PageSourceSearch

https://www.rededorsaoluiz.com.br/chunk-X26QOURQ.js

js rededorsaoluiz.com.br collected 2026-09-24 09:31:12 UTC 4,494 bytes, 1 lines download raw bytes

1import{a as A}from"./chunk-BWR5DE7I.js";import{u as p}from"./chunk-AHT52CI5.js";import{b as w}from"./chunk-SQBEQ7PF.js";import{b as u}from"./chunk-UKM23MQP.js";import{K as h,N as s,Ob as S,b as f,d as a,dc as c,ec as m,fc as b,h as d,ha as l,hc as k,j as x}from"./chunk-RYQV473N.js";var C=(()=>{class o{constructor(t,e,i){this.http=t,this.log=e,this.platformId=i,this.mapboxAccessToken=u.mapboxAccessToken,this.mapboxSSRAccessToken=u.mapboxSSRAccessToken,this.mapboxApiUrl="https://api.mapbox.com",this.geocodingEp="search/geocode/v6",this.headers=new b}forwardGeocoding(t,e={},i){if(this.logMapbox("forwardGeocoding",i),t.length>=256)return d(()=>"Query length exceeds 255 characters.");let r=`${this.mapboxApiUrl}/${this.geocodingEp}/forward?q=${t}`;return e.access_token=c(this.platformId)?this.mapboxAccessToken:this.mapboxSSRAccessToken,this.http.get(r,{params:e,headers:this.getHeaders()})}reverseGeocoding(t,e,i={},r){this.logMapbox("reverseGeocoding",r);let n=`${this.mapboxApiUrl}/${this.geocodingEp}/reverse?longitude=${t}&latitude=${e}`;return i.access_token=c(this.platformId)?this.mapboxAccessToken:this.mapboxSSRAccessToken,this.http.get(n,{params:i})}logMapbox(t,e="no-context"){let i=m(this.platformId)?"server":"browser";this.log.logMsg(`${i} - ${t} - ${e}`,"MAPBOX")}getHeaders(){return this.headers=this.headers.set("Referrer-Policy","origin"),this.headers}static{this.\u0275fac=function(e){return new(e||o)(s(k),s(p),s(l))}}static{this.\u0275prov=h({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();var g=function(o){return o.GRANTED="granted",o.PROMPT="prompt",o.DENIED="denied",o}(g||{}),L=(()=>{class o{constructor(t,e,i,r){this.document=t,this.platformId=e,this.mapboxService=i,this.log=r,this.mapboxGeocodingParams={types:"place",limit:1,language:"pt-BR",country:"BR"},this.hasConsent=new a(!1),this.switchStatus=new a(!1),this.geolocation=new a(null),this.address=new a(null),this.isChecked=new a(!1),c(this.platformId)?(this.isSafariAgent=A(),this.isSafariAgent?this.initSafariGeolocation():navigator?.permissions?.query({name:"geolocation"}).then(n=>{this.permission=n.state,this.initGeolocation(),n.onchange=()=>{this.setPermission(n.state)}}).catch(n=>{this.log.logMsg(JSON.stringify(n,w()),"ERROR"),this.setPermission(g.DENIED)})):this.isChecked.next(!0)}setPermission(t){this.permission=t,this.initGeolocation()}initGeolocation(){this.permission===g.GRANTED?this.getCurrentPosition().subscribe({next:t=>{this.setGeolocation(t),this.switchStatus.next(!0)},error:()=>{this.switchStatus.next(!1),this.isChecked.next(!0)}}):(this.switchStatus.next(!1),this.isChecked.next(!0))}initSafariGeolocation(){this.checkACookieExists("geolocation_consent")?this.getCurrentPosition().subscribe({next:e=>{this.setGeolocation(e),this.permission=g.GRANTED,this.switchStatus.next(!0)},error:()=>{this.switchStatus.next(!1),this.isChecked.next(!0)}}):this.isChecked.next(!0)}setGeolocation(t){t?(this.geolocation.next({lat:t.coords.latitude,lng:t.coords.longitude}),this.getMapboxAdress().pipe(x(e=>{let i=e?.features[0]?.properties?.name,r={name:e?.features[0]?.properties?.name,shortCode:e?.features[0]?.properties?.context?.region?.region_code_full?.slice(3)};return{city:i,state:r}})).subscribe(e=>{this.address.next(e),this.isChecked.next(!0)})):(this.geolocation.next(null),this.isChecked.next(!0))}getCurrentPosition(){return new f(t=>{navigator.geolocation.getCurrentPosition(e=>{t.next(e),t.complete()},e=>t.error(e),{enableHighAccuracy:!0})})}setConsentCookie(t,e){if(this.getCookieValue("geolocation_consent")!==t.toString()){let i=new Date(Date.now()+e*864e5).toUTCString();this.document.cookie=`geolocation_consent=${t}; path=/; expires=${i}; SameSite=None; Secure`}}setGeolocationSwitchStatus(t){this.switchStatus.next(t)}checkACookieExists(t){return m(this.platformId)||typeof this.document>"u"||!this.document?.cookie?!1:this.document.cookie.split(";").map(e=>e.trim()).some(e=>e.trim().startsWith(t))}getCookieValue(t){if(c(this.platformId)){let e=this.document.cookie.split(";").map(i=>i.trim()).find(i=>i.startsWith(`${t}=`));return e?e.slice(t.length+1):""}}getMapboxAdress(){let t=`${this.geolocation.value.lng}`,e=`${this.geolocation.value.lat}`;return this.mapboxService.reverseGeocoding(t,e,this.mapboxGeocodingParams,"geolocalizacao.service getMapboxAdress")}static{this.\u0275fac=function(e){return new(e||o)(s(S),s(l),s(C),s(p))}}static{this.\u0275prov=h({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o}
1)();export{g as a,L as b};

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.