1/*! 2 * IPM Sistemas (C) - Atende.net (C) - 2026 3 * https://www.ipm.com.br/ 4 * Direitos Reservados 5 * ESTE CÓDIGO FONTE E QUALQUER DOCUMENTAÇÃO QUE O ACOMPANHE SÃO PROTEGIDOS PELA LEI DE DIREITOS AUTORAIS INTERNACIONAIS 6 * E NÃO PODE SER REVENDIDO OU REDISTRIBUÍDO. A REPRODUÇÃO OU DISTRIBUIÇÃO NÃO AUTORIZADA ESTÁ SUJEITA A PENALIDADES CIVIS E PENAIS. 7 */ 8 9/*<editor-fold desc="js_mapa.js">*/var Mapa=function(sComponenteID,sTitulo,bObrigatorio){this.id=defaultVal(sComponenteID,"mapa_sistema_net"),this.nome=defaultVal(sComponenteID,"mapa_sistema_net"),this.titulo=defaultVal(sTitulo,"Mapa"),this.obrigatorio=defaultVal(bObrigatorio,!1),this.tipoComponente=ComponenteTela.MAPA,this.tipoExibicao=Mapa.TIPO_EXIBICAO_BOTAO,this.exibeMenuOpcoes=!0,this.visualizacao=!1,this.multiplo=!1,this.fnOnCriaMarcador=[],this.fnOnIniciaMapa=null,this.aOnCriaApiMapa=null,this.fnOnBuscaEndereco=null,this.aOnMarcadorClick=[],this.aFnOnConfirmaMapa=[],this.oJanela=null,this.oTela=null,this.latitude="",this.longitude="",this.panorama="",this.objetos="",this.busca="",this.initialValue="",this.coordenadaInicial={},this.aCampos=[],this.aMarcadores=[],this.buscaLocalizacaoAtual=null,this.opcoesFerramentasMapa=new ConfiguracaoMapa,this.exibeLatLong=!0,this.exibeEndereco=!0,this.ocultaPontosInteresseMapa=!1,this.posicionaMapaLocalizacaoAtual=!1,this.utilizaMapaGoogleUrl=!1,this.aBeforeAbreMapaExterno=[],this.modoVisualizacao=Mapa.VISUALIZACAO_FORMATO_ROADMAP,this.zoom=null,this.width=null,this.height=null,this.mapasExibicao=[],this.desativaMarkerCluster=!1,this.exibeMarcadorInicial=!0,this.permiteAlterarMarkerCluster=!0,this.raioCluster=null,this.aOnChange=[],this.exibeMapaCalor=!1,this.servicoMapas=null,this.oMapaAPI=null,this.triggerBeforeAbreMapaExterno=function(){var a=new MapaEnderecoInfo;return this.aBeforeAbreMapaExterno.forEach(function(t){executaEventoJson(t,[a])}),a},this.__criaTelaMapa=function(){var a="",t=!1;return this.oTela=new TelaPadrao("tela_mapa_container"),this.oTela.setLayout(this.getLayoutPadraoTelaMapa()),this.fnOnBuscaEndereco&&(a=this.fnOnBuscaEndereco.call(),a=a.toString().trim(),a!=this.initialValue&&(t=!0,this.limpa(),this.enderecoAtual=a)),Mapa.criaApiMapa("mapa_sistema_api",this.coordenadaInicial,this.multiplo,this.panorama,this.servicoMapas).then(i=>{this.oMapaAPI=i,this.aOnCriaApiMapa&&this.aOnCriaApiMapa.forEach(e=>e.call()),this.oMapaAPI.setMapasExibicao&&this.mapasExibicao.length&&this.oMapaAPI.setMapasExibicao(this.mapasExibicao),this.oMapaAPI.setZoom&&this.zoom!==null&&this.oMapaAPI.setZoom(this.zoom),this.getPosicionaMapaLocalizacaoAtual()&&this.enderecoAtual&&this.oMapaAPI.setEnderecoBuscaInicial(this.enderecoAtual),this.getExibeEndereco()&&this.oMapaAPI.setUsaEndereco(!0),this.oMapaAPI.setDesativaMarkerCluster&&this.oMapaAPI.setDesativaMarkerCluster(this.desativaMarkerCluster),this.oMapaAPI.setExibeMarcadorInicial&&this.oMapaAPI.setExibeMarcadorInicial(this.exibeMarcadorInicial),this.oMapaAPI.setPermiteAlterarMarkerCluster&&this.oMapaAPI.setPermiteAlterarMarkerCluster(this.permiteAlterarMarkerCluster),this.oMapaAPI.setRaioCluster&&this.oMapaAPI.setRaioCluster(this.raioCluster),this.exibeMapaCalor&&this.oMapaAPI&&this.oMapaAPI.doExibeMapaCalor(),this.oMapaAPI.setOpcoesFerramentasMapa(this.opcoesFerramentasMapa),this.oMapaAPI.setVisualizacao(this.visualizacao),this.oMapaAPI.setExibeMenuOpcoes(this.exibeMenuOpcoes),this.oMapaAPI.setOcultaPontosInteresseMapa(this.ocultaPontosInteresseMapa),this.oMapaAPI.setModoVisualizacao(this.modoVisualizacao),this.oMapaAPI.onSearch(this.processaBuscaRetorno),this.oMapaAPI.onCriaMarkMapa(()=>{var e=this;this.aCampos[0].setValor(this.oMapaAPI.getLatitude()),this.aCampos[1].setValor(this.oMapaAPI.getLongitude()),this.aCampos[2].setValor(this.oMapaAPI.getNomeLocal()),Array.isArray(this.fnOnCriaMarcador)||(this.fnOnCriaMarcador=[this.fnOnCriaMarcador]),$(this.fnOnCriaMarcador).each(function(){this.call(e)})}),this.oMapaAPI.onIniciaMapa(()=>{this.oMapaAPI.doCarregaEstadoMapa(this.getObjetos()),this.setMarcadores(this.aMarcadores),!this.getOpcoesFerramentasMapa().getPermiteBuscaInterna()&&this.aMarcadores.length==0&&(em_branco(this.latitude)||this.latitude==null||this.latitude==0)&&(em_branco(this.longitude)||this.longitude==null||this.longitude==0)&&(em_branco(this.aCampos[3].getValor())||this.oMapaAPI.processaBusca(this.aCampos[3].getValor(),!0,!0)),this.getBuscaLocalizacaoAtual()&&this.carregaLocalizacaoAtual(),this.fnOnIniciaMapa&&this.fnOnIniciaMapa.call()}),this.oMapaAPI.onMarcadorClick(e=>{var r;return this.aOnMarcadorClick.forEach(function(o){var l;typeof o=="object"?l=executaEventoJson(o,[e]):l=o(e),r=l}),r}),this.aCampos[0]=new CampoForm("numerico","campo_mapa_latitude","Latitude",this.obrigatorio,10,50,this.latitude),this.aCampos[0].oCampo.setReadOnly(!0),this.aCampos[0].oCampo.setPermiteValorNegativo(!0),this.aCampos[0].oCampo.obj.css("width","100%"),this.aCampos[1]=new CampoForm("numerico","campo_mapa_longitude","Longitude",this.obrigatorio,10,50,this.longitude),this.aCampos[1].oCampo.setReadOnly(!0),this.aCampos[1].oCampo.setPermiteValorNegativo(!0),this.aCampos[1].oCampo.obj.css("width","100%"),this.aCampos[2]=new CampoForm("texto","campo_mapa_endereco","Endereço",!1,42,256),this.aCampos[2].oCampo.setReadOnly(!0),this.aCampos[2].oCampo.obj.css("width","98%"),this.aCampos[3]=new CampoForm("texto","campo_mapa_pesquisa","Pesquisar",!1,20,256,this.busca),this.aCampos[3].oCampo.setModoSugestao(1),this.aCampos[3].oCampo.obj.css("width","100%"),this.aCampos[3].onFocus(function(){return s(),!0});var s=()=>
9{if(this.fnOnBuscaEndereco&&em_branco(this.aCampos[3].getValor())){var e=this.fnOnBuscaEndereco.call();this.aCampos[3].setValor(e.toString())}},n=new BotaoEstrutura("consultar",()=>{s(),this.oMapaAPI.processaBusca(this.aCampos[3].getValor(),!0,!1)});n.obj.attr("title","Pesquisar"),t?this.aCampos[3].setValor(a):s(),this.aCampos[3].onKeyUp(e=>{var r=this.aCampos[3],o=e.keyCode||e.which;if(o==CONST.KEY.ARROW_UP||o==CONST.KEY.ARROW_DOWN||this.visualizacao)return!1;this.oMapaAPI.processaBusca(r.getValor(),!0,!1)}),this.aCampos[3].getCampo().callFunctionSelect=e=>{this.setBusca(e),this.oMapaAPI.processaBusca(e,!1,!1)},this.oTela.adicionaComponente(this.aCampos[0]),this.oTela.adicionaComponente(this.aCampos[1]),this.oTela.adicionaComponente(this.aCampos[2]),this.oTela.adicionaComponente(this.aCampos[3]),this.oTela.adicionaComponente(n),this.oTela.setVisualizacao(this.visualizacao)})},this.getLayoutPadraoTelaMapa=function(){function a(M){var u=$("<td>");return $("<span>").css({display:"block",margin:"5px 0px 0px 5px"}).attr("type","label").html(M).appendTo(u),u}function t(M){var u=$("<td>");return $("<span>").css({display:"block",margin:"0px 5px 0px 5px"}).attr("type","campo").html(M).appendTo(u),u}var i=!this.getOpcoesFerramentasMapa().getPermiteBuscaInterna(),s=$("<table>").css({width:"100%",height:"100%"}),n=$("<tr>").appendTo(s);i&&a("campo_mapa_pesquisa").attr({id:"td_mapa_label",height:"15px",width:"26.5%",colspan:2}).appendTo(n);var e=$("<td>").attr({height:"90%",colspan:3}).appendTo(n);(this.getExibeLatLong()||this.getExibeEndereco())&&e.addClass("mapa_border_bottom");var r=$("<div>").addClass("div_mapa_container full").appendTo(e);if(i){var o=!this.getExibeLatLong()&&!this.getExibeEndereco()?5:3;e.attr("rowspan",o),r.addClass("mapa_border_left")}if(i){var l=$("<tr>").appendTo(s);t("campo_mapa_pesquisa").attr({id:"td_mapa_pesquisa",height:"22px"}).appendTo(l);var d=$("<td>").attr({id:"td_mapa_consultar",width:"14px"}).appendTo(l);$("<span>").attr("type","botao").html("consultar").appendTo(d);var h=$("<tr>").appendTo(s),p=$("<td>").attr({id:"td_mapa_resultado",width:"160px",colspan:2,rowspan:3}).addClass("mapa_border_top").appendTo(h);$("<div>").addClass("div_mapa_pesquisa").appendTo(p)}if(this.getExibeLatLong()||this.getExibeEndereco()){var c=$("<tr>").appendTo(s);if(this.getExibeLatLong()){var f=a("campo_mapa_latitude").attr("height","15px").appendTo(c);a("campo_mapa_longitude").appendTo(c)}if(this.getExibeEndereco())var g=a("campo_mapa_endereco").attr("height","15px").appendTo(c);var m=$("<tr>").appendTo(s);if(this.getExibeLatLong()){var C=t("campo_mapa_latitude").attr("height","22px").appendTo(m);t("campo_mapa_longitude").appendTo(m)}if(this.getExibeEndereco())var A=t("campo_mapa_endereco").attr("height","22px").appendTo(m);i&&(this.getExibeLatLong()?(f.addClass("mapa_border_left"),C.addClass("mapa_border_left")):this.getExibeEndereco()&&(g.addClass("mapa_border_left"),A.addClass("mapa_border_left")))}return s.get(0).outerHTML},this.criaJanelaMapa=function(){this.__criaTelaMapa().then(()=>{var bIpmMaps=!!__enderecoMapsIpm,aBotoes=[new Botao("botao_janela_mapa_confirmar","Confirmar",()=>{if(this.oMapaAPI&&this.oMapaAPI.valida&&!this.oMapaAPI.valida())return this.oJanela.chamaAtencao(),!1;this.validaCamposMapa()&&((em_branco(this.aCampos[0].getValor())||em_branco(this.aCampos[1].getValor()))&&(this.aCampos[0].setValor(this.oMapaAPI.getLatitude()),this.aCampos[1].setValor(this.oMapaAPI.getLongitude()),this.aCampos[2].setValor(this.oMapaAPI.getNomeLocal())),this.setLatitude(this.aCampos[0].getValor()),this.setLongitude(this.aCampos[1].getValor()),this.setCoordenadaInicial({lat:this.getLatitude(),lng:this.getLongitude()}),this.setBusca(this.aCampos[3].getValor()),this.oMapaAPI&&(this.setObjetos(this.oMapaAPI.doSalvaEstadoMapa()),this.setPanorama(this.oMapaAPI.getPanorama())),this.aFnOnConfirmaMapa.length&&this.aFnOnConfirmaMapa.forEach(a=>a.call()),this.aOnChange.forEach(fn=>{typeof fn=="string"&&(fn=eval("("+fn+")")),fn()}),this.oJanela.getJanela().closeJanela())}),new Botao("botao_janela_mapa_limpar","Limpar",()=>{this.aCampos.forEach(a=>a&&a.setValor("")),this.limpa()}),new Botao("botao_janela_mapa_fechar","Fechar",()=>{this.oJanela.getJanela().closeJanela()})];
9this.visualizacao&&(aBotoes[0].hide(),aBotoes[1].hide());var oJanelaCaller=this.getJanela(),oCaller=!1;oJanelaCaller&&oJanelaCaller.options&&oJanelaCaller.options.rotina&&(oCaller={rotina:oJanelaCaller.options.rotina,acao:oJanelaCaller.options.acao,autoId:oJanelaCaller.options.autoId});var iHeight=this.getHeight()?this.getHeight():500,iWidth=this.getWidth()?this.getWidth():1e3;this.oJanela=new Janela({titulo:sTitulo,aba:!1,bloqueadora:!0,areaRodape:!0,maximizavel:!0,maximizada:bIpmMaps,redimensionavel:!0,botoes:aBotoes,caller:oCaller,altura:iHeight,alturaMin:400,largura:iWidth,larguraMin:700}),this.oJanela.onDestroyJanela(()=>{this.oJanela=null,this.oTela=null});var oConteudoJan=this.oJanela.getConteudo();this.oTela.appendTo(oConteudoJan),this.afterAppendTelaMapa()})},this.getTelaMapa=function(){return this.oTela},this.afterAppendTelaMapa=function(){var a=$("div.div_mapa_container",this.oTela.getContent());this.oMapaAPI.obj.appendTo(a),this.visualizacao&&($("td#td_mapa_label",this.oTela.getContent()).hide(),$("td#td_mapa_pesquisa",this.oTela.getContent()).hide(),$("td#td_mapa_consultar",this.oTela.getContent()).hide(),$("td#td_mapa_resultado",this.oTela.getContent()).hide())},this.processaBuscaRetorno=function(a,t,i){var s=this,n=$("div.div_mapa_pesquisa",this.oTela.getContent());if(i=defaultVal(i,!1),n.empty(),!a){var e=$(document.createElement("div")).addClass("div_mapa_resultado_disable");e.html("Nenhum resultado encontrado."),n.append(e);return}if(t==!0)for(var r=0;r<a.length;r++){var o=a[r];if(o){var e=$(document.createElement("div")).addClass("div_mapa_resultado");if(r%2&&e.addClass("div_mapa_color"),e.html(o.formatted_address),e.attr("title",o.formatted_address),e.attr("latitude",o.geometry.location.lat()),e.attr("longitude",o.geometry.location.lng()),e.on("click",function(h){var p=$(h.target),c=new google.maps.LatLng(p.attr("latitude"),p.attr("longitude"));s.oMapaAPI.criaMarkMapa(c)}),n.append(e),i&&r==0){var l=new google.maps.LatLng(o.geometry.location.lat(),o.geometry.location.lng());s.oMapaAPI.criaMarkMapa(l)}}}else this.oMapaAPI.criaMarkMapa(a[0].geometry.location)},this.carregaLocalizacaoAtual=function(){!em_branco(defaultVal(this.getLatitude(),""))||!em_branco(defaultVal(this.getLongitude(),""))||this.visualizacao||Mapa.getLocalizacaoAtual(a=>{em_branco(defaultVal(this.getLatitude(),""))&&em_branco(defaultVal(this.getLongitude(),""))&&(this.setLatitude(a.latitude),this.setLongitude(a.longitude),this.isExibicaoTela()&&(this.aCampos[0].setValor(a.latitude),this.aCampos[1].setValor(a.longitude),this.oMapaAPI&&this.oMapaAPI.criaMarcador(a.latitude,a.longitude)))},!1,!1)},this.setWidth=function(a){this.width=a},this.getWidth=function(){return this.width},this.setHeight=function(a){this.height=a},this.getHeight=function(){return this.height},this.setUtilizaMapaGoogleUrl=function(a){this.utilizaMapaGoogleUrl=a},this.getUtilizaMapaGoogleUrl=function(){return this.utilizaMapaGoogleUrl},this.setBeforeAbreMapaExterno=function(a){this.aBeforeAbreMapaExterno=a},this.setModoVisualizacao=function(a){this.modoVisualizacao=a},this.setZoom=function(a){this.zoom=a,this.oMapaAPI&&this.oMapaAPI.setZoom(this.zoom)},this.getZoom=function(){return this.zoom},this.setTitulo=function(a){this.titulo=a},this.getTitulo=function(){return this.titulo},this.setObrigatorio=function(a){this.obrigatorio=a},this.getObrigatorio=function(){return this.obrigatorio},this.setVisualizacao=function(a){this.visualizacao=a,this.oMapaAPI&&this.oMapaAPI.setVisualizacao(this.visualizacao)},this.getVisualizacao=function(){return this.visualizacao},this.setLatitude=function(a){this.latitude=a,this.oMapaAPI&&this.oMapaAPI.setLatitude(a)},this.getLatitude=function(){return this.isExibicaoTela()&&this.oMapaAPI?this.oMapaAPI.getLatitude():this.latitude},this.setLongitude=function(a){this.longitude=a,this.oMapaAPI&&this.oMapaAPI.setLongitude(a)},this.getLongitude=function(){return this.isExibicaoTela()&&this.oMapaAPI?this.oMapaAPI.getLongitude():this.longitude},this.getCoordenadaInicial=function(){return this.coordenadaInicial},this.setCoordenadaInicial=function(a){this.coordenadaInicial=a,this.oMapaAPI&&(this.oMapaAPI.setLatitude(a.lat),this.oMapaAPI.setLongitude(a.lng))},this.setObjetos=function(a){this.objetos=a,this.oMapaAPI&&this.oMapaAPI.doCarregaEstadoMapa(a)},this.getObjetos=function(){return this.objetos},this.limpaObjetos=function(){this.setObjetos("[]")},this.adicionaObjeto=function(a){var t=a.desenho;typeof t.caminho=="string"&&(t.caminho=googlePolyline.decode(t.caminho));var i=this.oMapaAPI.doCriaNovoObjeto(a.tipo,t);return i.setDadoObjeto("titulo",a.dados.titulo),i.setDadoObjeto("descricao",a.dados.descricao),i.setSomenteLeitura(!!a.readonly),a.dados.label&&i.setLabel&&i.setLabel(a.dados.label),a.estilos&&i.setEstilosObjeto(a.estilos),i},this.removeObjeto=function(a){this.oMapaAPI.doDeletaElemento(a)},this.setBusca=function(a){this.busca=a},this.getBusca=function(){return this.busca},this.setMultiplo=function(a){this.multiplo=a},this.getMultiplo=function(){return this.multiplo},this.setMarcadores=function(a){this.aMarcadores=a||[],this.oMapaAPI&&(this.oMapaAPI.doLimpaAtributosMapa(),this.aMarcadores.forEac
9h(t=>{if(!(em_branco(t.latitude)||t.latitude==0||em_branco(t.longitude)||t.longitude==0)){var i=null;this.usaGoogleMaps()?i=this.oMapaAPI.criaMarcador(t.latitude,t.longitude,t.titulo,t.icone,t.chave,!0,t.label):i=this.oMapaAPI.criaMarcadorFixo(t.latitude,t.longitude,t.titulo,t.icone,t.chave,t.label,!1,t.arrastavel),t.objetoOriginal=i}}))},this.getMarcadores=function(){if(this.oMapaAPI){var a=this.oMapaAPI.getMarcadores()||[];return a=a.map(t=>{var i=new MapaMarcador;return i.carregaFromObjeto(t),i}),this.aMarcadores=a,this.aMarcadores}return this.aMarcadores},this.ocultaMarcador=function(a){if(Array.isArray(a))return a.forEach(t=>this.ocultaMarcador(t));this.oMapaAPI&&a.objetoOriginal&&this.oMapaAPI.ocultaMarcador(a.objetoOriginal)},this.exibeMarcador=function(a){if(Array.isArray(a))return a.forEach(t=>this.exibeMarcador(t));this.oMapaAPI&&a.objetoOriginal&&this.oMapaAPI.exibeMarcador(a.objetoOriginal)},this.adicionaEventoMarcador=function(a,t,i){this.oMapaAPI&&a.objetoOriginal&&this.oMapaAPI.adicionaEventoMarcador(a.objetoOriginal,t,i)},this.setPanorama=function(a){this.panorama=a},this.getPanorama=function(){return this.panorama},this.setTipoExibicao=function(a){this.tipoExibicao=a},this.isExibicaoBotao=function(){return this.tipoExibicao===Mapa.TIPO_EXIBICAO_BOTAO},this.isExibicaoTela=function(){return this.tipoExibicao===Mapa.TIPO_EXIBICAO_MAPA},this.setBuscaLocalizacaoAtual=function(a){this.buscaLocalizacaoAtual=a},this.getBuscaLocalizacaoAtual=function(){return this.buscaLocalizacaoAtual},this.setOpcoesFerramentasMapa=function(a){a instanceof ConfiguracaoMapa?this.opcoesFerramentasMapa=a:this.opcoesFerramentasMapa.setOpcoes(a)},this.getOpcoesFerramentasMapa=function(){return this.opcoesFerramentasMapa},this.getExibeLatLong=function(){return this.exibeLatLong},this.getExibeEndereco=function(){return this.exibeEndereco},this.setExibeLatLong=function(a){this.exibeLatLong=a},this.setExibeEndereco=function(a){this.exibeEndereco=a},this.setExibeMenuOpcoes=function(a){this.exibeMenuOpcoes=a,this.oMapaAPI&&this.oMapaAPI.setExibeMenuOpcoes(this.exibeMenuOpcoes)},this.getExibeMenuOpcoes=function(){return this.exibeMenuOpcoes},this.setOcultaPontosInteresse=function(a){this.ocultaPontosInteresseMapa=a},this.setPosicionaMapaLocalizacaoAtual=function(a){this.posicionaMapaLocalizacaoAtual=a},this.getPosicionaMapaLocalizacaoAtual=function(){return this.posicionaMapaLocalizacaoAtual},this.limpa=function(){this.latitude="",this.longitude="",this.busca="",this.panorama="",this.objetos="",this.oMapaAPI&&this.oMapaAPI.doLimpaAtributosMapa(),this.oMapaAPI&&this.oMapaAPI.doLimpaMapa()},this.validaCamposMapa=function(){try{this.aCampos[0].valida(),this.aCampos[1].valida()}catch(a){return Message.alertaSistema(a.codigo,a.paramMsg,!0,this.aCampos[0].oCampo),!1}return!0},this.valida=function(){return this.isExibicaoBotao()?!0:this.validaCamposMapa()},this.getValores=function(){if(window.Mapa.debugMapa)return[window.Mapa.latDebug,window.Mapa.lngDebug,this.busca,this.panorama,window.Mapa.objDebug];if(document.debug){var a=rand(10,26)*-1-.8089464,t=rand(20,49)*-1-.266401;return[a,t,this.busca,this.panorama]}return this.isExibicaoTela()&&this.aCampos.length>0?[this.aCampos[0].getValor(),this.aCampos[1].getValor(),this.aCampos[3].getValor(),this.oMapaAPI?this.oMapaAPI.getPanorama():null,this.oMapaAPI?this.oMapaAPI.doSalvaEstadoMapa():""]:[this.latitude,this.longitude,this.busca,this.panorama,this.objetos]},this.onCriaMarcador=function(a){this.fnOnCriaMarcador=[a]},this.onBuscaEndereco=function(a){this.fnOnBuscaEndereco=a},this.addFunctionOnCriaMarcador=function(a){this.fnOnCriaMarcador?Array.isArray(this.fnOnCriaMarcador)||(this.fnOnCriaMarcador=[this.fnOnCriaMarcador]):this.fnOnCriaMarcador=[],this.fnOnCriaMarcador.push(a)},this.onIniciaMapa=function(a){var t=this.fnOnIniciaMapa;t?this.fnOnIniciaMapa=function(){a.apply(this,arguments),t.apply(this,arguments)}:this.fnOnIniciaMapa=a},this.onCriaApiMapa=function(a){this.aOnCriaApiMapa||(this.aOnCriaApiMapa=[]),this.aOnCriaApiMapa.push(a)},this.onMarcadorClick=function(a){this.aOnMarcadorClick.push(a)},this.setMapasExibicao=function(a){this.mapasExibicao=a},this.setOnClickMarcador=function(a){this.aOnMarcadorClick=a}
9,this.setDesativaMarkerCluster=function(a){this.desativaMarkerCluster=a,this.oMapaAPI&&this.oMapaAPI.setDesativaMarkerCluster(a)},this.setExibeMarcadorInicial=function(a){this.exibeMarcadorInicial=a,this.oMapaAPI&&this.oMapaAPI.setExibeMarcadorInicial(a)},this.setPermiteAlterarMarkerCluster=function(a){this.permiteAlterarMarkerCluster=a,this.oMapaAPI&&this.oMapaAPI.setExibeMarcadorInicial(a)},this.setRaioCluster=function(a){this.raioCluster=a,this.oMapaAPI&&this.oMapaAPI.setRaioCluster(a)},this.doExibeMapaCalor=function(){this.exibeMapaCalor=!0,this.oMapaAPI&&this.oMapaAPI.doExibeMapaCalor()},this.doOcultaMapaCalor=function(){this.exibeMapaCalor=!1,this.doOcultaMapaCalor&&this.oMapaAPI.doOcultaMapaCalor()},this.carregaFromJson=function(a){Mapa.prototype.carregaFromJson.apply(this,arguments),a.id&&(this.id=a.id),a.visualizacao&&this.setVisualizacao(!0),this.nome=a.nome,this.initialValue=a.initialValue,this.setTitulo(a.titulo),this.setObrigatorio(a.obrigatorio),this.setCoordenadaInicial(a.coordenadaInicial),this.setLatitude(a.latitude),this.setLongitude(a.longitude),this.setBusca(a.busca),this.setMultiplo(a.multiplo),this.setMarcadores(a.marcadores),this.setObjetos(a.objetos),this.setPanorama(a.panorama),this.setBuscaLocalizacaoAtual(a.localizacaoAtual),this.setTipoExibicao(a.tipoExibicao),this.setExibeLatLong(a.exibeLatitudeLongitude),this.setExibeEndereco(a.exibeEndereco),this.setExibeMenuOpcoes(a.exibeMenuOpcoes),a.zoom!==null&&this.setZoom(a.zoom),this.setPosicionaMapaLocalizacaoAtual(a.posicionaMapaLocAtual),this.setOcultaPontosInteresse(a.ocultaPontosInteresse),this.setOpcoesFerramentasMapa(a.configuracoesObjetos),this.getOpcoesFerramentasMapa().setCamadasKml(a.camadasMapa),this.getOpcoesFerramentasMapa().setCamadasKmlAtivas(a.camadasAtivasMapa),this.getOpcoesFerramentasMapa().setPermiteBuscaInterna(a.permiteBuscaInterna),this.setUtilizaMapaGoogleUrl(a.utilizaMapaGoogleUrl),this.setModoVisualizacao(a.modoVisualizacao),this.setMapasExibicao(a.mapasExibicao),this.setDesativaMarkerCluster(a.desativaMarkerCluster),this.setExibeMarcadorInicial(a.exibeMarcadorInicial),this.setPermiteAlterarMarkerCluster(a.alteraMarkerCluster),this.setRaioCluster(a.raioCluster),this.servicoMapas=a.servicoMapas,a.exibeMapaCalor&&this.doExibeMapaCalor(),this.oMapaAPI&&this.oMapaAPI.carregaFromJson&&this.oMapaAPI.carregaFromJson(a)},this.getJsonFormat=function(){var a=Mapa.prototype.getJsonFormat.apply(this,arguments);return a.nome=this.nome,a.titulo=this.getTitulo(),a.obrigatorio=this.getObrigatorio(),a.permiteBuscaInterna=this.getOpcoesFerramentasMapa().getPermiteBuscaInterna(),a.modoVisualizacao=this.modoVisualizacao,a.latitude=this.getLatitude(),a.longitude=this.getLongitude(),a.zoom=this.getZoom(),a.busca=this.getBusca(),a.multiplo=this.getMultiplo(),a.objetos=this.getObjetos(),a.marcadores=this.getMarcadores(),a.panorama=this.getPanorama(),a.localizacaoAtual=this.getBuscaLocalizacaoAtual(),a.tipoExibicao=this.tipoExibicao,a.exibeLatitudeLongitude=this.getExibeLatLong(),a.exibeEndereco=this.getExibeEndereco(),a.exibeMenuOpcoes=this.getExibeMenuOpcoes(),a.coordenadaInicial=this.getCoordenadaInicial(),a.mapasExibicao=this.mapasExibicao,a.configuracoesObjetos=this.getOpcoesFerramentasMapa(),a.camadasMapa=this.getOpcoesFerramentasMapa().getCamadasKml(),a.camadasAtivasMapa=this.getOpcoesFerramentasMapa().getCamadasKmlAtivas(),a.posicionaMapaLocAtual=this.posicionaMapaLocAtual,a.ocultaPontosInteresse=this.ocultaPontosInteresseMapa,a.utilizaMapaGoogleUrl=this.utilizaMapaGoogleUrl,a.raioCluster=this.raioCluster,a.exibeMapaCalor=this.exibeMapaCalor,a.servicoMapas=this.servicoMapas,a.id=this.id,a.visualizacao=this.visualizacao,a.initialValue=this.initialValue,a.desativaMarkerCluster=this.desativaMarkerCluster,a.exibeMarcadorInicial=this.exibeMarcadorInicial,a.alteraMarkerCluster=this.permiteAlterarMarkerCluster,a},this.onConfirmaMapa=function(a){this.aFnOnConfirmaMapa.push(a)},this.__iniciaComponenteMapa=function(){this.criaObjeto("div"),this.loadComportamentos=Componente.loadComportamentos,this.onAfterAppend(oInstance=>{if(this.isExibicaoBotao()){var oBotaoMapa=new BotaoEstrutura("mapa",()=>{this.criaJanelaMapa()});if(this.utilizaMapaGoogleUrl){var oBotaoExterno=new BotaoAcao(1072,()=>{abreJanelaGoogleMaps(this.latitude,this.longitude,this.triggerBeforeAbreMapaExterno())});oBotaoExterno.setLabel("Abrir Externamente"),oBotaoMapa.adicionaAcao(oBotaoExterno),oBotaoMapa.showAsGroup()}
9oBotaoMapa.showAsButtonFull(),oBotaoMapa.setLabel(this.titulo),oBotaoMapa.appendTo(this.obj)}else this.__criaTelaMapa().then(()=>{this.oTela.appendTo(this.obj),this.obj.css("height","100%"),this.afterAppendTelaMapa(),this.oMapaAPI.onCriaMarkMapa(()=>{this.aOnChange.forEach(fn=>{typeof fn=="string"&&(fn=eval("("+fn+")")),fn()})})});this.fnOnBuscaEndereco&&(this.initialValue=this.fnOnBuscaEndereco.call(),this.initialValue=this.initialValue.toString().trim())})},this.onChange=function(a){this.aOnChange.push(a)},this.usaGoogleMaps=function(){return this.servicoMapas?this.servicoMapas==Mapa.SERVICO_MAPA_GOOGLE_MAPS:Mapa.usaGoogleMaps()};function abreJanelaGoogleMaps(a,t,i){i.validaDadosPreenchidos()&&(ControleBaseSistema.bloqueiaSistema("Buscando informações do endereço."),loadAjax({rotina:1,acao:1,processo:"getUrlMapaNovaJanela",parametro:{lat:a,lng:t,infoMapa:utf8_encode(JSON.stringify(i.toJsonFormat()))},completo:function(s){window.open(s)},finally:function(){ControleBaseSistema.desbloqueiaSistema()}}))}this.__iniciaComponenteMapa()};Mapa.prototype=new ComponenteTela,Mapa.SERVICO_MAPA_GOOGLE_MAPS=1,Mapa.SERVICO_MAPA_IPM_MAPS=2,Mapa.TIPO_EXIBICAO_BOTAO=1,Mapa.TIPO_EXIBICAO_MAPA=2,Mapa.VISUALIZACAO_FORMATO_ROADMAP="ROADMAP",Mapa.VISUALIZACAO_FORMATO_TERRAIN="TERRAIN",Mapa.VISUALIZACAO_FORMATO_SATELLITE="SATELLITE",Mapa.VISUALIZACAO_FORMATO_HYBRID="HYBRID",Mapa.criaApiMapa=async function(a,t,i,s,n){const e=n?n==Mapa.SERVICO_MAPA_GOOGLE_MAPS:Mapa.usaGoogleMaps(),l=["js_mapas_overlay_view.js",...e?["js_componente_mapa_google.js","js_mapas_overlay_view_google_maps.js","js_mapas_objetos_google.js","js_markerclusterer.min.js","js_overlapping_marker_spiderfier.min.js"]:["js_componente_mapa_ipm.js","js_mapas_overlay_view_ipm_maps.js","js_mapas_objetos_ipm.js"]],d=await includeJavaScript(l);let h;if(d){let p=!1;e||await loadAjax({rotina:1,acao:1,processo:"getNovoTokenMapa",completo:c=>(p=c,!0)}),p?(h=new ComponenteMapaIpmMapas(a,p),h.setLatitude(t&&t.lat||0),h.setLongitude(t&&t.lng||0),h.setMultiplo(i)):h=new ComponenteMapaGoogle(a,t&&t.lat,t&&t.lng,i,s)}return h},Mapa.usaGoogleMaps=function(){return!window.__utilizaMapsIpmDefault},Mapa.getLocalizacaoAtual=function(a,t,i,s){if(!navigator.geolocation){i&&Message.alertaSistema("EST-000360"),t&&t.apply(null,["O navegador não possui suporte ao recurso de localização"]);return}const n=function(r){let o="";switch(r.code){case r.PERMISSION_DENIED:o="Não foi concedido permissão para obter a localização atual";break;case r.POSITION_UNAVAILABLE:o="Não foi possível obter a localização atual";break;case r.TIMEOUT:o="A busca pela localização ultrapassou o tempo limite";break;default:o="Erro desconhecido"}i&&Message.alertaSistema("EST-000420",{detalhes:o}),t&&t.apply(null,[o])},e=function(r){a&&a.apply(null,[{latitude:r.coords.latitude,longitude:r.coords.longitude}])};s={timeout:1e4,...s},navigator.geolocation.getCurrentPosition(e,n,s)};function MapaEnderecoInfo(){this.setNumeroRua=function(a){this.numeroRua=a},this.setLogradouro=function(a){this.logradouro=a},this.setNomeBairro=function(a){this.nomeBairro=a},this.setNomeCidade=function(a){this.nomeCidade=a},this.setNomeEstado=function(a){this.nomeEstado=a},this.setSiglaEstado=function(a){this.siglaEstado=a},this.setNomePais=function(a){this.nomePais=a},this.setSiglaPais=function(a){this.siglaPais=a},this.setCep=function(a){this.cep=a},this.validaDadosPreenchidos=function(){return em_branco(this.cep)||em_branco(this.nomeCidade)||em_branco(this.logradouro)?(Message.alerta("WUN-000431"),!1):!0},this.toJsonFormat=function(){return[{address_components:[{long_name:this.numeroRua,short_name:this.numeroRua,types:["street_number"]},{long_name:this.logradouro,short_name:this.logradouro,types:["route"]},{long_name:this.nomeBairro,short_name:this.nomeBairro,types:["political","sublocality","sublocality_level_1"]},{long_name:this.nomeCidade,short_name:this.nomeCidade,types:["administrative_area_level_2","political"]},{long_name:this.nomeEstado,short_name:this.siglaEstado,types:["administrative_area_level_1","political"]},{long_name:this.nomePais,short_name:this.siglaPais,types:["country","political"]},{long_name:(this.cep||"").replace(/\D/,""),short_name:(this.cep||"").replace(/\D/,""),types:["postal_code"]}
9],types:["street_address"]}]}}var ConfiguracaoMapa=function(a){this.setPermiteDesenharMarcadores=function(t){this.permiteMarcadores=t},this.getPermiteDesenharMarcadores=function(){return this.permiteMarcadores},this.setPermiteDesenharLinhas=function(t){this.permiteLinhas=t},this.getPermiteDesenharLinhas=function(){return this.permiteLinhas},this.setPermiteDesenharPoligonos=function(t){this.permitePoligonos=t},this.getPermiteDesenharPoligonos=function(){return this.permitePoligonos},this.setPermiteDesenharCirculos=function(t){this.permiteCirculos=t},this.getPermiteDesenharCirculos=function(){return this.permiteCirculos},this.setPermiteSalvarCarregarEstado=function(t){this.permiteSalvaCarregaEstado=t},this.getPermiteSalvarCarregarEstado=function(){return this.permiteSalvaCarregaEstado},this.setPermiteExibirMapaCalor=function(t){this.permiteMapaCalor=t},this.getPermiteExibirMapaCalor=function(){return this.permiteMapaCalor},this.setPermiteBuscaInterna=function(t){this.permiteBuscaInterna=t},this.getPermiteBuscaInterna=function(){return this.permiteBuscaInterna},this.getPermiteExportar=function(){return this.permiteExportar},this.setLinkMarcador=function(t){this.linkMarcadores=t},this.getLinkMarcador=function(){return this.linkMarcadores},this.setLinkInstantaneo=function(t){this.linkInstantaneo=t},this.getLinkInstantaneo=function(){return this.linkInstantaneo},this.setAcoesObjetoMapa=function(t){this.acoesObjeto=t},this.getAcoesObjetoMapa=function(){return this.acoesObjeto},this.setCamadasKml=function(t){this.camadasKml=t},this.getCamadasKml=function(){return this.camadasKml},this.setCamadasKmlAtivas=function(t){this.camadasKmlAtivas=t},this.getCamadasKmlAtivas=function(){return this.camadasKmlAtivas},this.onCapturaInstantaneo=function(t){this.fnCapturaInstantaneo=t},this.getFnCapturaInstantaneo=function(){return this.fnCapturaInstantaneo},this.setOpcoes=function(t){t||(t={}),this.permiteMarcadores=defaultVal(t.permiteMarcadores,!1),this.permiteLinhas=defaultVal(t.permiteLinhas,!1),this.permitePoligonos=defaultVal(t.permitePoligonos,!1),this.permiteCirculos=defaultVal(t.permiteCirculos,!1),this.permiteSalvaCarregaEstado=defaultVal(t.permiteSalvaCarregaEstado,!0),this.permiteMapaCalor=defaultVal(t.permiteMapaCalor,!1),this.permiteBuscaInterna=defaultVal(t.permiteBuscaInterna,!1),this.permiteExportar=defaultVal(t.permiteExportar,!1),this.linkMarcadores=defaultVal(t.linkMarcadores,null),this.linkInstantaneo=defaultVal(t.linkInstantaneo,null),this.acoesObjeto=defaultVal(t.acoesObjeto,[]),this.camadasKml=defaultVal(t.camadasKml,[]),this.camadasKmlAtivas=defaultVal(t.camadasKmlAtivas,[]),this.fnCapturaInstantaneo=defaultVal(t.onCapturaInstantaneo,null)},this.listen=function(t){this.changeListeners.push(t)},this.destroy=function(){this.changeListeners=[]},this.changeListeners=[],Object.defineProperties(this,["permiteMarcadores","permiteLinhas","permitePoligonos","permiteCirculos","permiteSalvaCarregaEstado","permiteMapaCalor","permiteBuscaInterna","permiteExportar","linkMarcadores","linkInstantaneo","acoesObjeto","camadasKml","camadasKmlAtivas","fnCapturaInstantaneo"].reduce((t,i)=>{let s="_"+i;return t[i]={get:()=>this[s],set:n=>{let e=this[s];this[s]=n,this.changeListeners.forEach(r=>{r({propriedade:s,original:e,valor:n})})}},t},{})),this.setOpcoes(a)};;/*</editor-fold desc="js_mapa.js">*/ 10/*<editor-fold desc="js_google_polyline.js">*//* 11 {ipm "async": false, "bundle": "mapas", "priority": 400} 12 Copyright 2020 Google LLC 13 14 Licensed under the Apache License, Version 2.0 (the "License");
15 you may not use this file except in compliance with the License. 16 You may obtain a copy of the License at 17 18 http://www.apache.org/licenses/LICENSE-2.0 19 20 Unless required by applicable law or agreed to in writing, software 21 distributed under the License is distributed on an "AS IS" BASIS, 22 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 See the License for the specific language governing permissions and 24 limitations under the License. 25*/ 26var googlePolyline=function(C){var ea="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},J=function(a){return a&&a.Math==Math&&a},f=J("object"==typeof globalThis&&globalThis)||J("object"==typeof window&&window)||J("object"==typeof self&&self)||J("object"==typeof ea&&ea)||function(){return this}()||Function("return this")(),q=function(a){try{return!!a()}catch(b){return!0}},r=!q(function(){return 7!=Object.defineProperty({}, 271,{get:function(){return 7}})[1]}),N=!q(function(){var a=function(){}.bind();return"function"!=typeof a||a.hasOwnProperty("prototype")}),K=Function.prototype.call,D=N?K.bind(K):function(){return K.apply(K,arguments)},fa={}.propertyIsEnumerable,ha=Object.getOwnPropertyDescriptor;var Oa=ha&&!fa.call({1:2},1)?function(a){a=ha(this,a);return!!a&&a.enumerable}:fa;var t,L,ia=function(a,b){return{enumerable:!(1&a),configurable:!(2&a),writable:!(4&a),value:b}},ja=Function.prototype,Pa=ja.bind,O=ja.call,Qa= 28N&&Pa.bind(O,O),k=N?function(a){return a&&Qa(a)}:function(a){return a&&function(){return O.apply(a,arguments)}},Ra=k({}.toString),Sa=k("".slice),P=f.Object,Ta=k("".split),E=q(function(){return!P("z").propertyIsEnumerable(0)})?function(a){return"String"==Sa(Ra(a),8,-1)?Ta(a,""):P(a)}:P,Ua=f.TypeError,F=function(a){if(null==a)throw Ua("Can't call method on "+a);return a},l=function(a){return"function"==typeof a},u=function(a){return"object"==typeof a?null!==a:l(a)},Q=function(a,b){if(2>arguments.length){var c= 29f[a];c=l(c)?c:void 0}else c=f[a]&&f[a][b];return c},Va=k({}.isPrototypeOf),R=Q("navigator","userAgent")||"",ka=f.process,la=f.Deno,ma=ka&&ka.versions||la&&la.version,na=ma&&ma.v8;na&&(L=0<(t=na.split("."))[0]&&4>t[0]?1:+(t[0]+t[1]));!L&&R&&(!(t=R.match(/Edge\/(\d+)/))||74<=t[1])&&(t=R.match(/Chrome\/(\d+)/))&&(L=+t[1]);var oa=L,S=!!Object.getOwnPropertySymbols&&!q(function(){var a=Symbol();return!String(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&oa&&41>oa}),T=S&&!Symbol.sham&&"symbol"==typeof Symbol.iterator, 30Wa=f.Object,U=T?function(a){return"symbol"==typeof a}:function(a){var b=Q("Symbol");return l(b)&&Va(b.prototype,Wa(a))},Xa=f.String,Ya=f.TypeError,Za=f.TypeError,V={},$a=Object.defineProperty,W=function(a,b){try{$a(f,a,{value:b,configurable:!0,writable:!0})}catch(c){f[a]=b}return b},v=f["__core-js_shared__"]||W("__core-js_shared__",{});(V=function(a,b){return v[a]||(v[a]=void 0!==b?b:{})})("versions",[]).push({version:"3.22.3",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.22.3/LICENSE", 31source:"https://github.com/zloirock/core-js"});var ab=f.Object,bb=k({}.hasOwnProperty),m=Object.hasOwn||function(a,b){return bb(ab(F(a)),b)},cb=0,db=Math.random(),eb=k((1).toString),pa=function(a){return"Symbol("+(void 0===a?"":a)+")_"+eb(++cb+db,36)},G=V("wks"),x=f.Symbol,qa=x&&x.for,fb=T?x:x&&x.withoutSetter||pa,gb=f.TypeError,hb=function(a){if(!m(G,a)||!S&&"string"!=typeof G[a]){var b="Symbol."+a;S&&m(x,a)?G[a]=x[a]:G[a]=T&&qa?qa(b):fb(b)}return G[a]}("toPrimitive"),X=function(a){a:{var b="string"; 32if(u(a)&&!U(a)){var c;var d=a[hb];if(null==d)d=void 0;else if(!l(d)){try{var g=Xa(d)}catch(n){g="Object"}throw Ya(g+" is not a function");}if(d){if(void 0===b&&(b="default"),c=D(d,a,b),!u(c)||U(c)){a=c;break a}throw gb("Can't convert object to primitive value");}void 0===b&&(b="number");var e,h;if(!("string"===b&&l(e=a.toString)&&!u(h=D(e,a))||l(e=a.valueOf)&&!u(h=D(e,a))||"string"!==b&&l(e=a.toString)&&!u(h=D(e,a))
32))throw Za("Can't convert object to primitive value");a=h}}return U(a)?a:a+""},Y=f.document, 33ib=u(Y)&&u(Y.createElement),ra=!r&&!q(function(){return 7!=Object.defineProperty(ib?Y.createElement("div"):{},"a",{get:function(){return 7}}).a}),sa=Object.getOwnPropertyDescriptor;var ta=r?sa:function(a,b){if(a=E(F(a)),b=X(b),ra)try{return sa(a,b)}catch(c){}if(m(a,b))return ia(!D(Oa,a,b),a[b])};var Z={},jb=r&&q(function(){return 42!=Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),kb=f.String,lb=f.TypeError,H=function(a){if(u(a))return a;throw lb(kb(a)+" is not an object"); 34},mb=f.TypeError,aa=Object.defineProperty,nb=Object.getOwnPropertyDescriptor;Z.f=r?jb?function(a,b,c){if(H(a),b=X(b),H(c),"function"==typeof a&&"prototype"===b&&"value"in c&&"writable"in c&&!c.writable){var d=nb(a,b);d&&d.writable&&(a[b]=c.value,c={configurable:"configurable"in c?c.configurable:d.configurable,enumerable:"enumerable"in c?c.enumerable:d.enumerable,writable:!1})}return aa(a,b,c)}:aa:function(a,b,c){if(H(a),b=X(b),H(c),ra)try{return aa(a,b,c)}catch(d){}if("get"in c||"set"in c)throw mb("Accessors not supported"); 35return"value"in c&&(a[b]=c.value),a};var M=r?function(a,b,c){return Z.f(a,b,ia(1,c))}:function(a,b,c){return a[b]=c,a},ua={},ob=k(Function.toString);l(v.inspectSource)||(v.inspectSource=function(a){return ob(a)});var va=v.inspectSource,wa=f.WeakMap,pb=l(wa)&&/native code/.test(va(wa)),xa=V("keys"),ya={},qb=function(a){return xa[a]||(xa[a]=pa(a))},za=f.TypeError,rb=f.WeakMap;if(pb||v.state){var y=v.state||(v.state=new rb),sb=k(y.get),Aa=k(y.has),tb=k(y.set);var Ba=function(a,b){if(Aa(y,a))throw new za("Object already initialized"); 36return b.facade=a,tb(y,a,b),b};var ba=function(a){return sb(y,a)||{}};var Ca=function(a){return Aa(y,a)}}else{var A=qb("state");ya[A]=!0;Ba=function(a,b){if(m(a,A))throw new za("Object already initialized");return b.facade=a,M(a,A,b),b};ba=function(a){return m(a,A)?a[A]:{}};Ca=function(a){return m(a,A)}}var ub=ba,Da=Function.prototype,vb=r&&Object.getOwnPropertyDescriptor,wb=m(Da,"name")&&(!r||r&&vb(Da,"name").configurable),xb=String(String).split("String");(ua=function(a,b,c,d){var g=!!d&&!!d.unsafe, 37e=!!d&&!!d.enumerable,h=!!d&&!!d.noTargetGet;d=d&&void 0!==d.name?d.name:b;if(l(c)){"Symbol("===String(d).slice(0,7)&&(d="["+String(d).replace(/^Symbol\(([^)]*)\)/,"$1")+"]");(!m(c,"name")||wb&&c.name!==d)&&M(c,"name",d);var n=Ca(c)?ba(c):Ba(c,{});n.source||(n.source=xb.join("string"==typeof d?d:""))}a!==f?(g?!h&&a[b]&&(e=!0):delete a[b],e?a[b]=c:M(a,b,c)):e?a[b]=c:W(b,c)})(Function.prototype,"toString",function(){return l(this)&&ub(this).source||va(this)});var Ea={},yb=Math.ceil,zb=Math.floor,Fa= 38function(a){a=+a;return a!=a||0===a?0:(0<a?zb:yb)(a)},Ab=Math.max,Bb=Math.min,Cb=Math.min,Ga=function(a){return function(b,c,d){var g;b=E(F(b));var e=b.length;e=0<e?Cb(Fa(e),9007199254740991):0;d=Fa(d);d=0>d?Ab(d+e,0):Bb(d,e);if(a&&c!=c)for(;e>d;){if((g=b[d++])!=g)return!0}else for(;e>d;d++)if((a||d in b)&&b[d]===c)return a||d||0;return!a&&-1}},Db={includes:Ga(!0),indexOf:Ga(!1)}.indexOf,Ha=k([].push),Ia="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ").concat("length", 39"prototype");Ea.f=Object.getOwnPropertyNames||function(a){var b;a=E(F(a));var c=0,d=[];for(b in a)!m(ya,b)&&m(a,b)&&Ha(d,b);for(;Ia.length>c;)m(a,b=Ia[c++])&&(~Db(d,b)||Ha(d,b));return d};var Ja=Object.getOwnPropertySymbols;var Eb=k([].concat),Fb=Q("Reflect","ownKeys")||function(a){var b=Ea.f(H(a));return Ja?Eb(b,Ja(a)):b},Gb=/#|\.prototype\./,I=function(a,b){a=Hb[Ib(a)];return a==Jb||a!=Kb&&(l(b)?q(b):!!b)},Ib=I.normalize=function(a){return String(a).replace(Gb,".").toLowerCase()},Hb=I.data={},Kb= 40I.NATIVE="N",Jb=I.POLYFILL="P",Lb=ua,Mb=k([].join),Nb=E!=Object,Ob=function(a,b){var c=[][a];return!!c&&q(function(){c.call(null,b||function(){return 1},1)})}("join",",");(function(a,b){var c,d,g,e,h,n=a.target,p=a.global,w=a.stat;if(c=p?f:w?f[n]||W(n,{}):(f[n]||{}).prototype)for(d in b){if(e=b[d],g=a.noTargetGet?(h=ta(c,d))&&h.value:c[d],!I(p?d:n+(w?".":"#")+d,a.forced)&&void 0!==g){if(typeof e==typeof g)continue;for(var z=e,Ka=g,La=Fb(Ka),Pb=Z.f,Qb=ta,ca=0;ca<La.length;ca++){var da=La[ca];m(z,da)|| 41Pb(z,da,Qb(Ka,da))}}(a.sham||g&&g.sham)&&M(e,"sham",!0);Lb(c,d,e,a)}})({target:"Array",proto:!0,forced:Nb||!Ob},{join:function(a){return Mb(E(F(this)),void 0===a?",":a)}});var Na=function(a,b){for(var c,d=[],g=[0,0],e=0,h=a.length;e<h;++e)c=b(a[e]),Ma(B(c[0])-B(g[0]),d),Ma(B(c[1])-B(g[1]),d),g=c;return d.join("")},Ma=function(a,b){for(a=0>a?~(a<<1):a<<1;32<=a;)b.push(String.fromCharCode(63+(32|31&a))),a>>=5;return b.push(String.fromCharCode(a+63)),b},B=function(a){return Math.floor(Math.abs(a)+.5)* 42(0<=a?1:-1)};return C.decode=function(a,b){void 0===b&&(b=5);b=Math.pow(10,b);for(var c=a.length,d=Array(Math.floor(a.length/2)),g=0,e=0,h=0,n=0;g<c;++n){var p=1,w=0,z;
42do p+=(z=a.charCodeAt(g++)-63-1)<<w,w+=5;while(31<=z);e+=1&p?~(p>>1):p>>1;p=1;w=0;do p+=(z=a.charCodeAt(g++)-63-1)<<w,w+=5;while(31<=z);h+=1&p?~(p>>1):p>>1;d[n]=[e/b,h/b]}return d.length=n,d},C.encode=function(a,b){void 0===b&&(b=5);var c=Math.pow(10,b);return Na(a,function(d){return Array.isArray(d)||(d=[d.lat,d.lng]),[B(d[0]*c),B(d[1]* 43c)]})},C.polylineEncodeLine=Na,Object.defineProperty(C,"__esModule",{value:!0}),C}({});;/*</editor-fold desc="js_google_polyline.js">*/ 44/*<editor-fold desc="js_mapa_marcador.js">*//* 45 {ipm "async": false, "bundle": "mapas", "priority": 400} 46*/ 47var MapaMarcador=function(){this.longitude=this.latitude=0;this.titulo="";this.chave=this.icone=null;this.label="";this.arrastavel=!1;this.objetoOriginal=null}; 48MapaMarcador.prototype.carregaFromObjeto=function(a){Mapa.usaGoogleMaps()?(this.latitude=a.position.lat(),this.longitude=a.position.lng(),this.titulo=a.title,this.icone=a.icon,this.chave=a.chave,this.label=a.label):(this.latitude=a.lat,this.longitude=a.lng,this.titulo=a.title,this.icone=a.icon,this.chave=a.chave||a.data,this.label=a.label,this.arrastavel=a.arrastavel);this.objetoOriginal=a}; 49MapaMarcador.prototype.doSelecionaMarcador=function(){this.objetoOriginal&&this.objetoOriginal.doSelecionaMarcador&&this.objetoOriginal.doSelecionaMarcador()};MapaMarcador.prototype.doDeselecionaMarcador=function(){this.objetoOriginal&&this.objetoOriginal.doDeselecionaMarcador&&this.objetoOriginal.doDeselecionaMarcador()};;/*</editor-fold desc="js_mapa_marcador.js">*/ 50/*<editor-fold desc="js_mapas_objetos.js">*//* 51 {ipm "async": false, "bundle": "mapas", "priority": 400} 52*/ 53var ObjetoMapaBase=function(a,b,f){this.id=a;this.tipo=this.getTipo();this.dadosDesenho={objeto:b};this.dadosObjeto={titulo:this.getComplementoTitulo()+(a?parseInt(a.replace(/\D/g,""))+1:""),descricao:""};this.estilosObjeto={};this.readonly=!1;this._oComponente=f};ObjetoMapaBase.prototype.getComplementoTitulo=function(){return"Objeto "};ObjetoMapaBase.prototype.getTipo=function(){};ObjetoMapaBase.prototype.getAsObjeto=function(){return{id:this.id,tipo:this.tipo,dadosObjeto:this.dadosObjeto}}; 54ObjetoMapaBase.prototype.getObjetoMapa=function(){return this.dadosDesenho.objeto};ObjetoMapaBase.prototype.getIdObjeto=function(){return this.id};ObjetoMapaBase.prototype.getDadosObjeto=function(){return this.dadosObjeto};ObjetoMapaBase.prototype.setDadosObjeto=function(a){this.dadosObjeto||(this.dadosObjeto={});this.dadosObjeto=$.extend({titulo:this.dadosObjeto.titulo,descricao:this.dadosObjeto.descricao},a);this._oComponente.atualizaObjeto(this)}; 55ObjetoMapaBase.prototype.getDadoObjeto=function(a){this.dadosObjeto||(this.dadosObjeto={});return this.dadosObjeto[a]};ObjetoMapaBase.prototype.setDadoObjeto=function(a,b){this.dadosObjeto||(this.dadosObjeto={});this.dadosObjeto[a]=b;this._oComponente.atualizaObjeto(this)};ObjetoMapaBase.prototype.setEstiloObjeto=function(a,b){this.estilosObjeto[a]=b;this._oComponente.atualizaObjeto(this)};ObjetoMapaBase.prototype.setEstilosObjeto=function(a){this.estilosObjeto=$.extend(this.estilosObjeto,a);this._oComponente.atualizaObjeto(this)}; 56ObjetoMapaBase.prototype.getEstilosObjeto=function(){return this.estilosObjeto};ObjetoMapaBase.prototype.setSomenteLeitura=function(a){this.readonly=a;this._oComponente.atualizaObjeto(this)};ObjetoMapaBase.prototype.getSomenteLeitura=function(){return this.readonly};ObjetoMapaBase.TIPO_POLIGONO="P";ObjetoMapaBase.TIPO_CIRCULO="C";ObjetoMapaBase.TIPO_LINHA="L";ObjetoMapaBase.TIPO_MARCADOR="M";ObjetoMapaBase.ACAO_EDITAR_OBJETO_MAPA=928;ObjetoMapaBase.ACAO_REMOVER_OBJETO_MAPA=929; 57ObjetoMapaBase.encodePolyline=function(a){return googlePolyline.encode(a)};ObjetoMapaBase.decodePolyline=function(a){return googlePolyline.decode(a)}; 58var FactoryObjetoMapa=function(){this.criaObjetoPoligono=function(a,b,f,e,c){if(Mapa.usaGoogleMaps()){if(!b){b=new google.maps.Polygon;c=c.dadosDesenho.caminho;"string"==typeof c&&(c=google.maps.geometry.encoding.decodePath(c));if(!c||!c[0])return null;b.setPath(c)}return new ObjetoMapaGooglePoligono(a,b,f,e)}if(!b){b={};c=c.dadosDesenho.caminho;"string"==typeof c&&(c=ObjetoMapaBase.decodePolyline(c));if(!c||!c[0])return null;b.latlng=c}return new ObjetoMapaIpmPoligono(a,b,e)};this.criaObjetoLinha=
59function(a,b,f,e,c){if(Mapa.usaGoogleMaps()){if(!b){b=new google.maps.Polyline;c=c.dadosDesenho.caminho;"string"==typeof c&&(c=google.maps.geometry.encoding.decodePath(c));if(!c||!c[0])return null;b.setPath(c)}return new ObjetoMapaGoogleLinha(a,b,f,e)}if(!b){b={};c=c.dadosDesenho.caminho;"string"==typeof c&&(c=ObjetoMapaBase.decodePolyline(c));if(!c||!c[0])return null;b.latlng=c}return new ObjetoMapaIpmLinha(a,b,e)};this.criaObjetoMarcador=function(a,b,f,e,c){if(Mapa.usaGoogleMaps()){if(!b){b=new google.maps.Marker; 60var d=c.dadosDesenho.caminho;"string"==typeof d&&(d=google.maps.geometry.encoding.decodePath(d));if(!d||!d[0])return null;b.setPosition(d[0])}a=new ObjetoMapaGoogleMarcador(a,b,f,e)}else{if(!b){b={};d=c.dadosDesenho.caminho;"string"==typeof d&&(d=ObjetoMapaBase.decodePolyline(d));if(!d||!d[0])return null;b.latlng=d}a=new ObjetoMapaIpmMarcador(a,b,e)}e.getOpcoesFerramentasMapa().getLinkMarcador()&&a.setFormularioClick(e.getOpcoesFerramentasMapa().getLinkMarcador());c&&c.dadosDesenho&&(a.setCor(c.dadosDesenho.cor), 61a.setLabel(c.dadosDesenho.label));return a};this.criaObjetoCirculo=function(a,b,f,e,c){if(Mapa.usaGoogleMaps()){if(!b){b=new google.maps.Circle;var d=c.dadosDesenho.caminho;"string"==typeof d&&(d=google.maps.geometry.encoding.decodePath(d));if(!d||!d[0])return null;b.setCenter(d[0]);b.setRadius(c.dadosDesenho.raio)}return new ObjetoMapaGoogleCirculo(a,b,f,e)}if(!b){b={};d=c.dadosDesenho.caminho;"string"==typeof d&&(d=ObjetoMapaBase.decodePolyline(d));if(!d||!d[0])return null;b.latlng=d;b.radius=c.dadosDesenho.raio}return new ObjetoMapaIpmCirculo(a, 62b,e)}};FactoryObjetoMapa.criaObjeto=function(a,b,f,e,c,d,g){var h=new FactoryObjetoMapa;switch(a){case ObjetoMapaBase.TIPO_POLIGONO:a=h.criaObjetoPoligono(b,f,c,d,g);break;case ObjetoMapaBase.TIPO_LINHA:a=h.criaObjetoLinha(b,f,c,d,g);break;case ObjetoMapaBase.TIPO_MARCADOR:a=h.criaObjetoMarcador(b,f,c,d,g);break;case ObjetoMapaBase.TIPO_CIRCULO:a=h.criaObjetoCirculo(b,f,c,d,g);break;default:return null}a&&e&&a.setMapa(e);return a}; 63FactoryObjetoMapa.criaObjetoMapaFromJson=function(a,b,f,e){if("string"==typeof a)try{a=JSON.parse(a)}catch(c){return null}if(!a||!a.dadosDesenho)return null;b=FactoryObjetoMapa.criaObjeto(a.tipo,a.id,!1,b,f,e,a);b.setDadosObjeto(a.dadosObjeto);a.estilos&&b.setEstilosObjeto(a.estilos);a.readonly&&b.setSomenteLeitura(a.readonly);return b};FactoryObjetoMapa.criaObjetoMapaFromDesenho=function(a,b,f,e,c,d){return f?FactoryObjetoMapa.criaObjeto(a,b,f,e,c,d,!1):null}; 64function trataUnidadesDistanciaMapa(a){return 1E3<a?(a/1E3).toFixed(2)+" km":a.toFixed(2)+" m"}function trataUnidadesAreaMapa(a){return 1E3<a?(a/1E4).toFixed(2)+" ha":a.toFixed(2)+" m²"};;/*</editor-fold desc="js_mapas_objetos.js">*/
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.