isobit-ui 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/library.js +1 -1
- package/dist/library.mjs +1 -1
- package/dist/theme.css +34 -4518
- package/dist/types/index.d.ts +3 -6
- package/package.json +2 -2
package/dist/library.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var vue=require("vue"),axios$2=require("axios"),Observable=require("ol/Observable"),_imports_0=require("@/cdn/images/triangle-down.svg"),script$q={name:"InputText"};const _hoisted_1$g={type:"text"};function render$m(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("input",_hoisted_1$g)}script$q.render=render$m,script$q.__file="src/InputText.vue";var script$p={name:"InputTextarea"};function render$l(e,t,l,a,o,r){return" text "}script$p.render=render$l,script$p.__file="src/InputTextarea.vue";const _$2={stores:[],_id:0,axios_get:null,storeFunction:{},id:()=>_$2._id++},num=e=>e=e?""==e?null:Number(""+e):0,date=(e,t)=>{if(e){let l;if(e instanceof Date)l=e;else if("string"==typeof e){let t=e.split("T");l=t[0].split("-"),t.length>1?(t=t[1].split(":"),l=new Date(parseInt(l[0]),parseInt(l[1])-1,parseInt(l[2]),parseInt(t[0]),parseInt(t[1]),t.length>2?parseInt(t[2]):0)):l.length>2?l=new Date(parseInt(l[0]),parseInt(l[1])-1,parseInt(l[2])):(l=e.split(":"),l=l.length>2?new Date(1981,0,6,parseInt(l[0]),parseInt(l[1]),parseInt(l[2])):new Date(e))}else l=new Date(e);if(1==t)e=l;else if("time"===t)e=pad(l.getHours(),2)+":"+pad(l.getMinutes(),2)+":"+pad(l.setSeconds()?l.setSeconds():0,2);else if("time a"==t)if("string"==typeof e||e instanceof String){let t=(e=e.split(":"))[0];e=pad(t>12?t-12:t,2)+":"+e[1]+":"+e[2]+" "+(t>12?"PM":"AM")}else h=l.getHours(),e=pad(h>12?h-12:h,2)+":"+pad(l.getMinutes(),2)+(l.setSeconds()?":"+pad(l.setSeconds(),2):"")+" "+(h>12?"PM":"AM");else e="date-"==t?pad(l.getFullYear(),4)+"-"+pad(l.getMonth()+1,2)+"-"+pad(l.getDate(),2):"dMY"==t||"date"==t?pad(l.getDate(),2)+"/"+pad(l.getMonth()+1,2)+"/"+pad(l.getFullYear(),4):"datetime"==t?pad(l.getFullYear(),4)+"-"+pad(l.getMonth()+1,2)+"-"+pad(l.getDate(),2)+"T"+pad(l.getHours(),2)+":"+pad(l.getMinutes(),2)+":"+pad(l.setSeconds()?l.setSeconds():0,2):pad(l.getDate(),2)+"/"+pad(l.getMonth()+1,2)+"/"+pad(l.getFullYear(),4)+" "+pad(l.getHours(),2)+":"+pad(l.getMinutes(),2)}return e},whichChild=e=>{let t=0;for(;null!=(e=e.previousElementSibling);)++t;return t},mask=(e,t)=>{if(!document.body)return;let l,a=document.createElement("div");a.className="abc",a.style="top:50%;transform:translate(-50%,-50%);position:absolute;width:100%;z-index:2; display: flex;justify-content: center;";let o=a.style;if(o.left="50%",o.textAlign="center",!1!==e)if(e instanceof Element)a=e;else{if(e){let t=document.createElement("div");t.innerHTML=e,a.append(t),a.style="padding:4px;margin-bottom:5px;color:white;font-size:24px;text-align:center"}l=document.createElement("div"),o=l.style,l.className="loading"}let r=document.createElement("div");o=r.style,o.height="100%",o.top="0px",o.position="absolute",o.left="0",o.zIndex=1e4,o.width="100%";let n=document.createElement("div");return o=n.style,o.height="100%",o.width="100%",o.top="0",o.position="absolute",o.left="0",o.backgroundColor="rgba(0,0,0,0.5)",t&&t.opacity&&(o.opacity=t.opacity),t&&t.backgroundColor&&(o.backgroundColor=t.backgroundColor),r.appendChild(n),r.appendChild(a),l&&a.appendChild(l),document.body.appendChild(r),r},unmask=e=>{e&&(e.style.display="none",e.parentNode&&e.parentNode.removeChild(e))},isObject=e=>e&&"object"==typeof e&&!Array.isArray(e),mergeDeep$1=function(){let e=arguments[0],t=[];for(let e=1;e<arguments.length;e++)t.push(arguments[e]);if(!t.length)return e;let l,a=t.shift();if(isObject(e)&&isObject(a))for(let t in a)isObject(a[t])?(e[t]||(l={},l[t]={},Object.assign(e,l)),mergeDeep$1(e[t],a[t])):(l={},l[t]=a[t],Object.assign(e,l));let o=[];return o.push(e),o.concat(t),mergeDeep$1.apply(null,o)},buildPopupMenu=e=>{let t=e.getAttribute("v--popup");if(!t){e.setAttribute("v--popup",t=_$2.id());let l=_$2.storeFunction[t],a=e.querySelectorAll(".v-datatable-header .v-button");a&&a.length&&!l&&window.innerWidth<=700&&setTimeout((function(){l=document.createElement("ul"),l.className="v-popup-2",e.appendChild(l);let o=null;const r=e=>{l.style.display="none";let t=e.target.getAttribute("commandId"),a=document.querySelector("#"+t);"BUTTON"==a.tagName?a.click():a.children[0].click(),unmask(o)};e.style.position="relative";let n=document.createElement("div");n.className="v-mobil v-table-buttons";let s=document.createElement("i");s.className="fa fa-bars fa-w-14",n.appendChild(s),n.onclick=()=>{for(a=e.querySelectorAll(".v-datatable-header .v-button");l.firstChild;)l.removeChild(l.firstChild);for(s=0;s<a.length;s++)if("none"!=a[s].style.display){let e=document.createElement("li");if(a[s].id||(a[s].id="c-"+_$2.id()),e.setAttribute("commandId",a[s].id),"BUTTON"==a[s].tagName){if(a[s].disabled)continue;e.appendChild(a[s].children[0].cloneNode(!0)),e.appendChild(document.createTextNode(a[s].value?a[s].value:a[s].title))}else a[s].children[0].children[1]&&(e.appendChild(a[s].children[0].children[1]),e.appendChild(document.createTextNode(a[s].textContent)));e.onclick=r,l.appendChild(e)}o=mask(l),l.style.display="block",o.onclick=()=>{l.style.display="none",unmask(o)}},e.appendChild(n),_$2.storeFunction[t]=l}),500)}},resize=()=>{let e=window.innerHeight;document.body.children[0].style.height=e+".px";let t=document.querySelectorAll("#page-header,.ui-layout-north,.v-layout-north,.ion-page >ion-header");t=t[0];const l=document.querySelectorAll("#app > .ui-panel > .v-dialog-content > form > .v-datatable");if(l&&l[0])buildPopupMenu(l[0]);else{let e=document.querySelectorAll(".ion-page");if(e[0]){let t=0;for(let l=0;l<e[0].childNodes.length;l++)"ION-HEADER"!=e[0].childNodes[l].nodeName&&"ION-FOOTER"!=e[0].childNodes[l].nodeName||(t+=e[0].childNodes[l].offsetHeight);let l=0;for(kk=0;kk<e[0].childNodes.length;kk++){let a=e[0].childNodes[kk];if("ION-HEADER"==a.nodeName&&(l=1),1==l&&"ION-HEADER"!=a.nodeName&&"ION-FOOTER"!=a.nodeName&&a.style){a.style.height=e[0].offsetHeight-t+"px",a.style.overflowY="auto";break}}}else console.log(12)}},MsgBox$1=(e,t,l)=>{if(l||(l=["OK"]),!document.body)return;let a=document.createElement("div");a.classList.add("v-overlay"),a.style.padding="40px",a.style.zIndex="2000",document.body.appendChild(a);let o=document.createElement("div"),r=document.createElement("div"),n=document.createElement("div"),s=document.createElement("div");s.className="v-msgbox-buttons",o.classList.add("v-dialog"),o.classList.add("v-msgbox"),n.innerHTML=e,o.setAttribute("path",_$2.currentPath);let i=function(){o.style.display="none",a.style.display="none",o.parentNode.removeChild(o),a.parentNode.removeChild(a),t&&t(this.getAttribute("index"))};for(let e=0;e<l.length;e++){let t=document.createElement("button");t.innerHTML=l[e],t.type="button",t.setAttribute("index",e),t.className="v-button ui-widget ui-state-default ui-corner-all",s.appendChild(t),t.addEventListener("click",i)}r.className="v-dialog-content v-widget-content",r.appendChild(n),r.appendChild(s),o.appendChild(r),a.appendChild(o),a.style.visibility="unset",a.style.opacity="unset",a.style.overflow="auto",o.style.margin="0 auto",o.style.position="unset",resize()},configureAxios=e=>{let t;_$2.axios_get=e.get,e.interceptors.request.use((function(e){return _$2.eeee=e,e.mask?e.mask():t||(t=mask()),e}),(function(e){return t=unmask(t),MsgBox$1("request "+_$2.id()+" "+e.message),Promise.reject(e)})),e.interceptors.response.use((function(e){return t=unmask(t),e}),(function(l){if(e.error&&0==e.error(l))t=unmask(t);else{let e=l.response,a=e&&e.data&&e.data.msg?e.data.msg:l.message;if(e&&(e.data&&e.data.message&&(a=e.data.message),"string"==typeof e.data&&(a=e.data),a||(a=e.status+": "+e.statusText)),t=unmask(t),e&&401==e.status&&_$2.app)return _$2.app.toast("Session terminada"),void _$2.app.logout();l.config?.error?l.config.error(l,a):(console.log(l),l.request?MsgBox$1("<b>"+l.request.responseURL+"</b><br/><br/>"+a):MsgBox$1(a))}return delete e.error,Promise.reject(l)}))},pad=(e,t)=>{if(null!=e){let l=1*e+"";for(;l.length<t;)l="0"+l;return l}},clean=e=>{for(let t in e)""!==e[t]&&null!==e[t]&&"function"!=typeof e[t]&&void 0!==e[t]||delete e[t];return e},sum=e=>(void 0).reduce(((t,l)=>t+((l=e?l[e]:l)?Number(l):0)),0);function createGetters(){return{get networkStatus(){return _$2.app?.networkStatus||{connected:!0}},get db(){return _$2.app?.db},app:()=>(console.log("get.app="+_$2.app),_$2.app),setApp(e){_$2.app=e,console.log("setApp="+_$2.app)}}}const app=()=>_$2.app,db=()=>_$2.db,initDB=(e,t)=>{let l=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB;if(_$2.IDBTransaction=window.IDBTransaction||window.webkitIDBTransaction||window.msIDBTransaction,_$2.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange||window.msIDBKeyRange,l){if(l)return _$2.stores=t,new Promise(((a,o)=>{let r=l.open("db",e);r.onupgradeneeded=e=>{let l=e.target.result;t.forEach((e=>{l.objectStoreNames.contains(e[0])||l.createObjectStore(e[0],e[1])}))},r.onerror=e=>{o(e)},r.onsuccess=()=>{_$2.db=r.result,a(_$2.db)}}))}else window.alert("Your browser doesn't support a stable version of IndexedDB.");return l},getStoredList=async(e,t)=>{let l;try{l=JSON.parse(sessionStorage.getItem("loadedStores"))}catch(e){}null==l&&(l={});const a=db();if(!l[e]&&networkStatus.connected){let t=_$2.stores.filter((t=>t[0]==e))[0];if(!t)throw"store '"+e+"' undefined";if(!t[2])throw"store url for '"+e+"' is empty";let o=t[2]?await _$2.axios_get(t[2]):[];const r=a.transaction([t[0]],"readwrite").objectStore(t[0]);await r.clear(),o=o.data||o;for(let e in o)try{await r.add(o[e])}catch(e){throw e}l[e]=1,sessionStorage.setItem("loadedStores",JSON.stringify(l))}let o=new Promise(((t,l)=>{if(a){let l=a.transaction(e).objectStore(e).getAll();l.onsuccess=function(){t(l.result)}}else l("db is null")}));return await o},getters=createGetters(),{networkStatus:networkStatus,setApp:setApp}=getters;class HTML2Canvas{props;ctx;lineHeight;constructor(e){this.props=e,this.ctx=e.ctx,this.lineHeight=e.lineHeight?e.lineHeight:20}heightText(e,t){const{ctx:l,lineHeight:a}=this;let o="",r=a;return e.split("").forEach((e=>{o+=e,l.measureText(o).width>=t-15&&(o="",r+=a)})),r+=7,r}drawText(e,t,l,a,o,r){const{ctx:n,lineHeight:s}=this;let i="",d=s+l;return n.fillStyle="#000000",e.split("").forEach((e=>{i+=e,n.measureText(i).width>=a-15&&(n.fillText(i,t,d),i="",d+=s)})),n.fillText(i,t+("right"==r?a-n.measureText(i).width:0),d),n.beginPath(),d+=7,d}}var script$o={name:"VAutocomplete",props:{value:{type:Object,required:!0},data:{type:Array,default:()=>null},placeholder:String,label:String,default:Object,store:String,params:Object,autoload:{type:Boolean,default:!1},floating:{type:Boolean,default:!0},src:String,readonly:Boolean,nowrap:Boolean,disabled:Boolean,showSelection:{type:Boolean,default:!0},pagination:{type:Number,default:10}},setup(e,t){const{emit:l,slots:a}=t,o=vue.ref(0),r=vue.ref(null),n=vue.ref(-1),s=vue.ref(""),i=vue.ref(null),d=vue.ref(!1),c=vue.ref(0),u=vue.ref("");vue.watch((()=>e.value),(e=>{r.value=e})),vue.watch((()=>e.data),(e=>{i.value=e})),vue.onMounted((()=>{u.value=e.inputClass,e.autoload&&v(),document.addEventListener("click",m)})),vue.onBeforeUnmount((()=>{document.removeEventListener("click",m)}));const p=vue.computed((()=>{n.value=-1;const e=s.value?s.value.trim().toLowerCase().split(/[ ,]+/):null;return i.value&&s.value?i.value.filter((t=>{const l=JSON.stringify(t).toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"");return e.every((e=>l.includes(e)))})):i.value})),v=async t=>{const{src:a,source:r}=e;let n=Number(e.pagination);if(1===t)o.value+=n;else if(o.value=0,e.data&&e.autoload)return;let u={query:s.value};e.params&&(u=mergeDeep$1(u,e.params)),axios$2.get((a||e.source)+(n>0?"/"+o.value+"/"+n:""),{params:u}).then((l=>{const a=l.data;console.log(a),a.error?MsgBox(a.error):(i.value=1===t?i.value.concat(a.data?a.data:a):a.data?a.data:a,console.log(i),c.value=a.size,e.autoload||(d.value=!0),console.log("========================="))})).catch(h).then((()=>{l("complete",{data:i.value,query:s.value,target:"me"})}))},h=e=>{console.log(e)},m=e=>{};return{query:s,show:d,selected:r,data2:p,focused:n,inputClass:u,search:v,remove:()=>{l("input",null)},clickout:m,focusout:e=>{},setSelected:e=>{r.value=e,l("update:modelValue",e)},getLabel:t=>{if(e.label){const l=e.label.split(".");for(let e=0;e<l.length;e++)t&&(t=t[l[e]])}return t},hasSlot:(e="default")=>!!a[e]}}};const _withScopeId=e=>(vue.pushScopeId("data-v-72884078"),e=e(),vue.popScopeId(),e),_hoisted_1$f=["value","disabled"],_hoisted_2$a=_withScopeId((()=>vue.createElementVNode("i",{class:"fa fa-times"},null,-1))),_hoisted_3$7=[_hoisted_2$a],_hoisted_4$5=_withScopeId((()=>vue.createElementVNode("i",{class:"fa fa-xs fa-sync"},null,-1))),_hoisted_5$2=[_hoisted_4$5],_hoisted_6$1=["disabled","placeholder"],_hoisted_7$1={class:"v-list"},_hoisted_8=["onClick"],_hoisted_9={key:0,class:"center yellow",style:{padding:"5px"}};function render$k(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",{class:"v-autocomplete",onFocusout:t[7]||(t[7]=(...e)=>a.focusout&&a.focusout(...e)),value:l.value,disabled:l.disabled},[a.selected&&l.showSelection?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"v-selection",style:vue.normalizeStyle({whiteSpace:l.nowrap?"nowrap":""})},[vue.renderSlot(e.$slots,"label",{selected:a.selected}),vue.createTextVNode(" "+vue.toDisplayString(a.hasSlot("label")?" ":a.getLabel(a.selected))+" ",1),l.readonly?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("span",{key:0,onClick:t[0]||(t[0]=(...e)=>a.remove&&a.remove(...e)),class:"remove-icon"},[..._hoisted_3$7]))],4)):vue.createCommentVNode("v-if",!0),a.selected?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("span",{key:1,onClick:t[1]||(t[1]=(...e)=>a.search&&a.search(...e)),class:"search-icon"},[..._hoisted_5$2])),a.selected?vue.createCommentVNode("v-if",!0):vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{key:2,onKeyup:[t[2]||(t[2]=(...t)=>e.keyup&&e.keyup(...t)),t[3]||(t[3]=vue.withKeys(vue.withModifiers(((...e)=>a.search&&a.search(...e)),["stop","prevent"]),["enter"]))],class:vue.normalizeClass(a.inputClass),onFocus:t[4]||(t[4]=e=>a.show=!0),disabled:l.disabled,placeholder:l.placeholder,"onUpdate:modelValue":t[5]||(t[5]=e=>a.query=e)},null,42,_hoisted_6$1)),[[vue.vModelText,a.query]]),vue.createVNode(vue.Transition,{name:"fade",persisted:""},{default:vue.withCtx((()=>[vue.withDirectives(vue.createElementVNode("div",{class:"v-resultpane",style:vue.normalizeStyle({zIndex:2,width:"calc(100% - 2px)",position:l.floating?"absolute":"relative"})},[vue.createElementVNode("div",_hoisted_7$1,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(a.data2,((t,l)=>(vue.openBlock(),vue.createElementBlock("div",{key:l,class:vue.normalizeClass({"v-selected":a.selected==t,"v-focused":a.focused==l}),onClick:e=>a.setSelected(t)},[vue.renderSlot(e.$slots,"default",{row:t})],10,_hoisted_8)))),128)),e.data0&&e.data0.length<e.total?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"center",onClick:t[6]||(t[6]=e=>a.search(1))},"Load more "+vue.toDisplayString(e.total-e.data0.length)+" results...",1)):vue.createCommentVNode("v-if",!0)]),a.data2&&a.data2.length<1?(vue.openBlock(),vue.createElementBlock("div",_hoisted_9,"No results found.")):vue.createCommentVNode("v-if",!0)],4),[[vue.vShow,a.show&&!a.selected]])])),_:3})],40,_hoisted_1$f)}script$o.render=render$k,script$o.__scopeId="data-v-72884078",script$o.__file="src/v-autocomplete.vue";var script$n={name:"VButton",mounted(){var e=this,t=document.createElement("span"),l=document.createElement("i");t.className="ui-button-text ui-c ",t.innerHTML=e.$attrs.value?e.$attrs.value:"ui-button",e.$el.addEventListener("click",(t=>{t.component=e})),e.$attrs.icon?(e.$attrs.value?e.$el.classList.add("v-button-text-icon-left"):e.$el.classList.add("v-button-icon-only"),l.dataset.icon=e.$attrs.icon,l.className="fa "+e.$attrs.icon,e.$el.appendChild(l)):(t=document.createElement("span"),e.$el.classList.add("ui-button-text-only"),e.$el.appendChild(t)),e.$attrs.value&&((t=document.createElement("span")).appendChild(document.createTextNode(e.$attrs.value)),e.$el.appendChild(t)),e.updateIcon()},methods:{updateIcon(){var e=this;setTimeout((function(){var t=e.$el.querySelector("svg");if(t){var l=t.dataset;l.icon||(l.icon=e.$attrs.icon)}}),1e3)}}};const _hoisted_1$e={type:"button",class:"_ ui-widget ui-state-default ui-corner-all v-button"};function render$j(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("button",_hoisted_1$e)}script$n.render=render$j,script$n.__file="src/v-button.vue";var script$m={name:"VCalendar",props:{value:{value:String},type:String,required:String,readonly:String,max:String,min:String},data:()=>({value2:null}),methods:{enterD(){var e=event.target.value,t=this,l=t.toDate(e);return console.log(l),t.max&&l&&l.getTime()>=t.toDate(t.max).getTime()||t.min&&l&&l.getTime()<=t.toDate(t.min).getTime()?(t.$emit("invalid",{target:t,value:l}),l=null,void(event.target.value=l)):void("time"===t.$props.type?this.$emit("input",t.pad(l.getHours(),2)+":"+t.pad(l.getMinutes(),2)+":00"):l.getTime&&this.$emit("input",l.getTime()))},pad(e,t){for(var l=e+"";l.length<t;)l="0"+l;return l},toDate(e){if(e){var t,l;if("time"===this.$props.type)return t=e.split(":"),new Date(1981,1,6,parseInt(t[0]),parseInt(t[1]),t.length>2?parseInt(t[2]):0);if(!isNaN(e))return new Date(e);if("datetime-local"===this.$props.type)return t=(l=e.split("T"))[1].split(":"),l=l[0].split("-"),l=new Date(parseInt(l[0]),parseInt(l[1])-1,parseInt(l[2]),parseInt(t[0]),parseInt(t[1]),t.length>2?parseInt(t[2]):0);l=e.split("-");var a=parseInt(l[0]);return a<100?e:l=new Date(a,parseInt(l[1])-1,parseInt(l[2]))}return e},changeDate(){var e,t=this,l=t.toDate(t.value);l&&(e="time"===t.$props.type?t.pad(l.getHours(),2)+":"+t.pad(l.getMinutes(),2):"datetime-local"===t.$props.type?t.pad(l.getFullYear(),4)+"-"+t.pad(l.getMonth()+1,2)+"-"+t.pad(l.getDate(),2)+"T"+t.pad(l.getHours(),2)+":"+t.pad(l.getMinutes(),2):t.pad(l.getFullYear(),4)+"-"+t.pad(l.getMonth()+1,2)+"-"+t.pad(l.getDate(),2)),this.$el.children[0].value=e}},updated(){this.changeDate()},mounted(){this.changeDate()}};const _hoisted_1$d=["value"],_hoisted_2$9=["required","readonly","min","max","type"];function render$i(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",{value:r.toDate(l.value)},[vue.createElementVNode("input",{required:l.required,readonly:l.readonly,min:l.min,max:l.max,onChange:t[0]||(t[0]=(...e)=>r.enterD&&r.enterD(...e)),type:l.type?l.type:"date"},null,40,_hoisted_2$9)],8,_hoisted_1$d)}script$m.render=render$i,script$m.__file="src/v-calendar.vue";var script$l={name:"VCheckboxGroup",props:{required:String,name:String},data:()=>({value:[],options:[],nam:null}),created(){this.nam||(this.nam=this.$props.name?this.$props.name:"input_"+_.id()),this.update2()},updated(){this.update2()},mounted(){this.options=this.$el.querySelectorAll("input:not(.v-chk)");for(var e=0;e<this.options.length;e++)this.options[e].classList.add("v-chk");this.update2()},methods:{update2(){var e=this.options,t=this.$attrs.value;"string"==typeof t&&(t=t.split("|"));for(var l=0;l<e.length;l++){e[l].checked=!1;for(var a=0;t&&a<t.length;a++)e[l].value==t[a]&&(e[l].checked=!0)}},onChange:function(e,t){var l=this,a=l.$attrs.value;if(("string"==typeof a||a instanceof String)&&(a=a.split("|")),t)a||(l.$attrs.value=a=[]),a.push(e);else{var o=a.indexOf(e);o>-1&&a.splice(o,1)}l.$emit("input",a)}}};function render$h(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",null,[vue.renderSlot(e.$slots,"default")])}script$l.render=render$h,script$l.__file="src/v-checkbox-group.vue";var script$k={name:"VCheckbox",model:{prop:"vmodel",event2:"change"},props:{value:null,vmodel:null,valueFalse:null,label:null,readonly:null},data:()=>({input:null,hadValue:0}),mounted(){var e=this,t=e.$el.querySelector("input");e.$parent&&e.$parent.nam&&(t.name=e.$parent.nam),e.input=t,e.$parent.onChange||(t.checked=e.value&&e.value==e.vmodel||""+e.vmodel=="true"||""+e.vmodel=="1"),e.$parent.$emit("mounted",e),e.$parent.update2&&e.$parent.update2()},updated(){var e=this;e.input.checked=e.value&&e.value==e.vmodel||""+e.vmodel=="true"||""+e.vmodel=="1"},methods:{change(){var e=this;if(!e.readonly){var t=e.$el.querySelector("input");e.$parent.onChange&&e.$parent.onChange(e.value,t.checked);var l=t.checked?e.value?e.value:t.checked:null!==e.valueFalse&&void 0!==e.valueFalse?e.valueFalse:t.checked;l&&(e.hadValue=1),console.log("nv="+l),e.$emit("input",l)}},getLabel(){var e=this.value;return this.label?this.label:e&&"string"==typeof e?e:""},onClick(e){return this.readonly&&e.preventDefault(),!1}}};const _hoisted_1$c={style:{"font-weight":"normal !important",display:"block"},class:"v-checkbox"},_hoisted_2$8=["innerHTML"],_hoisted_3$6=["checked","value"],_hoisted_4$4=vue.createElementVNode("span",{class:"checkmark"},null,-1);function render$g(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("label",_hoisted_1$c,[vue.createElementVNode("span",{innerHTML:r.getLabel()},null,8,_hoisted_2$8),vue.createElementVNode("input",{type:"checkbox",checked:l.value&&l.vmodel==l.value||l.vmodel,onChange:t[0]||(t[0]=(...e)=>r.change&&r.change(...e)),value:l.value},null,40,_hoisted_3$6),_hoisted_4$4])}script$k.render=render$g,script$k.__file="src/v-checkbox.vue";var script$j={name:"VDataview",props:{value:Array,filterKey:String,src:String,filters:Object,store:null,itemWidth:null,rowKey:String,rowStyleClass:null,pagination:null,selectable:Boolean,scrollable:Boolean,autoload:{type:Boolean,default:!0}},data:function(){return{data:null,pages:1,page:1,columns:1,w:0,row:{},error:null,size:null,sortKey:"",selected:[],sortOrders:{},rowStyleClassFunc:null}},created(){var me=this;try{me.rowStyleClass&&(eval("me.rowStyleClassFunc=function(row,item,index){return "+me.rowStyleClass+"}"),me.rowStyleClassFunc({},{},0))}catch(e){me.rowStyleClassFunc=null,console.log("Error en la expresion rowStyleClassFunc=function(row,item,index){return "+me.rowStyleClass+"}")}},updated(){console.log("updated"),this.$emit("updated"),this.resize()},mounted(){var e=this;e.$el.addEventListener("parentResize2",e.resize),e.autoload&&e.load(),e.resize()},methods:{resize(){var e=this;if(e.itemWidth){var t=1+Math.trunc(e.$el.offsetWidth/Number(e.itemWidth));t>6&&(t=6),e.columns=t}},async getStoredList(e){let t=new Promise((t=>{var l=window._.db.transaction(e).objectStore(e).getAll();l.onsuccess=function(){t(l.result)}}));return await t},async loadStore(){let e=this,t=e.store;if(null!=t){let l;return window._.db&&(l=await e.getStoredList(t)),l||(l=[]),e.data=e.data?l.concat(e.data):l,console.log("loadStore"),console.log(e.data),e.data}},getRowClass(e,t){var l=this,a=t%l.columns+1,o=["c-w-"+l.columns];return a==l.columns&&o.push("v-last"),l.rowStyleClassFunc?o.push(l.rowStyleClassFunc(e,e,t)):o.push(l.rowStyleClass),o},remove(e){e=e.id?e.id:e;var t=this.data,l=t.map((e=>e.id)).indexOf(e);t.splice(l,1)},error2(e,t){this.data=[],this.error=t},load(e){var t=this;if(this.selected=[],t.value)t.data=t.value;else{!0===e&&(t.page=1);var l=t.src;l||(l=t.$root.apiLink(window.location.pathname)),l.endsWith("/")&&(l=l.slice(0,l.length-1)),t.pagination&&(l+="/"+(t.page-1)*t.pagination+"/"+t.pagination),axios.get(l,{error:t.error2,params:t.filters}).then((function(l){if(l.data&&l.data.error)MsgBox(l.data.error);else{var a=t.value?t.value:l.data.data?l.data.data:l.data;t.data||(t.data=[]),t.data=!0===e?a:t.data?t.data.concat(a):t.data,t.size=l.data.size,l.data&&l.data.size&&(t.pages=Math.ceil(l.data.size/t.pagination),t.page>t.pages&&(t.page=1)),t.$emit("loaded",{target:t,response:l})}})).catch(t.error)}}}};const _hoisted_1$b={class:"v-dataview"};function render$f(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$b,[e.data?(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:0},vue.renderList(e.data,((t,l)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(r.getRowClass(t,l))},[vue.renderSlot(e.$slots,"default",{row:t,item:t,index:l})],2)))),256)):vue.createCommentVNode("v-if",!0),e.data&&!e.data.length?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(["center v-no-results",{error:e.error}])},vue.toDisplayString(e.error?e.error:"No existen registros para mostrar"),3)):vue.createCommentVNode("v-if",!0),e.data&&e.size>e.data.length?(vue.openBlock(),vue.createElementBlock("div",{key:2,onClick:t[0]||(t[0]=t=>r.load(e.page++)),class:"center v-more-results"},"Ver mas resultados")):vue.createCommentVNode("v-if",!0)])}script$j.render=render$f,script$j.__file="src/v-dataview.vue";var script$i={name:"VFieldset",props:{legend:String,closable:null},watch:{closed(e){this.$emit("change",{target:this,closed:e}),this.$emit("input",!e)}},data:()=>({closed:!1}),created(){this.closed=this.closable},mounted(){var e=this;e.$el.addEventListener("parentResize",(t=>{t.$target=e,e.$emit("resize",t)}))},updated(){var e=this;setTimeout((function(){var t=e.$el.querySelector("legend > * > svg");if(t)try{console.log(),t.dataset.icon=t.parentNode.dataset.icon}catch(e){console.log("icon"),console.log(e)}}),50)}};const _hoisted_1$a={class:"v-fieldset"},_hoisted_2$7=["data-icon"],_hoisted_3$5=["innerHTML"],_hoisted_4$3={style:{flex:"1",display:"flex","flex-direction":"column"}};function render$e(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("fieldset",_hoisted_1$a,[l.legend?(vue.openBlock(),vue.createElementBlock("legend",{key:0,onClick:t[0]||(t[0]=e=>o.closed=l.closable&&!o.closed),style:vue.normalizeStyle({cursor:l.closable?"pointer":""})},[l.closable?(vue.openBlock(),vue.createElementBlock("span",{key:0,"data-icon":o.closed?"plus":"minus",style:{margin:"0px 5px 0px 0px"}},[vue.createElementVNode("i",{class:vue.normalizeClass([o.closed?"fa-plus":"fa-minus","fa"])},null,2)],8,_hoisted_2$7)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("span",{innerHTML:l.legend},null,8,_hoisted_3$5)],4)):vue.createCommentVNode("v-if",!0),vue.withDirectives(vue.createElementVNode("div",_hoisted_4$3,[vue.renderSlot(e.$slots,"default")],512),[[vue.vShow,!o.closed]])])}script$i.render=render$e,script$i.__file="src/v-fieldset.vue";var script$h={name:"VForm",props:["header","store","action"],setup(e,t){const{slots:l,expose:a}=t;return a({abc:()=>{alert(8)},...e}),()=>{const t=[];return e.header&&t.push(vue.h("div",{class:"v-widget-header v-panel-titlebar"},[vue.h("span",{class:"v-panel-title"},e.header)])),t.push(vue.h("div",{class:"v-dialog-content v-widget-content"},[vue.h("form",{action:e.action},l.default())])),vue.h("div",{class:"ui-panel"},t)}},watch:{header(e){this.setTitle(e)}},data:()=>({timer:null}),methods:{setTitle(e){var t=this.$parent.app;t&&setTimeout((()=>{t.title=e}),100)},getAbsoluteHeight(e){var t=window.getComputedStyle(e),l=parseFloat(t.marginTop)+parseFloat(t.marginBottom);return Math.ceil(e.offsetHeight+l)},resize(e){var t=this,l=t.$el,a=e.height;l.style.height=a+"px",t.timer&&clearTimeout(t.timer),t.timer=setTimeout((()=>{if(l.parentElement){var e;if(l.children[1])a-=l.children[0].offsetHeight,l.children[1].style.height=a+"px",l.children[1].style.overflowY="auto",(l=l.children[1].children[0]).style.height=a+"px",l.children&&(l.parentNode.style.overflowY="hidden",l.parentNode.style.overflow="hidden"),[].forEach.call(l.children,((o,r)=>{r==l.children.length-1&&"CENTER"==o.tagName||!o.classList.contains("v-scrollable")&&!o.classList.contains("v-form")&&!o.classList.contains("v-resize")?a-=t.getAbsoluteHeight(o):e||(e=o)})),l=e;else(l=l.children[0]).style.height=a+"px";if(l){l.style.overflowY="auto",l.style.height=a+"px";var o=new Event("parentResize",{bubbles:!0});o.height=a,l.children[0].dispatchEvent(o),o.$target=t,t.$emit("resize",o)}}}),500)}},mounted(){var e=this;e.$el.querySelector("form").addEventListener("submit",(t=>{t.preventDefault();var l=e.$parent;return l.refresh&&l.refresh(),!1})),e.setTitle(e.header),e.$el.addEventListener("parentResize",(t=>{t.target==e.$el&&e.resize(t)}))},beforeUnmount(){console.log("unmounted")},updated(){for(var e=this,t=e.$el.querySelectorAll("[type=number]:not(._)"),l=0;l<t.length;l++){var a=()=>{var e=this,t=e.value;if(t){t=n(t),e.max&&t>n(e.max)&&(t=n(e.max)),e.min&&t<n(e.min)&&(t=n(e.min));var l=this.getAttribute("decimal");null!==l&&(t=t.toFixed(1*l)),e.value=t}};t[l].oninput=a,t[l].onblur=a,t[l].classList?t[l].classList.add("_"):t[l].className="_"}t=e.$el.querySelectorAll(".numeric:not(._)");for(l=0;l<t.length;l++)t[l].addEventListener("keyup",(e=>{86==e.keyCode&&isNaN(this.value)&&(this.value="")})),t[l].addEventListener("keydown",(e=>{console.log("eeeeeee"+e.keyCode),-1!==[46,8,9,27,13,110,88,86].indexOf(e.keyCode)||65===e.keyCode&&(!0===e.ctrlKey||!0===e.metaKey)||e.keyCode>=35&&e.keyCode<=40||(e.shiftKey||e.keyCode<48||e.keyCode>57)&&(e.keyCode<96||e.keyCode>105)&&e.preventDefault()})),t[l].classList?t[l].classList.add("_"):t[l].className="_";var o=function(e){var t=this,l=t.previousElementSibling;if(l&&l.classList&&l.classList.contains("v-error")&&l.parentNode.removeChild(l),!t.disabled&&!t.getAttribute("disabled")&&(t.required||"DIV"===t.tagName)&&("DIV"!=t.tagName&&!t.value||"DIV"===t.tagName&&!t.attributes.value)){for(l=t.previousElementSibling;l&&1!=l.nodeType;)l=l.previousElementSibling;if(!l)for(l=t.parentElement.previousElementSibling;l&&1!=l.nodeType;)l=l.previousElementSibling;var a=document.createElement("div");a.innerHTML="Este campo es requerido!",a.classList.add("v-error"),t.parentNode.insertBefore(a,t)}};e.$el.querySelectorAll("select,input[type=date]:not(.__),input[type=text]:not(.__),textarea:not(.__)").forEach((e=>{e.addEventListener("focusout",o),e.classList?e.classList.add("__"):e.className="__"}))},__file:"src/v-form.vue"},script$g={name:"VGroup",props:{required:String,name:String},data:()=>({value:null,nam:null}),updated(){this.update2()},mounted(){this.update2()},created(){this.nam||(this.nam=this.$props.name?this.$props.name:"input_"+window._.id())},methods:{getInputs(e,t){var l=this;return e.children&&Array.from(e.children).forEach((e=>{"INPUT"==e.tagName?t.push(e):e.classList.contains("v-group")||l.getInputs(e,t)})),t},update2(){for(var e=this.getInputs(this.$el,[]),t=0;t<e.length;t++)e[t].value==this.$attrs.value?e[t].checked=!0:e[t].checked=!1},onChange(e){this.value=e,""===e&&(e=null),this.$emit("input",e)}}};const _hoisted_1$9={class:"v-group"};function render$d(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$9,[vue.renderSlot(e.$slots,"default")])}script$g.render=render$d,script$g.__file="src/v-group.vue";var script$f={name:"VLayerControl",data:()=>({loaded:null,map:null,feature2:null,district:null,pl:null,selection:null,dl:null,scope:null,lastScope:null,unmove:null}),methods:{setScope(e,t){var l=this,a=l.map;if(console.log("me.map="+l.map),e!=l.lastScope)if(e<100&&(e*=1e4),l.scope=e,0==l.scope)a.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],a.getSize()),l.lastScope=e,a.getLayerById("districts").getSource().clear(),l.$emit("scope",{feature:{getId:()=>null},target:l});else if(a){if(e>9999){for(var o=a.getLayerById("districts"),r=o.getSource().getFeatures(),n=0;n<r.length;n++)if(1*r[n].id_==e){o.onChange({feature:r[n]});break}}else if(e){var s=a.getLayerById("provinces");for(e=1*(e.value?e.value:e),r=s.getSource().getFeatures(),n=0;n<r.length;n++)if(1*r[n].id_==e){s.onChange({feature:r[n]});break}}}else l.lastScope=e;else a.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],a.getSize())}},created(){var e=this;return e.$parent.$on("build",(t=>{var l=document.createElement("i"),a=t.map;e.selection=new ol.Collection;var o=e.selection;l.setAttribute("class","fa fa-expand"),a.addControl(new ol.control.FullScreen({label:l,tipLabel:"Fullscreen"}));var r=new ol.source.Vector({url:(axios.defaults.baseURL?axios.defaults.baseURL:"")+"/fs/geo/02.geojson",format:new ol.format.GeoJSON}),n=e.pl=new ol.layer.Vector({source:r,style:e=>new ol.style.Style({fill:new ol.style.Fill({color:"rgba(255, 0, 0, 0.0)"}),stroke:new ol.style.Stroke({color:"#4073CE",width:1}),text:new ol.style.Text({text:e.values_.name?e.values_.name.toUpperCase():"",fill:new ol.style.Fill({color:"#4073CE"}),stroke:new ol.style.Stroke({color:"#4073CE",width:.5})})}),id:"provinces"}),s=r.on("change",(()=>{var t=e.scope;t>9999&&(t=Math.floor(t/100));for(var l=r.getFeatures(),a=0;a<l.length;a++)if(1*l[a].id_==1*t){n.onChange({feature:l[a]});break}Observable.unByKey(s)})),i=new ol.layer.Vector({preload:1/0,source:new ol.source.Vector,id:"districts",style:e=>new ol.style.Style({fill:new ol.style.Fill({color:"rgba(16, 110, 138, 0.0)"}),stroke:new ol.style.Stroke({color:"#194300",width:1}),text:new ol.style.Text({text:e.values_.name?e.values_.name.toUpperCase():"",fill:new ol.style.Fill({color:"#194300"}),stroke:new ol.style.Stroke({color:"#194300",width:.5})})})}),d=()=>{if(e.feature2){if(e.feature2.id_<1e4){i.setSource(new ol.source.Vector({url:(axios.defaults.baseURL?axios.defaults.baseURL:"")+"/fs/geo/"+e.feature2.id_+".geojson",format:new ol.format.GeoJSON}));var t=i.getSource().on("change",(()=>{if(e.scope>0)for(var l=i.getSource().getFeatures(),a=e.scope,o=0;o<l.length;o++)if(1*l[o].id_==a){e.scope=0,i.onChange({feature:l[o]});break}Observable.unByKey(t)}))}e.$emit("scope",{feature:e.feature2,target:e}),e.feature2=null}};a.on("moveend",d),n.onChange=t=>{var l=t.feature;e.lastScope!=l.getId()&&(o.clear(),o.push(l),t.preventDefault&&t.preventDefault(),e.lastScope=l.getId(),e.feature2=l,e.unmove?d():a.getView().fit(l.getGeometry().getExtent(),{duration:300}))},n.onSelect=t=>{e.$emit("select",t)},a.addLayer(n),a.addLayer(new ol.layer.Vector({id:"district",source:new ol.source.Vector,style:new ol.style.Style({fill:new ol.style.Fill({color:"rgba(255, 150, 150, 0.0)"}),stroke:new ol.style.Stroke({color:"#4073CE",width:1})})})),new ol.style.Style({fill:new ol.style.Fill({color:"rgba(16, 110, 138, 5.0)"})}),new ol.style.Style({fill:new ol.style.Fill({color:"rgba(255, 150, 150, 0.0)"})}),i.onChange=t=>{var l=t.feature;e.lastScope!=l.getId()&&(2==o.getLength()&&o.pop(),o.push(l),t.preventDefault&&t.preventDefault(),e.lastScope=l.getId(),e.feature2=l,e.unmove?d():a.getView().fit(l.getGeometry().getExtent(),{duration:300}))},i.onSelect=t=>{e.$emit("select",t)},a.addLayer(i),e.map=a,e.$emit("render",e)})),null}};function render$c(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",null,[vue.renderSlot(e.$slots,"default")])}script$f.render=render$c,script$f.__file="src/v-layer-control.vue";var script$e={name:"VMapControl",props:{icon:String,visible:{default:1}},computed:{slotPassed(){return!!this.$slots.default}},data:()=>({ready:null,visible0:null,slotUsed:!1}),updated(){var e=this.$el.querySelectorAll(":scope > :not(.v-map-control-button)").length;0==e&&(e=this.$el.textContent.trim().length),this.slotUsed=e},created(){this.visible0=!!this.visible},mounted(){let e=this,t=window.ol;e.slotUsed=!!this.$slots.default,e.$parent.map?(e.$parent.map.addControl(new t.control.Control({element:e.$el})),e.ready=!0):e.$parent.$on("build",(l=>{l.map.addControl(new t.control.Control({element:e.$el})),e.ready=!0}))},methods:{enter(e){e.x&&this.$emit("click",e)},toggle(){this.visible0=!this.visible0}}};const _hoisted_1$8={class:"ol-unselectable ol-control"};function render$b(e,t,l,a,o,r){return vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",_hoisted_1$8,[vue.renderSlot(e.$slots,"default"),o.slotUsed?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("button",{key:0,class:"v-map-control-button",onClick:t[0]||(t[0]=vue.withModifiers(((...e)=>r.enter&&r.enter(...e)),["prevent"]))},[l.icon?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:vue.normalizeClass(["fa fa-xs",l.icon])},null,2)):vue.createCommentVNode("v-if",!0)]))],512)),[[vue.vShow,o.ready&&o.visible0]])}script$e.render=render$b,script$e.__file="src/v-map-control.vue";var script$d={name:"VMap",mounted(){this.$emit("beforeBuild"),this.build()},data:()=>({moved:!1,map:null,movingCompleted:null,collection:null,styleMap:null,coordinate:{}}),methods:{addLayer(e){this.map.addLayer(e),this.$emit("addlayer",e)},urlParam(e,t){t||(t=window.location.href);var l=new RegExp("[?&]"+e+"=([^&#]*)").exec(t);return l&&l[1]||0},addFeature(e,t){let l=window.ol;e=e||{};var a,o=this,r=o.map;if(e.lon&&e.lat){var n=[e.lon,e.lat];a=new l.geom.Point(n[0]>-100?l.proj.fromLonLat(n):n)}else a=new l.geom.Point(r.getView().getCenter());n=(n=a.flatCoordinates)[0]<-1e4?l.proj.toLonLat(n):n;o.$emit("translateend",{lon:n[0],lat:n[1]}),e.geometry=a;var s=new l.Feature(e);if(s.data=e,e.draggable){var i=new l.Collection;i.push(s);var d=new l.interaction.Translate({features:i});d.on("translateend",(e=>{var t=l.proj.toLonLat(e.coordinate);o.$emit("translateend",{lon:t[0],lat:t[1]})})),d.on("translatestart",(e=>{o.selectedFeature=e.features.getArray()[0]})),s.interactionCollection=i,o.map.addInteraction(d)}if("object"==typeof e.style?s.setStyle(e.style):s.setStyle(o.styleMap[e.style?e.style:"default"]),n=(n=a.flatCoordinates)[0]<-1e4?l.proj.toLonLat(n):n,o.$emit("translateend",{lon:n[0],lat:n[1]}),null!=e.layer){var c=r.getLayerById(e.layer);c?c.getSource().addFeatures(s):r.addLayer(new l.layer.Vector({id:e.layer,source:new l.source.Vector({features:new l.Collection([s])})}))}else o.collection.push(s);return t&&(console.log(s.getGeometry().getCoordinates()),o.map.getView().animate(Object.assign({center:s.getGeometry().getCoordinates(),zoom:17,duration:500},t))),s},animate(e){this.map.getView().animate(e),this.movingCompleted=e.complete},build(){var e=this,t=window.ol;e.styleMap={default:new t.style.Style({image:new t.style.Circle({radius:8,stroke:new t.style.Stroke({color:"#8a0000",width:2}),fill:new t.style.Fill({color:"#ff0000"})})}),star:[new t.style.Style({image:new t.style.RegularShape({fill:new t.style.Fill({color:"#ff0000"}),stroke:new t.style.Stroke({color:"#8a0000",width:2}),points:5,radius:10,radius2:4,angle:0})})]};var l=e.urlParam("location"),a=-1;if(l){var o=l.split("/");l=[parseFloat(o[0]),parseFloat(o[1])],a=o[2],e.moved=!0}else l=!1;console.log("w="+e.$el.clientHeight+";h="+e.$el.clientWidth);var r=new t.Map({target:e.$el,layers:[new t.layer.Tile({source:new t.source.OSM({})})],view:new t.View({})});new ResizeObserver((t=>{console.log("w="+e.$el.clientHeight+";h="+e.$el.clientWidth),r.updateSize()})).observe(e.$el),r.getLayerById=function(e){var t;return r.getLayers().forEach((l=>{l.get("id")!==e||(t=l)})),t},r.styleMap=e.styleMap,r.addLayer(new t.layer.Vector({source:new t.source.Vector({features:e.collection=new t.Collection})})),e.moved?(r.getView().setCenter(l),r.getView().setZoom(a||12),e.map=r,console.log("distarar evento buid pageLocation="+l),e.$emit("build",e)):(console.log("En caso no exista una coordenada se usara se fijara a los limites de la region"),_.getCurrentPosition().then((l=>{r.getView().setCenter(t.proj.fromLonLat([l.coords.longitude,l.coords.latitude])),r.getView().setZoom(12),e.map=r,e.$emit("build",e)}),(t=>{r.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],r.getSize()),e.map=r,e.$emit("build",e)})));var n=r.getView().getZoom();r.on("moveend",(t=>{this.movingCompleted&&(this.movingCompleted(e),this.movingCompleted=null);var l=r.getView().getZoom();n!=l&&(n=l,e.$children.forEach((function(e){e.$vnode.tag.endsWith("v-overlay")&&e.$emit("zoom",l)})))})),r.on("singleclick",(e=>{var t=r.forEachFeatureAtPixel(e.pixel,((e,t)=>{if(t)return[e,t]}));if(t){var l=t[1];t=t[0];if(e.feature=t,e.map=r,e.preventDefault(),l.onSelect)return void l.onSelect(e)}})),r.on("dblclick",(t=>{var l=r.forEachFeatureAtPixel(t.pixel,((e,t)=>{if(t)return[e,t]}));if(l){var a=l[1];l=l[0];if(t.feature=l,t.map=r,a.onChange)return console.log("dbclick manda event onchangue"),void a.onChange(t);e.$emit("change",l),r.getView().animate({center:l.getGeometry().getCoordinates(),zoom:17,duration:500},(()=>{for(var l=0;l<e.$children.length;l++){var a=e.$children[0];a.open&&a.open(t)}}))}})),r.getViewport().parentNode.addEventListener("parentResize",(t=>{setTimeout((()=>{r.updateSize(),e.$emit("resize",r)}),100)})),Vue.resize()}}};function render$a(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",null,[vue.renderSlot(e.$slots,"default")])}script$d.render=render$a,script$d.__file="src/v-map.vue";var script$c={name:"VNumber",props:{value:Number,max:Number,min:Number,delay:Number},setup(e,t){const{emit:l}=t,a=vue.ref(null);vue.onMounted((()=>{a.value=e.value})),vue.onUpdated((()=>{a.value=t.attrs.modelValue}));return{v:a,handleInput:t=>{let o=a.value;const r=t.target.getAttribute("decimal");null!==o?(o=num(o),e.max&&o>num(e.max)&&(o=num(e.max)),e.min&&o<num(e.min)&&(o=num(e.min)),null!==r&&(o=o.toFixed(Number(r)))):o=null,a.value=t.target.value;let n=_$2.calendarTimer;n&&clearTimeout(n),e.delay?_$2.calendarTimer=setTimeout((()=>{l("input",o),_$2.calendarTimer=null}),13===t.keyCode?0:e.delay):l("input",o)}}}};function render$9(e,t,l,a,o,r){return vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{type:"number",onKeyup:t[0]||(t[0]=vue.withKeys(((...e)=>a.handleInput&&a.handleInput(...e)),["enter"])),"onUpdate:modelValue":t[1]||(t[1]=e=>a.v=e),onInput:t[2]||(t[2]=(...e)=>a.handleInput&&a.handleInput(...e)),class:"_"},null,544)),[[vue.vModelText,a.v,void 0,{number:!0}]])}script$c.render=render$9,script$c.__file="src/v-number.vue";var script$b={setup(e,t){const l=e,{displayField:a,store:o,filter:r}=l,{expose:n,emit:s}=t,i=vue.ref([]),d=vue.ref([]),c=vue.ref([]);vue.ref(null),vue.ref(null);const u=vue.inject("collect"),p=vue.computed((()=>d.value&&r?d.value.filter((e=>-1!==JSON.stringify(e).toLowerCase().indexOf(r.toLowerCase()))):d.value)),v=(e,t)=>{const l=c.value;if(l&&l.length)for(var a=0;a<l.length;a++)e&&(e=e[l[a]]);else e&&!t&&(e=e.id?e.id:e.code?e.code:e);return e},h=async(e=null,t=null,a=!1)=>{if(!a&&t&&e&&i.value.push([e,t]),!(i.value.length>1)){if(d.value=[],d.value||(d.value=[]),l.store){let t=await getStoredList(l.store);const[a]=e?Object.keys(e):[];if(a){let l;try{d.value=t.filter((t=>(l=t,l[a].startsWith(e[a]))))}catch(e){console.log("Error trying to filter ",l),console.error(e)}}else d.value=d.value.concat(t)}for(u(p),a||i.value.shift();i.value.length;){const e=i.value.shift()||[];await h(e[0],e[1],!0)}}};return h.getObjectByIndex=e=>{const t=p.value;return t?t[e]:null},h.getValueByIndex=e=>{const t=p.value;return t?v(t[e],1):null},h.getIndexByValue=(e,t)=>{e&&e.id?e=e.id:e&&e.code&&(e=e.code);for(var l=0;l<p.value.length;l++)if(v(p.value[l])==e)return t&&t(l),l;return t&&t(-1),-1},u.push(h),vue.onUpdated((()=>{u.updateSelect()})),vue.onMounted((()=>{l.valueField&&(c.value=l.valueField.split(".")),u.updateSelect()})),vue.onUnmounted((()=>{u.remove(h)})),n({load:h}),()=>p.value.map((e=>vue.h("option",{value:v(e)},e[a])))},name:"VOptions",props:{url:String,src:String,displayField:String,data:Array,store:null,valueField:String,filters:null,filter:null,mode:null},watch:{data(){this.$parent.updateSelect()}},created(){var e=this;e.data&&(e.data2=e.data)},updated(){let e=this;!e.loaded&&e.data&&(e.data2=e.data)},methods:{getParentE(){return this.$el.parentElement.parentElement},getSelectedItem(){var e=this.$el.parentElement;return this.filterList[e.selectedIndex-1]},async load2(e,t,l){}},__file:"src/v-options.vue"},ol$1=window.ol,_$1=window._,axios$1=window.axios,script$a={name:"VOverlay",props:{value:{value:Object},src:String,width:{default:400},header:String},data:()=>({coordinate:null,overlay:null,location:null,ele:null,c:0}),created(){var e=this;e.$parent.$on("beforeBuild",(t=>{console.log(t),e.overlay=new ol$1.Overlay({element:e.$el,positioning:"bottom-right"})})),e.$parent.$on("build",(t=>{t.map.addOverlay(e.overlay)}))},mounted(){var e=this;e.header&&e.$el.childNodes[0].addEventListener("mousedown",(function(t){const l=e.$el.parentElement;var a=window.getComputedStyle(l),o=parseFloat(a.left),r=parseFloat(a.top),n=t.clientX,s=t.clientY,i=l.parentElement;function d(e){l.style.left=o+e.clientX-n+"px",l.style.top=r+e.clientY-s+"px"}i.addEventListener("mousemove",d,!1),i.addEventListener("mouseup",(function(){i.removeEventListener("mousemove",d,!1)}),!1)}),!1)},methods:{close(){this.overlay&&this.overlay.setPosition()},hasSlot(e="default"){return!!this.$slots[e]||!!this.$scopedSlots[e]},load(){var e=this;axios$1.get(_$1.remoteServer+e.src).then((t=>{e.$emit("input",t.data)}))},open(e){for(var t=this,l=e.map,a=e.feature,o=t.overlay,r=o.element,n=t.$parent.$children,s=0;s<n.length;s++)n[s].close&&(n[s].$el.style.opacity=0,n[s].close());e.coordinate?t.coordinate=e.coordinate:(e.coordinate=l.getView().getCenter(),t.coordinate=null),o.setPosition(e.coordinate);var i=l.getView().getCenter(),d=l.getView().getResolution(),c=a?a.getGeometry().getCoordinates():[null],u=l.getPixelFromCoordinate(Number(c[0])?c:e.coordinate);if(this.src)axios$1.get(_$1.remoteServer+this.src).then((e=>{t.$emit("input",e.data),t.c++,setTimeout((function(){var e=l.viewport_.offsetWidth,a=l.viewport_.offsetHeight,n=r.children[0].children[1];n.scrollTop=0;var s=r.offsetHeight;n.style.height=s+100>=a?a-100-r.children[0].children[0].offsetHeight+"px":"300px",s=r.offsetHeight;var c=1*t.width,p=e<=c+40?e-40:c;if(r.style.zIndex=10,r.style.width=p+"px",p/=2,l.getView().animate({center:[i[0]+(u[0]+p+20>=e?+(u[0]+p+20-e):u[0]-20-p<0?-p+u[0]-20:0)*d,i[1]+(u[1]<s?s-u[1]:0)*d],duration:500}),u[0]=u[0]+p-0,u[1]=u[1]-12,o.setPosition(l.getCoordinateFromPixel(u)),t.$el.style.opacity=1,_$1.mobil)for(var v=o.getElement().querySelectorAll("a:not(._)"),h=0;h<v.length;h++)v[h].addEventListener("click",_$1.open2)}),400)})).catch((e=>{console.log(e)}));else{var p=l.viewport_.offsetWidth,v=l.viewport_.offsetHeight,h=r.children[0].children[1];h.scrollTop=0;var m=r.offsetHeight;console.log(r.offsetHeight),h.style.height=m+100>=v?v-100-r.children[0].children[0].offsetHeight+"px":"300px",m=r.offsetHeight;var g=1*t.width,f=p<=g+40?p-40:g;if(r.style.zIndex=10,r.style.width=f+"px",f/=2,l.getView().animate({center:[i[0]+(u[0]+f+20>=p?+(u[0]+f+20-p):u[0]-20-f<0?-f+u[0]-20:0)*d,i[1]+(u[1]<m?m-u[1]:0)*d],duration:500}),u[0]=u[0]+f-0,u[1]=u[1]-12,o.setPosition(l.getCoordinateFromPixel(u)),t.$el.parentNode.style.opacity=0,t.$el.style.opacity=1,t.$el.parentNode.style.top=(v-t.$el.offsetHeight)/2+"px",t.$el.parentNode.style.opacity=1,_$1.mobil){var y=o.getElement().querySelectorAll("a:not(._)");for(s=0;s<y.length;s++)y[s].addEventListener("click",_$1.open2)}t.$emit("opened",{target:t})}}}};const _hoisted_1$7={class:"v-ol-overlay"},_hoisted_2$6={key:0,class:"v-panel-titlebar"},_hoisted_3$4=vue.createElementVNode("i",{class:"fa fa-times"},null,-1),_hoisted_4$2=[_hoisted_3$4],_hoisted_5$1={key:2,style:{"text-align":"center"}},_hoisted_6=vue.createElementVNode("img",{src:_imports_0,width:"20",height:"18"},null,-1),_hoisted_7=[_hoisted_6];function render$8(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$7,[l.header?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$6,[vue.createElementVNode("span",{class:"v-icon v-icon-close",onClick:t[0]||(t[0]=(...e)=>r.close&&r.close(...e))},[..._hoisted_4$2]),vue.createTextVNode(vue.toDisplayString(l.header),1)])):vue.createCommentVNode("v-if",!0),(vue.openBlock(),vue.createElementBlock("div",{class:"v-ol-body",key:"c-"+o.c,style:{padding:"10px"}},[l.value?vue.renderSlot(e.$slots,"default",{key:0,value:l.value}):vue.createCommentVNode("v-if",!0)])),r.hasSlot("footer")&&l.value?(vue.openBlock(),vue.createElementBlock("footer",{key:"f-"+o.c},[vue.renderSlot(e.$slots,"footer",{value:l.value})])):vue.createCommentVNode("v-if",!0),o.coordinate?(vue.openBlock(),vue.createElementBlock("div",_hoisted_5$1,[..._hoisted_7])):vue.createCommentVNode("v-if",!0)])}script$a.render=render$8,script$a.__file="src/v-overlay.vue";var script$9={name:"VPanel",props:{header:String}};const _hoisted_1$6={class:"ui-panel"},_hoisted_2$5={key:0,class:"v-panel-titlebar v-widget-header ui-helper-clearfix ui-corner-all"},_hoisted_3$3={class:"v-panel-title"},_hoisted_4$1={class:"v-panel-content v-dialog-content v-widget-content"};function render$7(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[l.header?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$5,[vue.createElementVNode("span",_hoisted_3$3,vue.toDisplayString(l.header),1)])):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",_hoisted_4$1,[vue.renderSlot(e.$slots,"default")])])}script$9.render=render$7,script$9.__file="src/v-panel.vue";var script$8={name:"VPopup",data:()=>({show:null,overlay:null}),mounted(){var e=this;e.$el.addEventListener("close",(function(){e.hide()}))},destroyed(){var e=this.overlay;e&&(e.style.visibility="hidden",e.style.opacity=0,e.remove(),e=null)},methods:{hide(){var e=this.overlay;e&&(e.style.visibility="hidden",e.style.opacity=0),this.show=0},toggle(){var e=this;e.show=!e.show;var t=e.overlay;if(e.show){var l=document.querySelector(".v-layout-north");e.$el.style.top=l.offsetHeight+"px",console.log(e.$el),t||((t=document.createElement("div")).classList.add("v-overlay"),t.style.padding="40px",t.addEventListener("click",(function(){t.style.visibility="hidden",t.style.opacity=0,e.show=!1})),document.body.appendChild(e.overlay=t)),t.style.visibility="unset",t.style.opacity="unset"}else this.hide()}}};const _hoisted_1$5={class:"v-popup",style:{position:"absolute"}};function render$6(e,t,l,a,o,r){return vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",_hoisted_1$5,[vue.renderSlot(e.$slots,"default")],512)),[[vue.vShow,o.show]])}script$8.render=render$6,script$8.__file="src/v-popup.vue";var script$7={name:"VRadio",props:{value:String,label:String},mounted(){var e=this,t=e.$el.querySelector("input");e.$parent&&e.$parent.nam&&(t.name=e.$parent.nam),e.$parent.required&&(t.required=e.$parent.required),t.onclick=function(){}}};const _hoisted_1$4={class:"v-radio",style:{"font-weight":"normal !important",display:"block"}},_hoisted_2$4=["value"],_hoisted_3$2=vue.createElementVNode("span",{class:"checkmark"},null,-1);function render$5(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("label",_hoisted_1$4,[vue.createTextVNode(vue.toDisplayString(l.label?l.label:l.value)+" ",1),vue.createElementVNode("input",{type:"radio",value:l.value},null,8,_hoisted_2$4),_hoisted_3$2,vue.renderSlot(e.$slots,"default")])}script$7.render=render$5,script$7.__file="src/v-radio.vue";var script$6={__name:"v-radio-group",props:{required:String,name:String,modelValue:String,items:{type:Array,required:!0},type:{type:String,default:"radio"},label:{type:String,default:""}},emits:["update:modelValue"],setup(e,{emit:t}){const l=e,a=t,o=vue.ref(l.modelValue),{proxy:r}=vue.getCurrentInstance(),n=new Set,s=(e,t)=>(e.children&&Array.from(e.children).forEach((e=>{"INPUT"===e.tagName?t.push(e):e.classList&&e.classList.contains("v-group")||s(e,t)})),t),i=()=>{const e=s(r.$el,[]);let t=l.name;t||(t="input_"+Date.now().toString(36)+Math.random().toString(36).substring(2,15));for(let l=0;l<e.length;l++)e[l].name=t,n.has(e[l])||(e[l].addEventListener("change",d),n.add(e[l])),e[l].checked=e[l].value===o.value},d=e=>{let t=e.target.value;""===t&&(t=null),o.value=t,a("update:modelValue",t)};vue.watch((()=>l.modelValue),(e=>{o.value=e,i()})),vue.onMounted((()=>{i()})),vue.onUpdated((()=>{i()}));const c=()=>{const e=[];return r.$slots.default&&e.push(...r.$slots.default()),l.items&&e.push(...l.items.map((e=>vue.h(script$7,{...e,modelValue:o.value,"onUpdate:modelValue":d})))),vue.h("div",[l.label&&vue.h("label",l.label),...e])};return(e,t)=>(vue.openBlock(),vue.createBlock(c))},__file:"src/v-radio-group.vue"},script$5={name:"VSelect",setup(e,t){const{slots:l,emit:a}=t,{displayField:o,valueField:r,disabled:n,readonly:s,autoload:i}=e,d=vue.ref([]),c=vue.ref([]),u=vue.ref([]),p=[],v=vue.ref(!(i+""=="false"||1*i==0)),h=vue.ref(null),m=e=>{const t=e.value;d.value=o?t.sort(((e,t)=>{const l=e[o];return l>t[o]?1:l<t[o]?-1:0})):t},g=()=>{let e=t.attrs.modelValue;if(null!=e&&e.target&&(e=e.value),h.value){let t=h.value,l=t.selectedIndex;e&&""!==e||(t.selectedIndex=0);for(let l=0;l<t.length;l++)t[l].value==e&&(t.selectedIndex=l);const o=p;for(let r=0;r<o.length;r++){if(!o[r].getValueByIndex)continue;let n=o[r].getValueByIndex(l-1);o[r].getIndexByValue(e,((l,s)=>{if(l>-1){t.selectedIndex=l+1;let s=o[r].getValueByIndex(t.selectedIndex-1);-1==s?s=null:o[r].getObjectByIndex&&(s=o[r].getObjectByIndex(t.selectedIndex-1));let i=Number(n);i=isNaN(i)?n?!!e&&(e.id?e.id==n.id:e==n):!e:i==Number(e),i||a("input",e,{value:e,select:t,object:s})}}))}}};m.remove=e=>{const t=p.filter((t=>t!==e));p.length=0,t.forEach((e=>p.push(e)))},m.push=e=>{p.push(e)},m.updateSelect=()=>{g()},r&&(c.value=r.split(".")),vue.provide("collect",m);const f=(t,l)=>{e.disabled?u.value=[t,l]:(u.value=[],p.forEach((e=>{e(t,l)})))};return vue.onMounted((()=>{f()})),vue.onUpdated((()=>{g()})),{options:d,getValueField:(e,t)=>{const l=c.value;if(l&&l.length)for(let t=0;t<l.length;t++)e&&(e=e[l[t]]);else e&&!t&&(e=e.id?e.id:e.code?e.code:e);return e},onChange:e=>{e.stopPropagation();let t=e.target.value;const l=h.value;t&&""!==t||(t=null,l.selectedIndex=0);let o,r=0;const n=d.value;for(let e=0;e<p.length;e++){if(r=p[e].getValueByIndex(l.selectedIndex-1),-1!=r){o=p[e].getObjectByIndex(l.selectedIndex-1);break}r=0}r?t=r:n.length&&(l.selectedIndex=0),a("update:modelValue",t,{value:t,select:l,object:o}),a("input",t,{value:t,select:l,object:o})},onInput:e=>{e.target.value,e.stopPropagation()},select:h,load:f,lastLoad:u,autoload_:v}},props:{required:null,readonly:null,multiple:null,label:null,disabled:null,autoload:null,displayField:null,valueField:null},data:()=>({autoload_:!0,ik:0,data:[],popup:null,show:!1,sel:[],sela:null,tmp:[],sel2:[]}),mounted(){},watch:{disabled(e,t){this.activate(e,t)},show(e){let t=this;if(e){let e=this.$refs.button,l=this.popup;l||(l=this.$refs.popup,l.style.position="absolute",document.body.append(l));let a=e.getBoundingClientRect();const o=l.children[0];window.innerWidth<400?(l.style.padding="40px",l.style.height="100%",o.style.height="100%"):(l.style.top=a.bottom+0+"px",l.style.left=a.left+0+"px",l.style.maxHeight=window.innerHeight-a.bottom-30+"px",o.style.maxHeight=l.style.maxHeight),o.style.display="flex",o.style.flexDirection="column",t.tmp=t.sel.sort().join(",")}else{let e=t.sel;"TH"!=t.$el.parentNode.tagName&&e&&e.length?e=e.join(","):e&&0==e.length&&(e=null),t.tmp!==t.sel.sort().join(",")&&t.$parent.load&&t.$parent.load()}}},methods:{activate(e,t){e=!!e,t=!!t;let l=this.lastLoad,a=this;!e&&!e===t&&l.length&&(this.$el.disabled=!1,a.load(l[0],l[1]))},expand(){console.log("click")},internalLoad(){let e=this;e.autoload_=!(e.autoload+""=="false"||1*e.autoload==0);let t=e.$attrs.value;null!=t&&t.target&&(t=t.value);let l=e.$el.childNodes[0];t&&""!==t||(l.selectedIndex=0),t=e.$attrs.value;for(let e=0;e<l.length;e++)l[e].value==t&&(l.selectedIndex=e);e.autoload_&&e.load(),e.$emit("mounted",e)},toggle(){this.show=!this.show},close(){this.show=!1},selectAll(){let e=[];for(let t=0;t<this.data.length;t++)e.push(this.data[t].value);this.sel=e,this.ik++},checkboxInput(){let e=this.sel;e&&e.length&&(e=e.join(","))}}};const _hoisted_1$3={class:"v-select",style:{position:"relative"}},_hoisted_2$3=["required","disabled","click"],_hoisted_3$1={style:{border:"1px solid lightgray","background-color":"white",padding:"5px"}},_hoisted_4={class:"_ ui-widget ui-state-default ui-corner-all",style:{padding:"3px 3px 1px 3px","margin-bottom":"5px"}},_hoisted_5={class:"center",style:{"padding-top":"4px"}};function render$4(e,t,l,a,o,r){const n=vue.resolveComponent("v-checkbox"),s=vue.resolveComponent("v-checkbox-group"),i=vue.resolveComponent("v-button");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$3,[l.readonly?vue.createCommentVNode("v-if",!0):vue.withDirectives((vue.openBlock(),vue.createElementBlock("select",{key:0,style:{width:"100%"},ref:"select",onChange:t[0]||(t[0]=(...e)=>a.onChange&&a.onChange(...e)),onInput:t[1]||(t[1]=(...e)=>a.onInput&&a.onInput(...e)),required:l.required,disabled:l.disabled,click:r.expand},[vue.renderSlot(e.$slots,"default")],40,_hoisted_2$3)),[[vue.vShow,!l.multiple]]),l.multiple?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createElementVNode("div",{class:vue.normalizeClass(["v-widget-header",{"v-selected":o.show}]),ref:"button",style:{"padding-top":"3px","padding-bottom":"3px"},onClick:t[2]||(t[2]=(...e)=>r.toggle&&r.toggle(...e))}," ",2),vue.withDirectives(vue.createElementVNode("div",{ref:"popup",onClick:t[5]||(t[5]=(...e)=>r.close&&r.close(...e)),style:{"background-color":"#0000009c"}},[vue.createElementVNode("div",_hoisted_3$1,[vue.createElementVNode("div",_hoisted_4,[vue.createVNode(n,{modelValue:o.sela,"onUpdate:modelValue":t[3]||(t[3]=e=>o.sela=e),onInput:r.selectAll},null,8,["modelValue","onInput"])]),(vue.openBlock(),vue.createBlock(s,{class:"v-select-checkbox-group",style:{"overflow-y":"auto"},key:"p"+o.ik,modelValue:o.sel,"onUpdate:modelValue":t[4]||(t[4]=e=>o.sel=e),onInput:r.checkboxInput},{default:vue.withCtx((()=>[o.data.length?(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:0},vue.renderList(o.data,(e=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(n,{value:e.value,label:e.label},null,8,["value","label"])])))),256)):vue.createCommentVNode("v-if",!0)])),_:1},8,["modelValue","onInput"])),vue.createElementVNode("div",_hoisted_5,[vue.createVNode(i,{icon:"fa-sync",value:"Filtrar"})])])],512),[[vue.vShow,o.show]])],64)):vue.createCommentVNode("v-if",!0),l.readonly?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:2},[vue.createTextVNode(vue.toDisplayString(l.label?l.label:"---"),1)],64)):vue.createCommentVNode("v-if",!0)])}script$5.render=render$4,script$5.__file="src/v-select.vue";var script$4={name:"VSwitch",props:{value:{value:Object}},data:()=>({options:["NO","SI"],selected:null}),mounted(){var e=this,t=""+e.value;e.selected="true"===t?"SI":"false"===t?"NO":null,e.$emit("input",e.value)},updated(){var e=this,t=""+e.value;e.selected="true"===t?"SI":"false"===t?"NO":null,e.$emit("input",e.value)},methods:{onChange(e){this.selected=e,this.$emit("input","SI"===e||"NO"!==e&&null)}}};const _hoisted_1$2=["value","data-value"],_hoisted_2$2=["onClick"];function render$3(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",{value:!1===l.value?"false":l.value,"data-value":""+l.value},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(o.options,(e=>(vue.openBlock(),vue.createElementBlock("div",{onClick:t=>r.onChange(e),style:vue.normalizeStyle("cursor:pointer;border: 1px solid #000;text-align:center;display:inline-block;width:calc(50% - 2px)"+(e===o.selected?"":";opacity: 0.5")),class:vue.normalizeClass({"v-selected":e==o.selected})},vue.toDisplayString(e),15,_hoisted_2$2)))),256))],8,_hoisted_1$2)}script$4.render=render$3,script$4.__file="src/v-switch.vue";var script$3={name:"VTable",setup(e,t){const l=vue.ref(1),a=vue.ref(0),o=vue.ref([]),r=vue.ref([]),n=vue.ref(null),s=vue.ref(1),i=vue.computed((()=>{const t=e,l=r.value;let a,o;return l.sum=sum,l.filter((e=>{for(var l in t.filters)if(a=t.filters[l],"function"==typeof a){if(!a(e))return 0}else if(a&&"string"==typeof a&&l in e&&(o=e[l],"string"==typeof o&&(o=o.toUpperCase().normalize("NFD").replace(/[\u0300-\u036f]/g,""),!o.includes(a.toUpperCase()))))return 0;return 1}))})),d=vue.computed((()=>{let e=i.value;return e=n?e.sort(((e,t)=>{t=(t=t[n])||0,e=e[n];const l=Number(e);return l&&(e=l),e<t?-1*s:e>t?1*s:0})):e,e.sum=sum,e})),c=[],u=vue.ref(1),p=vue.ref(0),{slots:v,expose:h,emit:m}=t,g=async()=>{var t,l=e.store;null!=l&&(db&&(t=await getStoredList(l)),t||(t=[]),r.value=r.value?t.concat(r.value):t);return data_},f=(e,t,a)=>{var n;if(-10===t)if(i.value.length===o.value.length)o.value=[];else for(o.value=[],n=0;n<i.value.length;n++)o.value.push(n);else a?l.value||!o.value.contains(t)?o.value=[t]:(o.value=[],e=null):this.selected.contains(t)?(o.value.splice(o.value.indexOf(t),1),e=null):o.value.push(t);var s=[],d=o.value.sort(((e,t)=>e-t));for(t=0;d.length>t;t++)s.push(r.value[d[t]]);m("row-select",{target:this,current:e,selection:s})},y=(t,l)=>{const a=[];return e.selectable&&(e=>o.value.includes(e))(t)&&a.push("v-selected"),e.rowStyleClassFunc&&a.push(e.rowStyleClassFunc(l)),a};let $=""+e.selectable;l.value="false"!=$&&"0"!=$?1:0,$=""+e.scrollable,a.value=e.scrollable&&"false"!=$&&"0"!=$?1:0;const b=v.default({row:{}});b&&b.forEach(((e,t)=>{const l=e.props;e.children&&e.children.filter&&(e.children.filter((e=>"v-filter"==e.type)).forEach((t=>{l.filter=t,p.value=1,e.children.shift()})),e.children.filter((e=>"v-footer"==e.type)).forEach((t=>{l.footer=t,e.children.shift()}))),c.push({filter:l.filter,header:l.header,width:l.width})}));return h({load:()=>{const t=e;if(o.value=[],t.value&&(r.value=t.value),t.src){var l=t.src;if(!l)return;l.endsWith("/")&&(l=l.slice(0,l.length-1));const e=t.pagination;if(e&&(l+="/"+(u.value-1)*e+"/"+e),networkStatus.connected){var a;if(t.gql){const l=t.gql,o="query{"+Object.keys(l)[0]+"(offset:"+(u.value-1)*e+" limit:"+e+"){\ndata{"+l[Object.keys(l)[0]]+"}\nsize\n}\n}";a=axios$2.post(t.src,{query:o})}else a=axios$2.get(l,{params:clean(t.filters)});a.then((l=>{if(l.data&&l.data.error)MsgBox(l.data.error);else{var a=l.data;t.gql&&(a=l.data.data[Object.keys(t.gql)[0]]),r.value=a.data||a,a&&a.hasOwnProperty("size")&&e&&(t.pages=Math.ceil(a.size/e),u.value>t.pages&&(u.value=1),t.size=a.size),g(),m("loaded",{target:t}),m("row-select",{}),t.remoteLoaded=1,t.loaded=1,t.kc++}})).catch(t.error)}else{r.value=[];const e=g();e.then&&e.then((e=>{r.value=e})),m("row-select",{target:t})}}else r.value=[],g().then((()=>m("loaded",{target:t})));t.kc++,t.loaded=1}}),()=>{const t=vue.h("div",{className:"v-datatable-scrollable-header-box",style:"position: absolute; height: 47px; left: 0px;"},vue.h("table",{className:"v-cloned-header v-table",style:"width: 1536px;"},[vue.h("th",{width:42},[vue.h("span",{className:"v-check"},vue.h("i",{className:"fa fa-lg"}))]),c.map((e=>vue.h("th",e,[e.header,e.filter?.children])))]));return vue.h("div",{className:"v-datatable"},[vue.h("div",{className:"v-datatable-header v-widget-header ui-corner-top"},v.header()),vue.h("div",{className:"v-paginator v-paginator-top v-widget-header v-paginator-pages center"},[vue.h(script$n,{value:"|<"}),vue.h(script$n,{value:"<"}),vue.h("input",{type:"number",style:"width:60px"}),vue.h(script$n,{value:">"}),vue.h(script$n,{value:">|"})]),vue.h("div",{className:"v-widget-header v-datatable-scrollable-header",style:"position: relative; height: 110px; margin-right: 0px;"},t),vue.h("div",{className:"v-datatable-scrollable-body",style:"overflow-y: auto; flex:1",onScroll(e){const l=e.currentTarget.scrollLeft;t.el.style.left="-"+l+"px"}},[vue.h("table",{className:"v-table",style:"width: 1536px;"},[vue.h("thead",{className:"v-head-cloned"},[vue.h("th",{width:42}),...c.map((e=>vue.h("th",{width:e.width})))]),vue.h("tbody",{className:"v-datatable-data"},d.value.length<1?vue.h("td",{colspan:c.length+(l.value?1:0)},e.emptyMessage):[d.value.map(((e,t)=>{const a=v.default({row:e});return a.forEach(((e,t)=>{delete e.props.header,delete e.props.width,e.children&&(e.children.filter((e=>"v-filter"==e.type)).forEach((t=>{p.value=1,e.children.shift()})),e.children.filter((e=>"v-footer"==e.type)).forEach((t=>{e.children.shift()})))})),vue.h("tr",{className:y(t,e),onclick(a){((e,t,a)=>{l.value&&0==whichChild(e.target)||f(t,a,1)})(a,e,t)}},[vue.h("td",{width:24}),...a])}))])])])])}},props:{value:Array,filterKey:String,reflow:null,summary:null,src:String,gql:null,filters:Object,store:null,width:null,emptyMessage:{default:"No existen registros"},rowKey:{default:"id"},rowStyleClass:String,pagination:null,selectable:{default:!0},scrollable:null,autoload:{default:!0}},data:()=>({pages:1,resizeAfterUpddate:0,active:0,kc:1,keyBody:1,columns:null,row:{},hasFilters:0,kt:0,size:null,sortKey:"",paginatio_:0,remoteLoaded:null,loaded:!1,sortOrders:{},rowStyleClassFunc:null}),mounted(){var e=this,t=e.$el.style?e.$el.style.height:null;t&&(e.scrollable0=1,e.resizeAfterUpddate=1),e.$parent.tabs&&e.$el.addEventListener("tabChange",(t=>{e.active=1;var l=t.$target.k;e.kt!=l&&(e.load(),e.kt=l)})),e.active&&e.buildColumns(),e.$el.addEventListener("parentResize",(t=>{e.resize(t.height)})),e.$el.addEventListener("command",(t=>{switch(t.name){case"refresh":if(!t.key||e.$el.getAttribute("refresh")!=t.key){e.load(),e.$el.getAttribute("refresh",t.key);break}}})),t&&e.resize(parseInt(t))},created(){var me=this;me.$parent.tabs||(me.active=1),me.paginatio_=me.pagination?me.pagination:0,me.rowStyleClass&&eval("me.rowStyleClassFunc=function(row){return "+me.rowStyleClass+"}")},beforeUpdate(){var e=this;e.active&&(e.buildColumns(),e.value&&null==e.remoteLoaded&&(e.data=e.value))},updated(){var e=this;e.resizeAfterUpddate&&(e.resize(parseInt(e.$el.style.height)),e.resizeAfterUpddate=0),e.paginatio_=e.pagination?e.pagination:0;var t=e.$el.querySelectorAll(".v-table"),l=e.$el.querySelectorAll(".v-datatable-scrollable-header-box")[0];if(l){var a=e.$el.querySelectorAll(".v-cloned-header");if(0===a.length){a=document.createElement("table");var o=t[0].querySelectorAll("thead")[0],r=0,n=0,s=document.createElement("canvas"),i=window.getComputedStyle(l),d=s.getContext("2d");d.font=i.fontSize+" PTSans";var c=t=>{13===t.keyCode&&(t.preventDefault(),e.load())},u=o.childNodes[0].querySelectorAll("th");e.columns.forEach((e=>{e.filter&&e.filter.elm.querySelectorAll("input").forEach((e=>e.addEventListener("keyup",c)))}));var p,v=new HTML2Canvas({lineHeight:parseInt(i.lineHeight),ctx:d});r=0;if(u.forEach(((t,l)=>{t.childNodes[0].onclick=m;var a=e.columns[l-(selectable0.value?1:0)];if(a&&a.filter&&a.filter.elm)if(a.filter.elm.children.forEach)a.filter.elm.children.forEach((e=>t.appendChild(e)));else for(let e of a.filter.elm.children)t.appendChild(e);else if(l>0&&e.hasFilters){var o=document.createElement("input");o.disabled="disabled",o.className="center",t.appendChild(o)}t.clientHeight>n&&(n=t.clientHeight),r+=parseInt(t.width);var s=t.childNodes[0].offsetHeight;s=v.heightText(t.childNodes[0].textContent,parseInt(t.width)),t.childNodes[0].style.width=t.width+"px",t.childNodes[0].style.display="table-cell",t.childNodes[0].style.verticalAlign="middle",s>n&&(n=s)})),u.forEach(((e,t)=>{t&&(e.childNodes[0].style.height=n+"px"),a.appendChild(e)})),u.forEach(((e,t)=>{var l=document.createElement("th");l.width=e.width,o.childNodes[0].appendChild(l)})),t[0].style.width=r+"px",t[0].width=r,t.length>1){t[1].style.width=r+"px",t[1].width=r,t[0].parentNode.style.overflowX="hidden",t[0].parentNode.style.position="relative",t[0].style.position="absolute",t[0].parentNode.style.height="150px",t[1].parentNode.addEventListener("scroll",(e=>{var a=e.currentTarget.scrollLeft;l.style.left="-"+a+"px",t[0].style.left="-"+a+"px"}));var h=t[1].querySelectorAll("td");for(p=0;p<u.length;p++)h[p]&&(h[p].style.width=u[p].width+"px")}else t[0].parentElement.addEventListener("scroll",(e=>{var t=e.currentTarget.scrollLeft;l.style.left="-"+t+"px"}));a.style.width=r+"px";var m=t=>{var l=e.columns[t.target.parentNode.getAttribute("ind")].sort;l==e.sorter&&(e.sortDir=-1*e.sortDir),e.sorter=l};a.className="v-cloned-header v-table",l.appendChild(a),l.appendChild(l.firstChild),l.style.position="absolute",l.style.height=n+37-37+"px",l.parentElement.style.height=l.style.height,e.$el.style.maxHeight&&(l.parentElement.nextElementSibling.style.maxHeight=parseInt(e.$el.style.maxHeight)-n+"px"),o.className="v-head-cloned"}}var g=e.$el.querySelectorAll(".v-check > svg");for(p=0;p<g.length;p++)g[p].dataset.icon=g[p].parentNode.dataset.icon;if(e.loaded){for(var f=e.$el.querySelectorAll(".group"),y=0;y<f.length;y++)f[y].parentNode.removeChild(f[y]);e.loaded=0}},filters:{capitalize:e=>e?e.charAt(0).toUpperCase()+e.slice(1):e,rowSelectedCount(){return this.selected.length}},watch:{kc(e){var t=this;setTimeout((function(){emit("updated",t)}),100)}},methods:{buildColumns(){},resize(e){var t=this.$el;setTimeout((()=>{var l=t.querySelector(".v-datatable-header");l&&(e-=l.offsetHeight),(l=t.querySelector(".v-paginator"))&&(e-=l.offsetHeight),(l=t.querySelector(".v-datatable-scrollable-header"))&&(l.style.height=l.querySelector("table").offsetHeight+"px",e-=l.offsetHeight),(l=t.querySelector(".v-table-summary"))&&(e-=l.offsetHeight);const a=(l=t.querySelector(".v-datatable-scrollable-body")).offsetWidth-l.clientWidth;l.style.overflowY="auto",l.style.height=e+"px",(l=t.querySelector(".v-datatable-scrollable-header-box"))&&(l.parentNode.style.marginRight=a+"px"),(l=t.querySelector(".v-table-summary"))&&(l.style.overflowY="hidden",l.style.marginRight=a+"px")}),100)},to(e,t){this.loadP(e,t)},loadP(e,t){var l=this;(l.page!=e||t)&&(l.page=e,l.load())},rowCreated(){},hasSlot(e){return!!this.$slots[e]},sortBy(){},rowSelect(e,t,l){var a,o=this;if(-10===t)if(filteredData.value.length===o.selected.length)o.selected=[];else for(o.selected=[],a=0;a<filteredData.value.length;a++)o.selected.push(a);else l?selectable0.value||!o.selected.contains(t)?o.selected=[t]:(o.selected=[],e=null):o.selected.contains(t)?(o.selected.splice(o.selected.indexOf(t),1),e=null):o.selected.push(t);var r=[],n=o.selected.sort(((e,t)=>e-t));for(t=0;n.length>t;t++)r.push(o.data[n[t]]);emit("row-select",{target:o,current:e,selection:r})},async getStoredList(e){let t=new Promise((t=>{console.log(db);var l=db.transaction(e).objectStore(e).getAll();l.onsuccess=function(){t(l.result)}}));try{return await t}catch(t){throw alert(e),t}},filter(){alert(12)}},__file:"src/v-table.vue"},script$2={name:"VTabview",data:()=>({tabs:[],height:0,currentTabIndex:0,k:0}),methods:{load(e){var t=new Event("command",{bubbles:!1});t.name="refresh",t.target=this.$el,this.$el.children[1+this.currentTabIndex].dispatchEvent(t)},reset(){this.load(this.k++)}},watch:{currentTabIndex(e){var t=this,l=t.$el.children[e+1];if(t.$children[e+1],l){var a=new Event("tabChange",{bubbles:!1});a.$target=t,l.dispatchEvent(a),t.$el.style.height=t.height+"px",(a=new Event("parentResize",{bubbles:!1})).height=t.$el.offsetHeight-25,l.style.height=a.height+"px",setTimeout((()=>{l.dispatchEvent(a)}),2)}}},updated(){for(var e=this.$el.children,t=1;t<e.length;t++)e[t].tagName&&(t-1===this.currentTabIndex&&(e[t].style.display="flex",e[t].style.flex="1",e[t].style.flexDirection="column"),t-1===this.currentTabIndex?e[t].classList.remove("hide"):(e[t].style.display="none",e[t].classList.add("hide"))),console.log(e[t])},mounted(){for(var e=this,t=e.$el.children,l=1;l<t.length;l++)t[l].style.display="none",e.tabs.push({title:""+t[l].getAttribute("tab")});e.$el.addEventListener("parentResize",(l=>{e.$el.style.height=l.height+1+"px",e.height=l.height+1;var a=new Event("parentResize",{bubbles:!1});a.height=e.$el.offsetHeight-25,a.target=e.$el,a.$target=e;for(var o=1;o<t.length;o++)"none"!=t[o].style.display&&(console.log("Se envia el alto "+a.height),t[o].style.height=a.height+"px",t[o].dispatchEvent(a));e.$emit("resize",a)})),t[1+e.currentTabIndex].setAttribute("active",1);var a=new Event("tabChange",{bubbles:!1});a.$target=e,t[1+e.currentTabIndex].dispatchEvent(a)}};const _hoisted_1$1={class:"v-tab-nav"},_hoisted_2$1=["onClick"];function render$2(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",{class:"v-tabview",style:vue.normalizeStyle({height:o.height+"px"})},[vue.createElementVNode("ul",_hoisted_1$1,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(o.tabs,((e,t)=>(vue.openBlock(),vue.createElementBlock("li",{class:vue.normalizeClass({"v-selected":t==o.currentTabIndex}),key:t,onClick:e=>o.currentTabIndex=t},vue.toDisplayString(e.title),11,_hoisted_2$1)))),128))]),vue.renderSlot(e.$slots,"default")],4)}script$2.render=render$2,script$2.__file="src/v-tabview.vue";var script$1={name:"VTextarea",props:{value:{type:String}},data:()=>({}),template:"<textarea>{{value}}</textarea>",updated(){var e=this,t=e.value;t&&e.$el.maxLength>0&&t.length>e.$el.maxLength&&(t=t.substring(0,e.$el.maxLength)),e.$el.value=t,e.$emit("input",t),e.delayedResize()},methods:{resize(){var e=this.$el;e.style.height="auto",e.style.height=e.scrollHeight+"px"},delayedResize(){window.setTimeout(this.resize,100)}},mounted(){var e=this;e.$el.addEventListener("keyup",(()=>{e.$emit("input",e.$el.value)}));var t,l=e.$el;(t=window.attachEvent?function(e,t,l){e.attachEvent("on"+t,l)}:function(e,t,l){e.addEventListener(t,l,!1)})(l,"change",e.resize),t(l,"cut",e.delayedResize),t(l,"paste",e.delayedResize),t(l,"drop",e.delayedResize),t(l,"keydown",e.delayedResize)}};function render$1(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("textarea",null,vue.toDisplayString(l.value),1)}script$1.render=render$1,script$1.__file="src/v-textarea.vue";var script={name:"VUploader",props:{value:String,onlyicon:Boolean,click:null,icon:String,domain:String},mounted(){var e=this;setTimeout((function(){e.$el.querySelector("svg").dataset.icon="image"}),1e3)},updated(){var e=this;setTimeout((function(){e.$el.querySelector("svg").dataset.icon="image"}),1e3)},data:()=>({uploadPercentage:0,showProgress:!1}),methods:{other(){this.click&&this.click(this)},handleFileUpload(){this.uploadPercentage=0,this.submitFile(this.$el.children[0].children[0].files[0])},submitFile(e,t){var l=this,a=new FormData;t=t||e.name.replace(/[^\w\s.]/gi,""),a.append("filename",t),a.append("file",e,t),l.showProgress=!0,axios.post((l.domain?l.domain:"")+"/api/file/upload",a,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:function(e){this.uploadPercentage=parseInt(Math.round(e.loaded/e.total*100))}.bind(this)}).then((function(e){l.$emit("input",e.data),l.showProgress=!1})).catch((function(){console.log("FAILURE!!")}))}}};const _hoisted_1={style:{cursor:"pointer"},class:""},_hoisted_2=["data-icon"],_hoisted_3=[".value"];function render(e,t,l,a,o,r){return vue.openBlock(),vue.createElementBlock("div",{onClick:t[1]||(t[1]=(...e)=>r.other&&r.other(...e)),class:vue.normalizeClass([l.onlyicon?"":"v-button ui-widget ui-state-default ui-corner-all","v-uploader"]),style:vue.normalizeStyle({padding:l.onlyicon?"0px":""})},[vue.createElementVNode("label",_hoisted_1,[l.click?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("input",{key:0,type:"file",onChange:t[0]||(t[0]=e=>r.handleFileUpload())},null,32)),vue.createElementVNode("i",{class:vue.normalizeClass(["fa",l.icon?l.icon:"fa-upload"]),"data-icon":l.icon,style:vue.normalizeStyle({marginRight:l.onlyicon||""==l.value?"":"10px"})},null,14,_hoisted_2),vue.createTextVNode(vue.toDisplayString(l.onlyicon?"":null!=l.value?l.value:"Adjuntar Archivo")+" ",1),o.showProgress?(vue.openBlock(),vue.createElementBlock("progress",{key:1,max:"100",style:{width:"100%"},".value":o.uploadPercentage},null,40,_hoisted_3)):vue.createCommentVNode("v-if",!0)])],6)}script.render=render,script.__file="src/v-uploader.vue";var components={InputTextarea:script$p,InputText:script$q,VAutocomplete:script$o,VButton:script$n,VCalendar:script$m,VCheckboxGroup:script$l,VCheckbox:script$k,VDataview:script$j,VFieldset:script$i,VForm:script$h,VGroup:script$g,VLayerControl:script$f,VMapControl:script$e,VMap:script$d,VNumber:script$c,VOptions:script$b,VOverlay:script$a,VPanel:script$9,VPopup:script$8,VRadioGroup:script$6,VRadio:script$7,VSelect:script$5,VSwitch:script$4,VTable:script$3,VTabview:script$2,VTextarea:script$1,VUploader:script};const IsobitUI={install(e){setApp(e),e.BUILT_ON=(void 0).VITE_APP_BUILT_ON,configureAxios(axios$2);for(const t in components)if(components.hasOwnProperty(t)){const l=components[t];e.component(l.name||t,l)}}};setTimeout(resize,400),window.addEventListener("resize",(()=>{setTimeout(resize,400)}));const ui=cfg=>{const defs={computed:{connected:{get(){return this.online&&!1!==this.x_connected_},set(e){let t=this.session;this.x_connected_=e,console.log("this.x_connected_ = "+this.x_connected_),this.$set(t,"connected",e),this.session=t}},session:{get(){if(!_$2._session){var e=localStorage.getItem("session");e=e?JSON.parse(e):{},_$2._session=e}return _$2._session},set(e){e?(Array.isArray(e.perms)&&(e.perms=e.perms.reduce(((e,t)=>(e[t]=!0,e)),{})),localStorage.setItem("session",JSON.stringify(e))):localStorage.removeItem("session"),_$2._session=e}},online(){return this.app2&&this.app2.networkStatus?.connected},cleanedFilters(){return clean(this.filters)},app:()=>_$2.app,user:()=>_$2.app.session,perms(){return this.session.perms||this.session.allcaps||{}},rowSelectedCount:()=>1,baseURL:()=>axios$2.defaults.baseURL},data(){return{app2:null,filters:{},ui:this,_session:null,x_connected_:null,row:{},networkStatus:{connected:null}}},created(){let e=this;_$2.app2||(_$2.app2=e,console.log("app created",_$2.app2)),e.app2=_$2.app2},methods:{pad:pad,bindLinks(e,t){const l=this;if(e.querySelectorAll){const r=e.querySelectorAll("a:not(._),ion-item:not(._)");var a=e=>{e.preventDefault()},o=e=>{e.preventDefault(),t&&t(),l.open(e)};for(let e=0;e<r.length;e++)r[e].href||r[e].attributes.href?r[e].onclick=o:r[e].onclick=a,r[e].classList?r[e].classList.add("_"):r[e].className="_"}},resize(){},vv(e){var t=this;Network.getStatus().then((function(l){if(l.connected){var a=localStorage.getItem("session");if(a){try{a=JSON.parse(a)}catch(e){a={}}a.connected=e,localStorage.setItem("session",JSON.stringify(a))}}else t.toast("El dispositivo no tiene acceso a internet!"),t.connected=l.connected}))},getSelected(e){for(var t=e&&e.$vnode?e:this.$children[0].$children[0],l=[],a=0;a<t.selected.length;a++)l.push(t.data[t.selected[a]]);return l},getRowSelectedCount(){var e=this.$children[0].$children[0];return e?e.selected.length:0},rewrite:e=>e,edit(e){var t=this,l=t.$children[0].action,a=[].filter.call(e.component.$parent.$children,(e=>e.$el.classList.contains("v-datatable")))[0];l||(l=window.location.pathname),a&&a.src&&(l=a.src),e.action&&(l=e.action),a||(a=e.$vnode||e.target&&e.target.$vnode?e:t.$children[0].$children[0]).src&&(l=a.src),l&&(l=t.rewrite(l.replace("/api","").replace("/0/0","")));var o=t.getSelected(a)[0],r=o[a.rowKey];o.tmpId&&(r=-o.tmpId),t.getSelectedId&&(r=t.getSelectedId(o)),_$2.app?t.open(l+"/"+r+"/edit"):axios$2.get((_$2.currentPath=(l+"/"+r+"/edit").replace(/([^:]\/)\/+/g,"$1"))+"?modal").then(t.open).catch(t.error)},get(e){var t=this.$el.querySelector("form").action;window.location.href=this.apiLink(t)+"/"+e},error(e){alert(e)},destroy(e){var t=this;t.$children[0].action;var l=[].filter.call(e.component.$parent.$children,(e=>e.$el.classList.contains("v-datatable")))[0];l||(l=e.$vnode?e:t.$children[0].$children[0]);var a=e.$vnode?e.load:null,o=l.$attrs.rowkey;o||(o=l.rowKey);var r=l.data[l.selected[0]];if(l.data,r.tmpId)t.MsgBox("Esta seguro que desea eliminar los registros temporales seleccionados ?",(function(e){if(0==e){for(var o=0,n=_$2.db.transaction([l.store],"readwrite").objectStore(l.store),s=[],i=l.selected.length-1;i>=0;i--)r=l.data[l.selected[i]],s.push(r),r.tmpId&&n.delete(r.tmpId),o++,l.data.splice(l.selected[i],1);o&&(t.app&&t.app.toast?t.app.toast(o+" registros eliminados"):t.MsgBox(o+" registros eliminados")),l.rowSelect(null,-1),l.selected=[],t.$emit("destroyed",s,l.store),a&&a()}}),["SI","NO"]);else{if(!o)return alert("Table don`t have defined attribute 'rowkey'");var n=r[o];t.MsgBox("Esta seguro que desea eliminar el registro seleccionado?",(function(e){if(0==e){var a=l.src.replace("/0/0",""),o=[],s=l.selected.length-1;axios$2.delete(a+"/"+n,{params:l.filters}).then((()=>{for(;s>=0;s--)r=l.data[l.selected[s]],o.push(r),l.data.splice(l.selected[s],1);t.app&&t.app.toast?t.app.toast(o.length+" registros eliminados"):t.MsgBox(o.length+" registros eliminados"),l.rowSelect(null,-1),l.selected=[]})).catch(t.error)}}),["SI","NO"])}},apiLink:e=>e.replace(_$2.contextPath,_$2.contextPath+"/api"),open(response,path,o){if(!(response.$el||response instanceof HTMLElement)){var e=response,t=e.target,me=this;return"string"==typeof e?t=e:"ION-ITEM"==t.tagName&&t.href?(e.preventDefault(),t=t.href):(e.preventDefault(),t.pathname||(t=t.parentNode),t.pathname||(t=t.parentNode),t.pathname||(t=t.parentNode),t=t.pathname),void(me.$route.path!==t&&(console.log("me.$route=",me.$router,t),me.$router.push(t)))}var me=this,el;if(response.$el)response=response.$el,path={};else if(response instanceof HTMLElement)path=path&&path.closeOnClickOut?path:{};else{if(response.target)return el=response.target,me.open(el.pathname?el.pathname:el.href);if("GET"===response){if("string"==typeof path){let e={path:_$2.currentPath=path+("string"==typeof o?"/"+o:"")};return"function"==typeof o?e.result=o:"object"==typeof o&&(e=mergeDeep(e,o)),me.open(response,e)}if(!path.data){if(el=document.querySelector("[path='"+path.path+"']"),el){for(var dd=document.querySelector("#layoutUnit-center > .ui-layout-unit-content,#page-content"),i=0;i<dd.children.length;i++)dd.children[i].style&&("ui-panel"==dd.children[i].className&&"none"!=dd.children[i].style.display&&(backPanel=dd.children[i]),dd.children[i].style.display="none");return el.style.removeProperty("display"),el}return axios$2.get((path.path+"/?modal").replace(/([^:]\/)\/+/g,"$1")).then((e=>{e.class=path.class?path.class:"",e.path=path.path,e.result=path.callback,e=Object.assign(e,path),me.open(response,e)})).catch(me.error)}}else{if(!response.data)return me.open("GET",response,path);response.data&&(path=response)}}var dialog,nid=Vue.id(),scriptDom=[],for_,ifor=0,backPanel;if(response instanceof HTMLElement)dialog=response,dialog.classList.add("v-dialog");else{dialog=document.createElement("div"),dialog.classList.add("v-dialog"),dialog.innerHTML=path.data;var s=dialog.getElementsByTagName("script");dialog.setAttribute("path",_$2.currentPath);for(var ld=dialog.children,k=0;k<s.length;k++)scriptDom.push(s[k]);for(k=0;k<ld.length;k++)"V-FORM"!=ld[k].tagName&&"V-PANEL"!=ld[k].tagName||(for_=ld[k],ifor=k)}var close=()=>{dialog.style.display="none",(overlay=dialog.parentNode).classList.contains("v-overlay")&&(overlay.style.display="none",dialog.parentNode.removeChild(dialog),overlay.parentNode.removeChild(overlay)),backPanel&&(dialog.parentNode.removeChild(dialog),backPanel.style.display="block"),Vue.resize()};if(for_&&for_.classList.contains("panel")){if(for_.id)window.currentEl="#"+for_.id;else{var clsId="cls-id-"+Vue.id();for_.classList.add(clsId),window.currentEl="."+clsId}for(dd=document.querySelector("#layoutUnit-center > .ui-layout-unit-content,#page-content"),i=0;i<dd.children.length;i++)dd.children[i].style&&("ui-panel"==dd.children[i].className&&"none"!=dd.children[i].style.display&&(backPanel=dd.children[i]),dd.children[i].style.display="none");dd.appendChild(dialog);for(var l2=0;scriptDom.length>l2;l2++)try{eval(scriptDom[l2].innerHTML)}catch(e){console.error(e)}var td;dialog.style.display="none";for(var aux=dialog.children[ifor];dialog.children.length>0;)td||(td=dialog.children[0]),dd.appendChild(dialog.children[0]);dialog.parentNode.removeChild(dialog),dialog=aux,dialog.setAttribute("path",path.path)}else{var overlay=document.createElement("div");if(overlay.classList.add("v-overlay"),overlay.style.padding="40px",document.body.appendChild(overlay),overlay.appendChild(dialog),!(response instanceof HTMLElement))for(l2=0;s.length>l2;l2++)try{eval(s[l2].innerHTML)}catch(e){console.error(e)}overlay.style.visibility="unset",overlay.style.opacity="unset",overlay.style.overflow="auto",dialog.style.margin="0 auto",dialog.style.position="unset";var resize=e=>{if(console.log("resize "),dialog.style.left=(window.innerWidth-dialog.offsetWidth)/2+"px",window.innerWidth<600){console.log(dialog);var t=dialog.querySelector(".v-dialog-content"),l=dialog.querySelector(".v-panel-titlebar"),a=window.innerHeight-94-(l?l.clientHeight:0);(t||dialog).style.height=a+"px"}};if(window.addEventListener("resize",resize),"v-search"===path.class){var d=dialog;d.className=d.className+" "+path.class,d.style.width="100%",d.style.height="calc(100% - 2px)";var children=d.querySelector("div"),f=d.querySelector("form"),t=d.querySelector(".v-datatable"),tb=d.querySelector(".v-datatable-scrollable-body");children.style.height="calc(100% - 2px)",children.style.overflowY="auto",children.children[1].style.padding="0px",children.children[1].style.height="calc(100% - 33px)",f.style.height="100%",f.style.overflowY="auto",t.style.height="calc(100% - 52px)",tb.style.height="calc(100% - 72px)",tb.style.overflowY="auto";var pag=d.querySelector(".v-paginator");pag.style.display="inline-block",f.appendChild(pag),tb=document.createElement("button"),tb.innerHTML="Recuperar",tb.style.padding="4px 16px",tb.className="_ ui-widget v-state-default ui-corner-all v-button ui-button-text-only";var vue=_$2.varMap[children.getAttribute("vueid")];tb.onclick=e=>{e.preventDefault(),vue.refresh()},f.appendChild(tb),tb=document.createElement("button"),tb.innerHTML="Seleccionar",tb.style.padding="4px 16px",tb.className="_ ui-widget v-state-default ui-corner-all v-button ui-button-text-only",vue=_$2.varMap[children.getAttribute("vueid")],tb.onclick=e=>{e.preventDefault();var t=[],l=vue.$children[0].$children[0];for(i=0;i<l.selected.length;i++)t.push(l.filteredData[l.selected[i]]);path.result(t),delete path.result,vue.close(e)},f.appendChild(tb)}resize()}_$2.storeFunction["PROPS="+nid]=path,_$2.storeFunction[nid]=e=>{path.result&&path.result(e),!0===e&&me.refresh()};var _vue_=dialog.querySelector("[vueid]");_vue_&&(path.__vue__=_vue_.__vue__,_vue_.__vue__.$emit("opened",path)),dialog.setAttribute("callback",nid);var h=dialog.querySelector(".v-panel-titlebar");if(h){var acl=h.querySelector(".ui-js-close");if(window.onkeyup=e=>{27==e.keyCode&&close()},!acl){var span=document.createElement("i");span.style.top="6px",span.style.right="6px",h.style.position="relative",span.style.position="absolute",span.style.color="white",span.className="fa fa-window-close v-dialog-close",acl=document.createElement("a"),acl.className="ui-js-close v-dialog-titlebar-icon v-dialog-titlebar-close ui-corner-all",acl.appendChild(span),h.appendChild(acl),acl.addEventListener("click",close)}}path.closeOnClickOut&&dialog.parentNode.addEventListener("click",close),dialog.style.display="block",Vue.resize(),document.documentElement.style.overflow="hidden",document.body.scroll="no"},close(e){e.$el&&(e=e.$el);var t=e instanceof HTMLElement?e:null;try{!t&&event.target instanceof HTMLElement&&(t=_$2.closest(event.target,".v-dialog"))}catch(e){console.log(e)}t||(t=this.$el.parentElement);var l=t.parentElement;if(l||!_$2.app.$router){t.style.display="none",(" "+l.className+" ").indexOf(" v-overlay ")>-1?l.style.display="none":l=null,Vue.resize();var a=_$2.storeFunction[t.getAttribute("callback")];a&&a(e),t.parentNode.removeChild(t),l&&l.parentNode.removeChild(l),document.documentElement.style.overflow="auto",document.body.scroll="yes"}else _$2.app.$router.back()},create(){const e=this,t=e.$el.__vnode.ctx.exposed;console.log(t);var l=t.action;l||(l=window.location.pathname),l&&(l=l.replace("/api","")),app()?e.open(l+"/create"):instance.get(_$2.currentPath=(l+"/create").replace(/([^:]\/)\/+/g,"$1")+"?modal").then(_$2.open).catch(e.error)},refresh(){const e=this.$el.__vnode;console.log(e.children[1].children[0]);e.children[1].children[0].children[0].component.exposed.load()},async sync(e){var t=this,l=t.$el.querySelector("form").getAttribute("action");if(!l){var a=(l=t.$el.parentNode.getAttribute("path")).split("/");a="edit"==a[a.length-1]?a.splice(0,a.length-2):a.splice(0,a.length-1),l=t.apiLink(a.join("/"))}var o=t.$children[0].$children[0];l=o.src;for(var r=await t.getStoredList(o.store),n=o.selected,s=[],i=[],d=0;d<n.length;d++){var c=o.data[n[d]];if(c.tmpId&&!c.synchronized)for(var u=0;u<r.length;u++)if(r[u].tmpId==c.tmpId){var p=JSON.clone(r[u]);delete p.synchronized,i.push(p),s.push(u)}}s.length>0&&axios$2.post(l+"/bulk"+(e.sufix?e.sufix:""),i).then((function(e){let l=e.data;for(let e=0;e<l.length;e++){if(l[e].errors){t.MsgBox(JSON.stringify(l[e].errors));break}if(l[e].error){t.MsgBox(l[e].error);break}for(var a=0;a<r.length;a++)(l[e].ext&&l[e].ext.tmpId==r[a].tmpId||l[e].tmpId==r[a].tmpId)&&(console.log("ok"),l[e].ext&&r.ext&&(r[a].ext.error=l[e].ext.error),l[e].id&&(r[a].id=l[e].id),r[a].synchronized=1,t.$emit("sync",l[e],r[a]))}t.setStoredList(o.store,r),t.refresh()})).catch((function(e){e.response?t.MsgBox(e.response.data):console.log(e)}))},async save(){var e=this;e.$forceUpdate();let t=e.$el.querySelector("form");if(this.validate(t)){let s=t.getAttribute("action");if(!s&&(s=e.$el.parentNode.getAttribute("path"),s)){let t=s.split("/");t="edit"==t[t.length-1]?t.splice(0,t.length-2):t.splice(0,t.length-1),s=e.apiLink(t.join("/"))}let i=e.$data.data?e.$data.data:e.$data.o;var l=JSON.parse(JSON.stringify(i));if(e.process&&(l=e.process(l)),"object"!=typeof l||Array.isArray(l)||null===l)return;if(s&&e.app2.connected)axios$2.post(s,l).then((t=>{var a=t.data;if(l.tmpId){alert(12);var o=e.$children[0].store,r=window._.db.transaction([o],"readwrite").objectStore(o),n=r.get(l.tmpId);a.id&&(l.id=a.id,i.id=l.id),n.onsuccess=function(){i.synchronized=1,l.synchronized=1,(n.result?r.put(l):r.add(l)).onerror=e=>{console.error(e)},e.$emit("sync",a,l)},n.onerror=function(){e.MsgBox("Error getting temporal record "+l.tmpId)}}e.app&&e.app.toast?e.app.toast("El registro fue grabado exitosamente!",(()=>{e.close({success:!0,data:a})})):MsgBox$1("El registro fue grabado exitosamente!",(()=>{e.close({success:!0,data:a})}))})).catch((function(l){var a,o;if(l.response)if("string"==typeof l.response.data)e.MsgBox(l.response.data);else{a=l.response.data.propertyViolations;for(var r=0;r<a.length;r++){var n=a[r];(o=t.querySelector("[name="+n.path+"]"))&&e.showerror(o,n.message)}for(a=l.response.data.fieldViolations,r=0;r<a.length;r++)n=a[r],(o=t.querySelector("[name="+n.path+"]"))&&e.showerror(o,n.message+", valor="+n.value);e.MsgBox("Verifique el formulario, aun tiene campos obligatorio completar."),"v-dialog"==e.$el.parentNode.className&&e.$el.parentNode.parentNode.scroll({top:0,behavior:"smooth"})}}));else{let t=e.$children[0].store;if(!t)return void e.MsgBox("Store in form is undefined!");let s=await e.getStoredList(t);if(s||(s=[]),l.id)for(var a=0;a<s.length;a++)s[a].tmpId==l.tmpId&&(delete l.synchronized,s[a]=l);var o=_$2.db.transaction([t],"readwrite").objectStore(t);if(l.id){delete l.synchronized;var r=o.get(l.tmpId);r.onsuccess=function(){r.result?o.put(l):s.forEach((e=>{e.tmpId==l.tmpId&&o.put(l)})),e.$emit("stored",l,s,o),e.$ionic&&e.app.toast("El registro fue grabado exitosamente!"),e.close({success:!0,data:l})},r.onerror=function(){e.MsgBox("Error getting temporal record "+l.tmpId)}}else{l.tmpId=1*new Date,l.id=-l.tmpId;var n=o.add(l);n.onsuccess=t=>{s.unshift(l),e.$emit("stored",l,s,o),e.app&&e.app.toast&&e.app.toast("El registro fue grabado exitosamente!"),i.tmpId=l.tmpId,i.id=l.id,e.close({success:!0,data:l})},n.onerror=t=>{e.app&&e.app.toast&&e.app.toast("Error!")}}}}else MsgBox$1("Verifique el formulario, aun tiene campos obligatorios sin completar."),"v-dialog"==e.$el.parentNode.className&&e.$el.parentNode.parentNode.scroll({top:0,behavior:"smooth"})},saveAs(e,t,l){"string"==typeof t&&(t={body:t});var a="string"==typeof l?{fileName:l}:l;a||(a={}),(""+t?axios$2.post(e,t,{responseType:"blob"}):axios$2({method:"post",url:e,data:t,headers:{"Content-Type":"multipart/form-data"}})).then((e=>{const t=window.URL.createObjectURL(new Blob([e.data])),l=document.createElement("a");if(l.href=t,!a.fileName){const t=e.headers["content-disposition"];if(t&&-1!==t.indexOf("attachment")){const e=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(t);null!=e&&e[1]&&(a.fileName=e[1].replace(/['"]/g,"").trim())}else console.warn("content-disposition: attachment; filename = <filename>; header no es accesible o no esta definido correctamente")}l.setAttribute("download",a.fileName),document.body.appendChild(l),l.click()}))},savePost(){},validate(e){const t=this;var l=!0;const a=[];e=e&&0!=e?e:t.$el;var o,r=e?.querySelectorAll("input,select,textarea,div[required=required]"),n={};for(v=0;r?.length>v;v++){var s=r[v];if("radio"!==s.type){if(s.error&&(s.error.style.display="none"),!s.disabled&&!s.getAttribute("disabled")&&(s.required||"DIV"===s.tagName)&&("DIV"!=s.tagName&&!s.value||"DIV"===s.tagName&&!s.attributes.value)){for(o=s.previousElementSibling;o&&1!=o.nodeType;)o=o.previousElementSibling;if(!o)for(o=s.parentElement.previousElementSibling;o&&1!=o.nodeType;)o=o.previousElementSibling;a.push(s)}}else{var i=n[s.name];i||(n[s.name]=i=[]),i.push(s)}}for(var d in console.log("valid radios"),n)if(Object.prototype.hasOwnProperty.call(n,d)){for(var c=n[d],u=!1,p=!1,v=0;v<c.length;v++)c[v].required&&!c[v].disabled&&(p=!0),c[v].checked&&(u=!0);(o=(s=c[0].parentNode.parentNode).previousElementSibling)&&o.classList&&o.classList.contains("v-error")&&o.parentNode.removeChild(o),p&&!u&&(t.showerror(s),l=!1)}console.log("ok="+l);for(const e of a)if(e.error)e.error.style.display="unset";else{const t=document.createElement("div");t.innerHTML="Este campo es requerido!",t.classList.add("v-error"),e.error=t,e.parentNode.insertBefore(t,e.nextSibling)}return!a.length}}};cfg||(cfg={data:{o:{}}});const{setup:setup,...other}=cfg;return cfg={mixins:[defs,other],setup:setup},cfg};exports.IsobitUI=IsobitUI,exports._=_$2,exports.app=app,exports.date=date,exports.db=db,exports.getStoredList=getStoredList,exports.initDB=initDB,exports.pad=pad,exports.resize=resize,exports.ui=ui;
|
|
1
|
+
"use strict";var Vue$1=require("vue"),axios$2=require("axios"),Observable=require("ol/Observable"),_imports_0=require("@/cdn/images/triangle-down.svg"),script$o={props:{value:{value:Object},data:{type:Array,default:null},placeholder:String,label:String,default:Object,store:null,params:null,autoload:null,floating:{default:!0},src:String,readonly:Boolean,nowrap:null,disabled:Boolean,showSelection:{type:Boolean,default:!0},pagination:{default:10}},data:()=>({page:0,selected:null,focused:-1,query:null,data0:null,show:!1,total:0,inputClass:""}),updated(){var e=this;e.selected=e.value,e.data&&(e.data0=e.data)},watch:{show(e){e&&this.$emit("contextmenu",this)}},computed:{data2(){var e=this;this.focused=-1;var t=e.query?e.query.trim().toLowerCase().split(/[ ,]+/):null;return e.data0&&e.query?e.data0.filter((e=>{for(var a=JSON.stringify(e).toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,""),l=0;l<t.length;l++)if(-1==a.indexOf(t[l]))return!1;return!0})):e.data0}},mounted(){var e=this;e.inputClass=e.$attrs.inputclass,e.autoload&&e.search(),document.addEventListener("click",e.clickout),e.$root.online||e.loadStore()},beforeDestroy(){document.removeEventListener("click",this.clickout)},methods:{async getStoredList(e){let t=new Promise((t=>{var a=window._.db.transaction(e).objectStore(e).getAll();a.onsuccess=function(){t(a.result)}}));return await t},async loadStore(){var e,t=this,a=t.store;if(null!=a)return window._.db&&(e=await t.getStoredList(a)),e||(e=[]),t.data0=t.data0?e.concat(t.data0):e,t.data0},keyup(){40==event.keyCode?this.focused<this.data.length&&this.focused++:38==event.keyCode?this.focused>0&&this.focused--:13==event.keyCode&&this.focused>-1&&this.setSelected(this.data[this.focused])},remove(){this.$emit("input",null)},clickout(){var e=event.target;event.stopPropagation();do{if(e==this.$el)return!1}while(e=e.parentNode);this.show=!1},focusout(){"INPUT"!=event.target.nodeName&&(this.show=!1)},hasSlot(e="default"){return!!this.$slots[e]||!!this.$scopedSlots[e]},clear(){var e=this;e.selected=null,e.query="",e.data0=null},focus(e){this.$el.querySelector("input").focus(e)},setSelected(e,t){this.show=t,this.selected=e,this.$emit("input",e)},getLabel(e){if(this.label)for(var t=this.label.split("."),a=0;a<t.length;a++)e&&(e=e[t[a]]);return e},search(e){var t=this,a=Number(t.pagination);if(1===e)t.page+=a;else if(t.page=0,t.data&&t.autoload)return;var l={query:t.query};t.params&&(l=Vue.mergeDeep(l,t.params)),axios.get((t.src?t.src:t.source)+(a>0?"/"+t.page+"/"+a:""),{params:l}).then((a=>{var l=a.data;l.error?MsgBox(l.error):(t.data0=1===e?t.data0.concat(l.data?l.data:l):l.data?l.data:l,console.log(t.data0),t.total=l.size,t.autoload||(t.show=!0),console.log("========================="))})).catch(t.error).then((()=>{t.$emit("complete",{data:t.data0,query:t.query,target:t})}))}}};const _hoisted_1$h=["value","disabled"],_hoisted_2$c=Vue$1.createElementVNode("i",{class:"fa fa-times"},null,-1),_hoisted_3$8=[_hoisted_2$c],_hoisted_4$5=Vue$1.createElementVNode("i",{class:"fa fa-xs fa-sync"},null,-1),_hoisted_5$2=[_hoisted_4$5],_hoisted_6$1=["disabled","placeholder"],_hoisted_7$1=Vue$1.createElementVNode("button",{class:"hide",onclick:"return false"},null,-1),_hoisted_8={class:"v-list"},_hoisted_9=["onClick"],_hoisted_10={key:0,class:"center yellow",style:{padding:"5px"}};function render$n(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",{class:"v-autocomplete",onFocusout2:t[8]||(t[8]=(...e)=>r.focusout&&r.focusout(...e)),value:a.value,disabled:a.disabled},[o.selected&&a.showSelection?(Vue$1.openBlock(),Vue$1.createElementBlock("div",{key:0,class:"v-selection",style:Vue$1.normalizeStyle({whiteSpace:a.nowrap?"nowrap":""})},[Vue$1.renderSlot(e.$slots,"label",{selected:o.selected}),Vue$1.createTextVNode(" "+Vue$1.toDisplayString(r.hasSlot("label")?" ":r.getLabel(o.selected))+" ",1),a.readonly?Vue$1.createCommentVNode("v-if",!0):(Vue$1.openBlock(),Vue$1.createElementBlock("span",{key:0,onClick:t[0]||(t[0]=(...e)=>r.remove&&r.remove(...e)),style:{top:"0px",margin:"2px 4px",right:"0px",position:"absolute",cursor:"pointer"}},[..._hoisted_3$8]))],4)):Vue$1.createCommentVNode("v-if",!0),o.selected?Vue$1.createCommentVNode("v-if",!0):(Vue$1.openBlock(),Vue$1.createElementBlock("span",{key:1,onClick:t[1]||(t[1]=(...e)=>r.search&&r.search(...e)),style:{color:"gray",top:"4px",right:"6px",position:"absolute",cursor:"pointer"}},[..._hoisted_5$2])),o.selected?Vue$1.createCommentVNode("v-if",!0):Vue$1.withDirectives((Vue$1.openBlock(),Vue$1.createElementBlock("input",{key:2,onKeyup:[t[2]||(t[2]=(...e)=>r.keyup&&r.keyup(...e)),t[3]||(t[3]=Vue$1.withKeys(Vue$1.withModifiers(((...e)=>r.search&&r.search(...e)),["stop","prevent"]),["enter"])),t[4]||(t[4]=Vue$1.withKeys((t=>e.$emit("escape",o.query)),["esc"]))],class:Vue$1.normalizeClass(o.inputClass),onFocus:t[5]||(t[5]=e=>o.show=!0),disabled:a.disabled,placeholder:a.placeholder,"onUpdate:modelValue":t[6]||(t[6]=e=>o.query=e)},null,42,_hoisted_6$1)),[[Vue$1.vModelText,o.query]]),_hoisted_7$1,Vue$1.createVNode(Vue$1.Transition,{name:"fade",persisted:""},{default:Vue$1.withCtx((()=>[Vue$1.withDirectives(Vue$1.createElementVNode("div",{class:"v-resultpane",style:Vue$1.normalizeStyle([{zIndex:2,width:"calc(100% - 2px)",position:a.floating?"absolute":"relative"},{"z-index":"2,width: calc(100% - 2px)","max-height":"300px","overflow-y":"auto",border:"1px solid #0f62ac"}])},[Vue$1.createElementVNode("div",_hoisted_8,[(Vue$1.openBlock(!0),Vue$1.createElementBlock(Vue$1.Fragment,null,Vue$1.renderList(r.data2,((t,a)=>(Vue$1.openBlock(),Vue$1.createElementBlock("div",{class:Vue$1.normalizeClass({"v-selected":o.selected==t,"v-focused":o.focused==a}),onClick:e=>r.setSelected(t)},[Vue$1.renderSlot(e.$slots,"default",{row:t})],10,_hoisted_9)))),256)),o.data0&&o.data0.length<o.total?(Vue$1.openBlock(),Vue$1.createElementBlock("div",{key:0,class:"center",onClick:t[7]||(t[7]=e=>r.search(1))},"Cargar "+Vue$1.toDisplayString(o.total-o.data0.length)+" resultados mas...",1)):Vue$1.createCommentVNode("v-if",!0)]),r.data2&&r.data2.length<1?(Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_10,"No existen resultados.")):Vue$1.createCommentVNode("v-if",!0)],4),[[Vue$1.vShow,o.show&&!o.selected]])])),_:3})],40,_hoisted_1$h)}script$o.render=render$n,script$o.__file="src/v-autocomplete.vue";var script$n={mounted(){var e=this,t=document.createElement("span"),a=document.createElement("i");t.className="ui-button-text ui-c ",t.innerHTML=e.$attrs.value?e.$attrs.value:"ui-button",e.$el.addEventListener("click",(t=>{t.component=e,e.$emit("click",t)})),e.$attrs.icon?(e.$attrs.value?e.$el.classList.add("v-button-text-icon-left"):e.$el.classList.add("v-button-icon-only"),a.dataset.icon=e.$attrs.icon,a.className="fa "+e.$attrs.icon,e.$el.appendChild(a)):(t=document.createElement("span"),e.$el.classList.add("ui-button-text-only"),e.$el.appendChild(t)),e.$attrs.value&&((t=document.createElement("span")).appendChild(document.createTextNode(e.$attrs.value)),e.$el.appendChild(t)),e.updateIcon()},methods:{updateIcon(){var e=this;setTimeout((function(){var t=e.$el.querySelector("svg");if(t){var a=t.dataset;a.icon||(a.icon=e.$attrs.icon)}}),1e3)}}};const _hoisted_1$g={type:"button",class:"_ ui-widget ui-state-default ui-corner-all v-button"};function render$m(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("button",_hoisted_1$g)}script$n.render=render$m,script$n.__file="src/v-button.vue";var script$m={props:{value:{value:String},type:String,required:String,readonly:String,max:String,min:String},data:()=>({value2:null}),methods:{enterD(){var e=event.target.value,t=this,a=t.toDate(e);return console.log(a),t.max&&a&&a.getTime()>=t.toDate(t.max).getTime()||t.min&&a&&a.getTime()<=t.toDate(t.min).getTime()?(t.$emit("invalid",{target:t,value:a}),a=null,void(event.target.value=a)):void("time"===t.$props.type?this.$emit("input",t.pad(a.getHours(),2)+":"+t.pad(a.getMinutes(),2)+":00"):a.getTime&&this.$emit("input",a.getTime()))},pad(e,t){for(var a=e+"";a.length<t;)a="0"+a;return a},toDate(e){if(e){var t,a;if("time"===this.$props.type)return t=e.split(":"),new Date(1981,1,6,parseInt(t[0]),parseInt(t[1]),t.length>2?parseInt(t[2]):0);if(!isNaN(e))return new Date(e);if("datetime-local"===this.$props.type)return t=(a=e.split("T"))[1].split(":"),a=a[0].split("-"),a=new Date(parseInt(a[0]),parseInt(a[1])-1,parseInt(a[2]),parseInt(t[0]),parseInt(t[1]),t.length>2?parseInt(t[2]):0);a=e.split("-");var l=parseInt(a[0]);return l<100?e:a=new Date(l,parseInt(a[1])-1,parseInt(a[2]))}return e},changeDate(){var e,t=this,a=t.toDate(t.value);console.log(a),a&&(e="time"===t.$props.type?t.pad(a.getHours(),2)+":"+t.pad(a.getMinutes(),2):"datetime-local"===t.$props.type?t.pad(a.getFullYear(),4)+"-"+t.pad(a.getMonth()+1,2)+"-"+t.pad(a.getDate(),2)+"T"+t.pad(a.getHours(),2)+":"+t.pad(a.getMinutes(),2):t.pad(a.getFullYear(),4)+"-"+t.pad(a.getMonth()+1,2)+"-"+t.pad(a.getDate(),2)),this.$el.children[0].value=e}},updated(){this.changeDate()},mounted(){this.changeDate()}};const _hoisted_1$f=["value"],_hoisted_2$b=["required","readonly","min","max","type"];function render$l(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",{value:r.toDate(a.value)},[Vue$1.createElementVNode("input",{required:a.required,readonly:a.readonly,min:a.min,max:a.max,onChange:t[0]||(t[0]=(...e)=>r.enterD&&r.enterD(...e)),type:a.type?a.type:"date"},null,40,_hoisted_2$b)],8,_hoisted_1$f)}script$m.render=render$l,script$m.__file="src/v-calendar.vue";var script$l={model:{prop:"vmodel",event2:"change"},props:{value:null,vmodel:null,valueFalse:null,label:null,readonly:null},data:()=>({input:null,hadValue:0}),mounted(){var e=this,t=e.$el.querySelector("input");e.$parent&&e.$parent.nam&&(t.name=e.$parent.nam),e.input=t,e.$parent.onChange||(t.checked=e.value&&e.value==e.vmodel||""+e.vmodel=="true"||""+e.vmodel=="1"),e.$parent.$emit("mounted",e),e.$parent.update2&&e.$parent.update2()},updated(){var e=this;e.input.checked=e.value&&e.value==e.vmodel||""+e.vmodel=="true"||""+e.vmodel=="1"},methods:{change(){var e=this;if(!e.readonly){var t=e.$el.querySelector("input");e.$parent.onChange&&e.$parent.onChange(e.value,t.checked);var a=t.checked?e.value?e.value:t.checked:null!==e.valueFalse&&void 0!==e.valueFalse?e.valueFalse:t.checked;a&&(e.hadValue=1),console.log("nv="+a),e.$emit("input",a)}},getLabel(){var e=this.value;return this.label?this.label:e&&"string"==typeof e?e:""},onClick(e){return this.readonly&&e.preventDefault(),!1}}};const _hoisted_1$e={style:{"font-weight":"normal !important",display:"block"},class:"v-checkbox"},_hoisted_2$a=["innerHTML"],_hoisted_3$7=["checked","value"],_hoisted_4$4=Vue$1.createElementVNode("span",{class:"checkmark"},null,-1);function render$k(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("label",_hoisted_1$e,[Vue$1.createElementVNode("span",{innerHTML:r.getLabel()},null,8,_hoisted_2$a),Vue$1.createElementVNode("input",{type:"checkbox",checked:a.value&&a.vmodel==a.value||a.vmodel,onChange:t[0]||(t[0]=(...e)=>r.change&&r.change(...e)),value:a.value},null,40,_hoisted_3$7),_hoisted_4$4])}script$l.render=render$k,script$l.__file="src/v-checkbox.vue";var script$k={props:{required:String,name:String},data:()=>({value:[],options:[],nam:null}),created(){this.nam||(this.nam=this.$props.name?this.$props.name:"input_"+_.id()),this.update2()},updated(){this.update2()},mounted(){this.options=this.$el.querySelectorAll("input:not(.v-chk)");for(var e=0;e<this.options.length;e++)this.options[e].classList.add("v-chk");this.update2()},methods:{update2(){var e=this.options,t=this.$attrs.value;"string"==typeof t&&(t=t.split("|"));for(var a=0;a<e.length;a++){e[a].checked=!1;for(var l=0;t&&l<t.length;l++)e[a].value==t[l]&&(e[a].checked=!0)}},onChange:function(e,t){var a=this,l=a.$attrs.value;if(("string"==typeof l||l instanceof String)&&(l=l.split("|")),t)l||(a.$attrs.value=l=[]),l.push(e);else{var o=l.indexOf(e);o>-1&&l.splice(o,1)}a.$emit("input",l)}}};function render$j(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",null,[Vue$1.renderSlot(e.$slots,"default")])}script$k.render=render$j,script$k.__file="src/v-checkbox-group.vue";var script$j={props:["header","store","action"],watch:{header(e){this.setTitle(e)}},data:()=>({timer:null}),methods:{setTitle(e){var t=this.$parent.app;t&&setTimeout((()=>{t.title=e}),100)},getAbsoluteHeight(e){var t=window.getComputedStyle(e),a=parseFloat(t.marginTop)+parseFloat(t.marginBottom);return Math.ceil(e.offsetHeight+a)},resize(e){console.log("v-form.resize");var t=this,a=t.$el,l=e.height;a.style.height=l+"px",t.timer&&clearTimeout(t.timer),t.timer=setTimeout((()=>{if(a.parentElement){var e;if(a.children[1])console.log(a.children[0].textContent),console.log(a.children[0]),console.log(a.children[0].offsetHeight),l-=a.children[0].offsetHeight,a.children[1].style.height=l+"px",a.children[1].style.overflowY="auto",(a=a.children[1].children[0]).style.height=l+"px",a.children&&(a.parentNode.style.overflowY="hidden",a.parentNode.style.overflow="hidden"),[].forEach.call(a.children,((o,r)=>{r==a.children.length-1&&"CENTER"==o.tagName||!o.classList.contains("v-scrollable")&&!o.classList.contains("v-form")&&!o.classList.contains("v-resize")?l-=t.getAbsoluteHeight(o):e||(e=o)})),a=e;else(a=a.children[0]).style.height=l+"px";if(a){a.style.overflowY="auto",a.style.height=l+"px";var o=new Event("parentResize",{bubbles:!0});o.height=l,a.children[0].dispatchEvent(o),o.$target=t,t.$emit("resize",o)}}}),500)}},mounted(){var e=this;e.$el.querySelector("form").addEventListener("submit",(t=>{t.preventDefault();var a=e.$parent;return a.refresh&&a.refresh(),!1})),e.setTitle(e.header),e.$el.addEventListener("parentResize",(t=>{t.target==e.$el&&e.resize(t)}))},beforeUnmount(){console.log("unmounted")},updated(){for(var e=this,t=e.$el.querySelectorAll("[type=number]:not(._)"),a=0;a<t.length;a++){var l=()=>{var e=this,t=e.value;if(t){t=n(t),e.max&&t>n(e.max)&&(t=n(e.max)),e.min&&t<n(e.min)&&(t=n(e.min));var a=this.getAttribute("decimal");null!==a&&(t=t.toFixed(1*a)),e.value=t}};t[a].oninput=l,t[a].onblur=l,t[a].classList?t[a].classList.add("_"):t[a].className="_"}t=e.$el.querySelectorAll(".numeric:not(._)");for(a=0;a<t.length;a++)t[a].addEventListener("keyup",(e=>{86==e.keyCode&&isNaN(this.value)&&(this.value="")})),t[a].addEventListener("keydown",(e=>{console.log("eeeeeee"+e.keyCode),-1!==[46,8,9,27,13,110,88,86].indexOf(e.keyCode)||65===e.keyCode&&(!0===e.ctrlKey||!0===e.metaKey)||e.keyCode>=35&&e.keyCode<=40||(e.shiftKey||e.keyCode<48||e.keyCode>57)&&(e.keyCode<96||e.keyCode>105)&&e.preventDefault()})),t[a].classList?t[a].classList.add("_"):t[a].className="_";var o=function(e){var t=this,a=t.previousElementSibling;if(a&&a.classList&&a.classList.contains("v-error")&&a.parentNode.removeChild(a),!t.disabled&&!t.getAttribute("disabled")&&(t.required||"DIV"===t.tagName)&&("DIV"!=t.tagName&&!t.value||"DIV"===t.tagName&&!t.attributes.value)){for(a=t.previousElementSibling;a&&1!=a.nodeType;)a=a.previousElementSibling;if(!a)for(a=t.parentElement.previousElementSibling;a&&1!=a.nodeType;)a=a.previousElementSibling;var l=document.createElement("div");l.innerHTML="Este campo es requerido!",l.classList.add("v-error"),t.parentNode.insertBefore(l,t)}};e.$el.querySelectorAll("select,input[type=date]:not(.__),input[type=text]:not(.__),textarea:not(.__)").forEach((e=>{e.addEventListener("focusout",o),e.classList?e.classList.add("__"):e.className="__"}))}};const _hoisted_1$d={class:"ui-panel"},_hoisted_2$9={key:0,class:"v-widget-header v-panel-titlebar"},_hoisted_3$6={class:"v-panel-title"},_hoisted_4$3={class:"v-dialog-content v-widget-content"},_hoisted_5$1=["action"];function render$i(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_1$d,[a.header?(Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_2$9,[Vue$1.createElementVNode("span",_hoisted_3$6,Vue$1.toDisplayString(a.header),1)])):Vue$1.createCommentVNode("v-if",!0),Vue$1.createElementVNode("div",_hoisted_4$3,[Vue$1.createElementVNode("form",{action:a.action},[Vue$1.renderSlot(e.$slots,"default")],8,_hoisted_5$1)])])}script$j.render=render$i,script$j.__file="src/v-form.vue";var script$i={props:{value:String,label:String},mounted(){var e=this,t=e.$el.querySelector("input");e.$parent&&e.$parent.nam&&(t.name=e.$parent.nam),e.$parent.required&&(t.required=e.$parent.required),t.onclick=function(){e.$parent.onChange(e.value)}}};const _hoisted_1$c={class:"v-radio",style:{"font-weight":"normal !important",display:"block"}},_hoisted_2$8=["value"],_hoisted_3$5=Vue$1.createElementVNode("span",{class:"checkmark"},null,-1);function render$h(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("label",_hoisted_1$c,[Vue$1.createTextVNode(Vue$1.toDisplayString(a.label?a.label:a.value)+" ",1),Vue$1.createElementVNode("input",{type:"radio",value:a.value},null,8,_hoisted_2$8),_hoisted_3$5,Vue$1.renderSlot(e.$slots,"default")])}script$i.render=render$h,script$i.__file="src/v-radio.vue";var script$h={props:{required:String,name:String},data:()=>({value:null,nam:null}),updated(){this.update2()},mounted(){this.update2()},created(){this.nam||(this.nam=this.$props.name?this.$props.name:"input_"+window._.id())},methods:{getInputs(e,t){var a=this;return e.children&&Array.from(e.children).forEach((e=>{"INPUT"==e.tagName?t.push(e):e.classList.contains("v-group")||a.getInputs(e,t)})),t},update2(){for(var e=this.getInputs(this.$el,[]),t=0;t<e.length;t++)e[t].value==this.$attrs.value?e[t].checked=!0:e[t].checked=!1},onChange(e){this.value=e,""===e&&(e=null),this.$emit("input",e)}}};const _hoisted_1$b={class:"v-group"};function render$g(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_1$b,[Vue$1.renderSlot(e.$slots,"default")])}script$h.render=render$g,script$h.__file="src/v-group.vue";var script$g={props:{required:String,name:String},data:()=>({value:null,nam:null}),updated(){this.update2()},mounted(){this.update2()},created(){this.nam||(this.nam=this.$props.name?this.$props.name:"input_"+window._.id())},methods:{getInputs(e,t){var a=this;return e.children&&Array.from(e.children).forEach((e=>{"INPUT"==e.tagName?t.push(e):e.classList.contains("v-group")||a.getInputs(e,t)})),t},update2(){for(var e=this.getInputs(this.$el,[]),t=0;t<e.length;t++)e[t].value==this.$attrs.value?e[t].checked=!0:e[t].checked=!1},onChange(e){this.value=e,""===e&&(e=null),this.$emit("input",e)}}};function render$f(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",null,[Vue$1.renderSlot(e.$slots,"default")])}script$g.render=render$f,script$g.__file="src/v-radio-group.vue";var script$f={props:{value:Array,filterKey:String,src:String,filters:Object,store:null,itemWidth:null,rowKey:String,rowStyleClass:null,pagination:null,selectable:Boolean,scrollable:Boolean,autoload:{type:Boolean,default:!0}},data:function(){return{data:null,pages:1,page:1,columns:1,w:0,row:{},error:null,size:null,sortKey:"",selected:[],sortOrders:{},rowStyleClassFunc:null}},created(){var me=this;try{me.rowStyleClass&&(eval("me.rowStyleClassFunc=function(row,item,index){return "+me.rowStyleClass+"}"),me.rowStyleClassFunc({},{},0))}catch(e){me.rowStyleClassFunc=null,console.log("Error en la expresion rowStyleClassFunc=function(row,item,index){return "+me.rowStyleClass+"}")}},updated(){console.log("updated"),this.$emit("updated"),this.resize()},mounted(){var e=this;e.$el.addEventListener("parentResize2",e.resize),e.autoload&&e.load(),e.resize()},methods:{resize(){var e=this;if(e.itemWidth){var t=1+Math.trunc(e.$el.offsetWidth/Number(e.itemWidth));t>6&&(t=6),e.columns=t}},async getStoredList(e){let t=new Promise((t=>{var a=window._.db.transaction(e).objectStore(e).getAll();a.onsuccess=function(){t(a.result)}}));return await t},async loadStore(){let e=this,t=e.store;if(null!=t){let a;return window._.db&&(a=await e.getStoredList(t)),a||(a=[]),e.data=e.data?a.concat(e.data):a,console.log("loadStore"),console.log(e.data),e.data}},getRowClass(e,t){var a=this,l=t%a.columns+1,o=["c-w-"+a.columns];return l==a.columns&&o.push("v-last"),a.rowStyleClassFunc?o.push(a.rowStyleClassFunc(e,e,t)):o.push(a.rowStyleClass),o},remove(e){e=e.id?e.id:e;var t=this.data,a=t.map((e=>e.id)).indexOf(e);t.splice(a,1)},error2(e,t){this.data=[],this.error=t},load(e){var t=this;if(this.selected=[],t.value)t.data=t.value;else{!0===e&&(t.page=1);var a=t.src;a||(a=t.$root.apiLink(window.location.pathname)),a.endsWith("/")&&(a=a.slice(0,a.length-1)),t.pagination&&(a+="/"+(t.page-1)*t.pagination+"/"+t.pagination),axios.get(a,{error:t.error2,params:t.filters}).then((function(a){if(a.data&&a.data.error)MsgBox(a.data.error);else{var l=t.value?t.value:a.data.data?a.data.data:a.data;t.data||(t.data=[]),t.data=!0===e?l:t.data?t.data.concat(l):t.data,t.size=a.data.size,a.data&&a.data.size&&(t.pages=Math.ceil(a.data.size/t.pagination),t.page>t.pages&&(t.page=1)),t.$emit("loaded",{target:t,response:a})}})).catch(t.error)}}}};const _hoisted_1$a={class:"v-dataview"};function render$e(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_1$a,[e.data?(Vue$1.openBlock(!0),Vue$1.createElementBlock(Vue$1.Fragment,{key:0},Vue$1.renderList(e.data,((t,a)=>(Vue$1.openBlock(),Vue$1.createElementBlock("div",{class:Vue$1.normalizeClass(r.getRowClass(t,a))},[Vue$1.renderSlot(e.$slots,"default",{row:t,item:t,index:a})],2)))),256)):Vue$1.createCommentVNode("v-if",!0),e.data&&!e.data.length?(Vue$1.openBlock(),Vue$1.createElementBlock("div",{key:1,class:Vue$1.normalizeClass(["center v-no-results",{error:e.error}])},Vue$1.toDisplayString(e.error?e.error:"No existen registros para mostrar"),3)):Vue$1.createCommentVNode("v-if",!0),e.data&&e.size>e.data.length?(Vue$1.openBlock(),Vue$1.createElementBlock("div",{key:2,onClick:t[0]||(t[0]=t=>r.load(e.page++)),class:"center v-more-results"},"Ver mas resultados")):Vue$1.createCommentVNode("v-if",!0)])}script$f.render=render$e,script$f.__file="src/v-dataview.vue";var script$e={props:{legend:String,closable:null},watch:{closed(e){this.$emit("change",{target:this,closed:e}),this.$emit("input",!e)}},data:()=>({closed:!1}),created(){this.closed=this.closable},mounted(){var e=this;e.$el.addEventListener("parentResize",(t=>{t.$target=e,e.$emit("resize",t)}))},updated(){var e=this;setTimeout((function(){var t=e.$el.querySelector("legend > * > svg");if(t)try{console.log(),t.dataset.icon=t.parentNode.dataset.icon}catch(e){console.log("icon"),console.log(e)}}),50)}};const _hoisted_1$9={class:"v-fieldset"},_hoisted_2$7=["data-icon"],_hoisted_3$4=["innerHTML"];function render$d(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("fieldset",_hoisted_1$9,[a.legend?(Vue$1.openBlock(),Vue$1.createElementBlock("legend",{key:0,onClick:t[0]||(t[0]=e=>o.closed=a.closable&&!o.closed),style:Vue$1.normalizeStyle({cursor:a.closable?"pointer":""})},[a.closable?(Vue$1.openBlock(),Vue$1.createElementBlock("span",{key:0,"data-icon":o.closed?"plus":"minus",style:{margin:"0px 5px 0px 0px"}},[Vue$1.createElementVNode("i",{class:Vue$1.normalizeClass([o.closed?"fa-plus":"fa-minus","fa"])},null,2)],8,_hoisted_2$7)):Vue$1.createCommentVNode("v-if",!0),Vue$1.createElementVNode("span",{innerHTML:a.legend},null,8,_hoisted_3$4)],4)):Vue$1.createCommentVNode("v-if",!0),Vue$1.withDirectives(Vue$1.createElementVNode("div",null,[Vue$1.renderSlot(e.$slots,"default")],512),[[Vue$1.vShow,!o.closed]])])}script$e.render=render$d,script$e.__file="src/v-fieldset.vue";const template='\n\t<div :class={reflow:reflow} :key="\'v-table-\'+keyBody" :style={width:width}\n class="v-datatable v-resize">\n <template v-if="active">\n\t\t<div v-if="hasSlot(\'header\')" class="v-datatable-header v-widget-header ui-corner-top"><slot name="header"></slot>\n\t\t</div>\n\t\t<div v-if="pagination" class="v-paginator v-paginator-top v-widget-header v-paginator-pages center">\n\t\t\n\t\t<v-button value="|<" :disabled="page<=1" v-on:click.prevent="to(1)"/><v-button value="<" v-on:click.prevent="to(page-1)" :disabled="page<=1"/><div style="padding:3px 8px;display:inline-block">\n\t\t<input type="number" v-on:change="to(page,true)" style="width:60px" min="1" :max="pages" v-model="page"/> / {{pages}}</div>\n\t\t<v-button value=">" v-on:click.prevent="to(page+1)" :disabled="page==pages"/><v-button v-on:click.prevent="to(pages)" value=">|" :disabled="page==pages"/>\n\t\t\t</div>\n\t\t<div v-if="scrollable0" class="v-widget-header v-datatable-scrollable-header" style="position:relative">\n\t\t<div class="v-datatable-scrollable-header-box" style=""></div></div>\n\t\t<div :class="{\'v-datatable-scrollable-body\':scrollable0}">\n\t\t<table class="v-table" :style="{width:width}" v-if="columns">\n\t\t\t<thead>\n <tr>\n <th v-if="selectable0" :width="getCheckColumnWidth" >\n <span class="v-check" v-on:click="rowSelect(null,-10)" :data-icon="selected.length?\'square-check\':\'square\'">\n <i class="fa fa-lg" :class="selected.length?\'fa-square-check\':\'fa-square\'"></i>\n </span>\n </th>\n <th :class="k[\'h-class\']" v-for="k in columns" :width="k.width" v-on:click="sortBy(k)">\n <div v-html="k.header"></div>\n </th>\n\t\t\t</tr>\n </thead>\n\t\t\t<tbody class="v-datatable-data" :key="kc">\n <template v-for="(groupItem) in groupedData">\n\n <tr v-if="hasSlot(\'header-group\')" >\n <slot name="header-group" :group="groupItem"></slot>\n </tr>\n\n <tr v-for="(entry,r) in groupItem" @row="rowCreated(entry)" @click="_selectRow($event,entry,r)" \n :class="getRowClass(r,entry)">\n <td v-if="selectable0" width="18" class="center">\n <span :data-index="r" class="v-check" v-on:click="rowSelect(entry,r)"\n :data-icon="isSelected(r)?\'square-check\':\'square\'"><i class="far fa-lg" :class="isSelected(r)?\'fa-square-check\':\'fa-square\'" ></i></span>\n </td>\n <slot :row="entry" :index="r+(page-1)*paginatio_"></slot>\n </tr>\n\n <tr v-if="hasSlot(\'footer-group\')" >\n <slot name="footer-group" :group="groupItem"></slot>\n </tr>\n\n </template>\n\n\t\t\t\t<tr v-if="!sortedData||sortedData.length==0">\n\t\t\t\t\t<td :colspan="columns.length+(selectable0?1:0)">{{emptyMessage}}</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t\t</div>\n\t\t<div v-if="summary||hasSlot(\'summary\')" class="v-table-summary" :class="{\'v-datatable-scrollable-body\':scrollable}">\n\t\t\t<table class="v-table v-table-summary"><tr>\n\t\t\t<td v-if="selectable0" :width="getCheckColumnWidth" ></td>\n\t\t\t<slot name="summary" :data="sortedData"></slot>\n\t\t\t</tr></table>\n\t\t</div>\n\t\t<div class="hide filters"><slot name="filters"></slot><slot name="columns"></slot></div></template></div>\n',compiledTemplate=Vue$1.compile(template);var script$d={props:{value:Array,filterKey:String,reflow:null,summary:null,src:String,gql:null,filters:Object,store:null,width:null,emptyMessage:{default:"No existen registros"},rowKey:{default:"id"},rowStyleClass:String,groupKeys:{default:""},pagination:null,selectable:{default:!0},scrollable:null,autoload:{default:!0}},data:()=>({data:[],sorter:null,sortDir:1,pages:1,resizeAfterUpddate:0,page:1,active:0,selectable0:1,scrollable0:0,kc:1,keyBody:1,columns:null,row:{},hasFilters:0,kt:0,size:null,sortKey:"",selected:[],paginatio_:0,remoteLoaded:null,loaded:!1,sortOrders:{},rowStyleClassFunc:null}),render(e){var t=this,a=[];t.def||(t.def=t.$scopedSlots.default);var l=t.def({row:{}});l&&(l.forEach(((e,l)=>{var o=e.data.attrs;e.children&&(e.children.filter((e=>"v-filter"==e.tag)).forEach((a=>{o.filter=a,t.hasFilters=1,e.children.shift()})),e.children.filter((e=>"v-footer"==e.tag)).forEach((t=>{o.footer=t,e.children.shift()}))),a.push(o)})),t.columns||(t.columns=a),t.co=a),t.$scopedSlots.default=function(e,a,l){let o=t.def(e,a,l);return o.forEach(((e,a)=>{delete e.data.attrs.header,delete e.data.attrs.width,e.children&&(e.children.filter((e=>"v-filter"==e.tag)).forEach((a=>{t.hasFilters=1,e.children.shift()})),e.children.filter((e=>"v-footer"==e.tag)).forEach((t=>{e.children.shift()})))})),o};var o=compiledTemplate.render.call(this,e);return t.co.forEach((e=>{e.filter&&o.children[o.children.length-1].children.push(e.filter)})),o},computed:{getCheckColumnWidth:()=>36,filteredData(){const e=this;let t,a,l=e.data;return l=l.filter((l=>{for(let o in e.filters)if(t=e.filters[o],"function"==typeof t){if(!t(l))return 0}else if(t&&"string"==typeof t&&o in l&&(a=l[o],"string"==typeof a&&(a=a.toUpperCase().normalize("NFD").replace(/[\u0300-\u036f]/g,""),!a.includes(t.toUpperCase()))))return 0;return 1})),l.sum=_.sum,l},groupedData(){const e={},t=this.groups,a=this.sortedData||[];return t?(alert(t),a.forEach((a=>{const l=a[t];e[l]||(e[l]=[]),e[l].push(a)})),Object.entries(e).map((([e,t])=>({group:Number(e),values:t})))):(alert(8),{group:"",values:a})},sortedData(){var e=this,t=e.filteredData;return(t=e.sorter?t.sort(((t,a)=>(a=(a=a[e.sorter])||0,t=t[e.sorter],aa=Number(t),aa&&(t=aa),t<a?-1*e.sortDir:t>a?1*e.sortDir:0))):t).sum=_.sum,t}},mounted(){var e=this,t=e.$el.style?e.$el.style.height:null;t&&(e.scrollable0=1,e.resizeAfterUpddate=1),e.$parent.tabs&&e.$el.addEventListener("tabChange",(t=>{e.active=1;var a=t.$target.k;e.kt!=a&&(e.load(),e.kt=a)})),e.active&&(e.buildColumns(),!0===e.autoload&&e.load()),e.$el.addEventListener("parentResize",(t=>{e.resize(t.height)})),e.$el.addEventListener("command",(t=>{switch(t.name){case"refresh":if(!t.key||e.$el.getAttribute("refresh")!=t.key){e.load(),e.$el.getAttribute("refresh",t.key);break}}})),t&&e.resize(parseInt(t))},created(){var me=this;me.$parent.tabs||(me.active=1);var s=""+me.selectable;me.selectable0="false"!=s&&"0"!=s?1:0,s=""+me.scrollable,me.scrollable0=me.scrollable&&"false"!=s&&"0"!=s?1:0,me.paginatio_=me.pagination?me.pagination:0,me.rowStyleClass&&eval("me.rowStyleClassFunc=function(row){return "+me.rowStyleClass+"}")},beforeUpdate(){var e=this;e.active&&(e.buildColumns(),e.value&&null==e.remoteLoaded&&(e.data=e.value))},updated(){var e=this;e.resizeAfterUpddate&&(e.resize(parseInt(e.$el.style.height)),e.resizeAfterUpddate=0),e.paginatio_=e.pagination?e.pagination:0;var t=e.$el.querySelectorAll(".v-table"),a=e.$el.querySelectorAll(".v-datatable-scrollable-header-box")[0];if(a){var l=e.$el.querySelectorAll(".v-cloned-header");if(0===l.length){l=document.createElement("table");var o=t[0].querySelectorAll("thead")[0],r=0,n=0,i=document.createElement("canvas"),s=window.getComputedStyle(a),d=i.getContext("2d");d.font=s.fontSize+" PTSans";var c=t=>{13===t.keyCode&&(t.preventDefault(),e.load())},u=o.childNodes[0].querySelectorAll("th");e.columns.forEach((e=>{e.filter&&e.filter.elm.querySelectorAll("input").forEach((e=>e.addEventListener("keyup",c)))}));var p,h=new _.HTML2Canvas({lineHeight:parseInt(s.lineHeight),ctx:d});r=0;if(u.forEach(((t,a)=>{t.childNodes[0].onclick=g;var l=e.columns[a-(e.selectable0?1:0)];if(l&&l.filter&&l.filter.elm)if(l.filter.elm.children.forEach)l.filter.elm.children.forEach((e=>t.appendChild(e)));else for(let e of l.filter.elm.children)t.appendChild(e);else if(a>0&&e.hasFilters){var o=document.createElement("input");o.disabled="disabled",o.className="center",t.appendChild(o)}t.clientHeight>n&&(n=t.clientHeight),r+=parseInt(t.width);var i=t.childNodes[0].offsetHeight;i=h.heightText(t.childNodes[0].textContent,parseInt(t.width)),t.childNodes[0].style.width=t.width+"px",t.childNodes[0].style.display="table-cell",t.childNodes[0].style.verticalAlign="middle",i>n&&(n=i)})),u.forEach(((e,t)=>{t&&(e.childNodes[0].style.height=n+"px"),l.appendChild(e)})),u.forEach(((e,t)=>{var a=document.createElement("th");a.width=e.width,o.childNodes[0].appendChild(a)})),t[0].style.width=r+"px",t[0].width=r,t.length>1){t[1].style.width=r+"px",t[1].width=r,t[0].parentNode.style.overflowX="hidden",t[0].parentNode.style.position="relative",t[0].style.position="absolute",t[0].parentNode.style.height="150px",t[1].parentNode.addEventListener("scroll",(e=>{var l=e.currentTarget.scrollLeft;a.style.left="-"+l+"px",t[0].style.left="-"+l+"px"}));var v=t[1].querySelectorAll("td");for(p=0;p<u.length;p++)v[p]&&(v[p].style.width=u[p].width+"px")}else t[0].parentElement.addEventListener("scroll",(e=>{var t=e.currentTarget.scrollLeft;a.style.left="-"+t+"px"}));l.style.width=r+"px";var g=t=>{var a=e.columns[t.target.parentNode.getAttribute("ind")].sort;a==e.sorter&&(e.sortDir=-1*e.sortDir),e.sorter=a};l.className="v-cloned-header v-table",a.appendChild(l),a.appendChild(a.firstChild),a.style.position="absolute",a.style.height=n+37-37+"px",a.parentElement.style.height=a.style.height,e.$el.style.maxHeight&&(a.parentElement.nextElementSibling.style.maxHeight=parseInt(e.$el.style.maxHeight)-n+"px"),o.className="v-head-cloned"}}var m=e.$el.querySelectorAll(".v-check > svg");for(p=0;p<m.length;p++)m[p].dataset.icon=m[p].parentNode.dataset.icon;if(e.loaded){for(var f=e.$el.querySelectorAll(".group"),$=0;$<f.length;$++)f[$].parentNode.removeChild(f[$]);e.$emit("updated",e),e.loaded=0}},filters:{capitalize:e=>e?e.charAt(0).toUpperCase()+e.slice(1):e,rowSelectedCount(){return this.selected.length}},watch:{kc(e){var t=this;setTimeout((function(){t.$emit("updated",t)}),100)}},methods:{buildColumns(){},getRowClass(e,t){var a=[],l=this;return l.selectable&&l.isSelected(e)&&a.push("v-selected"),l.rowStyleClassFunc&&a.push(l.rowStyleClassFunc(t)),a},resize(e){var t=this.$el;setTimeout((()=>{var a=t.querySelector(".v-datatable-header");a&&(e-=a.offsetHeight),(a=t.querySelector(".v-paginator"))&&(e-=a.offsetHeight),(a=t.querySelector(".v-datatable-scrollable-header"))&&(a.style.height=a.querySelector("table").offsetHeight+"px",e-=a.offsetHeight),(a=t.querySelector(".v-table-summary"))&&(e-=a.offsetHeight);const l=(a=t.querySelector(".v-datatable-scrollable-body")).offsetWidth-a.clientWidth;a.style.overflowY="auto",a.style.height=e+"px",(a=t.querySelector(".v-datatable-scrollable-header-box"))&&(a.parentNode.style.marginRight=l+"px"),(a=t.querySelector(".v-table-summary"))&&(a.style.overflowY="hidden",a.style.marginRight=l+"px")}),100)},to(e,t){this.loadP(e,t)},loadP(e,t){var a=this;(a.page!=e||t)&&(a.page=e,a.load())},rowCreated(){},hasSlot(e){return!!this.$slots[e]},sortBy(){},isSelected(e){return this.selected.contains(e)},_selectRow(e,t,a){this.selectable0&&0==_.whichChild(e.target)||this.rowSelect(t,a,1)},rowSelect(e,t,a){var l,o=this;if(-10===t)if(o.filteredData.length===o.selected.length)o.selected=[];else for(o.selected=[],l=0;l<o.filteredData.length;l++)o.selected.push(l);else a?this.selectable0||!o.selected.contains(t)?o.selected=[t]:(o.selected=[],e=null):o.selected.contains(t)?(o.selected.splice(o.selected.indexOf(t),1),e=null):o.selected.push(t);var r=[],n=o.selected.sort(((e,t)=>e-t));for(t=0;n.length>t;t++)r.push(o.data[n[t]]);o.$emit("row-select",{target:o,current:e,selection:r})},async getStoredList(e){let t=new Promise((t=>{var a=window._.db.transaction(e).objectStore(e).getAll();a.onsuccess=function(){t(a.result)}}));try{return await t}catch(t){throw alert(e),t}},async loadStore(){var e,t=this,a=t.store;null!=a&&(window._.db&&(e=await t.getStoredList(a)),e||(e=[]),t.data=t.data?e.concat(t.data):e);return t.data},load(){var e=this;if(this.selected=[],e.value&&(e.data=e.value),e.src){var t=e.src;if(!t)return;t.endsWith("/")&&(t=t.slice(0,t.length-1));var a=e.pagination;if(a&&(t+="/"+(e.page-1)*a+"/"+e.pagination),_.networkStatus.connected){var l;if(e.gql){var o=e.gql,r="query{"+Object.keys(o)[0]+"(offset:"+(e.page-1)*a+" limit:"+e.pagination+"){\ndata{"+o[Object.keys(o)[0]]+"}\nsize\n}\n}";l=axios.post(e.src,{query:r})}else l=axios.get(t,{params:_.clean(e.filters)});l.then((t=>{if(t.data&&t.data.error)MsgBox(t.data.error);else{var l=t.data;e.gql&&(l=t.data.data[Object.keys(e.gql)[0]]),e.data=l.data||l,l&&l.hasOwnProperty("size")&&a&&(e.pages=Math.ceil(l.size/a),e.page>e.pages&&(e.page=1),e.size=l.size),e.loadStore(),e.$emit("loaded",{target:e}),e.$emit("row-select",{}),e.remoteLoaded=1,e.loaded=1,e.kc++}})).catch(e.error)}else{e.data=[];var n=e.loadStore();n.then&&n.then((t=>{e.data=t})),e.$emit("row-select",{target:e})}}else e.data=[],e.loadStore(),e.$emit("loaded",{target:e});e.kc++,e.loaded=1},filter(){alert(12)}},__file:"src/v-table.vue"},script$c={data:()=>({tabs:[],height:0,currentTabIndex:0,k:0}),methods:{load(e){var t=new Event("command",{bubbles:!1});t.name="refresh",t.target=this.$el,this.$el.children[1+this.currentTabIndex].dispatchEvent(t)},reset(){this.load(this.k++)}},watch:{currentTabIndex(e){var t=this,a=t.$el.children[e+1];if(t.$children[e+1],a){console.log("aviso al actual tab q esta seleccionado seltab="+e);var l=new Event("tabChange",{bubbles:!1});l.$target=t,a.dispatchEvent(l),t.$el.style.height=t.height+"px",(l=new Event("parentResize",{bubbles:!1})).height=t.$el.offsetHeight-25,a.style.height=l.height+"px",setTimeout((()=>{a.dispatchEvent(l)}),2)}}},updated(){for(var e=this.$el.children,t=1;t<e.length;t++)e[t].tagName&&(t-1===this.currentTabIndex&&(e[t].style.display="",e[t].style.height=this.$el.offsetHeight-e[0].offsetHeight+"px"),t-1===this.currentTabIndex?e[t].classList.remove("hide"):e[t].classList.add("hide"))},mounted(){for(var e=this,t=e.$el.children,a=1;a<t.length;a++)t[a].style.display="none",e.tabs.push({title:""+t[a].getAttribute("tab")});e.$el.addEventListener("parentResize",(a=>{e.$el.style.height=a.height+1+"px",e.height=a.height+1;var l=new Event("parentResize",{bubbles:!1});l.height=e.$el.offsetHeight-25,l.target=e.$el,l.$target=e;for(var o=1;o<t.length;o++)"none"!=t[o].style.display&&(console.log("Se envia el alto "+l.height),t[o].style.height=l.height+"px",t[o].dispatchEvent(l));e.$emit("resize",l)})),t[1+e.currentTabIndex].setAttribute("active",1);var l=new Event("tabChange",{bubbles:!1});l.$target=e,t[1+e.currentTabIndex].dispatchEvent(l)}};const _hoisted_1$8={class:"v-tab-nav"},_hoisted_2$6=["onClick"];function render$c(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",{class:"v-tabview",style:Vue$1.normalizeStyle({height:o.height+"px"})},[Vue$1.createElementVNode("ul",_hoisted_1$8,[(Vue$1.openBlock(!0),Vue$1.createElementBlock(Vue$1.Fragment,null,Vue$1.renderList(o.tabs,((e,t)=>(Vue$1.openBlock(),Vue$1.createElementBlock("li",{class:Vue$1.normalizeClass({"v-selected":t==o.currentTabIndex}),key:t,onClick:e=>o.currentTabIndex=t},Vue$1.toDisplayString(e.title),11,_hoisted_2$6)))),128))]),Vue$1.renderSlot(e.$slots,"default")],4)}script$c.render=render$c,script$c.__file="src/v-tabview.vue";var script$b={props:{value:{type:String}},data:()=>({}),template:"<textarea>{{value}}</textarea>",updated(){var e=this,t=e.value;t&&e.$el.maxLength>0&&t.length>e.$el.maxLength&&(t=t.substring(0,e.$el.maxLength)),e.$el.value=t,e.$emit("input",t),e.delayedResize()},methods:{resize(){var e=this.$el;e.style.height="auto",e.style.height=e.scrollHeight+"px"},delayedResize(){window.setTimeout(this.resize,100)}},mounted(){var e=this;e.$el.addEventListener("keyup",(()=>{e.$emit("input",e.$el.value)}));var t,a=e.$el;(t=window.attachEvent?function(e,t,a){e.attachEvent("on"+t,a)}:function(e,t,a){e.addEventListener(t,a,!1)})(a,"change",e.resize),t(a,"cut",e.delayedResize),t(a,"paste",e.delayedResize),t(a,"drop",e.delayedResize),t(a,"keydown",e.delayedResize)}};function render$b(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("textarea",null,Vue$1.toDisplayString(a.value),1)}script$b.render=render$b,script$b.__file="src/v-textarea.vue";var script$a={props:{required:null,readonly:null,multiple:null,label:null,disabled:null,autoload:null},data:()=>({autoload_:!0,ik:0,lastLoad:null,data:[],popup:null,show:!1,sel:[],sela:null}),created(){var e=this;e.autoload_=!(e.autoload+""=="false"||1*e.autoload==0)},mounted(){this.internalLoad(),this.updateSelect()},watch:{disabled(e){var t=this.lastLoad,a=this;!e&&t&&(this.$el.disabled=!1,setTimeout((function(){a.load(t[0],t[1])}),50))},readonly(e){let t=this.lastLoad,a=this;!e&&t&&(this.$el.disabled=!1,setTimeout((()=>{a.load(t[0],t[1])}),50))},show(e){if(e){var t=this.$el.childNodes[1];this.popup||(this.popup=this.$el.childNodes[2],this.popup.style.position="absolute",this.popup.style.backgroundColor="white",document.body.append(this.popup));var a=t.getBoundingClientRect();this.popup.style.top=a.bottom+0+"px",this.popup.style.left=a.left+0+"px"}else this.$parent.load&&this.$parent.load()}},updated(){this.updateSelect()},methods:{expand(){console.log("click")},updateSelect(){var e=this,t=e.$attrs.value;null!=t&&t.target&&(t=t.value);var a=e.$el.childNodes[0],l=a.selectedIndex;t&&""!==t||(a.selectedIndex=0);for(var o=0;o<a.length;o++)a[o].value==t&&(a.selectedIndex=o);for(var r=0;r<e.$children.length;r++)if(e.$children[r].getValueByIndex){var n=e.$children[r].getValueByIndex(l-1);e.$children[r].getIndexByValue(t,(function(l,o){if(l>-1){a.selectedIndex=l+1;var i=e.$children[r].getValueByIndex(a.selectedIndex-1);i=-1==i?null:e.$children[r].filterList[a.selectedIndex-1];var s=Number(n);(s=isNaN(s)?n?!!t&&(t.id?t.id==n.id:t==n):!t:s==Number(t))||(e.$el.id&&(console.log("emit input ."+e.$el.id+"="+JSON.stringify(t)),console.log("ffound=",i)),e.$emit("input",t,{value:t,select:a,option:a[a.selectedIndex],target:e,object:i}))}}))}},internalLoad(){var e=this;e.autoload_=!(e.autoload+""=="false"||1*e.autoload==0);let t=e.$attrs.value;null!=t&&t.target&&(t=t.value);var a=e.$el.childNodes[0];t&&""!==t||(a.selectedIndex=0),t=e.$attrs.value;for(let e=0;e<a.length;e++)a[e].value==t&&(a.selectedIndex=e);e.autoload_&&e.load(),e.$emit("mounted",e),e.$on("changed",(function(t){let a=t.querySelectorAll("option"),l=[];for(let e=0;a.length>e;e++)l.push({value:a[e].value,label:a[e].textContent});e.data=l}))},load(e,t){let a=this;a.$children.forEach((a=>{a.load&&a.load(e,t)})),a.disabled||a.readonly?a.lastLoad=[e,t]:a.lastLoad=null},toggle(){this.show=!this.show},selectAll(){for(var e=[],t=0;t<this.data.length;t++)e.push(this.data[t].value);this.sel=e,this.ik++},checkboxInput(){var e=this.sel;e&&e.length&&(e=e.join(",")),this.$emit("input",e)},onChange(e){var t=this,a=this.$el.childNodes[0];e&&""!==e||(e=null,a.selectedIndex=0);for(var l,o=0,r=0;r<t.$children.length;r++){if(-1!=(o=t.$children[r].getValueByIndex(a.selectedIndex-1))){l=t.$children[r].filterList[a.selectedIndex-1];break}o=0}o?e=o:t.$children.length&&(a.selectedIndex=0),t.$emit("input",e,{value:e,select:a,option:a[a.selectedIndex],target:t,object:l})}}};const _hoisted_1$7={class:"v-select",style:{position:"relative"}},_hoisted_2$5=["required","disabled","click"],_hoisted_3$3={style:{padding:"5px",border:"1px solid lightgray"}},_hoisted_4$2={class:"_ ui-widget ui-state-default ui-corner-all",style:{padding:"5px 5px 1px 5px","margin-bottom":"5px"}};function render$a(e,t,a,l,o,r){const n=Vue$1.resolveComponent("v-checkbox"),i=Vue$1.resolveComponent("v-checkbox-group");return Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_1$7,[a.readonly?Vue$1.createCommentVNode("v-if",!0):Vue$1.withDirectives((Vue$1.openBlock(),Vue$1.createElementBlock("select",{key:0,style:{width:"100%"},onChange:t[0]||(t[0]=e=>r.onChange(e.target.value)),required:a.required,disabled:a.disabled,click:r.expand},[Vue$1.renderSlot(e.$slots,"default")],40,_hoisted_2$5)),[[Vue$1.vShow,!a.multiple]]),a.multiple?(Vue$1.openBlock(),Vue$1.createElementBlock(Vue$1.Fragment,{key:1},[Vue$1.createElementVNode("div",{class:Vue$1.normalizeClass(["v-widget-header",{"v-selected":o.show}]),style:{"padding-top":"3px","padding-bottom":"3px"},onClick:t[1]||(t[1]=(...e)=>r.toggle&&r.toggle(...e))}," ",2),Vue$1.withDirectives(Vue$1.createElementVNode("div",_hoisted_3$3,[Vue$1.createElementVNode("div",_hoisted_4$2,[Vue$1.createVNode(n,{modelValue:o.sela,"onUpdate:modelValue":t[2]||(t[2]=e=>o.sela=e),onInput:r.selectAll},null,8,["modelValue","onInput"])]),(Vue$1.openBlock(),Vue$1.createBlock(i,{key:"p"+o.ik,modelValue:o.sel,"onUpdate:modelValue":t[3]||(t[3]=e=>o.sel=e),onInput:r.checkboxInput},{default:Vue$1.withCtx((()=>[o.data.length?(Vue$1.openBlock(!0),Vue$1.createElementBlock(Vue$1.Fragment,{key:0},Vue$1.renderList(o.data,(e=>(Vue$1.openBlock(),Vue$1.createElementBlock("div",null,[Vue$1.createVNode(n,{value:e.value,label:e.label},null,8,["value","label"])])))),256)):Vue$1.createCommentVNode("v-if",!0)])),_:1},8,["modelValue","onInput"]))],512),[[Vue$1.vShow,o.show]])],64)):Vue$1.createCommentVNode("v-if",!0),a.readonly?(Vue$1.openBlock(),Vue$1.createElementBlock(Vue$1.Fragment,{key:2},[Vue$1.createTextVNode(Vue$1.toDisplayString(a.label?a.label:"---"),1)],64)):Vue$1.createCommentVNode("v-if",!0)])}script$a.render=render$a,script$a.__file="src/v-select.vue";var script$9={props:{value:{value:Object}},data:()=>({options:["NO","SI"],selected:null}),mounted(){var e=this,t=""+e.value;e.selected="true"===t?"SI":"false"===t?"NO":null,e.$emit("input",e.value)},updated(){var e=this,t=""+e.value;e.selected="true"===t?"SI":"false"===t?"NO":null,e.$emit("input",e.value)},methods:{onChange(e){this.selected=e,this.$emit("input","SI"===e||"NO"!==e&&null)}}};const _hoisted_1$6=["value","data-value"],_hoisted_2$4=["onClick"];function render$9(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",{value:!1===a.value?"false":a.value,"data-value":""+a.value},[(Vue$1.openBlock(!0),Vue$1.createElementBlock(Vue$1.Fragment,null,Vue$1.renderList(o.options,(e=>(Vue$1.openBlock(),Vue$1.createElementBlock("div",{onClick:t=>r.onChange(e),style:Vue$1.normalizeStyle("cursor:pointer;border: 1px solid #000;text-align:center;display:inline-block;width:calc(50% - 2px)"+(e===o.selected?"":";opacity: 0.5")),class:Vue$1.normalizeClass({"v-selected":e==o.selected})},Vue$1.toDisplayString(e),15,_hoisted_2$4)))),256))],8,_hoisted_1$6)}script$9.render=render$9,script$9.__file="src/v-switch.vue";var script$8={props:{delay:null},data:()=>({v:null}),created(){this.v=this.value},methods:{input(){var e=this,t=e.$el,a=e.v,l=Vue.n;if(a){a=l(a),e.max&&a>l(e.max)&&(a=l(e.max)),e.min&&a<l(e.min)&&(a=l(e.min));var o=t.getAttribute("decimal");null!==o&&(a=a.toFixed(1*o))}else a=null;a=event.target.value;var r=Vue.calendarTimer;r&&clearTimeout(r),e.delay?Vue.calendarTimer=setTimeout((function(){e.$emit("input",a),Vue.calendarTimer=null}),13===event.keyCode?0:e.delay):e.$emit("input",a)}}};function render$8(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("input",{type:"number",onKeyup:t[0]||(t[0]=Vue$1.withKeys(((...e)=>r.input&&r.input(...e)),["enter"])),"vmodel.number":"v",onInput:t[1]||(t[1]=(...e)=>r.input&&r.input(...e)),class:"_"},null,32)}script$8.render=render$8,script$8.__file="src/v-number.vue";var script$7={props:{url:String,src:String,displayField:String,data:Array,store:null,valueField:String,filters:null,filter:null,mode:null},watch:{data(){this.$parent.updateSelect()}},data:()=>({queue:[],data2:[],valueField_:[],lastLoad:null,loaded:null}),computed:{filterList(){var e=this;return e.data2&&e.filter?e.data2.filter((t=>-1!==JSON.stringify(t).toLowerCase().indexOf(e.filter.toLowerCase()))):e.data2}},created(){var e=this;e.data&&(e.data2=e.data)},updated(){let e=this;!e.loaded&&e.data&&(e.data2=e.data);let t=e.$el.parentElement;for(;e.$el.childNodes.length>0;)t.appendChild(e.$el.childNodes[0]);e.$parent.$emit("changed",t),e.$parent.updateSelect()},mounted(){var e=this;e.valueField&&(e.valueField_=e.valueField.split(".")),e.$parent&&e.$parent.updateSelect()},methods:{getParentE(){return this.$el.parentElement.parentElement},getIndexByValue(e,t){e&&e.id?e=e.id:e&&e.code&&(e=e.code);for(var a=0;a<this.filterList.length;a++)if(this.getValueField(this.filterList[a])==e)return t&&t(a),a;return t&&t(-1),-1},getValueByIndex(e){var t=this.filterList;return t?this.getValueField(t[e],1):null},getValueField(e,t){var a=this.valueField_;if(a&&a.length)for(var l=0;l<a.length;l++)e&&(e=e[a[l]]);else e&&!t&&(e=e.id?e.id:e.code?e.code:e);return e},getSelectedItem(){var e=this.$el.parentElement;return this.filterList[e.selectedIndex-1]},async load(e,t,a){let l=this;if(a||l.queue.push([e,t]),l.queue.length>1)return;let o=l.$el.parentElement;if(l.data2=l.data,l.data2||(l.data2=[]),l.store){console.log(l);let t=await l.$root.$children[0].getStoredList(l.store,e);const[a]=e?Object.keys(e):[];if(a)try{var r,n=t.filter((t=>(r=t,this.getParentE().id&&console.log(t[a]+" c "+e[a]+" = "+t[a].startsWith(e[a])),t[a].startsWith(e[a]))));l.data2=l.data2.concat(n)}catch(e){console.log("Error trying to filter ",r),console.error(e)}else l.data2=l.data2.concat(t);var i=l.displayField;l.data2=l.data2.sort((function(e,t){return e[i]>t[i]?1:e[i]<t[i]?-1:void 0}))}for(!l.url&&!l.src||o.disabled||(l.data2||(l.data2=[]),l.filters&&(e=window.Vue.mergeDeep(e||{},l.filters)),await window.axios.get(l.url?l.url:l.src,{params:e}).then((e=>{var a=e.data.data?e.data.data:e.data;l.$emit("loaded",{target:l,data:a}),l.data2=l.data2.concat(a),l.loaded=1,l.$parent.$forceUpdate(),t&&t()})).catch((()=>{}))),a||l.queue.shift();l.queue.length;){var s=l.queue.shift();await l.load(s[0],s[1],1)}}}};const _hoisted_1$5=["title"],_hoisted_2$3=["value"];function render$7(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",{title:a.data?a.data.length:0},[(Vue$1.openBlock(!0),Vue$1.createElementBlock(Vue$1.Fragment,null,Vue$1.renderList(r.filterList,((t,l)=>(Vue$1.openBlock(),Vue$1.createElementBlock("option",{key:l,value:r.getValueField(t)},[Vue$1.createTextVNode(Vue$1.toDisplayString(t[a.displayField])+" ",1),Vue$1.renderSlot(e.$slots,"default",{item:t})],8,_hoisted_2$3)))),128))],8,_hoisted_1$5)}script$7.render=render$7,script$7.__file="src/v-options.vue";var script$6={props:{value:String,onlyicon:Boolean,click:null,icon:String,domain:String},mounted(){var e=this;setTimeout((function(){e.$el.querySelector("svg").dataset.icon="image"}),1e3)},updated(){var e=this;setTimeout((function(){e.$el.querySelector("svg").dataset.icon="image"}),1e3)},data:()=>({uploadPercentage:0,showProgress:!1}),methods:{other(){this.click&&this.click(this)},handleFileUpload(){this.uploadPercentage=0,this.submitFile(this.$el.children[0].children[0].files[0])},submitFile(e,t){var a=this,l=new FormData;t=t||e.name.replace(/[^\w\s.]/gi,""),l.append("filename",t),l.append("file",e,t),a.showProgress=!0,axios.post((a.domain?a.domain:"")+"/api/file/upload",l,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:function(e){this.uploadPercentage=parseInt(Math.round(e.loaded/e.total*100))}.bind(this)}).then((function(e){a.$emit("input",e.data),a.showProgress=!1})).catch((function(){console.log("FAILURE!!")}))}}};const _hoisted_1$4={style:{cursor:"pointer"},class:""},_hoisted_2$2=["data-icon"],_hoisted_3$2=[".value"];function render$6(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",{onClick:t[1]||(t[1]=(...e)=>r.other&&r.other(...e)),class:Vue$1.normalizeClass([a.onlyicon?"":"v-button ui-widget ui-state-default ui-corner-all","v-uploader"]),style:Vue$1.normalizeStyle({padding:a.onlyicon?"0px":""})},[Vue$1.createElementVNode("label",_hoisted_1$4,[a.click?Vue$1.createCommentVNode("v-if",!0):(Vue$1.openBlock(),Vue$1.createElementBlock("input",{key:0,type:"file",onChange:t[0]||(t[0]=e=>r.handleFileUpload())},null,32)),Vue$1.createElementVNode("i",{class:Vue$1.normalizeClass(["fa",a.icon?a.icon:"fa-upload"]),"data-icon":a.icon,style:Vue$1.normalizeStyle({marginRight:a.onlyicon||""==a.value?"":"10px"})},null,14,_hoisted_2$2),Vue$1.createTextVNode(Vue$1.toDisplayString(a.onlyicon?"":null!=a.value?a.value:"Adjuntar Archivo")+" ",1),o.showProgress?(Vue$1.openBlock(),Vue$1.createElementBlock("progress",{key:1,max:"100",style:{width:"100%"},".value":o.uploadPercentage},null,40,_hoisted_3$2)):Vue$1.createCommentVNode("v-if",!0)])],6)}script$6.render=render$6,script$6.__file="src/v-uploader.vue";var script$5={props:{header:String}};const _hoisted_1$3={class:"ui-panel"},_hoisted_2$1={key:0,class:"v-panel-titlebar v-widget-header ui-helper-clearfix ui-corner-all"},_hoisted_3$1={class:"v-panel-title"},_hoisted_4$1={class:"v-panel-content v-dialog-content v-widget-content"};function render$5(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_1$3,[a.header?(Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_2$1,[Vue$1.createElementVNode("span",_hoisted_3$1,Vue$1.toDisplayString(a.header),1)])):Vue$1.createCommentVNode("v-if",!0),Vue$1.createElementVNode("div",_hoisted_4$1,[Vue$1.renderSlot(e.$slots,"default")])])}script$5.render=render$5,script$5.__file="src/v-panel.vue";var script$4={data:()=>({loaded:null,map:null,feature2:null,district:null,pl:null,selection:null,dl:null,scope:null,lastScope:null,unmove:null}),methods:{setScope(e,t){var a=this,l=a.map;if(console.log("me.map="+a.map),e!=a.lastScope)if(e<100&&(e*=1e4),a.scope=e,0==a.scope)l.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],l.getSize()),a.lastScope=e,l.getLayerById("districts").getSource().clear(),a.$emit("scope",{feature:{getId:()=>null},target:a});else if(l){if(e>9999){for(var o=l.getLayerById("districts"),r=o.getSource().getFeatures(),n=0;n<r.length;n++)if(1*r[n].id_==e){o.onChange({feature:r[n]});break}}else if(e){var i=l.getLayerById("provinces");for(e=1*(e.value?e.value:e),r=i.getSource().getFeatures(),n=0;n<r.length;n++)if(1*r[n].id_==e){i.onChange({feature:r[n]});break}}}else a.lastScope=e;else l.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],l.getSize())}},created(){var e=this;return e.$parent.$on("build",(t=>{var a=document.createElement("i"),l=t.map;e.selection=new ol.Collection;var o=e.selection;a.setAttribute("class","fa fa-expand"),l.addControl(new ol.control.FullScreen({label:a,tipLabel:"Fullscreen"}));var r=new ol.source.Vector({url:(axios.defaults.baseURL?axios.defaults.baseURL:"")+"/fs/geo/02.geojson",format:new ol.format.GeoJSON}),n=e.pl=new ol.layer.Vector({source:r,style:e=>new ol.style.Style({fill:new ol.style.Fill({color:"rgba(255, 0, 0, 0.0)"}),stroke:new ol.style.Stroke({color:"#4073CE",width:1}),text:new ol.style.Text({text:e.values_.name?e.values_.name.toUpperCase():"",fill:new ol.style.Fill({color:"#4073CE"}),stroke:new ol.style.Stroke({color:"#4073CE",width:.5})})}),id:"provinces"}),i=r.on("change",(()=>{var t=e.scope;t>9999&&(t=Math.floor(t/100));for(var a=r.getFeatures(),l=0;l<a.length;l++)if(1*a[l].id_==1*t){n.onChange({feature:a[l]});break}Observable.unByKey(i)})),s=new ol.layer.Vector({preload:1/0,source:new ol.source.Vector,id:"districts",style:e=>new ol.style.Style({fill:new ol.style.Fill({color:"rgba(16, 110, 138, 0.0)"}),stroke:new ol.style.Stroke({color:"#194300",width:1}),text:new ol.style.Text({text:e.values_.name?e.values_.name.toUpperCase():"",fill:new ol.style.Fill({color:"#194300"}),stroke:new ol.style.Stroke({color:"#194300",width:.5})})})}),d=()=>{if(e.feature2){if(e.feature2.id_<1e4){s.setSource(new ol.source.Vector({url:(axios.defaults.baseURL?axios.defaults.baseURL:"")+"/fs/geo/"+e.feature2.id_+".geojson",format:new ol.format.GeoJSON}));var t=s.getSource().on("change",(()=>{if(e.scope>0)for(var a=s.getSource().getFeatures(),l=e.scope,o=0;o<a.length;o++)if(1*a[o].id_==l){e.scope=0,s.onChange({feature:a[o]});break}Observable.unByKey(t)}))}console.log("emit scopee "+e.feature2.id_),e.$emit("scope",{feature:e.feature2,target:e}),e.feature2=null,console.log("layer moveend termina")}};l.on("moveend",d),n.onChange=t=>{var a=t.feature;e.lastScope!=a.getId()&&(o.clear(),o.push(a),t.preventDefault&&t.preventDefault(),e.lastScope=a.getId(),e.feature2=a,e.unmove?d():l.getView().fit(a.getGeometry().getExtent(),{duration:300}))},n.onSelect=t=>{e.$emit("select",t)},l.addLayer(n),l.addLayer(new ol.layer.Vector({id:"district",source:new ol.source.Vector,style:new ol.style.Style({fill:new ol.style.Fill({color:"rgba(255, 150, 150, 0.0)"}),stroke:new ol.style.Stroke({color:"#4073CE",width:1})})})),new ol.style.Style({fill:new ol.style.Fill({color:"rgba(16, 110, 138, 5.0)"})}),new ol.style.Style({fill:new ol.style.Fill({color:"rgba(255, 150, 150, 0.0)"})}),s.onChange=t=>{var a=t.feature;e.lastScope!=a.getId()&&(2==o.getLength()&&o.pop(),o.push(a),t.preventDefault&&t.preventDefault(),e.lastScope=a.getId(),e.feature2=a,e.unmove?d():l.getView().fit(a.getGeometry().getExtent(),{duration:300}))},s.onSelect=t=>{e.$emit("select",t)},l.addLayer(s),e.map=l,e.$emit("render",e)})),null}};function render$4(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",null,[Vue$1.renderSlot(e.$slots,"default")])}script$4.render=render$4,script$4.__file="src/v-layer-control.vue";var script$3={mounted(){this.$emit("beforeBuild"),this.build()},data:()=>({moved:!1,map:null,movingCompleted:null,collection:null,styleMap:null,coordinate:{}}),methods:{addLayer(e){this.map.addLayer(e),this.$emit("addlayer",e)},urlParam(e,t){t||(t=window.location.href);var a=new RegExp("[?&]"+e+"=([^&#]*)").exec(t);return a&&a[1]||0},addFeature(e,t){e=e||{};var a,l=this,o=l.map;if(e.lon&&e.lat){var r=[e.lon,e.lat];a=new ol.geom.Point(r[0]>-100?ol.proj.fromLonLat(r):r)}else a=new ol.geom.Point(o.getView().getCenter());r=(r=a.flatCoordinates)[0]<-1e4?ol.proj.toLonLat(r):r;l.$emit("translateend",{lon:r[0],lat:r[1]}),e.geometry=a;var n=new ol.Feature(e);if(n.data=e,e.draggable){var i=new ol.Collection;i.push(n);var s=new ol.interaction.Translate({features:i});s.on("translateend",(e=>{var t=ol.proj.toLonLat(e.coordinate);l.$emit("translateend",{lon:t[0],lat:t[1]})})),s.on("translatestart",(e=>{l.selectedFeature=e.features.getArray()[0]})),n.interactionCollection=i,l.map.addInteraction(s)}if("object"==typeof e.style?n.setStyle(e.style):n.setStyle(l.styleMap[e.style?e.style:"default"]),r=(r=a.flatCoordinates)[0]<-1e4?ol.proj.toLonLat(r):r,l.$emit("translateend",{lon:r[0],lat:r[1]}),null!=e.layer){var d=o.getLayerById(e.layer);d?d.getSource().addFeatures(n):o.addLayer(new ol.layer.Vector({id:e.layer,source:new ol.source.Vector({features:new ol.Collection([n])})}))}else l.collection.push(n);return t&&(console.log(n.getGeometry().getCoordinates()),l.map.getView().animate(Object.assign({center:n.getGeometry().getCoordinates(),zoom:17,duration:500},t))),n},animate(e){this.map.getView().animate(e),this.movingCompleted=e.complete},build(){var e=this;e.styleMap={default:new ol.style.Style({image:new ol.style.Circle({radius:8,stroke:new ol.style.Stroke({color:"#8a0000",width:2}),fill:new ol.style.Fill({color:"#ff0000"})})}),star:[new ol.style.Style({image:new ol.style.RegularShape({fill:new ol.style.Fill({color:"#ff0000"}),stroke:new ol.style.Stroke({color:"#8a0000",width:2}),points:5,radius:10,radius2:4,angle:0})})]};var t=e.urlParam("location"),a=-1;if(t){var l=t.split("/");t=[parseFloat(l[0]),parseFloat(l[1])],a=l[2],e.moved=!0}else t=!1;var o=new ol.Map({target:e.$el,layers:[new ol.layer.Tile({source:new ol.source.OSM({})})],view:new ol.View({})});o.getLayerById=function(e){var t;return o.getLayers().forEach((a=>{a.get("id")!==e||(t=a)})),t},o.styleMap=e.styleMap,o.addLayer(new ol.layer.Vector({source:new ol.source.Vector({features:e.collection=new ol.Collection})})),e.moved?(o.getView().setCenter(t),console.log("en el momento de cargar moved to pageLocation="+t),o.getView().setZoom(a||12),e.map=o,console.log("distarar evento buid pageLocation="+t),e.$emit("build",e)):(console.log("En caso no exista una coordenada se usara se fijara a los limites de la region"),_.getCurrentPosition().then((t=>{o.getView().setCenter(ol.proj.fromLonLat([t.coords.longitude,t.coords.latitude])),o.getView().setZoom(12),e.map=o,e.$emit("build",e)}),(t=>{o.getView().fit([-8756221.995832639,-1207995.483261405,-8541070.763947014,-899052.0546471546],o.getSize()),e.map=o,e.$emit("build",e)})));var r=o.getView().getZoom();o.on("moveend",(t=>{this.movingCompleted&&(this.movingCompleted(e),this.movingCompleted=null);var a=o.getView().getZoom();r!=a&&(r=a,e.$children.forEach((function(e){e.$vnode.tag.endsWith("v-overlay")&&e.$emit("zoom",a)})))})),o.on("singleclick",(e=>{var t=o.forEachFeatureAtPixel(e.pixel,((e,t)=>{if(t)return[e,t]}));if(t){var a=t[1];t=t[0];if(e.feature=t,e.map=o,e.preventDefault(),a.onSelect)return void a.onSelect(e)}})),o.on("dblclick",(t=>{var a=o.forEachFeatureAtPixel(t.pixel,((e,t)=>{if(t)return[e,t]}));if(a){var l=a[1];a=a[0];if(t.feature=a,t.map=o,l.onChange)return console.log("dbclick manda event onchangue"),void l.onChange(t);e.$emit("change",a),o.getView().animate({center:a.getGeometry().getCoordinates(),zoom:17,duration:500},(()=>{for(var a=0;a<e.$children.length;a++){var l=e.$children[0];l.open&&l.open(t)}}))}})),o.getViewport().parentNode.addEventListener("parentResize",(t=>{setTimeout((()=>{o.updateSize(),e.$emit("resize",o)}),100)})),Vue.resize()}}};function render$3(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",null,[Vue$1.renderSlot(e.$slots,"default")])}script$3.render=render$3,script$3.__file="src/v-map.vue";var script$2={props:{icon:String,visible:{default:1}},computed:{slotPassed(){return!!this.$slots.default}},data:()=>({ready:null,visible0:null,slotUsed:!1}),updated(){var e=this.$el.querySelectorAll(":scope > :not(.v-map-control-button)").length;0==e&&(e=this.$el.textContent.trim().length),this.slotUsed=e},created(){this.visible0=!!this.visible},mounted(){var e=this;e.slotUsed=!!this.$slots.default,e.$parent.map?(e.$parent.map.addControl(new ol.control.Control({element:e.$el})),e.ready=!0):e.$parent.$on("build",(t=>{t.map.addControl(new ol.control.Control({element:e.$el})),e.ready=!0}))},methods:{enter(e){e.x&&this.$emit("click",e)},toggle(){this.visible0=!this.visible0}}};const _hoisted_1$2={class:"ol-unselectable ol-control"};function render$2(e,t,a,l,o,r){return Vue$1.withDirectives((Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_1$2,[Vue$1.renderSlot(e.$slots,"default"),o.slotUsed?Vue$1.createCommentVNode("v-if",!0):(Vue$1.openBlock(),Vue$1.createElementBlock("button",{key:0,class:"v-map-control-button",onClick:t[0]||(t[0]=Vue$1.withModifiers(((...e)=>r.enter&&r.enter(...e)),["prevent"]))},[a.icon?(Vue$1.openBlock(),Vue$1.createElementBlock("i",{key:0,class:Vue$1.normalizeClass(["fa fa-xs",a.icon])},null,2)):Vue$1.createCommentVNode("v-if",!0)]))],512)),[[Vue$1.vShow,o.ready&&o.visible0]])}script$2.render=render$2,script$2.__file="src/v-map-control.vue";var ol$1=window.ol,_$2=window._,axios$1=window.axios,script$1={props:{value:{value:Object},src:String,width:{default:400},header:String},data:()=>({coordinate:null,overlay:null,location:null,ele:null,c:0}),created(){var e=this;e.$parent.$on("beforeBuild",(t=>{console.log(t),e.overlay=new ol$1.Overlay({element:e.$el,positioning:"bottom-right"})})),e.$parent.$on("build",(t=>{t.map.addOverlay(e.overlay)}))},mounted(){var e=this;e.header&&e.$el.childNodes[0].addEventListener("mousedown",(function(t){const a=e.$el.parentElement;var l=window.getComputedStyle(a),o=parseFloat(l.left),r=parseFloat(l.top),n=t.clientX,i=t.clientY,s=a.parentElement;function d(e){a.style.left=o+e.clientX-n+"px",a.style.top=r+e.clientY-i+"px"}s.addEventListener("mousemove",d,!1),s.addEventListener("mouseup",(function(){s.removeEventListener("mousemove",d,!1)}),!1)}),!1)},methods:{close(){this.overlay&&this.overlay.setPosition()},hasSlot(e="default"){return!!this.$slots[e]||!!this.$scopedSlots[e]},load(){var e=this;axios$1.get(_$2.remoteServer+e.src).then((t=>{e.$emit("input",t.data)}))},open(e){for(var t=this,a=e.map,l=e.feature,o=t.overlay,r=o.element,n=t.$parent.$children,i=0;i<n.length;i++)n[i].close&&(n[i].$el.style.opacity=0,n[i].close());e.coordinate?t.coordinate=e.coordinate:(e.coordinate=a.getView().getCenter(),t.coordinate=null),o.setPosition(e.coordinate);var s=a.getView().getCenter(),d=a.getView().getResolution(),c=l?l.getGeometry().getCoordinates():[null],u=a.getPixelFromCoordinate(Number(c[0])?c:e.coordinate);if(this.src)axios$1.get(_$2.remoteServer+this.src).then((e=>{t.$emit("input",e.data),t.c++,setTimeout((function(){var e=a.viewport_.offsetWidth,l=a.viewport_.offsetHeight,n=r.children[0].children[1];n.scrollTop=0;var i=r.offsetHeight;n.style.height=i+100>=l?l-100-r.children[0].children[0].offsetHeight+"px":"300px",i=r.offsetHeight;var c=1*t.width,p=e<=c+40?e-40:c;if(r.style.zIndex=10,r.style.width=p+"px",p/=2,a.getView().animate({center:[s[0]+(u[0]+p+20>=e?+(u[0]+p+20-e):u[0]-20-p<0?-p+u[0]-20:0)*d,s[1]+(u[1]<i?i-u[1]:0)*d],duration:500}),u[0]=u[0]+p-0,u[1]=u[1]-12,o.setPosition(a.getCoordinateFromPixel(u)),t.$el.style.opacity=1,_$2.mobil)for(var h=o.getElement().querySelectorAll("a:not(._)"),v=0;v<h.length;v++)h[v].addEventListener("click",_$2.open2)}),400)})).catch((e=>{console.log(e)}));else{var p=a.viewport_.offsetWidth,h=a.viewport_.offsetHeight,v=r.children[0].children[1];v.scrollTop=0;var g=r.offsetHeight;console.log(r.offsetHeight),v.style.height=g+100>=h?h-100-r.children[0].children[0].offsetHeight+"px":"300px",g=r.offsetHeight;var m=1*t.width,f=p<=m+40?p-40:m;if(r.style.zIndex=10,r.style.width=f+"px",f/=2,a.getView().animate({center:[s[0]+(u[0]+f+20>=p?+(u[0]+f+20-p):u[0]-20-f<0?-f+u[0]-20:0)*d,s[1]+(u[1]<g?g-u[1]:0)*d],duration:500}),u[0]=u[0]+f-0,u[1]=u[1]-12,o.setPosition(a.getCoordinateFromPixel(u)),t.$el.parentNode.style.opacity=0,t.$el.style.opacity=1,t.$el.parentNode.style.top=(h-t.$el.offsetHeight)/2+"px",t.$el.parentNode.style.opacity=1,_$2.mobil){var $=o.getElement().querySelectorAll("a:not(._)");for(i=0;i<$.length;i++)$[i].addEventListener("click",_$2.open2)}t.$emit("opened",{target:t})}}}};const _hoisted_1$1={class:"v-ol-overlay"},_hoisted_2={key:0,class:"v-panel-titlebar"},_hoisted_3=Vue$1.createElementVNode("i",{class:"fa fa-times"},null,-1),_hoisted_4=[_hoisted_3],_hoisted_5={key:2,style:{"text-align":"center"}},_hoisted_6=Vue$1.createElementVNode("img",{src:_imports_0,width:"20",height:"18"},null,-1),_hoisted_7=[_hoisted_6];function render$1(e,t,a,l,o,r){return Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_1$1,[a.header?(Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_2,[Vue$1.createElementVNode("span",{class:"v-icon v-icon-close",onClick:t[0]||(t[0]=(...e)=>r.close&&r.close(...e))},[..._hoisted_4]),Vue$1.createTextVNode(Vue$1.toDisplayString(a.header),1)])):Vue$1.createCommentVNode("v-if",!0),(Vue$1.openBlock(),Vue$1.createElementBlock("div",{class:"v-ol-body",key:"c-"+o.c,style:{padding:"10px"}},[a.value?Vue$1.renderSlot(e.$slots,"default",{key:0,value:a.value}):Vue$1.createCommentVNode("v-if",!0)])),r.hasSlot("footer")&&a.value?(Vue$1.openBlock(),Vue$1.createElementBlock("footer",{key:"f-"+o.c},[Vue$1.renderSlot(e.$slots,"footer",{value:a.value})])):Vue$1.createCommentVNode("v-if",!0),o.coordinate?(Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_5,[..._hoisted_7])):Vue$1.createCommentVNode("v-if",!0)])}script$1.render=render$1,script$1.__file="src/v-overlay.vue";var script={data:()=>({show:null,overlay:null}),mounted(){var e=this;e.$el.addEventListener("close",(function(){e.hide()}))},destroyed(){var e=this.overlay;e&&(e.style.visibility="hidden",e.style.opacity=0,e.remove(),e=null)},methods:{hide(){var e=this.overlay;e&&(e.style.visibility="hidden",e.style.opacity=0),this.show=0},toggle(){var e=this;e.show=!e.show;var t=e.overlay;if(e.show){var a=document.querySelector(".v-layout-north");e.$el.style.top=a.offsetHeight+"px",console.log(e.$el),t||((t=document.createElement("div")).classList.add("v-overlay"),t.style.padding="40px",t.addEventListener("click",(function(){t.style.visibility="hidden",t.style.opacity=0,e.show=!1})),document.body.appendChild(e.overlay=t)),t.style.visibility="unset",t.style.opacity="unset"}else this.hide()}}};const _hoisted_1={class:"v-popup",style:{position:"absolute"}};function render(e,t,a,l,o,r){return Vue$1.withDirectives((Vue$1.openBlock(),Vue$1.createElementBlock("div",_hoisted_1,[Vue$1.renderSlot(e.$slots,"default")],512)),[[Vue$1.vShow,o.show]])}script.render=render,script.__file="src/v-popup.vue",window.isMobile=1,void 0===window._&&(window._={});var _$1=window._;_$1.instance||(_$1.instance=axios$2);var instance=_$1.instance;Vue$1.config.ignoredElements=[...Vue$1.config.ignoredElements||[],"v-filter","v-footer"],Vue$1.n=e=>e=e?""==e?null:Number(""+e):0,"function"!=typeof JSON.clone&&(JSON.clone=function(e){return JSON.parse(JSON.stringify(e))}),"function"!=typeof Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),a=1;a<arguments.length;a++){var l=arguments[a];if(null!=l)for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(t[o]=l[o])}return t});let buildPopupMenu=function(e){var t=e.getAttribute("v--popup");if(!t){e.setAttribute("v--popup",t=_$1.id());var a=_$1.storeFunction[t],l=e.querySelectorAll(".v-datatable-header .v-button");l&&l.length&&!a&&window.innerWidth<=700&&setTimeout((function(){(a=document.createElement("ul")).className="v-popup-2",a.style.backgroundColor="white",a.style.position="absolute",a.style.bottom="0px",a.style.fontSize="26px",a.style.right="0px",a.style.display="none",a.style.width="200px",a.style.zIndex="12000",e.appendChild(a);var o=null,r=function(){a.style.display="none";var e=this.getAttribute("commandId"),t=document.querySelector("#"+e);"BUTTON"==t.tagName?t.click():t.children[0].click(),_$1.unmask(o)};e.style.position="relative";var n=document.createElement("div");n.className="v-mobil v-table-buttons";var i=document.createElement("i");i.className="fa fa-bars fa-w-14",n.appendChild(i),n.onclick=function(){for(l=e.querySelectorAll(".v-datatable-header .v-button");a.firstChild;)a.removeChild(a.firstChild);for(i=0;i<l.length;i++)if("none"!=l[i].style.display){var t=document.createElement("li");if(l[i].id||(l[i].id="c-"+_$1.id()),t.setAttribute("commandId",l[i].id),"BUTTON"==l[i].tagName){if(l[i].disabled)continue;t.appendChild(l[i].children[0].cloneNode(!0)),t.appendChild(document.createTextNode(l[i].value?l[i].value:l[i].title))}else l[i].children[0].children[1]&&(t.appendChild(l[i].children[0].children[1]),t.appendChild(document.createTextNode(l[i].textContent)));t.onclick=r,a.appendChild(t)}o=_$1.mask(a),a.style.display="block",o.onclick=function(){a.style.display="none",_$1.unmask(o)}},e.appendChild(n),_$1.storeFunction[t]=a}),1e3)}},resize=function(){console.log("Vue.resize2");var e=window.innerHeight;document.body.children[0].style.height=e+".px";var t=document.querySelectorAll("#page-header,.ui-layout-north,.v-layout-north,.ion-page >ion-header");t=t[0];var a,l=document.querySelectorAll(".ion-page >ion-header + .ui-panel,#page-content,.ui-layout-pane-center,.v-layout-center ,.ion-page > ion-content");if(l&&l[0]){var o,r;if("ION-CONTENT"==l[0].nodeName){var n;if(o=l[0].children[0],e=e-t.offsetHeight-0,o.style.height=e+"px",o.style.overflowY="auto",o.classList.contains("ui-panel")||(o=o.children[0]),(n=new Event("parentResize",{bubbles:!0})).height=e,o.dispatchEvent(n),o.children[1]){var i=o.children[1];"FORM"==i.children[0].tagName&&(i=i.children[0].children[0]),buildPopupMenu(i)}return}if("DIV"==l[0].nodeName)return o=l[0],console.log("==========DIV============"),console.log(o),o.style.height=e+"px",o.style.overflowY="auto",e=e-t.offsetHeight-0,o.classList.contains("ui-panel")||(o=o.children[0]),(n=new Event("parentResize",{bubbles:!0})).height=e,o.dispatchEvent(n),void(o.children[1]&&buildPopupMenu(o.children[1]));if(l[0].style.height=e-t.offsetHeight-2+"px",l[0].style.overflowY="auto",o=l[0].querySelector(".ui-panel"),console.log("==========ppp============"),console.log(o),o){if(l=o.children,t&&(e-=t.offsetHeight+l[0].offsetHeight+2),l[1]){console.log(l[1]),l[1].style.height=e+"px";var s=l[1].querySelectorAll(".v-resize,.v-datatable");for(r=0;r<s.length;r++){var d=new Event("parentResize",{bubbles:!0});d.height=e,s[r].dispatchEvent(d)}}}else{if(console.log(l[0]),!l[0].children[0])return;console.log(e);var c=l[0].children;for(r=0;r<c.length;r++){var u=new Event("parentResize",{bubbles:!0});u.height=e,c[r].dispatchEvent(u)}c=l[0].children[0].children;var p=[];for(r=0;r<c.length;r++)a=c[r],"none"!==window.getComputedStyle(a).display&&p.push(c[r]);1==p.length&&(p[0].style.overflowY="auto")}}else{var h=document.querySelectorAll(".ion-page");if(h[0]){console.log("?????????????");for(var v=0,g=0;g<h[0].childNodes.length;g++)"ION-HEADER"!=h[0].childNodes[g].nodeName&&"ION-FOOTER"!=h[0].childNodes[g].nodeName||(v+=h[0].childNodes[g].offsetHeight);var m=0;for(g=0;g<h[0].childNodes.length;g++){var f=h[0].childNodes[g];if("ION-HEADER"==f.nodeName&&(m=1),1==m&&"ION-HEADER"!=f.nodeName&&"ION-FOOTER"!=f.nodeName&&f.style){f.style.height=h[0].offsetHeight-v+"px",f.style.overflowY="auto";break}}}else console.log(12)}};function HTML2Canvas(e){this.props=e,this.ctx=e.ctx,this.lineHeight=e.lineHeight?e.lineHeight:20,this.heightText=function(e,t){var a=this.ctx,l=this,o="",r=l.lineHeight;return e.split("").forEach((e=>{o+=e,a.measureText(o).width>=t-15&&(o="",r+=l.lineHeight)})),r+=7},this.drawText=function(e,t,a,l,o,r){var n=this.ctx,i=this,s="",d=i.lineHeight+a;return n.fillStyle="#000000",e.split("").forEach((e=>{s+=e,n.measureText(s).width>=l-15&&(n.fillText(s,t,d),s="",d+=i.lineHeight)})),n.fillText(s,t+("right"==r?l-n.measureText(s).width:0),d),n.beginPath(),d+=7}}setTimeout(Vue$1.resize=resize,400),window.addEventListener("resize",(function(){setTimeout(resize,400)}));var f={value:function(e){for(var t=0;t<this.length;t++)if(this[t]==e)return!0;return!1}};if([].contains||Object.defineProperty(Array.prototype,"contains",f),"".contains||Object.defineProperty(String.prototype,"contains",f),_$1=Object.assign(_$1,{initDB(e,t){let a=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB;if(_$1.IDBTransaction=window.IDBTransaction||window.webkitIDBTransaction||window.msIDBTransaction,_$1.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange||window.msIDBKeyRange,a){if(_$1.indexedDB=a,a)return _$1.stores=t,new Promise(((l,o)=>{let r=a.open("db",e);r.onupgradeneeded=e=>{let a=e.target.result;t.forEach((e=>{a.objectStoreNames.contains(e[0])||a.createObjectStore(e[0],e[1])}))},r.onerror=e=>{o(e)},r.onsuccess=()=>{_$1.db=r.result,l(_$1.db)}}))}else window.alert("Your browser doesn't support a stable version of IndexedDB.");return a},remoteServer:"",_id:0,networkStatus:{connected:!0},storeFunction:{},varMap:{},id:()=>++_$1._id,findForm(e){var t=e.parentNode;return t&&"FORM"!=t.tagName&&(t=_$1.findForm(t)),t},contains:(e,t)=>e&&e.includes(t),uiParent:e=>e.ui||!e?e:_$1.uiParent(e.$parent),closest(e,t){for(;(e=e.parentElement)&&!(e.matches||e.matchesSelector).call(e,t););return e},fadeOut(e,t){isNaN(t)&&(t=9),document.getElementById(e).style.opacity="0."+t,document.getElementById(e).style.filter="alpha(opacity="+t+"0)",t>0&&(t--,setTimeout('fadeOut("'+e+'",'+t+")",90))},fadeIn(e,t){isNaN(t)&&(t=0),document.getElementById(e).style.opacity="0."+t,document.getElementById(e).style.filter="alpha(opacity="+t+"0)",t<9&&(t++,setTimeout('fadeIn("'+e+'",'+t+")",90))},whichChild(e){for(var t=0;null!=(e=e.previousElementSibling);)++t;return t},showerror(e,t){e.$el&&(e=e.$el);var a=e.previousElementSibling;for(a&&a.classList&&a.classList.contains("v-error")&&a.parentNode.removeChild(a),a=e.previousElementSibling;a&&1!=a.nodeType;)a=a.previousElementSibling;if(!a)for(a=e.parentElement.previousElementSibling;a&&1!=a.nodeType;)a=a.previousElementSibling;var l=document.createElement("div");l.innerHTML=t||"Este campo es requerido!",l.classList.add("v-error"),e.parentNode.insertBefore(l,e)},print(e){var t=document.createElement("iframe");document.body.appendChild(t);var a=t.contentWindow.document;t.style.display="none",a.open(),a.write("<html><head><title>TT"+e.title+"</title>"),a.write('<link rel="stylesheet" type="text/css" href="/cdn/isobit.css?v=0004"><style>table{background-color:red}</style>'),a.write('</head><body style="padding:20px;background-color:white !important">'),a.write("<style>body, body > * {padding:20px;background-color:white !important }</style>"),a.write("<h1>"+e.title+"</h1>"),a.write(e.body),a.write("</body></html>"),a.close(),t.focus(),t.contentWindow.print()},mask(e,t){if(document.body){var a=document.createElement("div");a.style="top:50%;transform:translate(-50%,-50%);position:absolute;width:100%;z-index:2";var l=a.style;if(l.left="50%",l.textAlign="center",!1!==e)if(e instanceof Element)a=e;else{if(e){var o=document.createElement("div");o.innerHTML=e,a.append(o),a.style="padding:4px;margin-bottom:5px;color:white;font-size:24px;text-align:center"}var r=document.createElement("div");(l=r.style).width="100%",l.height="180px",r.className="loading"}var n=document.createElement("div");(l=n.style).height="100%",l.top="0px",l.position="absolute",l.left="0",l.zIndex=1e4,l.width="100%";var i=document.createElement("div");return(l=i.style).height="100%",l.width="100%",l.top="0",l.position="absolute",l.left="0",l.backgroundColor="rgba(0,0,0,0.5)",t&&t.opacity&&(l.opacity=t.opacity),t&&t.backgroundColor&&(l.backgroundColor=t.backgroundColor),n.appendChild(i),n.appendChild(a),r&&a.appendChild(r),document.body.appendChild(n),n}},unmask(e){e&&(e.style.display="none",e.parentNode&&e.parentNode.removeChild(e))},clean(e){for(var t in e)""!==e[t]&&null!==e[t]&&"function"!=typeof e[t]&&void 0!==e[t]||delete e[t];return e},processURL:e=>e,loadCSS(e){var t=document.getElementsByTagName("head")[0],a=document.createElement("link");a.rel="stylesheet",a.type="text/css",a.href=e,a.media="all",t.appendChild(a)},go(e){window.location=e},getCurrentPosition:()=>new Promise((function(e,t){if(_$1.location){var a="result"+_$1.id();_$1[a]=function(l){delete _$1[a],l.coords?e(l):t(l)},_$1.location(a)}else navigator.geolocation&&navigator.geolocation.getCurrentPosition(e,t)})),URL(e){var t=this;t.location=window.location,t.path=e||window.location.pathname;var a=t.path.split("?");a.length>1?(t.path=a[0],a=a[1].split("#"),t.query=a[0]):(a=a[0].split("#"),t.path=a[0]),t.get=function(e,a){if(t.query)for(var l,o=t.query.split("&"),r=o.length;r--;)if((l=o[r].split("="))[0]==e)return l[1];return a},t.put=function(e,a){e=encodeURI(e),a=encodeURI(a);var l=t.path.split("?");l.length>1&&(l=l[1].split("&"));for(var o,r=l.length;r--;)if((o=l[r].split("="))[0]==e){o[1]=a,l[r]=o.join("=");break}return r<0&&(l[l.length]=[e,a].join("=")),t.location.pathname+"?"+l.join("&")+t.location.hash}},loadScript(e,t){var a=document.getElementsByTagName("head")[0],l=document.createElement("script");l.type="text/javascript",l.src=e,l.onreadystatechange=t,l.onload=t,a.appendChild(l)},sum(e){return this.reduce(((t,a)=>t+((a=e?a[e]:a)?Number(a):0)),0)}}),_$1.getLocation=_$1.getCurrentPosition,Vue$1.id=_$1.id,"undefined"!=typeof ol){function e(e,t){var a;return e.getLayers().forEach((function(e){e.get("id")!==t||(a=e)})),a}ol.getLayerById=e,window.ol=ol}Vue$1.pad=function(e,t){if(null!=e){for(var a=1*e+"";a.length<t;)a="0"+a;return a}},Vue$1.filter("upper",_$1.upper=e=>e?e.toUpperCase():e),Vue$1.filter("capitalize",_$1.capitalize=e=>(e&&(e=e.replace("_"," ").replace(/\b[a-z](?=[a-z]{2})/gi,(function(e){return e.toUpperCase()}))),e)),Vue$1.filter("number",(function(e){return e?e.toFixed(2).replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1 "):e})),Vue$1.filter("date",_$1.toDate=(e,t)=>{if(e){var a,l=Vue$1.pad;if(e instanceof Date)a=e;else if("string"==typeof e){var o=e.split("T");a=o[0].split("-"),o.length>1?(o=o[1].split(":"),a=new Date(parseInt(a[0]),parseInt(a[1])-1,parseInt(a[2]),parseInt(o[0]),parseInt(o[1]),o.length>2?parseInt(o[2]):0)):a=a.length>2?new Date(parseInt(a[0]),parseInt(a[1])-1,parseInt(a[2])):(a=e.split(":")).length>2?new Date(1981,0,6,parseInt(a[0]),parseInt(a[1]),parseInt(a[2])):new Date(e)}else a=new Date(e);if(1==t)e=a;else if("time"===t)e=l(a.getHours(),2)+":"+l(a.getMinutes(),2)+":"+l(a.setSeconds()?a.setSeconds():0,2);else if("time a"==t)if("string"==typeof e||e instanceof String){var r=(e=e.split(":"))[0];e=l(r>12?r-12:r,2)+":"+e[1]+":"+e[2]+" "+(r>12?"PM":"AM")}else e=l((r=a.getHours())>12?r-12:r,2)+":"+l(a.getMinutes(),2)+(a.setSeconds()?":"+l(a.setSeconds(),2):"")+" "+(r>12?"PM":"AM");else e="date-"==t?l(a.getFullYear(),4)+"-"+l(a.getMonth()+1,2)+"-"+l(a.getDate(),2):"dMY"==t||"date"==t?l(a.getDate(),2)+"/"+l(a.getMonth()+1,2)+"/"+l(a.getFullYear(),4):"datetime"==t?l(a.getFullYear(),4)+"-"+l(a.getMonth()+1,2)+"-"+l(a.getDate(),2)+"T"+l(a.getHours(),2)+":"+l(a.getMinutes(),2)+":"+l(a.setSeconds()?a.setSeconds():0,2):l(a.getDate(),2)+"/"+l(a.getMonth()+1,2)+"/"+l(a.getFullYear(),4)+" "+l(a.getHours(),2)+":"+l(a.getMinutes(),2)}return e}),_$1.HTML2Canvas=HTML2Canvas,Vue$1.dateDiff=function(e,t){Number(e)===e&&(e=new Date(e));var a,l,o,r,n,i,s,d,c=e-t;c/=36e5,c/=24,c=Math.floor(c),c=Math.abs(c);var u=new Date,p=new Date;e>t?(u=e,p=t):(u=t,p=e),a=u.getFullYear()-p.getFullYear(),0>(l=(r=u.getMonth())-(n=p.getMonth()))&&(l+=12,--a),o=(s=u.getDate())-(d=p.getDate());var h=new Date(u.getFullYear(),r,1);return h.setDate(h.getDate()-1),i=h.getDate(),d>s&&(o+=i,0>--l&&(l+=12,--a),e>t&&((h=new Date(p.getFullYear(),n+1,1)).setDate(h.getDate()-1),30==(i=h.getDate())&&(o-=1),29==i&&(o-=2),28==i&&(o-=3))),{ans:a,meses:l,dias:o,Tdias:c}};var f={value:function(e){for(var t=0;t<this.length;t++)if(this[t]==e)return!0;return!1}};function isObject(e){return e&&"object"==typeof e&&!Array.isArray(e)}function configureAxios(e){var t;e.interceptors.request.use((function(e){return _$1.eeee=e,e.mask?e.mask():t||(t=_$1.mask()),e}),(function(e){return t=_$1.unmask(t),_$1.MsgBox("request "+_$1.id()+" "+e.message),Promise.reject(e)})),e.interceptors.response.use((function(e){return t=_$1.unmask(t),e}),(function(e){if(axios$2.error&&0==axios$2.error(e))t=_$1.unmask(t);else{var a=e.response,l=a&&a.data&&a.data.msg?a.data.msg:e.message;if(a&&(a.data&&a.data.message&&(l=a.data.message),"string"==typeof a.data&&(l=a.data),l||(l=a.status+": "+a.statusText)),t=_$1.unmask(t),a&&401==a.status&&_$1.app)return _$1.app.toast("Session terminada"),void _$1.app.logout();e.config.error?(console.log("error"),e.config.error(e,l)):(console.log("mssg"),_$1.MsgBox("<b>"+e.request.responseURL+"</b><br/><br/>"+l)),console.log(l),console.log(a)}return delete axios$2.error,Promise.reject(e)}))}[].contains||Object.defineProperty(Array.prototype,"contains",f),"".contains||Object.defineProperty(String.prototype,"contains",f),_$1.contains=function(e,t){return e&&e.includes(t)},_$1.MsgBox=function(e,t,a){if(a||(a=["OK"]),document.body){var l=document.createElement("div");l.classList.add("v-overlay"),l.style.padding="40px",l.style.zIndex="2000",document.body.appendChild(l);var o=document.createElement("div"),r=document.createElement("div"),n=document.createElement("div"),i=document.createElement("div");i.className="v-msgbox-buttons",o.classList.add("v-dialog"),o.classList.add("v-msgbox"),n.innerHTML=e,o.setAttribute("path",_$1.currentPath),o.setAttribute("callback",u);for(var s=function(){o.style.display="none",l.style.display="none",o.parentNode.removeChild(o),l.parentNode.removeChild(l),t&&(console.log(t),t(this.getAttribute("index")))},d=0;d<a.length;d++){var c=document.createElement("button");c.innerHTML=a[d],c.type="button",c.setAttribute("index",d),c.className="v-button ui-widget ui-state-default ui-corner-all",i.appendChild(c),c.addEventListener("click",s)}r.className="v-dialog-content v-widget-content",r.appendChild(n),r.appendChild(i),o.appendChild(r),l.appendChild(o),l.style.visibility="unset",l.style.opacity="unset",l.style.overflow="auto",o.style.margin="0 auto",o.style.position="unset";var u="v_0";Vue$1.resize()}},Vue$1.mergeDeep=function(){for(var e=arguments[0],t=[],a=1;a<arguments.length;a++)t.push(arguments[a]);if(!t.length)return e;var l,o=t.shift();if(isObject(e)&&isObject(o))for(var r in o)isObject(o[r])?(e[r]||((l={})[r]={},Object.assign(e,l)),Vue$1.mergeDeep(e[r],o[r])):((l={})[r]=o[r],Object.assign(e,l));var n=[];return n.push(e),n.concat(t),Vue$1.mergeDeep.apply(null,n)},window.ui=_$1.ui=function(cfg){var defs={watch:{$route(e){console.log("$route"),Vue$1.resize(),this.changeRoute(e)},cleanedFilters(){this.$el&&(this.t&&clearTimeout(this.t),this.t=setTimeout((()=>{this.refresh()}),1200))}},computed:{connected:{get(){return this.online&&!1!==this.x_connected_},set(e){let t=this.session;this.x_connected_=e,console.log("this.x_connected_ = "+this.x_connected_),this.$set(t,"connected",e),this.session=t}},session:{get(){if(!_$1._session){var e=localStorage.getItem("session");e=e?JSON.parse(e):{},_$1._session=e}return _$1._session},set(e){e?localStorage.setItem("session",JSON.stringify(e)):localStorage.removeItem("session"),_$1._session=e}},online(){return!1!==this.app.networkStatus.connected},cleanedFilters(){return _$1.clean(this.filters)},app:()=>_$1.app,user:()=>_$1.app.session,perms(){return this.session.perms||this.session.allcaps||{}},rowSelectedCount(){if(!this.$children[0])return 0;var e=this.$children[0].$children[0];return e?e.selected.length:0},baseURL:()=>Vue$1.baseURL?Vue$1.baseURL:axios$2.defaults.baseURL},data(){return{filters:{},ui:this,_session:null,x_connected_:null,row:{}}},created(){this.x_connected_=this.session.connected},updated(){console.log("main.update")},mounted(){var e=this,t=_$1.id();e.$el&&e.$el.setAttribute&&e.$el.setAttribute("vueid",t),_$1.varMap[t]=e,e.ddd(e.$root)},methods:{resize(){Vue$1.resize()},vv(e){var t=this;Network.getStatus().then((function(a){if(a.connected){var l=localStorage.getItem("session");if(l){try{l=JSON.parse(l)}catch(e){console.log(e),l={}}l.connected=e,localStorage.setItem("session",JSON.stringify(l))}}else t.toast("El dispositivo no tiene acceso a internet!"),t.connected=a.connected}))},bindLinks(e,t){var a=this;if((e=e||a.$el).querySelectorAll)for(var l=e.querySelectorAll("a:not(._),ion-item:not(._)"),o=function(e){e.preventDefault()},r=function(e){e.preventDefault(),t&&t(),a.open(e)},n=0;n<l.length;n++)l[n].attributes.href?l[n].onclick=r:l[n].onclick=o,l[n].classList?l[n].classList.add("_"):l[n].className="_"},MsgBox:_$1.MsgBox,changeRoute(){},pad:Vue$1.pad,key:()=>Math.random(),submitFile(e,t,a){var l=new FormData;t=t||e.name.replace(/[^\w\s.]/gi,""),l.append("filename",t),l.append("file",e,t),axios$2.post("/api/file/upload",l,{headers:{"Content-Type":"multipart/form-data",filename:t}}).then((function(e){a(e.data)})).catch((function(){console.log("FAILURE!!")}))},go(e){window.o(e)},ddd(){},rowCreated(e){this.row=e},getSelected(e){return(e&&e.$vnode?e:this.$children[0].$children[0]).selected},getRowSelectedCount(){var e=this.$children[0].$children[0];return e?e.selected.length:0},rewrite:e=>e,create(){var e=this,t=e.$children[0].action;t||(t=window.location.pathname),(t=_$1.processURL(t))&&(t=t.replace("/api","")),_$1.app?e.open(t+"/create"):instance.get(_$1.currentPath=(t+"/create").replace(/([^:]\/)\/+/g,"$1")+"?modal").then(_$1.open).catch(e.error)},edit(e){var t=this,a=t.$children[0].action,l=[].filter.call(e.component.$parent.$children,(e=>e.$el.classList.contains("v-datatable")))[0];a||(a=window.location.pathname),l&&l.src&&(a=l.src),e.action&&(a=e.action),l||(l=e.$vnode||e.target&&e.target.$vnode?e:t.$children[0].$children[0]).src&&(a=l.src),a&&(a=t.rewrite(a.replace("/api","").replace("/0/0","")));var o=t.getSelected(l)[0],r=o[l.rowKey];o.tmpId&&(r=-o.tmpId),console.log(o),t.getSelectedId&&(r=t.getSelectedId(o)),_$1.app?t.open(a+"/"+r+"/edit"):axios$2.get((_$1.currentPath=(a+"/"+r+"/edit").replace(/([^:]\/)\/+/g,"$1"))+"?modal").then(t.open).catch(t.error)},get(e){var t=this.$el.querySelector("form").action;window.location.href=this.apiLink(t)+"/"+e},error(e){alert(e)},destroy(e){var t=this;t.$children[0].action;var a=[].filter.call(e.component.$parent.$children,(e=>e.$el.classList.contains("v-datatable")))[0];a||(a=e.$vnode?e:t.$children[0].$children[0]);var l=e.$vnode?e.load:null,o=a.$attrs.rowkey;o||(o=a.rowKey);var r=a.data[a.selected[0]];if(a.data,r.tmpId)t.MsgBox("Esta seguro que desea eliminar los registros temporales seleccionados ?",(function(e){if(0==e){for(var o=0,n=_$1.db.transaction([a.store],"readwrite").objectStore(a.store),i=[],s=a.selected.length-1;s>=0;s--)r=a.data[a.selected[s]],i.push(r),r.tmpId&&n.delete(r.tmpId),o++,a.data.splice(a.selected[s],1);o&&(t.app&&t.app.toast?t.app.toast(o+" registros eliminados"):t.MsgBox(o+" registros eliminados")),a.rowSelect(null,-1),a.selected=[],t.$emit("destroyed",i,a.store),l&&l()}}),["SI","NO"]);else{if(!o)return alert("Table don`t have defined attribute 'rowkey'");var n=r[o];t.MsgBox("Esta seguro que desea eliminar el registro seleccionado?",(function(e){if(0==e){var l=a.src.replace("/0/0",""),o=[];console.log(a.selected);var i=a.selected.length-1;axios$2.delete(l+"/"+n,{params:a.filters}).then((function(){for(console.log(a.selected);i>=0;i--)console.log("k="+i),console.log(a.data),console.log("t.selected[k]="+a.selected[i]),r=a.data[a.selected[i]],o.push(r),console.log(o),a.data.splice(a.selected[i],1);t.app&&t.app.toast?t.app.toast(o.length+" registros eliminados"):t.MsgBox(o.length+" registros eliminados"),a.rowSelect(null,-1),a.selected=[]})).catch(t.error)}}),["SI","NO"])}},apiLink:e=>e.replace(_$1.contextPath,_$1.contextPath+"/api"),open(response,path,o){if(!(response.$el||response instanceof HTMLElement)){var e=response,t=e.target,me=this;return"string"==typeof e?t=e:"ION-ITEM"==t.tagName&&t.href?(e.preventDefault(),t=t.href):(e.preventDefault(),t.pathname||(t=t.parentNode),t.pathname||(t=t.parentNode),t.pathname||(t=t.parentNode),t=t.pathname),void(me.$route.path!==t&&(console.log("path="+t),me.$router.push(t)))}var me=this,el;if(response.$el)response=response.$el,path={};else if(response instanceof HTMLElement)path=path&&path.closeOnClickOut?path:{},console.log("PATH===="),console.log(path);else{if(response.target)return el=response.target,me.open(el.pathname?el.pathname:el.href);if("GET"===response){if("string"==typeof path){var cfg={path:_$1.currentPath=path+("string"==typeof o?"/"+o:"")};return"function"==typeof o?cfg.result=o:"object"==typeof o&&(cfg=Vue$1.mergeDeep(cfg,o)),me.open(response,cfg)}if(!path.data){if(el=document.querySelector("[path='"+path.path+"']"),el){for(var dd=document.querySelector("#layoutUnit-center > .ui-layout-unit-content,#page-content"),i=0;i<dd.children.length;i++)dd.children[i].style&&("ui-panel"==dd.children[i].className&&"none"!=dd.children[i].style.display&&(backPanel=dd.children[i]),dd.children[i].style.display="none");return el.style.removeProperty("display"),el}return axios$2.get((path.path+"/?modal").replace(/([^:]\/)\/+/g,"$1")).then((e=>{e.class=path.class?path.class:"",e.path=path.path,e.result=path.callback,e=Object.assign(e,path),me.open(response,e)})).catch(me.error)}}else{if(!response.data)return me.open("GET",response,path);response.data&&(path=response)}}console.log("open(path="+path+")"),console.log(path);var dialog,nid=Vue$1.id(),scriptDom=[],for_,ifor=0,backPanel;if(response instanceof HTMLElement)dialog=response,dialog.classList.add("v-dialog");else{dialog=document.createElement("div"),dialog.classList.add("v-dialog"),dialog.innerHTML=path.data;var s=dialog.getElementsByTagName("script");dialog.setAttribute("path",_$1.currentPath);for(var ld=dialog.children,k=0;k<s.length;k++)scriptDom.push(s[k]);for(k=0;k<ld.length;k++)"V-FORM"!=ld[k].tagName&&"V-PANEL"!=ld[k].tagName||(for_=ld[k],ifor=k)}var close=()=>{dialog.style.display="none",(overlay=dialog.parentNode).classList.contains("v-overlay")&&(overlay.style.display="none",dialog.parentNode.removeChild(dialog),overlay.parentNode.removeChild(overlay)),backPanel&&(dialog.parentNode.removeChild(dialog),backPanel.style.display="block"),Vue$1.resize()};if(for_&&for_.classList.contains("panel")){if(for_.id)window.currentEl="#"+for_.id;else{var clsId="cls-id-"+Vue$1.id();for_.classList.add(clsId),window.currentEl="."+clsId}for(dd=document.querySelector("#layoutUnit-center > .ui-layout-unit-content,#page-content"),i=0;i<dd.children.length;i++)dd.children[i].style&&("ui-panel"==dd.children[i].className&&"none"!=dd.children[i].style.display&&(backPanel=dd.children[i]),dd.children[i].style.display="none");dd.appendChild(dialog);for(var l2=0;scriptDom.length>l2;l2++)try{eval(scriptDom[l2].innerHTML)}catch(e){console.error(e)}var td;dialog.style.display="none";for(var aux=dialog.children[ifor];dialog.children.length>0;)td||(td=dialog.children[0]),dd.appendChild(dialog.children[0]);dialog.parentNode.removeChild(dialog),dialog=aux,dialog.setAttribute("path",path.path)}else{var overlay=document.createElement("div");if(overlay.classList.add("v-overlay"),overlay.style.padding="40px",document.body.appendChild(overlay),overlay.appendChild(dialog),!(response instanceof HTMLElement))for(l2=0;s.length>l2;l2++)try{eval(s[l2].innerHTML)}catch(e){console.error(e)}overlay.style.visibility="unset",overlay.style.opacity="unset",overlay.style.overflow="auto",dialog.style.margin="0 auto",dialog.style.position="unset";var resize=e=>{if(console.log("resize "),dialog.style.left=(window.innerWidth-dialog.offsetWidth)/2+"px",window.innerWidth<600){console.log(dialog);var t=dialog.querySelector(".v-dialog-content"),a=dialog.querySelector(".v-panel-titlebar"),l=window.innerHeight-94-(a?a.clientHeight:0);(t||dialog).style.height=l+"px"}};if(window.addEventListener("resize",resize),"v-search"===path.class){var d=dialog;d.className=d.className+" "+path.class,d.style.width="100%",d.style.height="calc(100% - 2px)";var children=d.querySelector("div"),f=d.querySelector("form"),t=d.querySelector(".v-datatable"),tb=d.querySelector(".v-datatable-scrollable-body");children.style.height="calc(100% - 2px)",children.style.overflowY="auto",children.children[1].style.padding="0px",children.children[1].style.height="calc(100% - 33px)",f.style.height="100%",f.style.overflowY="auto",t.style.height="calc(100% - 52px)",tb.style.height="calc(100% - 72px)",tb.style.overflowY="auto";var pag=d.querySelector(".v-paginator");pag.style.display="inline-block",f.appendChild(pag),tb=document.createElement("button"),tb.innerHTML="Recuperar",tb.style.padding="4px 16px",tb.className="_ ui-widget v-state-default ui-corner-all v-button ui-button-text-only";var vue=_$1.varMap[children.getAttribute("vueid")];tb.onclick=e=>{e.preventDefault(),vue.refresh()},f.appendChild(tb),tb=document.createElement("button"),tb.innerHTML="Seleccionar",tb.style.padding="4px 16px",tb.className="_ ui-widget v-state-default ui-corner-all v-button ui-button-text-only",vue=_$1.varMap[children.getAttribute("vueid")],tb.onclick=e=>{e.preventDefault();var t=[],a=vue.$children[0].$children[0];for(i=0;i<a.selected.length;i++)t.push(a.filteredData[a.selected[i]]);path.result(t),delete path.result,vue.close(e)},f.appendChild(tb)}resize()}_$1.storeFunction["PROPS="+nid]=path,_$1.storeFunction[nid]=e=>{path.result&&path.result(e),!0===e&&me.refresh()};var _vue_=dialog.querySelector("[vueid]");_vue_&&(path.__vue__=_vue_.__vue__,_vue_.__vue__.$emit("opened",path)),dialog.setAttribute("callback",nid);var h=dialog.querySelector(".v-panel-titlebar");if(h){var acl=h.querySelector(".ui-js-close");if(window.onkeyup=e=>{27==e.keyCode&&close()},!acl){var span=document.createElement("i");span.style.top="6px",span.style.right="6px",h.style.position="relative",span.style.position="absolute",span.style.color="white",span.className="fa fa-window-close v-dialog-close",acl=document.createElement("a"),acl.className="ui-js-close v-dialog-titlebar-icon v-dialog-titlebar-close ui-corner-all",acl.appendChild(span),h.appendChild(acl),acl.addEventListener("click",close)}}path.closeOnClickOut&&dialog.parentNode.addEventListener("click",close),dialog.style.display="block",Vue$1.resize(),document.documentElement.style.overflow="hidden",document.body.scroll="no"},close(e){e.$el&&(e=e.$el);var t=e instanceof HTMLElement?e:null;try{!t&&event.target instanceof HTMLElement&&(t=_$1.closest(event.target,".v-dialog"))}catch(e){console.log(e)}t||(t=this.$el.parentElement);var a=t.parentElement;if(a||!_$1.app.$router){t.style.display="none",(" "+a.className+" ").indexOf(" v-overlay ")>-1?a.style.display="none":a=null,Vue$1.resize();var l=_$1.storeFunction[t.getAttribute("callback")];l&&l(e),t.parentNode.removeChild(t),a&&a.parentNode.removeChild(a),document.documentElement.style.overflow="auto",document.body.scroll="yes"}else _$1.app.$router.back()},refresh(){this.$children[0].$children[0].load()},removeStored(e){if(window.idb){var t=this;window._.db.transaction([e],"readwrite").objectStore(e).clear().onerror=function(){t.MsgBox("Error al eliminar data temporal")}}else localStorage.removeItem(e)},async toast(e,t){e.message&&!e.duration&&(e.duration=2e3);const a=await this.$ionic.toastController.create(e.message?e:{message:e,duration:2e3});await a.present(),t&&t()},async setStoredList(e,t){if(_$1.db)try{var a=_$1.db.transaction([e],"readwrite").objectStore(e);a.clear().onsuccess=()=>{for(var e in t){console.log(t[e]),a.add(t[e]).onerror=e=>{console.log(e)}}}}catch(t){throw alert(e),t}else localStorage.setItem(e,JSON.stringify(t))},async getStoredList(e,t){let a;try{a=JSON.parse(sessionStorage.getItem("loadedStores"))}catch(e){}if(null==a&&(a={}),!a[e]&&_$1.networkStatus.connected){let t=_$1.stores.filter((t=>t[0]==e))[0];if(!t[2])throw"store url is empty";let o=await axios$2.get(t[2]),r=_$1.db.transaction([t[0]],"readwrite").objectStore(t[0]);for(var l in await r.clear(),o=o.data||o,o)try{await r.add(o[l])}catch(e){throw e}a[e]=1,sessionStorage.setItem("loadedStores",JSON.stringify(a))}let o=new Promise(((t,a)=>{if(_$1.db){var l=_$1.db.transaction(e).objectStore(e).getAll();l.onsuccess=function(){t(l.result)}}else a("db is null")}));return await o},getStoreObject:(e,t)=>window._.db.transaction([e],"readwrite").objectStore(e).get(t),async sync(e){var t=this,a=t.$el.querySelector("form").getAttribute("action");if(!a){var l=(a=t.$el.parentNode.getAttribute("path")).split("/");l="edit"==l[l.length-1]?l.splice(0,l.length-2):l.splice(0,l.length-1),a=t.apiLink(l.join("/"))}var o=t.$children[0].$children[0];a=o.src;for(var r=await t.getStoredList(o.store),n=o.selected,i=[],s=[],d=0;d<n.length;d++){var c=o.data[n[d]];if(c.tmpId&&!c.synchronized)for(var u=0;u<r.length;u++)if(r[u].tmpId==c.tmpId){var p=JSON.clone(r[u]);delete p.synchronized,s.push(p),i.push(u)}}i.length>0&&axios$2.post(a+"/bulk"+(e.sufix?e.sufix:""),s).then((function(e){let a=e.data;for(let e=0;e<a.length;e++){if(a[e].errors){t.MsgBox(JSON.stringify(a[e].errors));break}if(a[e].error){t.MsgBox(a[e].error);break}for(var l=0;l<r.length;l++)(a[e].ext&&a[e].ext.tmpId==r[l].tmpId||a[e].tmpId==r[l].tmpId)&&(console.log("ok"),a[e].ext&&r.ext&&(r[l].ext.error=a[e].ext.error),a[e].id&&(r[l].id=a[e].id),r[l].synchronized=1,t.$emit("sync",a[e],r[l]))}t.setStoredList(o.store,r),t.refresh()})).catch((function(e){e.response?t.MsgBox(e.response.data):console.log(e)}))},async save(){var e=this;e.$forceUpdate();var t=e.$el.querySelector("form");if(this.validate(t)){var a=t.getAttribute("action");if(!a&&(a=e.$el.parentNode.getAttribute("path"))){var l=a.split("/");l="edit"==l[l.length-1]?l.splice(0,l.length-2):l.splice(0,l.length-1),a=e.apiLink(l.join("/"))}var o=this._data.data?this._data.data:this._data.o,r=JSON.parse(JSON.stringify(o));if(e.process&&(r=e.process(r)),"object"!=typeof r||Array.isArray(r)||null===r)return;if(a&&e.app.networkStatus.connected)axios$2.post(a,r).then((function(t){var a=t.data;if(r.tmpId){var l=e.$children[0].store,n=window._.db.transaction([l],"readwrite").objectStore(l),i=n.get(r.tmpId);a.id&&(r.id=a.id,o.id=r.id),i.onsuccess=function(){o.synchronized=1,r.synchronized=1,(i.result?n.put(r):n.add(r)).onerror=e=>{console.error(e)},e.$emit("sync",a,r)},i.onerror=function(){e.MsgBox("Error getting temporal record "+r.tmpId)}}e.$ionic?e.app.toast("El registro fue grabado exitosamente!",(()=>{e.close({success:!0,data:a})})):(console.log(a),e.MsgBox("El registro fue grabado exitosamente!",(function(){e.close({success:!0,data:a})})))})).catch((function(a){var l,o;if(console.log(a),a.response)if("string"==typeof a.response.data)e.MsgBox(a.response.data);else{l=a.response.data.propertyViolations;for(var r=0;r<l.length;r++){var n=l[r];(o=t.querySelector("[name="+n.path+"]"))&&e.showerror(o,n.message)}for(l=a.response.data.fieldViolations,r=0;r<l.length;r++)n=l[r],(o=t.querySelector("[name="+n.path+"]"))&&e.showerror(o,n.message+", valor="+n.value);e.MsgBox("Verifique el formulario, aun tiene campos obligatorio completar."),"v-dialog"==e.$el.parentNode.className&&e.$el.parentNode.parentNode.scroll({top:0,behavior:"smooth"})}}));else{let t=e.$children[0].store;if(!t)return void e.MsgBox("Store in form is undefined!");let a=await e.getStoredList(t);if(a||(a=[]),r.id)for(var n=0;n<a.length;n++)a[n].tmpId==r.tmpId&&(delete r.synchronized,a[n]=r);var i=_$1.db.transaction([t],"readwrite").objectStore(t);if(r.id){delete r.synchronized;var s=i.get(r.tmpId);s.onsuccess=function(){console.log(s.result),s.result?(console.log("objectStore.put(o)"),i.put(r)):a.forEach((e=>{e.tmpId==r.tmpId&&i.put(r)})),e.$emit("stored",r,a,i),e.$ionic&&e.app.toast("El registro fue grabado exitosamente!"),e.close({success:!0,data:r})},s.onerror=function(){e.MsgBox("Error getting temporal record "+r.tmpId)}}else{r.tmpId=1*new Date,r.id=-r.tmpId;var d=i.add(r);d.onsuccess=l=>{console.log(l),console.log("saved to "+t),a.unshift(r),e.$emit("stored",r,a,i),e.app&&e.app.toast&&e.app.toast("El registro fue grabado exitosamente!"),o.tmpId=r.tmpId,o.id=r.id,e.close({success:!0,data:r})},d.onerror=t=>{e.app&&e.app.toast&&e.app.toast("Error!"),console.log(t)}}}}else e.MsgBox("Verifique el formulario, aun tiene campos obligatorios sin completar."),"v-dialog"==e.$el.parentNode.className&&e.$el.parentNode.parentNode.scroll({top:0,behavior:"smooth"})},saveAs(e,t,a){"string"==typeof t&&(t={body:t});var l="string"==typeof a?{fileName:a}:a;l||(l={}),(""+t?axios$2.post(e,t,{responseType:"blob"}):axios$2({method:"post",url:e,data:t,headers:{"Content-Type":"multipart/form-data"}})).then((e=>{const t=window.URL.createObjectURL(new Blob([e.data])),a=document.createElement("a");if(a.href=t,!l.fileName)var o=e.headers["content-disposition"];if(o&&-1!==o.indexOf("attachment")){var r=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(o);null!=r&&r[1]&&(l.fileName=r[1].replace(/['"]/g,"").trim())}a.setAttribute("download",l.fileName),document.body.appendChild(a),a.click()}))},savePost(){},validate(e){var t,a=!0,l=(e=e||this.$el).querySelectorAll("input,select,textarea,div[required=required]"),o={};for(p=0;l.length>p;p++){var r=l[p];if("radio"!==r.type){if((t=r.previousElementSibling)&&t.classList&&t.classList.contains("v-error")&&t.parentNode.removeChild(t),!r.disabled&&!r.getAttribute("disabled")&&(r.required||"DIV"===r.tagName)&&("DIV"!=r.tagName&&!r.value||"DIV"===r.tagName&&!r.attributes.value)){for(t=r.previousElementSibling;t&&1!=t.nodeType;)t=t.previousElementSibling;if(!t)for(t=r.parentElement.previousElementSibling;t&&1!=t.nodeType;)t=t.previousElementSibling;var n=document.createElement("div");n.innerHTML="Este campo es requerido!",a=!1,n.classList.add("v-error"),r.parentNode.insertBefore(n,r)}}else{var i=o[r.name];i||(o[r.name]=i=[]),i.push(r)}}for(var s in o)if(Object.prototype.hasOwnProperty.call(o,s)){for(var d=o[s],c=!1,u=!1,p=0;p<d.length;p++)d[p].required&&!d[p].disabled&&(u=!0),d[p].checked&&(c=!0);(t=(r=d[0].parentNode.parentNode).previousElementSibling)&&t.classList&&t.classList.contains("v-error")&&t.parentNode.removeChild(t),u&&!c&&(this.showerror(r),a=!1)}return a},showerror:_$1.showerror}};if(cfg||(cfg={data:{o:{}}}),!window.isMobile){var el=cfg.el;if("string"==typeof cfg.el)el=document.querySelector(cfg.el);else{var script=document.getElementsByTagName("script");el=script[script.length-1].previousElementSibling.previousElementSibling}for(var tv=el.querySelectorAll("v-tabview"),i=0;i<tv.length;i++){var id="v-"+_$1.id();tv[i].setAttribute("vid",id);var cn=tv[i].childNodes,tabs=[];_$1.varMap[id]=tabs;for(var j=0;j<cn.length;j++)cn[j].tagName&&(cn[j].className="hide",tabs.push({title:cn[j].title}))}cfg.el=el}return cfg={mixins:[defs,cfg]},window.isMobile?cfg:new Vue$1(cfg)},window._=_$1,window.Vue=Vue$1,window.axios=axios$2,_$1.axios=axios$2,Vue$1.configureAxios=configureAxios,configureAxios(axios$2);var index={install(e,t){console.log(_$1.Vue),e.filter("upper",(e=>e?e.toUpperCase():e)),e.filter("date",_$1.toDate.bind(t)),e.filter("capitalize",_$1.capitalize.bind(t)),e.filter("upper",_$1.upper.bind(t)),console.log("filter date addedd!"),e.component("v-autocomplete",script$o),e.component("v-button",script$n),e.component("v-calendar",script$m),e.component("v-checkbox",script$l),e.component("v-checkbox-group",script$k),e.component("v-radio",script$i),e.component("v-radio-group",script$g),e.component("v-group",script$h),e.component("v-dataview",script$f),e.component("v-fieldset",script$e),e.component("v-form",script$j),e.component("v-table",script$d),e.component("v-tabview",script$c),e.component("v-switch",script$9),e.component("v-select",script$a),e.component("v-layer-control",script$4),e.component("v-map",script$3),e.component("v-map-control",script$2),e.component("v-number",script$8),e.component("v-options",script$7),e.component("v-overlay",script$1),e.component("v-uploader",script$6),e.component("v-panel",script$5),e.component("v-popup",script),e.component("v-textarea",script$b),e.component("v-filter-calendar",{template:'<div><v-button icon="fa-calendar" v-on:click.prevent="open"/><v-panel style="text-align:left;position:absolute;display:none" v-bind:header="\'Configurar Filtro []\'"><div style="padding:20px"><div class="v-form"><label>Desde:</label><v-calendar v-model="from"/><label>Hasta:</label><v-calendar v-model="to"/></div><center style="padding-top:20px"><v-button icon="fa-check" value="Aceptar"/><v-button icon="fa-ban" v-on:click.prevent="close" value="Cerrar"/></center></div></v-panel></div>',data:function(){return{el:null,mask:null}},methods:{open(){var e=this.el?this.el:this.el=this.$el.children[1];this.mask=_$1.mask(e,{backgroundColor:"rgba(0,0,0,0.95)"}),e.style.display="block"},close(){_$1.unmask(this.mask)}}}),e.component("v-accordion",{mounted(){},methods:{toggle(e){this.$emit("change",e)}},template:'<div class="v-accordion"><slot></slot></div>'}),e.component("v-tab",{props:["title","expanded"],data:()=>({count:0,expanded_:0}),update(){this.$el.querySelector("svg").dataset.icon="chevron-down"},mounted(){var e=this;e.expanded_=e.expanded,setTimeout((function(){e.$el.querySelector("svg").dataset.icon="chevron-down"}),100)},methods:{toggle(){this.expanded_=!this.expanded_,this.$el.querySelector("svg").dataset.icon=this.expanded_?"chevron-up":"chevron-down",this.$parent&&this.$parent.toggle&&this.$parent.toggle(this)}},template:'<div><div v-on:click="toggle" v-bind:class="{expanded:expanded_}" style="cursor:pointer;position: relative;padding: 10px 0px;">{{title}}<span style="position:absolute;right:0px" ><i data-icon="chevron-down" class="fa"></i></span></div><transition name="fade"><div class="v-tab-content" v-if="expanded_"><slot></slot></div></transition></div>'})}};module.exports=index;
|