1"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[618],{6565:(T,y,s)=>{s.d(y,{F:()=>H});var v=s(65938),P=s(47423),p=s(15861),c=(()=>{return(u=c||(c={})).Prompt="PROMPT",u.Camera="CAMERA",u.Photos="PHOTOS",c;var u})(),d=(()=>{return(u=d||(d={})).Rear="REAR",u.Front="FRONT",d;var u})(),h=(()=>{return(u=h||(h={})).Uri="uri",u.Base64="base64",u.DataUrl="dataUrl",h;var u})();class f extends P.Uw{getPhoto(a){var o=this;return(0,p.Z)(function*(){return new Promise(function(){var n=(0,p.Z)(function*(t,i){if(a.webUseInput||a.source===c.Photos)o.fileInputExperience(a,t,i);else if(a.source===c.Prompt){let r=document.querySelector("pwa-action-sheet");r||(r=document.createElement("pwa-action-sheet"),document.body.appendChild(r)),r.header=a.promptLabelHeader||"Photo",r.cancelable=!1,r.options=[{title:a.promptLabelPhoto||"From Photos"},{title:a.promptLabelPicture||"Take Picture"}],r.addEventListener("onSelection",function(){var l=(0,p.Z)(function*(m){0===m.detail?o.fileInputExperience(a,t,i):o.cameraExperience(a,t,i)});return function(m){return l.apply(this,arguments)}}())}else o.cameraExperience(a,t,i)});return function(t,i){return n.apply(this,arguments)}}())})()}pickImages(a){var o=this;return(0,p.Z)(function*(){return new Promise(function(){var n=(0,p.Z)(function*(t,i){o.multipleFileInputExperience(t,i)});return function(t,i){return n.apply(this,arguments)}}())})()}cameraExperience(a,o,n){var t=this;return(0,p.Z)(function*(){if(customElements.get("pwa-camera-modal")){const i=document.createElement("pwa-camera-modal");i.facingMode=a.direction===d.Front?"user":"environment",document.body.appendChild(i);try{yield i.componentOnReady(),i.addEventListener("onPhoto",function(){var r=(0,p.Z)(function*(l){const m=l.detail;null===m?n(new P.xz("User cancelled photos app")):m instanceof Error?n(m):o(yield t._getCameraPhoto(m,a)),i.dismiss(),document.body.removeChild(i)});return function(l){return r.apply(this,arguments)}}()),i.present()}catch{t.fileInputExperience(a,o,n)}}else console.error("Unable to load PWA Element 'pwa-camera-modal'. See the docs: https://capacitorjs.com/docs/web/pwa-elements."),t.fileInputExperience(a,o,n)})()}fileInputExperience(a,o,n){let t=document.querySelector("#_capacitor-camera-input");const i=()=>{var r;null===(r=t.parentNode)||void 0===r||r.removeChild(t)};t||(t=document.createElement("input"),t.id="_capacitor-camera-input",t.type="file",t.hidden=!0,document.body.appendChild(t),t.addEventListener("change",r=>{const l=t.files[0];let m="jpeg";if("image/png"===l.type?m="png":"image/gif"===l.type&&(m="gif"),"dataUrl"===a.resultType||"base64"===a.resultType){const _=new FileReader;_.addEventListener("load",()=>{if("dataUrl"===a.resultType)o({dataUrl:_.result,format:m});else if("base64"===a.resultType){const N=_.result.split(",")[1];o({base64String:N,format:m})}i()}),_.readAsDataURL(l)}else o({webPath:URL.createObjectURL(l),format:m}),i()}),t.addEventListener("cancel",r=>{n(new P.xz("User cancelled photos app")),i()})),t.accept="image/*",t.capture=!0,a.source===c.Photos||a.source===c.Prompt?t.removeAttribute("capture"):a.direction===d.Front?t.capture="user":a.direction===d.Rear&&(t.capture="environment"),t.click()}multipleFileInputExperience(a,o){let n=document.querySelector("#_capacitor-camera-input-multiple");const t=()=>{var i;null===(i=n.parentNode)||void 0===i||i.removeChild(n)};n||(n=document.createElement("input"),n.id="_capacitor-camera-input-multiple",n.type="file",n.hidden=!0,n.multiple=!0,document.body.appendChild(n),n.addEventListener("change",i=>{const r=[];for(let l=0;l<n.files.length;l++){const m=n.files[l];let _="jpeg";"image/png"===m.type?_="png":"image/gif"===m.type&&(_="gif"),r.push({webPath:URL.createObjectURL(m),format:_})}a({photos:r}),t()}),n.addEventListener("cancel",i=>{o(new P.xz("User cancelled photos app")),t()})),n.accept="image/*",n.click()}_getCameraPhoto(a,o){return new Promise((n,t)=>{const i=new FileReader,r=a.type.split("/")[1];"uri"===o.resultType?n({webPath:URL.createObjectURL(a),format:r,saved:!1}):(i.readAsDataURL(a),i.onloadend=()=>{const l=i.result;n("dataUrl"===o.resultType?{dataUrl:l,format:r,saved:!1}:{base64String:l.split(",")[1],format:r,saved:!1})},i.onerror=l=>{t(l)})})}checkPermissions(){var a=this;return(0,p.Z)(function*(){if(typeof navigator>"u"||!navigator.permissions)throw a.unavailable("Permissions API not available in this browser");try{return{camera:(yield window.navigator.permissions.query({name:"camera"})).state,photos:"granted"}}catch{throw a.unavailable("Camera permissions are not available in this browser")}})()}requestPermissions(){var a=this;return(0,p.Z)(function*(){throw a.unimplemented("Not implemented on web.")})()}pickLimitedLibraryPhotos(){var a=this;return(0,p.Z)(function*(){throw a.unavailable("Not implemented on web.")})()}getLimitedLibraryPhotos(){var a=this;return(0,p.Z)(function*(){throw a.unavailable("Not implemented on web.")})()}}
1new f;const b=(0,P.fo)("Camera",{web:()=>new f});var C=s(5254),g=s(21086),U=s(87545),e=s(94650),x=s(99571),w=s(80529),A=s(36895),M=s(96338),I=s(44850),Z=s(4859),O=s(97392);const L=["galleryInput"],D=["cameraInput"],R=["container"];function F(u,a){if(1&u){const o=e.EpF();e.TgZ(0,"mat-list-item",11),e.NdJ("click",function(){e.CHM(o);const t=e.oxw(2);return e.KtG(t.openCamera())}),e.TgZ(1,"button",12)(2,"mat-icon"),e._uU(3,"add_a_photo"),e.qZA()(),e.TgZ(4,"h4",13),e._uU(5,"Camera"),e.qZA()()}}function B(u,a){if(1&u){const o=e.EpF();e.ynx(0),e.TgZ(1,"h1",8),e._uU(2,"Cosa vuoi usare?"),e.qZA(),e.TgZ(3,"div",9)(4,"mat-list"),e.YNc(5,F,6,0,"mat-list-item",10),e._UZ(6,"mat-divider"),e.TgZ(7,"mat-list-item",11),e.NdJ("click",function(){e.CHM(o);const t=e.oxw();return e.KtG(t.openGallery())}),e.TgZ(8,"button",12)(9,"mat-icon"),e._uU(10,"photo_library"),e.qZA()(),e.TgZ(11,"h4",13),e._uU(12,"Galleria"),e.qZA()()()(),e.BQk()}if(2&u){const o=e.oxw();e.xp6(5),e.Q6J("ngIf",o.showCamera)}}function G(u,a){if(1&u){const o=e.EpF();e.TgZ(0,"div",14)(1,"mat-icon",15),e._uU(2,"cloud_upload"),e.qZA(),e.TgZ(3,"h2",15),e._uU(4," Trascina qui il file da caricare "),e.qZA(),e.TgZ(5,"h2",15),e._uU(6,"oppure"),e.qZA(),e.TgZ(7,"button",16),e.NdJ("click",function(){e.CHM(o);const t=e.oxw();return e.KtG(t.openGallery())}),e._uU(8," Cerca un file "),e.qZA()()}if(2&u){const o=e.oxw();e.Udp("opacity",o.opacity)}}let H=(()=>{const a=class{constructor(n,t,i,r){this.mobileService=n,this.httpClient=t,this.dialogRef=i,this.data=r,this.isMobile=!1,this.showChoices=!1,this.isApp=!1,this.showCamera=!1,this.opacity=1,this.isMobile=/Android|iPhone/i.test(window.navigator.userAgent)}onDragOver(n){n.preventDefault(),n.stopPropagation(),this.opacity=.5}onDragLeave(n){n.preventDefault(),n.stopPropagation(),this.opacity=1}onDrag(n){n.preventDefault(),n.stopPropagation(),this.opacity=1,this.uploadFile(n.dataTransfer.files)}ngOnInit(){this.isApp=this.mobileService.isApp(),this.isMobile&&!this.isApp?(this.showChoices=!0,this.showCamera=!1,this.openGallery()):this.isApp?(this.showChoices=!0,this.showCamera=!0):this.showChoices=!1}openGallery(){this.isApp?this.getCamera(c.Photos).subscribe():this.galleryInput.nativeElement.click()}openCamera(){this.isApp?this.getCamera(c.Camera).subscribe():this.cameraInput.nativeElement.click()}getCamera(n){return(0,C.D)(b.getPhoto({resultType:h.DataUrl,source:n,quality:100})).pipe((0,U.w)(t=>(this.dialogRef.close(t.dataUrl),(0,g.of)(!0))))}uploadFile(n){let t=n||this.galleryInput.nativeElement.files||this.cameraInput.nativeElement.files;t.length>0?this.dialogRef.close(t[0]):this.dialogRef.close()}};let u=a;return a.\u0275fac=function(t){return new(t||a)(e.Y36(x.W),e.Y36(w.eN),e.Y36(v.so),e.Y36(v.WI))},a.\u0275cmp=e.Xpm({type:a,selectors:[["ar-photo-modal"]],viewQuery:function(t,i){if(1&t&&(e.Gf(L,7),e.Gf(D,7),e.Gf(R,7)),2&t){let r;e.iGM(r=e.CRH())&&(i.galleryInput=r.first),e.iGM(r=e.CRH())&&(i.cameraInput=r.first),e.iGM(r=e.CRH())&&(i.container=r.first)}},hostBindings:function(t,i){1&t&&e.NdJ("dragover",function(l){return i.onDragOver(l)})("dragleave",function(l){return i.onDragLeave(l)})("drop",function(l){return i.onDrag(l)})},decls:9,vars:2,consts:[[1,"container"],["container",""],[4,"ngIf","ngIfElse"],["dragAndDrop",""],["hidden","","type","file","id","gallery_file","accept",".jpg, .png, .jpeg, .pdf",3,"change"],["galleryInput",""],["hidden","","type","file","id","camera_file","accept",".jpg, .png, .jpeg, .pdf","capture","",3,"change"],["cameraInput",""],["mat-dialog-title",""],["mat-dialog-content",""],["style","cursor:pointer",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],[1,"image-btn"],["mat-line",""],["fxLayout","column",1,"drag-area"],["fxFlex",""],["fxFlex","","mat-flat-button","",1,"ar-button",3,"click"]],template:function(t,i){if(1&t&&(e.TgZ(0,"div",0,1),e.YNc(2,B,13,1,"ng-container",2),e.YNc(3,G,9,2,"ng-template",null,3,e.W1O),e.TgZ(5,"input",4,5),e.NdJ("change",function(){return i.uploadFile(null)}),e.qZA(),e.TgZ(7,"input",6,7),e.NdJ("change",function(){return i.uploadFile(null)}),e.qZA()()),2&t){const r=e.MAs(4);e.xp6(2),e.Q6J("ngIf",i.showChoices)("ngIfElse",r)}},dependencies:[A.O5,v.uh,v.xY,M.i$,M.Tg,I.d,Z.lW,O.Hw],styles:[".image-btn[_ngcontent-%COMP%]{border-radius:38px;height:42px;width:50px;box-shadow:none;border:0px;color:#fff;background-color:#0e7dc1;cursor:pointer}.drag-area[_ngcontent-%COMP%]{text-align:center}.drag-area[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#0c
17abf;transform:scale(1.5)}.ar-button[_ngcontent-%COMP%]{padding:0 16px;border-radius:4px;line-height:36px;cursor:pointer}"]}),u})()},64694:(T,y,s)=>{s.d(y,{S:()=>b});var v=s(53358),P=s(4859),p=s(65938),c=s(44850),d=s(97392),h=s(96338),f=s(98674),E=s(94650);let b=(()=>{const g=class{};let C=g;return g.\u0275fac=function(x){return new(x||g)},g.\u0275mod=E.oAB({type:g}),g.\u0275inj=E.cJS({imports:[v.m,p.Is,h.ie,c.t,P.ot,d.Ps,f.z]}),C})()},77949:(T,y,s)=>{s.d(y,{b:()=>v});class v{static groupBy(p,c){return p.reduce((d,h)=>((d[h[c]]=d[h[c]]||[]).push(h),d),{})}static sortByProp(p,c,d=((h,f)=>0)){return p.sort(function(h,f){return h[c]<f[c]?-1:h[c]>f[c]?1:d(h,f)})}static isValidImageExtension(p){if(!p)return!1;const c=p.split(".");let d;return c.length>1&&(d=c[c.length-1],["PDF","JPG","PNG","JPEG"].some(f=>f===d.toUpperCase()))}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.