1"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[4592],{4592:($,P,r)=>{r.r(P),r.d(P,{FirstPostsPageModule:()=>S});var m=r(2200),C=r(9417),f=r(7343),b=r(3123),v=r(8132),g=r(467),M=r(6967),u=r(1906),O=r(6912),t=r(3664),d=r(2615),y=r(5035),F=r(1608);const x=s=>({count:s}),_=(s,i)=>({current:s,min:i}),R=s=>({index:s});function U(s,i){if(1&s&&t.nrm(0,"img",14),2&s){const p=t.XpG().$implicit;t.Y8G("src",p.previewUrl,t.B4B)}}function k(s,i){1&s&&(t.j41(0,"div",15),t.nrm(1,"ion-icon",16),t.j41(2,"span"),t.EFF(3),t.nI1(4,"transloco"),t.k0s()()),2&s&&(t.R7$(3),t.JRh(t.bMT(4,1,"onboarding.firstPosts.addPhoto")))}function j(s,i){if(1&s){const p=t.RV6();t.j41(0,"button",17),t.nI1(1,"transloco"),t.bIt("click",function(e){d.eBV(p);const n=t.XpG().index,l=t.XpG();return d.Njj(l.clearSlot(n,e))}),t.nrm(2,"ion-icon",18),t.k0s()}2&s&&t.BMQ("aria-label",t.bMT(1,1,"onboarding.firstPosts.removePhoto"))}function I(s,i){if(1&s){const p=t.RV6();t.j41(0,"button",10),t.nI1(1,"transloco"),t.bIt("click",function(){const e=d.eBV(p).index,n=t.XpG();return d.Njj(n.openSlot(e))}),t.DNE(2,U,1,1,"img",11)(3,k,5,3,"div",12)(4,j,3,3,"button",13),t.k0s()}if(2&s){const p=i.$implicit;t.BMQ("aria-label",t.i5U(1,4,"onboarding.firstPosts.slotAria",t.eq3(7,R,i.index+1))),t.R7$(2),t.Y8G("ngIf",p.previewUrl),t.R7$(),t.Y8G("ngIf",!p.previewUrl),t.R7$(),t.Y8G("ngIf",p.previewUrl)}}const T=[{path:"",component:(()=>{var s;class i{constructor(o,e,n,l,a,c,h){this.navController=o,this.loadingController=e,this.toastController=n,this.supabaseService=l,this.onboardingService=a,this.transloco=c,this.platform=h,this.minPosts=u.TR,this.slots=Array.from({length:u.TR},()=>({file:null,previewUrl:null})),this.isPublishing=!1,this.activeSlotIndex=0}get filledCount(){return this.slots.filter(o=>!!o.file).length}get canPublish(){return this.filledCount>=this.minPosts&&!this.isPublishing}ngOnInit(){var o=this;return(0,g.A)(function*(){o.backButtonSub=o.platform.backButton.subscribeWithPriority(20,()=>{o.presentBlockedToast()}),o.onboardingService.invalidateCompletenessCache();const e=yield o.onboardingService.fetchCompleteness(!0);e.isComplete?yield o.navController.navigateRoot("/tabs",{animated:!1}):!e.hasPhoto||!e.hasLocation||e.meetingPointsCount<u.$y?yield o.navController.navigateRoot("/onboarding/profile-setup",{animated:!1}):(o.minPosts=Math.max(0,u.TR-e.postsCount),o.slots=Array.from({length:o.minPosts},()=>({file:null,previewUrl:null})))})()}ngOnDestroy(){this.backButtonSub?.unsubscribe();for(const o of this.slots)o.previewUrl&&URL.revokeObjectURL(o.previewUrl)}openSlot(o){if(this.isPublishing)return;this.activeSlotIndex=o;const e=document.createElement("input");e.type="file",e.accept="image/*",e.multiple=!0,e.style.display="none",document.body.appendChild(e),e.onchange=()=>{const n=e.files?Array.from(e.files).filter(l=>l.type.startsWith("image/")):[];document.body.removeChild(e),0!==n.length&&this.fillSlotsFromFiles(n,o)},e.oncancel=()=>{document.body.removeChild(e)},e.click()}clearSlot(o,e){if(e.stopPropagation(),this.isPublishing)return;const n=this.slots[o];n.previewUrl&&URL.revokeObjectURL(n.previewUrl),n.file=null,n.previewUrl=null}fillSlotsFromFiles(o,e){let n=0;const l=[e,...this.slots.map((a,c)=>c).filter(a=>a!==e)];for(const a of l){if(n>=o.length)break;const c=this.slots[a];if(c.file&&a!==e)continue;c.previewUrl&&URL.revokeObjectURL(c.previewUrl);const h=o[n++];c.file=h,c.previewUrl=URL.createObjectURL(h)}}publish(){var o=this;return(0,g.A)(function*(){if(!o.canPublish)return void(yield o.presentToast(o.transloco.translate("onboarding.firstPosts.errors.needAll",{count:o.minPosts}),"warning"));o.isPublishing=!0;const e=yield o.loadingController.create({message:o.transloco.translate("onboarding.firstPosts.publishing"),cssClass:"custom-loading"});yield e.present();try{const n=o.slots.map(a=>a.file).filter(Boolean);for(const a of n){const c=yield o.compressImage(a);yield o.supabaseService.createPost("",null,[{file:c,type:"image"}],[])}o.onboardingService.invalidateCompletenessCache();const{error:l}=yield o.onboardingService.markAppOnboardingCompleted();if(l)return void(yield o.presentToast((0,O.O)(l,"No se pudo completar el registro. Int\xe9ntalo de nuevo."),"danger"));yield o.presentToast(o.transloco.translate("onboarding.firstPosts.completed"),"success"),yield o.navController.navigateRoot("/tabs",{animated:!0})}catch(n){console.error("Error publicando primeros posts:",n),yield o.presentToast(o.transloco.translate("onboarding.firstPosts.errors.publishFailed"),"danger")}finally{o.isPublishing=!1,yield e.dismiss()}})()}
1compressImage(o){return(0,g.A)(function*(){try{const e=yield(0,M.default)(o,{maxSizeMB:3,maxWidthOrHeight:2048,useWebWorker:!0,initialQuality:.85});return new File([e],o.name||`onboarding_${Date.now()}.jpg`,{type:e.type||"image/jpeg"})}catch{return o}})()}presentBlockedToast(){var o=this;return(0,g.A)(function*(){yield o.presentToast(o.transloco.translate("onboarding.firstPosts.errors.needAll",{count:o.minPosts}),"warning")})()}presentToast(o,e){var n=this;return(0,g.A)(function*(){yield(yield n.toastController.create({message:o,color:e,duration:3e3,position:"bottom"})).present()})()}static#t=s=()=>(this.\u0275fac=function(e){return new(e||i)(t.rXU(y.q9),t.rXU(f.Xi),t.rXU(f.K_),t.rXU(F.w),t.rXU(u.x$),t.rXU(b.JO),t.rXU(y.OD))},this.\u0275cmp=t.VBU({type:i,selectors:[["app-first-posts"]],standalone:!1,decls:21,vars:25,consts:[[1,"first-posts-content",3,"fullscreen"],[1,"first-posts-shell"],[1,"first-posts-header"],[1,"subtitle"],[1,"progress"],["role","list",1,"slots-grid"],["type","button","class","slot","role","listitem",3,"click",4,"ngFor","ngForOf"],[1,"hint"],[1,"first-posts-actions"],["type","button",1,"publish-btn",3,"click","disabled"],["type","button","role","listitem",1,"slot",3,"click"],["alt","","class","slot-preview",3,"src",4,"ngIf"],["class","slot-empty",4,"ngIf"],["type","button","class","slot-clear",3,"click",4,"ngIf"],["alt","",1,"slot-preview",3,"src"],[1,"slot-empty"],["name","add"],["type","button",1,"slot-clear",3,"click"],["name","close"]],template:function(e,n){1&e&&(t.j41(0,"ion-content",0)(1,"main",1)(2,"header",2)(3,"h1"),t.EFF(4),t.nI1(5,"transloco"),t.k0s(),t.j41(6,"p",3),t.EFF(7),t.nI1(8,"transloco"),t.k0s(),t.j41(9,"p",4),t.EFF(10),t.nI1(11,"transloco"),t.k0s()(),t.j41(12,"div",5),t.DNE(13,I,5,9,"button",6),t.k0s(),t.j41(14,"p",7),t.EFF(15),t.nI1(16,"transloco"),t.k0s(),t.j41(17,"footer",8)(18,"button",9),t.bIt("click",function(){return n.publish()}),t.EFF(19),t.nI1(20,"transloco"),t.k0s()()()()),2&e&&(t.Y8G("fullscreen",!0),t.R7$(4),t.JRh(t.bMT(5,8,"onboarding.firstPosts.title")),t.R7$(3),t.JRh(t.i5U(8,10,"onboarding.firstPosts.subtitle",t.eq3(20,x,n.minPosts))),t.R7$(3),t.JRh(t.i5U(11,13,"onboarding.firstPosts.progress",t.l_i(22,_,n.filledCount,n.minPosts))),t.R7$(3),t.Y8G("ngForOf",n.slots),t.R7$(2),t.JRh(t.bMT(16,16,"onboarding.firstPosts.hint")),t.R7$(3),t.Y8G("disabled",!n.canPublish),t.R7$(),t.SpI(" ",t.bMT(20,18,"onboarding.firstPosts.publish")," "))},dependencies:[m.Sq,m.bT,f.W9,f.iq,b.Kj],styles:["[_nghost-%COMP%]{display:block;height:100%;background:#f0f1f5}.first-posts-content[_ngcontent-%COMP%]{--background: #f0f1f5}.first-posts-shell[_ngcontent-%COMP%]{min-height:100%;box-sizing:border-box;padding:calc(24px + var(--ion-safe-area-top, 0)) 24px calc(24px + var(--ion-safe-area-bottom, 0));display:flex;flex-direction:column;gap:24px}.first-posts-header[_ngcontent-%COMP%]{text-align:center}.first-posts-header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0 0 8px;font-size:1.45rem;font-weight:700;color:#000}.first-posts-header[_ngcontent-%COMP%] .subtitle[_ngcontent-%COMP%]{margin:0;font-size:.95rem;color:#4a4a4a;line-height:1.4}.first-posts-header[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]{margin:12px 0 0;font-size:.85rem;font-weight:600;color:#f800df}.slots-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.slot[_ngcontent-%COMP%]{position:relative;aspect-ratio:3/4;border:2px dashed #c8ccd4;border-radius:16px;background:#fff;padding:0;overflow:hidden;cursor:pointer}.slot[_ngcontent-%COMP%]:active{opacity:.9}.slot-preview[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover;display:block}.slot-empty[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;color:#8a8f99}.slot-empty[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%]{font-size:1.75rem}.slot-empty[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.7rem;font-weight:600}.slot-clear[_ngcontent-%COMP%]{position:absolute;top:6px;right:6px;width:28px;height:28px;border:none;border-radius:50%;background:#0000008c;color:#fff;display:flex;align-items:center;justify-content:center;padding:0}.slot-clear[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%]{font-size:16px}.hint[_ngcontent-%COMP%]{margin:0;text-align:center;font-size:.8rem;color:#6b7280;line-height:1.4}.first-posts-actions[_ngcontent-%COMP%]{margin-top:auto;padding-top:8px}.publish-btn[_ngcontent-%COMP%]{width:100%;border:none;border-radius:14px;padding:16px;font-size:1rem;font-weight:700;background:#f800df;color:#fff;cursor:pointer}.publish-btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:default}.publish-btn[_ngcontent-%COMP%]:not(:disabled):active{opacity:.9}"]}))}return s(),i})()}];let w=(()=>{var s;
1class i{static#t=s=()=>(this.\u0275fac=function(e){return new(e||i)},this.\u0275mod=t.$C({type:i}),this.\u0275inj=d.G2t({imports:[v.iI.forChild(T),v.iI]}))}return s(),i})(),S=(()=>{var s;class i{static#t=s=()=>(this.\u0275fac=function(e){return new(e||i)},this.\u0275mod=t.$C({type:i}),this.\u0275inj=d.G2t({imports:[m.MD,C.YN,f.bv,b.Q8,w]}))}return s(),i})()}}]);
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.