decidim-navigation_maps 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE-AGPLv3.txt +661 -0
  3. data/README.md +144 -0
  4. data/Rakefile +40 -0
  5. data/app/assets/config/admin/decidim_navigation_maps_manifest.css +3 -0
  6. data/app/assets/config/admin/decidim_navigation_maps_manifest.js +3 -0
  7. data/app/assets/config/decidim_navigation_maps_manifest.css +3 -0
  8. data/app/assets/config/decidim_navigation_maps_manifest.js +1 -0
  9. data/app/assets/images/decidim/navigation_maps/icon.svg +1 -0
  10. data/app/assets/javascripts/decidim/navigation_maps/admin/map_editor.js +88 -0
  11. data/app/assets/javascripts/decidim/navigation_maps/admin/navigation_maps.js +143 -0
  12. data/app/assets/javascripts/decidim/navigation_maps/map_view.js +123 -0
  13. data/app/assets/javascripts/decidim/navigation_maps/navigation_maps.js +44 -0
  14. data/app/assets/stylesheets/decidim/navigation_maps/_variables.scss +3 -0
  15. data/app/assets/stylesheets/decidim/navigation_maps/admin/navigation_maps.scss +102 -0
  16. data/app/assets/stylesheets/decidim/navigation_maps/navigation_maps.scss +58 -0
  17. data/app/cells/decidim/navigation_maps/content_blocks/navigation_map/_styles.erb +18 -0
  18. data/app/cells/decidim/navigation_maps/content_blocks/navigation_map/_tabs.erb +5 -0
  19. data/app/cells/decidim/navigation_maps/content_blocks/navigation_map/_tabs_content.erb +8 -0
  20. data/app/cells/decidim/navigation_maps/content_blocks/navigation_map/_template.erb +13 -0
  21. data/app/cells/decidim/navigation_maps/content_blocks/navigation_map/show.erb +21 -0
  22. data/app/cells/decidim/navigation_maps/content_blocks/navigation_map_cell.rb +22 -0
  23. data/app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form/_form.erb +36 -0
  24. data/app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form/_modal.erb +12 -0
  25. data/app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form/_tabs.erb +6 -0
  26. data/app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form/_tabs_content.erb +11 -0
  27. data/app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form/show.erb +35 -0
  28. data/app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form_cell.rb +32 -0
  29. data/app/commands/decidim/navigation_maps/save_area.rb +58 -0
  30. data/app/commands/decidim/navigation_maps/save_blueprints.rb +72 -0
  31. data/app/controllers/decidim/navigation_maps/admin/application_controller.rb +13 -0
  32. data/app/controllers/decidim/navigation_maps/admin/areas_controller.rb +94 -0
  33. data/app/controllers/decidim/navigation_maps/admin/blueprints_controller.rb +64 -0
  34. data/app/forms/decidim/navigation_maps/area_form.rb +37 -0
  35. data/app/forms/decidim/navigation_maps/blueprint_form.rb +39 -0
  36. data/app/forms/decidim/navigation_maps/blueprint_forms.rb +9 -0
  37. data/app/models/decidim/navigation_maps/application_record.rb +10 -0
  38. data/app/models/decidim/navigation_maps/blueprint.rb +27 -0
  39. data/app/models/decidim/navigation_maps/blueprint_area.rb +32 -0
  40. data/app/queries/decidim/navigation_maps/organization_blueprints.rb +20 -0
  41. data/app/uploaders/decidim/navigation_maps/blueprint_uploader.rb +22 -0
  42. data/app/views/decidim/navigation_maps/admin/areas/_form.html.erb +39 -0
  43. data/app/views/decidim/navigation_maps/admin/areas/new.html.erb +17 -0
  44. data/app/views/decidim/navigation_maps/admin/areas/show.html.erb +14 -0
  45. data/config/i18n-tasks.yml +10 -0
  46. data/config/locales/ca.yml +45 -0
  47. data/config/locales/cs.yml +45 -0
  48. data/config/locales/en.yml +46 -0
  49. data/config/locales/es.yml +45 -0
  50. data/db/migrate/20191022092624_create_decidim_navigation_maps_blueprints.rb +13 -0
  51. data/db/migrate/20191120185739_add_title_to_navigation_maps_blueprints.rb +10 -0
  52. data/db/migrate/20191125142751_create_decidim_navigation_maps_blueprint_areas.rb +18 -0
  53. data/db/migrate/20191126045831_add_link_type_to_decidim_navigation_maps_blueprint_areas.rb +8 -0
  54. data/db/migrate/20191126154019_add_area_id_to_decidim_navigation_maps_blueprint_areas.rb +16 -0
  55. data/db/migrate/20191127093746_add_color_to_navigation_maps_blueprint_areas.rb +7 -0
  56. data/lib/decidim/navigation_maps.rb +13 -0
  57. data/lib/decidim/navigation_maps/admin.rb +10 -0
  58. data/lib/decidim/navigation_maps/admin_engine.rb +34 -0
  59. data/lib/decidim/navigation_maps/engine.rb +34 -0
  60. data/lib/decidim/navigation_maps/navigation_map_cell_helpers.rb +28 -0
  61. data/lib/decidim/navigation_maps/test/factories.rb +29 -0
  62. data/lib/decidim/navigation_maps/version.rb +9 -0
  63. data/vendor/assets/images/draw/layers-2x.png +0 -0
  64. data/vendor/assets/images/draw/layers.png +0 -0
  65. data/vendor/assets/images/draw/marker-icon-2x.png +0 -0
  66. data/vendor/assets/images/draw/marker-icon.png +0 -0
  67. data/vendor/assets/images/draw/marker-shadow.png +0 -0
  68. data/vendor/assets/images/draw/spritesheet-2x.png +0 -0
  69. data/vendor/assets/images/draw/spritesheet.png +0 -0
  70. data/vendor/assets/images/draw/spritesheet.svg +156 -0
  71. data/vendor/assets/images/images/layers-2x.png +0 -0
  72. data/vendor/assets/images/images/layers.png +0 -0
  73. data/vendor/assets/images/images/marker-icon-2x.png +0 -0
  74. data/vendor/assets/images/images/marker-icon.png +0 -0
  75. data/vendor/assets/images/images/marker-shadow.png +0 -0
  76. data/vendor/assets/javascripts/jquery.form.js +1277 -0
  77. data/vendor/assets/javascripts/jsrender.min.js +4 -0
  78. data/vendor/assets/javascripts/jsrender.min.js.map +1 -0
  79. data/vendor/assets/javascripts/leaflet-geoman.min.js +1 -0
  80. data/vendor/assets/javascripts/leaflet.js +5 -0
  81. data/vendor/assets/stylesheets/leaflet-geoman.css +164 -0
  82. metadata +183 -0
@@ -0,0 +1,4 @@
1
+ /*! JsRender v1.0.5: http://jsviews.com/#jsrender */
2
+ /*! **VERSION FOR WEB** (For NODE.JS see http://jsviews.com/download/jsrender-node.js) */
3
+ !function(t,e){var n=e.jQuery;"object"==typeof exports?module.exports=n?t(e,n):function(n){if(n&&!n.fn)throw"Provide jQuery or null";return t(e,n)}:"function"==typeof define&&define.amd?define(function(){return t(e)}):t(e,!1)}(function(t,e){"use strict";function n(t,e){return function(){var n,r=this,i=r.base;return r.base=t,n=e.apply(r,arguments),r.base=i,n}}function r(t,e){return st(e)&&(e=n(t?t._d?t:n(a,t):a,e),e._d=(t&&t._d||0)+1),e}function i(t,e){var n,i=e.props;for(n in i)!$t.test(n)||t[n]&&t[n].fix||(t[n]="convert"!==n?r(t.constructor.prototype[n],i[n]):i[n])}function o(t){return t}function a(){return""}function s(t){try{throw console.log("JsRender dbg breakpoint: "+t),"dbg breakpoint"}catch(e){}return this.base?this.baseApply(arguments):t}function l(t){this.name=(e.link?"JsViews":"JsRender")+" Error",this.message=t||this.name}function d(t,e){if(t){for(var n in e)t[n]=e[n];return t}}function p(t,e,n){return t?lt(t)?p.apply(ot,t):(wt=n?n[0]:wt,/^(\W|_){5}$/.test(t+e+wt)||S("Invalid delimiters"),ht=t[0],_t=t[1],xt=e[0],bt=e[1],gt.delimiters=[ht+_t,xt+bt,wt],t="\\"+ht+"(\\"+wt+")?\\"+_t,e="\\"+xt+"\\"+bt,rt="(?:(\\w+(?=[\\/\\s\\"+xt+"]))|(\\w+)?(:)|(>)|(\\*))\\s*((?:[^\\"+xt+"]|\\"+xt+"(?!\\"+bt+"))*?)",ft.rTag="(?:"+rt+")",rt=new RegExp("(?:"+t+rt+"(\\/)?|\\"+ht+"(\\"+wt+")?\\"+_t+"(?:(?:\\/(\\w+))\\s*|!--[\\s\\S]*?--))"+e,"g"),ft.rTmpl=new RegExp("^\\s|\\s$|<.*>|([^\\\\]|^)[{}]|"+t+".*"+e),mt):gt.delimiters}function u(t,e){e||t===!0||(e=t,t=void 0);var n,r,i,o,a=this,s="root"===e;if(t){if(o=e&&a.type===e&&a,!o)if(n=a.views,a._.useKey){for(r in n)if(o=e?n[r].get(t,e):n[r])break}else for(r=0,i=n.length;!o&&r<i;r++)o=e?n[r].get(t,e):n[r]}else if(s)o=a.root;else if(e)for(;a&&!o;)o=a.type===e?a:void 0,a=a.parent;else o=a.parent;return o||void 0}function c(){var t=this.get("item");return t?t.index:void 0}function f(){return this.index}function g(t,e,n,r){var i,o,s,l=0;if(1===n&&(r=1,n=void 0),e)for(o=e.split("."),s=o.length;t&&l<s;l++)i=t,t=o[l]?t[o[l]]:t;return n&&(n.lt=n.lt||l<s),void 0===t?r?a:"":r?function(){return t.apply(i,arguments)}:t}function v(n,r,i){var o,a,s,l,p,u,c,f=this,g=!kt&&arguments.length>1,v=f.ctx;if(n){if(f._||(p=f.index,f=f.tag),u=f,v&&v.hasOwnProperty(n)||(v=ut).hasOwnProperty(n)){if(s=v[n],"tag"===n||"tagCtx"===n||"root"===n||"parentTags"===n)return s}else v=void 0;if((!kt&&f.tagCtx||f.linked)&&(s&&s._cxp||(f=f.tagCtx||st(s)?f:(f=f.scope||f,!f.isTop&&f.ctx.tag||f),void 0!==s&&f.tagCtx&&(f=f.tagCtx.view.scope),v=f._ocps,s=v&&v.hasOwnProperty(n)&&v[n]||s,s&&s._cxp||!i&&!g||((v||(f._ocps=f._ocps||{}))[n]=s=[{_ocp:s,_vw:u,_key:n}],s._cxp={path:Tt,ind:0,updateValue:function(t,n){return e.observable(s[0]).setProperty(Tt,t),this}})),l=s&&s._cxp)){if(arguments.length>2)return a=s[1]?ft._ceo(s[1].deps):[Tt],a.unshift(s[0]),a._cxp=l,a;if(p=l.tagElse,c=s[1]?l.tag&&l.tag.cvtArgs?l.tag.cvtArgs(p,1)[l.ind]:s[1](s[0].data,s[0],ft):s[0]._ocp,g)return s&&c!==r&&ft._ucp(n,r,f,l),f;s=c}return s&&st(s)&&(o=function(){return s.apply(this&&this!==t?this:u,arguments)},d(o,s)),o||s}}function m(t){return t&&(t.fn?t:this.getRsc("templates",t)||dt(t))}function h(t,e,n,r){var o,a,s,l,p,u="number"==typeof n&&e.tmpl.bnds[n-1];if(void 0===r&&u&&u._lr&&(r=""),void 0!==r?n=r={props:{},args:[r]}:u&&(n=u(e.data,e,ft)),u=u._bd&&u,t||u){if(a=e._lc,o=a&&a.tag,n.view=e,!o){if(o=d(new ft._tg,{_:{bnd:u,unlinked:!0,lt:n.lt},inline:!a,tagName:":",convert:t,onArrayChange:!0,flow:!0,tagCtx:n,tagCtxs:[n],_is:"tag"}),l=n.args.length,l>1)for(p=o.bindTo=[];l--;)p.unshift(l);a&&(a.tag=o,o.linkCtx=a),n.ctx=Q(n.ctx,(a?a.view:e).ctx),i(o,n)}o._er=r&&s,o.ctx=n.ctx||o.ctx||{},n.ctx=void 0,s=o.cvtArgs()[0],o._er=r&&s}else s=n.args[0];return s=u&&e._.onRender?e._.onRender(s,e,o):s,void 0!=s?s:""}function _(t,e){var n,r,i,o,a,s,l,d=this;if(d.tagName){if(s=d,d=(s.tagCtxs||[d])[t||0],!d)return}else s=d.tag;if(a=s.bindFrom,o=d.args,(l=s.convert)&&""+l===l&&(l="true"===l?void 0:d.view.getRsc("converters",l)||S("Unknown converter: '"+l+"'")),l&&!e&&(o=o.slice()),a){for(i=[],n=a.length;n--;)r=a[n],i.unshift(x(d,r));e&&(o=i)}if(l){if(l=l.apply(s,i||o),void 0===l)return o;if(a=a||[0],n=a.length,lt(l)&&l.length===n||(l=[l],a=[0],n=1),e)o=l;else for(;n--;)r=a[n],+r===r&&(o[r]=l[n])}return o}function x(t,e){return t=t[+e===e?"args":"props"],t&&t[e]}function b(t){return this.cvtArgs(t,1)}function w(t,e){var n,r,i=this;if(""+e===e){for(;void 0===n&&i;)r=i.tmpl&&i.tmpl[t],n=r&&r[e],i=i.parent;return n||ot[t][e]}}function y(t,e,n,r,o,a){function s(t){var e=l[t];if(void 0!==e)for(e=lt(e)?e:[e],m=e.length;m--;)J=e[m],isNaN(parseInt(J))||(e[m]=parseInt(J));return e||[0]}e=e||it;var l,d,p,u,c,f,g,m,h,w,y,k,C,T,j,A,P,R,N,M,F,V,$,I,D,J,U,q,K,L,B=0,H="",W=e._lc||!1,Z=e.ctx,z=n||e.tmpl,G="number"==typeof r&&e.tmpl.bnds[r-1];for("tag"===t._is?(l=t,t=l.tagName,r=l.tagCtxs,p=l.template):(d=e.getRsc("tags",t)||S("Unknown tag: {{"+t+"}} "),p=d.template),void 0===a&&G&&(G._lr=d.lateRender&&G._lr!==!1||G._lr)&&(a=""),void 0!==a?(H+=a,r=a=[{props:{},args:[],params:{props:{}}}]):G&&(r=G(e.data,e,ft)),g=r.length;B<g;B++)y=r[B],P=y.tmpl,(!W||!W.tag||B&&!W.tag.inline||l._er||P&&+P===P)&&(P&&z.tmpls&&(y.tmpl=y.content=z.tmpls[P-1]),y.index=B,y.ctxPrm=v,y.render=E,y.cvtArgs=_,y.bndArgs=b,y.view=e,y.ctx=Q(Q(y.ctx,d&&d.ctx),Z)),(n=y.props.tmpl)&&(y.tmpl=e._getTmpl(n),y.content=y.content||y.tmpl),l?W&&W.fn._lr&&(R=!!l.init):(l=new d._ctr,R=!!l.init,l.parent=f=Z&&Z.tag,l.tagCtxs=r,W&&(l.inline=!1,W.tag=l),l.linkCtx=W,(l._.bnd=G||W.fn)?(l._.ths=y.params.props["this"],l._.lt=r.lt,l._.arrVws={}):l.dataBoundOnly&&S(t+" must be data-bound:\n{^{"+t+"}}")),I=l.dataMap,y.tag=l,I&&r&&(y.map=r[B].map),l.flow||(k=y.ctx=y.ctx||{},u=l.parents=k.parentTags=Z&&Q(k.parentTags,Z.parentTags)||{},f&&(u[f.tagName]=f),u[l.tagName]=k.tag=l,k.tagCtx=y);if(!(l._er=a)){for(i(l,r[0]),l.rendering={rndr:l.rendering},B=0;B<g;B++){if(y=l.tagCtx=r[B],$=y.props,l.ctx=y.ctx,!B){if(R&&(l.init(y,W,l.ctx),R=void 0),y.args.length||y.argDefault===!1||l.argDefault===!1||(y.args=F=[y.view.data],y.params.args=["#data"]),T=s("bindTo"),void 0!==l.bindTo&&(l.bindTo=T),void 0!==l.bindFrom?l.bindFrom=s("bindFrom"):l.bindTo&&(l.bindFrom=l.bindTo=T),j=l.bindFrom||T,q=T.length,U=j.length,l._.bnd&&(K=l.linkedElement)&&(l.linkedElement=K=lt(K)?K:[K],q!==K.length&&S("linkedElement not same length as bindTo")),(K=l.linkedCtxParam)&&(l.linkedCtxParam=K=lt(K)?K:[K],U!==K.length&&S("linkedCtxParam not same length as bindFrom/bindTo")),j)for(l._.fromIndex={},l._.toIndex={},h=U;h--;)for(J=j[h],m=q;m--;)J===T[m]&&(l._.fromIndex[m]=h,l._.toIndex[h]=m);W&&(W.attr=l.attr=W.attr||l.attr||W._dfAt),c=l.attr,l._.noVws=c&&c!==Kt}if(F=l.cvtArgs(B),l.linkedCtxParam)for(V=l.cvtArgs(B,1),m=U,L=l.constructor.prototype.ctx;m--;)(C=l.linkedCtxParam[m])&&(J=j[m],A=V[m],y.ctx[C]=ft._cp(L&&void 0===A?L[C]:A,void 0!==A&&x(y.params,J),y.view,l._.bnd&&{tag:l,cvt:l.convert,ind:m,tagElse:B}));(N=$.dataMap||I)&&(F.length||$.dataMap)&&(M=y.map,M&&M.src===F[0]&&!o||(M&&M.src&&M.unmap(),N.map(F[0],y,M,!l._.bnd),M=y.map),F=[M.tgt]),w=void 0,l.render&&(w=l.render.apply(l,F),e.linked&&w&&!Et.test(w)&&(n={links:[]},n.render=n.fn=function(){return w},w=O(n,e.data,void 0,!0,e,void 0,void 0,l))),F.length||(F=[e]),void 0===w&&(D=F[0],l.contentCtx&&(D=l.contentCtx===!0?e:l.contentCtx(D)),w=y.render(D,!0)||(o?void 0:"")),H=H?H+(w||""):void 0!==w?""+w:void 0}l.rendering=l.rendering.rndr}return l.tagCtx=r[0],l.ctx=l.tagCtx.ctx,l._.noVws&&l.inline&&(H="text"===c?pt.html(H):""),G&&e._.onRender?e._.onRender(H,e,l):H}function k(t,e,n,r,i,o,a,s){var l,d,p,u=this,f="array"===e;u.content=s,u.views=f?[]:{},u.data=r,u.tmpl=i,p=u._={key:0,useKey:f?0:1,id:""+Jt++,onRender:a,bnds:{}},u.linked=!!a,u.type=e||"top",n&&"top"!==n.type||((u.ctx=t||{}).root=u.data),(u.parent=n)?(u.root=n.root||u,l=n.views,d=n._,u.isTop=d.scp,u.scope=(!t.tag||t.tag===n.ctx.tag)&&!u.isTop&&n.scope||u,d.useKey?(l[p.key="_"+d.useKey++]=u,u.index=Ht,u.getIndex=c):l.length===(p.key=u.index=o)?l.push(u):l.splice(o,0,u),u.ctx=t||n.ctx):e&&(u.root=u)}function C(t){var e,n,r;for(e in Gt)n=e+"s",t[n]&&(r=t[n],t[n]={},ot[n](r,t))}function T(t,e,n){function i(){var e=this;e._={unlinked:!0},e.inline=!0,e.tagName=t}var o,a,s,l=new ft._tg;if(st(e)?e={depends:e.depends,render:e}:""+e===e&&(e={template:e}),a=e.baseTag){e.flow=!!e.flow,a=""+a===a?n&&n.tags[a]||ct[a]:a,a||S('baseTag: "'+e.baseTag+'" not found'),l=d(l,a);for(s in e)l[s]=r(a[s],e[s])}else l=d(l,e);return void 0!==(o=l.template)&&(l.template=""+o===o?dt[o]||dt(o):o),(i.prototype=l).constructor=l._ctr=i,n&&(l._parentTmpl=n),l}function j(t){return this.base.apply(this,t)}function A(t,n,r,i){function o(n){var o,s;if(""+n===n||n.nodeType>0&&(a=n)){if(!a)if(/^\.\/[^\\:*?"<>]*$/.test(n))(s=dt[t=t||n])?n=s:a=document.getElementById(n);else if(e.fn&&!ft.rTmpl.test(n))try{a=e(n,document)[0]}catch(l){}a&&("SCRIPT"!==a.tagName&&S(n+": Use script block, not "+a.tagName),i?n=a.innerHTML:(o=a.getAttribute(Bt),o&&(o!==Qt?(n=dt[o],delete dt[o]):e.fn&&(n=e.data(a)[Qt])),o&&n||(t=t||(e.fn?Qt:n),n=A(t,a.innerHTML,r,i)),n.tmplName=t=t||o,t!==Qt&&(dt[t]=n),a.setAttribute(Bt,t),e.fn&&e.data(a,Qt,n))),a=void 0}else n.fn||(n=void 0);return n}var a,s,l=n=n||"";if(ft._html=pt.html,0===i&&(i=void 0,l=o(l)),i=i||(n.markup?n.bnds?d({},n):n:{}),i.tmplName=i.tmplName||t||"unnamed",r&&(i._parentTmpl=r),!l&&n.markup&&(l=o(n.markup))&&l.fn&&(l=l.markup),void 0!==l)return l.render||n.render?l.tmpls&&(s=l):(n=M(l,i),J(l.replace(Pt,"\\$&"),n)),s||(s=d(function(){return s.render.apply(s,arguments)},n),C(s)),s}function P(t,e){return st(t)?t.call(e):t}function R(t,e,n){Object.defineProperty(t,e,{value:n,configurable:!0})}function N(t,n){function r(t){p.apply(this,t)}function i(){return new r(arguments)}function o(t,e){for(var n,r,i,o,a,s=0;s<x;s++)i=f[s],n=void 0,i+""!==i&&(n=i,i=n.getter,a=n.parentRef),void 0===(o=t[i])&&n&&void 0!==(r=n.defaultVal)&&(o=P(r,t)),e(o,n&&c[n.type],i,a)}function a(e){e=e+""===e?JSON.parse(e):e;var n,r,i,a,d=0,p=e,u=[];if(lt(e)){for(e=e||[],n=e.length;d<n;d++)u.push(this.map(e[d]));return u._is=t,u.unmap=l,u.merge=s,u}if(e){for(o(e,function(t,e){e&&(t=e.map(t)),u.push(t)}),p=this.apply(this,u),d=x;d--;)if(i=u[d],a=f[d].parentRef,a&&i&&i.unmap)if(lt(i))for(n=i.length;n--;)R(i[n],a,p);else R(i,a,p);for(r in e)r===at||w[r]||(p[r]=e[r])}return p}function s(t,e,n){t=t+""===t?JSON.parse(t):t;var r,a,s,l,d,p,u,c,f,g,m=0,h=this;if(lt(h)){for(u={},f=[],a=t.length,s=h.length;m<a;m++){for(c=t[m],p=!1,r=0;r<s&&!p;r++)u[r]||(d=h[r],v&&(u[r]=p=v+""===v?c[v]&&(w[v]?d[v]():d[v])===c[v]:v(d,c)));p?(d.merge(c),f.push(d)):(f.push(g=i.map(c)),n&&R(g,n,e))}return void(b?b(h).refresh(f,!0):h.splice.apply(h,[0,h.length].concat(f)))}o(t,function(t,e,n,r){e?h[n]().merge(t,h,r):h[n]()!==t&&h[n](t)});for(l in t)l===at||w[l]||(h[l]=t[l])}function l(){function t(t){for(var e=[],n=0,r=t.length;n<r;n++)e.push(t[n].unmap());return e}var e,n,r,i,o=0,a=this;if(lt(a))return t(a);for(e={};o<x;o++)n=f[o],r=void 0,n+""!==n&&(r=n,n=r.getter),i=a[n](),e[n]=r&&i&&c[r.type]?lt(i)?t(i):i.unmap():i;for(n in a)!a.hasOwnProperty(n)||"_"===n.charAt(0)&&w[n.slice(1)]||n===at||st(a[n])||(e[n]=a[n]);return e}var d,p,u,c=this,f=n.getters,g=n.extend,v=n.id,m=e.extend({_is:t||"unnamed",unmap:l,merge:s},g),h="",_="",x=f?f.length:0,b=e.observable,w={};for(r.prototype=m,d=0;d<x;d++)!function(t){t=t.getter||t,w[t]=d+1;var e="_"+t;h+=(h?",":"")+t,_+="this."+e+" = "+t+";\n",m[t]=m[t]||function(n){return arguments.length?void(b?b(this).setProperty(t,n):this[e]=n):this[e]},b&&(m[t].set=m[t].set||function(t){this[e]=t})}(f[d]);return _=new Function(h,_),p=function(){_.apply(this,arguments),(u=arguments[x+1])&&R(this,arguments[x],u)},p.prototype=m,m.constructor=p,i.map=a,i.getters=f,i.extend=g,i.id=v,i}function M(t,n){var r,i=vt._wm||{},o={tmpls:[],links:{},bnds:[],_is:"template",render:E};return n&&(o=d(o,n)),o.markup=t,o.htmlTag||(r=Mt.exec(t),o.htmlTag=r?r[1].toLowerCase():""),r=i[o.htmlTag],r&&r!==i.div&&(o.markup=e.trim(o.markup)),o}function F(t,e){function n(i,o,a){var s,l,d,p=ft.onStore[t];if(i&&typeof i===Lt&&!i.nodeType&&!i.markup&&!i.getTgt&&!("viewModel"===t&&i.getters||i.extend)){for(l in i)n(l,i[l],o);return o||ot}return i&&""+i!==i&&(a=o,o=i,i=void 0),d=a?"viewModel"===t?a:a[r]=a[r]||{}:n,s=e.compile,void 0===o&&(o=s?i:d[i],i=void 0),null===o?i&&delete d[i]:(s&&(o=s.call(d,i,o,a,0)||{},o._is=t),i&&(d[i]=o)),p&&p(i,o,a,s),o}var r=t+"s";ot[r]=n}function V(t){mt[t]=mt[t]||function(e){return arguments.length?(gt[t]=e,mt):gt[t]}}function $(t){function e(e,n){this.tgt=t.getTgt(e,n),n.map=this}return st(t)&&(t={getTgt:t}),t.baseMap&&(t=d(d({},t.baseMap),t)),t.map=function(t,n){return new e(t,n)},t}function E(t,e,n,r,i,o){var a,s,l,d,p,u,c,f,g=r,v="";if(e===!0?(n=e,e=void 0):typeof e!==Lt&&(e=void 0),(l=this.tag)?(p=this,g=g||p.view,d=g._getTmpl(l.template||p.tmpl),arguments.length||(t=l.contentCtx&&st(l.contentCtx)?t=l.contentCtx(t):g)):d=this,d){if(!r&&t&&"view"===t._is&&(g=t),g&&t===g&&(t=g.data),u=!g,kt=kt||u,g||((e=e||{}).root=t),!kt||vt.useViews||d.useViews||g&&g!==it)v=O(d,t,e,n,g,i,o,l);else{if(g?(c=g.data,f=g.index,g.index=Ht):(g=it,c=g.data,g.data=t,g.ctx=e),lt(t)&&!n)for(a=0,s=t.length;a<s;a++)g.index=a,g.data=t[a],v+=d.fn(t[a],g,ft);else g.data=t,v+=d.fn(t,g,ft);g.data=c,g.index=f}u&&(kt=void 0)}return v}function O(t,e,n,r,i,o,a,s){var l,p,u,c,f,g,v,m,h,_,x,b,w,y="";if(s&&(h=s.tagName,b=s.tagCtx,n=n?Q(n,s.ctx):s.ctx,t===i.content?v=t!==i.ctx._wrp?i.ctx._wrp:void 0:t!==b.content?t===s.template?(v=b.tmpl,n._wrp=b.content):v=b.content||i.content:v=i.content,b.props.link===!1&&(n=n||{},n.link=!1)),i&&(a=a||i._.onRender,w=n&&n.link===!1,w&&i._.nl&&(a=void 0),n=Q(n,i.ctx),b=!s&&i.tag?i.tag.tagCtxs[i.tagElse]:b),(_=b&&b.props.itemVar)&&("~"!==_[0]&&D("Use itemVar='~myItem'"),_=_.slice(1)),o===!0&&(g=!0,o=0),a&&s&&s._.noVws&&(a=void 0),m=a,a===!0&&(m=void 0,a=i._.onRender),n=t.helpers?Q(t.helpers,n):n,x=n,lt(e)&&!r)for(u=g?i:void 0!==o&&i||new k(n,"array",i,e,t,o,a,v),u._.nl=w,i&&i._.useKey&&(u._.bnd=!s||s._.bnd&&s,u.tag=s),l=0,p=e.length;l<p;l++)c=new k(x,"item",u,e[l],t,(o||0)+l,a,u.content),_&&((c.ctx=d({},x))[_]=ft._cp(e[l],"#data",c)),f=t.fn(e[l],c,ft),y+=u._.onRender?u._.onRender(f,c):f;else u=g?i:new k(x,h||"data",i,e,t,o,a,v),_&&((u.ctx=d({},x))[_]=ft._cp(e,"#data",u)),u.tag=s,u._.nl=w,y+=t.fn(e,u,ft);return s&&(u.tagElse=b.index,b.contentView=u),m?m(y,u):y}function I(t,e,n){var r=void 0!==n?st(n)?n.call(e.data,t,e):n||"":"{Error: "+(t.message||t)+"}";return gt.onError&&void 0!==(n=gt.onError.call(e.data,t,n&&r,e))&&(r=n),e&&!e._lc?pt.html(r):r}function S(t){throw new ft.Err(t)}function D(t){S("Syntax error\n"+t)}function J(t,e,n,r,i){function o(e){e-=v,e&&h.push(t.substr(v,e).replace(jt,"\\n"))}function a(e,n){e&&(e+="}}",D((n?"{{"+n+"}} block has {{/"+e+" without {{"+e:"Unmatched or missing {{/"+e)+", in template:\n"+t))}function s(s,l,d,c,g,x,b,w,y,k,C,T){(b&&l||y&&!d||w&&":"===w.slice(-1)||k)&&D(s),x&&(g=":",c=Kt),y=y||n&&!i;var j,A,P,R=(l||n)&&[[]],N="",M="",F="",V="",$="",E="",O="",I="",S=!y&&!g;d=d||(w=w||"#data",g),o(T),v=T+s.length,b?f&&h.push(["*","\n"+w.replace(/^:/,"ret+= ").replace(At,"$1")+";\n"]):d?("else"===d&&(Nt.test(w)&&D('For "{{else if expr}}" use "{{else expr}}"'),R=_[9]&&[[]],_[10]=t.substring(_[10],T),A=_[11]||_[0]||D("Mismatched: "+s),_=m.pop(),h=_[2],S=!0),w&&L(w.replace(jt," "),R,e,n).replace(Rt,function(t,e,n,r,i,o,a,s){return"this:"===r&&(o="undefined"),s&&(P=P||"@"===s[0]),r="'"+i+"':",a?(M+=n+o+",",V+="'"+s+"',"):n?(F+=r+"j._cp("+o+',"'+s+'",view),',E+=r+"'"+s+"',"):e?O+=o:("trigger"===i&&(I+=o),"lateRender"===i&&(j="false"!==s),N+=r+o+",",$+=r+"'"+s+"',",u=u||$t.test(i)),""}).slice(0,-1),R&&R[0]&&R.pop(),p=[d,c||!!r||u||"",S&&[],q(V||(":"===d?"'#data',":""),$,E),q(M||(":"===d?"data,":""),N,F),O,I,j,P,R||0],h.push(p),S&&(m.push(_),_=p,_[10]=v,_[11]=A)):C&&(a(C!==_[0]&&C!==_[11]&&C,_[0]),_[10]=t.substring(_[10],T),_=m.pop()),a(!_&&C),h=_[2]}var l,d,p,u,c,f=gt.allowCode||e&&e.allowCode||mt.allowCode===!0,g=[],v=0,m=[],h=g,_=[,,g];if(f&&e._is&&(e.allowCode=f),n&&(void 0!==r&&(t=t.slice(0,-r.length-2)+xt),t=ht+t+bt),a(m[0]&&m[0][2].pop()[0]),t.replace(rt,s),o(t.length),(v=g[g.length-1])&&a(""+v!==v&&+v[10]===v[10]&&v[0]),n){for(d=B(g,t,n),c=[],l=g.length;l--;)c.unshift(g[l][9]);U(d,c)}else d=B(g,e);return d}function U(t,e){var n,r,i=0,o=e.length;for(t.deps=[],t.paths=[];i<o;i++){t.paths.push(r=e[i]);for(n in r)"_jsvto"!==n&&r.hasOwnProperty(n)&&r[n].length&&!r[n].skp&&(t.deps=t.deps.concat(r[n]))}}function q(t,e,n){return[t.slice(0,-1),e.slice(0,-1),n.slice(0,-1)]}function K(t,e){return"\n\t"+(e?e+":{":"")+"args:["+t[0]+"],\n\tprops:{"+t[1]+"}"+(t[2]?",\n\tctx:{"+t[2]+"}":"")}function L(t,e,n,r){function i(i,p,x,b,w,y,k,C,T,j,A,P,R,N,M,F,V,$,E,O,I){function S(t,n,i,s,l,d,p,f){var g="."===i;if(i&&(w=w.slice(n.length),/^\.?constructor$/.test(f||w)&&D(t),g||(t=(j?(r?"":"(ltOb.lt=ltOb.lt||")+"(ob=":"")+(s?'view.ctxPrm("'+s+'")':l?"view":"data")+(j?")===undefined"+(r?"":")")+'?"":view._getOb(ob,"':"")+(f?(d?"."+d:s?"":l?"":"."+i)+(p||""):(f=s?"":l?d||"":i,"")),t+=f?"."+f:"",t=n+("view.data"===t.slice(0,9)?t.slice(5):t)+(j?(r?'"':'",ltOb')+(A?",1)":")"):"")),u)){if(K="_linkTo"===o?a=e._jsvto=e._jsvto||[]:c.bd,L=g&&K[K.length-1]){if(L._cpfn){for(;L.sb;)L=L.sb;L.bnd&&(w="^"+w.slice(1)),L.sb=w,L.bnd=L.bnd||"^"===w[0]}}else K.push(w);_[m]=O+(g?1:0)}return t}b&&!C&&(w=b+w),y=y||"",x=x||p||R,w=w||T,j&&(j=!/\)|]/.test(I[O-1]))&&(w=w.slice(1).split(".").join("^")),A=A||$||"";var U,q,K,L,B,Q=")";if("["===A&&(A="[j._sq(",Q=")]"),!k||d||l){if(u&&V&&!d&&!l&&m&&(U=_[m-1],I.length-1>O-(U||0))){if(U=I.slice(U,O+i.length),q!==!0)if(K=a||f[m-1].bd,L=K[K.length-1],L&&L.prm){for(;L.sb&&L.sb.prm;)L=L.sb;B=L.sb={path:L.sb,bnd:L.bnd}}else K.push(B={path:K.pop()});V=_t+":"+U+" onerror=''"+xt,q=v[V],q||(v[V]=!0,v[V]=q=J(V,n,!0)),q!==!0&&B&&(B._cpfn=q,B.prm=c.bd,B.bnd=B.bnd||B.path&&B.path.indexOf("^")>=0)}return d?(d=!N,d?i:R+'"'):l?(l=!M,l?i:R+'"'):(x?(_[m]=O++,c=f[++m]={bd:[]},x):"")+(E?m?"":(g=I.slice(g,O),(o?(o=s=a=!1,"\b"):"\b,")+g+(g=O+i.length,u&&e.push(c.bd=[]),"\b")):C?(m&&D(t),u&&e.pop(),o="_"+w,s=b,g=O+i.length,u&&(u=c.bd=e[o]=[],u.skp=!b),w+":"):w?w.split("^").join(".").replace(ft.rPath,S)+(A?(c=f[++m]={bd:[]},h[m]=Q,A):y):y?y:F?(F=h[m]||F,h[m]=!1,c=f[--m],F+(A?(c=f[++m],h[m]=Q,A):"")):P?(h[m]||D(t),","):p?"":(d=N,l=M,'"'))}D(t)}var o,a,s,l,d,p,u=e&&e[0],c={bd:u},f={0:c},g=0,v=(n?n.links:u&&(u.links=u.links||{}))||it.tmpl.links,m=0,h={},_={};return"@"===t[0]&&(t=t.replace(Dt,".")),p=(t+(n?" ":"")).replace(ft.rPrm,i),!m&&p||D(t)}function B(t,e,n){var r,i,o,a,s,l,d,p,u,c,f,g,v,m,h,_,x,b,w,y,k,C,T,j,A,P,R,N,F,V,$,E,O,I=0,S=vt.useViews||e.useViews||e.tags||e.templates||e.helpers||e.converters,J="",q={},L=t.length;for(""+e===e?(b=n?'data-link="'+e.replace(jt," ").slice(1,-1)+'"':e,e=0):(b=e.tmplName||"unnamed",e.allowCode&&(q.allowCode=!0),e.debug&&(q.debug=!0),f=e.bnds,x=e.tmpls),r=0;r<L;r++)if(i=t[r],""+i===i)J+='\n+"'+i+'"';else if(o=i[0],"*"===o)J+=";\n"+i[1]+"\nret=ret";else{if(a=i[1],k=!n&&i[2],s=K(i[3],"params")+"},"+K(v=i[4]),V=i[6],$=i[7],i[8]?(E="\nvar ob,ltOb={},ctxs=",O=";\nctxs.lt=ltOb.lt;\nreturn ctxs;"):(E="\nreturn ",O=""),C=i[10]&&i[10].replace(At,"$1"),(A="else"===o)?g&&g.push(i[9]):(N=i[5]||gt.debugMode!==!1&&"undefined",f&&(g=i[9])&&(g=[g],I=f.push(1))),S=S||v[1]||v[2]||g||/view.(?!index)/.test(v[0]),(P=":"===o)?a&&(o=a===Kt?">":a+o):(k&&(w=M(C,q),w.tmplName=b+"/"+o,w.useViews=w.useViews||S,B(k,w),S=w.useViews,x.push(w)),A||(y=o,S=S||o&&(!ct[o]||!ct[o].flow),j=J,J=""),T=t[r+1],T=T&&"else"===T[0]),F=N?";\ntry{\nret+=":"\n+",m="",h="",P&&(g||V||a&&a!==Kt||$)){if(R=new Function("data,view,j,u","// "+b+" "+ ++I+" "+o+E+"{"+s+"};"+O),R._er=N,R._tag=o,R._bd=!!g,R._lr=$,n)return R;U(R,g),_='c("'+a+'",view,',c=!0,m=_+I+",",h=")"}if(J+=P?(n?(N?"try{\n":"")+"return ":F)+(c?(c=void 0,S=u=!0,_+(R?(f[I-1]=R,I):"{"+s+"}")+")"):">"===o?(d=!0,"h("+v[0]+")"):(p=!0,"((v="+v[0]+")!=null?v:"+(n?"null)":'"")'))):(l=!0,"\n{view:view,content:false,tmpl:"+(k?x.length:"false")+","+s+"},"),y&&!T){if(J="["+J.slice(0,-1)+"]",_='t("'+y+'",view,this,',n||g){if(J=new Function("data,view,j,u"," // "+b+" "+I+" "+y+E+J+O),J._er=N,J._tag=y,g&&U(f[I-1]=J,g),J._lr=$,n)return J;m=_+I+",undefined,",h=")"}J=j+F+_+(g&&I||J)+")",g=0,y=0}N&&!T&&(S=!0,J+=";\n}catch(e){ret"+(n?"urn ":"+=")+m+"j._err(e,view,"+N+")"+h+";}"+(n?"":"ret=ret"))}J="// "+b+(q.debug?"\ndebugger;":"")+"\nvar v"+(l?",t=j._tag":"")+(u?",c=j._cnvt":"")+(d?",h=j._html":"")+(n?(i[8]?", ob":"")+";\n":',ret=""')+J+(n?"\n":";\nreturn ret;");try{J=new Function("data,view,j,u",J)}catch(Q){D("Compiled template code:\n\n"+J+'\n: "'+(Q.message||Q)+'"')}return e&&(e.fn=J,e.useViews=!!S),J}function Q(t,e){return t&&t!==e?e?d(d({},e),t):t:e&&d({},e)}function H(t,n){var r,i,o=n.map,a=o&&o.propsArr;if(!a){if(a=[],typeof t===Lt||st(t))for(r in t)i=t[r],r===at||!t.hasOwnProperty(r)||n.props.noFunctions&&e.isFunction(i)||a.push({key:r,prop:i});o&&(o.propsArr=o.options&&a)}return W(a,n)}function W(t,n){var r,i,o,a=n.tag,s=n.props,l=n.params.props,d=s.filter,p=s.sort,u=p===!0,c=parseInt(s.step),f=s.reverse?-1:1;if(!lt(t))return t;if(u||p&&""+p===p?(r=t.map(function(t,e){return t=u?t:g(t,p),{i:e,v:""+t===t?t.toLowerCase():t}}),r.sort(function(t,e){return t.v>e.v?f:t.v<e.v?-f:0}),t=r.map(function(e){return t[e.i]})):(p||f<0)&&!a.dataMap&&(t=t.slice()),st(p)&&(t=t.sort(function(){return p.apply(n,arguments)})),f<0&&(!p||st(p))&&(t=t.reverse()),t.filter&&d&&(t=t.filter(d,n),n.tag.onFilter&&n.tag.onFilter(n)),l.sorted&&(r=p||f<0?t:t.slice(),a.sorted?e.observable(a.sorted).refresh(r):n.map.sorted=r),i=s.start,o=s.end,(l.start&&void 0===i||l.end&&void 0===o)&&(i=o=0),isNaN(i)&&isNaN(o)||(i=+i||0,o=void 0===o||o>t.length?t.length:+o,t=t.slice(i,o)),c>1){for(i=0,o=t.length,r=[];i<o;i+=c)r.push(t[i]);t=r}return l.paged&&a.paged&&$observable(a.paged).refresh(t),t}function Z(t,n,r){var i=this.jquery&&(this[0]||S("Unknown template")),o=i.getAttribute(Bt);return E.call(o&&e.data(i)[Qt]||dt(i),t,n,r)}function z(t){return Ut[t]||(Ut[t]="&#"+t.charCodeAt(0)+";")}function G(t,e){return qt[e]||""}function X(t){return void 0!=t?Vt.test(t)&&(""+t).replace(Ot,z)||t:""}function Y(t){return""+t===t?t.replace(It,z):t}function tt(t){return""+t===t?t.replace(St,G):t}var et=e===!1;e=e&&e.fn?e:t.jQuery;var nt,rt,it,ot,at,st,lt,dt,pt,ut,ct,ft,gt,vt,mt,ht,_t,xt,bt,wt,yt,kt,Ct="v1.0.5",Tt="_ocp",jt=/[ \t]*(\r\n|\n|\r)/g,At=/\\(['"])/g,Pt=/['"\\]/g,Rt=/(?:\x08|^)(onerror:)?(?:(~?)(([\w$.]+):)?([^\x08]+))\x08(,)?([^\x08]+)/gi,Nt=/^if\s/,Mt=/<(\w+)[>\s]/,Ft=/[\x00`><"'&=]/g,Vt=/[\x00`><\"'&=]/,$t=/^on[A-Z]|^convert(Back)?$/,Et=/^\#\d+_`[\s\S]*\/\d+_`$/,Ot=Ft,It=/[&<>]/g,St=/&(amp|gt|lt);/g,Dt=/\[['"]?|['"]?\]/g,Jt=0,Ut={"&":"&amp;","<":"&lt;",">":"&gt;","\0":"&#0;","'":"&#39;",'"':"&#34;","`":"&#96;","=":"&#61;"},qt={amp:"&",gt:">",lt:"<"},Kt="html",Lt="object",Bt="data-jsv-tmpl",Qt="jsvTmpl",Ht="For #index in nested block use #getIndex().",Wt={},Zt=t.jsrender,zt=Zt&&e&&!e.render,Gt={template:{compile:A},tag:{compile:T},viewModel:{compile:N},helper:{},converter:{}};if(ot={jsviews:Ct,sub:{rPath:/^(!*?)(?:null|true|false|\d[\d.]*|([\w$]+|\.|~([\w$]+)|#(view|([\w$]+))?)([\w$.^]*?)(?:[.[^]([\w$]+)\]?)?)$/g,rPrm:/(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)(~?[\w$.^]+)?\s*((\+\+|--)|\+|-|~(?![\w$])|&&|\|\||===|!==|==|!=|<=|>=|[<>%*:?\/]|(=))\s*|(!*?(@)?[#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*(([)\]])(?=[.^]|\s*$|[^([])|[)\]])([([]?))|(\s+)/g,View:k,Err:l,tmplFn:J,parse:L,extend:d,extendCtx:Q,syntaxErr:D,onStore:{template:function(t,e){null===e?delete Wt[t]:t&&(Wt[t]=e)}},addSetting:V,settings:{allowCode:!1},advSet:a,_thp:i,_gm:r,_tg:function(){},_cnvt:h,_tag:y,_er:S,_err:I,_cp:o,_sq:function(t){return"constructor"===t&&D(""),t}},settings:{delimiters:p,advanced:function(t){return t?(d(vt,t),ft.advSet(),mt):vt}},map:$},(l.prototype=new Error).constructor=l,c.depends=function(){return[this.get("item"),"index"]},f.depends="index",k.prototype={get:u,getIndex:f,ctxPrm:v,getRsc:w,_getTmpl:m,_getOb:g,_is:"view"},ft=ot.sub,mt=ot.settings,!(Zt||e&&e.render)){for(nt in Gt)F(nt,Gt[nt]);if(pt=ot.converters,ut=ot.helpers,ct=ot.tags,ft._tg.prototype={baseApply:j,cvtArgs:_,bndArgs:b,ctxPrm:v},it=ft.topView=new k,e){if(e.fn.render=Z,at=e.expando,e.observable){if(Ct!==(Ct=e.views.jsviews))throw"JsObservable requires JsRender "+Ct;d(ft,e.views.sub),ot.map=e.views.map}}else e={},et&&(t.jsrender=e),e.renderFile=e.__express=e.compile=function(){throw"Node.js: use npm jsrender, or jsrender-node.js"},e.isFunction=function(t){return"function"==typeof t},e.isArray=Array.isArray||function(t){return"[object Array]"==={}.toString.call(t)},ft._jq=function(t){t!==e&&(d(t,e),e=t,e.fn.render=Z,delete e.jsrender,at=e.expando)},e.jsrender=Ct;gt=ft.settings,gt.allowCode=!1,st=e.isFunction,e.render=Wt,e.views=ot,e.templates=dt=ot.templates;for(yt in gt)V(yt);(mt.debugMode=function(t){return void 0===t?gt.debugMode:(gt.debugMode=t,gt.onError=t+""===t?function(){return t}:st(t)?t:void 0,mt)})(!1),vt=gt.advanced={useViews:!1,_jsv:!1},ct({"if":{render:function(t){var e=this,n=e.tagCtx,r=e.rendering.done||!t&&(n.args.length||!n.index)?"":(e.rendering.done=!0,void(e.selected=n.index));return r},contentCtx:!0,flow:!0},"for":{sortDataMap:$(W),init:function(t,e){this.setDataMap(this.tagCtxs)},render:function(t){var e,n,r,i,o,a=this,s=a.tagCtx,l=s.argDefault===!1,d=s.props,p=l||s.args.length,u="",c=0;if(!a.rendering.done){if(e=p?t:s.view.data,l)for(l=d.reverse?"unshift":"push",i=+d.end,o=+d.step||1,e=[],r=+d.start||0;(i-r)*o>0;r+=o)e[l](r);void 0!==e&&(n=lt(e),u+=s.render(e,!p||d.noIteration),c+=n?e.length:1),(a.rendering.done=c)&&(a.selected=s.index)}return u},setDataMap:function(t){for(var e,n,r,i=this,o=t.length;o--;)e=t[o],n=e.props,r=e.params.props,e.argDefault=void 0===n.end||e.args.length>0,n.dataMap=e.argDefault!==!1&&lt(e.args[0])&&(r.sort||r.start||r.end||r.step||r.filter||r.reverse||n.sort||n.start||n.end||n.step||n.filter||n.reverse)&&i.sortDataMap},flow:!0},props:{baseTag:"for",dataMap:$(H),init:a,flow:!0},include:{flow:!0},"*":{render:o,flow:!0},":*":{render:o,flow:!0},dbg:ut.dbg=pt.dbg=s}),pt({html:X,attr:X,encode:Y,unencode:tt,url:function(t){return void 0!=t?encodeURI(""+t):null===t?t:""}})}return gt=ft.settings,lt=(e||Zt).isArray,mt.delimiters("{{","}}","^"),zt&&Zt.views.sub._jq(e),e||Zt},window);
4
+ //# sourceMappingURL=jsrender.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["jsrender.js"],"names":["factory","global","$","jQuery","exports","module","fn","define","amd","getDerivedMethod","baseMethod","method","ret","tag","this","prevBase","base","apply","arguments","getMethod","$isFunction","_d","noop","tagHandlersFromProps","tagCtx","prop","props","rHasHandlers","test","fix","constructor","prototype","retVal","val","dbgBreak","console","log","e","baseApply","JsViewsError","message","name","link","$extend","target","source","$viewsDelimiters","openChars","closeChars","$isArray","$views","linkChar","error","delimOpenChar0","delimOpenChar1","delimCloseChar0","delimCloseChar1","$subSettings","delimiters","rTag","$sub","RegExp","rTmpl","$viewsSettings","getView","inner","type","undefined","views","i","l","found","view","root","_","useKey","get","length","parent","getNestedIndex","index","getIndex","getPathObject","ob","path","ltOb","prevOb","tokens","split","lt","contextParameter","key","value","wrapped","deps","res","obsCtxPrm","tagElse","callView","newRes","storeView","isUpdate","isRenderCall","store","ctx","hasOwnProperty","$helpers","linked","_cxp","scope","isTop","_ocps","_ocp","_vw","_key","ind","updateValue","observable","setProperty","_ceo","unshift","cvtArgs","data","_ucp","getTemplate","tmpl","getRsc","$templates","convertVal","converter","onError","linkCtx","argsLen","bindTo","boundTag","bnds","_lr","args","_bd","_lc","_tg","bnd","unlinked","inline","tagName","convert","onArrayChange","flow","tagCtxs","_is","extendCtx","_er","onRender","convertArgs","bound","boundArgs","bindFrom","slice","argOrProp","context","convertBoundArgs","getResource","resourceType","itemName","renderTag","parentView","bindToOrBindFrom","bindArray","m","isNaN","parseInt","topView","tagDef","template","tags","attr","parentTag","n","itemRet","tagCtxCtx","ctxPrm","initVal","content","callInit","mapDef","thisMap","bdArgs","tagDataMap","contentCtx","bindFromLength","bindToLength","linkedElement","defaultCtx","parentTmpl","lateRender","params","tmpls","render","renderContent","bndArgs","_getTmpl","init","_ctr","ths","arrVws","dataBoundOnly","dataMap","map","parents","parentTags","rendering","rndr","argDefault","linkedCtxParam","fromIndex","toIndex","_dfAt","noVws","HTML","_cp","cvt","src","unmap","tgt","rWrappedInViewMarker","links","renderWithViews","$converters","html","View","contentTmpl","parentView_","self_","self","isArray","id","viewId","scp","indexStr","push","splice","compileChildResources","storeName","storeNames","resources","jsvStores","compileTag","Tag","baseTag","compiledDef","depends","$tags","_parentTmpl","compileTmpl","options","lookupTemplate","currentName","nodeType","elem","document","getElementById","innerHTML","getAttribute","tmplAttr","jsvTmpl","tmplName","setAttribute","compiledTmpl","tmplOrMarkup","_html","markup","tmplObject","tmplFn","replace","rEscapeQuotes","getDefaultVal","defaultVal","call","addParentRef","ref","Object","defineProperty","configurable","compileViewModel","JsvVm","vm","iterate","action","getterType","parentRef","j","getterCount","getters","getter","viewModels","JSON","parse","childOb","arr","merge","viewModel","$expando","getterNames","mod","assigned","newModArr","k","model","$observable","refresh","concat","unmapArray","modelArr","charAt","extend","proto","cnstr","privField","set","Function","htmlTag","wrapMap","$subSettingsAdvanced","_wm","rFirstElem","exec","toLowerCase","div","trim","registerStore","storeSettings","theStore","item","compile","thisStore","onStore","OBJECT","getTgt","addSetting","st","Map","baseMap","noIteration","isTopRenderCall","prevData","prevIndex","result","useViews","newView","childView","itemResult","swapContent","outerOnRender","itemVar","newCtx","noLinking","_wrp","nl","syntaxError","helpers","contentView","onRenderError","fallback","Err","isLinkExpr","convertBack","hasElse","pushprecedingContent","shift","loc","substr","rNewLine","blockTagCheck","block","parseTag","all","bind","colon","codeTag","slash","bind2","closeBlock","late","openTagName","isLateOb","pathBindings","ctxProps","paramsArgs","paramsProps","paramsCtxProps","useTrigger","allowCode","rUnescapeQuotes","rTestElseIf","current","substring","stack","pop","parseParams","rBuildHash","onerror","isCtxPrm","keyToken","keyValue","arg","param","hasHandlers","newNode","parsedParam","bindings","astTop","buildCode","setPaths","pathsArr","paths","skp","paramStructure","parts","parseTokens","lftPrn0","lftPrn","operator","err","eq","path2","prn","comma","lftPrn2","apos","quot","rtPrn","rtPrnDot","prn2","space","full","parsePath","allPath","not","object","helper","viewProperty","pathTokens","leafToken","subPath","binds","named","bindto","_jsvto","bndCtx","bd","theOb","_cpfn","sb","pathStart","parenDepth","join","expr","exprFn","newOb","rtSq","aposed","quoted","bndStack","prm","tmplLinks","indexOf","paramIndex","boundName","rPath","fnCall","0","rBracketQuote","rPrm","ast","node","hasTag","hasEncoder","getsVal","hasCnvt","useCnvt","tmplBindings","boundOnErrStart","boundOnErrEnd","tagRender","nestedTmpls","nestedTmpl","tagAndElses","nextIsElse","oldCode","isElse","isGetVal","tagCtxFn","tagStart","trigger","retStrOpen","retStrClose","tmplBindingKey","templates","converters","code","tmplOptions","debug","debugMode","_tag","parentContext","getTargetProps","propsArr","noFunctions","isFunction","getTargetSorted","mapped","start","end","propParams","filter","sort","directSort","step","reverse","v","a","b","onFilter","sorted","paged","$fnRender","tmplElem","jquery","getCharEntity","ch","charEntities","charCodeAt","getCharFromEntity","match","token","charsFromEntities","htmlEncode","text","rIsHtml","rHtmlEncode","dataEncode","rDataEncode","dataUnencode","rDataUnencode","setGlobals","jsvStoreName","setting","versionNumber","rAttrEncode","&","<",">","\u0000","'","\"","`","=","amp","gt","$render","jsr","jsrender","jsrToJq","jsviews","sub","syntaxErr","settings","advSet","_thp","_gm","_cnvt","_err","_sq","advanced","Error","_getOb","expando","renderFile","__express","Array","obj","_jq","jq","_jsv","if","done","selected","for","sortDataMap","cloned","setDataMap","range","include","*",":*","dbg","encode","unencode","url","encodeURI","window"],"mappings":";;CAaC,SAASA,EAASC,GAElB,GAAIC,GAAID,EAAOE,MAEQ,iBAAZC,SACVC,OAAOD,QAAUF,EACdF,EAAQC,EAAQC,GAChB,SAASA,GACV,GAAIA,IAAMA,EAAEI,GACX,KAAM,wBAEP,OAAON,GAAQC,EAAQC,IAEG,kBAAXK,SAAyBA,OAAOC,IACjDD,OAAO,WACN,MAAOP,GAAQC,KAGhBD,EAAQC,GAAQ,IAKlB,SAASA,EAAQC,GACjB,YAsIA,SAASO,GAAiBC,EAAYC,GACrC,MAAO,YACN,GAAIC,GACHC,EAAMC,KACNC,EAAWF,EAAIG,IAKhB,OAHAH,GAAIG,KAAON,EACXE,EAAMD,EAAOM,MAAMJ,EAAKK,WACxBL,EAAIG,KAAOD,EACJH,GAIT,QAASO,GAAUT,EAAYC,GAc9B,MAXIS,IAAYT,KACfA,EAASF,EACNC,EAEEA,EAAWW,GACVX,EACAD,EAAiBa,EAAMZ,GAHxBY,EAIHX,GAEFA,EAAOU,IAAMX,GAAcA,EAAWW,IAAM,GAAK,GAE3CV,EAGR,QAASY,GAAqBV,EAAKW,GAClC,GAAIC,GACHC,EAAQF,EAAOE,KAChB,KAAKD,IAAQC,IACRC,GAAaC,KAAKH,IAAWZ,EAAIY,IAASZ,EAAIY,GAAMI,MACvDhB,EAAIY,GAAiB,YAATA,EAAqBN,EAAUN,EAAIiB,YAAYC,UAAUN,GAAOC,EAAMD,IAASC,EAAMD,IAOpG,QAASO,GAAOC,GACf,MAAOA,GAGR,QAASX,KACR,MAAO,GAGR,QAASY,GAASD,GAEjB,IAEC,KADAE,SAAQC,IAAI,4BAA8BH,GACpC,iBAEP,MAAOI,IACP,MAAOvB,MAAKE,KAAOF,KAAKwB,UAAUpB,WAAae,EAGhD,QAASM,GAAaC,GAGrB1B,KAAK2B,MAAQvC,EAAEwC,KAAO,UAAY,YAAc,SAChD5B,KAAK0B,QAA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,EAAYiI,MAAQjI,EAAY8H,QAAU9H,EAAYkI,SAChH5e,EAAMye,MAAQze,EAAMqe,OAASre,EAAMse,KAAOte,EAAM2e,MAAQ3e,EAAMwe,QAAUxe,EAAM4e,UAC9E7R,EAAKmW,aAGXzb,MAAM,GAEPzH,OACC8N,QAAS,MACT1C,QAASA,EAAQ2S,GACjBhT,KAAMnL,EACN6H,MAAM,GAEP6b,SACC7b,MAAM,GAEP8b,KAEC5Y,OAAQrK,EACRmH,MAAM,GAEP+b,MAEC7Y,OAAQrK,EACRmH,MAAM,GAEPgc,IAAKze,GAASye,IAAMhX,GAAYgX,IAAMjjB,IAGvCiM,IACCC,KAAMoT,EACNzW,KAAMyW,EACN4D,OAAQxD,EACRyD,SAAUvD,GACVwD,IAAK,SAAS7D,GAEb,MAAetd,SAARsd,EAAoB8D,UAAU,GAAK9D,GAAiB,OAATA,EAAgBA,EAAO,MAY5E,MAPAhe,IAAeG,GAAK0f,SACpBrgB,IAAY/C,GAAG8iB,IAAKtU,QACpB3K,GAAeL,WAAW,KAAM,KAAM,KAElCwf,IACHF,GAAI5e,MAAMgf,IAAIiB,IAAInkB,GAEZA,GAAK8iB,IACTwC","file":"jsrender.min.js","sourcesContent":["/*! JsRender v1.0.5: http://jsviews.com/#jsrender */\n/*! **VERSION FOR WEB** (For NODE.JS see http://jsviews.com/download/jsrender-node.js) */\n/*\n * Best-of-breed templating in browser or on Node.js.\n * Does not require jQuery, or HTML DOM\n * Integrates with JsViews (http://jsviews.com/#jsviews)\n *\n * Copyright 2019, Boris Moore\n * Released under the MIT License.\n */\n\n//jshint -W018, -W041, -W120\n\n(function(factory, global) {\n\t// global var is the this object, which is window when running in the usual browser environment\n\tvar $ = global.jQuery;\n\n\tif (typeof exports === \"object\") { // CommonJS e.g. Browserify\n\t\tmodule.exports = $\n\t\t\t? factory(global, $)\n\t\t\t: function($) { // If no global jQuery, take optional jQuery passed as parameter: require('jsrender')(jQuery)\n\t\t\t\tif ($ && !$.fn) {\n\t\t\t\t\tthrow \"Provide jQuery or null\";\n\t\t\t\t}\n\t\t\t\treturn factory(global, $);\n\t\t\t};\n\t} else if (typeof define === \"function\" && define.amd) { // AMD script loader, e.g. RequireJS\n\t\tdefine(function() {\n\t\t\treturn factory(global);\n\t\t});\n\t} else { // Browser using plain <script> tag\n\t\tfactory(global, false);\n\t}\n} (\n\n// factory (for jsrender.js)\nfunction(global, $) {\n\"use strict\";\n\n//========================== Top-level vars ==========================\n\n// global var is the this object, which is window when running in the usual browser environment\nvar setGlobals = $ === false; // Only set globals if script block in browser (not AMD and not CommonJS)\n\n$ = $ && $.fn ? $ : global.jQuery; // $ is jQuery passed in by CommonJS loader (Browserify), or global jQuery.\n\nvar versionNumber = \"v1.0.5\",\n\tjsvStoreName, rTag, rTmplString, topView, $views, $expando,\n\t_ocp = \"_ocp\", // Observable contextual parameter\n\n//TODO\ttmplFnsCache = {},\n\t$isFunction, $isArray, $templates, $converters, $helpers, $tags, $sub, $subSettings, $subSettingsAdvanced, $viewsSettings,\n\tdelimOpenChar0, delimOpenChar1, delimCloseChar0, delimCloseChar1, linkChar, setting, baseOnError,\n\n\tisRenderCall,\n\trNewLine = /[ \\t]*(\\r\\n|\\n|\\r)/g,\n\trUnescapeQuotes = /\\\\(['\"])/g,\n\trEscapeQuotes = /['\"\\\\]/g, // Escape quotes and \\ character\n\trBuildHash = /(?:\\x08|^)(onerror:)?(?:(~?)(([\\w$.]+):)?([^\\x08]+))\\x08(,)?([^\\x08]+)/gi,\n\trTestElseIf = /^if\\s/,\n\trFirstElem = /<(\\w+)[>\\s]/,\n\trAttrEncode = /[\\x00`><\"'&=]/g, // Includes > encoding since rConvertMarkers in JsViews does not skip > characters in attribute strings\n\trIsHtml = /[\\x00`><\\\"'&=]/,\n\trHasHandlers = /^on[A-Z]|^convert(Back)?$/,\n\trWrappedInViewMarker = /^\\#\\d+_`[\\s\\S]*\\/\\d+_`$/,\n\trHtmlEncode = rAttrEncode,\n\trDataEncode = /[&<>]/g,\n\trDataUnencode = /&(amp|gt|lt);/g,\n\trBracketQuote = /\\[['\"]?|['\"]?\\]/g,\n\tviewId = 0,\n\tcharEntities = {\n\t\t\"&\": \"&amp;\",\n\t\t\"<\": \"&lt;\",\n\t\t\">\": \"&gt;\",\n\t\t\"\\x00\": \"&#0;\",\n\t\t\"'\": \"&#39;\",\n\t\t'\"': \"&#34;\",\n\t\t\"`\": \"&#96;\",\n\t\t\"=\": \"&#61;\"\n\t},\n\tcharsFromEntities = {\n\t\tamp: \"&\",\n\t\tgt: \">\",\n\t\tlt: \"<\"\n\t},\n\tHTML = \"html\",\n\tOBJECT = \"object\",\n\ttmplAttr = \"data-jsv-tmpl\",\n\tjsvTmpl = \"jsvTmpl\",\n\tindexStr = \"For #index in nested block use #getIndex().\",\n\t$render = {},\n\n\tjsr = global.jsrender,\n\tjsrToJq = jsr && $ && !$.render, // JsRender already loaded, without jQuery. but we will re-load it now to attach to jQuery\n\n\tjsvStores = {\n\t\ttemplate: {\n\t\t\tcompile: compileTmpl\n\t\t},\n\t\ttag: {\n\t\t\tcompile: compileTag\n\t\t},\n\t\tviewModel: {\n\t\t\tcompile: compileViewModel\n\t\t},\n\t\thelper: {},\n\t\tconverter: {}\n\t};\n\n\t// views object ($.views if jQuery is loaded, jsrender.views if no jQuery, e.g. in Node.js)\n\t$views = {\n\t\tjsviews: versionNumber,\n\t\tsub: {\n\t\t\t// subscription, e.g. JsViews integration\n\t\t\trPath: /^(!*?)(?:null|true|false|\\d[\\d.]*|([\\w$]+|\\.|~([\\w$]+)|#(view|([\\w$]+))?)([\\w$.^]*?)(?:[.[^]([\\w$]+)\\]?)?)$/g,\n\t\t\t// not object helper view viewProperty pathTokens leafToken\n\n\t\t\trPrm: /(\\()(?=\\s*\\()|(?:([([])\\s*)?(?:(\\^?)(~?[\\w$.^]+)?\\s*((\\+\\+|--)|\\+|-|~(?![\\w$])|&&|\\|\\||===|!==|==|!=|<=|>=|[<>%*:?\\/]|(=))\\s*|(!*?(@)?[#~]?[\\w$.^]+)([([])?)|(,\\s*)|(\\(?)\\\\?(?:(')|(\"))|(?:\\s*(([)\\]])(?=[.^]|\\s*$|[^([])|[)\\]])([([]?))|(\\s+)/g,\n\t\t\t// lftPrn0 lftPrn bound path operator err eq path2 late prn comma lftPrn2 apos quot rtPrn rtPrnDot prn2 space\n\n\t\t\tView: View,\n\t\t\tErr: JsViewsError,\n\t\t\ttmplFn: tmplFn,\n\t\t\tparse: parseParams,\n\t\t\textend: $extend,\n\t\t\textendCtx: extendCtx,\n\t\t\tsyntaxErr: syntaxError,\n\t\t\tonStore: {\n\t\t\t\ttemplate: function(name, item) {\n\t\t\t\t\tif (item === null) {\n\t\t\t\t\t\tdelete $render[name];\n\t\t\t\t\t} else if (name) {\n\t\t\t\t\t\t$render[name] = item;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\taddSetting: addSetting,\n\t\t\tsettings: {\n\t\t\t\tallowCode: false\n\t\t\t},\n\t\t\tadvSet: noop, // Update advanced settings\n\t\t\t_thp: tagHandlersFromProps,\n\t\t\t_gm: getMethod,\n\t\t\t_tg: function() {}, // Constructor for tagDef\n\t\t\t_cnvt: convertVal,\n\t\t\t_tag: renderTag,\n\t\t\t_er: error,\n\t\t\t_err: onRenderError,\n\t\t\t_cp: retVal, // Get observable contextual parameters (or properties) ~foo=expr. In JsRender, simply returns val.\n\t\t\t_sq: function(token) {\n\t\t\t\tif (token === \"constructor\") {\n\t\t\t\t\tsyntaxError(\"\");\n\t\t\t\t}\n\t\t\t\treturn token;\n\t\t\t}\n\t\t},\n\t\tsettings: {\n\t\t\tdelimiters: $viewsDelimiters,\n\t\t\tadvanced: function(value) {\n\t\t\t\treturn value\n\t\t\t\t\t? (\n\t\t\t\t\t\t\t$extend($subSettingsAdvanced, value),\n\t\t\t\t\t\t\t$sub.advSet(),\n\t\t\t\t\t\t\t$viewsSettings\n\t\t\t\t\t\t)\n\t\t\t\t\t\t: $subSettingsAdvanced;\n\t\t\t\t}\n\t\t},\n\t\tmap: dataMap // If jsObservable loaded first, use that definition of dataMap\n\t};\n\nfunction getDerivedMethod(baseMethod, method) {\n\treturn function() {\n\t\tvar ret,\n\t\t\ttag = this,\n\t\t\tprevBase = tag.base;\n\n\t\ttag.base = baseMethod; // Within method call, calling this.base will call the base method\n\t\tret = method.apply(tag, arguments); // Call the method\n\t\ttag.base = prevBase; // Replace this.base to be the base method of the previous call, for chained calls\n\t\treturn ret;\n\t};\n}\n\nfunction getMethod(baseMethod, method) {\n\t// For derived methods (or handlers declared declaratively as in {{:foo onChange=~fooChanged}} replace by a derived method, to allow using this.base(...)\n\t// or this.baseApply(arguments) to call the base implementation. (Equivalent to this._super(...) and this._superApply(arguments) in jQuery UI)\n\tif ($isFunction(method)) {\n\t\tmethod = getDerivedMethod(\n\t\t\t\t!baseMethod\n\t\t\t\t\t? noop // no base method implementation, so use noop as base method\n\t\t\t\t\t: baseMethod._d\n\t\t\t\t\t\t? baseMethod // baseMethod is a derived method, so use it\n\t\t\t\t\t\t: getDerivedMethod(noop, baseMethod), // baseMethod is not derived so make its base method be the noop method\n\t\t\t\tmethod\n\t\t\t);\n\t\tmethod._d = (baseMethod && baseMethod._d || 0) + 1; // Add flag for derived method (incremented for derived of derived...)\n\t}\n\treturn method;\n}\n\nfunction tagHandlersFromProps(tag, tagCtx) {\n\tvar prop,\n\t\tprops = tagCtx.props;\n\tfor (prop in props) {\n\t\tif (rHasHandlers.test(prop) && !(tag[prop] && tag[prop].fix)) { // Don't override handlers with fix expando (used in datepicker and spinner)\n\t\t\ttag[prop] = prop !== \"convert\" ? getMethod(tag.constructor.prototype[prop], props[prop]) : props[prop];\n\t\t\t// Copy over the onFoo props, convert and convertBack from tagCtx.props to tag (overrides values in tagDef).\n\t\t\t// Note: unsupported scenario: if handlers are dynamically added ^onFoo=expression this will work, but dynamically removing will not work.\n\t\t}\n\t}\n}\n\nfunction retVal(val) {\n\treturn val;\n}\n\nfunction noop() {\n\treturn \"\";\n}\n\nfunction dbgBreak(val) {\n\t// Usage examples: {{dbg:...}}, {{:~dbg(...)}}, {{dbg .../}}, {^{for ... onAfterLink=~dbg}} etc.\n\ttry {\n\t\tconsole.log(\"JsRender dbg breakpoint: \" + val);\n\t\tthrow \"dbg breakpoint\"; // To break here, stop on caught exceptions.\n\t}\n\tcatch (e) {}\n\treturn this.base ? this.baseApply(arguments) : val;\n}\n\nfunction JsViewsError(message) {\n\t// Error exception type for JsViews/JsRender\n\t// Override of $.views.sub.Error is possible\n\tthis.name = ($.link ? \"JsViews\" : \"JsRender\") + \" Error\";\n\tthis.message = message || this.name;\n}\n\nfunction $extend(target, source) {\n\tif (target) {\n\t\tfor (var name in source) {\n\t\t\ttarget[name] = source[name];\n\t\t}\n\t\treturn target;\n\t}\n}\n\n(JsViewsError.prototype = new Error()).constructor = JsViewsError;\n\n//========================== Top-level functions ==========================\n\n//===================\n// views.delimiters\n//===================\n\n\t/**\n\t* Set the tag opening and closing delimiters and 'link' character. Default is \"{{\", \"}}\" and \"^\"\n\t* openChars, closeChars: opening and closing strings, each with two characters\n\t* $.views.settings.delimiters(...)\n\t*\n\t* @param {string} openChars\n\t* @param {string} [closeChars]\n\t* @param {string} [link]\n\t* @returns {Settings}\n\t*\n\t* Get delimiters\n\t* delimsArray = $.views.settings.delimiters()\n\t*\n\t* @returns {string[]}\n\t*/\nfunction $viewsDelimiters(openChars, closeChars, link) {\n\tif (!openChars) {\n\t\treturn $subSettings.delimiters;\n\t}\n\tif ($isArray(openChars)) {\n\t\treturn $viewsDelimiters.apply($views, openChars);\n\t}\n\tlinkChar = link ? link[0] : linkChar;\n\tif (!/^(\\W|_){5}$/.test(openChars + closeChars + linkChar)) {\n\t\terror(\"Invalid delimiters\"); // Must be non-word characters, and openChars and closeChars must each be length 2\n\t}\n\tdelimOpenChar0 = openChars[0];\n\tdelimOpenChar1 = openChars[1];\n\tdelimCloseChar0 = closeChars[0];\n\tdelimCloseChar1 = closeChars[1];\n\n\t$subSettings.delimiters = [delimOpenChar0 + delimOpenChar1, delimCloseChar0 + delimCloseChar1, linkChar];\n\n\t// Escape the characters - since they could be regex special characters\n\topenChars = \"\\\\\" + delimOpenChar0 + \"(\\\\\" + linkChar + \")?\\\\\" + delimOpenChar1; // Default is \"{^{\"\n\tcloseChars = \"\\\\\" + delimCloseChar0 + \"\\\\\" + delimCloseChar1; // Default is \"}}\"\n\t// Build regex with new delimiters\n\t// [tag (followed by / space or }) or cvtr+colon or html or code] followed by space+params then convertBack?\n\trTag = \"(?:(\\\\w+(?=[\\\\/\\\\s\\\\\" + delimCloseChar0 + \"]))|(\\\\w+)?(:)|(>)|(\\\\*))\\\\s*((?:[^\\\\\"\n\t\t+ delimCloseChar0 + \"]|\\\\\" + delimCloseChar0 + \"(?!\\\\\" + delimCloseChar1 + \"))*?)\";\n\n\t// Make rTag available to JsViews (or other components) for parsing binding expressions\n\t$sub.rTag = \"(?:\" + rTag + \")\";\n\t// { ^? { tag+params slash? or closingTag or comment\n\trTag = new RegExp(\"(?:\" + openChars + rTag + \"(\\\\/)?|\\\\\" + delimOpenChar0 + \"(\\\\\" + linkChar + \")?\\\\\" + delimOpenChar1 + \"(?:(?:\\\\/(\\\\w+))\\\\s*|!--[\\\\s\\\\S]*?--))\" + closeChars, \"g\");\n\n\t// Default: bind tagName cvt cln html code params slash bind2 closeBlk comment\n\t// /(?:{(\\^)?{(?:(\\w+(?=[\\/\\s}]))|(\\w+)?(:)|(>)|(\\*))\\s*((?:[^}]|}(?!}))*?)(\\/)?|{(\\^)?{(?:(?:\\/(\\w+))\\s*|!--[\\s\\S]*?--))}}\n\n\t$sub.rTmpl = new RegExp(\"^\\\\s|\\\\s$|<.*>|([^\\\\\\\\]|^)[{}]|\" + openChars + \".*\" + closeChars);\n\t// $sub.rTmpl looks for initial or final white space, html tags or { or } char not preceded by \\\\, or JsRender tags {{xxx}}.\n\t// Each of these strings are considered NOT to be jQuery selectors\n\treturn $viewsSettings;\n}\n\n//=========\n// View.get\n//=========\n\nfunction getView(inner, type) { //view.get(inner, type)\n\tif (!type && inner !== true) {\n\t\t// view.get(type)\n\t\ttype = inner;\n\t\tinner = undefined;\n\t}\n\n\tvar views, i, l, found,\n\t\tview = this,\n\t\troot = type === \"root\";\n\t\t// view.get(\"root\") returns view.root, view.get() returns view.parent, view.get(true) returns view.views[0].\n\n\tif (inner) {\n\t\t// Go through views - this one, and all nested ones, depth-first - and return first one with given type.\n\t\t// If type is undefined, i.e. view.get(true), return first child view.\n\t\tfound = type && view.type === type && view;\n\t\tif (!found) {\n\t\t\tviews = view.views;\n\t\t\tif (view._.useKey) {\n\t\t\t\tfor (i in views) {\n\t\t\t\t\tif (found = type ? views[i].get(inner, type) : views[i]) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (i = 0, l = views.length; !found && i < l; i++) {\n\t\t\t\t\tfound = type ? views[i].get(inner, type) : views[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else if (root) {\n\t\t// Find root view. (view whose parent is top view)\n\t\tfound = view.root;\n\t} else if (type) {\n\t\twhile (view && !found) {\n\t\t\t// Go through views - this one, and all parent ones - and return first one with given type.\n\t\t\tfound = view.type === type ? view : undefined;\n\t\t\tview = view.parent;\n\t\t}\n\t} else {\n\t\tfound = view.parent;\n\t}\n\treturn found || undefined;\n}\n\nfunction getNestedIndex() {\n\tvar view = this.get(\"item\");\n\treturn view ? view.index : undefined;\n}\n\ngetNestedIndex.depends = function() {\n\treturn [this.get(\"item\"), \"index\"];\n};\n\nfunction getIndex() {\n\treturn this.index;\n}\n\ngetIndex.depends = \"index\";\n\n//==================\n// View.ctxPrm, etc.\n//==================\n\n/* Internal private: view._getOb() */\nfunction getPathObject(ob, path, ltOb, fn) {\n\t// Iterate through path to late paths: @a.b.c paths\n\t// Return \"\" (or noop if leaf is a function @a.b.c(...) ) if intermediate object not yet available\n\tvar prevOb, tokens, l,\n\t\ti = 0;\n\tif (ltOb === 1) {\n\t\tfn = 1;\n\t\tltOb = undefined;\n\t}\n\t// Paths like ^a^b^c or ~^a^b^c will not throw if an object in path is undefined.\n\tif (path) {\n\t\ttokens = path.split(\".\");\n\t\tl = tokens.length;\n\n\t\tfor (; ob && i < l; i++) {\n\t\t\tprevOb = ob;\n\t\t\tob = tokens[i] ? ob[tokens[i]] : ob;\n\t\t}\n\t}\n\tif (ltOb) {\n\t\tltOb.lt = ltOb.lt || i<l; // If i < l there was an object in the path not yet available\n\t}\n\treturn ob === undefined\n\t\t? fn ? noop : \"\"\n\t\t: fn ? function() {\n\t\t\treturn ob.apply(prevOb, arguments);\n\t\t} : ob;\n}\n\nfunction contextParameter(key, value, get) {\n\t// Helper method called as view.ctxPrm(key) for helpers or template parameters ~foo - from compiled template or from context callback\n\tvar wrapped, deps, res, obsCtxPrm, tagElse, callView, newRes,\n\t\tstoreView = this,\n\t\tisUpdate = !isRenderCall && arguments.length > 1,\n\t\tstore = storeView.ctx;\n\tif (key) {\n\t\tif (!storeView._) { // tagCtx.ctxPrm() call\n\t\t\ttagElse = storeView.index;\n\t\t\tstoreView = storeView.tag;\n\t\t}\n\t\tcallView = storeView;\n\t\tif (store && store.hasOwnProperty(key) || (store = $helpers).hasOwnProperty(key)) {\n\t\t\tres = store[key];\n\t\t\tif (key === \"tag\" || key === \"tagCtx\" || key === \"root\" || key === \"parentTags\") {\n\t\t\t\treturn res;\n\t\t\t}\n\t\t} else {\n\t\t\tstore = undefined;\n\t\t}\n\t\tif (!isRenderCall && storeView.tagCtx || storeView.linked) { // Data-linked view, or tag instance\n\t\t\tif (!res || !res._cxp) {\n\t\t\t\t// Not a contextual parameter\n\t\t\t\t// Set storeView to tag (if this is a tag.ctxPrm() call) or to root view (\"data\" view of linked template)\n\t\t\t\tstoreView = storeView.tagCtx || $isFunction(res)\n\t\t\t\t\t? storeView // Is a tag, not a view, or is a computed contextual parameter, so scope to the callView, no the 'scope view'\n\t\t\t\t\t: (storeView = storeView.scope || storeView,\n\t\t\t\t\t\t!storeView.isTop && storeView.ctx.tag // If this view is in a tag, set storeView to the tag\n\t\t\t\t\t\t\t|| storeView);\n\t\t\t\tif (res !== undefined && storeView.tagCtx) {\n\t\t\t\t\t// If storeView is a tag, but the contextual parameter has been set at at higher level (e.g. helpers)...\n\t\t\t\t\tstoreView = storeView.tagCtx.view.scope; // then move storeView to the outer level (scope of tag container view)\n\t\t\t\t}\n\t\t\t\tstore = storeView._ocps;\n\t\t\t\tres = store && store.hasOwnProperty(key) && store[key] || res;\n\t\t\t\tif (!(res && res._cxp) && (get || isUpdate)) {\n\t\t\t\t\t// Create observable contextual parameter\n\t\t\t\t\t(store || (storeView._ocps = storeView._ocps || {}))[key]\n\t\t\t\t\t\t= res\n\t\t\t\t\t\t= [{\n\t\t\t\t\t\t\t_ocp: res, // The observable contextual parameter value\n\t\t\t\t\t\t\t_vw: callView,\n\t\t\t\t\t\t\t_key: key\n\t\t\t\t\t\t}];\n\t\t\t\t\tres._cxp = {\n\t\t\t\t\t\tpath: _ocp,\n\t\t\t\t\t\tind: 0,\n\t\t\t\t\t\tupdateValue: function(val, path) {\n\t\t\t\t\t\t\t$.observable(res[0]).setProperty(_ocp, val); // Set the value (res[0]._ocp)\n\t\t\t\t\t\t\treturn this;\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (obsCtxPrm = res && res._cxp) {\n\t\t\t\t// If this helper resource is an observable contextual parameter\n\t\t\t\tif (arguments.length > 2) {\n\t\t\t\t\tdeps = res[1] ? $sub._ceo(res[1].deps) : [_ocp]; // fn deps (with any exprObs cloned using $sub._ceo)\n\t\t\t\t\tdeps.unshift(res[0]); // view\n\t\t\t\t\tdeps._cxp = obsCtxPrm;\n\t\t\t\t\t// In a context callback for a contextual param, we set get = true, to get ctxPrm [view, dependencies...] array - needed for observe call\n\t\t\t\t\treturn deps;\n\t\t\t\t}\n\t\t\t\ttagElse = obsCtxPrm.tagElse;\n\t\t\t\tnewRes = res[1] // linkFn for compiled expression\n\t\t\t\t\t? obsCtxPrm.tag && obsCtxPrm.tag.cvtArgs\n\t\t\t\t\t\t? obsCtxPrm.tag.cvtArgs(tagElse, 1)[obsCtxPrm.ind] // = tag.bndArgs() - for tag contextual parameter\n\t\t\t\t\t\t: res[1](res[0].data, res[0], $sub) // = fn(data, view, $sub) for compiled binding expression\n\t\t\t\t\t: res[0]._ocp; // Observable contextual parameter (uninitialized, or initialized as static expression, so no path dependencies)\n\t\t\t\tif (isUpdate) {\n\t\t\t\t\tif (res && newRes !== value) {\n\t\t\t\t\t\t$sub._ucp(key, value, storeView, obsCtxPrm); // Update observable contextual parameter\n\t\t\t\t\t}\n\t\t\t\t\treturn storeView;\n\t\t\t\t}\n\t\t\t\tres = newRes;\n\t\t\t}\n\t\t}\n\t\tif (res && $isFunction(res)) {\n\t\t\t// If a helper is of type function we will wrap it, so if called with no this pointer it will be called with the\n\t\t\t// view as 'this' context. If the helper ~foo() was in a data-link expression, the view will have a 'temporary' linkCtx property too.\n\t\t\t// Note that helper functions on deeper paths will have specific this pointers, from the preceding path.\n\t\t\t// For example, ~util.foo() will have the ~util object as 'this' pointer\n\t\t\twrapped = function() {\n\t\t\t\treturn res.apply((!this || this === global) ? callView : this, arguments);\n\t\t\t};\n\t\t\t$extend(wrapped, res); // Attach same expandos (if any) to the wrapped function\n\t\t}\n\t\treturn wrapped || res;\n\t}\n}\n\n/* Internal private: view._getTmpl() */\nfunction getTemplate(tmpl) {\n\treturn tmpl && (tmpl.fn\n\t\t? tmpl\n\t\t: this.getRsc(\"templates\", tmpl) || $templates(tmpl)); // not yet compiled\n}\n\n//==============\n// views._cnvt\n//==============\n\nfunction convertVal(converter, view, tagCtx, onError) {\n\t// Called from compiled template code for {{:}}\n\t// self is template object or linkCtx object\n\tvar tag, linkCtx, value, argsLen, bindTo,\n\t\t// If tagCtx is an integer, then it is the key for the compiled function to return the boundTag tagCtx\n\t\tboundTag = typeof tagCtx === \"number\" && view.tmpl.bnds[tagCtx-1];\n\n\tif (onError === undefined && boundTag && boundTag._lr) { // lateRender\n\t\tonError = \"\";\n\t}\n\tif (onError !== undefined) {\n\t\ttagCtx = onError = {props: {}, args: [onError]};\n\t} else if (boundTag) {\n\t\ttagCtx = boundTag(view.data, view, $sub);\n\t}\n\tboundTag = boundTag._bd && boundTag;\n\tif (converter || boundTag) {\n\t\tlinkCtx = view._lc; // For data-link=\"{cvt:...}\"... See onDataLinkedTagChange\n\t\ttag = linkCtx && linkCtx.tag;\n\t\ttagCtx.view = view;\n\t\tif (!tag) {\n\t\t\ttag = $extend(new $sub._tg(), {\n\t\t\t\t_: {\n\t\t\t\t\tbnd: boundTag,\n\t\t\t\t\tunlinked: true,\n\t\t\t\t\tlt: tagCtx.lt // If a late path @some.path has not returned @some object, mark tag as late\n\t\t\t\t},\n\t\t\t\tinline: !linkCtx,\n\t\t\t\ttagName: \":\",\n\t\t\t\tconvert: converter,\n\t\t\t\tonArrayChange: true,\n\t\t\t\tflow: true,\n\t\t\t\ttagCtx: tagCtx,\n\t\t\t\ttagCtxs: [tagCtx],\n\t\t\t\t_is: \"tag\"\n\t\t\t});\n\t\t\targsLen = tagCtx.args.length;\n\t\t\tif (argsLen>1) {\n\t\t\t\tbindTo = tag.bindTo = [];\n\t\t\t\twhile (argsLen--) {\n\t\t\t\t\tbindTo.unshift(argsLen); // Bind to all the arguments - generate bindTo array: [0,1,2...]\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (linkCtx) {\n\t\t\t\tlinkCtx.tag = tag;\n\t\t\t\ttag.linkCtx = linkCtx;\n\t\t\t}\n\t\t\ttagCtx.ctx = extendCtx(tagCtx.ctx, (linkCtx ? linkCtx.view : view).ctx);\n\t\t\ttagHandlersFromProps(tag, tagCtx);\n\t\t}\n\t\ttag._er = onError && value;\n\t\ttag.ctx = tagCtx.ctx || tag.ctx || {};\n\t\ttagCtx.ctx = undefined;\n\t\tvalue = tag.cvtArgs()[0]; // If there is a convertBack but no convert, converter will be \"true\"\n\t\ttag._er = onError && value;\n\t} else {\n\t\tvalue = tagCtx.args[0];\n\t}\n\n\t// Call onRender (used by JsViews if present, to add binding annotations around rendered content)\n\tvalue = boundTag && view._.onRender\n\t\t? view._.onRender(value, view, tag)\n\t\t: value;\n\treturn value != undefined ? value : \"\";\n}\n\nfunction convertArgs(tagElse, bound) { // tag.cvtArgs() or tag.cvtArgs(tagElse?, true?)\n\tvar l, key, boundArgs, args, bindFrom, tag, converter,\n\t\ttagCtx = this;\n\n\tif (tagCtx.tagName) {\n\t\ttag = tagCtx;\n\t\ttagCtx = (tag.tagCtxs || [tagCtx])[tagElse||0];\n\t\tif (!tagCtx) {\n\t\t\treturn;\n\t\t}\n\t} else {\n\t\ttag = tagCtx.tag;\n\t}\n\n\tbindFrom = tag.bindFrom;\n\targs = tagCtx.args;\n\n\tif ((converter = tag.convert) && \"\" + converter === converter) {\n\t\tconverter = converter === \"true\"\n\t\t\t? undefined\n\t\t\t: (tagCtx.view.getRsc(\"converters\", converter) || error(\"Unknown converter: '\" + converter + \"'\"));\n\t}\n\n\tif (converter && !bound) { // If there is a converter, use a copy of the tagCtx.args array for rendering, and replace the args[0] in\n\t\targs = args.slice(); // the copied array with the converted value. But we do not modify the value of tag.tagCtx.args[0] (the original args array)\n\t}\n\tif (bindFrom) { // Get the values of the boundArgs\n\t\tboundArgs = [];\n\t\tl = bindFrom.length;\n\t\twhile (l--) {\n\t\t\tkey = bindFrom[l];\n\t\t\tboundArgs.unshift(argOrProp(tagCtx, key));\n\t\t}\n\t\tif (bound) {\n\t\t\targs = boundArgs; // Call to bndArgs() - returns the boundArgs\n\t\t}\n\t}\n\tif (converter) {\n\t\tconverter = converter.apply(tag, boundArgs || args);\n\t\tif (converter === undefined) {\n\t\t\treturn args; // Returning undefined from a converter is equivalent to not having a converter.\n\t\t}\n\t\tbindFrom = bindFrom || [0];\n\t\tl = bindFrom.length;\n\t\tif (!$isArray(converter) || converter.length !== l) {\n\t\t\tconverter = [converter];\n\t\t\tbindFrom = [0];\n\t\t\tl = 1;\n\t\t}\n\t\tif (bound) { // Call to bndArgs() - so apply converter to all boundArgs\n\t\t\targs = converter; // The array of values returned from the converter\n\t\t} else { // Call to cvtArgs()\n\t\t\twhile (l--) {\n\t\t\t\tkey = bindFrom[l];\n\t\t\t\tif (+key === key) {\n\t\t\t\t\targs[key] = converter[l];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn args;\n}\n\nfunction argOrProp(context, key) {\n\tcontext = context[+key === key ? \"args\" : \"props\"];\n\treturn context && context[key];\n}\n\nfunction convertBoundArgs(tagElse) { // tag.bndArgs()\n\treturn this.cvtArgs(tagElse, 1);\n}\n\n//=============\n// views.tag\n//=============\n\n/* view.getRsc() */\nfunction getResource(resourceType, itemName) {\n\tvar res, store,\n\t\tview = this;\n\tif (\"\" + itemName === itemName) {\n\t\twhile ((res === undefined) && view) {\n\t\t\tstore = view.tmpl && view.tmpl[resourceType];\n\t\t\tres = store && store[itemName];\n\t\t\tview = view.parent;\n\t\t}\n\t\treturn res || $views[resourceType][itemName];\n\t}\n}\n\nfunction renderTag(tagName, parentView, tmpl, tagCtxs, isUpdate, onError) {\n\tfunction bindToOrBindFrom(type) {\n\t\tvar bindArray = tag[type];\n\n\t\tif (bindArray !== undefined) {\n\t\t\tbindArray = $isArray(bindArray) ? bindArray : [bindArray];\n\t\t\tm = bindArray.length;\n\t\t\twhile (m--) {\n\t\t\t\tkey = bindArray[m];\n\t\t\t\tif (!isNaN(parseInt(key))) {\n\t\t\t\t\tbindArray[m] = parseInt(key); // Convert \"0\" to 0, etc.\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn bindArray || [0];\n\t}\n\n\tparentView = parentView || topView;\n\tvar tag, tagDef, template, tags, attr, parentTag, l, m, n, itemRet, tagCtx, tagCtxCtx, ctxPrm, bindTo, bindFrom, initVal,\n\t\tcontent, callInit, mapDef, thisMap, args, bdArgs, props, tagDataMap, contentCtx, key, bindFromLength, bindToLength, linkedElement, defaultCtx,\n\t\ti = 0,\n\t\tret = \"\",\n\t\tlinkCtx = parentView._lc || false, // For data-link=\"{myTag...}\"... See onDataLinkedTagChange\n\t\tctx = parentView.ctx,\n\t\tparentTmpl = tmpl || parentView.tmpl,\n\t\t// If tagCtxs is an integer, then it is the key for the compiled function to return the boundTag tagCtxs\n\t\tboundTag = typeof tagCtxs === \"number\" && parentView.tmpl.bnds[tagCtxs-1];\n\n\tif (tagName._is === \"tag\") {\n\t\ttag = tagName;\n\t\ttagName = tag.tagName;\n\t\ttagCtxs = tag.tagCtxs;\n\t\ttemplate = tag.template;\n\t} else {\n\t\ttagDef = parentView.getRsc(\"tags\", tagName) || error(\"Unknown tag: {{\" + tagName + \"}} \");\n\t\ttemplate = tagDef.template;\n\t}\n\tif (onError === undefined && boundTag && (boundTag._lr = (tagDef.lateRender && boundTag._lr!== false || boundTag._lr))) {\n\t\tonError = \"\"; // If lateRender, set temporary onError, to skip initial rendering (and render just \"\")\n\t}\n\tif (onError !== undefined) {\n\t\tret += onError;\n\t\ttagCtxs = onError = [{props: {}, args: [], params: {props:{}}}];\n\t} else if (boundTag) {\n\t\ttagCtxs = boundTag(parentView.data, parentView, $sub);\n\t}\n\n\tl = tagCtxs.length;\n\tfor (; i < l; i++) {\n\t\ttagCtx = tagCtxs[i];\n\t\tcontent = tagCtx.tmpl;\n\t\tif (!linkCtx || !linkCtx.tag || i && !linkCtx.tag.inline || tag._er || content && +content===content) {\n\t\t\t// Initialize tagCtx\n\t\t\t// For block tags, tagCtx.tmpl is an integer > 0\n\t\t\tif (content && parentTmpl.tmpls) {\n\t\t\t\ttagCtx.tmpl = tagCtx.content = parentTmpl.tmpls[content - 1]; // Set the tmpl property to the content of the block tag\n\t\t\t}\n\t\t\ttagCtx.index = i;\n\t\t\ttagCtx.ctxPrm = contextParameter;\n\t\t\ttagCtx.render = renderContent;\n\t\t\ttagCtx.cvtArgs = convertArgs;\n\t\t\ttagCtx.bndArgs = convertBoundArgs;\n\t\t\ttagCtx.view = parentView;\n\t\t\ttagCtx.ctx = extendCtx(extendCtx(tagCtx.ctx, tagDef && tagDef.ctx), ctx); // Clone and extend parentView.ctx\n\t\t}\n\t\tif (tmpl = tagCtx.props.tmpl) {\n\t\t\t// If the tmpl property is overridden, set the value (when initializing, or, in case of binding: ^tmpl=..., when updating)\n\t\t\ttagCtx.tmpl = parentView._getTmpl(tmpl);\n\t\t\ttagCtx.content = tagCtx.content || tagCtx.tmpl;\n\t\t}\n\n\t\tif (!tag) {\n\t\t\t// This will only be hit for initial tagCtx (not for {{else}}) - if the tag instance does not exist yet\n\t\t\t// If the tag has not already been instantiated, we will create a new instance.\n\t\t\t// ~tag will access the tag, even within the rendering of the template content of this tag.\n\t\t\t// From child/descendant tags, can access using ~tag.parent, or ~parentTags.tagName\n\t\t\ttag = new tagDef._ctr();\n\t\t\tcallInit = !!tag.init;\n\n\t\t\ttag.parent = parentTag = ctx && ctx.tag;\n\t\t\ttag.tagCtxs = tagCtxs;\n\n\t\t\tif (linkCtx) {\n\t\t\t\ttag.inline = false;\n\t\t\t\tlinkCtx.tag = tag;\n\t\t\t}\n\t\t\ttag.linkCtx = linkCtx;\n\t\t\tif (tag._.bnd = boundTag || linkCtx.fn) {\n\t\t\t\t// Bound if {^{tag...}} or data-link=\"{tag...}\"\n\t\t\t\ttag._.ths = tagCtx.params.props.this; // Tag has a this=expr binding, to get javascript reference to tag instance\n\t\t\t\ttag._.lt = tagCtxs.lt; // If a late path @some.path has not returned @some object, mark tag as late\n\t\t\t\ttag._.arrVws = {};\n\t\t\t} else if (tag.dataBoundOnly) {\n\t\t\t\terror(tagName + \" must be data-bound:\\n{^{\" + tagName + \"}}\");\n\t\t\t}\n\t\t\t//TODO better perf for childTags() - keep child tag.tags array, (and remove child, when disposed)\n\t\t\t// tag.tags = [];\n\t\t} else if (linkCtx && linkCtx.fn._lr) {\n\t\t\tcallInit = !!tag.init;\n\t\t}\n\t\ttagDataMap = tag.dataMap;\n\n\t\ttagCtx.tag = tag;\n\t\tif (tagDataMap && tagCtxs) {\n\t\t\ttagCtx.map = tagCtxs[i].map; // Copy over the compiled map instance from the previous tagCtxs to the refreshed ones\n\t\t}\n\t\tif (!tag.flow) {\n\t\t\ttagCtxCtx = tagCtx.ctx = tagCtx.ctx || {};\n\n\t\t\t// tags hash: tag.ctx.tags, merged with parentView.ctx.tags,\n\t\t\ttags = tag.parents = tagCtxCtx.parentTags = ctx && extendCtx(tagCtxCtx.parentTags, ctx.parentTags) || {};\n\t\t\tif (parentTag) {\n\t\t\t\ttags[parentTag.tagName] = parentTag;\n\t\t\t\t//TODO better perf for childTags: parentTag.tags.push(tag);\n\t\t\t}\n\t\t\ttags[tag.tagName] = tagCtxCtx.tag = tag;\n\t\t\ttagCtxCtx.tagCtx = tagCtx;\n\t\t}\n\t}\n\tif (!(tag._er = onError)) {\n\t\ttagHandlersFromProps(tag, tagCtxs[0]);\n\t\ttag.rendering = {rndr: tag.rendering}; // Provide object for state during render calls to tag and elses. (Used by {{if}} and {{for}}...)\n\t\tfor (i = 0; i < l; i++) { // Iterate tagCtx for each {{else}} block\n\t\t\ttagCtx = tag.tagCtx = tagCtxs[i];\n\t\t\tprops = tagCtx.props;\n\t\t\ttag.ctx = tagCtx.ctx;\n\n\t\t\tif (!i) {\n\t\t\t\tif (callInit) {\n\t\t\t\t\ttag.init(tagCtx, linkCtx, tag.ctx);\n\t\t\t\t\tcallInit = undefined;\n\t\t\t\t}\n\t\t\t\tif (!tagCtx.args.length && tagCtx.argDefault !== false && tag.argDefault !== false) {\n\t\t\t\t\ttagCtx.args = args = [tagCtx.view.data]; // Missing first arg defaults to the current data context\n\t\t\t\t\ttagCtx.params.args = [\"#data\"];\n\t\t\t\t}\n\n\t\t\t\tbindTo = bindToOrBindFrom(\"bindTo\");\n\n\t\t\t\tif (tag.bindTo !== undefined) {\n\t\t\t\t\ttag.bindTo = bindTo;\n\t\t\t\t}\n\n\t\t\t\tif (tag.bindFrom !== undefined) {\n\t\t\t\t\ttag.bindFrom = bindToOrBindFrom(\"bindFrom\");\n\t\t\t\t} else if (tag.bindTo) {\n\t\t\t\t\ttag.bindFrom = tag.bindTo = bindTo;\n\t\t\t\t}\n\t\t\t\tbindFrom = tag.bindFrom || bindTo;\n\n\t\t\t\tbindToLength = bindTo.length;\n\t\t\t\tbindFromLength = bindFrom.length;\n\n\t\t\t\tif (tag._.bnd && (linkedElement = tag.linkedElement)) {\n\t\t\t\t\ttag.linkedElement = linkedElement = $isArray(linkedElement) ? linkedElement: [linkedElement];\n\n\t\t\t\t\tif (bindToLength !== linkedElement.length) {\n\t\t\t\t\t\terror(\"linkedElement not same length as bindTo\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (linkedElement = tag.linkedCtxParam) {\n\t\t\t\t\ttag.linkedCtxParam = linkedElement = $isArray(linkedElement) ? linkedElement: [linkedElement];\n\n\t\t\t\t\tif (bindFromLength !== linkedElement.length) {\n\t\t\t\t\t\terror(\"linkedCtxParam not same length as bindFrom/bindTo\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (bindFrom) {\n\t\t\t\t\ttag._.fromIndex = {}; // Hash of bindFrom index which has same path value as bindTo index. fromIndex = tag._.fromIndex[toIndex]\n\t\t\t\t\ttag._.toIndex = {}; // Hash of bindFrom index which has same path value as bindTo index. fromIndex = tag._.fromIndex[toIndex]\n\t\t\t\t\tn = bindFromLength;\n\t\t\t\t\twhile (n--) {\n\t\t\t\t\t\tkey = bindFrom[n];\n\t\t\t\t\t\tm = bindToLength;\n\t\t\t\t\t\twhile (m--) {\n\t\t\t\t\t\t\tif (key === bindTo[m]) {\n\t\t\t\t\t\t\t\ttag._.fromIndex[m] = n;\n\t\t\t\t\t\t\t\ttag._.toIndex[n] = m;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (linkCtx) {\n\t\t\t\t\t// Set attr on linkCtx to ensure outputting to the correct target attribute.\n\t\t\t\t\t// Setting either linkCtx.attr or this.attr in the init() allows per-instance choice of target attrib.\n\t\t\t\t\tlinkCtx.attr = tag.attr = linkCtx.attr || tag.attr || linkCtx._dfAt;\n\t\t\t\t}\n\t\t\t\tattr = tag.attr;\n\t\t\t\ttag._.noVws = attr && attr !== HTML;\n\t\t\t}\n\t\t\targs = tag.cvtArgs(i);\n\t\t\tif (tag.linkedCtxParam) {\n\t\t\t\tbdArgs = tag.cvtArgs(i, 1);\n\t\t\t\tm = bindFromLength;\n\t\t\t\tdefaultCtx = tag.constructor.prototype.ctx;\n\t\t\t\twhile (m--) {\n\t\t\t\t\tif (ctxPrm = tag.linkedCtxParam[m]) {\n\t\t\t\t\t\tkey = bindFrom[m];\n\t\t\t\t\t\tinitVal = bdArgs[m];\n\t\t\t\t\t\t// Create tag contextual parameter\n\t\t\t\t\t\ttagCtx.ctx[ctxPrm] = $sub._cp(\n\t\t\t\t\t\t\tdefaultCtx && initVal === undefined ? defaultCtx[ctxPrm]: initVal,\n\t\t\t\t\t\t\tinitVal !== undefined && argOrProp(tagCtx.params, key),\n\t\t\t\t\t\t\ttagCtx.view,\n\t\t\t\t\t\t\ttag._.bnd && {tag: tag, cvt: tag.convert, ind: m, tagElse: i}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((mapDef = props.dataMap || tagDataMap) && (args.length || props.dataMap)) {\n\t\t\t\tthisMap = tagCtx.map;\n\t\t\t\tif (!thisMap || thisMap.src !== args[0] || isUpdate) {\n\t\t\t\t\tif (thisMap && thisMap.src) {\n\t\t\t\t\t\tthisMap.unmap(); // only called if observable map - not when only used in JsRender, e.g. by {{props}}\n\t\t\t\t\t}\n\t\t\t\t\tmapDef.map(args[0], tagCtx, thisMap, !tag._.bnd);\n\t\t\t\t\tthisMap = tagCtx.map;\n\t\t\t\t}\n\t\t\t\targs = [thisMap.tgt];\n\t\t\t}\n\n\t\t\titemRet = undefined;\n\t\t\tif (tag.render) {\n\t\t\t\titemRet = tag.render.apply(tag, args);\n\t\t\t\tif (parentView.linked && itemRet && !rWrappedInViewMarker.test(itemRet)) {\n\t\t\t\t\t// When a tag renders content from the render method, with data linking then we need to wrap with view markers, if absent,\n\t\t\t\t\t// to provide a contentView for the tag, which will correctly dispose bindings if deleted. The 'tmpl' for this view will\n\t\t\t\t\t// be a dumbed-down template which will always return the itemRet string (no matter what the data is). The itemRet string\n\t\t\t\t\t// is not compiled as template markup, so can include \"{{\" or \"}}\" without triggering syntax errors\n\t\t\t\t\ttmpl = { // 'Dumbed-down' template which always renders 'static' itemRet string\n\t\t\t\t\t\tlinks: []\n\t\t\t\t\t};\n\t\t\t\t\ttmpl.render = tmpl.fn = function() {\n\t\t\t\t\t\treturn itemRet;\n\t\t\t\t\t};\n\t\t\t\t\titemRet = renderWithViews(tmpl, parentView.data, undefined, true, parentView, undefined, undefined, tag);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!args.length) {\n\t\t\t\targs = [parentView]; // no arguments - (e.g. {{else}}) get data context from view.\n\t\t\t}\n\t\t\tif (itemRet === undefined) {\n\t\t\t\tcontentCtx = args[0]; // Default data context for wrapped block content is the first argument\n\t\t\t\tif (tag.contentCtx) { // Set tag.contentCtx to true, to inherit parent context, or to a function to provide alternate context.\n\t\t\t\t\tcontentCtx = tag.contentCtx === true ? parentView : tag.contentCtx(contentCtx);\n\t\t\t\t}\n\t\t\t\titemRet = tagCtx.render(contentCtx, true) || (isUpdate ? undefined : \"\");\n\t\t\t}\n\t\t\tret = ret\n\t\t\t\t? ret + (itemRet || \"\")\n\t\t\t\t: itemRet !== undefined\n\t\t\t\t\t? \"\" + itemRet\n\t\t\t\t\t: undefined; // If no return value from render, and no template/content tagCtx.render(...), return undefined\n\t\t}\n\t\ttag.rendering = tag.rendering.rndr; // Remove tag.rendering object (if this is outermost render call. (In case of nested calls)\n\t}\n\ttag.tagCtx = tagCtxs[0];\n\ttag.ctx = tag.tagCtx.ctx;\n\n\tif (tag._.noVws && tag.inline) {\n\t\t// inline tag with attr set to \"text\" will insert HTML-encoded content - as if it was element-based innerText\n\t\tret = attr === \"text\"\n\t\t\t? $converters.html(ret)\n\t\t\t: \"\";\n\t}\n\treturn boundTag && parentView._.onRender\n\t\t// Call onRender (used by JsViews if present, to add binding annotations around rendered content)\n\t\t? parentView._.onRender(ret, parentView, tag)\n\t\t: ret;\n}\n\n//=================\n// View constructor\n//=================\n\nfunction View(context, type, parentView, data, template, key, onRender, contentTmpl) {\n\t// Constructor for view object in view hierarchy. (Augmented by JsViews if JsViews is loaded)\n\tvar views, parentView_, tag, self_,\n\t\tself = this,\n\t\tisArray = type === \"array\";\n\t\t// If the data is an array, this is an 'array view' with a views array for each child 'item view'\n\t\t// If the data is not an array, this is an 'item view' with a views 'hash' object for any child nested views\n\n\tself.content = contentTmpl;\n\tself.views = isArray ? [] : {};\n\tself.data = data;\n\tself.tmpl = template;\n\tself_ = self._ = {\n\t\tkey: 0,\n\t\t// ._.useKey is non zero if is not an 'array view' (owning a data array). Use this as next key for adding to child views hash\n\t\tuseKey: isArray ? 0 : 1,\n\t\tid: \"\" + viewId++,\n\t\tonRender: onRender,\n\t\tbnds: {}\n\t};\n\tself.linked = !!onRender;\n\tself.type = type || \"top\";\n\n\tif (!parentView || parentView.type === \"top\") {\n\t\t(self.ctx = context || {}).root = self.data;\n\t}\n\n\tif (self.parent = parentView) {\n\t\tself.root = parentView.root || self; // view whose parent is top view\n\t\tviews = parentView.views;\n\t\tparentView_ = parentView._;\n\t\tself.isTop = parentView_.scp; // Is top content view of a link(\"#container\", ...) call\n\t\tself.scope = (!context.tag || context.tag === parentView.ctx.tag) && !self.isTop && parentView.scope || self;\n\t\t// Scope for contextParams - closest non flow tag ancestor or root view\n\t\tif (parentView_.useKey) {\n\t\t\t// Parent is not an 'array view'. Add this view to its views object\n\t\t\t// self._key = is the key in the parent view hash\n\t\t\tviews[self_.key = \"_\" + parentView_.useKey++] = self;\n\t\t\tself.index = indexStr;\n\t\t\tself.getIndex = getNestedIndex;\n\t\t} else if (views.length === (self_.key = self.index = key)) { // Parent is an 'array view'. Add this view to its views array\n\t\t\tviews.push(self); // Adding to end of views array. (Using push when possible - better perf than splice)\n\t\t} else {\n\t\t\tviews.splice(key, 0, self); // Inserting in views array\n\t\t}\n\t\t// If no context was passed in, use parent context\n\t\t// If context was passed in, it should have been merged already with parent context\n\t\tself.ctx = context || parentView.ctx;\n\t} else if (type) {\n\t\tself.root = self; // view whose parent is top view\n\t}\n}\n\nView.prototype = {\n\tget: getView,\n\tgetIndex: getIndex,\n\tctxPrm: contextParameter,\n\tgetRsc: getResource,\n\t_getTmpl: getTemplate,\n\t_getOb: getPathObject,\n\t_is: \"view\"\n};\n\n//====================================================\n// Registration\n//====================================================\n\nfunction compileChildResources(parentTmpl) {\n\tvar storeName, storeNames, resources;\n\tfor (storeName in jsvStores) {\n\t\tstoreNames = storeName + \"s\";\n\t\tif (parentTmpl[storeNames]) {\n\t\t\tresources = parentTmpl[storeNames]; // Resources not yet compiled\n\t\t\tparentTmpl[storeNames] = {}; // Remove uncompiled resources\n\t\t\t$views[storeNames](resources, parentTmpl); // Add back in the compiled resources\n\t\t}\n\t}\n}\n\n//===============\n// compileTag\n//===============\n\nfunction compileTag(name, tagDef, parentTmpl) {\n\tvar tmpl, baseTag, prop,\n\t\tcompiledDef = new $sub._tg();\n\n\tfunction Tag() {\n\t\tvar tag = this;\n\t\ttag._ = {\n\t\t\tunlinked: true\n\t\t};\n\t\ttag.inline = true;\n\t\ttag.tagName = name;\n\t}\n\n\tif ($isFunction(tagDef)) {\n\t\t// Simple tag declared as function. No presenter instantation.\n\t\ttagDef = {\n\t\t\tdepends: tagDef.depends,\n\t\t\trender: tagDef\n\t\t};\n\t} else if (\"\" + tagDef === tagDef) {\n\t\ttagDef = {template: tagDef};\n\t}\n\n\tif (baseTag = tagDef.baseTag) {\n\t\ttagDef.flow = !!tagDef.flow; // Set flow property, so defaults to false even if baseTag has flow=true\n\t\tbaseTag = \"\" + baseTag === baseTag\n\t\t\t? (parentTmpl && parentTmpl.tags[baseTag] || $tags[baseTag])\n\t\t\t: baseTag;\n\t\tif (!baseTag) {\n\t\t\terror('baseTag: \"' + tagDef.baseTag + '\" not found');\n\t\t}\n\t\tcompiledDef = $extend(compiledDef, baseTag);\n\n\t\tfor (prop in tagDef) {\n\t\t\tcompiledDef[prop] = getMethod(baseTag[prop], tagDef[prop]);\n\t\t}\n\t} else {\n\t\tcompiledDef = $extend(compiledDef, tagDef);\n\t}\n\n\t// Tag declared as object, used as the prototype for tag instantiation (control/presenter)\n\tif ((tmpl = compiledDef.template) !== undefined) {\n\t\tcompiledDef.template = \"\" + tmpl === tmpl ? ($templates[tmpl] || $templates(tmpl)) : tmpl;\n\t}\n\t(Tag.prototype = compiledDef).constructor = compiledDef._ctr = Tag;\n\n\tif (parentTmpl) {\n\t\tcompiledDef._parentTmpl = parentTmpl;\n\t}\n\treturn compiledDef;\n}\n\nfunction baseApply(args) {\n\t// In derived method (or handler declared declaratively as in {{:foo onChange=~fooChanged}} can call base method,\n\t// using this.baseApply(arguments) (Equivalent to this._superApply(arguments) in jQuery UI)\n\treturn this.base.apply(this, args);\n}\n\n//===============\n// compileTmpl\n//===============\n\nfunction compileTmpl(name, tmpl, parentTmpl, options) {\n\t// tmpl is either a template object, a selector for a template script block, the name of a compiled template, or a template object\n\n\t//==== nested functions ====\n\tfunction lookupTemplate(value) {\n\t\t// If value is of type string - treat as selector, or name of compiled template\n\t\t// Return the template object, if already compiled, or the markup string\n\t\tvar currentName, tmpl;\n\t\tif ((\"\" + value === value) || value.nodeType > 0 && (elem = value)) {\n\t\t\tif (!elem) {\n\t\t\t\tif (/^\\.\\/[^\\\\:*?\"<>]*$/.test(value)) {\n\t\t\t\t\t// tmpl=\"./some/file.html\"\n\t\t\t\t\t// If the template is not named, use \"./some/file.html\" as name.\n\t\t\t\t\tif (tmpl = $templates[name = name || value]) {\n\t\t\t\t\t\tvalue = tmpl;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// BROWSER-SPECIFIC CODE (not on Node.js):\n\t\t\t\t\t\t// Look for server-generated script block with id \"./some/file.html\"\n\t\t\t\t\t\telem = document.getElementById(value);\n\t\t\t\t\t}\n\t\t\t\t} else if ($.fn && !$sub.rTmpl.test(value)) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\telem = $ (value, document)[0]; // if jQuery is loaded, test for selector returning elements, and get first element\n\t\t\t\t\t} catch (e) {}\n\t\t\t\t}// END BROWSER-SPECIFIC CODE\n\t\t\t} //BROWSER-SPECIFIC CODE\n\t\t\tif (elem) {\n\t\t\t\tif (elem.tagName !== \"SCRIPT\") {\n\t\t\t\t\terror(value + \": Use script block, not \" + elem.tagName);\n\t\t\t\t}\n\t\t\t\tif (options) {\n\t\t\t\t\t// We will compile a new template using the markup in the script element\n\t\t\t\t\tvalue = elem.innerHTML;\n\t\t\t\t} else {\n\t\t\t\t\t// We will cache a single copy of the compiled template, and associate it with the name\n\t\t\t\t\t// (renaming from a previous name if there was one).\n\t\t\t\t\tcurrentName = elem.getAttribute(tmplAttr);\n\t\t\t\t\tif (currentName) {\n\t\t\t\t\t\tif (currentName !== jsvTmpl) {\n\t\t\t\t\t\t\tvalue = $templates[currentName];\n\t\t\t\t\t\t\tdelete $templates[currentName];\n\t\t\t\t\t\t} else if ($.fn) {\n\t\t\t\t\t\t\tvalue = $.data(elem)[jsvTmpl]; // Get cached compiled template\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!currentName || !value) { // Not yet compiled, or cached version lost\n\t\t\t\t\t\tname = name || ($.fn ? jsvTmpl : value);\n\t\t\t\t\t\tvalue = compileTmpl(name, elem.innerHTML, parentTmpl, options);\n\t\t\t\t\t}\n\t\t\t\t\tvalue.tmplName = name = name || currentName;\n\t\t\t\t\tif (name !== jsvTmpl) {\n\t\t\t\t\t\t$templates[name] = value;\n\t\t\t\t\t}\n\t\t\t\t\telem.setAttribute(tmplAttr, name);\n\t\t\t\t\tif ($.fn) {\n\t\t\t\t\t\t$.data(elem, jsvTmpl, value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // END BROWSER-SPECIFIC CODE\n\t\t\telem = undefined;\n\t\t} else if (!value.fn) {\n\t\t\tvalue = undefined;\n\t\t\t// If value is not a string. HTML element, or compiled template, return undefined\n\t\t}\n\t\treturn value;\n\t}\n\n\tvar elem, compiledTmpl,\n\t\ttmplOrMarkup = tmpl = tmpl || \"\";\n\t$sub._html = $converters.html;\n\n\t//==== Compile the template ====\n\tif (options === 0) {\n\t\toptions = undefined;\n\t\ttmplOrMarkup = lookupTemplate(tmplOrMarkup); // Top-level compile so do a template lookup\n\t}\n\n\t// If options, then this was already compiled from a (script) element template declaration.\n\t// If not, then if tmpl is a template object, use it for options\n\toptions = options || (tmpl.markup\n\t\t? tmpl.bnds\n\t\t\t? $extend({}, tmpl)\n\t\t\t: tmpl\n\t\t: {}\n\t);\n\n\toptions.tmplName = options.tmplName || name || \"unnamed\";\n\tif (parentTmpl) {\n\t\toptions._parentTmpl = parentTmpl;\n\t}\n\t// If tmpl is not a markup string or a selector string, then it must be a template object\n\t// In that case, get it from the markup property of the object\n\tif (!tmplOrMarkup && tmpl.markup && (tmplOrMarkup = lookupTemplate(tmpl.markup)) && tmplOrMarkup.fn) {\n\t\t// If the string references a compiled template object, need to recompile to merge any modified options\n\t\ttmplOrMarkup = tmplOrMarkup.markup;\n\t}\n\tif (tmplOrMarkup !== undefined) {\n\t\tif (tmplOrMarkup.render || tmpl.render) {\n\t\t\t// tmpl is already compiled, so use it\n\t\t\tif (tmplOrMarkup.tmpls) {\n\t\t\t\tcompiledTmpl = tmplOrMarkup;\n\t\t\t}\n\t\t} else {\n\t\t\t// tmplOrMarkup is a markup string, not a compiled template\n\t\t\t// Create template object\n\t\t\ttmpl = tmplObject(tmplOrMarkup, options);\n\t\t\t// Compile to AST and then to compiled function\n\t\t\ttmplFn(tmplOrMarkup.replace(rEscapeQuotes, \"\\\\$&\"), tmpl);\n\t\t}\n\t\tif (!compiledTmpl) {\n\t\t\tcompiledTmpl = $extend(function() {\n\t\t\t\treturn compiledTmpl.render.apply(compiledTmpl, arguments);\n\t\t\t}, tmpl);\n\n\t\t\tcompileChildResources(compiledTmpl);\n\t\t}\n\t\treturn compiledTmpl;\n\t}\n}\n\n//==== /end of function compileTmpl ====\n\n//=================\n// compileViewModel\n//=================\n\nfunction getDefaultVal(defaultVal, data) {\n\treturn $isFunction(defaultVal)\n\t\t? defaultVal.call(data)\n\t\t: defaultVal;\n}\n\nfunction addParentRef(ob, ref, parent) {\n\tObject.defineProperty(ob, ref, {\n\t\tvalue: parent,\n\t\tconfigurable: true\n\t});\n}\n\nfunction compileViewModel(name, type) {\n\tvar i, constructor, parent,\n\t\tviewModels = this,\n\t\tgetters = type.getters,\n\t\textend = type.extend,\n\t\tid = type.id,\n\t\tproto = $.extend({\n\t\t\t_is: name || \"unnamed\",\n\t\t\tunmap: unmap,\n\t\t\tmerge: merge\n\t\t}, extend),\n\t\targs = \"\",\n\t\tcnstr = \"\",\n\t\tgetterCount = getters ? getters.length : 0,\n\t\t$observable = $.observable,\n\t\tgetterNames = {};\n\n\tfunction JsvVm(args) {\n\t\tconstructor.apply(this, args);\n\t}\n\n\tfunction vm() {\n\t\treturn new JsvVm(arguments);\n\t}\n\n\tfunction iterate(data, action) {\n\t\tvar getterType, defaultVal, prop, ob, parentRef,\n\t\t\tj = 0;\n\t\tfor (; j < getterCount; j++) {\n\t\t\tprop = getters[j];\n\t\t\tgetterType = undefined;\n\t\t\tif (prop + \"\" !== prop) {\n\t\t\t\tgetterType = prop;\n\t\t\t\tprop = getterType.getter;\n\t\t\t\tparentRef = getterType.parentRef;\n\t\t\t}\n\t\t\tif ((ob = data[prop]) === undefined && getterType && (defaultVal = getterType.defaultVal) !== undefined) {\n\t\t\t\tob = getDefaultVal(defaultVal, data);\n\t\t\t}\n\t\t\taction(ob, getterType && viewModels[getterType.type], prop, parentRef);\n\t\t}\n\t}\n\n\tfunction map(data) {\n\t\tdata = data + \"\" === data\n\t\t\t? JSON.parse(data) // Accept JSON string\n\t\t\t: data; // or object/array\n\t\tvar l, prop, childOb, parentRef,\n\t\t\tj = 0,\n\t\t\tob = data,\n\t\t\tarr = [];\n\n\t\tif ($isArray(data)) {\n\t\t\tdata = data || [];\n\t\t\tl = data.length;\n\t\t\tfor (; j<l; j++) {\n\t\t\t\tarr.push(this.map(data[j]));\n\t\t\t}\n\t\t\tarr._is = name;\n\t\t\tarr.unmap = unmap;\n\t\t\tarr.merge = merge;\n\t\t\treturn arr;\n\t\t}\n\n\t\tif (data) {\n\t\t\titerate(data, function(ob, viewModel) {\n\t\t\t\tif (viewModel) { // Iterate to build getters arg array (value, or mapped value)\n\t\t\t\t\tob = viewModel.map(ob);\n\t\t\t\t}\n\t\t\t\tarr.push(ob);\n\t\t\t});\n\t\t\tob = this.apply(this, arr); // Instantiate this View Model, passing getters args array to constructor\n\t\t\tj = getterCount;\n\t\t\twhile (j--) {\n\t\t\t\tchildOb = arr[j];\n\t\t\t\tparentRef = getters[j].parentRef;\n\t\t\t\tif (parentRef && childOb && childOb.unmap) {\n\t\t\t\t\tif ($isArray(childOb)) {\n\t\t\t\t\t\tl = childOb.length;\n\t\t\t\t\t\twhile (l--) {\n\t\t\t\t\t\t\taddParentRef(childOb[l], parentRef, ob);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\taddParentRef(childOb, parentRef, ob);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (prop in data) { // Copy over any other properties. that are not get/set properties\n\t\t\t\tif (prop !== $expando && !getterNames[prop]) {\n\t\t\t\t\tob[prop] = data[prop];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ob;\n\t}\n\n\tfunction merge(data, parent, parentRef) {\n\t\tdata = data + \"\" === data\n\t\t\t? JSON.parse(data) // Accept JSON string\n\t\t\t: data; // or object/array\n\n\t\tvar j, l, m, prop, mod, found, assigned, ob, newModArr, childOb,\n\t\t\tk = 0,\n\t\t\tmodel = this;\n\n\t\tif ($isArray(model)) {\n\t\t\tassigned = {};\n\t\t\tnewModArr = [];\n\t\t\tl = data.length;\n\t\t\tm = model.length;\n\t\t\tfor (; k<l; k++) {\n\t\t\t\tob = data[k];\n\t\t\t\tfound = false;\n\t\t\t\tfor (j=0; j<m && !found; j++) {\n\t\t\t\t\tif (assigned[j]) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tmod = model[j];\n\n\t\t\t\t\tif (id) {\n\t\t\t\t\t\tassigned[j] = found = id + \"\" === id\n\t\t\t\t\t\t? (ob[id] && (getterNames[id] ? mod[id]() : mod[id]) === ob[id])\n\t\t\t\t\t\t: id(mod, ob);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (found) {\n\t\t\t\t\tmod.merge(ob);\n\t\t\t\t\tnewModArr.push(mod);\n\t\t\t\t} else {\n\t\t\t\t\tnewModArr.push(childOb = vm.map(ob));\n\t\t\t\t\tif (parentRef) {\n\t\t\t\t\t\taddParentRef(childOb, parentRef, parent);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($observable) {\n\t\t\t\t$observable(model).refresh(newModArr, true);\n\t\t\t} else {\n\t\t\t\tmodel.splice.apply(model, [0, model.length].concat(newModArr));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\titerate(data, function(ob, viewModel, getter, parentRef) {\n\t\t\tif (viewModel) {\n\t\t\t\tmodel[getter]().merge(ob, model, parentRef); // Update typed property\n\t\t\t} else if (model[getter]() !== ob) {\n\t\t\t\tmodel[getter](ob); // Update non-typed property\n\t\t\t}\n\t\t});\n\t\tfor (prop in data) {\n\t\t\tif (prop !== $expando && !getterNames[prop]) {\n\t\t\t\tmodel[prop] = data[prop];\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction unmap() {\n\t\tvar ob, prop, getterType, arr, value,\n\t\t\tk = 0,\n\t\t\tmodel = this;\n\n\t\tfunction unmapArray(modelArr) {\n\t\t\tvar arr = [],\n\t\t\t\ti = 0,\n\t\t\t\tl = modelArr.length;\n\t\t\tfor (; i<l; i++) {\n\t\t\t\tarr.push(modelArr[i].unmap());\n\t\t\t}\n\t\t\treturn arr;\n\t\t}\n\n\t\tif ($isArray(model)) {\n\t\t\treturn unmapArray(model);\n\t\t}\n\t\tob = {};\n\t\tfor (; k < getterCount; k++) {\n\t\t\tprop = getters[k];\n\t\t\tgetterType = undefined;\n\t\t\tif (prop + \"\" !== prop) {\n\t\t\t\tgetterType = prop;\n\t\t\t\tprop = getterType.getter;\n\t\t\t}\n\t\t\tvalue = model[prop]();\n\t\t\tob[prop] = getterType && value && viewModels[getterType.type]\n\t\t\t\t? $isArray(value)\n\t\t\t\t\t? unmapArray(value)\n\t\t\t\t\t: value.unmap()\n\t\t\t\t: value;\n\t\t}\n\t\tfor (prop in model) {\n\t\t\tif (model.hasOwnProperty(prop) && (prop.charAt(0) !== \"_\" || !getterNames[prop.slice(1)]) && prop !== $expando && !$isFunction(model[prop])) {\n\t\t\t\tob[prop] = model[prop];\n\t\t\t}\n\t\t}\n\t\treturn ob;\n\t}\n\n\tJsvVm.prototype = proto;\n\n\tfor (i=0; i < getterCount; i++) {\n\t\t(function(getter) {\n\t\t\tgetter = getter.getter || getter;\n\t\t\tgetterNames[getter] = i+1;\n\t\t\tvar privField = \"_\" + getter;\n\n\t\t\targs += (args ? \",\" : \"\") + getter;\n\t\t\tcnstr += \"this.\" + privField + \" = \" + getter + \";\\n\";\n\t\t\tproto[getter] = proto[getter] || function(val) {\n\t\t\t\tif (!arguments.length) {\n\t\t\t\t\treturn this[privField]; // If there is no argument, use as a getter\n\t\t\t\t}\n\t\t\t\tif ($observable) {\n\t\t\t\t\t$observable(this).setProperty(getter, val);\n\t\t\t\t} else {\n\t\t\t\t\tthis[privField] = val;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tif ($observable) {\n\t\t\t\tproto[getter].set = proto[getter].set || function(val) {\n\t\t\t\t\tthis[privField] = val; // Setter called by observable property change\n\t\t\t\t};\n\t\t\t}\n\t\t})(getters[i]);\n\t}\n\n\t// Constructor for new viewModel instance.\n\tcnstr = new Function(args, cnstr);\n\n\tconstructor = function() {\n\t\tcnstr.apply(this, arguments);\n\t\t// Pass additional parentRef str and parent obj to have a parentRef pointer on instance\n\t\tif (parent = arguments[getterCount + 1]) {\n\t\t\taddParentRef(this, arguments[getterCount], parent);\n\t\t}\n\t};\n\n\tconstructor.prototype = proto;\n\tproto.constructor = constructor;\n\n\tvm.map = map;\n\tvm.getters = getters;\n\tvm.extend = extend;\n\tvm.id = id;\n\treturn vm;\n}\n\nfunction tmplObject(markup, options) {\n\t// Template object constructor\n\tvar htmlTag,\n\t\twrapMap = $subSettingsAdvanced._wm || {}, // Only used in JsViews. Otherwise empty: {}\n\t\ttmpl = {\n\t\t\ttmpls: [],\n\t\t\tlinks: {}, // Compiled functions for link expressions\n\t\t\tbnds: [],\n\t\t\t_is: \"template\",\n\t\t\trender: renderContent\n\t\t};\n\n\tif (options) {\n\t\ttmpl = $extend(tmpl, options);\n\t}\n\n\ttmpl.markup = markup;\n\tif (!tmpl.htmlTag) {\n\t\t// Set tmpl.tag to the top-level HTML tag used in the template, if any...\n\t\thtmlTag = rFirstElem.exec(markup);\n\t\ttmpl.htmlTag = htmlTag ? htmlTag[1].toLowerCase() : \"\";\n\t}\n\thtmlTag = wrapMap[tmpl.htmlTag];\n\tif (htmlTag && htmlTag !== wrapMap.div) {\n\t\t// When using JsViews, we trim templates which are inserted into HTML contexts where text nodes are not rendered (i.e. not 'Phrasing Content').\n\t\t// Currently not trimmed for <li> tag. (Not worth adding perf cost)\n\t\ttmpl.markup = $.trim(tmpl.markup);\n\t}\n\n\treturn tmpl;\n}\n\n//==============\n// registerStore\n//==============\n\n/**\n* Internal. Register a store type (used for template, tags, helpers, converters)\n*/\nfunction registerStore(storeName, storeSettings) {\n\n/**\n* Generic store() function to register item, named item, or hash of items\n* Also used as hash to store the registered items\n* Used as implementation of $.templates(), $.views.templates(), $.views.tags(), $.views.helpers() and $.views.converters()\n*\n* @param {string|hash} name name - or selector, in case of $.templates(). Or hash of items\n* @param {any} [item] (e.g. markup for named template)\n* @param {template} [parentTmpl] For item being registered as private resource of template\n* @returns {any|$.views} item, e.g. compiled template - or $.views in case of registering hash of items\n*/\n\tfunction theStore(name, item, parentTmpl) {\n\t\t// The store is also the function used to add items to the store. e.g. $.templates, or $.views.tags\n\n\t\t// For store of name 'thing', Call as:\n\t\t// $.views.things(items[, parentTmpl]),\n\t\t// or $.views.things(name[, item, parentTmpl])\n\n\t\tvar compile, itemName, thisStore, cnt,\n\t\t\tonStore = $sub.onStore[storeName];\n\n\t\tif (name && typeof name === OBJECT && !name.nodeType && !name.markup && !name.getTgt && !(storeName === \"viewModel\" && name.getters || name.extend)) {\n\t\t\t// Call to $.views.things(items[, parentTmpl]),\n\n\t\t\t// Adding items to the store\n\t\t\t// If name is a hash, then item is parentTmpl. Iterate over hash and call store for key.\n\t\t\tfor (itemName in name) {\n\t\t\t\ttheStore(itemName, name[itemName], item);\n\t\t\t}\n\t\t\treturn item || $views;\n\t\t}\n\t\t// Adding a single unnamed item to the store\n\t\tif (name && \"\" + name !== name) { // name must be a string\n\t\t\tparentTmpl = item;\n\t\t\titem = name;\n\t\t\tname = undefined;\n\t\t}\n\t\tthisStore = parentTmpl\n\t\t\t? storeName === \"viewModel\"\n\t\t\t\t? parentTmpl\n\t\t\t\t: (parentTmpl[storeNames] = parentTmpl[storeNames] || {})\n\t\t\t: theStore;\n\t\tcompile = storeSettings.compile;\n\n\t\tif (item === undefined) {\n\t\t\titem = compile ? name : thisStore[name];\n\t\t\tname = undefined;\n\t\t}\n\t\tif (item === null) {\n\t\t\t// If item is null, delete this entry\n\t\t\tif (name) {\n\t\t\t\tdelete thisStore[name];\n\t\t\t}\n\t\t} else {\n\t\t\tif (compile) {\n\t\t\t\titem = compile.call(thisStore, name, item, parentTmpl, 0) || {};\n\t\t\t\titem._is = storeName; // Only do this for compiled objects (tags, templates...)\n\t\t\t}\n\t\t\tif (name) {\n\t\t\t\tthisStore[name] = item;\n\t\t\t}\n\t\t}\n\t\tif (onStore) {\n\t\t\t// e.g. JsViews integration\n\t\t\tonStore(name, item, parentTmpl, compile);\n\t\t}\n\t\treturn item;\n\t}\n\n\tvar storeNames = storeName + \"s\";\n\t$views[storeNames] = theStore;\n}\n\n/**\n* Add settings such as:\n* $.views.settings.allowCode(true)\n* @param {boolean} value\n* @returns {Settings}\n*\n* allowCode = $.views.settings.allowCode()\n* @returns {boolean}\n*/\nfunction addSetting(st) {\n\t$viewsSettings[st] = $viewsSettings[st] || function(value) {\n\t\treturn arguments.length\n\t\t\t? ($subSettings[st] = value, $viewsSettings)\n\t\t\t: $subSettings[st];\n\t};\n}\n\n//========================\n// dataMap for render only\n//========================\n\nfunction dataMap(mapDef) {\n\tfunction Map(source, options) {\n\t\tthis.tgt = mapDef.getTgt(source, options);\n\t\toptions.map = this;\n\t}\n\n\tif ($isFunction(mapDef)) {\n\t\t// Simple map declared as function\n\t\tmapDef = {\n\t\t\tgetTgt: mapDef\n\t\t};\n\t}\n\n\tif (mapDef.baseMap) {\n\t\tmapDef = $extend($extend({}, mapDef.baseMap), mapDef);\n\t}\n\n\tmapDef.map = function(source, options) {\n\t\treturn new Map(source, options);\n\t};\n\treturn mapDef;\n}\n\n//==============\n// renderContent\n//==============\n\n/** Render the template as a string, using the specified data and helpers/context\n* $(\"#tmpl\").render(), tmpl.render(), tagCtx.render(), $.render.namedTmpl()\n*\n* @param {any} data\n* @param {hash} [context] helpers or context\n* @param {boolean} [noIteration]\n* @param {View} [parentView] internal\n* @param {string} [key] internal\n* @param {function} [onRender] internal\n* @returns {string} rendered template internal\n*/\nfunction renderContent(data, context, noIteration, parentView, key, onRender) {\n\tvar i, l, tag, tmpl, tagCtx, isTopRenderCall, prevData, prevIndex,\n\t\tview = parentView,\n\t\tresult = \"\";\n\n\tif (context === true) {\n\t\tnoIteration = context; // passing boolean as second param - noIteration\n\t\tcontext = undefined;\n\t} else if (typeof context !== OBJECT) {\n\t\tcontext = undefined; // context must be a boolean (noIteration) or a plain object\n\t}\n\n\tif (tag = this.tag) {\n\t\t// This is a call from renderTag or tagCtx.render(...)\n\t\ttagCtx = this;\n\t\tview = view || tagCtx.view;\n\t\ttmpl = view._getTmpl(tag.template || tagCtx.tmpl);\n\t\tif (!arguments.length) {\n\t\t\tdata = tag.contentCtx && $isFunction(tag.contentCtx)\n\t\t\t\t? data = tag.contentCtx(data)\n\t\t\t\t: view; // Default data context for wrapped block content is the first argument\n\t\t}\n\t} else {\n\t\t// This is a template.render(...) call\n\t\ttmpl = this;\n\t}\n\n\tif (tmpl) {\n\t\tif (!parentView && data && data._is === \"view\") {\n\t\t\tview = data; // When passing in a view to render or link (and not passing in a parent view) use the passed-in view as parentView\n\t\t}\n\n\t\tif (view && data === view) {\n\t\t\t// Inherit the data from the parent view.\n\t\t\tdata = view.data;\n\t\t}\n\n\t\tisTopRenderCall = !view;\n\t\tisRenderCall = isRenderCall || isTopRenderCall;\n\t\tif (!view) {\n\t\t\t(context = context || {}).root = data; // Provide ~root as shortcut to top-level data.\n\t\t}\n\t\tif (!isRenderCall || $subSettingsAdvanced.useViews || tmpl.useViews || view && view !== topView) {\n\t\t\tresult = renderWithViews(tmpl, data, context, noIteration, view, key, onRender, tag);\n\t\t} else {\n\t\t\tif (view) { // In a block\n\t\t\t\tprevData = view.data;\n\t\t\t\tprevIndex = view.index;\n\t\t\t\tview.index = indexStr;\n\t\t\t} else {\n\t\t\t\tview = topView;\n\t\t\t\tprevData = view.data;\n\t\t\t\tview.data = data;\n\t\t\t\tview.ctx = context;\n\t\t\t}\n\t\t\tif ($isArray(data) && !noIteration) {\n\t\t\t\t// Create a view for the array, whose child views correspond to each data item. (Note: if key and parentView are passed in\n\t\t\t\t// along with parent view, treat as insert -e.g. from view.addViews - so parentView is already the view item for array)\n\t\t\t\tfor (i = 0, l = data.length; i < l; i++) {\n\t\t\t\t\tview.index = i;\n\t\t\t\t\tview.data = data[i];\n\t\t\t\t\tresult += tmpl.fn(data[i], view, $sub);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tview.data = data;\n\t\t\t\tresult += tmpl.fn(data, view, $sub);\n\t\t\t}\n\t\t\tview.data = prevData;\n\t\t\tview.index = prevIndex;\n\t\t}\n\t\tif (isTopRenderCall) {\n\t\t\tisRenderCall = undefined;\n\t\t}\n\t}\n\treturn result;\n}\n\nfunction renderWithViews(tmpl, data, context, noIteration, view, key, onRender, tag) {\n\t// Render template against data as a tree of subviews (nested rendered template instances), or as a string (top-level template).\n\t// If the data is the parent view, treat as noIteration, re-render with the same data context.\n\t// tmpl can be a string (e.g. rendered by a tag.render() method), or a compiled template.\n\tvar i, l, newView, childView, itemResult, swapContent, contentTmpl, outerOnRender, tmplName, itemVar, newCtx, tagCtx, noLinking,\n\t\tresult = \"\";\n\n\tif (tag) {\n\t\t// This is a call from renderTag or tagCtx.render(...)\n\t\ttmplName = tag.tagName;\n\t\ttagCtx = tag.tagCtx;\n\t\tcontext = context ? extendCtx(context, tag.ctx) : tag.ctx;\n\n\t\tif (tmpl === view.content) { // {{xxx tmpl=#content}}\n\t\t\tcontentTmpl = tmpl !== view.ctx._wrp // We are rendering the #content\n\t\t\t\t? view.ctx._wrp // #content was the tagCtx.props.tmpl wrapper of the block content - so within this view, #content will now be the view.ctx._wrp block content\n\t\t\t\t: undefined; // #content was the view.ctx._wrp block content - so within this view, there is no longer any #content to wrap.\n\t\t} else if (tmpl !== tagCtx.content) {\n\t\t\tif (tmpl === tag.template) { // Rendering {{tag}} tag.template, replacing block content.\n\t\t\t\tcontentTmpl = tagCtx.tmpl; // Set #content to block content (or wrapped block content if tagCtx.props.tmpl is set)\n\t\t\t\tcontext._wrp = tagCtx.content; // Pass wrapped block content to nested views\n\t\t\t} else { // Rendering tagCtx.props.tmpl wrapper\n\t\t\t\tcontentTmpl = tagCtx.content || view.content; // Set #content to wrapped block content\n\t\t\t}\n\t\t} else {\n\t\t\tcontentTmpl = view.content; // Nested views inherit same wrapped #content property\n\t\t}\n\n\t\tif (tagCtx.props.link === false) {\n\t\t\t// link=false setting on block tag\n\t\t\t// We will override inherited value of link by the explicit setting link=false taken from props\n\t\t\t// The child views of an unlinked view are also unlinked. So setting child back to true will not have any effect.\n\t\t\tcontext = context || {};\n\t\t\tcontext.link = false;\n\t\t}\n\t}\n\n\tif (view) {\n\t\tonRender = onRender || view._.onRender;\n\t\tnoLinking = context && context.link === false;\n\n\t\tif (noLinking && view._.nl) {\n\t\t\tonRender = undefined;\n\t\t}\n\n\t\tcontext = extendCtx(context, view.ctx);\n\t\ttagCtx = !tag && view.tag\n\t\t\t? view.tag.tagCtxs[view.tagElse]\n\t\t\t: tagCtx;\n\t}\n\n\tif (itemVar = tagCtx && tagCtx.props.itemVar) {\n\t\tif (itemVar[0] !== \"~\") {\n\t\t\tsyntaxError(\"Use itemVar='~myItem'\");\n\t\t}\n\t\titemVar = itemVar.slice(1);\n\t}\n\n\tif (key === true) {\n\t\tswapContent = true;\n\t\tkey = 0;\n\t}\n\n\t// If link===false, do not call onRender, so no data-linking marker nodes\n\tif (onRender && tag && tag._.noVws) {\n\t\tonRender = undefined;\n\t}\n\touterOnRender = onRender;\n\tif (onRender === true) {\n\t\t// Used by view.refresh(). Don't create a new wrapper view.\n\t\touterOnRender = undefined;\n\t\tonRender = view._.onRender;\n\t}\n\t// Set additional context on views created here, (as modified context inherited from the parent, and to be inherited by child views)\n\tcontext = tmpl.helpers\n\t\t? extendCtx(tmpl.helpers, context)\n\t\t: context;\n\n\tnewCtx = context;\n\tif ($isArray(data) && !noIteration) {\n\t\t// Create a view for the array, whose child views correspond to each data item. (Note: if key and view are passed in\n\t\t// along with parent view, treat as insert -e.g. from view.addViews - so view is already the view item for array)\n\t\tnewView = swapContent\n\t\t\t? view\n\t\t\t: (key !== undefined && view)\n\t\t\t\t|| new View(context, \"array\", view, data, tmpl, key, onRender, contentTmpl);\n\t\tnewView._.nl= noLinking;\n\t\tif (view && view._.useKey) {\n\t\t\t// Parent is not an 'array view'\n\t\t\tnewView._.bnd = !tag || tag._.bnd && tag; // For array views that are data bound for collection change events, set the\n\t\t\t// view._.bnd property to true for top-level link() or data-link=\"{for}\", or to the tag instance for a data-bound tag, e.g. {^{for ...}}\n\t\t\tnewView.tag = tag;\n\t\t}\n\t\tfor (i = 0, l = data.length; i < l; i++) {\n\t\t\t// Create a view for each data item.\n\t\t\tchildView = new View(newCtx, \"item\", newView, data[i], tmpl, (key || 0) + i, onRender, newView.content);\n\t\t\tif (itemVar) {\n\t\t\t\t(childView.ctx = $extend({}, newCtx))[itemVar] = $sub._cp(data[i], \"#data\", childView);\n\t\t\t}\n\t\t\titemResult = tmpl.fn(data[i], childView, $sub);\n\t\t\tresult += newView._.onRender ? newView._.onRender(itemResult, childView) : itemResult;\n\t\t}\n\t} else {\n\t\t// Create a view for singleton data object. The type of the view will be the tag name, e.g. \"if\" or \"mytag\" except for\n\t\t// \"item\", \"array\" and \"data\" views. A \"data\" view is from programmatic render(object) against a 'singleton'.\n\t\tnewView = swapContent ? view : new View(newCtx, tmplName || \"data\", view, data, tmpl, key, onRender, contentTmpl);\n\n\t\tif (itemVar) {\n\t\t\t(newView.ctx = $extend({}, newCtx))[itemVar] = $sub._cp(data, \"#data\", newView);\n\t\t}\n\n\t\tnewView.tag = tag;\n\t\tnewView._.nl = noLinking;\n\t\tresult += tmpl.fn(data, newView, $sub);\n\t}\n\tif (tag) {\n\t\tnewView.tagElse = tagCtx.index;\n\t\ttagCtx.contentView = newView;\n\t}\n\treturn outerOnRender ? outerOnRender(result, newView) : result;\n}\n\n//===========================\n// Build and compile template\n//===========================\n\n// Generate a reusable function that will serve to render a template against data\n// (Compile AST then build template function)\n\nfunction onRenderError(e, view, fallback) {\n\tvar message = fallback !== undefined\n\t\t? $isFunction(fallback)\n\t\t\t? fallback.call(view.data, e, view)\n\t\t\t: fallback || \"\"\n\t\t: \"{Error: \" + (e.message||e) + \"}\";\n\n\tif ($subSettings.onError && (fallback = $subSettings.onError.call(view.data, e, fallback && message, view)) !== undefined) {\n\t\tmessage = fallback; // There is a settings.debugMode(handler) onError override. Call it, and use return value (if any) to replace message\n\t}\n\treturn view && !view._lc ? $converters.html(message) : message; // For data-link=\\\"{... onError=...}\"... See onDataLinkedTagChange\n}\n\nfunction error(message) {\n\tthrow new $sub.Err(message);\n}\n\nfunction syntaxError(message) {\n\terror(\"Syntax error\\n\" + message);\n}\n\nfunction tmplFn(markup, tmpl, isLinkExpr, convertBack, hasElse) {\n\t// Compile markup to AST (abtract syntax tree) then build the template function code from the AST nodes\n\t// Used for compiling templates, and also by JsViews to build functions for data link expressions\n\n\t//==== nested functions ====\n\tfunction pushprecedingContent(shift) {\n\t\tshift -= loc;\n\t\tif (shift) {\n\t\t\tcontent.push(markup.substr(loc, shift).replace(rNewLine, \"\\\\n\"));\n\t\t}\n\t}\n\n\tfunction blockTagCheck(tagName, block) {\n\t\tif (tagName) {\n\t\t\ttagName += '}}';\n\t\t\t//\t\t\t'{{include}} block has {{/for}} with no open {{for}}'\n\t\t\tsyntaxError((\n\t\t\t\tblock\n\t\t\t\t\t? '{{' + block + '}} block has {{/' + tagName + ' without {{' + tagName\n\t\t\t\t\t: 'Unmatched or missing {{/' + tagName) + ', in template:\\n' + markup);\n\t\t}\n\t}\n\n\tfunction parseTag(all, bind, tagName, converter, colon, html, codeTag, params, slash, bind2, closeBlock, index) {\n/*\n\n bind tagName cvt cln html code params slash bind2 closeBlk comment\n/(?:{(\\^)?{(?:(\\w+(?=[\\/\\s}]))|(\\w+)?(:)|(>)|(\\*))\\s*((?:[^}]|}(?!}))*?)(\\/)?|{(\\^)?{(?:(?:\\/(\\w+))\\s*|!--[\\s\\S]*?--))}}/g\n\n(?:\n {(\\^)?{ bind\n (?:\n (\\w+ tagName\n (?=[\\/\\s}])\n )\n |\n (\\w+)?(:) converter colon\n |\n (>) html\n |\n (\\*) codeTag\n )\n \\s*\n ( params\n (?:[^}]|}(?!}))*?\n )\n (\\/)? slash\n |\n {(\\^)?{ bind2\n (?:\n (?:\\/(\\w+))\\s* closeBlock\n |\n !--[\\s\\S]*?-- comment\n )\n)\n}}/g\n\n*/\n\t\tif (codeTag && bind || slash && !tagName || params && params.slice(-1) === \":\" || bind2) {\n\t\t\tsyntaxError(all);\n\t\t}\n\n\t\t// Build abstract syntax tree (AST): [tagName, converter, params, content, hash, bindings, contentMarkup]\n\t\tif (html) {\n\t\t\tcolon = \":\";\n\t\t\tconverter = HTML;\n\t\t}\n\t\tslash = slash || isLinkExpr && !hasElse;\n\n\t\tvar late, openTagName, isLateOb,\n\t\t\tpathBindings = (bind || isLinkExpr) && [[]], // pathBindings is an array of arrays for arg bindings and a hash of arrays for prop bindings\n\t\t\tprops = \"\",\n\t\t\targs = \"\",\n\t\t\tctxProps = \"\",\n\t\t\tparamsArgs = \"\",\n\t\t\tparamsProps = \"\",\n\t\t\tparamsCtxProps = \"\",\n\t\t\tonError = \"\",\n\t\t\tuseTrigger = \"\",\n\t\t\t// Block tag if not self-closing and not {{:}} or {{>}} (special case) and not a data-link expression\n\t\t\tblock = !slash && !colon;\n\n\t\t//==== nested helper function ====\n\t\ttagName = tagName || (params = params || \"#data\", colon); // {{:}} is equivalent to {{:#data}}\n\t\tpushprecedingContent(index);\n\t\tloc = index + all.length; // location marker - parsed up to here\n\t\tif (codeTag) {\n\t\t\tif (allowCode) {\n\t\t\t\tcontent.push([\"*\", \"\\n\" + params.replace(/^:/, \"ret+= \").replace(rUnescapeQuotes, \"$1\") + \";\\n\"]);\n\t\t\t}\n\t\t} else if (tagName) {\n\t\t\tif (tagName === \"else\") {\n\t\t\t\tif (rTestElseIf.test(params)) {\n\t\t\t\t\tsyntaxError('For \"{{else if expr}}\" use \"{{else expr}}\"');\n\t\t\t\t}\n\t\t\t\tpathBindings = current[9] && [[]];\n\t\t\t\tcurrent[10] = markup.substring(current[10], index); // contentMarkup for block tag\n\t\t\t\topenTagName = current[11] || current[0] || syntaxError(\"Mismatched: \" + all);\n\t\t\t\t// current[0] is tagName, but for {{else}} nodes, current[11] is tagName of preceding open tag\n\t\t\t\tcurrent = stack.pop();\n\t\t\t\tcontent = current[2];\n\t\t\t\tblock = true;\n\t\t\t}\n\t\t\tif (params) {\n\t\t\t\t// remove newlines from the params string, to avoid compiled code errors for unterminated strings\n\t\t\t\tparseParams(params.replace(rNewLine, \" \"), pathBindings, tmpl, isLinkExpr)\n\t\t\t\t\t.replace(rBuildHash, function(all, onerror, isCtxPrm, key, keyToken, keyValue, arg, param) {\n\t\t\t\t\t\tif (key === \"this:\") {\n\t\t\t\t\t\t\tkeyValue = \"undefined\"; // this=some.path is always a to parameter (one-way), so don't need to compile/evaluate some.path initialization\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (param) {\n\t\t\t\t\t\t\tisLateOb = isLateOb || param[0] === \"@\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tkey = \"'\" + keyToken + \"':\";\n\t\t\t\t\t\tif (arg) {\n\t\t\t\t\t\t\targs += isCtxPrm + keyValue + \",\";\n\t\t\t\t\t\t\tparamsArgs += \"'\" + param + \"',\";\n\t\t\t\t\t\t} else if (isCtxPrm) { // Contextual parameter, ~foo=expr\n\t\t\t\t\t\t\tctxProps += key + 'j._cp(' + keyValue + ',\"' + param + '\",view),';\n\t\t\t\t\t\t\t// Compiled code for evaluating tagCtx on a tag will have: ctx:{'foo':j._cp(compiledExpr, \"expr\", view)}\n\t\t\t\t\t\t\tparamsCtxProps += key + \"'\" + param + \"',\";\n\t\t\t\t\t\t} else if (onerror) {\n\t\t\t\t\t\t\tonError += keyValue;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (keyToken === \"trigger\") {\n\t\t\t\t\t\t\t\tuseTrigger += keyValue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (keyToken === \"lateRender\") {\n\t\t\t\t\t\t\t\tlate = param !== \"false\"; // Render after first pass\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tprops += key + keyValue + \",\";\n\t\t\t\t\t\t\tparamsProps += key + \"'\" + param + \"',\";\n\t\t\t\t\t\t\thasHandlers = hasHandlers || rHasHandlers.test(keyToken);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"\";\n\t\t\t\t\t}).slice(0, -1);\n\t\t\t}\n\n\t\t\tif (pathBindings && pathBindings[0]) {\n\t\t\t\tpathBindings.pop(); // Remove the binding that was prepared for next arg. (There is always an extra one ready).\n\t\t\t}\n\n\t\t\tnewNode = [\n\t\t\t\t\ttagName,\n\t\t\t\t\tconverter || !!convertBack || hasHandlers || \"\",\n\t\t\t\t\tblock && [],\n\t\t\t\t\tparsedParam(paramsArgs || (tagName === \":\" ? \"'#data',\" : \"\"), paramsProps, paramsCtxProps), // {{:}} equivalent to {{:#data}}\n\t\t\t\t\tparsedParam(args || (tagName === \":\" ? \"data,\" : \"\"), props, ctxProps),\n\t\t\t\t\tonError,\n\t\t\t\t\tuseTrigger,\n\t\t\t\t\tlate,\n\t\t\t\t\tisLateOb,\n\t\t\t\t\tpathBindings || 0\n\t\t\t\t];\n\t\t\tcontent.push(newNode);\n\t\t\tif (block) {\n\t\t\t\tstack.push(current);\n\t\t\t\tcurrent = newNode;\n\t\t\t\tcurrent[10] = loc; // Store current location of open tag, to be able to add contentMarkup when we reach closing tag\n\t\t\t\tcurrent[11] = openTagName; // Used for checking syntax (matching close tag)\n\t\t\t}\n\t\t} else if (closeBlock) {\n\t\t\tblockTagCheck(closeBlock !== current[0] && closeBlock !== current[11] && closeBlock, current[0]); // Check matching close tag name\n\t\t\tcurrent[10] = markup.substring(current[10], index); // contentMarkup for block tag\n\t\t\tcurrent = stack.pop();\n\t\t}\n\t\tblockTagCheck(!current && closeBlock);\n\t\tcontent = current[2];\n\t}\n\t//==== /end of nested functions ====\n\n\tvar i, result, newNode, hasHandlers, bindings,\n\t\tallowCode = $subSettings.allowCode || tmpl && tmpl.allowCode\n\t\t\t|| $viewsSettings.allowCode === true, // include direct setting of settings.allowCode true for backward compat only\n\t\tastTop = [],\n\t\tloc = 0,\n\t\tstack = [],\n\t\tcontent = astTop,\n\t\tcurrent = [,,astTop];\n\n\tif (allowCode && tmpl._is) {\n\t\ttmpl.allowCode = allowCode;\n\t}\n\n//TODO\tresult = tmplFnsCache[markup]; // Only cache if template is not named and markup length < ...,\n//and there are no bindings or subtemplates?? Consider standard optimization for data-link=\"a.b.c\"\n//\t\tif (result) {\n//\t\t\ttmpl.fn = result;\n//\t\t} else {\n\n//\t\tresult = markup;\n\tif (isLinkExpr) {\n\t\tif (convertBack !== undefined) {\n\t\t\tmarkup = markup.slice(0, -convertBack.length - 2) + delimCloseChar0;\n\t\t}\n\t\tmarkup = delimOpenChar0 + markup + delimCloseChar1;\n\t}\n\n\tblockTagCheck(stack[0] && stack[0][2].pop()[0]);\n\t// Build the AST (abstract syntax tree) under astTop\n\tmarkup.replace(rTag, parseTag);\n\n\tpushprecedingContent(markup.length);\n\n\tif (loc = astTop[astTop.length - 1]) {\n\t\tblockTagCheck(\"\" + loc !== loc && (+loc[10] === loc[10]) && loc[0]);\n\t}\n//\t\t\tresult = tmplFnsCache[markup] = buildCode(astTop, tmpl);\n//\t\t}\n\n\tif (isLinkExpr) {\n\t\tresult = buildCode(astTop, markup, isLinkExpr);\n\t\tbindings = [];\n\t\ti = astTop.length;\n\t\twhile (i--) {\n\t\t\tbindings.unshift(astTop[i][9]); // With data-link expressions, pathBindings array for tagCtx[i] is astTop[i][9]\n\t\t}\n\t\tsetPaths(result, bindings);\n\t} else {\n\t\tresult = buildCode(astTop, tmpl);\n\t}\n\treturn result;\n}\n\nfunction setPaths(fn, pathsArr) {\n\tvar key, paths,\n\t\ti = 0,\n\t\tl = pathsArr.length;\n\tfn.deps = [];\n\tfn.paths = []; // The array of path binding (array/dictionary)s for each tag/else block's args and props\n\tfor (; i < l; i++) {\n\t\tfn.paths.push(paths = pathsArr[i]);\n\t\tfor (key in paths) {\n\t\t\tif (key !== \"_jsvto\" && paths.hasOwnProperty(key) && paths[key].length && !paths[key].skp) {\n\t\t\t\tfn.deps = fn.deps.concat(paths[key]); // deps is the concatenation of the paths arrays for the different bindings\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction parsedParam(args, props, ctx) {\n\treturn [args.slice(0, -1), props.slice(0, -1), ctx.slice(0, -1)];\n}\n\nfunction paramStructure(parts, type) {\n\treturn '\\n\\t'\n\t\t+ (type\n\t\t\t? type + ':{'\n\t\t\t: '')\n\t\t+ 'args:[' + parts[0] + '],\\n\\tprops:{' + parts[1] + '}'\n\t\t+ (parts[2] ? ',\\n\\tctx:{' + parts[2] + '}' : \"\");\n}\n\nfunction parseParams(params, pathBindings, tmpl, isLinkExpr) {\n\n\tfunction parseTokens(all, lftPrn0, lftPrn, bound, path, operator, err, eq, path2, late, prn, comma, lftPrn2, apos, quot, rtPrn, rtPrnDot, prn2, space, index, full) {\n\t// /(\\()(?=\\s*\\()|(?:([([])\\s*)?(?:(\\^?)(~?[\\w$.^]+)?\\s*((\\+\\+|--)|\\+|-|~(?![\\w$])|&&|\\|\\||===|!==|==|!=|<=|>=|[<>%*:?\\/]|(=))\\s*|(!*?(@)?[#~]?[\\w$.^]+)([([])?)|(,\\s*)|(\\(?)\\\\?(?:(')|(\"))|(?:\\s*(([)\\]])(?=[.^]|\\s*$|[^([])|[)\\]])([([]?))|(\\s+)/g,\n\t//lftPrn0 lftPrn bound path operator err eq path2 late prn comma lftPrn2 apos quot rtPrn rtPrnDot prn2 space\n\t// (left paren? followed by (path? followed by operator) or (path followed by paren?)) or comma or apos or quot or right paren or space\n\n\t\tfunction parsePath(allPath, not, object, helper, view, viewProperty, pathTokens, leafToken) {\n\t\t\t// /^(!*?)(?:null|true|false|\\d[\\d.]*|([\\w$]+|\\.|~([\\w$]+)|#(view|([\\w$]+))?)([\\w$.^]*?)(?:[.[^]([\\w$]+)\\]?)?)$/g,\n\t\t\t// not object helper view viewProperty pathTokens leafToken\n\t\t\tvar subPath = object === \".\";\n\t\t\tif (object) {\n\t\t\t\tpath = path.slice(not.length);\n\t\t\t\tif (/^\\.?constructor$/.test(leafToken||path)) {\n\t\t\t\t\tsyntaxError(allPath);\n\t\t\t\t}\n\t\t\t\tif (!subPath) {\n\t\t\t\t\tallPath = (late // late path @a.b.c: not throw on 'property of undefined' if a undefined, and will use _getOb() after linking to resolve late.\n\t\t\t\t\t\t\t? (isLinkExpr ? '' : '(ltOb.lt=ltOb.lt||') + '(ob='\n\t\t\t\t\t\t\t: \"\"\n\t\t\t\t\t\t)\n\t\t\t\t\t\t+ (helper\n\t\t\t\t\t\t\t? 'view.ctxPrm(\"' + helper + '\")'\n\t\t\t\t\t\t\t: view\n\t\t\t\t\t\t\t\t? \"view\"\n\t\t\t\t\t\t\t\t: \"data\")\n\t\t\t\t\t\t+ (late\n\t\t\t\t\t\t\t? ')===undefined' + (isLinkExpr ? '' : ')') + '?\"\":view._getOb(ob,\"'\n\t\t\t\t\t\t\t: \"\"\n\t\t\t\t\t\t)\n\t\t\t\t\t\t+ (leafToken\n\t\t\t\t\t\t\t? (viewProperty\n\t\t\t\t\t\t\t\t? \".\" + viewProperty\n\t\t\t\t\t\t\t\t: helper\n\t\t\t\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t\t\t\t: (view ? \"\" : \".\" + object)\n\t\t\t\t\t\t\t\t) + (pathTokens || \"\")\n\t\t\t\t\t\t\t: (leafToken = helper ? \"\" : view ? viewProperty || \"\" : object, \"\"));\n\t\t\t\t\tallPath = allPath + (leafToken ? \".\" + leafToken : \"\");\n\n\t\t\t\t\tallPath = not + (allPath.slice(0, 9) === \"view.data\"\n\t\t\t\t\t\t? allPath.slice(5) // convert #view.data... to data...\n\t\t\t\t\t\t: allPath)\n\t\t\t\t\t+ (late\n\t\t\t\t\t\t\t? (isLinkExpr ? '\"': '\",ltOb') + (prn ? ',1)':')')\n\t\t\t\t\t\t\t: \"\"\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (bindings) {\n\t\t\t\t\tbinds = named === \"_linkTo\" ? (bindto = pathBindings._jsvto = pathBindings._jsvto || []) : bndCtx.bd;\n\t\t\t\t\tif (theOb = subPath && binds[binds.length-1]) {\n\t\t\t\t\t\tif (theOb._cpfn) { // Computed property exprOb\n\t\t\t\t\t\t\twhile (theOb.sb) {\n\t\t\t\t\t\t\t\ttheOb = theOb.sb;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (theOb.bnd) {\n\t\t\t\t\t\t\t\tpath = \"^\" + path.slice(1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttheOb.sb = path;\n\t\t\t\t\t\t\ttheOb.bnd = theOb.bnd || path[0] === \"^\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbinds.push(path);\n\t\t\t\t\t}\n\t\t\t\t\tpathStart[parenDepth] = index + (subPath ? 1 : 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn allPath;\n\t\t}\n\n\t\t//bound = bindings && bound;\n\t\tif (bound && !eq) {\n\t\t\tpath = bound + path; // e.g. some.fn(...)^some.path - so here path is \"^some.path\"\n\t\t}\n\t\toperator = operator || \"\";\n\t\tlftPrn = lftPrn || lftPrn0 || lftPrn2;\n\t\tpath = path || path2;\n\n\t\tif (late && (late = !/\\)|]/.test(full[index-1]))) {\n\t\t\tpath = path.slice(1).split(\".\").join(\"^\"); // Late path @z.b.c. Use \"^\" rather than \".\" to ensure that deep binding will be used\n\t\t}\n\t\t// Could do this - but not worth perf cost?? :-\n\t\t// if (!path.lastIndexOf(\"#data.\", 0)) { path = path.slice(6); } // If path starts with \"#data.\", remove that.\n\t\tprn = prn || prn2 || \"\";\n\n\t\tvar expr, exprFn, binds, theOb, newOb,\n\t\t\trtSq = \")\";\n\n\t\tif (prn === \"[\") {\n\t\t\tprn = \"[j._sq(\";\n\t\t\trtSq = \")]\";\n\t\t}\n\n\t\tif (err && !aposed && !quoted) {\n\t\t\tsyntaxError(params);\n\t\t} else {\n\t\t\tif (bindings && rtPrnDot && !aposed && !quoted) {\n\t\t\t\t// This is a binding to a path in which an object is returned by a helper/data function/expression, e.g. foo()^x.y or (a?b:c)^x.y\n\t\t\t\t// We create a compiled function to get the object instance (which will be called when the dependent data of the subexpression changes, to return the new object, and trigger re-binding of the subsequent path)\n\t\t\t\tif (parenDepth) {\n\t\t\t\t\texpr = pathStart[parenDepth - 1];\n\t\t\t\t\tif (full.length - 1 > index - (expr || 0)) { // We need to compile a subexpression\n\t\t\t\t\t\texpr = full.slice(expr, index + all.length);\n\t\t\t\t\t\tif (exprFn !== true) { // If not reentrant call during compilation\n\t\t\t\t\t\t\tbinds = bindto || bndStack[parenDepth-1].bd;\n\t\t\t\t\t\t\t// Insert exprOb object, to be used during binding to return the computed object\n\t\t\t\t\t\t\ttheOb = binds[binds.length-1];\n\t\t\t\t\t\t\tif (theOb && theOb.prm) {\n\t\t\t\t\t\t\t\twhile (theOb.sb && theOb.sb.prm) {\n\t\t\t\t\t\t\t\t\ttheOb = theOb.sb;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tnewOb = theOb.sb = {path: theOb.sb, bnd: theOb.bnd};\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tbinds.push(newOb = {path: binds.pop()}); // Insert exprOb object, to be used during binding to return the computed object\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t // (e.g. \"some.object()\" in \"some.object().a.b\" - to be used as context for binding the following tokens \"a.b\")\n\t\t\t\t\t\t}\n\t\t\t\t\t\trtPrnDot = delimOpenChar1 + \":\" + expr // The parameter or function subexpression\n\t\t\t\t\t\t\t+ \" onerror=''\" // set onerror='' in order to wrap generated code with a try catch - returning '' as object instance if there is an error/missing parent\n\t\t\t\t\t\t\t+ delimCloseChar0;\n\t\t\t\t\t\texprFn = tmplLinks[rtPrnDot];\n\t\t\t\t\t\tif (!exprFn) {\n\t\t\t\t\t\t\ttmplLinks[rtPrnDot] = true; // Flag that this exprFn (for rtPrnDot) is being compiled\n\t\t\t\t\t\t\ttmplLinks[rtPrnDot] = exprFn = tmplFn(rtPrnDot, tmpl, true); // Compile the expression (or use cached copy already in tmpl.links)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (exprFn !== true && newOb) {\n\t\t\t\t\t\t\t// If not reentrant call during compilation\n\t\t\t\t\t\t\tnewOb._cpfn = exprFn;\n\t\t\t\t\t\t\tnewOb.prm = bndCtx.bd;\n\t\t\t\t\t\t\tnewOb.bnd = newOb.bnd || newOb.path && newOb.path.indexOf(\"^\") >= 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn (aposed\n\t\t\t\t// within single-quoted string\n\t\t\t\t? (aposed = !apos, (aposed ? all : lftPrn2 + '\"'))\n\t\t\t\t: quoted\n\t\t\t\t// within double-quoted string\n\t\t\t\t\t? (quoted = !quot, (quoted ? all : lftPrn2 + '\"'))\n\t\t\t\t\t:\n\t\t\t\t(\n\t\t\t\t\t(lftPrn\n\t\t\t\t\t\t? (pathStart[parenDepth] = index++, bndCtx = bndStack[++parenDepth] = {bd: []}, lftPrn)\n\t\t\t\t\t\t: \"\")\n\t\t\t\t\t+ (space\n\t\t\t\t\t\t? (parenDepth\n\t\t\t\t\t\t\t? \"\"\n\t\t\t\t// New arg or prop - so insert backspace \\b (\\x08) as separator for named params, used subsequently by rBuildHash, and prepare new bindings array\n\t\t\t\t\t\t\t: (paramIndex = full.slice(paramIndex, index), named\n\t\t\t\t\t\t\t\t? (named = boundName = bindto = false, \"\\b\")\n\t\t\t\t\t\t\t\t: \"\\b,\") + paramIndex + (paramIndex = index + all.length, bindings && pathBindings.push(bndCtx.bd = []), \"\\b\")\n\t\t\t\t\t\t)\n\t\t\t\t\t\t: eq\n\t\t\t\t// named param. Remove bindings for arg and create instead bindings array for prop\n\t\t\t\t\t\t\t? (parenDepth && syntaxError(params), bindings && pathBindings.pop(), named = \"_\" + path, boundName = bound, paramIndex = index + all.length,\n\t\t\t\t\t\t\t\t\tbindings && ((bindings = bndCtx.bd = pathBindings[named] = []), bindings.skp = !bound), path + ':')\n\t\t\t\t\t\t\t: path\n\t\t\t\t// path\n\t\t\t\t\t\t\t\t? (path.split(\"^\").join(\".\").replace($sub.rPath, parsePath)\n\t\t\t\t\t\t\t\t\t+ (prn\n\t\t\t\t// some.fncall(\n\t\t\t\t\t\t\t\t\t\t? (bndCtx = bndStack[++parenDepth] = {bd: []}, fnCall[parenDepth] = rtSq, prn)\n\t\t\t\t\t\t\t\t\t\t: operator)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t: operator\n\t\t\t\t// operator\n\t\t\t\t\t\t\t\t\t? operator\n\t\t\t\t\t\t\t\t\t: rtPrn\n\t\t\t\t// function\n\t\t\t\t\t\t\t\t\t\t? ((rtPrn = fnCall[parenDepth] || rtPrn, fnCall[parenDepth] = false, bndCtx = bndStack[--parenDepth], rtPrn)\n\t\t\t\t\t\t\t\t\t\t\t+ (prn // rtPrn and prn, e.g )( in (a)() or a()(), or )[ in a()[]\n\t\t\t\t\t\t\t\t\t\t\t\t? (bndCtx = bndStack[++parenDepth], fnCall[parenDepth] = rtSq, prn)\n\t\t\t\t\t\t\t\t\t\t\t\t: \"\")\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t: comma\n\t\t\t\t\t\t\t\t\t\t\t? (fnCall[parenDepth] || syntaxError(params), \",\") // We don't allow top-level literal arrays or objects\n\t\t\t\t\t\t\t\t\t\t\t: lftPrn0\n\t\t\t\t\t\t\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t\t\t\t\t\t\t: (aposed = apos, quoted = quot, '\"')\n\t\t\t\t))\n\t\t\t);\n\t\t}\n\t}\n\n\tvar named, bindto, boundName,\n\t\tquoted, // boolean for string content in double quotes\n\t\taposed, // or in single quotes\n\t\tbindings = pathBindings && pathBindings[0], // bindings array for the first arg\n\t\tbndCtx = {bd: bindings},\n\t\tbndStack = {0: bndCtx},\n\t\tparamIndex = 0, // list,\n\t\ttmplLinks = (tmpl ? tmpl.links : bindings && (bindings.links = bindings.links || {})) || topView.tmpl.links,\n\t\t// The following are used for tracking path parsing including nested paths, such as \"a.b(c^d + (e))^f\", and chained computed paths such as\n\t\t// \"a.b().c^d().e.f().g\" - which has four chained paths, \"a.b()\", \"^c.d()\", \".e.f()\" and \".g\"\n\t\tparenDepth = 0,\n\t\tfnCall = {}, // We are in a function call\n\t\tpathStart = {}, // tracks the start of the current path such as c^d() in the above example\n\t\tresult;\n\n\tif (params[0] === \"@\") {\n\t\tparams = params.replace(rBracketQuote, \".\");\n\t}\n\tresult = (params + (tmpl ? \" \" : \"\")).replace($sub.rPrm, parseTokens);\n\n\treturn !parenDepth && result || syntaxError(params); // Syntax error if unbalanced parens in params expression\n}\n\nfunction buildCode(ast, tmpl, isLinkExpr) {\n\t// Build the template function code from the AST nodes, and set as property on the passed-in template object\n\t// Used for compiling templates, and also by JsViews to build functions for data link expressions\n\tvar i, node, tagName, converter, tagCtx, hasTag, hasEncoder, getsVal, hasCnvt, useCnvt, tmplBindings, pathBindings, params, boundOnErrStart,\n\t\tboundOnErrEnd, tagRender, nestedTmpls, tmplName, nestedTmpl, tagAndElses, content, markup, nextIsElse, oldCode, isElse, isGetVal, tagCtxFn,\n\t\tonError, tagStart, trigger, lateRender, retStrOpen, retStrClose,\n\t\ttmplBindingKey = 0,\n\t\tuseViews = $subSettingsAdvanced.useViews || tmpl.useViews || tmpl.tags || tmpl.templates || tmpl.helpers || tmpl.converters,\n\t\tcode = \"\",\n\t\ttmplOptions = {},\n\t\tl = ast.length;\n\n\tif (\"\" + tmpl === tmpl) {\n\t\ttmplName = isLinkExpr ? 'data-link=\"' + tmpl.replace(rNewLine, \" \").slice(1, -1) + '\"' : tmpl;\n\t\ttmpl = 0;\n\t} else {\n\t\ttmplName = tmpl.tmplName || \"unnamed\";\n\t\tif (tmpl.allowCode) {\n\t\t\ttmplOptions.allowCode = true;\n\t\t}\n\t\tif (tmpl.debug) {\n\t\t\ttmplOptions.debug = true;\n\t\t}\n\t\ttmplBindings = tmpl.bnds;\n\t\tnestedTmpls = tmpl.tmpls;\n\t}\n\tfor (i = 0; i < l; i++) {\n\t\t// AST nodes: [0: tagName, 1: converter, 2: content, 3: params, 4: code, 5: onError, 6: trigger, 7:pathBindings, 8: contentMarkup]\n\t\tnode = ast[i];\n\n\t\t// Add newline for each callout to t() c() etc. and each markup string\n\t\tif (\"\" + node === node) {\n\t\t\t// a markup string to be inserted\n\t\t\tcode += '\\n+\"' + node + '\"';\n\t\t} else {\n\t\t\t// a compiled tag expression to be inserted\n\t\t\ttagName = node[0];\n\t\t\tif (tagName === \"*\") {\n\t\t\t\t// Code tag: {{* }}\n\t\t\t\tcode += \";\\n\" + node[1] + \"\\nret=ret\";\n\t\t\t} else {\n\t\t\t\tconverter = node[1];\n\t\t\t\tcontent = !isLinkExpr && node[2];\n\t\t\t\ttagCtx = paramStructure(node[3], 'params') + '},' + paramStructure(params = node[4]);\n\t\t\t\ttrigger = node[6];\n\t\t\t\tlateRender = node[7];\n\t\t\t\tif (node[8]) { // latePath @a.b.c or @~a.b.c\n\t\t\t\t\tretStrOpen = \"\\nvar ob,ltOb={},ctxs=\";\n\t\t\t\t\tretStrClose = \";\\nctxs.lt=ltOb.lt;\\nreturn ctxs;\";\n\t\t\t\t} else {\n\t\t\t\t\tretStrOpen = \"\\nreturn \";\n\t\t\t\t\tretStrClose = \"\";\n\t\t\t\t}\n\t\t\t\tmarkup = node[10] && node[10].replace(rUnescapeQuotes, \"$1\");\n\t\t\t\tif (isElse = tagName === \"else\") {\n\t\t\t\t\tif (pathBindings) {\n\t\t\t\t\t\tpathBindings.push(node[9]);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tonError = node[5] || $subSettings.debugMode !== false && \"undefined\"; // If debugMode not false, set default onError handler on tag to \"undefined\" (see onRenderError)\n\t\t\t\t\tif (tmplBindings && (pathBindings = node[9])) { // Array of paths, or false if not data-bound\n\t\t\t\t\t\tpathBindings = [pathBindings];\n\t\t\t\t\t\ttmplBindingKey = tmplBindings.push(1); // Add placeholder in tmplBindings for compiled function\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tuseViews = useViews || params[1] || params[2] || pathBindings || /view.(?!index)/.test(params[0]);\n\t\t\t\t// useViews is for perf optimization. For render() we only use views if necessary - for the more advanced scenarios.\n\t\t\t\t// We use views if there are props, contextual properties or args with #... (other than #index) - but you can force\n\t\t\t\t// using the full view infrastructure, (and pay a perf price) by opting in: Set useViews: true on the template, manually...\n\t\t\t\tif (isGetVal = tagName === \":\") {\n\t\t\t\t\tif (converter) {\n\t\t\t\t\t\ttagName = converter === HTML ? \">\" : converter + tagName;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (content) { // TODO optimize - if content.length === 0 or if there is a tmpl=\"...\" specified - set content to null / don't run this compilation code - since content won't get used!!\n\t\t\t\t\t\t// Create template object for nested template\n\t\t\t\t\t\tnestedTmpl = tmplObject(markup, tmplOptions);\n\t\t\t\t\t\tnestedTmpl.tmplName = tmplName + \"/\" + tagName;\n\t\t\t\t\t\t// Compile to AST and then to compiled function\n\t\t\t\t\t\tnestedTmpl.useViews = nestedTmpl.useViews || useViews;\n\t\t\t\t\t\tbuildCode(content, nestedTmpl);\n\t\t\t\t\t\tuseViews = nestedTmpl.useViews;\n\t\t\t\t\t\tnestedTmpls.push(nestedTmpl);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!isElse) {\n\t\t\t\t\t\t// This is not an else tag.\n\t\t\t\t\t\ttagAndElses = tagName;\n\t\t\t\t\t\tuseViews = useViews || tagName && (!$tags[tagName] || !$tags[tagName].flow);\n\t\t\t\t\t\t// Switch to a new code string for this bound tag (and its elses, if it has any) - for returning the tagCtxs array\n\t\t\t\t\t\toldCode = code;\n\t\t\t\t\t\tcode = \"\";\n\t\t\t\t\t}\n\t\t\t\t\tnextIsElse = ast[i + 1];\n\t\t\t\t\tnextIsElse = nextIsElse && nextIsElse[0] === \"else\";\n\t\t\t\t}\n\t\t\t\ttagStart = onError ? \";\\ntry{\\nret+=\" : \"\\n+\";\n\t\t\t\tboundOnErrStart = \"\";\n\t\t\t\tboundOnErrEnd = \"\";\n\n\t\t\t\tif (isGetVal && (pathBindings || trigger || converter && converter !== HTML || lateRender)) {\n\t\t\t\t\t// For convertVal we need a compiled function to return the new tagCtx(s)\n\t\t\t\t\ttagCtxFn = new Function(\"data,view,j,u\", \"// \" + tmplName + \" \" + (++tmplBindingKey) + \" \" + tagName\n\t\t\t\t\t\t+ retStrOpen + \"{\" + tagCtx + \"};\" + retStrClose);\n\t\t\t\t\ttagCtxFn._er = onError;\n\t\t\t\t\ttagCtxFn._tag = tagName;\n\t\t\t\t\ttagCtxFn._bd = !!pathBindings; // data-linked tag {^{.../}}\n\t\t\t\t\ttagCtxFn._lr = lateRender;\n\n\t\t\t\t\tif (isLinkExpr) {\n\t\t\t\t\t\treturn tagCtxFn;\n\t\t\t\t\t}\n\n\t\t\t\t\tsetPaths(tagCtxFn, pathBindings);\n\t\t\t\t\ttagRender = 'c(\"' + converter + '\",view,';\n\t\t\t\t\tuseCnvt = true;\n\t\t\t\t\tboundOnErrStart = tagRender + tmplBindingKey + \",\";\n\t\t\t\t\tboundOnErrEnd = \")\";\n\t\t\t\t}\n\t\t\t\tcode += (isGetVal\n\t\t\t\t\t? (isLinkExpr ? (onError ? \"try{\\n\" : \"\") + \"return \" : tagStart) + (useCnvt // Call _cnvt if there is a converter: {{cnvt: ... }} or {^{cnvt: ... }}\n\t\t\t\t\t\t? (useCnvt = undefined, useViews = hasCnvt = true, tagRender + (tagCtxFn\n\t\t\t\t\t\t\t? ((tmplBindings[tmplBindingKey - 1] = tagCtxFn), tmplBindingKey) // Store the compiled tagCtxFn in tmpl.bnds, and pass the key to convertVal()\n\t\t\t\t\t\t\t: \"{\" + tagCtx + \"}\") + \")\")\n\t\t\t\t\t\t: tagName === \">\"\n\t\t\t\t\t\t\t? (hasEncoder = true, \"h(\" + params[0] + \")\")\n\t\t\t\t\t\t\t: (getsVal = true, \"((v=\" + params[0] + ')!=null?v:' + (isLinkExpr ? 'null)' : '\"\")'))\n\t\t\t\t\t\t\t// Non strict equality so data-link=\"title{:expr}\" with expr=null/undefined removes title attribute\n\t\t\t\t\t)\n\t\t\t\t\t: (hasTag = true, \"\\n{view:view,content:false,tmpl:\" // Add this tagCtx to the compiled code for the tagCtxs to be passed to renderTag()\n\t\t\t\t\t\t+ (content ? nestedTmpls.length : \"false\") + \",\" // For block tags, pass in the key (nestedTmpls.length) to the nested content template\n\t\t\t\t\t\t+ tagCtx + \"},\"));\n\n\t\t\t\tif (tagAndElses && !nextIsElse) {\n\t\t\t\t\t// This is a data-link expression or an inline tag without any elses, or the last {{else}} of an inline tag\n\t\t\t\t\t// We complete the code for returning the tagCtxs array\n\t\t\t\t\tcode = \"[\" + code.slice(0, -1) + \"]\";\n\t\t\t\t\ttagRender = 't(\"' + tagAndElses + '\",view,this,';\n\t\t\t\t\tif (isLinkExpr || pathBindings) {\n\t\t\t\t\t\t// This is a bound tag (data-link expression or inline bound tag {^{tag ...}}) so we store a compiled tagCtxs function in tmp.bnds\n\t\t\t\t\t\tcode = new Function(\"data,view,j,u\", \" // \" + tmplName + \" \" + tmplBindingKey + \" \" + tagAndElses + retStrOpen + code\n\t\t\t\t\t\t\t+ retStrClose);\n\t\t\t\t\t\tcode._er = onError;\n\t\t\t\t\t\tcode._tag = tagAndElses;\n\t\t\t\t\t\tif (pathBindings) {\n\t\t\t\t\t\t\tsetPaths(tmplBindings[tmplBindingKey - 1] = code, pathBindings);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcode._lr = lateRender;\n\t\t\t\t\t\tif (isLinkExpr) {\n\t\t\t\t\t\t\treturn code; // For a data-link expression we return the compiled tagCtxs function\n\t\t\t\t\t\t}\n\t\t\t\t\t\tboundOnErrStart = tagRender + tmplBindingKey + \",undefined,\";\n\t\t\t\t\t\tboundOnErrEnd = \")\";\n\t\t\t\t\t}\n\n\t\t\t\t\t// This is the last {{else}} for an inline tag.\n\t\t\t\t\t// For a bound tag, pass the tagCtxs fn lookup key to renderTag.\n\t\t\t\t\t// For an unbound tag, include the code directly for evaluating tagCtxs array\n\t\t\t\t\tcode = oldCode + tagStart + tagRender + (pathBindings && tmplBindingKey || code) + \")\";\n\t\t\t\t\tpathBindings = 0;\n\t\t\t\t\ttagAndElses = 0;\n\t\t\t\t}\n\t\t\t\tif (onError && !nextIsElse) {\n\t\t\t\t\tuseViews = true;\n\t\t\t\t\tcode += ';\\n}catch(e){ret' + (isLinkExpr ? \"urn \" : \"+=\") + boundOnErrStart + 'j._err(e,view,' + onError + ')' + boundOnErrEnd + ';}' + (isLinkExpr ? \"\" : 'ret=ret');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Include only the var references that are needed in the code\n\tcode = \"// \" + tmplName\n\t\t+ (tmplOptions.debug ? \"\\ndebugger;\" : \"\")\n\t\t+ \"\\nvar v\"\n\t\t+ (hasTag ? \",t=j._tag\" : \"\") // has tag\n\t\t+ (hasCnvt ? \",c=j._cnvt\" : \"\") // converter\n\t\t+ (hasEncoder ? \",h=j._html\" : \"\") // html converter\n\t\t+ (isLinkExpr\n\t\t\t\t? (node[8] // late @... path?\n\t\t\t\t\t\t? \", ob\"\n\t\t\t\t\t\t: \"\"\n\t\t\t\t\t) + \";\\n\"\n\t\t\t\t: ',ret=\"\"')\n\t\t+ code\n\t\t+ (isLinkExpr ? \"\\n\" : \";\\nreturn ret;\");\n\n\ttry {\n\t\tcode = new Function(\"data,view,j,u\", code);\n\t} catch (e) {\n\t\tsyntaxError(\"Compiled template code:\\n\\n\" + code + '\\n: \"' + (e.message||e) + '\"');\n\t}\n\tif (tmpl) {\n\t\ttmpl.fn = code;\n\t\ttmpl.useViews = !!useViews;\n\t}\n\treturn code;\n}\n\n//==========\n// Utilities\n//==========\n\n// Merge objects, in particular contexts which inherit from parent contexts\nfunction extendCtx(context, parentContext) {\n\t// Return copy of parentContext, unless context is defined and is different, in which case return a new merged context\n\t// If neither context nor parentContext are defined, return undefined\n\treturn context && context !== parentContext\n\t\t? (parentContext\n\t\t\t? $extend($extend({}, parentContext), context)\n\t\t\t: context)\n\t\t: parentContext && $extend({}, parentContext);\n}\n\nfunction getTargetProps(source, tagCtx) {\n\t// this pointer is theMap - which has tagCtx.props too\n\t// arguments: tagCtx.args.\n\tvar key, prop,\n\t\tmap = tagCtx.map,\n\t\tpropsArr = map && map.propsArr;\n\n\tif (!propsArr) { // map.propsArr is the full array of {key:..., prop:...} objects\n\t\tpropsArr = [];\n\t\tif (typeof source === OBJECT || $isFunction(source)) {\n\t\t\tfor (key in source) {\n\t\t\t\tprop = source[key];\n\t\t\t\tif (key !== $expando && source.hasOwnProperty(key) && (!tagCtx.props.noFunctions || !$.isFunction(prop))) {\n\t\t\t\t\tpropsArr.push({key: key, prop: prop});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (map) {\n\t\t\tmap.propsArr = map.options && propsArr; // If bound {^{props}} and not isRenderCall, store propsArr on map (map.options is defined only for bound, && !isRenderCall)\n\t\t}\n\t}\n\treturn getTargetSorted(propsArr, tagCtx); // Obtains map.tgt, by filtering, sorting and splicing the full propsArr\n}\n\nfunction getTargetSorted(value, tagCtx) {\n\t// getTgt\n\tvar mapped, start, end,\n\t\ttag = tagCtx.tag,\n\t\tprops = tagCtx.props,\n\t\tpropParams = tagCtx.params.props,\n\t\tfilter = props.filter,\n\t\tsort = props.sort,\n\t\tdirectSort = sort === true,\n\t\tstep = parseInt(props.step),\n\t\treverse = props.reverse ? -1 : 1;\n\n\tif (!$isArray(value)) {\n\t\treturn value;\n\t}\n\tif (directSort || sort && \"\" + sort === sort) {\n\t\t// Temporary mapped array holds objects with index and sort-value\n\t\tmapped = value.map(function(item, i) {\n\t\t\titem = directSort ? item : getPathObject(item, sort);\n\t\t\treturn {i: i, v: \"\" + item === item ? item.toLowerCase() : item};\n\t\t});\n\t\t// Sort mapped array\n\t\tmapped.sort(function(a, b) {\n\t\t\treturn a.v > b.v ? reverse : a.v < b.v ? -reverse : 0;\n\t\t});\n\t\t// Map to new array with resulting order\n\t\tvalue = mapped.map(function(item){\n\t\t\treturn value[item.i];\n\t\t});\n\t} else if ((sort || reverse < 0) && !tag.dataMap) {\n\t\tvalue = value.slice(); // Clone array first if not already a new array\n\t}\n\tif ($isFunction(sort)) {\n\t\tvalue = value.sort(function() { // Wrap the sort function to provide tagCtx as 'this' pointer\n\t\t\treturn sort.apply(tagCtx, arguments);\n\t\t});\n\t}\n\tif (reverse < 0 && (!sort || $isFunction(sort))) { // Reverse result if not already reversed in sort\n\t\tvalue = value.reverse();\n\t}\n\n\tif (value.filter && filter) { // IE8 does not support filter\n\t\tvalue = value.filter(filter, tagCtx);\n\t\tif (tagCtx.tag.onFilter) {\n\t\t\ttagCtx.tag.onFilter(tagCtx);\n\t\t}\n\t}\n\n\tif (propParams.sorted) {\n\t\tmapped = (sort || reverse < 0) ? value : value.slice();\n\t\tif (tag.sorted) {\n\t\t\t$.observable(tag.sorted).refresh(mapped); // Note that this might cause the start and end props to be modified - e.g. by pager tag control\n\t\t} else {\n\t\t\ttagCtx.map.sorted = mapped;\n\t\t}\n\t}\n\n\tstart = props.start; // Get current value - after possible changes triggered by tag.sorted refresh() above\n\tend = props.end;\n\tif (propParams.start && start === undefined || propParams.end && end === undefined) {\n\t\tstart = end = 0;\n\t}\n\tif (!isNaN(start) || !isNaN(end)) { // start or end specified, but not the auto-create Number array scenario of {{for start=xxx end=yyy}}\n\t\tstart = +start || 0;\n\t\tend = end === undefined || end > value.length ? value.length : +end;\n\t\tvalue = value.slice(start, end);\n\t}\n\tif (step > 1) {\n\t\tstart = 0;\n\t\tend = value.length;\n\t\tmapped = [];\n\t\tfor (; start<end; start+=step) {\n\t\t\tmapped.push(value[start]);\n\t\t}\n\t\tvalue = mapped;\n\t}\n\tif (propParams.paged && tag.paged) {\n\t\t$observable(tag.paged).refresh(value);\n\t}\n\n\treturn value;\n}\n\n/** Render the template as a string, using the specified data and helpers/context\n* $(\"#tmpl\").render()\n*\n* @param {any} data\n* @param {hash} [helpersOrContext]\n* @param {boolean} [noIteration]\n* @returns {string} rendered template\n*/\nfunction $fnRender(data, context, noIteration) {\n\tvar tmplElem = this.jquery && (this[0] || error('Unknown template')), // Targeted element not found for jQuery template selector such as \"#myTmpl\"\n\t\ttmpl = tmplElem.getAttribute(tmplAttr);\n\n\treturn renderContent.call(tmpl && $.data(tmplElem)[jsvTmpl] || $templates(tmplElem),\n\t\tdata, context, noIteration);\n}\n\n//========================== Register converters ==========================\n\nfunction getCharEntity(ch) {\n\t// Get character entity for HTML, Attribute and optional data encoding\n\treturn charEntities[ch] || (charEntities[ch] = \"&#\" + ch.charCodeAt(0) + \";\");\n}\n\nfunction getCharFromEntity(match, token) {\n\t// Get character from HTML entity, for optional data unencoding\n\treturn charsFromEntities[token] || \"\";\n}\n\nfunction htmlEncode(text) {\n\t// HTML encode: Replace < > & ' \" ` etc. by corresponding entities.\n\treturn text != undefined ? rIsHtml.test(text) && (\"\" + text).replace(rHtmlEncode, getCharEntity) || text : \"\";\n}\n\nfunction dataEncode(text) {\n\t// Encode just < > and & - intended for 'safe data' along with {{:}} rather than {{>}}\n return \"\" + text === text ? text.replace(rDataEncode, getCharEntity) : text;\n}\n\nfunction dataUnencode(text) {\n // Unencode just < > and & - intended for 'safe data' along with {{:}} rather than {{>}}\n return \"\" + text === text ? text.replace(rDataUnencode, getCharFromEntity) : text;\n}\n\n//========================== Initialize ==========================\n\n$sub = $views.sub;\n$viewsSettings = $views.settings;\n\nif (!(jsr || $ && $.render)) {\n\t// JsRender not already loaded, or loaded without jQuery, and we are now moving from jsrender namespace to jQuery namepace\n\tfor (jsvStoreName in jsvStores) {\n\t\tregisterStore(jsvStoreName, jsvStores[jsvStoreName]);\n\t}\n\n\t$converters = $views.converters;\n\t$helpers = $views.helpers;\n\t$tags = $views.tags;\n\n\t$sub._tg.prototype = {\n\t\tbaseApply: baseApply,\n\t\tcvtArgs: convertArgs,\n\t\tbndArgs: convertBoundArgs,\n\t\tctxPrm: contextParameter\n\t};\n\n\ttopView = $sub.topView = new View();\n\n\t//BROWSER-SPECIFIC CODE\n\tif ($) {\n\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t// jQuery (= $) is loaded\n\n\t\t$.fn.render = $fnRender;\n\t\t$expando = $.expando;\n\t\tif ($.observable) {\n\t\t\tif (versionNumber !== (versionNumber = $.views.jsviews)) {\n\t\t\t\t// Different version of jsRender was loaded\n\t\t\t\tthrow \"JsObservable requires JsRender \" + versionNumber;\n\t\t\t}\n\t\t\t$extend($sub, $.views.sub); // jquery.observable.js was loaded before jsrender.js\n\t\t\t$views.map = $.views.map;\n\t\t}\n\n\t} else {\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t// jQuery is not loaded.\n\n\t\t$ = {};\n\n\t\tif (setGlobals) {\n\t\t\tglobal.jsrender = $; // We are loading jsrender.js from a script element, not AMD or CommonJS, so set global\n\t\t}\n\n\t\t// Error warning if jsrender.js is used as template engine on Node.js (e.g. Express or Hapi...)\n\t\t// Use jsrender-node.js instead...\n\t\t$.renderFile = $.__express = $.compile = function() { throw \"Node.js: use npm jsrender, or jsrender-node.js\"; };\n\n\t\t//END BROWSER-SPECIFIC CODE\n\t\t$.isFunction = function(ob) {\n\t\t\treturn typeof ob === \"function\";\n\t\t};\n\n\t\t$.isArray = Array.isArray || function(obj) {\n\t\t\treturn ({}.toString).call(obj) === \"[object Array]\";\n\t\t};\n\n\t\t$sub._jq = function(jq) { // private method to move from JsRender APIs from jsrender namespace to jQuery namespace\n\t\t\tif (jq !== $) {\n\t\t\t\t$extend(jq, $); // map over from jsrender namespace to jQuery namespace\n\t\t\t\t$ = jq;\n\t\t\t\t$.fn.render = $fnRender;\n\t\t\t\tdelete $.jsrender;\n\t\t\t\t$expando = $.expando;\n\t\t\t}\n\t\t};\n\n\t\t$.jsrender = versionNumber;\n\t}\n\t$subSettings = $sub.settings;\n\t$subSettings.allowCode = false;\n\t$isFunction = $.isFunction;\n\t$.render = $render;\n\t$.views = $views;\n\t$.templates = $templates = $views.templates;\n\n\tfor (setting in $subSettings) {\n\t\taddSetting(setting);\n\t}\n\n\t/**\n\t* $.views.settings.debugMode(true)\n\t* @param {boolean} debugMode\n\t* @returns {Settings}\n\t*\n\t* debugMode = $.views.settings.debugMode()\n\t* @returns {boolean}\n\t*/\n\t($viewsSettings.debugMode = function(debugMode) {\n\t\treturn debugMode === undefined\n\t\t\t? $subSettings.debugMode\n\t\t\t: (\n\t\t\t\t$subSettings.debugMode = debugMode,\n\t\t\t\t$subSettings.onError = debugMode + \"\" === debugMode\n\t\t\t\t\t? function() { return debugMode; }\n\t\t\t\t\t: $isFunction(debugMode)\n\t\t\t\t\t\t? debugMode\n\t\t\t\t\t\t: undefined,\n\t\t\t\t$viewsSettings);\n\t})(false); // jshint ignore:line\n\n\t$subSettingsAdvanced = $subSettings.advanced = {\n\t\tuseViews: false,\n\t\t_jsv: false // For global access to JsViews store\n\t};\n\n\t//========================== Register tags ==========================\n\n\t$tags({\n\t\t\"if\": {\n\t\t\trender: function(val) {\n\t\t\t\t// This function is called once for {{if}} and once for each {{else}}.\n\t\t\t\t// We will use the tag.rendering object for carrying rendering state across the calls.\n\t\t\t\t// If not done (a previous block has not been rendered), look at expression for this block and render the block if expression is truthy\n\t\t\t\t// Otherwise return \"\"\n\t\t\t\tvar self = this,\n\t\t\t\t\ttagCtx = self.tagCtx,\n\t\t\t\t\tret = (self.rendering.done || !val && (tagCtx.args.length || !tagCtx.index))\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: (self.rendering.done = true,\n\t\t\t\t\t\t\tself.selected = tagCtx.index,\n\t\t\t\t\t\t\tundefined); // Test is satisfied, so render content on current context\n\t\t\t\treturn ret;\n\t\t\t},\n\t\t\tcontentCtx: true, // Inherit parent view data context\n\t\t\tflow: true\n\t\t},\n\t\t\"for\": {\n\t\t\tsortDataMap: dataMap(getTargetSorted),\n\t\t\tinit: function(val, cloned) {\n\t\t\t\tthis.setDataMap(this.tagCtxs);\n\t\t\t},\n\t\t\trender: function(val) {\n\t\t\t\t// This function is called once for {{for}} and once for each {{else}}.\n\t\t\t\t// We will use the tag.rendering object for carrying rendering state across the calls.\n\t\t\t\tvar value, filter, srtField, isArray, i, sorted, end, step,\n\t\t\t\t\tself = this,\n\t\t\t\t\ttagCtx = self.tagCtx,\n\t\t\t\t\trange = tagCtx.argDefault === false,\n\t\t\t\t\tprops = tagCtx.props,\n\t\t\t\t\titerate = range || tagCtx.args.length, // Not final else and not auto-create range\n\t\t\t\t\tresult = \"\",\n\t\t\t\t\tdone = 0;\n\n\t\t\t\tif (!self.rendering.done) {\n\t\t\t\t\tvalue = iterate ? val : tagCtx.view.data; // For the final else, defaults to current data without iteration.\n\n\t\t\t\t\tif (range) {\n\t\t\t\t\t\trange = props.reverse ? \"unshift\" : \"push\";\n\t\t\t\t\t\tend = +props.end;\n\t\t\t\t\t\tstep = +props.step || 1;\n\t\t\t\t\t\tvalue = []; // auto-create integer array scenario of {{for start=xxx end=yyy}}\n\t\t\t\t\t\tfor (i = +props.start || 0; (end - i) * step > 0; i += step) {\n\t\t\t\t\t\t\tvalue[range](i);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t\tisArray = $isArray(value);\n\t\t\t\t\t\tresult += tagCtx.render(value, !iterate || props.noIteration);\n\t\t\t\t\t\t// Iterates if data is an array, except on final else - or if noIteration property\n\t\t\t\t\t\t// set to true. (Use {{include}} to compose templates without array iteration)\n\t\t\t\t\t\tdone += isArray ? value.length : 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (self.rendering.done = done) {\n\t\t\t\t\t\tself.selected = tagCtx.index;\n\t\t\t\t\t}\n\t\t\t\t\t// If nothing was rendered we will look at the next {{else}}. Otherwise, we are done.\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tsetDataMap: function(tagCtxs) {\n\t\t\t\tvar tagCtx, props, paramsProps,\n\t\t\t\t\tself = this,\n\t\t\t\t\tl = tagCtxs.length;\n\t\t\t\twhile (l--) {\n\t\t\t\t\ttagCtx = tagCtxs[l];\n\t\t\t\t\tprops = tagCtx.props;\n\t\t\t\t\tparamsProps = tagCtx.params.props;\n\t\t\t\t\ttagCtx.argDefault = props.end === undefined || tagCtx.args.length > 0; // Default to #data except for auto-create range scenario {{for start=xxx end=yyy step=zzz}}\n\t\t\t\t\tprops.dataMap = (tagCtx.argDefault !== false && $isArray(tagCtx.args[0]) &&\n\t\t\t\t\t\t(paramsProps.sort || paramsProps.start || paramsProps.end || paramsProps.step || paramsProps.filter || paramsProps.reverse\n\t\t\t\t\t\t|| props.sort || props.start || props.end || props.step || props.filter || props.reverse))\n\t\t\t\t\t\t&& self.sortDataMap;\n\t\t\t\t}\n\t\t\t},\n\t\t\tflow: true\n\t\t},\n\t\tprops: {\n\t\t\tbaseTag: \"for\",\n\t\t\tdataMap: dataMap(getTargetProps),\n\t\t\tinit: noop, // Don't execute the base init() of the \"for\" tag\n\t\t\tflow: true\n\t\t},\n\t\tinclude: {\n\t\t\tflow: true\n\t\t},\n\t\t\"*\": {\n\t\t\t// {{* code... }} - Ignored if template.allowCode and $.views.settings.allowCode are false. Otherwise include code in compiled template\n\t\t\trender: retVal,\n\t\t\tflow: true\n\t\t},\n\t\t\":*\": {\n\t\t\t// {{:* returnedExpression }} - Ignored if template.allowCode and $.views.settings.allowCode are false. Otherwise include code in compiled template\n\t\t\trender: retVal,\n\t\t\tflow: true\n\t\t},\n\t\tdbg: $helpers.dbg = $converters.dbg = dbgBreak // Register {{dbg/}}, {{dbg:...}} and ~dbg() to throw and catch, as breakpoints for debugging.\n\t});\n\n\t$converters({\n\t\thtml: htmlEncode,\n\t\tattr: htmlEncode, // Includes > encoding since rConvertMarkers in JsViews does not skip > characters in attribute strings\n\t\tencode: dataEncode,\n\t\tunencode: dataUnencode, // Includes > encoding since rConvertMarkers in JsViews does not skip > characters in attribute strings\n\t\turl: function(text) {\n\t\t\t// URL encoding helper.\n\t\t\treturn text != undefined ? encodeURI(\"\" + text) : text === null ? text : \"\"; // null returns null, e.g. to remove attribute. undefined returns \"\"\n\t\t}\n\t});\n}\n//========================== Define default delimiters ==========================\n$subSettings = $sub.settings;\n$isArray = ($||jsr).isArray;\n$viewsSettings.delimiters(\"{{\", \"}}\", \"^\");\n\nif (jsrToJq) { // Moving from jsrender namespace to jQuery namepace - copy over the stored items (templates, converters, helpers...)\n\tjsr.views.sub._jq($);\n}\nreturn $ || jsr;\n}, window));\n"]}
@@ -0,0 +1 @@
1
+ !function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=55)}([function(t,e,r){var n=r(123);t.exports=function(t,e,r){var i=null==t?void 0:n(t,e);return void 0===i?r:i}},function(t,e,r){"use strict";function n(t,e,r){void 0===r&&(r={});var n={type:"Feature"};return 0!==r.id&&!r.id||(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function i(t,e,r){return void 0===r&&(r={}),n({type:"Point",coordinates:t},e,r)}function o(t,e,r){void 0===r&&(r={});for(var i=0,o=t;i<o.length;i++){var a=o[i];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<a[a.length-1].length;s++)if(a[a.length-1][s]!==a[0][s])throw new Error("First and last Position are not equivalent.")}return n({type:"Polygon",coordinates:t},e,r)}function a(t,e,r){if(void 0===r&&(r={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return n({type:"LineString",coordinates:t},e,r)}function s(t,e){void 0===e&&(e={});var r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}function l(t,e,r){return void 0===r&&(r={}),n({type:"MultiLineString",coordinates:t},e,r)}function h(t,e,r){return void 0===r&&(r={}),n({type:"MultiPoint",coordinates:t},e,r)}function c(t,e,r){return void 0===r&&(r={}),n({type:"MultiPolygon",coordinates:t},e,r)}function u(t,r){void 0===r&&(r="kilometers");var n=e.factors[r];if(!n)throw new Error(r+" units is invalid");return t*n}function p(t,r){void 0===r&&(r="kilometers");var n=e.factors[r];if(!n)throw new Error(r+" units is invalid");return t/n}function f(t){return t%(2*Math.PI)*180/Math.PI}function d(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)&&!/^\s*$/.test(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.earthRadius=6371008.8,e.factors={centimeters:100*e.earthRadius,centimetres:100*e.earthRadius,degrees:e.earthRadius/111325,feet:3.28084*e.earthRadius,inches:39.37*e.earthRadius,kilometers:e.earthRadius/1e3,kilometres:e.earthRadius/1e3,meters:e.earthRadius,metres:e.earthRadius,miles:e.earthRadius/1609.344,millimeters:1e3*e.earthRadius,millimetres:1e3*e.earthRadius,nauticalmiles:e.earthRadius/1852,radians:1,yards:e.earthRadius/1.0936},e.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/e.earthRadius,yards:1/1.0936},e.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},e.feature=n,e.geometry=function(t,e,r){switch(void 0===r&&(r={}),t){case"Point":return i(e).geometry;case"LineString":return a(e).geometry;case"Polygon":return o(e).geometry;case"MultiPoint":return h(e).geometry;case"MultiLineString":return l(e).geometry;case"MultiPolygon":return c(e).geometry;default:throw new Error(t+" is invalid")}},e.point=i,e.points=function(t,e,r){return void 0===r&&(r={}),s(t.map((function(t){return i(t,e)})),r)},e.polygon=o,e.polygons=function(t,e,r){return void 0===r&&(r={}),s(t.map((function(t){return o(t,e)})),r)},e.lineString=a,e.lineStrings=function(t,e,r){return void 0===r&&(r={}),s(t.map((function(t){return a(t,e)})),r)},e.featureCollection=s,e.multiLineString=l,e.multiPoint=h,e.multiPolygon=c,e.geometryCollection=function(t,e,r){return void 0===r&&(r={}),n({type:"GeometryCollection",geometries:t},e,r)},e.round=function(t,e){if(void 0===e&&(e=0),e&&!(0<=e))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},e.radiansToLength=u,e.lengthToRadians=p,e.lengthToDegrees=function(t,e){return f(p(t,e))},e.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},e.radiansToDegrees=f,e.degreesToRadians=function(t){return t%360*Math.PI/180},e.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(0<=t))throw new Error("length must be a positive number");return u(p(t,e),r)},e.convertArea=function(t,r,n){if(void 0===r&&(r="meters"),void 0===n&&(n="kilometers"),!(0<=t))throw new Error("area must be a positive number");var i=e.areaFactors[r];if(!i)throw new Error("invalid original units");var o=e.areaFactors[n];if(!o)throw new Error("invalid final units");return t/i*o},e.isNumber=d,e.isObject=function(t){return!!t&&t.constructor===Object},e.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!d(t))throw new Error("bbox must only contain numbers")}))},e.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")},e.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},e.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},e.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},e.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},e.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},e.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},e.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,r){var n=r(28),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();t.exports=o},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){var r=Array.isArray;t.exports=r},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1);function i(t,e,r,n,i,o,a,s){var l,h,c,u,p={x:null,y:null,onLine1:!1,onLine2:!1};return 0==(l=(s-o)*(r-t)-(a-i)*(n-e))?null!==p.x&&null!==p.y&&p:(u=(r-t)*(h=e-o)-(n-e)*(c=t-i),h=((a-i)*h-(s-o)*c)/l,c=u/l,p.x=t+h*(r-t),p.y=e+h*(n-e),0<=h&&h<=1&&(p.onLine1=!0),0<=c&&c<=1&&(p.onLine2=!0),!(!p.onLine1||!p.onLine2)&&[p.x,p.y])}e.default=function(t){var e,r,o={type:"FeatureCollection",features:[]};if("LineString"===(r="Feature"===t.type?t.geometry:t).type)e=[r.coordinates];else if("MultiLineString"===r.type)e=r.coordinates;else if("MultiPolygon"===r.type)e=[].concat.apply([],r.coordinates);else{if("Polygon"!==r.type)throw new Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");e=r.coordinates}return e.forEach((function(t){e.forEach((function(e){for(var r=0;r<t.length-1;r++)for(var a=r;a<e.length-1;a++){if(t===e){if(1===Math.abs(r-a))continue;if(0===r&&a===t.length-2&&t[r][0]===t[t.length-1][0]&&t[r][1]===t[t.length-1][1])continue}var s=i(t[r][0],t[r][1],t[r+1][0],t[r+1][1],e[a][0],e[a][1],e[a+1][0],e[a+1][1]);s&&o.features.push(n.point([s[0],s[1]]))}}))})),o}},function(t,e,r){var n=r(16),i=r(71),o=r(72),a=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?i(t):o(t)}},function(t,e,r){var n=r(59),i=r(60),o=r(61),a=r(62),s=r(63);function l(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,t.exports=l},function(t,e,r){var n=r(10);t.exports=function(t,e){for(var r=t.length;r--;)if(n(t[r][0],e))return r;return-1}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,r){var n=r(14)(Object,"create");t.exports=n},function(t,e,r){var n=r(85);t.exports=function(t,e){var r=t.__data__;return n(e)?r["string"==typeof e?"string":"hash"]:r.map}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1);e.getCoord=function(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&2<=t.length&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")},e.getCoords=function(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")},e.containsNumber=function t(e){if(1<e.length&&n.isNumber(e[0])&&n.isNumber(e[1]))return!0;if(Array.isArray(e[0])&&e[0].length)return t(e[0]);throw new Error("coordinates must only contain numbers")},e.geojsonType=function(t,e,r){if(!e||!r)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.type)},e.featureOf=function(t,e,r){if(!t)throw new Error("No feature passed");if(!r)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.geometry.type)},e.collectionOf=function(t,e,r){if(!t)throw new Error("No featureCollection passed");if(!r)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+r+", FeatureCollection required");for(var n=0,i=t.features;n<i.length;n++){var o=i[n];if(!o||"Feature"!==o.type||!o.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!o.geometry||o.geometry.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+o.geometry.type)}},e.getGeom=function(t){return"Feature"===t.type?t.geometry:t},e.getType=function(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}},function(t,e,r){var n=r(69),i=r(76);t.exports=function(t,e){var r=i(t,e);return n(r)?r:void 0}},function(t,e,r){var n=r(7),i=r(2);t.exports=function(t){if(!i(t))return!1;var e=n(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},function(t,e,r){var n=r(3).Symbol;t.exports=n},function(t,e,r){var n=r(31);t.exports=function(t,e,r){"__proto__"==e&&n?n(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){var n=r(100),i=r(4),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(t){return i(t)&&a.call(t,"callee")&&!s.call(t,"callee")};t.exports=l},function(t,e,r){var n=r(15),i=r(21);t.exports=function(t){return null!=t&&i(t.length)&&!n(t)}},function(t,e){t.exports=function(t){return"number"==typeof t&&-1<t&&t%1==0&&t<=9007199254740991}},function(t,e){var r=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&r.test(t))&&-1<t&&t%1==0&&t<e}},function(t,e,r){var n=r(7),i=r(4);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==n(t)}},function(t,e,r){!function(t){"use strict";function e(t,e){return e<t?1:t<e?-1:0}var r=function(t,r){void 0===t&&(t=e),void 0===r&&(r=!1),this._compare=t,this._root=null,this._size=0,this._noDuplicates=!!r},n={size:{configurable:!0}};r.prototype.rotateLeft=function(t){var e=t.right;e&&(t.right=e.left,e.left&&(e.left.parent=t),e.parent=t.parent),t.parent?t===t.parent.left?t.parent.left=e:t.parent.right=e:this._root=e,e&&(e.left=t),t.parent=e},r.prototype.rotateRight=function(t){var e=t.left;e&&(t.left=e.right,e.right&&(e.right.parent=t),e.parent=t.parent),t.parent?t===t.parent.left?t.parent.left=e:t.parent.right=e:this._root=e,e&&(e.right=t),t.parent=e},r.prototype._splay=function(t){for(var e=this;t.parent;){var r=t.parent;r.parent?r.left===t&&r.parent.left===r?(e.rotateRight(r.parent),e.rotateRight(r)):r.right===t&&r.parent.right===r?(e.rotateLeft(r.parent),e.rotateLeft(r)):r.left===t&&r.parent.right===r?(e.rotateRight(r),e.rotateLeft(r)):(e.rotateLeft(r),e.rotateRight(r)):r.left===t?e.rotateRight(r):e.rotateLeft(r)}},r.prototype.splay=function(t){for(var e,r,n,i,o;t.parent;)(r=(e=t.parent).parent)&&r.parent?((n=r.parent).left===r?n.left=t:n.right=t,t.parent=n):(t.parent=null,this._root=t),i=t.left,o=t.right,t===e.left?(r&&(r.left===e?(e.right?(r.left=e.right,r.left.parent=r):r.left=null,(e.right=r).parent=e):(i?(r.right=i).parent=r:r.right=null,(t.left=r).parent=t)),o?(e.left=o).parent=e:e.left=null,(t.right=e).parent=t):(r&&(r.right===e?(e.left?(r.right=e.left,r.right.parent=r):r.right=null,(e.left=r).parent=e):(o?(r.left=o).parent=r:r.left=null,(t.right=r).parent=t)),i?(e.right=i).parent=e:e.right=null,(t.left=e).parent=t)},r.prototype.replace=function(t,e){t.parent?t===t.parent.left?t.parent.left=e:t.parent.right=e:this._root=e,e&&(e.parent=t.parent)},r.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},r.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},r.prototype.insert=function(t,e){var r=this._root,n=null,i=this._compare;if(this._noDuplicates)for(;r;){if(0===i((n=r).key,t))return;r=i(r.key,t)<0?r.right:r.left}else for(;r;)r=i((n=r).key,t)<0?r.right:r.left;return r={key:t,data:e,left:null,right:null,parent:n},n?i(n.key,r.key)<0?n.right=r:n.left=r:this._root=r,this.splay(r),this._size++,r},r.prototype.find=function(t){for(var e=this._root,r=this._compare;e;){var n=r(e.key,t);if(n<0)e=e.right;else{if(!(0<n))return e;e=e.left}}return null},r.prototype.contains=function(t){for(var e=this._root,r=this._compare;e;){var n=r(t,e.key);if(0===n)return!0;e=n<0?e.left:e.right}return!1},r.prototype.remove=function(t){var e=this.find(t);if(!e)return!1;if(this.splay(e),e.left)if(e.right){var r=this.minNode(e.right);r.parent!==e&&(this.replace(r,r.right),r.right=e.right,r.right.parent=r),this.replace(e,r),r.left=e.left,r.left.parent=r}else this.replace(e,e.left);else this.replace(e,e.right);return this._size--,!0},r.prototype.removeNode=function(t){if(!t)return!1;if(this.splay(t),t.left)if(t.right){var e=this.minNode(t.right);e.parent!==t&&(this.replace(e,e.right),e.right=t.right,e.right.parent=e),this.replace(t,e),e.left=t.left,e.left.parent=e}else this.replace(t,t.left);else this.replace(t,t.right);return this._size--,!0},r.prototype.erase=function(t){var e=this.find(t);if(e){this.splay(e);var r=e.left,n=e.right,i=null;r&&(r.parent=null,i=this.maxNode(r),this.splay(i),this._root=i),n&&(r?i.right=n:this._root=n,n.parent=i),this._size--}},r.prototype.pop=function(){var t=this._root,e=null;if(t){for(;t.left;)t=t.left;e={key:t.key,data:t.data},this.remove(t.key)}return e},r.prototype.next=function(t){var e=t;if(e)if(e.right)for(e=e.right;e&&e.left;)e=e.left;else for(e=t.parent;e&&e.right===t;)e=(t=e).parent;return e},r.prototype.prev=function(t){var e=t;if(e)if(e.left)for(e=e.left;e&&e.right;)e=e.right;else for(e=t.parent;e&&e.left===t;)e=(t=e).parent;return e},r.prototype.forEach=function(t){for(var e=this._root,r=[],n=!1,i=0;!n;)e?(r.push(e),e=e.left):0<r.length?(t(e=r.pop(),i++),e=e.right):n=!0;return this},r.prototype.range=function(t,e,r,n){for(var i=[],o=this._compare,a=this._root;0!==i.length||a;)if(a)i.push(a),a=a.left;else{if(0<o((a=i.pop()).key,e))break;if(0<=o(a.key,t)&&r.call(n,a))return this;a=a.right}return this},r.prototype.keys=function(){for(var t=this._root,e=[],r=[],n=!1;!n;)t?(e.push(t),t=t.left):0<e.length?(t=e.pop(),r.push(t.key),t=t.right):n=!0;return r},r.prototype.values=function(){for(var t=this._root,e=[],r=[],n=!1;!n;)t?(e.push(t),t=t.left):0<e.length?(t=e.pop(),r.push(t.data),t=t.right):n=!0;return r},r.prototype.at=function(t){for(var e=this._root,r=[],n=!1,i=0;!n;)if(e)r.push(e),e=e.left;else if(0<r.length){if(e=r.pop(),i===t)return e;i++,e=e.right}else n=!0;return null},r.prototype.load=function(t,e,r){if(void 0===t&&(t=[]),void 0===e&&(e=[]),void 0===r&&(r=!1),0!==this._size)throw new Error("bulk-load: tree is not empty");var n=t.length;return r&&function t(e,r,n,i,o){if(!(i<=n)){for(var a=e[n+i>>1],s=n-1,l=i+1;;){for(;o(e[++s],a)<0;);for(;0<o(e[--l],a););if(l<=s)break;var h=e[s];e[s]=e[l],e[l]=h,h=r[s],r[s]=r[l],r[l]=h}t(e,r,n,l,o),t(e,r,l+1,i,o)}}(t,e,0,n-1,this._compare),this._root=function t(e,r,n,i,o){var a=o-i;if(0<a){var s=i+Math.floor(a/2),l={key:r[s],data:n[s],parent:e};return l.left=t(l,r,n,i,s),l.right=t(l,r,n,s+1,o),l}return null}(null,t,e,0,n),this._size=n,this},r.prototype.min=function(){var t=this.minNode(this._root);return t?t.key:null},r.prototype.max=function(){var t=this.maxNode(this._root);return t?t.key:null},r.prototype.isEmpty=function(){return null===this._root},n.size.get=function(){return this._size},r.createTree=function(t,e,n,i,o){return new r(n,o).load(t,e,i)},Object.defineProperties(r.prototype,n);var i=0,o=1,a=2,s=3,l=0,h=1,c=2,u=3;function p(t,e,r){null===e?(t.inOut=!1,t.otherInOut=!0):(t.isSubject===e.isSubject?(t.inOut=!e.inOut,t.otherInOut=e.otherInOut):(t.inOut=!e.otherInOut,t.otherInOut=e.isVertical()?!e.inOut:e.inOut),e&&(t.prevInResult=!f(e,r)||e.isVertical()?e.prevInResult:e)),t.inResult=f(t,r)}function f(t,e){switch(t.type){case i:switch(e){case l:return!t.otherInOut;case h:return t.otherInOut;case c:return t.isSubject&&t.otherInOut||!t.isSubject&&!t.otherInOut;case u:return!0}break;case a:return e===l||e===h;case s:return e===c;case o:return!1}return!1}var d=function(t,e,r,n,o){this.left=e,this.point=t,this.otherEvent=r,this.isSubject=n,this.type=o||i,this.inOut=!1,this.otherInOut=!1,this.prevInResult=null,this.inResult=!1,this.resultInOut=!1,this.isExteriorRing=!0};function g(t,e){return t[0]===e[0]&&t[1]===e[1]}function _(t,e,r){return(t[0]-r[0])*(e[1]-r[1])-(e[0]-r[0])*(t[1]-r[1])}function m(t,e){var r=t.point,n=e.point;return r[0]>n[0]?1:r[0]<n[0]?-1:r[1]!==n[1]?r[1]>n[1]?1:-1:function(t,e,r,n){return t.left===e.left?0===_(r,t.otherEvent.point,e.otherEvent.point)?!t.isSubject&&e.isSubject?1:-1:t.isBelow(e.otherEvent.point)?-1:1:t.left?1:-1}(t,e,r)}function y(t,e,r){var n=new d(e,!1,t,t.isSubject),i=new d(e,!0,t.otherEvent,t.isSubject);return g(t.point,t.otherEvent.point)&&console.warn("what is that, a collapsed segment?",t),n.contourId=i.contourId=t.contourId,0<m(i,t.otherEvent)&&(t.otherEvent.left=!0,i.left=!1),t.otherEvent.otherEvent=i,t.otherEvent=n,r.push(i),r.push(n),r}function v(t,e){return t[0]*e[1]-t[1]*e[0]}function L(t,e){return t[0]*e[0]+t[1]*e[1]}function b(t,e,r){var n=function(t,e,r,n,i){var o=[e[0]-t[0],e[1]-t[1]],a=[n[0]-r[0],n[1]-r[1]];function s(t,e,r){return[t[0]+e*r[0],t[1]+e*r[1]]}var l=[r[0]-t[0],r[1]-t[1]],h=v(o,a),c=h*h,u=L(o,o);if(0<c){var p=v(l,a)/h;if(p<0||1<p)return null;var f=v(l,o)/h;return f<0||1<f?null:0==p||1==p?i?null:[s(t,p,o)]:0==f||1==f?i?null:[s(r,f,a)]:[s(t,p,o)]}if(0<(c=(h=v(l,o))*h))return null;var d=L(o,l)/u,g=d+L(o,a)/u,_=Math.min(d,g),m=Math.max(d,g);return _<=1&&0<=m?1===_?i?null:[s(t,0<_?_:0,o)]:0===m?i?null:[s(t,m<1?m:1,o)]:i&&0===_&&1===m?null:[s(t,0<_?_:0,o),s(t,m<1?m:1,o)]:null}(t.point,t.otherEvent.point,e.point,e.otherEvent.point),i=n?n.length:0;if(0===i)return 0;if(1===i&&(g(t.point,e.point)||g(t.otherEvent.point,e.otherEvent.point)))return 0;if(2===i&&t.isSubject===e.isSubject)return 0;if(1===i)return g(t.point,n[0])||g(t.otherEvent.point,n[0])||y(t,n[0],r),g(e.point,n[0])||g(e.otherEvent.point,n[0])||y(e,n[0],r),1;var l=[],h=!1,c=!1;return g(t.point,e.point)?h=!0:1===m(t,e)?l.push(e,t):l.push(t,e),g(t.otherEvent.point,e.otherEvent.point)?c=!0:1===m(t.otherEvent,e.otherEvent)?l.push(e.otherEvent,t.otherEvent):l.push(t.otherEvent,e.otherEvent),h&&c||h?(e.type=o,t.type=e.inOut===t.inOut?a:s,h&&!c&&y(l[1].otherEvent,l[0].point,r),2):(c?y(l[0],l[1].point,r):l[0]!==l[3].otherEvent?(y(l[0],l[1].point,r),y(l[1],l[2].point,r)):(y(l[0],l[1].point,r),y(l[3].otherEvent,l[2].point,r)),3)}function k(t,e){if(t===e)return 0;if(0!==_(t.point,t.otherEvent.point,e.point)||0!==_(t.point,t.otherEvent.point,e.otherEvent.point))return g(t.point,e.point)?t.isBelow(e.otherEvent.point)?-1:1:t.point[0]===e.point[0]?t.point[1]<e.point[1]?-1:1:1===m(t,e)?e.isAbove(t.point)?-1:1:t.isBelow(e.point)?-1:1;if(t.isSubject!==e.isSubject)return t.isSubject?-1:1;var r=t.point,n=e.point;return r[0]===n[0]&&r[1]===n[1]?(r=t.otherEvent.point,n=e.otherEvent.point,r[0]===n[0]&&r[1]===n[1]?0:t.contourId>e.contourId?1:-1):1===m(t,e)?1:-1}function M(t,e,r,n){var i=t+1,o=e.length;if(o-1<i)return t-1;for(var a=e[t].point,s=e[i].point;i<o&&s[0]===a[0]&&s[1]===a[1];){if(!r[i])return i;s=e[++i].point}for(i=t-1;r[i]&&n<=i;)i--;return i}d.prototype.isBelow=function(t){var e=this.point,r=this.otherEvent.point;return this.left?0<(e[0]-t[0])*(r[1]-t[1])-(r[0]-t[0])*(e[1]-t[1]):0<(r[0]-t[0])*(e[1]-t[1])-(e[0]-t[0])*(r[1]-t[1])},d.prototype.isAbove=function(t){return!this.isBelow(t)},d.prototype.isVertical=function(){return this.point[0]===this.otherEvent.point[0]},d.prototype.clone=function(){var t=new d(this.point,this.left,this.otherEvent,this.isSubject,this.type);return t.inResult=this.inResult,t.prevInResult=this.prevInResult,t.isExteriorRing=this.isExteriorRing,t.inOut=this.inOut,t.otherInOut=this.otherInOut,t};var w=x,C=x;function x(t,e){if(!(this instanceof x))return new x(t,e);if(this.data=t||[],this.length=this.data.length,this.compare=e||S,0<this.length)for(var r=(this.length>>1)-1;0<=r;r--)this._down(r)}function S(t,e){return t<e?-1:e<t?1:0}x.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,0<this.length&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,r=this.compare,n=e[t];0<t;){var i=t-1>>1,o=e[i];if(0<=r(n,o))break;e[t]=o,t=i}e[t]=n},_down:function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t<n;){var o=1+(t<<1),a=o+1,s=e[o];if(a<this.length&&r(e[a],s)<0&&(s=e[o=a]),0<=r(s,i))break;e[t]=s,t=o}e[t]=i}},w.default=C;var E=Math.max,P=Math.min,O=0;function B(t,e,r,n,i,o){var a,s,l,h,c,u;for(a=0,s=t.length-1;a<s;a++)if(l=t[a],h=t[a+1],c=new d(l,!1,void 0,e),u=new d(h,!1,c,e),c.otherEvent=u,l[0]!==h[0]||l[1]!==h[1]){c.contourId=u.contourId=r,o||(c.isExteriorRing=!1,u.isExteriorRing=!1),0<m(c,u)?u.left=!0:c.left=!0;var p=l[0],f=l[1];i[0]=P(i[0],p),i[1]=P(i[1],f),i[2]=E(i[2],p),i[3]=E(i[3],f),n.push(c),n.push(u)}}var T=[];function D(t,e,n){"number"==typeof t[0][0][0]&&(t=[t]),"number"==typeof e[0][0][0]&&(e=[e]);var i=function(t,e,r){var n=null;return t.length*e.length==0&&(r===l?n=T:r===c?n=t:r!==h&&r!==u||(n=0===t.length?e:t)),n}(t,e,n);if(i)return i===T?null:i;var o=[1/0,1/0,-1/0,-1/0],a=[1/0,1/0,-1/0,-1/0],s=function(t,e,r,n,i){var o,a,s,l,h,u,p=new w(null,m);for(s=0,l=t.length;s<l;s++)for(h=0,u=(o=t[s]).length;h<u;h++)(a=0===h)&&O++,B(o[h],!0,O,p,r,a);for(s=0,l=e.length;s<l;s++)for(h=0,u=(o=e[s]).length;h<u;h++)a=0===h,i===c&&(a=!1),a&&O++,B(o[h],!1,O,p,n,a);return p}(t,e,o,a,n);return(i=function(t,e,r,n,i){var o=null;return(r[0]>n[2]||n[0]>r[2]||r[1]>n[3]||n[1]>r[3])&&(i===l?o=T:i===c?o=t:i!==h&&i!==u||(o=t.concat(e))),o}(t,e,o,a,n))?i===T?null:i:function(t,e){var r,n,i,o=function(t){var e,r,n,i,o=[];for(r=0,n=t.length;r<n;r++)((e=t[r]).left&&e.inResult||!e.left&&e.otherEvent.inResult)&&o.push(e);for(var a=!1;!a;)for(a=!0,r=0,n=o.length;r<n;r++)r+1<n&&1===m(o[r],o[r+1])&&(i=o[r],o[r]=o[r+1],o[r+1]=i,a=!1);for(r=0,n=o.length;r<n;r++)(e=o[r]).pos=r;for(r=0,n=o.length;r<n;r++)(e=o[r]).left||(i=e.pos,e.pos=e.otherEvent.pos,e.otherEvent.pos=i);return o}(t),a={},s=[];for(r=0,n=o.length;r<n;r++)if(!a[r]){var l=[[]];o[r].isExteriorRing?e===c&&!o[r].isSubject&&1<s.length?s[s.length-1].push(l[0]):s.push(l):e!==c||o[r].isSubject||0!==s.length?0===s.length?s.push([[l]]):s[s.length-1].push(l[0]):s.push(l);var h=s.length-1,u=r,p=o[r].point;for(l[0].push(p);r<=u;)i=o[u],a[u]=!0,i.left?(i.resultInOut=!1,i.contourId=h):(i.otherEvent.resultInOut=!0,i.otherEvent.contourId=h),a[u=i.pos]=!0,l[0].push(o[u].point),u=M(u,o,a,r);i=o[u=-1===u?r:u],a[u]=a[i.pos]=!0,i.otherEvent.resultInOut=!0,i.otherEvent.contourId=h}return s}(function(t,e,n,i,o,a){for(var s,h,u,f=new r(k),d=[],g=Math.min(i[2],o[2]);0!==t.length;){var _=t.pop();if(d.push(_),a===l&&_.point[0]>g||a===c&&_.point[0]>i[2])break;if(_.left){h=s=f.insert(_),s=s!==(u=f.minNode())?f.prev(s):null,h=f.next(h);var m=s?s.key:null;if(p(_,m,a),h&&2===b(_,h.key,t)&&(p(_,m,a),p(_,h.key,a)),s&&2===b(s.key,_,t)){var y=s;p(m,(y=y!==u?f.prev(y):null)?y.key:null,a),p(_,m,a)}}else _=_.otherEvent,h=s=f.find(_),s&&h&&(s=s!==u?f.prev(s):null,h=f.next(h),f.remove(_),h&&s&&b(s.key,h.key,t))}return d}(s,0,0,o,a,n),n)}var j={UNION:h,DIFFERENCE:c,INTERSECTION:l,XOR:u};t.union=function(t,e){return D(t,e,h)},t.diff=function(t,e){return D(t,e,c)},t.xor=function(t,e){return D(t,e,u)},t.intersection=function(t,e){return D(t,e,l)},t.operations=j,Object.defineProperty(t,"__esModule",{value:!0})}(e)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1);function i(t,e,r){if(null!==t)for(var n,o,a,s,l,h,c,u,p=0,f=0,d=t.type,g="FeatureCollection"===d,_="Feature"===d,m=g?t.features.length:1,y=0;y<m;y++){l=(u=!!(c=g?t.features[y].geometry:_?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var v=0;v<l;v++){var L=0,b=0;if(null!==(s=u?c.geometries[v]:c)){h=s.coordinates;var k=s.type;switch(p=!r||"Polygon"!==k&&"MultiPolygon"!==k?0:1,k){case null:break;case"Point":if(!1===e(h,f,y,L,b))return!1;f++,L++;break;case"LineString":case"MultiPoint":for(n=0;n<h.length;n++){if(!1===e(h[n],f,y,L,b))return!1;f++,"MultiPoint"===k&&L++}"LineString"===k&&L++;break;case"Polygon":case"MultiLineString":for(n=0;n<h.length;n++){for(o=0;o<h[n].length-p;o++){if(!1===e(h[n][o],f,y,L,b))return!1;f++}"MultiLineString"===k&&L++,"Polygon"===k&&b++}"Polygon"===k&&L++;break;case"MultiPolygon":for(n=0;n<h.length;n++){for(o=b=0;o<h[n].length;o++){for(a=0;a<h[n][o].length-p;a++){if(!1===e(h[n][o][a],f,y,L,b))return!1;f++}b++}L++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(!1===i(s.geometries[n],e,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function o(t,e){var r;switch(t.type){case"FeatureCollection":for(r=0;r<t.features.length&&!1!==e(t.features[r].properties,r);r++);break;case"Feature":e(t.properties,0)}}function a(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var r=0;r<t.features.length&&!1!==e(t.features[r],r);r++);}function s(t,e){var r,n,i,o,a,s,l,h,c,u,p=0,f="FeatureCollection"===t.type,d="Feature"===t.type,g=f?t.features.length:1;for(r=0;r<g;r++){for(s=f?t.features[r].geometry:d?t.geometry:t,h=f?t.features[r].properties:d?t.properties:{},c=f?t.features[r].bbox:d?t.bbox:void 0,u=f?t.features[r].id:d?t.id:void 0,a=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<a;i++)if(null!==(o=l?s.geometries[i]:s))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,p,h,c,u))return!1;break;case"GeometryCollection":for(n=0;n<o.geometries.length;n++)if(!1===e(o.geometries[n],p,h,c,u))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,p,h,c,u))return!1;p++}}function l(t,e){s(t,(function(t,r,i,o,a){var s,l=null===t?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return!1!==e(n.feature(t,i,{bbox:o,id:a}),r,0)&&void 0}switch(l){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var h=0;h<t.coordinates.length;h++){var c={type:s,coordinates:t.coordinates[h]};if(!1===e(n.feature(c,i),r,h))return!1}}))}function h(t,e){l(t,(function(t,r,o){var a=0;if(t.geometry){var s=t.geometry.type;if("Point"!==s&&"MultiPoint"!==s){var l,h=0,c=0,u=0;return!1!==i(t,(function(i,s,p,f,d){if(void 0===l||h<r||c<f||u<d)return l=i,h=r,c=f,u=d,void(a=0);var g=n.lineString([l,i],t.properties);if(!1===e(g,r,o,d,a))return!1;a++,l=i}))&&void 0}}}))}function c(t,e){if(!t)throw new Error("geojson is required");l(t,(function(t,r,i){if(null!==t.geometry){var o=t.geometry.type,a=t.geometry.coordinates;switch(o){case"LineString":if(!1===e(t,r,i,0,0))return!1;break;case"Polygon":for(var s=0;s<a.length;s++)if(!1===e(n.lineString(a[s],t.properties),r,i,s))return!1}}}))}e.coordEach=i,e.coordReduce=function(t,e,r,n){var o=r;return i(t,(function(t,n,i,a,s){o=0===n&&void 0===r?t:e(o,t,n,i,a,s)}),n),o},e.propEach=o,e.propReduce=function(t,e,r){var n=r;return o(t,(function(t,i){n=0===i&&void 0===r?t:e(n,t,i)})),n},e.featureEach=a,e.featureReduce=function(t,e,r){var n=r;return a(t,(function(t,i){n=0===i&&void 0===r?t:e(n,t,i)})),n},e.coordAll=function(t){var e=[];return i(t,(function(t){e.push(t)})),e},e.geomEach=s,e.geomReduce=function(t,e,r){var n=r;return s(t,(function(t,i,o,a,s){n=0===i&&void 0===r?t:e(n,t,i,o,a,s)})),n},e.flattenEach=l,e.flattenReduce=function(t,e,r){var n=r;return l(t,(function(t,i,o){n=0===i&&0===o&&void 0===r?t:e(n,t,i,o)})),n},e.segmentEach=h,e.segmentReduce=function(t,e,r){var n=r,i=!1;return h(t,(function(t,o,a,s,l){n=!1===i&&void 0===r?t:e(n,t,o,a,s,l),i=!0})),n},e.lineEach=c,e.lineReduce=function(t,e,r){var n=r;return c(t,(function(t,i,o,a){n=0===i&&void 0===r?t:e(n,t,i,o,a)})),n},e.findSegment=function(t,e){if(e=e||{},!n.isObject(e))throw new Error("options is invalid");var r,i=e.featureIndex||0,o=e.multiFeatureIndex||0,a=e.geometryIndex||0,s=e.segmentIndex||0,l=e.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),l=l||t.features[i].properties,r=t.features[i].geometry;break;case"Feature":l=l||t.properties,r=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=t;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var h=r.coordinates;switch(r.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=h.length+s-1),n.lineString([h[s],h[s+1]],l,e);case"Polygon":return a<0&&(a=h.length+a),s<0&&(s=h[a].length+s-1),n.lineString([h[a][s],h[a][s+1]],l,e);case"MultiLineString":return o<0&&(o=h.length+o),s<0&&(s=h[o].length+s-1),n.lineString([h[o][s],h[o][s+1]],l,e);case"MultiPolygon":return o<0&&(o=h.length+o),a<0&&(a=h[o].length+a),s<0&&(s=h[o][a].length-s-1),n.lineString([h[o][a][s],h[o][a][s+1]],l,e)}throw new Error("geojson is invalid")},e.findPoint=function(t,e){if(e=e||{},!n.isObject(e))throw new Error("options is invalid");var r,i=e.featureIndex||0,o=e.multiFeatureIndex||0,a=e.geometryIndex||0,s=e.coordIndex||0,l=e.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),l=l||t.features[i].properties,r=t.features[i].geometry;break;case"Feature":l=l||t.properties,r=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=t;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var h=r.coordinates;switch(r.type){case"Point":return n.point(h,l,e);case"MultiPoint":return o<0&&(o=h.length+o),n.point(h[o],l,e);case"LineString":return s<0&&(s=h.length+s),n.point(h[s],l,e);case"Polygon":return a<0&&(a=h.length+a),s<0&&(s=h[a].length+s),n.point(h[a][s],l,e);case"MultiLineString":return o<0&&(o=h.length+o),s<0&&(s=h[o].length+s),n.point(h[o][s],l,e);case"MultiPolygon":return o<0&&(o=h.length+o),a<0&&(a=h[o].length+a),s<0&&(s=h[o][a].length-s),n.point(h[o][a][s],l,e)}throw new Error("geojson is invalid")}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(25),i=6378137;function o(t){var e=0;if(t&&0<t.length){e+=Math.abs(a(t[0]));for(var r=1;r<t.length;r++)e-=Math.abs(a(t[r]))}return e}function a(t){var e,r,n,o,a,l,h=0,c=t.length;if(2<c){for(l=0;l<c;l++)a=l===c-2?(n=c-2,o=c-1,0):l===c-1?(n=c-1,o=0,1):(o=(n=l)+1,l+2),e=t[n],r=t[o],h+=(s(t[a][0])-s(e[0]))*Math.sin(s(r[1]));h=h*i*i/2}return h}function s(t){return t*Math.PI/180}e.default=function(t){return n.geomReduce(t,(function(t,e){return t+function(t){var e,r=0;switch(t.type){case"Polygon":return o(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)r+=o(t.coordinates[e]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(e)}),0)}},function(t,e,r){var n=r(14)(r(3),"Map");t.exports=n},function(t,e,r){(function(e){var r="object"==typeof e&&e&&e.Object===Object&&e;t.exports=r}).call(this,r(70))},function(t,e,r){var n=r(77),i=r(84),o=r(86),a=r(87),s=r(88);function l(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,t.exports=l},function(t,e,r){var n=r(17),i=r(10);t.exports=function(t,e,r){(void 0===r||i(t[e],r))&&(void 0!==r||e in t)||n(t,e,r)}},function(t,e,r){var n=r(14),i=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=i},function(t,e,r){var n=r(99)(Object.getPrototypeOf,Object);t.exports=n},function(t,e){var r=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||r)}},function(t,e,r){(function(t){var n=r(3),i=r(102),o=e&&!e.nodeType&&e,a=o&&"object"==typeof t&&t&&!t.nodeType&&t,s=a&&a.exports===o?n.Buffer:void 0,l=(s?s.isBuffer:void 0)||i;t.exports=l}).call(this,r(18)(t))},function(t,e,r){var n=r(104),i=r(105),o=r(106),a=o&&o.isTypedArray,s=a?i(a):n;t.exports=s},function(t,e){t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},function(t,e,r){var n=r(110),i=r(112),o=r(20);t.exports=function(t){return o(t)?n(t,!0):i(t)}},function(t,e){t.exports=function(t){return t}},function(t,e,r){var n=r(5),i=r(124),o=r(125),a=r(128);t.exports=function(t,e){return n(t)?t:i(t,e)?[t]:o(a(t))}},function(t,e,r){var n=r(23);t.exports=function(t){if("string"==typeof t||n(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},function(t){t.exports=JSON.parse('{"a":"2.3.0"}')},function(t,e,r){var n=r(57),i=r(114)((function(t,e,r){n(t,e,r)}));t.exports=i},function(t){t.exports=JSON.parse('{"tooltips":{"placeMarker":"Click to place marker","firstVertex":"Click to place first vertex","continueLine":"Click to continue drawing","finishLine":"Click any existing marker to finish","finishPoly":"Click first marker to finish","finishRect":"Click to finish","startCircle":"Click to place circle center","finishCircle":"Click to finish circle","placeCircleMarker":"Click to place circle marker"},"actions":{"finish":"Finish","cancel":"Cancel","removeLastVertex":"Remove Last Vertex"},"buttonTitles":{"drawMarkerButton":"Draw Marker","drawPolyButton":"Draw Polygons","drawLineButton":"Draw Polyline","drawCircleButton":"Draw Circle","drawRectButton":"Draw Rectangle","editButton":"Edit Layers","dragButton":"Drag Layers","cutButton":"Cut Layers","deleteButton":"Remove Layers","drawCircleMarkerButton":"Draw Circle Marker"}}')},function(t){t.exports=JSON.parse('{"tooltips":{"placeMarker":"Platziere den Marker mit Klick","firstVertex":"Platziere den ersten Marker mit Klick","continueLine":"Klicke, um weiter zu zeichnen","finishLine":"Beende mit Klick auf existierenden Marker","finishPoly":"Beende mit Klick auf ersten Marker","finishRect":"Beende mit Klick","startCircle":"Platziere das Kreiszentrum mit Klick","finishCircle":"Beende den Kreis mit Klick","placeCircleMarker":"Platziere den Kreismarker mit Klick"},"actions":{"finish":"Beenden","cancel":"Abbrechen","removeLastVertex":"Letzten Vertex löschen"},"buttonTitles":{"drawMarkerButton":"Marker zeichnen","drawPolyButton":"Polygon zeichnen","drawLineButton":"Polyline zeichnen","drawCircleButton":"Kreis zeichnen","drawRectButton":"Rechteck zeichnen","editButton":"Layer editieren","dragButton":"Layer bewegen","cutButton":"Layer schneiden","deleteButton":"Layer löschen","drawCircleMarkerButton":"Kreismarker zeichnen"}}')},function(t){t.exports=JSON.parse('{"tooltips":{"placeMarker":"Clicca per posizionare un Marker","firstVertex":"Clicca per posizionare il primo vertice","continueLine":"Clicca per continuare a disegnare","finishLine":"Clicca qualsiasi marker esistente per terminare","finishPoly":"Clicca il primo marker per terminare","finishRect":"Clicca per terminare","startCircle":"Clicca per posizionare il punto centrale del cerchio","finishCircle":"Clicca per terminare il cerchio","placeCircleMarker":"Clicca per posizionare un Marker del cherchio"},"actions":{"finish":"Termina","cancel":"Annulla","removeLastVertex":"Rimuovi l\'ultimo vertice"},"buttonTitles":{"drawMarkerButton":"Disegna Marker","drawPolyButton":"Disegna Poligoni","drawLineButton":"Disegna Polilinea","drawCircleButton":"Disegna Cerchio","drawRectButton":"Disegna Rettangolo","editButton":"Modifica Livelli","dragButton":"Sposta Livelli","cutButton":"Ritaglia Livelli","deleteButton":"Elimina Livelli","drawCircleMarkerButton":"Disegna Marker del Cherchio"}}')},function(t){t.exports=JSON.parse('{"tooltips":{"placeMarker":"Adaugă un punct","firstVertex":"Apasă aici pentru a adăuga primul Vertex","continueLine":"Apasă aici pentru a continua desenul","finishLine":"Apasă pe orice obiect pentru a finisa desenul","finishPoly":"Apasă pe primul obiect pentru a finisa","finishRect":"Apasă pentru a finisa","startCircle":"Apasă pentru a desena un cerc","finishCircle":"Apasă pentru a finisa un cerc","placeCircleMarker":"Adaugă un punct"},"actions":{"finish":"Termină","cancel":"Anulează","removeLastVertex":"Șterge ultimul Vertex"},"buttonTitles":{"drawMarkerButton":"Adaugă o bulină","drawPolyButton":"Desenează un poligon","drawLineButton":"Desenează o linie","drawCircleButton":"Desenează un cerc","drawRectButton":"Desenează un dreptunghi","editButton":"Editează straturile","dragButton":"Mută straturile","cutButton":"Taie straturile","deleteButton":"Șterge straturile","placeCircleMarker":"Adaugă o bulină"}}')},function(t){t.exports=JSON.parse('{"tooltips":{"placeMarker":"Щелкните, чтобы поместить маркер","firstVertex":"Нажмите, чтобы поместить первый объект","continueLine":"Нажмите, чтобы продолжить рисование","finishLine":"Щелкните любой существующий маркер для завершения","finishPoly":"Выберите первую точку, чтобы закончить","finishRect":"Нажмите, чтобы закончить","startCircle":"Нажмите чтобы добавить круг","finishCircle":"Нажмите чтобы закончить круг","placeCircleMarker":"Click to place circle marker"},"actions":{"finish":"Заканчивать","cancel":"Отмена","removeLastVertex":"Удалить последний объект на карте"},"buttonTitles":{"drawMarkerButton":"Добавить маркер","drawPolyButton":"Рисовать полигон","drawLineButton":"Рисовать Полилинию","drawCircleButton":"Рисовать круг","drawRectButton":"Рисовать Прямоугольник","editButton":"Редактировать слой","dragButton":"Перетаскивать слой","cutButton":"Вырезать слой","deleteButton":"Удалить слой","placeCircleMarker":"Щелкните, чтобы поместить маркер"}}')},function(t){t.exports=JSON.parse('{"tooltips":{"placeMarker":"Presiona para colocar un marcador","firstVertex":"Presiona para colocar el primer vértice","continueLine":"Presiona para continuar dibujando","finishLine":"Presiona cualquier marcador existente para finalizar","finishPoly":"Presiona el primer marcador para finalizar","finishRect":"Presiona para finalizar","startCircle":"Presiona para colocar el centro del circulo","finishCircle":"Presiona para finalizar el circulo","placeCircleMarker":"Presiona para colocar un marcador de circulo"},"actions":{"finish":"Finalizar","cancel":"Cancelar","removeLastVertex":"Remover ultimo vértice"},"buttonTitles":{"drawMarkerButton":"Dibujar Marcador","drawPolyButton":"Dibujar Polígono","drawLineButton":"Dibujar Línea","drawCircleButton":"Dibujar Circulo","drawRectButton":"Dibujar Rectángulo","editButton":"Editar Capas","dragButton":"Arrastrar Capas","cutButton":"Cortar Capas","deleteButton":"Remover Capas","drawCircleMarkerButton":"Dibujar Marcador de Circulo"}}')},function(t){t.exports=JSON.parse('{"tooltips":{"placeMarker":"Klik om een marker te plaatsen","firstVertex":"Klik om het eerste punt te plaatsen","continueLine":"Klik om te blijven tekenen","finishLine":"Klik op een bestaand punt om te beëindigen","finishPoly":"Klik op het eerst punt om te beëindigen","finishRect":"Klik om te beëindigen","startCircle":"Klik om het middelpunt te plaatsen","finishCircle":"Klik om de cirkel te beëindigen","placeCircleMarker":"Klik om een marker te plaatsen"},"actions":{"finish":"Bewaar","cancel":"Annuleer","removeLastVertex":"Verwijder laatste punt"},"buttonTitles":{"drawMarkerButton":"Plaats Marker","drawPolyButton":"Teken een vlak","drawLineButton":"Teken een lijn","drawCircleButton":"Teken een cirkel","drawRectButton":"Teken een vierkant","editButton":"Bewerk","dragButton":"Verplaats","cutButton":"Knip","deleteButton":"Verwijder","drawCircleMarkerButton":"Plaats Marker"}}')},function(t){t.exports=JSON.parse('{"tooltips":{"placeMarker":"Cliquez pour placer un marqueur","firstVertex":"Cliquez pour placer le premier sommet","continueLine":"Cliquez pour continuer à dessiner","finishLine":"Cliquez sur n\'importe quel marqueur pour terminer","finishPoly":"Cliquez sur le premier marqueur pour terminer","finishRect":"Cliquez pour terminer","startCircle":"Cliquez pour placer le centre du cercle","finishCircle":"Cliquez pour finir le cercle"},"actions":{"finish":"Terminer","cancel":"Annuler","removeLastVertex":"Retirer le dernier sommet"},"buttonTitles":{"drawMarkerButton":"Placer des marqueurs","drawPolyButton":"Dessiner des polygones","drawLineButton":"Dessiner des polylignes","drawCircleButton":"Dessiner un cercle","drawRectButton":"Dessiner un rectangle","editButton":"Éditer des calques","dragButton":"Déplacer des calques","cutButton":"Couper des calques","deleteButton":"Supprimer des calques"}}')},function(t){t.exports=JSON.parse('{"tooltips":{"placeMarker":"单击放置标记","firstVertex":"单击放置首个顶点","continueLine":"单击继续绘制","finishLine":"单击任何存在的标记以完成","finishPoly":"单击第一个标记以完成","finishRect":"单击完成","startCircle":"单击放置圆心","finishCircle":"单击完成圆形"},"actions":{"finish":"完成","cancel":"取消","removeLastVertex":"移除最后的顶点"},"buttonTitles":{"drawMarkerButton":"绘制标记","drawPolyButton":"绘制多边形","drawLineButton":"绘制线段","drawCircleButton":"绘制圆形","drawRectButton":"绘制长方形","editButton":"编辑图层","dragButton":"拖拽图层","cutButton":"剪切图层","deleteButton":"删除图层"}}')},function(t){t.exports=JSON.parse('{"tooltips":{"placeMarker":"Clique para posicionar o marcador","firstVertex":"Clique para posicionar o primeiro vértice","continueLine":"Clique para continuar desenhando","finishLine":"Clique em qualquer marcador existente para finalizar","finishPoly":"Clique no primeiro ponto para fechar o polígono","finishRect":"Clique para finalizar","startCircle":"Clique para posicionar o centro do círculo","finishCircle":"Clique para fechar o círculo"},"actions":{"finish":"Finalizar","cancel":"Cancelar","removeLastVertex":"Remover último vértice"},"buttonTitles":{"drawMarkerButton":"Desenhar um marcador","drawPolyButton":"Desenhar um polígono","drawLineButton":"Desenhar uma polilinha","drawCircleButton":"Desenhar um círculo","drawRectButton":"Desenhar um retângulo","editButton":"Editar camada(s)","dragButton":"Mover camada(s)","cutButton":"Recortar camada(s)","deleteButton":"Remover camada(s)"}}')},function(t,e,r){var n=r(131),i=r(132);t.exports=function(t,e){return null!=t&&i(t,e,n)}},function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),o=r(13),a=n(r(24));e.default=function t(e,r,n){void 0===n&&(n={});var s=o.getGeom(e),l=o.getGeom(r);if("Polygon"===s.type&&"Polygon"===l.type){var h=a.intersection(s.coordinates,l.coordinates);if(null===h||0===h.length)return null;if(1!==h.length)return i.multiPolygon(h,n.properties);var c=h[0][0][0],u=h[0][0][h[0][0].length-1];return c[0]===u[0]&&c[1]===u[1]?i.polygon(h[0],n.properties):null}if("MultiPolygon"===s.type){for(var p=[],f=0,d=s.coordinates;f<d.length;f++){var g=d[f],_=t(o.getGeom(i.polygon(g)),l);if(_){var m=o.getGeom(_);if("Polygon"===m.type)p.push(m.coordinates);else{if("MultiPolygon"!==m.type)throw new Error("intersection is invalid");p=p.concat(m.coordinates)}}}return 0===p.length?null:1===p.length?i.polygon(p[0],n.properties):i.multiPolygon(p,n.properties)}if("MultiPolygon"===l.type)return t(l,s);throw new Error("poly1 and poly2 must be either polygons or multiPolygons")}},function(t,e,r){t.exports=r(135)},function(t,e){Array.prototype.findIndex=Array.prototype.findIndex||function(t){if(null===this)throw new TypeError("Array.prototype.findIndex called on null or undefined");if("function"!=typeof t)throw new TypeError("callback must be a function");for(var e=Object(this),r=e.length>>>0,n=arguments[1],i=0;i<r;i++)if(t.call(n,e[i],i,e))return i;return-1},Array.prototype.find=Array.prototype.find||function(t){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("callback must be a function");for(var e=Object(this),r=e.length>>>0,n=arguments[1],i=0;i<r;i++){var o=e[i];if(t.call(n,o,i,e))return o}},"function"!=typeof Object.assign&&(Object.assign=function(t){"use strict";if(null==t)throw new TypeError("Cannot convert undefined or null to object");t=Object(t);for(var e=1;e<arguments.length;e++){var r=arguments[e];if(null!=r)for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}),[Element.prototype,CharacterData.prototype,DocumentType.prototype].forEach((function(t){t.hasOwnProperty("remove")||Object.defineProperty(t,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){this.parentNode.removeChild(this)}})}))},function(t,e,r){var n=r(58),i=r(30),o=r(89),a=r(91),s=r(2),l=r(37),h=r(36);t.exports=function t(e,r,c,u,p){e!==r&&o(r,(function(o,l){if(p=p||new n,s(o))a(e,r,l,c,t,u,p);else{var f=u?u(h(e,l),o,l+"",e,r,p):void 0;void 0===f&&(f=o),i(e,l,f)}}),l)}},function(t,e,r){var n=r(8),i=r(64),o=r(65),a=r(66),s=r(67),l=r(68);function h(t){var e=this.__data__=new n(t);this.size=e.size}h.prototype.clear=i,h.prototype.delete=o,h.prototype.get=a,h.prototype.has=s,h.prototype.set=l,t.exports=h},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,r){var n=r(9),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,r=n(e,t);return!(r<0||(r==e.length-1?e.pop():i.call(e,r,1),--this.size,0))}},function(t,e,r){var n=r(9);t.exports=function(t){var e=this.__data__,r=n(e,t);return r<0?void 0:e[r][1]}},function(t,e,r){var n=r(9);t.exports=function(t){return-1<n(this.__data__,t)}},function(t,e,r){var n=r(9);t.exports=function(t,e){var r=this.__data__,i=n(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this}},function(t,e,r){var n=r(8);t.exports=function(){this.__data__=new n,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,r){var n=r(8),i=r(27),o=r(29);t.exports=function(t,e){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!i||a.length<199)return a.push([t,e]),this.size=++r.size,this;r=this.__data__=new o(a)}return r.set(t,e),this.size=r.size,this}},function(t,e,r){var n=r(15),i=r(73),o=r(2),a=r(75),s=/^\[object .+?Constructor\]$/,l=Function.prototype,h=Object.prototype,c=l.toString,u=h.hasOwnProperty,p=RegExp("^"+c.call(u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(n(t)?p:s).test(a(t))}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){var n=r(16),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n?n.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),r=t[s];try{t[s]=void 0;var n=!0}catch(t){}var i=a.call(t);return n&&(e?t[s]=r:delete t[s]),i}},function(t,e){var r=Object.prototype.toString;t.exports=function(t){return r.call(t)}},function(t,e,r){var n,i=r(74),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";t.exports=function(t){return!!o&&o in t}},function(t,e,r){var n=r(3)["__core-js_shared__"];t.exports=n},function(t,e){var r=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return r.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,r){var n=r(78),i=r(8),o=r(27);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||i),string:new n}}},function(t,e,r){var n=r(79),i=r(80),o=r(81),a=r(82),s=r(83);function l(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,t.exports=l},function(t,e,r){var n=r(11);t.exports=function(){this.__data__=n?n(null):{},this.size=0}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,r){var n=r(11),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(n){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(e,t)?e[t]:void 0}},function(t,e,r){var n=r(11),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return n?void 0!==e[t]:i.call(e,t)}},function(t,e,r){var n=r(11);t.exports=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=n&&void 0===e?"__lodash_hash_undefined__":e,this}},function(t,e,r){var n=r(12);t.exports=function(t){var e=n(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,r){var n=r(12);t.exports=function(t){return n(this,t).get(t)}},function(t,e,r){var n=r(12);t.exports=function(t){return n(this,t).has(t)}},function(t,e,r){var n=r(12);t.exports=function(t,e){var r=n(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this}},function(t,e,r){var n=r(90)();t.exports=n},function(t,e){t.exports=function(t){return function(e,r,n){for(var i=-1,o=Object(e),a=n(e),s=a.length;s--;){var l=a[t?s:++i];if(!1===r(o[l],l,o))break}return e}}},function(t,e,r){var n=r(30),i=r(92),o=r(93),a=r(96),s=r(97),l=r(19),h=r(5),c=r(101),u=r(34),p=r(15),f=r(2),d=r(103),g=r(35),_=r(36),m=r(107);t.exports=function(t,e,r,y,v,L,b){var k=_(t,r),M=_(e,r),w=b.get(M);if(w)n(t,r,w);else{var C=L?L(k,M,r+"",t,e,b):void 0,x=void 0===C;if(x){var S=h(M),E=!S&&u(M),P=!S&&!E&&g(M);C=M,S||E||P?C=h(k)?k:c(k)?a(k):E?i(M,!(x=!1)):P?o(M,!(x=!1)):[]:d(M)||l(M)?l(C=k)?C=m(k):f(k)&&!p(k)||(C=s(M)):x=!1}x&&(b.set(M,C),v(C,M,y,L,b),b.delete(M)),n(t,r,C)}}},function(t,e,r){(function(t){var n=r(3),i=e&&!e.nodeType&&e,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i?n.Buffer:void 0,s=a?a.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var r=t.length,n=s?s(r):new t.constructor(r);return t.copy(n),n}}).call(this,r(18)(t))},function(t,e,r){var n=r(94);t.exports=function(t,e){var r=e?n(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}},function(t,e,r){var n=r(95);t.exports=function(t){var e=new t.constructor(t.byteLength);return new n(e).set(new n(t)),e}},function(t,e,r){var n=r(3).Uint8Array;t.exports=n},function(t,e){t.exports=function(t,e){var r=-1,n=t.length;for(e=e||Array(n);++r<n;)e[r]=t[r];return e}},function(t,e,r){var n=r(98),i=r(32),o=r(33);t.exports=function(t){return"function"!=typeof t.constructor||o(t)?{}:n(i(t))}},function(t,e,r){var n=r(2),i=Object.create;function o(){}t.exports=function(t){if(!n(t))return{};if(i)return i(t);o.prototype=t;var e=new o;return o.prototype=void 0,e}},function(t,e){t.exports=function(t,e){return function(r){return t(e(r))}}},function(t,e,r){var n=r(7),i=r(4);t.exports=function(t){return i(t)&&"[object Arguments]"==n(t)}},function(t,e,r){var n=r(20),i=r(4);t.exports=function(t){return i(t)&&n(t)}},function(t,e){t.exports=function(){return!1}},function(t,e,r){var n=r(7),i=r(32),o=r(4),a=Function.prototype,s=Object.prototype,l=a.toString,h=s.hasOwnProperty,c=l.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=n(t))return!1;var e=i(t);if(null===e)return!0;var r=h.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&l.call(r)==c}},function(t,e,r){var n=r(7),i=r(21),o=r(4),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&i(t.length)&&!!a[n(t)]}},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,r){(function(t){var n=r(28),i=e&&!e.nodeType&&e,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i&&n.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=s}).call(this,r(18)(t))},function(t,e,r){var n=r(108),i=r(37);t.exports=function(t){return n(t,i(t))}},function(t,e,r){var n=r(109),i=r(17);t.exports=function(t,e,r,o){var a=!r;r=r||{};for(var s=-1,l=e.length;++s<l;){var h=e[s],c=o?o(r[h],t[h],h,r,t):void 0;void 0===c&&(c=t[h]),a?i(r,h,c):n(r,h,c)}return r}},function(t,e,r){var n=r(17),i=r(10),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){var a=t[e];o.call(t,e)&&i(a,r)&&(void 0!==r||e in t)||n(t,e,r)}},function(t,e,r){var n=r(111),i=r(19),o=r(5),a=r(34),s=r(22),l=r(35),h=Object.prototype.hasOwnProperty;t.exports=function(t,e){var r=o(t),c=!r&&i(t),u=!r&&!c&&a(t),p=!r&&!c&&!u&&l(t),f=r||c||u||p,d=f?n(t.length,String):[],g=d.length;for(var _ in t)!e&&!h.call(t,_)||f&&("length"==_||u&&("offset"==_||"parent"==_)||p&&("buffer"==_||"byteLength"==_||"byteOffset"==_)||s(_,g))||d.push(_);return d}},function(t,e){t.exports=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}},function(t,e,r){var n=r(2),i=r(33),o=r(113),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return o(t);var e=i(t),r=[];for(var s in t)("constructor"!=s||!e&&a.call(t,s))&&r.push(s);return r}},function(t,e){t.exports=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}},function(t,e,r){var n=r(115),i=r(122);t.exports=function(t){return n((function(e,r){var n=-1,o=r.length,a=1<o?r[o-1]:void 0,s=2<o?r[2]:void 0;for(a=3<t.length&&"function"==typeof a?(o--,a):void 0,s&&i(r[0],r[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var l=r[n];l&&t(e,l,n,a)}return e}))}},function(t,e,r){var n=r(38),i=r(116),o=r(118);t.exports=function(t,e){return o(i(t,e,n),t+"")}},function(t,e,r){var n=r(117),i=Math.max;t.exports=function(t,e,r){return e=i(void 0===e?t.length-1:e,0),function(){for(var o=arguments,a=-1,s=i(o.length-e,0),l=Array(s);++a<s;)l[a]=o[e+a];a=-1;for(var h=Array(e+1);++a<e;)h[a]=o[a];return h[e]=r(l),n(t,this,h)}}},function(t,e){t.exports=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}},function(t,e,r){var n=r(119),i=r(121)(n);t.exports=i},function(t,e,r){var n=r(120),i=r(31),o=r(38),a=i?function(t,e){return i(t,"toString",{configurable:!0,enumerable:!1,value:n(e),writable:!0})}:o;t.exports=a},function(t,e){t.exports=function(t){return function(){return t}}},function(t,e){var r=Date.now;t.exports=function(t){var e=0,n=0;return function(){var i=r(),o=16-(i-n);if(n=i,0<o){if(800<=++e)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,r){var n=r(10),i=r(20),o=r(22),a=r(2);t.exports=function(t,e,r){if(!a(r))return!1;var s=typeof e;return!!("number"==s?i(r)&&o(e,r.length):"string"==s&&e in r)&&n(r[e],t)}},function(t,e,r){var n=r(39),i=r(40);t.exports=function(t,e){for(var r=0,o=(e=n(e,t)).length;null!=t&&r<o;)t=t[i(e[r++])];return r&&r==o?t:void 0}},function(t,e,r){var n=r(5),i=r(23),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(n(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!i(t))||a.test(t)||!o.test(t)||null!=e&&t in Object(e)}},function(t,e,r){var n=r(126),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=n((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(i,(function(t,r,n,i){e.push(n?i.replace(o,"$1"):r||t)})),e}));t.exports=a},function(t,e,r){var n=r(127);t.exports=function(t){var e=n(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}},function(t,e,r){var n=r(29),i="Expected a function";function o(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(i);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=t.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(o.Cache||n),r}o.Cache=n,t.exports=o},function(t,e,r){var n=r(129);t.exports=function(t){return null==t?"":n(t)}},function(t,e,r){var n=r(16),i=r(130),o=r(5),a=r(23),s=n?n.prototype:void 0,l=s?s.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(o(e))return i(e,t)+"";if(a(e))return l?l.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r}},function(t,e){t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}},function(t,e){var r=Object.prototype.hasOwnProperty;t.exports=function(t,e){return null!=t&&r.call(t,e)}},function(t,e,r){var n=r(39),i=r(19),o=r(5),a=r(22),s=r(21),l=r(40);t.exports=function(t,e,r){for(var h=-1,c=(e=n(e,t)).length,u=!1;++h<c;){var p=l(e[h]);if(!(u=null!=t&&r(t,p)))break;t=t[p]}return u||++h!=c?u:!!(c=null==t?0:t.length)&&s(c)&&a(p,c)&&(o(t)||i(t))}},function(t,e,r){},function(t,e,r){},function(t,e,r){"use strict";r.r(e),r(56);var n=r(41),i=r(42),o=r.n(i),a=r(43),s=r(44),l=r(45),h=r(46),c=r(47),u=r(48),p=r(49),f=r(50),d=r(51),g={en:a,de:s,it:l,ro:h,ru:c,es:u,nl:p,fr:f,pt_br:r(52),zh:d},_=L.Class.extend({initialize:function(t){this.map=t,this.Draw=new L.PM.Draw(t),this.Toolbar=new L.PM.Toolbar(t),this._globalRemovalMode=!1},setLang:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"en",e=1<arguments.length?arguments[1]:void 0,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"en";e&&(g[t]=o()(g[r],e)),L.PM.activeLang=t,this.map.pm.Toolbar.reinit()},addControls:function(t){this.Toolbar.addControls(t)},removeControls:function(){this.Toolbar.removeControls()},toggleControls:function(){this.Toolbar.toggleControls()},controlsVisible:function(){return this.Toolbar.isVisible},enableDraw:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"Polygon",e=1<arguments.length?arguments[1]:void 0;"Poly"===t&&(t="Polygon"),this.Draw.enable(t,e)},disableDraw:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"Polygon";"Poly"===t&&(t="Polygon"),this.Draw.disable(t)},setPathOptions:function(t){this.Draw.setPathOptions(t)},findLayers:function(){var t=[];return this.map.eachLayer((function(e){(e instanceof L.Polyline||e instanceof L.Marker||e instanceof L.Circle||e instanceof L.CircleMarker)&&t.push(e)})),t=(t=t.filter((function(t){return!!t.pm}))).filter((function(t){return!t._pmTempLayer}))},removeLayer:function(t){var e=t.target;e._pmTempLayer||e.pm&&e.pm.dragging()||(e.remove(),this.map.fire("pm:remove",{layer:e}))},globalDragModeEnabled:function(){return!!this._globalDragMode},enableGlobalDragMode:function(){var t=this.findLayers();this._globalDragMode=!0,t.forEach((function(t){t.pm.enableLayerDrag()})),this.map.on("layeradd",this.layerAddHandler,this),this.Toolbar.toggleButton("dragMode",this._globalDragMode),this._fireDragModeEvent(!0)},disableGlobalDragMode:function(){var t=this.findLayers();this._globalDragMode=!1,t.forEach((function(t){t.pm.disableLayerDrag()})),this.map.off("layeradd",this.layerAddHandler,this),this.Toolbar.toggleButton("dragMode",this._globalDragMode),this._fireDragModeEvent(!1)},_fireDragModeEvent:function(t){this.map.fire("pm:globaldragmodetoggled",{enabled:t,map:this.map})},toggleGlobalDragMode:function(){this.globalDragModeEnabled()?this.disableGlobalDragMode():this.enableGlobalDragMode()},layerAddHandler:function(t){var e=t.layer;!e.pm||e._pmTempLayer||(this.globalRemovalEnabled()&&(this.disableGlobalRemovalMode(),this.enableGlobalRemovalMode()),this.globalEditEnabled()&&(this.disableGlobalEditMode(),this.enableGlobalEditMode()),this.globalDragModeEnabled()&&(this.disableGlobalDragMode(),this.enableGlobalDragMode()))},disableGlobalRemovalMode:function(){var t=this;this._globalRemovalMode=!1,this.map.eachLayer((function(e){e.off("click",t.removeLayer,t)})),this.map.off("layeradd",this.layerAddHandler,this),this.Toolbar.toggleButton("deleteLayer",this._globalRemovalMode),this._fireRemovalModeEvent(!1)},enableGlobalRemovalMode:function(){var t=this;this._globalRemovalMode=!0,this.map.eachLayer((function(e){(function(t){return t.pm&&!(t.pm.options&&t.pm.options.preventMarkerRemoval)&&!(t instanceof L.LayerGroup)})(e)&&e.on("click",t.removeLayer,t)})),this.map.on("layeradd",this.layerAddHandler,this),this.Toolbar.toggleButton("deleteLayer",this._globalRemovalMode),this._fireRemovalModeEvent(!0)},_fireRemovalModeEvent:function(t){this.map.fire("pm:globalremovalmodetoggled",{enabled:t,map:this.map})},toggleGlobalRemovalMode:function(){this.globalRemovalEnabled()?this.disableGlobalRemovalMode():this.enableGlobalRemovalMode()},globalRemovalEnabled:function(){return!!this._globalRemovalMode},globalEditEnabled:function(){return this._globalEditMode},enableGlobalEditMode:function(t){var e=this.findLayers();this._globalEditMode=!0,e.forEach((function(e){e.pm.enable(t)})),this.map.on("layeradd",this.layerAddHandler,this),this.Toolbar.toggleButton("editPolygon",this._globalEditMode),this._fireEditModeEvent(!0)},disableGlobalEditMode:function(){var t=this.findLayers();this._globalEditMode=!1,t.forEach((function(t){t.pm.disable()})),this.map.on("layeroff",this.layerAddHandler,this),this.Toolbar.toggleButton("editPolygon",this._globalEditMode),this._fireEditModeEvent(!1)},_fireEditModeEvent:function(t){this.map.fire("pm:globaleditmodetoggled",{enabled:t,map:this.map})},toggleGlobalEditMode:function(t){this.globalEditEnabled()?this.disableGlobalEditMode():this.enableGlobalEditMode(t)}}),m=r(0),y=r.n(m),v=r(53),b=r.n(v);function k(t){var e=L.PM.activeLang;return b()(g,e)||(e="en"),y()(g[e],t)}var M=L.Control.extend({options:{position:"topleft"},initialize:function(t){this._button=L.Util.setOptions(this,t)},onAdd:function(t){return this._map=t,this._container="edit"===this._button.tool?this._map.pm.Toolbar.editContainer:this._map.pm.Toolbar.drawContainer,this.buttonsDomNode=this._makeButton(this._button),this._container.appendChild(this.buttonsDomNode),this._container},onRemove:function(){return this.buttonsDomNode.remove(),this._container},getText:function(){return this._button.text},getIconUrl:function(){return this._button.iconUrl},destroy:function(){this._button={},this._update()},toggle:function(t){return this._button.toggleStatus="boolean"==typeof t?t:!this._button.toggleStatus,this._applyStyleClasses(),this._button.toggleStatus},toggled:function(){return this._button.toggleStatus},onCreate:function(){this.toggle(!1)},_triggerClick:function(t){this._button.onClick(t),this._clicked(t),this._button.afterClick(t)},_makeButton:function(t){var e=this,r=L.DomUtil.create("div","button-container",this._container),n=L.DomUtil.create("a","leaflet-buttons-control-button",r),i=L.DomUtil.create("div","leaflet-pm-actions-container",r),o=t.actions,a={cancel:{text:k("actions.cancel"),onClick:function(){this._triggerClick()}},removeLastVertex:{text:k("actions.removeLastVertex"),onClick:function(){this._map.pm.Draw[t.jsClass]._removeLastVertex()}},finish:{text:k("actions.finish"),onClick:function(e){this._map.pm.Draw[t.jsClass]._finishShape(e)}}};o.forEach((function(t){var r=a[t],n=L.DomUtil.create("a","leaflet-pm-action action-".concat(t),i);n.innerHTML=r.text,L.DomEvent.addListener(n,"click",r.onClick,e),L.DomEvent.disableClickPropagation(n)})),t.toggleStatus&&L.DomUtil.addClass(n,"active");var s=L.DomUtil.create("div","control-icon",n);return t.title&&s.setAttribute("title",t.title),t.iconUrl&&s.setAttribute("src",t.iconUrl),t.className&&L.DomUtil.addClass(s,t.className),L.DomEvent.addListener(n,"click",(function(){e._button.disableOtherButtons&&e._map.pm.Toolbar.triggerClickOnToggledButtons(e)})),L.DomEvent.addListener(n,"click",this._triggerClick,this),L.DomEvent.disableClickPropagation(n),r},_applyStyleClasses:function(){this._container&&(this._button.toggleStatus?L.DomUtil.addClass(this.buttonsDomNode,"active"):L.DomUtil.removeClass(this.buttonsDomNode,"active"))},_clicked:function(){this._button.doToggle&&this.toggle()}});L.Control.PMButton=M;var w=L.Class.extend({options:{drawMarker:!0,drawRectangle:!0,drawPolyline:!0,drawPolygon:!0,drawCircle:!0,drawCircleMarker:!0,editMode:!0,dragMode:!0,cutPolygon:!0,removalMode:!0,position:"topleft"},initialize:function(t){this.init(t)},reinit:function(){var t=this.isVisible;this.removeControls(),this._defineButtons(),t&&this.addControls()},init:function(t){this.map=t,this.buttons={},this.isVisible=!1,this.drawContainer=L.DomUtil.create("div","leaflet-pm-toolbar leaflet-pm-draw leaflet-bar leaflet-control"),this.editContainer=L.DomUtil.create("div","leaflet-pm-toolbar leaflet-pm-edit leaflet-bar leaflet-control"),this._defineButtons()},getButtons:function(){return this.buttons},addControls:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.options;void 0!==t.editPolygon&&(t.editMode=t.editPolygon),void 0!==t.deleteLayer&&(t.removalMode=t.deleteLayer),L.Util.setOptions(this,t),this.applyIconStyle(),this._showHideButtons(),this.isVisible=!0},applyIconStyle:function(){var t=this.getButtons(),e={geomanIcons:{drawMarker:"control-icon leaflet-pm-icon-marker",drawPolyline:"control-icon leaflet-pm-icon-polyline",drawRectangle:"control-icon leaflet-pm-icon-rectangle",drawPolygon:"control-icon leaflet-pm-icon-polygon",drawCircle:"control-icon leaflet-pm-icon-circle",drawCircleMarker:"control-icon leaflet-pm-icon-circle-marker",editMode:"control-icon leaflet-pm-icon-edit",dragMode:"control-icon leaflet-pm-icon-drag",cutPolygon:"control-icon leaflet-pm-icon-cut",removalMode:"control-icon leaflet-pm-icon-delete"}};for(var r in t){var n=t[r];L.Util.setOptions(n,{className:e.geomanIcons[r]})}},removeControls:function(){var t=this.getButtons();for(var e in t)t[e].remove();this.isVisible=!1},toggleControls:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.options;this.isVisible?this.removeControls():this.addControls(t)},_addButton:function(t,e){return this.buttons[t]=e,this.options[t]=this.options[t]||!1,this.buttons[t]},triggerClickOnToggledButtons:function(t){for(var e in this.buttons)this.buttons[e]!==t&&this.buttons[e].toggled()&&this.buttons[e]._triggerClick()},toggleButton:function(t,e){return"editPolygon"===t&&(t="editMode"),"deleteLayer"===t&&(t="removalMode"),this.triggerClickOnToggledButtons(this.buttons[t]),this.buttons[t].toggle(e)},_defineButtons:function(){var t=this,e={className:"control-icon leaflet-pm-icon-marker",title:k("buttonTitles.drawMarkerButton"),jsClass:"Marker",onClick:function(){},afterClick:function(){t.map.pm.Draw.Marker.toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},r={title:k("buttonTitles.drawPolyButton"),className:"control-icon leaflet-pm-icon-polygon",jsClass:"Polygon",onClick:function(){},afterClick:function(){t.map.pm.Draw.Polygon.toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["finish","removeLastVertex","cancel"]},n={className:"control-icon leaflet-pm-icon-polyline",title:k("buttonTitles.drawLineButton"),jsClass:"Line",onClick:function(){},afterClick:function(){t.map.pm.Draw.Line.toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["finish","removeLastVertex","cancel"]},i={title:k("buttonTitles.drawCircleButton"),className:"control-icon leaflet-pm-icon-circle",jsClass:"Circle",onClick:function(){},afterClick:function(){t.map.pm.Draw.Circle.toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},o={title:k("buttonTitles.drawCircleMarkerButton"),className:"control-icon leaflet-pm-icon-circle-marker",jsClass:"CircleMarker",onClick:function(){},afterClick:function(){t.map.pm.Draw.CircleMarker.toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},a={title:k("buttonTitles.drawRectButton"),className:"control-icon leaflet-pm-icon-rectangle",jsClass:"Rectangle",onClick:function(){},afterClick:function(){t.map.pm.Draw.Rectangle.toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},s={title:k("buttonTitles.editButton"),className:"control-icon leaflet-pm-icon-edit",onClick:function(){},afterClick:function(){t.map.pm.toggleGlobalEditMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["cancel"]},l={title:k("buttonTitles.dragButton"),className:"control-icon leaflet-pm-icon-drag",onClick:function(){},afterClick:function(){t.map.pm.toggleGlobalDragMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["cancel"]},h={title:k("buttonTitles.cutButton"),className:"control-icon leaflet-pm-icon-cut",jsClass:"Cut",onClick:function(){},afterClick:function(){t.map.pm.Draw.Cut.toggle({snappable:!0,cursorMarker:!0,allowSelfIntersection:!1})},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finish","removeLastVertex","cancel"]},c={title:k("buttonTitles.deleteButton"),className:"control-icon leaflet-pm-icon-delete",onClick:function(){},afterClick:function(){t.map.pm.toggleGlobalRemovalMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["cancel"]};this._addButton("drawMarker",new L.Control.PMButton(e)),this._addButton("drawPolyline",new L.Control.PMButton(n)),this._addButton("drawRectangle",new L.Control.PMButton(a)),this._addButton("drawPolygon",new L.Control.PMButton(r)),this._addButton("drawCircle",new L.Control.PMButton(i)),this._addButton("drawCircleMarker",new L.Control.PMButton(o)),this._addButton("editMode",new L.Control.PMButton(s)),this._addButton("dragMode",new L.Control.PMButton(l)),this._addButton("cutPolygon",new L.Control.PMButton(h)),this._addButton("removalMode",new L.Control.PMButton(c))},_showHideButtons:function(){this.removeControls();var t=this.getButtons();for(var e in t)this.options[e]&&(t[e].setPosition(this.options.position),t[e].addTo(this.map))}}),C=function(t,e,r){var n=t.project(e),i=t.project(r);return t.unproject(n._add(i)._divideBy(2))},x={_initSnappableMarkers:function(){this.options.snapDistance=this.options.snapDistance||30,this._assignEvents(this._markers),this._layer.off("pm:dragstart",this._unsnap,this),this._layer.on("pm:dragstart",this._unsnap,this)},_assignEvents:function(t){var e=this;t.forEach((function(t){Array.isArray(t)?e._assignEvents(t):(t.off("drag",e._handleSnapping,e),t.on("drag",e._handleSnapping,e),t.off("dragend",e._cleanupSnapping,e),t.on("dragend",e._cleanupSnapping,e))}))},_unsnap:function(){delete this._snapLatLng},_cleanupSnapping:function(){delete this._snapList,this._map.off("pm:remove",this._handleSnapLayerRemoval,this),this.debugIndicatorLines&&this.debugIndicatorLines.forEach((function(t){t.remove()}))},_handleSnapLayerRemoval:function(t){var e=t.layer,r=this._snapList.findIndex((function(t){return t._leaflet_id===e._leaflet_id}));this._snapList.splice(r,1)},_handleSnapping:function(t){var e=this;if(t.originalEvent.altKey)return!1;if(void 0===this._snapList&&(this._createSnapList(),this._map.off("layeradd",this._createSnapList,this),this._map.on("layeradd",this._createSnapList,this)),this._snapList.length<=0)return!1;var r,n=t.target,i=this._calcClosestLayer(n.getLatLng(),this._snapList),o=i.layer instanceof L.Marker||i.layer instanceof L.CircleMarker;r=o?i.latlng:this._checkPrioritiySnapping(i);var a=this.options.snapDistance,s={marker:n,snapLatLng:r,segment:i.segment,layer:this._layer,layerInteractedWith:i.layer,distance:i.distance};if(s.marker.fire("pm:snapdrag",s),this._layer.fire("pm:snapdrag",s),i.distance<a){n.setLatLng(r),n._snapped=!0;var l=this._snapLatLng||{},h=r||{};l.lat===h.lat&&l.lng===h.lng||(e._snapLatLng=r,n.fire("pm:snap",s),e._layer.fire("pm:snap",s))}else this._snapLatLng&&(this._unsnap(s),n._snapped=!1,s.marker.fire("pm:unsnap",s),this._layer.fire("pm:unsnap",s));return!0},_checkPrioritiySnapping:function(t){var e,r=this._map,n=t.segment[0],i=t.segment[1],o=t.latlng,a=this._getDistance(r,n,o),s=this._getDistance(r,i,o),l=a<s?n:i,h=a<s?a:s;if(this.options.snapMiddle){var c=C(r,n,i),u=this._getDistance(r,c,o);u<a&&u<s&&(l=c,h=u)}return e=h<this.options.snapDistance?l:o,Object.assign({},e)},_createSnapList:function(){var t=this,e=[],r=[],n=this._map;n.off("pm:remove",this._handleSnapLayerRemoval,this),n.on("pm:remove",this._handleSnapLayerRemoval,this),n.eachLayer((function(t){if((t instanceof L.Polyline||t instanceof L.Marker||t instanceof L.CircleMarker)&&!0!==t.options.snapIgnore){e.push(t);var n=L.polyline([],{color:"red",pmIgnore:!0});n._pmTempLayer=!0,r.push(n)}})),e=(e=(e=e.filter((function(e){return t._layer!==e}))).filter((function(t){return t._latlng||t._latlngs&&0<t._latlngs.length}))).filter((function(t){return!t._pmTempLayer})),this._otherSnapLayers?this._snapList=e.concat(this._otherSnapLayers):this._snapList=e,this.debugIndicatorLines=r},_calcClosestLayer:function(t,e){var r=this,n={};return e.forEach((function(e,i){var o=r._calcLayerDistances(t,e);r.debugIndicatorLines[i].setLatLngs([t,o.latlng]),(void 0===n.distance||o.distance<n.distance)&&((n=o).layer=e)})),n},_calcLayerDistances:function(t,e){var r,n,i=this,o=this._map,a=e instanceof L.Marker||e instanceof L.CircleMarker,s=e instanceof L.Polygon,l=t,h=a?e.getLatLng():e.getLatLngs();if(a)return{latlng:Object.assign({},h),distance:this._getDistance(o,h,l)};!function t(e){e.forEach((function(a,h){if(Array.isArray(a))t(a);else{var c,u=a;c=s?h+1===e.length?0:h+1:h+1===e.length?void 0:h+1;var p=e[c];if(p){var f=i._getDistanceToSegment(o,l,u,p);(void 0===n||f<n)&&(n=f,r=[u,p])}}}))}(h);var c=this._getClosestPointOnSegment(o,t,r[0],r[1]);return{latlng:Object.assign({},c),segment:r,distance:n}},_getClosestPointOnSegment:function(t,e,r,n){var i=t.getMaxZoom();i===1/0&&(i=t.getZoom());var o=t.project(e,i),a=t.project(r,i),s=t.project(n,i),l=L.LineUtil.closestPointOnSegment(o,a,s);return t.unproject(l,i)},_getDistanceToSegment:function(t,e,r,n){var i=t.latLngToLayerPoint(e),o=t.latLngToLayerPoint(r),a=t.latLngToLayerPoint(n);return L.LineUtil.pointToSegmentDistance(i,o,a)},_getDistance:function(t,e,r){return t.latLngToLayerPoint(e).distanceTo(t.latLngToLayerPoint(r))}},S=L.Class.extend({includes:[x],options:{snappable:!0,snapDistance:20,tooltips:!0,cursorMarker:!0,finishOnDoubleClick:!1,finishOn:null,allowSelfIntersection:!0,templineStyle:{},hintlineStyle:{color:"#3388ff",dashArray:"5,5"},markerStyle:{draggable:!0}},initialize:function(t){var e=this;this._map=t,this.shapes=["Marker","CircleMarker","Line","Polygon","Rectangle","Circle","Cut"],this.shapes.forEach((function(t){e[t]=new L.PM.Draw[t](e._map)}))},setPathOptions:function(t){this.options.pathOptions=t},getShapes:function(){return this.shapes},enable:function(t,e){if(!t)throw new Error("Error: Please pass a shape as a parameter. Possible shapes are: ".concat(this.getShapes().join(",")));this.disable(),this[t].enable(e)},disable:function(){var t=this;this.shapes.forEach((function(e){t[e].disable()}))},addControls:function(){var t=this;this.shapes.forEach((function(e){t[e].addButton()}))}});S.Marker=S.extend({initialize:function(t){this._map=t,this._shape="Marker",this.toolbarButtonName="drawMarker"},enable:function(t){var e=this;L.Util.setOptions(this,t),this._enabled=!0,this._map.on("click",this._createMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._hintMarker=L.marker([0,0],this.options.markerStyle),this._hintMarker._pmTempLayer=!0,this._hintMarker.addTo(this._map),this.options.tooltips&&this._hintMarker.bindTooltip(k("tooltips.placeMarker"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._layer=this._hintMarker,this._map.on("mousemove",this._syncHintMarker,this),this._map.fire("pm:drawstart",{shape:this._shape,workingLayer:this._layer}),this._map.eachLayer((function(t){e.isRelevantMarker(t)&&t.pm.enable()}))},disable:function(){var t=this;this._enabled&&(this._map.off("click",this._createMarker,this),this._hintMarker.remove(),this._map.off("mousemove",this._syncHintMarker,this),this._map.eachLayer((function(e){t.isRelevantMarker(e)&&e.pm.disable()})),this._map.fire("pm:drawend",{shape:this._shape}),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._enabled=!1)},isRelevantMarker:function(t){return t instanceof L.Marker&&t.pm&&!t._pmTempLayer},enabled:function(){return this._enabled},toggle:function(t){this.enabled()?this.disable():this.enable(t)},_createMarker:function(t){if(t.latlng){this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);var e=this._hintMarker.getLatLng(),r=new L.Marker(e,this.options.markerStyle);r.addTo(this._map),r.pm.enable(),this._map.fire("pm:create",{shape:this._shape,marker:r,layer:r}),this._cleanupSnapping()}},_syncHintMarker:function(t){if(this._hintMarker.setLatLng(t.latlng),this.options.snappable){var e=t;e.target=this._hintMarker,this._handleSnapping(e)}}});var E=r(6),P=r.n(E);S.Line=S.extend({initialize:function(t){this._map=t,this._shape="Line",this.toolbarButtonName="drawPolyline",this._doesSelfIntersect=!1},enable:function(t){L.Util.setOptions(this,t),this.options.finishOnDoubleClick&&!this.options.finishOn&&(this.options.finishOn="dblclick"),this._enabled=!0,this._layerGroup=new L.LayerGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=L.polyline([],this.options.templineStyle),this._layer._pmTempLayer=!0,this._layerGroup.addLayer(this._layer),this._hintline=L.polyline([],this.options.hintlineStyle),this._hintline._pmTempLayer=!0,this._layerGroup.addLayer(this._hintline),this._hintMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(k("tooltips.firstVertex"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._map._container.style.cursor="crosshair",this._map.on("click",this._createVertex,this),this.options.finishOn&&this._map.on(this.options.finishOn,this._finishShape,this),"dblclick"===this.options.finishOn&&(this.tempMapDoubleClickZoomState=this._map.doubleClickZoom._enabled,this.tempMapDoubleClickZoomState&&this._map.doubleClickZoom.disable()),this._map.on("mousemove",this._syncHintMarker,this),this._hintMarker.on("move",this._syncHintLine,this),this._map.fire("pm:drawstart",{shape:this._shape,workingLayer:this._layer}),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._otherSnapLayers=[]},disable:function(){this._enabled&&(this._enabled=!1,this._map._container.style.cursor="",this._map.off("click",this._createVertex,this),this._map.off("mousemove",this._syncHintMarker,this),this.options.finishOn&&this._map.off(this.options.finishOn,this._finishShape,this),this.tempMapDoubleClickZoomState&&this._map.doubleClickZoom.enable(),this._map.removeLayer(this._layerGroup),this._map.fire("pm:drawend",{shape:this._shape}),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping())},enabled:function(){return this._enabled},toggle:function(t){this.enabled()?this.disable():this.enable(t)},hasSelfIntersection:function(){return 0<P()(this._layer.toGeoJSON(15)).features.length},_syncHintLine:function(){var t=this._layer.getLatLngs();if(0<t.length){var e=t[t.length-1];this._hintline.setLatLngs([e,this._hintMarker.getLatLng()])}},_syncHintMarker:function(t){if(this._hintMarker.setLatLng(t.latlng),this.options.snappable){var e=t;e.target=this._hintMarker,this._handleSnapping(e)}this.options.allowSelfIntersection||this._handleSelfIntersection(!0,t.latlng)},_handleSelfIntersection:function(t,e){var r=L.polyline(this._layer.getLatLngs());t&&(e=e||this._hintMarker.getLatLng(),r.addLatLng(e));var n=P()(r.toGeoJSON(15));this._doesSelfIntersect=0<n.features.length,this._doesSelfIntersect?this._hintline.setStyle({color:"red"}):this._hintline.setStyle(this.options.hintlineStyle)},_removeLastVertex:function(){var t=this._layer.getLatLngs(),e=t.pop();if(t.length<1)this.disable();else{var r=this._layerGroup.getLayers().filter((function(t){return t instanceof L.Marker})).filter((function(t){return!L.DomUtil.hasClass(t._icon,"cursor-marker")})).find((function(t){return t.getLatLng()===e}));this._layerGroup.removeLayer(r),this._layer.setLatLngs(t),this._syncHintLine()}},_createVertex:function(t){if(this.options.allowSelfIntersection||(this._handleSelfIntersection(!0,t.latlng),!this._doesSelfIntersect)){this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);var e=this._hintMarker.getLatLng();if(e.equals(this._layer.getLatLngs()[0]))this._finishShape(t);else{var r=0===this._layer.getLatLngs().length;this._layer.addLatLng(e);var n=this._createMarker(e,r);this._hintline.setLatLngs([e,e]),this._layer.fire("pm:vertexadded",{shape:this._shape,workingLayer:this._layer,marker:n,latlng:e})}}},_finishShape:function(){if(this.options.allowSelfIntersection||(this._handleSelfIntersection(!1),!this._doesSelfIntersect)){var t=this._layer.getLatLngs();if(!(t.length<=1)){var e=L.polyline(t,this.options.pathOptions).addTo(this._map);this.disable(),this._map.fire("pm:create",{shape:this._shape,layer:e}),this.options.snappable&&this._cleanupSnapping()}}},_createMarker:function(t,e){var r=new L.Marker(t,{draggable:!1,icon:L.divIcon({className:"marker-icon"})});return r._pmTempLayer=!0,this._layerGroup.addLayer(r),r.on("click",this._finishShape,this),e&&this._hintMarker.setTooltipContent(k("tooltips.continueLine")),2===this._layer.getLatLngs().length&&this._hintMarker.setTooltipContent(k("tooltips.finishLine")),r}}),S.Polygon=S.Line.extend({initialize:function(t){this._map=t,this._shape="Polygon",this.toolbarButtonName="drawPolygon"},_finishShape:function(t){if(this.options.allowSelfIntersection||(this._handleSelfIntersection(!1),!this._doesSelfIntersect)){var e=this._layer.getLatLngs();if(!(e.length<=2)){t&&"dblclick"===t.type&&e.splice(e.length-1,1);var r=L.polygon(e,this.options.pathOptions).addTo(this._map);this.disable(),this._map.fire("pm:create",{shape:this._shape,layer:r}),this._cleanupSnapping(),this._otherSnapLayers.splice(this._tempSnapLayerIndex,1),delete this._tempSnapLayerIndex}}},_createMarker:function(t,e){var r=new L.Marker(t,{draggable:!1,icon:L.divIcon({className:"marker-icon"})});return r._pmTempLayer=!0,this._layerGroup.addLayer(r),e&&(r.on("click",this._finishShape,this),this._tempSnapLayerIndex=this._otherSnapLayers.push(r)-1,this.options.snappable&&this._cleanupSnapping()),e&&this._hintMarker.setTooltipContent(k("tooltips.continueLine")),3===this._layer.getLatLngs().length&&this._hintMarker.setTooltipContent(k("tooltips.finishPoly")),r}}),S.Rectangle=S.extend({initialize:function(t){this._map=t,this._shape="Rectangle",this.toolbarButtonName="drawRectangle"},enable:function(t){if(L.Util.setOptions(this,t),this._enabled=!0,this._layerGroup=new L.LayerGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=L.rectangle([[0,0],[0,0]],this.options.pathOptions),this._layer._pmTempLayer=!0,this._startMarker=L.marker([0,0],{icon:L.divIcon({className:"marker-icon rect-start-marker"}),draggable:!0,zIndexOffset:100,opacity:this.options.cursorMarker?1:0}),this._startMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._startMarker),this._hintMarker=L.marker([0,0],{icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.tooltips&&this._hintMarker.bindTooltip(k("tooltips.firstVertex"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this.options.cursorMarker){L.DomUtil.addClass(this._hintMarker._icon,"visible"),this._styleMarkers=[];for(var e=0;e<2;e+=1){var r=L.marker([0,0],{icon:L.divIcon({className:"marker-icon rect-style-marker"}),draggable:!0,zIndexOffset:100});r._pmTempLayer=!0,this._layerGroup.addLayer(r),this._styleMarkers.push(r)}}this._map._container.style.cursor="crosshair",this._map.on("click",this._placeStartingMarkers,this),this._map.on("mousemove",this._syncHintMarker,this),this._map.fire("pm:drawstart",{shape:this._shape,workingLayer:this._layer}),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._otherSnapLayers=[]},disable:function(){this._enabled&&(this._enabled=!1,this._map._container.style.cursor="",this._map.off("click",this._finishShape,this),this._map.off("click",this._placeStartingMarkers,this),this._map.off("mousemove",this._syncHintMarker,this),this._map.removeLayer(this._layerGroup),this._map.fire("pm:drawend",{shape:this._shape}),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping())},enabled:function(){return this._enabled},toggle:function(t){this.enabled()?this.disable():this.enable(t)},_placeStartingMarkers:function(t){this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);var e=this._hintMarker.getLatLng();L.DomUtil.addClass(this._startMarker._icon,"visible"),this._startMarker.setLatLng(e),this.options.cursorMarker&&this._styleMarkers&&this._styleMarkers.forEach((function(t){L.DomUtil.addClass(t._icon,"visible"),t.setLatLng(e)})),this._map.off("click",this._placeStartingMarkers,this),this._map.on("click",this._finishShape,this),this._hintMarker.setTooltipContent(k("tooltips.finishRect")),this._setRectangleOrigin()},_setRectangleOrigin:function(){var t=this._startMarker.getLatLng();t&&(this._layerGroup.addLayer(this._layer),this._layer.setLatLngs([t,t]),this._hintMarker.on("move",this._syncRectangleSize,this))},_syncHintMarker:function(t){if(this._hintMarker.setLatLng(t.latlng),this.options.snappable){var e=t;e.target=this._hintMarker,this._handleSnapping(e)}},_syncRectangleSize:function(){var t=this,e=this._startMarker.getLatLng(),r=this._hintMarker.getLatLng();if(this._layer.setBounds([e,r]),this.options.cursorMarker&&this._styleMarkers){var n=this._findCorners(),i=[];n.forEach((function(e){e.equals(t._startMarker.getLatLng())||e.equals(t._hintMarker.getLatLng())||i.push(e)})),i.forEach((function(e,r){t._styleMarkers[r].setLatLng(e)}))}},_finishShape:function(t){this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);var e=this._hintMarker.getLatLng(),r=this._startMarker.getLatLng(),n=L.rectangle([r,e],this.options.pathOptions).addTo(this._map);this.disable(),this._map.fire("pm:create",{shape:this._shape,layer:n})},_findCorners:function(){var t=this._layer.getBounds();return[t.getNorthWest(),t.getNorthEast(),t.getSouthEast(),t.getSouthWest()]}}),S.Circle=S.extend({initialize:function(t){this._map=t,this._shape="Circle",this.toolbarButtonName="drawCircle"},enable:function(t){L.Util.setOptions(this,t),this.options.radius=0,this._enabled=!0,this._layerGroup=new L.LayerGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=L.circle([0,0],this.options.templineStyle),this._layer._pmTempLayer=!0,this._layerGroup.addLayer(this._layer),this._centerMarker=L.marker([0,0],{icon:L.divIcon({className:"marker-icon"}),draggable:!1,zIndexOffset:100}),this._centerMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._centerMarker),this._hintMarker=L.marker([0,0],{icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(k("tooltips.startCircle"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._hintline=L.polyline([],this.options.hintlineStyle),this._hintline._pmTempLayer=!0,this._layerGroup.addLayer(this._hintline),this._map._container.style.cursor="crosshair",this._map.on("click",this._placeCenterMarker,this),this._map.on("mousemove",this._syncHintMarker,this),this._map.fire("pm:drawstart",{shape:this._shape,workingLayer:this._layer}),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._otherSnapLayers=[]},disable:function(){this._enabled&&(this._enabled=!1,this._map._container.style.cursor="",this._map.off("click",this._finishShape,this),this._map.off("click",this._placeCenterMarker,this),this._map.off("mousemove",this._syncHintMarker,this),this._map.removeLayer(this._layerGroup),this._map.fire("pm:drawend",{shape:this._shape}),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping())},enabled:function(){return this._enabled},toggle:function(t){this.enabled()?this.disable():this.enable(t)},_syncHintLine:function(){var t=this._centerMarker.getLatLng();this._hintline.setLatLngs([t,this._hintMarker.getLatLng()])},_syncCircleRadius:function(){var t=this._centerMarker.getLatLng(),e=this._hintMarker.getLatLng(),r=t.distanceTo(e);this._layer.setRadius(r)},_syncHintMarker:function(t){if(this._hintMarker.setLatLng(t.latlng),this.options.snappable){var e=t;e.target=this._hintMarker,this._handleSnapping(e)}},_placeCenterMarker:function(t){this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);var e=this._hintMarker.getLatLng();this._centerMarker.setLatLng(e),this._map.off("click",this._placeCenterMarker,this),this._map.on("click",this._finishShape,this),this._placeCircleCenter()},_placeCircleCenter:function(){var t=this._centerMarker.getLatLng();t&&(this._layer.setLatLng(t),this._hintMarker.on("move",this._syncHintLine,this),this._hintMarker.on("move",this._syncCircleRadius,this),this._hintMarker.setTooltipContent(k("tooltips.finishCircle")),this._layer.fire("pm:centerplaced",{shape:this._shape,workingLayer:this._layer,latlng:t}))},_finishShape:function(t){var e=this._centerMarker.getLatLng(),r=t.latlng,n=e.distanceTo(r),i=Object.assign({},this.options.pathOptions,{radius:n}),o=L.circle(e,i).addTo(this._map);this.disable(),this._map.fire("pm:create",{shape:this._shape,layer:o})},_createMarker:function(t){var e=new L.Marker(t,{draggable:!1,icon:L.divIcon({className:"marker-icon"})});return e._pmTempLayer=!0,this._layerGroup.addLayer(e),e}}),S.CircleMarker=S.Marker.extend({initialize:function(t){this._map=t,this._shape="CircleMarker",this.toolbarButtonName="drawCircleMarker"},enable:function(t){var e=this;L.Util.setOptions(this,t),this._enabled=!0,this._map.on("click",this._createMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._hintMarker=L.circleMarker([0,0],this.options.templineStyle),this._hintMarker._pmTempLayer=!0,this._hintMarker.addTo(this._map),this.options.tooltips&&this._hintMarker.bindTooltip(k("tooltips.placeCircleMarker"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._layer=this._hintMarker,this._map.on("mousemove",this._syncHintMarker,this),this._map.fire("pm:drawstart",{shape:this._shape,workingLayer:this._layer}),this._map.eachLayer((function(t){e.isRelevantMarker(t)&&t.pm.enable()}))},isRelevantMarker:function(t){return t instanceof L.CircleMarker&&!(t instanceof L.Circle)&&t.pm&&!t._pmTempLayer},_createMarker:function(t){if(t.latlng){this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);var e=this._hintMarker.getLatLng(),r=L.circleMarker(e,this.options.pathOptions);r.addTo(this._map),r.pm.enable(),this._map.fire("pm:create",{shape:this._shape,marker:r,layer:r}),this._cleanupSnapping()}}});var O=r(54),B=r.n(O),T=r(24),D=r(26),j=r.n(D),I=r(1),R=r(13),G=r(25);function A(t){switch(t.type){case"Polygon":return 1<j()(t)?t:null;case"MultiPolygon":var e=[];if(Object(G.flattenEach)(t,(function(t){1<j()(t)&&e.push(t.geometry.coordinates)})),e.length)return{type:"MultiPolygon",coordinates:e}}}S.Cut=S.Polygon.extend({initialize:function(t){this._map=t,this._shape="Cut",this.toolbarButtonName="cutPolygon"},_cut:function(t){var e=this,r=this._map._layers;Object.keys(r).map((function(t){return r[t]})).filter((function(t){return t.pm})).filter((function(t){return t instanceof L.Polygon})).filter((function(e){return e!==t})).filter((function(e){try{return!!B()(t.toGeoJSON(15),e.toGeoJSON(15))}catch(t){return console.error("You cant cut polygons with self-intersections"),!1}})).forEach((function(r){var n=function(t,e){var r=Object(R.getGeom)(t),n=Object(R.getGeom)(e),i=t.properties||{};if(r=A(r),n=A(n),!r)return null;if(!n)return Object(I.feature)(r,i);var o=T.diff(r.coordinates,n.coordinates);return 0===o.length?null:1===o.length?Object(I.polygon)(o[0],i):Object(I.multiPolygon)(o,i)}(r.toGeoJSON(15),t.toGeoJSON(15)),i=L.geoJSON(n,r.options).addTo(e._map);i.addTo(e._map),i.pm.enable(e.options),i.pm.disable(),r.fire("pm:cut",{shape:e._shape,layer:i,originalLayer:r}),e._map.fire("pm:cut",{shape:e._shape,layer:i,originalLayer:r}),r._pmTempLayer=!0,t._pmTempLayer=!0,r.remove(),t.remove(),0===i.getLayers().length&&e._map.pm.removeLayer({target:i})}))},_finishShape:function(){if(this.options.allowSelfIntersection||(this._handleSelfIntersection(!1),!this._doesSelfIntersect)){var t=this._layer.getLatLngs(),e=L.polygon(t,this.options.pathOptions);this._cut(e),this.disable(),this._cleanupSnapping(),this._otherSnapLayers.splice(this._tempSnapLayerIndex,1),delete this._tempSnapLayerIndex}}});var N={enableLayerDrag:function(){if(this._layer instanceof L.Marker)this._layer.dragging.enable();else{this._tempDragCoord=null;var t=this._layer._path?this._layer._path:this._layer._renderer._container;L.DomUtil.addClass(t,"leaflet-pm-draggable"),this._originalMapDragState=this._layer._map.dragging._enabled,this._safeToCacheDragState=!0,this._layer.on("mousedown",this._dragMixinOnMouseDown,this)}},disableLayerDrag:function(){if(this._layer instanceof L.Marker)this._layer.dragging.disable();else{var t=this._layer._path?this._layer._path:this._layer._renderer._container;L.DomUtil.removeClass(t,"leaflet-pm-draggable"),this._safeToCacheDragState=!1,this._layer.off("mousedown",this._dragMixinOnMouseDown,this)}},_dragMixinOnMouseUp:function(){var t=this,e=this._layer._path?this._layer._path:this._layer._renderer._container;return this._originalMapDragState&&this._layer._map.dragging.enable(),this._safeToCacheDragState=!0,this._layer._map.off("mousemove",this._dragMixinOnMouseMove,this),this._layer._map.off("mouseup",this._dragMixinOnMouseUp,this),!!this._dragging&&(window.setTimeout((function(){t._dragging=!1,L.DomUtil.removeClass(e,"leaflet-pm-dragging"),t._layer.fire("pm:dragend"),t._fireEdit()}),10),!0)},_dragMixinOnMouseMove:function(t){var e=this._layer._path?this._layer._path:this._layer._renderer._container;this._dragging||(this._dragging=!0,L.DomUtil.addClass(e,"leaflet-pm-dragging"),this._layer.bringToFront(),this._originalMapDragState&&this._layer._map.dragging.disable(),this._layer.fire("pm:dragstart")),this._onLayerDrag(t)},_dragMixinOnMouseDown:function(t){0<t.originalEvent.button||(this._safeToCacheDragState&&(this._originalMapDragState=this._layer._map.dragging._enabled,this._safeToCacheDragState=!1),this._tempDragCoord=t.latlng,this._layer._map.on("mouseup",this._dragMixinOnMouseUp,this),this._layer._map.on("mousemove",this._dragMixinOnMouseMove,this))},dragging:function(){return this._dragging},_onLayerDrag:function(t){var e=t.latlng,r=e.lat-this._tempDragCoord.lat,n=e.lng-this._tempDragCoord.lng;if(this._layer instanceof L.CircleMarker)this._layer.setLatLng(e);else{var i=function t(e){return e.map((function(e){return Array.isArray(e)?t(e):{lat:e.lat+r,lng:e.lng+n}}))}(this._layer.getLatLngs());this._layer.setLatLngs(i)}this._tempDragCoord=e,this._layer.fire("pm:drag",t)}},z=L.Class.extend({includes:[N,x],options:{snappable:!0,snapDistance:20,allowSelfIntersection:!0,draggable:!0},isPolygon:function(){return this._layer instanceof L.Polygon}});z.LayerGroup=L.Class.extend({initialize:function(t){var e=this;this._layerGroup=t,this._layers=this.findLayers(),this._layers.forEach((function(t){return e._initLayer(t)})),this._layerGroup.on("layeradd",(function(t){t.target._pmTempLayer||(e._layers=e.findLayers(),t.layer.pm&&e._initLayer(t.layer),t.target.pm.enabled()&&e.enable(e.getOptions()))}))},findLayers:function(){var t=this._layerGroup.getLayers();return(t=(t=t.filter((function(t){return!(t instanceof L.LayerGroup)}))).filter((function(t){return!!t.pm}))).filter((function(t){return!t._pmTempLayer}))},_initLayer:function(t){var e=this;["pm:edit","pm:update","pm:remove","pm:dragstart","pm:drag","pm:dragend","pm:snap","pm:unsnap","pm:cut","pm:intersect","pm:raiseMarkers","pm:markerdragend","pm:markerdragstart","pm:vertexadded","pm:vertexremoved","pm:centerplaced"].forEach((function(r){t.on(r,e._fireEvent,e)})),t.pm._layerGroup=this._layerGroup},_fireEvent:function(t){this._layerGroup.fireEvent(t.type,t)},toggleEdit:function(t){this._options=t,this._layers.forEach((function(e){e.pm.toggleEdit(t)}))},enable:function(t){this._options=t,this._layers.forEach((function(e){e.pm.enable(t)}))},disable:function(){this._layers.forEach((function(t){t.pm.disable()}))},enabled:function(){var t=this._layers.find((function(t){return t.pm.enabled()}));return!!t},dragging:function(){var t=this._layers.find((function(t){return t.pm.dragging()}));return!!t},getOptions:function(){return this._options}}),z.Marker=z.extend({initialize:function(t){this._layer=t,this._enabled=!1,this._layer.on("dragend",this._onDragEnd,this)},toggleEdit:function(t){this.enabled()?this.disable():this.enable(t)},enable:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{draggable:!0,snappable:!0};L.Util.setOptions(this,t),this._map=this._layer._map,this.enabled()||(this._enabled=!0,this.options.preventMarkerRemoval||this._layer.on("contextmenu",this._removeMarker,this),this.options.draggable&&this._layer.dragging.enable(),this.options.snappable&&this._initSnappableMarkers())},enabled:function(){return this._enabled},disable:function(){this._enabled=!1,this._layer.dragging&&this._layer.dragging.disable(),this._layer.off("contextmenu",this._removeMarker,this),this._layerEdited&&this._layer.fire("pm:update",{}),this._layerEdited=!1},_removeMarker:function(t){var e=t.target;e.remove(),e.fire("pm:remove")},_onDragEnd:function(t){t.target.fire("pm:edit"),this._layerEdited=!0},_initSnappableMarkers:function(){var t=this._layer;this.options.snapDistance=this.options.snapDistance||30,t.off("drag",this._handleSnapping,this),t.on("drag",this._handleSnapping,this),t.off("dragend",this._cleanupSnapping,this),t.on("dragend",this._cleanupSnapping,this),t.off("pm:dragstart",this._unsnap,this),t.on("pm:dragstart",this._unsnap,this)}}),z.Line=z.extend({initialize:function(t){this._layer=t,this._enabled=!1},toggleEdit:function(t){return this.enabled()?this.disable():this.enable(t),this.enabled()},enable:function(t){L.Util.setOptions(this,t),this._map=this._layer._map,this._map&&(this.enabled()||this.disable(),this._enabled=!0,this._initMarkers(),this._layer.on("remove",this._onLayerRemove,this),this.options.allowSelfIntersection||this._layer.on("pm:vertexremoved",this._handleSelfIntersectionOnVertexRemoval,this),this.options.allowSelfIntersection||(this.cachedColor=this._layer.options.color,this.isRed=!1,this._handleLayerStyle()))},_onLayerRemove:function(t){this.disable(t.target)},enabled:function(){return this._enabled},disable:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this._layer;if(!this.enabled())return!1;if(t.pm._dragging)return!1;t.pm._enabled=!1,t.pm._markerGroup.clearLayers(),t.off("mousedown"),t.off("mouseup"),this._layer.off("remove",this._onLayerRemove,this),this.options.allowSelfIntersection||this._layer.off("pm:vertexremoved",this._handleSelfIntersectionOnVertexRemoval);var e=t._path?t._path:this._layer._renderer._container;return L.DomUtil.removeClass(e,"leaflet-pm-draggable"),this.hasSelfIntersection()&&L.DomUtil.removeClass(e,"leaflet-pm-invalid"),this._layerEdited&&this._layer.fire("pm:update",{}),!(this._layerEdited=!1)},hasSelfIntersection:function(){return 0<P()(this._layer.toGeoJSON(15)).features.length},_handleSelfIntersectionOnVertexRemoval:function(){this._handleLayerStyle(!0),this.hasSelfIntersection()&&(this._layer.setLatLngs(this._coordsBeforeEdit),this._coordsBeforeEdit=null,this._initMarkers())},_handleLayerStyle:function(t){var e=this,r=this._layer;if(this.hasSelfIntersection()){if(this.isRed)return;t?(r.setStyle({color:"red"}),this.isRed=!0,window.setTimeout((function(){r.setStyle({color:e.cachedColor}),e.isRed=!1}),200)):(r.setStyle({color:"red"}),this.isRed=!0),this._layer.fire("pm:intersect",{intersection:P()(this._layer.toGeoJSON(15))})}else r.setStyle({color:this.cachedColor}),this.isRed=!1},_initMarkers:function(){var t=this,e=this._map,r=this._layer.getLatLngs();this._markerGroup&&this._markerGroup.clearLayers(),this._markerGroup=new L.LayerGroup,this._markerGroup._pmTempLayer=!0,e.addLayer(this._markerGroup);this._markers=function e(r){if(Array.isArray(r[0]))return r.map(e,t);var n=r.map(t._createMarker,t);return r.map((function(e,i){var o=t.isPolygon()?(i+1)%r.length:i+1;return t._createMiddleMarker(n[i],n[o])})),n}(r),this.options.snappable&&this._initSnappableMarkers()},_createMarker:function(t){var e=new L.Marker(t,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return e._pmTempLayer=!0,e.on("dragstart",this._onMarkerDragStart,this),e.on("move",this._onMarkerDrag,this),e.on("dragend",this._onMarkerDragEnd,this),this.options.preventMarkerRemoval||e.on("contextmenu",this._removeMarker,this),this._markerGroup.addLayer(e),e},_createMiddleMarker:function(t,e){var r=this;if(!t||!e)return!1;var n=C(this._map,t.getLatLng(),e.getLatLng()),i=this._createMarker(n),o=L.divIcon({className:"marker-icon marker-icon-middle"});return i.setIcon(o),t._middleMarkerNext=i,(e._middleMarkerPrev=i).on("click",(function(){var n=L.divIcon({className:"marker-icon"});i.setIcon(n),r._addMarker(i,t,e)})),i.on("movestart",(function(){i.on("moveend",(function(){var t=L.divIcon({className:"marker-icon"});i.setIcon(t),i.off("moveend")})),r._addMarker(i,t,e)})),i},_addMarker:function(t,e,r){t.off("movestart"),t.off("click");var n=t.getLatLng(),i=this._layer._latlngs,o=this.findDeepMarkerIndex(this._markers,e),a=o.indexPath,s=o.index,l=o.parentPath,h=1<a.length?y()(i,l):i,c=1<a.length?y()(this._markers,l):this._markers;h.splice(s+1,0,n),c.splice(s+1,0,t),this._layer.setLatLngs(i),this._createMiddleMarker(e,t),this._createMiddleMarker(t,r),this._fireEdit(),this._layer.fire("pm:vertexadded",{layer:this._layer,marker:t,indexPath:this.findDeepMarkerIndex(this._markers,t).indexPath,latlng:n}),this.options.snappable&&this._initSnappableMarkers()},_removeMarker:function(t){if(!this.options.allowSelfIntersection){var e=this._layer.getLatLngs();this._coordsBeforeEdit=JSON.parse(JSON.stringify(e))}var r=t.target,n=this._layer.getLatLngs(),i=this.findDeepMarkerIndex(this._markers,r),o=i.indexPath,a=i.index,s=i.parentPath;if(o){var l,h,c=1<o.length?y()(n,s):n,u=1<o.length?y()(this._markers,s):this._markers;if(c.splice(a,1),this._layer.setLatLngs(n),c.length<=1&&(c.splice(0,c.length),this._layer.setLatLngs(n),this.disable(),this.enable(this.options)),function(t){return!function t(e){return e.filter((function(t){return![null,"",void 0].includes(t)})).reduce((function(e,r){return e.concat(Array.isArray(r)?t(r):r)}),[])}(t).length}(n)&&this._layer.remove(),r._middleMarkerPrev&&this._markerGroup.removeLayer(r._middleMarkerPrev),r._middleMarkerNext&&this._markerGroup.removeLayer(r._middleMarkerNext),this._markerGroup.removeLayer(r),this.isPolygon()?(l=(a+1)%u.length,h=(a+(u.length-1))%u.length):(h=a-1<0?void 0:a-1,l=a+1>=u.length?void 0:a+1),l!==h){var p=u[h],f=u[l];this._createMiddleMarker(p,f)}u.splice(a,1),this._fireEdit(),this._layer.fire("pm:vertexremoved",{layer:this._layer,marker:r,indexPath:o})}},findDeepMarkerIndex:function(t,e){var r;t.some(function t(n){return function(i,o){var a=n.concat(o);return i._leaflet_id===e._leaflet_id?(r=a,!0):Array.isArray(i)&&i.some(t(a))}}([]));var n={};return r&&(n={indexPath:r,index:r[r.length-1],parentPath:r.slice(0,r.length-1)}),n},updatePolygonCoordsFromMarkerDrag:function(t){var e=this._layer.getLatLngs(),r=t.getLatLng(),n=this.findDeepMarkerIndex(this._markers,t),i=n.indexPath,o=n.index,a=n.parentPath;(1<i.length?y()(e,a):e).splice(o,1,r),this._layer.setLatLngs(e)},_onMarkerDrag:function(t){var e=t.target,r=this.findDeepMarkerIndex(this._markers,e),n=r.indexPath,i=r.index,o=r.parentPath;if(n){this.updatePolygonCoordsFromMarkerDrag(e);var a=1<n.length?y()(this._markers,o):this._markers,s=(i+1)%a.length,l=(i+(a.length-1))%a.length,h=e.getLatLng(),c=a[l].getLatLng(),u=a[s].getLatLng();if(e._middleMarkerNext){var p=C(this._map,h,u);e._middleMarkerNext.setLatLng(p)}if(e._middleMarkerPrev){var f=C(this._map,h,c);e._middleMarkerPrev.setLatLng(f)}this.options.allowSelfIntersection||this._handleLayerStyle()}},_onMarkerDragEnd:function(t){var e=t.target,r=this.findDeepMarkerIndex(this._markers,e).indexPath;if(!this.options.allowSelfIntersection&&this.hasSelfIntersection())return this._layer.setLatLngs(this._coordsBeforeEdit),this._coordsBeforeEdit=null,this._initMarkers(),void this._handleLayerStyle();this._layer.fire("pm:markerdragend",{markerEvent:t,indexPath:r}),this._fireEdit()},_onMarkerDragStart:function(t){var e=t.target,r=this.findDeepMarkerIndex(this._markers,e).indexPath;this._layer.fire("pm:markerdragstart",{markerEvent:t,indexPath:r}),this.options.allowSelfIntersection||(this._coordsBeforeEdit=this._layer.getLatLngs()),this.cachedColor=this._layer.options.color},_fireEdit:function(){this._layerEdited=!0,this._layer.fire("pm:edit")}}),z.Polygon=z.Line.extend({}),z.Rectangle=z.Polygon.extend({_initMarkers:function(){var t=this._map,e=this._findCorners();this._markerGroup&&this._markerGroup.clearLayers(),this._markerGroup=new L.LayerGroup,this._markerGroup._pmTempLayer=!0,t.addLayer(this._markerGroup),this._markers=[],this._markers[0]=e.map(this._createMarker,this);var r=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(this._markers,1);this._cornerMarkers=r[0],this.options.snappable&&this._initSnappableMarkers()},_createMarker:function(t,e){var r=new L.Marker(t,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return r._origLatLng=t,r._index=e,r._pmTempLayer=!0,r.on("dragstart",this._onMarkerDragStart,this),r.on("drag",this._onMarkerDrag,this),r.on("dragend",this._onMarkerDragEnd,this),r.on("pm:snap",this._adjustRectangleForMarkerSnap,this),this.options.preventMarkerRemoval||r.on("contextmenu",this._removeMarker,this),this._markerGroup.addLayer(r),r},_removeMarker:function(){return null},_onMarkerDragStart:function(t){var e=t.target,r=this._findCorners();e._oppositeCornerLatLng=r[(e._index+2)%4],e._snapped=!1,this._layer.fire("pm:markerdragstart",{markerEvent:t})},_onMarkerDrag:function(t){var e=t.target;void 0!==e._index&&(e._snapped||this._adjustRectangleForMarkerMove(e))},_onMarkerDragEnd:function(t){var e=this._findCorners();this._adjustAllMarkers(e),this._cornerMarkers.forEach((function(t){delete t._oppositeCornerLatLng})),this._layer.setLatLngs(e),this._layer.fire("pm:markerdragend",{markerEvent:t}),this._fireEdit()},_adjustRectangleForMarkerMove:function(t){L.extend(t._origLatLng,t._latlng);var e=t.getLatLng();this._layer.setBounds(L.latLngBounds(e,t._oppositeCornerLatLng)),this._adjustAdjacentMarkers(t),this._layer.redraw()},_adjustRectangleForMarkerSnap:function(t){if(this.options.snappable){var e=t.target;this._adjustRectangleForMarkerMove(e)}},_adjustAllMarkers:function(t){t.length&&4===t.length?this._cornerMarkers.forEach((function(e,r){e.setLatLng(t[r])})):console.error("_adjustAllMarkers() requires an array of EXACTLY 4 LatLng coordinates")},_adjustAdjacentMarkers:function(t){if(t&&t.getLatLng&&t._oppositeCornerLatLng){var e=t.getLatLng(),r=t._oppositeCornerLatLng,n=[];this._findCorners().forEach((function(t){t.equals(e)||t.equals(r)||n.push(t)}));var i=0;2===n.length&&this._cornerMarkers.forEach((function(t){var o=t.getLatLng();o.equals(e)||o.equals(r)||(t.setLatLng(n[i]),i+=1)}))}else console.error("_adjustAdjacentMarkers() requires a valid Marker object")},_findCorners:function(){var t=this._layer.getBounds();return[t.getNorthWest(),t.getNorthEast(),t.getSouthEast(),t.getSouthWest()]}}),z.Circle=z.extend({initialize:function(t){this._layer=t,this._enabled=!1},toggleEdit:function(t){this.enabled()?this.disable():this.enable(t)},enabled:function(){return this._enabled},enable:function(t){var e=this;L.Util.setOptions(this,t),this._map=this._layer._map,this.enabled()||this.disable(),this._enabled=!0,this._initMarkers(),this._layer.on("remove",(function(t){e.disable(t.target)}))},disable:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this._layer;if(!this.enabled())return!1;if(t.pm._dragging)return!1;t.pm._enabled=!1,t.pm._helperLayers.clearLayers(),t.off("mousedown"),t.off("mouseup");var e=t._path?t._path:this._layer._renderer._container;return L.DomUtil.removeClass(e,"leaflet-pm-draggable"),this._layerEdited&&this._layer.fire("pm:update",{}),!(this._layerEdited=!1)},_initMarkers:function(){var t=this._map;this._helperLayers&&this._helperLayers.clearLayers(),this._helperLayers=new L.LayerGroup,this._helperLayers._pmTempLayer=!0,this._helperLayers.addTo(t);var e=this._layer.getLatLng(),r=this._layer._radius,n=this._getLatLngOnCircle(e,r);this._centerMarker=this._createCenterMarker(e),this._outerMarker=this._createOuterMarker(n),this._markers=[this._centerMarker,this._outerMarker],this._createHintLine(this._centerMarker,this._outerMarker),this.options.snappable&&this._initSnappableMarkers()},_getLatLngOnCircle:function(t,e){var r=this._map.project(t),n=L.point(r.x+e,r.y);return this._map.unproject(n)},_resizeCircle:function(){this._syncHintLine(),this._syncCircleRadius()},_moveCircle:function(t){var e=t.latlng;this._layer.setLatLng(e);var r=this._layer._radius,n=this._getLatLngOnCircle(e,r);this._outerMarker.setLatLng(n),this._syncHintLine(),this._layer.fire("pm:centerplaced",{layer:this._layer,latlng:e})},_onMarkerDragStart:function(t){this._layer.fire("pm:markerdragstart",{markerEvent:t})},_onMarkerDragEnd:function(t){this._fireEdit(),this._layer.fire("pm:markerdragend",{markerEvent:t})},_syncCircleRadius:function(){var t=this._centerMarker.getLatLng(),e=this._outerMarker.getLatLng(),r=t.distanceTo(e);this._layer.setRadius(r)},_syncHintLine:function(){var t=this._centerMarker.getLatLng(),e=this._outerMarker.getLatLng();this._hintline.setLatLngs([t,e])},_createHintLine:function(t,e){var r=t.getLatLng(),n=e.getLatLng();this._hintline=L.polyline([r,n],this.options.hintlineStyle),this._hintline._pmTempLayer=!0,this._helperLayers.addLayer(this._hintline)},_createCenterMarker:function(t){var e=this._createMarker(t);return L.DomUtil.addClass(e._icon,"leaflet-pm-draggable"),e.on("drag",this._moveCircle,this),e},_createOuterMarker:function(t){var e=this._createMarker(t);return e.on("drag",this._resizeCircle,this),e},_createMarker:function(t){var e=new L.Marker(t,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return e._origLatLng=t,e._pmTempLayer=!0,e.on("dragstart",this._onMarkerDragStart,this),e.on("dragend",this._onMarkerDragEnd,this),this._helperLayers.addLayer(e),e},_fireEdit:function(){this._layer.fire("pm:edit"),this._layerEdited=!0}}),z.CircleMarker=z.extend({initialize:function(t){this._layer=t,this._enabled=!1},toggleEdit:function(t){this.enabled()?this.disable():this.enable(t)},enabled:function(){return this._enabled},enable:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{draggable:!0,snappable:!0};L.Util.setOptions(this,t),this._map=this._layer._map,this._map&&(this.enabled()||this.disable(),this._enabled=!0,this.options.preventMarkerRemoval||this._layer.on("contextmenu",this._removeMarker,this),this.options.draggable&&this.enableLayerDrag(),this.options.snappable&&this._initSnappableMarkers(),this._layer.on("pm:dragend",this._onMarkerDragEnd,this))},disable:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this._layer;if(!this.enabled())return!1;if(t.pm._dragging)return!1;if(t.pm._enabled=!1,t._path){var e=t._path;L.DomUtil.removeClass(e,"leaflet-pm-draggable")}return this._layerEdited&&this._layer.fire("pm:update",{}),!(this._layerEdited=!1)},_moveMarker:function(t){var e=t.latlng;this._layer.setLatLng(e).redraw()},_removeMarker:function(){this._layer.fire("pm:remove"),this._layer.remove()},_fireEdit:function(){this._layer.fire("pm:edit"),this._layerEdited=!0},_onMarkerDragEnd:function(t){this._layer.fire("pm:markerdragend",{markerEvent:t}),this._fireEdit()},_initSnappableMarkers:function(){var t=this._layer;this.options.snapDistance=this.options.snapDistance||30,t.off("pm:drag",this._handleSnapping,this),t.on("pm:drag",this._handleSnapping,this),t.off("pm:dragend",this._cleanupSnapping,this),t.on("pm:dragend",this._cleanupSnapping,this),t.off("pm:dragstart",this._unsnap,this),t.on("pm:dragstart",this._unsnap,this)}}),r(133),r(134),L.PM=L.PM||{version:n.a,Map:_,Toolbar:w,Draw:S,Edit:z,activeLang:"en",initialize:function(t){this.addInitHooks(t)},addInitHooks:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};L.Map.addInitHook((function(){this.pm=void 0,t.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Map(this)):this.options.pmIgnore||(this.pm=new L.PM.Map(this))})),L.LayerGroup.addInitHook((function(){this.pm=new L.PM.Edit.LayerGroup(this)})),L.Marker.addInitHook((function(){this.pm=void 0,t.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Edit.Marker(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Marker(this))})),L.CircleMarker.addInitHook((function(){this.pm=void 0,t.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Edit.CircleMarker(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.CircleMarker(this))})),L.Polyline.addInitHook((function(){this.pm=void 0,t.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Edit.Line(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Line(this))})),L.Polygon.addInitHook((function(){this.pm=void 0,t.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Edit.Polygon(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Polygon(this))})),L.Rectangle.addInitHook((function(){this.pm=void 0,t.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Edit.Rectangle(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Rectangle(this))})),L.Circle.addInitHook((function(){this.pm=void 0,t.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Edit.Circle(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Circle(this))}))}},L.PM.initialize()}]);
@@ -0,0 +1,5 @@
1
+ /* @preserve
2
+ * Leaflet 1.5.1+Detached: 2e3e0ffbe87f246eb76d86d2633ddd59b262830b.2e3e0ff, a JS library for interactive maps. http://leafletjs.com
3
+ * (c) 2010-2018 Vladimir Agafonkin, (c) 2010-2011 CloudMade
4
+ */
5
+ !function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i(t.L={})}(this,function(t){"use strict";var i=Object.freeze;function h(t){var i,e,n,o;for(e=1,n=arguments.length;e<n;e++)for(i in o=arguments[e])t[i]=o[i];return t}Object.freeze=function(t){return t};var s=Object.create||function(t){return e.prototype=t,new e};function e(){}function a(t,i){var e=Array.prototype.slice;if(t.bind)return t.bind.apply(t,e.call(arguments,1));var n=e.call(arguments,2);return function(){return t.apply(i,n.length?n.concat(e.call(arguments)):arguments)}}var n=0;function u(t){return t._leaflet_id=t._leaflet_id||++n,t._leaflet_id}function o(t,i,e){var n,o,s,r;return r=function(){n=!1,o&&(s.apply(e,o),o=!1)},s=function(){n?o=arguments:(t.apply(e,arguments),setTimeout(r,i),n=!0)}}function r(t,i,e){var n=i[1],o=i[0],s=n-o;return t===n&&e?t:((t-o)%s+s)%s+o}function l(){return!1}function c(t,i){return i=void 0===i?6:i,+(Math.round(t+"e+"+i)+"e-"+i)}function _(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function d(t){return _(t).split(/\s+/)}function p(t,i){for(var e in t.hasOwnProperty("options")||(t.options=t.options?s(t.options):{}),i)t.options[e]=i[e];return t.options}function m(t,i,e){var n=[];for(var o in t)n.push(encodeURIComponent(e?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(i&&-1!==i.indexOf("?")?"&":"?")+n.join("&")}var f=/\{ *([\w_-]+) *\}/g;function g(t,n){return t.replace(f,function(t,i){var e=n[i];if(void 0===e)throw new Error("No value provided for variable "+t);return"function"==typeof e&&(e=e(n)),e})}var v=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function y(t,i){for(var e=0;e<t.length;e++)if(t[e]===i)return e;return-1}var x="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function w(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var P=0;function b(t){var i=+new Date,e=Math.max(0,16-(i-P));return P=i+e,window.setTimeout(t,e)}var T=window.requestAnimationFrame||w("RequestAnimationFrame")||b,z=window.cancelAnimationFrame||w("CancelAnimationFrame")||w("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function M(t,i,e){if(!e||T!==b)return T.call(window,a(t,i));t.call(i)}function C(t){t&&z.call(window,t)}var S=(Object.freeze||Object)({freeze:i,extend:h,create:s,bind:a,lastId:n,stamp:u,throttle:o,wrapNum:r,falseFn:l,formatNum:c,trim:_,splitWords:d,setOptions:p,getParamString:m,template:g,isArray:v,indexOf:y,emptyImageUrl:x,requestFn:T,cancelFn:z,requestAnimFrame:M,cancelAnimFrame:C});function Z(){}Z.extend=function(t){function i(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()}var e=i.__super__=this.prototype,n=s(e);for(var o in(n.constructor=i).prototype=n,this)this.hasOwnProperty(o)&&"prototype"!==o&&"__super__"!==o&&(i[o]=this[o]);return t.statics&&(h(i,t.statics),delete t.statics),t.includes&&(function(t){if("undefined"==typeof L||!L||!L.Mixin)return;t=v(t)?t:[t];for(var i=0;i<t.length;i++)t[i]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}(t.includes),h.apply(null,[n].concat(t.includes)),delete t.includes),n.options&&(t.options=h(s(n.options),t.options)),h(n,t),n._initHooks=[],n.callInitHooks=function(){if(!this._initHooksCalled){e.callInitHooks&&e.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,i=n._initHooks.length;t<i;t++)n._initHooks[t].call(this)}},i},Z.include=function(t){return h(this.prototype,t),this},Z.mergeOptions=function(t){return h(this.prototype.options,t),this},Z.addInitHook=function(t){var i=Array.prototype.slice.call(arguments,1),e="function"==typeof t?t:function(){this[t].apply(this,i)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(e),this};var E={on:function(t,i,e){if("object"==typeof t)for(var n in t)this._on(n,t[n],i);else for(var o=0,s=(t=d(t)).length;o<s;o++)this._on(t[o],i,e);return this},off:function(t,i,e){if(t)if("object"==typeof t)for(var n in t)this._off(n,t[n],i);else for(var o=0,s=(t=d(t)).length;o<s;o++)this._off(t[o],i,e);else delete this._events;return this},_on:function(t,i,e){this._events=this._events||{};var n=this._events[t];n||(n=[],this._events[t]=n),e===this&&(e=void 0);for(var o={fn:i,ctx:e},s=n,r=0,a=s.length;r<a;r++)if(s[r].fn===i&&s[r].ctx===e)return;s.push(o)},_off:function(t,i,e){var n,o,s;if(this._events&&(n=this._events[t]))if(i){if(e===this&&(e=void 0),n)for(o=0,s=n.length;o<s;o++){var r=n[o];if(r.ctx===e&&r.fn===i)return r.fn=l,this._firingCount&&(this._events[t]=n=n.slice()),void n.splice(o,1)}}else{for(o=0,s=n.length;o<s;o++)n[o].fn=l;delete this._events[t]}},fire:function(t,i,e){if(!this.listens(t,e))return this;var n=h({},i,{type:t,target:this,sourceTarget:i&&i.sourceTarget||this});if(this._events){var o=this._events[t];if(o){this._firingCount=this._firingCount+1||1;for(var s=0,r=o.length;s<r;s++){var a=o[s];a.fn.call(a.ctx||this,n)}this._firingCount--}}return e&&this._propagateEvent(n),this},listens:function(t,i){var e=this._events&&this._events[t];if(e&&e.length)return!0;if(i)for(var n in this._eventParents)if(this._eventParents[n].listens(t,i))return!0;return!1},once:function(t,i,e){if("object"==typeof t){for(var n in t)this.once(n,t[n],i);return this}var o=a(function(){this.off(t,i,e).off(t,o,e)},this);return this.on(t,i,e).on(t,o,e)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[u(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[u(t)],this},_propagateEvent:function(t){for(var i in this._eventParents)this._eventParents[i].fire(t.type,h({layer:t.target,propagatedFrom:t.target},t),!0)}};E.addEventListener=E.on,E.removeEventListener=E.clearAllEventListeners=E.off,E.addOneTimeEventListener=E.once,E.fireEvent=E.fire,E.hasEventListeners=E.listens;var k=Z.extend(E);function B(t,i,e){this.x=e?Math.round(t):t,this.y=e?Math.round(i):i}var A=Math.trunc||function(t){return 0<t?Math.floor(t):Math.ceil(t)};function I(t,i,e){return t instanceof B?t:v(t)?new B(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new B(t.x,t.y):new B(t,i,e)}function O(t,i){if(t)for(var e=i?[t,i]:t,n=0,o=e.length;n<o;n++)this.extend(e[n])}function R(t,i){return!t||t instanceof O?t:new O(t,i)}function N(t,i){if(t)for(var e=i?[t,i]:t,n=0,o=e.length;n<o;n++)this.extend(e[n])}function D(t,i){return t instanceof N?t:new N(t,i)}function j(t,i,e){if(isNaN(t)||isNaN(i))throw new Error("Invalid LatLng object: ("+t+", "+i+")");this.lat=+t,this.lng=+i,void 0!==e&&(this.alt=+e)}function W(t,i,e){return t instanceof j?t:v(t)&&"object"!=typeof t[0]?3===t.length?new j(t[0],t[1],t[2]):2===t.length?new j(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new j(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===i?null:new j(t,i,e)}B.prototype={clone:function(){return new B(this.x,this.y)},add:function(t){return this.clone()._add(I(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(I(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new B(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new B(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=A(this.x),this.y=A(this.y),this},distanceTo:function(t){var i=(t=I(t)).x-this.x,e=t.y-this.y;return Math.sqrt(i*i+e*e)},equals:function(t){return(t=I(t)).x===this.x&&t.y===this.y},contains:function(t){return t=I(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+c(this.x)+", "+c(this.y)+")"}},O.prototype={extend:function(t){return t=I(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new B((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new B(this.min.x,this.max.y)},getTopRight:function(){return new B(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var i,e;return(t="number"==typeof t[0]||t instanceof B?I(t):R(t))instanceof O?(i=t.min,e=t.max):i=e=t,i.x>=this.min.x&&e.x<=this.max.x&&i.y>=this.min.y&&e.y<=this.max.y},intersects:function(t){t=R(t);var i=this.min,e=this.max,n=t.min,o=t.max,s=o.x>=i.x&&n.x<=e.x,r=o.y>=i.y&&n.y<=e.y;return s&&r},overlaps:function(t){t=R(t);var i=this.min,e=this.max,n=t.min,o=t.max,s=o.x>i.x&&n.x<e.x,r=o.y>i.y&&n.y<e.y;return s&&r},isValid:function(){return!(!this.min||!this.max)}},N.prototype={extend:function(t){var i,e,n=this._southWest,o=this._northEast;if(t instanceof j)e=i=t;else{if(!(t instanceof N))return t?this.extend(W(t)||D(t)):this;if(i=t._southWest,e=t._northEast,!i||!e)return this}return n||o?(n.lat=Math.min(i.lat,n.lat),n.lng=Math.min(i.lng,n.lng),o.lat=Math.max(e.lat,o.lat),o.lng=Math.max(e.lng,o.lng)):(this._southWest=new j(i.lat,i.lng),this._northEast=new j(e.lat,e.lng)),this},pad:function(t){var i=this._southWest,e=this._northEast,n=Math.abs(i.lat-e.lat)*t,o=Math.abs(i.lng-e.lng)*t;return new N(new j(i.lat-n,i.lng-o),new j(e.lat+n,e.lng+o))},getCenter:function(){return new j((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new j(this.getNorth(),this.getWest())},getSouthEast:function(){return new j(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof j||"lat"in t?W(t):D(t);var i,e,n=this._southWest,o=this._northEast;return t instanceof N?(i=t.getSouthWest(),e=t.getNorthEast()):i=e=t,i.lat>=n.lat&&e.lat<=o.lat&&i.lng>=n.lng&&e.lng<=o.lng},intersects:function(t){t=D(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=i.lat&&n.lat<=e.lat,r=o.lng>=i.lng&&n.lng<=e.lng;return s&&r},overlaps:function(t){t=D(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>i.lat&&n.lat<e.lat,r=o.lng>i.lng&&n.lng<e.lng;return s&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,i){return!!t&&(t=D(t),this._southWest.equals(t.getSouthWest(),i)&&this._northEast.equals(t.getNorthEast(),i))},isValid:function(){return!(!this._southWest||!this._northEast)}};var H,F={latLngToPoint:function(t,i){var e=this.projection.project(t),n=this.scale(i);return this.transformation._transform(e,n)},pointToLatLng:function(t,i){var e=this.scale(i),n=this.transformation.untransform(t,e);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var i=this.projection.bounds,e=this.scale(t);return new O(this.transformation.transform(i.min,e),this.transformation.transform(i.max,e))},infinite:!(j.prototype={equals:function(t,i){return!!t&&(t=W(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===i?1e-9:i))},toString:function(t){return"LatLng("+c(this.lat,t)+", "+c(this.lng,t)+")"},distanceTo:function(t){return U.distance(this,W(t))},wrap:function(){return U.wrapLatLng(this)},toBounds:function(t){var i=180*t/40075017,e=i/Math.cos(Math.PI/180*this.lat);return D([this.lat-i,this.lng-e],[this.lat+i,this.lng+e])},clone:function(){return new j(this.lat,this.lng,this.alt)}}),wrapLatLng:function(t){var i=this.wrapLng?r(t.lng,this.wrapLng,!0):t.lng;return new j(this.wrapLat?r(t.lat,this.wrapLat,!0):t.lat,i,t.alt)},wrapLatLngBounds:function(t){var i=t.getCenter(),e=this.wrapLatLng(i),n=i.lat-e.lat,o=i.lng-e.lng;if(0==n&&0==o)return t;var s=t.getSouthWest(),r=t.getNorthEast();return new N(new j(s.lat-n,s.lng-o),new j(r.lat-n,r.lng-o))}},U=h({},F,{wrapLng:[-180,180],R:6371e3,distance:function(t,i){var e=Math.PI/180,n=t.lat*e,o=i.lat*e,s=Math.sin((i.lat-t.lat)*e/2),r=Math.sin((i.lng-t.lng)*e/2),a=s*s+Math.cos(n)*Math.cos(o)*r*r,h=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*h}}),V=6378137,q={R:V,MAX_LATITUDE:85.0511287798,project:function(t){var i=Math.PI/180,e=this.MAX_LATITUDE,n=Math.max(Math.min(e,t.lat),-e),o=Math.sin(n*i);return new B(this.R*t.lng*i,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(t){var i=180/Math.PI;return new j((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*i,t.x*i/this.R)},bounds:(H=V*Math.PI,new O([-H,-H],[H,H]))};function G(t,i,e,n){if(v(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=i,this._c=e,this._d=n}function K(t,i,e,n){return new G(t,i,e,n)}G.prototype={transform:function(t,i){return this._transform(t.clone(),i)},_transform:function(t,i){return i=i||1,t.x=i*(this._a*t.x+this._b),t.y=i*(this._c*t.y+this._d),t},untransform:function(t,i){return i=i||1,new B((t.x/i-this._b)/this._a,(t.y/i-this._d)/this._c)}};var Y,X=h({},U,{code:"EPSG:3857",projection:q,transformation:(Y=.5/(Math.PI*q.R),K(Y,.5,-Y,.5))}),J=h({},X,{code:"EPSG:900913"});function $(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Q(t,i){var e,n,o,s,r,a,h="";for(e=0,o=t.length;e<o;e++){for(n=0,s=(r=t[e]).length;n<s;n++)h+=(n?"L":"M")+(a=r[n]).x+" "+a.y;h+=i?Zt?"z":"x":""}return h||"M0 0"}var tt=document.documentElement.style,it="ActiveXObject"in window,et=it&&!document.addEventListener,nt="msLaunchUri"in navigator&&!("documentMode"in document),ot=kt("webkit"),st=kt("android"),rt=kt("android 2")||kt("android 3"),at=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),ht=st&&kt("Google")&&at<537&&!("AudioNode"in window),ut=!!window.opera,lt=kt("chrome"),ct=kt("gecko")&&!ot&&!ut&&!it,_t=!lt&&kt("safari"),dt=kt("phantom"),pt="OTransition"in tt,mt=0===navigator.platform.indexOf("Win"),ft=it&&"transition"in tt,gt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!rt,vt="MozPerspective"in tt,yt=!window.L_DISABLE_3D&&(ft||gt||vt)&&!pt&&!dt,xt="undefined"!=typeof orientation||kt("mobile"),wt=xt&&ot,Pt=xt&&gt,Lt=!window.PointerEvent&&window.MSPointerEvent,bt=!(!window.PointerEvent&&!Lt),Tt=!window.L_NO_TOUCH&&(bt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),zt=xt&&ut,Mt=xt&&ct,Ct=1<(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI),St=!!document.createElement("canvas").getContext,Zt=!(!document.createElementNS||!$("svg").createSVGRect),Et=!Zt&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(t){return!1}}();function kt(t){return 0<=navigator.userAgent.toLowerCase().indexOf(t)}var Bt=(Object.freeze||Object)({ie:it,ielt9:et,edge:nt,webkit:ot,android:st,android23:rt,androidStock:ht,opera:ut,chrome:lt,gecko:ct,safari:_t,phantom:dt,opera12:pt,win:mt,ie3d:ft,webkit3d:gt,gecko3d:vt,any3d:yt,mobile:xt,mobileWebkit:wt,mobileWebkit3d:Pt,msPointer:Lt,pointer:bt,touch:Tt,mobileOpera:zt,mobileGecko:Mt,retina:Ct,canvas:St,svg:Zt,vml:Et}),At=Lt?"MSPointerDown":"pointerdown",It=Lt?"MSPointerMove":"pointermove",Ot=Lt?"MSPointerUp":"pointerup",Rt=Lt?"MSPointerCancel":"pointercancel",Nt=["INPUT","SELECT","OPTION"],Dt={},jt=!1,Wt=0;function Ht(t,i,e,n){return"touchstart"===i?function(t,i,e){var n=a(function(t){if("mouse"!==t.pointerType&&t.MSPOINTER_TYPE_MOUSE&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE){if(!(Nt.indexOf(t.target.tagName)<0))return;Di(t)}qt(t,i)});t["_leaflet_touchstart"+e]=n,t.addEventListener(At,n,!1),jt||(document.documentElement.addEventListener(At,Ft,!0),document.documentElement.addEventListener(It,Ut,!0),document.documentElement.addEventListener(Ot,Vt,!0),document.documentElement.addEventListener(Rt,Vt,!0),jt=!0)}(t,e,n):"touchmove"===i?function(t,i,e){var n=function(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&qt(t,i)};t["_leaflet_touchmove"+e]=n,t.addEventListener(It,n,!1)}(t,e,n):"touchend"===i&&function(t,i,e){var n=function(t){qt(t,i)};t["_leaflet_touchend"+e]=n,t.addEventListener(Ot,n,!1),t.addEventListener(Rt,n,!1)}(t,e,n),this}function Ft(t){Dt[t.pointerId]=t,Wt++}function Ut(t){Dt[t.pointerId]&&(Dt[t.pointerId]=t)}function Vt(t){delete Dt[t.pointerId],Wt--}function qt(t,i){for(var e in t.touches=[],Dt)t.touches.push(Dt[e]);t.changedTouches=[t],i(t)}var Gt=Lt?"MSPointerDown":bt?"pointerdown":"touchstart",Kt=Lt?"MSPointerUp":bt?"pointerup":"touchend",Yt="_leaflet_";function Xt(t,o,i){var s,r,a=!1;function e(t){var i;if(bt){if(!nt||"mouse"===t.pointerType)return;i=Wt}else i=t.touches.length;if(!(1<i)){var e=Date.now(),n=e-(s||e);r=t.touches?t.touches[0]:t,a=0<n&&n<=250,s=e}}function n(t){if(a&&!r.cancelBubble){if(bt){if(!nt||"mouse"===t.pointerType)return;var i,e,n={};for(e in r)i=r[e],n[e]=i&&i.bind?i.bind(r):i;r=n}r.type="dblclick",r.button=0,o(r),s=null}}return t[Yt+Gt+i]=e,t[Yt+Kt+i]=n,t[Yt+"dblclick"+i]=o,t.addEventListener(Gt,e,!1),t.addEventListener(Kt,n,!1),t.addEventListener("dblclick",o,!1),this}function Jt(t,i){var e=t[Yt+Gt+i],n=t[Yt+Kt+i],o=t[Yt+"dblclick"+i];return t.removeEventListener(Gt,e,!1),t.removeEventListener(Kt,n,!1),nt||t.removeEventListener("dblclick",o,!1),this}var $t,Qt,ti,ii,ei,ni=yi(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),oi=yi(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),si="webkitTransition"===oi||"OTransition"===oi?oi+"End":"transitionend";function ri(t){return"string"==typeof t?document.getElementById(t):t}function ai(t,i){var e=t.style[i]||t.currentStyle&&t.currentStyle[i];if((!e||"auto"===e)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);e=n?n[i]:null}return"auto"===e?null:e}function hi(t,i,e){var n=document.createElement(t);return n.className=i||"",e&&e.appendChild(n),n}function ui(t){var i=t.parentNode;i&&i.removeChild(t)}function li(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ci(t){var i=t.parentNode;i&&i.lastChild!==t&&i.appendChild(t)}function _i(t){var i=t.parentNode;i&&i.firstChild!==t&&i.insertBefore(t,i.firstChild)}function di(t,i){if(void 0!==t.classList)return t.classList.contains(i);var e=gi(t);return 0<e.length&&new RegExp("(^|\\s)"+i+"(\\s|$)").test(e)}function pi(t,i){if(void 0!==t.classList)for(var e=d(i),n=0,o=e.length;n<o;n++)t.classList.add(e[n]);else if(!di(t,i)){var s=gi(t);fi(t,(s?s+" ":"")+i)}}function mi(t,i){void 0!==t.classList?t.classList.remove(i):fi(t,_((" "+gi(t)+" ").replace(" "+i+" "," ")))}function fi(t,i){void 0===t.className.baseVal?t.className=i:t.className.baseVal=i}function gi(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function vi(t,i){"opacity"in t.style?t.style.opacity=i:"filter"in t.style&&function(t,i){var e=!1,n="DXImageTransform.Microsoft.Alpha";try{e=t.filters.item(n)}catch(t){if(1===i)return}i=Math.round(100*i),e?(e.Enabled=100!==i,e.Opacity=i):t.style.filter+=" progid:"+n+"(opacity="+i+")"}(t,i)}function yi(t){for(var i=document.documentElement.style,e=0;e<t.length;e++)if(t[e]in i)return t[e];return!1}function xi(t,i,e){var n=i||new B(0,0);t.style[ni]=(ft?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(e?" scale("+e+")":"")}function wi(t,i){t._leaflet_pos=i,yt?xi(t,i):(t.style.left=i.x+"px",t.style.top=i.y+"px")}function Pi(t){return t._leaflet_pos||new B(0,0)}if("onselectstart"in document)$t=function(){Ei(window,"selectstart",Di)},Qt=function(){Bi(window,"selectstart",Di)};else{var Li=yi(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);$t=function(){if(Li){var t=document.documentElement.style;ti=t[Li],t[Li]="none"}},Qt=function(){Li&&(document.documentElement.style[Li]=ti,ti=void 0)}}function bi(){Ei(window,"dragstart",Di)}function Ti(){Bi(window,"dragstart",Di)}function zi(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Mi(),ei=(ii=t).style.outline,t.style.outline="none",Ei(window,"keydown",Mi))}function Mi(){ii&&(ii.style.outline=ei,ei=ii=void 0,Bi(window,"keydown",Mi))}function Ci(t){for(;!((t=t.parentNode).offsetWidth&&t.offsetHeight||t===document.body););return t}function Si(t){var i=t.getBoundingClientRect();return{x:i.width/t.offsetWidth||1,y:i.height/t.offsetHeight||1,boundingClientRect:i}}var Zi=(Object.freeze||Object)({TRANSFORM:ni,TRANSITION:oi,TRANSITION_END:si,get:ri,getStyle:ai,create:hi,remove:ui,empty:li,toFront:ci,toBack:_i,hasClass:di,addClass:pi,removeClass:mi,setClass:fi,getClass:gi,setOpacity:vi,testProp:yi,setTransform:xi,setPosition:wi,getPosition:Pi,disableTextSelection:$t,enableTextSelection:Qt,disableImageDrag:bi,enableImageDrag:Ti,preventOutline:zi,restoreOutline:Mi,getSizedParentNode:Ci,getScale:Si});function Ei(t,i,e,n){if("object"==typeof i)for(var o in i)Ai(t,o,i[o],e);else for(var s=0,r=(i=d(i)).length;s<r;s++)Ai(t,i[s],e,n);return this}var ki="_leaflet_events";function Bi(t,i,e,n){if("object"==typeof i)for(var o in i)Ii(t,o,i[o],e);else if(i)for(var s=0,r=(i=d(i)).length;s<r;s++)Ii(t,i[s],e,n);else{for(var a in t[ki])Ii(t,a,t[ki][a]);delete t[ki]}return this}function Ai(i,t,e,n){var o=t+u(e)+(n?"_"+u(n):"");if(i[ki]&&i[ki][o])return this;var s=function(t){return e.call(n||i,t||window.event)},r=s;bt&&0===t.indexOf("touch")?Ht(i,t,s,o):!Tt||"dblclick"!==t||bt&&lt?"addEventListener"in i?"mousewheel"===t?i.addEventListener("onwheel"in i?"wheel":"mousewheel",s,!1):"mouseenter"===t||"mouseleave"===t?(s=function(t){t=t||window.event,Ki(i,t)&&r(t)},i.addEventListener("mouseenter"===t?"mouseover":"mouseout",s,!1)):("click"===t&&st&&(s=function(t){!function(t,i){var e=t.timeStamp||t.originalEvent&&t.originalEvent.timeStamp,n=Ui&&e-Ui;if(n&&100<n&&n<500||t.target._simulatedClick&&!t._simulated)return ji(t);Ui=e,i(t)}(t,r)}),i.addEventListener(t,s,!1)):"attachEvent"in i&&i.attachEvent("on"+t,s):Xt(i,s,o),i[ki]=i[ki]||{},i[ki][o]=s}function Ii(t,i,e,n){var o=i+u(e)+(n?"_"+u(n):""),s=t[ki]&&t[ki][o];if(!s)return this;bt&&0===i.indexOf("touch")?function(t,i,e){var n=t["_leaflet_"+i+e];"touchstart"===i?t.removeEventListener(At,n,!1):"touchmove"===i?t.removeEventListener(It,n,!1):"touchend"===i&&(t.removeEventListener(Ot,n,!1),t.removeEventListener(Rt,n,!1))}(t,i,o):!Tt||"dblclick"!==i||bt&&lt?"removeEventListener"in t?"mousewheel"===i?t.removeEventListener("onwheel"in t?"wheel":"mousewheel",s,!1):t.removeEventListener("mouseenter"===i?"mouseover":"mouseleave"===i?"mouseout":i,s,!1):"detachEvent"in t&&t.detachEvent("on"+i,s):Jt(t,o),t[ki][o]=null}function Oi(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Gi(t),this}function Ri(t){return Ai(t,"mousewheel",Oi),this}function Ni(t){return Ei(t,"mousedown touchstart dblclick",Oi),Ai(t,"click",qi),this}function Di(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function ji(t){return Di(t),Oi(t),this}function Wi(t,i){if(!i)return new B(t.clientX,t.clientY);var e=Si(i),n=e.boundingClientRect;return new B((t.clientX-n.left)/e.x-i.clientLeft,(t.clientY-n.top)/e.y-i.clientTop)}var Hi=mt&&lt?2*window.devicePixelRatio:ct?window.devicePixelRatio:1;function Fi(t){return nt?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Hi:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}var Ui,Vi={};function qi(t){Vi[t.type]=!0}function Gi(t){var i=Vi[t.type];return Vi[t.type]=!1,i}function Ki(t,i){var e=i.relatedTarget;if(!e)return!0;try{for(;e&&e!==t;)e=e.parentNode}catch(t){return!1}return e!==t}var Yi=(Object.freeze||Object)({on:Ei,off:Bi,stopPropagation:Oi,disableScrollPropagation:Ri,disableClickPropagation:Ni,preventDefault:Di,stop:ji,getMousePosition:Wi,getWheelDelta:Fi,fakeStop:qi,skipped:Gi,isExternalTarget:Ki,addListener:Ei,removeListener:Bi}),Xi=k.extend({run:function(t,i,e,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=e||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=Pi(t),this._offset=i.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=M(this._animate,this),this._step()},_step:function(t){var i=+new Date-this._startTime,e=1e3*this._duration;i<e?this._runFrame(this._easeOut(i/e),t):(this._runFrame(1),this._complete())},_runFrame:function(t,i){var e=this._startPos.add(this._offset.multiplyBy(t));i&&e._round(),wi(this._el,e),this.fire("step")},_complete:function(){C(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),Ji=k.extend({options:{crs:X,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,i){i=p(this,i),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=a(this._onResize,this),this._initEvents(),i.maxBounds&&this.setMaxBounds(i.maxBounds),void 0!==i.zoom&&(this._zoom=this._limitZoom(i.zoom)),i.center&&void 0!==i.zoom&&this.setView(W(i.center),i.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=oi&&yt&&!zt&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Ei(this._proxy,si,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,i,e){if((i=void 0===i?this._zoom:this._limitZoom(i),t=this._limitCenter(W(t),i,this.options.maxBounds),e=e||{},this._stop(),this._loaded&&!e.reset&&!0!==e)&&(void 0!==e.animate&&(e.zoom=h({animate:e.animate},e.zoom),e.pan=h({animate:e.animate,duration:e.duration},e.pan)),this._zoom!==i?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,i,e.zoom):this._tryAnimatedPan(t,e.pan)))return clearTimeout(this._sizeTimer),this;return this._resetView(t,i),this},setZoom:function(t,i){return this._loaded?this.setView(this.getCenter(),t,{zoom:i}):(this._zoom=t,this)},zoomIn:function(t,i){return t=t||(yt?this.options.zoomDelta:1),this.setZoom(this._zoom+t,i)},zoomOut:function(t,i){return t=t||(yt?this.options.zoomDelta:1),this.setZoom(this._zoom-t,i)},setZoomAround:function(t,i,e){var n=this.getZoomScale(i),o=this.getSize().divideBy(2),s=(t instanceof B?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/n),r=this.containerPointToLatLng(o.add(s));return this.setView(r,i,{zoom:e})},_getBoundsCenterZoom:function(t,i){i=i||{},t=t.getBounds?t.getBounds():D(t);var e=I(i.paddingTopLeft||i.padding||[0,0]),n=I(i.paddingBottomRight||i.padding||[0,0]),o=this.getBoundsZoom(t,!1,e.add(n));if((o="number"==typeof i.maxZoom?Math.min(i.maxZoom,o):o)===1/0)return{center:t.getCenter(),zoom:o};var s=n.subtract(e).divideBy(2),r=this.project(t.getSouthWest(),o),a=this.project(t.getNorthEast(),o);return{center:this.unproject(r.add(a).divideBy(2).add(s),o),zoom:o}},fitBounds:function(t,i){if(!(t=D(t)).isValid())throw new Error("Bounds are not valid.");var e=this._getBoundsCenterZoom(t,i);return this.setView(e.center,e.zoom,i)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,i){return this.setView(t,this._zoom,{pan:i})},panBy:function(t,i){if(i=i||{},!(t=I(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==i.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Xi,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),i.noMoveStart||this.fire("movestart"),!1!==i.animate){pi(this._mapPane,"leaflet-pan-anim");var e=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,e,i.duration||.25,i.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(n,o,t){if(!1===(t=t||{}).animate||!yt)return this.setView(n,o,t);this._stop();var s=this.project(this.getCenter()),r=this.project(n),i=this.getSize(),a=this._zoom;n=W(n),o=void 0===o?a:o;var h=Math.max(i.x,i.y),u=h*this.getZoomScale(a,o),l=r.distanceTo(s)||1,c=1.42,_=c*c;function e(t){var i=(u*u-h*h+(t?-1:1)*_*_*l*l)/(2*(t?u:h)*_*l),e=Math.sqrt(i*i+1)-i;return e<1e-9?-18:Math.log(e)}function d(t){return(Math.exp(t)-Math.exp(-t))/2}function p(t){return(Math.exp(t)+Math.exp(-t))/2}var m=e(0);function f(t){return h*(p(m)*function(t){return d(t)/p(t)}(m+c*t)-d(m))/_}var g=Date.now(),v=(e(1)-m)/c,y=t.duration?1e3*t.duration:1e3*v*.8;return this._moveStart(!0,t.noMoveStart),function t(){var i=(Date.now()-g)/y,e=function(t){return 1-Math.pow(1-t,1.5)}(i)*v;i<=1?(this._flyToFrame=M(t,this),this._move(this.unproject(s.add(r.subtract(s).multiplyBy(f(e)/l)),a),this.getScaleZoom(h/function(t){return h*(p(m)/p(m+c*t))}(e),a),{flyTo:!0})):this._move(n,o)._moveEnd(!0)}.call(this),this},flyToBounds:function(t,i){var e=this._getBoundsCenterZoom(t,i);return this.flyTo(e.center,e.zoom,i)},setMaxBounds:function(t){return(t=D(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var i=this.options.minZoom;return this.options.minZoom=t,this._loaded&&i!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var i=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&i!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,i){this._enforcingBounds=!0;var e=this.getCenter(),n=this._limitCenter(e,this._zoom,D(t));return e.equals(n)||this.panTo(n,i),this._enforcingBounds=!1,this},panInside:function(t,i){var e=I((i=i||{}).paddingTopLeft||i.padding||[0,0]),n=I(i.paddingBottomRight||i.padding||[0,0]),o=this.getCenter(),s=this.project(o),r=this.project(t),a=this.getPixelBounds(),h=a.getSize().divideBy(2),u=R([a.min.add(e),a.max.subtract(n)]);if(!u.contains(r)){this._enforcingBounds=!0;var l=s.subtract(r),c=I(r.x+l.x,r.y+l.y);(r.x<u.min.x||r.x>u.max.x)&&(c.x=s.x-l.x,0<l.x?c.x+=h.x-e.x:c.x-=h.x-n.x),(r.y<u.min.y||r.y>u.max.y)&&(c.y=s.y-l.y,0<l.y?c.y+=h.y-e.y:c.y-=h.y-n.y),this.panTo(this.unproject(c),i),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=h({animate:!1,pan:!0},!0===t?{animate:!0}:t);var i=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var e=this.getSize(),n=i.divideBy(2).round(),o=e.divideBy(2).round(),s=n.subtract(o);return s.x||s.y?(t.animate&&t.pan?this.panBy(s):(t.pan&&this._rawPanBy(s),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:i,newSize:e})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=h({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var i=a(this._handleGeolocationResponse,this),e=a(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(i,e,t):navigator.geolocation.getCurrentPosition(i,e,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var i=t.code,e=t.message||(1===i?"permission denied":2===i?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:i,message:"Geolocation error: "+e+"."})},_handleGeolocationResponse:function(t){var i=new j(t.coords.latitude,t.coords.longitude),e=i.toBounds(2*t.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(e);this.setView(i,n.maxZoom?Math.min(o,n.maxZoom):o)}var s={latlng:i,bounds:e,timestamp:t.timestamp};for(var r in t.coords)"number"==typeof t.coords[r]&&(s[r]=t.coords[r]);this.fire("locationfound",s)},addHandler:function(t,i){if(!i)return this;var e=this[t]=new i(this);return this._handlers.push(e),this.options[t]&&e.enable(),this},remove:function(){if(this._initEvents(!0),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ui(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(C(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ui(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,i){var e=hi("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),i||this._mapPane);return t&&(this._panes[t]=e),e},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new N(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,i,e){t=D(t),e=I(e||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),h=this.getSize().subtract(e),u=R(this.project(a,n),this.project(r,n)).getSize(),l=yt?this.options.zoomSnap:1,c=h.x/u.x,_=h.y/u.y,d=i?Math.max(c,_):Math.min(c,_);return n=this.getScaleZoom(d,n),l&&(n=Math.round(n/(l/100))*(l/100),n=i?Math.ceil(n/l)*l:Math.floor(n/l)*l),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new B(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,i){var e=this._getTopLeftPoint(t,i);return new O(e,e.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,i){var e=this.options.crs;return i=void 0===i?this._zoom:i,e.scale(t)/e.scale(i)},getScaleZoom:function(t,i){var e=this.options.crs;i=void 0===i?this._zoom:i;var n=e.zoom(t*e.scale(i));return isNaN(n)?1/0:n},project:function(t,i){return i=void 0===i?this._zoom:i,this.options.crs.latLngToPoint(W(t),i)},unproject:function(t,i){return i=void 0===i?this._zoom:i,this.options.crs.pointToLatLng(I(t),i)},layerPointToLatLng:function(t){var i=I(t).add(this.getPixelOrigin());return this.unproject(i)},latLngToLayerPoint:function(t){return this.project(W(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(W(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(D(t))},distance:function(t,i){return this.options.crs.distance(W(t),W(i))},containerPointToLayerPoint:function(t){return I(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return I(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var i=this.containerPointToLayerPoint(I(t));return this.layerPointToLatLng(i)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(W(t)))},mouseEventToContainerPoint:function(t){return Wi(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var i=this._container=ri(t);if(!i)throw new Error("Map container not found.");if(i._leaflet_id)throw new Error("Map container is already initialized.");Ei(i,"scroll",this._onScroll,this),this._containerId=u(i)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&yt,pi(t,"leaflet-container"+(Tt?" leaflet-touch":"")+(Ct?" leaflet-retina":"")+(et?" leaflet-oldie":"")+(_t?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var i=ai(t,"position");"absolute"!==i&&"relative"!==i&&"fixed"!==i&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),wi(this._mapPane,new B(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(pi(t.markerPane,"leaflet-zoom-hide"),pi(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,i){wi(this._mapPane,new B(0,0));var e=!this._loaded;this._loaded=!0,i=this._limitZoom(i),this.fire("viewprereset");var n=this._zoom!==i;this._moveStart(n,!1)._move(t,i)._moveEnd(n),this.fire("viewreset"),e&&this.fire("load")},_moveStart:function(t,i){return t&&this.fire("zoomstart"),i||this.fire("movestart"),this},_move:function(t,i,e){void 0===i&&(i=this._zoom);var n=this._zoom!==i;return this._zoom=i,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(n||e&&e.pinch)&&this.fire("zoom",e),this.fire("move",e)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return C(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){wi(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={};var i=t?Bi:Ei;i((this._targets[u(this._container)]=this)._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&i(window,"resize",this._onResize,this),yt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){C(this._resizeRequest),this._resizeRequest=M(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,i){for(var e,n=[],o="mouseout"===i||"mouseover"===i,s=t.target||t.srcElement,r=!1;s;){if((e=this._targets[u(s)])&&("click"===i||"preclick"===i)&&!t._simulated&&this._draggableMoved(e)){r=!0;break}if(e&&e.listens(i,!0)){if(o&&!Ki(s,t))break;if(n.push(e),o)break}if(s===this._container)break;s=s.parentNode}return n.length||r||o||!Ki(s,t)||(n=[this]),n},_handleDOMEvent:function(t){if(this._loaded&&!Gi(t)){var i=t.type;"mousedown"!==i&&"keypress"!==i&&"keyup"!==i&&"keydown"!==i||zi(t.target||t.srcElement),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,i,e){if("click"===t.type){var n=h({},t);n.type="preclick",this._fireDOMEvent(n,n.type,e)}if(!t._stopped&&(e=(e||[]).concat(this._findEventTargets(t,i))).length){var o=e[0];"contextmenu"===i&&o.listens(i,!0)&&Di(t);var s={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var r=o.getLatLng&&(!o._radius||o._radius<=10);s.containerPoint=r?this.latLngToContainerPoint(o.getLatLng()):this.mouseEventToContainerPoint(t),s.layerPoint=this.containerPointToLayerPoint(s.containerPoint),s.latlng=r?o.getLatLng():this.layerPointToLatLng(s.layerPoint)}for(var a=0;a<e.length;a++)if(e[a].fire(i,s,!0),s.originalEvent._stopped||!1===e[a].options.bubblingMouseEvents&&-1!==y(this._mouseEvents,i))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,i=this._handlers.length;t<i;t++)this._handlers[t].disable()},whenReady:function(t,i){return this._loaded?t.call(i||this,{target:this}):this.on("load",t,i),this},_getMapPanePos:function(){return Pi(this._mapPane)||new B(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,i){return(t&&void 0!==i?this._getNewPixelOrigin(t,i):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,i){var e=this.getSize()._divideBy(2);return this.project(t,i)._subtract(e)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,i,e){var n=this._getNewPixelOrigin(e,i);return this.project(t,i)._subtract(n)},_latLngBoundsToNewLayerBounds:function(t,i,e){var n=this._getNewPixelOrigin(e,i);return R([this.project(t.getSouthWest(),i)._subtract(n),this.project(t.getNorthWest(),i)._subtract(n),this.project(t.getSouthEast(),i)._subtract(n),this.project(t.getNorthEast(),i)._subtract(n)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,i,e){if(!e)return t;var n=this.project(t,i),o=this.getSize().divideBy(2),s=new O(n.subtract(o),n.add(o)),r=this._getBoundsOffset(s,e,i);return r.round().equals([0,0])?t:this.unproject(n.add(r),i)},_limitOffset:function(t,i){if(!i)return t;var e=this.getPixelBounds(),n=new O(e.min.add(t),e.max.add(t));return t.add(this._getBoundsOffset(n,i))},_getBoundsOffset:function(t,i,e){var n=R(this.project(i.getNorthEast(),e),this.project(i.getSouthWest(),e)),o=n.min.subtract(t.min),s=n.max.subtract(t.max);return new B(this._rebound(o.x,-s.x),this._rebound(o.y,-s.y))},_rebound:function(t,i){return 0<t+i?Math.round(t-i)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(i))},_limitZoom:function(t){var i=this.getMinZoom(),e=this.getMaxZoom(),n=yt?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(i,Math.min(e,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){mi(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,i){var e=this._getCenterOffset(t)._trunc();return!(!0!==(i&&i.animate)&&!this.getSize().contains(e))&&(this.panBy(e,i),!0)},_createAnimProxy:function(){var t=this._proxy=hi("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(t){var i=ni,e=this._proxy.style[i];xi(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),e===this._proxy.style[i]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",function(){var t=this.getCenter(),i=this.getZoom();xi(this._proxy,this.project(t,i),this.getZoomScale(i,1))},this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ui(this._proxy),delete this._proxy},_catchTransitionEnd:function(t){this._animatingZoom&&0<=t.propertyName.indexOf("transform")&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,i,e){if(this._animatingZoom)return!0;if(e=e||{},!this._zoomAnimated||!1===e.animate||this._nothingToAnimate()||Math.abs(i-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(i),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==e.animate&&!this.getSize().contains(o))&&(M(function(){this._moveStart(!0,!1)._animateZoom(t,i,!0)},this),!0)},_animateZoom:function(t,i,e,n){this._mapPane&&(e&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=i,pi(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:i,noUpdate:n}),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&mi(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),M(function(){this._moveEnd(!0)},this))}});function $i(t){return new Qi(t)}var Qi=Z.extend({options:{position:"topright"},initialize:function(t){p(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var i=this._map;return i&&i.removeControl(this),this.options.position=t,i&&i.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var i=this._container=this.onAdd(t),e=this.getPosition(),n=t._controlCorners[e];return pi(i,"leaflet-control"),-1!==e.indexOf("bottom")?n.insertBefore(i,n.firstChild):n.appendChild(i),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(ui(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&0<t.screenX&&0<t.screenY&&this._map.getContainer().focus()}});Ji.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var n=this._controlCorners={},o="leaflet-",s=this._controlContainer=hi("div",o+"control-container",this._container);function t(t,i){var e=o+t+" "+o+i;n[t+i]=hi("div",e,s)}t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ui(this._controlCorners[t]);ui(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var te=Qi.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,i,e,n){return e<n?-1:n<e?1:0}},initialize:function(t,i,e){for(var n in p(this,e),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[n],n);for(n in i)this._addLayer(i[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),(this._map=t).on("zoomend",this._checkDisabledLayers,this);for(var i=0;i<this._layers.length;i++)this._layers[i].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return Qi.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,i){return this._addLayer(t,i),this._map?this._update():this},addOverlay:function(t,i){return this._addLayer(t,i,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var i=this._getLayer(u(t));return i&&this._layers.splice(this._layers.indexOf(i),1),this._map?this._update():this},expand:function(){pi(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(pi(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):mi(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return mi(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",i=this._container=hi("div",t),e=this.options.collapsed;i.setAttribute("aria-haspopup",!0),Ni(i),Ri(i);var n=this._section=hi("section",t+"-list");e&&(this._map.on("click",this.collapse,this),st||Ei(i,{mouseenter:this.expand,mouseleave:this.collapse},this));var o=this._layersLink=hi("a",t+"-toggle",i);o.href="#",o.title="Layers",Tt?(Ei(o,"click",ji),Ei(o,"click",this.expand,this)):Ei(o,"focus",this.expand,this),e||this.expand(),this._baseLayersList=hi("div",t+"-base",n),this._separator=hi("div",t+"-separator",n),this._overlaysList=hi("div",t+"-overlays",n),i.appendChild(n)},_getLayer:function(t){for(var i=0;i<this._layers.length;i++)if(this._layers[i]&&u(this._layers[i].layer)===t)return this._layers[i]},_addLayer:function(t,i,e){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:i,overlay:e}),this.options.sortLayers&&this._layers.sort(a(function(t,i){return this.options.sortFunction(t.layer,i.layer,t.name,i.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;li(this._baseLayersList),li(this._overlaysList),this._layerControlInputs=[];var t,i,e,n,o=0;for(e=0;e<this._layers.length;e++)n=this._layers[e],this._addItem(n),i=i||n.overlay,t=t||!n.overlay,o+=n.overlay?0:1;return this.options.hideSingleBase&&(t=t&&1<o,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=i&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var i=this._getLayer(u(t.target)),e=i.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;e&&this._map.fire(e,i)},_createRadioElement:function(t,i){var e='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(i?' checked="checked"':"")+"/>",n=document.createElement("div");return n.innerHTML=e,n.firstChild},_addItem:function(t){var i,e=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((i=document.createElement("input")).type="checkbox",i.className="leaflet-control-layers-selector",i.defaultChecked=n):i=this._createRadioElement("leaflet-base-layers_"+u(this),n),this._layerControlInputs.push(i),i.layerId=u(t.layer),Ei(i,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var s=document.createElement("div");return e.appendChild(s),s.appendChild(i),s.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){var t,i,e=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=e.length-1;0<=s;s--)t=e[s],i=this._getLayer(t.layerId).layer,t.checked?n.push(i):t.checked||o.push(i);for(s=0;s<o.length;s++)this._map.hasLayer(o[s])&&this._map.removeLayer(o[s]);for(s=0;s<n.length;s++)this._map.hasLayer(n[s])||this._map.addLayer(n[s]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,i,e=this._layerControlInputs,n=this._map.getZoom(),o=e.length-1;0<=o;o--)t=e[o],i=this._getLayer(t.layerId).layer,t.disabled=void 0!==i.options.minZoom&&n<i.options.minZoom||void 0!==i.options.maxZoom&&n>i.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),ie=Qi.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"&#x2212;",zoomOutTitle:"Zoom out"},onAdd:function(t){var i="leaflet-control-zoom",e=hi("div",i+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,i+"-in",e,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,i+"-out",e,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),e},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,i,e,n,o){var s=hi("a",e,n);return s.innerHTML=t,s.href="#",s.title=i,s.setAttribute("role","button"),s.setAttribute("aria-label",i),Ni(s),Ei(s,"click",ji),Ei(s,"click",o,this),Ei(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,i="leaflet-disabled";mi(this._zoomInButton,i),mi(this._zoomOutButton,i),!this._disabled&&t._zoom!==t.getMinZoom()||pi(this._zoomOutButton,i),!this._disabled&&t._zoom!==t.getMaxZoom()||pi(this._zoomInButton,i)}});Ji.mergeOptions({zoomControl:!0}),Ji.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new ie,this.addControl(this.zoomControl))});var ee=Qi.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var i="leaflet-control-scale",e=hi("div",i),n=this.options;return this._addScales(n,i+"-line",e),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),e},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,i,e){t.metric&&(this._mScale=hi("div",i,e)),t.imperial&&(this._iScale=hi("div",i,e))},_update:function(){var t=this._map,i=t.getSize().y/2,e=t.distance(t.containerPointToLatLng([0,i]),t.containerPointToLatLng([this.options.maxWidth,i]));this._updateScales(e)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var i=this._getRoundNum(t),e=i<1e3?i+" m":i/1e3+" km";this._updateScale(this._mScale,e,i/t)},_updateImperial:function(t){var i,e,n,o=3.2808399*t;5280<o?(i=o/5280,e=this._getRoundNum(i),this._updateScale(this._iScale,e+" mi",e/i)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,i,e){t.style.width=Math.round(this.options.maxWidth*e)+"px",t.innerHTML=i},_getRoundNum:function(t){var i=Math.pow(10,(Math.floor(t)+"").length-1),e=t/i;return i*(e=10<=e?10:5<=e?5:3<=e?3:2<=e?2:1)}}),ne=Qi.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){p(this,t),this._attributions={}},onAdd:function(t){for(var i in(t.attributionControl=this)._container=hi("div","leaflet-control-attribution"),Ni(this._container),t._layers)t._layers[i].getAttribution&&this.addAttribution(t._layers[i].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t&&(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update()),this},removeAttribution:function(t){return t&&this._attributions[t]&&(this._attributions[t]--,this._update()),this},_update:function(){if(this._map){var t=[];for(var i in this._attributions)this._attributions[i]&&t.push(i);var e=[];this.options.prefix&&e.push(this.options.prefix),t.length&&e.push(t.join(", ")),this._container.innerHTML=e.join(" | ")}}});Ji.mergeOptions({attributionControl:!0}),Ji.addInitHook(function(){this.options.attributionControl&&(new ne).addTo(this)});Qi.Layers=te,Qi.Zoom=ie,Qi.Scale=ee,Qi.Attribution=ne,$i.layers=function(t,i,e){return new te(t,i,e)},$i.zoom=function(t){return new ie(t)},$i.scale=function(t){return new ee(t)},$i.attribution=function(t){return new ne(t)};var oe=Z.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}});oe.addTo=function(t,i){return t.addHandler(i,this),this};var se,re={Events:E},ae=Tt?"touchstart mousedown":"mousedown",he={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},ue={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},le=k.extend({options:{clickTolerance:3},initialize:function(t,i,e,n){p(this,n),this._element=t,this._dragStartTarget=i||t,this._preventOutline=e},enable:function(){this._enabled||(Ei(this._dragStartTarget,ae,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(le._dragging===this&&this.finishDrag(),Bi(this._dragStartTarget,ae,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!di(this._element,"leaflet-zoom-anim")&&!(le._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||((le._dragging=this)._preventOutline&&zi(this._element),bi(),$t(),this._moving)))){this.fire("down");var i=t.touches?t.touches[0]:t,e=Ci(this._element);this._startPoint=new B(i.clientX,i.clientY),this._parentScale=Si(e),Ei(document,ue[t.type],this._onMove,this),Ei(document,he[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&1<t.touches.length)this._moved=!0;else{var i=t.touches&&1===t.touches.length?t.touches[0]:t,e=new B(i.clientX,i.clientY)._subtract(this._startPoint);(e.x||e.y)&&(Math.abs(e.x)+Math.abs(e.y)<this.options.clickTolerance||(e.x/=this._parentScale.x,e.y/=this._parentScale.y,Di(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=Pi(this._element).subtract(e),pi(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),pi(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(e),this._moving=!0,C(this._animRequest),this._lastEvent=t,this._animRequest=M(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),wi(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in mi(document.body,"leaflet-dragging"),this._lastTarget&&(mi(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),ue)Bi(document,ue[t],this._onMove,this),Bi(document,he[t],this._onUp,this);Ti(),Qt(),this._moved&&this._moving&&(C(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,le._dragging=!1}});function ce(t,i){if(!i||!t.length)return t.slice();var e=i*i;return t=function(t,i){var e=t.length,n=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(e);n[0]=n[e-1]=1,function t(i,e,n,o,s){var r,a,h,u=0;for(a=o+1;a<=s-1;a++)h=fe(i[a],i[o],i[s],!0),u<h&&(r=a,u=h);n<u&&(e[r]=1,t(i,e,n,o,r),t(i,e,n,r,s))}(t,n,i,0,e-1);var o,s=[];for(o=0;o<e;o++)n[o]&&s.push(t[o]);return s}(t=function(t,i){for(var e=[t[0]],n=1,o=0,s=t.length;n<s;n++)r=t[n],a=t[o],void 0,h=a.x-r.x,u=a.y-r.y,i<h*h+u*u&&(e.push(t[n]),o=n);var r,a,h,u;o<s-1&&e.push(t[s-1]);return e}(t,e),e)}function _e(t,i,e){return Math.sqrt(fe(t,i,e,!0))}function de(t,i,e,n,o){var s,r,a,h=n?se:me(t,e),u=me(i,e);for(se=u;;){if(!(h|u))return[t,i];if(h&u)return!1;a=me(r=pe(t,i,s=h||u,e,o),e),s===h?(t=r,h=a):(i=r,u=a)}}function pe(t,i,e,n,o){var s,r,a=i.x-t.x,h=i.y-t.y,u=n.min,l=n.max;return 8&e?(s=t.x+a*(l.y-t.y)/h,r=l.y):4&e?(s=t.x+a*(u.y-t.y)/h,r=u.y):2&e?(s=l.x,r=t.y+h*(l.x-t.x)/a):1&e&&(s=u.x,r=t.y+h*(u.x-t.x)/a),new B(s,r,o)}function me(t,i){var e=0;return t.x<i.min.x?e|=1:t.x>i.max.x&&(e|=2),t.y<i.min.y?e|=4:t.y>i.max.y&&(e|=8),e}function fe(t,i,e,n){var o,s=i.x,r=i.y,a=e.x-s,h=e.y-r,u=a*a+h*h;return 0<u&&(1<(o=((t.x-s)*a+(t.y-r)*h)/u)?(s=e.x,r=e.y):0<o&&(s+=a*o,r+=h*o)),a=t.x-s,h=t.y-r,n?a*a+h*h:new B(s,r)}function ge(t){return!v(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function ve(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),ge(t)}var ye=(Object.freeze||Object)({simplify:ce,pointToSegmentDistance:_e,closestPointOnSegment:function(t,i,e){return fe(t,i,e)},clipSegment:de,_getEdgeIntersection:pe,_getBitCode:me,_sqClosestPointOnSegment:fe,isFlat:ge,_flat:ve});function xe(t,i,e){var n,o,s,r,a,h,u,l,c,_=[1,4,2,8];for(o=0,u=t.length;o<u;o++)t[o]._code=me(t[o],i);for(r=0;r<4;r++){for(l=_[r],n=[],o=0,s=(u=t.length)-1;o<u;s=o++)a=t[o],h=t[s],a._code&l?h._code&l||((c=pe(h,a,l,i,e))._code=me(c,i),n.push(c)):(h._code&l&&((c=pe(h,a,l,i,e))._code=me(c,i),n.push(c)),n.push(a));t=n}return t}var we,Pe=(Object.freeze||Object)({clipPolygon:xe}),Le={project:function(t){return new B(t.lng,t.lat)},unproject:function(t){return new j(t.y,t.x)},bounds:new O([-180,-90],[180,90])},be={R:6378137,R_MINOR:6356752.314245179,bounds:new O([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var i=Math.PI/180,e=this.R,n=t.lat*i,o=this.R_MINOR/e,s=Math.sqrt(1-o*o),r=s*Math.sin(n),a=Math.tan(Math.PI/4-n/2)/Math.pow((1-r)/(1+r),s/2);return n=-e*Math.log(Math.max(a,1e-10)),new B(t.lng*i*e,n)},unproject:function(t){for(var i,e=180/Math.PI,n=this.R,o=this.R_MINOR/n,s=Math.sqrt(1-o*o),r=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(r),h=0,u=.1;h<15&&1e-7<Math.abs(u);h++)i=s*Math.sin(a),i=Math.pow((1-i)/(1+i),s/2),a+=u=Math.PI/2-2*Math.atan(r*i)-a;return new j(a*e,t.x*e/n)}},Te=(Object.freeze||Object)({LonLat:Le,Mercator:be,SphericalMercator:q}),ze=h({},U,{code:"EPSG:3395",projection:be,transformation:(we=.5/(Math.PI*be.R),K(we,.5,-we,.5))}),Me=h({},U,{code:"EPSG:4326",projection:Le,transformation:K(1/180,1,-1/180,.5)}),Ce=h({},F,{projection:Le,transformation:K(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,i){var e=i.lng-t.lng,n=i.lat-t.lat;return Math.sqrt(e*e+n*n)},infinite:!0});F.Earth=U,F.EPSG3395=ze,F.EPSG3857=X,F.EPSG900913=J,F.EPSG4326=Me,F.Simple=Ce;var Se=k.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[u(t)]=this},removeInteractiveTarget:function(t){return delete this._map._targets[u(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var i=t.target;if(i.hasLayer(this)){if(this._map=i,this._zoomAnimated=i._zoomAnimated,this.getEvents){var e=this.getEvents();i.on(e,this),this.once("remove",function(){i.off(e,this)},this)}this.onAdd(i),this.getAttribution&&i.attributionControl&&i.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),i.fire("layeradd",{layer:this})}}});Ji.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var i=u(t);return this._layers[i]||((this._layers[i]=t)._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var i=u(t);return this._layers[i]&&(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[i],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null),this},hasLayer:function(t){return!!t&&u(t)in this._layers},eachLayer:function(t,i){for(var e in this._layers)t.call(i,this._layers[e]);return this},_addLayers:function(t){for(var i=0,e=(t=t?v(t)?t:[t]:[]).length;i<e;i++)this.addLayer(t[i])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[u(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var i=u(t);this._zoomBoundLayers[i]&&(delete this._zoomBoundLayers[i],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,i=-1/0,e=this._getZoomSpan();for(var n in this._zoomBoundLayers){var o=this._zoomBoundLayers[n].options;t=void 0===o.minZoom?t:Math.min(t,o.minZoom),i=void 0===o.maxZoom?i:Math.max(i,o.maxZoom)}this._layersMaxZoom=i===-1/0?void 0:i,this._layersMinZoom=t===1/0?void 0:t,e!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Ze=Se.extend({initialize:function(t,i){var e,n;if(p(this,i),this._layers={},t)for(e=0,n=t.length;e<n;e++)this.addLayer(t[e])},addLayer:function(t){var i=this.getLayerId(t);return this._layers[i]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var i=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[i]&&this._map.removeLayer(this._layers[i]),delete this._layers[i],this},hasLayer:function(t){return!!t&&(t in this._layers||this.getLayerId(t)in this._layers)},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var i,e,n=Array.prototype.slice.call(arguments,1);for(i in this._layers)(e=this._layers[i])[t]&&e[t].apply(e,n);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,i){for(var e in this._layers)t.call(i,this._layers[e]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return u(t)}}),Ee=Ze.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Ze.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Ze.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new N;for(var i in this._layers){var e=this._layers[i];t.extend(e.getBounds?e.getBounds():e.getLatLng())}return t}}),ke=Z.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0]},initialize:function(t){p(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,i){var e=this._getIconUrl(t);if(!e){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(e,i&&"IMG"===i.tagName?i:null);return this._setIconStyles(n,t),n},_setIconStyles:function(t,i){var e=this.options,n=e[i+"Size"];"number"==typeof n&&(n=[n,n]);var o=I(n),s=I("shadow"===i&&e.shadowAnchor||e.iconAnchor||o&&o.divideBy(2,!0));t.className="leaflet-marker-"+i+" "+(e.className||""),s&&(t.style.marginLeft=-s.x+"px",t.style.marginTop=-s.y+"px"),o&&(t.style.width=o.x+"px",t.style.height=o.y+"px")},_createImg:function(t,i){return(i=i||document.createElement("img")).src=t,i},_getIconUrl:function(t){return Ct&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});var Be=ke.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return Be.imagePath||(Be.imagePath=this._detectIconPath()),(this.options.imagePath||Be.imagePath)+ke.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=hi("div","leaflet-default-icon-path",document.body),i=ai(t,"background-image")||ai(t,"backgroundImage");return document.body.removeChild(t),i=null===i||0!==i.indexOf("url")?"":i.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),Ae=oe.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new le(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),pi(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&mi(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var i=this._marker,e=i._map,n=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,s=Pi(i._icon),r=e.getPixelBounds(),a=e.getPixelOrigin(),h=R(r.min._subtract(a).add(o),r.max._subtract(a).subtract(o));if(!h.contains(s)){var u=I((Math.max(h.max.x,s.x)-h.max.x)/(r.max.x-h.max.x)-(Math.min(h.min.x,s.x)-h.min.x)/(r.min.x-h.min.x),(Math.max(h.max.y,s.y)-h.max.y)/(r.max.y-h.max.y)-(Math.min(h.min.y,s.y)-h.min.y)/(r.min.y-h.min.y)).multiplyBy(n);e.panBy(u,{animate:!1}),this._draggable._newPos._add(u),this._draggable._startPos._add(u),wi(i._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=M(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup().fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(C(this._panRequest),this._panRequest=M(this._adjustPan.bind(this,t)))},_onDrag:function(t){var i=this._marker,e=i._shadow,n=Pi(i._icon),o=i._map.layerPointToLatLng(n);e&&wi(e,n),i._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,i.fire("move",t).fire("drag",t)},_onDragEnd:function(t){C(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Ie=Se.extend({options:{icon:new Be,interactive:!0,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,i){p(this,i),this._latlng=W(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var i=this._latlng;return this._latlng=W(t),this.update(),this.fire("move",{oldLatLng:i,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,i="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),e=t.icon.createIcon(this._icon),n=!1;e!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(e.title=t.title),"IMG"===e.tagName&&(e.alt=t.alt||"")),pi(e,i),t.keyboard&&(e.tabIndex="0"),this._icon=e,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var o=t.icon.createShadow(this._shadow),s=!1;o!==this._shadow&&(this._removeShadow(),s=!0),o&&(pi(o,i),o.alt=""),this._shadow=o,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&s&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),ui(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ui(this._shadow),this._shadow=null},_setPos:function(t){wi(this._icon,t),this._shadow&&wi(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var i=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(i)},_initInteraction:function(){if(this.options.interactive&&(pi(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Ae)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Ae(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&vi(this._icon,t),this._shadow&&vi(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});var Oe=Se.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return p(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t.hasOwnProperty("weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+this._renderer.options.tolerance}}),Re=Oe.extend({options:{fill:!0,radius:10},initialize:function(t,i){p(this,i),this._latlng=W(t),this._radius=this.options.radius},setLatLng:function(t){return this._latlng=W(t),this.redraw(),this.fire("move",{latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var i=t&&t.radius||this._radius;return Oe.prototype.setStyle.call(this,t),this.setRadius(i),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,i=this._radiusY||t,e=this._clickTolerance(),n=[t+e,i+e];this._pxBounds=new O(this._point.subtract(n),this._point.add(n))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});var Ne=Re.extend({initialize:function(t,i,e){if("number"==typeof i&&(i=h({},e,{radius:i})),p(this,i),this._latlng=W(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new N(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:Oe.prototype.setStyle,_project:function(){var t=this._latlng.lng,i=this._latlng.lat,e=this._map,n=e.options.crs;if(n.distance===U.distance){var o=Math.PI/180,s=this._mRadius/U.R/o,r=e.project([i+s,t]),a=e.project([i-s,t]),h=r.add(a).divideBy(2),u=e.unproject(h).lat,l=Math.acos((Math.cos(s*o)-Math.sin(i*o)*Math.sin(u*o))/(Math.cos(i*o)*Math.cos(u*o)))/o;!isNaN(l)&&0!==l||(l=s/Math.cos(Math.PI/180*i)),this._point=h.subtract(e.getPixelOrigin()),this._radius=isNaN(l)?0:h.x-e.project([u,t-l]).x,this._radiusY=h.y-r.y}else{var c=n.unproject(n.project(this._latlng).subtract([this._mRadius,0]));this._point=e.latLngToLayerPoint(this._latlng),this._radius=this._point.x-e.latLngToLayerPoint(c).x}this._updateBounds()}});var De=Oe.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,i){p(this,i),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var i,e,n=1/0,o=null,s=fe,r=0,a=this._parts.length;r<a;r++)for(var h=this._parts[r],u=1,l=h.length;u<l;u++){var c=s(t,i=h[u-1],e=h[u],!0);c<n&&(n=c,o=s(t,i,e))}return o&&(o.distance=Math.sqrt(n)),o},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,i,e,n,o,s,r,a=this._rings[0],h=a.length;if(!h)return null;for(i=t=0;t<h-1;t++)i+=a[t].distanceTo(a[t+1])/2;if(0===i)return this._map.layerPointToLatLng(a[0]);for(n=t=0;t<h-1;t++)if(o=a[t],s=a[t+1],i<(n+=e=o.distanceTo(s)))return r=(n-i)/e,this._map.layerPointToLatLng([s.x-r*(s.x-o.x),s.y-r*(s.y-o.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,i){return i=i||this._defaultShape(),t=W(t),i.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new N,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return ge(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var i=[],e=ge(t),n=0,o=t.length;n<o;n++)e?(i[n]=W(t[n]),this._bounds.extend(i[n])):i[n]=this._convertLatLngs(t[n]);return i},_project:function(){var t=new O;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),i=new B(t,t);this._pxBounds=new O([this._rawPxBounds.min.subtract(i),this._rawPxBounds.max.add(i)])},_projectLatlngs:function(t,i,e){var n,o,s=t[0]instanceof j,r=t.length;if(s){for(o=[],n=0;n<r;n++)o[n]=this._map.latLngToLayerPoint(t[n]),e.extend(o[n]);i.push(o)}else for(n=0;n<r;n++)this._projectLatlngs(t[n],i,e)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var i,e,n,o,s,r,a,h=this._parts;for(n=i=0,o=this._rings.length;i<o;i++)for(e=0,s=(a=this._rings[i]).length;e<s-1;e++)(r=de(a[e],a[e+1],t,e,!0))&&(h[n]=h[n]||[],h[n].push(r[0]),r[1]===a[e+1]&&e!==s-2||(h[n].push(r[1]),n++))}},_simplifyPoints:function(){for(var t=this._parts,i=this.options.smoothFactor,e=0,n=t.length;e<n;e++)t[e]=ce(t[e],i)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,i){var e,n,o,s,r,a,h=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(e=0,s=this._parts.length;e<s;e++)for(n=0,o=(r=(a=this._parts[e]).length)-1;n<r;o=n++)if((i||0!==n)&&_e(t,a[o],a[n])<=h)return!0;return!1}});De._flat=ve;var je=De.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,i,e,n,o,s,r,a,h,u=this._rings[0],l=u.length;if(!l)return null;for(s=r=a=0,t=0,i=l-1;t<l;i=t++)e=u[t],n=u[i],o=e.y*n.x-n.y*e.x,r+=(e.x+n.x)*o,a+=(e.y+n.y)*o,s+=3*o;return h=0===s?u[0]:[r/s,a/s],this._map.layerPointToLatLng(h)},_convertLatLngs:function(t){var i=De.prototype._convertLatLngs.call(this,t),e=i.length;return 2<=e&&i[0]instanceof j&&i[0].equals(i[e-1])&&i.pop(),i},_setLatLngs:function(t){De.prototype._setLatLngs.call(this,t),ge(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return ge(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,i=this.options.weight,e=new B(i,i);if(t=new O(t.min.subtract(e),t.max.add(e)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var n,o=0,s=this._rings.length;o<s;o++)(n=xe(this._rings[o],t,!0)).length&&this._parts.push(n)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var i,e,n,o,s,r,a,h,u=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(o=0,a=this._parts.length;o<a;o++)for(s=0,r=(h=(i=this._parts[o]).length)-1;s<h;r=s++)e=i[s],n=i[r],e.y>t.y!=n.y>t.y&&t.x<(n.x-e.x)*(t.y-e.y)/(n.y-e.y)+e.x&&(u=!u);return u||De.prototype._containsPoint.call(this,t,!0)}});var We=Ee.extend({initialize:function(t,i){p(this,i),this._layers={},t&&this.addData(t)},addData:function(t){var i,e,n,o=v(t)?t:t.features;if(o){for(i=0,e=o.length;i<e;i++)((n=o[i]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var s=this.options;if(s.filter&&!s.filter(t))return this;var r=He(t,s);return r?(r.feature=Ke(t),r.defaultOptions=r.options,this.resetStyle(r),s.onEachFeature&&s.onEachFeature(t,r),this.addLayer(r)):this},resetStyle:function(t){return t.options=h({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this},setStyle:function(i){return this.eachLayer(function(t){this._setLayerStyle(t,i)},this)},_setLayerStyle:function(t,i){t.setStyle&&("function"==typeof i&&(i=i(t.feature)),t.setStyle(i))}});function He(t,i){var e,n,o,s,r="Feature"===t.type?t.geometry:t,a=r?r.coordinates:null,h=[],u=i&&i.pointToLayer,l=i&&i.coordsToLatLng||Fe;if(!a&&!r)return null;switch(r.type){case"Point":return e=l(a),u?u(t,e):new Ie(e);case"MultiPoint":for(o=0,s=a.length;o<s;o++)e=l(a[o]),h.push(u?u(t,e):new Ie(e));return new Ee(h);case"LineString":case"MultiLineString":return n=Ue(a,"LineString"===r.type?0:1,l),new De(n,i);case"Polygon":case"MultiPolygon":return n=Ue(a,"Polygon"===r.type?1:2,l),new je(n,i);case"GeometryCollection":for(o=0,s=r.geometries.length;o<s;o++){var c=He({geometry:r.geometries[o],type:"Feature",properties:t.properties},i);c&&h.push(c)}return new Ee(h);default:throw new Error("Invalid GeoJSON object.")}}function Fe(t){return new j(t[1],t[0],t[2])}function Ue(t,i,e){for(var n,o=[],s=0,r=t.length;s<r;s++)n=i?Ue(t[s],i-1,e):(e||Fe)(t[s]),o.push(n);return o}function Ve(t,i){return i="number"==typeof i?i:6,void 0!==t.alt?[c(t.lng,i),c(t.lat,i),c(t.alt,i)]:[c(t.lng,i),c(t.lat,i)]}function qe(t,i,e,n){for(var o=[],s=0,r=t.length;s<r;s++)o.push(i?qe(t[s],i-1,e,n):Ve(t[s],n));return!i&&e&&o.push(o[0]),o}function Ge(t,i){return t.feature?h({},t.feature,{geometry:i}):Ke(i)}function Ke(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var Ye={toGeoJSON:function(t){return Ge(this,{type:"Point",coordinates:Ve(this.getLatLng(),t)})}};function Xe(t,i){return new We(t,i)}Ie.include(Ye),Ne.include(Ye),Re.include(Ye),De.include({toGeoJSON:function(t){var i=!ge(this._latlngs);return Ge(this,{type:(i?"Multi":"")+"LineString",coordinates:qe(this._latlngs,i?1:0,!1,t)})}}),je.include({toGeoJSON:function(t){var i=!ge(this._latlngs),e=i&&!ge(this._latlngs[0]),n=qe(this._latlngs,e?2:i?1:0,!0,t);return i||(n=[n]),Ge(this,{type:(e?"Multi":"")+"Polygon",coordinates:n})}}),Ze.include({toMultiPoint:function(i){var e=[];return this.eachLayer(function(t){e.push(t.toGeoJSON(i).geometry.coordinates)}),Ge(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(n){var t=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===t)return this.toMultiPoint(n);var o="GeometryCollection"===t,s=[];return this.eachLayer(function(t){if(t.toGeoJSON){var i=t.toGeoJSON(n);if(o)s.push(i.geometry);else{var e=Ke(i);"FeatureCollection"===e.type?s.push.apply(s,e.features):s.push(e)}}}),o?Ge(this,{geometries:s,type:"GeometryCollection"}):{type:"FeatureCollection",features:s}}});var Je=Xe,$e=Se.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,i,e){this._url=t,this._bounds=D(i),p(this,e)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(pi(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ui(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&ci(this._image),this},bringToBack:function(){return this._map&&_i(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=D(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,i=this._image=t?this._url:hi("img");pi(i,"leaflet-image-layer"),this._zoomAnimated&&pi(i,"leaflet-zoom-animated"),this.options.className&&pi(i,this.options.className),i.onselectstart=l,i.onmousemove=l,i.onload=a(this.fire,this,"load"),i.onerror=a(this._overlayOnError,this,"error"),!this.options.crossOrigin&&""!==this.options.crossOrigin||(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=i.src:(i.src=this._url,i.alt=this.options.alt)},_animateZoom:function(t){var i=this._map.getZoomScale(t.zoom),e=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;xi(this._image,e,i)},_reset:function(){var t=this._image,i=new O(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),e=i.getSize();wi(t,i.min),t.style.width=e.x+"px",t.style.height=e.y+"px"},_updateOpacity:function(){vi(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}}),Qe=$e.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,i=this._image=t?this._url:hi("video");if(pi(i,"leaflet-image-layer"),this._zoomAnimated&&pi(i,"leaflet-zoom-animated"),i.onselectstart=l,i.onmousemove=l,i.onloadeddata=a(this.fire,this,"load"),t){for(var e=i.getElementsByTagName("source"),n=[],o=0;o<e.length;o++)n.push(e[o].src);this._url=0<e.length?n:[i.src]}else{v(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&i.style.hasOwnProperty("objectFit")&&(i.style.objectFit="fill"),i.autoplay=!!this.options.autoplay,i.loop=!!this.options.loop;for(var s=0;s<this._url.length;s++){var r=hi("source");r.src=this._url[s],i.appendChild(r)}}}});var tn=$e.extend({_initImage:function(){var t=this._image=this._url;pi(t,"leaflet-image-layer"),this._zoomAnimated&&pi(t,"leaflet-zoom-animated"),t.onselectstart=l,t.onmousemove=l}});var en=Se.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,i){p(this,t),this._source=i},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&vi(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&vi(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(vi(this._container,0),this._removeTimeout=setTimeout(a(ui,void 0,this._container),200)):ui(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=W(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&ci(this._container),this},bringToBack:function(){return this._map&&_i(this._container),this},_prepareOpen:function(t,i,e){if(i instanceof Se||(e=i,i=t),i instanceof Ee)for(var n in t._layers){i=t._layers[n];break}if(!e)if(i.getCenter)e=i.getCenter();else{if(!i.getLatLng)throw new Error("Unable to get source layer LatLng.");e=i.getLatLng()}return this._source=i,this.update(),e},_updateContent:function(){if(this._content){var t=this._contentNode,i="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof i)t.innerHTML=i;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(i)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),i=I(this.options.offset),e=this._getAnchor();this._zoomAnimated?wi(this._container,t.add(e)):i=i.add(t).add(e);var n=this._containerBottom=-i.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+i.x;this._container.style.bottom=n+"px",this._container.style.left=o+"px"}},_getAnchor:function(){return[0,0]}}),nn=en.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t.openPopup(this),this},onAdd:function(t){en.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Oe||this._source.on("preclick",Oi))},onRemove:function(t){en.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Oe||this._source.off("preclick",Oi))},getEvents:function(){var t=en.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t="leaflet-popup",i=this._container=hi("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),e=this._wrapper=hi("div",t+"-content-wrapper",i);if(this._contentNode=hi("div",t+"-content",e),Ni(e),Ri(this._contentNode),Ei(e,"contextmenu",Oi),this._tipContainer=hi("div",t+"-tip-container",i),this._tip=hi("div",t+"-tip",this._tipContainer),this.options.closeButton){var n=this._closeButton=hi("a",t+"-close-button",i);n.href="#close",n.innerHTML="&#215;",Ei(n,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,i=t.style;i.width="",i.whiteSpace="nowrap";var e=t.offsetWidth;e=Math.min(e,this.options.maxWidth),e=Math.max(e,this.options.minWidth),i.width=e+1+"px",i.whiteSpace="",i.height="";var n=t.offsetHeight,o=this.options.maxHeight,s="leaflet-popup-scrolled";o&&o<n?(i.height=o+"px",pi(t,s)):mi(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var i=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),e=this._getAnchor();wi(this._container,i.add(e))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var t=this._map,i=parseInt(ai(this._container,"marginBottom"),10)||0,e=this._container.offsetHeight+i,n=this._containerWidth,o=new B(this._containerLeft,-e-this._containerBottom);o._add(Pi(this._container));var s=t.layerPointToContainerPoint(o),r=I(this.options.autoPanPadding),a=I(this.options.autoPanPaddingTopLeft||r),h=I(this.options.autoPanPaddingBottomRight||r),u=t.getSize(),l=0,c=0;s.x+n+h.x>u.x&&(l=s.x+n-u.x+h.x),s.x-l-a.x<0&&(l=s.x-a.x),s.y+e+h.y>u.y&&(c=s.y+e-u.y+h.y),s.y-c-a.y<0&&(c=s.y-a.y),(l||c)&&t.fire("autopanstart").panBy([l,c])}},_onCloseButtonClick:function(t){this._close(),ji(t)},_getAnchor:function(){return I(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});Ji.mergeOptions({closePopupOnClick:!0}),Ji.include({openPopup:function(t,i,e){return t instanceof nn||(t=new nn(e).setContent(t)),i&&t.setLatLng(i),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Se.include({bindPopup:function(t,i){return t instanceof nn?(p(t,i),(this._popup=t)._source=this):(this._popup&&!i||(this._popup=new nn(i,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,i){return this._popup&&this._map&&(i=this._popup._prepareOpen(this,t,i),this._map.openPopup(this._popup,i)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var i=t.layer||t.target;this._popup&&this._map&&(ji(t),i instanceof Oe?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===i?this.closePopup():this.openPopup(i,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var on=en.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){en.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){en.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=en.prototype.getEvents.call(this);return Tt&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=hi("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var i=this._map,e=this._container,n=i.latLngToContainerPoint(i.getCenter()),o=i.layerPointToContainerPoint(t),s=this.options.direction,r=e.offsetWidth,a=e.offsetHeight,h=I(this.options.offset),u=this._getAnchor();t="top"===s?t.add(I(-r/2+h.x,-a+h.y+u.y,!0)):"bottom"===s?t.subtract(I(r/2-h.x,-h.y,!0)):"center"===s?t.subtract(I(r/2+h.x,a/2-u.y+h.y,!0)):"right"===s||"auto"===s&&o.x<n.x?(s="right",t.add(I(h.x+u.x,u.y-a/2+h.y,!0))):(s="left",t.subtract(I(r+u.x-h.x,a/2-u.y-h.y,!0))),mi(e,"leaflet-tooltip-right"),mi(e,"leaflet-tooltip-left"),mi(e,"leaflet-tooltip-top"),mi(e,"leaflet-tooltip-bottom"),pi(e,"leaflet-tooltip-"+s),wi(e,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&vi(this._container,t)},_animateZoom:function(t){var i=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(i)},_getAnchor:function(){return I(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}});Ji.include({openTooltip:function(t,i,e){return t instanceof on||(t=new on(e).setContent(t)),i&&t.setLatLng(i),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),Se.include({bindTooltip:function(t,i){return t instanceof on?(p(t,i),(this._tooltip=t)._source=this):(this._tooltip&&!i||(this._tooltip=new on(i,this)),this._tooltip.setContent(t)),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var i=t?"off":"on",e={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?e.add=this._openTooltip:(e.mouseover=this._openTooltip,e.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(e.mousemove=this._moveTooltip),Tt&&(e.click=this._openTooltip)),this[i](e),this._tooltipHandlersAdded=!t}},openTooltip:function(t,i){return this._tooltip&&this._map&&(i=this._tooltip._prepareOpen(this,t,i),this._map.openTooltip(this._tooltip,i),this._tooltip.options.interactive&&this._tooltip._container&&(pi(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(mi(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){var i=t.layer||t.target;this._tooltip&&this._map&&this.openTooltip(i,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var i,e,n=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(i=this._map.mouseEventToContainerPoint(t.originalEvent),e=this._map.containerPointToLayerPoint(i),n=this._map.layerPointToLatLng(e)),this._tooltip.setLatLng(n)}});var sn=ke.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var i=t&&"DIV"===t.tagName?t:document.createElement("div"),e=this.options;if(e.html instanceof Element?(li(i),i.appendChild(e.html)):i.innerHTML=!1!==e.html?e.html:"",e.bgPos){var n=I(e.bgPos);i.style.backgroundPosition=-n.x+"px "+-n.y+"px"}return this._setIconStyles(i,"icon"),i},createShadow:function(){return null}});ke.Default=Be;var rn=Se.extend({options:{tileSize:256,opacity:1,updateWhenIdle:xt,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){p(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ui(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(ci(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(_i(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=o(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof B?t:new B(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var i,e=this.getPane().children,n=-t(-1/0,1/0),o=0,s=e.length;o<s;o++)i=e[o].style.zIndex,e[o]!==this._container&&i&&(n=t(n,+i));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!et){vi(this._container,this.options.opacity);var t=+new Date,i=!1,e=!1;for(var n in this._tiles){var o=this._tiles[n];if(o.current&&o.loaded){var s=Math.min(1,(t-o.loaded)/200);vi(o.el,s),s<1?i=!0:(o.active?e=!0:this._onOpaqueTile(o),o.active=!0)}}e&&!this._noPrune&&this._pruneTiles(),i&&(C(this._fadeFrame),this._fadeFrame=M(this._updateOpacity,this))}},_onOpaqueTile:l,_initContainer:function(){this._container||(this._container=hi("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,i=this.options.maxZoom;if(void 0!==t){for(var e in this._levels)this._levels[e].el.children.length||e===t?(this._levels[e].el.style.zIndex=i-Math.abs(t-e),this._onUpdateLevel(e)):(ui(this._levels[e].el),this._removeTilesAtZoom(e),this._onRemoveLevel(e),delete this._levels[e]);var n=this._levels[t],o=this._map;return n||((n=this._levels[t]={}).el=hi("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=i,n.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,o.getCenter(),o.getZoom()),n.el.offsetWidth,this._onCreateLevel(n)),this._level=n}},_onUpdateLevel:l,_onRemoveLevel:l,_onCreateLevel:l,_pruneTiles:function(){if(this._map){var t,i,e=this._map.getZoom();if(e>this.options.maxZoom||e<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(i=this._tiles[t]).retain=i.current;for(t in this._tiles)if((i=this._tiles[t]).current&&!i.active){var n=i.coords;this._retainParent(n.x,n.y,n.z,n.z-5)||this._retainChildren(n.x,n.y,n.z,n.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var i in this._tiles)this._tiles[i].coords.z===t&&this._removeTile(i)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ui(this._levels[t].el),this._onRemoveLevel(t),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,i,e,n){var o=Math.floor(t/2),s=Math.floor(i/2),r=e-1,a=new B(+o,+s);a.z=+r;var h=this._tileCoordsToKey(a),u=this._tiles[h];return u&&u.active?u.retain=!0:(u&&u.loaded&&(u.retain=!0),n<r&&this._retainParent(o,s,r,n))},_retainChildren:function(t,i,e,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*i;s<2*i+2;s++){var r=new B(o,s);r.z=e+1;var a=this._tileCoordsToKey(r),h=this._tiles[a];h&&h.active?h.retain=!0:(h&&h.loaded&&(h.retain=!0),e+1<n&&this._retainChildren(o,s,e+1,n))}},_resetView:function(t){var i=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),i,i)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var i=this.options;return void 0!==i.minNativeZoom&&t<i.minNativeZoom?i.minNativeZoom:void 0!==i.maxNativeZoom&&i.maxNativeZoom<t?i.maxNativeZoom:t},_setView:function(t,i,e,n){var o=this._clampZoom(Math.round(i));(void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom)&&(o=void 0);var s=this.options.updateWhenZooming&&o!==this._tileZoom;n&&!s||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),e||this._pruneTiles(),this._noPrune=!!e),this._setZoomTransforms(t,i)},_setZoomTransforms:function(t,i){for(var e in this._levels)this._setZoomTransform(this._levels[e],t,i)},_setZoomTransform:function(t,i,e){var n=this._map.getZoomScale(e,t.zoom),o=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(i,e)).round();yt?xi(t.el,o,n):wi(t.el,o)},_resetGrid:function(){var t=this._map,i=t.options.crs,e=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=i.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,i.wrapLng[0]],n).x/e.x),Math.ceil(t.project([0,i.wrapLng[1]],n).x/e.y)],this._wrapY=i.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([i.wrapLat[0],0],n).y/e.x),Math.ceil(t.project([i.wrapLat[1],0],n).y/e.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var i=this._map,e=i._animatingZoom?Math.max(i._animateToZoom,i.getZoom()):i.getZoom(),n=i.getZoomScale(e,this._tileZoom),o=i.project(t,this._tileZoom).floor(),s=i.getSize().divideBy(2*n);return new O(o.subtract(s),o.add(s))},_update:function(t){var i=this._map;if(i){var e=this._clampZoom(i.getZoom());if(void 0===t&&(t=i.getCenter()),void 0!==this._tileZoom){var n=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(n),s=o.getCenter(),r=[],a=this.options.keepBuffer,h=new O(o.getBottomLeft().subtract([a,-a]),o.getTopRight().add([a,-a]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var u in this._tiles){var l=this._tiles[u].coords;l.z===this._tileZoom&&h.contains(new B(l.x,l.y))||(this._tiles[u].current=!1)}if(1<Math.abs(e-this._tileZoom))this._setView(t,e);else{for(var c=o.min.y;c<=o.max.y;c++)for(var _=o.min.x;_<=o.max.x;_++){var d=new B(_,c);if(d.z=this._tileZoom,this._isValidTile(d)){var p=this._tiles[this._tileCoordsToKey(d)];p?p.current=!0:r.push(d)}}if(r.sort(function(t,i){return t.distanceTo(s)-i.distanceTo(s)}),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(_=0;_<r.length;_++)this._addTile(r[_],m);this._level.el.appendChild(m)}}}}},_isValidTile:function(t){var i=this._map.options.crs;if(!i.infinite){var e=this._globalTileRange;if(!i.wrapLng&&(t.x<e.min.x||t.x>e.max.x)||!i.wrapLat&&(t.y<e.min.y||t.y>e.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return D(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var i=this._map,e=this.getTileSize(),n=t.scaleBy(e),o=n.add(e);return[i.unproject(n,t.z),i.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var i=this._tileCoordsToNwSe(t),e=new N(i[0],i[1]);return this.options.noWrap||(e=this._map.wrapLatLngBounds(e)),e},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var i=t.split(":"),e=new B(+i[0],+i[1]);return e.z=+i[2],e},_removeTile:function(t){var i=this._tiles[t];i&&(ui(i.el),delete this._tiles[t],this.fire("tileunload",{tile:i.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){pi(t,"leaflet-tile");var i=this.getTileSize();t.style.width=i.x+"px",t.style.height=i.y+"px",t.onselectstart=l,t.onmousemove=l,et&&this.options.opacity<1&&vi(t,this.options.opacity),st&&!rt&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,i){var e=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),a(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&M(a(this._tileReady,this,t,null,o)),wi(o,e),this._tiles[n]={el:o,coords:t,current:!0},i.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,i,e){i&&this.fire("tileerror",{error:i,tile:e,coords:t});var n=this._tileCoordsToKey(t);(e=this._tiles[n])&&(e.loaded=+new Date,this._map._fadeAnimated?(vi(e.el,0),C(this._fadeFrame),this._fadeFrame=M(this._updateOpacity,this)):(e.active=!0,this._pruneTiles()),i||(pi(e.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:e.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),et||!this._map._fadeAnimated?M(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var i=new B(this._wrapX?r(t.x,this._wrapX):t.x,this._wrapY?r(t.y,this._wrapY):t.y);return i.z=t.z,i},_pxBoundsToTileRange:function(t){var i=this.getTileSize();return new O(t.min.unscaleBy(i).floor(),t.max.unscaleBy(i).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});var an=rn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,i){this._url=t,(i=p(this,i)).detectRetina&&Ct&&0<i.maxZoom&&(i.tileSize=Math.floor(i.tileSize/2),i.zoomReverse?(i.zoomOffset--,i.minZoom++):(i.zoomOffset++,i.maxZoom--),i.minZoom=Math.max(0,i.minZoom)),"string"==typeof i.subdomains&&(i.subdomains=i.subdomains.split("")),st||this.on("tileunload",this._onTileRemove)},setUrl:function(t,i){return this._url===t&&void 0===i&&(i=!0),this._url=t,i||this.redraw(),this},createTile:function(t,i){var e=document.createElement("img");return Ei(e,"load",a(this._tileOnLoad,this,i,e)),Ei(e,"error",a(this._tileOnError,this,i,e)),!this.options.crossOrigin&&""!==this.options.crossOrigin||(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),e.alt="",e.setAttribute("role","presentation"),e.src=this.getTileUrl(t),e},getTileUrl:function(t){var i={r:Ct?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var e=this._globalTileRange.max.y-t.y;this.options.tms&&(i.y=e),i["-y"]=e}return g(this._url,h(i,this.options))},_tileOnLoad:function(t,i){et?setTimeout(a(t,this,null,i),0):t(null,i)},_tileOnError:function(t,i,e){var n=this.options.errorTileUrl;n&&i.getAttribute("src")!==n&&(i.src=n),t(e,i)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,i=this.options.maxZoom;return this.options.zoomReverse&&(t=i-t),t+this.options.zoomOffset},_getSubdomain:function(t){var i=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[i]},_abortLoading:function(){var t,i;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((i=this._tiles[t].el).onload=l,i.onerror=l,i.complete||(i.src=x,ui(i),delete this._tiles[t]))},_removeTile:function(t){var i=this._tiles[t];if(i)return ht||i.el.setAttribute("src",x),rn.prototype._removeTile.call(this,t)},_tileReady:function(t,i,e){if(this._map&&(!e||e.getAttribute("src")!==x))return rn.prototype._tileReady.call(this,t,i,e)}});function hn(t,i){return new an(t,i)}var un=an.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,i){this._url=t;var e=h({},this.defaultWmsParams);for(var n in i)n in this.options||(e[n]=i[n]);var o=(i=p(this,i)).detectRetina&&Ct?2:1,s=this.getTileSize();e.width=s.x*o,e.height=s.y*o,this.wmsParams=e},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var i=1.3<=this._wmsVersion?"crs":"srs";this.wmsParams[i]=this._crs.code,an.prototype.onAdd.call(this,t)},getTileUrl:function(t){var i=this._tileCoordsToNwSe(t),e=this._crs,n=R(e.project(i[0]),e.project(i[1])),o=n.min,s=n.max,r=(1.3<=this._wmsVersion&&this._crs===Me?[o.y,o.x,s.y,s.x]:[o.x,o.y,s.x,s.y]).join(","),a=an.prototype.getTileUrl.call(this,t);return a+m(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,i){return h(this.wmsParams,t),i||this.redraw(),this}});an.WMS=un,hn.wms=function(t,i){return new un(t,i)};var ln=Se.extend({options:{padding:.1,tolerance:0},initialize:function(t){p(this,t),u(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&pi(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,i){var e=this._map.getZoomScale(i,this._zoom),n=Pi(this._container),o=this._map.getSize().multiplyBy(.5+this.options.padding),s=this._map.project(this._center,i),r=this._map.project(t,i).subtract(s),a=o.multiplyBy(-e).add(n).add(o).subtract(r);yt?xi(this._container,a,e):wi(this._container,a)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,i=this._map.getSize(),e=this._map.containerPointToLayerPoint(i.multiplyBy(-t)).round();this._bounds=new O(e,e.add(i.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),cn=ln.extend({getEvents:function(){var t=ln.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ln.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");Ei(t,"mousemove",o(this._onMouseMove,32,this),this),Ei(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ei(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){C(this._redrawRequest),delete this._ctx,ui(this._container),Bi(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){ln.prototype._update.call(this);var t=this._bounds,i=this._container,e=t.getSize(),n=Ct?2:1;wi(i,t.min),i.width=n*e.x,i.height=n*e.y,i.style.width=e.x+"px",i.style.height=e.y+"px",Ct&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){ln.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t);var i=(this._layers[u(t)]=t)._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=i),this._drawLast=i,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var i=t._order,e=i.next,n=i.prev;e?e.prev=n:this._drawLast=n,n?n.next=e:this._drawFirst=e,delete t._order,delete this._layers[u(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var i,e,n=t.options.dashArray.split(/[, ]+/),o=[];for(e=0;e<n.length;e++){if(i=Number(n[e]),isNaN(i))return;o.push(i)}t.options._dashArray=o}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||M(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var i=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new O,this._redrawBounds.extend(t._pxBounds.min.subtract([i,i])),this._redrawBounds.extend(t._pxBounds.max.add([i,i]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var i=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,i.x,i.y)}else this._ctx.clearRect(0,0,this._container.width,this._container.height)},_draw:function(){var t,i=this._redrawBounds;if(this._ctx.save(),i){var e=i.getSize();this._ctx.beginPath(),this._ctx.rect(i.min.x,i.min.y,e.x,e.y),this._ctx.clip()}this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!i||t._pxBounds&&t._pxBounds.intersects(i))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,i){if(this._drawing){var e,n,o,s,r=t._parts,a=r.length,h=this._ctx;if(a){for(h.beginPath(),e=0;e<a;e++){for(n=0,o=r[e].length;n<o;n++)s=r[e][n],h[n?"lineTo":"moveTo"](s.x,s.y);i&&h.closePath()}this._fillStroke(h,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var i=t._point,e=this._ctx,n=Math.max(Math.round(t._radius),1),o=(Math.max(Math.round(t._radiusY),1)||n)/n;1!=o&&(e.save(),e.scale(1,o)),e.beginPath(),e.arc(i.x,i.y/o,n,0,2*Math.PI,!1),1!=o&&e.restore(),this._fillStroke(e,t)}},_fillStroke:function(t,i){var e=i.options;e.fill&&(t.globalAlpha=e.fillOpacity,t.fillStyle=e.fillColor||e.color,t.fill(e.fillRule||"evenodd")),e.stroke&&0!==e.weight&&(t.setLineDash&&t.setLineDash(i.options&&i.options._dashArray||[]),t.globalAlpha=e.opacity,t.lineWidth=e.weight,t.strokeStyle=e.color,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.stroke())},_onClick:function(t){for(var i,e,n=this._map.mouseEventToLayerPoint(t),o=this._drawFirst;o;o=o.next)(i=o.layer).options.interactive&&i._containsPoint(n)&&!this._map._draggableMoved(i)&&(e=i);e&&(qi(t),this._fireEvent([e],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var i=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,i)}},_handleMouseOut:function(t){var i=this._hoveredLayer;i&&(mi(this._container,"leaflet-interactive"),this._fireEvent([i],t,"mouseout"),this._hoveredLayer=null)},_handleMouseHover:function(t,i){for(var e,n,o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(i)&&(n=e);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(pi(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t)},_fireEvent:function(t,i,e){this._map._fireDOMEvent(i,e||i.type,t)},_bringToFront:function(t){var i=t._order;if(i){var e=i.next,n=i.prev;e&&((e.prev=n)?n.next=e:e&&(this._drawFirst=e),i.prev=this._drawLast,(this._drawLast.next=i).next=null,this._drawLast=i,this._requestRedraw(t))}},_bringToBack:function(t){var i=t._order;if(i){var e=i.next,n=i.prev;n&&((n.next=e)?e.prev=n:n&&(this._drawLast=n),i.prev=null,i.next=this._drawFirst,this._drawFirst.prev=i,this._drawFirst=i,this._requestRedraw(t))}}});function _n(t){return St?new cn(t):null}var dn=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),pn={_initContainer:function(){this._container=hi("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ln.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var i=t._container=dn("shape");pi(i,"leaflet-vml-shape "+(this.options.className||"")),i.coordsize="1 1",t._path=dn("path"),i.appendChild(t._path),this._updateStyle(t),this._layers[u(t)]=t},_addPath:function(t){var i=t._container;this._container.appendChild(i),t.options.interactive&&t.addInteractiveTarget(i)},_removePath:function(t){var i=t._container;ui(i),t.removeInteractiveTarget(i),delete this._layers[u(t)]},_updateStyle:function(t){var i=t._stroke,e=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(i||(i=t._stroke=dn("stroke")),o.appendChild(i),i.weight=n.weight+"px",i.color=n.color,i.opacity=n.opacity,n.dashArray?i.dashStyle=v(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):i.dashStyle="",i.endcap=n.lineCap.replace("butt","flat"),i.joinstyle=n.lineJoin):i&&(o.removeChild(i),t._stroke=null),n.fill?(e||(e=t._fill=dn("fill")),o.appendChild(e),e.color=n.fillColor||n.color,e.opacity=n.fillOpacity):e&&(o.removeChild(e),t._fill=null)},_updateCircle:function(t){var i=t._point.round(),e=Math.round(t._radius),n=Math.round(t._radiusY||e);this._setPath(t,t._empty()?"M0 0":"AL "+i.x+","+i.y+" "+e+","+n+" 0,23592600")},_setPath:function(t,i){t._path.v=i},_bringToFront:function(t){ci(t._container)},_bringToBack:function(t){_i(t._container)}},mn=Et?dn:$,fn=ln.extend({getEvents:function(){var t=ln.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=mn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=mn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ui(this._container),Bi(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){ln.prototype._update.call(this);var t=this._bounds,i=t.getSize(),e=this._container;this._svgSize&&this._svgSize.equals(i)||(this._svgSize=i,e.setAttribute("width",i.x),e.setAttribute("height",i.y)),wi(e,t.min),e.setAttribute("viewBox",[t.min.x,t.min.y,i.x,i.y].join(" ")),this.fire("update")}},_initPath:function(t){var i=t._path=mn("path");t.options.className&&pi(i,t.options.className),t.options.interactive&&pi(i,"leaflet-interactive"),this._updateStyle(t),this._layers[u(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ui(t._path),t.removeInteractiveTarget(t._path),delete this._layers[u(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var i=t._path,e=t.options;i&&(e.stroke?(i.setAttribute("stroke",e.color),i.setAttribute("stroke-opacity",e.opacity),i.setAttribute("stroke-width",e.weight),i.setAttribute("stroke-linecap",e.lineCap),i.setAttribute("stroke-linejoin",e.lineJoin),e.dashArray?i.setAttribute("stroke-dasharray",e.dashArray):i.removeAttribute("stroke-dasharray"),e.dashOffset?i.setAttribute("stroke-dashoffset",e.dashOffset):i.removeAttribute("stroke-dashoffset")):i.setAttribute("stroke","none"),e.fill?(i.setAttribute("fill",e.fillColor||e.color),i.setAttribute("fill-opacity",e.fillOpacity),i.setAttribute("fill-rule",e.fillRule||"evenodd")):i.setAttribute("fill","none"))},_updatePoly:function(t,i){this._setPath(t,Q(t._parts,i))},_updateCircle:function(t){var i=t._point,e=Math.max(Math.round(t._radius),1),n="a"+e+","+(Math.max(Math.round(t._radiusY),1)||e)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(i.x-e)+","+i.y+n+2*e+",0 "+n+2*-e+",0 ";this._setPath(t,o)},_setPath:function(t,i){t._path.setAttribute("d",i)},_bringToFront:function(t){ci(t._path)},_bringToBack:function(t){_i(t._path)}});function gn(t){return Zt||Et?new fn(t):null}Et&&fn.include(pn),Ji.include({getRenderer:function(t){var i=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return i||(i=this._renderer=this._createRenderer()),this.hasLayer(i)||this.addLayer(i),i},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var i=this._paneRenderers[t];return void 0===i&&(i=this._createRenderer({pane:t}),this._paneRenderers[t]=i),i},_createRenderer:function(t){return this.options.preferCanvas&&_n(t)||gn(t)}});var vn=je.extend({initialize:function(t,i){je.prototype.initialize.call(this,this._boundsToLatLngs(t),i)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=D(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});fn.create=mn,fn.pointsToPath=Q,We.geometryToLayer=He,We.coordsToLatLng=Fe,We.coordsToLatLngs=Ue,We.latLngToCoords=Ve,We.latLngsToCoords=qe,We.getFeature=Ge,We.asFeature=Ke,Ji.mergeOptions({boxZoom:!0});var yn=oe.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){Ei(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Bi(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ui(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),$t(),bi(),this._startPoint=this._map.mouseEventToContainerPoint(t),Ei(document,{contextmenu:ji,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=hi("div","leaflet-zoom-box",this._container),pi(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var i=new O(this._point,this._startPoint),e=i.getSize();wi(this._box,i.min),this._box.style.width=e.x+"px",this._box.style.height=e.y+"px"},_finish:function(){this._moved&&(ui(this._box),mi(this._container,"leaflet-crosshair")),Qt(),Ti(),Bi(document,{contextmenu:ji,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0);var i=new N(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(i).fire("boxzoomend",{boxZoomBounds:i})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});Ji.addInitHook("addHandler","boxZoom",yn),Ji.mergeOptions({doubleClickZoom:!0});var xn=oe.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var i=this._map,e=i.getZoom(),n=i.options.zoomDelta,o=t.originalEvent.shiftKey?e-n:e+n;"center"===i.options.doubleClickZoom?i.setZoom(o):i.setZoomAround(t.containerPoint,o)}});Ji.addInitHook("addHandler","doubleClickZoom",xn),Ji.mergeOptions({dragging:!0,inertia:!rt,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var wn=oe.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new le(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}pi(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){mi(this._map._container,"leaflet-grab"),mi(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var i=D(this._map.options.maxBounds);this._offsetLimit=R(this._map.latLngToContainerPoint(i.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(i.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var i=this._lastTime=+new Date,e=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(e),this._times.push(i),this._prunePositions(i)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;1<this._positions.length&&50<t-this._times[0];)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),i=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=i.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,i){return t-(t-i)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),i=this._offsetLimit;t.x<i.min.x&&(t.x=this._viscousLimit(t.x,i.min.x)),t.y<i.min.y&&(t.y=this._viscousLimit(t.y,i.min.y)),t.x>i.max.x&&(t.x=this._viscousLimit(t.x,i.max.x)),t.y>i.max.y&&(t.y=this._viscousLimit(t.y,i.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,i=Math.round(t/2),e=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-i+e)%t+i-e,s=(n+i+e)%t-i-e,r=Math.abs(o+e)<Math.abs(s+e)?o:s;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=r},_onDragEnd:function(t){var i=this._map,e=i.options,n=!e.inertia||this._times.length<2;if(i.fire("dragend",t),n)i.fire("moveend");else{this._prunePositions(+new Date);var o=this._lastPos.subtract(this._positions[0]),s=(this._lastTime-this._times[0])/1e3,r=e.easeLinearity,a=o.multiplyBy(r/s),h=a.distanceTo([0,0]),u=Math.min(e.inertiaMaxSpeed,h),l=a.multiplyBy(u/h),c=u/(e.inertiaDeceleration*r),_=l.multiplyBy(-c/2).round();_.x||_.y?(_=i._limitOffset(_,i.options.maxBounds),M(function(){i.panBy(_,{duration:c,easeLinearity:r,noMoveStart:!0,animate:!0})})):i.fire("moveend")}}});Ji.addInitHook("addHandler","dragging",wn),Ji.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Pn=oe.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),Ei(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Bi(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,i=document.documentElement,e=t.scrollTop||i.scrollTop,n=t.scrollLeft||i.scrollLeft;this._map._container.focus(),window.scrollTo(n,e)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var i,e,n=this._panKeys={},o=this.keyCodes;for(i=0,e=o.left.length;i<e;i++)n[o.left[i]]=[-1*t,0];for(i=0,e=o.right.length;i<e;i++)n[o.right[i]]=[t,0];for(i=0,e=o.down.length;i<e;i++)n[o.down[i]]=[0,t];for(i=0,e=o.up.length;i<e;i++)n[o.up[i]]=[0,-1*t]},_setZoomDelta:function(t){var i,e,n=this._zoomKeys={},o=this.keyCodes;for(i=0,e=o.zoomIn.length;i<e;i++)n[o.zoomIn[i]]=t;for(i=0,e=o.zoomOut.length;i<e;i++)n[o.zoomOut[i]]=-t},_addHooks:function(){Ei(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Bi(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var i,e=t.keyCode,n=this._map;if(e in this._panKeys)n._panAnim&&n._panAnim._inProgress||(i=this._panKeys[e],t.shiftKey&&(i=I(i).multiplyBy(3)),n.panBy(i),n.options.maxBounds&&n.panInsideBounds(n.options.maxBounds));else if(e in this._zoomKeys)n.setZoom(n.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[e]);else{if(27!==e||!n._popup||!n._popup.options.closeOnEscapeKey)return;n.closePopup()}ji(t)}}});Ji.addInitHook("addHandler","keyboard",Pn),Ji.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Ln=oe.extend({addHooks:function(){Ei(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Bi(this._map._container,"mousewheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var i=Fi(t),e=this._map.options.wheelDebounceTime;this._delta+=i,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var n=Math.max(e-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(a(this._performZoom,this),n),ji(t)},_performZoom:function(){var t=this._map,i=t.getZoom(),e=this._map.options.zoomSnap||0;t._stop();var n=this._delta/(4*this._map.options.wheelPxPerZoomLevel),o=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,s=e?Math.ceil(o/e)*e:o,r=t._limitZoom(i+(0<this._delta?s:-s))-i;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(i+r):t.setZoomAround(this._lastMousePos,i+r))}});Ji.addInitHook("addHandler","scrollWheelZoom",Ln),Ji.mergeOptions({tap:!0,tapTolerance:15});var bn=oe.extend({addHooks:function(){Ei(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Bi(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(Di(t),this._fireClick=!0,1<t.touches.length)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var i=t.touches[0],e=i.target;this._startPos=this._newPos=new B(i.clientX,i.clientY),e.tagName&&"a"===e.tagName.toLowerCase()&&pi(e,"leaflet-active"),this._holdTimeout=setTimeout(a(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",i))},this),1e3),this._simulateEvent("mousedown",i),Ei(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),Bi(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var i=t.changedTouches[0],e=i.target;e&&e.tagName&&"a"===e.tagName.toLowerCase()&&mi(e,"leaflet-active"),this._simulateEvent("mouseup",i),this._isTapValid()&&this._simulateEvent("click",i)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var i=t.touches[0];this._newPos=new B(i.clientX,i.clientY),this._simulateEvent("mousemove",i)},_simulateEvent:function(t,i){var e=document.createEvent("MouseEvents");e._simulated=!0,i.target._simulatedClick=!0,e.initMouseEvent(t,!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),i.target.dispatchEvent(e)}});Tt&&!bt&&Ji.addInitHook("addHandler","tap",bn),Ji.mergeOptions({touchZoom:Tt&&!rt,bounceAtZoomLimits:!0});var Tn=oe.extend({addHooks:function(){pi(this._map._container,"leaflet-touch-zoom"),Ei(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){mi(this._map._container,"leaflet-touch-zoom"),Bi(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var i=this._map;if(t.touches&&2===t.touches.length&&!i._animatingZoom&&!this._zooming){var e=i.mouseEventToContainerPoint(t.touches[0]),n=i.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=i.getSize()._divideBy(2),this._startLatLng=i.containerPointToLatLng(this._centerPoint),"center"!==i.options.touchZoom&&(this._pinchStartLatLng=i.containerPointToLatLng(e.add(n)._divideBy(2))),this._startDist=e.distanceTo(n),this._startZoom=i.getZoom(),this._moved=!1,this._zooming=!0,i._stop(),Ei(document,"touchmove",this._onTouchMove,this),Ei(document,"touchend",this._onTouchEnd,this),Di(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var i=this._map,e=i.mouseEventToContainerPoint(t.touches[0]),n=i.mouseEventToContainerPoint(t.touches[1]),o=e.distanceTo(n)/this._startDist;if(this._zoom=i.getScaleZoom(o,this._startZoom),!i.options.bounceAtZoomLimits&&(this._zoom<i.getMinZoom()&&o<1||this._zoom>i.getMaxZoom()&&1<o)&&(this._zoom=i._limitZoom(this._zoom)),"center"===i.options.touchZoom){if(this._center=this._startLatLng,1==o)return}else{var s=e._add(n)._divideBy(2)._subtract(this._centerPoint);if(1==o&&0===s.x&&0===s.y)return;this._center=i.unproject(i.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(i._moveStart(!0,!1),this._moved=!0),C(this._animRequest);var r=a(i._move,i,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=M(r,this,!0),Di(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,C(this._animRequest),Bi(document,"touchmove",this._onTouchMove),Bi(document,"touchend",this._onTouchEnd),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});Ji.addInitHook("addHandler","touchZoom",Tn),Ji.BoxZoom=yn,Ji.DoubleClickZoom=xn,Ji.Drag=wn,Ji.Keyboard=Pn,Ji.ScrollWheelZoom=Ln,Ji.Tap=bn,Ji.TouchZoom=Tn,Object.freeze=i,t.version="1.5.1+HEAD.2e3e0ff",t.Control=Qi,t.control=$i,t.Browser=Bt,t.Evented=k,t.Mixin=re,t.Util=S,t.Class=Z,t.Handler=oe,t.extend=h,t.bind=a,t.stamp=u,t.setOptions=p,t.DomEvent=Yi,t.DomUtil=Zi,t.PosAnimation=Xi,t.Draggable=le,t.LineUtil=ye,t.PolyUtil=Pe,t.Point=B,t.point=I,t.Bounds=O,t.bounds=R,t.Transformation=G,t.transformation=K,t.Projection=Te,t.LatLng=j,t.latLng=W,t.LatLngBounds=N,t.latLngBounds=D,t.CRS=F,t.GeoJSON=We,t.geoJSON=Xe,t.geoJson=Je,t.Layer=Se,t.LayerGroup=Ze,t.layerGroup=function(t,i){return new Ze(t,i)},t.FeatureGroup=Ee,t.featureGroup=function(t){return new Ee(t)},t.ImageOverlay=$e,t.imageOverlay=function(t,i,e){return new $e(t,i,e)},t.VideoOverlay=Qe,t.videoOverlay=function(t,i,e){return new Qe(t,i,e)},t.SVGOverlay=tn,t.svgOverlay=function(t,i,e){return new tn(t,i,e)},t.DivOverlay=en,t.Popup=nn,t.popup=function(t,i){return new nn(t,i)},t.Tooltip=on,t.tooltip=function(t,i){return new on(t,i)},t.Icon=ke,t.icon=function(t){return new ke(t)},t.DivIcon=sn,t.divIcon=function(t){return new sn(t)},t.Marker=Ie,t.marker=function(t,i){return new Ie(t,i)},t.TileLayer=an,t.tileLayer=hn,t.GridLayer=rn,t.gridLayer=function(t){return new rn(t)},t.SVG=fn,t.svg=gn,t.Renderer=ln,t.Canvas=cn,t.canvas=_n,t.Path=Oe,t.CircleMarker=Re,t.circleMarker=function(t,i){return new Re(t,i)},t.Circle=Ne,t.circle=function(t,i,e){return new Ne(t,i,e)},t.Polyline=De,t.polyline=function(t,i){return new De(t,i)},t.Polygon=je,t.polygon=function(t,i){return new je(t,i)},t.Rectangle=vn,t.rectangle=function(t,i){return new vn(t,i)},t.Map=Ji,t.map=function(t,i){return new Ji(t,i)};var zn=window.L;t.noConflict=function(){return window.L=zn,this},window.L=t});
@@ -0,0 +1,164 @@
1
+ .marker-icon,
2
+ .marker-icon:focus {
3
+ background-color: #ffffff;
4
+ border: 1px solid #3388ff;
5
+ border-radius: 50%;
6
+ margin: -8px 0 0 -8px !important;
7
+ width: 14px !important;
8
+ height: 14px !important;
9
+ outline: 0;
10
+ transition: opacity ease 0.3s;
11
+ }
12
+
13
+ .marker-icon-middle,
14
+ .marker-icon-middle:focus {
15
+ opacity: 0.7;
16
+ margin: -6px 0 0 -6px !important;
17
+ width: 10px !important;
18
+ height: 10px !important;
19
+ }
20
+
21
+ .leaflet-pm-draggable {
22
+ cursor: move !important;
23
+ }
24
+
25
+ .cursor-marker {
26
+ cursor: crosshair;
27
+ pointer-events: none;
28
+ display: none;
29
+ }
30
+
31
+ .cursor-marker.visible {
32
+ display: block !important;
33
+ }
34
+
35
+ .leaflet-pm-invalid {
36
+ stroke: red;
37
+ transition: fill ease 0s, stroke ease 0s;
38
+ }
39
+
40
+ .rect-style-marker,
41
+ .rect-start-marker {
42
+ opacity: 0;
43
+ }
44
+
45
+ .rect-style-marker.visible,
46
+ .rect-start-marker.visible {
47
+ opacity: 1 !important;
48
+ }
49
+
50
+ .hidden {
51
+ display: none;
52
+ }
53
+
54
+ .leaflet-pm-toolbar {
55
+ }
56
+
57
+ .leaflet-pm-toolbar .leaflet-buttons-control-button {
58
+ padding: 5px;
59
+ box-sizing: border-box;
60
+ position: relative;
61
+ z-index: 3;
62
+ }
63
+
64
+ .leaflet-pm-toolbar .control-fa-icon {
65
+ font-size: 19px;
66
+ line-height: 24px;
67
+ }
68
+
69
+ .leaflet-pm-toolbar .control-icon {
70
+ width: 100%;
71
+ height: 100%;
72
+ box-sizing: border-box;
73
+ background-size: contain;
74
+ background-repeat: no-repeat;
75
+ background-position: center center;
76
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UgeGxpbms6aHJlZj0iI3BhdGgtMSI+PC91c2U+CiAgICAgICAgICAgIDwvbWFzaz4KICAgICAgICAgICAgPHVzZSBpZD0iTWFzayIgZmlsbD0iIzVCNUI1QiIgZmlsbC1ydWxlPSJub256ZXJvIiB4bGluazpocmVmPSIjcGF0aC0xIj48L3VzZT4KICAgICAgICAgICAgPGcgaWQ9IkF0b21zL0NvbG9yL0dyZXkiIG1hc2s9InVybCgjbWFzay0yKSIgZmlsbD0iIzVCNUI1QiI+CiAgICAgICAgICAgICAgICA8cmVjdCBpZD0iUmVjdGFuZ2xlIiB4PSIwIiB5PSIwIiB3aWR0aD0iMzAiIGhlaWdodD0iMzAiPjwvcmVjdD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+);
89
+ }
90
+ .leaflet-pm-toolbar .leaflet-pm-icon-circle-marker {
91
+ background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KCjxzdmcgdmlld0JveD0iMCAwIDEwMCAxMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjNUI1QjVCIiBzdHJva2Utd2lkdGg9IjgiCiAgICAgZmlsbD0ibm9uZSI+CjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIHI9IjM1Ii8+CiAgPGNpcmNsZSBjeD0iNTAiIGN5PSI1MCIgcj0iMyIgZmlsbD0iIzVCNUI1QiIvPgo8L3N2Zz4=);
92
+ }
93
+ .leaflet-pm-toolbar .leaflet-pm-icon-rectangle {
94
+ background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAy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gICAgICAgICAgICAgICA8dXNlIHhsaW5rOmhyZWY9IiNwYXRoLTEiPjwvdXNlPgogICAgICAgICAgICA8L21hc2s+CiAgICAgICAgICAgIDx1c2UgaWQ9Ik1hc2siIGZpbGw9IiM1QjVCNUIiIGZpbGwtcnVsZT0ibm9uemVybyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTYuMDkzMTk0LCAxNS42NjMzNTEpIHJvdGF0ZSgtMzIuMDAwMDAwKSB0cmFuc2xhdGUoLTE2LjA5MzE5NCwgLTE1LjY2MzM1MSkgIiB4bGluazpocmVmPSIjcGF0aC0xIj48L3VzZT4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==);
107
+ }
108
+
109
+ .leaflet-buttons-control-button:hover {
110
+ cursor: pointer;
111
+ background-color: #f4f4f4;
112
+ }
113
+ .active .leaflet-buttons-control-button {
114
+ box-shadow: inset 0 -1px 5px 2px rgba(81, 77, 77, 0.31);
115
+ }
116
+
117
+ .leaflet-buttons-control-text-hide {
118
+ display: none;
119
+ }
120
+
121
+ .button-container {
122
+ position: relative;
123
+ }
124
+
125
+ .button-container .leaflet-pm-actions-container {
126
+ z-index: 2;
127
+ position: absolute;
128
+ top: 0;
129
+ left: 31px;
130
+ display: none;
131
+ white-space: nowrap;
132
+ }
133
+
134
+ .leaflet-right
135
+ .leaflet-pm-toolbar
136
+ .button-container
137
+ .leaflet-pm-actions-container {
138
+ right: 31px;
139
+ left: auto;
140
+ }
141
+
142
+ .button-container.active .leaflet-pm-actions-container {
143
+ display: block;
144
+ }
145
+
146
+ .button-container .leaflet-pm-actions-container .leaflet-pm-action:last-child {
147
+ border-radius: 0px 3px 3px 0px;
148
+ border-right: 0px;
149
+ }
150
+ .button-container .leaflet-pm-actions-container .leaflet-pm-action {
151
+ padding: 0px 10px;
152
+ background-color: #666;
153
+ color: #fff;
154
+ display: inline-block;
155
+ width: auto;
156
+ border-right: 1px solid #eee;
157
+ user-select: none;
158
+ }
159
+
160
+ .button-container .leaflet-pm-actions-container .leaflet-pm-action:hover {
161
+ cursor: pointer;
162
+ background-color: #777;
163
+ }
164
+
metadata ADDED
@@ -0,0 +1,183 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: decidim-navigation_maps
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Ivan Vergés
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-01-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: decidim-admin
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.18.0
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '0.22'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 0.18.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '0.22'
33
+ - !ruby/object:Gem::Dependency
34
+ name: decidim-core
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: 0.18.0
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '0.22'
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: 0.18.0
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '0.22'
53
+ - !ruby/object:Gem::Dependency
54
+ name: decidim-dev
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: 0.18.0
60
+ - - "<"
61
+ - !ruby/object:Gem::Version
62
+ version: '0.22'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: 0.18.0
70
+ - - "<"
71
+ - !ruby/object:Gem::Version
72
+ version: '0.22'
73
+ description: Allows to map processes to image parts using maps.
74
+ email:
75
+ - ivan@platoniq.net
76
+ executables: []
77
+ extensions: []
78
+ extra_rdoc_files: []
79
+ files:
80
+ - LICENSE-AGPLv3.txt
81
+ - README.md
82
+ - Rakefile
83
+ - app/assets/config/admin/decidim_navigation_maps_manifest.css
84
+ - app/assets/config/admin/decidim_navigation_maps_manifest.js
85
+ - app/assets/config/decidim_navigation_maps_manifest.css
86
+ - app/assets/config/decidim_navigation_maps_manifest.js
87
+ - app/assets/images/decidim/navigation_maps/icon.svg
88
+ - app/assets/javascripts/decidim/navigation_maps/admin/map_editor.js
89
+ - app/assets/javascripts/decidim/navigation_maps/admin/navigation_maps.js
90
+ - app/assets/javascripts/decidim/navigation_maps/map_view.js
91
+ - app/assets/javascripts/decidim/navigation_maps/navigation_maps.js
92
+ - app/assets/stylesheets/decidim/navigation_maps/_variables.scss
93
+ - app/assets/stylesheets/decidim/navigation_maps/admin/navigation_maps.scss
94
+ - app/assets/stylesheets/decidim/navigation_maps/navigation_maps.scss
95
+ - app/cells/decidim/navigation_maps/content_blocks/navigation_map/_styles.erb
96
+ - app/cells/decidim/navigation_maps/content_blocks/navigation_map/_tabs.erb
97
+ - app/cells/decidim/navigation_maps/content_blocks/navigation_map/_tabs_content.erb
98
+ - app/cells/decidim/navigation_maps/content_blocks/navigation_map/_template.erb
99
+ - app/cells/decidim/navigation_maps/content_blocks/navigation_map/show.erb
100
+ - app/cells/decidim/navigation_maps/content_blocks/navigation_map_cell.rb
101
+ - app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form/_form.erb
102
+ - app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form/_modal.erb
103
+ - app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form/_tabs.erb
104
+ - app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form/_tabs_content.erb
105
+ - app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form/show.erb
106
+ - app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form_cell.rb
107
+ - app/commands/decidim/navigation_maps/save_area.rb
108
+ - app/commands/decidim/navigation_maps/save_blueprints.rb
109
+ - app/controllers/decidim/navigation_maps/admin/application_controller.rb
110
+ - app/controllers/decidim/navigation_maps/admin/areas_controller.rb
111
+ - app/controllers/decidim/navigation_maps/admin/blueprints_controller.rb
112
+ - app/forms/decidim/navigation_maps/area_form.rb
113
+ - app/forms/decidim/navigation_maps/blueprint_form.rb
114
+ - app/forms/decidim/navigation_maps/blueprint_forms.rb
115
+ - app/models/decidim/navigation_maps/application_record.rb
116
+ - app/models/decidim/navigation_maps/blueprint.rb
117
+ - app/models/decidim/navigation_maps/blueprint_area.rb
118
+ - app/queries/decidim/navigation_maps/organization_blueprints.rb
119
+ - app/uploaders/decidim/navigation_maps/blueprint_uploader.rb
120
+ - app/views/decidim/navigation_maps/admin/areas/_form.html.erb
121
+ - app/views/decidim/navigation_maps/admin/areas/new.html.erb
122
+ - app/views/decidim/navigation_maps/admin/areas/show.html.erb
123
+ - config/i18n-tasks.yml
124
+ - config/locales/ca.yml
125
+ - config/locales/cs.yml
126
+ - config/locales/en.yml
127
+ - config/locales/es.yml
128
+ - db/migrate/20191022092624_create_decidim_navigation_maps_blueprints.rb
129
+ - db/migrate/20191120185739_add_title_to_navigation_maps_blueprints.rb
130
+ - db/migrate/20191125142751_create_decidim_navigation_maps_blueprint_areas.rb
131
+ - db/migrate/20191126045831_add_link_type_to_decidim_navigation_maps_blueprint_areas.rb
132
+ - db/migrate/20191126154019_add_area_id_to_decidim_navigation_maps_blueprint_areas.rb
133
+ - db/migrate/20191127093746_add_color_to_navigation_maps_blueprint_areas.rb
134
+ - lib/decidim/navigation_maps.rb
135
+ - lib/decidim/navigation_maps/admin.rb
136
+ - lib/decidim/navigation_maps/admin_engine.rb
137
+ - lib/decidim/navigation_maps/engine.rb
138
+ - lib/decidim/navigation_maps/navigation_map_cell_helpers.rb
139
+ - lib/decidim/navigation_maps/test/factories.rb
140
+ - lib/decidim/navigation_maps/version.rb
141
+ - vendor/assets/images/draw/layers-2x.png
142
+ - vendor/assets/images/draw/layers.png
143
+ - vendor/assets/images/draw/marker-icon-2x.png
144
+ - vendor/assets/images/draw/marker-icon.png
145
+ - vendor/assets/images/draw/marker-shadow.png
146
+ - vendor/assets/images/draw/spritesheet-2x.png
147
+ - vendor/assets/images/draw/spritesheet.png
148
+ - vendor/assets/images/draw/spritesheet.svg
149
+ - vendor/assets/images/images/layers-2x.png
150
+ - vendor/assets/images/images/layers.png
151
+ - vendor/assets/images/images/marker-icon-2x.png
152
+ - vendor/assets/images/images/marker-icon.png
153
+ - vendor/assets/images/images/marker-shadow.png
154
+ - vendor/assets/javascripts/jquery.form.js
155
+ - vendor/assets/javascripts/jsrender.min.js
156
+ - vendor/assets/javascripts/jsrender.min.js.map
157
+ - vendor/assets/javascripts/leaflet-geoman.min.js
158
+ - vendor/assets/javascripts/leaflet.js
159
+ - vendor/assets/stylesheets/leaflet-geoman.css
160
+ homepage: https://github.com/Platoniq/decidim-module-navigation_maps
161
+ licenses:
162
+ - AGPL-3.0
163
+ metadata: {}
164
+ post_install_message:
165
+ rdoc_options: []
166
+ require_paths:
167
+ - lib
168
+ required_ruby_version: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: '2.5'
173
+ required_rubygems_version: !ruby/object:Gem::Requirement
174
+ requirements:
175
+ - - ">="
176
+ - !ruby/object:Gem::Version
177
+ version: '0'
178
+ requirements: []
179
+ rubygems_version: 3.1.4
180
+ signing_key:
181
+ specification_version: 4
182
+ summary: A decidim navigation_maps module
183
+ test_files: []