(window.webpackJsonp=window.webpackJsonp||[]).push([[280],{1872:function(t,e,n){"use strict";n.r(e);n(6),n(5),n(7),n(12),n(8),n(13);var r=n(64),o=n(2),c=(n(138),n(4),n(78)),l=n(207),f=n.n(l),d=n(900);function m(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}function w(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?m(Object(source),!0).forEach((function(e){Object(o.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):m(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var y={name:"ExportarKMZAmbiental",props:{ids:{type:Array,default:function(){return[]}},filters:{type:Object,default:function(){}}},data:function(){return{downloading:!1}},computed:w({},Object(c.c)({empresa:"empresa/empresaAtual"})),methods:{handleExportKMZ:function(){var t=this;this.downloading=!0,this.$mapaService.exportarKmlsMapaAmbiental(this.empresa.sigla,w({},this.filters)).then(function(){var t=Object(r.a)(regeneratorRuntime.mark((function t(e){var data,n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return data=e.data,n=f()().format("DD-MM-YYYY_HH[h]mm"),r=new Blob([data],{type:"application/vnd.google-earth.kmz"}),t.next=5,Object(d.a)(r,"mapa-modulo-ambiental-".concat(n,".kmz"));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(e){t.$notifyApiError(e,"Erro ao exportar KMZ")})).finally((function(){t.downloading=!1}))}}},O=y,h=n(42),component=Object(h.a)(O,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("b-button",{staticClass:"mx-2 rounded",attrs:{size:"sm",variant:"outline-primary"},on:{click:t.handleExportKMZ}},[n("span",{staticClass:"mr-1"},[t.downloading?n("b-spinner",{attrs:{small:""}}):n("fa-icon",{attrs:{icon:"download"}})],1),t._v(" "),n("span",[t._v("Exportar KMZ")])])],1)}),[],!1,null,null,null);e.default=component.exports},900:function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"d",(function(){return o})),n.d(e,"c",(function(){return c})),n.d(e,"b",(function(){return l}));n(4),n(31),n(32),n(398),n(165),n(50);var r=function(t,e){return new Promise((function(n,r){try{var o=window.URL.createObjectURL(t),c=document.createElement("a");c.download=e,c.href=o,c.onerror=function(t){r(t)},document.body.appendChild(c),c.click(),document.body.removeChild(c),setTimeout((function(){window.URL.revokeObjectURL(o),n()}),100)}catch(t){r(t)}}))},o=function(t,e){var n="".concat(e,".zip"),o=new Blob([t],{type:"application/zip"});r(o,n)},c=function(t,e){var n="".concat(e,".pdf"),o=new Blob([t],{type:"application/pdf"});r(o,n)},l=function(t,e){var n="".concat(e,".xlsx"),o=new Blob([t],{type:"application/excel"});r(o,n)}}}]);
//# sourceMappingURL=3f3130f-1.2.11.js.map