@fluxhub/fluxhub-lib 10.0.167 → 10.0.168

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.
@@ -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 Et=function(t,e){return(Et=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 xt(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Ot(arguments[e]));return t}Object.create;var Ct=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}(),At=function(){function t(t){this.app_s=t}return t.prototype.set_home_title=function(t){var e=this;setTimeout((function(){e.app_s.getState().topnavTitle=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 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.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.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 Ct).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.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;null!=a&&null!=r&&(l=this.get_diff_doc(a,r));var p=new vt;null!=l||null!=s?(p.sql="INSERT_LOG_N2",p.types=["string","string","string","string","string","string"],p.values=null!=l?[e,i,n,o,s,JSON.stringify(l)]:[e,i,n,o,s,null]):(p.sql="INSERT_LOG_N",p.types=["string","string","string","string"],p.values=[e,i,n,o]),t.doQuery(p).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}();At.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new At(n.ɵɵinject(wt))},token:At,providedIn:"root"}),At.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],At.ctorParameters=function(){return[{type:wt}]};var Dt=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 a.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(r.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 Dt})),r.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(a.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:a.HttpClient},{type:wt},{type:i.ToastrService}]};var kt=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 a.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(r.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 Dt})),r.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}();kt.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new kt(n.ɵɵinject(a.HttpClient),n.ɵɵinject(i.ToastrService),n.ɵɵinject(wt),n.ɵɵinject(At))},token:kt,providedIn:"root"}),kt.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],kt.ctorParameters=function(){return[{type:a.HttpClient},{type:i.ToastrService},{type:wt},{type:At}]};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}}\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){this._appservice=t,this._dataService=e,this.toastr=i,this.dialog=o,this.fileService=s,this.uti=a,this.enabled=!0,this.force_en=!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.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("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="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","Conferma Operazione"),localStorage.setItem(this._appservice.COMPANY_KEY+"msg_dialog","Confermi l'eliminazione dell'elemento?"),this.dialog.open(St).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","ALLEGATO ELIMINATO",{timeOut:1e3,progressBar:!0}))}))}}))},t.prototype.ngAfterViewInit=function(){},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,"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}();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\'\n "\n [fixed_label]="\n force_en\n ? \'Attachments description (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()"\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:kt},{type:i.ToastrService},{type:e.MatDialog},{type:Tt},{type:At}]},Rt.propDecorators={enabled:[{type:n.Input}],force_en:[{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}],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){var a=this;this._dataService=t,this.toastr=e,this.dialog=i,this.app_s=o,this.uti=s,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 500MB",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 l.FileUploader({url:this.app_s.API_ENDPOINT+this.app_s.UPLOAD_ENDPOINT+"_new",maxFileSize:524288e3}),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&&(a.descrizione="",a.toastr.info("INFO",a.allegato_inserito,{timeOut:1e3,progressBar:!0}),a.ref_allegato(),a.last_result={item:t,response:e,status:i,header:n},a.change.emit(a.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","Confermi l'eliminazione dell'elemento?"),this.dialog.open(St).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.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.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"\n ></FHComboBox\n >&nbsp;&nbsp;\n </div>\n <mat-form-field\n [hidden]="!show_descri"\n style="width: 100%"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label }} {{ fixed_label }}</mat-label>\n <input\n matInput\n type="text"\n name="descrizione"\n [(ngModel)]="descrizione"\n />\n </mat-form-field>\n &nbsp;&nbsp;&nbsp;&nbsp;\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">&nbsp;&nbsp;&nbsp;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" 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 &nbsp;<span style="font-size: 14px">&nbsp;&nbsp;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 &nbsp;&nbsp;&nbsp;&nbsp;\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 >&nbsp;&nbsp;&nbsp;\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:kt},{type:i.ToastrService},{type:e.MatDialog},{type:wt},{type:At}]},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.selval="-1",this.errorMsg="",this.valDef="-1",this.fltr_user="",this.value_list=new Array,this.single_sel=!1,this.vis_buttons=!0,this.limit_size=!1,this.value_list_sel=new Array,this.types=[],this.values=[],this.value_sel=[],null!=n&&(null!=n.value_list&&(this.value_list=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.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()},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.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()}else this.toastr.error("ERRORE","Selezionare il valore 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.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" fxFlex>\n <div fxLayout="row">\n <div fxLayout="column" fxFlex="41%">\n <div style="width:100%;height:420px;overflow:auto;">\n <table style="width: 100%" class="fh_table">\n <thead>\n <tr>\n <th>VALORI SELEZIONABILI</th>\n </tr>\n </thead>\n\n <tbody>\n <tr>\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"\n fxFlex="18%"\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 >\n <button\n mat-flat-button\n color="primary"\n (click)="do_add()"\n [disabled]="!option"\n >\n <mat-icon>arrow_forward</mat-icon>\n </button>\n <br /><br />\n <button\n mat-flat-button\n color="primary"\n (click)="do_rem()"\n [disabled]="option"\n >\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n </div>\n <div fxLayout="column" fxFlex="41%">\n <div style="width:100%;height:420px;overflow:auto;">\n <table style="width: 100%" class="fh_table">\n <thead>\n <tr>\n <th>VALORI SELEZIONATI</th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="let u of value_sel; 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 >&nbsp;&nbsp;&nbsp;\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="dialogRef.close()"\n >\n Annulla\n </button>\n </div>\n </div>\n ',styles:["\n .selector {\n cursor: hand;\n }\n "]}]}],Mt.ctorParameters=function(){return[{type:e.MatDialogRef},{type:kt},{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:p.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:"700px",height:"550px",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\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"\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:kt},{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="",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 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>DETTAGLIO MODIFICA - {{ title }}</h2>\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 '}]}],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,o,s){this.data=t,this.dialogRef=e,this._dataService=i,this.toastr=n,this.dialog=o,this.app_s=s,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}();Ut.decorators=[{type:n.Component,args:[{selector:"wkf_win_upload",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 <mat-toolbar color="primary" style="width:90%;"\n ><div fxFlex="20">{{ title }}</div>\n <div fxLayout="row" fxLayoutAlign="center end" fxFlex="90"></div>\n </mat-toolbar>\n <mat-dialog-content style="font-size:12px">\n\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\n </button>\n </div>\n ',styles:[""]}]}],Ut.ctorParameters=function(){return[{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]},{type:e.MatDialogRef},{type:kt},{type:i.ToastrService},{type:e.MatDialog},{type:wt}]},Ut.propDecorators={upc:[{type:n.ViewChild,args:["upc"]}]};var Vt=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}();Vt.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:[""]}]}],Vt.ctorParameters=function(){return[{type:e.MatDialogRef},{type:e.MatDialog},{type:wt},{type:At},{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){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="Back",this.mgs_edit="Edit",this.mgs_save="Save",this.b_commento=!1,this.log_enabled=!0,this.custom_commands=[],this.command=new n.EventEmitter}return t.prototype.logs=function(){this._dialog.open(Vt,{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}();qt.decorators=[{type:n.Component,args:[{selector:"FHFormToolBar",template:'\n <div fxLayout="row" fxLayoutGap="5px">\n <div\n fxLayout="row"\n fxLayoutGap="5px"\n [hidden]="is_editing"\n fxLayoutAlign="start center"\n >\n <button mat-flat-button [hidden]="!show_back" (click)="back()">{{ mgs_back }}</button\n >\n <button\n mat-flat-button\n color="primary"\n [hidden]="!editable"\n (click)="edit()"\n >\n <mat-icon>edit</mat-icon>&nbsp;&nbsp;{{ mgs_edit }}\n </button>\n <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>&nbsp;&nbsp;Logs\n </button>\n </div>\n <div\n fxLayout="row"\n fxLayoutGap="5px"\n [hidden]="!is_editing"\n fxLayoutAlign="start center"\n >\n <button mat-flat-button [hidden]="!show_back" (click)="back_ask_save()">{{ mgs_back }}</button>\n <button\n mat-flat-button\n color="primary"\n [hidden]="!show_save"\n (click)="save()"\n >\n <mat-icon>save</mat-icon>&nbsp;&nbsp;{{ mgs_save }}\n </button>\n\n <button [hidden]="!log_enabled"\n mat-flat-button\n *ngIf="App != \'\'"\n color="accent"\n (click)="logs()"\n >\n <mat-icon>assignment</mat-icon>&nbsp;&nbsp;Logs\n </button>\n </div>\n <div\n *ngIf="custom_commands.length > 0"\n fxLayoutGap="3px"\n fxLayout="row"\n fxLayoutAlign="end center"\n >\n <div *ngFor="let app of custom_commands" fxLayout="row"\n fxLayoutGap="5px">\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 }}\n </button>\n </div>\n </div>\n </div>\n ',styles:[""]}]}],qt.ctorParameters=function(){return[{type:e.MatDialog}]},qt.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:p.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Gt})),multi:!0},Gt=function(){function t(){this.hidden=!1,this.label="",this.enabled=!0,this.required=!1,this.rows=3,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}();Gt.decorators=[{type:n.Component,args:[{selector:"FHTextArea",providers:[Bt],template:'\n <mat-form-field [hidden]="hidden" appearance="outline" floatLabel="always"\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-form-field>\n ',styles:[""]}]}],Gt.ctorParameters=function(){return[]},Gt.propDecorators={hidden:[{type:n.Input}],label:[{type:n.Input}],enabled:[{type:n.Input}],required:[{type:n.Input}],rows:[{type:n.Input}],change:[{type:n.Output}],focusout:[{type:n.Output}],focusin:[{type:n.Output}]};var Kt=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}();Kt.decorators=[{type:n.Component,args:[{selector:"checkbox-cell",template:' <FHCheckBox [(ngModel)]="value"> </FHCheckBox> '}]}],Kt.ctorParameters=function(){return[]},Kt.propDecorators={input:[{type:n.ViewChild,args:["input",{read:n.ViewContainerRef}]}]};var Ht=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 a.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(r.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 Dt})),r.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t}();Ht.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new Ht(n.ɵɵinject(a.HttpClient),n.ɵɵinject(wt),n.ɵɵinject(i.ToastrService))},token:Ht,providedIn:"root"}),Ht.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],Ht.ctorParameters=function(){return[{type:a.HttpClient},{type:wt},{type:i.ToastrService}]};var Yt=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 a.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(r.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 Dt})),r.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),u.Observable.throw(e)},t}();Yt.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new Yt(n.ɵɵinject(a.HttpClient),n.ɵɵinject(wt),n.ɵɵinject(i.ToastrService))},token:Yt,providedIn:"root"}),Yt.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],Yt.ctorParameters=function(){return[{type:a.HttpClient},{type:wt},{type:i.ToastrService}]};var Qt=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}();Qt.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 />'}]}],Qt.ctorParameters=function(){return[{type:At}]},Qt.propDecorators={input:[{type:n.ViewChild,args:["input",{read:n.ViewContainerRef}]}]};var Xt=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}();Xt.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 '}]}],Xt.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:wt},{type:At}]};var Wt=function(){function t(t){this.model=t}return t.prototype.onInputChange=function(t,e){for(var i,n=t.toString().split(","),o=0;o<n.length;++o)n[o]=n[o].replace(/\D/g,"");if(0===n.length)i="";else{if(null!==n[0].match(/[0-9]{3}/gim)&&n[0].length>3){var s=Array.from(Array.from(n[0]).reverse().join("").match(/[0-9]{3}/gim).join()).reverse().join(""),a=n[0].replace(s.replace(/\D/g,""),"");i=(a.length>0?a+".":"")+s}else i=n[0];n.length>1&&(i+=","+n[1].substring(0,2))}this.model.valueAccessor.writeValue(i)},t}();Wt.decorators=[{type:n.Directive,args:[{selector:"[ngModel][decimal]",host:{"(ngModelChange)":"onInputChange($event)"}}]}],Wt.ctorParameters=function(){return[{type:p.NgControl}]};var $t={provide:p.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.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.ngChange=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(){this.m<60&&this.m++,this.sc()},t.prototype.dom=function(){this.m>0&&this.m--,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.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=parseInt(e[1]),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.getValue();this.selchange.emit(),this.ngChange.emit(t),this.onChange(t)},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:[$t],template:'\n <div fxLayout="row" fxLayoutAlign="center center" [hidden]="vertical && enabled">\n <b>{{ label }}</b\n >&nbsp;&nbsp;\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 <div *ngIf="enabled">\n <mat-icon (click)="doh()"\n >keyboard_arrow_down</mat-icon\n >\n </div>\n </div>\n\n &nbsp;&nbsp;<b style="font-size:28px">:</b>&nbsp;&nbsp;\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 style="width:40px;text-align:center;"\n (keydown)="onKeyDown1($event)"\n (focusout)="onMi()"\n [disabled]="!enabled"\n [(ngModel)]="m"\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"> &nbsp;&nbsp; &nbsp;&nbsp;\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 <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 &nbsp;&nbsp;&nbsp;&nbsp;\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>&nbsp;\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"> &nbsp;&nbsp; &nbsp;&nbsp;\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 <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 &nbsp;&nbsp;&nbsp;&nbsp;\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>&nbsp;\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:kt},{type:e.MatDialog},{type:wt},{type:i.ToastrService},{type:At}]},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}],arr_hh:[{type:n.Input}],arr_mm:[{type:n.Input}],selchange:[{type:n.Output}],ngChange:[{type:n.Output,args:["change"]}]};var Jt=function(){function t(){}return t.prototype.agInit=function(t){this.params=t},t.prototype.refresh=function(){return!0},t}();Jt.decorators=[{type:n.Component,args:[{selector:"currency-cell",template:'{{ params.value | currency: "EUR" }}'}]}];var te=function(){function t(t,e,i,n,o,s,r,l){this._dataService=t,this.toastr=e,this.http=i,this.router=n,this.route=o,this._fileService=s,this.app_s=r,this.uti_s=l,this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT,this.goto_after="",this.username="",this.headers=new a.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"),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(r.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 Dt})),r.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(r.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 Dt})),r.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(r.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 Dt})),r.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(r.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 Dt})),r.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(r.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 Dt})),r.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(r.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 Dt})),r.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}();te.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new te(n.ɵɵinject(kt),n.ɵɵinject(i.ToastrService),n.ɵɵinject(a.HttpClient),n.ɵɵinject(c.Router),n.ɵɵinject(c.ActivatedRoute),n.ɵɵinject(Tt),n.ɵɵinject(wt),n.ɵɵinject(At))},token:te,providedIn:"root"}),te.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],te.ctorParameters=function(){return[{type:kt},{type:i.ToastrService},{type:a.HttpClient},{type:c.Router},{type:c.ActivatedRoute},{type:Tt},{type:wt},{type:At}]};var ee=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.App=n.App,this.K=n.K;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_all=function(t){window.open(this.m_appService.COMPANY_SITE_ROOT+"/uploads/"+this.App+"/"+this.K+"/ant/"+t)},t}();ee.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}}\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="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 '}]}],ee.ctorParameters=function(){return[{type:e.MatDialogRef},{type:Tt},{type:wt},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var ie=function(){function t(t,e,i,o,s,a){this._appservice=t,this._dataService=e,this.toastr=i,this.dialog=o,this.auth_s=s,this.uti=a,this.enabled=!0,this.force_en=!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.show_upload=!0,this.b_initt=!1,this.change=new n.EventEmitter,this.call_upload=new n.EventEmitter,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=""}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,tipo:this.m_p_tipo,local_path:this._appservice.LOCAL_PATH,p1:this.m_programma_da_eseguire})},t.prototype.preview_email=function(t){this.dialog.open(ee,{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);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="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","Conferma Operazione"),localStorage.setItem(this._appservice.COMPANY_KEY+"msg_dialog","Confermi l'eliminazione dell'elemento?"),this.dialog.open(St).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("INFO","ALLEGATO ELIMINATO",{timeOut:1e3,progressBar:!0}))}),(function(t){}))}}))},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){setTimeout((function(){t.b_initt=!0}),700),t.upc.single=!1,t.b_mobile=t._appservice.getState().pageFullscreen,t.force_en?t.upc.init(t.App,t.K,"Attachment Description",t.m_p_tipo,t.m_programma_da_eseguire):t.upc.init(t.App,t.K,"Descrizione Allegato",t.m_p_tipo,t.m_programma_da_eseguire),t.m_p_tipo.indexOf("SELECT_")>-1&&(t.multi_list=!0),t.ref_allegato()})),"[ZZZ_DIS_CC]"!=this.ruolo_supervisore&&(this.access_control=!0)},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.ngAfterViewInit()},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}();ie.decorators=[{type:n.Component,args:[{selector:"FHUploadPanel",template:'\n <div fxLayout="column">\n <h3 *ngIf="label != \'\'">{{ label }}</h3>\n <div fxLayout="column">\n <div [hidden]="!enabled || !show_upload">\n <FHUpload\n [single]="b_False"\n\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\n [label_attendere]="\n force_en ? \'UPLOADING\' : \'ATTENDERE UPLOAD IN CORSO\'\n "\n [fixed_label]="\n force_en\n ? \'Attachments description (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()"\n (call_upload)="call_up($event)"\n #upc\n ></FHUpload>\n </div>\n <table width="98%" class="fh_table" *ngIf="!image_type && !b_mobile">\n <thead>\n <tr class="header">\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" style="width:60px;text-align:center">Dim.</th>\n <th [fxShow.lt-sm]="false" 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 <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 [fxShow.lt-sm]="false"\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.Filename }}</td>\n <td style="text-align:center" [fxShow.lt-sm]="false">{{ app.Filesize }}</td>\n <td [fxShow.lt-sm]="false">\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 *ngIf="multi_list">\n <div fxLayout="row">\n <a\n mat-icon-button\n matTooltip="Modifica Tipo"\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 \'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 <td style="text-align:center">\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\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 [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" style="width:60px;text-align:center">Dim.</th>\n\n <th [fxShow.lt-sm]="false" style="width:20%">\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 <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 [fxShow.lt-sm]="false"\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 [fxShow.lt-sm]="false">{{ app.Filename }}</td>\n <td [fxShow.lt-sm]="false" style="text-align:center">{{ app.Filesize }}</td>\n <td [fxShow.lt-sm]="false">\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 *ngIf="multi_list">\n <div fxLayout="row">\n <a\n mat-icon-button\n matTooltip="Modifica Tipo"\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 \'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">{{ app.Filename }}</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 <td style="text-align:center">\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\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.Filename }}<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:[""]}]}],ie.ctorParameters=function(){return[{type:wt},{type:kt},{type:i.ToastrService},{type:e.MatDialog},{type:te},{type:At}]},ie.propDecorators={enabled:[{type:n.Input}],force_en:[{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}],change:[{type:n.Output}],call_upload:[{type:n.Output}],upc:[{type:n.ViewChild,args:["upc"]}]};var ne=function(){function t(t,e,i,o,s){var a=this;this._dataService=t,this.toastr=e,this.dialog=i,this.app_s=o,this.uti=s,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 500MB",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.fill_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 l.FileUploader({url:this.app_s.API_ENDPOINT+this.app_s.UPLOAD_ENDPOINT,maxFileSize:524288e3}),this.id=null,this.show_upload=!0,this.id_component=this.uti.newGuid(),this.username=this.app_s.user,this.uploader.onBeforeUploadItem=function(t){t.withCredentials=!1},this.uploader.onCompleteItem=function(t,e,i,n){200===i&&(a.descrizione="",a.toastr.info("INFO",a.allegato_inserito,{timeOut:1e3,progressBar:!0}),a.ref_allegato(),a.last_result={item:t,response:e,status:i,header:n},a.change.emit(a.last_result))}}return 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.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(St).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.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.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.limit_string.split("<size>").join(""+o));break;default:t.toastr.error("Errore: "+i.name)}}}))},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;if(this.descri_obb&&""==this.descrizione)this.toastr.error(this.inserire_descrizione);else{for(var i=0;i<this.lista_allegati.length;i++)if(this.lista_allegati[i].Filename.toLowerCase()==t.file.name.toLowerCase())return void this.toastr.error("File già presente (cancellarlo per aggiornarlo)");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),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.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===n&&(n=""),void 0===o&&(o=""),void 0===s&&(s=!1),void 0===a&&(a=!1),void 0===r&&(r=!0),this.App=t,this.K=e,this.label=i,this.tipo=n,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.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",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}();ne.decorators=[{type:n.Component,args:[{selector:"FHUpload",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"\n ></FHComboBox\n >&nbsp;&nbsp;\n </div>\n <mat-form-field\n [hidden]="!show_descri"\n style="width: 100%"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label }} {{ fixed_label }}</mat-label>\n <input\n matInput\n type="text"\n name="descrizione"\n [(ngModel)]="descrizione"\n />\n </mat-form-field>\n &nbsp;&nbsp;&nbsp;&nbsp;\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">&nbsp;&nbsp;&nbsp;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" 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 &nbsp;<span style="font-size: 14px">&nbsp;&nbsp;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 &nbsp;&nbsp;&nbsp;&nbsp;\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 >&nbsp;&nbsp;&nbsp;\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 </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 && 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"]}]}],ne.ctorParameters=function(){return[{type:kt},{type:i.ToastrService},{type:e.MatDialog},{type:wt},{type:At}]},ne.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}],lista_allegati:[{type:n.Input}],change:[{type:n.Output}],upload_ended:[{type:n.Output}],call_upload:[{type:n.Output}],fill_end:[{type:n.Output}],select_file:[{type:n.ViewChild,args:["select_file"]}],cmb_tipo:[{type:n.ViewChild,args:["cmb_tipo"]}]};var oe=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 a.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(r.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 Dt})),r.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t}();oe.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new oe(n.ɵɵinject(a.HttpClient),n.ɵɵinject(wt),n.ɵɵinject(i.ToastrService))},token:oe,providedIn:"root"}),oe.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],oe.ctorParameters=function(){return[{type:a.HttpClient},{type:wt},{type:i.ToastrService}]};var se=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}();se.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 "]}]}],se.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:wt}]};var ae=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}();ae.decorators=[{type:n.Component,args:[{selector:"app-win_ask_text",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>{{ title }}</h2>\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 >&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="chiudi()">ANNULLA</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</button>\n </div>\n </mat-dialog-actions>\n '}]}],ae.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var re=function(){this.filter="",this.system_dest=1},le=function(){},pe=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 le;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){var n=this;void 0===i&&(i=null),this.eprog=0;var o=new vt;return o.sql="INSERT_OFFICE_OPERATION",o.types=["string","string"],e.sort((function(t,e){return t.ord<e.ord?-1:t.ord>e.ord?1:void 0})),o.values=[t,JSON.stringify(e)],this.dataService.doQuery(o).pipe(r.flatMap((function(e){if(null!=e&&"OK"==e.result_msg){var o=new gt;return o.command="exec_app",o.p1="print_manager",o.p2=t,null!=i&&setTimeout((function(){n.progress_update(i)}),2e3),n.fileService.doQuery(o).pipe(r.flatMap((function(t){if(null!=t&&"OK"==t.result_msg)return new u.Observable((function(e){setTimeout((function(){!0}),18e4);n.eprog=100,n.progress_update(i),e.next(t),e.complete()}))})))}})))},t}();pe.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new pe(n.ɵɵinject(kt),n.ɵɵinject(Tt),n.ɵɵinject(i.ToastrService))},token:pe,providedIn:"root"}),pe.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],pe.ctorParameters=function(){return[{type:kt},{type:Tt},{type:i.ToastrService}]};var ue=function(){function t(t,e,i,o,s,a,r,l,p,u){var c=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.end_point=null,this.tbl_name="",this.count_tbl_name="",this.num_per_pag=35,this.grid_key="PRO_H",this.sort_field="",this.fields="*",this.filters="1=1",this.enabled=!0,this.auto_load=!0,this.auto_height=!1,this.abilita_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_paste=!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.dataSource={getRows:function(t){c.slimLoadingBarService.start((function(){}));var e=new re;if(e.table=c.tbl_name,e.table_count=c.tbl_name,""!=c.count_tbl_name&&(e.table_count=c.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),e.sort_field=c.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('"+c.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=c.system_dest,e.field=c.fields,null!=c.filters&&(e.filter=c.filters),""!=c.fix_flt&&(""!=e.filter&&(e.filter=e.filter+" and "),e.filter=e.filter+" ("+c.fix_flt+" )"),""!=c.fix_flt_temp&&(""!=e.filter&&(e.filter=e.filter+" and "),e.filter=e.filter+" ("+c.fix_flt_temp+" )");var n=e.filter;if(null!=t.filterModel)for(var o in t.filterModel){var s=t.filterModel[o];console.log(t.filterModel[o],o),null==s.operator?""==e.filter?e.filter+=c.calcola_filtro(t.filterModel[o],"",o,!1):e.filter+=c.calcola_filtro(t.filterModel[o],"",o,!0):(""!=e.filter&&(e.filter+=" and "),e.filter+=" (",e.filter+=c.calcola_filtro(t.filterModel[o].condition1,"",o,!1),e.filter+=" "+s.operator+" ",e.filter+=c.calcola_filtro(t.filterModel[o].condition2,"",o,!1),e.filter+=")")}""==e.filter||n==e.filter?c.show_pulisci_filtri=!1:c.show_pulisci_filtri=!0,c.str_curr_q_p="",""!=e.filter&&(c.str_curr_q_p="where "+e.filter),""!=e.sort_field&&(c.str_curr_q_p=c.str_curr_q_p+" order by "+e.sort_field),c.curr_filter=e.filter,console.log("this.filter ",c.filters," p.filter ",e.filter),c._gridservice.doQuery(e,!0,c.end_point).subscribe((function(i){var n=!1;if(null!=i&&"OK"==i.result_msg){n=!0,t.successCallback(i.result_data,i.count),c.b_init=!0,c.myData=i.result_data.slice(),c.num_r=i.count,c.slimLoadingBarService.complete(),c.fill_end.emit(),localStorage.setItem(c.grid_key+"_POS1",JSON.stringify(e)),null!=localStorage.getItem(c.grid_key+"_POS2")&&null!=c.gridOptions&&null!=c.gridOptions.api&&c.gridOptions.api.forEachNode((function(t){c.getRowNodeId(t)===localStorage.getItem(c.grid_key+"_POS2")&&(t.setSelected(!0),localStorage.removeItem(c.grid_key+"_POS2"))}));null!=c.toggle_mantieni&&c.toggle_mantieni.checked,c.no_pref&&!c.b_init1&&c.autoSizeAll(),c.b_init1=!0,c.ensure_visible(),null==localStorage.getItem(c.grid_key+"_COLS")&&c.autosize_at_ini&&setTimeout((function(){c.autoSizeAll()}),300)}n||(c.errorMsg=i.msg+" ["+i.result_msg+"]")}),(function(t){c.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(){c.export_excel()},icon:'<img src="assets/icons/square-o/xlsx.svg"/>'}]},this.gridOptions={debug:!1,headerHeight:this.header_h,floatingFilter:!0,enableRangeSelection:!0,defaultColDef:{resizable:!0,sortable:!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={})}return 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(St,{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(St,{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(ae,{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.calcola_filtro=function(t,e,i,n){void 0===n&&(n=!0);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 '%"+t.filter.replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()+"%' ESCAPE '$'"),"startsWith"==t.type&&(e=e+" upper("+i+") like '"+t.filter.replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()+"%' ESCAPE '$'"),"equals"==t.type&&(e=e+" upper("+i+") = '"+t.filter.replace("'","''").toUpperCase()+"%'"),"notContains"==t.type&&(e=e+"not upper("+i+") like '%"+t.filter.replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()+"%' ESCAPE '$'"),"notEqual"==t.type&&(e=e+" upper("+i+") <> '"+t.filter.replace("'","''").toUpperCase()+"'"),"endsWith"==t.type&&(e=e+" upper("+i+") like '%"+t.replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()+"' 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=!1;if(null!=t.values)for(var l=0;l<t.values.length;l++)null!=t.values[l]?(""!=a&&(a+=","),a=a+"'"+t.values[l].replace("'","''")+"'"):r=!0;var p=-1,u=this.gridOptions.api.getColumnDef(i);if(console.log("countryFilterComponent ",u),null!=u&&null!=u.filterParams&&null!=u.filterParams.values){var c=u.filterParams.values;c=c.filter((function(t,e){return c.indexOf(t)===e})),console.log("model ",c),null!=c&&(p=c.length)}console.log("obj_filtro.values.length!=num_all ",t.values.length,p),""!=a?t.values.length!=p&&(!0,n&&(e+=" and "),e=r?e+"("+i+" in ("+a+") or "+i+" is null)":e+i+" in ("+a+")"):(!0,n&&(e+=" and "),r?e=e+" "+i+" is null":e+=" (1=0)")}return e},t.prototype.onBtExport=function(){this.export_excel()},t.prototype.sendToClipboard=function(t,e,i){e.copySelectedRowsToClipboard(!1)},t.prototype.setHeaderHeight=function(t){var e=this;this.header_h=t,this.gridOptions.api.setHeaderHeight(this.header_h),this.enable_paste||(this.gridOptions.sendToClipboard=function(t){e.clipboard.copy(t.data),e.last_copy!=t.data&&(e.last_copy=t.data,e.sendToClipboard(t,e.gridOptions.api,e.last_copy))})},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(se,{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.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>15e3)this._toast.error("Massimo 15000 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++)""!=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++)),i.push(this.officeService.operation("GB_CREA_TABELLA_FROM_DB","select "+n+" 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).subscribe((function(i){setTimeout((function(){e.dialogRef_W.componentInstance.update_progess(100)}));var n=new gt;n.p1=e.m_appService.LOCAL_PATH+"grid_reports\\"+e.uiid_stampa+"_"+e.m_appService.user+t,n.command="check_file",e._fileService.doQuery(n).subscribe((function(i){if(null!=i)if("N"==i.msg){var n=new vt;n.sql="SELECT_OFFICE_OPERATION_FINISCHED",n.types=["string"],n.values=[e.uiid_stampa],e._dataService.doQuery(n).subscribe((function(t){null!=t&&"OK"==t.result_msg&&t.result_data.length>0?e._toast.error(t.result_data[0].result_msg):e._toast.error("ERRORE DI STAMPA")}))}else 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++)e[n].length>2?i.push(e[n]):this._toast.error("ignorato termine: "+e[n]+" troppo corto");if(0==i.length)return;for(var o="",s=0;s<this.columnDefs.length;s++)if(null!=this.columnDefs[s]&&null==this.columnDefs[s].no_filter&&null!=this.columnDefs[s].field&&""!=this.columnDefs[s].field&&"agDateColumnFilter"!=this.columnDefs[s].filter)for(n=0;n<i.length;n++)""!=o&&(o+=" or "),o=o+this.columnDefs[s].field+" LIKE '%"+this.uti_s.string_sqlvalue(i[n]).replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()+"%' ESCAPE '$'";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.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.gridOptions.api.sizeColumnsToFit()}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++)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]).replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()+"%' ESCAPE '$'";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,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}();ue.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 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <div fxLayout="row" fxLayoutGap="3px" fxLayoutAlign="start center">\n <div>\n <h5>{{num_r}}&nbsp;{{label_elementi}}</h5>\n </div>\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n\n <div fxLayout="row" fxLayoutAlign="start center">\n <input\n matInput\n [placeholder]="trova_label"\n (keydown)="keyDownFunctioncl($event)"\n [(ngModel)]="ric_libera"\n style="\n min-width: 100px;\n max-width: 180px;\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>&nbsp;\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>compare_arrows</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\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 &nbsp;\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 &nbsp;&nbsp;&nbsp;&nbsp;\n\n <img\n *ngIf="abilita_export"\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="abilita_export"\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 style="width: 100%;"\n *ngIf="enabled"\n >\n <FHGridToolBar\n (command)="docmd($event)"\n [type]="toolbar_type"\n [custom_commands]="toolbar_custom_commands"\n [toolbar_wkfapp]="toolbar_wkfapp"\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\n [getContextMenuItems]="abilita_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:[""]}]}],ue.ctorParameters=function(){return[{type:oe},{type:i.ToastrService},{type:kt},{type:wt},{type:d.SlimLoadingBarService},{type:e.MatDialog},{type:At},{type:pe},{type:Tt},{type:h.Clipboard}]},ue.propDecorators={end_point:[{type:n.Input}],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}],enabled:[{type:n.Input}],auto_load:[{type:n.Input}],auto_height:[{type:n.Input}],abilita_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_paste:[{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 ce={provide:p.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return de})),multi:!0},de=function(){function t(t,e){this._dataService=t,this._dataService_odbc=e,this.init_fill=!0,this.sql="",this.types=[],this.values=[],this.hidden=!1,this.label="",this.enabled=!0,this.required=!1,this.sel_label="",this.tooltip="",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.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.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("$")){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){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&&this.setByDescri(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.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&&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();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=o[0],this.add_option(n)}this.setByValue(this.valDef),this.is_loaded=!0,"-1"==this.getValue()&&this.setByDescri(this.valDef)},t.prototype.doFill=function(){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.fillCombo()}else t.errorMsg="";t.initend.emit(),setTimeout((function(){t.is_loaded=!0}),1e3)}))},t.prototype.sc=function(){this.onChange(this.getValue()),this.selchange.emit({event:this.getObj(),valore:this.getValue(),descrizione_valore:this.getDescri()})},t.prototype.getModelValue=function(){return this.getData("valore")},t.prototype.writeValue=function(t){this.resetValue(),this.setByValue(t)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}();de.decorators=[{type:n.Component,args:[{selector:"FHComboBox",providers:[ce],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)"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label }}</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">{{ 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 [matTooltip]="tooltip"\n />\n </mat-form-field>\n ',styles:[""]}]}],de.ctorParameters=function(){return[{type:kt},{type:Ht}]},de.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}],tooltip:[{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:p.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return _e})),multi:!0},_e=function(){function t(t,e){this._dataService=t,this._dataService_odbc=e,this.init_fill=!0,this.sql="",this.label="",this.types=[],this.values=[],this.hidden=!1,this.id_loading=!1,this.db_type="1",this.enabled=!0,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.sItem="",this.searchItemsFiltered=[],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){this.searchItemsFiltered=[];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.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(){this.fillCombo()},t.prototype.fillCombo=function(){var t=this;this.myData=new Array,this.searchItemsFiltered=new Array;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}}))},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);t.fillCombo()}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}();_e.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)"\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 (keyup)="onChange_up($event)"\n [(ngModel)]="sItem"\n (focus)="fi_search()"\n (focusout)="fo_search($event)"\n #searchp\n />\n </mat-form-field>\n <mat-autocomplete\n #auto="matAutocomplete"\n (optionSelected)="selectedSearchItem($event)"\n autoActiveFirstOption\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"\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:[""]}]}],_e.ctorParameters=function(){return[{type:kt},{type:Ht}]},_e.propDecorators={init_fill:[{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}],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}],searchp:[{type:n.ViewChild,args:["searchp"]}],auto:[{type:n.ViewChild,args:["auto"]}]};for(var me=m,fe={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMMM Y",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM Y"}},ge=[],ve=1;ve<=31;ve++)ge.push(String(ve));var ye=function(t){function e(){var e=t.apply(this,xt(arguments))||this;return e.localeData=me.localeData(),e}return function(t,e){function i(){this.constructor=t}Et(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 ge},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 me([t,e,i])},e.prototype.today=function(){return me()},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=me(t,e,!0);return o.isValid()||(o=me(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=me.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:m.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 me.isMoment(t)},e.prototype.toIso8601=function(t){return t.format()},e.prototype.fromIso8601=function(t){return me(t)},e.prototype.invalid=function(){},e}(f.DateAdapter),be={provide:p.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Ie})),multi:!0},we=fe,Ie=function(){function t(t,e){this.dateAdapter=t,this.uti_s=e,this.label="",this.required=!1,this.show_buttons=!1,this.enabled=!0,this.min_date=null,this.max_date=null,this.change=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.dateAdapter.setLocale("it-IT")}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 ye,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.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 ye;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 ye;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 ye;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.prototype.setLimits=function(){},t.prototype.setToday=function(){this.date_sel=new Date},t.prototype.setValue=function(t){if(this.dateAdapter.setLocale("it-IT"),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 ye;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:[be,{provide:f.MAT_DATE_FORMATS,useValue:we},{provide:f.DateAdapter,useClass:ye},{provide:f.MAT_DATE_LOCALE,useValue:"it-IT"}],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"\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-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:f.DateAdapter},{type:At}]},Ie.propDecorators={label:[{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"]}]};var Se=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.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))}return t.prototype.filtra=function(){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))if(null==this.user_sel)this.users_list_sel.push(this.users_list[t]);else{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.filtra())}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"}))}else{if(null!=t.user_sel&&t.user_sel.length>0)return;if(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])}}))},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),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}();Se.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</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 }}</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 (mouseover)="selectedAdd = u"\n\n (click)="addTo(u)"\n (dblclick)="do_add()"\n\n class="sel_r"\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 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 >\n <button\n mat-flat-button\n color="primary"\n (click)="do_add()"\n [disabled]="!option"\n >\n <mat-icon>arrow_forward</mat-icon>\n </button>\n <br /><br />\n <button\n mat-flat-button\n color="primary"\n (click)="do_rem()"\n [disabled]="option"\n >\n <mat-icon>delete</mat-icon>\n </button>\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</th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="let u of user_sel; let odd = odd; let even = even"\n (mouseover)="selectedRemove = u"\n (click)="removeTo(u)"\n (dblclick)="do_rem()"\n class="sel_r"\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 >&nbsp;&nbsp;&nbsp;\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 ',styles:["\n\n\n "]}]}],Se.ctorParameters=function(){return[{type:kt},{type:e.MatDialogRef},{type:i.ToastrService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Se.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 Ee={provide:p.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Oe})),multi:!0},Oe=function(){function t(){this.hidden=!1,this.label="",this.enabled=!0,this.required=!1,this.email=!1,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}();Oe.decorators=[{type:n.Component,args:[{selector:"FHTextInput",providers:[Ee],template:'\n <mat-form-field [hidden]="hidden" appearance="outline" floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n <input\n matInput\n [email]="email"\n type="text"\n [(ngModel)]="text_v"\n [disabled]="!enabled"\n [required]="required"\n (focusout)="onFu()"\n (focusin)="onFi()"\n (ngModelChange)="modelch()"\n />\n </mat-form-field>\n ',styles:[""]}]}],Oe.ctorParameters=function(){return[]},Oe.propDecorators={hidden:[{type:n.Input}],label:[{type:n.Input}],enabled:[{type:n.Input}],required:[{type:n.Input}],email:[{type:n.Input}],change:[{type:n.Output}],focusout:[{type:n.Output}],focusin:[{type:n.Output}]};var xe=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}();xe.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 "]}]}],xe.propDecorators={container:[{type:n.ViewChild,args:["container",{read:n.ViewContainerRef}]}]};var Ce="000000",Ae=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}();Ae.decorators=[{type:n.Pipe,args:[{name:"FHCurrency"}]}],Ae.ctorParameters=function(){return[]};var De=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}();De.decorators=[{type:n.Directive,args:[{selector:"[FHCurrencyFormatter]"}]}],De.ctorParameters=function(){return[{type:n.ElementRef},{type:Ae}]},De.propDecorators={onFocus:[{type:n.HostListener,args:["focus",["$event.target.value"]]}],onBlur:[{type:n.HostListener,args:["blur",["$event.target.value"]]}]};var Te=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.title="",this.sql_dett="",this.descri="",this.lat=51.673858,this.long=7.815982,this.zoom=7,this.infoWindowOpened=null,this.markers=[],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.infoWindowOpened!==e&&(null!==this.infoWindowOpened&&this.infoWindowOpened.close(),this.infoWindowOpened=e)},t.prototype.ngAfterViewInit=function(){},t}();Te.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="min-width:800px;min-height:500px;font-size: 15px;"\n >\n <agm-map\n [zoom]="zoom"\n width="100%"\n height="100%"\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 <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 "]}]}],Te.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:wt}]};var ke=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}();ke.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!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="this.params.api.stopEditing();">ANNULLA</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 "]}]}],ke.propDecorators={container:[{type:n.ViewChild,args:["container",{read:n.ViewContainerRef}]}],appdt:[{type:n.ViewChild,args:["appdt"]}]};var Le=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}();Le.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!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="this.params.api.stopEditing();">ANNULLA</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.ctorParameters=function(){return[{type:kt}]},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.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){var e=new vt;e.sql=this.sql,e.types=this.types,e.values=this.values,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}();Re.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 >&nbsp;&nbsp;&nbsp;\n </td>\n </tr>\n </tbody>\n </table>\n ',styles:[""]}]}],Re.ctorParameters=function(){return[{type:kt}]},Re.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 Ne=function(){function t(){}return t.prototype.transform=function(t){return""+t.replace(/\n/g,"<br/>")},t}();Ne.decorators=[{type:n.Pipe,args:[{name:"replaceLineBreaks"}]}];var Fe=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.title="",this.label="",this.valore="",this.valore_min=1,this.valore_max=1e6}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}();Fe.decorators=[{type:n.Component,args:[{selector:"app-win_ask_text",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>{{ title }}</h2>\n <mat-dialog-content style="font-size: 15px;">\n <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n <input matInput type="number" [(ngModel)]="valore" required />\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-flat-button color="primary" (click)="do_check()">OK</button\n >&nbsp;&nbsp;&nbsp;<button\n mat-flat-button\n color="warn"\n (click)="chiudi()"\n >\n ANNULLA\n </button>\n </mat-dialog-actions>\n '}]}],Fe.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService}]};var Me=function(){function t(t){this.platformId=t}return t.prototype.highlightAll=function(){g.isPlatformBrowser(this.platformId)&&Prism.highlightAll()},t}();Me.decorators=[{type:n.Injectable}],Me.ctorParameters=function(){return[{type:Object,decorators:[{type:n.Inject,args:[n.PLATFORM_ID]}]}]};var Pe=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}();Pe.decorators=[{type:n.Component,args:[{selector:"FHMdReader",template:' <markdown [src]="path_md"> </markdown> ',styles:[""]}]}],Pe.ctorParameters=function(){return[{type:Me}]},Pe.propDecorators={path_md:[{type:n.Input}]};var ze=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 i.getFullYear()<1980?" ------ ":e.uti.pad(i.getDate(),2)+"/"+e.uti.pad(i.getMonth()+1,2)+"/"+i.getFullYear()}}],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}();ze.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:[""]}]}],ze.ctorParameters=function(){return[{type:At}]},ze.propDecorators={g_height:[{type:n.Input}],datagrid:[{type:n.ViewChild,args:["dtm"]}]};var je={provide:p.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Ue})),multi:!0},Ue=function(){function t(){this.decimal=2,this.label="",this.required=!1,this.enabled=!0,this.hidden=!1,this.color="",this.m_color="",this.label_width="",this.change=new n.EventEmitter,this.focus=new n.EventEmitter,this.focus_out=new n.EventEmitter,this.enter_pressed=new n.EventEmitter,this.innerValue=0,this.onChange=function(t){},this.onTouched=function(){},this.formattedAmount="0,00",this.value=0,this.set_color(this.color)}return t.prototype.kd=function(t){"Enter"==t.code&&this.enter_pressed.emit()},t.prototype.getStyle_color=function(){return this.m_color},t.prototype.getStyle_mw=function(){return this.label_width},t.prototype.set_color=function(t){this.m_color=t},t.prototype.chg=function(){var t=this;setTimeout((function(){0==t.decimal?t.value=parseFloat(t.formattedAmount.split(".").join("").split(",").join("")):t.value=parseFloat(t.formattedAmount.split(".").join("").split(",").join(".")),"string"==typeof t.value&&(0==t.decimal?t.value=parseFloat(t.value.split(".").join("").split(",").join("")):t.value=parseFloat(t.value.split(".").join("").split(",").join("."))),console.log("this.value ",t.value),t.onChange(t.value)}),0)},t.prototype.writeValue=function(t){console.log("inif ",t,this.innerValue),null==t&&(t=0),t!==this.innerValue&&(console.log("typeof value ",typeof t),"string"==typeof t&&(t=0==this.decimal?parseFloat(t.split(".").join("").split(",").join("")):parseFloat(t.split(".").join("").split(",").join("."))),this.innerValue=t,this.value=t,console.log("writeValue ini ",this.value,this.formattedAmount),this.formattedAmount=this.transform(this.value,this.decimal),console.log("writeValue fin ",this.value,this.formattedAmount))},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.transformAmount=function(t){var e=this;try{setTimeout((function(){console.log("transformAmount ini ",e.value,e.formattedAmount),e.formattedAmount=e.transform(e.value,e.decimal),console.log("transformAmount fin ",e.value,e.formattedAmount)}),0)}catch(t){console.log(t)}},t.prototype.transform=function(t,e){void 0===e&&(e=2),console.log("trasform ",t);var i=Ot((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return console.log("integer, fraction ",n,s),s=e>0?","+(s+"000000").substring(0,e):"",""==(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,"."))&&(n="0"),console.log("trasform ",n+s),n+s},t.prototype.focus_e=function(t){try{this.removeCurrencyPipeFormat(t),this.setFocus(),this.focus.emit(this.value)}catch(t){console.log(t)}},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.prototype.removeCurrencyPipeFormat=function(t){try{this.formattedAmount=this.transform(this.value,this.decimal)}catch(t){console.log(t)}},t}();Ue.decorators=[{type:n.Component,args:[{selector:"FHCurrencyField",providers:[je],template:'\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 style="text-align:right"\n #el\n matInput\n [disabled]="!enabled"\n [(ngModel)]="formattedAmount"\n (blur)="transformAmount($event); focus_out.emit(value)"\n [style.color]="getStyle_color()"\n (keydown)="kd($event)"\n (focus)="focus_e($event)"\n (keyup)="chg()"\n />\n </mat-form-field>\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 style="text-align:right"\n [style.color]="getStyle_color()"\n #el1\n matInput\n [disabled]="true"\n [(ngModel)]="formattedAmount"\n />\n </mat-form-field>\n ',styles:[""]}]}],Ue.ctorParameters=function(){return[]},Ue.propDecorators={el:[{type:n.ViewChild,args:["el"]}],decimal:[{type:n.Input}],label:[{type:n.Input}],required:[{type:n.Input}],enabled:[{type:n.Input}],hidden:[{type:n.Input}],color:[{type:n.Input}],label_width:[{type:n.Input}],change:[{type:n.Output}],focus:[{type:n.Output}],focus_out:[{type:n.Output}],enter_pressed:[{type:n.Output}],value:[{type:n.Input}]};var Ve={provide:p.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.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"\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 ',styles:[""]}]}],qe.ctorParameters=function(){return[]},qe.propDecorators={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 Be=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.title="",this.label="",this.valore="",this.min_chars=3,this.max_chars=50}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}();Be.decorators=[{type:n.Component,args:[{selector:"app-win_output",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>{{ title }}</h2>\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 <button mat-flat-button color="warn" (click)="chiudi()">CHIUDI</button>\n </mat-dialog-actions>\n '}]}],Be.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService}]},Be.propDecorators={title:[{type:n.Input}],label:[{type:n.Input}],valore:[{type:n.Input}]};var Ge={provide:p.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Ke})),multi:!0},Ke=function(){function t(t){this.uti_s=t,this.decimal=0,this.label="",this.text_align="right",this.th_character=".",this.required=!1,this.enabled=!0,this.hidden=!1,this.m_color="",this.pattern="[-+]?[0-9]*[.,]?[0-9]+",this.change=new n.EventEmitter,this.innerValue=0,this.chgf=!1,this.onChange=function(t){},this.onTouched=function(){},this.formattedAmount="0,00",this.value=0}return t.prototype.getStyle=function(){return this.m_color},t.prototype.set_backcolor=function(t){this.m_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){this.chgf?this.chgf=!1:(null==t&&(t=0),t!==this.innerValue&&(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){var e=this;setTimeout((function(){e.el.nativeElement.select()}),200)},t.prototype.select_allf=function(t){this.el.nativeElement.select()},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}();Ke.decorators=[{type:n.Component,args:[{selector:"FHNumericField",providers:[Ge],template:'\n <mat-form-field [hidden]="hidden" appearance="outline" floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n <input\n type="text"\n [style.text-align]="text_align"\n [style.background-color]="getStyle()"\n #el\n matInput\n [required]="required"\n [disabled]="!enabled"\n [(ngModel)]="formattedAmount"\n (blur)="chg()"\n (click)="click_select_allf($event)"\n (focus)="removeCurrencyPipeFormat($event); select_allf($event)"\n [pattern]="pattern"\n />\n </mat-form-field>\n ',styles:[""]}]}],Ke.ctorParameters=function(){return[{type:At}]},Ke.propDecorators={el:[{type:n.ViewChild,args:["el"]}],decimal:[{type:n.Input}],label:[{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}],change:[{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.values=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 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>{{ title }}</h2>\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 >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\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 '}]}],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:p.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.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),console.log(e.selectedUser),e.userName=e.getUsersNc(),console.log(e.userName)):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(null!=this.all_user){if(this.enabled){var e=this.dialog.open(Se,{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()})),e.afterClosed().subscribe((function(e){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"\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"\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:kt},{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 Xe=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}();Xe.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 >&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="esci_senza_salv()">\n {{ esci_senza_salvataggi }}\n </button>\n </div>\n </div>\n '}]}],Xe.ctorParameters=function(){return[{type:e.MatDialogRef},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]},{type:i.ToastrService}]};var We=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}();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 <h4 mat-dialog-title>{{ title }}</h4>\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 <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>Commento {{ nota_commento }}</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="4"></textarea>\n </mat-form-field>\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 >&nbsp;&nbsp;&nbsp;\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n ANNULLA\n </button>\n </div>\n '}]}],We.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:kt},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},We.propDecorators={up:[{type:n.ViewChild,args:["up"]}]};var $e=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.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.m_appService.getState().wkf_doc_info.title,this.lbl=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=" (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","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: {{ utenti }}\n </div>\n <h3\n *ngIf="!mobile && utenti?.toLocaleLowerCase().indexOf(\'system\') == -1"\n >\n Assegnata a: {{ 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 >&nbsp;&nbsp;&nbsp;&nbsp;\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n ANNULLA\n </button>\n </div>\n '}]}],$e.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:kt},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var Ze=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i,this.selval="-1",this.errorMsg="",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}();Ze.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="font-size: 15px;">\n <mat-toolbar\n >SELEZIONA AMBITO\n <div style="width:100%;text-align: right;"></div>\n </mat-toolbar>\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 '}]}],Ze.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService}]},Ze.propDecorators={smtr:[{type:n.ViewChild,args:["cmb"]}]};var Je=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i,this.selval="-1",this.errorMsg="",this.OK_BUTTON="OK",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)}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}();Je.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="font-size: 15px;">\n <mat-toolbar style="max-width:500px"\n >SELEZIONA PROSSIMO STEP:\n </mat-toolbar>\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:</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.descri_livello\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 >&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="close()">\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 '}]}],Je.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService}]},Je.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 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>{{ title }} </mat-toolbar>\n\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 >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="close()">ANNULLA</button>\n </div>\n '}]}],ti.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:kt}]},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[3],t.values[1]=o)}this.headers=new a.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(r.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 Dt})),r.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(a.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:a.HttpClient},{type:wt},{type:i.ToastrService}]};var ii=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.m_file=a,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="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="COMMENTI"}}),(function(t){}))},t.prototype.ok=function(){if(this.not_comm){if(""==this.nota)return void this.toastr.error("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="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){void 0===p&&(p=!0),void 0===u&&(u="");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","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","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","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler annullare l'inserimento del commento?"),this.m_dialogRef.open(St).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="INSERISCI COMMENTO"},t}();ii.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 color="primary"\n >{{ title }}\n <span class="fill-remaining-space"></span>\n <div>\n <button mat-mat-flat-button color="accent" (click)="ins()" *ngIf="!b_edit">\n <mat-icon>note_add</mat-icon>\n INSERISCI\n </button>\n </div>\n </mat-toolbar>\n <br />\n <div mat-dialog-content style="min-width:800px;font-size: 15px;">\n <mat-form-field *ngIf="b_edit" appearance="outline" floatLabel="always"\n ><mat-label>Commento</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="12"></textarea>\n </mat-form-field>\n\n <div *ngIf="b_edit" fxLayoutAlign="center center" fxLayout="row">\n <button mat-flat-button color="primary" (click)="ok()">OK</button\n >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="annulla()">ANNULLA</button\n >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\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\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</th>\n <th width="15%">Autore</th>\n <th width="15%">Data</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 CHIUDI\n </button>\n </div>\n ',styles:[""]}]}],ii.ctorParameters=function(){return[{type:e.MatDialogRef},{type:e.MatDialog},{type:wt},{type:i.ToastrService},{type:kt},{type:ei},{type:Tt}]};var ni=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toast=i,this.hide_richiedente=!1,this.load_info()}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.load_info=function(){var t=this;null!=this.m_appService.getState().wkf_doc_info&&null!=this.m_appService.getState().wkf_doc_info.codice?(this.codice=this.m_appService.getState().wkf_doc_info.codice,this.data_richiesta=this.m_appService.getState().wkf_doc_info.data_richiesta,this.richiedente=this.m_appService.getState().wkf_doc_info.richiedente,this.stato=this.m_appService.getState().wkf_doc_info.stato,this.in_carico_a=this.m_appService.getState().wkf_doc_info.in_carico_a,this.uiid_app=this.m_appService.getState().wkf_doc_info.uiid_app,this.uiid_doc=this.m_appService.getState().wkf_doc_info.uiid_doc,this.canale=this.m_appService.getState().wkf_doc_info.canale):setTimeout((function(){t.load_info()}),500)},t.prototype.ngAfterViewInit=function(){},t}();ni.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 color="primary"\n >INFO DOCUMENTO\n <div style="width:100%;text-align: right;"></div>\n </mat-toolbar>\n <div mat-dialog-content style="font-size: 15px;">\n <table class="fh_table">\n <tbody>\n <tr class="odd">\n <td>Codice:</td>\n <td>\n <b>{{ codice }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>Data:</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:</td>\n <td>\n <b>{{ richiedente }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>Stato:</td>\n <td>\n <b>{{ stato }}</b>\n </td>\n </tr>\n <tr class="odd">\n <td>In Carico a:</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 '}]}],ni.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService}]};var oi=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.m_file=a,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.lettori="",this.subject="",this.link="",this.codice_doc=""}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(St).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++)t.logs[i].v_commento="<b>"+t.logs[i].operazione.replace(/\n/g,"<br/>")+"</b>";t.ossv||(t.modeler=new T({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){void 0===p&&(p=!0),void 0===u&&(u="");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).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).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"\n >\n <button mat-flat-button color="accent" (click)="ins()">\n <mat-icon>note_add</mat-icon>\n INSERISCI</button\n >&nbsp;&nbsp;&nbsp;&nbsp;\n </div>\n\n <div fxLayout="column" *ngIf="b_edit">\n <br />\n <mat-form-field\n *ngIf="b_edit"\n appearance="outline"\n floatLabel="always"\n ><mat-label>Commento</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="12"></textarea>\n </mat-form-field>\n\n <div *ngIf="b_edit" fxLayoutAlign="center center" fxLayout="row">\n <button mat-flat-button color="primary" (click)="ok()">OK</button\n >&nbsp;&nbsp;&nbsp;&nbsp;\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="annulla()"\n >\n ANNULLA</button\n >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\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\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</th>\n <th width="15%">Utente</th>\n <th>Operazione</th>\n <td></td>\n <td></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>\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:kt},{type:ei},{type:Tt}]},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 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="font-size: 15px;">\n <mat-toolbar color="primary"\n >{{ title }}\n <span class="fill-remaining-space"></span>\n </mat-toolbar>\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 '}]}],si.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:kt}]},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 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="font-size: 15px;">\n <mat-toolbar>{{ title }} </mat-toolbar>\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.descri_livello\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 >&nbsp;&nbsp;&nbsp;\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 '}]}],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 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 <h4 mat-dialog-title>{{ title }}</h4>\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\n <mat-form-field\n [hidden]="commento_hidden"\n appearance="outline"\n floatLabel="always"\n ><mat-label>Commento {{ nota_commento }}</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</button>\n </div>\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\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 '}]}],ri.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:kt}]},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 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 <h4 mat-dialog-title>{{ title }}</h4>\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 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\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 '}]}],li.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:kt}]},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(At),n.ɵɵinject(wt))},token:pi,providedIn:"root"}),pi.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],pi.ctorParameters=function(){return[{type:At},{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.abilita_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,floatingFilter:!0,enableRangeSelection:!0,enableServerSideSorting:!1,enableServerSideFilter:!1,defaultColDef:{resizable:!0,sortable:!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;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(St,{disableClose:!0}).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(ae,{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.abilita_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(se,{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"))){var e=/iPad|iPhone|iPod/.test(navigator.userAgent);this.gridOptions.api.setGridAutoHeight(!e),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 }}</h5>\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n </td>\n <td style="vertical-align:\'bottom\'">\n &nbsp;&nbsp;&nbsp;&nbsp;\n <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>{{ trova_label }}</mat-label>\n <input\n matInput\n (keydown)="keyDownFunctioncl($event)"\n [(ngModel)]="ric_libera"\n style="width:200px"\n /> </mat-form-field\n >&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;\n </td>\n <td\n [hidden]="this.m_appService.getState().pageFullscreen"\n *ngIf="show_buttons && !this.m_appService.getState().mobile"\n >\n &nbsp;&nbsp;&nbsp;<button\n *ngIf="show_pulisci_filtri"\n mat-flat-button\n (click)="pulisci_filtri()"\n color="warn"\n >\n <mat-icon>clear</mat-icon>&nbsp;&nbsp;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 &nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="autoSizeAll()" color="accent">\n <mat-icon>photo_size_select_small</mat-icon>&nbsp;&nbsp;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 &nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="fitSizeAll()" color="accent">\n <mat-icon>aspect_ratio</mat-icon>&nbsp;&nbsp;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" }}\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:At},{type:i.ToastrService},{type:kt},{type:wt},{type:d.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}],abilita_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.type="NONE",this.toolbar_wkfapp=null,this.custom_commands=[],this.command=new n.EventEmitter}return 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.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.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_NO_EDIT\'"\n fxLayoutGap="3px"\n fxLayout="row"\n fxFlex="100"\n fxLayoutAlign="end center"\n style="background-color: #CC0000"\n >\n <mat-toolbar>\n <div fxLayout="row" fxLayoutGap="3px" fxLayoutAlign="end center">\n <button\n mat-flat-button\n color="warn"\n mat-button\n fxHide\n fxShow.gt-sm\n [matMenuTriggerFor]="gest_menu"\n *ngIf="\n toolbar_wkfapp?.is_Supervisor ||\n toolbar_wkfapp?.is_Admin ||\n toolbar_wkfapp?.is_PowerUser\n "\n >\n <mat-icon>label_important</mat-icon>&nbsp;&nbsp;&nbsp;{{\n "Gestione" | translate\n }}\n </button>\n <mat-menu #gest_menu="matMenu">\n <button\n mat-menu-item\n style="background-color: #F5F5F5"\n (click)="annulla_richiesta()"\n >\n {{ "ANNULLA DOCUMENTO" | translate }}\n </button>\n <button\n mat-menu-item\n style="background-color: #F5F5F5"\n (click)="recupera_richiesta()"\n >\n {{ "RECUPERA DOCUMENTO" | translate }}\n </button>\n <button\n mat-menu-item\n style="background-color: #F5F5F5"\n (click)="riassegna_richiesta()"\n *ngIf="toolbar_wkfapp?.is_Supervisor || toolbar_wkfapp?.is_Admin"\n >\n {{ "RIASSEGNA DOCUMENTO" | translate }}\n </button>\n <button\n mat-menu-item\n style="background-color: #F5F5F5"\n (click)="sostituisci_utente()"\n *ngIf="toolbar_wkfapp?.is_Admin"\n >\n {{ "SOSTITUISCI UTENTE" | translate }}\n </button>\n\n <button\n mat-menu-item\n style="background-color: #F5F5F5"\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 != \'\'"\n >\n {{ toolbar_wkfapp?.imp }}\n </button>\n <div *ngFor="let app of custom_commands">\n &nbsp;&nbsp;<button\n mat-flat-button [hidden]="app.hidden!=null && app.hidden"\n [color]="app.color"\n (click)="exec_command(app.command)"\n >\n <mat-icon *ngIf="app.icon != null">{{ app.icon }}</mat-icon\n >&nbsp;{{ app.label | translate }}\n </button>\n </div>\n </div>\n </mat-toolbar>\n </div>\n <div\n *ngIf="type == \'WKF\'"\n fxLayoutGap="3px"\n fxLayout="row"\n fxLayoutAlign="end center"\n style="width: 100%;background-color: maroon"\n >\n <mat-toolbar>\n <div fxLayout="row" fxLayoutGap="3px" fxLayoutAlign="end center">\n <button\n mat-flat-button\n (click)="insert_doc()"\n *ngIf="toolbar_wkfapp?.is_Ins"\n color="accent"\n >\n <mat-icon>note_add</mat-icon>&nbsp;&nbsp;&nbsp;{{\n "INSERISCI" | translate\n }}</button\n >&nbsp;&nbsp;&nbsp;\n\n <button\n mat-flat-button\n color="warn"\n mat-button\n fxHide\n fxShow.gt-sm\n [matMenuTriggerFor]="gest_menu"\n *ngIf="toolbar_wkfapp?.is_Supervisor"\n >\n {{ "Gestione" | translate }}\n </button>\n <mat-menu #gest_menu="matMenu">\n <button mat-menu-item (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 (click)="riassegna_richiesta()">\n {{ "RIASSEGNA DOCUMENTO" | translate }}\n </button>\n <button\n mat-menu-item\n (click)="sostituisci_utente()"\n *ngIf="toolbar_wkfapp?.is_Admin"\n >\n {{ "SOSTITUISCI UTENTE" | translate }}\n </button>\n\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 *ngFor="let app of custom_commands">\n &nbsp;&nbsp;<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 >&nbsp;{{ app.label | translate }}\n </button>\n </div>\n </div>\n </mat-toolbar>\n </div>\n <div\n *ngIf="type == \'INSERT_DELETE\' || type == \'INSERT\'"\n fxLayoutGap="3px"\n fxLayout="row"\n >\n <mat-toolbar>\n <div fxLayout="row" fxLayoutGap="5px" fxLayoutAlign="end center">\n <button mat-flat-button (click)="new_doc()" color="primary">\n <mat-icon>note_add</mat-icon>&nbsp;&nbsp;&nbsp;{{\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>&nbsp;&nbsp;&nbsp;{{\n "ELIMINA" | translate\n }}\n </button>\n <div *ngFor="let app of custom_commands" fxLayout="row" fxLayoutGap="5px">\n <div>\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 >&nbsp;&nbsp;&nbsp;{{ app.label | translate }}\n </button>\n </div>\n <FHCheckBox\n *ngIf="app.type == \'checkbox\'"\n (change)="selx(app.command, $event)"\n [label]="app.label | translate"\n ></FHCheckBox>\n\n <div *ngIf="app.type == \'spacer\'" style="width:60px"></div>\n </div>\n </div>\n </mat-toolbar>\n </div>\n <div\n *ngIf="type == \'CUSTOM\'"\n fxLayoutGap="3px"\n fxLayout="row"\n fxLayoutAlign="end center"\n >\n <div *ngFor="let app of custom_commands" fxLayoutAlign="end center" fxLayout="row" fxLayoutGap="5px">\n <div>\n <button [hidden]="app.hidden!=null && app.hidden"\n *ngIf="app.type == null || app.type == \'button\'"\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 >&nbsp;&nbsp;&nbsp;{{ app.label | translate }}\n </button>\n </div>\n <FHCheckBox\n *ngIf="app.type == \'checkbox\'"\n (change)="selx(app.command, $event)"\n [label]="app.label | translate"\n ></FHCheckBox>\n <div *ngIf="app.type == \'spacer\'" style="width:60px"></div>\n </div>\n </div>\n ',styles:[""]}]}],ci.propDecorators={type:[{type:n.Input}],toolbar_wkfapp:[{type:n.Input}],custom_commands:[{type:n.Input}],command:[{type:n.Output}]};var di=function(){function t(t){this.m_appService=t,this.dt_agg=null,this.edit_button=!1,this.respingi_button=!1,this.procedi_button=!0,this.utility_button=!0,this.force_save=!1,this.check_on_save=!1,this.admin_role="[ZZZ_DIS_CC]",this.sovra_path="",this.button_clicked=new n.EventEmitter}return 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()},t.prototype.ngAfterViewInit=function(){},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 Indietro</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 Salva</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</button\n ></div><div>\n <button\n mat-flat-button\n (click)="respingi()"\n *ngIf="respingi_button"\n color="warn"\n >\n Respingi\n </button>\n </div>\n \x3c!-- <button mat-flat-button (click)="doEnd(900)" color="warn" >test</button>&nbsp;&nbsp;\n--\x3e\n </div>\n &nbsp;&nbsp;&nbsp;&nbsp;\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>&nbsp;&nbsp;Info Doc</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</button\n ></div>\n </div>\n <div fxLayout="row" fxLayoutGap="16px">\n <div>\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</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\n </button>\n </div> </div>\n </div>\n </div>\n '}]}],di.ctorParameters=function(){return[{type:wt}]},di.propDecorators={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}],force_save:[{type:n.Input}],check_on_save:[{type:n.Input}],admin_role:[{type:n.Input}],sovra_path:[{type:n.Input}],button_clicked:[{type:n.Output}]};var hi=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(St,{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}();hi.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>&nbsp;&nbsp;&nbsp;<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>&nbsp;&nbsp;&nbsp;<span>Number</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(3)">\n <mat-icon>filter_none</mat-icon>&nbsp;&nbsp;&nbsp;<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>&nbsp;&nbsp;&nbsp;<span>Check Box</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(5)">\n <mat-icon>radio_button_checked</mat-icon>&nbsp;&nbsp;&nbsp;<span\n >Radio</span\n >\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(6)">\n <mat-icon>dehaze</mat-icon>&nbsp;&nbsp;&nbsp;<span>Select</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(7)">\n <mat-icon>today</mat-icon>&nbsp;&nbsp;&nbsp;<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 *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 <section\n class="custom-section"\n *ngIf="item.type == \'radiobutton\'"\n >\n <label class="custom-margin">{{ item.label }}:</label>\n <mat-radio-group\n [(ngModel)]="item.default_value"\n [required]="item.required"\n >\n <mat-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 </section>\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 >&nbsp;&nbsp;\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">\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:[""]}]}],hi.ctorParameters=function(){return[{type:At},{type:e.MatDialog},{type:z.DragulaService}]},hi.propDecorators={change:[{type:n.Output}],bottoml:[{type:n.ViewChild,args:["bottoml"]}]};var _i=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}();_i.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 <section *ngIf="item.type == \'radiobutton\'">\n <label *ngIf="!item.required">{{ item.label }}: </label>&nbsp;\n <label *ngIf="item.required">{{ item.label }}: *</label>&nbsp;\n <mat-radio-group\n [(ngModel)]="item.default_value"\n [required]="item.required"\n >\n <mat-radio-button\n *ngFor="let opt of item.opts"\n [disabled]="!enabled"\n class="custom-margin"\n value="{{ opt }}"\n ><b>{{ opt }}</b\n >&nbsp;&nbsp;&nbsp;&nbsp;</mat-radio-button\n >\n </mat-radio-group>\n </section>\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 >&nbsp;&nbsp;\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:[""]}]}],_i.ctorParameters=function(){return[{type:At},{type:e.MatDialog},{type:i.ToastrService}]},_i.propDecorators={items:[{type:n.Input}],enabled:[{type:n.Input}],bottoml:[{type:n.ViewChild,args:["bottoml"]}]};var mi=function(){function t(t){this.dialogRef=t,this.title="",this.button_config=[]}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 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>{{ title }}</h2>\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 >&nbsp;&nbsp;&nbsp;\n </div>\n </mat-dialog-content>\n <br /><br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="accent" (click)="close()">CHIUDI</button>\n </div>\n '}]}],mi.ctorParameters=function(){return[{type:e.MatDialogRef}]},mi.propDecorators={title:[{type:n.Input}],button_config:[{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</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{-webkit-animation:rotation 2s linear infinite;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)}}@-webkit-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:j.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:j.DomSanitizer}]};var Ii={provide:p.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Si})),multi:!0},Si=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.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});setTimeout((function(){e.componentInstance.single_sel=t.single_sel,e.componentInstance.sel_values=t.value,e.componentInstance.separator=t.separator,e.componentInstance.label=t.label,e.componentInstance.sql=t.sql,e.componentInstance.types=t.types,e.componentInstance.values=t.values,e.componentInstance.doFill()})),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}();Si.decorators=[{type:n.Component,args:[{providers:[Ii],selector:"FHFieldPickList",template:'\n <div\n fxLayout="row"\n fxFlex="100"\n fxLayoutAlign="start center"\n [hidden]="hidden" fxLayoutGap="10px"\n >\n <div fxFlex fxLayout="row">\n <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n <input\n type="text"\n #el1\n matInput\n [readonly]="!enabled || only_in_list"\n [(ngModel)]="value"\n />\n </mat-form-field>\n </div>\n\n <div fxLayout="row">\n <button\n mat-flat-button\n color="primary"\n (click)="open_pick_list()"\n [hidden]="!enabled"\n >\n SELEZIONA\n </button>\n </div>\n </div>\n ',styles:[""]}]}],Si.ctorParameters=function(){return[{type:e.MatDialog}]},Si.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 Ei=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.single_sel=!1,this.sel_values="",this.id_tipo=-1}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}();Ei.decorators=[{type:n.Component,args:[{selector:"win_manage_values",template:'\n <div fxLayout="column" style="height: 520px">\n <div fxLayout="row" style="width: 90%">\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" style="overflow-y: scroll;height:100%;">\n <div fxLayout="column" style="overflow-y: scroll;height:420px;">\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 </div>\n <div fxLayout="row" fxLayoutAlign="center center" style="width: 100%">\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 '}]}],Ei.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:wt},{type:kt}]};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(Ei,{width:"90%",height:"550px"});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 >\n &nbsp;<FHComboBox\n #cmb_sel\n sql="SELECT_TABLE_MANAGEMENT"\n label="Gestisci Tabella:"\n init_fill="false"\n ></FHComboBox\n >&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="edit_values()" color="primary">\n Modifica\n </button>\n </div>\n ',styles:[""]}]}],Oi.ctorParameters=function(){return[{type:kt},{type:wt},{type:e.MatDialog}]},Oi.propDecorators={application:[{type:n.Input}],cmb_sel:[{type:n.ViewChild,args:["cmb_sel"]}]};var xi=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}();xi.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&nbsp;per&nbsp;associare&nbsp;utente:</b\n >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\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 '}]}],xi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:wt},{type:kt}]},xi.propDecorators={autoc:[{type:n.ViewChild,args:["autoc"]}]};var Ci=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:"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}();Ci.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 &nbsp;&nbsp;&nbsp;&nbsp;<FHComboBox\n #cmb_sel\n sql="SELECT_APP_USER_MANAGEMENT"\n label="Gestisci Ruoli:"\n init_fill="false"\n ></FHComboBox\n >&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="edit_values()" color="primary">\n Modifica\n </button>\n </div>\n ',styles:[""]}]}],Ci.ctorParameters=function(){return[{type:kt},{type:wt},{type:e.MatDialog}]},Ci.propDecorators={application:[{type:n.Input}],cmb_sel:[{type:n.ViewChild,args:["cmb_sel"]}]};var Ai=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}();Ai.decorators=[{type:n.Component,args:[{selector:"FHFilterComboBox",template:'\n <mat-form-field [hidden]="!enabled || hidden">\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:[""]}]}],Ai.ctorParameters=function(){return[{type:kt},{type:Ht}]},Ai.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 Di=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){void 0===p&&(p=!0),void 0===u&&(u="");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}();Di.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 <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>Commento</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="12"></textarea>\n </mat-form-field>\n\n <div>\n <button mat-flat-button color="primary" (click)="ok()">OK</button\n >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="annulla()">ANNULLA</button\n >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <mat-checkbox [(ngModel)]="not_int" [hidden]="lettori === \'\'">\n Notifica Interessati\n </mat-checkbox>\n </div>\n </div>\n ',styles:[""]}]}],Di.ctorParameters=function(){return[{type:e.MatDialogRef},{type:e.MatDialog},{type:wt},{type:i.ToastrService},{type:kt},{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(){var t=this;setTimeout((function(){"1"==t.isadmin&&null!=t.appService.dev_mode&&"1"==t.appService.dev_mode&&(t.dev_mode=!0);var e=new vt;e.sql="SELECT_ALLEGATI_DOCUMENTO",e.types=["string","string"],e.values=["FOTO_UTENTI",t.appService.user],t._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&e.result_data.length>0&&(t.b_filef=!0,t.foto_ut=t.appService.COMPANY_SITE_ROOT+"/uploads/"+e.result_data[0].App+"/"+e.result_data[0].K+"/"+e.result_data[0].Filename)}))}))},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 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">Info Utente</h2>\n <mat-dialog-content style="font-size:12px">\n <table class="fh_table">\n <tbody>\n <tr class="odd">\n <td>Nome</td>\n <td>\n <b>{{ user_name }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>Cognome</td>\n <td>\n <b>{{ user_surname }}</b>\n </td>\n </tr>\n <tr class="odd">\n <td>Username</td>\n <td>\n <b>{{ user }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>Email</td>\n <td>\n <b>{{ user_email }}</b>\n </td>\n </tr>\n <tr class="odd">\n <td>Ruoli</td>\n <td>\n <b>{{ user_roles }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>Lingua</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\n <div fxLayoutAlign="center center" fxLayout="row">\n <button mat-flat-button color="primary" (click)="dialogRef.close()">\n CHIUDI\n </button>\n </div>\n </mat-dialog-content>\n '}]}],Ti.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:kt}]};var ki=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}();ki.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:[""]}]}],ki.ctorParameters=function(){return[{type:kt},{type:i.ToastrService}]},ki.propDecorators={color:[{type:n.Input}],bk_color:[{type:n.Input}],hidden:[{type:n.Input}],key:[{type:n.Input}]};var Li={provide:p.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\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(){}return t.forRoot=function(){return{ngModule:t,providers:[wt,M.NgForage,kt,Yt,Tt,Ht,ei,oe,te,At,pi,pe]}},t.forChilds=function(){return{ngModule:t,providers:[]}},t}();Ni.decorators=[{type:n.NgModule,args:[{imports:[P.TranslateModule,F.CdkTableModule,mt.MatBadgeModule,U.MatAutocompleteModule,e.MatDialogModule,q.MatButtonModule,G.MatButtonToggleModule,V.MatCardModule,B.MatCheckboxModule,K.MatChipsModule,H.MatDatepickerModule,Y.MatExpansionModule,Q.MatFormFieldModule,X.MatGridListModule,W.MatIconModule,$.MatInputModule,Z.MatListModule,J.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,ht.MatSortModule,_t.MatTableModule,f.MatNativeDateModule,l.FileUploadModule,R.AgGridModule.withComponents([Qt]),g.CommonModule,z.DragulaModule,p.FormsModule,N.AgmCoreModule.forRoot({apiKey:"AIzaSyD3-g3b_QqxUruxBY4PGJKaH2fubIVXvN4"}),k.FlexLayoutModule,ft.QuillModule,L.MarkdownModule],exports:[jt,qt,Gt,Kt,Ri,Oe,ki,Ti,Di,Ci,Si,wi,gi,fi,mi,Xt,Wt,Zt,Jt,ie,ne,ue,de,St,_e,Ie,Qt,Se,xe,De,Ae,Te,se,ke,Le,Re,yt,Ne,ae,Mt,Fe,Pe,ze,bt,Ue,qe,Be,Ke,di,He,Nt,Qe,ui,Xe,hi,_i,Oi,zt,Rt,Ft,ee,Lt],declarations:[jt,qt,Gt,Kt,Ri,Oe,ki,Ti,Di,Ci,Si,wi,bi,Vt,gi,fi,mi,ci,Xt,Wt,Zt,Jt,ie,ne,di,ue,de,St,_e,Ie,Qt,Se,xe,De,Ae,Te,se,ke,Le,Re,yt,Ne,ae,Mt,Fe,Pe,ze,bt,Ue,qe,Be,Ke,He,Nt,Qe,Xe,We,$e,Ze,Je,Ut,ii,ni,oi,si,ai,ri,li,ti,ui,hi,_i,Oi,Ei,xi,Ai,zt,Rt,Ft,ee,Lt],providers:[Me,z.DragulaService],entryComponents:[jt,Vt,Ti,Di,xi,Ei,fi,mi,Xe,We,$e,Ze,Je,Ut,ii,ni,oi,si,ai,li,ri,ti,Mt,St,Xt,Se,xe,Te,se,ke,Le,yt,ae,Fe,bt,Be,He,Mt,Nt,ee,Lt]}]}];var Fi=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}();Fi.decorators=[{type:n.Injectable}],Fi.ctorParameters=function(){return[{type:a.HttpClient},{type:te},{type:c.Router},{type:i.ToastrService},{type:kt},{type:d.SlimLoadingBarService},{type:wt}]};var Mi=function(){this.result_data=new Array},Pi=function(){this.result_data=new Array},zi=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_fservice=n,this.m_router=o,this._toastr=s,this.dialog=a,this.m_wkf=r,this.m_uti=l,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.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(),"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(St,{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.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});setTimeout((function(){s.componentInstance.setStepCombo(i),s.componentInstance.title="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++)e[i].nc=e[i].nc.split(" ()").join(""),null!=e[i].idp&&null==e[i].username&&(e[i].username=e[i].idp);setTimeout((function(){n.componentInstance.arrAutori=e,n.componentInstance.title="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,e="";null!=this.get_grid().sRow.lettori&&(e=this.get_grid().sRow.lettori);var i="",n="",o="",s="";null!=this.get_grid().sRow.partecipanti&&(s=this.get_grid().sRow.partecipanti);for(var a="",r="XCXXX",l=0;l<this.wax.length;l++){if("XCXXX"!=r&&r!=this.wax[l].gruppo_parallelo)return void this._toastr.error("impossibile assegnare a utenti di gruppi distiniti");r=this.wax[l].gruppo_parallelo,""!=a&&(a+=","),a+=this.wax[l].idp,-1==e.indexOf(this.wax[l].idp)&&(""!=e&&(e+=","),e+=this.wax[l].idp),-1==n.indexOf(this.wax[l].nc)&&(""!=n&&(n+=","),n+=this.wax[l].nc),""!=o&&(o+=","),o+=this.wax[l].nc,null!=s&&-1==s.indexOf(this.wax[l].idp)&&(""!=s&&(s+=","),s+=this.wax[l].idp),""!=i&&(i+=","),i+=this.wax[l].idp}this.sendEMail_ex(this.user_idp,a,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 p=new vt;p.sql="INSERT_COMMENTO_RIASS",p.types=["string","string","string","string","string","int","int"],p.values=[this.id_applicativo,this.get_grid().sRow.uiid,"Documento riassegnato a "+o,this.user_idp,this.os_r.descri_livello,this.get_grid().sRow.stato,this.os_r.livello];this.m_dataService.doQuery(p).subscribe((function(t){null!=t&&t.result_msg}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}));var u="$$";this.wax.length>0&&null!=this.wax[0].gruppo_parallelo&&""!=this.wax[0].gruppo_parallelo&&(u=this.wax[0].gruppo_parallelo),console.log("riassegnazione canale: ",u),(p=new vt).sql="UPDATE_RIASS_DOCUMENTO",p.types=["string","string","string","string","string","string","string","string","string","string",u],p.values=[this.os_r.livello,this.os_r.descri_livello,e,i,this.os_r.descri_livello,n,s,this.get_grid().sRow.id_applicativo,this.get_grid().sRow.uiid],this.m_dataService.doQuery(p).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.get_grid().doFill("")}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})),(p=new vt).sql="INSERT_WKF_COMMENTO",p.types=["string","string","string","string","string"],p.values=[this.id_applicativo,this.get_grid().sRow.uiid,"Documento riassegnato, commento:\n"+this.nota_wax,this.user_idp,""],this.m_dataService.doQuery(p).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&&((p=new vt).sql="UPDATE_RIASSEGNA_TODO",p.types=["string","string"],p.values=[this.wax[0].idp,this.get_grid().sRow.uiid],!1,this.m_dataService.doQuery(p).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){void 0===p&&(p="");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(){this.app_s.user_name=this.app_s.user_name_ori,this.app_s.user=this.app_s.user_ori,this.app_s.user_surname=this.app_s.user_surname_ori,this.app_s.user_email=this.app_s.user_email_ori,this.user_idp=this.app_s.user,this.user_nome=this.app_s.user_name,this.user_cognome=this.app_s.user_surname,this.user_email=this.app_s.user_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="",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,t.get_grid().doFill(""),console.log(" this.user_idp ",t.user_idp))}))}}))}}))},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.app_s.getState().wkf_obj.title,this.m_uti.set_home_title(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){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}(),ji=function(){function t(t,e,i,n,o,s,a,r){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.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.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="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.init_user_i=function(){this.user_idp=this.app_s.user,this.user_nome=this.app_s.user_name,this.user_cognome=this.app_s.user_surname,this.user_email=this.app_s.user_email},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();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,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()&&0==this.livs[e].notifica&&this.m_obj.canale==this.livs[e].gruppo_parallelo){this.clevel=this.livs[e];break}if(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}}if(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(Je,{disableClose:!0}).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)}))},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);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}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;this.user_idp.toUpperCase();if(null!=this.nlevel){new Array;var e=new Array;if(""==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="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="Il documento verrà inviato a "+this.nlevel.descri_livello:this.app_s.getState().wkf_doc_info.lbl="La richiesta verrà chiusa con stato: "+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),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="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(We,{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),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;t?this.m_dialog.open(Xe,{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),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="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));if(this.nlevel.livello>=900){this.getLvlInfo(this.nlevel.livello);this.doEnd(this.nlevel.livello);var n=new vt;n.sql="UPDATE_DATA_CHIUSURA",n.values=[this.id_applicativo,this.id_documento],n.types=["string","string"],this.m_dataService.doQuery(n).subscribe((function(t){null!=t&&t.result_msg}))}var o,s="$$";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("$$"!=s){s="$$";break}s=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(",")),o=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,s):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,s);var a=new Array;for(i=0;i<o.length;i++)a.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 r=new vt;r.sql="doWKF",r.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(r).subscribe((function(t){null!=t&&t.result_msg})),(r=new vt).sql="UPDATE_WKF_DOCUMENTOV3_NS",r.values=o,r.types=a,this.m_dataService.doQuery(r).subscribe((function(t){null!=t&&t.result_msg})),(r=new vt).sql="exec_app_workflow",r.values=[this.app_info.codice_documento,this.id_documento,""+this.clevel.livello,""+this.nlevel.livello,this.user_idp];if(this.m_wkf.doQuery(r).subscribe((function(t){})),""!=this.m_danotificare){var l="";if(""!=this.nota&&(l="<br>Commento: <br>"+this.nota),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{var p=null;if(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):p={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"}),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()+"<br>Commenti:"+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,p);else if(null==this.nlevel.oggetto_email)this.sendEMail_ex(this.user_idp,this.m_danotificare,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),"<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,p);else if(""==this.nlevel.oggetto_email)this.sendEMail_ex(this.user_idp,this.m_danotificare,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),"<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,p);else{var u=this.nlevel.oggetto_email;for(var c in null!=this.nlevel&&null!=this.nlevel.descri_livello&&(u=u.split("%new_step%").join(this.nlevel.descri_livello)),null!=this.clevel&&null!=this.clevel.descri_livello&&(u=u.split("%old_step%").join(this.clevel.descri_livello)),u=(u=u.split("%new_step%").join("")).split("%old_step%").join(""),this.m_obj)null!=this.m_obj[c]&&(console.log(c+" "+Object.prototype.toString.call(this.m_obj[c])),u="[object Date]"===Object.prototype.toString.call(this.m_obj[c])?u.split("%"+c+"%").join(this.uti_s.date2String(this.m_obj[c])):-1==(""+this.m_obj[c]).indexOf("T00:00:00")?u.split("%"+c+"%").join(this.m_obj[c]):u.split("%"+c+"%").join(this.uti_s.date2String(this.uti_s.string2date(this.m_obj[c],2))));this.sendEMail_ex(this.user_idp,this.m_danotificare,u,"<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,p)}else this.goto_edit_doc();if(0!=this.nlevel.tipo_notifica_aggiuntiva){if(1==this.nlevel.tipo_notifica_aggiuntiva&&this.sendEMail_ex(this.user_idp,this.m_obj.creatore,this.app_info.descrizione_breve+", Il documento numero: "+this.m_obj.codice+" è passato allo STEP: "+this.nlevel.descri_livello+" "+this.getTitle(),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,p,!1),2==this.nlevel.tipo_notifica_aggiuntiva){var d=new vt;d.sql="SELECT_PARTECIPANTI_DOC",d.values=[this.id_applicativo,this.id_documento],d.types=["string","string"],this.m_dataService.doQuery(d).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);t.sendEMail_ex(t.user_idp,i,t.app_info.descrizione_breve+", Il documento numero: "+t.m_obj.codice+" è passato allo STEP: "+t.nlevel.descri_livello+" "+t.getTitle(),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,p,!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,t.app_info.descrizione_breve+", Il documento numero: "+t.m_obj.codice+" è passato allo STEP: "+t.nlevel.descri_livello+" "+t.getTitle(),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,p,!1)}}))}}}}else this.goto_edit_doc()},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,a,r,l,p,u,c){var d=this;void 0===p&&(p=!0),void 0===u&&(u=""),void 0===c&&(c=!0);var h=new vt;h.sql="send_wkf_mail",e=(e=e.split(t+",").join("")).split(","+t).join(""),null==u&&(u=""),""!=u&&(u=JSON.stringify(u)),h.values=[t,e,i,n.split("\n").join("<br>"),o,s,a,r,l,u],this.m_wkf.doQuery(h).subscribe((function(t){c&&d.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].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),this.resp_b(!1),this.salva()},t.prototype.procedi=function(){if(this.oper="procedi",this.btnprocedi=!0,this.edit_b(!1),this.resp_b(!1),!this.ck_field())return this.edit_b(!0),void(this.respingi_enabled&&this.resp_b(!0));this.salva()},t.prototype.open_wkf=function(t){var e=this;void 0===t&&(t=!1);var i=this.app_s.getState().body_h-40+"px",n=this.m_dialog.open(oi,{disableClose:!0,width:"95%",height:i});setTimeout((function(){n.componentInstance.subject=e.app_info.descrizione_breve+", <OP>: "+e.m_obj.codice+" "+e.getTitle(),null!=e.m_obj.lettori?n.componentInstance.lettori=e.m_obj.lettori:n.componentInstance.lettori="",n.componentInstance.link=e.app_s.COMPANY_SITE_ROOT+"#/"+e.app_info.modulo_swf+"/"+e.id_applicativo+"/"+e.id_documento+"/edit",n.componentInstance.codice_doc=e.m_obj.codice,n.componentInstance.notifica_commenti=e.app_info.notifica_commenti,n.componentInstance.notifica_commenti_obbl=e.app_info.notifica_commenti_obbl,n.componentInstance.commenti_insert=t,n.componentInstance.init_v()})),n.afterClosed().subscribe((function(t){e.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(Ut,{disableClose:!0,width:"90%",data:{admin_role:e}});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);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?(console.log("NULL",e[n].names,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.edit_b(this.b_edit_before),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),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){if(null!=t&&"OK"==t.result_msg){if(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].gruppo_parallelo=e.override_livs[i].gruppo_parallelo,t.result_data[n].nc=e.override_livs[i].nc);e.ok_livelli_doc(t.result_data)}}))},t.prototype.ok_livelli_doc=function(t){if(this.livs=t,this.over_canale_iniz(),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.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(Ze,{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,e=this.m_dialog.open(ni,{disableClose:!0});setTimeout((function(){e.componentInstance.hide_richiedente=t.hide_richiedente})),e.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,"Assegnata a:"+l,"","",this.getLvlDescri(String(t),"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,"Assegnata a:"+l,"","",this.getLvlDescri(String(t),"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];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))));""==e?n.sendEMail_ex(n.user_idp,a,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),"<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,""):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.app_info.descrizione_breve+" - Nuova Richiesta"),this.reset_form(this.app_info.descrizione_breve+" - Nuova Richiesta"),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);break}},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),this.respingi_enabled&&this.resp_b(!0)),this.r_count();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,this.uti_s.set_home_title(this.app_info.descrizione_breve+" "+this.m_obj.codice+" - "+this.m_obj.stat_stato),this.reset_form(this.app_info.descrizione_breve+" "+this.m_obj.codice+" - "+this.m_obj.stat_stato)},t.prototype.onResize=function(t){},t.prototype.init_engine=function(){var t=this;null!=this.user_idp?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_user_i(),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}();ji.propDecorators={onResize:[{type:n.HostListener,args:["window:resize",["event"]]}]},t.AppMakerService=Yt,t.AppService=wt,t.ApprovaGridComponent=xe,t.AuthenticationService=te,t.CheckboxEditorComponent=Kt,t.ComboBoxEditor=Le,t.CurrencyComponent=Jt,t.FHAutoCompleteComponent=_e,t.FHCheckBox=Ri,t.FHComboboxComponent=de,t.FHConfirmValues=It,t.FHCurrencyFieldComponent=Ue,t.FHCurrencyFormatterDirective=De,t.FHCurrencyPipe=Ae,t.FHDatePickerComponent=Ie,t.FHFieldPickListComponent=Si,t.FHFormToolBarComponent=qt,t.FHGridComponent=ue,t.FHGridJSONComponent=ui,t.FHGuard=Fi,t.FHListComponent=Re,t.FHLogPanelComponent=ze,t.FHMdReader=Pe,t.FHNumericFieldComponent=Ke,t.FHPickFieldComponent=zt,t.FHPickListComponent=Mt,t.FHRichText=qe,t.FHRoleManager=Ci,t.FHTableManager=Oi,t.FHTextArea=Gt,t.FHTextInput=Oe,t.FHTimePickerComponent=Zt,t.FHUploadComponent=ne,t.FHUploadPanelComponent=ie,t.FHUploadPanelS3Component=Rt,t.FHUploadS3Component=Ft,t.FHUserFieldComponent=Qe,t.FSInput=gt,t.FSResult=Pi,t.FileService=Tt,t.FluxhubLibModule=Ni,t.FormBuilderComponent=hi,t.FormExecuterComponent=_i,t.GridService=oe,t.LocalDBService=pi,t.NumericEditorComponent=Qt,t.OdbcService=Ht,t.OfficeAutomatorService=pe,t.QGParam=re,t.QGResult=Dt,t.QParam=vt,t.QResult=Mi,t.QueryService=kt,t.ReplaceLineBreaks=Ne,t.TextAreaEditor=ke,t.UtilityService=At,t.WkfService=ei,t.dati_aggiuntivi=ji,t.fh_win_ask_big_test=bt,t.fh_win_ask_buttons=mi,t.fh_win_ask_number=Fe,t.fh_win_ask_test=ae,t.fh_win_combo=yt,t.fh_win_confirm=St,t.fh_win_list=He,t.fh_win_mappa=Te,t.fh_win_output=Be,t.fh_win_show_email=ee,t.fh_win_show_email_s3=Lt,t.fh_win_show_image=fi,t.fh_win_show_log_dett=jt,t.fh_win_time_slider=Xt,t.fh_win_user_info=Ti,t.fh_win_user_picker=Se,t.fh_win_wait=Nt,t.fhimagepreview=gi,t.win_insert_commento=Di,t.win_salva_annulla=Xe,t.win_uploads=Ut,t.wkf_header_bar=di,t.wkfapp=zi,t.ɵa=Pt,t.ɵb=Bt,t.ɵba=Ze,t.ɵbb=Je,t.ɵbc=ii,t.ɵbd=ni,t.ɵbe=oi,t.ɵbf=si,t.ɵbg=ai,t.ɵbh=ri,t.ɵbi=li,t.ɵbj=ti,t.ɵbk=Ei,t.ɵbl=xi,t.ɵbm=Ai,t.ɵc=Ii,t.ɵd=he,t.ɵe=ce,t.ɵf=je,t.ɵg=be,t.ɵh=Ge,t.ɵi=Ve,t.ɵj=$t,t.ɵk=Ye,t.ɵl=Ee,t.ɵm=Li,t.ɵn=ki,t.ɵo=wi,t.ɵp=Wt,t.ɵq=fe,t.ɵr=ye,t.ɵs=se,t.ɵt=Me,t.ɵu=bi,t.ɵw=Vt,t.ɵx=ci,t.ɵy=We,t.ɵz=$e,Object.defineProperty(t,"__esModule",{value:!0})}));
16
+ var Et=function(t,e){return(Et=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 xt(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Ot(arguments[e]));return t}Object.create;var Ct=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}(),At=function(){function t(t){this.app_s=t}return t.prototype.set_home_title=function(t){var e=this;setTimeout((function(){e.app_s.getState().topnavTitle=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 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.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.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 Ct).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.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;null!=a&&null!=r&&(l=this.get_diff_doc(a,r));var p=new vt;null!=l||null!=s?(p.sql="INSERT_LOG_N2",p.types=["string","string","string","string","string","string"],p.values=null!=l?[e,i,n,o,s,JSON.stringify(l)]:[e,i,n,o,s,null]):(p.sql="INSERT_LOG_N",p.types=["string","string","string","string"],p.values=[e,i,n,o]),t.doQuery(p).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}();At.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new At(n.ɵɵinject(wt))},token:At,providedIn:"root"}),At.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],At.ctorParameters=function(){return[{type:wt}]};var Dt=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 a.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(r.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 Dt})),r.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(a.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:a.HttpClient},{type:wt},{type:i.ToastrService}]};var kt=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 a.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(r.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 Dt})),r.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}();kt.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new kt(n.ɵɵinject(a.HttpClient),n.ɵɵinject(i.ToastrService),n.ɵɵinject(wt),n.ɵɵinject(At))},token:kt,providedIn:"root"}),kt.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],kt.ctorParameters=function(){return[{type:a.HttpClient},{type:i.ToastrService},{type:wt},{type:At}]};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}}\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){this._appservice=t,this._dataService=e,this.toastr=i,this.dialog=o,this.fileService=s,this.uti=a,this.enabled=!0,this.force_en=!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.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("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="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","Conferma Operazione"),localStorage.setItem(this._appservice.COMPANY_KEY+"msg_dialog","Confermi l'eliminazione dell'elemento?"),this.dialog.open(St).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","ALLEGATO ELIMINATO",{timeOut:1e3,progressBar:!0}))}))}}))},t.prototype.ngAfterViewInit=function(){},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,"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}();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\'\n "\n [fixed_label]="\n force_en\n ? \'Attachments description (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()"\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:kt},{type:i.ToastrService},{type:e.MatDialog},{type:Tt},{type:At}]},Rt.propDecorators={enabled:[{type:n.Input}],force_en:[{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}],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){var a=this;this._dataService=t,this.toastr=e,this.dialog=i,this.app_s=o,this.uti=s,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 500MB",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 l.FileUploader({url:this.app_s.API_ENDPOINT+this.app_s.UPLOAD_ENDPOINT+"_new",maxFileSize:524288e3}),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&&(a.descrizione="",a.toastr.info("INFO",a.allegato_inserito,{timeOut:1e3,progressBar:!0}),a.ref_allegato(),a.last_result={item:t,response:e,status:i,header:n},a.change.emit(a.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","Confermi l'eliminazione dell'elemento?"),this.dialog.open(St).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.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.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"\n ></FHComboBox\n >&nbsp;&nbsp;\n </div>\n <mat-form-field\n [hidden]="!show_descri"\n style="width: 100%"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label }} {{ fixed_label }}</mat-label>\n <input\n matInput\n type="text"\n name="descrizione"\n [(ngModel)]="descrizione"\n />\n </mat-form-field>\n &nbsp;&nbsp;&nbsp;&nbsp;\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">&nbsp;&nbsp;&nbsp;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" 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 &nbsp;<span style="font-size: 14px">&nbsp;&nbsp;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 &nbsp;&nbsp;&nbsp;&nbsp;\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 >&nbsp;&nbsp;&nbsp;\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:kt},{type:i.ToastrService},{type:e.MatDialog},{type:wt},{type:At}]},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.selval="-1",this.errorMsg="",this.valDef="-1",this.fltr_user="",this.value_list=new Array,this.single_sel=!1,this.vis_buttons=!0,this.limit_size=!1,this.value_list_sel=new Array,this.types=[],this.values=[],this.value_sel=[],null!=n&&(null!=n.value_list&&(this.value_list=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.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()},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.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()}else this.toastr.error("ERRORE","Selezionare il valore 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.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" fxFlex>\n <div fxLayout="row">\n <div fxLayout="column" fxFlex="41%">\n <div style="width:100%;height:420px;overflow:auto;">\n <table style="width: 100%" class="fh_table">\n <thead>\n <tr>\n <th>VALORI SELEZIONABILI</th>\n </tr>\n </thead>\n\n <tbody>\n <tr>\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"\n fxFlex="18%"\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 >\n <button\n mat-flat-button\n color="primary"\n (click)="do_add()"\n [disabled]="!option"\n >\n <mat-icon>arrow_forward</mat-icon>\n </button>\n <br /><br />\n <button\n mat-flat-button\n color="primary"\n (click)="do_rem()"\n [disabled]="option"\n >\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n </div>\n <div fxLayout="column" fxFlex="41%">\n <div style="width:100%;height:420px;overflow:auto;">\n <table style="width: 100%" class="fh_table">\n <thead>\n <tr>\n <th>VALORI SELEZIONATI</th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="let u of value_sel; 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 >&nbsp;&nbsp;&nbsp;\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="dialogRef.close()"\n >\n Annulla\n </button>\n </div>\n </div>\n ',styles:["\n .selector {\n cursor: hand;\n }\n "]}]}],Mt.ctorParameters=function(){return[{type:e.MatDialogRef},{type:kt},{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:p.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:"700px",height:"550px",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\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"\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:kt},{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="",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 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>DETTAGLIO MODIFICA - {{ title }}</h2>\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 '}]}],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,o,s){this.data=t,this.dialogRef=e,this._dataService=i,this.toastr=n,this.dialog=o,this.app_s=s,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}();Ut.decorators=[{type:n.Component,args:[{selector:"wkf_win_upload",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 <mat-toolbar color="primary" style="width:90%;"\n ><div fxFlex="20">{{ title }}</div>\n <div fxLayout="row" fxLayoutAlign="center end" fxFlex="90"></div>\n </mat-toolbar>\n <mat-dialog-content style="font-size:12px">\n\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\n </button>\n </div>\n ',styles:[""]}]}],Ut.ctorParameters=function(){return[{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]},{type:e.MatDialogRef},{type:kt},{type:i.ToastrService},{type:e.MatDialog},{type:wt}]},Ut.propDecorators={upc:[{type:n.ViewChild,args:["upc"]}]};var Vt=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}();Vt.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:[""]}]}],Vt.ctorParameters=function(){return[{type:e.MatDialogRef},{type:e.MatDialog},{type:wt},{type:At},{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){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="Back",this.mgs_edit="Edit",this.mgs_save="Save",this.b_commento=!1,this.log_enabled=!0,this.custom_commands=[],this.command=new n.EventEmitter}return t.prototype.logs=function(){this._dialog.open(Vt,{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}();qt.decorators=[{type:n.Component,args:[{selector:"FHFormToolBar",template:'\n <div fxLayout="row" fxLayoutGap="5px">\n <div\n fxLayout="row"\n fxLayoutGap="5px"\n [hidden]="is_editing"\n fxLayoutAlign="start center"\n >\n <button mat-flat-button [hidden]="!show_back" (click)="back()">{{ mgs_back }}</button\n >\n <button\n mat-flat-button\n color="primary"\n [hidden]="!editable"\n (click)="edit()"\n >\n <mat-icon>edit</mat-icon>&nbsp;&nbsp;{{ mgs_edit }}\n </button>\n <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>&nbsp;&nbsp;Logs\n </button>\n </div>\n <div\n fxLayout="row"\n fxLayoutGap="5px"\n [hidden]="!is_editing"\n fxLayoutAlign="start center"\n >\n <button mat-flat-button [hidden]="!show_back" (click)="back_ask_save()">{{ mgs_back }}</button>\n <button\n mat-flat-button\n color="primary"\n [hidden]="!show_save"\n (click)="save()"\n >\n <mat-icon>save</mat-icon>&nbsp;&nbsp;{{ mgs_save }}\n </button>\n\n <button [hidden]="!log_enabled"\n mat-flat-button\n *ngIf="App != \'\'"\n color="accent"\n (click)="logs()"\n >\n <mat-icon>assignment</mat-icon>&nbsp;&nbsp;Logs\n </button>\n </div>\n <div\n *ngIf="custom_commands.length > 0"\n fxLayoutGap="3px"\n fxLayout="row"\n fxLayoutAlign="end center"\n >\n <div *ngFor="let app of custom_commands" fxLayout="row"\n fxLayoutGap="5px">\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 }}\n </button>\n </div>\n </div>\n </div>\n ',styles:[""]}]}],qt.ctorParameters=function(){return[{type:e.MatDialog}]},qt.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:p.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Gt})),multi:!0},Gt=function(){function t(){this.hidden=!1,this.label="",this.enabled=!0,this.required=!1,this.rows=3,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}();Gt.decorators=[{type:n.Component,args:[{selector:"FHTextArea",providers:[Bt],template:'\n <mat-form-field [hidden]="hidden" appearance="outline" floatLabel="always"\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-form-field>\n ',styles:[""]}]}],Gt.ctorParameters=function(){return[]},Gt.propDecorators={hidden:[{type:n.Input}],label:[{type:n.Input}],enabled:[{type:n.Input}],required:[{type:n.Input}],rows:[{type:n.Input}],change:[{type:n.Output}],focusout:[{type:n.Output}],focusin:[{type:n.Output}]};var Kt=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}();Kt.decorators=[{type:n.Component,args:[{selector:"checkbox-cell",template:' <FHCheckBox [(ngModel)]="value"> </FHCheckBox> '}]}],Kt.ctorParameters=function(){return[]},Kt.propDecorators={input:[{type:n.ViewChild,args:["input",{read:n.ViewContainerRef}]}]};var Ht=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 a.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(r.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 Dt})),r.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t}();Ht.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new Ht(n.ɵɵinject(a.HttpClient),n.ɵɵinject(wt),n.ɵɵinject(i.ToastrService))},token:Ht,providedIn:"root"}),Ht.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],Ht.ctorParameters=function(){return[{type:a.HttpClient},{type:wt},{type:i.ToastrService}]};var Yt=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 a.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(r.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 Dt})),r.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),u.Observable.throw(e)},t}();Yt.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new Yt(n.ɵɵinject(a.HttpClient),n.ɵɵinject(wt),n.ɵɵinject(i.ToastrService))},token:Yt,providedIn:"root"}),Yt.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],Yt.ctorParameters=function(){return[{type:a.HttpClient},{type:wt},{type:i.ToastrService}]};var Qt=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}();Qt.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 />'}]}],Qt.ctorParameters=function(){return[{type:At}]},Qt.propDecorators={input:[{type:n.ViewChild,args:["input",{read:n.ViewContainerRef}]}]};var Xt=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}();Xt.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 '}]}],Xt.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:wt},{type:At}]};var Wt=function(){function t(t){this.model=t}return t.prototype.onInputChange=function(t,e){for(var i,n=t.toString().split(","),o=0;o<n.length;++o)n[o]=n[o].replace(/\D/g,"");if(0===n.length)i="";else{if(null!==n[0].match(/[0-9]{3}/gim)&&n[0].length>3){var s=Array.from(Array.from(n[0]).reverse().join("").match(/[0-9]{3}/gim).join()).reverse().join(""),a=n[0].replace(s.replace(/\D/g,""),"");i=(a.length>0?a+".":"")+s}else i=n[0];n.length>1&&(i+=","+n[1].substring(0,2))}this.model.valueAccessor.writeValue(i)},t}();Wt.decorators=[{type:n.Directive,args:[{selector:"[ngModel][decimal]",host:{"(ngModelChange)":"onInputChange($event)"}}]}],Wt.ctorParameters=function(){return[{type:p.NgControl}]};var $t={provide:p.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.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.ngChange=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(){this.m<60&&this.m++,this.sc()},t.prototype.dom=function(){this.m>0&&this.m--,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.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=parseInt(e[1]),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.getValue();this.selchange.emit(),this.ngChange.emit(t),this.onChange(t)},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:[$t],template:'\n <div fxLayout="row" fxLayoutAlign="center center" [hidden]="vertical && enabled">\n <b>{{ label }}</b\n >&nbsp;&nbsp;\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 <div *ngIf="enabled">\n <mat-icon (click)="doh()"\n >keyboard_arrow_down</mat-icon\n >\n </div>\n </div>\n\n &nbsp;&nbsp;<b style="font-size:28px">:</b>&nbsp;&nbsp;\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 style="width:40px;text-align:center;"\n (keydown)="onKeyDown1($event)"\n (focusout)="onMi()"\n [disabled]="!enabled"\n [(ngModel)]="m"\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"> &nbsp;&nbsp; &nbsp;&nbsp;\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 <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 &nbsp;&nbsp;&nbsp;&nbsp;\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>&nbsp;\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"> &nbsp;&nbsp; &nbsp;&nbsp;\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 <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 &nbsp;&nbsp;&nbsp;&nbsp;\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>&nbsp;\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:kt},{type:e.MatDialog},{type:wt},{type:i.ToastrService},{type:At}]},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}],arr_hh:[{type:n.Input}],arr_mm:[{type:n.Input}],selchange:[{type:n.Output}],ngChange:[{type:n.Output,args:["change"]}]};var Jt=function(){function t(){}return t.prototype.agInit=function(t){this.params=t},t.prototype.refresh=function(){return!0},t}();Jt.decorators=[{type:n.Component,args:[{selector:"currency-cell",template:'{{ params.value | currency: "EUR" }}'}]}];var te=function(){function t(t,e,i,n,o,s,r,l){this._dataService=t,this.toastr=e,this.http=i,this.router=n,this.route=o,this._fileService=s,this.app_s=r,this.uti_s=l,this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT,this.goto_after="",this.username="",this.headers=new a.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"),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(r.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 Dt})),r.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(r.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 Dt})),r.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(r.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 Dt})),r.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(r.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 Dt})),r.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(r.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 Dt})),r.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(r.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 Dt})),r.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}();te.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new te(n.ɵɵinject(kt),n.ɵɵinject(i.ToastrService),n.ɵɵinject(a.HttpClient),n.ɵɵinject(c.Router),n.ɵɵinject(c.ActivatedRoute),n.ɵɵinject(Tt),n.ɵɵinject(wt),n.ɵɵinject(At))},token:te,providedIn:"root"}),te.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],te.ctorParameters=function(){return[{type:kt},{type:i.ToastrService},{type:a.HttpClient},{type:c.Router},{type:c.ActivatedRoute},{type:Tt},{type:wt},{type:At}]};var ee=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.App=n.App,this.K=n.K;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_all=function(t){window.open(this.m_appService.COMPANY_SITE_ROOT+"/uploads/"+this.App+"/"+this.K+"/ant/"+t)},t}();ee.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}}\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="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 '}]}],ee.ctorParameters=function(){return[{type:e.MatDialogRef},{type:Tt},{type:wt},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var ie=function(){function t(t,e,i,o,s,a){this._appservice=t,this._dataService=e,this.toastr=i,this.dialog=o,this.auth_s=s,this.uti=a,this.enabled=!0,this.force_en=!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.show_upload=!0,this.b_initt=!1,this.change=new n.EventEmitter,this.call_upload=new n.EventEmitter,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=""}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,tipo:this.m_p_tipo,local_path:this._appservice.LOCAL_PATH,p1:this.m_programma_da_eseguire})},t.prototype.preview_email=function(t){this.dialog.open(ee,{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);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="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","Conferma Operazione"),localStorage.setItem(this._appservice.COMPANY_KEY+"msg_dialog","Confermi l'eliminazione dell'elemento?"),this.dialog.open(St).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("INFO","ALLEGATO ELIMINATO",{timeOut:1e3,progressBar:!0}))}),(function(t){}))}}))},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){setTimeout((function(){t.b_initt=!0}),700),t.upc.single=!1,t.b_mobile=t._appservice.getState().pageFullscreen,t.force_en?t.upc.init(t.App,t.K,"Attachment Description",t.m_p_tipo,t.m_programma_da_eseguire):t.upc.init(t.App,t.K,"Descrizione Allegato",t.m_p_tipo,t.m_programma_da_eseguire),t.m_p_tipo.indexOf("SELECT_")>-1&&(t.multi_list=!0),t.ref_allegato()})),"[ZZZ_DIS_CC]"!=this.ruolo_supervisore&&(this.access_control=!0)},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.ngAfterViewInit()},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}();ie.decorators=[{type:n.Component,args:[{selector:"FHUploadPanel",template:'\n <div fxLayout="column">\n <h3 *ngIf="label != \'\'">{{ label }}</h3>\n <div fxLayout="column">\n <div [hidden]="!enabled || !show_upload">\n <FHUpload\n [single]="b_False"\n\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\n [label_attendere]="\n force_en ? \'UPLOADING\' : \'ATTENDERE UPLOAD IN CORSO\'\n "\n [fixed_label]="\n force_en\n ? \'Attachments description (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()"\n (call_upload)="call_up($event)"\n #upc\n ></FHUpload>\n </div>\n <table width="98%" class="fh_table" *ngIf="!image_type && !b_mobile">\n <thead>\n <tr class="header">\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" style="width:60px;text-align:center">Dim.</th>\n <th [fxShow.lt-sm]="false" 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 <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 [fxShow.lt-sm]="false"\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.Filename }}</td>\n <td style="text-align:center" [fxShow.lt-sm]="false">{{ app.Filesize }}</td>\n <td [fxShow.lt-sm]="false">\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 *ngIf="multi_list">\n <div fxLayout="row">\n <a\n mat-icon-button\n matTooltip="Modifica Tipo"\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 \'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 <td style="text-align:center">\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\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 [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" style="width:60px;text-align:center">Dim.</th>\n\n <th [fxShow.lt-sm]="false" style="width:20%">\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 <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 [fxShow.lt-sm]="false"\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 [fxShow.lt-sm]="false">{{ app.Filename }}</td>\n <td [fxShow.lt-sm]="false" style="text-align:center">{{ app.Filesize }}</td>\n <td [fxShow.lt-sm]="false">\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 *ngIf="multi_list">\n <div fxLayout="row">\n <a\n mat-icon-button\n matTooltip="Modifica Tipo"\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 \'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">{{ app.Filename }}</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 <td style="text-align:center">\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\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.Filename }}<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:[""]}]}],ie.ctorParameters=function(){return[{type:wt},{type:kt},{type:i.ToastrService},{type:e.MatDialog},{type:te},{type:At}]},ie.propDecorators={enabled:[{type:n.Input}],force_en:[{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}],change:[{type:n.Output}],call_upload:[{type:n.Output}],upc:[{type:n.ViewChild,args:["upc"]}]};var ne=function(){function t(t,e,i,o,s){var a=this;this._dataService=t,this.toastr=e,this.dialog=i,this.app_s=o,this.uti=s,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 500MB",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.fill_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 l.FileUploader({url:this.app_s.API_ENDPOINT+this.app_s.UPLOAD_ENDPOINT,maxFileSize:524288e3}),this.id=null,this.show_upload=!0,this.id_component=this.uti.newGuid(),this.username=this.app_s.user,this.uploader.onBeforeUploadItem=function(t){t.withCredentials=!1},this.uploader.onCompleteItem=function(t,e,i,n){200===i&&(a.descrizione="",a.toastr.info("INFO",a.allegato_inserito,{timeOut:1e3,progressBar:!0}),a.ref_allegato(),a.last_result={item:t,response:e,status:i,header:n},a.change.emit(a.last_result))}}return 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.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(St).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.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.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.limit_string.split("<size>").join(""+o));break;default:t.toastr.error("Errore: "+i.name)}}}))},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;if(this.descri_obb&&""==this.descrizione)this.toastr.error(this.inserire_descrizione);else{for(var i=0;i<this.lista_allegati.length;i++)if(this.lista_allegati[i].Filename.toLowerCase()==t.file.name.toLowerCase())return void this.toastr.error("File già presente (cancellarlo per aggiornarlo)");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),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.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===n&&(n=""),void 0===o&&(o=""),void 0===s&&(s=!1),void 0===a&&(a=!1),void 0===r&&(r=!0),this.App=t,this.K=e,this.label=i,this.tipo=n,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.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",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}();ne.decorators=[{type:n.Component,args:[{selector:"FHUpload",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"\n ></FHComboBox\n >&nbsp;&nbsp;\n </div>\n <mat-form-field\n [hidden]="!show_descri"\n style="width: 100%"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label }} {{ fixed_label }}</mat-label>\n <input\n matInput\n type="text"\n name="descrizione"\n [(ngModel)]="descrizione"\n />\n </mat-form-field>\n &nbsp;&nbsp;&nbsp;&nbsp;\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">&nbsp;&nbsp;&nbsp;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" 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 &nbsp;<span style="font-size: 14px">&nbsp;&nbsp;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 &nbsp;&nbsp;&nbsp;&nbsp;\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 >&nbsp;&nbsp;&nbsp;\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 </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 && 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"]}]}],ne.ctorParameters=function(){return[{type:kt},{type:i.ToastrService},{type:e.MatDialog},{type:wt},{type:At}]},ne.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}],lista_allegati:[{type:n.Input}],change:[{type:n.Output}],upload_ended:[{type:n.Output}],call_upload:[{type:n.Output}],fill_end:[{type:n.Output}],select_file:[{type:n.ViewChild,args:["select_file"]}],cmb_tipo:[{type:n.ViewChild,args:["cmb_tipo"]}]};var oe=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 a.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(r.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 Dt})),r.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t}();oe.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new oe(n.ɵɵinject(a.HttpClient),n.ɵɵinject(wt),n.ɵɵinject(i.ToastrService))},token:oe,providedIn:"root"}),oe.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],oe.ctorParameters=function(){return[{type:a.HttpClient},{type:wt},{type:i.ToastrService}]};var se=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}();se.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 "]}]}],se.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:wt}]};var ae=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}();ae.decorators=[{type:n.Component,args:[{selector:"app-win_ask_text",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>{{ title }}</h2>\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 >&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="chiudi()">ANNULLA</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</button>\n </div>\n </mat-dialog-actions>\n '}]}],ae.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var re=function(){this.filter="",this.system_dest=1},le=function(){},pe=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 le;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){var n=this;void 0===i&&(i=null),this.eprog=0;var o=new vt;return o.sql="INSERT_OFFICE_OPERATION",o.types=["string","string"],e.sort((function(t,e){return t.ord<e.ord?-1:t.ord>e.ord?1:void 0})),o.values=[t,JSON.stringify(e)],this.dataService.doQuery(o).pipe(r.flatMap((function(e){if(null!=e&&"OK"==e.result_msg){var o=new gt;return o.command="exec_app",o.p1="print_manager",o.p2=t,null!=i&&setTimeout((function(){n.progress_update(i)}),2e3),n.fileService.doQuery(o).pipe(r.flatMap((function(t){if(null!=t&&"OK"==t.result_msg)return new u.Observable((function(e){setTimeout((function(){!0}),18e4);n.eprog=100,n.progress_update(i),e.next(t),e.complete()}))})))}})))},t}();pe.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new pe(n.ɵɵinject(kt),n.ɵɵinject(Tt),n.ɵɵinject(i.ToastrService))},token:pe,providedIn:"root"}),pe.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],pe.ctorParameters=function(){return[{type:kt},{type:Tt},{type:i.ToastrService}]};var ue=function(){function t(t,e,i,o,s,a,r,l,p,u){var c=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.end_point=null,this.tbl_name="",this.count_tbl_name="",this.num_per_pag=35,this.grid_key="PRO_H",this.sort_field="",this.fields="*",this.filters="1=1",this.enabled=!0,this.auto_load=!0,this.auto_height=!1,this.abilita_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_paste=!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.dataSource={getRows:function(t){c.slimLoadingBarService.start((function(){}));var e=new re;if(e.table=c.tbl_name,e.table_count=c.tbl_name,""!=c.count_tbl_name&&(e.table_count=c.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),e.sort_field=c.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('"+c.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=c.system_dest,e.field=c.fields,null!=c.filters&&(e.filter=c.filters),""!=c.fix_flt&&(""!=e.filter&&(e.filter=e.filter+" and "),e.filter=e.filter+" ("+c.fix_flt+" )"),""!=c.fix_flt_temp&&(""!=e.filter&&(e.filter=e.filter+" and "),e.filter=e.filter+" ("+c.fix_flt_temp+" )");var n=e.filter;if(null!=t.filterModel)for(var o in t.filterModel){var s=t.filterModel[o];console.log(t.filterModel[o],o),null==s.operator?""==e.filter?e.filter+=c.calcola_filtro(t.filterModel[o],"",o,!1):e.filter+=c.calcola_filtro(t.filterModel[o],"",o,!0):(""!=e.filter&&(e.filter+=" and "),e.filter+=" (",e.filter+=c.calcola_filtro(t.filterModel[o].condition1,"",o,!1),e.filter+=" "+s.operator+" ",e.filter+=c.calcola_filtro(t.filterModel[o].condition2,"",o,!1),e.filter+=")")}""==e.filter||n==e.filter?c.show_pulisci_filtri=!1:c.show_pulisci_filtri=!0,c.str_curr_q_p="",""!=e.filter&&(c.str_curr_q_p="where "+e.filter),""!=e.sort_field&&(c.str_curr_q_p=c.str_curr_q_p+" order by "+e.sort_field),c.curr_filter=e.filter,console.log("this.filter ",c.filters," p.filter ",e.filter),c._gridservice.doQuery(e,!0,c.end_point).subscribe((function(i){var n=!1;if(null!=i&&"OK"==i.result_msg){n=!0,t.successCallback(i.result_data,i.count),c.b_init=!0,c.myData=i.result_data.slice(),c.num_r=i.count,c.slimLoadingBarService.complete(),c.fill_end.emit(),localStorage.setItem(c.grid_key+"_POS1",JSON.stringify(e)),null!=localStorage.getItem(c.grid_key+"_POS2")&&null!=c.gridOptions&&null!=c.gridOptions.api&&c.gridOptions.api.forEachNode((function(t){c.getRowNodeId(t)===localStorage.getItem(c.grid_key+"_POS2")&&(t.setSelected(!0),localStorage.removeItem(c.grid_key+"_POS2"))}));null!=c.toggle_mantieni&&c.toggle_mantieni.checked,c.no_pref&&!c.b_init1&&c.autoSizeAll(),c.b_init1=!0,c.ensure_visible(),null==localStorage.getItem(c.grid_key+"_COLS")&&c.autosize_at_ini&&setTimeout((function(){c.autoSizeAll()}),300)}n||(c.errorMsg=i.msg+" ["+i.result_msg+"]")}),(function(t){c.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(){c.export_excel()},icon:'<img src="assets/icons/square-o/xlsx.svg"/>'}]},this.gridOptions={debug:!1,headerHeight:this.header_h,floatingFilter:!0,enableRangeSelection:!0,defaultColDef:{resizable:!0,sortable:!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={})}return 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(St,{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(St,{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(ae,{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.calcola_filtro=function(t,e,i,n){void 0===n&&(n=!0);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 '%"+t.filter.replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()+"%' ESCAPE '$'"),"startsWith"==t.type&&(e=e+" upper("+i+") like '"+t.filter.replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()+"%' ESCAPE '$'"),"equals"==t.type&&(e=e+" upper("+i+") = '"+t.filter.replace("'","''").toUpperCase()+"%'"),"notContains"==t.type&&(e=e+"not upper("+i+") like '%"+t.filter.replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()+"%' ESCAPE '$'"),"notEqual"==t.type&&(e=e+" upper("+i+") <> '"+t.filter.replace("'","''").toUpperCase()+"'"),"endsWith"==t.type&&(e=e+" upper("+i+") like '%"+t.replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()+"' 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=!1;if(null!=t.values)for(var l=0;l<t.values.length;l++)null!=t.values[l]?(""!=a&&(a+=","),a=a+"'"+t.values[l].replace("'","''")+"'"):r=!0;var p=-1,u=this.gridOptions.api.getColumnDef(i);if(console.log("countryFilterComponent ",u),null!=u&&null!=u.filterParams&&null!=u.filterParams.values){var c=u.filterParams.values;c=c.filter((function(t,e){return c.indexOf(t)===e})),console.log("model ",c),null!=c&&(p=c.length)}console.log("obj_filtro.values.length!=num_all ",t.values.length,p),""!=a?t.values.length!=p&&(!0,n&&(e+=" and "),e=r?e+"("+i+" in ("+a+") or "+i+" is null)":e+i+" in ("+a+")"):(!0,n&&(e+=" and "),r?e=e+" "+i+" is null":e+=" (1=0)")}return e},t.prototype.onBtExport=function(){this.export_excel()},t.prototype.sendToClipboard=function(t,e,i){e.copySelectedRowsToClipboard(!1)},t.prototype.setHeaderHeight=function(t){var e=this;this.header_h=t,this.gridOptions.api.setHeaderHeight(this.header_h),this.enable_paste||(this.gridOptions.sendToClipboard=function(t){e.clipboard.copy(t.data),e.last_copy!=t.data&&(e.last_copy=t.data,e.sendToClipboard(t,e.gridOptions.api,e.last_copy))})},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(se,{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.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>15e3)this._toast.error("Massimo 15000 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++)""!=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++)),i.push(this.officeService.operation("GB_CREA_TABELLA_FROM_DB","select "+n+" 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).subscribe((function(i){setTimeout((function(){e.dialogRef_W.componentInstance.update_progess(100)}));var n=new gt;n.p1=e.m_appService.LOCAL_PATH+"grid_reports\\"+e.uiid_stampa+"_"+e.m_appService.user+t,n.command="check_file",e._fileService.doQuery(n).subscribe((function(i){if(null!=i)if("N"==i.msg){var n=new vt;n.sql="SELECT_OFFICE_OPERATION_FINISCHED",n.types=["string"],n.values=[e.uiid_stampa],e._dataService.doQuery(n).subscribe((function(t){null!=t&&"OK"==t.result_msg&&t.result_data.length>0?e._toast.error(t.result_data[0].result_msg):e._toast.error("ERRORE DI STAMPA")}))}else 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++)e[n].length>2?i.push(e[n]):this._toast.error("ignorato termine: "+e[n]+" troppo corto");if(0==i.length)return;for(var o="",s=0;s<this.columnDefs.length;s++)if(null!=this.columnDefs[s]&&null==this.columnDefs[s].no_filter&&null!=this.columnDefs[s].field&&""!=this.columnDefs[s].field&&"agDateColumnFilter"!=this.columnDefs[s].filter)for(n=0;n<i.length;n++)""!=o&&(o+=" or "),o=o+this.columnDefs[s].field+" LIKE '%"+this.uti_s.string_sqlvalue(i[n]).replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()+"%' ESCAPE '$'";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.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.gridOptions.api.sizeColumnsToFit()}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++)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]).replace("'","$'").replace("*","$*").replace("?","$?").replace("[","$[").replace("]","$]").replace("!","'$").toUpperCase()+"%' ESCAPE '$'";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,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}();ue.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 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <div fxLayout="row" fxLayoutGap="3px" fxLayoutAlign="start center">\n <div>\n <h5>{{num_r}}&nbsp;{{label_elementi}}</h5>\n </div>\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n\n <div fxLayout="row" fxLayoutAlign="start center">\n <input\n matInput\n [placeholder]="trova_label"\n (keydown)="keyDownFunctioncl($event)"\n [(ngModel)]="ric_libera"\n style="\n min-width: 100px;\n max-width: 180px;\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>&nbsp;\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>compare_arrows</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\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 &nbsp;\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 &nbsp;&nbsp;&nbsp;&nbsp;\n\n <img\n *ngIf="abilita_export"\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="abilita_export"\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 style="width: 100%;"\n *ngIf="enabled"\n >\n <FHGridToolBar\n (command)="docmd($event)"\n [type]="toolbar_type"\n [custom_commands]="toolbar_custom_commands"\n [toolbar_wkfapp]="toolbar_wkfapp"\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\n [getContextMenuItems]="abilita_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:[""]}]}],ue.ctorParameters=function(){return[{type:oe},{type:i.ToastrService},{type:kt},{type:wt},{type:d.SlimLoadingBarService},{type:e.MatDialog},{type:At},{type:pe},{type:Tt},{type:h.Clipboard}]},ue.propDecorators={end_point:[{type:n.Input}],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}],enabled:[{type:n.Input}],auto_load:[{type:n.Input}],auto_height:[{type:n.Input}],abilita_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_paste:[{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 ce={provide:p.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return de})),multi:!0},de=function(){function t(t,e){this._dataService=t,this._dataService_odbc=e,this.init_fill=!0,this.sql="",this.types=[],this.values=[],this.hidden=!1,this.label="",this.enabled=!0,this.required=!1,this.sel_label="",this.tooltip="",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.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.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("$")){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){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&&this.setByDescri(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.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&&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();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=o[0],this.add_option(n)}this.setByValue(this.valDef),this.is_loaded=!0,"-1"==this.getValue()&&this.setByDescri(this.valDef)},t.prototype.doFill=function(){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.fillCombo()}else t.errorMsg="";t.initend.emit(),setTimeout((function(){t.is_loaded=!0}),1e3)}))},t.prototype.sc=function(){this.onChange(this.getValue()),this.selchange.emit({event:this.getObj(),valore:this.getValue(),descrizione_valore:this.getDescri()})},t.prototype.getModelValue=function(){return this.getData("valore")},t.prototype.writeValue=function(t){this.resetValue(),this.setByValue(t)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}();de.decorators=[{type:n.Component,args:[{selector:"FHComboBox",providers:[ce],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)"\n appearance="outline"\n floatLabel="always"\n ><mat-label>{{ label }}</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">{{ 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 [matTooltip]="tooltip"\n />\n </mat-form-field>\n ',styles:[""]}]}],de.ctorParameters=function(){return[{type:kt},{type:Ht}]},de.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}],tooltip:[{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:p.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return _e})),multi:!0},_e=function(){function t(t,e){this._dataService=t,this._dataService_odbc=e,this.init_fill=!0,this.sql="",this.label="",this.types=[],this.values=[],this.hidden=!1,this.id_loading=!1,this.db_type="1",this.enabled=!0,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.sItem="",this.searchItemsFiltered=[],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){this.searchItemsFiltered=[];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.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(){this.fillCombo()},t.prototype.fillCombo=function(){var t=this;this.myData=new Array,this.searchItemsFiltered=new Array;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}}))},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);t.fillCombo()}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}();_e.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)"\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 (keyup)="onChange_up($event)"\n [(ngModel)]="sItem"\n (focus)="fi_search()"\n (focusout)="fo_search($event)"\n #searchp\n />\n </mat-form-field>\n <mat-autocomplete\n #auto="matAutocomplete"\n (optionSelected)="selectedSearchItem($event)"\n autoActiveFirstOption\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"\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:[""]}]}],_e.ctorParameters=function(){return[{type:kt},{type:Ht}]},_e.propDecorators={init_fill:[{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}],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}],searchp:[{type:n.ViewChild,args:["searchp"]}],auto:[{type:n.ViewChild,args:["auto"]}]};for(var me=m,fe={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMMM Y",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM Y"}},ge=[],ve=1;ve<=31;ve++)ge.push(String(ve));var ye=function(t){function e(){var e=t.apply(this,xt(arguments))||this;return e.localeData=me.localeData(),e}return function(t,e){function i(){this.constructor=t}Et(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 ge},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 me([t,e,i])},e.prototype.today=function(){return me()},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=me(t,e,!0);return o.isValid()||(o=me(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=me.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:m.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 me.isMoment(t)},e.prototype.toIso8601=function(t){return t.format()},e.prototype.fromIso8601=function(t){return me(t)},e.prototype.invalid=function(){},e}(f.DateAdapter),be={provide:p.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Ie})),multi:!0},we=fe,Ie=function(){function t(t,e){this.dateAdapter=t,this.uti_s=e,this.label="",this.required=!1,this.show_buttons=!1,this.enabled=!0,this.min_date=null,this.max_date=null,this.change=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.dateAdapter.setLocale("it-IT")}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 ye,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.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 ye;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 ye;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 ye;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.prototype.setLimits=function(){},t.prototype.setToday=function(){this.date_sel=new Date},t.prototype.setValue=function(t){if(this.dateAdapter.setLocale("it-IT"),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 ye;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:[be,{provide:f.MAT_DATE_FORMATS,useValue:we},{provide:f.DateAdapter,useClass:ye},{provide:f.MAT_DATE_LOCALE,useValue:"it-IT"}],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"\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-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:f.DateAdapter},{type:At}]},Ie.propDecorators={label:[{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"]}]};var Se=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.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))}return t.prototype.filtra=function(){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))if(null==this.user_sel)this.users_list_sel.push(this.users_list[t]);else{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.filtra())}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"}))}else{if(null!=t.user_sel&&t.user_sel.length>0)return;if(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])}}))},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),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}();Se.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</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 }}</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 (mouseover)="selectedAdd = u"\n\n (click)="addTo(u)"\n (dblclick)="do_add()"\n\n class="sel_r"\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 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 >\n <button\n mat-flat-button\n color="primary"\n (click)="do_add()"\n [disabled]="!option"\n >\n <mat-icon>arrow_forward</mat-icon>\n </button>\n <br /><br />\n <button\n mat-flat-button\n color="primary"\n (click)="do_rem()"\n [disabled]="option"\n >\n <mat-icon>delete</mat-icon>\n </button>\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</th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor="let u of user_sel; let odd = odd; let even = even"\n (mouseover)="selectedRemove = u"\n (click)="removeTo(u)"\n (dblclick)="do_rem()"\n class="sel_r"\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 >&nbsp;&nbsp;&nbsp;\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 ',styles:["\n\n\n "]}]}],Se.ctorParameters=function(){return[{type:kt},{type:e.MatDialogRef},{type:i.ToastrService},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},Se.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 Ee={provide:p.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Oe})),multi:!0},Oe=function(){function t(){this.hidden=!1,this.label="",this.enabled=!0,this.required=!1,this.email=!1,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}();Oe.decorators=[{type:n.Component,args:[{selector:"FHTextInput",providers:[Ee],template:'\n <mat-form-field [hidden]="hidden" appearance="outline" floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n <input\n matInput\n [email]="email"\n type="text"\n [(ngModel)]="text_v"\n [disabled]="!enabled"\n [required]="required"\n (focusout)="onFu()"\n (focusin)="onFi()"\n (ngModelChange)="modelch()"\n />\n </mat-form-field>\n ',styles:[""]}]}],Oe.ctorParameters=function(){return[]},Oe.propDecorators={hidden:[{type:n.Input}],label:[{type:n.Input}],enabled:[{type:n.Input}],required:[{type:n.Input}],email:[{type:n.Input}],change:[{type:n.Output}],focusout:[{type:n.Output}],focusin:[{type:n.Output}]};var xe=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}();xe.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 "]}]}],xe.propDecorators={container:[{type:n.ViewChild,args:["container",{read:n.ViewContainerRef}]}]};var Ce="000000",Ae=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}();Ae.decorators=[{type:n.Pipe,args:[{name:"FHCurrency"}]}],Ae.ctorParameters=function(){return[]};var De=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}();De.decorators=[{type:n.Directive,args:[{selector:"[FHCurrencyFormatter]"}]}],De.ctorParameters=function(){return[{type:n.ElementRef},{type:Ae}]},De.propDecorators={onFocus:[{type:n.HostListener,args:["focus",["$event.target.value"]]}],onBlur:[{type:n.HostListener,args:["blur",["$event.target.value"]]}]};var Te=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.title="",this.sql_dett="",this.descri="",this.lat=51.673858,this.long=7.815982,this.zoom=7,this.infoWindowOpened=null,this.markers=[],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.infoWindowOpened!==e&&(null!==this.infoWindowOpened&&this.infoWindowOpened.close(),this.infoWindowOpened=e)},t.prototype.ngAfterViewInit=function(){},t}();Te.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="min-width:800px;min-height:500px;font-size: 15px;"\n >\n <agm-map\n [zoom]="zoom"\n width="100%"\n height="100%"\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 <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 "]}]}],Te.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:wt}]};var ke=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}();ke.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!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="this.params.api.stopEditing();">ANNULLA</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 "]}]}],ke.propDecorators={container:[{type:n.ViewChild,args:["container",{read:n.ViewContainerRef}]}],appdt:[{type:n.ViewChild,args:["appdt"]}]};var Le=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}();Le.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!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="this.params.api.stopEditing();">ANNULLA</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.ctorParameters=function(){return[{type:kt}]},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.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){var e=new vt;e.sql=this.sql,e.types=this.types,e.values=this.values,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}();Re.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 >&nbsp;&nbsp;&nbsp;\n </td>\n </tr>\n </tbody>\n </table>\n ',styles:[""]}]}],Re.ctorParameters=function(){return[{type:kt}]},Re.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 Ne=function(){function t(){}return t.prototype.transform=function(t){return""+t.replace(/\n/g,"<br/>")},t}();Ne.decorators=[{type:n.Pipe,args:[{name:"replaceLineBreaks"}]}];var Fe=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.title="",this.label="",this.valore="",this.valore_min=1,this.valore_max=1e6}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}();Fe.decorators=[{type:n.Component,args:[{selector:"app-win_ask_text",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>{{ title }}</h2>\n <mat-dialog-content style="font-size: 15px;">\n <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n <input matInput type="number" [(ngModel)]="valore" required />\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-flat-button color="primary" (click)="do_check()">OK</button\n >&nbsp;&nbsp;&nbsp;<button\n mat-flat-button\n color="warn"\n (click)="chiudi()"\n >\n ANNULLA\n </button>\n </mat-dialog-actions>\n '}]}],Fe.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService}]};var Me=function(){function t(t){this.platformId=t}return t.prototype.highlightAll=function(){g.isPlatformBrowser(this.platformId)&&Prism.highlightAll()},t}();Me.decorators=[{type:n.Injectable}],Me.ctorParameters=function(){return[{type:Object,decorators:[{type:n.Inject,args:[n.PLATFORM_ID]}]}]};var Pe=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}();Pe.decorators=[{type:n.Component,args:[{selector:"FHMdReader",template:' <markdown [src]="path_md"> </markdown> ',styles:[""]}]}],Pe.ctorParameters=function(){return[{type:Me}]},Pe.propDecorators={path_md:[{type:n.Input}]};var ze=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 i.getFullYear()<1980?" ------ ":e.uti.pad(i.getDate(),2)+"/"+e.uti.pad(i.getMonth()+1,2)+"/"+i.getFullYear()}}],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}();ze.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:[""]}]}],ze.ctorParameters=function(){return[{type:At}]},ze.propDecorators={g_height:[{type:n.Input}],datagrid:[{type:n.ViewChild,args:["dtm"]}]};var je={provide:p.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Ue})),multi:!0},Ue=function(){function t(){this.decimal=2,this.label="",this.required=!1,this.enabled=!0,this.hidden=!1,this.color="",this.m_color="",this.label_width="",this.change=new n.EventEmitter,this.focus=new n.EventEmitter,this.focus_out=new n.EventEmitter,this.enter_pressed=new n.EventEmitter,this.innerValue=0,this.onChange=function(t){},this.onTouched=function(){},this.formattedAmount="0,00",this.value=0,this.set_color(this.color)}return t.prototype.kd=function(t){"Enter"==t.code&&this.enter_pressed.emit()},t.prototype.getStyle_color=function(){return this.m_color},t.prototype.getStyle_mw=function(){return this.label_width},t.prototype.set_color=function(t){this.m_color=t},t.prototype.chg=function(){var t=this;setTimeout((function(){0==t.decimal?t.value=parseFloat(t.formattedAmount.split(".").join("").split(",").join("")):t.value=parseFloat(t.formattedAmount.split(".").join("").split(",").join(".")),"string"==typeof t.value&&(0==t.decimal?t.value=parseFloat(t.value.split(".").join("").split(",").join("")):t.value=parseFloat(t.value.split(".").join("").split(",").join("."))),console.log("this.value ",t.value),t.onChange(t.value)}),0)},t.prototype.writeValue=function(t){console.log("inif ",t,this.innerValue),null==t&&(t=0),parseFloat(t)!==this.innerValue&&(console.log("typeof value ",typeof t),"string"==typeof t&&(t=0==this.decimal?parseFloat(t.split(".").join("").split(",").join("")):parseFloat(t.split(".").join("").split(",").join("."))),this.innerValue=t,this.value=t,console.log("writeValue ini ",this.value,this.formattedAmount),this.formattedAmount=this.transform(this.value,this.decimal),console.log("writeValue fin ",this.value,this.formattedAmount))},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.transformAmount=function(t){var e=this;try{setTimeout((function(){console.log("transformAmount ini ",e.value,e.formattedAmount),e.formattedAmount=e.transform(e.value,e.decimal),console.log("transformAmount fin ",e.value,e.formattedAmount)}),0)}catch(t){console.log(t)}},t.prototype.transform=function(t,e){void 0===e&&(e=2),console.log("trasform ",t);var i=Ot((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return console.log("integer, fraction ",n,s),s=e>0?","+(s+"000000").substring(0,e):"",""==(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,"."))&&(n="0"),console.log("trasform ",n+s),n+s},t.prototype.focus_e=function(t){try{this.removeCurrencyPipeFormat(t),this.setFocus(),this.focus.emit(this.value)}catch(t){console.log(t)}},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.prototype.removeCurrencyPipeFormat=function(t){try{this.formattedAmount=this.transform(this.value,this.decimal)}catch(t){console.log(t)}},t}();Ue.decorators=[{type:n.Component,args:[{selector:"FHCurrencyField",providers:[je],template:'\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 style="text-align:right"\n #el\n matInput\n [disabled]="!enabled"\n [(ngModel)]="formattedAmount"\n (blur)="transformAmount($event); focus_out.emit(value)"\n [style.color]="getStyle_color()"\n (keydown)="kd($event)"\n (focus)="focus_e($event)"\n (keyup)="chg()"\n />\n </mat-form-field>\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 style="text-align:right"\n [style.color]="getStyle_color()"\n #el1\n matInput\n [disabled]="true"\n [(ngModel)]="formattedAmount"\n />\n </mat-form-field>\n ',styles:[""]}]}],Ue.ctorParameters=function(){return[]},Ue.propDecorators={el:[{type:n.ViewChild,args:["el"]}],decimal:[{type:n.Input}],label:[{type:n.Input}],required:[{type:n.Input}],enabled:[{type:n.Input}],hidden:[{type:n.Input}],color:[{type:n.Input}],label_width:[{type:n.Input}],change:[{type:n.Output}],focus:[{type:n.Output}],focus_out:[{type:n.Output}],enter_pressed:[{type:n.Output}],value:[{type:n.Input}]};var Ve={provide:p.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.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"\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 ',styles:[""]}]}],qe.ctorParameters=function(){return[]},qe.propDecorators={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 Be=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.title="",this.label="",this.valore="",this.min_chars=3,this.max_chars=50}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}();Be.decorators=[{type:n.Component,args:[{selector:"app-win_output",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>{{ title }}</h2>\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 <button mat-flat-button color="warn" (click)="chiudi()">CHIUDI</button>\n </mat-dialog-actions>\n '}]}],Be.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService}]},Be.propDecorators={title:[{type:n.Input}],label:[{type:n.Input}],valore:[{type:n.Input}]};var Ge={provide:p.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Ke})),multi:!0},Ke=function(){function t(t){this.uti_s=t,this.decimal=0,this.label="",this.text_align="right",this.th_character=".",this.required=!1,this.enabled=!0,this.hidden=!1,this.m_color="",this.pattern="[-+]?[0-9]*[.,]?[0-9]+",this.change=new n.EventEmitter,this.innerValue=0,this.chgf=!1,this.onChange=function(t){},this.onTouched=function(){},this.formattedAmount="0,00",this.value=0}return t.prototype.getStyle=function(){return this.m_color},t.prototype.set_backcolor=function(t){this.m_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){this.chgf?this.chgf=!1:(null==t&&(t=0),t!==this.innerValue&&(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){var e=this;setTimeout((function(){e.el.nativeElement.select()}),200)},t.prototype.select_allf=function(t){this.el.nativeElement.select()},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}();Ke.decorators=[{type:n.Component,args:[{selector:"FHNumericField",providers:[Ge],template:'\n <mat-form-field [hidden]="hidden" appearance="outline" floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n <input\n type="text"\n [style.text-align]="text_align"\n [style.background-color]="getStyle()"\n #el\n matInput\n [required]="required"\n [disabled]="!enabled"\n [(ngModel)]="formattedAmount"\n (blur)="chg()"\n (click)="click_select_allf($event)"\n (focus)="removeCurrencyPipeFormat($event); select_allf($event)"\n [pattern]="pattern"\n />\n </mat-form-field>\n ',styles:[""]}]}],Ke.ctorParameters=function(){return[{type:At}]},Ke.propDecorators={el:[{type:n.ViewChild,args:["el"]}],decimal:[{type:n.Input}],label:[{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}],change:[{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.values=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 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>{{ title }}</h2>\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 >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\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 '}]}],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:p.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.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),console.log(e.selectedUser),e.userName=e.getUsersNc(),console.log(e.userName)):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(null!=this.all_user){if(this.enabled){var e=this.dialog.open(Se,{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()})),e.afterClosed().subscribe((function(e){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"\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"\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:kt},{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 Xe=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}();Xe.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 >&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="esci_senza_salv()">\n {{ esci_senza_salvataggi }}\n </button>\n </div>\n </div>\n '}]}],Xe.ctorParameters=function(){return[{type:e.MatDialogRef},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]},{type:i.ToastrService}]};var We=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}();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 <h4 mat-dialog-title>{{ title }}</h4>\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 <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>Commento {{ nota_commento }}</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="4"></textarea>\n </mat-form-field>\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 >&nbsp;&nbsp;&nbsp;\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n ANNULLA\n </button>\n </div>\n '}]}],We.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:kt},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]},We.propDecorators={up:[{type:n.ViewChild,args:["up"]}]};var $e=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.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.m_appService.getState().wkf_doc_info.title,this.lbl=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=" (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","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: {{ utenti }}\n </div>\n <h3\n *ngIf="!mobile && utenti?.toLocaleLowerCase().indexOf(\'system\') == -1"\n >\n Assegnata a: {{ 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 >&nbsp;&nbsp;&nbsp;&nbsp;\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="close()"\n >\n ANNULLA\n </button>\n </div>\n '}]}],$e.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:kt},{type:void 0,decorators:[{type:n.Inject,args:[e.MAT_DIALOG_DATA]}]}]};var Ze=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i,this.selval="-1",this.errorMsg="",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}();Ze.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="font-size: 15px;">\n <mat-toolbar\n >SELEZIONA AMBITO\n <div style="width:100%;text-align: right;"></div>\n </mat-toolbar>\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 '}]}],Ze.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService}]},Ze.propDecorators={smtr:[{type:n.ViewChild,args:["cmb"]}]};var Je=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i,this.selval="-1",this.errorMsg="",this.OK_BUTTON="OK",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)}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}();Je.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="font-size: 15px;">\n <mat-toolbar style="max-width:500px"\n >SELEZIONA PROSSIMO STEP:\n </mat-toolbar>\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:</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.descri_livello\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 >&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="close()">\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 '}]}],Je.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService}]},Je.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 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>{{ title }} </mat-toolbar>\n\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 >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="close()">ANNULLA</button>\n </div>\n '}]}],ti.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:kt}]},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[3],t.values[1]=o)}this.headers=new a.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(r.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 Dt})),r.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(a.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:a.HttpClient},{type:wt},{type:i.ToastrService}]};var ii=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.m_file=a,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="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="COMMENTI"}}),(function(t){}))},t.prototype.ok=function(){if(this.not_comm){if(""==this.nota)return void this.toastr.error("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="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){void 0===p&&(p=!0),void 0===u&&(u="");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","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","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","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler annullare l'inserimento del commento?"),this.m_dialogRef.open(St).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="INSERISCI COMMENTO"},t}();ii.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 color="primary"\n >{{ title }}\n <span class="fill-remaining-space"></span>\n <div>\n <button mat-mat-flat-button color="accent" (click)="ins()" *ngIf="!b_edit">\n <mat-icon>note_add</mat-icon>\n INSERISCI\n </button>\n </div>\n </mat-toolbar>\n <br />\n <div mat-dialog-content style="min-width:800px;font-size: 15px;">\n <mat-form-field *ngIf="b_edit" appearance="outline" floatLabel="always"\n ><mat-label>Commento</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="12"></textarea>\n </mat-form-field>\n\n <div *ngIf="b_edit" fxLayoutAlign="center center" fxLayout="row">\n <button mat-flat-button color="primary" (click)="ok()">OK</button\n >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="annulla()">ANNULLA</button\n >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\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\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</th>\n <th width="15%">Autore</th>\n <th width="15%">Data</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 CHIUDI\n </button>\n </div>\n ',styles:[""]}]}],ii.ctorParameters=function(){return[{type:e.MatDialogRef},{type:e.MatDialog},{type:wt},{type:i.ToastrService},{type:kt},{type:ei},{type:Tt}]};var ni=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toast=i,this.hide_richiedente=!1,this.load_info()}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.load_info=function(){var t=this;null!=this.m_appService.getState().wkf_doc_info&&null!=this.m_appService.getState().wkf_doc_info.codice?(this.codice=this.m_appService.getState().wkf_doc_info.codice,this.data_richiesta=this.m_appService.getState().wkf_doc_info.data_richiesta,this.richiedente=this.m_appService.getState().wkf_doc_info.richiedente,this.stato=this.m_appService.getState().wkf_doc_info.stato,this.in_carico_a=this.m_appService.getState().wkf_doc_info.in_carico_a,this.uiid_app=this.m_appService.getState().wkf_doc_info.uiid_app,this.uiid_doc=this.m_appService.getState().wkf_doc_info.uiid_doc,this.canale=this.m_appService.getState().wkf_doc_info.canale):setTimeout((function(){t.load_info()}),500)},t.prototype.ngAfterViewInit=function(){},t}();ni.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 color="primary"\n >INFO DOCUMENTO\n <div style="width:100%;text-align: right;"></div>\n </mat-toolbar>\n <div mat-dialog-content style="font-size: 15px;">\n <table class="fh_table">\n <tbody>\n <tr class="odd">\n <td>Codice:</td>\n <td>\n <b>{{ codice }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>Data:</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:</td>\n <td>\n <b>{{ richiedente }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>Stato:</td>\n <td>\n <b>{{ stato }}</b>\n </td>\n </tr>\n <tr class="odd">\n <td>In Carico a:</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 '}]}],ni.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService}]};var oi=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.m_file=a,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.lettori="",this.subject="",this.link="",this.codice_doc=""}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(St).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++)t.logs[i].v_commento="<b>"+t.logs[i].operazione.replace(/\n/g,"<br/>")+"</b>";t.ossv||(t.modeler=new T({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){void 0===p&&(p=!0),void 0===u&&(u="");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).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).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"\n >\n <button mat-flat-button color="accent" (click)="ins()">\n <mat-icon>note_add</mat-icon>\n INSERISCI</button\n >&nbsp;&nbsp;&nbsp;&nbsp;\n </div>\n\n <div fxLayout="column" *ngIf="b_edit">\n <br />\n <mat-form-field\n *ngIf="b_edit"\n appearance="outline"\n floatLabel="always"\n ><mat-label>Commento</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="12"></textarea>\n </mat-form-field>\n\n <div *ngIf="b_edit" fxLayoutAlign="center center" fxLayout="row">\n <button mat-flat-button color="primary" (click)="ok()">OK</button\n >&nbsp;&nbsp;&nbsp;&nbsp;\n <button\n mat-flat-button\n style="background-color: #F5F5F5"\n (click)="annulla()"\n >\n ANNULLA</button\n >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\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\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</th>\n <th width="15%">Utente</th>\n <th>Operazione</th>\n <td></td>\n <td></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>\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:kt},{type:ei},{type:Tt}]},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 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="font-size: 15px;">\n <mat-toolbar color="primary"\n >{{ title }}\n <span class="fill-remaining-space"></span>\n </mat-toolbar>\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 '}]}],si.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:kt}]},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 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="font-size: 15px;">\n <mat-toolbar>{{ title }} </mat-toolbar>\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.descri_livello\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 >&nbsp;&nbsp;&nbsp;\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 '}]}],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 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 <h4 mat-dialog-title>{{ title }}</h4>\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\n <mat-form-field\n [hidden]="commento_hidden"\n appearance="outline"\n floatLabel="always"\n ><mat-label>Commento {{ nota_commento }}</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</button>\n </div>\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\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 '}]}],ri.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:kt}]},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 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 <h4 mat-dialog-title>{{ title }}</h4>\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 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\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 '}]}],li.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:i.ToastrService},{type:kt}]},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(At),n.ɵɵinject(wt))},token:pi,providedIn:"root"}),pi.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],pi.ctorParameters=function(){return[{type:At},{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.abilita_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,floatingFilter:!0,enableRangeSelection:!0,enableServerSideSorting:!1,enableServerSideFilter:!1,defaultColDef:{resizable:!0,sortable:!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;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(St,{disableClose:!0}).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(ae,{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.abilita_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(se,{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"))){var e=/iPad|iPhone|iPod/.test(navigator.userAgent);this.gridOptions.api.setGridAutoHeight(!e),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 }}</h5>\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n </td>\n <td style="vertical-align:\'bottom\'">\n &nbsp;&nbsp;&nbsp;&nbsp;\n <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>{{ trova_label }}</mat-label>\n <input\n matInput\n (keydown)="keyDownFunctioncl($event)"\n [(ngModel)]="ric_libera"\n style="width:200px"\n /> </mat-form-field\n >&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;\n </td>\n <td\n [hidden]="this.m_appService.getState().pageFullscreen"\n *ngIf="show_buttons && !this.m_appService.getState().mobile"\n >\n &nbsp;&nbsp;&nbsp;<button\n *ngIf="show_pulisci_filtri"\n mat-flat-button\n (click)="pulisci_filtri()"\n color="warn"\n >\n <mat-icon>clear</mat-icon>&nbsp;&nbsp;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 &nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="autoSizeAll()" color="accent">\n <mat-icon>photo_size_select_small</mat-icon>&nbsp;&nbsp;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 &nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="fitSizeAll()" color="accent">\n <mat-icon>aspect_ratio</mat-icon>&nbsp;&nbsp;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" }}\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:At},{type:i.ToastrService},{type:kt},{type:wt},{type:d.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}],abilita_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.type="NONE",this.toolbar_wkfapp=null,this.custom_commands=[],this.command=new n.EventEmitter}return 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.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.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_NO_EDIT\'"\n fxLayoutGap="3px"\n fxLayout="row"\n fxFlex="100"\n fxLayoutAlign="end center"\n style="background-color: #CC0000"\n >\n <mat-toolbar>\n <div fxLayout="row" fxLayoutGap="3px" fxLayoutAlign="end center">\n <button\n mat-flat-button\n color="warn"\n mat-button\n fxHide\n fxShow.gt-sm\n [matMenuTriggerFor]="gest_menu"\n *ngIf="\n toolbar_wkfapp?.is_Supervisor ||\n toolbar_wkfapp?.is_Admin ||\n toolbar_wkfapp?.is_PowerUser\n "\n >\n <mat-icon>label_important</mat-icon>&nbsp;&nbsp;&nbsp;{{\n "Gestione" | translate\n }}\n </button>\n <mat-menu #gest_menu="matMenu">\n <button\n mat-menu-item\n style="background-color: #F5F5F5"\n (click)="annulla_richiesta()"\n >\n {{ "ANNULLA DOCUMENTO" | translate }}\n </button>\n <button\n mat-menu-item\n style="background-color: #F5F5F5"\n (click)="recupera_richiesta()"\n >\n {{ "RECUPERA DOCUMENTO" | translate }}\n </button>\n <button\n mat-menu-item\n style="background-color: #F5F5F5"\n (click)="riassegna_richiesta()"\n *ngIf="toolbar_wkfapp?.is_Supervisor || toolbar_wkfapp?.is_Admin"\n >\n {{ "RIASSEGNA DOCUMENTO" | translate }}\n </button>\n <button\n mat-menu-item\n style="background-color: #F5F5F5"\n (click)="sostituisci_utente()"\n *ngIf="toolbar_wkfapp?.is_Admin"\n >\n {{ "SOSTITUISCI UTENTE" | translate }}\n </button>\n\n <button\n mat-menu-item\n style="background-color: #F5F5F5"\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 != \'\'"\n >\n {{ toolbar_wkfapp?.imp }}\n </button>\n <div *ngFor="let app of custom_commands">\n &nbsp;&nbsp;<button\n mat-flat-button [hidden]="app.hidden!=null && app.hidden"\n [color]="app.color"\n (click)="exec_command(app.command)"\n >\n <mat-icon *ngIf="app.icon != null">{{ app.icon }}</mat-icon\n >&nbsp;{{ app.label | translate }}\n </button>\n </div>\n </div>\n </mat-toolbar>\n </div>\n <div\n *ngIf="type == \'WKF\'"\n fxLayoutGap="3px"\n fxLayout="row"\n fxLayoutAlign="end center"\n style="width: 100%;background-color: maroon"\n >\n <mat-toolbar>\n <div fxLayout="row" fxLayoutGap="3px" fxLayoutAlign="end center">\n <button\n mat-flat-button\n (click)="insert_doc()"\n *ngIf="toolbar_wkfapp?.is_Ins"\n color="accent"\n >\n <mat-icon>note_add</mat-icon>&nbsp;&nbsp;&nbsp;{{\n "INSERISCI" | translate\n }}</button\n >&nbsp;&nbsp;&nbsp;\n\n <button\n mat-flat-button\n color="warn"\n mat-button\n fxHide\n fxShow.gt-sm\n [matMenuTriggerFor]="gest_menu"\n *ngIf="toolbar_wkfapp?.is_Supervisor"\n >\n {{ "Gestione" | translate }}\n </button>\n <mat-menu #gest_menu="matMenu">\n <button mat-menu-item (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 (click)="riassegna_richiesta()">\n {{ "RIASSEGNA DOCUMENTO" | translate }}\n </button>\n <button\n mat-menu-item\n (click)="sostituisci_utente()"\n *ngIf="toolbar_wkfapp?.is_Admin"\n >\n {{ "SOSTITUISCI UTENTE" | translate }}\n </button>\n\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 *ngFor="let app of custom_commands">\n &nbsp;&nbsp;<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 >&nbsp;{{ app.label | translate }}\n </button>\n </div>\n </div>\n </mat-toolbar>\n </div>\n <div\n *ngIf="type == \'INSERT_DELETE\' || type == \'INSERT\'"\n fxLayoutGap="3px"\n fxLayout="row"\n >\n <mat-toolbar>\n <div fxLayout="row" fxLayoutGap="5px" fxLayoutAlign="end center">\n <button mat-flat-button (click)="new_doc()" color="primary">\n <mat-icon>note_add</mat-icon>&nbsp;&nbsp;&nbsp;{{\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>&nbsp;&nbsp;&nbsp;{{\n "ELIMINA" | translate\n }}\n </button>\n <div *ngFor="let app of custom_commands" fxLayout="row" fxLayoutGap="5px">\n <div>\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 >&nbsp;&nbsp;&nbsp;{{ app.label | translate }}\n </button>\n </div>\n <FHCheckBox\n *ngIf="app.type == \'checkbox\'"\n (change)="selx(app.command, $event)"\n [label]="app.label | translate"\n ></FHCheckBox>\n\n <div *ngIf="app.type == \'spacer\'" style="width:60px"></div>\n </div>\n </div>\n </mat-toolbar>\n </div>\n <div\n *ngIf="type == \'CUSTOM\'"\n fxLayoutGap="3px"\n fxLayout="row"\n fxLayoutAlign="end center"\n >\n <div *ngFor="let app of custom_commands" fxLayoutAlign="end center" fxLayout="row" fxLayoutGap="5px">\n <div>\n <button [hidden]="app.hidden!=null && app.hidden"\n *ngIf="app.type == null || app.type == \'button\'"\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 >&nbsp;&nbsp;&nbsp;{{ app.label | translate }}\n </button>\n </div>\n <FHCheckBox\n *ngIf="app.type == \'checkbox\'"\n (change)="selx(app.command, $event)"\n [label]="app.label | translate"\n ></FHCheckBox>\n <div *ngIf="app.type == \'spacer\'" style="width:60px"></div>\n </div>\n </div>\n ',styles:[""]}]}],ci.propDecorators={type:[{type:n.Input}],toolbar_wkfapp:[{type:n.Input}],custom_commands:[{type:n.Input}],command:[{type:n.Output}]};var di=function(){function t(t){this.m_appService=t,this.dt_agg=null,this.edit_button=!1,this.respingi_button=!1,this.procedi_button=!0,this.utility_button=!0,this.force_save=!1,this.check_on_save=!1,this.admin_role="[ZZZ_DIS_CC]",this.sovra_path="",this.button_clicked=new n.EventEmitter}return 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()},t.prototype.ngAfterViewInit=function(){},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 Indietro</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 Salva</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</button\n ></div><div>\n <button\n mat-flat-button\n (click)="respingi()"\n *ngIf="respingi_button"\n color="warn"\n >\n Respingi\n </button>\n </div>\n \x3c!-- <button mat-flat-button (click)="doEnd(900)" color="warn" >test</button>&nbsp;&nbsp;\n--\x3e\n </div>\n &nbsp;&nbsp;&nbsp;&nbsp;\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>&nbsp;&nbsp;Info Doc</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</button\n ></div>\n </div>\n <div fxLayout="row" fxLayoutGap="16px">\n <div>\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</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\n </button>\n </div> </div>\n </div>\n </div>\n '}]}],di.ctorParameters=function(){return[{type:wt}]},di.propDecorators={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}],force_save:[{type:n.Input}],check_on_save:[{type:n.Input}],admin_role:[{type:n.Input}],sovra_path:[{type:n.Input}],button_clicked:[{type:n.Output}]};var hi=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(St,{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}();hi.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>&nbsp;&nbsp;&nbsp;<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>&nbsp;&nbsp;&nbsp;<span>Number</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(3)">\n <mat-icon>filter_none</mat-icon>&nbsp;&nbsp;&nbsp;<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>&nbsp;&nbsp;&nbsp;<span>Check Box</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(5)">\n <mat-icon>radio_button_checked</mat-icon>&nbsp;&nbsp;&nbsp;<span\n >Radio</span\n >\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(6)">\n <mat-icon>dehaze</mat-icon>&nbsp;&nbsp;&nbsp;<span>Select</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(7)">\n <mat-icon>today</mat-icon>&nbsp;&nbsp;&nbsp;<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 *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 <section\n class="custom-section"\n *ngIf="item.type == \'radiobutton\'"\n >\n <label class="custom-margin">{{ item.label }}:</label>\n <mat-radio-group\n [(ngModel)]="item.default_value"\n [required]="item.required"\n >\n <mat-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 </section>\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 >&nbsp;&nbsp;\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">\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:[""]}]}],hi.ctorParameters=function(){return[{type:At},{type:e.MatDialog},{type:z.DragulaService}]},hi.propDecorators={change:[{type:n.Output}],bottoml:[{type:n.ViewChild,args:["bottoml"]}]};var _i=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}();_i.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 <section *ngIf="item.type == \'radiobutton\'">\n <label *ngIf="!item.required">{{ item.label }}: </label>&nbsp;\n <label *ngIf="item.required">{{ item.label }}: *</label>&nbsp;\n <mat-radio-group\n [(ngModel)]="item.default_value"\n [required]="item.required"\n >\n <mat-radio-button\n *ngFor="let opt of item.opts"\n [disabled]="!enabled"\n class="custom-margin"\n value="{{ opt }}"\n ><b>{{ opt }}</b\n >&nbsp;&nbsp;&nbsp;&nbsp;</mat-radio-button\n >\n </mat-radio-group>\n </section>\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 >&nbsp;&nbsp;\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:[""]}]}],_i.ctorParameters=function(){return[{type:At},{type:e.MatDialog},{type:i.ToastrService}]},_i.propDecorators={items:[{type:n.Input}],enabled:[{type:n.Input}],bottoml:[{type:n.ViewChild,args:["bottoml"]}]};var mi=function(){function t(t){this.dialogRef=t,this.title="",this.button_config=[]}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 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>{{ title }}</h2>\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 >&nbsp;&nbsp;&nbsp;\n </div>\n </mat-dialog-content>\n <br /><br />\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="accent" (click)="close()">CHIUDI</button>\n </div>\n '}]}],mi.ctorParameters=function(){return[{type:e.MatDialogRef}]},mi.propDecorators={title:[{type:n.Input}],button_config:[{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</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{-webkit-animation:rotation 2s linear infinite;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)}}@-webkit-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:j.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:j.DomSanitizer}]};var Ii={provide:p.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Si})),multi:!0},Si=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.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});setTimeout((function(){e.componentInstance.single_sel=t.single_sel,e.componentInstance.sel_values=t.value,e.componentInstance.separator=t.separator,e.componentInstance.label=t.label,e.componentInstance.sql=t.sql,e.componentInstance.types=t.types,e.componentInstance.values=t.values,e.componentInstance.doFill()})),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}();Si.decorators=[{type:n.Component,args:[{providers:[Ii],selector:"FHFieldPickList",template:'\n <div\n fxLayout="row"\n fxFlex="100"\n fxLayoutAlign="start center"\n [hidden]="hidden" fxLayoutGap="10px"\n >\n <div fxFlex fxLayout="row">\n <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>{{ label }}</mat-label>\n <input\n type="text"\n #el1\n matInput\n [readonly]="!enabled || only_in_list"\n [(ngModel)]="value"\n />\n </mat-form-field>\n </div>\n\n <div fxLayout="row">\n <button\n mat-flat-button\n color="primary"\n (click)="open_pick_list()"\n [hidden]="!enabled"\n >\n SELEZIONA\n </button>\n </div>\n </div>\n ',styles:[""]}]}],Si.ctorParameters=function(){return[{type:e.MatDialog}]},Si.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 Ei=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.single_sel=!1,this.sel_values="",this.id_tipo=-1}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}();Ei.decorators=[{type:n.Component,args:[{selector:"win_manage_values",template:'\n <div fxLayout="column" style="height: 520px">\n <div fxLayout="row" style="width: 90%">\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" style="overflow-y: scroll;height:100%;">\n <div fxLayout="column" style="overflow-y: scroll;height:420px;">\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 </div>\n <div fxLayout="row" fxLayoutAlign="center center" style="width: 100%">\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 '}]}],Ei.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:wt},{type:kt}]};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(Ei,{width:"90%",height:"550px"});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 >\n &nbsp;<FHComboBox\n #cmb_sel\n sql="SELECT_TABLE_MANAGEMENT"\n label="Gestisci Tabella:"\n init_fill="false"\n ></FHComboBox\n >&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="edit_values()" color="primary">\n Modifica\n </button>\n </div>\n ',styles:[""]}]}],Oi.ctorParameters=function(){return[{type:kt},{type:wt},{type:e.MatDialog}]},Oi.propDecorators={application:[{type:n.Input}],cmb_sel:[{type:n.ViewChild,args:["cmb_sel"]}]};var xi=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}();xi.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&nbsp;per&nbsp;associare&nbsp;utente:</b\n >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\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 '}]}],xi.ctorParameters=function(){return[{type:e.MatDialogRef},{type:i.ToastrService},{type:wt},{type:kt}]},xi.propDecorators={autoc:[{type:n.ViewChild,args:["autoc"]}]};var Ci=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:"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}();Ci.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 &nbsp;&nbsp;&nbsp;&nbsp;<FHComboBox\n #cmb_sel\n sql="SELECT_APP_USER_MANAGEMENT"\n label="Gestisci Ruoli:"\n init_fill="false"\n ></FHComboBox\n >&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="edit_values()" color="primary">\n Modifica\n </button>\n </div>\n ',styles:[""]}]}],Ci.ctorParameters=function(){return[{type:kt},{type:wt},{type:e.MatDialog}]},Ci.propDecorators={application:[{type:n.Input}],cmb_sel:[{type:n.ViewChild,args:["cmb_sel"]}]};var Ai=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}();Ai.decorators=[{type:n.Component,args:[{selector:"FHFilterComboBox",template:'\n <mat-form-field [hidden]="!enabled || hidden">\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:[""]}]}],Ai.ctorParameters=function(){return[{type:kt},{type:Ht}]},Ai.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 Di=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){void 0===p&&(p=!0),void 0===u&&(u="");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}();Di.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 <mat-form-field appearance="outline" floatLabel="always"\n ><mat-label>Commento</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="12"></textarea>\n </mat-form-field>\n\n <div>\n <button mat-flat-button color="primary" (click)="ok()">OK</button\n >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="annulla()">ANNULLA</button\n >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <mat-checkbox [(ngModel)]="not_int" [hidden]="lettori === \'\'">\n Notifica Interessati\n </mat-checkbox>\n </div>\n </div>\n ',styles:[""]}]}],Di.ctorParameters=function(){return[{type:e.MatDialogRef},{type:e.MatDialog},{type:wt},{type:i.ToastrService},{type:kt},{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(){var t=this;setTimeout((function(){"1"==t.isadmin&&null!=t.appService.dev_mode&&"1"==t.appService.dev_mode&&(t.dev_mode=!0);var e=new vt;e.sql="SELECT_ALLEGATI_DOCUMENTO",e.types=["string","string"],e.values=["FOTO_UTENTI",t.appService.user],t._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&e.result_data.length>0&&(t.b_filef=!0,t.foto_ut=t.appService.COMPANY_SITE_ROOT+"/uploads/"+e.result_data[0].App+"/"+e.result_data[0].K+"/"+e.result_data[0].Filename)}))}))},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 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">Info Utente</h2>\n <mat-dialog-content style="font-size:12px">\n <table class="fh_table">\n <tbody>\n <tr class="odd">\n <td>Nome</td>\n <td>\n <b>{{ user_name }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>Cognome</td>\n <td>\n <b>{{ user_surname }}</b>\n </td>\n </tr>\n <tr class="odd">\n <td>Username</td>\n <td>\n <b>{{ user }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>Email</td>\n <td>\n <b>{{ user_email }}</b>\n </td>\n </tr>\n <tr class="odd">\n <td>Ruoli</td>\n <td>\n <b>{{ user_roles }}</b>\n </td>\n </tr>\n <tr class="even">\n <td>Lingua</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\n <div fxLayoutAlign="center center" fxLayout="row">\n <button mat-flat-button color="primary" (click)="dialogRef.close()">\n CHIUDI\n </button>\n </div>\n </mat-dialog-content>\n '}]}],Ti.ctorParameters=function(){return[{type:e.MatDialogRef},{type:wt},{type:kt}]};var ki=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}();ki.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:[""]}]}],ki.ctorParameters=function(){return[{type:kt},{type:i.ToastrService}]},ki.propDecorators={color:[{type:n.Input}],bk_color:[{type:n.Input}],hidden:[{type:n.Input}],key:[{type:n.Input}]};var Li={provide:p.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\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(){}return t.forRoot=function(){return{ngModule:t,providers:[wt,M.NgForage,kt,Yt,Tt,Ht,ei,oe,te,At,pi,pe]}},t.forChilds=function(){return{ngModule:t,providers:[]}},t}();Ni.decorators=[{type:n.NgModule,args:[{imports:[P.TranslateModule,F.CdkTableModule,mt.MatBadgeModule,U.MatAutocompleteModule,e.MatDialogModule,q.MatButtonModule,G.MatButtonToggleModule,V.MatCardModule,B.MatCheckboxModule,K.MatChipsModule,H.MatDatepickerModule,Y.MatExpansionModule,Q.MatFormFieldModule,X.MatGridListModule,W.MatIconModule,$.MatInputModule,Z.MatListModule,J.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,ht.MatSortModule,_t.MatTableModule,f.MatNativeDateModule,l.FileUploadModule,R.AgGridModule.withComponents([Qt]),g.CommonModule,z.DragulaModule,p.FormsModule,N.AgmCoreModule.forRoot({apiKey:"AIzaSyD3-g3b_QqxUruxBY4PGJKaH2fubIVXvN4"}),k.FlexLayoutModule,ft.QuillModule,L.MarkdownModule],exports:[jt,qt,Gt,Kt,Ri,Oe,ki,Ti,Di,Ci,Si,wi,gi,fi,mi,Xt,Wt,Zt,Jt,ie,ne,ue,de,St,_e,Ie,Qt,Se,xe,De,Ae,Te,se,ke,Le,Re,yt,Ne,ae,Mt,Fe,Pe,ze,bt,Ue,qe,Be,Ke,di,He,Nt,Qe,ui,Xe,hi,_i,Oi,zt,Rt,Ft,ee,Lt],declarations:[jt,qt,Gt,Kt,Ri,Oe,ki,Ti,Di,Ci,Si,wi,bi,Vt,gi,fi,mi,ci,Xt,Wt,Zt,Jt,ie,ne,di,ue,de,St,_e,Ie,Qt,Se,xe,De,Ae,Te,se,ke,Le,Re,yt,Ne,ae,Mt,Fe,Pe,ze,bt,Ue,qe,Be,Ke,He,Nt,Qe,Xe,We,$e,Ze,Je,Ut,ii,ni,oi,si,ai,ri,li,ti,ui,hi,_i,Oi,Ei,xi,Ai,zt,Rt,Ft,ee,Lt],providers:[Me,z.DragulaService],entryComponents:[jt,Vt,Ti,Di,xi,Ei,fi,mi,Xe,We,$e,Ze,Je,Ut,ii,ni,oi,si,ai,li,ri,ti,Mt,St,Xt,Se,xe,Te,se,ke,Le,yt,ae,Fe,bt,Be,He,Mt,Nt,ee,Lt]}]}];var Fi=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}();Fi.decorators=[{type:n.Injectable}],Fi.ctorParameters=function(){return[{type:a.HttpClient},{type:te},{type:c.Router},{type:i.ToastrService},{type:kt},{type:d.SlimLoadingBarService},{type:wt}]};var Mi=function(){this.result_data=new Array},Pi=function(){this.result_data=new Array},zi=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_fservice=n,this.m_router=o,this._toastr=s,this.dialog=a,this.m_wkf=r,this.m_uti=l,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.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(),"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(St,{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.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});setTimeout((function(){s.componentInstance.setStepCombo(i),s.componentInstance.title="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++)e[i].nc=e[i].nc.split(" ()").join(""),null!=e[i].idp&&null==e[i].username&&(e[i].username=e[i].idp);setTimeout((function(){n.componentInstance.arrAutori=e,n.componentInstance.title="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,e="";null!=this.get_grid().sRow.lettori&&(e=this.get_grid().sRow.lettori);var i="",n="",o="",s="";null!=this.get_grid().sRow.partecipanti&&(s=this.get_grid().sRow.partecipanti);for(var a="",r="XCXXX",l=0;l<this.wax.length;l++){if("XCXXX"!=r&&r!=this.wax[l].gruppo_parallelo)return void this._toastr.error("impossibile assegnare a utenti di gruppi distiniti");r=this.wax[l].gruppo_parallelo,""!=a&&(a+=","),a+=this.wax[l].idp,-1==e.indexOf(this.wax[l].idp)&&(""!=e&&(e+=","),e+=this.wax[l].idp),-1==n.indexOf(this.wax[l].nc)&&(""!=n&&(n+=","),n+=this.wax[l].nc),""!=o&&(o+=","),o+=this.wax[l].nc,null!=s&&-1==s.indexOf(this.wax[l].idp)&&(""!=s&&(s+=","),s+=this.wax[l].idp),""!=i&&(i+=","),i+=this.wax[l].idp}this.sendEMail_ex(this.user_idp,a,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 p=new vt;p.sql="INSERT_COMMENTO_RIASS",p.types=["string","string","string","string","string","int","int"],p.values=[this.id_applicativo,this.get_grid().sRow.uiid,"Documento riassegnato a "+o,this.user_idp,this.os_r.descri_livello,this.get_grid().sRow.stato,this.os_r.livello];this.m_dataService.doQuery(p).subscribe((function(t){null!=t&&t.result_msg}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}));var u="$$";this.wax.length>0&&null!=this.wax[0].gruppo_parallelo&&""!=this.wax[0].gruppo_parallelo&&(u=this.wax[0].gruppo_parallelo),console.log("riassegnazione canale: ",u),(p=new vt).sql="UPDATE_RIASS_DOCUMENTO",p.types=["string","string","string","string","string","string","string","string","string","string",u],p.values=[this.os_r.livello,this.os_r.descri_livello,e,i,this.os_r.descri_livello,n,s,this.get_grid().sRow.id_applicativo,this.get_grid().sRow.uiid],this.m_dataService.doQuery(p).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.get_grid().doFill("")}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})),(p=new vt).sql="INSERT_WKF_COMMENTO",p.types=["string","string","string","string","string"],p.values=[this.id_applicativo,this.get_grid().sRow.uiid,"Documento riassegnato, commento:\n"+this.nota_wax,this.user_idp,""],this.m_dataService.doQuery(p).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&&((p=new vt).sql="UPDATE_RIASSEGNA_TODO",p.types=["string","string"],p.values=[this.wax[0].idp,this.get_grid().sRow.uiid],!1,this.m_dataService.doQuery(p).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){void 0===p&&(p="");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(){this.app_s.user_name=this.app_s.user_name_ori,this.app_s.user=this.app_s.user_ori,this.app_s.user_surname=this.app_s.user_surname_ori,this.app_s.user_email=this.app_s.user_email_ori,this.user_idp=this.app_s.user,this.user_nome=this.app_s.user_name,this.user_cognome=this.app_s.user_surname,this.user_email=this.app_s.user_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="",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,t.get_grid().doFill(""),console.log(" this.user_idp ",t.user_idp))}))}}))}}))},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.app_s.getState().wkf_obj.title,this.m_uti.set_home_title(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){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}(),ji=function(){function t(t,e,i,n,o,s,a,r){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.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.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="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.init_user_i=function(){this.user_idp=this.app_s.user,this.user_nome=this.app_s.user_name,this.user_cognome=this.app_s.user_surname,this.user_email=this.app_s.user_email},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();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,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()&&0==this.livs[e].notifica&&this.m_obj.canale==this.livs[e].gruppo_parallelo){this.clevel=this.livs[e];break}if(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}}if(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(Je,{disableClose:!0}).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)}))},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);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}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;this.user_idp.toUpperCase();if(null!=this.nlevel){new Array;var e=new Array;if(""==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="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="Il documento verrà inviato a "+this.nlevel.descri_livello:this.app_s.getState().wkf_doc_info.lbl="La richiesta verrà chiusa con stato: "+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),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="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(We,{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),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;t?this.m_dialog.open(Xe,{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),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="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));if(this.nlevel.livello>=900){this.getLvlInfo(this.nlevel.livello);this.doEnd(this.nlevel.livello);var n=new vt;n.sql="UPDATE_DATA_CHIUSURA",n.values=[this.id_applicativo,this.id_documento],n.types=["string","string"],this.m_dataService.doQuery(n).subscribe((function(t){null!=t&&t.result_msg}))}var o,s="$$";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("$$"!=s){s="$$";break}s=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(",")),o=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,s):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,s);var a=new Array;for(i=0;i<o.length;i++)a.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 r=new vt;r.sql="doWKF",r.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(r).subscribe((function(t){null!=t&&t.result_msg})),(r=new vt).sql="UPDATE_WKF_DOCUMENTOV3_NS",r.values=o,r.types=a,this.m_dataService.doQuery(r).subscribe((function(t){null!=t&&t.result_msg})),(r=new vt).sql="exec_app_workflow",r.values=[this.app_info.codice_documento,this.id_documento,""+this.clevel.livello,""+this.nlevel.livello,this.user_idp];if(this.m_wkf.doQuery(r).subscribe((function(t){})),""!=this.m_danotificare){var l="";if(""!=this.nota&&(l="<br>Commento: <br>"+this.nota),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{var p=null;if(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):p={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"}),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()+"<br>Commenti:"+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,p);else if(null==this.nlevel.oggetto_email)this.sendEMail_ex(this.user_idp,this.m_danotificare,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),"<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,p);else if(""==this.nlevel.oggetto_email)this.sendEMail_ex(this.user_idp,this.m_danotificare,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),"<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,p);else{var u=this.nlevel.oggetto_email;for(var c in null!=this.nlevel&&null!=this.nlevel.descri_livello&&(u=u.split("%new_step%").join(this.nlevel.descri_livello)),null!=this.clevel&&null!=this.clevel.descri_livello&&(u=u.split("%old_step%").join(this.clevel.descri_livello)),u=(u=u.split("%new_step%").join("")).split("%old_step%").join(""),this.m_obj)null!=this.m_obj[c]&&(console.log(c+" "+Object.prototype.toString.call(this.m_obj[c])),u="[object Date]"===Object.prototype.toString.call(this.m_obj[c])?u.split("%"+c+"%").join(this.uti_s.date2String(this.m_obj[c])):-1==(""+this.m_obj[c]).indexOf("T00:00:00")?u.split("%"+c+"%").join(this.m_obj[c]):u.split("%"+c+"%").join(this.uti_s.date2String(this.uti_s.string2date(this.m_obj[c],2))));this.sendEMail_ex(this.user_idp,this.m_danotificare,u,"<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,p)}else this.goto_edit_doc();if(0!=this.nlevel.tipo_notifica_aggiuntiva){if(1==this.nlevel.tipo_notifica_aggiuntiva&&this.sendEMail_ex(this.user_idp,this.m_obj.creatore,this.app_info.descrizione_breve+", Il documento numero: "+this.m_obj.codice+" è passato allo STEP: "+this.nlevel.descri_livello+" "+this.getTitle(),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,p,!1),2==this.nlevel.tipo_notifica_aggiuntiva){var d=new vt;d.sql="SELECT_PARTECIPANTI_DOC",d.values=[this.id_applicativo,this.id_documento],d.types=["string","string"],this.m_dataService.doQuery(d).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);t.sendEMail_ex(t.user_idp,i,t.app_info.descrizione_breve+", Il documento numero: "+t.m_obj.codice+" è passato allo STEP: "+t.nlevel.descri_livello+" "+t.getTitle(),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,p,!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,t.app_info.descrizione_breve+", Il documento numero: "+t.m_obj.codice+" è passato allo STEP: "+t.nlevel.descri_livello+" "+t.getTitle(),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,p,!1)}}))}}}}else this.goto_edit_doc()},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,a,r,l,p,u,c){var d=this;void 0===p&&(p=!0),void 0===u&&(u=""),void 0===c&&(c=!0);var h=new vt;h.sql="send_wkf_mail",e=(e=e.split(t+",").join("")).split(","+t).join(""),null==u&&(u=""),""!=u&&(u=JSON.stringify(u)),h.values=[t,e,i,n.split("\n").join("<br>"),o,s,a,r,l,u],this.m_wkf.doQuery(h).subscribe((function(t){c&&d.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].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),this.resp_b(!1),this.salva()},t.prototype.procedi=function(){if(this.oper="procedi",this.btnprocedi=!0,this.edit_b(!1),this.resp_b(!1),!this.ck_field())return this.edit_b(!0),void(this.respingi_enabled&&this.resp_b(!0));this.salva()},t.prototype.open_wkf=function(t){var e=this;void 0===t&&(t=!1);var i=this.app_s.getState().body_h-40+"px",n=this.m_dialog.open(oi,{disableClose:!0,width:"95%",height:i});setTimeout((function(){n.componentInstance.subject=e.app_info.descrizione_breve+", <OP>: "+e.m_obj.codice+" "+e.getTitle(),null!=e.m_obj.lettori?n.componentInstance.lettori=e.m_obj.lettori:n.componentInstance.lettori="",n.componentInstance.link=e.app_s.COMPANY_SITE_ROOT+"#/"+e.app_info.modulo_swf+"/"+e.id_applicativo+"/"+e.id_documento+"/edit",n.componentInstance.codice_doc=e.m_obj.codice,n.componentInstance.notifica_commenti=e.app_info.notifica_commenti,n.componentInstance.notifica_commenti_obbl=e.app_info.notifica_commenti_obbl,n.componentInstance.commenti_insert=t,n.componentInstance.init_v()})),n.afterClosed().subscribe((function(t){e.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(Ut,{disableClose:!0,width:"90%",data:{admin_role:e}});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);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?(console.log("NULL",e[n].names,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.edit_b(this.b_edit_before),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),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){if(null!=t&&"OK"==t.result_msg){if(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].gruppo_parallelo=e.override_livs[i].gruppo_parallelo,t.result_data[n].nc=e.override_livs[i].nc);e.ok_livelli_doc(t.result_data)}}))},t.prototype.ok_livelli_doc=function(t){if(this.livs=t,this.over_canale_iniz(),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.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(Ze,{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,e=this.m_dialog.open(ni,{disableClose:!0});setTimeout((function(){e.componentInstance.hide_richiedente=t.hide_richiedente})),e.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,"Assegnata a:"+l,"","",this.getLvlDescri(String(t),"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,"Assegnata a:"+l,"","",this.getLvlDescri(String(t),"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];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))));""==e?n.sendEMail_ex(n.user_idp,a,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),"<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,""):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.app_info.descrizione_breve+" - Nuova Richiesta"),this.reset_form(this.app_info.descrizione_breve+" - Nuova Richiesta"),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);break}},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),this.respingi_enabled&&this.resp_b(!0)),this.r_count();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,this.uti_s.set_home_title(this.app_info.descrizione_breve+" "+this.m_obj.codice+" - "+this.m_obj.stat_stato),this.reset_form(this.app_info.descrizione_breve+" "+this.m_obj.codice+" - "+this.m_obj.stat_stato)},t.prototype.onResize=function(t){},t.prototype.init_engine=function(){var t=this;null!=this.user_idp?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_user_i(),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}();ji.propDecorators={onResize:[{type:n.HostListener,args:["window:resize",["event"]]}]},t.AppMakerService=Yt,t.AppService=wt,t.ApprovaGridComponent=xe,t.AuthenticationService=te,t.CheckboxEditorComponent=Kt,t.ComboBoxEditor=Le,t.CurrencyComponent=Jt,t.FHAutoCompleteComponent=_e,t.FHCheckBox=Ri,t.FHComboboxComponent=de,t.FHConfirmValues=It,t.FHCurrencyFieldComponent=Ue,t.FHCurrencyFormatterDirective=De,t.FHCurrencyPipe=Ae,t.FHDatePickerComponent=Ie,t.FHFieldPickListComponent=Si,t.FHFormToolBarComponent=qt,t.FHGridComponent=ue,t.FHGridJSONComponent=ui,t.FHGuard=Fi,t.FHListComponent=Re,t.FHLogPanelComponent=ze,t.FHMdReader=Pe,t.FHNumericFieldComponent=Ke,t.FHPickFieldComponent=zt,t.FHPickListComponent=Mt,t.FHRichText=qe,t.FHRoleManager=Ci,t.FHTableManager=Oi,t.FHTextArea=Gt,t.FHTextInput=Oe,t.FHTimePickerComponent=Zt,t.FHUploadComponent=ne,t.FHUploadPanelComponent=ie,t.FHUploadPanelS3Component=Rt,t.FHUploadS3Component=Ft,t.FHUserFieldComponent=Qe,t.FSInput=gt,t.FSResult=Pi,t.FileService=Tt,t.FluxhubLibModule=Ni,t.FormBuilderComponent=hi,t.FormExecuterComponent=_i,t.GridService=oe,t.LocalDBService=pi,t.NumericEditorComponent=Qt,t.OdbcService=Ht,t.OfficeAutomatorService=pe,t.QGParam=re,t.QGResult=Dt,t.QParam=vt,t.QResult=Mi,t.QueryService=kt,t.ReplaceLineBreaks=Ne,t.TextAreaEditor=ke,t.UtilityService=At,t.WkfService=ei,t.dati_aggiuntivi=ji,t.fh_win_ask_big_test=bt,t.fh_win_ask_buttons=mi,t.fh_win_ask_number=Fe,t.fh_win_ask_test=ae,t.fh_win_combo=yt,t.fh_win_confirm=St,t.fh_win_list=He,t.fh_win_mappa=Te,t.fh_win_output=Be,t.fh_win_show_email=ee,t.fh_win_show_email_s3=Lt,t.fh_win_show_image=fi,t.fh_win_show_log_dett=jt,t.fh_win_time_slider=Xt,t.fh_win_user_info=Ti,t.fh_win_user_picker=Se,t.fh_win_wait=Nt,t.fhimagepreview=gi,t.win_insert_commento=Di,t.win_salva_annulla=Xe,t.win_uploads=Ut,t.wkf_header_bar=di,t.wkfapp=zi,t.ɵa=Pt,t.ɵb=Bt,t.ɵba=Ze,t.ɵbb=Je,t.ɵbc=ii,t.ɵbd=ni,t.ɵbe=oi,t.ɵbf=si,t.ɵbg=ai,t.ɵbh=ri,t.ɵbi=li,t.ɵbj=ti,t.ɵbk=Ei,t.ɵbl=xi,t.ɵbm=Ai,t.ɵc=Ii,t.ɵd=he,t.ɵe=ce,t.ɵf=je,t.ɵg=be,t.ɵh=Ge,t.ɵi=Ve,t.ɵj=$t,t.ɵk=Ye,t.ɵl=Ee,t.ɵm=Li,t.ɵn=ki,t.ɵo=wi,t.ɵp=Wt,t.ɵq=fe,t.ɵr=ye,t.ɵs=se,t.ɵt=Me,t.ɵu=bi,t.ɵw=Vt,t.ɵx=ci,t.ɵy=We,t.ɵz=$e,Object.defineProperty(t,"__esModule",{value:!0})}));
17
17
  //# sourceMappingURL=fluxhub-fluxhub-lib.umd.min.js.map