@fluxhub/fluxhub-lib 11.0.39 → 11.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/fluxhub-fluxhub-lib.umd.js +9 -11
- package/bundles/fluxhub-fluxhub-lib.umd.js.map +1 -1
- package/bundles/fluxhub-fluxhub-lib.umd.min.js +1 -1
- package/bundles/fluxhub-fluxhub-lib.umd.min.js.map +1 -1
- package/esm2015/lib/controls/fhgrid.js +10 -12
- package/fesm2015/fluxhub-fluxhub-lib.js +9 -11
- package/fesm2015/fluxhub-fluxhub-lib.js.map +1 -1
- package/package.json +1 -1
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
15
|
***************************************************************************** */
|
|
16
|
-
var xt=function(t,e){return(xt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)};Object.create;function Ot(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,o,s=i.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}return a}function Et(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Ot(arguments[e]));return t}Object.create;var At=function(){function t(){this.checkType={NUMBER:function(t){return"number"==typeof t},BOOLEAN:function(t){return"boolean"==typeof t},STRING:function(t){return"string"==typeof t},DATE:function(t){return t instanceof Date},UNDEFINED:function(t){return void 0===t},NULL:function(t){return null===t},ARRAY:function(t){return t instanceof Array},MAP:function(t){return t instanceof Map},SET:function(t){return t instanceof Set},ITERABLE_OBJECT:function(t){return"[object Object]"===Object.prototype.toString.call(t)}},this.types={NUMBER:"NUMBER",BOOLEAN:"BOOLEAN",STRING:"STRING",NULL:"NULL",UNDEFINED:"UNDEFINED",DATE:"DATE",ARRAY:"ARRAY",MAP:"MAP",SET:"SET",ITERABLE_OBJECT:"ITERABLE_OBJECT",DEFAULT:"OBJECT"},this.iterableTypes="ITERABLE_OBJECT__MAP__ARRAY__SET",this.noop=function(){},this.checkEqualityForComplexTypes={DATE:function(t,e){return t.getTime()===e.getTime()}}}return t.prototype.getType=function(t){for(var e=Object.keys(this.checkType),i=this.types.DEFAULT,n=0;n<e.length;n+=1)if(this.checkType[e[n]](t)){i=e[n];break}return i},t.prototype.isTraversalNeeded=function(t,e){return t===e&&this.iterableTypes.indexOf(t)>=0},t.prototype.areEqual=function(t,e,i,n){return i===n&&(this.checkEqualityForComplexTypes[i]?this.checkEqualityForComplexTypes[i](t,e):t===e)},t.prototype.computeOp=function(t,e,i,n){var o=null;return i===this.types.UNDEFINED&&n!==this.types.UNDEFINED?o="add":i!==this.types.UNDEFINED&&n===this.types.UNDEFINED?o="delete":this.areEqual(t,e,i,n)?this.noop():o="update",o},t.prototype.getKeys=function(t,e,i){var n;return i===this.types.ITERABLE_OBJECT?n=new Set(Object.keys(t).concat(Object.keys(e))):i===this.types.ARRAY&&(n=(n=(n=t.length>e.length?new Array(t.length):new Array(e.length)).fill(0,0)).map((function(t,e){return e})),n=new Set(n)),n},t.prototype.makeDiff=function(t,e,i,n,o){var s={op:i,path:n,val:"",oldVal:""};return"add"!==i&&"update"!==i||(s.val=e),o&&"add"!==i&&(s.oldVal=t),s},t.prototype.get_diff=function(t,e,i,n,o){void 0===i&&(i=!1),void 0===n&&(n=[]),void 0===o&&(o=[]);var s=this.getType(t),a=this.getType(e),r=n||[],l=o||[];if(this.isTraversalNeeded(s,a))for(var p=this.getKeys(t,e,s).values(),u=p.next().value;null!=u;)this.get_diff(t[u],e[u],i,r.concat(u),l),u=p.next().value;else{var c=this.computeOp(t,e,s,a);null!=c&&l.push(this.makeDiff(t,e,c,n,i))}return l},t}(),Ct=function(){function t(t,e){this.app_s=t,this.titleService=e}return t.prototype.set_home_title=function(t){var e=this;setTimeout((function(){e.app_s.getState().topnavTitle=t,e.titleService.setTitle(t)}),100)},t.prototype.get_home_title=function(){return this.app_s.getState().topnavTitle},t.prototype.check_value_combo=function(t,e){return null!=e&&"-1"!=e?e:null!=t?t:e},t.prototype.gridDateRenderer=function(e){if(null==e.value)return" ------ ";if("null"==e.value)return" ------ ";var i=t.prototype.string2date(e.value,2);return null==i||1970==i.getFullYear()?" ------ ":t.prototype.pad(i.getDate(),2)+"/"+t.prototype.pad(i.getMonth()+1,2)+"/"+i.getFullYear()},t.prototype.gridDateStyle=function(t){return{"text-align":"center"}},t.prototype.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))},t.prototype.array_move=function(t,e,i){if(i>=t.length)for(var n=i-t.length+1;n--;)t.push(void 0);return t.splice(i,0,t.splice(e,1)[0]),t},t.prototype.format_currency=function(t,e,i,n,o){void 0===e&&(e=2),void 0===i&&(i=","),void 0===n&&(n="."),void 0===o&&(o="000000"),(t||"").toString().indexOf(",")>0&&(t=(t||"").toString().split(".").join("").split(",").join(".")),""==t&&(t="0");var s=Ot((t||"").toString().split("."),2),a=s[0],r=s[1],l=void 0===r?"":r;return l=e>0?i+(l+o).substring(0,e):"",(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,n))+l},t.prototype.number2bool=function(t){return null!=t&&1==t},t.prototype.bool2number=function(t){return null==t?0:t?1:0},t.prototype.round=function(t,e){return Math.round(t*Math.pow(10,e))/Math.pow(10,e)},t.prototype.string2date=function(t,e){if(null==t)return null;if(""==t)return null;if(1==e)return 10!=t.length||(n=t.split("-"))[0].length<4?null:new Date(parseInt(n[0]),parseInt(n[1])-1,parseInt(n[2]));if(2==e)return new Date(t);if((3==e||5==e)&&t.length>=16){var i=(t=t.substring(0,16)).split(" "),n=i[0].split("/");5==e&&(n=i[0].split("-"));var o=i[1].split(":");return n[0].length<4?null:new Date(parseInt(n[0]),parseInt(n[1])-1,parseInt(n[2]),parseInt(o[0]),parseInt(o[1]),0)}if(4==e){if(!t)return null;var s=t.split("/").map((function(t){return parseInt(t)}));return new Date(s[2],s[1]-1,s[0])}return 5==e&&t&&8==t.length?new Date(parseInt(t.substring(0,4)),parseInt(t.substring(4,2))-1,parseInt(t.substring(6,2))):null},t.prototype.sql_number=function(t){return null==t?"0":"it"==this.app_s.SQL_SERVER_LANG||"uk"==this.app_s.SQL_SERVER_LANG?String(t).replace(".",","):void 0},t.prototype.compare_date=function(t,e){return null!=t&&(null!=e&&(t.getDate()==t.getDate()&&t.getMonth()==e.getMonth()&&t.getFullYear()==e.getFullYear()))},t.prototype.sql_date=function(t){if(null==t)return"dbnull";if(void 0===t)return"dbnull";if("string"==typeof t&&(t=new Date(this.string2date(t,2))),1970==t.getFullYear())return"dbnull";var e=t.getMonth()+1,i=t.getDate();return"it"==this.app_s.SQL_SERVER_LANG?[(i>9?"":"0")+i,"-",(e>9?"":"0")+e,"-",t.getFullYear()].join(""):"uk"==this.app_s.SQL_SERVER_LANG?[t.getFullYear(),"-",(e>9?"":"0")+e,"-",(i>9?"":"0")+i].join(""):"Parametro SQL_SERVER_LANG non corretto"},t.prototype.sql_date_grid=function(t,e){if(void 0===e&&(e=""),null==t)return"dbnull";if(void 0===t)return"dbnull";if("string"==typeof t)return"dbnull";if(1970==t.getFullYear())return"dbnull";var i=t.getMonth()+1,n=t.getDate();return"CONVERT(DATETIME,'"+[t.getFullYear(),"-",(i>9?"":"0")+i,"-",(n>9?"":"0")+n].join("")+e+"',127)"},t.prototype.properCase=function(t){for(var e=t.toLowerCase().split(" "),i=0;i<e.length;i++)e[i]=e[i][0].toUpperCase()+e[i].slice(1);return e.join(" ")},t.prototype.DateAdd=function(t,e,i){var n,o=36e5,s=24*o,a=i.valueOf();switch(t){case"ms":n=new Date(a+1*e);break;case"s":n=new Date(a+1e3*e);break;case"mi":n=new Date(a+6e4*e);break;case"h":n=new Date(a+o*e);break;case"d":n=new Date(a+s*e);break;case"y":n=new Date(a+31536e6*e)}return n},t.prototype.date2String=function(t){if(null==t)return"";var e=t.getMonth()+1,i=t.getDate();return[(i>9?"":"0")+i,"/",(e>9?"":"0")+e,"/",t.getFullYear()].join("")},t.prototype.datetime2String=function(t){if(null==t)return"";var e=t.getMonth()+1,i=t.getDate(),n=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return[(i>9?"":"0")+i,"/",(e>9?"":"0")+e,"/",t.getFullYear()," ",(n>9?"":"0")+n,":",(o>9?"":"0")+o,":",(s>9?"":"0")+s].join("")},t.prototype.formatDecimal=function(t,e){void 0===e&&(e=2);var i=Ot((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=e>0?","+(s+"000000").substring(0,e):"",(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,"."))+s},t.prototype.left_pad=function(t,e,i){void 0===e&&(e=2),void 0===i&&(i="0");for(var n=t+"";n.length<e;)n=i+n;return n},t.prototype.datetime2GanttString=function(t){var e=t.getMonth()+1,i=t.getDate(),n=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return[t.getFullYear(),"-",(e>9?"":"0")+e,"-",(i>9?"":"0")+i,"T",(n>9?"":"0")+n,":",(o>9?"":"0")+o,":",(s>9?"":"0")+s].join("")},t.prototype.check2int=function(t){return t?1:0},t.prototype.setSelectionRange=function(t,e,i){if(t.setSelectionRange)t.focus(),t.setSelectionRange(e,i);else if(t.createTextRange){var n=t.createTextRange();n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",e),n.select()}},t.prototype.getBrowserName=function(){var t=window.navigator.userAgent.toLowerCase();switch(!0){case t.indexOf("edge")>-1:return"edge";case t.indexOf("opr")>-1&&!!window.opr:return"opera";case t.indexOf("chrome")>-1&&!!window.chrome:return"chrome";case t.indexOf("trident")>-1:return"ie";case t.indexOf("firefox")>-1:return"firefox";case t.indexOf("safari")>-1:return"safari";default:return"other"}},t.prototype.print_param=function(t){console.log("Tipologie -> "+String(t.types.length)),console.log("Valori -> "+String(t.values.length));for(var e=0;e<t.types.length;e++)console.log(t.types[e]+" "+String(t.values[e]))},t.prototype.get_diff_doc=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null);var i=[];if(null==t&&null==e)return i;for(var n=(new At).get_diff(t,e,!0),o=0;o<n.length;o++)n[o].path+""!="uiid"&&n[o].path+""!="id"&&i.push(n[o]);return i},t.prototype.getutcdate=function(t){var e=t.getTimezoneOffset();return t.setMinutes(t.getMinutes()+e),t},t.prototype.insert_log=function(t,e,i,n,o,s,a,r){void 0===s&&(s=null),void 0===a&&(a=null),void 0===r&&(r=null);var l=null;if(null!=a&&null!=r){for(var p in r)r.hasOwnProperty(p)&&r[p]instanceof Date&&(a[p]=new Date(a[p]));l=this.get_diff_doc(a,r)}var u=new vt;console.log("diff ",l),null!=l||null!=s?(u.sql="INSERT_LOG_N2",u.types=["string","string","string","string","string","string"],u.values=null!=l?[e,i,n,o,s,JSON.stringify(l)]:[e,i,n,o,s,null]):(u.sql="INSERT_LOG_N",u.types=["string","string","string","string"],u.values=[e,i,n,o]),t.doQuery(u).subscribe()},t.prototype.sql_date_time=function(t){if(null==t)return"dbnull";if(void 0===t)return"dbnull";if("string"==typeof t&&(t=new Date(this.string2date(t,2))),1970==t.getFullYear())return"dbnull";var e=t.getMonth()+1,i=t.getDate();return"it"==this.app_s.SQL_SERVER_LANG?[(i>9?"":"0")+i,"-",(e>9?"":"0")+e,"-",t.getFullYear()].join("")+" "+this.left_pad(t.getHours())+":"+this.left_pad(t.getMinutes())+":"+this.left_pad(t.getSeconds()):"uk"==this.app_s.SQL_SERVER_LANG?[t.getFullYear(),"-",(e>9?"":"0")+e,"-",(i>9?"":"0")+i].join("")+" "+this.left_pad(t.getHours())+":"+this.left_pad(t.getMinutes())+":"+this.left_pad(t.getSeconds()):"Parametro SQL_SERVER_LANG non corretto"},t.prototype.onlyDt=function(t){return null==t?null:new Date(t.getFullYear(),t.getMonth(),t.getDate())},t.prototype.descriMese=function(t){switch(t.getMonth()){case 0:return"Gennaio";case 1:return"Febbraio";case 2:return"Marzo";case 3:return"Aprile";case 4:return"Maggio";case 5:return"Giugno";case 6:return"Luglio";case 7:return"Agosto";case 8:return"Settembre";case 9:return"Ottobre";case 10:return"Novembre";case 11:return"Dicembre"}},t.prototype.addDays=function(t,e){return t.setDate(t.getDate()+e),t},t.prototype.toMoney=function(t,e,i,n){var o,s,a,r,l;return o=isNaN(e)?2:Math.abs(e),s=i||".",a=void 0===n?",":n,(t<0?"-":"")+((l=(l=(r=parseInt(t=Math.abs(t).toFixed(o))+"").length)>3?l%3:0)?r.substr(0,l)+a:"")+r.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+a)+(o?s+Math.abs(t-r).toFixed(o).slice(2):"")},t.prototype.format_euro=function(t){return this.toMoney(t,2,",",".")},t.prototype.pad=function(t,e){for(var i=t+"";i.length<e;)i="0"+i;return i},t.prototype.encrypt=function(t){for(var e="",i=0;i<t.length;i++){var n=1^t.charCodeAt(i);e+=String.fromCharCode(n)}return e},t.prototype.encrypt_v3=function(t){return s.AES.encrypt(t,"}?fhg7SP&^N4").toString()},t.prototype.decrypt_v3=function(t){return s.AES.decrypt(t,"}?fhg7SP&^N4").toString(s.enc.Utf8)},t.prototype.decrypt=function(t){for(var e="",i=0;i<t.length;i++){var n=1^t.charCodeAt(i);e+=String.fromCharCode(n)}return e},t.prototype.encrypt_v2=function(t){return(new o.SimpleCrypt).encode("prologika_fluxhub_etjda",t)},t.prototype.decrypt_v2=function(t){return(new o.SimpleCrypt).decode("prologika_fluxhub_etjda",t)},t.prototype.string_sqlvalue=function(t){return null==t?"":t.split("'").join("''")},t.prototype.hasRole=function(t,e){return void 0===e&&(e=!0),null!==this.app_s.user_roles&&(!(!e||null==this.app_s.user_isadmin||"1"!=this.app_s.user_isadmin)||this.app_s.user_roles.toUpperCase().indexOf(t.toLocaleUpperCase())>-1)},t}();Ct.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new Ct(n.ɵɵinject(wt),n.ɵɵinject(a.Title))},token:Ct,providedIn:"root"}),Ct.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],Ct.ctorParameters=function(){return[{type:wt},{type:a.Title}]};var kt=function(){},Tt=function(){function t(t,e,i){this.http=t,this.app_s=e,this.toastr=i,this.url=this.app_s.API_ENDPOINT+this.app_s.FILE_ENDPOINT}return t.prototype.doQuery=function(t,e){var i=this;void 0===e&&(e=!0),this.headers=new r.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=this.app_s.API_ENDPOINT+this.app_s.FILE_ENDPOINT;var n=JSON.stringify(t);return this.http.post(this.url,n,{headers:this.headers}).pipe(l.map((function(t){var n,o=t;if(t?"KO"===o.result_msg&&(n=new Error(o.msg)):n=new Error("Empty server response"),n)throw console.error(n),e&&i.toastr.error(n.message),new Error(n);return t||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t}();Tt.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new Tt(n.ɵɵinject(r.HttpClient),n.ɵɵinject(wt),n.ɵɵinject(i.ToastrService))},token:Tt,providedIn:"root"}),Tt.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],Tt.ctorParameters=function(){return[{type:r.HttpClient},{type:wt},{type:i.ToastrService}]};var Dt=function(){function t(t,e,i,n){this.http=t,this.toastr=e,this.app_s=i,this.uti_s=n,this.url=this.app_s.API_ENDPOINT+this.app_s.QUERY_ENDPOINT}return t.prototype.doQuery=function(t,e,i){var n=this;if(void 0===e&&(e=!0),void 0===i&&(i=null),null!=localStorage.getItem(this.app_s.COMPANY_KEY+"token")){if(this.headers=new r.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=null==i?this.app_s.API_ENDPOINT+this.app_s.QUERY_ENDPOINT:i,null!=t.types&&-1==t.sql.indexOf("_MULTI"))for(var o=0;o<t.types.length;o++)null==t.values[o]?t.values[o]="dbnull":("boolean"==t.types[o]&&(t.values[o]?t.values[o]="1":t.values[o]="0"),"int"==t.types[o]&&(t.values[o]+""==""?t.values[o]="dbnull":isNaN(t.values[o])?t.values[o]="0":t.values[o]=""+t.values[o]),"string"==t.types[o]&&(t.values[o]=""+t.values[o]),"date"==t.types[o]&&(t.values[o]=this.uti_s.sql_date(t.values[o]),"NaN-NaN-NaN"==t.values[o].split("0").join("")&&(t.values[o]="dbnull")),"datetime"==t.types[o]&&(t.values[o]=this.uti_s.sql_date_time(t.values[o]),"NaN-NaN-NaN NaN:NaN"==t.values[o].split("0").join("")&&(t.values[o]="dbnull")),"string"==t.types[o]&&null==t.values[o]&&(t.values[o]="dbnull"),"decimal"==t.types[o]&&(t.values[o]+""==""?t.values[o]="dbnull":isNaN(t.values[o])?t.values[o]="0":t.values[o]=""+t.values[o]));var s=JSON.stringify(t);return this.http.post(this.url,s,{headers:this.headers}).pipe(l.map((function(i){var o;if(i?"KO"===i.result_msg&&(o=new Error(i.msg)):o=new Error("Empty server response"),o)throw console.error(o),e&&n.toastr.error(t.sql+" "+o.message),new Error(o);return i||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))}console.log("token non online")},t}();Dt.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new Dt(n.ɵɵinject(r.HttpClient),n.ɵɵinject(i.ToastrService),n.ɵɵinject(wt),n.ɵɵinject(Ct))},token:Dt,providedIn:"root"}),Dt.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],Dt.ctorParameters=function(){return[{type:r.HttpClient},{type:i.ToastrService},{type:wt},{type:Ct}]};var Lt=function(){function t(t,e,i,n){var o=this;this.dialogRef=t,this._fileservice=e,this.m_appService=i,this.data=n,this.allegati=[],this.App="",this.K="",this.email_obj={},this.title="ANTEPRIMA EMAIL",this.web_url="",this.local_dir="",this.ant_preview="";var s=new gt;s.command="exec_app",s.p1="Email_Reader_S3",s.p2=n.local_dir+"|"+n.uiid,this._fileservice.doQuery(s).subscribe((function(t){o.email_obj=JSON.parse(t.msg),o.allegati=o.email_obj.allegati.split("||")}))}return t.prototype.init_w=function(){},t.prototype.open_all=function(t){window.open(this.email_obj.ant_preview+t)},t}();Lt.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="dialogRef.close(null)" /> </div><br>\n <div style="width:100%;overflow:auto;" [style.height]="(m_appService.getState().body_h-240)+\'px\'">\n <mat-toolbar color="primary">{{title | translate}}\n <span class="fill-remaining-space"></span>\n\n </mat-toolbar>\n <br>\n\n <div style="width:100%;height:500px">\n <div style="width:100%;height:100%">\n <div fxLayout="column">\n\n <div fxLayout="row">\n <div style="width:100px">Data:</div>\n <div>{{email_obj.dt}}</div>\n </div>\n <div fxLayout="row">\n <div style="width:100px">From:</div>\n <div [innerHTML]="email_obj.from" ></div>\n </div>\n <div fxLayout="row">\n <div style="width:100px">To:</div>\n <div [innerHTML]="email_obj.to" ></div>\n </div>\n <div fxLayout="row">\n <div style="width:100px">CC:</div>\n <div [innerHTML]="email_obj.cc" ></div>\n </div>\n <div fxLayout="row">\n <div style="width:100px">Subject:</div>\n <div [innerHTML]="email_obj.subject" ></div>\n </div>\n <div style="width:100px">Body:</div>\n <div style="overflow:auto;" [style.height]="(m_appService.getState().body_h-490)+\'px\'">\n <div fxLayout="row" [hidden]="email_obj.is_html==\'NO\'">\n\n <div [innerHTML]="email_obj.body" ></div>\n </div>\n <div fxLayout="row" [hidden]="email_obj.is_html==\'SI\'">\n\n <div>{{email_obj.body}}</div>\n </div>\n </div>\n <hr style="width:100%">\n <div fxLayout="row" fxLayoutGap="10px">\n <div style="width:100px">Allegati:</div>\n <div *ngFor="let u of allegati" >\n <button mat-flat-button color="primary" (click)="open_all(u)">{{u}}</button>\n </div>\n\n\n\n </div>\n\n\n </div>\n </div>\n </div>\n '}]}],Lt.ctorParameters=function(){return[{type:e.MatDialogRef},{type:Tt},{type:wt},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var Rt=function(){function t(t,e,i,o,s,a,r){this._appservice=t,this._dataService=e,this.toastr=i,this.dialog=o,this.fileService=s,this.uti=a,this.tsr=r,this.enabled=!0,this.force_en=!1,this.dt_scadenza=!1,this.label="",this.sovrascrivi_path="",this.ruolo_supervisore="[ZZZ_DIS_CC]",this.access_control=!1,this.show_images=!0,this.can_delete_owner=!0,this.b_initt=!1,this.change=new n.EventEmitter,this.call_upload=new n.EventEmitter,this.init_end=new n.EventEmitter,this.fill_end=new n.EventEmitter,this.image_mode=!1,this.App="",this.K="",this.image_type=!1,this.b_edit_loaded=!1,this.b_False=!1,this.b_mobile=!1,this.b_ini=!1,this.m_p_tipo="",this.multi_list=!1,this.m_programma_da_eseguire="",this.m_p_cod_doc="",this.m_p_section="",this.m_p_system_type=""}return t.prototype.call_up=function(t){this.call_upload.emit({App:this.App,K:this.K,descrizione:t.descrizione,single:!1,username:this._appservice.user,cod_doc:this.m_p_cod_doc,section:this.m_p_section,local_path:this._appservice.LOCAL_PATH,p1:this.m_programma_da_eseguire})},t.prototype.download_all=function(t){var e=this,i=new gt;i.command="exec_app",i.p1="s3_downloader",i.p2=t.uiid+"|"+this._appservice.user,this.fileService.doQuery(i).subscribe((function(t){if(null!=t&&"OK"==t.result_msg){var i=t.msg.split("|");"OK"==i[0]?window.open(i[1]):e.toastr.error(i[1].split("|").join(" -> "))}}))},t.prototype.preview_email=function(t){this.dialog.open(Lt,{data:{uiid:t.uiid,local_dir:this._appservice.user},width:"95%"}).afterClosed().subscribe((function(t){}))},t.prototype.edit_tipo=function(t){var e=this,i=new vt;i.sql=this.m_p_tipo,i.types=[],i.values=[],this._dataService.doQuery(i).subscribe((function(i){if(null!=i&&"OK"==i.result_msg){var n=e.dialog.open(yt);setTimeout((function(){n.componentInstance.set_selection(e.tsr.instant("Tipologia Allegato"),i.result_data)})),n.afterClosed().subscribe((function(i){if(null!=i){var n=new vt;n.sql="UPDATE_ALLEGATI_TIPO",n.types=["int","string"],n.values=[t.id,i.descrizione_valore],e._dataService.doQuery(n).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.ref_allegato()}))}}))}}))},t.prototype.edit_descri=function(t){var e=this,i=this.dialog.open(bt);setTimeout((function(){i.componentInstance.label=e.tsr.instant("Descrizione Allegato"),i.componentInstance.valore=t.description,i.componentInstance.min_chars=0})),i.afterClosed().subscribe((function(i){if(null!=i){var n=new vt;n.sql="UPDATE_ALLEGATI_DESCRIZIONE_NEW",n.types=["string","string"],n.values=[t.uiid,i],e._dataService.doQuery(n).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.ref_allegato()}))}}))},t.prototype.delete=function(t){var e=this;localStorage.setItem(this._appservice.COMPANY_KEY+"title_dialog",this.tsr.instant("Conferma Operazione")),localStorage.setItem(this._appservice.COMPANY_KEY+"msg_dialog",this.tsr.instant("Confermi l'eliminazione dell'elemento?")),this.dialog.open(It).afterClosed().subscribe((function(i){if(i){var n=new vt;n.sql="DELETE_ALLEGATO_NEW",n.types=["string"],n.values=[t.uiid],e._dataService.doQuery(n).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(e.ref_allegato(),e.toastr.info("INFO",e.tsr.instant("ALLEGATO ELIMINATO"),{timeOut:1e3,progressBar:!0}))}))}}))},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.init_end.emit()}))},t.prototype.init_upload=function(){var t=this;null!=this.upc?(this.upc.single=!1,this.b_mobile=this._appservice.getState().pageFullscreen,this.force_en?this.upc.init(this.App,this.K,this.m_p_cod_doc,this.m_p_section,"Attachment Description",this.m_p_system_type,this.m_programma_da_eseguire):this.upc.init(this.App,this.K,this.m_p_cod_doc,this.m_p_section,this.tsr.instant("Descrizione Allegato"),this.m_p_system_type,this.m_programma_da_eseguire),this.b_initt=!0,this.ref_allegato()):setTimeout((function(){t.init_upload()}),500)},t.prototype.init=function(t,e,i,n,o,s){void 0===s&&(s=""),this.App=t,this.K=e,this.b_ini=!0,this.b_edit_loaded=!1,this.m_p_cod_doc=i,this.m_p_section=n,this.m_p_system_type=o,this.m_programma_da_eseguire=s,this.init_upload()},t.prototype.ref_allegato=function(){var t=this;if(null!=this.App&&""!=this.App){this.image_mode=!1;var e=new vt;e.sql="SELECT_ALLEGATO_INFO_NEW",e.types=["string","string","string"],e.values=[this.App,this.K,this.m_p_section],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.arr_g=e.result_data,t.arr_g.map((function(e){"IMG"==e.type&&(t.image_mode=!0)}));for(var i="webinfo",n=0;n<t.arr_g.length;n++){null!=t.arr_g[n].APP&&(t.arr_g[n].App=t.arr_g[n].APP),null!=t.arr_g[n].description?t.arr_g[n].descrizione_vis=t.arr_g[n].description.split("\n").join("<br>"):t.arr_g[n].descrizione_vis="";var o=t.arr_g[n].file_name_orig.split("."),s=t.arr_g[n].repo_params.split("|");if(t.arr_g[n].url=s[3]+"/"+s[2]+"/"+t.App+"/"+t.m_p_cod_doc+"/"+t.m_p_section+"/"+t.arr_g[n].dir+"/F_"+t.arr_g[n].uiid,t.arr_g[n].url_orig=s[3]+"/"+s[2]+"/"+t.App+"/"+t.m_p_cod_doc+"/"+t.m_p_section+"/"+t.arr_g[n].dir+"/F_"+t.arr_g[n].uiid,-1!="3G2|3GA|3GP|7Z|AA|AAC|AC|ACCDB|ACCDT|ADN|AI|AIF|AIFC|AIFF|AIT|AMR|ANI|APK|APP|APPLESCRIPT|ASAX|ASC|ASCX|ASF|ASH|ASHX|ASMX|ASP|ASPX|ASX|AU|AUP|AVI|AXD|AZE|BAK|BASH|BAT|BIN|BLANK|BMP|BOWERRC|BPG|BROWSER|BZ2|C|CAB|CAD|CAF|CAL|CD|CER|CFG|CFM|CFML|CGI|CLASS|CMD|CODEKIT|COFFEE|COFFEELINTIGNORE|COM|COMPILE|CONF|CONFIG|CPP|CPTX|CR2|CRDOWNLOAD|CRT|CRYPT|CS|CSH|CSON|CSPROJ|CSS|CSV|CUE|DAT|DB|DBF|DEB|DGN|DIST|DIZ|DLL|DMG|DNG|DOC|DOCB|DOCM|DOCX|DOT|DOTM|DOTX|DOWNLOAD|DPJ|DS_STORE|DTD|DWG|DXF|EDITORCONFIG|EL|ENC|EOT|EPS|EPUB|ESLINTIGNORE|EXE|F4V|FAX|FB2|FLA|FLAC|FLV|FOLDER|GADGET|GDP|GEM|GIF|GITATTRIBUTES|GITIGNORE|GO|GPG|GZ|H|HANDLEBARS|HBS|HEIC|HS|HSL|HTM|HTML|IBOOKS|ICNS|ICO|ICS|IDX|IFF|IFO|IMAGE|IMG|IN|INDD|INF|INI|ISO|J2|JAR|JAVA|JPE|JPEG|JPG|JS|JSON|JSP|JSX|KEY|KF8|KMK|KSH|KUP|LESS|LEX|LICX|LISP|LIT|LNK|LOCK|LOG|LUA|M|M2V|M3U|M3U8|M4|M4A|M4R|M4V|MAP|MASTER|MC|MD|MDB|MDF|ME|MI|MID|MIDI|MK|MKV|MM|MO|MOBI|MOD|MOV|MP2|MP3|MP4|MPA|MPD|MPE|MPEG|MPG|MPGA|MPP|MPT|MSI|MSU|NEF|NES|NFO|NIX|NPMIGNORE|ODB|ODS|ODT|OGG|OGV|OST|OTF|OTT|OVA|OVF|P12|P7B|PAGES|PART|PCD|PDB|PDF|PEM|PFX|PGP|PH|PHAR|PHP|PKG|PL|PLIST|PM|PNG|PO|POM|POT|POTX|PPS|PPSX|PPT|PPTM|PPTX|PROP|PS|PS1|PSD|PSP|PST|PUB|PY|PYC|QT|RA|RAM|RAR|RAW|RB|RDF|RESX|RETRY|RM|ROM|RPM|RSA|RSS|RTF|RU|RUB|SASS|SCSS|SDF|SED|SH|SITEMAP|SKIN|SLDM|SLDX|SLN|SOL|SQL|SQLITE|STEP|STL|SVG|SWD|SWF|SWIFT|SYS|TAR|TCSH|TEX|TFIGNORE|TGA|TGZ|TIF|TIFF|TMP|TORRENT|TS|TSV|TTF|TWIG|TXT|UDF|VB|VBPROJ|VBS|VCD|VCS|VDI|VDX|VMDK|VOB|VSCODEIGNORE|VSD|VSS|VST|VSX|VTX|WAR|WAV|WBK|WEBINFO|WEBM|WEBP|WMA|WMF|WMV|WOFF|WOFF2|WPS|WSF|XAML|XCF|XLM|XLS|XLSM|XLSX|XLT|XLTM|XLTX|XML|XPI|XPS|XRB|XSD|XSL|XSPF|XZ|YAML|YML|Z|ZIP|ZSH".indexOf(o[o.length-1].toLocaleUpperCase())&&(i=o[o.length-1].toLocaleLowerCase()),t.arr_g[n].icon=i+".svg",t.can_delete_owner?(t.arr_g[n].can_delete=!t.access_control||t.arr_g[n].idp==t._appservice.user||t.uti.hasRole(t.ruolo_supervisore),"[ZZZ_DIS_CC]"==t.ruolo_supervisore?t.arr_g[n].can_delete_m=t.arr_g[n].idp:t.arr_g[n].can_delete_m=t.arr_g[n].idp+",["+t.ruolo_supervisore+"]"):(t.arr_g[n].can_delete=!t.access_control||t.uti.hasRole(t.ruolo_supervisore),"[ZZZ_DIS_CC]"==t.ruolo_supervisore?t.arr_g[n].can_delete_m="":t.arr_g[n].can_delete_m="["+t.ruolo_supervisore+"]"),t.arr_g[n].can_edit=!t.access_control||t.arr_g[n].idp==t._appservice.user||t.uti.hasRole(t.ruolo_supervisore),-1==t.arr_g[n].file_name_orig.indexOf(".jpg")&&-1==t.arr_g[n].file_name_orig.indexOf(".gif")&&-1==t.arr_g[n].file_name_orig.indexOf(".png")||!t.show_images)t.arr_g[n].type="O";else{if(t.arr_g[n].type="IMG",t.arr_g[n].image_original=[t.arr_g[n].url],null!=t.arr_g[n].preview&&1==t.arr_g[n].preview){var a=t.arr_g[n].url.split("."),r=a.pop();t.arr_g[n].url=a.join(".")+"_preview."+r}t.image_type=!0,t.arr_g[n].image_thumbnail=[t.arr_g[n].url]}}t.fill_end.emit()}}))}},t}();Rt.decorators=[{type:n.Component,args:[{selector:"FHUploadPanelS3",template:'\n\n <div fxLayout="column">\n <h3 *ngIf="label != \'\'">{{ label }}</h3>\n <div fxLayout="column">\n <div [hidden]="!enabled">\n\n <FHUploadS3\n [single]="b_False"\n [label_attendere]="\n force_en ? \'UPLOADING\' : \'ATTENDERE UPLOAD IN CORSO\' | translate\n "\n [fixed_label]="\n force_en\n ? \' (insert the description here before uploading the file)\'\n : \' (INSERISCI QUI LA DESCRIZIONE PRIMA DI CARICARE IL FILE)\' | translate\n "\n [allegato_inserito]="\n force_en ? \'Attachment Inserted\' : \'ALLEGATO INSERITO\' | translate\n "\n [lista_allegati]="arr_g"\n (change)="ref_allegato()"\n (call_upload)="call_up($event)"\n #upc\n ></FHUploadS3>\n </div>\n <table width="98%" class="fh_table" *ngIf="!image_type && !b_mobile">\n <thead>\n <tr class="header">\n <th style="width:40px"></th>\n <th style="width:50%">{{ force_en ? "Name" : "Nome" }}</th>\n <th style="width:60px;text-align:center">Dim.</th>\n <th style="width:40%">\n {{ force_en ? "Description" : "Descrizione" }}\n </th>\n <th style="width:20%">\n {{ force_en ? "Version" : "Versione" }}\n </th>\n\n <th *ngIf="image_mode" class="actions"></th>\n <th style="width:30%">{{ force_en ? "User" : "Utente" }}</th>\n <th style="width:240px;text-align:center">\n {{ force_en ? "Date" : "Data" }}\n </th>\n <th style="width:40px" class="actions"></th>\n <th *ngIf="enabled" style="width:40px" class="actions"></th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="let app of arr_g; let odd = odd; let even = even"\n style="font-size: 15px;"\n [ngClass]="{ odd: odd, even: even }"\n >\n <td\n style="text-align:center;vertical-align: middle;width:36px;height:36px;"\n >\n <div\n style="text-align:center;vertical-align: middle;width:28px;height:28px;"\n >\n <img\n src="assets/icons/square-o/{{ app.icon }}"\n style="width:28px;height:28px;"\n />\n </div>\n </td>\n <td>{{ app.file_name_orig }}</td>\n <td style="text-align:center">{{ app.dim }}</td>\n <td>\n <div fxLayout="row">\n <div *ngIf="enabled">\n <a\n mat-icon-button\n matTooltip="Modifica Descrizione"\n *ngIf="app.can_edit"\n (click)="edit_descri(app)"\n >\n <mat-icon>edit</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]="\n \'Modifica Descrizione consentita solo a: \' + app.nc\n "\n *ngIf="!app.can_edit"\n [disabled]="true"\n >\n <mat-icon>edit</mat-icon>\n </a>\n </div>\n <div\n [innerHTML]="app.descrizione_vis"\n style="width:100%"\n ></div>\n </div>\n </td>\n\n <td>\n {{app.version}}\n </td>\n\n <td *ngIf="image_mode"\n style="min-width:400px;min-height: 400px"\n\n >\n <fh-image-viewer [u]="app"></fh-image-viewer>\n </td>\n\n <td>{{ app.nc }}</td>\n <td style="text-align:center">\n {{ app.dt_ins | date: "dd/MM/yyyy HH:mm:ss" }}\n </td>\n <td style="text-align:center">\n\n <button [hidden]="app.file_name_orig.indexOf(\'.eml\')==-1 && app.file_name_orig.indexOf(\'.msg\')==-1"\n mat-icon-button\n matTooltip="Preview"\n (click)="preview_email(app)"\n >\n <mat-icon>visibility</mat-icon>\n </button>\n <button\n mat-icon-button\n matTooltip="Download File"\n (click)="download_all(app)"\n >\n <mat-icon>cloud_download</mat-icon>\n </button>\n </td>\n\n <td *ngIf="enabled" style="text-align:center">\n <a\n mat-icon-button\n matTooltip="Elimina File"\n *ngIf="app.can_delete"\n (click)="delete(app)"\n >\n <mat-icon>delete</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]="\n \'Cancellazione consentita solo a: \' + app.can_delete_m\n "\n *ngIf="!app.can_delete"\n [disabled]="true"\n >\n <mat-icon>delete</mat-icon>\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n <table width="98%" class="fh_table" *ngIf="image_type && !b_mobile">\n <thead>\n <tr class="header">\n <th style="width:40px"></th>\n <th style="width:50%">{{ force_en ? "Name" : "Nome" }}</th>\n <th style="width:60px;text-align:center">Dim.</th>\n\n <th style="width:20%">\n {{ force_en ? "Description" : "Descrizione" }}\n </th>\n <th style="width:10%">\n {{ force_en ? "Version" : "Versione" }}\n </th>\n <th style="width:40%"></th>\n\n <th style="width:10%">{{ force_en ? "User" : "Utente" }}</th>\n <th style="width:240px;text-align:center">\n {{ force_en ? "Date" : "Data" }}\n </th>\n <th style="width:40px" class="actions"></th>\n <th *ngIf="enabled" style="width:40px" class="actions"></th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="let app of arr_g; let odd = odd; let even = even"\n style="font-size: 15px;"\n [ngClass]="{ odd: odd, even: even }"\n >\n <td\n style="text-align:center;vertical-align: middle;width:36px;height:36px;"\n >\n <div\n style="text-align:center;vertical-align: middle;width:28px;height:28px;"\n >\n <img\n src="assets/icons/square-o/{{ app.icon }}"\n style="width:28px;height:28px;"\n />\n </div>\n </td>\n\n <td>{{ app.file_name_orig }}</td>\n <td style="text-align:center">{{ app.dim }}</td>\n <td>\n <div fxLayout="row">\n <div *ngIf="enabled">\n <a\n mat-icon-button\n matTooltip="Modifica Descrizione"\n *ngIf="app.can_edit"\n (click)="edit_descri(app)"\n >\n <mat-icon>edit</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]="\n \'Modifica Descrizione consentita solo a: \' + app.nc\n "\n *ngIf="!app.can_edit"\n [disabled]="true"\n >\n <mat-icon>edit</mat-icon>\n </a>\n </div>\n <div\n [innerHTML]="app.descrizione_vis"\n style="width:100%"\n ></div>\n </div>\n </td>\n <td>\n {{app.version}}\n </td>\n\n <td\n style="min-width:400px;min-height: 400px"\n *ngIf="app.type == \'IMG\'"\n >\n <fh-image-viewer [u]="app"></fh-image-viewer>\n </td>\n <td *ngIf="app.type != \'IMG\'"></td>\n <td>{{ app.nc }}</td>\n <td style="text-align:center">\n {{ app.dt_ins | date: "dd/MM/yyyy HH:mm:ss" }}\n </td>\n <td style="text-align:center">\n\n <button [hidden]="app.file_name_orig.indexOf(\'.eml\')==-1 && app.file_name_orig.indexOf(\'.msg\')==-1"\n mat-icon-button\n matTooltip="Preview"\n (click)="preview_email(app)"\n >\n <mat-icon>visibility</mat-icon>\n </button>\n <button\n mat-icon-button\n matTooltip="Download File"\n (click)="download_all(app)"\n >\n <mat-icon>cloud_download</mat-icon>\n </button>\n </td>\n\n <td *ngIf="enabled" style="text-align:center">\n <a\n mat-icon-button\n matTooltip="Elimina File"\n *ngIf="app.can_delete"\n (click)="delete(app)"\n >\n <mat-icon>delete</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]="\n \'Cancellazione consentita solo a: \' + app.can_delete_m\n "\n *ngIf="!app.can_delete"\n [disabled]="true"\n >\n <mat-icon>delete</mat-icon>\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n <table width="98%" class="fh_table" *ngIf="b_mobile">\n <tbody>\n <tr\n *ngFor="let app of arr_g; let odd = odd; let even = even"\n style="font-size: 15px;"\n [ngClass]="{ odd: odd, even: even }"\n >\n <td\n style="text-align:center;vertical-align: middle;width:36px;height:36px;"\n >\n <div\n style="text-align:center;vertical-align: middle;width:28px;height:28px;"\n >\n <img\n src="assets/icons/square-o/{{ app.icon }}"\n style="width:28px;height:28px;"\n />\n </div>\n </td>\n <td *ngIf="b_mobile" style="text-align:center">\n {{ app.file_name_orig }}<br /><br />\n <button\n style="background-color: #F5F5F5"\n (click)="download_all(app)"\n mat-flat-button\n >\n DOWNLOAD\n </button>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div *ngIf="!b_ini && b_initt" style="color:#ff0000">\n\n </div>\n ',styles:[""]}]}],Rt.ctorParameters=function(){return[{type:wt},{type:Dt},{type:i.ToastrService},{type:e.MatDialog},{type:Tt},{type:Ct},{type:p.TranslateService}]},Rt.propDecorators={enabled:[{type:n.Input}],force_en:[{type:n.Input}],dt_scadenza:[{type:n.Input}],label:[{type:n.Input}],sovrascrivi_path:[{type:n.Input}],ruolo_supervisore:[{type:n.Input}],access_control:[{type:n.Input}],show_images:[{type:n.Input}],can_delete_owner:[{type:n.Input}],change:[{type:n.Output}],call_upload:[{type:n.Output}],init_end:[{type:n.Output}],fill_end:[{type:n.Output}],upc:[{type:n.ViewChild,args:["upc"]}]};var Nt=function(){function t(t,e){this.dialogRef=t,this.data=e,this.label="",this.progress_p=0,null!=e&&(null!=e.label&&(this.label=e.label),null!=e.progress_p&&(this.progress_p=e.progress_p))}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.update_progess=function(t){this.progress_p=t,100==t&&this.dialogRef.close()},t.prototype.ngAfterViewInit=function(){},t}();Nt.decorators=[{type:n.Component,args:[{selector:"fhfh_win_wait",template:'\n <h2 mat-dialog-title>\n {{ label | uppercase }}\n </h2>\n <mat-dialog-content style="min-width:700px">\n <mat-progress-bar\n style="height:50px"\n color="accent"\n mode="determinate"\n value="{{ progress_p }}"\n ></mat-progress-bar>\n </mat-dialog-content>\n '}]}],Nt.ctorParameters=function(){return[{type:e.MatDialogRef},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Nt.propDecorators={cmb_sel:[{type:n.ViewChild,args:["cmb_sel"]}]};var Ft=function(){function t(t,e,i,o,s,a){var r=this;this._dataService=t,this.toastr=e,this.dialog=i,this.app_s=o,this.uti=s,this._trs=a,this.show_descri=!0,this.enabled=!0,this.single=!0,this.descri_obb=!1,this.programma_da_eseguire="",this.label_attendere="ATTENDERE UPLOAD IN CORSO",this.fixed_label=" (INSERISCI QUI LA DESCRIZIONE PRIMA DI CARICARE IL FILE)",this.limit_string="Il file di <size>MB supera il limite di 1GB",this.allegato_inserito="ALLEGATO INSERITO",this.inserire_descrizione="Descrizione Obbligatoria",this.lista_allegati=[],this.change=new n.EventEmitter,this.upload_ended=new n.EventEmitter,this.call_upload=new n.EventEmitter,this.hasBaseDropZoneOver=!1,this.hasAnotherDropZoneOver=!1,this.lascia_il_file="Lascia il file per confermarmare upload",this.trascina_il_file="Trascina un file qui o Clicca per avviare upload",this.multi_list=!1,this.allow_delete=!1,this.loading=!1,this.App="",this.K="",this.label_b="",this.descrizione="",this.file_name="",this.label="",this.username="",this.b_edit_loaded=!1,this.tipo="",this.b_ini=!1,this.uploader=new u.FileUploader({url:this.app_s.API_ENDPOINT+this.app_s.UPLOAD_ENDPOINT+"_new",maxFileSize:1048576e3}),this.id_component="",this.last_result={},this.id=null,this.p_cod_doc="",this.p_section="",this.p_system_type="",this.id_component=this.uti.newGuid(),this.username=this.app_s.user,this.uploader.onBeforeUploadItem=function(t){t.withCredentials=!1},console.log("uploader ",this.app_s.API_ENDPOINT+this.app_s.UPLOAD_ENDPOINT+"_new"),this.uploader.onCompleteItem=function(t,e,i,n){200===i&&(r.descrizione="",r.toastr.info("INFO",r.allegato_inserito,{timeOut:1e3,progressBar:!0}),r.ref_allegato(),r.last_result={item:t,response:e,status:i,header:n},r.change.emit(r.last_result))}}return t.prototype.onFileDrop=function(t){},t.prototype.fileOverBase=function(t){console.log(t),this.hasBaseDropZoneOver=t},t.prototype.call_up=function(){this.call_upload.emit({App:this.App,K:this.K,descrizione:this.descrizione,single:!1,username:this.app_s.user,tipo:this.tipo,local_path:this.app_s.LOCAL_PATH,p1:this.programma_da_eseguire})},t.prototype.del_doc=function(){var t=this;localStorage.setItem(this.app_s.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.app_s.COMPANY_KEY+"msg_dialog",this._trs.instant("Confermi l'eliminazione dell'elemento?")),this.dialog.open(It).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="DELETE_ALLEGATO",i.types=["int","string"],i.values=[t.id,t.app_s.user];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.ref_allegato(),t.toastr.info("INFO","ALLEGATO ELIMINATO",{timeOut:1e3,progressBar:!0}))}),(function(t){}))}}))},t.prototype.load_types=function(){var t=this;null!=this.cmb_tipo&&""!=this.tipo?(this.cmb_tipo.sql=this.tipo,this.cmb_tipo.fillCombo()):setTimeout((function(){t.load_types()}),200)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){var e={};e.headers=[{name:"Authorization",value:"Bearer "+localStorage.getItem(t.app_s.COMPANY_KEY+"token")}],t.uploader.setOptions(e),t.uploader.onCompleteAll=function(){t.loading=!1,t.upload_ended.emit(t.last_result),null!=t.dialogRef&&null!=t.dialogRef.componentInstance&&(t.dialogRef.componentInstance.update_progess(100),t.dialogRef=null)},t.uploader.onErrorItem=function(e,i,n,o){t.toastr.error(i)},t.uploader.onAfterAddingFile=function(e){t.ch(e)},t.uploader.onProgressItem=function(e,i){t.loading=!0,null!=t.dialogRef&&null!=t.dialogRef.componentInstance&&t.dialogRef.componentInstance.update_progess(i)},t.uploader.onWhenAddingFileFailed=function(e,i,n){switch(i.name){case"fileSize":var o=Math.round(e.size/1024/1024);t.toastr.error(t._trs.instant(t.limit_string.split("<size>").join(""+o)));break;default:t.toastr.error("Errore: "+i.name)}}}))},t.prototype.download_all=function(){window.open(this.app_s.COMPANY_SITE_ROOT+"/uploads/"+this.App+"/"+this.K+"/"+this.file_name)},t.prototype.ch=function(t){var e=this;this.descri_obb&&""==this.descrizione?this.toastr.error(this.inserire_descrizione):(this.uploader.onBuildItemForm=function(t,i){i.append("App",e.App),i.append("K",e.K),i.append("descrizione",e.descrizione),i.append("single",e.single),i.append("username",e.username),i.append("system_type",e.p_system_type),i.append("uiid",e.uti.newGuid()),i.append("doc_number",e.p_cod_doc),i.append("repo_uiid","S3"),i.append("parent_doc_type",e.App),i.append("parent_doc_rif",e.p_cod_doc),i.append("parent_doc_uiid",e.K),i.append("parent_doc_section",e.p_section),i.append("version",1),i.append("status","PUBLISHED"),i.append("p_owner",e.app_s.user),i.append("tipo",""),i.append("local_path",e.app_s.LOCAL_PATH),""!=e.programma_da_eseguire&&i.append("p1",e.programma_da_eseguire)},null==this.dialogRef&&(this.dialogRef=this.dialog.open(Nt,{disableClose:!0}),setTimeout((function(){e.dialogRef.componentInstance.label=e._trs.instant(e.label_attendere)})),this.dialogRef.afterClosed().subscribe((function(t){}))),this.uploader.uploadAll())},t.prototype.init=function(t,e,i,n,o,s,a,r){void 0===a&&(a=""),void 0===r&&(r=!1),this.App=t,this.K=e,this.label=o,this.p_cod_doc=i,this.p_section=n,this.p_system_type=s,this.b_ini=!0,this.b_edit_loaded=!1,this.descrizione="",this.programma_da_eseguire=a,this.allow_delete=r,this.ref_allegato(),this.tipo.indexOf("SELECT_")>-1&&(this.multi_list=!0,this.load_types())},t.prototype.ref_allegato=function(){var t=this;if(this.id=null,this.descrizione="",this.file_name="",this.label_b="",this.cmb_tipo.resetValue(),this.single&&null!=this.App&&""!=this.App){var e=new vt;e.sql="SELECT_ALLEGATO_INFO_NEW",e.types=["string","string"],e.values=[this.App,this.K],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;i.length>0&&(t.id=i[0].id,t.descrizione=i[0].descrizione,t.file_name=i[0].file_name_orig,t.label_b=i[0].file_name_orig+" - "+i[0].dim,t.b_edit_loaded=!0)}}))}},t}();Ft.decorators=[{type:n.Component,args:[{selector:"FHUploadS3",template:'\n <div *ngIf="loading" fxLayout="row">\n WAIT\n </div>\n <div\n [hidden]="!(enabled && !loading)"\n fxLayout="row"\n fxLayoutAlign="start center"\n >\n <div\n [hidden]="!multi_list"\n style="width:380px"\n fxLayoutAlign="start center"\n >\n <FHComboBox\n [sql]="tipo"\n #cmb_tipo\n [init_fill]="false"\n [label]="\'Tipologia\' | translate"\n ></FHComboBox\n > \n </div>\n <mat-form-field [class.fh_field]="enabled" [class.fh_field_dis]="!enabled"\n [hidden]="!show_descri"\n style="width: 100%"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label | translate}} {{ fixed_label | translate }}</mat-label>\n <input\n matInput\n type="text"\n name="descrizione"\n [(ngModel)]="descrizione"\n />\n </mat-form-field>\n \n \x3c!-- <div\n style="width:140px"\n fxLayout="row"\n fxLayoutAlign="start start"\n (click)="call_up()"\n >\n <input\n type="file"\n multiple\n ng2FileSelect\n [uploader]="uploader"\n name="file-fh{{ id_component }}"\n id="file-fh{{ id_component }}"\n class="inputfile inputfile-fh"\n />\n <label for="file-fh{{ id_component }}" style="width:210px"\n ><svg\n xmlns="http://www.w3.org/2000/svg"\n width="20"\n height="17"\n viewBox="0 0 20 17"\n >\n <path\n d="M10 0l-5.2 4.9h3.3v5.1h3.8v-5.1h3.3l-5.2-4.9zm9.3 11.5l-3.2-2.1h-2l3.4 2.6h-3.5c-.1 0-.2.1-.2.1l-.8 2.3h-6l-.8-2.2c-.1-.1-.1-.2-.2-.2h-3.6l3.4-2.6h-2l-3.2 2.1c-.4.3-.7 1-.6 1.5l.6 3.1c.1.5.7.9 1.2.9h16.3c.6 0 1.1-.4 1.3-.9l.6-3.1c.1-.5-.2-1.2-.7-1.5z"\n /></svg><span style="font-size: 12px"> Upload</span></label>\n </div>\n --\x3e\n <div class="my-drop-zone" style="width:130px" fxLayout="row" [matTooltip]="hasBaseDropZoneOver ? lascia_il_file : trascina_il_file | translate" fxLayoutAlign="center start">\n <label for="uploader-input" ng2FileDrop style="font-weight:bold"\n [ngClass]="{\'over-drop-zone\': hasBaseDropZoneOver}" for="file-fh{{ id_component }}"\n (onFileDrop)="onFileDrop($event)"\n (fileOver)="fileOverBase($event)" [uploader]="uploader">\n <div fxLayoutAlign="center center" fxLayout="row">\n <mat-icon>{{!hasBaseDropZoneOver?\'backup\':\'thumb_up\'}}</mat-icon>\n\n <span style="font-size: 14px"> Upload</span></div></label></div>\n <input type="file"\n ng2FileSelect\n [multiple]="true"\n [uploader]="uploader"\n name="file-fh{{ id_component }}"\n id="file-fh{{ id_component }}"\n (onFileSelected)="onFileDrop($event)"\n id="uploader-input" style="display:none"/>\n <div fxLayout="row" fxLayoutAlign="start start">\n \n <button\n mat-flat-button\n *ngIf="b_edit_loaded"\n (click)="download_all()"\n style="font-size: 12px;font-weight:bold" color="accent"\n\n >\n {{ label_b }}</button\n > \n <button\n mat-flat-button\n *ngIf="id != null && allow_delete"\n (click)="del_doc()"\n color="warn"\n >\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n </div>\n <div *ngIf="!enabled" fxLayout="row" fxLayoutGap="10px">\n <label>{{ label }}:</label>\n <div *ngIf="label != descrizione">{{ descrizione }}</div>\n <button\n mat-flat-button\n *ngIf="b_edit_loaded"\n (click)="download_all()"\n style="font-size: 12px;background-color: #F5F5F5"\n >\n {{ label_b }}\n </button>\n </div>\n ',styles:[""]}]}],Ft.ctorParameters=function(){return[{type:Dt},{type:i.ToastrService},{type:e.MatDialog},{type:wt},{type:Ct},{type:p.TranslateService}]},Ft.propDecorators={show_descri:[{type:n.Input}],enabled:[{type:n.Input}],single:[{type:n.Input}],descri_obb:[{type:n.Input}],programma_da_eseguire:[{type:n.Input}],label_attendere:[{type:n.Input}],fixed_label:[{type:n.Input}],limit_string:[{type:n.Input}],allegato_inserito:[{type:n.Input}],inserire_descrizione:[{type:n.Input}],lista_allegati:[{type:n.Input}],change:[{type:n.Output}],upload_ended:[{type:n.Output}],call_upload:[{type:n.Output}],cmb_tipo:[{type:n.ViewChild,args:["cmb_tipo"]}],lascia_il_file:[{type:n.Input}],trascina_il_file:[{type:n.Input}]};var Mt=function(){function t(t,e,i,n){this.dialogRef=t,this._dataService=e,this.toastr=i,this.data=n,this.width="100%",this.selectedAdd=null,this.selectedRemove=null,this.option=0,this.selval="-1",this.errorMsg="",this.valDef="-1",this.fltr_user="",this.fltr_user_rem="",this.value_list=new Array,this.single_sel=!1,this.vis_buttons=!0,this.limit_size=!1,this.value_sel_ric=new Array,this.value_list_sel=new Array,this.types=[],this.values=[],this.value_list_all=[],this.value_sel=[],null!=n&&(null!=n.value_list&&(this.value_list=n.value_list,this.value_list_all=JSON.parse(JSON.stringify(n.value_list))),null!=n.single_sel&&(this.single_sel=n.single_sel),null!=n.vis_buttons&&(this.vis_buttons=n.vis_buttons),null!=n.limit_size&&(this.limit_size=n.limit_size),null!=n.value_sel&&(this.value_sel=n.value_sel),this.fill_list_arr(this.value_list,this.value_sel))}return t.prototype.ngAfterViewInit=function(){},t.prototype.add_all=function(){for(var t=0;t<this.value_list_sel.length;t++)this.value_sel.push(this.value_list_sel[t]);var e=[];for(t=0;t<this.value_list_all.length;t++){for(var i=!1,n=0;n<this.value_sel.length;n++)if(this.value_sel[n].valore==this.value_list_all[t].valore){i=!0;break}i||e.push(this.value_list_all[t])}this.value_list=JSON.parse(JSON.stringify(e)),this.selectedAdd=null,this.filtra(),this.filtra_rem()},t.prototype.rem_all=function(){var t=this;this.value_sel_ric.map((function(e){t.value_list.push(e)}));for(var e=[],i=0;i<this.value_sel.length;i++){for(var n=!1,o=0;o<this.value_sel_ric.length;o++)if(this.value_sel_ric[o].descrizione_valore==this.value_sel[i].descrizione_valore){n=!0;break}n||e.push(this.value_sel[i])}this.value_sel=JSON.parse(JSON.stringify(e)),this.value_sel_ric=[],this.selectedAdd=null,this.filtra(),this.filtra_rem()},t.prototype.filtra_rem=function(){if(console.log("fltr_user_rem "),this.value_sel_ric=new Array,""==this.fltr_user_rem){for(var t=0;t<this.value_sel.length;t++)if(this.value_sel_ric.push(this.value_sel[t]),50==t&&this.limit_size)return}else for(t=0;t<this.value_sel.length;t++)if(-1!=this.value_sel[t].descrizione_valore.toUpperCase().indexOf(this.fltr_user_rem.toUpperCase())){console.log("entro !!");for(var e=!1,i=0;i<this.value_sel_ric.length;i++)if(this.value_sel_ric[i].descrizione_valore==this.value_sel[t].descrizione_valore){e=!0;break}if(console.log("entro !! ",e),e||this.value_sel_ric.push(this.value_sel[t]),50==this.value_sel_ric.length&&this.limit_size)return}},t.prototype.filtra=function(){if(this.value_list_sel=new Array,""==this.fltr_user){for(var t=0;t<this.value_list.length;t++)if(this.value_list_sel.push(this.value_list[t]),50==t&&this.limit_size)return}else for(t=0;t<this.value_list.length;t++)if(-1!=this.value_list[t].descrizione_valore.toUpperCase().indexOf(this.fltr_user.toUpperCase())){for(var e=!1,i=0;i<this.value_list_sel.length;i++)if(this.value_list_sel[i].descrizione_valore==this.value_list[t].descrizione_valore){e=!0;break}if(e||this.value_list_sel.push(this.value_list[t]),50==this.value_list_sel.length&&this.limit_size)return}},t.prototype.fill_list=function(t,e){var i=this;this.value_sel=[];var n=new vt;n.sql=t,n.types=this.types,n.values=this.values,this._dataService.doQuery(n).subscribe((function(t){if(null!=t&&"OK"==t.result_msg){i.value_list=t.result_data;for(var n=0;n<e.length;n++)for(var o=0;o<t.result_data.length;o++)e[n]==t.result_data[o].descrizione_valore&&i.value_sel.push(t.result_data[o]);for(o=0;o<i.value_sel.length;o++)for(n=i.value_list.length-1;n>=0;n--)if(i.value_list[n].descrizione_valore==i.value_sel[o].descrizione_valore){i.value_list.splice(n,1);break}i.filtra(),!0}}),(function(t){i.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"}))},t.prototype.fill_list_arr=function(t,e){this.value_sel=[];for(var i=0;i<e.length;i++)for(var n=0;n<t.length;n++)e[i]==t[n].valore&&this.value_sel.push(t[n]);this.value_list=t;for(n=0;n<this.value_sel.length;n++)for(i=this.value_list.length-1;i>=0;i--)if(this.value_list[i].descrizione_valore==this.value_sel[n].descrizione_valore){this.value_list.splice(i,1);break}this.filtra(),this.filtra_rem()},t.prototype.do_add=function(){if(null!=this.selectedAdd){var t=this.value_list.indexOf(this.selectedAdd,0);this.single_sel||t>-1&&this.value_list.splice(t,1),this.single_sel&&(this.value_sel=new Array),this.value_sel.push(this.selectedAdd),this.selectedAdd=null,this.filtra(),this.filtra_rem(),this.single_sel&&this.ok()}else this.toastr.error("ERRORE","Selezionare il valore da aggiungere",{timeOut:1e3,progressBar:!0})},t.prototype.do_rem=function(){if(null!=this.selectedRemove){var t=this.value_sel.indexOf(this.selectedRemove,0);t>-1&&this.value_sel.splice(t,1),this.value_list.push(this.selectedRemove),this.selectedRemove=null,this.filtra(),this.filtra_rem()}else this.toastr.error("ERRORE","Selezionare il valore da rimuovere",{timeOut:1e3,progressBar:!0})},t.prototype.addTo=function(t){this.option=1,this.selectedAdd=t,this.selectedRemove=null},t.prototype.removeTo=function(t){this.option=2,this.selectedAdd=null,this.selectedRemove=t},t.prototype.getSelStr=function(){for(var t="",e=0;e<this.value_sel.length;e++)""!=t&&(t+=","),t+=this.value_sel[e].descrizione_valore;return t},t.prototype.getSelVal=function(){for(var t="",e=0;e<this.value_sel.length;e++)""!=t&&(t+=","),t+=this.value_sel[e].valore;return t},t.prototype.getSelArr=function(){return this.value_sel},t.prototype.ok=function(){this.dialogRef.close(this.getSelArr())},t}();Mt.decorators=[{type:n.Component,args:[{selector:"FHPickList",template:'\n <div fxLayout="column" fxLayoutGap="15px" style="min-width:1000px" fxFlex>\n <div fxLayout="row" fxLayoutGap="10px">\n <div fxLayout="column" fxFlex="45">\n <div style="width:100%;height:450px;overflow:auto;">\n <table style="width: 100%" class="fh_table sel_r">\n <thead>\n <tr>\n <th>{{\'VALORI SELEZIONABILI\' |translate}}</th>\n </tr>\n </thead>\n\n <tbody>\n <tr style="background-color:#FFF !important">\n <td>\n <input\n [(ngModel)]="fltr_user"\n (ngModelChange)="filtra()"\n style="padding:8px;margin:15px auto;width:100%;"\n placeholder="Ricerca..."\n />\n </td>\n </tr>\n <tr\n *ngFor="\n let u of value_list_sel;\n let odd = odd;\n let even = even\n "\n\n (click)="addTo(u)"\n (dblclick)="do_add()"\n class="selector"\n\n [ngClass]="{ active: selectedAdd == u }"\n >\n <td [ngClass]="{ odd: odd, even: even }" style="cursor:pointer">{{ u.descrizione_valore }}</td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div\n fxLayout="column" fxFlex="10" fxLayoutAlign="center center"\n style="height: 450px; position: relative; margin:0 .5em; padding-left: .5em; padding-right: .5em; border-left: 1px solid rgba(191, 191, 191, 0.5); border-right: 1px solid rgba(191, 191, 191, 0.5);"\n >\n <div fxLayoutAlign="center center" fxLayout="column"\n\n >\n <button\n mat-flat-button\n color="primary"\n (click)="do_add()"\n [disabled]="option!=1"\n >\n >\n </button>\n <br />\n <button\n mat-flat-button\n color="primary"\n (click)="do_rem()"\n [disabled]="option!=2"\n >\n <\n </button> <br *ngIf="!single_sel" /><br *ngIf="!single_sel"/> <br *ngIf="!single_sel"/>\n <button *ngIf="!single_sel"\n mat-flat-button\n color="primary"\n (click)="add_all()" matTooltip="Seleziona Tutto"\n [disabled]="value_list_sel.length==0"\n >\n >>\n </button> <br *ngIf="!single_sel"/>\n <button *ngIf="!single_sel"\n mat-flat-button\n color="primary" matTooltip="Deseleziona Tutto"\n (click)="rem_all()"\n [disabled]="value_sel.length==0"\n >\n <<\n </button>\n </div>\n </div>\n\n <div fxLayout="column" fxFlex="45">\n <div style="width:100%;height:450px;overflow:auto;">\n <table style="width: 100%" class="fh_table sel_r">\n <thead>\n <tr>\n <th>{{\'VALORI SELEZIONATI\'|translate}}</th>\n </tr>\n </thead>\n <tbody>\n <tr style="background-color:#FFF !important">\n <td>\n <input\n [(ngModel)]="fltr_user_rem"\n (ngModelChange)="filtra_rem()"\n style="padding:8px;margin:15px auto;width:100%;"\n placeholder="Ricerca..."\n />\n </td>\n </tr>\n <tr\n *ngFor="let u of value_sel_ric; let odd = odd; let even = even"\n (mouseover)="selectedRemove = u"\n [ngClass]="{ odd: odd, even: even }"\n (click)="removeTo(u)"\n (dblclick)="do_rem()"\n class="selector"\n [ngClass]="{ active: selectedRemove == u }"\n >\n <td [ngClass]="{ odd: odd, even: even }" style="cursor:pointer">{{ u.descrizione_valore }}</td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n <br /><br />\n <div fxLayout="row" fxLayoutAlign="center center" fxLayoutGap="5px">\n <button mat-flat-button color="primary" (click)="ok()">Ok</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="dialogRef.close()"\n >\n {{\'Annulla\'|translate }}\n </button>\n </div>\n </div>\n ',styles:["\n .mat-dialog-content { max-height: unset !important; }\n .selector {\n cursor: hand;\n }\n "]}]}],Mt.ctorParameters=function(){return[{type:e.MatDialogRef},{type:Dt},{type:i.ToastrService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Mt.propDecorators={value_list:[{type:n.Input}],single_sel:[{type:n.Input}],vis_buttons:[{type:n.Input}],limit_size:[{type:n.Input}],value_sel:[{type:n.Input}]};var Pt={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return zt})),multi:!0},zt=function(){function t(t,e){this.dataservice=t,this.dialog=e,this.label="",this.required=!1,this.enabled=!0,this.hidden=!1,this.sep=",",this.value_list=new Array,this.single_sel=!1,this.vis_buttons=!0,this.limit_size=!1,this.value_sel=[],this.change=new n.EventEmitter,this.t_value="",this.i_value="",this.selectedUser=[],this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.required&&(t.label=t.label+" *")}))},t.prototype.set_by_value=function(t){null==t&&this.clear(),""==t&&this.clear();var e=t.split(this.sep);this.t_value="",this.i_value="",this.value_sel=[];for(var i=0;i<e.length;i++)for(var n=0;n<this.value_list.length;n++)if(e[i]==this.value_list[n].valore){""!=this.t_value&&(this.t_value+=this.sep),this.t_value+=this.value_list[n].descrizione_valore,""!=this.i_value&&(this.i_value+=this.sep),this.i_value+=this.value_list[n].valore,this.value_sel.push(this.value_list[n].valore);break}},t.prototype.writeValue=function(t){null!=t&&""!=t?this.set_by_value(t):this.clear()},t.prototype.open_pick=function(){var t=this;this.enabled&&this.dialog.open(Mt,{disableClose:!0,width:"800px",height:"650px",data:{value_list:JSON.parse(JSON.stringify(this.value_list)),single_sel:this.single_sel,vis_buttons:this.vis_buttons,limit_size:this.limit_size,value_sel:JSON.parse(JSON.stringify(this.value_sel))}}).afterClosed().subscribe((function(e){null!=e&&(t.set_by_value(e.map((function(t){return t.valore})).join(t.sep)),t.change.emit(e),t.onChange(t.i_value))}))},t.prototype.clear=function(){this.t_value="",this.i_value="",this.onChange("")},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}();zt.decorators=[{type:n.Component,args:[{selector:"FHPickField",providers:[Pt],template:'\n <div fxLayout="row" [hidden]="!enabled || hidden">\n <mat-form-field [class.fh_field]="enabled"\n style="clickable-field"\n (click)="open_pick()"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n\n <input\n matInput\n [hidden]="hidden"\n type="text"\n [ngModel]="t_value"\n [disabled]="false"\n readonly\n />\n </mat-form-field>\n <button\n mat-icon-button\n matSuffix\n [hidden]="selectedUser.length == 0"\n (click)="clear()"\n >\n <mat-icon>clear</mat-icon>\n </button>\n </div>\n <mat-form-field\n [hidden]="enabled || hidden" [class.fh_field_dis]="!enabled"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n <input\n type="text"\n #el1\n matInput\n [disabled]="true"\n [(ngModel)]="t_value"\n />\n </mat-form-field>\n ',styles:["\n .clickable-field {\n border: 1px solid #000000;\n color: #000000;\n }\n\n .clickable-field:focus {\n outline: none;\n }\n\n :host ::ng-deep .mat-input-element {\n cursor: pointer !important;\n }\n "]}]}],zt.ctorParameters=function(){return[{type:Dt},{type:e.MatDialog}]},zt.propDecorators={label:[{type:n.Input}],required:[{type:n.Input}],enabled:[{type:n.Input}],hidden:[{type:n.Input}],sep:[{type:n.Input}],value_list:[{type:n.Input}],single_sel:[{type:n.Input}],vis_buttons:[{type:n.Input}],limit_size:[{type:n.Input}],value_sel:[{type:n.Input}],change:[{type:n.Output}]};var jt=function(){function t(t,e){this.dialogRef=t,this.data=e,this.modifiche=[],this.title="",null!=e.title&&(this.title=e.title.toUpperCase()),this.modifiche=JSON.parse(e.dt)}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ngAfterViewInit=function(){},t}();jt.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">DETTAGLIO MODIFICA - {{ title }}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n\n <mat-dialog-content style="min-width:700px">\n <table style="width: 90%" class="fh_table">\n <thead>\n <tr>\n <th style="width:20%;">Operazione</th>\n <th style="width:20%;">Campo</th>\n <th style="width:30%;">Old Value</th>\n <th style="width:30%;">New Value</th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="let u of modifiche; let odd = odd; let even = even"\n [ngClass]="{ odd: odd, even: even }"\n >\n <td>{{ u.op }}</td>\n <td>{{ u.path }}</td>\n <td>{{ u.oldVal }}</td>\n <td>{{ u.val }}</td>\n </tr>\n </tbody>\n </table>\n </mat-dialog-content>\n</div>\n '}]}],jt.ctorParameters=function(){return[{type:e.MatDialogRef},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var Ut=function(){function t(t,e,i,n){this.dialogRef=t,this.appService=e,this.toastr=i,this._dataService=n,this.o=new Object}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ngAfterViewInit=function(){},t}();Ut.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n <h2 mat-dialog-title>LOG {{ o.data | date: "dd/MM/yyyy HH:mm:ss" }}</h2>\n\n <mat-dialog-content style="min-width:700px">\n <div fxLayout="column">\n <div\n [style.background-color]="o.tipo === \'ERROR\' ? \'#CC0033\' : \'#1E7BB5\'"\n style="color:#FFFFFF;font-weight: bold;text-align:center"\n >\n {{ o.tipo }}\n </div>\n <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>Applicazione</mat-label>\n <input\n type="text"\n matInput\n [readonly]="true"\n [(ngModel)]="o.applicativo"\n />\n </mat-form-field>\n <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>Documento</mat-label>\n <input\n type="text"\n matInput\n [readonly]="true"\n [(ngModel)]="o.iddocumento"\n />\n </mat-form-field>\n\n <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>Descrizione</mat-label>\n <textarea\n matInput\n readonly\n [(ngModel)]="o.descr_all"\n rows="8"\n ></textarea>\n </mat-form-field>\n </div>\n\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button (click)="dialogRef.close()" color="accent">\n CHIUDI\n </button>\n </div>\n </mat-dialog-content>\n '}]}],Ut.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:Dt}]};var Vt=function(){function t(t,e,i,n,o,s,a,r,l){this.router=t,this.route=e,this._dataService=i,this.toastr=n,this.dialog=o,this.appService=s,this.uti=a,this.dialogRef=r,this.data=l,this.title="LOGS",this.columnDefs=[],this.flt_log="",this.appService.getState().mobile||(this.uti.set_home_title(this.title),this.title=""),null!=l.flt&&(this.flt_log=l.flt)}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.cce=function(t){if("link"==t.colDef.field){if(null==t.data.link)return;window.open(t.data.link)}if("diff"==t.colDef.field){if(null==t.data.diff)return;this.dialog.open(jt,{data:{dt:t.data.diff,title:t.data.utente+" del: "+this.uti.datetime2String(new Date(t.data.data))}}).afterClosed().subscribe()}"descr_all"==t.colDef.field&&this.dialog.open(bt,{disableClose:!0,data:{valore:t.data.descr_all,readonly:!0,title:"Descrizione"}}).afterClosed().subscribe((function(t){}))},t.prototype.ie=function(){var t=this,e=new vt;e.sql="SELECT_LOGS_APPS",e.types=[],e.values=[],this._dataService.doQuery(e).subscribe((function(i){if(null!=i&&"OK"==i.result_msg){for(var n=i.result_data,o=0;o<n.length;o++)n[o]=n[o].applicativo;(e=new vt).sql="SELECT_LOGS_TYPES",e.types=[],e.values=[],t._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=e.result_data,o=0;o<i.length;o++)i[o]=i[o].tipo;t.columnDefs=[{headerName:"Applicazione",field:"applicativo",filter:"agSetColumnFilter",filterParams:{values:n,newRowsAction:"keep"}},{headerName:"Documento",field:"iddocumento",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Descrizione",field:"descr_all",filter:"agTextColumnFilter",tooltipField:"descr_all",tooltipComponentParams:{color:"#ececec"},filterParams:{newRowsAction:"keep"},cellRenderer:function(t){return null==t.value?" ------ ":t.value.length>60?'<table border="0" style="width: 100%;"><tr><td>'+t.value.substring(0,60)+'...</td><td style="text-align: right"><i style="color:#f4b342;font-size: 22px;" class="material-icons">feedback</i></td></tr></table>':'<div width="100%">'+t.value+"</div>"}},{headerName:"Utente",field:"utente",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Tipo",field:"tipo",filter:"agSetColumnFilter",filterParams:{values:i,newRowsAction:"keep"},cellStyle:function(t){return"INFO"==t.value?{"background-color":"#1E7BB5",color:"#FFFFFF","font-weight":"bold","text-align":"center"}:"ERROR"==t.value?{"background-color":"#CC0033",color:"#FFFFFF","font-weight":"bold","text-align":"center"}:"INSERT_DOC"==t.value||"EDIT_DOC"==t.value||"DELETE_DOC"==t.value?{"background-color":"#FF8000",color:"#FFFFFF","font-weight":"bold","text-align":"center"}:{"text-align":"left"}}},{headerName:"Data",field:"data",filter:"agDateColumnFilter",floatingFilterComponentParams:{suppressFilterButton:!0},filterParams:{newRowsAction:"keep"},cellStyle:function(t){return{"text-align":"left"}},cellRenderer:function(e){if(null==e.value)return" ------ ";var i=new Date(e.value);return 1970==i.getFullYear()?" ------ ":t.uti.datetime2String(i)}},{headerName:"Dettagli",field:"diff",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"},cellStyle:function(t){return{"text-align":"center"}},cellRenderer:function(t){return null!=t.value&&"null"!=t.value&&""!=t.value?'<button mat-flat-button color="primary" style="width:100%">DETTAGLI</button>':""}},{headerName:"Link",field:"link",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"},cellStyle:function(t){return{"text-align":"center"}},cellRenderer:function(t){return null!=t.value?'<button mat-flat-button color="primary" style="width:100%">LINK</button>':""}}]}}))}}))},t.prototype.show_descri=function(){var t=this,e=this.dialog.open(Ut);setTimeout((function(){null!=t.datagrid.sRow.descr_all&&(t.datagrid.sRow.descr_all=t.datagrid.sRow.descr_all.split("<br>").join("\n")),e.componentInstance.o=t.datagrid.sRow,e.afterClosed().subscribe((function(t){}))}))},t.prototype.ngAfterViewInit=function(){this.datagrid.doFill(this.flt_log)},t}();Vt.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">LOGS</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n\n <mat-dialog-content>\n <div\n style="width: 100%;"\n [style.height]="(appService.getState().body_h - 300) + \'px\'"\n >\n <div style="width: 100%; height: 100%;">\n <FHGrid\n [init_fill]="false"\n #dtm\n [tooltipShowDelay]="0"\n [columnDefs]="columnDefs"\n (dclicked)="show_descri()"\n tbl_name="v_logs"\n grid_key="logs_V112"\n (init_end)="ie()"\n (cell_clicked)="cce($event)"\n sort_field="data desc"\n fields="applicativo,iddocumento,utente,tipo,data,diff,link,descr_all"\n ></FHGrid>\n </div>\n </div>\n </mat-dialog-content>\n</div>\n ',styles:[" .mat-dialog-content { max-height: unset !important; }\n\n"]}]}],Vt.ctorParameters=function(){return[{type:d.Router},{type:d.ActivatedRoute},{type:Dt},{type:i.ToastrService},{type:e.MatDialog},{type:wt},{type:Ct},{type:e.MatDialogRef},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Vt.propDecorators={datagrid:[{type:n.ViewChild,args:["dtm"]}]};var qt=function(){function t(t,e,i,n){this.data=t,this.dialogRef=e,this.app_s=i,this.trs=n,this.enabled=!0,this.access_control=!0,this.App="",this.K="",this.title="ALLEGATI",this.admin_role="[ZZZ_DIS_CC]",this.sovrascrivi_path="",null!=t&&(null!=t.App&&(this.App=t.App),null!=t.K&&(this.K=t.K),null!=t.admin_role&&(this.admin_role=t.admin_role),null!=t.enabled&&(this.enabled=t.enabled))}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.init(t.App,t.K),t.title=t.trs.instant("ALLEGATI")}))},t.prototype.init=function(t,e){this.App=t,this.K=e,this.upc.init(this.App,this.K)},t}();qt.decorators=[{type:n.Component,args:[{selector:"wkf_win_upload",template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n\n <mat-dialog-content style="font-size:12px">\n<br><br>\n <FHUploadPanel\n [enabled]="enabled"\n #upc\n [access_control]="access_control"\n [sovrascrivi_path]="sovrascrivi_path"\n [ruolo_supervisore]="admin_role"\n ></FHUploadPanel>\n </mat-dialog-content>\n <br /><br />\n <div style="width:100%;text-align:center;">\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n {{\'CHIUDI\' | translate}}\n </button>\n </div>\n </div>\n ',styles:[""]}]}],qt.ctorParameters=function(){return[{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]},{type:e.MatDialogRef},{type:wt},{type:p.TranslateService}]},qt.propDecorators={upc:[{type:n.ViewChild,args:["upc"]}]};var Gt=function(){function t(t,e,i,n,o){var s=this;this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.uti=n,this.datax=o,this.title="LOGS",this.data=null,this.b_commento=!1,this.columnDefs=[],this.data=o,console.log("datax ",o),null!=o&&null!=o.b_commento&&(this.b_commento=this.datax.b_commento),this.b_commento?this.columnDefs=[{headerName:"Commento",field:"descrizione",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Utente",field:"utente",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Tipo",field:"tipo",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"},cellStyle:function(t){return"INFO"==t.value?{"background-color":"#1E7BB5",color:"#FFFFFF","font-weight":"bold","text-align":"center"}:"ERROR"==t.value?{"background-color":"#CC0033",color:"#FFFFFF","font-weight":"bold","text-align":"center"}:"INSERT_DOC"==t.value||"EDIT_DOC"==t.value||"DELETE_DOC"==t.value?{"background-color":"#FF8000",color:"#FFFFFF","font-weight":"bold","text-align":"center"}:{"text-align":"left"}}},{headerName:"Data",field:"data",filter:"agDateColumnFilter",floatingFilterComponentParams:{suppressFilterButton:!0},filterParams:{newRowsAction:"keep"},cellStyle:function(t){return{"text-align":"left"}},cellRenderer:function(t){if(null==t.value)return" ------ ";var e=new Date(t.value);return 1970==e.getFullYear()?" ------ ":s.uti.datetime2String(e)}},{headerName:"Dettagli",field:"diff",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"},cellStyle:function(t){return{"text-align":"center"}},cellRenderer:function(t){return console.log("params.value ",t.value),null!=t.value&&"null"!=t.value&&""!=t.value?'<button style="width:100%">DETTAGLI</button>':""}},{headerName:"Commento",field:"descrizione",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}}]:this.columnDefs=[{headerName:"Utente",field:"utente",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Tipo",field:"tipo",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"},cellStyle:function(t){return"INFO"==t.value?{"background-color":"#1E7BB5",color:"#FFFFFF","font-weight":"bold","text-align":"center"}:"ERROR"==t.value?{"background-color":"#CC0033",color:"#FFFFFF","font-weight":"bold","text-align":"center"}:"INSERT_DOC"==t.value||"EDIT_DOC"==t.value||"DELETE_DOC"==t.value?{"background-color":"#FF8000",color:"#FFFFFF","font-weight":"bold","text-align":"center"}:{"text-align":"left"}}},{headerName:"Data",field:"data",filter:"agDateColumnFilter",floatingFilterComponentParams:{suppressFilterButton:!0},filterParams:{newRowsAction:"keep"},cellStyle:function(t){return{"text-align":"left"}},cellRenderer:function(t){if(null==t.value)return" ------ ";var e=new Date(t.value);return 1970==e.getFullYear()?" ------ ":s.uti.datetime2String(e)}},{headerName:"Dettagli",field:"diff",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"},cellStyle:function(t){return{"text-align":"center"}},cellRenderer:function(t){return null!=t.value&&"null"!=t.value&&""!=t.value?'<button style="width:100%">DETTAGLI</button>':""}}]}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ngAfterViewInit=function(){null!=this.data&&this.datagrid.doFill("applicativo='"+this.data.App+"' and iddocumento='"+this.data.K+"'")},t.prototype.cce=function(t){if("diff"==t.colDef.field){if(null==t.data.diff)return;this.m_dialogRef.open(jt,{data:{dt:t.data.diff,title:t.data.utente+" del: "+this.uti.datetime2String(new Date(t.data.data))}}).afterClosed().subscribe()}},t}();Gt.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n <div [style.height]="m_appService.getState().body_h - 130 + \'px\'">\n <div\n style="width: 100%"\n [style.height]="m_appService.getState().body_h - 140 + \'px\'"\n >\n <div style="width:100%;height:100%">\n <FHGrid\n #dtm\n [columnDefs]="columnDefs"\n [init_fill]="false"\n tbl_name="v_logs"\n grid_key="dddfd"\n (cell_clicked)="cce($event)"\n sort_field="data desc"\n fields="*"\n ></FHGrid>\n </div>\n </div>\n </div>\n ',styles:[""]}]}],Gt.ctorParameters=function(){return[{type:e.MatDialogRef},{type:e.MatDialog},{type:wt},{type:Ct},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Gt.propDecorators={datagrid:[{type:n.ViewChild,args:["dtm"]}]};var Kt=function(){function t(t){this._dialog=t,this.editable=!0,this.show_save=!0,this.show_back=!0,this.is_editing=!1,this.App="",this.K="",this.mgs_back="Indietro",this.mgs_edit="Modifica",this.mgs_save="Salva",this.b_commento=!1,this.log_enabled=!0,this.custom_commands=[],this.command=new n.EventEmitter}return t.prototype.logs=function(){this._dialog.open(Gt,{width:"95%",disableClose:!0,data:{App:this.App,K:this.K,b_commento:this.b_commento}}).afterClosed().subscribe((function(t){}))},t.prototype.exec_command=function(t){this.command.emit({cmd:t})},t.prototype.edit=function(){this.command.emit({cmd:"edit_form"}),this.is_editing=!0},t.prototype.back_ask_save=function(){this.command.emit({cmd:"ask_back"})},t.prototype.back=function(){this.command.emit({cmd:"back"})},t.prototype.save=function(){this.command.emit({cmd:"save"})},t.prototype.set_editing=function(t){this.is_editing=t},t}();Kt.decorators=[{type:n.Component,args:[{selector:"FHFormToolBar",template:'\n <div fxLayout="row" fxLayoutGap="5px">\n <div\n fxLayout="row"\n fxLayoutGap="10px"\n [hidden]="is_editing"\n fxLayoutAlign="start center"\n >\n <div><button mat-flat-button [hidden]="!show_back" (click)="back()">{{ mgs_back | translate }}</button> </div>\n <div><button\n mat-flat-button\n color="primary"\n [hidden]="!editable"\n (click)="edit()"\n >\n <mat-icon>edit</mat-icon> {{ mgs_edit }}\n </button> </div>\n <div><button\n [hidden]="!editable || !log_enabled"\n mat-flat-button\n *ngIf="App != \'\'"\n color="accent"\n (click)="logs()"\n >\n <mat-icon>assignment</mat-icon> Logs</button> </div>\n </div>\n <div\n fxLayout="row"\n fxLayoutGap="10px"\n [hidden]="!is_editing"\n fxLayoutAlign="start center">\n <div><button mat-flat-button [hidden]="!show_back" (click)="back_ask_save()">{{ mgs_back | translate }}</button> </div>\n <div><button\n mat-flat-button\n color="primary"\n [hidden]="!show_save"\n (click)="save()">\n <mat-icon>save</mat-icon> {{ mgs_save | translate}}\n </button> </div>\n\n <div><button [hidden]="!log_enabled"\n mat-flat-button\n *ngIf="App != \'\'"\n color="accent"\n (click)="logs()"\n >\n <mat-icon>assignment</mat-icon> Logs\n </button> </div>\n </div>\n <div\n *ngIf="custom_commands.length > 0"\n fxLayoutGap="10px"\n fxLayout="row"\n fxLayoutAlign="end center"\n >\n <div *ngFor="let app of custom_commands" fxLayout="row"\n fxLayoutGap="5px">\n <div><button [hidden]="app.hidden!=null && app.hidden"\n mat-flat-button\n [color]="app.color"\n (click)="exec_command(app.command)"\n >\n <mat-icon *ngIf="app.icon != null">{{ app.icon }}</mat-icon\n >{{ app.label }}\n </button> </div>\n </div>\n </div>\n </div>\n ',styles:[""]}]}],Kt.ctorParameters=function(){return[{type:e.MatDialog}]},Kt.propDecorators={editable:[{type:n.Input}],show_save:[{type:n.Input}],show_back:[{type:n.Input}],App:[{type:n.Input}],K:[{type:n.Input}],mgs_back:[{type:n.Input}],mgs_edit:[{type:n.Input}],mgs_save:[{type:n.Input}],b_commento:[{type:n.Input}],log_enabled:[{type:n.Input}],custom_commands:[{type:n.Input}],command:[{type:n.Output}]};var Bt={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Ht})),multi:!0},Ht=function(){function t(){this.hidden=!1,this.label="",this.enabled=!0,this.required=!1,this.rows=3,this.error=null,this.change=new n.EventEmitter,this.focusout=new n.EventEmitter,this.focusin=new n.EventEmitter,this.text_v="",this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.onFi=function(){var t=this;setTimeout((function(){t.focusin.emit(t.text_v)}))},t.prototype.onFu=function(){var t=this;setTimeout((function(){t.focusout.emit(t.text_v)}))},t.prototype.modelch=function(){var t=this;setTimeout((function(){t.onChange(t.text_v),t.change.emit(t.text_v)}))},t.prototype.ngAfterViewInit=function(){},t.prototype.writeValue=function(t){this.text_v=t},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}();Ht.decorators=[{type:n.Component,args:[{selector:"FHTextArea",providers:[Bt],template:'\n <mat-form-field [hidden]="hidden" appearance="outline" floatLabel="always" [class.fh_field]="enabled" [class.fh_field_dis]="!enabled"\n ><mat-label>{{ label }}</mat-label>\n <textarea\n matInput\n [rows]="rows"\n type="text"\n [(ngModel)]="text_v"\n [readonly]="!enabled"\n [required]="required"\n (focusout)="onFu()"\n (focusin)="onFi()"\n (ngModelChange)="modelch()"\n ></textarea>\n <mat-error *ngIf="error==null">{{ error }}</mat-error>\n </mat-form-field>\n ',styles:[""]}]}],Ht.ctorParameters=function(){return[]},Ht.propDecorators={hidden:[{type:n.Input}],label:[{type:n.Input}],enabled:[{type:n.Input}],required:[{type:n.Input}],rows:[{type:n.Input}],error:[{type:n.Input}],change:[{type:n.Output}],focusout:[{type:n.Output}],focusin:[{type:n.Output}]};var Yt=function(){function t(){}return t.prototype.agInit=function(t){this.params=t,this.value=this.params.value},t.prototype.getValue=function(){return this.value},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){null!=t.input&&null!=t.input.element&&null!=t.input.element.nativeElement&&t.input.element.nativeElement.focus()}))},t}();Yt.decorators=[{type:n.Component,args:[{selector:"checkbox-cell",template:' <FHCheckBox [(ngModel)]="value"> </FHCheckBox> '}]}],Yt.ctorParameters=function(){return[]},Yt.propDecorators={input:[{type:n.ViewChild,args:["input",{read:n.ViewContainerRef}]}]};var Qt=function(){function t(t,e,i){this.http=t,this.app_s=e,this.toastr=i,this.url=this.app_s.API_ENDPOINT+this.app_s.ODBC_ENDPOINT}return t.prototype.doQuery=function(t,e){var i=this;void 0===e&&(e=!0),this.headers=new r.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=this.app_s.API_ENDPOINT+this.app_s.ODBC_ENDPOINT;var n=JSON.stringify(t);return this.http.post(this.url,n,{headers:this.headers}).pipe(l.map((function(t){var n;if(t?"KO"===t.result_msg&&(n=new Error(t.msg)):n=new Error("Empty server response"),n)throw console.error(n),e&&i.toastr.error(n.message),new Error(n);return t||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t}();Qt.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new Qt(n.ɵɵinject(r.HttpClient),n.ɵɵinject(wt),n.ɵɵinject(i.ToastrService))},token:Qt,providedIn:"root"}),Qt.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],Qt.ctorParameters=function(){return[{type:r.HttpClient},{type:wt},{type:i.ToastrService}]};var Wt=function(){function t(t,e,i){this.http=t,this.app_s=e,this.toastr=i,this.url=this.app_s.API_ENDPOINT+this.app_s.APPMAKER_ENDPOINT}return t.prototype.doQuery=function(t,e){var i=this;void 0===e&&(e=!0),this.url=this.app_s.API_ENDPOINT+this.app_s.APPMAKER_ENDPOINT,this.headers=new r.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")});var n=JSON.stringify(t);return this.http.post(this.url,n).pipe(l.map((function(t){var n,o=t;if(t?"KO"===o.result_msg&&(n=new Error(o.msg)):n=new Error("Empty server response"),n)throw console.error(n),e&&i.toastr.error(n.message),new Error(n);return o||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.extractData=function(t){return t.json()||{}},t.prototype.handleError=function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";return console.error(e),_.Observable.throw(e)},t}();Wt.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new Wt(n.ɵɵinject(r.HttpClient),n.ɵɵinject(wt),n.ɵɵinject(i.ToastrService))},token:Wt,providedIn:"root"}),Wt.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],Wt.ctorParameters=function(){return[{type:r.HttpClient},{type:wt},{type:i.ToastrService}]};var Jt=function(){function t(t){this.uti_s=t,this.cancelBeforeStart=!1}return t.prototype.agInit=function(t){var e=this;this.params=t,"string"==typeof this.value?this.value=this.params.value:this.value=this.uti_s.format_currency(this.params.value),"1234567890,".indexOf(t.charPress)>=0?(this.value=t.charPress,setTimeout((function(){e.uti_s.setSelectionRange(e.input.element.nativeElement,1,String(e.value).length)}),100)):setTimeout((function(){e.uti_s.setSelectionRange(e.input.element.nativeElement,0,String(e.value).length)}),100),this.cancelBeforeStart=t.charPress&&"1234567890,".indexOf(t.charPress)<0},t.prototype.getValue=function(){if(""==String(this.value))return 0;var t=0;return null!=(t="string"==typeof this.value?parseFloat(this.value.split(".").join("").split(",").join(".")):this.value)?t:0},t.prototype.isCancelBeforeStart=function(){return this.cancelBeforeStart},t.prototype.isCancelAfterEnd=function(){return"string"==typeof this.value&&parseFloat(this.value.split(".").join("").split(",").join("."))>1e6},t.prototype.onKeyDown=function(t){this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault()},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){null!=t.input&&null!=t.input.element&&null!=t.input.element.nativeElement&&t.input.element.nativeElement.focus()}))},t.prototype.getCharCodeFromEvent=function(t){return void 0===(t=t||window.event).which?t.keyCode:t.which},t.prototype.isCharNumeric=function(t){return!!/\d/.test(t)},t.prototype.isKeyPressedNumeric=function(t){var e=this.getCharCodeFromEvent(t);if(8==e)return!0;if(188==e)return!0;if(e>=96&&e<=109)return!0;var i=String.fromCharCode(e);return this.isCharNumeric(i)},t}();Jt.decorators=[{type:n.Component,args:[{selector:"numeric-cell",template:'<input\n #input\n (keydown)="onKeyDown($event)"\n [(ngModel)]="value"\n style="fontSize:40;height:30px;"\n />'}]}],Jt.ctorParameters=function(){return[{type:Ct}]},Jt.propDecorators={input:[{type:n.ViewChild,args:["input",{read:n.ViewContainerRef}]}]};var $t=function(){function t(t,e,i,n){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.uti_s=n,this.res="",this.h=0,this.m=0}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.change=function(){this.res=this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.ok=function(){5==this.res.length?this.dialogRef.close(this.res):this.toastr.error("ERRORE","SELEZIONARE L'ORARIO",{timeOut:1e3,progressBar:!0,positionClass:"toast-bottom-right"})},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(null!=t.m_appService.getState().appo_dialog&&null!=t.m_appService.getState().appo_dialog.val){var e=t.m_appService.getState().appo_dialog.val.split(":");return t.h=parseInt(e[0]),t.m=parseInt(e[1]),void(t.res=t.m_appService.getState().appo_dialog.val)}}))},t}();$t.decorators=[{type:n.Component,args:[{selector:"fhtimeslider",template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <h2 mat-dialog-title style="min-width:300px">\n Seleziona Orario -> {{ res }}\n </h2>\n\n <mat-dialog-content style="font-size: 15px;"\n ><br /><br />\n <table>\n <tr>\n <td>Ore:</td>\n <td>\n <mat-slider\n [max]="23"\n (change)="change()"\n [min]="0"\n [step]="1"\n thumbLabel\n [(ngModel)]="h"\n >\n </mat-slider>\n </td>\n </tr>\n <tr>\n <td>Minuti:</td>\n <td>\n <mat-slider\n [max]="45"\n [min]="0"\n (change)="change()"\n [step]="15"\n thumbLabel\n [(ngModel)]="m"\n >\n </mat-slider>\n </td>\n </tr>\n </table>\n </mat-dialog-content>\n\n <mat-dialog-actions>\n <button mat-flat-button color="primary" (click)="ok()">OK</button>\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="dialogRef.close(\'\')"\n >\n CHIUDI\n </button>\n </mat-dialog-actions>\n '}]}],$t.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:wt},{type:Ct}]};var Xt={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Zt})),multi:!0},Zt=function(){function t(t,e,i,o,s){this._dataService=t,this.dialog=e,this.m_appService=i,this.toastr=o,this.uti_s=s,this.maxore=23,this.label="",this.enabled=!0,this.vertical=!1,this.label_hh="",this.label_mm="",this.step=1,this.arr_hh=["0","1","2","3","4","5","6","7","8","9","10"],this.arr_mm=["0","10","15","30","45"],this.show_picker=!1,this.selchange=new n.EventEmitter,this.h=0,this.m=0,this.res="",this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.setta_h=function(t){this.h=parseInt(t)},t.prototype.setta_m=function(t){this.m=parseInt(t)},t.prototype.uph=function(){this.h<this.maxore&&this.h++,this.sc()},t.prototype.doh=function(){this.h>0&&this.h--,this.sc()},t.prototype.upm=function(){var t=parseInt(this.m+"")+parseInt(this.step+"");console.log("upm ",this.m,parseInt(this.m+""),t),t<60&&(this.m=t),this.sc()},t.prototype.dom=function(){console.log("dom ",this.m,parseInt(this.m+""),parseInt(this.m+"")-this.step),parseInt(this.m+"")-this.step>=0&&(this.m=parseInt(this.m+"")-this.step),this.sc()},t.prototype.onFu=function(){this.h>this.maxore&&(this.h=this.maxore),this.sc()},t.prototype.onMi=function(){this.m>59&&(this.m=59),this.m=Math.round(this.m/this.step)*this.step,60==this.m&&(this.m=60-this.step),this.sc()},t.prototype.onKeyDown=function(t){this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault(),this.sc()},t.prototype.onKeyDown1=function(t){this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault(),this.sc()},t.prototype.resetValue=function(){this.h=0,this.m=0},t.prototype.annulla=function(){this.show_picker=!1},t.prototype.ok=function(){0!=this.h||0!=this.m?this.sc():this.toastr.error("ERRORE","SELEZIONARE L'ORARIO",{timeOut:1e3,progressBar:!0,positionClass:"toast-bottom-right"})},t.prototype.change=function(){this.res=this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.setByDescri=function(t){null==t&&(t="00:00"),""==t&&(t="00:00"),-1==t.indexOf(":")&&(t="00:00");var e=t.split(":");this.h=parseInt(e[0]),this.m=Math.round(parseInt(e[1])/this.step)*this.step,60==this.m&&(this.m=60-this.step),5!=t.length&&this.onChange(this.getValue())},t.prototype.isValidVal=function(){return!0},t.prototype.setByValue=function(t){this.setByDescri(t)},t.prototype.setValue=function(t){this.setByDescri(t)},t.prototype.getDescri=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getData=function(t){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getObj=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getValue=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getHours=function(){return this.h},t.prototype.getMinutes=function(){return this.m},t.prototype.ngAfterViewInit=function(){},t.prototype.sc=function(){var t=this;setTimeout((function(){var e=t.getValue();t.selchange.emit(),console.log("sc ",e),t.onChange(e)}),200)},t.prototype.isCharNumeric=function(t){return!!/\d/.test(t)},t.prototype.getCharCodeFromEvent=function(t){return void 0===(t=t||window.event).which?t.keyCode:t.which},t.prototype.isKeyPressedNumeric=function(t){return-1!=="0123456789".indexOf(t.key)||"ArrowRight"==t.key||"ArrowLeft"==t.key||"ArrowDown"==t.key||"ArrowUp"==t.key||"Backspace"==t.key||9==t.keyCode},t.prototype.writeValue=function(t){this.setByValue(t)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}();Zt.decorators=[{type:n.Component,args:[{selector:"FHTimePicker",providers:[Xt],template:'\n <div fxLayout="row" fxLayoutAlign="center center" [hidden]="vertical && enabled" >\n <b>{{ label }}</b\n > \n <div fxLayout="column" fxLayoutAlign="center center">\n <div *ngIf="enabled" >\n <mat-icon (click)="uph()">keyboard_arrow_up</mat-icon>\n </div>\n\n <input\n style="width:40px;text-align:center;"\n (keydown)="onKeyDown($event)"\n (focusout)="onFu()"\n [disabled]="!enabled"\n [(ngModel)]="h"\n\n\n />\n <div *ngIf="enabled">\n <mat-icon (click)="doh()"\n >keyboard_arrow_down</mat-icon\n >\n </div>\n </div>\n\n <b style="font-size:28px">:</b> \n\n <div fxLayout="column" fxLayoutAlign="center center">\n <div *ngIf="enabled">\n <mat-icon (click)="upm()"\n >keyboard_arrow_up</mat-icon\n >\n </div>\n\n <input\n\n step="step"\n style="width:40px;text-align:center;"\n (keydown)="onKeyDown1($event)"\n (focusout)="onMi()"\n [disabled]="!enabled"\n [(ngModel)]="m"\n\n />\n <div *ngIf="enabled" style="pointer_mouse">\n <mat-icon (click)="dom()"\n style="pointer_mouse" >keyboard_arrow_down</mat-icon\n >\n </div>\n </div>\n </div>\n\n\n <div fxLayout="column" [hidden]="!vertical || !enabled">\n <div fxLayout="row" fxLayoutAlign="start center">\n <b style="min-width:70px">{{ label_hh }}</b>\n <div fxLayout="column" fxLayoutAlign="start center" fxLayoutGap="0px">\n\n <div fxLayout="row" fxLayoutAlign="start center"> \n <div fxLayout="column" fxLayoutAlign="start center" fxLayoutGap="0px">\n <div *ngIf="enabled" >\n <mat-icon (click)="uph()">keyboard_arrow_up</mat-icon>\n </div>\n\n <input\n style="width:40px;text-align:center;"\n (keydown)="onKeyDown($event)"\n (focusout)="onFu()"\n [disabled]="!enabled"\n [(ngModel)]="h"\n\n />\n <div *ngIf="enabled" style="pointer_mouse">\n <mat-icon (click)="doh()"\n style="pointer_mouse">keyboard_arrow_down</mat-icon\n >\n </div>\n </div>\n \n <div *ngFor="let u of arr_hh" [hidden]="!enabled">\n <button mat-flat-button color="primary" (click)="setta_h(u)" class="pad_b">\n {{u}}\n </button> \n </div>\n </div>\n\n </div>\n </div>\n\n\n\n <div fxLayout="row" fxLayoutAlign="start center">\n <b style="min-width:70px">{{ label_mm }}</b>\n <div fxLayout="column" fxLayoutAlign="start center" fxLayoutGap="0px">\n\n <div fxLayout="row" fxLayoutAlign="start center"> \n <div fxLayout="column" fxLayoutAlign="start center" fxLayoutGap="0px">\n <div *ngIf="enabled" style="pointer_mouse">\n <mat-icon (click)="upm()" style="pointer_mouse">keyboard_arrow_up</mat-icon>\n </div>\n\n <input\n style="width:40px;text-align:center;"\n (keydown)="onKeyDown1($event)"\n (focusout)="onMi()"\n [disabled]="!enabled"\n [(ngModel)]="m"\n\n step="step"\n\n />\n <div *ngIf="enabled" style="pointer_mouse">\n <mat-icon (click)="dom()" style="pointer_mouse"\n >keyboard_arrow_down</mat-icon\n >\n </div>\n </div>\n \n <div *ngFor="let u of arr_mm" [hidden]="!enabled">\n <button mat-flat-button color="primary" (click)="setta_m(u)" class="pad_b">\n {{u}}\n </button> \n </div>\n </div>\n\n </div>\n </div>\n </div>\n\n ',styles:["\n.pad_b {\n padding-left: 5px !important;\n padding-right: 5px !important;\n padding-top: 0px !important;\n padding-bottom: 0px !important;\n min-width: 30px !important;\n min-height: 8px !important;\n font-size:14px !important;\n}\n\n .hhh {\n height: 63px;\n width: 100px;\n background-color: rgba(255, 0, 0, 0.1);\n }\n\n .pointer_mouse {\n cursor: pointer;\n user-select: none;\n }\n "]}]}],Zt.ctorParameters=function(){return[{type:Dt},{type:e.MatDialog},{type:wt},{type:i.ToastrService},{type:Ct}]},Zt.propDecorators={maxore:[{type:n.Input}],label:[{type:n.Input}],enabled:[{type:n.Input}],vertical:[{type:n.Input}],label_hh:[{type:n.Input}],label_mm:[{type:n.Input}],step:[{type:n.Input}],arr_hh:[{type:n.Input}],arr_mm:[{type:n.Input}],selchange:[{type:n.Output}]};var te=function(){function t(){}return t.prototype.agInit=function(t){this.params=t},t.prototype.refresh=function(){return!0},t}();te.decorators=[{type:n.Component,args:[{selector:"currency-cell",template:'{{ params.value | currency: "EUR" }}'}]}];var ee=function(){function t(t,e,i,n){this.toastr=t,this.http=e,this.router=i,this.app_s=n,this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT,this.goto_after="",this.username="",this.headers=new r.HttpHeaders({"Content-Type":"application/json"})}return t.prototype.logout=function(){this.app_s.user=null,this.app_s.user_name=null,this.app_s.user_surname=null,this.app_s.user_idp=null,this.app_s.user_email=null,this.app_s.user_roles=null,this.app_s.user_lang=null,this.app_s.user_isadmin=null,this.app_s.token=null,localStorage.removeItem(this.app_s.COMPANY_KEY+"token"),this.goto_after="",1!=this.app_s.LOGIN_EXT?this.router.navigate(["login"]):window.location.href=this.app_s.LOGOUT_URL_EXT},t.prototype.login=function(t,e,i){var n=this;void 0===i&&(i=!0),this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT;var o=JSON.stringify({username:t,password:e});return 1==this.app_s.LDAP_AUTH&&(o=JSON.stringify({username:t,password:e,ldap_auth:1})),this.http.post(this.url,o,{headers:this.headers}).pipe(l.map((function(t){var e;if(t?"KO"===t.result_msg?e=new Error(t.msg):t.result_data.length>0&&localStorage.setItem(n.app_s.COMPANY_KEY+"token",t.result_data[0].token):e=new Error("Empty server response"),e)throw console.error(e),i&&n.toastr.error(e.message),new Error(e);return t||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.register_user=function(t,e,i,n,o,s,a){var r=this;void 0===a&&(a=!0),this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT+"_register";var p=JSON.stringify({name:t,surname:e,email:i,password:o,username:n,add_role:s});return this.http.post(this.url,p,{headers:this.headers}).pipe(l.map((function(t){var e;if(t?"KO"===t.result_msg?e=new Error(t.msg):t.result_data.length>0&&localStorage.setItem(r.app_s.COMPANY_KEY+"token",t.result_data[0].token):e=new Error("Empty server response"),e)throw console.error(e),a&&r.toastr.error(e.message),new Error(e);return t||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.login_by_email=function(t,e){var i=this;void 0===e&&(e=!0),this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT+"_email";var n=JSON.stringify({email:t});return 1==this.app_s.LDAP_AUTH&&(n=JSON.stringify({email:t})),this.http.post(this.url,n,{headers:this.headers}).pipe(l.map((function(t){var n;if(t?"KO"===t.result_msg?n=new Error(t.msg):t.result_data.length>0&&localStorage.setItem(i.app_s.COMPANY_KEY+"token",t.result_data[0].token):n=new Error("Empty server response"),n)throw console.error(n),e&&i.toastr.error(n.message),new Error(n);return t||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.get_user_info=function(t,e){var i=this;void 0===e&&(e=!0),this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT;var n=JSON.stringify({username_info:t});return this.http.post(this.url,n,{headers:this.headers}).pipe(l.map((function(t){var n;if(t?"KO"===t.result_msg&&(n=new Error(t.msg)):n=new Error("Empty server response"),n)throw console.error(n),e&&i.toastr.error(n.message),new Error(n);return t||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.passrecovery=function(t,e){var i=this;void 0===e&&(e=!0);var n=JSON.stringify({email:t,websiteroot:this.app_s.COMPANY_SITE_ROOT,op:"send_email"});return this.http.post(this.app_s.API_ENDPOINT+this.app_s.PASSRECOVERY_ENDPOINT,n,{headers:this.headers}).pipe(l.map((function(t){var n;if(t?"KO"===t.result_msg&&(n=new Error(t.msg)):n=new Error("Empty server response"),n)throw console.error(n),e&&i.toastr.error(n.message),new Error(n);return t||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.checktoken=function(t,e){var i=this;void 0===e&&(e=!0);var n=JSON.stringify({res_rep:t,op:"check_token"});return this.http.post(this.app_s.API_ENDPOINT+this.app_s.PASSRECOVERY_ENDPOINT,n,{headers:this.headers}).pipe(l.map((function(t){var n;if(t?"KO"===t.result_msg&&(n=new Error(t.msg)):n=new Error("Empty server response"),n)throw console.error(n),e&&i.toastr.error(n.message),new Error(n);return t||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.change_password=function(t,e,i){var n=this;void 0===i&&(i=!0);var o=JSON.stringify({token:t,password:e,op:"change_password"});return this.http.post(this.app_s.API_ENDPOINT+this.app_s.PASSRECOVERY_ENDPOINT,o,{headers:this.headers}).pipe(l.map((function(t){var e;if(t?"KO"===t.result_msg&&(e=new Error(t.msg)):e=new Error("Empty server response"),e)throw console.error(e),i&&n.toastr.error(e.message),new Error(e);return t||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.checkCredentials_toLogin=function(){return"/login"!=this.router.url&&-1==this.router.url.indexOf("/rp/")&&(this.goto_after=window.location.toString()),null!==localStorage.getItem(this.app_s.COMPANY_KEY+"token")||(-1==this.router.url.indexOf("/rp/")&&this.router.navigate(["login"]),!1)},t.prototype.checkCredentials=function(){return"/login"!=this.router.url&&-1==this.router.url.indexOf("/rp/")&&(this.goto_after=window.location.toString()),null!==localStorage.getItem(this.app_s.COMPANY_KEY+"token")},t}();ee.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new ee(n.ɵɵinject(i.ToastrService),n.ɵɵinject(r.HttpClient),n.ɵɵinject(d.Router),n.ɵɵinject(wt))},token:ee,providedIn:"root"}),ee.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],ee.ctorParameters=function(){return[{type:i.ToastrService},{type:r.HttpClient},{type:d.Router},{type:wt}]};var ie=function(){function t(t,e,i,n){var o=this;this.dialogRef=t,this._fileservice=e,this.m_appService=i,this.data=n,this.allegati=[],this.App="",this.K="",this.Filename="",this.email_obj={},this.title="ANTEPRIMA EMAIL",this.App=n.App,this.K=n.K,this.Filename=n.Filename;var s=new gt;s.command="exec_app",s.p1="Email_Reader",s.p2=n.App+"|"+n.K+"|"+n.Filename,this._fileservice.doQuery(s).subscribe((function(t){o.email_obj=JSON.parse(t.msg),o.allegati=o.email_obj.allegati.split("||")}))}return t.prototype.init_w=function(){},t.prototype.open_eml=function(){window.open(this.m_appService.COMPANY_SITE_ROOT+"/uploads/"+this.App+"/"+this.K+"/"+this.Filename)},t.prototype.open_all=function(t){window.open(this.m_appService.COMPANY_SITE_ROOT+"/uploads/"+this.App+"/"+this.K+"/ant/"+t)},t}();ie.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="dialogRef.close(null)" /> </div><br>\n <div style="width:100%;overflow:auto;" [style.height]="(m_appService.getState().body_h-240)+\'px\'">\n <mat-toolbar color="primary">{{title | translate}}\n <span class="fill-remaining-space"></span>\n\n </mat-toolbar>\n <br>\n\n <div style="width:100%;height:500px">\n <div style="width:100%;height:100%">\n <div fxLayout="column">\n <div fxLayout="row">\n <div style="width:100px">Data:</div>\n <div>{{email_obj.dt}}</div>\n </div>\n <div fxLayout="row">\n <div style="width:100px">From:</div>\n <div [innerHTML]="email_obj.from" ></div>\n </div>\n <div fxLayout="row">\n <div style="width:100px">To:</div>\n <div [innerHTML]="email_obj.to" ></div>\n </div>\n <div fxLayout="row">\n <div style="width:100px">CC:</div>\n <div [innerHTML]="email_obj.cc" ></div>\n </div>\n <div fxLayout="row">\n <div style="width:100px">Subject:</div>\n <div [innerHTML]="email_obj.subject" ></div>\n </div>\n <div style="width:100px">Body:</div>\n <div style="overflow:auto;" [style.height]="(m_appService.getState().body_h-490)+\'px\'">\n <div fxLayout="row" [hidden]="email_obj.is_html==\'NO\'">\n\n <div [innerHTML]="email_obj.body" ></div>\n </div>\n <div fxLayout="row" [hidden]="email_obj.is_html==\'SI\'">\n\n <div>{{email_obj.body}}</div>\n </div>\n </div>\n <hr style="width:100%">\n <div fxLayout="row" fxLayoutGap="15px">\n <div style="width:100px">Download Eml:</div>\n <button mat-flat-button color="primary" (click)="open_eml()">Download</button>\n <div> </div>\n <div style="width:100px">Allegati:</div>\n <div *ngFor="let u of allegati" >\n <button mat-flat-button color="primary" (click)="open_all(u)">{{u}}</button>\n </div>\n\n\n\n </div>\n\n\n </div>\n </div>\n </div>\n '}]}],ie.ctorParameters=function(){return[{type:e.MatDialogRef},{type:Tt},{type:wt},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var ne=function(){function t(t,e,i,o,s,a,r){this._appservice=t,this._dataService=e,this.toastr=i,this.dialog=o,this.auth_s=s,this.uti=a,this._trs=r,this.show_version=!1,this.enabled=!0,this.force_en=!1,this.show_dim=!0,this.show_descri=!0,this.label="",this.sovrascrivi_path="",this.ruolo_supervisore="[ZZZ_DIS_CC]",this.access_control=!1,this.show_images=!0,this.can_delete_owner=!0,this.show_upload=!0,this.show_download=!0,this.description_required=!1,this.selezionare_tipologia="Selezionare la Tipologia",this.b_initt=!1,this.expand=new n.EventEmitter,this.file_copy=new n.EventEmitter,this.change=new n.EventEmitter,this.call_upload=new n.EventEmitter,this.init_end=new n.EventEmitter,this.App="",this.K="",this.image_type=!1,this.b_edit_loaded=!1,this.current_v=-1,this.b_False=!1,this.b_mobile=!1,this.b_ini=!1,this.m_p_tipo="",this.multi_list=!1,this.m_programma_da_eseguire=""}return t.prototype.set_curr_version=function(t){this.show_version=!0,this.current_v=t},t.prototype.output_ris=function(t){if(null!=t&&null!=t.response){var e=JSON.parse(t.response);console.log(e),null!=e&&null!=e.msg&&""!=e.msg&&("KO"==e.result_msg&&this.toastr.error(e.msg),"OK"==e.result_msg&&this.toastr.info(e.msg))}},t.prototype.call_up=function(t){this.call_upload.emit({App:this.App,K:this.K,descrizione:t.descrizione,single:!1,username:this._appservice.user,tipo:this.m_p_tipo,local_path:this._appservice.LOCAL_PATH,p1:this.m_programma_da_eseguire,ver:this.current_v})},t.prototype.preview_email=function(t){this.dialog.open(ie,{data:{App:t.App,K:t.K,Filename:t.Filename},width:"95%"}).afterClosed().subscribe((function(t){}))},t.prototype.download_all=function(t){null!=t.APP&&(t.App=t.APP),""==this.sovrascrivi_path?window.open(this._appservice.COMPANY_SITE_ROOT+"/uploads/"+t.App+"/"+t.K+"/"+t.Filename):window.open(this.sovrascrivi_path+"/uploads/"+t.App+"/"+t.K+"/"+t.Filename)},t.prototype.edit_tipo=function(t){var e=this,i=new vt;i.sql=this.m_p_tipo,i.types=[],i.values=[],this._dataService.doQuery(i).subscribe((function(i){if(null!=i&&"OK"==i.result_msg){var n=e.dialog.open(yt,{width:"650px"});setTimeout((function(){n.componentInstance.set_selection("Tipologia Allegato",i.result_data)})),n.afterClosed().subscribe((function(i){if(null!=i){var n=new vt;n.sql="UPDATE_ALLEGATI_TIPO",n.types=["int","string"],n.values=[t.id,i.descrizione_valore],e._dataService.doQuery(n).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.ref_allegato()}))}}))}}))},t.prototype.edit_descri=function(t){var e=this,i=this.dialog.open(bt);setTimeout((function(){i.componentInstance.label=e._trs.instant("Descrizione Allegato"),i.componentInstance.valore=t.descrizione,i.componentInstance.min_chars=0})),i.afterClosed().subscribe((function(i){if(null!=i){var n=new vt;n.sql="UPDATE_ALLEGATI_DESCRIZIONE",n.types=["int","string"],n.values=[t.id,i],e._dataService.doQuery(n).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.ref_allegato()}))}}))},t.prototype.delete=function(t){var e=this;localStorage.setItem(this._appservice.COMPANY_KEY+"title_dialog",this._trs.instant("Conferma Operazione")),localStorage.setItem(this._appservice.COMPANY_KEY+"msg_dialog",this._trs.instant("Confermi l'eliminazione dell'elemento?")),this.dialog.open(It).afterClosed().subscribe((function(i){if(i){var n=new vt;n.sql="DELETE_ALLEGATO",n.types=["int","string"],n.values=[t.id,e.auth_s.username],e._dataService.doQuery(n).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(e.ref_allegato(),e.toastr.info(e._trs.instant("INFO"),e._trs.instant("ALLEGATO ELIMINATO"),{timeOut:1e3,progressBar:!0}))}))}}))},t.prototype.load_component=function(){var t=this;setTimeout((function(){t.upc.single=!1,t.b_mobile=t._appservice.getState().pageFullscreen,t.force_en?t.upc.init(t.App,t.K,t._trs.instant("Attachment Description"),t.m_p_tipo,t.m_programma_da_eseguire,!1,!1,!0,t.current_v):t.upc.init(t.App,t.K,t._trs.instant("Descrizione Allegato"),t.m_p_tipo,t.m_programma_da_eseguire,!1,!1,!0,t.current_v),t.m_p_tipo.indexOf("SELECT_")>-1&&(t.multi_list=!0),t.ref_allegato()})),"[ZZZ_DIS_CC]"!=this.ruolo_supervisore&&(this.access_control=!0),null==this._appservice.user_lang&&(this._appservice.user_lang="it"),"en"==this._appservice.user_lang.toLocaleLowerCase()&&(this.force_en=!0)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.b_initt=!0,t.init_end.emit()}),700),this.load_component()},t.prototype.init=function(t,e,i,n){void 0===i&&(i=""),void 0===n&&(n=""),this.App=t,this.K=e,this.b_ini=!0,this.b_edit_loaded=!1,this.m_p_tipo=i,this.m_programma_da_eseguire=n,this.load_component()},t.prototype.do_upload=function(t,e,i,n,o){this.upc.init(t,e,i,n,o,!1,!0,this.show_upload)},t.prototype.ref_allegato=function(){var t=this;if(null!=this.App&&""!=this.App){var e=new vt;e.sql="SELECT_ALLEGATO_INFO",e.types=["string","string"],e.values=[this.App,this.K],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.arr_g=e.result_data;for(var i="webinfo",n=0;n<t.arr_g.length;n++){null!=t.arr_g[n].APP&&(t.arr_g[n].App=t.arr_g[n].APP),null!=t.arr_g[n].descrizione?t.arr_g[n].descrizione_vis=t.arr_g[n].descrizione.split("\n").join("<br>"):t.arr_g[n].descrizione_vis="";var o=t.arr_g[n].Filename.split(".");if(""==t.sovrascrivi_path?(t.arr_g[n].url=t._appservice.COMPANY_SITE_ROOT+"/uploads/"+t.arr_g[n].App+"/"+t.arr_g[n].K+"/"+t.arr_g[n].Filename,t.arr_g[n].url_orig=t._appservice.COMPANY_SITE_ROOT+"/uploads/"+t.arr_g[n].App+"/"+t.arr_g[n].K+"/"+t.arr_g[n].Filename):(t.arr_g[n].url=t.sovrascrivi_path+"/uploads/"+t.arr_g[n].App+"/"+t.arr_g[n].K+"/"+t.arr_g[n].Filename,t.arr_g[n].url_orig=t.sovrascrivi_path+"/uploads/"+t.arr_g[n].App+"/"+t.arr_g[n].K+"/"+t.arr_g[n].Filename),-1!="3G2|3GA|3GP|7Z|AA|AAC|AC|ACCDB|ACCDT|ADN|AI|AIF|AIFC|AIFF|AIT|AMR|ANI|APK|APP|APPLESCRIPT|ASAX|ASC|ASCX|ASF|ASH|ASHX|ASMX|ASP|ASPX|ASX|AU|AUP|AVI|AXD|AZE|BAK|BASH|BAT|BIN|BLANK|BMP|BOWERRC|BPG|BROWSER|BZ2|C|CAB|CAD|CAF|CAL|CD|CER|CFG|CFM|CFML|CGI|CLASS|CMD|CODEKIT|COFFEE|COFFEELINTIGNORE|COM|COMPILE|CONF|CONFIG|CPP|CPTX|CR2|CRDOWNLOAD|CRT|CRYPT|CS|CSH|CSON|CSPROJ|CSS|CSV|CUE|DAT|DB|DBF|DEB|DGN|DIST|DIZ|DLL|DMG|DNG|DOC|DOCB|DOCM|DOCX|DOT|DOTM|DOTX|DOWNLOAD|DPJ|DS_STORE|DTD|DWG|DXF|EDITORCONFIG|EL|ENC|EOT|EPS|EPUB|ESLINTIGNORE|EXE|F4V|FAX|FB2|FLA|FLAC|FLV|FOLDER|GADGET|GDP|GEM|GIF|GITATTRIBUTES|GITIGNORE|GO|GPG|GZ|H|HANDLEBARS|HBS|HEIC|HS|HSL|HTM|HTML|IBOOKS|ICNS|ICO|ICS|IDX|IFF|IFO|IMAGE|IMG|IN|INDD|INF|INI|ISO|J2|JAR|JAVA|JPE|JPEG|JPG|JS|JSON|JSP|JSX|KEY|KF8|KMK|KSH|KUP|LESS|LEX|LICX|LISP|LIT|LNK|LOCK|LOG|LUA|M|M2V|M3U|M3U8|M4|M4A|M4R|M4V|MAP|MASTER|MC|MD|MDB|MDF|ME|MI|MID|MIDI|MK|MKV|MM|MO|MOBI|MOD|MOV|MP2|MP3|MP4|MPA|MPD|MPE|MPEG|MPG|MPGA|MPP|MPT|MSI|MSU|NEF|NES|NFO|NIX|NPMIGNORE|ODB|ODS|ODT|OGG|OGV|OST|OTF|OTT|OVA|OVF|P12|P7B|PAGES|PART|PCD|PDB|PDF|PEM|PFX|PGP|PH|PHAR|PHP|PKG|PL|PLIST|PM|PNG|PO|POM|POT|POTX|PPS|PPSX|PPT|PPTM|PPTX|PROP|PS|PS1|PSD|PSP|PST|PUB|PY|PYC|QT|RA|RAM|RAR|RAW|RB|RDF|RESX|RETRY|RM|ROM|RPM|RSA|RSS|RTF|RU|RUB|SASS|SCSS|SDF|SED|SH|SITEMAP|SKIN|SLDM|SLDX|SLN|SOL|SQL|SQLITE|STEP|STL|SVG|SWD|SWF|SWIFT|SYS|TAR|TCSH|TEX|TFIGNORE|TGA|TGZ|TIF|TIFF|TMP|TORRENT|TS|TSV|TTF|TWIG|TXT|UDF|VB|VBPROJ|VBS|VCD|VCS|VDI|VDX|VMDK|VOB|VSCODEIGNORE|VSD|VSS|VST|VSX|VTX|WAR|WAV|WBK|WEBINFO|WEBM|WEBP|WMA|WMF|WMV|WOFF|WOFF2|WPS|WSF|XAML|XCF|XLM|XLS|XLSM|XLSX|XLT|XLTM|XLTX|XML|XPI|XPS|XRB|XSD|XSL|XSPF|XZ|YAML|YML|Z|ZIP|ZSH".indexOf(o[o.length-1].toLocaleUpperCase())&&(i=o[o.length-1].toLocaleLowerCase()),t.arr_g[n].icon=i+".svg",t.can_delete_owner?(t.arr_g[n].can_delete=!t.access_control||t.arr_g[n].idp==t._appservice.user||t.uti.hasRole(t.ruolo_supervisore),"[ZZZ_DIS_CC]"==t.ruolo_supervisore?t.arr_g[n].can_delete_m=t.arr_g[n].idp:t.arr_g[n].can_delete_m=t.arr_g[n].idp+",["+t.ruolo_supervisore+"]"):(t.arr_g[n].can_delete=!t.access_control||t.uti.hasRole(t.ruolo_supervisore),"[ZZZ_DIS_CC]"==t.ruolo_supervisore?t.arr_g[n].can_delete_m="":t.arr_g[n].can_delete_m="["+t.ruolo_supervisore+"]"),t.arr_g[n].can_edit=!t.access_control||t.arr_g[n].idp==t._appservice.user||t.uti.hasRole(t.ruolo_supervisore),-1==t.arr_g[n].Filename.indexOf(".jpg")&&-1==t.arr_g[n].Filename.indexOf(".gif")&&-1==t.arr_g[n].Filename.indexOf(".png")||!t.show_images)t.arr_g[n].type="O";else{if(t.arr_g[n].type="IMG",t.arr_g[n].image_original=[t.arr_g[n].url],null!=t.arr_g[n].preview&&1==t.arr_g[n].preview){var s=t.arr_g[n].url.split("."),a=s.pop();t.arr_g[n].url=s.join(".")+"_preview."+a}t.image_type=!0,t.arr_g[n].image_thumbnail=[t.arr_g[n].url]}}t.change.emit()}}))}},t}();ne.decorators=[{type:n.Component,args:[{selector:"FHUploadPanel",template:'\n <div fxLayout="column">\n <h3 *ngIf="label != \'\'">{{ label }}</h3>\n <div fxLayout="column">\n\n <div [hidden]="!enabled || !show_upload">\n\n <FHUpload\n [single]="false"\n [selezionare_tipologia]="selezionare_tipologia "\n [lascia_il_file] = "force_en ? \'Drop here to confim\':\'Lascia il file per confermarmare upload\' "\n [trascina_il_file] = "force_en ? \'Drop a file here o click to upload a file\':\'Trascina un file qui o Clicca per avviare upload\' "\n\n [show_descri]="show_descri"\n [descri_obb]="description_required"\n [label_attendere]="\n force_en ? \'UPLOADING\' : \'ATTENDERE UPLOAD IN CORSO\'\n "\n [fixed_label]="\n force_en\n ? \' (insert the description here before uploading the file)\'\n : \' (INSERISCI QUI LA DESCRIZIONE PRIMA DI CARICARE IL FILE)\'\n "\n [allegato_inserito]="\n force_en ? \'Attachment Inserted\' : \'ALLEGATO INSERITO\'\n "\n [lista_allegati]="arr_g"\n (change)="ref_allegato();output_ris($event)"\n (call_upload)="call_up($event)"\n #upc\n ></FHUpload>\n\n </div>\n <table width="98%" class="fh_table" *ngIf="!image_type && !b_mobile">\n <thead>\n <tr class="header">\n <th style="width:40px" class="actions" *ngIf="show_download"></th>\n <th [fxShow.lt-sm]="false" style="width:40px"></th>\n <th style="width:50%">{{ force_en ? "Name" : "Nome" }}</th>\n <th [fxShow.lt-sm]="false" *ngIf="show_version" style="width:30px;text-align:center">Ver.</th>\n <th [fxShow.lt-sm]="false" *ngIf="show_dim" style="width:30px;text-align:center">Dim.</th>\n <th [fxShow.lt-sm]="false" *ngIf="show_descri" style="width:40%">\n {{ force_en ? "Description" : "Descrizione" }}\n </th>\n <th *ngIf="multi_list" style="width:20%">\n {{ force_en ? "Type" : "Tipo" }}\n </th>\n\n <th style="width:40px" class="actions"></th>\n <th [fxShow.lt-sm]="false" style="width:30%">{{ force_en ? "User" : "Utente" }}</th>\n <th [fxShow.lt-sm]="false" style="width:240px;text-align:center">\n {{ force_en ? "Date" : "Data" }}\n </th>\n\n <th *ngIf="enabled" style="width:40px" class="actions"></th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="let app of arr_g; let odd = odd; let even = even"\n style="font-size: 15px;"\n [ngClass]="{ odd: odd, even: even }"\n >\n <td style="text-align:center" *ngIf="show_download">\n\n <button [hidden]="app.Filename.indexOf(\'.eml\')==-1 && app.Filename.indexOf(\'.msg\')==-1"\n mat-icon-button\n [matTooltip]="\'Preview\' "\n (click)="preview_email(app)"\n >\n <mat-icon>visibility</mat-icon>\n </button>\n <button\n mat-icon-button\n [matTooltip]="\'Download File\' "\n (click)="download_all(app)"\n >\n <mat-icon>cloud_download</mat-icon>\n </button>\n </td>\n <td [fxShow.lt-sm]="false"\n style="text-align:center;vertical-align: middle;width:36px;height:36px;" (click)="download_all(app)"\n >\n <div\n style="text-align:center;vertical-align: middle;width:28px;height:28px;"\n >\n <img\n src="assets/icons/square-o/{{ app.icon }}"\n style="width:28px;height:28px;"\n />\n </div>\n </td>\n <td><button mat-stroked-button color="primary" (click)="download_all(app)">{{ app.Filename }}</button></td>\n <td style="text-align:center" *ngIf="show_version" [fxShow.lt-sm]="false">{{ app.v }}</td>\n <td style="text-align:center" *ngIf="show_dim" [fxShow.lt-sm]="false">{{ app.Filesize }}</td>\n <td [fxShow.lt-sm]="false" *ngIf="show_descri">\n <div fxLayout="row">\n <div *ngIf="enabled">\n <a\n mat-icon-button\n [matTooltip]="\'Modifica Descrizione\' | translate"\n *ngIf="app.can_edit"\n (click)="edit_descri(app)"\n >\n <mat-icon>edit</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]="\n _trs.instant(\'Modifica Descrizione consentita solo a\') +\': \' + app.nc\n "\n *ngIf="!app.can_edit"\n [disabled]="true"\n >\n <mat-icon>edit</mat-icon>\n </a>\n </div>\n <div\n [innerHTML]="app.descrizione_vis"\n style="width:100%"\n ></div>\n </div>\n </td>\n\n <td *ngIf="multi_list">\n <div fxLayout="row">\n <a\n mat-icon-button\n [matTooltip]="\'Modifica Tipo\' | translate"\n *ngIf="app.can_edit"\n (click)="edit_tipo(app)"\n >\n <mat-icon>edit</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]="\n _trs.instant(\'Modifica Tipologia consentita solo a\')+\': \' + app.nc\n "\n *ngIf="!app.can_edit"\n [disabled]="true"\n >\n <mat-icon>edit</mat-icon>\n </a>\n\n <div [innerHTML]="app.tipo" style="width:100%"></div>\n </div>\n </td>\n\n <td\n style="min-width:400px;min-height: 400px"\n *ngIf="app.type == \'IMG\'"\n >\n <fh-image-viewer [u]="app"></fh-image-viewer>\n </td>\n <td *ngIf="app.type != \'IMG\'"></td>\n <td [fxShow.lt-sm]="false">{{ app.nc }}</td>\n <td [fxShow.lt-sm]="false" style="text-align:center">\n {{ app.dt_ins | date: "dd/MM/yyyy HH:mm:ss" }}\n </td>\n\n\n <td *ngIf="enabled" style="text-align:center">\n <a\n mat-icon-button\n [matTooltip]="\'Elimina File\' "\n *ngIf="app.can_delete"\n (click)="delete(app)"\n >\n <mat-icon>delete</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]="\n _trs.instant(\'Eliminazione consentita solo a\')+\': \' + app.can_delete_m\n "\n *ngIf="!app.can_delete"\n [disabled]="true"\n >\n <mat-icon>delete</mat-icon>\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n <table width="98%" class="fh_table" *ngIf="image_type && !b_mobile">\n <thead>\n <tr class="header">\n <th style="width:40px" class="actions" *ngIf="show_download"></th>\n <th [fxShow.lt-sm]="false" style="width:40px"></th>\n <th [fxShow.lt-sm]="false" style="width:50%">{{ force_en ? "Name" : "Nome" }}</th>\n <th [fxShow.lt-sm]="false" *ngIf="show_version" style="width:30px;text-align:center">Ver.</th>\n <th [fxShow.lt-sm]="false" *ngIf="show_dim" style="width:30px;text-align:center">Dim.</th>\n\n <th [fxShow.lt-sm]="false" style="width:20%" *ngIf="show_descri">\n {{ force_en ? "Description" : "Descrizione" }}\n </th>\n <th *ngIf="multi_list" style="width:10%" [fxShow.lt-sm]="false">\n {{ force_en ? "Type" : "Tipo" }}\n </th>\n <th style="width:40%"></th>\n\n <th [fxShow.lt-sm]="false" style="width:10%">{{ force_en ? "User" : "Utente" }}</th>\n <th [fxShow.lt-sm]="false" style="width:240px;text-align:center">\n {{ force_en ? "Date" : "Data" }}\n </th>\n\n <th *ngIf="enabled" style="width:40px" class="actions"></th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="let app of arr_g; let odd = odd; let even = even"\n style="font-size: 15px;"\n [ngClass]="{ odd: odd, even: even }"\n >\n <td style="text-align:center" *ngIf="show_download">\n\n<button [hidden]="app.Filename.indexOf(\'.eml\')==-1 && app.Filename.indexOf(\'.msg\')==-1"\n mat-icon-button\n [matTooltip]="\'Preview\' "\n (click)="preview_email(app)"\n >\n <mat-icon>visibility</mat-icon>\n </button>\n\n\n <button\n mat-icon-button\n [matTooltip]="\'Download File\' "\n (click)="download_all(app)"\n >\n <mat-icon>cloud_download</mat-icon>\n </button>\n</td>\n <td [fxShow.lt-sm]="false"\n style="text-align:center;vertical-align: middle;width:36px;height:36px;" (click)="download_all(app)"\n >\n <div\n style="text-align:center;vertical-align: middle;width:28px;height:28px;"\n >\n <img\n src="assets/icons/square-o/{{ app.icon }}"\n style="width:28px;height:28px;"\n />\n </div>\n </td>\n\n <td [fxShow.lt-sm]="false"><button mat-stroked-button color="primary" (click)="download_all(app)">{{ app.Filename }}</button></td>\n <td style="text-align:center" *ngIf="show_version" [fxShow.lt-sm]="false">{{ app.v }}</td>\n <td [fxShow.lt-sm]="false" *ngIf="show_dim" style="text-align:center">{{ app.Filesize }}</td>\n <td [fxShow.lt-sm]="false" *ngIf="show_descri">\n <div fxLayout="row">\n <div *ngIf="enabled">\n <a\n mat-icon-button\n [matTooltip]="\'Modifica Descrizione\' | translate"\n *ngIf="app.can_edit"\n (click)="edit_descri(app)"\n >\n <mat-icon>edit</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]="\n _trs.instant( \'Modifica Descrizione consentita solo a\')+\': \' + app.nc\n "\n *ngIf="!app.can_edit"\n [disabled]="true"\n >\n <mat-icon>edit</mat-icon>\n </a>\n </div>\n <div\n [innerHTML]="app.descrizione_vis"\n style="width:100%"\n ></div>\n </div>\n </td>\n <td *ngIf="multi_list">\n <div fxLayout="row">\n <a\n mat-icon-button\n [matTooltip]="\'Modifica Tipo\' | translate"\n *ngIf="app.can_edit"\n (click)="edit_tipo(app)"\n >\n <mat-icon>edit</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]="\n _trs.instant( \'Modifica Tipologia consentita solo a\')+\':\' + app.nc\n "\n *ngIf="!app.can_edit"\n [disabled]="true"\n >\n <mat-icon>edit</mat-icon>\n </a>\n\n <div [innerHTML]="app.tipo" style="width:100%"></div>\n </div>\n </td>\n\n <td\n style="min-width:400px;min-height: 400px"\n *ngIf="app.type == \'IMG\'"\n >\n <fh-image-viewer [u]="app"></fh-image-viewer>\n </td>\n <td *ngIf="app.type != \'IMG\'"><div [fxShow.lt-sm]="true"><button mat-stroked-button color="primary" (click)="download_all(app)">{{ app.Filename }}</button></div></td>\n <td [fxShow.lt-sm]="false">{{ app.nc }}</td>\n <td style="text-align:center" [fxShow.lt-sm]="false">\n {{ app.dt_ins | date: "dd/MM/yyyy HH:mm:ss" }}\n </td>\n\n\n <td *ngIf="enabled" style="text-align:center">\n <a\n mat-icon-button\n [matTooltip]="\'Elimina File\' "\n *ngIf="app.can_delete"\n (click)="delete(app)"\n >\n <mat-icon>delete</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]="\n _trs.instant( \'Cancellazione consentita solo a\')+\': \' + app.can_delete_m\n "\n *ngIf="!app.can_delete"\n [disabled]="true"\n >\n <mat-icon>delete</mat-icon>\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n <table width="98%" class="fh_table" *ngIf="b_mobile">\n <tbody>\n <tr\n *ngFor="let app of arr_g; let odd = odd; let even = even"\n style="font-size: 15px;"\n [ngClass]="{ odd: odd, even: even }"\n >\n <td\n style="text-align:center;vertical-align: middle;width:36px;height:36px;" (click)="download_all(app)"\n >\n <div\n style="text-align:center;vertical-align: middle;width:28px;height:28px;"\n >\n <img\n src="assets/icons/square-o/{{ app.icon }}"\n style="width:28px;height:28px;"\n />\n </div>\n </td>\n <td *ngIf="b_mobile" style="text-align:center">\n <button mat-stroked-button color="primary" (click)="download_all(app)">{{ app.Filename }}</button><br /><br />\n <button\n style="background-color: #F5F5F5"\n (click)="download_all(app)"\n mat-flat-button\n >\n DOWNLOAD\n </button>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div *ngIf="!b_ini && b_initt" style="color:#ff0000">\n <b>{{\'ATTENZIONE COMPONENTE NON INIZIALIZZATO\' }}</b>\n </div>\n ',styles:[""]}]}],ne.ctorParameters=function(){return[{type:wt},{type:Dt},{type:i.ToastrService},{type:e.MatDialog},{type:ee},{type:Ct},{type:p.TranslateService}]},ne.propDecorators={enabled:[{type:n.Input}],force_en:[{type:n.Input}],show_dim:[{type:n.Input}],show_descri:[{type:n.Input}],label:[{type:n.Input}],sovrascrivi_path:[{type:n.Input}],ruolo_supervisore:[{type:n.Input}],access_control:[{type:n.Input}],show_images:[{type:n.Input}],can_delete_owner:[{type:n.Input}],show_upload:[{type:n.Input}],show_download:[{type:n.Input}],description_required:[{type:n.Input}],selezionare_tipologia:[{type:n.Input}],expand:[{type:n.Output}],file_copy:[{type:n.Output}],change:[{type:n.Output}],call_upload:[{type:n.Output}],init_end:[{type:n.Output}],upc:[{type:n.ViewChild,args:["upc"]}]};var oe=function(){function t(t,e,i,o,s,a){var r=this;this._dataService=t,this.toastr=e,this.dialog=i,this.app_s=o,this.uti=s,this._trs=a,this.lascia_il_file="Lascia il file per confermarmare upload",this.trascina_il_file="Trascina un file qui o Clicca per avviare upload",this.show_download_button=!0,this.show_descri=!0,this.enabled=!0,this.single=!0,this.descri_obb=!1,this.programma_da_eseguire="",this.label_attendere="ATTENDERE UPLOAD IN CORSO",this.sovrascrivi_path="",this.fixed_label=" (INSERISCI QUI LA DESCRIZIONE PRIMA DI CARICARE IL FILE)",this.limit_string="Il file di <size>MB supera il limite di 1GB",this.allegato_inserito="ALLEGATO INSERITO",this.inserire_descrizione="Descrizione Obbligatoria",this.selezionare_tipologia="Selezionare la Tipologia",this.show_error=!0,this.lista_allegati=[],this.change=new n.EventEmitter,this.upload_ended=new n.EventEmitter,this.call_upload=new n.EventEmitter,this.fill_end=new n.EventEmitter,this.init_end=new n.EventEmitter,this.id_component="",this.hasBaseDropZoneOver=!1,this.hasAnotherDropZoneOver=!1,this.multi_list=!1,this.allow_delete=!1,this.loading=!1,this.App="",this.K="",this.label_b="",this.descrizione="",this.file_name="",this.label="",this.username="",this.b_edit_loaded=!1,this.tipo="",this.b_ini=!1,this.last_result={},this.uploader=new u.FileUploader({url:this.app_s.API_ENDPOINT+this.app_s.UPLOAD_ENDPOINT,maxFileSize:1048576e3}),this.id=null,this.ver=-1,this.show_upload=!0,this.id_component=this.uti.newGuid(),this.username=this.app_s.user,console.log("this.app_s.user ",this.app_s.user),this.uploader.onBeforeUploadItem=function(t){t.withCredentials=!1},this.uploader.onCompleteItem=function(t,e,i,n){200===i&&(r.ref_allegato(),r.last_result={item:t,response:e,status:i,header:n},r.change.emit(r.last_result))}}return t.prototype.call_up=function(){console.log("this.app_s.user ",this.app_s.user),this.call_upload.emit({App:this.App,K:this.K,descrizione:this.descrizione,single:!1,username:this.app_s.user,tipo:this.tipo,local_path:this.app_s.LOCAL_PATH,p1:this.programma_da_eseguire,ver:this.ver})},t.prototype.onFileDrop=function(t){},t.prototype.fileOverBase=function(t){this.hasBaseDropZoneOver=t},t.prototype.del_doc=function(){var t=this;localStorage.setItem(this.app_s.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.app_s.COMPANY_KEY+"msg_dialog","Confermi l'eliminazione dell'elemento?"),this.dialog.open(It).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="DELETE_ALLEGATO",i.types=["int","string"],i.values=[t.id,t.app_s.user];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.ref_allegato(),t.toastr.info("INFO","ALLEGATO ELIMINATO",{timeOut:1e3,progressBar:!0}))}),(function(t){}))}}))},t.prototype.load_types=function(){var t=this;null!=this.cmb_tipo&&""!=this.tipo?(this.cmb_tipo.sql=this.tipo,this.cmb_tipo.fillCombo()):setTimeout((function(){t.load_types()}),200)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){var e={};e.headers=[{name:"Authorization",value:"Bearer "+localStorage.getItem(t.app_s.COMPANY_KEY+"token")}],t.uploader.setOptions(e),t.uploader.onCompleteAll=function(){t.loading=!1,t.upload_ended.emit(t.last_result),t.descrizione="",t.ref_allegato(),null!=t.dialogRef&&null!=t.dialogRef.componentInstance&&(t.dialogRef.componentInstance.update_progess(100),t.dialogRef=null)},t.uploader.onErrorItem=function(e,i,n,o){t.show_error&&t.toastr.error(i)},t.uploader.onAfterAddingFile=function(e){t.ch(e)},t.uploader.onProgressItem=function(e,i){t.loading=!0,null!=t.dialogRef&&null!=t.dialogRef.componentInstance&&t.dialogRef.componentInstance.update_progess(i)},t.uploader.onWhenAddingFileFailed=function(e,i,n){switch(i.name){case"fileSize":var o=Math.round(e.size/1024/1024);t.toastr.error(t._trs.instant(t.limit_string).split("<size>").join(""+o));break;default:t.toastr.error("Errore: "+i.name)}},t.init_end.emit()}))},t.prototype.download_all=function(){""==this.sovrascrivi_path?window.open(this.app_s.COMPANY_SITE_ROOT+"/uploads/"+this.App+"/"+this.K+"/"+this.file_name):window.open(this.sovrascrivi_path+"/uploads/"+this.App+"/"+this.K+"/"+this.file_name)},t.prototype.ch=function(t){var e=this;this.descri_obb&&""==this.descrizione?this.toastr.error(this._trs.instant(this.inserire_descrizione)):""==this.selezionare_tipologia||!this.multi_list||""!=this.cmb_tipo.getValue()&&"-1"!=this.cmb_tipo.getValue()?(this.uploader.onBuildItemForm=function(t,i){i.append("App",e.App),i.append("K",e.K),i.append("descrizione",e.descrizione),i.append("single",e.single),i.append("username",e.app_s.user),i.append("ver",e.ver),console.log("this.app_s.user ",e.app_s.user),e.multi_list&&e.show_upload?i.append("tipo",e.cmb_tipo.getDescri().split("-1").join("")):i.append("tipo",e.tipo),i.append("local_path",e.app_s.LOCAL_PATH),""!=e.programma_da_eseguire&&i.append("p1",e.programma_da_eseguire)},null==this.dialogRef&&(this.dialogRef=this.dialog.open(Nt,{disableClose:!0}),setTimeout((function(){e.dialogRef.componentInstance.label=e._trs.instant(e.label_attendere)})),this.dialogRef.afterClosed().subscribe((function(t){}))),this.uploader.uploadAll()):this.toastr.error(this._trs.instant(this.selezionare_tipologia))},t.prototype.init=function(t,e,i,n,o,s,a,r,l){void 0===n&&(n=""),void 0===o&&(o=""),void 0===s&&(s=!1),void 0===a&&(a=!1),void 0===r&&(r=!0),void 0===l&&(l=-1),this.App=t,this.K=e,this.label=i,this.tipo=n,this.ver=l,this.b_ini=!0,this.b_edit_loaded=!1,this.descrizione="",this.programma_da_eseguire=o,this.allow_delete=s,this.ref_allegato(),this.tipo.indexOf("SELECT_")>-1&&(this.multi_list=!0,this.load_types()),this.show_upload=r,a&&this.select_file.nativeElement.click()},t.prototype.ref_allegato=function(){var t=this;if(this.id=null,this.file_name="",this.label_b="",this.cmb_tipo.resetValue(),this.single&&null!=this.App&&""!=this.App){var e=new vt;e.sql="SELECT_ALLEGATO_INFO",e.types=["string","string"],e.values=[this.App,this.K],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;i.length>0&&(t.id=i[0].id,t.descrizione=i[0].descrizione,t.file_name=i[0].Filename,t.label_b=i[0].Filename+" - "+i[0].Filesize,t.b_edit_loaded=!0,t.fill_end.emit())}}))}},t}();oe.decorators=[{type:n.Component,args:[{selector:"FHUpload",template:'\n <div *ngIf="loading" fxLayout="row">\n <mat-spinner diameter="25" ></mat-spinner>\n </div>\n\n <div\n [hidden]="!(enabled && !loading)"\n fxLayout="row"\n fxLayoutAlign="start center"\n fxLayoutGap="10px"\n >\n <div\n [hidden]="!multi_list"\n style="width:400px"\n fxLayoutAlign="start center"\n >\n <div style="width:100%">\n <FHComboBox\n [sql]="tipo"\n #cmb_tipo\n [init_fill]="false"\n label="Tipologia"\n ></FHComboBox\n ></div>\n </div>\n <mat-form-field\n [hidden]="!show_descri" [class.fh_field]="enabled" [class.fh_field_dis]="!enabled"\n style="width: 100%"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label | translate}} {{ fixed_label | translate }} {{ descri_obb ? \'*\':\'\'}}</mat-label>\n <input\n matInput\n type="text"\n name="descrizione"\n [(ngModel)]="descrizione"\n />\n </mat-form-field>\n \n \x3c!-- <div\n style="width:140px"\n fxLayout="row"\n fxLayoutAlign="start start"\n (click)="call_up()"\n >\n <input\n type="file"\n multiple\n ng2FileSelect\n [uploader]="uploader"\n name="file-fh{{ id_component }}"\n id="file-fh{{ id_component }}"\n class="inputfile inputfile-fh"\n />\n <label for="file-fh{{ id_component }}" style="width:210px"\n ><svg\n xmlns="http://www.w3.org/2000/svg"\n width="20"\n height="17"\n viewBox="0 0 20 17"\n >\n <path\n d="M10 0l-5.2 4.9h3.3v5.1h3.8v-5.1h3.3l-5.2-4.9zm9.3 11.5l-3.2-2.1h-2l3.4 2.6h-3.5c-.1 0-.2.1-.2.1l-.8 2.3h-6l-.8-2.2c-.1-.1-.1-.2-.2-.2h-3.6l3.4-2.6h-2l-3.2 2.1c-.4.3-.7 1-.6 1.5l.6 3.1c.1.5.7.9 1.2.9h16.3c.6 0 1.1-.4 1.3-.9l.6-3.1c.1-.5-.2-1.2-.7-1.5z"\n /></svg><span style="font-size: 12px"> Upload</span></label>\n </div>\n --\x3e\n <div fxLayout="row" [hidden]="!((descri_obb && descrizione == \'\') || (multi_list && (cmb_tipo.getValue() == \'\' || cmb_tipo.getValue() == \'-1\')))">\n <div [hidden]="!(this.descri_obb && descrizione == \'\')"><b>{{inserire_descrizione | translate}}</b></div>\n <div [hidden]="!(multi_list && (cmb_tipo.getValue() == \'\' || cmb_tipo.getValue() == \'-1\'))"><b>{{selezionare_tipologia | translate}}</b></div>\n </div>\n <div class="my-drop-zone" [hidden]="(descri_obb && descrizione == \'\') || (multi_list && (cmb_tipo.getValue() == \'\' || cmb_tipo.getValue() == \'-1\'))" style="width:130px" fxLayout="row" [matTooltip]="hasBaseDropZoneOver ? lascia_il_file : trascina_il_file | translate" fxLayoutAlign="center start">\n <label for="uploader-input" ng2FileDrop style="font-weight:bold"\n [ngClass]="{\'over-drop-zone\': hasBaseDropZoneOver}" for="file-fh{{ id_component }}"\n (onFileDrop)="onFileDrop($event)" (click)="call_up()"\n (fileOver)="fileOverBase($event)" [uploader]="uploader">\n <div fxLayoutAlign="center center" fxLayout="row">\n <mat-icon>{{!hasBaseDropZoneOver?\'backup\':\'thumb_up\'}}</mat-icon>\n\n <span style="font-size: 14px"> Upload</span></div></label></div>\n <input type="file"\n ng2FileSelect #select_file\n [multiple]="true"\n [uploader]="uploader"\n name="file-fh{{ id_component }}"\n id="file-fh{{ id_component }}" (click)="call_up()"\n (onFileSelected)="onFileDrop($event)"\n id="uploader-input" style="display:none"/>\n <div fxLayout="row" fxLayoutAlign="start start">\n \n <button\n mat-flat-button\n *ngIf="b_edit_loaded && show_download_button"\n (click)="download_all()"\n style="font-size: 12px;font-weight:bold" color="accent"\n\n >\n {{ label_b }}</button\n > \n <button\n mat-flat-button\n *ngIf="id != null && allow_delete && show_download_button"\n (click)="del_doc()"\n color="warn"\n >\n <mat-icon>delete</mat-icon>\n </button>\n\n </div>\n </div>\n <div *ngIf="!enabled" fxLayout="row" fxLayoutGap="10px">\n <label [hidden]="label==null || label==\'\'">{{ label }}:</label>\n <div *ngIf="label != descrizione">{{ descrizione }}</div>\n <button\n mat-flat-button\n *ngIf="b_edit_loaded && show_download_button"\n (click)="download_all()"\n style="font-size: 12px;background-color: #F5F5F5"\n >\n {{ label_b }}\n </button>\n </div>\n ',styles:["\n .fileLabel{\n display: inline-block;\n padding: .7em .4em;\n font-size: 13px;\n color: #525252;\n background-color: #e6e6e6;\n margin: 0 .2em;\n border-radius: 5px;\n }\n","\n .my-drop-zone { border: dotted 3px lightgray;height:35px }\n\n","\n .nv-file-over { border: dotted 3px red; } /* Default class applied to drop zones on over */\n ","\n .another-file-over-class { border: dotted 3px green; }\n"]}]}],oe.ctorParameters=function(){return[{type:Dt},{type:i.ToastrService},{type:e.MatDialog},{type:wt},{type:Ct},{type:p.TranslateService}]},oe.propDecorators={lascia_il_file:[{type:n.Input}],trascina_il_file:[{type:n.Input}],show_download_button:[{type:n.Input}],show_descri:[{type:n.Input}],enabled:[{type:n.Input}],single:[{type:n.Input}],descri_obb:[{type:n.Input}],programma_da_eseguire:[{type:n.Input}],label_attendere:[{type:n.Input}],sovrascrivi_path:[{type:n.Input}],fixed_label:[{type:n.Input}],limit_string:[{type:n.Input}],allegato_inserito:[{type:n.Input}],inserire_descrizione:[{type:n.Input}],selezionare_tipologia:[{type:n.Input}],show_error:[{type:n.Input}],lista_allegati:[{type:n.Input}],change:[{type:n.Output}],upload_ended:[{type:n.Output}],call_upload:[{type:n.Output}],fill_end:[{type:n.Output}],init_end:[{type:n.Output}],select_file:[{type:n.ViewChild,args:["select_file"]}],cmb_tipo:[{type:n.ViewChild,args:["cmb_tipo"]}]};var se=function(){function t(t,e,i){this.http=t,this.app_s=e,this.toastr=i,this.url=this.app_s.API_ENDPOINT+this.app_s.GRID_ENDPOINT}return t.prototype.doQuery=function(t,e,i){var n=this;void 0===e&&(e=!0),void 0===i&&(i=null),this.headers=new r.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=null==i?this.app_s.API_ENDPOINT+this.app_s.GRID_ENDPOINT:i;var o=JSON.stringify(t);return this.http.post(this.url,o,{headers:this.headers}).pipe(l.map((function(t){var i;if(t?"KO"===t.result_msg&&(i=new Error(t.msg)):i=new Error("Empty server response"),i)throw console.error(i),e&&n.toastr.error(i.message),new Error(i);return t||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t}();se.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new se(n.ɵɵinject(r.HttpClient),n.ɵɵinject(wt),n.ɵɵinject(i.ToastrService))},token:se,providedIn:"root"}),se.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],se.ctorParameters=function(){return[{type:r.HttpClient},{type:wt},{type:i.ToastrService}]};var ae=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.title=""}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ngAfterViewInit=function(){},t}();ae.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <mat-dialog-content style="min-width:800px;min-height:500px">\n <mat-tab-group>\n <mat-tab label="FILTRI">\n <img src="assets/helps/fhgrid/filtri.png" />\n </mat-tab>\n <mat-tab label="ORDINAMENTI">\n <img src="assets/helps/fhgrid/ordinamenti.png" />\n </mat-tab>\n <mat-tab label="LAYOUT COLONNE">\n <img src="assets/helps/fhgrid/layout_colonne.png" />\n </mat-tab>\n </mat-tab-group>\n </mat-dialog-content>\n\n <mat-dialog-actions>\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="dialogRef.close(\'\')"\n >\n CHIUDI\n </button>\n </mat-dialog-actions>\n ',styles:["\n agm-map {\n height: 600px;\n width: 100%;\n }\n "]}]}],ae.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:wt}]};var re=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.data=i,this.title="",this.label="",this.password_mode=!1,this.valore="",this.min_chars=3,this.max_chars=50,this.readonly=!1,null!=i&&(null!=i.title&&(this.title=i.title),null!=i.label&&(this.label=i.label),null!=i.valore&&(this.valore=i.valore),null!=i.readonly&&(this.readonly=i.readonly),null!=i.min_chars&&(this.min_chars=i.min_chars),null!=i.max_chars&&(this.max_chars=i.max_chars),null!=i.password_mode&&(this.password_mode=i.password_mode))}return t.prototype.ngAfterViewInit=function(){},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.show=function(){},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.do_check=function(){this.valore.length<this.min_chars||this.valore.length>this.max_chars?this.toastr.error("Il valore deve avere un numero di caratteri compreso tra "+this.min_chars+" - "+this.max_chars):this.dialogRef.close(this.valore)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t}();re.decorators=[{type:n.Component,args:[{selector:"app-win_ask_text",template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{ title }}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <mat-dialog-content style="font-size: 15px;">\n <mat-form-field *ngIf="!password_mode"\n appearance="outline"\n floatLabel="always"\n style="width:100%"\n ><mat-label\n >{{ label }}</mat-label\n >\n <input matInput type="text" [(ngModel)]="valore" required />\n </mat-form-field>\n <mat-form-field appearance="outline" floatLabel="always" *ngIf="password_mode"\n ><mat-label>{{ label }}</mat-label>\n\n <input\n autocomplete="new-password"\n matInput\n type="password"\n [(ngModel)]="valore"\n\n />\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <div\n fxLayout="row"\n fxLayoutAlign="center center"\n style="width: 100%"\n [hidden]="readonly"\n >\n <button mat-flat-button color="primary" (click)="do_check()">OK</button\n > \n <button mat-flat-button color="warn" (click)="chiudi()">{{\'ANNULLA\' | translate}}</button>\n </div>\n <div\n fxLayout="row"\n fxLayoutAlign="center center"\n style="width: 100%"\n [hidden]="!readonly"\n >\n <button mat-flat-button color="warn" (click)="chiudi()">{{\'CHIUDI\' | translate}}</button>\n </div>\n </mat-dialog-actions>\n</div>\n '}]}],re.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var le=function(){this.filter="",this.system_dest=1},pe=function(){},ue=function(){function t(t,e,i){this.dataService=t,this.fileService=e,this.toastr=i,this.eprog=0}return t.prototype.operation=function(t,e,i,n){var o=new pe;return o.op=t,o.v1=e,o.v2=i,o.ord=n,o},t.prototype.progress_update=function(t){var e=this;void 0===t&&(t=null),null!=t&&null!=t.componentInstance&&(this.eprog+=10,this.eprog>=100&&(this.eprog=95),setTimeout((function(){null!=t&&null!=t.componentInstance&&t.componentInstance.update_progess(e.eprog)})),setTimeout((function(){e.progress_update(t)}),2e3))},t.prototype.runCommands=function(t,e,i,n){var o=this;void 0===i&&(i=null),void 0===n&&(n=!0),this.eprog=0;var s=new vt;return s.sql="INSERT_OFFICE_OPERATION",s.types=["string","string"],e.sort((function(t,e){return t.ord<e.ord?-1:t.ord>e.ord?1:void 0})),s.values=[t,JSON.stringify(e)],this.dataService.doQuery(s).pipe(l.flatMap((function(e){if(null!=e&&"OK"==e.result_msg){var s=new gt;return s.command=n?"exec_app":"exec_app_async",s.p1="print_manager",s.p2=t,null!=i&&setTimeout((function(){o.progress_update(i)}),2e3),o.fileService.doQuery(s).pipe(l.flatMap((function(t){if(null!=t&&"OK"==t.result_msg)return new _.Observable((function(e){setTimeout((function(){!0}),18e4);o.eprog=100,o.progress_update(i),e.next(t),e.complete()}))})))}})))},t}();ue.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new ue(n.ɵɵinject(Dt),n.ɵɵinject(Tt),n.ɵɵinject(i.ToastrService))},token:ue,providedIn:"root"}),ue.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],ue.ctorParameters=function(){return[{type:Dt},{type:Tt},{type:i.ToastrService}]};var ce=function(){function t(t,e,i,o,s,a,r,l,p,u,c){var d=this;this._gridservice=t,this._toast=e,this._dataService=i,this.m_appService=o,this.slimLoadingBarService=s,this.m_dialog=a,this.uti_s=r,this.officeService=l,this._fileService=p,this.clipboard=u,this._trs=c,this.flt_aggiuntivo=[],this.flt_aggiuntivo_value="",this.flt_aggiuntivo_label="",this.width_max="100%",this.browser="nd",this.overwrite_help_url="",this.over_fulltext=!1,this.b_wait=!1,this.over_fulltext_types=[],this.over_fulltext_values=[],this.over_fulltext_sql="",this.tooltipShowDelay=2e3,this.elimina_label="ELIMINA",this.export_field_aggiuntivi="",this.end_point=null,this.tbl_name="",this.count_tbl_name="",this.search_field_tooltip="",this.loading_fulltext=!1,this.num_per_pag=0,this.grid_key="PRO_H",this.sort_field="",this.fields="*",this.filters="1=1",this.enabled=!0,this.show_link=!1,this.show_help_bar=!1,this.help_label_bar="HELP",this.auto_load=!0,this.auto_height=!1,this.enable_export=!0,this.enabled_pag=!0,this.show_help=!0,this.show_num_elem=!0,this.system_dest=1,this.header_h=35,this.selection_mode="multiple",this.init_fill=!0,this.no_pref=!1,this.pref_hidden=!0,this.enable_export_pdf=!0,this.enable_export_xls=!0,this.enable_copy=!0,this.autosize_at_ini=!0,this.label_elementi=" Elementi",this.trova_label="TROVA",this.mantieni_impostazioni="Mantieni Imp.",this.curr_filter="",this.flt_aggiuntivo_event=new n.EventEmitter,this.show_buttons=!0,this.fill_end=new n.EventEmitter,this.cell_edited=new n.EventEmitter,this.clicked=new n.EventEmitter,this.dclicked=new n.EventEmitter,this.columndclicked=new n.EventEmitter,this.cell_clicked=new n.EventEmitter,this.selection_change=new n.EventEmitter,this.custom_export=!1,this.toolbar_type="NONE",this.toolbar_wkfapp=null,this.toolbar_custom_commands=[],this.command=new n.EventEmitter,this.b_ensure=!1,this.curr_config="-1",this.init_end=new n.EventEmitter,this.off_set=0,this.include_always="",this.first_ref=!0,this.b_restored=!1,this.str_curr_q_p="",this.dataSource={getRows:function(t){d.slimLoadingBarService.start((function(){}));var e=new le;if(e.table=d.tbl_name,e.table_count=d.tbl_name,""!=d.count_tbl_name&&(e.table_count=d.count_tbl_name),e.num_per_pag=t.endRow-t.startRow,e.curr_page=Math.round(t.startRow/e.num_per_pag),null==e.curr_page&&(e.curr_page=0),null==e.num_per_pag&&(e.num_per_pag=100),0!=d.num_per_pag&&(e.num_per_pag=d.num_per_pag),e.sort_field=d.sort_field,null!=t.sortModel&&t.sortModel.length>0){e.sort_field="";for(var i=0;i<t.sortModel.length;i++)""!=e.sort_field&&(e.sort_field=e.sort_field+","),"autori"==t.sortModel[i].colId?e.sort_field=e.sort_field+"case when CHARINDEX('"+d.m_appService.user+"',autori)>0 then 1 else 0 end "+t.sortModel[i].sort:e.sort_field=e.sort_field+t.sortModel[i].colId+" "+t.sortModel[i].sort}e.system_dest=d.system_dest,e.field=d.fields,null!=d.filters&&(e.filter=d.filters),""!=d.fix_flt&&(""!=e.filter&&(e.filter=e.filter+" and "),e.filter=e.filter+" ("+d.fix_flt+" )"),""!=d.ric_libera&&d.over_fulltext||""!=d.fix_flt_temp&&(""!=e.filter&&(e.filter=e.filter+" and "),e.filter=e.filter+" ("+d.fix_flt_temp+" )");var n=e.filter,o=!1;if(null!=t.filterModel)for(var s in t.filterModel){var a=t.filterModel[s];console.log(t.filterModel[s],s),null==a.operator?""==e.filter?e.filter+=d.calcola_filtro(t.filterModel[s],"",s,!1):e.filter+=d.calcola_filtro(t.filterModel[s],"",s,!0):(o?""!=e.filter&&(e.filter+=" and "):""!=d.include_always?e.filter=e.filter+" ("+d.include_always+" or ":""!=e.filter&&(e.filter+=" and "),o=!0,e.filter+=" (",e.filter+=d.calcola_filtro(t.filterModel[s].condition1,"",s,!1),e.filter+=" "+a.operator+" ",e.filter+=d.calcola_filtro(t.filterModel[s].condition2,"",s,!1),e.filter+=")")}if(o&&""!=d.include_always&&(e.filter=e.filter+" )"),o=!0,e.filter=e.filter.split("{{user}}").join(d.m_appService.user),""!=d.ric_libera?d.last_riclib=!0:d.last_riclib=!1,""!=e.filter&&n!=e.filter||null!=d.ric_libera&&""!=d.ric_libera?d.show_pulisci_filtri=!0:d.show_pulisci_filtri=!1,d.loading_fulltext=!0,d.str_curr_q_p="",""!=e.filter&&(d.str_curr_q_p="where "+e.filter),""!=e.sort_field&&(d.str_curr_q_p=d.str_curr_q_p+" order by "+e.sort_field),d.curr_filter=e.filter,""!=d.ric_libera&&d.over_fulltext){d.loading_fulltext=!0;var r="";""!=e.filter&&(r=" and ("+e.filter+")");var l=new vt;l.sql=d.over_fulltext_sql,console.log("JSON.stringify(params.filterModel) ",JSON.stringify(t.filterModel)),"{}"==JSON.stringify(t.filterModel)&&(l.sql=d.over_fulltext_sql+"_FT"),l.types=["string","string","string"],l.values=[d.ric_libera,e.sort_field,r],d.over_fulltext_types.map((function(t){l.types.push(t)})),d.over_fulltext_values.map((function(t){l.values.push(t)})),d._dataService.doQuery(l).subscribe((function(i){var n=!1;if(null!=i&&"OK"==i.result_msg){n=!0,t.successCallback(i.result_data,i.result_data.length),d.b_init=!0,d.myData=i.result_data.slice(),d.num_r=i.result_data.length,d.slimLoadingBarService.complete(),d.fill_end.emit(),localStorage.setItem(d.grid_key+"_POS1",JSON.stringify(e)),null!=localStorage.getItem(d.grid_key+"_POS2")&&null!=d.gridOptions&&null!=d.gridOptions.api&&d.gridOptions.api.forEachNode((function(t){d.getRowNodeId(t)===localStorage.getItem(d.grid_key+"_POS2")&&(t.setSelected(!0),localStorage.removeItem(d.grid_key+"_POS2"),null!=localStorage.getItem(d.grid_key+"_LAST_ROW")&&(d.sRow=JSON.parse(localStorage.getItem(d.grid_key+"_LAST_ROW"))),localStorage.removeItem(d.grid_key+"_LAST_ROW"))}));null!=d.toggle_mantieni&&d.toggle_mantieni.checked,d.loading_fulltext=!1,d.no_pref&&!d.b_init1&&d.autoSizeAll(),d.b_init1=!0,d.ensure_visible(),null==localStorage.getItem(d.grid_key+"_COLS")&&d.autosize_at_ini&&setTimeout((function(){d.autoSizeAll()}),300)}n||(d.errorMsg=i.msg+" ["+i.result_msg+"]")}),(function(t){d.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER. RITENTARE PIU' TARDI"}))}else d._gridservice.doQuery(e,!0,d.end_point).subscribe((function(i){var n=!1;if(null!=i&&"OK"==i.result_msg){n=!0,t.successCallback(i.result_data,i.count),d.b_init=!0,d.myData=i.result_data.slice(),d.num_r=i.count,d.slimLoadingBarService.complete(),d.fill_end.emit(),localStorage.setItem(d.grid_key+"_POS1",JSON.stringify(e)),null!=localStorage.getItem(d.grid_key+"_POS2")&&null!=d.gridOptions&&null!=d.gridOptions.api&&d.gridOptions.api.forEachNode((function(t){d.getRowNodeId(t)===localStorage.getItem(d.grid_key+"_POS2")&&(t.setSelected(!0),localStorage.removeItem(d.grid_key+"_POS2"),null!=localStorage.getItem(d.grid_key+"_LAST_ROW")&&(d.sRow=JSON.parse(localStorage.getItem(d.grid_key+"_LAST_ROW"))),localStorage.removeItem(d.grid_key+"_LAST_ROW"))}));null!=d.toggle_mantieni&&d.toggle_mantieni.checked,d.loading_fulltext=!1,d.no_pref&&!d.b_init1&&d.autoSizeAll(),d.b_init1=!0,d.ensure_visible(),null==localStorage.getItem(d.grid_key+"_COLS")&&d.autosize_at_ini&&setTimeout((function(){d.autoSizeAll()}),300)}n||(d.errorMsg=i.msg+" ["+i.result_msg+"]")}),(function(t){d.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER. RITENTARE PIU' TARDI"}))}},this.getContextMenuItems_n_e=function(){return["autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste"]},this.getContextMenuItems_e=function(){return["autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste",{name:"Esporta",action:function(){d.export_excel()},icon:'<img src="assets/icons/square-o/xlsx.svg"/>'}]},this.gridOptions={debug:!1,headerHeight:this.header_h,enableRangeSelection:!0,defaultColDef:{resizable:!0,sortable:!0,floatingFilter:!0},allowContextMenuWithControlKey:!0,rowModelType:"infinite",localeText:{page:"pagina",more:"altre",to:"a",of:"di",next:"prossima",last:"ultima",first:"prima",previous:"precedente",loadingOoo:"Caricamento...",selectAll:"Seleziona Tutto",searchOoo:"Trova...",blanks:"Vuoto",filterOoo:"Filtro...",applyFilter:"Applica Filtro...",equals:"Uguale",notEqual:"Diverso",lessThan:"Minore o Uguale",greaterThan:"Maggiore o Uguale",notContains:"Non Contiene",contains:"Contiene",startsWith:"Inizia Con",endsWith:"Finisce Con",group:"Gruppo",columns:"Colonne",rowGroupColumns:"Colonne Pivot",rowGroupColumnsEmptyMessage:"trascina le colonne per raggrupparle",valueColumns:"Colonne Valore",pivotMode:"Modalità Pivot",groups:"Gruppi",values:"Valori",pivots:"Pivots",valueColumnsEmptyMessage:"trascina le colonne per aggreare",pivotColumnsEmptyMessage:"trascina le colonne per pivot",noRowsToShow:"nessun dato",pinColumn:"Sposta Colonna",valueAggregation:"Aggregazione",autosizeThiscolumn:"Autosize colonna",autosizeAllColumns:"Autosize tutte le colonne",groupBy:"Raggruppa per",ungroupBy:"Spacca per",resetColumns:"Resetta queste colonna",expandAll:"Espandi",collapseAll:"Chiudi",toolPanel:"Impostazioni",pinLeft:"Sposta <<",pinRight:"Sposta >>",noPin:"Sposta <>",sum:"Somma",min:"Minimo",max:"Massimo",none:"Nessuno",count:"Numero",average:"Media",copy:"Copia",ctrlC:"ctrl n C",paste:"Incolla",ctrlV:"ctrl n C"},getRowNodeId:function(t){return null!=t.ID?String(t.ID):null!=t.id?String(t.id):null!=t.uiid?t.uiid:null!=t.codice?t.codice:null!=t.id_doc?t.id_doc:null!=t.notesid?t.notesid:null!=t.ord?t.ord:void 0}},this.last_copy="",this.b_init=!1,this.b_init1=!1,this.errorMsg="",this.innerWidth=750,this.show_pulisci_filtri=!1,this.last_riclib=!1,this.uiid_stampa="",this.xxopx=0,this.num_r=0,this.ready=!1,this.ckk_ed=!1,this.myData=new Array,this.b_iniended=!1,this.ric_libera="",this.fix_flt="",this.fix_flt_temp="",null==this.m_appService.getState().grid_obj&&(this.m_appService.getState().grid_obj={}),this.browser=this.getBrowserName(),"ie"==this.browser&&(this.width_max="")}return t.prototype.sc=function(){this.flt_aggiuntivo_event.emit(this.flt_aggiuntivo_value)},t.prototype.getBrowserName=function(){var t=window.navigator.userAgent.toLowerCase();switch(!0){case t.indexOf("edge")>-1:return"edge";case t.indexOf("opr")>-1&&!!window.opr:return"opera";case t.indexOf("chrome")>-1&&!!window.chrome:return"chrome";case t.indexOf("trident")>-1:return"ie";case t.indexOf("firefox")>-1:return"firefox";case t.indexOf("safari")>-1:return"safari";default:return"other"}},t.prototype.docmd=function(t){this.command.emit(t)},t.prototype.translate_back=function(t){if(console.log("translate_back ",t),null==this._trs)return t;if(null==this._trs.store)return t;if(null==this._trs.store.translations)return t;null==localStorage.getItem(this.m_appService.COMPANY_KEY+"_lng")&&localStorage.setItem(this.m_appService.COMPANY_KEY+"_lng","it");var e=localStorage.getItem(this.m_appService.COMPANY_KEY+"_lng");for(var i in this._trs.store.translations[e])if(this._trs.store.translations[e][i]==t)return i;return t},t.prototype.ensure_visible=function(){if(!this.b_ensure){this.b_ensure=!0;try{null!=localStorage.getItem(this.grid_key+"_POS")&&(this.gridOptions.api.ensureIndexVisible(parseInt(localStorage.getItem(this.grid_key+"_POS"))),localStorage.removeItem(this.grid_key+"_POS"))}catch(t){console.log(t)}}},t.prototype.ck_flag=function(){this.toggle_mantieni.checked?localStorage.setItem(this.grid_key+"_MANTIENI","NO"):localStorage.setItem(this.grid_key+"_MANTIENI","SI")},t.prototype.refresh_all_rows=function(){var t=this;setTimeout((function(){t.gridOptions.api.refreshCells({force:!0})}),0)},t.prototype.ch_config=function(){this.no_pref||(this.curr_config=this.gf.getValue(),"-1"!=this.curr_config&&(localStorage.removeItem(this.grid_key+"_COLS"),localStorage.removeItem(this.grid_key+"_FILTER"),localStorage.removeItem(this.grid_key+"_CFG_DEFAULT"),localStorage.removeItem(this.grid_key+"_FILTER_UP"),null!=this.gf.getObj().COL&&""!=this.gf.getObj().COL&&localStorage.setItem(this.grid_key+"_COLS",this.gf.getObj().COL),null!=this.gf.getObj().FILTER&&""!=this.gf.getObj().FILTER&&localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),null!=this.gf.getDescri()&&"-1"!=this.gf.getDescri()&&localStorage.setItem(this.grid_key+"_CFG_DEFAULT",this.gf.getDescri()),this.curr_config=this.gf.getValue(),this.res_columns(!0)))},t.prototype.elimina_config=function(){var t=this;null==this.gf.getObj().username||this.m_appService.user==this.gf.getObj().username?(localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler cancellare la configurazione "+this.gf.getDescri()+"?"),this.m_dialog.open(It,{disableClose:!0}).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="DELETE_CFG_GRID",i.types=["string","string"],i.values=[t.gf.getDescri(),t.grid_key];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione eliminata"),t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo(),t.curr_config="-1")}))}}))):this._toast.error("Configurazione gestibile da: "+this.gf.getObj().username)},t.prototype.edit_config=function(){var t=this;null==this.gf.getObj().username||this.m_appService.user==this.gf.getObj().username?(localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler sovrascrivere la configurazione "+this.gf.getDescri()+"?"),this.m_dialog.open(It,{disableClose:!0}).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="INSERT_UPDATE_CFG_GRID";var n="",o="";null!=localStorage.getItem(t.grid_key+"_COLS")&&(n=localStorage.getItem(t.grid_key+"_COLS")),null!=localStorage.getItem(t.grid_key+"_FILTER")&&(o=localStorage.getItem(t.grid_key+"_FILTER")),i.types=["string","string","string","string","string","string"],i.values=[t.gf.getDescri(),t.grid_key,n,"",o,t.m_appService.user];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione salvata"),t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo(),t.curr_config="-1")}),(function(t){}))}}))):this._toast.error("Configurazione gestibile da: "+this.gf.getObj().username)},t.prototype.refresh_access=function(t){this.toolbar_wkfapp=t},t.prototype.getGridApi=function(){return this.gridOptions.api},t.prototype.getGridOptions=function(){return this.gridOptions},t.prototype.insert_config=function(){var t=this;this.win_opt=this.m_dialog.open(re,{disableClose:!0}),setTimeout((function(){t.win_opt.componentInstance.title="Salva Configurazione",t.win_opt.componentInstance.label="Nome"})),this.win_opt.afterClosed().subscribe((function(e){if(e&&null!=e){var i=new vt;i.sql="INSERT_UPDATE_CFG_GRID";var n="",o="";null!=localStorage.getItem(t.grid_key+"_COLS")&&(n=localStorage.getItem(t.grid_key+"_COLS")),null!=localStorage.getItem(t.grid_key+"_FILTER")&&(o=localStorage.getItem(t.grid_key+"_FILTER")),i.types=["string","string","string","string","string","string"],i.values=[e,t.grid_key,n,"",o,t.m_appService.user];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione salvata"),!0,t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo())}),(function(t){}))}}))},t.prototype.prepare_filter=function(t){return t.split("'").join("$''").split("*").join("$*").split("?").join("$?").split("[").join("$[").split("]").join("$]").split("!").join("!$").split("ì").join("_").split("ù").join("_").split("à").join("_").split("ò").join("_").toUpperCase()},t.prototype.calcola_filtro=function(t,e,i,n){void 0===n&&(n=!0),console.log("calcola_filtro ",i,n);if(null!=t.type){if(null!=t.filter&&(n&&(e+=" and "),!0,"number"==t.filterType?("greaterThan"==t.type&&(e=e+" "+i+" > "+t.filter),"equals"==t.type&&(e=e+" "+i+" = "+t.filter),"notEqual"==t.type&&(e=e+" "+i+" <> "+t.filter),"lessThan"==t.type&&(e=e+" "+i+" < "+t.filter),"lessThanOrEqual"==t.type&&(e=e+" "+i+" <= "+t.filter),"greaterThanOrEqual"==t.type&&(e=e+" "+i+" >= "+t.filter),"inRange"==t.type&&(e=e+" ("+i+" >= "+t.filter+" and "+i+" <= "+t.filterTo+")")):("contains"==t.type&&(e=e+" upper("+i+") like '%"+this.prepare_filter(t.filter)+"%' ESCAPE '$'"),"startsWith"==t.type&&(e=e+" upper("+i+") like '"+this.prepare_filter(t.filter)+"%' ESCAPE '$'"),"equals"==t.type&&(e=e+" upper("+i+") = '"+t.filter.replace("'","''").toUpperCase()+"'"),"notContains"==t.type&&(e=e+"not upper("+i+") like '%"+this.prepare_filter(t.filter)+"%' ESCAPE '$'"),"notEqual"==t.type&&(e=e+" upper("+i+") <> '"+t.filter.replace("'","''").toUpperCase()+"'"),"endsWith"==t.type&&(e=e+" upper("+i+") like '%"+this.prepare_filter(t.filter)+"' ESCAPE '$'"))),"inRange"==t.type){if(null!=t.dateTo&&null!=t.dateFrom){if(t.dateFrom>=t.dateTo)return void this._toast.error("Data inizio range deve essere maggiore di data fine range");!0,n&&(e+=" and "),e=e+" ("+i+">="+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,5))+" and "+i+"<="+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateTo,5))+") "}}else if(null!=t.dateTo||null!=t.dateFrom){if(!0,n&&(e+=" and "),e+=" (",null!=t.dateFrom&&"dbnull"!=this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,5))){var o="";"greaterThan"==t.type&&(o=" "+i+" >= "+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,5))),"equals"==t.type&&(o=" ("+i+" >="+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,5))+" and "+i+" <="+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,5),"T23:59:00")+")"),"notEqual"==t.type&&(o=" "+i+" <> "+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,5))),"lessThan"==t.type&&(o=" "+i+" <= "+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,5)));var s=this.uti_s.string2date(t.dateFrom,5);s.setHours(23),s.setMinutes(59),"lessThanOrEqual"==t.type&&(o=" "+i+" <= "+this.uti_s.sql_date_grid(s)),"greaterThanOrEqual"==t.type&&(o=" "+i+" >= "+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,5))),e+=o}else e+="1=1";e+=" )"}}else{var a="",r="",l=!1;if(null!=t.values)for(var p=0;p<t.values.length;p++)null!=t.values[p]?(""!=r&&(r+=","),r=r+"'"+this.translate_back(t.values[p].replace("'","''"))+"'",""!=a&&(a+=" or "),a=a+" upper("+i+") like '%"+t.values[p].replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()+"%' ESCAPE '$'"):l=!0;var u=-1,c=this.gridOptions.api.getColumnDef(i);if(null!=c&&null!=c.filterParams&&null!=c.filterParams.values){var d=c.filterParams.values;null!=(d=d.filter((function(t,e){return d.indexOf(t)===e})))&&(u=d.length)}console.log("KEY!!!! ",i),"pers_int"!=i?""!=r?t.values.length!=u&&(!0,n&&(e+=" and "),e=l?e+"("+i+" in ("+r+") or "+i+" is null)":e+i+" in ("+r+")"):(!0,n&&(e+=" and "),l?e=e+" "+i+" is null":e+=" (1=0)"):""!=a&&(console.log("like_f ",a),!0,n&&(e+=" and "),e=e+"("+a+")")}return console.log("return filter_v ",e),e},t.prototype.onBtExport=function(){this.export_excel()},t.prototype.setHeaderHeight=function(t){var e=this;this.header_h=t,this.gridOptions.api.setHeaderHeight(this.header_h),this.gridOptions.suppressCopyRowsToClipboard=!0,this.gridOptions.sendToClipboard=function(t){console.log("v ",t),e.enable_copy&&e.clipboard.copy(t.data.split("\n")[0])}},t.prototype.getRowNodeId=function(t){return null==t||null==t.data?this.uti_s.newGuid():null!=t.data.id?String(t.data.id):null!=t.data.uiid?t.data.uiid:null!=t.data.codice?t.data.codice:"NA"},t.prototype.ngAfterViewInit=function(){var t=this;"PRO_H"==this.grid_key&&(this.no_pref=!0),setTimeout((function(){null==t.end_point&&(t.end_point=t.m_appService.API_ENDPOINT+t.m_appService.GRID_ENDPOINT),null!=localStorage.getItem(t.grid_key+"_FILTER_UP")&&(t.ric_libera=localStorage.getItem(t.grid_key+"_FILTER_UP")),t.onResize()}))},t.prototype.okr=function(t){t.data.nome_colonna=t.column.colDef.field,this.cell_edited.emit(t.data)},t.prototype.help_window=function(){""==this.overwrite_help_url?this.m_dialog.open(ae,{disableClose:!0}).afterClosed().subscribe((function(t){})):window.open(this.overwrite_help_url)},t.prototype.onResize=function(t){},t.prototype.autoSizeAll=function(){var t=this;if(null!=this.gridOptions&&null!=this.gridOptions.columnApi){var e=[];this.gridOptions.columnApi.getAllGridColumns().map((function(t){e.push(t.getColId())})),this.gridOptions.columnApi.autoSizeColumns(e),this.gridOptions.columnApi.getColumnState().length>0&&24==this.gridOptions.columnApi.getColumnState()[0].width?setTimeout((function(){t.autoSizeAll()}),300):this.save_cfg()}},t.prototype.fitSizeAll=function(){this.gridOptions.api.sizeColumnsToFit(),this.save_cfg()},t.prototype.selectCount=function(){var t=0;return this.gridOptions.api.forEachNode((function(e){e.isSelected()&&t++})),t},t.prototype.getquerySelected=function(t,e){var i="";return"String"==e&&this.gridOptions.api.forEachNode((function(e){e.isSelected()&&null!=e.data[t]&&(""!=i&&(i+=","),i=i+"'"+e.data[t]+"'")})),"Number"==e&&this.gridOptions.api.forEachNode((function(e){e.isSelected()&&null!=e.data[t]&&(""!=i&&(i+=","),i+=e.data[t])})),i},t.prototype.selectAllFiltered=function(){this.gridOptions.api.forEachNode((function(t){t.setSelected(!0)}))},t.prototype.deselectAllFiltered=function(){this.gridOptions.api.forEachNode((function(t){t.setSelected(!1)}))},t.prototype.pulisci_filtri=function(t){void 0===t&&(t=!0),localStorage.removeItem(this.grid_key+"_FILTER"),t&&((""!=this.ric_libera||this.last_riclib)&&this.doFill("",!0,!1),this.ric_libera="",localStorage.removeItem(this.grid_key+"_FILTER_UP")),this.fix_flt_temp="",this.gridOptions.api.setFilterModel(null);this.gridOptions.api.setFilterModel({})},t.prototype.export_excel=function(t){var e=this;if(void 0===t&&(t="xlsx"),this.custom_export)this.command.emit({cmd:"export_excel",v:t});else if(this.num_r>2e4)this._toast.error("Massimo 20000 elementi esportabili");else{t="."+t,this.uiid_stampa=this.uti_s.newGuid(),this.xxopx=0;this.dialogRef_W=this.m_dialog.open(Nt,{disableClose:!0}),setTimeout((function(){e.dialogRef_W.componentInstance.label="EXPORT IN CORSO"}));for(var i=[],n="",o=this.gridOptions.columnApi.getAllDisplayedColumns(),s=0;s<o.length;s++)o[s].getColDef().field.length<60&&(""!=n&&(n+=","),null==o[s].getColDef().headerName||""==o[s].getColDef().headerName?n+="["+o[s].getColDef().field+"]":n+="["+o[s].getColDef().field+"] ["+o[s].getColDef().headerName.split("[").join("").split("]").join("")+"]");-1!=this.fields.indexOf("DISTINCT")&&(n="DISTINCT "+n),i.push(this.officeService.operation("GB_XLS_APRI","tpl_report.xlsx",this.uiid_stampa+".xlsx",this.xxopx++));var a="GB_CREA_TABELLA_FROM_DB";2==this.system_dest&&(a="GB_CREA_TABELLA_FROM_DB1"),""==this.export_field_aggiuntivi?i.push(this.officeService.operation(a,"select "+n+" from "+this.tbl_name+" "+this.str_curr_q_p,"3",this.xxopx++)):i.push(this.officeService.operation(a,"select "+n+","+this.export_field_aggiuntivi+" from "+this.tbl_name+" "+this.str_curr_q_p,"3",this.xxopx++)),i.push(this.officeService.operation("GB_XLS_SAVE",this.m_appService.LOCAL_PATH+"grid_reports\\"+this.uiid_stampa+"_"+this.m_appService.user+t,"",this.xxopx++)),this.officeService.runCommands(this.uiid_stampa,i,this.dialogRef_W,!1).subscribe((function(i){e.check_end(t)}))}},t.prototype.check_end=function(t){var e=this,i=new gt;i.p1=this.m_appService.LOCAL_PATH+"grid_reports\\"+this.uiid_stampa+"_"+this.m_appService.user+t,i.command="check_file",this._fileService.doQuery(i).subscribe((function(i){null!=i&&("N"==i.msg?setTimeout((function(){e.check_end(t)}),5e3):(setTimeout((function(){e.dialogRef_W.componentInstance.update_progess(100)})),window.open(e.m_appService.COMPANY_SITE_ROOT+"/grid_reports/"+e.uiid_stampa+"_"+e.m_appService.user+t)))}))},t.prototype.print=function(){this.custom_export?this.command.emit({cmd:"print_pdf"}):this.export_excel("pdf")},t.prototype.init_conf=function(){},t.prototype.createColumnDefs=function(t){},t.prototype.ckk=function(){var t=this;if(this.auto_load)if(null!=this.columnDefs)if(0!=this.columnDefs.length){if(!this.ckk_ed){if(this.ckk_ed=!0,null!=this.toggle_mantieni&&(this.toggle_mantieni.checked=!0,null!=localStorage.getItem(this.grid_key+"_MANTIENI")&&"NO"==localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.toggle_mantieni.checked=!1)),this.res_columns(),null!=localStorage.getItem(this.grid_key+"_POS")&&(this.b_restored=!0),null!=localStorage.getItem(this.grid_key+"_FILTER_UP")&&""!=localStorage.getItem(this.grid_key+"_FILTER_UP")){this.ric_libera=localStorage.getItem(this.grid_key+"_FILTER_UP");for(var e=this.ric_libera.split(" "),i=new Array,n=0;n<e.length;n++)i.push(e[n]);if(0==i.length)return;var o="",s=function(e){for(var n="",s=0;s<a.columnDefs.length;s++)null!=a.columnDefs[s]&&null==a.columnDefs[s].no_filter&&null!=a.columnDefs[s].field&&""!=a.columnDefs[s].field&&"agDateColumnFilter"!=a.columnDefs[s].filter&&(""!=n&&(n+=" or "),n+=a.columnDefs[s].field+" LIKE '%"+a.prepare_filter(i[e])+"%' ESCAPE '$'");null!=a.full_text_added_columns&&a.full_text_added_columns.map((function(o){null!=o&&""!=o&&(""!=n&&(n+=" or "),n+=o+" LIKE '%"+t.prepare_filter(i[e])+"%' ESCAPE '$'")})),""!=n&&(""!=o&&(o+=" and "),o+="("+n+")")},a=this;for(n=0;n<i.length;n++)s(n);null!=this.full_text_added_query&&this.full_text_added_query.map((function(e){null!=e&&""!=e&&(""!=o&&(o="("+o+") or "),o+=e.split("_VALORE_").join(t.uti_s.string_sqlvalue(t.ric_libera).replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()))})),this.fix_flt_temp=o}this.init_fill&&setTimeout((function(){t.ref_dt()}),100)}}else setTimeout((function(){t.ckk()}),500);else setTimeout((function(){t.ckk()}),500)},t.prototype.set_init_size=function(){var t=this;0!=this.myData.length?this.columnDefs.length<=6?this.fitSizeAll():this.autoSizeAll():setTimeout((function(){t.set_init_size()}),500)},t.prototype.res_columns=function(t){var e=this;if(void 0===t&&(t=!1),null!=this.columnDefs)if(0!=this.columnDefs.length){var i=!1;if(null!=this.toggle_mantieni&&(i=this.toggle_mantieni.checked),null!=localStorage.getItem(this.grid_key+"_COLS")&&""!=localStorage.getItem(this.grid_key+"_COLS")){if(null!=localStorage.getItem(this.grid_key+"_COLS")&&(i||t)&&""!=localStorage.getItem(this.grid_key+"_COLS")){!0;try{for(var n=JSON.parse(localStorage.getItem(this.grid_key+"_COLS")),o=!0,s=0;s<n.length;s++)n[s].hide||(o=!1);o?localStorage.getItem(this.grid_key+"_COLS"):this.gridOptions.columnApi.setColumnState(JSON.parse(localStorage.getItem(this.grid_key+"_COLS")))}catch(t){console.log(t)}}if(null!=localStorage.getItem(this.grid_key+"_FILTER")&&(i||t)&&""!=localStorage.getItem(this.grid_key+"_FILTER"))try{this.gridOptions.api.setFilterModel(JSON.parse(localStorage.getItem(this.grid_key+"_FILTER")))}catch(t){console.log(t)}}else this.set_init_size()}else setTimeout((function(){e.res_columns(t)}),200);else setTimeout((function(){e.res_columns(t)}),200)},t.prototype.getRows=function(){return this.gridOptions.rowData},t.prototype.sortAndFilter=function(t,e){},t.prototype.ref_dt=function(){var t=this;null==this.gridOptions||null==this.gridOptions.api?setTimeout((function(){t.ref_dt()}),500):this.gridOptions.api.setDatasource(this.dataSource)},t.prototype.updateRow=function(){this.refresh_all_rows()},t.prototype.onModelUpdated=function(){},t.prototype.onReady=function(t){this.gridApi=t.api,this.setHeaderHeight(this.header_h),0!=this.num_per_pag&&(this.gridOptions.paginationPageSize=this.num_per_pag,this.gridOptions.cacheBlockSize=this.num_per_pag),null!=this.gf&&this.show_buttons&&!this.pref_hidden&&(this.gf.sql="SELECT_CFG_GRID",this.gf.types=["string"],this.gf.values=[this.grid_key],this.gf.fillCombo(),"NO"!=localStorage.getItem(this.grid_key+"_MANTIENI")&&null!=localStorage.getItem(this.grid_key+"_CFG_DEFAULT"))||this.auto_load&&this.onready_go()},t.prototype.init_grid=function(){this.auto_load=!0,this.onready_go()},t.prototype.save_cfg=function(){localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.fe_cfg=function(){null!=this.gf&&null!=this.gf.getObj()&&"NO"!=localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.gf.setByDescri(localStorage.getItem(this.grid_key+"_CFG_DEFAULT")),localStorage.setItem(this.grid_key+"_COLS",this.gf.getObj().COLS),localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),this.curr_config=this.gf.getValue()),this.onready_go()},t.prototype.onready_go=function(){var t=this;this.ready=!0,setTimeout((function(){t.ckk()}),10),this.b_iniended||(this.b_iniended=!0,this.init_end.emit())},t.prototype.init_filters=function(){},t.prototype.keyDownFunctioncl=function(t){13==t.keyCode&&this.free_search()},t.prototype.free_search=function(){var t=this;if(""==this.ric_libera)return this.pulisci_filtri(),this.fix_flt_temp="",this.doFill("",!0,!1),void localStorage.removeItem(this.grid_key+"_FILTER_UP");localStorage.setItem(this.grid_key+"_FILTER_UP",this.ric_libera);for(var e=this.ric_libera.split(" "),i=new Array,n=0;n<e.length;n++)i.push(e[n]);if(0!=i.length){var o="",s=function(e){for(var n="",s=0;s<a.columnDefs.length;s++)null!=a.columnDefs[s]&&null==a.columnDefs[s].no_filter&&null!=a.columnDefs[s].field&&""!=a.columnDefs[s].field&&"agDateColumnFilter"!=a.columnDefs[s].filter&&(""!=n&&(n+=" or "),n+=a.columnDefs[s].field+" LIKE '%"+a.prepare_filter(i[e])+"%' ESCAPE '$'");null!=a.full_text_added_columns&&a.full_text_added_columns.map((function(o){null!=o&&""!=o&&(""!=n&&(n+=" or "),n+=o+" LIKE '%"+t.prepare_filter(i[e])+"%' ESCAPE '$'")})),""!=n&&(console.log("ADDO "),""!=o&&(o+=" and "),o+="("+n+")")},a=this;for(n=0;n<i.length;n++)s(n);null!=this.full_text_added_query&&this.full_text_added_query.map((function(e){null!=e&&""!=e&&(""!=o&&(o="("+o+") or "),o+=e.split("_VALORE_").join(t.uti_s.string_sqlvalue(t.ric_libera).replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()))})),this.pulisci_filtri(!1),this.doFill_Temp(o,!0)}},t.prototype.onCellClicked=function(t){this.cell_clicked.emit(t)},t.prototype.onCellValueChanged=function(t){},t.prototype.onCellDoubleClicked=function(t){},t.prototype.onCellFocused=function(t){},t.prototype.onSelectionChanged=function(t){var e=this.getGridApi().getSelectedNodes().length;this.selection_change.emit(e),console.log("selectionChanged")},t.prototype.onBeforeFilterChanged=function(){},t.prototype.oncolumnEverythingChanged=function(t){this.b_init&&localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.onFilterModified=function(){var t=this;this.no_pref||setTimeout((function(){t.b_init&&localStorage.setItem(t.grid_key+"_FILTER",JSON.stringify(t.gridOptions.api.getFilterModel()))}),200)},t.prototype.onBeforeSortChanged=function(){},t.prototype.onAfterSortChanged=function(){this.no_pref||this.b_init&&localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.onVirtualRowRemoved=function(t){},t.prototype.onRowClicked=function(t){var e=this.gridOptions.api.getSelectedNodes();null!=e&&null!=e[0]&&(localStorage.setItem(this.grid_key+"_POS",String(e[0].rowIndex)),localStorage.setItem(this.grid_key+"_POS_BAR",JSON.stringify(this.gridOptions.api.getVerticalPixelRange())),localStorage.setItem(this.grid_key+"_POS2",this.getRowNodeId(e[0]))),this.sRow=t.data,localStorage.setItem(this.grid_key+"_LAST_ROW",JSON.stringify(this.sRow)),this.clicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&(this.columndclicked.emit(t),this.dclicked.emit(t.data))},t.prototype.onRowDClicked=function(t){this.dclicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&this.columndclicked.emit(t)},t.prototype.onQuickFilterChanged=function(t){this.gridOptions.api.setQuickFilter(t.target.value)},t.prototype.onColumnEvent=function(t){this.columndclicked.emit(t)},t.prototype.doFill=function(t,e,i){var n=this;void 0===e&&(e=!0),void 0===i&&(i=!0),e&&(this.filters=""),i&&(this.fix_flt=t),this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout((function(){n.ckk()}),10)},t.prototype.doFill_Temp=function(t,e){var i=this;void 0===e&&(e=!0),e&&(this.filters=""),this.fix_flt_temp=t,this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout((function(){i.Refresh()}),10)},t.prototype.Refresh=function(){this.ref_dt()},t.prototype.RefreshOnlyMemory=function(){this.updateRow()},t}();ce.decorators=[{type:n.Component,args:[{selector:"FHGrid",template:'<div fxLayout="column" fxFlexFill>\n <div\n fxLayout="row"\n fxLayout.xs="column"\n fxLayoutAlign="center start"\n fxLayoutGap="3px"\n style="min-height: 55px;"\n [hidden]="!show_buttons"\n >\n \n <div fxLayout="row" fxLayoutGap="3px" fxLayoutAlign="start center">\n <div>\n <h5>{{num_r}} {{label_elementi | translate}}</h5>\n </div>\n \n\n <div fxLayout="row" fxLayoutAlign="start center">\n <input\n matInput\n [placeholder]="trova_label | translate"\n (keydown)="keyDownFunctioncl($event)"\n [(ngModel)]="ric_libera"\n [matTooltip]="search_field_tooltip"\n style="\n width: 160px;\n border: 1px solid;\n min-height: 30px;\n "\n />\n </div>\n\n <div\n matTooltip="REMOVE FILTER"\n matTooltipPosition="above"\n *ngIf="show_pulisci_filtri"\n >\n <button mat-flat-button (click)="pulisci_filtri()" color="warn">\n <mat-icon>filter_none</mat-icon> \n </button>\n </div>\n <div matTooltip="AUTO SIZE" matTooltipPosition="above">\n <button\n mat-flat-button\n (click)="autoSizeAll()"\n color="primary"\n *ngIf="show_buttons"\n >\n <mat-icon>swap_horiz</mat-icon>\n </button>\n </div>\n <div fxHide fxShow.gt-sm matTooltip="FIT SIZE" matTooltipPosition="above">\n <button\n mat-flat-button\n (click)="fitSizeAll()"\n color="primary"\n *ngIf="show_buttons"\n >\n <mat-icon>keyboard_tab</mat-icon>\n </button>\n </div>\n <div fxHide fxShow.gt-sm matTooltip="Refresh" matTooltipPosition="above">\n <button\n mat-flat-button\n (click)="Refresh()"\n color="primary"\n *ngIf="show_buttons"\n >\n <mat-icon>autorenew</mat-icon>\n </button>\n </div>\n <FHFilterComboBox\n fxHide [label]="\'Configurazioni Salvate\' | translate"\n fxShow.gt-sm\n [hidden]="!show_buttons || pref_hidden"\n (selchange)="ch_config()"\n (fillend)="fe_cfg()"\n #gf\n init_fill="false"\n ></FHFilterComboBox>\n <div\n matTooltip="Modifica Preferenza"\n matTooltipPosition="above"\n *ngIf="curr_config!=\'-1\'"\n >\n <button\n mat-icon-button\n *ngIf="show_buttons && !pref_hidden"\n style="color: rgb(248, 105, 10);"\n >\n <mat-icon (click)="edit_config()">save</mat-icon>\n </button>\n </div>\n <div\n matTooltip="Elimina Preferenza"\n matTooltipPosition="above"\n *ngIf="curr_config!=\'-1\'"\n >\n <button\n mat-icon-button\n *ngIf="show_buttons && !pref_hidden"\n style="color: rgb(248, 105, 10);"\n >\n <mat-icon (click)="elimina_config()">delete</mat-icon>\n </button>\n </div>\n <div\n fxHide\n fxShow.gt-sm\n matTooltip="Crea Nuova Preferenza"\n matTooltipPosition="above"\n >\n <button\n mat-icon-button\n style="color: rgb(16, 98, 16);"\n *ngIf="show_buttons && !pref_hidden"\n >\n <mat-icon (click)="insert_config()">library_add</mat-icon>\n </button>\n </div>\n\n <mat-slide-toggle\n fxHide\n fxShow.gt-sm\n [hidden]="!show_buttons || pref_hidden"\n (click)="ck_flag()"\n #toggle_mantieni\n >\n {{mantieni_impostazioni}}\n </mat-slide-toggle>\n\n \n <div fxHide fxShow.gt-sm matTooltip="HELP" matTooltipPosition="above">\n <button\n mat-flat-button\n (click)="help_window()"\n color="primary"\n *ngIf="show_buttons && show_help"\n >\n <mat-icon>help</mat-icon>\n </button>\n </div>\n \n\n <img\n *ngIf="enable_export && enable_export_pdf"\n matTooltip="EXPORT PDF"\n matTooltipPosition="above"\n src="assets/icons/square-o/pdf.svg"\n style="width: 24px; height: 24px; cursor: pointer"\n (click)="print()"\n alt="Export Excel"\n width="24" height="24"\n />\n\n\n <img *ngIf="enable_export && enable_export_xls"\n matTooltip="EXPORT EXCEL"\n matTooltipPosition="above"\n src="assets/icons/square-o/xlsx.svg"\n style="width: 24px; height: 24px; cursor: pointer"\n (click)="export_excel()"\n alt="Export Excel"\n width="24" height="24"\n />\n\n <div *ngIf="flt_aggiuntivo.length!=0"> </div>\n <mat-form-field *ngIf="flt_aggiuntivo.length!=0"\n\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ flt_aggiuntivo_label|translate }}</mat-label>\n <mat-select\n\n [(ngModel)]="flt_aggiuntivo_value"\n (selectionChange)="sc()"\n >\n <mat-option value="{{ app.valore }}" *ngFor="let app of flt_aggiuntivo">{{\n app.descrizione_valore | translate\n }}</mat-option>\n </mat-select>\n </mat-form-field>\n \n <mat-spinner diameter="25" *ngIf="loading_fulltext"></mat-spinner>\n\n </div>\n <div\n fxLayout="row"\n fxLayoutAlign="end center"\n\n [style.width]="width_max"\n *ngIf="enabled"\n >\n\n <FHGridToolBar\n (command)="docmd($event)"\n [type]="toolbar_type"\n [show_link]="show_link"\n [show_help]="show_help_bar"\n [help_label]="help_label_bar"\n [custom_commands]="toolbar_custom_commands"\n [toolbar_wkfapp]="toolbar_wkfapp"\n [elimina_label]="elimina_label"\n [b_wait]="b_wait"\n [sRow]="sRow"\n ></FHGridToolBar>\n </div>\n </div>\n\n\n <div fxLayout="row" style="width: 100%;" [fxFlex]="show_buttons ? 100:95">\n <ag-grid-angular\n ref-agGrid\n style="width: 100%; height: 100%;"\n id="myGrid"\n (cellDoubleClicked)="onColumnEvent($event)"\n (cellClicked)="onCellClicked($event)"\n [headerHeight]="header_h"\n [groupHeaderHeight]="header_h"\n class="ag-theme-balham"\n [singleClickEdit]="true"\n [gridOptions]="gridOptions"\n [columnDefs]="columnDefs"\n [rowData]="rowData"\n [rowSelection]="selection_mode"\n [tooltipShowDelay]="tooltipShowDelay"\n [getContextMenuItems]="enable_export ? getContextMenuItems_e:getContextMenuItems_n_e"\n (filterModified)="onFilterModified()"\n (rowDoubleClicked)="onRowDClicked($event)"\n (rowClicked)="onRowClicked($event)"\n (columnVisible)="oncolumnEverythingChanged($event)"\n (columnResized)="oncolumnEverythingChanged($event)"\n (columnMoved)="oncolumnEverythingChanged($event)"\n (cellValueChanged)="okr($event)"\n (sortChanged)="onAfterSortChanged()"\n (selectionChanged)="onSelectionChanged($event)"\n [paginationPageSize]="num_per_pag"\n (gridReady)="onReady($event)"\n >\n </ag-grid-angular>\n </div>\n</div>\n',styles:[""]}]}],ce.ctorParameters=function(){return[{type:se},{type:i.ToastrService},{type:Dt},{type:wt},{type:h.SlimLoadingBarService},{type:e.MatDialog},{type:Ct},{type:ue},{type:Tt},{type:m.Clipboard},{type:p.TranslateService}]},ce.propDecorators={flt_aggiuntivo:[{type:n.Input}],flt_aggiuntivo_value:[{type:n.Input}],flt_aggiuntivo_label:[{type:n.Input}],overwrite_help_url:[{type:n.Input}],over_fulltext:[{type:n.Input}],b_wait:[{type:n.Input}],over_fulltext_types:[{type:n.Input}],over_fulltext_values:[{type:n.Input}],over_fulltext_sql:[{type:n.Input}],tooltipShowDelay:[{type:n.Input}],elimina_label:[{type:n.Input}],export_field_aggiuntivi:[{type:n.Input}],end_point:[{type:n.Input}],tbl_name:[{type:n.Input}],columnDefs:[{type:n.Input}],count_tbl_name:[{type:n.Input}],search_field_tooltip:[{type:n.Input}],num_per_pag:[{type:n.Input}],grid_key:[{type:n.Input}],sort_field:[{type:n.Input}],fields:[{type:n.Input}],filters:[{type:n.Input}],enabled:[{type:n.Input}],show_link:[{type:n.Input}],show_help_bar:[{type:n.Input}],help_label_bar:[{type:n.Input}],auto_load:[{type:n.Input}],auto_height:[{type:n.Input}],enable_export:[{type:n.Input}],enabled_pag:[{type:n.Input}],show_help:[{type:n.Input}],show_num_elem:[{type:n.Input}],system_dest:[{type:n.Input}],header_h:[{type:n.Input}],selection_mode:[{type:n.Input}],init_fill:[{type:n.Input}],no_pref:[{type:n.Input}],pref_hidden:[{type:n.Input}],enable_export_pdf:[{type:n.Input}],enable_export_xls:[{type:n.Input}],enable_copy:[{type:n.Input}],full_text_added_columns:[{type:n.Input}],full_text_added_query:[{type:n.Input}],autosize_at_ini:[{type:n.Input}],label_elementi:[{type:n.Input}],trova_label:[{type:n.Input}],mantieni_impostazioni:[{type:n.Input}],flt_aggiuntivo_event:[{type:n.Output}],show_buttons:[{type:n.Input}],fill_end:[{type:n.Output}],cell_edited:[{type:n.Output}],clicked:[{type:n.Output}],dclicked:[{type:n.Output}],columndclicked:[{type:n.Output}],cell_clicked:[{type:n.Output}],selection_change:[{type:n.Output}],custom_export:[{type:n.Input}],toolbar_type:[{type:n.Input}],toolbar_wkfapp:[{type:n.Input}],toolbar_custom_commands:[{type:n.Input}],command:[{type:n.Output}],gf:[{type:n.ViewChild,args:["gf"]}],toggle_mantieni:[{type:n.ViewChild,args:["toggle_mantieni"]}],init_end:[{type:n.Output}],off_set:[{type:n.Input}],include_always:[{type:n.Input}],onResize:[{type:n.HostListener,args:["window:resize",["event"]]}]};var de={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return _e})),multi:!0},_e=function(){function t(t,e,i){this._dataService=t,this._dataService_odbc=e,this._tsr=i,this.error=null,this.init_fill=!0,this.sql="",this.types=[],this.values=[],this.hidden=!1,this.label="",this.enabled=!0,this.required=!1,this.load_delay=0,this.show_empty=!0,this.sel_label="",this.tooltip="",this.option_values="",this.fillend=new n.EventEmitter,this.selchange=new n.EventEmitter,this.initend=new n.EventEmitter,this.myData=[],this.valDef="-1",this.selval="-1",this.errorMsg="",this.db_type="1",this.dis_value="",this.is_loaded=!1,this.descri_val="",this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.setValue=function(t){this.setByValue(t)},t.prototype.update_dis=function(){this.dis_value="";try{if(null!=this.descri_val&&""!=this.descri_val)return void(this.dis_value=this._tsr.instant(this.descri_val));null==this.valDef?this.dis_value="":""!=this.valDef.split("-1").join("")?this.dis_value=this._tsr.instant(this.valDef.split("-1").join("")):this.dis_value=""}catch(t){this.dis_value=this.selval}},t.prototype.resetValue=function(){this.selval="-1",this.valDef="-1",this.descri_val="",this.update_dis()},t.prototype.focus=function(){this.smtr.nativeElement.focus()},t.prototype.reset=function(){this.selval="-1",this.valDef="-1",this.myData=new Array,this.update_dis()},t.prototype.fillCombo=function(){var t=this;if(null==this.sql&&(this.sql=""),-1==this.sql.indexOf("|")||-1==this.sql.indexOf("$"))if(null==this.option_values||""==this.option_values){var e=new vt;e.sql=this.sql,e.types=this.types,e.values=this.values,"1"==this.db_type&&this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=0;i<e.result_data.length;i++)null!=e.result_data[i].descrizione_valore&&""!=e.result_data[i].descrizione_valore&&(e.result_data[i].descrizione_valore=t._tsr.instant(e.result_data[i].descrizione_valore));t.resetD(e.result_data)}})),"2"==this.db_type&&this._dataService_odbc.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=0;i<e.result_data.length;i++)null!=e.result_data[i].VALORE&&(e.result_data[i].valore=e.result_data[i].VALORE),null!=e.result_data[i].DESCRIZIONE_VALORE&&(e.result_data[i].descrizione_valore=e.result_data[i].DESCRIZIONE_VALORE),null!=e.result_data[i].descrizione_valore&&""!=e.result_data[i].descrizione_valore&&(e.result_data[i].descrizione_valore=t._tsr.instant(e.result_data[i].descrizione_valore));t.resetD(e.result_data)}}))}else this.set_options(this.option_values);else this.set_options(this.sql)},t.prototype.add_option=function(t){var e=!1;this.myData.map((function(i){i.descrizione_valore!=t.descrizione_valore&&i.valore!=t.valore||(e=!0)})),e||this.myData.push(t)},t.prototype.resetD=function(t){this.myData=t,this.selval="-1",this.setByValue(this.valDef),"-1"==this.getValue()&&"-1"!=this.valDef&&null!=this.valDef&&""!=this.valDef&&this.setByDescri(this._tsr.instant(this.valDef)),this.is_loaded=!0,this.fillend.emit()},t.prototype.setByDescri=function(t){if(this.valDef=t,this.selval="-1",""!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){for(var e=0;e<this.myData.length;e++)if(this.myData[e].descrizione_valore==t)return this.selval=""+this.myData[e].valore,null!=this.myData[e].descrizione_valore&&(this.descri_val=this.myData[e].descrizione_valore),void this.update_dis();if(null!=t&&""!=t&&"-1"!=t){for(var i=!1,n=0;n<this.myData.length;n++)if(null!=this.myData[n].valore&&this.myData[n].valore==t){i=!0;break}i||this.add_option({valore:t,descrizione_valore:t}),this.selval=t,this.descri_val=t}this.update_dis()}},t.prototype.setByIndex=function(t){this.valDef="",this.selval="-1",null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]&&this.myData.length>t&&this.setByDescri(this._tsr.instant(this.myData[t].descrizione_valore))},t.prototype.getObj=function(){if(null==this.selval)return null;if("-1"==this.selval)return null;for(var t=0;t<this.myData.length;t++)if(this.myData[t].valore==this.selval)return this.myData[t]},t.prototype.setByValue=function(t){if(this.valDef=t,this.selval="-1",""+t=="")return this.descri_val="",void this.update_dis();if(null==this.myData&&null!=t&&""!=t){if("-1"==t)return;this.myData=[],this.add_option({valore:t,descrizione_valore:t})}if((0==this.myData.length||null==this.myData[0])&&null!=t&&""!=t){if("-1"==t)return;this.myData=[],this.add_option({valore:t,descrizione_valore:t})}for(var e=0;e<this.myData.length;e++)if(this.myData[e].valore==t)return this.selval=""+this.myData[e].valore,null!=this.myData[e].descrizione_valore&&(this.descri_val=this.myData[e].descrizione_valore),void this.update_dis();if(null!=t&&""!=t&&"-1"!=t){for(var i=!1,n=0;n<this.myData.length;n++)if(null!=this.myData[n].valore&&this.myData[n].valore==t){i=!0;break}i||this.add_option({valore:t,descrizione_valore:t}),this.selval=t,this.descri_val=t}this.update_dis()},t.prototype.getDescri=function(){if(!this.enabled){if(null==this.selval)return this.valDef;if("-1"==this.selval)return this.valDef}if(null==this.selval)return"-1";if("-1"==this.selval)return"-1";for(var t=0;t<this.myData.length;t++)if(this.myData[t].valore==this.selval)return this.myData[t].descrizione_valore},t.prototype.getValue=function(){if(!this.enabled){if(null==this.selval)return this.valDef;if("-1"==this.selval)return this.valDef}return null==this.selval||""==this.selval?"-1":this.selval},t.prototype.getData=function(t){for(var e in this.myData)if(this.myData[e].valore==this.selval)return this.myData[e][t]},t.prototype.set_options=function(t){this.myData=new Array;for(var e=t.split("$"),i=0;i<e.length;i++){var n=new Object,o=e[i].split("|");n.valore=o[1],n.descrizione_valore=this._tsr.instant(o[0]),this.add_option(n)}this.setByValue(this.valDef),this.is_loaded=!0,"-1"==this.getValue()&&(""!=this.valDef?this.setByDescri(this._tsr.instant(this.valDef)):this.setByDescri(this.valDef))},t.prototype.doFill=function(){var t=this;0!=this.load_delay?setTimeout((function(){t.fillCombo()}),this.load_delay):this.fillCombo()},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(1==t.init_fill){if(""==t.sql)return void setTimeout((function(){t.is_loaded=!0}),1e3);t.doFill()}else t.errorMsg="";t.initend.emit(),setTimeout((function(){t.is_loaded=!0}),1e3)}))},t.prototype.sc=function(){var t=this;this.onChange(this.getValue()),setTimeout((function(){t.selchange.emit({event:t.getObj(),valore:t.getValue(),descrizione_valore:t.getDescri()}),t.update_dis(),t.dis_value=t.getDescri()}))},t.prototype.getModelValue=function(){return this.getData("valore")},t.prototype.writeValue=function(t){null!=t&&null!=t&&(this.resetValue(),this.setByValue(t))},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}();_e.decorators=[{type:n.Component,args:[{selector:"FHComboBox",providers:[de],template:'\n <div style="min-height:45px" *ngIf="enabled && !hidden && !is_loaded && myData?.length==0"><mat-spinner diameter="25" ></mat-spinner></div>\n <mat-form-field\n [hidden]="!enabled || hidden || (!is_loaded && myData?.length==0)" [class.fh_field]="enabled"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label|translate }}</mat-label>\n <mat-select\n #cmb\n [(ngModel)]="selval"\n (selectionChange)="sc()"\n [required]="required"\n [matTooltip]="tooltip"\n >\n <mat-option value="-1" *ngIf="show_empty">{{ sel_label }}</mat-option>\n <mat-option value="{{ app.valore }}" *ngFor="let app of myData">{{\n app.descrizione_valore | translate\n }}</mat-option>\n </mat-select>\n <mat-error *ngIf="error==null">{{ error }}</mat-error>\n </mat-form-field>\n\n <mat-form-field\n [hidden]="enabled || hidden" [class.fh_field_dis]="!enabled"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n <input\n type="text"\n #el1\n matInput\n [disabled]="true"\n [(ngModel)]="dis_value"\n [matTooltip]="tooltip"\n />\n </mat-form-field>\n ',styles:[""]}]}],_e.ctorParameters=function(){return[{type:Dt},{type:Qt},{type:p.TranslateService}]},_e.propDecorators={error:[{type:n.Input}],init_fill:[{type:n.Input}],sql:[{type:n.Input}],types:[{type:n.Input}],values:[{type:n.Input}],hidden:[{type:n.Input}],label:[{type:n.Input}],enabled:[{type:n.Input}],required:[{type:n.Input}],load_delay:[{type:n.Input}],show_empty:[{type:n.Input}],sel_label:[{type:n.Input}],tooltip:[{type:n.Input}],option_values:[{type:n.Input}],smtr:[{type:n.ViewChild,args:["cmb"]}],fillend:[{type:n.Output}],selchange:[{type:n.Output}],initend:[{type:n.Output}],valDef:[{type:n.Input}],db_type:[{type:n.Input}]};var he={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return me})),multi:!0},me=function(){function t(t,e){this._dataService=t,this._dataService_odbc=e,this.init_fill=!0,this.error=null,this.sql="",this.label="",this.types=[],this.values=[],this.hidden=!1,this.id_loading=!1,this.db_type="1",this.enabled=!0,this.open_on_load=!0,this.option_values="",this.required=!1,this.only_from_list=!1,this.fillend=new n.EventEmitter,this.selchange=new n.EventEmitter,this.change=new n.EventEmitter,this.initend=new n.EventEmitter,this.focusout=new n.EventEmitter,this.descri_val="",this.load_delay=0,this.sItem="",this.searchItemsFiltered=[],this.myData=[],this.is_loaded=!1,this.selval=null,this.errorMsg="",this.valDef="",this.table_hidden=!0,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.fi_search=function(){null==this.sItem&&(this.sItem="",this.onChange(""))},t.prototype.fo_search=function(t){var e=this;setTimeout((function(){e.only_from_list?(e.onChange(e.getValue()),e.change.emit(e.getValue())):(e.onChange(e.sItem),e.change.emit(e.sItem))})),this.focusout.emit()},t.prototype.onChange_up=function(t){if(this.searchItemsFiltered=[],null!=this.sItem)if(""!=this.sItem){var e=this.sItem.toLowerCase();if(null!=this.myData)for(var i=0;i<this.myData.length&&(null!=this.myData[i].descrizione_valore&&-1!=this.myData[i].descrizione_valore.toLowerCase().indexOf(e)&&this.searchItemsFiltered.push(this.myData[i]),!(e.length<4&&20==this.searchItemsFiltered.length));i++);}else if(null!=this.myData)for(i=0;i<this.myData.length&&(this.searchItemsFiltered.push(this.myData[i]),20!=i);i++);},t.prototype.add_option=function(t){var e=!1;this.myData.map((function(i){i.descrizione_valore!=t.descrizione_valore&&i.valore!=t.valore||(e=!0)})),e||this.myData.push(t)},t.prototype.selectedSearchItem=function(t){this.setByDescri(t.option.value),this.sItem=t.option.value,this.ch(t)},t.prototype.ch=function(t){this.getValue();this.selchange.emit({event:t,valore:this.getValue(),descrizione_valore:this.sItem}),this.only_from_list?(this.onChange(this.getValue()),this.change.emit(this.getValue())):(this.onChange(this.sItem),this.change.emit(this.sItem))},t.prototype.myListFormatter=function(t){return t.descrizione_valore},t.prototype.resetValue=function(t){void 0===t&&(t=!0),this.selval="",t&&(this.valDef=""),this.sItem="",this.selval=null},t.prototype.reset=function(){this.selval="",this.valDef="",this.selval=null,this.sItem="",this.myData=new Array},t.prototype.doFill=function(){var t=this;setTimeout((function(){t.fillCombo()}),this.load_delay)},t.prototype.fillCombo=function(){var t=this;if(console.log("fillcombo ",this.option_values),this.myData=new Array,this.searchItemsFiltered=new Array,null==this.sql&&(this.sql=""),null==this.option_values&&(this.option_values=""),-1==this.sql.indexOf("|")||-1==this.sql.indexOf("$"))if(""==this.option_values){var e=new vt;e.sql=this.sql,e.types=this.types,e.values=this.values,"1"==this.db_type&&this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.resetD(e.result_data),t.is_loaded=!0,t.fillend.emit())})),"2"==this.db_type&&this._dataService_odbc.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=0;i<e.result_data.length;i++)null!=e.result_data[i].VALORE&&(e.result_data[i].valore=e.result_data[i].VALORE),null!=e.result_data[i].DESCRIZIONE_VALORE&&(e.result_data[i].descrizione_valore=e.result_data[i].DESCRIZIONE_VALORE);t.resetD(e.result_data),t.is_loaded=!0,t.fillend.emit(),!0}}))}else this.set_options(this.option_values);else this.set_options(this.sql)},t.prototype.resetD=function(t){if(this.myData=t,this.selval="",this.table_hidden=!1,this.errorMsg="",!this.only_from_list)return this.last_v=this.valDef,this.selval=this.valDef,void(this.sItem=this.selval);this.setByValue(this.valDef),null!=this.getValue()&&""!=this.getValue()||""==this.valDef||this.setByDescri(this.valDef)},t.prototype.setByDescri=function(t){if(this.valDef=t,this.selval="",""!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){if(null!=this.myData)for(var e=0;e<this.myData.length;e++)if(this.myData[e].descrizione_valore==t)return this.sItem=t,this.selval=this.myData[e].valore,void(null!=this.sItem&&(this.descri_val=this.sItem));this.only_from_list||(this.sItem=t)}},t.prototype.last_val_rec=function(){this.setByValue(this.last_v)},t.prototype.setByValue=function(t){var e=this;if(this.valDef=t,this.selval=t,null!=this.myData){var i=!1;for(var n in this.myData)if(this.myData[n].valore==this.selval)return this.sItem=this.myData[n].descrizione_valore,void(null!=this.sItem&&(i=!0,this.descri_val=this.sItem));!i&&this.only_from_list&&this.resetValue(!1),this.only_from_list||(this.sItem=this.selval)}else this.only_from_list?setTimeout((function(){e.last_val_rec()}),1e3):this.sItem=this.selval},t.prototype.setValue=function(t){this.setByValue(t)},t.prototype.getDescri=function(){return this.getData("descrizione_valore")},t.prototype.getData=function(t){for(var e in this.myData)if(this.myData[e].descrizione_valore==this.sItem)return this.myData[e][t];return this.only_from_list?null:this.sItem},t.prototype.getObj=function(){for(var t in this.myData)if(this.myData[t].descrizione_valore==this.selval||this.myData[t].valore==this.selval)return this.myData[t];return null},t.prototype.getValue=function(){return this.getData("valore")},t.prototype.getModelValue=function(){var t=this.getData("valore");return null!==t||this.only_from_list?t:this.sItem},t.prototype.set_options=function(t){this.myData=new Array;for(var e=t.split("$"),i=0;i<e.length;i++){var n=new Object,o=e[i].split("|");n.valore=o[1],n.descrizione_valore=o[0],this.myData.push(n)}this.table_hidden=!1,this.is_loaded=!0,this.setByValue(this.valDef),""==this.getValue()&&this.setByDescri(this.valDef)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(t.init_fill){if(""==t.sql)return void setTimeout((function(){t.is_loaded=!0}),1e3);setTimeout((function(){t.fillCombo()}),t.load_delay)}else t.errorMsg="";t.initend.emit(),setTimeout((function(){t.is_loaded=!0}),1e3)}))},t.prototype.writeValue=function(t){this.last_v=t,this.setValue(t)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}();me.decorators=[{type:n.Component,args:[{selector:"FHAutoComplete",providers:[he],template:'\n <div style="min-height:45px" *ngIf="enabled && !hidden && !is_loaded && myData?.length==0"><mat-spinner diameter="25" ></mat-spinner></div>\n <mat-form-field\n [hidden]="!enabled || hidden || (!is_loaded && myData?.length==0)" [class.fh_field]="enabled"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n <input\n matInput\n [disabled]="!enabled || hidden"\n [matAutocomplete]="auto"\n [required]="required"\n #trigger="matAutocompleteTrigger"\n (keyup)="onChange_up($event)"\n [(ngModel)]="sItem"\n (focus)="fi_search();onChange_up($event)"\n (focusout)="fo_search($event)"\n #searchp\n />\n <mat-error *ngIf="error==null">{{ error }}</mat-error>\n </mat-form-field>\n <mat-autocomplete\n #auto="matAutocomplete"\n (optionSelected)="selectedSearchItem($event)"\n [autoActiveFirstOption]="open_on_load"\n >\n <mat-option\n *ngFor="let objx of searchItemsFiltered"\n [value]="objx.descrizione_valore"\n >\n {{ objx.descrizione_valore }}\n </mat-option>\n </mat-autocomplete>\n\n <div class="ui negative message" *ngIf="errorMsg != \'\'">\n <i class="close icon"></i>\n <div class="header">\n {{ errorMsg }}\n </div>\n </div>\n <mat-form-field\n [hidden]="enabled || hidden" [class.fh_field_dis]="!enabled"\n\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n <input type="text" #el1 matInput [disabled]="true" [required]="required" [(ngModel)]="sItem" />\n </mat-form-field>\n ',styles:[""]}]}],me.ctorParameters=function(){return[{type:Dt},{type:Qt}]},me.propDecorators={init_fill:[{type:n.Input}],autocomplete:[{type:n.ViewChild,args:[g.MatAutocompleteTrigger]}],error:[{type:n.Input}],sql:[{type:n.Input}],label:[{type:n.Input}],types:[{type:n.Input}],values:[{type:n.Input}],hidden:[{type:n.Input}],db_type:[{type:n.Input}],enabled:[{type:n.Input}],open_on_load:[{type:n.Input}],option_values:[{type:n.Input}],required:[{type:n.Input}],only_from_list:[{type:n.Input}],fillend:[{type:n.Output}],selchange:[{type:n.Output}],change:[{type:n.Output}],initend:[{type:n.Output}],focusout:[{type:n.Output}],load_delay:[{type:n.Input}],searchp:[{type:n.ViewChild,args:["searchp"]}],auto:[{type:n.ViewChild,args:["auto"]}]};for(var fe=v,ge={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMMM Y",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM Y"}},ve=[],ye=1;ye<=31;ye++)ve.push(String(ye));var be=function(t){function e(){var e=t.apply(this,Et(arguments))||this;return e.localeData=fe.localeData(),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}xt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e.prototype.getYear=function(t){return t.year()},e.prototype.getMonth=function(t){return t.month()},e.prototype.getDate=function(t){return t.date()},e.prototype.getDayOfWeek=function(t){return t.day()},e.prototype.getMonthNames=function(t){switch(t){case"long":return this.localeData.months();case"short":return this.localeData.monthsShort();case"narrow":return this.localeData.monthsShort().map((function(t){return t[0]}))}},e.prototype.getDateNames=function(){return ve},e.prototype.getDayOfWeekNames=function(t){switch(t){case"long":return this.localeData.weekdays();case"short":case"narrow":return this.localeData.weekdaysShort()}},e.prototype.getYearName=function(t){return String(t.year())},e.prototype.getFirstDayOfWeek=function(){return this.localeData.firstDayOfWeek()},e.prototype.getNumDaysInMonth=function(t){return t.daysInMonth()},e.prototype.clone=function(t){return t.clone()},e.prototype.createDate=function(t,e,i){return fe([t,e,i])},e.prototype.today=function(){return fe()},e.prototype.parse=function(t,e){if(console.log("prima value ",t,"parseFormat ",e),null!=t){var i,n=t.split("/");if(console.log("arr ",n),3==n.length)(i=parseInt(n[2]))<100&&(i+=2e3),1==n[1].length&&(n[1]="0"+n[1]),1==n[0].length&&(n[0]="0"+n[0]),t=n[0]+"/"+n[1]+"/"+i;if(n=t.split("-"),console.log("arr ",n),3==n.length)(i=parseInt(n[2]))<100&&(i+=2e3),1==n[1].length&&(n[1]="0"+n[1]),1==n[0].length&&(n[0]="0"+n[0]),t=n[0]+"/"+n[1]+"/"+i}console.log("fine value ",t,"parseFormat ",e);var o=fe(t,e,!0);return o.isValid()||(o=fe(t)),o.isValid()?o:null},e.prototype.format=function(t,e){return t?t.format(e):""},e.prototype.addCalendarYears=function(t,e){return t.clone().add(e,"y")},e.prototype.addCalendarMonths=function(t,e){return t.clone().add(e,"M")},e.prototype.addCalendarDays=function(t,e){return t.clone().add(e,"d")},e.prototype.setLocale=function(t){this.localeData=fe.localeData(t)},e.prototype.compareDate=function(t,e){return t.diff(e,"seconds",!0)},e.prototype.sameDate=function(e,i){return null==e?null==i:v.isMoment(e)?e.isSame(i):t.prototype.sameDate.call(this,e,i)},e.prototype.clampDate=function(t,e,i){return e&&t.isBefore(e)?e:i&&t.isAfter(i)?i:t},e.prototype.isValid=function(t){return t.isValid()},e.prototype.isDateInstance=function(t){return fe.isMoment(t)},e.prototype.toIso8601=function(t){return t.format()},e.prototype.fromIso8601=function(t){return fe(t)},e.prototype.invalid=function(){},e}(y.DateAdapter),we={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Ie})),multi:!0},Se=ge,Ie=function(){function t(t,e,i){this.dateAdapter=t,this.uti_s=e,this._apps=i,this.label="",this.error=null,this.required=!1,this.show_buttons=!1,this.enabled=!0,this.min_date=null,this.max_date=null,this.change=new n.EventEmitter,this.init_end=new n.EventEmitter,this.v_view=this.uti_s.date2String(new Date),this.date_sel=null,this.v_date_sel="",this.onChange=function(t){},this.onTouched=function(){},this.setlocalt()}return t.prototype.checkInput=function(t){},t.prototype.dt_chg=function(t){var e=t.target.value.split("-").join("/").split("/");if(3==e.length)if(1==e[1].length&&(e[1]="0"+e[1]),1==e[0].length&&(e[0]="0"+e[0]),parseInt(e[2])<3e3&&parseInt(e[0])>0&&parseInt(e[0])<=31&&parseInt(e[1])>0&&parseInt(e[1])<=12){var i=new be,n=parseInt(e[2]);n<100&&(n+=2e3),this.date_sel=i.createDate(n,parseInt(e[1])-1,parseInt(e[0]))}else console.log("data non valida! ",e)},t.prototype.chxx=function(t){},t.prototype.ch=function(t){this.onChange(this.getValue()),this.change.emit(this.getValue())},t.prototype.setlocalt=function(){var t=this;null!=this._apps.user_lang&&""!=this._apps.user_lang?"it"==this._apps.user_lang?this.dateAdapter.setLocale("it-IT"):"en"==this._apps.user_lang?this.dateAdapter.setLocale("en-GB"):this.dateAdapter.setLocale("it-IT"):setTimeout((function(){t.setlocalt()}),500)},t.prototype.setFocus=function(){this.pickerId.nativeElement.focus()},t.prototype.dt_ch=function(){var t=this;setTimeout((function(){t.ch()}),50)},t.prototype.add_year=function(){var t=new be;this.date_sel=t.createDate(this.getValue().getFullYear()+1,this.getValue().getMonth(),this.getValue().getDate()),this.v_view=this.uti_s.date2String(this.getValue()),this.ch()},t.prototype.ini_year=function(){var t=new be;this.date_sel=t.createDate(this.getValue().getFullYear()+1,1,1),this.v_view=this.uti_s.date2String(this.getValue()),this.ch()},t.prototype.fin_year=function(){var t=new be;this.date_sel=t.createDate(this.getValue().getFullYear()+1,12,31),this.v_view=this.uti_s.date2String(this.getValue()),this.ch()},t.prototype.getValue=function(){return null==this.date_sel?null:this.date_sel.toDate()},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.setLimits(),t.init_end.emit()}))},t.prototype.setLimits=function(){},t.prototype.setToday=function(){this.date_sel=new Date},t.prototype.setValue=function(t){if(this.setlocalt(),null!=t)if("string"==typeof t&&(t=new Date(this.uti_s.string2date(t,2))),t instanceof Date||null!=t.value&&(t=new Date(t.value)),1970!=t.getFullYear()){var e=new be;this.date_sel=e.createDate(t.getFullYear(),t.getMonth(),t.getDate()),this.v_view=this.uti_s.date2String(this.getValue())}else this.date_sel=null;else this.date_sel=null},t.prototype.writeValue=function(t){this.setValue(t)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}();Ie.decorators=[{type:n.Component,args:[{selector:"FHDatePicker",providers:[we,{provide:y.MAT_DATE_FORMATS,useValue:Se},{provide:y.DateAdapter,useClass:be}],template:'\n <div [hidden]="!show_buttons || !enabled">\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="add_year()"\n >\n +1 Anno\n </button>\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="ini_year()"\n >\n Inizio Anno\n </button>\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="fin_year()"\n >\n Fine Anno\n </button>\n </div>\n\n <mat-form-field\n (click)="chxx($event)"\n appearance="outline"\n floatLabel="always" [class.fh_field]="enabled" [class.fh_field_dis]="!enabled"\n ><mat-label>{{ label }}</mat-label>\n <input\n [disabled]="!enabled"\n #pickerId\n (dateChange)="ch($event)"\n (focusout)="dt_chg($event)"\n (keyup)="checkInput($event)"\n [min]="min_date"\n [max]="max_date"\n [required]="required"\n (click)="chxx($event)"\n [(ngModel)]="date_sel"\n matInput\n [matDatepicker]="picker"\n />\n <mat-datepicker-toggle\n matSuffix\n [for]="picker"\n (click)="chxx($event)"\n ></mat-datepicker-toggle>\n <mat-datepicker (click)="chxx($event)" #picker></mat-datepicker>\n <mat-error *ngIf="error==null">{{ error }}</mat-error>\n </mat-form-field>\n ',styles:["\n .lb_small_grigia {\n font-size: 15px;\n color: #b8b8b8;\n }\n\n .label_dis {\n font-size: 14px;\n font-weight: bold;\n }\n\n :host.ng-invalid > .ng-touched ::ng-deep .mat-input-element,\n :host.ng-invalid > .ng-touched ::ng-deep .mat-form-field-label {\n color: #f44336;\n }\n\n :host.ng-invalid > .ng-touched ::ng-deep .mat-form-field-underline,\n :host.ng-invalid > .ng-touched ::ng-deep .mat-form-field-ripple {\n background-color: #f44336;\n }\n "]}]}],Ie.ctorParameters=function(){return[{type:y.DateAdapter},{type:Ct},{type:wt}]},Ie.propDecorators={label:[{type:n.Input}],error:[{type:n.Input}],required:[{type:n.Input}],show_buttons:[{type:n.Input}],enabled:[{type:n.Input}],min_date:[{type:n.Input}],max_date:[{type:n.Input}],change:[{type:n.Output}],pickerId:[{type:n.ViewChild,args:["pickerId"]}],init_end:[{type:n.Output}]};var xe=function(){function t(t,e,i,n){this._dataService=t,this.dialogRef=e,this.toastr=i,this.data=n,this.width="100%",this.label="Ricerca...",this.selectedAdd=null,this.selectedRemove=null,this.errorMsg="",this.fltr_user="",this.height=420,this.single_sel=!1,this.vis_buttons=!0,this.all_users=!1,this.lista_utenti=[],this.user_sel=new Array,null!=n&&(null!=n.single_sel&&(this.single_sel=n.single_sel),null!=n.user_sel&&(this.user_sel=n.user_sel),null!=n.all_users&&(this.all_users=n.all_users),null!=n.vis_buttons&&(this.vis_buttons=n.vis_buttons),null!=n.users_list&&(this.users_list=n.users_list,this.lista_utenti=JSON.parse(JSON.stringify(this.users_list))))}return t.prototype.do_add_all=function(){this.fltr_user="",this.users_list_sel=[],this.users_list=JSON.parse(JSON.stringify(this.lista_utenti)),this.user_sel=JSON.parse(JSON.stringify(this.lista_utenti))},t.prototype.do_rem_all=function(){this.fltr_user="",this.users_list=JSON.parse(JSON.stringify(this.lista_utenti)),this.users_list_sel=JSON.parse(JSON.stringify(this.lista_utenti)),this.user_sel=[]},t.prototype.filtra=function(){null==this.fltr_user&&(this.fltr_user=""),console.log("filtra() "+this.fltr_user.toUpperCase()),this.users_list_sel=new Array;for(var t=0;t<this.users_list.length;t++)if(null!=this.users_list[t].nc){for(var e=!1,i=0;i<this.users_list_sel.length;i++)if(this.users_list_sel[i].username==this.users_list[t].username&&this.users_list_sel[i].canale==this.users_list[t].canale){e=!0;break}if(!e&&(-1!=this.users_list[t].nc.toUpperCase().indexOf(this.fltr_user.toUpperCase())||""==this.fltr_user)){for(var n=!1,o=0;o<this.user_sel.length;o++)if(this.user_sel[o].username==this.users_list[t].username&&this.user_sel[o].canale==this.users_list[t].canale){n=!0;break}n||this.users_list_sel.push(this.users_list[t])}}},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(t.all_users){var e=new vt;e.sql="SELECT_ALL_USERS",e.types=[],e.values=[],t._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.users_list=e.result_data,t.lista_utenti=JSON.parse(JSON.stringify(t.users_list)),t.filtra())}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"}))}else{if(t.lista_utenti=JSON.parse(JSON.stringify(t.users_list)),t.users_list_sel=new Array,null!=t.users_list)for(var i=0;i<t.users_list.length;i++)t.users_list_sel.push(t.users_list[i]);if(null!=t.users_list&&null!=t.user_sel&&t.user_sel.length>0)return}}))},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.do_add=function(){if(null!=this.selectedAdd){var t=this.users_list.indexOf(this.selectedAdd,0);this.single_sel||t>-1&&this.users_list.splice(t,1),console.log("this.users_list 1 ",this.users_list),this.single_sel&&(this.user_sel=new Array),null==this.user_sel&&(this.user_sel=[]),this.user_sel.push(this.selectedAdd),this.selectedAdd=null,this.filtra()}else this.toastr.error("ERRORE","Selezionare l'utente da aggiungere",{timeOut:1e3,progressBar:!0})},t.prototype.do_rem=function(){if(null!=this.selectedRemove){var t=this.user_sel.indexOf(this.selectedRemove,0);t>-1&&this.user_sel.splice(t,1),this.users_list.push(this.selectedRemove),this.selectedRemove=null,this.filtra()}else this.toastr.error("ERRORE","Selezionare l'utente da rimuovere",{timeOut:1e3,progressBar:!0})},t.prototype.addTo=function(t){this.option=!0,this.selectedAdd=t,this.selectedRemove=null},t.prototype.removeTo=function(t){this.option=!1,this.selectedAdd=null,this.selectedRemove=t},t.prototype.getSelArr=function(){return this.user_sel},t}();xe.decorators=[{type:n.Component,args:[{selector:"FHPickUsers",template:'\n <mat-dialog-content style="font-size:12px">\n <br /><br />\n <div fxLayout="row">\n <div fxLayout="column" fxFlex="40">\n <div style="width:100%;overflow-y:scroll;" [style.height]="(height)+ \'px\'">\n <table style="width: 100%" class="fh_table sel_r" cellpadding="7">\n <thead>\n <tr>\n <th colspan="2">{{\'UTENTI SELEZIONABILI\' | translate }}</th>\n </tr>\n </thead>\n\n <tbody>\n <tr>\n <td colspan="2" style="background-color:#FFF !important">\n <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>{{ label | translate }}</mat-label>\n <input\n [(ngModel)]="fltr_user"\n (ngModelChange)="filtra()"\n matInput\n />\n </mat-form-field>\n </td>\n </tr>\n <tr\n *ngFor="\n let u of users_list_sel;\n let odd = odd;\n let even = even\n "\n\n (click)="addTo(u);selectedAdd = u"\n (dblclick)="do_add()"\n [style.background-color]="selectedAdd == u ? \'#2AA1DD\':\'\'"\n [style.color]="selectedAdd == u ? \'#FFFFFF\':\'\'"\n [ngClass]="selectedAdd == u ? \'\':\'sel_r\'"\n\n >\n <td style="width: 80%">{{ u.nc }}</td>\n <td style="width: 20%">{{ u.context }}</td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div\n fxLayout="column"\n fxFlex="20"\n style="height: 280px; position: relative; margin:0 .5em; padding-left: .5em; padding-right: .5em; border-left: 1px solid rgba(191, 191, 191, 0.5); border-right: 1px solid rgba(191, 191, 191, 0.5);"\n >\n <div\n style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);"\n > <br><br><br><br><br><br>\n <div style="width:100%;text-align:center">\n <button\n mat-flat-button\n color="primary"\n (click)="do_add()"\n [disabled]="!option || selectedAdd==null"\n >\n <mat-icon>arrow_forward</mat-icon>\n </button>\n </div>\n <br />\n <div style="width:100%;text-align:center">\n <button\n mat-flat-button\n color="primary"\n (click)="do_rem()"\n [disabled]="option || selectedRemove==null"\n >\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n <br><br><br><br>\n <div style="width:100%;text-align:center">\n <button\n mat-flat-button\n color="primary"\n (click)="do_add_all()"\n [disabled]="users_list_sel?.length==0"\n >\n {{\'Sel. Tutti\' | translate}}\n </button>\n </div>\n <br />\n <div style="width:100%;text-align:center">\n <button\n mat-flat-button\n color="primary"\n (click)="do_rem_all()"\n [disabled]="user_sel?.length==0"\n >\n {{\'Desel. Tutti\' | translate}}\n </button>\n </div>\n </div>\n </div>\n <div fxLayout="column" fxFlex="40">\n <div style="width:100%;overflow-y:scroll;" [style.height]="(height)+ \'px\'">\n <table style="width: 100%" class="fh_table sel_r" cellpadding="7">\n <thead>\n <tr>\n <th colspan="2">{{\'UTENTI SELEZIONATI\' | translate }}</th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="let u of user_sel; let odd = odd; let even = even"\n [style.background-color]="selectedRemove == u ? \'#2AA1DD\':\'\'"\n [style.color]="selectedRemove == u ? \'#FFFFFF\':\'\'"\n [ngClass]="selectedRemove == u ? \'\':\'sel_r\'"\n (click)="removeTo(u);selectedRemove = u"\n (dblclick)="do_rem()"\n\n >\n <td style="width: 80%">{{ u.nc }}</td>\n <td style="width: 20%">{{ u.canale }}</td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions *ngIf="vis_buttons">\n <div\n style="width:100%"\n *ngIf="vis_buttons"\n fxLayout="row"\n fxLayoutAlign="center center"\n >\n <button\n mat-flat-button\n color="primary"\n (click)="dialogRef.close(this.user_sel)"\n >\n Ok</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="dialogRef.close()"\n >\n {{\'Annulla\' | translate }}\n </button>\n </div>\n </mat-dialog-actions>\n ',styles:["\n\n\n "]}]}],xe.ctorParameters=function(){return[{type:Dt},{type:e.MatDialogRef},{type:i.ToastrService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},xe.propDecorators={height:[{type:n.Input}],users_list:[{type:n.Input}],single_sel:[{type:n.Input}],vis_buttons:[{type:n.Input}],all_users:[{type:n.Input}],user_sel:[{type:n.Input}]};var Oe={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Ee})),multi:!0},Ee=function(){function t(){this.hidden=!1,this.label="",this.hint="",this.autocomplete="",this.maxlength="",this.type="text",this.enabled=!0,this.required=!1,this.email=!1,this.error=null,this.change=new n.EventEmitter,this.focusout=new n.EventEmitter,this.focusin=new n.EventEmitter,this.text_v="",this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.setFocus=function(){this.el.nativeElement.focus()},t.prototype.onFi=function(){var t=this;setTimeout((function(){t.focusin.emit(t.text_v)}))},t.prototype.onFu=function(){var t=this;setTimeout((function(){t.focusout.emit(t.text_v)}))},t.prototype.modelch=function(){var t=this;setTimeout((function(){t.onChange(t.text_v),t.change.emit(t.text_v)}))},t.prototype.ngAfterViewInit=function(){},t.prototype.writeValue=function(t){this.text_v=t},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}();Ee.decorators=[{type:n.Component,args:[{selector:"FHTextInput",providers:[Oe],template:'\n <mat-form-field [hidden]="hidden" appearance="outline" floatLabel="always" [class.fh_field]="enabled" [class.fh_field_dis]="!enabled"\n ><mat-label>{{ label }}</mat-label>\n <input\n matInput\n [email]="email"\n type="text"\n [(ngModel)]="text_v"\n #el\n [disabled]="!enabled"\n [required]="required"\n (focusout)="onFu()"\n (focusin)="onFi()"\n (ngModelChange)="modelch()"\n [autocomplete]="autocomplete"\n [maxlength]="maxlength"\n [type]="type"\n />\n <mat-hint [hidden]="hint==\'\'">{{hint}}</mat-hint>\n <mat-error *ngIf="error==null">{{ error }}</mat-error>\n </mat-form-field>\n ',styles:[""]}]}],Ee.ctorParameters=function(){return[]},Ee.propDecorators={hidden:[{type:n.Input}],label:[{type:n.Input}],hint:[{type:n.Input}],autocomplete:[{type:n.Input}],maxlength:[{type:n.Input}],type:[{type:n.Input}],enabled:[{type:n.Input}],required:[{type:n.Input}],email:[{type:n.Input}],error:[{type:n.Input}],change:[{type:n.Output}],focusout:[{type:n.Output}],focusin:[{type:n.Output}],el:[{type:n.ViewChild,args:["el"]}]};var Ae=function(){function t(){this.val_app=-1}return t.prototype.ok=function(){this.val_app=1,this.params.api.stopEditing()},t.prototype.ko=function(){this.val_app=0,this.params.api.stopEditing()},t.prototype.nd=function(){this.val_app=-1,this.params.api.stopEditing()},t.prototype.agInit=function(t){this.params=t},t.prototype.getValue=function(){return this.val_app},t.prototype.isPopup=function(){return!0},t.prototype.onKeyDown=function(t){var e=t.which||t.keyCode;37!=e&&39!=e||t.stopPropagation()},t}();Ae.decorators=[{type:n.Component,args:[{selector:"approva-cell",template:'\n <div #container class="mood">\n <div class="example-mat-buttons">\n <button mat-icon-button style="color:green" (click)="ok()">\n <mat-icon>thumb_up</mat-icon>\n </button>\n <button mat-icon-button style="color:red" (click)="ko()">\n <mat-icon>thumb_down</mat-icon>\n </button>\n <button mat-icon-button style="color:gray" (click)="nd()">\n <mat-icon>crop_din</mat-icon>\n </button>\n </div>\n </div>\n ',styles:["\n .mood {\n border-radius: 15px;\n border: 1px solid grey;\n background: #e6e6e6;\n padding: 15px;\n text-align: center;\n display: inline-block;\n outline: none;\n }\n "]}]}],Ae.propDecorators={container:[{type:n.ViewChild,args:["container",{read:n.ViewContainerRef}]}]};var Ce="000000",ke=function(){function t(){this.DECIMAL_SEPARATOR=",",this.THOUSANDS_SEPARATOR="."}return t.prototype.transform=function(t,e){void 0===e&&(e=2);var i=Ot((t||"").toString().split(this.DECIMAL_SEPARATOR),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=e>0?this.DECIMAL_SEPARATOR+(s+Ce).substring(0,e):"",(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,this.THOUSANDS_SEPARATOR))+s},t.prototype.parse=function(t,e){void 0===e&&(e=2);var i=Ot((t||"").split(this.DECIMAL_SEPARATOR),2),n=i[0],o=i[1],s=void 0===o?"":o;return n=n.replace(new RegExp(this.THOUSANDS_SEPARATOR,"g"),""),s=parseInt(s,10)>0&&e>0?this.DECIMAL_SEPARATOR+(s+Ce).substring(0,e):"",t},t}();ke.decorators=[{type:n.Pipe,args:[{name:"FHCurrency"}]}],ke.ctorParameters=function(){return[]};var Te=function(){function t(t,e){this.elementRef=t,this.currencyPipe=e,this.el=this.elementRef.nativeElement}return t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.el.value=t.currencyPipe.transform(t.el.value)}))},t.prototype.onFocus=function(t){this.el.value=this.currencyPipe.parse(t)},t.prototype.onBlur=function(t){this.el.value=this.currencyPipe.transform(t)},t}();Te.decorators=[{type:n.Directive,args:[{selector:"[FHCurrencyFormatter]"}]}],Te.ctorParameters=function(){return[{type:n.ElementRef},{type:ke}]},Te.propDecorators={onFocus:[{type:n.HostListener,args:["focus",["$event.target.value"]]}],onBlur:[{type:n.HostListener,args:["blur",["$event.target.value"]]}]};var De=function(){function t(t,e,i,n){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.data=n,this.title="",this.sql_dett="",this.open_only_one=!0,this.descri="",this.lat=51.673858,this.long=7.815982,this.zoom=7,this.infoWindowOpened=null,this.markers=[],this.height="600px",null!=n&&(null!=n.height&&(this.height=n.height),null!=n.open_only_one&&(this.open_only_one=n.open_only_one)),null!=this.m_appService.getState().appo_dialog&&(null!=this.m_appService.getState().appo_dialog.zoom&&(this.zoom=this.m_appService.getState().appo_dialog.zoom),null!=this.m_appService.getState().appo_dialog.title&&(this.title=this.m_appService.getState().appo_dialog.title),null!=this.m_appService.getState().appo_dialog.lat&&(this.lat=this.m_appService.getState().appo_dialog.lat),null!=this.m_appService.getState().appo_dialog.long&&(this.long=this.m_appService.getState().appo_dialog.long),null!=this.m_appService.getState().appo_dialog.descri&&(this.descri=this.m_appService.getState().appo_dialog.descri),null!=this.m_appService.getState().appo_dialog.markers&&(this.markers=this.m_appService.getState().appo_dialog.markers))}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.apri_Scheda=function(t){window.open(t)},t.prototype.clickedMarker=function(t,e,i){this.open_only_one&&this.infoWindowOpened!==e&&(null!==this.infoWindowOpened&&this.infoWindowOpened.close(),this.infoWindowOpened=e)},t.prototype.ngAfterViewInit=function(){},t}();De.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <mat-dialog-content\n [style.height]="height"\n >\n\n <agm-map\n [zoom]="zoom"\n width="100%"\n [style.height]="height"\n [latitude]="lat"\n [longitude]="long"\n >\n <agm-marker\n *ngFor="let m of markers; let i = index"\n (markerClick)="clickedMarker(m.labelx, infoWindow, i)"\n [latitude]="m.lat"\n [longitude]="m.lng"\n [label]="m.label"\n >\n <agm-info-window #infoWindow>\n <strong>{{ m.labelx }}</strong\n ><br />\n <button\n *ngIf="m.url_scheda != null"\n (click)="apri_Scheda(m.url_scheda)"\n >\n APRI SCHEDA\n </button>\n </agm-info-window>\n </agm-marker>\n </agm-map>\n </mat-dialog-content>\n\n ',styles:["\n agm-map {\n\n width: 100%;\n }\n .mat-dialog-content { max-height: unset !important; }\n "]}]}],De.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:wt},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var Le=function(){function t(){this.text="",this.date_zz="",this.date_v="",this.label=""}return t.prototype.setDt=function(){this.date_zz=this.text},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){return t.appdt.nativeElement.focus()}))},t.prototype.agInit=function(t){return this.params=t,null==t.value||-1!=t.value.indexOf("--")?(this.text=null,void(this.date_zz=null)):(this.text=t.value,void(this.date_zz=t.value))},t.prototype.getValue=function(){return null==this.date_zz?null:this.date_zz},t.prototype.isPopup=function(){return!0},t.prototype.onKeyDown=function(t){var e=t.which||t.keyCode;37!=e&&13!=e&&39!=e||t.stopPropagation()},t}();Le.decorators=[{type:n.Component,args:[{selector:"editor-cell",template:'\n <div #container class="mood">\n <div fxLayout="row" (keydown)="onKeyDown($event)">\n <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n <textarea\n matInput\n style="min-height:180px;min-width:400px"\n [(ngModel)]="text"\n #appdt\n ></textarea>\n </mat-form-field>\n </div>\n\n <button\n mat-flat-button\n color="primary"\n (click)="this.setDt(); this.params.api.stopEditing()"\n >\n CONFERMA\n </button>\n \x3c!-- \n <button mat-flat-button (click)="this.params.api.stopEditing();">{{\'ANNULLA\' | translate}}</button>\n--\x3e</div>\n ',styles:["\n .mood {\n border-radius: 15px;\n border: 1px solid grey;\n background: #e6e6e6;\n padding: 15px;\n text-align: center;\n display: inline-block;\n outline: none;\n }\n\n .default {\n padding-left: 10px;\n padding-right: 10px;\n border: 1px solid transparent;\n padding: 4px;\n }\n\n .selected {\n padding-left: 10px;\n padding-right: 10px;\n border: 1px solid lightgreen;\n padding: 4px;\n }\n "]}]}],Le.propDecorators={container:[{type:n.ViewChild,args:["container",{read:n.ViewContainerRef}]}],appdt:[{type:n.ViewChild,args:["appdt"]}]};var Re=function(){function t(t){this._dataService=t,this.selval="",this.date_zz="",this.date_v="",this.sql="",this.label="",this.myData=new Array}return t.prototype.setDt=function(){this.date_zz=this.selval},t.prototype.agInit=function(t){var e=this;this.params=t;var i=new vt;i.sql=t.sql,i.types=t.types,i.values=t.values;this._dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(e.myData=t.result_data)}),(function(t){})),null!=t.value&&-1==t.value.indexOf("--")&&(this.selval=t.value,this.date_zz=t.value)},t.prototype.getValue=function(){return null==this.date_zz?null:this.date_zz},t.prototype.isPopup=function(){return!0},t.prototype.onKeyDown=function(t){t.which||t.keyCode},t}();Re.decorators=[{type:n.Component,args:[{selector:"editor-cell",template:'\n <div #container class="mood">\n <div style="min-width:350px;min-height:60px;text-align:center">\n <select [(ngModel)]="selval" #appdt style="min-height:40px;width:90%">\n <option\n value="{{ app.descrizione_valore }}"\n *ngFor="let app of myData"\n >{{ app.descrizione_valore }}</option\n >\n </select>\n </div>\n <br /><br /><br />\n <button\n mat-flat-button\n color="primary"\n (click)="this.setDt(); this.params.api.stopEditing()"\n >\n CONFERMA\n </button>\n \x3c!-- \n <button mat-flat-button (click)="this.params.api.stopEditing();">{{\'ANNULLA\' | translate}}</button>\n--\x3e</div>\n ',styles:["\n .mood {\n border-radius: 15px;\n border: 1px solid grey;\n background: #e6e6e6;\n padding: 15px;\n text-align: center;\n display: inline-block;\n outline: none;\n }\n\n .default {\n padding-left: 10px;\n padding-right: 10px;\n border: 1px solid transparent;\n padding: 4px;\n }\n\n .selected {\n padding-left: 10px;\n padding-right: 10px;\n border: 1px solid lightgreen;\n padding: 4px;\n }\n "]}]}],Re.ctorParameters=function(){return[{type:Dt}]},Re.propDecorators={container:[{type:n.ViewChild,args:["container",{read:n.ViewContainerRef}]}],appdt:[{type:n.ViewChild,args:["appdt"]}]};var Ne=function(){function t(t){this._dataService=t,this.init_fill=!0,this.sql="",this.types=[],this.values=[],this.label="",this.enabled=!0,this.single_sel=!1,this.separator=",",this.fillend=new n.EventEmitter,this.selchange=new n.EventEmitter,this.initend=new n.EventEmitter,this.myData=new Array,this.selval="-1",this.errorMsg="",this.valDef="-1"}return t.prototype.change_v=function(t,e){t.checked=!t.checked,this.upd_f(t,e)},t.prototype.upd_f=function(t,e){this.single_sel&&(t.checked=!0);var i=new Object;i.u=t,i.b=e,this.selchange.emit(i)},t.prototype.resetValue=function(){for(var t=0;t<this.myData.length;t++)this.myData[t].checked=!1},t.prototype.reset=function(){this.myData=new Array,this.resetValue()},t.prototype.fillCombo=function(){var t=this;if(this.init_fill){console.log("fillcombolist");var e=new vt;e.sql=this.sql,e.types=this.types,e.values=this.values,console.log("p ",e),this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.myData=e.result_data,t.resetValue(),t.setByValue(t.valDef),""==t.getValue()&&"-1"!=t.valDef&&t.setByDescri(t.valDef),t.fillend.emit())}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+t.sql+"]"}))}},t.prototype.setByDescri=function(t){if(console.log("setByDescri "+t),this.valDef=t,null!=t&&""!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){var e=t.split(this.separator);console.log("arr_val ",e);for(var i=0;i<this.myData.length;i++)for(var n=0;n<e.length;n++)console.log("v1 - v2",this.myData[i].descrizione_valore,e[n]),this.myData[i].descrizione_valore==e[n]&&(this.myData[i].checked=!0)}},t.prototype.setByIndex=function(t){this.valDef="",this.selval="-1",null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]&&this.myData.length>t&&this.setByDescri(this.myData[t].descrizione_valore)},t.prototype.setByValue=function(t){if(this.valDef=t,null!=t&&""+t!=""&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0])for(var e=t.split(this.separator),i=0;i<this.myData.length;i++)for(var n=0;n<e.length;n++)this.myData[i].valore==e[n]&&(this.myData[i].checked=!0)},t.prototype.getDescri=function(){for(var t="",e=0;e<this.myData.length;e++)this.myData[e].checked&&(""!=t&&(t+=this.separator),t+=this.myData[e].descrizione_valore);return t},t.prototype.getObjects=function(){for(var t=new Array,e=0;e<this.myData.length;e++)this.myData[e].checked&&t.push(this.myData[e]);return t},t.prototype.getValue=function(){for(var t="",e=0;e<this.myData.length;e++)this.myData[e].checked&&(""!=t&&(t+=this.separator),t+=this.myData[e].valore);return t},t.prototype.getData=function(t){for(var e in this.myData)if(this.myData[e].valore==this.selval)return this.myData[e][t]},t.prototype.add_option=function(t){t.valore=t.valore.toString(),this.myData.push(t)},t.prototype.set_options=function(t){this.myData=new Array;for(var e=t.split("$"),i=0;i<e.length;i++){var n=new Object,o=e[i].split("|");n.valore=o[1],n.descrizione_valore=o[0],n.checked=!1,this.myData.push(n)}this.setByValue(this.valDef),"-1"==this.getValue()&&this.setByDescri(this.valDef)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(1==t.init_fill){if(""==t.sql)return;t.fillCombo()}else t.errorMsg="";t.initend.emit()}))},t.prototype.sc=function(){this.selchange.emit()},t}();Ne.decorators=[{type:n.Component,args:[{selector:"FHList",template:'\n <table class="fh_table" style="width:100%;">\n <thead>\n <tr>\n <th *ngIf="!single_sel"></th>\n <th>\n {{ label }}\n </th>\n <th *ngIf="single_sel"></th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="let u of myData; let odd = odd; let even = even"\n [ngClass]="{ odd: odd, even: even }"\n >\n <td style="width:20px;" valign="middle" *ngIf="!single_sel">\n <mat-slide-toggle\n (change)="upd_f(u, $event)"\n [disabled]="!enabled"\n [(ngModel)]="u.checked"\n ></mat-slide-toggle>\n </td>\n <td (click)="change_v(u, $event)" valign="middle">\n {{ u.descrizione_valore }}\n </td>\n <td\n valign="middle"\n style="width:20px;text-align: center"\n *ngIf="single_sel"\n >\n <button\n mat-flat-button\n color="primary"\n (click)="upd_f(u, $event)"\n [disabled]="!enabled"\n >\n <mat-icon>send</mat-icon></button\n > \n </td>\n </tr>\n </tbody>\n </table>\n ',styles:[""]}]}],Ne.ctorParameters=function(){return[{type:Dt}]},Ne.propDecorators={init_fill:[{type:n.Input}],sql:[{type:n.Input}],types:[{type:n.Input}],values:[{type:n.Input}],label:[{type:n.Input}],enabled:[{type:n.Input}],single_sel:[{type:n.Input}],separator:[{type:n.Input}],smtr:[{type:n.ViewChild,args:["cmb"]}],fillend:[{type:n.Output}],selchange:[{type:n.Output}],initend:[{type:n.Output}]};var Fe=function(){function t(t,e,i){if(this.dialogRef=t,this.toastr=e,this.data=i,this.label="",this.width="100%",this.nota=!1,this.nota_val="",null!=i&&null!=i){var n="",o=[],s=!1;null!=i.label&&(n=i.label),null!=i.arr_option&&(o=i.arr_option),null!=i.nota&&(s=i.nota),this.set_selection(n,o,s)}}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.set_selection=function(t,e,i){var n=this;if(void 0===i&&(i=!1),null!=this.cmb_sel){this.nota=i,this.label=t;for(var o=0;o<e.length;o++)this.cmb_sel.add_option(e[o])}else setTimeout((function(){n.set_selection(t,e,i)}),500)},t.prototype.ok=function(){"-1"!=this.cmb_sel.getValue()?(this.cmb_sel.getObj().nota=this.nota_val,this.dialogRef.close(this.cmb_sel.getObj())):this.toastr.error("Selezionare un valore")},t.prototype.ngAfterViewInit=function(){},t}();Fe.decorators=[{type:n.Component,args:[{selector:"fh_win_auto_complete",template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <div fxLayout="column">\n <mat-dialog-content style="font-size: 15px;">\n <div fxLayout="column">\n <h3>\n {{ label | uppercase }}\n </h3>\n <FHAutoComplete #cmb_sel [init_fill]="false" [only_from_list]="true"></FHAutoComplete>\n <mat-form-field *ngIf="nota" appearance="outline" floatLabel="always"\n ><mat-label>Nota</mat-label>\n <textarea matInput [(ngModel)]="nota_val" rows="12"></textarea>\n </mat-form-field>\n </div>\n </mat-dialog-content>\n\n <mat-dialog-actions\n fxFlex="100"\n fxLayout="row"\n fxLayoutAlign="center center"\n >\n <button mat-flat-button color="primary" (click)="ok()">OK</button\n > \n <button mat-flat-button color="warn" (click)="close()">{{\'ANNULLA\' | translate}}</button>\n </mat-dialog-actions>\n </div>\n '}]}],Fe.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Fe.propDecorators={cmb_sel:[{type:n.ViewChild,args:["cmb_sel"]}]};var Me=function(){function t(){}return t.prototype.transform=function(t){return""+t.replace(/\n/g,"<br/>")},t}();Me.decorators=[{type:n.Pipe,args:[{name:"replaceLineBreaks"}]}];var Pe=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.data=i,this.title="",this.label="",this.valore=0,this.valore_min=0,this.valore_max=1e6,this.decimal_n=0,null!=i.title&&(this.title=i.title),null!=i.label&&(this.label=i.label),null!=i.valore&&(this.valore=i.valore),null!=i.valore_min&&(this.valore_min=i.valore_min),null!=i.valore_max&&(this.valore_max=i.valore_max),null!=i.decimal&&(this.decimal_n=i.decimal)}return t.prototype.ngAfterViewInit=function(){},t.prototype.show=function(){},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.do_check=function(){Number(this.valore)<this.valore_min||Number(this.valore)>this.valore_max?this.toastr.error("Il valore deve avere essere compreso tra "+this.valore_min+" - "+this.valore_max):this.dialogRef.close(this.valore)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t}();Pe.decorators=[{type:n.Component,args:[{selector:"app-win_ask_text",template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{ title }}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <mat-dialog-content>\n <FHNumericField [label]="label" [required]="valore>0" [(ngModel)]="valore" [decimal]="decimal_n"></FHNumericField>\n\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-flat-button color="primary" (click)="do_check()">OK</button\n > <button\n mat-flat-button\n color="warn"\n (click)="chiudi()"\n >\n ANNULLA\n </button>\n </mat-dialog-actions>\n</div>\n '}]}],Pe.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var ze=function(){function t(t){this.platformId=t}return t.prototype.highlightAll=function(){b.isPlatformBrowser(this.platformId)&&Prism.highlightAll()},t}();ze.decorators=[{type:n.Injectable}],ze.ctorParameters=function(){return[{type:Object,decorators:[{type:n.Inject,args:[n.PLATFORM_ID]}]}]};var je=function(){function t(t){this.highlightService=t,this.highlighted=!1,this.path_md=""}return t.prototype.ngAfterViewChecked=function(){this.highlighted||null!=!this.path_md||(this.highlightService.highlightAll(),this.highlighted=!0)},t.prototype.ngAfterViewInit=function(){},t}();je.decorators=[{type:n.Component,args:[{selector:"FHMdReader",template:' <markdown [src]="path_md"> </markdown> ',styles:[""]}]}],je.ctorParameters=function(){return[{type:ze}]},je.propDecorators={path_md:[{type:n.Input}]};var Ue=function(){function t(t){var e=this;this.uti=t,this.g_height="300px",this.columnDefs=[{headerName:"Utente",field:"utente",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Descrizione",field:"descrizione",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Tipo",field:"tipo",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Data",field:"data",filter:"agDateColumnFilter",filterParams:{newRowsAction:"keep"},cellRenderer:function(t){if(null==t.value)return" ------ ";var i=new Date(t.value);return 1900==i.getFullYear()?" ------ ":e.uti.datetime2String(i)},cellStyle:function(t){return{"text-align":"center"}}}],this.m_app="",this.m_k=""}return t.prototype.init=function(t,e){var i=this;this.m_app=t,this.m_k=e,setTimeout((function(){i.reload()}),500)},t.prototype.reload=function(){this.datagrid.doFill("[applicativo]='"+this.m_app+"' and [iddocumento]='"+this.m_k+"'")},t.prototype.ngAfterViewInit=function(){},t}();Ue.decorators=[{type:n.Component,args:[{selector:"FHLogPanel",template:'\n <div style="width:100%;">\n <section class="bs">\n <div style="width:100%;height:450px">\n <div style="width:100%;height:100%">\n <FHGrid\n [init_fill]="false"\n #dtm\n [show_buttons]="false"\n [columnDefs]="columnDefs"\n tbl_name="logs"\n grid_key="logs"\n sort_field="data desc"\n ></FHGrid>\n </div>\n </div>\n </section>\n </div>\n ',styles:[""]}]}],Ue.ctorParameters=function(){return[{type:Ct}]},Ue.propDecorators={g_height:[{type:n.Input}],datagrid:[{type:n.ViewChild,args:["dtm"]}]};var Ve={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return qe})),multi:!0},qe=function(){function t(){this.config={modules:{toolbar:[["bold","italic","underline","strike","image","link"],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["code-block","blockquote",{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"}]],keyboard:{bindings:{list:{key:"backspace",context:{format:["list"]},handler:function(t,e){0!==t.index&&(0===t.length?this.quill.deleteText(t.index-1,1,1):this.quill.deleteText(t,1))}}}}}},this.html_edit=!1,this.enabled=!0,this.value="",this.label="",this.height="360",this.change=new n.EventEmitter,this.focus=new n.EventEmitter,this.blur=new n.EventEmitter,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.modelch=function(){var t=this;console.log("modelch ",this.value),setTimeout((function(){t.onChange(t.value),t.change.emit(t.value)}))},t.prototype.onFocus=function(t){this.focus.emit(t)},t.prototype.onBlur=function(t){this.blur.emit(t)},t.prototype.ngAfterViewInit=function(){},t.prototype.writeValue=function(t){this.value=t},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}();qe.decorators=[{type:n.Component,args:[{selector:"FHRichText",providers:[Ve],template:'\n <b *ngIf="label != \'\'">{{ label }}</b>\n <quill-editor\n [hidden]="!enabled"\n (focus)="onFocus($event)"\n (ngModelChange)="modelch()"\n (onContentChanged)="modelch()"\n (onBlur)="modelch()"\n (blur)="onBlur($event)"\n theme="snow"\n format="html" [class.fh_field]="enabled" [class.fh_field_dis]="!enabled"\n [(ngModel)]="value"\n ></quill-editor>\n <quill-view\n [content]="value"\n [hidden]="enabled"\n format="html"\n theme="snow"\n ></quill-view>\n <textarea [hidden]="!html_edit" style="width:100%" rows="10" [(ngModel)]="value"></textarea>\n ',styles:[""]}]}],qe.ctorParameters=function(){return[]},qe.propDecorators={html_edit:[{type:n.Input}],enabled:[{type:n.Input}],value:[{type:n.Input}],label:[{type:n.Input}],height:[{type:n.Input}],change:[{type:n.Output}],focus:[{type:n.Output}],blur:[{type:n.Output}]};var Ge=function(){function t(t,e){this.dialogRef=t,this.data=e,this.title="",this.label="",this.valore="",null!=e&&(null!=e.title&&(this.title=e.title),null!=e.label&&(this.label=e.label),null!=e.valore&&(this.valore=e.valore))}return t.prototype.ngAfterViewInit=function(){},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.show=function(){},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t}();Ge.decorators=[{type:n.Component,args:[{selector:"app-win_output",template:'\n\n<div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{ title }}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n\n <mat-dialog-content style="min-width:500px;font-size: 15px;">\n <div [innerHTML]="valore" style="width:100%"></div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <div fxFlex="100" fxLayout="row" fxLayoutAlign="end center">\n <button mat-flat-button color="warn" (click)="chiudi()">{{\'CHIUDI\' | translate}}</button>\n</div>\n </mat-dialog-actions>\n '}]}],Ge.ctorParameters=function(){return[{type:e.MatDialogRef},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Ge.propDecorators={title:[{type:n.Input}],label:[{type:n.Input}],valore:[{type:n.Input}]};var Ke={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Be})),multi:!0},Be=function(){function t(t){this.uti_s=t,this.decimal=0,this.label="",this.hint="",this.text_align="right",this.th_character=".",this.required=!1,this.enabled=!0,this.hidden=!1,this.color="",this.error=null,this.m_bkcolor="",this.pattern="[-+]?[0-9]*[.,]?[0-9]+",this.change=new n.EventEmitter,this.focus_out=new n.EventEmitter,this.enter_key_pressed=new n.EventEmitter,this.innerValue=0,this.chgf=!1,this.onChange=function(t){},this.onTouched=function(){},this.formattedAmount="0,00",this.value=0,this.b_already_f=!1}return t.prototype.keyDownFunctioncl=function(t){13==t.keyCode&&(this.chg(),this.enter_key_pressed.emit())},t.prototype.modelch=function(){var t=this;setTimeout((function(){t.onChange(t.formattedAmount),t.change.emit(t.formattedAmount)}))},t.prototype.getStyle_Color=function(){return this.color},t.prototype.getStyle_BkColor=function(){return this.m_bkcolor},t.prototype.set_backcolor=function(t){this.m_bkcolor=t},t.prototype.set_color=function(t){this.color=t},t.prototype.chg=function(){""!=this.formattedAmount?(this.value=this.uti_s.round(parseFloat(this.formattedAmount.split(".").join("").split(",").join(".")),this.decimal),this.formattedAmount=this.transform(this.value,this.decimal)):(this.value=this.uti_s.round(0,this.decimal),this.formattedAmount=this.transform(this.value,this.decimal)),this.chgf=!0,this.onChange(this.value)},t.prototype.writeValue=function(t){null==t&&(t=0),this.innerValue=t,this.value=t,this.formattedAmount=this.transform(this.value,this.decimal)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.transform=function(t,e){void 0===e&&(e=0);var i=Ot((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=e>0?","+(s+"000000").substring(0,e):"",""!=this.th_character&&(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,this.th_character)),""==n&&(n="0"),0==this.decimal?n:n+s},t.prototype.removeCurrencyPipeFormat=function(t){try{this.formattedAmount=this.transform(this.value,this.decimal)}catch(t){console.log(t)}},t.prototype.click_select_allf=function(t){this.select_allf(t)},t.prototype.select_allf=function(t){var e=this;console.log("this.b_already_f ",this.b_already_f),this.b_already_f?console.log("SALTO FOCUS ALL"):this.el.nativeElement.select(),this.b_already_f=!0,setTimeout((function(){e.b_already_f=!1}),1e3)},t.prototype.setFocus=function(){this.el.nativeElement.focus()},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.required&&(t.el.nativeElement.required=t.required),t.el.nativeElement.disabled=!t.enabled,null==t.value&&(t.value=0),t.formattedAmount=t.transform(t.value,t.decimal)}))},t}();Be.decorators=[{type:n.Component,args:[{selector:"FHNumericField",providers:[Ke],template:'\n <mat-form-field [hidden]="hidden" appearance="outline" floatLabel="always" [class.fh_field]="enabled" [class.fh_field_dis]="!enabled"\n ><mat-label>{{ label }}</mat-label>\n <input\n type="text"\n [style.text-align]="text_align"\n [style.background-color]="getStyle_BkColor()"\n [style.color]="getStyle_Color()"\n #el\n matInput\n [required]="required"\n [disabled]="!enabled"\n [(ngModel)]="formattedAmount"\n (ngModelChange)="modelch()"\n formnovalidate\n (blur)="chg();focus_out.emit(value)"\n (click)="click_select_allf($event)"\n (focus)="removeCurrencyPipeFormat($event); select_allf($event)"\n (keydown)="keyDownFunctioncl($event)"\n />\n <mat-hint [hidden]="hint==\'\'">{{hint}}</mat-hint>\n <mat-error *ngIf="error==null">{{ error }}</mat-error>\n </mat-form-field>\n ',styles:["\n\n "]}]}],Be.ctorParameters=function(){return[{type:Ct}]},Be.propDecorators={el:[{type:n.ViewChild,args:["el"]}],decimal:[{type:n.Input}],label:[{type:n.Input}],hint:[{type:n.Input}],text_align:[{type:n.Input}],th_character:[{type:n.Input}],required:[{type:n.Input}],enabled:[{type:n.Input}],hidden:[{type:n.Input}],color:[{type:n.Input}],error:[{type:n.Input}],change:[{type:n.Output}],focus_out:[{type:n.Output}],enter_key_pressed:[{type:n.Output}],value:[{type:n.Input}]};var He=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.data=i,this.label="",this.separator=",",this.title="",this.sql="",this.types=[],this.values=[],this.single_sel=!1,this.sel_values="",this.required=!0,this.options=null,null!=i&&(null!=i.sql&&(this.sql=i.sql),null!=i.types&&(this.types=i.types),null!=i.values&&(this.values=i.values),null!=i.single_sel&&(this.single_sel=i.single_sel),null!=i.sel_values&&(this.sel_values=i.sel_values),null!=i.title&&(this.title=i.title),null!=i.separator&&(this.separator=i.separator),null!=i.label&&(this.label=i.label),null!=i.required&&(this.required=i.required),null!=i.sql&&this.doFill(),null!=i.options&&(this.options=i.options))}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.doFill=function(){var t=this;null!=this.cmb_sel?(this.single_sel||this.cmb_sel.setByDescri(this.sel_values),this.cmb_sel.sql=this.sql,this.cmb_sel.types=this.types,this.cmb_sel.values=this.values,this.cmb_sel.fillCombo()):setTimeout((function(){t.doFill()}),500)},t.prototype.ok=function(){this.required&&""==this.cmb_sel.getValue()?this.toastr.error("Selezionare un valore"):this.dialogRef.close(this.cmb_sel.getObjects())},t.prototype.ok_single=function(){this.single_sel&&this.dialogRef.close(this.cmb_sel.getObjects())},t.prototype.ngAfterViewInit=function(){null!=this.options&&(this.cmb_sel.myData=JSON.parse(JSON.stringify(this.options))),this.single_sel||this.cmb_sel.setByDescri(this.sel_values)},t}();He.decorators=[{type:n.Component,args:[{selector:"fh_win_list",template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{ title }}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <mat-dialog-content style="min-width:700px;min-height:500px">\n <FHList\n #cmb_sel\n [label]="label"\n [single_sel]="single_sel"\n [separator]="separator"\n style="width:100%;height:100%"\n init_fill="false"\n (selchange)="ok_single()"\n ></FHList>\n </mat-dialog-content>\n\n <mat-dialog-actions>\n <div fxLayout="row" fxLayoutAlign="center center" style="width: 100%">\n <button\n mat-flat-button\n color="primary"\n *ngIf="!single_sel"\n (click)="ok()"\n >\n OK</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="dialogRef.close(\'\')"\n >\n ANNULLA\n </button>\n </div>\n </mat-dialog-actions>\n</div>\n '}]}],He.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},He.propDecorators={cmb_sel:[{type:n.ViewChild,args:["cmb_sel"]}]};var Ye={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Qe})),multi:!0},Qe=function(){function t(t,e){this.dataservice=t,this.dialog=e,this.label="",this.required=!1,this.enabled=!0,this.hidden=!1,this.multi=!1,this.change=new n.EventEmitter,this.select=new n.EventEmitter,this.userName="",this.selectedUser=[],this.all_user=null,this.opened=!1,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.required&&(t.label=t.label+" *")}))},t.prototype.getUsersNc=function(){for(var t="",e=0;e<this.selectedUser.length;e++)""!=t&&(t+=","),t=t+(this.selectedUser[e].cognome+" ")+this.selectedUser[e].nome;return t},t.prototype.getUsersEmail=function(){for(var t="",e=0;e<this.selectedUser.length;e++)""!=t&&(t+=","),t=t+""+this.selectedUser[e].email;return t},t.prototype.getUsersUsername=function(){for(var t="",e=0;e<this.selectedUser.length;e++)""!=t&&(t+=","),t=t+""+this.selectedUser[e].username;return t},t.prototype.getUsers=function(){return this.selectedUser},t.prototype.writeValue=function(t){if(null!=t){if(""!=t)return"noop"==t?(this.userName=this.getUsersNc(),void this.onChange(this.getUsersUsername())):null==this.selectedUser?(this.setByUsername(t),void(this.userName=this.getUsersNc())):void(this.getUsersUsername()!=t&&(this.setByUsername(t),this.userName=this.getUsersNc()));this.clear()}else this.clear()},t.prototype.setByEmail=function(t){var e=this;if(null!=t&&""!=t){for(var i=t.split(","),n="",o=0;o<i.length;o++)""!=n&&(n+=","),n=n+"'"+i[o]+"'";if(""!=n){var s={sql:"SELECT_USERS_INFOS_BY_EMAIL_NOREP",types:["string"],values:[n],names:[]};this.dataservice.doQuery(s).subscribe((function(t){var i=t.result_data;null!=i?(e.selectedUser=i,e.writeValue("noop"),e.select.emit(e.selectedUser),e.userName=e.getUsersNc()):e.clear()}))}}},t.prototype.setByUsername=function(t){var e=this;if(t){for(var i=t.split(","),n="",o=0;o<i.length;o++)""!=n&&(n+=","),n=n+"'"+i[o]+"'";var s={sql:"SELECT_USERS_INFOS_BY_USERNAME_NOREP",types:["string"],values:[n],names:[]};this.dataservice.doQuery(s).subscribe((function(t){var i=t.result_data;null!=i?(e.selectedUser=i,e.writeValue("noop"),e.select.emit(e.selectedUser),console.log(e.selectedUser),e.userName=e.getUsersNc(),console.log(e.userName)):e.clear()}))}},t.prototype.load_all_users=function(){var t=this;this.dataservice.doQuery({sql:"SELECT_ALL_USERS",types:[],values:[],names:[]}).subscribe((function(e){t.all_user=e.result_data,null==t.all_user&&(t.all_user=[]),t.open_pick()}))},t.prototype.open_pick=function(){var t=this;if(!this.opened)if(null!=this.all_user){if(this.enabled){var e=this.dialog.open(xe,{disableClose:!0,width:"700px",height:"550px"});setTimeout((function(){e.componentInstance.user_sel=t.selectedUser,e.componentInstance.users_list=Object.assign([],t.all_user),e.componentInstance.single_sel=!t.multi,e.componentInstance.filtra()})),this.opened=!0,e.afterClosed().subscribe((function(e){t.opened=!1,null!=e&&(null!=e&&(t.selectedUser=e,t.writeValue("noop"),t.select.emit(t.selectedUser),t.userName=t.getUsersNc()),t.change.emit(t.selectedUser),t.select.emit(t.selectedUser))}))}}else this.load_all_users()},t.prototype.clear=function(){this.selectedUser=[],this.onChange([]),this.userName=""},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}();Qe.decorators=[{type:n.Component,args:[{selector:"FHUserField",providers:[Ye],template:'\n <div fxLayout="row" [hidden]="!enabled || hidden">\n <mat-form-field\n style="clickable-field" [class.fh_field]="enabled"\n (click)="open_pick()"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n\n <input\n matInput\n [hidden]="hidden"\n type="text"\n [ngModel]="userName"\n [disabled]="false"\n readonly\n />\n </mat-form-field>\n <button\n mat-icon-button\n matSuffix\n [hidden]="selectedUser.length == 0"\n (click)="clear()"\n >\n <mat-icon>clear</mat-icon>\n </button>\n </div>\n <mat-form-field\n [hidden]="enabled || hidden" [class.fh_field_dis]="!enabled"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n <input\n type="text"\n #el1\n matInput\n [disabled]="true"\n [(ngModel)]="userName"\n />\n </mat-form-field>\n ',styles:["\n .clickable-field {\n border: 1px solid #000000;\n color: #000000;\n }\n\n .clickable-field:focus {\n outline: none;\n }\n\n :host ::ng-deep .mat-input-element {\n cursor: pointer !important;\n }\n "]}]}],Qe.ctorParameters=function(){return[{type:Dt},{type:e.MatDialog}]},Qe.propDecorators={label:[{type:n.Input}],required:[{type:n.Input}],enabled:[{type:n.Input}],hidden:[{type:n.Input}],multi:[{type:n.Input}],change:[{type:n.Output}],select:[{type:n.Output}],userName:[{type:n.Input}]};var We=function(){function t(t,e,i){this.dialogRef=t,this.data=e,this.toast=i,this.salva_ed_esci="SALVA ED ESCI",this.esci_senza_salvataggi="ESCI SENZA SALVATAGGIO",this.commento="",this.b_commento=!1,this.commento_mgs="Commento",this.insert_comment_msg="Inserire un commento",null!=e&&(null!=e.mgs_salva_ed_esci&&(this.salva_ed_esci=e.mgs_salva_ed_esci),null!=e.msg_esci_senza_salvataggi&&(this.esci_senza_salvataggi=e.msg_esci_senza_salvataggi),null!=e.b_commento&&(this.b_commento=e.b_commento),null!=e.commento_mgs&&(this.commento_mgs=e.commento_mgs),null!=e.insert_comment_msg&&(this.insert_comment_msg=e.insert_comment_msg))}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.salva_esci=function(){this.b_commento&&""==this.commento?this.toast.error(this.insert_comment_msg):this.dialogRef.close("salva_esci")},t.prototype.esci_senza_salv=function(){this.dialogRef.close("esci_senza_salv")},t.prototype.ngAfterViewInit=function(){},t}();We.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <div mat-dialog-content>\n <div style="width:400px" [hidden]="!b_commento"><br /></div>\n <div style="width:400px" [hidden]="!b_commento">\n <FHTextArea\n label="{{ commento_mgs }}"\n required\n [(ngModel)]="commento"\n ></FHTextArea>\n </div>\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="salva_esci()">\n {{ salva_ed_esci }}</button\n > \n <button mat-flat-button color="warn" (click)="esci_senza_salv()">\n {{ esci_senza_salvataggi }}\n </button>\n </div>\n </div>\n '}]}],We.ctorParameters=function(){return[{type:e.MatDialogRef},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]},{type:i.ToastrService}]};var Je=function(){function t(t,e,i,n,o){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.data=o,this.lbl="",this.nota="",this.nota_commento="",this.title="ASSEGNA DOCUMENTO",this.comm_notrequired=0,this.comm_notrequired=this.m_appService.getState().wkf_doc_info.comm_notrequired,this.title=this.m_appService.getState().wkf_doc_info.title,this.lbl=this.m_appService.getState().wkf_doc_info.lbl,this.arrAutori=this.m_appService.getState().wkf_doc_info.arrAutori;for(var s=0;s<this.arrAutori.length;s++)null==this.arrAutori[s].username&&(this.arrAutori[s].username=this.arrAutori[s].idp);2==this.comm_notrequired&&(this.nota_commento=" (COMMENTO NON OBBLIGATORIO)"),null!=o&&(null!=o.commento_default&&(this.nota=o.commento_default),null!=o.comm_notrequired&&(this.comm_notrequired=o.comm_notrequired))}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(0!=this.comm_notrequired||""!=this.nota)if(0!=this.up.getSelArr().length){var t=new Object;t.nota=this.nota,t.arrsel=this.up.getSelArr(),this.dialogRef.close(t)}else this.toastr.error("ERRORE","SELEZIONARE ALMENO UN UTENTE",{timeOut:1e3,progressBar:!0});else this.toastr.error("ERRORE","INSERIRE IL COMMENTO",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();Je.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <div\n mat-dialog-content\n fxLayout="column"\n style="font-size: 15px;min-width: 750px"\n >\n <div style="width:100%;height:450px">\n <FHPickUsers\n #up\n [users_list]="arrAutori"\n [vis_buttons]="false"\n ></FHPickUsers>\n </div>\n <div *ngIf="comm_notrequired != 1">\n <br />\n\n <FHTextArea [label]="\'Commento\' | translate" [(ngModel)]="nota" rows="4"></FHTextArea>\n </div>\n </div>\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()">OK</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n ANNULLA\n </button>\n </div>\n</div>\n '}]}],Je.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:Dt},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Je.propDecorators={up:[{type:n.ViewChild,args:["up"]}]};var $e=function(){function t(t,e,i,n,o,s){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.data=o,this._tsr=s,this.utenti="",this.lbl="",this.nota="",this.nota_commento="",this.title="COMMENTI",this.comm_notrequired=0,this.mobile=!1,this.comm_notrequired=this.m_appService.getState().wkf_doc_info.comm_notrequired,this.title=this._tsr.instant(this.m_appService.getState().wkf_doc_info.title),this.lbl=this._tsr.instant(this.m_appService.getState().wkf_doc_info.lbl),this.utenti=this.m_appService.getState().wkf_doc_info.utenti,2==this.comm_notrequired&&(this.nota_commento=this._tsr.instant(" (COMMENTO NON OBBLIGATORIO)")),this.mobile=this.m_appService.getState().pageFullscreen,null!=o&&(null!=o.commento_default&&(this.nota=o.commento_default),null!=o.comm_notrequired&&(this.comm_notrequired=o.comm_notrequired))}return t.prototype.ok=function(){0!=this.comm_notrequired||""!=this.nota?this.dialogRef.close(this.nota):this.toastr.error("ERRORE",this._tsr.instant("INSERIRE IL COMMENTO"),{timeOut:1e3,progressBar:!0})},t.prototype.close=function(){this.dialogRef.close("abort")},t.prototype.ngAfterViewInit=function(){},t}();$e.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <mat-toolbar>\n <div style="font-size:10px" *ngIf="mobile">{{ lbl }}</div>\n <div *ngIf="!mobile">{{ lbl }}</div>\n </mat-toolbar>\n <br />\n <div mat-dialog-content style="min-width:800px;font-size: 15px;">\n <div\n *ngIf="mobile && utenti?.toLocaleLowerCase().indexOf(\'system\') == -1"\n style="font-size:10px"\n >\n {{\'Assegnata a\' | translate}}: {{ utenti }}\n </div>\n <h3\n *ngIf="!mobile && utenti?.toLocaleLowerCase().indexOf(\'system\') == -1"\n >\n {{\'Assegnata a\' | translate}}: {{ utenti }}\n </h3>\n <br />\n <mat-form-field\n [hidden]="comm_notrequired == 1"\n appearance="outline"\n floatLabel="always"\n ><mat-label> {{\'Commento\'}} {{ nota_commento }}</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="6"></textarea>\n </mat-form-field>\n </div>\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()">OK</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n {{\'ANNULLA\' | translate}}\n </button>\n </div>\n '}]}],$e.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:Dt},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]},{type:p.TranslateService}]};var Xe=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i,this.selval="-1",this.errorMsg="",this.title="SELEZIONA AMBITO",this.myData=this.m_appService.getState().wkf_doc_info.canali_arr,this.selval="-1"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){"-1"!=this.selval?this.dialogRef.close(this.selval):this.toastr.error("ERRORE","SELEZIONARE AMBITO",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();Xe.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n\n <div mat-dialog-content style="font-size: 15px;">\n\n <div mat-dialog-content>\n <br /><br />\n <mat-form-field\n style="width:100%"\n appearance="outline"\n floatLabel="always"\n ><mat-label>Seleziona Ambito:</mat-label>\n <mat-select #cmb [(ngModel)]="selval">\n <mat-option value="-1">Seleziona</mat-option>\n <mat-option value="{{ app }}" *ngFor="let app of myData">{{\n app\n }}</mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()">OK</button>\n </div>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">\n {{ errorMsg }}\n </p>\n </div>\n </div>\n '}]}],Xe.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService}]},Xe.propDecorators={smtr:[{type:n.ViewChild,args:["cmb"]}]};var Ze=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this.tsr=n,this.selval="-1",this.errorMsg="",this.OK_BUTTON="OK",this.title="",this.setStepCombo(this.m_appService.getState().wkf_doc_info.livs,this.m_appService.getState().wkf_doc_info.st,this.m_appService.getState().wkf_doc_info.cl),this.title=this.tsr.instant("Seleziona Prossimo Step")}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.sc=function(){if(this.OK_BUTTON="OK","-1"!=this.selval)for(var t=0;t<this.myData.length;t++){if(Number(this.selval).valueOf()+0==this.myData[t].livello+0){this.OK_BUTTON="OK ("+this.myData[t].descri_livello+")";break}}},t.prototype.setStepCombo=function(t,e,i){for(var n=e.split("|"),o=new Array,s=0;s<n.length;s++)for(var a=0;a<t.length;a++){if("*N"==n[s].toString().toUpperCase()){(r={descri_livello:"Prosegui a step successivo"}).g=0==s?1:0,r.livello="*N",o.push(r);break}if("*C"==n[s].toString().toUpperCase()){var r;(r={descri_livello:"Prosegui a chiusura"}).g=0==s?1:0,r.livello="*C",o.push(r);break}if(n[s]==t[a].livello&&n[s]!=i.livello){t[a].g=0==s?1:0,o.push(t[a]);break}}1==o.length&&this.dialogRef.close(o[0].livello),this.myData=o},t.prototype.ok=function(){null!=this.selval&&"-1"!=this.selval?this.dialogRef.close(this.selval):this.toastr.error("ERRORE","SELEZIONARE LO STEP SUCCESSIVO",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();Ze.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:80%">{{title | translate}}</div>\n <div style="width:20%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n\n <div mat-dialog-content style="font-size: 15px;">\n\n <mat-dialog-content style="max-width:500px;font-size:12px"\n ><br /><br />\n <mat-form-field\n appearance="outline"\n floatLabel="always"\n style="width:100%"\n ><mat-label>{{\'Seleziona Prossimo Step\' | translate}}:</mat-label>\n <mat-select #cmb [(ngModel)]="selval" (change)="sc()">\n <mat-option value="-1">{{\'Seleziona\' | translate}}</mat-option>\n <mat-option value="{{ app.livello }}" *ngFor="let app of myData">{{\n app.descri_livello | translate\n }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <br /><br /><br /><br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()">\n {{ OK_BUTTON }}</button\n > \n <button mat-flat-button color="warn" (click)="close()">\n {{\'ANNULLA\' | translate}}\n </button>\n </div>\n <br /><br />\n </mat-dialog-content>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">\n {{ errorMsg }}\n </p>\n </div>\n </div>\n '}]}],Ze.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:p.TranslateService}]},Ze.propDecorators={smtr:[{type:n.ViewChild,args:["cmb"]}]};var ti=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.title="SELEZIONA CHI NOTIFICARE"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.init_arr=function(t){this.up.user_sel=new Array,this.up.users_list_sel=new Array,this.up.users_list=new Array;for(var e=0;e<t.length;e++)null==t[e].username&&(t[e].username=t[e].idp),this.up.users_list_sel.push(t[e]),this.up.users_list.push(t[e]);this.up.filtra()},t.prototype.ok=function(){if(0!=this.up.getSelArr().length){var t=new Object;t.arrsel=this.up.getSelArr(),this.dialogRef.close(t)}else this.toastr.error("ERRORE","SELEZIONARE ALMENO UN UTENTE",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();ti.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <div mat-dialog-content style="min-width:700px;font-size: 15px;">\n <div style="height:370px;">\n <FHPickUsers #up [vis_buttons]="false"></FHPickUsers>\n </div>\n <br />\n </div>\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()">OK</button\n > \n <button mat-flat-button color="warn" (click)="close()">{{\'ANNULLA\' | translate}}</button>\n </div>\n</div>\n '}]}],ti.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:Dt}]},ti.propDecorators={up:[{type:n.ViewChild,args:["up"]}]};var ei=function(){function t(t,e,i){this.http=t,this.app_s=e,this.toastr=i,this.url=this.app_s.API_ENDPOINT+this.app_s.WKF_ENDPOINT}return t.prototype.doQuery=function(t,e){var i=this;void 0===e&&(e=!0);var n=!1;if(null==this.app_s.user_isadmin||"1"!=this.app_s.user_isadmin?this.app_s.dev_mode=null:null!=this.app_s.dev_mode&&"1"==this.app_s.dev_mode&&(n=!0),n){var o=this.app_s.user;"send_wkf_mail"==t.sql&&(null==t.values[9]&&(t.values[9]=""),this.toastr.info("DEBUG - MESSAGGIO NON INVIATO DESTINARI ORIGINALI: "+t.values[1]),t.values[3]=t.values[3]+"\n\n DEST. ORIGINALI:"+t.values[1],t.values[1]=o),"send_mail"==t.sql&&(this.toastr.info("DEBUG - MESSAGGIO NON INVIATO DESTINARI ORIGINALI: "+t.values[3]),t.values[2]=t.values[2]+"\n\n DEST. ORIGINALI:"+t.values[0],t.values[1]=o)}this.headers=new r.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=this.app_s.API_ENDPOINT+this.app_s.WKF_ENDPOINT;var s=JSON.stringify(t);return this.http.post(this.url,s,{headers:this.headers}).pipe(l.map((function(t){var n;if(t?"KO"===t.result_msg&&(n=new Error(t.msg)):n=new Error("Empty server response"),n)throw console.error(n),e&&i.toastr.error(n.message),new Error(n);return t||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t}();ei.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new ei(n.ɵɵinject(r.HttpClient),n.ɵɵinject(wt),n.ɵɵinject(i.ToastrService))},token:ei,providedIn:"root"}),ei.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],ei.ctorParameters=function(){return[{type:r.HttpClient},{type:wt},{type:i.ToastrService}]};var ii=function(){function t(t,e,i,n,o,s,a,r){this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.toastr=n,this._dataService=o,this.m_wkf=s,this.m_file=a,this.tsr=r,this.notifica_commenti=1,this.notifica_commenti_obbl=0,this.not_comm=!1,this.not_comm_disabled=!1,this.nota="",this.title="COMMENTI",this.b_edit=!1,this.b_ins=!1,this.edit_id=0,this.lettori="",this.subject="",this.link="",this.codice_doc="",this.refresh_list()}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.init_v=function(){this.notifica_commenti>0&&1==this.notifica_commenti_obbl&&(this.not_comm=!0,this.not_comm_disabled=!0)},t.prototype.edit_comm=function(t){this.b_edit=!0,this.b_ins=!1,this.nota=t.commento,this.edit_id=t.id_comment,this.title=this.tsr.instant("MODIFICA COMMENTO")},t.prototype.refresh_list=function(){var t=this,e=new vt;e.sql="SELECT_COMMENTI_DOCUMENTO",e.types=["string","string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.commenti_list=e.result_data;for(var i=0;i<t.commenti_list.length;i++)t.commenti_list[i].v_commento="<b>"+t.commenti_list[i].commento.replace(/\n/g,"<br/>")+"</b>";t.title=t.tsr.instant("COMMENTI")}}),(function(t){}))},t.prototype.ok=function(){if(this.not_comm){if(""==this.nota)return void this.toastr.error(this.tsr.instant("INSERIRE UN COMMENTO"));2!=this.notifica_commenti?this.select_destinatari():this.select_destinatari_grp()}else this.ok_op()},t.prototype.select_destinatari_grp=function(){var t=this,e=this.m_dialogRef.open(He,{disableClose:!0});setTimeout((function(){e.componentInstance.title=t.tsr.instant("Selezione almeno un gruppo da notificare"),e.componentInstance.types=["string"],e.componentInstance.values=[t.m_appService.getState().wkf_doc_info.uiid_app],e.componentInstance.sql="SELECT_GRP_APP_USERS",e.componentInstance.doFill()})),e.afterClosed().subscribe((function(e){if(null!=e){if(""==e)return;for(var i="",n=0;n<e.length;n++)""!=i&&(i+=","),i=i+""+e[n].valore;var o=new vt;o.sql="SELECT_USERS_BY_IDROLES_NOREP",o.types=["string"],o.values=[i],t._dataService.doQuery(o).subscribe((function(e){i="";for(var n=0;n<e.result_data.length;n++)""!=i&&(i+=","),i=i+""+e.result_data[n].username;t.ok_op(i)}))}}))},t.prototype.select_destinatari=function(){var t=this,e=new vt;e.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",e.types=["string"],e.values=["'"+this.lettori.split(",").join("','")+"'"];this._dataService.doQuery(e).subscribe((function(e){var i=t.m_dialogRef.open(ti,{disableClose:!0});setTimeout((function(){i.componentInstance.init_arr(e.result_data)})),i.afterClosed().subscribe((function(e){if(null!=e){for(var i="",n=0;n<e.arrsel.length;n++)""!=i&&(i+=","),i+=e.arrsel[n].username;t.ok_op(i)}}))}),(function(t){}))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,a,r,l,p,u){if(void 0===p&&(p=!0),void 0===u&&(u=""),null!=e&&""!=e){var c=new vt;c.sql="send_wkf_mail",c.values=[t,e,i,n.split("\n").join("<br>"),o,s,a,r,l,u],this.m_wkf.doQuery(c).subscribe((function(t){}))}},t.prototype.ok_op=function(t){var e=this;if(void 0===t&&(t=""),this.b_ins){(i=new vt).sql="INSERT_WKF_COMMENTO",i.types=["string","string","string","string","string"],i.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc,this.nota,this.m_appService.getState().wkf_doc_info.curr_user,t];this._dataService.doQuery(i).subscribe((function(i){var n=!1;if(null!=i&&"OK"==i.result_msg){e.toastr.info("INFO",e.tsr.instant("COMMENTO INSERITO"),{timeOut:1e3,progressBar:!0});var o=new gt;o.command="exec_app",o.p1="insert_update_comment",o.p2=e.m_appService.getState().wkf_doc_info.uiid_app+"|"+e.m_appService.getState().wkf_doc_info.uiid_doc,e.m_file.doQuery(o,!1).subscribe(),n=!0,e.b_edit=!1,""!=t&&e.sendEMail_ex(e.m_appService.getState().wkf_doc_info.curr_user,t,e.subject.split("<OP>").join("E' stato inserito un commento"),"<br><br>Commento inserito: <br>"+e.nota.split("\n").join("<br>"),e.m_appService.getState().wkf_doc_info.uiid_app,e.m_appService.getState().wkf_doc_info.uiid_doc,e.link,e.codice_doc,""),e.refresh_list()}n||e.toastr.error("ERRORE",i.msg)}))}else{var i;(i=new vt).sql="UPDATE_WKF_COMMENTO",i.types=["string","string","string"],i.values=[this.nota,this.edit_id,t];this._dataService.doQuery(i).subscribe((function(i){var n=!1;if(null!=i&&"OK"==i.result_msg){e.toastr.info("INFO",e.tsr.instant("COMMENTO AGGIORNATO"),{timeOut:1e3,progressBar:!0});var o=new gt;o.command="exec_app",o.p1="insert_update_comment",o.p2=e.m_appService.getState().wkf_doc_info.uiid_app+"|"+e.m_appService.getState().wkf_doc_info.uiid_doc+"|"+e.edit_id,e.m_file.doQuery(o,!1).subscribe(),n=!0,e.b_edit=!1,""!=t&&e.sendEMail_ex(e.m_appService.getState().wkf_doc_info.curr_user,t,e.subject.split("<OP>").join("E' stato modificato un commento"),"<br><br>Commento modificato: <br>"+e.nota.split("\n").join("<br>"),e.m_appService.getState().wkf_doc_info.uiid_app,e.m_appService.getState().wkf_doc_info.uiid_doc,e.link,e.codice_doc,""),e.refresh_list()}n||e.toastr.error("ERRORE",i.msg)}),(function(t){}))}},t.prototype.annulla=function(){var t=this;localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog",this.tsr.instant("Conferma Operazione")),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog",this.tsr.instant("Confermi di voler annullare l'inserimento del commento?")),this.m_dialogRef.open(It).afterClosed().subscribe((function(e){e&&(t.nota="",t.b_edit=!1,t.title=t.tsr.instant("COMMENTI"))}))},t.prototype.ngAfterViewInit=function(){},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title=this.tsr.instant("INSERISCI COMMENTO")},t}();ii.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n\n <mat-toolbar color="primary">\n\n <span class="fill-remaining-space"></span>\n <div>\n <button mat-flat-button color="accent" (click)="ins()" *ngIf="!b_edit">\n <mat-icon>note_add</mat-icon>\n {{\'INSERISCI\' | translate}}\n </button>\n </div>\n </mat-toolbar>\n <br />\n <div mat-dialog-content style="min-width:800px;font-size: 15px;">\n\n <FHTextArea [label]="\'Commento\' | translate" [(ngModel)]="nota" rows="12"></FHTextArea>\n <div *ngIf="b_edit" fxLayoutAlign="center center" fxLayout="row">\n <button mat-flat-button color="primary" (click)="ok()">{{\'OK\' | translate}}</button\n > \n <button mat-flat-button color="warn" (click)="annulla()">{{\'ANNULLA\' | translate}}</button\n > \n <mat-checkbox\n [disabled]="not_comm_disabled"\n [(ngModel)]="not_comm"\n [hidden]="\n notifica_commenti == 0 || (notifica_commenti == 1 && lettori == \'\')\n "\n >\n {{\'Notifica Interessati\' | translate}}\n </mat-checkbox>\n </div>\n <section class="bs" *ngIf="!b_edit">\n <table style="min-width: 100%" class="fh_table">\n <thead>\n <tr>\n <th>{{\'Commento\' | translate}}</th>\n <th width="15%"> {{\'Autore\' | translate}}</th>\n <th width="15%"> {{\'Data\' | translate}}</th>\n <th></th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="\n let app of commenti_list;\n let odd = odd;\n let even = even;\n index as i\n "\n [ngClass]="{ odd: odd, even: even }"\n >\n <td [innerHTML]="app.v_commento"></td>\n <td>{{ app.COGNOME + " " + app.NOME }}</td>\n <td>{{ app.data_creazione | date: "dd/MM/yyyy HH:mm:ss" }}</td>\n <td>\n <mat-icon\n [matTooltip]="app.dest_notif"\n *ngIf="app.dest_notif != null && app.dest_notif != \'\'"\n >mail</mat-icon\n >\n </td>\n <td>\n <mat-icon\n *ngIf="\n i == 0 &&\n app.creatore ==\n m_appService.getState().wkf_doc_info.curr_user\n "\n (click)="edit_comm(app)"\n >edit\n </mat-icon>\n </td>\n </tr>\n </tbody>\n </table>\n </section>\n </div>\n <br />\n\n <div style="width:100%;text-align:center;" *ngIf="!b_edit">\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n\n {{\'CHIUDI\' | translate}}\n </button>\n </div>\n</div>\n ',styles:[""]}]}],ii.ctorParameters=function(){return[{type:e.MatDialogRef},{type:e.MatDialog},{type:wt},{type:i.ToastrService},{type:Dt},{type:ei},{type:Tt},{type:p.TranslateService}]};var ni=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toast=i,this.data=n,this.title="INFO DOCUMENTO",this.hide_richiedente=!1,this.load_info(n)}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.load_info=function(t){console.log("data ",t),this.codice=t.codice,this.data_richiesta=t.data_richiesta,this.richiedente=t.richiedente,this.stato=t.stato,this.stat_stato=t.stat_stato,this.in_carico_a=t.autori,null!=t.s_uto&&""!=t.s_uto&&(this.in_carico_a=t.s_uto),this.uiid_app=t.id_applicativo,this.uiid_doc=t.id_documento,this.canale=t.canale,this.nc=t.nc},t.prototype.ngAfterViewInit=function(){},t}();ni.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title|translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <div mat-dialog-content style="font-size: 15px;">\n <table class="fh_table">\n <tbody>\n <tr class="odd">\n <td>{{\'Codice\'|translate}}:</td>\n <td>\n <b>{{ codice }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>{{\'Data\'|translate}}:</td>\n <td>\n <b>{{ data_richiesta | date: "dd/MM/yyyy HH:mm:ss" }}</b>\n </td>\n </tr>\n <tr *ngIf="!hide_richiedente" class="odd">\n <td>{{\'Richiedente\'|translate}}:</td>\n <td>\n <b>{{ richiedente }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>{{\'Stato\'|translate}}:</td>\n <td>\n <b>{{ stato }} - {{stat_stato}}</b>\n </td>\n </tr>\n <tr class="odd">\n <td>{{\'In Carico a\'|translate}}:</td>\n <td>\n <b>{{ in_carico_a }}</b>\n </td>\n </tr>\n\n <tr class="even" *ngIf="m_appService.dev_mode">\n <td>Uiid App:</td>\n <td>\n <b>{{ uiid_app }}</b>\n </td>\n </tr>\n <tr class="odd" *ngIf="m_appService.dev_mode">\n <td>Uiid Doc:</td>\n <td>\n <b>{{ uiid_doc }}</b>\n </td>\n </tr>\n <tr class="odd" *ngIf="m_appService.dev_mode">\n <td>Grp:</td>\n <td>\n <b>{{ canale }}</b>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <br />\n\n <div style="width:100%;text-align:center;">\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="dialogRef.close(\'\')"\n >\n CHIUDI\n </button>\n </div>\n</div>\n '}]}],ni.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var oi=function(){function t(t,e,i,n,o,s,a,r){this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.toastr=n,this._dataService=o,this.m_wkf=s,this.m_file=a,this.data=r,this.ossv=!1,this.not_comm=!1,this.not_comm_disabled=!1,this.b_flussook=!0,this.logs=new Array,this.notifica_commenti=1,this.notifica_commenti_obbl=0,this.title="LOG WORKFLOW E COMMENTI",this.nota="",this.commenti_insert=!1,this.b_edit=!1,this.b_ins=!1,this.edit_id=0,this.c_edit=!0,this.lettori="",this.subject="",this.link="",this.codice_doc="",null!=r.edit_c&&(this.c_edit=r.edit_c)}return t.prototype.ric_all=function(){this.refresh_list()},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.init_v=function(){this.notifica_commenti>0&&1==this.notifica_commenti_obbl&&(this.not_comm=!0,this.not_comm_disabled=!0)},t.prototype.load_graph=function(){var t=this,e=new vt;e.sql="SELECT_WKF_BY_ID",e.types=["string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){if(e.result_data.length>0&&null!=e.result_data[0].diagramma_flusso&&""!=e.result_data[0].diagramma_flusso){for(var i=!1,n=0;n<t.logs.length;n++)-1==t.logs[n].id_comment&&(null!=t.logs[n].liv_ini&&(e.result_data[0].diagramma_flusso=e.result_data[0].diagramma_flusso.split('bpmnElement="STEP_'+t.logs[n].liv_ini+'"').join('bpmnElement="STEP_'+t.logs[n].liv_ini+'" bioc:stroke="#43A047" bioc:fill="#C8E6C9"')),i||null!=t.logs[n].liv_fin&&(e.result_data[0].diagramma_flusso=e.result_data[0].diagramma_flusso.split('bpmnElement="STEP_'+t.logs[n].liv_fin+'"').join('bpmnElement="STEP_'+t.logs[n].liv_fin+'" bioc:stroke="#FB8C00" bioc:fill="#FFE0B2"'),i=!0));return void t.modeler.importXML(e.result_data[0].diagramma_flusso,(function(e){e?t.b_flussook=!1:t.modeler.get("canvas").zoom("fit-viewport",{x:0,y:0})}))}t.b_flussook=!1}}))},t.prototype.annulla=function(){var t=this;localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler annullare l'inserimento del commento?"),this.m_dialogRef.open(It).afterClosed().subscribe((function(e){e&&(t.nota="",t.b_edit=!1,t.title="LOG WORKFLOW E COMMENTI")}))},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title="INSERISCI COMMENTO"},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.ric_all()}),200)},t.prototype.edit_comm=function(t){this.b_edit=!0,this.b_ins=!1,this.nota=t.stato_attuale,this.edit_id=t.id_comment,this.title="MODIFICA COMMENTO"},t.prototype.refresh_list=function(){var t=this,e=new vt;e.sql="SELECT_WORKFLOW_LOG",e.types=["string","string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc];this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.logs=e.result_data;for(var i=0;i<t.logs.length;i++)null!=t.logs[i].stato_attuale?t.logs[i].v_commento="<b>"+t.logs[i].operazione.replace(/\n/g,"<br/>")+" ("+t.logs[i].stato_attuale.replace(/\n/g,"<br/>")+")</b>":t.logs[i].v_commento="<b>"+t.logs[i].operazione.replace(/\n/g,"<br/>")+"</b>";t.ossv||(t.modeler=new R({container:"#canvas",width:"97%",height:"100%",readonly:!0})),t.load_graph(),t.ossv=!0,!0}}))},t.prototype.ok=function(){if(this.not_comm){if(""==this.nota)return void this.toastr.error("INSERIRE UN COMMENTO");1==this.notifica_commenti?this.select_destinatari():this.select_destinatari_grp()}else this.ok_op()},t.prototype.select_destinatari=function(){var t=this,e=new vt;e.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",e.types=["string"],e.values=["'"+this.lettori.split(",").join("','")+"'"];this._dataService.doQuery(e).subscribe((function(e){var i=t.m_dialogRef.open(ti,{disableClose:!0});setTimeout((function(){i.componentInstance.init_arr(e.result_data)})),i.afterClosed().subscribe((function(e){if(null!=e){for(var i="",n=0;n<e.arrsel.length;n++)""!=i&&(i+=","),i+=e.arrsel[n].username;t.ok_op(i)}}))}))},t.prototype.select_destinatari_grp=function(){var t=this,e=this.m_dialogRef.open(He,{disableClose:!0});setTimeout((function(){e.componentInstance.title="Selezione almeno un gruppo da notificare",e.componentInstance.types=["string"],e.componentInstance.values=[t.m_appService.getState().wkf_doc_info.uiid_app],e.componentInstance.sql="SELECT_GRP_APP_USERS",e.componentInstance.doFill()})),e.afterClosed().subscribe((function(e){if(null!=e){if(""==e)return;for(var i="",n=0;n<e.length;n++)""!=i&&(i+=","),i=i+""+e[n].valore;var o=new vt;o.sql="SELECT_USERS_BY_IDROLES_NOREP",o.types=["string"],o.values=[i],t._dataService.doQuery(o).subscribe((function(e){i="";for(var n=0;n<e.result_data.length;n++)""!=i&&(i+=","),i=i+""+e.result_data[n].username;t.ok_op(i)}))}}))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,a,r,l,p,u){if(void 0===p&&(p=!0),void 0===u&&(u=""),null!=e&&""!=e){var c=new vt;c.sql="send_wkf_mail",c.values=[t,e,i,n.split("\n").join("<br>"),o,s,a,r,l,u],this.m_wkf.doQuery(c).subscribe((function(t){}))}},t.prototype.ok_op=function(t){var e,i=this;(void 0===t&&(t=""),this.b_ins)?((e=new vt).sql="INSERT_WKF_COMMENTO",e.types=["string","string","string","string","string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc,this.nota,this.m_appService.getState().wkf_doc_info.curr_user,t],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){i.toastr.info("INFO","COMMENTO INSERITO",{timeOut:1e3,progressBar:!0}),console.log("insert_update_comment !!!!");var n=new gt;n.command="exec_app",n.p1="insert_update_comment",n.p2=i.m_appService.getState().wkf_doc_info.uiid_app+"|"+i.m_appService.getState().wkf_doc_info.uiid_doc,i.m_file.doQuery(n,!1).subscribe(),i.b_edit=!1,""!=t&&i.sendEMail_ex(i.m_appService.getState().wkf_doc_info.curr_user,t,i.subject.split("<OP>").join("E' stato inserito un commento"),"<br><br>Commento inserito: <br>"+i.nota.split("\n").join("<br>"),i.m_appService.getState().wkf_doc_info.uiid_app,i.m_appService.getState().wkf_doc_info.uiid_doc,i.link,i.codice_doc,""),i.refresh_list()}}))):((e=new vt).sql="UPDATE_WKF_COMMENTO",e.types=["string","string","string","string"],e.values=[this.nota,this.edit_id],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){i.toastr.info("INFO","COMMENTO AGGIORNATO",{timeOut:1e3,progressBar:!0}),console.log("insert_update_comment !!!!");var n=new gt;n.command="exec_app",n.p1="insert_update_comment",n.p2=i.m_appService.getState().wkf_doc_info.uiid_app+"|"+i.m_appService.getState().wkf_doc_info.uiid_doc,i.m_file.doQuery(n,!1).subscribe(),i.b_edit=!1,""!=t&&i.sendEMail_ex(i.m_appService.getState().wkf_doc_info.curr_user,t,i.subject.split("<OP>").join("E' stato modificato un commento"),"<br><br>Commento modificato: <br>"+i.nota.split("\n").join("<br>"),i.m_appService.getState().wkf_doc_info.uiid_app,i.m_appService.getState().wkf_doc_info.uiid_doc,i.link,i.codice_doc,""),i.refresh_list()}})))},t}();oi.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <div\n style="font-size: 12px"\n [style.height]="m_appService.getState().body_h - 130 + \'px\'"\n >\n <mat-tab-group\n #zz\n style="width:100%"\n [style.height]="m_appService.getState().body_h - 140 + \'px\'"\n >\n <mat-tab label="WORKFLOW" *ngIf="b_flussook">\n <div [style.height]="m_appService.getState().body_h - 160 + \'px\'">\n <div style="width:100%;height:100%" id="canvas"></div>\n </div>\n </mat-tab>\n\n <mat-tab label="LOGS">\n <div\n fxLayout="row"\n fxLayoutAlign="center end"\n fxFlex="90"\n *ngIf="!b_edit && commenti_insert && c_edit"\n >\n <button mat-flat-button color="accent" (click)="ins()">\n <mat-icon>note_add</mat-icon>\n {{\'INSERISCI\' | translate}}</button\n > \n </div>\n\n <div fxLayout="column" *ngIf="b_edit">\n <br />\n\n <FHTextArea *ngIf="b_edit" [label]="\'Commento\' | translate" [(ngModel)]="nota" rows="12"></FHTextArea>\n\n <div *ngIf="b_edit" fxLayoutAlign="center center" fxLayout="row">\n <button mat-flat-button color="primary" (click)="ok()">OK</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="annulla()"\n >\n {{\'ANNULLA\' | translate}}</button\n > \n <mat-checkbox\n [disabled]="not_comm_disabled"\n [(ngModel)]="not_comm"\n [hidden]="\n notifica_commenti == 0 ||\n (notifica_commenti == 1 && lettori == \'\')\n "\n >\n {{\'Notifica Interessati\' | translate}}\n\n </mat-checkbox>\n </div>\n <br /><br />\n </div>\n <table *ngIf="!b_edit" class="fh_table" style="width:90%">\n <thead>\n <tr>\n <th width="15%">{{\'Data\' | translate}}</th>\n <th width="15%">{{\'Utente\' | translate}}</th>\n <th>{{\'Task/Operazione\' | translate}}</th>\n <td></td>\n <td *ngIf="c_edit"></td>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="\n let app of logs;\n let odd = odd;\n let even = even;\n index as i\n "\n [ngClass]="{ odd: odd, even: even }"\n >\n <td>{{ app.data_creazione | date: "dd/MM/yyyy HH:mm:ss" }}</td>\n <td>{{ app.nc }}</td>\n <td [innerHTML]="app.v_commento"></td>\n <td>\n <mat-icon\n [matTooltip]="app.dest_notif"\n *ngIf="app.dest_notif != null && app.dest_notif != \'\'"\n >mail</mat-icon\n >\n </td>\n <td *ngIf="c_edit">\n <mat-icon\n *ngIf="\n i == 0 &&\n app.creatore ==\n m_appService.getState().wkf_doc_info.curr_user\n "\n (click)="edit_comm(app)"\n >edit\n </mat-icon>\n </td>\n </tr>\n </tbody>\n </table>\n </mat-tab>\n </mat-tab-group>\n </div>\n ',styles:[""]}]}],oi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:e.MatDialog},{type:wt},{type:i.ToastrService},{type:Dt},{type:ei},{type:Tt},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},oi.propDecorators={zz:[{type:n.ViewChild,args:["zz"]}]};var si=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.flt_grid="1=1",this.title="RECUPERA DOCUMENTO"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.edit=function(t){var e=this,i=new vt;i.sql="UPDATE_WKF_ANNULATO",i.types=["string","string","int"],i.values=[this.datagrid.sRow.id_applicativo,this.datagrid.sRow.uiid,0],this._dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(e.toastr.info("Documento "+e.datagrid.sRow.codice+" Recuperato"),e.dialogRef.close("ok"))}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}))},t.prototype.init_w=function(t){this.datagrid.columnDefs=[{headerName:"Codice",field:"codice",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Oggetto",field:"oggetto",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Stato",field:"stat_stato",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Richiedente",field:"nc",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}}],this.datagrid.doFill("annullato=-1 and id_applicativo='"+t+"'")},t.prototype.edit_comm=function(t){},t}();si.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <div mat-dialog-content style="font-size: 15px;">\n\n <br />\n <div style="width:100%;height:400px">\n <div style="width:100%;height:100%">\n <FHGrid\n [filters]="flt_grid"\n init_fill="false"\n show_buttons="false"\n vis\n #dtm\n (dclicked)="edit($event)"\n g_width="100%"\n g_height="100%"\n tbl_name="wkf_documents"\n grid_key="r_wkf_documents"\n sort_field="codice desc"\n off_set="50"\n fields="*"\n ></FHGrid>\n </div>\n </div>\n <br />\n\n <div style="width:100%;text-align:center;">\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="dialogRef.close(\'\')"\n >\n CHIUDI\n </button>\n </div>\n </div>\n</div>\n '}]}],si.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:Dt}]},si.propDecorators={datagrid:[{type:n.ViewChild,args:["dtm"]}]};var ai=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i,this.selval="-1",this.title="",this.errorMsg="",this.OK_BUTTON="OK"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.sc=function(){if(this.OK_BUTTON="OK","-1"!=this.selval)for(var t=0;t<this.myData.length;t++){if(Number(this.selval).valueOf()+0==this.myData[t].livello+0){this.OK_BUTTON="OK ("+this.myData[t].descri_livello+")";break}}},t.prototype.setStepCombo=function(t){this.myData=t},t.prototype.ok=function(){if(null!=this.selval)if("-1"!=this.selval){for(var t=null,e=0;e<this.myData.length;e++){if(Number(this.selval).valueOf()+0==this.myData[e].livello+0){t=this.myData[e];break}}null!=t?this.dialogRef.close({lvl_sel:t,result:"ok"}):this.toastr.error("ERRORE","SELEZIONARE LO STEP",{timeOut:1e3,progressBar:!0})}else this.toastr.error("ERRORE","SELEZIONARE LO STEP",{timeOut:1e3,progressBar:!0});else this.toastr.error("ERRORE","SELEZIONARE LO STEP",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();ai.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n\n\n <div mat-dialog-content style="font-size: 15px;">\n\n <mat-dialog-content\n ><br /><br />\n <mat-form-field\n style="width:100%"\n appearance="outline"\n floatLabel="always"\n ><mat-label>Seleziona Step:</mat-label>\n <mat-select #cmb [(ngModel)]="selval" (change)="sc()">\n <mat-option value="-1">Seleziona</mat-option>\n <mat-option value="{{ app.livello }}" *ngFor="let app of myData">{{\n app.v\n }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <br /><br /><br /><br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()">\n {{ OK_BUTTON }}</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n ANNULLA\n </button>\n </div>\n <br /><br />\n </mat-dialog-content>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">\n {{ errorMsg }}\n </p>\n </div>\n </div>\n '}]}],ai.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService}]},ai.propDecorators={smtr:[{type:n.ViewChild,args:["cmb"]}]};var ri=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.commento_hidden=!1,this.nota="",this.nota_commento="",this.title="",this.comm_notrequired=!0,this.comm_notrequired=!0}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(this.commento_hidden||""!=this.nota)if(0!=this.up.getSelArr().length){var t=new Object;t.nota=this.nota,t.arrsel=this.up.getSelArr(),t.result="ok",this.dialogRef.close(t)}else this.toastr.error("ERRORE","SELEZIONARE ALMENO UN UTENTE",{timeOut:1e3,progressBar:!0});else this.toastr.error("ERRORE","INSERIRE IL COMMENTO",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();ri.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title |translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <div mat-dialog-content fxLayout="column" style="font-size:12px">\n <div style="width:100%;height:500px">\n <FHPickUsers\n #up\n [users_list]="arrAutori"\n [vis_buttons]="false"\n ></FHPickUsers>\n </div>\n <FHTextArea [hidden]="commento_hidden" [label]="\'Commento\' | translate" [(ngModel)]="nota" rows="2"></FHTextArea>\n </div>\n <div mat-dialog-actions fxLayout="row" fxLayoutAlign="center center">\n <div>\n <button mat-flat-button color="primary" (click)="ok()">OK</button>\n </div>\n \n <div>\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n {{\'ANNULLA\' | translate}}\n </button>\n </div>\n </div>\n</div>\n '}]}],ri.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:Dt}]},ri.propDecorators={up:[{type:n.ViewChild,args:["up"]}]};var li=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.nota="",this.title="",this.comm_notrequired=!0,this.comm_notrequired=!0}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(console.log(this.up.getUsersUsername(),this.up1.getUsersUsername()),null!=this.up.getUsersUsername())if("-1"!=this.up.getUsersUsername())if(""!=this.up.getUsersUsername())if(null!=this.up1.getUsersUsername())if("-1"!=this.up1.getUsersUsername())if(""!=this.up1.getUsersUsername()){var t=new Object;t.u1=this.up.getUsersUsername(),t.u2=this.up1.getUsersUsername(),t.result="ok",this.dialogRef.close(t)}else this.toastr.error("selezionare utente destinazione");else this.toastr.error("selezionare utente destinazione");else this.toastr.error("selezionare utente destinazione");else this.toastr.error("selezionare utente origine");else this.toastr.error("selezionare utente origine");else this.toastr.error("selezionare utente origine")},t.prototype.ngAfterViewInit=function(){},t}();li.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <div\n mat-dialog-content\n fxLayoutGap="5px"\n fxLayout="column"\n style="font-size:12px"\n >\n <div style="width:100%">\n <FHUserField label="Utente da sostituire" #up></FHUserField>\n </div>\n <div style="width:100%">\n <FHUserField label="Utente sostituto" #up1></FHUserField>\n </div>\n </div>\n <div mat-dialog-actions fxLayout="row" fxLayoutAlign="center center">\n <div>\n <button mat-flat-button color="primary" (click)="ok()">OK</button>\n </div>\n \n <div>\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n ANNULLA\n </button>\n </div>\n </div>\n</div>\n '}]}],li.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:Dt}]},li.propDecorators={up:[{type:n.ViewChild,args:["up"]}],up1:[{type:n.ViewChild,args:["up1"]}]};var pi=function(){function t(t,e){this.uti=t,this.app=e}return t.prototype.read=function(t,e,i){var n=this;return void 0===e&&(e=!0),void 0===i&&(i=!0),new Promise((function(o){if(null!=localStorage.getItem(t))if(e){if(i){try{o(JSON.parse(n.uti.decrypt_v2(localStorage.getItem(t))))}catch(e){return console.log(e,"Errore JSON "+n.uti.decrypt_v2(localStorage.getItem(t))),void o({})}return}o(n.uti.decrypt_v2(localStorage.getItem(t)))}else if(i)try{o(JSON.parse(""+localStorage.getItem(t)))}catch(e){return console.log(e,"Errore JSON "+localStorage.getItem(t)),void o({})}else o(localStorage.getItem(t));else o(null)}))},t.prototype.write=function(t,e,i,n){void 0===i&&(i=!0),void 0===n&&(n=!0),i?n?localStorage.setItem(t,this.uti.encrypt_v2(JSON.stringify(e))):localStorage.setItem(t,this.uti.encrypt_v2(e)):n?localStorage.setItem(t,JSON.stringify(e)):localStorage.setItem(t,e)},t.prototype.delete=function(t){localStorage.removeItem(t)},t}();pi.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new pi(n.ɵɵinject(Ct),n.ɵɵinject(wt))},token:pi,providedIn:"root"}),pi.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],pi.ctorParameters=function(){return[{type:Ct},{type:wt}]};var ui=function(){function t(t,e,i,o,s,a,r){var l=this;this.localstore=t,this.uti_s=e,this._toast=i,this._dataService=o,this.m_appService=s,this.slimLoadingBarService=a,this.m_dialog=r,this.tbl_name="",this.count_tbl_name="",this.num_per_pag=5e3,this.grid_key="PRO_H",this.sort_field="",this.fields="*",this.filters="1=1",this.auto_height=!1,this.enable_export=!0,this.enabled_pag=!0,this.show_help=!0,this.show_num_elem=!0,this.system_dest=1,this.header_h=35,this.g_width="100%",this.g_height="100%",this.init_fill=!0,this.label_elementi=" Elementi",this.trova_label="TROVA",this.mantieni_impostazioni="Mantieni impostazioni",this.curr_filter="",this.show_buttons=!0,this.fill_end=new n.EventEmitter,this.cell_edited=new n.EventEmitter,this.clicked=new n.EventEmitter,this.dclicked=new n.EventEmitter,this.columndclicked=new n.EventEmitter,this.cell_clicked=new n.EventEmitter,this.b_ensure=!1,this.curr_config="-1",this.init_end=new n.EventEmitter,this.off_set=0,this.b_restored=!1,this.gridOptions={debug:!1,headerHeight:this.header_h,enableRangeSelection:!0,enableServerSideSorting:!1,enableServerSideFilter:!1,defaultColDef:{resizable:!0,sortable:!0,floatingFilter:!0},rowSelection:"multiple",rowDeselection:!1,getContextMenuItems:function(){return l.getContextMenuItems()},allowContextMenuWithControlKey:!0,rowModelType:"clientSide",localeText:{page:"pagina",more:"altre",to:"a",of:"di",next:"prossima",last:"ultima",first:"prima",previous:"precedente",loadingOoo:"Caricamento...",selectAll:"Seleziona Tutto",searchOoo:"Trova...",blanks:"Vuoto",filterOoo:"Filtro...",applyFilter:"Applica Filtro...",equals:"Uguale",notEqual:"Diverso",lessThan:"Minore o Uguale",greaterThan:"Maggiore o Uguale",notContains:"Non Contiene",contains:"Contiene",startsWith:"Inizia Con",endsWith:"Finisce Con",group:"Gruppo",columns:"Colonne",rowGroupColumns:"Colonne Pivot",rowGroupColumnsEmptyMessage:"trascina le colonne per raggrupparle",valueColumns:"Colonne Valore",pivotMode:"Modalità Pivot",groups:"Gruppi",values:"Valori",pivots:"Pivots",valueColumnsEmptyMessage:"trascina le colonne per aggreare",pivotColumnsEmptyMessage:"trascina le colonne per pivot",noRowsToShow:"nessun dato",pinColumn:"Sposta Colonna",valueAggregation:"Aggregazione",autosizeThiscolumn:"Autosize colonna",autosizeAllColumns:"Autosize tutte le colonne",groupBy:"Raggruppa per",ungroupBy:"Spacca per",resetColumns:"Resetta queste colonna",expandAll:"Espandi",collapseAll:"Chiudi",toolPanel:"Impostazioni",pinLeft:"Sposta <<",pinRight:"Sposta >>",noPin:"Sposta <>",sum:"Somma",min:"Minimo",max:"Massimo",none:"Nessuno",count:"Numero",average:"Media",copy:"Copia",ctrlC:"ctrl n C",paste:"Incolla",ctrlV:"ctrl n C"},getRowNodeId:function(t){return null!=t.ID?String(t.ID):null!=t.id?String(t.id):null!=t.uiid?t.uiid:null!=t.codice?t.codice:null!=t.id_doc?t.id_doc:null!=t.ord?t.ord:void 0}},this.b_init=!1,this.b_init1=!1,this.errorMsg="",this.innerWidth=750,this.show_pulisci_filtri=!1,this.num_r=0,this.ready=!1,this.ckk_ed=!1,this.myData=new Array,this.b_iniended=!1,this.ric_libera="",this.fix_flt="",this.fix_flt_temp="",null==this.m_appService.getState().grid_obj&&(this.m_appService.getState().grid_obj=new Object)}return t.prototype.ensure_visible=function(){if(!this.b_ensure){this.b_ensure=!0;try{null!=localStorage.getItem(this.grid_key+"_POS")&&(this.gridOptions.api.ensureIndexVisible(parseInt(localStorage.getItem(this.grid_key+"_POS"))),localStorage.removeItem(this.grid_key+"_POS"))}catch(t){console.log(t)}}},t.prototype.ck_flag=function(){this.toggle_mantieni.checked?localStorage.setItem(this.grid_key+"_MANTIENI","NO"):localStorage.setItem(this.grid_key+"_MANTIENI","SI")},t.prototype.refresh_all_rows=function(){this.gridOptions.api.refreshCells({force:!0})},t.prototype.ch_config=function(){this.curr_config=this.gf.getValue(),"-1"!=this.curr_config&&(localStorage.removeItem(this.grid_key+"_COLS"),localStorage.removeItem(this.grid_key+"_SORT"),localStorage.removeItem(this.grid_key+"_FILTER"),localStorage.removeItem(this.grid_key+"_CFG_DEFAULT"),null!=this.gf.getObj().COL&&""!=this.gf.getObj().COL&&localStorage.setItem(this.grid_key+"_COLS",this.gf.getObj().COL),null!=this.gf.getObj().SORT&&""!=this.gf.getObj().SORT&&localStorage.setItem(this.grid_key+"_SORT",this.gf.getObj().SORT),null!=this.gf.getObj().FILTER&&""!=this.gf.getObj().FILTER&&localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),null!=this.gf.getDescri()&&"-1"!=this.gf.getDescri()&&localStorage.setItem(this.grid_key+"_CFG_DEFAULT",this.gf.getDescri()),this.curr_config=this.gf.getValue(),this.res_columns(!0))},t.prototype.edit_config=function(){var t=this;this.m_dialog.open(It,{disableClose:!0,data:{title_dialog:"Conferma Operazione",msg_dialog:"Confermi di voler sovrascrivere la configurazione "+this.gf.getDescri()+"?"}}).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="INSERT_UPDATE_CFG_GRID";var n="",o="",s="";null!=localStorage.getItem(t.grid_key+"_COLS")&&(n=localStorage.getItem(t.grid_key+"_COLS")),null!=localStorage.getItem(t.grid_key+"_SORT")&&(o=localStorage.getItem(t.grid_key+"_SORT")),null!=localStorage.getItem(t.grid_key+"_FILTER")&&(s=localStorage.getItem(t.grid_key+"_FILTER")),i.types=["string","string","string","string","string","string"],i.values=[t.gf.getDescri(),t.grid_key,n,o,s,t.m_appService.user];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione salvata"),t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo()),t.errorMsg=e.msg}),(function(t){}))}}))},t.prototype.getGridApi=function(){return this.gridOptions.api},t.prototype.insert_config=function(){var t=this;this.win_opt=this.m_dialog.open(re,{disableClose:!0}),setTimeout((function(){t.win_opt.componentInstance.title="Salva Configurazione",t.win_opt.componentInstance.label="Nome"})),this.win_opt.afterClosed().subscribe((function(e){if(e&&null!=e){var i=new vt;i.sql="INSERT_UPDATE_CFG_GRID";var n="",o="",s="";null!=localStorage.getItem(t.grid_key+"_COLS")&&(n=localStorage.getItem(t.grid_key+"_COLS")),null!=localStorage.getItem(t.grid_key+"_SORT")&&(o=localStorage.getItem(t.grid_key+"_SORT")),null!=localStorage.getItem(t.grid_key+"_FILTER")&&(s=localStorage.getItem(t.grid_key+"_FILTER")),i.types=["string","string","string","string","string","string"],i.values=[e,t.grid_key,n,o,s,t.m_appService.user];t._dataService.doQuery(i).subscribe((function(e){var i=!1;null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione salvata"),i=!0,t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo()),i||(t.errorMsg=e.msg)}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"}))}}))},t.prototype.getContextMenuItems=function(){var t=this,e=["autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste","toolPanel",{name:"Esporta",action:function(){t.onBtExport()}}];return this.enable_export||(e=new Array("autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste","toolPanel")),e},t.prototype.onBtExport=function(){var t=this,e={skipHeader:!1,columnGroups:!1,skipFooters:!0,skipGroups:!0,skipPinnedTop:!0,skipPinnedBottom:!0,allColumns:!0,onlySelected:!1,suppressQuotes:!1,processCellCallback:function(e){if(e.value){if(null==e.value)return"";if("function"==typeof e.value.getMonth)return t.uti_s.pad(e.value.getDate(),2)+"/"+t.uti_s.pad(e.value.getMonth()+1,2)+"/"+e.value.getFullYear();if(24==e.value.length&&e.value.indexOf(":00.000Z")>-1){var i=new Date(e.value);return t.uti_s.pad(i.getDate(),2)+"/"+t.uti_s.pad(i.getMonth()+1,2)+"/"+i.getFullYear()+" "+t.uti_s.pad(i.getHours(),2)+":"+t.uti_s.pad(i.getMinutes(),2)}return e.value}}};this.gridOptions.api.exportDataAsExcel(e)},t.prototype.setHeaderHeight=function(t){this.header_h=t,this.gridOptions.api.setHeaderHeight(this.header_h)},t.prototype.getRowNodeId=function(t){return null==t||null==t.data?this.uti_s.newGuid():null!=t.data.id?String(t.data.id):null!=t.data.uiid?t.data.uiid:null!=t.data.codice?t.data.codice:"NA"},t.prototype.ngAfterViewInit=function(){},t.prototype.okr=function(t){t.data.nome_colonna=t.column.colDef.field,this.cell_edited.emit(t.data)},t.prototype.help_window=function(){this.m_dialog.open(ae,{disableClose:!0}).afterClosed().subscribe((function(t){}))},t.prototype.autoSizeAll=function(){var t=[];this.columnDefs.forEach((function(e){t.push(e.field)})),this.gridOptions.columnApi.autoSizeColumns(t),this.save_cfg()},t.prototype.fitSizeAll=function(){this.gridOptions.api.sizeColumnsToFit(),this.save_cfg()},t.prototype.selectCount=function(){var t=0;return this.gridOptions.api.forEachNode((function(e){e.isSelected()&&t++})),t},t.prototype.getquerySelected=function(t,e){var i="";return"String"==e&&this.gridOptions.api.forEachNode((function(e){e.isSelected()&&null!=e.data[t]&&(""!=i&&(i+=","),i=i+"'"+e.data[t]+"'")})),"Number"==e&&this.gridOptions.api.forEachNode((function(e){e.isSelected()&&null!=e.data[t]&&(""!=i&&(i+=","),i+=e.data[t])})),i},t.prototype.selectAllFiltered=function(){var t=this;this.gridOptions.api.forEachNode((function(e){t.gridOptions.api.selectNode(e,!0)}))},t.prototype.deselectAllFiltered=function(){var t=this;this.gridOptions.api.forEachNode((function(e){t.gridOptions.api.selectNode(e,!1)}))},t.prototype.pulisci_filtri=function(t){void 0===t&&(t=!0),localStorage.removeItem(this.grid_key+"_FILTER"),t&&(this.ric_libera=""),this.fix_flt_temp="",this.gridOptions.api.setFilterModel(null),this.show_pulisci_filtri=!1},t.prototype.init_conf=function(){},t.prototype.createColumnDefs=function(t){},t.prototype.ckk=function(){var t=this;null!=this.columnDefs&&0!=this.columnDefs.length?this.ckk_ed||(this.ckk_ed=!0,null!=this.toggle_mantieni&&(this.toggle_mantieni.checked=!0,null!=localStorage.getItem(this.grid_key+"_MANTIENI")&&"NO"==localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.toggle_mantieni.checked=!1)),this.res_columns(),null!=localStorage.getItem(this.grid_key+"_POS")&&(this.b_restored=!0),this.init_fill&&setTimeout((function(){t.ref_dt()}),100)):setTimeout((function(){t.ckk()}),500)},t.prototype.res_columns=function(t){void 0===t&&(t=!1);var e=!1;if(null!=this.toggle_mantieni&&(e=this.toggle_mantieni.checked),null!=localStorage.getItem(this.grid_key+"_COLS")&&(e||t)&&""!=localStorage.getItem(this.grid_key+"_COLS")){!0;try{this.gridOptions.columnApi.setColumnState(JSON.parse(localStorage.getItem(this.grid_key+"_COLS")))}catch(t){console.log(t)}}try{this.gridOptions.api.setSortModel(null)}catch(t){console.log(t)}if(null!=localStorage.getItem(this.grid_key+"_SORT")&&(e||t)&&""!=localStorage.getItem(this.grid_key+"_SORT"))try{this.gridOptions.api.setSortModel(JSON.parse(localStorage.getItem(this.grid_key+"_SORT")))}catch(t){console.log(t)}try{this.gridOptions.api.setFilterModel(null)}catch(t){console.log(t)}if(null!=localStorage.getItem(this.grid_key+"_FILTER")&&(e||t)&&""!=localStorage.getItem(this.grid_key+"_FILTER"))try{this.gridOptions.api.setFilterModel(JSON.parse(localStorage.getItem(this.grid_key+"_FILTER")))}catch(t){console.log(t)}},t.prototype.getRows=function(){return this.gridOptions.rowData},t.prototype.setRows=function(){var t=this;this.localstore.read(this.m_appService.COMPANY_KEY+this.tbl_name).then((function(e){t.rowData=e}))},t.prototype.sortAndFilter=function(t,e){},t.prototype.ref_dt=function(){var t=this;null==this.gridOptions||null==this.gridOptions.api?setTimeout((function(){t.ref_dt()}),500):this.setRows()},t.prototype.updateRow=function(){this.refresh_all_rows()},t.prototype.onModelUpdated=function(){},t.prototype.onReady=function(t){if(this.setHeaderHeight(this.header_h),null==this.gf||!this.show_buttons||(this.gf.sql="SELECT_CFG_GRID",this.gf.types=["string"],this.gf.values=[this.grid_key],this.gf.fillCombo(),"NO"==localStorage.getItem(this.grid_key+"_MANTIENI")||null==localStorage.getItem(this.grid_key+"_CFG_DEFAULT"))){/iPad|iPhone|iPod/.test(navigator.userAgent);this.onready_go()}},t.prototype.save_cfg=function(){localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.fe_cfg=function(){null!=this.gf&&null!=this.gf.getObj()&&"NO"!=localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.gf.setByDescri(localStorage.getItem(this.grid_key+"_CFG_DEFAULT")),localStorage.setItem(this.grid_key+"_COL",this.gf.getObj().COLS),localStorage.setItem(this.grid_key+"_SORT",this.gf.getObj().SORT),localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),this.curr_config=this.gf.getValue()),this.onready_go()},t.prototype.onready_go=function(){var t=this;this.ready=!0,setTimeout((function(){t.ckk()}),10),this.b_iniended||(this.b_iniended=!0,this.init_end.emit())},t.prototype.init_filters=function(){},t.prototype.keyDownFunctioncl=function(t){13==t.keyCode&&this.free_search()},t.prototype.free_search=function(){if(""==this.ric_libera)return this.pulisci_filtri(),this.fix_flt_temp="",void this.doFill("",!0,!1);for(var t=this.ric_libera.split(" "),e=new Array,i=0;i<t.length;i++)t[i].length>2?e.push(t[i]):this._toast.error("ignorato termine: "+t[i]+" troppo corto");if(0!=e.length){for(var n="",o=0;o<this.columnDefs.length;o++)if(null!=this.columnDefs[o]&&null==this.columnDefs[o].no_filter&&null!=this.columnDefs[o].field&&""!=this.columnDefs[o].field&&"agDateColumnFilter"!=this.columnDefs[o].filter)for(i=0;i<e.length;i++)""!=n&&(n+=" or "),n=n+this.columnDefs[o].field+" LIKE '%"+this.uti_s.string_sqlvalue(e[i])+"%'";this.pulisci_filtri(!1),this.doFill_Temp(n,!0)}},t.prototype.onCellClicked=function(t){this.cell_clicked.emit(t)},t.prototype.onCellValueChanged=function(t){},t.prototype.onCellDoubleClicked=function(t){},t.prototype.onCellFocused=function(t){},t.prototype.onSelectionChanged=function(){},t.prototype.onBeforeFilterChanged=function(){},t.prototype.oncolumnEverythingChanged=function(t){this.b_init&&localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.onAfterFilterChanged=function(){localStorage.removeItem(this.grid_key+"_POS"),this.b_init&&localStorage.setItem(this.grid_key+"_FILTER",JSON.stringify(this.gridOptions.api.getFilterModel()))},t.prototype.onFilterModified=function(){this.b_init&&localStorage.setItem(this.grid_key+"_FILTER",JSON.stringify(this.gridOptions.api.getFilterModel()))},t.prototype.onBeforeSortChanged=function(){},t.prototype.onAfterSortChanged=function(){this.b_init&&localStorage.setItem(this.grid_key+"_SORT",JSON.stringify(this.gridOptions.api.getSortModel()))},t.prototype.onVirtualRowRemoved=function(t){},t.prototype.onRowClicked=function(t){var e=this.gridOptions.api.getSelectedNodes();null!=e&&null!=e[0]&&(localStorage.setItem(this.grid_key+"_POS",String(e[0].rowIndex)),localStorage.setItem(this.grid_key+"_POS_BAR",JSON.stringify(this.gridOptions.api.getVerticalPixelRange())),localStorage.setItem(this.grid_key+"_POS2",this.getRowNodeId(e[0]))),this.sRow=t.data,this.clicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&(this.columndclicked.emit(t),this.dclicked.emit(t.data))},t.prototype.onRowDClicked=function(t){this.dclicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&this.columndclicked.emit(t)},t.prototype.onQuickFilterChanged=function(t){this.gridOptions.api.setQuickFilter(t.target.value)},t.prototype.onColumnEvent=function(t){this.columndclicked.emit(t)},t.prototype.doFill=function(t,e,i){var n=this;void 0===e&&(e=!0),void 0===i&&(i=!0),e&&(this.filters=""),i&&(this.fix_flt=t),this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout((function(){n.ckk()}),10)},t.prototype.doFill_Temp=function(t,e){var i=this;void 0===e&&(e=!0),e&&(this.filters=""),this.fix_flt_temp=t,this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout((function(){i.ckk()}),10)},t.prototype.Refresh=function(){this.ref_dt()},t.prototype.RefreshOnlyMemory=function(){this.updateRow()},t}();ui.decorators=[{type:n.Component,args:[{selector:"FHGridJSON",template:'\n <table [hidden]="!show_buttons" style="height: 15%;">\n <tr>\n <td [hidden]="this.m_appService.getState().pageFullscreen">\n <h5>{{ num_r }} {{label_elementi|translate }}</h5>\n \n </td>\n <td style="vertical-align:\'bottom\'">\n \n <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>{{ trova_label|translate }}</mat-label>\n <input\n matInput\n (keydown)="keyDownFunctioncl($event)"\n [(ngModel)]="ric_libera"\n style="width:200px"\n /> </mat-form-field\n > \n </td>\n <td\n [hidden]="this.m_appService.getState().pageFullscreen"\n *ngIf="show_buttons && !this.m_appService.getState().mobile"\n >\n <button\n *ngIf="show_pulisci_filtri"\n mat-flat-button\n (click)="pulisci_filtri()"\n color="warn"\n >\n <mat-icon>clear</mat-icon> REMOVE FILTER\n </button>\n </td>\n <td\n [hidden]="this.m_appService.getState().pageFullscreen"\n *ngIf="show_buttons && !this.m_appService.getState().mobile"\n >\n \n <button mat-flat-button (click)="autoSizeAll()" color="accent">\n <mat-icon>photo_size_select_small</mat-icon> AUTO SIZE\n </button>\n </td>\n <td\n [hidden]="this.m_appService.getState().pageFullscreen"\n *ngIf="show_buttons && !this.m_appService.getState().mobile"\n >\n \n <button mat-flat-button (click)="fitSizeAll()" color="accent">\n <mat-icon>aspect_ratio</mat-icon> FIT SIZE\n </button>\n </td>\n </tr>\n </table>\n <div\n [hidden]="this.m_appService.getState().pageFullscreen"\n *ngIf="\n !show_buttons && !this.m_appService.getState().mobile && show_num_elem\n "\n >\n <h5>\n {{ num_r }} {{ "Elementi" | translate}}\n </h5>\n </div>\n\n <ag-grid-angular\n ref-agGrid\n style="width:100%;height:85%;"\n (cellDoubleClicked)="onColumnEvent($event)"\n (cellClicked)="onCellClicked($event)"\n [headerHeight]="header_h"\n [groupHeaderHeight]="header_h"\n class="ag-theme-balham"\n [singleClickEdit]="true"\n [gridOptions]="gridOptions"\n [columnDefs]="columnDefs"\n [rowData]="rowData"\n (afterFilterChanged)="onAfterFilterChanged()"\n (filterModified)="onFilterModified()"\n (rowDoubleClicked)="onRowDClicked($event)"\n (rowClicked)="onRowClicked($event)"\n (columnVisible)="oncolumnEverythingChanged($event)"\n (columnResized)="oncolumnEverythingChanged($event)"\n (columnMoved)="oncolumnEverythingChanged($event)"\n (cellValueChanged)="okr($event)"\n (sortChanged)="onAfterSortChanged()"\n [paginationPageSize]="num_per_pag"\n (gridReady)="onReady($event)"\n >\n </ag-grid-angular>\n ',styles:[""]}]}],ui.ctorParameters=function(){return[{type:pi},{type:Ct},{type:i.ToastrService},{type:Dt},{type:wt},{type:h.SlimLoadingBarService},{type:e.MatDialog}]},ui.propDecorators={tbl_name:[{type:n.Input}],columnDefs:[{type:n.Input}],count_tbl_name:[{type:n.Input}],num_per_pag:[{type:n.Input}],grid_key:[{type:n.Input}],sort_field:[{type:n.Input}],fields:[{type:n.Input}],filters:[{type:n.Input}],auto_height:[{type:n.Input}],enable_export:[{type:n.Input}],enabled_pag:[{type:n.Input}],show_help:[{type:n.Input}],show_num_elem:[{type:n.Input}],system_dest:[{type:n.Input}],header_h:[{type:n.Input}],g_width:[{type:n.Input}],g_height:[{type:n.Input}],init_fill:[{type:n.Input}],label_elementi:[{type:n.Input}],trova_label:[{type:n.Input}],mantieni_impostazioni:[{type:n.Input}],show_buttons:[{type:n.Input}],fill_end:[{type:n.Output}],cell_edited:[{type:n.Output}],clicked:[{type:n.Output}],dclicked:[{type:n.Output}],columndclicked:[{type:n.Output}],cell_clicked:[{type:n.Output}],gf:[{type:n.ViewChild,args:["gf"]}],toggle_mantieni:[{type:n.ViewChild,args:["toggle_mantieni"]}],init_end:[{type:n.Output}],off_set:[{type:n.Input}],testom:[{type:n.ViewChild,args:["testom",{read:n.ViewContainerRef}]}],myModalNormal:[{type:n.ViewChild,args:["myModalNormal",{read:n.ViewContainerRef}]}]};var ci=function(){function t(){this.show_help=!1,this.help_label="HELP",this.show_link=!1,this.elimina_label="ELIMINA",this.b_wait=!1,this.type="NONE",this.toolbar_wkfapp=null,this.custom_commands=[],this.sRow=null,this.command=new n.EventEmitter}return t.prototype.ngAfterViewInit=function(){for(var t=0;t<this.custom_commands.length;t++)null==this.custom_commands[t].type&&(this.custom_commands[t].type="button")},t.prototype.refresh_access=function(t){this.toolbar_wkfapp=t},t.prototype.selx=function(t,e){this.command.emit({cmd:t,v:e})},t.prototype.exec_command=function(t){this.command.emit({cmd:t})},t.prototype.help_doc=function(){this.command.emit({cmd:"show_help"})},t.prototype.link_doc=function(){this.command.emit({cmd:"link_list"})},t.prototype.insert_doc=function(){this.command.emit({cmd:"insert_doc"})},t.prototype.annulla_imp=function(){this.command.emit({cmd:"annulla_imp"})},t.prototype.recupera_richiesta=function(){this.command.emit({cmd:"recupera_richiesta"})},t.prototype.riassegna_richiesta=function(){this.command.emit({cmd:"riassegna_richiesta"})},t.prototype.sostituisci_utente=function(){this.command.emit({cmd:"sostituisci_utente"})},t.prototype.reclama_bozza=function(){this.command.emit({cmd:"reclama_bozza"})},t.prototype.test_utente=function(){this.command.emit({cmd:"test_utente"})},t.prototype.annulla_richiesta=function(){this.command.emit({cmd:"annulla_richiesta"})},t.prototype.new_doc=function(){this.command.emit({cmd:"new_doc"})},t.prototype.del_doc=function(){this.command.emit({cmd:"del_doc"})},t}();ci.decorators=[{type:n.Component,args:[{selector:"FHGridToolBar",template:'\n <div\n *ngIf="type == \'WKF\' || type == \'WKF_NO_EDIT\'"\n fxLayoutGap="3px"\n fxLayout="row"\n fxFlex="100"\n style="height: 70px;"\n fxLayoutAlign="end center"\n >\n <mat-toolbar>\n <div fxLayout="row" fxLayoutGap="3px" fxLayoutAlign="end center">\n <button mat-flat-button (click)="link_doc()" style="background-color: #2B7CD3;color:#FFFFFF" *ngIf="show_link">\n <mat-icon>launch</mat-icon> {{\n "LINK" | translate\n }}\n </button>\n <button mat-flat-button (click)="help_doc()" style="background-color: #2B7CD3;color:#FFFFFF" *ngIf="show_help">\n <mat-icon>help</mat-icon> {{\n help_label | translate\n }}\n </button>\n <div style="width:200px" fxHide fxShow.gt-sm *ngIf="show_link || show_help"></div>\n <table><tr><td style="width:130px">\n <button\n mat-flat-button\n (click)="insert_doc()"\n *ngIf="toolbar_wkfapp?.is_Ins && type != \'WKF_NO_EDIT\'"\n color="accent"\n style="width:130px"\n >\n <mat-icon>note_add</mat-icon> {{\n "INSERISCI" | translate\n }}</button\n >\n </td><td style="width:130px">\n <button\n mat-flat-button\n color="warn"\n mat-button style="width:130px"\n fxHide\n fxShow.gt-sm\n [matMenuTriggerFor]="gest_menu"\n *ngIf="toolbar_wkfapp?.is_Supervisor"\n >\n {{ "Gestione" | translate }}\n </button>\n </td></tr></table>\n <mat-menu #gest_menu="matMenu">\n <button mat-menu-item [hidden]="sRow==null" (click)="annulla_richiesta()">\n {{ "ANNULLA DOCUMENTO" | translate }}\n </button>\n <button mat-menu-item (click)="recupera_richiesta()">\n {{ "RECUPERA DOCUMENTO" | translate }}\n </button>\n <button mat-menu-item [hidden]="sRow==null" (click)="riassegna_richiesta()">\n {{ "RIASSEGNA DOCUMENTO" | translate }}\n </button>\n <button\n mat-menu-item [hidden]="sRow==null"\n (click)="sostituisci_utente()"\n *ngIf="toolbar_wkfapp?.is_Admin"\n >\n {{ "SOSTITUISCI UTENTE" | translate }}\n </button>\n <button\n mat-menu-item [hidden]="sRow==null"\n style="background-color: #F5F5F5"\n (click)="reclama_bozza()"\n *ngIf="toolbar_wkfapp?.is_Supervisor || toolbar_wkfapp?.is_Admin"\n >\n {{ "RECLAMA BOZZA" | translate }}\n </button>\n <button\n mat-menu-item\n (click)="test_utente()"\n *ngIf="toolbar_wkfapp?.is_Admin"\n >\n {{ "TEST UTENTE" | translate }}\n </button>\n </mat-menu>\n <button\n mat-flat-button\n (click)="annulla_imp()"\n *ngIf="toolbar_wkfapp?.imp != null && toolbar_wkfapp?.imp != \'\'"\n >\n {{ toolbar_wkfapp?.imp }}\n </button>\n<div>\n <button\n mat-flat-button\n color="accent"\n mat-button\n [matMenuTriggerFor]="gest_menu_custom"\n *ngIf="custom_commands!=null && custom_commands.length>0"\n >\n\t\t\t<mat-icon>menu</mat-icon>\n </button>\n </div>\n <mat-menu #gest_menu_custom="matMenu">\n <div fxLayout="row" style="width:300px" fxLayoutAlign="center center"> \n <div fxLayout="column" fxLayoutGap="8px" fxFlex="100" fxLayoutAlign="center start">\n\t\t\t<ng-container *ngFor="let app of custom_commands">\n\n <div style="width:280px"><button *ngIf="app.type == \'button\'" [hidden]="app.hidden"\n mat-flat-button style="width:96%"\n [color]="app.color"\n (click)="exec_command(app.command)"\n >\n <mat-icon *ngIf="app.icon != null">{{ app.icon }}</mat-icon> {{ app.label | translate }}\n </button></div>\n <div style="width:280px">\n\t\t\t\t <FHCheckBox\n\t\t\t\t\t *ngIf="app.type == \'checkbox\'"\n (change)="selx(app.command, $event)"\n [label]="app.label | translate"\n [(ngModel)]="app.default_value"\n ></FHCheckBox>\n </div>\n <div style="width:280px">\n\t\t\t <FHTableManager *ngIf="app.type == \'table_manager\'" style="width:180px" [application]="app.default_value"></FHTableManager>\n </div>\n\t\t\t</ng-container>\n </div> \n </div>\n </mat-menu>\n </div>\n </mat-toolbar>\n </div>\n <div\n *ngIf="type == \'INSERT_DELETE\' || type == \'INSERT\'"\n fxLayoutGap="3px"\n fxLayout="row"\n fxFlex="100"\n style="height: 70px;"\n fxLayoutAlign="end center"\n >\n <mat-toolbar>\n <div fxLayout="row" fxLayoutGap="5px" fxLayoutAlign="end center">\n <button mat-flat-button (click)="link_doc()" style="background-color: #2B7CD3;color:#FFFFFF" *ngIf="show_link">\n <mat-icon>launch</mat-icon> {{\n "LINK" | translate\n }}\n </button>\n <button mat-flat-button (click)="help_doc()" style="background-color: #2B7CD3;color:#FFFFFF" *ngIf="show_help">\n <mat-icon>help</mat-icon> {{\n help_label | translate\n }}\n </button>\n <div style="width:200px" fxHide fxShow.gt-sm *ngIf="show_link || show_help"></div>\n <button mat-flat-button (click)="new_doc()" color="primary">\n <mat-icon>note_add</mat-icon> {{\n "INSERISCI" | translate\n }}\n </button>\n\n <button\n *ngIf="type == \'INSERT_DELETE\'"\n mat-flat-button\n (click)="del_doc()"\n color="warn"\n >\n <mat-icon>delete</mat-icon> \n {{elimina_label | translate}}\n\n </button>\n <div *ngFor="let app of custom_commands" fxLayout="column" fxLayoutGap="5px">\n <div *ngIf="app.type == \'button\' || app.type == null">\n <button [hidden]="app.hidden!=null && app.hidden"\n mat-flat-button\n [color]="app.color"\n (click)="exec_command(app.command)"\n >\n <mat-icon *ngIf="app.icon != null">{{ app.icon }}</mat-icon\n > {{ app.label | translate }}\n </button>\n </div>\n <div *ngIf="app.type == \'checkbox\'" style="font-size:12px">\n <FHCheckBox\n\n (change)="selx(app.command, $event)"\n [label]="app.label | translate"\n [(ngModel)]="app.default_value"\n ></FHCheckBox>\n </div>\n <div *ngIf="app.type == \'spacer\'" style="width:60px"></div>\n <div *ngIf="app.type == \'table_manager\'">\n <FHTableManager [application]="app.default_value"></FHTableManager>\n </div>\n </div>\n <div [hidden]="!b_wait"><mat-spinner diameter="25"></mat-spinner></div>\n </div>\n </mat-toolbar>\n\n </div>\n <div\n *ngIf="type == \'CUSTOM\'"\n fxLayoutGap="3px"\n fxLayout="row"\n fxFlex="100"\n style="height: 70px;"\n fxLayoutAlign="end center"\n > <button mat-flat-button (click)="link_doc()" style="background-color: #2B7CD3;color:#FFFFFF" *ngIf="show_link">\n <mat-icon>launch</mat-icon> {{\n "LINK" | translate\n }}\n </button>\n <div *ngFor="let app of custom_commands" fxLayoutAlign="end center" fxLayout="row" fxLayoutGap="10px">\n <div *ngIf="app.type == \'button\' || app.type == null">\n <button [hidden]="app.hidden!=null && app.hidden"\n\n mat-flat-button\n [color]="app.color"\n (click)="exec_command(app.command)"\n >\n <mat-icon *ngIf="app.icon != null">{{ app.icon }}</mat-icon\n > {{ app.label | translate }}\n </button>\n </div>\n <div *ngIf="app.type == \'checkbox\'" style="font-size:12px">\n <FHCheckBox\n (change)="selx(app.command, $event)"\n [label]="app.label | translate"\n [(ngModel)]="app.default_value"\n ></FHCheckBox>\n </div>\n <div *ngIf="app.type == \'spacer\'" style="width:60px"></div>\n <div *ngIf="app.type == \'table_manager\'">\n <FHTableManager [application]="app.default_value"></FHTableManager>\n </div>\n </div>\n <div [hidden]="!b_wait"><mat-spinner diameter="25"></mat-spinner></div>\n </div>\n <div\n *ngIf="type == \'CUSTOM_MENU\'"\n fxLayoutGap="3px"\n fxLayout="row"\n fxFlex="100"\n style="height: 70px;"\n fxLayoutAlign="end center"\n >\n <button\n mat-flat-button\n color="warn"\n mat-button\n fxHide\n fxShow.gt-sm\n [matMenuTriggerFor]="gest_menu"\n\n >\n <mat-icon>menu</mat-icon>\n </button>\n <mat-menu #gest_menu="matMenu">\n <div fxLayout="column" fxLayoutGap="6px" style="width:100%">\n <div style="width:100%"><button style="width:100%" mat-flat-button (click)="link_doc()" style="background-color: #2B7CD3;color:#FFFFFF" *ngIf="show_link">\n <mat-icon>launch</mat-icon> {{\n "LINK" | translate\n }}\n </button></div>\n <div *ngFor="let app of custom_commands" fxLayoutAlign="end center" fxLayout="row" fxLayoutGap="10px">\n <div style="width:100%" *ngIf="app.type == \'button\' || app.type == null">\n <button [hidden]="app.hidden!=null && app.hidden"\n style="width:100%"\n mat-flat-button\n [color]="app.color"\n (click)="exec_command(app.command)"\n >\n <mat-icon *ngIf="app.icon != null">{{ app.icon }}</mat-icon\n > {{ app.label | translate }}\n </button>\n </div>\n <div *ngIf="app.type == \'checkbox\'" style="font-size:12px">\n <FHCheckBox\n (change)="selx(app.command, $event)"\n [label]="app.label | translate"\n [(ngModel)]="app.default_value"\n ></FHCheckBox>\n </div>\n <div *ngIf="app.type == \'spacer\'" style="width:60px"></div>\n <div *ngIf="app.type == \'table_manager\'">\n <FHTableManager [application]="app.default_value"></FHTableManager>\n </div>\n </div></div>\n </mat-menu>\n </div>\n <div\n *ngIf="type == \'NONE\' && show_link"\n fxLayoutGap="3px"\n fxLayout="row"\n fxFlex="100"\n style="height: 70px;"\n fxLayoutAlign="end center"\n >\n <button mat-flat-button (click)="link_doc()" style="background-color: #2B7CD3;color:#FFFFFF" *ngIf="show_link">\n <mat-icon>launch</mat-icon> {{\n "LINK" | translate\n }}\n </button>\n\n <button mat-flat-button (click)="help_doc()" style="background-color: #2B7CD3;color:#FFFFFF" *ngIf="show_help">\n <mat-icon>help</mat-icon> {{\n help_label | translate\n }}\n </button>\n\n <div [hidden]="!b_wait"><mat-spinner diameter="25"></mat-spinner></div>\n </div>\n ',styles:["\n\n "]}]}],ci.propDecorators={show_help:[{type:n.Input}],help_label:[{type:n.Input}],show_link:[{type:n.Input}],elimina_label:[{type:n.Input}],b_wait:[{type:n.Input}],type:[{type:n.Input}],toolbar_wkfapp:[{type:n.Input}],custom_commands:[{type:n.Input}],sRow:[{type:n.Input}],command:[{type:n.Output}]};var di=function(){function t(t,e){this.m_appService=t,this._trs=e,this.custom_commands=[],this.dt_agg=null,this.edit_button=!1,this.respingi_button=!1,this.procedi_button=!0,this.utility_button=!0,this.download_button=!0,this.force_save=!1,this.check_on_save=!1,this.command=new n.EventEmitter,this.admin_role="[ZZZ_DIS_CC]",this.sovra_path="",this.edit_comments_in_logs=!0,this.back_lbl="Indietro",this.save_lbl="Salva",this.procedi_lbl="Procedi",this.respingi_lbl="Respingi",this.revisione_lbl="Revisione",this.info_doc_lbl="Info Doc",this.commenti_lbl="Commenti",this.allegati_lbl="Allegati",this.workflow_lbl="Workflow",this.button_clicked=new n.EventEmitter}return t.prototype.exec_command=function(t){this.command.emit({cmd:t})},t.prototype.back=function(){this.button_clicked.emit("back"),null!=this.dt_agg&&this.dt_agg.back(this.edit_button)},t.prototype.evt_salv=function(){this.button_clicked.emit("evt_salv"),null!=this.dt_agg&&this.dt_agg.evt_salv(this.edit_button,this.check_on_save)},t.prototype.respingi=function(){this.button_clicked.emit("respingi"),null!=this.dt_agg&&this.dt_agg.respingi()},t.prototype.procedi=function(){this.button_clicked.emit("procedi"),null!=this.dt_agg&&this.dt_agg.procedi()},t.prototype.open_info=function(){this.button_clicked.emit("open_info"),null!=this.dt_agg&&this.dt_agg.open_info()},t.prototype.open_commenti=function(){this.button_clicked.emit("open_commenti"),null!=this.dt_agg&&this.dt_agg.open_commenti()},t.prototype.open_upload=function(){this.button_clicked.emit("open_upload"),null!=this.dt_agg&&this.dt_agg.open_upload(this.sovra_path,this.admin_role)},t.prototype.open_wkf=function(){this.button_clicked.emit("open_wkf"),null!=this.dt_agg&&this.dt_agg.open_wkf(!1,this.edit_comments_in_logs)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.back_lbl=t._trs.instant("Indietro"),t.save_lbl=t._trs.instant("Salva"),t.procedi_lbl=t._trs.instant("Procedi"),t.respingi_lbl=t._trs.instant("Respingi"),t.revisione_lbl=t._trs.instant("Revisione"),t.info_doc_lbl=t._trs.instant("Info Doc"),t.commenti_lbl=t._trs.instant("Commenti"),t.allegati_lbl=t._trs.instant("Allegati"),t.workflow_lbl=t._trs.instant("Workflow")}))},t}();di.decorators=[{type:n.Component,args:[{selector:"wkf_header_bar",template:'\n <div fxLayout="row" fxLayoutGap.lt-md="8px" fxLayout.lt-md="column">\n <div\n fxLayout="row"\n fxLayoutGap="16px" fxLayoutGap.lt-md="8px"\n *ngIf="\n !m_appService.getState().pageFullscreen ||\n edit_button ||\n respingi_button\n "\n >\n <div>\n <button\n mat-flat-button\n (click)="back()"\n *ngIf="!m_appService.getState().pageFullscreen"\n >\n {{back_lbl}}</button\n ></div><div>\n <button\n mat-flat-button\n (click)="evt_salv()"\n *ngIf="edit_button || force_save"\n color="primary"\n >\n {{save_lbl}}</button\n ></div><div>\n <button\n mat-flat-button\n (click)="procedi()"\n *ngIf="edit_button && procedi_button"\n color="accent"\n >\n {{procedi_lbl}}</button\n ></div><div>\n <button\n mat-flat-button\n (click)="respingi()"\n *ngIf="respingi_button"\n color="warn"\n >\n {{respingi_lbl}}\n </button>\n </div>\n \x3c!-- <button mat-flat-button (click)="doEnd(900)" color="warn" >test</button> \n--\x3e\n </div>\n \n <div\n fxLayout="row"\n fxLayout.xs="column"\n fxLayoutGap="16px"\n fxLayoutGap.xs="3px"\n >\n <div fxLayout="row" fxLayoutGap="16px">\n <div>\n <button\n mat-flat-button\n (click)="open_info()"\n *ngIf="!m_appService.getState().pageFullscreen && utility_button"\n >\n <mat-icon>info_outline</mat-icon> {{info_doc_lbl}}</button\n ></div><div>\n <button\n mat-flat-button *ngIf="utility_button"\n [color]="(dt_agg?.comm_c ? dt_agg?.comm_c : 0 > 0) ? \'accent\' : \'\'"\n [matBadge]="dt_agg?.comm_c ? dt_agg?.comm_c : 0"\n matBadgePosition="before"\n matBadgeColor="primary"\n (click)="open_commenti()"\n >\n <mat-icon>insert_comment</mat-icon>{{commenti_lbl}}</button\n ></div>\n </div>\n <div fxLayout="row" fxLayoutGap="16px">\n <div [hidden]="!download_button">\n <button\n mat-flat-button *ngIf="utility_button"\n [color]="(dt_agg?.all_c ? dt_agg?.all_c : 0 > 0) ? \'accent\' : \'\'"\n [matBadge]="dt_agg?.all_c ? dt_agg?.all_c : 0"\n matBadgePosition="before"\n matBadgeColor="primary"\n (click)="open_upload()"\n >\n <mat-icon>attach_file</mat-icon>{{allegati_lbl}}</button\n ></div><div>\n <button\n mat-flat-button\n (click)="open_wkf()"\n *ngIf="!m_appService.getState().pageFullscreen && utility_button"\n >\n <mat-icon>transfer_within_a_station</mat-icon>{{workflow_lbl}}\n </button>\n </div> </div>\n </div>\n <div\n *ngIf="custom_commands.length > 0"\n fxLayoutGap="10px"\n fxLayout="row"\n fxLayoutAlign="end center"\n >\n <div *ngFor="let app of custom_commands" fxLayout="row"\n fxLayoutGap="5px">\n <div><button [hidden]="app.hidden!=null && app.hidden"\n mat-flat-button\n [color]="app.color"\n (click)="exec_command(app.command)"\n >\n <mat-icon *ngIf="app.icon != null">{{ app.icon }}</mat-icon\n >{{ app.label }}\n </button> </div>\n </div>\n </div>\n </div>\n '}]}],di.ctorParameters=function(){return[{type:wt},{type:p.TranslateService}]},di.propDecorators={custom_commands:[{type:n.Input}],dt_agg:[{type:n.Input}],edit_button:[{type:n.Input}],respingi_button:[{type:n.Input}],procedi_button:[{type:n.Input}],utility_button:[{type:n.Input}],download_button:[{type:n.Input}],force_save:[{type:n.Input}],check_on_save:[{type:n.Input}],command:[{type:n.Output}],admin_role:[{type:n.Input}],sovra_path:[{type:n.Input}],edit_comments_in_logs:[{type:n.Input}],button_clicked:[{type:n.Output}]};var _i=function(){function t(t,e,i){this.fhutility=t,this._dialog=e,this.dragula=i,this.change=new n.EventEmitter,this.items=[],this.edit_obj=null,this.radio_values=""}return t.prototype.add_component=function(t){1==t&&this.items.push({type:"text_field",label:"Label",default_value:"",uiid:this.fhutility.newGuid(),selected:!1,required:!1}),2==t&&this.items.push({type:"numeric_field",label:"Label",default_value:0,decimali:2,uiid:this.fhutility.newGuid(),selected:!1,required:!1}),3==t&&this.items.push({type:"textarea",label:"Label",default_value:"",uiid:this.fhutility.newGuid(),selected:!1,required:!1}),4==t&&this.items.push({type:"checkbox",label:"Label",default_value:"",uiid:this.fhutility.newGuid(),selected:!1,required:!1}),5==t&&this.items.push({type:"radiobutton",label:"Label",default_value:"",opts:["Option1","Option2"],uiid:this.fhutility.newGuid(),selected:!1,required:!1}),6==t&&this.items.push({type:"select",label:"Label",default_value:"",opts:["","Value1","Value2"],uiid:this.fhutility.newGuid(),selected:!1,required:!1}),7==t&&this.items.push({type:"date_field",label:"Label",default_value:null,uiid:this.fhutility.newGuid(),selected:!1,required:!1}),this.change.emit(),this.edit_obj=null},t.prototype.setStyles=function(t){return null!=this.edit_obj&&this.edit_obj.uiid==t?{width:"90%",padding:"15px",margin:"15px",border:"3px solid #3db3cd","background-color":"#C2CACB"}:{width:"90%",padding:"15px",margin:"15px",border:"1px solid #3db3cd","background-color":"#ECF0F1"}},t.prototype.ok_panel=function(){this.change.emit(),this.edit_obj=null},t.prototype.edit_item=function(t){for(var e=0;e<this.items.length;e++)this.items[e].uiid==t&&(this.edit_obj=this.items[e],"radiobutton"!=this.edit_obj.type&&"select"!=this.edit_obj.type||null!=this.edit_obj.opts&&(this.radio_values=this.edit_obj.opts.join(",")))},t.prototype.del_item=function(t){var e=this,i=this._dialog.open(It,{disableClose:!0});setTimeout((function(){i.componentInstance.title="Confirm",i.componentInstance.msg="Remove Element?"})),i.afterClosed().subscribe((function(i){if(i)for(var n=0;n<e.items.length;n++)e.items[n].uiid==t&&(e.items.splice(n,1),e.change.emit(),e.edit_obj=null)}))},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){try{t.dragula.createGroup("bag-items",{revertOnSpill:!0})}catch(t){console.log(t)}t.dragula.drag.call((function(e){t.change.emit(),t.edit_obj=null})),t.dragula.drop.call((function(e){t.change.emit(),t.edit_obj=null}))}))},t}();_i.decorators=[{type:n.Component,args:[{selector:"FHFormBuilder",template:'\n <div fxLayout="row" style="width: 100%;height:100%">\n <mat-toolbar color="primary" style="max-width: 200px;height:100%;">\n <mat-toolbar-row (click)="add_component(1)">\n <mat-icon>text_fields</mat-icon> <span\n >Text Field</span\n >\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(2)">\n <mat-icon>filter_1</mat-icon> <span>Number</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(3)">\n <mat-icon>filter_none</mat-icon> <span\n >Text Area</span\n >\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(4)">\n <mat-icon>check_box</mat-icon> <span>Check Box</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(5)">\n <mat-icon>radio_button_checked</mat-icon> <span\n >Radio</span\n >\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(6)">\n <mat-icon>dehaze</mat-icon> <span>Select</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(7)">\n <mat-icon>today</mat-icon> <span>Date</span>\n </mat-toolbar-row>\n </mat-toolbar>\n <div\n fxLayout="column"\n fxFlex="100"\n style="width:100%;border:1px solid #004040;height:100%;overflow:auto;background-color: #a6aec4"\n >\n <div fxLayout="row" style="width:90%;width:100%;height:5000px;">\n <ul\n [dragula]="\'bag-items\'"\n [(dragulaModel)]="items"\n style="width:100%;"\n >\n <li\n fxLayout="row"\n fxLayoutGap="10px"\n *ngFor="let item of items"\n [ngStyle]="setStyles(item.uiid)"\n fxLayoutAlign="start center"\n >\n <div style="width:100%">\n <div style="width: 90%">\n <mat-form-field\n *ngIf="item.type == \'text_field\'"\n style="max-width: 350px"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ item.label }}</mat-label>\n <input\n matInput\n [required]="item.required"\n type="text"\n [(ngModel)]="item.default_value"\n />\n </mat-form-field>\n\n <mat-form-field\n *ngIf="item.type == \'numeric_field\'"\n style="max-width: 220px"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ item.label }}</mat-label>\n <input\n matInput\n [required]="item.required"\n type="number"\n [(ngModel)]="item.default_value"\n />\n </mat-form-field>\n\n <FHRichText\n *ngIf="item.type == \'textarea\'"\n [label]="item.label"\n [required]="item.required"\n [(ngModel)]="item.default_value"\n height="15\'"\n enabled="false"\n ></FHRichText>\n\n <mat-checkbox\n *ngIf="item.type == \'checkbox\'"\n [required]="item.required"\n [(ngModel)]="item.default_value"\n ><b>{{ item.label }}</b></mat-checkbox\n >\n\n <div fxLayout="row" fxLayoutGap="5px"\n class="custom-section"\n *ngIf="item.type == \'radiobutton\'"\n >\n <label class="custom-margin">{{ item.label }}:</label> \n <mat-radio-group class="fh-radio-group"\n [(ngModel)]="item.default_value"\n [required]="item.required"\n >\n <mat-radio-button class="fh-radio-button"\n *ngFor="let opt of item.opts"\n class="custom-margin"\n value="{{ opt }}"\n ><b>{{ opt }}</b></mat-radio-button\n >\n </mat-radio-group>\n </div>\n\n <mat-form-field\n *ngIf="item.type == \'select\'"\n style="max-width: 400px"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ item.label }}</mat-label>\n <mat-select\n [required]="item.required"\n [(ngModel)]="item.default_value"\n >\n <mat-option\n *ngFor="let opt of item.opts"\n value="{{ opt }}"\n >{{ opt }}</mat-option\n >\n </mat-select>\n </mat-form-field>\n <div style="width: 220px" *ngIf="item.type == \'date_field\'">\n <FHDatePicker\n [required]="item.required"\n [(ngModel)]="item.default_value"\n [label]="item.label"\n ></FHDatePicker\n > \n </div>\n </div>\n </div>\n <div fxLayout="column" style="width:70px" fxLayoutGap="10px">\n <button\n mat-flat-button\n (click)="edit_item(item.uiid)"\n color="primary"\n >\n <mat-icon>edit</mat-icon>\n </button>\n <button\n mat-flat-button\n (click)="del_item(item.uiid)"\n color="warn"\n >\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n </li>\n </ul>\n </div>\n <mat-form-field [hidden]="true">\n <input matInput #bottoml />\n </mat-form-field>\n </div>\n\n <div\n style="width:400px;height:100%;background-color: #3F51B5"\n fxLayoutAlign="start center"\n fxLayout="column"\n *ngIf="edit_obj != null"\n >\n <br /><br />\n <mat-card style="width: 96%">\n <mat-card-title>Properties</mat-card-title>\n <mat-card-content>\n <div fxLayout="column" fxLayoutGap="10px">\n <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>Label</mat-label>\n <input matInput type="text" [(ngModel)]="edit_obj.label" />\n </mat-form-field>\n <mat-checkbox [(ngModel)]="edit_obj.required"\n >Required</mat-checkbox\n >\n\n <mat-form-field\n *ngIf="edit_obj.type == \'numeric_field_tobe\'"\n appearance="outline"\n floatLabel="always"\n ><mat-label>Decimal Places</mat-label>\n <input matInput type="text" [(ngModel)]="edit_obj.decimali" />\n </mat-form-field>\n <mat-form-field\n *ngIf="edit_obj.type == \'text_field\'"\n appearance="outline"\n floatLabel="always"\n ><mat-label>Default Value</mat-label>\n <input\n matInput\n type="text"\n [(ngModel)]="edit_obj.default_value"\n />\n </mat-form-field>\n\n <mat-checkbox\n *ngIf="edit_obj.type == \'checkbox\'"\n [(ngModel)]="edit_obj.default_value"\n >Default Value</mat-checkbox\n >\n\n <mat-form-field\n *ngIf="\n edit_obj.type == \'radiobutton\' || edit_obj.type == \'select\'\n "\n appearance="outline"\n floatLabel="always"\n ><mat-label>Values</mat-label>\n <input\n matInput\n type="text"\n [(ngModel)]="radio_values"\n (ngModelChange)="edit_obj.opts = $event.split(\',\')"\n />\n </mat-form-field>\n <mat-form-field\n *ngIf="\n edit_obj.type == \'radiobutton\' || edit_obj.type == \'select\'\n "\n appearance="outline"\n floatLabel="always"\n ><mat-label>Default Value</mat-label>\n <input\n matInput\n type="text"\n [(ngModel)]="edit_obj.default_value"\n />\n </mat-form-field>\n\n <button mat-flat-button (click)="ok_panel()" color="primary">\n OK\n </button>\n </div></mat-card-content\n >\n </mat-card>\n </div>\n </div>\n ',styles:["\n .fh-radio-group {\n display: flex;\n flex-direction: column;\n margin: 15px 0;\n}\n\n.fh-radio-button {\n margin: 5px;\n}\n\n "]}]}],_i.ctorParameters=function(){return[{type:Ct},{type:e.MatDialog},{type:U.DragulaService}]},_i.propDecorators={change:[{type:n.Output}],bottoml:[{type:n.ViewChild,args:["bottoml"]}]};var hi=function(){function t(t,e,i){this.fhutility=t,this._dialog=e,this.toastr=i,this.items=null,this.enabled=!0}return t.prototype.ck_field_custom=function(){for(var t=0;t<this.items.length;t++)if(this.items[t].required&&(null==this.items[t].default_value&&(this.items[t].default_value=""),""==(""+this.items[t].default_value).trim()))return this.toastr.error("Compilare il campo: "+this.items[t].label),!1;return!0},t.prototype.add_component=function(t){this.items.push(t)},t.prototype.setStyles=function(t){return{width:"90%",padding:"15px",margin:"15px",border:"1px solid #3db3cd","background-color":"#ECF0F1"}},t.prototype.ngAfterViewInit=function(){},t}();hi.decorators=[{type:n.Component,args:[{selector:"FHFormExecuter",template:'\n <div\n fxLayout="column"\n fxFlex="100"\n style="width:100%;border:1px solid #004040;height:100%"\n *ngIf="items != null"\n >\n <div\n fxLayout="row"\n *ngFor="let item of items"\n [ngStyle]="setStyles(item.uiid)"\n fxLayoutAlign="start center"\n >\n <div style="width: 90%">\n <mat-form-field\n *ngIf="item.type == \'text_field\'"\n style="max-width: 350px"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ item.label }}</mat-label>\n <input\n matInput\n [required]="item.required"\n [disabled]="!enabled"\n type="text"\n [(ngModel)]="item.default_value"\n />\n </mat-form-field>\n\n <mat-form-field\n *ngIf="item.type == \'numeric_field\'"\n style="max-width: 220px"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ item.label }}</mat-label>\n <input\n matInput\n [required]="item.required"\n [disabled]="!enabled"\n type="number"\n [(ngModel)]="item.default_value"\n />\n </mat-form-field>\n\n <FHRichText\n *ngIf="item.type == \'textarea\'"\n [label]="item.label"\n [required]="item.required"\n [(ngModel)]="item.default_value"\n height="15\'"\n enabled="false"\n ></FHRichText>\n\n <mat-checkbox\n *ngIf="item.type == \'checkbox\'"\n [required]="item.required"\n [disabled]="!enabled"\n [(ngModel)]="item.default_value"\n ><b>{{ item.label }}</b></mat-checkbox\n >\n\n <div *ngIf="item.type == \'radiobutton\'" fxLayout="row" fxLayoutGap="5px">\n <label *ngIf="!item.required">{{ item.label }}: </label> \n <label *ngIf="item.required">{{ item.label }}: *</label> \n <mat-radio-group\n [(ngModel)]="item.default_value"\n [required]="item.required" class="fh-radio-group"\n >\n <mat-radio-button\n *ngFor="let opt of item.opts"\n [disabled]="!enabled"\n class="custom-margin" class="fh-radio-button"\n value="{{ opt }}"\n ><b>{{ opt }}</b\n > </mat-radio-button\n >\n </mat-radio-group>\n </div>\n\n <mat-form-field\n *ngIf="item.type == \'select\'"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ item.label }}</mat-label>\n <mat-select\n [required]="item.required"\n [(ngModel)]="item.default_value"\n >\n <mat-option\n *ngFor="let opt of item.opts"\n [disabled]="!enabled"\n value="{{ opt }}"\n >{{ opt }}</mat-option\n >\n </mat-select>\n </mat-form-field>\n <div style="width: 220px" *ngIf="item.type == \'date_field\'">\n <FHDatePicker\n [required]="item.required"\n [disabled]="!enabled"\n [(ngModel)]="item.default_value"\n [label]="item.label"\n ></FHDatePicker\n > \n </div>\n </div>\n </div>\n\n <mat-form-field [hidden]="true">\n <input matInput #bottoml />\n </mat-form-field>\n </div>\n ',styles:[" .fh-radio-group {\n display: flex;\n flex-direction: column;\n margin: 15px 0;\n }\n\n .fh-radio-button {\n margin: 5px;\n }"]}]}],hi.ctorParameters=function(){return[{type:Ct},{type:e.MatDialog},{type:i.ToastrService}]},hi.propDecorators={items:[{type:n.Input}],enabled:[{type:n.Input}],bottoml:[{type:n.ViewChild,args:["bottoml"]}]};var mi=function(){function t(t,e){this.dialogRef=t,this.data=e,this.title="",this.button_config=[],this.show_close=!0,null!=e&&(null!=e.button_config&&(this.button_config=e.button_config),null!=e.title&&(this.title=e.title),null!=e.show_close&&(this.show_close=e.show_close))}return t.prototype.ngAfterViewInit=function(){},t.prototype.open=function(t){this.dialogRef.close(t)},t.prototype.close=function(){this.dialogRef.close(null)},t}();mi.decorators=[{type:n.Component,args:[{selector:"app-win_ask_buttons",template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{ title }}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <mat-dialog-content style="font-size: 15px;">\n <div fxLayout="row" fxLayoutAlign="center center">\n <button\n mat-flat-button\n style="font-size: 18px;color:#FFFFFF;"\n *ngFor="let app of button_config"\n (click)="open(app)"\n [style.background-color]="app.color"\n >\n {{ app.label }}</button\n > \n </div>\n </mat-dialog-content>\n <br *ngIf="show_close" /><br *ngIf="show_close" />\n <div style="width:100%;text-align:center;" *ngIf="show_close">\n <button mat-flat-button color="accent" (click)="close()">{{\'CHIUDI\' | translate}}</button>\n </div>\n</div>\n '}]}],mi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},mi.propDecorators={title:[{type:n.Input}],button_config:[{type:n.Input}],show_close:[{type:n.Input}]};var fi=function(){function t(t){this.dialogRef=t,this.imageIndex=0,this.images=[]}return t.prototype.ngAfterViewInit=function(){},t}();fi.decorators=[{type:n.Component,args:[{template:'\n \x3c!-- <ngx-image-viewer [src]="images" [(index)]="imageIndex"></ngx-image-viewer>--\x3e\n\n <mat-dialog-actions>\n <button mat-flat-button (click)="dialogRef.close(\'\')">{{\'CHIUDI\' | translate}}</button>\n </mat-dialog-actions>\n ',styles:[""]}]}],fi.ctorParameters=function(){return[{type:e.MatDialogRef}]};var gi=function(){function t(){this._preview=!1,this._preview_c=!1,this.m_preview=!1,this.m_init=!1,this.config={btnClass:"default",zoomFactor:.1,containerBackgroundColor:"#ccc",wheelZoom:!0,allowFullscreen:!1,allowKeyboardNavigation:!0,btnIcons:{zoomIn:"fa fa-plus",zoomOut:"fa fa-minus",rotateClockwise:"fa fa-repeat",rotateCounterClockwise:"fa fa-undo",next:"fa fa-arrow-right",prev:"fa fa-arrow-left",fullscreen:"fa fa-arrows-alt"},btnShow:{zoomIn:!1,zoomOut:!1,rotateClockwise:!1,rotateCounterClockwise:!1,next:!1,prev:!1}},this.notfullScreenEvent=new n.EventEmitter,this.fullScreenEvent=new n.EventEmitter,this._u=null,this.already_open=!1,this.config_photo_big={btnClass:"default",zoomFactor:.1,containerBackgroundColor:"#ccc",wheelZoom:!0,allowFullscreen:!0,allowKeyboardNavigation:!0,btnIcons:{zoomIn:"fa fa-plus",zoomOut:"fa fa-minus",rotateClockwise:"fa fa-repeat",rotateCounterClockwise:"fa fa-undo",next:"fa fa-arrow-right",prev:"fa fa-arrow-left",fullscreen:"fa fa-arrows-alt"},btnShow:{zoomIn:!0,zoomOut:!0,rotateClockwise:!0,rotateCounterClockwise:!0,next:!0,prev:!0}}}return t.prototype.toggle_up=function(){this.m_preview=!1,this.photo_c.src=[],this.photo_c.src.push(this._u.image_original[0]),this.config=this.config_photo_big,this.already_open=!0},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.init()}))},t.prototype.openFullscreen=function(){this.elem=this.photo_c.imgx.nativeElement,this.elem.requestFullscreen?this.elem.requestFullscreen():this.elem.mozRequestFullScreen?this.elem.mozRequestFullScreen():this.elem.webkitRequestFullscreen?this.elem.webkitRequestFullscreen():this.elem.msRequestFullscreen?this.elem.msRequestFullscreen():console.log("no full!")},t.prototype.closeFullscreen=function(){try{this.elem="undefined"!=typeof window&&void 0!==window.document?window.document:{},console.log("closeFullscreen ",this.elem),this.elem.exitFullscreen?(console.log("exitFullscreen"),this.elem.exitFullscreen()):this.elem.mozCancelFullScreen?(console.log("mozCancelFullScreen"),this.elem.mozCancelFullScreen()):this.elem.webkitExitFullscreen?(console.log("webkitExitFullscreen"),this.elem.webkitExitFullscreen()):this.elem.webkitCancelFullScreen?(console.log("webkitExitFullscreen"),this.elem.webkitCancelFullScreen()):this.elem.msExitFullscreen?(console.log("msExitFullscreen"),this.elem.msExitFullscreen()):console.log("no exit!")}catch(t){this.openFullscreen()}},t.prototype.raise_fullScreenEvent=function(){this.fullScreenEvent.emit(),this.openFullscreen(),null!=this._u&&null!=this._u.image_thumbnail&&this._u.image_thumbnail.length>0&&this.m_preview&&this.toggle_up()},t.prototype.handleEvent=function(t){},Object.defineProperty(t.prototype,"preview",{get:function(){return this._preview},set:function(t){this._preview=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"u",{get:function(){return this._u},set:function(t){this._u=t,this.init()},enumerable:!1,configurable:!0}),t.prototype.init=function(){this._preview_c=!1,null!=this._u&&null!=this._u.image_thumbnail&&(null==this._u.image_original&&(this._u.image_original=this._u.image_thumbnail),this._u.image_thumbnail.length>0&&(this._u.image_thumbnail[0]!=this._u.image_original[0]&&(this._preview_c=!0),this.m_init=!0,this.m_preview=this._preview_c))},t}();gi.decorators=[{type:n.Component,args:[{selector:"fh-image-viewer",template:'\n <image-viewer\n [hidden]="!m_init"\n (init)="init()"\n [preview]="m_preview"\n (notfullScreenEvent)="closeFullscreen()"\n (fullScreenEvent)="raise_fullScreenEvent()"\n [config]="config_photo_big"\n #photo_c\n [src]="_u?.image_thumbnail"\n index="0"\n ></image-viewer>\n ',styles:[""]}]}],gi.propDecorators={notfullScreenEvent:[{type:n.Output}],fullScreenEvent:[{type:n.Output}],photo_c:[{type:n.ViewChild,args:["photo_c"]}],preview:[{type:n.Input}],u:[{type:n.Input}]};var vi=function(t,e){this.name=t,this.imageIndex=e},yi={btnClass:"default",zoomFactor:.1,containerBackgroundColor:"#ccc",wheelZoom:!1,allowFullscreen:!0,allowKeyboardNavigation:!0,btnShow:{zoomIn:!0,zoomOut:!0,rotateClockwise:!0,rotateCounterClockwise:!0,next:!0,prev:!0},btnIcons:{zoomIn:"fa fa-plus",zoomOut:"fa fa-minus",rotateClockwise:"fa fa-repeat",rotateCounterClockwise:"fa fa-undo",next:"fa fa-arrow-right",prev:"fa fa-arrow-left",fullscreen:"fa fa-arrows-alt"}},bi=function(){function t(t,e){this.moduleConfig=t,this.sanitizer=e,this.index=0,this.preview=!1,this.indexChange=new n.EventEmitter,this.configChange=new n.EventEmitter,this.customEvent=new n.EventEmitter,this.style={transform:"",msTransform:"",oTransform:"",webkitTransform:""},this.fullscreen=!1,this.loading=!0,this.scale=1,this.rotation=0,this.translateX=0,this.translateY=0,this.hovered=!1,this.notfullScreenEvent=new n.EventEmitter,this.fullScreenEvent=new n.EventEmitter}return t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){var e=t.mergeConfig(yi,t.moduleConfig);t.config=t.mergeConfig(e,t.config),t.triggerConfigBinding()}))},t.prototype.nextImage=function(t){console.log("this.src.length ",this.src.length),this.index<this.src.length-1&&(this.loading=!0,this.index++,this.triggerIndexBinding(),this.reset())},t.prototype.prevImage=function(t){this.index>0&&(this.loading=!0,this.index--,this.triggerIndexBinding(),this.reset())},t.prototype.zoomIn=function(){this.scale*=1+this.config.zoomFactor,this.updateStyle()},t.prototype.zoomOut=function(){this.scale>this.config.zoomFactor&&(this.scale/=1+this.config.zoomFactor),this.updateStyle()},t.prototype.scrollZoom=function(t){if(this.config.wheelZoom)return t.deltaY>0?this.zoomOut():this.zoomIn(),!1},t.prototype.rotateClockwise=function(){this.rotation+=90,this.updateStyle()},t.prototype.rotateCounterClockwise=function(){this.rotation-=90,this.updateStyle()},t.prototype.onLoad=function(){this.loading=!1},t.prototype.onLoadStart=function(){this.loading=!0},t.prototype.onDragOver=function(t){this.translateX+=t.clientX-this.prevX,this.translateY+=t.clientY-this.prevY,this.prevX=t.clientX,this.prevY=t.clientY,this.updateStyle()},t.prototype.onDragStart=function(t){t.dataTransfer&&t.dataTransfer.setDragImage&&t.dataTransfer.setDragImage(t.target.nextElementSibling,0,0),this.prevX=t.clientX,this.prevY=t.clientY},t.prototype.toggleFullscreen=function(){this.fullscreen=!this.fullscreen,this.fullscreen?this.fullScreenEvent.emit():this.notfullScreenEvent.emit(),this.fullscreen||this.reset()},t.prototype.triggerIndexBinding=function(){this.indexChange.emit(this.index)},t.prototype.triggerConfigBinding=function(){this.configChange.next(this.config)},t.prototype.fireCustomEvent=function(t,e){this.customEvent.emit(new vi(t,e))},t.prototype.reset=function(){this.scale=1,this.rotation=0,this.translateX=0,this.translateY=0,this.updateStyle()},t.prototype.canNavigate=function(t){return null==t||this.config.allowKeyboardNavigation&&this.hovered},t.prototype.updateStyle=function(){this.style.transform="translate("+this.translateX+"px, "+this.translateY+"px) rotate("+this.rotation+"deg) scale("+this.scale+")",this.style.msTransform=this.style.transform,this.style.webkitTransform=this.style.transform,this.style.oTransform=this.style.transform},t.prototype.mergeConfig=function(t,e){var i=Object.assign({},t);return e&&(i=Object.assign(Object.assign({},t),e),e.btnIcons&&(i.btnIcons=Object.assign(Object.assign({},t.btnIcons),e.btnIcons))),i},t}();bi.decorators=[{type:n.Component,args:[{selector:"image-viewer",template:'<div\n #imgx\n class="img-container"\n [style.backgroundColor]="config.containerBackgroundColor"\n (wheel)="scrollZoom($event)"\n (dragover)="onDragOver($event)"\n *ngIf="src != null"\n>\n <img\n [src]="src[index]"\n [style.transform]="style.transform | safe: \'style\'"\n [style.msTransform]="style.transform | safe: \'style\'"\n style="min-height: 280px;"\n [style.webkitTransform]="style.transform | safe: \'style\'"\n [style.oTransform]="style.transform | safe: \'style\'"\n alt="Image not found..."\n (dragstart)="onDragStart($event)"\n (load)="onLoad()"\n (loadstart)="onLoadStart()"\n />\n \x3c!-- Div below will be used to hide the \'ghost\' image when dragging --\x3e\n <div></div>\n <div class="spinner-container" *ngIf="loading">\n <div class="spinner"></div>\n </div>\n <button\n type="button"\n [class]="config.btnClass"\n *ngIf="config.btnShow.rotateCounterClockwise && !preview"\n (click)="rotateCounterClockwise()"\n >\n <span [class]="config.btnIcons.rotateCounterClockwise"></span>\n </button>\n <button\n type="button"\n [class]="config.btnClass"\n *ngIf="config.btnShow.rotateClockwise && !preview"\n (click)="rotateClockwise()"\n >\n <span [class]="config.btnIcons.rotateClockwise"></span>\n </button>\n\n <button\n type="button"\n [class]="config.btnClass"\n *ngIf="config.btnShow.zoomOut && !preview"\n (click)="zoomOut()"\n >\n <span [class]="config.btnIcons.zoomOut"></span>\n </button>\n <button\n type="button"\n [class]="config.btnClass"\n *ngIf="config.btnShow.zoomIn && !preview"\n (click)="zoomIn()"\n >\n <span [class]="config.btnIcons.zoomIn"></span>\n </button>\n\n <button\n type="button"\n id="ngx-fs-btn"\n [class]="config.btnClass"\n (click)="toggleFullscreen()"\n *ngIf="config.allowFullscreen"\n >\n <span [class]="config.btnIcons.fullscreen"></span>\n </button>\n\n <div class="nav-button-container" *ngIf="src?.length > 1">\n <button\n type="button"\n [class]="config.btnClass"\n (click)="prevImage($event)"\n [disabled]="index === 0"\n >\n <span [class]="config.btnIcons.prev"></span>\n </button>\n <button\n type="button"\n [class]="config.btnClass"\n (click)="nextImage($event)"\n [disabled]="index === src?.length - 1"\n >\n <span [class]="config.btnIcons.next"></span>\n </button>\n </div>\n</div>\n',styles:[".img-container{height:100%;overflow:hidden;position:relative;width:100%}.img-container img{display:block;margin:0 auto;max-height:100%;max-width:100%;z-index:2}.img-container button{position:absolute;right:15px;z-index:99}.img-container button:not(:disabled){cursor:pointer}.img-container>button:first-of-type:not(#ngx-fs-btn){bottom:15px}.img-container>button:nth-of-type(2):not(#ngx-fs-btn){bottom:65px}.img-container>button:nth-of-type(3):not(#ngx-fs-btn){bottom:115px}.img-container>button:nth-of-type(4):not(#ngx-fs-btn){bottom:165px}.img-container>button:nth-of-type(5):not(#ngx-fs-btn){bottom:215px}.img-container>button:nth-of-type(6):not(#ngx-fs-btn){bottom:265px}.img-container>button:nth-of-type(7):not(#ngx-fs-btn){bottom:315px}#ngx-fs-btn{top:15px}button.default{background-color:#fff;border:1px solid #555;border-radius:50%;height:40px;opacity:.7;transition:opacity .2s;width:40px}button.default:hover{opacity:1}button.default:disabled{opacity:.25}.nav-button-container>button{margin:0 10px;position:relative;right:0}.nav-button-container{bottom:10px;left:0;position:absolute;right:0;text-align:center;z-index:98}.spinner-container{background-color:rgba(0,0,0,.4);border-radius:25%;bottom:0;height:60px;left:0;margin:auto;padding:10px;position:absolute;right:0;top:0;width:60px}.spinner{animation:rotation 2s linear infinite;border:7px solid;border-color:#ccc #ccc #222;border-radius:50%;box-sizing:border-box;height:100%;width:100%}@keyframes rotation{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(359deg)}}"]}]}],bi.ctorParameters=function(){return[{type:void 0,decorators:[{type:n.Optional},{type:n.Inject,args:["config"]}]},{type:a.DomSanitizer}]},bi.propDecorators={src:[{type:n.Input}],index:[{type:n.Input}],preview:[{type:n.Input}],config:[{type:n.Input}],indexChange:[{type:n.Output}],configChange:[{type:n.Output}],customEvent:[{type:n.Output}],imgx:[{type:n.ViewChild,args:["imgx"]}],notfullScreenEvent:[{type:n.Output}],fullScreenEvent:[{type:n.Output}],nextImage:[{type:n.HostListener,args:["window:keyup.ArrowRight",["$event"]]}],prevImage:[{type:n.HostListener,args:["window:keyup.ArrowLeft",["$event"]]}]};var wi=function(){function t(t){this.sanitizer=t}return t.prototype.transform=function(t,e){switch(e){case"html":return this.sanitizer.bypassSecurityTrustHtml(t);case"style":return this.sanitizer.bypassSecurityTrustStyle(t);case"script":return this.sanitizer.bypassSecurityTrustScript(t);case"url":return this.sanitizer.bypassSecurityTrustUrl(t);case"resourceUrl":return this.sanitizer.bypassSecurityTrustResourceUrl(t);default:throw new Error("Invalid safe type specified: "+e)}},t}();wi.decorators=[{type:n.Pipe,args:[{name:"safe"}]}],wi.ctorParameters=function(){return[{type:a.DomSanitizer}]};var Si={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Ii})),multi:!0},Ii=function(){function t(t){this.m_dialog=t,this.sql="",this.types=new Array,this.values=new Array,this.hidden=!1,this.only_in_list=!0,this.single_sel=!1,this.label="",this.enabled=!0,this.required=!1,this.db_type="1",this.separator=",",this.value="",this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.setv=function(){var t=this;setTimeout((function(){t.writeValue(t.value)}),70)},t.prototype.resetValue=function(){this.value="",this.writeValue(this.value)},t.prototype.writeValue=function(t){this.value=t,this.onChange(this.value)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.focus=function(){},t.prototype.open_pick_list=function(){var t=this,e=this.m_dialog.open(He,{disableClose:!0,data:{single_sel:this.single_sel,sel_values:this.value,separator:this.separator,label:this.label,sql:this.sql,types:this.types,values:this.values}});setTimeout((function(){})),e.afterClosed().subscribe((function(e){if(null==e||""==e);else{t.value="";for(var i=0;i<e.length;i++)""!=t.value&&(t.value+=t.separator),t.value+=e[i].descrizione_valore,t.writeValue(t.value)}}))},t.prototype.ngAfterViewInit=function(){},t}();Ii.decorators=[{type:n.Component,args:[{providers:[Si],selector:"FHFieldPickList",template:'\n <div\n fxLayout="row" [hidden]="!enabled || hidden"\n fxFlex="100"\n fxLayoutAlign="start center"\n fxLayoutGap="10px"\n >\n <div fxFlex fxLayout="row">\n <mat-form-field appearance="outline" floatLabel="always" [class.fh_field]="enabled"\n ><mat-label>{{ label }}</mat-label>\n <input\n type="text"\n #el1\n matInput\n [readonly]="only_in_list"\n [(ngModel)]="value"\n [required]="required" (ngModelChange)="setv()"\n />\n </mat-form-field>\n </div>\n\n <div fxLayout="row" fxLayoutGap="3px">\n <button\n mat-flat-button\n color="primary"\n (click)="open_pick_list()"\n\n >\n SELEZIONA\n </button>\n <button\n mat-flat-button\n color="warn"\n (click)="resetValue()"\n\n >\n RESET\n </button>\n </div>\n </div>\n <mat-form-field appearance="outline" [hidden]="enabled || hidden" floatLabel="always" [class.fh_field_dis]="!enabled"\n ><mat-label>{{ label }}</mat-label>\n <input\n type="text" [matTooltip]="value"\n\n matInput [disabled]="true"\n\n [(ngModel)]="value"\n />\n </mat-form-field>\n ',styles:[""]}]}],Ii.ctorParameters=function(){return[{type:e.MatDialog}]},Ii.propDecorators={sql:[{type:n.Input}],types:[{type:n.Input}],values:[{type:n.Input}],hidden:[{type:n.Input}],only_in_list:[{type:n.Input}],single_sel:[{type:n.Input}],label:[{type:n.Input}],enabled:[{type:n.Input}],required:[{type:n.Input}],db_type:[{type:n.Input}],separator:[{type:n.Input}],value:[{type:n.Input}]};var xi=function(){function t(t,e,i,n){this.dialogRef=t,this.toastr=e,this.m_appService=i,this._dataService=n,this.label="",this.sql="",this.title="Modifica Valori Tabella",this.single_sel=!1,this.sel_values="",this.valoris=[],this.id_tipo=-1,this.nValori={}}return t.prototype.delete_uassoc=function(t){var e=this,i=new vt;i.sql="DELETE_VALORI",i.types=["int"],i.values=[t.id_valore],this._dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.ref_user_list()}))},t.prototype.update_tassoc_ins=function(t){var e=this,i=new vt;i.sql="INSERT_UPDATE_VALORI",i.types=["int","int","string","int","string","int","string","string"],i.values=[t.id_valore,t.valore,t.descrizione,this.id_tipo,"","0","",""],this._dataService.doQuery(i).subscribe((function(i){null!=i&&"OK"==i.result_msg&&(e.toastr.info("INFO","VALORE INSERITO"),t.descrizione="",e.ref_user_list())}))},t.prototype.update_tassoc=function(t){var e=this,i=new vt;i.sql="INSERT_UPDATE_VALORI",i.types=["int","int","string","int","string","int","string","string"],i.values=[t.id_valore,t.valore,t.descrizione,this.id_tipo,t.v1,t.v2,t.v3,t.lingua],this._dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.toastr.info("INFO","VALORE AGGIORNATO")}))},t.prototype.ref_user_list=function(){var t=this,e=new vt;e.sql="SELECT_VALORI_BY_ID",e.types=["int"],e.values=[this.id_tipo],this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.valoris=e.result_data,t.nValori.valore=t.valoris.length+1)}))},t.prototype.ok=function(){},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.nValori=new Object,t.nValori.descrizione="",t.nValori.v1=null,t.nValori.v2=null,t.nValori.id_valore=-1,t.nValori.v3=null,t.nValori.lingua=null,t.ref_user_list()}))},t}();xi.decorators=[{type:n.Component,args:[{selector:"win_manage_values",template:'\n<div fxLayout="column">\n <div fxFlex="100" fxLayout="row" class="dialog_header"> \n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{ title }}</div> \n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="dialogRef.close(null)" /> \n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n\n\t<mat-dialog-content>\n\t<mat-card>\n\t\t\t\t\t\t\t\t<mat-card-content>\n\t\t\t\t\t\t\t\t<div fxLayout="column" fxLayoutGap="10px">\n\n\n <div fxLayout="row" style="width: 90%" fxLayoutAlign="start center" fxLayoutGap="10px">\n <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>Descrizione</mat-label>\n <input\n matInput\n [(ngModel)]="nValori.descrizione"\n style="min-width:500px"\n />\n </mat-form-field> \n <div>\n <button\n mat-flat-button\n color="primary"\n (click)="update_tassoc_ins(nValori)"\n >\n Inserisci\n </button>\n </div>\n </div>\n <div fxLayout="column">\n <div fxLayout="column" style="overflow:auto;height:500px">\n <table style="width: 90%" class="fh_table">\n <thead>\n <tr>\n <th style="width:70%;">Descrizione</th>\n <th style="width:5%;">V1</th>\n <th style="width:5%;">V2</th>\n <th style="width:5%;">V3</th>\n <th style="width:10%;">Lingua</th>\n <th style="width:5%;"></th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="let u of valoris; let odd = odd; let even = even"\n [ngClass]="{ odd: odd, even: even }"\n >\n <td style="width:70%;">\n <mat-form-field appearance="outline" floatLabel="always">\n <input\n matInput\n [(ngModel)]="u.descrizione"\n (focusout)="update_tassoc(u)"\n />\n </mat-form-field>\n </td>\n <td style="width:5%;">\n <mat-form-field appearance="outline" floatLabel="always">\n <input\n matInput\n type="text"\n [(ngModel)]="u.v1"\n (focusout)="update_tassoc(u)"\n />\n </mat-form-field>\n </td>\n <td style="width:5%;">\n <mat-form-field appearance="outline" floatLabel="always">\n <input\n matInput\n type="text"\n [(ngModel)]="u.v2"\n (focusout)="update_tassoc(u)"\n />\n </mat-form-field>\n </td>\n <td style="width:5%;">\n <mat-form-field appearance="outline" floatLabel="always">\n <input\n matInput\n type="text"\n [(ngModel)]="u.v3"\n (focusout)="update_tassoc(u)"\n />\n </mat-form-field>\n </td>\n <td style="width:10%;">\n <mat-form-field appearance="outline" floatLabel="always">\n <input\n matInput\n type="text"\n [(ngModel)]="u.lingua"\n (focusout)="update_tassoc(u)"\n />\n </mat-form-field>\n </td>\n <td style="width:5%;">\n <a mat-icon-button (click)="delete_uassoc(u)">\n <mat-icon>delete</mat-icon>\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n\n </div>\n </div>\n\n</mat-card-content>\n </mat-card>\n</mat-dialog-content><br>\n\n</div>\n\n ',styles:[" .mat-dialog-content { max-height: unset !important; }\n\n"]}]}],xi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:wt},{type:Dt}]};var Oi=function(){function t(t,e,i){this._dataService=t,this.app=e,this._dialog=i,this.application="",this.b_init=!1}return t.prototype.edit_values=function(){var t=this;if("-1"!=this.cmb_sel.getValue()){var e=this._dialog.open(xi,{width:"90%",height:"650px"});setTimeout((function(){e.componentInstance.id_tipo=Number(t.cmb_sel.getValue())})),e.afterClosed().subscribe((function(t){}))}},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){""!=t.application&&(t.cmb_sel.sql="SELECT_TABLE_MANAGEMENT",t.cmb_sel.types=["string"],t.cmb_sel.values=[t.application],t.cmb_sel.fillCombo(),t.b_init=!0)}))},t}();Oi.decorators=[{type:n.Component,args:[{selector:"FHTableManager",template:'\n <div\n [hidden]="!b_init"\n fxLayout="row"\n fxLayoutAlign="start center"\n fxLayoutGap="6px"\n style="font-size:12px"\n >\n <FHComboBox\n #cmb_sel\n sql="SELECT_TABLE_MANAGEMENT"\n label="Gestisci Tabella:"\n init_fill="false" (selchange)="edit_values()"\n ></FHComboBox>\n\n </div>\n ',styles:[""]}]}],Oi.ctorParameters=function(){return[{type:Dt},{type:wt},{type:e.MatDialog}]},Oi.propDecorators={application:[{type:n.Input}],cmb_sel:[{type:n.ViewChild,args:["cmb_sel"]}]};var Ei=function(){function t(t,e,i,n){this.dialogRef=t,this.toastr=e,this._dataService=n,this.label="",this.sql="",this.single_sel=!1,this.sel_values="",this.role_id=-1,this.users=[],this.m_appService=i}return t.prototype.ok=function(){},t.prototype.add_assoc=function(){var t=this;if(console.log(this.autoc.getValue()),""!=this.autoc.getValue()){var e=new vt;e.sql="INSERT_UPDATE_ASSOC_ROLE_USER",e.types=["string","int"],e.values=[this.autoc.getValue(),this.role_id],this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.ref_user_list()}))}},t.prototype.delete_uassoc=function(t){var e=this,i=new vt;i.sql="DELETE_ASSOC_ROLE_USER",i.types=["string","int"],i.values=[t.username,this.role_id];this._dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(!0,e.ref_user_list())}),(function(t){}))},t.prototype.ref_user_list=function(){var t=this,e=new vt;e.sql="SELECT_USERS_BY_IDROLE",e.types=["int"],e.values=[this.role_id],this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.users=e.result_data,t.autoc.types=["int"],t.autoc.values=[t.role_id],t.autoc.fillCombo(),t.autoc.resetValue())}))},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.ref_user_list()}))},t}();Ei.decorators=[{type:n.Component,args:[{selector:"win_manage_roles",template:'\n <div fxLayout="column" style="height: 520px">\n <div fxLayout="row" style="width: 90%">\n <div style="width:100%" fxLayout="row" fxAlign="start center">\n <b>Seleziona per associare utente:</b\n > \n <div style="width:100%">\n <FHAutoComplete\n sql="SELECT_NOT_USERS_BY_IDROLE"\n #autoc\n [init_fill]="false"\n (selchange)="add_assoc()"\n label="Add user"\n ></FHAutoComplete>\n </div>\n </div>\n </div>\n <div fxLayout="column" style="overflow-y: scroll;height:100%;">\n <div fxLayout="column" style="overflow-y: scroll;height:420px;">\n <table style="min-width:60%">\n <tr>\n <td>\n <div\n style="overflow-y: auto;"\n fxLayout="row"\n fxLayoutAlign="center start"\n [style.height]="m_appService.getState().body_height3"\n >\n <br />\n <section class="bs">\n <table style="min-width: 600px" class="fh_table">\n <thead>\n <tr>\n <th>Utente</th>\n\n <th style="width: 60px" class="actions"></th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="\n let u of users;\n let odd = odd;\n let even = even\n "\n [ngClass]="{ odd: odd, even: even }"\n >\n <td>{{ u.cognome }} {{ u.nome }}</td>\n\n <td style="text-align: center;">\n <a mat-icon-button (click)="delete_uassoc(u)">\n <mat-icon>delete</mat-icon>\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n </section>\n </div>\n </td>\n </tr>\n </table>\n </div>\n </div>\n <div fxLayout="row" fxLayoutAlign="center center" style="width: 100%">\n <button mat-flat-button color="warn" (click)="dialogRef.close(\'\')">\n CHIUDI\n </button>\n </div>\n </div>\n '}]}],Ei.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:wt},{type:Dt}]},Ei.propDecorators={autoc:[{type:n.ViewChild,args:["autoc"]}]};var Ai=function(){function t(t,e,i){this._dataService=t,this.app=e,this._dialog=i,this.application="",this.b_init=!1}return t.prototype.edit_values=function(){var t=this;if("-1"!=this.cmb_sel.getValue()){var e=this._dialog.open(Ei,{width:"90%",height:"550px"});setTimeout((function(){e.componentInstance.role_id=Number(t.cmb_sel.getValue())})),e.afterClosed().subscribe((function(t){}))}},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){""!=t.application&&(t.cmb_sel.sql="SELECT_APP_USER_MANAGEMENT",t.cmb_sel.types=["string"],t.cmb_sel.values=[t.application],t.cmb_sel.fillCombo(),t.b_init=!0)}))},t}();Ai.decorators=[{type:n.Component,args:[{selector:"FHRoleManager",template:'\n <div\n [hidden]="!b_init"\n fxLayout="row"\n fxLayoutAlign="start center"\n fxLayoutGap="6px"\n >\n <FHComboBox\n #cmb_sel\n sql="SELECT_APP_USER_MANAGEMENT"\n label="Gestisci Ruoli:"\n init_fill="false"\n ></FHComboBox\n > \n <button mat-flat-button (click)="edit_values()" color="primary">\n Modifica\n </button>\n </div>\n ',styles:[""]}]}],Ai.ctorParameters=function(){return[{type:Dt},{type:wt},{type:e.MatDialog}]},Ai.propDecorators={application:[{type:n.Input}],cmb_sel:[{type:n.ViewChild,args:["cmb_sel"]}]};var Ci=function(){function t(t,e){this._dataService=t,this._dataService_odbc=e,this.init_fill=!0,this.sql="",this.types=new Array,this.values=new Array,this.hidden=!1,this.label="",this.enabled=!0,this.required=!1,this.sel_label="",this.fillend=new n.EventEmitter,this.selchange=new n.EventEmitter,this.initend=new n.EventEmitter,this.myData=[],this.valDef="-1",this.selval="-1",this.errorMsg="",this.db_type="1",this.dis_value="",this.descri_val=""}return t.prototype.update_dis=function(){this.dis_value="";try{if(null!=this.descri_val&&""!=this.descri_val)return void(this.dis_value=this.descri_val);null==this.valDef?this.dis_value="":this.dis_value=this.valDef.split("-1").join("")}catch(t){console.log("errore split -> this.valDef ",this.valDef)}},t.prototype.resetValue=function(){this.selval="-1",this.valDef="-1",this.update_dis()},t.prototype.focus=function(){this.smtr.nativeElement.focus()},t.prototype.reset=function(){this.selval="-1",this.valDef="-1",this.myData=new Array,this.update_dis()},t.prototype.fillCombo=function(){var t=this;if(null==this.sql&&(this.sql=""),-1==this.sql.indexOf("|")||-1==this.sql.indexOf("$")){var e=new vt;e.sql=this.sql,e.types=this.types,e.values=this.values;"1"==this.db_type&&this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.resetD(e.result_data)}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+t.sql+"]"})),"2"==this.db_type&&this._dataService_odbc.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=0;i<e.result_data.length;i++)null!=e.result_data[i].VALORE&&(e.result_data[i].valore=e.result_data[i].VALORE),null!=e.result_data[i].DESCRIZIONE_VALORE&&(e.result_data[i].descrizione_valore=e.result_data[i].DESCRIZIONE_VALORE);t.resetD(e.result_data),!0}}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+t.sql+"]"}))}else this.set_options(this.sql)},t.prototype.add_option=function(t){this.myData.push(t)},t.prototype.resetD=function(t){this.myData=t,this.selval="-1",this.setByValue(this.valDef),"-1"==this.getValue()&&"-1"!=this.valDef&&this.setByDescri(this.valDef),this.fillend.emit()},t.prototype.setByDescri=function(t){if(this.valDef=t,this.selval="-1",""!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){for(var e=0;e<this.myData.length;e++)if(this.myData[e].descrizione_valore==t)return this.selval=""+this.myData[e].valore,null!=this.myData[e].descrizione_valore&&(this.descri_val=this.myData[e].descrizione_valore),void this.update_dis();this.update_dis()}},t.prototype.setByIndex=function(t){this.valDef="",this.selval="-1",null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]&&this.myData.length>t&&this.setByDescri(this.myData[t].descrizione_valore)},t.prototype.getObj=function(){if(null==this.selval)return null;if("-1"==this.selval)return null;for(var t=0;t<this.myData.length;t++)if(this.myData[t].valore==this.selval)return this.myData[t]},t.prototype.setByValue=function(t){if(this.valDef=t,this.selval="-1",""+t!=""&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){for(var e=0;e<this.myData.length;e++)if(this.myData[e].valore==t)return this.selval=""+this.myData[e].valore,null!=this.myData[e].descrizione_valore&&(this.descri_val=this.myData[e].descrizione_valore),void this.update_dis();this.update_dis()}},t.prototype.getDescri=function(){if(!this.enabled){if(null==this.selval)return this.valDef;if("-1"==this.selval)return this.valDef}if(null==this.selval)return"-1";if("-1"==this.selval)return"-1";for(var t=0;t<this.myData.length;t++)if(this.myData[t].valore==this.selval)return this.myData[t].descrizione_valore},t.prototype.getValue=function(){if(!this.enabled){if(null==this.selval)return this.valDef;if("-1"==this.selval)return this.valDef}return null==this.selval||""==this.selval?"-1":this.selval},t.prototype.getData=function(t){for(var e in this.myData)if(this.myData[e].valore==this.selval)return this.myData[e][t]},t.prototype.set_options=function(t){this.myData=new Array;for(var e=t.split("$"),i=0;i<e.length;i++){var n=new Object,o=e[i].split("|");n.valore=o[1],n.descrizione_valore=o[0],this.myData.push(n)}this.setByValue(this.valDef),"-1"==this.getValue()&&this.setByDescri(this.valDef)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(1==t.init_fill){if(""==t.sql)return;t.fillCombo()}else t.errorMsg="";t.initend.emit()}))},t.prototype.sc=function(){this.selchange.emit({event:this.getObj(),valore:this.getValue(),descrizione_valore:this.getDescri()})},t}();Ci.decorators=[{type:n.Component,args:[{selector:"FHFilterComboBox",template:'\n <mat-form-field [hidden]="!enabled || hidden"\n appearance="outline"\n floatLabel="always" style="font-weight:14px">\n <mat-select\n #cmb\n [(ngModel)]="selval"\n (selectionChange)="sc()"\n [required]="required"\n [placeholder]="label"\n >\n <mat-option value="-1">{{ sel_label }}</mat-option>\n <mat-option value="{{ app.valore }}" *ngFor="let app of myData">{{\n app.descrizione_valore\n }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field\n [hidden]="enabled || hidden"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n <input\n type="text"\n #el1\n matInput\n [disabled]="true"\n [(ngModel)]="dis_value"\n />\n </mat-form-field>\n ',styles:[""]}]}],Ci.ctorParameters=function(){return[{type:Dt},{type:Qt}]},Ci.propDecorators={init_fill:[{type:n.Input}],sql:[{type:n.Input}],types:[{type:n.Input}],values:[{type:n.Input}],hidden:[{type:n.Input}],label:[{type:n.Input}],enabled:[{type:n.Input}],required:[{type:n.Input}],sel_label:[{type:n.Input}],smtr:[{type:n.ViewChild,args:["cmb"]}],fillend:[{type:n.Output}],selchange:[{type:n.Output}],initend:[{type:n.Output}],valDef:[{type:n.Input}],db_type:[{type:n.Input}]};var ki=function(){function t(t,e,i,n,o,s){this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.toastr=n,this._dataService=o,this.m_wkf=s,this.not_int=!0,this.nota="",this.title="COMMENTI",this.b_edit=!1,this.b_ins=!0,this.edit_id=0,this.lettori="",this.subject="",this.link="",this.codice_doc=""}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(this.not_int){if(""==this.nota)return void this.toastr.error("INSERIRE UN COMMENTO");this.select_destinatari()}else this.ok_op()},t.prototype.select_destinatari=function(){var t=this,e=new vt;e.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",e.types=["string"],e.values=["'"+this.lettori.split(",").join("','")+"'"];this._dataService.doQuery(e).subscribe((function(e){var i=t.m_dialogRef.open(ti,{disableClose:!0});setTimeout((function(){i.componentInstance.init_arr(e.result_data)})),i.afterClosed().subscribe((function(e){if(null!=e){for(var i="",n=0;n<e.arrsel.length;n++)""!=i&&(i+=","),i+=e.arrsel[n].username;t.ok_op(i)}}))}),(function(t){}))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,a,r,l,p,u){if(void 0===p&&(p=!0),void 0===u&&(u=""),null!=e&&""!=e){var c=new vt;c.sql="send_wkf_mail",c.values=[t,e,i,n.split("\n").join("<br>"),o,s,a,r,l,u],this.m_wkf.doQuery(c).subscribe((function(t){}))}},t.prototype.ok_op=function(t){var e=this;void 0===t&&(t="");var i=new vt;i.sql="INSERT_WKF_COMMENTO",i.types=["string","string","string","string","string"],i.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc,this.nota,this.m_appService.getState().wkf_doc_info.curr_user,""],this._dataService.doQuery(i).subscribe((function(i){null!=i&&"OK"==i.result_msg&&(e.toastr.info("INFO","COMMENTO INSERITO",{timeOut:1e3,progressBar:!0}),e.b_edit=!1,""!=t&&e.sendEMail_ex(e.m_appService.getState().wkf_doc_info.curr_user,t,e.subject.split("<OP>").join("E' stato inserito un commento"),"<br><br>Commento inserito: <br>"+e.nota.split("\n").join("<br>"),e.m_appService.getState().wkf_doc_info.uiid_app,e.m_appService.getState().wkf_doc_info.uiid_doc,e.link,e.codice_doc,""))}))},t.prototype.annulla=function(){this.nota="",this.b_edit=!1,this.title="COMMENTI"},t.prototype.ngAfterViewInit=function(){},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title="INSERISCI COMMENTO"},t}();ki.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <div mat-dialog-content style="min-width:800px;font-size: 15px;">\n <FHTextArea [label]="\'Commento\' | translate" [(ngModel)]="nota" rows="12"></FHTextArea>\n <div>\n <button mat-flat-button color="primary" (click)="ok()">OK</button\n > \n <button mat-flat-button color="warn" (click)="annulla()">{{\'ANNULLA\' | translate}}</button\n > \n <mat-checkbox [(ngModel)]="not_int" [hidden]="lettori === \'\'">\n {{\'Notifica Interessati\' | translate}}\n </mat-checkbox>\n </div>\n </div>\n ',styles:[""]}]}],ki.ctorParameters=function(){return[{type:e.MatDialogRef},{type:e.MatDialog},{type:wt},{type:i.ToastrService},{type:Dt},{type:ei}]};var Ti=function(){function t(t,e,i){this.dialogRef=t,this.appService=e,this._dataService=i,this.user="",this.user_name="",this.user_surname="",this.user_email="",this.user_roles="",this.user_lang="",this.isadmin="",this.foto_ut="",this.dev_mode=!1,this.b_filef=!1,this.user=this.appService.user,this.user_name=this.appService.user_name,this.user_surname=this.appService.user_surname,this.user_email=this.appService.user_email,null!=this.appService.user_roles&&(this.user_roles=this.appService.user_roles.split(",").join(" ")),this.user_lang=this.appService.user_lang,this.isadmin=this.appService.user_isadmin}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ngAfterViewInit=function(){},t.prototype.upd_dev=function(t){t?(this.appService.dev_mode="1",localStorage.setItem(this.appService.COMPANY_KEY+"dev_mode",this.appService.dev_mode)):(this.appService.dev_mode="0",localStorage.removeItem(this.appService.COMPANY_KEY+"dev_mode"))},t}();Ti.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <table class="dialog_header" style="width:100%"><tr><td>\n{{\'INFO UTENTE\'}}\n</td>\n<td style="text-align:right">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /></td>\n</table>\n\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n\n <mat-dialog-content style="font-size:12px">\n <table class="fh_table" style="width:100%">\n <tbody>\n <tr class="odd">\n <td>{{\'Nome\' | translate}}</td>\n <td>\n <b>{{ user_name }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>{{\'Cognome\' | translate}}</td>\n <td>\n <b>{{ user_surname }}</b>\n </td>\n </tr>\n <tr class="odd">\n <td>{{\'Username\' | translate}}</td>\n <td>\n <b>{{ user }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>{{\'Email\' | translate}}</td>\n <td>\n <b>{{ user_email }}</b>\n </td>\n </tr>\n <tr class="odd">\n <td>{{\'Ruoli\' | translate}}</td>\n <td>\n <b>{{ user_roles }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>{{\'Lingua\' | translate}}</td>\n <td>\n <b>{{ user_lang }}</b>\n </td>\n </tr>\n <tr *ngIf="isadmin == \'1\'" class="odd">\n <td>DEV MODE</td>\n <td>\n <b\n ><mat-checkbox\n [(ngModel)]="dev_mode"\n (ngModelChange)="upd_dev(dev_mode)"\n ></mat-checkbox\n ></b>\n </td>\n </tr>\n </tbody>\n </table>\n <img\n style="vertical-align:middle;max-height:300px"\n *ngIf="b_filef"\n aria-hidden\n src="{{ foto_ut }}"\n />\n </mat-dialog-content>\n</div>\n '}]}],Ti.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:Dt}]};var Di=function(){function t(t,e){this._dataService=t,this._toast=e,this.color="#FFFFFF",this.bk_color="#000000",this.hidden=!1,this.key=""}return t.prototype.open_help=function(){var t=this;if(""!=this.key){var e=new vt;e.sql="SELECT_HELP_TEXT",e.types=["string"],e.values=[this.key],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg)if(e.result_data.length>0){if(null==e.result_data[0].url)return void t._toast.error("help non disponibile: "+t.key);if(""==e.result_data[0].url)return void t._toast.error("help non disponibile: "+t.key);"L"==e.result_data[0].t&&window.open(e.result_data[0].url),"I"==e.result_data[0].t&&t._toast.info(e.result_data[0].url,"HELP",{timeOut:5e3,positionClass:"toast-center-center"})}else{t._toast.error("help non disponibile: "+t.key);var i=new vt;i.sql="INSERT_HELP_TEXT",i.types=["string"],i.values=[t.key],t._dataService.doQuery(i).subscribe()}}))}},t}();Di.decorators=[{type:n.Component,args:[{selector:"FHHelpButton",template:'\n <div style="cursor:pointer">\n <mat-icon\n [style.color]="color"\n [style.background-color]="bk_color"\n [hidden]="hidden"\n (click)="open_help()"\n >info</mat-icon\n >\n </div>\n ',styles:[""]}]}],Di.ctorParameters=function(){return[{type:Dt},{type:i.ToastrService}]},Di.propDecorators={color:[{type:n.Input}],bk_color:[{type:n.Input}],hidden:[{type:n.Input}],key:[{type:n.Input}]};var Li={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Ri})),multi:!0},Ri=function(){function t(){this.hidden=!1,this.label="",this.enabled=!0,this.required=!1,this.change=new n.EventEmitter,this.click=new n.EventEmitter,this.value_b=!1,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.onCl=function(){var t=this;setTimeout((function(){t.click.emit(t.value_b?1:0)}))},t.prototype.modelch=function(){var t=this;setTimeout((function(){t.onChange(t.value_b?1:0),t.change.emit(t.value_b?1:0)}))},t.prototype.ngAfterViewInit=function(){},t.prototype.getModelValue=function(){return this.value_b?1:0},t.prototype.writeValue=function(t){this.getModelValue()!==t&&null!=t&&(this.value_b=1==t)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}();Ri.decorators=[{type:n.Component,args:[{selector:"FHCheckBox",providers:[Li],template:'\n <mat-checkbox [class.fh_field_ck]="enabled" [class.fh_field_dis_ck]="!enabled"\n [(ngModel)]="value_b"\n (click)="onCl()"\n [disabled]="!enabled"\n [required]="required"\n (ngModelChange)="modelch()"\n >{{ label }}\n </mat-checkbox>\n ',styles:[""]}]}],Ri.ctorParameters=function(){return[]},Ri.propDecorators={hidden:[{type:n.Input}],label:[{type:n.Input}],enabled:[{type:n.Input}],required:[{type:n.Input}],change:[{type:n.Output}],click:[{type:n.Output}]};var Ni=function(){function t(t,e,i,n,o){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._trs=n,this.data=o,this.lbl="",this.nota="",this.nota_commento="",this.title="",this.comm_notrequired=0,this.user_sel=[],null!=o&&(null!=o.commento_default&&(this.nota=o.commento_default),null!=o.comm_notrequired&&(this.comm_notrequired=o.comm_notrequired?1:0),null!=o.title&&(this.title=o.title),null!=o.lbl&&(this.lbl=o.lbl),null!=o.utenti&&(this.arrAutori=o.utenti),null!=o.user_sel&&(this.user_sel=o.user_sel)),this.title=this._trs.instant("ASSEGNA DOCUMENTO");for(var s=0;s<this.arrAutori.length;s++)null==this.arrAutori[s].username&&(this.arrAutori[s].username=this.arrAutori[s].idp);2==this.comm_notrequired&&(this.nota_commento=this._trs.instant(" (COMMENTO NON OBBLIGATORIO)")),null!=o&&(null!=o.commento_default&&(this.nota=o.commento_default),null!=o.comm_notrequired&&(this.comm_notrequired=o.comm_notrequired))}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(0!=this.up.getSelArr().length)if(0!=this.comm_notrequired||""!=this.nota){var t=new Object;t.nota=this.nota,t.arrsel=this.up.getSelArr(),this.dialogRef.close(t)}else this.toastr.error("ERRORE",this._trs.instant("INSERIRE IL COMMENTO"),{timeOut:1e3,progressBar:!0});else this.toastr.error("ERRORE",this._trs.instant("SELEZIONARE ALMENO UN UTENTE"),{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();Ni.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n <div\n mat-dialog-content\n fxLayout="column"\n style="font-size: 15px;min-width: 750px"\n >\n <div style="width:100%;height:450px">\n <FHPickUsers\n #up\n [users_list]="arrAutori"\n [vis_buttons]="false"\n [user_sel]="user_sel"\n ></FHPickUsers>\n </div>\n <div *ngIf="comm_notrequired != 1">\n <br />\n <FHTextArea [label]="(\'Commento\' | translate) + nota_commento" [(ngModel)]="nota" rows="4"></FHTextArea>\n </div>\n </div>\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()"> {{\'OK\' | translate }}</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n {{\'ANNULLA\' | translate }}\n </button>\n </div>\n </div>\n '}]}],Ni.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:p.TranslateService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Ni.propDecorators={up:[{type:n.ViewChild,args:["up"]}]};var Fi=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this._tsr=i,this.title="SELEZIONA CHI NOTIFICARE"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.init_arr=function(t){this.up.user_sel=new Array,this.up.users_list_sel=new Array,this.up.users_list=new Array;for(var e=0;e<t.length;e++)null==t[e].username&&(t[e].username=t[e].idp),this.up.users_list_sel.push(t[e]),this.up.users_list.push(t[e]);this.up.filtra()},t.prototype.ok=function(){if(0!=this.up.getSelArr().length){var t=new Object;t.arrsel=this.up.getSelArr(),this.dialogRef.close(t)}else this.toastr.error("ERRORE","SELEZIONARE ALMENO UN UTENTE",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();Fi.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n <div mat-dialog-content style="min-width:700px;font-size: 15px;">\n <div style="height:370px;">\n <FHPickUsers #up [vis_buttons]="false"></FHPickUsers>\n </div>\n <br />\n </div>\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()"> {{\'OK\' | translate }}</button\n > \n <button mat-flat-button color="warn" (click)="close()">{{\'ANNULLA\' | translate }}</button>\n </div>\n </div>\n '}]}],Fi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:p.TranslateService}]},Fi.propDecorators={up:[{type:n.ViewChild,args:["up"]}]};var Mi=function(){function t(t,e,i,n,o,s,a,r){this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.toastr=n,this._dataService=o,this.m_wkf=s,this.m_file=a,this._tsr=r,this.notifica_commenti=1,this.notifica_commenti_obbl=0,this.not_comm=!1,this.not_comm_disabled=!1,this.nota="",this.title="COMMENTI",this.b_edit=!1,this.b_ins=!1,this.edit_id=0,this.lettori="",this.subject="",this.link="",this.codice_doc="",this.op="",this.refresh_list()}return t.prototype.close=function(){this.dialogRef.close(this.op)},t.prototype.init_v=function(){this.notifica_commenti>0&&1==this.notifica_commenti_obbl&&(this.not_comm=!0,this.not_comm_disabled=!0)},t.prototype.edit_comm=function(t){this.b_edit=!0,this.b_ins=!1,this.nota=t.commento,this.edit_id=t.id_comment,this.title=this._tsr.instant("MODIFICA COMMENTO")},t.prototype.refresh_list=function(){var t=this,e=new vt;e.sql="SELECT_COMMENTI_DOCUMENTO_M",e.types=["string","string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.commenti_list=e.result_data;for(var i=0;i<t.commenti_list.length;i++)t.commenti_list[i].v_commento="<b>"+t.commenti_list[i].commento.replace(/\n/g,"<br/>")+"</b>";t.title=t._tsr.instant("COMMENTI")}}),(function(t){}))},t.prototype.ok=function(){if(this.not_comm){if(""==this.nota)return void this.toastr.error(this._tsr.instant("INSERIRE UN COMMENTO"));2!=this.notifica_commenti?this.select_destinatari():this.select_destinatari_grp()}else this.ok_op()},t.prototype.select_destinatari_grp=function(){var t=this,e=this.m_dialogRef.open(He,{disableClose:!0});setTimeout((function(){e.componentInstance.title=t._tsr.instant("Selezione almeno un gruppo da notificare"),e.componentInstance.types=["string"],e.componentInstance.values=[t.m_appService.getState().wkf_doc_info.uiid_app],e.componentInstance.sql="SELECT_GRP_APP_USERS",e.componentInstance.doFill()})),e.afterClosed().subscribe((function(e){if(null!=e){if(""==e)return;for(var i="",n=0;n<e.length;n++)""!=i&&(i+=","),i=i+""+e[n].valore;var o=new vt;o.sql="SELECT_USERS_BY_IDROLES_NOREP",o.types=["string"],o.values=[i],t._dataService.doQuery(o).subscribe((function(e){i="";for(var n=0;n<e.result_data.length;n++)""!=i&&(i+=","),i=i+""+e.result_data[n].username;t.ok_op(i)}))}}))},t.prototype.select_destinatari=function(){var t=this,e=new vt;e.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",e.types=["string"],e.values=["'"+this.lettori.split(",").join("','")+"'"];this._dataService.doQuery(e).subscribe((function(e){var i=t.m_dialogRef.open(Fi,{disableClose:!0});setTimeout((function(){i.componentInstance.init_arr(e.result_data)})),i.afterClosed().subscribe((function(e){if(null!=e){for(var i="",n=0;n<e.arrsel.length;n++)""!=i&&(i+=","),i+=e.arrsel[n].username;t.ok_op(i)}}))}),(function(t){}))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,a,r,l,p,u){if(void 0===p&&(p=!0),void 0===u&&(u=""),null!=e&&""!=e){var c=new vt;c.sql="send_wkf_mail",c.values=[t,e,i,n.split("\n").join("<br>"),o,s,a,r,l,u],this.m_wkf.doQuery(c).subscribe((function(t){}))}},t.prototype.ok_op=function(t){var e=this;if(void 0===t&&(t=""),this.b_ins){(i=new vt).sql="INSERT_WKF_COMMENTO_M",i.types=["string","string","string","string","string"],i.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc,this.nota,this.m_appService.getState().wkf_doc_info.curr_user,t];this._dataService.doQuery(i).subscribe((function(i){e.op="i";var n=!1;if(null!=i&&"OK"==i.result_msg){e.toastr.info(e._tsr.instant("INFO"),e._tsr.instant("COMMENTO INSERITO"),{timeOut:1e3,progressBar:!0});var o=new gt;o.command="exec_app",o.p1="insert_update_comment",o.p2=e.m_appService.getState().wkf_doc_info.uiid_app+"|"+e.m_appService.getState().wkf_doc_info.uiid_doc,e.m_file.doQuery(o,!1).subscribe(),n=!0,e.b_edit=!1,""!=t&&e.sendEMail_ex(e.m_appService.getState().wkf_doc_info.curr_user,t,e.subject.split("<OP>").join(e._tsr.instant("E' stato inserito un commento")),"<br><br>"+e._tsr.instant("Commento inserito")+": <br>"+e.nota.split("\n").join("<br>"),e.m_appService.getState().wkf_doc_info.uiid_app,e.m_appService.getState().wkf_doc_info.uiid_doc,e.link,e.codice_doc,""),e.refresh_list()}n||e.toastr.error("ERRORE",i.msg)}))}else{var i;(i=new vt).sql="UPDATE_WKF_COMMENTO",i.types=["string","string","string"],i.values=[this.nota,this.edit_id,t];this._dataService.doQuery(i).subscribe((function(i){var n=!1;if(null!=i&&"OK"==i.result_msg){e.toastr.info(e._tsr.instant("INFO"),e._tsr.instant("COMMENTO AGGIORNATO"),{timeOut:1e3,progressBar:!0});var o=new gt;o.command="exec_app",o.p1="insert_update_comment",o.p2=e.m_appService.getState().wkf_doc_info.uiid_app+"|"+e.m_appService.getState().wkf_doc_info.uiid_doc+"|"+e.edit_id,e.m_file.doQuery(o,!1).subscribe(),n=!0,e.b_edit=!1,""!=t&&e.sendEMail_ex(e.m_appService.getState().wkf_doc_info.curr_user,t,e.subject.split("<OP>").join(e._tsr.instant("E' stato modificato un commento")),"<br><br>"+e._tsr.instant("Commento modificato")+": <br>"+e.nota.split("\n").join("<br>"),e.m_appService.getState().wkf_doc_info.uiid_app,e.m_appService.getState().wkf_doc_info.uiid_doc,e.link,e.codice_doc,""),e.refresh_list()}n||e.toastr.error("ERRORE",i.msg)}),(function(t){}))}},t.prototype.annulla=function(){var t=this;localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog",this._tsr.instant("Conferma Operazione")),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog",this._tsr.instant("Confermi di voler annullare l'inserimento del commento?")),this.m_dialogRef.open(It).afterClosed().subscribe((function(e){e&&(t.nota="",t.b_edit=!1,t.title="COMMENTI")}))},t.prototype.ngAfterViewInit=function(){},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title=this._tsr.instant("INSERISCI COMMENTO")},t}();Mi.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column">\n <div fxFlex="100" fxLayout="row" fxLayoutAlign="start center" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%"> <b>{{title | translate}}</b></div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\n\n <div fxFlex="100" fxLayout="row" fxLayoutAlign="end center"\n >\n <span class="fill-remaining-space"></span>\n <button mat-raised-button color="accent" (click)="ins()" *ngIf="!b_edit">\n <mat-icon>note_add</mat-icon>\n {{\'INSERISCI\' | translate}}\n </button>\n </div>\n\n <br />\n <div mat-dialog-content style="min-width:800px;font-size: 15px;">\n <FHTextArea *ngIf="b_edit" [label]="\'Commento\' | translate" [(ngModel)]="nota" rows="12"></FHTextArea>\n <div *ngIf="b_edit" fxLayoutAlign="center center" fxLayout="row">\n <button mat-flat-button color="primary" (click)="ok()"> {{\'OK\' | translate}}</button\n > \n <button mat-flat-button color="warn" (click)="annulla()"> {{\'ANNULLA\' | translate}}</button\n > \n <mat-checkbox\n [disabled]="not_comm_disabled"\n [(ngModel)]="not_comm"\n [hidden]="\n notifica_commenti == 0 || (notifica_commenti == 1 && lettori == \'\')\n "\n >{{\'Notifica Interessati\' | translate}}\n\n </mat-checkbox>\n </div>\n <section class="bs" *ngIf="!b_edit">\n <table style="min-width: 100%" class="fh_table">\n <thead>\n <tr>\n <th width="20">{{\'Ver\' | translate}}</th>\n <th>{{\'Commento\' | translate}}</th>\n <th width="15%">{{\'Autore\' | translate}}</th>\n <th width="15%">{{\'Data\' | translate}}</th>\n <th width="20"></th>\n <th width="20"></th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="\n let app of commenti_list;\n let odd = odd;\n let even = even;\n index as i\n "\n [ngClass]="{ odd: odd, even: even }"\n >\n <td align="center">{{app.v}}</td>\n <td [innerHTML]="app.v_commento"></td>\n <td>{{ app.COGNOME + " " + app.NOME }}</td>\n <td>{{ app.data_creazione | date: "dd/MM/yyyy HH:mm:ss" }}</td>\n <td align="center">\n <mat-icon\n [matTooltip]="app.dest_notif"\n *ngIf="app.dest_notif != null && app.dest_notif != \'\'"\n >mail</mat-icon\n >\n </td>\n <td align="center">\n <mat-icon\n *ngIf="\n i == 0 &&\n app.creatore ==\n m_appService.getState().wkf_doc_info.curr_user\n "\n (click)="edit_comm(app)"\n >edit\n </mat-icon>\n </td>\n </tr>\n </tbody>\n </table>\n </section>\n </div>\n <br />\n\n <div style="width:100%;text-align:center;" *ngIf="!b_edit">\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n {{\'CHIUDI\' | translate}}\n </button>\n </div>\n </div>\n ',styles:[""]}]}],Mi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:e.MatDialog},{type:wt},{type:i.ToastrService},{type:Dt},{type:ei},{type:Tt},{type:p.TranslateService}]};var Pi=function(){function t(t,e,i,n,o){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._tsr=n,this.data=o,this.utenti="",this.lbl="",this.nota="",this.icon="",this.color_font="",this.color="",this.nota_commento="",this.title="COMMENTI",this.comm_notrequired=0,this.mobile=!1,console.log("data ",o),null!=o&&(null!=o.commento_default&&(this.nota=o.commento_default),null!=o.comm_notrequired&&(this.comm_notrequired=o.comm_notrequired?1:0),null!=o.title&&(this.title=o.title),null!=o.lbl&&(this.lbl=o.lbl),null!=o.utenti&&(this.utenti=o.utenti.split(";").join(", ")),null!=o.icon&&(this.icon=o.icon),null!=o.color_font&&(this.color_font=o.color_font),null!=o.color&&(this.color=o.color)),2==this.comm_notrequired&&(this.nota_commento=" (COMMENTO NON OBBLIGATORIO)"),this.mobile=this.m_appService.getState().pageFullscreen}return t.prototype.ok=function(){0!=this.comm_notrequired||""!=this.nota?this.dialogRef.close(this.nota):this.toastr.error(this._tsr.instant("ERRORE"),this._tsr.instant("INSERIRE IL COMMENTO"),{timeOut:1e3,progressBar:!0})},t.prototype.close=function(){this.dialogRef.close("abort")},t.prototype.ngAfterViewInit=function(){},t}();Pi.decorators=[{type:n.Component,args:[{template:'\n<div fxLayout="column">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{ title| translate }}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <mat-toolbar [style.background-color]="color"\n [style.color]="color_font">\n <i *ngIf="icon!=null && icon!=\'\'" class="fa {{icon}}" aria-hidden="true"></i> \n <div style="font-size:10px" *ngIf="mobile">{{ lbl | translate}}</div>\n <div *ngIf="!mobile">{{ lbl| translate }}</div>\n </mat-toolbar>\n <br />\n <div mat-dialog-content style="min-width:800px;font-size: 15px;">\n <div\n *ngIf="mobile && utenti?.toLocaleLowerCase().indexOf(\'system\') == -1"\n style="font-size:10px"\n >\n {{\'Assegnata a\'| translate}}: {{ utenti }}\n </div>\n <h3\n *ngIf="!mobile && utenti?.toLocaleLowerCase().indexOf(\'system\') == -1"\n >\n {{\'Assegnata a\'| translate}}: {{ utenti }}\n </h3>\n <br />\n <mat-form-field\n [hidden]="comm_notrequired == 1"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{\'Commento\'| translate}} {{ nota_commento | translate}}</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="6"></textarea>\n </mat-form-field>\n </div>\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()">{{\'OK\'| translate}}</button>\n\n </div>\n '}]}],Pi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:p.TranslateService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var zi=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toast=i,this.data=n,this.title="INFO DOCUMENTO",this.hide_richiedente=!1,this.load_info(n)}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.load_info=function(t){console.log("data ",t),null==t.v&&(t.v=1),this.codice=t.codice+"/"+t.v,this.data_richiesta=t.data_richiesta,this.richiedente=t.richiedente,this.stato=t.stato,this.stat_stato=t.stat_stato,this.in_carico_a=t.autori,null!=t.s_uto&&""!=t.s_uto&&(this.in_carico_a=t.s_uto),this.uiid_app=t.id_applicativo,this.uiid_doc=t.id_documento,this.canale=t.canale,this.nc=t.nc},t.prototype.ngAfterViewInit=function(){},t}();zi.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title|translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <div mat-dialog-content style="font-size: 15px;">\n <table class="fh_table">\n <tbody>\n <tr class="odd">\n <td>{{\'Codice\'|translate}}:</td>\n <td>\n <b>{{ codice }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>{{\'Data\'|translate}}:</td>\n <td>\n <b>{{ data_richiesta | date: "dd/MM/yyyy HH:mm:ss" }}</b>\n </td>\n </tr>\n <tr *ngIf="!hide_richiedente" class="odd">\n <td>{{\'Richiedente\'|translate}}:</td>\n <td>\n <b>{{ richiedente }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>{{\'Stato\'|translate}}:</td>\n <td>\n <b>{{ stato }} - {{stat_stato}}</b>\n </td>\n </tr>\n <tr class="odd">\n <td>{{\'In Carico a\'|translate}}:</td>\n <td>\n <b>{{ in_carico_a }}</b>\n </td>\n </tr>\n\n <tr class="even" *ngIf="m_appService.dev_mode">\n <td>Uiid App:</td>\n <td>\n <b>{{ uiid_app }}</b>\n </td>\n </tr>\n <tr class="odd" *ngIf="m_appService.dev_mode">\n <td>Uiid Doc:</td>\n <td>\n <b>{{ uiid_doc }}</b>\n </td>\n </tr>\n <tr class="odd" *ngIf="m_appService.dev_mode">\n <td>Grp:</td>\n <td>\n <b>{{ canale }}</b>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <br />\n\n <div style="width:100%;text-align:center;">\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="dialogRef.close(\'\')"\n >\n CHIUDI\n </button>\n </div>\n</div>\n '}]}],zi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var ji=function(){function t(t,e,i,n,o,s,a){this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.toastr=n,this._dataService=o,this.m_wkf=s,this._tsr=a,this.not_int=!0,this.nota="",this.title="COMMENTI",this.b_edit=!1,this.b_ins=!0,this.edit_id=0,this.lettori="",this.subject="",this.link="",this.codice_doc=""}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(this.not_int){if(""==this.nota)return void this.toastr.error("INSERIRE UN COMMENTO");this.select_destinatari()}else this.ok_op()},t.prototype.select_destinatari=function(){var t=this,e=new vt;e.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",e.types=["string"],e.values=["'"+this.lettori.split(",").join("','")+"'"];this._dataService.doQuery(e).subscribe((function(e){var i=t.m_dialogRef.open(Fi,{disableClose:!0});setTimeout((function(){i.componentInstance.init_arr(e.result_data)})),i.afterClosed().subscribe((function(e){if(null!=e){for(var i="",n=0;n<e.arrsel.length;n++)""!=i&&(i+=","),i+=e.arrsel[n].username;t.ok_op(i)}}))}),(function(t){}))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,a,r,l,p,u){if(void 0===p&&(p=!0),void 0===u&&(u=""),null!=e&&""!=e){var c=new vt;c.sql="send_wkf_mail",c.values=[t,e,i,n.split("\n").join("<br>"),o,s,a,r,l,u],this.m_wkf.doQuery(c).subscribe((function(t){}))}},t.prototype.ok_op=function(t){var e=this;void 0===t&&(t="");var i=new vt;i.sql="INSERT_WKF_COMMENTO_M",i.types=["string","string","string","string","string"],i.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc,this.nota,this.m_appService.getState().wkf_doc_info.curr_user,""],this._dataService.doQuery(i).subscribe((function(i){null!=i&&"OK"==i.result_msg&&(e.toastr.info(e._tsr.instant("INFO"),e._tsr.instant("COMMENTO INSERITO"),{timeOut:1e3,progressBar:!0}),e.b_edit=!1,""!=t&&e.sendEMail_ex(e.m_appService.getState().wkf_doc_info.curr_user,t,e.subject.split("<OP>").join(e._tsr.instant("E' stato inserito un commento")),"<br><br>"+e._tsr.instant("Commento inserito")+": <br>"+e.nota.split("\n").join("<br>"),e.m_appService.getState().wkf_doc_info.uiid_app,e.m_appService.getState().wkf_doc_info.uiid_doc,e.link,e.codice_doc,""))}))},t.prototype.annulla=function(){this.nota="",this.b_edit=!1,this.title="COMMENTI"},t.prototype.ngAfterViewInit=function(){},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title="INSERISCI COMMENTO"},t}();ji.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <div mat-dialog-content style="min-width:800px;font-size: 15px;">\n <FHTextArea [label]="\'Commento\' | translate" [(ngModel)]="nota" rows="12"></FHTextArea>\n <div>\n <button mat-flat-button color="primary" (click)="ok()">{{\'OK\' | translate}}</button\n > \n <button mat-flat-button color="warn" (click)="annulla()">{{\'ANNULLA\' | translate}}</button\n > \n <mat-checkbox [(ngModel)]="not_int" [hidden]="lettori === \'\'">\n {{\'Notifica Interessati\' | translate}\n </mat-checkbox>\n </div>\n </div>\n ',styles:[""]}]}],ji.ctorParameters=function(){return[{type:e.MatDialogRef},{type:e.MatDialog},{type:wt},{type:i.ToastrService},{type:Dt},{type:ei},{type:p.TranslateService}]};var Ui=function(){function t(t,e,i,n,o,s,a,r,l){this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.toastr=n,this._dataService=o,this.m_wkf=s,this.m_file=a,this._tsr=r,this.data=l,this.ossv=!1,this.not_comm=!1,this.not_comm_disabled=!1,this.op="",this.b_flussook=!0,this.logs=new Array,this.notifica_commenti=1,this.notifica_commenti_obbl=0,this.title="LOG WORKFLOW E COMMENTI",this.nota="",this.commenti_insert=!1,this.b_edit=!1,this.b_ins=!1,this.edit_id=0,this.c_edit=!0,this.lettori="",this.subject="",this.link="",this.codice_doc="",null!=l.edit_c&&(this.c_edit=l.edit_c)}return t.prototype.ric_all=function(){this.refresh_list()},t.prototype.close=function(){this.dialogRef.close(this.op)},t.prototype.init_v=function(){this.notifica_commenti>0&&1==this.notifica_commenti_obbl&&(this.not_comm=!0,this.not_comm_disabled=!0)},t.prototype.load_graph=function(){var t=this,e=new vt;e.sql="SELECT_WKF_BY_ID",e.types=["string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){if(e.result_data.length>0&&null!=e.result_data[0].diagramma_flusso&&""!=e.result_data[0].diagramma_flusso){for(var i=!1,n=0;n<t.logs.length;n++){if(null!=t.logs[n].liv_ini&&null!=t.logs[n].liv_fin){var o;o=t.logs[n].liv_ini+"_"+t.logs[n].liv_fin,console.log("sostituisco ",o),e.result_data[0].diagramma_flusso=e.result_data[0].diagramma_flusso.split('bpmnElement="LINK_'+o+'"').join('bpmnElement="LINK_'+o+'" bioc:stroke="#1E88E5" bioc:fill="#BBDEFB"'),e.result_data[0].diagramma_flusso=e.result_data[0].diagramma_flusso.split('bpmnElement="LINK_EXIT_'+t.logs[n].liv_ini+'"').join('bpmnElement="LINK_EXIT_'+t.logs[n].liv_ini+'" bioc:stroke="#1E88E5" bioc:fill="#BBDEFB"')}-1==t.logs[n].id_comment&&(null!=t.logs[n].liv_ini&&(e.result_data[0].diagramma_flusso=e.result_data[0].diagramma_flusso.split('bpmnElement="STEP_'+t.logs[n].liv_ini+'"').join('bpmnElement="STEP_'+t.logs[n].liv_ini+'" bioc:stroke="#43A047" bioc:fill="#C8E6C9"')),i||null!=t.logs[n].liv_fin&&(e.result_data[0].diagramma_flusso=e.result_data[0].diagramma_flusso.split('bpmnElement="STEP_'+t.logs[n].liv_fin+'"').join('bpmnElement="STEP_'+t.logs[n].liv_fin+'" bioc:stroke="#FB8C00" bioc:fill="#FFE0B2"'),i=!0))}return void t.modeler.importXML(e.result_data[0].diagramma_flusso,(function(e){e?t.b_flussook=!1:t.modeler.get("canvas").zoom("fit-viewport",{x:0,y:0})}))}t.b_flussook=!1}}))},t.prototype.annulla=function(){var t=this;localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog",this._tsr.instant("Conferma Operazione")),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog",this._tsr.instant("Confermi di voler annullare l'inserimento del commento?")),this.m_dialogRef.open(It).afterClosed().subscribe((function(e){e&&(t.nota="",t.b_edit=!1,t.title=t._tsr.instant("LOG WORKFLOW E COMMENTI"))}))},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title=this._tsr.instant("INSERISCI COMMENTO")},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.ric_all()}),200)},t.prototype.edit_comm=function(t){this.b_edit=!0,this.b_ins=!1,this.nota=t.stato_attuale,this.edit_id=t.id_comment,this.title=this._tsr.instant("MODIFICA COMMENTO")},t.prototype.refresh_list=function(){var t=this,e=new vt;e.sql="SELECT_WORKFLOW_LOG",e.types=["string","string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc];this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.logs=e.result_data;for(var i=0;i<t.logs.length;i++)null!=t.logs[i].stato_attuale?t.logs[i].v_commento="<b>"+t.logs[i].operazione.replace(/\n/g,"<br/>")+" ("+t.logs[i].stato_attuale.replace(/\n/g,"<br/>")+")</b>":t.logs[i].v_commento="<b>"+t.logs[i].operazione.replace(/\n/g,"<br/>")+"</b>";t.ossv||(t.modeler=new R({container:"#canvas",width:"97%",height:"100%",readonly:!0})),t.load_graph(),t.ossv=!0,!0}}))},t.prototype.ok=function(){if(this.not_comm){if(""==this.nota)return void this.toastr.error(this._tsr.instant("INSERIRE UN COMMENTO"));1==this.notifica_commenti?this.select_destinatari():this.select_destinatari_grp()}else this.ok_op()},t.prototype.select_destinatari=function(){var t=this,e=new vt;e.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",e.types=["string"],e.values=["'"+this.lettori.split(",").join("','")+"'"];this._dataService.doQuery(e).subscribe((function(e){var i=t.m_dialogRef.open(Fi,{disableClose:!0});setTimeout((function(){i.componentInstance.init_arr(e.result_data)})),i.afterClosed().subscribe((function(e){if(null!=e){for(var i="",n=0;n<e.arrsel.length;n++)""!=i&&(i+=","),i+=e.arrsel[n].username;t.ok_op(i)}}))}))},t.prototype.select_destinatari_grp=function(){var t=this,e=this.m_dialogRef.open(He,{disableClose:!0});setTimeout((function(){e.componentInstance.title=t._tsr.instant("Selezione almeno un gruppo da notificare"),e.componentInstance.types=["string"],e.componentInstance.values=[t.m_appService.getState().wkf_doc_info.uiid_app],e.componentInstance.sql="SELECT_GRP_APP_USERS",e.componentInstance.doFill()})),e.afterClosed().subscribe((function(e){if(null!=e){if(""==e)return;for(var i="",n=0;n<e.length;n++)""!=i&&(i+=","),i=i+""+e[n].valore;var o=new vt;o.sql="SELECT_USERS_BY_IDROLES_NOREP",o.types=["string"],o.values=[i],t._dataService.doQuery(o).subscribe((function(e){i="";for(var n=0;n<e.result_data.length;n++)""!=i&&(i+=","),i=i+""+e.result_data[n].username;t.ok_op(i)}))}}))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,a,r,l,p,u){if(void 0===p&&(p=!0),void 0===u&&(u=""),null!=e&&""!=e){var c=new vt;c.sql="send_wkf_mail",c.values=[t,e,i,n.split("\n").join("<br>"),o,s,a,r,l,u],this.m_wkf.doQuery(c).subscribe((function(t){}))}},t.prototype.ok_op=function(t){var e,i=this;(void 0===t&&(t=""),this.b_ins)?((e=new vt).sql="INSERT_WKF_COMMENTO",e.types=["string","string","string","string","string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc,this.nota,this.m_appService.getState().wkf_doc_info.curr_user,t],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){i.op="i",i.toastr.info(i._tsr.instant("INFO"),i._tsr.instant("COMMENTO INSERITO"),{timeOut:1e3,progressBar:!0}),console.log("insert_update_comment !!!!");var n=new gt;n.command="exec_app",n.p1="insert_update_comment",n.p2=i.m_appService.getState().wkf_doc_info.uiid_app+"|"+i.m_appService.getState().wkf_doc_info.uiid_doc,i.m_file.doQuery(n,!1).subscribe(),i.b_edit=!1,""!=t&&i.sendEMail_ex(i.m_appService.getState().wkf_doc_info.curr_user,t,i.subject.split("<OP>").join(i._tsr.instant("E' stato inserito un commento")),"<br><br>"+i._tsr.instant("Commento inserito")+": <br>"+i.nota.split("\n").join("<br>"),i.m_appService.getState().wkf_doc_info.uiid_app,i.m_appService.getState().wkf_doc_info.uiid_doc,i.link,i.codice_doc,""),i.refresh_list()}}))):((e=new vt).sql="UPDATE_WKF_COMMENTO",e.types=["string","string","string","string"],e.values=[this.nota,this.edit_id],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){i.toastr.info(i._tsr.instant("INFO"),i._tsr.instant("COMMENTO AGGIORNATO"),{timeOut:1e3,progressBar:!0}),console.log("insert_update_comment !!!!");var n=new gt;n.command="exec_app",n.p1="insert_update_comment",n.p2=i.m_appService.getState().wkf_doc_info.uiid_app+"|"+i.m_appService.getState().wkf_doc_info.uiid_doc,i.m_file.doQuery(n,!1).subscribe(),i.b_edit=!1,""!=t&&i.sendEMail_ex(i.m_appService.getState().wkf_doc_info.curr_user,t,i.subject.split("<OP>").join(i._tsr.instant("E' stato modificato un commento")),"<br><br>"+i._tsr.instant("Commento modificato")+": <br>"+i.nota.split("\n").join("<br>"),i.m_appService.getState().wkf_doc_info.uiid_app,i.m_appService.getState().wkf_doc_info.uiid_doc,i.link,i.codice_doc,""),i.refresh_list()}})))},t}();Ui.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <div\n style="font-size: 12px"\n [style.height]="m_appService.getState().body_h - 130 + \'px\'"\n >\n <mat-tab-group\n #zz\n style="width:100%"\n [style.height]="m_appService.getState().body_h - 140 + \'px\'"\n >\n <mat-tab label="WORKFLOW" *ngIf="b_flussook">\n <div [style.height]="m_appService.getState().body_h - 160 + \'px\'">\n <div style="width:100%;height:100%" id="canvas"></div>\n </div>\n </mat-tab>\n\n <mat-tab label="LOGS">\n <div\n fxLayout="row"\n fxLayoutAlign="center end"\n fxFlex="90"\n *ngIf="!b_edit && commenti_insert && c_edit"\n >\n <button mat-flat-button color="accent" (click)="ins()">\n <mat-icon>note_add</mat-icon>\n {{\'INSERISCI\' | translate}}</button\n > \n </div>\n\n <div fxLayout="column" *ngIf="b_edit">\n <br />\n\n <FHTextArea *ngIf="b_edit" [label]="\'Commento\' | translate" [(ngModel)]="nota" rows="12"></FHTextArea>\n <div *ngIf="b_edit" fxLayoutAlign="center center" fxLayout="row">\n <button mat-flat-button color="primary" (click)="ok()">OK</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="annulla()"\n >\n {{\'ANNULLA\' | translate}}</button\n > \n <mat-checkbox\n [disabled]="not_comm_disabled"\n [(ngModel)]="not_comm"\n [hidden]="\n notifica_commenti == 0 ||\n (notifica_commenti == 1 && lettori == \'\')\n "\n >\n {{\'Notifica Interessati\' | translate}}\n </mat-checkbox>\n </div>\n <br /><br />\n </div>\n <table *ngIf="!b_edit" class="fh_table" style="width:90%">\n <thead>\n <tr>\n <th width="15%"> {{\'Data\' | translate}}</th>\n <th width="15%"> {{\'Utente\' | translate}}</th>\n <th> {{\'Task/Operazione\' | translate}}</th>\n <td></td>\n <td *ngIf="c_edit"></td>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="\n let app of logs;\n let odd = odd;\n let even = even;\n index as i\n "\n [ngClass]="{ odd: odd, even: even }"\n >\n <td>{{ app.data_creazione | date: "dd/MM/yyyy HH:mm:ss" }}</td>\n <td>{{ app.nc }}</td>\n <td [innerHTML]="app.v_commento"></td>\n <td>\n <mat-icon\n [matTooltip]="app.dest_notif"\n *ngIf="app.dest_notif != null && app.dest_notif != \'\'"\n >mail</mat-icon\n >\n </td>\n <td *ngIf="c_edit">\n <mat-icon\n *ngIf="\n i == 0 &&\n app.creatore ==\n m_appService.getState().wkf_doc_info.curr_user\n "\n (click)="edit_comm(app)"\n >edit\n </mat-icon>\n </td>\n </tr>\n </tbody>\n </table>\n </mat-tab>\n </mat-tab-group>\n </div>\n ',styles:[""]}]}],Ui.ctorParameters=function(){return[{type:e.MatDialogRef},{type:e.MatDialog},{type:wt},{type:i.ToastrService},{type:Dt},{type:ei},{type:Tt},{type:p.TranslateService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Ui.propDecorators={zz:[{type:n.ViewChild,args:["zz"]}]};var Vi=function(){function t(t,e,i,n,o){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this._tsr=o,this.flt_grid="1=1",this.title="RECUPERA DOCUMENTO"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.edit=function(t){var e=this,i=new vt;i.sql="UPDATE_WKF_ANNULATO",i.types=["string","string","int"],i.values=[this.datagrid.sRow.id_applicativo,this.datagrid.sRow.uiid,0],this._dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(e.toastr.info(e._tsr.instant("Documento")+" "+e.datagrid.sRow.codice+" "+e._tsr.instant("Recuperato")),e.dialogRef.close("ok"))}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}))},t.prototype.init_w=function(t){this.datagrid.columnDefs=[{headerName:this._tsr.instant("Codice"),field:"codice",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:this._tsr.instant("Oggetto"),field:"oggetto",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:this._tsr.instant("Stato"),field:"stat_stato",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:this._tsr.instant("Richiedente"),field:"nc",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}}],this.datagrid.doFill("annullato=-1 and id_applicativo='"+t+"'")},t.prototype.edit_comm=function(t){},t}();Vi.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n <div mat-dialog-content style="font-size: 15px;">\n\n <br />\n <div style="width:100%;height:400px">\n <div style="width:100%;height:100%">\n <FHGrid\n [filters]="flt_grid"\n init_fill="false"\n show_buttons="false"\n vis\n #dtm\n (dclicked)="edit($event)"\n g_width="100%"\n g_height="100%"\n tbl_name="wkf_documents"\n grid_key="r_wkf_documents"\n sort_field="codice desc"\n off_set="50"\n fields="*"\n ></FHGrid>\n </div>\n </div>\n <br />\n\n <div style="width:100%;text-align:center;">\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="dialogRef.close(\'\')"\n >\n {{\'CHIUDI\' | translate}}\n </button>\n </div>\n </div>\n </div>\n '}]}],Vi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:Dt},{type:p.TranslateService}]},Vi.propDecorators={datagrid:[{type:n.ViewChild,args:["dtm"]}]};var qi=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this._tsr=i,this.selval="-1",this.title="",this.errorMsg="",this.OK_BUTTON="OK"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.sc=function(){if(this.OK_BUTTON="OK","-1"!=this.selval)for(var t=0;t<this.myData.length;t++){if(Number(this.selval).valueOf()+0==this.myData[t].step+0){this.OK_BUTTON="OK ("+this.myData[t].description+")";break}}},t.prototype.setStepCombo=function(t){this.myData=t},t.prototype.ok=function(){if(null!=this.selval)if("-1"!=this.selval){for(var t=null,e=0;e<this.myData.length;e++){if(Number(this.selval).valueOf()+0==this.myData[e].step+0){t=this.myData[e];break}}null!=t?this.dialogRef.close({lvl_sel:t,result:"ok"}):this.toastr.error(this._tsr.instant("ERRORE"),this._tsr.instant("SELEZIONARE LO STEP"),{timeOut:1e3,progressBar:!0})}else this.toastr.error(this._tsr.instant("ERRORE"),this._tsr.instant("SELEZIONARE LO STEP"),{timeOut:1e3,progressBar:!0});else this.toastr.error(this._tsr.instant("ERRORE"),this._tsr.instant("SELEZIONARE LO STEP"),{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();qi.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n <div mat-dialog-content style="font-size: 15px;">\n\n <mat-dialog-content\n ><br /><br />\n <mat-form-field\n style="width:100%"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{\'Seleziona Step\' | translate}}:</mat-label>\n <mat-select #cmb [(ngModel)]="selval" (change)="sc()">\n <mat-option value="-1">Seleziona</mat-option>\n <mat-option value="{{ app.step }}" *ngFor="let app of myData">\n {{app.v | translate }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <br /><br /><br /><br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()">\n {{ OK_BUTTON | translate }}</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n {{\'ANNULLA\' | translate }}\n </button>\n </div>\n <br /><br />\n </mat-dialog-content>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">\n {{ errorMsg }}\n </p>\n </div>\n </div>\n '}]}],qi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:p.TranslateService}]},qi.propDecorators={smtr:[{type:n.ViewChild,args:["cmb"]}]};var Gi=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this._tsr=i,this.commento_hidden=!1,this.nota="",this.nota_commento="",this.title="",this.comm_notrequired=!0,this.comm_notrequired=!0}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(this.commento_hidden||""!=this.nota)if(0!=this.up.getSelArr().length){var t=new Object;t.nota=this.nota,t.arrsel=this.up.getSelArr(),t.result="ok",this.dialogRef.close(t)}else this.toastr.error(this._tsr.instant("ERRORE"),this._tsr.instant("SELEZIONARE ALMENO UN UTENTE"),{timeOut:1e3,progressBar:!0});else this.toastr.error(this._tsr.instant("ERRORE"),this._tsr.instant("INSERIRE IL COMMENTO"),{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();Gi.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate }}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n <div mat-dialog-content fxLayout="column" style="font-size:12px">\n <div style="width:100%;height:500px">\n <FHPickUsers\n #up\n [users_list]="arrAutori"\n [vis_buttons]="false"\n\n ></FHPickUsers>\n </div>\n\n <mat-form-field\n [hidden]="commento_hidden"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{\'Commento\' | translate }} {{ nota_commento | translate }}</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="2"></textarea>\n </mat-form-field>\n </div>\n <div mat-dialog-actions fxLayout="row" fxLayoutAlign="center center">\n <div>\n <button mat-flat-button color="primary" (click)="ok()"> {{\'OK\' | translate }}</button>\n </div>\n \n <div>\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n {{\'ANNULLA\' | translate }}\n </button>\n </div>\n </div>\n </div>\n ',styles:[" .mat-dialog-content { max-height: unset !important; }\n\n"]}]}],Gi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:p.TranslateService}]},Gi.propDecorators={up:[{type:n.ViewChild,args:["up"]}]};var Ki=function(){function t(t,e,i){this.dialogRef=t,this.data=e,this.toast=i,this.salva_ed_esci="SALVA ED ESCI",this.esci_senza_salvataggi="ESCI SENZA SALVATAGGIO",this.commento="",this.b_commento=!1,this.commento_mgs="Commento",this.insert_comment_msg="Inserire un commento",null!=e&&(null!=e.mgs_salva_ed_esci&&(this.salva_ed_esci=e.mgs_salva_ed_esci),null!=e.msg_esci_senza_salvataggi&&(this.esci_senza_salvataggi=e.msg_esci_senza_salvataggi),null!=e.b_commento&&(this.b_commento=e.b_commento),null!=e.commento_mgs&&(this.commento_mgs=e.commento_mgs),null!=e.insert_comment_msg&&(this.insert_comment_msg=e.insert_comment_msg))}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.salva_esci=function(){this.b_commento&&""==this.commento?this.toast.error(this.insert_comment_msg):this.dialogRef.close("salva_esci")},t.prototype.esci_senza_salv=function(){this.dialogRef.close("esci_senza_salv")},t.prototype.ngAfterViewInit=function(){},t}();Ki.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <div mat-dialog-content>\n <div style="width:400px" [hidden]="!b_commento"><br /></div>\n <div style="width:400px" [hidden]="!b_commento">\n <FHTextArea\n label="{{ commento_mgs |translate }}"\n required\n [(ngModel)]="commento"\n ></FHTextArea>\n </div>\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="salva_esci()">\n {{ salva_ed_esci|translate }}</button\n > \n <button mat-flat-button color="warn" (click)="esci_senza_salv()">\n {{ esci_senza_salvataggi |translate }}\n </button>\n </div>\n </div>\n '}]}],Ki.ctorParameters=function(){return[{type:e.MatDialogRef},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]},{type:i.ToastrService}]};var Bi=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._tsr=n,this.selval="-1",this.errorMsg="",this.title="SELEZIONA AMBITO",this.myData=this.m_appService.getState().wkf_doc_info.canali_arr,this.selval="-1"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){"-1"!=this.selval?this.dialogRef.close(this.selval):this.toastr.error(this._tsr.instant("ERRORE"),this._tsr.instant("SELEZIONARE AMBITO"),{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();Bi.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title|translate }}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n <div mat-dialog-content style="font-size: 15px;">\n\n <div mat-dialog-content>\n <br /><br />\n <mat-form-field\n style="width:100%"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{\'Seleziona Ambito\'|translate }}:</mat-label>\n <mat-select #cmb [(ngModel)]="selval">\n <mat-option value="-1">{{\'Seleziona\' |translate }}</mat-option>\n <mat-option value="{{ app }}" *ngFor="let app of myData">\n {{app |translate }}\n }}</mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()"> {{\'OK\' | translate }}</button>\n </div>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">\n {{ errorMsg |translate }}\n </p>\n </div>\n </div>\n '}]}],Bi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:p.TranslateService}]},Bi.propDecorators={smtr:[{type:n.ViewChild,args:["cmb"]}]};var Hi=function(){function t(t,e,i,n){this.dialogRef=t,this.toastr=e,this._tsr=i,this.data=n,this.selval="-1",this.errorMsg="",this.title="SELEZIONA PROSSIMO STEP:",this.OK_BUTTON="OK",this.trans=[],this.trans=n,this.title=this._tsr.instant(this.title)}return t.prototype.sel=function(t){this.selval=t.uiid,this.ok()},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.sc=function(){if(this.OK_BUTTON="OK",null!=this.selval&&""!=this.selval&&"-1"!=this.selval)for(var t=0;t<this.trans.length;t++)if(this.selval==this.trans[t].uiid){this.OK_BUTTON=this._tsr.instant("OK")+" ("+this.trans[t].description+")";break}},t.prototype.ok=function(){if(null!=this.selval&&""!=this.selval&&"-1"!=this.selval)for(var t=0;t<this.trans.length;t++)this.selval==this.trans[t].uiid&&this.dialogRef.close(this.trans[t]);else this.toastr.error(this._tsr.instant("Selezionare lo step di destinazione"))},t.prototype.ngAfterViewInit=function(){},t}();Hi.decorators=[{type:n.Component,args:[{template:'\n<div fxLayout="column">\n<div fxFlex="100" fxLayout="row" fxLayoutAlign="start center" class="dialog_header">\n\n<div fxLayout="row" fxLayoutAlign="start center" fxFlex="90"><div>{{title|translate}}</div></div>\n\n<div fxFlex="10" fxLayout="row" fxLayoutAlign="end center">\n <div><img src="assets/icons/x.png" style="cursor: pointer;" (click)="dialogRef.close(null)" /> </div>\n</div>\n\n</div>\n\n\n<mat-dialog-content>\n<hr width="100%" size="0.5" color="#DDDDDD">\n\n <br />\n <div fxLayout="column" fxLayoutGap="5px">\n <div *ngFor="let app of trans">\n <button mat-raised-button [style.background-color]="app.color" (click)="sel(app)"\n [style.color]="app.color_font" style="font-weight:bold;font-size:18px;min-width:300px">\n <i *ngIf="app.icon!=null && app.icon!=\'\'" class="fa {{app.icon}}" aria-hidden="true"></i>\n\n{{ app.description|translate}}</button>\n<br><br>\n\n\n</div>\n </div>\n</mat-dialog-content>\n\n\n '}]}],Hi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:p.TranslateService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Hi.propDecorators={smtr:[{type:n.ViewChild,args:["cmb"]}]};var Yi=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this._tsr=i,this.nota="",this.title="",this.comm_notrequired=!0,this.comm_notrequired=!0}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(console.log(this.up.getUsersUsername(),this.up1.getUsersUsername()),null!=this.up.getUsersUsername())if("-1"!=this.up.getUsersUsername())if(""!=this.up.getUsersUsername())if(null!=this.up1.getUsersUsername())if("-1"!=this.up1.getUsersUsername())if(""!=this.up1.getUsersUsername()){var t=new Object;t.u1=this.up.getUsersUsername(),t.u2=this.up1.getUsersUsername(),t.result="ok",this.dialogRef.close(t)}else this.toastr.error(this._tsr.instant("selezionare utente destinazione"));else this.toastr.error(this._tsr.instant("selezionare utente destinazione"));else this.toastr.error(this._tsr.instant("selezionare utente destinazione"));else this.toastr.error(this._tsr.instant("selezionare utente origine"));else this.toastr.error(this._tsr.instant("selezionare utente origine"));else this.toastr.error(this._tsr.instant("selezionare utente origine"))},t.prototype.ngAfterViewInit=function(){},t}();Yi.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title|translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n <div\n mat-dialog-content\n fxLayoutGap="5px"\n fxLayout="column"\n style="font-size:12px"\n >\n <div style="width:100%">\n <FHUserField [label]="\'Utente da sostituire\' |translate" #up></FHUserField>\n </div>\n <div style="width:100%">\n <FHUserField [label]="\'Utente sostituto\' |translate" #up1></FHUserField>\n </div>\n </div>\n <div mat-dialog-actions fxLayout="row" fxLayoutAlign="center center">\n <div>\n <button mat-flat-button color="primary" (click)="ok()"> {{\'OK\' | translate }}</button>\n </div>\n \n <div>\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n {{\'ANNULLA\' | translate }}\n </button>\n </div>\n </div>\n </div>\n '}]}],Yi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:p.TranslateService}]},Yi.propDecorators={up:[{type:n.ViewChild,args:["up"]}],up1:[{type:n.ViewChild,args:["up1"]}]};var Qi=function(){function t(t,e,i){this.data=t,this.dialogRef=e,this.app_s=i,this.enabled=!0,this.access_control=!0,this.App="",this.K="",this.title="ALLEGATI",this.admin_role="[ZZZ_DIS_CC]",this.sovrascrivi_path="",console.log("data ",t),null!=t&&(null!=t.App&&(this.App=t.App),null!=t.K&&(this.K=t.K),null!=t.admin_role&&(this.admin_role=t.admin_role))}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){""==t.App&&(t.App=t.app_s.getState().wkf_doc_info.uiid_app,t.K=t.app_s.getState().wkf_doc_info.uiid_doc),t.init(t.App,t.K)}))},t.prototype.init=function(t,e){this.App=t,this.K=e,this.upc.init(this.App,this.K)},t}();Qi.decorators=[{type:n.Component,args:[{selector:"wkf_win_upload",template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title |translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n\n <mat-dialog-content style="font-size:12px">\n<br><br>\n <FHUploadPanel\n [enabled]="enabled"\n #upc\n [access_control]="access_control"\n [sovrascrivi_path]="sovrascrivi_path"\n [ruolo_supervisore]="admin_role"\n ></FHUploadPanel>\n </mat-dialog-content>\n <br /><br />\n <div style="width:100%;text-align:center;">\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n {{\'CHIUDI\' | translate}}\n </button>\n </div>\n </div>\n ',styles:[""]}]}],Qi.ctorParameters=function(){return[{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]},{type:e.MatDialogRef},{type:wt}]},Qi.propDecorators={upc:[{type:n.ViewChild,args:["upc"]}]};var Wi=function(){function t(t,e){this.m_appService=t,this._trs=e,this.custom_commands=[],this.dt_agg=null,this.edit_button=!1,this.in_carico=!1,this.respingi_button=!1,this.procedi_button=!0,this.utility_button=!0,this.show_logs=!0,this.show_commenti=!0,this.show_allegati=!0,this.force_save=!1,this.check_on_save=!1,this.download_button=!0,this.edit_comments_in_logs=!0,this.assegna_a=!1,this.next_label=!1,this.next_label_color=!1,this.back_lbl="Indietro",this.save_lbl="Salva",this.procedi_lbl="Procedi",this.respingi_lbl="Respingi",this.revisione_lbl="Revisione",this.info_doc_lbl="Info Doc",this.commenti_lbl="Commenti",this.allegati_lbl="Allegati",this.workflow_lbl="Workflow",this.prendi_in_carico_lbl="Prendi in Carico",this.b_revisione=!1,this.admin_role="[ZZZ_DIS_CC]",this.sovra_path="",this.command=new n.EventEmitter,this.comment_inserted=new n.EventEmitter,this.button_clicked=new n.EventEmitter}return t.prototype.exec_command=function(t){this.command.emit({cmd:t})},t.prototype.revisione=function(){this.button_clicked.emit("revisione"),null!=this.dt_agg&&this.dt_agg.revisione()},t.prototype.back=function(){this.button_clicked.emit("back"),null!=this.dt_agg&&this.dt_agg.back(this.edit_button)},t.prototype.evt_salv=function(){this.button_clicked.emit("evt_salv"),null!=this.dt_agg&&this.dt_agg.evt_salv(this.edit_button,this.check_on_save)},t.prototype.prendi_in_carico=function(){this.button_clicked.emit("prendi_in_c"),null!=this.dt_agg&&this.dt_agg.prendi_in_carico()},t.prototype.evt_assegna_a=function(){this.button_clicked.emit("assegna_a"),null!=this.dt_agg&&this.dt_agg.assegna_a()},t.prototype.respingi=function(){this.button_clicked.emit("respingi"),null!=this.dt_agg&&this.dt_agg.respingi()},t.prototype.procedi=function(){this.button_clicked.emit("procedi"),null!=this.dt_agg&&this.dt_agg.procedi()},t.prototype.open_info=function(){this.button_clicked.emit("open_info"),null!=this.dt_agg&&this.dt_agg.open_info()},t.prototype.open_commenti=function(){this.button_clicked.emit("open_commenti"),null!=this.dt_agg&&this.dt_agg.open_commenti(this.comment_inserted)},t.prototype.open_upload=function(){this.button_clicked.emit("open_upload"),null!=this.dt_agg&&this.dt_agg.open_upload(this.sovra_path,this.admin_role)},t.prototype.open_wkf=function(){console.log("this.edit_comments_in_logs ",this.edit_comments_in_logs),this.button_clicked.emit("open_wkf"),null!=this.dt_agg&&this.dt_agg.open_wkf(this.comment_inserted,!1,this.edit_comments_in_logs)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.back_lbl=t._trs.instant("Indietro"),t.save_lbl=t._trs.instant("Salva"),t.procedi_lbl=t._trs.instant("Procedi"),t.respingi_lbl=t._trs.instant("Respingi"),t.revisione_lbl=t._trs.instant("Revisione"),t.info_doc_lbl=t._trs.instant("Info Doc"),t.commenti_lbl=t._trs.instant("Commenti"),t.allegati_lbl=t._trs.instant("Allegati"),t.workflow_lbl=t._trs.instant("Workflow")}))},t}();Wi.decorators=[{type:n.Component,args:[{selector:"wkf_header_bar_v2",template:'\n <div fxLayout="row" fxLayoutGap.lt-md="8px" fxLayoutGap="15px" fxLayout.lt-md="column">\n <div\n fxLayout="row"\n fxLayoutGap="16px"\n fxLayoutGap.lt-md="8px"\n *ngIf="\n !m_appService.getState().pageFullscreen ||\n edit_button ||\n respingi_button\n "\n >\n <div>\n <button\n mat-flat-button\n (click)="back()"\n *ngIf="!m_appService.getState().pageFullscreen"\n >\n {{back_lbl}}</button\n ></div>\n <div *ngIf="(edit_button || force_save) && !in_carico">\n <button\n mat-flat-button\n (click)="evt_salv()"\n\n color="primary" style="font-weight:bold"\n >\n {{save_lbl}}</button\n ></div>\n\n\n <div>\n <button\n mat-flat-button\n (click)="prendi_in_carico()"\n *ngIf="in_carico"\n style="background-color:#709D66;color:#FFFFFF;font-weight:bold"\n >\n {{prendi_in_carico_lbl | translate}}</button\n ></div>\n\n <div *ngIf="dt_agg!=null && dt_agg?.b_init_next">\n\n <button\n mat-flat-button\n (click)="procedi()"\n *ngIf="(edit_button && procedi_button) && !in_carico"\n style="font-weight:bold" [style.background-color]="dt_agg?.next_back_ground_color" [style.color]="dt_agg?.next_label_color"\n >\n {{dt_agg?.next_label | translate}}</button>\n </div>\n\n <div *ngIf="(respingi_button) && !in_carico">\n <button\n mat-flat-button\n (click)="respingi()"\n style="font-weight:bold"\n color="warn"\n >\n {{respingi_lbl | translate}}\n </button>\n </div>\n <div *ngIf="(b_revisione) && in_carico">\n <button\n mat-flat-button\n (click)="revisione()"\n\n color="accent"\n >\n {{revisione_lbl | translate}}\n </button>\n </div>\n <div *ngIf="assegna_a">\n <button\n mat-flat-button\n (click)="evt_assegna_a()"\n\n style="background-color:#709D66;color:#FFF;font-weight:bold"\n >\n {{\'Riassegna a\'|translate}}</button\n ></div>\n\n <div>\n \x3c!-- <button mat-flat-button (click)="doEnd(900)" color="warn" >test</button> \n--\x3e\n </div>\n \n <div\n fxLayout="row"\n fxLayout.xs="column"\n fxLayoutGap="16px"\n fxLayoutGap.xs="8px"\n >\n <div fxLayout="row" fxLayoutGap="16px">\n <div>\n <button\n mat-flat-button\n (click)="open_info()"\n *ngIf="!m_appService.getState().pageFullscreen && utility_button"\n >\n <mat-icon>info_outline</mat-icon> {{info_doc_lbl | translate}}</button\n ></div>\n <div>\n <button\n mat-flat-button *ngIf="utility_button && show_commenti"\n [color]="(dt_agg?.comm_c ? dt_agg?.comm_c : 0 > 0) ? \'accent\' : \'\'"\n [matBadge]="dt_agg?.comm_c ? dt_agg?.comm_c : 0"\n matBadgePosition="before"\n matBadgeColor="primary"\n (click)="open_commenti()"\n >\n <mat-icon>insert_comment</mat-icon> {{commenti_lbl | translate}}</button\n ></div>\n\n </div>\n <div fxLayout="row" fxLayoutGap="16px">\n <div [hidden]="!download_button">\n <button\n mat-flat-button *ngIf="utility_button && show_allegati"\n [color]="(dt_agg?.all_c ? dt_agg?.all_c : 0 > 0) ? \'accent\' : \'\'"\n [matBadge]="dt_agg?.all_c ? dt_agg?.all_c : 0"\n matBadgePosition="before"\n matBadgeColor="primary"\n (click)="open_upload()"\n >\n <mat-icon>attach_file</mat-icon> {{allegati_lbl | translate}}</button\n ></div>\n\n <div>\n <button\n mat-flat-button\n (click)="open_wkf()"\n *ngIf="!m_appService.getState().pageFullscreen && utility_button && show_logs"\n >\n <mat-icon>transfer_within_a_station</mat-icon> {{workflow_lbl | translate}}\n </button>\n </div>\n\n\n\n </div>\n </div>\n <div\n *ngIf="custom_commands.length > 0"\n fxLayoutGap="10px"\n fxLayout="row"\n fxLayoutAlign="end center"\n >\n <div *ngFor="let app of custom_commands" fxLayout="row"\n fxLayoutGap="5px">\n <div><button [hidden]="app.hidden!=null && app.hidden"\n mat-flat-button\n [color]="app.color"\n (click)="exec_command(app.command)"\n >\n <mat-icon *ngIf="app.icon != null">{{ app.icon }}</mat-icon\n >{{ app.label | translate}}\n </button> </div>\n </div>\n </div>\n </div>\n '}]}],Wi.ctorParameters=function(){return[{type:wt},{type:p.TranslateService}]},Wi.propDecorators={custom_commands:[{type:n.Input}],dt_agg:[{type:n.Input}],edit_button:[{type:n.Input}],in_carico:[{type:n.Input}],respingi_button:[{type:n.Input}],procedi_button:[{type:n.Input}],utility_button:[{type:n.Input}],show_logs:[{type:n.Input}],show_commenti:[{type:n.Input}],show_allegati:[{type:n.Input}],force_save:[{type:n.Input}],check_on_save:[{type:n.Input}],download_button:[{type:n.Input}],edit_comments_in_logs:[{type:n.Input}],assegna_a:[{type:n.Input}],next_label:[{type:n.Input}],next_label_color:[{type:n.Input}],b_revisione:[{type:n.Input}],admin_role:[{type:n.Input}],sovra_path:[{type:n.Input}],command:[{type:n.Output}],comment_inserted:[{type:n.Output}],button_clicked:[{type:n.Output}]};var Ji=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.data=i,this.config={modules:{toolbar:[["bold","italic","underline","strike","image","link"],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["code-block","blockquote",{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"}]],keyboard:{bindings:{list:{key:"backspace",context:{format:["list"]},handler:function(t,e){0!==t.index&&(0===t.length?this.quill.deleteText(t.index-1,1,1):this.quill.deleteText(t,1))}}}}}},this.title="",this.label="",this.value="",this.readonly=!1,this.show_annulla=!0,this.show_ok=!0,this.min_chars=3,null!=i&&(null!=i.title&&(this.title=i.title),null!=i.label&&(this.label=i.label),null!=i.value&&(this.value=i.value),null!=i.readonly&&(this.readonly=i.readonly),null!=i.show_annulla&&(this.show_annulla=i.show_annulla),null!=i.show_ok&&(this.show_ok=i.show_ok),null!=i.min_chars&&(this.min_chars=i.min_chars))}return t.prototype.ngAfterViewInit=function(){},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.show=function(){},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.do_check=function(){this.value.length<this.min_chars?this.toastr.error("Il value deve contenere almeno "+this.min_chars+" caratteri"):this.dialogRef.close(this.value)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t}();Ji.decorators=[{type:n.Component,args:[{selector:"app-win_ask_richtext",template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{ title }}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <mat-dialog-content style="width:630px;font-size: 15px;">\n <b *ngIf="label != \'\'">{{ label }}</b>\n <quill-editor\n theme="snow"\n format="html"\n\n [(ngModel)]="value"\n ></quill-editor>\n\n </mat-dialog-content>\n <mat-dialog-actions>\n <div\n fxLayout="row"\n fxLayoutAlign="center center"\n style="width: 100%"\n [hidden]="readonly"\n >\n <button\n *ngIf="show_ok"\n mat-flat-button\n color="primary"\n (click)="do_check()"\n >\n OK</button\n > \n <button\n *ngIf="show_annulla"\n mat-flat-button\n color="warn"\n (click)="chiudi()"\n >\n ANNULLA\n </button>\n </div>\n <div\n fxLayout="row"\n fxLayoutAlign="center center"\n style="width: 100%"\n [hidden]="!readonly"\n >\n <button\n *ngIf="show_annulla"\n mat-flat-button\n color="warn"\n (click)="chiudi()"\n >\n CHIUDI\n </button>\n </div>\n </mat-dialog-actions>\n</div>\n '}]}],Ji.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var $i=function(){function t(t,e,i,o,s,a,r,l,p){var u=this;this._gridservice=t,this._toast=e,this._dataService=i,this.m_appService=o,this.slimLoadingBarService=s,this.m_dialog=a,this.uti_s=r,this._fileService=l,this.clipboard=p,this.width_max="100%",this.browser="nd",this.tooltipShowDelay=2e3,this.elimina_label="ELIMINA",this.export_field_aggiuntivi="",this.end_point=null,this.tbl_name="",this.num_per_pag=35,this.grid_key="PRO_H",this.enabled=!0,this.show_link=!1,this.show_help_bar=!1,this.help_label_bar="HELP",this.auto_load=!0,this.auto_height=!1,this.enable_export=!0,this.enabled_pag=!0,this.show_help=!0,this.show_num_elem=!0,this.system_dest=1,this.header_h=35,this.selection_mode="multiple",this.init_fill=!0,this.no_pref=!1,this.pref_hidden=!0,this.enable_export_pdf=!0,this.enable_export_xls=!0,this.enable_copy=!0,this.autosize_at_ini=!0,this.label_elementi=" Elementi",this.trova_label="TROVA",this.mantieni_impostazioni="Mantieni Imp.",this.curr_filter="",this.show_buttons=!0,this.fill_end=new n.EventEmitter,this.cell_edited=new n.EventEmitter,this.clicked=new n.EventEmitter,this.dclicked=new n.EventEmitter,this.columndclicked=new n.EventEmitter,this.cell_clicked=new n.EventEmitter,this.custom_export=!1,this.toolbar_type="NONE",this.toolbar_wkfapp=null,this.toolbar_custom_commands=[],this.command=new n.EventEmitter,this.b_ensure=!1,this.curr_config="-1",this.init_end=new n.EventEmitter,this.off_set=0,this.first_ref=!0,this.b_restored=!1,this.str_curr_q_p="",this.p_fi={},this.dataSource={getRows:function(t){u.slimLoadingBarService.start((function(){}));var e={kd:u.tbl_name};e.num_per_pag=t.endRow-t.startRow,e.curr_page=Math.round(t.startRow/e.num_per_pag),null==e.curr_page&&(e.curr_page=0),null==e.num_per_pag&&(e.num_per_pag=100),e.system_dest=u.system_dest,e.p=JSON.stringify({sort_model:t.sortModel,filter_model:t.filterModel,free_search:u.ric_libera}),null!=t.filterModel&&"{}"!=JSON.stringify(t.filterModel)||null!=u.ric_libera&&""!=u.ric_libera?u.show_pulisci_filtri=!0:u.show_pulisci_filtri=!1,u.p_fi={kd:e.kd,system_dest:e.system_dest,p:e.p},u._gridservice.doQuery(e,!0,u.m_appService.API_ENDPOINT+"dogridn").subscribe((function(i){var n=!1;if(null!=i&&"OK"==i.result_msg){n=!0,t.successCallback(i.result_data,i.count),u.b_init=!0,u.myData=i.result_data.slice(),u.num_r=i.count,u.slimLoadingBarService.complete(),u.fill_end.emit(),localStorage.setItem(u.grid_key+"_POS1",JSON.stringify(e)),null!=localStorage.getItem(u.grid_key+"_POS2")&&null!=u.gridOptions&&null!=u.gridOptions.api&&u.gridOptions.api.forEachNode((function(t){u.getRowNodeId(t)===localStorage.getItem(u.grid_key+"_POS2")&&(t.setSelected(!0),localStorage.removeItem(u.grid_key+"_POS2"),null!=localStorage.getItem(u.grid_key+"_LAST_ROW")&&(u.sRow=JSON.parse(localStorage.getItem(u.grid_key+"_LAST_ROW"))),localStorage.removeItem(u.grid_key+"_LAST_ROW"))}));null!=u.toggle_mantieni&&u.toggle_mantieni.checked,u.no_pref&&!u.b_init1&&u.autoSizeAll(),u.b_init1=!0,u.ensure_visible(),null==localStorage.getItem(u.grid_key+"_COLS")&&u.autosize_at_ini&&setTimeout((function(){u.autoSizeAll()}),300)}n||(u.errorMsg=i.msg+" ["+i.result_msg+"]")}),(function(t){u.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER. RITENTARE PIU' TARDI"}))}},this.getContextMenuItems_n_e=function(){return["autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste"]},this.getContextMenuItems_e=function(){return["autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste",{name:"Esporta",action:function(){u.export_excel()},icon:'<img src="assets/icons/square-o/xlsx.svg"/>'}]},this.gridOptions={debug:!1,headerHeight:this.header_h,enableRangeSelection:!0,defaultColDef:{resizable:!0,sortable:!0,floatingFilter:!0},allowContextMenuWithControlKey:!0,rowModelType:"infinite",localeText:{page:"pagina",more:"altre",to:"a",of:"di",next:"prossima",last:"ultima",first:"prima",previous:"precedente",loadingOoo:"Caricamento...",selectAll:"Seleziona Tutto",searchOoo:"Trova...",blanks:"Vuoto",filterOoo:"Filtro...",applyFilter:"Applica Filtro...",equals:"Uguale",notEqual:"Diverso",lessThan:"Minore o Uguale",greaterThan:"Maggiore o Uguale",notContains:"Non Contiene",contains:"Contiene",startsWith:"Inizia Con",endsWith:"Finisce Con",group:"Gruppo",columns:"Colonne",rowGroupColumns:"Colonne Pivot",rowGroupColumnsEmptyMessage:"trascina le colonne per raggrupparle",valueColumns:"Colonne Valore",pivotMode:"Modalità Pivot",groups:"Gruppi",values:"Valori",pivots:"Pivots",valueColumnsEmptyMessage:"trascina le colonne per aggreare",pivotColumnsEmptyMessage:"trascina le colonne per pivot",noRowsToShow:"nessun dato",pinColumn:"Sposta Colonna",valueAggregation:"Aggregazione",autosizeThiscolumn:"Autosize colonna",autosizeAllColumns:"Autosize tutte le colonne",groupBy:"Raggruppa per",ungroupBy:"Spacca per",resetColumns:"Resetta queste colonna",expandAll:"Espandi",collapseAll:"Chiudi",toolPanel:"Impostazioni",pinLeft:"Sposta <<",pinRight:"Sposta >>",noPin:"Sposta <>",sum:"Somma",min:"Minimo",max:"Massimo",none:"Nessuno",count:"Numero",average:"Media",copy:"Copia",ctrlC:"ctrl n C",paste:"Incolla",ctrlV:"ctrl n C"},getRowNodeId:function(t){return null!=t.ID?String(t.ID):null!=t.id?String(t.id):null!=t.uiid?t.uiid:null!=t.codice?t.codice:null!=t.id_doc?t.id_doc:null!=t.notesid?t.notesid:null!=t.ord?t.ord:void 0}},this.last_copy="",this.b_init=!1,this.b_init1=!1,this.errorMsg="",this.innerWidth=750,this.show_pulisci_filtri=!1,this.uiid_stampa="",this.xxopx=0,this.num_r=0,this.ready=!1,this.ckk_ed=!1,this.myData=new Array,this.b_iniended=!1,this.ric_libera="",this.fix_flt="",this.fix_flt_temp="",null==this.m_appService.getState().grid_obj&&(this.m_appService.getState().grid_obj={}),this.browser=this.getBrowserName(),"ie"==this.browser&&(this.width_max="")}return t.prototype.getBrowserName=function(){var t=window.navigator.userAgent.toLowerCase();switch(!0){case t.indexOf("edge")>-1:return"edge";case t.indexOf("opr")>-1&&!!window.opr:return"opera";case t.indexOf("chrome")>-1&&!!window.chrome:return"chrome";case t.indexOf("trident")>-1:return"ie";case t.indexOf("firefox")>-1:return"firefox";case t.indexOf("safari")>-1:return"safari";default:return"other"}},t.prototype.docmd=function(t){this.command.emit(t)},t.prototype.ensure_visible=function(){if(!this.b_ensure){this.b_ensure=!0;try{null!=localStorage.getItem(this.grid_key+"_POS")&&(this.gridOptions.api.ensureIndexVisible(parseInt(localStorage.getItem(this.grid_key+"_POS"))),localStorage.removeItem(this.grid_key+"_POS"))}catch(t){console.log(t)}}},t.prototype.ck_flag=function(){this.toggle_mantieni.checked?localStorage.setItem(this.grid_key+"_MANTIENI","NO"):localStorage.setItem(this.grid_key+"_MANTIENI","SI")},t.prototype.refresh_all_rows=function(){var t=this;setTimeout((function(){t.gridOptions.api.refreshCells({force:!0})}),0)},t.prototype.ch_config=function(){this.no_pref||(this.curr_config=this.gf.getValue(),"-1"!=this.curr_config&&(localStorage.removeItem(this.grid_key+"_COLS"),localStorage.removeItem(this.grid_key+"_FILTER"),localStorage.removeItem(this.grid_key+"_CFG_DEFAULT"),localStorage.removeItem(this.grid_key+"_FILTER_UP"),null!=this.gf.getObj().COL&&""!=this.gf.getObj().COL&&localStorage.setItem(this.grid_key+"_COLS",this.gf.getObj().COL),null!=this.gf.getObj().FILTER&&""!=this.gf.getObj().FILTER&&localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),null!=this.gf.getDescri()&&"-1"!=this.gf.getDescri()&&localStorage.setItem(this.grid_key+"_CFG_DEFAULT",this.gf.getDescri()),this.curr_config=this.gf.getValue(),this.res_columns(!0)))},t.prototype.elimina_config=function(){var t=this;null==this.gf.getObj().username||this.m_appService.user==this.gf.getObj().username?(localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler cancellare la configurazione "+this.gf.getDescri()+"?"),this.m_dialog.open(It,{disableClose:!0}).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="DELETE_CFG_GRID",i.types=["string","string"],i.values=[t.gf.getDescri(),t.grid_key];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione eliminata"),t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo(),t.curr_config="-1")}))}}))):this._toast.error("Configurazione gestibile da: "+this.gf.getObj().username)},t.prototype.edit_config=function(){var t=this;null==this.gf.getObj().username||this.m_appService.user==this.gf.getObj().username?(localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler sovrascrivere la configurazione "+this.gf.getDescri()+"?"),this.m_dialog.open(It,{disableClose:!0}).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="INSERT_UPDATE_CFG_GRID";var n="",o="";null!=localStorage.getItem(t.grid_key+"_COLS")&&(n=localStorage.getItem(t.grid_key+"_COLS")),null!=localStorage.getItem(t.grid_key+"_FILTER")&&(o=localStorage.getItem(t.grid_key+"_FILTER")),i.types=["string","string","string","string","string","string"],i.values=[t.gf.getDescri(),t.grid_key,n,"",o,t.m_appService.user];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione salvata"),t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo(),t.curr_config="-1")}),(function(t){}))}}))):this._toast.error("Configurazione gestibile da: "+this.gf.getObj().username)},t.prototype.refresh_access=function(t){this.toolbar_wkfapp=t},t.prototype.getGridApi=function(){return this.gridOptions.api},t.prototype.getGridOptions=function(){return this.gridOptions},t.prototype.insert_config=function(){var t=this;this.win_opt=this.m_dialog.open(re,{disableClose:!0}),setTimeout((function(){t.win_opt.componentInstance.title="Salva Configurazione",t.win_opt.componentInstance.label="Nome"})),this.win_opt.afterClosed().subscribe((function(e){if(e&&null!=e){var i=new vt;i.sql="INSERT_UPDATE_CFG_GRID";var n="",o="";null!=localStorage.getItem(t.grid_key+"_COLS")&&(n=localStorage.getItem(t.grid_key+"_COLS")),null!=localStorage.getItem(t.grid_key+"_FILTER")&&(o=localStorage.getItem(t.grid_key+"_FILTER")),i.types=["string","string","string","string","string","string"],i.values=[e,t.grid_key,n,"",o,t.m_appService.user];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione salvata"),!0,t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo())}),(function(t){}))}}))},t.prototype.onBtExport=function(){this.export_excel()},t.prototype.export_excel=function(t){var e=this;void 0===t&&(t="excel"),this.dialogRef_W=this.m_dialog.open(Nt,{disableClose:!0}),setTimeout((function(){e.dialogRef_W.componentInstance.label="EXPORT IN CORSO"})),this.p_fi.type=t,this.p_fi.uiid_stampa=this.uti_s.newGuid(),this.uiid_stampa=this.p_fi.uiid_stampa,this._gridservice.doQuery(this.p_fi,!0,this.m_appService.API_ENDPOINT+"doexportn").subscribe((function(i){e.check_end("pdf"==t?".pdf":".xlsx")}))},t.prototype.check_end=function(t){var e=this,i=new gt;i.p1=this.m_appService.LOCAL_PATH+"grid_reports\\"+this.uiid_stampa+"_"+this.m_appService.user+t,i.command="check_file",this._fileService.doQuery(i).subscribe((function(i){null!=i&&("N"==i.msg?setTimeout((function(){e.check_end(t)}),1e3):(setTimeout((function(){e.dialogRef_W.componentInstance.update_progess(100)})),window.open(e.m_appService.COMPANY_SITE_ROOT+"/grid_reports/"+e.uiid_stampa+"_"+e.m_appService.user+t)))}))},t.prototype.setHeaderHeight=function(t){var e=this;this.header_h=t,this.gridOptions.api.setHeaderHeight(this.header_h),this.gridOptions.suppressCopyRowsToClipboard=!0,this.gridOptions.sendToClipboard=function(t){console.log("v ",t),e.enable_copy&&e.gridApi.copySelectedRangeToClipboard(),e.clipboard.copy(t.data.split("\n")[0])}},t.prototype.getRowNodeId=function(t){return null==t||null==t.data?this.uti_s.newGuid():null!=t.data.id?String(t.data.id):null!=t.data.uiid?t.data.uiid:null!=t.data.codice?t.data.codice:"NA"},t.prototype.ngAfterViewInit=function(){var t=this;"PRO_H"==this.grid_key&&(this.no_pref=!0),setTimeout((function(){null==t.end_point&&(t.end_point=t.m_appService.API_ENDPOINT+t.m_appService.GRID_ENDPOINT),null!=localStorage.getItem(t.grid_key+"_FILTER_UP")&&(t.ric_libera=localStorage.getItem(t.grid_key+"_FILTER_UP")),t.onResize()}))},t.prototype.okr=function(t){t.data.nome_colonna=t.column.colDef.field,this.cell_edited.emit(t.data)},t.prototype.help_window=function(){this.m_dialog.open(ae,{disableClose:!0}).afterClosed().subscribe((function(t){}))},t.prototype.onResize=function(t){},t.prototype.autoSizeAll=function(){var t=this;if(null!=this.gridOptions&&null!=this.gridOptions.columnApi){var e=[];this.gridOptions.columnApi.getAllGridColumns().map((function(t){e.push(t.getColId())})),this.gridOptions.columnApi.autoSizeColumns(e),this.gridOptions.columnApi.getColumnState().length>0&&24==this.gridOptions.columnApi.getColumnState()[0].width?setTimeout((function(){t.autoSizeAll()}),300):this.save_cfg()}},t.prototype.fitSizeAll=function(){this.gridOptions.api.sizeColumnsToFit(),this.save_cfg()},t.prototype.selectCount=function(){var t=0;return this.gridOptions.api.forEachNode((function(e){e.isSelected()&&t++})),t},t.prototype.getquerySelected=function(t,e){var i="";return"String"==e&&this.gridOptions.api.forEachNode((function(e){e.isSelected()&&null!=e.data[t]&&(""!=i&&(i+=","),i=i+"'"+e.data[t]+"'")})),"Number"==e&&this.gridOptions.api.forEachNode((function(e){e.isSelected()&&null!=e.data[t]&&(""!=i&&(i+=","),i+=e.data[t])})),i},t.prototype.selectAllFiltered=function(){var t=this;this.gridOptions.api.forEachNode((function(e){t.gridOptions.api.selectNode(e,!0)}))},t.prototype.deselectAllFiltered=function(){var t=this;this.gridOptions.api.forEachNode((function(e){t.gridOptions.api.selectNode(e,!1)}))},t.prototype.pulisci_filtri=function(t){void 0===t&&(t=!0),localStorage.removeItem(this.grid_key+"_FILTER"),t&&(""!=this.ric_libera&&this.doFill("",!0,!1),this.ric_libera="",localStorage.removeItem(this.grid_key+"_FILTER_UP")),this.fix_flt_temp="",this.gridOptions.api.setFilterModel(null);this.gridOptions.api.setFilterModel({})},t.prototype.print=function(){this.custom_export?this.command.emit({cmd:"print_pdf"}):this.export_excel("pdf")},t.prototype.init_conf=function(){},t.prototype.createColumnDefs=function(t){},t.prototype.ckk=function(){var t=this;if(this.auto_load)if(null!=this.columnDefs)if(0!=this.columnDefs.length){if(!this.ckk_ed){if(this.ckk_ed=!0,null!=this.toggle_mantieni&&(this.toggle_mantieni.checked=!0,null!=localStorage.getItem(this.grid_key+"_MANTIENI")&&"NO"==localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.toggle_mantieni.checked=!1)),this.res_columns(),null!=localStorage.getItem(this.grid_key+"_POS")&&(this.b_restored=!0),null!=localStorage.getItem(this.grid_key+"_FILTER_UP")&&""!=localStorage.getItem(this.grid_key+"_FILTER_UP")){this.ric_libera=localStorage.getItem(this.grid_key+"_FILTER_UP");for(var e=this.ric_libera.split(" "),i=new Array,n=0;n<e.length;n++)i.push(e[n]);if(0==i.length)return;var o="",s=function(t){for(var e="",n=0;n<a.columnDefs.length;n++)null!=a.columnDefs[n]&&null==a.columnDefs[n].no_filter&&null!=a.columnDefs[n].field&&""!=a.columnDefs[n].field&&"agDateColumnFilter"!=a.columnDefs[n].filter&&(""!=e&&(e+=" or "),e+=a.columnDefs[n].field+" LIKE '%"+i[t].replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()+"%' ESCAPE '$'");null!=a.full_text_added_columns&&a.full_text_added_columns.map((function(n){null!=n&&""!=n&&(""!=e&&(e+=" or "),e+=n+" LIKE '%"+i[t].replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()+"%' ESCAPE '$'")})),""!=e&&(""!=o&&(o+=" and "),o+="("+e+")")},a=this;for(n=0;n<i.length;n++)s(n);this.fix_flt_temp=o}this.init_fill&&setTimeout((function(){t.ref_dt()}),100)}}else setTimeout((function(){t.ckk()}),500);else setTimeout((function(){t.ckk()}),500)},t.prototype.set_init_size=function(){var t=this;0!=this.myData.length?this.columnDefs.length<=6?this.fitSizeAll():this.autoSizeAll():setTimeout((function(){t.set_init_size()}),500)},t.prototype.res_columns=function(t){var e=this;if(void 0===t&&(t=!1),null!=this.columnDefs)if(0!=this.columnDefs.length){var i=!1;if(null!=this.toggle_mantieni&&(i=this.toggle_mantieni.checked),null!=localStorage.getItem(this.grid_key+"_COLS")&&""!=localStorage.getItem(this.grid_key+"_COLS")){if(null!=localStorage.getItem(this.grid_key+"_COLS")&&(i||t)&&""!=localStorage.getItem(this.grid_key+"_COLS")){!0;try{for(var n=JSON.parse(localStorage.getItem(this.grid_key+"_COLS")),o=!0,s=0;s<n.length;s++)n[s].hide||(o=!1);o?localStorage.getItem(this.grid_key+"_COLS"):this.gridOptions.columnApi.setColumnState(JSON.parse(localStorage.getItem(this.grid_key+"_COLS")))}catch(t){console.log(t)}}if(null!=localStorage.getItem(this.grid_key+"_FILTER")&&(i||t)&&""!=localStorage.getItem(this.grid_key+"_FILTER"))try{this.gridOptions.api.setFilterModel(JSON.parse(localStorage.getItem(this.grid_key+"_FILTER")))}catch(t){console.log(t)}}else this.set_init_size()}else setTimeout((function(){e.res_columns(t)}),200);else setTimeout((function(){e.res_columns(t)}),200)},t.prototype.getRows=function(){return this.gridOptions.rowData},t.prototype.sortAndFilter=function(t,e){},t.prototype.ref_dt=function(){var t=this;null==this.gridOptions||null==this.gridOptions.api?setTimeout((function(){t.ref_dt()}),500):this.gridOptions.api.setDatasource(this.dataSource)},t.prototype.updateRow=function(){this.refresh_all_rows()},t.prototype.onModelUpdated=function(){},t.prototype.onReady=function(t){this.gridApi=t.api,this.setHeaderHeight(this.header_h),null!=this.gf&&this.show_buttons&&!this.pref_hidden&&(this.gf.sql="SELECT_CFG_GRID",this.gf.types=["string"],this.gf.values=[this.grid_key],this.gf.fillCombo(),"NO"!=localStorage.getItem(this.grid_key+"_MANTIENI")&&null!=localStorage.getItem(this.grid_key+"_CFG_DEFAULT"))||this.auto_load&&this.onready_go()},t.prototype.init_grid=function(){this.auto_load=!0,this.onready_go()},t.prototype.save_cfg=function(){localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.fe_cfg=function(){null!=this.gf&&null!=this.gf.getObj()&&"NO"!=localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.gf.setByDescri(localStorage.getItem(this.grid_key+"_CFG_DEFAULT")),localStorage.setItem(this.grid_key+"_COLS",this.gf.getObj().COLS),localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),this.curr_config=this.gf.getValue()),this.onready_go()},t.prototype.onready_go=function(){var t=this;this.ready=!0,setTimeout((function(){t.ckk()}),10),this.b_iniended||(this.b_iniended=!0,this.init_end.emit())},t.prototype.init_filters=function(){},t.prototype.keyDownFunctioncl=function(t){13==t.keyCode&&this.free_search()},t.prototype.free_search=function(){if(""==this.ric_libera)return this.pulisci_filtri(),this.fix_flt_temp="",this.doFill("",!0,!1),void localStorage.removeItem(this.grid_key+"_FILTER_UP");localStorage.setItem(this.grid_key+"_FILTER_UP",this.ric_libera);for(var t=this.ric_libera.split(" "),e=new Array,i=0;i<t.length;i++)e.push(t[i]);if(0!=e.length){var n="",o=function(t){for(var i="",o=0;o<s.columnDefs.length;o++)null!=s.columnDefs[o]&&null==s.columnDefs[o].no_filter&&null!=s.columnDefs[o].field&&""!=s.columnDefs[o].field&&"agDateColumnFilter"!=s.columnDefs[o].filter&&(""!=i&&(i+=" or "),i+=s.columnDefs[o].field+" LIKE '%"+e[t].replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()+"%' ESCAPE '$'");null!=s.full_text_added_columns&&s.full_text_added_columns.map((function(n){null!=n&&""!=n&&(""!=i&&(i+=" or "),i+=n+" LIKE '%"+e[t].replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()+"%' ESCAPE '$'")})),""!=i&&(console.log("ADDO "),""!=n&&(n+=" and "),n+="("+i+")")},s=this;for(i=0;i<e.length;i++)o(i);this.pulisci_filtri(!1),this.doFill_Temp(n,!0)}},t.prototype.onCellClicked=function(t){this.cell_clicked.emit(t)},t.prototype.onCellValueChanged=function(t){},t.prototype.onCellDoubleClicked=function(t){},t.prototype.onCellFocused=function(t){},t.prototype.onSelectionChanged=function(){},t.prototype.onBeforeFilterChanged=function(){},t.prototype.oncolumnEverythingChanged=function(t){this.b_init&&localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.onFilterModified=function(){var t=this;this.no_pref||setTimeout((function(){t.b_init&&localStorage.setItem(t.grid_key+"_FILTER",JSON.stringify(t.gridOptions.api.getFilterModel()))}),200)},t.prototype.onBeforeSortChanged=function(){},t.prototype.onAfterSortChanged=function(){this.no_pref||this.b_init&&localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.onVirtualRowRemoved=function(t){},t.prototype.onRowClicked=function(t){var e=this.gridOptions.api.getSelectedNodes();null!=e&&null!=e[0]&&(localStorage.setItem(this.grid_key+"_POS",String(e[0].rowIndex)),localStorage.setItem(this.grid_key+"_POS_BAR",JSON.stringify(this.gridOptions.api.getVerticalPixelRange())),localStorage.setItem(this.grid_key+"_POS2",this.getRowNodeId(e[0]))),this.sRow=t.data,localStorage.setItem(this.grid_key+"_LAST_ROW",JSON.stringify(this.sRow)),this.clicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&(this.columndclicked.emit(t),this.dclicked.emit(t.data))},t.prototype.onRowDClicked=function(t){this.dclicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&this.columndclicked.emit(t)},t.prototype.onQuickFilterChanged=function(t){this.gridOptions.api.setQuickFilter(t.target.value)},t.prototype.onColumnEvent=function(t){this.columndclicked.emit(t)},t.prototype.doFill=function(t,e,i){var n=this;void 0===e&&(e=!0),void 0===i&&(i=!0),i&&(this.fix_flt=t),this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout((function(){n.ckk()}),10)},t.prototype.doFill_Temp=function(t,e){var i=this;void 0===e&&(e=!0),this.fix_flt_temp=t,this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout((function(){i.Refresh()}),10)},t.prototype.Refresh=function(){this.ref_dt()},t.prototype.RefreshOnlyMemory=function(){this.updateRow()},t}();$i.decorators=[{type:n.Component,args:[{selector:"FHGridN",template:'<div fxLayout="column" fxFlexFill>\n <div\n fxLayout="row"\n fxLayout.xs="column"\n fxLayoutAlign="center start"\n fxLayoutGap="3px"\n style="min-height: 55px;"\n [hidden]="!show_buttons"\n >\n \n <div fxLayout="row" fxLayoutGap="3px" fxLayoutAlign="start center">\n <div>\n <h5>{{num_r}} {{label_elementi | translate}}</h5>\n </div>\n \n\n <div fxLayout="row" fxLayoutAlign="start center">\n <input\n matInput\n [placeholder]="trova_label | translate"\n (keydown)="keyDownFunctioncl($event)"\n [(ngModel)]="ric_libera"\n style="\n width: 200px;\n border: 1px solid;\n min-height: 30px;\n "\n />\n </div>\n\n <div\n matTooltip="REMOVE FILTER"\n matTooltipPosition="above"\n *ngIf="show_pulisci_filtri"\n >\n <button mat-flat-button (click)="pulisci_filtri()" color="warn">\n <mat-icon>filter_none</mat-icon> \n </button>\n </div>\n <div matTooltip="AUTO SIZE" matTooltipPosition="above">\n <button\n mat-flat-button\n (click)="autoSizeAll()"\n color="accent"\n *ngIf="show_buttons"\n >\n <mat-icon>swap_horiz</mat-icon>\n </button>\n </div>\n <div fxHide fxShow.gt-sm matTooltip="FIT SIZE" matTooltipPosition="above">\n <button\n mat-flat-button\n (click)="fitSizeAll()"\n color="accent"\n *ngIf="show_buttons"\n >\n <mat-icon>keyboard_tab</mat-icon>\n </button>\n </div>\n <div fxHide fxShow.gt-sm matTooltip="Refresh" matTooltipPosition="above">\n <button\n mat-flat-button\n (click)="Refresh()"\n color="accent"\n *ngIf="show_buttons"\n >\n <mat-icon>autorenew</mat-icon>\n </button>\n </div>\n <FHFilterComboBox\n fxHide\n fxShow.gt-sm\n [hidden]="!show_buttons || pref_hidden"\n (selchange)="ch_config()"\n (fillend)="fe_cfg()"\n #gf\n init_fill="false"\n ></FHFilterComboBox>\n <div\n matTooltip="Modifica Preferenza"\n matTooltipPosition="above"\n *ngIf="curr_config!=\'-1\'"\n >\n <button\n mat-icon-button\n *ngIf="show_buttons && !pref_hidden"\n style="color: rgb(248, 105, 10);"\n >\n <mat-icon (click)="edit_config()">save</mat-icon>\n </button>\n </div>\n <div\n matTooltip="Elimina Preferenza"\n matTooltipPosition="above"\n *ngIf="curr_config!=\'-1\'"\n >\n <button\n mat-icon-button\n *ngIf="show_buttons && !pref_hidden"\n style="color: rgb(248, 105, 10);"\n >\n <mat-icon (click)="elimina_config()">delete</mat-icon>\n </button>\n </div>\n <div\n fxHide\n fxShow.gt-sm\n matTooltip="Crea Nuova Preferenza"\n matTooltipPosition="above"\n >\n <button\n mat-icon-button\n style="color: rgb(16, 98, 16);"\n *ngIf="show_buttons && !pref_hidden"\n >\n <mat-icon (click)="insert_config()">library_add</mat-icon>\n </button>\n </div>\n\n <mat-slide-toggle\n fxHide\n fxShow.gt-sm\n [hidden]="!show_buttons || pref_hidden"\n (click)="ck_flag()"\n #toggle_mantieni\n >\n {{mantieni_impostazioni}}\n </mat-slide-toggle>\n\n \n <div fxHide fxShow.gt-sm matTooltip="HELP" matTooltipPosition="above">\n <button\n mat-flat-button\n (click)="help_window()"\n color="primary"\n *ngIf="show_buttons && show_help"\n >\n <mat-icon>help</mat-icon>\n </button>\n </div>\n \n\n <img\n *ngIf="enable_export && enable_export_pdf"\n matTooltip="EXPORT PDF"\n matTooltipPosition="above"\n src="assets/icons/square-o/pdf.svg"\n style="width: 24px; height: 24px; cursor: pointer"\n (click)="print()"\n alt="Export PDF"\n width="24" height="24"\n />\n\n\n <img *ngIf="enable_export && enable_export_xls"\n matTooltip="EXPORT EXCEL"\n matTooltipPosition="above"\n src="assets/icons/square-o/xlsx.svg"\n style="width: 24px; height: 24px; cursor: pointer"\n (click)="export_excel()"\n alt="Export Excel"\n width="24" height="24"\n />\n\n </div>\n <div\n fxLayout="row"\n fxLayoutAlign="end center"\n\n [style.width]="width_max"\n *ngIf="enabled"\n >\n\n <FHGridToolBar\n (command)="docmd($event)"\n [type]="toolbar_type"\n [show_link]="show_link"\n [show_help]="show_help_bar"\n [help_label]="help_label_bar"\n [custom_commands]="toolbar_custom_commands"\n [toolbar_wkfapp]="toolbar_wkfapp"\n [elimina_label]="elimina_label"\n [sRow]="sRow"\n ></FHGridToolBar>\n </div>\n </div>\n\n\n <div fxLayout="row" style="width: 100%;" [fxFlex]="show_buttons ? 100:95">\n <ag-grid-angular\n ref-agGrid\n style="width: 100%; height: 100%;"\n id="myGrid"\n (cellDoubleClicked)="onColumnEvent($event)"\n (cellClicked)="onCellClicked($event)"\n [headerHeight]="header_h"\n [groupHeaderHeight]="header_h"\n class="ag-theme-balham"\n [singleClickEdit]="true"\n [gridOptions]="gridOptions"\n [columnDefs]="columnDefs"\n [rowData]="rowData"\n [rowSelection]="selection_mode"\n [tooltipShowDelay]="tooltipShowDelay"\n [getContextMenuItems]="enable_export ? getContextMenuItems_e:getContextMenuItems_n_e"\n (filterModified)="onFilterModified()"\n (rowDoubleClicked)="onRowDClicked($event)"\n (rowClicked)="onRowClicked($event)"\n (columnVisible)="oncolumnEverythingChanged($event)"\n (columnResized)="oncolumnEverythingChanged($event)"\n (columnMoved)="oncolumnEverythingChanged($event)"\n (cellValueChanged)="okr($event)"\n (sortChanged)="onAfterSortChanged()"\n [paginationPageSize]="num_per_pag"\n (gridReady)="onReady($event)"\n >\n </ag-grid-angular>\n </div>\n</div>\n',styles:[""]}]}],$i.ctorParameters=function(){return[{type:se},{type:i.ToastrService},{type:Dt},{type:wt},{type:h.SlimLoadingBarService},{type:e.MatDialog},{type:Ct},{type:Tt},{type:m.Clipboard}]},$i.propDecorators={tooltipShowDelay:[{type:n.Input}],elimina_label:[{type:n.Input}],export_field_aggiuntivi:[{type:n.Input}],end_point:[{type:n.Input}],tbl_name:[{type:n.Input}],columnDefs:[{type:n.Input}],num_per_pag:[{type:n.Input}],grid_key:[{type:n.Input}],enabled:[{type:n.Input}],show_link:[{type:n.Input}],show_help_bar:[{type:n.Input}],help_label_bar:[{type:n.Input}],auto_load:[{type:n.Input}],auto_height:[{type:n.Input}],enable_export:[{type:n.Input}],enabled_pag:[{type:n.Input}],show_help:[{type:n.Input}],show_num_elem:[{type:n.Input}],system_dest:[{type:n.Input}],header_h:[{type:n.Input}],selection_mode:[{type:n.Input}],init_fill:[{type:n.Input}],no_pref:[{type:n.Input}],pref_hidden:[{type:n.Input}],enable_export_pdf:[{type:n.Input}],enable_export_xls:[{type:n.Input}],enable_copy:[{type:n.Input}],full_text_added_columns:[{type:n.Input}],autosize_at_ini:[{type:n.Input}],label_elementi:[{type:n.Input}],trova_label:[{type:n.Input}],mantieni_impostazioni:[{type:n.Input}],show_buttons:[{type:n.Input}],fill_end:[{type:n.Output}],cell_edited:[{type:n.Output}],clicked:[{type:n.Output}],dclicked:[{type:n.Output}],columndclicked:[{type:n.Output}],cell_clicked:[{type:n.Output}],custom_export:[{type:n.Input}],toolbar_type:[{type:n.Input}],toolbar_wkfapp:[{type:n.Input}],toolbar_custom_commands:[{type:n.Input}],command:[{type:n.Output}],gf:[{type:n.ViewChild,args:["gf"]}],toggle_mantieni:[{type:n.ViewChild,args:["toggle_mantieni"]}],init_end:[{type:n.Output}],off_set:[{type:n.Input}],onResize:[{type:n.HostListener,args:["window:resize",["event"]]}]};var Xi=function(){function t(t,e,i,n,o){if(this.dialogRef=t,this.m_appService=e,this.toastr=i,this._trs=n,this.data=o,this.op="L",this.lbl="",this.nota="",this.hide_row_cmd=!1,this.nota_commento="",this.title="",this.comm_notrequired=0,this.prendi_in_carico=!0,this.all_users=[],null!=o&&(null!=o.commento_default&&(this.nota=o.commento_default),null!=o.comm_notrequired&&(this.comm_notrequired=o.comm_notrequired?1:0),null!=o.title&&(this.title=o.title),null!=o.lbl&&(this.lbl=o.lbl),null!=o.only_riassegna&&o.only_riassegna&&(this.op="A",this.hide_row_cmd=!0),null!=o.utenti)){this.arrAutori=o.utenti,this.all_users=JSON.parse(JSON.stringify(o.utenti)),null!=o.prendi_in_carico&&(this.prendi_in_carico=o.prendi_in_carico),this.title=this._trs.instant("ASSEGNA DOCUMENTO");for(var s=0;s<this.arrAutori.length;s++)null==this.arrAutori[s].username&&(this.arrAutori[s].username=this.arrAutori[s].idp);2==this.comm_notrequired&&(this.nota_commento=this._trs.instant(" (COMMENTO NON OBBLIGATORIO)")),null!=o&&(null!=o.commento_default&&(this.nota=o.commento_default),null!=o.comm_notrequired&&(this.comm_notrequired=o.comm_notrequired))}}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){var t=this;if("A"!=this.op||0!=this.up.getSelArr().length){var e=new Object;e.nota=this.nota,"A"==this.op?e.arrsel=this.up.getSelArr():"L"==this.op?e.arrsel=this.all_users:"C"==this.op&&this.all_users.map((function(i){i.username==t.m_appService.user&&(e.arrsel=[i])})),e.op=this.op,this.dialogRef.close(e)}else this.toastr.error("ERRORE",this._trs.instant("SELEZIONARE ALMENO UN UTENTE"),{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();Xi.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n <div\n mat-dialog-content\n fxLayout="column"\n style="font-size: 15px;min-width: 750px"\n >\n <br><br>\n <div fxLayout="row" style="font-size: 15px;min-width: 90px" fxLayoutAlign="start center" fxFlexGap="5px" fxFlex="100" [hidden]="hide_row_cmd">\n <div style="width:100px;font-weight:bold">Operazione:*</div>\n <mat-radio-group [(ngModel)]="op">\n <mat-radio-button [hidden]="prendi_in_carico" value="L">LIBERA</mat-radio-button> \n <mat-radio-button value="A">RIASSEGNA A</mat-radio-button> \n <mat-radio-button [hidden]="!prendi_in_carico" value="C">PRENDI IN CARICO</mat-radio-button>\n </mat-radio-group>\n </div>\n <div style="width:100%;height:450px" [hidden]="op!=\'A\'">\n <FHPickUsers\n #up\n [users_list]="arrAutori"\n [vis_buttons]="false"\n ></FHPickUsers>\n </div>\n\n </div>\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()"> {{\'OK\' | translate }}</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n {{\'ANNULLA\' | translate }}\n </button>\n </div>\n </div>\n '}]}],Xi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:p.TranslateService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Xi.propDecorators={up:[{type:n.ViewChild,args:["up"]}]};var Zi=function(){function t(t,e,i,n,o){var s=this;this.dialogRef=t,this._dataService=e,this.toastr=i,this.apps=n,this.data=o,this.selection_mode="multiple",this.value_sel=[],this.gridOptions={debug:!1,enableRangeSelection:!0,defaultColDef:{resizable:!0,sortable:!0,floatingFilter:!0},allowContextMenuWithControlKey:!0,localeText:{page:"pagina",more:"altre",to:"a",of:"di",next:"prossima",last:"ultima",first:"prima",previous:"precedente",loadingOoo:"Caricamento...",selectAll:"Seleziona Tutto",searchOoo:"Trova...",blanks:"Vuoto",filterOoo:"Filtro...",applyFilter:"Applica Filtro...",equals:"Uguale",notEqual:"Diverso",lessThan:"Minore o Uguale",greaterThan:"Maggiore o Uguale",notContains:"Non Contiene",contains:"Contiene",startsWith:"Inizia Con",endsWith:"Finisce Con",group:"Gruppo",columns:"Colonne",rowGroupColumns:"Colonne Pivot",rowGroupColumnsEmptyMessage:"trascina le colonne per raggrupparle",valueColumns:"Colonne Valore",pivotMode:"Modalità Pivot",groups:"Gruppi",values:"Valori",pivots:"Pivots",valueColumnsEmptyMessage:"trascina le colonne per aggreare",pivotColumnsEmptyMessage:"trascina le colonne per pivot",noRowsToShow:"nessun dato",pinColumn:"Sposta Colonna",valueAggregation:"Aggregazione",autosizeThiscolumn:"Autosize colonna",autosizeAllColumns:"Autosize tutte le colonne",groupBy:"Raggruppa per",ungroupBy:"Spacca per",resetColumns:"Resetta queste colonna",expandAll:"Espandi",collapseAll:"Chiudi",toolPanel:"Impostazioni",pinLeft:"Sposta <<",pinRight:"Sposta >>",noPin:"Sposta <>",sum:"Somma",min:"Minimo",max:"Massimo",none:"Nessuno",count:"Numero",average:"Media",copy:"Copia",ctrlC:"ctrl n C",paste:"Incolla",ctrlV:"ctrl n C"}},this.cc_pro=[{color:"accent",command:"sel_tutto",icon:"select_all",label:"Seleziona Tutto"},{color:"accent",command:"desel_tutto",icon:"all_out",label:"Deseleziona tutto"}],this.defaultColDef={flex:1,minWidth:100,resizable:!0,headerCheckboxSelection:this.isFirstColumn,checkboxSelection:this.isFirstColumn},this.columnDefs=[],this.system_dest=1,this.title="",this.tbl_name="",this.tbl_flt="",this.option=0,this.init=!1,null!=o&&(null!=o.title&&(this.title=o.title),null!=o.column_defs&&(this.columnDefs=o.column_defs),null!=o.value_sel&&(this.value_sel=o.value_sel),this._dataService.doQuery(o.p_query).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(s.rowData=t.result_data,s.fe())})))}return t.prototype.onReady=function(t){this.gridApi=t.api,this.fe()},t.prototype.cmd_wkf_prog=function(t){if("sel_tutto"==t.cmd){console.log(this.rowData);for(var e=function(t){var e,n=i.rowData[t];e=n.valore,i.getGridApi().forEachNode((function(t){t.data.valore==e&&t.setSelected(!0)}))},i=this,n=0;n<this.rowData.length;n++)e(n)}if("desel_tutto"==t.cmd){var o=function(t){var e,i=s.rowData[t];e=i.valore,s.getGridApi().forEachNode((function(t){t.data.valore==e&&t.setSelected(!1)}))},s=this;for(n=0;n<this.rowData.length;n++)o(n)}},t.prototype.getGridApi=function(){return this.gridOptions.api},t.prototype.getGridOptions=function(){return this.gridOptions},t.prototype.selc=function(t){var e=this;this.option=t;var i=this.getGridApi().getSelectedNodes();this.value_sel=[],i.map((function(t){e.value_sel.push({valore:t.data})}))},t.prototype.onSelectionChanged=function(t){var e=this,i=this.getGridApi().getSelectedNodes().length;this.option=i;var n=this.getGridApi().getSelectedNodes();this.value_sel=[],n.map((function(t){e.value_sel.push(t.data)})),console.log("selectionChanged")},t.prototype.isFirstColumn=function(t){return t.columnApi.getAllDisplayedColumns()[0]===t.column},t.prototype.ngAfterViewInit=function(){},t.prototype.fe=function(){var t=this;setTimeout((function(){console.log("this.getGridApi() ",t.getGridApi(),t.value_sel),t.value_sel.map((function(e){t.getGridApi().forEachNode((function(t){t.data.valore==e.valore&&t.setSelected(!0)}))}))}),100)},t.prototype.getSelStr=function(){for(var t="",e=0;e<this.value_sel.length;e++)""!=t&&(t+=","),t+=this.value_sel[e].descrizione_valore;return t},t.prototype.getSelVal=function(){for(var t="",e=0;e<this.value_sel.length;e++)""!=t&&(t+=","),t+=this.value_sel[e].valore;return t},t.prototype.getSelArr=function(){return this.value_sel},t.prototype.ok=function(){this.dialogRef.close(this.getSelArr())},t}();Zi.decorators=[{type:n.Component,args:[{selector:"PickList",template:'\n <div fxLayout="column">\n<div fxFlex="100" fxLayout="row" fxLayoutAlign="start center" class="dialog_header"> \n<div fxLayout="row" fxLayoutAlign="start center" fxFlex="50"><div>{{title}}</div></div> \n<div fxFlex="50" fxLayout="row" fxLayoutAlign="end center">\n<div style="width: 100%;text-align:right">\n<img src="assets/icons/x.png" style="cursor: pointer;" (click)="dialogRef.close(null)" />\n</div>\n</div>\n</div>\n<hr width="100%" size="0.5" color="#DDDDDD">\n\n <div [style.height]="\'500px\'" style="width:100%;overflow:auto;">\n\n <ag-grid-angular\n ref-agGrid\n style="width: 100%; height: 100%;"\n id="myGrid"\n class="ag-theme-balham"\n [columnDefs]="columnDefs"\n [rowData]="rowData"\n (gridReady)="onReady($event)"\n [rowSelection]="selection_mode"\n [gridOptions]="gridOptions"\n (selectionChanged)="onSelectionChanged($event)"\n >\n </ag-grid-angular>\n\n </div>\n\n <br /><br />\n <div fxLayout="row" fxLayoutAlign="center center" fxLayoutGap="5px">\n <button mat-flat-button color="primary" (click)="ok()">Ok ({{value_sel.length}})</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="dialogRef.close()"\n >\n {{\'Annulla\' }}\n </button>\n </div> </div>\n\n ',styles:["\n .mat-dialog-content { max-height: unset !important; }\n .selector {\n cursor: hand;\n }\n "]}]}],Zi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:Dt},{type:i.ToastrService},{type:wt},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Zi.propDecorators={selection_mode:[{type:n.Input}],dtmt:[{type:n.ViewChild,args:["dtmt"]}]};var tn=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[wt,j.NgForage,Dt,Wt,Tt,Qt,ei,se,ee,Ct,pi,ue]}},t.forChilds=function(){return{ngModule:t,providers:[]}},t}();tn.decorators=[{type:n.NgModule,args:[{imports:[p.TranslateModule,z.CdkTableModule,mt.MatBadgeModule,g.MatAutocompleteModule,e.MatDialogModule,q.MatButtonModule,K.MatButtonToggleModule,V.MatCardModule,G.MatCheckboxModule,B.MatChipsModule,H.MatDatepickerModule,Y.MatExpansionModule,Q.MatFormFieldModule,W.MatGridListModule,J.MatIconModule,$.MatInputModule,X.MatListModule,Z.MatMenuModule,tt.MatProgressBarModule,et.MatProgressSpinnerModule,it.MatRadioModule,nt.MatSelectModule,ot.MatSlideToggleModule,st.MatSliderModule,at.MatSidenavModule,rt.MatSnackBarModule,lt.MatStepperModule,pt.MatTabsModule,ut.MatToolbarModule,ct.MatTooltipModule,dt.MatPaginatorModule,_t.MatSortModule,ht.MatTableModule,y.MatNativeDateModule,u.FileUploadModule,M.AgGridModule.withComponents([Jt]),b.CommonModule,U.DragulaModule,c.FormsModule,P.AgmCoreModule.forRoot({apiKey:"AIzaSyD3-g3b_QqxUruxBY4PGJKaH2fubIVXvN4"}),N.FlexLayoutModule,ft.QuillModule,F.MarkdownModule],exports:[jt,Vt,Kt,Ht,Yt,Ri,Ee,Ti,ki,Ai,Ii,gi,fi,mi,$t,Zt,te,ne,oe,ce,$i,_e,It,me,Ie,Jt,xe,Ae,Te,Gt,ke,De,Zi,Le,Re,Ne,yt,Me,re,Mt,Pe,je,Ue,bt,Ji,qe,Ge,Be,di,He,Nt,Qe,ui,We,_i,hi,Oi,zt,Rt,Ft,ie,Lt,Fe,Wi],declarations:[jt,Ut,Vt,Kt,Ht,Yt,Ri,Ee,Di,Ti,ki,Ai,Ii,wi,bi,Gt,gi,fi,mi,ci,$t,Zi,Zt,te,ne,oe,di,ce,$i,_e,It,me,Ie,Jt,xe,Ae,Te,ke,De,ae,Le,Re,Ne,yt,Me,re,Mt,Pe,je,Ue,bt,Ji,qe,Ge,Be,He,Nt,Qe,We,Je,$e,Xe,Ze,qt,ii,ni,oi,si,ai,ri,li,ti,ui,_i,hi,Oi,xi,Ei,Ci,zt,Rt,Ft,ie,Lt,Fe,Ki,Ni,Pi,Bi,Hi,Qi,Mi,zi,Ui,Vi,qi,Gi,Yi,Fi,Wi,ji,Xi],providers:[ze,U.DragulaService]}]}];var en=function(){function t(t,e,i,n,o,s,a){this.http=t,this.auth=e,this.toast=n,this.querys=o,this.slimLoadingBarService=s,this.app_s=a,this.url=this.app_s.API_ENDPOINT+this.app_s.QUERY_ENDPOINT,this.routingDestination="",this.arr_accessi=null}return t.prototype.canActivate=function(t,e){var i=this;return this.routingDestination=t.url[0].path,""==this.routingDestination||("login"==this.routingDestination||"rp"==this.routingDestination||"pr"==this.routingDestination||"/"==this.routingDestination||(this.auth.checkCredentials()?"home"==this.routingDestination||(null!=this.app_s.user_isadmin&&"1"==this.app_s.user_isadmin||new Promise((function(t){if(null!=i.arr_accessi){for(var e=0;e<i.arr_accessi.length;e++)if("M"==i.arr_accessi[e].type&&"["+i.arr_accessi[e].url.split("/")[0]+"]"=="["+i.routingDestination.split("/")[0]+"]")return void t(!0);return i.toast.error("ACCESS DENIED [0X0003]"),i.slimLoadingBarService.complete(),void t(!1)}var n=new vt;if(n.sql="SELECT_USER_ACCESS",n.values=[],n.types=[],null==i.app_s.user||null==i.app_s.user_isadmin)i.querys.doQuery(n).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){if(!(e.result_data.length>0))return i.toast.error("ACCESS DENIED [0X0002]"),i.slimLoadingBarService.complete(),t(!1),!1;if(i.app_s.user_roles=e.result_data[0].roles,null!=i.app_s.user_roles&&i.app_s.user_roles.length>0&&(i.app_s.user_roles=i.app_s.user_roles.substr(1)),null==i.app_s.user_roles&&(i.app_s.user_roles="[NO_RUOLI_CONFIGURATI]"),i.app_s.user_isadmin=e.result_data[0].isadmin,i.app_s.user=e.result_data[0].username,null!=i.app_s.user_isadmin&&"1"==i.app_s.user_isadmin)return void t(!0);var n=new vt;n.sql="SELECT_APPS_USER_ALL",i.app_s.getState().app_enabled=[],n.types=["string"],n.values=[i.app_s.user],i.querys.doQuery(n).subscribe((function(e){i.arr_accessi=e.result_data;for(var n=0;n<i.arr_accessi.length;n++)if("M"==i.arr_accessi[n].type&&"["+i.arr_accessi[n].url.split("/")[0]+"]"=="["+i.routingDestination.split("/")[0]+"]")return void t(!0);i.toast.error("ACCESS DENIED [0X0001]"),t(!1),i.slimLoadingBarService.complete()}))}}));else{var o=new vt;if(null!=i.app_s.user_isadmin&&i.app_s.user_isadmin+""=="1")return void t(!0);o.sql="SELECT_APPS_USER_ALL",i.app_s.getState().app_enabled=[],o.types=["string"],o.values=[i.app_s.user],i.querys.doQuery(o).subscribe((function(e){i.arr_accessi=e.result_data;for(var n=0;n<i.arr_accessi.length;n++)if("M"==i.arr_accessi[n].type&&"["+i.arr_accessi[n].url.split("/")[0]+"]"=="["+i.routingDestination.split("/")[0]+"]")return void t(!0);i.toast.error("ACCESS DENIED [0X0005]"),t(!1),i.slimLoadingBarService.complete()}))}}))):(this.toast.error("ACCESS DENIED [0X0004]"),this.slimLoadingBarService.complete(),!1)))},t}();en.decorators=[{type:n.Injectable}],en.ctorParameters=function(){return[{type:r.HttpClient},{type:ee},{type:d.Router},{type:i.ToastrService},{type:Dt},{type:h.SlimLoadingBarService},{type:wt}]};var nn=function(){this.result_data=new Array},on=function(){this.result_data=new Array},sn=function(){function t(t,e,i,n,o,s,a,r,l,p){this.app_s=t,this.m_service=e,this.m_dataService=i,this.m_fservice=n,this.m_router=o,this._toastr=s,this.dialog=a,this.m_wkf=r,this.m_uti=l,this.tsr=p,this.b_editing=!1,this.is_Supervisor=!1,this.is_Visor=!1,this.is_Admin=!1,this.is_PowerUser=!1,this.is_Ins=!1,this.id_applicativo="",this.codice_app="",this.att_panelcat="",this.documento_pubblico=!1,this.titolo_email="",this.tbl_name="",this.app_root="",this.grid_key="",this.m_id_Doc="",this.title="",this.user_nome="",this.user_cognome="",this.user_email="",this.b_initd=!1,this.nota_wax="",this.is_init=!1,this.imp="",this.m_cod_documento="",this.sort_field="",e.checkCredentials()&&(this.ripristina_imp(),null==this.sort_field&&(this.sort_field=""),""==this.sort_field&&(this.sort_field="case when CHARINDEX('"+this.user_idp+"',autori)>0 then 1 else 0 end desc,codice desc"))}return t.prototype.goto_edit_doc=function(t,e){this.m_router.navigate([this.app_root,t,e,"edit"])},t.prototype.cmd_wkf=function(t){"annulla_richiesta"==t.cmd&&this.annulla_richiesta(),"recupera_richiesta"==t.cmd&&this.recupera_richiesta(),"riassegna_richiesta"==t.cmd&&this.riassegna_richiesta(),"sostituisci_utente"==t.cmd&&this.sostituisci_utente(),"reclama_bozza"==t.cmd&&this.reclama_bozza(),"annulla_imp"==t.cmd&&this.annulla_imp(),"test_utente"==t.cmd&&this.test_utente(),"insert_doc"==t.cmd&&this.insert_doc()},t.prototype.annulla_richiesta=function(){var t=this;null!=this.get_grid().sRow?(localStorage.setItem(this.app_s.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.app_s.COMPANY_KEY+"msg_dialog","Confermi di voler annullare il documento numero: "+this.get_grid().sRow.codice+"?"),this.dialog.open(It,{disableClose:!0}).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="UPDATE_WKF_ANNULATO",i.types=["string","string","int"],i.values=[t.id_applicativo,t.get_grid().sRow.uiid,-1],t.m_dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.get_grid().doFill("")}))}}))):this._toastr.error("Selezionare il documento da annullare")},t.prototype.reclama_bozza=function(){var t=this;null!=this.get_grid().sRow?this.dialog.open(It,{disableClose:!0,data:{title_dialog:"Conferma Operazione",msg_dialog:"Confermi di voler assegnarti il documento?"}}).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="SELECT_DOCUMENTS_BY_UIID",i.types=["string","string"],i.values=[t.id_applicativo,t.get_grid().sRow.uiid],t.m_dataService.doQuery(i).subscribe((function(e){var n=e.result_data[0].stato;(i=new vt).sql="SELECT_WKF_SELECT_USER_MIN",i.types=["string","string"],i.values=[t.id_applicativo,t.get_grid().sRow.uiid],t.m_dataService.doQuery(i).subscribe((function(e){for(var i=!1,o=0,s="",a=0;a<e.result_data.length;a++)if(e.result_data[a].idp==t.app_s.user){o=e.result_data[a].livello,s=e.result_data[a].descri_livello,i=!0;break}if(i){if(o!=n)return void t._toastr.error("Il documento non è in stato Bozza");var r=new vt;r.sql="UPDATE_WKF_STATO_BOZZA",r.types=["string","string","int","string"],r.values=[t.id_applicativo,t.get_grid().sRow.uiid,o,s],t.m_dataService.doQuery(r).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toastr.info("Documento aggiornato"),t.get_grid().doFill(""))}))}else t._toastr.error("L'utente non è configurato per lo step BOZZA")}))}))}})):this._toastr.error("Selezionare il documento")},t.prototype.recupera_richiesta=function(){var t=this,e=this.dialog.open(si,{disableClose:!0});setTimeout((function(){e.componentInstance.init_w(t.id_applicativo)})),e.afterClosed().subscribe((function(e){"ok"==e&&t.get_grid().doFill("")}))},t.prototype.sostituisci_utente=function(){var t=this;if(null!=this.get_grid().sRow){var e=new vt;e.sql="SELECT_USERS_BY_WKF_DOC",e.types=["string","string"],e.values=[this.id_applicativo,this.get_grid().sRow.uiid],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=t.dialog.open(li,{disableClose:!0,width:"450px"});setTimeout((function(){i.componentInstance.up.all_user=e.result_data,i.componentInstance.title="Sostituzione utente: "+t.get_grid().sRow.codice+" - "+t.get_grid().sRow.oggetto})),i.afterClosed().subscribe((function(e){if(null!=e&&null!=e.result&&"ok"==e.result){var i=new vt;i.sql="UPDATE_USER_WORKFLOW",i.types=["string","string","string","string"],i.values=[t.id_applicativo,t.get_grid().sRow.uiid,e.u1,e.u2],t.m_dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t._toastr.info("Workflow Aggiornato")}))}}))}}))}else this._toastr.error("Selezionare il documento")},t.prototype.riassegna_richiesta=function(){var t=this;if(null!=this.get_grid().sRow){var e=new vt;e.sql="SELECT_WLIVELLIV2ADM",e.types=["string","string","string"],e.values=[this.id_applicativo,this.get_grid().sRow.uiid,this.get_grid().sRow.stato];this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.livs_adm=e.result_data;for(var i=new Array,n="",o=0;o<t.livs_adm.length;o++)-1==n.indexOf(String(t.livs_adm[o].livello))&&(n=n+String(t.livs_adm[o].livello)+"|",i.push(t.livs_adm[o]));var s=t.dialog.open(ai,{disableClose:!0,width:"600px"});setTimeout((function(){s.componentInstance.setStepCombo(i),s.componentInstance.title=t.tsr.instant("Riassegnazione documento")+": "+t.get_grid().sRow.codice+" - "+t.get_grid().sRow.oggetto})),s.afterClosed().subscribe((function(e){null!=e&&null!=e.result&&"ok"==e.result&&(t.os_r=e.lvl_sel,t.riassegna_richiesta_step1())}))}}))}else this._toastr.error("Selezionare il documento da riassegnare")},t.prototype.riassegna_richiesta_step1=function(){for(var t=this,e=new Array,i=0;i<this.livs_adm.length;i++)this.livs_adm[i].livello==this.os_r.livello&&0==this.livs_adm[i].notifica&&e.push(this.livs_adm[i]);var n=this.dialog.open(ri,{disableClose:!0,width:"850px"});for(i=0;i<e.length;i++)null!=e[i].nc?e[i].nc=e[i].nc.split(" ()").join(""):e[i].nc=e[i].username,null!=e[i].idp&&null==e[i].username&&(e[i].username=e[i].idp);setTimeout((function(){n.componentInstance.arrAutori=e,n.componentInstance.title=t.tsr.instant("Riassegnazione documento")+": "+t.get_grid().sRow.codice+" - "+t.get_grid().sRow.oggetto})),n.afterClosed().subscribe((function(e){null!=e&&null!=e.result&&"ok"==e.result&&(t.wax=e.arrsel,t.nota_wax=e.nota,t.riassegna_richiesta_step2())}))},t.prototype.riassegna_richiesta_step2=function(){var t=this;console.log("riassegna_richiesta_step2() ");var e="",i=[],n=new vt;n.sql="DELETE_TODO_ALL_BYID",n.types=["string","string"],n.values=[this.id_applicativo,this.get_grid().sRow.uiid],i.push(this.m_dataService.doQuery(n)),null!=this.get_grid().sRow.lettori&&(e=this.get_grid().sRow.lettori);var o="",s="",a="",r="";null!=this.get_grid().sRow.partecipanti&&(r=this.get_grid().sRow.partecipanti);var l="",p="XCXXX";console.log("this.wax ",this.wax);for(var u=0;u<this.wax.length;u++){var c=new vt;if(c.sql="INSERT_TODO_GEST",c.types=["string","string","string","string","string","string","string"],c.values=[this.id_applicativo,this.get_grid().sRow.uiid,this.wax[u].idp,this.get_grid().sRow.oggetto,this.title,this.get_grid().sRow.descrizione,this.app_s.COMPANY_SITE_ROOT+"/#/"+this.app_root+"/"+this.id_applicativo+"/"+this.get_grid().sRow.uiid+"/edit"],i.push(this.m_dataService.doQuery(c)),"XCXXX"!=p&&p!=this.wax[u].gruppo_parallelo)return void this._toastr.error("impossibile assegnare a utenti di gruppi distiniti");p=this.wax[u].gruppo_parallelo,""!=l&&(l+=","),l+=this.wax[u].idp,-1==e.indexOf(this.wax[u].idp)&&(""!=e&&(e+=","),e+=this.wax[u].idp),-1==s.indexOf(this.wax[u].nc)&&(""!=s&&(s+=","),s+=this.wax[u].nc),""!=a&&(a+=","),a+=this.wax[u].nc,null!=r&&-1==r.indexOf(this.wax[u].idp)&&(""!=r&&(r+=","),r+=this.wax[u].idp),""!=o&&(o+=","),o+=this.wax[u].idp}console.log("op ",i),_.forkJoin(i).subscribe((function(t){})),this.sendEMail_ex(this.user_idp,l,this.titolo_email+"L'utente "+this.user_cognome+" "+this.user_nome+" ti ha riassegnato il documento: "+this.get_grid().sRow.codice,"Commento:\n\n"+this.nota_wax,this.id_applicativo,this.get_grid().sRow.uiid,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_root+"/"+this.id_applicativo+"/"+this.get_grid().sRow.uiid+"/edit",this.get_grid().sRow.uiid,this.nota_wax);var d=new vt;d.sql="INSERT_COMMENTO_RIASS",d.types=["string","string","string","string","string","int","int"],d.values=[this.id_applicativo,this.get_grid().sRow.uiid,"Documento riassegnato a "+a,this.user_idp,this.os_r.descri_livello,this.get_grid().sRow.stato,this.os_r.livello];this.m_dataService.doQuery(d).subscribe((function(t){null!=t&&t.result_msg}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}));var h="$$";this.wax.length>0&&null!=this.wax[0].gruppo_parallelo&&""!=this.wax[0].gruppo_parallelo&&(h=this.wax[0].gruppo_parallelo),console.log("riassegnazione canale: ",h),(d=new vt).sql="UPDATE_RIASS_DOCUMENTO",d.types=["string","string","string","string","string","string","string","string","string","string",h],d.values=[this.os_r.livello,this.os_r.descri_livello,e,o,this.os_r.descri_livello,s,r,this.get_grid().sRow.id_applicativo,this.get_grid().sRow.uiid],this.m_dataService.doQuery(d).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.get_grid().Refresh()}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})),(d=new vt).sql="INSERT_WKF_COMMENTO",d.types=["string","string","string","string","string"],d.values=[this.id_applicativo,this.get_grid().sRow.uiid,"Documento riassegnato, commento:\n"+this.nota_wax,this.user_idp,""],this.m_dataService.doQuery(d).subscribe((function(t){null!=t&&t.result_msg}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})),this.wax.length>0&&((d=new vt).sql="UPDATE_RIASSEGNA_TODO",d.types=["string","string"],d.values=[this.wax[0].idp,this.get_grid().sRow.uiid],!1,this.m_dataService.doQuery(d).subscribe((function(t){null!=t&&t.result_msg}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,a,r,l,p){if(void 0===p&&(p=""),null!=e&&""!=e){var u=new vt;u.sql="send_wkf_mail",u.values=[t,e,i,n.split("\n").join("<br>"),o,s,a,r,l,p],this.m_wkf.doQuery(u).subscribe((function(t){}))}},t.prototype.annulla_imp=function(){var t=this,e=new vt;e.sql="SELECT_CURRENT_USER_INFOS",e.types=[],e.values=[],this.m_dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.app_s.user_name=e.result_data[0].nome,t.app_s.user=e.result_data[0].username,t.app_s.user_surname=e.result_data[0].cognome,t.app_s.user_email=e.result_data[0].email,t.user_idp=e.result_data[0].username,t.user_nome=e.result_data[0].nome,t.user_cognome=e.result_data[0].cognome,t.user_email=e.result_data[0].email)})),this.app_s.user_name_ori=null,this.app_s.user_ori=null,this.app_s.user_surname_ori=null,this.app_s.user_email_ori=null,this.imp="",localStorage.removeItem(this.app_s.COMPANY_KEY+"_imp_user"),this.get_grid().doFill("")},t.prototype.test_utente=function(){var t=this,e=new vt;e.sql="SELECT_UTENTI_WORKFLOW",e.types=["string"],e.values=[this.id_applicativo],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=t.dialog.open(ri,{disableClose:!0,width:"850px"});setTimeout((function(){i.componentInstance.arrAutori=e.result_data,i.componentInstance.title="Impersona Utente",i.componentInstance.commento_hidden=!0})),i.afterClosed().subscribe((function(e){if(null!=e&&null!=e.result&&"ok"==e.result){var i=new vt;i.sql="SELECT_USER_INFO_WKF",i.types=["string"],i.values=[e.arrsel[0].username],t.m_dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.app_s.user_name_ori=t.app_s.user_name,t.app_s.user_ori=t.app_s.user,t.app_s.user_surname_ori=t.app_s.user_surname,t.app_s.user_email_ori=t.app_s.user_email,t.app_s.user_name=e.result_data[0].nome,t.app_s.user=e.result_data[0].username,t.app_s.user_surname=e.result_data[0].cognome,t.app_s.user_email=e.result_data[0].email,t.user_idp=e.result_data[0].username,t.user_nome=e.result_data[0].nome,t.user_cognome=e.result_data[0].cognome,t.user_email=e.result_data[0].email,t.imp="ANN. IMP: "+e.result_data[0].cognome+" "+e.result_data[0].nome,localStorage.setItem(t.app_s.COMPANY_KEY+"_imp_user",t.m_uti.encrypt_v3(JSON.stringify(e.result_data[0]))),t.get_grid().doFill(""))}))}}))}}))},t.prototype.ripristina_imp=function(){if(null!=localStorage.getItem(this.app_s.COMPANY_KEY+"_imp_user")){var t=null;try{t=JSON.parse(this.m_uti.decrypt_v3(localStorage.getItem(this.app_s.COMPANY_KEY+"_imp_user")))}catch(t){}null!=t&&(this.app_s.user_name_ori=this.app_s.user_name,this.app_s.user_ori=this.app_s.user,this.app_s.user_surname_ori=this.app_s.user_surname,this.app_s.user_email_ori=this.app_s.user_email,this.app_s.user_name=t.nome,this.app_s.user=t.username,this.app_s.user_surname=t.cognome,this.app_s.user_email=t.email,this.user_idp=t.username,this.user_nome=t.nome,this.user_cognome=t.cognome,this.user_email=t.email,this.imp="ANN. IMP: "+t.cognome+" "+t.nome)}},t.prototype.save_state_wkf=function(){this.app_s.getState().wkf_obj={},this.app_s.getState().wkf_obj.b_editing=this.b_editing,this.app_s.getState().wkf_obj.is_Supervisor=this.is_Supervisor,this.app_s.getState().wkf_obj.is_Visor=this.is_Visor,this.app_s.getState().wkf_obj.is_Admin=this.is_Admin,this.app_s.getState().wkf_obj.is_PowerUser=this.is_PowerUser,this.app_s.getState().wkf_obj.is_Ins=this.is_Ins,this.app_s.getState().wkf_obj.id_applicativo=this.id_applicativo,this.app_s.getState().wkf_obj.codice_app=this.codice_app,this.app_s.getState().wkf_obj.att_panelcat=this.att_panelcat,this.app_s.getState().wkf_obj.documento_pubblico=this.documento_pubblico,this.app_s.getState().wkf_obj.titolo_email=this.titolo_email,this.app_s.getState().wkf_obj.tbl_name=this.tbl_name,this.app_s.getState().wkf_obj.grid_key=this.grid_key,this.app_s.getState().wkf_obj.m_id_Doc=this.m_id_Doc,this.app_s.getState().wkf_obj.livs=this.livs,this.app_s.getState().wkf_obj.user_idp=this.user_idp,this.app_s.getState().wkf_obj.app_root=this.app_root,this.app_s.getState().wkf_obj.title=this.title},t.prototype.restore_state_wkf=function(){this.b_editing=this.app_s.getState().wkf_obj.b_editing,this.is_Visor=this.app_s.getState().wkf_obj.is_Visor,this.is_Supervisor=this.app_s.getState().wkf_obj.is_Supervisor,this.is_Admin=this.app_s.getState().wkf_obj.is_Admin,this.is_PowerUser=this.app_s.getState().wkf_obj.is_PowerUser,this.is_Ins=this.app_s.getState().wkf_obj.is_Ins,this.id_applicativo=this.app_s.getState().wkf_obj.id_applicativo,this.codice_app=this.app_s.getState().wkf_obj.codice_app,this.att_panelcat=this.app_s.getState().wkf_obj.att_panelcat,this.documento_pubblico=this.app_s.getState().wkf_obj.documento_pubblico,this.titolo_email=this.app_s.getState().wkf_obj.titolo_email,this.tbl_name=this.app_s.getState().wkf_obj.tbl_name,this.grid_key=this.app_s.getState().wkf_obj.grid_key,this.m_id_Doc=this.app_s.getState().wkf_obj.m_id_Doc,this.livs=this.app_s.getState().wkf_obj.livs,this.user_idp=this.app_s.getState().wkf_obj.user_idp,this.app_root=this.app_s.getState().wkf_obj.app_root,this.title=this.tsr.instant(this.app_s.getState().wkf_obj.title),this.m_uti.set_home_title(this.tsr.instant(this.att_panelcat))},t.prototype.init_Panel=function(t,e){this.m_id_Doc=e,this.m_cod_documento=t,this.do_init()},t.prototype.run_grid=function(){var t=this;null!=this.get_grid()&&this.get_grid().ready?this.init_grid():setTimeout((function(){t.run_grid()}),500)},t.prototype.self_ok=function(){var t=this;null==this.get_grid()?setTimeout((function(){t.self_ok()}),500):this.get_grid().refresh_access(this)},t.prototype.do_init=function(){var t=this;if(null!=this.app_s.user_ori&&(this.imp="ANN. IMP: "+this.app_s.user_name+" "+this.app_s.user_surname),this.user_idp=this.app_s.user,null!=this.user_idp){null==this.sort_field&&(this.sort_field=""),""==this.sort_field&&(this.sort_field="case when CHARINDEX('"+this.user_idp+"',autori)>0 then 1 else 0 end desc,codice desc");var e=new vt;e.sql="SELECT_WKF_APP_INFO",e.types=["string"],e.values=[this.m_cod_documento],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;t.id_applicativo=i[0].id_gruppo,t.app_root=i[0].modulo_swf,t.codice_app=i[0].codice_documento,t.att_panelcat=i[0].descrizione_breve,t.documento_pubblico=i[0].pubblico,t.titolo_email="["+i[0].descrizione_breve+"]",t.tbl_name=i[0].vista_sql,t.grid_key=t.app_s.COMPANY_KEY+i[0].vista_sql,t.user_idp=t.app_s.user,t.user_nome=t.app_s.user_name,t.user_cognome=t.app_s.user_surname,t.user_email=t.app_s.user_email,t.m_uti.set_home_title(t.att_panelcat);var n=new vt;n.sql="SELECT_UTENTE_WKF_ADMIN",n.types=["string","string"],n.values=[t.id_applicativo,t.app_s.user],t.m_dataService.doQuery(n).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;t.is_Supervisor=!1,t.is_Admin=!1,t.is_PowerUser=!1,i.length>0&&("0"==i[0].tipo&&(t.is_Supervisor=!0),"1"==i[0].tipo&&(t.is_Admin=!0,t.is_Supervisor=!0),"2"==i[0].tipo&&(t.is_PowerUser=!0));var n=new vt;n.sql="SELECT_WLIVELLIV2",n.types=["string","string"],n.values=[t.id_applicativo,""],t.m_dataService.doQuery(n).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.ok_conf_s(e.result_data);var i=new vt;i.sql="SELECT_ROLES_VISORI",i.types=["string"],i.values=[t.id_applicativo],t.m_dataService.doQuery(i).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.is_Visor=!1;for(var i=0;i<e.result_data.length;i++)if(t.m_uti.hasRole(e.result_data[i].name,!1)){t.is_Visor=!0;break}t.run_grid(),t.self_ok()}}))}}))}}))}}))}else setTimeout((function(){t.do_init()}),500)},t.prototype.ok_conf_s=function(t){this.livs=t,this.is_Ins=!1;for(var e=0;e<this.livs.length;e++)if(null!=this.livs[e].idp&&null!=this.user_idp&&(this.livs[e].idp.toUpperCase()==this.user_idp.toUpperCase()||"*ALLUSERS"==this.livs[e].gruppo_parallelo)&&this.livs[e].livello<=10&&0==this.livs[e].notifica){this.is_Ins=!0,"*ALLUSERS"==this.livs[e].gruppo_parallelo&&(this.livs[e].gruppo_parallelo="",this.livs[e].idp=this.user_idp);break}this.save_state_wkf(),this.parse_url(),this.b_editing&&(this.returnedit(),this.b_editing=!1)},t.prototype.returnedit=function(){},t.prototype.parse_url=function(){for(var t=this.m_router.routerState.snapshot.url.split(/[\&?]+/),e=0;e<t.length;e++)if(t[e]=="/"+this.app_root+"/new")return void this.insert_doc()},t.prototype.goto_models=function(){this.m_router.navigate([this.app_root,"models"])},t.prototype.insert_doc=function(){this.m_router.navigate([this.app_root,this.id_applicativo,"new"])},t}(),an=function(){function t(t,e,i,n,o,s,a,r,l){this.app_s=t,this.m_service=e,this.m_dataService=i,this.m_router=n,this.m_dialog=o,this.m_route=s,this.m_wkf=a,this.uti_s=r,this.tsr=l,this.m_obj={},this.b_rip_pulsanti=!0,this.save_alreadypressed=!1,this.b_respingi=!1,this.limite_salto_after=-1,this.respingi_enabled=!1,this.email_bloccate=!1,this.appo_livs=null,this.oper="",this.b_edit_before=!1,this.all_c=0,this.comm_c=0,this.forza_canale="",this.forza_canale_curr="",this.c_canale="",this.user_nome="",this.user_cognome="",this.user_email="",this.bEdit=!1,this.bEdit_wkf=!1,this.bEditOp_wkf=!1,this.bEditAp_wkf=!1,this.bEditAss_wkf=!1,this.bEditBozza_wkf=!1,this.bEdit_bozza=!1,this.bNuovaRev_Agg=!1,this.hide_richiedente=!1,this.bEdit_Agg=!1,this.btnSalva_label="SALVA",this.btnTerminaOp_label="Termina Attività",this.btnApprova_label="APPROVA",this.btnAssegna_label="Assegna",this.btnRespingi_label="RESPINGI",this.id_documento="",this.m_autori="",this.m_lettori="",this.m_liv=0,this.m_statox="",this.m_danotificare="",this.m_oper="",this.m_autori_paralleli="",this.m_crea_att=0,this.m_send_email=0,this.errorMsg="",this.id_applicativo="",this.rich="",this.cod="",this.simple_mode=!1,this.oggetto_editable=!1,this.descrizione_editable=!1,this.btnSalva_visible=!1,this.b_PrendiInCarico=!1,this.stat_stato_text="",this.creatore_text="",this.pers_int_text="",this.rich_enabled=!1,this.oggetto_text="",this.descrizione_text="",this.btnprocedi=!1,this.b_edit=!1,this.b_valid=!0,this.s_uto="",this.b_apprf=!1}return t.prototype.ripristina_imp=function(){if(null==localStorage.getItem(this.app_s.COMPANY_KEY+"_imp_user"))return this.user_idp=this.app_s.user,this.user_nome=this.app_s.user_name,this.user_cognome=this.app_s.user_surname,void(this.user_email=this.app_s.user_email);var t=null;try{t=JSON.parse(this.uti_s.decrypt_v3(localStorage.getItem(this.app_s.COMPANY_KEY+"_imp_user")))}catch(t){}if(null==t)return this.user_idp=this.app_s.user,this.user_nome=this.app_s.user_name,this.user_cognome=this.app_s.user_surname,void(this.user_email=this.app_s.user_email);this.app_s.user_name_ori=this.app_s.user_name,this.app_s.user_ori=this.app_s.user,this.app_s.user_surname_ori=this.app_s.user_surname,this.app_s.user_email_ori=this.app_s.user_email,this.app_s.user_name=t.nome,this.app_s.user=t.username,this.app_s.user_surname=t.cognome,this.app_s.user_email=t.email,this.user_idp=t.username,this.user_nome=t.nome,this.user_cognome=t.cognome,this.user_email=t.email},t.prototype.init_user_i=function(){this.ripristina_imp()},t.prototype.save_to_app_state=function(){this.app_s.getState().wkf_doc_info={},this.app_s.getState().wkf_doc_info.curr_user=this.user_idp,this.app_s.getState().wkf_doc_info.codice=this.m_obj.codice,this.app_s.getState().wkf_doc_info.data_richiesta=this.m_obj.data_richiesta,this.app_s.getState().wkf_doc_info.richiedente=this.m_obj.nc+" ("+this.m_obj.richiesta_da+")",this.app_s.getState().wkf_doc_info.in_carico_a=this.m_obj.in_carico_a,this.app_s.getState().wkf_doc_info.stato=this.m_obj.stat_stato,this.app_s.getState().wkf_doc_info.uiid_app=this.id_applicativo,this.app_s.getState().wkf_doc_info.uiid_doc=this.m_obj.id_documento,this.app_s.getState().wkf_doc_info.canale=this.m_obj.canale},t.prototype.evt_salv=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!1),this.b_rip_pulsanti=t,this.btnprocedi=!1,e&&!this.ck_field()||this.salva()},t.prototype.salva=function(){var t=this;if(!this.save_alreadypressed)if(this.save_alreadypressed=!0,setTimeout((function(){t.save_alreadypressed=!1}),1e3),""==this.m_obj.codice){if("respingi"==this.oper)return void this.alert("Errore di configurazione pratica contattare ufficio IT [0x001]",1);this.ck_canale_multiplo()}else this.save_agg()},t.prototype.doApprova=function(){this.b_respingi=!1,this.over_canale_iniz(),this.over_canale_curr();var t=0;if(this.nlevel=null,0==this.m_obj.stato)for(var e=0;e<this.livs.length;e++)(this.livs[e].livello<t||0==t)&&(this.clevel=this.livs[e],t=this.livs[e].livello);else{if(t=this.m_obj.stato,console.log(this.livs,t),null!=this.m_obj.canale)for(e=0;e<this.livs.length;e++)if(this.livs[e].livello==t&&this.user_idp.toUpperCase()==this.livs[e].idp.toUpperCase()&&(console.log(this.livs[e].idp.toUpperCase()+" "+this.m_obj.canale+" "+this.livs[e].gruppo_parallelo),0==this.livs[e].notifica&&this.m_obj.canale==this.livs[e].gruppo_parallelo)){this.clevel=this.livs[e];break}if(console.log("this.clevel1 ",this.clevel),null==this.clevel)for(e=0;e<this.livs.length;e++)if(this.livs[e].livello==t&&!(this.user_idp.toUpperCase()!=this.livs[e].idp.toUpperCase()&&"*ALLUSERS"!=this.livs[e].gruppo_parallelo||0!=this.livs[e].notifica||""!=this.c_canale&&""!=this.livs[e].gruppo_parallelo&&this.c_canale!=this.livs[e].gruppo_parallelo&&"*ALLUSERS"!=this.livs[e].gruppo_parallelo)){this.clevel=this.livs[e];break}console.log("this.clevel2 ",this.clevel)}if(console.log("this.clevel3 ",this.clevel),this.clevel=this.check_n_levels(this.clevel),null!=this.clevel&&""!=this.clevel){var i=t;if("procedi"==this.oper&&1==this.clevel.salto_iniziale){t=this.clevel.livello;for(e=0;e<this.livs.length;e++)this.user_idp.toUpperCase()==this.livs[e].idp.toUpperCase()&&0==this.livs[e].notifica&&this.livs[e].livello>t&&0!=t&&this.livs[e].livello!=i&&(-1==this.limite_salto_after||this.livs[e].livello<this.limite_salto_after)&&(this.clevel=this.livs[e],t=this.livs[e].livello);for(var n=this.wkf_rule(t),o=0;o<this.livs.length;o++)if(this.livs[o].livello==n&&this.user_idp.toUpperCase()==this.livs[o].idp.toUpperCase()&&(""==this.c_canale||""==this.livs[o].gruppo_parallelo||this.c_canale==this.livs[o].gruppo_parallelo)){this.clevel=this.livs[o],t=this.livs[o].livello;break}}if("procedi"==this.oper){if(this.clevel=this.check_n_levels(this.clevel),null==this.clevel.livelli_jump&&(this.clevel.livelli_jump=""),""!=this.clevel.livelli_jump)return void this.selectLevel(this.clevel.livelli_jump);this.calcolanextandjump()}if("respingi"==this.oper){if(null==this.clevel.livelli_down&&(this.clevel.livelli_down=""),""!=this.clevel.livelli_down)return void this.selectLevel(this.clevel.livelli_down);this.alert("Errore di configurazione pratica contattare ufficio IT [0x004]",1)}}else this.alert("Errore di configurazione pratica contattare ufficio IT [0x002]",1)},t.prototype.selectLevel=function(t){var e=this;this.app_s.getState().wkf_doc_info.livs=this.livs,this.app_s.getState().wkf_doc_info.st=t,this.app_s.getState().wkf_doc_info.cl=this.clevel,this.m_dialog.open(Ze,{disableClose:!0,width:"800px"}).afterClosed().subscribe((function(t){if(null!=t){var i=t;if("Prosegui a step successivo"!=t.descri_livello)if("Prosegui a chiusura"!=t.descri_livello){i=e.wkf_rule(i);var n=!1;for(o=0;o<e.livs.length;o++)e.user_idp.toUpperCase()==e.livs[o].idp.toUpperCase()&&0==e.livs[o].notifica&&e.livs[o].livello==i&&(e.nlevel=e.livs[o],i=e.livs[o].livello,n=!0);if(!n)for(o=0;o<e.livs.length;o++)if(e.livs[o].livello==i&&0==e.livs[o].notifica){e.nlevel=e.livs[o],i=e.livs[o].livello;break}e.doJump()}else{i=0;for(var o=0;o<e.livs.length;o++)e.livs[o].livello<900&&e.livs[o].livello>i&&0==e.livs[o].notifica&&(e.clevel=e.livs[o],i=e.livs[o].livello);e.calcolanextandjump()}else e.calcolanextandjump()}else e.edit_b(!0,!1)}))},t.prototype.calcolanextandjump=function(){var t=0,e=1e5;t=this.clevel.livello;for(var i=0;i<this.livs.length;i++)(0==t||t<this.livs[i].livello&&e>this.livs[i].livello)&&(this.nlevel=this.livs[i],e=this.livs[i].livello);t=this.wkf_rule(e),console.log("this.wkf_rule ",e,t);for(var n=!1,o=0;o<this.livs.length;o++)0!=this.livs[o].notifica||""!=this.clevel.gruppo_parallelo&&this.clevel.gruppo_parallelo!=this.livs[o].gruppo_parallelo||this.livs[o].livello==t&&(this.nlevel=this.livs[o],t=this.livs[o].livello,n=!0);if(!n)for(var s=0;s<this.livs.length;s++)if(this.livs[s].livello==t&&0==this.livs[s].notifica){this.nlevel=this.livs[s],t=this.livs[s].livello;break}console.log("this.nlevel ",e,t);var a=t,r=this.nlevel;if(2==this.nlevel.salto_iniziale){for(var l=0;l<this.livs.length;l++)r.idp.toUpperCase()==this.livs[l].idp.toUpperCase()&&0==this.livs[l].notifica&&r.gruppo_parallelo==this.livs[l].gruppo_parallelo&&this.livs[l].livello>a&&0!=a&&(this.nlevel=this.livs[l],t=this.livs[l].livello);e=t}this.ck_after(t)&&this.doJump()},t.prototype.doJump=function(){var t=this;if(null!=this.nlevel){var e=new Array;if(console.log("livs ",this.livs),""==this.clevel.gruppo_parallelo)for(var i=0;i<this.livs.length;i++)this.livs[i].livello==this.nlevel.livello&&0==this.livs[i].notifica&&e.push(this.livs[i]);else{var n=!1;for(i=0;i<this.livs.length;i++)this.livs[i].livello==this.nlevel.livello&&""!=this.livs[i].gruppo_parallelo&&(n=!0);for(i=0;i<this.livs.length;i++)this.livs[i].livello==this.nlevel.livello&&0==this.livs[i].notifica&&(this.clevel.gruppo_parallelo!=this.livs[i].gruppo_parallelo&&n||(e.push(this.livs[i]),this.nlevel=this.livs[i]))}if(0!=e.length)if(0==this.nlevel.assegnazione_manuale){this.app_s.getState().wkf_doc_info.title=this.tsr.instant("Avanzamento");var o="";for(i=0;i<e.length;i++)null!=e[i].nc&&-1==o.indexOf(e[i].nc)&&(""!=o&&(o+=";"),o+=e[i].nc);this.app_s.getState().wkf_doc_info.utenti="",this.nlevel.livello<900?this.app_s.getState().wkf_doc_info.lbl=this.tsr.instant("Il documento verrà inviato a")+" "+this.tsr.instant(this.nlevel.descri_livello):this.app_s.getState().wkf_doc_info.lbl=this.tsr.instant("La richiesta verrà chiusa con stato")+" "+this.tsr.instant(this.nlevel.descri_livello),this.app_s.getState().wkf_doc_info.utenti=o,this.app_s.getState().wkf_doc_info.comm_notrequired=this.nlevel.commenti_opzionali;var s=this.m_dialog.open($e,{disableClose:!0,data:{commento_default:this.app_s.temp_var4,comm_notrequired:this.nlevel.commenti_opzionali}});this.app_s.temp_var4="",s.afterClosed().subscribe((function(i){if("abort"==i)return t.edit_b(!0,!1),void(t.respingi_enabled&&t.resp_b(!0));t.arrUsersSelected=e,t.nota=i,t.OKCOM()}))}else{this.app_s.getState().wkf_doc_info.title=this.tsr.instant("Assegnazione"),this.app_s.getState().wkf_doc_info.comm_notrequired=this.nlevel.commenti_opzionali,this.app_s.getState().wkf_doc_info.arrAutori=e.sort((function(t,e){return t.nc>e.nc?1:t.nc<e.nc?-1:0})),null==this.app_s.temp_var4&&(this.app_s.temp_var4="");s=this.m_dialog.open(Je,{disableClose:!0,data:{commento_default:this.app_s.temp_var4,comm_notrequired:this.nlevel.commenti_opzionali}});this.app_s.temp_var4="",s.afterClosed().subscribe((function(e){if(""==e||null==e)return t.edit_b(!0,!1),void(t.respingi_enabled&&t.resp_b(!0));t.arrUsersSelected=e.arrsel,t.nota=e.nota,t.OKCOM()}))}else this.alert("problema di configurazione il livello "+this.nlevel.descri_livello+" non presenta utenti partecipanti validi",1)}else this.alert("problema di configurazione passaggio avanti dal livello "+this.clevel.descri_livello+" non attivato comunicare al CED",1)},t.prototype.back=function(t){var e=this,i=this.uti_s.get_diff_doc(this.old_doc,this.getfieldvalues());console.log(i);for(var n=[],o=0;o<i.length;o++)"-1"==i[o].val&&(i[o].val=""),"-1"==i[o].oldVal&&(i[o].oldVal="")," "==i[o].val&&(i[o].val="")," "==i[o].oldVal&&(i[o].oldVal=""),i[o].val instanceof Number&&i[o].oldVal instanceof String&&(i[o].oldVal=Number(i[o].oldVal.split(",").join(".")));for(o=0;o<i.length;o++)("update"!=i[o].op||"date"!=i[o].val&&"string"!=i[o].val)&&("add"==i[o].op&&null==i[o].val&&""==i[o].oldVal||i[o].val!=i[o].oldVal&&(""==i[o].val&&"0"==i[o].oldVal||"0"==i[o].val&&null==i[o].oldVal||i[o].val instanceof Date||n.push(i[o])));for(o=0;o<i.length;o++)i[o].val instanceof Date&&new Date(i[o].val).getTime()!=new Date(i[o].oldVal).getTime()&&n.push(i[o]);(console.log("arrx ",n,t,!t||0==n.length),t&&0!=n.length)?this.m_dialog.open(We,{disableClose:!0}).afterClosed().subscribe((function(t){"esci_senza_salv"==t&&e.m_router.navigate([e.app_info.modulo_swf]),"salva_esci"==t&&(e.evt_salv(),e.m_router.navigate([e.app_info.modulo_swf]))})):this.m_router.navigate([this.app_info.modulo_swf])},t.prototype.OKCOM=function(){var t=this;this.m_lettori=this.m_obj.lettori,null==this.m_lettori&&(this.m_lettori=this.m_obj.partecipanti),null==this.m_lettori&&(this.m_lettori=""),""==this.m_lettori&&(this.m_lettori=this.app_s.user),this.m_danotificare="",this.m_autori="";for(var e="",i=0;i<this.arrUsersSelected.length;i++)1==this.nlevel.email_partecipanti&&(""!=this.m_danotificare&&(this.m_danotificare=this.m_danotificare+","),this.m_danotificare=this.m_danotificare+this.arrUsersSelected[i].idp),-1==this.m_lettori.toLowerCase().indexOf(this.arrUsersSelected[i].idp.toLowerCase())&&(""!=this.m_lettori&&(this.m_lettori=this.m_lettori+","),this.m_lettori=this.m_lettori+this.arrUsersSelected[i].idp),-1==this.m_autori.toLowerCase().indexOf(this.arrUsersSelected[i].idp.toLowerCase())&&(""!=this.m_autori&&(this.m_autori=this.m_autori+","),""!=e&&(e+=","),this.m_autori=this.m_autori+this.arrUsersSelected[i].idp,e+=this.arrUsersSelected[i].nc);""!=this.nota&&this.insert_commento(this.id_applicativo,this.id_documento,this.nota,this.user_idp),this.m_liv=this.nlevel.livello,this.m_statox=this.tsr.instant("Assegnata a")+": "+e,this.m_autori_paralleli="",this.m_obj.assegnati_paralleli="",this.chstato(this.m_liv),this.m_obj.stato<=10&&(null==this.m_obj.creatore||""==this.m_obj.creatore?this.insert_wkf_variabile(this.id_applicativo,this.id_documento,"REQUESTER",this.user_idp):this.insert_wkf_variabile(this.id_applicativo,this.id_documento,"REQUESTER",this.m_obj.creatore));for(i=0;i<this.livs.length;i++)this.livs[i].livello==this.m_liv&&1==this.livs[i].notifica&&(1==this.livs[i].email_ospiti&&(""!=this.m_danotificare&&(this.m_danotificare=this.m_danotificare+","),this.m_danotificare=this.m_danotificare+this.livs[i].idp),-1==this.m_lettori.toLowerCase().indexOf(this.livs[i].idp.toLowerCase())&&(""!=this.m_lettori&&(this.m_lettori=this.m_lettori+","),this.m_lettori=this.m_lettori+this.livs[i].idp));var n,o="$$";for(i=0;i<this.livs.length;i++)if(this.livs[i].livello==this.clevel.livello&&this.livs[i].idp==this.app_s.user){if("$$"!=o){o="$$";break}o=this.livs[i].gruppo_parallelo}this.m_autori=Array.from(new Set(this.m_autori.split(","))).join(","),this.m_lettori=Array.from(new Set(this.m_lettori.split(","))).join(","),this.m_danotificare=Array.from(new Set(this.m_danotificare.split(","))).join(","),null==this.m_obj.partecipanti&&(this.m_obj.partecipanti=""),null!=this.m_autori&&""!=this.m_autori&&(this.m_obj.partecipanti=this.m_obj.partecipanti+","+Array.from(new Set(this.m_autori.split(","))).join(",")),n=this.app_info.documento_pubblico?new Array(this.m_autori,"",this.m_liv,this.m_statox,this.m_autori_paralleli,this.m_obj.assegnati_paralleli,this.getLvlDescri(String(this.m_liv),this.m_statox),this.getUsersList(this.m_autori,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento,o):new Array(this.m_autori,this.m_lettori,this.m_liv,this.m_statox,this.m_autori_paralleli,this.m_obj.assegnati_paralleli,this.getLvlDescri(String(this.m_liv),this.m_statox),this.getUsersList(this.m_autori,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento,o);var s=new Array;for(i=0;i<n.length;i++)s.push("string");this.m_crea_att=1,this.m_liv>=900&&(this.m_crea_att=0),this.b_respingi&&(this.m_oper="Respinta"),null!=this.clevel&&null!=this.clevel.descri_livello&&(this.m_oper=this.m_oper+" - "+this.clevel.descri_livello),null!=this.nlevel&&null!=this.nlevel.descri_livello&&(this.m_oper=this.m_oper+" -> "+this.nlevel.descri_livello);var a=new vt;a.sql="doWKF",a.values=[this.app_info.descrizione_breve,this.m_obj.codice,this.m_autori,this.m_danotificare,this.m_obj.codice+" - "+this.getTitle(),this.getTitle()+"Il documento: "+this.m_obj.codice+" è passato allo stato: "+this.m_statox,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit","In approvazione",this.getDescri(),this.user_idp,this.m_statox,this.m_oper,this.id_applicativo,this.id_documento,""+this.m_crea_att,""+this.m_send_email,""+this.clevel.livello,""+this.nlevel.livello],this.insert_wkf_variabile(this.id_applicativo,this.id_documento,this.clevel.livello+"_PLAYER",this.user_idp),this.m_wkf.doQuery(a).subscribe((function(t){null!=t&&t.result_msg})),(a=new vt).sql="UPDATE_WKF_DOCUMENTOV3_NS",a.values=n,a.types=s,this.m_dataService.doQuery(a).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){if(t.nlevel.livello>=900){t.doEnd(t.nlevel.livello);var i=new vt;i.sql="UPDATE_DATA_CHIUSURA",i.values=[t.id_applicativo,t.id_documento],i.types=["string","string"],t.m_dataService.doQuery(i).subscribe((function(t){null!=t&&t.result_msg}))}(a=new vt).sql="exec_app_workflow",a.values=[t.app_info.codice_documento,t.id_documento,""+t.clevel.livello,""+t.nlevel.livello,t.user_idp],t.m_wkf.doQuery(a).subscribe((function(t){}))}}));var r=null,l="";""!=this.nota&&(l="<br>Commento: <br>"+this.nota),1==this.nlevel.ical&&(null==this.m_obj.ical_dt_ini?this.alert("Attenzione ical non configurato ical_dt_ini",1):null==this.m_obj.ical_dt_fin?this.alert("Attenzione ical non configurato ical_dt_fin",1):r={start:this.m_obj.ical_dt_ini,end:this.m_obj.ical_dt_fin,summary:this.app_info.descrizione_breve+" "+this.getTitle(),description:this.getDescri()+l+"<br>"+this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",organizer:this.user_nome+" "+this.user_cognome+" <"+this.user_email+">",url:this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit"});var p=this.nlevel.oggetto_email;for(var u in null==p&&(p=""),null!=this.nlevel&&null!=this.nlevel.descri_livello&&(p=p.split("%new_step%").join(this.nlevel.descri_livello)),null!=this.clevel&&null!=this.clevel.descri_livello&&(p=p.split("%old_step%").join(this.clevel.descri_livello)),p=(p=p.split("%new_step%").join("")).split("%old_step%").join(""),this.m_obj)null!=this.m_obj[u]&&(console.log(u+" "+Object.prototype.toString.call(this.m_obj[u])),p="[object Date]"===Object.prototype.toString.call(this.m_obj[u])?p.split("%"+u+"%").join(this.uti_s.date2String(this.m_obj[u])):-1==(""+this.m_obj[u]).indexOf("T00:00:00")?p.split("%"+u+"%").join(this.m_obj[u]):p.split("%"+u+"%").join(this.uti_s.date2String(this.uti_s.string2date(this.m_obj[u],2))));if(""!=this.m_danotificare)if(1==this.clevel.ccn_mittente&&(""!=this.m_danotificare&&(this.m_danotificare=this.m_danotificare+","),this.m_danotificare=this.m_danotificare+this.user_idp),1==this.nlevel.approvazione_email);else if(1==this.nlevel.email_partecipanti||1==this.nlevel.email_ospiti)if(this.b_respingi)this.sendEMail_ex(this.user_idp,this.m_danotificare,"Respinta "+this.getTitle()+"-["+this.m_obj.codice+"]","<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+l,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota,!0,r);else{var c="";c=-1==this.getTitle().indexOf("NOSTD|")?this.app_info.descrizione_breve+", Ti è stato assegnato il documento numero: "+this.m_obj.codice+" "+this.getTitle()+" - "+this.getLvlDescri(String(this.m_liv),this.m_statox):this.getTitle().split("NOSTD|").join("");var d="";d=-1==this.getDescri().indexOf("NOSTD|")?"<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+l:this.getDescri().split("NOSTD|").join(""),null==this.nlevel.oggetto_email||""==this.nlevel.oggetto_email?this.sendEMail_ex(this.user_idp,this.m_danotificare,c,d+l,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota,!0,r):this.sendEMail_ex(this.user_idp,this.m_danotificare,p,"<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+l,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota,!0,r)}else this.goto_edit_doc();if(console.log("this.nlevel ",this.nlevel),console.log("this.nlevel.tipo_notifica_aggiuntiva ",this.nlevel.tipo_notifica_aggiuntiva),""==p&&(p=this.app_info.descrizione_breve+", Il documento numero: "+this.m_obj.codice+" è passato allo STEP: "+this.nlevel.descri_livello+" "+this.getTitle()),0!=this.nlevel.tipo_notifica_aggiuntiva){if(1==this.nlevel.tipo_notifica_aggiuntiva&&this.sendEMail_ex(this.user_idp,this.m_obj.creatore,p,this.m_statox+"<br>"+this.getDescri()+l,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota,!0,r,!1),2==this.nlevel.tipo_notifica_aggiuntiva){console.log("SELECT_PARTECIPANTI_DOC ");var _=new vt;_.sql="SELECT_PARTECIPANTI_DOC",_.values=[this.id_applicativo,this.id_documento],_.types=["string","string"],this.m_dataService.doQuery(_).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=t.user_idp,n=0;n<e.result_data.length;n++)-1==i.indexOf(e.result_data[n].username)&&(i+=",",i+=e.result_data[n].username);console.log("lista_p ",i),t.sendEMail_ex(t.user_idp,i,p,t.m_statox+"<br>"+t.getDescri()+l,t.id_applicativo,t.id_documento,t.app_s.COMPANY_SITE_ROOT+"#/"+t.app_info.modulo_swf+"/"+t.id_applicativo+"/"+t.id_documento+"/edit",t.m_obj.codice,t.nota,!0,r,!1)}}))}if(3==this.nlevel.tipo_notifica_aggiuntiva){var h=new vt;h.sql="SELECT_ALL_USERS_DOC",h.values=[this.id_applicativo,this.id_documento],h.types=["string","string"],this.m_dataService.doQuery(h).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=t.user_idp,n=0;n<e.result_data.length;n++)-1==i.indexOf(e.result_data[n].username)&&(console.log("username:",e.result_data[n].username),i+=",",i+=e.result_data[n].username);t.sendEMail_ex(t.user_idp,i,p,t.m_statox+"<br>"+t.getDescri()+l,t.id_applicativo,t.id_documento,t.app_s.COMPANY_SITE_ROOT+"#/"+t.app_info.modulo_swf+"/"+t.id_applicativo+"/"+t.id_documento+"/edit",t.m_obj.codice,t.nota,!0,r,!1)}}))}}this.goto_edit_doc()},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,a,r,l,p,u,c){var d=this;if(void 0===p&&(p=!0),void 0===u&&(u=""),void 0===c&&(c=!0),console.log("this.email_bloccate ",this.email_bloccate),null!=e)if(""!=e)if(this.email_bloccate)c&&this.goto_edit_doc(p);else{var _=new vt;_.sql="send_wkf_mail",e=(e=e.split(t+",").join("")).split(","+t).join(""),null==u&&(u=""),""!=u&&(u=JSON.stringify(u)),_.values=[t,e,i,n.split("\n").join("<br>"),o,s,a,r,l,u],this.m_wkf.doQuery(_).subscribe((function(t){c&&d.goto_edit_doc(p)}))}else c&&this.goto_edit_doc(p);else c&&this.goto_edit_doc(p)},t.prototype.goto_edit_doc=function(t){void 0===t&&(t=!0),this.m_router.navigate([this.app_info.modulo_swf]),t&&this.alert("Avanzamento effettuato",0)},t.prototype.addOverrideLvlUser=function(t){null==this.override_livs&&(this.override_livs=[]),this.override_livs.push(t),this.apply_over_load()},t.prototype.overwriteLivs=function(t){this.appo_livs=JSON.parse(JSON.stringify(t))},t.prototype.getLvlInfo=function(t){for(var e=0;e<this.livs.length;e++)if(t==this.livs[e].livello)return this.livs[e];return null},t.prototype.insert_commento=function(t,e,i,n){var o=new vt;o.sql="INSERT_WKF_COMMENTO",o.values=[t,e,i,n,""],o.types=["string","string","string","string","string"],this.m_dataService.doQuery(o).subscribe((function(t){null!=t&&t.result_msg}))},t.prototype.insert_wkf_variabile=function(t,e,i,n){var o=new vt;o.sql="insert_wkf_variabile",o.values=[t,e,i,n],this.m_wkf.doQuery(o).subscribe((function(t){null!=t&&t.result_msg}))},t.prototype.respingi=function(){this.oper="respingi",this.btnprocedi=!0,this.edit_b(!1,!1),this.resp_b(!1),this.salva()},t.prototype.procedi=function(){if(this.oper="procedi",this.btnprocedi=!0,this.edit_b(!1,!1),this.resp_b(!1),!this.ck_field())return this.edit_b(!0,!1),void(this.respingi_enabled&&this.resp_b(!0));this.salva()},t.prototype.open_wkf=function(t,e){var i=this;void 0===t&&(t=!1),void 0===e&&(e=!0),console.log("inser_c = false,edit_c=true ",t,e);var n=this.app_s.getState().body_h-40+"px",o=this.m_dialog.open(oi,{disableClose:!0,width:"95%",height:n,data:{edit_c:e}});setTimeout((function(){o.componentInstance.subject=i.app_info.descrizione_breve+", <OP>: "+i.m_obj.codice+" "+i.getTitle(),null!=i.m_obj.lettori?o.componentInstance.lettori=i.m_obj.lettori:o.componentInstance.lettori="",o.componentInstance.link=i.app_s.COMPANY_SITE_ROOT+"#/"+i.app_info.modulo_swf+"/"+i.id_applicativo+"/"+i.id_documento+"/edit",o.componentInstance.codice_doc=i.m_obj.codice,o.componentInstance.notifica_commenti=i.app_info.notifica_commenti,o.componentInstance.notifica_commenti_obbl=i.app_info.notifica_commenti_obbl,o.componentInstance.commenti_insert=t,o.componentInstance.init_v()})),o.afterClosed().subscribe((function(t){i.r_count()}))},t.prototype.open_commenti=function(){var t=this,e=this.m_dialog.open(ii,{disableClose:!0,width:"90%"});setTimeout((function(){e.componentInstance.subject=t.app_info.descrizione_breve+", <OP>: "+t.m_obj.codice+" "+t.getTitle(),null!=t.m_obj.lettori?e.componentInstance.lettori=t.m_obj.lettori:e.componentInstance.lettori="",e.componentInstance.link=t.app_s.COMPANY_SITE_ROOT+"#/"+t.app_info.modulo_swf+"/"+t.id_applicativo+"/"+t.id_documento+"/edit",e.componentInstance.codice_doc=t.m_obj.codice,e.componentInstance.notifica_commenti=t.app_info.notifica_commenti,e.componentInstance.notifica_commenti_obbl=t.app_info.notifica_commenti_obbl,e.componentInstance.init_v()})),e.afterClosed().subscribe((function(e){t.r_count()}))},t.prototype.open_upload=function(t,e){var i=this;void 0===t&&(t=""),void 0===e&&(e="[ZZZ_DIS_CC]"),console.log("open_upload ",t,e);var n=this.m_dialog.open(qt,{disableClose:!0,width:"90%",data:{admin_role:e,App:this.id_applicativo,K:this.id_documento}});setTimeout((function(){n.componentInstance.sovrascrivi_path=t})),n.afterClosed().subscribe((function(t){i.r_count()}))},t.prototype.create_new_document=function(){var t=this,e=new vt;e.sql="insert_new_doc",null==this.c_canale&&(this.c_canale=""),e.values=[this.id_applicativo,this.id_documento,this.c_canale,this.user_idp],this.m_wkf.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.save_agg()}))},t.prototype.save_agg=function(){var t=this;this.b_edit_before=this.b_edit&&this.b_rip_pulsanti,this.edit_b(!1,!1);var e=this.getfieldvalues(),i=new vt;i.sql="insert_aggiuntivi",i.types=["string","string"],i.values=[this.app_info.tabella_dati,this.id_documento],i.names=["tabella","id_documento"];for(var n=0;n<e.length;n++)i.types.push(e[n].types),i.names.push(e[n].names),null==e[n].values?e[n].values="dbnull":("boolean"==e[n].types&&(e[n].values?e[n].values="1":e[n].values="0"),"int"==e[n].types&&(e[n].values+""==""?e[n].values="dbnull":isNaN(e[n].values)?e[n].values="0":e[n].values=""+e[n].values),"string"==e[n].types&&(e[n].values=""+e[n].values),"date"==e[n].types&&(e[n].values=this.uti_s.sql_date(e[n].values),"NaN-NaN-NaN"==e[n].values.split("0").join("")&&(e[n].values="dbnull")),"datetime"==e[n].types&&(console.log("typeof ",typeof e[n].values,e[n].values),e[n].values=this.uti_s.sql_date_time(e[n].values),console.log("arr[i].values ",e[n].values),"NaN-NaN-NaN NaN:NaN"==e[n].values.split("0").join("")&&(e[n].values="dbnull")),"string"==e[n].types&&null==e[n].values&&(e[n].values="dbnull"),"decimal"==e[n].types&&(e[n].values+""==""?e[n].values="dbnull":isNaN(e[n].values)?e[n].values="0":e[n].values=""+e[n].values)),i.values.push(e[n].values);this.m_wkf.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.ok_insert_aggiuntivi()}),(function(t){}))},t.prototype.ok_insert_aggiuntivi=function(){this.btnprocedi?this.b_edit||this.btnprocedi?this.load_document():this.m_router.navigate([this.app_info.modulo_swf,this.id_applicativo,this.id_documento,"edit"]):(this.alert("DOCUMENTO SALVATO",0),this.saved_event(),this.edit_b(this.b_edit_before,!0),this.b_edit||this.btnprocedi||this.m_router.navigate([this.app_info.modulo_swf,this.id_applicativo,this.id_documento,"edit"]))},t.prototype.load_document=function(){var t=this,e=new vt;e.sql="SELECT_WKF_DOCUMENT_NOREP",e.types=["string","string","string"],e.values=[this.app_info.vista_sql,this.id_applicativo,this.id_documento],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;i.length>0?t.ok_load_document(i[0]):t.alert("DOCUMENTO NON TROVATO",1)}}),(function(t){}))},t.prototype.ok_load_document=function(t){var e=this;this.m_obj=JSON.parse(JSON.stringify(t)),this.edit_b(!1,!1),this.save_to_app_state();var i=new vt;i.sql="SELECT_LIVELLI_DOC",i.types=["string","string"],i.values=[this.id_applicativo,this.id_documento],this.m_dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.ok_livelli_doc(t.result_data)}))},t.prototype.apply_over_load=function(){if(null!=this.override_livs&&null!=this.livs)for(var t=0;t<this.override_livs.length;t++)for(var e=0;e<this.livs.length;e++)null!=this.livs[e].id_Applicativo&&this.livs[e].id_Applicativo==this.override_livs[t].id_Applicativo&&(this.livs[e].idp=this.override_livs[t].idp,this.livs[e].gruppo_parallelo=this.override_livs[t].gruppo_parallelo,this.livs[e].nc=this.override_livs[t].nc);null!=this.appo_livs&&(this.livs=JSON.parse(JSON.stringify(this.appo_livs)))},t.prototype.ok_livelli_doc=function(t){if(this.livs=t,this.apply_over_load(),this.over_canale_iniz(),this.over_canale_curr(),this.m_obj.stato<=10)for(var e=0;e<this.livs.length;e++)this.livs[e].idp.toUpperCase()!=this.user_idp.toUpperCase()&&"*ALLUSERS"!=this.livs[e].gruppo_parallelo||10==this.livs[e].livello&&0==this.livs[e].notifica&&"*ALLUSERS"==this.livs[e].gruppo_parallelo&&(this.livs[e].gruppo_parallelo="",this.livs[e].idp=this.user_idp);!this.b_edit||this.btnprocedi?this.btnprocedi&&this.doApprova():this.return_edit()},t.prototype.r_count=function(){var t=this,e=new vt;e.sql="SELECT_WKF_ALLEGATI_COUNTER",e.types=["string","string"],e.values=[this.id_applicativo,this.id_documento],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=e.result_data,n=0,o=0,s=0;s<i.length;s++)i[s].n>0&&("ALLEGATI"==i[s].v&&(n=i[s].n),"COMMENTI"==i[s].v&&(o=i[s].n));t.reset_counters_int(o,n)}}),(function(t){}))},t.prototype.reset_counters_int=function(t,e){t>0&&(this.comm_c=t),e>0&&(this.all_c=e)},t.prototype.set_canale_iniziale=function(t){this.forza_canale=t},t.prototype.over_canale_iniz=function(){if(""!=this.forza_canale){for(var t=0,e=0;e<this.livs.length;e++)(this.livs[e].livello<t||0==t)&&(t=this.livs[e].livello);for(e=0;e<this.livs.length;e++)this.livs[e].livello==t&&(this.livs[e].gruppo_parallelo=this.forza_canale);this.m_obj.stato<20&&(this.m_obj.canale=this.forza_canale),this.c_canale=this.forza_canale}},t.prototype.over_canale_curr=function(){if(""!=this.forza_canale_curr&&null!=this.m_obj.stato){for(var t=0,e=0;e<this.livs.length;e++)this.livs[e].livello==this.m_obj.stato&&(t=this.livs[e].livello);for(e=0;e<this.livs.length;e++)this.livs[e].livello==t&&(this.livs[e].gruppo_parallelo=this.forza_canale_curr);this.m_obj.stato<20&&(this.m_obj.canale=this.forza_canale_curr),this.c_canale=this.forza_canale_curr}},t.prototype.ck_canale_multiplo=function(){for(var t=this,e=0,i=0;i<this.livs.length;i++)(this.livs[i].livello<e||0==e)&&0==this.livs[i].notifica&&(this.clevel=this.livs[i],e=this.livs[i].livello);var n=[];for(i=0;i<this.livs.length;i++)this.livs[i].livello==e&&0==this.livs[i].notifica&&this.app_s.getState().wkf_doc_info.curr_user.toUpperCase()==this.livs[i].idp.toUpperCase()&&(null!=this.livs[i].gruppo_parallelo?n.push(this.livs[i].gruppo_parallelo):n.push(""));n.length<=1?(this.c_canale=n[0],this.create_new_document()):(this.app_s.getState().wkf_doc_info.canali_arr=n.sort((function(t,e){return t>e?1:t<e?-1:0})),this.m_dialog.open(Xe,{disableClose:!0}).afterClosed().subscribe((function(e){null!=e&&""!=e&&(t.c_canale=e,t.create_new_document())})))},t.prototype.open_info=function(){var t=this;this.s_uto="";for(var e=this.m_obj.autori.split(","),i=0;i<e.length;i++)for(var n=0;n<this.livs.length;n++)if(this.livs[n].idp==e[i]){""!=this.s_uto&&(this.s_uto=this.s_uto+","),this.s_uto=this.s_uto+this.livs[n].nc;break}this.app_s.getState().wkf_doc_info.in_carico_a=this.s_uto,this.m_obj.s_uto=this.s_uto;var o=this.m_dialog.open(ni,{disableClose:!0,data:this.m_obj});setTimeout((function(){o.componentInstance.hide_richiedente=t.hide_richiedente})),o.afterClosed().subscribe((function(t){}))},t.prototype.setForceJump=function(t,e,i){var n=this;void 0===e&&(e=""),void 0===i&&(i=!0);for(var o,s="",a="",r="",l="",p="",u=0;u<this.livs.length;u++)t!=this.livs[u].livello||""!=e&&!this.livs[u].canale||(1==this.livs[u].email_ospiti&&1==this.livs[u].notifica||1==this.livs[u].email_partecipanti&&0==this.livs[u].notifica)&&(""!=a&&(a+=","),a+=this.livs[u].idp),t!=this.livs[u].livello||0!=this.livs[u].notifica||""!=e&&!this.livs[u].canale||(""!=s&&(s+=","),s+=this.livs[u].idp,""!=l&&(l+=","),l+=this.livs[u].nc,p=this.livs[u].descri_livello,null!=this.livs[u].oggetto_email&&""!=this.livs[u].oggetto_email&&(r=this.livs[u].oggetto_email));if(""==s)return"NESSUN UTENTE CONFIGURATO STEP: "+t+" CANALE: "+e;a=Array.from(new Set(a.split(","))).join(","),null==this.m_obj.partecipanti&&null!=this.m_obj.autori&&(this.m_obj.partecipanti=Array.from(new Set(this.m_obj.autori.split(","))).join(",")),this.m_obj.partecipanti=Array.from(new Set(this.m_obj.partecipanti.split(","))).join(","),o=this.app_info.documento_pubblico?[s,"",t,this.tsr.instant("Assegnata a")+": "+l,"","",this.getLvlDescri(String(t),this.tsr.instant("Assegnata a")+": "+l),this.getUsersList(l,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento,e]:[s,this.m_obj.partecipanti+","+s,t,this.tsr.instant("Assegnata a")+":"+l,"","",this.getLvlDescri(String(t),this.tsr.instant("Assegnata")+": "+l),this.getUsersList(l,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento,e],console.log("update documento --\x3e ",o);var c=[];for(u=0;u<o.length;u++)c.push("string");var d=new vt;return d.sql="exec_app_workflow",d.values=[this.app_info.codice_documento,this.id_documento,""+this.m_obj.stato,""+t,this.user_idp],this.m_wkf.doQuery(d).subscribe((function(t){})),(d=new vt).sql="UPDATE_WKF_DOCUMENTOV3_NS",d.values=o,d.types=c,this.m_dataService.doQuery(d).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var o=new vt;o.sql="doWKF",o.values=[n.app_info.descrizione_breve,n.m_obj.codice,""+t,""+t,n.m_obj.codice+" - "+n.getTitle(),n.getTitle()+"La scheda numero: "+n.m_obj.codice+" è passata allo stato: "+p,n.app_s.COMPANY_SITE_ROOT+"#/"+n.app_info.modulo_swf+"/"+n.id_applicativo+"/"+n.id_documento+"/edit","In approvazione",n.getDescri(),n.user_idp,p,"",n.id_applicativo,n.id_documento,"1","0",""+n.m_obj.stato,""+t],n.insert_wkf_variabile(n.id_applicativo,n.id_documento,n.m_obj.stato+"_PLAYER",n.user_idp);n.m_wkf.doQuery(o).subscribe((function(t){if(null!=t&&"OK"==t.result_msg)if(i&&""!=a){var e=r;for(var o in n.m_obj)null!=n.m_obj[o]&&(console.log(o+" "+Object.prototype.toString.call(n.m_obj[o])),e="[object Date]"===Object.prototype.toString.call(n.m_obj[o])?e.split("%"+o+"%").join(n.uti_s.date2String(n.m_obj[o])):-1==(""+n.m_obj[o]).indexOf("T00:00:00")?e.split("%"+o+"%").join(n.m_obj[o]):e.split("%"+o+"%").join(n.uti_s.date2String(n.uti_s.string2date(n.m_obj[o],2))));var s="";s=-1==n.getTitle().indexOf("NOSTD|")?n.app_info.descrizione_breve+", Ti è stato assegnato il documento numero: "+n.m_obj.codice+" "+n.getTitle()+" - "+n.getLvlDescri(String(n.m_liv),n.m_statox):n.getTitle().split("NOSTD|").join("");var l="";l=-1==n.getDescri().indexOf("NOSTD|")?"<br>Attività:"+n.getLvlDescri(String(n.m_liv),n.m_statox)+"<br>"+n.m_statox+"<br>"+n.getDescri():n.getDescri().split("NOSTD|").join(""),""==e?n.sendEMail_ex(n.user_idp,a,s,l,n.id_applicativo,n.id_documento,n.app_s.COMPANY_SITE_ROOT+"#/"+n.app_info.modulo_swf+"/"+n.id_applicativo+"/"+n.id_documento+"/edit",n.m_obj.codice,"",!0,""):n.sendEMail_ex(n.user_idp,a,e+" - "+n.getLvlDescri(String(n.m_liv),n.m_statox),"<br>Attività:"+n.getLvlDescri(String(n.m_liv),n.m_statox)+"<br>"+n.m_statox+"<br>"+n.getDescri(),n.id_applicativo,n.id_documento,n.app_s.COMPANY_SITE_ROOT+"#/"+n.app_info.modulo_swf+"/"+n.id_applicativo+"/"+n.id_documento+"/edit",n.m_obj.codice,"",!0,"")}else n.goto_edit_doc()})),!0}n.alert(e.msg,1)}),(function(t){})),"OK"},t.prototype.insert_doc=function(){var t=this;this.m_autori=this.user_idp,this.m_lettori="",this.m_liv=0,this.m_statox="",this.m_danotificare="",this.m_oper="",this.m_autori_paralleli="",this.m_crea_att=0,this.m_send_email=0,this.clevel=null,this.nlevel=null,this.m_obj=new Object,this.id_documento=this.uti_s.newGuid(),this.m_obj.id_documento=this.id_documento,this.m_obj.codice="",this.m_obj.data_richiesta=new Date,this.m_obj.richiedente=this.user_idp,this.m_obj.autori=this.user_idp,this.m_obj.stato=0,this.m_obj.stat_stato="In Creazione",this.m_obj.richiesta_da=this.user_idp,this.m_obj.in_carico_a="",this.m_obj.nc=this.user_cognome+" "+this.user_nome,this.c_canale="",this.dtr=new Date,this.rich=this.user_idp,this.cod="",this.dt_scad=null,this.m_statox="",this.oggetto_editable=!0,this.descrizione_editable=!0,this.btnSalva_visible=!0,this.b_PrendiInCarico=!1,this.stat_stato_text="Bozza",this.creatore_text=this.user_cognome+" "+this.user_nome,this.pers_int_text=this.user_cognome+" "+this.user_nome,this.rich_enabled=!0,this.oggetto_text="",this.descrizione_text="",this.m_obj.stato_txt="",this.m_obj.stato=0,this.bEdit=!0,this.bEdit_wkf=!1,this.bEditOp_wkf=!1,this.bEditAp_wkf=!1,this.bEditAss_wkf=!1,this.bEditBozza_wkf=!1,this.bEdit_bozza=!1,this.bNuovaRev_Agg=!1,this.bEdit_Agg=this.bEdit_wkf,this.btnSalva_label="SALVA",this.btnTerminaOp_label="Termina Attività",this.btnApprova_label="APPROVA",this.btnAssegna_label="Assegna",this.btnRespingi_label="RESPINGI",this.uti_s.set_home_title(this.tsr.instant(this.app_info.descrizione_breve)+" - "+this.tsr.instant("Nuova Richiesta")),this.reset_form(this.tsr.instant(this.app_info.descrizione_breve)+" - "+this.tsr.instant("Nuova Richiesta")),this.old_doc=JSON.parse(JSON.stringify(this.getfieldvalues())),this.reset_counters_int(0,0);var e=new vt;e.sql="SELECT_WLIVELLIV2",e.types=["string","string"],e.values=[this.id_applicativo,""];this.m_dataService.doQuery(e).subscribe((function(e){var i=!1;null!=e&&"OK"==e.result_msg&&(console.log(e.result_data),t.ok_livw2(e.result_data),i=!0),i||(t.errorMsg=e.msg)}),(function(t){})),this.save_to_app_state()},t.prototype.ok_livw2=function(t){this.livs=t;for(var e=0,i=0;i<this.livs.length;i++)(this.livs[i].livello<e||0==e)&&(e=this.livs[i].livello);console.log("min_liv ",e);for(i=0;i<this.livs.length;i++)if(e==this.livs[i].livello&&(this.user_idp.toUpperCase()==this.livs[i].idp.toUpperCase()||"*ALLUSERS"==this.livs[i].gruppo_parallelo)){1==this.livs[i].abilita_indietro?this.respingi_enabled=!0:this.respingi_enabled=!1,this.edit_b(!0,!1);break}},t.prototype.saved_event=function(){},t.prototype.edit_doc=function(){this.load_document()},t.prototype.return_edit=function(){for(var t=0;t<this.livs.length;t++)if(this.livs[t].livello==this.m_obj.stato){1==this.livs[t].abilita_indietro?this.respingi_enabled=!0:this.respingi_enabled=!1;break}null==this.m_obj.autori&&(this.m_obj.autori=""),-1!=(","+this.m_obj.autori.toLowerCase()+",").indexOf(","+this.user_idp.toLowerCase()+",")&&(this.edit_b(!0,!1),this.respingi_enabled&&this.resp_b(!0)),this.r_count(),this.s_uto="";var e=this.m_obj.autori.split(",");for(t=0;t<e.length;t++)for(var i=0;i<this.livs.length;i++)if(this.livs[i].idp==e[t]){""!=this.s_uto&&(this.s_uto=this.s_uto+","),this.s_uto=this.s_uto+this.livs[i].nc;break}this.app_s.getState().wkf_doc_info.in_carico_a=this.s_uto,null==this.m_obj.v?this.uti_s.set_home_title(this.tsr.instant(this.app_info.descrizione_breve)+" "+this.m_obj.codice+" - "+this.tsr.instant(this.m_obj.stat_stato)):this.uti_s.set_home_title(this.tsr.instant(this.app_info.descrizione_breve)+" "+this.m_obj.codice+"/"+this.m_obj.v+" - "+this.tsr.instant(this.m_obj.stat_stato)),this.reset_form(this.tsr.instant(this.app_info.descrizione_breve)+" "+this.m_obj.codice+" - "+this.tsr.instant(this.m_obj.stat_stato)),this.old_doc=JSON.parse(JSON.stringify(this.getfieldvalues()))},t.prototype.onResize=function(t){},t.prototype.init_engine=function(){var t=this;null!=this.app_s.user&&(this.user_idp=this.app_s.user),console.log("this.user_idp ",this.user_idp),null!=this.user_idp?(this.init_user_i(),this.m_route.params.subscribe((function(e){t.onResize();var i=e.op;if(t.id_applicativo=e.idapp,t.id_documento=e.id_doc,t.b_edit="new"!=i,t.b_edit||t.id_applicativo.indexOf("_")>-1&&(t.simple_mode=!0,t.id_applicativo=t.id_applicativo.split("_").join("")),t.b_valid=!!t.id_applicativo,t.b_valid){var n=new vt;n.sql="SELECT_WKF_APP_INFO_BYUID",n.types=["string"],n.values=[t.id_applicativo];t.m_dataService.doQuery(n).subscribe((function(e){var i=!1;null!=e&&"OK"==e.result_msg&&(e.result_data.length>0?(t.setta_info_app(e.result_data[0]),t.b_edit?t.edit_doc():t.insert_doc()):t.alert("CODICE APPLICAZIONE NON VALIDO",2),i=!0),i||t.alert(e.msg,2)}),(function(t){}))}else t.alert("PARAMETRO APPLICAZIONE NON VALIDO",2)}))):setTimeout((function(){t.init_engine()}),100)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.init_engine()}))},t.prototype.setta_info_app=function(t){this.app_info=t},t.prototype.getLvlDescri=function(t,e){for(var i=0;i<this.livs.length;i++)if(t==this.livs[i].livello)return""!=this.livs[i].livello?this.livs[i].descri_livello:e;return e},t.prototype.getUsersList=function(t,e){var i="";return""!=t&&(i=t),""!=e&&(""!=i&&(i+=","),i+=e),""==i?"":this.getNames(i)},t.prototype.getNames=function(t){for(var e="",i=t.split(","),n=0;n<i.length;n++)for(var o=0;o<this.livs.length;o++)if(i[n].toUpperCase()==this.livs[o].idp.toUpperCase()){""!=e&&(e+=","),e+=this.livs[o].nc;break}return e},t}();an.decorators=[{type:n.Directive}],an.ctorParameters=function(){return[{type:wt},{type:ee},{type:Dt},{type:d.Router},{type:e.MatDialog},{type:d.ActivatedRoute},{type:ei},{type:Ct},{type:p.TranslateService}]},an.propDecorators={onResize:[{type:n.HostListener,args:["window:resize",["event"]]}]};var rn=function(){function t(t,e,i,n,o,s,a,r,l,p){this.app_s=t,this.m_service=e,this.m_dataService=i,this.m_router=n,this._toastr=o,this.dialog=s,this.m_wkf=a,this.m_uti=r,this.tsr=l,this.m_fileservice=p,this.b_editing=!1,this.is_Supervisor=!1,this.is_Visor=!1,this.is_Admin=!1,this.is_PowerUser=!1,this.is_Ins=!1,this.id_applicativo="",this.codice_app="",this.att_panelcat="",this.documento_pubblico=!1,this.titolo_email="",this.tbl_name="",this.app_root="",this.grid_key="",this.m_id_Doc="",this.title="",this.override_insert=!1,this.user_nome="",this.user_cognome="",this.user_email="",this.b_initd=!1,this.nota_wax="",this.is_init=!1,this.imp="",this.m_cod_documento="",this.app_info={},this.sort_field="",e.checkCredentials()&&(this.ripristina_imp(),null==this.sort_field&&(this.sort_field=""),""==this.sort_field&&(this.sort_field="case when CHARINDEX('"+this.user_idp+"',autori)>0 then 1 else 0 end desc,codice desc"))}return t.prototype.goto_edit_doc=function(t,e){this.m_router.navigate([this.app_root,t,e,"edit"])},t.prototype.cmd_wkf=function(t){console.log("cmd_wkf ",t),"annulla_richiesta"==t.cmd&&this.annulla_richiesta(),"recupera_richiesta"==t.cmd&&this.recupera_richiesta(),"riassegna_richiesta"==t.cmd&&this.riassegna_richiesta(),"sostituisci_utente"==t.cmd&&this.sostituisci_utente(),"annulla_imp"==t.cmd&&this.annulla_imp(),"test_utente"==t.cmd&&this.test_utente(),"insert_doc"==t.cmd&&this.insert_doc(),"reclama_bozza"==t.cmd&&this.reclama_bozza()},t.prototype.riassegna_a=function(t){var e=this,i=new vt;i.sql="SELECT_DOCUMENTS_BY_UIID",i.types=["string","string"],i.values=[this.id_applicativo,this.get_grid().sRow.uiid],this.m_dataService.doQuery(i).subscribe((function(i){for(var n=(t=i.result_data[0]).assegnati_paralleli.split(","),o=[],s=0;s<n.length;s++)for(var a=0;a<e.livs.length;a++)if(n[s]==e.livs[a].username){o.push({username:n[s],nc:e.livs[a].nc});break}o=o.sort((function(t,e){return t.nc>e.nc?1:t.nc<e.nc?-1:0})),e.dialog.open(Xi,{disableClose:!0,width:"800px",data:{title:e.tsr.instant("Conferma Assegnazione"),lbl:"",commento_default:"",comm_notrequired:"",utenti:o,prendi_in_carico:!1,only_riassegna:!0}}).afterClosed().subscribe((function(i){if(i){if(0==i.arrsel.length)return void e._toastr.error("Impossibile riassegnare");var n="";t.autori="",t.pers_int="";i.arrsel.map((function(i){""!=n&&(n+=","),n+=i.username,-1==t.autori.indexOf(i.username)&&(console.log("VVV ",i),""!=t.autori&&(t.autori=t.autori+","),t.autori=t.autori+i.username,""!=t.pers_int&&(t.pers_int=t.pers_int+","),t.pers_int=t.pers_int+i.nc),i.username==e.app_info.user&&!0}));var o=!1;null!=t.autori&&1!=t.autori.split(",").length&&(o=!0),console.log(t.autori,o);null!=t.assegnati_paralleli&&1!=t.assegnati_paralleli.split(",").length&&t.assegnati_paralleli.indexOf(e.app_s.user)>-1&&!0;var s=new vt;s.sql="UPDATE_WKF_DOC_AUTHOR",s.values=[e.id_applicativo,t.id_documento,t.autori,t.pers_int],s.types=["string","string","string","string"],e.m_dataService.doQuery(s).subscribe((function(o){if(null!=o&&"OK"==o.result_msg&&(e.m_dataService.doQuery({sql:"INSERT_WORKFLOW_LOG",values:[e.id_applicativo,e.user_idp,"DOCUMENTO RIASSEGNATO","DOCUMENTO RIASSEGNATO A: "+n,t.uiid],types:["string","string","string","string","string"],names:[]}).subscribe((function(t){})),"A"==i.op)){var s="",a=e.app_info.descrizione_breve+", Ti è stato assegnato il documento numero: "+t.codice;null!=e.app_info.subject_riassegna&&""!=e.app_info.subject_riassegna&&(a=e.app_info.subject_riassegna),null!=e.app_info.body_riassegna&&""!=e.app_info.body_riassegna&&(s=e.app_info.body_riassegna),a=a.split("{{TRANSITION_DESCRI}}").join(t.stat_stato),s=s.split("{{TRANSITION_DESCRI}}").join(t.stat_stato),e.sendEMail_ex(e.user_idp,n,a,s,e.id_applicativo,t.uiid,e.app_info.COMPANY_SITE_ROOT+"#/"+e.app_info.modulo_swf+"/"+e.id_applicativo+"/"+t.uiid+"/edit",t.codice,"",!0,"",!1,"")}}))}}))}))},t.prototype.annulla_richiesta=function(){var t=this;null!=this.get_grid().sRow?(localStorage.setItem(this.app_s.COMPANY_KEY+"title_dialog",this.tsr.instant("Conferma Operazione")),localStorage.setItem(this.app_s.COMPANY_KEY+"msg_dialog",this.tsr.instant("Confermi di voler annullare il documento numero: ")+this.get_grid().sRow.codice+"?"),this.dialog.open(It,{disableClose:!0}).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="UPDATE_WKF_ANNULATO",i.types=["string","string","int"],i.values=[t.id_applicativo,t.get_grid().sRow.uiid,-1],t.m_dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.get_grid().doFill("")}))}}))):this._toastr.error(this.tsr.instant("Selezionare il documento da annullare"))},t.prototype.recupera_richiesta=function(){var t=this,e=this.dialog.open(Vi,{disableClose:!0});setTimeout((function(){e.componentInstance.init_w(t.id_applicativo)})),e.afterClosed().subscribe((function(e){"ok"==e&&t.get_grid().doFill("")}))},t.prototype.reclama_bozza=function(){var t=this;null!=this.get_grid().sRow?this.dialog.open(It,{disableClose:!0,data:{title_dialog:this.tsr.instant("Conferma Operazione"),msg_dialog:this.tsr.instant("Confermi di voler assegnarti il documento?")}}).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="SELECT_DOCUMENTS_BY_UIID",i.types=["string","string"],i.values=[t.id_applicativo,t.get_grid().sRow.uiid],t.m_dataService.doQuery(i).subscribe((function(e){var n=e.result_data[0].stato;(i=new vt).sql="SELECT_WKF2_SELECT_USER_MIN",i.types=["string","string"],i.values=[t.id_applicativo,t.get_grid().sRow.uiid],t.m_dataService.doQuery(i).subscribe((function(e){for(var i=!1,o=0,s="",a=0;a<e.result_data.length;a++)if(e.result_data[a].username==t.app_s.user){o=e.result_data[a].step,s=e.result_data[a].des_step,i=!0;break}if(i){if(console.log(o,n),o!=n)return void t._toastr.error(t.tsr.instant("Il documento non è in stato Bozza"));var r=new vt;r.sql="UPDATE_WKF_STATO_BOZZA",r.types=["string","string","int","string"],r.values=[t.id_applicativo,t.get_grid().sRow.uiid,o,s],t.m_dataService.doQuery(r).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toastr.info(t.tsr.instant("Documento aggiornato")),t.get_grid().doFill(""))}))}else t._toastr.error(t.tsr.instant("L'utente non è configurato per lo step BOZZA"))}))}))}})):this._toastr.error("Selezionare il documento")},t.prototype.sostituisci_utente=function(){var t=this;if(null!=this.get_grid().sRow){var e=new vt;e.sql="SELECT_USERS_BY_WKF_DOC",e.types=["string","string"],e.values=[this.id_applicativo,this.get_grid().sRow.uiid];this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=t.dialog.open(Yi,{disableClose:!0,width:"450px"});setTimeout((function(){i.componentInstance.up.all_user=e.result_data,i.componentInstance.title=t.tsr.instant("Sostituzione utente: ")+t.get_grid().sRow.codice+" - "+t.get_grid().sRow.oggetto})),i.afterClosed().subscribe((function(e){if(null!=e&&null!=e.result&&"ok"==e.result){var i=new vt;i.sql="UPDATE_USER_WORKFLOW",i.types=["string","string","string","string"],i.values=[t.id_applicativo,t.get_grid().sRow.uiid,e.u1,e.u2],t.m_dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t._toastr.info(t.tsr.instant("Workflow Aggiornato"))}))}}))}}))}else this._toastr.error(this.tsr.instant("Selezionare il documento"))},t.prototype.riassegna_richiesta=function(){var t=this;if(null!=this.get_grid().sRow){var e=new vt;e.sql="SELECT_WLIVELLIV2ADM_2",e.types=["string","string","string"],e.values=[this.id_applicativo,this.get_grid().sRow.uiid,this.get_grid().sRow.stato];this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.livs_adm=e.result_data;for(var i=new Array,n="",o=0;o<t.livs_adm.length;o++)-1==n.indexOf(String(t.livs_adm[o].step))&&(n=n+String(t.livs_adm[o].step)+"|",i.push(t.livs_adm[o]));var s=t.dialog.open(qi,{disableClose:!0,width:"600px"});setTimeout((function(){s.componentInstance.setStepCombo(i),s.componentInstance.title=t.tsr.instant("Riassegnazione documento")+": "+t.get_grid().sRow.codice+" - "+t.get_grid().sRow.oggetto})),s.afterClosed().subscribe((function(e){null!=e&&null!=e.result&&"ok"==e.result&&(t.os_r=e.lvl_sel,t.set_canale_step1())}))}}))}else this._toastr.error("Selezionare il documento da riassegnare")},t.prototype.set_canale_step1=function(){var t=this,e=new vt;e.sql="SELECT_DOCUMENTS_BY_UIID",e.types=["string","string"],e.values=[this.id_applicativo,this.get_grid().sRow.uiid],this.m_dataService.doQuery(e).subscribe((function(e){t.get_grid().sRow.canale=e.result_data[0].canale,console.log("setto canale: "+t.get_grid().sRow.canale),t.riassegna_richiesta_step1()}))},t.prototype.riassegna_richiesta_step1=function(){var t=this,e=new vt;e.sql="SELECT_WLIVELLIV2_STEP_2",e.types=["string","string","string"],e.values=[this.id_applicativo,this.os_r.step],this.m_dataService.doQuery(e).subscribe((function(e){var i=e.result_data;console.log("arrAutori prima ",i);var n=new vt;n.sql="SELECT_WKF_VARIABILES_V2",n.types=["string"],n.values=[t.get_grid().sRow.uiid],t.m_dataService.doQuery(n).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){i.map((function(i){10==i.step&&"*ALLUSERS"==i.value&&e.result_data.map((function(t){"*CREATOR"==t.k&&(i.username=t.v,i.nc=t.nc,i.ncx=t.nc)})),0==i.value.indexOf("*")&&(i.context=t.get_grid().sRow.canale,i.description="",i.name="",e.result_data.map((function(t){i.value.split("CREATOR").join("REQUESTER")==t.k.split("CREATOR").join("REQUESTER")&&(i.username=t.v,i.nc=t.nc,i.ncx=t.nc)})))})),console.log("arrAutori dopo ",i,t.get_grid().sRow.canale);for(var n=[],o=function(e){if(null==t.get_grid().sRow.canale||""==t.get_grid().sRow.canale||t.get_grid().sRow.canale==i[e].context){console.log("arrAutori[i].context ",i[e].context);var o=!1;n.map((function(t){t.nc==i[e].nc&&t.context==i[e].context&&(o=!0)})),o||n.push(i[e])}},s=0;s<i.length;s++)o(s);console.log("arrAutori_temp ",n),i=JSON.parse(JSON.stringify(n));var a=t.dialog.open(Gi,{disableClose:!0,width:"850px"});for(s=0;s<i.length;s++)null!=i[s].nc?i[s].nc=i[s].nc.split(" ()").join(""):i[s].nc=i[s].username,null!=i[s].idp&&null==i[s].username&&(i[s].username=i[s].idp);setTimeout((function(){a.componentInstance.arrAutori=i,a.componentInstance.title=t.tsr.instant("Riassegnazione documento")+": "+t.get_grid().sRow.codice+" - "+t.get_grid().sRow.oggetto})),a.afterClosed().subscribe((function(e){null!=e&&null!=e.result&&"ok"==e.result&&(t.wax=e.arrsel,t.nota_wax=e.nota,t.riassegna_richiesta_step2())}))}}))}))},t.prototype.riassegna_richiesta_step2=function(){var t=this,e="",i=[],n=new vt;n.sql="DELETE_TODO_ALL_BYID",n.types=["string","string"],n.values=[this.id_applicativo,this.get_grid().sRow.uiid],i.push(this.m_dataService.doQuery(n)),null!=this.get_grid().sRow.lettori&&(e=this.get_grid().sRow.lettori);var o="",s="",a="",r="";null!=this.get_grid().sRow.partecipanti&&(r=this.get_grid().sRow.partecipanti);var l="",p="XCXXX";console.log("this.wax ",this.wax);for(var u=0;u<this.wax.length;u++){var c=new vt;if(c.sql="INSERT_TODO_GEST",c.types=["string","string","string","string","string","string","string"],c.values=[this.id_applicativo,this.get_grid().sRow.uiid,this.wax[u].username,this.get_grid().sRow.oggetto,this.title,this.get_grid().sRow.descrizione,this.app_s.COMPANY_SITE_ROOT+"/#/"+this.app_root+"/"+this.id_applicativo+"/"+this.get_grid().sRow.uiid+"/edit"],i.push(this.m_dataService.doQuery(c)),"XCXXX"!=p&&p!=this.wax[u].gruppo_parallelo)return void this._toastr.error(this.tsr.instant("impossibile assegnare a utenti di gruppi distiniti"));p=this.wax[u].gruppo_parallelo,""!=l&&(l+=","),l+=this.wax[u].username,-1==e.indexOf(this.wax[u].username)&&(""!=e&&(e+=","),e+=this.wax[u].username),-1==s.indexOf(this.wax[u].nc)&&(""!=s&&(s+=","),s+=this.wax[u].nc),""!=a&&(a+=","),a+=this.wax[u].nc,null!=r&&-1==r.indexOf(this.wax[u].username)&&(""!=r&&(r+=","),r+=this.wax[u].username),""!=o&&(o+=","),o+=this.wax[u].username}_.forkJoin(i).subscribe((function(t){}));var d=this.titolo_email+this.tsr.instant("L'utente ")+this.user_cognome+" "+this.user_nome+this.tsr.instant(" ti ha riassegnato il documento: ")+this.get_grid().sRow.codice,h="Commento:\n\n"+this.nota_wax;null!=this.app_info.subject_riassegna&&""!=this.app_info.subject_riassegna&&(d=this.app_info.subject_riassegna),null!=this.app_info.body_riassegna&&""!=this.app_info.body_riassegna&&(h=this.app_info.body_riassegna),d=d.split("{{TRANSITION_DESCRI}}").join(this.os_r.description),h=h.split("{{TRANSITION_DESCRI}}").join(this.os_r.description),this.sendEMail_ex(this.user_idp,l,d,h,this.id_applicativo,this.get_grid().sRow.uiid,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_root+"/"+this.id_applicativo+"/"+this.get_grid().sRow.uiid+"/edit",this.get_grid().sRow.uiid,this.nota_wax);var m=new vt;m.sql="INSERT_COMMENTO_RIASS",m.types=["string","string","string","string","string","int","int"],m.values=[this.id_applicativo,this.get_grid().sRow.uiid,this.tsr.instant("Documento riassegnato a ")+a,this.user_idp,this.os_r.description,this.get_grid().sRow.stato,this.os_r.step];this.m_dataService.doQuery(m).subscribe((function(t){null!=t&&t.result_msg}));var f="$$";this.wax.length>0&&null!=this.wax[0].gruppo_parallelo&&""!=this.wax[0].gruppo_parallelo&&(f=this.wax[0].gruppo_parallelo),(m=new vt).sql="UPDATE_RIASS_DOCUMENTO",m.types=["string","string","string","string","string","string","string","string","string","string",f],m.values=[this.os_r.step,this.os_r.description,e,o,this.os_r.description,s,r,this.get_grid().sRow.id_applicativo,this.get_grid().sRow.uiid],this.m_dataService.doQuery(m).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.get_grid().Refresh(),(m=new vt).sql="INSERT_WKF_COMMENTO",m.types=["string","string","string","string","string"],m.values=[t.id_applicativo,t.get_grid().sRow.uiid,t.tsr.instant("Documento riassegnato,"+t.os_r.description+" commento:")+"\n"+t.nota_wax,t.user_idp,""],!1,t.m_dataService.doQuery(m).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){(m=new vt).sql="exec_app_workflow",m.values=[t.codice_app,t.get_grid().sRow.uiid,""+t.get_grid().sRow.stato,""+t.os_r.step,t.user_idp];t.m_wkf.doQuery(m).subscribe((function(t){}))}})))})),this.wax.length>0&&((m=new vt).sql="UPDATE_RIASSEGNA_TODO",m.types=["string","string"],m.values=[this.wax[0].idp,this.get_grid().sRow.uiid],!1,this.m_dataService.doQuery(m).subscribe((function(t){null!=t&&t.result_msg}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,a,r,l,p,u,c,d){var _=this;void 0===p&&(p=!0),void 0===u&&(u=""),void 0===c&&(c=!0),void 0===d&&(d="");var h=!1;null!=this.app_s.dev_mode&&"1"==this.app_s.dev_mode&&(h=!0);var m={destinatari:e.split(","),commento:d,id_applicazione:o,id_documento:s,username:t,e_subject:i,e_body:n,dev_mode:h?1:0},f=new gt;f.command="exec_app",f.p1="send_email";var g=this.m_uti.newGuid();f.p2=g;var v=new vt;v.sql="INSERT_WKF_OP",v.values=[g,JSON.stringify(m)],v.types=["string","string"],this.m_dataService.doQuery(v).subscribe((function(t){_.m_fileservice.doQuery(f).subscribe((function(t){}))}))},t.prototype.annulla_imp=function(){var t=this,e=new vt;e.sql="SELECT_CURRENT_USER_INFOS",e.types=[],e.values=[],this.m_dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.app_s.user_name=e.result_data[0].nome,t.app_s.user=e.result_data[0].username,t.app_s.user_surname=e.result_data[0].cognome,t.app_s.user_email=e.result_data[0].email,t.user_idp=e.result_data[0].username,t.user_nome=e.result_data[0].nome,t.user_cognome=e.result_data[0].cognome,t.user_email=e.result_data[0].email)})),this.app_s.user_name_ori=null,this.app_s.user_ori=null,this.app_s.user_surname_ori=null,this.app_s.user_email_ori=null,this.imp="",localStorage.removeItem(this.app_s.COMPANY_KEY+"_imp_user"),this.get_grid().doFill("")},t.prototype.test_utente=function(){var t=this,e=new vt;e.sql="SELECT_ALL_USERS",e.types=["string"],e.values=[this.id_applicativo],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=t.dialog.open(Gi,{disableClose:!0,width:"850px"});setTimeout((function(){i.componentInstance.arrAutori=e.result_data,i.componentInstance.title=t.tsr.instant("Impersona Utente"),i.componentInstance.commento_hidden=!0})),i.afterClosed().subscribe((function(e){if(null!=e&&null!=e.result&&"ok"==e.result){var i=new vt;i.sql="SELECT_USER_INFO_WKF",i.types=["string"],i.values=[e.arrsel[0].username],t.m_dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.app_s.user_name_ori=t.app_s.user_name,t.app_s.user_ori=t.app_s.user,t.app_s.user_surname_ori=t.app_s.user_surname,t.app_s.user_email_ori=t.app_s.user_email,t.app_s.user_name=e.result_data[0].nome,t.app_s.user=e.result_data[0].username,t.app_s.user_surname=e.result_data[0].cognome,t.app_s.user_email=e.result_data[0].email,t.user_idp=e.result_data[0].username,t.user_nome=e.result_data[0].nome,t.user_cognome=e.result_data[0].cognome,t.user_email=e.result_data[0].email,t.imp="ANN. IMP: "+e.result_data[0].cognome+" "+e.result_data[0].nome,localStorage.setItem(t.app_s.COMPANY_KEY+"_imp_user",t.m_uti.encrypt_v3(JSON.stringify(e.result_data[0]))),t.get_grid().doFill(""))}))}}))}}))},t.prototype.save_state_wkf=function(){this.app_s.getState().wkf_obj={},this.app_s.getState().wkf_obj.b_editing=this.b_editing,this.app_s.getState().wkf_obj.is_Supervisor=this.is_Supervisor,this.app_s.getState().wkf_obj.is_Visor=this.is_Visor,this.app_s.getState().wkf_obj.is_Admin=this.is_Admin,this.app_s.getState().wkf_obj.is_PowerUser=this.is_PowerUser,this.app_s.getState().wkf_obj.is_Ins=this.is_Ins,this.app_s.getState().wkf_obj.id_applicativo=this.id_applicativo,this.app_s.getState().wkf_obj.codice_app=this.codice_app,this.app_s.getState().wkf_obj.att_panelcat=this.att_panelcat,this.app_s.getState().wkf_obj.documento_pubblico=this.documento_pubblico,this.app_s.getState().wkf_obj.titolo_email=this.titolo_email,this.app_s.getState().wkf_obj.tbl_name=this.tbl_name,this.app_s.getState().wkf_obj.grid_key=this.grid_key,this.app_s.getState().wkf_obj.m_id_Doc=this.m_id_Doc,this.app_s.getState().wkf_obj.livs=this.livs,this.app_s.getState().wkf_obj.user_idp=this.user_idp,this.app_s.getState().wkf_obj.app_root=this.app_root,this.app_s.getState().wkf_obj.title=this.title},t.prototype.restore_state_wkf=function(){this.b_editing=this.app_s.getState().wkf_obj.b_editing,this.is_Visor=this.app_s.getState().wkf_obj.is_Visor,this.is_Supervisor=this.app_s.getState().wkf_obj.is_Supervisor,this.is_Admin=this.app_s.getState().wkf_obj.is_Admin,this.is_PowerUser=this.app_s.getState().wkf_obj.is_PowerUser,this.is_Ins=this.app_s.getState().wkf_obj.is_Ins,this.id_applicativo=this.app_s.getState().wkf_obj.id_applicativo,this.codice_app=this.app_s.getState().wkf_obj.codice_app,this.att_panelcat=this.app_s.getState().wkf_obj.att_panelcat,this.documento_pubblico=this.app_s.getState().wkf_obj.documento_pubblico,this.titolo_email=this.app_s.getState().wkf_obj.titolo_email,this.tbl_name=this.app_s.getState().wkf_obj.tbl_name,this.grid_key=this.app_s.getState().wkf_obj.grid_key,this.m_id_Doc=this.app_s.getState().wkf_obj.m_id_Doc,this.livs=this.app_s.getState().wkf_obj.livs,this.user_idp=this.app_s.getState().wkf_obj.user_idp,this.app_root=this.app_s.getState().wkf_obj.app_root,this.title=this.tsr.instant(this.app_s.getState().wkf_obj.title),this.m_uti.set_home_title(this.tsr.instant(this.att_panelcat))},t.prototype.init_Panel=function(t,e){this.m_id_Doc=e,this.m_cod_documento=t,this.do_init()},t.prototype.run_grid=function(){var t=this;null!=this.get_grid()&&this.get_grid().ready?this.init_grid():setTimeout((function(){t.run_grid()}),500)},t.prototype.self_ok=function(){var t=this;if(null!=this.get_grid())return console.log("this.get_grid() ",this.get_grid()),void this.get_grid().refresh_access(this);setTimeout((function(){t.self_ok()}),500)},t.prototype.do_init=function(){var t=this;if(null!=this.app_s.user_ori&&(this.imp="ANN. IMP: "+this.app_s.user_name+" "+this.app_s.user_surname),this.user_idp=this.app_s.user,null!=this.user_idp){null==this.sort_field&&(this.sort_field=""),""==this.sort_field&&(this.sort_field="case when CHARINDEX('"+this.user_idp+"',autori)>0 then 1 else 0 end desc,codice desc");var e=new vt;e.sql="SELECT_WKF_APP_INFO_V2",e.types=["string"],e.values=[this.m_cod_documento],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;t.id_applicativo=i[0].id_gruppo,t.app_info=i[0],t.app_root=i[0].modulo_swf,t.codice_app=i[0].codice_documento,t.att_panelcat=i[0].descrizione_breve,t.documento_pubblico=i[0].pubblico,t.titolo_email="["+i[0].descrizione_breve+"]",t.tbl_name=i[0].vista_sql,t.grid_key=t.app_s.COMPANY_KEY+i[0].vista_sql,t.user_idp=t.app_s.user,t.user_nome=t.app_s.user_name,t.user_cognome=t.app_s.user_surname,t.user_email=t.app_s.user_email,t.m_uti.set_home_title(t.tsr.instant(t.att_panelcat));var n=new vt;n.sql="SELECT_UTENTE_WKF_ADMIN",n.types=["string","string"],n.values=[t.id_applicativo,t.app_s.user],t.m_dataService.doQuery(n).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;t.is_Supervisor=!1,t.is_Admin=!1,t.is_PowerUser=!1,i.length>0&&("0"==i[0].tipo&&(t.is_Supervisor=!0),"1"==i[0].tipo&&(t.is_Admin=!0,t.is_Supervisor=!0),"2"==i[0].tipo&&(t.is_PowerUser=!0));var n=new vt;n.sql="SELECT_WLIVELLIV2_2",n.types=["string"],n.values=[t.id_applicativo],t.m_dataService.doQuery(n).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.ok_conf_s(e.result_data);var i=new vt;i.sql="SELECT_ROLES_VISORI",i.types=["string"],i.values=[t.id_applicativo],t.m_dataService.doQuery(i).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.is_Visor=!1;for(var i=0;i<e.result_data.length;i++)if(t.m_uti.hasRole(e.result_data[i].name,!1)){t.is_Visor=!0;break}t.run_grid(),t.self_ok()}}))}}))}}))}}))}else setTimeout((function(){t.do_init()}),500)},t.prototype.ok_conf_s=function(t){this.livs=t,this.is_Ins=!1,console.log("livs ",this.livs);for(var e=0;e<this.livs.length;e++)if(null==this.livs[e].username&&(this.livs[e].username="ZZZ"),null!=this.user_idp&&(this.livs[e].username.toUpperCase()==this.user_idp.toUpperCase()||"*ALLUSERS"==this.livs[e].value)&&this.livs[e].step<=10){this.is_Ins=!0,"*ALLUSERS"==this.livs[e].value&&(this.livs[e].value="",this.livs[e].username=this.user_idp);break}this.save_state_wkf(),this.parse_url(),this.b_editing&&(this.returnedit(),this.b_editing=!1)},t.prototype.returnedit=function(){},t.prototype.parse_url=function(){for(var t=this.m_router.routerState.snapshot.url.split(/[\&?]+/),e=0;e<t.length;e++)if(t[e]=="/"+this.app_root+"/new")return void this.insert_doc()},t.prototype.do_custom_insert=function(){},t.prototype.goto_models=function(){this.m_router.navigate([this.app_root,"models"])},t.prototype.insert_doc=function(){console.log("insert_doc() ",this.override_insert),this.override_insert?this.do_custom_insert():this.m_router.navigate([this.app_root,this.id_applicativo,"new"])},t.prototype.ripristina_imp=function(){if(null!=localStorage.getItem(this.app_s.COMPANY_KEY+"_imp_user")){var t=null;try{t=JSON.parse(this.m_uti.decrypt_v3(localStorage.getItem(this.app_s.COMPANY_KEY+"_imp_user")))}catch(t){}null!=t&&(this.app_s.user_name_ori=this.app_s.user_name,this.app_s.user_ori=this.app_s.user,this.app_s.user_surname_ori=this.app_s.user_surname,this.app_s.user_email_ori=this.app_s.user_email,this.app_s.user_name=t.nome,this.app_s.user=t.username,this.app_s.user_surname=t.cognome,this.app_s.user_email=t.email,this.user_idp=t.username,this.user_nome=t.nome,this.user_cognome=t.cognome,this.user_email=t.email,this.imp="ANN. IMP: "+t.cognome+" "+t.nome)}},t}();rn.decorators=[{type:n.Directive}],rn.ctorParameters=function(){return[{type:wt},{type:ee},{type:Dt},{type:d.Router},{type:i.ToastrService},{type:e.MatDialog},{type:ei},{type:Ct},{type:p.TranslateService},{type:Tt}]};var ln=function(){function t(t,e,i,n,o,s,a,r,l){var p=this;this.app_s=t,this.m_dataService=e,this.m_router=i,this.m_dialog=n,this.m_route=o,this.m_wkf=s,this.uti_s=a,this.m_fileservice=r,this.tsr=l,this.m_obj={},this.next_label="Procedi",this.next_label_color="#000000",this.next_back_ground_color="#ffd740",this.b_init_next=!1,this.sort_field="",this.in_carico=!1,this.wkf_users_roles="",this.b_rip_pulsanti=!0,this.save_alreadypressed=!1,this.b_respingi=!1,this.limite_salto_after=-1,this.transizione_info={},this.respingi_enabled=!1,this.b_assengna_a=!1,this.ttw=0,this.email_bloccate=!1,this.oper="",this.b_edit_before=!1,this.all_c=0,this.comm_c=0,this.forza_canale="",this.c_canale="",this.user_nome="",this.user_cognome="",this.user_email="",this.bEdit=!1,this.bEdit_wkf=!1,this.bEditOp_wkf=!1,this.bEditAp_wkf=!1,this.bEditAss_wkf=!1,this.bEditBozza_wkf=!1,this.bEdit_bozza=!1,this.bNuovaRev_Agg=!1,this.hide_richiedente=!1,this.bEdit_Agg=!1,this.btnSalva_label=this.tsr.instant("SALVA"),this.btnTerminaOp_label=this.tsr.instant("Termina Attività"),this.btnApprova_label=this.tsr.instant("APPROVA"),this.btnAssegna_label=this.tsr.instant("Assegna"),this.btnRespingi_label=this.tsr.instant("RESPINGI"),this.id_documento="",this.m_autori="",this.m_lettori="",this.m_liv=0,this.m_statox="",this.m_danotificare="",this.m_oper="",this.m_autori_paralleli="",this.m_crea_att=0,this.m_send_email=0,this.errorMsg="",this.id_applicativo="",this.rich="",this.cod="",this.simple_mode=!1,this.oggetto_editable=!1,this.descrizione_editable=!1,this.btnSalva_visible=!1,this.b_PrendiInCarico=!1,this.stat_stato_text="",this.creatore_text="",this.pers_int_text="",this.rich_enabled=!1,this.oggetto_text="",this.descrizione_text="",this.btnprocedi=!1,this.b_edit=!1,this.b_valid=!0,this.s_uto="",this.b_apprf=!1,this.loaded=!1,setTimeout((function(){var t=new vt;t.sql="SELECT_ROLES_WKF_V2",t.values=[p.id_applicativo],t.types=["string"],console.log("start SELECT_ROLES_WKF_V2",new Date),p.m_dataService.doQuery(t).subscribe((function(t){null!=t&&"OK"==t.result_msg&&t.result_data.map((function(t){p.wkf_users_roles+=t.name}))}))})),this.m_route.params.subscribe((function(t){p.onResize();t.op;p.id_applicativo=t.idapp,p.id_documento=t.id_doc;var e=new vt;e.sql="SELECT_WKF_APP_INFO_BYUID",e.types=["string"],e.values=[p.id_applicativo],console.log("start SELECT_WKF_APP_INFO_BYUID",new Date),p.m_dataService.doQuery(e).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(console.log(t.result_data.length),t.result_data.length>0?(console.log("end SELECT_WKF_APP_INFO_BYUID",new Date),p.setta_info_app(t.result_data[0]),p.init_engine()):p.alert("CODICE APPLICAZIONE NON VALIDO",2))}))}))}return t.prototype.ripristina_imp=function(){if(null==localStorage.getItem(this.app_s.COMPANY_KEY+"_imp_user"))return this.user_idp=this.app_s.user,this.user_nome=this.app_s.user_name,this.user_cognome=this.app_s.user_surname,void(this.user_email=this.app_s.user_email);var t=JSON.parse(this.uti_s.decrypt_v3(localStorage.getItem(this.app_s.COMPANY_KEY+"_imp_user")));if(null==t)return this.user_idp=this.app_s.user,this.user_nome=this.app_s.user_name,this.user_cognome=this.app_s.user_surname,void(this.user_email=this.app_s.user_email);this.app_s.user_name_ori=this.app_s.user_name,this.app_s.user_ori=this.app_s.user,this.app_s.user_surname_ori=this.app_s.user_surname,this.app_s.user_email_ori=this.app_s.user_email,this.app_s.user_name=t.nome,this.app_s.user=t.username,this.app_s.user_surname=t.cognome,this.app_s.user_email=t.email,this.user_idp=t.username,this.user_nome=t.nome,this.user_cognome=t.cognome,this.user_email=t.email},t.prototype.hasRole=function(t,e){return void 0===e&&(e=!0),null!==this.wkf_users_roles&&(!(!e||null==this.app_s.user_isadmin||"1"!=this.app_s.user_isadmin)||this.wkf_users_roles.toUpperCase().indexOf(t.toLocaleUpperCase())>-1)},t.prototype.init_user_i=function(){this.ripristina_imp()},t.prototype.save_to_app_state=function(){this.app_s.getState().wkf_doc_info={},this.app_s.getState().wkf_doc_info.curr_user=this.user_idp,this.app_s.getState().wkf_doc_info.codice=this.m_obj.codice,this.app_s.getState().wkf_doc_info.data_richiesta=this.m_obj.data_richiesta,this.app_s.getState().wkf_doc_info.richiedente=this.m_obj.nc+" ("+this.m_obj.richiesta_da+")",this.app_s.getState().wkf_doc_info.in_carico_a=this.m_obj.in_carico_a,this.app_s.getState().wkf_doc_info.stato=this.m_obj.stat_stato,this.app_s.getState().wkf_doc_info.uiid_app=this.id_applicativo,this.app_s.getState().wkf_doc_info.uiid_doc=this.m_obj.id_documento,this.app_s.getState().wkf_doc_info.canale=this.m_obj.canale},t.prototype.evt_salv=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!1),this.b_rip_pulsanti=t,this.btnprocedi=!1,e&&!this.ck_field()||this.salva()},t.prototype.prendi_in_carico=function(){this.in_carico=!1,null!=this.m_obj.assegnati_paralleli&&1!=this.m_obj.assegnati_paralleli.split(",").length&&this.m_obj.assegnati_paralleli.indexOf(this.app_s.user)>-1&&(this.b_assengna_a=!0),this.update_status(!0,null,this.in_carico,this.b_assengna_a,1),this.m_obj.autori=this.app_s.user;var t=new vt;t.sql="UPDATE_WKF_PRENDI_IN_CARICO",t.types=["string","string","string"],t.values=[this.id_applicativo,this.id_documento,this.app_s.user_surname+" "+this.app_s.user_name],this.m_dataService.doQuery(t).subscribe(),this.reassigned_to("C"),(t=new vt).sql="INSERT_WORKFLOW_LOG",t.types=["string","string","string","string","string"],t.values=[this.id_applicativo,this.app_s.user,"Presa in carico",this.m_obj.stat_stato,this.id_documento],this.m_dataService.doQuery(t).subscribe()},t.prototype.salva=function(){var t=this;if(this.can_save()&&!this.save_alreadypressed)if(this.save_alreadypressed=!0,setTimeout((function(){t.save_alreadypressed=!1}),1e3),""==this.m_obj.codice){if("respingi"==this.oper)return void this.alert("Errore di configurazione pratica contattare ufficio IT [0x001]",1);this.ck_canale_multiplo()}else this.save_agg()},t.prototype.doApprova=function(){this.b_respingi=!1,this.over_canale_iniz();var t=0;if(this.nlevel=null,0==this.m_obj.stato)for(var e=0;e<this.livs.length;e++)(this.livs[e].step<t||0==t)&&(this.clevel=this.livs[e],t=this.livs[e].step);else{if(t=this.m_obj.stato,console.log("this.m_obj.canale ",this.m_obj.canale,t),null!=this.m_obj.canale&&""!=this.m_obj.canale)for(e=0;e<this.livs.length;e++)if(this.livs[e].step==t&&(console.log(" liv ",this.livs[e]),this.user_idp.toUpperCase()==this.livs[e].username.toUpperCase()&&(console.log(this.m_obj.canale+" "+this.livs[e].context),this.m_obj.canale==this.livs[e].context))){console.log("clevel 1 ",this.livs[e]),this.clevel=this.livs[e];break}if(console.log("clevel 2 ",this.clevel),null==this.clevel)for(e=0;e<this.livs.length;e++)if(null==this.livs[e].username&&(this.livs[e].username="ZZZ"),this.livs[e].step==t&&!("*ALLUSERS"!=this.livs[e].context&&this.user_idp.toUpperCase()!=this.livs[e].username.toUpperCase()||""!=this.c_canale&&""!=this.livs[e].context&&this.c_canale!=this.livs[e].context&&"*ALLUSERS"!=this.livs[e].context)){this.clevel=this.livs[e];break}}if(console.log("clevel 2 ",this.clevel),this.clevel=this.check_n_levels(this.clevel),null!=this.clevel&&""!=this.clevel){var i=t;if("procedi"==this.oper&&1==this.clevel.salto_iniziale){t=this.clevel.livello;for(e=0;e<this.livs.length;e++)this.user_idp.toUpperCase()==this.livs[e].username.toUpperCase()&&0==this.livs[e].notifica&&this.livs[e].step>t&&0!=t&&this.livs[e].step!=i&&(-1==this.limite_salto_after||this.livs[e].step<this.limite_salto_after)&&(this.clevel=this.livs[e],t=this.livs[e].step);for(var n=this.wkf_rule(t),o=0;o<this.livs.length;o++)if(this.livs[o].livello==n&&this.user_idp.toUpperCase()==this.livs[o].idp.toUpperCase()&&(""==this.c_canale||""==this.livs[o].context||this.c_canale==this.livs[o].context)){this.clevel=this.livs[o],t=this.livs[o].livello;break}}this.clevel=this.check_n_levels(this.clevel),this.calcolanextandjump()}else this.alert("Errore di configurazione pratica contattare ufficio IT [0x002]",1)},t.prototype.wkf_rule_before=function(t,e,i){return t},t.prototype.calcolanextandjump=function(){var t=this,e=new vt;e.sql="SELECT_TRANSAZIONI_FROM_LVL",e.values=[this.id_applicativo,this.clevel.step],e.types=["string","int"],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;if(console.log("transazioni ",i),0==(i=t.wkf_rule_before(i,t.clevel.step,t.clevel.context)).length)return void t.alert("Nessuna transizione definita dallo step: "+t.clevel.step,1);if(1==i.length)t.calcolanextandjump2(i[0]);else t.m_dialog.open(Hi,{disableClose:!0,data:i}).afterClosed().subscribe((function(e){console.log("ris select level",e),null!=e?t.calcolanextandjump2(e):t.update_status(!0,null,null,null,2)}))}}))},t.prototype.calcolanextandjump2=function(t){console.log("calcolanextandjump2",t),this.transizione_info=t;for(var e=0,i=0,n=0;n<this.livs.length;n++)t.step_d==this.livs[n].step&&(this.nlevel=this.livs[n],e=this.livs[n].step);i=this.wkf_rule(e);var o=!1;for(n=0;n<this.livs.length;n++)""!=this.clevel.context&&this.clevel.context!=this.livs[n].context||this.livs[n].step==i&&(this.nlevel=this.livs[n],i=this.livs[n].step,o=!0);if(!o)for(n=0;n<this.livs.length;n++)if(this.livs[n].step==i&&0==this.livs[n].notifica){this.nlevel=this.livs[n],i=this.livs[n].step;break}this.ck_after(i)?this.calcola_destinari(t):this.update_status(this.b_edit_before,null,null,null,3)},t.prototype.calcola_destinari=function(t){var e=this;if(console.log("this. this.transizione_info ",t),null==this.nlevel)return this.alert("problema di configurazione passaggio prossimo livello "+this.clevel.des_step+" non attivato comunicare al CED (verificare responsabile in anagrafica utente)",1),void this.update_status(this.b_edit_before,null,null,null,3);console.log("canale before: "+this.clevel.context),null!=this.c_canale&&""!=this.c_canale&&(null!=this.clevel.context&&""!=this.clevel.context||(this.clevel.context=this.c_canale)),console.log("canale after: "+this.clevel.context);var i=new Array;if(""==this.clevel.context)for(var n=0;n<this.livs.length;n++)this.livs[n].step==this.nlevel.step&&i.push(this.livs[n]);else{var o=!1;for(n=0;n<this.livs.length;n++)this.livs[n].step==this.nlevel.step&&""!=this.livs[n].context&&(o=!0);console.log("canale: "+this.clevel.context);for(n=0;n<this.livs.length;n++)this.livs[n].step==this.nlevel.step&&(this.clevel.context!=this.livs[n].context&&o&&"*SYSTEM"!=this.livs[n].context||(i.push(this.livs[n]),this.nlevel=this.livs[n]))}if(console.log("autori calcolati: "+i),0!=i.length)if(null==t.pre_assegna_req&&(t.pre_assegna_req=0),null==t.pre_assegna_man&&(t.pre_assegna_man=0),console.log(" o.pre_assegna_req ",t.pre_assegna_req),1==this.transizione_info.manual_assignment||1==t.pre_assegna_man){var s=[];null!=this.m_obj.creatore&&""!=this.m_obj.creatore&&i.map((function(t){t.username==e.m_obj.creatore&&s.push(t)})),i=i.sort((function(t,e){return t.nc>e.nc?1:t.nc<e.nc?-1:0}));var a=JSON.parse(JSON.stringify(i));this.m_dialog.open(Ni,{disableClose:!0,data:{title:this.tsr.instant("Conferma Assegnazione"),lbl:t.description,commento_default:"",comm_notrequired:t.comments_opt,utenti:i,user_sel:0==t.pre_assegna_req?[]:s,pre_assegna_man:1==t.pre_assegna_man}}).afterClosed().subscribe((function(i){if(""==i||null==i)return e.update_status(!0,!1,null,null,4),void(e.respingi_enabled&&e.update_status(!0,!0,null,null,5));1!=t.pre_assegna_man?e.exec_wkf(t,e.nlevel,i.arrsel,i.nota,e.transizione_info.create_ver,null):e.exec_wkf(t,e.nlevel,i.arrsel,i.nota,e.transizione_info.create_ver,a)}))}else{var r="";i.map((function(t){null==t.nc&&(t.nc=t.value.split("*").join(""))}));var l=[],p=JSON.parse(JSON.stringify(i)),u=!1;if(1==t.pre_assegna_req){var c=[];null!=this.m_obj.creatore&&""!=this.m_obj.creatore&&i.map((function(t){t.username==e.m_obj.creatore&&c.push(t)})),(c=c.sort((function(t,e){return t.nc>e.nc?1:t.nc<e.nc?-1:0}))).length>0&&(i=JSON.parse(JSON.stringify(c)))}i.map((function(t){null!=t.default_value&&1==t.default_value&&(u=!0)})),u&&(i.map((function(t){null!=t.default_value&&1==t.default_value&&l.push(t)})),i=JSON.parse(JSON.stringify(l)));for(n=0;n<i.length;n++)null!=i[n].nc&&-1==r.indexOf(i[n].nc)&&(""!=r&&(r+=";"),r+=i[n].nc);console.log(" sp ",r),this.m_dialog.open(Pi,{disableClose:!0,data:{title:"Conferma Avanzamento",lbl:t.description,icon:t.icon,color_font:t.color_font,color:t.color,commento_default:"",comm_notrequired:t.comments_opt,utenti:r}}).afterClosed().subscribe((function(n){if(null==n||"abort"==n)return e.update_status(!0,!1,null,null,6),void(e.respingi_enabled&&e.update_status(!0,!0,null,null,7));e.exec_wkf(t,e.nlevel,i,n,e.transizione_info.create_ver,p)}))}else this.alert("problema di configurazione il livello "+this.nlevel.descri_livello+" non presenta utenti partecipanti validi",1)},t.prototype.assegna_a=function(){for(var t=this,e=this.m_obj.assegnati_paralleli.split(","),i=[],n=0;n<e.length;n++)for(var o=0;o<this.livs.length;o++)if(e[n]==this.livs[o].username){i.push({username:e[n],nc:this.livs[o].nc});break}i=i.sort((function(t,e){return t.nc>e.nc?1:t.nc<e.nc?-1:0})),this.m_dialog.open(Xi,{disableClose:!0,width:"800px",data:{title:this.tsr.instant("Conferma Assegnazione"),lbl:"",commento_default:"",comm_notrequired:"",utenti:i,prendi_in_carico:this.m_obj.autori!=this.app_s.user}}).afterClosed().subscribe((function(e){if(e){if(0==e.arrsel.length)return void t.alert("Impossibile riassegnare",1);var i="";t.m_obj.autori="",t.m_obj.pers_int="";var n=!1;e.arrsel.map((function(e){""!=i&&(i+=","),i+=e.username,-1==t.m_obj.autori.indexOf(e.username)&&(console.log("VVV ",e),""!=t.m_obj.autori&&(t.m_obj.autori=t.m_obj.autori+","),t.m_obj.autori=t.m_obj.autori+e.username,""!=t.m_obj.pers_int&&(t.m_obj.pers_int=t.m_obj.pers_int+","),t.m_obj.pers_int=t.m_obj.pers_int+e.nc),e.username==t.app_info.user&&(n=!0)})),t.in_carico=!1,null!=t.m_obj.autori&&1!=t.m_obj.autori.split(",").length&&(t.in_carico=!0),console.log(t.m_obj.autori,t.in_carico),t.b_assengna_a=!1,null!=t.m_obj.assegnati_paralleli&&1!=t.m_obj.assegnati_paralleli.split(",").length&&t.m_obj.assegnati_paralleli.indexOf(t.app_s.user)>-1&&(t.b_assengna_a=!0),t.update_status(n,!1,t.in_carico,t.b_assengna_a,18),t.respingi_enabled&&t.update_status(n,!0,t.in_carico,t.b_assengna_a,19);var o=new vt;o.sql="UPDATE_WKF_DOC_AUTHOR",o.values=[t.id_applicativo,t.id_documento,t.m_obj.autori,t.m_obj.pers_int],o.types=["string","string","string","string"],t.m_dataService.doQuery(o).subscribe((function(n){if(null!=n&&"OK"==n.result_msg&&(t.reassigned_to(e.op),t.m_dataService.doQuery({sql:"INSERT_WORKFLOW_LOG",values:[t.id_applicativo,t.user_idp,"DOCUMENTO RIASSEGNATO","DOCUMENTO RIASSEGNATO A: "+i,t.id_documento],types:["string","string","string","string","string"],names:[]}).subscribe((function(t){})),"C"==e.op&&t.update_status(!0,t.respingi_enabled,t.in_carico,t.b_assengna_a,18),"A"==e.op)){var o=t.app_info.descrizione_breve+", Ti è stato assegnato il documento numero: "+t.m_obj.codice+" "+t.getTitle()+" - "+t.getLvlDescri(String(t.m_liv),t.m_statox),s="<br>Attività:"+t.getLvlDescri(String(t.m_liv),t.m_statox)+"<br>"+t.m_statox+"<br>"+t.getDescri();null!=t.app_info.subject_riassegna&&""!=t.app_info.subject_riassegna&&(o=t.app_info.subject_riassegna),null!=t.app_info.body_riassegna&&""!=t.app_info.body_riassegna&&(s=t.app_info.body_riassegna),o=o.split("{{TRANSITION_DESCRI}}").join(t.getLvlDescri(String(t.m_liv),t.m_statox)),s=s.split("{{TRANSITION_DESCRI}}").join(t.getLvlDescri(String(t.m_liv),t.m_statox)),t.sendEMail_ex(t.user_idp,i,o,s,t.id_applicativo,t.id_documento,t.app_info.COMPANY_SITE_ROOT+"#/"+t.app_info.modulo_swf+"/"+t.id_applicativo+"/"+t.id_documento+"/edit",t.m_obj.codice,"",!0,"",!1,"")}}))}}))},t.prototype.exec_wkf=function(t,e,i,n,o,s){var a=this;void 0===o&&(o=!1),console.log("exec_wkf trans ",t," liv ",e," arrdest ",i," comm ",n," crea_ver ",o," assegnati_paralleli ",s);var r=!1;null!=this.app_s.dev_mode&&"1"==this.app_s.dev_mode&&(r=!0),console.log("exec_wkf ",i,s),null==o&&(o=!1),this.dialogRef_ww=this.m_dialog.open(Nt,{disableClose:!0,data:{label:this.tsr.instant("Attendere")}}),this.ttw=0,null==s&&(s=JSON.parse(JSON.stringify(i)));var l=new gt;l.command="exec_app",l.p1=o?"create_ver":"exec_wkf";var p=this.uti_s.newGuid();l.p2=p;var u=new vt;u.sql="INSERT_WKF_OP",u.values=o?[p,JSON.stringify({transizione:{uiid_wkf:t.uiid_wkf,uiid:t.uiid,step_d:t.step_d,step_o:t.step_o},commento:n,id_applicazione:this.id_applicativo,id_documento:this.id_documento,username:this.app_s.user})]:[p,JSON.stringify({transizione:t,destinatari:i,commento:n,assegnati_paralleli:s,id_applicazione:this.id_applicativo,id_documento:this.id_documento,username:this.app_s.user,title:this.getTitle().split('"').join("_doppiap_"),descri:this.getDescri().split('"').join("_doppiap_"),dev_mode:r?1:0})],u.types=["string","string"],this.m_dataService.doQuery(u).subscribe((function(e){a.reset_updw(),a.m_fileservice.doQuery(l).subscribe((function(e){console.log(e),t.step_d>=900?a.doEnd(t.step_d):a.chstato(t.step_d),null!=a.dialogRef_ww&&null!=a.dialogRef_ww.componentInstance&&a.dialogRef_ww.componentInstance.update_progess(100),a.goto_edit_doc()}))}))},t.prototype.reset_updw=function(){var t=this;this.ttw+=10,null!=this.dialogRef_ww&&null!=this.dialogRef_ww.componentInstance&&this.dialogRef_ww.componentInstance.update_progess(this.ttw),setTimeout((function(){t.reset_updw()}),800)},t.prototype.back=function(t){var e=this,i=this.uti_s.get_diff_doc(this.old_doc,this.getfieldvalues());console.log(i);for(var n=[],o=0;o<i.length;o++)"-1"==i[o].val&&(i[o].val=""),"-1"==i[o].oldVal&&(i[o].oldVal="")," "==i[o].val&&(i[o].val="")," "==i[o].oldVal&&(i[o].oldVal=""),i[o].val instanceof Number&&i[o].oldVal instanceof String&&(i[o].oldVal=Number(i[o].oldVal.split(",").join(".")));for(o=0;o<i.length;o++)("update"!=i[o].op||"date"!=i[o].val&&"string"!=i[o].val)&&("add"==i[o].op&&null==i[o].val&&""==i[o].oldVal||i[o].val!=i[o].oldVal&&(""==i[o].val&&"0"==i[o].oldVal||"0"==i[o].val&&null==i[o].oldVal||i[o].val instanceof Date||n.push(i[o])));for(o=0;o<i.length;o++)i[o].val instanceof Date&&new Date(i[o].val).getTime()!=new Date(i[o].oldVal).getTime()&&n.push(i[o]);t&&0!=n.length?this.m_dialog.open(Ki,{disableClose:!0}).afterClosed().subscribe((function(t){"esci_senza_salv"==t&&e.m_router.navigate([e.app_info.modulo_swf]),"salva_esci"==t&&(e.evt_salv(),e.m_router.navigate([e.app_info.modulo_swf]))})):this.m_router.navigate([this.app_info.modulo_swf])},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,a,r,l,p,u,c,d){var _=this;void 0===p&&(p=!0),void 0===u&&(u=""),void 0===c&&(c=!0),void 0===d&&(d="");var h=!1;null!=this.app_s.dev_mode&&"1"==this.app_s.dev_mode&&(h=!0);var m={destinatari:e.split(","),commento:d,id_applicazione:o,id_documento:s,username:t,e_subject:i,e_body:n,dev_mode:h?1:0},f=new gt;f.command="exec_app",f.p1="send_email";var g=this.uti_s.newGuid();f.p2=g;var v=new vt;v.sql="INSERT_WKF_OP",v.values=[g,JSON.stringify(m)],v.types=["string","string"],this.m_dataService.doQuery(v).subscribe((function(t){_.m_fileservice.doQuery(f).subscribe((function(t){c&&_.goto_edit_doc(p)}))}))},t.prototype.goto_edit_doc=function(t){void 0===t&&(t=!0),this.m_router.navigate([this.app_info.modulo_swf]),t&&this.alert("Avanzamento effettuato",0)},t.prototype.addOverrideLvlUser=function(t){null==this.override_livs&&(this.override_livs=[]),this.override_livs.push(t)},t.prototype.getLvlInfo=function(t){for(var e=0;e<this.livs.length;e++)if(t==this.livs[e].step)return this.livs[e];return null},t.prototype.insert_commento=function(t,e,i,n){var o=new vt;o.sql="INSERT_WKF_COMMENTO",o.values=[t,e,i,n,""],o.types=["string","string","string","string","string"],this.m_dataService.doQuery(o).subscribe((function(t){null!=t&&t.result_msg}))},t.prototype.insert_wkf_variabile=function(t,e,i,n){var o=new vt;o.sql="insert_wkf_variabile",o.values=[t,e,i,n],this.m_wkf.doQuery(o).subscribe((function(t){null!=t&&t.result_msg}))},t.prototype.respingi=function(){this.can_save()&&(this.oper="respingi",this.btnprocedi=!0,this.update_status(!1,!1,null,null,8),this.salva())},t.prototype.procedi=function(){if(this.can_save()){if(this.oper="procedi",this.btnprocedi=!0,this.update_status(!1,!1,null,null,9),!this.ck_field())return this.update_status(!0,null,null,null,10),void(this.respingi_enabled&&this.update_status(!0,!0,null,null,11));this.salva()}},t.prototype.open_wkf=function(t,e,i){var n=this;void 0===e&&(e=!1),void 0===i&&(i=!0),console.log("inser_c = false,edit_c=true ",e,i);var o=this.app_s.getState().body_h-40+"px",s=this.m_dialog.open(Ui,{disableClose:!0,width:"95%",height:o,data:{edit_c:i}});setTimeout((function(){s.componentInstance.subject=n.app_info.descrizione_breve+", <OP>: "+n.m_obj.codice+" "+n.getTitle(),null!=n.m_obj.lettori?s.componentInstance.lettori=n.m_obj.lettori:s.componentInstance.lettori="",s.componentInstance.link=n.app_s.COMPANY_SITE_ROOT+"#/"+n.app_info.modulo_swf+"/"+n.id_applicativo+"/"+n.id_documento+"/edit",s.componentInstance.codice_doc=n.m_obj.codice,s.componentInstance.notifica_commenti=n.app_info.notifica_commenti,s.componentInstance.notifica_commenti_obbl=n.app_info.notifica_commenti_obbl,s.componentInstance.commenti_insert=e,s.componentInstance.init_v()})),s.afterClosed().subscribe((function(e){null==e&&"i"==e&&(console.log("inserito commento"),t.emit()),n.r_count()}))},t.prototype.open_commenti=function(t){var e=this,i=this.m_dialog.open(Mi,{disableClose:!0,width:"90%"});setTimeout((function(){i.componentInstance.subject=e.app_info.descrizione_breve+", <OP>: "+e.m_obj.codice+" "+e.getTitle(),null!=e.m_obj.lettori?i.componentInstance.lettori=e.m_obj.lettori:i.componentInstance.lettori="",i.componentInstance.link=e.app_s.COMPANY_SITE_ROOT+"#/"+e.app_info.modulo_swf+"/"+e.id_applicativo+"/"+e.id_documento+"/edit",i.componentInstance.codice_doc=e.m_obj.codice,i.componentInstance.notifica_commenti=e.app_info.notifica_commenti,i.componentInstance.notifica_commenti_obbl=e.app_info.notifica_commenti_obbl,i.componentInstance.init_v()})),i.afterClosed().subscribe((function(i){null!=i&&"i"==i&&(t.emit(),console.log("emetto insert")),e.r_count()}))},t.prototype.open_upload=function(t,e){var i=this;void 0===t&&(t=""),void 0===e&&(e="[ZZZ_DIS_CC]"),console.log("open_upload ",t,e);var n=this.m_dialog.open(Qi,{disableClose:!0,width:"90%",data:{admin_role:e,App:this.id_applicativo,K:this.id_documento}});setTimeout((function(){n.componentInstance.sovrascrivi_path=t})),n.afterClosed().subscribe((function(t){i.r_count()}))},t.prototype.create_new_document=function(){var t=this,e=new vt;e.sql="insert_new_doc_v2",null==this.c_canale&&(this.c_canale=""),e.values=[this.id_applicativo,this.id_documento,this.c_canale,this.user_idp],this.m_wkf.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.m_dataService.doQuery({sql:"INSERT_WORKFLOW_LOG",values:[t.id_applicativo,t.user_idp,"INSERIMENTO","INSERIMENTO DOCUMENTO",t.id_documento],types:["string","string","string","string","string"],names:[]}).subscribe((function(t){})),t.save_agg())}))},t.prototype.save_agg=function(){var t=this;this.before_save(),this.b_edit_before=this.b_edit&&this.b_rip_pulsanti,this.update_status(!1,null,null,null,12);var e=this.getfieldvalues(),i=new vt;i.sql="insert_aggiuntivi",i.types=["string","string"],i.values=[this.app_info.tabella_dati,this.id_documento],i.names=["tabella","id_documento"];for(var n=0;n<e.length;n++)i.types.push(e[n].types),i.names.push(e[n].names),null==e[n].values?e[n].values="dbnull":("boolean"==e[n].types&&(e[n].values?e[n].values="1":e[n].values="0"),"int"==e[n].types&&(e[n].values+""==""?e[n].values="dbnull":isNaN(e[n].values)?e[n].values="0":e[n].values=""+e[n].values),"string"==e[n].types&&(e[n].values=""+e[n].values),"date"==e[n].types&&(e[n].values=this.uti_s.sql_date(e[n].values),"NaN-NaN-NaN"==e[n].values.split("0").join("")&&(e[n].values="dbnull")),"datetime"==e[n].types&&(console.log("typeof ",typeof e[n].values,e[n].values),e[n].values=this.uti_s.sql_date_time(e[n].values),console.log("arr[i].values ",e[n].values),"NaN-NaN-NaN NaN:NaN"==e[n].values.split("0").join("")&&(e[n].values="dbnull")),"string"==e[n].types&&null==e[n].values&&(e[n].values="dbnull"),"decimal"==e[n].types&&(e[n].values+""==""?e[n].values="dbnull":isNaN(e[n].values)?e[n].values="0":e[n].values=""+e[n].values)),i.values.push(e[n].values);this.m_wkf.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.ok_insert_aggiuntivi()}),(function(t){}))},t.prototype.ok_insert_aggiuntivi=function(){this.btnprocedi?this.b_edit||this.btnprocedi?this.load_document():this.m_router.navigate([this.app_info.modulo_swf,this.id_applicativo,this.id_documento,"edit"]):(this.alert("DOCUMENTO SALVATO",0),this.after_save(),this.update_status(this.b_edit_before,null,null,null,13),this.b_edit||this.btnprocedi||this.m_router.navigate([this.app_info.modulo_swf,this.id_applicativo,this.id_documento,"edit"]))},t.prototype.load_document=function(){var t=this;if(null!=this.app_info){var e=new vt;e.sql="SELECT_WKF_DOCUMENT_NOREP",e.types=["string","string","string"],e.values=[this.app_info.vista_sql,this.id_applicativo,this.id_documento],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;i.length>0?t.ok_load_document(i[0]):t.alert("DOCUMENTO NON TROVATO",1)}}),(function(t){}))}else setTimeout((function(){t.load_document()}),200)},t.prototype.ok_load_document=function(t){var e=this;this.m_obj=JSON.parse(JSON.stringify(t)),null!=this.m_obj.assegnati_paralleli&&1!=this.m_obj.assegnati_paralleli.split(",").length&&this.m_obj.assegnati_paralleli.indexOf(this.app_s.user)>-1&&(this.b_assengna_a=!0),this.in_carico=!1,this.b_assengna_a&&(null==this.m_obj.autori||""==this.m_obj.autori||1!=this.m_obj.autori.split(",").length)&&(this.in_carico=!0),this.update_status(!1,null,this.b_assengna_a&&this.in_carico,this.b_assengna_a,14),this.save_to_app_state();var i=new vt;i.sql="SELECT_WLIVELLIV2_2",i.types=["string"],i.values=[this.id_applicativo],this.m_dataService.doQuery(i).subscribe((function(t){if(null!=t&&"OK"==t.result_msg){if(console.log("end SELECT_WLIVELLIV2_2",new Date),null!=e.override_livs&&null!=t.result_data)for(var i=0;i<e.override_livs.length;i++)for(var n=0;n<t.result_data.length;n++)null!=t.result_data[n].id_Applicativo&&t.result_data[n].id_Applicativo==e.override_livs[i].id_Applicativo&&(t.result_data[n].idp=e.override_livs[i].idp,t.result_data[n].context=e.override_livs[i].context,t.result_data[n].nc=e.override_livs[i].nc);t.result_data.map((function(t){null==t.username&&(t.username="SYSTEM")}));var o=new vt;o.sql="SELECT_WKF_VARIABILES_V2",o.types=["string"],o.values=[e.id_documento],e.m_dataService.doQuery(o).subscribe((function(i){if(null!=i&&"OK"==i.result_msg){if(console.log("SELECT_WKF_VARIABILES_V2 ",i.result_data),i.result_data.push({k:"*CURRENT_USER",v:e.app_s.user,nc:e.app_s.user_surname+" "+e.app_s.user_name}),null==e.m_obj.stato||e.m_obj.stato<=10)i.result_data.push({k:"*ALLUSERS",v:e.app_s.user,nc:e.app_s.user_surname+" "+e.app_s.user_name});else for(var n=0;n<i.result_data.length;n++)if("*REQUESTER"==i.result_data[n].k.split("CREATOR").join("REQUESTER")){i.result_data.push({k:"*ALLUSERS",v:i.result_data[n].v,nc:i.result_data[n].nc});break}console.log("SELECT_WKF_VARIABILES_V2 dopo add ",i.result_data),t.result_data.map((function(t){0==t.value.indexOf("*")&&(t.context=e.m_obj.canale,t.description="",t.name="",i.result_data.map((function(e){t.value.split("CREATOR").join("REQUESTER")==e.k.split("CREATOR").join("REQUESTER")&&(console.log("sostituisco k: ",e.k,e.v),t.username=e.v,t.nc=e.nc,t.ncx=e.nc,t.sost=!0)})))})),console.log("Var speciali ",i.result_data);var o=[];t.result_data.map((function(t){0!=t.value.indexOf("*")||t.sost?o.push(t):console.log("escludo! ",t)})),t.result_data=JSON.parse(JSON.stringify(o)),console.log("liv dopo SELECT_WKF_VARIABILES_V2 ",t.result_data),e.ok_livelli_doc(t.result_data)}}))}}))},t.prototype.ok_livelli_doc=function(t){if(console.log(),this.livs=t,this.over_canale_iniz(),this.m_obj.stato<=10)for(var e=0;e<this.livs.length;e++)this.livs[e].username.toUpperCase()!=this.user_idp.toUpperCase()&&"*ALLUSERS"!=this.livs[e].context||10==this.livs[e].step&&0==this.livs[e].notifica&&"*ALLUSERS"==this.livs[e].context&&(this.livs[e].context="",this.livs[e].username=this.user_idp);!this.b_edit||this.btnprocedi?this.btnprocedi&&this.doApprova():this.return_edit()},t.prototype.r_count=function(){var t=this,e=new vt;e.sql="SELECT_WKF_ALLEGATI_COUNTER",e.types=["string","string"],e.values=[this.id_applicativo,this.id_documento],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=e.result_data,n=0,o=0,s=0;s<i.length;s++)i[s].n>0&&("ALLEGATI"==i[s].v&&(n=i[s].n),"COMMENTI"==i[s].v&&(o=i[s].n));t.reset_counters_int(o,n)}}),(function(t){}))},t.prototype.reset_counters_int=function(t,e){t>0&&(this.comm_c=t),e>0&&(this.all_c=e)},t.prototype.set_canale_iniziale=function(t,e){void 0===e&&(e=!1),this.forza_canale=t,e&&this.over_canale_iniz()},t.prototype.over_canale_iniz=function(){if(null!=this.forza_canale&&""!=this.forza_canale){for(var t=0,e=0;e<this.livs.length;e++)(this.livs[e].step<t||0==t)&&(t=this.livs[e].step);for(e=0;e<this.livs.length;e++)this.livs[e].step==t&&(this.livs[e].context=this.forza_canale);this.m_obj.canale=this.forza_canale,this.c_canale=this.forza_canale}},t.prototype.ck_canale_multiplo=function(){var t=this;console.log("ck_canale_multiplo ",this.livs);for(var e=0,i=0;i<this.livs.length;i++)(this.livs[i].step<e||0==e)&&(this.clevel=this.livs[i],e=this.livs[i].step);console.log("min_liv ",e);var n=[];for(i=0;i<this.livs.length;i++)if(this.livs[i].step==e&&this.app_s.getState().wkf_doc_info.curr_user.toUpperCase()==this.livs[i].username.toUpperCase()){console.log(" this.livs[i].step ",this.livs[i].step,this.livs[i].username.toUpperCase(),this.livs[i].context);for(var o=!1,s=0;s<this.livs.length;s++)if(this.livs[s].context==this.livs[i].context){o=!0;break}o||(null!=this.livs[i].context?n.push(this.livs[i].context):n.push(""))}n.length<=1?(this.c_canale=n[0],this.create_new_document()):(this.app_s.getState().wkf_doc_info.canali_arr=n.sort((function(t,e){return t>e?1:t<e?-1:0})),this.m_dialog.open(Bi,{disableClose:!0}).afterClosed().subscribe((function(e){null!=e&&""!=e&&(t.c_canale=e,t.create_new_document())})))},t.prototype.open_info=function(){var t=this;this.s_uto="";for(var e=this.m_obj.autori.split(","),i=0;i<e.length;i++)for(var n=0;n<this.livs.length;n++)if(this.livs[n].idp==e[i]){""!=this.s_uto&&(this.s_uto=this.s_uto+","),this.s_uto=this.s_uto+this.livs[n].nc;break}this.app_s.getState().wkf_doc_info.in_carico_a=this.s_uto,this.m_obj.s_uto=this.s_uto,console.log("this.m_obj ",this.m_obj);var o=this.m_dialog.open(zi,{disableClose:!0,data:this.m_obj});setTimeout((function(){o.componentInstance.hide_richiedente=t.hide_richiedente})),o.afterClosed().subscribe((function(t){}))},t.prototype.setForceJump=function(t,e,i){var n=this;void 0===e&&(e=""),void 0===i&&(i=!0);for(var o,s="",a="",r="",l="",p="",u="",c=0;c<this.livs.length;c++)t!=this.livs[c].step||""!=e&&!this.livs[c].canale||(1==this.livs[c].email_ospiti&&1==this.livs[c].notifica||1==this.livs[c].email_partecipanti&&0==this.livs[c].notifica)&&(""!=a&&(a+=","),a+=this.livs[c].username),t!=this.livs[c].step||0!=this.livs[c].notifica||""!=e&&!this.livs[c].canale||(""!=s&&(s+=","),s+=this.livs[c].username,""!=p&&(p+=","),p+=this.livs[c].nc,u=this.livs[c].descri_livello);if(""==s)return"NESSUN UTENTE CONFIGURATO STEP: "+t+" CANALE: "+e;a=Array.from(new Set(a.split(","))).join(","),null==this.m_obj.partecipanti&&null!=this.m_obj.autori&&(this.m_obj.partecipanti=Array.from(new Set(this.m_obj.autori.split(","))).join(",")),this.m_obj.partecipanti=Array.from(new Set(this.m_obj.partecipanti.split(","))).join(","),o=this.app_info.documento_pubblico?[s,"",t,this.tsr.instant("Assegnata a")+": "+p,"",s,this.getLvlDescri(String(t),this.tsr.instant("Assegnata a")+": "+p),this.getUsersList(p,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento,e]:[s,this.m_obj.partecipanti+","+s,t,this.tsr.instant("Assegnata a")+": "+p,"",s,this.getLvlDescri(String(t),this.tsr.instant("Assegnata a")+": "+p),this.getUsersList(p,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento,e];var d=[];for(c=0;c<o.length;c++)d.push("string");var _=new vt;return _.sql="exec_app_workflow",_.values=[this.app_info.codice_documento,this.id_documento,""+this.m_obj.stato,""+t,this.user_idp],this.m_wkf.doQuery(_).subscribe((function(t){})),(_=new vt).sql="UPDATE_WKF_DOCUMENTOV3_NS",_.values=o,_.types=d,this.m_dataService.doQuery(_).subscribe((function(e){var o=!1;if(null!=e&&"OK"==e.result_msg){var s=new vt;s.sql="doWKF",s.values=[n.app_info.descrizione_breve,n.m_obj.codice,""+t,""+t,n.m_obj.codice+" - "+n.getTitle(),n.getTitle()+"La scheda numero: "+n.m_obj.codice+" è passata allo stato: "+u,n.app_s.COMPANY_SITE_ROOT+"#/"+n.app_info.modulo_swf+"/"+n.id_applicativo+"/"+n.id_documento+"/edit","In approvazione",n.getDescri(),n.user_idp,u,"",n.id_applicativo,n.id_documento,"1","0",""+n.m_obj.stato,""+t],n.insert_wkf_variabile(n.id_applicativo,n.id_documento,"PLAYER_"+n.m_obj.stato,n.user_idp),n.m_liv=t,n.m_wkf.doQuery(s).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(i&&""!=a?(r=n.app_info.descrizione_breve+", Ti è stato assegnato il documento numero: "+n.m_obj.codice+" "+n.getTitle()+" - "+n.getLvlDescri(String(n.m_liv),n.m_statox),l="<br>Attività:"+n.getLvlDescri(String(n.m_liv),n.m_statox)+"<br>"+n.m_statox+"<br>"+n.getDescri(),null!=n.app_info.subject_riassegna&&""!=n.app_info.subject_riassegna&&(r=n.app_info.subject_riassegna),null!=n.app_info.body_riassegna&&""!=n.app_info.body_riassegna&&(l=n.app_info.body_riassegna),r=r.split("{{TRANSITION_DESCRI}}").join(n.getLvlDescri(String(n.m_liv),n.m_statox)),l=l.split("{{TRANSITION_DESCRI}}").join(n.getLvlDescri(String(n.m_liv),n.m_statox)),n.sendEMail_ex(n.user_idp,a,r,l,n.id_applicativo,n.id_documento,n.app_s.COMPANY_SITE_ROOT+"#/"+n.app_info.modulo_swf+"/"+n.id_applicativo+"/"+n.id_documento+"/edit",n.m_obj.codice,"",!0,"",!0,"")):n.goto_edit_doc())})),o=!0}o||n.alert(e.msg,1)}),(function(t){})),"OK"},t.prototype.insert_doc=function(){var t=this;this.m_autori=this.user_idp,this.m_lettori="",this.m_statox="",this.m_danotificare="",this.m_oper="",this.m_autori_paralleli="",this.m_crea_att=0,this.m_send_email=0,this.clevel=null,this.nlevel=null,this.m_obj=new Object,this.id_documento=this.uti_s.newGuid(),this.m_obj.id_documento=this.id_documento,this.m_obj.codice="",this.m_obj.data_richiesta=new Date,this.m_obj.richiedente=this.user_idp,this.m_obj.autori=this.user_idp,this.m_obj.stato=0,this.m_obj.stat_stato="In Creazione",this.m_obj.richiesta_da=this.user_idp,this.m_obj.in_carico_a="",this.m_obj.nc=this.user_cognome+" "+this.user_nome,this.c_canale="",this.dtr=new Date,this.rich=this.user_idp,this.cod="",this.dt_scad=null,this.m_statox="",this.oggetto_editable=!0,this.descrizione_editable=!0,this.btnSalva_visible=!0,this.b_PrendiInCarico=!1,this.stat_stato_text="Bozza",this.creatore_text=this.user_cognome+" "+this.user_nome,this.pers_int_text=this.user_cognome+" "+this.user_nome,this.rich_enabled=!0,this.oggetto_text="",this.descrizione_text="",this.m_obj.stato_txt="",this.m_obj.stato=0,this.bEdit=!0,this.bEdit_wkf=!1,this.bEditOp_wkf=!1,this.bEditAp_wkf=!1,this.bEditAss_wkf=!1,this.bEditBozza_wkf=!1,this.bEdit_bozza=!1,this.bNuovaRev_Agg=!1,this.bEdit_Agg=this.bEdit_wkf,this.btnSalva_label=this.tsr.instant("SALVA"),this.btnTerminaOp_label=this.tsr.instant("Termina Attività"),this.btnApprova_label=this.tsr.instant("APPROVA"),this.btnAssegna_label=this.tsr.instant("Assegna"),this.btnRespingi_label=this.tsr.instant("RESPINGI"),this.uti_s.set_home_title(this.tsr.instant(this.app_info.descrizione_breve)+" - "+this.tsr.instant("Nuova Richiesta")),this.reset_form_v(this.tsr.instant(this.app_info.descrizione_breve)+" - "+this.tsr.instant("Nuova Richiesta")),this.reset_counters_int(0,0);var e=new vt;e.sql="SELECT_WLIVELLIV2_2",e.types=["string"],e.values=[this.id_applicativo],this.m_dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.ok_livw2(e.result_data)})),this.save_to_app_state()},t.prototype.ok_livw2=function(t){this.livs=t;for(var e=0,i=0;i<this.livs.length;i++)(this.livs[i].step<e||0==e)&&(e=this.livs[i].step);for(i=0;i<this.livs.length;i++)if(e==this.livs[i].step&&(null==this.livs[i].username&&(this.livs[i].username="ZZZ"),this.user_idp.toUpperCase()==this.livs[i].username.toUpperCase()||"*ALLUSERS"==this.livs[i].context)){this.update_status(!0,null,null,null,15);break}},t.prototype.reassigned_to=function(t){},t.prototype.after_save=function(){},t.prototype.before_save=function(){},t.prototype.can_save=function(){return!0},t.prototype.edit_doc=function(){this.load_document()},t.prototype.return_edit=function(){for(var t=this,e=0;e<this.livs.length;e++)if(this.livs[e].step==this.m_obj.stato){1==this.livs[e].abilita_indietro?this.respingi_enabled=!0:this.respingi_enabled=!1;break}null==this.m_obj.autori&&(this.m_obj.autori=""),-1!=(","+this.m_obj.autori.toLowerCase()+",").indexOf(","+this.user_idp.toLowerCase()+",")&&(console.log("this.m_obj.autori ",this.m_obj.autori),null!=this.m_obj.autori&&1!=this.m_obj.autori.split(",").length&&(this.in_carico=!0),null!=this.m_obj.assegnati_paralleli&&1!=this.m_obj.assegnati_paralleli.split(",").length&&this.m_obj.assegnati_paralleli.indexOf(this.app_s.user)>-1&&(this.b_assengna_a=!0),this.update_status(!0,!1,this.in_carico,this.b_assengna_a,16),this.respingi_enabled&&this.update_status(null,!0,this.in_carico,this.b_assengna_a,17));var i=new vt;i.sql="SELECT_WKF_PROC_CONFIG",i.values=[this.id_applicativo,this.id_documento],i.types=["string","string"],this.m_dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(e.result_data.length>0&&(t.next_label=e.result_data[0].next_label,t.next_label_color=e.result_data[0].next_label_color,t.next_back_ground_color=e.result_data[0].next_back_ground_color),t.b_init_next=!0)})),this.r_count(),this.s_uto="";var n=this.m_obj.autori.split(",");for(e=0;e<n.length;e++)for(var o=0;o<this.livs.length;o++)if(this.livs[o].username==n[e]){""!=this.s_uto&&(this.s_uto=this.s_uto+","),null!=this.livs[o].nc?this.s_uto=this.s_uto+this.livs[o].nc:this.s_uto=this.s_uto+this.livs[o].username;break}this.app_s.getState().wkf_doc_info.in_carico_a=this.s_uto,null==this.m_obj.v?this.uti_s.set_home_title(this.tsr.instant(this.app_info.descrizione_breve)+" "+this.m_obj.codice+" - "+this.tsr.instant(this.m_obj.stat_stato)):this.uti_s.set_home_title(this.tsr.instant(this.app_info.descrizione_breve)+" "+this.m_obj.codice+"/"+this.m_obj.v+" - "+this.tsr.instant(this.m_obj.stat_stato)),this.reset_form_v(this.tsr.instant(this.app_info.descrizione_breve)+" "+this.m_obj.codice+" - "+this.tsr.instant(this.m_obj.stat_stato)),this.old_doc=JSON.parse(JSON.stringify(this.getfieldvalues()))},t.prototype.reset_form_v=function(t){var e=this;console.log("reset_form_v ",this.loaded),this.loaded?(this.reset_form(t),this.old_doc=JSON.parse(JSON.stringify(this.getfieldvalues()))):setTimeout((function(){e.reset_form_v(t)}),500)},t.prototype.revisione=function(){var t=this;this.m_dialog.open(It,{disableClose:!0,data:{title_dialog:this.tsr.instant("Conferma Operazione"),msg_dialog:this.tsr.instant("Confermi di voler revisionare il documento?")}}).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="UPDATE_DOCUMENTO_REV",i.values=[t.id_applicativo,t.id_documento],i.types=["string","string"],t.m_dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.alert(t.tsr.instant("Revisione generata"),0),window.location.reload())}))}}))},t.prototype.onResize=function(t){},t.prototype.init_engine=function(){var t=this;null!=this.app_s.user&&(this.user_idp=this.app_s.user),console.log("this.user_idp == null || this.m_route.params==null ",this.user_idp,this.m_route.params,new Date),null!=this.user_idp&&null!=this.m_route.params?(console.log("init_engine",new Date),this.init_user_i(),this.m_route.params.subscribe((function(e){var i=e.op;t.id_applicativo=e.idapp,t.id_documento=e.id_doc,console.log("qui!"),t.b_edit="new"!=i,t.init_app_wkf(),t.b_edit||t.id_applicativo.indexOf("_")>-1&&(t.simple_mode=!0,t.id_applicativo=t.id_applicativo.split("_").join("")),t.b_valid=!!t.id_applicativo,t.b_valid||t.alert("PARAMETRO APPLICAZIONE NON VALIDO",2)}))):setTimeout((function(){t.init_engine()}),500)},t.prototype.init_app_wkf=function(){console.log("init_app_wkf ",this.b_edit),this.b_edit?this.edit_doc():this.insert_doc()},t.prototype.ngAfterViewInit=function(){this.loaded=!0},t.prototype.setta_info_app=function(t){this.app_info=t},t.prototype.getLvlDescri=function(t,e){for(var i=0;i<this.livs.length;i++)if(t==this.livs[i].step)return""!=this.livs[i].step?this.livs[i].descri_livello:e;return e},t.prototype.getUsersList=function(t,e){var i="";return""!=t&&(i=t),""!=e&&(""!=i&&(i+=","),i+=e),""==i?"":this.getNames(i)},t.prototype.getNames=function(t){for(var e="",i=t.split(","),n=0;n<i.length;n++)for(var o=0;o<this.livs.length;o++)if(i[n].toUpperCase()==this.livs[o].username.toUpperCase()){""!=e&&(e+=","),e+=this.livs[o].nc;break}return e},t}();ln.decorators=[{type:n.Directive}],ln.ctorParameters=function(){return[{type:wt},{type:Dt},{type:d.Router},{type:e.MatDialog},{type:d.ActivatedRoute},{type:ei},{type:Ct},{type:Tt},{type:p.TranslateService}]},ln.propDecorators={onResize:[{type:n.HostListener,args:["window:resize",["event"]]}]},t.AppMakerService=Wt,t.AppService=wt,t.ApprovaGridComponent=Ae,t.AuthenticationService=ee,t.CheckboxEditorComponent=Yt,t.ComboBoxEditor=Re,t.CurrencyComponent=te,t.FHAutoCompleteComponent=me,t.FHCheckBox=Ri,t.FHComboboxComponent=_e,t.FHConfirmValues=St,t.FHCurrencyFormatterDirective=Te,t.FHCurrencyPipe=ke,t.FHDatePickerComponent=Ie,t.FHFieldPickListComponent=Ii,t.FHFormToolBarComponent=Kt,t.FHGridComponent=ce,t.FHGridComponentN=$i,t.FHGridJSONComponent=ui,t.FHGuard=en,t.FHHelpButton=Di,t.FHListComponent=Ne,t.FHLogPanelComponent=Ue,t.FHMdReader=je,t.FHNumericFieldComponent=Be,t.FHPickFieldComponent=zt,t.FHRichText=qe,t.FHRoleManager=Ai,t.FHTableManager=Oi,t.FHTextArea=Ht,t.FHTextInput=Ee,t.FHTimePickerComponent=Zt,t.FHUploadComponent=oe,t.FHUploadPanelComponent=ne,t.FHUploadPanelS3Component=Rt,t.FHUploadS3Component=Ft,t.FHUserFieldComponent=Qe,t.FSInput=gt,t.FSResult=on,t.FileService=Tt,t.FluxhubLibModule=tn,t.FormBuilderComponent=_i,t.FormExecuterComponent=hi,t.GridService=se,t.LocalDBService=pi,t.NumericEditorComponent=Jt,t.OdbcService=Qt,t.OfficeAutomatorService=ue,t.QGParam=le,t.QGResult=kt,t.QParam=vt,t.QResult=nn,t.QueryService=Dt,t.ReplaceLineBreaks=Me,t.TextAreaEditor=Le,t.UtilityService=Ct,t.WkfService=ei,t.dati_aggiuntivi=an,t.dati_aggiuntivi_v2=ln,t.fh_win_app_logs=Gt,t.fh_win_ask_big_text=bt,t.fh_win_ask_buttons=mi,t.fh_win_ask_number=Pe,t.fh_win_ask_richtext=Ji,t.fh_win_ask_text=re,t.fh_win_auto_complete=Fe,t.fh_win_combo=yt,t.fh_win_confirm=It,t.fh_win_list=He,t.fh_win_mappa=De,t.fh_win_output=Ge,t.fh_win_picklist=Mt,t.fh_win_select_by_grid=Zi,t.fh_win_show_email=ie,t.fh_win_show_email_s3=Lt,t.fh_win_show_image=fi,t.fh_win_show_log=Vt,t.fh_win_show_log_dett=jt,t.fh_win_time_slider=$t,t.fh_win_uploads=qt,t.fh_win_user_info=Ti,t.fh_win_user_picker=xe,t.fh_win_wait=Nt,t.fhimagepreview=gi,t.win_insert_commento=ki,t.win_salva_annulla=We,t.wkf_header_bar=di,t.wkf_header_bar_v2=Wi,t.wkfapp=sn,t.wkfapp_v2=rn,t.ɵa=Pt,t.ɵb=Bt,t.ɵba=ni,t.ɵbb=oi,t.ɵbc=si,t.ɵbd=ai,t.ɵbe=ri,t.ɵbf=li,t.ɵbg=ti,t.ɵbh=xi,t.ɵbi=Ei,t.ɵbj=Ci,t.ɵbk=Ki,t.ɵbl=Ni,t.ɵbm=Pi,t.ɵbn=Bi,t.ɵbo=Hi,t.ɵbp=Qi,t.ɵbq=Mi,t.ɵbr=zi,t.ɵbs=Ui,t.ɵbt=Vi,t.ɵbu=qi,t.ɵbv=Gi,t.ɵbw=Yi,t.ɵbx=Fi,t.ɵby=ji,t.ɵbz=Xi,t.ɵc=Si,t.ɵd=he,t.ɵe=de,t.ɵf=we,t.ɵg=Ke,t.ɵh=Ve,t.ɵi=Xt,t.ɵj=Ye,t.ɵk=Oe,t.ɵl=Li,t.ɵm=ge,t.ɵn=be,t.ɵo=ze,t.ɵp=Ut,t.ɵq=wi,t.ɵr=bi,t.ɵt=ci,t.ɵu=ae,t.ɵv=Je,t.ɵw=$e,t.ɵx=Xe,t.ɵy=Ze,t.ɵz=ii,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
16
|
+
var xt=function(t,e){return(xt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)};Object.create;function Ot(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,o,s=i.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}return a}function Et(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Ot(arguments[e]));return t}Object.create;var At=function(){function t(){this.checkType={NUMBER:function(t){return"number"==typeof t},BOOLEAN:function(t){return"boolean"==typeof t},STRING:function(t){return"string"==typeof t},DATE:function(t){return t instanceof Date},UNDEFINED:function(t){return void 0===t},NULL:function(t){return null===t},ARRAY:function(t){return t instanceof Array},MAP:function(t){return t instanceof Map},SET:function(t){return t instanceof Set},ITERABLE_OBJECT:function(t){return"[object Object]"===Object.prototype.toString.call(t)}},this.types={NUMBER:"NUMBER",BOOLEAN:"BOOLEAN",STRING:"STRING",NULL:"NULL",UNDEFINED:"UNDEFINED",DATE:"DATE",ARRAY:"ARRAY",MAP:"MAP",SET:"SET",ITERABLE_OBJECT:"ITERABLE_OBJECT",DEFAULT:"OBJECT"},this.iterableTypes="ITERABLE_OBJECT__MAP__ARRAY__SET",this.noop=function(){},this.checkEqualityForComplexTypes={DATE:function(t,e){return t.getTime()===e.getTime()}}}return t.prototype.getType=function(t){for(var e=Object.keys(this.checkType),i=this.types.DEFAULT,n=0;n<e.length;n+=1)if(this.checkType[e[n]](t)){i=e[n];break}return i},t.prototype.isTraversalNeeded=function(t,e){return t===e&&this.iterableTypes.indexOf(t)>=0},t.prototype.areEqual=function(t,e,i,n){return i===n&&(this.checkEqualityForComplexTypes[i]?this.checkEqualityForComplexTypes[i](t,e):t===e)},t.prototype.computeOp=function(t,e,i,n){var o=null;return i===this.types.UNDEFINED&&n!==this.types.UNDEFINED?o="add":i!==this.types.UNDEFINED&&n===this.types.UNDEFINED?o="delete":this.areEqual(t,e,i,n)?this.noop():o="update",o},t.prototype.getKeys=function(t,e,i){var n;return i===this.types.ITERABLE_OBJECT?n=new Set(Object.keys(t).concat(Object.keys(e))):i===this.types.ARRAY&&(n=(n=(n=t.length>e.length?new Array(t.length):new Array(e.length)).fill(0,0)).map((function(t,e){return e})),n=new Set(n)),n},t.prototype.makeDiff=function(t,e,i,n,o){var s={op:i,path:n,val:"",oldVal:""};return"add"!==i&&"update"!==i||(s.val=e),o&&"add"!==i&&(s.oldVal=t),s},t.prototype.get_diff=function(t,e,i,n,o){void 0===i&&(i=!1),void 0===n&&(n=[]),void 0===o&&(o=[]);var s=this.getType(t),a=this.getType(e),r=n||[],l=o||[];if(this.isTraversalNeeded(s,a))for(var p=this.getKeys(t,e,s).values(),u=p.next().value;null!=u;)this.get_diff(t[u],e[u],i,r.concat(u),l),u=p.next().value;else{var c=this.computeOp(t,e,s,a);null!=c&&l.push(this.makeDiff(t,e,c,n,i))}return l},t}(),Ct=function(){function t(t,e){this.app_s=t,this.titleService=e}return t.prototype.set_home_title=function(t){var e=this;setTimeout((function(){e.app_s.getState().topnavTitle=t,e.titleService.setTitle(t)}),100)},t.prototype.get_home_title=function(){return this.app_s.getState().topnavTitle},t.prototype.check_value_combo=function(t,e){return null!=e&&"-1"!=e?e:null!=t?t:e},t.prototype.gridDateRenderer=function(e){if(null==e.value)return" ------ ";if("null"==e.value)return" ------ ";var i=t.prototype.string2date(e.value,2);return null==i||1970==i.getFullYear()?" ------ ":t.prototype.pad(i.getDate(),2)+"/"+t.prototype.pad(i.getMonth()+1,2)+"/"+i.getFullYear()},t.prototype.gridDateStyle=function(t){return{"text-align":"center"}},t.prototype.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))},t.prototype.array_move=function(t,e,i){if(i>=t.length)for(var n=i-t.length+1;n--;)t.push(void 0);return t.splice(i,0,t.splice(e,1)[0]),t},t.prototype.format_currency=function(t,e,i,n,o){void 0===e&&(e=2),void 0===i&&(i=","),void 0===n&&(n="."),void 0===o&&(o="000000"),(t||"").toString().indexOf(",")>0&&(t=(t||"").toString().split(".").join("").split(",").join(".")),""==t&&(t="0");var s=Ot((t||"").toString().split("."),2),a=s[0],r=s[1],l=void 0===r?"":r;return l=e>0?i+(l+o).substring(0,e):"",(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,n))+l},t.prototype.number2bool=function(t){return null!=t&&1==t},t.prototype.bool2number=function(t){return null==t?0:t?1:0},t.prototype.round=function(t,e){return Math.round(t*Math.pow(10,e))/Math.pow(10,e)},t.prototype.string2date=function(t,e){if(null==t)return null;if(""==t)return null;if(1==e)return 10!=t.length||(n=t.split("-"))[0].length<4?null:new Date(parseInt(n[0]),parseInt(n[1])-1,parseInt(n[2]));if(2==e)return new Date(t);if((3==e||5==e)&&t.length>=16){var i=(t=t.substring(0,16)).split(" "),n=i[0].split("/");5==e&&(n=i[0].split("-"));var o=i[1].split(":");return n[0].length<4?null:new Date(parseInt(n[0]),parseInt(n[1])-1,parseInt(n[2]),parseInt(o[0]),parseInt(o[1]),0)}if(4==e){if(!t)return null;var s=t.split("/").map((function(t){return parseInt(t)}));return new Date(s[2],s[1]-1,s[0])}return 5==e&&t&&8==t.length?new Date(parseInt(t.substring(0,4)),parseInt(t.substring(4,2))-1,parseInt(t.substring(6,2))):null},t.prototype.sql_number=function(t){return null==t?"0":"it"==this.app_s.SQL_SERVER_LANG||"uk"==this.app_s.SQL_SERVER_LANG?String(t).replace(".",","):void 0},t.prototype.compare_date=function(t,e){return null!=t&&(null!=e&&(t.getDate()==t.getDate()&&t.getMonth()==e.getMonth()&&t.getFullYear()==e.getFullYear()))},t.prototype.sql_date=function(t){if(null==t)return"dbnull";if(void 0===t)return"dbnull";if("string"==typeof t&&(t=new Date(this.string2date(t,2))),1970==t.getFullYear())return"dbnull";var e=t.getMonth()+1,i=t.getDate();return"it"==this.app_s.SQL_SERVER_LANG?[(i>9?"":"0")+i,"-",(e>9?"":"0")+e,"-",t.getFullYear()].join(""):"uk"==this.app_s.SQL_SERVER_LANG?[t.getFullYear(),"-",(e>9?"":"0")+e,"-",(i>9?"":"0")+i].join(""):"Parametro SQL_SERVER_LANG non corretto"},t.prototype.sql_date_grid=function(t,e){if(void 0===e&&(e=""),null==t)return"dbnull";if(void 0===t)return"dbnull";if("string"==typeof t)return"dbnull";if(1970==t.getFullYear())return"dbnull";var i=t.getMonth()+1,n=t.getDate();return"CONVERT(DATETIME,'"+[t.getFullYear(),"-",(i>9?"":"0")+i,"-",(n>9?"":"0")+n].join("")+e+"',127)"},t.prototype.properCase=function(t){for(var e=t.toLowerCase().split(" "),i=0;i<e.length;i++)e[i]=e[i][0].toUpperCase()+e[i].slice(1);return e.join(" ")},t.prototype.DateAdd=function(t,e,i){var n,o=36e5,s=24*o,a=i.valueOf();switch(t){case"ms":n=new Date(a+1*e);break;case"s":n=new Date(a+1e3*e);break;case"mi":n=new Date(a+6e4*e);break;case"h":n=new Date(a+o*e);break;case"d":n=new Date(a+s*e);break;case"y":n=new Date(a+31536e6*e)}return n},t.prototype.date2String=function(t){if(null==t)return"";var e=t.getMonth()+1,i=t.getDate();return[(i>9?"":"0")+i,"/",(e>9?"":"0")+e,"/",t.getFullYear()].join("")},t.prototype.datetime2String=function(t){if(null==t)return"";var e=t.getMonth()+1,i=t.getDate(),n=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return[(i>9?"":"0")+i,"/",(e>9?"":"0")+e,"/",t.getFullYear()," ",(n>9?"":"0")+n,":",(o>9?"":"0")+o,":",(s>9?"":"0")+s].join("")},t.prototype.formatDecimal=function(t,e){void 0===e&&(e=2);var i=Ot((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=e>0?","+(s+"000000").substring(0,e):"",(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,"."))+s},t.prototype.left_pad=function(t,e,i){void 0===e&&(e=2),void 0===i&&(i="0");for(var n=t+"";n.length<e;)n=i+n;return n},t.prototype.datetime2GanttString=function(t){var e=t.getMonth()+1,i=t.getDate(),n=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return[t.getFullYear(),"-",(e>9?"":"0")+e,"-",(i>9?"":"0")+i,"T",(n>9?"":"0")+n,":",(o>9?"":"0")+o,":",(s>9?"":"0")+s].join("")},t.prototype.check2int=function(t){return t?1:0},t.prototype.setSelectionRange=function(t,e,i){if(t.setSelectionRange)t.focus(),t.setSelectionRange(e,i);else if(t.createTextRange){var n=t.createTextRange();n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",e),n.select()}},t.prototype.getBrowserName=function(){var t=window.navigator.userAgent.toLowerCase();switch(!0){case t.indexOf("edge")>-1:return"edge";case t.indexOf("opr")>-1&&!!window.opr:return"opera";case t.indexOf("chrome")>-1&&!!window.chrome:return"chrome";case t.indexOf("trident")>-1:return"ie";case t.indexOf("firefox")>-1:return"firefox";case t.indexOf("safari")>-1:return"safari";default:return"other"}},t.prototype.print_param=function(t){console.log("Tipologie -> "+String(t.types.length)),console.log("Valori -> "+String(t.values.length));for(var e=0;e<t.types.length;e++)console.log(t.types[e]+" "+String(t.values[e]))},t.prototype.get_diff_doc=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null);var i=[];if(null==t&&null==e)return i;for(var n=(new At).get_diff(t,e,!0),o=0;o<n.length;o++)n[o].path+""!="uiid"&&n[o].path+""!="id"&&i.push(n[o]);return i},t.prototype.getutcdate=function(t){var e=t.getTimezoneOffset();return t.setMinutes(t.getMinutes()+e),t},t.prototype.insert_log=function(t,e,i,n,o,s,a,r){void 0===s&&(s=null),void 0===a&&(a=null),void 0===r&&(r=null);var l=null;if(null!=a&&null!=r){for(var p in r)r.hasOwnProperty(p)&&r[p]instanceof Date&&(a[p]=new Date(a[p]));l=this.get_diff_doc(a,r)}var u=new vt;console.log("diff ",l),null!=l||null!=s?(u.sql="INSERT_LOG_N2",u.types=["string","string","string","string","string","string"],u.values=null!=l?[e,i,n,o,s,JSON.stringify(l)]:[e,i,n,o,s,null]):(u.sql="INSERT_LOG_N",u.types=["string","string","string","string"],u.values=[e,i,n,o]),t.doQuery(u).subscribe()},t.prototype.sql_date_time=function(t){if(null==t)return"dbnull";if(void 0===t)return"dbnull";if("string"==typeof t&&(t=new Date(this.string2date(t,2))),1970==t.getFullYear())return"dbnull";var e=t.getMonth()+1,i=t.getDate();return"it"==this.app_s.SQL_SERVER_LANG?[(i>9?"":"0")+i,"-",(e>9?"":"0")+e,"-",t.getFullYear()].join("")+" "+this.left_pad(t.getHours())+":"+this.left_pad(t.getMinutes())+":"+this.left_pad(t.getSeconds()):"uk"==this.app_s.SQL_SERVER_LANG?[t.getFullYear(),"-",(e>9?"":"0")+e,"-",(i>9?"":"0")+i].join("")+" "+this.left_pad(t.getHours())+":"+this.left_pad(t.getMinutes())+":"+this.left_pad(t.getSeconds()):"Parametro SQL_SERVER_LANG non corretto"},t.prototype.onlyDt=function(t){return null==t?null:new Date(t.getFullYear(),t.getMonth(),t.getDate())},t.prototype.descriMese=function(t){switch(t.getMonth()){case 0:return"Gennaio";case 1:return"Febbraio";case 2:return"Marzo";case 3:return"Aprile";case 4:return"Maggio";case 5:return"Giugno";case 6:return"Luglio";case 7:return"Agosto";case 8:return"Settembre";case 9:return"Ottobre";case 10:return"Novembre";case 11:return"Dicembre"}},t.prototype.addDays=function(t,e){return t.setDate(t.getDate()+e),t},t.prototype.toMoney=function(t,e,i,n){var o,s,a,r,l;return o=isNaN(e)?2:Math.abs(e),s=i||".",a=void 0===n?",":n,(t<0?"-":"")+((l=(l=(r=parseInt(t=Math.abs(t).toFixed(o))+"").length)>3?l%3:0)?r.substr(0,l)+a:"")+r.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+a)+(o?s+Math.abs(t-r).toFixed(o).slice(2):"")},t.prototype.format_euro=function(t){return this.toMoney(t,2,",",".")},t.prototype.pad=function(t,e){for(var i=t+"";i.length<e;)i="0"+i;return i},t.prototype.encrypt=function(t){for(var e="",i=0;i<t.length;i++){var n=1^t.charCodeAt(i);e+=String.fromCharCode(n)}return e},t.prototype.encrypt_v3=function(t){return s.AES.encrypt(t,"}?fhg7SP&^N4").toString()},t.prototype.decrypt_v3=function(t){return s.AES.decrypt(t,"}?fhg7SP&^N4").toString(s.enc.Utf8)},t.prototype.decrypt=function(t){for(var e="",i=0;i<t.length;i++){var n=1^t.charCodeAt(i);e+=String.fromCharCode(n)}return e},t.prototype.encrypt_v2=function(t){return(new o.SimpleCrypt).encode("prologika_fluxhub_etjda",t)},t.prototype.decrypt_v2=function(t){return(new o.SimpleCrypt).decode("prologika_fluxhub_etjda",t)},t.prototype.string_sqlvalue=function(t){return null==t?"":t.split("'").join("''")},t.prototype.hasRole=function(t,e){return void 0===e&&(e=!0),null!==this.app_s.user_roles&&(!(!e||null==this.app_s.user_isadmin||"1"!=this.app_s.user_isadmin)||this.app_s.user_roles.toUpperCase().indexOf(t.toLocaleUpperCase())>-1)},t}();Ct.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new Ct(n.ɵɵinject(wt),n.ɵɵinject(a.Title))},token:Ct,providedIn:"root"}),Ct.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],Ct.ctorParameters=function(){return[{type:wt},{type:a.Title}]};var kt=function(){},Tt=function(){function t(t,e,i){this.http=t,this.app_s=e,this.toastr=i,this.url=this.app_s.API_ENDPOINT+this.app_s.FILE_ENDPOINT}return t.prototype.doQuery=function(t,e){var i=this;void 0===e&&(e=!0),this.headers=new r.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=this.app_s.API_ENDPOINT+this.app_s.FILE_ENDPOINT;var n=JSON.stringify(t);return this.http.post(this.url,n,{headers:this.headers}).pipe(l.map((function(t){var n,o=t;if(t?"KO"===o.result_msg&&(n=new Error(o.msg)):n=new Error("Empty server response"),n)throw console.error(n),e&&i.toastr.error(n.message),new Error(n);return t||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t}();Tt.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new Tt(n.ɵɵinject(r.HttpClient),n.ɵɵinject(wt),n.ɵɵinject(i.ToastrService))},token:Tt,providedIn:"root"}),Tt.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],Tt.ctorParameters=function(){return[{type:r.HttpClient},{type:wt},{type:i.ToastrService}]};var Dt=function(){function t(t,e,i,n){this.http=t,this.toastr=e,this.app_s=i,this.uti_s=n,this.url=this.app_s.API_ENDPOINT+this.app_s.QUERY_ENDPOINT}return t.prototype.doQuery=function(t,e,i){var n=this;if(void 0===e&&(e=!0),void 0===i&&(i=null),null!=localStorage.getItem(this.app_s.COMPANY_KEY+"token")){if(this.headers=new r.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=null==i?this.app_s.API_ENDPOINT+this.app_s.QUERY_ENDPOINT:i,null!=t.types&&-1==t.sql.indexOf("_MULTI"))for(var o=0;o<t.types.length;o++)null==t.values[o]?t.values[o]="dbnull":("boolean"==t.types[o]&&(t.values[o]?t.values[o]="1":t.values[o]="0"),"int"==t.types[o]&&(t.values[o]+""==""?t.values[o]="dbnull":isNaN(t.values[o])?t.values[o]="0":t.values[o]=""+t.values[o]),"string"==t.types[o]&&(t.values[o]=""+t.values[o]),"date"==t.types[o]&&(t.values[o]=this.uti_s.sql_date(t.values[o]),"NaN-NaN-NaN"==t.values[o].split("0").join("")&&(t.values[o]="dbnull")),"datetime"==t.types[o]&&(t.values[o]=this.uti_s.sql_date_time(t.values[o]),"NaN-NaN-NaN NaN:NaN"==t.values[o].split("0").join("")&&(t.values[o]="dbnull")),"string"==t.types[o]&&null==t.values[o]&&(t.values[o]="dbnull"),"decimal"==t.types[o]&&(t.values[o]+""==""?t.values[o]="dbnull":isNaN(t.values[o])?t.values[o]="0":t.values[o]=""+t.values[o]));var s=JSON.stringify(t);return this.http.post(this.url,s,{headers:this.headers}).pipe(l.map((function(i){var o;if(i?"KO"===i.result_msg&&(o=new Error(i.msg)):o=new Error("Empty server response"),o)throw console.error(o),e&&n.toastr.error(t.sql+" "+o.message),new Error(o);return i||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))}console.log("token non online")},t}();Dt.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new Dt(n.ɵɵinject(r.HttpClient),n.ɵɵinject(i.ToastrService),n.ɵɵinject(wt),n.ɵɵinject(Ct))},token:Dt,providedIn:"root"}),Dt.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],Dt.ctorParameters=function(){return[{type:r.HttpClient},{type:i.ToastrService},{type:wt},{type:Ct}]};var Lt=function(){function t(t,e,i,n){var o=this;this.dialogRef=t,this._fileservice=e,this.m_appService=i,this.data=n,this.allegati=[],this.App="",this.K="",this.email_obj={},this.title="ANTEPRIMA EMAIL",this.web_url="",this.local_dir="",this.ant_preview="";var s=new gt;s.command="exec_app",s.p1="Email_Reader_S3",s.p2=n.local_dir+"|"+n.uiid,this._fileservice.doQuery(s).subscribe((function(t){o.email_obj=JSON.parse(t.msg),o.allegati=o.email_obj.allegati.split("||")}))}return t.prototype.init_w=function(){},t.prototype.open_all=function(t){window.open(this.email_obj.ant_preview+t)},t}();Lt.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="dialogRef.close(null)" /> </div><br>\n <div style="width:100%;overflow:auto;" [style.height]="(m_appService.getState().body_h-240)+\'px\'">\n <mat-toolbar color="primary">{{title | translate}}\n <span class="fill-remaining-space"></span>\n\n </mat-toolbar>\n <br>\n\n <div style="width:100%;height:500px">\n <div style="width:100%;height:100%">\n <div fxLayout="column">\n\n <div fxLayout="row">\n <div style="width:100px">Data:</div>\n <div>{{email_obj.dt}}</div>\n </div>\n <div fxLayout="row">\n <div style="width:100px">From:</div>\n <div [innerHTML]="email_obj.from" ></div>\n </div>\n <div fxLayout="row">\n <div style="width:100px">To:</div>\n <div [innerHTML]="email_obj.to" ></div>\n </div>\n <div fxLayout="row">\n <div style="width:100px">CC:</div>\n <div [innerHTML]="email_obj.cc" ></div>\n </div>\n <div fxLayout="row">\n <div style="width:100px">Subject:</div>\n <div [innerHTML]="email_obj.subject" ></div>\n </div>\n <div style="width:100px">Body:</div>\n <div style="overflow:auto;" [style.height]="(m_appService.getState().body_h-490)+\'px\'">\n <div fxLayout="row" [hidden]="email_obj.is_html==\'NO\'">\n\n <div [innerHTML]="email_obj.body" ></div>\n </div>\n <div fxLayout="row" [hidden]="email_obj.is_html==\'SI\'">\n\n <div>{{email_obj.body}}</div>\n </div>\n </div>\n <hr style="width:100%">\n <div fxLayout="row" fxLayoutGap="10px">\n <div style="width:100px">Allegati:</div>\n <div *ngFor="let u of allegati" >\n <button mat-flat-button color="primary" (click)="open_all(u)">{{u}}</button>\n </div>\n\n\n\n </div>\n\n\n </div>\n </div>\n </div>\n '}]}],Lt.ctorParameters=function(){return[{type:e.MatDialogRef},{type:Tt},{type:wt},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var Rt=function(){function t(t,e,i,o,s,a,r){this._appservice=t,this._dataService=e,this.toastr=i,this.dialog=o,this.fileService=s,this.uti=a,this.tsr=r,this.enabled=!0,this.force_en=!1,this.dt_scadenza=!1,this.label="",this.sovrascrivi_path="",this.ruolo_supervisore="[ZZZ_DIS_CC]",this.access_control=!1,this.show_images=!0,this.can_delete_owner=!0,this.b_initt=!1,this.change=new n.EventEmitter,this.call_upload=new n.EventEmitter,this.init_end=new n.EventEmitter,this.fill_end=new n.EventEmitter,this.image_mode=!1,this.App="",this.K="",this.image_type=!1,this.b_edit_loaded=!1,this.b_False=!1,this.b_mobile=!1,this.b_ini=!1,this.m_p_tipo="",this.multi_list=!1,this.m_programma_da_eseguire="",this.m_p_cod_doc="",this.m_p_section="",this.m_p_system_type=""}return t.prototype.call_up=function(t){this.call_upload.emit({App:this.App,K:this.K,descrizione:t.descrizione,single:!1,username:this._appservice.user,cod_doc:this.m_p_cod_doc,section:this.m_p_section,local_path:this._appservice.LOCAL_PATH,p1:this.m_programma_da_eseguire})},t.prototype.download_all=function(t){var e=this,i=new gt;i.command="exec_app",i.p1="s3_downloader",i.p2=t.uiid+"|"+this._appservice.user,this.fileService.doQuery(i).subscribe((function(t){if(null!=t&&"OK"==t.result_msg){var i=t.msg.split("|");"OK"==i[0]?window.open(i[1]):e.toastr.error(i[1].split("|").join(" -> "))}}))},t.prototype.preview_email=function(t){this.dialog.open(Lt,{data:{uiid:t.uiid,local_dir:this._appservice.user},width:"95%"}).afterClosed().subscribe((function(t){}))},t.prototype.edit_tipo=function(t){var e=this,i=new vt;i.sql=this.m_p_tipo,i.types=[],i.values=[],this._dataService.doQuery(i).subscribe((function(i){if(null!=i&&"OK"==i.result_msg){var n=e.dialog.open(yt);setTimeout((function(){n.componentInstance.set_selection(e.tsr.instant("Tipologia Allegato"),i.result_data)})),n.afterClosed().subscribe((function(i){if(null!=i){var n=new vt;n.sql="UPDATE_ALLEGATI_TIPO",n.types=["int","string"],n.values=[t.id,i.descrizione_valore],e._dataService.doQuery(n).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.ref_allegato()}))}}))}}))},t.prototype.edit_descri=function(t){var e=this,i=this.dialog.open(bt);setTimeout((function(){i.componentInstance.label=e.tsr.instant("Descrizione Allegato"),i.componentInstance.valore=t.description,i.componentInstance.min_chars=0})),i.afterClosed().subscribe((function(i){if(null!=i){var n=new vt;n.sql="UPDATE_ALLEGATI_DESCRIZIONE_NEW",n.types=["string","string"],n.values=[t.uiid,i],e._dataService.doQuery(n).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.ref_allegato()}))}}))},t.prototype.delete=function(t){var e=this;localStorage.setItem(this._appservice.COMPANY_KEY+"title_dialog",this.tsr.instant("Conferma Operazione")),localStorage.setItem(this._appservice.COMPANY_KEY+"msg_dialog",this.tsr.instant("Confermi l'eliminazione dell'elemento?")),this.dialog.open(It).afterClosed().subscribe((function(i){if(i){var n=new vt;n.sql="DELETE_ALLEGATO_NEW",n.types=["string"],n.values=[t.uiid],e._dataService.doQuery(n).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(e.ref_allegato(),e.toastr.info("INFO",e.tsr.instant("ALLEGATO ELIMINATO"),{timeOut:1e3,progressBar:!0}))}))}}))},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.init_end.emit()}))},t.prototype.init_upload=function(){var t=this;null!=this.upc?(this.upc.single=!1,this.b_mobile=this._appservice.getState().pageFullscreen,this.force_en?this.upc.init(this.App,this.K,this.m_p_cod_doc,this.m_p_section,"Attachment Description",this.m_p_system_type,this.m_programma_da_eseguire):this.upc.init(this.App,this.K,this.m_p_cod_doc,this.m_p_section,this.tsr.instant("Descrizione Allegato"),this.m_p_system_type,this.m_programma_da_eseguire),this.b_initt=!0,this.ref_allegato()):setTimeout((function(){t.init_upload()}),500)},t.prototype.init=function(t,e,i,n,o,s){void 0===s&&(s=""),this.App=t,this.K=e,this.b_ini=!0,this.b_edit_loaded=!1,this.m_p_cod_doc=i,this.m_p_section=n,this.m_p_system_type=o,this.m_programma_da_eseguire=s,this.init_upload()},t.prototype.ref_allegato=function(){var t=this;if(null!=this.App&&""!=this.App){this.image_mode=!1;var e=new vt;e.sql="SELECT_ALLEGATO_INFO_NEW",e.types=["string","string","string"],e.values=[this.App,this.K,this.m_p_section],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.arr_g=e.result_data,t.arr_g.map((function(e){"IMG"==e.type&&(t.image_mode=!0)}));for(var i="webinfo",n=0;n<t.arr_g.length;n++){null!=t.arr_g[n].APP&&(t.arr_g[n].App=t.arr_g[n].APP),null!=t.arr_g[n].description?t.arr_g[n].descrizione_vis=t.arr_g[n].description.split("\n").join("<br>"):t.arr_g[n].descrizione_vis="";var o=t.arr_g[n].file_name_orig.split("."),s=t.arr_g[n].repo_params.split("|");if(t.arr_g[n].url=s[3]+"/"+s[2]+"/"+t.App+"/"+t.m_p_cod_doc+"/"+t.m_p_section+"/"+t.arr_g[n].dir+"/F_"+t.arr_g[n].uiid,t.arr_g[n].url_orig=s[3]+"/"+s[2]+"/"+t.App+"/"+t.m_p_cod_doc+"/"+t.m_p_section+"/"+t.arr_g[n].dir+"/F_"+t.arr_g[n].uiid,-1!="3G2|3GA|3GP|7Z|AA|AAC|AC|ACCDB|ACCDT|ADN|AI|AIF|AIFC|AIFF|AIT|AMR|ANI|APK|APP|APPLESCRIPT|ASAX|ASC|ASCX|ASF|ASH|ASHX|ASMX|ASP|ASPX|ASX|AU|AUP|AVI|AXD|AZE|BAK|BASH|BAT|BIN|BLANK|BMP|BOWERRC|BPG|BROWSER|BZ2|C|CAB|CAD|CAF|CAL|CD|CER|CFG|CFM|CFML|CGI|CLASS|CMD|CODEKIT|COFFEE|COFFEELINTIGNORE|COM|COMPILE|CONF|CONFIG|CPP|CPTX|CR2|CRDOWNLOAD|CRT|CRYPT|CS|CSH|CSON|CSPROJ|CSS|CSV|CUE|DAT|DB|DBF|DEB|DGN|DIST|DIZ|DLL|DMG|DNG|DOC|DOCB|DOCM|DOCX|DOT|DOTM|DOTX|DOWNLOAD|DPJ|DS_STORE|DTD|DWG|DXF|EDITORCONFIG|EL|ENC|EOT|EPS|EPUB|ESLINTIGNORE|EXE|F4V|FAX|FB2|FLA|FLAC|FLV|FOLDER|GADGET|GDP|GEM|GIF|GITATTRIBUTES|GITIGNORE|GO|GPG|GZ|H|HANDLEBARS|HBS|HEIC|HS|HSL|HTM|HTML|IBOOKS|ICNS|ICO|ICS|IDX|IFF|IFO|IMAGE|IMG|IN|INDD|INF|INI|ISO|J2|JAR|JAVA|JPE|JPEG|JPG|JS|JSON|JSP|JSX|KEY|KF8|KMK|KSH|KUP|LESS|LEX|LICX|LISP|LIT|LNK|LOCK|LOG|LUA|M|M2V|M3U|M3U8|M4|M4A|M4R|M4V|MAP|MASTER|MC|MD|MDB|MDF|ME|MI|MID|MIDI|MK|MKV|MM|MO|MOBI|MOD|MOV|MP2|MP3|MP4|MPA|MPD|MPE|MPEG|MPG|MPGA|MPP|MPT|MSI|MSU|NEF|NES|NFO|NIX|NPMIGNORE|ODB|ODS|ODT|OGG|OGV|OST|OTF|OTT|OVA|OVF|P12|P7B|PAGES|PART|PCD|PDB|PDF|PEM|PFX|PGP|PH|PHAR|PHP|PKG|PL|PLIST|PM|PNG|PO|POM|POT|POTX|PPS|PPSX|PPT|PPTM|PPTX|PROP|PS|PS1|PSD|PSP|PST|PUB|PY|PYC|QT|RA|RAM|RAR|RAW|RB|RDF|RESX|RETRY|RM|ROM|RPM|RSA|RSS|RTF|RU|RUB|SASS|SCSS|SDF|SED|SH|SITEMAP|SKIN|SLDM|SLDX|SLN|SOL|SQL|SQLITE|STEP|STL|SVG|SWD|SWF|SWIFT|SYS|TAR|TCSH|TEX|TFIGNORE|TGA|TGZ|TIF|TIFF|TMP|TORRENT|TS|TSV|TTF|TWIG|TXT|UDF|VB|VBPROJ|VBS|VCD|VCS|VDI|VDX|VMDK|VOB|VSCODEIGNORE|VSD|VSS|VST|VSX|VTX|WAR|WAV|WBK|WEBINFO|WEBM|WEBP|WMA|WMF|WMV|WOFF|WOFF2|WPS|WSF|XAML|XCF|XLM|XLS|XLSM|XLSX|XLT|XLTM|XLTX|XML|XPI|XPS|XRB|XSD|XSL|XSPF|XZ|YAML|YML|Z|ZIP|ZSH".indexOf(o[o.length-1].toLocaleUpperCase())&&(i=o[o.length-1].toLocaleLowerCase()),t.arr_g[n].icon=i+".svg",t.can_delete_owner?(t.arr_g[n].can_delete=!t.access_control||t.arr_g[n].idp==t._appservice.user||t.uti.hasRole(t.ruolo_supervisore),"[ZZZ_DIS_CC]"==t.ruolo_supervisore?t.arr_g[n].can_delete_m=t.arr_g[n].idp:t.arr_g[n].can_delete_m=t.arr_g[n].idp+",["+t.ruolo_supervisore+"]"):(t.arr_g[n].can_delete=!t.access_control||t.uti.hasRole(t.ruolo_supervisore),"[ZZZ_DIS_CC]"==t.ruolo_supervisore?t.arr_g[n].can_delete_m="":t.arr_g[n].can_delete_m="["+t.ruolo_supervisore+"]"),t.arr_g[n].can_edit=!t.access_control||t.arr_g[n].idp==t._appservice.user||t.uti.hasRole(t.ruolo_supervisore),-1==t.arr_g[n].file_name_orig.indexOf(".jpg")&&-1==t.arr_g[n].file_name_orig.indexOf(".gif")&&-1==t.arr_g[n].file_name_orig.indexOf(".png")||!t.show_images)t.arr_g[n].type="O";else{if(t.arr_g[n].type="IMG",t.arr_g[n].image_original=[t.arr_g[n].url],null!=t.arr_g[n].preview&&1==t.arr_g[n].preview){var a=t.arr_g[n].url.split("."),r=a.pop();t.arr_g[n].url=a.join(".")+"_preview."+r}t.image_type=!0,t.arr_g[n].image_thumbnail=[t.arr_g[n].url]}}t.fill_end.emit()}}))}},t}();Rt.decorators=[{type:n.Component,args:[{selector:"FHUploadPanelS3",template:'\n\n <div fxLayout="column">\n <h3 *ngIf="label != \'\'">{{ label }}</h3>\n <div fxLayout="column">\n <div [hidden]="!enabled">\n\n <FHUploadS3\n [single]="b_False"\n [label_attendere]="\n force_en ? \'UPLOADING\' : \'ATTENDERE UPLOAD IN CORSO\' | translate\n "\n [fixed_label]="\n force_en\n ? \' (insert the description here before uploading the file)\'\n : \' (INSERISCI QUI LA DESCRIZIONE PRIMA DI CARICARE IL FILE)\' | translate\n "\n [allegato_inserito]="\n force_en ? \'Attachment Inserted\' : \'ALLEGATO INSERITO\' | translate\n "\n [lista_allegati]="arr_g"\n (change)="ref_allegato()"\n (call_upload)="call_up($event)"\n #upc\n ></FHUploadS3>\n </div>\n <table width="98%" class="fh_table" *ngIf="!image_type && !b_mobile">\n <thead>\n <tr class="header">\n <th style="width:40px"></th>\n <th style="width:50%">{{ force_en ? "Name" : "Nome" }}</th>\n <th style="width:60px;text-align:center">Dim.</th>\n <th style="width:40%">\n {{ force_en ? "Description" : "Descrizione" }}\n </th>\n <th style="width:20%">\n {{ force_en ? "Version" : "Versione" }}\n </th>\n\n <th *ngIf="image_mode" class="actions"></th>\n <th style="width:30%">{{ force_en ? "User" : "Utente" }}</th>\n <th style="width:240px;text-align:center">\n {{ force_en ? "Date" : "Data" }}\n </th>\n <th style="width:40px" class="actions"></th>\n <th *ngIf="enabled" style="width:40px" class="actions"></th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="let app of arr_g; let odd = odd; let even = even"\n style="font-size: 15px;"\n [ngClass]="{ odd: odd, even: even }"\n >\n <td\n style="text-align:center;vertical-align: middle;width:36px;height:36px;"\n >\n <div\n style="text-align:center;vertical-align: middle;width:28px;height:28px;"\n >\n <img\n src="assets/icons/square-o/{{ app.icon }}"\n style="width:28px;height:28px;"\n />\n </div>\n </td>\n <td>{{ app.file_name_orig }}</td>\n <td style="text-align:center">{{ app.dim }}</td>\n <td>\n <div fxLayout="row">\n <div *ngIf="enabled">\n <a\n mat-icon-button\n matTooltip="Modifica Descrizione"\n *ngIf="app.can_edit"\n (click)="edit_descri(app)"\n >\n <mat-icon>edit</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]="\n \'Modifica Descrizione consentita solo a: \' + app.nc\n "\n *ngIf="!app.can_edit"\n [disabled]="true"\n >\n <mat-icon>edit</mat-icon>\n </a>\n </div>\n <div\n [innerHTML]="app.descrizione_vis"\n style="width:100%"\n ></div>\n </div>\n </td>\n\n <td>\n {{app.version}}\n </td>\n\n <td *ngIf="image_mode"\n style="min-width:400px;min-height: 400px"\n\n >\n <fh-image-viewer [u]="app"></fh-image-viewer>\n </td>\n\n <td>{{ app.nc }}</td>\n <td style="text-align:center">\n {{ app.dt_ins | date: "dd/MM/yyyy HH:mm:ss" }}\n </td>\n <td style="text-align:center">\n\n <button [hidden]="app.file_name_orig.indexOf(\'.eml\')==-1 && app.file_name_orig.indexOf(\'.msg\')==-1"\n mat-icon-button\n matTooltip="Preview"\n (click)="preview_email(app)"\n >\n <mat-icon>visibility</mat-icon>\n </button>\n <button\n mat-icon-button\n matTooltip="Download File"\n (click)="download_all(app)"\n >\n <mat-icon>cloud_download</mat-icon>\n </button>\n </td>\n\n <td *ngIf="enabled" style="text-align:center">\n <a\n mat-icon-button\n matTooltip="Elimina File"\n *ngIf="app.can_delete"\n (click)="delete(app)"\n >\n <mat-icon>delete</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]="\n \'Cancellazione consentita solo a: \' + app.can_delete_m\n "\n *ngIf="!app.can_delete"\n [disabled]="true"\n >\n <mat-icon>delete</mat-icon>\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n <table width="98%" class="fh_table" *ngIf="image_type && !b_mobile">\n <thead>\n <tr class="header">\n <th style="width:40px"></th>\n <th style="width:50%">{{ force_en ? "Name" : "Nome" }}</th>\n <th style="width:60px;text-align:center">Dim.</th>\n\n <th style="width:20%">\n {{ force_en ? "Description" : "Descrizione" }}\n </th>\n <th style="width:10%">\n {{ force_en ? "Version" : "Versione" }}\n </th>\n <th style="width:40%"></th>\n\n <th style="width:10%">{{ force_en ? "User" : "Utente" }}</th>\n <th style="width:240px;text-align:center">\n {{ force_en ? "Date" : "Data" }}\n </th>\n <th style="width:40px" class="actions"></th>\n <th *ngIf="enabled" style="width:40px" class="actions"></th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="let app of arr_g; let odd = odd; let even = even"\n style="font-size: 15px;"\n [ngClass]="{ odd: odd, even: even }"\n >\n <td\n style="text-align:center;vertical-align: middle;width:36px;height:36px;"\n >\n <div\n style="text-align:center;vertical-align: middle;width:28px;height:28px;"\n >\n <img\n src="assets/icons/square-o/{{ app.icon }}"\n style="width:28px;height:28px;"\n />\n </div>\n </td>\n\n <td>{{ app.file_name_orig }}</td>\n <td style="text-align:center">{{ app.dim }}</td>\n <td>\n <div fxLayout="row">\n <div *ngIf="enabled">\n <a\n mat-icon-button\n matTooltip="Modifica Descrizione"\n *ngIf="app.can_edit"\n (click)="edit_descri(app)"\n >\n <mat-icon>edit</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]="\n \'Modifica Descrizione consentita solo a: \' + app.nc\n "\n *ngIf="!app.can_edit"\n [disabled]="true"\n >\n <mat-icon>edit</mat-icon>\n </a>\n </div>\n <div\n [innerHTML]="app.descrizione_vis"\n style="width:100%"\n ></div>\n </div>\n </td>\n <td>\n {{app.version}}\n </td>\n\n <td\n style="min-width:400px;min-height: 400px"\n *ngIf="app.type == \'IMG\'"\n >\n <fh-image-viewer [u]="app"></fh-image-viewer>\n </td>\n <td *ngIf="app.type != \'IMG\'"></td>\n <td>{{ app.nc }}</td>\n <td style="text-align:center">\n {{ app.dt_ins | date: "dd/MM/yyyy HH:mm:ss" }}\n </td>\n <td style="text-align:center">\n\n <button [hidden]="app.file_name_orig.indexOf(\'.eml\')==-1 && app.file_name_orig.indexOf(\'.msg\')==-1"\n mat-icon-button\n matTooltip="Preview"\n (click)="preview_email(app)"\n >\n <mat-icon>visibility</mat-icon>\n </button>\n <button\n mat-icon-button\n matTooltip="Download File"\n (click)="download_all(app)"\n >\n <mat-icon>cloud_download</mat-icon>\n </button>\n </td>\n\n <td *ngIf="enabled" style="text-align:center">\n <a\n mat-icon-button\n matTooltip="Elimina File"\n *ngIf="app.can_delete"\n (click)="delete(app)"\n >\n <mat-icon>delete</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]="\n \'Cancellazione consentita solo a: \' + app.can_delete_m\n "\n *ngIf="!app.can_delete"\n [disabled]="true"\n >\n <mat-icon>delete</mat-icon>\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n <table width="98%" class="fh_table" *ngIf="b_mobile">\n <tbody>\n <tr\n *ngFor="let app of arr_g; let odd = odd; let even = even"\n style="font-size: 15px;"\n [ngClass]="{ odd: odd, even: even }"\n >\n <td\n style="text-align:center;vertical-align: middle;width:36px;height:36px;"\n >\n <div\n style="text-align:center;vertical-align: middle;width:28px;height:28px;"\n >\n <img\n src="assets/icons/square-o/{{ app.icon }}"\n style="width:28px;height:28px;"\n />\n </div>\n </td>\n <td *ngIf="b_mobile" style="text-align:center">\n {{ app.file_name_orig }}<br /><br />\n <button\n style="background-color: #F5F5F5"\n (click)="download_all(app)"\n mat-flat-button\n >\n DOWNLOAD\n </button>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div *ngIf="!b_ini && b_initt" style="color:#ff0000">\n\n </div>\n ',styles:[""]}]}],Rt.ctorParameters=function(){return[{type:wt},{type:Dt},{type:i.ToastrService},{type:e.MatDialog},{type:Tt},{type:Ct},{type:p.TranslateService}]},Rt.propDecorators={enabled:[{type:n.Input}],force_en:[{type:n.Input}],dt_scadenza:[{type:n.Input}],label:[{type:n.Input}],sovrascrivi_path:[{type:n.Input}],ruolo_supervisore:[{type:n.Input}],access_control:[{type:n.Input}],show_images:[{type:n.Input}],can_delete_owner:[{type:n.Input}],change:[{type:n.Output}],call_upload:[{type:n.Output}],init_end:[{type:n.Output}],fill_end:[{type:n.Output}],upc:[{type:n.ViewChild,args:["upc"]}]};var Nt=function(){function t(t,e){this.dialogRef=t,this.data=e,this.label="",this.progress_p=0,null!=e&&(null!=e.label&&(this.label=e.label),null!=e.progress_p&&(this.progress_p=e.progress_p))}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.update_progess=function(t){this.progress_p=t,100==t&&this.dialogRef.close()},t.prototype.ngAfterViewInit=function(){},t}();Nt.decorators=[{type:n.Component,args:[{selector:"fhfh_win_wait",template:'\n <h2 mat-dialog-title>\n {{ label | uppercase }}\n </h2>\n <mat-dialog-content style="min-width:700px">\n <mat-progress-bar\n style="height:50px"\n color="accent"\n mode="determinate"\n value="{{ progress_p }}"\n ></mat-progress-bar>\n </mat-dialog-content>\n '}]}],Nt.ctorParameters=function(){return[{type:e.MatDialogRef},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Nt.propDecorators={cmb_sel:[{type:n.ViewChild,args:["cmb_sel"]}]};var Ft=function(){function t(t,e,i,o,s,a){var r=this;this._dataService=t,this.toastr=e,this.dialog=i,this.app_s=o,this.uti=s,this._trs=a,this.show_descri=!0,this.enabled=!0,this.single=!0,this.descri_obb=!1,this.programma_da_eseguire="",this.label_attendere="ATTENDERE UPLOAD IN CORSO",this.fixed_label=" (INSERISCI QUI LA DESCRIZIONE PRIMA DI CARICARE IL FILE)",this.limit_string="Il file di <size>MB supera il limite di 1GB",this.allegato_inserito="ALLEGATO INSERITO",this.inserire_descrizione="Descrizione Obbligatoria",this.lista_allegati=[],this.change=new n.EventEmitter,this.upload_ended=new n.EventEmitter,this.call_upload=new n.EventEmitter,this.hasBaseDropZoneOver=!1,this.hasAnotherDropZoneOver=!1,this.lascia_il_file="Lascia il file per confermarmare upload",this.trascina_il_file="Trascina un file qui o Clicca per avviare upload",this.multi_list=!1,this.allow_delete=!1,this.loading=!1,this.App="",this.K="",this.label_b="",this.descrizione="",this.file_name="",this.label="",this.username="",this.b_edit_loaded=!1,this.tipo="",this.b_ini=!1,this.uploader=new u.FileUploader({url:this.app_s.API_ENDPOINT+this.app_s.UPLOAD_ENDPOINT+"_new",maxFileSize:1048576e3}),this.id_component="",this.last_result={},this.id=null,this.p_cod_doc="",this.p_section="",this.p_system_type="",this.id_component=this.uti.newGuid(),this.username=this.app_s.user,this.uploader.onBeforeUploadItem=function(t){t.withCredentials=!1},console.log("uploader ",this.app_s.API_ENDPOINT+this.app_s.UPLOAD_ENDPOINT+"_new"),this.uploader.onCompleteItem=function(t,e,i,n){200===i&&(r.descrizione="",r.toastr.info("INFO",r.allegato_inserito,{timeOut:1e3,progressBar:!0}),r.ref_allegato(),r.last_result={item:t,response:e,status:i,header:n},r.change.emit(r.last_result))}}return t.prototype.onFileDrop=function(t){},t.prototype.fileOverBase=function(t){console.log(t),this.hasBaseDropZoneOver=t},t.prototype.call_up=function(){this.call_upload.emit({App:this.App,K:this.K,descrizione:this.descrizione,single:!1,username:this.app_s.user,tipo:this.tipo,local_path:this.app_s.LOCAL_PATH,p1:this.programma_da_eseguire})},t.prototype.del_doc=function(){var t=this;localStorage.setItem(this.app_s.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.app_s.COMPANY_KEY+"msg_dialog",this._trs.instant("Confermi l'eliminazione dell'elemento?")),this.dialog.open(It).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="DELETE_ALLEGATO",i.types=["int","string"],i.values=[t.id,t.app_s.user];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.ref_allegato(),t.toastr.info("INFO","ALLEGATO ELIMINATO",{timeOut:1e3,progressBar:!0}))}),(function(t){}))}}))},t.prototype.load_types=function(){var t=this;null!=this.cmb_tipo&&""!=this.tipo?(this.cmb_tipo.sql=this.tipo,this.cmb_tipo.fillCombo()):setTimeout((function(){t.load_types()}),200)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){var e={};e.headers=[{name:"Authorization",value:"Bearer "+localStorage.getItem(t.app_s.COMPANY_KEY+"token")}],t.uploader.setOptions(e),t.uploader.onCompleteAll=function(){t.loading=!1,t.upload_ended.emit(t.last_result),null!=t.dialogRef&&null!=t.dialogRef.componentInstance&&(t.dialogRef.componentInstance.update_progess(100),t.dialogRef=null)},t.uploader.onErrorItem=function(e,i,n,o){t.toastr.error(i)},t.uploader.onAfterAddingFile=function(e){t.ch(e)},t.uploader.onProgressItem=function(e,i){t.loading=!0,null!=t.dialogRef&&null!=t.dialogRef.componentInstance&&t.dialogRef.componentInstance.update_progess(i)},t.uploader.onWhenAddingFileFailed=function(e,i,n){switch(i.name){case"fileSize":var o=Math.round(e.size/1024/1024);t.toastr.error(t._trs.instant(t.limit_string.split("<size>").join(""+o)));break;default:t.toastr.error("Errore: "+i.name)}}}))},t.prototype.download_all=function(){window.open(this.app_s.COMPANY_SITE_ROOT+"/uploads/"+this.App+"/"+this.K+"/"+this.file_name)},t.prototype.ch=function(t){var e=this;this.descri_obb&&""==this.descrizione?this.toastr.error(this.inserire_descrizione):(this.uploader.onBuildItemForm=function(t,i){i.append("App",e.App),i.append("K",e.K),i.append("descrizione",e.descrizione),i.append("single",e.single),i.append("username",e.username),i.append("system_type",e.p_system_type),i.append("uiid",e.uti.newGuid()),i.append("doc_number",e.p_cod_doc),i.append("repo_uiid","S3"),i.append("parent_doc_type",e.App),i.append("parent_doc_rif",e.p_cod_doc),i.append("parent_doc_uiid",e.K),i.append("parent_doc_section",e.p_section),i.append("version",1),i.append("status","PUBLISHED"),i.append("p_owner",e.app_s.user),i.append("tipo",""),i.append("local_path",e.app_s.LOCAL_PATH),""!=e.programma_da_eseguire&&i.append("p1",e.programma_da_eseguire)},null==this.dialogRef&&(this.dialogRef=this.dialog.open(Nt,{disableClose:!0}),setTimeout((function(){e.dialogRef.componentInstance.label=e._trs.instant(e.label_attendere)})),this.dialogRef.afterClosed().subscribe((function(t){}))),this.uploader.uploadAll())},t.prototype.init=function(t,e,i,n,o,s,a,r){void 0===a&&(a=""),void 0===r&&(r=!1),this.App=t,this.K=e,this.label=o,this.p_cod_doc=i,this.p_section=n,this.p_system_type=s,this.b_ini=!0,this.b_edit_loaded=!1,this.descrizione="",this.programma_da_eseguire=a,this.allow_delete=r,this.ref_allegato(),this.tipo.indexOf("SELECT_")>-1&&(this.multi_list=!0,this.load_types())},t.prototype.ref_allegato=function(){var t=this;if(this.id=null,this.descrizione="",this.file_name="",this.label_b="",this.cmb_tipo.resetValue(),this.single&&null!=this.App&&""!=this.App){var e=new vt;e.sql="SELECT_ALLEGATO_INFO_NEW",e.types=["string","string"],e.values=[this.App,this.K],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;i.length>0&&(t.id=i[0].id,t.descrizione=i[0].descrizione,t.file_name=i[0].file_name_orig,t.label_b=i[0].file_name_orig+" - "+i[0].dim,t.b_edit_loaded=!0)}}))}},t}();Ft.decorators=[{type:n.Component,args:[{selector:"FHUploadS3",template:'\n <div *ngIf="loading" fxLayout="row">\n WAIT\n </div>\n <div\n [hidden]="!(enabled && !loading)"\n fxLayout="row"\n fxLayoutAlign="start center"\n >\n <div\n [hidden]="!multi_list"\n style="width:380px"\n fxLayoutAlign="start center"\n >\n <FHComboBox\n [sql]="tipo"\n #cmb_tipo\n [init_fill]="false"\n [label]="\'Tipologia\' | translate"\n ></FHComboBox\n > \n </div>\n <mat-form-field [class.fh_field]="enabled" [class.fh_field_dis]="!enabled"\n [hidden]="!show_descri"\n style="width: 100%"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label | translate}} {{ fixed_label | translate }}</mat-label>\n <input\n matInput\n type="text"\n name="descrizione"\n [(ngModel)]="descrizione"\n />\n </mat-form-field>\n \n \x3c!-- <div\n style="width:140px"\n fxLayout="row"\n fxLayoutAlign="start start"\n (click)="call_up()"\n >\n <input\n type="file"\n multiple\n ng2FileSelect\n [uploader]="uploader"\n name="file-fh{{ id_component }}"\n id="file-fh{{ id_component }}"\n class="inputfile inputfile-fh"\n />\n <label for="file-fh{{ id_component }}" style="width:210px"\n ><svg\n xmlns="http://www.w3.org/2000/svg"\n width="20"\n height="17"\n viewBox="0 0 20 17"\n >\n <path\n d="M10 0l-5.2 4.9h3.3v5.1h3.8v-5.1h3.3l-5.2-4.9zm9.3 11.5l-3.2-2.1h-2l3.4 2.6h-3.5c-.1 0-.2.1-.2.1l-.8 2.3h-6l-.8-2.2c-.1-.1-.1-.2-.2-.2h-3.6l3.4-2.6h-2l-3.2 2.1c-.4.3-.7 1-.6 1.5l.6 3.1c.1.5.7.9 1.2.9h16.3c.6 0 1.1-.4 1.3-.9l.6-3.1c.1-.5-.2-1.2-.7-1.5z"\n /></svg><span style="font-size: 12px"> Upload</span></label>\n </div>\n --\x3e\n <div class="my-drop-zone" style="width:130px" fxLayout="row" [matTooltip]="hasBaseDropZoneOver ? lascia_il_file : trascina_il_file | translate" fxLayoutAlign="center start">\n <label for="uploader-input" ng2FileDrop style="font-weight:bold"\n [ngClass]="{\'over-drop-zone\': hasBaseDropZoneOver}" for="file-fh{{ id_component }}"\n (onFileDrop)="onFileDrop($event)"\n (fileOver)="fileOverBase($event)" [uploader]="uploader">\n <div fxLayoutAlign="center center" fxLayout="row">\n <mat-icon>{{!hasBaseDropZoneOver?\'backup\':\'thumb_up\'}}</mat-icon>\n\n <span style="font-size: 14px"> Upload</span></div></label></div>\n <input type="file"\n ng2FileSelect\n [multiple]="true"\n [uploader]="uploader"\n name="file-fh{{ id_component }}"\n id="file-fh{{ id_component }}"\n (onFileSelected)="onFileDrop($event)"\n id="uploader-input" style="display:none"/>\n <div fxLayout="row" fxLayoutAlign="start start">\n \n <button\n mat-flat-button\n *ngIf="b_edit_loaded"\n (click)="download_all()"\n style="font-size: 12px;font-weight:bold" color="accent"\n\n >\n {{ label_b }}</button\n > \n <button\n mat-flat-button\n *ngIf="id != null && allow_delete"\n (click)="del_doc()"\n color="warn"\n >\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n </div>\n <div *ngIf="!enabled" fxLayout="row" fxLayoutGap="10px">\n <label>{{ label }}:</label>\n <div *ngIf="label != descrizione">{{ descrizione }}</div>\n <button\n mat-flat-button\n *ngIf="b_edit_loaded"\n (click)="download_all()"\n style="font-size: 12px;background-color: #F5F5F5"\n >\n {{ label_b }}\n </button>\n </div>\n ',styles:[""]}]}],Ft.ctorParameters=function(){return[{type:Dt},{type:i.ToastrService},{type:e.MatDialog},{type:wt},{type:Ct},{type:p.TranslateService}]},Ft.propDecorators={show_descri:[{type:n.Input}],enabled:[{type:n.Input}],single:[{type:n.Input}],descri_obb:[{type:n.Input}],programma_da_eseguire:[{type:n.Input}],label_attendere:[{type:n.Input}],fixed_label:[{type:n.Input}],limit_string:[{type:n.Input}],allegato_inserito:[{type:n.Input}],inserire_descrizione:[{type:n.Input}],lista_allegati:[{type:n.Input}],change:[{type:n.Output}],upload_ended:[{type:n.Output}],call_upload:[{type:n.Output}],cmb_tipo:[{type:n.ViewChild,args:["cmb_tipo"]}],lascia_il_file:[{type:n.Input}],trascina_il_file:[{type:n.Input}]};var Mt=function(){function t(t,e,i,n){this.dialogRef=t,this._dataService=e,this.toastr=i,this.data=n,this.width="100%",this.selectedAdd=null,this.selectedRemove=null,this.option=0,this.selval="-1",this.errorMsg="",this.valDef="-1",this.fltr_user="",this.fltr_user_rem="",this.value_list=new Array,this.single_sel=!1,this.vis_buttons=!0,this.limit_size=!1,this.value_sel_ric=new Array,this.value_list_sel=new Array,this.types=[],this.values=[],this.value_list_all=[],this.value_sel=[],null!=n&&(null!=n.value_list&&(this.value_list=n.value_list,this.value_list_all=JSON.parse(JSON.stringify(n.value_list))),null!=n.single_sel&&(this.single_sel=n.single_sel),null!=n.vis_buttons&&(this.vis_buttons=n.vis_buttons),null!=n.limit_size&&(this.limit_size=n.limit_size),null!=n.value_sel&&(this.value_sel=n.value_sel),this.fill_list_arr(this.value_list,this.value_sel))}return t.prototype.ngAfterViewInit=function(){},t.prototype.add_all=function(){for(var t=0;t<this.value_list_sel.length;t++)this.value_sel.push(this.value_list_sel[t]);var e=[];for(t=0;t<this.value_list_all.length;t++){for(var i=!1,n=0;n<this.value_sel.length;n++)if(this.value_sel[n].valore==this.value_list_all[t].valore){i=!0;break}i||e.push(this.value_list_all[t])}this.value_list=JSON.parse(JSON.stringify(e)),this.selectedAdd=null,this.filtra(),this.filtra_rem()},t.prototype.rem_all=function(){var t=this;this.value_sel_ric.map((function(e){t.value_list.push(e)}));for(var e=[],i=0;i<this.value_sel.length;i++){for(var n=!1,o=0;o<this.value_sel_ric.length;o++)if(this.value_sel_ric[o].descrizione_valore==this.value_sel[i].descrizione_valore){n=!0;break}n||e.push(this.value_sel[i])}this.value_sel=JSON.parse(JSON.stringify(e)),this.value_sel_ric=[],this.selectedAdd=null,this.filtra(),this.filtra_rem()},t.prototype.filtra_rem=function(){if(console.log("fltr_user_rem "),this.value_sel_ric=new Array,""==this.fltr_user_rem){for(var t=0;t<this.value_sel.length;t++)if(this.value_sel_ric.push(this.value_sel[t]),50==t&&this.limit_size)return}else for(t=0;t<this.value_sel.length;t++)if(-1!=this.value_sel[t].descrizione_valore.toUpperCase().indexOf(this.fltr_user_rem.toUpperCase())){console.log("entro !!");for(var e=!1,i=0;i<this.value_sel_ric.length;i++)if(this.value_sel_ric[i].descrizione_valore==this.value_sel[t].descrizione_valore){e=!0;break}if(console.log("entro !! ",e),e||this.value_sel_ric.push(this.value_sel[t]),50==this.value_sel_ric.length&&this.limit_size)return}},t.prototype.filtra=function(){if(this.value_list_sel=new Array,""==this.fltr_user){for(var t=0;t<this.value_list.length;t++)if(this.value_list_sel.push(this.value_list[t]),50==t&&this.limit_size)return}else for(t=0;t<this.value_list.length;t++)if(-1!=this.value_list[t].descrizione_valore.toUpperCase().indexOf(this.fltr_user.toUpperCase())){for(var e=!1,i=0;i<this.value_list_sel.length;i++)if(this.value_list_sel[i].descrizione_valore==this.value_list[t].descrizione_valore){e=!0;break}if(e||this.value_list_sel.push(this.value_list[t]),50==this.value_list_sel.length&&this.limit_size)return}},t.prototype.fill_list=function(t,e){var i=this;this.value_sel=[];var n=new vt;n.sql=t,n.types=this.types,n.values=this.values,this._dataService.doQuery(n).subscribe((function(t){if(null!=t&&"OK"==t.result_msg){i.value_list=t.result_data;for(var n=0;n<e.length;n++)for(var o=0;o<t.result_data.length;o++)e[n]==t.result_data[o].descrizione_valore&&i.value_sel.push(t.result_data[o]);for(o=0;o<i.value_sel.length;o++)for(n=i.value_list.length-1;n>=0;n--)if(i.value_list[n].descrizione_valore==i.value_sel[o].descrizione_valore){i.value_list.splice(n,1);break}i.filtra(),!0}}),(function(t){i.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"}))},t.prototype.fill_list_arr=function(t,e){this.value_sel=[];for(var i=0;i<e.length;i++)for(var n=0;n<t.length;n++)e[i]==t[n].valore&&this.value_sel.push(t[n]);this.value_list=t;for(n=0;n<this.value_sel.length;n++)for(i=this.value_list.length-1;i>=0;i--)if(this.value_list[i].descrizione_valore==this.value_sel[n].descrizione_valore){this.value_list.splice(i,1);break}this.filtra(),this.filtra_rem()},t.prototype.do_add=function(){if(null!=this.selectedAdd){var t=this.value_list.indexOf(this.selectedAdd,0);this.single_sel||t>-1&&this.value_list.splice(t,1),this.single_sel&&(this.value_sel=new Array),this.value_sel.push(this.selectedAdd),this.selectedAdd=null,this.filtra(),this.filtra_rem(),this.single_sel&&this.ok()}else this.toastr.error("ERRORE","Selezionare il valore da aggiungere",{timeOut:1e3,progressBar:!0})},t.prototype.do_rem=function(){if(null!=this.selectedRemove){var t=this.value_sel.indexOf(this.selectedRemove,0);t>-1&&this.value_sel.splice(t,1),this.value_list.push(this.selectedRemove),this.selectedRemove=null,this.filtra(),this.filtra_rem()}else this.toastr.error("ERRORE","Selezionare il valore da rimuovere",{timeOut:1e3,progressBar:!0})},t.prototype.addTo=function(t){this.option=1,this.selectedAdd=t,this.selectedRemove=null},t.prototype.removeTo=function(t){this.option=2,this.selectedAdd=null,this.selectedRemove=t},t.prototype.getSelStr=function(){for(var t="",e=0;e<this.value_sel.length;e++)""!=t&&(t+=","),t+=this.value_sel[e].descrizione_valore;return t},t.prototype.getSelVal=function(){for(var t="",e=0;e<this.value_sel.length;e++)""!=t&&(t+=","),t+=this.value_sel[e].valore;return t},t.prototype.getSelArr=function(){return this.value_sel},t.prototype.ok=function(){this.dialogRef.close(this.getSelArr())},t}();Mt.decorators=[{type:n.Component,args:[{selector:"FHPickList",template:'\n <div fxLayout="column" fxLayoutGap="15px" style="min-width:1000px" fxFlex>\n <div fxLayout="row" fxLayoutGap="10px">\n <div fxLayout="column" fxFlex="45">\n <div style="width:100%;height:450px;overflow:auto;">\n <table style="width: 100%" class="fh_table sel_r">\n <thead>\n <tr>\n <th>{{\'VALORI SELEZIONABILI\' |translate}}</th>\n </tr>\n </thead>\n\n <tbody>\n <tr style="background-color:#FFF !important">\n <td>\n <input\n [(ngModel)]="fltr_user"\n (ngModelChange)="filtra()"\n style="padding:8px;margin:15px auto;width:100%;"\n placeholder="Ricerca..."\n />\n </td>\n </tr>\n <tr\n *ngFor="\n let u of value_list_sel;\n let odd = odd;\n let even = even\n "\n\n (click)="addTo(u)"\n (dblclick)="do_add()"\n class="selector"\n\n [ngClass]="{ active: selectedAdd == u }"\n >\n <td [ngClass]="{ odd: odd, even: even }" style="cursor:pointer">{{ u.descrizione_valore }}</td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div\n fxLayout="column" fxFlex="10" fxLayoutAlign="center center"\n style="height: 450px; position: relative; margin:0 .5em; padding-left: .5em; padding-right: .5em; border-left: 1px solid rgba(191, 191, 191, 0.5); border-right: 1px solid rgba(191, 191, 191, 0.5);"\n >\n <div fxLayoutAlign="center center" fxLayout="column"\n\n >\n <button\n mat-flat-button\n color="primary"\n (click)="do_add()"\n [disabled]="option!=1"\n >\n >\n </button>\n <br />\n <button\n mat-flat-button\n color="primary"\n (click)="do_rem()"\n [disabled]="option!=2"\n >\n <\n </button> <br *ngIf="!single_sel" /><br *ngIf="!single_sel"/> <br *ngIf="!single_sel"/>\n <button *ngIf="!single_sel"\n mat-flat-button\n color="primary"\n (click)="add_all()" matTooltip="Seleziona Tutto"\n [disabled]="value_list_sel.length==0"\n >\n >>\n </button> <br *ngIf="!single_sel"/>\n <button *ngIf="!single_sel"\n mat-flat-button\n color="primary" matTooltip="Deseleziona Tutto"\n (click)="rem_all()"\n [disabled]="value_sel.length==0"\n >\n <<\n </button>\n </div>\n </div>\n\n <div fxLayout="column" fxFlex="45">\n <div style="width:100%;height:450px;overflow:auto;">\n <table style="width: 100%" class="fh_table sel_r">\n <thead>\n <tr>\n <th>{{\'VALORI SELEZIONATI\'|translate}}</th>\n </tr>\n </thead>\n <tbody>\n <tr style="background-color:#FFF !important">\n <td>\n <input\n [(ngModel)]="fltr_user_rem"\n (ngModelChange)="filtra_rem()"\n style="padding:8px;margin:15px auto;width:100%;"\n placeholder="Ricerca..."\n />\n </td>\n </tr>\n <tr\n *ngFor="let u of value_sel_ric; let odd = odd; let even = even"\n (mouseover)="selectedRemove = u"\n [ngClass]="{ odd: odd, even: even }"\n (click)="removeTo(u)"\n (dblclick)="do_rem()"\n class="selector"\n [ngClass]="{ active: selectedRemove == u }"\n >\n <td [ngClass]="{ odd: odd, even: even }" style="cursor:pointer">{{ u.descrizione_valore }}</td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n <br /><br />\n <div fxLayout="row" fxLayoutAlign="center center" fxLayoutGap="5px">\n <button mat-flat-button color="primary" (click)="ok()">Ok</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="dialogRef.close()"\n >\n {{\'Annulla\'|translate }}\n </button>\n </div>\n </div>\n ',styles:["\n .mat-dialog-content { max-height: unset !important; }\n .selector {\n cursor: hand;\n }\n "]}]}],Mt.ctorParameters=function(){return[{type:e.MatDialogRef},{type:Dt},{type:i.ToastrService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Mt.propDecorators={value_list:[{type:n.Input}],single_sel:[{type:n.Input}],vis_buttons:[{type:n.Input}],limit_size:[{type:n.Input}],value_sel:[{type:n.Input}]};var Pt={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return zt})),multi:!0},zt=function(){function t(t,e){this.dataservice=t,this.dialog=e,this.label="",this.required=!1,this.enabled=!0,this.hidden=!1,this.sep=",",this.value_list=new Array,this.single_sel=!1,this.vis_buttons=!0,this.limit_size=!1,this.value_sel=[],this.change=new n.EventEmitter,this.t_value="",this.i_value="",this.selectedUser=[],this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.required&&(t.label=t.label+" *")}))},t.prototype.set_by_value=function(t){null==t&&this.clear(),""==t&&this.clear();var e=t.split(this.sep);this.t_value="",this.i_value="",this.value_sel=[];for(var i=0;i<e.length;i++)for(var n=0;n<this.value_list.length;n++)if(e[i]==this.value_list[n].valore){""!=this.t_value&&(this.t_value+=this.sep),this.t_value+=this.value_list[n].descrizione_valore,""!=this.i_value&&(this.i_value+=this.sep),this.i_value+=this.value_list[n].valore,this.value_sel.push(this.value_list[n].valore);break}},t.prototype.writeValue=function(t){null!=t&&""!=t?this.set_by_value(t):this.clear()},t.prototype.open_pick=function(){var t=this;this.enabled&&this.dialog.open(Mt,{disableClose:!0,width:"800px",height:"650px",data:{value_list:JSON.parse(JSON.stringify(this.value_list)),single_sel:this.single_sel,vis_buttons:this.vis_buttons,limit_size:this.limit_size,value_sel:JSON.parse(JSON.stringify(this.value_sel))}}).afterClosed().subscribe((function(e){null!=e&&(t.set_by_value(e.map((function(t){return t.valore})).join(t.sep)),t.change.emit(e),t.onChange(t.i_value))}))},t.prototype.clear=function(){this.t_value="",this.i_value="",this.onChange("")},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}();zt.decorators=[{type:n.Component,args:[{selector:"FHPickField",providers:[Pt],template:'\n <div fxLayout="row" [hidden]="!enabled || hidden">\n <mat-form-field [class.fh_field]="enabled"\n style="clickable-field"\n (click)="open_pick()"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n\n <input\n matInput\n [hidden]="hidden"\n type="text"\n [ngModel]="t_value"\n [disabled]="false"\n readonly\n />\n </mat-form-field>\n <button\n mat-icon-button\n matSuffix\n [hidden]="selectedUser.length == 0"\n (click)="clear()"\n >\n <mat-icon>clear</mat-icon>\n </button>\n </div>\n <mat-form-field\n [hidden]="enabled || hidden" [class.fh_field_dis]="!enabled"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n <input\n type="text"\n #el1\n matInput\n [disabled]="true"\n [(ngModel)]="t_value"\n />\n </mat-form-field>\n ',styles:["\n .clickable-field {\n border: 1px solid #000000;\n color: #000000;\n }\n\n .clickable-field:focus {\n outline: none;\n }\n\n :host ::ng-deep .mat-input-element {\n cursor: pointer !important;\n }\n "]}]}],zt.ctorParameters=function(){return[{type:Dt},{type:e.MatDialog}]},zt.propDecorators={label:[{type:n.Input}],required:[{type:n.Input}],enabled:[{type:n.Input}],hidden:[{type:n.Input}],sep:[{type:n.Input}],value_list:[{type:n.Input}],single_sel:[{type:n.Input}],vis_buttons:[{type:n.Input}],limit_size:[{type:n.Input}],value_sel:[{type:n.Input}],change:[{type:n.Output}]};var jt=function(){function t(t,e){this.dialogRef=t,this.data=e,this.modifiche=[],this.title="",null!=e.title&&(this.title=e.title.toUpperCase()),this.modifiche=JSON.parse(e.dt)}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ngAfterViewInit=function(){},t}();jt.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">DETTAGLIO MODIFICA - {{ title }}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n\n <mat-dialog-content style="min-width:700px">\n <table style="width: 90%" class="fh_table">\n <thead>\n <tr>\n <th style="width:20%;">Operazione</th>\n <th style="width:20%;">Campo</th>\n <th style="width:30%;">Old Value</th>\n <th style="width:30%;">New Value</th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="let u of modifiche; let odd = odd; let even = even"\n [ngClass]="{ odd: odd, even: even }"\n >\n <td>{{ u.op }}</td>\n <td>{{ u.path }}</td>\n <td>{{ u.oldVal }}</td>\n <td>{{ u.val }}</td>\n </tr>\n </tbody>\n </table>\n </mat-dialog-content>\n</div>\n '}]}],jt.ctorParameters=function(){return[{type:e.MatDialogRef},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var Ut=function(){function t(t,e,i,n){this.dialogRef=t,this.appService=e,this.toastr=i,this._dataService=n,this.o=new Object}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ngAfterViewInit=function(){},t}();Ut.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n <h2 mat-dialog-title>LOG {{ o.data | date: "dd/MM/yyyy HH:mm:ss" }}</h2>\n\n <mat-dialog-content style="min-width:700px">\n <div fxLayout="column">\n <div\n [style.background-color]="o.tipo === \'ERROR\' ? \'#CC0033\' : \'#1E7BB5\'"\n style="color:#FFFFFF;font-weight: bold;text-align:center"\n >\n {{ o.tipo }}\n </div>\n <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>Applicazione</mat-label>\n <input\n type="text"\n matInput\n [readonly]="true"\n [(ngModel)]="o.applicativo"\n />\n </mat-form-field>\n <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>Documento</mat-label>\n <input\n type="text"\n matInput\n [readonly]="true"\n [(ngModel)]="o.iddocumento"\n />\n </mat-form-field>\n\n <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>Descrizione</mat-label>\n <textarea\n matInput\n readonly\n [(ngModel)]="o.descr_all"\n rows="8"\n ></textarea>\n </mat-form-field>\n </div>\n\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button (click)="dialogRef.close()" color="accent">\n CHIUDI\n </button>\n </div>\n </mat-dialog-content>\n '}]}],Ut.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:Dt}]};var Vt=function(){function t(t,e,i,n,o,s,a,r,l){this.router=t,this.route=e,this._dataService=i,this.toastr=n,this.dialog=o,this.appService=s,this.uti=a,this.dialogRef=r,this.data=l,this.title="LOGS",this.columnDefs=[],this.flt_log="",this.appService.getState().mobile||(this.uti.set_home_title(this.title),this.title=""),null!=l.flt&&(this.flt_log=l.flt)}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.cce=function(t){if("link"==t.colDef.field){if(null==t.data.link)return;window.open(t.data.link)}if("diff"==t.colDef.field){if(null==t.data.diff)return;this.dialog.open(jt,{data:{dt:t.data.diff,title:t.data.utente+" del: "+this.uti.datetime2String(new Date(t.data.data))}}).afterClosed().subscribe()}"descr_all"==t.colDef.field&&this.dialog.open(bt,{disableClose:!0,data:{valore:t.data.descr_all,readonly:!0,title:"Descrizione"}}).afterClosed().subscribe((function(t){}))},t.prototype.ie=function(){var t=this,e=new vt;e.sql="SELECT_LOGS_APPS",e.types=[],e.values=[],this._dataService.doQuery(e).subscribe((function(i){if(null!=i&&"OK"==i.result_msg){for(var n=i.result_data,o=0;o<n.length;o++)n[o]=n[o].applicativo;(e=new vt).sql="SELECT_LOGS_TYPES",e.types=[],e.values=[],t._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=e.result_data,o=0;o<i.length;o++)i[o]=i[o].tipo;t.columnDefs=[{headerName:"Applicazione",field:"applicativo",filter:"agSetColumnFilter",filterParams:{values:n,newRowsAction:"keep"}},{headerName:"Documento",field:"iddocumento",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Descrizione",field:"descr_all",filter:"agTextColumnFilter",tooltipField:"descr_all",tooltipComponentParams:{color:"#ececec"},filterParams:{newRowsAction:"keep"},cellRenderer:function(t){return null==t.value?" ------ ":t.value.length>60?'<table border="0" style="width: 100%;"><tr><td>'+t.value.substring(0,60)+'...</td><td style="text-align: right"><i style="color:#f4b342;font-size: 22px;" class="material-icons">feedback</i></td></tr></table>':'<div width="100%">'+t.value+"</div>"}},{headerName:"Utente",field:"utente",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Tipo",field:"tipo",filter:"agSetColumnFilter",filterParams:{values:i,newRowsAction:"keep"},cellStyle:function(t){return"INFO"==t.value?{"background-color":"#1E7BB5",color:"#FFFFFF","font-weight":"bold","text-align":"center"}:"ERROR"==t.value?{"background-color":"#CC0033",color:"#FFFFFF","font-weight":"bold","text-align":"center"}:"INSERT_DOC"==t.value||"EDIT_DOC"==t.value||"DELETE_DOC"==t.value?{"background-color":"#FF8000",color:"#FFFFFF","font-weight":"bold","text-align":"center"}:{"text-align":"left"}}},{headerName:"Data",field:"data",filter:"agDateColumnFilter",floatingFilterComponentParams:{suppressFilterButton:!0},filterParams:{newRowsAction:"keep"},cellStyle:function(t){return{"text-align":"left"}},cellRenderer:function(e){if(null==e.value)return" ------ ";var i=new Date(e.value);return 1970==i.getFullYear()?" ------ ":t.uti.datetime2String(i)}},{headerName:"Dettagli",field:"diff",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"},cellStyle:function(t){return{"text-align":"center"}},cellRenderer:function(t){return null!=t.value&&"null"!=t.value&&""!=t.value?'<button mat-flat-button color="primary" style="width:100%">DETTAGLI</button>':""}},{headerName:"Link",field:"link",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"},cellStyle:function(t){return{"text-align":"center"}},cellRenderer:function(t){return null!=t.value?'<button mat-flat-button color="primary" style="width:100%">LINK</button>':""}}]}}))}}))},t.prototype.show_descri=function(){var t=this,e=this.dialog.open(Ut);setTimeout((function(){null!=t.datagrid.sRow.descr_all&&(t.datagrid.sRow.descr_all=t.datagrid.sRow.descr_all.split("<br>").join("\n")),e.componentInstance.o=t.datagrid.sRow,e.afterClosed().subscribe((function(t){}))}))},t.prototype.ngAfterViewInit=function(){this.datagrid.doFill(this.flt_log)},t}();Vt.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">LOGS</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n\n <mat-dialog-content>\n <div\n style="width: 100%;"\n [style.height]="(appService.getState().body_h - 300) + \'px\'"\n >\n <div style="width: 100%; height: 100%;">\n <FHGrid\n [init_fill]="false"\n #dtm\n [tooltipShowDelay]="0"\n [columnDefs]="columnDefs"\n (dclicked)="show_descri()"\n tbl_name="v_logs"\n grid_key="logs_V112"\n (init_end)="ie()"\n (cell_clicked)="cce($event)"\n sort_field="data desc"\n fields="applicativo,iddocumento,utente,tipo,data,diff,link,descr_all"\n ></FHGrid>\n </div>\n </div>\n </mat-dialog-content>\n</div>\n ',styles:[" .mat-dialog-content { max-height: unset !important; }\n\n"]}]}],Vt.ctorParameters=function(){return[{type:d.Router},{type:d.ActivatedRoute},{type:Dt},{type:i.ToastrService},{type:e.MatDialog},{type:wt},{type:Ct},{type:e.MatDialogRef},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Vt.propDecorators={datagrid:[{type:n.ViewChild,args:["dtm"]}]};var qt=function(){function t(t,e,i,n){this.data=t,this.dialogRef=e,this.app_s=i,this.trs=n,this.enabled=!0,this.access_control=!0,this.App="",this.K="",this.title="ALLEGATI",this.admin_role="[ZZZ_DIS_CC]",this.sovrascrivi_path="",null!=t&&(null!=t.App&&(this.App=t.App),null!=t.K&&(this.K=t.K),null!=t.admin_role&&(this.admin_role=t.admin_role),null!=t.enabled&&(this.enabled=t.enabled))}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.init(t.App,t.K),t.title=t.trs.instant("ALLEGATI")}))},t.prototype.init=function(t,e){this.App=t,this.K=e,this.upc.init(this.App,this.K)},t}();qt.decorators=[{type:n.Component,args:[{selector:"wkf_win_upload",template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n\n <mat-dialog-content style="font-size:12px">\n<br><br>\n <FHUploadPanel\n [enabled]="enabled"\n #upc\n [access_control]="access_control"\n [sovrascrivi_path]="sovrascrivi_path"\n [ruolo_supervisore]="admin_role"\n ></FHUploadPanel>\n </mat-dialog-content>\n <br /><br />\n <div style="width:100%;text-align:center;">\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n {{\'CHIUDI\' | translate}}\n </button>\n </div>\n </div>\n ',styles:[""]}]}],qt.ctorParameters=function(){return[{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]},{type:e.MatDialogRef},{type:wt},{type:p.TranslateService}]},qt.propDecorators={upc:[{type:n.ViewChild,args:["upc"]}]};var Gt=function(){function t(t,e,i,n,o){var s=this;this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.uti=n,this.datax=o,this.title="LOGS",this.data=null,this.b_commento=!1,this.columnDefs=[],this.data=o,console.log("datax ",o),null!=o&&null!=o.b_commento&&(this.b_commento=this.datax.b_commento),this.b_commento?this.columnDefs=[{headerName:"Commento",field:"descrizione",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Utente",field:"utente",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Tipo",field:"tipo",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"},cellStyle:function(t){return"INFO"==t.value?{"background-color":"#1E7BB5",color:"#FFFFFF","font-weight":"bold","text-align":"center"}:"ERROR"==t.value?{"background-color":"#CC0033",color:"#FFFFFF","font-weight":"bold","text-align":"center"}:"INSERT_DOC"==t.value||"EDIT_DOC"==t.value||"DELETE_DOC"==t.value?{"background-color":"#FF8000",color:"#FFFFFF","font-weight":"bold","text-align":"center"}:{"text-align":"left"}}},{headerName:"Data",field:"data",filter:"agDateColumnFilter",floatingFilterComponentParams:{suppressFilterButton:!0},filterParams:{newRowsAction:"keep"},cellStyle:function(t){return{"text-align":"left"}},cellRenderer:function(t){if(null==t.value)return" ------ ";var e=new Date(t.value);return 1970==e.getFullYear()?" ------ ":s.uti.datetime2String(e)}},{headerName:"Dettagli",field:"diff",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"},cellStyle:function(t){return{"text-align":"center"}},cellRenderer:function(t){return console.log("params.value ",t.value),null!=t.value&&"null"!=t.value&&""!=t.value?'<button style="width:100%">DETTAGLI</button>':""}},{headerName:"Commento",field:"descrizione",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}}]:this.columnDefs=[{headerName:"Utente",field:"utente",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Tipo",field:"tipo",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"},cellStyle:function(t){return"INFO"==t.value?{"background-color":"#1E7BB5",color:"#FFFFFF","font-weight":"bold","text-align":"center"}:"ERROR"==t.value?{"background-color":"#CC0033",color:"#FFFFFF","font-weight":"bold","text-align":"center"}:"INSERT_DOC"==t.value||"EDIT_DOC"==t.value||"DELETE_DOC"==t.value?{"background-color":"#FF8000",color:"#FFFFFF","font-weight":"bold","text-align":"center"}:{"text-align":"left"}}},{headerName:"Data",field:"data",filter:"agDateColumnFilter",floatingFilterComponentParams:{suppressFilterButton:!0},filterParams:{newRowsAction:"keep"},cellStyle:function(t){return{"text-align":"left"}},cellRenderer:function(t){if(null==t.value)return" ------ ";var e=new Date(t.value);return 1970==e.getFullYear()?" ------ ":s.uti.datetime2String(e)}},{headerName:"Dettagli",field:"diff",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"},cellStyle:function(t){return{"text-align":"center"}},cellRenderer:function(t){return null!=t.value&&"null"!=t.value&&""!=t.value?'<button style="width:100%">DETTAGLI</button>':""}}]}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ngAfterViewInit=function(){null!=this.data&&this.datagrid.doFill("applicativo='"+this.data.App+"' and iddocumento='"+this.data.K+"'")},t.prototype.cce=function(t){if("diff"==t.colDef.field){if(null==t.data.diff)return;this.m_dialogRef.open(jt,{data:{dt:t.data.diff,title:t.data.utente+" del: "+this.uti.datetime2String(new Date(t.data.data))}}).afterClosed().subscribe()}},t}();Gt.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n <div [style.height]="m_appService.getState().body_h - 130 + \'px\'">\n <div\n style="width: 100%"\n [style.height]="m_appService.getState().body_h - 140 + \'px\'"\n >\n <div style="width:100%;height:100%">\n <FHGrid\n #dtm\n [columnDefs]="columnDefs"\n [init_fill]="false"\n tbl_name="v_logs"\n grid_key="dddfd"\n (cell_clicked)="cce($event)"\n sort_field="data desc"\n fields="*"\n ></FHGrid>\n </div>\n </div>\n </div>\n ',styles:[""]}]}],Gt.ctorParameters=function(){return[{type:e.MatDialogRef},{type:e.MatDialog},{type:wt},{type:Ct},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Gt.propDecorators={datagrid:[{type:n.ViewChild,args:["dtm"]}]};var Kt=function(){function t(t){this._dialog=t,this.editable=!0,this.show_save=!0,this.show_back=!0,this.is_editing=!1,this.App="",this.K="",this.mgs_back="Indietro",this.mgs_edit="Modifica",this.mgs_save="Salva",this.b_commento=!1,this.log_enabled=!0,this.custom_commands=[],this.command=new n.EventEmitter}return t.prototype.logs=function(){this._dialog.open(Gt,{width:"95%",disableClose:!0,data:{App:this.App,K:this.K,b_commento:this.b_commento}}).afterClosed().subscribe((function(t){}))},t.prototype.exec_command=function(t){this.command.emit({cmd:t})},t.prototype.edit=function(){this.command.emit({cmd:"edit_form"}),this.is_editing=!0},t.prototype.back_ask_save=function(){this.command.emit({cmd:"ask_back"})},t.prototype.back=function(){this.command.emit({cmd:"back"})},t.prototype.save=function(){this.command.emit({cmd:"save"})},t.prototype.set_editing=function(t){this.is_editing=t},t}();Kt.decorators=[{type:n.Component,args:[{selector:"FHFormToolBar",template:'\n <div fxLayout="row" fxLayoutGap="5px">\n <div\n fxLayout="row"\n fxLayoutGap="10px"\n [hidden]="is_editing"\n fxLayoutAlign="start center"\n >\n <div><button mat-flat-button [hidden]="!show_back" (click)="back()">{{ mgs_back | translate }}</button> </div>\n <div><button\n mat-flat-button\n color="primary"\n [hidden]="!editable"\n (click)="edit()"\n >\n <mat-icon>edit</mat-icon> {{ mgs_edit }}\n </button> </div>\n <div><button\n [hidden]="!editable || !log_enabled"\n mat-flat-button\n *ngIf="App != \'\'"\n color="accent"\n (click)="logs()"\n >\n <mat-icon>assignment</mat-icon> Logs</button> </div>\n </div>\n <div\n fxLayout="row"\n fxLayoutGap="10px"\n [hidden]="!is_editing"\n fxLayoutAlign="start center">\n <div><button mat-flat-button [hidden]="!show_back" (click)="back_ask_save()">{{ mgs_back | translate }}</button> </div>\n <div><button\n mat-flat-button\n color="primary"\n [hidden]="!show_save"\n (click)="save()">\n <mat-icon>save</mat-icon> {{ mgs_save | translate}}\n </button> </div>\n\n <div><button [hidden]="!log_enabled"\n mat-flat-button\n *ngIf="App != \'\'"\n color="accent"\n (click)="logs()"\n >\n <mat-icon>assignment</mat-icon> Logs\n </button> </div>\n </div>\n <div\n *ngIf="custom_commands.length > 0"\n fxLayoutGap="10px"\n fxLayout="row"\n fxLayoutAlign="end center"\n >\n <div *ngFor="let app of custom_commands" fxLayout="row"\n fxLayoutGap="5px">\n <div><button [hidden]="app.hidden!=null && app.hidden"\n mat-flat-button\n [color]="app.color"\n (click)="exec_command(app.command)"\n >\n <mat-icon *ngIf="app.icon != null">{{ app.icon }}</mat-icon\n >{{ app.label }}\n </button> </div>\n </div>\n </div>\n </div>\n ',styles:[""]}]}],Kt.ctorParameters=function(){return[{type:e.MatDialog}]},Kt.propDecorators={editable:[{type:n.Input}],show_save:[{type:n.Input}],show_back:[{type:n.Input}],App:[{type:n.Input}],K:[{type:n.Input}],mgs_back:[{type:n.Input}],mgs_edit:[{type:n.Input}],mgs_save:[{type:n.Input}],b_commento:[{type:n.Input}],log_enabled:[{type:n.Input}],custom_commands:[{type:n.Input}],command:[{type:n.Output}]};var Bt={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Ht})),multi:!0},Ht=function(){function t(){this.hidden=!1,this.label="",this.enabled=!0,this.required=!1,this.rows=3,this.error=null,this.change=new n.EventEmitter,this.focusout=new n.EventEmitter,this.focusin=new n.EventEmitter,this.text_v="",this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.onFi=function(){var t=this;setTimeout((function(){t.focusin.emit(t.text_v)}))},t.prototype.onFu=function(){var t=this;setTimeout((function(){t.focusout.emit(t.text_v)}))},t.prototype.modelch=function(){var t=this;setTimeout((function(){t.onChange(t.text_v),t.change.emit(t.text_v)}))},t.prototype.ngAfterViewInit=function(){},t.prototype.writeValue=function(t){this.text_v=t},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}();Ht.decorators=[{type:n.Component,args:[{selector:"FHTextArea",providers:[Bt],template:'\n <mat-form-field [hidden]="hidden" appearance="outline" floatLabel="always" [class.fh_field]="enabled" [class.fh_field_dis]="!enabled"\n ><mat-label>{{ label }}</mat-label>\n <textarea\n matInput\n [rows]="rows"\n type="text"\n [(ngModel)]="text_v"\n [readonly]="!enabled"\n [required]="required"\n (focusout)="onFu()"\n (focusin)="onFi()"\n (ngModelChange)="modelch()"\n ></textarea>\n <mat-error *ngIf="error==null">{{ error }}</mat-error>\n </mat-form-field>\n ',styles:[""]}]}],Ht.ctorParameters=function(){return[]},Ht.propDecorators={hidden:[{type:n.Input}],label:[{type:n.Input}],enabled:[{type:n.Input}],required:[{type:n.Input}],rows:[{type:n.Input}],error:[{type:n.Input}],change:[{type:n.Output}],focusout:[{type:n.Output}],focusin:[{type:n.Output}]};var Yt=function(){function t(){}return t.prototype.agInit=function(t){this.params=t,this.value=this.params.value},t.prototype.getValue=function(){return this.value},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){null!=t.input&&null!=t.input.element&&null!=t.input.element.nativeElement&&t.input.element.nativeElement.focus()}))},t}();Yt.decorators=[{type:n.Component,args:[{selector:"checkbox-cell",template:' <FHCheckBox [(ngModel)]="value"> </FHCheckBox> '}]}],Yt.ctorParameters=function(){return[]},Yt.propDecorators={input:[{type:n.ViewChild,args:["input",{read:n.ViewContainerRef}]}]};var Qt=function(){function t(t,e,i){this.http=t,this.app_s=e,this.toastr=i,this.url=this.app_s.API_ENDPOINT+this.app_s.ODBC_ENDPOINT}return t.prototype.doQuery=function(t,e){var i=this;void 0===e&&(e=!0),this.headers=new r.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=this.app_s.API_ENDPOINT+this.app_s.ODBC_ENDPOINT;var n=JSON.stringify(t);return this.http.post(this.url,n,{headers:this.headers}).pipe(l.map((function(t){var n;if(t?"KO"===t.result_msg&&(n=new Error(t.msg)):n=new Error("Empty server response"),n)throw console.error(n),e&&i.toastr.error(n.message),new Error(n);return t||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t}();Qt.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new Qt(n.ɵɵinject(r.HttpClient),n.ɵɵinject(wt),n.ɵɵinject(i.ToastrService))},token:Qt,providedIn:"root"}),Qt.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],Qt.ctorParameters=function(){return[{type:r.HttpClient},{type:wt},{type:i.ToastrService}]};var Wt=function(){function t(t,e,i){this.http=t,this.app_s=e,this.toastr=i,this.url=this.app_s.API_ENDPOINT+this.app_s.APPMAKER_ENDPOINT}return t.prototype.doQuery=function(t,e){var i=this;void 0===e&&(e=!0),this.url=this.app_s.API_ENDPOINT+this.app_s.APPMAKER_ENDPOINT,this.headers=new r.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")});var n=JSON.stringify(t);return this.http.post(this.url,n).pipe(l.map((function(t){var n,o=t;if(t?"KO"===o.result_msg&&(n=new Error(o.msg)):n=new Error("Empty server response"),n)throw console.error(n),e&&i.toastr.error(n.message),new Error(n);return o||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.extractData=function(t){return t.json()||{}},t.prototype.handleError=function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";return console.error(e),_.Observable.throw(e)},t}();Wt.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new Wt(n.ɵɵinject(r.HttpClient),n.ɵɵinject(wt),n.ɵɵinject(i.ToastrService))},token:Wt,providedIn:"root"}),Wt.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],Wt.ctorParameters=function(){return[{type:r.HttpClient},{type:wt},{type:i.ToastrService}]};var Jt=function(){function t(t){this.uti_s=t,this.cancelBeforeStart=!1}return t.prototype.agInit=function(t){var e=this;this.params=t,"string"==typeof this.value?this.value=this.params.value:this.value=this.uti_s.format_currency(this.params.value),"1234567890,".indexOf(t.charPress)>=0?(this.value=t.charPress,setTimeout((function(){e.uti_s.setSelectionRange(e.input.element.nativeElement,1,String(e.value).length)}),100)):setTimeout((function(){e.uti_s.setSelectionRange(e.input.element.nativeElement,0,String(e.value).length)}),100),this.cancelBeforeStart=t.charPress&&"1234567890,".indexOf(t.charPress)<0},t.prototype.getValue=function(){if(""==String(this.value))return 0;var t=0;return null!=(t="string"==typeof this.value?parseFloat(this.value.split(".").join("").split(",").join(".")):this.value)?t:0},t.prototype.isCancelBeforeStart=function(){return this.cancelBeforeStart},t.prototype.isCancelAfterEnd=function(){return"string"==typeof this.value&&parseFloat(this.value.split(".").join("").split(",").join("."))>1e6},t.prototype.onKeyDown=function(t){this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault()},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){null!=t.input&&null!=t.input.element&&null!=t.input.element.nativeElement&&t.input.element.nativeElement.focus()}))},t.prototype.getCharCodeFromEvent=function(t){return void 0===(t=t||window.event).which?t.keyCode:t.which},t.prototype.isCharNumeric=function(t){return!!/\d/.test(t)},t.prototype.isKeyPressedNumeric=function(t){var e=this.getCharCodeFromEvent(t);if(8==e)return!0;if(188==e)return!0;if(e>=96&&e<=109)return!0;var i=String.fromCharCode(e);return this.isCharNumeric(i)},t}();Jt.decorators=[{type:n.Component,args:[{selector:"numeric-cell",template:'<input\n #input\n (keydown)="onKeyDown($event)"\n [(ngModel)]="value"\n style="fontSize:40;height:30px;"\n />'}]}],Jt.ctorParameters=function(){return[{type:Ct}]},Jt.propDecorators={input:[{type:n.ViewChild,args:["input",{read:n.ViewContainerRef}]}]};var $t=function(){function t(t,e,i,n){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.uti_s=n,this.res="",this.h=0,this.m=0}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.change=function(){this.res=this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.ok=function(){5==this.res.length?this.dialogRef.close(this.res):this.toastr.error("ERRORE","SELEZIONARE L'ORARIO",{timeOut:1e3,progressBar:!0,positionClass:"toast-bottom-right"})},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(null!=t.m_appService.getState().appo_dialog&&null!=t.m_appService.getState().appo_dialog.val){var e=t.m_appService.getState().appo_dialog.val.split(":");return t.h=parseInt(e[0]),t.m=parseInt(e[1]),void(t.res=t.m_appService.getState().appo_dialog.val)}}))},t}();$t.decorators=[{type:n.Component,args:[{selector:"fhtimeslider",template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <h2 mat-dialog-title style="min-width:300px">\n Seleziona Orario -> {{ res }}\n </h2>\n\n <mat-dialog-content style="font-size: 15px;"\n ><br /><br />\n <table>\n <tr>\n <td>Ore:</td>\n <td>\n <mat-slider\n [max]="23"\n (change)="change()"\n [min]="0"\n [step]="1"\n thumbLabel\n [(ngModel)]="h"\n >\n </mat-slider>\n </td>\n </tr>\n <tr>\n <td>Minuti:</td>\n <td>\n <mat-slider\n [max]="45"\n [min]="0"\n (change)="change()"\n [step]="15"\n thumbLabel\n [(ngModel)]="m"\n >\n </mat-slider>\n </td>\n </tr>\n </table>\n </mat-dialog-content>\n\n <mat-dialog-actions>\n <button mat-flat-button color="primary" (click)="ok()">OK</button>\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="dialogRef.close(\'\')"\n >\n CHIUDI\n </button>\n </mat-dialog-actions>\n '}]}],$t.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:wt},{type:Ct}]};var Xt={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Zt})),multi:!0},Zt=function(){function t(t,e,i,o,s){this._dataService=t,this.dialog=e,this.m_appService=i,this.toastr=o,this.uti_s=s,this.maxore=23,this.label="",this.enabled=!0,this.vertical=!1,this.label_hh="",this.label_mm="",this.step=1,this.arr_hh=["0","1","2","3","4","5","6","7","8","9","10"],this.arr_mm=["0","10","15","30","45"],this.show_picker=!1,this.selchange=new n.EventEmitter,this.h=0,this.m=0,this.res="",this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.setta_h=function(t){this.h=parseInt(t)},t.prototype.setta_m=function(t){this.m=parseInt(t)},t.prototype.uph=function(){this.h<this.maxore&&this.h++,this.sc()},t.prototype.doh=function(){this.h>0&&this.h--,this.sc()},t.prototype.upm=function(){var t=parseInt(this.m+"")+parseInt(this.step+"");console.log("upm ",this.m,parseInt(this.m+""),t),t<60&&(this.m=t),this.sc()},t.prototype.dom=function(){console.log("dom ",this.m,parseInt(this.m+""),parseInt(this.m+"")-this.step),parseInt(this.m+"")-this.step>=0&&(this.m=parseInt(this.m+"")-this.step),this.sc()},t.prototype.onFu=function(){this.h>this.maxore&&(this.h=this.maxore),this.sc()},t.prototype.onMi=function(){this.m>59&&(this.m=59),this.m=Math.round(this.m/this.step)*this.step,60==this.m&&(this.m=60-this.step),this.sc()},t.prototype.onKeyDown=function(t){this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault(),this.sc()},t.prototype.onKeyDown1=function(t){this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault(),this.sc()},t.prototype.resetValue=function(){this.h=0,this.m=0},t.prototype.annulla=function(){this.show_picker=!1},t.prototype.ok=function(){0!=this.h||0!=this.m?this.sc():this.toastr.error("ERRORE","SELEZIONARE L'ORARIO",{timeOut:1e3,progressBar:!0,positionClass:"toast-bottom-right"})},t.prototype.change=function(){this.res=this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.setByDescri=function(t){null==t&&(t="00:00"),""==t&&(t="00:00"),-1==t.indexOf(":")&&(t="00:00");var e=t.split(":");this.h=parseInt(e[0]),this.m=Math.round(parseInt(e[1])/this.step)*this.step,60==this.m&&(this.m=60-this.step),5!=t.length&&this.onChange(this.getValue())},t.prototype.isValidVal=function(){return!0},t.prototype.setByValue=function(t){this.setByDescri(t)},t.prototype.setValue=function(t){this.setByDescri(t)},t.prototype.getDescri=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getData=function(t){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getObj=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getValue=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getHours=function(){return this.h},t.prototype.getMinutes=function(){return this.m},t.prototype.ngAfterViewInit=function(){},t.prototype.sc=function(){var t=this;setTimeout((function(){var e=t.getValue();t.selchange.emit(),console.log("sc ",e),t.onChange(e)}),200)},t.prototype.isCharNumeric=function(t){return!!/\d/.test(t)},t.prototype.getCharCodeFromEvent=function(t){return void 0===(t=t||window.event).which?t.keyCode:t.which},t.prototype.isKeyPressedNumeric=function(t){return-1!=="0123456789".indexOf(t.key)||"ArrowRight"==t.key||"ArrowLeft"==t.key||"ArrowDown"==t.key||"ArrowUp"==t.key||"Backspace"==t.key||9==t.keyCode},t.prototype.writeValue=function(t){this.setByValue(t)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}();Zt.decorators=[{type:n.Component,args:[{selector:"FHTimePicker",providers:[Xt],template:'\n <div fxLayout="row" fxLayoutAlign="center center" [hidden]="vertical && enabled" >\n <b>{{ label }}</b\n > \n <div fxLayout="column" fxLayoutAlign="center center">\n <div *ngIf="enabled" >\n <mat-icon (click)="uph()">keyboard_arrow_up</mat-icon>\n </div>\n\n <input\n style="width:40px;text-align:center;"\n (keydown)="onKeyDown($event)"\n (focusout)="onFu()"\n [disabled]="!enabled"\n [(ngModel)]="h"\n\n\n />\n <div *ngIf="enabled">\n <mat-icon (click)="doh()"\n >keyboard_arrow_down</mat-icon\n >\n </div>\n </div>\n\n <b style="font-size:28px">:</b> \n\n <div fxLayout="column" fxLayoutAlign="center center">\n <div *ngIf="enabled">\n <mat-icon (click)="upm()"\n >keyboard_arrow_up</mat-icon\n >\n </div>\n\n <input\n\n step="step"\n style="width:40px;text-align:center;"\n (keydown)="onKeyDown1($event)"\n (focusout)="onMi()"\n [disabled]="!enabled"\n [(ngModel)]="m"\n\n />\n <div *ngIf="enabled" style="pointer_mouse">\n <mat-icon (click)="dom()"\n style="pointer_mouse" >keyboard_arrow_down</mat-icon\n >\n </div>\n </div>\n </div>\n\n\n <div fxLayout="column" [hidden]="!vertical || !enabled">\n <div fxLayout="row" fxLayoutAlign="start center">\n <b style="min-width:70px">{{ label_hh }}</b>\n <div fxLayout="column" fxLayoutAlign="start center" fxLayoutGap="0px">\n\n <div fxLayout="row" fxLayoutAlign="start center"> \n <div fxLayout="column" fxLayoutAlign="start center" fxLayoutGap="0px">\n <div *ngIf="enabled" >\n <mat-icon (click)="uph()">keyboard_arrow_up</mat-icon>\n </div>\n\n <input\n style="width:40px;text-align:center;"\n (keydown)="onKeyDown($event)"\n (focusout)="onFu()"\n [disabled]="!enabled"\n [(ngModel)]="h"\n\n />\n <div *ngIf="enabled" style="pointer_mouse">\n <mat-icon (click)="doh()"\n style="pointer_mouse">keyboard_arrow_down</mat-icon\n >\n </div>\n </div>\n \n <div *ngFor="let u of arr_hh" [hidden]="!enabled">\n <button mat-flat-button color="primary" (click)="setta_h(u)" class="pad_b">\n {{u}}\n </button> \n </div>\n </div>\n\n </div>\n </div>\n\n\n\n <div fxLayout="row" fxLayoutAlign="start center">\n <b style="min-width:70px">{{ label_mm }}</b>\n <div fxLayout="column" fxLayoutAlign="start center" fxLayoutGap="0px">\n\n <div fxLayout="row" fxLayoutAlign="start center"> \n <div fxLayout="column" fxLayoutAlign="start center" fxLayoutGap="0px">\n <div *ngIf="enabled" style="pointer_mouse">\n <mat-icon (click)="upm()" style="pointer_mouse">keyboard_arrow_up</mat-icon>\n </div>\n\n <input\n style="width:40px;text-align:center;"\n (keydown)="onKeyDown1($event)"\n (focusout)="onMi()"\n [disabled]="!enabled"\n [(ngModel)]="m"\n\n step="step"\n\n />\n <div *ngIf="enabled" style="pointer_mouse">\n <mat-icon (click)="dom()" style="pointer_mouse"\n >keyboard_arrow_down</mat-icon\n >\n </div>\n </div>\n \n <div *ngFor="let u of arr_mm" [hidden]="!enabled">\n <button mat-flat-button color="primary" (click)="setta_m(u)" class="pad_b">\n {{u}}\n </button> \n </div>\n </div>\n\n </div>\n </div>\n </div>\n\n ',styles:["\n.pad_b {\n padding-left: 5px !important;\n padding-right: 5px !important;\n padding-top: 0px !important;\n padding-bottom: 0px !important;\n min-width: 30px !important;\n min-height: 8px !important;\n font-size:14px !important;\n}\n\n .hhh {\n height: 63px;\n width: 100px;\n background-color: rgba(255, 0, 0, 0.1);\n }\n\n .pointer_mouse {\n cursor: pointer;\n user-select: none;\n }\n "]}]}],Zt.ctorParameters=function(){return[{type:Dt},{type:e.MatDialog},{type:wt},{type:i.ToastrService},{type:Ct}]},Zt.propDecorators={maxore:[{type:n.Input}],label:[{type:n.Input}],enabled:[{type:n.Input}],vertical:[{type:n.Input}],label_hh:[{type:n.Input}],label_mm:[{type:n.Input}],step:[{type:n.Input}],arr_hh:[{type:n.Input}],arr_mm:[{type:n.Input}],selchange:[{type:n.Output}]};var te=function(){function t(){}return t.prototype.agInit=function(t){this.params=t},t.prototype.refresh=function(){return!0},t}();te.decorators=[{type:n.Component,args:[{selector:"currency-cell",template:'{{ params.value | currency: "EUR" }}'}]}];var ee=function(){function t(t,e,i,n){this.toastr=t,this.http=e,this.router=i,this.app_s=n,this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT,this.goto_after="",this.username="",this.headers=new r.HttpHeaders({"Content-Type":"application/json"})}return t.prototype.logout=function(){this.app_s.user=null,this.app_s.user_name=null,this.app_s.user_surname=null,this.app_s.user_idp=null,this.app_s.user_email=null,this.app_s.user_roles=null,this.app_s.user_lang=null,this.app_s.user_isadmin=null,this.app_s.token=null,localStorage.removeItem(this.app_s.COMPANY_KEY+"token"),this.goto_after="",1!=this.app_s.LOGIN_EXT?this.router.navigate(["login"]):window.location.href=this.app_s.LOGOUT_URL_EXT},t.prototype.login=function(t,e,i){var n=this;void 0===i&&(i=!0),this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT;var o=JSON.stringify({username:t,password:e});return 1==this.app_s.LDAP_AUTH&&(o=JSON.stringify({username:t,password:e,ldap_auth:1})),this.http.post(this.url,o,{headers:this.headers}).pipe(l.map((function(t){var e;if(t?"KO"===t.result_msg?e=new Error(t.msg):t.result_data.length>0&&localStorage.setItem(n.app_s.COMPANY_KEY+"token",t.result_data[0].token):e=new Error("Empty server response"),e)throw console.error(e),i&&n.toastr.error(e.message),new Error(e);return t||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.register_user=function(t,e,i,n,o,s,a){var r=this;void 0===a&&(a=!0),this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT+"_register";var p=JSON.stringify({name:t,surname:e,email:i,password:o,username:n,add_role:s});return this.http.post(this.url,p,{headers:this.headers}).pipe(l.map((function(t){var e;if(t?"KO"===t.result_msg?e=new Error(t.msg):t.result_data.length>0&&localStorage.setItem(r.app_s.COMPANY_KEY+"token",t.result_data[0].token):e=new Error("Empty server response"),e)throw console.error(e),a&&r.toastr.error(e.message),new Error(e);return t||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.login_by_email=function(t,e){var i=this;void 0===e&&(e=!0),this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT+"_email";var n=JSON.stringify({email:t});return 1==this.app_s.LDAP_AUTH&&(n=JSON.stringify({email:t})),this.http.post(this.url,n,{headers:this.headers}).pipe(l.map((function(t){var n;if(t?"KO"===t.result_msg?n=new Error(t.msg):t.result_data.length>0&&localStorage.setItem(i.app_s.COMPANY_KEY+"token",t.result_data[0].token):n=new Error("Empty server response"),n)throw console.error(n),e&&i.toastr.error(n.message),new Error(n);return t||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.get_user_info=function(t,e){var i=this;void 0===e&&(e=!0),this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT;var n=JSON.stringify({username_info:t});return this.http.post(this.url,n,{headers:this.headers}).pipe(l.map((function(t){var n;if(t?"KO"===t.result_msg&&(n=new Error(t.msg)):n=new Error("Empty server response"),n)throw console.error(n),e&&i.toastr.error(n.message),new Error(n);return t||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.passrecovery=function(t,e){var i=this;void 0===e&&(e=!0);var n=JSON.stringify({email:t,websiteroot:this.app_s.COMPANY_SITE_ROOT,op:"send_email"});return this.http.post(this.app_s.API_ENDPOINT+this.app_s.PASSRECOVERY_ENDPOINT,n,{headers:this.headers}).pipe(l.map((function(t){var n;if(t?"KO"===t.result_msg&&(n=new Error(t.msg)):n=new Error("Empty server response"),n)throw console.error(n),e&&i.toastr.error(n.message),new Error(n);return t||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.checktoken=function(t,e){var i=this;void 0===e&&(e=!0);var n=JSON.stringify({res_rep:t,op:"check_token"});return this.http.post(this.app_s.API_ENDPOINT+this.app_s.PASSRECOVERY_ENDPOINT,n,{headers:this.headers}).pipe(l.map((function(t){var n;if(t?"KO"===t.result_msg&&(n=new Error(t.msg)):n=new Error("Empty server response"),n)throw console.error(n),e&&i.toastr.error(n.message),new Error(n);return t||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.change_password=function(t,e,i){var n=this;void 0===i&&(i=!0);var o=JSON.stringify({token:t,password:e,op:"change_password"});return this.http.post(this.app_s.API_ENDPOINT+this.app_s.PASSRECOVERY_ENDPOINT,o,{headers:this.headers}).pipe(l.map((function(t){var e;if(t?"KO"===t.result_msg&&(e=new Error(t.msg)):e=new Error("Empty server response"),e)throw console.error(e),i&&n.toastr.error(e.message),new Error(e);return t||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.checkCredentials_toLogin=function(){return"/login"!=this.router.url&&-1==this.router.url.indexOf("/rp/")&&(this.goto_after=window.location.toString()),null!==localStorage.getItem(this.app_s.COMPANY_KEY+"token")||(-1==this.router.url.indexOf("/rp/")&&this.router.navigate(["login"]),!1)},t.prototype.checkCredentials=function(){return"/login"!=this.router.url&&-1==this.router.url.indexOf("/rp/")&&(this.goto_after=window.location.toString()),null!==localStorage.getItem(this.app_s.COMPANY_KEY+"token")},t}();ee.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new ee(n.ɵɵinject(i.ToastrService),n.ɵɵinject(r.HttpClient),n.ɵɵinject(d.Router),n.ɵɵinject(wt))},token:ee,providedIn:"root"}),ee.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],ee.ctorParameters=function(){return[{type:i.ToastrService},{type:r.HttpClient},{type:d.Router},{type:wt}]};var ie=function(){function t(t,e,i,n){var o=this;this.dialogRef=t,this._fileservice=e,this.m_appService=i,this.data=n,this.allegati=[],this.App="",this.K="",this.Filename="",this.email_obj={},this.title="ANTEPRIMA EMAIL",this.App=n.App,this.K=n.K,this.Filename=n.Filename;var s=new gt;s.command="exec_app",s.p1="Email_Reader",s.p2=n.App+"|"+n.K+"|"+n.Filename,this._fileservice.doQuery(s).subscribe((function(t){o.email_obj=JSON.parse(t.msg),o.allegati=o.email_obj.allegati.split("||")}))}return t.prototype.init_w=function(){},t.prototype.open_eml=function(){window.open(this.m_appService.COMPANY_SITE_ROOT+"/uploads/"+this.App+"/"+this.K+"/"+this.Filename)},t.prototype.open_all=function(t){window.open(this.m_appService.COMPANY_SITE_ROOT+"/uploads/"+this.App+"/"+this.K+"/ant/"+t)},t}();ie.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="dialogRef.close(null)" /> </div><br>\n <div style="width:100%;overflow:auto;" [style.height]="(m_appService.getState().body_h-240)+\'px\'">\n <mat-toolbar color="primary">{{title | translate}}\n <span class="fill-remaining-space"></span>\n\n </mat-toolbar>\n <br>\n\n <div style="width:100%;height:500px">\n <div style="width:100%;height:100%">\n <div fxLayout="column">\n <div fxLayout="row">\n <div style="width:100px">Data:</div>\n <div>{{email_obj.dt}}</div>\n </div>\n <div fxLayout="row">\n <div style="width:100px">From:</div>\n <div [innerHTML]="email_obj.from" ></div>\n </div>\n <div fxLayout="row">\n <div style="width:100px">To:</div>\n <div [innerHTML]="email_obj.to" ></div>\n </div>\n <div fxLayout="row">\n <div style="width:100px">CC:</div>\n <div [innerHTML]="email_obj.cc" ></div>\n </div>\n <div fxLayout="row">\n <div style="width:100px">Subject:</div>\n <div [innerHTML]="email_obj.subject" ></div>\n </div>\n <div style="width:100px">Body:</div>\n <div style="overflow:auto;" [style.height]="(m_appService.getState().body_h-490)+\'px\'">\n <div fxLayout="row" [hidden]="email_obj.is_html==\'NO\'">\n\n <div [innerHTML]="email_obj.body" ></div>\n </div>\n <div fxLayout="row" [hidden]="email_obj.is_html==\'SI\'">\n\n <div>{{email_obj.body}}</div>\n </div>\n </div>\n <hr style="width:100%">\n <div fxLayout="row" fxLayoutGap="15px">\n <div style="width:100px">Download Eml:</div>\n <button mat-flat-button color="primary" (click)="open_eml()">Download</button>\n <div> </div>\n <div style="width:100px">Allegati:</div>\n <div *ngFor="let u of allegati" >\n <button mat-flat-button color="primary" (click)="open_all(u)">{{u}}</button>\n </div>\n\n\n\n </div>\n\n\n </div>\n </div>\n </div>\n '}]}],ie.ctorParameters=function(){return[{type:e.MatDialogRef},{type:Tt},{type:wt},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var ne=function(){function t(t,e,i,o,s,a,r){this._appservice=t,this._dataService=e,this.toastr=i,this.dialog=o,this.auth_s=s,this.uti=a,this._trs=r,this.show_version=!1,this.enabled=!0,this.force_en=!1,this.show_dim=!0,this.show_descri=!0,this.label="",this.sovrascrivi_path="",this.ruolo_supervisore="[ZZZ_DIS_CC]",this.access_control=!1,this.show_images=!0,this.can_delete_owner=!0,this.show_upload=!0,this.show_download=!0,this.description_required=!1,this.selezionare_tipologia="Selezionare la Tipologia",this.b_initt=!1,this.expand=new n.EventEmitter,this.file_copy=new n.EventEmitter,this.change=new n.EventEmitter,this.call_upload=new n.EventEmitter,this.init_end=new n.EventEmitter,this.App="",this.K="",this.image_type=!1,this.b_edit_loaded=!1,this.current_v=-1,this.b_False=!1,this.b_mobile=!1,this.b_ini=!1,this.m_p_tipo="",this.multi_list=!1,this.m_programma_da_eseguire=""}return t.prototype.set_curr_version=function(t){this.show_version=!0,this.current_v=t},t.prototype.output_ris=function(t){if(null!=t&&null!=t.response){var e=JSON.parse(t.response);console.log(e),null!=e&&null!=e.msg&&""!=e.msg&&("KO"==e.result_msg&&this.toastr.error(e.msg),"OK"==e.result_msg&&this.toastr.info(e.msg))}},t.prototype.call_up=function(t){this.call_upload.emit({App:this.App,K:this.K,descrizione:t.descrizione,single:!1,username:this._appservice.user,tipo:this.m_p_tipo,local_path:this._appservice.LOCAL_PATH,p1:this.m_programma_da_eseguire,ver:this.current_v})},t.prototype.preview_email=function(t){this.dialog.open(ie,{data:{App:t.App,K:t.K,Filename:t.Filename},width:"95%"}).afterClosed().subscribe((function(t){}))},t.prototype.download_all=function(t){null!=t.APP&&(t.App=t.APP),""==this.sovrascrivi_path?window.open(this._appservice.COMPANY_SITE_ROOT+"/uploads/"+t.App+"/"+t.K+"/"+t.Filename):window.open(this.sovrascrivi_path+"/uploads/"+t.App+"/"+t.K+"/"+t.Filename)},t.prototype.edit_tipo=function(t){var e=this,i=new vt;i.sql=this.m_p_tipo,i.types=[],i.values=[],this._dataService.doQuery(i).subscribe((function(i){if(null!=i&&"OK"==i.result_msg){var n=e.dialog.open(yt,{width:"650px"});setTimeout((function(){n.componentInstance.set_selection("Tipologia Allegato",i.result_data)})),n.afterClosed().subscribe((function(i){if(null!=i){var n=new vt;n.sql="UPDATE_ALLEGATI_TIPO",n.types=["int","string"],n.values=[t.id,i.descrizione_valore],e._dataService.doQuery(n).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.ref_allegato()}))}}))}}))},t.prototype.edit_descri=function(t){var e=this,i=this.dialog.open(bt);setTimeout((function(){i.componentInstance.label=e._trs.instant("Descrizione Allegato"),i.componentInstance.valore=t.descrizione,i.componentInstance.min_chars=0})),i.afterClosed().subscribe((function(i){if(null!=i){var n=new vt;n.sql="UPDATE_ALLEGATI_DESCRIZIONE",n.types=["int","string"],n.values=[t.id,i],e._dataService.doQuery(n).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.ref_allegato()}))}}))},t.prototype.delete=function(t){var e=this;localStorage.setItem(this._appservice.COMPANY_KEY+"title_dialog",this._trs.instant("Conferma Operazione")),localStorage.setItem(this._appservice.COMPANY_KEY+"msg_dialog",this._trs.instant("Confermi l'eliminazione dell'elemento?")),this.dialog.open(It).afterClosed().subscribe((function(i){if(i){var n=new vt;n.sql="DELETE_ALLEGATO",n.types=["int","string"],n.values=[t.id,e.auth_s.username],e._dataService.doQuery(n).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(e.ref_allegato(),e.toastr.info(e._trs.instant("INFO"),e._trs.instant("ALLEGATO ELIMINATO"),{timeOut:1e3,progressBar:!0}))}))}}))},t.prototype.load_component=function(){var t=this;setTimeout((function(){t.upc.single=!1,t.b_mobile=t._appservice.getState().pageFullscreen,t.force_en?t.upc.init(t.App,t.K,t._trs.instant("Attachment Description"),t.m_p_tipo,t.m_programma_da_eseguire,!1,!1,!0,t.current_v):t.upc.init(t.App,t.K,t._trs.instant("Descrizione Allegato"),t.m_p_tipo,t.m_programma_da_eseguire,!1,!1,!0,t.current_v),t.m_p_tipo.indexOf("SELECT_")>-1&&(t.multi_list=!0),t.ref_allegato()})),"[ZZZ_DIS_CC]"!=this.ruolo_supervisore&&(this.access_control=!0),null==this._appservice.user_lang&&(this._appservice.user_lang="it"),"en"==this._appservice.user_lang.toLocaleLowerCase()&&(this.force_en=!0)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.b_initt=!0,t.init_end.emit()}),700),this.load_component()},t.prototype.init=function(t,e,i,n){void 0===i&&(i=""),void 0===n&&(n=""),this.App=t,this.K=e,this.b_ini=!0,this.b_edit_loaded=!1,this.m_p_tipo=i,this.m_programma_da_eseguire=n,this.load_component()},t.prototype.do_upload=function(t,e,i,n,o){this.upc.init(t,e,i,n,o,!1,!0,this.show_upload)},t.prototype.ref_allegato=function(){var t=this;if(null!=this.App&&""!=this.App){var e=new vt;e.sql="SELECT_ALLEGATO_INFO",e.types=["string","string"],e.values=[this.App,this.K],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.arr_g=e.result_data;for(var i="webinfo",n=0;n<t.arr_g.length;n++){null!=t.arr_g[n].APP&&(t.arr_g[n].App=t.arr_g[n].APP),null!=t.arr_g[n].descrizione?t.arr_g[n].descrizione_vis=t.arr_g[n].descrizione.split("\n").join("<br>"):t.arr_g[n].descrizione_vis="";var o=t.arr_g[n].Filename.split(".");if(""==t.sovrascrivi_path?(t.arr_g[n].url=t._appservice.COMPANY_SITE_ROOT+"/uploads/"+t.arr_g[n].App+"/"+t.arr_g[n].K+"/"+t.arr_g[n].Filename,t.arr_g[n].url_orig=t._appservice.COMPANY_SITE_ROOT+"/uploads/"+t.arr_g[n].App+"/"+t.arr_g[n].K+"/"+t.arr_g[n].Filename):(t.arr_g[n].url=t.sovrascrivi_path+"/uploads/"+t.arr_g[n].App+"/"+t.arr_g[n].K+"/"+t.arr_g[n].Filename,t.arr_g[n].url_orig=t.sovrascrivi_path+"/uploads/"+t.arr_g[n].App+"/"+t.arr_g[n].K+"/"+t.arr_g[n].Filename),-1!="3G2|3GA|3GP|7Z|AA|AAC|AC|ACCDB|ACCDT|ADN|AI|AIF|AIFC|AIFF|AIT|AMR|ANI|APK|APP|APPLESCRIPT|ASAX|ASC|ASCX|ASF|ASH|ASHX|ASMX|ASP|ASPX|ASX|AU|AUP|AVI|AXD|AZE|BAK|BASH|BAT|BIN|BLANK|BMP|BOWERRC|BPG|BROWSER|BZ2|C|CAB|CAD|CAF|CAL|CD|CER|CFG|CFM|CFML|CGI|CLASS|CMD|CODEKIT|COFFEE|COFFEELINTIGNORE|COM|COMPILE|CONF|CONFIG|CPP|CPTX|CR2|CRDOWNLOAD|CRT|CRYPT|CS|CSH|CSON|CSPROJ|CSS|CSV|CUE|DAT|DB|DBF|DEB|DGN|DIST|DIZ|DLL|DMG|DNG|DOC|DOCB|DOCM|DOCX|DOT|DOTM|DOTX|DOWNLOAD|DPJ|DS_STORE|DTD|DWG|DXF|EDITORCONFIG|EL|ENC|EOT|EPS|EPUB|ESLINTIGNORE|EXE|F4V|FAX|FB2|FLA|FLAC|FLV|FOLDER|GADGET|GDP|GEM|GIF|GITATTRIBUTES|GITIGNORE|GO|GPG|GZ|H|HANDLEBARS|HBS|HEIC|HS|HSL|HTM|HTML|IBOOKS|ICNS|ICO|ICS|IDX|IFF|IFO|IMAGE|IMG|IN|INDD|INF|INI|ISO|J2|JAR|JAVA|JPE|JPEG|JPG|JS|JSON|JSP|JSX|KEY|KF8|KMK|KSH|KUP|LESS|LEX|LICX|LISP|LIT|LNK|LOCK|LOG|LUA|M|M2V|M3U|M3U8|M4|M4A|M4R|M4V|MAP|MASTER|MC|MD|MDB|MDF|ME|MI|MID|MIDI|MK|MKV|MM|MO|MOBI|MOD|MOV|MP2|MP3|MP4|MPA|MPD|MPE|MPEG|MPG|MPGA|MPP|MPT|MSI|MSU|NEF|NES|NFO|NIX|NPMIGNORE|ODB|ODS|ODT|OGG|OGV|OST|OTF|OTT|OVA|OVF|P12|P7B|PAGES|PART|PCD|PDB|PDF|PEM|PFX|PGP|PH|PHAR|PHP|PKG|PL|PLIST|PM|PNG|PO|POM|POT|POTX|PPS|PPSX|PPT|PPTM|PPTX|PROP|PS|PS1|PSD|PSP|PST|PUB|PY|PYC|QT|RA|RAM|RAR|RAW|RB|RDF|RESX|RETRY|RM|ROM|RPM|RSA|RSS|RTF|RU|RUB|SASS|SCSS|SDF|SED|SH|SITEMAP|SKIN|SLDM|SLDX|SLN|SOL|SQL|SQLITE|STEP|STL|SVG|SWD|SWF|SWIFT|SYS|TAR|TCSH|TEX|TFIGNORE|TGA|TGZ|TIF|TIFF|TMP|TORRENT|TS|TSV|TTF|TWIG|TXT|UDF|VB|VBPROJ|VBS|VCD|VCS|VDI|VDX|VMDK|VOB|VSCODEIGNORE|VSD|VSS|VST|VSX|VTX|WAR|WAV|WBK|WEBINFO|WEBM|WEBP|WMA|WMF|WMV|WOFF|WOFF2|WPS|WSF|XAML|XCF|XLM|XLS|XLSM|XLSX|XLT|XLTM|XLTX|XML|XPI|XPS|XRB|XSD|XSL|XSPF|XZ|YAML|YML|Z|ZIP|ZSH".indexOf(o[o.length-1].toLocaleUpperCase())&&(i=o[o.length-1].toLocaleLowerCase()),t.arr_g[n].icon=i+".svg",t.can_delete_owner?(t.arr_g[n].can_delete=!t.access_control||t.arr_g[n].idp==t._appservice.user||t.uti.hasRole(t.ruolo_supervisore),"[ZZZ_DIS_CC]"==t.ruolo_supervisore?t.arr_g[n].can_delete_m=t.arr_g[n].idp:t.arr_g[n].can_delete_m=t.arr_g[n].idp+",["+t.ruolo_supervisore+"]"):(t.arr_g[n].can_delete=!t.access_control||t.uti.hasRole(t.ruolo_supervisore),"[ZZZ_DIS_CC]"==t.ruolo_supervisore?t.arr_g[n].can_delete_m="":t.arr_g[n].can_delete_m="["+t.ruolo_supervisore+"]"),t.arr_g[n].can_edit=!t.access_control||t.arr_g[n].idp==t._appservice.user||t.uti.hasRole(t.ruolo_supervisore),-1==t.arr_g[n].Filename.indexOf(".jpg")&&-1==t.arr_g[n].Filename.indexOf(".gif")&&-1==t.arr_g[n].Filename.indexOf(".png")||!t.show_images)t.arr_g[n].type="O";else{if(t.arr_g[n].type="IMG",t.arr_g[n].image_original=[t.arr_g[n].url],null!=t.arr_g[n].preview&&1==t.arr_g[n].preview){var s=t.arr_g[n].url.split("."),a=s.pop();t.arr_g[n].url=s.join(".")+"_preview."+a}t.image_type=!0,t.arr_g[n].image_thumbnail=[t.arr_g[n].url]}}t.change.emit()}}))}},t}();ne.decorators=[{type:n.Component,args:[{selector:"FHUploadPanel",template:'\n <div fxLayout="column">\n <h3 *ngIf="label != \'\'">{{ label }}</h3>\n <div fxLayout="column">\n\n <div [hidden]="!enabled || !show_upload">\n\n <FHUpload\n [single]="false"\n [selezionare_tipologia]="selezionare_tipologia "\n [lascia_il_file] = "force_en ? \'Drop here to confim\':\'Lascia il file per confermarmare upload\' "\n [trascina_il_file] = "force_en ? \'Drop a file here o click to upload a file\':\'Trascina un file qui o Clicca per avviare upload\' "\n\n [show_descri]="show_descri"\n [descri_obb]="description_required"\n [label_attendere]="\n force_en ? \'UPLOADING\' : \'ATTENDERE UPLOAD IN CORSO\'\n "\n [fixed_label]="\n force_en\n ? \' (insert the description here before uploading the file)\'\n : \' (INSERISCI QUI LA DESCRIZIONE PRIMA DI CARICARE IL FILE)\'\n "\n [allegato_inserito]="\n force_en ? \'Attachment Inserted\' : \'ALLEGATO INSERITO\'\n "\n [lista_allegati]="arr_g"\n (change)="ref_allegato();output_ris($event)"\n (call_upload)="call_up($event)"\n #upc\n ></FHUpload>\n\n </div>\n <table width="98%" class="fh_table" *ngIf="!image_type && !b_mobile">\n <thead>\n <tr class="header">\n <th style="width:40px" class="actions" *ngIf="show_download"></th>\n <th [fxShow.lt-sm]="false" style="width:40px"></th>\n <th style="width:50%">{{ force_en ? "Name" : "Nome" }}</th>\n <th [fxShow.lt-sm]="false" *ngIf="show_version" style="width:30px;text-align:center">Ver.</th>\n <th [fxShow.lt-sm]="false" *ngIf="show_dim" style="width:30px;text-align:center">Dim.</th>\n <th [fxShow.lt-sm]="false" *ngIf="show_descri" style="width:40%">\n {{ force_en ? "Description" : "Descrizione" }}\n </th>\n <th *ngIf="multi_list" style="width:20%">\n {{ force_en ? "Type" : "Tipo" }}\n </th>\n\n <th style="width:40px" class="actions"></th>\n <th [fxShow.lt-sm]="false" style="width:30%">{{ force_en ? "User" : "Utente" }}</th>\n <th [fxShow.lt-sm]="false" style="width:240px;text-align:center">\n {{ force_en ? "Date" : "Data" }}\n </th>\n\n <th *ngIf="enabled" style="width:40px" class="actions"></th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="let app of arr_g; let odd = odd; let even = even"\n style="font-size: 15px;"\n [ngClass]="{ odd: odd, even: even }"\n >\n <td style="text-align:center" *ngIf="show_download">\n\n <button [hidden]="app.Filename.indexOf(\'.eml\')==-1 && app.Filename.indexOf(\'.msg\')==-1"\n mat-icon-button\n [matTooltip]="\'Preview\' "\n (click)="preview_email(app)"\n >\n <mat-icon>visibility</mat-icon>\n </button>\n <button\n mat-icon-button\n [matTooltip]="\'Download File\' "\n (click)="download_all(app)"\n >\n <mat-icon>cloud_download</mat-icon>\n </button>\n </td>\n <td [fxShow.lt-sm]="false"\n style="text-align:center;vertical-align: middle;width:36px;height:36px;" (click)="download_all(app)"\n >\n <div\n style="text-align:center;vertical-align: middle;width:28px;height:28px;"\n >\n <img\n src="assets/icons/square-o/{{ app.icon }}"\n style="width:28px;height:28px;"\n />\n </div>\n </td>\n <td><button mat-stroked-button color="primary" (click)="download_all(app)">{{ app.Filename }}</button></td>\n <td style="text-align:center" *ngIf="show_version" [fxShow.lt-sm]="false">{{ app.v }}</td>\n <td style="text-align:center" *ngIf="show_dim" [fxShow.lt-sm]="false">{{ app.Filesize }}</td>\n <td [fxShow.lt-sm]="false" *ngIf="show_descri">\n <div fxLayout="row">\n <div *ngIf="enabled">\n <a\n mat-icon-button\n [matTooltip]="\'Modifica Descrizione\' | translate"\n *ngIf="app.can_edit"\n (click)="edit_descri(app)"\n >\n <mat-icon>edit</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]="\n _trs.instant(\'Modifica Descrizione consentita solo a\') +\': \' + app.nc\n "\n *ngIf="!app.can_edit"\n [disabled]="true"\n >\n <mat-icon>edit</mat-icon>\n </a>\n </div>\n <div\n [innerHTML]="app.descrizione_vis"\n style="width:100%"\n ></div>\n </div>\n </td>\n\n <td *ngIf="multi_list">\n <div fxLayout="row">\n <a\n mat-icon-button\n [matTooltip]="\'Modifica Tipo\' | translate"\n *ngIf="app.can_edit"\n (click)="edit_tipo(app)"\n >\n <mat-icon>edit</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]="\n _trs.instant(\'Modifica Tipologia consentita solo a\')+\': \' + app.nc\n "\n *ngIf="!app.can_edit"\n [disabled]="true"\n >\n <mat-icon>edit</mat-icon>\n </a>\n\n <div [innerHTML]="app.tipo" style="width:100%"></div>\n </div>\n </td>\n\n <td\n style="min-width:400px;min-height: 400px"\n *ngIf="app.type == \'IMG\'"\n >\n <fh-image-viewer [u]="app"></fh-image-viewer>\n </td>\n <td *ngIf="app.type != \'IMG\'"></td>\n <td [fxShow.lt-sm]="false">{{ app.nc }}</td>\n <td [fxShow.lt-sm]="false" style="text-align:center">\n {{ app.dt_ins | date: "dd/MM/yyyy HH:mm:ss" }}\n </td>\n\n\n <td *ngIf="enabled" style="text-align:center">\n <a\n mat-icon-button\n [matTooltip]="\'Elimina File\' "\n *ngIf="app.can_delete"\n (click)="delete(app)"\n >\n <mat-icon>delete</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]="\n _trs.instant(\'Eliminazione consentita solo a\')+\': \' + app.can_delete_m\n "\n *ngIf="!app.can_delete"\n [disabled]="true"\n >\n <mat-icon>delete</mat-icon>\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n <table width="98%" class="fh_table" *ngIf="image_type && !b_mobile">\n <thead>\n <tr class="header">\n <th style="width:40px" class="actions" *ngIf="show_download"></th>\n <th [fxShow.lt-sm]="false" style="width:40px"></th>\n <th [fxShow.lt-sm]="false" style="width:50%">{{ force_en ? "Name" : "Nome" }}</th>\n <th [fxShow.lt-sm]="false" *ngIf="show_version" style="width:30px;text-align:center">Ver.</th>\n <th [fxShow.lt-sm]="false" *ngIf="show_dim" style="width:30px;text-align:center">Dim.</th>\n\n <th [fxShow.lt-sm]="false" style="width:20%" *ngIf="show_descri">\n {{ force_en ? "Description" : "Descrizione" }}\n </th>\n <th *ngIf="multi_list" style="width:10%" [fxShow.lt-sm]="false">\n {{ force_en ? "Type" : "Tipo" }}\n </th>\n <th style="width:40%"></th>\n\n <th [fxShow.lt-sm]="false" style="width:10%">{{ force_en ? "User" : "Utente" }}</th>\n <th [fxShow.lt-sm]="false" style="width:240px;text-align:center">\n {{ force_en ? "Date" : "Data" }}\n </th>\n\n <th *ngIf="enabled" style="width:40px" class="actions"></th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="let app of arr_g; let odd = odd; let even = even"\n style="font-size: 15px;"\n [ngClass]="{ odd: odd, even: even }"\n >\n <td style="text-align:center" *ngIf="show_download">\n\n<button [hidden]="app.Filename.indexOf(\'.eml\')==-1 && app.Filename.indexOf(\'.msg\')==-1"\n mat-icon-button\n [matTooltip]="\'Preview\' "\n (click)="preview_email(app)"\n >\n <mat-icon>visibility</mat-icon>\n </button>\n\n\n <button\n mat-icon-button\n [matTooltip]="\'Download File\' "\n (click)="download_all(app)"\n >\n <mat-icon>cloud_download</mat-icon>\n </button>\n</td>\n <td [fxShow.lt-sm]="false"\n style="text-align:center;vertical-align: middle;width:36px;height:36px;" (click)="download_all(app)"\n >\n <div\n style="text-align:center;vertical-align: middle;width:28px;height:28px;"\n >\n <img\n src="assets/icons/square-o/{{ app.icon }}"\n style="width:28px;height:28px;"\n />\n </div>\n </td>\n\n <td [fxShow.lt-sm]="false"><button mat-stroked-button color="primary" (click)="download_all(app)">{{ app.Filename }}</button></td>\n <td style="text-align:center" *ngIf="show_version" [fxShow.lt-sm]="false">{{ app.v }}</td>\n <td [fxShow.lt-sm]="false" *ngIf="show_dim" style="text-align:center">{{ app.Filesize }}</td>\n <td [fxShow.lt-sm]="false" *ngIf="show_descri">\n <div fxLayout="row">\n <div *ngIf="enabled">\n <a\n mat-icon-button\n [matTooltip]="\'Modifica Descrizione\' | translate"\n *ngIf="app.can_edit"\n (click)="edit_descri(app)"\n >\n <mat-icon>edit</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]="\n _trs.instant( \'Modifica Descrizione consentita solo a\')+\': \' + app.nc\n "\n *ngIf="!app.can_edit"\n [disabled]="true"\n >\n <mat-icon>edit</mat-icon>\n </a>\n </div>\n <div\n [innerHTML]="app.descrizione_vis"\n style="width:100%"\n ></div>\n </div>\n </td>\n <td *ngIf="multi_list">\n <div fxLayout="row">\n <a\n mat-icon-button\n [matTooltip]="\'Modifica Tipo\' | translate"\n *ngIf="app.can_edit"\n (click)="edit_tipo(app)"\n >\n <mat-icon>edit</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]="\n _trs.instant( \'Modifica Tipologia consentita solo a\')+\':\' + app.nc\n "\n *ngIf="!app.can_edit"\n [disabled]="true"\n >\n <mat-icon>edit</mat-icon>\n </a>\n\n <div [innerHTML]="app.tipo" style="width:100%"></div>\n </div>\n </td>\n\n <td\n style="min-width:400px;min-height: 400px"\n *ngIf="app.type == \'IMG\'"\n >\n <fh-image-viewer [u]="app"></fh-image-viewer>\n </td>\n <td *ngIf="app.type != \'IMG\'"><div [fxShow.lt-sm]="true"><button mat-stroked-button color="primary" (click)="download_all(app)">{{ app.Filename }}</button></div></td>\n <td [fxShow.lt-sm]="false">{{ app.nc }}</td>\n <td style="text-align:center" [fxShow.lt-sm]="false">\n {{ app.dt_ins | date: "dd/MM/yyyy HH:mm:ss" }}\n </td>\n\n\n <td *ngIf="enabled" style="text-align:center">\n <a\n mat-icon-button\n [matTooltip]="\'Elimina File\' "\n *ngIf="app.can_delete"\n (click)="delete(app)"\n >\n <mat-icon>delete</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]="\n _trs.instant( \'Cancellazione consentita solo a\')+\': \' + app.can_delete_m\n "\n *ngIf="!app.can_delete"\n [disabled]="true"\n >\n <mat-icon>delete</mat-icon>\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n <table width="98%" class="fh_table" *ngIf="b_mobile">\n <tbody>\n <tr\n *ngFor="let app of arr_g; let odd = odd; let even = even"\n style="font-size: 15px;"\n [ngClass]="{ odd: odd, even: even }"\n >\n <td\n style="text-align:center;vertical-align: middle;width:36px;height:36px;" (click)="download_all(app)"\n >\n <div\n style="text-align:center;vertical-align: middle;width:28px;height:28px;"\n >\n <img\n src="assets/icons/square-o/{{ app.icon }}"\n style="width:28px;height:28px;"\n />\n </div>\n </td>\n <td *ngIf="b_mobile" style="text-align:center">\n <button mat-stroked-button color="primary" (click)="download_all(app)">{{ app.Filename }}</button><br /><br />\n <button\n style="background-color: #F5F5F5"\n (click)="download_all(app)"\n mat-flat-button\n >\n DOWNLOAD\n </button>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div *ngIf="!b_ini && b_initt" style="color:#ff0000">\n <b>{{\'ATTENZIONE COMPONENTE NON INIZIALIZZATO\' }}</b>\n </div>\n ',styles:[""]}]}],ne.ctorParameters=function(){return[{type:wt},{type:Dt},{type:i.ToastrService},{type:e.MatDialog},{type:ee},{type:Ct},{type:p.TranslateService}]},ne.propDecorators={enabled:[{type:n.Input}],force_en:[{type:n.Input}],show_dim:[{type:n.Input}],show_descri:[{type:n.Input}],label:[{type:n.Input}],sovrascrivi_path:[{type:n.Input}],ruolo_supervisore:[{type:n.Input}],access_control:[{type:n.Input}],show_images:[{type:n.Input}],can_delete_owner:[{type:n.Input}],show_upload:[{type:n.Input}],show_download:[{type:n.Input}],description_required:[{type:n.Input}],selezionare_tipologia:[{type:n.Input}],expand:[{type:n.Output}],file_copy:[{type:n.Output}],change:[{type:n.Output}],call_upload:[{type:n.Output}],init_end:[{type:n.Output}],upc:[{type:n.ViewChild,args:["upc"]}]};var oe=function(){function t(t,e,i,o,s,a){var r=this;this._dataService=t,this.toastr=e,this.dialog=i,this.app_s=o,this.uti=s,this._trs=a,this.lascia_il_file="Lascia il file per confermarmare upload",this.trascina_il_file="Trascina un file qui o Clicca per avviare upload",this.show_download_button=!0,this.show_descri=!0,this.enabled=!0,this.single=!0,this.descri_obb=!1,this.programma_da_eseguire="",this.label_attendere="ATTENDERE UPLOAD IN CORSO",this.sovrascrivi_path="",this.fixed_label=" (INSERISCI QUI LA DESCRIZIONE PRIMA DI CARICARE IL FILE)",this.limit_string="Il file di <size>MB supera il limite di 1GB",this.allegato_inserito="ALLEGATO INSERITO",this.inserire_descrizione="Descrizione Obbligatoria",this.selezionare_tipologia="Selezionare la Tipologia",this.show_error=!0,this.lista_allegati=[],this.change=new n.EventEmitter,this.upload_ended=new n.EventEmitter,this.call_upload=new n.EventEmitter,this.fill_end=new n.EventEmitter,this.init_end=new n.EventEmitter,this.id_component="",this.hasBaseDropZoneOver=!1,this.hasAnotherDropZoneOver=!1,this.multi_list=!1,this.allow_delete=!1,this.loading=!1,this.App="",this.K="",this.label_b="",this.descrizione="",this.file_name="",this.label="",this.username="",this.b_edit_loaded=!1,this.tipo="",this.b_ini=!1,this.last_result={},this.uploader=new u.FileUploader({url:this.app_s.API_ENDPOINT+this.app_s.UPLOAD_ENDPOINT,maxFileSize:1048576e3}),this.id=null,this.ver=-1,this.show_upload=!0,this.id_component=this.uti.newGuid(),this.username=this.app_s.user,console.log("this.app_s.user ",this.app_s.user),this.uploader.onBeforeUploadItem=function(t){t.withCredentials=!1},this.uploader.onCompleteItem=function(t,e,i,n){200===i&&(r.ref_allegato(),r.last_result={item:t,response:e,status:i,header:n},r.change.emit(r.last_result))}}return t.prototype.call_up=function(){console.log("this.app_s.user ",this.app_s.user),this.call_upload.emit({App:this.App,K:this.K,descrizione:this.descrizione,single:!1,username:this.app_s.user,tipo:this.tipo,local_path:this.app_s.LOCAL_PATH,p1:this.programma_da_eseguire,ver:this.ver})},t.prototype.onFileDrop=function(t){},t.prototype.fileOverBase=function(t){this.hasBaseDropZoneOver=t},t.prototype.del_doc=function(){var t=this;localStorage.setItem(this.app_s.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.app_s.COMPANY_KEY+"msg_dialog","Confermi l'eliminazione dell'elemento?"),this.dialog.open(It).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="DELETE_ALLEGATO",i.types=["int","string"],i.values=[t.id,t.app_s.user];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.ref_allegato(),t.toastr.info("INFO","ALLEGATO ELIMINATO",{timeOut:1e3,progressBar:!0}))}),(function(t){}))}}))},t.prototype.load_types=function(){var t=this;null!=this.cmb_tipo&&""!=this.tipo?(this.cmb_tipo.sql=this.tipo,this.cmb_tipo.fillCombo()):setTimeout((function(){t.load_types()}),200)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){var e={};e.headers=[{name:"Authorization",value:"Bearer "+localStorage.getItem(t.app_s.COMPANY_KEY+"token")}],t.uploader.setOptions(e),t.uploader.onCompleteAll=function(){t.loading=!1,t.upload_ended.emit(t.last_result),t.descrizione="",t.ref_allegato(),null!=t.dialogRef&&null!=t.dialogRef.componentInstance&&(t.dialogRef.componentInstance.update_progess(100),t.dialogRef=null)},t.uploader.onErrorItem=function(e,i,n,o){t.show_error&&t.toastr.error(i)},t.uploader.onAfterAddingFile=function(e){t.ch(e)},t.uploader.onProgressItem=function(e,i){t.loading=!0,null!=t.dialogRef&&null!=t.dialogRef.componentInstance&&t.dialogRef.componentInstance.update_progess(i)},t.uploader.onWhenAddingFileFailed=function(e,i,n){switch(i.name){case"fileSize":var o=Math.round(e.size/1024/1024);t.toastr.error(t._trs.instant(t.limit_string).split("<size>").join(""+o));break;default:t.toastr.error("Errore: "+i.name)}},t.init_end.emit()}))},t.prototype.download_all=function(){""==this.sovrascrivi_path?window.open(this.app_s.COMPANY_SITE_ROOT+"/uploads/"+this.App+"/"+this.K+"/"+this.file_name):window.open(this.sovrascrivi_path+"/uploads/"+this.App+"/"+this.K+"/"+this.file_name)},t.prototype.ch=function(t){var e=this;this.descri_obb&&""==this.descrizione?this.toastr.error(this._trs.instant(this.inserire_descrizione)):""==this.selezionare_tipologia||!this.multi_list||""!=this.cmb_tipo.getValue()&&"-1"!=this.cmb_tipo.getValue()?(this.uploader.onBuildItemForm=function(t,i){i.append("App",e.App),i.append("K",e.K),i.append("descrizione",e.descrizione),i.append("single",e.single),i.append("username",e.app_s.user),i.append("ver",e.ver),console.log("this.app_s.user ",e.app_s.user),e.multi_list&&e.show_upload?i.append("tipo",e.cmb_tipo.getDescri().split("-1").join("")):i.append("tipo",e.tipo),i.append("local_path",e.app_s.LOCAL_PATH),""!=e.programma_da_eseguire&&i.append("p1",e.programma_da_eseguire)},null==this.dialogRef&&(this.dialogRef=this.dialog.open(Nt,{disableClose:!0}),setTimeout((function(){e.dialogRef.componentInstance.label=e._trs.instant(e.label_attendere)})),this.dialogRef.afterClosed().subscribe((function(t){}))),this.uploader.uploadAll()):this.toastr.error(this._trs.instant(this.selezionare_tipologia))},t.prototype.init=function(t,e,i,n,o,s,a,r,l){void 0===n&&(n=""),void 0===o&&(o=""),void 0===s&&(s=!1),void 0===a&&(a=!1),void 0===r&&(r=!0),void 0===l&&(l=-1),this.App=t,this.K=e,this.label=i,this.tipo=n,this.ver=l,this.b_ini=!0,this.b_edit_loaded=!1,this.descrizione="",this.programma_da_eseguire=o,this.allow_delete=s,this.ref_allegato(),this.tipo.indexOf("SELECT_")>-1&&(this.multi_list=!0,this.load_types()),this.show_upload=r,a&&this.select_file.nativeElement.click()},t.prototype.ref_allegato=function(){var t=this;if(this.id=null,this.file_name="",this.label_b="",this.cmb_tipo.resetValue(),this.single&&null!=this.App&&""!=this.App){var e=new vt;e.sql="SELECT_ALLEGATO_INFO",e.types=["string","string"],e.values=[this.App,this.K],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;i.length>0&&(t.id=i[0].id,t.descrizione=i[0].descrizione,t.file_name=i[0].Filename,t.label_b=i[0].Filename+" - "+i[0].Filesize,t.b_edit_loaded=!0,t.fill_end.emit())}}))}},t}();oe.decorators=[{type:n.Component,args:[{selector:"FHUpload",template:'\n <div *ngIf="loading" fxLayout="row">\n <mat-spinner diameter="25" ></mat-spinner>\n </div>\n\n <div\n [hidden]="!(enabled && !loading)"\n fxLayout="row"\n fxLayoutAlign="start center"\n fxLayoutGap="10px"\n >\n <div\n [hidden]="!multi_list"\n style="width:400px"\n fxLayoutAlign="start center"\n >\n <div style="width:100%">\n <FHComboBox\n [sql]="tipo"\n #cmb_tipo\n [init_fill]="false"\n label="Tipologia"\n ></FHComboBox\n ></div>\n </div>\n <mat-form-field\n [hidden]="!show_descri" [class.fh_field]="enabled" [class.fh_field_dis]="!enabled"\n style="width: 100%"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label | translate}} {{ fixed_label | translate }} {{ descri_obb ? \'*\':\'\'}}</mat-label>\n <input\n matInput\n type="text"\n name="descrizione"\n [(ngModel)]="descrizione"\n />\n </mat-form-field>\n \n \x3c!-- <div\n style="width:140px"\n fxLayout="row"\n fxLayoutAlign="start start"\n (click)="call_up()"\n >\n <input\n type="file"\n multiple\n ng2FileSelect\n [uploader]="uploader"\n name="file-fh{{ id_component }}"\n id="file-fh{{ id_component }}"\n class="inputfile inputfile-fh"\n />\n <label for="file-fh{{ id_component }}" style="width:210px"\n ><svg\n xmlns="http://www.w3.org/2000/svg"\n width="20"\n height="17"\n viewBox="0 0 20 17"\n >\n <path\n d="M10 0l-5.2 4.9h3.3v5.1h3.8v-5.1h3.3l-5.2-4.9zm9.3 11.5l-3.2-2.1h-2l3.4 2.6h-3.5c-.1 0-.2.1-.2.1l-.8 2.3h-6l-.8-2.2c-.1-.1-.1-.2-.2-.2h-3.6l3.4-2.6h-2l-3.2 2.1c-.4.3-.7 1-.6 1.5l.6 3.1c.1.5.7.9 1.2.9h16.3c.6 0 1.1-.4 1.3-.9l.6-3.1c.1-.5-.2-1.2-.7-1.5z"\n /></svg><span style="font-size: 12px"> Upload</span></label>\n </div>\n --\x3e\n <div fxLayout="row" [hidden]="!((descri_obb && descrizione == \'\') || (multi_list && (cmb_tipo.getValue() == \'\' || cmb_tipo.getValue() == \'-1\')))">\n <div [hidden]="!(this.descri_obb && descrizione == \'\')"><b>{{inserire_descrizione | translate}}</b></div>\n <div [hidden]="!(multi_list && (cmb_tipo.getValue() == \'\' || cmb_tipo.getValue() == \'-1\'))"><b>{{selezionare_tipologia | translate}}</b></div>\n </div>\n <div class="my-drop-zone" [hidden]="(descri_obb && descrizione == \'\') || (multi_list && (cmb_tipo.getValue() == \'\' || cmb_tipo.getValue() == \'-1\'))" style="width:130px" fxLayout="row" [matTooltip]="hasBaseDropZoneOver ? lascia_il_file : trascina_il_file | translate" fxLayoutAlign="center start">\n <label for="uploader-input" ng2FileDrop style="font-weight:bold"\n [ngClass]="{\'over-drop-zone\': hasBaseDropZoneOver}" for="file-fh{{ id_component }}"\n (onFileDrop)="onFileDrop($event)" (click)="call_up()"\n (fileOver)="fileOverBase($event)" [uploader]="uploader">\n <div fxLayoutAlign="center center" fxLayout="row">\n <mat-icon>{{!hasBaseDropZoneOver?\'backup\':\'thumb_up\'}}</mat-icon>\n\n <span style="font-size: 14px"> Upload</span></div></label></div>\n <input type="file"\n ng2FileSelect #select_file\n [multiple]="true"\n [uploader]="uploader"\n name="file-fh{{ id_component }}"\n id="file-fh{{ id_component }}" (click)="call_up()"\n (onFileSelected)="onFileDrop($event)"\n id="uploader-input" style="display:none"/>\n <div fxLayout="row" fxLayoutAlign="start start">\n \n <button\n mat-flat-button\n *ngIf="b_edit_loaded && show_download_button"\n (click)="download_all()"\n style="font-size: 12px;font-weight:bold" color="accent"\n\n >\n {{ label_b }}</button\n > \n <button\n mat-flat-button\n *ngIf="id != null && allow_delete && show_download_button"\n (click)="del_doc()"\n color="warn"\n >\n <mat-icon>delete</mat-icon>\n </button>\n\n </div>\n </div>\n <div *ngIf="!enabled" fxLayout="row" fxLayoutGap="10px">\n <label [hidden]="label==null || label==\'\'">{{ label }}:</label>\n <div *ngIf="label != descrizione">{{ descrizione }}</div>\n <button\n mat-flat-button\n *ngIf="b_edit_loaded && show_download_button"\n (click)="download_all()"\n style="font-size: 12px;background-color: #F5F5F5"\n >\n {{ label_b }}\n </button>\n </div>\n ',styles:["\n .fileLabel{\n display: inline-block;\n padding: .7em .4em;\n font-size: 13px;\n color: #525252;\n background-color: #e6e6e6;\n margin: 0 .2em;\n border-radius: 5px;\n }\n","\n .my-drop-zone { border: dotted 3px lightgray;height:35px }\n\n","\n .nv-file-over { border: dotted 3px red; } /* Default class applied to drop zones on over */\n ","\n .another-file-over-class { border: dotted 3px green; }\n"]}]}],oe.ctorParameters=function(){return[{type:Dt},{type:i.ToastrService},{type:e.MatDialog},{type:wt},{type:Ct},{type:p.TranslateService}]},oe.propDecorators={lascia_il_file:[{type:n.Input}],trascina_il_file:[{type:n.Input}],show_download_button:[{type:n.Input}],show_descri:[{type:n.Input}],enabled:[{type:n.Input}],single:[{type:n.Input}],descri_obb:[{type:n.Input}],programma_da_eseguire:[{type:n.Input}],label_attendere:[{type:n.Input}],sovrascrivi_path:[{type:n.Input}],fixed_label:[{type:n.Input}],limit_string:[{type:n.Input}],allegato_inserito:[{type:n.Input}],inserire_descrizione:[{type:n.Input}],selezionare_tipologia:[{type:n.Input}],show_error:[{type:n.Input}],lista_allegati:[{type:n.Input}],change:[{type:n.Output}],upload_ended:[{type:n.Output}],call_upload:[{type:n.Output}],fill_end:[{type:n.Output}],init_end:[{type:n.Output}],select_file:[{type:n.ViewChild,args:["select_file"]}],cmb_tipo:[{type:n.ViewChild,args:["cmb_tipo"]}]};var se=function(){function t(t,e,i){this.http=t,this.app_s=e,this.toastr=i,this.url=this.app_s.API_ENDPOINT+this.app_s.GRID_ENDPOINT}return t.prototype.doQuery=function(t,e,i){var n=this;void 0===e&&(e=!0),void 0===i&&(i=null),this.headers=new r.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=null==i?this.app_s.API_ENDPOINT+this.app_s.GRID_ENDPOINT:i;var o=JSON.stringify(t);return this.http.post(this.url,o,{headers:this.headers}).pipe(l.map((function(t){var i;if(t?"KO"===t.result_msg&&(i=new Error(t.msg)):i=new Error("Empty server response"),i)throw console.error(i),e&&n.toastr.error(i.message),new Error(i);return t||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t}();se.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new se(n.ɵɵinject(r.HttpClient),n.ɵɵinject(wt),n.ɵɵinject(i.ToastrService))},token:se,providedIn:"root"}),se.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],se.ctorParameters=function(){return[{type:r.HttpClient},{type:wt},{type:i.ToastrService}]};var ae=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.title=""}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ngAfterViewInit=function(){},t}();ae.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <mat-dialog-content style="min-width:800px;min-height:500px">\n <mat-tab-group>\n <mat-tab label="FILTRI">\n <img src="assets/helps/fhgrid/filtri.png" />\n </mat-tab>\n <mat-tab label="ORDINAMENTI">\n <img src="assets/helps/fhgrid/ordinamenti.png" />\n </mat-tab>\n <mat-tab label="LAYOUT COLONNE">\n <img src="assets/helps/fhgrid/layout_colonne.png" />\n </mat-tab>\n </mat-tab-group>\n </mat-dialog-content>\n\n <mat-dialog-actions>\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="dialogRef.close(\'\')"\n >\n CHIUDI\n </button>\n </mat-dialog-actions>\n ',styles:["\n agm-map {\n height: 600px;\n width: 100%;\n }\n "]}]}],ae.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:wt}]};var re=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.data=i,this.title="",this.label="",this.password_mode=!1,this.valore="",this.min_chars=3,this.max_chars=50,this.readonly=!1,null!=i&&(null!=i.title&&(this.title=i.title),null!=i.label&&(this.label=i.label),null!=i.valore&&(this.valore=i.valore),null!=i.readonly&&(this.readonly=i.readonly),null!=i.min_chars&&(this.min_chars=i.min_chars),null!=i.max_chars&&(this.max_chars=i.max_chars),null!=i.password_mode&&(this.password_mode=i.password_mode))}return t.prototype.ngAfterViewInit=function(){},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.show=function(){},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.do_check=function(){this.valore.length<this.min_chars||this.valore.length>this.max_chars?this.toastr.error("Il valore deve avere un numero di caratteri compreso tra "+this.min_chars+" - "+this.max_chars):this.dialogRef.close(this.valore)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t}();re.decorators=[{type:n.Component,args:[{selector:"app-win_ask_text",template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{ title }}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <mat-dialog-content style="font-size: 15px;">\n <mat-form-field *ngIf="!password_mode"\n appearance="outline"\n floatLabel="always"\n style="width:100%"\n ><mat-label\n >{{ label }}</mat-label\n >\n <input matInput type="text" [(ngModel)]="valore" required />\n </mat-form-field>\n <mat-form-field appearance="outline" floatLabel="always" *ngIf="password_mode"\n ><mat-label>{{ label }}</mat-label>\n\n <input\n autocomplete="new-password"\n matInput\n type="password"\n [(ngModel)]="valore"\n\n />\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <div\n fxLayout="row"\n fxLayoutAlign="center center"\n style="width: 100%"\n [hidden]="readonly"\n >\n <button mat-flat-button color="primary" (click)="do_check()">OK</button\n > \n <button mat-flat-button color="warn" (click)="chiudi()">{{\'ANNULLA\' | translate}}</button>\n </div>\n <div\n fxLayout="row"\n fxLayoutAlign="center center"\n style="width: 100%"\n [hidden]="!readonly"\n >\n <button mat-flat-button color="warn" (click)="chiudi()">{{\'CHIUDI\' | translate}}</button>\n </div>\n </mat-dialog-actions>\n</div>\n '}]}],re.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var le=function(){this.filter="",this.system_dest=1},pe=function(){},ue=function(){function t(t,e,i){this.dataService=t,this.fileService=e,this.toastr=i,this.eprog=0}return t.prototype.operation=function(t,e,i,n){var o=new pe;return o.op=t,o.v1=e,o.v2=i,o.ord=n,o},t.prototype.progress_update=function(t){var e=this;void 0===t&&(t=null),null!=t&&null!=t.componentInstance&&(this.eprog+=10,this.eprog>=100&&(this.eprog=95),setTimeout((function(){null!=t&&null!=t.componentInstance&&t.componentInstance.update_progess(e.eprog)})),setTimeout((function(){e.progress_update(t)}),2e3))},t.prototype.runCommands=function(t,e,i,n){var o=this;void 0===i&&(i=null),void 0===n&&(n=!0),this.eprog=0;var s=new vt;return s.sql="INSERT_OFFICE_OPERATION",s.types=["string","string"],e.sort((function(t,e){return t.ord<e.ord?-1:t.ord>e.ord?1:void 0})),s.values=[t,JSON.stringify(e)],this.dataService.doQuery(s).pipe(l.flatMap((function(e){if(null!=e&&"OK"==e.result_msg){var s=new gt;return s.command=n?"exec_app":"exec_app_async",s.p1="print_manager",s.p2=t,null!=i&&setTimeout((function(){o.progress_update(i)}),2e3),o.fileService.doQuery(s).pipe(l.flatMap((function(t){if(null!=t&&"OK"==t.result_msg)return new _.Observable((function(e){setTimeout((function(){!0}),18e4);o.eprog=100,o.progress_update(i),e.next(t),e.complete()}))})))}})))},t}();ue.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new ue(n.ɵɵinject(Dt),n.ɵɵinject(Tt),n.ɵɵinject(i.ToastrService))},token:ue,providedIn:"root"}),ue.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],ue.ctorParameters=function(){return[{type:Dt},{type:Tt},{type:i.ToastrService}]};var ce=function(){function t(t,e,i,o,s,a,r,l,p,u,c){var d=this;this._gridservice=t,this._toast=e,this._dataService=i,this.m_appService=o,this.slimLoadingBarService=s,this.m_dialog=a,this.uti_s=r,this.officeService=l,this._fileService=p,this.clipboard=u,this._trs=c,this.flt_aggiuntivo=[],this.flt_aggiuntivo_value="",this.flt_aggiuntivo_label="",this.width_max="100%",this.browser="nd",this.overwrite_help_url="",this.over_fulltext=!1,this.b_wait=!1,this.over_fulltext_types=[],this.over_fulltext_values=[],this.over_fulltext_sql="",this.tooltipShowDelay=2e3,this.elimina_label="ELIMINA",this.export_field_aggiuntivi="",this.end_point=null,this.tbl_name="",this.count_tbl_name="",this.search_field_tooltip="",this.loading_fulltext=!1,this.num_per_pag=0,this.grid_key="PRO_H",this.sort_field="",this.fields="*",this.filters="1=1",this.enabled=!0,this.show_link=!1,this.show_help_bar=!1,this.help_label_bar="HELP",this.auto_load=!0,this.auto_height=!1,this.enable_export=!0,this.enabled_pag=!0,this.show_help=!0,this.show_num_elem=!0,this.system_dest=1,this.header_h=35,this.selection_mode="multiple",this.init_fill=!0,this.no_pref=!1,this.pref_hidden=!0,this.enable_export_pdf=!0,this.enable_export_xls=!0,this.enable_copy=!0,this.autosize_at_ini=!0,this.label_elementi=" Elementi",this.trova_label="TROVA",this.mantieni_impostazioni="Mantieni Imp.",this.curr_filter="",this.flt_aggiuntivo_event=new n.EventEmitter,this.show_buttons=!0,this.fill_end=new n.EventEmitter,this.cell_edited=new n.EventEmitter,this.clicked=new n.EventEmitter,this.dclicked=new n.EventEmitter,this.columndclicked=new n.EventEmitter,this.cell_clicked=new n.EventEmitter,this.selection_change=new n.EventEmitter,this.custom_export=!1,this.toolbar_type="NONE",this.toolbar_wkfapp=null,this.toolbar_custom_commands=[],this.command=new n.EventEmitter,this.b_ensure=!1,this.curr_config="-1",this.init_end=new n.EventEmitter,this.off_set=0,this.include_always="",this.first_ref=!0,this.b_restored=!1,this.str_curr_q_p="",this.dataSource={getRows:function(t){d.slimLoadingBarService.start((function(){}));var e=new le;if(e.table=d.tbl_name,e.table_count=d.tbl_name,""!=d.count_tbl_name&&(e.table_count=d.count_tbl_name),e.num_per_pag=t.endRow-t.startRow,e.curr_page=Math.round(t.startRow/e.num_per_pag),null==e.curr_page&&(e.curr_page=0),null==e.num_per_pag&&(e.num_per_pag=100),0!=d.num_per_pag&&(e.num_per_pag=d.num_per_pag),e.sort_field=d.sort_field,null!=t.sortModel&&t.sortModel.length>0){e.sort_field="";for(var i=0;i<t.sortModel.length;i++)""!=e.sort_field&&(e.sort_field=e.sort_field+","),"autori"==t.sortModel[i].colId?e.sort_field=e.sort_field+"case when CHARINDEX('"+d.m_appService.user+"',autori)>0 then 1 else 0 end "+t.sortModel[i].sort:e.sort_field=e.sort_field+t.sortModel[i].colId+" "+t.sortModel[i].sort}e.system_dest=d.system_dest,e.field=d.fields,null!=d.filters&&(e.filter=d.filters),""!=d.fix_flt&&(""!=e.filter&&(e.filter=e.filter+" and "),e.filter=e.filter+" ("+d.fix_flt+" )"),""!=d.ric_libera&&d.over_fulltext||""!=d.fix_flt_temp&&(""!=e.filter&&(e.filter=e.filter+" and "),e.filter=e.filter+" ("+d.fix_flt_temp+" )");var n=e.filter,o=!1;if(null!=t.filterModel)for(var s in t.filterModel){o||(console.log("🚀 ~ file: fhgrid.ts ~ line 770 ~ FHGridComponent ~ this.include_always",d.include_always),""!=d.include_always&&(e.filter=e.filter+" ("+d.include_always+" or "));var a=t.filterModel[s];console.log(t.filterModel[s],s),null==a.operator?""==e.filter||!o&&""!=d.include_always?e.filter+=d.calcola_filtro(t.filterModel[s],"",s,!1):e.filter+=d.calcola_filtro(t.filterModel[s],"",s,!0):(""==e.filter||!o&&""!=d.include_always||(e.filter+=" and "),e.filter+=" (",e.filter+=d.calcola_filtro(t.filterModel[s].condition1,"",s,!1),e.filter+=" "+a.operator+" ",e.filter+=d.calcola_filtro(t.filterModel[s].condition2,"",s,!1),e.filter+=")"),o=!0}if(o&&""!=d.include_always&&(e.filter=e.filter+" )"),o=!0,e.filter=e.filter.split("{{user}}").join(d.m_appService.user),""!=d.ric_libera?d.last_riclib=!0:d.last_riclib=!1,""!=e.filter&&n!=e.filter||null!=d.ric_libera&&""!=d.ric_libera?d.show_pulisci_filtri=!0:d.show_pulisci_filtri=!1,d.loading_fulltext=!0,d.str_curr_q_p="",""!=e.filter&&(d.str_curr_q_p="where "+e.filter),""!=e.sort_field&&(d.str_curr_q_p=d.str_curr_q_p+" order by "+e.sort_field),d.curr_filter=e.filter,""!=d.ric_libera&&d.over_fulltext){d.loading_fulltext=!0;var r="";""!=e.filter&&(r=" and ("+e.filter+")");var l=new vt;l.sql=d.over_fulltext_sql,console.log("JSON.stringify(params.filterModel) ",JSON.stringify(t.filterModel)),"{}"==JSON.stringify(t.filterModel)&&(l.sql=d.over_fulltext_sql+"_FT"),l.types=["string","string","string"],l.values=[d.ric_libera,e.sort_field,r],d.over_fulltext_types.map((function(t){l.types.push(t)})),d.over_fulltext_values.map((function(t){l.values.push(t)})),d._dataService.doQuery(l).subscribe((function(i){var n=!1;if(null!=i&&"OK"==i.result_msg){n=!0,t.successCallback(i.result_data,i.result_data.length),d.b_init=!0,d.myData=i.result_data.slice(),d.num_r=i.result_data.length,d.slimLoadingBarService.complete(),d.fill_end.emit(),localStorage.setItem(d.grid_key+"_POS1",JSON.stringify(e)),null!=localStorage.getItem(d.grid_key+"_POS2")&&null!=d.gridOptions&&null!=d.gridOptions.api&&d.gridOptions.api.forEachNode((function(t){d.getRowNodeId(t)===localStorage.getItem(d.grid_key+"_POS2")&&(t.setSelected(!0),localStorage.removeItem(d.grid_key+"_POS2"),null!=localStorage.getItem(d.grid_key+"_LAST_ROW")&&(d.sRow=JSON.parse(localStorage.getItem(d.grid_key+"_LAST_ROW"))),localStorage.removeItem(d.grid_key+"_LAST_ROW"))}));null!=d.toggle_mantieni&&d.toggle_mantieni.checked,d.loading_fulltext=!1,d.no_pref&&!d.b_init1&&d.autoSizeAll(),d.b_init1=!0,d.ensure_visible(),null==localStorage.getItem(d.grid_key+"_COLS")&&d.autosize_at_ini&&setTimeout((function(){d.autoSizeAll()}),300)}n||(d.errorMsg=i.msg+" ["+i.result_msg+"]")}),(function(t){d.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER. RITENTARE PIU' TARDI"}))}else d._gridservice.doQuery(e,!0,d.end_point).subscribe((function(i){var n=!1;if(null!=i&&"OK"==i.result_msg){n=!0,t.successCallback(i.result_data,i.count),d.b_init=!0,d.myData=i.result_data.slice(),d.num_r=i.count,d.slimLoadingBarService.complete(),d.fill_end.emit(),localStorage.setItem(d.grid_key+"_POS1",JSON.stringify(e)),null!=localStorage.getItem(d.grid_key+"_POS2")&&null!=d.gridOptions&&null!=d.gridOptions.api&&d.gridOptions.api.forEachNode((function(t){d.getRowNodeId(t)===localStorage.getItem(d.grid_key+"_POS2")&&(t.setSelected(!0),localStorage.removeItem(d.grid_key+"_POS2"),null!=localStorage.getItem(d.grid_key+"_LAST_ROW")&&(d.sRow=JSON.parse(localStorage.getItem(d.grid_key+"_LAST_ROW"))),localStorage.removeItem(d.grid_key+"_LAST_ROW"))}));null!=d.toggle_mantieni&&d.toggle_mantieni.checked,d.loading_fulltext=!1,d.no_pref&&!d.b_init1&&d.autoSizeAll(),d.b_init1=!0,d.ensure_visible(),null==localStorage.getItem(d.grid_key+"_COLS")&&d.autosize_at_ini&&setTimeout((function(){d.autoSizeAll()}),300)}n||(d.errorMsg=i.msg+" ["+i.result_msg+"]")}),(function(t){d.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER. RITENTARE PIU' TARDI"}))}},this.getContextMenuItems_n_e=function(){return["autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste"]},this.getContextMenuItems_e=function(){return["autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste",{name:"Esporta",action:function(){d.export_excel()},icon:'<img src="assets/icons/square-o/xlsx.svg"/>'}]},this.gridOptions={debug:!1,headerHeight:this.header_h,enableRangeSelection:!0,defaultColDef:{resizable:!0,sortable:!0,floatingFilter:!0},allowContextMenuWithControlKey:!0,rowModelType:"infinite",localeText:{page:"pagina",more:"altre",to:"a",of:"di",next:"prossima",last:"ultima",first:"prima",previous:"precedente",loadingOoo:"Caricamento...",selectAll:"Seleziona Tutto",searchOoo:"Trova...",blanks:"Vuoto",filterOoo:"Filtro...",applyFilter:"Applica Filtro...",equals:"Uguale",notEqual:"Diverso",lessThan:"Minore o Uguale",greaterThan:"Maggiore o Uguale",notContains:"Non Contiene",contains:"Contiene",startsWith:"Inizia Con",endsWith:"Finisce Con",group:"Gruppo",columns:"Colonne",rowGroupColumns:"Colonne Pivot",rowGroupColumnsEmptyMessage:"trascina le colonne per raggrupparle",valueColumns:"Colonne Valore",pivotMode:"Modalità Pivot",groups:"Gruppi",values:"Valori",pivots:"Pivots",valueColumnsEmptyMessage:"trascina le colonne per aggreare",pivotColumnsEmptyMessage:"trascina le colonne per pivot",noRowsToShow:"nessun dato",pinColumn:"Sposta Colonna",valueAggregation:"Aggregazione",autosizeThiscolumn:"Autosize colonna",autosizeAllColumns:"Autosize tutte le colonne",groupBy:"Raggruppa per",ungroupBy:"Spacca per",resetColumns:"Resetta queste colonna",expandAll:"Espandi",collapseAll:"Chiudi",toolPanel:"Impostazioni",pinLeft:"Sposta <<",pinRight:"Sposta >>",noPin:"Sposta <>",sum:"Somma",min:"Minimo",max:"Massimo",none:"Nessuno",count:"Numero",average:"Media",copy:"Copia",ctrlC:"ctrl n C",paste:"Incolla",ctrlV:"ctrl n C"},getRowNodeId:function(t){return null!=t.ID?String(t.ID):null!=t.id?String(t.id):null!=t.uiid?t.uiid:null!=t.codice?t.codice:null!=t.id_doc?t.id_doc:null!=t.notesid?t.notesid:null!=t.ord?t.ord:void 0}},this.last_copy="",this.b_init=!1,this.b_init1=!1,this.errorMsg="",this.innerWidth=750,this.show_pulisci_filtri=!1,this.last_riclib=!1,this.uiid_stampa="",this.xxopx=0,this.num_r=0,this.ready=!1,this.ckk_ed=!1,this.myData=new Array,this.b_iniended=!1,this.ric_libera="",this.fix_flt="",this.fix_flt_temp="",null==this.m_appService.getState().grid_obj&&(this.m_appService.getState().grid_obj={}),this.browser=this.getBrowserName(),"ie"==this.browser&&(this.width_max="")}return t.prototype.sc=function(){this.flt_aggiuntivo_event.emit(this.flt_aggiuntivo_value)},t.prototype.getBrowserName=function(){var t=window.navigator.userAgent.toLowerCase();switch(!0){case t.indexOf("edge")>-1:return"edge";case t.indexOf("opr")>-1&&!!window.opr:return"opera";case t.indexOf("chrome")>-1&&!!window.chrome:return"chrome";case t.indexOf("trident")>-1:return"ie";case t.indexOf("firefox")>-1:return"firefox";case t.indexOf("safari")>-1:return"safari";default:return"other"}},t.prototype.docmd=function(t){this.command.emit(t)},t.prototype.translate_back=function(t){if(console.log("translate_back ",t),null==this._trs)return t;if(null==this._trs.store)return t;if(null==this._trs.store.translations)return t;null==localStorage.getItem(this.m_appService.COMPANY_KEY+"_lng")&&localStorage.setItem(this.m_appService.COMPANY_KEY+"_lng","it");var e=localStorage.getItem(this.m_appService.COMPANY_KEY+"_lng");for(var i in this._trs.store.translations[e])if(this._trs.store.translations[e][i]==t)return i;return t},t.prototype.ensure_visible=function(){if(!this.b_ensure){this.b_ensure=!0;try{null!=localStorage.getItem(this.grid_key+"_POS")&&(this.gridOptions.api.ensureIndexVisible(parseInt(localStorage.getItem(this.grid_key+"_POS"))),localStorage.removeItem(this.grid_key+"_POS"))}catch(t){console.log(t)}}},t.prototype.ck_flag=function(){this.toggle_mantieni.checked?localStorage.setItem(this.grid_key+"_MANTIENI","NO"):localStorage.setItem(this.grid_key+"_MANTIENI","SI")},t.prototype.refresh_all_rows=function(){var t=this;setTimeout((function(){t.gridOptions.api.refreshCells({force:!0})}),0)},t.prototype.ch_config=function(){this.no_pref||(this.curr_config=this.gf.getValue(),"-1"!=this.curr_config&&(localStorage.removeItem(this.grid_key+"_COLS"),localStorage.removeItem(this.grid_key+"_FILTER"),localStorage.removeItem(this.grid_key+"_CFG_DEFAULT"),localStorage.removeItem(this.grid_key+"_FILTER_UP"),null!=this.gf.getObj().COL&&""!=this.gf.getObj().COL&&localStorage.setItem(this.grid_key+"_COLS",this.gf.getObj().COL),null!=this.gf.getObj().FILTER&&""!=this.gf.getObj().FILTER&&localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),null!=this.gf.getDescri()&&"-1"!=this.gf.getDescri()&&localStorage.setItem(this.grid_key+"_CFG_DEFAULT",this.gf.getDescri()),this.curr_config=this.gf.getValue(),this.res_columns(!0)))},t.prototype.elimina_config=function(){var t=this;null==this.gf.getObj().username||this.m_appService.user==this.gf.getObj().username?(localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler cancellare la configurazione "+this.gf.getDescri()+"?"),this.m_dialog.open(It,{disableClose:!0}).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="DELETE_CFG_GRID",i.types=["string","string"],i.values=[t.gf.getDescri(),t.grid_key];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione eliminata"),t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo(),t.curr_config="-1")}))}}))):this._toast.error("Configurazione gestibile da: "+this.gf.getObj().username)},t.prototype.edit_config=function(){var t=this;null==this.gf.getObj().username||this.m_appService.user==this.gf.getObj().username?(localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler sovrascrivere la configurazione "+this.gf.getDescri()+"?"),this.m_dialog.open(It,{disableClose:!0}).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="INSERT_UPDATE_CFG_GRID";var n="",o="";null!=localStorage.getItem(t.grid_key+"_COLS")&&(n=localStorage.getItem(t.grid_key+"_COLS")),null!=localStorage.getItem(t.grid_key+"_FILTER")&&(o=localStorage.getItem(t.grid_key+"_FILTER")),i.types=["string","string","string","string","string","string"],i.values=[t.gf.getDescri(),t.grid_key,n,"",o,t.m_appService.user];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione salvata"),t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo(),t.curr_config="-1")}),(function(t){}))}}))):this._toast.error("Configurazione gestibile da: "+this.gf.getObj().username)},t.prototype.refresh_access=function(t){this.toolbar_wkfapp=t},t.prototype.getGridApi=function(){return this.gridOptions.api},t.prototype.getGridOptions=function(){return this.gridOptions},t.prototype.insert_config=function(){var t=this;this.win_opt=this.m_dialog.open(re,{disableClose:!0}),setTimeout((function(){t.win_opt.componentInstance.title="Salva Configurazione",t.win_opt.componentInstance.label="Nome"})),this.win_opt.afterClosed().subscribe((function(e){if(e&&null!=e){var i=new vt;i.sql="INSERT_UPDATE_CFG_GRID";var n="",o="";null!=localStorage.getItem(t.grid_key+"_COLS")&&(n=localStorage.getItem(t.grid_key+"_COLS")),null!=localStorage.getItem(t.grid_key+"_FILTER")&&(o=localStorage.getItem(t.grid_key+"_FILTER")),i.types=["string","string","string","string","string","string"],i.values=[e,t.grid_key,n,"",o,t.m_appService.user];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione salvata"),!0,t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo())}),(function(t){}))}}))},t.prototype.prepare_filter=function(t){return t.split("'").join("$''").split("*").join("$*").split("?").join("$?").split("[").join("$[").split("]").join("$]").split("!").join("!$").split("ì").join("_").split("ù").join("_").split("à").join("_").split("ò").join("_").toUpperCase()},t.prototype.calcola_filtro=function(t,e,i,n){void 0===n&&(n=!0),console.log("calcola_filtro ",i,n);if(null!=t.type){if(null!=t.filter&&(n&&(e+=" and "),!0,"number"==t.filterType?("greaterThan"==t.type&&(e=e+" "+i+" > "+t.filter),"equals"==t.type&&(e=e+" "+i+" = "+t.filter),"notEqual"==t.type&&(e=e+" "+i+" <> "+t.filter),"lessThan"==t.type&&(e=e+" "+i+" < "+t.filter),"lessThanOrEqual"==t.type&&(e=e+" "+i+" <= "+t.filter),"greaterThanOrEqual"==t.type&&(e=e+" "+i+" >= "+t.filter),"inRange"==t.type&&(e=e+" ("+i+" >= "+t.filter+" and "+i+" <= "+t.filterTo+")")):("contains"==t.type&&(e=e+" upper("+i+") like '%"+this.prepare_filter(t.filter)+"%' ESCAPE '$'"),"startsWith"==t.type&&(e=e+" upper("+i+") like '"+this.prepare_filter(t.filter)+"%' ESCAPE '$'"),"equals"==t.type&&(e=e+" upper("+i+") = '"+t.filter.replace("'","''").toUpperCase()+"'"),"notContains"==t.type&&(e=e+"not upper("+i+") like '%"+this.prepare_filter(t.filter)+"%' ESCAPE '$'"),"notEqual"==t.type&&(e=e+" upper("+i+") <> '"+t.filter.replace("'","''").toUpperCase()+"'"),"endsWith"==t.type&&(e=e+" upper("+i+") like '%"+this.prepare_filter(t.filter)+"' ESCAPE '$'"))),"inRange"==t.type){if(null!=t.dateTo&&null!=t.dateFrom){if(t.dateFrom>=t.dateTo)return void this._toast.error("Data inizio range deve essere maggiore di data fine range");!0,n&&(e+=" and "),e=e+" ("+i+">="+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,5))+" and "+i+"<="+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateTo,5))+") "}}else if(null!=t.dateTo||null!=t.dateFrom){if(!0,n&&(e+=" and "),e+=" (",null!=t.dateFrom&&"dbnull"!=this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,5))){var o="";"greaterThan"==t.type&&(o=" "+i+" >= "+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,5))),"equals"==t.type&&(o=" ("+i+" >="+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,5))+" and "+i+" <="+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,5),"T23:59:00")+")"),"notEqual"==t.type&&(o=" "+i+" <> "+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,5))),"lessThan"==t.type&&(o=" "+i+" <= "+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,5)));var s=this.uti_s.string2date(t.dateFrom,5);s.setHours(23),s.setMinutes(59),"lessThanOrEqual"==t.type&&(o=" "+i+" <= "+this.uti_s.sql_date_grid(s)),"greaterThanOrEqual"==t.type&&(o=" "+i+" >= "+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,5))),e+=o}else e+="1=1";e+=" )"}}else{var a="",r="",l=!1;if(null!=t.values)for(var p=0;p<t.values.length;p++)null!=t.values[p]?(""!=r&&(r+=","),r=r+"'"+this.translate_back(t.values[p].replace("'","''"))+"'",""!=a&&(a+=" or "),a=a+" upper("+i+") like '%"+t.values[p].replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()+"%' ESCAPE '$'"):l=!0;var u=-1,c=this.gridOptions.api.getColumnDef(i);if(null!=c&&null!=c.filterParams&&null!=c.filterParams.values){var d=c.filterParams.values;null!=(d=d.filter((function(t,e){return d.indexOf(t)===e})))&&(u=d.length)}console.log("KEY!!!! ",i),"pers_int"!=i?""!=r?t.values.length!=u&&(!0,n&&(e+=" and "),e=l?e+"("+i+" in ("+r+") or "+i+" is null)":e+i+" in ("+r+")"):(!0,n&&(e+=" and "),l?e=e+" "+i+" is null":e+=" (1=0)"):""!=a&&(console.log("like_f ",a),!0,n&&(e+=" and "),e=e+"("+a+")")}return console.log("return filter_v ",e),e},t.prototype.onBtExport=function(){this.export_excel()},t.prototype.setHeaderHeight=function(t){var e=this;this.header_h=t,this.gridOptions.api.setHeaderHeight(this.header_h),this.gridOptions.suppressCopyRowsToClipboard=!0,this.gridOptions.sendToClipboard=function(t){console.log("v ",t),e.enable_copy&&e.clipboard.copy(t.data.split("\n")[0])}},t.prototype.getRowNodeId=function(t){return null==t||null==t.data?this.uti_s.newGuid():null!=t.data.id?String(t.data.id):null!=t.data.uiid?t.data.uiid:null!=t.data.codice?t.data.codice:"NA"},t.prototype.ngAfterViewInit=function(){var t=this;"PRO_H"==this.grid_key&&(this.no_pref=!0),setTimeout((function(){null==t.end_point&&(t.end_point=t.m_appService.API_ENDPOINT+t.m_appService.GRID_ENDPOINT),null!=localStorage.getItem(t.grid_key+"_FILTER_UP")&&(t.ric_libera=localStorage.getItem(t.grid_key+"_FILTER_UP")),t.onResize()}))},t.prototype.okr=function(t){t.data.nome_colonna=t.column.colDef.field,this.cell_edited.emit(t.data)},t.prototype.help_window=function(){""==this.overwrite_help_url?this.m_dialog.open(ae,{disableClose:!0}).afterClosed().subscribe((function(t){})):window.open(this.overwrite_help_url)},t.prototype.onResize=function(t){},t.prototype.autoSizeAll=function(){var t=this;if(null!=this.gridOptions&&null!=this.gridOptions.columnApi){var e=[];this.gridOptions.columnApi.getAllGridColumns().map((function(t){e.push(t.getColId())})),this.gridOptions.columnApi.autoSizeColumns(e),this.gridOptions.columnApi.getColumnState().length>0&&24==this.gridOptions.columnApi.getColumnState()[0].width?setTimeout((function(){t.autoSizeAll()}),300):this.save_cfg()}},t.prototype.fitSizeAll=function(){this.gridOptions.api.sizeColumnsToFit(),this.save_cfg()},t.prototype.selectCount=function(){var t=0;return this.gridOptions.api.forEachNode((function(e){e.isSelected()&&t++})),t},t.prototype.getquerySelected=function(t,e){var i="";return"String"==e&&this.gridOptions.api.forEachNode((function(e){e.isSelected()&&null!=e.data[t]&&(""!=i&&(i+=","),i=i+"'"+e.data[t]+"'")})),"Number"==e&&this.gridOptions.api.forEachNode((function(e){e.isSelected()&&null!=e.data[t]&&(""!=i&&(i+=","),i+=e.data[t])})),i},t.prototype.selectAllFiltered=function(){this.gridOptions.api.forEachNode((function(t){t.setSelected(!0)}))},t.prototype.deselectAllFiltered=function(){this.gridOptions.api.forEachNode((function(t){t.setSelected(!1)}))},t.prototype.pulisci_filtri=function(t){void 0===t&&(t=!0),localStorage.removeItem(this.grid_key+"_FILTER"),t&&((""!=this.ric_libera||this.last_riclib)&&this.doFill("",!0,!1),this.ric_libera="",localStorage.removeItem(this.grid_key+"_FILTER_UP")),this.fix_flt_temp="",this.gridOptions.api.setFilterModel(null);this.gridOptions.api.setFilterModel({})},t.prototype.export_excel=function(t){var e=this;if(void 0===t&&(t="xlsx"),this.custom_export)this.command.emit({cmd:"export_excel",v:t});else if(this.num_r>2e4)this._toast.error("Massimo 20000 elementi esportabili");else{t="."+t,this.uiid_stampa=this.uti_s.newGuid(),this.xxopx=0;this.dialogRef_W=this.m_dialog.open(Nt,{disableClose:!0}),setTimeout((function(){e.dialogRef_W.componentInstance.label="EXPORT IN CORSO"}));for(var i=[],n="",o=this.gridOptions.columnApi.getAllDisplayedColumns(),s=0;s<o.length;s++)o[s].getColDef().field.length<60&&(""!=n&&(n+=","),null==o[s].getColDef().headerName||""==o[s].getColDef().headerName?n+="["+o[s].getColDef().field+"]":n+="["+o[s].getColDef().field+"] ["+o[s].getColDef().headerName.split("[").join("").split("]").join("")+"]");-1!=this.fields.indexOf("DISTINCT")&&(n="DISTINCT "+n),i.push(this.officeService.operation("GB_XLS_APRI","tpl_report.xlsx",this.uiid_stampa+".xlsx",this.xxopx++));var a="GB_CREA_TABELLA_FROM_DB";2==this.system_dest&&(a="GB_CREA_TABELLA_FROM_DB1"),""==this.export_field_aggiuntivi?i.push(this.officeService.operation(a,"select "+n+" from "+this.tbl_name+" "+this.str_curr_q_p,"3",this.xxopx++)):i.push(this.officeService.operation(a,"select "+n+","+this.export_field_aggiuntivi+" from "+this.tbl_name+" "+this.str_curr_q_p,"3",this.xxopx++)),i.push(this.officeService.operation("GB_XLS_SAVE",this.m_appService.LOCAL_PATH+"grid_reports\\"+this.uiid_stampa+"_"+this.m_appService.user+t,"",this.xxopx++)),this.officeService.runCommands(this.uiid_stampa,i,this.dialogRef_W,!1).subscribe((function(i){e.check_end(t)}))}},t.prototype.check_end=function(t){var e=this,i=new gt;i.p1=this.m_appService.LOCAL_PATH+"grid_reports\\"+this.uiid_stampa+"_"+this.m_appService.user+t,i.command="check_file",this._fileService.doQuery(i).subscribe((function(i){null!=i&&("N"==i.msg?setTimeout((function(){e.check_end(t)}),5e3):(setTimeout((function(){e.dialogRef_W.componentInstance.update_progess(100)})),window.open(e.m_appService.COMPANY_SITE_ROOT+"/grid_reports/"+e.uiid_stampa+"_"+e.m_appService.user+t)))}))},t.prototype.print=function(){this.custom_export?this.command.emit({cmd:"print_pdf"}):this.export_excel("pdf")},t.prototype.init_conf=function(){},t.prototype.createColumnDefs=function(t){},t.prototype.ckk=function(){var t=this;if(this.auto_load)if(null!=this.columnDefs)if(0!=this.columnDefs.length){if(!this.ckk_ed){if(this.ckk_ed=!0,null!=this.toggle_mantieni&&(this.toggle_mantieni.checked=!0,null!=localStorage.getItem(this.grid_key+"_MANTIENI")&&"NO"==localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.toggle_mantieni.checked=!1)),this.res_columns(),null!=localStorage.getItem(this.grid_key+"_POS")&&(this.b_restored=!0),null!=localStorage.getItem(this.grid_key+"_FILTER_UP")&&""!=localStorage.getItem(this.grid_key+"_FILTER_UP")){this.ric_libera=localStorage.getItem(this.grid_key+"_FILTER_UP");for(var e=this.ric_libera.split(" "),i=new Array,n=0;n<e.length;n++)i.push(e[n]);if(0==i.length)return;var o="",s=function(e){for(var n="",s=0;s<a.columnDefs.length;s++)null!=a.columnDefs[s]&&null==a.columnDefs[s].no_filter&&null!=a.columnDefs[s].field&&""!=a.columnDefs[s].field&&"agDateColumnFilter"!=a.columnDefs[s].filter&&(""!=n&&(n+=" or "),n+=a.columnDefs[s].field+" LIKE '%"+a.prepare_filter(i[e])+"%' ESCAPE '$'");null!=a.full_text_added_columns&&a.full_text_added_columns.map((function(o){null!=o&&""!=o&&(""!=n&&(n+=" or "),n+=o+" LIKE '%"+t.prepare_filter(i[e])+"%' ESCAPE '$'")})),""!=n&&(""!=o&&(o+=" and "),o+="("+n+")")},a=this;for(n=0;n<i.length;n++)s(n);null!=this.full_text_added_query&&this.full_text_added_query.map((function(e){null!=e&&""!=e&&(""!=o&&(o="("+o+") or "),o+=e.split("_VALORE_").join(t.uti_s.string_sqlvalue(t.ric_libera).replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()))})),this.fix_flt_temp=o}this.init_fill&&setTimeout((function(){t.ref_dt()}),100)}}else setTimeout((function(){t.ckk()}),500);else setTimeout((function(){t.ckk()}),500)},t.prototype.set_init_size=function(){var t=this;0!=this.myData.length?this.columnDefs.length<=6?this.fitSizeAll():this.autoSizeAll():setTimeout((function(){t.set_init_size()}),500)},t.prototype.res_columns=function(t){var e=this;if(void 0===t&&(t=!1),null!=this.columnDefs)if(0!=this.columnDefs.length){var i=!1;if(null!=this.toggle_mantieni&&(i=this.toggle_mantieni.checked),null!=localStorage.getItem(this.grid_key+"_COLS")&&""!=localStorage.getItem(this.grid_key+"_COLS")){if(null!=localStorage.getItem(this.grid_key+"_COLS")&&(i||t)&&""!=localStorage.getItem(this.grid_key+"_COLS")){!0;try{for(var n=JSON.parse(localStorage.getItem(this.grid_key+"_COLS")),o=!0,s=0;s<n.length;s++)n[s].hide||(o=!1);o?localStorage.getItem(this.grid_key+"_COLS"):this.gridOptions.columnApi.setColumnState(JSON.parse(localStorage.getItem(this.grid_key+"_COLS")))}catch(t){console.log(t)}}if(null!=localStorage.getItem(this.grid_key+"_FILTER")&&(i||t)&&""!=localStorage.getItem(this.grid_key+"_FILTER"))try{this.gridOptions.api.setFilterModel(JSON.parse(localStorage.getItem(this.grid_key+"_FILTER")))}catch(t){console.log(t)}}else this.set_init_size()}else setTimeout((function(){e.res_columns(t)}),200);else setTimeout((function(){e.res_columns(t)}),200)},t.prototype.getRows=function(){return this.gridOptions.rowData},t.prototype.sortAndFilter=function(t,e){},t.prototype.ref_dt=function(){var t=this;null==this.gridOptions||null==this.gridOptions.api?setTimeout((function(){t.ref_dt()}),500):this.gridOptions.api.setDatasource(this.dataSource)},t.prototype.updateRow=function(){this.refresh_all_rows()},t.prototype.onModelUpdated=function(){},t.prototype.onReady=function(t){this.gridApi=t.api,this.setHeaderHeight(this.header_h),0!=this.num_per_pag&&(this.gridOptions.paginationPageSize=this.num_per_pag,this.gridOptions.cacheBlockSize=this.num_per_pag),null!=this.gf&&this.show_buttons&&!this.pref_hidden&&(this.gf.sql="SELECT_CFG_GRID",this.gf.types=["string"],this.gf.values=[this.grid_key],this.gf.fillCombo(),"NO"!=localStorage.getItem(this.grid_key+"_MANTIENI")&&null!=localStorage.getItem(this.grid_key+"_CFG_DEFAULT"))||this.auto_load&&this.onready_go()},t.prototype.init_grid=function(){this.auto_load=!0,this.onready_go()},t.prototype.save_cfg=function(){localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.fe_cfg=function(){null!=this.gf&&null!=this.gf.getObj()&&"NO"!=localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.gf.setByDescri(localStorage.getItem(this.grid_key+"_CFG_DEFAULT")),localStorage.setItem(this.grid_key+"_COLS",this.gf.getObj().COLS),localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),this.curr_config=this.gf.getValue()),this.onready_go()},t.prototype.onready_go=function(){var t=this;this.ready=!0,setTimeout((function(){t.ckk()}),10),this.b_iniended||(this.b_iniended=!0,this.init_end.emit())},t.prototype.init_filters=function(){},t.prototype.keyDownFunctioncl=function(t){13==t.keyCode&&this.free_search()},t.prototype.free_search=function(){var t=this;if(""==this.ric_libera)return this.pulisci_filtri(),this.fix_flt_temp="",this.doFill("",!0,!1),void localStorage.removeItem(this.grid_key+"_FILTER_UP");localStorage.setItem(this.grid_key+"_FILTER_UP",this.ric_libera);for(var e=this.ric_libera.split(" "),i=new Array,n=0;n<e.length;n++)i.push(e[n]);if(0!=i.length){var o="",s=function(e){for(var n="",s=0;s<a.columnDefs.length;s++)null!=a.columnDefs[s]&&null==a.columnDefs[s].no_filter&&null!=a.columnDefs[s].field&&""!=a.columnDefs[s].field&&"agDateColumnFilter"!=a.columnDefs[s].filter&&(""!=n&&(n+=" or "),n+=a.columnDefs[s].field+" LIKE '%"+a.prepare_filter(i[e])+"%' ESCAPE '$'");null!=a.full_text_added_columns&&a.full_text_added_columns.map((function(o){null!=o&&""!=o&&(""!=n&&(n+=" or "),n+=o+" LIKE '%"+t.prepare_filter(i[e])+"%' ESCAPE '$'")})),""!=n&&(console.log("ADDO "),""!=o&&(o+=" and "),o+="("+n+")")},a=this;for(n=0;n<i.length;n++)s(n);null!=this.full_text_added_query&&this.full_text_added_query.map((function(e){null!=e&&""!=e&&(""!=o&&(o="("+o+") or "),o+=e.split("_VALORE_").join(t.uti_s.string_sqlvalue(t.ric_libera).replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()))})),this.pulisci_filtri(!1),this.doFill_Temp(o,!0)}},t.prototype.onCellClicked=function(t){this.cell_clicked.emit(t)},t.prototype.onCellValueChanged=function(t){},t.prototype.onCellDoubleClicked=function(t){},t.prototype.onCellFocused=function(t){},t.prototype.onSelectionChanged=function(t){var e=this.getGridApi().getSelectedNodes().length;this.selection_change.emit(e),console.log("selectionChanged")},t.prototype.onBeforeFilterChanged=function(){},t.prototype.oncolumnEverythingChanged=function(t){this.b_init&&localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.onFilterModified=function(){var t=this;this.no_pref||setTimeout((function(){t.b_init&&localStorage.setItem(t.grid_key+"_FILTER",JSON.stringify(t.gridOptions.api.getFilterModel()))}),200)},t.prototype.onBeforeSortChanged=function(){},t.prototype.onAfterSortChanged=function(){this.no_pref||this.b_init&&localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.onVirtualRowRemoved=function(t){},t.prototype.onRowClicked=function(t){var e=this.gridOptions.api.getSelectedNodes();null!=e&&null!=e[0]&&(localStorage.setItem(this.grid_key+"_POS",String(e[0].rowIndex)),localStorage.setItem(this.grid_key+"_POS_BAR",JSON.stringify(this.gridOptions.api.getVerticalPixelRange())),localStorage.setItem(this.grid_key+"_POS2",this.getRowNodeId(e[0]))),this.sRow=t.data,localStorage.setItem(this.grid_key+"_LAST_ROW",JSON.stringify(this.sRow)),this.clicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&(this.columndclicked.emit(t),this.dclicked.emit(t.data))},t.prototype.onRowDClicked=function(t){this.dclicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&this.columndclicked.emit(t)},t.prototype.onQuickFilterChanged=function(t){this.gridOptions.api.setQuickFilter(t.target.value)},t.prototype.onColumnEvent=function(t){this.columndclicked.emit(t)},t.prototype.doFill=function(t,e,i){var n=this;void 0===e&&(e=!0),void 0===i&&(i=!0),e&&(this.filters=""),i&&(this.fix_flt=t),this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout((function(){n.ckk()}),10)},t.prototype.doFill_Temp=function(t,e){var i=this;void 0===e&&(e=!0),e&&(this.filters=""),this.fix_flt_temp=t,this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout((function(){i.Refresh()}),10)},t.prototype.Refresh=function(){this.ref_dt()},t.prototype.RefreshOnlyMemory=function(){this.updateRow()},t}();ce.decorators=[{type:n.Component,args:[{selector:"FHGrid",template:'<div fxLayout="column" fxFlexFill>\n <div\n fxLayout="row"\n fxLayout.xs="column"\n fxLayoutAlign="center start"\n fxLayoutGap="3px"\n style="min-height: 55px;"\n [hidden]="!show_buttons"\n >\n \n <div fxLayout="row" fxLayoutGap="3px" fxLayoutAlign="start center">\n <div>\n <h5>{{num_r}} {{label_elementi | translate}}</h5>\n </div>\n \n\n <div fxLayout="row" fxLayoutAlign="start center">\n <input\n matInput\n [placeholder]="trova_label | translate"\n (keydown)="keyDownFunctioncl($event)"\n [(ngModel)]="ric_libera"\n [matTooltip]="search_field_tooltip"\n style="\n width: 160px;\n border: 1px solid;\n min-height: 30px;\n "\n />\n </div>\n\n <div\n matTooltip="REMOVE FILTER"\n matTooltipPosition="above"\n *ngIf="show_pulisci_filtri"\n >\n <button mat-flat-button (click)="pulisci_filtri()" color="warn">\n <mat-icon>filter_none</mat-icon> \n </button>\n </div>\n <div matTooltip="AUTO SIZE" matTooltipPosition="above">\n <button\n mat-flat-button\n (click)="autoSizeAll()"\n color="primary"\n *ngIf="show_buttons"\n >\n <mat-icon>swap_horiz</mat-icon>\n </button>\n </div>\n <div fxHide fxShow.gt-sm matTooltip="FIT SIZE" matTooltipPosition="above">\n <button\n mat-flat-button\n (click)="fitSizeAll()"\n color="primary"\n *ngIf="show_buttons"\n >\n <mat-icon>keyboard_tab</mat-icon>\n </button>\n </div>\n <div fxHide fxShow.gt-sm matTooltip="Refresh" matTooltipPosition="above">\n <button\n mat-flat-button\n (click)="Refresh()"\n color="primary"\n *ngIf="show_buttons"\n >\n <mat-icon>autorenew</mat-icon>\n </button>\n </div>\n <FHFilterComboBox\n fxHide [label]="\'Configurazioni Salvate\' | translate"\n fxShow.gt-sm\n [hidden]="!show_buttons || pref_hidden"\n (selchange)="ch_config()"\n (fillend)="fe_cfg()"\n #gf\n init_fill="false"\n ></FHFilterComboBox>\n <div\n matTooltip="Modifica Preferenza"\n matTooltipPosition="above"\n *ngIf="curr_config!=\'-1\'"\n >\n <button\n mat-icon-button\n *ngIf="show_buttons && !pref_hidden"\n style="color: rgb(248, 105, 10);"\n >\n <mat-icon (click)="edit_config()">save</mat-icon>\n </button>\n </div>\n <div\n matTooltip="Elimina Preferenza"\n matTooltipPosition="above"\n *ngIf="curr_config!=\'-1\'"\n >\n <button\n mat-icon-button\n *ngIf="show_buttons && !pref_hidden"\n style="color: rgb(248, 105, 10);"\n >\n <mat-icon (click)="elimina_config()">delete</mat-icon>\n </button>\n </div>\n <div\n fxHide\n fxShow.gt-sm\n matTooltip="Crea Nuova Preferenza"\n matTooltipPosition="above"\n >\n <button\n mat-icon-button\n style="color: rgb(16, 98, 16);"\n *ngIf="show_buttons && !pref_hidden"\n >\n <mat-icon (click)="insert_config()">library_add</mat-icon>\n </button>\n </div>\n\n <mat-slide-toggle\n fxHide\n fxShow.gt-sm\n [hidden]="!show_buttons || pref_hidden"\n (click)="ck_flag()"\n #toggle_mantieni\n >\n {{mantieni_impostazioni}}\n </mat-slide-toggle>\n\n \n <div fxHide fxShow.gt-sm matTooltip="HELP" matTooltipPosition="above">\n <button\n mat-flat-button\n (click)="help_window()"\n color="primary"\n *ngIf="show_buttons && show_help"\n >\n <mat-icon>help</mat-icon>\n </button>\n </div>\n \n\n <img\n *ngIf="enable_export && enable_export_pdf"\n matTooltip="EXPORT PDF"\n matTooltipPosition="above"\n src="assets/icons/square-o/pdf.svg"\n style="width: 24px; height: 24px; cursor: pointer"\n (click)="print()"\n alt="Export Excel"\n width="24" height="24"\n />\n\n\n <img *ngIf="enable_export && enable_export_xls"\n matTooltip="EXPORT EXCEL"\n matTooltipPosition="above"\n src="assets/icons/square-o/xlsx.svg"\n style="width: 24px; height: 24px; cursor: pointer"\n (click)="export_excel()"\n alt="Export Excel"\n width="24" height="24"\n />\n\n <div *ngIf="flt_aggiuntivo.length!=0"> </div>\n <mat-form-field *ngIf="flt_aggiuntivo.length!=0"\n\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ flt_aggiuntivo_label|translate }}</mat-label>\n <mat-select\n\n [(ngModel)]="flt_aggiuntivo_value"\n (selectionChange)="sc()"\n >\n <mat-option value="{{ app.valore }}" *ngFor="let app of flt_aggiuntivo">{{\n app.descrizione_valore | translate\n }}</mat-option>\n </mat-select>\n </mat-form-field>\n \n <mat-spinner diameter="25" *ngIf="loading_fulltext"></mat-spinner>\n\n </div>\n <div\n fxLayout="row"\n fxLayoutAlign="end center"\n\n [style.width]="width_max"\n *ngIf="enabled"\n >\n\n <FHGridToolBar\n (command)="docmd($event)"\n [type]="toolbar_type"\n [show_link]="show_link"\n [show_help]="show_help_bar"\n [help_label]="help_label_bar"\n [custom_commands]="toolbar_custom_commands"\n [toolbar_wkfapp]="toolbar_wkfapp"\n [elimina_label]="elimina_label"\n [b_wait]="b_wait"\n [sRow]="sRow"\n ></FHGridToolBar>\n </div>\n </div>\n\n\n <div fxLayout="row" style="width: 100%;" [fxFlex]="show_buttons ? 100:95">\n <ag-grid-angular\n ref-agGrid\n style="width: 100%; height: 100%;"\n id="myGrid"\n (cellDoubleClicked)="onColumnEvent($event)"\n (cellClicked)="onCellClicked($event)"\n [headerHeight]="header_h"\n [groupHeaderHeight]="header_h"\n class="ag-theme-balham"\n [singleClickEdit]="true"\n [gridOptions]="gridOptions"\n [columnDefs]="columnDefs"\n [rowData]="rowData"\n [rowSelection]="selection_mode"\n [tooltipShowDelay]="tooltipShowDelay"\n [getContextMenuItems]="enable_export ? getContextMenuItems_e:getContextMenuItems_n_e"\n (filterModified)="onFilterModified()"\n (rowDoubleClicked)="onRowDClicked($event)"\n (rowClicked)="onRowClicked($event)"\n (columnVisible)="oncolumnEverythingChanged($event)"\n (columnResized)="oncolumnEverythingChanged($event)"\n (columnMoved)="oncolumnEverythingChanged($event)"\n (cellValueChanged)="okr($event)"\n (sortChanged)="onAfterSortChanged()"\n (selectionChanged)="onSelectionChanged($event)"\n [paginationPageSize]="num_per_pag"\n (gridReady)="onReady($event)"\n >\n </ag-grid-angular>\n </div>\n</div>\n',styles:[""]}]}],ce.ctorParameters=function(){return[{type:se},{type:i.ToastrService},{type:Dt},{type:wt},{type:h.SlimLoadingBarService},{type:e.MatDialog},{type:Ct},{type:ue},{type:Tt},{type:m.Clipboard},{type:p.TranslateService}]},ce.propDecorators={flt_aggiuntivo:[{type:n.Input}],flt_aggiuntivo_value:[{type:n.Input}],flt_aggiuntivo_label:[{type:n.Input}],overwrite_help_url:[{type:n.Input}],over_fulltext:[{type:n.Input}],b_wait:[{type:n.Input}],over_fulltext_types:[{type:n.Input}],over_fulltext_values:[{type:n.Input}],over_fulltext_sql:[{type:n.Input}],tooltipShowDelay:[{type:n.Input}],elimina_label:[{type:n.Input}],export_field_aggiuntivi:[{type:n.Input}],end_point:[{type:n.Input}],tbl_name:[{type:n.Input}],columnDefs:[{type:n.Input}],count_tbl_name:[{type:n.Input}],search_field_tooltip:[{type:n.Input}],num_per_pag:[{type:n.Input}],grid_key:[{type:n.Input}],sort_field:[{type:n.Input}],fields:[{type:n.Input}],filters:[{type:n.Input}],enabled:[{type:n.Input}],show_link:[{type:n.Input}],show_help_bar:[{type:n.Input}],help_label_bar:[{type:n.Input}],auto_load:[{type:n.Input}],auto_height:[{type:n.Input}],enable_export:[{type:n.Input}],enabled_pag:[{type:n.Input}],show_help:[{type:n.Input}],show_num_elem:[{type:n.Input}],system_dest:[{type:n.Input}],header_h:[{type:n.Input}],selection_mode:[{type:n.Input}],init_fill:[{type:n.Input}],no_pref:[{type:n.Input}],pref_hidden:[{type:n.Input}],enable_export_pdf:[{type:n.Input}],enable_export_xls:[{type:n.Input}],enable_copy:[{type:n.Input}],full_text_added_columns:[{type:n.Input}],full_text_added_query:[{type:n.Input}],autosize_at_ini:[{type:n.Input}],label_elementi:[{type:n.Input}],trova_label:[{type:n.Input}],mantieni_impostazioni:[{type:n.Input}],flt_aggiuntivo_event:[{type:n.Output}],show_buttons:[{type:n.Input}],fill_end:[{type:n.Output}],cell_edited:[{type:n.Output}],clicked:[{type:n.Output}],dclicked:[{type:n.Output}],columndclicked:[{type:n.Output}],cell_clicked:[{type:n.Output}],selection_change:[{type:n.Output}],custom_export:[{type:n.Input}],toolbar_type:[{type:n.Input}],toolbar_wkfapp:[{type:n.Input}],toolbar_custom_commands:[{type:n.Input}],command:[{type:n.Output}],gf:[{type:n.ViewChild,args:["gf"]}],toggle_mantieni:[{type:n.ViewChild,args:["toggle_mantieni"]}],init_end:[{type:n.Output}],off_set:[{type:n.Input}],include_always:[{type:n.Input}],onResize:[{type:n.HostListener,args:["window:resize",["event"]]}]};var de={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return _e})),multi:!0},_e=function(){function t(t,e,i){this._dataService=t,this._dataService_odbc=e,this._tsr=i,this.error=null,this.init_fill=!0,this.sql="",this.types=[],this.values=[],this.hidden=!1,this.label="",this.enabled=!0,this.required=!1,this.load_delay=0,this.show_empty=!0,this.sel_label="",this.tooltip="",this.option_values="",this.fillend=new n.EventEmitter,this.selchange=new n.EventEmitter,this.initend=new n.EventEmitter,this.myData=[],this.valDef="-1",this.selval="-1",this.errorMsg="",this.db_type="1",this.dis_value="",this.is_loaded=!1,this.descri_val="",this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.setValue=function(t){this.setByValue(t)},t.prototype.update_dis=function(){this.dis_value="";try{if(null!=this.descri_val&&""!=this.descri_val)return void(this.dis_value=this._tsr.instant(this.descri_val));null==this.valDef?this.dis_value="":""!=this.valDef.split("-1").join("")?this.dis_value=this._tsr.instant(this.valDef.split("-1").join("")):this.dis_value=""}catch(t){this.dis_value=this.selval}},t.prototype.resetValue=function(){this.selval="-1",this.valDef="-1",this.descri_val="",this.update_dis()},t.prototype.focus=function(){this.smtr.nativeElement.focus()},t.prototype.reset=function(){this.selval="-1",this.valDef="-1",this.myData=new Array,this.update_dis()},t.prototype.fillCombo=function(){var t=this;if(null==this.sql&&(this.sql=""),-1==this.sql.indexOf("|")||-1==this.sql.indexOf("$"))if(null==this.option_values||""==this.option_values){var e=new vt;e.sql=this.sql,e.types=this.types,e.values=this.values,"1"==this.db_type&&this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=0;i<e.result_data.length;i++)null!=e.result_data[i].descrizione_valore&&""!=e.result_data[i].descrizione_valore&&(e.result_data[i].descrizione_valore=t._tsr.instant(e.result_data[i].descrizione_valore));t.resetD(e.result_data)}})),"2"==this.db_type&&this._dataService_odbc.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=0;i<e.result_data.length;i++)null!=e.result_data[i].VALORE&&(e.result_data[i].valore=e.result_data[i].VALORE),null!=e.result_data[i].DESCRIZIONE_VALORE&&(e.result_data[i].descrizione_valore=e.result_data[i].DESCRIZIONE_VALORE),null!=e.result_data[i].descrizione_valore&&""!=e.result_data[i].descrizione_valore&&(e.result_data[i].descrizione_valore=t._tsr.instant(e.result_data[i].descrizione_valore));t.resetD(e.result_data)}}))}else this.set_options(this.option_values);else this.set_options(this.sql)},t.prototype.add_option=function(t){var e=!1;this.myData.map((function(i){i.descrizione_valore!=t.descrizione_valore&&i.valore!=t.valore||(e=!0)})),e||this.myData.push(t)},t.prototype.resetD=function(t){this.myData=t,this.selval="-1",this.setByValue(this.valDef),"-1"==this.getValue()&&"-1"!=this.valDef&&null!=this.valDef&&""!=this.valDef&&this.setByDescri(this._tsr.instant(this.valDef)),this.is_loaded=!0,this.fillend.emit()},t.prototype.setByDescri=function(t){if(this.valDef=t,this.selval="-1",""!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){for(var e=0;e<this.myData.length;e++)if(this.myData[e].descrizione_valore==t)return this.selval=""+this.myData[e].valore,null!=this.myData[e].descrizione_valore&&(this.descri_val=this.myData[e].descrizione_valore),void this.update_dis();if(null!=t&&""!=t&&"-1"!=t){for(var i=!1,n=0;n<this.myData.length;n++)if(null!=this.myData[n].valore&&this.myData[n].valore==t){i=!0;break}i||this.add_option({valore:t,descrizione_valore:t}),this.selval=t,this.descri_val=t}this.update_dis()}},t.prototype.setByIndex=function(t){this.valDef="",this.selval="-1",null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]&&this.myData.length>t&&this.setByDescri(this._tsr.instant(this.myData[t].descrizione_valore))},t.prototype.getObj=function(){if(null==this.selval)return null;if("-1"==this.selval)return null;for(var t=0;t<this.myData.length;t++)if(this.myData[t].valore==this.selval)return this.myData[t]},t.prototype.setByValue=function(t){if(this.valDef=t,this.selval="-1",""+t=="")return this.descri_val="",void this.update_dis();if(null==this.myData&&null!=t&&""!=t){if("-1"==t)return;this.myData=[],this.add_option({valore:t,descrizione_valore:t})}if((0==this.myData.length||null==this.myData[0])&&null!=t&&""!=t){if("-1"==t)return;this.myData=[],this.add_option({valore:t,descrizione_valore:t})}for(var e=0;e<this.myData.length;e++)if(this.myData[e].valore==t)return this.selval=""+this.myData[e].valore,null!=this.myData[e].descrizione_valore&&(this.descri_val=this.myData[e].descrizione_valore),void this.update_dis();if(null!=t&&""!=t&&"-1"!=t){for(var i=!1,n=0;n<this.myData.length;n++)if(null!=this.myData[n].valore&&this.myData[n].valore==t){i=!0;break}i||this.add_option({valore:t,descrizione_valore:t}),this.selval=t,this.descri_val=t}this.update_dis()},t.prototype.getDescri=function(){if(!this.enabled){if(null==this.selval)return this.valDef;if("-1"==this.selval)return this.valDef}if(null==this.selval)return"-1";if("-1"==this.selval)return"-1";for(var t=0;t<this.myData.length;t++)if(this.myData[t].valore==this.selval)return this.myData[t].descrizione_valore},t.prototype.getValue=function(){if(!this.enabled){if(null==this.selval)return this.valDef;if("-1"==this.selval)return this.valDef}return null==this.selval||""==this.selval?"-1":this.selval},t.prototype.getData=function(t){for(var e in this.myData)if(this.myData[e].valore==this.selval)return this.myData[e][t]},t.prototype.set_options=function(t){this.myData=new Array;for(var e=t.split("$"),i=0;i<e.length;i++){var n=new Object,o=e[i].split("|");n.valore=o[1],n.descrizione_valore=this._tsr.instant(o[0]),this.add_option(n)}this.setByValue(this.valDef),this.is_loaded=!0,"-1"==this.getValue()&&(""!=this.valDef?this.setByDescri(this._tsr.instant(this.valDef)):this.setByDescri(this.valDef))},t.prototype.doFill=function(){var t=this;0!=this.load_delay?setTimeout((function(){t.fillCombo()}),this.load_delay):this.fillCombo()},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(1==t.init_fill){if(""==t.sql)return void setTimeout((function(){t.is_loaded=!0}),1e3);t.doFill()}else t.errorMsg="";t.initend.emit(),setTimeout((function(){t.is_loaded=!0}),1e3)}))},t.prototype.sc=function(){var t=this;this.onChange(this.getValue()),setTimeout((function(){t.selchange.emit({event:t.getObj(),valore:t.getValue(),descrizione_valore:t.getDescri()}),t.update_dis(),t.dis_value=t.getDescri()}))},t.prototype.getModelValue=function(){return this.getData("valore")},t.prototype.writeValue=function(t){null!=t&&null!=t&&(this.resetValue(),this.setByValue(t))},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}();_e.decorators=[{type:n.Component,args:[{selector:"FHComboBox",providers:[de],template:'\n <div style="min-height:45px" *ngIf="enabled && !hidden && !is_loaded && myData?.length==0"><mat-spinner diameter="25" ></mat-spinner></div>\n <mat-form-field\n [hidden]="!enabled || hidden || (!is_loaded && myData?.length==0)" [class.fh_field]="enabled"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label|translate }}</mat-label>\n <mat-select\n #cmb\n [(ngModel)]="selval"\n (selectionChange)="sc()"\n [required]="required"\n [matTooltip]="tooltip"\n >\n <mat-option value="-1" *ngIf="show_empty">{{ sel_label }}</mat-option>\n <mat-option value="{{ app.valore }}" *ngFor="let app of myData">{{\n app.descrizione_valore | translate\n }}</mat-option>\n </mat-select>\n <mat-error *ngIf="error==null">{{ error }}</mat-error>\n </mat-form-field>\n\n <mat-form-field\n [hidden]="enabled || hidden" [class.fh_field_dis]="!enabled"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n <input\n type="text"\n #el1\n matInput\n [disabled]="true"\n [(ngModel)]="dis_value"\n [matTooltip]="tooltip"\n />\n </mat-form-field>\n ',styles:[""]}]}],_e.ctorParameters=function(){return[{type:Dt},{type:Qt},{type:p.TranslateService}]},_e.propDecorators={error:[{type:n.Input}],init_fill:[{type:n.Input}],sql:[{type:n.Input}],types:[{type:n.Input}],values:[{type:n.Input}],hidden:[{type:n.Input}],label:[{type:n.Input}],enabled:[{type:n.Input}],required:[{type:n.Input}],load_delay:[{type:n.Input}],show_empty:[{type:n.Input}],sel_label:[{type:n.Input}],tooltip:[{type:n.Input}],option_values:[{type:n.Input}],smtr:[{type:n.ViewChild,args:["cmb"]}],fillend:[{type:n.Output}],selchange:[{type:n.Output}],initend:[{type:n.Output}],valDef:[{type:n.Input}],db_type:[{type:n.Input}]};var he={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return me})),multi:!0},me=function(){function t(t,e){this._dataService=t,this._dataService_odbc=e,this.init_fill=!0,this.error=null,this.sql="",this.label="",this.types=[],this.values=[],this.hidden=!1,this.id_loading=!1,this.db_type="1",this.enabled=!0,this.open_on_load=!0,this.option_values="",this.required=!1,this.only_from_list=!1,this.fillend=new n.EventEmitter,this.selchange=new n.EventEmitter,this.change=new n.EventEmitter,this.initend=new n.EventEmitter,this.focusout=new n.EventEmitter,this.descri_val="",this.load_delay=0,this.sItem="",this.searchItemsFiltered=[],this.myData=[],this.is_loaded=!1,this.selval=null,this.errorMsg="",this.valDef="",this.table_hidden=!0,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.fi_search=function(){null==this.sItem&&(this.sItem="",this.onChange(""))},t.prototype.fo_search=function(t){var e=this;setTimeout((function(){e.only_from_list?(e.onChange(e.getValue()),e.change.emit(e.getValue())):(e.onChange(e.sItem),e.change.emit(e.sItem))})),this.focusout.emit()},t.prototype.onChange_up=function(t){if(this.searchItemsFiltered=[],null!=this.sItem)if(""!=this.sItem){var e=this.sItem.toLowerCase();if(null!=this.myData)for(var i=0;i<this.myData.length&&(null!=this.myData[i].descrizione_valore&&-1!=this.myData[i].descrizione_valore.toLowerCase().indexOf(e)&&this.searchItemsFiltered.push(this.myData[i]),!(e.length<4&&20==this.searchItemsFiltered.length));i++);}else if(null!=this.myData)for(i=0;i<this.myData.length&&(this.searchItemsFiltered.push(this.myData[i]),20!=i);i++);},t.prototype.add_option=function(t){var e=!1;this.myData.map((function(i){i.descrizione_valore!=t.descrizione_valore&&i.valore!=t.valore||(e=!0)})),e||this.myData.push(t)},t.prototype.selectedSearchItem=function(t){this.setByDescri(t.option.value),this.sItem=t.option.value,this.ch(t)},t.prototype.ch=function(t){this.getValue();this.selchange.emit({event:t,valore:this.getValue(),descrizione_valore:this.sItem}),this.only_from_list?(this.onChange(this.getValue()),this.change.emit(this.getValue())):(this.onChange(this.sItem),this.change.emit(this.sItem))},t.prototype.myListFormatter=function(t){return t.descrizione_valore},t.prototype.resetValue=function(t){void 0===t&&(t=!0),this.selval="",t&&(this.valDef=""),this.sItem="",this.selval=null},t.prototype.reset=function(){this.selval="",this.valDef="",this.selval=null,this.sItem="",this.myData=new Array},t.prototype.doFill=function(){var t=this;setTimeout((function(){t.fillCombo()}),this.load_delay)},t.prototype.fillCombo=function(){var t=this;if(console.log("fillcombo ",this.option_values),this.myData=new Array,this.searchItemsFiltered=new Array,null==this.sql&&(this.sql=""),null==this.option_values&&(this.option_values=""),-1==this.sql.indexOf("|")||-1==this.sql.indexOf("$"))if(""==this.option_values){var e=new vt;e.sql=this.sql,e.types=this.types,e.values=this.values,"1"==this.db_type&&this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.resetD(e.result_data),t.is_loaded=!0,t.fillend.emit())})),"2"==this.db_type&&this._dataService_odbc.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=0;i<e.result_data.length;i++)null!=e.result_data[i].VALORE&&(e.result_data[i].valore=e.result_data[i].VALORE),null!=e.result_data[i].DESCRIZIONE_VALORE&&(e.result_data[i].descrizione_valore=e.result_data[i].DESCRIZIONE_VALORE);t.resetD(e.result_data),t.is_loaded=!0,t.fillend.emit(),!0}}))}else this.set_options(this.option_values);else this.set_options(this.sql)},t.prototype.resetD=function(t){if(this.myData=t,this.selval="",this.table_hidden=!1,this.errorMsg="",!this.only_from_list)return this.last_v=this.valDef,this.selval=this.valDef,void(this.sItem=this.selval);this.setByValue(this.valDef),null!=this.getValue()&&""!=this.getValue()||""==this.valDef||this.setByDescri(this.valDef)},t.prototype.setByDescri=function(t){if(this.valDef=t,this.selval="",""!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){if(null!=this.myData)for(var e=0;e<this.myData.length;e++)if(this.myData[e].descrizione_valore==t)return this.sItem=t,this.selval=this.myData[e].valore,void(null!=this.sItem&&(this.descri_val=this.sItem));this.only_from_list||(this.sItem=t)}},t.prototype.last_val_rec=function(){this.setByValue(this.last_v)},t.prototype.setByValue=function(t){var e=this;if(this.valDef=t,this.selval=t,null!=this.myData){var i=!1;for(var n in this.myData)if(this.myData[n].valore==this.selval)return this.sItem=this.myData[n].descrizione_valore,void(null!=this.sItem&&(i=!0,this.descri_val=this.sItem));!i&&this.only_from_list&&this.resetValue(!1),this.only_from_list||(this.sItem=this.selval)}else this.only_from_list?setTimeout((function(){e.last_val_rec()}),1e3):this.sItem=this.selval},t.prototype.setValue=function(t){this.setByValue(t)},t.prototype.getDescri=function(){return this.getData("descrizione_valore")},t.prototype.getData=function(t){for(var e in this.myData)if(this.myData[e].descrizione_valore==this.sItem)return this.myData[e][t];return this.only_from_list?null:this.sItem},t.prototype.getObj=function(){for(var t in this.myData)if(this.myData[t].descrizione_valore==this.selval||this.myData[t].valore==this.selval)return this.myData[t];return null},t.prototype.getValue=function(){return this.getData("valore")},t.prototype.getModelValue=function(){var t=this.getData("valore");return null!==t||this.only_from_list?t:this.sItem},t.prototype.set_options=function(t){this.myData=new Array;for(var e=t.split("$"),i=0;i<e.length;i++){var n=new Object,o=e[i].split("|");n.valore=o[1],n.descrizione_valore=o[0],this.myData.push(n)}this.table_hidden=!1,this.is_loaded=!0,this.setByValue(this.valDef),""==this.getValue()&&this.setByDescri(this.valDef)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(t.init_fill){if(""==t.sql)return void setTimeout((function(){t.is_loaded=!0}),1e3);setTimeout((function(){t.fillCombo()}),t.load_delay)}else t.errorMsg="";t.initend.emit(),setTimeout((function(){t.is_loaded=!0}),1e3)}))},t.prototype.writeValue=function(t){this.last_v=t,this.setValue(t)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}();me.decorators=[{type:n.Component,args:[{selector:"FHAutoComplete",providers:[he],template:'\n <div style="min-height:45px" *ngIf="enabled && !hidden && !is_loaded && myData?.length==0"><mat-spinner diameter="25" ></mat-spinner></div>\n <mat-form-field\n [hidden]="!enabled || hidden || (!is_loaded && myData?.length==0)" [class.fh_field]="enabled"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n <input\n matInput\n [disabled]="!enabled || hidden"\n [matAutocomplete]="auto"\n [required]="required"\n #trigger="matAutocompleteTrigger"\n (keyup)="onChange_up($event)"\n [(ngModel)]="sItem"\n (focus)="fi_search();onChange_up($event)"\n (focusout)="fo_search($event)"\n #searchp\n />\n <mat-error *ngIf="error==null">{{ error }}</mat-error>\n </mat-form-field>\n <mat-autocomplete\n #auto="matAutocomplete"\n (optionSelected)="selectedSearchItem($event)"\n [autoActiveFirstOption]="open_on_load"\n >\n <mat-option\n *ngFor="let objx of searchItemsFiltered"\n [value]="objx.descrizione_valore"\n >\n {{ objx.descrizione_valore }}\n </mat-option>\n </mat-autocomplete>\n\n <div class="ui negative message" *ngIf="errorMsg != \'\'">\n <i class="close icon"></i>\n <div class="header">\n {{ errorMsg }}\n </div>\n </div>\n <mat-form-field\n [hidden]="enabled || hidden" [class.fh_field_dis]="!enabled"\n\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n <input type="text" #el1 matInput [disabled]="true" [required]="required" [(ngModel)]="sItem" />\n </mat-form-field>\n ',styles:[""]}]}],me.ctorParameters=function(){return[{type:Dt},{type:Qt}]},me.propDecorators={init_fill:[{type:n.Input}],autocomplete:[{type:n.ViewChild,args:[g.MatAutocompleteTrigger]}],error:[{type:n.Input}],sql:[{type:n.Input}],label:[{type:n.Input}],types:[{type:n.Input}],values:[{type:n.Input}],hidden:[{type:n.Input}],db_type:[{type:n.Input}],enabled:[{type:n.Input}],open_on_load:[{type:n.Input}],option_values:[{type:n.Input}],required:[{type:n.Input}],only_from_list:[{type:n.Input}],fillend:[{type:n.Output}],selchange:[{type:n.Output}],change:[{type:n.Output}],initend:[{type:n.Output}],focusout:[{type:n.Output}],load_delay:[{type:n.Input}],searchp:[{type:n.ViewChild,args:["searchp"]}],auto:[{type:n.ViewChild,args:["auto"]}]};for(var fe=v,ge={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMMM Y",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM Y"}},ve=[],ye=1;ye<=31;ye++)ve.push(String(ye));var be=function(t){function e(){var e=t.apply(this,Et(arguments))||this;return e.localeData=fe.localeData(),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}xt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e.prototype.getYear=function(t){return t.year()},e.prototype.getMonth=function(t){return t.month()},e.prototype.getDate=function(t){return t.date()},e.prototype.getDayOfWeek=function(t){return t.day()},e.prototype.getMonthNames=function(t){switch(t){case"long":return this.localeData.months();case"short":return this.localeData.monthsShort();case"narrow":return this.localeData.monthsShort().map((function(t){return t[0]}))}},e.prototype.getDateNames=function(){return ve},e.prototype.getDayOfWeekNames=function(t){switch(t){case"long":return this.localeData.weekdays();case"short":case"narrow":return this.localeData.weekdaysShort()}},e.prototype.getYearName=function(t){return String(t.year())},e.prototype.getFirstDayOfWeek=function(){return this.localeData.firstDayOfWeek()},e.prototype.getNumDaysInMonth=function(t){return t.daysInMonth()},e.prototype.clone=function(t){return t.clone()},e.prototype.createDate=function(t,e,i){return fe([t,e,i])},e.prototype.today=function(){return fe()},e.prototype.parse=function(t,e){if(console.log("prima value ",t,"parseFormat ",e),null!=t){var i,n=t.split("/");if(console.log("arr ",n),3==n.length)(i=parseInt(n[2]))<100&&(i+=2e3),1==n[1].length&&(n[1]="0"+n[1]),1==n[0].length&&(n[0]="0"+n[0]),t=n[0]+"/"+n[1]+"/"+i;if(n=t.split("-"),console.log("arr ",n),3==n.length)(i=parseInt(n[2]))<100&&(i+=2e3),1==n[1].length&&(n[1]="0"+n[1]),1==n[0].length&&(n[0]="0"+n[0]),t=n[0]+"/"+n[1]+"/"+i}console.log("fine value ",t,"parseFormat ",e);var o=fe(t,e,!0);return o.isValid()||(o=fe(t)),o.isValid()?o:null},e.prototype.format=function(t,e){return t?t.format(e):""},e.prototype.addCalendarYears=function(t,e){return t.clone().add(e,"y")},e.prototype.addCalendarMonths=function(t,e){return t.clone().add(e,"M")},e.prototype.addCalendarDays=function(t,e){return t.clone().add(e,"d")},e.prototype.setLocale=function(t){this.localeData=fe.localeData(t)},e.prototype.compareDate=function(t,e){return t.diff(e,"seconds",!0)},e.prototype.sameDate=function(e,i){return null==e?null==i:v.isMoment(e)?e.isSame(i):t.prototype.sameDate.call(this,e,i)},e.prototype.clampDate=function(t,e,i){return e&&t.isBefore(e)?e:i&&t.isAfter(i)?i:t},e.prototype.isValid=function(t){return t.isValid()},e.prototype.isDateInstance=function(t){return fe.isMoment(t)},e.prototype.toIso8601=function(t){return t.format()},e.prototype.fromIso8601=function(t){return fe(t)},e.prototype.invalid=function(){},e}(y.DateAdapter),we={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Ie})),multi:!0},Se=ge,Ie=function(){function t(t,e,i){this.dateAdapter=t,this.uti_s=e,this._apps=i,this.label="",this.error=null,this.required=!1,this.show_buttons=!1,this.enabled=!0,this.min_date=null,this.max_date=null,this.change=new n.EventEmitter,this.init_end=new n.EventEmitter,this.v_view=this.uti_s.date2String(new Date),this.date_sel=null,this.v_date_sel="",this.onChange=function(t){},this.onTouched=function(){},this.setlocalt()}return t.prototype.checkInput=function(t){},t.prototype.dt_chg=function(t){var e=t.target.value.split("-").join("/").split("/");if(3==e.length)if(1==e[1].length&&(e[1]="0"+e[1]),1==e[0].length&&(e[0]="0"+e[0]),parseInt(e[2])<3e3&&parseInt(e[0])>0&&parseInt(e[0])<=31&&parseInt(e[1])>0&&parseInt(e[1])<=12){var i=new be,n=parseInt(e[2]);n<100&&(n+=2e3),this.date_sel=i.createDate(n,parseInt(e[1])-1,parseInt(e[0]))}else console.log("data non valida! ",e)},t.prototype.chxx=function(t){},t.prototype.ch=function(t){this.onChange(this.getValue()),this.change.emit(this.getValue())},t.prototype.setlocalt=function(){var t=this;null!=this._apps.user_lang&&""!=this._apps.user_lang?"it"==this._apps.user_lang?this.dateAdapter.setLocale("it-IT"):"en"==this._apps.user_lang?this.dateAdapter.setLocale("en-GB"):this.dateAdapter.setLocale("it-IT"):setTimeout((function(){t.setlocalt()}),500)},t.prototype.setFocus=function(){this.pickerId.nativeElement.focus()},t.prototype.dt_ch=function(){var t=this;setTimeout((function(){t.ch()}),50)},t.prototype.add_year=function(){var t=new be;this.date_sel=t.createDate(this.getValue().getFullYear()+1,this.getValue().getMonth(),this.getValue().getDate()),this.v_view=this.uti_s.date2String(this.getValue()),this.ch()},t.prototype.ini_year=function(){var t=new be;this.date_sel=t.createDate(this.getValue().getFullYear()+1,1,1),this.v_view=this.uti_s.date2String(this.getValue()),this.ch()},t.prototype.fin_year=function(){var t=new be;this.date_sel=t.createDate(this.getValue().getFullYear()+1,12,31),this.v_view=this.uti_s.date2String(this.getValue()),this.ch()},t.prototype.getValue=function(){return null==this.date_sel?null:this.date_sel.toDate()},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.setLimits(),t.init_end.emit()}))},t.prototype.setLimits=function(){},t.prototype.setToday=function(){this.date_sel=new Date},t.prototype.setValue=function(t){if(this.setlocalt(),null!=t)if("string"==typeof t&&(t=new Date(this.uti_s.string2date(t,2))),t instanceof Date||null!=t.value&&(t=new Date(t.value)),1970!=t.getFullYear()){var e=new be;this.date_sel=e.createDate(t.getFullYear(),t.getMonth(),t.getDate()),this.v_view=this.uti_s.date2String(this.getValue())}else this.date_sel=null;else this.date_sel=null},t.prototype.writeValue=function(t){this.setValue(t)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}();Ie.decorators=[{type:n.Component,args:[{selector:"FHDatePicker",providers:[we,{provide:y.MAT_DATE_FORMATS,useValue:Se},{provide:y.DateAdapter,useClass:be}],template:'\n <div [hidden]="!show_buttons || !enabled">\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="add_year()"\n >\n +1 Anno\n </button>\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="ini_year()"\n >\n Inizio Anno\n </button>\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="fin_year()"\n >\n Fine Anno\n </button>\n </div>\n\n <mat-form-field\n (click)="chxx($event)"\n appearance="outline"\n floatLabel="always" [class.fh_field]="enabled" [class.fh_field_dis]="!enabled"\n ><mat-label>{{ label }}</mat-label>\n <input\n [disabled]="!enabled"\n #pickerId\n (dateChange)="ch($event)"\n (focusout)="dt_chg($event)"\n (keyup)="checkInput($event)"\n [min]="min_date"\n [max]="max_date"\n [required]="required"\n (click)="chxx($event)"\n [(ngModel)]="date_sel"\n matInput\n [matDatepicker]="picker"\n />\n <mat-datepicker-toggle\n matSuffix\n [for]="picker"\n (click)="chxx($event)"\n ></mat-datepicker-toggle>\n <mat-datepicker (click)="chxx($event)" #picker></mat-datepicker>\n <mat-error *ngIf="error==null">{{ error }}</mat-error>\n </mat-form-field>\n ',styles:["\n .lb_small_grigia {\n font-size: 15px;\n color: #b8b8b8;\n }\n\n .label_dis {\n font-size: 14px;\n font-weight: bold;\n }\n\n :host.ng-invalid > .ng-touched ::ng-deep .mat-input-element,\n :host.ng-invalid > .ng-touched ::ng-deep .mat-form-field-label {\n color: #f44336;\n }\n\n :host.ng-invalid > .ng-touched ::ng-deep .mat-form-field-underline,\n :host.ng-invalid > .ng-touched ::ng-deep .mat-form-field-ripple {\n background-color: #f44336;\n }\n "]}]}],Ie.ctorParameters=function(){return[{type:y.DateAdapter},{type:Ct},{type:wt}]},Ie.propDecorators={label:[{type:n.Input}],error:[{type:n.Input}],required:[{type:n.Input}],show_buttons:[{type:n.Input}],enabled:[{type:n.Input}],min_date:[{type:n.Input}],max_date:[{type:n.Input}],change:[{type:n.Output}],pickerId:[{type:n.ViewChild,args:["pickerId"]}],init_end:[{type:n.Output}]};var xe=function(){function t(t,e,i,n){this._dataService=t,this.dialogRef=e,this.toastr=i,this.data=n,this.width="100%",this.label="Ricerca...",this.selectedAdd=null,this.selectedRemove=null,this.errorMsg="",this.fltr_user="",this.height=420,this.single_sel=!1,this.vis_buttons=!0,this.all_users=!1,this.lista_utenti=[],this.user_sel=new Array,null!=n&&(null!=n.single_sel&&(this.single_sel=n.single_sel),null!=n.user_sel&&(this.user_sel=n.user_sel),null!=n.all_users&&(this.all_users=n.all_users),null!=n.vis_buttons&&(this.vis_buttons=n.vis_buttons),null!=n.users_list&&(this.users_list=n.users_list,this.lista_utenti=JSON.parse(JSON.stringify(this.users_list))))}return t.prototype.do_add_all=function(){this.fltr_user="",this.users_list_sel=[],this.users_list=JSON.parse(JSON.stringify(this.lista_utenti)),this.user_sel=JSON.parse(JSON.stringify(this.lista_utenti))},t.prototype.do_rem_all=function(){this.fltr_user="",this.users_list=JSON.parse(JSON.stringify(this.lista_utenti)),this.users_list_sel=JSON.parse(JSON.stringify(this.lista_utenti)),this.user_sel=[]},t.prototype.filtra=function(){null==this.fltr_user&&(this.fltr_user=""),console.log("filtra() "+this.fltr_user.toUpperCase()),this.users_list_sel=new Array;for(var t=0;t<this.users_list.length;t++)if(null!=this.users_list[t].nc){for(var e=!1,i=0;i<this.users_list_sel.length;i++)if(this.users_list_sel[i].username==this.users_list[t].username&&this.users_list_sel[i].canale==this.users_list[t].canale){e=!0;break}if(!e&&(-1!=this.users_list[t].nc.toUpperCase().indexOf(this.fltr_user.toUpperCase())||""==this.fltr_user)){for(var n=!1,o=0;o<this.user_sel.length;o++)if(this.user_sel[o].username==this.users_list[t].username&&this.user_sel[o].canale==this.users_list[t].canale){n=!0;break}n||this.users_list_sel.push(this.users_list[t])}}},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(t.all_users){var e=new vt;e.sql="SELECT_ALL_USERS",e.types=[],e.values=[],t._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.users_list=e.result_data,t.lista_utenti=JSON.parse(JSON.stringify(t.users_list)),t.filtra())}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"}))}else{if(t.lista_utenti=JSON.parse(JSON.stringify(t.users_list)),t.users_list_sel=new Array,null!=t.users_list)for(var i=0;i<t.users_list.length;i++)t.users_list_sel.push(t.users_list[i]);if(null!=t.users_list&&null!=t.user_sel&&t.user_sel.length>0)return}}))},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.do_add=function(){if(null!=this.selectedAdd){var t=this.users_list.indexOf(this.selectedAdd,0);this.single_sel||t>-1&&this.users_list.splice(t,1),console.log("this.users_list 1 ",this.users_list),this.single_sel&&(this.user_sel=new Array),null==this.user_sel&&(this.user_sel=[]),this.user_sel.push(this.selectedAdd),this.selectedAdd=null,this.filtra()}else this.toastr.error("ERRORE","Selezionare l'utente da aggiungere",{timeOut:1e3,progressBar:!0})},t.prototype.do_rem=function(){if(null!=this.selectedRemove){var t=this.user_sel.indexOf(this.selectedRemove,0);t>-1&&this.user_sel.splice(t,1),this.users_list.push(this.selectedRemove),this.selectedRemove=null,this.filtra()}else this.toastr.error("ERRORE","Selezionare l'utente da rimuovere",{timeOut:1e3,progressBar:!0})},t.prototype.addTo=function(t){this.option=!0,this.selectedAdd=t,this.selectedRemove=null},t.prototype.removeTo=function(t){this.option=!1,this.selectedAdd=null,this.selectedRemove=t},t.prototype.getSelArr=function(){return this.user_sel},t}();xe.decorators=[{type:n.Component,args:[{selector:"FHPickUsers",template:'\n <mat-dialog-content style="font-size:12px">\n <br /><br />\n <div fxLayout="row">\n <div fxLayout="column" fxFlex="40">\n <div style="width:100%;overflow-y:scroll;" [style.height]="(height)+ \'px\'">\n <table style="width: 100%" class="fh_table sel_r" cellpadding="7">\n <thead>\n <tr>\n <th colspan="2">{{\'UTENTI SELEZIONABILI\' | translate }}</th>\n </tr>\n </thead>\n\n <tbody>\n <tr>\n <td colspan="2" style="background-color:#FFF !important">\n <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>{{ label | translate }}</mat-label>\n <input\n [(ngModel)]="fltr_user"\n (ngModelChange)="filtra()"\n matInput\n />\n </mat-form-field>\n </td>\n </tr>\n <tr\n *ngFor="\n let u of users_list_sel;\n let odd = odd;\n let even = even\n "\n\n (click)="addTo(u);selectedAdd = u"\n (dblclick)="do_add()"\n [style.background-color]="selectedAdd == u ? \'#2AA1DD\':\'\'"\n [style.color]="selectedAdd == u ? \'#FFFFFF\':\'\'"\n [ngClass]="selectedAdd == u ? \'\':\'sel_r\'"\n\n >\n <td style="width: 80%">{{ u.nc }}</td>\n <td style="width: 20%">{{ u.context }}</td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div\n fxLayout="column"\n fxFlex="20"\n style="height: 280px; position: relative; margin:0 .5em; padding-left: .5em; padding-right: .5em; border-left: 1px solid rgba(191, 191, 191, 0.5); border-right: 1px solid rgba(191, 191, 191, 0.5);"\n >\n <div\n style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);"\n > <br><br><br><br><br><br>\n <div style="width:100%;text-align:center">\n <button\n mat-flat-button\n color="primary"\n (click)="do_add()"\n [disabled]="!option || selectedAdd==null"\n >\n <mat-icon>arrow_forward</mat-icon>\n </button>\n </div>\n <br />\n <div style="width:100%;text-align:center">\n <button\n mat-flat-button\n color="primary"\n (click)="do_rem()"\n [disabled]="option || selectedRemove==null"\n >\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n <br><br><br><br>\n <div style="width:100%;text-align:center">\n <button\n mat-flat-button\n color="primary"\n (click)="do_add_all()"\n [disabled]="users_list_sel?.length==0"\n >\n {{\'Sel. Tutti\' | translate}}\n </button>\n </div>\n <br />\n <div style="width:100%;text-align:center">\n <button\n mat-flat-button\n color="primary"\n (click)="do_rem_all()"\n [disabled]="user_sel?.length==0"\n >\n {{\'Desel. Tutti\' | translate}}\n </button>\n </div>\n </div>\n </div>\n <div fxLayout="column" fxFlex="40">\n <div style="width:100%;overflow-y:scroll;" [style.height]="(height)+ \'px\'">\n <table style="width: 100%" class="fh_table sel_r" cellpadding="7">\n <thead>\n <tr>\n <th colspan="2">{{\'UTENTI SELEZIONATI\' | translate }}</th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="let u of user_sel; let odd = odd; let even = even"\n [style.background-color]="selectedRemove == u ? \'#2AA1DD\':\'\'"\n [style.color]="selectedRemove == u ? \'#FFFFFF\':\'\'"\n [ngClass]="selectedRemove == u ? \'\':\'sel_r\'"\n (click)="removeTo(u);selectedRemove = u"\n (dblclick)="do_rem()"\n\n >\n <td style="width: 80%">{{ u.nc }}</td>\n <td style="width: 20%">{{ u.canale }}</td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions *ngIf="vis_buttons">\n <div\n style="width:100%"\n *ngIf="vis_buttons"\n fxLayout="row"\n fxLayoutAlign="center center"\n >\n <button\n mat-flat-button\n color="primary"\n (click)="dialogRef.close(this.user_sel)"\n >\n Ok</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="dialogRef.close()"\n >\n {{\'Annulla\' | translate }}\n </button>\n </div>\n </mat-dialog-actions>\n ',styles:["\n\n\n "]}]}],xe.ctorParameters=function(){return[{type:Dt},{type:e.MatDialogRef},{type:i.ToastrService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},xe.propDecorators={height:[{type:n.Input}],users_list:[{type:n.Input}],single_sel:[{type:n.Input}],vis_buttons:[{type:n.Input}],all_users:[{type:n.Input}],user_sel:[{type:n.Input}]};var Oe={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Ee})),multi:!0},Ee=function(){function t(){this.hidden=!1,this.label="",this.hint="",this.autocomplete="",this.maxlength="",this.type="text",this.enabled=!0,this.required=!1,this.email=!1,this.error=null,this.change=new n.EventEmitter,this.focusout=new n.EventEmitter,this.focusin=new n.EventEmitter,this.text_v="",this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.setFocus=function(){this.el.nativeElement.focus()},t.prototype.onFi=function(){var t=this;setTimeout((function(){t.focusin.emit(t.text_v)}))},t.prototype.onFu=function(){var t=this;setTimeout((function(){t.focusout.emit(t.text_v)}))},t.prototype.modelch=function(){var t=this;setTimeout((function(){t.onChange(t.text_v),t.change.emit(t.text_v)}))},t.prototype.ngAfterViewInit=function(){},t.prototype.writeValue=function(t){this.text_v=t},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}();Ee.decorators=[{type:n.Component,args:[{selector:"FHTextInput",providers:[Oe],template:'\n <mat-form-field [hidden]="hidden" appearance="outline" floatLabel="always" [class.fh_field]="enabled" [class.fh_field_dis]="!enabled"\n ><mat-label>{{ label }}</mat-label>\n <input\n matInput\n [email]="email"\n type="text"\n [(ngModel)]="text_v"\n #el\n [disabled]="!enabled"\n [required]="required"\n (focusout)="onFu()"\n (focusin)="onFi()"\n (ngModelChange)="modelch()"\n [autocomplete]="autocomplete"\n [maxlength]="maxlength"\n [type]="type"\n />\n <mat-hint [hidden]="hint==\'\'">{{hint}}</mat-hint>\n <mat-error *ngIf="error==null">{{ error }}</mat-error>\n </mat-form-field>\n ',styles:[""]}]}],Ee.ctorParameters=function(){return[]},Ee.propDecorators={hidden:[{type:n.Input}],label:[{type:n.Input}],hint:[{type:n.Input}],autocomplete:[{type:n.Input}],maxlength:[{type:n.Input}],type:[{type:n.Input}],enabled:[{type:n.Input}],required:[{type:n.Input}],email:[{type:n.Input}],error:[{type:n.Input}],change:[{type:n.Output}],focusout:[{type:n.Output}],focusin:[{type:n.Output}],el:[{type:n.ViewChild,args:["el"]}]};var Ae=function(){function t(){this.val_app=-1}return t.prototype.ok=function(){this.val_app=1,this.params.api.stopEditing()},t.prototype.ko=function(){this.val_app=0,this.params.api.stopEditing()},t.prototype.nd=function(){this.val_app=-1,this.params.api.stopEditing()},t.prototype.agInit=function(t){this.params=t},t.prototype.getValue=function(){return this.val_app},t.prototype.isPopup=function(){return!0},t.prototype.onKeyDown=function(t){var e=t.which||t.keyCode;37!=e&&39!=e||t.stopPropagation()},t}();Ae.decorators=[{type:n.Component,args:[{selector:"approva-cell",template:'\n <div #container class="mood">\n <div class="example-mat-buttons">\n <button mat-icon-button style="color:green" (click)="ok()">\n <mat-icon>thumb_up</mat-icon>\n </button>\n <button mat-icon-button style="color:red" (click)="ko()">\n <mat-icon>thumb_down</mat-icon>\n </button>\n <button mat-icon-button style="color:gray" (click)="nd()">\n <mat-icon>crop_din</mat-icon>\n </button>\n </div>\n </div>\n ',styles:["\n .mood {\n border-radius: 15px;\n border: 1px solid grey;\n background: #e6e6e6;\n padding: 15px;\n text-align: center;\n display: inline-block;\n outline: none;\n }\n "]}]}],Ae.propDecorators={container:[{type:n.ViewChild,args:["container",{read:n.ViewContainerRef}]}]};var Ce="000000",ke=function(){function t(){this.DECIMAL_SEPARATOR=",",this.THOUSANDS_SEPARATOR="."}return t.prototype.transform=function(t,e){void 0===e&&(e=2);var i=Ot((t||"").toString().split(this.DECIMAL_SEPARATOR),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=e>0?this.DECIMAL_SEPARATOR+(s+Ce).substring(0,e):"",(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,this.THOUSANDS_SEPARATOR))+s},t.prototype.parse=function(t,e){void 0===e&&(e=2);var i=Ot((t||"").split(this.DECIMAL_SEPARATOR),2),n=i[0],o=i[1],s=void 0===o?"":o;return n=n.replace(new RegExp(this.THOUSANDS_SEPARATOR,"g"),""),s=parseInt(s,10)>0&&e>0?this.DECIMAL_SEPARATOR+(s+Ce).substring(0,e):"",t},t}();ke.decorators=[{type:n.Pipe,args:[{name:"FHCurrency"}]}],ke.ctorParameters=function(){return[]};var Te=function(){function t(t,e){this.elementRef=t,this.currencyPipe=e,this.el=this.elementRef.nativeElement}return t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.el.value=t.currencyPipe.transform(t.el.value)}))},t.prototype.onFocus=function(t){this.el.value=this.currencyPipe.parse(t)},t.prototype.onBlur=function(t){this.el.value=this.currencyPipe.transform(t)},t}();Te.decorators=[{type:n.Directive,args:[{selector:"[FHCurrencyFormatter]"}]}],Te.ctorParameters=function(){return[{type:n.ElementRef},{type:ke}]},Te.propDecorators={onFocus:[{type:n.HostListener,args:["focus",["$event.target.value"]]}],onBlur:[{type:n.HostListener,args:["blur",["$event.target.value"]]}]};var De=function(){function t(t,e,i,n){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.data=n,this.title="",this.sql_dett="",this.open_only_one=!0,this.descri="",this.lat=51.673858,this.long=7.815982,this.zoom=7,this.infoWindowOpened=null,this.markers=[],this.height="600px",null!=n&&(null!=n.height&&(this.height=n.height),null!=n.open_only_one&&(this.open_only_one=n.open_only_one)),null!=this.m_appService.getState().appo_dialog&&(null!=this.m_appService.getState().appo_dialog.zoom&&(this.zoom=this.m_appService.getState().appo_dialog.zoom),null!=this.m_appService.getState().appo_dialog.title&&(this.title=this.m_appService.getState().appo_dialog.title),null!=this.m_appService.getState().appo_dialog.lat&&(this.lat=this.m_appService.getState().appo_dialog.lat),null!=this.m_appService.getState().appo_dialog.long&&(this.long=this.m_appService.getState().appo_dialog.long),null!=this.m_appService.getState().appo_dialog.descri&&(this.descri=this.m_appService.getState().appo_dialog.descri),null!=this.m_appService.getState().appo_dialog.markers&&(this.markers=this.m_appService.getState().appo_dialog.markers))}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.apri_Scheda=function(t){window.open(t)},t.prototype.clickedMarker=function(t,e,i){this.open_only_one&&this.infoWindowOpened!==e&&(null!==this.infoWindowOpened&&this.infoWindowOpened.close(),this.infoWindowOpened=e)},t.prototype.ngAfterViewInit=function(){},t}();De.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <mat-dialog-content\n [style.height]="height"\n >\n\n <agm-map\n [zoom]="zoom"\n width="100%"\n [style.height]="height"\n [latitude]="lat"\n [longitude]="long"\n >\n <agm-marker\n *ngFor="let m of markers; let i = index"\n (markerClick)="clickedMarker(m.labelx, infoWindow, i)"\n [latitude]="m.lat"\n [longitude]="m.lng"\n [label]="m.label"\n >\n <agm-info-window #infoWindow>\n <strong>{{ m.labelx }}</strong\n ><br />\n <button\n *ngIf="m.url_scheda != null"\n (click)="apri_Scheda(m.url_scheda)"\n >\n APRI SCHEDA\n </button>\n </agm-info-window>\n </agm-marker>\n </agm-map>\n </mat-dialog-content>\n\n ',styles:["\n agm-map {\n\n width: 100%;\n }\n .mat-dialog-content { max-height: unset !important; }\n "]}]}],De.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:wt},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var Le=function(){function t(){this.text="",this.date_zz="",this.date_v="",this.label=""}return t.prototype.setDt=function(){this.date_zz=this.text},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){return t.appdt.nativeElement.focus()}))},t.prototype.agInit=function(t){return this.params=t,null==t.value||-1!=t.value.indexOf("--")?(this.text=null,void(this.date_zz=null)):(this.text=t.value,void(this.date_zz=t.value))},t.prototype.getValue=function(){return null==this.date_zz?null:this.date_zz},t.prototype.isPopup=function(){return!0},t.prototype.onKeyDown=function(t){var e=t.which||t.keyCode;37!=e&&13!=e&&39!=e||t.stopPropagation()},t}();Le.decorators=[{type:n.Component,args:[{selector:"editor-cell",template:'\n <div #container class="mood">\n <div fxLayout="row" (keydown)="onKeyDown($event)">\n <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n <textarea\n matInput\n style="min-height:180px;min-width:400px"\n [(ngModel)]="text"\n #appdt\n ></textarea>\n </mat-form-field>\n </div>\n\n <button\n mat-flat-button\n color="primary"\n (click)="this.setDt(); this.params.api.stopEditing()"\n >\n CONFERMA\n </button>\n \x3c!-- \n <button mat-flat-button (click)="this.params.api.stopEditing();">{{\'ANNULLA\' | translate}}</button>\n--\x3e</div>\n ',styles:["\n .mood {\n border-radius: 15px;\n border: 1px solid grey;\n background: #e6e6e6;\n padding: 15px;\n text-align: center;\n display: inline-block;\n outline: none;\n }\n\n .default {\n padding-left: 10px;\n padding-right: 10px;\n border: 1px solid transparent;\n padding: 4px;\n }\n\n .selected {\n padding-left: 10px;\n padding-right: 10px;\n border: 1px solid lightgreen;\n padding: 4px;\n }\n "]}]}],Le.propDecorators={container:[{type:n.ViewChild,args:["container",{read:n.ViewContainerRef}]}],appdt:[{type:n.ViewChild,args:["appdt"]}]};var Re=function(){function t(t){this._dataService=t,this.selval="",this.date_zz="",this.date_v="",this.sql="",this.label="",this.myData=new Array}return t.prototype.setDt=function(){this.date_zz=this.selval},t.prototype.agInit=function(t){var e=this;this.params=t;var i=new vt;i.sql=t.sql,i.types=t.types,i.values=t.values;this._dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(e.myData=t.result_data)}),(function(t){})),null!=t.value&&-1==t.value.indexOf("--")&&(this.selval=t.value,this.date_zz=t.value)},t.prototype.getValue=function(){return null==this.date_zz?null:this.date_zz},t.prototype.isPopup=function(){return!0},t.prototype.onKeyDown=function(t){t.which||t.keyCode},t}();Re.decorators=[{type:n.Component,args:[{selector:"editor-cell",template:'\n <div #container class="mood">\n <div style="min-width:350px;min-height:60px;text-align:center">\n <select [(ngModel)]="selval" #appdt style="min-height:40px;width:90%">\n <option\n value="{{ app.descrizione_valore }}"\n *ngFor="let app of myData"\n >{{ app.descrizione_valore }}</option\n >\n </select>\n </div>\n <br /><br /><br />\n <button\n mat-flat-button\n color="primary"\n (click)="this.setDt(); this.params.api.stopEditing()"\n >\n CONFERMA\n </button>\n \x3c!-- \n <button mat-flat-button (click)="this.params.api.stopEditing();">{{\'ANNULLA\' | translate}}</button>\n--\x3e</div>\n ',styles:["\n .mood {\n border-radius: 15px;\n border: 1px solid grey;\n background: #e6e6e6;\n padding: 15px;\n text-align: center;\n display: inline-block;\n outline: none;\n }\n\n .default {\n padding-left: 10px;\n padding-right: 10px;\n border: 1px solid transparent;\n padding: 4px;\n }\n\n .selected {\n padding-left: 10px;\n padding-right: 10px;\n border: 1px solid lightgreen;\n padding: 4px;\n }\n "]}]}],Re.ctorParameters=function(){return[{type:Dt}]},Re.propDecorators={container:[{type:n.ViewChild,args:["container",{read:n.ViewContainerRef}]}],appdt:[{type:n.ViewChild,args:["appdt"]}]};var Ne=function(){function t(t){this._dataService=t,this.init_fill=!0,this.sql="",this.types=[],this.values=[],this.label="",this.enabled=!0,this.single_sel=!1,this.separator=",",this.fillend=new n.EventEmitter,this.selchange=new n.EventEmitter,this.initend=new n.EventEmitter,this.myData=new Array,this.selval="-1",this.errorMsg="",this.valDef="-1"}return t.prototype.change_v=function(t,e){t.checked=!t.checked,this.upd_f(t,e)},t.prototype.upd_f=function(t,e){this.single_sel&&(t.checked=!0);var i=new Object;i.u=t,i.b=e,this.selchange.emit(i)},t.prototype.resetValue=function(){for(var t=0;t<this.myData.length;t++)this.myData[t].checked=!1},t.prototype.reset=function(){this.myData=new Array,this.resetValue()},t.prototype.fillCombo=function(){var t=this;if(this.init_fill){console.log("fillcombolist");var e=new vt;e.sql=this.sql,e.types=this.types,e.values=this.values,console.log("p ",e),this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.myData=e.result_data,t.resetValue(),t.setByValue(t.valDef),""==t.getValue()&&"-1"!=t.valDef&&t.setByDescri(t.valDef),t.fillend.emit())}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+t.sql+"]"}))}},t.prototype.setByDescri=function(t){if(console.log("setByDescri "+t),this.valDef=t,null!=t&&""!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){var e=t.split(this.separator);console.log("arr_val ",e);for(var i=0;i<this.myData.length;i++)for(var n=0;n<e.length;n++)console.log("v1 - v2",this.myData[i].descrizione_valore,e[n]),this.myData[i].descrizione_valore==e[n]&&(this.myData[i].checked=!0)}},t.prototype.setByIndex=function(t){this.valDef="",this.selval="-1",null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]&&this.myData.length>t&&this.setByDescri(this.myData[t].descrizione_valore)},t.prototype.setByValue=function(t){if(this.valDef=t,null!=t&&""+t!=""&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0])for(var e=t.split(this.separator),i=0;i<this.myData.length;i++)for(var n=0;n<e.length;n++)this.myData[i].valore==e[n]&&(this.myData[i].checked=!0)},t.prototype.getDescri=function(){for(var t="",e=0;e<this.myData.length;e++)this.myData[e].checked&&(""!=t&&(t+=this.separator),t+=this.myData[e].descrizione_valore);return t},t.prototype.getObjects=function(){for(var t=new Array,e=0;e<this.myData.length;e++)this.myData[e].checked&&t.push(this.myData[e]);return t},t.prototype.getValue=function(){for(var t="",e=0;e<this.myData.length;e++)this.myData[e].checked&&(""!=t&&(t+=this.separator),t+=this.myData[e].valore);return t},t.prototype.getData=function(t){for(var e in this.myData)if(this.myData[e].valore==this.selval)return this.myData[e][t]},t.prototype.add_option=function(t){t.valore=t.valore.toString(),this.myData.push(t)},t.prototype.set_options=function(t){this.myData=new Array;for(var e=t.split("$"),i=0;i<e.length;i++){var n=new Object,o=e[i].split("|");n.valore=o[1],n.descrizione_valore=o[0],n.checked=!1,this.myData.push(n)}this.setByValue(this.valDef),"-1"==this.getValue()&&this.setByDescri(this.valDef)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(1==t.init_fill){if(""==t.sql)return;t.fillCombo()}else t.errorMsg="";t.initend.emit()}))},t.prototype.sc=function(){this.selchange.emit()},t}();Ne.decorators=[{type:n.Component,args:[{selector:"FHList",template:'\n <table class="fh_table" style="width:100%;">\n <thead>\n <tr>\n <th *ngIf="!single_sel"></th>\n <th>\n {{ label }}\n </th>\n <th *ngIf="single_sel"></th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="let u of myData; let odd = odd; let even = even"\n [ngClass]="{ odd: odd, even: even }"\n >\n <td style="width:20px;" valign="middle" *ngIf="!single_sel">\n <mat-slide-toggle\n (change)="upd_f(u, $event)"\n [disabled]="!enabled"\n [(ngModel)]="u.checked"\n ></mat-slide-toggle>\n </td>\n <td (click)="change_v(u, $event)" valign="middle">\n {{ u.descrizione_valore }}\n </td>\n <td\n valign="middle"\n style="width:20px;text-align: center"\n *ngIf="single_sel"\n >\n <button\n mat-flat-button\n color="primary"\n (click)="upd_f(u, $event)"\n [disabled]="!enabled"\n >\n <mat-icon>send</mat-icon></button\n > \n </td>\n </tr>\n </tbody>\n </table>\n ',styles:[""]}]}],Ne.ctorParameters=function(){return[{type:Dt}]},Ne.propDecorators={init_fill:[{type:n.Input}],sql:[{type:n.Input}],types:[{type:n.Input}],values:[{type:n.Input}],label:[{type:n.Input}],enabled:[{type:n.Input}],single_sel:[{type:n.Input}],separator:[{type:n.Input}],smtr:[{type:n.ViewChild,args:["cmb"]}],fillend:[{type:n.Output}],selchange:[{type:n.Output}],initend:[{type:n.Output}]};var Fe=function(){function t(t,e,i){if(this.dialogRef=t,this.toastr=e,this.data=i,this.label="",this.width="100%",this.nota=!1,this.nota_val="",null!=i&&null!=i){var n="",o=[],s=!1;null!=i.label&&(n=i.label),null!=i.arr_option&&(o=i.arr_option),null!=i.nota&&(s=i.nota),this.set_selection(n,o,s)}}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.set_selection=function(t,e,i){var n=this;if(void 0===i&&(i=!1),null!=this.cmb_sel){this.nota=i,this.label=t;for(var o=0;o<e.length;o++)this.cmb_sel.add_option(e[o])}else setTimeout((function(){n.set_selection(t,e,i)}),500)},t.prototype.ok=function(){"-1"!=this.cmb_sel.getValue()?(this.cmb_sel.getObj().nota=this.nota_val,this.dialogRef.close(this.cmb_sel.getObj())):this.toastr.error("Selezionare un valore")},t.prototype.ngAfterViewInit=function(){},t}();Fe.decorators=[{type:n.Component,args:[{selector:"fh_win_auto_complete",template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <div fxLayout="column">\n <mat-dialog-content style="font-size: 15px;">\n <div fxLayout="column">\n <h3>\n {{ label | uppercase }}\n </h3>\n <FHAutoComplete #cmb_sel [init_fill]="false" [only_from_list]="true"></FHAutoComplete>\n <mat-form-field *ngIf="nota" appearance="outline" floatLabel="always"\n ><mat-label>Nota</mat-label>\n <textarea matInput [(ngModel)]="nota_val" rows="12"></textarea>\n </mat-form-field>\n </div>\n </mat-dialog-content>\n\n <mat-dialog-actions\n fxFlex="100"\n fxLayout="row"\n fxLayoutAlign="center center"\n >\n <button mat-flat-button color="primary" (click)="ok()">OK</button\n > \n <button mat-flat-button color="warn" (click)="close()">{{\'ANNULLA\' | translate}}</button>\n </mat-dialog-actions>\n </div>\n '}]}],Fe.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Fe.propDecorators={cmb_sel:[{type:n.ViewChild,args:["cmb_sel"]}]};var Me=function(){function t(){}return t.prototype.transform=function(t){return""+t.replace(/\n/g,"<br/>")},t}();Me.decorators=[{type:n.Pipe,args:[{name:"replaceLineBreaks"}]}];var Pe=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.data=i,this.title="",this.label="",this.valore=0,this.valore_min=0,this.valore_max=1e6,this.decimal_n=0,null!=i.title&&(this.title=i.title),null!=i.label&&(this.label=i.label),null!=i.valore&&(this.valore=i.valore),null!=i.valore_min&&(this.valore_min=i.valore_min),null!=i.valore_max&&(this.valore_max=i.valore_max),null!=i.decimal&&(this.decimal_n=i.decimal)}return t.prototype.ngAfterViewInit=function(){},t.prototype.show=function(){},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.do_check=function(){Number(this.valore)<this.valore_min||Number(this.valore)>this.valore_max?this.toastr.error("Il valore deve avere essere compreso tra "+this.valore_min+" - "+this.valore_max):this.dialogRef.close(this.valore)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t}();Pe.decorators=[{type:n.Component,args:[{selector:"app-win_ask_text",template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{ title }}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <mat-dialog-content>\n <FHNumericField [label]="label" [required]="valore>0" [(ngModel)]="valore" [decimal]="decimal_n"></FHNumericField>\n\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-flat-button color="primary" (click)="do_check()">OK</button\n > <button\n mat-flat-button\n color="warn"\n (click)="chiudi()"\n >\n ANNULLA\n </button>\n </mat-dialog-actions>\n</div>\n '}]}],Pe.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var ze=function(){function t(t){this.platformId=t}return t.prototype.highlightAll=function(){b.isPlatformBrowser(this.platformId)&&Prism.highlightAll()},t}();ze.decorators=[{type:n.Injectable}],ze.ctorParameters=function(){return[{type:Object,decorators:[{type:n.Inject,args:[n.PLATFORM_ID]}]}]};var je=function(){function t(t){this.highlightService=t,this.highlighted=!1,this.path_md=""}return t.prototype.ngAfterViewChecked=function(){this.highlighted||null!=!this.path_md||(this.highlightService.highlightAll(),this.highlighted=!0)},t.prototype.ngAfterViewInit=function(){},t}();je.decorators=[{type:n.Component,args:[{selector:"FHMdReader",template:' <markdown [src]="path_md"> </markdown> ',styles:[""]}]}],je.ctorParameters=function(){return[{type:ze}]},je.propDecorators={path_md:[{type:n.Input}]};var Ue=function(){function t(t){var e=this;this.uti=t,this.g_height="300px",this.columnDefs=[{headerName:"Utente",field:"utente",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Descrizione",field:"descrizione",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Tipo",field:"tipo",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Data",field:"data",filter:"agDateColumnFilter",filterParams:{newRowsAction:"keep"},cellRenderer:function(t){if(null==t.value)return" ------ ";var i=new Date(t.value);return 1900==i.getFullYear()?" ------ ":e.uti.datetime2String(i)},cellStyle:function(t){return{"text-align":"center"}}}],this.m_app="",this.m_k=""}return t.prototype.init=function(t,e){var i=this;this.m_app=t,this.m_k=e,setTimeout((function(){i.reload()}),500)},t.prototype.reload=function(){this.datagrid.doFill("[applicativo]='"+this.m_app+"' and [iddocumento]='"+this.m_k+"'")},t.prototype.ngAfterViewInit=function(){},t}();Ue.decorators=[{type:n.Component,args:[{selector:"FHLogPanel",template:'\n <div style="width:100%;">\n <section class="bs">\n <div style="width:100%;height:450px">\n <div style="width:100%;height:100%">\n <FHGrid\n [init_fill]="false"\n #dtm\n [show_buttons]="false"\n [columnDefs]="columnDefs"\n tbl_name="logs"\n grid_key="logs"\n sort_field="data desc"\n ></FHGrid>\n </div>\n </div>\n </section>\n </div>\n ',styles:[""]}]}],Ue.ctorParameters=function(){return[{type:Ct}]},Ue.propDecorators={g_height:[{type:n.Input}],datagrid:[{type:n.ViewChild,args:["dtm"]}]};var Ve={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return qe})),multi:!0},qe=function(){function t(){this.config={modules:{toolbar:[["bold","italic","underline","strike","image","link"],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["code-block","blockquote",{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"}]],keyboard:{bindings:{list:{key:"backspace",context:{format:["list"]},handler:function(t,e){0!==t.index&&(0===t.length?this.quill.deleteText(t.index-1,1,1):this.quill.deleteText(t,1))}}}}}},this.html_edit=!1,this.enabled=!0,this.value="",this.label="",this.height="360",this.change=new n.EventEmitter,this.focus=new n.EventEmitter,this.blur=new n.EventEmitter,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.modelch=function(){var t=this;console.log("modelch ",this.value),setTimeout((function(){t.onChange(t.value),t.change.emit(t.value)}))},t.prototype.onFocus=function(t){this.focus.emit(t)},t.prototype.onBlur=function(t){this.blur.emit(t)},t.prototype.ngAfterViewInit=function(){},t.prototype.writeValue=function(t){this.value=t},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}();qe.decorators=[{type:n.Component,args:[{selector:"FHRichText",providers:[Ve],template:'\n <b *ngIf="label != \'\'">{{ label }}</b>\n <quill-editor\n [hidden]="!enabled"\n (focus)="onFocus($event)"\n (ngModelChange)="modelch()"\n (onContentChanged)="modelch()"\n (onBlur)="modelch()"\n (blur)="onBlur($event)"\n theme="snow"\n format="html" [class.fh_field]="enabled" [class.fh_field_dis]="!enabled"\n [(ngModel)]="value"\n ></quill-editor>\n <quill-view\n [content]="value"\n [hidden]="enabled"\n format="html"\n theme="snow"\n ></quill-view>\n <textarea [hidden]="!html_edit" style="width:100%" rows="10" [(ngModel)]="value"></textarea>\n ',styles:[""]}]}],qe.ctorParameters=function(){return[]},qe.propDecorators={html_edit:[{type:n.Input}],enabled:[{type:n.Input}],value:[{type:n.Input}],label:[{type:n.Input}],height:[{type:n.Input}],change:[{type:n.Output}],focus:[{type:n.Output}],blur:[{type:n.Output}]};var Ge=function(){function t(t,e){this.dialogRef=t,this.data=e,this.title="",this.label="",this.valore="",null!=e&&(null!=e.title&&(this.title=e.title),null!=e.label&&(this.label=e.label),null!=e.valore&&(this.valore=e.valore))}return t.prototype.ngAfterViewInit=function(){},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.show=function(){},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t}();Ge.decorators=[{type:n.Component,args:[{selector:"app-win_output",template:'\n\n<div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{ title }}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n\n <mat-dialog-content style="min-width:500px;font-size: 15px;">\n <div [innerHTML]="valore" style="width:100%"></div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <div fxFlex="100" fxLayout="row" fxLayoutAlign="end center">\n <button mat-flat-button color="warn" (click)="chiudi()">{{\'CHIUDI\' | translate}}</button>\n</div>\n </mat-dialog-actions>\n '}]}],Ge.ctorParameters=function(){return[{type:e.MatDialogRef},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Ge.propDecorators={title:[{type:n.Input}],label:[{type:n.Input}],valore:[{type:n.Input}]};var Ke={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Be})),multi:!0},Be=function(){function t(t){this.uti_s=t,this.decimal=0,this.label="",this.hint="",this.text_align="right",this.th_character=".",this.required=!1,this.enabled=!0,this.hidden=!1,this.color="",this.error=null,this.m_bkcolor="",this.pattern="[-+]?[0-9]*[.,]?[0-9]+",this.change=new n.EventEmitter,this.focus_out=new n.EventEmitter,this.enter_key_pressed=new n.EventEmitter,this.innerValue=0,this.chgf=!1,this.onChange=function(t){},this.onTouched=function(){},this.formattedAmount="0,00",this.value=0,this.b_already_f=!1}return t.prototype.keyDownFunctioncl=function(t){13==t.keyCode&&(this.chg(),this.enter_key_pressed.emit())},t.prototype.modelch=function(){var t=this;setTimeout((function(){t.onChange(t.formattedAmount),t.change.emit(t.formattedAmount)}))},t.prototype.getStyle_Color=function(){return this.color},t.prototype.getStyle_BkColor=function(){return this.m_bkcolor},t.prototype.set_backcolor=function(t){this.m_bkcolor=t},t.prototype.set_color=function(t){this.color=t},t.prototype.chg=function(){""!=this.formattedAmount?(this.value=this.uti_s.round(parseFloat(this.formattedAmount.split(".").join("").split(",").join(".")),this.decimal),this.formattedAmount=this.transform(this.value,this.decimal)):(this.value=this.uti_s.round(0,this.decimal),this.formattedAmount=this.transform(this.value,this.decimal)),this.chgf=!0,this.onChange(this.value)},t.prototype.writeValue=function(t){null==t&&(t=0),this.innerValue=t,this.value=t,this.formattedAmount=this.transform(this.value,this.decimal)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.transform=function(t,e){void 0===e&&(e=0);var i=Ot((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=e>0?","+(s+"000000").substring(0,e):"",""!=this.th_character&&(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,this.th_character)),""==n&&(n="0"),0==this.decimal?n:n+s},t.prototype.removeCurrencyPipeFormat=function(t){try{this.formattedAmount=this.transform(this.value,this.decimal)}catch(t){console.log(t)}},t.prototype.click_select_allf=function(t){this.select_allf(t)},t.prototype.select_allf=function(t){var e=this;console.log("this.b_already_f ",this.b_already_f),this.b_already_f?console.log("SALTO FOCUS ALL"):this.el.nativeElement.select(),this.b_already_f=!0,setTimeout((function(){e.b_already_f=!1}),1e3)},t.prototype.setFocus=function(){this.el.nativeElement.focus()},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.required&&(t.el.nativeElement.required=t.required),t.el.nativeElement.disabled=!t.enabled,null==t.value&&(t.value=0),t.formattedAmount=t.transform(t.value,t.decimal)}))},t}();Be.decorators=[{type:n.Component,args:[{selector:"FHNumericField",providers:[Ke],template:'\n <mat-form-field [hidden]="hidden" appearance="outline" floatLabel="always" [class.fh_field]="enabled" [class.fh_field_dis]="!enabled"\n ><mat-label>{{ label }}</mat-label>\n <input\n type="text"\n [style.text-align]="text_align"\n [style.background-color]="getStyle_BkColor()"\n [style.color]="getStyle_Color()"\n #el\n matInput\n [required]="required"\n [disabled]="!enabled"\n [(ngModel)]="formattedAmount"\n (ngModelChange)="modelch()"\n formnovalidate\n (blur)="chg();focus_out.emit(value)"\n (click)="click_select_allf($event)"\n (focus)="removeCurrencyPipeFormat($event); select_allf($event)"\n (keydown)="keyDownFunctioncl($event)"\n />\n <mat-hint [hidden]="hint==\'\'">{{hint}}</mat-hint>\n <mat-error *ngIf="error==null">{{ error }}</mat-error>\n </mat-form-field>\n ',styles:["\n\n "]}]}],Be.ctorParameters=function(){return[{type:Ct}]},Be.propDecorators={el:[{type:n.ViewChild,args:["el"]}],decimal:[{type:n.Input}],label:[{type:n.Input}],hint:[{type:n.Input}],text_align:[{type:n.Input}],th_character:[{type:n.Input}],required:[{type:n.Input}],enabled:[{type:n.Input}],hidden:[{type:n.Input}],color:[{type:n.Input}],error:[{type:n.Input}],change:[{type:n.Output}],focus_out:[{type:n.Output}],enter_key_pressed:[{type:n.Output}],value:[{type:n.Input}]};var He=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.data=i,this.label="",this.separator=",",this.title="",this.sql="",this.types=[],this.values=[],this.single_sel=!1,this.sel_values="",this.required=!0,this.options=null,null!=i&&(null!=i.sql&&(this.sql=i.sql),null!=i.types&&(this.types=i.types),null!=i.values&&(this.values=i.values),null!=i.single_sel&&(this.single_sel=i.single_sel),null!=i.sel_values&&(this.sel_values=i.sel_values),null!=i.title&&(this.title=i.title),null!=i.separator&&(this.separator=i.separator),null!=i.label&&(this.label=i.label),null!=i.required&&(this.required=i.required),null!=i.sql&&this.doFill(),null!=i.options&&(this.options=i.options))}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.doFill=function(){var t=this;null!=this.cmb_sel?(this.single_sel||this.cmb_sel.setByDescri(this.sel_values),this.cmb_sel.sql=this.sql,this.cmb_sel.types=this.types,this.cmb_sel.values=this.values,this.cmb_sel.fillCombo()):setTimeout((function(){t.doFill()}),500)},t.prototype.ok=function(){this.required&&""==this.cmb_sel.getValue()?this.toastr.error("Selezionare un valore"):this.dialogRef.close(this.cmb_sel.getObjects())},t.prototype.ok_single=function(){this.single_sel&&this.dialogRef.close(this.cmb_sel.getObjects())},t.prototype.ngAfterViewInit=function(){null!=this.options&&(this.cmb_sel.myData=JSON.parse(JSON.stringify(this.options))),this.single_sel||this.cmb_sel.setByDescri(this.sel_values)},t}();He.decorators=[{type:n.Component,args:[{selector:"fh_win_list",template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{ title }}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <mat-dialog-content style="min-width:700px;min-height:500px">\n <FHList\n #cmb_sel\n [label]="label"\n [single_sel]="single_sel"\n [separator]="separator"\n style="width:100%;height:100%"\n init_fill="false"\n (selchange)="ok_single()"\n ></FHList>\n </mat-dialog-content>\n\n <mat-dialog-actions>\n <div fxLayout="row" fxLayoutAlign="center center" style="width: 100%">\n <button\n mat-flat-button\n color="primary"\n *ngIf="!single_sel"\n (click)="ok()"\n >\n OK</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="dialogRef.close(\'\')"\n >\n ANNULLA\n </button>\n </div>\n </mat-dialog-actions>\n</div>\n '}]}],He.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},He.propDecorators={cmb_sel:[{type:n.ViewChild,args:["cmb_sel"]}]};var Ye={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Qe})),multi:!0},Qe=function(){function t(t,e){this.dataservice=t,this.dialog=e,this.label="",this.required=!1,this.enabled=!0,this.hidden=!1,this.multi=!1,this.change=new n.EventEmitter,this.select=new n.EventEmitter,this.userName="",this.selectedUser=[],this.all_user=null,this.opened=!1,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.required&&(t.label=t.label+" *")}))},t.prototype.getUsersNc=function(){for(var t="",e=0;e<this.selectedUser.length;e++)""!=t&&(t+=","),t=t+(this.selectedUser[e].cognome+" ")+this.selectedUser[e].nome;return t},t.prototype.getUsersEmail=function(){for(var t="",e=0;e<this.selectedUser.length;e++)""!=t&&(t+=","),t=t+""+this.selectedUser[e].email;return t},t.prototype.getUsersUsername=function(){for(var t="",e=0;e<this.selectedUser.length;e++)""!=t&&(t+=","),t=t+""+this.selectedUser[e].username;return t},t.prototype.getUsers=function(){return this.selectedUser},t.prototype.writeValue=function(t){if(null!=t){if(""!=t)return"noop"==t?(this.userName=this.getUsersNc(),void this.onChange(this.getUsersUsername())):null==this.selectedUser?(this.setByUsername(t),void(this.userName=this.getUsersNc())):void(this.getUsersUsername()!=t&&(this.setByUsername(t),this.userName=this.getUsersNc()));this.clear()}else this.clear()},t.prototype.setByEmail=function(t){var e=this;if(null!=t&&""!=t){for(var i=t.split(","),n="",o=0;o<i.length;o++)""!=n&&(n+=","),n=n+"'"+i[o]+"'";if(""!=n){var s={sql:"SELECT_USERS_INFOS_BY_EMAIL_NOREP",types:["string"],values:[n],names:[]};this.dataservice.doQuery(s).subscribe((function(t){var i=t.result_data;null!=i?(e.selectedUser=i,e.writeValue("noop"),e.select.emit(e.selectedUser),e.userName=e.getUsersNc()):e.clear()}))}}},t.prototype.setByUsername=function(t){var e=this;if(t){for(var i=t.split(","),n="",o=0;o<i.length;o++)""!=n&&(n+=","),n=n+"'"+i[o]+"'";var s={sql:"SELECT_USERS_INFOS_BY_USERNAME_NOREP",types:["string"],values:[n],names:[]};this.dataservice.doQuery(s).subscribe((function(t){var i=t.result_data;null!=i?(e.selectedUser=i,e.writeValue("noop"),e.select.emit(e.selectedUser),console.log(e.selectedUser),e.userName=e.getUsersNc(),console.log(e.userName)):e.clear()}))}},t.prototype.load_all_users=function(){var t=this;this.dataservice.doQuery({sql:"SELECT_ALL_USERS",types:[],values:[],names:[]}).subscribe((function(e){t.all_user=e.result_data,null==t.all_user&&(t.all_user=[]),t.open_pick()}))},t.prototype.open_pick=function(){var t=this;if(!this.opened)if(null!=this.all_user){if(this.enabled){var e=this.dialog.open(xe,{disableClose:!0,width:"700px",height:"550px"});setTimeout((function(){e.componentInstance.user_sel=t.selectedUser,e.componentInstance.users_list=Object.assign([],t.all_user),e.componentInstance.single_sel=!t.multi,e.componentInstance.filtra()})),this.opened=!0,e.afterClosed().subscribe((function(e){t.opened=!1,null!=e&&(null!=e&&(t.selectedUser=e,t.writeValue("noop"),t.select.emit(t.selectedUser),t.userName=t.getUsersNc()),t.change.emit(t.selectedUser),t.select.emit(t.selectedUser))}))}}else this.load_all_users()},t.prototype.clear=function(){this.selectedUser=[],this.onChange([]),this.userName=""},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}();Qe.decorators=[{type:n.Component,args:[{selector:"FHUserField",providers:[Ye],template:'\n <div fxLayout="row" [hidden]="!enabled || hidden">\n <mat-form-field\n style="clickable-field" [class.fh_field]="enabled"\n (click)="open_pick()"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n\n <input\n matInput\n [hidden]="hidden"\n type="text"\n [ngModel]="userName"\n [disabled]="false"\n readonly\n />\n </mat-form-field>\n <button\n mat-icon-button\n matSuffix\n [hidden]="selectedUser.length == 0"\n (click)="clear()"\n >\n <mat-icon>clear</mat-icon>\n </button>\n </div>\n <mat-form-field\n [hidden]="enabled || hidden" [class.fh_field_dis]="!enabled"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n <input\n type="text"\n #el1\n matInput\n [disabled]="true"\n [(ngModel)]="userName"\n />\n </mat-form-field>\n ',styles:["\n .clickable-field {\n border: 1px solid #000000;\n color: #000000;\n }\n\n .clickable-field:focus {\n outline: none;\n }\n\n :host ::ng-deep .mat-input-element {\n cursor: pointer !important;\n }\n "]}]}],Qe.ctorParameters=function(){return[{type:Dt},{type:e.MatDialog}]},Qe.propDecorators={label:[{type:n.Input}],required:[{type:n.Input}],enabled:[{type:n.Input}],hidden:[{type:n.Input}],multi:[{type:n.Input}],change:[{type:n.Output}],select:[{type:n.Output}],userName:[{type:n.Input}]};var We=function(){function t(t,e,i){this.dialogRef=t,this.data=e,this.toast=i,this.salva_ed_esci="SALVA ED ESCI",this.esci_senza_salvataggi="ESCI SENZA SALVATAGGIO",this.commento="",this.b_commento=!1,this.commento_mgs="Commento",this.insert_comment_msg="Inserire un commento",null!=e&&(null!=e.mgs_salva_ed_esci&&(this.salva_ed_esci=e.mgs_salva_ed_esci),null!=e.msg_esci_senza_salvataggi&&(this.esci_senza_salvataggi=e.msg_esci_senza_salvataggi),null!=e.b_commento&&(this.b_commento=e.b_commento),null!=e.commento_mgs&&(this.commento_mgs=e.commento_mgs),null!=e.insert_comment_msg&&(this.insert_comment_msg=e.insert_comment_msg))}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.salva_esci=function(){this.b_commento&&""==this.commento?this.toast.error(this.insert_comment_msg):this.dialogRef.close("salva_esci")},t.prototype.esci_senza_salv=function(){this.dialogRef.close("esci_senza_salv")},t.prototype.ngAfterViewInit=function(){},t}();We.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <div mat-dialog-content>\n <div style="width:400px" [hidden]="!b_commento"><br /></div>\n <div style="width:400px" [hidden]="!b_commento">\n <FHTextArea\n label="{{ commento_mgs }}"\n required\n [(ngModel)]="commento"\n ></FHTextArea>\n </div>\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="salva_esci()">\n {{ salva_ed_esci }}</button\n > \n <button mat-flat-button color="warn" (click)="esci_senza_salv()">\n {{ esci_senza_salvataggi }}\n </button>\n </div>\n </div>\n '}]}],We.ctorParameters=function(){return[{type:e.MatDialogRef},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]},{type:i.ToastrService}]};var Je=function(){function t(t,e,i,n,o){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.data=o,this.lbl="",this.nota="",this.nota_commento="",this.title="ASSEGNA DOCUMENTO",this.comm_notrequired=0,this.comm_notrequired=this.m_appService.getState().wkf_doc_info.comm_notrequired,this.title=this.m_appService.getState().wkf_doc_info.title,this.lbl=this.m_appService.getState().wkf_doc_info.lbl,this.arrAutori=this.m_appService.getState().wkf_doc_info.arrAutori;for(var s=0;s<this.arrAutori.length;s++)null==this.arrAutori[s].username&&(this.arrAutori[s].username=this.arrAutori[s].idp);2==this.comm_notrequired&&(this.nota_commento=" (COMMENTO NON OBBLIGATORIO)"),null!=o&&(null!=o.commento_default&&(this.nota=o.commento_default),null!=o.comm_notrequired&&(this.comm_notrequired=o.comm_notrequired))}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(0!=this.comm_notrequired||""!=this.nota)if(0!=this.up.getSelArr().length){var t=new Object;t.nota=this.nota,t.arrsel=this.up.getSelArr(),this.dialogRef.close(t)}else this.toastr.error("ERRORE","SELEZIONARE ALMENO UN UTENTE",{timeOut:1e3,progressBar:!0});else this.toastr.error("ERRORE","INSERIRE IL COMMENTO",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();Je.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <div\n mat-dialog-content\n fxLayout="column"\n style="font-size: 15px;min-width: 750px"\n >\n <div style="width:100%;height:450px">\n <FHPickUsers\n #up\n [users_list]="arrAutori"\n [vis_buttons]="false"\n ></FHPickUsers>\n </div>\n <div *ngIf="comm_notrequired != 1">\n <br />\n\n <FHTextArea [label]="\'Commento\' | translate" [(ngModel)]="nota" rows="4"></FHTextArea>\n </div>\n </div>\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()">OK</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n ANNULLA\n </button>\n </div>\n</div>\n '}]}],Je.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:Dt},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Je.propDecorators={up:[{type:n.ViewChild,args:["up"]}]};var $e=function(){function t(t,e,i,n,o,s){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.data=o,this._tsr=s,this.utenti="",this.lbl="",this.nota="",this.nota_commento="",this.title="COMMENTI",this.comm_notrequired=0,this.mobile=!1,this.comm_notrequired=this.m_appService.getState().wkf_doc_info.comm_notrequired,this.title=this._tsr.instant(this.m_appService.getState().wkf_doc_info.title),this.lbl=this._tsr.instant(this.m_appService.getState().wkf_doc_info.lbl),this.utenti=this.m_appService.getState().wkf_doc_info.utenti,2==this.comm_notrequired&&(this.nota_commento=this._tsr.instant(" (COMMENTO NON OBBLIGATORIO)")),this.mobile=this.m_appService.getState().pageFullscreen,null!=o&&(null!=o.commento_default&&(this.nota=o.commento_default),null!=o.comm_notrequired&&(this.comm_notrequired=o.comm_notrequired))}return t.prototype.ok=function(){0!=this.comm_notrequired||""!=this.nota?this.dialogRef.close(this.nota):this.toastr.error("ERRORE",this._tsr.instant("INSERIRE IL COMMENTO"),{timeOut:1e3,progressBar:!0})},t.prototype.close=function(){this.dialogRef.close("abort")},t.prototype.ngAfterViewInit=function(){},t}();$e.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <mat-toolbar>\n <div style="font-size:10px" *ngIf="mobile">{{ lbl }}</div>\n <div *ngIf="!mobile">{{ lbl }}</div>\n </mat-toolbar>\n <br />\n <div mat-dialog-content style="min-width:800px;font-size: 15px;">\n <div\n *ngIf="mobile && utenti?.toLocaleLowerCase().indexOf(\'system\') == -1"\n style="font-size:10px"\n >\n {{\'Assegnata a\' | translate}}: {{ utenti }}\n </div>\n <h3\n *ngIf="!mobile && utenti?.toLocaleLowerCase().indexOf(\'system\') == -1"\n >\n {{\'Assegnata a\' | translate}}: {{ utenti }}\n </h3>\n <br />\n <mat-form-field\n [hidden]="comm_notrequired == 1"\n appearance="outline"\n floatLabel="always"\n ><mat-label> {{\'Commento\'}} {{ nota_commento }}</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="6"></textarea>\n </mat-form-field>\n </div>\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()">OK</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n {{\'ANNULLA\' | translate}}\n </button>\n </div>\n '}]}],$e.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:Dt},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]},{type:p.TranslateService}]};var Xe=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i,this.selval="-1",this.errorMsg="",this.title="SELEZIONA AMBITO",this.myData=this.m_appService.getState().wkf_doc_info.canali_arr,this.selval="-1"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){"-1"!=this.selval?this.dialogRef.close(this.selval):this.toastr.error("ERRORE","SELEZIONARE AMBITO",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();Xe.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n\n <div mat-dialog-content style="font-size: 15px;">\n\n <div mat-dialog-content>\n <br /><br />\n <mat-form-field\n style="width:100%"\n appearance="outline"\n floatLabel="always"\n ><mat-label>Seleziona Ambito:</mat-label>\n <mat-select #cmb [(ngModel)]="selval">\n <mat-option value="-1">Seleziona</mat-option>\n <mat-option value="{{ app }}" *ngFor="let app of myData">{{\n app\n }}</mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()">OK</button>\n </div>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">\n {{ errorMsg }}\n </p>\n </div>\n </div>\n '}]}],Xe.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService}]},Xe.propDecorators={smtr:[{type:n.ViewChild,args:["cmb"]}]};var Ze=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this.tsr=n,this.selval="-1",this.errorMsg="",this.OK_BUTTON="OK",this.title="",this.setStepCombo(this.m_appService.getState().wkf_doc_info.livs,this.m_appService.getState().wkf_doc_info.st,this.m_appService.getState().wkf_doc_info.cl),this.title=this.tsr.instant("Seleziona Prossimo Step")}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.sc=function(){if(this.OK_BUTTON="OK","-1"!=this.selval)for(var t=0;t<this.myData.length;t++){if(Number(this.selval).valueOf()+0==this.myData[t].livello+0){this.OK_BUTTON="OK ("+this.myData[t].descri_livello+")";break}}},t.prototype.setStepCombo=function(t,e,i){for(var n=e.split("|"),o=new Array,s=0;s<n.length;s++)for(var a=0;a<t.length;a++){if("*N"==n[s].toString().toUpperCase()){(r={descri_livello:"Prosegui a step successivo"}).g=0==s?1:0,r.livello="*N",o.push(r);break}if("*C"==n[s].toString().toUpperCase()){var r;(r={descri_livello:"Prosegui a chiusura"}).g=0==s?1:0,r.livello="*C",o.push(r);break}if(n[s]==t[a].livello&&n[s]!=i.livello){t[a].g=0==s?1:0,o.push(t[a]);break}}1==o.length&&this.dialogRef.close(o[0].livello),this.myData=o},t.prototype.ok=function(){null!=this.selval&&"-1"!=this.selval?this.dialogRef.close(this.selval):this.toastr.error("ERRORE","SELEZIONARE LO STEP SUCCESSIVO",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();Ze.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:80%">{{title | translate}}</div>\n <div style="width:20%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n\n <div mat-dialog-content style="font-size: 15px;">\n\n <mat-dialog-content style="max-width:500px;font-size:12px"\n ><br /><br />\n <mat-form-field\n appearance="outline"\n floatLabel="always"\n style="width:100%"\n ><mat-label>{{\'Seleziona Prossimo Step\' | translate}}:</mat-label>\n <mat-select #cmb [(ngModel)]="selval" (change)="sc()">\n <mat-option value="-1">{{\'Seleziona\' | translate}}</mat-option>\n <mat-option value="{{ app.livello }}" *ngFor="let app of myData">{{\n app.descri_livello | translate\n }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <br /><br /><br /><br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()">\n {{ OK_BUTTON }}</button\n > \n <button mat-flat-button color="warn" (click)="close()">\n {{\'ANNULLA\' | translate}}\n </button>\n </div>\n <br /><br />\n </mat-dialog-content>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">\n {{ errorMsg }}\n </p>\n </div>\n </div>\n '}]}],Ze.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:p.TranslateService}]},Ze.propDecorators={smtr:[{type:n.ViewChild,args:["cmb"]}]};var ti=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.title="SELEZIONA CHI NOTIFICARE"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.init_arr=function(t){this.up.user_sel=new Array,this.up.users_list_sel=new Array,this.up.users_list=new Array;for(var e=0;e<t.length;e++)null==t[e].username&&(t[e].username=t[e].idp),this.up.users_list_sel.push(t[e]),this.up.users_list.push(t[e]);this.up.filtra()},t.prototype.ok=function(){if(0!=this.up.getSelArr().length){var t=new Object;t.arrsel=this.up.getSelArr(),this.dialogRef.close(t)}else this.toastr.error("ERRORE","SELEZIONARE ALMENO UN UTENTE",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();ti.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <div mat-dialog-content style="min-width:700px;font-size: 15px;">\n <div style="height:370px;">\n <FHPickUsers #up [vis_buttons]="false"></FHPickUsers>\n </div>\n <br />\n </div>\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()">OK</button\n > \n <button mat-flat-button color="warn" (click)="close()">{{\'ANNULLA\' | translate}}</button>\n </div>\n</div>\n '}]}],ti.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:Dt}]},ti.propDecorators={up:[{type:n.ViewChild,args:["up"]}]};var ei=function(){function t(t,e,i){this.http=t,this.app_s=e,this.toastr=i,this.url=this.app_s.API_ENDPOINT+this.app_s.WKF_ENDPOINT}return t.prototype.doQuery=function(t,e){var i=this;void 0===e&&(e=!0);var n=!1;if(null==this.app_s.user_isadmin||"1"!=this.app_s.user_isadmin?this.app_s.dev_mode=null:null!=this.app_s.dev_mode&&"1"==this.app_s.dev_mode&&(n=!0),n){var o=this.app_s.user;"send_wkf_mail"==t.sql&&(null==t.values[9]&&(t.values[9]=""),this.toastr.info("DEBUG - MESSAGGIO NON INVIATO DESTINARI ORIGINALI: "+t.values[1]),t.values[3]=t.values[3]+"\n\n DEST. ORIGINALI:"+t.values[1],t.values[1]=o),"send_mail"==t.sql&&(this.toastr.info("DEBUG - MESSAGGIO NON INVIATO DESTINARI ORIGINALI: "+t.values[3]),t.values[2]=t.values[2]+"\n\n DEST. ORIGINALI:"+t.values[0],t.values[1]=o)}this.headers=new r.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=this.app_s.API_ENDPOINT+this.app_s.WKF_ENDPOINT;var s=JSON.stringify(t);return this.http.post(this.url,s,{headers:this.headers}).pipe(l.map((function(t){var n;if(t?"KO"===t.result_msg&&(n=new Error(t.msg)):n=new Error("Empty server response"),n)throw console.error(n),e&&i.toastr.error(n.message),new Error(n);return t||new kt})),l.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t}();ei.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new ei(n.ɵɵinject(r.HttpClient),n.ɵɵinject(wt),n.ɵɵinject(i.ToastrService))},token:ei,providedIn:"root"}),ei.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],ei.ctorParameters=function(){return[{type:r.HttpClient},{type:wt},{type:i.ToastrService}]};var ii=function(){function t(t,e,i,n,o,s,a,r){this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.toastr=n,this._dataService=o,this.m_wkf=s,this.m_file=a,this.tsr=r,this.notifica_commenti=1,this.notifica_commenti_obbl=0,this.not_comm=!1,this.not_comm_disabled=!1,this.nota="",this.title="COMMENTI",this.b_edit=!1,this.b_ins=!1,this.edit_id=0,this.lettori="",this.subject="",this.link="",this.codice_doc="",this.refresh_list()}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.init_v=function(){this.notifica_commenti>0&&1==this.notifica_commenti_obbl&&(this.not_comm=!0,this.not_comm_disabled=!0)},t.prototype.edit_comm=function(t){this.b_edit=!0,this.b_ins=!1,this.nota=t.commento,this.edit_id=t.id_comment,this.title=this.tsr.instant("MODIFICA COMMENTO")},t.prototype.refresh_list=function(){var t=this,e=new vt;e.sql="SELECT_COMMENTI_DOCUMENTO",e.types=["string","string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.commenti_list=e.result_data;for(var i=0;i<t.commenti_list.length;i++)t.commenti_list[i].v_commento="<b>"+t.commenti_list[i].commento.replace(/\n/g,"<br/>")+"</b>";t.title=t.tsr.instant("COMMENTI")}}),(function(t){}))},t.prototype.ok=function(){if(this.not_comm){if(""==this.nota)return void this.toastr.error(this.tsr.instant("INSERIRE UN COMMENTO"));2!=this.notifica_commenti?this.select_destinatari():this.select_destinatari_grp()}else this.ok_op()},t.prototype.select_destinatari_grp=function(){var t=this,e=this.m_dialogRef.open(He,{disableClose:!0});setTimeout((function(){e.componentInstance.title=t.tsr.instant("Selezione almeno un gruppo da notificare"),e.componentInstance.types=["string"],e.componentInstance.values=[t.m_appService.getState().wkf_doc_info.uiid_app],e.componentInstance.sql="SELECT_GRP_APP_USERS",e.componentInstance.doFill()})),e.afterClosed().subscribe((function(e){if(null!=e){if(""==e)return;for(var i="",n=0;n<e.length;n++)""!=i&&(i+=","),i=i+""+e[n].valore;var o=new vt;o.sql="SELECT_USERS_BY_IDROLES_NOREP",o.types=["string"],o.values=[i],t._dataService.doQuery(o).subscribe((function(e){i="";for(var n=0;n<e.result_data.length;n++)""!=i&&(i+=","),i=i+""+e.result_data[n].username;t.ok_op(i)}))}}))},t.prototype.select_destinatari=function(){var t=this,e=new vt;e.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",e.types=["string"],e.values=["'"+this.lettori.split(",").join("','")+"'"];this._dataService.doQuery(e).subscribe((function(e){var i=t.m_dialogRef.open(ti,{disableClose:!0});setTimeout((function(){i.componentInstance.init_arr(e.result_data)})),i.afterClosed().subscribe((function(e){if(null!=e){for(var i="",n=0;n<e.arrsel.length;n++)""!=i&&(i+=","),i+=e.arrsel[n].username;t.ok_op(i)}}))}),(function(t){}))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,a,r,l,p,u){if(void 0===p&&(p=!0),void 0===u&&(u=""),null!=e&&""!=e){var c=new vt;c.sql="send_wkf_mail",c.values=[t,e,i,n.split("\n").join("<br>"),o,s,a,r,l,u],this.m_wkf.doQuery(c).subscribe((function(t){}))}},t.prototype.ok_op=function(t){var e=this;if(void 0===t&&(t=""),this.b_ins){(i=new vt).sql="INSERT_WKF_COMMENTO",i.types=["string","string","string","string","string"],i.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc,this.nota,this.m_appService.getState().wkf_doc_info.curr_user,t];this._dataService.doQuery(i).subscribe((function(i){var n=!1;if(null!=i&&"OK"==i.result_msg){e.toastr.info("INFO",e.tsr.instant("COMMENTO INSERITO"),{timeOut:1e3,progressBar:!0});var o=new gt;o.command="exec_app",o.p1="insert_update_comment",o.p2=e.m_appService.getState().wkf_doc_info.uiid_app+"|"+e.m_appService.getState().wkf_doc_info.uiid_doc,e.m_file.doQuery(o,!1).subscribe(),n=!0,e.b_edit=!1,""!=t&&e.sendEMail_ex(e.m_appService.getState().wkf_doc_info.curr_user,t,e.subject.split("<OP>").join("E' stato inserito un commento"),"<br><br>Commento inserito: <br>"+e.nota.split("\n").join("<br>"),e.m_appService.getState().wkf_doc_info.uiid_app,e.m_appService.getState().wkf_doc_info.uiid_doc,e.link,e.codice_doc,""),e.refresh_list()}n||e.toastr.error("ERRORE",i.msg)}))}else{var i;(i=new vt).sql="UPDATE_WKF_COMMENTO",i.types=["string","string","string"],i.values=[this.nota,this.edit_id,t];this._dataService.doQuery(i).subscribe((function(i){var n=!1;if(null!=i&&"OK"==i.result_msg){e.toastr.info("INFO",e.tsr.instant("COMMENTO AGGIORNATO"),{timeOut:1e3,progressBar:!0});var o=new gt;o.command="exec_app",o.p1="insert_update_comment",o.p2=e.m_appService.getState().wkf_doc_info.uiid_app+"|"+e.m_appService.getState().wkf_doc_info.uiid_doc+"|"+e.edit_id,e.m_file.doQuery(o,!1).subscribe(),n=!0,e.b_edit=!1,""!=t&&e.sendEMail_ex(e.m_appService.getState().wkf_doc_info.curr_user,t,e.subject.split("<OP>").join("E' stato modificato un commento"),"<br><br>Commento modificato: <br>"+e.nota.split("\n").join("<br>"),e.m_appService.getState().wkf_doc_info.uiid_app,e.m_appService.getState().wkf_doc_info.uiid_doc,e.link,e.codice_doc,""),e.refresh_list()}n||e.toastr.error("ERRORE",i.msg)}),(function(t){}))}},t.prototype.annulla=function(){var t=this;localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog",this.tsr.instant("Conferma Operazione")),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog",this.tsr.instant("Confermi di voler annullare l'inserimento del commento?")),this.m_dialogRef.open(It).afterClosed().subscribe((function(e){e&&(t.nota="",t.b_edit=!1,t.title=t.tsr.instant("COMMENTI"))}))},t.prototype.ngAfterViewInit=function(){},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title=this.tsr.instant("INSERISCI COMMENTO")},t}();ii.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n\n <mat-toolbar color="primary">\n\n <span class="fill-remaining-space"></span>\n <div>\n <button mat-flat-button color="accent" (click)="ins()" *ngIf="!b_edit">\n <mat-icon>note_add</mat-icon>\n {{\'INSERISCI\' | translate}}\n </button>\n </div>\n </mat-toolbar>\n <br />\n <div mat-dialog-content style="min-width:800px;font-size: 15px;">\n\n <FHTextArea [label]="\'Commento\' | translate" [(ngModel)]="nota" rows="12"></FHTextArea>\n <div *ngIf="b_edit" fxLayoutAlign="center center" fxLayout="row">\n <button mat-flat-button color="primary" (click)="ok()">{{\'OK\' | translate}}</button\n > \n <button mat-flat-button color="warn" (click)="annulla()">{{\'ANNULLA\' | translate}}</button\n > \n <mat-checkbox\n [disabled]="not_comm_disabled"\n [(ngModel)]="not_comm"\n [hidden]="\n notifica_commenti == 0 || (notifica_commenti == 1 && lettori == \'\')\n "\n >\n {{\'Notifica Interessati\' | translate}}\n </mat-checkbox>\n </div>\n <section class="bs" *ngIf="!b_edit">\n <table style="min-width: 100%" class="fh_table">\n <thead>\n <tr>\n <th>{{\'Commento\' | translate}}</th>\n <th width="15%"> {{\'Autore\' | translate}}</th>\n <th width="15%"> {{\'Data\' | translate}}</th>\n <th></th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="\n let app of commenti_list;\n let odd = odd;\n let even = even;\n index as i\n "\n [ngClass]="{ odd: odd, even: even }"\n >\n <td [innerHTML]="app.v_commento"></td>\n <td>{{ app.COGNOME + " " + app.NOME }}</td>\n <td>{{ app.data_creazione | date: "dd/MM/yyyy HH:mm:ss" }}</td>\n <td>\n <mat-icon\n [matTooltip]="app.dest_notif"\n *ngIf="app.dest_notif != null && app.dest_notif != \'\'"\n >mail</mat-icon\n >\n </td>\n <td>\n <mat-icon\n *ngIf="\n i == 0 &&\n app.creatore ==\n m_appService.getState().wkf_doc_info.curr_user\n "\n (click)="edit_comm(app)"\n >edit\n </mat-icon>\n </td>\n </tr>\n </tbody>\n </table>\n </section>\n </div>\n <br />\n\n <div style="width:100%;text-align:center;" *ngIf="!b_edit">\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n\n {{\'CHIUDI\' | translate}}\n </button>\n </div>\n</div>\n ',styles:[""]}]}],ii.ctorParameters=function(){return[{type:e.MatDialogRef},{type:e.MatDialog},{type:wt},{type:i.ToastrService},{type:Dt},{type:ei},{type:Tt},{type:p.TranslateService}]};var ni=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toast=i,this.data=n,this.title="INFO DOCUMENTO",this.hide_richiedente=!1,this.load_info(n)}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.load_info=function(t){console.log("data ",t),this.codice=t.codice,this.data_richiesta=t.data_richiesta,this.richiedente=t.richiedente,this.stato=t.stato,this.stat_stato=t.stat_stato,this.in_carico_a=t.autori,null!=t.s_uto&&""!=t.s_uto&&(this.in_carico_a=t.s_uto),this.uiid_app=t.id_applicativo,this.uiid_doc=t.id_documento,this.canale=t.canale,this.nc=t.nc},t.prototype.ngAfterViewInit=function(){},t}();ni.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title|translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <div mat-dialog-content style="font-size: 15px;">\n <table class="fh_table">\n <tbody>\n <tr class="odd">\n <td>{{\'Codice\'|translate}}:</td>\n <td>\n <b>{{ codice }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>{{\'Data\'|translate}}:</td>\n <td>\n <b>{{ data_richiesta | date: "dd/MM/yyyy HH:mm:ss" }}</b>\n </td>\n </tr>\n <tr *ngIf="!hide_richiedente" class="odd">\n <td>{{\'Richiedente\'|translate}}:</td>\n <td>\n <b>{{ richiedente }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>{{\'Stato\'|translate}}:</td>\n <td>\n <b>{{ stato }} - {{stat_stato}}</b>\n </td>\n </tr>\n <tr class="odd">\n <td>{{\'In Carico a\'|translate}}:</td>\n <td>\n <b>{{ in_carico_a }}</b>\n </td>\n </tr>\n\n <tr class="even" *ngIf="m_appService.dev_mode">\n <td>Uiid App:</td>\n <td>\n <b>{{ uiid_app }}</b>\n </td>\n </tr>\n <tr class="odd" *ngIf="m_appService.dev_mode">\n <td>Uiid Doc:</td>\n <td>\n <b>{{ uiid_doc }}</b>\n </td>\n </tr>\n <tr class="odd" *ngIf="m_appService.dev_mode">\n <td>Grp:</td>\n <td>\n <b>{{ canale }}</b>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <br />\n\n <div style="width:100%;text-align:center;">\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="dialogRef.close(\'\')"\n >\n CHIUDI\n </button>\n </div>\n</div>\n '}]}],ni.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var oi=function(){function t(t,e,i,n,o,s,a,r){this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.toastr=n,this._dataService=o,this.m_wkf=s,this.m_file=a,this.data=r,this.ossv=!1,this.not_comm=!1,this.not_comm_disabled=!1,this.b_flussook=!0,this.logs=new Array,this.notifica_commenti=1,this.notifica_commenti_obbl=0,this.title="LOG WORKFLOW E COMMENTI",this.nota="",this.commenti_insert=!1,this.b_edit=!1,this.b_ins=!1,this.edit_id=0,this.c_edit=!0,this.lettori="",this.subject="",this.link="",this.codice_doc="",null!=r.edit_c&&(this.c_edit=r.edit_c)}return t.prototype.ric_all=function(){this.refresh_list()},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.init_v=function(){this.notifica_commenti>0&&1==this.notifica_commenti_obbl&&(this.not_comm=!0,this.not_comm_disabled=!0)},t.prototype.load_graph=function(){var t=this,e=new vt;e.sql="SELECT_WKF_BY_ID",e.types=["string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){if(e.result_data.length>0&&null!=e.result_data[0].diagramma_flusso&&""!=e.result_data[0].diagramma_flusso){for(var i=!1,n=0;n<t.logs.length;n++)-1==t.logs[n].id_comment&&(null!=t.logs[n].liv_ini&&(e.result_data[0].diagramma_flusso=e.result_data[0].diagramma_flusso.split('bpmnElement="STEP_'+t.logs[n].liv_ini+'"').join('bpmnElement="STEP_'+t.logs[n].liv_ini+'" bioc:stroke="#43A047" bioc:fill="#C8E6C9"')),i||null!=t.logs[n].liv_fin&&(e.result_data[0].diagramma_flusso=e.result_data[0].diagramma_flusso.split('bpmnElement="STEP_'+t.logs[n].liv_fin+'"').join('bpmnElement="STEP_'+t.logs[n].liv_fin+'" bioc:stroke="#FB8C00" bioc:fill="#FFE0B2"'),i=!0));return void t.modeler.importXML(e.result_data[0].diagramma_flusso,(function(e){e?t.b_flussook=!1:t.modeler.get("canvas").zoom("fit-viewport",{x:0,y:0})}))}t.b_flussook=!1}}))},t.prototype.annulla=function(){var t=this;localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler annullare l'inserimento del commento?"),this.m_dialogRef.open(It).afterClosed().subscribe((function(e){e&&(t.nota="",t.b_edit=!1,t.title="LOG WORKFLOW E COMMENTI")}))},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title="INSERISCI COMMENTO"},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.ric_all()}),200)},t.prototype.edit_comm=function(t){this.b_edit=!0,this.b_ins=!1,this.nota=t.stato_attuale,this.edit_id=t.id_comment,this.title="MODIFICA COMMENTO"},t.prototype.refresh_list=function(){var t=this,e=new vt;e.sql="SELECT_WORKFLOW_LOG",e.types=["string","string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc];this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.logs=e.result_data;for(var i=0;i<t.logs.length;i++)null!=t.logs[i].stato_attuale?t.logs[i].v_commento="<b>"+t.logs[i].operazione.replace(/\n/g,"<br/>")+" ("+t.logs[i].stato_attuale.replace(/\n/g,"<br/>")+")</b>":t.logs[i].v_commento="<b>"+t.logs[i].operazione.replace(/\n/g,"<br/>")+"</b>";t.ossv||(t.modeler=new R({container:"#canvas",width:"97%",height:"100%",readonly:!0})),t.load_graph(),t.ossv=!0,!0}}))},t.prototype.ok=function(){if(this.not_comm){if(""==this.nota)return void this.toastr.error("INSERIRE UN COMMENTO");1==this.notifica_commenti?this.select_destinatari():this.select_destinatari_grp()}else this.ok_op()},t.prototype.select_destinatari=function(){var t=this,e=new vt;e.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",e.types=["string"],e.values=["'"+this.lettori.split(",").join("','")+"'"];this._dataService.doQuery(e).subscribe((function(e){var i=t.m_dialogRef.open(ti,{disableClose:!0});setTimeout((function(){i.componentInstance.init_arr(e.result_data)})),i.afterClosed().subscribe((function(e){if(null!=e){for(var i="",n=0;n<e.arrsel.length;n++)""!=i&&(i+=","),i+=e.arrsel[n].username;t.ok_op(i)}}))}))},t.prototype.select_destinatari_grp=function(){var t=this,e=this.m_dialogRef.open(He,{disableClose:!0});setTimeout((function(){e.componentInstance.title="Selezione almeno un gruppo da notificare",e.componentInstance.types=["string"],e.componentInstance.values=[t.m_appService.getState().wkf_doc_info.uiid_app],e.componentInstance.sql="SELECT_GRP_APP_USERS",e.componentInstance.doFill()})),e.afterClosed().subscribe((function(e){if(null!=e){if(""==e)return;for(var i="",n=0;n<e.length;n++)""!=i&&(i+=","),i=i+""+e[n].valore;var o=new vt;o.sql="SELECT_USERS_BY_IDROLES_NOREP",o.types=["string"],o.values=[i],t._dataService.doQuery(o).subscribe((function(e){i="";for(var n=0;n<e.result_data.length;n++)""!=i&&(i+=","),i=i+""+e.result_data[n].username;t.ok_op(i)}))}}))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,a,r,l,p,u){if(void 0===p&&(p=!0),void 0===u&&(u=""),null!=e&&""!=e){var c=new vt;c.sql="send_wkf_mail",c.values=[t,e,i,n.split("\n").join("<br>"),o,s,a,r,l,u],this.m_wkf.doQuery(c).subscribe((function(t){}))}},t.prototype.ok_op=function(t){var e,i=this;(void 0===t&&(t=""),this.b_ins)?((e=new vt).sql="INSERT_WKF_COMMENTO",e.types=["string","string","string","string","string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc,this.nota,this.m_appService.getState().wkf_doc_info.curr_user,t],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){i.toastr.info("INFO","COMMENTO INSERITO",{timeOut:1e3,progressBar:!0}),console.log("insert_update_comment !!!!");var n=new gt;n.command="exec_app",n.p1="insert_update_comment",n.p2=i.m_appService.getState().wkf_doc_info.uiid_app+"|"+i.m_appService.getState().wkf_doc_info.uiid_doc,i.m_file.doQuery(n,!1).subscribe(),i.b_edit=!1,""!=t&&i.sendEMail_ex(i.m_appService.getState().wkf_doc_info.curr_user,t,i.subject.split("<OP>").join("E' stato inserito un commento"),"<br><br>Commento inserito: <br>"+i.nota.split("\n").join("<br>"),i.m_appService.getState().wkf_doc_info.uiid_app,i.m_appService.getState().wkf_doc_info.uiid_doc,i.link,i.codice_doc,""),i.refresh_list()}}))):((e=new vt).sql="UPDATE_WKF_COMMENTO",e.types=["string","string","string","string"],e.values=[this.nota,this.edit_id],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){i.toastr.info("INFO","COMMENTO AGGIORNATO",{timeOut:1e3,progressBar:!0}),console.log("insert_update_comment !!!!");var n=new gt;n.command="exec_app",n.p1="insert_update_comment",n.p2=i.m_appService.getState().wkf_doc_info.uiid_app+"|"+i.m_appService.getState().wkf_doc_info.uiid_doc,i.m_file.doQuery(n,!1).subscribe(),i.b_edit=!1,""!=t&&i.sendEMail_ex(i.m_appService.getState().wkf_doc_info.curr_user,t,i.subject.split("<OP>").join("E' stato modificato un commento"),"<br><br>Commento modificato: <br>"+i.nota.split("\n").join("<br>"),i.m_appService.getState().wkf_doc_info.uiid_app,i.m_appService.getState().wkf_doc_info.uiid_doc,i.link,i.codice_doc,""),i.refresh_list()}})))},t}();oi.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <div\n style="font-size: 12px"\n [style.height]="m_appService.getState().body_h - 130 + \'px\'"\n >\n <mat-tab-group\n #zz\n style="width:100%"\n [style.height]="m_appService.getState().body_h - 140 + \'px\'"\n >\n <mat-tab label="WORKFLOW" *ngIf="b_flussook">\n <div [style.height]="m_appService.getState().body_h - 160 + \'px\'">\n <div style="width:100%;height:100%" id="canvas"></div>\n </div>\n </mat-tab>\n\n <mat-tab label="LOGS">\n <div\n fxLayout="row"\n fxLayoutAlign="center end"\n fxFlex="90"\n *ngIf="!b_edit && commenti_insert && c_edit"\n >\n <button mat-flat-button color="accent" (click)="ins()">\n <mat-icon>note_add</mat-icon>\n {{\'INSERISCI\' | translate}}</button\n > \n </div>\n\n <div fxLayout="column" *ngIf="b_edit">\n <br />\n\n <FHTextArea *ngIf="b_edit" [label]="\'Commento\' | translate" [(ngModel)]="nota" rows="12"></FHTextArea>\n\n <div *ngIf="b_edit" fxLayoutAlign="center center" fxLayout="row">\n <button mat-flat-button color="primary" (click)="ok()">OK</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="annulla()"\n >\n {{\'ANNULLA\' | translate}}</button\n > \n <mat-checkbox\n [disabled]="not_comm_disabled"\n [(ngModel)]="not_comm"\n [hidden]="\n notifica_commenti == 0 ||\n (notifica_commenti == 1 && lettori == \'\')\n "\n >\n {{\'Notifica Interessati\' | translate}}\n\n </mat-checkbox>\n </div>\n <br /><br />\n </div>\n <table *ngIf="!b_edit" class="fh_table" style="width:90%">\n <thead>\n <tr>\n <th width="15%">{{\'Data\' | translate}}</th>\n <th width="15%">{{\'Utente\' | translate}}</th>\n <th>{{\'Task/Operazione\' | translate}}</th>\n <td></td>\n <td *ngIf="c_edit"></td>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="\n let app of logs;\n let odd = odd;\n let even = even;\n index as i\n "\n [ngClass]="{ odd: odd, even: even }"\n >\n <td>{{ app.data_creazione | date: "dd/MM/yyyy HH:mm:ss" }}</td>\n <td>{{ app.nc }}</td>\n <td [innerHTML]="app.v_commento"></td>\n <td>\n <mat-icon\n [matTooltip]="app.dest_notif"\n *ngIf="app.dest_notif != null && app.dest_notif != \'\'"\n >mail</mat-icon\n >\n </td>\n <td *ngIf="c_edit">\n <mat-icon\n *ngIf="\n i == 0 &&\n app.creatore ==\n m_appService.getState().wkf_doc_info.curr_user\n "\n (click)="edit_comm(app)"\n >edit\n </mat-icon>\n </td>\n </tr>\n </tbody>\n </table>\n </mat-tab>\n </mat-tab-group>\n </div>\n ',styles:[""]}]}],oi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:e.MatDialog},{type:wt},{type:i.ToastrService},{type:Dt},{type:ei},{type:Tt},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},oi.propDecorators={zz:[{type:n.ViewChild,args:["zz"]}]};var si=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.flt_grid="1=1",this.title="RECUPERA DOCUMENTO"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.edit=function(t){var e=this,i=new vt;i.sql="UPDATE_WKF_ANNULATO",i.types=["string","string","int"],i.values=[this.datagrid.sRow.id_applicativo,this.datagrid.sRow.uiid,0],this._dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(e.toastr.info("Documento "+e.datagrid.sRow.codice+" Recuperato"),e.dialogRef.close("ok"))}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}))},t.prototype.init_w=function(t){this.datagrid.columnDefs=[{headerName:"Codice",field:"codice",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Oggetto",field:"oggetto",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Stato",field:"stat_stato",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Richiedente",field:"nc",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}}],this.datagrid.doFill("annullato=-1 and id_applicativo='"+t+"'")},t.prototype.edit_comm=function(t){},t}();si.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <div mat-dialog-content style="font-size: 15px;">\n\n <br />\n <div style="width:100%;height:400px">\n <div style="width:100%;height:100%">\n <FHGrid\n [filters]="flt_grid"\n init_fill="false"\n show_buttons="false"\n vis\n #dtm\n (dclicked)="edit($event)"\n g_width="100%"\n g_height="100%"\n tbl_name="wkf_documents"\n grid_key="r_wkf_documents"\n sort_field="codice desc"\n off_set="50"\n fields="*"\n ></FHGrid>\n </div>\n </div>\n <br />\n\n <div style="width:100%;text-align:center;">\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="dialogRef.close(\'\')"\n >\n CHIUDI\n </button>\n </div>\n </div>\n</div>\n '}]}],si.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:Dt}]},si.propDecorators={datagrid:[{type:n.ViewChild,args:["dtm"]}]};var ai=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i,this.selval="-1",this.title="",this.errorMsg="",this.OK_BUTTON="OK"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.sc=function(){if(this.OK_BUTTON="OK","-1"!=this.selval)for(var t=0;t<this.myData.length;t++){if(Number(this.selval).valueOf()+0==this.myData[t].livello+0){this.OK_BUTTON="OK ("+this.myData[t].descri_livello+")";break}}},t.prototype.setStepCombo=function(t){this.myData=t},t.prototype.ok=function(){if(null!=this.selval)if("-1"!=this.selval){for(var t=null,e=0;e<this.myData.length;e++){if(Number(this.selval).valueOf()+0==this.myData[e].livello+0){t=this.myData[e];break}}null!=t?this.dialogRef.close({lvl_sel:t,result:"ok"}):this.toastr.error("ERRORE","SELEZIONARE LO STEP",{timeOut:1e3,progressBar:!0})}else this.toastr.error("ERRORE","SELEZIONARE LO STEP",{timeOut:1e3,progressBar:!0});else this.toastr.error("ERRORE","SELEZIONARE LO STEP",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();ai.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n\n\n <div mat-dialog-content style="font-size: 15px;">\n\n <mat-dialog-content\n ><br /><br />\n <mat-form-field\n style="width:100%"\n appearance="outline"\n floatLabel="always"\n ><mat-label>Seleziona Step:</mat-label>\n <mat-select #cmb [(ngModel)]="selval" (change)="sc()">\n <mat-option value="-1">Seleziona</mat-option>\n <mat-option value="{{ app.livello }}" *ngFor="let app of myData">{{\n app.v\n }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <br /><br /><br /><br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()">\n {{ OK_BUTTON }}</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n ANNULLA\n </button>\n </div>\n <br /><br />\n </mat-dialog-content>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">\n {{ errorMsg }}\n </p>\n </div>\n </div>\n '}]}],ai.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService}]},ai.propDecorators={smtr:[{type:n.ViewChild,args:["cmb"]}]};var ri=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.commento_hidden=!1,this.nota="",this.nota_commento="",this.title="",this.comm_notrequired=!0,this.comm_notrequired=!0}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(this.commento_hidden||""!=this.nota)if(0!=this.up.getSelArr().length){var t=new Object;t.nota=this.nota,t.arrsel=this.up.getSelArr(),t.result="ok",this.dialogRef.close(t)}else this.toastr.error("ERRORE","SELEZIONARE ALMENO UN UTENTE",{timeOut:1e3,progressBar:!0});else this.toastr.error("ERRORE","INSERIRE IL COMMENTO",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();ri.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title |translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <div mat-dialog-content fxLayout="column" style="font-size:12px">\n <div style="width:100%;height:500px">\n <FHPickUsers\n #up\n [users_list]="arrAutori"\n [vis_buttons]="false"\n ></FHPickUsers>\n </div>\n <FHTextArea [hidden]="commento_hidden" [label]="\'Commento\' | translate" [(ngModel)]="nota" rows="2"></FHTextArea>\n </div>\n <div mat-dialog-actions fxLayout="row" fxLayoutAlign="center center">\n <div>\n <button mat-flat-button color="primary" (click)="ok()">OK</button>\n </div>\n \n <div>\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n {{\'ANNULLA\' | translate}}\n </button>\n </div>\n </div>\n</div>\n '}]}],ri.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:Dt}]},ri.propDecorators={up:[{type:n.ViewChild,args:["up"]}]};var li=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.nota="",this.title="",this.comm_notrequired=!0,this.comm_notrequired=!0}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(console.log(this.up.getUsersUsername(),this.up1.getUsersUsername()),null!=this.up.getUsersUsername())if("-1"!=this.up.getUsersUsername())if(""!=this.up.getUsersUsername())if(null!=this.up1.getUsersUsername())if("-1"!=this.up1.getUsersUsername())if(""!=this.up1.getUsersUsername()){var t=new Object;t.u1=this.up.getUsersUsername(),t.u2=this.up1.getUsersUsername(),t.result="ok",this.dialogRef.close(t)}else this.toastr.error("selezionare utente destinazione");else this.toastr.error("selezionare utente destinazione");else this.toastr.error("selezionare utente destinazione");else this.toastr.error("selezionare utente origine");else this.toastr.error("selezionare utente origine");else this.toastr.error("selezionare utente origine")},t.prototype.ngAfterViewInit=function(){},t}();li.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <div\n mat-dialog-content\n fxLayoutGap="5px"\n fxLayout="column"\n style="font-size:12px"\n >\n <div style="width:100%">\n <FHUserField label="Utente da sostituire" #up></FHUserField>\n </div>\n <div style="width:100%">\n <FHUserField label="Utente sostituto" #up1></FHUserField>\n </div>\n </div>\n <div mat-dialog-actions fxLayout="row" fxLayoutAlign="center center">\n <div>\n <button mat-flat-button color="primary" (click)="ok()">OK</button>\n </div>\n \n <div>\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n ANNULLA\n </button>\n </div>\n </div>\n</div>\n '}]}],li.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:Dt}]},li.propDecorators={up:[{type:n.ViewChild,args:["up"]}],up1:[{type:n.ViewChild,args:["up1"]}]};var pi=function(){function t(t,e){this.uti=t,this.app=e}return t.prototype.read=function(t,e,i){var n=this;return void 0===e&&(e=!0),void 0===i&&(i=!0),new Promise((function(o){if(null!=localStorage.getItem(t))if(e){if(i){try{o(JSON.parse(n.uti.decrypt_v2(localStorage.getItem(t))))}catch(e){return console.log(e,"Errore JSON "+n.uti.decrypt_v2(localStorage.getItem(t))),void o({})}return}o(n.uti.decrypt_v2(localStorage.getItem(t)))}else if(i)try{o(JSON.parse(""+localStorage.getItem(t)))}catch(e){return console.log(e,"Errore JSON "+localStorage.getItem(t)),void o({})}else o(localStorage.getItem(t));else o(null)}))},t.prototype.write=function(t,e,i,n){void 0===i&&(i=!0),void 0===n&&(n=!0),i?n?localStorage.setItem(t,this.uti.encrypt_v2(JSON.stringify(e))):localStorage.setItem(t,this.uti.encrypt_v2(e)):n?localStorage.setItem(t,JSON.stringify(e)):localStorage.setItem(t,e)},t.prototype.delete=function(t){localStorage.removeItem(t)},t}();pi.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new pi(n.ɵɵinject(Ct),n.ɵɵinject(wt))},token:pi,providedIn:"root"}),pi.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],pi.ctorParameters=function(){return[{type:Ct},{type:wt}]};var ui=function(){function t(t,e,i,o,s,a,r){var l=this;this.localstore=t,this.uti_s=e,this._toast=i,this._dataService=o,this.m_appService=s,this.slimLoadingBarService=a,this.m_dialog=r,this.tbl_name="",this.count_tbl_name="",this.num_per_pag=5e3,this.grid_key="PRO_H",this.sort_field="",this.fields="*",this.filters="1=1",this.auto_height=!1,this.enable_export=!0,this.enabled_pag=!0,this.show_help=!0,this.show_num_elem=!0,this.system_dest=1,this.header_h=35,this.g_width="100%",this.g_height="100%",this.init_fill=!0,this.label_elementi=" Elementi",this.trova_label="TROVA",this.mantieni_impostazioni="Mantieni impostazioni",this.curr_filter="",this.show_buttons=!0,this.fill_end=new n.EventEmitter,this.cell_edited=new n.EventEmitter,this.clicked=new n.EventEmitter,this.dclicked=new n.EventEmitter,this.columndclicked=new n.EventEmitter,this.cell_clicked=new n.EventEmitter,this.b_ensure=!1,this.curr_config="-1",this.init_end=new n.EventEmitter,this.off_set=0,this.b_restored=!1,this.gridOptions={debug:!1,headerHeight:this.header_h,enableRangeSelection:!0,enableServerSideSorting:!1,enableServerSideFilter:!1,defaultColDef:{resizable:!0,sortable:!0,floatingFilter:!0},rowSelection:"multiple",rowDeselection:!1,getContextMenuItems:function(){return l.getContextMenuItems()},allowContextMenuWithControlKey:!0,rowModelType:"clientSide",localeText:{page:"pagina",more:"altre",to:"a",of:"di",next:"prossima",last:"ultima",first:"prima",previous:"precedente",loadingOoo:"Caricamento...",selectAll:"Seleziona Tutto",searchOoo:"Trova...",blanks:"Vuoto",filterOoo:"Filtro...",applyFilter:"Applica Filtro...",equals:"Uguale",notEqual:"Diverso",lessThan:"Minore o Uguale",greaterThan:"Maggiore o Uguale",notContains:"Non Contiene",contains:"Contiene",startsWith:"Inizia Con",endsWith:"Finisce Con",group:"Gruppo",columns:"Colonne",rowGroupColumns:"Colonne Pivot",rowGroupColumnsEmptyMessage:"trascina le colonne per raggrupparle",valueColumns:"Colonne Valore",pivotMode:"Modalità Pivot",groups:"Gruppi",values:"Valori",pivots:"Pivots",valueColumnsEmptyMessage:"trascina le colonne per aggreare",pivotColumnsEmptyMessage:"trascina le colonne per pivot",noRowsToShow:"nessun dato",pinColumn:"Sposta Colonna",valueAggregation:"Aggregazione",autosizeThiscolumn:"Autosize colonna",autosizeAllColumns:"Autosize tutte le colonne",groupBy:"Raggruppa per",ungroupBy:"Spacca per",resetColumns:"Resetta queste colonna",expandAll:"Espandi",collapseAll:"Chiudi",toolPanel:"Impostazioni",pinLeft:"Sposta <<",pinRight:"Sposta >>",noPin:"Sposta <>",sum:"Somma",min:"Minimo",max:"Massimo",none:"Nessuno",count:"Numero",average:"Media",copy:"Copia",ctrlC:"ctrl n C",paste:"Incolla",ctrlV:"ctrl n C"},getRowNodeId:function(t){return null!=t.ID?String(t.ID):null!=t.id?String(t.id):null!=t.uiid?t.uiid:null!=t.codice?t.codice:null!=t.id_doc?t.id_doc:null!=t.ord?t.ord:void 0}},this.b_init=!1,this.b_init1=!1,this.errorMsg="",this.innerWidth=750,this.show_pulisci_filtri=!1,this.num_r=0,this.ready=!1,this.ckk_ed=!1,this.myData=new Array,this.b_iniended=!1,this.ric_libera="",this.fix_flt="",this.fix_flt_temp="",null==this.m_appService.getState().grid_obj&&(this.m_appService.getState().grid_obj=new Object)}return t.prototype.ensure_visible=function(){if(!this.b_ensure){this.b_ensure=!0;try{null!=localStorage.getItem(this.grid_key+"_POS")&&(this.gridOptions.api.ensureIndexVisible(parseInt(localStorage.getItem(this.grid_key+"_POS"))),localStorage.removeItem(this.grid_key+"_POS"))}catch(t){console.log(t)}}},t.prototype.ck_flag=function(){this.toggle_mantieni.checked?localStorage.setItem(this.grid_key+"_MANTIENI","NO"):localStorage.setItem(this.grid_key+"_MANTIENI","SI")},t.prototype.refresh_all_rows=function(){this.gridOptions.api.refreshCells({force:!0})},t.prototype.ch_config=function(){this.curr_config=this.gf.getValue(),"-1"!=this.curr_config&&(localStorage.removeItem(this.grid_key+"_COLS"),localStorage.removeItem(this.grid_key+"_SORT"),localStorage.removeItem(this.grid_key+"_FILTER"),localStorage.removeItem(this.grid_key+"_CFG_DEFAULT"),null!=this.gf.getObj().COL&&""!=this.gf.getObj().COL&&localStorage.setItem(this.grid_key+"_COLS",this.gf.getObj().COL),null!=this.gf.getObj().SORT&&""!=this.gf.getObj().SORT&&localStorage.setItem(this.grid_key+"_SORT",this.gf.getObj().SORT),null!=this.gf.getObj().FILTER&&""!=this.gf.getObj().FILTER&&localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),null!=this.gf.getDescri()&&"-1"!=this.gf.getDescri()&&localStorage.setItem(this.grid_key+"_CFG_DEFAULT",this.gf.getDescri()),this.curr_config=this.gf.getValue(),this.res_columns(!0))},t.prototype.edit_config=function(){var t=this;this.m_dialog.open(It,{disableClose:!0,data:{title_dialog:"Conferma Operazione",msg_dialog:"Confermi di voler sovrascrivere la configurazione "+this.gf.getDescri()+"?"}}).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="INSERT_UPDATE_CFG_GRID";var n="",o="",s="";null!=localStorage.getItem(t.grid_key+"_COLS")&&(n=localStorage.getItem(t.grid_key+"_COLS")),null!=localStorage.getItem(t.grid_key+"_SORT")&&(o=localStorage.getItem(t.grid_key+"_SORT")),null!=localStorage.getItem(t.grid_key+"_FILTER")&&(s=localStorage.getItem(t.grid_key+"_FILTER")),i.types=["string","string","string","string","string","string"],i.values=[t.gf.getDescri(),t.grid_key,n,o,s,t.m_appService.user];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione salvata"),t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo()),t.errorMsg=e.msg}),(function(t){}))}}))},t.prototype.getGridApi=function(){return this.gridOptions.api},t.prototype.insert_config=function(){var t=this;this.win_opt=this.m_dialog.open(re,{disableClose:!0}),setTimeout((function(){t.win_opt.componentInstance.title="Salva Configurazione",t.win_opt.componentInstance.label="Nome"})),this.win_opt.afterClosed().subscribe((function(e){if(e&&null!=e){var i=new vt;i.sql="INSERT_UPDATE_CFG_GRID";var n="",o="",s="";null!=localStorage.getItem(t.grid_key+"_COLS")&&(n=localStorage.getItem(t.grid_key+"_COLS")),null!=localStorage.getItem(t.grid_key+"_SORT")&&(o=localStorage.getItem(t.grid_key+"_SORT")),null!=localStorage.getItem(t.grid_key+"_FILTER")&&(s=localStorage.getItem(t.grid_key+"_FILTER")),i.types=["string","string","string","string","string","string"],i.values=[e,t.grid_key,n,o,s,t.m_appService.user];t._dataService.doQuery(i).subscribe((function(e){var i=!1;null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione salvata"),i=!0,t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo()),i||(t.errorMsg=e.msg)}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"}))}}))},t.prototype.getContextMenuItems=function(){var t=this,e=["autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste","toolPanel",{name:"Esporta",action:function(){t.onBtExport()}}];return this.enable_export||(e=new Array("autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste","toolPanel")),e},t.prototype.onBtExport=function(){var t=this,e={skipHeader:!1,columnGroups:!1,skipFooters:!0,skipGroups:!0,skipPinnedTop:!0,skipPinnedBottom:!0,allColumns:!0,onlySelected:!1,suppressQuotes:!1,processCellCallback:function(e){if(e.value){if(null==e.value)return"";if("function"==typeof e.value.getMonth)return t.uti_s.pad(e.value.getDate(),2)+"/"+t.uti_s.pad(e.value.getMonth()+1,2)+"/"+e.value.getFullYear();if(24==e.value.length&&e.value.indexOf(":00.000Z")>-1){var i=new Date(e.value);return t.uti_s.pad(i.getDate(),2)+"/"+t.uti_s.pad(i.getMonth()+1,2)+"/"+i.getFullYear()+" "+t.uti_s.pad(i.getHours(),2)+":"+t.uti_s.pad(i.getMinutes(),2)}return e.value}}};this.gridOptions.api.exportDataAsExcel(e)},t.prototype.setHeaderHeight=function(t){this.header_h=t,this.gridOptions.api.setHeaderHeight(this.header_h)},t.prototype.getRowNodeId=function(t){return null==t||null==t.data?this.uti_s.newGuid():null!=t.data.id?String(t.data.id):null!=t.data.uiid?t.data.uiid:null!=t.data.codice?t.data.codice:"NA"},t.prototype.ngAfterViewInit=function(){},t.prototype.okr=function(t){t.data.nome_colonna=t.column.colDef.field,this.cell_edited.emit(t.data)},t.prototype.help_window=function(){this.m_dialog.open(ae,{disableClose:!0}).afterClosed().subscribe((function(t){}))},t.prototype.autoSizeAll=function(){var t=[];this.columnDefs.forEach((function(e){t.push(e.field)})),this.gridOptions.columnApi.autoSizeColumns(t),this.save_cfg()},t.prototype.fitSizeAll=function(){this.gridOptions.api.sizeColumnsToFit(),this.save_cfg()},t.prototype.selectCount=function(){var t=0;return this.gridOptions.api.forEachNode((function(e){e.isSelected()&&t++})),t},t.prototype.getquerySelected=function(t,e){var i="";return"String"==e&&this.gridOptions.api.forEachNode((function(e){e.isSelected()&&null!=e.data[t]&&(""!=i&&(i+=","),i=i+"'"+e.data[t]+"'")})),"Number"==e&&this.gridOptions.api.forEachNode((function(e){e.isSelected()&&null!=e.data[t]&&(""!=i&&(i+=","),i+=e.data[t])})),i},t.prototype.selectAllFiltered=function(){var t=this;this.gridOptions.api.forEachNode((function(e){t.gridOptions.api.selectNode(e,!0)}))},t.prototype.deselectAllFiltered=function(){var t=this;this.gridOptions.api.forEachNode((function(e){t.gridOptions.api.selectNode(e,!1)}))},t.prototype.pulisci_filtri=function(t){void 0===t&&(t=!0),localStorage.removeItem(this.grid_key+"_FILTER"),t&&(this.ric_libera=""),this.fix_flt_temp="",this.gridOptions.api.setFilterModel(null),this.show_pulisci_filtri=!1},t.prototype.init_conf=function(){},t.prototype.createColumnDefs=function(t){},t.prototype.ckk=function(){var t=this;null!=this.columnDefs&&0!=this.columnDefs.length?this.ckk_ed||(this.ckk_ed=!0,null!=this.toggle_mantieni&&(this.toggle_mantieni.checked=!0,null!=localStorage.getItem(this.grid_key+"_MANTIENI")&&"NO"==localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.toggle_mantieni.checked=!1)),this.res_columns(),null!=localStorage.getItem(this.grid_key+"_POS")&&(this.b_restored=!0),this.init_fill&&setTimeout((function(){t.ref_dt()}),100)):setTimeout((function(){t.ckk()}),500)},t.prototype.res_columns=function(t){void 0===t&&(t=!1);var e=!1;if(null!=this.toggle_mantieni&&(e=this.toggle_mantieni.checked),null!=localStorage.getItem(this.grid_key+"_COLS")&&(e||t)&&""!=localStorage.getItem(this.grid_key+"_COLS")){!0;try{this.gridOptions.columnApi.setColumnState(JSON.parse(localStorage.getItem(this.grid_key+"_COLS")))}catch(t){console.log(t)}}try{this.gridOptions.api.setSortModel(null)}catch(t){console.log(t)}if(null!=localStorage.getItem(this.grid_key+"_SORT")&&(e||t)&&""!=localStorage.getItem(this.grid_key+"_SORT"))try{this.gridOptions.api.setSortModel(JSON.parse(localStorage.getItem(this.grid_key+"_SORT")))}catch(t){console.log(t)}try{this.gridOptions.api.setFilterModel(null)}catch(t){console.log(t)}if(null!=localStorage.getItem(this.grid_key+"_FILTER")&&(e||t)&&""!=localStorage.getItem(this.grid_key+"_FILTER"))try{this.gridOptions.api.setFilterModel(JSON.parse(localStorage.getItem(this.grid_key+"_FILTER")))}catch(t){console.log(t)}},t.prototype.getRows=function(){return this.gridOptions.rowData},t.prototype.setRows=function(){var t=this;this.localstore.read(this.m_appService.COMPANY_KEY+this.tbl_name).then((function(e){t.rowData=e}))},t.prototype.sortAndFilter=function(t,e){},t.prototype.ref_dt=function(){var t=this;null==this.gridOptions||null==this.gridOptions.api?setTimeout((function(){t.ref_dt()}),500):this.setRows()},t.prototype.updateRow=function(){this.refresh_all_rows()},t.prototype.onModelUpdated=function(){},t.prototype.onReady=function(t){if(this.setHeaderHeight(this.header_h),null==this.gf||!this.show_buttons||(this.gf.sql="SELECT_CFG_GRID",this.gf.types=["string"],this.gf.values=[this.grid_key],this.gf.fillCombo(),"NO"==localStorage.getItem(this.grid_key+"_MANTIENI")||null==localStorage.getItem(this.grid_key+"_CFG_DEFAULT"))){/iPad|iPhone|iPod/.test(navigator.userAgent);this.onready_go()}},t.prototype.save_cfg=function(){localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.fe_cfg=function(){null!=this.gf&&null!=this.gf.getObj()&&"NO"!=localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.gf.setByDescri(localStorage.getItem(this.grid_key+"_CFG_DEFAULT")),localStorage.setItem(this.grid_key+"_COL",this.gf.getObj().COLS),localStorage.setItem(this.grid_key+"_SORT",this.gf.getObj().SORT),localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),this.curr_config=this.gf.getValue()),this.onready_go()},t.prototype.onready_go=function(){var t=this;this.ready=!0,setTimeout((function(){t.ckk()}),10),this.b_iniended||(this.b_iniended=!0,this.init_end.emit())},t.prototype.init_filters=function(){},t.prototype.keyDownFunctioncl=function(t){13==t.keyCode&&this.free_search()},t.prototype.free_search=function(){if(""==this.ric_libera)return this.pulisci_filtri(),this.fix_flt_temp="",void this.doFill("",!0,!1);for(var t=this.ric_libera.split(" "),e=new Array,i=0;i<t.length;i++)t[i].length>2?e.push(t[i]):this._toast.error("ignorato termine: "+t[i]+" troppo corto");if(0!=e.length){for(var n="",o=0;o<this.columnDefs.length;o++)if(null!=this.columnDefs[o]&&null==this.columnDefs[o].no_filter&&null!=this.columnDefs[o].field&&""!=this.columnDefs[o].field&&"agDateColumnFilter"!=this.columnDefs[o].filter)for(i=0;i<e.length;i++)""!=n&&(n+=" or "),n=n+this.columnDefs[o].field+" LIKE '%"+this.uti_s.string_sqlvalue(e[i])+"%'";this.pulisci_filtri(!1),this.doFill_Temp(n,!0)}},t.prototype.onCellClicked=function(t){this.cell_clicked.emit(t)},t.prototype.onCellValueChanged=function(t){},t.prototype.onCellDoubleClicked=function(t){},t.prototype.onCellFocused=function(t){},t.prototype.onSelectionChanged=function(){},t.prototype.onBeforeFilterChanged=function(){},t.prototype.oncolumnEverythingChanged=function(t){this.b_init&&localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.onAfterFilterChanged=function(){localStorage.removeItem(this.grid_key+"_POS"),this.b_init&&localStorage.setItem(this.grid_key+"_FILTER",JSON.stringify(this.gridOptions.api.getFilterModel()))},t.prototype.onFilterModified=function(){this.b_init&&localStorage.setItem(this.grid_key+"_FILTER",JSON.stringify(this.gridOptions.api.getFilterModel()))},t.prototype.onBeforeSortChanged=function(){},t.prototype.onAfterSortChanged=function(){this.b_init&&localStorage.setItem(this.grid_key+"_SORT",JSON.stringify(this.gridOptions.api.getSortModel()))},t.prototype.onVirtualRowRemoved=function(t){},t.prototype.onRowClicked=function(t){var e=this.gridOptions.api.getSelectedNodes();null!=e&&null!=e[0]&&(localStorage.setItem(this.grid_key+"_POS",String(e[0].rowIndex)),localStorage.setItem(this.grid_key+"_POS_BAR",JSON.stringify(this.gridOptions.api.getVerticalPixelRange())),localStorage.setItem(this.grid_key+"_POS2",this.getRowNodeId(e[0]))),this.sRow=t.data,this.clicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&(this.columndclicked.emit(t),this.dclicked.emit(t.data))},t.prototype.onRowDClicked=function(t){this.dclicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&this.columndclicked.emit(t)},t.prototype.onQuickFilterChanged=function(t){this.gridOptions.api.setQuickFilter(t.target.value)},t.prototype.onColumnEvent=function(t){this.columndclicked.emit(t)},t.prototype.doFill=function(t,e,i){var n=this;void 0===e&&(e=!0),void 0===i&&(i=!0),e&&(this.filters=""),i&&(this.fix_flt=t),this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout((function(){n.ckk()}),10)},t.prototype.doFill_Temp=function(t,e){var i=this;void 0===e&&(e=!0),e&&(this.filters=""),this.fix_flt_temp=t,this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout((function(){i.ckk()}),10)},t.prototype.Refresh=function(){this.ref_dt()},t.prototype.RefreshOnlyMemory=function(){this.updateRow()},t}();ui.decorators=[{type:n.Component,args:[{selector:"FHGridJSON",template:'\n <table [hidden]="!show_buttons" style="height: 15%;">\n <tr>\n <td [hidden]="this.m_appService.getState().pageFullscreen">\n <h5>{{ num_r }} {{label_elementi|translate }}</h5>\n \n </td>\n <td style="vertical-align:\'bottom\'">\n \n <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>{{ trova_label|translate }}</mat-label>\n <input\n matInput\n (keydown)="keyDownFunctioncl($event)"\n [(ngModel)]="ric_libera"\n style="width:200px"\n /> </mat-form-field\n > \n </td>\n <td\n [hidden]="this.m_appService.getState().pageFullscreen"\n *ngIf="show_buttons && !this.m_appService.getState().mobile"\n >\n <button\n *ngIf="show_pulisci_filtri"\n mat-flat-button\n (click)="pulisci_filtri()"\n color="warn"\n >\n <mat-icon>clear</mat-icon> REMOVE FILTER\n </button>\n </td>\n <td\n [hidden]="this.m_appService.getState().pageFullscreen"\n *ngIf="show_buttons && !this.m_appService.getState().mobile"\n >\n \n <button mat-flat-button (click)="autoSizeAll()" color="accent">\n <mat-icon>photo_size_select_small</mat-icon> AUTO SIZE\n </button>\n </td>\n <td\n [hidden]="this.m_appService.getState().pageFullscreen"\n *ngIf="show_buttons && !this.m_appService.getState().mobile"\n >\n \n <button mat-flat-button (click)="fitSizeAll()" color="accent">\n <mat-icon>aspect_ratio</mat-icon> FIT SIZE\n </button>\n </td>\n </tr>\n </table>\n <div\n [hidden]="this.m_appService.getState().pageFullscreen"\n *ngIf="\n !show_buttons && !this.m_appService.getState().mobile && show_num_elem\n "\n >\n <h5>\n {{ num_r }} {{ "Elementi" | translate}}\n </h5>\n </div>\n\n <ag-grid-angular\n ref-agGrid\n style="width:100%;height:85%;"\n (cellDoubleClicked)="onColumnEvent($event)"\n (cellClicked)="onCellClicked($event)"\n [headerHeight]="header_h"\n [groupHeaderHeight]="header_h"\n class="ag-theme-balham"\n [singleClickEdit]="true"\n [gridOptions]="gridOptions"\n [columnDefs]="columnDefs"\n [rowData]="rowData"\n (afterFilterChanged)="onAfterFilterChanged()"\n (filterModified)="onFilterModified()"\n (rowDoubleClicked)="onRowDClicked($event)"\n (rowClicked)="onRowClicked($event)"\n (columnVisible)="oncolumnEverythingChanged($event)"\n (columnResized)="oncolumnEverythingChanged($event)"\n (columnMoved)="oncolumnEverythingChanged($event)"\n (cellValueChanged)="okr($event)"\n (sortChanged)="onAfterSortChanged()"\n [paginationPageSize]="num_per_pag"\n (gridReady)="onReady($event)"\n >\n </ag-grid-angular>\n ',styles:[""]}]}],ui.ctorParameters=function(){return[{type:pi},{type:Ct},{type:i.ToastrService},{type:Dt},{type:wt},{type:h.SlimLoadingBarService},{type:e.MatDialog}]},ui.propDecorators={tbl_name:[{type:n.Input}],columnDefs:[{type:n.Input}],count_tbl_name:[{type:n.Input}],num_per_pag:[{type:n.Input}],grid_key:[{type:n.Input}],sort_field:[{type:n.Input}],fields:[{type:n.Input}],filters:[{type:n.Input}],auto_height:[{type:n.Input}],enable_export:[{type:n.Input}],enabled_pag:[{type:n.Input}],show_help:[{type:n.Input}],show_num_elem:[{type:n.Input}],system_dest:[{type:n.Input}],header_h:[{type:n.Input}],g_width:[{type:n.Input}],g_height:[{type:n.Input}],init_fill:[{type:n.Input}],label_elementi:[{type:n.Input}],trova_label:[{type:n.Input}],mantieni_impostazioni:[{type:n.Input}],show_buttons:[{type:n.Input}],fill_end:[{type:n.Output}],cell_edited:[{type:n.Output}],clicked:[{type:n.Output}],dclicked:[{type:n.Output}],columndclicked:[{type:n.Output}],cell_clicked:[{type:n.Output}],gf:[{type:n.ViewChild,args:["gf"]}],toggle_mantieni:[{type:n.ViewChild,args:["toggle_mantieni"]}],init_end:[{type:n.Output}],off_set:[{type:n.Input}],testom:[{type:n.ViewChild,args:["testom",{read:n.ViewContainerRef}]}],myModalNormal:[{type:n.ViewChild,args:["myModalNormal",{read:n.ViewContainerRef}]}]};var ci=function(){function t(){this.show_help=!1,this.help_label="HELP",this.show_link=!1,this.elimina_label="ELIMINA",this.b_wait=!1,this.type="NONE",this.toolbar_wkfapp=null,this.custom_commands=[],this.sRow=null,this.command=new n.EventEmitter}return t.prototype.ngAfterViewInit=function(){for(var t=0;t<this.custom_commands.length;t++)null==this.custom_commands[t].type&&(this.custom_commands[t].type="button")},t.prototype.refresh_access=function(t){this.toolbar_wkfapp=t},t.prototype.selx=function(t,e){this.command.emit({cmd:t,v:e})},t.prototype.exec_command=function(t){this.command.emit({cmd:t})},t.prototype.help_doc=function(){this.command.emit({cmd:"show_help"})},t.prototype.link_doc=function(){this.command.emit({cmd:"link_list"})},t.prototype.insert_doc=function(){this.command.emit({cmd:"insert_doc"})},t.prototype.annulla_imp=function(){this.command.emit({cmd:"annulla_imp"})},t.prototype.recupera_richiesta=function(){this.command.emit({cmd:"recupera_richiesta"})},t.prototype.riassegna_richiesta=function(){this.command.emit({cmd:"riassegna_richiesta"})},t.prototype.sostituisci_utente=function(){this.command.emit({cmd:"sostituisci_utente"})},t.prototype.reclama_bozza=function(){this.command.emit({cmd:"reclama_bozza"})},t.prototype.test_utente=function(){this.command.emit({cmd:"test_utente"})},t.prototype.annulla_richiesta=function(){this.command.emit({cmd:"annulla_richiesta"})},t.prototype.new_doc=function(){this.command.emit({cmd:"new_doc"})},t.prototype.del_doc=function(){this.command.emit({cmd:"del_doc"})},t}();ci.decorators=[{type:n.Component,args:[{selector:"FHGridToolBar",template:'\n <div\n *ngIf="type == \'WKF\' || type == \'WKF_NO_EDIT\'"\n fxLayoutGap="3px"\n fxLayout="row"\n fxFlex="100"\n style="height: 70px;"\n fxLayoutAlign="end center"\n >\n <mat-toolbar>\n <div fxLayout="row" fxLayoutGap="3px" fxLayoutAlign="end center">\n <button mat-flat-button (click)="link_doc()" style="background-color: #2B7CD3;color:#FFFFFF" *ngIf="show_link">\n <mat-icon>launch</mat-icon> {{\n "LINK" | translate\n }}\n </button>\n <button mat-flat-button (click)="help_doc()" style="background-color: #2B7CD3;color:#FFFFFF" *ngIf="show_help">\n <mat-icon>help</mat-icon> {{\n help_label | translate\n }}\n </button>\n <div style="width:200px" fxHide fxShow.gt-sm *ngIf="show_link || show_help"></div>\n <table><tr><td style="width:130px">\n <button\n mat-flat-button\n (click)="insert_doc()"\n *ngIf="toolbar_wkfapp?.is_Ins && type != \'WKF_NO_EDIT\'"\n color="accent"\n style="width:130px"\n >\n <mat-icon>note_add</mat-icon> {{\n "INSERISCI" | translate\n }}</button\n >\n </td><td style="width:130px">\n <button\n mat-flat-button\n color="warn"\n mat-button style="width:130px"\n fxHide\n fxShow.gt-sm\n [matMenuTriggerFor]="gest_menu"\n *ngIf="toolbar_wkfapp?.is_Supervisor"\n >\n {{ "Gestione" | translate }}\n </button>\n </td></tr></table>\n <mat-menu #gest_menu="matMenu">\n <button mat-menu-item [hidden]="sRow==null" (click)="annulla_richiesta()">\n {{ "ANNULLA DOCUMENTO" | translate }}\n </button>\n <button mat-menu-item (click)="recupera_richiesta()">\n {{ "RECUPERA DOCUMENTO" | translate }}\n </button>\n <button mat-menu-item [hidden]="sRow==null" (click)="riassegna_richiesta()">\n {{ "RIASSEGNA DOCUMENTO" | translate }}\n </button>\n <button\n mat-menu-item [hidden]="sRow==null"\n (click)="sostituisci_utente()"\n *ngIf="toolbar_wkfapp?.is_Admin"\n >\n {{ "SOSTITUISCI UTENTE" | translate }}\n </button>\n <button\n mat-menu-item [hidden]="sRow==null"\n style="background-color: #F5F5F5"\n (click)="reclama_bozza()"\n *ngIf="toolbar_wkfapp?.is_Supervisor || toolbar_wkfapp?.is_Admin"\n >\n {{ "RECLAMA BOZZA" | translate }}\n </button>\n <button\n mat-menu-item\n (click)="test_utente()"\n *ngIf="toolbar_wkfapp?.is_Admin"\n >\n {{ "TEST UTENTE" | translate }}\n </button>\n </mat-menu>\n <button\n mat-flat-button\n (click)="annulla_imp()"\n *ngIf="toolbar_wkfapp?.imp != null && toolbar_wkfapp?.imp != \'\'"\n >\n {{ toolbar_wkfapp?.imp }}\n </button>\n<div>\n <button\n mat-flat-button\n color="accent"\n mat-button\n [matMenuTriggerFor]="gest_menu_custom"\n *ngIf="custom_commands!=null && custom_commands.length>0"\n >\n\t\t\t<mat-icon>menu</mat-icon>\n </button>\n </div>\n <mat-menu #gest_menu_custom="matMenu">\n <div fxLayout="row" style="width:300px" fxLayoutAlign="center center"> \n <div fxLayout="column" fxLayoutGap="8px" fxFlex="100" fxLayoutAlign="center start">\n\t\t\t<ng-container *ngFor="let app of custom_commands">\n\n <div style="width:280px"><button *ngIf="app.type == \'button\'" [hidden]="app.hidden"\n mat-flat-button style="width:96%"\n [color]="app.color"\n (click)="exec_command(app.command)"\n >\n <mat-icon *ngIf="app.icon != null">{{ app.icon }}</mat-icon> {{ app.label | translate }}\n </button></div>\n <div style="width:280px">\n\t\t\t\t <FHCheckBox\n\t\t\t\t\t *ngIf="app.type == \'checkbox\'"\n (change)="selx(app.command, $event)"\n [label]="app.label | translate"\n [(ngModel)]="app.default_value"\n ></FHCheckBox>\n </div>\n <div style="width:280px">\n\t\t\t <FHTableManager *ngIf="app.type == \'table_manager\'" style="width:180px" [application]="app.default_value"></FHTableManager>\n </div>\n\t\t\t</ng-container>\n </div> \n </div>\n </mat-menu>\n </div>\n </mat-toolbar>\n </div>\n <div\n *ngIf="type == \'INSERT_DELETE\' || type == \'INSERT\'"\n fxLayoutGap="3px"\n fxLayout="row"\n fxFlex="100"\n style="height: 70px;"\n fxLayoutAlign="end center"\n >\n <mat-toolbar>\n <div fxLayout="row" fxLayoutGap="5px" fxLayoutAlign="end center">\n <button mat-flat-button (click)="link_doc()" style="background-color: #2B7CD3;color:#FFFFFF" *ngIf="show_link">\n <mat-icon>launch</mat-icon> {{\n "LINK" | translate\n }}\n </button>\n <button mat-flat-button (click)="help_doc()" style="background-color: #2B7CD3;color:#FFFFFF" *ngIf="show_help">\n <mat-icon>help</mat-icon> {{\n help_label | translate\n }}\n </button>\n <div style="width:200px" fxHide fxShow.gt-sm *ngIf="show_link || show_help"></div>\n <button mat-flat-button (click)="new_doc()" color="primary">\n <mat-icon>note_add</mat-icon> {{\n "INSERISCI" | translate\n }}\n </button>\n\n <button\n *ngIf="type == \'INSERT_DELETE\'"\n mat-flat-button\n (click)="del_doc()"\n color="warn"\n >\n <mat-icon>delete</mat-icon> \n {{elimina_label | translate}}\n\n </button>\n <div *ngFor="let app of custom_commands" fxLayout="column" fxLayoutGap="5px">\n <div *ngIf="app.type == \'button\' || app.type == null">\n <button [hidden]="app.hidden!=null && app.hidden"\n mat-flat-button\n [color]="app.color"\n (click)="exec_command(app.command)"\n >\n <mat-icon *ngIf="app.icon != null">{{ app.icon }}</mat-icon\n > {{ app.label | translate }}\n </button>\n </div>\n <div *ngIf="app.type == \'checkbox\'" style="font-size:12px">\n <FHCheckBox\n\n (change)="selx(app.command, $event)"\n [label]="app.label | translate"\n [(ngModel)]="app.default_value"\n ></FHCheckBox>\n </div>\n <div *ngIf="app.type == \'spacer\'" style="width:60px"></div>\n <div *ngIf="app.type == \'table_manager\'">\n <FHTableManager [application]="app.default_value"></FHTableManager>\n </div>\n </div>\n <div [hidden]="!b_wait"><mat-spinner diameter="25"></mat-spinner></div>\n </div>\n </mat-toolbar>\n\n </div>\n <div\n *ngIf="type == \'CUSTOM\'"\n fxLayoutGap="3px"\n fxLayout="row"\n fxFlex="100"\n style="height: 70px;"\n fxLayoutAlign="end center"\n > <button mat-flat-button (click)="link_doc()" style="background-color: #2B7CD3;color:#FFFFFF" *ngIf="show_link">\n <mat-icon>launch</mat-icon> {{\n "LINK" | translate\n }}\n </button>\n <div *ngFor="let app of custom_commands" fxLayoutAlign="end center" fxLayout="row" fxLayoutGap="10px">\n <div *ngIf="app.type == \'button\' || app.type == null">\n <button [hidden]="app.hidden!=null && app.hidden"\n\n mat-flat-button\n [color]="app.color"\n (click)="exec_command(app.command)"\n >\n <mat-icon *ngIf="app.icon != null">{{ app.icon }}</mat-icon\n > {{ app.label | translate }}\n </button>\n </div>\n <div *ngIf="app.type == \'checkbox\'" style="font-size:12px">\n <FHCheckBox\n (change)="selx(app.command, $event)"\n [label]="app.label | translate"\n [(ngModel)]="app.default_value"\n ></FHCheckBox>\n </div>\n <div *ngIf="app.type == \'spacer\'" style="width:60px"></div>\n <div *ngIf="app.type == \'table_manager\'">\n <FHTableManager [application]="app.default_value"></FHTableManager>\n </div>\n </div>\n <div [hidden]="!b_wait"><mat-spinner diameter="25"></mat-spinner></div>\n </div>\n <div\n *ngIf="type == \'CUSTOM_MENU\'"\n fxLayoutGap="3px"\n fxLayout="row"\n fxFlex="100"\n style="height: 70px;"\n fxLayoutAlign="end center"\n >\n <button\n mat-flat-button\n color="warn"\n mat-button\n fxHide\n fxShow.gt-sm\n [matMenuTriggerFor]="gest_menu"\n\n >\n <mat-icon>menu</mat-icon>\n </button>\n <mat-menu #gest_menu="matMenu">\n <div fxLayout="column" fxLayoutGap="6px" style="width:100%">\n <div style="width:100%"><button style="width:100%" mat-flat-button (click)="link_doc()" style="background-color: #2B7CD3;color:#FFFFFF" *ngIf="show_link">\n <mat-icon>launch</mat-icon> {{\n "LINK" | translate\n }}\n </button></div>\n <div *ngFor="let app of custom_commands" fxLayoutAlign="end center" fxLayout="row" fxLayoutGap="10px">\n <div style="width:100%" *ngIf="app.type == \'button\' || app.type == null">\n <button [hidden]="app.hidden!=null && app.hidden"\n style="width:100%"\n mat-flat-button\n [color]="app.color"\n (click)="exec_command(app.command)"\n >\n <mat-icon *ngIf="app.icon != null">{{ app.icon }}</mat-icon\n > {{ app.label | translate }}\n </button>\n </div>\n <div *ngIf="app.type == \'checkbox\'" style="font-size:12px">\n <FHCheckBox\n (change)="selx(app.command, $event)"\n [label]="app.label | translate"\n [(ngModel)]="app.default_value"\n ></FHCheckBox>\n </div>\n <div *ngIf="app.type == \'spacer\'" style="width:60px"></div>\n <div *ngIf="app.type == \'table_manager\'">\n <FHTableManager [application]="app.default_value"></FHTableManager>\n </div>\n </div></div>\n </mat-menu>\n </div>\n <div\n *ngIf="type == \'NONE\' && show_link"\n fxLayoutGap="3px"\n fxLayout="row"\n fxFlex="100"\n style="height: 70px;"\n fxLayoutAlign="end center"\n >\n <button mat-flat-button (click)="link_doc()" style="background-color: #2B7CD3;color:#FFFFFF" *ngIf="show_link">\n <mat-icon>launch</mat-icon> {{\n "LINK" | translate\n }}\n </button>\n\n <button mat-flat-button (click)="help_doc()" style="background-color: #2B7CD3;color:#FFFFFF" *ngIf="show_help">\n <mat-icon>help</mat-icon> {{\n help_label | translate\n }}\n </button>\n\n <div [hidden]="!b_wait"><mat-spinner diameter="25"></mat-spinner></div>\n </div>\n ',styles:["\n\n "]}]}],ci.propDecorators={show_help:[{type:n.Input}],help_label:[{type:n.Input}],show_link:[{type:n.Input}],elimina_label:[{type:n.Input}],b_wait:[{type:n.Input}],type:[{type:n.Input}],toolbar_wkfapp:[{type:n.Input}],custom_commands:[{type:n.Input}],sRow:[{type:n.Input}],command:[{type:n.Output}]};var di=function(){function t(t,e){this.m_appService=t,this._trs=e,this.custom_commands=[],this.dt_agg=null,this.edit_button=!1,this.respingi_button=!1,this.procedi_button=!0,this.utility_button=!0,this.download_button=!0,this.force_save=!1,this.check_on_save=!1,this.command=new n.EventEmitter,this.admin_role="[ZZZ_DIS_CC]",this.sovra_path="",this.edit_comments_in_logs=!0,this.back_lbl="Indietro",this.save_lbl="Salva",this.procedi_lbl="Procedi",this.respingi_lbl="Respingi",this.revisione_lbl="Revisione",this.info_doc_lbl="Info Doc",this.commenti_lbl="Commenti",this.allegati_lbl="Allegati",this.workflow_lbl="Workflow",this.button_clicked=new n.EventEmitter}return t.prototype.exec_command=function(t){this.command.emit({cmd:t})},t.prototype.back=function(){this.button_clicked.emit("back"),null!=this.dt_agg&&this.dt_agg.back(this.edit_button)},t.prototype.evt_salv=function(){this.button_clicked.emit("evt_salv"),null!=this.dt_agg&&this.dt_agg.evt_salv(this.edit_button,this.check_on_save)},t.prototype.respingi=function(){this.button_clicked.emit("respingi"),null!=this.dt_agg&&this.dt_agg.respingi()},t.prototype.procedi=function(){this.button_clicked.emit("procedi"),null!=this.dt_agg&&this.dt_agg.procedi()},t.prototype.open_info=function(){this.button_clicked.emit("open_info"),null!=this.dt_agg&&this.dt_agg.open_info()},t.prototype.open_commenti=function(){this.button_clicked.emit("open_commenti"),null!=this.dt_agg&&this.dt_agg.open_commenti()},t.prototype.open_upload=function(){this.button_clicked.emit("open_upload"),null!=this.dt_agg&&this.dt_agg.open_upload(this.sovra_path,this.admin_role)},t.prototype.open_wkf=function(){this.button_clicked.emit("open_wkf"),null!=this.dt_agg&&this.dt_agg.open_wkf(!1,this.edit_comments_in_logs)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.back_lbl=t._trs.instant("Indietro"),t.save_lbl=t._trs.instant("Salva"),t.procedi_lbl=t._trs.instant("Procedi"),t.respingi_lbl=t._trs.instant("Respingi"),t.revisione_lbl=t._trs.instant("Revisione"),t.info_doc_lbl=t._trs.instant("Info Doc"),t.commenti_lbl=t._trs.instant("Commenti"),t.allegati_lbl=t._trs.instant("Allegati"),t.workflow_lbl=t._trs.instant("Workflow")}))},t}();di.decorators=[{type:n.Component,args:[{selector:"wkf_header_bar",template:'\n <div fxLayout="row" fxLayoutGap.lt-md="8px" fxLayout.lt-md="column">\n <div\n fxLayout="row"\n fxLayoutGap="16px" fxLayoutGap.lt-md="8px"\n *ngIf="\n !m_appService.getState().pageFullscreen ||\n edit_button ||\n respingi_button\n "\n >\n <div>\n <button\n mat-flat-button\n (click)="back()"\n *ngIf="!m_appService.getState().pageFullscreen"\n >\n {{back_lbl}}</button\n ></div><div>\n <button\n mat-flat-button\n (click)="evt_salv()"\n *ngIf="edit_button || force_save"\n color="primary"\n >\n {{save_lbl}}</button\n ></div><div>\n <button\n mat-flat-button\n (click)="procedi()"\n *ngIf="edit_button && procedi_button"\n color="accent"\n >\n {{procedi_lbl}}</button\n ></div><div>\n <button\n mat-flat-button\n (click)="respingi()"\n *ngIf="respingi_button"\n color="warn"\n >\n {{respingi_lbl}}\n </button>\n </div>\n \x3c!-- <button mat-flat-button (click)="doEnd(900)" color="warn" >test</button> \n--\x3e\n </div>\n \n <div\n fxLayout="row"\n fxLayout.xs="column"\n fxLayoutGap="16px"\n fxLayoutGap.xs="3px"\n >\n <div fxLayout="row" fxLayoutGap="16px">\n <div>\n <button\n mat-flat-button\n (click)="open_info()"\n *ngIf="!m_appService.getState().pageFullscreen && utility_button"\n >\n <mat-icon>info_outline</mat-icon> {{info_doc_lbl}}</button\n ></div><div>\n <button\n mat-flat-button *ngIf="utility_button"\n [color]="(dt_agg?.comm_c ? dt_agg?.comm_c : 0 > 0) ? \'accent\' : \'\'"\n [matBadge]="dt_agg?.comm_c ? dt_agg?.comm_c : 0"\n matBadgePosition="before"\n matBadgeColor="primary"\n (click)="open_commenti()"\n >\n <mat-icon>insert_comment</mat-icon>{{commenti_lbl}}</button\n ></div>\n </div>\n <div fxLayout="row" fxLayoutGap="16px">\n <div [hidden]="!download_button">\n <button\n mat-flat-button *ngIf="utility_button"\n [color]="(dt_agg?.all_c ? dt_agg?.all_c : 0 > 0) ? \'accent\' : \'\'"\n [matBadge]="dt_agg?.all_c ? dt_agg?.all_c : 0"\n matBadgePosition="before"\n matBadgeColor="primary"\n (click)="open_upload()"\n >\n <mat-icon>attach_file</mat-icon>{{allegati_lbl}}</button\n ></div><div>\n <button\n mat-flat-button\n (click)="open_wkf()"\n *ngIf="!m_appService.getState().pageFullscreen && utility_button"\n >\n <mat-icon>transfer_within_a_station</mat-icon>{{workflow_lbl}}\n </button>\n </div> </div>\n </div>\n <div\n *ngIf="custom_commands.length > 0"\n fxLayoutGap="10px"\n fxLayout="row"\n fxLayoutAlign="end center"\n >\n <div *ngFor="let app of custom_commands" fxLayout="row"\n fxLayoutGap="5px">\n <div><button [hidden]="app.hidden!=null && app.hidden"\n mat-flat-button\n [color]="app.color"\n (click)="exec_command(app.command)"\n >\n <mat-icon *ngIf="app.icon != null">{{ app.icon }}</mat-icon\n >{{ app.label }}\n </button> </div>\n </div>\n </div>\n </div>\n '}]}],di.ctorParameters=function(){return[{type:wt},{type:p.TranslateService}]},di.propDecorators={custom_commands:[{type:n.Input}],dt_agg:[{type:n.Input}],edit_button:[{type:n.Input}],respingi_button:[{type:n.Input}],procedi_button:[{type:n.Input}],utility_button:[{type:n.Input}],download_button:[{type:n.Input}],force_save:[{type:n.Input}],check_on_save:[{type:n.Input}],command:[{type:n.Output}],admin_role:[{type:n.Input}],sovra_path:[{type:n.Input}],edit_comments_in_logs:[{type:n.Input}],button_clicked:[{type:n.Output}]};var _i=function(){function t(t,e,i){this.fhutility=t,this._dialog=e,this.dragula=i,this.change=new n.EventEmitter,this.items=[],this.edit_obj=null,this.radio_values=""}return t.prototype.add_component=function(t){1==t&&this.items.push({type:"text_field",label:"Label",default_value:"",uiid:this.fhutility.newGuid(),selected:!1,required:!1}),2==t&&this.items.push({type:"numeric_field",label:"Label",default_value:0,decimali:2,uiid:this.fhutility.newGuid(),selected:!1,required:!1}),3==t&&this.items.push({type:"textarea",label:"Label",default_value:"",uiid:this.fhutility.newGuid(),selected:!1,required:!1}),4==t&&this.items.push({type:"checkbox",label:"Label",default_value:"",uiid:this.fhutility.newGuid(),selected:!1,required:!1}),5==t&&this.items.push({type:"radiobutton",label:"Label",default_value:"",opts:["Option1","Option2"],uiid:this.fhutility.newGuid(),selected:!1,required:!1}),6==t&&this.items.push({type:"select",label:"Label",default_value:"",opts:["","Value1","Value2"],uiid:this.fhutility.newGuid(),selected:!1,required:!1}),7==t&&this.items.push({type:"date_field",label:"Label",default_value:null,uiid:this.fhutility.newGuid(),selected:!1,required:!1}),this.change.emit(),this.edit_obj=null},t.prototype.setStyles=function(t){return null!=this.edit_obj&&this.edit_obj.uiid==t?{width:"90%",padding:"15px",margin:"15px",border:"3px solid #3db3cd","background-color":"#C2CACB"}:{width:"90%",padding:"15px",margin:"15px",border:"1px solid #3db3cd","background-color":"#ECF0F1"}},t.prototype.ok_panel=function(){this.change.emit(),this.edit_obj=null},t.prototype.edit_item=function(t){for(var e=0;e<this.items.length;e++)this.items[e].uiid==t&&(this.edit_obj=this.items[e],"radiobutton"!=this.edit_obj.type&&"select"!=this.edit_obj.type||null!=this.edit_obj.opts&&(this.radio_values=this.edit_obj.opts.join(",")))},t.prototype.del_item=function(t){var e=this,i=this._dialog.open(It,{disableClose:!0});setTimeout((function(){i.componentInstance.title="Confirm",i.componentInstance.msg="Remove Element?"})),i.afterClosed().subscribe((function(i){if(i)for(var n=0;n<e.items.length;n++)e.items[n].uiid==t&&(e.items.splice(n,1),e.change.emit(),e.edit_obj=null)}))},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){try{t.dragula.createGroup("bag-items",{revertOnSpill:!0})}catch(t){console.log(t)}t.dragula.drag.call((function(e){t.change.emit(),t.edit_obj=null})),t.dragula.drop.call((function(e){t.change.emit(),t.edit_obj=null}))}))},t}();_i.decorators=[{type:n.Component,args:[{selector:"FHFormBuilder",template:'\n <div fxLayout="row" style="width: 100%;height:100%">\n <mat-toolbar color="primary" style="max-width: 200px;height:100%;">\n <mat-toolbar-row (click)="add_component(1)">\n <mat-icon>text_fields</mat-icon> <span\n >Text Field</span\n >\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(2)">\n <mat-icon>filter_1</mat-icon> <span>Number</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(3)">\n <mat-icon>filter_none</mat-icon> <span\n >Text Area</span\n >\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(4)">\n <mat-icon>check_box</mat-icon> <span>Check Box</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(5)">\n <mat-icon>radio_button_checked</mat-icon> <span\n >Radio</span\n >\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(6)">\n <mat-icon>dehaze</mat-icon> <span>Select</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(7)">\n <mat-icon>today</mat-icon> <span>Date</span>\n </mat-toolbar-row>\n </mat-toolbar>\n <div\n fxLayout="column"\n fxFlex="100"\n style="width:100%;border:1px solid #004040;height:100%;overflow:auto;background-color: #a6aec4"\n >\n <div fxLayout="row" style="width:90%;width:100%;height:5000px;">\n <ul\n [dragula]="\'bag-items\'"\n [(dragulaModel)]="items"\n style="width:100%;"\n >\n <li\n fxLayout="row"\n fxLayoutGap="10px"\n *ngFor="let item of items"\n [ngStyle]="setStyles(item.uiid)"\n fxLayoutAlign="start center"\n >\n <div style="width:100%">\n <div style="width: 90%">\n <mat-form-field\n *ngIf="item.type == \'text_field\'"\n style="max-width: 350px"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ item.label }}</mat-label>\n <input\n matInput\n [required]="item.required"\n type="text"\n [(ngModel)]="item.default_value"\n />\n </mat-form-field>\n\n <mat-form-field\n *ngIf="item.type == \'numeric_field\'"\n style="max-width: 220px"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ item.label }}</mat-label>\n <input\n matInput\n [required]="item.required"\n type="number"\n [(ngModel)]="item.default_value"\n />\n </mat-form-field>\n\n <FHRichText\n *ngIf="item.type == \'textarea\'"\n [label]="item.label"\n [required]="item.required"\n [(ngModel)]="item.default_value"\n height="15\'"\n enabled="false"\n ></FHRichText>\n\n <mat-checkbox\n *ngIf="item.type == \'checkbox\'"\n [required]="item.required"\n [(ngModel)]="item.default_value"\n ><b>{{ item.label }}</b></mat-checkbox\n >\n\n <div fxLayout="row" fxLayoutGap="5px"\n class="custom-section"\n *ngIf="item.type == \'radiobutton\'"\n >\n <label class="custom-margin">{{ item.label }}:</label> \n <mat-radio-group class="fh-radio-group"\n [(ngModel)]="item.default_value"\n [required]="item.required"\n >\n <mat-radio-button class="fh-radio-button"\n *ngFor="let opt of item.opts"\n class="custom-margin"\n value="{{ opt }}"\n ><b>{{ opt }}</b></mat-radio-button\n >\n </mat-radio-group>\n </div>\n\n <mat-form-field\n *ngIf="item.type == \'select\'"\n style="max-width: 400px"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ item.label }}</mat-label>\n <mat-select\n [required]="item.required"\n [(ngModel)]="item.default_value"\n >\n <mat-option\n *ngFor="let opt of item.opts"\n value="{{ opt }}"\n >{{ opt }}</mat-option\n >\n </mat-select>\n </mat-form-field>\n <div style="width: 220px" *ngIf="item.type == \'date_field\'">\n <FHDatePicker\n [required]="item.required"\n [(ngModel)]="item.default_value"\n [label]="item.label"\n ></FHDatePicker\n > \n </div>\n </div>\n </div>\n <div fxLayout="column" style="width:70px" fxLayoutGap="10px">\n <button\n mat-flat-button\n (click)="edit_item(item.uiid)"\n color="primary"\n >\n <mat-icon>edit</mat-icon>\n </button>\n <button\n mat-flat-button\n (click)="del_item(item.uiid)"\n color="warn"\n >\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n </li>\n </ul>\n </div>\n <mat-form-field [hidden]="true">\n <input matInput #bottoml />\n </mat-form-field>\n </div>\n\n <div\n style="width:400px;height:100%;background-color: #3F51B5"\n fxLayoutAlign="start center"\n fxLayout="column"\n *ngIf="edit_obj != null"\n >\n <br /><br />\n <mat-card style="width: 96%">\n <mat-card-title>Properties</mat-card-title>\n <mat-card-content>\n <div fxLayout="column" fxLayoutGap="10px">\n <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>Label</mat-label>\n <input matInput type="text" [(ngModel)]="edit_obj.label" />\n </mat-form-field>\n <mat-checkbox [(ngModel)]="edit_obj.required"\n >Required</mat-checkbox\n >\n\n <mat-form-field\n *ngIf="edit_obj.type == \'numeric_field_tobe\'"\n appearance="outline"\n floatLabel="always"\n ><mat-label>Decimal Places</mat-label>\n <input matInput type="text" [(ngModel)]="edit_obj.decimali" />\n </mat-form-field>\n <mat-form-field\n *ngIf="edit_obj.type == \'text_field\'"\n appearance="outline"\n floatLabel="always"\n ><mat-label>Default Value</mat-label>\n <input\n matInput\n type="text"\n [(ngModel)]="edit_obj.default_value"\n />\n </mat-form-field>\n\n <mat-checkbox\n *ngIf="edit_obj.type == \'checkbox\'"\n [(ngModel)]="edit_obj.default_value"\n >Default Value</mat-checkbox\n >\n\n <mat-form-field\n *ngIf="\n edit_obj.type == \'radiobutton\' || edit_obj.type == \'select\'\n "\n appearance="outline"\n floatLabel="always"\n ><mat-label>Values</mat-label>\n <input\n matInput\n type="text"\n [(ngModel)]="radio_values"\n (ngModelChange)="edit_obj.opts = $event.split(\',\')"\n />\n </mat-form-field>\n <mat-form-field\n *ngIf="\n edit_obj.type == \'radiobutton\' || edit_obj.type == \'select\'\n "\n appearance="outline"\n floatLabel="always"\n ><mat-label>Default Value</mat-label>\n <input\n matInput\n type="text"\n [(ngModel)]="edit_obj.default_value"\n />\n </mat-form-field>\n\n <button mat-flat-button (click)="ok_panel()" color="primary">\n OK\n </button>\n </div></mat-card-content\n >\n </mat-card>\n </div>\n </div>\n ',styles:["\n .fh-radio-group {\n display: flex;\n flex-direction: column;\n margin: 15px 0;\n}\n\n.fh-radio-button {\n margin: 5px;\n}\n\n "]}]}],_i.ctorParameters=function(){return[{type:Ct},{type:e.MatDialog},{type:U.DragulaService}]},_i.propDecorators={change:[{type:n.Output}],bottoml:[{type:n.ViewChild,args:["bottoml"]}]};var hi=function(){function t(t,e,i){this.fhutility=t,this._dialog=e,this.toastr=i,this.items=null,this.enabled=!0}return t.prototype.ck_field_custom=function(){for(var t=0;t<this.items.length;t++)if(this.items[t].required&&(null==this.items[t].default_value&&(this.items[t].default_value=""),""==(""+this.items[t].default_value).trim()))return this.toastr.error("Compilare il campo: "+this.items[t].label),!1;return!0},t.prototype.add_component=function(t){this.items.push(t)},t.prototype.setStyles=function(t){return{width:"90%",padding:"15px",margin:"15px",border:"1px solid #3db3cd","background-color":"#ECF0F1"}},t.prototype.ngAfterViewInit=function(){},t}();hi.decorators=[{type:n.Component,args:[{selector:"FHFormExecuter",template:'\n <div\n fxLayout="column"\n fxFlex="100"\n style="width:100%;border:1px solid #004040;height:100%"\n *ngIf="items != null"\n >\n <div\n fxLayout="row"\n *ngFor="let item of items"\n [ngStyle]="setStyles(item.uiid)"\n fxLayoutAlign="start center"\n >\n <div style="width: 90%">\n <mat-form-field\n *ngIf="item.type == \'text_field\'"\n style="max-width: 350px"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ item.label }}</mat-label>\n <input\n matInput\n [required]="item.required"\n [disabled]="!enabled"\n type="text"\n [(ngModel)]="item.default_value"\n />\n </mat-form-field>\n\n <mat-form-field\n *ngIf="item.type == \'numeric_field\'"\n style="max-width: 220px"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ item.label }}</mat-label>\n <input\n matInput\n [required]="item.required"\n [disabled]="!enabled"\n type="number"\n [(ngModel)]="item.default_value"\n />\n </mat-form-field>\n\n <FHRichText\n *ngIf="item.type == \'textarea\'"\n [label]="item.label"\n [required]="item.required"\n [(ngModel)]="item.default_value"\n height="15\'"\n enabled="false"\n ></FHRichText>\n\n <mat-checkbox\n *ngIf="item.type == \'checkbox\'"\n [required]="item.required"\n [disabled]="!enabled"\n [(ngModel)]="item.default_value"\n ><b>{{ item.label }}</b></mat-checkbox\n >\n\n <div *ngIf="item.type == \'radiobutton\'" fxLayout="row" fxLayoutGap="5px">\n <label *ngIf="!item.required">{{ item.label }}: </label> \n <label *ngIf="item.required">{{ item.label }}: *</label> \n <mat-radio-group\n [(ngModel)]="item.default_value"\n [required]="item.required" class="fh-radio-group"\n >\n <mat-radio-button\n *ngFor="let opt of item.opts"\n [disabled]="!enabled"\n class="custom-margin" class="fh-radio-button"\n value="{{ opt }}"\n ><b>{{ opt }}</b\n > </mat-radio-button\n >\n </mat-radio-group>\n </div>\n\n <mat-form-field\n *ngIf="item.type == \'select\'"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ item.label }}</mat-label>\n <mat-select\n [required]="item.required"\n [(ngModel)]="item.default_value"\n >\n <mat-option\n *ngFor="let opt of item.opts"\n [disabled]="!enabled"\n value="{{ opt }}"\n >{{ opt }}</mat-option\n >\n </mat-select>\n </mat-form-field>\n <div style="width: 220px" *ngIf="item.type == \'date_field\'">\n <FHDatePicker\n [required]="item.required"\n [disabled]="!enabled"\n [(ngModel)]="item.default_value"\n [label]="item.label"\n ></FHDatePicker\n > \n </div>\n </div>\n </div>\n\n <mat-form-field [hidden]="true">\n <input matInput #bottoml />\n </mat-form-field>\n </div>\n ',styles:[" .fh-radio-group {\n display: flex;\n flex-direction: column;\n margin: 15px 0;\n }\n\n .fh-radio-button {\n margin: 5px;\n }"]}]}],hi.ctorParameters=function(){return[{type:Ct},{type:e.MatDialog},{type:i.ToastrService}]},hi.propDecorators={items:[{type:n.Input}],enabled:[{type:n.Input}],bottoml:[{type:n.ViewChild,args:["bottoml"]}]};var mi=function(){function t(t,e){this.dialogRef=t,this.data=e,this.title="",this.button_config=[],this.show_close=!0,null!=e&&(null!=e.button_config&&(this.button_config=e.button_config),null!=e.title&&(this.title=e.title),null!=e.show_close&&(this.show_close=e.show_close))}return t.prototype.ngAfterViewInit=function(){},t.prototype.open=function(t){this.dialogRef.close(t)},t.prototype.close=function(){this.dialogRef.close(null)},t}();mi.decorators=[{type:n.Component,args:[{selector:"app-win_ask_buttons",template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{ title }}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <mat-dialog-content style="font-size: 15px;">\n <div fxLayout="row" fxLayoutAlign="center center">\n <button\n mat-flat-button\n style="font-size: 18px;color:#FFFFFF;"\n *ngFor="let app of button_config"\n (click)="open(app)"\n [style.background-color]="app.color"\n >\n {{ app.label }}</button\n > \n </div>\n </mat-dialog-content>\n <br *ngIf="show_close" /><br *ngIf="show_close" />\n <div style="width:100%;text-align:center;" *ngIf="show_close">\n <button mat-flat-button color="accent" (click)="close()">{{\'CHIUDI\' | translate}}</button>\n </div>\n</div>\n '}]}],mi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},mi.propDecorators={title:[{type:n.Input}],button_config:[{type:n.Input}],show_close:[{type:n.Input}]};var fi=function(){function t(t){this.dialogRef=t,this.imageIndex=0,this.images=[]}return t.prototype.ngAfterViewInit=function(){},t}();fi.decorators=[{type:n.Component,args:[{template:'\n \x3c!-- <ngx-image-viewer [src]="images" [(index)]="imageIndex"></ngx-image-viewer>--\x3e\n\n <mat-dialog-actions>\n <button mat-flat-button (click)="dialogRef.close(\'\')">{{\'CHIUDI\' | translate}}</button>\n </mat-dialog-actions>\n ',styles:[""]}]}],fi.ctorParameters=function(){return[{type:e.MatDialogRef}]};var gi=function(){function t(){this._preview=!1,this._preview_c=!1,this.m_preview=!1,this.m_init=!1,this.config={btnClass:"default",zoomFactor:.1,containerBackgroundColor:"#ccc",wheelZoom:!0,allowFullscreen:!1,allowKeyboardNavigation:!0,btnIcons:{zoomIn:"fa fa-plus",zoomOut:"fa fa-minus",rotateClockwise:"fa fa-repeat",rotateCounterClockwise:"fa fa-undo",next:"fa fa-arrow-right",prev:"fa fa-arrow-left",fullscreen:"fa fa-arrows-alt"},btnShow:{zoomIn:!1,zoomOut:!1,rotateClockwise:!1,rotateCounterClockwise:!1,next:!1,prev:!1}},this.notfullScreenEvent=new n.EventEmitter,this.fullScreenEvent=new n.EventEmitter,this._u=null,this.already_open=!1,this.config_photo_big={btnClass:"default",zoomFactor:.1,containerBackgroundColor:"#ccc",wheelZoom:!0,allowFullscreen:!0,allowKeyboardNavigation:!0,btnIcons:{zoomIn:"fa fa-plus",zoomOut:"fa fa-minus",rotateClockwise:"fa fa-repeat",rotateCounterClockwise:"fa fa-undo",next:"fa fa-arrow-right",prev:"fa fa-arrow-left",fullscreen:"fa fa-arrows-alt"},btnShow:{zoomIn:!0,zoomOut:!0,rotateClockwise:!0,rotateCounterClockwise:!0,next:!0,prev:!0}}}return t.prototype.toggle_up=function(){this.m_preview=!1,this.photo_c.src=[],this.photo_c.src.push(this._u.image_original[0]),this.config=this.config_photo_big,this.already_open=!0},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.init()}))},t.prototype.openFullscreen=function(){this.elem=this.photo_c.imgx.nativeElement,this.elem.requestFullscreen?this.elem.requestFullscreen():this.elem.mozRequestFullScreen?this.elem.mozRequestFullScreen():this.elem.webkitRequestFullscreen?this.elem.webkitRequestFullscreen():this.elem.msRequestFullscreen?this.elem.msRequestFullscreen():console.log("no full!")},t.prototype.closeFullscreen=function(){try{this.elem="undefined"!=typeof window&&void 0!==window.document?window.document:{},console.log("closeFullscreen ",this.elem),this.elem.exitFullscreen?(console.log("exitFullscreen"),this.elem.exitFullscreen()):this.elem.mozCancelFullScreen?(console.log("mozCancelFullScreen"),this.elem.mozCancelFullScreen()):this.elem.webkitExitFullscreen?(console.log("webkitExitFullscreen"),this.elem.webkitExitFullscreen()):this.elem.webkitCancelFullScreen?(console.log("webkitExitFullscreen"),this.elem.webkitCancelFullScreen()):this.elem.msExitFullscreen?(console.log("msExitFullscreen"),this.elem.msExitFullscreen()):console.log("no exit!")}catch(t){this.openFullscreen()}},t.prototype.raise_fullScreenEvent=function(){this.fullScreenEvent.emit(),this.openFullscreen(),null!=this._u&&null!=this._u.image_thumbnail&&this._u.image_thumbnail.length>0&&this.m_preview&&this.toggle_up()},t.prototype.handleEvent=function(t){},Object.defineProperty(t.prototype,"preview",{get:function(){return this._preview},set:function(t){this._preview=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"u",{get:function(){return this._u},set:function(t){this._u=t,this.init()},enumerable:!1,configurable:!0}),t.prototype.init=function(){this._preview_c=!1,null!=this._u&&null!=this._u.image_thumbnail&&(null==this._u.image_original&&(this._u.image_original=this._u.image_thumbnail),this._u.image_thumbnail.length>0&&(this._u.image_thumbnail[0]!=this._u.image_original[0]&&(this._preview_c=!0),this.m_init=!0,this.m_preview=this._preview_c))},t}();gi.decorators=[{type:n.Component,args:[{selector:"fh-image-viewer",template:'\n <image-viewer\n [hidden]="!m_init"\n (init)="init()"\n [preview]="m_preview"\n (notfullScreenEvent)="closeFullscreen()"\n (fullScreenEvent)="raise_fullScreenEvent()"\n [config]="config_photo_big"\n #photo_c\n [src]="_u?.image_thumbnail"\n index="0"\n ></image-viewer>\n ',styles:[""]}]}],gi.propDecorators={notfullScreenEvent:[{type:n.Output}],fullScreenEvent:[{type:n.Output}],photo_c:[{type:n.ViewChild,args:["photo_c"]}],preview:[{type:n.Input}],u:[{type:n.Input}]};var vi=function(t,e){this.name=t,this.imageIndex=e},yi={btnClass:"default",zoomFactor:.1,containerBackgroundColor:"#ccc",wheelZoom:!1,allowFullscreen:!0,allowKeyboardNavigation:!0,btnShow:{zoomIn:!0,zoomOut:!0,rotateClockwise:!0,rotateCounterClockwise:!0,next:!0,prev:!0},btnIcons:{zoomIn:"fa fa-plus",zoomOut:"fa fa-minus",rotateClockwise:"fa fa-repeat",rotateCounterClockwise:"fa fa-undo",next:"fa fa-arrow-right",prev:"fa fa-arrow-left",fullscreen:"fa fa-arrows-alt"}},bi=function(){function t(t,e){this.moduleConfig=t,this.sanitizer=e,this.index=0,this.preview=!1,this.indexChange=new n.EventEmitter,this.configChange=new n.EventEmitter,this.customEvent=new n.EventEmitter,this.style={transform:"",msTransform:"",oTransform:"",webkitTransform:""},this.fullscreen=!1,this.loading=!0,this.scale=1,this.rotation=0,this.translateX=0,this.translateY=0,this.hovered=!1,this.notfullScreenEvent=new n.EventEmitter,this.fullScreenEvent=new n.EventEmitter}return t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){var e=t.mergeConfig(yi,t.moduleConfig);t.config=t.mergeConfig(e,t.config),t.triggerConfigBinding()}))},t.prototype.nextImage=function(t){console.log("this.src.length ",this.src.length),this.index<this.src.length-1&&(this.loading=!0,this.index++,this.triggerIndexBinding(),this.reset())},t.prototype.prevImage=function(t){this.index>0&&(this.loading=!0,this.index--,this.triggerIndexBinding(),this.reset())},t.prototype.zoomIn=function(){this.scale*=1+this.config.zoomFactor,this.updateStyle()},t.prototype.zoomOut=function(){this.scale>this.config.zoomFactor&&(this.scale/=1+this.config.zoomFactor),this.updateStyle()},t.prototype.scrollZoom=function(t){if(this.config.wheelZoom)return t.deltaY>0?this.zoomOut():this.zoomIn(),!1},t.prototype.rotateClockwise=function(){this.rotation+=90,this.updateStyle()},t.prototype.rotateCounterClockwise=function(){this.rotation-=90,this.updateStyle()},t.prototype.onLoad=function(){this.loading=!1},t.prototype.onLoadStart=function(){this.loading=!0},t.prototype.onDragOver=function(t){this.translateX+=t.clientX-this.prevX,this.translateY+=t.clientY-this.prevY,this.prevX=t.clientX,this.prevY=t.clientY,this.updateStyle()},t.prototype.onDragStart=function(t){t.dataTransfer&&t.dataTransfer.setDragImage&&t.dataTransfer.setDragImage(t.target.nextElementSibling,0,0),this.prevX=t.clientX,this.prevY=t.clientY},t.prototype.toggleFullscreen=function(){this.fullscreen=!this.fullscreen,this.fullscreen?this.fullScreenEvent.emit():this.notfullScreenEvent.emit(),this.fullscreen||this.reset()},t.prototype.triggerIndexBinding=function(){this.indexChange.emit(this.index)},t.prototype.triggerConfigBinding=function(){this.configChange.next(this.config)},t.prototype.fireCustomEvent=function(t,e){this.customEvent.emit(new vi(t,e))},t.prototype.reset=function(){this.scale=1,this.rotation=0,this.translateX=0,this.translateY=0,this.updateStyle()},t.prototype.canNavigate=function(t){return null==t||this.config.allowKeyboardNavigation&&this.hovered},t.prototype.updateStyle=function(){this.style.transform="translate("+this.translateX+"px, "+this.translateY+"px) rotate("+this.rotation+"deg) scale("+this.scale+")",this.style.msTransform=this.style.transform,this.style.webkitTransform=this.style.transform,this.style.oTransform=this.style.transform},t.prototype.mergeConfig=function(t,e){var i=Object.assign({},t);return e&&(i=Object.assign(Object.assign({},t),e),e.btnIcons&&(i.btnIcons=Object.assign(Object.assign({},t.btnIcons),e.btnIcons))),i},t}();bi.decorators=[{type:n.Component,args:[{selector:"image-viewer",template:'<div\n #imgx\n class="img-container"\n [style.backgroundColor]="config.containerBackgroundColor"\n (wheel)="scrollZoom($event)"\n (dragover)="onDragOver($event)"\n *ngIf="src != null"\n>\n <img\n [src]="src[index]"\n [style.transform]="style.transform | safe: \'style\'"\n [style.msTransform]="style.transform | safe: \'style\'"\n style="min-height: 280px;"\n [style.webkitTransform]="style.transform | safe: \'style\'"\n [style.oTransform]="style.transform | safe: \'style\'"\n alt="Image not found..."\n (dragstart)="onDragStart($event)"\n (load)="onLoad()"\n (loadstart)="onLoadStart()"\n />\n \x3c!-- Div below will be used to hide the \'ghost\' image when dragging --\x3e\n <div></div>\n <div class="spinner-container" *ngIf="loading">\n <div class="spinner"></div>\n </div>\n <button\n type="button"\n [class]="config.btnClass"\n *ngIf="config.btnShow.rotateCounterClockwise && !preview"\n (click)="rotateCounterClockwise()"\n >\n <span [class]="config.btnIcons.rotateCounterClockwise"></span>\n </button>\n <button\n type="button"\n [class]="config.btnClass"\n *ngIf="config.btnShow.rotateClockwise && !preview"\n (click)="rotateClockwise()"\n >\n <span [class]="config.btnIcons.rotateClockwise"></span>\n </button>\n\n <button\n type="button"\n [class]="config.btnClass"\n *ngIf="config.btnShow.zoomOut && !preview"\n (click)="zoomOut()"\n >\n <span [class]="config.btnIcons.zoomOut"></span>\n </button>\n <button\n type="button"\n [class]="config.btnClass"\n *ngIf="config.btnShow.zoomIn && !preview"\n (click)="zoomIn()"\n >\n <span [class]="config.btnIcons.zoomIn"></span>\n </button>\n\n <button\n type="button"\n id="ngx-fs-btn"\n [class]="config.btnClass"\n (click)="toggleFullscreen()"\n *ngIf="config.allowFullscreen"\n >\n <span [class]="config.btnIcons.fullscreen"></span>\n </button>\n\n <div class="nav-button-container" *ngIf="src?.length > 1">\n <button\n type="button"\n [class]="config.btnClass"\n (click)="prevImage($event)"\n [disabled]="index === 0"\n >\n <span [class]="config.btnIcons.prev"></span>\n </button>\n <button\n type="button"\n [class]="config.btnClass"\n (click)="nextImage($event)"\n [disabled]="index === src?.length - 1"\n >\n <span [class]="config.btnIcons.next"></span>\n </button>\n </div>\n</div>\n',styles:[".img-container{height:100%;overflow:hidden;position:relative;width:100%}.img-container img{display:block;margin:0 auto;max-height:100%;max-width:100%;z-index:2}.img-container button{position:absolute;right:15px;z-index:99}.img-container button:not(:disabled){cursor:pointer}.img-container>button:first-of-type:not(#ngx-fs-btn){bottom:15px}.img-container>button:nth-of-type(2):not(#ngx-fs-btn){bottom:65px}.img-container>button:nth-of-type(3):not(#ngx-fs-btn){bottom:115px}.img-container>button:nth-of-type(4):not(#ngx-fs-btn){bottom:165px}.img-container>button:nth-of-type(5):not(#ngx-fs-btn){bottom:215px}.img-container>button:nth-of-type(6):not(#ngx-fs-btn){bottom:265px}.img-container>button:nth-of-type(7):not(#ngx-fs-btn){bottom:315px}#ngx-fs-btn{top:15px}button.default{background-color:#fff;border:1px solid #555;border-radius:50%;height:40px;opacity:.7;transition:opacity .2s;width:40px}button.default:hover{opacity:1}button.default:disabled{opacity:.25}.nav-button-container>button{margin:0 10px;position:relative;right:0}.nav-button-container{bottom:10px;left:0;position:absolute;right:0;text-align:center;z-index:98}.spinner-container{background-color:rgba(0,0,0,.4);border-radius:25%;bottom:0;height:60px;left:0;margin:auto;padding:10px;position:absolute;right:0;top:0;width:60px}.spinner{animation:rotation 2s linear infinite;border:7px solid;border-color:#ccc #ccc #222;border-radius:50%;box-sizing:border-box;height:100%;width:100%}@keyframes rotation{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(359deg)}}"]}]}],bi.ctorParameters=function(){return[{type:void 0,decorators:[{type:n.Optional},{type:n.Inject,args:["config"]}]},{type:a.DomSanitizer}]},bi.propDecorators={src:[{type:n.Input}],index:[{type:n.Input}],preview:[{type:n.Input}],config:[{type:n.Input}],indexChange:[{type:n.Output}],configChange:[{type:n.Output}],customEvent:[{type:n.Output}],imgx:[{type:n.ViewChild,args:["imgx"]}],notfullScreenEvent:[{type:n.Output}],fullScreenEvent:[{type:n.Output}],nextImage:[{type:n.HostListener,args:["window:keyup.ArrowRight",["$event"]]}],prevImage:[{type:n.HostListener,args:["window:keyup.ArrowLeft",["$event"]]}]};var wi=function(){function t(t){this.sanitizer=t}return t.prototype.transform=function(t,e){switch(e){case"html":return this.sanitizer.bypassSecurityTrustHtml(t);case"style":return this.sanitizer.bypassSecurityTrustStyle(t);case"script":return this.sanitizer.bypassSecurityTrustScript(t);case"url":return this.sanitizer.bypassSecurityTrustUrl(t);case"resourceUrl":return this.sanitizer.bypassSecurityTrustResourceUrl(t);default:throw new Error("Invalid safe type specified: "+e)}},t}();wi.decorators=[{type:n.Pipe,args:[{name:"safe"}]}],wi.ctorParameters=function(){return[{type:a.DomSanitizer}]};var Si={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Ii})),multi:!0},Ii=function(){function t(t){this.m_dialog=t,this.sql="",this.types=new Array,this.values=new Array,this.hidden=!1,this.only_in_list=!0,this.single_sel=!1,this.label="",this.enabled=!0,this.required=!1,this.db_type="1",this.separator=",",this.value="",this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.setv=function(){var t=this;setTimeout((function(){t.writeValue(t.value)}),70)},t.prototype.resetValue=function(){this.value="",this.writeValue(this.value)},t.prototype.writeValue=function(t){this.value=t,this.onChange(this.value)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.focus=function(){},t.prototype.open_pick_list=function(){var t=this,e=this.m_dialog.open(He,{disableClose:!0,data:{single_sel:this.single_sel,sel_values:this.value,separator:this.separator,label:this.label,sql:this.sql,types:this.types,values:this.values}});setTimeout((function(){})),e.afterClosed().subscribe((function(e){if(null==e||""==e);else{t.value="";for(var i=0;i<e.length;i++)""!=t.value&&(t.value+=t.separator),t.value+=e[i].descrizione_valore,t.writeValue(t.value)}}))},t.prototype.ngAfterViewInit=function(){},t}();Ii.decorators=[{type:n.Component,args:[{providers:[Si],selector:"FHFieldPickList",template:'\n <div\n fxLayout="row" [hidden]="!enabled || hidden"\n fxFlex="100"\n fxLayoutAlign="start center"\n fxLayoutGap="10px"\n >\n <div fxFlex fxLayout="row">\n <mat-form-field appearance="outline" floatLabel="always" [class.fh_field]="enabled"\n ><mat-label>{{ label }}</mat-label>\n <input\n type="text"\n #el1\n matInput\n [readonly]="only_in_list"\n [(ngModel)]="value"\n [required]="required" (ngModelChange)="setv()"\n />\n </mat-form-field>\n </div>\n\n <div fxLayout="row" fxLayoutGap="3px">\n <button\n mat-flat-button\n color="primary"\n (click)="open_pick_list()"\n\n >\n SELEZIONA\n </button>\n <button\n mat-flat-button\n color="warn"\n (click)="resetValue()"\n\n >\n RESET\n </button>\n </div>\n </div>\n <mat-form-field appearance="outline" [hidden]="enabled || hidden" floatLabel="always" [class.fh_field_dis]="!enabled"\n ><mat-label>{{ label }}</mat-label>\n <input\n type="text" [matTooltip]="value"\n\n matInput [disabled]="true"\n\n [(ngModel)]="value"\n />\n </mat-form-field>\n ',styles:[""]}]}],Ii.ctorParameters=function(){return[{type:e.MatDialog}]},Ii.propDecorators={sql:[{type:n.Input}],types:[{type:n.Input}],values:[{type:n.Input}],hidden:[{type:n.Input}],only_in_list:[{type:n.Input}],single_sel:[{type:n.Input}],label:[{type:n.Input}],enabled:[{type:n.Input}],required:[{type:n.Input}],db_type:[{type:n.Input}],separator:[{type:n.Input}],value:[{type:n.Input}]};var xi=function(){function t(t,e,i,n){this.dialogRef=t,this.toastr=e,this.m_appService=i,this._dataService=n,this.label="",this.sql="",this.title="Modifica Valori Tabella",this.single_sel=!1,this.sel_values="",this.valoris=[],this.id_tipo=-1,this.nValori={}}return t.prototype.delete_uassoc=function(t){var e=this,i=new vt;i.sql="DELETE_VALORI",i.types=["int"],i.values=[t.id_valore],this._dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.ref_user_list()}))},t.prototype.update_tassoc_ins=function(t){var e=this,i=new vt;i.sql="INSERT_UPDATE_VALORI",i.types=["int","int","string","int","string","int","string","string"],i.values=[t.id_valore,t.valore,t.descrizione,this.id_tipo,"","0","",""],this._dataService.doQuery(i).subscribe((function(i){null!=i&&"OK"==i.result_msg&&(e.toastr.info("INFO","VALORE INSERITO"),t.descrizione="",e.ref_user_list())}))},t.prototype.update_tassoc=function(t){var e=this,i=new vt;i.sql="INSERT_UPDATE_VALORI",i.types=["int","int","string","int","string","int","string","string"],i.values=[t.id_valore,t.valore,t.descrizione,this.id_tipo,t.v1,t.v2,t.v3,t.lingua],this._dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.toastr.info("INFO","VALORE AGGIORNATO")}))},t.prototype.ref_user_list=function(){var t=this,e=new vt;e.sql="SELECT_VALORI_BY_ID",e.types=["int"],e.values=[this.id_tipo],this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.valoris=e.result_data,t.nValori.valore=t.valoris.length+1)}))},t.prototype.ok=function(){},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.nValori=new Object,t.nValori.descrizione="",t.nValori.v1=null,t.nValori.v2=null,t.nValori.id_valore=-1,t.nValori.v3=null,t.nValori.lingua=null,t.ref_user_list()}))},t}();xi.decorators=[{type:n.Component,args:[{selector:"win_manage_values",template:'\n<div fxLayout="column">\n <div fxFlex="100" fxLayout="row" class="dialog_header"> \n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{ title }}</div> \n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="dialogRef.close(null)" /> \n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n\n\t<mat-dialog-content>\n\t<mat-card>\n\t\t\t\t\t\t\t\t<mat-card-content>\n\t\t\t\t\t\t\t\t<div fxLayout="column" fxLayoutGap="10px">\n\n\n <div fxLayout="row" style="width: 90%" fxLayoutAlign="start center" fxLayoutGap="10px">\n <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>Descrizione</mat-label>\n <input\n matInput\n [(ngModel)]="nValori.descrizione"\n style="min-width:500px"\n />\n </mat-form-field> \n <div>\n <button\n mat-flat-button\n color="primary"\n (click)="update_tassoc_ins(nValori)"\n >\n Inserisci\n </button>\n </div>\n </div>\n <div fxLayout="column">\n <div fxLayout="column" style="overflow:auto;height:500px">\n <table style="width: 90%" class="fh_table">\n <thead>\n <tr>\n <th style="width:70%;">Descrizione</th>\n <th style="width:5%;">V1</th>\n <th style="width:5%;">V2</th>\n <th style="width:5%;">V3</th>\n <th style="width:10%;">Lingua</th>\n <th style="width:5%;"></th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="let u of valoris; let odd = odd; let even = even"\n [ngClass]="{ odd: odd, even: even }"\n >\n <td style="width:70%;">\n <mat-form-field appearance="outline" floatLabel="always">\n <input\n matInput\n [(ngModel)]="u.descrizione"\n (focusout)="update_tassoc(u)"\n />\n </mat-form-field>\n </td>\n <td style="width:5%;">\n <mat-form-field appearance="outline" floatLabel="always">\n <input\n matInput\n type="text"\n [(ngModel)]="u.v1"\n (focusout)="update_tassoc(u)"\n />\n </mat-form-field>\n </td>\n <td style="width:5%;">\n <mat-form-field appearance="outline" floatLabel="always">\n <input\n matInput\n type="text"\n [(ngModel)]="u.v2"\n (focusout)="update_tassoc(u)"\n />\n </mat-form-field>\n </td>\n <td style="width:5%;">\n <mat-form-field appearance="outline" floatLabel="always">\n <input\n matInput\n type="text"\n [(ngModel)]="u.v3"\n (focusout)="update_tassoc(u)"\n />\n </mat-form-field>\n </td>\n <td style="width:10%;">\n <mat-form-field appearance="outline" floatLabel="always">\n <input\n matInput\n type="text"\n [(ngModel)]="u.lingua"\n (focusout)="update_tassoc(u)"\n />\n </mat-form-field>\n </td>\n <td style="width:5%;">\n <a mat-icon-button (click)="delete_uassoc(u)">\n <mat-icon>delete</mat-icon>\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n\n </div>\n </div>\n\n</mat-card-content>\n </mat-card>\n</mat-dialog-content><br>\n\n</div>\n\n ',styles:[" .mat-dialog-content { max-height: unset !important; }\n\n"]}]}],xi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:wt},{type:Dt}]};var Oi=function(){function t(t,e,i){this._dataService=t,this.app=e,this._dialog=i,this.application="",this.b_init=!1}return t.prototype.edit_values=function(){var t=this;if("-1"!=this.cmb_sel.getValue()){var e=this._dialog.open(xi,{width:"90%",height:"650px"});setTimeout((function(){e.componentInstance.id_tipo=Number(t.cmb_sel.getValue())})),e.afterClosed().subscribe((function(t){}))}},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){""!=t.application&&(t.cmb_sel.sql="SELECT_TABLE_MANAGEMENT",t.cmb_sel.types=["string"],t.cmb_sel.values=[t.application],t.cmb_sel.fillCombo(),t.b_init=!0)}))},t}();Oi.decorators=[{type:n.Component,args:[{selector:"FHTableManager",template:'\n <div\n [hidden]="!b_init"\n fxLayout="row"\n fxLayoutAlign="start center"\n fxLayoutGap="6px"\n style="font-size:12px"\n >\n <FHComboBox\n #cmb_sel\n sql="SELECT_TABLE_MANAGEMENT"\n label="Gestisci Tabella:"\n init_fill="false" (selchange)="edit_values()"\n ></FHComboBox>\n\n </div>\n ',styles:[""]}]}],Oi.ctorParameters=function(){return[{type:Dt},{type:wt},{type:e.MatDialog}]},Oi.propDecorators={application:[{type:n.Input}],cmb_sel:[{type:n.ViewChild,args:["cmb_sel"]}]};var Ei=function(){function t(t,e,i,n){this.dialogRef=t,this.toastr=e,this._dataService=n,this.label="",this.sql="",this.single_sel=!1,this.sel_values="",this.role_id=-1,this.users=[],this.m_appService=i}return t.prototype.ok=function(){},t.prototype.add_assoc=function(){var t=this;if(console.log(this.autoc.getValue()),""!=this.autoc.getValue()){var e=new vt;e.sql="INSERT_UPDATE_ASSOC_ROLE_USER",e.types=["string","int"],e.values=[this.autoc.getValue(),this.role_id],this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.ref_user_list()}))}},t.prototype.delete_uassoc=function(t){var e=this,i=new vt;i.sql="DELETE_ASSOC_ROLE_USER",i.types=["string","int"],i.values=[t.username,this.role_id];this._dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(!0,e.ref_user_list())}),(function(t){}))},t.prototype.ref_user_list=function(){var t=this,e=new vt;e.sql="SELECT_USERS_BY_IDROLE",e.types=["int"],e.values=[this.role_id],this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.users=e.result_data,t.autoc.types=["int"],t.autoc.values=[t.role_id],t.autoc.fillCombo(),t.autoc.resetValue())}))},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.ref_user_list()}))},t}();Ei.decorators=[{type:n.Component,args:[{selector:"win_manage_roles",template:'\n <div fxLayout="column" style="height: 520px">\n <div fxLayout="row" style="width: 90%">\n <div style="width:100%" fxLayout="row" fxAlign="start center">\n <b>Seleziona per associare utente:</b\n > \n <div style="width:100%">\n <FHAutoComplete\n sql="SELECT_NOT_USERS_BY_IDROLE"\n #autoc\n [init_fill]="false"\n (selchange)="add_assoc()"\n label="Add user"\n ></FHAutoComplete>\n </div>\n </div>\n </div>\n <div fxLayout="column" style="overflow-y: scroll;height:100%;">\n <div fxLayout="column" style="overflow-y: scroll;height:420px;">\n <table style="min-width:60%">\n <tr>\n <td>\n <div\n style="overflow-y: auto;"\n fxLayout="row"\n fxLayoutAlign="center start"\n [style.height]="m_appService.getState().body_height3"\n >\n <br />\n <section class="bs">\n <table style="min-width: 600px" class="fh_table">\n <thead>\n <tr>\n <th>Utente</th>\n\n <th style="width: 60px" class="actions"></th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="\n let u of users;\n let odd = odd;\n let even = even\n "\n [ngClass]="{ odd: odd, even: even }"\n >\n <td>{{ u.cognome }} {{ u.nome }}</td>\n\n <td style="text-align: center;">\n <a mat-icon-button (click)="delete_uassoc(u)">\n <mat-icon>delete</mat-icon>\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n </section>\n </div>\n </td>\n </tr>\n </table>\n </div>\n </div>\n <div fxLayout="row" fxLayoutAlign="center center" style="width: 100%">\n <button mat-flat-button color="warn" (click)="dialogRef.close(\'\')">\n CHIUDI\n </button>\n </div>\n </div>\n '}]}],Ei.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:wt},{type:Dt}]},Ei.propDecorators={autoc:[{type:n.ViewChild,args:["autoc"]}]};var Ai=function(){function t(t,e,i){this._dataService=t,this.app=e,this._dialog=i,this.application="",this.b_init=!1}return t.prototype.edit_values=function(){var t=this;if("-1"!=this.cmb_sel.getValue()){var e=this._dialog.open(Ei,{width:"90%",height:"550px"});setTimeout((function(){e.componentInstance.role_id=Number(t.cmb_sel.getValue())})),e.afterClosed().subscribe((function(t){}))}},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){""!=t.application&&(t.cmb_sel.sql="SELECT_APP_USER_MANAGEMENT",t.cmb_sel.types=["string"],t.cmb_sel.values=[t.application],t.cmb_sel.fillCombo(),t.b_init=!0)}))},t}();Ai.decorators=[{type:n.Component,args:[{selector:"FHRoleManager",template:'\n <div\n [hidden]="!b_init"\n fxLayout="row"\n fxLayoutAlign="start center"\n fxLayoutGap="6px"\n >\n <FHComboBox\n #cmb_sel\n sql="SELECT_APP_USER_MANAGEMENT"\n label="Gestisci Ruoli:"\n init_fill="false"\n ></FHComboBox\n > \n <button mat-flat-button (click)="edit_values()" color="primary">\n Modifica\n </button>\n </div>\n ',styles:[""]}]}],Ai.ctorParameters=function(){return[{type:Dt},{type:wt},{type:e.MatDialog}]},Ai.propDecorators={application:[{type:n.Input}],cmb_sel:[{type:n.ViewChild,args:["cmb_sel"]}]};var Ci=function(){function t(t,e){this._dataService=t,this._dataService_odbc=e,this.init_fill=!0,this.sql="",this.types=new Array,this.values=new Array,this.hidden=!1,this.label="",this.enabled=!0,this.required=!1,this.sel_label="",this.fillend=new n.EventEmitter,this.selchange=new n.EventEmitter,this.initend=new n.EventEmitter,this.myData=[],this.valDef="-1",this.selval="-1",this.errorMsg="",this.db_type="1",this.dis_value="",this.descri_val=""}return t.prototype.update_dis=function(){this.dis_value="";try{if(null!=this.descri_val&&""!=this.descri_val)return void(this.dis_value=this.descri_val);null==this.valDef?this.dis_value="":this.dis_value=this.valDef.split("-1").join("")}catch(t){console.log("errore split -> this.valDef ",this.valDef)}},t.prototype.resetValue=function(){this.selval="-1",this.valDef="-1",this.update_dis()},t.prototype.focus=function(){this.smtr.nativeElement.focus()},t.prototype.reset=function(){this.selval="-1",this.valDef="-1",this.myData=new Array,this.update_dis()},t.prototype.fillCombo=function(){var t=this;if(null==this.sql&&(this.sql=""),-1==this.sql.indexOf("|")||-1==this.sql.indexOf("$")){var e=new vt;e.sql=this.sql,e.types=this.types,e.values=this.values;"1"==this.db_type&&this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.resetD(e.result_data)}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+t.sql+"]"})),"2"==this.db_type&&this._dataService_odbc.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=0;i<e.result_data.length;i++)null!=e.result_data[i].VALORE&&(e.result_data[i].valore=e.result_data[i].VALORE),null!=e.result_data[i].DESCRIZIONE_VALORE&&(e.result_data[i].descrizione_valore=e.result_data[i].DESCRIZIONE_VALORE);t.resetD(e.result_data),!0}}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+t.sql+"]"}))}else this.set_options(this.sql)},t.prototype.add_option=function(t){this.myData.push(t)},t.prototype.resetD=function(t){this.myData=t,this.selval="-1",this.setByValue(this.valDef),"-1"==this.getValue()&&"-1"!=this.valDef&&this.setByDescri(this.valDef),this.fillend.emit()},t.prototype.setByDescri=function(t){if(this.valDef=t,this.selval="-1",""!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){for(var e=0;e<this.myData.length;e++)if(this.myData[e].descrizione_valore==t)return this.selval=""+this.myData[e].valore,null!=this.myData[e].descrizione_valore&&(this.descri_val=this.myData[e].descrizione_valore),void this.update_dis();this.update_dis()}},t.prototype.setByIndex=function(t){this.valDef="",this.selval="-1",null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]&&this.myData.length>t&&this.setByDescri(this.myData[t].descrizione_valore)},t.prototype.getObj=function(){if(null==this.selval)return null;if("-1"==this.selval)return null;for(var t=0;t<this.myData.length;t++)if(this.myData[t].valore==this.selval)return this.myData[t]},t.prototype.setByValue=function(t){if(this.valDef=t,this.selval="-1",""+t!=""&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){for(var e=0;e<this.myData.length;e++)if(this.myData[e].valore==t)return this.selval=""+this.myData[e].valore,null!=this.myData[e].descrizione_valore&&(this.descri_val=this.myData[e].descrizione_valore),void this.update_dis();this.update_dis()}},t.prototype.getDescri=function(){if(!this.enabled){if(null==this.selval)return this.valDef;if("-1"==this.selval)return this.valDef}if(null==this.selval)return"-1";if("-1"==this.selval)return"-1";for(var t=0;t<this.myData.length;t++)if(this.myData[t].valore==this.selval)return this.myData[t].descrizione_valore},t.prototype.getValue=function(){if(!this.enabled){if(null==this.selval)return this.valDef;if("-1"==this.selval)return this.valDef}return null==this.selval||""==this.selval?"-1":this.selval},t.prototype.getData=function(t){for(var e in this.myData)if(this.myData[e].valore==this.selval)return this.myData[e][t]},t.prototype.set_options=function(t){this.myData=new Array;for(var e=t.split("$"),i=0;i<e.length;i++){var n=new Object,o=e[i].split("|");n.valore=o[1],n.descrizione_valore=o[0],this.myData.push(n)}this.setByValue(this.valDef),"-1"==this.getValue()&&this.setByDescri(this.valDef)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(1==t.init_fill){if(""==t.sql)return;t.fillCombo()}else t.errorMsg="";t.initend.emit()}))},t.prototype.sc=function(){this.selchange.emit({event:this.getObj(),valore:this.getValue(),descrizione_valore:this.getDescri()})},t}();Ci.decorators=[{type:n.Component,args:[{selector:"FHFilterComboBox",template:'\n <mat-form-field [hidden]="!enabled || hidden"\n appearance="outline"\n floatLabel="always" style="font-weight:14px">\n <mat-select\n #cmb\n [(ngModel)]="selval"\n (selectionChange)="sc()"\n [required]="required"\n [placeholder]="label"\n >\n <mat-option value="-1">{{ sel_label }}</mat-option>\n <mat-option value="{{ app.valore }}" *ngFor="let app of myData">{{\n app.descrizione_valore\n }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field\n [hidden]="enabled || hidden"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n <input\n type="text"\n #el1\n matInput\n [disabled]="true"\n [(ngModel)]="dis_value"\n />\n </mat-form-field>\n ',styles:[""]}]}],Ci.ctorParameters=function(){return[{type:Dt},{type:Qt}]},Ci.propDecorators={init_fill:[{type:n.Input}],sql:[{type:n.Input}],types:[{type:n.Input}],values:[{type:n.Input}],hidden:[{type:n.Input}],label:[{type:n.Input}],enabled:[{type:n.Input}],required:[{type:n.Input}],sel_label:[{type:n.Input}],smtr:[{type:n.ViewChild,args:["cmb"]}],fillend:[{type:n.Output}],selchange:[{type:n.Output}],initend:[{type:n.Output}],valDef:[{type:n.Input}],db_type:[{type:n.Input}]};var ki=function(){function t(t,e,i,n,o,s){this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.toastr=n,this._dataService=o,this.m_wkf=s,this.not_int=!0,this.nota="",this.title="COMMENTI",this.b_edit=!1,this.b_ins=!0,this.edit_id=0,this.lettori="",this.subject="",this.link="",this.codice_doc=""}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(this.not_int){if(""==this.nota)return void this.toastr.error("INSERIRE UN COMMENTO");this.select_destinatari()}else this.ok_op()},t.prototype.select_destinatari=function(){var t=this,e=new vt;e.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",e.types=["string"],e.values=["'"+this.lettori.split(",").join("','")+"'"];this._dataService.doQuery(e).subscribe((function(e){var i=t.m_dialogRef.open(ti,{disableClose:!0});setTimeout((function(){i.componentInstance.init_arr(e.result_data)})),i.afterClosed().subscribe((function(e){if(null!=e){for(var i="",n=0;n<e.arrsel.length;n++)""!=i&&(i+=","),i+=e.arrsel[n].username;t.ok_op(i)}}))}),(function(t){}))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,a,r,l,p,u){if(void 0===p&&(p=!0),void 0===u&&(u=""),null!=e&&""!=e){var c=new vt;c.sql="send_wkf_mail",c.values=[t,e,i,n.split("\n").join("<br>"),o,s,a,r,l,u],this.m_wkf.doQuery(c).subscribe((function(t){}))}},t.prototype.ok_op=function(t){var e=this;void 0===t&&(t="");var i=new vt;i.sql="INSERT_WKF_COMMENTO",i.types=["string","string","string","string","string"],i.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc,this.nota,this.m_appService.getState().wkf_doc_info.curr_user,""],this._dataService.doQuery(i).subscribe((function(i){null!=i&&"OK"==i.result_msg&&(e.toastr.info("INFO","COMMENTO INSERITO",{timeOut:1e3,progressBar:!0}),e.b_edit=!1,""!=t&&e.sendEMail_ex(e.m_appService.getState().wkf_doc_info.curr_user,t,e.subject.split("<OP>").join("E' stato inserito un commento"),"<br><br>Commento inserito: <br>"+e.nota.split("\n").join("<br>"),e.m_appService.getState().wkf_doc_info.uiid_app,e.m_appService.getState().wkf_doc_info.uiid_doc,e.link,e.codice_doc,""))}))},t.prototype.annulla=function(){this.nota="",this.b_edit=!1,this.title="COMMENTI"},t.prototype.ngAfterViewInit=function(){},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title="INSERISCI COMMENTO"},t}();ki.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <div mat-dialog-content style="min-width:800px;font-size: 15px;">\n <FHTextArea [label]="\'Commento\' | translate" [(ngModel)]="nota" rows="12"></FHTextArea>\n <div>\n <button mat-flat-button color="primary" (click)="ok()">OK</button\n > \n <button mat-flat-button color="warn" (click)="annulla()">{{\'ANNULLA\' | translate}}</button\n > \n <mat-checkbox [(ngModel)]="not_int" [hidden]="lettori === \'\'">\n {{\'Notifica Interessati\' | translate}}\n </mat-checkbox>\n </div>\n </div>\n ',styles:[""]}]}],ki.ctorParameters=function(){return[{type:e.MatDialogRef},{type:e.MatDialog},{type:wt},{type:i.ToastrService},{type:Dt},{type:ei}]};var Ti=function(){function t(t,e,i){this.dialogRef=t,this.appService=e,this._dataService=i,this.user="",this.user_name="",this.user_surname="",this.user_email="",this.user_roles="",this.user_lang="",this.isadmin="",this.foto_ut="",this.dev_mode=!1,this.b_filef=!1,this.user=this.appService.user,this.user_name=this.appService.user_name,this.user_surname=this.appService.user_surname,this.user_email=this.appService.user_email,null!=this.appService.user_roles&&(this.user_roles=this.appService.user_roles.split(",").join(" ")),this.user_lang=this.appService.user_lang,this.isadmin=this.appService.user_isadmin}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ngAfterViewInit=function(){},t.prototype.upd_dev=function(t){t?(this.appService.dev_mode="1",localStorage.setItem(this.appService.COMPANY_KEY+"dev_mode",this.appService.dev_mode)):(this.appService.dev_mode="0",localStorage.removeItem(this.appService.COMPANY_KEY+"dev_mode"))},t}();Ti.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <table class="dialog_header" style="width:100%"><tr><td>\n{{\'INFO UTENTE\'}}\n</td>\n<td style="text-align:right">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /></td>\n</table>\n\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n\n <mat-dialog-content style="font-size:12px">\n <table class="fh_table" style="width:100%">\n <tbody>\n <tr class="odd">\n <td>{{\'Nome\' | translate}}</td>\n <td>\n <b>{{ user_name }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>{{\'Cognome\' | translate}}</td>\n <td>\n <b>{{ user_surname }}</b>\n </td>\n </tr>\n <tr class="odd">\n <td>{{\'Username\' | translate}}</td>\n <td>\n <b>{{ user }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>{{\'Email\' | translate}}</td>\n <td>\n <b>{{ user_email }}</b>\n </td>\n </tr>\n <tr class="odd">\n <td>{{\'Ruoli\' | translate}}</td>\n <td>\n <b>{{ user_roles }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>{{\'Lingua\' | translate}}</td>\n <td>\n <b>{{ user_lang }}</b>\n </td>\n </tr>\n <tr *ngIf="isadmin == \'1\'" class="odd">\n <td>DEV MODE</td>\n <td>\n <b\n ><mat-checkbox\n [(ngModel)]="dev_mode"\n (ngModelChange)="upd_dev(dev_mode)"\n ></mat-checkbox\n ></b>\n </td>\n </tr>\n </tbody>\n </table>\n <img\n style="vertical-align:middle;max-height:300px"\n *ngIf="b_filef"\n aria-hidden\n src="{{ foto_ut }}"\n />\n </mat-dialog-content>\n</div>\n '}]}],Ti.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:Dt}]};var Di=function(){function t(t,e){this._dataService=t,this._toast=e,this.color="#FFFFFF",this.bk_color="#000000",this.hidden=!1,this.key=""}return t.prototype.open_help=function(){var t=this;if(""!=this.key){var e=new vt;e.sql="SELECT_HELP_TEXT",e.types=["string"],e.values=[this.key],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg)if(e.result_data.length>0){if(null==e.result_data[0].url)return void t._toast.error("help non disponibile: "+t.key);if(""==e.result_data[0].url)return void t._toast.error("help non disponibile: "+t.key);"L"==e.result_data[0].t&&window.open(e.result_data[0].url),"I"==e.result_data[0].t&&t._toast.info(e.result_data[0].url,"HELP",{timeOut:5e3,positionClass:"toast-center-center"})}else{t._toast.error("help non disponibile: "+t.key);var i=new vt;i.sql="INSERT_HELP_TEXT",i.types=["string"],i.values=[t.key],t._dataService.doQuery(i).subscribe()}}))}},t}();Di.decorators=[{type:n.Component,args:[{selector:"FHHelpButton",template:'\n <div style="cursor:pointer">\n <mat-icon\n [style.color]="color"\n [style.background-color]="bk_color"\n [hidden]="hidden"\n (click)="open_help()"\n >info</mat-icon\n >\n </div>\n ',styles:[""]}]}],Di.ctorParameters=function(){return[{type:Dt},{type:i.ToastrService}]},Di.propDecorators={color:[{type:n.Input}],bk_color:[{type:n.Input}],hidden:[{type:n.Input}],key:[{type:n.Input}]};var Li={provide:c.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Ri})),multi:!0},Ri=function(){function t(){this.hidden=!1,this.label="",this.enabled=!0,this.required=!1,this.change=new n.EventEmitter,this.click=new n.EventEmitter,this.value_b=!1,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.onCl=function(){var t=this;setTimeout((function(){t.click.emit(t.value_b?1:0)}))},t.prototype.modelch=function(){var t=this;setTimeout((function(){t.onChange(t.value_b?1:0),t.change.emit(t.value_b?1:0)}))},t.prototype.ngAfterViewInit=function(){},t.prototype.getModelValue=function(){return this.value_b?1:0},t.prototype.writeValue=function(t){this.getModelValue()!==t&&null!=t&&(this.value_b=1==t)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}();Ri.decorators=[{type:n.Component,args:[{selector:"FHCheckBox",providers:[Li],template:'\n <mat-checkbox [class.fh_field_ck]="enabled" [class.fh_field_dis_ck]="!enabled"\n [(ngModel)]="value_b"\n (click)="onCl()"\n [disabled]="!enabled"\n [required]="required"\n (ngModelChange)="modelch()"\n >{{ label }}\n </mat-checkbox>\n ',styles:[""]}]}],Ri.ctorParameters=function(){return[]},Ri.propDecorators={hidden:[{type:n.Input}],label:[{type:n.Input}],enabled:[{type:n.Input}],required:[{type:n.Input}],change:[{type:n.Output}],click:[{type:n.Output}]};var Ni=function(){function t(t,e,i,n,o){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._trs=n,this.data=o,this.lbl="",this.nota="",this.nota_commento="",this.title="",this.comm_notrequired=0,this.user_sel=[],null!=o&&(null!=o.commento_default&&(this.nota=o.commento_default),null!=o.comm_notrequired&&(this.comm_notrequired=o.comm_notrequired?1:0),null!=o.title&&(this.title=o.title),null!=o.lbl&&(this.lbl=o.lbl),null!=o.utenti&&(this.arrAutori=o.utenti),null!=o.user_sel&&(this.user_sel=o.user_sel)),this.title=this._trs.instant("ASSEGNA DOCUMENTO");for(var s=0;s<this.arrAutori.length;s++)null==this.arrAutori[s].username&&(this.arrAutori[s].username=this.arrAutori[s].idp);2==this.comm_notrequired&&(this.nota_commento=this._trs.instant(" (COMMENTO NON OBBLIGATORIO)")),null!=o&&(null!=o.commento_default&&(this.nota=o.commento_default),null!=o.comm_notrequired&&(this.comm_notrequired=o.comm_notrequired))}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(0!=this.up.getSelArr().length)if(0!=this.comm_notrequired||""!=this.nota){var t=new Object;t.nota=this.nota,t.arrsel=this.up.getSelArr(),this.dialogRef.close(t)}else this.toastr.error("ERRORE",this._trs.instant("INSERIRE IL COMMENTO"),{timeOut:1e3,progressBar:!0});else this.toastr.error("ERRORE",this._trs.instant("SELEZIONARE ALMENO UN UTENTE"),{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();Ni.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n <div\n mat-dialog-content\n fxLayout="column"\n style="font-size: 15px;min-width: 750px"\n >\n <div style="width:100%;height:450px">\n <FHPickUsers\n #up\n [users_list]="arrAutori"\n [vis_buttons]="false"\n [user_sel]="user_sel"\n ></FHPickUsers>\n </div>\n <div *ngIf="comm_notrequired != 1">\n <br />\n <FHTextArea [label]="(\'Commento\' | translate) + nota_commento" [(ngModel)]="nota" rows="4"></FHTextArea>\n </div>\n </div>\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()"> {{\'OK\' | translate }}</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n {{\'ANNULLA\' | translate }}\n </button>\n </div>\n </div>\n '}]}],Ni.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:p.TranslateService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Ni.propDecorators={up:[{type:n.ViewChild,args:["up"]}]};var Fi=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this._tsr=i,this.title="SELEZIONA CHI NOTIFICARE"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.init_arr=function(t){this.up.user_sel=new Array,this.up.users_list_sel=new Array,this.up.users_list=new Array;for(var e=0;e<t.length;e++)null==t[e].username&&(t[e].username=t[e].idp),this.up.users_list_sel.push(t[e]),this.up.users_list.push(t[e]);this.up.filtra()},t.prototype.ok=function(){if(0!=this.up.getSelArr().length){var t=new Object;t.arrsel=this.up.getSelArr(),this.dialogRef.close(t)}else this.toastr.error("ERRORE","SELEZIONARE ALMENO UN UTENTE",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();Fi.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n <div mat-dialog-content style="min-width:700px;font-size: 15px;">\n <div style="height:370px;">\n <FHPickUsers #up [vis_buttons]="false"></FHPickUsers>\n </div>\n <br />\n </div>\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()"> {{\'OK\' | translate }}</button\n > \n <button mat-flat-button color="warn" (click)="close()">{{\'ANNULLA\' | translate }}</button>\n </div>\n </div>\n '}]}],Fi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:p.TranslateService}]},Fi.propDecorators={up:[{type:n.ViewChild,args:["up"]}]};var Mi=function(){function t(t,e,i,n,o,s,a,r){this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.toastr=n,this._dataService=o,this.m_wkf=s,this.m_file=a,this._tsr=r,this.notifica_commenti=1,this.notifica_commenti_obbl=0,this.not_comm=!1,this.not_comm_disabled=!1,this.nota="",this.title="COMMENTI",this.b_edit=!1,this.b_ins=!1,this.edit_id=0,this.lettori="",this.subject="",this.link="",this.codice_doc="",this.op="",this.refresh_list()}return t.prototype.close=function(){this.dialogRef.close(this.op)},t.prototype.init_v=function(){this.notifica_commenti>0&&1==this.notifica_commenti_obbl&&(this.not_comm=!0,this.not_comm_disabled=!0)},t.prototype.edit_comm=function(t){this.b_edit=!0,this.b_ins=!1,this.nota=t.commento,this.edit_id=t.id_comment,this.title=this._tsr.instant("MODIFICA COMMENTO")},t.prototype.refresh_list=function(){var t=this,e=new vt;e.sql="SELECT_COMMENTI_DOCUMENTO_M",e.types=["string","string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.commenti_list=e.result_data;for(var i=0;i<t.commenti_list.length;i++)t.commenti_list[i].v_commento="<b>"+t.commenti_list[i].commento.replace(/\n/g,"<br/>")+"</b>";t.title=t._tsr.instant("COMMENTI")}}),(function(t){}))},t.prototype.ok=function(){if(this.not_comm){if(""==this.nota)return void this.toastr.error(this._tsr.instant("INSERIRE UN COMMENTO"));2!=this.notifica_commenti?this.select_destinatari():this.select_destinatari_grp()}else this.ok_op()},t.prototype.select_destinatari_grp=function(){var t=this,e=this.m_dialogRef.open(He,{disableClose:!0});setTimeout((function(){e.componentInstance.title=t._tsr.instant("Selezione almeno un gruppo da notificare"),e.componentInstance.types=["string"],e.componentInstance.values=[t.m_appService.getState().wkf_doc_info.uiid_app],e.componentInstance.sql="SELECT_GRP_APP_USERS",e.componentInstance.doFill()})),e.afterClosed().subscribe((function(e){if(null!=e){if(""==e)return;for(var i="",n=0;n<e.length;n++)""!=i&&(i+=","),i=i+""+e[n].valore;var o=new vt;o.sql="SELECT_USERS_BY_IDROLES_NOREP",o.types=["string"],o.values=[i],t._dataService.doQuery(o).subscribe((function(e){i="";for(var n=0;n<e.result_data.length;n++)""!=i&&(i+=","),i=i+""+e.result_data[n].username;t.ok_op(i)}))}}))},t.prototype.select_destinatari=function(){var t=this,e=new vt;e.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",e.types=["string"],e.values=["'"+this.lettori.split(",").join("','")+"'"];this._dataService.doQuery(e).subscribe((function(e){var i=t.m_dialogRef.open(Fi,{disableClose:!0});setTimeout((function(){i.componentInstance.init_arr(e.result_data)})),i.afterClosed().subscribe((function(e){if(null!=e){for(var i="",n=0;n<e.arrsel.length;n++)""!=i&&(i+=","),i+=e.arrsel[n].username;t.ok_op(i)}}))}),(function(t){}))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,a,r,l,p,u){if(void 0===p&&(p=!0),void 0===u&&(u=""),null!=e&&""!=e){var c=new vt;c.sql="send_wkf_mail",c.values=[t,e,i,n.split("\n").join("<br>"),o,s,a,r,l,u],this.m_wkf.doQuery(c).subscribe((function(t){}))}},t.prototype.ok_op=function(t){var e=this;if(void 0===t&&(t=""),this.b_ins){(i=new vt).sql="INSERT_WKF_COMMENTO_M",i.types=["string","string","string","string","string"],i.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc,this.nota,this.m_appService.getState().wkf_doc_info.curr_user,t];this._dataService.doQuery(i).subscribe((function(i){e.op="i";var n=!1;if(null!=i&&"OK"==i.result_msg){e.toastr.info(e._tsr.instant("INFO"),e._tsr.instant("COMMENTO INSERITO"),{timeOut:1e3,progressBar:!0});var o=new gt;o.command="exec_app",o.p1="insert_update_comment",o.p2=e.m_appService.getState().wkf_doc_info.uiid_app+"|"+e.m_appService.getState().wkf_doc_info.uiid_doc,e.m_file.doQuery(o,!1).subscribe(),n=!0,e.b_edit=!1,""!=t&&e.sendEMail_ex(e.m_appService.getState().wkf_doc_info.curr_user,t,e.subject.split("<OP>").join(e._tsr.instant("E' stato inserito un commento")),"<br><br>"+e._tsr.instant("Commento inserito")+": <br>"+e.nota.split("\n").join("<br>"),e.m_appService.getState().wkf_doc_info.uiid_app,e.m_appService.getState().wkf_doc_info.uiid_doc,e.link,e.codice_doc,""),e.refresh_list()}n||e.toastr.error("ERRORE",i.msg)}))}else{var i;(i=new vt).sql="UPDATE_WKF_COMMENTO",i.types=["string","string","string"],i.values=[this.nota,this.edit_id,t];this._dataService.doQuery(i).subscribe((function(i){var n=!1;if(null!=i&&"OK"==i.result_msg){e.toastr.info(e._tsr.instant("INFO"),e._tsr.instant("COMMENTO AGGIORNATO"),{timeOut:1e3,progressBar:!0});var o=new gt;o.command="exec_app",o.p1="insert_update_comment",o.p2=e.m_appService.getState().wkf_doc_info.uiid_app+"|"+e.m_appService.getState().wkf_doc_info.uiid_doc+"|"+e.edit_id,e.m_file.doQuery(o,!1).subscribe(),n=!0,e.b_edit=!1,""!=t&&e.sendEMail_ex(e.m_appService.getState().wkf_doc_info.curr_user,t,e.subject.split("<OP>").join(e._tsr.instant("E' stato modificato un commento")),"<br><br>"+e._tsr.instant("Commento modificato")+": <br>"+e.nota.split("\n").join("<br>"),e.m_appService.getState().wkf_doc_info.uiid_app,e.m_appService.getState().wkf_doc_info.uiid_doc,e.link,e.codice_doc,""),e.refresh_list()}n||e.toastr.error("ERRORE",i.msg)}),(function(t){}))}},t.prototype.annulla=function(){var t=this;localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog",this._tsr.instant("Conferma Operazione")),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog",this._tsr.instant("Confermi di voler annullare l'inserimento del commento?")),this.m_dialogRef.open(It).afterClosed().subscribe((function(e){e&&(t.nota="",t.b_edit=!1,t.title="COMMENTI")}))},t.prototype.ngAfterViewInit=function(){},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title=this._tsr.instant("INSERISCI COMMENTO")},t}();Mi.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column">\n <div fxFlex="100" fxLayout="row" fxLayoutAlign="start center" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%"> <b>{{title | translate}}</b></div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\n\n <div fxFlex="100" fxLayout="row" fxLayoutAlign="end center"\n >\n <span class="fill-remaining-space"></span>\n <button mat-raised-button color="accent" (click)="ins()" *ngIf="!b_edit">\n <mat-icon>note_add</mat-icon>\n {{\'INSERISCI\' | translate}}\n </button>\n </div>\n\n <br />\n <div mat-dialog-content style="min-width:800px;font-size: 15px;">\n <FHTextArea *ngIf="b_edit" [label]="\'Commento\' | translate" [(ngModel)]="nota" rows="12"></FHTextArea>\n <div *ngIf="b_edit" fxLayoutAlign="center center" fxLayout="row">\n <button mat-flat-button color="primary" (click)="ok()"> {{\'OK\' | translate}}</button\n > \n <button mat-flat-button color="warn" (click)="annulla()"> {{\'ANNULLA\' | translate}}</button\n > \n <mat-checkbox\n [disabled]="not_comm_disabled"\n [(ngModel)]="not_comm"\n [hidden]="\n notifica_commenti == 0 || (notifica_commenti == 1 && lettori == \'\')\n "\n >{{\'Notifica Interessati\' | translate}}\n\n </mat-checkbox>\n </div>\n <section class="bs" *ngIf="!b_edit">\n <table style="min-width: 100%" class="fh_table">\n <thead>\n <tr>\n <th width="20">{{\'Ver\' | translate}}</th>\n <th>{{\'Commento\' | translate}}</th>\n <th width="15%">{{\'Autore\' | translate}}</th>\n <th width="15%">{{\'Data\' | translate}}</th>\n <th width="20"></th>\n <th width="20"></th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="\n let app of commenti_list;\n let odd = odd;\n let even = even;\n index as i\n "\n [ngClass]="{ odd: odd, even: even }"\n >\n <td align="center">{{app.v}}</td>\n <td [innerHTML]="app.v_commento"></td>\n <td>{{ app.COGNOME + " " + app.NOME }}</td>\n <td>{{ app.data_creazione | date: "dd/MM/yyyy HH:mm:ss" }}</td>\n <td align="center">\n <mat-icon\n [matTooltip]="app.dest_notif"\n *ngIf="app.dest_notif != null && app.dest_notif != \'\'"\n >mail</mat-icon\n >\n </td>\n <td align="center">\n <mat-icon\n *ngIf="\n i == 0 &&\n app.creatore ==\n m_appService.getState().wkf_doc_info.curr_user\n "\n (click)="edit_comm(app)"\n >edit\n </mat-icon>\n </td>\n </tr>\n </tbody>\n </table>\n </section>\n </div>\n <br />\n\n <div style="width:100%;text-align:center;" *ngIf="!b_edit">\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n {{\'CHIUDI\' | translate}}\n </button>\n </div>\n </div>\n ',styles:[""]}]}],Mi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:e.MatDialog},{type:wt},{type:i.ToastrService},{type:Dt},{type:ei},{type:Tt},{type:p.TranslateService}]};var Pi=function(){function t(t,e,i,n,o){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._tsr=n,this.data=o,this.utenti="",this.lbl="",this.nota="",this.icon="",this.color_font="",this.color="",this.nota_commento="",this.title="COMMENTI",this.comm_notrequired=0,this.mobile=!1,console.log("data ",o),null!=o&&(null!=o.commento_default&&(this.nota=o.commento_default),null!=o.comm_notrequired&&(this.comm_notrequired=o.comm_notrequired?1:0),null!=o.title&&(this.title=o.title),null!=o.lbl&&(this.lbl=o.lbl),null!=o.utenti&&(this.utenti=o.utenti.split(";").join(", ")),null!=o.icon&&(this.icon=o.icon),null!=o.color_font&&(this.color_font=o.color_font),null!=o.color&&(this.color=o.color)),2==this.comm_notrequired&&(this.nota_commento=" (COMMENTO NON OBBLIGATORIO)"),this.mobile=this.m_appService.getState().pageFullscreen}return t.prototype.ok=function(){0!=this.comm_notrequired||""!=this.nota?this.dialogRef.close(this.nota):this.toastr.error(this._tsr.instant("ERRORE"),this._tsr.instant("INSERIRE IL COMMENTO"),{timeOut:1e3,progressBar:!0})},t.prototype.close=function(){this.dialogRef.close("abort")},t.prototype.ngAfterViewInit=function(){},t}();Pi.decorators=[{type:n.Component,args:[{template:'\n<div fxLayout="column">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{ title| translate }}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <mat-toolbar [style.background-color]="color"\n [style.color]="color_font">\n <i *ngIf="icon!=null && icon!=\'\'" class="fa {{icon}}" aria-hidden="true"></i> \n <div style="font-size:10px" *ngIf="mobile">{{ lbl | translate}}</div>\n <div *ngIf="!mobile">{{ lbl| translate }}</div>\n </mat-toolbar>\n <br />\n <div mat-dialog-content style="min-width:800px;font-size: 15px;">\n <div\n *ngIf="mobile && utenti?.toLocaleLowerCase().indexOf(\'system\') == -1"\n style="font-size:10px"\n >\n {{\'Assegnata a\'| translate}}: {{ utenti }}\n </div>\n <h3\n *ngIf="!mobile && utenti?.toLocaleLowerCase().indexOf(\'system\') == -1"\n >\n {{\'Assegnata a\'| translate}}: {{ utenti }}\n </h3>\n <br />\n <mat-form-field\n [hidden]="comm_notrequired == 1"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{\'Commento\'| translate}} {{ nota_commento | translate}}</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="6"></textarea>\n </mat-form-field>\n </div>\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()">{{\'OK\'| translate}}</button>\n\n </div>\n '}]}],Pi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:p.TranslateService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var zi=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toast=i,this.data=n,this.title="INFO DOCUMENTO",this.hide_richiedente=!1,this.load_info(n)}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.load_info=function(t){console.log("data ",t),null==t.v&&(t.v=1),this.codice=t.codice+"/"+t.v,this.data_richiesta=t.data_richiesta,this.richiedente=t.richiedente,this.stato=t.stato,this.stat_stato=t.stat_stato,this.in_carico_a=t.autori,null!=t.s_uto&&""!=t.s_uto&&(this.in_carico_a=t.s_uto),this.uiid_app=t.id_applicativo,this.uiid_doc=t.id_documento,this.canale=t.canale,this.nc=t.nc},t.prototype.ngAfterViewInit=function(){},t}();zi.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title|translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <div mat-dialog-content style="font-size: 15px;">\n <table class="fh_table">\n <tbody>\n <tr class="odd">\n <td>{{\'Codice\'|translate}}:</td>\n <td>\n <b>{{ codice }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>{{\'Data\'|translate}}:</td>\n <td>\n <b>{{ data_richiesta | date: "dd/MM/yyyy HH:mm:ss" }}</b>\n </td>\n </tr>\n <tr *ngIf="!hide_richiedente" class="odd">\n <td>{{\'Richiedente\'|translate}}:</td>\n <td>\n <b>{{ richiedente }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>{{\'Stato\'|translate}}:</td>\n <td>\n <b>{{ stato }} - {{stat_stato}}</b>\n </td>\n </tr>\n <tr class="odd">\n <td>{{\'In Carico a\'|translate}}:</td>\n <td>\n <b>{{ in_carico_a }}</b>\n </td>\n </tr>\n\n <tr class="even" *ngIf="m_appService.dev_mode">\n <td>Uiid App:</td>\n <td>\n <b>{{ uiid_app }}</b>\n </td>\n </tr>\n <tr class="odd" *ngIf="m_appService.dev_mode">\n <td>Uiid Doc:</td>\n <td>\n <b>{{ uiid_doc }}</b>\n </td>\n </tr>\n <tr class="odd" *ngIf="m_appService.dev_mode">\n <td>Grp:</td>\n <td>\n <b>{{ canale }}</b>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <br />\n\n <div style="width:100%;text-align:center;">\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="dialogRef.close(\'\')"\n >\n CHIUDI\n </button>\n </div>\n</div>\n '}]}],zi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var ji=function(){function t(t,e,i,n,o,s,a){this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.toastr=n,this._dataService=o,this.m_wkf=s,this._tsr=a,this.not_int=!0,this.nota="",this.title="COMMENTI",this.b_edit=!1,this.b_ins=!0,this.edit_id=0,this.lettori="",this.subject="",this.link="",this.codice_doc=""}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(this.not_int){if(""==this.nota)return void this.toastr.error("INSERIRE UN COMMENTO");this.select_destinatari()}else this.ok_op()},t.prototype.select_destinatari=function(){var t=this,e=new vt;e.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",e.types=["string"],e.values=["'"+this.lettori.split(",").join("','")+"'"];this._dataService.doQuery(e).subscribe((function(e){var i=t.m_dialogRef.open(Fi,{disableClose:!0});setTimeout((function(){i.componentInstance.init_arr(e.result_data)})),i.afterClosed().subscribe((function(e){if(null!=e){for(var i="",n=0;n<e.arrsel.length;n++)""!=i&&(i+=","),i+=e.arrsel[n].username;t.ok_op(i)}}))}),(function(t){}))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,a,r,l,p,u){if(void 0===p&&(p=!0),void 0===u&&(u=""),null!=e&&""!=e){var c=new vt;c.sql="send_wkf_mail",c.values=[t,e,i,n.split("\n").join("<br>"),o,s,a,r,l,u],this.m_wkf.doQuery(c).subscribe((function(t){}))}},t.prototype.ok_op=function(t){var e=this;void 0===t&&(t="");var i=new vt;i.sql="INSERT_WKF_COMMENTO_M",i.types=["string","string","string","string","string"],i.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc,this.nota,this.m_appService.getState().wkf_doc_info.curr_user,""],this._dataService.doQuery(i).subscribe((function(i){null!=i&&"OK"==i.result_msg&&(e.toastr.info(e._tsr.instant("INFO"),e._tsr.instant("COMMENTO INSERITO"),{timeOut:1e3,progressBar:!0}),e.b_edit=!1,""!=t&&e.sendEMail_ex(e.m_appService.getState().wkf_doc_info.curr_user,t,e.subject.split("<OP>").join(e._tsr.instant("E' stato inserito un commento")),"<br><br>"+e._tsr.instant("Commento inserito")+": <br>"+e.nota.split("\n").join("<br>"),e.m_appService.getState().wkf_doc_info.uiid_app,e.m_appService.getState().wkf_doc_info.uiid_doc,e.link,e.codice_doc,""))}))},t.prototype.annulla=function(){this.nota="",this.b_edit=!1,this.title="COMMENTI"},t.prototype.ngAfterViewInit=function(){},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title="INSERISCI COMMENTO"},t}();ji.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <div mat-dialog-content style="min-width:800px;font-size: 15px;">\n <FHTextArea [label]="\'Commento\' | translate" [(ngModel)]="nota" rows="12"></FHTextArea>\n <div>\n <button mat-flat-button color="primary" (click)="ok()">{{\'OK\' | translate}}</button\n > \n <button mat-flat-button color="warn" (click)="annulla()">{{\'ANNULLA\' | translate}}</button\n > \n <mat-checkbox [(ngModel)]="not_int" [hidden]="lettori === \'\'">\n {{\'Notifica Interessati\' | translate}\n </mat-checkbox>\n </div>\n </div>\n ',styles:[""]}]}],ji.ctorParameters=function(){return[{type:e.MatDialogRef},{type:e.MatDialog},{type:wt},{type:i.ToastrService},{type:Dt},{type:ei},{type:p.TranslateService}]};var Ui=function(){function t(t,e,i,n,o,s,a,r,l){this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.toastr=n,this._dataService=o,this.m_wkf=s,this.m_file=a,this._tsr=r,this.data=l,this.ossv=!1,this.not_comm=!1,this.not_comm_disabled=!1,this.op="",this.b_flussook=!0,this.logs=new Array,this.notifica_commenti=1,this.notifica_commenti_obbl=0,this.title="LOG WORKFLOW E COMMENTI",this.nota="",this.commenti_insert=!1,this.b_edit=!1,this.b_ins=!1,this.edit_id=0,this.c_edit=!0,this.lettori="",this.subject="",this.link="",this.codice_doc="",null!=l.edit_c&&(this.c_edit=l.edit_c)}return t.prototype.ric_all=function(){this.refresh_list()},t.prototype.close=function(){this.dialogRef.close(this.op)},t.prototype.init_v=function(){this.notifica_commenti>0&&1==this.notifica_commenti_obbl&&(this.not_comm=!0,this.not_comm_disabled=!0)},t.prototype.load_graph=function(){var t=this,e=new vt;e.sql="SELECT_WKF_BY_ID",e.types=["string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){if(e.result_data.length>0&&null!=e.result_data[0].diagramma_flusso&&""!=e.result_data[0].diagramma_flusso){for(var i=!1,n=0;n<t.logs.length;n++){if(null!=t.logs[n].liv_ini&&null!=t.logs[n].liv_fin){var o;o=t.logs[n].liv_ini+"_"+t.logs[n].liv_fin,console.log("sostituisco ",o),e.result_data[0].diagramma_flusso=e.result_data[0].diagramma_flusso.split('bpmnElement="LINK_'+o+'"').join('bpmnElement="LINK_'+o+'" bioc:stroke="#1E88E5" bioc:fill="#BBDEFB"'),e.result_data[0].diagramma_flusso=e.result_data[0].diagramma_flusso.split('bpmnElement="LINK_EXIT_'+t.logs[n].liv_ini+'"').join('bpmnElement="LINK_EXIT_'+t.logs[n].liv_ini+'" bioc:stroke="#1E88E5" bioc:fill="#BBDEFB"')}-1==t.logs[n].id_comment&&(null!=t.logs[n].liv_ini&&(e.result_data[0].diagramma_flusso=e.result_data[0].diagramma_flusso.split('bpmnElement="STEP_'+t.logs[n].liv_ini+'"').join('bpmnElement="STEP_'+t.logs[n].liv_ini+'" bioc:stroke="#43A047" bioc:fill="#C8E6C9"')),i||null!=t.logs[n].liv_fin&&(e.result_data[0].diagramma_flusso=e.result_data[0].diagramma_flusso.split('bpmnElement="STEP_'+t.logs[n].liv_fin+'"').join('bpmnElement="STEP_'+t.logs[n].liv_fin+'" bioc:stroke="#FB8C00" bioc:fill="#FFE0B2"'),i=!0))}return void t.modeler.importXML(e.result_data[0].diagramma_flusso,(function(e){e?t.b_flussook=!1:t.modeler.get("canvas").zoom("fit-viewport",{x:0,y:0})}))}t.b_flussook=!1}}))},t.prototype.annulla=function(){var t=this;localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog",this._tsr.instant("Conferma Operazione")),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog",this._tsr.instant("Confermi di voler annullare l'inserimento del commento?")),this.m_dialogRef.open(It).afterClosed().subscribe((function(e){e&&(t.nota="",t.b_edit=!1,t.title=t._tsr.instant("LOG WORKFLOW E COMMENTI"))}))},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title=this._tsr.instant("INSERISCI COMMENTO")},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.ric_all()}),200)},t.prototype.edit_comm=function(t){this.b_edit=!0,this.b_ins=!1,this.nota=t.stato_attuale,this.edit_id=t.id_comment,this.title=this._tsr.instant("MODIFICA COMMENTO")},t.prototype.refresh_list=function(){var t=this,e=new vt;e.sql="SELECT_WORKFLOW_LOG",e.types=["string","string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc];this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.logs=e.result_data;for(var i=0;i<t.logs.length;i++)null!=t.logs[i].stato_attuale?t.logs[i].v_commento="<b>"+t.logs[i].operazione.replace(/\n/g,"<br/>")+" ("+t.logs[i].stato_attuale.replace(/\n/g,"<br/>")+")</b>":t.logs[i].v_commento="<b>"+t.logs[i].operazione.replace(/\n/g,"<br/>")+"</b>";t.ossv||(t.modeler=new R({container:"#canvas",width:"97%",height:"100%",readonly:!0})),t.load_graph(),t.ossv=!0,!0}}))},t.prototype.ok=function(){if(this.not_comm){if(""==this.nota)return void this.toastr.error(this._tsr.instant("INSERIRE UN COMMENTO"));1==this.notifica_commenti?this.select_destinatari():this.select_destinatari_grp()}else this.ok_op()},t.prototype.select_destinatari=function(){var t=this,e=new vt;e.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",e.types=["string"],e.values=["'"+this.lettori.split(",").join("','")+"'"];this._dataService.doQuery(e).subscribe((function(e){var i=t.m_dialogRef.open(Fi,{disableClose:!0});setTimeout((function(){i.componentInstance.init_arr(e.result_data)})),i.afterClosed().subscribe((function(e){if(null!=e){for(var i="",n=0;n<e.arrsel.length;n++)""!=i&&(i+=","),i+=e.arrsel[n].username;t.ok_op(i)}}))}))},t.prototype.select_destinatari_grp=function(){var t=this,e=this.m_dialogRef.open(He,{disableClose:!0});setTimeout((function(){e.componentInstance.title=t._tsr.instant("Selezione almeno un gruppo da notificare"),e.componentInstance.types=["string"],e.componentInstance.values=[t.m_appService.getState().wkf_doc_info.uiid_app],e.componentInstance.sql="SELECT_GRP_APP_USERS",e.componentInstance.doFill()})),e.afterClosed().subscribe((function(e){if(null!=e){if(""==e)return;for(var i="",n=0;n<e.length;n++)""!=i&&(i+=","),i=i+""+e[n].valore;var o=new vt;o.sql="SELECT_USERS_BY_IDROLES_NOREP",o.types=["string"],o.values=[i],t._dataService.doQuery(o).subscribe((function(e){i="";for(var n=0;n<e.result_data.length;n++)""!=i&&(i+=","),i=i+""+e.result_data[n].username;t.ok_op(i)}))}}))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,a,r,l,p,u){if(void 0===p&&(p=!0),void 0===u&&(u=""),null!=e&&""!=e){var c=new vt;c.sql="send_wkf_mail",c.values=[t,e,i,n.split("\n").join("<br>"),o,s,a,r,l,u],this.m_wkf.doQuery(c).subscribe((function(t){}))}},t.prototype.ok_op=function(t){var e,i=this;(void 0===t&&(t=""),this.b_ins)?((e=new vt).sql="INSERT_WKF_COMMENTO",e.types=["string","string","string","string","string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc,this.nota,this.m_appService.getState().wkf_doc_info.curr_user,t],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){i.op="i",i.toastr.info(i._tsr.instant("INFO"),i._tsr.instant("COMMENTO INSERITO"),{timeOut:1e3,progressBar:!0}),console.log("insert_update_comment !!!!");var n=new gt;n.command="exec_app",n.p1="insert_update_comment",n.p2=i.m_appService.getState().wkf_doc_info.uiid_app+"|"+i.m_appService.getState().wkf_doc_info.uiid_doc,i.m_file.doQuery(n,!1).subscribe(),i.b_edit=!1,""!=t&&i.sendEMail_ex(i.m_appService.getState().wkf_doc_info.curr_user,t,i.subject.split("<OP>").join(i._tsr.instant("E' stato inserito un commento")),"<br><br>"+i._tsr.instant("Commento inserito")+": <br>"+i.nota.split("\n").join("<br>"),i.m_appService.getState().wkf_doc_info.uiid_app,i.m_appService.getState().wkf_doc_info.uiid_doc,i.link,i.codice_doc,""),i.refresh_list()}}))):((e=new vt).sql="UPDATE_WKF_COMMENTO",e.types=["string","string","string","string"],e.values=[this.nota,this.edit_id],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){i.toastr.info(i._tsr.instant("INFO"),i._tsr.instant("COMMENTO AGGIORNATO"),{timeOut:1e3,progressBar:!0}),console.log("insert_update_comment !!!!");var n=new gt;n.command="exec_app",n.p1="insert_update_comment",n.p2=i.m_appService.getState().wkf_doc_info.uiid_app+"|"+i.m_appService.getState().wkf_doc_info.uiid_doc,i.m_file.doQuery(n,!1).subscribe(),i.b_edit=!1,""!=t&&i.sendEMail_ex(i.m_appService.getState().wkf_doc_info.curr_user,t,i.subject.split("<OP>").join(i._tsr.instant("E' stato modificato un commento")),"<br><br>"+i._tsr.instant("Commento modificato")+": <br>"+i.nota.split("\n").join("<br>"),i.m_appService.getState().wkf_doc_info.uiid_app,i.m_appService.getState().wkf_doc_info.uiid_doc,i.link,i.codice_doc,""),i.refresh_list()}})))},t}();Ui.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <div\n style="font-size: 12px"\n [style.height]="m_appService.getState().body_h - 130 + \'px\'"\n >\n <mat-tab-group\n #zz\n style="width:100%"\n [style.height]="m_appService.getState().body_h - 140 + \'px\'"\n >\n <mat-tab label="WORKFLOW" *ngIf="b_flussook">\n <div [style.height]="m_appService.getState().body_h - 160 + \'px\'">\n <div style="width:100%;height:100%" id="canvas"></div>\n </div>\n </mat-tab>\n\n <mat-tab label="LOGS">\n <div\n fxLayout="row"\n fxLayoutAlign="center end"\n fxFlex="90"\n *ngIf="!b_edit && commenti_insert && c_edit"\n >\n <button mat-flat-button color="accent" (click)="ins()">\n <mat-icon>note_add</mat-icon>\n {{\'INSERISCI\' | translate}}</button\n > \n </div>\n\n <div fxLayout="column" *ngIf="b_edit">\n <br />\n\n <FHTextArea *ngIf="b_edit" [label]="\'Commento\' | translate" [(ngModel)]="nota" rows="12"></FHTextArea>\n <div *ngIf="b_edit" fxLayoutAlign="center center" fxLayout="row">\n <button mat-flat-button color="primary" (click)="ok()">OK</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="annulla()"\n >\n {{\'ANNULLA\' | translate}}</button\n > \n <mat-checkbox\n [disabled]="not_comm_disabled"\n [(ngModel)]="not_comm"\n [hidden]="\n notifica_commenti == 0 ||\n (notifica_commenti == 1 && lettori == \'\')\n "\n >\n {{\'Notifica Interessati\' | translate}}\n </mat-checkbox>\n </div>\n <br /><br />\n </div>\n <table *ngIf="!b_edit" class="fh_table" style="width:90%">\n <thead>\n <tr>\n <th width="15%"> {{\'Data\' | translate}}</th>\n <th width="15%"> {{\'Utente\' | translate}}</th>\n <th> {{\'Task/Operazione\' | translate}}</th>\n <td></td>\n <td *ngIf="c_edit"></td>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="\n let app of logs;\n let odd = odd;\n let even = even;\n index as i\n "\n [ngClass]="{ odd: odd, even: even }"\n >\n <td>{{ app.data_creazione | date: "dd/MM/yyyy HH:mm:ss" }}</td>\n <td>{{ app.nc }}</td>\n <td [innerHTML]="app.v_commento"></td>\n <td>\n <mat-icon\n [matTooltip]="app.dest_notif"\n *ngIf="app.dest_notif != null && app.dest_notif != \'\'"\n >mail</mat-icon\n >\n </td>\n <td *ngIf="c_edit">\n <mat-icon\n *ngIf="\n i == 0 &&\n app.creatore ==\n m_appService.getState().wkf_doc_info.curr_user\n "\n (click)="edit_comm(app)"\n >edit\n </mat-icon>\n </td>\n </tr>\n </tbody>\n </table>\n </mat-tab>\n </mat-tab-group>\n </div>\n ',styles:[""]}]}],Ui.ctorParameters=function(){return[{type:e.MatDialogRef},{type:e.MatDialog},{type:wt},{type:i.ToastrService},{type:Dt},{type:ei},{type:Tt},{type:p.TranslateService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Ui.propDecorators={zz:[{type:n.ViewChild,args:["zz"]}]};var Vi=function(){function t(t,e,i,n,o){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this._tsr=o,this.flt_grid="1=1",this.title="RECUPERA DOCUMENTO"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.edit=function(t){var e=this,i=new vt;i.sql="UPDATE_WKF_ANNULATO",i.types=["string","string","int"],i.values=[this.datagrid.sRow.id_applicativo,this.datagrid.sRow.uiid,0],this._dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(e.toastr.info(e._tsr.instant("Documento")+" "+e.datagrid.sRow.codice+" "+e._tsr.instant("Recuperato")),e.dialogRef.close("ok"))}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}))},t.prototype.init_w=function(t){this.datagrid.columnDefs=[{headerName:this._tsr.instant("Codice"),field:"codice",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:this._tsr.instant("Oggetto"),field:"oggetto",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:this._tsr.instant("Stato"),field:"stat_stato",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:this._tsr.instant("Richiedente"),field:"nc",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}}],this.datagrid.doFill("annullato=-1 and id_applicativo='"+t+"'")},t.prototype.edit_comm=function(t){},t}();Vi.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n <div mat-dialog-content style="font-size: 15px;">\n\n <br />\n <div style="width:100%;height:400px">\n <div style="width:100%;height:100%">\n <FHGrid\n [filters]="flt_grid"\n init_fill="false"\n show_buttons="false"\n vis\n #dtm\n (dclicked)="edit($event)"\n g_width="100%"\n g_height="100%"\n tbl_name="wkf_documents"\n grid_key="r_wkf_documents"\n sort_field="codice desc"\n off_set="50"\n fields="*"\n ></FHGrid>\n </div>\n </div>\n <br />\n\n <div style="width:100%;text-align:center;">\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="dialogRef.close(\'\')"\n >\n {{\'CHIUDI\' | translate}}\n </button>\n </div>\n </div>\n </div>\n '}]}],Vi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:Dt},{type:p.TranslateService}]},Vi.propDecorators={datagrid:[{type:n.ViewChild,args:["dtm"]}]};var qi=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this._tsr=i,this.selval="-1",this.title="",this.errorMsg="",this.OK_BUTTON="OK"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.sc=function(){if(this.OK_BUTTON="OK","-1"!=this.selval)for(var t=0;t<this.myData.length;t++){if(Number(this.selval).valueOf()+0==this.myData[t].step+0){this.OK_BUTTON="OK ("+this.myData[t].description+")";break}}},t.prototype.setStepCombo=function(t){this.myData=t},t.prototype.ok=function(){if(null!=this.selval)if("-1"!=this.selval){for(var t=null,e=0;e<this.myData.length;e++){if(Number(this.selval).valueOf()+0==this.myData[e].step+0){t=this.myData[e];break}}null!=t?this.dialogRef.close({lvl_sel:t,result:"ok"}):this.toastr.error(this._tsr.instant("ERRORE"),this._tsr.instant("SELEZIONARE LO STEP"),{timeOut:1e3,progressBar:!0})}else this.toastr.error(this._tsr.instant("ERRORE"),this._tsr.instant("SELEZIONARE LO STEP"),{timeOut:1e3,progressBar:!0});else this.toastr.error(this._tsr.instant("ERRORE"),this._tsr.instant("SELEZIONARE LO STEP"),{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();qi.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n <div mat-dialog-content style="font-size: 15px;">\n\n <mat-dialog-content\n ><br /><br />\n <mat-form-field\n style="width:100%"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{\'Seleziona Step\' | translate}}:</mat-label>\n <mat-select #cmb [(ngModel)]="selval" (change)="sc()">\n <mat-option value="-1">Seleziona</mat-option>\n <mat-option value="{{ app.step }}" *ngFor="let app of myData">\n {{app.v | translate }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <br /><br /><br /><br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()">\n {{ OK_BUTTON | translate }}</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n {{\'ANNULLA\' | translate }}\n </button>\n </div>\n <br /><br />\n </mat-dialog-content>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">\n {{ errorMsg }}\n </p>\n </div>\n </div>\n '}]}],qi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:p.TranslateService}]},qi.propDecorators={smtr:[{type:n.ViewChild,args:["cmb"]}]};var Gi=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this._tsr=i,this.commento_hidden=!1,this.nota="",this.nota_commento="",this.title="",this.comm_notrequired=!0,this.comm_notrequired=!0}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(this.commento_hidden||""!=this.nota)if(0!=this.up.getSelArr().length){var t=new Object;t.nota=this.nota,t.arrsel=this.up.getSelArr(),t.result="ok",this.dialogRef.close(t)}else this.toastr.error(this._tsr.instant("ERRORE"),this._tsr.instant("SELEZIONARE ALMENO UN UTENTE"),{timeOut:1e3,progressBar:!0});else this.toastr.error(this._tsr.instant("ERRORE"),this._tsr.instant("INSERIRE IL COMMENTO"),{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();Gi.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate }}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n <div mat-dialog-content fxLayout="column" style="font-size:12px">\n <div style="width:100%;height:500px">\n <FHPickUsers\n #up\n [users_list]="arrAutori"\n [vis_buttons]="false"\n\n ></FHPickUsers>\n </div>\n\n <mat-form-field\n [hidden]="commento_hidden"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{\'Commento\' | translate }} {{ nota_commento | translate }}</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="2"></textarea>\n </mat-form-field>\n </div>\n <div mat-dialog-actions fxLayout="row" fxLayoutAlign="center center">\n <div>\n <button mat-flat-button color="primary" (click)="ok()"> {{\'OK\' | translate }}</button>\n </div>\n \n <div>\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n {{\'ANNULLA\' | translate }}\n </button>\n </div>\n </div>\n </div>\n ',styles:[" .mat-dialog-content { max-height: unset !important; }\n\n"]}]}],Gi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:p.TranslateService}]},Gi.propDecorators={up:[{type:n.ViewChild,args:["up"]}]};var Ki=function(){function t(t,e,i){this.dialogRef=t,this.data=e,this.toast=i,this.salva_ed_esci="SALVA ED ESCI",this.esci_senza_salvataggi="ESCI SENZA SALVATAGGIO",this.commento="",this.b_commento=!1,this.commento_mgs="Commento",this.insert_comment_msg="Inserire un commento",null!=e&&(null!=e.mgs_salva_ed_esci&&(this.salva_ed_esci=e.mgs_salva_ed_esci),null!=e.msg_esci_senza_salvataggi&&(this.esci_senza_salvataggi=e.msg_esci_senza_salvataggi),null!=e.b_commento&&(this.b_commento=e.b_commento),null!=e.commento_mgs&&(this.commento_mgs=e.commento_mgs),null!=e.insert_comment_msg&&(this.insert_comment_msg=e.insert_comment_msg))}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.salva_esci=function(){this.b_commento&&""==this.commento?this.toast.error(this.insert_comment_msg):this.dialogRef.close("salva_esci")},t.prototype.esci_senza_salv=function(){this.dialogRef.close("esci_senza_salv")},t.prototype.ngAfterViewInit=function(){},t}();Ki.decorators=[{type:n.Component,args:[{template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start">\n <img\n src="assets/icons/x.png"\n style="cursor: pointer;"\n (click)="close()"\n />\n </div>\n <hr width="100%" size="0.5" color="#DDDDDD" />\n\n <div mat-dialog-content>\n <div style="width:400px" [hidden]="!b_commento"><br /></div>\n <div style="width:400px" [hidden]="!b_commento">\n <FHTextArea\n label="{{ commento_mgs |translate }}"\n required\n [(ngModel)]="commento"\n ></FHTextArea>\n </div>\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="salva_esci()">\n {{ salva_ed_esci|translate }}</button\n > \n <button mat-flat-button color="warn" (click)="esci_senza_salv()">\n {{ esci_senza_salvataggi |translate }}\n </button>\n </div>\n </div>\n '}]}],Ki.ctorParameters=function(){return[{type:e.MatDialogRef},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]},{type:i.ToastrService}]};var Bi=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._tsr=n,this.selval="-1",this.errorMsg="",this.title="SELEZIONA AMBITO",this.myData=this.m_appService.getState().wkf_doc_info.canali_arr,this.selval="-1"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){"-1"!=this.selval?this.dialogRef.close(this.selval):this.toastr.error(this._tsr.instant("ERRORE"),this._tsr.instant("SELEZIONARE AMBITO"),{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();Bi.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title|translate }}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n <div mat-dialog-content style="font-size: 15px;">\n\n <div mat-dialog-content>\n <br /><br />\n <mat-form-field\n style="width:100%"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{\'Seleziona Ambito\'|translate }}:</mat-label>\n <mat-select #cmb [(ngModel)]="selval">\n <mat-option value="-1">{{\'Seleziona\' |translate }}</mat-option>\n <mat-option value="{{ app }}" *ngFor="let app of myData">\n {{app |translate }}\n }}</mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()"> {{\'OK\' | translate }}</button>\n </div>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">\n {{ errorMsg |translate }}\n </p>\n </div>\n </div>\n '}]}],Bi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:p.TranslateService}]},Bi.propDecorators={smtr:[{type:n.ViewChild,args:["cmb"]}]};var Hi=function(){function t(t,e,i,n){this.dialogRef=t,this.toastr=e,this._tsr=i,this.data=n,this.selval="-1",this.errorMsg="",this.title="SELEZIONA PROSSIMO STEP:",this.OK_BUTTON="OK",this.trans=[],this.trans=n,this.title=this._tsr.instant(this.title)}return t.prototype.sel=function(t){this.selval=t.uiid,this.ok()},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.sc=function(){if(this.OK_BUTTON="OK",null!=this.selval&&""!=this.selval&&"-1"!=this.selval)for(var t=0;t<this.trans.length;t++)if(this.selval==this.trans[t].uiid){this.OK_BUTTON=this._tsr.instant("OK")+" ("+this.trans[t].description+")";break}},t.prototype.ok=function(){if(null!=this.selval&&""!=this.selval&&"-1"!=this.selval)for(var t=0;t<this.trans.length;t++)this.selval==this.trans[t].uiid&&this.dialogRef.close(this.trans[t]);else this.toastr.error(this._tsr.instant("Selezionare lo step di destinazione"))},t.prototype.ngAfterViewInit=function(){},t}();Hi.decorators=[{type:n.Component,args:[{template:'\n<div fxLayout="column">\n<div fxFlex="100" fxLayout="row" fxLayoutAlign="start center" class="dialog_header">\n\n<div fxLayout="row" fxLayoutAlign="start center" fxFlex="90"><div>{{title|translate}}</div></div>\n\n<div fxFlex="10" fxLayout="row" fxLayoutAlign="end center">\n <div><img src="assets/icons/x.png" style="cursor: pointer;" (click)="dialogRef.close(null)" /> </div>\n</div>\n\n</div>\n\n\n<mat-dialog-content>\n<hr width="100%" size="0.5" color="#DDDDDD">\n\n <br />\n <div fxLayout="column" fxLayoutGap="5px">\n <div *ngFor="let app of trans">\n <button mat-raised-button [style.background-color]="app.color" (click)="sel(app)"\n [style.color]="app.color_font" style="font-weight:bold;font-size:18px;min-width:300px">\n <i *ngIf="app.icon!=null && app.icon!=\'\'" class="fa {{app.icon}}" aria-hidden="true"></i>\n\n{{ app.description|translate}}</button>\n<br><br>\n\n\n</div>\n </div>\n</mat-dialog-content>\n\n\n '}]}],Hi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:p.TranslateService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Hi.propDecorators={smtr:[{type:n.ViewChild,args:["cmb"]}]};var Yi=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this._tsr=i,this.nota="",this.title="",this.comm_notrequired=!0,this.comm_notrequired=!0}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(console.log(this.up.getUsersUsername(),this.up1.getUsersUsername()),null!=this.up.getUsersUsername())if("-1"!=this.up.getUsersUsername())if(""!=this.up.getUsersUsername())if(null!=this.up1.getUsersUsername())if("-1"!=this.up1.getUsersUsername())if(""!=this.up1.getUsersUsername()){var t=new Object;t.u1=this.up.getUsersUsername(),t.u2=this.up1.getUsersUsername(),t.result="ok",this.dialogRef.close(t)}else this.toastr.error(this._tsr.instant("selezionare utente destinazione"));else this.toastr.error(this._tsr.instant("selezionare utente destinazione"));else this.toastr.error(this._tsr.instant("selezionare utente destinazione"));else this.toastr.error(this._tsr.instant("selezionare utente origine"));else this.toastr.error(this._tsr.instant("selezionare utente origine"));else this.toastr.error(this._tsr.instant("selezionare utente origine"))},t.prototype.ngAfterViewInit=function(){},t}();Yi.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title|translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n <div\n mat-dialog-content\n fxLayoutGap="5px"\n fxLayout="column"\n style="font-size:12px"\n >\n <div style="width:100%">\n <FHUserField [label]="\'Utente da sostituire\' |translate" #up></FHUserField>\n </div>\n <div style="width:100%">\n <FHUserField [label]="\'Utente sostituto\' |translate" #up1></FHUserField>\n </div>\n </div>\n <div mat-dialog-actions fxLayout="row" fxLayoutAlign="center center">\n <div>\n <button mat-flat-button color="primary" (click)="ok()"> {{\'OK\' | translate }}</button>\n </div>\n \n <div>\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n {{\'ANNULLA\' | translate }}\n </button>\n </div>\n </div>\n </div>\n '}]}],Yi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:p.TranslateService}]},Yi.propDecorators={up:[{type:n.ViewChild,args:["up"]}],up1:[{type:n.ViewChild,args:["up1"]}]};var Qi=function(){function t(t,e,i){this.data=t,this.dialogRef=e,this.app_s=i,this.enabled=!0,this.access_control=!0,this.App="",this.K="",this.title="ALLEGATI",this.admin_role="[ZZZ_DIS_CC]",this.sovrascrivi_path="",console.log("data ",t),null!=t&&(null!=t.App&&(this.App=t.App),null!=t.K&&(this.K=t.K),null!=t.admin_role&&(this.admin_role=t.admin_role))}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){""==t.App&&(t.App=t.app_s.getState().wkf_doc_info.uiid_app,t.K=t.app_s.getState().wkf_doc_info.uiid_doc),t.init(t.App,t.K)}))},t.prototype.init=function(t,e){this.App=t,this.K=e,this.upc.init(this.App,this.K)},t}();Qi.decorators=[{type:n.Component,args:[{selector:"wkf_win_upload",template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title |translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n\n <mat-dialog-content style="font-size:12px">\n<br><br>\n <FHUploadPanel\n [enabled]="enabled"\n #upc\n [access_control]="access_control"\n [sovrascrivi_path]="sovrascrivi_path"\n [ruolo_supervisore]="admin_role"\n ></FHUploadPanel>\n </mat-dialog-content>\n <br /><br />\n <div style="width:100%;text-align:center;">\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n {{\'CHIUDI\' | translate}}\n </button>\n </div>\n </div>\n ',styles:[""]}]}],Qi.ctorParameters=function(){return[{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]},{type:e.MatDialogRef},{type:wt}]},Qi.propDecorators={upc:[{type:n.ViewChild,args:["upc"]}]};var Wi=function(){function t(t,e){this.m_appService=t,this._trs=e,this.custom_commands=[],this.dt_agg=null,this.edit_button=!1,this.in_carico=!1,this.respingi_button=!1,this.procedi_button=!0,this.utility_button=!0,this.show_logs=!0,this.show_commenti=!0,this.show_allegati=!0,this.force_save=!1,this.check_on_save=!1,this.download_button=!0,this.edit_comments_in_logs=!0,this.assegna_a=!1,this.next_label=!1,this.next_label_color=!1,this.back_lbl="Indietro",this.save_lbl="Salva",this.procedi_lbl="Procedi",this.respingi_lbl="Respingi",this.revisione_lbl="Revisione",this.info_doc_lbl="Info Doc",this.commenti_lbl="Commenti",this.allegati_lbl="Allegati",this.workflow_lbl="Workflow",this.prendi_in_carico_lbl="Prendi in Carico",this.b_revisione=!1,this.admin_role="[ZZZ_DIS_CC]",this.sovra_path="",this.command=new n.EventEmitter,this.comment_inserted=new n.EventEmitter,this.button_clicked=new n.EventEmitter}return t.prototype.exec_command=function(t){this.command.emit({cmd:t})},t.prototype.revisione=function(){this.button_clicked.emit("revisione"),null!=this.dt_agg&&this.dt_agg.revisione()},t.prototype.back=function(){this.button_clicked.emit("back"),null!=this.dt_agg&&this.dt_agg.back(this.edit_button)},t.prototype.evt_salv=function(){this.button_clicked.emit("evt_salv"),null!=this.dt_agg&&this.dt_agg.evt_salv(this.edit_button,this.check_on_save)},t.prototype.prendi_in_carico=function(){this.button_clicked.emit("prendi_in_c"),null!=this.dt_agg&&this.dt_agg.prendi_in_carico()},t.prototype.evt_assegna_a=function(){this.button_clicked.emit("assegna_a"),null!=this.dt_agg&&this.dt_agg.assegna_a()},t.prototype.respingi=function(){this.button_clicked.emit("respingi"),null!=this.dt_agg&&this.dt_agg.respingi()},t.prototype.procedi=function(){this.button_clicked.emit("procedi"),null!=this.dt_agg&&this.dt_agg.procedi()},t.prototype.open_info=function(){this.button_clicked.emit("open_info"),null!=this.dt_agg&&this.dt_agg.open_info()},t.prototype.open_commenti=function(){this.button_clicked.emit("open_commenti"),null!=this.dt_agg&&this.dt_agg.open_commenti(this.comment_inserted)},t.prototype.open_upload=function(){this.button_clicked.emit("open_upload"),null!=this.dt_agg&&this.dt_agg.open_upload(this.sovra_path,this.admin_role)},t.prototype.open_wkf=function(){console.log("this.edit_comments_in_logs ",this.edit_comments_in_logs),this.button_clicked.emit("open_wkf"),null!=this.dt_agg&&this.dt_agg.open_wkf(this.comment_inserted,!1,this.edit_comments_in_logs)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.back_lbl=t._trs.instant("Indietro"),t.save_lbl=t._trs.instant("Salva"),t.procedi_lbl=t._trs.instant("Procedi"),t.respingi_lbl=t._trs.instant("Respingi"),t.revisione_lbl=t._trs.instant("Revisione"),t.info_doc_lbl=t._trs.instant("Info Doc"),t.commenti_lbl=t._trs.instant("Commenti"),t.allegati_lbl=t._trs.instant("Allegati"),t.workflow_lbl=t._trs.instant("Workflow")}))},t}();Wi.decorators=[{type:n.Component,args:[{selector:"wkf_header_bar_v2",template:'\n <div fxLayout="row" fxLayoutGap.lt-md="8px" fxLayoutGap="15px" fxLayout.lt-md="column">\n <div\n fxLayout="row"\n fxLayoutGap="16px"\n fxLayoutGap.lt-md="8px"\n *ngIf="\n !m_appService.getState().pageFullscreen ||\n edit_button ||\n respingi_button\n "\n >\n <div>\n <button\n mat-flat-button\n (click)="back()"\n *ngIf="!m_appService.getState().pageFullscreen"\n >\n {{back_lbl}}</button\n ></div>\n <div *ngIf="(edit_button || force_save) && !in_carico">\n <button\n mat-flat-button\n (click)="evt_salv()"\n\n color="primary" style="font-weight:bold"\n >\n {{save_lbl}}</button\n ></div>\n\n\n <div>\n <button\n mat-flat-button\n (click)="prendi_in_carico()"\n *ngIf="in_carico"\n style="background-color:#709D66;color:#FFFFFF;font-weight:bold"\n >\n {{prendi_in_carico_lbl | translate}}</button\n ></div>\n\n <div *ngIf="dt_agg!=null && dt_agg?.b_init_next">\n\n <button\n mat-flat-button\n (click)="procedi()"\n *ngIf="(edit_button && procedi_button) && !in_carico"\n style="font-weight:bold" [style.background-color]="dt_agg?.next_back_ground_color" [style.color]="dt_agg?.next_label_color"\n >\n {{dt_agg?.next_label | translate}}</button>\n </div>\n\n <div *ngIf="(respingi_button) && !in_carico">\n <button\n mat-flat-button\n (click)="respingi()"\n style="font-weight:bold"\n color="warn"\n >\n {{respingi_lbl | translate}}\n </button>\n </div>\n <div *ngIf="(b_revisione) && in_carico">\n <button\n mat-flat-button\n (click)="revisione()"\n\n color="accent"\n >\n {{revisione_lbl | translate}}\n </button>\n </div>\n <div *ngIf="assegna_a">\n <button\n mat-flat-button\n (click)="evt_assegna_a()"\n\n style="background-color:#709D66;color:#FFF;font-weight:bold"\n >\n {{\'Riassegna a\'|translate}}</button\n ></div>\n\n <div>\n \x3c!-- <button mat-flat-button (click)="doEnd(900)" color="warn" >test</button> \n--\x3e\n </div>\n \n <div\n fxLayout="row"\n fxLayout.xs="column"\n fxLayoutGap="16px"\n fxLayoutGap.xs="8px"\n >\n <div fxLayout="row" fxLayoutGap="16px">\n <div>\n <button\n mat-flat-button\n (click)="open_info()"\n *ngIf="!m_appService.getState().pageFullscreen && utility_button"\n >\n <mat-icon>info_outline</mat-icon> {{info_doc_lbl | translate}}</button\n ></div>\n <div>\n <button\n mat-flat-button *ngIf="utility_button && show_commenti"\n [color]="(dt_agg?.comm_c ? dt_agg?.comm_c : 0 > 0) ? \'accent\' : \'\'"\n [matBadge]="dt_agg?.comm_c ? dt_agg?.comm_c : 0"\n matBadgePosition="before"\n matBadgeColor="primary"\n (click)="open_commenti()"\n >\n <mat-icon>insert_comment</mat-icon> {{commenti_lbl | translate}}</button\n ></div>\n\n </div>\n <div fxLayout="row" fxLayoutGap="16px">\n <div [hidden]="!download_button">\n <button\n mat-flat-button *ngIf="utility_button && show_allegati"\n [color]="(dt_agg?.all_c ? dt_agg?.all_c : 0 > 0) ? \'accent\' : \'\'"\n [matBadge]="dt_agg?.all_c ? dt_agg?.all_c : 0"\n matBadgePosition="before"\n matBadgeColor="primary"\n (click)="open_upload()"\n >\n <mat-icon>attach_file</mat-icon> {{allegati_lbl | translate}}</button\n ></div>\n\n <div>\n <button\n mat-flat-button\n (click)="open_wkf()"\n *ngIf="!m_appService.getState().pageFullscreen && utility_button && show_logs"\n >\n <mat-icon>transfer_within_a_station</mat-icon> {{workflow_lbl | translate}}\n </button>\n </div>\n\n\n\n </div>\n </div>\n <div\n *ngIf="custom_commands.length > 0"\n fxLayoutGap="10px"\n fxLayout="row"\n fxLayoutAlign="end center"\n >\n <div *ngFor="let app of custom_commands" fxLayout="row"\n fxLayoutGap="5px">\n <div><button [hidden]="app.hidden!=null && app.hidden"\n mat-flat-button\n [color]="app.color"\n (click)="exec_command(app.command)"\n >\n <mat-icon *ngIf="app.icon != null">{{ app.icon }}</mat-icon\n >{{ app.label | translate}}\n </button> </div>\n </div>\n </div>\n </div>\n '}]}],Wi.ctorParameters=function(){return[{type:wt},{type:p.TranslateService}]},Wi.propDecorators={custom_commands:[{type:n.Input}],dt_agg:[{type:n.Input}],edit_button:[{type:n.Input}],in_carico:[{type:n.Input}],respingi_button:[{type:n.Input}],procedi_button:[{type:n.Input}],utility_button:[{type:n.Input}],show_logs:[{type:n.Input}],show_commenti:[{type:n.Input}],show_allegati:[{type:n.Input}],force_save:[{type:n.Input}],check_on_save:[{type:n.Input}],download_button:[{type:n.Input}],edit_comments_in_logs:[{type:n.Input}],assegna_a:[{type:n.Input}],next_label:[{type:n.Input}],next_label_color:[{type:n.Input}],b_revisione:[{type:n.Input}],admin_role:[{type:n.Input}],sovra_path:[{type:n.Input}],command:[{type:n.Output}],comment_inserted:[{type:n.Output}],button_clicked:[{type:n.Output}]};var Ji=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.data=i,this.config={modules:{toolbar:[["bold","italic","underline","strike","image","link"],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["code-block","blockquote",{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"}]],keyboard:{bindings:{list:{key:"backspace",context:{format:["list"]},handler:function(t,e){0!==t.index&&(0===t.length?this.quill.deleteText(t.index-1,1,1):this.quill.deleteText(t,1))}}}}}},this.title="",this.label="",this.value="",this.readonly=!1,this.show_annulla=!0,this.show_ok=!0,this.min_chars=3,null!=i&&(null!=i.title&&(this.title=i.title),null!=i.label&&(this.label=i.label),null!=i.value&&(this.value=i.value),null!=i.readonly&&(this.readonly=i.readonly),null!=i.show_annulla&&(this.show_annulla=i.show_annulla),null!=i.show_ok&&(this.show_ok=i.show_ok),null!=i.min_chars&&(this.min_chars=i.min_chars))}return t.prototype.ngAfterViewInit=function(){},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.show=function(){},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.do_check=function(){this.value.length<this.min_chars?this.toastr.error("Il value deve contenere almeno "+this.min_chars+" caratteri"):this.dialogRef.close(this.value)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t}();Ji.decorators=[{type:n.Component,args:[{selector:"app-win_ask_richtext",template:'\n <div fxLayout="column" fxLayoutGap="5px">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{ title }}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n\t\t<hr width="100%" size="0.5" color="#DDDDDD">\n <mat-dialog-content style="width:630px;font-size: 15px;">\n <b *ngIf="label != \'\'">{{ label }}</b>\n <quill-editor\n theme="snow"\n format="html"\n\n [(ngModel)]="value"\n ></quill-editor>\n\n </mat-dialog-content>\n <mat-dialog-actions>\n <div\n fxLayout="row"\n fxLayoutAlign="center center"\n style="width: 100%"\n [hidden]="readonly"\n >\n <button\n *ngIf="show_ok"\n mat-flat-button\n color="primary"\n (click)="do_check()"\n >\n OK</button\n > \n <button\n *ngIf="show_annulla"\n mat-flat-button\n color="warn"\n (click)="chiudi()"\n >\n ANNULLA\n </button>\n </div>\n <div\n fxLayout="row"\n fxLayoutAlign="center center"\n style="width: 100%"\n [hidden]="!readonly"\n >\n <button\n *ngIf="show_annulla"\n mat-flat-button\n color="warn"\n (click)="chiudi()"\n >\n CHIUDI\n </button>\n </div>\n </mat-dialog-actions>\n</div>\n '}]}],Ji.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var $i=function(){function t(t,e,i,o,s,a,r,l,p){var u=this;this._gridservice=t,this._toast=e,this._dataService=i,this.m_appService=o,this.slimLoadingBarService=s,this.m_dialog=a,this.uti_s=r,this._fileService=l,this.clipboard=p,this.width_max="100%",this.browser="nd",this.tooltipShowDelay=2e3,this.elimina_label="ELIMINA",this.export_field_aggiuntivi="",this.end_point=null,this.tbl_name="",this.num_per_pag=35,this.grid_key="PRO_H",this.enabled=!0,this.show_link=!1,this.show_help_bar=!1,this.help_label_bar="HELP",this.auto_load=!0,this.auto_height=!1,this.enable_export=!0,this.enabled_pag=!0,this.show_help=!0,this.show_num_elem=!0,this.system_dest=1,this.header_h=35,this.selection_mode="multiple",this.init_fill=!0,this.no_pref=!1,this.pref_hidden=!0,this.enable_export_pdf=!0,this.enable_export_xls=!0,this.enable_copy=!0,this.autosize_at_ini=!0,this.label_elementi=" Elementi",this.trova_label="TROVA",this.mantieni_impostazioni="Mantieni Imp.",this.curr_filter="",this.show_buttons=!0,this.fill_end=new n.EventEmitter,this.cell_edited=new n.EventEmitter,this.clicked=new n.EventEmitter,this.dclicked=new n.EventEmitter,this.columndclicked=new n.EventEmitter,this.cell_clicked=new n.EventEmitter,this.custom_export=!1,this.toolbar_type="NONE",this.toolbar_wkfapp=null,this.toolbar_custom_commands=[],this.command=new n.EventEmitter,this.b_ensure=!1,this.curr_config="-1",this.init_end=new n.EventEmitter,this.off_set=0,this.first_ref=!0,this.b_restored=!1,this.str_curr_q_p="",this.p_fi={},this.dataSource={getRows:function(t){u.slimLoadingBarService.start((function(){}));var e={kd:u.tbl_name};e.num_per_pag=t.endRow-t.startRow,e.curr_page=Math.round(t.startRow/e.num_per_pag),null==e.curr_page&&(e.curr_page=0),null==e.num_per_pag&&(e.num_per_pag=100),e.system_dest=u.system_dest,e.p=JSON.stringify({sort_model:t.sortModel,filter_model:t.filterModel,free_search:u.ric_libera}),null!=t.filterModel&&"{}"!=JSON.stringify(t.filterModel)||null!=u.ric_libera&&""!=u.ric_libera?u.show_pulisci_filtri=!0:u.show_pulisci_filtri=!1,u.p_fi={kd:e.kd,system_dest:e.system_dest,p:e.p},u._gridservice.doQuery(e,!0,u.m_appService.API_ENDPOINT+"dogridn").subscribe((function(i){var n=!1;if(null!=i&&"OK"==i.result_msg){n=!0,t.successCallback(i.result_data,i.count),u.b_init=!0,u.myData=i.result_data.slice(),u.num_r=i.count,u.slimLoadingBarService.complete(),u.fill_end.emit(),localStorage.setItem(u.grid_key+"_POS1",JSON.stringify(e)),null!=localStorage.getItem(u.grid_key+"_POS2")&&null!=u.gridOptions&&null!=u.gridOptions.api&&u.gridOptions.api.forEachNode((function(t){u.getRowNodeId(t)===localStorage.getItem(u.grid_key+"_POS2")&&(t.setSelected(!0),localStorage.removeItem(u.grid_key+"_POS2"),null!=localStorage.getItem(u.grid_key+"_LAST_ROW")&&(u.sRow=JSON.parse(localStorage.getItem(u.grid_key+"_LAST_ROW"))),localStorage.removeItem(u.grid_key+"_LAST_ROW"))}));null!=u.toggle_mantieni&&u.toggle_mantieni.checked,u.no_pref&&!u.b_init1&&u.autoSizeAll(),u.b_init1=!0,u.ensure_visible(),null==localStorage.getItem(u.grid_key+"_COLS")&&u.autosize_at_ini&&setTimeout((function(){u.autoSizeAll()}),300)}n||(u.errorMsg=i.msg+" ["+i.result_msg+"]")}),(function(t){u.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER. RITENTARE PIU' TARDI"}))}},this.getContextMenuItems_n_e=function(){return["autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste"]},this.getContextMenuItems_e=function(){return["autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste",{name:"Esporta",action:function(){u.export_excel()},icon:'<img src="assets/icons/square-o/xlsx.svg"/>'}]},this.gridOptions={debug:!1,headerHeight:this.header_h,enableRangeSelection:!0,defaultColDef:{resizable:!0,sortable:!0,floatingFilter:!0},allowContextMenuWithControlKey:!0,rowModelType:"infinite",localeText:{page:"pagina",more:"altre",to:"a",of:"di",next:"prossima",last:"ultima",first:"prima",previous:"precedente",loadingOoo:"Caricamento...",selectAll:"Seleziona Tutto",searchOoo:"Trova...",blanks:"Vuoto",filterOoo:"Filtro...",applyFilter:"Applica Filtro...",equals:"Uguale",notEqual:"Diverso",lessThan:"Minore o Uguale",greaterThan:"Maggiore o Uguale",notContains:"Non Contiene",contains:"Contiene",startsWith:"Inizia Con",endsWith:"Finisce Con",group:"Gruppo",columns:"Colonne",rowGroupColumns:"Colonne Pivot",rowGroupColumnsEmptyMessage:"trascina le colonne per raggrupparle",valueColumns:"Colonne Valore",pivotMode:"Modalità Pivot",groups:"Gruppi",values:"Valori",pivots:"Pivots",valueColumnsEmptyMessage:"trascina le colonne per aggreare",pivotColumnsEmptyMessage:"trascina le colonne per pivot",noRowsToShow:"nessun dato",pinColumn:"Sposta Colonna",valueAggregation:"Aggregazione",autosizeThiscolumn:"Autosize colonna",autosizeAllColumns:"Autosize tutte le colonne",groupBy:"Raggruppa per",ungroupBy:"Spacca per",resetColumns:"Resetta queste colonna",expandAll:"Espandi",collapseAll:"Chiudi",toolPanel:"Impostazioni",pinLeft:"Sposta <<",pinRight:"Sposta >>",noPin:"Sposta <>",sum:"Somma",min:"Minimo",max:"Massimo",none:"Nessuno",count:"Numero",average:"Media",copy:"Copia",ctrlC:"ctrl n C",paste:"Incolla",ctrlV:"ctrl n C"},getRowNodeId:function(t){return null!=t.ID?String(t.ID):null!=t.id?String(t.id):null!=t.uiid?t.uiid:null!=t.codice?t.codice:null!=t.id_doc?t.id_doc:null!=t.notesid?t.notesid:null!=t.ord?t.ord:void 0}},this.last_copy="",this.b_init=!1,this.b_init1=!1,this.errorMsg="",this.innerWidth=750,this.show_pulisci_filtri=!1,this.uiid_stampa="",this.xxopx=0,this.num_r=0,this.ready=!1,this.ckk_ed=!1,this.myData=new Array,this.b_iniended=!1,this.ric_libera="",this.fix_flt="",this.fix_flt_temp="",null==this.m_appService.getState().grid_obj&&(this.m_appService.getState().grid_obj={}),this.browser=this.getBrowserName(),"ie"==this.browser&&(this.width_max="")}return t.prototype.getBrowserName=function(){var t=window.navigator.userAgent.toLowerCase();switch(!0){case t.indexOf("edge")>-1:return"edge";case t.indexOf("opr")>-1&&!!window.opr:return"opera";case t.indexOf("chrome")>-1&&!!window.chrome:return"chrome";case t.indexOf("trident")>-1:return"ie";case t.indexOf("firefox")>-1:return"firefox";case t.indexOf("safari")>-1:return"safari";default:return"other"}},t.prototype.docmd=function(t){this.command.emit(t)},t.prototype.ensure_visible=function(){if(!this.b_ensure){this.b_ensure=!0;try{null!=localStorage.getItem(this.grid_key+"_POS")&&(this.gridOptions.api.ensureIndexVisible(parseInt(localStorage.getItem(this.grid_key+"_POS"))),localStorage.removeItem(this.grid_key+"_POS"))}catch(t){console.log(t)}}},t.prototype.ck_flag=function(){this.toggle_mantieni.checked?localStorage.setItem(this.grid_key+"_MANTIENI","NO"):localStorage.setItem(this.grid_key+"_MANTIENI","SI")},t.prototype.refresh_all_rows=function(){var t=this;setTimeout((function(){t.gridOptions.api.refreshCells({force:!0})}),0)},t.prototype.ch_config=function(){this.no_pref||(this.curr_config=this.gf.getValue(),"-1"!=this.curr_config&&(localStorage.removeItem(this.grid_key+"_COLS"),localStorage.removeItem(this.grid_key+"_FILTER"),localStorage.removeItem(this.grid_key+"_CFG_DEFAULT"),localStorage.removeItem(this.grid_key+"_FILTER_UP"),null!=this.gf.getObj().COL&&""!=this.gf.getObj().COL&&localStorage.setItem(this.grid_key+"_COLS",this.gf.getObj().COL),null!=this.gf.getObj().FILTER&&""!=this.gf.getObj().FILTER&&localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),null!=this.gf.getDescri()&&"-1"!=this.gf.getDescri()&&localStorage.setItem(this.grid_key+"_CFG_DEFAULT",this.gf.getDescri()),this.curr_config=this.gf.getValue(),this.res_columns(!0)))},t.prototype.elimina_config=function(){var t=this;null==this.gf.getObj().username||this.m_appService.user==this.gf.getObj().username?(localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler cancellare la configurazione "+this.gf.getDescri()+"?"),this.m_dialog.open(It,{disableClose:!0}).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="DELETE_CFG_GRID",i.types=["string","string"],i.values=[t.gf.getDescri(),t.grid_key];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione eliminata"),t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo(),t.curr_config="-1")}))}}))):this._toast.error("Configurazione gestibile da: "+this.gf.getObj().username)},t.prototype.edit_config=function(){var t=this;null==this.gf.getObj().username||this.m_appService.user==this.gf.getObj().username?(localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler sovrascrivere la configurazione "+this.gf.getDescri()+"?"),this.m_dialog.open(It,{disableClose:!0}).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="INSERT_UPDATE_CFG_GRID";var n="",o="";null!=localStorage.getItem(t.grid_key+"_COLS")&&(n=localStorage.getItem(t.grid_key+"_COLS")),null!=localStorage.getItem(t.grid_key+"_FILTER")&&(o=localStorage.getItem(t.grid_key+"_FILTER")),i.types=["string","string","string","string","string","string"],i.values=[t.gf.getDescri(),t.grid_key,n,"",o,t.m_appService.user];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione salvata"),t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo(),t.curr_config="-1")}),(function(t){}))}}))):this._toast.error("Configurazione gestibile da: "+this.gf.getObj().username)},t.prototype.refresh_access=function(t){this.toolbar_wkfapp=t},t.prototype.getGridApi=function(){return this.gridOptions.api},t.prototype.getGridOptions=function(){return this.gridOptions},t.prototype.insert_config=function(){var t=this;this.win_opt=this.m_dialog.open(re,{disableClose:!0}),setTimeout((function(){t.win_opt.componentInstance.title="Salva Configurazione",t.win_opt.componentInstance.label="Nome"})),this.win_opt.afterClosed().subscribe((function(e){if(e&&null!=e){var i=new vt;i.sql="INSERT_UPDATE_CFG_GRID";var n="",o="";null!=localStorage.getItem(t.grid_key+"_COLS")&&(n=localStorage.getItem(t.grid_key+"_COLS")),null!=localStorage.getItem(t.grid_key+"_FILTER")&&(o=localStorage.getItem(t.grid_key+"_FILTER")),i.types=["string","string","string","string","string","string"],i.values=[e,t.grid_key,n,"",o,t.m_appService.user];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione salvata"),!0,t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo())}),(function(t){}))}}))},t.prototype.onBtExport=function(){this.export_excel()},t.prototype.export_excel=function(t){var e=this;void 0===t&&(t="excel"),this.dialogRef_W=this.m_dialog.open(Nt,{disableClose:!0}),setTimeout((function(){e.dialogRef_W.componentInstance.label="EXPORT IN CORSO"})),this.p_fi.type=t,this.p_fi.uiid_stampa=this.uti_s.newGuid(),this.uiid_stampa=this.p_fi.uiid_stampa,this._gridservice.doQuery(this.p_fi,!0,this.m_appService.API_ENDPOINT+"doexportn").subscribe((function(i){e.check_end("pdf"==t?".pdf":".xlsx")}))},t.prototype.check_end=function(t){var e=this,i=new gt;i.p1=this.m_appService.LOCAL_PATH+"grid_reports\\"+this.uiid_stampa+"_"+this.m_appService.user+t,i.command="check_file",this._fileService.doQuery(i).subscribe((function(i){null!=i&&("N"==i.msg?setTimeout((function(){e.check_end(t)}),1e3):(setTimeout((function(){e.dialogRef_W.componentInstance.update_progess(100)})),window.open(e.m_appService.COMPANY_SITE_ROOT+"/grid_reports/"+e.uiid_stampa+"_"+e.m_appService.user+t)))}))},t.prototype.setHeaderHeight=function(t){var e=this;this.header_h=t,this.gridOptions.api.setHeaderHeight(this.header_h),this.gridOptions.suppressCopyRowsToClipboard=!0,this.gridOptions.sendToClipboard=function(t){console.log("v ",t),e.enable_copy&&e.gridApi.copySelectedRangeToClipboard(),e.clipboard.copy(t.data.split("\n")[0])}},t.prototype.getRowNodeId=function(t){return null==t||null==t.data?this.uti_s.newGuid():null!=t.data.id?String(t.data.id):null!=t.data.uiid?t.data.uiid:null!=t.data.codice?t.data.codice:"NA"},t.prototype.ngAfterViewInit=function(){var t=this;"PRO_H"==this.grid_key&&(this.no_pref=!0),setTimeout((function(){null==t.end_point&&(t.end_point=t.m_appService.API_ENDPOINT+t.m_appService.GRID_ENDPOINT),null!=localStorage.getItem(t.grid_key+"_FILTER_UP")&&(t.ric_libera=localStorage.getItem(t.grid_key+"_FILTER_UP")),t.onResize()}))},t.prototype.okr=function(t){t.data.nome_colonna=t.column.colDef.field,this.cell_edited.emit(t.data)},t.prototype.help_window=function(){this.m_dialog.open(ae,{disableClose:!0}).afterClosed().subscribe((function(t){}))},t.prototype.onResize=function(t){},t.prototype.autoSizeAll=function(){var t=this;if(null!=this.gridOptions&&null!=this.gridOptions.columnApi){var e=[];this.gridOptions.columnApi.getAllGridColumns().map((function(t){e.push(t.getColId())})),this.gridOptions.columnApi.autoSizeColumns(e),this.gridOptions.columnApi.getColumnState().length>0&&24==this.gridOptions.columnApi.getColumnState()[0].width?setTimeout((function(){t.autoSizeAll()}),300):this.save_cfg()}},t.prototype.fitSizeAll=function(){this.gridOptions.api.sizeColumnsToFit(),this.save_cfg()},t.prototype.selectCount=function(){var t=0;return this.gridOptions.api.forEachNode((function(e){e.isSelected()&&t++})),t},t.prototype.getquerySelected=function(t,e){var i="";return"String"==e&&this.gridOptions.api.forEachNode((function(e){e.isSelected()&&null!=e.data[t]&&(""!=i&&(i+=","),i=i+"'"+e.data[t]+"'")})),"Number"==e&&this.gridOptions.api.forEachNode((function(e){e.isSelected()&&null!=e.data[t]&&(""!=i&&(i+=","),i+=e.data[t])})),i},t.prototype.selectAllFiltered=function(){var t=this;this.gridOptions.api.forEachNode((function(e){t.gridOptions.api.selectNode(e,!0)}))},t.prototype.deselectAllFiltered=function(){var t=this;this.gridOptions.api.forEachNode((function(e){t.gridOptions.api.selectNode(e,!1)}))},t.prototype.pulisci_filtri=function(t){void 0===t&&(t=!0),localStorage.removeItem(this.grid_key+"_FILTER"),t&&(""!=this.ric_libera&&this.doFill("",!0,!1),this.ric_libera="",localStorage.removeItem(this.grid_key+"_FILTER_UP")),this.fix_flt_temp="",this.gridOptions.api.setFilterModel(null);this.gridOptions.api.setFilterModel({})},t.prototype.print=function(){this.custom_export?this.command.emit({cmd:"print_pdf"}):this.export_excel("pdf")},t.prototype.init_conf=function(){},t.prototype.createColumnDefs=function(t){},t.prototype.ckk=function(){var t=this;if(this.auto_load)if(null!=this.columnDefs)if(0!=this.columnDefs.length){if(!this.ckk_ed){if(this.ckk_ed=!0,null!=this.toggle_mantieni&&(this.toggle_mantieni.checked=!0,null!=localStorage.getItem(this.grid_key+"_MANTIENI")&&"NO"==localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.toggle_mantieni.checked=!1)),this.res_columns(),null!=localStorage.getItem(this.grid_key+"_POS")&&(this.b_restored=!0),null!=localStorage.getItem(this.grid_key+"_FILTER_UP")&&""!=localStorage.getItem(this.grid_key+"_FILTER_UP")){this.ric_libera=localStorage.getItem(this.grid_key+"_FILTER_UP");for(var e=this.ric_libera.split(" "),i=new Array,n=0;n<e.length;n++)i.push(e[n]);if(0==i.length)return;var o="",s=function(t){for(var e="",n=0;n<a.columnDefs.length;n++)null!=a.columnDefs[n]&&null==a.columnDefs[n].no_filter&&null!=a.columnDefs[n].field&&""!=a.columnDefs[n].field&&"agDateColumnFilter"!=a.columnDefs[n].filter&&(""!=e&&(e+=" or "),e+=a.columnDefs[n].field+" LIKE '%"+i[t].replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()+"%' ESCAPE '$'");null!=a.full_text_added_columns&&a.full_text_added_columns.map((function(n){null!=n&&""!=n&&(""!=e&&(e+=" or "),e+=n+" LIKE '%"+i[t].replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()+"%' ESCAPE '$'")})),""!=e&&(""!=o&&(o+=" and "),o+="("+e+")")},a=this;for(n=0;n<i.length;n++)s(n);this.fix_flt_temp=o}this.init_fill&&setTimeout((function(){t.ref_dt()}),100)}}else setTimeout((function(){t.ckk()}),500);else setTimeout((function(){t.ckk()}),500)},t.prototype.set_init_size=function(){var t=this;0!=this.myData.length?this.columnDefs.length<=6?this.fitSizeAll():this.autoSizeAll():setTimeout((function(){t.set_init_size()}),500)},t.prototype.res_columns=function(t){var e=this;if(void 0===t&&(t=!1),null!=this.columnDefs)if(0!=this.columnDefs.length){var i=!1;if(null!=this.toggle_mantieni&&(i=this.toggle_mantieni.checked),null!=localStorage.getItem(this.grid_key+"_COLS")&&""!=localStorage.getItem(this.grid_key+"_COLS")){if(null!=localStorage.getItem(this.grid_key+"_COLS")&&(i||t)&&""!=localStorage.getItem(this.grid_key+"_COLS")){!0;try{for(var n=JSON.parse(localStorage.getItem(this.grid_key+"_COLS")),o=!0,s=0;s<n.length;s++)n[s].hide||(o=!1);o?localStorage.getItem(this.grid_key+"_COLS"):this.gridOptions.columnApi.setColumnState(JSON.parse(localStorage.getItem(this.grid_key+"_COLS")))}catch(t){console.log(t)}}if(null!=localStorage.getItem(this.grid_key+"_FILTER")&&(i||t)&&""!=localStorage.getItem(this.grid_key+"_FILTER"))try{this.gridOptions.api.setFilterModel(JSON.parse(localStorage.getItem(this.grid_key+"_FILTER")))}catch(t){console.log(t)}}else this.set_init_size()}else setTimeout((function(){e.res_columns(t)}),200);else setTimeout((function(){e.res_columns(t)}),200)},t.prototype.getRows=function(){return this.gridOptions.rowData},t.prototype.sortAndFilter=function(t,e){},t.prototype.ref_dt=function(){var t=this;null==this.gridOptions||null==this.gridOptions.api?setTimeout((function(){t.ref_dt()}),500):this.gridOptions.api.setDatasource(this.dataSource)},t.prototype.updateRow=function(){this.refresh_all_rows()},t.prototype.onModelUpdated=function(){},t.prototype.onReady=function(t){this.gridApi=t.api,this.setHeaderHeight(this.header_h),null!=this.gf&&this.show_buttons&&!this.pref_hidden&&(this.gf.sql="SELECT_CFG_GRID",this.gf.types=["string"],this.gf.values=[this.grid_key],this.gf.fillCombo(),"NO"!=localStorage.getItem(this.grid_key+"_MANTIENI")&&null!=localStorage.getItem(this.grid_key+"_CFG_DEFAULT"))||this.auto_load&&this.onready_go()},t.prototype.init_grid=function(){this.auto_load=!0,this.onready_go()},t.prototype.save_cfg=function(){localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.fe_cfg=function(){null!=this.gf&&null!=this.gf.getObj()&&"NO"!=localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.gf.setByDescri(localStorage.getItem(this.grid_key+"_CFG_DEFAULT")),localStorage.setItem(this.grid_key+"_COLS",this.gf.getObj().COLS),localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),this.curr_config=this.gf.getValue()),this.onready_go()},t.prototype.onready_go=function(){var t=this;this.ready=!0,setTimeout((function(){t.ckk()}),10),this.b_iniended||(this.b_iniended=!0,this.init_end.emit())},t.prototype.init_filters=function(){},t.prototype.keyDownFunctioncl=function(t){13==t.keyCode&&this.free_search()},t.prototype.free_search=function(){if(""==this.ric_libera)return this.pulisci_filtri(),this.fix_flt_temp="",this.doFill("",!0,!1),void localStorage.removeItem(this.grid_key+"_FILTER_UP");localStorage.setItem(this.grid_key+"_FILTER_UP",this.ric_libera);for(var t=this.ric_libera.split(" "),e=new Array,i=0;i<t.length;i++)e.push(t[i]);if(0!=e.length){var n="",o=function(t){for(var i="",o=0;o<s.columnDefs.length;o++)null!=s.columnDefs[o]&&null==s.columnDefs[o].no_filter&&null!=s.columnDefs[o].field&&""!=s.columnDefs[o].field&&"agDateColumnFilter"!=s.columnDefs[o].filter&&(""!=i&&(i+=" or "),i+=s.columnDefs[o].field+" LIKE '%"+e[t].replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()+"%' ESCAPE '$'");null!=s.full_text_added_columns&&s.full_text_added_columns.map((function(n){null!=n&&""!=n&&(""!=i&&(i+=" or "),i+=n+" LIKE '%"+e[t].replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()+"%' ESCAPE '$'")})),""!=i&&(console.log("ADDO "),""!=n&&(n+=" and "),n+="("+i+")")},s=this;for(i=0;i<e.length;i++)o(i);this.pulisci_filtri(!1),this.doFill_Temp(n,!0)}},t.prototype.onCellClicked=function(t){this.cell_clicked.emit(t)},t.prototype.onCellValueChanged=function(t){},t.prototype.onCellDoubleClicked=function(t){},t.prototype.onCellFocused=function(t){},t.prototype.onSelectionChanged=function(){},t.prototype.onBeforeFilterChanged=function(){},t.prototype.oncolumnEverythingChanged=function(t){this.b_init&&localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.onFilterModified=function(){var t=this;this.no_pref||setTimeout((function(){t.b_init&&localStorage.setItem(t.grid_key+"_FILTER",JSON.stringify(t.gridOptions.api.getFilterModel()))}),200)},t.prototype.onBeforeSortChanged=function(){},t.prototype.onAfterSortChanged=function(){this.no_pref||this.b_init&&localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.onVirtualRowRemoved=function(t){},t.prototype.onRowClicked=function(t){var e=this.gridOptions.api.getSelectedNodes();null!=e&&null!=e[0]&&(localStorage.setItem(this.grid_key+"_POS",String(e[0].rowIndex)),localStorage.setItem(this.grid_key+"_POS_BAR",JSON.stringify(this.gridOptions.api.getVerticalPixelRange())),localStorage.setItem(this.grid_key+"_POS2",this.getRowNodeId(e[0]))),this.sRow=t.data,localStorage.setItem(this.grid_key+"_LAST_ROW",JSON.stringify(this.sRow)),this.clicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&(this.columndclicked.emit(t),this.dclicked.emit(t.data))},t.prototype.onRowDClicked=function(t){this.dclicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&this.columndclicked.emit(t)},t.prototype.onQuickFilterChanged=function(t){this.gridOptions.api.setQuickFilter(t.target.value)},t.prototype.onColumnEvent=function(t){this.columndclicked.emit(t)},t.prototype.doFill=function(t,e,i){var n=this;void 0===e&&(e=!0),void 0===i&&(i=!0),i&&(this.fix_flt=t),this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout((function(){n.ckk()}),10)},t.prototype.doFill_Temp=function(t,e){var i=this;void 0===e&&(e=!0),this.fix_flt_temp=t,this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout((function(){i.Refresh()}),10)},t.prototype.Refresh=function(){this.ref_dt()},t.prototype.RefreshOnlyMemory=function(){this.updateRow()},t}();$i.decorators=[{type:n.Component,args:[{selector:"FHGridN",template:'<div fxLayout="column" fxFlexFill>\n <div\n fxLayout="row"\n fxLayout.xs="column"\n fxLayoutAlign="center start"\n fxLayoutGap="3px"\n style="min-height: 55px;"\n [hidden]="!show_buttons"\n >\n \n <div fxLayout="row" fxLayoutGap="3px" fxLayoutAlign="start center">\n <div>\n <h5>{{num_r}} {{label_elementi | translate}}</h5>\n </div>\n \n\n <div fxLayout="row" fxLayoutAlign="start center">\n <input\n matInput\n [placeholder]="trova_label | translate"\n (keydown)="keyDownFunctioncl($event)"\n [(ngModel)]="ric_libera"\n style="\n width: 200px;\n border: 1px solid;\n min-height: 30px;\n "\n />\n </div>\n\n <div\n matTooltip="REMOVE FILTER"\n matTooltipPosition="above"\n *ngIf="show_pulisci_filtri"\n >\n <button mat-flat-button (click)="pulisci_filtri()" color="warn">\n <mat-icon>filter_none</mat-icon> \n </button>\n </div>\n <div matTooltip="AUTO SIZE" matTooltipPosition="above">\n <button\n mat-flat-button\n (click)="autoSizeAll()"\n color="accent"\n *ngIf="show_buttons"\n >\n <mat-icon>swap_horiz</mat-icon>\n </button>\n </div>\n <div fxHide fxShow.gt-sm matTooltip="FIT SIZE" matTooltipPosition="above">\n <button\n mat-flat-button\n (click)="fitSizeAll()"\n color="accent"\n *ngIf="show_buttons"\n >\n <mat-icon>keyboard_tab</mat-icon>\n </button>\n </div>\n <div fxHide fxShow.gt-sm matTooltip="Refresh" matTooltipPosition="above">\n <button\n mat-flat-button\n (click)="Refresh()"\n color="accent"\n *ngIf="show_buttons"\n >\n <mat-icon>autorenew</mat-icon>\n </button>\n </div>\n <FHFilterComboBox\n fxHide\n fxShow.gt-sm\n [hidden]="!show_buttons || pref_hidden"\n (selchange)="ch_config()"\n (fillend)="fe_cfg()"\n #gf\n init_fill="false"\n ></FHFilterComboBox>\n <div\n matTooltip="Modifica Preferenza"\n matTooltipPosition="above"\n *ngIf="curr_config!=\'-1\'"\n >\n <button\n mat-icon-button\n *ngIf="show_buttons && !pref_hidden"\n style="color: rgb(248, 105, 10);"\n >\n <mat-icon (click)="edit_config()">save</mat-icon>\n </button>\n </div>\n <div\n matTooltip="Elimina Preferenza"\n matTooltipPosition="above"\n *ngIf="curr_config!=\'-1\'"\n >\n <button\n mat-icon-button\n *ngIf="show_buttons && !pref_hidden"\n style="color: rgb(248, 105, 10);"\n >\n <mat-icon (click)="elimina_config()">delete</mat-icon>\n </button>\n </div>\n <div\n fxHide\n fxShow.gt-sm\n matTooltip="Crea Nuova Preferenza"\n matTooltipPosition="above"\n >\n <button\n mat-icon-button\n style="color: rgb(16, 98, 16);"\n *ngIf="show_buttons && !pref_hidden"\n >\n <mat-icon (click)="insert_config()">library_add</mat-icon>\n </button>\n </div>\n\n <mat-slide-toggle\n fxHide\n fxShow.gt-sm\n [hidden]="!show_buttons || pref_hidden"\n (click)="ck_flag()"\n #toggle_mantieni\n >\n {{mantieni_impostazioni}}\n </mat-slide-toggle>\n\n \n <div fxHide fxShow.gt-sm matTooltip="HELP" matTooltipPosition="above">\n <button\n mat-flat-button\n (click)="help_window()"\n color="primary"\n *ngIf="show_buttons && show_help"\n >\n <mat-icon>help</mat-icon>\n </button>\n </div>\n \n\n <img\n *ngIf="enable_export && enable_export_pdf"\n matTooltip="EXPORT PDF"\n matTooltipPosition="above"\n src="assets/icons/square-o/pdf.svg"\n style="width: 24px; height: 24px; cursor: pointer"\n (click)="print()"\n alt="Export PDF"\n width="24" height="24"\n />\n\n\n <img *ngIf="enable_export && enable_export_xls"\n matTooltip="EXPORT EXCEL"\n matTooltipPosition="above"\n src="assets/icons/square-o/xlsx.svg"\n style="width: 24px; height: 24px; cursor: pointer"\n (click)="export_excel()"\n alt="Export Excel"\n width="24" height="24"\n />\n\n </div>\n <div\n fxLayout="row"\n fxLayoutAlign="end center"\n\n [style.width]="width_max"\n *ngIf="enabled"\n >\n\n <FHGridToolBar\n (command)="docmd($event)"\n [type]="toolbar_type"\n [show_link]="show_link"\n [show_help]="show_help_bar"\n [help_label]="help_label_bar"\n [custom_commands]="toolbar_custom_commands"\n [toolbar_wkfapp]="toolbar_wkfapp"\n [elimina_label]="elimina_label"\n [sRow]="sRow"\n ></FHGridToolBar>\n </div>\n </div>\n\n\n <div fxLayout="row" style="width: 100%;" [fxFlex]="show_buttons ? 100:95">\n <ag-grid-angular\n ref-agGrid\n style="width: 100%; height: 100%;"\n id="myGrid"\n (cellDoubleClicked)="onColumnEvent($event)"\n (cellClicked)="onCellClicked($event)"\n [headerHeight]="header_h"\n [groupHeaderHeight]="header_h"\n class="ag-theme-balham"\n [singleClickEdit]="true"\n [gridOptions]="gridOptions"\n [columnDefs]="columnDefs"\n [rowData]="rowData"\n [rowSelection]="selection_mode"\n [tooltipShowDelay]="tooltipShowDelay"\n [getContextMenuItems]="enable_export ? getContextMenuItems_e:getContextMenuItems_n_e"\n (filterModified)="onFilterModified()"\n (rowDoubleClicked)="onRowDClicked($event)"\n (rowClicked)="onRowClicked($event)"\n (columnVisible)="oncolumnEverythingChanged($event)"\n (columnResized)="oncolumnEverythingChanged($event)"\n (columnMoved)="oncolumnEverythingChanged($event)"\n (cellValueChanged)="okr($event)"\n (sortChanged)="onAfterSortChanged()"\n [paginationPageSize]="num_per_pag"\n (gridReady)="onReady($event)"\n >\n </ag-grid-angular>\n </div>\n</div>\n',styles:[""]}]}],$i.ctorParameters=function(){return[{type:se},{type:i.ToastrService},{type:Dt},{type:wt},{type:h.SlimLoadingBarService},{type:e.MatDialog},{type:Ct},{type:Tt},{type:m.Clipboard}]},$i.propDecorators={tooltipShowDelay:[{type:n.Input}],elimina_label:[{type:n.Input}],export_field_aggiuntivi:[{type:n.Input}],end_point:[{type:n.Input}],tbl_name:[{type:n.Input}],columnDefs:[{type:n.Input}],num_per_pag:[{type:n.Input}],grid_key:[{type:n.Input}],enabled:[{type:n.Input}],show_link:[{type:n.Input}],show_help_bar:[{type:n.Input}],help_label_bar:[{type:n.Input}],auto_load:[{type:n.Input}],auto_height:[{type:n.Input}],enable_export:[{type:n.Input}],enabled_pag:[{type:n.Input}],show_help:[{type:n.Input}],show_num_elem:[{type:n.Input}],system_dest:[{type:n.Input}],header_h:[{type:n.Input}],selection_mode:[{type:n.Input}],init_fill:[{type:n.Input}],no_pref:[{type:n.Input}],pref_hidden:[{type:n.Input}],enable_export_pdf:[{type:n.Input}],enable_export_xls:[{type:n.Input}],enable_copy:[{type:n.Input}],full_text_added_columns:[{type:n.Input}],autosize_at_ini:[{type:n.Input}],label_elementi:[{type:n.Input}],trova_label:[{type:n.Input}],mantieni_impostazioni:[{type:n.Input}],show_buttons:[{type:n.Input}],fill_end:[{type:n.Output}],cell_edited:[{type:n.Output}],clicked:[{type:n.Output}],dclicked:[{type:n.Output}],columndclicked:[{type:n.Output}],cell_clicked:[{type:n.Output}],custom_export:[{type:n.Input}],toolbar_type:[{type:n.Input}],toolbar_wkfapp:[{type:n.Input}],toolbar_custom_commands:[{type:n.Input}],command:[{type:n.Output}],gf:[{type:n.ViewChild,args:["gf"]}],toggle_mantieni:[{type:n.ViewChild,args:["toggle_mantieni"]}],init_end:[{type:n.Output}],off_set:[{type:n.Input}],onResize:[{type:n.HostListener,args:["window:resize",["event"]]}]};var Xi=function(){function t(t,e,i,n,o){if(this.dialogRef=t,this.m_appService=e,this.toastr=i,this._trs=n,this.data=o,this.op="L",this.lbl="",this.nota="",this.hide_row_cmd=!1,this.nota_commento="",this.title="",this.comm_notrequired=0,this.prendi_in_carico=!0,this.all_users=[],null!=o&&(null!=o.commento_default&&(this.nota=o.commento_default),null!=o.comm_notrequired&&(this.comm_notrequired=o.comm_notrequired?1:0),null!=o.title&&(this.title=o.title),null!=o.lbl&&(this.lbl=o.lbl),null!=o.only_riassegna&&o.only_riassegna&&(this.op="A",this.hide_row_cmd=!0),null!=o.utenti)){this.arrAutori=o.utenti,this.all_users=JSON.parse(JSON.stringify(o.utenti)),null!=o.prendi_in_carico&&(this.prendi_in_carico=o.prendi_in_carico),this.title=this._trs.instant("ASSEGNA DOCUMENTO");for(var s=0;s<this.arrAutori.length;s++)null==this.arrAutori[s].username&&(this.arrAutori[s].username=this.arrAutori[s].idp);2==this.comm_notrequired&&(this.nota_commento=this._trs.instant(" (COMMENTO NON OBBLIGATORIO)")),null!=o&&(null!=o.commento_default&&(this.nota=o.commento_default),null!=o.comm_notrequired&&(this.comm_notrequired=o.comm_notrequired))}}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){var t=this;if("A"!=this.op||0!=this.up.getSelArr().length){var e=new Object;e.nota=this.nota,"A"==this.op?e.arrsel=this.up.getSelArr():"L"==this.op?e.arrsel=this.all_users:"C"==this.op&&this.all_users.map((function(i){i.username==t.m_appService.user&&(e.arrsel=[i])})),e.op=this.op,this.dialogRef.close(e)}else this.toastr.error("ERRORE",this._trs.instant("SELEZIONARE ALMENO UN UTENTE"),{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t}();Xi.decorators=[{type:n.Component,args:[{template:'\n <div fxLayout="column">\n <div fxFlex="100" fxLayout="row" class="dialog_header">\n\t<div fxLayout="row" fxLayoutAlign="start center" style="width:50%">{{title | translate}}</div>\n <div style="width:50%" fxLayout="row" fxLayoutAlign="end start">\n <img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" />\n</div>\n</div>\n <div\n mat-dialog-content\n fxLayout="column"\n style="font-size: 15px;min-width: 750px"\n >\n <br><br>\n <div fxLayout="row" style="font-size: 15px;min-width: 90px" fxLayoutAlign="start center" fxFlexGap="5px" fxFlex="100" [hidden]="hide_row_cmd">\n <div style="width:100px;font-weight:bold">Operazione:*</div>\n <mat-radio-group [(ngModel)]="op">\n <mat-radio-button [hidden]="prendi_in_carico" value="L">LIBERA</mat-radio-button> \n <mat-radio-button value="A">RIASSEGNA A</mat-radio-button> \n <mat-radio-button [hidden]="!prendi_in_carico" value="C">PRENDI IN CARICO</mat-radio-button>\n </mat-radio-group>\n </div>\n <div style="width:100%;height:450px" [hidden]="op!=\'A\'">\n <FHPickUsers\n #up\n [users_list]="arrAutori"\n [vis_buttons]="false"\n ></FHPickUsers>\n </div>\n\n </div>\n <br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()"> {{\'OK\' | translate }}</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n {{\'ANNULLA\' | translate }}\n </button>\n </div>\n </div>\n '}]}],Xi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:p.TranslateService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Xi.propDecorators={up:[{type:n.ViewChild,args:["up"]}]};var Zi=function(){function t(t,e,i,n,o){var s=this;this.dialogRef=t,this._dataService=e,this.toastr=i,this.apps=n,this.data=o,this.selection_mode="multiple",this.value_sel=[],this.gridOptions={debug:!1,enableRangeSelection:!0,defaultColDef:{resizable:!0,sortable:!0,floatingFilter:!0},allowContextMenuWithControlKey:!0,localeText:{page:"pagina",more:"altre",to:"a",of:"di",next:"prossima",last:"ultima",first:"prima",previous:"precedente",loadingOoo:"Caricamento...",selectAll:"Seleziona Tutto",searchOoo:"Trova...",blanks:"Vuoto",filterOoo:"Filtro...",applyFilter:"Applica Filtro...",equals:"Uguale",notEqual:"Diverso",lessThan:"Minore o Uguale",greaterThan:"Maggiore o Uguale",notContains:"Non Contiene",contains:"Contiene",startsWith:"Inizia Con",endsWith:"Finisce Con",group:"Gruppo",columns:"Colonne",rowGroupColumns:"Colonne Pivot",rowGroupColumnsEmptyMessage:"trascina le colonne per raggrupparle",valueColumns:"Colonne Valore",pivotMode:"Modalità Pivot",groups:"Gruppi",values:"Valori",pivots:"Pivots",valueColumnsEmptyMessage:"trascina le colonne per aggreare",pivotColumnsEmptyMessage:"trascina le colonne per pivot",noRowsToShow:"nessun dato",pinColumn:"Sposta Colonna",valueAggregation:"Aggregazione",autosizeThiscolumn:"Autosize colonna",autosizeAllColumns:"Autosize tutte le colonne",groupBy:"Raggruppa per",ungroupBy:"Spacca per",resetColumns:"Resetta queste colonna",expandAll:"Espandi",collapseAll:"Chiudi",toolPanel:"Impostazioni",pinLeft:"Sposta <<",pinRight:"Sposta >>",noPin:"Sposta <>",sum:"Somma",min:"Minimo",max:"Massimo",none:"Nessuno",count:"Numero",average:"Media",copy:"Copia",ctrlC:"ctrl n C",paste:"Incolla",ctrlV:"ctrl n C"}},this.cc_pro=[{color:"accent",command:"sel_tutto",icon:"select_all",label:"Seleziona Tutto"},{color:"accent",command:"desel_tutto",icon:"all_out",label:"Deseleziona tutto"}],this.defaultColDef={flex:1,minWidth:100,resizable:!0,headerCheckboxSelection:this.isFirstColumn,checkboxSelection:this.isFirstColumn},this.columnDefs=[],this.system_dest=1,this.title="",this.tbl_name="",this.tbl_flt="",this.option=0,this.init=!1,null!=o&&(null!=o.title&&(this.title=o.title),null!=o.column_defs&&(this.columnDefs=o.column_defs),null!=o.value_sel&&(this.value_sel=o.value_sel),this._dataService.doQuery(o.p_query).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(s.rowData=t.result_data,s.fe())})))}return t.prototype.onReady=function(t){this.gridApi=t.api,this.fe()},t.prototype.cmd_wkf_prog=function(t){if("sel_tutto"==t.cmd){console.log(this.rowData);for(var e=function(t){var e,n=i.rowData[t];e=n.valore,i.getGridApi().forEachNode((function(t){t.data.valore==e&&t.setSelected(!0)}))},i=this,n=0;n<this.rowData.length;n++)e(n)}if("desel_tutto"==t.cmd){var o=function(t){var e,i=s.rowData[t];e=i.valore,s.getGridApi().forEachNode((function(t){t.data.valore==e&&t.setSelected(!1)}))},s=this;for(n=0;n<this.rowData.length;n++)o(n)}},t.prototype.getGridApi=function(){return this.gridOptions.api},t.prototype.getGridOptions=function(){return this.gridOptions},t.prototype.selc=function(t){var e=this;this.option=t;var i=this.getGridApi().getSelectedNodes();this.value_sel=[],i.map((function(t){e.value_sel.push({valore:t.data})}))},t.prototype.onSelectionChanged=function(t){var e=this,i=this.getGridApi().getSelectedNodes().length;this.option=i;var n=this.getGridApi().getSelectedNodes();this.value_sel=[],n.map((function(t){e.value_sel.push(t.data)})),console.log("selectionChanged")},t.prototype.isFirstColumn=function(t){return t.columnApi.getAllDisplayedColumns()[0]===t.column},t.prototype.ngAfterViewInit=function(){},t.prototype.fe=function(){var t=this;setTimeout((function(){console.log("this.getGridApi() ",t.getGridApi(),t.value_sel),t.value_sel.map((function(e){t.getGridApi().forEachNode((function(t){t.data.valore==e.valore&&t.setSelected(!0)}))}))}),100)},t.prototype.getSelStr=function(){for(var t="",e=0;e<this.value_sel.length;e++)""!=t&&(t+=","),t+=this.value_sel[e].descrizione_valore;return t},t.prototype.getSelVal=function(){for(var t="",e=0;e<this.value_sel.length;e++)""!=t&&(t+=","),t+=this.value_sel[e].valore;return t},t.prototype.getSelArr=function(){return this.value_sel},t.prototype.ok=function(){this.dialogRef.close(this.getSelArr())},t}();Zi.decorators=[{type:n.Component,args:[{selector:"PickList",template:'\n <div fxLayout="column">\n<div fxFlex="100" fxLayout="row" fxLayoutAlign="start center" class="dialog_header"> \n<div fxLayout="row" fxLayoutAlign="start center" fxFlex="50"><div>{{title}}</div></div> \n<div fxFlex="50" fxLayout="row" fxLayoutAlign="end center">\n<div style="width: 100%;text-align:right">\n<img src="assets/icons/x.png" style="cursor: pointer;" (click)="dialogRef.close(null)" />\n</div>\n</div>\n</div>\n<hr width="100%" size="0.5" color="#DDDDDD">\n\n <div [style.height]="\'500px\'" style="width:100%;overflow:auto;">\n\n <ag-grid-angular\n ref-agGrid\n style="width: 100%; height: 100%;"\n id="myGrid"\n class="ag-theme-balham"\n [columnDefs]="columnDefs"\n [rowData]="rowData"\n (gridReady)="onReady($event)"\n [rowSelection]="selection_mode"\n [gridOptions]="gridOptions"\n (selectionChanged)="onSelectionChanged($event)"\n >\n </ag-grid-angular>\n\n </div>\n\n <br /><br />\n <div fxLayout="row" fxLayoutAlign="center center" fxLayoutGap="5px">\n <button mat-flat-button color="primary" (click)="ok()">Ok ({{value_sel.length}})</button\n > \n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="dialogRef.close()"\n >\n {{\'Annulla\' }}\n </button>\n </div> </div>\n\n ',styles:["\n .mat-dialog-content { max-height: unset !important; }\n .selector {\n cursor: hand;\n }\n "]}]}],Zi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:Dt},{type:i.ToastrService},{type:wt},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Zi.propDecorators={selection_mode:[{type:n.Input}],dtmt:[{type:n.ViewChild,args:["dtmt"]}]};var tn=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[wt,j.NgForage,Dt,Wt,Tt,Qt,ei,se,ee,Ct,pi,ue]}},t.forChilds=function(){return{ngModule:t,providers:[]}},t}();tn.decorators=[{type:n.NgModule,args:[{imports:[p.TranslateModule,z.CdkTableModule,mt.MatBadgeModule,g.MatAutocompleteModule,e.MatDialogModule,q.MatButtonModule,K.MatButtonToggleModule,V.MatCardModule,G.MatCheckboxModule,B.MatChipsModule,H.MatDatepickerModule,Y.MatExpansionModule,Q.MatFormFieldModule,W.MatGridListModule,J.MatIconModule,$.MatInputModule,X.MatListModule,Z.MatMenuModule,tt.MatProgressBarModule,et.MatProgressSpinnerModule,it.MatRadioModule,nt.MatSelectModule,ot.MatSlideToggleModule,st.MatSliderModule,at.MatSidenavModule,rt.MatSnackBarModule,lt.MatStepperModule,pt.MatTabsModule,ut.MatToolbarModule,ct.MatTooltipModule,dt.MatPaginatorModule,_t.MatSortModule,ht.MatTableModule,y.MatNativeDateModule,u.FileUploadModule,M.AgGridModule.withComponents([Jt]),b.CommonModule,U.DragulaModule,c.FormsModule,P.AgmCoreModule.forRoot({apiKey:"AIzaSyD3-g3b_QqxUruxBY4PGJKaH2fubIVXvN4"}),N.FlexLayoutModule,ft.QuillModule,F.MarkdownModule],exports:[jt,Vt,Kt,Ht,Yt,Ri,Ee,Ti,ki,Ai,Ii,gi,fi,mi,$t,Zt,te,ne,oe,ce,$i,_e,It,me,Ie,Jt,xe,Ae,Te,Gt,ke,De,Zi,Le,Re,Ne,yt,Me,re,Mt,Pe,je,Ue,bt,Ji,qe,Ge,Be,di,He,Nt,Qe,ui,We,_i,hi,Oi,zt,Rt,Ft,ie,Lt,Fe,Wi],declarations:[jt,Ut,Vt,Kt,Ht,Yt,Ri,Ee,Di,Ti,ki,Ai,Ii,wi,bi,Gt,gi,fi,mi,ci,$t,Zi,Zt,te,ne,oe,di,ce,$i,_e,It,me,Ie,Jt,xe,Ae,Te,ke,De,ae,Le,Re,Ne,yt,Me,re,Mt,Pe,je,Ue,bt,Ji,qe,Ge,Be,He,Nt,Qe,We,Je,$e,Xe,Ze,qt,ii,ni,oi,si,ai,ri,li,ti,ui,_i,hi,Oi,xi,Ei,Ci,zt,Rt,Ft,ie,Lt,Fe,Ki,Ni,Pi,Bi,Hi,Qi,Mi,zi,Ui,Vi,qi,Gi,Yi,Fi,Wi,ji,Xi],providers:[ze,U.DragulaService]}]}];var en=function(){function t(t,e,i,n,o,s,a){this.http=t,this.auth=e,this.toast=n,this.querys=o,this.slimLoadingBarService=s,this.app_s=a,this.url=this.app_s.API_ENDPOINT+this.app_s.QUERY_ENDPOINT,this.routingDestination="",this.arr_accessi=null}return t.prototype.canActivate=function(t,e){var i=this;return this.routingDestination=t.url[0].path,""==this.routingDestination||("login"==this.routingDestination||"rp"==this.routingDestination||"pr"==this.routingDestination||"/"==this.routingDestination||(this.auth.checkCredentials()?"home"==this.routingDestination||(null!=this.app_s.user_isadmin&&"1"==this.app_s.user_isadmin||new Promise((function(t){if(null!=i.arr_accessi){for(var e=0;e<i.arr_accessi.length;e++)if("M"==i.arr_accessi[e].type&&"["+i.arr_accessi[e].url.split("/")[0]+"]"=="["+i.routingDestination.split("/")[0]+"]")return void t(!0);return i.toast.error("ACCESS DENIED [0X0003]"),i.slimLoadingBarService.complete(),void t(!1)}var n=new vt;if(n.sql="SELECT_USER_ACCESS",n.values=[],n.types=[],null==i.app_s.user||null==i.app_s.user_isadmin)i.querys.doQuery(n).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){if(!(e.result_data.length>0))return i.toast.error("ACCESS DENIED [0X0002]"),i.slimLoadingBarService.complete(),t(!1),!1;if(i.app_s.user_roles=e.result_data[0].roles,null!=i.app_s.user_roles&&i.app_s.user_roles.length>0&&(i.app_s.user_roles=i.app_s.user_roles.substr(1)),null==i.app_s.user_roles&&(i.app_s.user_roles="[NO_RUOLI_CONFIGURATI]"),i.app_s.user_isadmin=e.result_data[0].isadmin,i.app_s.user=e.result_data[0].username,null!=i.app_s.user_isadmin&&"1"==i.app_s.user_isadmin)return void t(!0);var n=new vt;n.sql="SELECT_APPS_USER_ALL",i.app_s.getState().app_enabled=[],n.types=["string"],n.values=[i.app_s.user],i.querys.doQuery(n).subscribe((function(e){i.arr_accessi=e.result_data;for(var n=0;n<i.arr_accessi.length;n++)if("M"==i.arr_accessi[n].type&&"["+i.arr_accessi[n].url.split("/")[0]+"]"=="["+i.routingDestination.split("/")[0]+"]")return void t(!0);i.toast.error("ACCESS DENIED [0X0001]"),t(!1),i.slimLoadingBarService.complete()}))}}));else{var o=new vt;if(null!=i.app_s.user_isadmin&&i.app_s.user_isadmin+""=="1")return void t(!0);o.sql="SELECT_APPS_USER_ALL",i.app_s.getState().app_enabled=[],o.types=["string"],o.values=[i.app_s.user],i.querys.doQuery(o).subscribe((function(e){i.arr_accessi=e.result_data;for(var n=0;n<i.arr_accessi.length;n++)if("M"==i.arr_accessi[n].type&&"["+i.arr_accessi[n].url.split("/")[0]+"]"=="["+i.routingDestination.split("/")[0]+"]")return void t(!0);i.toast.error("ACCESS DENIED [0X0005]"),t(!1),i.slimLoadingBarService.complete()}))}}))):(this.toast.error("ACCESS DENIED [0X0004]"),this.slimLoadingBarService.complete(),!1)))},t}();en.decorators=[{type:n.Injectable}],en.ctorParameters=function(){return[{type:r.HttpClient},{type:ee},{type:d.Router},{type:i.ToastrService},{type:Dt},{type:h.SlimLoadingBarService},{type:wt}]};var nn=function(){this.result_data=new Array},on=function(){this.result_data=new Array},sn=function(){function t(t,e,i,n,o,s,a,r,l,p){this.app_s=t,this.m_service=e,this.m_dataService=i,this.m_fservice=n,this.m_router=o,this._toastr=s,this.dialog=a,this.m_wkf=r,this.m_uti=l,this.tsr=p,this.b_editing=!1,this.is_Supervisor=!1,this.is_Visor=!1,this.is_Admin=!1,this.is_PowerUser=!1,this.is_Ins=!1,this.id_applicativo="",this.codice_app="",this.att_panelcat="",this.documento_pubblico=!1,this.titolo_email="",this.tbl_name="",this.app_root="",this.grid_key="",this.m_id_Doc="",this.title="",this.user_nome="",this.user_cognome="",this.user_email="",this.b_initd=!1,this.nota_wax="",this.is_init=!1,this.imp="",this.m_cod_documento="",this.sort_field="",e.checkCredentials()&&(this.ripristina_imp(),null==this.sort_field&&(this.sort_field=""),""==this.sort_field&&(this.sort_field="case when CHARINDEX('"+this.user_idp+"',autori)>0 then 1 else 0 end desc,codice desc"))}return t.prototype.goto_edit_doc=function(t,e){this.m_router.navigate([this.app_root,t,e,"edit"])},t.prototype.cmd_wkf=function(t){"annulla_richiesta"==t.cmd&&this.annulla_richiesta(),"recupera_richiesta"==t.cmd&&this.recupera_richiesta(),"riassegna_richiesta"==t.cmd&&this.riassegna_richiesta(),"sostituisci_utente"==t.cmd&&this.sostituisci_utente(),"reclama_bozza"==t.cmd&&this.reclama_bozza(),"annulla_imp"==t.cmd&&this.annulla_imp(),"test_utente"==t.cmd&&this.test_utente(),"insert_doc"==t.cmd&&this.insert_doc()},t.prototype.annulla_richiesta=function(){var t=this;null!=this.get_grid().sRow?(localStorage.setItem(this.app_s.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.app_s.COMPANY_KEY+"msg_dialog","Confermi di voler annullare il documento numero: "+this.get_grid().sRow.codice+"?"),this.dialog.open(It,{disableClose:!0}).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="UPDATE_WKF_ANNULATO",i.types=["string","string","int"],i.values=[t.id_applicativo,t.get_grid().sRow.uiid,-1],t.m_dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.get_grid().doFill("")}))}}))):this._toastr.error("Selezionare il documento da annullare")},t.prototype.reclama_bozza=function(){var t=this;null!=this.get_grid().sRow?this.dialog.open(It,{disableClose:!0,data:{title_dialog:"Conferma Operazione",msg_dialog:"Confermi di voler assegnarti il documento?"}}).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="SELECT_DOCUMENTS_BY_UIID",i.types=["string","string"],i.values=[t.id_applicativo,t.get_grid().sRow.uiid],t.m_dataService.doQuery(i).subscribe((function(e){var n=e.result_data[0].stato;(i=new vt).sql="SELECT_WKF_SELECT_USER_MIN",i.types=["string","string"],i.values=[t.id_applicativo,t.get_grid().sRow.uiid],t.m_dataService.doQuery(i).subscribe((function(e){for(var i=!1,o=0,s="",a=0;a<e.result_data.length;a++)if(e.result_data[a].idp==t.app_s.user){o=e.result_data[a].livello,s=e.result_data[a].descri_livello,i=!0;break}if(i){if(o!=n)return void t._toastr.error("Il documento non è in stato Bozza");var r=new vt;r.sql="UPDATE_WKF_STATO_BOZZA",r.types=["string","string","int","string"],r.values=[t.id_applicativo,t.get_grid().sRow.uiid,o,s],t.m_dataService.doQuery(r).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toastr.info("Documento aggiornato"),t.get_grid().doFill(""))}))}else t._toastr.error("L'utente non è configurato per lo step BOZZA")}))}))}})):this._toastr.error("Selezionare il documento")},t.prototype.recupera_richiesta=function(){var t=this,e=this.dialog.open(si,{disableClose:!0});setTimeout((function(){e.componentInstance.init_w(t.id_applicativo)})),e.afterClosed().subscribe((function(e){"ok"==e&&t.get_grid().doFill("")}))},t.prototype.sostituisci_utente=function(){var t=this;if(null!=this.get_grid().sRow){var e=new vt;e.sql="SELECT_USERS_BY_WKF_DOC",e.types=["string","string"],e.values=[this.id_applicativo,this.get_grid().sRow.uiid],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=t.dialog.open(li,{disableClose:!0,width:"450px"});setTimeout((function(){i.componentInstance.up.all_user=e.result_data,i.componentInstance.title="Sostituzione utente: "+t.get_grid().sRow.codice+" - "+t.get_grid().sRow.oggetto})),i.afterClosed().subscribe((function(e){if(null!=e&&null!=e.result&&"ok"==e.result){var i=new vt;i.sql="UPDATE_USER_WORKFLOW",i.types=["string","string","string","string"],i.values=[t.id_applicativo,t.get_grid().sRow.uiid,e.u1,e.u2],t.m_dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t._toastr.info("Workflow Aggiornato")}))}}))}}))}else this._toastr.error("Selezionare il documento")},t.prototype.riassegna_richiesta=function(){var t=this;if(null!=this.get_grid().sRow){var e=new vt;e.sql="SELECT_WLIVELLIV2ADM",e.types=["string","string","string"],e.values=[this.id_applicativo,this.get_grid().sRow.uiid,this.get_grid().sRow.stato];this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.livs_adm=e.result_data;for(var i=new Array,n="",o=0;o<t.livs_adm.length;o++)-1==n.indexOf(String(t.livs_adm[o].livello))&&(n=n+String(t.livs_adm[o].livello)+"|",i.push(t.livs_adm[o]));var s=t.dialog.open(ai,{disableClose:!0,width:"600px"});setTimeout((function(){s.componentInstance.setStepCombo(i),s.componentInstance.title=t.tsr.instant("Riassegnazione documento")+": "+t.get_grid().sRow.codice+" - "+t.get_grid().sRow.oggetto})),s.afterClosed().subscribe((function(e){null!=e&&null!=e.result&&"ok"==e.result&&(t.os_r=e.lvl_sel,t.riassegna_richiesta_step1())}))}}))}else this._toastr.error("Selezionare il documento da riassegnare")},t.prototype.riassegna_richiesta_step1=function(){for(var t=this,e=new Array,i=0;i<this.livs_adm.length;i++)this.livs_adm[i].livello==this.os_r.livello&&0==this.livs_adm[i].notifica&&e.push(this.livs_adm[i]);var n=this.dialog.open(ri,{disableClose:!0,width:"850px"});for(i=0;i<e.length;i++)null!=e[i].nc?e[i].nc=e[i].nc.split(" ()").join(""):e[i].nc=e[i].username,null!=e[i].idp&&null==e[i].username&&(e[i].username=e[i].idp);setTimeout((function(){n.componentInstance.arrAutori=e,n.componentInstance.title=t.tsr.instant("Riassegnazione documento")+": "+t.get_grid().sRow.codice+" - "+t.get_grid().sRow.oggetto})),n.afterClosed().subscribe((function(e){null!=e&&null!=e.result&&"ok"==e.result&&(t.wax=e.arrsel,t.nota_wax=e.nota,t.riassegna_richiesta_step2())}))},t.prototype.riassegna_richiesta_step2=function(){var t=this;console.log("riassegna_richiesta_step2() ");var e="",i=[],n=new vt;n.sql="DELETE_TODO_ALL_BYID",n.types=["string","string"],n.values=[this.id_applicativo,this.get_grid().sRow.uiid],i.push(this.m_dataService.doQuery(n)),null!=this.get_grid().sRow.lettori&&(e=this.get_grid().sRow.lettori);var o="",s="",a="",r="";null!=this.get_grid().sRow.partecipanti&&(r=this.get_grid().sRow.partecipanti);var l="",p="XCXXX";console.log("this.wax ",this.wax);for(var u=0;u<this.wax.length;u++){var c=new vt;if(c.sql="INSERT_TODO_GEST",c.types=["string","string","string","string","string","string","string"],c.values=[this.id_applicativo,this.get_grid().sRow.uiid,this.wax[u].idp,this.get_grid().sRow.oggetto,this.title,this.get_grid().sRow.descrizione,this.app_s.COMPANY_SITE_ROOT+"/#/"+this.app_root+"/"+this.id_applicativo+"/"+this.get_grid().sRow.uiid+"/edit"],i.push(this.m_dataService.doQuery(c)),"XCXXX"!=p&&p!=this.wax[u].gruppo_parallelo)return void this._toastr.error("impossibile assegnare a utenti di gruppi distiniti");p=this.wax[u].gruppo_parallelo,""!=l&&(l+=","),l+=this.wax[u].idp,-1==e.indexOf(this.wax[u].idp)&&(""!=e&&(e+=","),e+=this.wax[u].idp),-1==s.indexOf(this.wax[u].nc)&&(""!=s&&(s+=","),s+=this.wax[u].nc),""!=a&&(a+=","),a+=this.wax[u].nc,null!=r&&-1==r.indexOf(this.wax[u].idp)&&(""!=r&&(r+=","),r+=this.wax[u].idp),""!=o&&(o+=","),o+=this.wax[u].idp}console.log("op ",i),_.forkJoin(i).subscribe((function(t){})),this.sendEMail_ex(this.user_idp,l,this.titolo_email+"L'utente "+this.user_cognome+" "+this.user_nome+" ti ha riassegnato il documento: "+this.get_grid().sRow.codice,"Commento:\n\n"+this.nota_wax,this.id_applicativo,this.get_grid().sRow.uiid,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_root+"/"+this.id_applicativo+"/"+this.get_grid().sRow.uiid+"/edit",this.get_grid().sRow.uiid,this.nota_wax);var d=new vt;d.sql="INSERT_COMMENTO_RIASS",d.types=["string","string","string","string","string","int","int"],d.values=[this.id_applicativo,this.get_grid().sRow.uiid,"Documento riassegnato a "+a,this.user_idp,this.os_r.descri_livello,this.get_grid().sRow.stato,this.os_r.livello];this.m_dataService.doQuery(d).subscribe((function(t){null!=t&&t.result_msg}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}));var h="$$";this.wax.length>0&&null!=this.wax[0].gruppo_parallelo&&""!=this.wax[0].gruppo_parallelo&&(h=this.wax[0].gruppo_parallelo),console.log("riassegnazione canale: ",h),(d=new vt).sql="UPDATE_RIASS_DOCUMENTO",d.types=["string","string","string","string","string","string","string","string","string","string",h],d.values=[this.os_r.livello,this.os_r.descri_livello,e,o,this.os_r.descri_livello,s,r,this.get_grid().sRow.id_applicativo,this.get_grid().sRow.uiid],this.m_dataService.doQuery(d).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.get_grid().Refresh()}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})),(d=new vt).sql="INSERT_WKF_COMMENTO",d.types=["string","string","string","string","string"],d.values=[this.id_applicativo,this.get_grid().sRow.uiid,"Documento riassegnato, commento:\n"+this.nota_wax,this.user_idp,""],this.m_dataService.doQuery(d).subscribe((function(t){null!=t&&t.result_msg}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})),this.wax.length>0&&((d=new vt).sql="UPDATE_RIASSEGNA_TODO",d.types=["string","string"],d.values=[this.wax[0].idp,this.get_grid().sRow.uiid],!1,this.m_dataService.doQuery(d).subscribe((function(t){null!=t&&t.result_msg}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,a,r,l,p){if(void 0===p&&(p=""),null!=e&&""!=e){var u=new vt;u.sql="send_wkf_mail",u.values=[t,e,i,n.split("\n").join("<br>"),o,s,a,r,l,p],this.m_wkf.doQuery(u).subscribe((function(t){}))}},t.prototype.annulla_imp=function(){var t=this,e=new vt;e.sql="SELECT_CURRENT_USER_INFOS",e.types=[],e.values=[],this.m_dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.app_s.user_name=e.result_data[0].nome,t.app_s.user=e.result_data[0].username,t.app_s.user_surname=e.result_data[0].cognome,t.app_s.user_email=e.result_data[0].email,t.user_idp=e.result_data[0].username,t.user_nome=e.result_data[0].nome,t.user_cognome=e.result_data[0].cognome,t.user_email=e.result_data[0].email)})),this.app_s.user_name_ori=null,this.app_s.user_ori=null,this.app_s.user_surname_ori=null,this.app_s.user_email_ori=null,this.imp="",localStorage.removeItem(this.app_s.COMPANY_KEY+"_imp_user"),this.get_grid().doFill("")},t.prototype.test_utente=function(){var t=this,e=new vt;e.sql="SELECT_UTENTI_WORKFLOW",e.types=["string"],e.values=[this.id_applicativo],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=t.dialog.open(ri,{disableClose:!0,width:"850px"});setTimeout((function(){i.componentInstance.arrAutori=e.result_data,i.componentInstance.title="Impersona Utente",i.componentInstance.commento_hidden=!0})),i.afterClosed().subscribe((function(e){if(null!=e&&null!=e.result&&"ok"==e.result){var i=new vt;i.sql="SELECT_USER_INFO_WKF",i.types=["string"],i.values=[e.arrsel[0].username],t.m_dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.app_s.user_name_ori=t.app_s.user_name,t.app_s.user_ori=t.app_s.user,t.app_s.user_surname_ori=t.app_s.user_surname,t.app_s.user_email_ori=t.app_s.user_email,t.app_s.user_name=e.result_data[0].nome,t.app_s.user=e.result_data[0].username,t.app_s.user_surname=e.result_data[0].cognome,t.app_s.user_email=e.result_data[0].email,t.user_idp=e.result_data[0].username,t.user_nome=e.result_data[0].nome,t.user_cognome=e.result_data[0].cognome,t.user_email=e.result_data[0].email,t.imp="ANN. IMP: "+e.result_data[0].cognome+" "+e.result_data[0].nome,localStorage.setItem(t.app_s.COMPANY_KEY+"_imp_user",t.m_uti.encrypt_v3(JSON.stringify(e.result_data[0]))),t.get_grid().doFill(""))}))}}))}}))},t.prototype.ripristina_imp=function(){if(null!=localStorage.getItem(this.app_s.COMPANY_KEY+"_imp_user")){var t=null;try{t=JSON.parse(this.m_uti.decrypt_v3(localStorage.getItem(this.app_s.COMPANY_KEY+"_imp_user")))}catch(t){}null!=t&&(this.app_s.user_name_ori=this.app_s.user_name,this.app_s.user_ori=this.app_s.user,this.app_s.user_surname_ori=this.app_s.user_surname,this.app_s.user_email_ori=this.app_s.user_email,this.app_s.user_name=t.nome,this.app_s.user=t.username,this.app_s.user_surname=t.cognome,this.app_s.user_email=t.email,this.user_idp=t.username,this.user_nome=t.nome,this.user_cognome=t.cognome,this.user_email=t.email,this.imp="ANN. IMP: "+t.cognome+" "+t.nome)}},t.prototype.save_state_wkf=function(){this.app_s.getState().wkf_obj={},this.app_s.getState().wkf_obj.b_editing=this.b_editing,this.app_s.getState().wkf_obj.is_Supervisor=this.is_Supervisor,this.app_s.getState().wkf_obj.is_Visor=this.is_Visor,this.app_s.getState().wkf_obj.is_Admin=this.is_Admin,this.app_s.getState().wkf_obj.is_PowerUser=this.is_PowerUser,this.app_s.getState().wkf_obj.is_Ins=this.is_Ins,this.app_s.getState().wkf_obj.id_applicativo=this.id_applicativo,this.app_s.getState().wkf_obj.codice_app=this.codice_app,this.app_s.getState().wkf_obj.att_panelcat=this.att_panelcat,this.app_s.getState().wkf_obj.documento_pubblico=this.documento_pubblico,this.app_s.getState().wkf_obj.titolo_email=this.titolo_email,this.app_s.getState().wkf_obj.tbl_name=this.tbl_name,this.app_s.getState().wkf_obj.grid_key=this.grid_key,this.app_s.getState().wkf_obj.m_id_Doc=this.m_id_Doc,this.app_s.getState().wkf_obj.livs=this.livs,this.app_s.getState().wkf_obj.user_idp=this.user_idp,this.app_s.getState().wkf_obj.app_root=this.app_root,this.app_s.getState().wkf_obj.title=this.title},t.prototype.restore_state_wkf=function(){this.b_editing=this.app_s.getState().wkf_obj.b_editing,this.is_Visor=this.app_s.getState().wkf_obj.is_Visor,this.is_Supervisor=this.app_s.getState().wkf_obj.is_Supervisor,this.is_Admin=this.app_s.getState().wkf_obj.is_Admin,this.is_PowerUser=this.app_s.getState().wkf_obj.is_PowerUser,this.is_Ins=this.app_s.getState().wkf_obj.is_Ins,this.id_applicativo=this.app_s.getState().wkf_obj.id_applicativo,this.codice_app=this.app_s.getState().wkf_obj.codice_app,this.att_panelcat=this.app_s.getState().wkf_obj.att_panelcat,this.documento_pubblico=this.app_s.getState().wkf_obj.documento_pubblico,this.titolo_email=this.app_s.getState().wkf_obj.titolo_email,this.tbl_name=this.app_s.getState().wkf_obj.tbl_name,this.grid_key=this.app_s.getState().wkf_obj.grid_key,this.m_id_Doc=this.app_s.getState().wkf_obj.m_id_Doc,this.livs=this.app_s.getState().wkf_obj.livs,this.user_idp=this.app_s.getState().wkf_obj.user_idp,this.app_root=this.app_s.getState().wkf_obj.app_root,this.title=this.tsr.instant(this.app_s.getState().wkf_obj.title),this.m_uti.set_home_title(this.tsr.instant(this.att_panelcat))},t.prototype.init_Panel=function(t,e){this.m_id_Doc=e,this.m_cod_documento=t,this.do_init()},t.prototype.run_grid=function(){var t=this;null!=this.get_grid()&&this.get_grid().ready?this.init_grid():setTimeout((function(){t.run_grid()}),500)},t.prototype.self_ok=function(){var t=this;null==this.get_grid()?setTimeout((function(){t.self_ok()}),500):this.get_grid().refresh_access(this)},t.prototype.do_init=function(){var t=this;if(null!=this.app_s.user_ori&&(this.imp="ANN. IMP: "+this.app_s.user_name+" "+this.app_s.user_surname),this.user_idp=this.app_s.user,null!=this.user_idp){null==this.sort_field&&(this.sort_field=""),""==this.sort_field&&(this.sort_field="case when CHARINDEX('"+this.user_idp+"',autori)>0 then 1 else 0 end desc,codice desc");var e=new vt;e.sql="SELECT_WKF_APP_INFO",e.types=["string"],e.values=[this.m_cod_documento],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;t.id_applicativo=i[0].id_gruppo,t.app_root=i[0].modulo_swf,t.codice_app=i[0].codice_documento,t.att_panelcat=i[0].descrizione_breve,t.documento_pubblico=i[0].pubblico,t.titolo_email="["+i[0].descrizione_breve+"]",t.tbl_name=i[0].vista_sql,t.grid_key=t.app_s.COMPANY_KEY+i[0].vista_sql,t.user_idp=t.app_s.user,t.user_nome=t.app_s.user_name,t.user_cognome=t.app_s.user_surname,t.user_email=t.app_s.user_email,t.m_uti.set_home_title(t.att_panelcat);var n=new vt;n.sql="SELECT_UTENTE_WKF_ADMIN",n.types=["string","string"],n.values=[t.id_applicativo,t.app_s.user],t.m_dataService.doQuery(n).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;t.is_Supervisor=!1,t.is_Admin=!1,t.is_PowerUser=!1,i.length>0&&("0"==i[0].tipo&&(t.is_Supervisor=!0),"1"==i[0].tipo&&(t.is_Admin=!0,t.is_Supervisor=!0),"2"==i[0].tipo&&(t.is_PowerUser=!0));var n=new vt;n.sql="SELECT_WLIVELLIV2",n.types=["string","string"],n.values=[t.id_applicativo,""],t.m_dataService.doQuery(n).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.ok_conf_s(e.result_data);var i=new vt;i.sql="SELECT_ROLES_VISORI",i.types=["string"],i.values=[t.id_applicativo],t.m_dataService.doQuery(i).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.is_Visor=!1;for(var i=0;i<e.result_data.length;i++)if(t.m_uti.hasRole(e.result_data[i].name,!1)){t.is_Visor=!0;break}t.run_grid(),t.self_ok()}}))}}))}}))}}))}else setTimeout((function(){t.do_init()}),500)},t.prototype.ok_conf_s=function(t){this.livs=t,this.is_Ins=!1;for(var e=0;e<this.livs.length;e++)if(null!=this.livs[e].idp&&null!=this.user_idp&&(this.livs[e].idp.toUpperCase()==this.user_idp.toUpperCase()||"*ALLUSERS"==this.livs[e].gruppo_parallelo)&&this.livs[e].livello<=10&&0==this.livs[e].notifica){this.is_Ins=!0,"*ALLUSERS"==this.livs[e].gruppo_parallelo&&(this.livs[e].gruppo_parallelo="",this.livs[e].idp=this.user_idp);break}this.save_state_wkf(),this.parse_url(),this.b_editing&&(this.returnedit(),this.b_editing=!1)},t.prototype.returnedit=function(){},t.prototype.parse_url=function(){for(var t=this.m_router.routerState.snapshot.url.split(/[\&?]+/),e=0;e<t.length;e++)if(t[e]=="/"+this.app_root+"/new")return void this.insert_doc()},t.prototype.goto_models=function(){this.m_router.navigate([this.app_root,"models"])},t.prototype.insert_doc=function(){this.m_router.navigate([this.app_root,this.id_applicativo,"new"])},t}(),an=function(){function t(t,e,i,n,o,s,a,r,l){this.app_s=t,this.m_service=e,this.m_dataService=i,this.m_router=n,this.m_dialog=o,this.m_route=s,this.m_wkf=a,this.uti_s=r,this.tsr=l,this.m_obj={},this.b_rip_pulsanti=!0,this.save_alreadypressed=!1,this.b_respingi=!1,this.limite_salto_after=-1,this.respingi_enabled=!1,this.email_bloccate=!1,this.appo_livs=null,this.oper="",this.b_edit_before=!1,this.all_c=0,this.comm_c=0,this.forza_canale="",this.forza_canale_curr="",this.c_canale="",this.user_nome="",this.user_cognome="",this.user_email="",this.bEdit=!1,this.bEdit_wkf=!1,this.bEditOp_wkf=!1,this.bEditAp_wkf=!1,this.bEditAss_wkf=!1,this.bEditBozza_wkf=!1,this.bEdit_bozza=!1,this.bNuovaRev_Agg=!1,this.hide_richiedente=!1,this.bEdit_Agg=!1,this.btnSalva_label="SALVA",this.btnTerminaOp_label="Termina Attività",this.btnApprova_label="APPROVA",this.btnAssegna_label="Assegna",this.btnRespingi_label="RESPINGI",this.id_documento="",this.m_autori="",this.m_lettori="",this.m_liv=0,this.m_statox="",this.m_danotificare="",this.m_oper="",this.m_autori_paralleli="",this.m_crea_att=0,this.m_send_email=0,this.errorMsg="",this.id_applicativo="",this.rich="",this.cod="",this.simple_mode=!1,this.oggetto_editable=!1,this.descrizione_editable=!1,this.btnSalva_visible=!1,this.b_PrendiInCarico=!1,this.stat_stato_text="",this.creatore_text="",this.pers_int_text="",this.rich_enabled=!1,this.oggetto_text="",this.descrizione_text="",this.btnprocedi=!1,this.b_edit=!1,this.b_valid=!0,this.s_uto="",this.b_apprf=!1}return t.prototype.ripristina_imp=function(){if(null==localStorage.getItem(this.app_s.COMPANY_KEY+"_imp_user"))return this.user_idp=this.app_s.user,this.user_nome=this.app_s.user_name,this.user_cognome=this.app_s.user_surname,void(this.user_email=this.app_s.user_email);var t=null;try{t=JSON.parse(this.uti_s.decrypt_v3(localStorage.getItem(this.app_s.COMPANY_KEY+"_imp_user")))}catch(t){}if(null==t)return this.user_idp=this.app_s.user,this.user_nome=this.app_s.user_name,this.user_cognome=this.app_s.user_surname,void(this.user_email=this.app_s.user_email);this.app_s.user_name_ori=this.app_s.user_name,this.app_s.user_ori=this.app_s.user,this.app_s.user_surname_ori=this.app_s.user_surname,this.app_s.user_email_ori=this.app_s.user_email,this.app_s.user_name=t.nome,this.app_s.user=t.username,this.app_s.user_surname=t.cognome,this.app_s.user_email=t.email,this.user_idp=t.username,this.user_nome=t.nome,this.user_cognome=t.cognome,this.user_email=t.email},t.prototype.init_user_i=function(){this.ripristina_imp()},t.prototype.save_to_app_state=function(){this.app_s.getState().wkf_doc_info={},this.app_s.getState().wkf_doc_info.curr_user=this.user_idp,this.app_s.getState().wkf_doc_info.codice=this.m_obj.codice,this.app_s.getState().wkf_doc_info.data_richiesta=this.m_obj.data_richiesta,this.app_s.getState().wkf_doc_info.richiedente=this.m_obj.nc+" ("+this.m_obj.richiesta_da+")",this.app_s.getState().wkf_doc_info.in_carico_a=this.m_obj.in_carico_a,this.app_s.getState().wkf_doc_info.stato=this.m_obj.stat_stato,this.app_s.getState().wkf_doc_info.uiid_app=this.id_applicativo,this.app_s.getState().wkf_doc_info.uiid_doc=this.m_obj.id_documento,this.app_s.getState().wkf_doc_info.canale=this.m_obj.canale},t.prototype.evt_salv=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!1),this.b_rip_pulsanti=t,this.btnprocedi=!1,e&&!this.ck_field()||this.salva()},t.prototype.salva=function(){var t=this;if(!this.save_alreadypressed)if(this.save_alreadypressed=!0,setTimeout((function(){t.save_alreadypressed=!1}),1e3),""==this.m_obj.codice){if("respingi"==this.oper)return void this.alert("Errore di configurazione pratica contattare ufficio IT [0x001]",1);this.ck_canale_multiplo()}else this.save_agg()},t.prototype.doApprova=function(){this.b_respingi=!1,this.over_canale_iniz(),this.over_canale_curr();var t=0;if(this.nlevel=null,0==this.m_obj.stato)for(var e=0;e<this.livs.length;e++)(this.livs[e].livello<t||0==t)&&(this.clevel=this.livs[e],t=this.livs[e].livello);else{if(t=this.m_obj.stato,console.log(this.livs,t),null!=this.m_obj.canale)for(e=0;e<this.livs.length;e++)if(this.livs[e].livello==t&&this.user_idp.toUpperCase()==this.livs[e].idp.toUpperCase()&&(console.log(this.livs[e].idp.toUpperCase()+" "+this.m_obj.canale+" "+this.livs[e].gruppo_parallelo),0==this.livs[e].notifica&&this.m_obj.canale==this.livs[e].gruppo_parallelo)){this.clevel=this.livs[e];break}if(console.log("this.clevel1 ",this.clevel),null==this.clevel)for(e=0;e<this.livs.length;e++)if(this.livs[e].livello==t&&!(this.user_idp.toUpperCase()!=this.livs[e].idp.toUpperCase()&&"*ALLUSERS"!=this.livs[e].gruppo_parallelo||0!=this.livs[e].notifica||""!=this.c_canale&&""!=this.livs[e].gruppo_parallelo&&this.c_canale!=this.livs[e].gruppo_parallelo&&"*ALLUSERS"!=this.livs[e].gruppo_parallelo)){this.clevel=this.livs[e];break}console.log("this.clevel2 ",this.clevel)}if(console.log("this.clevel3 ",this.clevel),this.clevel=this.check_n_levels(this.clevel),null!=this.clevel&&""!=this.clevel){var i=t;if("procedi"==this.oper&&1==this.clevel.salto_iniziale){t=this.clevel.livello;for(e=0;e<this.livs.length;e++)this.user_idp.toUpperCase()==this.livs[e].idp.toUpperCase()&&0==this.livs[e].notifica&&this.livs[e].livello>t&&0!=t&&this.livs[e].livello!=i&&(-1==this.limite_salto_after||this.livs[e].livello<this.limite_salto_after)&&(this.clevel=this.livs[e],t=this.livs[e].livello);for(var n=this.wkf_rule(t),o=0;o<this.livs.length;o++)if(this.livs[o].livello==n&&this.user_idp.toUpperCase()==this.livs[o].idp.toUpperCase()&&(""==this.c_canale||""==this.livs[o].gruppo_parallelo||this.c_canale==this.livs[o].gruppo_parallelo)){this.clevel=this.livs[o],t=this.livs[o].livello;break}}if("procedi"==this.oper){if(this.clevel=this.check_n_levels(this.clevel),null==this.clevel.livelli_jump&&(this.clevel.livelli_jump=""),""!=this.clevel.livelli_jump)return void this.selectLevel(this.clevel.livelli_jump);this.calcolanextandjump()}if("respingi"==this.oper){if(null==this.clevel.livelli_down&&(this.clevel.livelli_down=""),""!=this.clevel.livelli_down)return void this.selectLevel(this.clevel.livelli_down);this.alert("Errore di configurazione pratica contattare ufficio IT [0x004]",1)}}else this.alert("Errore di configurazione pratica contattare ufficio IT [0x002]",1)},t.prototype.selectLevel=function(t){var e=this;this.app_s.getState().wkf_doc_info.livs=this.livs,this.app_s.getState().wkf_doc_info.st=t,this.app_s.getState().wkf_doc_info.cl=this.clevel,this.m_dialog.open(Ze,{disableClose:!0,width:"800px"}).afterClosed().subscribe((function(t){if(null!=t){var i=t;if("Prosegui a step successivo"!=t.descri_livello)if("Prosegui a chiusura"!=t.descri_livello){i=e.wkf_rule(i);var n=!1;for(o=0;o<e.livs.length;o++)e.user_idp.toUpperCase()==e.livs[o].idp.toUpperCase()&&0==e.livs[o].notifica&&e.livs[o].livello==i&&(e.nlevel=e.livs[o],i=e.livs[o].livello,n=!0);if(!n)for(o=0;o<e.livs.length;o++)if(e.livs[o].livello==i&&0==e.livs[o].notifica){e.nlevel=e.livs[o],i=e.livs[o].livello;break}e.doJump()}else{i=0;for(var o=0;o<e.livs.length;o++)e.livs[o].livello<900&&e.livs[o].livello>i&&0==e.livs[o].notifica&&(e.clevel=e.livs[o],i=e.livs[o].livello);e.calcolanextandjump()}else e.calcolanextandjump()}else e.edit_b(!0,!1)}))},t.prototype.calcolanextandjump=function(){var t=0,e=1e5;t=this.clevel.livello;for(var i=0;i<this.livs.length;i++)(0==t||t<this.livs[i].livello&&e>this.livs[i].livello)&&(this.nlevel=this.livs[i],e=this.livs[i].livello);t=this.wkf_rule(e),console.log("this.wkf_rule ",e,t);for(var n=!1,o=0;o<this.livs.length;o++)0!=this.livs[o].notifica||""!=this.clevel.gruppo_parallelo&&this.clevel.gruppo_parallelo!=this.livs[o].gruppo_parallelo||this.livs[o].livello==t&&(this.nlevel=this.livs[o],t=this.livs[o].livello,n=!0);if(!n)for(var s=0;s<this.livs.length;s++)if(this.livs[s].livello==t&&0==this.livs[s].notifica){this.nlevel=this.livs[s],t=this.livs[s].livello;break}console.log("this.nlevel ",e,t);var a=t,r=this.nlevel;if(2==this.nlevel.salto_iniziale){for(var l=0;l<this.livs.length;l++)r.idp.toUpperCase()==this.livs[l].idp.toUpperCase()&&0==this.livs[l].notifica&&r.gruppo_parallelo==this.livs[l].gruppo_parallelo&&this.livs[l].livello>a&&0!=a&&(this.nlevel=this.livs[l],t=this.livs[l].livello);e=t}this.ck_after(t)&&this.doJump()},t.prototype.doJump=function(){var t=this;if(null!=this.nlevel){var e=new Array;if(console.log("livs ",this.livs),""==this.clevel.gruppo_parallelo)for(var i=0;i<this.livs.length;i++)this.livs[i].livello==this.nlevel.livello&&0==this.livs[i].notifica&&e.push(this.livs[i]);else{var n=!1;for(i=0;i<this.livs.length;i++)this.livs[i].livello==this.nlevel.livello&&""!=this.livs[i].gruppo_parallelo&&(n=!0);for(i=0;i<this.livs.length;i++)this.livs[i].livello==this.nlevel.livello&&0==this.livs[i].notifica&&(this.clevel.gruppo_parallelo!=this.livs[i].gruppo_parallelo&&n||(e.push(this.livs[i]),this.nlevel=this.livs[i]))}if(0!=e.length)if(0==this.nlevel.assegnazione_manuale){this.app_s.getState().wkf_doc_info.title=this.tsr.instant("Avanzamento");var o="";for(i=0;i<e.length;i++)null!=e[i].nc&&-1==o.indexOf(e[i].nc)&&(""!=o&&(o+=";"),o+=e[i].nc);this.app_s.getState().wkf_doc_info.utenti="",this.nlevel.livello<900?this.app_s.getState().wkf_doc_info.lbl=this.tsr.instant("Il documento verrà inviato a")+" "+this.tsr.instant(this.nlevel.descri_livello):this.app_s.getState().wkf_doc_info.lbl=this.tsr.instant("La richiesta verrà chiusa con stato")+" "+this.tsr.instant(this.nlevel.descri_livello),this.app_s.getState().wkf_doc_info.utenti=o,this.app_s.getState().wkf_doc_info.comm_notrequired=this.nlevel.commenti_opzionali;var s=this.m_dialog.open($e,{disableClose:!0,data:{commento_default:this.app_s.temp_var4,comm_notrequired:this.nlevel.commenti_opzionali}});this.app_s.temp_var4="",s.afterClosed().subscribe((function(i){if("abort"==i)return t.edit_b(!0,!1),void(t.respingi_enabled&&t.resp_b(!0));t.arrUsersSelected=e,t.nota=i,t.OKCOM()}))}else{this.app_s.getState().wkf_doc_info.title=this.tsr.instant("Assegnazione"),this.app_s.getState().wkf_doc_info.comm_notrequired=this.nlevel.commenti_opzionali,this.app_s.getState().wkf_doc_info.arrAutori=e.sort((function(t,e){return t.nc>e.nc?1:t.nc<e.nc?-1:0})),null==this.app_s.temp_var4&&(this.app_s.temp_var4="");s=this.m_dialog.open(Je,{disableClose:!0,data:{commento_default:this.app_s.temp_var4,comm_notrequired:this.nlevel.commenti_opzionali}});this.app_s.temp_var4="",s.afterClosed().subscribe((function(e){if(""==e||null==e)return t.edit_b(!0,!1),void(t.respingi_enabled&&t.resp_b(!0));t.arrUsersSelected=e.arrsel,t.nota=e.nota,t.OKCOM()}))}else this.alert("problema di configurazione il livello "+this.nlevel.descri_livello+" non presenta utenti partecipanti validi",1)}else this.alert("problema di configurazione passaggio avanti dal livello "+this.clevel.descri_livello+" non attivato comunicare al CED",1)},t.prototype.back=function(t){var e=this,i=this.uti_s.get_diff_doc(this.old_doc,this.getfieldvalues());console.log(i);for(var n=[],o=0;o<i.length;o++)"-1"==i[o].val&&(i[o].val=""),"-1"==i[o].oldVal&&(i[o].oldVal="")," "==i[o].val&&(i[o].val="")," "==i[o].oldVal&&(i[o].oldVal=""),i[o].val instanceof Number&&i[o].oldVal instanceof String&&(i[o].oldVal=Number(i[o].oldVal.split(",").join(".")));for(o=0;o<i.length;o++)("update"!=i[o].op||"date"!=i[o].val&&"string"!=i[o].val)&&("add"==i[o].op&&null==i[o].val&&""==i[o].oldVal||i[o].val!=i[o].oldVal&&(""==i[o].val&&"0"==i[o].oldVal||"0"==i[o].val&&null==i[o].oldVal||i[o].val instanceof Date||n.push(i[o])));for(o=0;o<i.length;o++)i[o].val instanceof Date&&new Date(i[o].val).getTime()!=new Date(i[o].oldVal).getTime()&&n.push(i[o]);(console.log("arrx ",n,t,!t||0==n.length),t&&0!=n.length)?this.m_dialog.open(We,{disableClose:!0}).afterClosed().subscribe((function(t){"esci_senza_salv"==t&&e.m_router.navigate([e.app_info.modulo_swf]),"salva_esci"==t&&(e.evt_salv(),e.m_router.navigate([e.app_info.modulo_swf]))})):this.m_router.navigate([this.app_info.modulo_swf])},t.prototype.OKCOM=function(){var t=this;this.m_lettori=this.m_obj.lettori,null==this.m_lettori&&(this.m_lettori=this.m_obj.partecipanti),null==this.m_lettori&&(this.m_lettori=""),""==this.m_lettori&&(this.m_lettori=this.app_s.user),this.m_danotificare="",this.m_autori="";for(var e="",i=0;i<this.arrUsersSelected.length;i++)1==this.nlevel.email_partecipanti&&(""!=this.m_danotificare&&(this.m_danotificare=this.m_danotificare+","),this.m_danotificare=this.m_danotificare+this.arrUsersSelected[i].idp),-1==this.m_lettori.toLowerCase().indexOf(this.arrUsersSelected[i].idp.toLowerCase())&&(""!=this.m_lettori&&(this.m_lettori=this.m_lettori+","),this.m_lettori=this.m_lettori+this.arrUsersSelected[i].idp),-1==this.m_autori.toLowerCase().indexOf(this.arrUsersSelected[i].idp.toLowerCase())&&(""!=this.m_autori&&(this.m_autori=this.m_autori+","),""!=e&&(e+=","),this.m_autori=this.m_autori+this.arrUsersSelected[i].idp,e+=this.arrUsersSelected[i].nc);""!=this.nota&&this.insert_commento(this.id_applicativo,this.id_documento,this.nota,this.user_idp),this.m_liv=this.nlevel.livello,this.m_statox=this.tsr.instant("Assegnata a")+": "+e,this.m_autori_paralleli="",this.m_obj.assegnati_paralleli="",this.chstato(this.m_liv),this.m_obj.stato<=10&&(null==this.m_obj.creatore||""==this.m_obj.creatore?this.insert_wkf_variabile(this.id_applicativo,this.id_documento,"REQUESTER",this.user_idp):this.insert_wkf_variabile(this.id_applicativo,this.id_documento,"REQUESTER",this.m_obj.creatore));for(i=0;i<this.livs.length;i++)this.livs[i].livello==this.m_liv&&1==this.livs[i].notifica&&(1==this.livs[i].email_ospiti&&(""!=this.m_danotificare&&(this.m_danotificare=this.m_danotificare+","),this.m_danotificare=this.m_danotificare+this.livs[i].idp),-1==this.m_lettori.toLowerCase().indexOf(this.livs[i].idp.toLowerCase())&&(""!=this.m_lettori&&(this.m_lettori=this.m_lettori+","),this.m_lettori=this.m_lettori+this.livs[i].idp));var n,o="$$";for(i=0;i<this.livs.length;i++)if(this.livs[i].livello==this.clevel.livello&&this.livs[i].idp==this.app_s.user){if("$$"!=o){o="$$";break}o=this.livs[i].gruppo_parallelo}this.m_autori=Array.from(new Set(this.m_autori.split(","))).join(","),this.m_lettori=Array.from(new Set(this.m_lettori.split(","))).join(","),this.m_danotificare=Array.from(new Set(this.m_danotificare.split(","))).join(","),null==this.m_obj.partecipanti&&(this.m_obj.partecipanti=""),null!=this.m_autori&&""!=this.m_autori&&(this.m_obj.partecipanti=this.m_obj.partecipanti+","+Array.from(new Set(this.m_autori.split(","))).join(",")),n=this.app_info.documento_pubblico?new Array(this.m_autori,"",this.m_liv,this.m_statox,this.m_autori_paralleli,this.m_obj.assegnati_paralleli,this.getLvlDescri(String(this.m_liv),this.m_statox),this.getUsersList(this.m_autori,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento,o):new Array(this.m_autori,this.m_lettori,this.m_liv,this.m_statox,this.m_autori_paralleli,this.m_obj.assegnati_paralleli,this.getLvlDescri(String(this.m_liv),this.m_statox),this.getUsersList(this.m_autori,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento,o);var s=new Array;for(i=0;i<n.length;i++)s.push("string");this.m_crea_att=1,this.m_liv>=900&&(this.m_crea_att=0),this.b_respingi&&(this.m_oper="Respinta"),null!=this.clevel&&null!=this.clevel.descri_livello&&(this.m_oper=this.m_oper+" - "+this.clevel.descri_livello),null!=this.nlevel&&null!=this.nlevel.descri_livello&&(this.m_oper=this.m_oper+" -> "+this.nlevel.descri_livello);var a=new vt;a.sql="doWKF",a.values=[this.app_info.descrizione_breve,this.m_obj.codice,this.m_autori,this.m_danotificare,this.m_obj.codice+" - "+this.getTitle(),this.getTitle()+"Il documento: "+this.m_obj.codice+" è passato allo stato: "+this.m_statox,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit","In approvazione",this.getDescri(),this.user_idp,this.m_statox,this.m_oper,this.id_applicativo,this.id_documento,""+this.m_crea_att,""+this.m_send_email,""+this.clevel.livello,""+this.nlevel.livello],this.insert_wkf_variabile(this.id_applicativo,this.id_documento,this.clevel.livello+"_PLAYER",this.user_idp),this.m_wkf.doQuery(a).subscribe((function(t){null!=t&&t.result_msg})),(a=new vt).sql="UPDATE_WKF_DOCUMENTOV3_NS",a.values=n,a.types=s,this.m_dataService.doQuery(a).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){if(t.nlevel.livello>=900){t.doEnd(t.nlevel.livello);var i=new vt;i.sql="UPDATE_DATA_CHIUSURA",i.values=[t.id_applicativo,t.id_documento],i.types=["string","string"],t.m_dataService.doQuery(i).subscribe((function(t){null!=t&&t.result_msg}))}(a=new vt).sql="exec_app_workflow",a.values=[t.app_info.codice_documento,t.id_documento,""+t.clevel.livello,""+t.nlevel.livello,t.user_idp],t.m_wkf.doQuery(a).subscribe((function(t){}))}}));var r=null,l="";""!=this.nota&&(l="<br>Commento: <br>"+this.nota),1==this.nlevel.ical&&(null==this.m_obj.ical_dt_ini?this.alert("Attenzione ical non configurato ical_dt_ini",1):null==this.m_obj.ical_dt_fin?this.alert("Attenzione ical non configurato ical_dt_fin",1):r={start:this.m_obj.ical_dt_ini,end:this.m_obj.ical_dt_fin,summary:this.app_info.descrizione_breve+" "+this.getTitle(),description:this.getDescri()+l+"<br>"+this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",organizer:this.user_nome+" "+this.user_cognome+" <"+this.user_email+">",url:this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit"});var p=this.nlevel.oggetto_email;for(var u in null==p&&(p=""),null!=this.nlevel&&null!=this.nlevel.descri_livello&&(p=p.split("%new_step%").join(this.nlevel.descri_livello)),null!=this.clevel&&null!=this.clevel.descri_livello&&(p=p.split("%old_step%").join(this.clevel.descri_livello)),p=(p=p.split("%new_step%").join("")).split("%old_step%").join(""),this.m_obj)null!=this.m_obj[u]&&(console.log(u+" "+Object.prototype.toString.call(this.m_obj[u])),p="[object Date]"===Object.prototype.toString.call(this.m_obj[u])?p.split("%"+u+"%").join(this.uti_s.date2String(this.m_obj[u])):-1==(""+this.m_obj[u]).indexOf("T00:00:00")?p.split("%"+u+"%").join(this.m_obj[u]):p.split("%"+u+"%").join(this.uti_s.date2String(this.uti_s.string2date(this.m_obj[u],2))));if(""!=this.m_danotificare)if(1==this.clevel.ccn_mittente&&(""!=this.m_danotificare&&(this.m_danotificare=this.m_danotificare+","),this.m_danotificare=this.m_danotificare+this.user_idp),1==this.nlevel.approvazione_email);else if(1==this.nlevel.email_partecipanti||1==this.nlevel.email_ospiti)if(this.b_respingi)this.sendEMail_ex(this.user_idp,this.m_danotificare,"Respinta "+this.getTitle()+"-["+this.m_obj.codice+"]","<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+l,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota,!0,r);else{var c="";c=-1==this.getTitle().indexOf("NOSTD|")?this.app_info.descrizione_breve+", Ti è stato assegnato il documento numero: "+this.m_obj.codice+" "+this.getTitle()+" - "+this.getLvlDescri(String(this.m_liv),this.m_statox):this.getTitle().split("NOSTD|").join("");var d="";d=-1==this.getDescri().indexOf("NOSTD|")?"<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+l:this.getDescri().split("NOSTD|").join(""),null==this.nlevel.oggetto_email||""==this.nlevel.oggetto_email?this.sendEMail_ex(this.user_idp,this.m_danotificare,c,d+l,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota,!0,r):this.sendEMail_ex(this.user_idp,this.m_danotificare,p,"<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+l,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota,!0,r)}else this.goto_edit_doc();if(console.log("this.nlevel ",this.nlevel),console.log("this.nlevel.tipo_notifica_aggiuntiva ",this.nlevel.tipo_notifica_aggiuntiva),""==p&&(p=this.app_info.descrizione_breve+", Il documento numero: "+this.m_obj.codice+" è passato allo STEP: "+this.nlevel.descri_livello+" "+this.getTitle()),0!=this.nlevel.tipo_notifica_aggiuntiva){if(1==this.nlevel.tipo_notifica_aggiuntiva&&this.sendEMail_ex(this.user_idp,this.m_obj.creatore,p,this.m_statox+"<br>"+this.getDescri()+l,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota,!0,r,!1),2==this.nlevel.tipo_notifica_aggiuntiva){console.log("SELECT_PARTECIPANTI_DOC ");var _=new vt;_.sql="SELECT_PARTECIPANTI_DOC",_.values=[this.id_applicativo,this.id_documento],_.types=["string","string"],this.m_dataService.doQuery(_).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=t.user_idp,n=0;n<e.result_data.length;n++)-1==i.indexOf(e.result_data[n].username)&&(i+=",",i+=e.result_data[n].username);console.log("lista_p ",i),t.sendEMail_ex(t.user_idp,i,p,t.m_statox+"<br>"+t.getDescri()+l,t.id_applicativo,t.id_documento,t.app_s.COMPANY_SITE_ROOT+"#/"+t.app_info.modulo_swf+"/"+t.id_applicativo+"/"+t.id_documento+"/edit",t.m_obj.codice,t.nota,!0,r,!1)}}))}if(3==this.nlevel.tipo_notifica_aggiuntiva){var h=new vt;h.sql="SELECT_ALL_USERS_DOC",h.values=[this.id_applicativo,this.id_documento],h.types=["string","string"],this.m_dataService.doQuery(h).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=t.user_idp,n=0;n<e.result_data.length;n++)-1==i.indexOf(e.result_data[n].username)&&(console.log("username:",e.result_data[n].username),i+=",",i+=e.result_data[n].username);t.sendEMail_ex(t.user_idp,i,p,t.m_statox+"<br>"+t.getDescri()+l,t.id_applicativo,t.id_documento,t.app_s.COMPANY_SITE_ROOT+"#/"+t.app_info.modulo_swf+"/"+t.id_applicativo+"/"+t.id_documento+"/edit",t.m_obj.codice,t.nota,!0,r,!1)}}))}}this.goto_edit_doc()},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,a,r,l,p,u,c){var d=this;if(void 0===p&&(p=!0),void 0===u&&(u=""),void 0===c&&(c=!0),console.log("this.email_bloccate ",this.email_bloccate),null!=e)if(""!=e)if(this.email_bloccate)c&&this.goto_edit_doc(p);else{var _=new vt;_.sql="send_wkf_mail",e=(e=e.split(t+",").join("")).split(","+t).join(""),null==u&&(u=""),""!=u&&(u=JSON.stringify(u)),_.values=[t,e,i,n.split("\n").join("<br>"),o,s,a,r,l,u],this.m_wkf.doQuery(_).subscribe((function(t){c&&d.goto_edit_doc(p)}))}else c&&this.goto_edit_doc(p);else c&&this.goto_edit_doc(p)},t.prototype.goto_edit_doc=function(t){void 0===t&&(t=!0),this.m_router.navigate([this.app_info.modulo_swf]),t&&this.alert("Avanzamento effettuato",0)},t.prototype.addOverrideLvlUser=function(t){null==this.override_livs&&(this.override_livs=[]),this.override_livs.push(t),this.apply_over_load()},t.prototype.overwriteLivs=function(t){this.appo_livs=JSON.parse(JSON.stringify(t))},t.prototype.getLvlInfo=function(t){for(var e=0;e<this.livs.length;e++)if(t==this.livs[e].livello)return this.livs[e];return null},t.prototype.insert_commento=function(t,e,i,n){var o=new vt;o.sql="INSERT_WKF_COMMENTO",o.values=[t,e,i,n,""],o.types=["string","string","string","string","string"],this.m_dataService.doQuery(o).subscribe((function(t){null!=t&&t.result_msg}))},t.prototype.insert_wkf_variabile=function(t,e,i,n){var o=new vt;o.sql="insert_wkf_variabile",o.values=[t,e,i,n],this.m_wkf.doQuery(o).subscribe((function(t){null!=t&&t.result_msg}))},t.prototype.respingi=function(){this.oper="respingi",this.btnprocedi=!0,this.edit_b(!1,!1),this.resp_b(!1),this.salva()},t.prototype.procedi=function(){if(this.oper="procedi",this.btnprocedi=!0,this.edit_b(!1,!1),this.resp_b(!1),!this.ck_field())return this.edit_b(!0,!1),void(this.respingi_enabled&&this.resp_b(!0));this.salva()},t.prototype.open_wkf=function(t,e){var i=this;void 0===t&&(t=!1),void 0===e&&(e=!0),console.log("inser_c = false,edit_c=true ",t,e);var n=this.app_s.getState().body_h-40+"px",o=this.m_dialog.open(oi,{disableClose:!0,width:"95%",height:n,data:{edit_c:e}});setTimeout((function(){o.componentInstance.subject=i.app_info.descrizione_breve+", <OP>: "+i.m_obj.codice+" "+i.getTitle(),null!=i.m_obj.lettori?o.componentInstance.lettori=i.m_obj.lettori:o.componentInstance.lettori="",o.componentInstance.link=i.app_s.COMPANY_SITE_ROOT+"#/"+i.app_info.modulo_swf+"/"+i.id_applicativo+"/"+i.id_documento+"/edit",o.componentInstance.codice_doc=i.m_obj.codice,o.componentInstance.notifica_commenti=i.app_info.notifica_commenti,o.componentInstance.notifica_commenti_obbl=i.app_info.notifica_commenti_obbl,o.componentInstance.commenti_insert=t,o.componentInstance.init_v()})),o.afterClosed().subscribe((function(t){i.r_count()}))},t.prototype.open_commenti=function(){var t=this,e=this.m_dialog.open(ii,{disableClose:!0,width:"90%"});setTimeout((function(){e.componentInstance.subject=t.app_info.descrizione_breve+", <OP>: "+t.m_obj.codice+" "+t.getTitle(),null!=t.m_obj.lettori?e.componentInstance.lettori=t.m_obj.lettori:e.componentInstance.lettori="",e.componentInstance.link=t.app_s.COMPANY_SITE_ROOT+"#/"+t.app_info.modulo_swf+"/"+t.id_applicativo+"/"+t.id_documento+"/edit",e.componentInstance.codice_doc=t.m_obj.codice,e.componentInstance.notifica_commenti=t.app_info.notifica_commenti,e.componentInstance.notifica_commenti_obbl=t.app_info.notifica_commenti_obbl,e.componentInstance.init_v()})),e.afterClosed().subscribe((function(e){t.r_count()}))},t.prototype.open_upload=function(t,e){var i=this;void 0===t&&(t=""),void 0===e&&(e="[ZZZ_DIS_CC]"),console.log("open_upload ",t,e);var n=this.m_dialog.open(qt,{disableClose:!0,width:"90%",data:{admin_role:e,App:this.id_applicativo,K:this.id_documento}});setTimeout((function(){n.componentInstance.sovrascrivi_path=t})),n.afterClosed().subscribe((function(t){i.r_count()}))},t.prototype.create_new_document=function(){var t=this,e=new vt;e.sql="insert_new_doc",null==this.c_canale&&(this.c_canale=""),e.values=[this.id_applicativo,this.id_documento,this.c_canale,this.user_idp],this.m_wkf.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.save_agg()}))},t.prototype.save_agg=function(){var t=this;this.b_edit_before=this.b_edit&&this.b_rip_pulsanti,this.edit_b(!1,!1);var e=this.getfieldvalues(),i=new vt;i.sql="insert_aggiuntivi",i.types=["string","string"],i.values=[this.app_info.tabella_dati,this.id_documento],i.names=["tabella","id_documento"];for(var n=0;n<e.length;n++)i.types.push(e[n].types),i.names.push(e[n].names),null==e[n].values?e[n].values="dbnull":("boolean"==e[n].types&&(e[n].values?e[n].values="1":e[n].values="0"),"int"==e[n].types&&(e[n].values+""==""?e[n].values="dbnull":isNaN(e[n].values)?e[n].values="0":e[n].values=""+e[n].values),"string"==e[n].types&&(e[n].values=""+e[n].values),"date"==e[n].types&&(e[n].values=this.uti_s.sql_date(e[n].values),"NaN-NaN-NaN"==e[n].values.split("0").join("")&&(e[n].values="dbnull")),"datetime"==e[n].types&&(console.log("typeof ",typeof e[n].values,e[n].values),e[n].values=this.uti_s.sql_date_time(e[n].values),console.log("arr[i].values ",e[n].values),"NaN-NaN-NaN NaN:NaN"==e[n].values.split("0").join("")&&(e[n].values="dbnull")),"string"==e[n].types&&null==e[n].values&&(e[n].values="dbnull"),"decimal"==e[n].types&&(e[n].values+""==""?e[n].values="dbnull":isNaN(e[n].values)?e[n].values="0":e[n].values=""+e[n].values)),i.values.push(e[n].values);this.m_wkf.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.ok_insert_aggiuntivi()}),(function(t){}))},t.prototype.ok_insert_aggiuntivi=function(){this.btnprocedi?this.b_edit||this.btnprocedi?this.load_document():this.m_router.navigate([this.app_info.modulo_swf,this.id_applicativo,this.id_documento,"edit"]):(this.alert("DOCUMENTO SALVATO",0),this.saved_event(),this.edit_b(this.b_edit_before,!0),this.b_edit||this.btnprocedi||this.m_router.navigate([this.app_info.modulo_swf,this.id_applicativo,this.id_documento,"edit"]))},t.prototype.load_document=function(){var t=this,e=new vt;e.sql="SELECT_WKF_DOCUMENT_NOREP",e.types=["string","string","string"],e.values=[this.app_info.vista_sql,this.id_applicativo,this.id_documento],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;i.length>0?t.ok_load_document(i[0]):t.alert("DOCUMENTO NON TROVATO",1)}}),(function(t){}))},t.prototype.ok_load_document=function(t){var e=this;this.m_obj=JSON.parse(JSON.stringify(t)),this.edit_b(!1,!1),this.save_to_app_state();var i=new vt;i.sql="SELECT_LIVELLI_DOC",i.types=["string","string"],i.values=[this.id_applicativo,this.id_documento],this.m_dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.ok_livelli_doc(t.result_data)}))},t.prototype.apply_over_load=function(){if(null!=this.override_livs&&null!=this.livs)for(var t=0;t<this.override_livs.length;t++)for(var e=0;e<this.livs.length;e++)null!=this.livs[e].id_Applicativo&&this.livs[e].id_Applicativo==this.override_livs[t].id_Applicativo&&(this.livs[e].idp=this.override_livs[t].idp,this.livs[e].gruppo_parallelo=this.override_livs[t].gruppo_parallelo,this.livs[e].nc=this.override_livs[t].nc);null!=this.appo_livs&&(this.livs=JSON.parse(JSON.stringify(this.appo_livs)))},t.prototype.ok_livelli_doc=function(t){if(this.livs=t,this.apply_over_load(),this.over_canale_iniz(),this.over_canale_curr(),this.m_obj.stato<=10)for(var e=0;e<this.livs.length;e++)this.livs[e].idp.toUpperCase()!=this.user_idp.toUpperCase()&&"*ALLUSERS"!=this.livs[e].gruppo_parallelo||10==this.livs[e].livello&&0==this.livs[e].notifica&&"*ALLUSERS"==this.livs[e].gruppo_parallelo&&(this.livs[e].gruppo_parallelo="",this.livs[e].idp=this.user_idp);!this.b_edit||this.btnprocedi?this.btnprocedi&&this.doApprova():this.return_edit()},t.prototype.r_count=function(){var t=this,e=new vt;e.sql="SELECT_WKF_ALLEGATI_COUNTER",e.types=["string","string"],e.values=[this.id_applicativo,this.id_documento],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=e.result_data,n=0,o=0,s=0;s<i.length;s++)i[s].n>0&&("ALLEGATI"==i[s].v&&(n=i[s].n),"COMMENTI"==i[s].v&&(o=i[s].n));t.reset_counters_int(o,n)}}),(function(t){}))},t.prototype.reset_counters_int=function(t,e){t>0&&(this.comm_c=t),e>0&&(this.all_c=e)},t.prototype.set_canale_iniziale=function(t){this.forza_canale=t},t.prototype.over_canale_iniz=function(){if(""!=this.forza_canale){for(var t=0,e=0;e<this.livs.length;e++)(this.livs[e].livello<t||0==t)&&(t=this.livs[e].livello);for(e=0;e<this.livs.length;e++)this.livs[e].livello==t&&(this.livs[e].gruppo_parallelo=this.forza_canale);this.m_obj.stato<20&&(this.m_obj.canale=this.forza_canale),this.c_canale=this.forza_canale}},t.prototype.over_canale_curr=function(){if(""!=this.forza_canale_curr&&null!=this.m_obj.stato){for(var t=0,e=0;e<this.livs.length;e++)this.livs[e].livello==this.m_obj.stato&&(t=this.livs[e].livello);for(e=0;e<this.livs.length;e++)this.livs[e].livello==t&&(this.livs[e].gruppo_parallelo=this.forza_canale_curr);this.m_obj.stato<20&&(this.m_obj.canale=this.forza_canale_curr),this.c_canale=this.forza_canale_curr}},t.prototype.ck_canale_multiplo=function(){for(var t=this,e=0,i=0;i<this.livs.length;i++)(this.livs[i].livello<e||0==e)&&0==this.livs[i].notifica&&(this.clevel=this.livs[i],e=this.livs[i].livello);var n=[];for(i=0;i<this.livs.length;i++)this.livs[i].livello==e&&0==this.livs[i].notifica&&this.app_s.getState().wkf_doc_info.curr_user.toUpperCase()==this.livs[i].idp.toUpperCase()&&(null!=this.livs[i].gruppo_parallelo?n.push(this.livs[i].gruppo_parallelo):n.push(""));n.length<=1?(this.c_canale=n[0],this.create_new_document()):(this.app_s.getState().wkf_doc_info.canali_arr=n.sort((function(t,e){return t>e?1:t<e?-1:0})),this.m_dialog.open(Xe,{disableClose:!0}).afterClosed().subscribe((function(e){null!=e&&""!=e&&(t.c_canale=e,t.create_new_document())})))},t.prototype.open_info=function(){var t=this;this.s_uto="";for(var e=this.m_obj.autori.split(","),i=0;i<e.length;i++)for(var n=0;n<this.livs.length;n++)if(this.livs[n].idp==e[i]){""!=this.s_uto&&(this.s_uto=this.s_uto+","),this.s_uto=this.s_uto+this.livs[n].nc;break}this.app_s.getState().wkf_doc_info.in_carico_a=this.s_uto,this.m_obj.s_uto=this.s_uto;var o=this.m_dialog.open(ni,{disableClose:!0,data:this.m_obj});setTimeout((function(){o.componentInstance.hide_richiedente=t.hide_richiedente})),o.afterClosed().subscribe((function(t){}))},t.prototype.setForceJump=function(t,e,i){var n=this;void 0===e&&(e=""),void 0===i&&(i=!0);for(var o,s="",a="",r="",l="",p="",u=0;u<this.livs.length;u++)t!=this.livs[u].livello||""!=e&&!this.livs[u].canale||(1==this.livs[u].email_ospiti&&1==this.livs[u].notifica||1==this.livs[u].email_partecipanti&&0==this.livs[u].notifica)&&(""!=a&&(a+=","),a+=this.livs[u].idp),t!=this.livs[u].livello||0!=this.livs[u].notifica||""!=e&&!this.livs[u].canale||(""!=s&&(s+=","),s+=this.livs[u].idp,""!=l&&(l+=","),l+=this.livs[u].nc,p=this.livs[u].descri_livello,null!=this.livs[u].oggetto_email&&""!=this.livs[u].oggetto_email&&(r=this.livs[u].oggetto_email));if(""==s)return"NESSUN UTENTE CONFIGURATO STEP: "+t+" CANALE: "+e;a=Array.from(new Set(a.split(","))).join(","),null==this.m_obj.partecipanti&&null!=this.m_obj.autori&&(this.m_obj.partecipanti=Array.from(new Set(this.m_obj.autori.split(","))).join(",")),this.m_obj.partecipanti=Array.from(new Set(this.m_obj.partecipanti.split(","))).join(","),o=this.app_info.documento_pubblico?[s,"",t,this.tsr.instant("Assegnata a")+": "+l,"","",this.getLvlDescri(String(t),this.tsr.instant("Assegnata a")+": "+l),this.getUsersList(l,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento,e]:[s,this.m_obj.partecipanti+","+s,t,this.tsr.instant("Assegnata a")+":"+l,"","",this.getLvlDescri(String(t),this.tsr.instant("Assegnata")+": "+l),this.getUsersList(l,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento,e],console.log("update documento --\x3e ",o);var c=[];for(u=0;u<o.length;u++)c.push("string");var d=new vt;return d.sql="exec_app_workflow",d.values=[this.app_info.codice_documento,this.id_documento,""+this.m_obj.stato,""+t,this.user_idp],this.m_wkf.doQuery(d).subscribe((function(t){})),(d=new vt).sql="UPDATE_WKF_DOCUMENTOV3_NS",d.values=o,d.types=c,this.m_dataService.doQuery(d).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var o=new vt;o.sql="doWKF",o.values=[n.app_info.descrizione_breve,n.m_obj.codice,""+t,""+t,n.m_obj.codice+" - "+n.getTitle(),n.getTitle()+"La scheda numero: "+n.m_obj.codice+" è passata allo stato: "+p,n.app_s.COMPANY_SITE_ROOT+"#/"+n.app_info.modulo_swf+"/"+n.id_applicativo+"/"+n.id_documento+"/edit","In approvazione",n.getDescri(),n.user_idp,p,"",n.id_applicativo,n.id_documento,"1","0",""+n.m_obj.stato,""+t],n.insert_wkf_variabile(n.id_applicativo,n.id_documento,n.m_obj.stato+"_PLAYER",n.user_idp);n.m_wkf.doQuery(o).subscribe((function(t){if(null!=t&&"OK"==t.result_msg)if(i&&""!=a){var e=r;for(var o in n.m_obj)null!=n.m_obj[o]&&(console.log(o+" "+Object.prototype.toString.call(n.m_obj[o])),e="[object Date]"===Object.prototype.toString.call(n.m_obj[o])?e.split("%"+o+"%").join(n.uti_s.date2String(n.m_obj[o])):-1==(""+n.m_obj[o]).indexOf("T00:00:00")?e.split("%"+o+"%").join(n.m_obj[o]):e.split("%"+o+"%").join(n.uti_s.date2String(n.uti_s.string2date(n.m_obj[o],2))));var s="";s=-1==n.getTitle().indexOf("NOSTD|")?n.app_info.descrizione_breve+", Ti è stato assegnato il documento numero: "+n.m_obj.codice+" "+n.getTitle()+" - "+n.getLvlDescri(String(n.m_liv),n.m_statox):n.getTitle().split("NOSTD|").join("");var l="";l=-1==n.getDescri().indexOf("NOSTD|")?"<br>Attività:"+n.getLvlDescri(String(n.m_liv),n.m_statox)+"<br>"+n.m_statox+"<br>"+n.getDescri():n.getDescri().split("NOSTD|").join(""),""==e?n.sendEMail_ex(n.user_idp,a,s,l,n.id_applicativo,n.id_documento,n.app_s.COMPANY_SITE_ROOT+"#/"+n.app_info.modulo_swf+"/"+n.id_applicativo+"/"+n.id_documento+"/edit",n.m_obj.codice,"",!0,""):n.sendEMail_ex(n.user_idp,a,e+" - "+n.getLvlDescri(String(n.m_liv),n.m_statox),"<br>Attività:"+n.getLvlDescri(String(n.m_liv),n.m_statox)+"<br>"+n.m_statox+"<br>"+n.getDescri(),n.id_applicativo,n.id_documento,n.app_s.COMPANY_SITE_ROOT+"#/"+n.app_info.modulo_swf+"/"+n.id_applicativo+"/"+n.id_documento+"/edit",n.m_obj.codice,"",!0,"")}else n.goto_edit_doc()})),!0}n.alert(e.msg,1)}),(function(t){})),"OK"},t.prototype.insert_doc=function(){var t=this;this.m_autori=this.user_idp,this.m_lettori="",this.m_liv=0,this.m_statox="",this.m_danotificare="",this.m_oper="",this.m_autori_paralleli="",this.m_crea_att=0,this.m_send_email=0,this.clevel=null,this.nlevel=null,this.m_obj=new Object,this.id_documento=this.uti_s.newGuid(),this.m_obj.id_documento=this.id_documento,this.m_obj.codice="",this.m_obj.data_richiesta=new Date,this.m_obj.richiedente=this.user_idp,this.m_obj.autori=this.user_idp,this.m_obj.stato=0,this.m_obj.stat_stato="In Creazione",this.m_obj.richiesta_da=this.user_idp,this.m_obj.in_carico_a="",this.m_obj.nc=this.user_cognome+" "+this.user_nome,this.c_canale="",this.dtr=new Date,this.rich=this.user_idp,this.cod="",this.dt_scad=null,this.m_statox="",this.oggetto_editable=!0,this.descrizione_editable=!0,this.btnSalva_visible=!0,this.b_PrendiInCarico=!1,this.stat_stato_text="Bozza",this.creatore_text=this.user_cognome+" "+this.user_nome,this.pers_int_text=this.user_cognome+" "+this.user_nome,this.rich_enabled=!0,this.oggetto_text="",this.descrizione_text="",this.m_obj.stato_txt="",this.m_obj.stato=0,this.bEdit=!0,this.bEdit_wkf=!1,this.bEditOp_wkf=!1,this.bEditAp_wkf=!1,this.bEditAss_wkf=!1,this.bEditBozza_wkf=!1,this.bEdit_bozza=!1,this.bNuovaRev_Agg=!1,this.bEdit_Agg=this.bEdit_wkf,this.btnSalva_label="SALVA",this.btnTerminaOp_label="Termina Attività",this.btnApprova_label="APPROVA",this.btnAssegna_label="Assegna",this.btnRespingi_label="RESPINGI",this.uti_s.set_home_title(this.tsr.instant(this.app_info.descrizione_breve)+" - "+this.tsr.instant("Nuova Richiesta")),this.reset_form(this.tsr.instant(this.app_info.descrizione_breve)+" - "+this.tsr.instant("Nuova Richiesta")),this.old_doc=JSON.parse(JSON.stringify(this.getfieldvalues())),this.reset_counters_int(0,0);var e=new vt;e.sql="SELECT_WLIVELLIV2",e.types=["string","string"],e.values=[this.id_applicativo,""];this.m_dataService.doQuery(e).subscribe((function(e){var i=!1;null!=e&&"OK"==e.result_msg&&(console.log(e.result_data),t.ok_livw2(e.result_data),i=!0),i||(t.errorMsg=e.msg)}),(function(t){})),this.save_to_app_state()},t.prototype.ok_livw2=function(t){this.livs=t;for(var e=0,i=0;i<this.livs.length;i++)(this.livs[i].livello<e||0==e)&&(e=this.livs[i].livello);console.log("min_liv ",e);for(i=0;i<this.livs.length;i++)if(e==this.livs[i].livello&&(this.user_idp.toUpperCase()==this.livs[i].idp.toUpperCase()||"*ALLUSERS"==this.livs[i].gruppo_parallelo)){1==this.livs[i].abilita_indietro?this.respingi_enabled=!0:this.respingi_enabled=!1,this.edit_b(!0,!1);break}},t.prototype.saved_event=function(){},t.prototype.edit_doc=function(){this.load_document()},t.prototype.return_edit=function(){for(var t=0;t<this.livs.length;t++)if(this.livs[t].livello==this.m_obj.stato){1==this.livs[t].abilita_indietro?this.respingi_enabled=!0:this.respingi_enabled=!1;break}null==this.m_obj.autori&&(this.m_obj.autori=""),-1!=(","+this.m_obj.autori.toLowerCase()+",").indexOf(","+this.user_idp.toLowerCase()+",")&&(this.edit_b(!0,!1),this.respingi_enabled&&this.resp_b(!0)),this.r_count(),this.s_uto="";var e=this.m_obj.autori.split(",");for(t=0;t<e.length;t++)for(var i=0;i<this.livs.length;i++)if(this.livs[i].idp==e[t]){""!=this.s_uto&&(this.s_uto=this.s_uto+","),this.s_uto=this.s_uto+this.livs[i].nc;break}this.app_s.getState().wkf_doc_info.in_carico_a=this.s_uto,null==this.m_obj.v?this.uti_s.set_home_title(this.tsr.instant(this.app_info.descrizione_breve)+" "+this.m_obj.codice+" - "+this.tsr.instant(this.m_obj.stat_stato)):this.uti_s.set_home_title(this.tsr.instant(this.app_info.descrizione_breve)+" "+this.m_obj.codice+"/"+this.m_obj.v+" - "+this.tsr.instant(this.m_obj.stat_stato)),this.reset_form(this.tsr.instant(this.app_info.descrizione_breve)+" "+this.m_obj.codice+" - "+this.tsr.instant(this.m_obj.stat_stato)),this.old_doc=JSON.parse(JSON.stringify(this.getfieldvalues()))},t.prototype.onResize=function(t){},t.prototype.init_engine=function(){var t=this;null!=this.app_s.user&&(this.user_idp=this.app_s.user),console.log("this.user_idp ",this.user_idp),null!=this.user_idp?(this.init_user_i(),this.m_route.params.subscribe((function(e){t.onResize();var i=e.op;if(t.id_applicativo=e.idapp,t.id_documento=e.id_doc,t.b_edit="new"!=i,t.b_edit||t.id_applicativo.indexOf("_")>-1&&(t.simple_mode=!0,t.id_applicativo=t.id_applicativo.split("_").join("")),t.b_valid=!!t.id_applicativo,t.b_valid){var n=new vt;n.sql="SELECT_WKF_APP_INFO_BYUID",n.types=["string"],n.values=[t.id_applicativo];t.m_dataService.doQuery(n).subscribe((function(e){var i=!1;null!=e&&"OK"==e.result_msg&&(e.result_data.length>0?(t.setta_info_app(e.result_data[0]),t.b_edit?t.edit_doc():t.insert_doc()):t.alert("CODICE APPLICAZIONE NON VALIDO",2),i=!0),i||t.alert(e.msg,2)}),(function(t){}))}else t.alert("PARAMETRO APPLICAZIONE NON VALIDO",2)}))):setTimeout((function(){t.init_engine()}),100)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.init_engine()}))},t.prototype.setta_info_app=function(t){this.app_info=t},t.prototype.getLvlDescri=function(t,e){for(var i=0;i<this.livs.length;i++)if(t==this.livs[i].livello)return""!=this.livs[i].livello?this.livs[i].descri_livello:e;return e},t.prototype.getUsersList=function(t,e){var i="";return""!=t&&(i=t),""!=e&&(""!=i&&(i+=","),i+=e),""==i?"":this.getNames(i)},t.prototype.getNames=function(t){for(var e="",i=t.split(","),n=0;n<i.length;n++)for(var o=0;o<this.livs.length;o++)if(i[n].toUpperCase()==this.livs[o].idp.toUpperCase()){""!=e&&(e+=","),e+=this.livs[o].nc;break}return e},t}();an.decorators=[{type:n.Directive}],an.ctorParameters=function(){return[{type:wt},{type:ee},{type:Dt},{type:d.Router},{type:e.MatDialog},{type:d.ActivatedRoute},{type:ei},{type:Ct},{type:p.TranslateService}]},an.propDecorators={onResize:[{type:n.HostListener,args:["window:resize",["event"]]}]};var rn=function(){function t(t,e,i,n,o,s,a,r,l,p){this.app_s=t,this.m_service=e,this.m_dataService=i,this.m_router=n,this._toastr=o,this.dialog=s,this.m_wkf=a,this.m_uti=r,this.tsr=l,this.m_fileservice=p,this.b_editing=!1,this.is_Supervisor=!1,this.is_Visor=!1,this.is_Admin=!1,this.is_PowerUser=!1,this.is_Ins=!1,this.id_applicativo="",this.codice_app="",this.att_panelcat="",this.documento_pubblico=!1,this.titolo_email="",this.tbl_name="",this.app_root="",this.grid_key="",this.m_id_Doc="",this.title="",this.override_insert=!1,this.user_nome="",this.user_cognome="",this.user_email="",this.b_initd=!1,this.nota_wax="",this.is_init=!1,this.imp="",this.m_cod_documento="",this.app_info={},this.sort_field="",e.checkCredentials()&&(this.ripristina_imp(),null==this.sort_field&&(this.sort_field=""),""==this.sort_field&&(this.sort_field="case when CHARINDEX('"+this.user_idp+"',autori)>0 then 1 else 0 end desc,codice desc"))}return t.prototype.goto_edit_doc=function(t,e){this.m_router.navigate([this.app_root,t,e,"edit"])},t.prototype.cmd_wkf=function(t){console.log("cmd_wkf ",t),"annulla_richiesta"==t.cmd&&this.annulla_richiesta(),"recupera_richiesta"==t.cmd&&this.recupera_richiesta(),"riassegna_richiesta"==t.cmd&&this.riassegna_richiesta(),"sostituisci_utente"==t.cmd&&this.sostituisci_utente(),"annulla_imp"==t.cmd&&this.annulla_imp(),"test_utente"==t.cmd&&this.test_utente(),"insert_doc"==t.cmd&&this.insert_doc(),"reclama_bozza"==t.cmd&&this.reclama_bozza()},t.prototype.riassegna_a=function(t){var e=this,i=new vt;i.sql="SELECT_DOCUMENTS_BY_UIID",i.types=["string","string"],i.values=[this.id_applicativo,this.get_grid().sRow.uiid],this.m_dataService.doQuery(i).subscribe((function(i){for(var n=(t=i.result_data[0]).assegnati_paralleli.split(","),o=[],s=0;s<n.length;s++)for(var a=0;a<e.livs.length;a++)if(n[s]==e.livs[a].username){o.push({username:n[s],nc:e.livs[a].nc});break}o=o.sort((function(t,e){return t.nc>e.nc?1:t.nc<e.nc?-1:0})),e.dialog.open(Xi,{disableClose:!0,width:"800px",data:{title:e.tsr.instant("Conferma Assegnazione"),lbl:"",commento_default:"",comm_notrequired:"",utenti:o,prendi_in_carico:!1,only_riassegna:!0}}).afterClosed().subscribe((function(i){if(i){if(0==i.arrsel.length)return void e._toastr.error("Impossibile riassegnare");var n="";t.autori="",t.pers_int="";i.arrsel.map((function(i){""!=n&&(n+=","),n+=i.username,-1==t.autori.indexOf(i.username)&&(console.log("VVV ",i),""!=t.autori&&(t.autori=t.autori+","),t.autori=t.autori+i.username,""!=t.pers_int&&(t.pers_int=t.pers_int+","),t.pers_int=t.pers_int+i.nc),i.username==e.app_info.user&&!0}));var o=!1;null!=t.autori&&1!=t.autori.split(",").length&&(o=!0),console.log(t.autori,o);null!=t.assegnati_paralleli&&1!=t.assegnati_paralleli.split(",").length&&t.assegnati_paralleli.indexOf(e.app_s.user)>-1&&!0;var s=new vt;s.sql="UPDATE_WKF_DOC_AUTHOR",s.values=[e.id_applicativo,t.id_documento,t.autori,t.pers_int],s.types=["string","string","string","string"],e.m_dataService.doQuery(s).subscribe((function(o){if(null!=o&&"OK"==o.result_msg&&(e.m_dataService.doQuery({sql:"INSERT_WORKFLOW_LOG",values:[e.id_applicativo,e.user_idp,"DOCUMENTO RIASSEGNATO","DOCUMENTO RIASSEGNATO A: "+n,t.uiid],types:["string","string","string","string","string"],names:[]}).subscribe((function(t){})),"A"==i.op)){var s="",a=e.app_info.descrizione_breve+", Ti è stato assegnato il documento numero: "+t.codice;null!=e.app_info.subject_riassegna&&""!=e.app_info.subject_riassegna&&(a=e.app_info.subject_riassegna),null!=e.app_info.body_riassegna&&""!=e.app_info.body_riassegna&&(s=e.app_info.body_riassegna),a=a.split("{{TRANSITION_DESCRI}}").join(t.stat_stato),s=s.split("{{TRANSITION_DESCRI}}").join(t.stat_stato),e.sendEMail_ex(e.user_idp,n,a,s,e.id_applicativo,t.uiid,e.app_info.COMPANY_SITE_ROOT+"#/"+e.app_info.modulo_swf+"/"+e.id_applicativo+"/"+t.uiid+"/edit",t.codice,"",!0,"",!1,"")}}))}}))}))},t.prototype.annulla_richiesta=function(){var t=this;null!=this.get_grid().sRow?(localStorage.setItem(this.app_s.COMPANY_KEY+"title_dialog",this.tsr.instant("Conferma Operazione")),localStorage.setItem(this.app_s.COMPANY_KEY+"msg_dialog",this.tsr.instant("Confermi di voler annullare il documento numero: ")+this.get_grid().sRow.codice+"?"),this.dialog.open(It,{disableClose:!0}).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="UPDATE_WKF_ANNULATO",i.types=["string","string","int"],i.values=[t.id_applicativo,t.get_grid().sRow.uiid,-1],t.m_dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.get_grid().doFill("")}))}}))):this._toastr.error(this.tsr.instant("Selezionare il documento da annullare"))},t.prototype.recupera_richiesta=function(){var t=this,e=this.dialog.open(Vi,{disableClose:!0});setTimeout((function(){e.componentInstance.init_w(t.id_applicativo)})),e.afterClosed().subscribe((function(e){"ok"==e&&t.get_grid().doFill("")}))},t.prototype.reclama_bozza=function(){var t=this;null!=this.get_grid().sRow?this.dialog.open(It,{disableClose:!0,data:{title_dialog:this.tsr.instant("Conferma Operazione"),msg_dialog:this.tsr.instant("Confermi di voler assegnarti il documento?")}}).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="SELECT_DOCUMENTS_BY_UIID",i.types=["string","string"],i.values=[t.id_applicativo,t.get_grid().sRow.uiid],t.m_dataService.doQuery(i).subscribe((function(e){var n=e.result_data[0].stato;(i=new vt).sql="SELECT_WKF2_SELECT_USER_MIN",i.types=["string","string"],i.values=[t.id_applicativo,t.get_grid().sRow.uiid],t.m_dataService.doQuery(i).subscribe((function(e){for(var i=!1,o=0,s="",a=0;a<e.result_data.length;a++)if(e.result_data[a].username==t.app_s.user){o=e.result_data[a].step,s=e.result_data[a].des_step,i=!0;break}if(i){if(console.log(o,n),o!=n)return void t._toastr.error(t.tsr.instant("Il documento non è in stato Bozza"));var r=new vt;r.sql="UPDATE_WKF_STATO_BOZZA",r.types=["string","string","int","string"],r.values=[t.id_applicativo,t.get_grid().sRow.uiid,o,s],t.m_dataService.doQuery(r).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toastr.info(t.tsr.instant("Documento aggiornato")),t.get_grid().doFill(""))}))}else t._toastr.error(t.tsr.instant("L'utente non è configurato per lo step BOZZA"))}))}))}})):this._toastr.error("Selezionare il documento")},t.prototype.sostituisci_utente=function(){var t=this;if(null!=this.get_grid().sRow){var e=new vt;e.sql="SELECT_USERS_BY_WKF_DOC",e.types=["string","string"],e.values=[this.id_applicativo,this.get_grid().sRow.uiid];this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=t.dialog.open(Yi,{disableClose:!0,width:"450px"});setTimeout((function(){i.componentInstance.up.all_user=e.result_data,i.componentInstance.title=t.tsr.instant("Sostituzione utente: ")+t.get_grid().sRow.codice+" - "+t.get_grid().sRow.oggetto})),i.afterClosed().subscribe((function(e){if(null!=e&&null!=e.result&&"ok"==e.result){var i=new vt;i.sql="UPDATE_USER_WORKFLOW",i.types=["string","string","string","string"],i.values=[t.id_applicativo,t.get_grid().sRow.uiid,e.u1,e.u2],t.m_dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t._toastr.info(t.tsr.instant("Workflow Aggiornato"))}))}}))}}))}else this._toastr.error(this.tsr.instant("Selezionare il documento"))},t.prototype.riassegna_richiesta=function(){var t=this;if(null!=this.get_grid().sRow){var e=new vt;e.sql="SELECT_WLIVELLIV2ADM_2",e.types=["string","string","string"],e.values=[this.id_applicativo,this.get_grid().sRow.uiid,this.get_grid().sRow.stato];this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.livs_adm=e.result_data;for(var i=new Array,n="",o=0;o<t.livs_adm.length;o++)-1==n.indexOf(String(t.livs_adm[o].step))&&(n=n+String(t.livs_adm[o].step)+"|",i.push(t.livs_adm[o]));var s=t.dialog.open(qi,{disableClose:!0,width:"600px"});setTimeout((function(){s.componentInstance.setStepCombo(i),s.componentInstance.title=t.tsr.instant("Riassegnazione documento")+": "+t.get_grid().sRow.codice+" - "+t.get_grid().sRow.oggetto})),s.afterClosed().subscribe((function(e){null!=e&&null!=e.result&&"ok"==e.result&&(t.os_r=e.lvl_sel,t.set_canale_step1())}))}}))}else this._toastr.error("Selezionare il documento da riassegnare")},t.prototype.set_canale_step1=function(){var t=this,e=new vt;e.sql="SELECT_DOCUMENTS_BY_UIID",e.types=["string","string"],e.values=[this.id_applicativo,this.get_grid().sRow.uiid],this.m_dataService.doQuery(e).subscribe((function(e){t.get_grid().sRow.canale=e.result_data[0].canale,console.log("setto canale: "+t.get_grid().sRow.canale),t.riassegna_richiesta_step1()}))},t.prototype.riassegna_richiesta_step1=function(){var t=this,e=new vt;e.sql="SELECT_WLIVELLIV2_STEP_2",e.types=["string","string","string"],e.values=[this.id_applicativo,this.os_r.step],this.m_dataService.doQuery(e).subscribe((function(e){var i=e.result_data;console.log("arrAutori prima ",i);var n=new vt;n.sql="SELECT_WKF_VARIABILES_V2",n.types=["string"],n.values=[t.get_grid().sRow.uiid],t.m_dataService.doQuery(n).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){i.map((function(i){10==i.step&&"*ALLUSERS"==i.value&&e.result_data.map((function(t){"*CREATOR"==t.k&&(i.username=t.v,i.nc=t.nc,i.ncx=t.nc)})),0==i.value.indexOf("*")&&(i.context=t.get_grid().sRow.canale,i.description="",i.name="",e.result_data.map((function(t){i.value.split("CREATOR").join("REQUESTER")==t.k.split("CREATOR").join("REQUESTER")&&(i.username=t.v,i.nc=t.nc,i.ncx=t.nc)})))})),console.log("arrAutori dopo ",i,t.get_grid().sRow.canale);for(var n=[],o=function(e){if(null==t.get_grid().sRow.canale||""==t.get_grid().sRow.canale||t.get_grid().sRow.canale==i[e].context){console.log("arrAutori[i].context ",i[e].context);var o=!1;n.map((function(t){t.nc==i[e].nc&&t.context==i[e].context&&(o=!0)})),o||n.push(i[e])}},s=0;s<i.length;s++)o(s);console.log("arrAutori_temp ",n),i=JSON.parse(JSON.stringify(n));var a=t.dialog.open(Gi,{disableClose:!0,width:"850px"});for(s=0;s<i.length;s++)null!=i[s].nc?i[s].nc=i[s].nc.split(" ()").join(""):i[s].nc=i[s].username,null!=i[s].idp&&null==i[s].username&&(i[s].username=i[s].idp);setTimeout((function(){a.componentInstance.arrAutori=i,a.componentInstance.title=t.tsr.instant("Riassegnazione documento")+": "+t.get_grid().sRow.codice+" - "+t.get_grid().sRow.oggetto})),a.afterClosed().subscribe((function(e){null!=e&&null!=e.result&&"ok"==e.result&&(t.wax=e.arrsel,t.nota_wax=e.nota,t.riassegna_richiesta_step2())}))}}))}))},t.prototype.riassegna_richiesta_step2=function(){var t=this,e="",i=[],n=new vt;n.sql="DELETE_TODO_ALL_BYID",n.types=["string","string"],n.values=[this.id_applicativo,this.get_grid().sRow.uiid],i.push(this.m_dataService.doQuery(n)),null!=this.get_grid().sRow.lettori&&(e=this.get_grid().sRow.lettori);var o="",s="",a="",r="";null!=this.get_grid().sRow.partecipanti&&(r=this.get_grid().sRow.partecipanti);var l="",p="XCXXX";console.log("this.wax ",this.wax);for(var u=0;u<this.wax.length;u++){var c=new vt;if(c.sql="INSERT_TODO_GEST",c.types=["string","string","string","string","string","string","string"],c.values=[this.id_applicativo,this.get_grid().sRow.uiid,this.wax[u].username,this.get_grid().sRow.oggetto,this.title,this.get_grid().sRow.descrizione,this.app_s.COMPANY_SITE_ROOT+"/#/"+this.app_root+"/"+this.id_applicativo+"/"+this.get_grid().sRow.uiid+"/edit"],i.push(this.m_dataService.doQuery(c)),"XCXXX"!=p&&p!=this.wax[u].gruppo_parallelo)return void this._toastr.error(this.tsr.instant("impossibile assegnare a utenti di gruppi distiniti"));p=this.wax[u].gruppo_parallelo,""!=l&&(l+=","),l+=this.wax[u].username,-1==e.indexOf(this.wax[u].username)&&(""!=e&&(e+=","),e+=this.wax[u].username),-1==s.indexOf(this.wax[u].nc)&&(""!=s&&(s+=","),s+=this.wax[u].nc),""!=a&&(a+=","),a+=this.wax[u].nc,null!=r&&-1==r.indexOf(this.wax[u].username)&&(""!=r&&(r+=","),r+=this.wax[u].username),""!=o&&(o+=","),o+=this.wax[u].username}_.forkJoin(i).subscribe((function(t){}));var d=this.titolo_email+this.tsr.instant("L'utente ")+this.user_cognome+" "+this.user_nome+this.tsr.instant(" ti ha riassegnato il documento: ")+this.get_grid().sRow.codice,h="Commento:\n\n"+this.nota_wax;null!=this.app_info.subject_riassegna&&""!=this.app_info.subject_riassegna&&(d=this.app_info.subject_riassegna),null!=this.app_info.body_riassegna&&""!=this.app_info.body_riassegna&&(h=this.app_info.body_riassegna),d=d.split("{{TRANSITION_DESCRI}}").join(this.os_r.description),h=h.split("{{TRANSITION_DESCRI}}").join(this.os_r.description),this.sendEMail_ex(this.user_idp,l,d,h,this.id_applicativo,this.get_grid().sRow.uiid,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_root+"/"+this.id_applicativo+"/"+this.get_grid().sRow.uiid+"/edit",this.get_grid().sRow.uiid,this.nota_wax);var m=new vt;m.sql="INSERT_COMMENTO_RIASS",m.types=["string","string","string","string","string","int","int"],m.values=[this.id_applicativo,this.get_grid().sRow.uiid,this.tsr.instant("Documento riassegnato a ")+a,this.user_idp,this.os_r.description,this.get_grid().sRow.stato,this.os_r.step];this.m_dataService.doQuery(m).subscribe((function(t){null!=t&&t.result_msg}));var f="$$";this.wax.length>0&&null!=this.wax[0].gruppo_parallelo&&""!=this.wax[0].gruppo_parallelo&&(f=this.wax[0].gruppo_parallelo),(m=new vt).sql="UPDATE_RIASS_DOCUMENTO",m.types=["string","string","string","string","string","string","string","string","string","string",f],m.values=[this.os_r.step,this.os_r.description,e,o,this.os_r.description,s,r,this.get_grid().sRow.id_applicativo,this.get_grid().sRow.uiid],this.m_dataService.doQuery(m).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.get_grid().Refresh(),(m=new vt).sql="INSERT_WKF_COMMENTO",m.types=["string","string","string","string","string"],m.values=[t.id_applicativo,t.get_grid().sRow.uiid,t.tsr.instant("Documento riassegnato,"+t.os_r.description+" commento:")+"\n"+t.nota_wax,t.user_idp,""],!1,t.m_dataService.doQuery(m).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){(m=new vt).sql="exec_app_workflow",m.values=[t.codice_app,t.get_grid().sRow.uiid,""+t.get_grid().sRow.stato,""+t.os_r.step,t.user_idp];t.m_wkf.doQuery(m).subscribe((function(t){}))}})))})),this.wax.length>0&&((m=new vt).sql="UPDATE_RIASSEGNA_TODO",m.types=["string","string"],m.values=[this.wax[0].idp,this.get_grid().sRow.uiid],!1,this.m_dataService.doQuery(m).subscribe((function(t){null!=t&&t.result_msg}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,a,r,l,p,u,c,d){var _=this;void 0===p&&(p=!0),void 0===u&&(u=""),void 0===c&&(c=!0),void 0===d&&(d="");var h=!1;null!=this.app_s.dev_mode&&"1"==this.app_s.dev_mode&&(h=!0);var m={destinatari:e.split(","),commento:d,id_applicazione:o,id_documento:s,username:t,e_subject:i,e_body:n,dev_mode:h?1:0},f=new gt;f.command="exec_app",f.p1="send_email";var g=this.m_uti.newGuid();f.p2=g;var v=new vt;v.sql="INSERT_WKF_OP",v.values=[g,JSON.stringify(m)],v.types=["string","string"],this.m_dataService.doQuery(v).subscribe((function(t){_.m_fileservice.doQuery(f).subscribe((function(t){}))}))},t.prototype.annulla_imp=function(){var t=this,e=new vt;e.sql="SELECT_CURRENT_USER_INFOS",e.types=[],e.values=[],this.m_dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.app_s.user_name=e.result_data[0].nome,t.app_s.user=e.result_data[0].username,t.app_s.user_surname=e.result_data[0].cognome,t.app_s.user_email=e.result_data[0].email,t.user_idp=e.result_data[0].username,t.user_nome=e.result_data[0].nome,t.user_cognome=e.result_data[0].cognome,t.user_email=e.result_data[0].email)})),this.app_s.user_name_ori=null,this.app_s.user_ori=null,this.app_s.user_surname_ori=null,this.app_s.user_email_ori=null,this.imp="",localStorage.removeItem(this.app_s.COMPANY_KEY+"_imp_user"),this.get_grid().doFill("")},t.prototype.test_utente=function(){var t=this,e=new vt;e.sql="SELECT_ALL_USERS",e.types=["string"],e.values=[this.id_applicativo],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=t.dialog.open(Gi,{disableClose:!0,width:"850px"});setTimeout((function(){i.componentInstance.arrAutori=e.result_data,i.componentInstance.title=t.tsr.instant("Impersona Utente"),i.componentInstance.commento_hidden=!0})),i.afterClosed().subscribe((function(e){if(null!=e&&null!=e.result&&"ok"==e.result){var i=new vt;i.sql="SELECT_USER_INFO_WKF",i.types=["string"],i.values=[e.arrsel[0].username],t.m_dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.app_s.user_name_ori=t.app_s.user_name,t.app_s.user_ori=t.app_s.user,t.app_s.user_surname_ori=t.app_s.user_surname,t.app_s.user_email_ori=t.app_s.user_email,t.app_s.user_name=e.result_data[0].nome,t.app_s.user=e.result_data[0].username,t.app_s.user_surname=e.result_data[0].cognome,t.app_s.user_email=e.result_data[0].email,t.user_idp=e.result_data[0].username,t.user_nome=e.result_data[0].nome,t.user_cognome=e.result_data[0].cognome,t.user_email=e.result_data[0].email,t.imp="ANN. IMP: "+e.result_data[0].cognome+" "+e.result_data[0].nome,localStorage.setItem(t.app_s.COMPANY_KEY+"_imp_user",t.m_uti.encrypt_v3(JSON.stringify(e.result_data[0]))),t.get_grid().doFill(""))}))}}))}}))},t.prototype.save_state_wkf=function(){this.app_s.getState().wkf_obj={},this.app_s.getState().wkf_obj.b_editing=this.b_editing,this.app_s.getState().wkf_obj.is_Supervisor=this.is_Supervisor,this.app_s.getState().wkf_obj.is_Visor=this.is_Visor,this.app_s.getState().wkf_obj.is_Admin=this.is_Admin,this.app_s.getState().wkf_obj.is_PowerUser=this.is_PowerUser,this.app_s.getState().wkf_obj.is_Ins=this.is_Ins,this.app_s.getState().wkf_obj.id_applicativo=this.id_applicativo,this.app_s.getState().wkf_obj.codice_app=this.codice_app,this.app_s.getState().wkf_obj.att_panelcat=this.att_panelcat,this.app_s.getState().wkf_obj.documento_pubblico=this.documento_pubblico,this.app_s.getState().wkf_obj.titolo_email=this.titolo_email,this.app_s.getState().wkf_obj.tbl_name=this.tbl_name,this.app_s.getState().wkf_obj.grid_key=this.grid_key,this.app_s.getState().wkf_obj.m_id_Doc=this.m_id_Doc,this.app_s.getState().wkf_obj.livs=this.livs,this.app_s.getState().wkf_obj.user_idp=this.user_idp,this.app_s.getState().wkf_obj.app_root=this.app_root,this.app_s.getState().wkf_obj.title=this.title},t.prototype.restore_state_wkf=function(){this.b_editing=this.app_s.getState().wkf_obj.b_editing,this.is_Visor=this.app_s.getState().wkf_obj.is_Visor,this.is_Supervisor=this.app_s.getState().wkf_obj.is_Supervisor,this.is_Admin=this.app_s.getState().wkf_obj.is_Admin,this.is_PowerUser=this.app_s.getState().wkf_obj.is_PowerUser,this.is_Ins=this.app_s.getState().wkf_obj.is_Ins,this.id_applicativo=this.app_s.getState().wkf_obj.id_applicativo,this.codice_app=this.app_s.getState().wkf_obj.codice_app,this.att_panelcat=this.app_s.getState().wkf_obj.att_panelcat,this.documento_pubblico=this.app_s.getState().wkf_obj.documento_pubblico,this.titolo_email=this.app_s.getState().wkf_obj.titolo_email,this.tbl_name=this.app_s.getState().wkf_obj.tbl_name,this.grid_key=this.app_s.getState().wkf_obj.grid_key,this.m_id_Doc=this.app_s.getState().wkf_obj.m_id_Doc,this.livs=this.app_s.getState().wkf_obj.livs,this.user_idp=this.app_s.getState().wkf_obj.user_idp,this.app_root=this.app_s.getState().wkf_obj.app_root,this.title=this.tsr.instant(this.app_s.getState().wkf_obj.title),this.m_uti.set_home_title(this.tsr.instant(this.att_panelcat))},t.prototype.init_Panel=function(t,e){this.m_id_Doc=e,this.m_cod_documento=t,this.do_init()},t.prototype.run_grid=function(){var t=this;null!=this.get_grid()&&this.get_grid().ready?this.init_grid():setTimeout((function(){t.run_grid()}),500)},t.prototype.self_ok=function(){var t=this;if(null!=this.get_grid())return console.log("this.get_grid() ",this.get_grid()),void this.get_grid().refresh_access(this);setTimeout((function(){t.self_ok()}),500)},t.prototype.do_init=function(){var t=this;if(null!=this.app_s.user_ori&&(this.imp="ANN. IMP: "+this.app_s.user_name+" "+this.app_s.user_surname),this.user_idp=this.app_s.user,null!=this.user_idp){null==this.sort_field&&(this.sort_field=""),""==this.sort_field&&(this.sort_field="case when CHARINDEX('"+this.user_idp+"',autori)>0 then 1 else 0 end desc,codice desc");var e=new vt;e.sql="SELECT_WKF_APP_INFO_V2",e.types=["string"],e.values=[this.m_cod_documento],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;t.id_applicativo=i[0].id_gruppo,t.app_info=i[0],t.app_root=i[0].modulo_swf,t.codice_app=i[0].codice_documento,t.att_panelcat=i[0].descrizione_breve,t.documento_pubblico=i[0].pubblico,t.titolo_email="["+i[0].descrizione_breve+"]",t.tbl_name=i[0].vista_sql,t.grid_key=t.app_s.COMPANY_KEY+i[0].vista_sql,t.user_idp=t.app_s.user,t.user_nome=t.app_s.user_name,t.user_cognome=t.app_s.user_surname,t.user_email=t.app_s.user_email,t.m_uti.set_home_title(t.tsr.instant(t.att_panelcat));var n=new vt;n.sql="SELECT_UTENTE_WKF_ADMIN",n.types=["string","string"],n.values=[t.id_applicativo,t.app_s.user],t.m_dataService.doQuery(n).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;t.is_Supervisor=!1,t.is_Admin=!1,t.is_PowerUser=!1,i.length>0&&("0"==i[0].tipo&&(t.is_Supervisor=!0),"1"==i[0].tipo&&(t.is_Admin=!0,t.is_Supervisor=!0),"2"==i[0].tipo&&(t.is_PowerUser=!0));var n=new vt;n.sql="SELECT_WLIVELLIV2_2",n.types=["string"],n.values=[t.id_applicativo],t.m_dataService.doQuery(n).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.ok_conf_s(e.result_data);var i=new vt;i.sql="SELECT_ROLES_VISORI",i.types=["string"],i.values=[t.id_applicativo],t.m_dataService.doQuery(i).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.is_Visor=!1;for(var i=0;i<e.result_data.length;i++)if(t.m_uti.hasRole(e.result_data[i].name,!1)){t.is_Visor=!0;break}t.run_grid(),t.self_ok()}}))}}))}}))}}))}else setTimeout((function(){t.do_init()}),500)},t.prototype.ok_conf_s=function(t){this.livs=t,this.is_Ins=!1,console.log("livs ",this.livs);for(var e=0;e<this.livs.length;e++)if(null==this.livs[e].username&&(this.livs[e].username="ZZZ"),null!=this.user_idp&&(this.livs[e].username.toUpperCase()==this.user_idp.toUpperCase()||"*ALLUSERS"==this.livs[e].value)&&this.livs[e].step<=10){this.is_Ins=!0,"*ALLUSERS"==this.livs[e].value&&(this.livs[e].value="",this.livs[e].username=this.user_idp);break}this.save_state_wkf(),this.parse_url(),this.b_editing&&(this.returnedit(),this.b_editing=!1)},t.prototype.returnedit=function(){},t.prototype.parse_url=function(){for(var t=this.m_router.routerState.snapshot.url.split(/[\&?]+/),e=0;e<t.length;e++)if(t[e]=="/"+this.app_root+"/new")return void this.insert_doc()},t.prototype.do_custom_insert=function(){},t.prototype.goto_models=function(){this.m_router.navigate([this.app_root,"models"])},t.prototype.insert_doc=function(){console.log("insert_doc() ",this.override_insert),this.override_insert?this.do_custom_insert():this.m_router.navigate([this.app_root,this.id_applicativo,"new"])},t.prototype.ripristina_imp=function(){if(null!=localStorage.getItem(this.app_s.COMPANY_KEY+"_imp_user")){var t=null;try{t=JSON.parse(this.m_uti.decrypt_v3(localStorage.getItem(this.app_s.COMPANY_KEY+"_imp_user")))}catch(t){}null!=t&&(this.app_s.user_name_ori=this.app_s.user_name,this.app_s.user_ori=this.app_s.user,this.app_s.user_surname_ori=this.app_s.user_surname,this.app_s.user_email_ori=this.app_s.user_email,this.app_s.user_name=t.nome,this.app_s.user=t.username,this.app_s.user_surname=t.cognome,this.app_s.user_email=t.email,this.user_idp=t.username,this.user_nome=t.nome,this.user_cognome=t.cognome,this.user_email=t.email,this.imp="ANN. IMP: "+t.cognome+" "+t.nome)}},t}();rn.decorators=[{type:n.Directive}],rn.ctorParameters=function(){return[{type:wt},{type:ee},{type:Dt},{type:d.Router},{type:i.ToastrService},{type:e.MatDialog},{type:ei},{type:Ct},{type:p.TranslateService},{type:Tt}]};var ln=function(){function t(t,e,i,n,o,s,a,r,l){var p=this;this.app_s=t,this.m_dataService=e,this.m_router=i,this.m_dialog=n,this.m_route=o,this.m_wkf=s,this.uti_s=a,this.m_fileservice=r,this.tsr=l,this.m_obj={},this.next_label="Procedi",this.next_label_color="#000000",this.next_back_ground_color="#ffd740",this.b_init_next=!1,this.sort_field="",this.in_carico=!1,this.wkf_users_roles="",this.b_rip_pulsanti=!0,this.save_alreadypressed=!1,this.b_respingi=!1,this.limite_salto_after=-1,this.transizione_info={},this.respingi_enabled=!1,this.b_assengna_a=!1,this.ttw=0,this.email_bloccate=!1,this.oper="",this.b_edit_before=!1,this.all_c=0,this.comm_c=0,this.forza_canale="",this.c_canale="",this.user_nome="",this.user_cognome="",this.user_email="",this.bEdit=!1,this.bEdit_wkf=!1,this.bEditOp_wkf=!1,this.bEditAp_wkf=!1,this.bEditAss_wkf=!1,this.bEditBozza_wkf=!1,this.bEdit_bozza=!1,this.bNuovaRev_Agg=!1,this.hide_richiedente=!1,this.bEdit_Agg=!1,this.btnSalva_label=this.tsr.instant("SALVA"),this.btnTerminaOp_label=this.tsr.instant("Termina Attività"),this.btnApprova_label=this.tsr.instant("APPROVA"),this.btnAssegna_label=this.tsr.instant("Assegna"),this.btnRespingi_label=this.tsr.instant("RESPINGI"),this.id_documento="",this.m_autori="",this.m_lettori="",this.m_liv=0,this.m_statox="",this.m_danotificare="",this.m_oper="",this.m_autori_paralleli="",this.m_crea_att=0,this.m_send_email=0,this.errorMsg="",this.id_applicativo="",this.rich="",this.cod="",this.simple_mode=!1,this.oggetto_editable=!1,this.descrizione_editable=!1,this.btnSalva_visible=!1,this.b_PrendiInCarico=!1,this.stat_stato_text="",this.creatore_text="",this.pers_int_text="",this.rich_enabled=!1,this.oggetto_text="",this.descrizione_text="",this.btnprocedi=!1,this.b_edit=!1,this.b_valid=!0,this.s_uto="",this.b_apprf=!1,this.loaded=!1,setTimeout((function(){var t=new vt;t.sql="SELECT_ROLES_WKF_V2",t.values=[p.id_applicativo],t.types=["string"],console.log("start SELECT_ROLES_WKF_V2",new Date),p.m_dataService.doQuery(t).subscribe((function(t){null!=t&&"OK"==t.result_msg&&t.result_data.map((function(t){p.wkf_users_roles+=t.name}))}))})),this.m_route.params.subscribe((function(t){p.onResize();t.op;p.id_applicativo=t.idapp,p.id_documento=t.id_doc;var e=new vt;e.sql="SELECT_WKF_APP_INFO_BYUID",e.types=["string"],e.values=[p.id_applicativo],console.log("start SELECT_WKF_APP_INFO_BYUID",new Date),p.m_dataService.doQuery(e).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(console.log(t.result_data.length),t.result_data.length>0?(console.log("end SELECT_WKF_APP_INFO_BYUID",new Date),p.setta_info_app(t.result_data[0]),p.init_engine()):p.alert("CODICE APPLICAZIONE NON VALIDO",2))}))}))}return t.prototype.ripristina_imp=function(){if(null==localStorage.getItem(this.app_s.COMPANY_KEY+"_imp_user"))return this.user_idp=this.app_s.user,this.user_nome=this.app_s.user_name,this.user_cognome=this.app_s.user_surname,void(this.user_email=this.app_s.user_email);var t=JSON.parse(this.uti_s.decrypt_v3(localStorage.getItem(this.app_s.COMPANY_KEY+"_imp_user")));if(null==t)return this.user_idp=this.app_s.user,this.user_nome=this.app_s.user_name,this.user_cognome=this.app_s.user_surname,void(this.user_email=this.app_s.user_email);this.app_s.user_name_ori=this.app_s.user_name,this.app_s.user_ori=this.app_s.user,this.app_s.user_surname_ori=this.app_s.user_surname,this.app_s.user_email_ori=this.app_s.user_email,this.app_s.user_name=t.nome,this.app_s.user=t.username,this.app_s.user_surname=t.cognome,this.app_s.user_email=t.email,this.user_idp=t.username,this.user_nome=t.nome,this.user_cognome=t.cognome,this.user_email=t.email},t.prototype.hasRole=function(t,e){return void 0===e&&(e=!0),null!==this.wkf_users_roles&&(!(!e||null==this.app_s.user_isadmin||"1"!=this.app_s.user_isadmin)||this.wkf_users_roles.toUpperCase().indexOf(t.toLocaleUpperCase())>-1)},t.prototype.init_user_i=function(){this.ripristina_imp()},t.prototype.save_to_app_state=function(){this.app_s.getState().wkf_doc_info={},this.app_s.getState().wkf_doc_info.curr_user=this.user_idp,this.app_s.getState().wkf_doc_info.codice=this.m_obj.codice,this.app_s.getState().wkf_doc_info.data_richiesta=this.m_obj.data_richiesta,this.app_s.getState().wkf_doc_info.richiedente=this.m_obj.nc+" ("+this.m_obj.richiesta_da+")",this.app_s.getState().wkf_doc_info.in_carico_a=this.m_obj.in_carico_a,this.app_s.getState().wkf_doc_info.stato=this.m_obj.stat_stato,this.app_s.getState().wkf_doc_info.uiid_app=this.id_applicativo,this.app_s.getState().wkf_doc_info.uiid_doc=this.m_obj.id_documento,this.app_s.getState().wkf_doc_info.canale=this.m_obj.canale},t.prototype.evt_salv=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!1),this.b_rip_pulsanti=t,this.btnprocedi=!1,e&&!this.ck_field()||this.salva()},t.prototype.prendi_in_carico=function(){this.in_carico=!1,null!=this.m_obj.assegnati_paralleli&&1!=this.m_obj.assegnati_paralleli.split(",").length&&this.m_obj.assegnati_paralleli.indexOf(this.app_s.user)>-1&&(this.b_assengna_a=!0),this.update_status(!0,null,this.in_carico,this.b_assengna_a,1),this.m_obj.autori=this.app_s.user;var t=new vt;t.sql="UPDATE_WKF_PRENDI_IN_CARICO",t.types=["string","string","string"],t.values=[this.id_applicativo,this.id_documento,this.app_s.user_surname+" "+this.app_s.user_name],this.m_dataService.doQuery(t).subscribe(),this.reassigned_to("C"),(t=new vt).sql="INSERT_WORKFLOW_LOG",t.types=["string","string","string","string","string"],t.values=[this.id_applicativo,this.app_s.user,"Presa in carico",this.m_obj.stat_stato,this.id_documento],this.m_dataService.doQuery(t).subscribe()},t.prototype.salva=function(){var t=this;if(this.can_save()&&!this.save_alreadypressed)if(this.save_alreadypressed=!0,setTimeout((function(){t.save_alreadypressed=!1}),1e3),""==this.m_obj.codice){if("respingi"==this.oper)return void this.alert("Errore di configurazione pratica contattare ufficio IT [0x001]",1);this.ck_canale_multiplo()}else this.save_agg()},t.prototype.doApprova=function(){this.b_respingi=!1,this.over_canale_iniz();var t=0;if(this.nlevel=null,0==this.m_obj.stato)for(var e=0;e<this.livs.length;e++)(this.livs[e].step<t||0==t)&&(this.clevel=this.livs[e],t=this.livs[e].step);else{if(t=this.m_obj.stato,console.log("this.m_obj.canale ",this.m_obj.canale,t),null!=this.m_obj.canale&&""!=this.m_obj.canale)for(e=0;e<this.livs.length;e++)if(this.livs[e].step==t&&(console.log(" liv ",this.livs[e]),this.user_idp.toUpperCase()==this.livs[e].username.toUpperCase()&&(console.log(this.m_obj.canale+" "+this.livs[e].context),this.m_obj.canale==this.livs[e].context))){console.log("clevel 1 ",this.livs[e]),this.clevel=this.livs[e];break}if(console.log("clevel 2 ",this.clevel),null==this.clevel)for(e=0;e<this.livs.length;e++)if(null==this.livs[e].username&&(this.livs[e].username="ZZZ"),this.livs[e].step==t&&!("*ALLUSERS"!=this.livs[e].context&&this.user_idp.toUpperCase()!=this.livs[e].username.toUpperCase()||""!=this.c_canale&&""!=this.livs[e].context&&this.c_canale!=this.livs[e].context&&"*ALLUSERS"!=this.livs[e].context)){this.clevel=this.livs[e];break}}if(console.log("clevel 2 ",this.clevel),this.clevel=this.check_n_levels(this.clevel),null!=this.clevel&&""!=this.clevel){var i=t;if("procedi"==this.oper&&1==this.clevel.salto_iniziale){t=this.clevel.livello;for(e=0;e<this.livs.length;e++)this.user_idp.toUpperCase()==this.livs[e].username.toUpperCase()&&0==this.livs[e].notifica&&this.livs[e].step>t&&0!=t&&this.livs[e].step!=i&&(-1==this.limite_salto_after||this.livs[e].step<this.limite_salto_after)&&(this.clevel=this.livs[e],t=this.livs[e].step);for(var n=this.wkf_rule(t),o=0;o<this.livs.length;o++)if(this.livs[o].livello==n&&this.user_idp.toUpperCase()==this.livs[o].idp.toUpperCase()&&(""==this.c_canale||""==this.livs[o].context||this.c_canale==this.livs[o].context)){this.clevel=this.livs[o],t=this.livs[o].livello;break}}this.clevel=this.check_n_levels(this.clevel),this.calcolanextandjump()}else this.alert("Errore di configurazione pratica contattare ufficio IT [0x002]",1)},t.prototype.wkf_rule_before=function(t,e,i){return t},t.prototype.calcolanextandjump=function(){var t=this,e=new vt;e.sql="SELECT_TRANSAZIONI_FROM_LVL",e.values=[this.id_applicativo,this.clevel.step],e.types=["string","int"],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;if(console.log("transazioni ",i),0==(i=t.wkf_rule_before(i,t.clevel.step,t.clevel.context)).length)return void t.alert("Nessuna transizione definita dallo step: "+t.clevel.step,1);if(1==i.length)t.calcolanextandjump2(i[0]);else t.m_dialog.open(Hi,{disableClose:!0,data:i}).afterClosed().subscribe((function(e){console.log("ris select level",e),null!=e?t.calcolanextandjump2(e):t.update_status(!0,null,null,null,2)}))}}))},t.prototype.calcolanextandjump2=function(t){console.log("calcolanextandjump2",t),this.transizione_info=t;for(var e=0,i=0,n=0;n<this.livs.length;n++)t.step_d==this.livs[n].step&&(this.nlevel=this.livs[n],e=this.livs[n].step);i=this.wkf_rule(e);var o=!1;for(n=0;n<this.livs.length;n++)""!=this.clevel.context&&this.clevel.context!=this.livs[n].context||this.livs[n].step==i&&(this.nlevel=this.livs[n],i=this.livs[n].step,o=!0);if(!o)for(n=0;n<this.livs.length;n++)if(this.livs[n].step==i&&0==this.livs[n].notifica){this.nlevel=this.livs[n],i=this.livs[n].step;break}this.ck_after(i)?this.calcola_destinari(t):this.update_status(this.b_edit_before,null,null,null,3)},t.prototype.calcola_destinari=function(t){var e=this;if(console.log("this. this.transizione_info ",t),null==this.nlevel)return this.alert("problema di configurazione passaggio prossimo livello "+this.clevel.des_step+" non attivato comunicare al CED (verificare responsabile in anagrafica utente)",1),void this.update_status(this.b_edit_before,null,null,null,3);console.log("canale before: "+this.clevel.context),null!=this.c_canale&&""!=this.c_canale&&(null!=this.clevel.context&&""!=this.clevel.context||(this.clevel.context=this.c_canale)),console.log("canale after: "+this.clevel.context);var i=new Array;if(""==this.clevel.context)for(var n=0;n<this.livs.length;n++)this.livs[n].step==this.nlevel.step&&i.push(this.livs[n]);else{var o=!1;for(n=0;n<this.livs.length;n++)this.livs[n].step==this.nlevel.step&&""!=this.livs[n].context&&(o=!0);console.log("canale: "+this.clevel.context);for(n=0;n<this.livs.length;n++)this.livs[n].step==this.nlevel.step&&(this.clevel.context!=this.livs[n].context&&o&&"*SYSTEM"!=this.livs[n].context||(i.push(this.livs[n]),this.nlevel=this.livs[n]))}if(console.log("autori calcolati: "+i),0!=i.length)if(null==t.pre_assegna_req&&(t.pre_assegna_req=0),null==t.pre_assegna_man&&(t.pre_assegna_man=0),console.log(" o.pre_assegna_req ",t.pre_assegna_req),1==this.transizione_info.manual_assignment||1==t.pre_assegna_man){var s=[];null!=this.m_obj.creatore&&""!=this.m_obj.creatore&&i.map((function(t){t.username==e.m_obj.creatore&&s.push(t)})),i=i.sort((function(t,e){return t.nc>e.nc?1:t.nc<e.nc?-1:0}));var a=JSON.parse(JSON.stringify(i));this.m_dialog.open(Ni,{disableClose:!0,data:{title:this.tsr.instant("Conferma Assegnazione"),lbl:t.description,commento_default:"",comm_notrequired:t.comments_opt,utenti:i,user_sel:0==t.pre_assegna_req?[]:s,pre_assegna_man:1==t.pre_assegna_man}}).afterClosed().subscribe((function(i){if(""==i||null==i)return e.update_status(!0,!1,null,null,4),void(e.respingi_enabled&&e.update_status(!0,!0,null,null,5));1!=t.pre_assegna_man?e.exec_wkf(t,e.nlevel,i.arrsel,i.nota,e.transizione_info.create_ver,null):e.exec_wkf(t,e.nlevel,i.arrsel,i.nota,e.transizione_info.create_ver,a)}))}else{var r="";i.map((function(t){null==t.nc&&(t.nc=t.value.split("*").join(""))}));var l=[],p=JSON.parse(JSON.stringify(i)),u=!1;if(1==t.pre_assegna_req){var c=[];null!=this.m_obj.creatore&&""!=this.m_obj.creatore&&i.map((function(t){t.username==e.m_obj.creatore&&c.push(t)})),(c=c.sort((function(t,e){return t.nc>e.nc?1:t.nc<e.nc?-1:0}))).length>0&&(i=JSON.parse(JSON.stringify(c)))}i.map((function(t){null!=t.default_value&&1==t.default_value&&(u=!0)})),u&&(i.map((function(t){null!=t.default_value&&1==t.default_value&&l.push(t)})),i=JSON.parse(JSON.stringify(l)));for(n=0;n<i.length;n++)null!=i[n].nc&&-1==r.indexOf(i[n].nc)&&(""!=r&&(r+=";"),r+=i[n].nc);console.log(" sp ",r),this.m_dialog.open(Pi,{disableClose:!0,data:{title:"Conferma Avanzamento",lbl:t.description,icon:t.icon,color_font:t.color_font,color:t.color,commento_default:"",comm_notrequired:t.comments_opt,utenti:r}}).afterClosed().subscribe((function(n){if(null==n||"abort"==n)return e.update_status(!0,!1,null,null,6),void(e.respingi_enabled&&e.update_status(!0,!0,null,null,7));e.exec_wkf(t,e.nlevel,i,n,e.transizione_info.create_ver,p)}))}else this.alert("problema di configurazione il livello "+this.nlevel.descri_livello+" non presenta utenti partecipanti validi",1)},t.prototype.assegna_a=function(){for(var t=this,e=this.m_obj.assegnati_paralleli.split(","),i=[],n=0;n<e.length;n++)for(var o=0;o<this.livs.length;o++)if(e[n]==this.livs[o].username){i.push({username:e[n],nc:this.livs[o].nc});break}i=i.sort((function(t,e){return t.nc>e.nc?1:t.nc<e.nc?-1:0})),this.m_dialog.open(Xi,{disableClose:!0,width:"800px",data:{title:this.tsr.instant("Conferma Assegnazione"),lbl:"",commento_default:"",comm_notrequired:"",utenti:i,prendi_in_carico:this.m_obj.autori!=this.app_s.user}}).afterClosed().subscribe((function(e){if(e){if(0==e.arrsel.length)return void t.alert("Impossibile riassegnare",1);var i="";t.m_obj.autori="",t.m_obj.pers_int="";var n=!1;e.arrsel.map((function(e){""!=i&&(i+=","),i+=e.username,-1==t.m_obj.autori.indexOf(e.username)&&(console.log("VVV ",e),""!=t.m_obj.autori&&(t.m_obj.autori=t.m_obj.autori+","),t.m_obj.autori=t.m_obj.autori+e.username,""!=t.m_obj.pers_int&&(t.m_obj.pers_int=t.m_obj.pers_int+","),t.m_obj.pers_int=t.m_obj.pers_int+e.nc),e.username==t.app_info.user&&(n=!0)})),t.in_carico=!1,null!=t.m_obj.autori&&1!=t.m_obj.autori.split(",").length&&(t.in_carico=!0),console.log(t.m_obj.autori,t.in_carico),t.b_assengna_a=!1,null!=t.m_obj.assegnati_paralleli&&1!=t.m_obj.assegnati_paralleli.split(",").length&&t.m_obj.assegnati_paralleli.indexOf(t.app_s.user)>-1&&(t.b_assengna_a=!0),t.update_status(n,!1,t.in_carico,t.b_assengna_a,18),t.respingi_enabled&&t.update_status(n,!0,t.in_carico,t.b_assengna_a,19);var o=new vt;o.sql="UPDATE_WKF_DOC_AUTHOR",o.values=[t.id_applicativo,t.id_documento,t.m_obj.autori,t.m_obj.pers_int],o.types=["string","string","string","string"],t.m_dataService.doQuery(o).subscribe((function(n){if(null!=n&&"OK"==n.result_msg&&(t.reassigned_to(e.op),t.m_dataService.doQuery({sql:"INSERT_WORKFLOW_LOG",values:[t.id_applicativo,t.user_idp,"DOCUMENTO RIASSEGNATO","DOCUMENTO RIASSEGNATO A: "+i,t.id_documento],types:["string","string","string","string","string"],names:[]}).subscribe((function(t){})),"C"==e.op&&t.update_status(!0,t.respingi_enabled,t.in_carico,t.b_assengna_a,18),"A"==e.op)){var o=t.app_info.descrizione_breve+", Ti è stato assegnato il documento numero: "+t.m_obj.codice+" "+t.getTitle()+" - "+t.getLvlDescri(String(t.m_liv),t.m_statox),s="<br>Attività:"+t.getLvlDescri(String(t.m_liv),t.m_statox)+"<br>"+t.m_statox+"<br>"+t.getDescri();null!=t.app_info.subject_riassegna&&""!=t.app_info.subject_riassegna&&(o=t.app_info.subject_riassegna),null!=t.app_info.body_riassegna&&""!=t.app_info.body_riassegna&&(s=t.app_info.body_riassegna),o=o.split("{{TRANSITION_DESCRI}}").join(t.getLvlDescri(String(t.m_liv),t.m_statox)),s=s.split("{{TRANSITION_DESCRI}}").join(t.getLvlDescri(String(t.m_liv),t.m_statox)),t.sendEMail_ex(t.user_idp,i,o,s,t.id_applicativo,t.id_documento,t.app_info.COMPANY_SITE_ROOT+"#/"+t.app_info.modulo_swf+"/"+t.id_applicativo+"/"+t.id_documento+"/edit",t.m_obj.codice,"",!0,"",!1,"")}}))}}))},t.prototype.exec_wkf=function(t,e,i,n,o,s){var a=this;void 0===o&&(o=!1),console.log("exec_wkf trans ",t," liv ",e," arrdest ",i," comm ",n," crea_ver ",o," assegnati_paralleli ",s);var r=!1;null!=this.app_s.dev_mode&&"1"==this.app_s.dev_mode&&(r=!0),console.log("exec_wkf ",i,s),null==o&&(o=!1),this.dialogRef_ww=this.m_dialog.open(Nt,{disableClose:!0,data:{label:this.tsr.instant("Attendere")}}),this.ttw=0,null==s&&(s=JSON.parse(JSON.stringify(i)));var l=new gt;l.command="exec_app",l.p1=o?"create_ver":"exec_wkf";var p=this.uti_s.newGuid();l.p2=p;var u=new vt;u.sql="INSERT_WKF_OP",u.values=o?[p,JSON.stringify({transizione:{uiid_wkf:t.uiid_wkf,uiid:t.uiid,step_d:t.step_d,step_o:t.step_o},commento:n,id_applicazione:this.id_applicativo,id_documento:this.id_documento,username:this.app_s.user})]:[p,JSON.stringify({transizione:t,destinatari:i,commento:n,assegnati_paralleli:s,id_applicazione:this.id_applicativo,id_documento:this.id_documento,username:this.app_s.user,title:this.getTitle().split('"').join("_doppiap_"),descri:this.getDescri().split('"').join("_doppiap_"),dev_mode:r?1:0})],u.types=["string","string"],this.m_dataService.doQuery(u).subscribe((function(e){a.reset_updw(),a.m_fileservice.doQuery(l).subscribe((function(e){console.log(e),t.step_d>=900?a.doEnd(t.step_d):a.chstato(t.step_d),null!=a.dialogRef_ww&&null!=a.dialogRef_ww.componentInstance&&a.dialogRef_ww.componentInstance.update_progess(100),a.goto_edit_doc()}))}))},t.prototype.reset_updw=function(){var t=this;this.ttw+=10,null!=this.dialogRef_ww&&null!=this.dialogRef_ww.componentInstance&&this.dialogRef_ww.componentInstance.update_progess(this.ttw),setTimeout((function(){t.reset_updw()}),800)},t.prototype.back=function(t){var e=this,i=this.uti_s.get_diff_doc(this.old_doc,this.getfieldvalues());console.log(i);for(var n=[],o=0;o<i.length;o++)"-1"==i[o].val&&(i[o].val=""),"-1"==i[o].oldVal&&(i[o].oldVal="")," "==i[o].val&&(i[o].val="")," "==i[o].oldVal&&(i[o].oldVal=""),i[o].val instanceof Number&&i[o].oldVal instanceof String&&(i[o].oldVal=Number(i[o].oldVal.split(",").join(".")));for(o=0;o<i.length;o++)("update"!=i[o].op||"date"!=i[o].val&&"string"!=i[o].val)&&("add"==i[o].op&&null==i[o].val&&""==i[o].oldVal||i[o].val!=i[o].oldVal&&(""==i[o].val&&"0"==i[o].oldVal||"0"==i[o].val&&null==i[o].oldVal||i[o].val instanceof Date||n.push(i[o])));for(o=0;o<i.length;o++)i[o].val instanceof Date&&new Date(i[o].val).getTime()!=new Date(i[o].oldVal).getTime()&&n.push(i[o]);t&&0!=n.length?this.m_dialog.open(Ki,{disableClose:!0}).afterClosed().subscribe((function(t){"esci_senza_salv"==t&&e.m_router.navigate([e.app_info.modulo_swf]),"salva_esci"==t&&(e.evt_salv(),e.m_router.navigate([e.app_info.modulo_swf]))})):this.m_router.navigate([this.app_info.modulo_swf])},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,a,r,l,p,u,c,d){var _=this;void 0===p&&(p=!0),void 0===u&&(u=""),void 0===c&&(c=!0),void 0===d&&(d="");var h=!1;null!=this.app_s.dev_mode&&"1"==this.app_s.dev_mode&&(h=!0);var m={destinatari:e.split(","),commento:d,id_applicazione:o,id_documento:s,username:t,e_subject:i,e_body:n,dev_mode:h?1:0},f=new gt;f.command="exec_app",f.p1="send_email";var g=this.uti_s.newGuid();f.p2=g;var v=new vt;v.sql="INSERT_WKF_OP",v.values=[g,JSON.stringify(m)],v.types=["string","string"],this.m_dataService.doQuery(v).subscribe((function(t){_.m_fileservice.doQuery(f).subscribe((function(t){c&&_.goto_edit_doc(p)}))}))},t.prototype.goto_edit_doc=function(t){void 0===t&&(t=!0),this.m_router.navigate([this.app_info.modulo_swf]),t&&this.alert("Avanzamento effettuato",0)},t.prototype.addOverrideLvlUser=function(t){null==this.override_livs&&(this.override_livs=[]),this.override_livs.push(t)},t.prototype.getLvlInfo=function(t){for(var e=0;e<this.livs.length;e++)if(t==this.livs[e].step)return this.livs[e];return null},t.prototype.insert_commento=function(t,e,i,n){var o=new vt;o.sql="INSERT_WKF_COMMENTO",o.values=[t,e,i,n,""],o.types=["string","string","string","string","string"],this.m_dataService.doQuery(o).subscribe((function(t){null!=t&&t.result_msg}))},t.prototype.insert_wkf_variabile=function(t,e,i,n){var o=new vt;o.sql="insert_wkf_variabile",o.values=[t,e,i,n],this.m_wkf.doQuery(o).subscribe((function(t){null!=t&&t.result_msg}))},t.prototype.respingi=function(){this.can_save()&&(this.oper="respingi",this.btnprocedi=!0,this.update_status(!1,!1,null,null,8),this.salva())},t.prototype.procedi=function(){if(this.can_save()){if(this.oper="procedi",this.btnprocedi=!0,this.update_status(!1,!1,null,null,9),!this.ck_field())return this.update_status(!0,null,null,null,10),void(this.respingi_enabled&&this.update_status(!0,!0,null,null,11));this.salva()}},t.prototype.open_wkf=function(t,e,i){var n=this;void 0===e&&(e=!1),void 0===i&&(i=!0),console.log("inser_c = false,edit_c=true ",e,i);var o=this.app_s.getState().body_h-40+"px",s=this.m_dialog.open(Ui,{disableClose:!0,width:"95%",height:o,data:{edit_c:i}});setTimeout((function(){s.componentInstance.subject=n.app_info.descrizione_breve+", <OP>: "+n.m_obj.codice+" "+n.getTitle(),null!=n.m_obj.lettori?s.componentInstance.lettori=n.m_obj.lettori:s.componentInstance.lettori="",s.componentInstance.link=n.app_s.COMPANY_SITE_ROOT+"#/"+n.app_info.modulo_swf+"/"+n.id_applicativo+"/"+n.id_documento+"/edit",s.componentInstance.codice_doc=n.m_obj.codice,s.componentInstance.notifica_commenti=n.app_info.notifica_commenti,s.componentInstance.notifica_commenti_obbl=n.app_info.notifica_commenti_obbl,s.componentInstance.commenti_insert=e,s.componentInstance.init_v()})),s.afterClosed().subscribe((function(e){null==e&&"i"==e&&(console.log("inserito commento"),t.emit()),n.r_count()}))},t.prototype.open_commenti=function(t){var e=this,i=this.m_dialog.open(Mi,{disableClose:!0,width:"90%"});setTimeout((function(){i.componentInstance.subject=e.app_info.descrizione_breve+", <OP>: "+e.m_obj.codice+" "+e.getTitle(),null!=e.m_obj.lettori?i.componentInstance.lettori=e.m_obj.lettori:i.componentInstance.lettori="",i.componentInstance.link=e.app_s.COMPANY_SITE_ROOT+"#/"+e.app_info.modulo_swf+"/"+e.id_applicativo+"/"+e.id_documento+"/edit",i.componentInstance.codice_doc=e.m_obj.codice,i.componentInstance.notifica_commenti=e.app_info.notifica_commenti,i.componentInstance.notifica_commenti_obbl=e.app_info.notifica_commenti_obbl,i.componentInstance.init_v()})),i.afterClosed().subscribe((function(i){null!=i&&"i"==i&&(t.emit(),console.log("emetto insert")),e.r_count()}))},t.prototype.open_upload=function(t,e){var i=this;void 0===t&&(t=""),void 0===e&&(e="[ZZZ_DIS_CC]"),console.log("open_upload ",t,e);var n=this.m_dialog.open(Qi,{disableClose:!0,width:"90%",data:{admin_role:e,App:this.id_applicativo,K:this.id_documento}});setTimeout((function(){n.componentInstance.sovrascrivi_path=t})),n.afterClosed().subscribe((function(t){i.r_count()}))},t.prototype.create_new_document=function(){var t=this,e=new vt;e.sql="insert_new_doc_v2",null==this.c_canale&&(this.c_canale=""),e.values=[this.id_applicativo,this.id_documento,this.c_canale,this.user_idp],this.m_wkf.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.m_dataService.doQuery({sql:"INSERT_WORKFLOW_LOG",values:[t.id_applicativo,t.user_idp,"INSERIMENTO","INSERIMENTO DOCUMENTO",t.id_documento],types:["string","string","string","string","string"],names:[]}).subscribe((function(t){})),t.save_agg())}))},t.prototype.save_agg=function(){var t=this;this.before_save(),this.b_edit_before=this.b_edit&&this.b_rip_pulsanti,this.update_status(!1,null,null,null,12);var e=this.getfieldvalues(),i=new vt;i.sql="insert_aggiuntivi",i.types=["string","string"],i.values=[this.app_info.tabella_dati,this.id_documento],i.names=["tabella","id_documento"];for(var n=0;n<e.length;n++)i.types.push(e[n].types),i.names.push(e[n].names),null==e[n].values?e[n].values="dbnull":("boolean"==e[n].types&&(e[n].values?e[n].values="1":e[n].values="0"),"int"==e[n].types&&(e[n].values+""==""?e[n].values="dbnull":isNaN(e[n].values)?e[n].values="0":e[n].values=""+e[n].values),"string"==e[n].types&&(e[n].values=""+e[n].values),"date"==e[n].types&&(e[n].values=this.uti_s.sql_date(e[n].values),"NaN-NaN-NaN"==e[n].values.split("0").join("")&&(e[n].values="dbnull")),"datetime"==e[n].types&&(console.log("typeof ",typeof e[n].values,e[n].values),e[n].values=this.uti_s.sql_date_time(e[n].values),console.log("arr[i].values ",e[n].values),"NaN-NaN-NaN NaN:NaN"==e[n].values.split("0").join("")&&(e[n].values="dbnull")),"string"==e[n].types&&null==e[n].values&&(e[n].values="dbnull"),"decimal"==e[n].types&&(e[n].values+""==""?e[n].values="dbnull":isNaN(e[n].values)?e[n].values="0":e[n].values=""+e[n].values)),i.values.push(e[n].values);this.m_wkf.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.ok_insert_aggiuntivi()}),(function(t){}))},t.prototype.ok_insert_aggiuntivi=function(){this.btnprocedi?this.b_edit||this.btnprocedi?this.load_document():this.m_router.navigate([this.app_info.modulo_swf,this.id_applicativo,this.id_documento,"edit"]):(this.alert("DOCUMENTO SALVATO",0),this.after_save(),this.update_status(this.b_edit_before,null,null,null,13),this.b_edit||this.btnprocedi||this.m_router.navigate([this.app_info.modulo_swf,this.id_applicativo,this.id_documento,"edit"]))},t.prototype.load_document=function(){var t=this;if(null!=this.app_info){var e=new vt;e.sql="SELECT_WKF_DOCUMENT_NOREP",e.types=["string","string","string"],e.values=[this.app_info.vista_sql,this.id_applicativo,this.id_documento],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;i.length>0?t.ok_load_document(i[0]):t.alert("DOCUMENTO NON TROVATO",1)}}),(function(t){}))}else setTimeout((function(){t.load_document()}),200)},t.prototype.ok_load_document=function(t){var e=this;this.m_obj=JSON.parse(JSON.stringify(t)),null!=this.m_obj.assegnati_paralleli&&1!=this.m_obj.assegnati_paralleli.split(",").length&&this.m_obj.assegnati_paralleli.indexOf(this.app_s.user)>-1&&(this.b_assengna_a=!0),this.in_carico=!1,this.b_assengna_a&&(null==this.m_obj.autori||""==this.m_obj.autori||1!=this.m_obj.autori.split(",").length)&&(this.in_carico=!0),this.update_status(!1,null,this.b_assengna_a&&this.in_carico,this.b_assengna_a,14),this.save_to_app_state();var i=new vt;i.sql="SELECT_WLIVELLIV2_2",i.types=["string"],i.values=[this.id_applicativo],this.m_dataService.doQuery(i).subscribe((function(t){if(null!=t&&"OK"==t.result_msg){if(console.log("end SELECT_WLIVELLIV2_2",new Date),null!=e.override_livs&&null!=t.result_data)for(var i=0;i<e.override_livs.length;i++)for(var n=0;n<t.result_data.length;n++)null!=t.result_data[n].id_Applicativo&&t.result_data[n].id_Applicativo==e.override_livs[i].id_Applicativo&&(t.result_data[n].idp=e.override_livs[i].idp,t.result_data[n].context=e.override_livs[i].context,t.result_data[n].nc=e.override_livs[i].nc);t.result_data.map((function(t){null==t.username&&(t.username="SYSTEM")}));var o=new vt;o.sql="SELECT_WKF_VARIABILES_V2",o.types=["string"],o.values=[e.id_documento],e.m_dataService.doQuery(o).subscribe((function(i){if(null!=i&&"OK"==i.result_msg){if(console.log("SELECT_WKF_VARIABILES_V2 ",i.result_data),i.result_data.push({k:"*CURRENT_USER",v:e.app_s.user,nc:e.app_s.user_surname+" "+e.app_s.user_name}),null==e.m_obj.stato||e.m_obj.stato<=10)i.result_data.push({k:"*ALLUSERS",v:e.app_s.user,nc:e.app_s.user_surname+" "+e.app_s.user_name});else for(var n=0;n<i.result_data.length;n++)if("*REQUESTER"==i.result_data[n].k.split("CREATOR").join("REQUESTER")){i.result_data.push({k:"*ALLUSERS",v:i.result_data[n].v,nc:i.result_data[n].nc});break}console.log("SELECT_WKF_VARIABILES_V2 dopo add ",i.result_data),t.result_data.map((function(t){0==t.value.indexOf("*")&&(t.context=e.m_obj.canale,t.description="",t.name="",i.result_data.map((function(e){t.value.split("CREATOR").join("REQUESTER")==e.k.split("CREATOR").join("REQUESTER")&&(console.log("sostituisco k: ",e.k,e.v),t.username=e.v,t.nc=e.nc,t.ncx=e.nc,t.sost=!0)})))})),console.log("Var speciali ",i.result_data);var o=[];t.result_data.map((function(t){0!=t.value.indexOf("*")||t.sost?o.push(t):console.log("escludo! ",t)})),t.result_data=JSON.parse(JSON.stringify(o)),console.log("liv dopo SELECT_WKF_VARIABILES_V2 ",t.result_data),e.ok_livelli_doc(t.result_data)}}))}}))},t.prototype.ok_livelli_doc=function(t){if(console.log(),this.livs=t,this.over_canale_iniz(),this.m_obj.stato<=10)for(var e=0;e<this.livs.length;e++)this.livs[e].username.toUpperCase()!=this.user_idp.toUpperCase()&&"*ALLUSERS"!=this.livs[e].context||10==this.livs[e].step&&0==this.livs[e].notifica&&"*ALLUSERS"==this.livs[e].context&&(this.livs[e].context="",this.livs[e].username=this.user_idp);!this.b_edit||this.btnprocedi?this.btnprocedi&&this.doApprova():this.return_edit()},t.prototype.r_count=function(){var t=this,e=new vt;e.sql="SELECT_WKF_ALLEGATI_COUNTER",e.types=["string","string"],e.values=[this.id_applicativo,this.id_documento],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=e.result_data,n=0,o=0,s=0;s<i.length;s++)i[s].n>0&&("ALLEGATI"==i[s].v&&(n=i[s].n),"COMMENTI"==i[s].v&&(o=i[s].n));t.reset_counters_int(o,n)}}),(function(t){}))},t.prototype.reset_counters_int=function(t,e){t>0&&(this.comm_c=t),e>0&&(this.all_c=e)},t.prototype.set_canale_iniziale=function(t,e){void 0===e&&(e=!1),this.forza_canale=t,e&&this.over_canale_iniz()},t.prototype.over_canale_iniz=function(){if(null!=this.forza_canale&&""!=this.forza_canale){for(var t=0,e=0;e<this.livs.length;e++)(this.livs[e].step<t||0==t)&&(t=this.livs[e].step);for(e=0;e<this.livs.length;e++)this.livs[e].step==t&&(this.livs[e].context=this.forza_canale);this.m_obj.canale=this.forza_canale,this.c_canale=this.forza_canale}},t.prototype.ck_canale_multiplo=function(){var t=this;console.log("ck_canale_multiplo ",this.livs);for(var e=0,i=0;i<this.livs.length;i++)(this.livs[i].step<e||0==e)&&(this.clevel=this.livs[i],e=this.livs[i].step);console.log("min_liv ",e);var n=[];for(i=0;i<this.livs.length;i++)if(this.livs[i].step==e&&this.app_s.getState().wkf_doc_info.curr_user.toUpperCase()==this.livs[i].username.toUpperCase()){console.log(" this.livs[i].step ",this.livs[i].step,this.livs[i].username.toUpperCase(),this.livs[i].context);for(var o=!1,s=0;s<this.livs.length;s++)if(this.livs[s].context==this.livs[i].context){o=!0;break}o||(null!=this.livs[i].context?n.push(this.livs[i].context):n.push(""))}n.length<=1?(this.c_canale=n[0],this.create_new_document()):(this.app_s.getState().wkf_doc_info.canali_arr=n.sort((function(t,e){return t>e?1:t<e?-1:0})),this.m_dialog.open(Bi,{disableClose:!0}).afterClosed().subscribe((function(e){null!=e&&""!=e&&(t.c_canale=e,t.create_new_document())})))},t.prototype.open_info=function(){var t=this;this.s_uto="";for(var e=this.m_obj.autori.split(","),i=0;i<e.length;i++)for(var n=0;n<this.livs.length;n++)if(this.livs[n].idp==e[i]){""!=this.s_uto&&(this.s_uto=this.s_uto+","),this.s_uto=this.s_uto+this.livs[n].nc;break}this.app_s.getState().wkf_doc_info.in_carico_a=this.s_uto,this.m_obj.s_uto=this.s_uto,console.log("this.m_obj ",this.m_obj);var o=this.m_dialog.open(zi,{disableClose:!0,data:this.m_obj});setTimeout((function(){o.componentInstance.hide_richiedente=t.hide_richiedente})),o.afterClosed().subscribe((function(t){}))},t.prototype.setForceJump=function(t,e,i){var n=this;void 0===e&&(e=""),void 0===i&&(i=!0);for(var o,s="",a="",r="",l="",p="",u="",c=0;c<this.livs.length;c++)t!=this.livs[c].step||""!=e&&!this.livs[c].canale||(1==this.livs[c].email_ospiti&&1==this.livs[c].notifica||1==this.livs[c].email_partecipanti&&0==this.livs[c].notifica)&&(""!=a&&(a+=","),a+=this.livs[c].username),t!=this.livs[c].step||0!=this.livs[c].notifica||""!=e&&!this.livs[c].canale||(""!=s&&(s+=","),s+=this.livs[c].username,""!=p&&(p+=","),p+=this.livs[c].nc,u=this.livs[c].descri_livello);if(""==s)return"NESSUN UTENTE CONFIGURATO STEP: "+t+" CANALE: "+e;a=Array.from(new Set(a.split(","))).join(","),null==this.m_obj.partecipanti&&null!=this.m_obj.autori&&(this.m_obj.partecipanti=Array.from(new Set(this.m_obj.autori.split(","))).join(",")),this.m_obj.partecipanti=Array.from(new Set(this.m_obj.partecipanti.split(","))).join(","),o=this.app_info.documento_pubblico?[s,"",t,this.tsr.instant("Assegnata a")+": "+p,"",s,this.getLvlDescri(String(t),this.tsr.instant("Assegnata a")+": "+p),this.getUsersList(p,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento,e]:[s,this.m_obj.partecipanti+","+s,t,this.tsr.instant("Assegnata a")+": "+p,"",s,this.getLvlDescri(String(t),this.tsr.instant("Assegnata a")+": "+p),this.getUsersList(p,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento,e];var d=[];for(c=0;c<o.length;c++)d.push("string");var _=new vt;return _.sql="exec_app_workflow",_.values=[this.app_info.codice_documento,this.id_documento,""+this.m_obj.stato,""+t,this.user_idp],this.m_wkf.doQuery(_).subscribe((function(t){})),(_=new vt).sql="UPDATE_WKF_DOCUMENTOV3_NS",_.values=o,_.types=d,this.m_dataService.doQuery(_).subscribe((function(e){var o=!1;if(null!=e&&"OK"==e.result_msg){var s=new vt;s.sql="doWKF",s.values=[n.app_info.descrizione_breve,n.m_obj.codice,""+t,""+t,n.m_obj.codice+" - "+n.getTitle(),n.getTitle()+"La scheda numero: "+n.m_obj.codice+" è passata allo stato: "+u,n.app_s.COMPANY_SITE_ROOT+"#/"+n.app_info.modulo_swf+"/"+n.id_applicativo+"/"+n.id_documento+"/edit","In approvazione",n.getDescri(),n.user_idp,u,"",n.id_applicativo,n.id_documento,"1","0",""+n.m_obj.stato,""+t],n.insert_wkf_variabile(n.id_applicativo,n.id_documento,"PLAYER_"+n.m_obj.stato,n.user_idp),n.m_liv=t,n.m_wkf.doQuery(s).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(i&&""!=a?(r=n.app_info.descrizione_breve+", Ti è stato assegnato il documento numero: "+n.m_obj.codice+" "+n.getTitle()+" - "+n.getLvlDescri(String(n.m_liv),n.m_statox),l="<br>Attività:"+n.getLvlDescri(String(n.m_liv),n.m_statox)+"<br>"+n.m_statox+"<br>"+n.getDescri(),null!=n.app_info.subject_riassegna&&""!=n.app_info.subject_riassegna&&(r=n.app_info.subject_riassegna),null!=n.app_info.body_riassegna&&""!=n.app_info.body_riassegna&&(l=n.app_info.body_riassegna),r=r.split("{{TRANSITION_DESCRI}}").join(n.getLvlDescri(String(n.m_liv),n.m_statox)),l=l.split("{{TRANSITION_DESCRI}}").join(n.getLvlDescri(String(n.m_liv),n.m_statox)),n.sendEMail_ex(n.user_idp,a,r,l,n.id_applicativo,n.id_documento,n.app_s.COMPANY_SITE_ROOT+"#/"+n.app_info.modulo_swf+"/"+n.id_applicativo+"/"+n.id_documento+"/edit",n.m_obj.codice,"",!0,"",!0,"")):n.goto_edit_doc())})),o=!0}o||n.alert(e.msg,1)}),(function(t){})),"OK"},t.prototype.insert_doc=function(){var t=this;this.m_autori=this.user_idp,this.m_lettori="",this.m_statox="",this.m_danotificare="",this.m_oper="",this.m_autori_paralleli="",this.m_crea_att=0,this.m_send_email=0,this.clevel=null,this.nlevel=null,this.m_obj=new Object,this.id_documento=this.uti_s.newGuid(),this.m_obj.id_documento=this.id_documento,this.m_obj.codice="",this.m_obj.data_richiesta=new Date,this.m_obj.richiedente=this.user_idp,this.m_obj.autori=this.user_idp,this.m_obj.stato=0,this.m_obj.stat_stato="In Creazione",this.m_obj.richiesta_da=this.user_idp,this.m_obj.in_carico_a="",this.m_obj.nc=this.user_cognome+" "+this.user_nome,this.c_canale="",this.dtr=new Date,this.rich=this.user_idp,this.cod="",this.dt_scad=null,this.m_statox="",this.oggetto_editable=!0,this.descrizione_editable=!0,this.btnSalva_visible=!0,this.b_PrendiInCarico=!1,this.stat_stato_text="Bozza",this.creatore_text=this.user_cognome+" "+this.user_nome,this.pers_int_text=this.user_cognome+" "+this.user_nome,this.rich_enabled=!0,this.oggetto_text="",this.descrizione_text="",this.m_obj.stato_txt="",this.m_obj.stato=0,this.bEdit=!0,this.bEdit_wkf=!1,this.bEditOp_wkf=!1,this.bEditAp_wkf=!1,this.bEditAss_wkf=!1,this.bEditBozza_wkf=!1,this.bEdit_bozza=!1,this.bNuovaRev_Agg=!1,this.bEdit_Agg=this.bEdit_wkf,this.btnSalva_label=this.tsr.instant("SALVA"),this.btnTerminaOp_label=this.tsr.instant("Termina Attività"),this.btnApprova_label=this.tsr.instant("APPROVA"),this.btnAssegna_label=this.tsr.instant("Assegna"),this.btnRespingi_label=this.tsr.instant("RESPINGI"),this.uti_s.set_home_title(this.tsr.instant(this.app_info.descrizione_breve)+" - "+this.tsr.instant("Nuova Richiesta")),this.reset_form_v(this.tsr.instant(this.app_info.descrizione_breve)+" - "+this.tsr.instant("Nuova Richiesta")),this.reset_counters_int(0,0);var e=new vt;e.sql="SELECT_WLIVELLIV2_2",e.types=["string"],e.values=[this.id_applicativo],this.m_dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.ok_livw2(e.result_data)})),this.save_to_app_state()},t.prototype.ok_livw2=function(t){this.livs=t;for(var e=0,i=0;i<this.livs.length;i++)(this.livs[i].step<e||0==e)&&(e=this.livs[i].step);for(i=0;i<this.livs.length;i++)if(e==this.livs[i].step&&(null==this.livs[i].username&&(this.livs[i].username="ZZZ"),this.user_idp.toUpperCase()==this.livs[i].username.toUpperCase()||"*ALLUSERS"==this.livs[i].context)){this.update_status(!0,null,null,null,15);break}},t.prototype.reassigned_to=function(t){},t.prototype.after_save=function(){},t.prototype.before_save=function(){},t.prototype.can_save=function(){return!0},t.prototype.edit_doc=function(){this.load_document()},t.prototype.return_edit=function(){for(var t=this,e=0;e<this.livs.length;e++)if(this.livs[e].step==this.m_obj.stato){1==this.livs[e].abilita_indietro?this.respingi_enabled=!0:this.respingi_enabled=!1;break}null==this.m_obj.autori&&(this.m_obj.autori=""),-1!=(","+this.m_obj.autori.toLowerCase()+",").indexOf(","+this.user_idp.toLowerCase()+",")&&(console.log("this.m_obj.autori ",this.m_obj.autori),null!=this.m_obj.autori&&1!=this.m_obj.autori.split(",").length&&(this.in_carico=!0),null!=this.m_obj.assegnati_paralleli&&1!=this.m_obj.assegnati_paralleli.split(",").length&&this.m_obj.assegnati_paralleli.indexOf(this.app_s.user)>-1&&(this.b_assengna_a=!0),this.update_status(!0,!1,this.in_carico,this.b_assengna_a,16),this.respingi_enabled&&this.update_status(null,!0,this.in_carico,this.b_assengna_a,17));var i=new vt;i.sql="SELECT_WKF_PROC_CONFIG",i.values=[this.id_applicativo,this.id_documento],i.types=["string","string"],this.m_dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(e.result_data.length>0&&(t.next_label=e.result_data[0].next_label,t.next_label_color=e.result_data[0].next_label_color,t.next_back_ground_color=e.result_data[0].next_back_ground_color),t.b_init_next=!0)})),this.r_count(),this.s_uto="";var n=this.m_obj.autori.split(",");for(e=0;e<n.length;e++)for(var o=0;o<this.livs.length;o++)if(this.livs[o].username==n[e]){""!=this.s_uto&&(this.s_uto=this.s_uto+","),null!=this.livs[o].nc?this.s_uto=this.s_uto+this.livs[o].nc:this.s_uto=this.s_uto+this.livs[o].username;break}this.app_s.getState().wkf_doc_info.in_carico_a=this.s_uto,null==this.m_obj.v?this.uti_s.set_home_title(this.tsr.instant(this.app_info.descrizione_breve)+" "+this.m_obj.codice+" - "+this.tsr.instant(this.m_obj.stat_stato)):this.uti_s.set_home_title(this.tsr.instant(this.app_info.descrizione_breve)+" "+this.m_obj.codice+"/"+this.m_obj.v+" - "+this.tsr.instant(this.m_obj.stat_stato)),this.reset_form_v(this.tsr.instant(this.app_info.descrizione_breve)+" "+this.m_obj.codice+" - "+this.tsr.instant(this.m_obj.stat_stato)),this.old_doc=JSON.parse(JSON.stringify(this.getfieldvalues()))},t.prototype.reset_form_v=function(t){var e=this;console.log("reset_form_v ",this.loaded),this.loaded?(this.reset_form(t),this.old_doc=JSON.parse(JSON.stringify(this.getfieldvalues()))):setTimeout((function(){e.reset_form_v(t)}),500)},t.prototype.revisione=function(){var t=this;this.m_dialog.open(It,{disableClose:!0,data:{title_dialog:this.tsr.instant("Conferma Operazione"),msg_dialog:this.tsr.instant("Confermi di voler revisionare il documento?")}}).afterClosed().subscribe((function(e){if(e){var i=new vt;i.sql="UPDATE_DOCUMENTO_REV",i.values=[t.id_applicativo,t.id_documento],i.types=["string","string"],t.m_dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.alert(t.tsr.instant("Revisione generata"),0),window.location.reload())}))}}))},t.prototype.onResize=function(t){},t.prototype.init_engine=function(){var t=this;null!=this.app_s.user&&(this.user_idp=this.app_s.user),console.log("this.user_idp == null || this.m_route.params==null ",this.user_idp,this.m_route.params,new Date),null!=this.user_idp&&null!=this.m_route.params?(console.log("init_engine",new Date),this.init_user_i(),this.m_route.params.subscribe((function(e){var i=e.op;t.id_applicativo=e.idapp,t.id_documento=e.id_doc,console.log("qui!"),t.b_edit="new"!=i,t.init_app_wkf(),t.b_edit||t.id_applicativo.indexOf("_")>-1&&(t.simple_mode=!0,t.id_applicativo=t.id_applicativo.split("_").join("")),t.b_valid=!!t.id_applicativo,t.b_valid||t.alert("PARAMETRO APPLICAZIONE NON VALIDO",2)}))):setTimeout((function(){t.init_engine()}),500)},t.prototype.init_app_wkf=function(){console.log("init_app_wkf ",this.b_edit),this.b_edit?this.edit_doc():this.insert_doc()},t.prototype.ngAfterViewInit=function(){this.loaded=!0},t.prototype.setta_info_app=function(t){this.app_info=t},t.prototype.getLvlDescri=function(t,e){for(var i=0;i<this.livs.length;i++)if(t==this.livs[i].step)return""!=this.livs[i].step?this.livs[i].descri_livello:e;return e},t.prototype.getUsersList=function(t,e){var i="";return""!=t&&(i=t),""!=e&&(""!=i&&(i+=","),i+=e),""==i?"":this.getNames(i)},t.prototype.getNames=function(t){for(var e="",i=t.split(","),n=0;n<i.length;n++)for(var o=0;o<this.livs.length;o++)if(i[n].toUpperCase()==this.livs[o].username.toUpperCase()){""!=e&&(e+=","),e+=this.livs[o].nc;break}return e},t}();ln.decorators=[{type:n.Directive}],ln.ctorParameters=function(){return[{type:wt},{type:Dt},{type:d.Router},{type:e.MatDialog},{type:d.ActivatedRoute},{type:ei},{type:Ct},{type:Tt},{type:p.TranslateService}]},ln.propDecorators={onResize:[{type:n.HostListener,args:["window:resize",["event"]]}]},t.AppMakerService=Wt,t.AppService=wt,t.ApprovaGridComponent=Ae,t.AuthenticationService=ee,t.CheckboxEditorComponent=Yt,t.ComboBoxEditor=Re,t.CurrencyComponent=te,t.FHAutoCompleteComponent=me,t.FHCheckBox=Ri,t.FHComboboxComponent=_e,t.FHConfirmValues=St,t.FHCurrencyFormatterDirective=Te,t.FHCurrencyPipe=ke,t.FHDatePickerComponent=Ie,t.FHFieldPickListComponent=Ii,t.FHFormToolBarComponent=Kt,t.FHGridComponent=ce,t.FHGridComponentN=$i,t.FHGridJSONComponent=ui,t.FHGuard=en,t.FHHelpButton=Di,t.FHListComponent=Ne,t.FHLogPanelComponent=Ue,t.FHMdReader=je,t.FHNumericFieldComponent=Be,t.FHPickFieldComponent=zt,t.FHRichText=qe,t.FHRoleManager=Ai,t.FHTableManager=Oi,t.FHTextArea=Ht,t.FHTextInput=Ee,t.FHTimePickerComponent=Zt,t.FHUploadComponent=oe,t.FHUploadPanelComponent=ne,t.FHUploadPanelS3Component=Rt,t.FHUploadS3Component=Ft,t.FHUserFieldComponent=Qe,t.FSInput=gt,t.FSResult=on,t.FileService=Tt,t.FluxhubLibModule=tn,t.FormBuilderComponent=_i,t.FormExecuterComponent=hi,t.GridService=se,t.LocalDBService=pi,t.NumericEditorComponent=Jt,t.OdbcService=Qt,t.OfficeAutomatorService=ue,t.QGParam=le,t.QGResult=kt,t.QParam=vt,t.QResult=nn,t.QueryService=Dt,t.ReplaceLineBreaks=Me,t.TextAreaEditor=Le,t.UtilityService=Ct,t.WkfService=ei,t.dati_aggiuntivi=an,t.dati_aggiuntivi_v2=ln,t.fh_win_app_logs=Gt,t.fh_win_ask_big_text=bt,t.fh_win_ask_buttons=mi,t.fh_win_ask_number=Pe,t.fh_win_ask_richtext=Ji,t.fh_win_ask_text=re,t.fh_win_auto_complete=Fe,t.fh_win_combo=yt,t.fh_win_confirm=It,t.fh_win_list=He,t.fh_win_mappa=De,t.fh_win_output=Ge,t.fh_win_picklist=Mt,t.fh_win_select_by_grid=Zi,t.fh_win_show_email=ie,t.fh_win_show_email_s3=Lt,t.fh_win_show_image=fi,t.fh_win_show_log=Vt,t.fh_win_show_log_dett=jt,t.fh_win_time_slider=$t,t.fh_win_uploads=qt,t.fh_win_user_info=Ti,t.fh_win_user_picker=xe,t.fh_win_wait=Nt,t.fhimagepreview=gi,t.win_insert_commento=ki,t.win_salva_annulla=We,t.wkf_header_bar=di,t.wkf_header_bar_v2=Wi,t.wkfapp=sn,t.wkfapp_v2=rn,t.ɵa=Pt,t.ɵb=Bt,t.ɵba=ni,t.ɵbb=oi,t.ɵbc=si,t.ɵbd=ai,t.ɵbe=ri,t.ɵbf=li,t.ɵbg=ti,t.ɵbh=xi,t.ɵbi=Ei,t.ɵbj=Ci,t.ɵbk=Ki,t.ɵbl=Ni,t.ɵbm=Pi,t.ɵbn=Bi,t.ɵbo=Hi,t.ɵbp=Qi,t.ɵbq=Mi,t.ɵbr=zi,t.ɵbs=Ui,t.ɵbt=Vi,t.ɵbu=qi,t.ɵbv=Gi,t.ɵbw=Yi,t.ɵbx=Fi,t.ɵby=ji,t.ɵbz=Xi,t.ɵc=Si,t.ɵd=he,t.ɵe=de,t.ɵf=we,t.ɵg=Ke,t.ɵh=Ve,t.ɵi=Xt,t.ɵj=Ye,t.ɵk=Oe,t.ɵl=Li,t.ɵm=ge,t.ɵn=be,t.ɵo=ze,t.ɵp=Ut,t.ɵq=wi,t.ɵr=bi,t.ɵt=ci,t.ɵu=ae,t.ɵv=Je,t.ɵw=$e,t.ɵx=Xe,t.ɵy=Ze,t.ɵz=ii,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
17
17
|
//# sourceMappingURL=fluxhub-fluxhub-lib.umd.min.js.map
|