diff --git a/public/assets/scripts/main.js b/public/assets/scripts/main.js index f5bcde579..8e466c8ad 100644 --- a/public/assets/scripts/main.js +++ b/public/assets/scripts/main.js @@ -1,2 +1,2 @@ /*! For license information please see main.js.LICENSE.txt */ -(()=>{var t,e={70:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(540),r=6378137;function o(t){var e=0;if(t&&t.length>0){e+=Math.abs(s(t[0]));for(var i=1;i2){for(l=0;l{"use strict";var n=i(540);function r(t){var e=[1/0,1/0,-1/0,-1/0];return n.coordEach(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]{"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var r=n(i(209)),o=n(i(70)),s=i(102),a=i(611),l=i(540);function u(t){switch(t.type){case"Polygon":return o(t)>1?t:null;case"MultiPolygon":var e=[];if(l.flattenEach(t,(function(t){o(t)>1&&e.push(t.geometry.coordinates)})),e.length)return{type:"MultiPolygon",coordinates:e}}}t.exports=function(t,e){var i=a.getGeom(t),n=a.getGeom(e),o=t.properties||{};if(i=u(i),n=u(n),!i)return null;if(!n)return s.feature(i,o);var l=r.diff(i.coordinates,n.coordinates);return 0===l.length?null:1===l.length?s.polygon(l[0],o):s.multiPolygon(l,o)}},102:(t,e)=>{"use strict";function i(t,e,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=e||{},n.geometry=t,n}function n(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!f(t[0])||!f(t[1]))throw new Error("coordinates must contain numbers");return i({type:"Point",coordinates:t},e,n)}function r(t,e,n){void 0===n&&(n={});for(var r=0,o=t;r=0))throw new Error("precision must be a positive number");var i=Math.pow(10,e||0);return Math.round(t*i)/i},e.radiansToLength=h,e.lengthToRadians=c,e.lengthToDegrees=function(t,e){return d(c(t,e))},e.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},e.radiansToDegrees=d,e.degreesToRadians=function(t){return t%360*Math.PI/180},e.convertLength=function(t,e,i){if(void 0===e&&(e="kilometers"),void 0===i&&(i="kilometers"),!(t>=0))throw new Error("length must be a positive number");return h(c(t,e),i)},e.convertArea=function(t,i,n){if(void 0===i&&(i="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var r=e.areaFactors[i];if(!r)throw new Error("invalid original units");var o=e.areaFactors[n];if(!o)throw new Error("invalid final units");return t/r*o},e.isNumber=f,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(!f(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")}},611:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(102);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)&&t.length>=2&&!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(e.length>1&&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,i){if(!e||!i)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+i+": must be a "+e+", given "+t.type)},e.featureOf=function(t,e,i){if(!t)throw new Error("No feature passed");if(!i)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+i+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+i+": must be a "+e+", given "+t.geometry.type)},e.collectionOf=function(t,e,i){if(!t)throw new Error("No featureCollection passed");if(!i)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+i+", FeatureCollection required");for(var n=0,r=t.features;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(102);function r(t,e,i){if(null!==t)for(var n,o,s,a,l,u,h,c,d=0,f=0,p=t.type,g="FeatureCollection"===p,m="Feature"===p,v=g?t.features.length:1,y=0;yu||f>h||p>c)return l=r,u=i,h=f,c=p,void(s=0);var g=n.lineString([l,r],t.properties);if(!1===e(g,i,o,p,s))return!1;s++,l=r}))&&void 0}}}))}function h(t,e){if(!t)throw new Error("geojson is required");l(t,(function(t,i,r){if(null!==t.geometry){var o=t.geometry.type,s=t.geometry.coordinates;switch(o){case"LineString":if(!1===e(t,i,r,0,0))return!1;break;case"Polygon":for(var a=0;a{var e=function(){var t={};function e(t,e){return new P(null,t+" uniform sampler2D texture; uniform vec2 texSize; varying vec2 texCoord; void main() { vec2 coord = texCoord * texSize; "+e+" gl_FragColor = texture2D(texture, coord / texSize); vec2 clampedCoord = clamp(coord, vec2(0.0), texSize); if (coord != clampedCoord) { /* fade to transparent if we are outside the image */ gl_FragColor.a *= max(0.0, 1.0 - length(coord - clampedCoord)); } }")}var i=" float random(vec3 scale, float seed) { /* use the fragment position for a different seed per-pixel */ return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed); }";function n(t,e){return A.brightnessContrast=A.brightnessContrast||new P(null," uniform sampler2D texture; uniform float brightness; uniform float contrast; varying vec2 texCoord; void main() { vec4 color = texture2D(texture, texCoord); color.rgb += brightness; if (contrast > 0.0) { color.rgb = (color.rgb - 0.5) / (1.0 - contrast) + 0.5; } else { color.rgb = (color.rgb - 0.5) * (1.0 + contrast) + 0.5; } gl_FragColor = color; } "),$.call(this,A.brightnessContrast,{brightness:k(-1,t,1),contrast:k(-1,e,1)}),this}function r(t){return A.gamma=A.gamma||new P(null," uniform sampler2D texture; uniform float gamma; varying vec2 texCoord; void main() { vec4 color = texture2D(texture, texCoord); color.rgb = pow(color.rgb, vec3(gamma)); gl_FragColor = color; } "),$.call(this,A.gamma,{gamma:k(0,t,5)}),this}function o(t){return A.vibrance=A.vibrance||new P(null," uniform sampler2D texture; uniform float amount; varying vec2 texCoord; void main() { vec4 color = texture2D(texture, texCoord); float average = (color.r + color.g + color.b) / 3.0; float mx = max(color.r, max(color.g, color.b)); float amt = (mx - average) * (-amount * 3.0); color.rgb = mix(color.rgb, vec3(mx), amt); gl_FragColor = color; } "),$.call(this,A.vibrance,{amount:k(-1,t,1)}),this}function s(t){for(var e=new V(t),i=[],n=0;n<256;n++)i.push(k(0,Math.floor(256*e.interpolate(n/255)),255));return i}function a(t,e,i){t=s(t),1==arguments.length?e=i=t:(e=s(e),i=s(i));for(var n=[],r=0;r<256;r++)n.splice(n.length,0,t[r],e[r],i[r],255);return this._.extraTexture.initFromBytes(256,1,n),this._.extraTexture.use(1),A.curves=A.curves||new P(null," uniform sampler2D texture; uniform sampler2D map; varying vec2 texCoord; void main() { vec4 color = texture2D(texture, texCoord); color.r = texture2D(map, vec2(color.r)).r; color.g = texture2D(map, vec2(color.g)).g; color.b = texture2D(map, vec2(color.b)).b; gl_FragColor = color; } "),A.curves.textures({map:1}),$.call(this,A.curves,{}),this}function l(t,e,i){return A.brightnessRGB=A.brightnessRGB||new P(null," uniform sampler2D texture; uniform float r; uniform float g; uniform float b; varying vec2 texCoord; void main() { vec4 color = texture2D(texture, texCoord); color.r += r; color.g += g; color.b += b; gl_FragColor = color; } "),$.call(this,A.brightnessRGB,{r:k(-1,t,1),g:k(-1,e,1),b:k(-1,i,1)}),this}function u(t,e){return A.vignette=A.vignette||new P(null," uniform sampler2D texture; uniform float size; uniform float amount; varying vec2 texCoord; void main() { vec4 color = texture2D(texture, texCoord); float dist = distance(texCoord, vec2(0.5, 0.5)); color.rgb *= smoothstep(0.8, size * 0.799, dist * (amount + size)); gl_FragColor = color; } "),$.call(this,A.vignette,{size:k(0,t,1),amount:k(0,e,1)}),this}function h(t){return A.noise=A.noise||new P(null," uniform sampler2D texture; uniform float amount; varying vec2 texCoord; float rand(vec2 co) { return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); } void main() { vec4 color = texture2D(texture, texCoord); float diff = (rand(texCoord) - 0.5) * amount; color.r += diff; color.g += diff; color.b += diff; gl_FragColor = color; } "),$.call(this,A.noise,{amount:k(0,t,1)}),this}function c(t){A.denoise=A.denoise||new P(null," uniform sampler2D texture; uniform float exponent; uniform float strength; uniform vec2 texSize; varying vec2 texCoord; void main() { vec4 center = texture2D(texture, texCoord); vec4 color = vec4(0.0); float total = 0.0; for (float x = -4.0; x <= 4.0; x += 1.0) { for (float y = -4.0; y <= 4.0; y += 1.0) { vec4 sample = texture2D(texture, texCoord + vec2(x, y) / texSize); float weight = 1.0 - abs(dot(sample.rgb - center.rgb, vec3(0.25))); weight = pow(weight, exponent); color += sample * weight; total += weight; } } gl_FragColor = color / total; } ");for(var e=0;e<2;e++)$.call(this,A.denoise,{exponent:Math.max(0,t),texSize:[this.width,this.height]});return this}function d(t){return A.sepia=A.sepia||new P(null," uniform sampler2D texture; uniform float amount; varying vec2 texCoord; void main() { vec4 color = texture2D(texture, texCoord); float r = color.r; float g = color.g; float b = color.b; color.r = min(1.0, (r * (1.0 - (0.607 * amount))) + (g * (0.769 * amount)) + (b * (0.189 * amount))); color.g = min(1.0, (r * 0.349 * amount) + (g * (1.0 - (0.314 * amount))) + (b * 0.168 * amount)); color.b = min(1.0, (r * 0.272 * amount) + (g * 0.534 * amount) + (b * (1.0 - (0.869 * amount)))); gl_FragColor = color; } "),$.call(this,A.sepia,{amount:k(0,t,1)}),this}function f(t,e){return A.unsharpMask=A.unsharpMask||new P(null," uniform sampler2D blurredTexture; uniform sampler2D originalTexture; uniform float strength; uniform float threshold; varying vec2 texCoord; void main() { vec4 blurred = texture2D(blurredTexture, texCoord); vec4 original = texture2D(originalTexture, texCoord); gl_FragColor = mix(blurred, original, 1.0 + strength); } "),this._.extraTexture.ensureFormat(this._.texture),this._.texture.use(),this._.extraTexture.drawTo((function(){P.getDefaultShader().drawRect()})),this._.extraTexture.use(1),this.triangleBlur(t),A.unsharpMask.textures({originalTexture:1}),$.call(this,A.unsharpMask,{strength:e}),this._.extraTexture.unuse(1),this}function p(t,e){return A.hueSaturation=A.hueSaturation||new P(null," uniform sampler2D texture; uniform float hue; uniform float saturation; varying vec2 texCoord; void main() { vec4 color = texture2D(texture, texCoord); /* hue adjustment, wolfram alpha: RotationTransform[angle, {1, 1, 1}][{x, y, z}] */ float angle = hue * 3.14159265; float s = sin(angle), c = cos(angle); vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0; float len = length(color.rgb); color.rgb = vec3( dot(color.rgb, weights.xyz), dot(color.rgb, weights.zxy), dot(color.rgb, weights.yzx) ); /* saturation adjustment */ float average = (color.r + color.g + color.b) / 3.0; if (saturation > 0.0) { color.rgb += (average - color.rgb) * (1.0 - 1.0 / (1.001 - saturation)); } else { color.rgb += (average - color.rgb) * (-saturation); } gl_FragColor = color; } "),$.call(this,A.hueSaturation,{hue:k(-1,t,1),saturation:k(-1,e,1)}),this}function g(t,i,n,r){return A.swirl=A.swirl||e(" uniform float radius; uniform float angle; uniform vec2 center; "," coord -= center; float distance = length(coord); if (distance < radius) { float percent = (radius - distance) / radius; float theta = percent * percent * angle; float s = sin(theta); float c = cos(theta); coord = vec2( coord.x * c - coord.y * s, coord.x * s + coord.y * c ); } coord += center; "),$.call(this,A.swirl,{radius:n,center:[t,i],angle:r,texSize:[this.width,this.height]}),this}function m(t,e){var i=U.apply(null,e),n=U.apply(null,t),r=function(t,e){return[t[0]*e[0]+t[1]*e[3]+t[2]*e[6],t[0]*e[1]+t[1]*e[4]+t[2]*e[7],t[0]*e[2]+t[1]*e[5]+t[2]*e[8],t[3]*e[0]+t[4]*e[3]+t[5]*e[6],t[3]*e[1]+t[4]*e[4]+t[5]*e[7],t[3]*e[2]+t[4]*e[5]+t[5]*e[8],t[6]*e[0]+t[7]*e[3]+t[8]*e[6],t[6]*e[1]+t[7]*e[4]+t[8]*e[7],t[6]*e[2]+t[7]*e[5]+t[8]*e[8]]}(z(i),n);return this.matrixWarp(r)}function v(t,i,n,r){return A.bulgePinch=A.bulgePinch||e(" uniform float radius; uniform float strength; uniform vec2 center; "," coord -= center; float distance = length(coord); if (distance < radius) { float percent = distance / radius; if (strength > 0.0) { coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75); } else { coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent); } } coord += center; "),$.call(this,A.bulgePinch,{radius:n,strength:k(-1,r,1),center:[t,i],texSize:[this.width,this.height]}),this}function y(t,i,n){if(A.matrixWarp=A.matrixWarp||e(" uniform mat3 matrix; uniform bool useTextureSpace; "," if (useTextureSpace) coord = coord / texSize * 2.0 - 1.0; vec3 warp = matrix * vec3(coord, 1.0); coord = warp.xy / warp.z; if (useTextureSpace) coord = (coord * 0.5 + 0.5) * texSize; "),4==(t=Array.prototype.concat.apply([],t)).length)t=[t[0],t[1],0,t[2],t[3],0,0,0,1];else if(9!=t.length)throw"can only warp with 2x2 or 3x3 matrix";return $.call(this,A.matrixWarp,{matrix:i?z(t):t,texSize:[this.width,this.height],useTextureSpace:0|n}),this}function _(t,e,n){return A.zoomBlur=A.zoomBlur||new P(null," uniform sampler2D texture; uniform vec2 center; uniform float strength; uniform vec2 texSize; varying vec2 texCoord; "+i+" void main() { vec4 color = vec4(0.0); float total = 0.0; vec2 toCenter = center - texCoord * texSize; /* randomize the lookup values to hide the fixed number of samples */ float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0); for (float t = 0.0; t <= 40.0; t++) { float percent = (t + offset) / 40.0; float weight = 4.0 * (percent - percent * percent); vec4 sample = texture2D(texture, texCoord + toCenter * percent * strength / texSize); /* switch to pre-multiplied alpha to correctly blur transparent images */ sample.rgb *= sample.a; color += sample * weight; total += weight; } gl_FragColor = color / total; /* switch back from pre-multiplied alpha */ gl_FragColor.rgb /= gl_FragColor.a + 0.00001; } "),$.call(this,A.zoomBlur,{center:[t,e],strength:n,texSize:[this.width,this.height]}),this}function b(t,e,n,r,o,s){A.tiltShift=A.tiltShift||new P(null," uniform sampler2D texture; uniform float blurRadius; uniform float gradientRadius; uniform vec2 start; uniform vec2 end; uniform vec2 delta; uniform vec2 texSize; varying vec2 texCoord; "+i+" void main() { vec4 color = vec4(0.0); float total = 0.0; /* randomize the lookup values to hide the fixed number of samples */ float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0); vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x)); float radius = smoothstep(0.0, 1.0, abs(dot(texCoord * texSize - start, normal)) / gradientRadius) * blurRadius; for (float t = -30.0; t <= 30.0; t++) { float percent = (t + offset - 0.5) / 30.0; float weight = 1.0 - abs(percent); vec4 sample = texture2D(texture, texCoord + delta / texSize * percent * radius); /* switch to pre-multiplied alpha to correctly blur transparent images */ sample.rgb *= sample.a; color += sample * weight; total += weight; } gl_FragColor = color / total; /* switch back from pre-multiplied alpha */ gl_FragColor.rgb /= gl_FragColor.a + 0.00001; } ");var a=n-t,l=r-e,u=Math.sqrt(a*a+l*l);return $.call(this,A.tiltShift,{blurRadius:o,gradientRadius:s,start:[t,e],end:[n,r],delta:[a/u,l/u],texSize:[this.width,this.height]}),$.call(this,A.tiltShift,{blurRadius:o,gradientRadius:s,start:[t,e],end:[n,r],delta:[-l/u,a/u],texSize:[this.width,this.height]}),this}function w(t){return A.triangleBlur=A.triangleBlur||new P(null," uniform sampler2D texture; uniform vec2 delta; varying vec2 texCoord; "+i+" void main() { vec4 color = vec4(0.0); float total = 0.0; /* randomize the lookup values to hide the fixed number of samples */ float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0); for (float t = -30.0; t <= 30.0; t++) { float percent = (t + offset - 0.5) / 30.0; float weight = 1.0 - abs(percent); vec4 sample = texture2D(texture, texCoord + delta * percent); /* switch to pre-multiplied alpha to correctly blur transparent images */ sample.rgb *= sample.a; color += sample * weight; total += weight; } gl_FragColor = color / total; /* switch back from pre-multiplied alpha */ gl_FragColor.rgb /= gl_FragColor.a + 0.00001; } "),$.call(this,A.triangleBlur,{delta:[t/this.width,0]}),$.call(this,A.triangleBlur,{delta:[0,t/this.height]}),this}function x(t,e,n){A.lensBlurPrePass=A.lensBlurPrePass||new P(null," uniform sampler2D texture; uniform float power; varying vec2 texCoord; void main() { vec4 color = texture2D(texture, texCoord); color = pow(color, vec4(power)); gl_FragColor = vec4(color); } ");var r=" uniform sampler2D texture0; uniform sampler2D texture1; uniform vec2 delta0; uniform vec2 delta1; uniform float power; varying vec2 texCoord; "+i+" vec4 sample(vec2 delta) { /* randomize the lookup values to hide the fixed number of samples */ float offset = random(vec3(delta, 151.7182), 0.0); vec4 color = vec4(0.0); float total = 0.0; for (float t = 0.0; t <= 30.0; t++) { float percent = (t + offset) / 30.0; color += texture2D(texture0, texCoord + delta * percent); total += 1.0; } return color / total; } ";A.lensBlur0=A.lensBlur0||new P(null,r+" void main() { gl_FragColor = sample(delta0); } "),A.lensBlur1=A.lensBlur1||new P(null,r+" void main() { gl_FragColor = (sample(delta0) + sample(delta1)) * 0.5; } "),A.lensBlur2=A.lensBlur2||new P(null,r+" void main() { vec4 color = (sample(delta0) + 2.0 * texture2D(texture1, texCoord)) / 3.0; gl_FragColor = pow(color, vec4(power)); } ").textures({texture1:1});for(var o=[],s=0;s<3;s++){var a=n+s*Math.PI*2/3;o.push([t*Math.sin(a)/this.width,t*Math.cos(a)/this.height])}var l=Math.pow(10,k(-1,e,1));return $.call(this,A.lensBlurPrePass,{power:l}),this._.extraTexture.ensureFormat(this._.texture),$.call(this,A.lensBlur0,{delta0:o[0]},this._.texture,this._.extraTexture),$.call(this,A.lensBlur1,{delta0:o[1],delta1:o[2]},this._.extraTexture,this._.extraTexture),$.call(this,A.lensBlur0,{delta0:o[1]}),this._.extraTexture.use(1),$.call(this,A.lensBlur2,{power:1/l,delta0:o[2]}),this}function S(t){return A.edgeWork1=A.edgeWork1||new P(null," uniform sampler2D texture; uniform vec2 delta; varying vec2 texCoord; "+i+" void main() { vec2 color = vec2(0.0); vec2 total = vec2(0.0); /* randomize the lookup values to hide the fixed number of samples */ float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0); for (float t = -30.0; t <= 30.0; t++) { float percent = (t + offset - 0.5) / 30.0; float weight = 1.0 - abs(percent); vec3 sample = texture2D(texture, texCoord + delta * percent).rgb; float average = (sample.r + sample.g + sample.b) / 3.0; color.x += average * weight; total.x += weight; if (abs(t) < 15.0) { weight = weight * 2.0 - 1.0; color.y += average * weight; total.y += weight; } } gl_FragColor = vec4(color / total, 0.0, 1.0); } "),A.edgeWork2=A.edgeWork2||new P(null," uniform sampler2D texture; uniform vec2 delta; varying vec2 texCoord; "+i+" void main() { vec2 color = vec2(0.0); vec2 total = vec2(0.0); /* randomize the lookup values to hide the fixed number of samples */ float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0); for (float t = -30.0; t <= 30.0; t++) { float percent = (t + offset - 0.5) / 30.0; float weight = 1.0 - abs(percent); vec2 sample = texture2D(texture, texCoord + delta * percent).xy; color.x += sample.x * weight; total.x += weight; if (abs(t) < 15.0) { weight = weight * 2.0 - 1.0; color.y += sample.y * weight; total.y += weight; } } float c = clamp(10000.0 * (color.y / total.y - color.x / total.x) + 0.5, 0.0, 1.0); gl_FragColor = vec4(c, c, c, 1.0); } "),$.call(this,A.edgeWork1,{delta:[t/this.width,0]}),$.call(this,A.edgeWork2,{delta:[0,t/this.height]}),this}function C(t,e,i,n){return A.colorHalftone=A.colorHalftone||new P(null," uniform sampler2D texture; uniform vec2 center; uniform float angle; uniform float scale; uniform vec2 texSize; varying vec2 texCoord; float pattern(float angle) { float s = sin(angle), c = cos(angle); vec2 tex = texCoord * texSize - center; vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale; return (sin(point.x) * sin(point.y)) * 4.0; } void main() { vec4 color = texture2D(texture, texCoord); vec3 cmy = 1.0 - color.rgb; float k = min(cmy.x, min(cmy.y, cmy.z)); cmy = (cmy - k) / (1.0 - k); cmy = clamp(cmy * 10.0 - 3.0 + vec3(pattern(angle + 0.26179), pattern(angle + 1.30899), pattern(angle)), 0.0, 1.0); k = clamp(k * 10.0 - 5.0 + pattern(angle + 0.78539), 0.0, 1.0); gl_FragColor = vec4(1.0 - cmy - k, color.a); } "),$.call(this,A.colorHalftone,{center:[t,e],angle:i,scale:Math.PI/n,texSize:[this.width,this.height]}),this}function T(t,e,i){return A.hexagonalPixelate=A.hexagonalPixelate||new P(null," uniform sampler2D texture; uniform vec2 center; uniform float scale; uniform vec2 texSize; varying vec2 texCoord; void main() { vec2 tex = (texCoord * texSize - center) / scale; tex.y /= 0.866025404; tex.x -= tex.y * 0.5; vec2 a; if (tex.x + tex.y - floor(tex.x) - floor(tex.y) < 1.0) a = vec2(floor(tex.x), floor(tex.y)); else a = vec2(ceil(tex.x), ceil(tex.y)); vec2 b = vec2(ceil(tex.x), floor(tex.y)); vec2 c = vec2(floor(tex.x), ceil(tex.y)); vec3 TEX = vec3(tex.x, tex.y, 1.0 - tex.x - tex.y); vec3 A = vec3(a.x, a.y, 1.0 - a.x - a.y); vec3 B = vec3(b.x, b.y, 1.0 - b.x - b.y); vec3 C = vec3(c.x, c.y, 1.0 - c.x - c.y); float alen = length(TEX - A); float blen = length(TEX - B); float clen = length(TEX - C); vec2 choice; if (alen < blen) { if (alen < clen) choice = a; else choice = c; } else { if (blen < clen) choice = b; else choice = c; } choice.x += choice.y * 0.5; choice.y *= 0.866025404; choice *= scale / texSize; gl_FragColor = texture2D(texture, choice + center / texSize); } "),$.call(this,A.hexagonalPixelate,{center:[t,e],scale:i,texSize:[this.width,this.height]}),this}function E(t){return A.ink=A.ink||new P(null," uniform sampler2D texture; uniform float strength; uniform vec2 texSize; varying vec2 texCoord; void main() { vec2 dx = vec2(1.0 / texSize.x, 0.0); vec2 dy = vec2(0.0, 1.0 / texSize.y); vec4 color = texture2D(texture, texCoord); float bigTotal = 0.0; float smallTotal = 0.0; vec3 bigAverage = vec3(0.0); vec3 smallAverage = vec3(0.0); for (float x = -2.0; x <= 2.0; x += 1.0) { for (float y = -2.0; y <= 2.0; y += 1.0) { vec3 sample = texture2D(texture, texCoord + dx * x + dy * y).rgb; bigAverage += sample; bigTotal += 1.0; if (abs(x) + abs(y) < 2.0) { smallAverage += sample; smallTotal += 1.0; } } } vec3 edge = max(vec3(0.0), bigAverage / bigTotal - smallAverage / smallTotal); gl_FragColor = vec4(color.rgb - dot(edge, edge) * strength * 100000.0, color.a); } "),$.call(this,A.ink,{strength:t*t*t*t*t,texSize:[this.width,this.height]}),this}function I(t,e,i,n){return A.dotScreen=A.dotScreen||new P(null," uniform sampler2D texture; uniform vec2 center; uniform float angle; uniform float scale; uniform vec2 texSize; varying vec2 texCoord; float pattern() { float s = sin(angle), c = cos(angle); vec2 tex = texCoord * texSize - center; vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale; return (sin(point.x) * sin(point.y)) * 4.0; } void main() { vec4 color = texture2D(texture, texCoord); float average = (color.r + color.g + color.b) / 3.0; gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a); } "),$.call(this,A.dotScreen,{center:[t,e],angle:i,scale:Math.PI/n,texSize:[this.width,this.height]}),this}var A,P=function(){function t(t){return"[object Number]"==Object.prototype.toString.call(t)}function e(t,e){var i=A.createShader(t);if(A.shaderSource(i,e),A.compileShader(i),!A.getShaderParameter(i,A.COMPILE_STATUS))throw"compile error: "+A.getShaderInfoLog(i);return i}function i(t,i){if(this.vertexAttribute=null,this.texCoordAttribute=null,this.program=A.createProgram(),t=t||" attribute vec2 vertex; attribute vec2 _texCoord; varying vec2 texCoord; void main() { texCoord = _texCoord; gl_Position = vec4(vertex * 2.0 - 1.0, 0.0, 1.0); }",i="precision highp float;"+(i=i||" uniform sampler2D texture; varying vec2 texCoord; void main() { gl_FragColor = texture2D(texture, texCoord); }"),A.attachShader(this.program,e(A.VERTEX_SHADER,t)),A.attachShader(this.program,e(A.FRAGMENT_SHADER,i)),A.linkProgram(this.program),!A.getProgramParameter(this.program,A.LINK_STATUS))throw"link error: "+A.getProgramInfoLog(this.program)}return i.prototype.destroy=function(){A.deleteProgram(this.program),this.program=null},i.prototype.uniforms=function(e){for(var i in A.useProgram(this.program),e)if(e.hasOwnProperty(i)){var n=A.getUniformLocation(this.program,i);if(null!==n){var r=e[i];if(o=r,"[object Array]"==Object.prototype.toString.call(o))switch(r.length){case 1:A.uniform1fv(n,new Float32Array(r));break;case 2:A.uniform2fv(n,new Float32Array(r));break;case 3:A.uniform3fv(n,new Float32Array(r));break;case 4:A.uniform4fv(n,new Float32Array(r));break;case 9:A.uniformMatrix3fv(n,!1,new Float32Array(r));break;case 16:A.uniformMatrix4fv(n,!1,new Float32Array(r));break;default:throw"dont't know how to load uniform \""+i+'" of length '+r.length}else{if(!t(r))throw'attempted to set uniform "'+i+'" to invalid value '+(r||"undefined").toString();A.uniform1f(n,r)}}}var o;return this},i.prototype.textures=function(t){for(var e in A.useProgram(this.program),t)t.hasOwnProperty(e)&&A.uniform1i(A.getUniformLocation(this.program,e),t[e]);return this},i.prototype.drawRect=function(t,e,i,n){var r,o=A.getParameter(A.VIEWPORT);e=e!==r?(e-o[1])/o[3]:0,t=t!==r?(t-o[0])/o[2]:0,i=i!==r?(i-o[0])/o[2]:1,n=n!==r?(n-o[1])/o[3]:1,null==A.vertexBuffer&&(A.vertexBuffer=A.createBuffer()),A.bindBuffer(A.ARRAY_BUFFER,A.vertexBuffer),A.bufferData(A.ARRAY_BUFFER,new Float32Array([t,e,t,n,i,e,i,n]),A.STATIC_DRAW),null==A.texCoordBuffer&&(A.texCoordBuffer=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,A.texCoordBuffer),A.bufferData(A.ARRAY_BUFFER,new Float32Array([0,0,0,1,1,0,1,1]),A.STATIC_DRAW)),null==this.vertexAttribute&&(this.vertexAttribute=A.getAttribLocation(this.program,"vertex"),A.enableVertexAttribArray(this.vertexAttribute)),null==this.texCoordAttribute&&(this.texCoordAttribute=A.getAttribLocation(this.program,"_texCoord"),A.enableVertexAttribArray(this.texCoordAttribute)),A.useProgram(this.program),A.bindBuffer(A.ARRAY_BUFFER,A.vertexBuffer),A.vertexAttribPointer(this.vertexAttribute,2,A.FLOAT,!1,0,0),A.bindBuffer(A.ARRAY_BUFFER,A.texCoordBuffer),A.vertexAttribPointer(this.texCoordAttribute,2,A.FLOAT,!1,0,0),A.drawArrays(A.TRIANGLE_STRIP,0,4)},i.getDefaultShader=function(){return A.defaultShader=A.defaultShader||new i,A.defaultShader},i}();function k(t,e,i){return Math.max(t,Math.min(e,i))}function R(t){return{_:t,loadContentsOf:function(t){A=this._.gl,this._.loadContentsOf(t)},destroy:function(){A=this._.gl,this._.destroy()}}}function L(t){return R(G.fromElement(t))}function F(t,e){var i=A.UNSIGNED_BYTE;if(A.getExtension("OES_texture_float")&&A.getExtension("OES_texture_float_linear")){A.getExtension("WEBGL_color_buffer_float");var n=new G(100,100,A.RGBA,A.FLOAT);try{n.drawTo((function(){i=A.FLOAT}))}catch(t){}n.destroy()}this._.texture&&this._.texture.destroy(),this._.spareTexture&&this._.spareTexture.destroy(),this.width=t,this.height=e,this._.texture=new G(t,e,A.RGBA,i),this._.spareTexture=new G(t,e,A.RGBA,i),this._.extraTexture=this._.extraTexture||new G(0,0,A.RGBA,i),this._.flippedShader=this._.flippedShader||new P(null," uniform sampler2D texture; varying vec2 texCoord; void main() { gl_FragColor = texture2D(texture, vec2(texCoord.x, 1.0 - texCoord.y)); } "),this._.isInitialized=!0}function M(t,e,i){return this._.isInitialized&&t._.width==this.width&&t._.height==this.height||F.call(this,e||t._.width,i||t._.height),t._.use(),this._.texture.drawTo((function(){P.getDefaultShader().drawRect()})),this}function O(){return this._.texture.use(),this._.flippedShader.drawRect(),this}function $(t,e,i,n){(i||this._.texture).use(),this._.spareTexture.drawTo((function(){t.uniforms(e).drawRect()})),this._.spareTexture.swapWith(n||this._.texture)}function D(t){return t.parentNode.insertBefore(this,t),t.parentNode.removeChild(t),this}function j(){var t=new G(this._.texture.width,this._.texture.height,A.RGBA,A.UNSIGNED_BYTE);return this._.texture.use(),t.drawTo((function(){P.getDefaultShader().drawRect()})),R(t)}function N(){var t=this._.texture.width,e=this._.texture.height,i=new Uint8Array(t*e*4);return this._.texture.drawTo((function(){A.readPixels(0,0,t,e,A.RGBA,A.UNSIGNED_BYTE,i)})),i}function B(t){return function(){return A=this._.gl,t.apply(this,arguments)}}function U(t,e,i,n,r,o,s,a){var l=i-r,u=n-o,h=s-r,c=a-o,d=t-i+r-s,f=e-n+o-a,p=l*c-h*u,g=(d*c-h*f)/p,m=(l*f-d*u)/p;return[i-t+g*i,n-e+g*n,g,s-t+m*s,a-e+m*a,m,t,e,1]}function z(t){var e=t[0],i=t[1],n=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],u=t[8],h=e*o*u-e*s*l-i*r*u+i*s*a+n*r*l-n*o*a;return[(o*u-s*l)/h,(n*l-i*u)/h,(i*s-n*o)/h,(s*a-r*u)/h,(e*u-n*a)/h,(n*r-e*s)/h,(r*l-o*a)/h,(i*a-e*l)/h,(e*o-i*r)/h]}function V(t){var e=t.length;this.xa=[],this.ya=[],this.u=[],this.y2=[],t.sort((function(t,e){return t[0]-e[0]}));for(var i=0;i=0;--i)this.y2[i]=this.y2[i]*this.y2[i+1]+this.u[i]}t.canvas=function(){var t=document.createElement("canvas");try{A=t.getContext("experimental-webgl",{premultipliedAlpha:!1})}catch(t){A=null}if(!A)throw"This browser does not support WebGL";return t._={gl:A,isInitialized:!1,texture:null,spareTexture:null,flippedShader:null},t.texture=B(L),t.draw=B(M),t.update=B(O),t.replace=B(D),t.contents=B(j),t.getPixelArray=B(N),t.brightnessContrast=B(n),t.brightnessRGB=B(l),t.hexagonalPixelate=B(T),t.hueSaturation=B(p),t.colorHalftone=B(C),t.triangleBlur=B(w),t.unsharpMask=B(f),t.perspective=B(m),t.matrixWarp=B(y),t.bulgePinch=B(v),t.tiltShift=B(b),t.dotScreen=B(I),t.edgeWork=B(S),t.lensBlur=B(x),t.zoomBlur=B(_),t.noise=B(h),t.denoise=B(c),t.curves=B(a),t.swirl=B(g),t.ink=B(E),t.vignette=B(u),t.vibrance=B(o),t.sepia=B(d),t.gamma=B(r),t},t.splineInterpolate=s,V.prototype.interpolate=function(t){for(var e=0,i=this.ya.length-1;i-e>1;){var n=i+e>>1;this.xa[n]>t?i=n:e=n}var r=this.xa[i]-this.xa[e],o=(this.xa[i]-t)/r,s=(t-this.xa[e])/r;return o*this.ya[e]+s*this.ya[i]+((o*o*o-o)*this.y2[e]+(s*s*s-s)*this.y2[i])*(r*r)/6};var G=function(){function t(t,e,i,n){this.gl=A,this.id=A.createTexture(),this.width=t,this.height=e,this.format=i,this.type=n,A.bindTexture(A.TEXTURE_2D,this.id),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_MAG_FILTER,A.LINEAR),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_MIN_FILTER,A.LINEAR),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_S,A.CLAMP_TO_EDGE),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_T,A.CLAMP_TO_EDGE),t&&e&&A.texImage2D(A.TEXTURE_2D,0,this.format,t,e,0,this.format,this.type,null)}t.fromElement=function(e){var i=new t(0,0,A.RGBA,A.UNSIGNED_BYTE);return i.loadContentsOf(e),i},t.prototype.loadContentsOf=function(t){this.width=t.width||t.videoWidth,this.height=t.height||t.videoHeight,A.bindTexture(A.TEXTURE_2D,this.id),A.texImage2D(A.TEXTURE_2D,0,this.format,this.format,this.type,t)},t.prototype.initFromBytes=function(t,e,i){this.width=t,this.height=e,this.format=A.RGBA,this.type=A.UNSIGNED_BYTE,A.bindTexture(A.TEXTURE_2D,this.id),A.texImage2D(A.TEXTURE_2D,0,A.RGBA,t,e,0,A.RGBA,this.type,new Uint8Array(i))},t.prototype.destroy=function(){A.deleteTexture(this.id),this.id=null},t.prototype.use=function(t){A.activeTexture(A.TEXTURE0+(t||0)),A.bindTexture(A.TEXTURE_2D,this.id)},t.prototype.unuse=function(t){A.activeTexture(A.TEXTURE0+(t||0)),A.bindTexture(A.TEXTURE_2D,null)},t.prototype.ensureFormat=function(t,e,i,n){if(1==arguments.length){var r=arguments[0];t=r.width,e=r.height,i=r.format,n=r.type}t==this.width&&e==this.height&&i==this.format&&n==this.type||(this.width=t,this.height=e,this.format=i,this.type=n,A.bindTexture(A.TEXTURE_2D,this.id),A.texImage2D(A.TEXTURE_2D,0,this.format,t,e,0,this.format,this.type,null))},t.prototype.drawTo=function(t){if(A.framebuffer=A.framebuffer||A.createFramebuffer(),A.bindFramebuffer(A.FRAMEBUFFER,A.framebuffer),A.framebufferTexture2D(A.FRAMEBUFFER,A.COLOR_ATTACHMENT0,A.TEXTURE_2D,this.id,0),A.checkFramebufferStatus(A.FRAMEBUFFER)!==A.FRAMEBUFFER_COMPLETE)throw new Error("incomplete framebuffer");A.viewport(0,0,this.width,this.height),t(),A.bindFramebuffer(A.FRAMEBUFFER,null)};var e=null;function i(t){null==e&&(e=document.createElement("canvas")),e.width=t.width,e.height=t.height;var i=e.getContext("2d");return i.clearRect(0,0,e.width,e.height),i}return t.prototype.fillUsingCanvas=function(t){return t(i(this)),this.format=A.RGBA,this.type=A.UNSIGNED_BYTE,A.bindTexture(A.TEXTURE_2D,this.id),A.texImage2D(A.TEXTURE_2D,0,A.RGBA,A.RGBA,A.UNSIGNED_BYTE,e),this},t.prototype.toImage=function(t){this.use(),P.getDefaultShader().drawRect();var n=this.width*this.height*4,r=new Uint8Array(n),o=i(this),s=o.createImageData(this.width,this.height);A.readPixels(0,0,this.width,this.height,A.RGBA,A.UNSIGNED_BYTE,r);for(var a=0;a{window.addEventListener("load",(function(){var t=(new Date).getTime(),e=window.setInterval((function(){(new Date).getTime()-t>72e5?window.clearInterval(e):Vue.http.post("heartbeat").then((function(){t=(new Date).getTime()}),(function(){window.clearInterval(e)}))}),36e5)}))},994:(t,e,i)=>{"use strict";var n=Object.freeze({});function r(t){return null==t}function o(t){return null!=t}function s(t){return!0===t}function a(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function l(t){return null!==t&&"object"==typeof t}var u=Object.prototype.toString;function h(t){return"[object Object]"===u.call(t)}function c(t){return"[object RegExp]"===u.call(t)}function d(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function f(t){return o(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function p(t){return null==t?"":Array.isArray(t)||h(t)&&t.toString===u?JSON.stringify(t,null,2):String(t)}function g(t){var e=parseFloat(t);return isNaN(e)?t:e}function m(t,e){for(var i=Object.create(null),n=t.split(","),r=0;r-1)return t.splice(i,1)}}var b=Object.prototype.hasOwnProperty;function w(t,e){return b.call(t,e)}function x(t){var e=Object.create(null);return function(i){return e[i]||(e[i]=t(i))}}var S=/-(\w)/g,C=x((function(t){return t.replace(S,(function(t,e){return e?e.toUpperCase():""}))})),T=x((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),E=/\B([A-Z])/g,I=x((function(t){return t.replace(E,"-$1").toLowerCase()}));var A=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function i(i){var n=arguments.length;return n?n>1?t.apply(e,arguments):t.call(e,i):t.call(e)}return i._length=t.length,i};function P(t,e){e=e||0;for(var i=t.length-e,n=new Array(i);i--;)n[i]=t[i+e];return n}function k(t,e){for(var i in e)t[i]=e[i];return t}function R(t){for(var e={},i=0;i0,tt=Z&&Z.indexOf("edge/")>0,et=(Z&&Z.indexOf("android"),Z&&/iphone|ipad|ipod|ios/.test(Z)||"ios"===H),it=(Z&&/chrome\/\d+/.test(Z),Z&&/phantomjs/.test(Z),Z&&Z.match(/firefox\/(\d+)/)),nt={}.watch,rt=!1;if(X)try{var ot={};Object.defineProperty(ot,"passive",{get:function(){rt=!0}}),window.addEventListener("test-passive",null,ot)}catch(ed){}var st=function(){return void 0===W&&(W=!X&&!Y&&void 0!==i.g&&(i.g.process&&"server"===i.g.process.env.VUE_ENV)),W},at=X&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function lt(t){return"function"==typeof t&&/native code/.test(t.toString())}var ut,ht="undefined"!=typeof Symbol&<(Symbol)&&"undefined"!=typeof Reflect&<(Reflect.ownKeys);ut="undefined"!=typeof Set&<(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var ct=L,dt=0,ft=function(){this.id=dt++,this.subs=[]};ft.prototype.addSub=function(t){this.subs.push(t)},ft.prototype.removeSub=function(t){_(this.subs,t)},ft.prototype.depend=function(){ft.target&&ft.target.addDep(this)},ft.prototype.notify=function(){var t=this.subs.slice();for(var e=0,i=t.length;e-1)if(o&&!w(r,"default"))s=!1;else if(""===s||s===I(t)){var l=Gt(String,r.type);(l<0||a0&&(pe((n=ge(n,(e||"")+"_"+i))[0])&&pe(u)&&(h[l]=bt(u.text+n[0].text),n.shift()),h.push.apply(h,n)):a(n)?pe(u)?h[l]=bt(u.text+n):""!==n&&h.push(bt(n)):pe(n)&&pe(u)?h[l]=bt(u.text+n.text):(s(t._isVList)&&o(n.tag)&&r(n.key)&&o(e)&&(n.key="__vlist"+e+"_"+i+"__"),h.push(n)));return h}function me(t,e){if(t){for(var i=Object.create(null),n=ht?Reflect.ownKeys(t):Object.keys(t),r=0;r0,s=t?!!t.$stable:!o,a=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(s&&i&&i!==n&&a===i.$key&&!o&&!i.$hasNormal)return i;for(var l in r={},t)t[l]&&"$"!==l[0]&&(r[l]=be(e,l,t[l]))}else r={};for(var u in e)u in r||(r[u]=we(e,u));return t&&Object.isExtensible(t)&&(t._normalized=r),G(r,"$stable",s),G(r,"$key",a),G(r,"$hasNormal",o),r}function be(t,e,i){var n=function(){var t=arguments.length?i.apply(null,arguments):i({});return(t=t&&"object"==typeof t&&!Array.isArray(t)?[t]:fe(t))&&(0===t.length||1===t.length&&t[0].isComment)?void 0:t};return i.proxy&&Object.defineProperty(t,e,{get:n,enumerable:!0,configurable:!0}),n}function we(t,e){return function(){return t[e]}}function xe(t,e){var i,n,r,s,a;if(Array.isArray(t)||"string"==typeof t)for(i=new Array(t.length),n=0,r=t.length;ndocument.createEvent("Event").timeStamp&&(pi=function(){return gi.now()})}function mi(){var t,e;for(fi=pi(),ci=!0,ai.sort((function(t,e){return t.id-e.id})),di=0;didi&&ai[i].id>t.id;)i--;ai.splice(i+1,0,t)}else ai.push(t);hi||(hi=!0,re(mi))}}(this)},yi.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||l(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(t){qt(t,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},yi.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},yi.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},yi.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||_(this.vm._watchers,this);for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1}};var _i={enumerable:!0,configurable:!0,get:L,set:L};function bi(t,e,i){_i.get=function(){return this[e][i]},_i.set=function(t){this[e][i]=t},Object.defineProperty(t,i,_i)}function wi(t){t._watchers=[];var e=t.$options;e.props&&function(t,e){var i=t.$options.propsData||{},n=t._props={},r=t.$options._propKeys=[];t.$parent&&Et(!1);var o=function(o){r.push(o);var s=Ut(o,e,i,t);Pt(n,o,s),o in t||bi(t,"_props",o)};for(var s in e)o(s);Et(!0)}(t,e.props),e.methods&&function(t,e){t.$options.props;for(var i in e)t[i]="function"!=typeof e[i]?L:A(e[i],t)}(t,e.methods),e.data?function(t){var e=t.$options.data;h(e=t._data="function"==typeof e?function(t,e){gt();try{return t.call(e,e)}catch(t){return qt(t,e,"data()"),{}}finally{mt()}}(e,t):e||{})||(e={});var i=Object.keys(e),n=t.$options.props,r=(t.$options.methods,i.length);for(;r--;){var o=i[r];0,n&&w(n,o)||V(o)||bi(t,"_data",o)}At(e,!0)}(t):At(t._data={},!0),e.computed&&function(t,e){var i=t._computedWatchers=Object.create(null),n=st();for(var r in e){var o=e[r],s="function"==typeof o?o:o.get;0,n||(i[r]=new yi(t,s||L,L,xi)),r in t||Si(t,r,o)}}(t,e.computed),e.watch&&e.watch!==nt&&function(t,e){for(var i in e){var n=e[i];if(Array.isArray(n))for(var r=0;r-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!c(t)&&t.test(e)}function Fi(t,e){var i=t.cache,n=t.keys,r=t._vnode;for(var o in i){var s=i[o];if(s){var a=Ri(s.componentOptions);a&&!e(a)&&Mi(i,o,n,r)}}}function Mi(t,e,i,n){var r=t[e];!r||n&&r.tag===n.tag||r.componentInstance.$destroy(),t[e]=null,_(i,e)}!function(t){t.prototype._init=function(t){var e=this;e._uid=Ii++,e._isVue=!0,t&&t._isComponent?function(t,e){var i=t.$options=Object.create(t.constructor.options),n=e._parentVnode;i.parent=e.parent,i._parentVnode=n;var r=n.componentOptions;i.propsData=r.propsData,i._parentListeners=r.listeners,i._renderChildren=r.children,i._componentTag=r.tag,e.render&&(i.render=e.render,i.staticRenderFns=e.staticRenderFns)}(e,t):e.$options=Nt(Ai(e.constructor),t||{},e),e._renderProxy=e,e._self=e,function(t){var e=t.$options,i=e.parent;if(i&&!e.abstract){for(;i.$options.abstract&&i.$parent;)i=i.$parent;i.$children.push(t)}t.$parent=i,t.$root=i?i.$root:t,t.$children=[],t.$refs={},t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(e),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&ti(t,e)}(e),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,i=t.$vnode=e._parentVnode,r=i&&i.context;t.$slots=ve(e._renderChildren,r),t.$scopedSlots=n,t._c=function(e,i,n,r){return Ge(t,e,i,n,r,!1)},t.$createElement=function(e,i,n,r){return Ge(t,e,i,n,r,!0)};var o=i&&i.data;Pt(t,"$attrs",o&&o.attrs||n,null,!0),Pt(t,"$listeners",e._parentListeners||n,null,!0)}(e),si(e,"beforeCreate"),function(t){var e=me(t.$options.inject,t);e&&(Et(!1),Object.keys(e).forEach((function(i){Pt(t,i,e[i])})),Et(!0))}(e),wi(e),function(t){var e=t.$options.provide;e&&(t._provided="function"==typeof e?e.call(t):e)}(e),si(e,"created"),e.$options.el&&e.$mount(e.$options.el)}}(Pi),function(t){var e={get:function(){return this._data}},i={get:function(){return this._props}};Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",i),t.prototype.$set=kt,t.prototype.$delete=Rt,t.prototype.$watch=function(t,e,i){var n=this;if(h(e))return Ei(n,t,e,i);(i=i||{}).user=!0;var r=new yi(n,t,e,i);if(i.immediate)try{e.call(n,r.value)}catch(t){qt(t,n,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(Pi),function(t){var e=/^hook:/;t.prototype.$on=function(t,i){var n=this;if(Array.isArray(t))for(var r=0,o=t.length;r1?P(i):i;for(var n=P(arguments,1),r='event handler for "'+t+'"',o=0,s=i.length;oparseInt(this.max)&&Mi(s,a[0],a,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return U}};Object.defineProperty(t,"config",e),t.util={warn:ct,extend:k,mergeOptions:Nt,defineReactive:Pt},t.set=kt,t.delete=Rt,t.nextTick=re,t.observable=function(t){return At(t),t},t.options=Object.create(null),N.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,k(t.options.components,$i),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var i=P(arguments,1);return i.unshift(this),"function"==typeof t.install?t.install.apply(t,i):"function"==typeof t&&t.apply(null,i),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=Nt(this.options,t),this}}(t),ki(t),function(t){N.forEach((function(e){t[e]=function(t,i){return i?("component"===e&&h(i)&&(i.name=i.name||t,i=this.options._base.extend(i)),"directive"===e&&"function"==typeof i&&(i={bind:i,update:i}),this.options[e+"s"][t]=i,i):this.options[e+"s"][t]}}))}(t)}(Pi),Object.defineProperty(Pi.prototype,"$isServer",{get:st}),Object.defineProperty(Pi.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Pi,"FunctionalRenderContext",{value:De}),Pi.version="2.6.12";var Di=m("style,class"),ji=m("input,textarea,option,select,progress"),Ni=function(t,e,i){return"value"===i&&ji(t)&&"button"!==e||"selected"===i&&"option"===t||"checked"===i&&"input"===t||"muted"===i&&"video"===t},Bi=m("contenteditable,draggable,spellcheck"),Ui=m("events,caret,typing,plaintext-only"),zi=m("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Vi="http://www.w3.org/1999/xlink",Gi=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},qi=function(t){return Gi(t)?t.slice(6,t.length):""},Wi=function(t){return null==t||!1===t};function Ki(t){for(var e=t.data,i=t,n=t;o(n.componentInstance);)(n=n.componentInstance._vnode)&&n.data&&(e=Xi(n.data,e));for(;o(i=i.parent);)i&&i.data&&(e=Xi(e,i.data));return function(t,e){if(o(t)||o(e))return Yi(t,Hi(e));return""}(e.staticClass,e.class)}function Xi(t,e){return{staticClass:Yi(t.staticClass,e.staticClass),class:o(t.class)?[t.class,e.class]:e.class}}function Yi(t,e){return t?e?t+" "+e:t:e||""}function Hi(t){return Array.isArray(t)?function(t){for(var e,i="",n=0,r=t.length;n-1?xn(t,e,i):zi(e)?Wi(i)?t.removeAttribute(e):(i="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,i)):Bi(e)?t.setAttribute(e,function(t,e){return Wi(e)||"false"===e?"false":"contenteditable"===t&&Ui(e)?e:"true"}(e,i)):Gi(e)?Wi(i)?t.removeAttributeNS(Vi,qi(e)):t.setAttributeNS(Vi,e,i):xn(t,e,i)}function xn(t,e,i){if(Wi(i))t.removeAttribute(e);else{if(J&&!Q&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==i&&!t.__ieph){var n=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",n)};t.addEventListener("input",n),t.__ieph=!0}t.setAttribute(e,i)}}var Sn={create:bn,update:bn};function Cn(t,e){var i=e.elm,n=e.data,s=t.data;if(!(r(n.staticClass)&&r(n.class)&&(r(s)||r(s.staticClass)&&r(s.class)))){var a=Ki(e),l=i._transitionClasses;o(l)&&(a=Yi(a,Hi(l))),a!==i._prevClass&&(i.setAttribute("class",a),i._prevClass=a)}}var Tn,En,In,An,Pn,kn,Rn={create:Cn,update:Cn},Ln=/[\w).+\-_$\]]/;function Fn(t){var e,i,n,r,o,s=!1,a=!1,l=!1,u=!1,h=0,c=0,d=0,f=0;for(n=0;n=0&&" "===(g=t.charAt(p));p--);g&&Ln.test(g)||(u=!0)}}else void 0===r?(f=n+1,r=t.slice(0,n).trim()):m();function m(){(o||(o=[])).push(t.slice(f,n).trim()),f=n+1}if(void 0===r?r=t.slice(0,n).trim():0!==f&&m(),o)for(n=0;n-1?{exp:t.slice(0,An),key:'"'+t.slice(An+1)+'"'}:{exp:t,key:null};En=t,An=Pn=kn=0;for(;!Hn();)Zn(In=Yn())?Qn(In):91===In&&Jn(In);return{exp:t.slice(0,Pn),key:t.slice(Pn+1,kn)}}(t);return null===i.key?t+"="+e:"$set("+i.exp+", "+i.key+", "+e+")"}function Yn(){return En.charCodeAt(++An)}function Hn(){return An>=Tn}function Zn(t){return 34===t||39===t}function Jn(t){var e=1;for(Pn=An;!Hn();)if(Zn(t=Yn()))Qn(t);else if(91===t&&e++,93===t&&e--,0===e){kn=An;break}}function Qn(t){for(var e=t;!Hn()&&(t=Yn())!==e;);}var tr,er="__r";function ir(t,e,i){var n=tr;return function r(){var o=e.apply(null,arguments);null!==o&&or(t,r,i,n)}}var nr=Ht&&!(it&&Number(it[1])<=53);function rr(t,e,i,n){if(nr){var r=fi,o=e;e=o._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=r||t.timeStamp<=0||t.target.ownerDocument!==document)return o.apply(this,arguments)}}tr.addEventListener(t,e,rt?{capture:i,passive:n}:i)}function or(t,e,i,n){(n||tr).removeEventListener(t,e._wrapper||e,i)}function sr(t,e){if(!r(t.data.on)||!r(e.data.on)){var i=e.data.on||{},n=t.data.on||{};tr=e.elm,function(t){if(o(t.__r)){var e=J?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r}o(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c)}(i),he(i,n,rr,or,ir,e.context),tr=void 0}}var ar,lr={create:sr,update:sr};function ur(t,e){if(!r(t.data.domProps)||!r(e.data.domProps)){var i,n,s=e.elm,a=t.data.domProps||{},l=e.data.domProps||{};for(i in o(l.__ob__)&&(l=e.data.domProps=k({},l)),a)i in l||(s[i]="");for(i in l){if(n=l[i],"textContent"===i||"innerHTML"===i){if(e.children&&(e.children.length=0),n===a[i])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if("value"===i&&"PROGRESS"!==s.tagName){s._value=n;var u=r(n)?"":String(n);hr(s,u)&&(s.value=u)}else if("innerHTML"===i&&Qi(s.tagName)&&r(s.innerHTML)){(ar=ar||document.createElement("div")).innerHTML=""+n+"";for(var h=ar.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;h.firstChild;)s.appendChild(h.firstChild)}else if(n!==a[i])try{s[i]=n}catch(t){}}}}function hr(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var i=!0;try{i=document.activeElement!==t}catch(t){}return i&&t.value!==e}(t,e)||function(t,e){var i=t.value,n=t._vModifiers;if(o(n)){if(n.number)return g(i)!==g(e);if(n.trim)return i.trim()!==e.trim()}return i!==e}(t,e))}var cr={create:ur,update:ur},dr=x((function(t){var e={},i=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var n=t.split(i);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}));function fr(t){var e=pr(t.style);return t.staticStyle?k(t.staticStyle,e):e}function pr(t){return Array.isArray(t)?R(t):"string"==typeof t?dr(t):t}var gr,mr=/^--/,vr=/\s*!important$/,yr=function(t,e,i){if(mr.test(e))t.style.setProperty(e,i);else if(vr.test(i))t.style.setProperty(I(e),i.replace(vr,""),"important");else{var n=br(e);if(Array.isArray(i))for(var r=0,o=i.length;r-1?e.split(Sr).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var i=" "+(t.getAttribute("class")||"")+" ";i.indexOf(" "+e+" ")<0&&t.setAttribute("class",(i+e).trim())}}function Tr(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Sr).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var i=" "+(t.getAttribute("class")||"")+" ",n=" "+e+" ";i.indexOf(n)>=0;)i=i.replace(n," ");(i=i.trim())?t.setAttribute("class",i):t.removeAttribute("class")}}function Er(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&k(e,Ir(t.name||"v")),k(e,t),e}return"string"==typeof t?Ir(t):void 0}}var Ir=x((function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}})),Ar=X&&!Q,Pr="transition",kr="animation",Rr="transition",Lr="transitionend",Fr="animation",Mr="animationend";Ar&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Rr="WebkitTransition",Lr="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Fr="WebkitAnimation",Mr="webkitAnimationEnd"));var Or=X?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function $r(t){Or((function(){Or(t)}))}function Dr(t,e){var i=t._transitionClasses||(t._transitionClasses=[]);i.indexOf(e)<0&&(i.push(e),Cr(t,e))}function jr(t,e){t._transitionClasses&&_(t._transitionClasses,e),Tr(t,e)}function Nr(t,e,i){var n=Ur(t,e),r=n.type,o=n.timeout,s=n.propCount;if(!r)return i();var a=r===Pr?Lr:Mr,l=0,u=function(){t.removeEventListener(a,h),i()},h=function(e){e.target===t&&++l>=s&&u()};setTimeout((function(){l0&&(i=Pr,h=s,c=o.length):e===kr?u>0&&(i=kr,h=u,c=l.length):c=(i=(h=Math.max(s,u))>0?s>u?Pr:kr:null)?i===Pr?o.length:l.length:0,{type:i,timeout:h,propCount:c,hasTransform:i===Pr&&Br.test(n[Rr+"Property"])}}function zr(t,e){for(;t.length1}function Xr(t,e){!0!==e.data.show&&Gr(e)}var Yr=function(t){var e,i,n={},l=t.modules,u=t.nodeOps;for(e=0;ep?_(t,r(i[v+1])?null:i[v+1].elm,i,f,v,n):f>v&&w(e,d,p)}(d,m,v,i,h):o(v)?(o(t.text)&&u.setTextContent(d,""),_(d,null,v,0,v.length-1,i)):o(m)?w(m,0,m.length-1):o(t.text)&&u.setTextContent(d,""):t.text!==e.text&&u.setTextContent(d,e.text),o(p)&&o(f=p.hook)&&o(f=f.postpatch)&&f(t,e)}}}function T(t,e,i){if(s(i)&&o(t.parent))t.parent.data.pendingInsert=e;else for(var n=0;n-1,s.selected!==o&&(s.selected=o);else if(O(to(s),n))return void(t.selectedIndex!==a&&(t.selectedIndex=a));r||(t.selectedIndex=-1)}}function Qr(t,e){return e.every((function(e){return!O(e,t)}))}function to(t){return"_value"in t?t._value:t.value}function eo(t){t.target.composing=!0}function io(t){t.target.composing&&(t.target.composing=!1,no(t.target,"input"))}function no(t,e){var i=document.createEvent("HTMLEvents");i.initEvent(e,!0,!0),t.dispatchEvent(i)}function ro(t){return!t.componentInstance||t.data&&t.data.transition?t:ro(t.componentInstance._vnode)}var oo={model:Hr,show:{bind:function(t,e,i){var n=e.value,r=(i=ro(i)).data&&i.data.transition,o=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;n&&r?(i.data.show=!0,Gr(i,(function(){t.style.display=o}))):t.style.display=n?o:"none"},update:function(t,e,i){var n=e.value;!n!=!e.oldValue&&((i=ro(i)).data&&i.data.transition?(i.data.show=!0,n?Gr(i,(function(){t.style.display=t.__vOriginalDisplay})):qr(i,(function(){t.style.display="none"}))):t.style.display=n?t.__vOriginalDisplay:"none")},unbind:function(t,e,i,n,r){r||(t.style.display=t.__vOriginalDisplay)}}},so={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function ao(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?ao(He(e.children)):t}function lo(t){var e={},i=t.$options;for(var n in i.propsData)e[n]=t[n];var r=i._parentListeners;for(var o in r)e[C(o)]=r[o];return e}function uo(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var ho=function(t){return t.tag||Ye(t)},co=function(t){return"show"===t.name},fo={name:"transition",props:so,abstract:!0,render:function(t){var e=this,i=this.$slots.default;if(i&&(i=i.filter(ho)).length){0;var n=this.mode;0;var r=i[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return r;var o=ao(r);if(!o)return r;if(this._leaving)return uo(t,r);var s="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?s+"comment":s+o.tag:a(o.key)?0===String(o.key).indexOf(s)?o.key:s+o.key:o.key;var l=(o.data||(o.data={})).transition=lo(this),u=this._vnode,h=ao(u);if(o.data.directives&&o.data.directives.some(co)&&(o.data.show=!0),h&&h.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(o,h)&&!Ye(h)&&(!h.componentInstance||!h.componentInstance._vnode.isComment)){var c=h.data.transition=k({},l);if("out-in"===n)return this._leaving=!0,ce(c,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),uo(t,r);if("in-out"===n){if(Ye(o))return u;var d,f=function(){d()};ce(l,"afterEnter",f),ce(l,"enterCancelled",f),ce(c,"delayLeave",(function(t){d=t}))}}return r}}},po=k({tag:String,moveClass:String},so);function go(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function mo(t){t.data.newPos=t.elm.getBoundingClientRect()}function vo(t){var e=t.data.pos,i=t.data.newPos,n=e.left-i.left,r=e.top-i.top;if(n||r){t.data.moved=!0;var o=t.elm.style;o.transform=o.WebkitTransform="translate("+n+"px,"+r+"px)",o.transitionDuration="0s"}}delete po.mode;var yo={Transition:fo,TransitionGroup:{props:po,beforeMount:function(){var t=this,e=this._update;this._update=function(i,n){var r=ii(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,r(),e.call(t,i,n)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",i=Object.create(null),n=this.prevChildren=this.children,r=this.$slots.default||[],o=this.children=[],s=lo(this),a=0;a-1?nn[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:nn[t]=/HTMLUnknownElement/.test(e.toString())},k(Pi.options.directives,oo),k(Pi.options.components,yo),Pi.prototype.__patch__=X?Yr:L,Pi.prototype.$mount=function(t,e){return function(t,e,i){var n;return t.$el=e,t.$options.render||(t.$options.render=_t),si(t,"beforeMount"),n=function(){t._update(t._render(),i)},new yi(t,n,L,{before:function(){t._isMounted&&!t._isDestroyed&&si(t,"beforeUpdate")}},!0),i=!1,null==t.$vnode&&(t._isMounted=!0,si(t,"mounted")),t}(this,t=t&&X?on(t):void 0,e)},X&&setTimeout((function(){U.devtools&&at&&at.emit("init",Pi)}),0);var _o=/\{\{((?:.|\r?\n)+?)\}\}/g,bo=/[-.*+?^${}()|[\]\/\\]/g,wo=x((function(t){var e=t[0].replace(bo,"\\$&"),i=t[1].replace(bo,"\\$&");return new RegExp(e+"((?:.|\\n)+?)"+i,"g")}));var xo={staticKeys:["staticClass"],transformNode:function(t,e){e.warn;var i=Gn(t,"class");i&&(t.staticClass=JSON.stringify(i));var n=Vn(t,"class",!1);n&&(t.classBinding=n)},genData:function(t){var e="";return t.staticClass&&(e+="staticClass:"+t.staticClass+","),t.classBinding&&(e+="class:"+t.classBinding+","),e}};var So,Co={staticKeys:["staticStyle"],transformNode:function(t,e){e.warn;var i=Gn(t,"style");i&&(t.staticStyle=JSON.stringify(dr(i)));var n=Vn(t,"style",!1);n&&(t.styleBinding=n)},genData:function(t){var e="";return t.staticStyle&&(e+="staticStyle:"+t.staticStyle+","),t.styleBinding&&(e+="style:("+t.styleBinding+"),"),e}},To=function(t){return(So=So||document.createElement("div")).innerHTML=t,So.textContent},Eo=m("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),Io=m("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),Ao=m("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),Po=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ko=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Ro="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+z.source+"]*",Lo="((?:"+Ro+"\\:)?"+Ro+")",Fo=new RegExp("^<"+Lo),Mo=/^\s*(\/?)>/,Oo=new RegExp("^<\\/"+Lo+"[^>]*>"),$o=/^]+>/i,Do=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},zo=/&(?:lt|gt|quot|amp|#39);/g,Vo=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Go=m("pre,textarea",!0),qo=function(t,e){return t&&Go(t)&&"\n"===e[0]};function Wo(t,e){var i=e?Vo:zo;return t.replace(i,(function(t){return Uo[t]}))}var Ko,Xo,Yo,Ho,Zo,Jo,Qo,ts,es=/^@|^v-on:/,is=/^v-|^@|^:|^#/,ns=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,rs=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,os=/^\(|\)$/g,ss=/^\[.*\]$/,as=/:(.*)$/,ls=/^:|^\.|^v-bind:/,us=/\.[^.\]]+(?=[^\]]*$)/g,hs=/^v-slot(:|$)|^#/,cs=/[\r\n]/,ds=/\s+/g,fs=x(To),ps="_empty_";function gs(t,e,i){return{type:1,tag:t,attrsList:e,attrsMap:xs(e),rawAttrsMap:{},parent:i,children:[]}}function ms(t,e){Ko=e.warn||On,Jo=e.isPreTag||F,Qo=e.mustUseProp||F,ts=e.getTagNamespace||F;var i=e.isReservedTag||F;(function(t){return!!t.component||!i(t.tag)}),Yo=$n(e.modules,"transformNode"),Ho=$n(e.modules,"preTransformNode"),Zo=$n(e.modules,"postTransformNode"),Xo=e.delimiters;var n,r,o=[],s=!1!==e.preserveWhitespace,a=e.whitespace,l=!1,u=!1;function h(t){if(c(t),l||t.processed||(t=vs(t,e)),o.length||t===n||n.if&&(t.elseif||t.else)&&_s(n,{exp:t.elseif,block:t}),r&&!t.forbidden)if(t.elseif||t.else)s=t,(a=function(t){for(var e=t.length;e--;){if(1===t[e].type)return t[e];t.pop()}}(r.children))&&a.if&&_s(a,{exp:s.elseif,block:s});else{if(t.slotScope){var i=t.slotTarget||'"default"';(r.scopedSlots||(r.scopedSlots={}))[i]=t}r.children.push(t),t.parent=r}var s,a;t.children=t.children.filter((function(t){return!t.slotScope})),c(t),t.pre&&(l=!1),Jo(t.tag)&&(u=!1);for(var h=0;h]*>)","i")),d=t.replace(c,(function(t,i,n){return u=n.length,No(h)||"noscript"===h||(i=i.replace(//g,"$1").replace(//g,"$1")),qo(h,i)&&(i=i.slice(1)),e.chars&&e.chars(i),""}));l+=t.length-d.length,t=d,E(h,l-u,l)}else{var f=t.indexOf("<");if(0===f){if(Do.test(t)){var p=t.indexOf("--\x3e");if(p>=0){e.shouldKeepComment&&e.comment(t.substring(4,p),l,l+p+3),S(p+3);continue}}if(jo.test(t)){var g=t.indexOf("]>");if(g>=0){S(g+2);continue}}var m=t.match($o);if(m){S(m[0].length);continue}var v=t.match(Oo);if(v){var y=l;S(v[0].length),E(v[1],y,l);continue}var _=C();if(_){T(_),qo(_.tagName,t)&&S(1);continue}}var b=void 0,w=void 0,x=void 0;if(f>=0){for(w=t.slice(f);!(Oo.test(w)||Fo.test(w)||Do.test(w)||jo.test(w)||(x=w.indexOf("<",1))<0);)f+=x,w=t.slice(f);b=t.substring(0,f)}f<0&&(b=t),b&&S(b.length),e.chars&&b&&e.chars(b,l-b.length,l)}if(t===i){e.chars&&e.chars(t);break}}function S(e){l+=e,t=t.substring(e)}function C(){var e=t.match(Fo);if(e){var i,n,r={tagName:e[1],attrs:[],start:l};for(S(e[0].length);!(i=t.match(Mo))&&(n=t.match(ko)||t.match(Po));)n.start=l,S(n[0].length),n.end=l,r.attrs.push(n);if(i)return r.unarySlash=i[1],S(i[0].length),r.end=l,r}}function T(t){var i=t.tagName,l=t.unarySlash;o&&("p"===n&&Ao(i)&&E(n),a(i)&&n===i&&E(i));for(var u=s(i)||!!l,h=t.attrs.length,c=new Array(h),d=0;d=0&&r[s].lowerCasedTag!==a;s--);else s=0;if(s>=0){for(var u=r.length-1;u>=s;u--)e.end&&e.end(r[u].tag,i,o);r.length=s,n=s&&r[s-1].tag}else"br"===a?e.start&&e.start(t,[],!0,i,o):"p"===a&&(e.start&&e.start(t,[],!1,i,o),e.end&&e.end(t,i,o))}E()}(t,{warn:Ko,expectHTML:e.expectHTML,isUnaryTag:e.isUnaryTag,canBeLeftOpenTag:e.canBeLeftOpenTag,shouldDecodeNewlines:e.shouldDecodeNewlines,shouldDecodeNewlinesForHref:e.shouldDecodeNewlinesForHref,shouldKeepComment:e.comments,outputSourceRange:e.outputSourceRange,start:function(t,i,s,a,c){var d=r&&r.ns||ts(t);J&&"svg"===d&&(i=function(t){for(var e=[],i=0;il&&(a.push(o=t.slice(l,r)),s.push(JSON.stringify(o)));var u=Fn(n[1].trim());s.push("_s("+u+")"),a.push({"@binding":u}),l=r+n[0].length}return l-1"+("true"===o?":("+e+")":":_q("+e+","+o+")")),zn(t,"change","var $$a="+e+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+s+");if(Array.isArray($$a)){var $$v="+(n?"_n("+r+")":r)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Xn(e,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Xn(e,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Xn(e,"$$c")+"}",null,!0)}(t,n,r);else if("input"===o&&"radio"===s)!function(t,e,i){var n=i&&i.number,r=Vn(t,"value")||"null";Dn(t,"checked","_q("+e+","+(r=n?"_n("+r+")":r)+")"),zn(t,"change",Xn(e,r),null,!0)}(t,n,r);else if("input"===o||"textarea"===o)!function(t,e,i){var n=t.attrsMap.type;0;var r=i||{},o=r.lazy,s=r.number,a=r.trim,l=!o&&"range"!==n,u=o?"change":"range"===n?er:"input",h="$event.target.value";a&&(h="$event.target.value.trim()");s&&(h="_n("+h+")");var c=Xn(e,h);l&&(c="if($event.target.composing)return;"+c);Dn(t,"value","("+e+")"),zn(t,u,c,null,!0),(a||s)&&zn(t,"blur","$forceUpdate()")}(t,n,r);else{if(!U.isReservedTag(o))return Kn(t,n,r),!1}return!0},text:function(t,e){e.value&&Dn(t,"textContent","_s("+e.value+")",e)},html:function(t,e){e.value&&Dn(t,"innerHTML","_s("+e.value+")",e)}},isPreTag:function(t){return"pre"===t},isUnaryTag:Eo,mustUseProp:Ni,canBeLeftOpenTag:Io,isReservedTag:tn,getTagNamespace:en,staticKeys:function(t){return t.reduce((function(t,e){return t.concat(e.staticKeys||[])}),[]).join(",")}(Es)},ks=x((function(t){return m("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(t?","+t:""))}));function Rs(t,e){t&&(Is=ks(e.staticKeys||""),As=e.isReservedTag||F,Ls(t),Fs(t,!1))}function Ls(t){if(t.static=function(t){if(2===t.type)return!1;if(3===t.type)return!0;return!(!t.pre&&(t.hasBindings||t.if||t.for||v(t.tag)||!As(t.tag)||function(t){for(;t.parent;){if("template"!==(t=t.parent).tag)return!1;if(t.for)return!0}return!1}(t)||!Object.keys(t).every(Is)))}(t),1===t.type){if(!As(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var e=0,i=t.children.length;e|^function(?:\s+[\w$]+)?\s*\(/,Os=/\([^)]*?\);*$/,$s=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Ds={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},js={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},Ns=function(t){return"if("+t+")return null;"},Bs={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Ns("$event.target !== $event.currentTarget"),ctrl:Ns("!$event.ctrlKey"),shift:Ns("!$event.shiftKey"),alt:Ns("!$event.altKey"),meta:Ns("!$event.metaKey"),left:Ns("'button' in $event && $event.button !== 0"),middle:Ns("'button' in $event && $event.button !== 1"),right:Ns("'button' in $event && $event.button !== 2")};function Us(t,e){var i=e?"nativeOn:":"on:",n="",r="";for(var o in t){var s=zs(t[o]);t[o]&&t[o].dynamic?r+=o+","+s+",":n+='"'+o+'":'+s+","}return n="{"+n.slice(0,-1)+"}",r?i+"_d("+n+",["+r.slice(0,-1)+"])":i+n}function zs(t){if(!t)return"function(){}";if(Array.isArray(t))return"["+t.map((function(t){return zs(t)})).join(",")+"]";var e=$s.test(t.value),i=Ms.test(t.value),n=$s.test(t.value.replace(Os,""));if(t.modifiers){var r="",o="",s=[];for(var a in t.modifiers)if(Bs[a])o+=Bs[a],Ds[a]&&s.push(a);else if("exact"===a){var l=t.modifiers;o+=Ns(["ctrl","shift","alt","meta"].filter((function(t){return!l[t]})).map((function(t){return"$event."+t+"Key"})).join("||"))}else s.push(a);return s.length&&(r+=function(t){return"if(!$event.type.indexOf('key')&&"+t.map(Vs).join("&&")+")return null;"}(s)),o&&(r+=o),"function($event){"+r+(e?"return "+t.value+"($event)":i?"return ("+t.value+")($event)":n?"return "+t.value:t.value)+"}"}return e||i?t.value:"function($event){"+(n?"return "+t.value:t.value)+"}"}function Vs(t){var e=parseInt(t,10);if(e)return"$event.keyCode!=="+e;var i=Ds[t],n=js[t];return"_k($event.keyCode,"+JSON.stringify(t)+","+JSON.stringify(i)+",$event.key,"+JSON.stringify(n)+")"}var Gs={on:function(t,e){t.wrapListeners=function(t){return"_g("+t+","+e.value+")"}},bind:function(t,e){t.wrapData=function(i){return"_b("+i+",'"+t.tag+"',"+e.value+","+(e.modifiers&&e.modifiers.prop?"true":"false")+(e.modifiers&&e.modifiers.sync?",true":"")+")"}},cloak:L},qs=function(t){this.options=t,this.warn=t.warn||On,this.transforms=$n(t.modules,"transformCode"),this.dataGenFns=$n(t.modules,"genData"),this.directives=k(k({},Gs),t.directives);var e=t.isReservedTag||F;this.maybeComponent=function(t){return!!t.component||!e(t.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Ws(t,e){var i=new qs(e);return{render:"with(this){return "+(t?Ks(t,i):'_c("div")')+"}",staticRenderFns:i.staticRenderFns}}function Ks(t,e){if(t.parent&&(t.pre=t.pre||t.parent.pre),t.staticRoot&&!t.staticProcessed)return Xs(t,e);if(t.once&&!t.onceProcessed)return Ys(t,e);if(t.for&&!t.forProcessed)return Js(t,e);if(t.if&&!t.ifProcessed)return Hs(t,e);if("template"!==t.tag||t.slotTarget||e.pre){if("slot"===t.tag)return function(t,e){var i=t.slotName||'"default"',n=ia(t,e),r="_t("+i+(n?","+n:""),o=t.attrs||t.dynamicAttrs?oa((t.attrs||[]).concat(t.dynamicAttrs||[]).map((function(t){return{name:C(t.name),value:t.value,dynamic:t.dynamic}}))):null,s=t.attrsMap["v-bind"];!o&&!s||n||(r+=",null");o&&(r+=","+o);s&&(r+=(o?"":",null")+","+s);return r+")"}(t,e);var i;if(t.component)i=function(t,e,i){var n=e.inlineTemplate?null:ia(e,i,!0);return"_c("+t+","+Qs(e,i)+(n?","+n:"")+")"}(t.component,t,e);else{var n;(!t.plain||t.pre&&e.maybeComponent(t))&&(n=Qs(t,e));var r=t.inlineTemplate?null:ia(t,e,!0);i="_c('"+t.tag+"'"+(n?","+n:"")+(r?","+r:"")+")"}for(var o=0;o>>0}(s):"")+")"}(t,t.scopedSlots,e)+","),t.model&&(i+="model:{value:"+t.model.value+",callback:"+t.model.callback+",expression:"+t.model.expression+"},"),t.inlineTemplate){var o=function(t,e){var i=t.children[0];0;if(i&&1===i.type){var n=Ws(i,e.options);return"inlineTemplate:{render:function(){"+n.render+"},staticRenderFns:["+n.staticRenderFns.map((function(t){return"function(){"+t+"}"})).join(",")+"]}"}}(t,e);o&&(i+=o+",")}return i=i.replace(/,$/,"")+"}",t.dynamicAttrs&&(i="_b("+i+',"'+t.tag+'",'+oa(t.dynamicAttrs)+")"),t.wrapData&&(i=t.wrapData(i)),t.wrapListeners&&(i=t.wrapListeners(i)),i}function ta(t){return 1===t.type&&("slot"===t.tag||t.children.some(ta))}function ea(t,e){var i=t.attrsMap["slot-scope"];if(t.if&&!t.ifProcessed&&!i)return Hs(t,e,ea,"null");if(t.for&&!t.forProcessed)return Js(t,e,ea);var n=t.slotScope===ps?"":String(t.slotScope),r="function("+n+"){return "+("template"===t.tag?t.if&&i?"("+t.if+")?"+(ia(t,e)||"undefined")+":undefined":ia(t,e)||"undefined":Ks(t,e))+"}",o=n?"":",proxy:true";return"{key:"+(t.slotTarget||'"default"')+",fn:"+r+o+"}"}function ia(t,e,i,n,r){var o=t.children;if(o.length){var s=o[0];if(1===o.length&&s.for&&"template"!==s.tag&&"slot"!==s.tag){var a=i?e.maybeComponent(s)?",1":",0":"";return""+(n||Ks)(s,e)+a}var l=i?function(t,e){for(var i=0,n=0;n':'
',ha.innerHTML.indexOf(" ")>0}var pa=!!X&&fa(!1),ga=!!X&&fa(!0),ma=x((function(t){var e=on(t);return e&&e.innerHTML})),va=Pi.prototype.$mount;Pi.prototype.$mount=function(t,e){if((t=t&&on(t))===document.body||t===document.documentElement)return this;var i=this.$options;if(!i.render){var n=i.template;if(n)if("string"==typeof n)"#"===n.charAt(0)&&(n=ma(n));else{if(!n.nodeType)return this;n=n.innerHTML}else t&&(n=function(t){if(t.outerHTML)return t.outerHTML;var e=document.createElement("div");return e.appendChild(t.cloneNode(!0)),e.innerHTML}(t));if(n){0;var r=da(n,{outputSourceRange:!1,shouldDecodeNewlines:pa,shouldDecodeNewlinesForHref:ga,delimiters:i.delimiters,comments:i.comments},this),o=r.render,s=r.staticRenderFns;i.render=o,i.staticRenderFns=s}}return va.call(this,t,e)},Pi.compile=da;const ya=Pi;function _a(t){this.state=2,this.value=void 0,this.deferred=[];var e=this;try{t((function(t){e.resolve(t)}),(function(t){e.reject(t)}))}catch(t){e.reject(t)}}_a.reject=function(t){return new _a((function(e,i){i(t)}))},_a.resolve=function(t){return new _a((function(e,i){e(t)}))},_a.all=function(t){return new _a((function(e,i){var n=0,r=[];function o(i){return function(o){r[i]=o,(n+=1)===t.length&&e(r)}}0===t.length&&e(r);for(var s=0;s=200&&o<300,this.status=o||0,this.statusText=s||"",this.headers=new el(r),this.body=t,La(t)?this.bodyText=t:(i=t,"undefined"!=typeof Blob&&i instanceof Blob&&(this.bodyBlob=t,function(t){return 0===t.type.indexOf("text")||-1!==t.type.indexOf("json")}(t)&&(this.bodyText=function(t){return new wa((function(e){var i=new FileReader;i.readAsText(t),i.onload=function(){e(i.result)}}))}(t))))}var e=t.prototype;return e.blob=function(){return $a(this.bodyBlob)},e.text=function(){return $a(this.bodyText)},e.json=function(){return $a(this.text(),(function(t){return JSON.parse(t)}))},t}();Object.defineProperty(nl.prototype,"data",{get:function(){return this.body},set:function(t){this.body=t}});var rl=function(){function t(t){this.body=null,this.params={},Na(this,t,{method:ka(t.method||"GET")}),this.headers instanceof el||(this.headers=new el(this.headers))}var e=t.prototype;return e.getUrl=function(){return Ka(this)},e.getBody=function(){return this.body},e.respondWith=function(t,e){return new nl(t,Na(e||{},{url:this.getUrl()}))},t}(),ol={"Content-Type":"application/json;charset=utf-8"};function sl(t){var e=this||{},i=function(t){var e=[tl],i=[];function n(n){for(;e.length;){var r=e.pop();if(Fa(r)){var o=function(){var e=void 0,o=void 0;if(Ma(e=r.call(t,n,(function(t){return o=t}))||o))return{v:new wa((function(n,r){i.forEach((function(i){e=$a(e,(function(e){return i.call(t,e)||e}),r)})),$a(e,n,r)}),t)};Fa(e)&&i.unshift(e)}();if("object"==typeof o)return o.v}else s="Invalid interceptor of type "+typeof r+", must be a function","undefined"!=typeof console&&Ea&&console.warn("[VueResource warn]: "+s)}var s}return Ma(t)||(t=null),n.use=function(t){e.push(t)},n}(e.$vm);return function(t){Ta.call(arguments,1).forEach((function(e){for(var i in e)void 0===t[i]&&(t[i]=e[i])}))}(t||{},e.$options,sl.options),sl.interceptors.forEach((function(t){La(t)&&(t=sl.interceptor[t]),Fa(t)&&i.use(t)})),i(new rl(t)).then((function(t){return t.ok?t:wa.reject(t)}),(function(t){var e;return t instanceof Error&&(e=t,"undefined"!=typeof console&&console.error(e)),wa.reject(t)}))}function al(t,e,i,n){var r=this||{},o={};return ja(i=Na({},al.actions,i),(function(i,s){i=Ba({url:t,params:Na({},e)},n,i),o[s]=function(){return(r.$http||sl)(ll(i,arguments))}})),o}function ll(t,e){var i,n=Na({},t),r={};switch(e.length){case 2:r=e[0],i=e[1];break;case 1:/^(POST|PUT|PATCH)$/i.test(n.method)?i=e[0]:r=e[0];break;case 0:break;default:throw"Expected up to 2 arguments [params, body], got "+e.length+" arguments"}return n.body=i,n.params=Na({},n.params,r),n}function ul(t){ul.installed||(!function(t){var e=t.config,i=t.nextTick;Sa=i,Ea=e.debug||!e.silent}(t),t.url=Ka,t.http=sl,t.resource=al,t.Promise=wa,Object.defineProperties(t.prototype,{$url:{get:function(){return Da(t.url,this,this.$options.url)}},$http:{get:function(){return Da(t.http,this,this.$options.http)}},$resource:{get:function(){return t.resource.bind(this)}},$promise:{get:function(){var e=this;return function(i){return new t.Promise(i,e)}}}}))}sl.options={},sl.headers={put:ol,post:ol,patch:ol,delete:ol,common:{Accept:"application/json, text/plain, */*"},custom:{}},sl.interceptor={before:function(t){Fa(t.before)&&t.before.call(this,t)},method:function(t){t.emulateHTTP&&/^(PUT|PATCH|DELETE)$/i.test(t.method)&&(t.headers.set("X-HTTP-Method-Override",t.method),t.method="POST")},jsonp:function(t){"JSONP"==t.method&&(t.client=Za)},json:function(t){var e=t.headers.get("Content-Type")||"";return Ma(t.body)&&0===e.indexOf("application/json")&&(t.body=JSON.stringify(t.body)),function(t){return t.bodyText?$a(t.text(),(function(e){if(0===(t.headers.get("Content-Type")||"").indexOf("application/json")||function(t){var e=t.match(/^\s*(\[|\{)/),i={"[":/]\s*$/,"{":/}\s*$/};return e&&i[e[1]].test(t)}(e))try{t.body=JSON.parse(e)}catch(e){t.body=null}else t.body=e;return t})):t}},form:function(t){var e;e=t.body,"undefined"!=typeof FormData&&e instanceof FormData?t.headers.delete("Content-Type"):Ma(t.body)&&t.emulateJSON&&(t.body=Ka.params(t.body),t.headers.set("Content-Type","application/x-www-form-urlencoded"))},header:function(t){ja(Na({},sl.headers.common,t.crossOrigin?{}:sl.headers.custom,sl.headers[Pa(t.method)]),(function(e,i){t.headers.has(i)||t.headers.set(i,e)}))},cors:function(t){if(Ia){var e=Ka.parse(location.href),i=Ka.parse(t.getUrl());i.protocol===e.protocol&&i.host===e.host||(t.crossOrigin=!0,t.emulateHTTP=!1,Ha||(t.client=Ya))}}},sl.interceptors=["before","method","jsonp","json","form","header","cors"],["get","delete","head","jsonp"].forEach((function(t){sl[t]=function(e,i){return this(Na(i||{},{url:e,method:t}))}})),["post","put","patch"].forEach((function(t){sl[t]=function(e,i,n){return this(Na(n||{},{url:e,method:t,body:i}))}})),al.actions={get:{method:"GET"},save:{method:"POST"},query:{method:"GET"},update:{method:"PUT"},remove:{method:"DELETE"},delete:{method:"DELETE"}},"undefined"!=typeof window&&window.Vue&&!window.Vue.resource&&window.Vue.use(ul);const hl=ul;window.Vue=ya,window.Vue.use(hl);var cl=function(t,e){window.addEventListener("load",(function(){var i=document.getElementById(t);i&&(e instanceof Vue||(e=new Vue(e)),e.$mount(i))}))},dl=function(t){t=Array.isArray(t)?t:t.split("."),window.biigle||(window.biigle={});for(var e=window.biigle,i=0,n=t.length;i=0;i--)if(!1===t[i].callback(e))return},on:function(t,e,i,n){var r=this,o=(t=this.prepareKeys(t)).join("+");this.compatibilityMaps.forEach((function(s){var a=t.map((function(t){return s.hasOwnProperty(t)?s[t]:t}));o!==a.join("+")&&r.on(a,e,i,n)}));var s={callback:e,priority:i=i||0};n=n||"default",this.listenerSets.hasOwnProperty(n)||(this.listenerSets[n]={});var a=this.listenerSets[n];if(a.hasOwnProperty(o)){var l,u=a[o];for(l=0;l=i);l++);l===u.length-1?u.push(s):u.splice(l,0,s)}else a[o]=[s]},off:function(t,e,i){t=this.prepareKeys(t).join("+"),i=i||"default";var n=this.listenerSets[i];if(n&&n.hasOwnProperty(t))for(var r=n[t],o=r.length-1;o>=0;o--)if(r[o].callback===e){r.splice(o,1);break}},setActiveSet:function(t){this.activeListenerSetName=t}},created:function(){document.body.addEventListener("keydown",this.handleKeyDown),document.body.addEventListener("keyup",this.handleKeyUp),window.addEventListener("focus",this.clearPressedKeys)}}),undefined,undefined,!1,null,null,null).exports;const kl=Sl({components:{sidebarButton:Il},data:function(){return{open:!1,tabs:[],lastOpenedTab:null,tabIdSequence:0}},props:{openTab:{type:String},showButtons:{type:Boolean,default:!0},direction:{type:String,default:"right",validator:function(t){return"left"===t||"right"===t}},toggleOnKeyboard:{type:Boolean,default:!1}},computed:{classObject:function(){return{"sidebar--open":this.open,"sidebar--left":this.isLeft,"sidebar--right":!this.isLeft}},isLeft:function(){return"left"===this.direction}},methods:{registerTab:function(t){t.id=this.tabIdSequence++,this.tabs.push(t)},handleOpenTab:function(t){this.open=!0,this.lastOpenedTab=t,this.$emit("toggle",t),Al.$emit("sidebar.toggle",t),Al.$emit("sidebar.open.".concat(t))},handleCloseTab:function(t){this.open=!1,this.$emit("toggle",t),Al.$emit("sidebar.toggle",t),Al.$emit("sidebar.close.".concat(t))},toggleLastOpenedTab:function(t){this.open?(t.preventDefault(),this.$emit("close",this.lastOpenedTab)):this.lastOpenedTab?(t.preventDefault(),this.$emit("open",this.lastOpenedTab)):this.tabs.length>0&&(t.preventDefault(),this.$emit("open",this.tabs[0].name))}},watch:{openTab:function(t){this.$emit("open",t)}},created:function(){this.$on("open",this.handleOpenTab),this.$on("close",this.handleCloseTab),this.toggleOnKeyboard&&Pl.on("Tab",this.toggleLastOpenedTab)},mounted:function(){this.openTab&&this.$emit("open",this.openTab)}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("aside",{staticClass:"sidebar",class:t.classObject},[t.showButtons?i("div",{staticClass:"sidebar__buttons"},t._l(t.tabs,(function(e){return i("sidebar-button",{key:e.id,attrs:{tab:e,direction:t.direction}})})),1):t._e(),t._v(" "),i("div",{staticClass:"sidebar__tabs"},[t._t("default")],2)])}),[],!1,null,null,null).exports;const Rl=Sl({data:function(){return{id:null,open:!1}},props:{name:{type:String,required:!0},icon:{type:String,required:!0},title:{type:String},href:{type:String},disabled:{type:Boolean,default:!1},highlight:{default:!1}},computed:{classObject:function(){return{"sidebar__tab--open":this.open}}},beforeCreate:function(){var t=this;this.$parent.$on("open",(function(e){t.open=e===t.name})),this.$parent.$on("close",(function(){t.open=!1})),this.$parent.registerTab(this)}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"sidebar__tab",class:t.classObject},[t._t("default")],2)}),[],!1,null,null,null).exports;function Ll(t){return null!=t}function Fl(t){return"string"==typeof t}var Ml="focus",Ol="blur",$l="click",Dl="input",jl="keydown",Nl="touchend";function Bl(t,e,i){t.addEventListener(e,i)}function Ul(t,e,i){t.removeEventListener(e,i)}function zl(t){return t&&t.nodeType===Node.ELEMENT_NODE}function Vl(t){zl(t)&&(!t.getAttribute("tabindex")&&t.setAttribute("tabindex","-1"),t.focus())}function Gl(t,e,i,n,r,o,s,a,l,u){"boolean"!=typeof s&&(l=a,a=s,s=!1);var h,c="function"==typeof i?i.options:i;if(t&&t.render&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),n&&(c._scopeId=n),o?(h=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=h):e&&(h=s?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),h)if(c.functional){var d=c.render;c.render=function(t,e){return h.call(e),d(t,e)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,h):[h]}return i}var ql={components:{Dropdown:{render:function(t){return t(this.tag,{class:{"btn-group":"div"===this.tag,dropdown:!this.dropup,dropup:this.dropup,open:this.show}},[this.$slots.default,t("ul",{class:{"dropdown-menu":!0,"dropdown-menu-right":this.menuRight},ref:"dropdown"},[this.$slots.dropdown])])},props:{tag:{type:String,default:"div"},appendToBody:{type:Boolean,default:!1},value:Boolean,dropup:{type:Boolean,default:!1},menuRight:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},notCloseElements:Array,positionElement:null},data:function(){return{show:!1,triggerEl:void 0}},watch:{value:function(t){this.toggle(t)}},mounted:function(){this.initTrigger(),this.triggerEl&&(Bl(this.triggerEl,$l,this.toggle),Bl(this.triggerEl,jl,this.onKeyPress)),Bl(this.$refs.dropdown,jl,this.onKeyPress),Bl(window,$l,this.windowClicked),Bl(window,Nl,this.windowClicked),this.value&&this.toggle(!0)},beforeDestroy:function(){this.removeDropdownFromBody(),this.triggerEl&&(Ul(this.triggerEl,$l,this.toggle),Ul(this.triggerEl,jl,this.onKeyPress)),Ul(this.$refs.dropdown,jl,this.onKeyPress),Ul(window,$l,this.windowClicked),Ul(window,Nl,this.windowClicked)},methods:{getFocusItem:function(){return this.$refs.dropdown.querySelector("li > a:focus")},onKeyPress:function(t){if(this.show){var e=this.$refs.dropdown,i=t.keyCode;if(27===i)this.toggle(!1),this.triggerEl&&this.triggerEl.focus();else if(13===i){var n=this.getFocusItem();n&&n.click()}else if(38===i||40===i){t.preventDefault(),t.stopPropagation();var r=this.getFocusItem(),o=e.querySelectorAll("li:not(.disabled) > a");if(r){for(var s=0;s0?Vl(o[s-1]):40===i&&s=0;s=o||a&&l}if(s){i=!0;break}}var u=this.$refs.dropdown.contains(e),h=this.$el.contains(e)&&!u,c=u&&"touchend"===t.type;h||i||c||this.toggle(!1)}},appendDropdownToBody:function(){try{var t=this.$refs.dropdown;t.style.display="block",document.body.appendChild(t),function(t,e,i){void 0===i&&(i={});var n=document.documentElement,r=(window.pageXOffset||n.scrollLeft)-(n.clientLeft||0),o=(window.pageYOffset||n.scrollTop)-(n.clientTop||0),s=e.getBoundingClientRect(),a=t.getBoundingClientRect();t.style.right="auto",t.style.bottom="auto",i.menuRight?t.style.left=r+s.left+s.width-a.width+"px":t.style.left=r+s.left+"px",i.dropup?t.style.top=o+s.top-a.height-4+"px":t.style.top=o+s.top+s.height+"px"}(t,this.positionElement||this.$el,this)}catch(t){}},removeDropdownFromBody:function(){try{var t=this.$refs.dropdown;t.removeAttribute("style"),this.$el.appendChild(t)}catch(t){}}}}},props:{value:{required:!0},data:Array,itemKey:String,appendToBody:{type:Boolean,default:!1},ignoreCase:{type:Boolean,default:!0},matchStart:{type:Boolean,default:!1},forceSelect:{type:Boolean,default:!1},forceClear:{type:Boolean,default:!1},limit:{type:Number,default:10},asyncSrc:String,asyncKey:String,asyncFunction:Function,debounce:{type:Number,default:200},openOnFocus:{type:Boolean,default:!0},openOnEmpty:{type:Boolean,default:!1},target:{required:!0},preselect:{type:Boolean,default:!0}},data:function(){return{inputEl:null,items:[],activeIndex:0,timeoutID:0,elements:[],open:!1,dropdownMenuEl:null}},computed:{regexOptions:function(){var t="";return this.ignoreCase&&(t+="i"),this.matchStart||(t+="g"),t}},mounted:function(){var t=this;Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(t){for(var e=(this.document||this.ownerDocument).querySelectorAll(t),i=e.length;--i>=0&&e.item(i)!==this;);return i>-1}),this.$nextTick((function(){t.initInputElByTarget(t.target),t.initListeners(),t.dropdownMenuEl=t.$refs.dropdown.$el.querySelector(".dropdown-menu"),t.value&&t.setInputTextByValue(t.value)}))},beforeDestroy:function(){this.removeListeners()},watch:{target:function(t){this.removeListeners(),this.initInputElByTarget(t),this.initListeners()},value:function(t){this.setInputTextByValue(t)}},methods:{setInputTextByValue:function(t){Fl(t)?this.inputEl.value=t:t?this.inputEl.value=this.itemKey?t[this.itemKey]:t:null===t&&(this.inputEl.value="")},hasEmptySlot:function(){return!!this.$slots.empty||!!this.$scopedSlots.empty},initInputElByTarget:function(t){var e;t&&(this.inputEl=Fl(e=t)?document.querySelector(e):zl(e)?e:zl(e.$el)?e.$el:null)},initListeners:function(){this.inputEl&&(this.elements=[this.inputEl],Bl(this.inputEl,Ml,this.inputFocused),Bl(this.inputEl,Ol,this.inputBlured),Bl(this.inputEl,Dl,this.inputChanged),Bl(this.inputEl,jl,this.inputKeyPressed))},removeListeners:function(){this.elements=[],this.inputEl&&(Ul(this.inputEl,Ml,this.inputFocused),Ul(this.inputEl,Ol,this.inputBlured),Ul(this.inputEl,Dl,this.inputChanged),Ul(this.inputEl,jl,this.inputKeyPressed))},prepareItems:function(t,e){if(void 0===e&&(e=!1),e)this.items=t.slice(0,this.limit);else{this.items=[],this.activeIndex=this.preselect?0:-1;for(var i=0,n=t.length;i=0)&&this.items.push(r),this.items.length>=this.limit)break}}},fetchItems:function(t,e){var i=this;if(clearTimeout(this.timeoutID),""!==t||this.openOnEmpty){if(this.data)this.prepareItems(this.data),this.open=this.hasEmptySlot()||Boolean(this.items.length);else if(this.asyncSrc)this.timeoutID=setTimeout((function(){i.$emit("loading"),function(t,e){void 0===e&&(e="GET");var i=new window.XMLHttpRequest,n={},r={then:function(t,e){return r.done(t).fail(e)},catch:function(t){return r.fail(t)},always:function(t){return r.done(t).fail(t)}};return["done","fail"].forEach((function(t){n[t]=[],r[t]=function(e){return e instanceof Function&&n[t].push(e),r}})),r.done(JSON.parse),i.onreadystatechange=function(){if(4===i.readyState){var t={status:i.status};if(200===i.status){var e=i.responseText;for(var r in n.done)if(s=n.done,a=r,Object.prototype.hasOwnProperty.call(s,a)&&"function"==typeof n.done[r]){var o=n.done[r](e);Ll(o)&&(e=o)}}else n.fail.forEach((function(e){return e(t)}))}var s,a},i.open(e,t),i.setRequestHeader("Accept","application/json"),i.send(),r}(i.asyncSrc+encodeURIComponent(t)).then((function(t){i.inputEl.matches(":focus")&&(i.prepareItems(i.asyncKey?t[i.asyncKey]:t,!0),i.open=i.hasEmptySlot()||Boolean(i.items.length)),i.$emit("loaded")})).catch((function(t){console.error(t),i.$emit("loaded-error")}))}),e);else if(this.asyncFunction){var n=function(t){i.inputEl.matches(":focus")&&(i.prepareItems(t,!0),i.open=i.hasEmptySlot()||Boolean(i.items.length)),i.$emit("loaded")};this.timeoutID=setTimeout((function(){i.$emit("loading"),i.asyncFunction(t,n)}),e)}}else this.open=!1},inputChanged:function(){var t=this.inputEl.value;this.fetchItems(t,this.debounce),this.$emit("input",this.forceSelect?void 0:t)},inputFocused:function(){if(this.openOnFocus){var t=this.inputEl.value;this.fetchItems(t,0)}},inputBlured:function(){var t=this;this.dropdownMenuEl.matches(":hover")||(this.open=!1),this.inputEl&&this.forceClear&&this.$nextTick((function(){void 0===t.value&&(t.inputEl.value="")}))},inputKeyPressed:function(t){if(t.stopPropagation(),this.open)switch(t.keyCode){case 13:this.activeIndex>=0?this.selectItem(this.items[this.activeIndex]):this.open=!1,t.preventDefault();break;case 27:this.open=!1;break;case 38:this.activeIndex=this.activeIndex>0?this.activeIndex-1:0;break;case 40:var e=this.items.length-1;this.activeIndex=this.activeIndex$&")}}},Wl=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("dropdown",{ref:"dropdown",attrs:{tag:"section","append-to-body":t.appendToBody,"not-close-elements":t.elements,"position-element":t.inputEl},model:{value:t.open,callback:function(e){t.open=e},expression:"open"}},[i("template",{slot:"dropdown"},[t._t("item",t._l(t.items,(function(e,n){return i("li",{class:{active:t.activeIndex===n}},[i("a",{attrs:{href:"#"},on:{click:function(i){return i.preventDefault(),t.selectItem(e)}}},[i("span",{domProps:{innerHTML:t._s(t.highlight(e))}})])])})),{items:t.items,activeIndex:t.activeIndex,select:t.selectItem,highlight:t.highlight}),t._v(" "),t.items&&0!==t.items.length?t._e():t._t("empty")],2)],2)};Wl._withStripped=!0;const Kl=Gl({render:Wl,staticRenderFns:[]},undefined,ql,undefined,false,undefined,!1,void 0,void 0,void 0);var Xl=Sl({props:{props:{type:Object,required:!0},item:{type:Object,required:!0},itemKey:{type:String,default:""}},computed:{info:function(){return this.itemKey?this.itemKey.split(".").reduce((function(t,e){return t?t[e]:t}),this.item):""}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("li",[i("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.props.select(t.item)}}},[i("span",{domProps:{innerHTML:t._s(t.props.highlight(t.item))}}),t._v(" "),t.info?i("span",[i("br"),i("small",{staticClass:"typeahead-item-info",attrs:{title:t.info},domProps:{textContent:t._s(t.info)}})]):t._e()])])}),[],!1,null,null,null);function Yl(t){return(Yl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}const Hl=Sl({components:{typeahead:Kl,typeaheadItem:Xl.exports},props:{items:{type:Array,required:!0},placeholder:{type:String,default:"Item name"},disabled:{type:Boolean,default:!1},value:{type:String,default:""},clearOnSelect:{type:Boolean,default:!1},moreInfo:{type:String,default:""},limit:{type:Number,default:5}},data:function(){return{inputElement:null,internalValue:void 0}},methods:{clear:function(){this.internalValue=void 0,this.$refs.input.value=""},emitFocus:function(t){this.$emit("focus",t)},emitBlur:function(t){this.$emit("blur",t)}},watch:{internalValue:function(t){"object"===Yl(t)&&(this.$emit("input",t),this.$emit("select",t),this.clearOnSelect&&this.clear())},value:function(t){this.internalValue=t}},created:function(){this.internalValue=this.value},mounted:function(){this.inputElement=this.$refs.input}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"typeahead clearfix"},[i("input",{ref:"input",staticClass:"form-control",attrs:{type:"text",disabled:t.disabled,placeholder:t.placeholder},on:{focus:t.emitFocus,blue:t.emitBlur}}),t._v(" "),i("typeahead",{attrs:{target:t.inputElement,data:t.items,"force-select":!0,limit:t.limit,"item-key":"name"},scopedSlots:t._u([{key:"item",fn:function(e){return t._l(e.items,(function(n,r){return i("typeahead-item",{key:r,class:{active:e.activeIndex===r},attrs:{props:e,item:n,"item-key":t.moreInfo}})}))}}]),model:{value:t.internalValue,callback:function(e){t.internalValue=e},expression:"internalValue"}})],1)}),[],!1,null,null,null).exports;var Zl={},Jl=function(t,e,i){Zl.hasOwnProperty(i)&&window.clearTimeout(Zl[i]),Zl[i]=window.setTimeout(t,e)},Ql=new Vue({data:{params:{}},methods:{setSlug:function(t,e){e=e||-1;var i=window.location.pathname.replace(/\/$/,""),n=i.split("/");n.splice(e,1,t),n=n.join("/"),this.replaceState(window.location.href.replace(i,n))},set:function(t){this.params=t,this.updateSearch()},unset:function(t){delete this.params[t],this.updateSearch()},get:function(t){return this.params[t]},updateSearch:function(){var t=[],e=window.location.href;for(var i in this.params)this.params.hasOwnProperty(i)&&t.push(i+"="+this.params[i]);t=t.length>0?"?"+t.join("&"):"",window.location.search?this.replaceState(e.replace(window.location.search,t)):-1!==e.indexOf("#")?window.location.hash?this.replaceState(e.replace(window.location.hash,t+window.location.hash)):this.replaceState(e.slice(0,-1)+t):this.replaceState(e+t)},replaceState:function(t){history.replaceState(null,null,t)}},created:function(){var t=window.location.search.substr(1);if(t)for(var e,i=(t=t.split("&")).length-1;i>=0;i--)e=t[i].split("="),this.params[e[0]]=e[1]}}),tu={},eu={},iu=function(t,e,i){eu[i]=t,tu.hasOwnProperty(i)||(tu[i]=window.setTimeout((function(){eu[i](),delete tu[i]}),e))},nu=function(t){return"string"!=typeof t?"":t.charAt(0).toUpperCase()+t.slice(1)},ru=new Vue({data:{max:1,all:[]},methods:{post:function(t,e){document.fullscreenElement&&(document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()),this.all.unshift({id:Date.now(),type:t,text:e}),this.all.length>this.max&&this.all.pop()},danger:function(t){this.post("danger",t)},warning:function(t){this.post("warning",t)},success:function(t){this.post("success",t)},info:function(t){this.post("info",t)},close:function(t){for(var e=this.all.length-1;e>=0;e--)this.all[e].id===t&&this.all.splice(e,1)},handleErrorResponse:function(t){var e=t.body;if(e){if(422===t.status&&e.errors){for(var i in e.errors)this.danger(e.errors[i][0]);return}if(e.message)return void this.danger(e.message);if("string"==typeof e)return void this.danger(e)}403===t.status?this.danger("You have no permission to do that."):401===t.status?this.danger("Please log in (again)."):this.danger("The server didn't respond, sorry.")},handleResponseError:function(t){return this.handleErrorResponse(t)}}}),ou=ru.handleErrorResponse;const su=Sl(ru,undefined,undefined,!1,null,null,null).exports;const au=Sl({data:function(){return{editing:!1}},methods:{startEditing:function(){this.editing=!0,this.$emit("editing.start")},finishEditing:function(){this.editing=!1,this.$emit("editing.stop")},toggleEditing:function(){this.editing?this.finishEditing():this.startEditing()}}},undefined,undefined,!1,null,null,null).exports;const lu=Sl({components:{loader:Cl,loaderBlock:Tl},data:function(){return{instancesLoading:0}},computed:{loading:function(){return this.instancesLoading>0}},watch:{loading:function(t){this.$emit("loading",t)}},methods:{startLoading:function(){this.instancesLoading+=1},finishLoading:function(){this.instancesLoading>0&&(this.instancesLoading-=1)},handleErrorResponse:function(t){return su.handleErrorResponse(t)}}},undefined,undefined,!1,null,null,null).exports;const uu=Sl(Vue.extend({data:function(){return{urlParams:[],storageKey:"biigle.settings",defaults:{},data:{}}},methods:{set:function(t,e){e===this.defaults[t]?this.delete(t):this.has(t)?this.data[t]=e:Vue.set(this.data,t,e),Jl(this.persist,100,this.storageKey)},delete:function(t){Vue.delete(this.data,t),this.persist()},get:function(t){return this.has(t)?this.data[t]:this.defaults[t]},has:function(t){return this.data.hasOwnProperty(t)},persist:function(){Object.keys(this.data).length>0?window.localStorage.setItem(this.storageKey,JSON.stringify(this.data)):window.localStorage.removeItem(this.storageKey)},restoreFromLocalStorage:function(){var t=JSON.parse(window.localStorage.getItem(this.storageKey));t&&Vue.set(this,"data",t)},restoreFromUrlParams:function(t){var e=this,i=Ql.params;(t=t||Object.keys(i)).forEach((function(t){i.hasOwnProperty(t)&&Vue.set(e.data,t,i[t])}))},watch:function(t,e){return this.$watch("data.".concat(t),e)}},created:function(){this.restoreFromLocalStorage(),this.urlParams.length>0&&this.restoreFromUrlParams(this.urlParams)}}),undefined,undefined,!1,null,null,null).exports;function hu(t){return"function"==typeof t}function cu(t){return"string"==typeof t}var du="mouseenter",fu="mouseleave",pu="focus",gu="blur",mu="click",vu="click",yu="hover",_u="focus",bu="hover-focus",wu="outside-click",xu="top",Su="right",Cu="bottom",Tu="left";function Eu(t,e,i){t.addEventListener(e,i)}function Iu(t,e,i){t.removeEventListener(e,i)}function Au(t){return t&&t.nodeType===Node.ELEMENT_NODE}function Pu(t){Au(t)&&Au(t.parentNode)&&t.parentNode.removeChild(t)}function ku(t,e){if(Au(t))if(t.className){var i=t.className.split(" ");i.indexOf(e)<0&&(i.push(e),t.className=i.join(" "))}else t.className=e}function Ru(t,e){if(Au(t)&&t.className){for(var i=t.className.split(" "),n=[],r=0,o=i.length;r=r.height,u=n.left+n.width/2>=r.width/2,a=n.right-n.width/2+r.width/2<=o.width;break;case Cu:l=n.bottom+r.height<=o.height,u=n.left+n.width/2>=r.width/2,a=n.right-n.width/2+r.width/2<=o.width;break;case Su:a=n.right+r.width<=o.width,s=n.top+n.height/2>=r.height/2,l=n.bottom-n.height/2+r.height/2<=o.height;break;case Tu:u=n.left>=r.width,s=n.top+n.height/2>=r.height/2,l=n.bottom-n.height/2+r.height/2<=o.height}return s&&a&&l&&u}function Fu(){return document.querySelectorAll(".modal-backdrop").length}function Mu(t){return cu(t)?document.querySelector(t):Au(t)?t:Au(t.$el)?t.$el:null}var Ou="in";const $u={mixins:[{props:{value:{type:Boolean,default:!1},tag:{type:String,default:"span"},placement:{type:String,default:xu},autoPlacement:{type:Boolean,default:!0},appendTo:{type:null,default:"body"},positionBy:{type:null,default:null},transition:{type:Number,default:150},hideDelay:{type:Number,default:0},showDelay:{type:Number,default:0},enable:{type:Boolean,default:!0},enterable:{type:Boolean,default:!0},target:null,viewport:null,customClass:String},data:function(){return{triggerEl:null,hideTimeoutId:0,showTimeoutId:0,transitionTimeoutId:0,autoTimeoutId:0}},watch:{value:function(t){t?this.show():this.hide()},trigger:function(){this.clearListeners(),this.initListeners()},target:function(t){this.clearListeners(),this.initTriggerElByTarget(t),this.initListeners()},allContent:function(t){var e=this;this.isNotEmpty()?this.$nextTick((function(){e.isShown()&&e.resetPosition()})):this.hide()},enable:function(t){t||this.hide()}},mounted:function(){var t=this;Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(t){for(var e=(this.document||this.ownerDocument).querySelectorAll(t),i=e.length;--i>=0&&e.item(i)!==this;);return i>-1}),Pu(this.$refs.popup),this.$nextTick((function(){t.initTriggerElByTarget(t.target),t.initListeners(),t.value&&t.show()}))},beforeDestroy:function(){this.clearListeners(),Pu(this.$refs.popup)},methods:{initTriggerElByTarget:function(t){if(t)this.triggerEl=Mu(t);else{var e=this.$el.querySelector('[data-role="trigger"]');if(e)this.triggerEl=e;else{var i=this.$el.firstChild;this.triggerEl=i===this.$refs.popup?null:i}}},initListeners:function(){this.triggerEl&&(this.trigger===yu?(Eu(this.triggerEl,du,this.show),Eu(this.triggerEl,fu,this.hide)):this.trigger===_u?(Eu(this.triggerEl,pu,this.show),Eu(this.triggerEl,gu,this.hide)):this.trigger===bu?(Eu(this.triggerEl,du,this.handleAuto),Eu(this.triggerEl,fu,this.handleAuto),Eu(this.triggerEl,pu,this.handleAuto),Eu(this.triggerEl,gu,this.handleAuto)):this.trigger!==vu&&this.trigger!==wu||Eu(this.triggerEl,mu,this.toggle)),Eu(window,mu,this.windowClicked)},clearListeners:function(){this.triggerEl&&(Iu(this.triggerEl,pu,this.show),Iu(this.triggerEl,gu,this.hide),Iu(this.triggerEl,du,this.show),Iu(this.triggerEl,fu,this.hide),Iu(this.triggerEl,mu,this.toggle),Iu(this.triggerEl,du,this.handleAuto),Iu(this.triggerEl,fu,this.handleAuto),Iu(this.triggerEl,pu,this.handleAuto),Iu(this.triggerEl,gu,this.handleAuto)),Iu(window,mu,this.windowClicked),this.clearTimeouts()},clearTimeouts:function(){this.hideTimeoutId&&(clearTimeout(this.hideTimeoutId),this.hideTimeoutId=0),this.showTimeoutId&&(clearTimeout(this.showTimeoutId),this.showTimeoutId=0),this.transitionTimeoutId&&(clearTimeout(this.transitionTimeoutId),this.transitionTimeoutId=0),this.autoTimeoutId&&(clearTimeout(this.autoTimeoutId),this.autoTimeoutId=0)},resetPosition:function(){var t=this.$refs.popup;t&&(!function(t,e,i,n,r,o,s){if(Au(t)&&Au(e)){var a,l,u=t&&t.className&&t.className.indexOf("popover")>=0;if(null==r||"body"===r||"body"===o){var h=document.documentElement;l=(window.pageXOffset||h.scrollLeft)-(h.clientLeft||0),a=(window.pageYOffset||h.scrollTop)-(h.clientTop||0)}else{var c=Mu(o||r);l=c.scrollLeft,a=c.scrollTop}if(n){var d=[Su,Cu,Tu,xu],f=function(e){d.forEach((function(e){Ru(t,e)})),ku(t,e)};if(!Lu(e,t,i)){for(var p=0,g=d.length;pT&&(m=T-b.height),vE&&(v=E-b.width),i===Cu?m-=w:i===Tu?v+=w:i===Su?v-=w:m+=w}t.style.top=m+"px",t.style.left=v+"px"}}(t,this.triggerEl,this.placement,this.autoPlacement,this.appendTo,this.positionBy,this.viewport),t.offsetHeight)},hideOnLeave:function(){(this.trigger===yu||this.trigger===bu&&!this.triggerEl.matches(":focus"))&&this.$hide()},toggle:function(){this.isShown()?this.hide():this.show()},show:function(){var t=this;if(this.enable&&this.triggerEl&&this.isNotEmpty()&&!this.isShown()){var e=this.hideTimeoutId>0;e&&(clearTimeout(this.hideTimeoutId),this.hideTimeoutId=0),this.transitionTimeoutId>0&&(clearTimeout(this.transitionTimeoutId),this.transitionTimeoutId=0),clearTimeout(this.showTimeoutId),this.showTimeoutId=setTimeout((function(){t.showTimeoutId=0;var i=t.$refs.popup;if(i){var n=Fu();if(n>1){var r="popover"===t.name?1060:1070,o=20*(n-1);i.style.zIndex=""+(r+o)}if(!e)i.className=t.name+" "+t.placement+" "+(t.customClass?t.customClass:"")+" fade",Mu(t.appendTo).appendChild(i),t.resetPosition();ku(i,Ou),t.$emit("input",!0),t.$emit("show")}}),this.showDelay)}},hide:function(){var t=this;this.showTimeoutId>0&&(clearTimeout(this.showTimeoutId),this.showTimeoutId=0),this.isShown()&&(!this.enterable||this.trigger!==yu&&this.trigger!==bu?this.$hide():(clearTimeout(this.hideTimeoutId),this.hideTimeoutId=setTimeout((function(){t.hideTimeoutId=0;var e=t.$refs.popup;e&&!e.matches(":hover")&&t.$hide()}),100)))},$hide:function(){var t=this;this.isShown()&&(clearTimeout(this.hideTimeoutId),this.hideTimeoutId=setTimeout((function(){t.hideTimeoutId=0,Ru(t.$refs.popup,Ou),t.transitionTimeoutId=setTimeout((function(){t.transitionTimeoutId=0,Pu(t.$refs.popup),t.$emit("input",!1),t.$emit("hide")}),t.transition)}),this.hideDelay))},isShown:function(){return function(t,e){if(!Au(t))return!1;for(var i=t.className.split(" "),n=0,r=i.length;n1&&void 0!==arguments[1]&&arguments[1],i=t.to,n=t.from;if(i&&(n||!1!==e)&&this.transports[i])if(e)this.transports[i]=[];else{var r=this.$_getTransportIndex(t);if(r>=0){var o=this.transports[i].slice(0);o.splice(r,1),this.transports[i]=o}}},registerTarget:function(t,e,i){zu&&(this.trackInstances&&!i&&this.targets[t]&&console.warn("[portal-vue]: Target ".concat(t," already exists")),this.$set(this.targets,t,Object.freeze([e])))},unregisterTarget:function(t){this.$delete(this.targets,t)},registerSource:function(t,e,i){zu&&(this.trackInstances&&!i&&this.sources[t]&&console.warn("[portal-vue]: source ".concat(t," already exists")),this.$set(this.sources,t,Object.freeze([e])))},unregisterSource:function(t){this.$delete(this.sources,t)},hasTarget:function(t){return!(!this.targets[t]||!this.targets[t][0])},hasSource:function(t){return!(!this.sources[t]||!this.sources[t][0])},hasContentFor:function(t){return!!this.transports[t]&&!!this.transports[t].length},$_getTransportIndex:function(t){var e=t.to,i=t.from;for(var n in this.transports[e])if(this.transports[e][n].from===i)return+n;return-1}}}))(Gu),Xu=1,Yu=ya.extend({name:"portal",props:{disabled:{type:Boolean},name:{type:String,default:function(){return String(Xu++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}}},created:function(){var t=this;this.$nextTick((function(){Ku.registerSource(t.name,t)}))},mounted:function(){this.disabled||this.sendUpdate()},updated:function(){this.disabled?this.clear():this.sendUpdate()},beforeDestroy:function(){Ku.unregisterSource(this.name),this.clear()},watch:{to:function(t,e){e&&e!==t&&this.clear(e),this.sendUpdate()}},methods:{clear:function(t){var e={from:this.name,to:t||this.to};Ku.close(e)},normalizeSlots:function(){return this.$scopedSlots.default?[this.$scopedSlots.default]:this.$slots.default},normalizeOwnChildren:function(t){return"function"==typeof t?t(this.slotProps):t},sendUpdate:function(){var t=this.normalizeSlots();if(t){var e={from:this.name,to:this.to,passengers:Uu(t),order:this.order};Ku.open(e)}else this.clear()}},render:function(t){var e=this.$slots.default||this.$scopedSlots.default||[],i=this.tag;return e&&this.disabled?e.length<=1&&this.slim?this.normalizeOwnChildren(e)[0]:t(i,[this.normalizeOwnChildren(e)]):this.slim?t():t(i,{class:{"v-portal":!0},style:{display:"none"},key:"v-portal-placeholder"})}}),Hu=ya.extend({name:"portalTarget",props:{multiple:{type:Boolean,default:!1},name:{type:String,required:!0},slim:{type:Boolean,default:!1},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},data:function(){return{transports:Ku.transports,firstRender:!0}},created:function(){var t=this;this.$nextTick((function(){Ku.registerTarget(t.name,t)}))},watch:{ownTransports:function(){this.$emit("change",this.children().length>0)},name:function(t,e){Ku.unregisterTarget(e),Ku.registerTarget(t,this)}},mounted:function(){var t=this;this.transition&&this.$nextTick((function(){t.firstRender=!1}))},beforeDestroy:function(){Ku.unregisterTarget(this.name)},computed:{ownTransports:function(){var t=this.transports[this.name]||[];return this.multiple?t:0===t.length?[]:[t[t.length-1]]},passengers:function(){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.reduce((function(t,i){var n=i.passengers[0],r="function"==typeof n?n(e):i.passengers;return t.concat(r)}),[])}(this.ownTransports,this.slotProps)}},methods:{children:function(){return 0!==this.passengers.length?this.passengers:this.$scopedSlots.default?this.$scopedSlots.default(this.slotProps):this.$slots.default||[]},noWrapper:function(){var t=this.slim&&!this.transition;return t&&this.children().length>1&&console.warn("[portal-vue]: PortalTarget with `slim` option received more than one child element."),t}},render:function(t){var e=this.noWrapper(),i=this.children(),n=this.transition||this.tag;return e?i[0]:this.slim&&!n?t():t(n,{props:{tag:this.transition&&this.tag?this.tag:void 0},class:{"vue-portal-target":!0}},i)}}),Zu=0,Ju=["disabled","name","order","slim","slotProps","tag","to"],Qu=["multiple","transition"];ya.extend({name:"MountingPortal",inheritAttrs:!1,props:{append:{type:[Boolean,String]},bail:{type:Boolean},mountTo:{type:String,required:!0},disabled:{type:Boolean},name:{type:String,default:function(){return"mounted_"+String(Zu++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}},multiple:{type:Boolean,default:!1},targetSlim:{type:Boolean},targetSlotProps:{type:Object,default:function(){return{}}},targetTag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},created:function(){if("undefined"!=typeof document){var t=document.querySelector(this.mountTo);if(t){var e=this.$props;if(Ku.targets[e.name])e.bail?console.warn("[portal-vue]: Target ".concat(e.name," is already mounted.\n Aborting because 'bail: true' is set")):this.portalTarget=Ku.targets[e.name];else{var i=e.append;if(i){var n="string"==typeof i?i:"DIV",r=document.createElement(n);t.appendChild(r),t=r}var o=Vu(this.$props,Qu);o.slim=this.targetSlim,o.tag=this.targetTag,o.slotProps=this.targetSlotProps,o.name=this.to,this.portalTarget=new Hu({el:t,parent:this.$parent||this,propsData:o})}}else console.error("[portal-vue]: Mount Point '".concat(this.mountTo,"' not found in document"))}},beforeDestroy:function(){var t=this.portalTarget;if(this.append){var e=t.$el;e.parentNode.removeChild(e)}t.$destroy()},render:function(t){if(!this.portalTarget)return console.warn("[portal-vue] Target wasn't mounted"),t();if(!this.$scopedSlots.manual){var e=Vu(this.$props,Ju);return t(Yu,{props:e,attrs:this.$attrs,on:this.$listeners,scopedSlots:this.$scopedSlots},this.$slots.default)}var i=this.$scopedSlots.manual({to:this.to});return Array.isArray(i)&&(i=i[0]),i||t()}});var th="active",eh="in";function ih(t,e,i,n,r,o,s,a,l,u){"boolean"!=typeof s&&(l=a,a=s,s=!1);var h,c="function"==typeof i?i.options:i;if(t&&t.render&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),n&&(c._scopeId=n),o?(h=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=h):e&&(h=s?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),h)if(c.functional){var d=c.render;c.render=function(t,e){return h.call(e),d(t,e)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,h):[h]}return i}var nh={components:{Portal:Yu},props:{title:{type:String,default:"Tab Title"},disabled:{type:Boolean,default:!1},tabClasses:{type:Object,default:function(){return{}}},group:String,pullRight:{type:Boolean,default:!1},hidden:{type:Boolean,default:!1}},data:function(){return{active:!0,transition:150}},watch:{active:function(t){var e=this;t?setTimeout((function(){ju(e.$el,th),e.$el.offsetHeight,ju(e.$el,eh);try{e.$parent.$emit("changed",e.$parent.activeIndex)}catch(t){throw new Error(" parent must be .")}}),this.transition):(Nu(this.$el,eh),setTimeout((function(){Nu(e.$el,th)}),this.transition))}},created:function(){try{this.$parent.tabs.push(this)}catch(t){throw new Error(" parent must be .")}},beforeDestroy:function(){!function(t,e){if(Array.isArray(t)){var i=t.indexOf(e);i>=0&&t.splice(i,1)}}(this.$parent&&this.$parent.tabs,this)},methods:{show:function(){var t=this;this.$nextTick((function(){ju(t.$el,th),ju(t.$el,eh)}))}}},rh=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"tab-pane",class:{fade:t.transition>0},attrs:{role:"tabpanel"}},[t._t("default"),t._v(" "),i("portal",{attrs:{to:t._uid.toString()}},[t._t("title")],2)],2)};rh._withStripped=!0;const oh=ih({render:rh,staticRenderFns:[]},undefined,nh,undefined,false,undefined,!1,void 0,void 0,void 0);function sh(t,e){var i=arguments;if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1;r a:focus")},onKeyPress:function(t){if(this.show){var e=this.$refs.dropdown,i=t.keyCode;if(27===i)this.toggle(!1),this.triggerEl&&this.triggerEl.focus();else if(13===i){var n=this.getFocusItem();n&&n.click()}else if(38===i||40===i){t.preventDefault(),t.stopPropagation();var r=this.getFocusItem(),o=e.querySelectorAll("li:not(.disabled) > a");if(r){for(var s=0;s0?gh(o[s-1]):40===i&&s=0;s=o||a&&l}if(s){i=!0;break}}var u=this.$refs.dropdown.contains(e),h=this.$el.contains(e)&&!u,c=u&&"touchend"===t.type;h||i||c||this.toggle(!1)}},appendDropdownToBody:function(){try{var t=this.$refs.dropdown;t.style.display="block",document.body.appendChild(t),function(t,e,i){void 0===i&&(i={});var n=document.documentElement,r=(window.pageXOffset||n.scrollLeft)-(n.clientLeft||0),o=(window.pageYOffset||n.scrollTop)-(n.clientTop||0),s=e.getBoundingClientRect(),a=t.getBoundingClientRect();t.style.right="auto",t.style.bottom="auto",i.menuRight?t.style.left=r+s.left+s.width-a.width+"px":t.style.left=r+s.left+"px",i.dropup?t.style.top=o+s.top-a.height-4+"px":t.style.top=o+s.top+s.height+"px"}(t,this.positionElement||this.$el,this)}catch(t){}},removeDropdownFromBody:function(){try{var t=this.$refs.dropdown;t.removeAttribute("style"),this.$el.appendChild(t)}catch(t){}}}};function vh(t){return(vh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yh(t){return function(t){if(Array.isArray(t)){for(var e=0,i=new Array(t.length);e1&&void 0!==arguments[1]&&arguments[1],i=t.to,n=t.from;if(i&&(n||!1!==e)&&this.transports[i])if(e)this.transports[i]=[];else{var r=this.$_getTransportIndex(t);if(r>=0){var o=this.transports[i].slice(0);o.splice(r,1),this.transports[i]=o}}},registerTarget:function(t,e,i){_h&&(this.trackInstances&&!i&&this.targets[t]&&console.warn("[portal-vue]: Target ".concat(t," already exists")),this.$set(this.targets,t,Object.freeze([e])))},unregisterTarget:function(t){this.$delete(this.targets,t)},registerSource:function(t,e,i){_h&&(this.trackInstances&&!i&&this.sources[t]&&console.warn("[portal-vue]: source ".concat(t," already exists")),this.$set(this.sources,t,Object.freeze([e])))},unregisterSource:function(t){this.$delete(this.sources,t)},hasTarget:function(t){return!(!this.targets[t]||!this.targets[t][0])},hasSource:function(t){return!(!this.sources[t]||!this.sources[t][0])},hasContentFor:function(t){return!!this.transports[t]&&!!this.transports[t].length},$_getTransportIndex:function(t){var e=t.to,i=t.from;for(var n in this.transports[e])if(this.transports[e][n].from===i)return+n;return-1}}}))(wh),Th=1,Eh=ya.extend({name:"portal",props:{disabled:{type:Boolean},name:{type:String,default:function(){return String(Th++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}}},created:function(){var t=this;this.$nextTick((function(){Ch.registerSource(t.name,t)}))},mounted:function(){this.disabled||this.sendUpdate()},updated:function(){this.disabled?this.clear():this.sendUpdate()},beforeDestroy:function(){Ch.unregisterSource(this.name),this.clear()},watch:{to:function(t,e){e&&e!==t&&this.clear(e),this.sendUpdate()}},methods:{clear:function(t){var e={from:this.name,to:t||this.to};Ch.close(e)},normalizeSlots:function(){return this.$scopedSlots.default?[this.$scopedSlots.default]:this.$slots.default},normalizeOwnChildren:function(t){return"function"==typeof t?t(this.slotProps):t},sendUpdate:function(){var t=this.normalizeSlots();if(t){var e={from:this.name,to:this.to,passengers:yh(t),order:this.order};Ch.open(e)}else this.clear()}},render:function(t){var e=this.$slots.default||this.$scopedSlots.default||[],i=this.tag;return e&&this.disabled?e.length<=1&&this.slim?this.normalizeOwnChildren(e)[0]:t(i,[this.normalizeOwnChildren(e)]):this.slim?t():t(i,{class:{"v-portal":!0},style:{display:"none"},key:"v-portal-placeholder"})}}),Ih=ya.extend({name:"portalTarget",props:{multiple:{type:Boolean,default:!1},name:{type:String,required:!0},slim:{type:Boolean,default:!1},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},data:function(){return{transports:Ch.transports,firstRender:!0}},created:function(){var t=this;this.$nextTick((function(){Ch.registerTarget(t.name,t)}))},watch:{ownTransports:function(){this.$emit("change",this.children().length>0)},name:function(t,e){Ch.unregisterTarget(e),Ch.registerTarget(t,this)}},mounted:function(){var t=this;this.transition&&this.$nextTick((function(){t.firstRender=!1}))},beforeDestroy:function(){Ch.unregisterTarget(this.name)},computed:{ownTransports:function(){var t=this.transports[this.name]||[];return this.multiple?t:0===t.length?[]:[t[t.length-1]]},passengers:function(){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.reduce((function(t,i){var n=i.passengers[0],r="function"==typeof n?n(e):i.passengers;return t.concat(r)}),[])}(this.ownTransports,this.slotProps)}},methods:{children:function(){return 0!==this.passengers.length?this.passengers:this.$scopedSlots.default?this.$scopedSlots.default(this.slotProps):this.$slots.default||[]},noWrapper:function(){var t=this.slim&&!this.transition;return t&&this.children().length>1&&console.warn("[portal-vue]: PortalTarget with `slim` option received more than one child element."),t}},render:function(t){var e=this.noWrapper(),i=this.children(),n=this.transition||this.tag;return e?i[0]:this.slim&&!n?t():t(n,{props:{tag:this.transition&&this.tag?this.tag:void 0},class:{"vue-portal-target":!0}},i)}}),Ah=0,Ph=["disabled","name","order","slim","slotProps","tag","to"],kh=["multiple","transition"];ya.extend({name:"MountingPortal",inheritAttrs:!1,props:{append:{type:[Boolean,String]},bail:{type:Boolean},mountTo:{type:String,required:!0},disabled:{type:Boolean},name:{type:String,default:function(){return"mounted_"+String(Ah++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}},multiple:{type:Boolean,default:!1},targetSlim:{type:Boolean},targetSlotProps:{type:Object,default:function(){return{}}},targetTag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},created:function(){if("undefined"!=typeof document){var t=document.querySelector(this.mountTo);if(t){var e=this.$props;if(Ch.targets[e.name])e.bail?console.warn("[portal-vue]: Target ".concat(e.name," is already mounted.\n Aborting because 'bail: true' is set")):this.portalTarget=Ch.targets[e.name];else{var i=e.append;if(i){var n="string"==typeof i?i:"DIV",r=document.createElement(n);t.appendChild(r),t=r}var o=bh(this.$props,kh);o.slim=this.targetSlim,o.tag=this.targetTag,o.slotProps=this.targetSlotProps,o.name=this.to,this.portalTarget=new Ih({el:t,parent:this.$parent||this,propsData:o})}}else console.error("[portal-vue]: Mount Point '".concat(this.mountTo,"' not found in document"))}},beforeDestroy:function(){var t=this.portalTarget;if(this.append){var e=t.$el;e.parentNode.removeChild(e)}t.$destroy()},render:function(t){if(!this.portalTarget)return console.warn("[portal-vue] Target wasn't mounted"),t();if(!this.$scopedSlots.manual){var e=bh(this.$props,Ph);return t(Eh,{props:e,attrs:this.$attrs,on:this.$listeners,scopedSlots:this.$scopedSlots},this.$slots.default)}var i=this.$scopedSlots.manual({to:this.to});return Array.isArray(i)&&(i=i[0]),i||t()}});var Rh="before-change";function Lh(t,e,i,n,r,o,s,a,l,u){"boolean"!=typeof s&&(l=a,a=s,s=!1);var h,c="function"==typeof i?i.options:i;if(t&&t.render&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),n&&(c._scopeId=n),o?(h=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=h):e&&(h=s?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),h)if(c.functional){var d=c.render;c.render=function(t,e){return h.call(e),d(t,e)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,h):[h]}return i}var Fh={components:{Dropdown:mh,PortalTarget:Ih},props:{value:{type:Number,validator:function(t){return t>=0}},transition:{type:Number,default:150},justified:Boolean,pills:Boolean,stacked:Boolean,customNavClass:null,customContentClass:null},data:function(){return{tabs:[],activeIndex:0}},watch:{value:{immediate:!0,handler:function(t){lh(t)&&(this.activeIndex=t,this.selectCurrent())}},tabs:function(t){var e=this;t.forEach((function(t,i){t.transition=e.transition,i===e.activeIndex&&t.show()})),this.selectCurrent()}},computed:{navClasses:function(){var t,e={nav:!0,"nav-justified":this.justified,"nav-tabs":!this.pills,"nav-pills":this.pills,"nav-stacked":this.stacked&&this.pills},i=this.customNavClass;return ah(i)?uh(i)?sh({},e,((t={})[i]=!0,t)):sh({},e,i):e},contentClasses:function(){var t,e={"tab-content":!0},i=this.customContentClass;return ah(i)?uh(i)?sh({},e,((t={})[i]=!0,t)):sh({},e,i):e},groupedTabs:function(){var t=[],e={};return this.tabs.forEach((function(i){var n,r;i.group?(n=e,r=i.group,Object.prototype.hasOwnProperty.call(n,r)?t[e[i.group]].tabs.push(i):(t.push({tabs:[i],group:i.group}),e[i.group]=t.length-1),i.active&&(t[e[i.group]].active=!0),i.pullRight&&(t[e[i.group]].pullRight=!0)):t.push(i)})),t=t.map((function(t){return Array.isArray(t.tabs)&&(t.hidden=t.tabs.filter((function(t){return t.hidden})).length===t.tabs.length),t}))}},methods:{getTabClasses:function(t,e){return void 0===e&&(e=!1),sh({active:t.active,disabled:t.disabled,"pull-right":t.pullRight&&!e},t.tabClasses)},selectCurrent:function(){var t=this,e=!1;this.tabs.forEach((function(i,n){n===t.activeIndex?(e=!i.active,i.active=!0):i.active=!1})),e&&this.$emit("change",this.activeIndex)},selectValidate:function(t){var e=this;"function"==typeof this.$listeners["before-change"]?this.$emit(Rh,this.activeIndex,t,(function(i){ah(i)||e.$select(t)})):this.$select(t)},select:function(t){this.tabs[t].disabled||t===this.activeIndex||this.selectValidate(t)},$select:function(t){lh(this.value)?this.$emit("input",t):(this.activeIndex=t,this.selectCurrent())}}},Mh=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("section",[i("ul",{class:t.navClasses,attrs:{role:"tablist"}},[t._l(t.groupedTabs,(function(e,n){return[e.tabs?i("dropdown",{directives:[{name:"show",rawName:"v-show",value:!e.hidden,expression:"!tab.hidden"}],class:t.getTabClasses(e),attrs:{role:"presentation",tag:"li"}},[i("a",{staticClass:"dropdown-toggle",attrs:{role:"tab",href:"#"},on:{click:function(t){t.preventDefault()}}},[t._v(t._s(e.group)+" "),i("span",{staticClass:"caret"})]),t._v(" "),i("template",{slot:"dropdown"},t._l(e.tabs,(function(e){return i("li",{directives:[{name:"show",rawName:"v-show",value:!e.hidden,expression:"!subTab.hidden"}],class:t.getTabClasses(e,!0)},[i("a",{attrs:{href:"#"},on:{click:function(i){i.preventDefault(),t.select(t.tabs.indexOf(e))}}},[t._v(t._s(e.title))])])})),0)],2):i("li",{directives:[{name:"show",rawName:"v-show",value:!e.hidden,expression:"!tab.hidden"}],class:t.getTabClasses(e),attrs:{role:"presentation"}},[e.$slots.title?i("portal-target",{attrs:{name:e._uid.toString(),tag:"a",role:"tab",href:"#"},nativeOn:{click:function(i){i.preventDefault(),t.select(t.tabs.indexOf(e))}}}):i("a",{attrs:{role:"tab",href:"#"},domProps:{textContent:t._s(e.title)},on:{click:function(i){i.preventDefault(),t.select(t.tabs.indexOf(e))}}})],1)]})),t._v(" "),!t.justified&&t.$slots["nav-right"]?i("li",{staticClass:"pull-right"},[t._t("nav-right")],2):t._e()],2),t._v(" "),i("div",{class:t.contentClasses},[t._t("default")],2)])};Mh._withStripped=!0;const Oh=Lh({render:Mh,staticRenderFns:[]},undefined,Fh,undefined,false,undefined,!1,void 0,void 0,void 0);window.biigle={},window.biigle.$mount=cl,window.biigle.$declare=function(t,e){var i=(t=t.split(".")).pop();return dl(t)[i]=e,e},window.biigle.$require=dl,biigle.$declare("api.annotations",fl),biigle.$declare("api.images",pl),biigle.$declare("api.labels",gl),biigle.$declare("api.labelSource",ml),biigle.$declare("api.labelTree",vl),biigle.$declare("api.labelTreeVersion",yl),biigle.$declare("api.notifications",_l),biigle.$declare("api.projects",bl),biigle.$declare("api.users",wl),biigle.$declare("api.volumes",xl),biigle.$declare("core.components.loader",Cl),biigle.$declare("core.components.loaderBlock",Tl),biigle.$declare("core.components.powerToggle",El),biigle.$declare("core.components.sidebar",kl),biigle.$declare("core.components.sidebarTab",Rl),biigle.$declare("core.components.typeahead",Hl),biigle.$declare("messages",su),biigle.$declare("messages.store",su),window.$biiglePostMessage=su.post,biigle.$declare("core.mixins.editor",au),biigle.$declare("core.mixins.loader",lu),biigle.$declare("core.models.Settings",uu),biigle.$declare("utils.debounce",Jl),biigle.$declare("utils.urlParams",Ql),biigle.$declare("urlParams",Ql),biigle.$declare("utils.throttle",iu),biigle.$declare("events",Al),biigle.$declare("keyboard",Pl),biigle.$declare("core.keyboard",Pl),biigle.$declare("uiv.popover",$u),biigle.$declare("uiv.tab",oh),biigle.$declare("uiv.tabs",Oh);const $h=Sl({components:{message:{props:{id:{type:Number,required:!0},text:{type:String,required:!0},type:{type:String,default:"info"}},computed:{typeClass:function(){return"alert-".concat(this.type)}},methods:{close:function(){su.close(this.id)},cancelTimeout:function(){this.closeTimeoutId&&(window.clearTimeout(this.closeTimeoutId),this.closeTimeoutId=null)}},mounted:function(){"danger"!==this.type&&(this.closeTimeoutId=window.setTimeout(this.close,15e3))}}},data:function(){return{messages:su.all}},mounted:function(){var t=biigle.$require("staticMessage");t.text&&t.type&&this.$nextTick((function(){su.post(t.type,t.text)}))}},undefined,undefined,!1,null,null,null).exports;const Dh=Sl(new Vue({data:{all:[],initialized:!1},computed:{unread:function(){return this.all.filter((function(t){return null===t.read_at}))},count:function(){return this.all.length},countUnread:function(){return this.unread.length}},methods:{remove:function(t){for(var e=this.all.length-1;e>=0;e--)this.all[e].id===t&&this.all.splice(e,1)},initialize:function(){if(!this.initialized){var t=biigle.$require("initialNotifications");this.all=t||[],this.initialized=!0}}}}),undefined,undefined,!1,null,null,null).exports;const jh=Sl({components:{notification:{props:["item","removeItem"],data:function(){return{isLoading:!1}},computed:{classObject:function(){return this.item.data.type?"panel-".concat(this.item.data.type):"panel-default"},isUnread:function(){return null===this.item.read_at}},methods:{markRead:function(){var t=this;return this.isLoading=!0,_l.markRead({id:this.item.id},{}).then((function(){t.item.read_at=new Date,t.removeItem&&Dh.remove(t.item.id)})).catch(su.handleErrorResponse).finally((function(){t.isLoading=!1}))},markReadAndOpenLink:function(){var t=this.item.data.actionLink;this.item.read_at?window.location=t:this.markRead().finally((function(){window.location=t}))}}}},data:function(){return{notifications:[]}},computed:{hasNotifications:function(){return Dh.count>0},hasUnreadNotifications:function(){return Dh.countUnread>0}},created:function(){Dh.initialize(),this.notifications=Dh.all}},undefined,undefined,!1,null,null,null).exports;const Nh=Sl({computed:{unread:function(){return Dh.initialized?Dh.countUnread:parseInt(this.$el.attributes.unread.value)},hasUnread:function(){return this.unread>0},unreadText:function(){return this.hasUnread?this.unread:"no"},title:function(){return"You have ".concat(this.unreadText," unread notification(s)")}}},undefined,undefined,!1,null,null,null).exports;const Bh=Sl({computed:{count:function(){return Dh.countUnread}}},undefined,undefined,!1,null,null,null).exports;const Uh=Sl({data:function(){return{body:""}},beforeMount:function(){var t=document.getElementById("system-messages-edit-form").querySelector('textarea[name="body"]');t&&(this.body=t.value)}},undefined,undefined,!1,null,null,null).exports;var zh="click",Vh="keydown",Gh="touchend";function qh(t,e,i){t.addEventListener(e,i)}function Wh(t,e,i){t.removeEventListener(e,i)}function Kh(t){(function(t){return t&&t.nodeType===Node.ELEMENT_NODE})(t)&&(!t.getAttribute("tabindex")&&t.setAttribute("tabindex","-1"),t.focus())}const Xh={render:function(t){return t(this.tag,{class:{"btn-group":"div"===this.tag,dropdown:!this.dropup,dropup:this.dropup,open:this.show}},[this.$slots.default,t("ul",{class:{"dropdown-menu":!0,"dropdown-menu-right":this.menuRight},ref:"dropdown"},[this.$slots.dropdown])])},props:{tag:{type:String,default:"div"},appendToBody:{type:Boolean,default:!1},value:Boolean,dropup:{type:Boolean,default:!1},menuRight:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},notCloseElements:Array,positionElement:null},data:function(){return{show:!1,triggerEl:void 0}},watch:{value:function(t){this.toggle(t)}},mounted:function(){this.initTrigger(),this.triggerEl&&(qh(this.triggerEl,zh,this.toggle),qh(this.triggerEl,Vh,this.onKeyPress)),qh(this.$refs.dropdown,Vh,this.onKeyPress),qh(window,zh,this.windowClicked),qh(window,Gh,this.windowClicked),this.value&&this.toggle(!0)},beforeDestroy:function(){this.removeDropdownFromBody(),this.triggerEl&&(Wh(this.triggerEl,zh,this.toggle),Wh(this.triggerEl,Vh,this.onKeyPress)),Wh(this.$refs.dropdown,Vh,this.onKeyPress),Wh(window,zh,this.windowClicked),Wh(window,Gh,this.windowClicked)},methods:{getFocusItem:function(){return this.$refs.dropdown.querySelector("li > a:focus")},onKeyPress:function(t){if(this.show){var e=this.$refs.dropdown,i=t.keyCode;if(27===i)this.toggle(!1),this.triggerEl&&this.triggerEl.focus();else if(13===i){var n=this.getFocusItem();n&&n.click()}else if(38===i||40===i){t.preventDefault(),t.stopPropagation();var r=this.getFocusItem(),o=e.querySelectorAll("li:not(.disabled) > a");if(r){for(var s=0;s0?Kh(o[s-1]):40===i&&s=0;s=o||a&&l}if(s){i=!0;break}}var u=this.$refs.dropdown.contains(e),h=this.$el.contains(e)&&!u,c=u&&"touchend"===t.type;h||i||c||this.toggle(!1)}},appendDropdownToBody:function(){try{var t=this.$refs.dropdown;t.style.display="block",document.body.appendChild(t),function(t,e,i){void 0===i&&(i={});var n=document.documentElement,r=(window.pageXOffset||n.scrollLeft)-(n.clientLeft||0),o=(window.pageYOffset||n.scrollTop)-(n.clientTop||0),s=e.getBoundingClientRect(),a=t.getBoundingClientRect();t.style.right="auto",t.style.bottom="auto",i.menuRight?t.style.left=r+s.left+s.width-a.width+"px":t.style.left=r+s.left+"px",i.dropup?t.style.top=o+s.top-a.height-4+"px":t.style.top=o+s.top+s.height+"px"}(t,this.positionElement||this.$el,this)}catch(t){}},removeDropdownFromBody:function(){try{var t=this.$refs.dropdown;t.removeAttribute("style"),this.$el.appendChild(t)}catch(t){}}}};cl("top-menu",Sl(new Vue({components:{dropdown:Xh}}),undefined,undefined,!1,null,null,null).exports),cl("messages-display",$h),cl("notifications-list",jh),cl("notifications-navbar-indicator",Nh),cl("notifications-unread-count",Bh),cl("system-messages-edit-form",Uh);i(755);var Yh=Sl({name:"label-tree-label",data:function(){return{hover:!1,editing:!1,oldName:"",oldColor:"",newName:"",newColor:"",internalLabel:null}},props:{label:{type:Object,required:!0},showFavourites:{type:Boolean,required:!1},editable:{type:Boolean,default:!1},flat:{type:Boolean,default:!1}},computed:{showColor:function(){return!this.expandable||!this.hover},showChevronUp:function(){return!this.showColor&&this.label.open},showChevronDown:function(){return!this.showColor&&!this.label.open},classObject:function(){return{"label-tree-label--selected":this.label.selected,"label-tree-label--expandable":this.expandable,"label-tree-label--editing":this.editing}},colorStyle:function(){return{"background-color":"#"+this.label.color}},chevronStyle:function(){return{color:"#"+this.label.color}},favouriteClass:function(){return{selected:this.label.favourite}},favouriteTitle:function(){return(this.label.favourite?"Remove":"Add")+" as favourite"},editTitle:function(){return"Edit label "+this.label.name},deleteTitle:function(){return"Remove label "+this.label.name},expandable:function(){return!this.flat&&!!this.label.children},showEditButton:function(){return this.editable&&this.hover&&!this.editing}},methods:{toggleSelect:function(t){this.editing||(t.preventDefault(),this.label.selected?this.$emit("deselect",this.label,t):this.$emit("select",this.label,t))},editThis:function(){this.editing=!0,this.oldName=this.label.name,this.oldColor=this.label.color,this.newName=this.label.name,this.newColor="#"+this.label.color},saveThis:function(){var t=this;this.internalLabel.name=this.newName,this.internalLabel.color=this.newColor.substr(1),this.editing=!1,this.oldName===this.label.name&&this.oldColor===this.label.color||this.emitSave(this.label,(function(){return t.editing=!0}))},revertThis:function(){this.editing=!1,this.internalLabel.name=this.oldName,this.internalLabel.color=this.oldColor},deleteThis:function(){this.emitDelete(this.label)},toggleOpen:function(t){this.editing||(this.expandable?this.internalLabel.open=!this.label.open:this.toggleSelect(t))},toggleFavourite:function(){this.label.favourite?this.emitRemoveFavourite(this.label):this.emitAddFavourite(this.label)},emitSelect:function(t,e){this.$emit("select",t,e)},emitDeselect:function(t,e){this.$emit("deselect",t,e)},emitDelete:function(t){this.$emit("delete",t)},emitSave:function(t,e){this.$emit("save",t,e)},emitAddFavourite:function(t){this.$emit("add-favourite",t)},emitRemoveFavourite:function(t){this.$emit("remove-favourite",t)},doHover:function(){this.hover=!0},dontHover:function(){this.hover=!1}},created:function(){this.internalLabel=this.label}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("li",{staticClass:"label-tree-label",class:t.classObject},[i("div",{staticClass:"label-tree-label__name",on:{click:t.toggleOpen,mouseover:t.doHover,mouseleave:t.dontHover}},[t.editing?i("span",[i("input",{directives:[{name:"model",rawName:"v-model",value:t.newColor,expression:"newColor"}],staticClass:"form-control input-sm label-tree-color-input",attrs:{type:"color"},domProps:{value:t.newColor},on:{input:function(e){e.target.composing||(t.newColor=e.target.value)}}}),t._v(" "),i("input",{directives:[{name:"model",rawName:"v-model",value:t.newName,expression:"newName"}],staticClass:"form-control input-sm label-tree-label__name-input",attrs:{type:"text"},domProps:{value:t.newName},on:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.saveThis(e)},input:function(e){e.target.composing||(t.newName=e.target.value)}}})]):i("span",[i("span",{directives:[{name:"show",rawName:"v-show",value:t.showColor,expression:"showColor"}],staticClass:"label-tree-label__color",style:t.colorStyle}),t._v(" "),i("span",{directives:[{name:"show",rawName:"v-show",value:t.showChevronDown,expression:"showChevronDown"}],staticClass:"label-tree-label__chevron label-tree-label__chevron--down",style:t.chevronStyle}),t._v(" "),i("span",{directives:[{name:"show",rawName:"v-show",value:t.showChevronUp,expression:"showChevronUp"}],staticClass:"label-tree-label__chevron label-tree-label__chevron--up",style:t.chevronStyle}),t._v(" "),i("span",{domProps:{textContent:t._s(t.label.name)},on:{click:function(e){return e.stopPropagation(),t.toggleSelect(e)},mouseenter:t.dontHover}})]),t._v(" "),i("span",{staticClass:"label-tree-label__buttons"},[t.showFavourites?i("button",{staticClass:"label-tree-label__favourite",class:t.favouriteClass,attrs:{type:"button",title:t.favouriteTitle},on:{click:function(e){return e.stopPropagation(),t.toggleFavourite(e)}}},[i("span",{staticClass:"fa fa-star",attrs:{"aria-hidden":"true",title:""}})]):t._e(),t._v(" "),i("span",{attrs:{if:"editable"}},[i("button",{directives:[{name:"show",rawName:"v-show",value:t.showEditButton,expression:"showEditButton"}],staticClass:"btn btn-default btn-xs",attrs:{title:t.editTitle},on:{click:function(e){return e.stopPropagation(),t.editThis(e)}}},[i("span",{staticClass:"fa fa-pencil-alt",attrs:{"aria-hidden":"true"}})]),t._v(" "),i("button",{directives:[{name:"show",rawName:"v-show",value:t.editing,expression:"editing"}],staticClass:"btn btn-danger btn-sm",attrs:{title:t.deleteTitle},on:{click:function(e){return e.stopPropagation(),t.deleteThis(e)}}},[i("span",{staticClass:"fa fa-trash",attrs:{"aria-hidden":"true"}})]),t._v(" "),i("button",{directives:[{name:"show",rawName:"v-show",value:t.editing,expression:"editing"}],staticClass:"btn btn-success btn-sm",attrs:{title:"Save changes"},on:{click:function(e){return e.stopPropagation(),t.saveThis(e)}}},[i("span",{staticClass:"fa fa-check",attrs:{"aria-hidden":"true"}})]),t._v(" "),i("button",{directives:[{name:"show",rawName:"v-show",value:t.editing,expression:"editing"}],staticClass:"btn btn-default btn-sm",attrs:{title:"Revert changes"},on:{click:function(e){return e.stopPropagation(),t.revertThis(e)}}},[i("span",{staticClass:"fa fa-times",attrs:{"aria-hidden":"true"}})])])])]),t._v(" "),t.expandable&&t.label.open?i("ul",{staticClass:"label-tree__list"},t._l(t.label.children,(function(e){return i("label-tree-label",{key:e.id,attrs:{label:e,editable:t.editable,"show-favourites":t.showFavourites},on:{select:t.emitSelect,deselect:t.emitDeselect,save:t.emitSave,delete:t.emitDelete,"add-favourite":t.emitAddFavourite,"remove-favourite":t.emitRemoveFavourite}})})),1):t._e()])}),[],!1,null,null,null);const Hh=Sl({data:function(){return{collapsed:!1}},components:{labelTreeLabel:Yh.exports},props:{name:{type:String,required:!0},labels:{type:Array,required:!0},showTitle:{type:Boolean,default:!0},standalone:{type:Boolean,default:!1},collapsible:{type:Boolean,default:!0},multiselect:{type:Boolean,default:!1},allowSelectSiblings:{type:Boolean,default:!1},allowSelectChildren:{type:Boolean,default:!1},editable:{type:Boolean,default:!1},showFavourites:{type:Boolean,default:!1},flat:{type:Boolean,default:!1}},computed:{labelMap:function(){for(var t={},e=this.labels.length-1;e>=0;e--)t[this.labels[e].id]=this.labels[e];return t},compiledLabels:function(){var t={null:[]};return this.flat?this.labels.forEach((function(e){t.null.push(e)})):(this.labels.forEach((function(e){t.hasOwnProperty(e.parent_id)?t[e.parent_id].push(e):t[e.parent_id]=[e]})),this.labels.forEach((function(e){t.hasOwnProperty(e.id)?Vue.set(e,"children",t[e.id]):(Vue.set(e,"children",void 0),e.open=!1)}))),t},rootLabels:function(){return this.compiledLabels.null},collapseTitle:function(){return this.collapsed?"Expand":"Collapse"},hasNoLabels:function(){return 0===this.rootLabels.length}},methods:{hasLabel:function(t){return this.labelMap.hasOwnProperty(t)},getLabel:function(t){return this.labelMap[t]},getParents:function(t){for(var e=[];null!==t.parent_id;)t=this.getLabel(t.parent_id),e.unshift(t.id);return e},getSiblings:function(t){return null===t.parent_id?this.rootLabels:this.getLabel(t.parent_id).children},selectSiblings:function(t){this.getSiblings(t).forEach((function(t){t.selected=!0}))},deselectSiblings:function(t){this.getSiblings(t).forEach((function(t){t.selected=!1}))},selectChildren:function(t){var e=this;t.children&&t.children.forEach((function(t){t.selected=!0,e.selectChildren(t)}))},deselectChildren:function(t){var e=this;t.children&&t.children.forEach((function(t){t.selected=!1,e.deselectChildren(t)}))},emitSelect:function(t,e){this.$emit("select",t,e)},emitDeselect:function(t,e){this.$emit("deselect",t,e)},emitSave:function(t,e){this.$emit("save",t,e)},emitDelete:function(t){this.$emit("delete",t)},conditionSelectSiblings:function(t){return this.allowSelectSiblings&&t.altKey},conditionSelectChildren:function(t){return this.allowSelectChildren&&t.ctrlKey},selectLabel:function(t,e){var i=this;this.multiselect||this.clearSelectedLabels(),t&&this.hasLabel(t.id)&&(t.selected=!0,this.collapsed=!1,this.flat||(this.getParents(t).forEach((function(t){i.getLabel(t).open=!0})),this.multiselect&&(this.conditionSelectSiblings(e)&&this.selectSiblings(t),this.conditionSelectChildren(e)&&(this.selectChildren(t),this.conditionSelectSiblings(e)&&this.getSiblings(t).forEach(this.selectChildren)))))},deselectLabel:function(t,e){this.hasLabel(t.id)&&(t.selected=!1,this.conditionSelectSiblings(e)&&this.deselectSiblings(t),this.conditionSelectChildren(e)&&(this.deselectChildren(t),this.conditionSelectSiblings(e)&&this.getSiblings(t).forEach(this.deselectChildren)))},clearSelectedLabels:function(){this.labels.forEach((function(t){t.selected=!1}))},collapse:function(){if(this.collapsed)this.collapsed=!1;else{var t=!1;this.labels.forEach((function(e){t|=e.open,e.open=!1})),this.collapsed=!t}},emitAddFavourite:function(t){this.$emit("add-favourite",t)},emitRemoveFavourite:function(t){this.$emit("remove-favourite",t)},addFavouriteLabel:function(t){this.hasLabel(t.id)&&(t.favourite=!0)},removeFavouriteLabel:function(t){this.hasLabel(t.id)&&(t.favourite=!1)}},created:function(){this.labels.forEach((function(t){t.hasOwnProperty("open")||Vue.set(t,"open",!1),t.hasOwnProperty("selected")||Vue.set(t,"selected",!1),t.hasOwnProperty("favourite")||Vue.set(t,"favourite",!1)})),this.standalone?(this.$on("select",this.selectLabel),this.$on("deselect",this.deselectLabel)):(this.$parent.$on("select",this.selectLabel),this.$parent.$on("deselect",this.deselectLabel),this.$parent.$on("clear",this.clearSelectedLabels),this.$parent.$on("add-favourite",this.addFavouriteLabel),this.$parent.$on("remove-favourite",this.removeFavouriteLabel))}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"label-tree"},[t.showTitle?i("h4",{staticClass:"label-tree__title"},[t.collapsible?i("button",{staticClass:"btn btn-default btn-xs pull-right",attrs:{title:t.collapseTitle,type:"button"},on:{click:function(e){return e.stopPropagation(),t.collapse(e)}}},[t.collapsed?i("span",{staticClass:"fa fa-chevron-down",attrs:{"aria-hidden":"true"}}):i("span",{staticClass:"fa fa-chevron-up",attrs:{"aria-hidden":"true"}})]):t._e(),t._v("\n "+t._s(t.name)+"\n ")]):t._e(),t._v(" "),t.collapsed?t._e():i("ul",{staticClass:"label-tree__list"},[t._l(t.rootLabels,(function(e){return i("label-tree-label",{key:e.id,attrs:{label:e,editable:t.editable,"show-favourites":t.showFavourites,flat:t.flat},on:{select:t.emitSelect,deselect:t.emitDeselect,save:t.emitSave,delete:t.emitDelete,"add-favourite":t.emitAddFavourite,"remove-favourite":t.emitRemoveFavourite}})})),t._v(" "),t.hasNoLabels?i("li",{staticClass:"text-muted"},[t._v("No labels")]):t._e()],2)])}),[],!1,null,null,null).exports;const Zh=Sl({mixins:[Hl],props:{template:{default:''}}},undefined,undefined,!1,null,null,null).exports;const Jh=Sl({components:{typeahead:Zh,labelTree:Hh},data:function(){return{favourites:[]}},props:{trees:{type:Array,required:!0},id:{type:String},typeahead:{type:Boolean,default:!0},clearable:{type:Boolean,default:!0},multiselect:{type:Boolean,default:!1},allowSelectSiblings:{type:Boolean,default:!1},allowSelectChildren:{type:Boolean,default:!1},showFavourites:{type:Boolean,default:!1},collapsible:{type:Boolean,default:!0},listenerSet:{type:String,default:"default"}},computed:{localeCompareSupportsLocales:function(){try{"foo".localeCompare("bar","i")}catch(t){return"RangeError"===t.name}return!1},labels:function(){var t=[];if(this.trees.forEach((function(e){Array.prototype.push.apply(t,e.labels)})),this.localeCompareSupportsLocales){var e=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});t.sort((function(t,i){return e.compare(t.name,i.name)}))}else t.sort((function(t,e){return t.name0},ownId:function(){if(this.id)return this.id;var t=[];for(var e in this.trees)this.trees.hasOwnProperty(e)&&t.push(this.trees[e].id);return t.join("-")},favouriteStorageKey:function(){return"biigle.label-trees.".concat(this.ownId,".favourites")}},methods:{handleSelect:function(t,e){t&&this.$emit("select",t,e)},handleDeselect:function(t,e){this.$emit("deselect",t,e)},clear:function(){this.$emit("clear")},handleAddFavourite:function(t){this.canHaveMoreFavourites&&(this.$emit("add-favourite",t),this.favourites.push(t),this.updateFavouriteStorage())},handleRemoveFavourite:function(t){this.$emit("remove-favourite",t);var e=this.favourites.indexOf(t);-1!==e&&this.favourites.splice(e,1),this.updateFavouriteStorage()},updateFavouriteStorage:function(){this.hasFavourites?localStorage.setItem(this.favouriteStorageKey,JSON.stringify(this.favouriteIds)):localStorage.removeItem(this.favouriteStorageKey)},selectFavourite:function(t){this.favourites[t]&&this.handleSelect(this.favourites[t])}},watch:{trees:{immediate:!0,handler:function(t){t.forEach((function(t){t.version?t.versionedName=t.name+" @ "+t.version.name:t.versionedName=t.name,t.labels.forEach((function(e){e.tree=t}))}))}}},mounted:function(){var t=this;if(this.showFavourites){var e=JSON.parse(localStorage.getItem(this.favouriteStorageKey));if(e){var i=[];this.labels.forEach((function(t){var n=e.indexOf(t.id);-1!==n&&(i[n]=t)})),i.filter(Boolean).forEach((function(e){t.handleAddFavourite(e)}))}for(var n=function(e,i){Pl.on(e,(function(){t.selectFavourite(i)}),0,t.listenerSet)},r=1;r<=9;r++)n(r.toString(),r-1);n("0",9)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"label-trees"},[t.typeahead||t.clearable?i("div",{staticClass:"label-trees__head"},[t.clearable?i("button",{staticClass:"btn btn-default",attrs:{title:"Clear selected labels",type:"button"},on:{click:t.clear}},[i("span",{staticClass:"fa fa-times fa-fw",attrs:{"aria-hidden":"true"}})]):t._e(),t._v(" "),t.typeahead?i("typeahead",{attrs:{items:t.labels,"more-info":"tree.versionedName",placeholder:"Find label"},on:{select:t.handleSelect}}):t._e()],1):t._e(),t._v(" "),i("div",{staticClass:"label-trees__body"},[t.hasFavourites?i("label-tree",{attrs:{name:"Favourites",labels:t.favourites,"show-favourites":t.showFavourites,flat:!0,collapsible:t.collapsible},on:{select:t.handleSelect,deselect:t.handleDeselect,"remove-favourite":t.handleRemoveFavourite}}):t._e(),t._v(" "),t._l(t.trees,(function(e){return i("label-tree",{key:e.id,attrs:{name:e.versionedName,labels:e.labels,multiselect:t.multiselect,"allow-select-siblings":t.allowSelectSiblings,"allow-select-children":t.allowSelectChildren,"show-favourites":t.showFavourites,collapsible:t.collapsible},on:{select:t.handleSelect,deselect:t.handleDeselect,"add-favourite":t.handleAddFavourite,"remove-favourite":t.handleRemoveFavourite}})}))],2)])}),[],!1,null,null,null).exports;biigle.$declare("labelTrees.components.labelTrees",Jh),biigle.$declare("labelTrees.components.labelTypeahead",Zh);const Qh=Sl({mixins:[lu],data:function(){return{labelTree:null,ownProjects:[],authorizedProjects:[],authorizedOwnProjects:[],privateId:null}},components:{typeahead:Hl},computed:{isPrivate:function(){return this.labelTree.visibility_id===this.privateId},authorizableProjects:function(){var t=this;return this.ownProjects.filter((function(e){for(var i=t.authorizedProjects.length-1;i>=0;i--)if(t.authorizedProjects[i].id===e.id)return!1;return!0}))},hasAuthorizedProjects:function(){return this.authorizedProjects.length>0}},methods:{fetchOwnProjects:function(){var t=this;bl.query().then((function(e){Vue.set(t,"ownProjects",e.body)}),ou)},addAuthorizedProject:function(t){var e=this;t&&!this.loading&&(this.startLoading(),vl.addAuthorizedProject({id:this.labelTree.id},{id:t.id}).then((function(){return e.authorizedProjectAdded(t)}),ou).finally(this.finishLoading))},authorizedProjectAdded:function(t){this.authorizedProjects.push(t),this.authorizedOwnProjects.push(t.id)},removeAuthorizedProject:function(t){var e=this;this.startLoading(),vl.removeAuthorizedProject({id:this.labelTree.id,project_id:t.id}).then((function(){return e.authorizedProjectRemoved(t)}),ou).finally(this.finishLoading)},authorizedProjectRemoved:function(t){var e;for(e=this.authorizedProjects.length-1;e>=0;e--)this.authorizedProjects[e].id===t.id&&this.authorizedProjects.splice(e,1);-1!==(e=this.authorizedOwnProjects.indexOf(t.id))&&this.authorizedOwnProjects.splice(e,1)},isOwnProject:function(t){return-1!==this.authorizedOwnProjects.indexOf(t.id)}},created:function(){this.privateId=biigle.$require("labelTrees.privateVisibilityId"),this.labelTree=biigle.$require("labelTrees.labelTree"),this.authorizedProjects=biigle.$require("labelTrees.authorizedProjects"),this.authorizedOwnProjects=biigle.$require("labelTrees.authorizedOwnProjects"),this.fetchOwnProjects()}},undefined,undefined,!1,null,null,null).exports;var tc=[0,.5,.9],ec=[360,1,1],ic=[0,2,2],nc=function(){for(var t,e,i=[0,0,0],n=i.length-1;n>=0;n--)t=10*ic[n],i[n]=(ec[n]-tc[n])*Math.random()+tc[n],i[n]=0!==t?Math.round(i[n]*t)/t:Math.round(i[n]);return"#"+(e=function(t){var e,i=t[0]/60,n=Math.floor(i),r=i-n,o=[t[2]*(1-t[1]),t[2]*(1-t[1]*r),t[2]*(1-t[1]*(1-r))];switch(n){case 1:e=[o[1],t[2],o[0]];break;case 2:e=[o[0],t[2],o[2]];break;case 3:e=[o[0],o[1],t[2]];break;case 4:e=[o[2],o[0],t[2]];break;case 5:e=[t[2],o[0],o[1]];break;default:e=[t[2],o[2],o[0]]}return e.map((function(t){return Math.round(255*t)}))}(i),e.map((function(t){return 1===(t=t.toString(16)).length?"0"+t:t}))).join("")};const rc=Sl({props:{labels:{type:Array,required:!0},color:{type:String,default:""},parent:{type:Object,default:null},name:{type:String,default:""}},components:{typeahead:Zh},computed:{selectedColor:{get:function(){return this.color},set:function(t){this.$emit("color",t)}},selectedName:{get:function(){return this.name},set:function(t){this.$emit("name",t)}},selectedParent:function(){return this.parent?this.parent.name:""},hasNoLabels:function(){return 0===this.labels.length},hasNoParent:function(){return!this.parent},hasNoName:function(){return!this.name}},methods:{refreshColor:function(){this.selectedColor=nc()},resetParent:function(){this.$emit("parent",null)},selectLabel:function(t){this.$emit("parent",t)}}},undefined,undefined,!1,null,null,null).exports;const oc=Sl({mixins:[rc],methods:{submit:function(){var t={name:this.selectedName,color:this.selectedColor};this.parent&&(t.parent_id=this.parent.id),this.$emit("submit",t)}}},undefined,undefined,!1,null,null,null).exports;var sc=Sl({props:{item:{type:Object,required:!0},recursive:{type:Boolean,required:!0},labels:{type:Array,required:!0},parent:{type:Object,default:null}},computed:{classification:function(){return this.item.parents.join(" > ")},buttonTitle:function(){return this.recursive?"Add ".concat(this.item.name," and all WoRMS parents as new labels"):this.parent?"Add ".concat(this.item.name," as a child of ").concat(this.parent.name):"Add ".concat(this.item.name," as a root label")},classObject:function(){return{"list-group-item-success":this.selected}},selected:function(){var t=this;return this.labels.some((function(e){return e.source_id==t.item.aphia_id}))}},methods:{select:function(){this.selected||this.$emit("select",this.item)}}},undefined,undefined,!1,null,null,null);var ac=Sl({mixins:[rc],components:{wormsResultItem:sc.exports},data:function(){return{results:[],recursive:!1,hasSearched:!1,unaccepted:!1,worms:null}},computed:{hasResults:function(){return this.results.length>0},recursiveButtonClass:function(){return{active:this.recursive,"btn-info":this.recursive}},unacceptedButtonClass:function(){return{active:this.unaccepted,"btn-info":this.unaccepted}}},methods:{findName:function(){var t=this;this.$emit("load-start");var e={id:this.worms.id,query:this.selectedName};this.unaccepted&&(e.unaccepted="true"),ml.query(e).then(this.updateResults,ou).finally((function(){t.hasSearched=!0,t.$emit("load-finish")}))},updateResults:function(t){this.results=t.data},importItem:function(t){var e={name:t.name,color:this.selectedColor,source_id:t.aphia_id,label_source_id:this.worms.id};this.recursive?e.recursive="true":this.parent&&(e.parent_id=this.parent.id),this.$emit("submit",e)},toggleRecursive:function(){this.recursive=!this.recursive},toggleUnaccepted:function(){this.unaccepted=!this.unaccepted}},created:function(){this.worms=biigle.$require("labelTrees.wormsLabelSource")}},undefined,undefined,!1,null,null,null);const lc=Sl({mixins:[lu],data:function(){return{labelTree:null,labels:[],selectedColor:nc(),selectedLabel:null,selectedName:"",canEdit:!1}},components:{tabs:Oh,tab:oh,labelTree:Hh,manualLabelForm:oc,wormsLabelForm:ac.exports},computed:{editable:function(){return!this.loading&&this.canEdit}},methods:{saveLabel:function(t,e){this.startLoading(),gl.update({id:t.id},{name:t.name,color:t.color}).catch((function(t){e(),ou(t)})).finally(this.finishLoading)},deleteLabel:function(t){var e=this;this.startLoading(),gl.delete({id:t.id}).then((function(){e.labelDeleted(t)}),ou).finally(this.finishLoading)},labelDeleted:function(t){this.selectedLabel&&this.selectedLabel.id===t.id&&this.deselectLabel(t);for(var e=this.labels.length-1;e>=0;e--)if(this.labels[e].id===t.id){this.labels.splice(e,1);break}},selectLabel:function(t){this.selectedLabel=t,t?(this.selectedColor="#"+t.color,this.$emit("select",t),Al.$emit("selectLabel",t)):(this.$emit("clear"),Al.$emit("selectLabel",null))},deselectLabel:function(t){this.selectedLabel=null,this.$emit("deselect",t),Al.$emit("selectLabel",null)},selectColor:function(t){this.selectedColor=t},selectName:function(t){this.selectedName=t},insertLabel:function(t){Vue.set(t,"open",!1),Vue.set(t,"selected",!1);for(var e=t.name.toLowerCase(),i=0,n=this.labels.length;i=e)return void this.labels.splice(i,0,t);this.labels.push(t)},createLabel:function(t){this.loading||(this.startLoading(),gl.save({label_tree_id:this.labelTree.id},t).then(this.labelCreated,ou).finally(this.finishLoading))},labelCreated:function(t){t.data.forEach(this.insertLabel),this.selectedColor=nc(),this.selectedName=""}},watch:{labels:function(t){Al.$emit("label-trees.labels.count",t.length)}},created:function(){this.labelTree=biigle.$require("labelTrees.labelTree"),this.labels=biigle.$require("labelTrees.labels"),this.canEdit=biigle.$require("labelTrees.canEdit")}},undefined,undefined,!1,null,null,null).exports;const uc=Sl({methods:{updateCount:function(t){this.$el.textContent=t}},created:function(){Al.$on("label-trees.labels.count",this.updateCount)}},undefined,undefined,!1,null,null,null).exports;const hc=Sl({mixins:[lu],props:{members:{type:Array,required:!0},roles:{type:Array,required:!0},defaultRole:{type:Object},disabled:{type:Boolean,default:!1}},components:{typeahead:Hl},data:function(){return{selectedMember:null,selectedRole:null,usersLoaded:!1,users:[]}},computed:{memberIds:function(){return this.members.map((function(t){return t.id}))},availableUsers:function(){var t=this;return this.users.filter((function(e){return!t.memberIds.includes(e.id)}))},canAttachMember:function(){return!this.disabled&&this.selectedMember&&this.selectedRole},selectedMemberName:function(){return this.selectedMember?this.selectedMember.name:""}},methods:{selectMember:function(t){this.selectedMember=t},attachMember:function(){var t={id:this.selectedMember.id,role_id:this.selectedRole,firstname:this.selectedMember.firstname,lastname:this.selectedMember.lastname,affiliation:this.selectedMember.affiliation};this.$emit("attach",t),this.selectedMember=null},loadUsers:function(){this.usersLoaded||(this.usersLoaded=!0,this.startLoading(),wl.query().then(this.loadedUsers,ou).finally(this.finishLoading))},loadedUsers:function(t){this.users=t.data.map((function(t){return t.name=t.firstname+" "+t.lastname,t}))}},created:function(){this.defaultRole?this.selectedRole=this.defaultRole.id:this.selectedRole=this.roles[0].id}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("form",{staticClass:"form-inline",on:{submit:function(e){return e.preventDefault(),t.attachMember(e)}}},[i("loader",{attrs:{active:t.loading}}),t._v(" "),i("typeahead",{attrs:{disabled:t.disabled,items:t.availableUsers,placeholder:"User name",value:t.selectedMemberName,"more-info":"affiliation"},on:{select:t.selectMember,focus:t.loadUsers}}),t._v(" "),i("select",{directives:[{name:"model",rawName:"v-model",value:t.selectedRole,expression:"selectedRole"}],staticClass:"form-control",attrs:{disabled:t.disabled,title:"Role of the new user"},on:{change:function(e){var i=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.selectedRole=e.target.multiple?i:i[0]}}},t._l(t.roles,(function(e){return i("option",{domProps:{value:e.id,textContent:t._s(e.name)}})})),0),t._v(" "),i("button",{staticClass:"btn btn-default",attrs:{type:"submit",disabled:!t.canAttachMember}},[t._v("Add member")])],1)}),[],!1,null,null,null).exports;const cc=Sl({props:{member:{type:Object,required:!0},ownId:{type:Number,required:!0},editable:{type:Boolean,required:!0},editing:{type:Boolean,default:!1},roles:{type:Array,required:!0}},data:function(){return{roleId:null}},computed:{isOwnUser:function(){return this.member.id===this.ownId},isEditing:function(){return this.editing&&!this.isOwnUser},name:function(){return this.member.firstname+" "+this.member.lastname},role:function(){var t=this;return this.roles.find((function(e){return t.member.role_id===e.id}))},labelClass:function(){switch(this.role.name){case"admin":return"label-danger";case"expert":return"label-warning";case"editor":return"label-primary";default:return"label-default"}}},methods:{removeMember:function(){this.$emit("remove",this.member)},changeRole:function(){this.$emit("update",this.member,{role_id:this.roleId})},emitEnter:function(){this.$emit("enter",this.member)}},created:function(){this.roleId=this.member.role_id}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("li",{staticClass:"list-group-item clearfix",on:{mouseenter:t.emitEnter}},[i("h4",{staticClass:"list-group-item-heading"},[t.editable?i("span",{directives:[{name:"show",rawName:"v-show",value:t.isEditing,expression:"isEditing"}],staticClass:"pull-right"},[i("form",{staticClass:"form-inline"},[i("select",{directives:[{name:"model",rawName:"v-model",value:t.roleId,expression:"roleId"}],staticClass:"form-control input-sm",attrs:{disabled:t.isOwnUser,title:"Change the role of "+t.name},on:{change:[function(e){var i=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.roleId=e.target.multiple?i:i[0]},t.changeRole]}},t._l(t.roles,(function(e){return i("option",{domProps:{value:e.id,textContent:t._s(e.name)}})})),0),t._v(" "),i("button",{staticClass:"btn btn-default btn-sm",attrs:{disabled:t.isOwnUser,type:"button",title:"Remove "+t.name},on:{click:t.removeMember}},[i("i",{staticClass:"fa fa-trash"})])])]):t._e(),t._v(" "),i("span",{directives:[{name:"show",rawName:"v-show",value:!t.isEditing,expression:"!isEditing"}],staticClass:"pull-right label",class:t.labelClass,domProps:{textContent:t._s(t.role.name)}}),t._v(" "),i("span",{domProps:{textContent:t._s(t.name)}}),t._v(" "),t.isOwnUser?i("span",{staticClass:"text-muted"},[t._v("(you)")]):t._e()]),t._v(" "),t.member.affiliation?i("p",{staticClass:"list-group-item-text text-muted",domProps:{textContent:t._s(t.member.affiliation)}}):t._e()])}),[],!1,null,null,null).exports;const dc=Sl({props:{members:{type:Array,required:!0},ownId:{type:Number,required:!0},editable:{type:Boolean,required:!0},roles:{type:Array,required:!0}},components:{memberListItem:cc},data:function(){return{editingMemberId:null}},computed:{sortedMembers:function(){var t=this,e=this.members.slice();return e.sort((function(e,i){return e.id===t.ownId?-1:i.id===t.ownId?1:0})),e}},methods:{emitRemove:function(t){this.$emit("remove",t)},emitUpdate:function(t,e){this.$emit("update",t,e)},handleEnter:function(t){this.editable&&(this.editingMemberId=t.id)},handleLeave:function(t){null!==t.relatedTarget&&(this.editingMemberId=null)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("ul",{staticClass:"list-group",on:{mouseleave:t.handleLeave}},t._l(t.sortedMembers,(function(e){return i("member-list-item",{key:e.id,attrs:{member:e,"own-id":t.ownId,editable:t.editable,editing:t.editingMemberId===e.id,roles:t.roles},on:{remove:t.emitRemove,update:t.emitUpdate,enter:t.handleEnter}})})),1)}),[],!1,null,null,null).exports;const fc=Sl({mixins:[lu],data:function(){return{labelTree:null,members:[],roles:[],defaultRole:null,userId:null}},components:{memberList:dc,addMemberForm:hc},computed:{hasMembers:function(){return 0!==this.members.length}},methods:{attachMember:function(t){var e=this;this.startLoading(),vl.addUser({id:this.labelTree.id},{id:t.id,role_id:t.role_id}).then((function(){return e.memberAttached(t)}),ou).finally(this.finishLoading)},memberAttached:function(t){this.members.push(t)},updateMember:function(t,e){var i=this;this.startLoading(),vl.updateUser({id:this.labelTree.id,user_id:t.id},{role_id:e.role_id}).then((function(){return i.memberUpdated(t,e)}),ou).finally(this.finishLoading)},memberUpdated:function(t,e){t.role_id=e.role_id},removeMember:function(t){var e=this;this.startLoading(),vl.removeUser({id:this.labelTree.id,user_id:t.id}).then((function(){return e.memberRemoved(t)}),ou).finally(this.finishLoading)},memberRemoved:function(t){for(var e=this.members.length-1;e>=0;e--)this.members[e].id===t.id&&this.members.splice(e,1)}},watch:{members:function(t){Al.$emit("label-trees.members.count",t.length)}},created:function(){this.labelTree=biigle.$require("labelTrees.labelTree"),this.members=biigle.$require("labelTrees.members"),this.roles=biigle.$require("labelTrees.roles"),this.defaultRole=biigle.$require("labelTrees.defaultRole"),this.userId=biigle.$require("labelTrees.userId")}},undefined,undefined,!1,null,null,null).exports;const pc=Sl({methods:{updateCount:function(t){this.$el.textContent=t}},created:function(){Al.$on("label-trees.members.count",this.updateCount)}},undefined,undefined,!1,null,null,null).exports;var gc=Sl({props:{item:{type:Object,required:!0},disabled:{type:Boolean,required:!1}},computed:{leftLabel:function(){return this.item.left},rightLabel:function(){return this.item.right},hasLeft:function(){return null!==this.leftLabel},hasRight:function(){return null!==this.rightLabel},labelToAdd:function(){return!this.hasLeft&&this.hasRight},labelToRemove:function(){return this.hasLeft&&!this.hasRight},labelsSame:function(){return this.hasLeft&&this.hasRight},leftColorStyle:function(){return{"background-color":"#"+this.leftLabel.color}},rightColorStyle:function(){return{"background-color":"#"+this.rightLabel.color}},classObject:function(){return{success:this.labelToAdd&&!this.accepted,"label-tree-diff-row--added":this.labelToAdd&&this.accepted,danger:this.labelToRemove&&!this.accepted,"label-tree-diff-row--removed":this.labelToRemove&&this.accepted}},labelStyle:function(){return{"padding-left":22*this.item.level+"px"}},addButtonClass:function(){return{"btn-success":this.accepted}},removeButtonClass:function(){return{"btn-danger":this.accepted}},accepted:function(){return this.item.accepted},acceptable:function(){return this.item.acceptable},labelAdded:function(){return this.labelToAdd&&this.accepted},removeTitle:function(){return this.acceptable?"Accept the deletion":"This label cannot be deleted because it or one of its child labels is used"}},methods:{emitResolved:function(){this.$emit("accepted",this.item)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("tr",{staticClass:"label-tree-diff-row",class:t.classObject},[i("td",{staticClass:"label-tree-diff-row__button"},[t.labelToAdd?i("button",{staticClass:"btn btn-sm btn-default",class:t.addButtonClass,attrs:{disabled:t.disabled,title:"Accept the addition"},on:{click:t.emitResolved}},[i("i",{staticClass:"fa fa-plus"})]):t._e(),t._v(" "),t.labelToRemove?i("button",{staticClass:"btn btn-sm btn-default",class:t.removeButtonClass,attrs:{title:t.removeTitle,disabled:!t.acceptable||t.disabled},on:{click:t.emitResolved}},[i("i",{staticClass:"fa fa-minus"})]):t._e()]),t._v(" "),i("td",{staticClass:"label-tree-diff-row__left"},[t.hasLeft?i("div",{staticClass:"label-tree-label",style:t.labelStyle},[i("div",{staticClass:"label-tree-label__name"},[i("span",{staticClass:"label-tree-label__color",style:t.leftColorStyle}),t._v(" "),i("span",{domProps:{textContent:t._s(t.leftLabel.name)}})])]):t._e(),t._v(" "),t.labelAdded?i("div",{staticClass:"label-tree-label",style:t.labelStyle},[i("div",{staticClass:"label-tree-label__name"},[i("span",{staticClass:"label-tree-label__color",style:t.rightColorStyle}),t._v(" "),i("span",{domProps:{textContent:t._s(t.rightLabel.name)}})])]):t._e()]),t._v(" "),i("td",{staticClass:"label-tree-diff-row__right"},[i("div",{staticClass:"label-tree-label",style:t.labelStyle},[t.hasRight?i("div",{staticClass:"label-tree-label__name"},[i("span",{staticClass:"label-tree-label__color",style:t.rightColorStyle}),t._v(" "),i("span",{domProps:{textContent:t._s(t.rightLabel.name)}})]):t._e()])])])}),[],!1,null,null,null);const mc=Sl({components:{labelTreeDiffRow:gc.exports},data:function(){return{diff:[]}},props:{leftLabels:{type:Array,required:!0},leftName:{type:String,default:""},rightLabels:{type:Array,required:!0},rightName:{type:String,default:""},usedLabels:{type:Array,default:function(){return[]}},disabled:{type:Boolean,default:!1}},computed:{leftLabelsById:function(){var t={};return this.leftLabels.forEach((function(e){t[e.id]=e})),t},leftLabelsAsTree:function(){var t=this.generateChildMap(this.leftLabels);return this.generateLabelsAsTree(t.null,t)},rightLabelsAsTree:function(){var t=this.generateChildMap(this.rightLabels);return this.generateLabelsAsTree(t.null,t)},usedLabelMap:function(){var t=this,e={};return this.usedLabels.forEach((function(i){do{e[i]=null,i=t.leftLabelsById[i].parent_id}while(null!==i)})),e},cannotResolveAll:function(){return this.disabled||this.diff.reduce((function(t,e){return e.acceptable?t&&e.accepted:t}),!0)},cannotResolveNone:function(){return this.disabled||this.diff.reduce((function(t,e){return e.acceptable?t&&!e.accepted:t}),!0)},hasDiff:function(){return this.diff.length>0}},methods:{generateChildMap:function(t){var e={};return t.forEach((function(t){e.hasOwnProperty(t.parent_id)?e[t.parent_id].push(t):e[t.parent_id]=[t]})),e},generateLabelsAsTree:function(t,e){var i=this;return t.map((function(t){return e.hasOwnProperty(t.id)?t.children=i.generateLabelsAsTree(e[t.id],e):t.children=[],t})).sort((function(t,e){return t.name+"-"+t.color<=e.name+"-"+e.color?-1:1}))},generateTreeDiff:function(t,e,i,n){var r=this;for(t=t.slice(),e=e.slice(),i=i||[],n=n||0;t.length>0&&e.length>0;){var o=t[0],s=e[0];o.name===s.name?(t.shift(),e.shift(),i.push({id:o.id,level:n,left:o,right:s}),this.generateTreeDiff(o.children,s.children,i,n+1)):o.name0&&t.forEach((function(t){i.push({id:t.id,level:n,accepted:!1,acceptable:!r.usedLabelMap.hasOwnProperty(t.id),left:t,right:null}),r.generateTreeDiff(t.children,[],i,n+1)})),e.length>0&&e.forEach((function(t){i.push({id:t.id,level:n,accepted:!1,acceptable:!0,left:null,right:t}),r.generateTreeDiff([],t.children,i,n+1)})),i},filterRelevantItems:function(t){var e=[];return t.forEach((function(t,i){null!==t.left&&null!==t.right||e.push(i)})),e.forEach((function(e){t[e].relevant=!0;for(var i=t[e].level,n=e;n>=0&&i>0;)t[n].level=i;)e.call(this,this.diff[n]),n+=1},doForAllParents:function(t,e){for(var i=t.level,n=this.diff.indexOf(t)-1;i>0&&n>=0;)this.diff[n].level0},labelTreeIds:function(){return this.labelTrees.map((function(t){return t.id}))},attachableLabelTrees:function(){var t=this;return this.availableLabelTrees.filter((function(e){return-1===t.labelTreeIds.indexOf(e.id)}))}},methods:{fetchAvailableLabelTrees:function(){this.fetchedAvailableLabelTrees||(this.fetchedAvailableLabelTrees=!0,this.startLoading(),bl.queryAvailableLabelTrees({id:this.project.id}).then(this.availableLabelTreesFetched,ou).finally(this.finishLoading))},availableLabelTreesFetched:function(t){this.availableLabelTrees=t.data.map(this.parseLabelTreeVersionedName)},attachTree:function(t){var e=this;t&&(this.startLoading(),bl.attachLabelTree({id:this.project.id},{id:t.id}).then((function(){return e.treeAttached(t)}),ou).finally(this.finishLoading))},treeAttached:function(t){for(var e=this.availableLabelTrees.length-1;e>=0;e--)this.availableLabelTrees[e].id===t.id&&this.availableLabelTrees.splice(e,1);this.labelTrees.push(t)},removeTree:function(t){var e=this;this.startLoading(),bl.detachLabelTree({id:this.project.id,label_tree_id:t.id}).then((function(){return e.treeRemoved(t)}),ou).finally(this.finishLoading)},treeRemoved:function(t){for(var e=this.labelTrees.length-1;e>=0;e--)this.labelTrees[e].id===t.id&&this.labelTrees.splice(e,1);this.availableLabelTrees.push(t)},parseLabelTreeVersionedName:function(t){return t.version&&(t.name=t.name+" @ "+t.version.name),t}},watch:{labelTrees:function(t){Al.$emit("project.label-trees.count",t.length)}},created:function(){this.canEdit=biigle.$require("projects.canEdit"),this.labelTrees=biigle.$require("projects.labelTrees").map(this.parseLabelTreeVersionedName),this.project=biigle.$require("projects.project")}},undefined,undefined,!1,null,null,null).exports;const Ac=Sl({methods:{updateCount:function(t){this.$el.textContent=t}},created:function(){Al.$on("project.label-trees.count",this.updateCount)}},undefined,undefined,!1,null,null,null).exports;const Pc=Sl({mixins:[lu],data:function(){return{project:null,canEdit:!1,members:[],roles:{},defaultRole:null,userId:null}},components:{memberList:dc,addMemberForm:hc},methods:{attachMember:function(t){var e=this;this.startLoading(),bl.addUser({id:this.project.id,user_id:t.id},{project_role_id:t.role_id}).then((function(){return e.memberAttached(t)}),ou).finally(this.finishLoading)},memberAttached:function(t){this.members.push(t)},updateMember:function(t,e){var i=this;this.startLoading(),bl.updateUser({id:this.project.id,user_id:t.id},{project_role_id:e.role_id}).then((function(){return i.memberUpdated(t,e)}),ou).finally(this.finishLoading)},memberUpdated:function(t,e){t.role_id=e.role_id},removeMember:function(t){var e=this;this.startLoading(),bl.removeUser({id:this.project.id,user_id:t.id}).then((function(){return e.memberRemoved(t)}),ou).finally(this.finishLoading)},memberRemoved:function(t){for(var e=this.members.length-1;e>=0;e--)this.members[e].id===t.id&&this.members.splice(e,1)}},watch:{members:function(t){Al.$emit("project.members.count",t.length)}},created:function(){this.project=biigle.$require("projects.project"),this.canEdit=biigle.$require("projects.canEdit"),this.roles=biigle.$require("projects.roles"),this.defaultRole=biigle.$require("projects.defaultRole"),this.members=biigle.$require("projects.members"),this.userId=biigle.$require("projects.userId")}},undefined,undefined,!1,null,null,null).exports;const kc=Sl({methods:{updateCount:function(t){this.$el.textContent=t}},created:function(){Al.$on("project.members.count",this.updateCount)}},undefined,undefined,!1,null,null,null).exports;const Rc=Sl({mixins:[lu,au],components:{dropdown:Xh},data:function(){return{project:null,name:null,description:null,userId:null,redirectUrl:null}},computed:{hasDescription:function(){return!!this.description.length},isChanged:function(){return this.name!==this.project.name||this.description!==this.project.description},disabledClass:function(){return this.loading?"disabled":""}},methods:{discardChanges:function(){this.name=this.project.name,this.description=this.project.description,this.finishEditing()},leaveProject:function(){confirm('Do you really want to revoke your membership of project "'.concat(this.project.name,'"?'))&&(this.startLoading(),bl.removeUser({id:this.project.id,user_id:this.userId}).then(this.projectLeft,ou).finally(this.finishLoading))},projectLeft:function(){var t=this;su.success("You left the project. Redirecting..."),setTimeout((function(){return location.href=t.redirectUrl}),2e3)},deleteProject:function(){confirm("Do you really want to delete the project ".concat(this.project.name,"?"))&&(this.startLoading(),bl.delete({id:this.project.id}).then(this.projectDeleted,this.maybeForceDeleteProject).finally(this.finishLoading))},maybeForceDeleteProject:function(t){400===t.status?confirm("Deleting this project will delete one or more volumes with all annotations! Do you want to continue?")&&(this.startLoading(),bl.delete({id:this.project.id},{force:!0}).then(this.projectDeleted,ou).finally(this.finishLoading)):ou(t)},projectDeleted:function(){var t=this;su.success("The project was deleted. Redirecting..."),setTimeout((function(){return location.href=t.redirectUrl}),2e3)},saveChanges:function(){this.startLoading(),bl.update({id:this.project.id},{name:this.name,description:this.description}).then(this.changesSaved,ou).finally(this.finishLoading)},changesSaved:function(){this.project.name=this.name,this.project.description=this.description,this.finishEditing()}},created:function(){this.project=biigle.$require("projects.project"),this.name=this.project.name,this.description=this.project.description,this.userId=biigle.$require("projects.userId"),this.redirectUrl=biigle.$require("projects.redirectUrl")}},undefined,undefined,!1,null,null,null).exports,Lc=Vue.resource("api/v1/projects{/id}/attachable-volumes");const Fc=Sl({mixins:[lu],data:function(){return{project:null,volumes:[],fetchedAttachableVolumes:!1,attachableVolumes:[],filterString:"",showImageVolumes:!0,showVideoVolumes:!0}},components:{previewThumbnail:Sc,typeahead:Hl},computed:{filteredVolumes:function(){var t=this.volumes;if(this.showImageVolumes||(t=t.filter((function(t){return"image"!==t.media_type.name}))),this.showVideoVolumes||(t=t.filter((function(t){return"video"!==t.media_type.name}))),this.hasFiltering){var e=this.filterString.toLowerCase();t=t.filter((function(t){return t.name.toLowerCase().includes(e)}))}return t},hasFiltering:function(){return this.filterString.length>0},filterInputClass:function(){return this.hasFiltering?"volume-filter--active":""},hasVolumes:function(){return this.volumes.length>0},hasNoMatchingVolumes:function(){return this.hasVolumes&&0===this.filteredVolumes.length},hasMixedMediaTypes:function(){return this.volumes.some((function(t){return"image"===t.media_type.name}))&&this.volumes.some((function(t){return"video"===t.media_type.name}))},toggleImageVolumesClass:function(){return this.showVideoVolumes?"btn-default":"btn-info active"},toggleVideoVolumesClass:function(){return this.showImageVolumes?"btn-default":"btn-info active"}},methods:{removeVolume:function(t){var e=this;this.startLoading(),bl.detachVolume({id:this.project.id,volume_id:t}).then((function(){return e.volumeRemoved(t)}),(function(i){400===i.status?confirm("The volume you are about to remove belongs only to this project and will be deleted. Are you sure you want to delete this volume?")&&e.forceRemoveVolume(t):ou(i)})).finally(this.finishLoading)},forceRemoveVolume:function(t){var e=this;this.startLoading(),bl.detachVolume({id:this.project.id,volume_id:t},{force:!0}).then((function(){return e.volumeRemoved(t)}),ou).finally(this.finishLoading)},volumeRemoved:function(t){for(var e=this.volumes.length-1;e>=0;e--)this.volumes[e].id===t&&(this.attachableVolumes.unshift(this.volumes[e]),this.volumes.splice(e,1))},hasVolume:function(t){for(var e=this.volumes.length-1;e>=0;e--)if(this.volumes[e].id===t)return!0;return!1},attachVolume:function(t){var e=this;t&&!this.hasVolume(t.id)&&(this.startLoading(),bl.attachVolume({id:this.project.id,volume_id:t.id},{}).then((function(){return e.volumeAttached(t)}),ou).finally(this.finishLoading))},volumeAttached:function(t){this.volumes.unshift(t);for(var e=this.attachableVolumes.length-1;e>=0;e--)this.attachableVolumes[e].id===t.id&&this.attachableVolumes.splice(e,1)},fetchAttachableVolumes:function(){this.fetchedAttachableVolumes||(this.fetchedAttachableVolumes=!0,this.startLoading(),Lc.get({id:this.project.id}).then(this.attachableVolumesFetched,ou).finally(this.finishLoading))},attachableVolumesFetched:function(t){this.attachableVolumes=t.data.map(this.processVolumes)},clearFiltering:function(t){t.preventDefault(),this.filterString=""},toggleImageVolumes:function(){this.showVideoVolumes=!this.showVideoVolumes,this.showImageVolumes||this.showVideoVolumes||(this.showImageVolumes=!0)},toggleVideoVolumes:function(){this.showImageVolumes=!this.showImageVolumes,this.showVideoVolumes||this.showImageVolumes||(this.showVideoVolumes=!0)},processVolumes:function(t){return t.icon="image"===t.media_type.name?"image":"film",t}},watch:{volumes:function(t){Al.$emit("project.volumes.count",t.length)}},created:function(){this.project=biigle.$require("projects.project"),this.volumes=biigle.$require("projects.volumes").map(this.processVolumes)}},undefined,undefined,!1,null,null,null).exports;const Mc=Sl({methods:{updateCount:function(t){this.$el.textContent=t}},created:function(){Al.$on("project.volumes.count",this.updateCount)}},undefined,undefined,!1,null,null,null).exports;biigle.$mount("project-label-trees-count",Ac),biigle.$mount("project-members-count",kc),biigle.$mount("project-volumes-count",Mc),biigle.$mount("projects-dashboard-main",Cc),biigle.$mount("projects-show-label-trees",Ic),biigle.$mount("projects-show-members",Pc),biigle.$mount("projects-show-volumes",Fc),biigle.$mount("projects-title",Rc);const Oc=Sl({props:{rule:{type:Object,required:!0}},data:function(){return{name:this.rule.id}},computed:{dataName:function(){return this.rule.data?this.rule.data.name:""}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("span",[i("strong",[t._v("with"),t.rule.negate?i("span",[t._v("out")]):t._e()]),t._v(" "),i("span",{domProps:{textContent:t._s(t.name)}}),t._v(" "),t.dataName?i("strong",{domProps:{textContent:t._s(t.dataName)}}):t._e()])}),[],!1,null,null,null).exports;const $c=Sl({components:{typeahead:Hl},props:{volumeId:{type:Number,required:!0}},data:function(){return{items:[],placeholder:"",selectedItem:null,typeaheadMoreInfo:""}},computed:{value:function(){return this.selectedItem?this.selectedItem.name:""}},methods:{select:function(t){this.selectedItem=t},gotItems:function(t){this.items=t.data},parseUsernames:function(t){return t.data=t.data.map((function(t){return t.name=t.firstname+" "+t.lastname,t})),t},submit:function(){this.$emit("select",this.selectedItem)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"filter-select"},[i("typeahead",{attrs:{items:t.items,value:t.value,placeholder:t.placeholder,"more-info":t.typeaheadMoreInfo},on:{select:t.select}}),t._v(" "),i("button",{staticClass:"btn btn-default",attrs:{type:"submit",disabled:!t.selectedItem},on:{click:t.submit}},[t._v("Add rule")])],1)}),[],!1,null,null,null).exports,Dc=Vue.resource("api/v1/volumes{/id}",{},{queryFilesWithFileLabels:{method:"GET",url:"api/v1/volumes{/id}/files/filter/labels"},queryFilesWithLabel:{method:"GET",url:"api/v1/volumes{/id}/files/filter/labels{/label_id}"},queryFilesWithLabelFromUser:{method:"GET",url:"api/v1/volumes{/id}/files/filter/labels/users{/user_id}"},queryFilesWithFilename:{method:"GET",url:"api/v1/volumes{/id}/files/filter/filename{/pattern}"},queryUsedFileLabels:{method:"GET",url:"api/v1/volumes{/id}/file-labels"},queryFilenames:{method:"GET",url:"api/v1/volumes{/id}/filenames"},queryFileLabels:{method:"GET",url:"api/v1/volumes{/id}/files/labels"},queryUsers:{method:"GET",url:"api/v1/volumes{/id}/users"},queryFiles:{method:"GET",url:"api/v1/volumes{/id}/files"},saveFiles:{method:"POST",url:"api/v1/volumes{/id}/files"},queryFilesWithAnnotations:{method:"GET",url:"api/v1/volumes{/id}/files/filter/annotations"},queryFilesWithAnnotationLabel:{method:"GET",url:"api/v1/volumes{/id}/files/filter/annotation-label{/label_id}"},queryFilesWithAnnotationFromUser:{method:"GET",url:"api/v1/volumes{/id}/files/filter/annotation-user{/user_id}"},queryAnnotationLabels:{method:"GET",url:"api/v1/volumes{/id}/annotation-labels"}});const jc=[{id:"fileLabels",types:["image"],label:"image labels",help:"All images that (don't) have image labels attached.",listComponent:{mixins:[Oc],data:function(){return{name:"image labels"}}},getSequence:function(t){return Dc.queryFilesWithFileLabels({id:t})}},{id:"fileLabels",types:["video"],label:"video labels",help:"All videos that (don't) have video labels attached.",listComponent:{mixins:[Oc],data:function(){return{name:"video labels"}}},getSequence:function(t){return Dc.queryFilesWithFileLabels({id:t})}},{id:"imageLabel",types:["image"],label:"image label",help:"All images that (don't) have the given image label attached.",listComponent:{mixins:[Oc],data:function(){return{name:"image label"}}},selectComponent:{mixins:[$c],components:{typeahead:Zh},data:function(){return{placeholder:"Label name"}},created:function(){Dc.queryUsedFileLabels({id:this.volumeId}).then(this.gotItems,ou)}},getSequence:function(t,e){return Dc.queryFilesWithLabel({id:t,label_id:e.id})}},{id:"videoLabel",types:["video"],label:"video label",help:"All videos that (don't) have the given video label attached.",listComponent:{mixins:[Oc],data:function(){return{name:"video label"}}},selectComponent:{mixins:[$c],components:{typeahead:Zh},data:function(){return{placeholder:"Label name"}},created:function(){Dc.queryUsedFileLabels({id:this.volumeId}).then(this.gotItems,ou)}},getSequence:function(t,e){return Dc.queryFilesWithLabel({id:t,label_id:e.id})}},{id:"imageLabelUser",types:["image"],label:"image label from user",help:"All images that (don't) have one or more image labels attached by the given user.",listComponent:{mixins:[Oc],data:function(){return{name:"image label from user"}}},selectComponent:{mixins:[$c],data:function(){return{placeholder:"User name",typeaheadMoreInfo:"affiliation"}},created:function(){Dc.queryUsers({id:this.volumeId}).then(this.parseUsernames,ou).then(this.gotItems)}},getSequence:function(t,e){return Dc.queryFilesWithLabelFromUser({id:t,user_id:e.id})}},{id:"videoLabelUser",types:["video"],label:"video label from user",help:"All videos that (don't) have one or more video labels attached by the given user.",listComponent:{mixins:[Oc],data:function(){return{name:"video label from user"}}},selectComponent:{mixins:[$c],data:function(){return{placeholder:"User name",typeaheadMoreInfo:"affiliation"}},created:function(){Dc.queryUsers({id:this.volumeId}).then(this.parseUsernames,ou).then(this.gotItems)}},getSequence:function(t,e){return Dc.queryFilesWithLabelFromUser({id:t,user_id:e.id})}},{id:"filename",types:["image","video"],label:"filename",help:"All :types that (don't) have a filename matching the given pattern. A pattern may contain the wildcard character * that matches any string of zero or more characters.",listComponent:{mixins:[Oc],computed:{dataName:function(){return this.rule.data}}},selectComponent:{template:'
\n
\n \n
\n \n
',data:function(){return{selectedItem:null}},methods:{submit:function(){this.$emit("select",this.selectedItem)}}},getSequence:function(t,e){return Dc.queryFilesWithFilename({id:t,pattern:e})}},{id:"annotations",types:["image","video"],label:"annotations",help:"All :types that (don't) contain annotations.",listComponent:Oc,getSequence:function(t){return Dc.queryFilesWithAnnotations({id:t})}},{id:"annotationLabels",types:["image","video"],label:"annotation with label",help:"All :types that (don't) contain one or more annotations with the given label.",listComponent:{mixins:[Oc],data:function(){return{name:"annotation with label"}}},selectComponent:{mixins:[$c],components:{typeahead:Zh},data:function(){return{placeholder:"Label name"}},created:function(){Dc.queryAnnotationLabels({id:this.volumeId}).then(this.gotItems,ou)}},getSequence:function(t,e){return Dc.queryFilesWithAnnotationLabel({id:t,label_id:e.id})}},{id:"annotationUser",types:["image","video"],label:"annotations from user",help:"All :types that (don't) contain one or more annotations from the given user.",listComponent:{mixins:[Oc],data:function(){return{name:"annotations from user"}}},selectComponent:{mixins:[$c],data:function(){return{placeholder:"User name",typeaheadMoreInfo:"affiliation"}},created:function(){Dc.queryUsers({id:this.volumeId}).then(this.parseUsernames,ou).then(this.gotItems)}},getSequence:function(t,e){return Dc.queryFilesWithAnnotationFromUser({id:t,user_id:e.id})}}];const Nc=Sl({data:function(){return{thumbnailUrl:null,timeout:null}},props:{image:{type:Object,required:!0},emptyUrl:{type:String,required:!0},selectable:{type:Boolean,required:!1},selectedIcon:{type:String,default:"check"},selectedFade:{type:Boolean,default:!0},smallIcon:{type:Boolean,default:!1}},computed:{classObject:function(){return{"image-grid__image--selected":this.selected,"image-grid__image--selectable":this.selectable,"image-grid__image--fade":this.selectedFade,"image-grid__image--small-icon":this.smallIcon}},selected:function(){return!1},iconClass:function(){return"fa-"+this.selectedIcon},showIcon:function(){return this.selectable||this.selected},srcUrl:function(){return Array.isArray(this.thumbnailUrl)?this.thumbnailUrl[0]:this.thumbnailUrl?this.thumbnailUrl:this.emptyUrl}},methods:{toggleSelect:function(t){this.selectable&&this.$emit("select",this.image,t)},gotBlob:function(t){var e=window.URL||window.webkitURL;this.thumbnailUrl=e.createObjectURL(t.body),this.image.blob=this.thumbnailUrl},showEmptyImage:function(){this.thumbnailUrl=null}},created:function(){var t=this;this.image.thumbnailUrl?this.thumbnailUrl=this.image.thumbnailUrl:this.image.blob?this.thumbnailUrl=this.image.blob:this.getThumbnailUrl?this.thumbnailUrl=this.getThumbnailUrl():this.getBlob&&(this.timeout=setTimeout((function(){return t.getBlob().then(t.gotBlob)}),50))},beforeDestroy:function(){clearTimeout(this.timeout)}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("figure",{staticClass:"image-grid__image",class:t.classObject},[t.showIcon?i("div",{staticClass:"image-icon"},[i("i",{staticClass:"fas",class:t.iconClass})]):t._e(),t._v(" "),i("img",{attrs:{src:t.srcUrl},on:{click:t.toggleSelect,error:t.showEmptyImage}})])}),[],!1,null,null,null).exports;var Bc=Sl({data:function(){return{scrolling:!1}},props:{progress:{type:Number,required:!0}},computed:{isAtTop:function(){return 0===this.progress},isAtBottom:function(){return 1===this.progress},progressHeight:function(){return 100*this.progress+"%"}},methods:{top:function(){this.$emit("top")},prevPage:function(){this.$emit("prev-page")},prevRow:function(){this.$emit("prev-row")},beginScrolling:function(){this.scrolling=!0},stopScrolling:function(){this.scrolling=!1},scroll:function(t){this.scrolling&&this.jump(t)},jump:function(t){var e=t.target.getBoundingClientRect();this.$emit("jump",(t.clientY-e.top)/e.height)},nextRow:function(){this.$emit("next-row")},nextPage:function(){this.$emit("next-page")},bottom:function(){this.$emit("bottom")}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"image-grid-progress"},[i("div",{staticClass:"btn-group-vertical"},[i("button",{staticClass:"btn btn-default btn-xs",attrs:{type:"button",title:"Go to top 𝗛𝗼𝗺𝗲",disabled:t.isAtTop},on:{click:t.top}},[i("span",{staticClass:"fa fa-fast-backward fa-rotate-90"})]),t._v(" "),i("button",{staticClass:"btn btn-default btn-xs",attrs:{type:"button",title:"Previous page 𝗣𝗮𝗴𝗲 𝘂𝗽/𝗔𝗿𝗿𝗼𝘄 𝗹𝗲𝗳𝘁",disabled:t.isAtTop},on:{click:t.prevPage}},[i("span",{staticClass:"fa fa-step-backward fa-rotate-90"})]),t._v(" "),i("button",{staticClass:"btn btn-default btn-xs",attrs:{type:"button",title:"Previous row 𝗔𝗿𝗿𝗼𝘄 𝘂𝗽",disabled:t.isAtTop},on:{click:t.prevRow}},[i("span",{staticClass:"fa fa-chevron-up"})])]),t._v(" "),i("div",{staticClass:"image-grid-progress__bar",on:{mousedown:t.beginScrolling,mouseup:t.stopScrolling,mouseleave:t.stopScrolling,mousemove:function(e){return e.preventDefault(),t.scroll(e)},click:t.jump}},[i("div",{staticClass:"image-grid-progress__wrapper"},[i("div",{staticClass:"image-grid-progress__inner",style:{height:t.progressHeight}})])]),t._v(" "),i("div",{staticClass:"btn-group-vertical"},[i("button",{staticClass:"btn btn-default btn-xs",attrs:{type:"button",title:"Next row 𝗔𝗿𝗿𝗼𝘄 𝗱𝗼𝘄𝗻",disabled:t.isAtBottom},on:{click:t.nextRow}},[i("span",{staticClass:"fa fa-chevron-down"})]),t._v(" "),i("button",{staticClass:"btn btn-default btn-xs",attrs:{type:"button",title:"Next page 𝗣𝗮𝗴𝗲 𝗱𝗼𝘄𝗻/𝗔𝗿𝗿𝗼𝘄 𝗿𝗶𝗴𝗵𝘁",disabled:t.isAtBottom},on:{click:t.nextPage}},[i("span",{staticClass:"fa fa-step-forward fa-rotate-90"})]),t._v(" "),i("button",{staticClass:"btn btn-default btn-xs",attrs:{type:"button",title:"Go to bottom 𝗘𝗻𝗱",disabled:t.isAtBottom},on:{click:t.bottom}},[i("span",{staticClass:"fa fa-fast-forward fa-rotate-90"})])])])}),[],!1,null,null,null);const Uc=Sl({data:function(){return{clientWidth:0,clientHeight:0,offset:0,imagesOffset:0,imagesOffsetTimeout:null}},components:{imageGridImage:Nc,imageGridProgress:Bc.exports},props:{images:{type:Array,required:!0},emptyUrl:{type:String,required:!0},width:{type:Number,default:135},height:{type:Number,default:180},margin:{type:Number,default:8},initialOffset:{type:Number,default:0},selectable:{type:Boolean,default:!1},selectedIcon:{type:String,default:"check"},listenerSet:{type:String,default:"default"}},computed:{columns:function(){return Math.max(1,Math.floor(this.clientWidth/(this.width+this.margin)))},rows:function(){return Math.max(1,Math.floor(this.clientHeight/(this.height+this.margin)))},imagesOffsetEnd:function(){return this.imagesOffset+this.columns*this.rows},displayedImages:function(){return this.images.slice(this.imagesOffset,this.imagesOffsetEnd)},progress:function(){return this.offset/(this.columns*this.lastRow)},lastRow:function(){return Math.max(0,Math.ceil(this.images.length/this.columns)-this.rows)},lastOffset:function(){return this.lastRow*this.columns},canScroll:function(){return this.lastRow>0}},methods:{updateDimensions:function(){this.$refs.images&&(this.clientHeight=this.$refs.images.clientHeight,this.clientWidth=this.$refs.images.clientWidth)},scrollRows:function(t,e){this.setOffset(this.offset+this.columns*t,e)},scroll:function(t){this.scrollRows(t.deltaY>=0?1:-1,!0)},advanceRow:function(){this.scrollRows(1)},advancePage:function(){this.scrollRows(this.rows)},reverseRow:function(){this.scrollRows(-1)},reversePage:function(){this.scrollRows(-this.rows)},jumpToPercent:function(t){this.setOffset(this.columns*Math.round(this.lastRow*t))},jumpToStart:function(){this.jumpToPercent(0)},jumpToEnd:function(){this.jumpToPercent(1)},emitSelect:function(t,e){this.$emit("select",t,e)},setOffset:function(t,e){var i=this;this.offset=Math.max(0,Math.min(this.lastOffset,t)),clearTimeout(this.imagesOffsetTimeout),e?this.imagesOffsetTimeout=setTimeout((function(){i.imagesOffset=i.offset}),25):this.imagesOffset=this.offset}},watch:{lastOffset:function(){this.setOffset(this.offset)},offset:function(){this.$emit("scroll",this.offset)}},created:function(){Pl.on("ArrowUp",this.reverseRow,0,this.listenerSet),Pl.on("w",this.reverseRow,0,this.listenerSet),Pl.on("ArrowDown",this.advanceRow,0,this.listenerSet),Pl.on("s",this.advanceRow,0,this.listenerSet),Pl.on("ArrowLeft",this.reversePage,0,this.listenerSet),Pl.on("a",this.reversePage,0,this.listenerSet),Pl.on("ArrowRight",this.advancePage,0,this.listenerSet),Pl.on("d",this.advancePage,0,this.listenerSet),Pl.on("PageUp",this.reversePage,0,this.listenerSet),Pl.on("PageDown",this.advancePage,0,this.listenerSet),Pl.on("Home",this.jumpToStart,0,this.listenerSet),Pl.on("End",this.jumpToEnd,0,this.listenerSet),this.setOffset(this.initialOffset)},mounted:function(){window.addEventListener("resize",this.updateDimensions),this.$on("resize",this.updateDimensions),this.$nextTick(this.updateDimensions),this.$watch("canScroll",this.updateDimensions)}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"image-grid",on:{wheel:function(e){return e.preventDefault(),t.scroll(e)}}},[i("div",{ref:"images",staticClass:"image-grid__images"},t._l(t.displayedImages,(function(e){return i("image-grid-image",{key:e.id,attrs:{image:e,"empty-url":t.emptyUrl,selectable:t.selectable,"selected-icon":t.selectedIcon},on:{select:t.emitSelect}})})),1),t._v(" "),t.canScroll?i("image-grid-progress",{attrs:{progress:t.progress},on:{top:t.jumpToStart,"prev-page":t.reversePage,"prev-row":t.reverseRow,jump:t.jumpToPercent,"next-row":t.advanceRow,"next-page":t.advancePage,bottom:t.jumpToEnd}}):t._e()],1)}),[],!1,null,null,null).exports;const zc=Sl({props:{activeSorter:{type:String,default:""}},computed:{active:function(){return this.activeSorter===this.id},classObject:function(){return{active:this.active}}},methods:{getSequence:function(){return new Vue.Promise.resolve([])},handleClick:function(){this.active||this.$emit("select",this)}}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("button",{staticClass:"list-group-item",class:t.classObject,attrs:{title:t.title},domProps:{textContent:t._s(t.text)},on:{click:t.handleClick}})}),[],!1,null,null,null).exports;const Vc=[{id:"filename",types:["image","video"],component:{mixins:[zc],data:function(){return{fileIds:[],title:"Sort images by filename",text:"Filename",id:"filename"}},methods:{getSequence:function(){return new Vue.Promise.resolve(this.fileIds)}},created:function(){this.fileIds=biigle.$require("volumes.fileIds")}}},{id:"id",types:["image","video"],component:{mixins:[zc],data:function(){return{fileIds:[],title:"Sort images by ID",text:"ID",id:"id"}},computed:{ids:function(){return this.fileIds.slice().sort(this.compare)}},methods:{getSequence:function(){return new Vue.Promise.resolve(this.ids)},compare:function(t,e){return t-e}},created:function(){this.fileIds=biigle.$require("volumes.fileIds")}}},{id:"random",types:["image","video"],component:{mixins:[zc],data:function(){return{fileIds:[],title:"Sort images randomly",text:"Random",id:"random"}},methods:{shuffle:function(t){var e,i,n;for(e=t.length-1;e>0;e--)i=Math.floor(Math.random()*(e+1)),n=t[e],t[e]=t[i],t[i]=n;return t},getSequence:function(){var t=this.shuffle(this.fileIds.slice());return new Vue.Promise.resolve(t)},handleClick:function(){this.$emit("select",this)}},created:function(){this.fileIds=biigle.$require("volumes.fileIds")}}}];biigle.$declare("annotations.api.volumes",Dc),biigle.$declare("volumes.components.filterListComponent",Oc),biigle.$declare("volumes.components.imageGrid",Uc),biigle.$declare("volumes.components.imageGridImage",Nc),biigle.$declare("volumes.mixins.sortComponent",zc),biigle.$declare("volumes.stores.filters",jc),biigle.$declare("volumes.stores.sorters",Vc);const Gc=Sl({props:["session","editing","editId"],computed:{title:function(){return this.editing?"Edit this annotation session":this.session.name},active:function(){var t=new Date;return this.session.starts_at_iso8601=t},currentlyEdited:function(){return this.session.id===this.editId},classObject:function(){return{"session--active":this.active,"list-group-item-info":this.currentlyEdited}}},methods:{edit:function(){this.editing&&!this.currentlyEdited&&this.$emit("edit",this.session)}}},undefined,undefined,!1,null,null,null).exports,qc=Vue.resource("api/v1/annotation-sessions{/id}",{},{query:{method:"GET",url:"api/v1/volumes{/volume_id}/annotation-sessions"},save:{method:"POST",url:"api/v1/volumes{/volume_id}/annotation-sessions"}});const Wc=Sl({props:["user"],computed:{name:function(){return this.user.firstname+" "+this.user.lastname},title:function(){return"Remove "+this.name}},methods:{remove:function(){this.$emit("remove",this.user)}}},undefined,undefined,!1,null,null,null).exports;function Kc(t,e){var i=arguments;if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1;r=0:n.value===n.inputValue,a={btn:!0,active:n.inputType?s:n.active,disabled:n.disabled,"btn-block":n.block};a["btn-"+n.type]=Boolean(n.type),a["btn-"+n.size]=Boolean(n.size);var l,u,h,c={click:function(t){n.disabled&&t instanceof Event&&(t.preventDefault(),t.stopPropagation())}};return n.href?(l="a",h=i,u=ad(r,{on:c,class:a,attrs:{role:"button",href:n.href,target:n.target}})):n.to?(l="router-link",h=i,u=ad(r,{nativeOn:c,class:a,props:{event:n.disabled?"":"click",to:n.to,replace:n.replace,append:n.append,exact:n.exact},attrs:{role:"button"}})):n.inputType?(l="label",u=ad(r,{on:c,class:a}),h=[t("input",{attrs:{autocomplete:"off",type:n.inputType,checked:s?"checked":null,disabled:n.disabled},domProps:{checked:s},on:{input:function(t){t.stopPropagation()},change:function(){if(n.inputType===hd){var t=n.value.slice();s?t.splice(t.indexOf(n.inputValue),1):t.push(n.inputValue),o.input(t)}else o.input(n.inputValue)}}}),i]):n.justified?(l=ud,u={},h=[t("button",ad(r,{on:c,class:a,attrs:{type:n.nativeType,disabled:n.disabled}}),i)]):(l="button",h=i,u=ad(r,{on:c,class:a,attrs:{type:n.nativeType,disabled:n.disabled}})),t(l,u,h)},props:{justified:{type:Boolean,default:!1},type:{type:String,default:"default"},nativeType:{type:String,default:"button"},size:String,block:{type:Boolean,default:!1},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},value:null,inputValue:null,inputType:{type:String,validator:function(t){return t===hd||"radio"===t}}}};function dd(t,e){for(var i=e-(t+="").length;i>0;i--)t="0"+t;return t}var fd=["January","February","March","April","May","June","July","August","September","October","November","December"];function pd(t){return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds())}function gd(t,e,i,n,r,o,s,a,l,u){"boolean"!=typeof s&&(l=a,a=s,s=!1);var h,c="function"==typeof i?i.options:i;if(t&&t.render&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),n&&(c._scopeId=n),o?(h=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=h):e&&(h=s?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),h)if(c.functional){var d=c.render;c.render=function(t,e){return h.call(e),d(t,e)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,h):[h]}return i}var md={mixins:[td],props:{month:Number,year:Number,date:Date,today:Date,limit:Object,weekStartsWith:Number,iconControlLeft:String,iconControlRight:String,dateClass:Function,yearMonthFormatter:Function,weekNumbers:Boolean},components:{Btn:cd},computed:{weekDays:function(){for(var t=[],e=this.weekStartsWith;t.length<7;)t.push(e++),e>6&&(e=0);return t},yearMonthStr:function(){return this.yearMonthFormatter?this.yearMonthFormatter(this.year,this.month):Xc(this.month)?this.year+" "+this.t("uiv.datePicker.month"+(this.month+1)):this.year},monthDayRows:function(){var t,e,i=[],n=new Date(this.year,this.month,1),r=new Date(this.year,this.month,0).getDate(),o=n.getDay(),s=(t=this.month,e=this.year,new Date(e,t+1,0).getDate()),a=0;a=this.weekStartsWith>o?7-this.weekStartsWith:0-this.weekStartsWith;for(var l=0;l<6;l++){i.push([]);for(var u=0-a;u<7-a;u++){var h=7*l+u,c={year:this.year,disabled:!1};h0?c.month=this.month-1:(c.month=11,c.year--)):h=this.limit.from),this.limit&&this.limit.to&&(p=d0?t--:(t=11,e--,this.$emit("year-change",e)),this.$emit("month-change",t)},goNextMonth:function(){var t=this.month,e=this.year;this.month<11?t++:(t=0,e++,this.$emit("year-change",e)),this.$emit("month-change",t)},changeView:function(){this.$emit("view-change","m")}}},vd=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("table",{staticStyle:{width:"100%"},attrs:{role:"grid"}},[i("thead",[i("tr",[i("td",[i("btn",{staticClass:"uiv-datepicker-pager-prev",staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goPrevMonth}},[i("i",{class:t.iconControlLeft})])],1),t._v(" "),i("td",{attrs:{colspan:t.weekNumbers?6:5}},[i("btn",{staticClass:"uiv-datepicker-title",staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.changeView}},[i("b",[t._v(t._s(t.yearMonthStr))])])],1),t._v(" "),i("td",[i("btn",{staticClass:"uiv-datepicker-pager-next",staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goNextMonth}},[i("i",{class:t.iconControlRight})])],1)]),t._v(" "),i("tr",{attrs:{align:"center"}},[t.weekNumbers?i("td"):t._e(),t._v(" "),t._l(t.weekDays,(function(e){return i("td",{attrs:{width:"14.2857142857%"}},[i("small",{staticClass:"uiv-datepicker-week"},[t._v(t._s(t.tWeekName(0===e?7:e)))])])}))],2)]),t._v(" "),i("tbody",t._l(t.monthDayRows,(function(e){return i("tr",[t.weekNumbers?i("td",{staticClass:"text-center",staticStyle:{"border-right":"1px solid #eee"}},[i("small",{staticClass:"text-muted"},[t._v(t._s(t.getWeekNumber(e[t.weekStartsWith])))])]):t._e(),t._v(" "),t._l(e,(function(e){return i("td",[i("btn",{class:e.classes,staticStyle:{border:"none"},attrs:{block:"",size:"sm","data-action":"select",type:t.getBtnType(e),disabled:e.disabled},on:{click:function(i){return t.select(e)}}},[i("span",{class:{"text-muted":t.month!==e.month},attrs:{"data-action":"select"}},[t._v(t._s(e.date))])])],1)}))],2)})),0)])};vd._withStripped=!0;var yd=gd({render:vd,staticRenderFns:[]},undefined,md,undefined,false,undefined,!1,void 0,void 0,void 0),_d={components:{Btn:cd},mixins:[td],props:{month:Number,year:Number,iconControlLeft:String,iconControlRight:String},data:function(){return{rows:[]}},mounted:function(){for(var t=0;t<4;t++){this.rows.push([]);for(var e=0;e<3;e++)this.rows[t].push(3*t+e+1)}},methods:{tCell:function(t){return this.t("uiv.datePicker.month"+t)},getBtnClass:function(t){return t===this.month?"primary":"default"},goPrevYear:function(){this.$emit("year-change",this.year-1)},goNextYear:function(){this.$emit("year-change",this.year+1)},changeView:function(t){Xc(t)?(this.$emit("month-change",t),this.$emit("view-change","d")):this.$emit("view-change","y")}}},bd=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("table",{staticStyle:{width:"100%"},attrs:{role:"grid"}},[i("thead",[i("tr",[i("td",[i("btn",{staticClass:"uiv-datepicker-pager-prev",staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goPrevYear}},[i("i",{class:t.iconControlLeft})])],1),t._v(" "),i("td",{attrs:{colspan:"4"}},[i("btn",{staticClass:"uiv-datepicker-title",staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:function(e){return t.changeView()}}},[i("b",[t._v(t._s(t.year))])])],1),t._v(" "),i("td",[i("btn",{staticClass:"uiv-datepicker-pager-next",staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goNextYear}},[i("i",{class:t.iconControlRight})])],1)])]),t._v(" "),i("tbody",t._l(t.rows,(function(e,n){return i("tr",t._l(e,(function(e,r){return i("td",{attrs:{colspan:"2",width:"33.333333%"}},[i("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm",type:t.getBtnClass(3*n+r)},on:{click:function(e){return t.changeView(3*n+r)}}},[i("span",[t._v(t._s(t.tCell(e)))])])],1)})),0)})),0)])};bd._withStripped=!0;var wd=gd({render:bd,staticRenderFns:[]},undefined,_d,undefined,false,undefined,!1,void 0,void 0,void 0),xd={components:{Btn:cd},props:{year:Number,iconControlLeft:String,iconControlRight:String},computed:{rows:function(){for(var t=[],e=this.year-this.year%20,i=0;i<4;i++){t.push([]);for(var n=0;n<5;n++)t[i].push(e+5*i+n)}return t},yearStr:function(){var t=this.year-this.year%20;return t+" ~ "+(t+19)}},methods:{getBtnClass:function(t){return t===this.year?"primary":"default"},goPrevYear:function(){this.$emit("year-change",this.year-20)},goNextYear:function(){this.$emit("year-change",this.year+20)},changeView:function(t){this.$emit("year-change",t),this.$emit("view-change","m")}}},Sd=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("table",{staticStyle:{width:"100%"},attrs:{role:"grid"}},[i("thead",[i("tr",[i("td",[i("btn",{staticClass:"uiv-datepicker-pager-prev",staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goPrevYear}},[i("i",{class:t.iconControlLeft})])],1),t._v(" "),i("td",{attrs:{colspan:"3"}},[i("btn",{staticClass:"uiv-datepicker-title",staticStyle:{border:"none"},attrs:{block:"",size:"sm"}},[i("b",[t._v(t._s(t.yearStr))])])],1),t._v(" "),i("td",[i("btn",{staticClass:"uiv-datepicker-pager-next",staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goNextYear}},[i("i",{class:t.iconControlRight})])],1)])]),t._v(" "),i("tbody",t._l(t.rows,(function(e){return i("tr",t._l(e,(function(e){return i("td",{attrs:{width:"20%"}},[i("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm",type:t.getBtnClass(e)},on:{click:function(i){return t.changeView(e)}}},[i("span",[t._v(t._s(e))])])],1)})),0)})),0)])};Sd._withStripped=!0;var Cd={mixins:[td],components:{DateView:yd,MonthView:wd,YearView:gd({render:Sd,staticRenderFns:[]},undefined,xd,undefined,false,undefined,!1,void 0,void 0,void 0),Btn:cd},props:{value:null,width:{type:Number,default:270},todayBtn:{type:Boolean,default:!0},clearBtn:{type:Boolean,default:!0},closeOnSelected:{type:Boolean,default:!0},limitFrom:null,limitTo:null,format:{type:String,default:"yyyy-MM-dd"},initialView:{type:String,default:"d"},dateParser:{type:Function,default:Date.parse},dateClass:Function,yearMonthFormatter:Function,weekStartsWith:{type:Number,default:0,validator:function(t){return t>=0&&t<=6}},weekNumbers:Boolean,iconControlLeft:{type:String,default:"glyphicon glyphicon-chevron-left"},iconControlRight:{type:String,default:"glyphicon glyphicon-chevron-right"}},data:function(){return{show:!1,now:new Date,currentMonth:0,currentYear:0,view:"d"}},computed:{valueDateObj:function(){var t=this.dateParser(this.value);if(isNaN(t))return null;var e=new Date(t);return 0!==e.getHours()&&(e=new Date(t+60*e.getTimezoneOffset()*1e3)),e},pickerStyle:function(){return{width:this.width+"px"}},pickerClass:function(){return{"uiv-datepicker":!0,"uiv-datepicker-date":"d"===this.view,"uiv-datepicker-month":"m"===this.view,"uiv-datepicker-year":"y"===this.view}},limit:function(){var t={};if(this.limitFrom){var e=this.dateParser(this.limitFrom);isNaN(e)||((e=pd(new Date(e))).setHours(0,0,0,0),t.from=e)}if(this.limitTo){var i=this.dateParser(this.limitTo);isNaN(i)||((i=pd(new Date(i))).setHours(0,0,0,0),t.to=i)}return t}},mounted:function(){this.value?this.setMonthAndYearByValue(this.value):(this.currentMonth=this.now.getMonth(),this.currentYear=this.now.getFullYear(),this.view=this.initialView)},watch:{value:function(t,e){this.setMonthAndYearByValue(t,e)}},methods:{setMonthAndYearByValue:function(t,e){var i=this.dateParser(t);if(!isNaN(i)){var n=new Date(i);0!==n.getHours()&&(n=new Date(i+60*n.getTimezoneOffset()*1e3)),this.limit&&(this.limit.from&&n=this.limit.to)?this.$emit("input",e||""):(this.currentMonth=n.getMonth(),this.currentYear=n.getFullYear())}},onMonthChange:function(t){this.currentMonth=t},onYearChange:function(t){this.currentYear=t,this.currentMonth=void 0},onDateChange:function(t){if(t&&Hc(t.date)&&Hc(t.month)&&Hc(t.year)){var e=new Date(t.year,t.month,t.date);this.$emit("input",this.format?function(t,e){try{var i=t.getFullYear(),n=t.getMonth()+1,r=t.getDate(),o=fd[n-1];return e.replace(/yyyy/g,i).replace(/MMMM/g,o).replace(/MMM/g,o.substring(0,3)).replace(/MM/g,dd(n,2)).replace(/dd/g,dd(r,2)).replace(/yy/g,i).replace(/M(?!a)/g,n).replace(/d/g,r)}catch(t){return""}}(e,this.format):e),this.currentMonth=t.month,this.currentYear=t.year}else this.$emit("input","")},onViewChange:function(t){this.view=t},selectToday:function(){this.view="d",this.onDateChange({date:this.now.getDate(),month:this.now.getMonth(),year:this.now.getFullYear()})},clearSelect:function(){this.currentMonth=this.now.getMonth(),this.currentYear=this.now.getFullYear(),this.view=this.initialView,this.onDateChange()},onPickerClick:function(t){"select"===t.target.getAttribute("data-action")&&this.closeOnSelected||t.stopPropagation()}}},Td=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{class:t.pickerClass,style:t.pickerStyle,attrs:{"data-role":"date-picker"},on:{click:t.onPickerClick}},[i("date-view",{directives:[{name:"show",rawName:"v-show",value:"d"===t.view,expression:"view==='d'"}],attrs:{month:t.currentMonth,year:t.currentYear,date:t.valueDateObj,today:t.now,limit:t.limit,"week-starts-with":t.weekStartsWith,"icon-control-left":t.iconControlLeft,"icon-control-right":t.iconControlRight,"date-class":t.dateClass,"year-month-formatter":t.yearMonthFormatter,"week-numbers":t.weekNumbers,locale:t.locale},on:{"month-change":t.onMonthChange,"year-change":t.onYearChange,"date-change":t.onDateChange,"view-change":t.onViewChange}}),t._v(" "),i("month-view",{directives:[{name:"show",rawName:"v-show",value:"m"===t.view,expression:"view==='m'"}],attrs:{month:t.currentMonth,year:t.currentYear,"icon-control-left":t.iconControlLeft,"icon-control-right":t.iconControlRight,locale:t.locale},on:{"month-change":t.onMonthChange,"year-change":t.onYearChange,"view-change":t.onViewChange}}),t._v(" "),i("year-view",{directives:[{name:"show",rawName:"v-show",value:"y"===t.view,expression:"view==='y'"}],attrs:{year:t.currentYear,"icon-control-left":t.iconControlLeft,"icon-control-right":t.iconControlRight},on:{"year-change":t.onYearChange,"view-change":t.onViewChange}}),t._v(" "),t.todayBtn||t.clearBtn?i("div",[i("br"),t._v(" "),i("div",{staticClass:"text-center"},[t.todayBtn?i("btn",{attrs:{"data-action":"select",type:"info",size:"sm"},domProps:{textContent:t._s(t.t("uiv.datePicker.today"))},on:{click:t.selectToday}}):t._e(),t._v(" "),t.clearBtn?i("btn",{attrs:{"data-action":"select",size:"sm"},domProps:{textContent:t._s(t.t("uiv.datePicker.clear"))},on:{click:t.clearSelect}}):t._e()],1)]):t._e()],1)};Td._withStripped=!0;const Ed=Sl({props:{placeholder:{type:String,default:""},value:{type:String,default:""}},components:{dropdown:Xh,datePicker:gd({render:Td,staticRenderFns:[]},undefined,Cd,undefined,false,undefined,!1,void 0,void 0,void 0)},data:function(){return{internalValue:""}},watch:{internalValue:function(t){this.$emit("input",t)},value:function(t){this.internalValue=t}},created:function(){this.internalValue=this.value}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("dropdown",[i("div",{staticClass:"input-group"},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.internalValue,expression:"internalValue"}],staticClass:"form-control",attrs:{type:"text",placeholder:t.placeholder},domProps:{value:t.internalValue},on:{input:function(e){e.target.composing||(t.internalValue=e.target.value)}}}),t._v(" "),i("div",{staticClass:"input-group-btn"},[i("button",{staticClass:"btn btn-default dropdown-toggle",attrs:{type:"button"}},[i("i",{staticClass:"fa fa-calendar"})])])]),t._v(" "),i("template",{slot:"dropdown"},[i("li",[i("date-picker",{attrs:{"icon-control-left":"fa fa-chevron-left","icon-control-right":"fa fa-chevron-right"},model:{value:t.internalValue,callback:function(e){t.internalValue=e},expression:"internalValue"}})],1)])],2)}),[],!1,null,null,null).exports;const Id=Sl({mixins:[lu,au],data:function(){return{volumeId:null,sessions:null,editedSession:{name:null,description:null,starts_at_iso8601:null,starts_at:null,ends_at_iso8601:null,ends_at:null,hide_other_users_annotations:!1,hide_own_annotations:!1,users:[]},users:[],errors:{}}},components:{typeahead:Hl,listItem:Gc,userTag:Wc,datepickerDropdown:Ed},computed:{classObject:function(){return{"panel-warning panel--editing":this.editing}},hasSessions:function(){return this.sessions.length>0},hasNewSession:function(){return void 0===this.editedSession.id},availableUsers:function(){var t=this.editedSession.users.map((function(t){return t.id}));return this.users.filter((function(e){return-1===t.indexOf(e.id)}))},orderedSessions:function(){return this.sessions.slice().sort((function(t,e){return e.starts_at_iso8601.getTime()-t.starts_at_iso8601.getTime()}))}},methods:{clone:function(t){return JSON.parse(JSON.stringify(t))},submit:function(t){var e=this;if(!this.loading){this.startLoading();var i=this.editedSession;if(this.hasNewSession)qc.save({volume_id:this.volumeId},this.packSession(i)).then(this.sessionSaved).catch(this.handleErrorResponse).finally(this.finishLoading);else{var n={id:i.id};!0===t&&(n.force=1),qc.update(n,this.packSession(i)).then((function(){return e.sessionUpdated(i)})).catch(this.handleConfirm("Use the Force and update the annotation session?",this.submit)).finally(this.finishLoading)}}},sessionUpdated:function(t){for(var e=this.sessions.length-1;e>=0;e--)this.sessions[e].id===t.id&&(this.sessions.splice(e,1,t),this.clearEditedSession())},sessionSaved:function(t){this.sessions.push(this.parseSession(t.data)),this.clearEditedSession()},packSession:function(t){return(t=this.clone(t)).users=t.users.map((function(t){return t.id})),t.starts_at=t.starts_at_iso8601,t.ends_at=t.ends_at_iso8601,delete t.starts_at_iso8601,delete t.ends_at_iso8601,t},handleConfirm:function(t,e){var i=this;return function(n){400===n.status?(i.finishLoading(),confirm(n.data.message+" "+t)&&e(!0)):i.handleErrorResponse(n)}},handleErrorResponse:function(t){422===t.status?this.errors=t.data.errors:ou(t)},hasError:function(t){return this.errors.hasOwnProperty(t)},getError:function(t){return this.errors[t].join(" ")},editSession:function(t){this.editedSession=this.clone(t)},deleteSession:function(t){var e=this;if(!this.loading&&!this.hasNewSession&&(!0===t||confirm("Are you sure you want to delete the annotation session '".concat(this.editedSession.name,"'?")))){this.startLoading();var i=this.editedSession.id,n={id:i};!0===t&&(n.force=1),qc.delete(n).then((function(){return e.sessionDeleted(i)})).catch(this.handleConfirm("Use the Force and delete the annotation session?",this.deleteSession)).finally(this.finishLoading)}},sessionDeleted:function(t){for(var e=this.sessions.length-1;e>=0;e--)if(this.sessions[e].id===t)return this.sessions.splice(e,1),void this.clearEditedSession()},clearEditedSession:function(){this.editedSession={name:null,description:null,starts_at_iso8601:null,starts_at:null,ends_at_iso8601:null,ends_at:null,hide_other_users_annotations:!1,hide_own_annotations:!1,users:[]}},loadUsers:function(){Dc.queryUsers({id:this.volumeId}).then(this.usersLoaded,ou)},usersLoaded:function(t){t.data.forEach((function(t){t.name=t.firstname+" "+t.lastname})),Vue.set(this,"users",t.data)},selectUser:function(t){this.editedSession.users.push(t)},removeUser:function(t){for(var e=this.editedSession.users.length-1;e>=0;e--)this.editedSession.users[e].id===t.id&&this.editedSession.users.splice(e,1)},stringifyDate:function(t){var e=t.getMonth()+1;return e=e<10?"0"+e:e,t.getFullYear()+"-"+e+"-"+t.getDate()},parseDate:function(t){if(t)return t=t.split("-"),new Date(t[0],t[1]-1,t[2])},parseSession:function(t){var e=new Date(t.starts_at_iso8601);return t.starts_at_iso8601=e,t.starts_at=this.stringifyDate(e),e=new Date(t.ends_at_iso8601),t.ends_at_iso8601=e,t.ends_at=this.stringifyDate(e),t}},watch:{editedSession:function(){this.errors={}},loading:function(t){t&&(this.errors={})},"editedSession.starts_at":function(t){this.editedSession.starts_at_iso8601=this.parseDate(t)},"editedSession.ends_at":function(t){this.editedSession.ends_at_iso8601=this.parseDate(t)}},created:function(){this.volumeId=biigle.$require("volumes.id"),this.sessions=biigle.$require("volumes.annotationSessions").map(this.parseSession),this.$once("editing.start",this.loadUsers)}},undefined,undefined,!1,null,null,null).exports,Ad=Vue.resource("api/v1/volumes/browser/directories{/disk}",{},{getImages:{method:"GET",url:"api/v1/volumes/browser/images{/disk}"},getVideos:{method:"GET",url:"api/v1/volumes/browser/videos{/disk}"}});const Pd=Sl({mixins:[lu],data:function(){return{disks:[],url:null,mediaType:"",filenames:null,browsing:!1,storageDisk:null,breadCrumbs:[],currentDirectories:[],loadingBrowser:!1,directoryCache:{},fileCache:{}}},computed:{showFilenameWarning:function(){return this.filenames.includes(".tif")},hasDirectories:function(){return this.currentDirectories.length>0},buttonClass:function(){return{"btn-info":this.browsing}},canGoBack:function(){return this.breadCrumbs.length>0||this.disks.length>1},hasCurrentDirectory:function(){return this.breadCrumbs.length>0},currentDirectory:function(){return this.hasCurrentDirectory?this.breadCrumbs[this.breadCrumbs.length-1]:null},isImageMediaType:function(){return"image"===this.mediaType},isVideoMediaType:function(){return"video"===this.mediaType}},methods:{toggleBrowse:function(){this.browsing=!this.browsing},fetchDirectories:function(t,e){var i=this,n=t+"://"+e;if(!this.directoryCache.hasOwnProperty(n)){this.loadingBrowser=!0;var r=Ad.get({disk:t,path:e});r.finally((function(){return i.loadingBrowser=!1})),this.directoryCache[n]=r}return this.directoryCache[n]},showDirectories:function(t){this.currentDirectories=t.body},openDirectory:function(t){this.breadCrumbs.push(t)},goBack:function(){this.breadCrumbs.length>0?this.breadCrumbs.pop():this.disks.length>1&&(this.storageDisk=null)},goTo:function(t){t>=-1&&t=0;e--)t.data[e].isNew=!0,this.files.push(t.data[e]);this.filenames=""},handleRemove:function(t){var e=this;!this.loading&&confirm("Are you sure that you want to delete the ".concat(this.type," #").concat(t.id," (").concat(t.filename,")?"))&&(this.startLoading(),this.fileApi.delete({id:t.id}).then((function(){return e.fileRemoved(t.id)})).catch((function(i){if(422!==i.status)throw i;if(confirm("The ".concat(e.type," contains annotations. Proceed to delete the ").concat(e.type,"?")))return e.fileApi.delete({id:t.id},{force:!0}).then((function(){return e.fileRemoved(t.id)}))})).catch(ou).finally(this.finishLoading))},fileRemoved:function(t){for(var e=this.files,i=e.length-1;i>=0;i--)if(e[i].id===t)return void e.splice(i,1)},handleErrorResponse:function(t){422===t.status?this.errors=t.data.errors:ou(t)},hasError:function(t){return this.errors.hasOwnProperty(t)},getError:function(t){return this.errors[t].join("\n")},setFiles:function(t){for(var e in t.body)t.body.hasOwnProperty(e),this.files.push({id:e,filename:t.body[e]})}},watch:{loading:function(t){t&&(this.errors={})}},created:function(){this.volumeId=biigle.$require("volumes.id"),this.type=biigle.$require("volumes.type"),this.startLoading(),Dc.queryFilenames({id:this.volumeId}).then(this.setFiles,ou).finally(this.finishLoading)}},undefined,undefined,!1,null,null,null).exports,Od=Vue.resource("api/v1/volumes{/id}/images/metadata");const $d=Sl({mixins:[lu],data:function(){return{volumeId:null,csv:void 0,error:!1,success:!1,message:void 0}},methods:{handleSuccess:function(){this.error=!1,this.success=!0},handleError:function(t){this.success=!1,t.data.file?Array.isArray(t.data.file)?this.error=t.data.file[0]:this.error=t.data.file:ou(t)},submit:function(){if(this.csv){this.startLoading();var t=new FormData;t.append("file",this.csv),Od.save({id:this.volumeId},t).bind(this).then(this.handleSuccess,this.handleError).finally(this.finishLoading)}},setCsv:function(t){this.csv=t.target.files[0]}},created:function(){this.volumeId=biigle.$require("volumes.id")}},undefined,undefined,!1,null,null,null).exports;const Dd=Sl(new Vue({components:{dropdown:Xh}}),undefined,undefined,!1,null,null,null).exports;const jd=Sl({components:{previewThumbnail:Sc}},undefined,undefined,!1,null,null,null).exports;function Nd(t){return(Nd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}const Bd=Sl({mixins:[lu],components:{powerToggle:El},props:{volumeId:{type:Number,required:!0},type:{type:String,required:!0},fileIds:{type:Array,required:!0},showFilenames:{type:Boolean,default:!1},loadingFilenames:{type:Boolean,default:!1}},data:function(){return{rules:[],selectedFilterId:null,negate:!1,mode:"filter",operator:"and"}},computed:{filters:function(){var t=this;return jc.filter((function(e){return e.types&&e.types.includes(t.type)}))},selectedFilter:function(){return this.getFilter(this.selectedFilterId)},hasSelectComponent:function(){return this.selectedFilter&&this.selectedFilter.selectComponent},selectComponent:function(){return this.selectedFilter.selectComponent},hasRules:function(){return this.rules.length>0},sequence:function(){if(!this.hasRules)return this.fileIds;var t={},e={},i=0,n=0;return this.rules.forEach((function(r){r.negate?(i++,r.sequence.forEach((function(t){e[t]=e[t]+1||1}))):(n++,r.sequence.forEach((function(e){t[e]=t[e]+1||1})))})),"and"===this.operator?n>0?this.fileIds.filter((function(i){return t[i]===n&&!e.hasOwnProperty(i)})):this.fileIds.filter((function(t){return!e.hasOwnProperty(t)})):i>0?this.fileIds.filter((function(n){return t.hasOwnProperty(n)||e[n]!==i})):this.fileIds.filter((function(e){return t.hasOwnProperty(e)}))},inFilterMode:function(){return"filter"===this.mode},inFlagMode:function(){return"flag"===this.mode},usesAndOperator:function(){return"and"===this.operator},usesOrOperator:function(){return"or"===this.operator},helpText:function(){return this.selectedFilter?this.selectedFilter.help.replace(":type",this.type):null},rulesStorageKey:function(){return"biigle.volumes.".concat(this.volumeId,".filter2.rules")},modeStorageKey:function(){return"biigle.volumes.".concat(this.volumeId,".filter2.mode")},operatorStorageKey:function(){return"biigle.volumes.".concat(this.volumeId,".filter2.operator")},typeText:function(){return nu(this.type)+"s"}},methods:{filterValid:function(t){return"string"==typeof t.id&&"string"==typeof t.label&&"object"===Nd(t.listComponent)&&"function"==typeof t.getSequence},getFilter:function(t){for(var e=this.filters.length-1;e>=0;e--)if(this.filters[e].id===t)return this.filters[e];return null},hasRule:function(t){return-1!==this.rules.findIndex((function(e){return e.id===t.id&&e.negate===t.negate&&e.data===t.data}))},addRule:function(t){var e=this;if(this.selectedFilter){var i={id:this.selectedFilter.id,data:t,negate:this.negate};this.hasRule(i)||(this.startLoading(),this.selectedFilter.getSequence(this.volumeId,t).catch(ou).then((function(t){return e.ruleAdded(i,t)})).finally(this.finishLoading))}},refreshRule:function(t){var e=this.getFilter(t.id);e&&(this.startLoading(),e.getSequence(this.volumeId,t.data).catch(ou).then((function(e){return t.sequence=e.data})).finally(this.finishLoading))},ruleAdded:function(t,e){t.sequence=e.data,this.rules.push(t)},removeRule:function(t){this.rules.splice(t,1)},reset:function(){this.rules=[],this.selectedFilterId=null,this.negate=!1,this.mode="filter",this.operator="and"},activateFilterMode:function(){this.mode="filter"},activateFlagMode:function(){this.mode="flag"},activateAndOperator:function(){this.operator="and"},activateOrOperator:function(){this.operator="or"},emitUpdate:function(){this.$emit("update",this.sequence,this.mode,this.hasRules)},getListComponent:function(t){for(var e=this.filters.length-1;e>=0;e--)if(this.filters[e].id===t.id)return this.filters[e].listComponent},enableFilenames:function(){this.$emit("enable-filenames")},disableFilenames:function(){this.$emit("disable-filenames")}},watch:{sequence:function(){this.emitUpdate()},mode:function(){this.emitUpdate(),"filter"!==this.mode?localStorage.setItem(this.modeStorageKey,this.mode):localStorage.removeItem(this.modeStorageKey)},operator:function(){this.emitUpdate(),"and"!==this.operator?localStorage.setItem(this.operatorStorageKey,this.operator):localStorage.removeItem(this.operatorStorageKey)},rules:{handler:function(){this.rules.length>0?localStorage.setItem(this.rulesStorageKey,JSON.stringify(this.rules)):localStorage.removeItem(this.rulesStorageKey)},deep:!0}},created:function(){for(var t,e=0;e0}},methods:{canDelete:function(t){return!0===this.isAdmin||this.userId===t.user.id},emitDeleted:function(t){this.$emit("deleted",t)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("ul",{staticClass:"file-label-list"},[t._l(t.fileLabels,(function(e){return i("list-item",{key:e.id,attrs:{item:e,deletable:t.canDelete(e),type:t.type},on:{deleted:t.emitDeleted}})})),t._v(" "),t.hasImageLabels?t._e():i("li",{staticClass:"text-muted"},[t._v("No "+t._s(t.type)+" labels")])],2)}),[],!1,null,null,null).exports;var qd=Sl({mixins:[Nc,lu],components:{fileLabelList:Gd,previewThumbnail:Sc},data:function(){return{userId:null,isAdmin:!1,attachingSuccess:null,timeout:null,saving:!1,showAnnotationRoute:null}},props:{selectedLabel:{type:Object,default:null},showFilename:{type:Boolean,default:!1},showLabels:{type:Boolean,default:!1},type:{type:String,default:"image"}},computed:{alreadyHasSelectedLabel:function(){var t=this.selectedLabel;return this.image.labels.reduce((function(e,i){return e||t.id===i.label_id}),!1)},showAnnotationLink:function(){return this.showAnnotationRoute?this.showAnnotationRoute+this.image.id:""},selected:function(){return this.image.flagged},canBeSelected:function(){return this.selectable&&this.selectedLabel&&!this.alreadyHasSelectedLabel&&!this.saving},classObject:function(){return{"image-grid__image--selected":this.selected,"image-grid__image--selectable":this.canBeSelected,"image-grid__image--saving":this.selectable&&this.saving,"image-grid__image--success":!0===this.attachingSuccess,"image-grid__image--error":!1===this.attachingSuccess}},title:function(){return this.canBeSelected?"Attach "+this.selectedLabel.name:""},linkTitle:function(){return"Annotate this ".concat(this.type)}},methods:{handleClick:function(){var t=this;this.canBeSelected&&(this.saving=!0,("image"===this.type?Ud.save({image_id:this.image.id},{label_id:this.selectedLabel.id}):zd.save({video_id:this.image.id},{label_id:this.selectedLabel.id})).then(this.labelAttached,this.attachingFailed).finally(this.resetSuccess).finally((function(){return t.saving=!1})))},labelAttached:function(t){this.attachingSuccess=!0,this.image.labels.push(t.data)},attachingFailed:function(t){this.attachingSuccess=!1,ou(t)},resetSuccess:function(){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.attachingSuccess=null}),3e3)},removeImageLabel:function(t){var e=this.image.labels.indexOf(t);-1!==e&&this.image.labels.splice(e,1)}},created:function(){this.userId=biigle.$require("volumes.userId"),this.isAdmin=biigle.$require("volumes.isAdmin"),this.showAnnotationRoute=biigle.$require("largo.showAnnotationRoute")}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"image-grid__image image-grid__image--volume",class:t.classObject,attrs:{title:t.title}},[!t.selectable&&t.image.annotateUrl?i("a",{staticClass:"image-link",attrs:{href:t.image.annotateUrl,title:t.linkTitle}},[i("preview-thumbnail",{attrs:{id:t.image.id,"thumb-uris":t.image.thumbnailUrl}},[i("img",{attrs:{src:t.srcUrl},on:{error:t.showEmptyImage}})])],1):i("preview-thumbnail",{attrs:{id:t.image.id,"thumb-uris":t.image.thumbnailUrl},on:{click:t.handleClick}},[i("img",{attrs:{src:t.srcUrl},on:{error:t.showEmptyImage}})]),t._v(" "),t.showFilename?i("span",{staticClass:"image-filename",attrs:{title:t.image.filename},domProps:{textContent:t._s(t.image.filename)}}):t._e(),t._v(" "),i("div",{staticClass:"image-buttons"},[t.image.infoUrl?i("a",{staticClass:"image-button",attrs:{href:t.image.infoUrl,title:"View image information"}},[i("span",{staticClass:"fa fa-info-circle",attrs:{"aria-hidden":"true"}})]):t._e()]),t._v(" "),t.showLabels?i("div",{staticClass:"image-labels",on:{wheel:function(t){t.stopPropagation()}}},[i("file-label-list",{attrs:{"file-labels":t.image.labels,"user-id":t.userId,"is-admin":t.isAdmin,type:t.type},on:{deleted:t.removeImageLabel}})],1):t._e()],1)}),[],!1,null,null,null);const Wd=Sl({mixins:[Uc],components:{imageGridImage:qd.exports},props:{selectedLabel:{type:Object,default:null},showFilenames:{type:Boolean,default:!1},showLabels:{type:Boolean,default:!1},type:{type:String,default:"image"}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"image-grid",on:{wheel:function(e){return e.preventDefault(),t.scroll(e)}}},[i("div",{ref:"images",staticClass:"image-grid__images"},t._l(t.displayedImages,(function(e){return i("image-grid-image",{key:e.id,attrs:{image:e,"empty-url":t.emptyUrl,"selected-label":t.selectedLabel,selectable:t.selectable,"selected-fade":!1,"show-filename":t.showFilenames,"show-labels":t.showLabels,type:t.type},on:{select:t.emitSelect}})})),1),t._v(" "),t.canScroll?i("image-grid-progress",{attrs:{progress:t.progress},on:{top:t.jumpToStart,"prev-page":t.reversePage,"prev-row":t.reverseRow,jump:t.jumpToPercent,"next-row":t.advanceRow,"next-page":t.advancePage,bottom:t.jumpToEnd}}):t._e()],1)}),[],!1,null,null,null).exports;const Kd=Sl({mixins:[lu],components:{labelTrees:Jh,powerToggle:El},props:{volumeId:{type:Number,required:!0},showLabels:{type:Boolean,default:!1},loadingLabels:{type:Boolean,default:!1}},data:function(){return{labelTrees:[]}},methods:{handleSelectedLabel:function(t){this.$emit("select",t)},handleDeselectedLabel:function(t){this.$emit("deselect",t)},enableLabels:function(){this.$emit("enable-labels")},disableLabels:function(){this.$emit("disable-labels")}},created:function(){this.labelTrees=biigle.$require("volumes.labelTrees")}},undefined,undefined,!1,null,null,null).exports;const Xd=Sl({mixins:[lu],props:{volumeId:{type:Number,required:!0},type:{type:String,required:!0},fileIds:{type:Array,required:!0}},data:function(){return{direction:!0,activeSorter:null,privateSequence:[]}},computed:{sorters:function(){var t=this;return Vc.filter((function(e){return e.types&&e.types.includes(t.type)}))},defaultSorter:function(){return this.sorters[0]},isActive:function(){return this.activeSorter!==this.defaultSorter.id||!this.direction},isSortedAscending:function(){return this.direction},isSortedDescending:function(){return!this.direction},sorterStorageKey:function(){return"biigle.volumes.".concat(this.volumeId,".sorting2.sorter")},directionStorageKey:function(){return"biigle.volumes.".concat(this.volumeId,".sorting2.direction")},sequence:function(){return this.direction?this.privateSequence:this.privateSequence.slice().reverse()}},methods:{reset:function(){this.direction=!0,this.activeSorter=this.defaultSorter.id,this.privateSequence=biigle.$require("volumes.fileIds")},sortAscending:function(){this.direction=!0},sortDescending:function(){this.direction=!1},handleSelect:function(t){var e=this;this.loading||(this.startLoading(),t.getSequence().then((function(i){e.activeSorter=t.id,e.privateSequence=i})).catch(ou).finally(this.finishLoading))},isValidSequence:function(t){for(var e={},i=this.fileIds,n=t.length-1;n>=0;n--)e[t[n]]=!0;for(var r=i.length-1;r>=0;r--)if(!e.hasOwnProperty(i[r]))return!1;return!0}},watch:{sequence:function(){this.$emit("update",this.sequence,this.isActive)},privateSequence:function(){this.activeSorter===this.defaultSorter.id?localStorage.removeItem(this.sorterStorageKey):localStorage.setItem(this.sorterStorageKey,JSON.stringify({id:this.activeSorter,sequence:this.privateSequence}))},direction:function(){this.direction?localStorage.removeItem(this.directionStorageKey):localStorage.setItem(this.directionStorageKey,this.direction)}},created:function(){this.privateSequence=biigle.$require("volumes.fileIds");var t=JSON.parse(localStorage.getItem(this.sorterStorageKey));t&&this.isValidSequence(t.sequence)?(this.activeSorter=t.id,this.privateSequence=t.sequence):(this.activeSorter=this.defaultSorter.id,localStorage.removeItem(this.sorterStorageKey));var e=JSON.parse(localStorage.getItem(this.directionStorageKey));null!==e&&(this.direction=e)}},undefined,undefined,!1,null,null,null).exports;var Yd=function(t){return t[0]+t[1]+"/"+t[2]+t[3]+"/"+t};const Hd=Sl({mixins:[lu],components:{sidebar:kl,sidebarTab:Rl,imageGrid:Wd,filterTab:Bd,sortingTab:Xd,labelsTab:Kd},data:function(){return{fileIds:[],files:[],filterSequence:[],filterMode:null,filterActive:!1,sortingSequence:[],sortingActive:!1,volumeId:null,imageLabelMode:!1,selectedLabel:null,loadingFilenames:!1,showFilenames:!1,filenamesPromise:null,loadingLabels:!1,showLabels:!1,labelsPromise:null,settings:null,type:null}},computed:{sortingMap:function(){var t={};return this.sortingSequence.forEach((function(e,i){t[e]=i})),t},sortedFiles:function(){var t=this.sortingMap,e=[];return this.files.forEach((function(i){e[t[i.id]]=i})),e},filterMap:function(){var t={};return this.filterSequence.forEach((function(e){t[e]=null})),t},filesToShow:function(){var t=this.filterMap;return"flag"===this.filterMode?this.sortedFiles.map((function(e){return e.flagged=t.hasOwnProperty(e.id),e})):this.sortedFiles.filter((function(e){return e.flagged=!1,t.hasOwnProperty(e.id)}))},fileIdsToShow:function(){return this.filesToShow.map((function(t){return t.id}))},filesStorageKey:function(){return"biigle.volumes.".concat(this.volumeId,".files")},offsetStorageKey:function(){return"biigle.volumes.".concat(this.volumeId,".offset")},initialOffset:function(){return parseInt(Ql.get("offset"))||parseInt(localStorage.getItem(this.offsetStorageKey))||0},filterEmpty:function(){return this.filterActive&&"flag"!==this.filterMode&&0===this.filterSequence.length}},methods:{handleSidebarToggle:function(){var t=this;this.$nextTick((function(){return t.$refs.imageGrid.$emit("resize")}))},handleSidebarOpen:function(t){this.imageLabelMode="labels"===t},handleSidebarClose:function(){this.imageLabelMode=!1},toggleLoading:function(t){t?this.startLoading():this.finishLoading()},updateFilterSequence:function(t,e,i){this.filterSequence=t,this.filterMode=e,this.filterActive=i},handleScroll:function(t){t>0?(Ql.set({offset:t}),localStorage.setItem(this.offsetStorageKey,t)):(Ql.unset("offset"),localStorage.removeItem(this.offsetStorageKey))},handleSelectedLabel:function(t){this.selectedLabel=t},handleDeselectedLabel:function(){this.selectedLabel=null},updateSortingSequence:function(t,e){this.sortingSequence=t,this.sortingActive=e},enableFilenames:function(){var t=this;this.filenamesPromise||(this.loadingFilenames=!0,this.filenamesPromise=Dc.queryFilenames({id:this.volumeId}).then(this.setFilenames).finally((function(){return t.loadingFilenames=!1}))),this.filenamesPromise.then((function(){return t.showFilenames=!0}))},disableFilenames:function(){this.showFilenames=!1},setFilenames:function(t){this.files.forEach((function(e){e.filename=t.body[e.id]}))},enableLabels:function(){var t=this;this.labelsPromise||(this.loadingLabels=!0,this.labelsPromise=Dc.queryFileLabels({id:this.volumeId}).then(this.setLabels).finally((function(){return t.loadingLabels=!1}))),this.labelsPromise.then((function(){return t.showLabels=!0}))},disableLabels:function(){this.showLabels=!1},setLabels:function(t){this.files.forEach((function(e){e.labels=t.body[e.id]}))},restoreSettings:function(){!0===this.settings.get("showFilenames")&&this.enableFilenames(),!0===this.settings.get("showLabels")&&this.enableLabels()}},watch:{fileIdsToShow:function(t){var e=this.fileIds,i=t.length===e.length;if(i)for(var n=t.length-1;n>=0;n--)if(t[n]!==e[n]){i=!1;break}i?localStorage.removeItem(this.filesStorageKey):localStorage.setItem(this.filesStorageKey,JSON.stringify(t)),kd.count=t.length},showFilenames:function(t){this.settings.set("showFilenames",t)},showLabels:function(t){this.settings.set("showLabels",t)}},created:function(){this.type=biigle.$require("volumes.type"),this.fileIds=biigle.$require("volumes.fileIds"),this.filterSequence=this.fileIds,this.sortingSequence=this.fileIds,this.volumeId=biigle.$require("volumes.volumeId"),this.settings=new uu({data:{storageKey:"biigle.volumes.settings",defaults:{showFilenames:!1,showLabels:!1}}});var t=biigle.$require("volumes.fileUuids"),e=biigle.$require("volumes.thumbUri"),i=biigle.$require("volumes.thumbCount"),n=biigle.$require("volumes.annotateUri"),r=biigle.$require("volumes.infoUri");this.files=this.fileIds.map((function(o){var s;return s=i>1?Array.from(Array(i).keys()).map((function(i){return e.replace(":uuid",Yd(t[o])+"/"+i)})):e.replace(":uuid",Yd(t[o])),{id:o,thumbnailUrl:s,annotateUrl:n.replace(":id",o),infoUrl:r?r.replace(":id",o):void 0,flagged:!1,filename:null,labels:[]}})),this.restoreSettings()}},undefined,undefined,!1,null,null,null).exports;biigle.$mount("annotation-session-panel",Id),biigle.$mount("create-volume-form",Pd),biigle.$mount("file-panel",Md),biigle.$mount("projects-breadcrumb",Dd),biigle.$mount("search-results",jd),biigle.$mount("volume-container",Hd),biigle.$mount("volume-file-count",Rd),biigle.$mount("volume-metadata-upload",$d);const Zd="postrender",Jd="movestart",Qd="moveend";function tf(){return function(){throw new Error("Unimplemented abstract method.")}()}var ef=0;function nf(t){return t.ol_uid||(t.ol_uid=String(++ef))}var rf="5.3.1";const of="propertychange";var sf="function"==typeof Object.assign?Object.assign:function(t,e){var i=arguments;if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1,o=arguments.length;r0},e.prototype.removeEventListener=function(t,e){var i=this.listeners_[t];if(i){var n=i.indexOf(e);t in this.pendingRemovals_?(i[n]=xf,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t])}},e}(_f),If="change",Af="clear",Pf="contextmenu",kf="click",Rf="dblclick",Lf="error",Ff="keydown",Mf="keypress",Of="load",$f="mousedown",Df="mousewheel",jf="MSPointerDown",Nf="resize",Bf="touchstart",Uf="wheel";const zf=function(t){function e(){t.call(this),this.revision_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.changed=function(){++this.revision_,this.dispatchEvent(If)},e.prototype.getRevision=function(){return this.revision_},e.prototype.on=function(t,e){if(Array.isArray(t)){for(var i=t.length,n=new Array(i),r=0;rr&&(l|=xp),ao&&(l|=wp),l===_p&&(l=bp),l}function Fp(){return[1/0,1/0,-1/0,-1/0]}function Mp(t,e,i,n,r){return r?(r[0]=t,r[1]=e,r[2]=i,r[3]=n,r):[t,e,i,n]}function Op(t){return Mp(1/0,1/0,-1/0,-1/0,t)}function $p(t,e){var i=t[0],n=t[1];return Mp(i,n,i,n,e)}function Dp(t,e,i,n,r){return zp(Op(r),t,e,i,n)}function jp(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Np(t,e){return e[0]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function Bp(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function Up(t,e){for(var i=0,n=e.length;ie[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function ng(t){return t[2]0},showThis:function(){return this.show&&this.hasAnnotations}},methods:{updateAnnotations:function(t){this.annotations=t.map((function(t){return t.get("annotation")}))}},watch:{show:{immediate:!0,handler:function(t){t?this.$parent.$on(this.watch,this.updateAnnotations):this.$parent.$off(this.watch,this.updateAnnotations)}},position:function(t){this.overlay.setPosition(t)},showThis:function(t){t?this.$parent.map.addOverlay(this.overlay):this.$parent.map.removeOverlay(this.overlay)}},mounted:function(){this.overlay=new ug({element:this.$el,offset:[15,0],positioning:this.positioning})},beforeDestroy:function(){this.$parent.map.removeOverlay(this.overlay)}},undefined,undefined,!1,null,null,null).exports;const cg=Sl({mixins:[hg],computed:{annotationLabels:function(){return this.annotations.map((function(t){return t.labels.map((function(t){return t.label.name}))}))}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"annotation-tooltip"},[i("ul",{staticClass:"annotation-tooltip__annotations"},t._l(t.annotationLabels,(function(e){return i("li",[i("ul",{staticClass:"annotation-tooltip__labels"},t._l(e,(function(e){return i("li",{domProps:{textContent:t._s(e)}})})),0)])})),0)])}),[],!1,null,null,null).exports;const dg=Sl({props:{image:{required:!0},areas:{required:!0}},data:function(){return{unitMultipliers:[1e3,1,.01,.001,1e-6,1e-9],unitNames:["km","m","cm","mm","µm","nm"]}},computed:{area:function(){return this.areas&&this.image&&this.areas[this.image.id]||-1},hasArea:function(){return-1!==this.area},pxWidthInMeter:function(){return Math.sqrt(this.area/(this.image.width*this.image.height))}},methods:{powerOfTen:function(t){return Math.pow(10,Math.floor(Math.log10(t)))}}},undefined,undefined,!1,null,null,null).exports;function fg(t,e){return t>e?1:t=0}function gg(t,e,i){var n,r=t.length;if(t[0]<=e)return 0;if(e<=t[r-1])return r-1;if(i>0){for(n=1;n1?(i=r,n=o):l>0&&(i+=s*l,n+=a*l)}return jg(t,e,i,n)}function jg(t,e,i,n){var r=i-t,o=n-e;return r*r+o*o}function Ng(t){return t*Math.PI/180}function Bg(t,e){var i=t%e;return i*e<0?i+e:i}function Ug(t,e,i){return t+i*(e-t)}var zg=6371008.8;function Vg(t,e,i){var n=i||zg,r=Ng(t[1]),o=Ng(e[1]),s=(o-r)/2,a=Ng(e[0]-t[0])/2,l=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(r)*Math.cos(o);return 2*n*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}var Gg={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},qg={};qg[Gg.DEGREES]=2*Math.PI*6370997/360,qg[Gg.FEET]=.3048,qg[Gg.METERS]=1,qg[Gg.USFEET]=1200/3937;const Wg=Gg;var Kg=function(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit};Kg.prototype.canWrapX=function(){return this.canWrapX_},Kg.prototype.getCode=function(){return this.code_},Kg.prototype.getExtent=function(){return this.extent_},Kg.prototype.getUnits=function(){return this.units_},Kg.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||qg[this.units_]},Kg.prototype.getWorldExtent=function(){return this.worldExtent_},Kg.prototype.getAxisOrientation=function(){return this.axisOrientation_},Kg.prototype.isGlobal=function(){return this.global_},Kg.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},Kg.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},Kg.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},Kg.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},Kg.prototype.setWorldExtent=function(t){this.worldExtent_=t},Kg.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},Kg.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};const Xg=Kg;var Yg=6378137,Hg=Math.PI*Yg,Zg=[-Hg,-Hg,Hg,Hg],Jg=[-180,-85,180,85],Qg=function(t){function e(e){t.call(this,{code:e,units:Wg.METERS,extent:Zg,global:!0,worldExtent:Jg,getPointResolution:function(t,e){return t/$g(e[1]/Yg)}})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Xg),tm=[new Qg("EPSG:3857"),new Qg("EPSG:102100"),new Qg("EPSG:102113"),new Qg("EPSG:900913"),new Qg("urn:ogc:def:crs:EPSG:6.18:3:3857"),new Qg("urn:ogc:def:crs:EPSG::3857"),new Qg("http://www.opengis.net/gml/srs/epsg.xml#3857")];function em(t,e,i){var n=t.length,r=i>1?i:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(n));for(var s=Hg,a=0;as?l=s:l<-s&&(l=-s),o[a+1]=l}return o}function im(t,e,i){var n=t.length,r=i>1?i:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(n));for(var s=0;s1)a=i;else{if(d>0){for(var f=0;fr&&(r=u),o=a,s=l}return r}function Bm(t,e,i,n,r){for(var o=0,s=i.length;o0;){for(var c=u.pop(),d=u.pop(),f=0,p=t[d],g=t[d+1],m=t[c],v=t[c+1],y=d+n;yf&&(h=y,f=_)}f>r&&(l[(h-e)/n]=1,d+n0&&g>f)&&(p<0&&m0&&m>p)?(a=c,l=d):(o[s++]=a,o[s++]=l,u=a,h=l,a=c,l=d)}}return o[s++]=a,o[s++]=l,s}function Qm(t,e,i,n,r,o,s,a){for(var l=0,u=i.length;lo&&(u-a)*(o-l)-(r-a)*(h-l)>0&&s++:h<=o&&(u-a)*(o-l)-(r-a)*(h-l)<0&&s--,a=u,l=h}return 0!==s}function ov(t,e,i,n,r,o){if(0===i.length)return!1;if(!rv(t,e,i[0],n,r,o))return!1;for(var s=1,a=i.length;sb&&ov(t,e,i,n,u=(h+c)/2,p)&&(_=u,b=w),h=c}return isNaN(_)&&(_=r[o]),s?(s.push(_,p,b),s):[_,p,b]}function av(t,e,i,n,r,o){for(var s,a=[t[e],t[e+1]],l=[];e+n=r[0]&&o[2]<=r[2]||(o[1]>=r[1]&&o[3]<=r[3]||av(t,e,i,n,(function(t,e){return function(t,e,i){var n=!1,r=Lp(t,e),o=Lp(t,i);if(r===bp||o===bp)n=!0;else{var s,a,l=t[0],u=t[1],h=t[2],c=t[3],d=e[0],f=e[1],p=i[0],g=i[1],m=(g-f)/(p-d);o&wp&&!(r&wp)&&(n=(s=p-(g-c)/m)>=l&&s<=h),n||!(o&xp)||r&xp||(n=(a=g-(p-h)*m)>=u&&a<=c),n||!(o&Sp)||r&Sp||(n=(s=p-(g-u)/m)>=l&&s<=h),n||!(o&Cp)||r&Cp||(n=(a=g-(p-l)*m)>=u&&a<=c)}return n}(r,t,e)})))))}function uv(t,e,i,n,r){if(!function(t,e,i,n,r){return!!(lv(t,e,i,n,r)||rv(t,e,i,n,r[0],r[1])||rv(t,e,i,n,r[0],r[3])||rv(t,e,i,n,r[2],r[1])||rv(t,e,i,n,r[2],r[3]))}(t,e,i[0],n,r))return!1;if(1===i.length)return!0;for(var o=1,s=i.length;o0}function dv(t,e,i,n,r){for(var o=void 0!==r&&r,s=0,a=i.length;s=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||Gp(t,this.intersectsCoordinate,this))}return!1},e.prototype.setCenter=function(t){var e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],n=t.slice();n[e]=n[0]+i;for(var r=1;r>1)],e))<0?s=n+1:(a=n,l=!r);return l?s:~s}(d,m);if(v<0){var y=(m-d[-v-2])/(d[-v-1]-d[-v-2]),_=e+(-v-2)*n;s=Ug(t[_],t[_+n],y),a=Ug(t[_+1],t[_+n+1],y)}else s=t[e+v*n],a=t[e+v*n+1]}return o?(o[0]=s,o[1]=a,o):[s,a]}function xv(t,e,i,n,r,o){if(i==e)return null;var s;if(r>1;r=0&&!((n=t/e[r])>=i&&n<1e3);r--);return r}},watch:{show:function(t){t?this.$parent.$on(this.watch,this.updateGeometries):this.$parent.$off(this.watch,this.updateGeometries)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"annotation-tooltip"},[i("ul",{staticClass:"annotation-tooltip__annotations"},t._l(t.measuredGeometries,(function(e){return i("li",{domProps:{textContent:t._s(e)}})})),0)])}),[],!1,null,null,null);const Ev=Sl({components:{labelTooltip:cg,measureTooltip:Tv.exports},props:{showLabelTooltip:{type:Boolean,default:!1},showMeasureTooltip:{type:Boolean,default:!1}},computed:{showAnnotationTooltip:function(){return this.isDefaultInteractionMode&&(this.showLabelTooltip||this.showMeasureTooltip)}},data:function(){return{hoveredFeaturesHash:""}},methods:{annotationLayerFilter:function(t){return"annotations"===t.get("name")},updateHoveredAnnotations:function(t){var e=this.map.getFeaturesAtPixel(t.pixel,{layerFilter:this.annotationLayerFilter})||[],i=e.map((function(t){return t.getId()})).join("-");this.hoveredFeaturesHash!==i&&(this.hoveredFeaturesHash=i,this.$emit("hoverFeatures",e))},resetHoveredAnnotations:function(){this.hoveredFeaturesHash="",this.$emit("hoverFeatures",[])}},watch:{showAnnotationTooltip:function(t){t?this.map.on("pointermove",this.updateHoveredAnnotations):(this.map.un("pointermove",this.updateHoveredAnnotations),this.resetHoveredAnnotations())}}},undefined,undefined,!1,null,null,null).exports,Iv={SINGLECLICK:"singleclick",CLICK:kf,DBLCLICK:Rf,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};function Av(t){return Math.pow(t,3)}function Pv(t){return 1-Av(1-t)}function kv(t){return 3*t*t-2*t*t*t}function Rv(t){return t}const Lv="active";function Fv(t,e,i,n){e=t.constrainRotation(e,0),Mv(t,e,i,n)}function Mv(t,e,i,n){if(void 0!==e){var r=t.getRotation(),o=t.getCenter();void 0!==r&&o&&n>0?t.animate({rotation:e,anchor:i,duration:n,easing:Pv}):t.rotate(e,i)}}function Ov(t,e,i,n){var r=t.getResolution(),o=t.constrainResolution(r,e,0);if(void 0!==o){var s=t.getResolutions();o=Og(o,t.getMinResolution()||s[s.length-1],t.getMaxResolution()||s[0])}if(i&&void 0!==o&&o!==r){var a=t.getCenter(),l=t.calculateCenterZoom(o,i);l=t.constrainCenter(l),i=[(o*a[0]-r*l[0])/(o-r),(o*a[1]-r*l[1])/(o-r)]}$v(t,o,i,n)}function $v(t,e,i,n){if(e){var r=t.getResolution(),o=t.getCenter();if(void 0!==r&&o&&e!==r&&n)t.animate({resolution:e,anchor:i,duration:n,easing:Pv});else{if(i){var s=t.calculateCenterZoom(e,i);t.setCenter(s)}t.setResolution(e)}}}const Dv=function(t){function e(e){t.call(this),e.handleEvent&&(this.handleEvent=e.handleEvent),this.map_=null,this.setActive(!0)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getActive=function(){return this.get(Lv)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Lv,t)},e.prototype.setMap=function(t){this.map_=t},e}(Wf);function jv(t){for(var e=t.length,i=0,n=0,r=0;r0}}else if(t.type==Iv.POINTERDOWN){var n=this.handleDownEvent(t);n&&t.preventDefault(),this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==Iv.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===Iv.POINTERDOWN||e===Iv.POINTERDRAG||e===Iv.POINTERUP}(t)){var e=t.pointerEvent,i=e.pointerId.toString();t.type==Iv.POINTERUP?delete this.trackedPointers_[i]:(t.type==Iv.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=lf(this.trackedPointers_)}},e}(Dv);function Bv(t){return(Bv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Uv(t,e){for(var i=0;i0&&(o/=u)}return o}function iy(t,e,i,n){var r=i-t,o=n-e,s=Math.sqrt(r*r+o*o);return[Math.round(i+r/s),Math.round(n+o/s)]}function ny(t,e,i,n,r,o,s,a,l,u,h){var c=ap(Math.round(i*t),Math.round(i*e));if(0===l.length)return c.canvas;c.scale(i,i);var d=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){Np(d,t.extent)}));var f=eg(d),p=Zp(d),g=ap(Math.round(i*f/n),Math.round(i*p/n)),m=i/n;l.forEach((function(t,e,i){var n=t.extent[0]-d[0],r=-(t.extent[3]-d[3]),o=eg(t.extent),s=Zp(t.extent);g.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,n*m,r*m,o*m,s*m)}));var v=Qp(s);return a.getTriangles().forEach((function(t,e,r){var s=t.source,a=t.target,l=s[0][0],u=s[0][1],h=s[1][0],f=s[1][1],p=s[2][0],m=s[2][1],y=(a[0][0]-v[0])/o,_=-(a[0][1]-v[1])/o,b=(a[1][0]-v[0])/o,w=-(a[1][1]-v[1])/o,x=(a[2][0]-v[0])/o,S=-(a[2][1]-v[1])/o,C=l,T=u;l=0,u=0;var E=function(t){for(var e=t.length,i=0;ir&&(r=s,n=o)}if(0===r)return null;var a=t[n];t[n]=t[i],t[i]=a;for(var l=i+1;l=0;d--){c[d]=t[d][e]/t[d][d];for(var f=d-1;f>=0;f--)t[f][e]-=t[f][d]*c[d]}return c}([[h-=C,f-=T,0,0,b-y],[p-=C,m-=T,0,0,x-y],[0,0,h,f,w-_],[0,0,p,m,S-_]]);if(E){c.save(),c.beginPath();var I=(y+b+x)/3,A=(_+w+S)/3,P=iy(I,A,y,_),k=iy(I,A,b,w),R=iy(I,A,x,S);c.moveTo(k[0],k[1]),c.lineTo(P[0],P[1]),c.lineTo(R[0],R[1]),c.clip(),c.transform(E[0],E[2],E[1],E[3],y,_),c.translate(d[0]-C,d[3]-T),c.scale(n/i,-n/i),c.drawImage(g.canvas,0,0),c.restore()}})),h&&(c.save(),c.strokeStyle="black",c.lineWidth=1,a.getTriangles().forEach((function(t,e,i){var n=t.target,r=(n[0][0]-v[0])/o,s=-(n[0][1]-v[1])/o,a=(n[1][0]-v[0])/o,l=-(n[1][1]-v[1])/o,u=(n[2][0]-v[0])/o,h=-(n[2][1]-v[1])/o;c.beginPath(),c.moveTo(a,l),c.lineTo(r,s),c.lineTo(u,h),c.closePath(),c.stroke()})),c.restore()),c.canvas}var ry=function(t,e,i,n,r){this.sourceProj_=t,this.targetProj_=e;var o={},s=xm(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return o[e]||(o[e]=s(t)),o[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&eg(n)==eg(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?eg(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?eg(this.targetProj_.getExtent()):null;var a=Qp(i),l=tg(i),u=Kp(i),h=Wp(i),c=this.transformInv_(a),d=this.transformInv_(l),f=this.transformInv_(u),p=this.transformInv_(h);if(this.addQuad_(a,l,u,h,c,d,f,p,10),this.wrapsXInSource_){var g=1/0;this.triangles_.forEach((function(t,e,i){g=Math.min(g,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-g>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-g>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-g>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-g>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i.5&&h<1,f=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)f=eg(Tp([t,e,i,n]))/this.targetWorldWidth_>.25||f;!d&&this.sourceProj_.isGlobal()&&h&&(f=h>.25||f)}if(f||!this.maxSourceExtent_||ig(u,this.maxSourceExtent_)){if(!(f||isFinite(r[0])&&isFinite(r[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1]))){if(!(l>0))return;f=!0}if(l>0){if(!f){var p,g=[(t[0]+i[0])/2,(t[1]+i[1])/2],m=this.transformInv_(g);if(d)p=(Bg(r[0],c)+Bg(s[0],c))/2-Bg(m[0],c);else p=(r[0]+s[0])/2-m[0];var v=(r[1]+s[1])/2-m[1];f=p*p+v*v>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var y=[(e[0]+i[0])/2,(e[1]+i[1])/2],_=this.transformInv_(y),b=[(n[0]+t[0])/2,(n[1]+t[1])/2],w=this.transformInv_(b);this.addQuad_(t,e,y,b,r,o,_,w,l-1),this.addQuad_(b,y,i,n,w,_,s,a,l-1)}else{var x=[(t[0]+e[0])/2,(t[1]+e[1])/2],S=this.transformInv_(x),C=[(i[0]+n[0])/2,(i[1]+n[1])/2],T=this.transformInv_(C);this.addQuad_(t,x,C,n,r,S,T,a,l-1),this.addQuad_(x,e,i,C,S,o,s,T,l-1)}return}}if(d){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}this.addTriangle_(t,i,n,r,s,a),this.addTriangle_(t,e,i,r,o,s)}},ry.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,n){var r=e.source;Bp(t,r[0]),Bp(t,r[1]),Bp(t,r[2])})),t},ry.prototype.getTriangles=function(){return this.triangles_};const oy=ry;const sy=function(t){function e(e,i,n,r,o,s){var a=e.getExtent(),l=i.getExtent(),u=l?Jp(n,l):n,h=ey(e,i,Xp(u),r),c=new oy(e,i,u,a,.5*h),d=s(c.calculateSourceExtent(),h,o),f=Jv;d&&(f=Hv);var p=d?d.getPixelRatio():1;t.call(this,n,r,p,f),this.targetProj_=i,this.maxSourceExtent_=a,this.triangulation_=c,this.targetResolution_=r,this.targetExtent_=n,this.sourceImage_=d,this.sourcePixelRatio_=p,this.canvas_=null,this.sourceListenerKey_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.state==Zv&&this.unlistenSource_(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.getProjection=function(){return this.targetProj_},e.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==Jv){var e=eg(this.targetExtent_)/this.targetResolution_,i=Zp(this.targetExtent_)/this.targetResolution_;this.canvas_=ny(e,i,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0)}this.state=t,this.changed()},e.prototype.load=function(){if(this.state==Hv){this.state=Zv,this.changed();var t=this.sourceImage_.getState();t==Jv||t==Qv?this.reproject_():(this.sourceListenerKey_=pf(this.sourceImage_,If,(function(t){var e=this.sourceImage_.getState();e!=Jv&&e!=Qv||(this.unlistenSource_(),this.reproject_())}),this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){vf(this.sourceListenerKey_),this.sourceListenerKey_=null},e}(ty),ay="undefined",ly="ready";function uy(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}const hy=function(t){function e(e){t.call(this),this.projection_=mm(e.projection),this.attributions_=uy(e.attributions),this.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,this.loading=!1,this.state_=void 0!==e.state?e.state:ly,this.wrapX_=void 0!==e.wrapX&&e.wrapX}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolutions=function(){return tf()},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=uy(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(Wf);var cy="imageloadstart",dy="imageloadend",fy="imageloaderror",py=function(t){function e(e,i){t.call(this,e),this.image=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Tf);const gy=function(t){function e(e){t.call(this,{attributions:e.attributions,projection:e.projection,state:e.state}),this.resolutions_=void 0!==e.resolutions?e.resolutions:null,this.reprojectedImage_=null,this.reprojectedRevision_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=gg(this.resolutions_,t,0);t=this.resolutions_[e]}return t},e.prototype.getImage=function(t,e,i,n){var r=this.getProjection();if(r&&n&&!bm(r,n)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&bm(this.reprojectedImage_.getProjection(),n)&&this.reprojectedImage_.getResolution()==e&&jp(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new sy(r,n,t,e,i,function(t,e,i){return this.getImageInternal(t,e,i,r)}.bind(this)),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return r&&(n=r),this.getImageInternal(t,e,i,n)},e.prototype.getImageInternal=function(t,e,i,n){return tf()},e.prototype.handleImageChange=function(t){var e=t.target;switch(e.getState()){case Zv:this.loading=!0,this.dispatchEvent(new py(cy,e));break;case Jv:this.loading=!1,this.dispatchEvent(new py(dy,e));break;case Qv:this.loading=!1,this.dispatchEvent(new py(fy,e))}},e}(hy);const my=function(t){function e(e,i,n,r,o){var s=void 0!==o?Hv:Jv;void 0===i&&(i=Zp(e)/r.height),t.call(this,e,i,n,s),this.loader_=void 0!==o?o:null,this.canvas_=r,this.error_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getError=function(){return this.error_},e.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=Qv):this.state=Jv,this.changed()},e.prototype.load=function(){this.state==Hv&&(this.state=Zv,this.changed(),this.loader_(this.handleLoad_.bind(this)))},e.prototype.getImage=function(){return this.canvas_},e}(ty);const vy=function(t){function e(e){t.call(this,{attributions:e.attributions,projection:e.projection,resolutions:e.resolutions,state:e.state}),this.canvas_=new my(e.canvasExtent,void 0,1,e.canvas),this.canvasSize_=e.canvasSize?e.canvasSize:null,pf(this.canvas_,If,this.handleImageChange,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getImageInternal=function(t,e,i,n){return ig(t,this.canvas_.getExtent())?this.canvas_:null},e}(gy),yy="add",_y="remove";var by="length",wy=function(t){function e(e,i){t.call(this,e),this.element=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Tf);const xy=function(t){function e(e,i){t.call(this);var n=i||{};if(this.unique_=!!n.unique,this.array_=e||[],this.unique_)for(var r=0,o=this.array_.length;r0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;e0}},methods:{handleClick:function(){this.disabled||this.$emit("click")},handleMouseEnter:function(){!this.disabled&&this.hover&&(this.mouseOver=!0),window.clearTimeout(this.timeout)},handleMouseLeave:function(){var t=this;window.clearTimeout(this.timeout),this.timeout=window.setTimeout((function(){t.mouseOver=!1}),200)},updateActiveSubControls:function(t){t?this.activeSubControls+=1:this.activeSubControls=Math.max(0,this.activeSubControls-1)}},watch:{active:function(t){this.$parent.$emit("control-button-active",t)}},created:function(){this.$on("control-button-active",this.updateActiveSubControls)},mounted:function(){this.active&&this.$parent.$emit("control-button-active",!0)}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("span",{staticClass:"control-button btn",class:t.classObject,attrs:{title:t.title,disabled:t.disabled},on:{click:t.handleClick,mouseenter:t.handleMouseEnter,mouseleave:t.handleMouseLeave}},[i("i",{class:t.iconClass,attrs:{"aria-hidden":"true"}}),t._v(" "),t.hasSubControls?i("span",{staticClass:"control-button__sub-controls btn-group",on:{click:function(t){t.stopPropagation()}}},[t._t("default")],2):t._e()])}),[],!1,null,null,null).exports;const Cy=function(t){function e(e){if(t.call(this),this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,pf(this,qf(this.geometryName_),this.handleGeometryChanged_,this),e)if("function"==typeof e.getSimplifiedGeometry){var i=e;this.setGeometry(i)}else{var n=e;this.setProperties(n)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){var t=new e(this.getProperties());t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var n=this.getStyle();return n&&t.setStyle(n),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(vf(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=pf(t,If,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;var e;Array.isArray(t)?e=t:(pp("function"==typeof t.getZIndex,41),e=[t]);return function(){return e}}(t):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){mf(this,qf(this.geometryName_),this.handleGeometryChanged_,this),this.geometryName_=t,pf(this,qf(this.geometryName_),this.handleGeometryChanged_,this),this.handleGeometryChanged_()},e}(Wf);const Ty=function(t){function e(e,i,n){t.call(this,e),this.map=i,this.frameState=void 0!==n?n:null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Tf);const Ey=function(t){function e(e,i,n,r,o){t.call(this,e,i,o),this.originalEvent=n,this.pixel=i.getEventPixel(n),this.coordinate=i.getCoordinateFromPixel(this.pixel),this.dragging=void 0!==r&&r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),this.originalEvent.stopPropagation()},e}(Ty);const Iy=function(t){function e(e,i,n,r,o){t.call(this,e,i,n.originalEvent,r,o),this.pointerEvent=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ey);function Ay(t,e){return t[0]+=e[0],t[1]+=e[1],t}function Py(t,e){var i,n,r=t[0],o=t[1],s=e[0],a=e[1],l=s[0],u=s[1],h=a[0],c=a[1],d=h-l,f=c-u,p=0===d&&0===f?0:(d*(r-l)+f*(o-u))/(d*d+f*f||0);return p<=0?(i=l,n=u):p>=1?(i=h,n=c):(i=l+p*d,n=u+p*f),[i,n]}function ky(t,e){for(var i=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){i=!1;break}return i}function Ry(t,e){var i=Math.cos(e),n=Math.sin(e),r=t[0]*i-t[1]*n,o=t[1]*i+t[0]*n;return t[0]=r,t[1]=o,t}function Ly(t,e){return t[0]*=e,t[1]*=e,t}function Fy(t,e){var i=t[0]-e[0],n=t[1]-e[1];return i*i+n*n}function My(t,e){return Math.sqrt(Fy(t,e))}var Oy="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",$y=-1!==Oy.indexOf("firefox"),Dy=-1!==Oy.indexOf("safari")&&-1==Oy.indexOf("chrom"),jy=-1!==Oy.indexOf("webkit")&&-1==Oy.indexOf("edge"),Ny=-1!==Oy.indexOf("macintosh"),By=window.devicePixelRatio||1,Uy=function(){var t=!1;try{t=!!document.createElement("canvas").getContext("2d").setLineDash}catch(t){}return t}(),zy=(navigator,"ontouchstart"in window),Vy="PointerEvent"in window,Gy=!!navigator.msPointerEnabled,qy=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},Wy=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Ky=function(t){return t.target.getTargetElement()===document.activeElement},Xy=bf,Yy=function(t){return t.type==Iv.CLICK},Hy=function(t){var e=t.originalEvent;return 0==e.button&&!(jy&&Ny&&e.ctrlKey)},Zy=wf,Jy=function(t){return t.type==Iv.SINGLECLICK},Qy=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},t_=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},e_=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},i_=function(t){var e=t.pointerEvent;return pp(void 0!==e,56),"mouse"==e.pointerType},n_=function(t){var e=t.pointerEvent;return pp(void 0!==e,56),e.isPrimary&&0===e.button};const r_=function(t){function e(e,i,n){if(t.call(this),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(e[0]))this.setCoordinates(e,i);else if(void 0!==i&&n)this.setFlatCoordinates(i,e),this.ends_=n;else{for(var r=this.getLayout(),o=e,s=[],a=[],l=0,u=o.length;l=t.minResolution&&ethis.highWaterMark},e.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null,this.dispatchEvent(Af)},e.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},e.prototype.forEach=function(t,e){for(var i=this.oldest_;i;)t.call(e,i.value_,i.key_,this),i=i.newer},e.prototype.get=function(t){var e=this.entries_[t];return pp(void 0!==e,15),e===this.newest_||(e===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(e.newer.older=e.older,e.older.newer=e.newer),e.newer=null,e.older=this.newest_,this.newest_.newer=e,this.newest_=e),e.value_},e.prototype.remove=function(t){var e=this.entries_[t];return pp(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},e.prototype.getCount=function(){return this.count_},e.prototype.getKeys=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},e.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},e.prototype.peekLast=function(){return this.oldest_.value_},e.prototype.peekLastKey=function(){return this.oldest_.key_},e.prototype.peekFirstKey=function(){return this.newest_.key_},e.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},e.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},e.prototype.set=function(t,e){pp(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},e.prototype.setSize=function(t){this.highWaterMark=t},e.prototype.prune=function(){for(;this.canExpireCache();)this.pop()},e}(Ef);var G_="10px sans-serif",q_=[0,0,0,1],W_="round",K_=[],X_="round",Y_=[0,0,0,1],H_="center",Z_="middle",J_=[0,0,0,0],Q_=new V_,tb={},eb=null,ib={},nb=function(){var t,e,i=tb,n="32px ",r=["monospace","serif"],o=r.length,s="wmytzilWMYTZIL@#/&?$%10";function a(t){for(var i=rb(),a=100;a<=700;a+=300){for(var l=a+" ",u=!0,h=0;h=200&&a.status<300){var r,o=e.getType();o==Pb||o==kb?r=a.responseText:o==Rb?(r=a.responseXML)||(r=(new DOMParser).parseFromString(a.responseText,"application/xml")):o==Ab&&(r=a.response),r?i.call(this,e.readFeatures(r,{featureProjection:s}),e.readProjection(r),e.getLastExtent()):n.call(this)}else n.call(this)}.bind(this),a.onerror=function(){n.call(this)}.bind(this),a.send()}}(t,e,(function(t,e){"function"==typeof this.addFeatures&&this.addFeatures(t)}),xf)}function Fb(t,e){return[[-1/0,-1/0,1/0,1/0]]}const Mb="addfeature",Ob="changefeature",$b="clear",Db="removefeature";var jb=i(510),Nb=i.n(jb),Bb=function(t){this.rbush_=Nb()(t,void 0),this.items_={}};Bb.prototype.insert=function(t,e){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[nf(e)]=i},Bb.prototype.load=function(t,e){for(var i=new Array(e.length),n=0,r=e.length;n2){var i=t[0],n=t[1],r=t[2],o=[n[0]-i[0],n[1]-i[1]];if(0===o[1])t=[[i,i,i,i]];else{var s=[-1*o[1],o[0]],a=o[0]/o[1],l=(r[0]+a*(n[1]-r[1])-n[0])/(s[0]-s[1]*a),u=[l*s[0],l*s[1]];t=[[[i[0]-u[0],i[1]-u[1]],[n[0]-u[0],n[1]-u[1]],[n[0]+u[0],n[1]+u[1]],[i[0]+u[0],i[1]+u[1]]]]}}else t=[t];var h=e;return h?h.setCoordinates(t):h=new Gb(t),h};else if(this.type_===Fg)this.minPoints_=3,this.maxPoints_=3,n=function(t,e){if(t.length>2){var i=t[0],n=t[1],r=t[2],o=[n[0]-i[0],n[1]-i[1]],s=[i[0]+.5*o[0],i[1]+.5*o[1]];if(0===o[1])t=[[i,i,i,i]];else{var a=[-1*o[1],o[0]],l=o[0]/o[1],u=(r[0]+l*(n[1]-r[1])-n[0])/(a[0]-a[1]*l),h=[u*a[0],u*a[1]];t=[[[i[0],i[1]],[s[0]-h[0],s[1]-h[1]],[n[0],n[1]],[s[0]+h[0],s[1]+h[1]]]]}}else t=[t];var c=e;return c?c.setCoordinates(t):c=new qb(t),c};else{var r,o=this.mode_;o===Wb?r=iv:o===Kb?r=Cv:o===Xb&&(r=mv),n=function(t,e){var i=e;return i?o===Xb?t[0].length?i.setCoordinates([t[0].concat([t[0][0]])]):i.setCoordinates([]):i.setCoordinates(t):i=new r(t),i}}this.geometryFunction_=n,this.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,this.overlay_=new Ib({source:new Vb({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:tw(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:Qy,this.freehandCondition_,e.freehand?this.freehandCondition_=Xy:this.freehandCondition_=e.freehandCondition?e.freehandCondition:t_,pf(this,qf(Lv),this.updateState_,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===Pf&&e.preventDefault(),this.freehand_=this.mode_!==Wb&&this.freehandCondition_(e);var i=e.type===Iv.POINTERMOVE,n=!0;!this.freehand_&&this.lastDragTime_&&e.type===Iv.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,i=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===Iv.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e),n=!1):this.freehand_&&e.type===Iv.POINTERDOWN?n=!1:i?(n=e.type===Iv.POINTERMOVE)&&this.freehand_?n=this.handlePointerMove_(e):(e.pointerEvent.pointerType==u_||e.type===Iv.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===Iv.DBLCLICK&&(n=!1),t.prototype.handleEvent.call(this,e)&&n},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t),!0):!!this.condition_(t)&&(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new Iy(Iv.POINTERMOVE,t.map,t.pointerEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0)},e.prototype.handleUpEvent=function(t){var e=!0;this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t);var i=this.mode_===Yb;return this.shouldHandle_?(this.finishCoordinate_?this.freehand_||i?this.finishDrawing():this.atFinish_(t)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t):(this.startDrawing_(t),this.mode_===Wb&&this.finishDrawing()),e=!1):this.freehand_&&(this.finishCoordinate_=null,this.abortDrawing_()),!e&&this.stopClick_&&t.stopPropagation(),e},e.prototype.handlePointerMove_=function(t){if(this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,i=t.pixel,n=e[0]-i[0],r=e[1]-i[1],o=n*n+r*r;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return!0}return this.finishCoordinate_?this.modifyDrawing_(t):this.createOrUpdateSketchPoint_(t),!0},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var i=!1,n=[this.finishCoordinate_];if(this.mode_===Kb)i=this.sketchCoords_.length>this.minPoints_;else if(this.mode_===Xb){var r=this.sketchCoords_;i=r[0].length>this.minPoints_,n=[r[0][0],r[0][r[0].length-2]]}if(i)for(var o=t.map,s=0,a=n.length;s=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(n.slice()),this.geometryFunction_(i,r)):this.mode_===Xb&&((i=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(n.slice()),e&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,r)),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry();this.mode_===Kb?((t=this.sketchCoords_).splice(-2,1),this.geometryFunction_(t,e),t.length>=2&&(this.finishCoordinate_=t[t.length-2].slice())):this.mode_===Xb&&((t=this.sketchCoords_[0]).splice(-2,1),this.sketchLine_.getGeometry().setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e)),0===t.length&&(this.finishCoordinate_=null),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,i=t.getGeometry();this.mode_===Kb?(e.pop(),this.geometryFunction_(e,i)):this.mode_===Xb&&(e[0].pop(),this.geometryFunction_(e,i),e=i.getCoordinates()),this.type_===Ig?t.setGeometry(new o_([e])):this.type_===Ag?t.setGeometry(new r_([e])):this.type_===Pg&&t.setGeometry(new s_([e])),this.dispatchEvent(new Qb(Jb,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return t&&(this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0)),t},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.updateSketchFeatures_(),this.dispatchEvent(new Qb(Zb,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing_(),this.overlay_.setMap(e?t:null)},e}(Nv);var iw={white:[255,255,255,1],blue:[0,153,255,1],orange:"#ff5e00"},nw={},rw=new yb({color:iw.white,width:5}),ow=new yb({color:iw.white,width:6}),sw=new yb({color:iw.blue,width:3}),aw=new yb({color:iw.orange,width:3}),lw=new mb({color:iw.blue}),uw=new mb({color:iw.orange}),hw=new yb({color:iw.white,width:2}),cw=new yb({color:iw.white,width:3}),dw=new yb({color:iw.white,width:2,lineDash:[3]}),fw=new yb({color:iw.blue,width:3,lineDash:[5]});const pw={colors:iw,features:function(t){var e=t.get("color");return e=e?"#"+e:iw.blue,nw.hasOwnProperty(e)||(nw[e]=[new Cb({stroke:rw,image:new pb({radius:6,fill:new mb({color:e}),stroke:hw}),fill:new mb({color:"transparent"})}),new Cb({stroke:new yb({color:e,width:3})})]),nw[e]},highlight:[new Cb({stroke:ow,image:new pb({radius:6,fill:uw,stroke:cw}),zIndex:200}),new Cb({stroke:aw,zIndex:200})],editing:[new Cb({stroke:rw,image:new pb({radius:6,fill:lw,stroke:dw})}),new Cb({stroke:fw})],viewport:[new Cb({stroke:sw}),new Cb({stroke:new yb({color:iw.white,width:1})})],cross:[new Cb({image:new fb({stroke:ow,points:4,radius1:6,radius2:0,angle:Math.PI/4})}),new Cb({image:new fb({stroke:aw,points:4,radius1:6,radius2:0,angle:Math.PI/4})})]};var gw,mw=function(t){var e=t.pointerEvent;return!(!e||"pen"!==e.pointerType)||t_(t)};const vw=Sl({computed:{isDrawing:function(){return this.interactionMode.startsWith("draw")},isDrawingPoint:function(){return"drawPoint"===this.interactionMode},isDrawingRectangle:function(){return"drawRectangle"===this.interactionMode},isDrawingCircle:function(){return"drawCircle"===this.interactionMode},isDrawingLineString:function(){return"drawLineString"===this.interactionMode},isDrawingPolygon:function(){return"drawPolygon"===this.interactionMode},isDrawingEllipse:function(){return"drawEllipse"===this.interactionMode}},methods:{draw:function(t){this["isDrawing"+t]?this.resetInteractionMode():this.hasSelectedLabel?this.canAdd&&(this.interactionMode="draw"+t):this.requireSelectedLabel()},drawPoint:function(){this.draw("Point")},drawRectangle:function(){this.draw("Rectangle")},drawCircle:function(){this.draw("Circle")},drawLineString:function(){this.draw("LineString")},drawPolygon:function(){this.draw("Polygon")},drawEllipse:function(){this.draw("Ellipse")},maybeUpdateDrawInteractionMode:function(t){gw&&(this.map.removeInteraction(gw),gw=void 0),this.isDrawing&&((gw=new ew({source:this.annotationSource,type:t.slice(4),style:pw.editing,freehandCondition:mw})).on("drawend",this.handleNewFeature),this.map.addInteraction(gw))}},watch:{selectedLabel:function(t){this.isDrawing&&!t&&this.resetInteractionMode()}},created:function(){this.canAdd&&(Pl.on("a",this.drawPoint,0,this.listenerSet),Pl.on("s",this.drawRectangle,0,this.listenerSet),Pl.on("d",this.drawCircle,0,this.listenerSet),Pl.on("Shift+d",this.drawEllipse,0,this.listenerSet),Pl.on("f",this.drawLineString,0,this.listenerSet),Pl.on("g",this.drawPolygon,0,this.listenerSet),this.$watch("interactionMode",this.maybeUpdateDrawInteractionMode))}},undefined,undefined,!1,null,null,null).exports;var yw=function(t){function e(e){var i=e||{};t.call(this,i),this.type=v_}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(M_);yw.prototype.getSource;const _w=yw;const bw=Sl({props:{label:{required:!0}}},undefined,undefined,!1,null,null,null).exports;const ww=Sl({data:function(){return{imageSection:[0,0],imageSectionCenter:[0,0]}},computed:{imageSectionSteps:function(){return[Math.ceil(this.image.width/(this.viewExtent[2]-this.viewExtent[0])),Math.ceil(this.image.height/(this.viewExtent[3]-this.viewExtent[1]))]},imageSectionStepSize:function(){var t,e=[this.viewExtent[2]-this.viewExtent[0],this.viewExtent[3]-this.viewExtent[1]];return this.imageSectionSteps[0]>1?(t=e[0]*this.imageSectionSteps[0]-this.image.width,e[0]-=t/(this.imageSectionSteps[0]-1)):e[0]=this.viewExtent[2],this.imageSectionSteps[1]>1?(t=e[1]*this.imageSectionSteps[1]-this.image.height,e[1]-=t/(this.imageSectionSteps[1]-1)):e[1]=this.viewExtent[3],e},imageSectionStartCenter:function(){var t=[(this.viewExtent[2]-this.viewExtent[0])/2,(this.viewExtent[3]-this.viewExtent[1])/2];return this.imageSectionSteps[0]<=1&&(t[0]=this.extent[2]/2),this.imageSectionSteps[1]<=1&&(t[1]=this.extent[3]/2),t},isLawnmowerAnnotationMode:function(){return"lawnmower"===this.annotationMode}},methods:{getImageSectionCenter:function(t){return[t[0]*this.imageSectionStepSize[0]+this.imageSectionStartCenter[0],t[1]*this.imageSectionStepSize[1]+this.imageSectionStartCenter[1]]},showImageSection:function(t){return t[0]=0&&t[1]>=0&&(this.imageSection=t,this.imageSectionCenter=this.getImageSectionCenter(t),this.map.getView().setCenter(this.imageSectionCenter),!0)},showLastImageSection:function(){this.showImageSection([this.imageSectionSteps[0]-1,this.imageSectionSteps[1]-1])},showFirstImageSection:function(){this.showImageSection([0,0])},showPreviousImageSection:function(){var t=this.imageSection[0]-1;return t>=0?this.showImageSection([t,this.imageSection[1]]):this.showImageSection([this.imageSectionSteps[0]-1,this.imageSection[1]-1])},showNextImageSection:function(){var t=this.imageSection[0]+1;return t0&&(e=Sw().gaussBlurOnlyBorder(e,this.blurRadius));for(var i=e.data,n=this.snapshot.data,r=i.length-1;r>=0;r--)0===n[4*r]&&(i[r]=0);var o=Sw().traceContours(e).filter((function(t){return!t.innner})).shift();if(o){this.simplifyTolerant>0&&(o=Sw().simplifyContours([o],this.simplifyTolerant,this.simplifyCount).shift());var s=this.fromSnapshotCoordinates(this.fromMagicWandCoordinates(o.points));this.sketchFeature?this.sketchFeature.getGeometry().setCoordinates([s]):(this.sketchFeature=new Cy(new mv([s])),this.sketchStyle&&this.sketchFeature.setStyle(this.sketchStyle),this.sketchSource.addFeature(this.sketchFeature))}}}])&&Tw(e.prototype,i),n&&Tw(e,n),o}(Nv);var Rw;const Lw=Sl({computed:{crossOrigin:function(){return this.image&&this.image.crossOrigin},isMagicWanding:function(){return"magicWand"===this.interactionMode&&!this.crossOrigin}},methods:{toggleMagicWand:function(){this.isMagicWanding?this.resetInteractionMode():Rw&&(this.interactionMode="magicWand")},maybeUpdateMagicWandSnapshot:function(t){t&&!t.tiled&&this.isMagicWanding&&Rw.updateSnapshot()},maybeSetMagicWandLayer:function(t,e){t&&!this.crossOrigin&&(!0===t.tiled?e&&!0===e.tiled||Rw.setLayer(this.tiledImageLayer):e&&!0!==e.tiled||Rw.setLayer(this.imageLayer))},toggleMagicWandInteraction:function(t){t?this.hasSelectedLabel?Rw.setActive(!0):this.requireSelectedLabel():Rw.setActive(!1)}},created:function(){this.canAdd&&(Pl.on("Shift+g",this.toggleMagicWand,0,this.listenerSet),this.$watch("image",this.maybeUpdateMagicWandSnapshot),this.$watch("image",this.maybeSetMagicWandLayer),this.$watch("isMagicWanding",this.toggleMagicWandInteraction))},mounted:function(){this.canAdd&&((Rw=new kw({map:this.map,source:this.annotationSource,style:pw.editing,indicatorPointStyle:pw.editing,indicatorCrossStyle:pw.cross,simplifyTolerant:.1})).on("drawend",this.handleNewFeature),Rw.setActive(!1),this.map.addInteraction(Rw))}},undefined,undefined,!1,null,null,null).exports,Fw="pointermove",Mw="pointerdown",Ow="pointerup",$w="pointerover",Dw="pointerout",jw="pointerenter",Nw="pointerleave",Bw="pointercancel";var Uw=["","unavailable","touch","pen","mouse"];function zw(t){this.pointerMap[t.pointerId.toString()]=t;var e=this.prepareEvent_(t);this.dispatcher.down(e,t)}function Vw(t){var e=this.prepareEvent_(t);this.dispatcher.move(e,t)}function Gw(t){var e=this.prepareEvent_(t);this.dispatcher.up(e,t),this.cleanup(t.pointerId)}function qw(t){var e=this.prepareEvent_(t);this.dispatcher.leaveOut(e,t)}function Ww(t){var e=this.prepareEvent_(t);this.dispatcher.enterOver(e,t)}function Kw(t){var e=this.prepareEvent_(t);this.dispatcher.cancel(e,t),this.cleanup(t.pointerId)}function Xw(t){var e=this.dispatcher.makeEvent("lostpointercapture",t,t);this.dispatcher.dispatchEvent(e)}function Yw(t){var e=this.dispatcher.makeEvent("gotpointercapture",t,t);this.dispatcher.dispatchEvent(e)}const Hw=function(t){function e(e){var i={MSPointerDown:zw,MSPointerMove:Vw,MSPointerUp:Gw,MSPointerOut:qw,MSPointerOver:Ww,MSPointerCancel:Kw,MSGotPointerCapture:Yw,MSLostPointerCapture:Xw};t.call(this,e,i),this.pointerMap=e.pointerMap}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvent_=function(t){var e=t;return"number"==typeof t.pointerType&&((e=this.dispatcher.cloneEvent(t,t)).pointerType=Uw[t.pointerType]),e},e.prototype.cleanup=function(t){delete this.pointerMap[t.toString()]},e}(l_);function Zw(t){this.dispatcher.fireNativeEvent(t)}function Jw(t){this.dispatcher.fireNativeEvent(t)}function Qw(t){this.dispatcher.fireNativeEvent(t)}function tx(t){this.dispatcher.fireNativeEvent(t)}function ex(t){this.dispatcher.fireNativeEvent(t)}function ix(t){this.dispatcher.fireNativeEvent(t)}function nx(t){this.dispatcher.fireNativeEvent(t)}function rx(t){this.dispatcher.fireNativeEvent(t)}const ox=function(t){function e(e){var i={pointerdown:Zw,pointermove:Jw,pointerup:Qw,pointerout:tx,pointerover:ex,pointercancel:ix,gotpointercapture:rx,lostpointercapture:nx};t.call(this,e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l_);var sx=!1,ax=function(t){function e(e,i,n){t.call(this,e),this.originalEvent=i;var r=n||{};this.buttons=function(t){var e;if(t.buttons||sx)e=t.buttons;else switch(t.which){case 1:e=1;break;case 2:e=4;break;case 3:e=2;break;default:e=0}return e}(r),this.pressure=function(t,e){var i=0;i=t.pressure?t.pressure:e?.5:0;return i}(r,this.buttons),this.bubbles="bubbles"in r&&r.bubbles,this.cancelable="cancelable"in r&&r.cancelable,this.view="view"in r?r.view:null,this.detail="detail"in r?r.detail:null,this.screenX="screenX"in r?r.screenX:0,this.screenY="screenY"in r?r.screenY:0,this.clientX="clientX"in r?r.clientX:0,this.clientY="clientY"in r?r.clientY:0,this.ctrlKey="ctrlKey"in r&&r.ctrlKey,this.altKey="altKey"in r&&r.altKey,this.shiftKey="shiftKey"in r&&r.shiftKey,this.metaKey="metaKey"in r&&r.metaKey,this.button="button"in r?r.button:0,this.relatedTarget="relatedTarget"in r?r.relatedTarget:null,this.pointerId="pointerId"in r?r.pointerId:0,this.width="width"in r?r.width:0,this.height="height"in r?r.height:0,this.tiltX="tiltX"in r?r.tiltX:0,this.tiltY="tiltY"in r?r.tiltY:0,this.pointerType="pointerType"in r?r.pointerType:"",this.hwTimestamp="hwTimestamp"in r?r.hwTimestamp:0,this.isPrimary="isPrimary"in r&&r.isPrimary,i.preventDefault&&(this.preventDefault=function(){i.preventDefault()})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Tf);!function(){try{var t=new MouseEvent("click",{buttons:1});sx=1===t.buttons}catch(t){}}();const lx=ax;function ux(t){this.vacuumTouches_(t),this.setPrimaryTouch_(t.changedTouches[0]),this.dedupSynthMouse_(t),this.clickCount_++,this.processTouches_(t,this.overDown_)}function hx(t){this.processTouches_(t,this.moveOverOut_)}function cx(t){this.dedupSynthMouse_(t),this.processTouches_(t,this.upOut_)}function dx(t){this.processTouches_(t,this.cancelOut_)}const fx=function(t){function e(e,i){var n={touchstart:ux,touchmove:hx,touchend:cx,touchcancel:dx};t.call(this,e,n),this.pointerMap=e.pointerMap,this.mouseSource=i,this.firstTouchId_=void 0,this.clickCount_=0,this.resetId_,this.dedupTimeout_=2500}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isPrimaryTouch_=function(t){return this.firstTouchId_===t.identifier},e.prototype.setPrimaryTouch_=function(t){var e=Object.keys(this.pointerMap).length;(0===e||1===e&&1..toString()in this.pointerMap)&&(this.firstTouchId_=t.identifier,this.cancelResetClickCount_())},e.prototype.removePrimaryPointer_=function(t){t.isPrimary&&(this.firstTouchId_=void 0,this.resetClickCount_())},e.prototype.resetClickCount_=function(){this.resetId_=setTimeout(this.resetClickCountHandler_.bind(this),200)},e.prototype.resetClickCountHandler_=function(){this.clickCount_=0,this.resetId_=void 0},e.prototype.cancelResetClickCount_=function(){void 0!==this.resetId_&&clearTimeout(this.resetId_)},e.prototype.touchToPointer_=function(t,e){var i=this.dispatcher.cloneEvent(t,e);return i.pointerId=e.identifier+2,i.bubbles=!0,i.cancelable=!0,i.detail=this.clickCount_,i.button=0,i.buttons=1,i.width=e.radiusX||0,i.height=e.radiusY||0,i.pressure=e.force||.5,i.isPrimary=this.isPrimaryTouch_(e),i.pointerType="touch",i.clientX=e.clientX,i.clientY=e.clientY,i.screenX=e.screenX,i.screenY=e.screenY,i},e.prototype.processTouches_=function(t,e){var i=Array.prototype.slice.call(t.changedTouches),n=i.length;function r(){t.preventDefault()}for(var o=0;o=e.length){for(var r=[],o=0;o-1&&t.splice(r,1)}),this.dedupTimeout_)}},e}(l_);var px=[["bubbles",!1],["cancelable",!1],["view",null],["detail",null],["screenX",0],["screenY",0],["clientX",0],["clientY",0],["ctrlKey",!1],["altKey",!1],["shiftKey",!1],["metaKey",!1],["button",0],["relatedTarget",null],["buttons",0],["pointerId",0],["width",0],["height",0],["pressure",0],["tiltX",0],["tiltY",0],["pointerType",""],["hwTimestamp",0],["isPrimary",!1],["type",""],["target",null],["currentTarget",null],["which",0]];const gx=function(t){function e(e){t.call(this),this.element_=e,this.pointerMap={},this.eventMap_={},this.eventSourceList_=[],this.registerSources()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.registerSources=function(){if(Vy)this.registerSource("native",new ox(this));else if(Gy)this.registerSource("ms",new Hw(this));else{var t=new m_(this);this.registerSource("mouse",t),zy&&this.registerSource("touch",new fx(this,t))}this.register_()},e.prototype.registerSource=function(t,e){var i=e,n=i.getEvents();n&&(n.forEach(function(t){var e=i.getHandlerForEvent(t);e&&(this.eventMap_[t]=e.bind(i))}.bind(this)),this.eventSourceList_.push(i))},e.prototype.register_=function(){for(var t=this.eventSourceList_.length,e=0;ethis.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(vf(this.relayedListenerKey_),this.relayedListenerKey_=null),this.pointerdownListenerKey_&&(vf(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(vf),this.dragListenerKeys_.length=0,this.documentPointerEventHandler_&&(this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null),this.pointerEventHandler_&&(this.pointerEventHandler_.dispose(),this.pointerEventHandler_=null),t.prototype.disposeInternal.call(this)},e}(Ef),vx="layergroup",yx="size",_x="target",bx="view",wx=0,xx=1,Sx=2,Cx=3,Tx=4,Ex=5;var Ix=1/0,Ax=function(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}};Ax.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,af(this.queuedElements_)},Ax.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var n=this.keyFunction_(i);return delete this.queuedElements_[n],i},Ax.prototype.enqueue=function(t){pp(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=Ix&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},Ax.prototype.getCount=function(){return this.elements_.length},Ax.prototype.getLeftChildIndex_=function(t){return 2*t+1},Ax.prototype.getRightChildIndex_=function(t){return 2*t+2},Ax.prototype.getParentIndex_=function(t){return t-1>>1},Ax.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},Ax.prototype.isEmpty=function(){return 0===this.elements_.length},Ax.prototype.isKeyQueued=function(t){return t in this.queuedElements_},Ax.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},Ax.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,n=e.length,r=e[t],o=i[t],s=t;t>1;){var a=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=lt;){var s=this.getParentIndex_(e);if(!(n[s]>o))break;i[e]=i[s],n[e]=n[s],e=s}i[e]=r,n[e]=o},Ax.prototype.reprioritize=function(){var t,e,i,n=this.priorityFunction_,r=this.elements_,o=this.priorities_,s=0,a=r.length;for(e=0;e0;)r=(n=this.dequeue()[0]).getKey(),(i=n.getState())===Ex?s=!0:i!==wx||r in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++o,n.load());0===o&&s&&this.tileChangeCallback_()},e}(Ax);var kx=256;function Rx(t){return t}function Lx(t,e){return void 0!==t?0:void 0}function Fx(t,e){return void 0!==t?t+e:void 0}const Mx=0,Ox=1,$x="center",Dx="resolution",jx="rotation";function Nx(t,e){setTimeout((function(){t(e)}),0)}function Bx(t){return!(t.sourceCenter&&t.targetCenter&&!ky(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}const Ux=function(t){function e(e){t.call(this);var i=sf({},e);this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.updateAnimations_=this.updateAnimations_.bind(this),this.projection_=_m(i.projection,"EPSG:3857"),this.applyOptions_(i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.applyOptions_=function(t){var e={};e[$x]=void 0!==t.center?t.center:null;var i=function(t){var e,i,n,r=28,o=2,s=void 0!==t.minZoom?t.minZoom:0,a=void 0!==t.maxZoom?t.maxZoom:r,l=void 0!==t.zoomFactor?t.zoomFactor:o;if(void 0!==t.resolutions){var u=t.resolutions;i=u[s],n=void 0!==u[a]?u[a]:u[u.length-1],e=function(t){return function(e,i,n){if(void 0!==e){var r=gg(t,e,n);r=Og(r+i,0,t.length-1);var o=Math.floor(r);if(r!=o&&o1&&"function"==typeof arguments[n-1]&&(e=arguments[n-1],--n),!this.isDef()){var r=arguments[n-1];return r.center&&this.setCenter(r.center),void 0!==r.zoom&&this.setZoom(r.zoom),void 0!==r.rotation&&this.setRotation(r.rotation),void(e&&Nx(e,!0))}for(var o=Date.now(),s=this.getCenter().slice(),a=this.getResolution(),l=this.getRotation(),u=[],h=0;h0},e.prototype.getInteracting=function(){return this.hints_[Ox]>0},e.prototype.cancelAnimations=function(){this.setHint(Mx,-this.hints_[Mx]);for(var t=0,e=this.animations_.length;t=0;--i){for(var n=this.animations_[i],r=!0,o=0,s=n.length;o0?l/a.duration:1;u>=1?(a.complete=!0,u=1):r=!1;var h=a.easing(u);if(a.sourceCenter){var c=a.sourceCenter[0],d=a.sourceCenter[1],f=c+h*(a.targetCenter[0]-c),p=d+h*(a.targetCenter[1]-d);this.set($x,[f,p])}if(a.sourceResolution&&a.targetResolution){var g=1===h?a.targetResolution:a.sourceResolution+h*(a.targetResolution-a.sourceResolution);a.anchor&&this.set($x,this.calculateCenterZoom(g,a.anchor)),this.set(Dx,g)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var m=1===h?Bg(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+h*(a.targetRotation-a.sourceRotation);a.anchor&&this.set($x,this.calculateCenterRotate(m,a.anchor)),this.set(jx,m)}if(e=!0,!a.complete)break}}if(r){this.animations_[i]=null,this.setHint(Mx,-1);var v=n[0].callback;v&&Nx(v,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_))}},e.prototype.calculateCenterRotate=function(t,e){var i,n=this.getCenter();return void 0!==n&&(Ry(i=[n[0]-e[0],n[1]-e[1]],t-this.getRotation()),Ay(i,e)),i},e.prototype.calculateCenterZoom=function(t,e){var i,n=this.getCenter(),r=this.getResolution();void 0!==n&&void 0!==r&&(i=[e[0]-t*(e[0]-n[0])/r,e[1]-t*(e[1]-n[1])/r]);return i},e.prototype.getSizeFromViewport_=function(){var t=[100,100],e='.ol-viewport[data-view="'+nf(this)+'"]',i=document.querySelector(e);if(i){var n=getComputedStyle(i);t[0]=parseInt(n.width,10),t[1]=parseInt(n.height,10)}return t},e.prototype.constrainCenter=function(t){return this.constraints_.center(t)},e.prototype.constrainResolution=function(t,e,i){var n=e||0,r=i||0;return this.constraints_.resolution(t,n,r)},e.prototype.constrainRotation=function(t,e){var i=e||0;return this.constraints_.rotation(t,i)},e.prototype.getCenter=function(){return this.get($x)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){var e=t||this.getSizeFromViewport_(),i=this.getCenter();pp(i,1);var n=this.getResolution();pp(void 0!==n,2);var r=this.getRotation();return pp(void 0!==r,3),Hp(i,n,r,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(Dx)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){var i=e||this.getSizeFromViewport_(),n=eg(t)/i[0],r=Zp(t)/i[1];return Math.max(n,r)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.maxResolution_,n=this.minResolution_,r=Math.log(i/n)/Math.log(e);return function(t){return i/Math.pow(e,t*r)}},e.prototype.getRotation=function(){return this.get(jx)},e.prototype.getValueForResolutionFunction=function(t){var e=t||2,i=this.maxResolution_,n=this.minResolution_,r=Math.log(i/n)/Math.log(e);return function(t){return Math.log(i/t)/Math.log(e)/r}},e.prototype.getState=function(t){var e=this.getCenter(),i=this.getProjection(),n=this.getResolution(),r=n/t,o=this.getRotation();return{center:[Math.round(e[0]/r)*r,Math.round(e[1]/r)*r],projection:void 0!==i?i:null,resolution:n,rotation:o,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,i,n=this.minZoom_||0;if(this.resolutions_){var r=gg(this.resolutions_,t,1);n=r,e=this.resolutions_[r],i=r==this.resolutions_.length-1?2:e/this.resolutions_[r+1]}else e=this.maxResolution_,i=this.zoomFactor_;return n+Math.log(e/t)/Math.log(i)},e.prototype.getResolutionForZoom=function(t){return this.constrainResolution(this.maxResolution_,t-this.minZoom_,0)},e.prototype.fit=function(t,e){var i,n=e||{},r=n.size;r||(r=this.getSizeFromViewport_()),pp(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t)?(pp(!ng(t),25),i=vv(t)):t.getType()===Rg?(i=vv(t=t.getExtent())).rotate(this.getRotation(),Xp(t)):i=t;var o,s=void 0!==n.padding?n.padding:[0,0,0,0],a=void 0===n.constrainResolution||n.constrainResolution,l=void 0!==n.nearest&&n.nearest;o=void 0!==n.minResolution?n.minResolution:void 0!==n.maxZoom?this.constrainResolution(this.maxResolution_,n.maxZoom-this.minZoom_,0):0;for(var u=i.getFlatCoordinates(),h=this.getRotation(),c=Math.cos(-h),d=Math.sin(-h),f=1/0,p=1/0,g=-1/0,m=-1/0,v=i.getStride(),y=0,_=u.length;y<_;y+=v){var b=u[y]*c-u[y+1]*d,w=u[y]*d+u[y+1]*c;f=Math.min(f,b),p=Math.min(p,w),g=Math.max(g,b),m=Math.max(m,w)}var x=this.getResolutionForExtent([f,p,g,m],[r[0]-s[1]-s[3],r[1]-s[0]-s[2]]);if(x=isNaN(x)?o:Math.max(x,o),a){var S=this.constrainResolution(x,0,0);!l&&S=0;i--){var n=e[i];if(n.getActive())if(!n.handleEvent(t))break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var i=this.maxTilesLoading_,n=i;if(t){var r=t.viewHints;r[Mx]&&(i=this.loadTilesWhileAnimating_?8:0,n=2),r[Ox]&&(i=this.loadTilesWhileInteracting_?8:0,n=2)}e.getTilesLoading()0&&t[1]>0}(i)&&n&&n.isDef()){for(var a=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),l=this.getLayerGroup().getLayerStatesArray(),u={},h=0,c=l.length;h0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!yg(e,this.renderedAttributions_)){dp(this.ulElement_);for(var n=0,r=e.length;n0?t.animate({rotation:0,duration:this.duration_,easing:Pv}):t.setRotation(0))},e}(Kx);const Jx=function(t){function e(e){var i=e||{};t.call(this,{element:document.createElement("div"),target:i.target});var n=void 0!==i.className?i.className:"ol-zoom",r=void 0!==i.delta?i.delta:1,o=void 0!==i.zoomInLabel?i.zoomInLabel:"+",s=void 0!==i.zoomOutLabel?i.zoomOutLabel:"−",a=void 0!==i.zoomInTipLabel?i.zoomInTipLabel:"Zoom in",l=void 0!==i.zoomOutTipLabel?i.zoomOutTipLabel:"Zoom out",u=document.createElement("button");u.className=n+"-in",u.setAttribute("type","button"),u.title=a,u.appendChild("string"==typeof o?document.createTextNode(o):o),pf(u,kf,this.handleClick_.bind(this,r));var h=document.createElement("button");h.className=n+"-out",h.setAttribute("type","button"),h.title=l,h.appendChild("string"==typeof s?document.createTextNode(s):s),pf(h,kf,this.handleClick_.bind(this,-r));var c=n+" "+"ol-unselectable "+rp,d=this.element;d.className=c,d.appendChild(u),d.appendChild(h),this.duration_=void 0!==i.duration?i.duration:250}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var i=e.getResolution();if(i){var n=e.constrainResolution(i,t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({resolution:n,duration:this.duration_,easing:Pv})):e.setResolution(n)}}},e}(Kx);var Qx=function(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0};Qx.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},Qx.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},Qx.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]0&&this.points_[i+2]>t;)i-=3;var n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;var r=this.points_[e]-this.points_[i],o=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(o,r),this.initialVelocity_=Math.sqrt(r*r+o*o)/n,this.initialVelocity_>this.minVelocity_},Qx.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},Qx.prototype.getAngle=function(){return this.angle_};const tS=Qx;function eS(t){var e=!1;if(t.type==Iv.DBLCLICK){var i=t.originalEvent,n=t.map,r=t.coordinate,o=i.shiftKey?-this.delta_:this.delta_;Ov(n.getView(),o,r,this.duration_),t.preventDefault(),e=!0}return!e}const iS=function(t){function e(e){t.call(this,{handleEvent:eS});var i=e||{};this.delta_=i.delta?i.delta:1,this.duration_=void 0!==i.duration?i.duration:250}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Dv);const nS=function(t){function e(e){t.call(this,{stopDown:wf});var i=e||{};this.kinetic_=i.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1,this.condition_=i.condition?i.condition:Qy,this.noKinetic_=!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().setHint(Ox,1));var e=this.targetPointers,i=jv(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(i[0],i[1]),this.lastCentroid){var n=this.lastCentroid[0]-i[0],r=i[1]-this.lastCentroid[1],o=t.map.getView(),s=[n,r];Ly(s,o.getResolution()),Ry(s,o.getRotation()),Ay(s,o.getCenter()),s=o.constrainCenter(s),o.setCenter(s)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=i,this.lastPointersCount_=e.length},e.prototype.handleUpEvent=function(t){var e=t.map,i=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var n=this.kinetic_.getDistance(),r=this.kinetic_.getAngle(),o=i.getCenter(),s=e.getPixelFromCoordinate(o),a=e.getCoordinateFromPixel([s[0]-n*Math.cos(r),s[1]-n*Math.sin(r)]);i.animate({center:i.constrainCenter(a),duration:500,easing:Pv})}return this.panning_&&(this.panning_=!1,i.setHint(Ox,-1)),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.setCenter(t.frameState.viewState.center),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(Nv);const rS=function(t){function e(e){var i=e||{};t.call(this,{stopDown:wf}),this.condition_=i.condition?i.condition:Wy,this.lastAngle_=void 0,this.duration_=void 0!==i.duration?i.duration:250}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDragEvent=function(t){if(i_(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==Lx){var n=e.getSize(),r=t.pixel,o=Math.atan2(n[1]/2-r[1],r[0]-n[0]/2);if(void 0!==this.lastAngle_){var s=o-this.lastAngle_,a=i.getRotation();Mv(i,a-s)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){if(!i_(t))return!0;var e=t.map.getView();e.setHint(Ox,-1);var i=e.getRotation();return Fv(e,i,void 0,this.duration_),!1},e.prototype.handleDownEvent=function(t){return!!i_(t)&&(!(!Hy(t)||!this.condition_(t))&&(t.map.getView().setHint(Ox,1),this.lastAngle_=void 0,!0))},e}(Nv);const oS=function(t){function e(e){t.call(this),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.className="ol-box "+e,this.map_=null,this.startPixel_=null,this.endPixel_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+i,n.top=Math.min(t[1],e[1])+i,n.width=Math.abs(e[0]-t[0])+i,n.height=Math.abs(e[1]-t[1])+i},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left=e.top=e.width=e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixel,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new mv([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(_f);var sS="boxstart",aS="boxdrag",lS="boxend",uS=function(t){function e(e,i,n){t.call(this,e),this.coordinate=i,this.mapBrowserEvent=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Tf);function hS(){var t=this.getMap(),e=t.getView(),i=t.getSize(),n=this.getGeometry().getExtent();if(this.out_){var r=e.calculateExtent(i),o=function(t,e){return Up(Op(e),t)}([t.getPixelFromCoordinate(Wp(n)),t.getPixelFromCoordinate(tg(n))]);!function(t,e){var i=(t[2]-t[0])/2*(e-1),n=(t[3]-t[1])/2*(e-1);t[0]-=i,t[2]+=i,t[1]-=n,t[3]+=n}(r,1/e.getResolutionForExtent(o,i)),n=r}var s=e.constrainResolution(e.getResolutionForExtent(n,i)),a=Xp(n);a=e.constrainCenter(a),e.animate({resolution:s,center:a,duration:this.duration_,easing:Pv})}const cS=function(t){function e(e){var i=e||{},n=i.condition?i.condition:t_;t.call(this,{condition:n,className:i.className||"ol-dragzoom",onBoxEnd:hS}),this.duration_=void 0!==i.duration?i.duration:200,this.out_=void 0!==i.out&&i.out}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(function(t){function e(e){t.call(this);var i=e||{};this.box_=new oS(i.className||"ol-dragbox"),this.minArea_=void 0!==i.minArea?i.minArea:64,this.onBoxEnd_=i.onBoxEnd?i.onBoxEnd:xf,this.startPixel_=null,this.condition_=i.condition?i.condition:Xy,this.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:this.defaultBoxEndCondition}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.defaultBoxEndCondition=function(t,e,i){var n=i[0]-e[0],r=i[1]-e[1];return n*n+r*r>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){i_(t)&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new uS(aS,t.coordinate,t)))},e.prototype.handleUpEvent=function(t){return!i_(t)||(this.box_.setMap(null),this.boxEndCondition_(t,this.startPixel_,t.pixel)&&(this.onBoxEnd_(t),this.dispatchEvent(new uS(lS,t.coordinate,t))),!1)},e.prototype.handleDownEvent=function(t){return!!i_(t)&&(!(!Hy(t)||!this.condition_(t))&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new uS(sS,t.coordinate,t)),!0))},e}(Nv)),dS=37,fS=38,pS=39,gS=40;function mS(t){var e=!1;if(t.type==Ff){var i=t.originalEvent.keyCode;if(this.condition_(t)&&(i==gS||i==dS||i==pS||i==fS)){var n=t.map.getView(),r=n.getResolution()*this.pixelDelta_,o=0,s=0;i==gS?s=-r:i==dS?o=-r:i==pS?o=r:s=r;var a=[o,s];Ry(a,n.getRotation()),function(t,e,i){var n=t.getCenter();if(n){var r=t.constrainCenter([n[0]+e[0],n[1]+e[1]]);i?t.animate({duration:i,easing:Rv,center:r}):t.setCenter(r)}}(n,a,this.duration_),t.preventDefault(),e=!0}}return!e}const vS=function(t){function e(e){t.call(this,{handleEvent:mS});var i=e||{};this.defaultCondition_=function(t){return Qy(t)&&e_(t)},this.condition_=void 0!==i.condition?i.condition:this.defaultCondition_,this.duration_=void 0!==i.duration?i.duration:100,this.pixelDelta_=void 0!==i.pixelDelta?i.pixelDelta:128}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Dv);function yS(t){var e=!1;if(t.type==Ff||t.type==Mf){var i=t.originalEvent.charCode;if(this.condition_(t)&&(i=="+".charCodeAt(0)||i=="-".charCodeAt(0))){var n=t.map,r=i=="+".charCodeAt(0)?this.delta_:-this.delta_;Ov(n.getView(),r,void 0,this.duration_),t.preventDefault(),e=!0}}return!e}const _S=function(t){function e(e){t.call(this,{handleEvent:yS});var i=e||{};this.condition_=i.condition?i.condition:e_,this.delta_=i.delta?i.delta:1,this.duration_=void 0!==i.duration?i.duration:100}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Dv);var bS="trackpad",wS="wheel";const xS=function(t){function e(e){var i=e||{};t.call(this,i),this.delta_=0,this.duration_=void 0!==i.duration?i.duration:250,this.timeout_=void 0!==i.timeout?i.timeout:80,this.useAnchor_=void 0===i.useAnchor||i.useAnchor,this.constrainResolution_=i.constrainResolution||!1,this.condition_=i.condition?i.condition:Xy,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.trackpadDeltaPerZoom_=300,this.trackpadZoomBuffer_=1.5}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.decrementInteractingHint_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().setHint(Ox,-1)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var e=t.type;if(e!==Uf&&e!==Df)return!0;t.preventDefault();var i,n=t.map,r=t.originalEvent;if(this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==Uf?(i=r.deltaY,$y&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(i/=By),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(i*=40)):t.type==Df&&(i=-r.wheelDeltaY,Dy&&(i/=3)),0===i)return!1;var o=Date.now();if(void 0===this.startTime_&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(i)<4?bS:wS),this.mode_===bS){var s=n.getView();this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):s.setHint(Ox,1),this.trackpadTimeoutId_=setTimeout(this.decrementInteractingHint_.bind(this),this.trackpadEventGap_);var a=s.getResolution()*Math.pow(2,i/this.trackpadDeltaPerZoom_),l=s.getMinResolution(),u=s.getMaxResolution(),h=0;if(au&&(a=Math.min(a,u*this.trackpadZoomBuffer_),h=-1),this.lastAnchor_){var c=s.calculateCenterZoom(a,this.lastAnchor_);s.setCenter(s.constrainCenter(c))}return s.setResolution(a),0===h&&this.constrainResolution_&&s.animate({resolution:s.constrainResolution(a,i>0?-1:1),easing:Pv,anchor:this.lastAnchor_,duration:this.duration_}),h>0?s.animate({resolution:l,easing:Pv,anchor:this.lastAnchor_,duration:500}):h<0&&s.animate({resolution:u,easing:Pv,anchor:this.lastAnchor_,duration:500}),this.startTime_=o,!1}this.delta_+=i;var d=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),d),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();Ov(e,-Og(this.delta_,-1,1),this.lastAnchor_,this.duration_),this.mode_=void 0,this.delta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(Dv);const SS=function(t){function e(e){var i=e||{},n=i;n.stopDown||(n.stopDown=wf),t.call(this,n),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=void 0!==i.threshold?i.threshold:.3,this.duration_=void 0!==i.duration?i.duration:250}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],n=this.targetPointers[1],r=Math.atan2(n.clientY-i.clientY,n.clientX-i.clientX);if(void 0!==this.lastAngle_){var o=r-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=r;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==Lx){var l=s.getViewport().getBoundingClientRect(),u=jv(this.targetPointers);if(u[0]-=l.left,u[1]-=l.top,this.anchor_=s.getCoordinateFromPixel(u),this.rotating_){var h=a.getRotation();s.render(),Mv(a,h+e,this.anchor_)}}},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView();if(e.setHint(Ox,-1),this.rotating_){var i=e.getRotation();Fv(e,i,this.anchor_,this.duration_)}return!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().setHint(Ox,1),!0}return!1},e}(Nv);const CS=function(t){function e(e){var i=e||{},n=i;n.stopDown||(n.stopDown=wf),t.call(this,n),this.constrainResolution_=i.constrainResolution||!1,this.anchor_=null,this.duration_=void 0!==i.duration?i.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],n=this.targetPointers[1],r=i.clientX-n.clientX,o=i.clientY-n.clientY,s=Math.sqrt(r*r+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,l=a.getView(),u=l.getResolution(),h=l.getMaxResolution(),c=l.getMinResolution(),d=u*e;d>h?(e=h/u,d=h):de.getMaxResolution()){var n=this.lastScaleDelta_-1;!function(t,e,i,n,r){e=t.constrainResolution(e,0,r),$v(t,e,i,n)}(e,i,this.anchor_,this.duration_,n)}return!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().setHint(Ox,1),!0}return!1},e}(Nv);function TS(t){var e=t||{},i=new xy,n=new tS(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new rS),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new iS({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new nS({condition:e.onFocusOnly?Ky:void 0,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new SS),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new CS({constrainResolution:e.constrainResolution,duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new vS),i.push(new _S({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new xS({condition:e.onFocusOnly?Ky:void 0,constrainResolution:e.constrainResolution,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new cS({duration:e.zoomDuration})),i}const ES=function(t){function e(e,i,n,r,o){t.call(this,e),this.vectorContext=i,this.frameState=n,this.context=r,this.glContext=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Tf);var IS=function(){};IS.prototype.drawCustom=function(t,e,i){},IS.prototype.drawGeometry=function(t){},IS.prototype.setStyle=function(t){},IS.prototype.drawCircle=function(t,e){},IS.prototype.drawEllipse=function(t,e){},IS.prototype.drawFeature=function(t,e){},IS.prototype.drawGeometryCollection=function(t,e){},IS.prototype.drawLineString=function(t,e){},IS.prototype.drawMultiLineString=function(t,e){},IS.prototype.drawMultiPoint=function(t,e){},IS.prototype.drawMultiPolygon=function(t,e){},IS.prototype.drawPoint=function(t,e){},IS.prototype.drawPolygon=function(t,e){},IS.prototype.drawText=function(t,e){},IS.prototype.setFillStrokeStyle=function(t,e){},IS.prototype.setImageStyle=function(t,e){},IS.prototype.setTextStyle=function(t,e){};const AS=IS;const PS=function(t){function e(e,i,n,r,o){t.call(this),this.context_=e,this.pixelRatio_=i,this.extent_=n,this.transform_=r,this.viewRotation_=o,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=0,this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=0,this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=[1,0,0,1,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawImages_=function(t,e,i,n){if(this.image_){var r=Mg(t,e,i,2,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.tmpLocalTransform_,a=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=a*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,h=r.length;uthis.maxCacheSize_){var t=0;for(var e in this.cache_){var i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},kS.prototype.get=function(t,e,i){var n=RS(t,e,i);return n in this.cache_?this.cache_[n]:null},kS.prototype.set=function(t,e,i,n){var r=RS(t,e,i);this.cache_[r]=n,++this.cacheSize_},kS.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()};var LS=new kS;function FS(t,e){LS.expire()}function MS(t,e){return t.zIndex-e.zIndex}var OS=[];const $S=function(t){function e(e){t.call(this,e);var i=e.getViewport();this.context_=ap(),this.canvas_=this.context_.canvas,this.canvas_.style.width="100%",this.canvas_.style.height="100%",this.canvas_.style.display="block",this.canvas_.className=np,i.insertBefore(this.canvas_,i.childNodes[0]||null),this.renderedVisible_=!0,this.transform_=[1,0,0,1,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.dispatchRenderEvent=function(t,e){var i=this.getMap(),n=this.context_;if(i.hasListener(t)){var r=e.extent,o=e.pixelRatio,s=e.viewState.rotation,a=this.getTransform(e),l=new PS(n,o,r,a,s),u=new ES(t,l,e,n,null);i.dispatchEvent(u)}},e.prototype.getTransform=function(t){var e=t.viewState,i=this.canvas_.width/2,n=this.canvas_.height/2,r=t.pixelRatio/e.resolution,o=-r,s=-e.rotation,a=-e.center[0],l=-e.center[1];return Lm(this.transform_,i,n,r,o,s,a,l)},e.prototype.renderFrame=function(t){if(t){var e=this.context_,i=t.pixelRatio,n=Math.round(t.size[0]*i),r=Math.round(t.size[1]*i);this.canvas_.width!=n||this.canvas_.height!=r?(this.canvas_.width=n,this.canvas_.height=r):e.clearRect(0,0,n,r);var o=t.viewState.rotation;this.calculateMatrices2D(t),this.dispatchRenderEvent(k_,t);var s=t.layerStatesArray;!function(t,e){var i,n=t.length,r=Array(t.length);for(i=0;i=0;--l){var f=h[l],p=f.layer;if(F_(f,u)&&o.call(s,p))if(a=this.getLayerRenderer(p).forEachLayerAtCoordinate(d,e,i,n,r))return a}},e.prototype.registerLayerRenderers=function(e){t.prototype.registerLayerRenderers.call(this,e);for(var i=0,n=e.length;if[2])d=[g+p*Math.ceil((f[0]-g)/p),t[1]]}var m,v=e.layerStatesArray;for(m=v.length-1;m>=0;--m){var y=v[m],_=y.layer;if(F_(y,u)&&o.call(s,_)){var b=this.getLayerRenderer(_),w=_.getSource();if(w&&(a=b.forEachFeatureAtCoordinate(w.getWrapX()?d:t,e,i,h)),a)return a}}},e.prototype.forEachLayerAtPixel=function(t,e,i,n,r,o,s){return tf()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,n,r){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,bf,this,n,r)},e.prototype.getLayerRenderer=function(t){var e=nf(t);if(e in this.layerRenderers_)return this.layerRenderers_[e];for(var i,n=0,r=this.layerRendererConstructors_.length;n=.5&&c>=.5&&i.drawImage(n,0,0,+n.width,+n.height,Math.round(l),Math.round(u),Math.round(h),Math.round(c)),i.globalAlpha=a,o&&i.restore()}this.postCompose(i,t,e)},e.prototype.getImage=function(){return tf()},e.prototype.getImageTransform=function(){return tf()},e.prototype.forEachLayerAtCoordinate=function(t,e,i,n,r){if(this.getImage()){var o=Pm(this.coordinateToCanvasPixelTransform,t.slice());Ly(o,e.viewState.resolution/this.renderedResolution),this.hitCanvasContext_||(this.hitCanvasContext_=ap(1,1)),this.hitCanvasContext_.clearRect(0,0,1,1),this.hitCanvasContext_.drawImage(this.getImage(),o[0],o[1],1,1,0,0,1,1);var s=this.hitCanvasContext_.getImageData(0,0,1,1).data;return s[3]>0?n.call(r,this.getLayer(),s):void 0}},e}(DS);var NS=function(t){function e(i){if(t.call(this,i),this.image_=null,this.imageTransform_=[1,0,0,1,0,0],this.skippedFeatures_=[],this.vectorRenderer_=null,i.getType()===b_)for(var n=0,r=OS.length;nthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},US.prototype.getHeight=function(){return this.maxY-this.minY+1},US.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},US.prototype.getWidth=function(){return this.maxX-this.minX+1},US.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY};const VS=US;var GS=function(t){function e(e,i){t.call(this,e),this.context=i?null:ap(),this.oversampling_,this.renderedExtent_=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=[1/0,1/0,-1/0,-1/0],this.tmpTileRange_=new VS(0,0,0,0),this.imageTransform_=[1,0,0,1,0,0],this.zDirection=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isDrawableTile_=function(t){var e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return i==Sx||i==Tx||i==Cx&&!n},e.prototype.getTile=function(t,e,i,n,r){var o=this.getLayer(),s=o.getSource().getTile(t,e,i,n,r);return s.getState()==Cx&&(o.getUseInterimTilesOnError()?o.getPreload()>0&&(this.newTiles_=!0):s.setState(Sx)),this.isDrawableTile_(s)||(s=s.getInterimTile()),s},e.prototype.prepareFrame=function(t,e){var i=t.pixelRatio,n=t.size,r=t.viewState,o=r.projection,s=r.resolution,a=r.center,l=this.getLayer(),u=l.getSource(),h=u.getRevision(),c=u.getTileGridForProjection(o),d=c.getZForResolution(s,this.zDirection),f=c.getResolution(d),p=Math.round(s/f)||1,g=t.extent;if(void 0!==e.extent&&(g=Jp(g,e.extent)),ng(g))return!1;var m=c.getTileRangeForExtentAndZ(g,d),v=c.getTileRangeExtent(d,m),y=u.getTilePixelRatio(i),_={};_[d]={};var b,w,x,S=this.createLoadedTileFinder(u,o,_),C=t.viewHints,T=C[Mx]||C[Ox],E=this.tmpExtent,I=this.tmpTileRange_;for(this.newTiles_=!1,w=m.minX;w<=m.maxX;++w)for(x=m.minY;x<=m.maxY;++x)if(!(Date.now()-t.time>16&&T)){if(b=this.getTile(d,w,x,i,o),this.isDrawableTile_(b)){var A=nf(this);if(b.getState()==Sx){_[d][b.tileCoord.toString()]=b;var P=b.inTransition(A);this.newTiles_||!P&&-1!==this.renderedTiles.indexOf(b)||(this.newTiles_=!0)}if(1===b.getAlpha(A,t.time))continue}var k=c.getTileCoordChildTileRange(b.tileCoord,I,E),R=!1;k&&(R=S(d+1,k)),R||c.forEachTileCoordParentTileRange(b.tileCoord,S,null,I,E)}var L=f*i/y*p;if(!(this.renderedResolution&&Date.now()-t.time>16&&T)&&(this.newTiles_||!this.renderedExtent_||!kp(this.renderedExtent_,g)||this.renderedRevision!=h||p!=this.oversampling_||!T&&L!=this.renderedResolution)){var F=this.context;if(F){var M=u.getTilePixelSize(d,i,o),O=Math.round(m.getWidth()*M[0]/p),$=Math.round(m.getHeight()*M[1]/p),D=F.canvas;D.width!=O||D.height!=$?(this.oversampling_=p,D.width=O,D.height=$):(this.renderedExtent_&&!jp(v,this.renderedExtent_)&&F.clearRect(0,0,O,$),p=this.oversampling_)}this.renderedTiles.length=0;var j,N,B,U,z,V,G,q,W,K,X=Object.keys(_).map(Number);for(X.sort((function(t,e){return t===d?1:e===d?-1:t>e?1:t0},e.prototype.drawTileImage=function(t,e,i,n,r,o,s,a,l){var u=this.getTileImage(t);if(u){var h=nf(this),c=l?t.getAlpha(h,e.time):1,d=this.getLayer().getSource();1!==c||d.getOpaque(e.viewState.projection)||this.context.clearRect(n,r,o,s);var f=c!==this.context.globalAlpha;f&&(this.context.save(),this.context.globalAlpha=c),this.context.drawImage(u,a,a,u.width-2*a,u.height-2*a,n,r,o,s),f&&this.context.restore(),1!==c?e.animate=!0:l&&t.endTransition(h)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getImageTransform=function(){return this.imageTransform_},e.prototype.getTileImage=function(t){return t.getImage()},e}(jS);GS.handles=function(t){return t.getType()===y_},GS.create=function(t,e){return new GS(e)},GS.prototype.getLayer;const qS=GS;var WS=function(){};WS.prototype.getReplay=function(t,e){return tf()},WS.prototype.isEmpty=function(){return tf()},WS.prototype.addDeclutter=function(t){return tf()};const KS=WS,XS="Circle",YS="Default",HS="Image",ZS="LineString",JS="Polygon",QS="Text",tC="Ellipse";function eC(t,e,i,n,r,o,s,a){for(var l,u,h,c=[],d=t[e]>t[i-n],f=r.length,p=t[e],g=t[e+1],m=t[e+=n],v=t[e+1],y=0,_=Math.sqrt(Math.pow(m-p,2)+Math.pow(v-g,2)),b="",w=0,x=0;x0?-Math.PI:Math.PI),void 0!==h){var A=I-h;if(A+=A>Math.PI?-2*Math.PI:A<-Math.PI?2*Math.PI:0,Math.abs(A)>a)return null}var P=E/_,k=Ug(p,m,P),R=Ug(g,v,P);h==I?(d&&(l[0]=k,l[1]=R,l[2]=C/2),l[4]=b):(w=C,l=[k,R,C/2,I,b=S],d?c.unshift(l):c.push(l),h=I),s+=C}return c}var iC={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12,ELLIPSE:13},nC=[iC.FILL],rC=[iC.STROKE],oC=[iC.BEGIN_PATH],sC=[iC.CLOSE_PATH];const aC=iC;var lC=[JS,XS,tC,ZS,HS,QS,YS],uC={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},hC=[1/0,1/0,-1/0,-1/0],cC=[1,0,0,1,0,0];const dC=function(t){function e(e,i,n,r,o,s){t.call(this),this.declutterTree=s,this.tolerance=e,this.maxExtent=i,this.overlaps=o,this.pixelRatio=r,this.maxLineWidth=0,this.resolution=n,this.alignFill_,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=[],this.pixelCoordinates_=null,this.state={},this.viewRotation_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.replayTextBackground_=function(t,e,i,n,r,o,s){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,n),t.lineTo.apply(t,r),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),s&&(this.setStrokeStyle_(t,s),t.stroke())},e.prototype.replayImage_=function(t,e,i,n,r,o,s,a,l,u,h,c,d,f,p,g,m,v){var y=m||v;e-=r*=d,i-=o*=d;var _,b,w,x,S=p+u>n.width?n.width-u:p,C=a+h>n.height?n.height-h:a,T=g[3]+S*d+g[1],E=g[0]+C*d+g[2],I=e-g[3],A=i-g[0];(y||0!==c)&&(_=[I,A],b=[I+T,A],w=[I+T,A+E],x=[I,A+E]);var P=null;if(0!==c){var k=e+r,R=i+o;P=Lm(cC,k,R,1,1,c,-k,-R),Op(hC),Bp(hC,Pm(cC,_)),Bp(hC,Pm(cC,b)),Bp(hC,Pm(cC,w)),Bp(hC,Pm(cC,x))}else Mp(I,A,I+T,A+E,hC);var L=t.canvas,F=v?v[2]*d/2:0,M=hC[0]-F<=L.width&&hC[2]+F>=0&&hC[1]-F<=L.height&&hC[3]+F>=0;if(f&&(e=Math.round(e),i=Math.round(i)),s){if(!M&&1==s[4])return;Np(s,hC);var O=M?[t,P?P.slice(0):null,l,n,u,h,S,C,e,i,d]:null;O&&y&&O.push(m,v,_,b,w,x),s.push(O)}else M&&(y&&this.replayTextBackground_(t,_,b,w,x,m,v),cb(t,P,l,n,u,h,S,C,e,i,d))},e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatCoordinates=function(t,e,i,n,r,o){var s=this.coordinates.length,a=this.getBufferedMaxExtent();o&&(e+=n);var l,u,h,c=[t[e],t[e+1]],d=[NaN,NaN],f=!0;for(l=e+n;l5){var i=t[4];if(1==i||i==t.length-5){var n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};if(!this.declutterTree.collides(n)){this.declutterTree.insert(n);for(var r=5,o=t.length;r11&&this.replayTextBackground_(s[0],s[13],s[14],s[15],s[16],s[11],s[12]),cb.apply(void 0,s))}}t.length=5,Op(t)}}},e.prototype.replay_=function(t,e,i,n,r,o,s){var a;this.pixelCoordinates_&&yg(e,this.renderedTransform_)?a=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),a=Mg(this.coordinates,0,this.coordinates.length,2,e,this.pixelCoordinates_),Am(this.renderedTransform_,e));for(var l,u,h,c,d,f,p,g,m,v,y,_,b=!uf(i),w=0,x=n.length,S=0,C=0,T=0,E=null,I=null,A=this.coordinateCache_,P=this.viewRotation_,k={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:P},R=this.instructions!=n||this.overlaps?0:200;wR&&(this.fill_(t),C=0),T>R&&(t.stroke(),T=0),C||T||(t.beginPath(),c=d=NaN),++w;break;case aC.CIRCLE:var F=a[S=L[1]],M=a[S+1],O=a[S+2]-F,$=a[S+3]-M,D=Math.sqrt(O*O+$*$);t.moveTo(F+D,M),t.arc(F,M,D,0,2*Math.PI,!0),++w;break;case aC.ELLIPSE:S=L[1],l=L[2];var j=a[S],N=a[S+1],B=a[S+2],U=a[S+3],z=a[S+4],V=a[S+5],G=a[S+6],q=a[S+7];if(l-S==8){var W=.2761424*(z-j),K=.2761424*(V-N),X=.2761424*(G-B),Y=.2761424*(q-U);t.moveTo(j,N),t.bezierCurveTo(j-X,N-Y,B-W,U-K,B,U),t.bezierCurveTo(B+W,U+K,z-X,V-Y,z,V),t.bezierCurveTo(z+X,V+Y,G+W,q+K,G,q),t.bezierCurveTo(G-W,q-K,j+X,N+Y,j,N)}++w;break;case aC.CLOSE_PATH:t.closePath(),++w;break;case aC.CUSTOM:S=L[1],l=L[2];var H=L[3],Z=L[4],J=6==L.length?L[5]:void 0;k.geometry=H,k.feature=v,w in A||(A[w]=[]);var Q=A[w];J?J(a,S,l,2,Q):(Q[0]=a[S],Q[1]=a[S+1],Q.length=2),Z(Q,k),++w;break;case aC.DRAW_IMAGE:S=L[1],l=L[2],m=L[3],u=L[4],h=L[5],g=o?null:L[6];var tt=L[7],et=L[8],it=L[9],nt=L[10],rt=L[11],ot=L[12],st=L[13],at=L[14],lt=void 0,ut=void 0,ht=void 0;for(L.length>16?(lt=L[15],ut=L[16],ht=L[17]):(lt=J_,ut=ht=!1),rt&&(ot+=P);Sthis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(t,e){var i=t.fillStyle,n=[aC.SET_FILL_STYLE,i];return"string"!=typeof i&&n.push(!0),n},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[aC.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e,i){var n=t.fillStyle;"string"==typeof n&&t.currentFillStyle==n||(void 0!==n&&this.instructions.push(e.call(this,t,i)),t.currentFillStyle=n)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,n=t.lineCap,r=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||r!=t.currentLineDash&&!yg(t.currentLineDash,r)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=r,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t,e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var i=[aC.END_GEOMETRY,e];this.instructions.push(i),this.hitDetectionInstructions.push(i)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Ip(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Ep(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(AS);const fC=function(t){function e(e,i,n,r,o,s){t.call(this,e,i,n,r,o,s),this.declutterGroup_=null,this.hitDetectionImage_=null,this.image_=null,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawCoordinates_=function(t,e,i,n){return this.appendFlatCoordinates(t,e,i,n,!1,!1)},e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),r=this.coordinates.length,o=this.drawCoordinates_(i,0,i.length,n);this.instructions.push([aC.DRAW_IMAGE,r,o,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([aC.DRAW_IMAGE,r,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(t,e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),r=this.coordinates.length,o=this.drawCoordinates_(i,0,i.length,n);this.instructions.push([aC.DRAW_IMAGE,r,o,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([aC.DRAW_IMAGE,r,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(t,e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),n=t.getSize(),r=t.getHitDetectionImage(1),o=t.getImage(1),s=t.getOrigin();this.anchorX_=i[0],this.anchorY_=i[1],this.declutterGroup_=e,this.hitDetectionImage_=r,this.image_=o,this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScale(),this.width_=n[0]},e}(dC);const pC=function(t){function e(e,i,n,r,o,s){t.call(this,e,i,n,r,o,s)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawFlatCoordinates_=function(t,e,i,n){var r=this.coordinates.length,o=this.appendFlatCoordinates(t,e,i,n,!1,!1),s=[aC.MOVE_TO_LINE_TO,r,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},e.prototype.drawLineString=function(t,e){var i=this.state,n=i.strokeStyle,r=i.lineWidth;if(void 0!==n&&void 0!==r){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([aC.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],oC);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(rC),this.endGeometry(t,e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,n=i.strokeStyle,r=i.lineWidth;if(void 0!==n&&void 0!==r){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([aC.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],oC);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),l=0,u=0,h=o.length;ut&&(v>m&&(m=v,p=y,g=o),v=0,y=o-r)),s=a,h=d,c=f),l=_,u=b}return(v+=a)>m?[y,o]:[p,g]}const vC="line";var yC={Circle:gC,Default:dC,Image:fC,LineString:pC,Polygon:gC,Text:function(t){function e(e,i,n,r,o,s){t.call(this,e,i,n,r,o,s),this.declutterGroup_,this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.widths_={},Q_.prune()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawText=function(t,e){var i=this.textFillState_,n=this.textStrokeState_,r=this.textState_;if(""!==this.text_&&r&&(i||n)){var o,s,a=this.coordinates.length,l=t.getType(),u=null,h=2,c=2;if(r.placement===vC){if(!ig(this.getBufferedMaxExtent(),t.getExtent()))return;var d;if(u=t.getFlatCoordinates(),c=t.getStride(),l==Cg)d=[u.length];else if(l==Ag)d=t.getEnds();else if(l==Eg)d=t.getEnds().slice(0,1);else if(l==Pg){var f=t.getEndss();for(d=[],o=0,s=f.length;o=w)&&u.push(x[o],x[o+1]);if(0==(h=u.length))return}h=this.appendFlatCoordinates(u,0,h,c,!1,!1),(r.backgroundFill||r.backgroundStroke)&&(this.setFillStrokeStyle(r.backgroundFill,r.backgroundStroke),r.backgroundFill&&(this.updateFillStyle(this.state,this.createFill,t),this.hitDetectionInstructions.push(this.createFill(this.state,t))),r.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e),this.drawTextImage_(b,a,h),this.endGeometry(t,e)}}},e.prototype.getImage=function(t,e,i,n){var r,o=n+e+t+i+this.pixelRatio;if(!Q_.containsKey(o)){var s=n?this.strokeStates[n]||this.textStrokeState_:null,a=i?this.fillStates[i]||this.textFillState_:null,l=this.textStates[e]||this.textState_,u=this.pixelRatio,h=l.scale*u,c=uC[l.textAlign||H_],d=n&&s.lineWidth?s.lineWidth:0,f=t.split("\n"),p=f.length,g=[],m=function(t,e,i){for(var n=e.length,r=0,o=0;o=o;)wC(i,t+r,t+o),wC(i,t+o,t+r),wC(i,t-o,t+r),wC(i,t-r,t+o),wC(i,t-r,t-o),wC(i,t-o,t-r),wC(i,t+o,t-r),wC(i,t+r,t-o),2*((s+=1+2*++o)-r)+1>0&&(s+=1-2*(r-=1));return bC[t]=i,i}(n);function p(t){for(var e=h.getImageData(0,0,l,l).data,i=0;i0){var r=void 0;return(!c||d!=HS&&d!=QS||-1!==c.indexOf(t))&&(r=o(t)),r||void h.clearRect(0,0,l,l)}}this.declutterTree_&&(c=this.declutterTree_.all().map((function(t){return t.value})));var g,m,v,y,_,b=Object.keys(this.replaysByZIndex_).map(Number);for(b.sort(fg),g=b.length-1;g>=0;--g){var w=b[g].toString();for(v=this.replaysByZIndex_[w],m=lC.length-1;m>=0;--m)if(void 0!==(y=v[d=lC[m]]))if(!s||d!=HS&&d!=QS){if(_=y.replayHitDetection(h,u,i,r,p,a))return _}else{var x=s[w];x?x.push(y,u.slice(0)):s[w]=[y,u.slice(0)]}}},e.prototype.getClipCoords=function(t){var e=this.maxExtent_,i=e[0],n=e[1],r=e[2],o=e[3],s=[i,n,i,o,r,o,r,n];return Mg(s,0,8,2,t,s),s},e.prototype.getReplay=function(t,e){var i=void 0!==t?t.toString():"0",n=this.replaysByZIndex_[i];void 0===n&&(n={},this.replaysByZIndex_[i]=n);var r=n[e];void 0===r&&(r=new(0,yC[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_),n[e]=r);return r},e.prototype.getReplays=function(){return this.replaysByZIndex_},e.prototype.isEmpty=function(){return uf(this.replaysByZIndex_)},e.prototype.replay=function(t,e,i,n,r,o,s){var a=Object.keys(this.replaysByZIndex_).map(Number);a.sort(fg),t.save(),this.clip(t,e);var l,u,h,c,d,f,p=o||lC;for(l=0,u=a.length;l=r)for(n=r;nu[2];)P=R*++L,c=this.getTransform(e,P),p.replay(g,c,l,o,E),k-=R}if(ub(g,l,I/2,A/2),b&&this.dispatchRenderEvent(g,e,c),g!=t){if(_){var F=t.globalAlpha;t.globalAlpha=i.opacity,t.drawImage(g.canvas,-v,-y),t.globalAlpha=F}else t.drawImage(g.canvas,-v,-y);g.translate(-v,-y)}_||(g.globalAlpha=C)}f&&t.restore()},e.prototype.composeFrame=function(t,e,i){var n=this.getTransform(t,0);this.preCompose(i,t,n),this.compose(i,t,e),this.postCompose(i,t,e,n)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,r){if(this.replayGroup_){var o=e.viewState.resolution,s=e.viewState.rotation,a=this.getLayer(),l={};return this.replayGroup_.forEachFeatureAtCoordinate(t,o,s,i,{},(function(t){var e=nf(t);if(!(e in l))return l[e]=!0,n.call(r,t,a)}),null)}},e.prototype.handleFontsChanged_=function(t){var e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t,e){var i=this.getLayer(),n=i.getSource(),r=t.viewHints[Mx],o=t.viewHints[Ox],s=i.getUpdateWhileAnimating(),a=i.getUpdateWhileInteracting();if(!this.dirty_&&!s&&r||!a&&o)return!0;var l=t.extent,u=t.viewState,h=u.projection,c=u.resolution,d=t.pixelRatio,f=i.getRevision(),p=i.getRenderBuffer(),g=i.getRenderOrder();void 0===g&&(g=CC);var m=Ep(l,p*c),v=u.projection.getExtent();if(n.getWrapX()&&u.projection.canWrapX()&&!kp(v,t.extent)){var y=eg(v),_=Math.max(eg(m)/2,y);m[0]=v[0]-_,m[2]=v[2]+_}if(!this.dirty_&&this.renderedResolution_==c&&this.renderedRevision_==f&&this.renderedRenderOrder_==g&&kp(this.renderedExtent_,m))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var b=new xC(EC(c,d),m,c,d,n.getOverlaps(),this.declutterTree_,i.getRenderBuffer());n.loadFeatures(m,c,h);var w=function(t){var e,n=t.getStyleFunction()||i.getStyleFunction();if(n&&(e=n(t,c)),e){var r=this.renderFeature(t,c,d,e,b);this.dirty_=this.dirty_||r}}.bind(this);if(g){var x=[];n.forEachFeatureInExtent(m,(function(t){x.push(t)})),x.sort(g);for(var S=0,C=x.length;S=0;--b){var w=m[b];if(w.getState()!=Ex)for(var x=w.tileCoord,S=v.getTileCoordExtent(x,this.tmpExtent)[0]-w.extent[0],C=void 0,T=0,E=w.tileKeys.length;T1?i.setAt(0,t.element):i.insertAt(0,t.element)}},initImageLayer:function(t){var e=this;t.getArray().forEach((function(t){e.refreshImageLayer({element:t})}))}},watch:{extent:function(){this.updateElementSize()}},created:function(){var t=new Vb;t.addFeature(this.viewport);var e=this.$parent.map;this.mapSize=e.getSize(),this.updateMapView({target:e}),e.on("change:size",this.updateMapSize),e.on("change:view",this.updateMapView),e.once("postcompose",this.updateViewport),this.minimap.addLayer(new Ib({source:t,style:pw.viewport})),e.getLayers().on("add",this.refreshImageLayer),this.minimap.on("pointerdrag",this.dragViewport),this.minimap.on("click",this.dragViewport),this.initImageLayer(e.getLayers())},mounted:function(){this.updateElementSize(),this.minimap.setTarget(this.$el),this.updateViewport()},beforeDestroy:function(){var t=this.$parent.map;this.mapView.un("change:center",this.updateViewport),this.mapView.un("change:resolution",this.updateViewport),t.un("change:size",this.updateMapSize),t.un("change:view",this.updateMapView),t.getLayers().un("add",this.refreshImageLayer)}},(function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"minimap"})}),[],!1,null,null,null).exports;var VC="modifystart",GC="modifyend",qC=function(t){function e(e,i,n){t.call(this,e),this.features=i,this.mapBrowserEvent=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Tf);function WC(t,e){return t.index-e.index}function KC(t,e){var i,n,r=e.geometry;if(r.getType()===Rg){var o=r;if(1===e.index){var s=Fy(o.getCenter(),t),a=Math.sqrt(s)-o.getRadius();return a*a}}return i=t,n=e.segment,Fy(i,Py(i,n))}function XC(t,e){var i=e.geometry;return i.getType()===Rg&&1===e.index||i.getType()===Fg||i.getType()===Lg?i.getClosestPoint(t):Py(t,e.segment)}function YC(){var t=xb();return function(e,i){return t[Sg]}}const HC=function(t){function e(e){var i;if(t.call(this,e),this.condition_=e.condition?e.condition:n_,this.defaultDeleteCondition_=function(t){return qy(t)&&Jy(t)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:Xy,this.vertexFeature_=null,this.vertexSegments_=null,this.lastPixel_=[0,0],this.ignoreNextSingleClick_=!1,this.modified_=!1,this.rBush_=new Ub,this.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new Ib({source:new Vb({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:YC(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_,LineString:this.writeLineStringGeometry_,LinearRing:this.writeLineStringGeometry_,Polygon:this.writePolygonGeometry_,MultiPoint:this.writeMultiPointGeometry_,MultiLineString:this.writeMultiLineStringGeometry_,MultiPolygon:this.writeMultiPolygonGeometry_,Rectangle:this.writePolygonGeometry_,Ellipse:this.writePolygonGeometry_,Circle:this.writeCircleGeometry_,GeometryCollection:this.writeGeometryCollectionGeometry_},this.source_=null,e.source?(this.source_=e.source,i=new xy(this.source_.getFeatures()),pf(this.source_,Mb,this.handleSourceAdd_,this),pf(this.source_,Db,this.handleSourceRemove_,this)):i=e.features,!i)throw new Error("The modify interaction requires features or a source");this.features_=i,this.features_.forEach(this.addFeature_.bind(this)),pf(this.features_,yy,this.handleFeatureAdd_,this),pf(this.features_,_y,this.handleFeatureRemove_,this),this.lastPointerEvent_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature_=function(t){var e=t.getGeometry();e&&e.getType()in this.SEGMENT_WRITERS_&&this.SEGMENT_WRITERS_[e.getType()].call(this,t,e);var i=this.getMap();i&&i.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,i),pf(t,If,this.handleFeatureChange_,this)},e.prototype.willModifyFeatures_=function(t){this.modified_||(this.modified_=!0,this.dispatchEvent(new qC(VC,this.features_,t)))},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),mf(t,If,this.handleFeatureChange_,this)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,i=[];e.forEach((function(e){t===e.feature&&i.push(e)}));for(var n=i.length-1;n>=0;--n)e.remove(i[n])},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),n={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),n)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n=0;--p)this.insertVertex_.apply(this,n[p])}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var i=this.dragSegments_[e][0],n=i.geometry;if(n.getType()===Lg||n.getType()===Fg)this.features_.remove(i.feature),this.features_.push(i.feature);else if(n.getType()===Rg){var r=n.getCenter(),o=i.featureSegments[0],s=i.featureSegments[1];o.segment[0]=o.segment[1]=r,s.segment[0]=s.segment[1]=r,this.rBush_.update($p(r),o),this.rBush_.update(n.getExtent(),s)}else this.rBush_.update(Tp(i.segment),i)}return this.modified_&&(this.dispatchEvent(new qC(GC,this.features_,t)),this.modified_=!1),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map)},e.prototype.handlePointerAtPixel_=function(t,e){var i=e.getCoordinateFromPixel(t),n=Ep($p(i),e.getView().getResolution()*this.pixelTolerance_),r=this.rBush_.getInExtent(n);if(r.length>0){r.sort((function(t,e){return KC(i,t)-KC(i,e)}));var o=r[0],s=o.segment,a=XC(i,o),l=e.getPixelFromCoordinate(a),u=My(t,l);if(u<=this.pixelTolerance_){var h={};if(o.geometry.getType()===Rg&&1===o.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(a);else{var c=e.getPixelFromCoordinate(s[0]),d=e.getPixelFromCoordinate(s[1]),f=Fy(l,c),p=Fy(l,d);u=Math.sqrt(Math.min(f,p)),this.snappedToVertex_=u<=this.pixelTolerance_,this.snappedToVertex_&&(a=f>p?s[1]:s[0]),this.createOrUpdateVertexFeature_(a);for(var g=1,m=r.length;g=0;--r)h=nf((u=(i=c[r])[0]).feature),u.depth&&(h+="-"+u.depth.join("-")),h in d||(d[h]={}),0===i[1]?(d[h].right=u,d[h].index=u.index):1==i[1]&&(d[h].left=u,d[h].index=u.index+1);for(h in d){switch(l=d[h].right,s=d[h].left,(a=(o=d[h].index)-1)<0&&(a=0),t=e=(n=(u=void 0!==s?s:l).geometry).getCoordinates(),f=!1,n.getType()){case Ag:e[u.depth[0]].length>2&&(e[u.depth[0]].splice(o,1),f=!0);break;case Cg:e.length>2&&(e.splice(o,1),f=!0);break;case Pg:t=t[u.depth[1]];case Eg:(t=t[u.depth[0]]).length>4&&(o==t.length-1&&(o=0),t.splice(o,1),f=!0,0===o&&(t.pop(),t.push(t[0]),a=t.length-1))}if(f){this.setGeometryCoordinates_(n,e);var p=[];if(void 0!==s&&(this.rBush_.remove(s),p.push(s.segment[0])),void 0!==l&&(this.rBush_.remove(l),p.push(l.segment[1])),void 0!==s&&void 0!==l){var g={depth:u.depth,feature:u.feature,geometry:u.geometry,index:a,segment:p};this.rBush_.insert(Tp(g.segment),g)}this.updateSegmentIndices_(n,o,u.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),c.length=0}}return f},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,i,n){this.rBush_.forEachInExtent(t.getExtent(),(function(r){r.geometry===t&&(void 0===i||void 0===r.depth||yg(r.depth,i))&&r.index>e&&(r.index+=n)}))},e}(Nv);const ZC=Sl({props:{position:{type:Array,required:!0}},computed:{positionText:function(){return this.position.join(" × ")}}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"mouse-position-indicator",attrs:{title:"Mouse position in the image"},domProps:{textContent:t._s(t.positionText)}})}),[],!1,null,null,null).exports;const JC=Sl({components:{mousePositionIndicator:ZC},props:{showMousePosition:{type:Boolean,default:!1}},data:function(){return{mousePositionIC:[0,0]}},watch:{mousePosition:function(t){var e=this;iu((function(){e.mousePositionIC=e.invertPointsYAxis(t.slice()).map(Math.round)}),100,"annotations.canvas.mouse-position-ic")}}},undefined,undefined,!1,null,null,null).exports;var QC=6371008.8,tT={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*QC,kilometers:6371.0088,kilometres:6371.0088,meters:QC,metres:QC,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:QC/1852,radians:1,yards:5825721.287490856};function eT(t,e,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=e||{},n.geometry=t,n}function iT(t,e,i){if(void 0===i&&(i={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!cT(t[0])||!cT(t[1]))throw new Error("coordinates must contain numbers");return eT({type:"Point",coordinates:t},e,i)}function nT(t,e,i){void 0===i&&(i={});for(var n=0,r=t;na||d>l||f>u)return s=o,a=i,l=d,u=f,void(r=0);var p=rT([s,o],t.properties);if(!1===e(p,i,n,f,r))return!1;r++,s=o}))&&void 0}}}))}function vT(t){var e=[1/0,1/0,-1/0,-1/0];return dT(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function bT(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")}function wT(t){return"Feature"===t.type?t.geometry:t}function xT(t,e,i){if(void 0===i&&(i={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var n=_T(t),r=wT(e),o=r.type,s=e.bbox,a=r.coordinates;if(s&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(n,s))return!1;"Polygon"===o&&(a=[a]);for(var l=!1,u=0;ut[1]!=u>t[1]&&t[0]<(l-s)*(t[1]-a)/(u-a)+s&&(n=!n)}return n}function CT(t,e,i,n){var r=i[0],o=i[1],s=t[0],a=t[1],l=e[0],u=e[1],h=l-s,c=u-a;return 0==(i[0]-s)*c-(i[1]-a)*h&&(n?"start"===n?Math.abs(h)>=Math.abs(c)?h>0?s0?a=Math.abs(c)?h>0?s<=r&&r0?a<=o&&o=Math.abs(c)?h>0?s0?a=Math.abs(c)?h>0?s<=r&&r<=l:l<=r&&r<=s:c>0?a<=o&&o<=u:u<=o&&o<=a)}const TT=function(t,e,i){void 0===i&&(i={});for(var n=_T(t),r=bT(e),o=0;oe[0])&&(!(t[2]e[1])&&!(t[3]l?s:l,a>u?a:u]),i.push(h),n})),i})(i,t.properties).forEach((function(t){t.id=e.length,e.push(t)}))}))}}(t,e)})),oT(e)};function LT(t,e,i){if(void 0===i&&(i={}),!0===i.final)return function(t,e){var i=LT(e,t);return i=(i+180)%360}(t,e);var n=_T(t),r=_T(e),o=hT(n[0]),s=hT(r[0]),a=hT(n[1]),l=hT(r[1]),u=Math.sin(s-o)*Math.cos(l),h=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(s-o);return uT(Math.atan2(u,h))}const FT=function(t,e,i){void 0===i&&(i={});var n=_T(t),r=_T(e),o=hT(r[1]-n[1]),s=hT(r[0]-n[0]),a=hT(n[1]),l=hT(r[1]),u=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(l);return aT(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),i.units)};function MT(t,e,i,n){void 0===n&&(n={});var r=_T(t),o=hT(r[0]),s=hT(r[1]),a=hT(i),l=lT(e,n.units),u=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(a));return iT([uT(o+Math.atan2(Math.sin(a)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(u))),uT(u)],n.properties)}function OT(t,e){var i=bT(t),n=bT(e);if(2!==i.length)throw new Error(" line1 must only contain 2 coordinates");if(2!==n.length)throw new Error(" line2 must only contain 2 coordinates");var r=i[0][0],o=i[0][1],s=i[1][0],a=i[1][1],l=n[0][0],u=n[0][1],h=n[1][0],c=n[1][1],d=(c-u)*(s-r)-(h-l)*(a-o),f=(h-l)*(o-u)-(c-u)*(r-l),p=(s-r)*(o-u)-(a-o)*(r-l);if(0===d)return null;var g=f/d,m=p/d;return g>=0&&g<=1&&m>=0&&m<=1?iT([r+g*(s-r),o+g*(a-o)]):null}const $T=function(t,e){var i={},n=[];if("LineString"===t.type&&(t=eT(t)),"LineString"===e.type&&(e=eT(e)),"Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var r=OT(t,e);return r&&n.push(r),oT(n)}var o=kT();return o.load(RT(e)),fT(RT(t),(function(t){fT(o.search(t),(function(e){var r=OT(t,e);if(r){var o=bT(r).join(",");i[o]||(i[o]=!0,n.push(r))}}))})),oT(n)};const DT=function(t,e,i){void 0===i&&(i={});var n=iT([1/0,1/0],{dist:1/0}),r=0;return gT(t,(function(t){for(var o=bT(t),s=0;s0&&((g=p.features[0]).properties.dist=FT(e,g,i),g.properties.location=r+FT(a,g,i)),a.properties.dist0}var VT=i(676);const GT=function(t,e,i){void 0===i&&(i={});var n=wT(t),r=wT(e),o=VT.union(n.coordinates,r.coordinates);return 0===o.length?null:1===o.length?nT(o[0],i.properties):sT(o,i.properties)};function qT(t,e){t.geometry.coordinates=tv(t.geometry.coordinates),e.geometry.coordinates=tv(e.geometry.coordinates);var i=GT(t,e);return"MultiPolygon"===i.geometry.type?i.geometry.coordinates[0]:i.geometry.coordinates}var WT=i(977),KT=i.n(WT);var XT=function(t){var e=t.pointerEvent;return e&&"pen"===e.pointerType};function YT(t,e){var i=t.originalEvent.deltaY;t.type==Df?0===(i=-t.originalEvent.wheelDeltaY)&&(i=-t.originalEvent.wheelDeltaX):0===i&&(i=t.originalEvent.deltaX);var n=5;return e<=25&&(n=1),i>0?e+n:i<0?Math.max(e-n,5):e}function HT(t,e){return 0!=t.pointerEvent.pressure?(e=YT(t,e),Math.max(e*t.pointerEvent.pressure,5)*t.map.getView().getResolution()):e}function ZT(){var t=xb();return t[Eg]=t[Eg].concat(t[Cg]),function(e,i){return t[e.getGeometry().getType()]}}const JT=function(t){function e(e){e.freehandCondition=e.freehandCondition?e.freehandCondition:XT,t.call(this,e),this.overlay_=new Ib({source:this.overlay_.getSource(),style:e.style?e.style:ZT(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.sketchPointRadius_=void 0!==e.brushRadius?e.brushRadius:100,this.condition_=void 0!==e.condition?e.condition:Xy,this.resizeCondition_=void 0!==e.resizeCondition?e.resizeCondition:t_,this.isDrawing_=!1,this.sketchCircle_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setMap=function(e){if(t.prototype.setMap.call(this,e),e){var i=e.getView();i&&this.watchViewForChangedResolution(i),e.on("change:view",function(t){this.watchViewForChangedResolution(t.target.getView())}.bind(this))}},e.prototype.watchViewForChangedResolution=function(t){t.on("change:resolution",this.updateRelativeSketchPointRadius_.bind(this))},e.prototype.handleEvent=function(e){var i=e.type,n=!0;return this.resizeCondition_(e)&&(i===Uf||Df)&&(e.originalEvent.preventDefault(),this.updateAbsoluteSketchPointRadius_(e),n=!1),e.type===Iv.POINTERDRAG&&this.handlingDownUpSequence&&(n=!1),t.prototype.handleEvent.call(this,e)&&n},e.prototype.handleDownEvent=function(t){return!(this.handlingDownUpSequence||!this.condition_(t))&&(this.startDrawing_(t),!0)},e.prototype.handleUpEvent=function(t){return!(!this.handlingDownUpSequence||!this.isDrawing_)&&(this.finishDrawing(),!0)},e.prototype.createOrUpdateSketchPoint_=function(t){var e=t.coordinate.slice();if(this.sketchPoint_){this.sketchPoint_.getGeometry().setCenter(e)}else{var i=t.map.getView().getResolution()*this.sketchPointRadius_;this.sketchPoint_=new Cy(new bv(e,i)),this.updateSketchFeatures_()}},e.prototype.updateRelativeSketchPointRadius_=function(t){this.sketchPoint_&&this.sketchPoint_.getGeometry().setRadius(this.sketchPointRadius_*t.target.getResolution())},e.prototype.updateAbsoluteSketchPointRadius_=function(t){this.sketchPoint_&&(this.sketchPointRadius_=YT(t,this.sketchPointRadius_),this.sketchPoint_.getGeometry().setRadius(this.sketchPointRadius_*t.map.getView().getResolution()))},e.prototype.createOrUpdateSketchCircle_=function(t){var e=t.coordinate.slice();this.sketchCircle_?(this.sketchCircle_.setCenter(e),this.sketchCircle_.setRadius(this.sketchPoint_.getGeometry().getRadius())):this.sketchCircle_=new bv(e,this.sketchPoint_.getGeometry().getRadius()),"pen"===t.originalEvent.pointerType&&this.sketchCircle_.setRadius(HT(t,this.sketchPointRadius_))},e.prototype.startDrawing_=function(t){this.isDrawing_=!0,this.createOrUpdateSketchPoint_(t),this.createOrUpdateSketchCircle_(t);var e=t.coordinate;this.finishCoordinate_=e,this.sketchFeature_=new Cy(yv(this.sketchCircle_)),this.updateSketchFeatures_(),this.dispatchEvent(new Qb(Zb,this.sketchFeature_))},e.prototype.handlePointerMove_=function(t){if(this.createOrUpdateSketchPoint_(t),this.createOrUpdateSketchCircle_(t),this.isDrawing_&&this.sketchFeature_){var e=nT(yv(this.sketchCircle_).getCoordinates()),i=this.sketchFeature_.getGeometry(),n=nT(i.getCoordinates());(zT(e,n)||ET(e,n))&&i.setCoordinates(qT(e,n))}},e.prototype.finishDrawing=function(){this.isDrawing_=!1;var t=this.abortDrawing_();t&&(this.dispatchEvent(new Qb(Jb,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t))},e.prototype.getBrushRadius=function(){return this.sketchPointRadius_},e.prototype.abortDrawing_=function(){return this.sketchCircle_=null,t.prototype.abortDrawing_.call(this)},e}(ew);var QT="modifyremove";const tE=function(t){function e(e){t.call(this,e),this.overlay_.setStyle(e.style?e.style:function(){var t=xb();return function(e,i){return t[Rg]}}()),this.sketchPoint_=null,this.sketchPointRadius_=void 0!==e.brushRadius?e.brushRadius:100,this.addCondition_=void 0!==e.addCondition?e.addCondition:Xy,this.subtractCondition_=void 0!==e.subtractCondition?e.subtractCondition:Xy,this.resizeCondition_=void 0!==e.resizeCondition?e.resizeCondition:t_,this.allowRemove_=void 0===e.allowRemove||e.allowRemove,this.isAdding_=!1,this.isSubtracting_=!1,this.sketchCircle_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setMap=function(e){if(t.prototype.setMap.call(this,e),e){var i=e.getView();i&&this.watchViewForChangedResolution(i),e.on("change:view",function(t){this.watchViewForChangedResolution(t.target.getView())}.bind(this))}},e.prototype.watchViewForChangedResolution=function(t){t.on("change:resolution",this.updateRelativeSketchPointRadius_.bind(this))},e.prototype.createOrUpdateSketchPoint_=function(t){var e=t.coordinate.slice();if(this.sketchPoint_){this.sketchPoint_.getGeometry().setCenter(e)}else{var i=t.map.getView().getResolution()*this.sketchPointRadius_;this.sketchPoint_=new Cy(new bv(e,i)),this.overlay_.getSource().addFeature(this.sketchPoint_)}},e.prototype.createOrUpdateSketchCircle_=function(t){var e=t.coordinate.slice();this.sketchCircle_?(this.sketchCircle_.setCenter(e),this.sketchCircle_.setRadius(this.sketchPoint_.getGeometry().getRadius())):this.sketchCircle_=new bv(e,this.sketchPoint_.getGeometry().getRadius()),"pen"===t.originalEvent.pointerType&&this.sketchCircle_.setRadius(HT(t,this.sketchPointRadius_))},e.prototype.updateRelativeSketchPointRadius_=function(t){this.sketchPoint_&&this.sketchPoint_.getGeometry().setRadius(this.sketchPointRadius_*t.target.getResolution())},e.prototype.updateAbsoluteSketchPointRadius_=function(t){this.sketchPoint_&&(this.sketchPointRadius_=YT(t,this.sketchPointRadius_),this.sketchPoint_.getGeometry().setRadius(this.sketchPointRadius_*t.map.getView().getResolution()))},e.prototype.handleEvent=function(e){var i=e.type,n=!0;return this.resizeCondition_(e)&&(i===Uf||Df)&&(e.originalEvent.preventDefault(),this.updateAbsoluteSketchPointRadius_(e),n=!1),t.prototype.handleEvent.call(this,e)&&n},e.prototype.handlePointerMove_=function(t){this.createOrUpdateSketchPoint_(t),this.createOrUpdateSketchCircle_(t)},e.prototype.handleDownEvent=function(t){if(!this.handlingDownUpSequence){if(this.createOrUpdateSketchPoint_(t),this.createOrUpdateSketchCircle_(t),this.subtractCondition_(t))return this.startSubtracting_(t),!0;if(this.addCondition_(t))return this.startAdding_(t),!0}return!1},e.prototype.handleUpEvent=function(t){return!(!this.handlingDownUpSequence||!this.isSubtracting_&&!this.isAdding_)&&(this.finishModifying_(t),!0)},e.prototype.startSubtracting_=function(t){this.isSubtracting_=!0,this.willModifyFeatures_(t),this.subtractCurrentFeatures_(t)},e.prototype.startAdding_=function(t){this.isAdding_=!0,this.willModifyFeatures_(t),this.addCurrentFeatures_(t)},e.prototype.handleDragEvent=function(t){this.createOrUpdateSketchPoint_(t),this.createOrUpdateSketchCircle_(t),this.isSubtracting_?this.subtractCurrentFeatures_(t):this.isAdding_&&this.addCurrentFeatures_(t)},e.prototype.subtractCurrentFeatures_=function(t){var e=yv(this.sketchCircle_),i=nT(e.getCoordinates()),n=e.getArea();this.features_.getArray().forEach((function(e){var r=e.getGeometry();try{var o=nT(r.getCoordinates())}catch(t){return}if(zT(i,o)){var s=function(t,e){t.geometry.coordinates=tv(t.geometry.coordinates),e.geometry.coordinates=tv(e.geometry.coordinates);var i=KT()(t,e);if("MultiPolygon"===i.geometry.type){for(var n,r=0,o=0;or&&(r=s,n=i.geometry.coordinates[o])}return n}return i.geometry.coordinates}(o,i);if(!this.allowRemove_&&n>new mv(s).getArea())return;r.setCoordinates(s)}else ET(i,o)&&this.allowRemove_&&(this.features_.remove(e),this.source_&&this.source_.removeFeature(e),this.dispatchEvent(new qC(QT,new xy([e]),t)))}),this)},e.prototype.addCurrentFeatures_=function(t){var e=yv(this.sketchCircle_),i=nT(e.getCoordinates());this.features_.getArray().forEach((function(t){var n=t.getGeometry();try{var r=nT(n.getCoordinates())}catch(t){return}zT(i,r)?n.setCoordinates(qT(i,r)):ET(i,r)&&n.setCoordinates(e.getCoordinates())}),this)},e.prototype.finishModifying_=function(t){this.isSubtracting_=!1,this.isAdding_=!1,this.dispatchEvent(new qC(GC,this.features_,t))},e.prototype.getBrushRadius=function(){return this.sketchPointRadius_},e}(HC);var eE="select",iE=function(t){function e(e,i,n,r){t.call(this,e),this.selected=i,this.deselected=n,this.mapBrowserEvent=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Tf);function nE(t){if(!this.condition_(t))return!0;var e=this.addCondition_(t),i=this.removeCondition_(t),n=this.toggleCondition_(t),r=!e&&!i&&!n,o=t.map,s=this.getFeatures(),a=[],l=[];if(r){af(this.featureLayerAssociation_),o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.filter_(t,e))return l.push(t),this.addFeatureLayerAssociation_(t,e),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var u=s.getLength()-1;u>=0;--u){var h=s.item(u),c=l.indexOf(h);c>-1?l.splice(c,1):(s.remove(h),a.push(h))}0!==l.length&&s.extend(l)}else{o.forEachFeatureAtPixel(t.pixel,function(t,r){if(this.filter_(t,r))return!e&&!n||pg(s.getArray(),t)?(i||n)&&pg(s.getArray(),t)&&(a.push(t),this.removeFeatureLayerAssociation_(t)):(l.push(t),this.addFeatureLayerAssociation_(t,r)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var d=a.length-1;d>=0;--d)s.remove(a[d]);s.extend(l)}return(l.length>0||a.length>0)&&this.dispatchEvent(new iE(eE,l,a,t)),function(t){return"pointermove"==t.type}(t)}function rE(){var t=xb();return vg(t[Eg],t[Cg]),vg(t[kg],t[Cg]),function(e,i){return e.getGeometry()?t[e.getGeometry().getType()]:null}}const oE=function(t){function e(e){t.call(this,{handleEvent:nE});var i=e||{};this.condition_=i.condition?i.condition:Jy,this.addCondition_=i.addCondition?i.addCondition:Zy,this.removeCondition_=i.removeCondition?i.removeCondition:Zy,this.toggleCondition_=i.toggleCondition?i.toggleCondition:t_,this.multi_=!!i.multi&&i.multi,this.filter_=i.filter?i.filter:bf,this.hitTolerance_=i.hitTolerance?i.hitTolerance:0;var n,r=new Ib({source:new Vb({useSpatialIndex:!1,features:i.features,wrapX:i.wrapX}),style:i.style?i.style:rE(),updateWhileAnimating:!0,updateWhileInteracting:!0});if(this.featureOverlay_=r,i.layers)if("function"==typeof i.layers)n=i.layers;else{var o=i.layers;n=function(t){return pg(o,t)}}else n=bf;this.layerFilter_=n,this.featureLayerAssociation_={};var s=this.getFeatures();pf(s,yy,this.addFeature_,this),pf(s,_y,this.removeFeature_,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeatureLayerAssociation_=function(t,e){this.featureLayerAssociation_[nf(t)]=e},e.prototype.getFeatures=function(){return this.featureOverlay_.getSource().getFeaturesCollection()},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.getLayer=function(t){return this.featureLayerAssociation_[nf(t)]},e.prototype.getOverlay=function(){return this.featureOverlay_},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){var i=this.getMap(),n=this.getFeatures();i&&n.forEach(i.unskipFeature.bind(i)),t.prototype.setMap.call(this,e),this.featureOverlay_.setMap(e),e&&n.forEach(e.skipFeature.bind(e))},e.prototype.addFeature_=function(t){var e=this.getMap();e&&e.skipFeature(t.element)},e.prototype.removeFeature_=function(t){var e=this.getMap();e&&e.unskipFeature(t.element)},e.prototype.removeFeatureLayerAssociation_=function(t){delete this.featureLayerAssociation_[nf(t)]},e}(Dv);var sE,aE,lE=50;const uE=Sl({computed:{isUsingPolygonBrush:function(){return"polygonBrush"===this.interactionMode},isUsingPolygonEraser:function(){return"polygonEraser"===this.interactionMode},isUsingPolygonFill:function(){return"polygonFill"===this.interactionMode}},methods:{togglePolygonBrush:function(){this.isUsingPolygonBrush?this.resetInteractionMode():this.hasSelectedLabel?this.canAdd&&(this.interactionMode="polygonBrush"):this.requireSelectedLabel()},togglePolygonEraser:function(){this.isUsingPolygonEraser?this.resetInteractionMode():this.canModify&&(this.interactionMode="polygonEraser")},togglePolygonFill:function(){this.isUsingPolygonFill?this.resetInteractionMode():this.canModify&&(this.interactionMode="polygonFill")},toggleCurrentInteraction:function(t){aE&&(lE=aE.getBrushRadius(),this.map.removeInteraction(aE),aE=null),this.canAdd&&"polygonBrush"===t?((aE=new JT({map:this.map,source:this.annotationSource,style:pw.editing,brushRadius:lE,resizeCondition:qy})).on("drawend",this.handleNewFeature),this.map.addInteraction(aE)):this.canModify&&"polygonEraser"===t?((aE=new tE({map:this.map,features:this.selectInteraction.getFeatures(),style:pw.editing,brushRadius:lE,allowRemove:!1,addCondition:Zy,subtractCondition:Qy,resizeCondition:qy})).on("modifystart",this.handleFeatureModifyStart),aE.on("modifyend",this.handleFeatureModifyEnd),this.map.addInteraction(aE),this.map.addInteraction(sE)):this.canModify&&"polygonFill"===t&&((aE=new tE({map:this.map,features:this.selectInteraction.getFeatures(),style:pw.editing,brushRadius:lE,addCondition:Qy,subtractCondition:Zy,resizeCondition:qy})).on("modifystart",this.handleFeatureModifyStart),aE.on("modifyend",this.handleFeatureModifyEnd),this.map.addInteraction(aE),this.map.addInteraction(sE))}},created:function(){this.canAdd&&Pl.on("e",this.togglePolygonBrush,0,this.listenerSet),this.canModify&&(Pl.on("r",this.togglePolygonEraser,0,this.listenerSet),Pl.on("t",this.togglePolygonFill,0,this.listenerSet)),(this.canAdd||this.canModify)&&this.$watch("interactionMode",this.toggleCurrentInteraction)},mounted:function(){this.canModify&&(sE=new oE({condition:function(t){return Yy(t)&&t_(t)},style:pw.highlight,layers:[this.annotationLayer],features:this.selectInteraction.getFeatures(),multi:!0})).on("select",this.handleFeatureSelect)}},undefined,undefined,!1,null,null,null).exports;var hE,cE;const dE=Sl({data:function(){return{regularSamplingRows:null,regularSamplingColumns:null,currentSamplingIndex:null,randomSamplingCount:null,randomLocationMemory:{}}},computed:{regularSamplingLocations:function(){for(var t=[this.image.width/this.regularSamplingColumns,this.image.height/this.regularSamplingRows],e=[t[0]/2,t[1]/2],i=[],n=this.regularSamplingRows-1;n>=0;n--)for(var r=this.regularSamplingColumns-1;r>=0;r--)i.unshift([e[0]+r*t[0],e[1]+n*t[1]]);return i},randomSamplingLocations:function(){if(!this.randomLocationMemory.hasOwnProperty(this.image.id)){for(var t=[],e=this.image.width,i=this.image.height,n=this.randomSamplingCount;n>0;n--)t.push([Math.round(Math.random()*e),Math.round(Math.random()*i)]);this.randomLocationMemory[this.image.id]=t}return this.randomLocationMemory[this.image.id]},samplingLocations:function(){return this[this.annotationMode+"Locations"]},isSamplingAnnotationMode:function(){return this.annotationMode.endsWith("Sampling")}},methods:{setSamplingData:function(t,e){"regularSampling"===t?Array.isArray(e)&&e[0]>0&&e[1]>0&&(this.regularSamplingRows=e[0],this.regularSamplingColumns=e[1]):"randomSampling"===t&&e>0&&(this.randomSamplingCount=e)},updateShownSamplingLocation:function(){var t=this.currentSamplingIndex;null!==t&&t>=0&&t=this.samplingLocations.length)&&(this.currentSamplingIndex=t,this.updateShownSamplingLocation(),!0)},createSampledAnnotation:function(){var t=this.samplingLocations[this.currentSamplingIndex];this.createPointAnnotationAt(t[0],t[1])}},watch:{isSamplingAnnotationMode:function(t){t?this.map.addLayer(hE):this.map.removeLayer(hE)},randomSamplingCount:function(){this.randomLocationMemory={}}},created:function(){hE=new Ib({source:new Vb,style:[new Cb({image:new pb({radius:6,stroke:new yb({color:"white",width:4})})}),new Cb({image:new pb({radius:6,stroke:new yb({color:[0,153,255,1],width:2,lineDash:[3]})})})],zIndex:90,updateWhileAnimating:!0,updateWhileInteracting:!0}),cE=new Cy(new iv([0,0])),hE.getSource().addFeature(cE)}},undefined,undefined,!1,null,null,null).exports;var fE=Sl({mixins:[dg],props:{resolution:{required:!0}},data:function(){return{targetWidth:100,leadingDigits:[1,2,5]}},computed:{scale:function(){return this.targetWidth*this.scaleMultiplier},scalePowerOfTen:function(){return this.powerOfTen(this.scale)},scaleMultiplier:function(){return this.hasArea?this.resolution*this.pxWidthInMeter:this.resolution||0},scaleNearest:function(){for(var t=0,e=1/0,i=this.leadingDigits.length-1;i>=0;i--){var n=this.leadingDigits[i]*this.scalePowerOfTen;Math.abs(this.scale-n)=0;i--)Math.abs(this.unitMultipliers[i]-this.scalePowerOfTen)0)||(this.translating||(this.dispatchEvent({type:"translatestart",features:this.features}),this.translating=!0),this.features.forEach((function(i){var n=i.getGeometry();n.translate(t,e),i.setGeometry(n)})),Jl((function(){i.translating=!1,i.dispatchEvent({type:"translateend",features:i.features})}),500,"ol.interactions.Translate.translateend"),!1)}}])&&CE(e.prototype,i),n&&CE(e,n),o}(function(t){function e(e){var i,n=e||{};if(t.call(this,n),this.lastCoordinate_=null,this.features_=void 0!==n.features?n.features:null,n.layers)if("function"==typeof n.layers)i=n.layers;else{var r=n.layers;i=function(t){return pg(r,t)}}else i=bf;this.layerFilter_=i,this.hitTolerance_=n.hitTolerance?n.hitTolerance:0,this.lastFeature_=null,pf(this,qf(Lv),this.handleActiveChanged_,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDownEvent=function(t){if(this.lastFeature_=this.featuresAtPixel_(t.pixel,t.map),!this.lastCoordinate_&&this.lastFeature_){this.lastCoordinate_=t.coordinate,this.handleMoveEvent(t);var e=this.features_||new xy([this.lastFeature_]);return this.dispatchEvent(new xE(_E,e,t.coordinate)),!0}return!1},e.prototype.handleUpEvent=function(t){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(t);var e=this.features_||new xy([this.lastFeature_]);return this.dispatchEvent(new xE(wE,e,t.coordinate)),!0}return!1},e.prototype.handleDragEvent=function(t){if(this.lastCoordinate_){var e=t.coordinate,i=e[0]-this.lastCoordinate_[0],n=e[1]-this.lastCoordinate_[1],r=this.features_||new xy([this.lastFeature_]);r.forEach((function(t){var e=t.getGeometry();e.translate(i,n),t.setGeometry(e)})),this.lastCoordinate_=e,this.dispatchEvent(new xE(bE,r,e))}},e.prototype.handleMoveEvent=function(t){var e=t.map.getViewport();this.featuresAtPixel_(t.pixel,t.map)?(e.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),e.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")},e.prototype.featuresAtPixel_=function(t,e){return e.forEachFeatureAtPixel(t,function(t){if(!this.features_||pg(this.features_.getArray(),t))return t}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){var i=this.getMap();t.prototype.setMap.call(this,e),this.updateState_(i)},e.prototype.handleActiveChanged_=function(){this.updateState_(null)},e.prototype.updateState_=function(t){var e=this.getMap(),i=this.getActive();e&&i||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")},e}(Nv));var kE;const RE=Sl({computed:{isTranslating:function(){return"translate"===this.interactionMode}},methods:{toggleTranslating:function(){this.isTranslating?this.resetInteractionMode():this.modifyInProgress||(this.interactionMode="translate")}},watch:{isTranslating:function(t){this.canModify&&kE.setActive(t)}},mounted:function(){this.canModify&&((kE=new PE({features:this.selectInteraction.getFeatures(),map:this.map})).setActive(!1),kE.on("translatestart",this.handleFeatureModifyStart),kE.on("translateend",this.handleFeatureModifyEnd),this.map.addInteraction(kE),Pl.on("m",this.toggleTranslating,0,this.listenerSet))}},undefined,undefined,!1,null,null,null).exports;const LE=function(t){function e(e,i,n){t.call(this);var r=n||{};this.tileCoord=e,this.state=i,this.interimTile=null,this.key="",this.transition_=void 0===r.transition?250:r.transition,this.transitionStarts_={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.changed=function(){this.dispatchEvent(If)},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==Sx)return t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==Sx){t.interimTile=null;break}t.getState()==xx?e=t:t.getState()==wx?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){this.state=t,this.changed()},e.prototype.load=function(){},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var n=e-i+1e3/60;return n>=this.transition_?1:Av(n/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(Ef);function FE(){var t=ap(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}const ME=function(t){function e(e,i,n,r,o,s){t.call(this,e,i,s),this.crossOrigin_=r,this.src_=n,this.image_=new Image,null!==r&&(this.image_.crossOrigin=r),this.imageListenerKeys_=null,this.tileLoadFunction_=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.state==xx&&(this.unlistenImage_(),this.image_=FE()),this.interimTile&&this.interimTile.dispose(),this.state=Ex,this.changed(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.image_},e.prototype.getKey=function(){return this.src_},e.prototype.handleImageError_=function(){this.state=Cx,this.unlistenImage_(),this.image_=FE(),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=Sx:this.state=Tx,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Cx&&(this.state=wx,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==wx&&(this.state=xx,this.changed(),this.imageListenerKeys_=[gf(this.image_,Lf,this.handleImageError_,this),gf(this.image_,Of,this.handleImageLoad_,this)],this.tileLoadFunction_(this,this.src_))},e.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(vf),this.imageListenerKeys_=null},e}(LE);function OE(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function $E(t,e,i){return t+"/"+e+"/"+i}function DE(t){return $E(t[0],t[1],t[2])}function jE(t,e){var i=/\{z\}/g,n=/\{x\}/g,r=/\{y\}/g,o=/\{-y\}/g;return function(s,a,l){return s?t.replace(i,s[0].toString()).replace(n,s[1].toString()).replace(r,(function(){return(-s[2]-1).toString()})).replace(o,(function(){var t=s[0],i=e.getFullTileRange(t);return pp(i,55),(i.getHeight()+s[2]).toString()})):void 0}}function NE(t){return 1===t.length?t[0]:function(e,i,n){if(e){var r=Bg(function(t){return(t[1]<0||i&&0===o)}))),17),!t.origins)for(var o=0,s=this.resolutions_.length-1;o=this.minZoom;){if(o=2===this.zoomFactor_?zS(s=Math.floor(s/2),s,a=Math.floor(a/2),a,n):this.getTileRangeForExtentAndZ(l,u,n),e.call(i,u,o))return!0;--u}return!1},qE.prototype.getExtent=function(){return this.extent_},qE.prototype.getMaxZoom=function(){return this.maxZoom},qE.prototype.getMinZoom=function(){return this.minZoom},qE.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},qE.prototype.getResolution=function(t){return this.resolutions_[t]},qE.prototype.getResolutions=function(){return this.resolutions_},qE.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]i||i>e.getMaxZoom())return!1;var o,s=e.getExtent();return!(o=s?e.getTileRangeForExtentAndZ(s,i):e.getFullTileRange(i))||o.containsXY(n,r)}(t,n)?t:null},e.prototype.refresh=function(){this.tileCache.clear(),this.changed()},e.prototype.useTile=function(t,e,i,n){},e}(hy),ZE=function(t){function e(e,i){t.call(this,e),this.tile=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Tf);const JE="tileloadstart",QE="tileloadend",tI="tileloaderror";function eI(t,e){t.getImage().src=e}const iI=function(t){function e(e){t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:eI,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible}),this.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,this.tileClass=void 0!==e.tileClass?e.tileClass:ME,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);for(var n in this.tileCache.expireCache(this.tileCache==i?e:{}),this.tileCacheForProjection){var r=this.tileCacheForProjection[n];r.expireCache(r==i?e:{})}},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!bm(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!bm(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!bm(e,t)){var i=nf(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=KE(t)),this.tileGridForProjection[i]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||bm(e,t))return this.tileCache;var i=nf(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new zE(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,e,i,n,r,o){var s=[t,e,i],a=this.getTileCoordForTileUrlFunction(s,r),l=a?this.tileUrlFunction(a,n,r):void 0,u=new this.tileClass(s,void 0!==l?wx:Tx,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=o,pf(u,If,this.handleTileChange,this),u},e.prototype.getTile=function(t,e,i,n,r){var o=this.getProjection();if(o&&r&&!bm(o,r)){var s,a=this.getTileCacheForProjection(r),l=[t,e,i],u=DE(l);a.containsKey(u)&&(s=a.get(u));var h=this.getKey();if(s&&s.key==h)return s;var c=this.getTileGridForProjection(o),d=this.getTileGridForProjection(r),f=this.getTileCoordForTileUrlFunction(l,r),p=new VE(o,c,r,d,l,f,this.getTilePixelRatio(n),this.getGutter(),function(t,e,i,n){return this.getTileInternal(t,e,i,n,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_);return p.key=h,s?(p.interimTile=s,p.refreshInterimChain(),a.replace(u,p)):a.set(u,p),p}return this.getTileInternal(t,e,i,n,o||r)},e.prototype.getTileInternal=function(t,e,i,n,r){var o=null,s=$E(t,e,i),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var l=o;o=this.createTile_(t,e,i,n,r,a),l.getState()==wx?o.interimTile=l.interimTile:o.interimTile=l,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.createTile_(t,e,i,n,r,a),this.tileCache.set(s,o);return o},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var i=mm(t);if(i){var n=nf(i);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}},e}(function(t){function e(e){t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible}),this.generateTileUrlFunction_=!e.tileUrlFunction,this.tileLoadFunction=e.tileLoadFunction,this.tileUrlFunction=e.tileUrlFunction?e.tileUrlFunction.bind(this):BE,this.urls=null,e.urls?this.setUrls(e.urls):e.url&&this.setUrl(e.url),e.tileUrlFunction&&this.setTileUrlFunction(e.tileUrlFunction,this.key_),this.tileLoadingKeys_={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,i=t.target,n=nf(i),r=i.getState();r==xx?(this.tileLoadingKeys_[n]=!0,e=JE):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=r==Cx?tI:r==Sx||r==Ex?QE:void 0),null!=e&&this.dispatchEvent(new ZE(e,i))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=this.urls=UE(t);this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(function(t,e){for(var i=t.length,n=new Array(i),r=0;rh||s>h;)l.push([Math.ceil(o/h),Math.ceil(s/h)]),h+=h;break;case rI:for(var c=o,d=s;c>h||d>h;)l.push([Math.ceil(c/h),Math.ceil(d/h)]),c>>=1,d>>=1;break;default:pp(!1,53)}l.push([1,1]),l.reverse();for(var f=[1],p=[0],g=1,m=l.length;g0?t.animate({resolution:1,duration:this.duration_}):t.setResolution(1))}}])&&cI(e.prototype,i),n&&cI(e,n),o}(Kx);const yI=Sl({mixins:[Ev,Yv,vw,ww,Lw,UC,JC,uE,dE,pE,RE,lI],components:{minimap:zC,labelIndicator:bw,controlButton:Sy},props:{canAdd:{type:Boolean,default:!1},canModify:{type:Boolean,default:!1},canDelete:{type:Boolean,default:!1},image:{type:Object,default:null},annotations:{type:Array,default:function(){return[]}},selectedAnnotations:{type:Array,default:function(){return[]}},center:{type:Array,default:void 0},resolution:{type:Number,default:void 0},selectedLabel:{default:null},lastCreatedAnnotation:{default:null},annotationOpacity:{type:Number,default:1},annotationMode:{type:String,default:"default"},showMinimap:{type:Boolean,default:!0},listenerSet:{type:String,default:"default"}},data:function(){return{initialized:!1,focusOptions:{padding:50,duration:250,resolution:1},interactionMode:"default",mapSize:[0,0],mousePosition:[0,0],modifyInProgress:!1}},computed:{extent:function(){return this.image?[0,0,this.image.width,this.image.height]:[0,0,0,0]},viewExtent:function(){return this.initialized&&this.resolution&&this.map?this.map.getView().calculateExtent(this.mapSize):[0,0,0,0]},projection:function(){return new Xg({code:"biigle-image",units:"pixels",extent:this.extent})},selectedFeatures:function(){return this.selectInteraction?this.selectInteraction.getFeatures():[]},isDefaultInteractionMode:function(){return"default"===this.interactionMode},hasSelectedLabel:function(){return Boolean(this.selectedLabel)},hasSelectedAnnotations:function(){return this.selectedAnnotations.length>0},hasLastCreatedAnnotation:function(){return null!==this.lastCreatedAnnotation},previousButtonTitle:function(){switch(this.annotationMode){case"volare":return"Previous annotation";case"lawnmower":return"Previous image section";case"randomSampling":case"regularSampling":return"Previous sample location";default:return"Previous image"}},nextButtonTitle:function(){switch(this.annotationMode){case"volare":return"Next annotation";case"lawnmower":return"Next image section";case"randomSampling":case"regularSampling":return"Next sample location";default:return"Next image"}}},methods:{createMap:function(){var t=new uI({tipLabel:"Zoom to show whole image",label:""});Pl.on("-",t.handleZoomToExtent.bind(t),0,this.listenerSet);var e=new jC({controls:[new Jx,t],interactions:TS({altShiftDragRotate:!1,doubleClickZoom:!1,keyboard:!1,shiftDragZoom:!1,pinchRotate:!1,pinchZoom:!1,mouseWheelZoom:!1})});return e.addInteraction(new xS({condition:function(t){return!t_(t)}})),t=new vI({label:""}),Pl.on("+",t.zoomToNative.bind(t),0,this.listenerSet),e.addControl(t),e},declareNonReactiveProperties:function(){this.map=this.createMap(),this.imageLayer=new _w,this.tiledImageLayer=new yE,this.annotationFeatures=new xy,this.annotationSource=new Vb({features:this.annotationFeatures}),this.annotationLayer=new Ib({source:this.annotationSource,zIndex:100,updateWhileAnimating:!0,updateWhileInteracting:!0,style:pw.features}),this.selectInteraction=new oE({condition:Yy,style:pw.highlight,layers:[this.annotationLayer],multi:!0}),this.canModify&&(this.featureRevisionMap={},this.modifyInteraction=new HC({features:this.selectInteraction.getFeatures(),deleteCondition:function(t){return t_(t)&&Jy(t)}}))},updateMapSize:function(){this.mapSize=this.map.getSize()},updateMapView:function(t){var e=t.target.getView();this.$emit("moveend",{center:e.getCenter(),resolution:e.getResolution()})},invertPointsYAxis:function(t){for(var e=this.extent[3],i=1;i0&&e.set("color",t.labels[0].label.color),e},handleFeatureModifyStart:function(t){var e=this;this.modifyInProgress=!0,t.features.getArray().forEach((function(t){e.featureRevisionMap[t.getId()]=t.getRevision()}))},handleFeatureModifyEnd:function(t){var e=this;this.modifyInProgress=!1;var i=t.features.getArray().filter((function(t){return e.featureRevisionMap[t.getId()]!==t.getRevision()})).map((function(t){return{id:t.getId(),image_id:t.get("annotation").image_id,points:e.getPoints(t.getGeometry())}}));i.length>0&&this.$emit("update",i)},focusAnnotation:function(t,e,i){var n=this.annotationSource.getFeatureById(t.id);if(n){var r=this.map.getView(),o=e?0:this.focusOptions.duration,s=i?this.resolution:this.focusOptions.resolution,a=n.getGeometry().getExtent().slice();if(a[0]-=this.focusOptions.padding,a[1]-=this.focusOptions.padding,a[2]+=this.focusOptions.padding,a[3]+=this.focusOptions.padding,!i){var l=r.getResolutionForExtent(a);s=l>this.focusOptions.resolution?l:s}r.animate({center:Xp(a),resolution:s,duration:o})}},fitImage:function(){this.map.getView().fit(this.extent,this.map.getSize())},extractAnnotationFromFeature:function(t){return t.get("annotation")},handleFeatureSelect:function(t){this.$emit("select",t.selected.map(this.extractAnnotationFromFeature),t.deselected.map(this.extractAnnotationFromFeature))},handlePrevious:function(){this.modifyInProgress||this.$emit("previous")},conditionalHandleScroll:function(t){t_({originalEvent:t})&&this.handleScroll(t)},handleScroll:function(t){t.preventDefault();var e=t.deltaY||t.deltaX;e<0?this.handleNext():e>0&&this.handlePrevious()},handleNext:function(){this.modifyInProgress||this.$emit("next")},resetInteractionMode:function(){this.interactionMode="default"},getPoints:function(t){var e;switch(t.getType()){case"Circle":e=[t.getCenter(),[t.getRadius()]];break;case"Polygon":case"Rectangle":case"Ellipse":e=t.getCoordinates()[0];break;case"Point":e=[t.getCoordinates()];break;default:e=t.getCoordinates()}return this.convertPointsFromOlToDb(e)},handleNewFeature:function(t){var e=this;if(this.hasSelectedLabel){var i=t.feature.getGeometry();t.feature.set("color",this.selectedLabel.color);this.$emit("new",{shape:i.getType(),points:this.getPoints(i)},(function(){try{e.annotationSource.removeFeature(t.feature)}catch(t){}}))}else this.annotationSource.removeFeature(t.feature)},deleteSelectedAnnotations:function(){!this.modifyInProgress&&this.hasSelectedAnnotations&&confirm("Are you sure you want to delete all selected annotations?")&&this.$emit("delete",this.selectedAnnotations)},deleteLastCreatedAnnotation:function(){this.hasLastCreatedAnnotation&&this.$emit("delete",[this.lastCreatedAnnotation])},createPointAnnotationAt:function(t,e){if(this.hasSelectedLabel){var i=new Cy(new iv([t,e]));this.annotationSource.addFeature(i),this.handleNewFeature({feature:i})}else this.requireSelectedLabel()},requireSelectedLabel:function(){this.$emit("requires-selected-label"),this.resetInteractionMode()},render:function(){this.map&&this.map.render()},handleRegularImage:function(t){t?this.imageLayer.setSource(new vy({canvas:t.canvas,projection:this.projection,canvasExtent:this.extent,canvasSize:[t.width,t.height]})):this.imageLayer.setSource(null)},handleTiledImage:function(t){t?this.tiledImageLayer.setSource(new sI({url:t.url,size:[t.width,t.height],extent:[0,0,t.width,t.height],transition:100})):this.tiledImageLayer.setSource(null)},updateMousePosition:function(t){this.mousePosition=t.coordinate},refreshAnnotationSource:function(t,e){var i={};t.forEach((function(t){i[t.id]=null}));var n={},r=e.getFeatures(),o=r.filter((function(t){return n[t.getId()]=null,!i.hasOwnProperty(t.getId())}));o.length===r.length?e.clear(!0):(o.filter((function(t){return void 0!==t.getId()})).forEach((function(t){e.removeFeature(t)})),t=t.filter((function(t){return!n.hasOwnProperty(t.id)}))),e.addFeatures(t.map(this.createFeature))}},watch:{image:function(t,e){t?!0===t.tiled?(e&&!0===e.tiled||(this.map.removeLayer(this.imageLayer),this.map.addLayer(this.tiledImageLayer)),this.handleTiledImage(t,e)):(e&&!0!==e.tiled||(this.map.removeLayer(this.tiledImageLayer),this.map.addLayer(this.imageLayer)),this.handleRegularImage(t,e)):(this.map.removeLayer(this.tiledImageLayer),this.map.removeLayer(this.imageLayer))},annotations:function(t){this.refreshAnnotationSource(t,this.annotationSource),this.resetHoveredAnnotations()},selectedAnnotations:function(t){var e=this.annotationSource,i=this.selectedFeatures;i.clear(),t.forEach((function(t){i.push(e.getFeatureById(t.id))}))},extent:function(t,e){if(t[2]!==e[2]||t[3]!==e[3]){var i=Xp(t);this.initialized||(i=this.center||i),this.map.setView(new Ux({projection:this.projection,center:i,resolution:this.resolution,zoomFactor:2,minResolution:.01,extent:t})),void 0===this.resolution&&this.map.getView().fit(t),this.initialized||(this.updateMapView({target:this.map}),this.initialized=!0)}},annotationOpacity:function(t){this.annotationLayer.setOpacity(t)},isDefaultInteractionMode:function(t){this.selectInteraction.setActive(t||this.isTranslating),this.canModify&&this.modifyInteraction.setActive(t)}},created:function(){var t=this;this.declareNonReactiveProperties(),this.annotationLayer.set("name","annotations"),this.map.addLayer(this.annotationLayer),this.imageLayer.set("name","imageRegular"),this.tiledImageLayer.set("name","imageTile"),Al.$on("sidebar.toggle",(function(){t.$nextTick((function(){t.map.updateSize()}))})),this.map.on("change:size",this.updateMapSize),this.map.on("moveend",this.updateMapView),this.map.on("pointermove",this.updateMousePosition),this.selectInteraction.on("select",this.handleFeatureSelect),this.map.addInteraction(this.selectInteraction),Pl.on(" ",this.handleNext,0,this.listenerSet),Pl.on("ArrowRight",this.handleNext,0,this.listenerSet),Pl.on("ArrowLeft",this.handlePrevious,0,this.listenerSet),Pl.on("Escape",this.resetInteractionMode,0,this.listenerSet),this.canModify&&(this.modifyInteraction.on("modifystart",this.handleFeatureModifyStart),this.modifyInteraction.on("modifyend",this.handleFeatureModifyEnd),this.map.addInteraction(this.modifyInteraction)),this.canDelete&&(Pl.on("Delete",this.deleteSelectedAnnotations,0,this.listenerSet),Pl.on("Backspace",this.deleteLastCreatedAnnotation,0,this.listenerSet))},mounted:function(){this.map.setTarget(this.$el)}},undefined,undefined,!1,null,null,null).exports;const _I=Sl(new Vue({data:{cache:{}},computed:{shapeMap:function(){return biigle.$require("annotations.shapes")},inverseShapeMap:function(){var t={};for(var e in this.shapeMap)t[this.shapeMap[e]]=parseInt(e,10);return t}},methods:{parseResponse:function(t){return t.data},resolveShape:function(t){return t.shape=this.shapeMap[t.shape_id],t},resolveAllShapes:function(t){return t.forEach(this.resolveShape,this),t},setDeselected:function(t){return t.selected=!1,t},setAllDeselected:function(t){return t.forEach(this.setDeselected),t},fetchAnnotations:function(t){return this.cache.hasOwnProperty(t)||(this.cache[t]=pl.getAnnotations({id:t}).catch((function(){return Vue.Promise.reject("Failed to load annotations for image ".concat(t,"!"))})).then(this.parseResponse).then(this.resolveAllShapes)),this.cache[t].then(this.setAllDeselected)},create:function(t,e){var i=this;return e.shape_id=this.inverseShapeMap[e.shape],delete e.shape,pl.saveAnnotations({id:t},e).then(this.parseResponse).then(this.resolveShape).then(this.setDeselected).then((function(e){return i.cache[t].then((function(t){t.unshift(e)})),e}))},update:function(t){var e=this,i=fl.update({id:t.id},{points:t.points});return i.then((function(){e.cache[t.image_id].then((function(e){for(var i=e.length-1;i>=0;i--)if(e[i].id===t.id)return void(e[i].points=t.points)}))})),i},attachLabel:function(t,e){var i=fl.attachLabel({id:t.id},e);return i.then((function(e){t.labels.unshift(e.data)}),(function(){})),i},detachLabel:function(t,e){var i=fl.detachLabel({annotation_label_id:e.id});return i.then((function(){for(var i=t.labels.length-1;i>=0;i--)if(t.labels[i].id===e.id)return void t.labels.splice(i,1)})),i},delete:function(t){var e=fl.delete({id:t.id}),i=this.cache[t.image_id];return e.then((function(){i.then((function(e){for(var i=e.length-1;i>=0;i--)if(e[i].id===t.id)return void e.splice(i,1)}))})),e}}}),undefined,undefined,!1,null,null,null).exports;var bI=i(789),wI=i.n(bI);const xI=Sl(new Vue({data:{initialized:!1,cache:{},cachedIds:[],maxCacheSize:200,supportsColorAdjustment:!1,currentlyDrawnImage:null,colorAdjustmentDefaults:{brightnessContrast:[0,0],brightnessRGB:[0,0,0],hueSaturation:[0,0],vibrance:[0],gamma:[1]},colorAdjustment:{brightnessContrast:[0,0],brightnessRGB:[0,0,0],hueSaturation:[0,0],vibrance:[0],gamma:[1]}},computed:{imageFileUri:function(){return biigle.$require("annotations.imageFileUri")},tilesUri:function(){return biigle.$require("annotations.tilesUri")},supportedTextureSize:function(){return this.fxCanvas?this.fxCanvas._.gl.getParameter(this.fxCanvas._.gl.MAX_TEXTURE_SIZE):0},hasColorAdjustment:function(){for(var t in this.colorAdjustment)if(this.colorAdjustment.hasOwnProperty(t)&&this.isAdjustmentActive(t))return!0;return!1}},methods:{initialize:function(){this.initialized=!0,this.drawCanvas=document.createElement("canvas"),this.drawCanvas.style.imageOrientation="none",this.drawCanvas.style.visibility="hidden",this.drawCanvas.style.position="fixed",document.body.appendChild(this.drawCanvas);try{this.fxCanvas=wI().canvas(),this.fxTexture=null,this.loadedImageTexture=null}catch(t){console.warn("WebGL not supported. Color adjustment disabled.")}window.addEventListener("beforeunload",(function(){this.fxTexture&&(this.fxTexture.destroy(),this.fxCanvas.width=1,this.fxCanvas.height=1)}))},isTiledImage:function(t){return!0===t.tiled},isAdjustmentActive:function(t){var e=this;return this.colorAdjustment[t].some((function(i,n){return i!==e.colorAdjustmentDefaults[t][n]}))},checkSupportsColorAdjustment:function(t){if(!this.fxCanvas||t.crossOrigin)return!1;if(this.isTiledImage(t))this.supportsColorAdjustment=!1;else{if(this.currentlyDrawnImage&&this.currentlyDrawnImage.width===t.width&&this.currentlyDrawnImage.height===t.height)return this.supportsColorAdjustment;var e=this.supportedTextureSize;if(e=0;i--)n[e].splice(i,1,t[e][i]);this.hasColorAdjustment?this.drawColorAdjustedImage(this.currentlyDrawnImage):r&&this.drawSimpleImage(this.currentlyDrawnImage)}}},watch:{cachedIds:function(t){if(t.length>this.maxCacheSize){var e=t.shift();delete this.cache[e]}}}}),undefined,undefined,!1,null,null,null).exports;const SI=Sl({props:{annotationFilters:{type:Array,default:function(){return[]}},hasActiveFilter:{type:Boolean,default:!1}},data:function(){return{chosenFilterIndex:null}},computed:{hasFilters:function(){return this.annotationFilters.length>0},chosenFilter:function(){return this.annotationFilters[this.chosenFilterIndex]},clearButtonClass:function(){return{"btn-info":this.hasActiveFilter}}},methods:{emitSelectFilter:function(t){this.$emit("select",t)},emitUnselectFilter:function(){this.$emit("unselect")}},watch:{chosenFilter:function(t,e){e&&(this.$refs.filterElement.removeChild(e.$el),e.$off("select",this.emitSelectFilter),e.$off("unselect",this.emitUnselectFilter)),this.$refs.filterElement.appendChild(t.$el),t.$on("select",this.emitSelectFilter),t.$on("unselect",this.emitUnselectFilter)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("form",{staticClass:"annotations-tab__filter form-inline",on:{submit:function(t){t.preventDefault()}}},[i("select",{directives:[{name:"model",rawName:"v-model",value:t.chosenFilterIndex,expression:"chosenFilterIndex"}],staticClass:"form-control",on:{change:function(e){var i=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.chosenFilterIndex=e.target.multiple?i:i[0]}}},t._l(t.annotationFilters,(function(e,n){return i("option",{domProps:{value:n,textContent:t._s(e.name)}})})),0),t._v(" "),i("span",{directives:[{name:"show",rawName:"v-show",value:t.chosenFilter,expression:"chosenFilter"}],ref:"filterElement"}),t._v(" "),i("input",{directives:[{name:"show",rawName:"v-show",value:!t.chosenFilter,expression:"!chosenFilter"}],staticClass:"form-control",attrs:{placeholder:"Filter annotations",type:"text",disabled:"true"}}),t._v(" "),i("button",{staticClass:"btn btn-default",class:t.clearButtonClass,attrs:{title:"Clear annotation filter",disabled:!t.hasActiveFilter},on:{click:function(e){return e.preventDefault(),t.emitUnselectFilter(e)}}},[i("i",{staticClass:"fa fa-times"})])])}),[],!1,null,null,null).exports;var CI=Sl({props:{annotation:{type:Object,required:!0},annotationLabel:{type:Object,required:!0},canDetach:{type:Boolean,default:!1}},computed:{classObject:function(){return{selected:!1!==this.annotation.selected}},shapeClass:function(){return"icon-"+this.annotation.shape.toLowerCase()},username:function(){return this.annotationLabel.user?this.annotationLabel.user.firstname+" "+this.annotationLabel.user.lastname:"(user deleted)"}},methods:{emitSelect:function(t){this.$emit("select",this.annotation,t.shiftKey)},emitDetach:function(){this.$emit("detach",this.annotation,this.annotationLabel)},emitFocus:function(){this.$emit("focus",this.annotation)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("li",{staticClass:"annotations-tab-item__sub-item",class:t.classObject,attrs:{"data-annotation-id":t.annotation.id},on:{click:t.emitSelect,dblclick:t.emitFocus}},[t.canDetach?i("button",{staticClass:"close",attrs:{type:"button",title:"Detach this label from the annotation"},on:{click:function(e){return e.stopPropagation(),t.emitDetach(e)}}},[i("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])]):t._e(),t._v(" "),i("span",{staticClass:"icon",class:t.shapeClass}),t._v(" "),i("span",{domProps:{textContent:t._s(t.username)}})])}),[],!1,null,null,null);var TI=Sl({components:{annotationItem:CI.exports},props:{label:{type:Object,default:function(){return{}}},annotations:{type:Array,default:function(){return[]}},canDetachOthers:{type:Boolean,default:!1},ownUserId:{type:Number,default:null}},data:function(){return{open:!1}},computed:{title:function(){return"Annotations with label ".concat(this.label.name)},classObject:function(){return{selected:this.isSelected}},count:function(){return this.annotationItems.length},countTitle:function(){return"There are ".concat(this.count," annotations with label ").concat(this.label.name)},colorStyle:function(){return"background-color: #"+this.label.color},isSelected:function(){return this.open||this.annotations.reduce((function(t,e){return t||!1!==e.selected}),!1)},annotationItems:function(){var t=this,e=[];return this.annotations.forEach((function(i){i.labels.forEach((function(n){n.label_id===t.label.id&&e.push({annotation:i,annotationLabel:n,canDetach:t.canDetachAnnotationLabel(n)})}))})),e}},methods:{toggleOpen:function(){this.open=!this.open},emitSelect:function(t,e){this.$emit("select",t,e)},emitDetach:function(t,e){this.$emit("detach",t,e)},emitFocus:function(t){this.$emit("focus",t)},canDetachAnnotationLabel:function(t){return this.canDetachOthers||this.ownUserId===t.user_id}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("li",{staticClass:"annotations-tab-item",class:t.classObject,attrs:{title:t.title}},[i("div",{staticClass:"annotations-tab-item__title",on:{click:t.toggleOpen}},[i("span",{staticClass:"pull-right badge",attrs:{title:t.countTitle},domProps:{textContent:t._s(t.count)}}),t._v(" "),i("span",{staticClass:"annotations-tab-item__color",style:t.colorStyle}),t._v(" "),i("span",{domProps:{textContent:t._s(t.label.name)}})]),t._v(" "),i("ul",{directives:[{name:"show",rawName:"v-show",value:t.isSelected,expression:"isSelected"}],staticClass:"annotations-tab-item__list list-unstyled"},t._l(t.annotationItems,(function(e){return i("annotation-item",{key:e.annotationLabel.id,attrs:{annotation:e.annotation,"annotation-label":e.annotationLabel,"can-detach":e.canDetach},on:{select:t.emitSelect,detach:t.emitDetach,focus:t.emitFocus}})})),1)])}),[],!1,null,null,null);const EI=Sl({components:{filters:SI,labelItem:TI.exports},props:{hasActiveFilter:{type:Boolean,default:!1},annotations:{type:Array,default:function(){return[]}},annotationFilters:{type:Array,default:function(){return[]}},canDetachOthers:{type:Boolean,default:!1},ownUserId:{type:Number,default:null},selectedAnnotations:{type:Array,default:function(){return[]}}},computed:{labelItems:function(){var t={},e={},i={};return this.annotations.forEach((function(n){n.labels.forEach((function(r){t.hasOwnProperty(r.label.id)||(t[r.label_id]=r.label,e[r.label_id]=[]);var o=n.id+"-"+r.label_id;i.hasOwnProperty(o)||(i[o]=null,e[r.label_id].push(n))}))})),Object.values(t).sort((function(t,e){return t.name.toLowerCase()>e.name.toLowerCase()?1:-1})).map((function(t){return{id:t.id,label:t,annotations:e[t.id]}}))}},methods:{handleSelect:function(t,e){!1!==t.selected&&e?this.$emit("deselect",t):this.$emit("select",t,e)},emitDetach:function(t,e){this.$emit("detach",t,e)},emitSelectFilter:function(t){this.$emit("select-filter",t)},emitUnselectFilter:function(){this.$emit("unselect-filter")},emitFocus:function(t){this.$emit("focus",t)},scrollIntoView:function(t){var e,i=this.$refs.scrollList,n=i.scrollTop,r=i.offsetHeight,o=1/0,s=0;t.forEach((function(t){for(var n=i.querySelectorAll('[data-annotation-id="'.concat(t.id,'"]')),r=n.length-1;r>=0;r--)e=n[r],o=Math.min(e.offsetTop,o),s=Math.max(e.offsetTop+e.offsetHeight,s)})),n>o?i.scrollTop=o:n+r=s-o?s-i.offsetHeight:o)}},watch:{selectedAnnotations:function(t){t.length>0&&this.$nextTick((function(){this.scrollIntoView(t)}))}}},undefined,undefined,!1,null,null,null).exports;var II={};const AI=Sl({mixins:[EI],computed:{plugins:function(){return II}}},undefined,undefined,!1,null,null,null).exports;var PI={};const kI=Sl({components:{labelTrees:Jh},data:function(){return{labelTrees:[],selectedLabel:null}},computed:{plugins:function(){return PI}},methods:{handleSelectedLabel:function(t){this.selectedLabel=t,this.$emit("select",t)},handleDeselectedLabel:function(){this.selectedLabel=null,this.$emit("select",null)}},created:function(){this.labelTrees=biigle.$require("annotations.labelTrees")}},undefined,undefined,!1,null,null,null).exports;const RI=Sl({data:function(){return{filenames:{},currentId:null}},computed:{filename:function(){if(this.currentId){var t=this.filenames[this.currentId].split(".");return t.length>1&&(t[t.length-1]="png"),"biigle_screenshot_"+(t=t.join(".").toLowerCase())}return"biigle_screenshot.png"}},methods:{trimCanvas:function(t){var e,i,n,r=t.getContext("2d"),o=document.createElement("canvas").getContext("2d"),s=r.getImageData(0,0,t.width,t.height),a=s.data.length,l={top:null,left:null,right:null,bottom:null};for(e=0;e0?this.annotationOpacity=0:this.annotationOpacity=1}},watch:{annotationOpacity:function(t){t=parseFloat(t),this.$emit("change","annotationOpacity",t),this.settings.set("annotationOpacity",t)},cachedImagesCount:function(t){t=parseFloat(t),this.$emit("change","cachedImagesCount",t),this.settings.set("cachedImagesCount",t)},mousePosition:function(t){this.$emit("change","mousePosition",t),this.settings.set("mousePosition",t)},zoomLevel:function(t){this.$emit("change","zoomLevel",t),this.settings.set("zoomLevel",t)},scaleLine:function(t){this.$emit("change","scaleLine",t),this.settings.set("scaleLine",t)},labelTooltip:function(t){this.$emit("change","labelTooltip",t),this.settings.set("labelTooltip",t)},measureTooltip:function(t){this.$emit("change","measureTooltip",t),this.settings.set("measureTooltip",t)},minimap:function(t){this.$emit("change","minimap",t),this.settings.set("minimap",t)},progressIndicator:function(t){this.$emit("change","progressIndicator",t),this.settings.set("progressIndicator",t)}},created:function(){var t=this;this.restoreKeys.forEach((function(e){t[e]=t.settings.get(e)})),Pl.on("o",this.toggleAnnotationOpacity)}},undefined,undefined,!1,null,null,null).exports;biigle.$declare("annotations.components.annotationCanvas",yI),biigle.$declare("annotations.components.annotationsTabPlugins",II),biigle.$declare("annotations.components.labelsTabPlugins",PI),biigle.$declare("annotations.components.settingsTabPlugins",MI),biigle.$declare("annotations.ol.AttachLabelInteraction",Wv),biigle.$declare("annotations.stores.annotations",_I),biigle.$declare("annotations.stores.images",xI),biigle.$declare("annotations.stores.styles",pw);i(576);const $I=Sl({components:{powerToggle:El},data:function(){return{mode:"default",modes:["default","volare","lawnmower","randomSampling","regularSampling"],restoreKeys:["randomSamplingNumber","regularSamplingRows","regularSamplingColumns"],randomSamplingNumber:9,regularSamplingRows:3,regularSamplingColumns:3}},computed:{isVolareActive:function(){return"volare"===this.mode},isLawnmowerActive:function(){return"lawnmower"===this.mode},isRandomSamplingActive:function(){return"randomSampling"===this.mode},isRegularSamplingActive:function(){return"regularSampling"===this.mode}},methods:{startVolare:function(){this.setMode("volare")},startLawnmower:function(){this.setMode("lawnmower")},startRandomSampling:function(){this.setMode("randomSampling")},startRegularSampling:function(){this.setMode("regularSampling")},setMode:function(t){-1!==this.modes.indexOf(t)&&(this.mode=t)},resetMode:function(){this.mode="default"},emitAttachLabel:function(){this.$emit("attach-label")},emitCreateSample:function(){this.$emit("create-sample")}},watch:{mode:function(t,e){switch(e){case"volare":Pl.off("Enter",this.emitAttachLabel);break;case"randomSampling":case"regularSampling":Pl.off("Enter",this.emitCreateSample)}switch(t){case"volare":Pl.on("Enter",this.emitAttachLabel);break;case"randomSampling":case"regularSampling":Pl.on("Enter",this.emitCreateSample)}switch(t){case"randomSampling":this.$emit("change",t,this.randomSamplingNumber);break;case"regularSampling":this.$emit("change",t,[this.regularSamplingRows,this.regularSamplingColumns]);break;default:this.$emit("change",t)}},randomSamplingNumber:function(t){FI.set("randomSamplingNumber",t)},regularSamplingRows:function(t){FI.set("regularSamplingRows",t)},regularSamplingColumns:function(t){FI.set("regularSamplingColumns",t)}},created:function(){var t=this;this.restoreKeys.forEach((function(e){return t[e]=FI.get(e)}));var e=Ql.get("annotationMode");e&&Al.$once("images.change",(function(){return t.setMode(e)}))}},undefined,undefined,!1,null,null,null).exports;const DI=Sl({data:function(){return{isBrightnessRgbActive:!1,colorAdjustmentDefaults:{brightnessContrast:[0,0],brightnessRGB:[0,0,0],hueSaturation:[0,0],vibrance:[0],gamma:[1]},colorAdjustment:{brightnessContrast:[0,0],brightnessRGB:[0,0,0],hueSaturation:[0,0],vibrance:[0],gamma:[1]}}},methods:{resetType:function(t,e){void 0!==e?this.colorAdjustment[t].splice(e,1,this.colorAdjustmentDefaults[t][e]):this.colorAdjustment[t]=this.colorAdjustmentDefaults[t].slice()},reset:function(){for(var t in this.colorAdjustment)this.colorAdjustment.hasOwnProperty(t)&&this.resetType(t)},toggleBrightnessRgb:function(){this.isBrightnessRgbActive?this.resetType("brightnessRGB"):this.resetType("brightnessContrast",0),this.isBrightnessRgbActive=!this.isBrightnessRgbActive}},watch:{colorAdjustment:{handler:function(){this.$emit("change",this.colorAdjustment)},deep:!0}}},undefined,undefined,!1,null,null,null).exports;const jI=Sl({mixins:[lu],components:{fileLabelList:Gd},props:{fileId:{required:!0,type:Number},selectedLabel:{type:Object,default:null},type:{type:String,default:"image"}},data:function(){return{cache:{},open:!1,currentLabels:[],saving:!1,userId:null,isAdmin:!1}},computed:{hasLabels:function(){return this.currentLabels.length>0},hasSelectedLabel:function(){return null!==this.selectedLabel},canAttachSelectedLabel:function(){if(this.hasSelectedLabel){for(var t=this.currentLabels.length-1;t>=0;t--)if(this.currentLabels[t].label.id===this.selectedLabel.id)return!1;return!this.saving}return!1},proposedLabelTitle:function(){return this.hasSelectedLabel?this.canAttachSelectedLabel?"Attach '".concat(this.selectedLabel.name,"' as new ").concat(this.type," label"):"The selected label is already attached.":"Please select a label first."}},methods:{startSaving:function(){this.saving=!0},finishSaving:function(){this.saving=!1},showFileLabels:function(t){this.cache.hasOwnProperty(t)||(this.startLoading(),this.currentLabels=[],"image"===this.type?this.cache[t]=Ud.query({image_id:t}):this.cache[t]=zd.query({video_id:t}),this.cache[t].finally(this.finishLoading)),this.cache[t].then(this.updateCurrentLabels,ou)},updateCurrentLabels:function(t){this.currentLabels=t.body},handleDeletedLabel:function(t){for(var e=this.currentLabels.length-1;e>=0;e--)if(this.currentLabels[e].id===t.id){this.currentLabels.splice(e,1);break}},attachSelectedLabel:function(){var t=this;this.startSaving(),("image"===this.type?Ud.save({image_id:this.fileId},{label_id:this.selectedLabel.id}):zd.save({video_id:this.fileId},{label_id:this.selectedLabel.id})).then((function(e){return t.currentLabels.push(e.data)}),ou).finally(this.finishSaving)},attachSelectedLabelIfPossible:function(){if(this.canAttachSelectedLabel)return this.attachSelectedLabel(),!1}},watch:{fileId:function(t){this.open&&this.showFileLabels(t)},open:function(t){t?(this.showFileLabels(this.fileId),Pl.on("Enter",this.attachSelectedLabelIfPossible)):Pl.off("Enter",this.attachSelectedLabelIfPossible)}},created:function(){var t=this;this.$parent.$watch("open",(function(e){return t.open=e}))}},undefined,undefined,!1,null,null,null).exports;const NI=Sl({mixins:[jI],created:function(){this.userId=biigle.$require("annotations.userId"),this.isAdmin=biigle.$require("annotations.isAdmin")}},undefined,undefined,!1,null,null,null).exports;const BI=Sl({components:{typeahead:Hl},data:function(){return{name:"",placeholder:"",selectedItem:null}},computed:{items:function(){return[]},selectedItemName:function(){return this.selectedItem?this.selectedItem.name:""}},methods:{select:function(t){this.selectedItem=t},filter:function(t){return t},reset:function(){this.selectedItem=null}},watch:{selectedItem:function(t){t?this.$emit("select",this):this.$emit("unselect")}},created:function(){this.$mount()}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("typeahead",{attrs:{items:t.items,placeholder:t.placeholder,value:t.selectedItemName},on:{select:t.select}})}),[],!1,null,null,null).exports;const UI=Sl(Vue.extend({mixins:[BI],components:{typeahead:Zh},data:function(){return{name:"label",annotations:[],placeholder:"label name"}},computed:{items:function(){var t={};return this.annotations.forEach((function(e){e.labels.forEach((function(e){t[e.label.id]=e.label}))})),Object.values(t)}},methods:{filter:function(t){if(!this.selectedItem)return t;var e=this.selectedItem.id;return t.filter((function(t){return t.labels.reduce((function(t,i){return t||i.label.id===e}),!1)}))}}}),undefined,undefined,!1,null,null,null).exports;const zI=Sl(Vue.extend({mixins:[BI],data:function(){return{name:"session",sessions:[],placeholder:"session name"}},computed:{items:function(){return this.sessions.map((function(t){return t.starts_at=new Date(t.starts_at),t.ends_at=new Date(t.ends_at),t}))}},methods:{filter:function(t){if(!this.selectedItem)return t;var e=this.selectedItem,i={};return e.users.forEach((function(t){i[t.id]=null})),t.filter((function(t){for(var n=t.labels.length-1;n>=0;n--)if(i.hasOwnProperty(t.labels[n].user_id)){var r=new Date(t.created_at);return r>=e.starts_at&&r0)return void this.focussedAnnotationIndex--;this.focussedAnnotationIndex===-1/0?this.focussedAnnotationIndex=Math.max(this.filteredAnnotations.length-2,0):this.focussedAnnotationIndex=1/0}else if(this.isLawnmowerAnnotationMode){if(this.$refs.canvas.showPreviousImageSection())return;this.annotationModeCarry=1/0}else if(this.isSamplingAnnotationMode){if(this.$refs.canvas.showPreviousSamplingLocation())return;this.annotationModeCarry=1/0}this.imageIndex=this.getPreviousIndex(this.imageIndex)}},maybeUpdateFocussedAnnotation:function(){this.isVolareAnnotationMode?this.filteredAnnotations.length>0?this.focussedAnnotationIndex===1/0?this.focussedAnnotationIndex=this.filteredAnnotations.length-1:this.focussedAnnotationIndex=0:(this.focussedAnnotationIndex=null,this.$refs.canvas.fitImage()):this.focussedAnnotationIndex=null},maybeUpdateShownImageSection:function(){this.isLawnmowerAnnotationMode&&(this.annotationModeCarry===1/0?this.$refs.canvas.showLastImageSection():this.$refs.canvas.showFirstImageSection())},maybeUpdateShownSampling:function(t){this.isSamplingAnnotationMode&&(this.$refs.canvas.setSamplingData(this.annotationMode,t),this.annotationModeCarry===1/0?this.$nextTick(this.$refs.canvas.showLastSamplingLocation):this.$nextTick(this.$refs.canvas.showFirstSamplingLocation))},maybeUpdateAnnotationMode:function(t){this.maybeUpdateFocussedAnnotation(),this.maybeUpdateShownImageSection(),this.maybeUpdateShownSampling(t)},handleMapMoveend:function(t){this.mapCenter=t.center,this.mapResolution=t.resolution,Ql.set({r:Math.round(100*t.resolution),x:Math.round(t.center[0]),y:Math.round(t.center[1])})},handleSelectAnnotation:function(t,e){!0===e||"object"===WI(e)&&e.shiftKey?t.selected=!0:this.annotations.forEach((function(e){e.selected=t.id===e.id}))},handleSelectAnnotations:function(t,e){t.forEach((function(t){t.selected=!0})),e.forEach((function(t){t.selected=!1}))},handleDeselectAnnotation:function(t){t?t.selected=!1:this.annotations.forEach((function(t){t.selected=!1}))},focusAnnotation:function(t,e,i){this.$refs.canvas.focusAnnotation(t,e,i)},handleDetachAnnotationLabel:function(t,e){this.isEditor&&(t.labels.length>1?_I.detachLabel(t,e).catch(ou):confirm("Detaching the last label of an annotation deletes the whole annotation. Do you want to delete the annotation?")&&this.handleDeleteAnnotation(t))},handleDeleteAnnotation:function(t){this.isEditor&&(this.lastCreatedAnnotation&&this.lastCreatedAnnotation.id===t.id&&(this.lastCreatedAnnotation=null),Vue.set(t,"markedForDeletion",!0),_I.delete(t).catch((function(e){t.markedForDeletion=!1,ou(e)})))},handleDeleteAnnotations:function(t){t.forEach(this.handleDeleteAnnotation)},handleUpdateAnnotations:function(t){this.isEditor&&Vue.Promise.all(t.map(_I.update)).catch(ou)},selectAndFocusAnnotation:function(t,e){this.selectedAnnotations.forEach((function(t){t.selected=!1})),t.selected=!0,this.focusAnnotation(t,!0,e)},handleFilter:function(t){this.annotationFilter=t},resetFilter:function(){this.annotationFilter&&this.annotationFilter.reset(),this.annotationFilter=null},handleSelectedLabel:function(t){this.selectedLabel=t},handleNewAnnotation:function(t,e){this.isEditor&&(t.label_id=this.selectedLabel.id,t.confidence=1,_I.create(this.imageId,t).then(this.setLastCreatedAnnotation).catch(ou).finally(e))},handleAttachLabel:function(t,e){if(e=e||this.selectedLabel,this.isEditor&&e){var i={label_id:e.id,confidence:1},n=_I.attachLabel(t,i);return n.catch(ou),n}return Vue.Promise.reject()},handleSwapLabel:function(t,e){var i=this;if(e=e||this.selectedLabel,this.isEditor&&e){var n=t.labels.filter((function(t){return t.user_id===i.userId})).sort((function(t,e){return t.id-e.id})).pop();this.handleAttachLabel(t,e).then((function(){n&&i.handleDetachAnnotationLabel(t,n)})).catch(ou)}},handleAttachAllSelected:function(){this.selectedAnnotations.forEach(this.handleAttachLabel)},emitImageChanged:function(){Al.$emit("images.change",this.imageId,this.image)},cachePreviousAndNext:function(){for(var t=[],e=[this.imageId],i=Math.min(this.cachedImagesCount,this.imagesIds.length),n=1;n<=i;n++){var r=this.imagesIds[this.getNextIndex(this.imageIndex+n)];e.includes(r)||(t.push(_I.fetchAnnotations(r)),t.push(xI.fetchImage(r)),e.push(r));var o=this.imagesIds[this.getPreviousIndex(this.imageIndex-n)];e.includes(o)||(t.push(_I.fetchAnnotations(o)),t.push(xI.fetchImage(o)),e.push(o))}Vue.Promise.all(t).catch((function(){}))},setLastCreatedAnnotation:function(t){var e=this;this.lastCreatedAnnotationTimeout&&window.clearTimeout(this.lastCreatedAnnotationTimeout),this.lastCreatedAnnotation=t,this.lastCreatedAnnotationTimeout=window.setTimeout((function(){e.lastCreatedAnnotation=null}),1e4)},updateColorAdjustment:function(t){var e=this.$refs.canvas;Jl((function(){xI.updateColorAdjustment(t),e.render()}),100,"annotations.color-adjustment.update")},handleSettingsChange:function(t,e){switch(t){case"annotationOpacity":this.annotationOpacity=e;break;case"cachedImagesCount":this.cachedImagesCount=e;break;case"mousePosition":this.showMousePosition=e;break;case"zoomLevel":this.showZoomLevel=e;break;case"scaleLine":this.showScaleLine=e;break;case"labelTooltip":this.showLabelTooltip=e;break;case"measureTooltip":this.showMeasureTooltip=e;break;case"minimap":this.showMinimap=e}},handleAnnotationModeChange:function(t,e){this.annotationMode=t,this.annotationModeCarry=null,this.maybeUpdateAnnotationMode(e)},handleOpenedTab:function(t){FI.set("openTab",t)},handleClosedTab:function(){FI.delete("openTab")},handleLoadingError:function(t){su.danger(t)},createSampledAnnotation:function(){this.$refs.canvas.createSampledAnnotation()},fetchImagesArea:function(){this.imagesArea||(this.imagesArea={},qI.get({id:this.volumeId}).then(this.setImagesArea,ou))},setImagesArea:function(t){this.imagesArea=t.body},handleRequiresSelectedLabel:function(){su.info("Please select a label first."),this.$refs.sidebar.$emit("open","labels")},maybeShowTilingInProgressMessage:function(){this.image.tilingInProgress&&su.warning("This image is currently being processed. Please retry later.")}},watch:{imageId:function(t){t&&(this.startLoading(),Vue.Promise.all(this.getImageAndAnnotationsPromises(t)).then(this.setCurrentImageAndAnnotations).then(this.updateUrlSlug).then(this.maybeUpdateAnnotationMode).then(this.emitImageChanged).then(this.maybeShowTilingInProgressMessage).then(this.cachePreviousAndNext).catch(this.handleLoadingError).finally(this.finishLoading))},cachedImagesCount:function(){Jl(this.cachePreviousAndNext,1e3,"annotations.cached-image-count.update")},focussedAnnotation:function(t){t&&this.selectAndFocusAnnotation(t,this.userUpdatedVolareResolution)},annotationFilter:function(){this.maybeUpdateFocussedAnnotation()},showScaleLine:function(t){t&&this.fetchImagesArea()},showMeasureTooltip:function(t){t&&this.fetchImagesArea()},isVolareAnnotationMode:function(t){t||(this.userUpdatedVolareResolution=!1)},mapResolution:function(){this.isVolareAnnotationMode&&(this.userUpdatedVolareResolution=!0)},annotations:function(t){this.annotationFilters[0].annotations=t,this.annotationFilters[1].annotations=t}},created:function(){var t=this;if(this.allImagesIds=biigle.$require("annotations.imagesIds"),this.volumeId=biigle.$require("annotations.volumeId"),this.isEditor=biigle.$require("annotations.isEditor"),this.userId=biigle.$require("annotations.userId"),this.annotationFilters=[new UI,new GI,new VI({data:{shapes:biigle.$require("annotations.shapes")}}),new zI({data:{sessions:biigle.$require("annotations.sessions")}})],0!==this.imagesIds.length){var e=this.imagesIds.indexOf(biigle.$require("annotations.imageId"));if(-1===e&&(e=0,su.info("The requested image does not exist in your current volume filtering. Switching to the first image.")),this.imageIndex=e,void 0!==Ql.get("r")&&(this.mapResolution=parseInt(Ql.get("r"),10)/100),void 0!==Ql.get("x")&&void 0!==Ql.get("y")&&(this.mapCenter=[parseInt(Ql.get("x"),10),parseInt(Ql.get("y"),10)]),Al.$on("annotations.select",this.handleSelectAnnotation),Al.$on("annotations.deselect",this.handleDeselectAnnotation),Al.$on("annotations.detachLabel",this.handleDetachAnnotationLabel),Al.$on("annotations.delete",this.handleDeleteAnnotation),Al.$on("annotations.focus",this.focusAnnotation),Ql.get("annotation")){var i=parseInt(Ql.get("annotation"));Al.$once("images.change",(function(){for(var e=t.annotations,n=e.length-1;n>=0;n--)if(e[n].id===i)return void t.selectAndFocusAnnotation(e[n])}))}if(FI.has("openTab")){var n=FI.get("openTab");"color-adjustment"===n?Al.$once("images.change",(function(){t.supportsColorAdjustment&&(t.openTab=n)})):this.openTab=n}}else su.info("Your current volume filtering contains no images.")},mounted:function(){Al.$emit("annotations.map.init",this.$refs.canvas.map)}},undefined,undefined,!1,null,null,null).exports;var XI=function(t){return[Math.cos(2*Math.PI*t)+1,Math.sin(2*Math.PI*t)+1]};const YI=Sl({props:{fileIds:{type:Array,default:function(){return[]}},filenames:{type:Object,default:function(){return{}}},showIndicator:{type:Boolean,default:!0},currentFileId:{type:Number,required:!0},type:{type:String,required:!0}},data:function(){return{fileIdsLeft:[]}},computed:{progressPath:function(){return"M 2 1 A 1 1 0 "+(this.progress>=.5?1:0)+" 1 "+XI(this.progress).join(" ")+"L 1 1"},initialProgressPath:function(){return"M 1 1 L "+XI(this.initialProgress).join(" ")},progressTitle:function(){var t=["started at ".concat(this.initialFileNumber)];return this.hasSeenAllFiles&&t.push("seen all"),"".concat(nu(this.type)," ").concat(this.currentFileNumber," of ").concat(this.fileIds.length," (").concat(t.join(", "),")")},currentFileNumber:function(){return this.currentFileId?this.fileIds.indexOf(this.currentFileId)+1:0},progress:function(){return this.currentFileNumber/this.fileIds.length},initialProgress:function(){return this.initialFileNumber/this.fileIds.length},hasSeenAllFiles:function(){return 0===this.fileIdsLeft.length},showInitialProgressMarker:function(){return 1!==this.initialFileNumber},indicatorClass:function(){return this.hasSeenAllFiles?"progress-indicator--all":""},filenameClass:function(){return this.hasSeenAllFiles?"text-success":""},filenameTitle:function(){return this.hasSeenAllFiles?"You have seen all ".concat(this.type,"s"):""},currentFilename:function(){return this.filenames[this.currentFileId]}},watch:{currentFileId:function(t){this.fileIdsLeft=this.fileIdsLeft.filter((function(e){return e!==t}))}},created:function(){var t=this;this.initialFileNumber=this.fileIds.indexOf(this.currentFileId)+1,this.fileIdsLeft=this.fileIds.filter((function(e){return e!==t.currentFileId}))}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("span",[t.showIndicator?i("span",{staticClass:"progress-indicator-container",attrs:{title:t.progressTitle}},[i("svg",{staticClass:"progress-indicator",class:t.indicatorClass,attrs:{viewBox:"-0.2 -0.2 2.4 2.4"}},[i("circle",{staticClass:"progress-indicator__background",attrs:{cx:"1",cy:"1",r:"1"}}),t._v(" "),i("g",{staticClass:"progress-indicator__progress"},[1==t.progress?i("circle",{attrs:{cx:"1",cy:"1",r:"1"}}):i("path",{attrs:{d:t.progressPath}})]),t._v(" "),t.showInitialProgressMarker?i("path",{staticClass:"progress-indicator__marker",attrs:{d:t.initialProgressPath}}):t._e()])]):t._e(),t._v(" "),i("strong",{class:t.filenameClass,attrs:{title:t.filenameTitle},domProps:{textContent:t._s(t.currentFilename)}})])}),[],!1,null,null,null).exports;const HI=Sl({components:{breadcrumb:YI},data:function(){return{volumeId:null,allIds:[],filenames:{},showIndicator:!0,currentId:null}},computed:{currentFilename:function(){return this.filenames[this.currentId]},ids:function(){var t=this.allIds.slice(),e=window.localStorage.getItem("biigle.volumes.".concat(this.volumeId,".files"));if(e){var i={};return t.forEach((function(t){i[t]=null})),JSON.parse(e).filter((function(t){return i.hasOwnProperty(t)}))}return t}},methods:{updateShowIndicator:function(t){this.showIndicator=!1!==t},updateCurrentId:function(t){this.currentId=t}},watch:{currentFilename:function(t){document.title="Annotate ".concat(t," - BIIGLE")}},created:function(){var t=this;this.allIds=biigle.$require("annotations.imagesIds"),this.volumeId=biigle.$require("annotations.volumeId");var e={};biigle.$require("annotations.imagesFilenames").forEach((function(i,n){e[t.allIds[n]]=i})),this.filenames=e,this.currentId=biigle.$require("annotations.imageId"),Al.$on("images.change",this.updateCurrentId),this.updateShowIndicator(FI.get("progressIndicator")),FI.watch("progressIndicator",this.updateShowIndicator)}},undefined,undefined,!1,null,null,null).exports;biigle.$mount("annotator-container",KI),biigle.$mount("annotations-navbar",HI);i(276);var ZI={annotationOpacity:1,showMinimap:!0,autoplayDraw:0,showLabelTooltip:!1,showMousePosition:!1,showProgressIndicator:!0};const JI=new uu({data:{urlParams:Object.keys(ZI),storageKey:"biigle.videos.settings",defaults:ZI}});const QI=Sl({components:{breadcrumb:YI},data:function(){return{ids:[],volumeId:null,filenames:{},showIndicator:!0,currentId:null}},computed:{currentFilename:function(){return this.filenames[this.currentId]}},methods:{updateShowIndicator:function(t){this.showIndicator=!1!==t},updateCurrentId:function(t){this.currentId=t},initVideoIds:function(t){var e=window.localStorage.getItem("biigle.volumes.".concat(this.volumeId,".files"));if(e){var i={};return t.forEach((function(t){i[t]=null})),JSON.parse(e).filter((function(t){return i.hasOwnProperty(t)}))}return t}},watch:{currentFilename:function(t){document.title="Annotate ".concat(t," - BIIGLE")}},created:function(){this.volumeId=biigle.$require("videos.volumeId");var t=biigle.$require("videos.videoIds");this.ids=this.initVideoIds(t);var e={};biigle.$require("videos.videoFilenames").forEach((function(i,n){e[t[n]]=i})),this.filenames=e,this.currentId=biigle.$require("videos.id"),this.updateShowIndicator(JI.get("showProgressIndicator")),JI.watch("showProgressIndicator",this.updateShowIndicator),Al.$on("video.id",this.updateCurrentId)}},undefined,undefined,!1,null,null,null).exports;const tA=Sl({components:{previewThumbnail:Sc}},undefined,undefined,!1,null,null,null).exports,eA=Vue.resource("api/v1/video-annotations{/id}",{},{query:{method:"GET",url:"api/v1/videos{/id}/annotations"},save:{method:"POST",url:"api/v1/videos{/id}/annotations"},split:{method:"POST",url:"api/v1/video-annotations{/id}/split"},link:{method:"POST",url:"api/v1/video-annotations{/id}/link"},attachLabel:{method:"POST",url:"api/v1/video-annotations{/id}/labels"},detachLabel:{method:"DELETE",url:"api/v1/video-annotation-labels{/id}"}}),iA=void 0,nA=" ",rA="fill";function oA(t){return"string"==typeof t}const sA=Math,aA=sA.abs,lA=sA.min,uA=sA.max,hA=sA.floor,cA=sA.round,dA=sA.sqrt,fA=sA.pow,pA=sA.cos,gA=sA.asin,mA=sA.sin,vA=sA.tan,yA=sA.PI,_A=2/3,bA=fA(2,-52);function wA(){throw new Error(Array.prototype.join.call(arguments,nA))}function xA(t,e){for(let i in e)t.hasOwnProperty(i)||(t[i]=e[i]);return t}var SA="undefined"!=typeof window&&window.navigator.userAgent;const CA=/(MSIE |Trident\/|Edge\/)/i.test(SA)?Array:Float32Array;function TA(t){return new CA(t)}function EA(t,e,i){const n=t.length,r=e.length;if(nt.toFixed(e.precision):cA;return t=>{const e=i*t,o=lA(hA(e),i-1);return function(t,e){if(oA(t))return t;let i=[];for(let n=0;n{if(aA(i-0)1&&(y=dA(y),i*=y,n*=y);const _=(o===s?-1:1)*dA(aA((i*i*n*n-i*i*v*v-n*n*m*m)/(i*i*v*v+n*n*m*m)));c=_*i*v/n+(t+a)/2,u=gA((e-(d=_*-n*m/i+(e+l)/2))/n),h=gA((l-d)/n),th&&(u-=BA),!s&&h>u&&(h-=BA)}let v;if(aA(h-u)>NA){const t=h,e=a,o=l;v=UA(a=c+i*pA(h=u+NA*(s&&h>u?1:-1)),l=d+n*mA(h),i,n,r,0,s,e,o,h,t,c,d)}else v=[];const y=4/3*vA((h-u)/4);if(v.splice(0,0,2*t-(t+y*i*mA(u)),2*e-(e-y*n*pA(u)),a+y*i*mA(h),l-y*n*pA(h),a,l),!m)for(let t=0,e=v.length;t1},wholeFrame:function(){return"WholeFrame"===this.shape}},methods:{startPollTracking:function(){this.tracking=!0,this.continuePollTracking()},pollTracking:function(){eA.get({id:this.id}).then(this.maybeFinishPollTracking,this.cancelPollTracking)},maybeFinishPollTracking:function(t){var e=t.body;e.frames.length>1?(this.tracking=!1,this.frames=e.frames,this.points=e.points):this.continuePollTracking()},continuePollTracking:function(){this.pollTimeout=window.setTimeout(this.pollTracking,5e3)},cancelPollTracking:function(){su.danger("Tracking of annotation ".concat(this.id," failed.")),this.tracking=!1,this.$emit("tracking-failed",this)},interpolatePoints:function(t){if(tthis.endFrame)return[];if(this.hasGapAt(t))return[];for(var e=this.frames,i=e.length-1;i>=0&&!(e[i]<=t&&null!==e[i]);i--);if(e[i]===t)return this.points[i];var n=(t-e[i])/(e[i+1]-e[i]);return this.interpolateBetweenFrames(i,i+1,n)},interpolateBetweenFrames:function(t,e,i){var n=this.interpolationPoints[t],r=this.interpolationPoints[e];switch(this.shape){case"Rectangle":case"Ellipse":return this.interpolationPointsToRectangle(this.interpolateNaive(n,r,i));case"LineString":case"Polygon":return this.interpolatePolymorph(n,r,i);default:return this.interpolateNaive(n,r,i)}},interpolateNaive:function(t,e,i){return t.map((function(t,n){return t+(e[n]-t)*i}))},interpolatePolymorph:function(t,e,i){return function(t,e){return OA(t.map(ZA),e||{})}([t,e])(i).replace(/[MCL\s]+/g," ").trim().split(" ").map((function(t){return parseInt(t,10)}))},rectangleToInterpolationPoints:function(t){var e=[t[2]-t[0],t[3]-t[1]],i=[t[6]-t[0],t[7]-t[1]],n=Math.sqrt(i[0]*i[0]+i[1]*i[1]),r=Math.sqrt(e[0]*e[0]+e[1]*e[1]),o=[e[0]/r,e[1]/r],s=[(t[0]+t[2]+t[4]+t[6])/4,(t[1]+t[3]+t[5]+t[7])/4];return[s[0],s[1],o[0],o[1],n,r]},interpolationPointsToRectangle:function(t){var e=[t[2],t[3]],i=[-e[1],e[0]],n=t[4]/2*i[0],r=t[4]/2*i[1],o=t[5]/2*e[0],s=t[5]/2*e[1];return[t[0]-o-n,t[1]-s-r,t[0]+o-n,t[1]+s-r,t[0]+o+n,t[1]+s+r,t[0]-o+n,t[1]-s+r]},polygonToSvgPath:function(t){return(t=t.slice()).unshift("M"),t.splice(3,0,"L"),t.join(" ")},hasGapAt:function(t){if(tthis.endFrame)return!1;for(var e=this.gapRanges.length-1;e>=0;e--)if(this.gapRanges[e][0]t)return!0;return!1},detachAnnotationLabel:function(t){var e=this.labels.indexOf(t);return-1!==e&&this.labels.splice(e,1),eA.detachLabel({id:t.id})},attachAnnotationLabel:function(t){return eA.attachLabel({id:this.id},{label_id:t.id}).then(this.handleAttachedLabel)},handleAttachedLabel:function(t){return this.labels.push(t.body),t},hasKeyframe:function(t){return-1!==this.frames.indexOf(t)},modify:function(t,e){var i=this.frames.indexOf(t);if(-1!==i)this.points.splice(i,1,e);else{for(var n=this.frames.length-1;n>=0&&!(this.frames[n]<=t);n--);this.frames.splice(n+1,0,t),this.points.splice(n+1,0,e)}return eA.update({id:this.id},{frames:this.frames,points:this.points})},split:function(t){return eA.split({id:this.id},{time:t}).then(this.handleFinishedSplit)},handleFinishedSplit:function(t){return this.frames=t.body[0].frames,this.points=t.body[0].points,t.body=t.body[1],t},link:function(t){return eA.link({id:this.id},{annotation_id:t.id}).then(this.handleFinishedLink)},handleFinishedLink:function(t){return this.frames=t.body.frames,this.points=t.body.points,this.labels=t.body.labels,t},deleteKeyframe:function(t){var e=this.frames.indexOf(t);return-1!==e?(this.frames.splice(e,1),this.points.splice(e,1),eA.update({id:this.id},{frames:this.frames,points:this.points})):Vue.Promise.reject("Unknown keyframe ".concat(t," of annotation ").concat(this.id))},delete:function(){return eA.delete({id:this.id})}},watch:{points:function(){this.revision+=1}},created:function(){this.shape=biigle.$require("videos.shapes")[this.shape_id]}}),undefined,undefined,!1,null,null,null).exports;const QA=Sl({mixins:[EI],methods:{handleSelect:function(t,e){t.isSelected&&e?this.$emit("deselect",t):this.$emit("select",t,t.startFrame,e)}}},undefined,undefined,!1,null,null,null).exports;const tP=Sl({components:{powerToggle:El},data:function(){return{restoreKeys:["annotationOpacity","showMinimap","autoplayDraw","showLabelTooltip","showMousePosition","showProgressIndicator"],annotationOpacity:1,showMinimap:!0,autoplayDraw:0,showLabelTooltip:!1,showMousePosition:!1,playbackRate:1,showProgressIndicator:!0}},methods:{handleShowMinimap:function(){this.showMinimap=!0},handleHideMinimap:function(){this.showMinimap=!1},handleShowLabelTooltip:function(){this.showLabelTooltip=!0},handleHideLabelTooltip:function(){this.showLabelTooltip=!1},handleShowMousePosition:function(){this.showMousePosition=!0},handleHideMousePosition:function(){this.showMousePosition=!1},handleShowProgressIndicator:function(){this.showProgressIndicator=!0},handleHideProgressIndicator:function(){this.showProgressIndicator=!1}},watch:{annotationOpacity:function(t){t=parseFloat(t),isNaN(t)||(this.$emit("update","annotationOpacity",t),JI.set("annotationOpacity",t))},showMinimap:function(t){this.$emit("update","showMinimap",t),JI.set("showMinimap",t)},autoplayDraw:function(t){t=parseFloat(t),this.$emit("update","autoplayDraw",t),JI.set("autoplayDraw",t)},showLabelTooltip:function(t){this.$emit("update","showLabelTooltip",t),JI.set("showLabelTooltip",t)},showMousePosition:function(t){this.$emit("update","showMousePosition",t),JI.set("showMousePosition",t)},playbackRate:function(t){t=parseFloat(t),isNaN(t)||this.$emit("update","playbackRate",t)},showProgressIndicator:function(t){this.$emit("update","showProgressIndicator",t),JI.set("showProgressIndicator",t)}},created:function(){var t=this;this.restoreKeys.forEach((function(e){t[e]=JI.get(e)}))}},undefined,undefined,!1,null,null,null).exports;const eP=Sl({mixins:[jI],created:function(){var t=biigle.$require("videos.user");this.userId=t?t.id:null,this.isAdmin=biigle.$require("videos.isAdmin")}},undefined,undefined,!1,null,null,null).exports;const iP=Sl({data:function(){return{renderedAnnotationMap:{},viewFitOptions:{padding:[50,50,50,50],minResolution:1}}},computed:{annotationsRevision:function(){return this.annotations.reduce((function(t,e){return t+e.revision}),0)},annotationsPreparedToRender:function(){return this.annotations.filter((function(t){return"WholeFrame"!==t.shape})).map((function(t){return{id:t.id,start:t.startFrame,end:t.endFrame,self:t}})).sort((function(t,e){return t.start-e.start}))}},methods:{refreshAnnotations:function(t){var e=this,i=this.annotationSource,n=this.selectedFeatures,r=this.annotationsPreparedToRender,o=this.renderedAnnotationMap,s={};this.renderedAnnotationMap=s;for(var a,l=[],u=!1,h=0,c=r.length;ht)break;a=r[h],u=!0,o.hasOwnProperty(a.id)?(s[a.id]=o[a.id],delete o[a.id]):l.push(a.self)}u?Object.values(o).forEach((function(t){i.removeFeature(t),n.remove(t)})):(i.clear(),n.clear());var d=l.map(this.createFeature);d.forEach((function(t){s[t.getId()]=t,t.get("annotation").isSelected&&n.push(t)})),d.length>0&&i.addFeatures(d),Object.values(s).forEach((function(i){e.updateGeometry(i,t)}))},createFeature:function(t){var e=new Cy(this.getGeometryFromPoints(t.shape,t.points[0]));return e.setId(t.id),e.set("annotation",t),t.labels&&t.labels.length>0&&e.set("color",t.labels[0].label.color),e},updateGeometry:function(t,e){var i=t.get("annotation"),n=i.interpolatePoints(e);t.setGeometry(this.getGeometryFromPoints(i.shape,n))},getGeometryFromPoints:function(t,e){switch(e=this.convertPointsFromDbToOl(e),t){case"Point":return new iv(e[0]);case"Rectangle":return new Gb([e]);case"Polygon":return new mv([e]);case"LineString":return new Cv(e);case"Circle":return new bv(e[0],e[1][0]);case"Ellipse":return new qb([e]);default:return void console.error("Unknown annotation shape: "+t)}},getPointsFromGeometry:function(t){var e;switch(t.getType()){case"Circle":e=[t.getCenter(),[t.getRadius()]];break;case"Polygon":case"Rectangle":case"Ellipse":e=t.getCoordinates()[0];break;case"Point":e=[t.getCoordinates()];break;default:e=t.getCoordinates()}return this.convertPointsFromOlToDb(e)},invertPointsYAxis:function(t){for(var e=this.videoCanvas.height,i=1;i0&&0===this.pendingAnnotation.points.length:this.pendingAnnotation.shape&&this.pendingAnnotation.frames.length>0&&this.pendingAnnotation.points.length>0},cantFinishDrawAnnotation:function(){return!this.hasPendingAnnotation},cantFinishTrackAnnotation:function(){return!this.pendingAnnotation.frames||1!==this.pendingAnnotation.frames.length}},methods:{requireSelectedLabel:function(){this.$emit("requires-selected-label"),this.resetInteractionMode()},initPendingAnnotationLayer:function(t){this.pendingAnnotationSource=new Vb,this.pendingAnnotationLayer=new Ib({opacity:.5,source:this.pendingAnnotationSource,updateWhileAnimating:!0,updateWhileInteracting:!0,style:pw.editing}),t.addLayer(this.pendingAnnotationLayer)},draw:function(t){this["isDrawing"+t]?this.resetInteractionMode():this.hasNoSelectedLabel?this.requireSelectedLabel():this.canAdd&&(this.interactionMode="draw"+t)},drawPoint:function(){this.draw("Point")},drawRectangle:function(){this.draw("Rectangle")},drawCircle:function(){this.draw("Circle")},drawLineString:function(){this.draw("LineString")},drawPolygon:function(){this.draw("Polygon")},drawWholeFrame:function(){this.draw("WholeFrame")},maybeUpdateDrawInteractionMode:function(t){var e=t.slice(4);this.resetPendingAnnotation(e),this.drawInteraction&&(this.map.removeInteraction(this.drawInteraction),this.drawInteraction=void 0),this.isDrawing&&this.hasSelectedLabel&&(this.pause(),this.isDrawingWholeFrame?(this.pendingAnnotation.frames.push(this.video.currentTime),this.$emit("pending-annotation",this.pendingAnnotation)):(this.drawInteraction=new ew({source:this.pendingAnnotationSource,type:e,style:pw.editing}),this.drawInteraction.on("drawend",this.extendPendingAnnotation),this.map.addInteraction(this.drawInteraction)))},finishDrawAnnotation:function(){(this.isDrawing||this.isUsingPolygonBrush)&&this.hasPendingAnnotation&&(this.isDrawingWholeFrame&&!this.pendingAnnotation.frames.includes(this.video.currentTime)&&this.pendingAnnotation.frames.push(this.video.currentTime),this.$emit("create-annotation",this.pendingAnnotation),this.isDrawingWholeFrame?this.resetInteractionMode():this.resetPendingAnnotation(this.pendingAnnotation.shape))},finishTrackAnnotation:function(){this.isDrawing&&this.hasPendingAnnotation&&(this.$emit("track-annotation",this.pendingAnnotation),this.resetPendingAnnotation(this.pendingAnnotation.shape))},resetPendingAnnotation:function(t){this.pendingAnnotationSource.clear(),this.pendingAnnotation={shape:t,frames:[],points:[]},this.$emit("pending-annotation",null)},extendPendingAnnotation:function(t){var e=this.pendingAnnotation.frames[this.pendingAnnotation.frames.length-1];void 0===e||e0&&(this.play(),window.clearTimeout(this.autoplayDrawTimeout),this.autoplayDrawTimeout=window.setTimeout(this.pause,1e3*this.autoplayDraw))):this.pendingAnnotationSource.once("addfeature",(function(t){this.removeFeature(t.feature)})),this.$emit("pending-annotation",this.pendingAnnotation)}},created:function(){this.$once("map-ready",this.initPendingAnnotationLayer),this.canAdd&&(this.$watch("interactionMode",this.maybeUpdateDrawInteractionMode),Pl.on("a",this.drawPoint,0,this.listenerSet),Pl.on("s",this.drawRectangle,0,this.listenerSet),Pl.on("d",this.drawCircle,0,this.listenerSet),Pl.on("f",this.drawLineString,0,this.listenerSet),Pl.on("g",this.drawPolygon,0,this.listenerSet),Pl.on("h",this.drawWholeFrame,0,this.listenerSet),Pl.on("Enter",this.finishDrawAnnotation,0,this.listenerSet))}},undefined,undefined,!1,null,null,null).exports;const rP=Sl({components:{mousePositionIndicator:ZC},data:function(){return{mousePositionImageCoordinates:[0,0]}},methods:{updateMousePositionImageCoordinates:function(){this.mousePositionImageCoordinates=this.invertPointsYAxis(this.mousePosition.slice()).map(Math.round)}},watch:{mousePosition:function(){iu(this.updateMousePositionImageCoordinates,100,"videos.update-mouse-position-ic")}}},undefined,undefined,!1,null,null,null).exports;var oP=["Point","Circle","Rectangle","WholeFrame"];const sP=Sl({data:function(){return{isTranslating:!1}},computed:{cannotSplitAnnotation:function(){return 1!==this.selectedAnnotations.length||this.selectedAnnotations[0].frames.length<=1||-1===oP.indexOf(this.selectedAnnotations[0].shape)},cannotLinkAnnotations:function(){return 2!==this.selectedAnnotations.length||this.selectedAnnotations[0].shape_id!==this.selectedAnnotations[1].shape_id},isAttaching:function(){return"attachLabel"===this.interactionMode},isSwapping:function(){return"swapLabel"===this.interactionMode}},methods:{initModifyInteraction:function(t){this.featureRevisionMap={},this.modifyInteraction=new HC({features:this.selectInteraction.getFeatures(),deleteCondition:function(t){return t_(t)&&Jy(t)}}),this.modifyInteraction.on("modifystart",this.handleModifyStart),this.modifyInteraction.on("modifyend",this.handleModifyEnd),t.addInteraction(this.modifyInteraction)},handleModifyStart:function(t){var e=this;t.features.getArray().forEach((function(t){e.featureRevisionMap[t.getId()]=t.getRevision()}))},handleModifyEnd:function(t){var e=this,i=t.features.getArray().filter((function(t){return e.featureRevisionMap[t.getId()]!==t.getRevision()})).map((function(t){return{annotation:t.get("annotation"),points:e.getPointsFromGeometry(t.getGeometry()),time:e.video.currentTime}}));i.length>0&&this.$emit("modify",i)},maybeUpdateModifyInteractionMode:function(t){this.modifyInteraction&&this.modifyInteraction.setActive(t)},emitDelete:function(){var t=this;this.canDelete&&this.hasSelectedAnnotations&&this.$emit("delete",this.selectedAnnotations.map((function(e){return{annotation:e,time:t.video.currentTime}})))},toggleTranslating:function(){this.resetInteractionMode(),this.isTranslating=!this.isTranslating},initTranslateInteraction:function(t){this.translateInteraction=new PE({features:this.selectedFeatures,map:t}),this.translateInteraction.setActive(!1),this.translateInteraction.on("translatestart",this.handleModifyStart),this.translateInteraction.on("translateend",this.handleModifyEnd),this.map.addInteraction(this.translateInteraction)},maybeUpdateIsTranslating:function(t){this.translateInteraction&&!t&&(this.isTranslating=!1)},resetTranslating:function(){this.isTranslating=!1},emitSplitAnnotation:function(){this.$emit("split-annotation",this.selectedAnnotations[0],this.video.currentTime)},emitLinkAnnotations:function(){this.$emit("link-annotations",this.selectedAnnotations)},toggleAttaching:function(){this.isAttaching?this.resetInteractionMode():this.interactionMode="attachLabel"},toggleSwapping:function(){this.isSwapping?this.resetInteractionMode():this.interactionMode="swapLabel"},initAttachInteraction:function(t){this.attachInteraction=new Wv({features:this.annotationFeatures,map:t}),this.attachInteraction.setActive(!1),this.attachInteraction.on("attach",this.handleAttachLabel),this.map.addInteraction(this.attachInteraction)},initSwapInteraction:function(t){this.swapInteraction=new Wv({features:this.annotationFeatures,map:t}),this.swapInteraction.setActive(!1),this.swapInteraction.on("attach",this.handleSwapLabel),this.map.addInteraction(this.swapInteraction)},handleAttachLabel:function(t){this.$emit("attach-label",t.feature.get("annotation"))},handleSwapLabel:function(t){this.$emit("swap-label",t.feature.get("annotation"))},maybeResetAttaching:function(t){this.isAttaching&&t&&this.resetInteractionMode()},maybeResetSwapping:function(t){this.isSwapping&&t&&this.resetInteractionMode()}},watch:{isTranslating:function(t){this.translateInteraction&&(this.translateInteraction.setActive(t),t?this.modifyInteraction.setActive(!1):this.isDefaultInteractionMode&&this.modifyInteraction.setActive(!0))},isAttaching:function(t){this.attachInteraction&&this.attachInteraction.setActive(t),this.$emit("attaching-active",t)},isSwapping:function(t){this.swapInteraction&&this.swapInteraction.setActive(t),this.$emit("swapping-active",t)}},created:function(){var t=this;this.canModify&&(this.$once("map-created",(function(){t.$once("map-ready",t.initModifyInteraction),t.$once("map-ready",t.initTranslateInteraction),t.$once("map-ready",t.initAttachInteraction),t.$once("map-ready",t.initSwapInteraction)})),this.$watch("isDefaultInteractionMode",this.maybeUpdateModifyInteractionMode),this.$watch("isDefaultInteractionMode",this.maybeUpdateIsTranslating),this.$watch("hasNoSelectedLabel",this.maybeResetAttaching),this.$watch("hasNoSelectedLabel",this.maybeResetSwapping),Pl.on("m",this.toggleTranslating,0,this.listenerSet),Pl.on("Escape",this.resetTranslating,0,this.listenerSet),Pl.on("l",this.toggleAttaching,0,this.listenerSet),Pl.on("Shift+l",this.toggleSwapping,0,this.listenerSet)),this.canDelete&&Pl.on("Delete",this.emitDelete)}},undefined,undefined,!1,null,null,null).exports;const aP=Sl({data:function(){return{polygonBrushRadius:50}},computed:{isUsingPolygonBrush:function(){return"polygonBrush"===this.interactionMode},isUsingPolygonEraser:function(){return"polygonEraser"===this.interactionMode},isUsingPolygonFill:function(){return"polygonFill"===this.interactionMode}},methods:{togglePolygonBrush:function(){this.isUsingPolygonBrush?this.resetInteractionMode():this.hasSelectedLabel?this.canAdd&&(this.interactionMode="polygonBrush"):this.requireSelectedLabel()},togglePolygonEraser:function(){this.isUsingPolygonEraser?this.resetInteractionMode():this.canModify&&(this.interactionMode="polygonEraser")},togglePolygonFill:function(){this.isUsingPolygonFill?this.resetInteractionMode():this.canModify&&(this.interactionMode="polygonFill")},togglePolygonBrushInteraction:function(t){t?this.hasSelectedLabel&&(this.polygonBrushInteraction=new JT({source:this.pendingAnnotationSource,style:pw.editing,brushRadius:this.polygonBrushRadius,resizeCondition:qy}),this.polygonBrushInteraction.on("drawend",this.extendPendingAnnotation),this.pendingAnnotation.shape="Polygon",this.map.addInteraction(this.polygonBrushInteraction)):(this.polygonBrushRadius=this.polygonBrushInteraction.getBrushRadius(),this.map.removeInteraction(this.polygonBrushInteraction))},togglePolygonEraserInteraction:function(t){t?(this.polygonEraserInteraction=new tE({features:this.selectInteraction.getFeatures(),style:pw.editing,brushRadius:this.polygonBrushRadius,allowRemove:!1,addCondition:Zy,subtractCondition:Qy,resizeCondition:qy}),this.polygonEraserInteraction.on("modifystart",this.handleModifyStart),this.polygonEraserInteraction.on("modifyend",this.handleModifyEnd),this.map.addInteraction(this.polygonEraserInteraction),this.map.addInteraction(this.shiftClickSelectInteraction)):(this.polygonBrushRadius=this.polygonEraserInteraction.getBrushRadius(),this.map.removeInteraction(this.polygonEraserInteraction),this.polygonEraserInteraction=null,this.map.removeInteraction(this.shiftClickSelectInteraction))},togglePolygonFillInteraction:function(t){t?(this.polygonFillInteraction=new tE({features:this.selectInteraction.getFeatures(),style:pw.editing,brushRadius:this.polygonBrushRadius,allowRemove:!1,addCondition:Qy,subtractCondition:Zy,resizeCondition:qy}),this.polygonFillInteraction.on("modifystart",this.handleModifyStart),this.polygonFillInteraction.on("modifyend",this.handleModifyEnd),this.map.addInteraction(this.polygonFillInteraction),this.map.addInteraction(this.shiftClickSelectInteraction)):(this.polygonBrushRadius=this.polygonFillInteraction.getBrushRadius(),this.map.removeInteraction(this.polygonFillInteraction),this.polygonFillInteraction=null,this.map.removeInteraction(this.shiftClickSelectInteraction))},initShiftSelectInteraction:function(){this.shiftClickSelectInteraction=new oE({condition:function(t){return Yy(t)&&t_(t)},style:pw.highlight,layers:[this.annotationLayer],features:this.selectInteraction.getFeatures(),multi:!0}),this.shiftClickSelectInteraction.on("select",this.handleFeatureSelect)}},created:function(){var t=this;this.canAdd&&(this.$watch("isUsingPolygonBrush",this.togglePolygonBrushInteraction),Pl.on("e",this.togglePolygonBrush,0,this.listenerSet)),this.canModify&&(this.$once("map-created",(function(){t.$once("map-ready",t.initShiftSelectInteraction)})),this.$watch("isUsingPolygonEraser",this.togglePolygonEraserInteraction),Pl.on("r",this.togglePolygonEraser,0,this.listenerSet),this.$watch("isUsingPolygonFill",this.togglePolygonFillInteraction),Pl.on("t",this.togglePolygonFill,0,this.listenerSet))}},undefined,undefined,!1,null,null,null).exports;const lP=Sl({components:{labelTooltip:cg},data:function(){return{hoveredFeaturesHash:""}},computed:{showTooltip:function(){return this.isDefaultInteractionMode&&this.showLabelTooltip}},methods:{annotationLayerFilter:function(t){return"annotations"===t.get("name")},updateHoveredAnnotations:function(t){var e=this.map.getFeaturesAtPixel(t.pixel,{layerFilter:this.annotationLayerFilter})||[],i=e.map((function(t){return t.getId()})).join("-");this.hoveredFeaturesHash!==i&&(this.hoveredFeaturesHash=i,this.$emit("hoverFeatures",e))},resetHoveredAnnotations:function(){this.hoveredFeaturesHash="",this.$emit("hoverFeatures",[])},updateTooltipEventListeners:function(){this.showTooltip?this.map.on("pointermove",this.updateHoveredAnnotations):(this.map.un("pointermove",this.updateHoveredAnnotations),this.resetHoveredAnnotations())}},watch:{showTooltip:function(){this.updateTooltipEventListeners()}},created:function(){this.$once("map-created",this.updateTooltipEventListeners)}},undefined,undefined,!1,null,null,null).exports;var uP=Sl({data:function(){return{playing:!1,animationFrameId:null,refreshRate:30,renderCurrentTime:-1,refreshLastTime:Date.now(),extent:[0,0,0,0],minResolution:.01}},methods:{initVideoLayer:function(t){var e=t[0];this.videoCanvas.width=this.video.videoWidth,this.videoCanvas.height=this.video.videoHeight,this.extent=[0,0,this.videoCanvas.width,this.videoCanvas.height];var i=new Xg({code:"biigle-image",units:"pixels",extent:this.extent});this.videoLayer=new _w({name:"image",source:new vy({canvas:this.videoCanvas,projection:i,canvasExtent:this.extent,canvasSize:[this.extent[0],this.extent[1]]})}),e.addLayer(this.videoLayer),e.setView(new Ux({center:[0,0],projection:i,minResolution:this.minResolution,extent:this.extent})),e.getView().fit(this.extent)},renderVideo:function(t){if(t||this.renderCurrentTime!==this.video.currentTime){this.renderCurrentTime=this.video.currentTime,this.videoCanvasCtx.drawImage(this.video,0,0,this.video.videoWidth,this.video.videoHeight),this.videoLayer.changed();var e=Date.now();(t||e-this.refreshLastTime>=this.refreshRate)&&(this.$emit("refresh",this.video.currentTime),this.refreshLastTime=e)}},startRenderLoop:function(){this.renderVideo(),this.animationFrameId=window.requestAnimationFrame(this.startRenderLoop)},stopRenderLoop:function(){window.cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null,this.renderVideo(!0)},setPlaying:function(){this.playing=!0},setPaused:function(){this.playing=!1},togglePlaying:function(){this.playing?this.pause():this.play()},play:function(){this.video.play()},pause:function(){this.video.pause(),this.renderVideo(!0)},emitMapReady:function(){this.$emit("map-ready",this.map)}},watch:{playing:function(t){t&&!this.animationFrameId?this.startRenderLoop():t||this.stopRenderLoop()}},created:function(){var t=this;this.videoCanvas=document.createElement("canvas"),this.videoCanvasCtx=this.videoCanvas.getContext("2d"),this.video.addEventListener("play",this.setPlaying),this.video.addEventListener("pause",this.setPaused),this.video.addEventListener("seeked",this.renderVideo),this.video.addEventListener("loadeddata",this.renderVideo);var e=new Vue.Promise((function(e){t.$once("map-created",e)})),i=new Vue.Promise((function(e){t.video.addEventListener("loadedmetadata",e)}));Vue.Promise.all([e,i]).then(this.initVideoLayer).then(this.emitMapReady),Pl.on(" ",this.togglePlaying),this.$watch("hasError",(function(e){t.videoLayer&&t.videoLayer.setVisible(!e)}))}},undefined,undefined,!1,null,null,null);const hP=Sl({mixins:[uP.exports,iP,nP,sP,lP,rP,aP],components:{controlButton:Sy,minimap:zC},props:{annotations:{type:Array,default:function(){return[]}},annotationOpacity:{type:Number,default:1},autoplayDraw:{type:Number,default:0},canAdd:{type:Boolean,default:!1},canModify:{type:Boolean,default:!1},canDelete:{type:Boolean,default:!1},initialCenter:{type:Array,default:function(){return[0,0]}},initialResolution:{type:Number,default:0},listenerSet:{type:String,default:"default"},selectedAnnotations:{type:Array,default:function(){return[]}},selectedLabel:{type:Object},showLabelTooltip:{type:Boolean,default:!1},showMinimap:{type:Boolean,default:!0},showMousePosition:{type:Boolean,default:!0},video:{type:HTMLVideoElement,required:!0},heightOffset:{type:Number,default:0},showPrevNext:{type:Boolean,default:!0},hasError:{type:Boolean,default:!1}},data:function(){return{interactionMode:"default",mousePosition:[0,0]}},computed:{showModifyBar:function(){return this.canModify||this.canDelete},hasSelectedAnnotations:function(){return this.selectedAnnotations.length>0},hasNoSelectedAnnotations:function(){return!this.hasSelectedAnnotations},isDefaultInteractionMode:function(){return"default"===this.interactionMode},styleObject:function(){return 0!==this.heightOffset?"height: calc(65% + ".concat(this.heightOffset,"px);"):""}},methods:{createMap:function(){var t=new uI({tipLabel:"Zoom to show whole video",label:""});Pl.on("-",t.handleZoomToExtent.bind(t),0,this.listenerSet);var e=new jC({controls:[new Jx,t],interactions:TS({altShiftDragRotate:!1,doubleClickZoom:!1,keyboard:!1,shiftDragZoom:!1,pinchRotate:!1,pinchZoom:!1})});return t=new vI({label:""}),Pl.on("+",t.zoomToNative.bind(t),0,this.listenerSet),e.addControl(t),e},initLayersAndInteractions:function(t){this.annotationFeatures=new xy,this.annotationSource=new Vb({features:this.annotationFeatures}),this.annotationLayer=new Ib({source:this.annotationSource,updateWhileAnimating:!0,updateWhileInteracting:!0,style:pw.features,opacity:this.annotationOpacity,name:"annotations"}),this.selectInteraction=new oE({condition:Yy,style:pw.highlight,layers:[this.annotationLayer],multi:!0}),this.selectedFeatures=this.selectInteraction.getFeatures(),this.selectInteraction.on("select",this.handleFeatureSelect),t.addLayer(this.annotationLayer),t.addInteraction(this.selectInteraction)},resetInteractionMode:function(){this.interactionMode="default"},extractAnnotationFromFeature:function(t){return t.get("annotation")},handleFeatureSelect:function(t){this.$emit("select",t.selected.map(this.extractAnnotationFromFeature),t.deselected.map(this.extractAnnotationFromFeature),this.video.currentTime)},updateMousePosition:function(t){this.mousePosition=t.coordinate},emitTrack:function(){this.$emit("track")},emitMoveend:function(t){var e=t.target.getView();this.$emit("moveend",e.getCenter(),e.getResolution())},initInitialCenterAndResolution:function(t){var e=t.getView();0!==this.initialResolution&&e.setResolution(Math.min(e.getMaxResolution(),Math.max(e.getMinResolution(),this.initialResolution))),0===this.initialCenter[0]&&0===this.initialCenter[1]||!Pp(this.extent,this.initialCenter)||e.setCenter(this.initialCenter)},updateSize:function(){var t=this;this.$nextTick((function(){return t.map.updateSize()}))},emitPrevious:function(){this.$emit("previous")},emitNext:function(){this.$emit("next")},reset:function(){this.setPaused(),this.resetInteractionMode()}},watch:{selectedAnnotations:function(t){var e,i=this.annotationSource,n=this.selectedFeatures;i&&n&&(n.clear(),t.forEach((function(t){(e=i.getFeatureById(t.id))&&n.push(e)})))},isDefaultInteractionMode:function(t){this.selectInteraction.setActive(t)},annotationOpacity:function(t){this.annotationLayer&&this.annotationLayer.setOpacity(t)},heightOffset:function(){this.updateSize()}},created:function(){this.$once("map-ready",this.initLayersAndInteractions),this.$once("map-ready",this.initInitialCenterAndResolution),this.map=this.createMap(),this.$emit("map-created",this.map),this.map.on("pointermove",this.updateMousePosition),this.map.on("moveend",this.emitMoveend),Pl.on("Escape",this.resetInteractionMode,0,this.listenerSet),Pl.on("ArrowRight",this.emitNext,0,this.listenerSet),Pl.on("ArrowLeft",this.emitPrevious,0,this.listenerSet)},mounted:function(){this.map.setTarget(this.$el)}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"video-screen",style:t.styleObject},[t.showMinimap&&!t.hasError?i("minimap",{attrs:{extent:t.extent}}):t._e(),t._v(" "),i("label-tooltip",{attrs:{watch:"hoverFeatures",show:t.showLabelTooltip,position:t.mousePosition}}),t._v(" "),i("div",{staticClass:"controls"},[i("div",{staticClass:"btn-group"},[t.showPrevNext?i("control-button",{attrs:{icon:"fa-step-backward",title:"Previous video 𝗟𝗲𝗳𝘁 𝗮𝗿𝗿𝗼𝘄"},on:{click:t.emitPrevious}}):t._e(),t._v(" "),t.playing?i("control-button",{attrs:{icon:"fa-pause",title:"Pause 𝗦𝗽𝗮𝗰𝗲𝗯𝗮𝗿",disabled:t.hasError},on:{click:t.pause}}):i("control-button",{attrs:{icon:"fa-play",title:"Play 𝗦𝗽𝗮𝗰𝗲𝗯𝗮𝗿",disabled:t.hasError},on:{click:t.play}}),t._v(" "),t.showPrevNext?i("control-button",{attrs:{icon:"fa-step-forward",title:"Next video 𝗥𝗶𝗴𝗵𝘁 𝗮𝗿𝗿𝗼𝘄"},on:{click:t.emitNext}}):t._e()],1),t._v(" "),t.canAdd?i("div",{staticClass:"btn-group"},[i("control-button",{attrs:{icon:"icon-point",title:"Start a point annotation 𝗔",hover:!1,open:t.isDrawingPoint,active:t.isDrawingPoint,disabled:t.hasError},on:{click:t.drawPoint}},[i("control-button",{attrs:{icon:"fa-check",title:"Finish the point annotation 𝗘𝗻𝘁𝗲𝗿",disabled:t.cantFinishDrawAnnotation},on:{click:t.finishDrawAnnotation}}),t._v(" "),i("control-button",{attrs:{icon:"fa-project-diagram",title:"Finish and track the point annotation",disabled:t.cantFinishTrackAnnotation},on:{click:t.finishTrackAnnotation}})],1),t._v(" "),i("control-button",{attrs:{icon:"icon-rectangle",title:"Start a rectangle annotation 𝗦",hover:!1,open:t.isDrawingRectangle,active:t.isDrawingRectangle,disabled:t.hasError},on:{click:t.drawRectangle}},[i("control-button",{attrs:{icon:"fa-check",title:"Finish the rectangle annotation 𝗘𝗻𝘁𝗲𝗿",disabled:t.cantFinishDrawAnnotation},on:{click:t.finishDrawAnnotation}})],1),t._v(" "),i("control-button",{attrs:{icon:"icon-circle",title:"Start a circle annotation 𝗗",hover:!1,open:t.isDrawingCircle,active:t.isDrawingCircle,disabled:t.hasError},on:{click:t.drawCircle}},[i("control-button",{attrs:{icon:"fa-check",title:"Finish the circle annotation 𝗘𝗻𝘁𝗲𝗿",disabled:t.cantFinishDrawAnnotation},on:{click:t.finishDrawAnnotation}}),t._v(" "),i("control-button",{attrs:{icon:"fa-project-diagram",title:"Finish and track the circle annotation",disabled:t.cantFinishTrackAnnotation},on:{click:t.finishTrackAnnotation}})],1),t._v(" "),i("control-button",{attrs:{icon:"icon-linestring",title:"Start a line annotation 𝗙",hover:!1,open:t.isDrawingLineString,active:t.isDrawingLineString,disabled:t.hasError},on:{click:t.drawLineString}},[i("control-button",{attrs:{icon:"fa-check",title:"Finish the line annotation 𝗘𝗻𝘁𝗲𝗿",disabled:t.cantFinishDrawAnnotation},on:{click:t.finishDrawAnnotation}})],1),t._v(" "),i("control-button",{attrs:{icon:"icon-polygon",title:"Start a polygon annotation 𝗚",open:t.isDrawingPolygon,active:t.isDrawingPolygon,disabled:t.hasError},on:{click:t.drawPolygon}},[t.isDrawingPolygon||t.isUsingPolygonBrush?i("control-button",{attrs:{icon:"fa-check",title:"Finish the polygon annotation 𝗘𝗻𝘁𝗲𝗿",disabled:t.cantFinishDrawAnnotation},on:{click:t.finishDrawAnnotation}}):t._e(),t._v(" "),i("control-button",{attrs:{icon:"fa-paint-brush",title:"Draw a polygon using the brush tool 𝗘",active:t.isUsingPolygonBrush},on:{click:t.togglePolygonBrush}}),t._v(" "),i("control-button",{attrs:{icon:"fa-eraser",title:"Modify selected polygons using the eraser tool 𝗥",active:t.isUsingPolygonEraser},on:{click:t.togglePolygonEraser}}),t._v(" "),i("control-button",{attrs:{icon:"fa-fill-drip",title:"Modify selected polygons using the fill tool 𝗧",active:t.isUsingPolygonFill},on:{click:t.togglePolygonFill}})],1),t._v(" "),i("control-button",{attrs:{icon:"icon-wholeframe",title:"Start a whole frame annotation 𝗛",hover:!1,open:t.isDrawingWholeFrame,active:t.isDrawingWholeFrame,disabled:t.hasError},on:{click:t.drawWholeFrame}},[i("control-button",{attrs:{icon:"fa-check",title:"Finish the whole frame annotation 𝗘𝗻𝘁𝗲𝗿",disabled:t.cantFinishDrawAnnotation},on:{click:t.finishDrawAnnotation}})],1)],1):t._e(),t._v(" "),t.showModifyBar?i("div",{staticClass:"btn-group"},[t.canModify?i("control-button",{attrs:{icon:"fa-tag",title:"Attach the currently selected label to existing annotations 𝗟",active:t.isAttaching,disabled:t.hasNoSelectedLabel||t.hasError},on:{click:t.toggleAttaching}},[i("control-button",{attrs:{icon:"fa-sync-alt",title:"Swap the most recent label of an existing annotation with the currently selected one 𝗦𝗵𝗶𝗳𝘁+𝗟",active:t.isSwapping,disabled:t.hasNoSelectedLabel||t.hasError},on:{click:t.toggleSwapping}})],1):t._e(),t._v(" "),t.canModify?i("control-button",{attrs:{icon:"fa-arrows-alt",title:"Move selected annotations 𝗠",active:t.isTranslating,disabled:t.hasError},on:{click:t.toggleTranslating}}):t._e(),t._v(" "),t.canModify?i("control-button",{attrs:{icon:"fa-link",title:"Link selected annotations",disabled:t.cannotLinkAnnotations||t.hasError},on:{click:t.emitLinkAnnotations}}):t._e(),t._v(" "),t.canModify?i("control-button",{attrs:{icon:"fa-unlink",title:"Split selected annotation",disabled:t.cannotSplitAnnotation||t.hasError},on:{click:t.emitSplitAnnotation}}):t._e(),t._v(" "),t.canDelete?i("control-button",{attrs:{icon:"fa-trash",title:"Delete selected annotations/keyframes 𝗗𝗲𝗹𝗲𝘁𝗲",disabled:t.hasNoSelectedAnnotations||t.hasError},on:{click:t.emitDelete}}):t._e()],1):t._e()]),t._v(" "),i("div",{staticClass:"indicators indicators--left"},[t.showMousePosition?i("mouse-position-indicator",{attrs:{position:t.mousePositionImageCoordinates}}):t._e()],1),t._v(" "),i("div",{staticClass:"indicators indicators--right"},[t.selectedLabel?i("div",{staticClass:"indicator",domProps:{textContent:t._s(t.selectedLabel.name)}}):t._e()])],1)}),[],!1,null,null,null).exports;const cP=Sl({props:{currentTime:{type:Number,required:!0},hoverTime:{type:Number,default:0},seeking:{type:Boolean,default:!1}},components:{loader:Cl},computed:{currentTimeText:function(){return Vue.filter("videoTime")(this.currentTime)},hoverTimeText:function(){return Vue.filter("videoTime")(this.hoverTime)},classObject:function(){return{"current-time--seeking":this.seeking,"current-time--hover":this.showHoverTime}},showHoverTime:function(){return 0!==this.hoverTime}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"current-time",class:t.classObject},[t.seeking?i("loader",{attrs:{active:!0}}):i("span",[i("span",{domProps:{textContent:t._s(t.currentTimeText)}}),t._v(" "),i("span",{directives:[{name:"show",rawName:"v-show",value:t.showHoverTime,expression:"showHoverTime"}],staticClass:"hover-time",domProps:{textContent:t._s(t.hoverTimeText)}})])],1)}),[],!1,null,null,null).exports;var dP=Sl({props:{frame:{type:Object,required:!0},startFrame:{type:Number,required:!0},segmentDuration:{type:Number,required:!0},color:{type:String,required:!0}},computed:{offset:function(){return(this.frame.time-this.startFrame)/this.segmentDuration},style:function(){return{left:100*this.offset+"%","background-color":this.color}},classObj:function(){return{"annotation-keyframe--selected":this.frame.selected}}},methods:{emitSelect:function(t){this.$emit("select",this.frame,t.shiftKey)}}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("span",{staticClass:"annotation-keyframe",class:t.classObj,style:t.style,on:{click:function(e){return e.stopPropagation(),t.emitSelect(e)}}})}),[],!1,null,null,null);var fP=Sl({components:{keyframe:dP.exports},props:{annotation:{type:Object,required:!0},label:{type:Object,required:!0},frames:{type:Array,required:!0},gap:{type:Boolean,default:!1},clipDuration:{type:Number,required:!0}},computed:{startFrame:function(){return this.frames[0]},endFrame:function(){return this.frames[this.frames.length-1]},segmentDuration:function(){return this.endFrame-this.startFrame},classObject:function(){return{"annotation-segment--gap":this.gap}},width:function(){return 100*this.segmentDuration/this.clipDuration},color:function(){return"#"+(this.label.color||"000000")},style:function(){var t={width:this.width+"%"};return this.gap?t["border-top-color"]=this.color:t["background-color"]=this.color+"66",t},keyframes:function(){if(this.gap)return[];var t=this.annotation.selected;return this.frames.map((function(e){return{time:e,selected:t===e}}))}},methods:{selectFrame:function(t,e){this.$emit("select",t.time,e)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"annotation-segment",class:t.classObject,style:t.style},t._l(t.keyframes,(function(e){return i("keyframe",{key:e.time,attrs:{frame:e,"start-frame":t.startFrame,"segment-duration":t.segmentDuration,color:t.color},on:{select:t.selectFrame}})})),1)}),[],!1,null,null,null);var pP=Sl({components:{segment:fP.exports},props:{annotation:{type:Object,required:!0},label:{type:Object,required:!0},duration:{type:Number,required:!0},elementWidth:{type:Number,required:!0}},computed:{startFrame:function(){return this.annotation.startFrame},endFrame:function(){return this.annotation.endFrame},offset:function(){var t=this.startFrame/this.duration*this.elementWidth;return this.annotation.isClip||(t=Math.min(t,this.elementWidth-9)),t},clipDuration:function(){return this.endFrame-this.startFrame},width:function(){return this.clipDuration/this.duration*this.elementWidth},style:function(){return{left:this.offset+"px",width:this.width+"px"}},segments:function(){for(var t,e=[this.annotation.frames.slice()],i=[!1],n=0;-1!==(t=e[n].indexOf(null));){var r=e[n];e[n]=r.slice(0,t),e.push([r[t-1],r[t+1]]),i.push(!0),e.push(r.slice(t+1)),i.push(!1),n+=2}return e.map((function(t,e){return{frames:t,gap:i[e]}}))},selected:function(){return this.annotation.isSelected},classObj:function(){return{"annotation-clip--selected":this.selected,"annotation-clip--compact":this.shouldBeCompact,"annotation-clip--more-compact":this.shouldBeMoreCompact,"annotation-clip--tracking":this.annotation.tracking,"annotation-clip--whole-frame":this.annotation.wholeFrame,"annotation-clip--dark":this.hasDarkColor,"annotation-clip--pending":this.annotation.pending}},minTimeBetweenFrames:function(){for(var t=1/0,e=this.annotation.frames.filter((function(t){return null!==t})),i=e.length-1;i>0;i--)t=Math.min(t,e[i]-e[i-1]);return t},minDistanceBetweenFrames:function(){return this.minTimeBetweenFrames/this.duration*this.elementWidth},shouldBeCompact:function(){return this.minDistanceBetweenFrames<=18},shouldBeMoreCompact:function(){return this.minDistanceBetweenFrames<=6},title:function(){return this.annotation.pending?"Pending annotation":this.annotation.tracking?"Tracking in progress":""},hasDarkColor:function(){var t=this.label.color||"000000",e=parseInt(t,16);return.2126*(e>>16&255)+.7152*(e>>8&255)+.0722*(e>>0&255)<128}},methods:{emitSelect:function(t,e){this.selected&&e?this.$emit("deselect",this.annotation):this.$emit("select",this.annotation,t,e)},select:function(t){var e=this.startFrame+(t.clientX-this.$el.getBoundingClientRect().left)/this.$el.clientWidth*this.clipDuration;this.emitSelect(e,t.shiftKey)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{directives:[{name:"show",rawName:"v-show",value:t.duration>0,expression:"duration > 0"}],staticClass:"annotation-clip",class:t.classObj,style:t.style,attrs:{title:t.title},on:{click:function(e){return e.stopPropagation(),t.select(e)}}},t._l(t.segments,(function(e,n){return i("segment",{key:n,attrs:{annotation:t.annotation,label:t.label,frames:e.frames,gap:e.gap,"clip-duration":t.clipDuration},on:{select:t.emitSelect}})})),1)}),[],!1,null,null,null);var gP=Sl({components:{annotationClip:pP.exports},props:{label:{type:Object,required:!0},lanes:{type:Array,required:!0},duration:{type:Number,required:!0},elementWidth:{type:Number,required:!0}},methods:{emitSelect:function(t,e,i){this.$emit("select",t,e,i)},emitDeselect:function(t){this.$emit("deselect",t)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"annotation-track"},t._l(t.lanes,(function(e){return i("div",{staticClass:"annotation-lane"},t._l(e,(function(e){return i("annotation-clip",{key:e.id,attrs:{annotation:e,"element-width":t.elementWidth,label:t.label,duration:t.duration},on:{select:t.emitSelect,deselect:t.emitDeselect}})})),1)})),0)}),[],!1,null,null,null);const mP=Sl({components:{annotationTrack:gP.exports},props:{tracks:{type:Array,required:!0},duration:{type:Number,required:!0},elementWidth:{type:Number,required:!0}},data:function(){return{dragging:!1,scrollTop:0,scrollHeight:0,clientHeight:0}},computed:{hasOverflowTop:function(){return this.scrollTop>0},hasOverflowBottom:function(){var t=this.scrollHeight-this.clientHeight-1;return t>0&&this.scrollTop0&&this.duration>0}},methods:{emitSeek:function(t){this.$emit("seek",(t.clientX-t.target.getBoundingClientRect().left)/t.target.clientWidth*this.duration)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"video-progress",on:{click:t.emitSeek}},t._l(t.ticks,(function(t){return i("tick",{key:t,attrs:{time:t}})})),1)}),[],!1,null,null,null);const _P=Sl({components:{videoProgress:yP.exports,annotationTracks:mP},props:{tracks:{type:Array,required:function(){return[]}},duration:{type:Number,required:!0},currentTime:{type:Number,required:!0},seeking:{type:Boolean,default:!1}},data:function(){return{zoom:1,zoomFactor:.3,scrollFactor:10,initialElementWidth:0,scrollLeft:0,hoverTime:0,hasOverflowTop:!1,hasOverflowBottom:!1}},computed:{currentTimePosition:function(){return this.duration>0?this.elementWidth*this.currentTime/this.duration:0},timeIndicatorClass:function(){return{"time-indicator--seeking":this.seeking}},timeIndicatorStyle:function(){return"transform: translateX(".concat(this.currentTimePosition,"px);")},hoverTimeIndicatorStyle:function(){return"transform: translateX(".concat(this.hoverPosition,"px);")},scrollerStyle:function(){return{width:100*this.zoom+"%",left:this.scrollLeft+"px"}},elementWidth:function(){return this.initialElementWidth*this.zoom},hoverPosition:function(){return this.duration>0?this.elementWidth*this.hoverTime/this.duration:0},showHoverTime:function(){return 0!==this.hoverTime},hasOverflowLeft:function(){return this.scrollLeft<0},hasOverflowRight:function(){return this.elementWidth+this.scrollLeft>this.initialElementWidth}},methods:{updateInitialElementWidth:function(){this.initialElementWidth=this.$el.clientWidth},emitSeek:function(t){this.$emit("seek",t)},emitSelect:function(t,e,i){this.$emit("select",t,e,i)},emitDeselect:function(t){this.$emit("deselect",t)},emitScrollY:function(t){this.$emit("scroll-y",t)},handleWheel:function(t){t.shiftKey?0!==t.deltaY&&this.updateZoom(t):t.deltaX<0?this.updateScrollLeft(this.scrollLeft+this.scrollFactor):t.deltaX>0&&this.updateScrollLeft(this.scrollLeft-this.scrollFactor)},updateZoom:function(t){var e=this,i=t.clientX-this.$el.getBoundingClientRect().left,n=(t.clientX-this.$refs.scroller.getBoundingClientRect().left)/this.elementWidth,r=t.deltaY<0?this.zoomFactor:-1*this.zoomFactor;this.zoom=Math.max(1,this.zoom+r),this.$nextTick((function(){var t=n*e.elementWidth;e.updateScrollLeft(i-t)}))},handleHideHoverTime:function(){this.hoverTime=0},handleUpdateHoverTime:function(t){this.hoverTime=(t.clientX-this.$refs.scroller.getBoundingClientRect().left)/this.elementWidth*this.duration},updateScrollLeft:function(t){this.scrollLeft=Math.max(Math.min(0,t),this.initialElementWidth-this.elementWidth)},updateOverflowTop:function(t){this.hasOverflowTop=t},updateOverflowBottom:function(t){this.hasOverflowBottom=t},handleDragX:function(t){this.updateScrollLeft(this.scrollLeft+t)},updateHeight:function(){this.$refs.annotationTracks.updateClientHeight()},reset:function(){this.zoom=1,this.scrollLeft=0,this.hoverTime=0,this.hasOverflowTop=!1,this.hasOverflowBottom=!1}},watch:{hoverTime:function(t){this.$emit("hover-time",t)},initialElementWidth:function(t,e){this.updateScrollLeft(this.scrollLeft*t/e)}},created:function(){var t=this;window.addEventListener("resize",this.updateInitialElementWidth),Al.$on("sidebar.toggle",(function(){t.$nextTick(t.updateInitialElementWidth)})),Pl.on(" ",(function(t){t.preventDefault()}))},mounted:function(){this.$nextTick(this.updateInitialElementWidth)}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"scroll-strip",on:{wheel:function(e){return e.stopPropagation(),t.handleWheel(e)},mouseleave:t.handleHideHoverTime}},[i("div",{ref:"scroller",staticClass:"scroll-strip__scroller",style:t.scrollerStyle,on:{mousemove:t.handleUpdateHoverTime}},[i("video-progress",{attrs:{duration:t.duration,"element-width":t.elementWidth},on:{seek:t.emitSeek}}),t._v(" "),i("div",{staticClass:"annotation-tracks-wrapper"},[i("annotation-tracks",{ref:"annotationTracks",attrs:{tracks:t.tracks,duration:t.duration,"element-width":t.elementWidth},on:{select:t.emitSelect,deselect:t.emitDeselect,"scroll-y":t.emitScrollY,"drag-x":t.handleDragX,"overflow-top":t.updateOverflowTop,"overflow-bottom":t.updateOverflowBottom}}),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:t.hasOverflowTop,expression:"hasOverflowTop"}],staticClass:"overflow-shadow overflow-shadow--top"}),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:t.hasOverflowBottom,expression:"hasOverflowBottom"}],staticClass:"overflow-shadow overflow-shadow--bottom"})],1),t._v(" "),i("span",{staticClass:"time-indicator",class:t.timeIndicatorClass,style:t.timeIndicatorStyle}),t._v(" "),i("span",{directives:[{name:"show",rawName:"v-show",value:t.showHoverTime,expression:"showHoverTime"}],staticClass:"hover-time-indicator",style:t.hoverTimeIndicatorStyle})],1),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:t.hasOverflowLeft,expression:"hasOverflowLeft"}],staticClass:"overflow-shadow overflow-shadow--left"}),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:t.hasOverflowRight,expression:"hasOverflowRight"}],staticClass:"overflow-shadow overflow-shadow--right"})])}),[],!1,null,null,null).exports;var bP=Sl({props:{tracks:{type:Array,required:!0},scrollTop:{type:Number,default:0}},watch:{scrollTop:function(t){this.$el.scrollTop=t}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"track-headers"},t._l(t.tracks,(function(e){return i("div",{staticClass:"track-header"},[i("div",{staticClass:"label-name",attrs:{title:e.label.name},domProps:{textContent:t._s(e.label.name)}}),t._v(" "),t._l(e.lanes,(function(t){return i("div",{staticClass:"lane-dummy"})}))],2)})),0)}),[],!1,null,null,null);const wP=Sl({components:{currentTime:cP,trackHeaders:bP.exports,scrollStrip:_P},props:{annotations:{type:Array,default:function(){return[]}},video:{type:HTMLVideoElement,required:!0},seeking:{type:Boolean,default:!1},heightOffset:{type:Number,default:0},pendingAnnotation:{type:Object,default:function(){return null}}},data:function(){return{animationFrameId:null,refreshRate:30,refreshLastTime:Date.now(),currentTime:0,duration:0,scrollTop:0,hoverTime:0}},computed:{labelMap:function(){var t={},e=this.annotations;return this.pendingAnnotation&&(e=e.slice()).push(this.pendingAnnotation),e.forEach((function(e){e.labels.forEach((function(e){t.hasOwnProperty(e.label_id)||(t[e.label_id]=e.label)}))})),t},annotationTracks:function(){var t=this,e={},i=this.annotations;return this.pendingAnnotation&&(i=i.slice()).push(this.pendingAnnotation),i.forEach((function(t){t.labels.forEach((function(i){e.hasOwnProperty(i.label_id)||(e[i.label_id]=[]),e[i.label_id].push(t)}))})),Object.keys(e).map((function(i){return{id:i,label:t.labelMap[i],lanes:t.getAnnotationTrackLanes(e[i])}}))},styleObject:function(){return 0!==this.heightOffset?"height: calc(35% + ".concat(this.heightOffset,"px);"):""}},methods:{startUpdateLoop:function(){var t=Date.now();t-this.refreshLastTime>=this.refreshRate&&(this.updateCurrentTime(),this.refreshLastTime=t),this.animationFrameId=window.requestAnimationFrame(this.startUpdateLoop)},stopUpdateLoop:function(){this.updateCurrentTime(),window.cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null},updateCurrentTime:function(){this.currentTime=this.video.currentTime},setDuration:function(){this.duration=this.video.duration},emitSeek:function(t){this.$emit("seek",t)},emitSelect:function(t,e,i){this.$emit("select",t,e,i)},emitDeselect:function(t){this.$emit("deselect",t)},handleScrollY:function(t){this.scrollTop=t},getAnnotationTrackLanes:function(t){var e=this,i=[[]],n=[[]];return t.forEach((function(t){var r=[t.startFrame,t.endFrame],o=0,s=!1;t:for(;!s;){if(n[o]){for(var a=i[o].length-1;a>=0;a--)if(e.rangesCollide(i[o][a],r)){o+=1;continue t}}else i[o]=[],n[o]=[];i[o].push(r),n[o].push(t),s=!0}})),n},rangesCollide:function(t,e){return t[0]>=e[0]&&t[0]e[0]&&t[1]<=e[1]||e[0]>=t[0]&&e[0]t[0]&&e[1]<=t[1]||t[0]===e[0]&&t[1]===e[1]},updateHoverTime:function(t){this.hoverTime=t},emitStartResize:function(t){this.$emit("start-resize",t)},reset:function(){this.currentTime=0,this.duration=0,this.scrollTop=0,this.hoverTime=0,this.$refs.scrollStrip.reset()}},watch:{heightOffset:function(){this.$refs.scrollStrip.updateHeight()}},created:function(){this.video.addEventListener("play",this.startUpdateLoop),this.video.addEventListener("pause",this.stopUpdateLoop),this.video.addEventListener("loadedmetadata",this.setDuration),this.video.addEventListener("seeked",this.updateCurrentTime)}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"video-timeline",style:t.styleObject},[i("div",{staticClass:"grab-border",on:{mousedown:t.emitStartResize}}),t._v(" "),i("div",{staticClass:"static-strip"},[i("current-time",{attrs:{"current-time":t.currentTime,"hover-time":t.hoverTime,seeking:t.seeking}}),t._v(" "),i("track-headers",{ref:"trackheaders",attrs:{tracks:t.annotationTracks,"scroll-top":t.scrollTop}})],1),t._v(" "),i("scroll-strip",{ref:"scrollStrip",attrs:{tracks:t.annotationTracks,duration:t.duration,"current-time":t.currentTime,seeking:t.seeking},on:{seek:t.emitSeek,select:t.emitSelect,deselect:t.emitDeselect,"scroll-y":t.handleScrollY,"hover-time":t.updateHoverTime}})],1)}),[],!1,null,null,null).exports;function xP(t){return(xP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function SP(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function CP(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&kP(t,e)}function TP(t){var e=PP();return function(){var i,n=RP(t);if(e){var r=RP(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return EP(this,i)}}function EP(t,e){return!e||"object"!==xP(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function IP(t){var e="function"==typeof Map?new Map:void 0;return(IP=function(t){if(null===t||(i=t,-1===Function.toString.call(i).indexOf("[native code]")))return t;var i;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return AP(t,arguments,RP(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),kP(n,t)})(t)}function AP(t,e,i){return(AP=PP()?Reflect.construct:function(t,e,i){var n=[null];n.push.apply(n,e);var r=new(Function.bind.apply(t,n));return i&&kP(r,i.prototype),r}).apply(null,arguments)}function PP(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function kP(t,e){return(kP=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function RP(t){return(RP=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var LP=function(t){CP(i,t);var e=TP(i);function i(){return SP(this,i),e.apply(this,arguments)}return i}(IP(Error)),FP=function(t){CP(i,t);var e=TP(i);function i(){return SP(this,i),e.apply(this,arguments)}return i}(LP),MP=function(t){CP(i,t);var e=TP(i);function i(){return SP(this,i),e.apply(this,arguments)}return i}(LP),OP=function(t){CP(i,t);var e=TP(i);function i(){return SP(this,i),e.apply(this,arguments)}return i}(LP),$P=function(t){CP(i,t);var e=TP(i);function i(){return SP(this,i),e.apply(this,arguments)}return i}(LP),DP=function(t){CP(i,t);var e=TP(i);function i(){return SP(this,i),e.apply(this,arguments)}return i}(LP),jP=function(t){CP(i,t);var e=TP(i);function i(){return SP(this,i),e.apply(this,arguments)}return i}(LP);const NP=Sl({mixins:[lu],components:{videoScreen:hP,videoTimeline:wP,sidebar:kl,sidebarTab:Rl,labelTrees:Jh,settingsTab:tP,annotationsTab:QA,videoLabelsTab:eP},data:function(){return{volumeId:null,videoId:null,videoDuration:0,videoIds:[],videoFileUri:"",shapes:[],canEdit:!1,video:null,labelTrees:[],selectedLabel:null,pendingAnnotation:null,annotations:[],seeking:!1,settings:{annotationOpacity:1,showMinimap:!0,autoplayDraw:0,showLabelTooltip:!1,showMousePosition:!1,playbackRate:1,showProgressIndicator:!0},openTab:"",urlParams:{x:0,y:0,r:0,t:0},initialCurrentTime:0,initialMapCenter:[0,0],initialMapResolution:0,initialFocussedAnnotation:0,annotationFilters:[],activeAnnotationFilter:null,resizingTimeline:!1,timelineOffsetReference:0,timelineHeightReference:0,fixedTimelineOffset:0,currentTimelineOffset:0,errors:{},error:null,user:null,attachingLabel:!1,swappingLabel:!1}},computed:{selectedAnnotations:function(){return this.filteredAnnotations.filter((function(t){return t.isSelected}))},filteredAnnotations:function(){return this.hasActiveAnnotationFilter?this.activeAnnotationFilter.filter(this.annotations):this.annotations},hasActiveAnnotationFilter:function(){return null!==this.activeAnnotationFilter},timelineHeightOffset:function(){return this.fixedTimelineOffset+this.currentTimelineOffset},screenHeightOffset:function(){return-1*this.timelineHeightOffset},classObject:function(){return this.resizingTimeline?"resizing-timeline":""},hasSiblingVideos:function(){return this.videoIds.length>1},hasError:function(){return null!==this.error},hasVideoError:function(){return this.error instanceof LP},errorMessage:function(){if(this.hasVideoError){if(this.error instanceof FP)return"The video has not been processed yet. Please try again later.";if(this.error instanceof MP)return"The video file has not been found. Please check the source.";if(this.error instanceof OP)return"The video MIME type is invalid.";if(this.error instanceof $P)return"The video codec is invalid.";if(this.error instanceof DP)return"The video file is malformed.";if(this.error instanceof jP)return"The video file is too large."}return""},errorClass:function(){return this.hasVideoError?this.error instanceof FP?"panel-warning text-warning":"panel-danger text-danger":""}},methods:{prepareAnnotation:function(t){return new JA({data:t})},setAnnotations:function(t){this.annotations=t[0].body.map(this.prepareAnnotation)},addCreatedAnnotation:function(t){var e=this.prepareAnnotation(t.body);return e.$on("tracking-failed",this.removeAnnotation),this.annotations.push(e),e},seek:function(t){var e=this;if(!this.seeking&&this.video.currentTime!==t){var i=new Vue.Promise((function(t,i){e.video.addEventListener("seeked",t),e.video.addEventListener("error",i)}));return this.seeking=!0,this.video.currentTime=t,i}return Vue.Promise.resolve()},selectAnnotation:function(t,e,i){return this.attachingLabel?(this.attachAnnotationLabel(t),Vue.Promise.resolve()):this.swappingLabel?(this.swapAnnotationLabel(t),Vue.Promise.resolve()):i?this.selectAnnotations([t],[],e):this.selectAnnotations([t],this.selectedAnnotations,e)},selectAnnotations:function(t,e,i){e.forEach((function(t){t.selected=!1}));var n=this.selectedAnnotations.length>0;return t.forEach((function(t){t.selected=i})),void 0!==i&&!1===n?this.seek(i):Vue.Promise.resolve()},deselectAnnotation:function(t){t?t.selected=!1:this.selectedAnnotations.forEach((function(t){t.selected=!1}))},updatePendingAnnotation:function(t){if(t){var e=Object.assign({},t,{shape_id:this.shapes[t.shape],labels:[{label_id:this.selectedLabel.id,label:this.selectedLabel,user:this.user}],pending:!0});this.pendingAnnotation=new JA({data:e})}else this.pendingAnnotation=null},createAnnotation:function(t){var e=this;this.updatePendingAnnotation(t);var i=this.pendingAnnotation;this.annotations.push(i);var n=i.frames.length;this.videoDuration>0&&n>0&&i.frames[n-1]>this.videoDuration&&(i.frames[n-1]=this.videoDuration);var r=Object.assign({},t,{shape_id:this.shapes[t.shape],label_id:this.selectedLabel?this.selectedLabel.id:0});return delete r.shape,eA.save({id:this.videoId},r).then(this.addCreatedAnnotation,ou).finally((function(){var t=e.annotations.indexOf(i);-1!==t&&e.annotations.splice(t,1)}))},trackAnnotation:function(t){t.track=!0,this.createAnnotation(t).then(this.startPollTrackingAnnotation)},startPollTrackingAnnotation:function(t){t&&t.startPollTracking()},handleSelectedLabel:function(t){this.selectedLabel=t},handleDeselectedLabel:function(){this.selectedLabel=null},deleteAnnotationsOrKeyframes:function(t){confirm("Are you sure that you want to delete all selected annotations/keyframes?")&&t.forEach(this.deleteAnnotationOrKeyframe)},deleteAnnotationOrKeyframe:function(t){var e=this,i=t.annotation;i.isClip&&i.hasKeyframe(t.time)?i.deleteKeyframe(t.time).catch(ou):i.delete().then((function(){return e.removeAnnotation(i)})).catch(ou)},handleVideoSeeked:function(){this.seeking=!1},modifyAnnotations:function(t){t.forEach(this.modifyAnnotation)},modifyAnnotation:function(t){t.annotation.modify(t.time,t.points).catch(ou)},handleUpdatedSettings:function(t,e){this.settings[t]=e},handleOpenedTab:function(t){JI.set("openTab",t)},handleClosedTab:function(){JI.delete("openTab")},handleToggledTab:function(){this.$refs.videoScreen.updateSize()},removeAnnotation:function(t){var e=this.annotations.indexOf(t);-1!==e&&this.annotations.splice(e,1)},splitAnnotation:function(t,e){t.split(e).then(this.addCreatedAnnotation,ou)},linkAnnotations:function(t){var e=this;t[0].link(t[1]).then((function(){return e.removeAnnotation(t[1])})).catch(ou)},updateMapUrlParams:function(t,e){this.urlParams.x=Math.round(t[0]),this.urlParams.y=Math.round(t[1]),this.urlParams.r=Math.round(100*e)},updateVideoUrlParams:function(){this.urlParams.t=Math.round(100*this.video.currentTime)},restoreUrlParams:function(){void 0!==Ql.get("r")&&(this.initialMapResolution=parseInt(Ql.get("r"),10)/100),void 0!==Ql.get("x")&&void 0!==Ql.get("y")&&(this.initialMapCenter=[parseInt(Ql.get("x"),10),parseInt(Ql.get("y"),10)]),void 0!==Ql.get("t")&&(this.initialCurrentTime=parseInt(Ql.get("t"),10)/100),void 0!==Ql.get("annotation")&&(this.initialFocussedAnnotation=parseInt(Ql.get("annotation"),10))},maybeInitCurrentTime:function(){return 0===this.initialCurrentTime||this.selectedAnnotations.length>0?Vue.Promise.resolve():this.seek(this.initialCurrentTime)},maybeFocusInitialAnnotation:function(){var t=this;if(this.initialFocussedAnnotation){var e=this.annotations.find((function(e){return e.id===t.initialFocussedAnnotation}));if(e)return this.selectAnnotation(e,e.startFrame).then((function(){return t.$refs.videoScreen.focusAnnotation(e)}))}return Vue.Promise.resolve()},detachAnnotationLabel:function(t,e){var i=this;t.labels.length>1?t.detachAnnotationLabel(e).catch(ou):confirm("Detaching the last label of an annotation deletes the whole annotation. Do you want to delete the annotation?")&&t.delete().then((function(){return i.removeAnnotation(t)})).catch(ou)},attachAnnotationLabel:function(t){var e=t.attachAnnotationLabel(this.selectedLabel);return e.catch(ou),e},swapAnnotationLabel:function(t){var e=this,i=t.labels.filter((function(t){return t.user_id===e.user.id})).sort((function(t,e){return t.id-e.id})).pop();this.attachAnnotationLabel(t).then((function(){i&&e.detachAnnotationLabel(t,i)})).catch(ou)},initAnnotationFilters:function(){var t={};for(var e in this.shapes)t[this.shapes[e]]=e;this.annotationFilters=[new UI({data:{annotations:this.annotations}}),new GI({data:{annotations:this.annotations}}),new VI({data:{shapes:t}})]},updateAnnotationFilters:function(){this.annotationFilters[0].annotations=this.annotations,this.annotationFilters[1].annotations=this.annotations},setActiveAnnotationFilter:function(t){this.activeAnnotationFilter=t},resetAnnotationFilter:function(){this.activeAnnotationFilter&&this.activeAnnotationFilter.reset(),this.activeAnnotationFilter=null},handleRequiresSelectedLabel:function(){su.info("Please select a label first."),this.$refs.sidebar.$emit("open","labels")},startUpdateTimelineHeight:function(t){t.preventDefault(),this.resizingTimeline=!0,this.timelineOffsetReference=t.clientY,this.timelineHeightReference=this.$refs.videoTimeline.$el.offsetHeight},updateTimelineHeight:function(t){this.resizingTimeline&&(t.preventDefault(),this.currentTimelineOffset=this.timelineOffsetReference-t.clientY)},finishUpdateTimelineHeight:function(){this.resizingTimeline&&(this.resizingTimeline=!1,this.fixedTimelineOffset=this.fixedTimelineOffset+this.$refs.videoTimeline.$el.offsetHeight-this.timelineHeightReference,this.currentTimelineOffset=0)},handleVideoInformationResponse:function(t){var e=t.body;if(e.error===this.errors["not-found"])throw new MP;if(e.error===this.errors.mimetype)throw new OP;if(e.error===this.errors.codec)throw new $P;if(e.error===this.errors.malformed)throw new DP;if(e.error===this.errors["too-large"])throw new jP;if(null===e.size)throw new FP;return this.error=null,this.videoDuration=e.duration,e},handleVideoError:function(t){t instanceof LP?this.error=t:(this.error=!0,ou(t))},fetchVideoContent:function(t){var e=this,i=new Vue.Promise((function(t){e.video.addEventListener("canplay",t)})),n=eA.query({id:t.id}),r=Vue.Promise.all([n,i]).then(this.setAnnotations).then(this.updateAnnotationFilters).then(this.maybeFocusInitialAnnotation).then(this.maybeInitCurrentTime);return this.video.src=this.videoFileUri.replace(":id",t.id),r},loadVideo:function(t){return this.videoId=t,Al.$emit("video.id",t),Ql.setSlug(t,-2),this.startLoading(),Fd.get({id:t}).then(this.handleVideoInformationResponse).then(this.fetchVideoContent).catch(this.handleVideoError).finally(this.finishLoading)},showPreviousVideo:function(){this.reset();var t=this.videoIds.length,e=(this.videoIds.indexOf(this.videoId)+t-1)%t;this.loadVideo(this.videoIds[e]).then(this.updateVideoUrlParams)},showNextVideo:function(){this.reset();var t=this.videoIds.length,e=(this.videoIds.indexOf(this.videoId)+t+1)%t;this.loadVideo(this.videoIds[e]).then(this.updateVideoUrlParams)},reset:function(){this.annotations=[],this.seeking=!1,this.initialCurrentTime=0,this.initialFocussedAnnotation=0,this.$refs.videoTimeline.reset(),this.$refs.videoScreen.reset()},initVideoIds:function(t){var e=window.localStorage.getItem("biigle.volumes.".concat(this.volumeId,".files"));if(e){var i={};return t.forEach((function(t){i[t]=null})),JSON.parse(e).filter((function(t){return i.hasOwnProperty(t)}))}return t},handleAttachingLabelActive:function(t){this.swappingLabel=!1,this.attachingLabel=t},handleSwappingLabelActive:function(t){this.attachingLabel=!1,this.swappingLabel=t}},watch:{"settings.playbackRate":function(t){this.video.playbackRate=t},urlParams:{deep:!0,handler:function(t){Ql.set(t)}}},created:function(){var t=biigle.$require("videos.shapes"),e={};Object.keys(t).forEach((function(i){e[t[i]]=parseInt(i)})),this.shapes=e,this.video=document.createElement("video"),this.videoId=biigle.$require("videos.id"),this.volumeId=biigle.$require("videos.volumeId"),this.videoIds=this.initVideoIds(biigle.$require("videos.videoIds")),this.videoFileUri=biigle.$require("videos.videoFileUri"),this.canEdit=biigle.$require("videos.isEditor"),this.labelTrees=biigle.$require("videos.labelTrees"),this.errors=biigle.$require("videos.errors"),this.user=biigle.$require("videos.user"),this.initAnnotationFilters(),this.restoreUrlParams(),this.video.muted=!0,this.video.addEventListener("error",(function(t){t.target.error.code===MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED?t.target.error.message.startsWith("404")||t.target.error.message.startsWith("403")?su.danger("Unable to access the video file."):su.danger("The video codec is not supported by your browser."):t.target.error.code!==MediaError.MEDIA_ERR_ABORTED&&su.danger("Error while loading video file.")})),this.video.addEventListener("seeked",this.handleVideoSeeked),this.video.addEventListener("pause",this.updateVideoUrlParams),this.video.addEventListener("seeked",this.updateVideoUrlParams),JI.has("openTab")&&(this.openTab=JI.get("openTab"))},mounted:function(){this.loadVideo(this.videoId)}},undefined,undefined,!1,null,null,null).exports;biigle.$mount("search-results",tA),biigle.$mount("video-annotations-navbar",QI),biigle.$mount("video-container",NP)},276:()=>{var t=new Date(0);Vue.filter("videoTime",(function(e){return t.setTime(1e3*e),t.toISOString().split("T")[1].slice(0,-2)}))},924:(t,e,i)=>{"use strict";var n=i(210),r=i(559),o=r(n("String.prototype.indexOf"));t.exports=function(t,e){var i=n(t,!!e);return"function"==typeof i&&o(t,".prototype.")>-1?r(i):i}},559:(t,e,i)=>{"use strict";var n=i(612),r=i(210),o=r("%Function.prototype.apply%"),s=r("%Function.prototype.call%"),a=r("%Reflect.apply%",!0)||n.call(s,o),l=r("%Object.getOwnPropertyDescriptor%",!0),u=r("%Object.defineProperty%",!0),h=r("%Math.max%");if(u)try{u({},"a",{value:1})}catch(t){u=null}t.exports=function(t){var e=a(n,s,arguments);if(l&&u){var i=l(e,"length");i.configurable&&u(e,"length",{value:1+h(0,t.length-(arguments.length-1))})}return e};var c=function(){return a(n,o,arguments)};u?u(t.exports,"apply",{value:c}):t.exports.apply=c},442:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>o});var n=i(645),r=i.n(n)()((function(t){return t[1]}));r.push([t.id,'.ol-box{box-sizing:border-box;border-radius:2px;border:2px solid #00f}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:rgba(0,60,136,.3);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid #eee;border-top:none;color:#eee;font-size:10px;text-align:center;margin:1px;will-change:contents,width}.ol-overlay-container{will-change:left,right,top,bottom}.ol-unsupported{display:none}.ol-unselectable,.ol-viewport{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:grab}.ol-control{position:absolute;background-color:hsla(0,0%,100%,.4);border-radius:4px;padding:2px}.ol-control:hover{background-color:hsla(0,0%,100%,.6)}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}@media print{.ol-control{display:none}}.ol-control button{display:block;margin:1px;padding:0;color:#fff;font-size:1.14em;font-weight:700;text-decoration:none;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:rgba(0,60,136,.5);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;font-size:1.2em;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:focus,.ol-control button:hover{text-decoration:none;background-color:rgba(0,60,136,.7)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em)}.ol-attribution ul{margin:0;padding:0 .5em;font-size:.7rem;line-height:1.375em;color:#000;text-shadow:0 0 2px #fff}.ol-attribution li{display:inline;list-style:none;line-height:inherit}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button,.ol-attribution ul{display:inline-block}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:hsla(0,0%,100%,.8)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0;height:1.1em;line-height:1em}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:inline-block}.ol-overviewmap .ol-overviewmap-map{border:1px solid #7b98bc;height:150px;margin:2px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:1px;left:2px;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:hsla(0,0%,100%,.8)}.ol-overviewmap-box{border:2px dotted rgba(0,60,136,.7)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}',""]);const o=r},645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i=t(e);return e[2]?"@media ".concat(e[2]," {").concat(i,"}"):i})).join("")},e.i=function(t,i,n){"string"==typeof t&&(t=[[null,t,""]]);var r={};if(n)for(var o=0;o{var n=i(215),r=i(584),o=i(609),s=i(420),a=i(847),l=i(923),u=Date.prototype.getTime;function h(t,e,i){var f=i||{};return!!(f.strict?o(t,e):t===e)||(!t||!e||"object"!=typeof t&&"object"!=typeof e?f.strict?o(t,e):t==e:function(t,e,i){var o,f;if(typeof t!=typeof e)return!1;if(c(t)||c(e))return!1;if(t.prototype!==e.prototype)return!1;if(r(t)!==r(e))return!1;var p=s(t),g=s(e);if(p!==g)return!1;if(p||g)return t.source===e.source&&a(t)===a(e);if(l(t)&&l(e))return u.call(t)===u.call(e);var m=d(t),v=d(e);if(m!==v)return!1;if(m||v){if(t.length!==e.length)return!1;for(o=0;o=0;o--)if(y[o]!=_[o])return!1;for(o=y.length-1;o>=0;o--)if(!h(t[f=y[o]],e[f],i))return!1;return!0}(t,e,f))}function c(t){return null==t}function d(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}t.exports=h},289:(t,e,i)=>{"use strict";var n=i(215),r="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=Object.defineProperty,l=a&&function(){var t={};try{for(var e in a(t,"x",{enumerable:!1,value:t}),t)return!1;return t.x===t}catch(t){return!1}}(),u=function(t,e,i,n){var r;(!(e in t)||"function"==typeof(r=n)&&"[object Function]"===o.call(r)&&n())&&(l?a(t,e,{configurable:!0,enumerable:!1,value:i,writable:!0}):t[e]=i)},h=function(t,e){var i=arguments.length>2?arguments[2]:{},o=n(e);r&&(o=s.call(o,Object.getOwnPropertySymbols(e)));for(var a=0;a{"use strict";var e="Function.prototype.bind called on incompatible ",i=Array.prototype.slice,n=Object.prototype.toString,r="[object Function]";t.exports=function(t){var o=this;if("function"!=typeof o||n.call(o)!==r)throw new TypeError(e+o);for(var s,a=i.call(arguments,1),l=function(){if(this instanceof s){var e=o.apply(this,a.concat(i.call(arguments)));return Object(e)===e?e:this}return o.apply(t,a.concat(i.call(arguments)))},u=Math.max(0,o.length-a.length),h=[],c=0;c{"use strict";var n=i(648);t.exports=Function.prototype.bind||n},657:(t,e,i)=>{var n=i(251),r=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=!(!t||!t.direction)&&t.direction,this.pseudoNode=!(!t||!t.pseudoNode)&&t.pseudoNode,this.objectComparator=t&&t.objectComparator?t.objectComparator:a};function o(t){return t.coordinates.map((function(e){return{type:t.type.replace("Multi",""),coordinates:e}}))}function s(t,e){return t.hasOwnProperty("coordinates")?t.coordinates.length===e.coordinates.length:t.length===e.length}function a(t,e){return n(t,e,{strict:!0})}r.prototype.compare=function(t,e){if(t.type!==e.type||!s(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,e);case"Feature":return this.compareFeature(t,e);default:if(0===t.type.indexOf("Multi")){var i=this,n=o(t),r=o(e);return n.every((function(t){return this.some((function(e){return i.compare(t,e)}))}),r)}}return!1},r.prototype.compareCoord=function(t,e){if(t.length!==e.length)return!1;for(var i=0;i=0&&(i=[].concat(t.slice(n,t.length),t.slice(1,n+1))),i},r.prototype.comparePath=function(t,e){var i=this;return t.every((function(t,e){return i.compareCoord(t,this[e])}),e)},r.prototype.comparePolygon=function(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var i=t.coordinates.slice(1,t.coordinates.length),n=e.coordinates.slice(1,e.coordinates.length),r=this;return i.every((function(t){return this.some((function(e){return r.compareLine(t,e,1,!0)}))}),n)}return!1},r.prototype.compareFeature=function(t,e){return!(t.id!==e.id||!this.objectComparator(t.properties,e.properties)||!this.compareBBox(t,e))&&this.compare(t.geometry,e.geometry)},r.prototype.compareBBox=function(t,e){return!!(!t.bbox&&!e.bbox||t.bbox&&e.bbox&&this.compareCoord(t.bbox,e.bbox))},r.prototype.removePseudo=function(t){return t},t.exports=r},787:(t,e,i)=>{var n=i(510),r=i(102),o=i(540),s=i(705).Z,a=o.featureEach,l=(o.coordEach,r.polygon,r.featureCollection);function u(t){var e=n(t);return e.insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:s(t),n.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:s(t),e.push(t)})):a(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:s(t),e.push(t)})),n.prototype.load.call(this,e)},e.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:s(t),n.prototype.remove.call(this,t,e)},e.clear=function(){return n.prototype.clear.call(this)},e.search=function(t){var e=n.prototype.search.call(this,this.toBBox(t));return l(e)},e.collides=function(t){return n.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=n.prototype.all.call(this);return l(t)},e.toJSON=function(){return n.prototype.toJSON.call(this)},e.fromJSON=function(t){return n.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else if("Feature"===t.type)e=s(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");e=s(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}t.exports=u,t.exports.default=u},210:(t,e,i)=>{"use strict";var n,r=SyntaxError,o=Function,s=TypeError,a=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},l=Object.getOwnPropertyDescriptor;if(l)try{l({},"")}catch(t){l=null}var u=function(){throw new s},h=l?function(){try{return u}catch(t){try{return l(arguments,"callee").get}catch(t){return u}}}():u,c=i(405)(),d=Object.getPrototypeOf||function(t){return t.__proto__},f={},p="undefined"==typeof Uint8Array?n:d(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":c?d([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":c?d(d([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&c?d((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&c?d((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":c?d(""[Symbol.iterator]()):n,"%Symbol%":c?Symbol:n,"%SyntaxError%":r,"%ThrowTypeError%":h,"%TypedArray%":p,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},m=function t(e){var i;if("%AsyncFunction%"===e)i=a("async function () {}");else if("%GeneratorFunction%"===e)i=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)i=a("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(i=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var r=t("%AsyncGenerator%");r&&(i=d(r.prototype))}return g[e]=i,i},v={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},y=i(612),_=i(642),b=y.call(Function.call,Array.prototype.concat),w=y.call(Function.apply,Array.prototype.splice),x=y.call(Function.call,String.prototype.replace),S=y.call(Function.call,String.prototype.slice),C=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,T=/\\(\\)?/g,E=function(t){var e=S(t,0,1),i=S(t,-1);if("%"===e&&"%"!==i)throw new r("invalid intrinsic syntax, expected closing `%`");if("%"===i&&"%"!==e)throw new r("invalid intrinsic syntax, expected opening `%`");var n=[];return x(t,C,(function(t,e,i,r){n[n.length]=i?x(r,T,"$1"):e||t})),n},I=function(t,e){var i,n=t;if(_(v,n)&&(n="%"+(i=v[n])[0]+"%"),_(g,n)){var o=g[n];if(o===f&&(o=m(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new r("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');var i=E(t),n=i.length>0?i[0]:"",o=I("%"+n+"%",e),a=o.name,u=o.value,h=!1,c=o.alias;c&&(n=c[0],w(i,b([0,1],c)));for(var d=1,f=!0;d=i.length){var y=l(u,p);u=(f=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:u[p]}else f=_(u,p),u=u[p];f&&!h&&(g[a]=u)}}return u}},405:(t,e,i)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,r=i(419);t.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&r())))}},419:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),i=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(i))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var r=Object.getOwnPropertyDescriptor(t,e);if(42!==r.value||!0!==r.enumerable)return!1}return!0}},642:(t,e,i)=>{"use strict";var n=i(612);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},584:(t,e,i)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,r=i(924)("Object.prototype.toString"),o=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===r(t)},s=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==r(t)&&"[object Function]"===r(t.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,t.exports=a?o:s},923:t=>{"use strict";var e=Date.prototype.getDay,i=Object.prototype.toString,n="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){return"object"==typeof t&&null!==t&&(n?function(t){try{return e.call(t),!0}catch(t){return!1}}(t):"[object Date]"===i.call(t))}},420:(t,e,i)=>{"use strict";var n,r,o,s,a=i(924),l=i(405)()&&"symbol"==typeof Symbol.toStringTag;if(l){n=a("Object.prototype.hasOwnProperty"),r=a("RegExp.prototype.exec"),o={};var u=function(){throw o};s={toString:u,valueOf:u},"symbol"==typeof Symbol.toPrimitive&&(s[Symbol.toPrimitive]=u)}var h=a("Object.prototype.toString"),c=Object.getOwnPropertyDescriptor;t.exports=l?function(t){if(!t||"object"!=typeof t)return!1;var e=c(t,"lastIndex");if(!(e&&n(e,"value")))return!1;try{r(t,s)}catch(t){return t===o}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===h(t)}},252:(t,e,i)=>{t=i.nmd(t);var n,r=((n={}).floodFill=function(t,e,i,n,r,o){return o?function(t,e,i,n,r){var o,s,a,l,u,h,c,d,f,p,g=t.data,m=t.width,v=t.height,y=t.bytes,_=-1,b=m+1,w=-1,x=v+1,S=i*m+e,C=new Uint8Array(m*v),T=new Uint8Array(r||m*v);if(1===T[S])return null;var E=[g[S*=y],g[S+1],g[S+2],g[S+3]],I=[{y:i,left:e-1,right:e+1,dir:1}];do{for(p=!1,s=(l=I.shift()).left+1;sn||o<-n||(o=g[S+1]-E[1])>n||o<-n||(o=g[S+2]-E[2])>n||o<-n))){for(h=s-1;h>-1&&(S=(d=c+h)*y,1!==T[d])&&(C[d]=1,T[d]=1,h--,!((o=g[S]-E[0])>n||o<-n))&&!((o=g[S+1]-E[1])>n||o<-n)&&!((o=g[S+2]-E[2])>n||o<-n););for(u=s+1;un||o<-n))&&!((o=g[S+1]-E[1])>n||o<-n)&&!((o=g[S+2]-E[2])>n||o<-n););h_&&(_=u-1),(a=l.y-l.dir)>=0&&a=0&&aw&&(w=l.y))}while(I.length>0);return{data:C,width:t.width,height:t.height,bounds:{minX:b,minY:x,maxX:_,maxY:w}}}(t,e,i,n,r):function(t,e,i,n,r){var o,s,a,l,u,h,c,d,f,p,g=t.data,m=t.width,v=t.height,y=t.bytes,_=-1,b=m+1,w=-1,x=v+1,S=i*m+e,C=new Uint8Array(m*v),T=new Uint8Array(r||m*v);if(1===T[S])return null;var E=[g[S*=y],g[S+1],g[S+2],g[S+3]],I=[{y:i,left:e-1,right:e+1,dir:1}];do{for(p=!1,s=(l=I.shift()).left+1;sn||o<-n||(o=g[S+1]-E[1])>n||o<-n||(o=g[S+2]-E[2])>n||o<-n)){for(p=!0,C[c+s]=1,T[c+s]=1,h=s-1;h>-1&&(S=(d=c+h)*y,1!==T[d])&&!((o=g[S]-E[0])>n||o<-n)&&!((o=g[S+1]-E[1])>n||o<-n)&&!((o=g[S+2]-E[2])>n||o<-n);)C[d]=1,T[d]=1,h--;for(u=s+1;un||o<-n)&&!((o=g[S+1]-E[1])>n||o<-n)&&!((o=g[S+2]-E[2])>n||o<-n);)C[f]=1,T[f]=1,u++;h_&&(_=u-1),(a=l.y-l.dir)>=0&&a=0&&aw&&(w=l.y))}while(I.length>0);return{data:C,width:t.width,height:t.height,bounds:{minX:b,minY:x,maxX:_,maxY:w}}}(t,e,i,n,r)},n.gaussBlur=function(t,e){var i,n,r,o,s,a,l,u=2*e+1,h=e*e,c=new Float32Array(u),d=0,f=t.width,p=t.height,g=t.data,m=t.bounds.minX,v=t.bounds.maxX,y=t.bounds.minY,_=t.bounds.maxY;for(i=0;i0?e-o:0;i0?e-s:0;i.5?1:0}return{data:x,width:f,height:p,bounds:{minX:m,minY:y,maxX:v,maxY:_}}},n.gaussBlurOnlyBorder=function(t,e,i){var n,r,o,s,a,l,u,h,c,d,f=function(t,e,i){var n,r,o,s,a,l,u,h=t.width,c=t.height,d=t.data,f=new Uint8Array(d),p=t.bounds.minX,g=t.bounds.maxX,m=t.bounds.minY,v=t.bounds.maxY,y=h*c,_=new Uint8Array(y),b=[],w=Math.max(p,1),x=Math.min(g,h-2),S=Math.max(m,1),C=Math.min(v,c-2);if(i&&i.length>0)for(a=0;a0?e-n:0;r0?e-s:0;r0?e-u:0;s.5)E[a]=1,ux&&(x=u),hC&&(C=h);else{for(d=A-h0?e-h:0;s.5?(E[a]=1,ux&&(x=u),hC&&(C=h)):E[a]=0}}return{data:E,width:y,height:_,bounds:{minX:w,minY:S,maxX:x,maxY:C}}},n.createBorderMask=function(t){var e,i,n,r,o,s=t.width,a=t.height,l=t.data,u=t.bounds.minX,h=t.bounds.maxX,c=t.bounds.minY,d=t.bounds.maxY,f=h-u+1,p=d-c+1,g=new Uint8Array(f*p),m=Math.max(u,1),v=Math.min(h,s-2),y=Math.max(c,1),_=Math.min(d,a-2);for(i=y;i<_+1;i++)for(e=m;e=Math.sqrt(v*v+y*y)?v:v>=Math.sqrt(m*m+y*y)?m:Math.abs((b*w.x-_*w.y+x.x*S.y-S.x*x.y)/y))>f&&(p=n,f=g);f>e&&(h.push(p),c.push({first:d.first,last:p}),c.push({first:p,last:d.last}))}}while(c.length>0);for(u=[],l=h.length,h.sort((function(t,e){return t-e})),o=0;oe?1:t0){var a=n+Math.floor(s/2),l={key:e[a],data:i[a],parent:t};return l.left=r(l,e,i,n,a),l.right=r(l,e,i,a+1,o),l}return null}function o(t,e,i,n,r){if(!(i>=n)){for(var s=t[i+n>>1],a=i-1,l=n+1;;){do{a++}while(r(t[a],s)<0);do{l--}while(r(t[l],s)>0);if(a>=l)break;var u=t[a];t[a]=t[l],t[l]=u,u=e[a],e[a]=e[l],e[l]=u}o(t,e,i,l,r),o(t,e,l+1,n,r)}}i.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},i.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},i.prototype._splay=function(t){for(;t.parent;){var e=t.parent;e.parent?e.left===t&&e.parent.left===e?(this.rotateRight(e.parent),this.rotateRight(e)):e.right===t&&e.parent.right===e?(this.rotateLeft(e.parent),this.rotateLeft(e)):e.left===t&&e.parent.right===e?(this.rotateRight(e),this.rotateLeft(e)):(this.rotateLeft(e),this.rotateRight(e)):e.left===t?this.rotateRight(e):this.rotateLeft(e)}},i.prototype.splay=function(t){for(var e,i,n,r,o;t.parent;)(i=(e=t.parent).parent)&&i.parent?((n=i.parent).left===i?n.left=t:n.right=t,t.parent=n):(t.parent=null,this._root=t),r=t.left,o=t.right,t===e.left?(i&&(i.left===e?(e.right?(i.left=e.right,i.left.parent=i):i.left=null,e.right=i,i.parent=e):(r?(i.right=r,r.parent=i):i.right=null,t.left=i,i.parent=t)),o?(e.left=o,o.parent=e):e.left=null,t.right=e,e.parent=t):(i&&(i.right===e?(e.left?(i.right=e.left,i.right.parent=i):i.right=null,e.left=i,i.parent=e):(o?(i.left=o,o.parent=i):i.left=null,t.right=i,i.parent=t)),r?(e.right=r,r.parent=e):e.right=null,t.left=e,e.parent=t)},i.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)},i.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},i.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},i.prototype.insert=function(t,e){var i=this._root,n=null,r=this._compare;if(this._noDuplicates)for(;i;){if(n=i,0===r(i.key,t))return;i=r(i.key,t)<0?i.right:i.left}else for(;i;)n=i,i=r(i.key,t)<0?i.right:i.left;return i={key:t,data:e,left:null,right:null,parent:n},n?r(n.key,i.key)<0?n.right=i:n.left=i:this._root=i,this.splay(i),this._size++,i},i.prototype.find=function(t){for(var e=this._root,i=this._compare;e;){var n=i(e.key,t);if(n<0)e=e.right;else{if(!(n>0))return e;e=e.left}}return null},i.prototype.contains=function(t){for(var e=this._root,i=this._compare;e;){var n=i(t,e.key);if(0===n)return!0;e=n<0?e.left:e.right}return!1},i.prototype.remove=function(t){var e=this.find(t);if(!e)return!1;if(this.splay(e),e.left)if(e.right){var i=this.minNode(e.right);i.parent!==e&&(this.replace(i,i.right),i.right=e.right,i.right.parent=i),this.replace(e,i),i.left=e.left,i.left.parent=i}else this.replace(e,e.left);else this.replace(e,e.right);return this._size--,!0},i.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},i.prototype.erase=function(t){var e=this.find(t);if(e){this.splay(e);var i=e.left,n=e.right,r=null;i&&(i.parent=null,r=this.maxNode(i),this.splay(r),this._root=r),n&&(i?r.right=n:this._root=n,n.parent=r),this._size--}},i.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},i.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;)t=e,e=e.parent;return e},i.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;)t=e,e=e.parent;return e},i.prototype.forEach=function(t){for(var e=this._root,i=[],n=!1,r=0;!n;)e?(i.push(e),e=e.left):i.length>0?(t(e=i.pop(),r++),e=e.right):n=!0;return this},i.prototype.range=function(t,e,i,n){for(var r=[],o=this._compare,s=this._root;0!==r.length||s;)if(s)r.push(s),s=s.left;else{if(o((s=r.pop()).key,e)>0)break;if(o(s.key,t)>=0&&i.call(n,s))return this;s=s.right}return this},i.prototype.keys=function(){for(var t=this._root,e=[],i=[],n=!1;!n;)t?(e.push(t),t=t.left):e.length>0?(t=e.pop(),i.push(t.key),t=t.right):n=!0;return i},i.prototype.values=function(){for(var t=this._root,e=[],i=[],n=!1;!n;)t?(e.push(t),t=t.left):e.length>0?(t=e.pop(),i.push(t.data),t=t.right):n=!0;return i},i.prototype.at=function(t){for(var e=this._root,i=[],n=!1,r=0;!n;)if(e)i.push(e),e=e.left;else if(i.length>0){if(e=i.pop(),r===t)return e;r++,e=e.right}else n=!0;return null},i.prototype.load=function(t,e,i){if(void 0===t&&(t=[]),void 0===e&&(e=[]),void 0===i&&(i=!1),0!==this._size)throw new Error("bulk-load: tree is not empty");var n=t.length;return i&&o(t,e,0,n-1,this._compare),this._root=r(null,t,e,0,n),this._size=n,this},i.prototype.min=function(){var t=this.minNode(this._root);return t?t.key:null},i.prototype.max=function(){var t=this.maxNode(this._root);return t?t.key:null},i.prototype.isEmpty=function(){return null===this._root},n.size.get=function(){return this._size},i.createTree=function(t,e,n,r,o){return new i(n,o).load(t,e,r)},Object.defineProperties(i.prototype,n);var s=0,a=1,l=2,u=3,h=0,c=1,d=2,f=3;function p(t,e,i){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=!g(e,i)||e.isVertical()?e.prevInResult:e));var n=g(t,i);t.resultTransition=n?m(t,i):0}function g(t,e){switch(t.type){case s:switch(e){case h:return!t.otherInOut;case c:return t.otherInOut;case d:return t.isSubject&&t.otherInOut||!t.isSubject&&!t.otherInOut;case f:return!0}break;case l:return e===h||e===c;case u:return e===d;case a:return!1}return!1}function m(t,e){var i,n=!t.inOut,r=!t.otherInOut;switch(e){case h:i=n&&r;break;case c:i=n||r;break;case f:i=n^r;break;case d:i=t.isSubject?n&&!r:r&&!n}return i?1:-1}var v=function(t,e,i,n,r){this.left=e,this.point=t,this.otherEvent=i,this.isSubject=n,this.type=r||s,this.inOut=!1,this.otherInOut=!1,this.prevInResult=null,this.resultTransition=0,this.otherPos=-1,this.outputContourId=-1,this.isExteriorRing=!0},y={inResult:{configurable:!0}};function _(t,e){return t[0]===e[0]&&t[1]===e[1]}v.prototype.isBelow=function(t){var e=this.point,i=this.otherEvent.point;return this.left?(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])>0:(i[0]-t[0])*(e[1]-t[1])-(e[0]-t[0])*(i[1]-t[1])>0},v.prototype.isAbove=function(t){return!this.isBelow(t)},v.prototype.isVertical=function(){return this.point[0]===this.otherEvent.point[0]},y.inResult.get=function(){return 0!==this.resultTransition},v.prototype.clone=function(){var t=new v(this.point,this.left,this.otherEvent,this.isSubject,this.type);return t.contourId=this.contourId,t.resultTransition=this.resultTransition,t.prevInResult=this.prevInResult,t.isExteriorRing=this.isExteriorRing,t.inOut=this.inOut,t.otherInOut=this.otherInOut,t},Object.defineProperties(v.prototype,y);var b=11102230246251565e-32,w=134217729,x=(3+8*b)*b;function S(t,e,i,n,r){var o,s,a,l,u=e[0],h=n[0],c=0,d=0;h>u==h>-u?(o=u,u=e[++c]):(o=h,h=n[++d]);var f=0;if(cu==h>-u?(a=o-((s=u+o)-u),u=e[++c]):(a=o-((s=h+o)-h),h=n[++d]),o=s,0!==a&&(r[f++]=a);cu==h>-u?(a=o-((s=o+u)-(l=s-o))+(u-l),u=e[++c]):(a=o-((s=o+h)-(l=s-o))+(h-l),h=n[++d]),o=s,0!==a&&(r[f++]=a);for(;c=U||-B>=U)return B;if(a=t-($+(c=t-$))+(c-r),u=i-(D+(c=i-D))+(c-r),l=e-(j+(c=e-j))+(c-o),h=n-(N+(c=n-N))+(c-o),0===a&&0===l&&0===u&&0===h)return B;if(U=A*s+x*Math.abs(B),(B+=$*h+N*a-(j*u+D*l))>=U||-B>=U)return B;c=(T=(p=a-(f=(d=w*a)-(d-a)))*(m=N-(g=(d=w*N)-(d-N)))-((b=a*N)-f*g-p*g-f*m))-(v=T-(M=(p=l-(f=(d=w*l)-(d-l)))*(m=D-(g=(d=w*D)-(d-D)))-((E=l*D)-f*g-p*g-f*m))),F[0]=T-(v+c)+(c-M),c=(_=b-((y=b+v)-(c=y-b))+(v-c))-(v=_-E),F[1]=_-(v+c)+(c-E),c=(O=y+v)-y,F[2]=y-(O-c)+(v-c),F[3]=O;var z=S(4,P,4,F,k);c=(T=(p=$-(f=(d=w*$)-(d-$)))*(m=h-(g=(d=w*h)-(d-h)))-((b=$*h)-f*g-p*g-f*m))-(v=T-(M=(p=j-(f=(d=w*j)-(d-j)))*(m=u-(g=(d=w*u)-(d-u)))-((E=j*u)-f*g-p*g-f*m))),F[0]=T-(v+c)+(c-M),c=(_=b-((y=b+v)-(c=y-b))+(v-c))-(v=_-E),F[1]=_-(v+c)+(c-E),c=(O=y+v)-y,F[2]=y-(O-c)+(v-c),F[3]=O;var V=S(z,k,4,F,R);c=(T=(p=a-(f=(d=w*a)-(d-a)))*(m=h-(g=(d=w*h)-(d-h)))-((b=a*h)-f*g-p*g-f*m))-(v=T-(M=(p=l-(f=(d=w*l)-(d-l)))*(m=u-(g=(d=w*u)-(d-u)))-((E=l*u)-f*g-p*g-f*m))),F[0]=T-(v+c)+(c-M),c=(_=b-((y=b+v)-(c=y-b))+(v-c))-(v=_-E),F[1]=_-(v+c)+(c-E),c=(O=y+v)-y,F[2]=y-(O-c)+(v-c),F[3]=O;var G=S(V,R,4,F,L);return L[G-1]}function O(t,e,i,n,r,o){var s=(e-o)*(i-r),a=(t-r)*(n-o),l=s-a;if(0===s||0===a||s>0!=a>0)return l;var u=Math.abs(s+a);return Math.abs(l)>=E*u?l:-M(t,e,i,n,r,o,u)}function $(t,e,i){var n=O(t[0],t[1],e[0],e[1],i[0],i[1]);return n>0?-1:n<0?1:0}function D(t,e){var i=t.point,n=e.point;return i[0]>n[0]?1:i[0]n[1]?1:-1:j(t,e,i)}function j(t,e,i,n){return t.left!==e.left?t.left?1:-1:0!==$(i,t.otherEvent.point,e.otherEvent.point)?t.isBelow(e.otherEvent.point)?-1:1:!t.isSubject&&e.isSubject?1:-1}function N(t,e,i){var n=new v(e,!1,t,t.isSubject),r=new v(e,!0,t.otherEvent,t.isSubject);return _(t.point,t.otherEvent.point)&&console.warn("what is that, a collapsed segment?",t),n.contourId=r.contourId=t.contourId,D(r,t.otherEvent)>0&&(t.otherEvent.left=!0,r.left=!1),t.otherEvent.otherEvent=r,t.otherEvent=n,i.push(r),i.push(n),i}function B(t,e){return t[0]*e[1]-t[1]*e[0]}function U(t,e){return t[0]*e[0]+t[1]*e[1]}function z(t,e,i,n,r){var o=[e[0]-t[0],e[1]-t[1]],s=[n[0]-i[0],n[1]-i[1]];function a(t,e,i){return[t[0]+e*i[0],t[1]+e*i[1]]}var l=[i[0]-t[0],i[1]-t[1]],u=B(o,s),h=u*u,c=U(o,o);if(h>0){var d=B(l,s)/u;if(d<0||d>1)return null;var f=B(l,o)/u;return f<0||f>1?null:0===d||1===d?r?null:[a(t,d,o)]:0===f||1===f?r?null:[a(i,f,s)]:[a(t,d,o)]}if((h=(u=B(l,o))*u)>0)return null;var p=U(o,l)/c,g=p+U(o,s)/c,m=Math.min(p,g),v=Math.max(p,g);return m<=1&&v>=0?1===m?r?null:[a(t,m>0?m:0,o)]:0===v?r?null:[a(t,v<1?v:1,o)]:r&&0===m&&1===v?null:[a(t,m>0?m:0,o),a(t,v<1?v:1,o)]:null}function V(t,e,i){var n=z(t.point,t.otherEvent.point,e.point,e.otherEvent.point),r=n?n.length:0;if(0===r)return 0;if(1===r&&(_(t.point,e.point)||_(t.otherEvent.point,e.otherEvent.point)))return 0;if(2===r&&t.isSubject===e.isSubject)return 0;if(1===r)return _(t.point,n[0])||_(t.otherEvent.point,n[0])||N(t,n[0],i),_(e.point,n[0])||_(e.otherEvent.point,n[0])||N(e,n[0],i),1;var o=[],s=!1,h=!1;return _(t.point,e.point)?s=!0:1===D(t,e)?o.push(e,t):o.push(t,e),_(t.otherEvent.point,e.otherEvent.point)?h=!0:1===D(t.otherEvent,e.otherEvent)?o.push(e.otherEvent,t.otherEvent):o.push(t.otherEvent,e.otherEvent),s&&h||s?(e.type=a,t.type=e.inOut===t.inOut?l:u,s&&!h&&N(o[1].otherEvent,o[0].point,i),2):h?(N(o[0],o[1].point,i),3):o[0]!==o[3].otherEvent?(N(o[0],o[1].point,i),N(o[1],o[2].point,i),3):(N(o[0],o[1].point,i),N(o[3].otherEvent,o[2].point,i),3)}function G(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 _(t.point,e.point)?t.isBelow(e.otherEvent.point)?-1:1:t.point[0]===e.point[0]?t.point[1]e.contourId?1:-1):1===D(t,e)?1:-1}function q(t,e,n,r,o,s){for(var a,l,u,c=new i(G),f=[],g=Math.min(r[2],o[2]);0!==t.length;){var m=t.pop();if(f.push(m),s===h&&m.point[0]>g||s===d&&m.point[0]>r[2])break;if(m.left){l=a=c.insert(m),a=a!==(u=c.minNode())?c.prev(a):null,l=c.next(l);var v=a?a.key:null;if(p(m,v,s),l&&2===V(m,l.key,t)&&(p(m,v,s),p(m,l.key,s)),a&&2===V(a.key,m,t)){var y=a;p(v,(y=y!==u?c.prev(y):null)?y.key:null,s),p(m,v,s)}}else m=m.otherEvent,l=a=c.find(m),a&&l&&(a=a!==u?c.prev(a):null,l=c.next(l),c.remove(m),l&&a&&V(a.key,l.key,t))}return f}var W=function(){this.points=[],this.holeIds=[],this.holeOf=null,this.depth=null};function K(t){var e,i,n,r,o=[];for(i=0,n=t.length;in;)o--;return o}function Y(t,e,i){var n=new W;if(null!=t.prevInResult){var r=t.prevInResult,o=r.outputContourId;if(r.resultTransition>0){var s=e[o];if(null!=s.holeOf){var a=s.holeOf;e[a].holeIds.push(i),n.holeOf=a,n.depth=e[o].depth}else e[o].holeIds.push(i),n.holeOf=o,n.depth=e[o].depth+1}else n.holeOf=null,n.depth=e[o].depth}else n.holeOf=null,n.depth=0;return n}function H(t){var e,i,n=K(t),r={},o=[],s=function(){if(!r[e]){var t=o.length,i=Y(n[e],o,t),s=function(e){r[e]=!0,n[e].outputContourId=t},a=e,l=e,u=n[e].point;for(i.points.push(u);s(a),s(a=n[a].otherPos),i.points.push(n[a].point),(a=X(a,n,r,l))!=l;);o.push(i)}};for(e=0,i=n.length;e0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)}function tt(t,e){return te?1:0}Q.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--,this.length>0&&(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,i=this.compare,n=e[t];t>0;){var r=t-1>>1,o=e[r];if(i(n,o)>=0)break;e[t]=o,t=r}e[t]=n},_down:function(t){for(var e=this.data,i=this.compare,n=this.length>>1,r=e[t];t=0)break;e[t]=a,t=o}e[t]=r}},Z.default=J;var et=Math.max,it=Math.min,nt=0;function rt(t,e,i,n,r,o){var s,a,l,u,h,c;for(s=0,a=t.length-1;s0?c.left=!0:h.left=!0;var d=l[0],f=l[1];r[0]=it(r[0],d),r[1]=it(r[1],f),r[2]=et(r[2],d),r[3]=et(r[3],f),n.push(h),n.push(c)}}function ot(t,e,i,n,r){var o,s,a,l,u,h,c=new Z(null,D);for(a=0,l=t.length;an[2]||n[0]>i[2]||i[1]>n[3]||n[1]>i[3])&&(r===h?o=st:r===d?o=t:r!==c&&r!==f||(o=t.concat(e))),o}function ut(t,e,i){"number"==typeof t[0][0][0]&&(t=[t]),"number"==typeof e[0][0][0]&&(e=[e]);var n=at(t,e,i);if(n)return n===st?null:n;var r=[1/0,1/0,-1/0,-1/0],o=[1/0,1/0,-1/0,-1/0],s=ot(t,e,r,o,i);if(n=lt(t,e,r,o,i))return n===st?null:n;for(var a=H(q(s,t,e,r,o,i)),l=[],u=0;u{},244:t=>{"use strict";var e=function(t){return t!=t};t.exports=function(t,i){return 0===t&&0===i?1/t==1/i:t===i||!(!e(t)||!e(i))}},609:(t,e,i)=>{"use strict";var n=i(289),r=i(559),o=i(244),s=i(624),a=i(281),l=r(s(),Object);n(l,{getPolyfill:s,implementation:o,shim:a}),t.exports=l},624:(t,e,i)=>{"use strict";var n=i(244);t.exports=function(){return"function"==typeof Object.is?Object.is:n}},281:(t,e,i)=>{"use strict";var n=i(624),r=i(289);t.exports=function(){var t=n();return r(Object,{is:t},{is:function(){return Object.is!==t}}),t}},987:(t,e,i)=>{"use strict";var n;if(!Object.keys){var r=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=i(414),a=Object.prototype.propertyIsEnumerable,l=!a.call({toString:null},"toString"),u=a.call((function(){}),"prototype"),h=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(t){var e=t.constructor;return e&&e.prototype===t},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!d["$"+t]&&r.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{c(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,i="[object Function]"===o.call(t),n=s(t),a=e&&"[object String]"===o.call(t),d=[];if(!e&&!i&&!n)throw new TypeError("Object.keys called on a non-object");var p=u&&i;if(a&&t.length>0&&!r.call(t,0))for(var g=0;g0)for(var m=0;m{"use strict";var n=Array.prototype.slice,r=i(414),o=Object.keys,s=o?function(t){return o(t)}:i(987),a=Object.keys;s.shim=function(){Object.keys?function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2)||(Object.keys=function(t){return r(t)?a(n.call(t)):a(t)}):Object.keys=s;return Object.keys||s},t.exports=s},414:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var i=e.call(t),n="[object Arguments]"===i;return n||(n="[object Array]"!==i&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},676:function(t,e,i){var n=i(155);t.exports=function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var i=0;ie?1:t0))break;if(null===e.right)break;if(i(t,e.right.key)>0&&(l=e.right,e.right=l.left,l.left=e,null===(e=l).right))break;o.right=e,o=e,e=e.right}}return o.right=e.left,s.left=e.right,e.left=n.right,e.right=n.left,e}function a(t,e,i,n){var o=new r(t,e);if(null===i)return o.left=o.right=null,o;var a=n(t,(i=s(t,i,n)).key);return a<0?(o.left=i.left,o.right=i,i.left=null):a>=0&&(o.right=i.right,o.left=i,i.right=null),o}function l(t,e,i){var n=null,r=null;if(e){var o=i((e=s(t,e,i)).key,t);0===o?(n=e.left,r=e.right):o<0?(r=e.right,e.right=null,n=e):(n=e.left,e.left=null,r=e)}return{left:n,right:r}}function u(t,e,i){return null===e?t:(null===t||((e=s(t.key,e,i)).left=t),e)}function h(t,e,i,n,r){if(t){n(e+(i?"└── ":"├── ")+r(t)+"\n");var o=e+(i?" ":"│ ");t.left&&h(t.left,o,!1,n,r),t.right&&h(t.right,o,!0,n,r)}}var c=function(){function t(t){void 0===t&&(t=o),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=a(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var i=new r(t,e);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var n=this._comparator,o=s(t,this._root,n),a=n(t,o.key);return 0===a?this._root=o:(a<0?(i.left=o.left,i.right=o,o.left=null):a>0&&(i.right=o.right,i.left=o,o.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,i){var n;return null===e?null:0===i(t,(e=s(t,e,i)).key)?(null===e.left?n=e.right:(n=s(t,e.left,i)).right=e.right,this._size--,n):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=s(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,i=this._comparator;e;){var n=i(t,e.key);if(0===n)return e;e=n<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=s(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,i=this._comparator;e;){var n=i(t,e.key);if(0===n)return!0;e=n<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var i=this._root,n=[],r=!1;!r;)null!==i?(n.push(i),i=i.left):0!==n.length?(i=n.pop(),t.call(e,i),i=i.right):r=!0;return this},t.prototype.range=function(t,e,i,n){for(var r=[],o=this._comparator,s=this._root;0!==r.length||s;)if(s)r.push(s),s=s.left;else{if(o((s=r.pop()).key,e)>0)break;if(o(s.key,t)>=0&&i.call(n,s))return this;s=s.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var i=e.key;return t.push(i)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var i=e.data;return t.push(i)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,i=!1,n=0,r=[];!i;)if(e)r.push(e),e=e.left;else if(r.length>0){if(e=r.pop(),n===t)return e;n++,e=e.right}else i=!0;return null},t.prototype.next=function(t){var e=this._root,i=null;if(t.right){for(i=t.right;i.left;)i=i.left;return i}for(var n=this._comparator;e;){var r=n(t.key,e.key);if(0===r)break;r<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(t){var e=this._root,i=null;if(null!==t.left){for(i=t.left;i.right;)i=i.right;return i}for(var n=this._comparator;e;){var r=n(t.key,e.key);if(0===r)break;r<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return p(this._root)},t.prototype.load=function(t,e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var n=t.length,r=this._comparator;if(i&&v(t,e,0,n-1,r),null===this._root)this._root=d(t,e,0,n),this._size=n;else{var o=m(this.toList(),f(t,e),r);n=this._size+n,this._root=g({head:o},0,n)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return h(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,i){var n=this._comparator,r=l(t,this._root,n),o=r.left,s=r.right;n(t,e)<0?s=a(e,i,s,n):o=a(e,i,o,n),this._root=u(o,s,n)},t.prototype.split=function(t){return l(t,this._root,this._comparator)},t}();function d(t,e,i,n){var o=n-i;if(o>0){var s=i+Math.floor(o/2),a=t[s],l=e[s],u=new r(a,l);return u.left=d(t,e,i,s),u.right=d(t,e,s+1,n),u}return null}function f(t,e){for(var i=new r(null,null),n=i,o=0;o0?e=(e=s=s.next=i.pop()).right:n=!0;return s.next=null,o.next}function g(t,e,i){var n=i-e;if(n>0){var r=e+Math.floor(n/2),o=g(t,e,r),s=t.head;return s.left=o,t.head=t.head.next,s.right=g(t,r+1,i),s}return null}function m(t,e,i){for(var n=new r(null,null),o=n,s=t,a=e;null!==s&&null!==a;)i(s.key,a.key)<0?(o.next=s,s=s.next):(o.next=a,a=a.next),o=o.next;return null!==s?o.next=s:null!==a&&(o.next=a),n.next}function v(t,e,i,n,r){if(!(i>=n)){for(var o=t[i+n>>1],s=i-1,a=n+1;;){do{s++}while(r(t[s],o)<0);do{a--}while(r(t[a],o)>0);if(s>=a)break;var l=t[s];t[s]=t[a],t[a]=l,l=e[s],e[s]=e[a],e[a]=l}v(t,e,i,a,r),v(t,e,a+1,n,r)}}var y=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},_=function(t,e){if(e.ur.xe.x?1:t.ye.y?1:0}}]),i(e,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,i=0,n=e.length;i=0&&l>=0?su?-1:0:o<0&&l<0?su?1:0:lo?1:0}}}]),e}(),$=0,D=function(){function e(i,n,r,o){t(this,e),this.id=++$,this.leftSE=i,i.segment=this,i.otherSE=n,this.rightSE=n,n.segment=this,n.otherSE=i,this.rings=r,this.windings=o}return i(e,null,[{key:"compare",value:function(t,e){var i=t.leftSE.point.x,n=e.leftSE.point.x,r=t.rightSE.point.x,o=e.rightSE.point.x;if(os&&a>l)return-1;var h=t.comparePoint(e.leftSE.point);if(h<0)return 1;if(h>0)return-1;var c=e.comparePoint(t.rightSE.point);return 0!==c?c:-1}if(i>n){if(sa&&s>u)return 1;var d=e.comparePoint(t.leftSE.point);if(0!==d)return d;var f=t.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(sa)return 1;if(ro){var g=t.comparePoint(e.rightSE.point);if(g<0)return 1;if(g>0)return-1}if(r!==o){var m=l-s,v=r-i,y=u-a,_=o-n;if(m>v&&y<_)return 1;if(m_)return-1}return r>o?1:ru?1:t.ide.id?1:0}}]),i(e,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:te?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,i=this.rightSE.point,n=this.vector();if(e.x===i.x)return t.x===e.x?0:t.x0&&a.swapEvents(),O.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),o.checkForConsuming()),i}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,i=this.windings.length;e0){var o=i;i=n,n=o}if(i.prev===n){var s=i;i=n,n=s}for(var a=0,l=n.rings.length;a0))throw new Error("Tried to create degenerate segment at [".concat(t.x,", ").concat(t.y,"]"));r=i,o=t,s=-1}return new e(new O(r,!0),new O(o,!1),[n],[s])}}]),e}(),j=function(){function e(i,n,r){if(t(this,e),!Array.isArray(i)||0===i.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=n,this.isExterior=r,this.segments=[],"number"!=typeof i[0][0]||"number"!=typeof i[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var o=T.round(i[0][0],i[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};for(var s=o,a=1,l=i.length;athis.bbox.ur.x&&(this.bbox.ur.x=u.x),u.y>this.bbox.ur.y&&(this.bbox.ur.y=u.y),s=u)}o.x===s.x&&o.y===s.y||this.segments.push(D.fromRing(s,o,this))}return i(e,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.segments.length;ethis.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=n}return i(e,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,i=this.interiorRings.length;ethis.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=n}return i(e,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.polys.length;e0&&(t=n)}for(var r=t.segment.prevInResult(),o=r?r.prevInResult():null;;){if(!r)return null;if(!o)return r.ringOut;if(o.ringOut!==r.ringOut)return o.ringOut.enclosingRing()!==r.ringOut?r.ringOut:r.ringOut.enclosingRing();r=o.prevInResult(),o=r?r.prevInResult():null}}}]),e}(),z=function(){function e(i){t(this,e),this.exteriorRing=i,i.poly=this,this.interiorRings=[]}return i(e,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,i=this.interiorRings.length;e1&&void 0!==arguments[1]?arguments[1]:D.compare;t(this,e),this.queue=i,this.tree=new c(n),this.segments=[]}return i(e,[{key:"process",value:function(t){var e=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),i;var n=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!n)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var r=n,o=n,s=void 0,a=void 0;void 0===s;)null===(r=this.tree.prev(r))?s=null:void 0===r.key.consumedBy&&(s=r.key);for(;void 0===a;)null===(o=this.tree.next(o))?a=null:void 0===o.key.consumedBy&&(a=o.key);if(t.isLeft){var l=null;if(s){var u=s.getIntersection(e);if(null!==u&&(e.isAnEndpoint(u)||(l=u),!s.isAnEndpoint(u)))for(var h=this._splitSafely(s,u),c=0,d=h.length;c0?(this.tree.remove(e),i.push(t)):(this.segments.push(e),e.prev=s)}else{if(s&&a){var x=s.getIntersection(a);if(null!==x){if(!s.isAnEndpoint(x))for(var S=this._splitSafely(s,x),C=0,T=S.length;Cq)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var w=new G(p),x=p.size,S=p.pop();S;){var C=S.key;if(p.size===x){var E=C.segment;throw new Error("Unable to pop() ".concat(C.isLeft?"left":"right"," SweepEvent ")+"[".concat(C.point.x,", ").concat(C.point.y,"] from segment #").concat(E.id," ")+"[".concat(E.leftSE.point.x,", ").concat(E.leftSE.point.y,"] -> ")+"[".concat(E.rightSE.point.x,", ").concat(E.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(p.size>q)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(w.segments.length>W)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var I=w.process(C),A=0,P=I.length;A1?e-1:0),n=1;n1?e-1:0),n=1;n1?e-1:0),n=1;n1?e-1:0),n=1;n{var e,i,n=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===r||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(i){try{return e.call(null,t,0)}catch(i){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:r}catch(t){e=r}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(t){i=o}}();var a,l=[],u=!1,h=-1;function c(){u&&a&&(u=!1,a.length?l=a.concat(l):h=-1,l.length&&d())}function d(){if(!u){var t=s(c);u=!0;for(var e=l.length;e;){for(a=l,l=[];++h1)for(var i=1;ir;){if(o-r>600){var a=o-r+1,l=n-r+1,u=Math.log(a),h=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*h*(a-h)/a)*(l-a/2<0?-1:1);e(t,n,Math.max(r,Math.floor(n-l*h/a+c)),Math.min(o,Math.floor(n+(a-l)*h/a+c)),s)}var d=t[n],f=r,p=o;for(i(t,r,n),s(t[o],d)>0&&i(t,r,o);f0;)p--}0===s(t[r],d)?i(t,r,p):i(t,++p,o),p<=n&&(r=p+1),n<=p&&(o=p-1)}}function i(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function n(t,e){return te?1:0}return t}()},510:(t,e,i)=>{"use strict";t.exports=r,t.exports.default=r;var n=i(166);function r(t,e){if(!(this instanceof r))return new r(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function o(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(t,e,i,r,o){for(var s,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=r||(s=e+Math.ceil((i-e)/r/2)*r,n(t,s,e,i,o),a.push(e,s,s,i))}r.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!p(t,e))return i;for(var r,o,s,a,l=[];e;){for(r=0,o=e.children.length;r=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(r,o,e)},_split:function(t,e){var i=t[e],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);var o=this._chooseSplitIndex(i,r,n),a=g(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,s(i,this.toBBox),s(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,r,o,s,l,u,h,d,f,p,g,m,v,y;for(u=h=1/0,n=e;n<=i-e;n++)r=a(t,0,n,this.toBBox),o=a(t,n,i,this.toBBox),f=r,p=o,g=void 0,m=void 0,v=void 0,y=void 0,g=Math.max(f.minX,p.minX),m=Math.max(f.minY,p.minY),v=Math.min(f.maxX,p.maxX),y=Math.min(f.maxY,p.maxY),s=Math.max(0,v-g)*Math.max(0,y-m),l=c(r)+c(o),s=e;r--)o=t.children[r],l(h,t.leaf?s(o):o),c+=d(h);return c},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)l(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():s(t[i],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},697:t=>{"use strict";var e=Object,i=TypeError;t.exports=function(){if(null!=this&&this!==e(this))throw new i("RegExp.prototype.flags getter called on non-object");var t="";return this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.sticky&&(t+="y"),t}},847:(t,e,i)=>{"use strict";var n=i(289),r=i(559),o=i(697),s=i(721),a=i(753),l=r(o);n(l,{getPolyfill:s,implementation:o,shim:a}),t.exports=l},721:(t,e,i)=>{"use strict";var n=i(697),r=i(289).supportsDescriptors,o=Object.getOwnPropertyDescriptor,s=TypeError;t.exports=function(){if(!r)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");if("gim"===/a/gim.flags){var t=o(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof/a/.dotAll)return t.get}return n}},753:(t,e,i)=>{"use strict";var n=i(289).supportsDescriptors,r=i(721),o=Object.getOwnPropertyDescriptor,s=Object.defineProperty,a=TypeError,l=Object.getPrototypeOf,u=/a/;t.exports=function(){if(!n||!l)throw new a("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=r(),e=l(u),i=o(e,"flags");return i&&i.get===t||s(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},576:(t,e,i)=>{var n=i(442);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,i(346).Z)("69d77a46",n,!0,{})},346:(t,e,i)=>{"use strict";function n(t,e){for(var i=[],n={},r=0;rp});var r="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!r)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var o={},s=r&&(document.head||document.getElementsByTagName("head")[0]),a=null,l=0,u=!1,h=function(){},c=null,d="data-vue-ssr-id",f="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function p(t,e,i,r){u=i,c=r||{};var s=n(t,e);return g(s),function(e){for(var i=[],r=0;ri.parts.length&&(n.parts.length=i.parts.length)}else{var s=[];for(r=0;r{}},i={};function n(t){var r=i[t];if(void 0!==r)return r.exports;var o=i[t]={id:t,loaded:!1,exports:{}};return e[t].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.m=e,t=[],n.O=(e,i,r,o)=>{if(!i){var s=1/0;for(u=0;u=o)&&Object.keys(n.O).every((t=>n.O[t](i[l])))?i.splice(l--,1):(a=!1,o0&&t[u-1][2]>o;u--)t[u]=t[u-1];t[u]=[i,r,o]},n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{var t={355:0,392:0};n.O.j=e=>0===t[e];var e=(e,i)=>{var r,o,[s,a,l]=i,u=0;for(r in a)n.o(a,r)&&(n.m[r]=a[r]);for(l&&l(n),e&&e(i);un(994)));var r=n.O(void 0,[392],(()=>n(798)));r=n.O(r)})(); \ No newline at end of file +(()=>{var t,e={70:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(540),r=6378137;function o(t){var e=0;if(t&&t.length>0){e+=Math.abs(s(t[0]));for(var i=1;i2){for(l=0;l{"use strict";var n=i(540);function r(t){var e=[1/0,1/0,-1/0,-1/0];return n.coordEach(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]{"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var r=n(i(209)),o=n(i(70)),s=i(102),a=i(611),l=i(540);function u(t){switch(t.type){case"Polygon":return o(t)>1?t:null;case"MultiPolygon":var e=[];if(l.flattenEach(t,(function(t){o(t)>1&&e.push(t.geometry.coordinates)})),e.length)return{type:"MultiPolygon",coordinates:e}}}t.exports=function(t,e){var i=a.getGeom(t),n=a.getGeom(e),o=t.properties||{};if(i=u(i),n=u(n),!i)return null;if(!n)return s.feature(i,o);var l=r.diff(i.coordinates,n.coordinates);return 0===l.length?null:1===l.length?s.polygon(l[0],o):s.multiPolygon(l,o)}},102:(t,e)=>{"use strict";function i(t,e,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=e||{},n.geometry=t,n}function n(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!f(t[0])||!f(t[1]))throw new Error("coordinates must contain numbers");return i({type:"Point",coordinates:t},e,n)}function r(t,e,n){void 0===n&&(n={});for(var r=0,o=t;r=0))throw new Error("precision must be a positive number");var i=Math.pow(10,e||0);return Math.round(t*i)/i},e.radiansToLength=h,e.lengthToRadians=c,e.lengthToDegrees=function(t,e){return d(c(t,e))},e.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},e.radiansToDegrees=d,e.degreesToRadians=function(t){return t%360*Math.PI/180},e.convertLength=function(t,e,i){if(void 0===e&&(e="kilometers"),void 0===i&&(i="kilometers"),!(t>=0))throw new Error("length must be a positive number");return h(c(t,e),i)},e.convertArea=function(t,i,n){if(void 0===i&&(i="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var r=e.areaFactors[i];if(!r)throw new Error("invalid original units");var o=e.areaFactors[n];if(!o)throw new Error("invalid final units");return t/r*o},e.isNumber=f,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(!f(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")}},611:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(102);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)&&t.length>=2&&!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(e.length>1&&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,i){if(!e||!i)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+i+": must be a "+e+", given "+t.type)},e.featureOf=function(t,e,i){if(!t)throw new Error("No feature passed");if(!i)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+i+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+i+": must be a "+e+", given "+t.geometry.type)},e.collectionOf=function(t,e,i){if(!t)throw new Error("No featureCollection passed");if(!i)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+i+", FeatureCollection required");for(var n=0,r=t.features;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(102);function r(t,e,i){if(null!==t)for(var n,o,s,a,l,u,h,c,d=0,f=0,p=t.type,g="FeatureCollection"===p,m="Feature"===p,v=g?t.features.length:1,y=0;yu||f>h||p>c)return l=r,u=i,h=f,c=p,void(s=0);var g=n.lineString([l,r],t.properties);if(!1===e(g,i,o,p,s))return!1;s++,l=r}))&&void 0}}}))}function h(t,e){if(!t)throw new Error("geojson is required");l(t,(function(t,i,r){if(null!==t.geometry){var o=t.geometry.type,s=t.geometry.coordinates;switch(o){case"LineString":if(!1===e(t,i,r,0,0))return!1;break;case"Polygon":for(var a=0;a{var e=function(){var t={};function e(t,e){return new P(null,t+" uniform sampler2D texture; uniform vec2 texSize; varying vec2 texCoord; void main() { vec2 coord = texCoord * texSize; "+e+" gl_FragColor = texture2D(texture, coord / texSize); vec2 clampedCoord = clamp(coord, vec2(0.0), texSize); if (coord != clampedCoord) { /* fade to transparent if we are outside the image */ gl_FragColor.a *= max(0.0, 1.0 - length(coord - clampedCoord)); } }")}var i=" float random(vec3 scale, float seed) { /* use the fragment position for a different seed per-pixel */ return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed); }";function n(t,e){return A.brightnessContrast=A.brightnessContrast||new P(null," uniform sampler2D texture; uniform float brightness; uniform float contrast; varying vec2 texCoord; void main() { vec4 color = texture2D(texture, texCoord); color.rgb += brightness; if (contrast > 0.0) { color.rgb = (color.rgb - 0.5) / (1.0 - contrast) + 0.5; } else { color.rgb = (color.rgb - 0.5) * (1.0 + contrast) + 0.5; } gl_FragColor = color; } "),$.call(this,A.brightnessContrast,{brightness:k(-1,t,1),contrast:k(-1,e,1)}),this}function r(t){return A.gamma=A.gamma||new P(null," uniform sampler2D texture; uniform float gamma; varying vec2 texCoord; void main() { vec4 color = texture2D(texture, texCoord); color.rgb = pow(color.rgb, vec3(gamma)); gl_FragColor = color; } "),$.call(this,A.gamma,{gamma:k(0,t,5)}),this}function o(t){return A.vibrance=A.vibrance||new P(null," uniform sampler2D texture; uniform float amount; varying vec2 texCoord; void main() { vec4 color = texture2D(texture, texCoord); float average = (color.r + color.g + color.b) / 3.0; float mx = max(color.r, max(color.g, color.b)); float amt = (mx - average) * (-amount * 3.0); color.rgb = mix(color.rgb, vec3(mx), amt); gl_FragColor = color; } "),$.call(this,A.vibrance,{amount:k(-1,t,1)}),this}function s(t){for(var e=new V(t),i=[],n=0;n<256;n++)i.push(k(0,Math.floor(256*e.interpolate(n/255)),255));return i}function a(t,e,i){t=s(t),1==arguments.length?e=i=t:(e=s(e),i=s(i));for(var n=[],r=0;r<256;r++)n.splice(n.length,0,t[r],e[r],i[r],255);return this._.extraTexture.initFromBytes(256,1,n),this._.extraTexture.use(1),A.curves=A.curves||new P(null," uniform sampler2D texture; uniform sampler2D map; varying vec2 texCoord; void main() { vec4 color = texture2D(texture, texCoord); color.r = texture2D(map, vec2(color.r)).r; color.g = texture2D(map, vec2(color.g)).g; color.b = texture2D(map, vec2(color.b)).b; gl_FragColor = color; } "),A.curves.textures({map:1}),$.call(this,A.curves,{}),this}function l(t,e,i){return A.brightnessRGB=A.brightnessRGB||new P(null," uniform sampler2D texture; uniform float r; uniform float g; uniform float b; varying vec2 texCoord; void main() { vec4 color = texture2D(texture, texCoord); color.r += r; color.g += g; color.b += b; gl_FragColor = color; } "),$.call(this,A.brightnessRGB,{r:k(-1,t,1),g:k(-1,e,1),b:k(-1,i,1)}),this}function u(t,e){return A.vignette=A.vignette||new P(null," uniform sampler2D texture; uniform float size; uniform float amount; varying vec2 texCoord; void main() { vec4 color = texture2D(texture, texCoord); float dist = distance(texCoord, vec2(0.5, 0.5)); color.rgb *= smoothstep(0.8, size * 0.799, dist * (amount + size)); gl_FragColor = color; } "),$.call(this,A.vignette,{size:k(0,t,1),amount:k(0,e,1)}),this}function h(t){return A.noise=A.noise||new P(null," uniform sampler2D texture; uniform float amount; varying vec2 texCoord; float rand(vec2 co) { return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); } void main() { vec4 color = texture2D(texture, texCoord); float diff = (rand(texCoord) - 0.5) * amount; color.r += diff; color.g += diff; color.b += diff; gl_FragColor = color; } "),$.call(this,A.noise,{amount:k(0,t,1)}),this}function c(t){A.denoise=A.denoise||new P(null," uniform sampler2D texture; uniform float exponent; uniform float strength; uniform vec2 texSize; varying vec2 texCoord; void main() { vec4 center = texture2D(texture, texCoord); vec4 color = vec4(0.0); float total = 0.0; for (float x = -4.0; x <= 4.0; x += 1.0) { for (float y = -4.0; y <= 4.0; y += 1.0) { vec4 sample = texture2D(texture, texCoord + vec2(x, y) / texSize); float weight = 1.0 - abs(dot(sample.rgb - center.rgb, vec3(0.25))); weight = pow(weight, exponent); color += sample * weight; total += weight; } } gl_FragColor = color / total; } ");for(var e=0;e<2;e++)$.call(this,A.denoise,{exponent:Math.max(0,t),texSize:[this.width,this.height]});return this}function d(t){return A.sepia=A.sepia||new P(null," uniform sampler2D texture; uniform float amount; varying vec2 texCoord; void main() { vec4 color = texture2D(texture, texCoord); float r = color.r; float g = color.g; float b = color.b; color.r = min(1.0, (r * (1.0 - (0.607 * amount))) + (g * (0.769 * amount)) + (b * (0.189 * amount))); color.g = min(1.0, (r * 0.349 * amount) + (g * (1.0 - (0.314 * amount))) + (b * 0.168 * amount)); color.b = min(1.0, (r * 0.272 * amount) + (g * 0.534 * amount) + (b * (1.0 - (0.869 * amount)))); gl_FragColor = color; } "),$.call(this,A.sepia,{amount:k(0,t,1)}),this}function f(t,e){return A.unsharpMask=A.unsharpMask||new P(null," uniform sampler2D blurredTexture; uniform sampler2D originalTexture; uniform float strength; uniform float threshold; varying vec2 texCoord; void main() { vec4 blurred = texture2D(blurredTexture, texCoord); vec4 original = texture2D(originalTexture, texCoord); gl_FragColor = mix(blurred, original, 1.0 + strength); } "),this._.extraTexture.ensureFormat(this._.texture),this._.texture.use(),this._.extraTexture.drawTo((function(){P.getDefaultShader().drawRect()})),this._.extraTexture.use(1),this.triangleBlur(t),A.unsharpMask.textures({originalTexture:1}),$.call(this,A.unsharpMask,{strength:e}),this._.extraTexture.unuse(1),this}function p(t,e){return A.hueSaturation=A.hueSaturation||new P(null," uniform sampler2D texture; uniform float hue; uniform float saturation; varying vec2 texCoord; void main() { vec4 color = texture2D(texture, texCoord); /* hue adjustment, wolfram alpha: RotationTransform[angle, {1, 1, 1}][{x, y, z}] */ float angle = hue * 3.14159265; float s = sin(angle), c = cos(angle); vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0; float len = length(color.rgb); color.rgb = vec3( dot(color.rgb, weights.xyz), dot(color.rgb, weights.zxy), dot(color.rgb, weights.yzx) ); /* saturation adjustment */ float average = (color.r + color.g + color.b) / 3.0; if (saturation > 0.0) { color.rgb += (average - color.rgb) * (1.0 - 1.0 / (1.001 - saturation)); } else { color.rgb += (average - color.rgb) * (-saturation); } gl_FragColor = color; } "),$.call(this,A.hueSaturation,{hue:k(-1,t,1),saturation:k(-1,e,1)}),this}function g(t,i,n,r){return A.swirl=A.swirl||e(" uniform float radius; uniform float angle; uniform vec2 center; "," coord -= center; float distance = length(coord); if (distance < radius) { float percent = (radius - distance) / radius; float theta = percent * percent * angle; float s = sin(theta); float c = cos(theta); coord = vec2( coord.x * c - coord.y * s, coord.x * s + coord.y * c ); } coord += center; "),$.call(this,A.swirl,{radius:n,center:[t,i],angle:r,texSize:[this.width,this.height]}),this}function m(t,e){var i=U.apply(null,e),n=U.apply(null,t),r=function(t,e){return[t[0]*e[0]+t[1]*e[3]+t[2]*e[6],t[0]*e[1]+t[1]*e[4]+t[2]*e[7],t[0]*e[2]+t[1]*e[5]+t[2]*e[8],t[3]*e[0]+t[4]*e[3]+t[5]*e[6],t[3]*e[1]+t[4]*e[4]+t[5]*e[7],t[3]*e[2]+t[4]*e[5]+t[5]*e[8],t[6]*e[0]+t[7]*e[3]+t[8]*e[6],t[6]*e[1]+t[7]*e[4]+t[8]*e[7],t[6]*e[2]+t[7]*e[5]+t[8]*e[8]]}(z(i),n);return this.matrixWarp(r)}function v(t,i,n,r){return A.bulgePinch=A.bulgePinch||e(" uniform float radius; uniform float strength; uniform vec2 center; "," coord -= center; float distance = length(coord); if (distance < radius) { float percent = distance / radius; if (strength > 0.0) { coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75); } else { coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent); } } coord += center; "),$.call(this,A.bulgePinch,{radius:n,strength:k(-1,r,1),center:[t,i],texSize:[this.width,this.height]}),this}function y(t,i,n){if(A.matrixWarp=A.matrixWarp||e(" uniform mat3 matrix; uniform bool useTextureSpace; "," if (useTextureSpace) coord = coord / texSize * 2.0 - 1.0; vec3 warp = matrix * vec3(coord, 1.0); coord = warp.xy / warp.z; if (useTextureSpace) coord = (coord * 0.5 + 0.5) * texSize; "),4==(t=Array.prototype.concat.apply([],t)).length)t=[t[0],t[1],0,t[2],t[3],0,0,0,1];else if(9!=t.length)throw"can only warp with 2x2 or 3x3 matrix";return $.call(this,A.matrixWarp,{matrix:i?z(t):t,texSize:[this.width,this.height],useTextureSpace:0|n}),this}function _(t,e,n){return A.zoomBlur=A.zoomBlur||new P(null," uniform sampler2D texture; uniform vec2 center; uniform float strength; uniform vec2 texSize; varying vec2 texCoord; "+i+" void main() { vec4 color = vec4(0.0); float total = 0.0; vec2 toCenter = center - texCoord * texSize; /* randomize the lookup values to hide the fixed number of samples */ float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0); for (float t = 0.0; t <= 40.0; t++) { float percent = (t + offset) / 40.0; float weight = 4.0 * (percent - percent * percent); vec4 sample = texture2D(texture, texCoord + toCenter * percent * strength / texSize); /* switch to pre-multiplied alpha to correctly blur transparent images */ sample.rgb *= sample.a; color += sample * weight; total += weight; } gl_FragColor = color / total; /* switch back from pre-multiplied alpha */ gl_FragColor.rgb /= gl_FragColor.a + 0.00001; } "),$.call(this,A.zoomBlur,{center:[t,e],strength:n,texSize:[this.width,this.height]}),this}function b(t,e,n,r,o,s){A.tiltShift=A.tiltShift||new P(null," uniform sampler2D texture; uniform float blurRadius; uniform float gradientRadius; uniform vec2 start; uniform vec2 end; uniform vec2 delta; uniform vec2 texSize; varying vec2 texCoord; "+i+" void main() { vec4 color = vec4(0.0); float total = 0.0; /* randomize the lookup values to hide the fixed number of samples */ float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0); vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x)); float radius = smoothstep(0.0, 1.0, abs(dot(texCoord * texSize - start, normal)) / gradientRadius) * blurRadius; for (float t = -30.0; t <= 30.0; t++) { float percent = (t + offset - 0.5) / 30.0; float weight = 1.0 - abs(percent); vec4 sample = texture2D(texture, texCoord + delta / texSize * percent * radius); /* switch to pre-multiplied alpha to correctly blur transparent images */ sample.rgb *= sample.a; color += sample * weight; total += weight; } gl_FragColor = color / total; /* switch back from pre-multiplied alpha */ gl_FragColor.rgb /= gl_FragColor.a + 0.00001; } ");var a=n-t,l=r-e,u=Math.sqrt(a*a+l*l);return $.call(this,A.tiltShift,{blurRadius:o,gradientRadius:s,start:[t,e],end:[n,r],delta:[a/u,l/u],texSize:[this.width,this.height]}),$.call(this,A.tiltShift,{blurRadius:o,gradientRadius:s,start:[t,e],end:[n,r],delta:[-l/u,a/u],texSize:[this.width,this.height]}),this}function w(t){return A.triangleBlur=A.triangleBlur||new P(null," uniform sampler2D texture; uniform vec2 delta; varying vec2 texCoord; "+i+" void main() { vec4 color = vec4(0.0); float total = 0.0; /* randomize the lookup values to hide the fixed number of samples */ float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0); for (float t = -30.0; t <= 30.0; t++) { float percent = (t + offset - 0.5) / 30.0; float weight = 1.0 - abs(percent); vec4 sample = texture2D(texture, texCoord + delta * percent); /* switch to pre-multiplied alpha to correctly blur transparent images */ sample.rgb *= sample.a; color += sample * weight; total += weight; } gl_FragColor = color / total; /* switch back from pre-multiplied alpha */ gl_FragColor.rgb /= gl_FragColor.a + 0.00001; } "),$.call(this,A.triangleBlur,{delta:[t/this.width,0]}),$.call(this,A.triangleBlur,{delta:[0,t/this.height]}),this}function x(t,e,n){A.lensBlurPrePass=A.lensBlurPrePass||new P(null," uniform sampler2D texture; uniform float power; varying vec2 texCoord; void main() { vec4 color = texture2D(texture, texCoord); color = pow(color, vec4(power)); gl_FragColor = vec4(color); } ");var r=" uniform sampler2D texture0; uniform sampler2D texture1; uniform vec2 delta0; uniform vec2 delta1; uniform float power; varying vec2 texCoord; "+i+" vec4 sample(vec2 delta) { /* randomize the lookup values to hide the fixed number of samples */ float offset = random(vec3(delta, 151.7182), 0.0); vec4 color = vec4(0.0); float total = 0.0; for (float t = 0.0; t <= 30.0; t++) { float percent = (t + offset) / 30.0; color += texture2D(texture0, texCoord + delta * percent); total += 1.0; } return color / total; } ";A.lensBlur0=A.lensBlur0||new P(null,r+" void main() { gl_FragColor = sample(delta0); } "),A.lensBlur1=A.lensBlur1||new P(null,r+" void main() { gl_FragColor = (sample(delta0) + sample(delta1)) * 0.5; } "),A.lensBlur2=A.lensBlur2||new P(null,r+" void main() { vec4 color = (sample(delta0) + 2.0 * texture2D(texture1, texCoord)) / 3.0; gl_FragColor = pow(color, vec4(power)); } ").textures({texture1:1});for(var o=[],s=0;s<3;s++){var a=n+s*Math.PI*2/3;o.push([t*Math.sin(a)/this.width,t*Math.cos(a)/this.height])}var l=Math.pow(10,k(-1,e,1));return $.call(this,A.lensBlurPrePass,{power:l}),this._.extraTexture.ensureFormat(this._.texture),$.call(this,A.lensBlur0,{delta0:o[0]},this._.texture,this._.extraTexture),$.call(this,A.lensBlur1,{delta0:o[1],delta1:o[2]},this._.extraTexture,this._.extraTexture),$.call(this,A.lensBlur0,{delta0:o[1]}),this._.extraTexture.use(1),$.call(this,A.lensBlur2,{power:1/l,delta0:o[2]}),this}function S(t){return A.edgeWork1=A.edgeWork1||new P(null," uniform sampler2D texture; uniform vec2 delta; varying vec2 texCoord; "+i+" void main() { vec2 color = vec2(0.0); vec2 total = vec2(0.0); /* randomize the lookup values to hide the fixed number of samples */ float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0); for (float t = -30.0; t <= 30.0; t++) { float percent = (t + offset - 0.5) / 30.0; float weight = 1.0 - abs(percent); vec3 sample = texture2D(texture, texCoord + delta * percent).rgb; float average = (sample.r + sample.g + sample.b) / 3.0; color.x += average * weight; total.x += weight; if (abs(t) < 15.0) { weight = weight * 2.0 - 1.0; color.y += average * weight; total.y += weight; } } gl_FragColor = vec4(color / total, 0.0, 1.0); } "),A.edgeWork2=A.edgeWork2||new P(null," uniform sampler2D texture; uniform vec2 delta; varying vec2 texCoord; "+i+" void main() { vec2 color = vec2(0.0); vec2 total = vec2(0.0); /* randomize the lookup values to hide the fixed number of samples */ float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0); for (float t = -30.0; t <= 30.0; t++) { float percent = (t + offset - 0.5) / 30.0; float weight = 1.0 - abs(percent); vec2 sample = texture2D(texture, texCoord + delta * percent).xy; color.x += sample.x * weight; total.x += weight; if (abs(t) < 15.0) { weight = weight * 2.0 - 1.0; color.y += sample.y * weight; total.y += weight; } } float c = clamp(10000.0 * (color.y / total.y - color.x / total.x) + 0.5, 0.0, 1.0); gl_FragColor = vec4(c, c, c, 1.0); } "),$.call(this,A.edgeWork1,{delta:[t/this.width,0]}),$.call(this,A.edgeWork2,{delta:[0,t/this.height]}),this}function C(t,e,i,n){return A.colorHalftone=A.colorHalftone||new P(null," uniform sampler2D texture; uniform vec2 center; uniform float angle; uniform float scale; uniform vec2 texSize; varying vec2 texCoord; float pattern(float angle) { float s = sin(angle), c = cos(angle); vec2 tex = texCoord * texSize - center; vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale; return (sin(point.x) * sin(point.y)) * 4.0; } void main() { vec4 color = texture2D(texture, texCoord); vec3 cmy = 1.0 - color.rgb; float k = min(cmy.x, min(cmy.y, cmy.z)); cmy = (cmy - k) / (1.0 - k); cmy = clamp(cmy * 10.0 - 3.0 + vec3(pattern(angle + 0.26179), pattern(angle + 1.30899), pattern(angle)), 0.0, 1.0); k = clamp(k * 10.0 - 5.0 + pattern(angle + 0.78539), 0.0, 1.0); gl_FragColor = vec4(1.0 - cmy - k, color.a); } "),$.call(this,A.colorHalftone,{center:[t,e],angle:i,scale:Math.PI/n,texSize:[this.width,this.height]}),this}function T(t,e,i){return A.hexagonalPixelate=A.hexagonalPixelate||new P(null," uniform sampler2D texture; uniform vec2 center; uniform float scale; uniform vec2 texSize; varying vec2 texCoord; void main() { vec2 tex = (texCoord * texSize - center) / scale; tex.y /= 0.866025404; tex.x -= tex.y * 0.5; vec2 a; if (tex.x + tex.y - floor(tex.x) - floor(tex.y) < 1.0) a = vec2(floor(tex.x), floor(tex.y)); else a = vec2(ceil(tex.x), ceil(tex.y)); vec2 b = vec2(ceil(tex.x), floor(tex.y)); vec2 c = vec2(floor(tex.x), ceil(tex.y)); vec3 TEX = vec3(tex.x, tex.y, 1.0 - tex.x - tex.y); vec3 A = vec3(a.x, a.y, 1.0 - a.x - a.y); vec3 B = vec3(b.x, b.y, 1.0 - b.x - b.y); vec3 C = vec3(c.x, c.y, 1.0 - c.x - c.y); float alen = length(TEX - A); float blen = length(TEX - B); float clen = length(TEX - C); vec2 choice; if (alen < blen) { if (alen < clen) choice = a; else choice = c; } else { if (blen < clen) choice = b; else choice = c; } choice.x += choice.y * 0.5; choice.y *= 0.866025404; choice *= scale / texSize; gl_FragColor = texture2D(texture, choice + center / texSize); } "),$.call(this,A.hexagonalPixelate,{center:[t,e],scale:i,texSize:[this.width,this.height]}),this}function E(t){return A.ink=A.ink||new P(null," uniform sampler2D texture; uniform float strength; uniform vec2 texSize; varying vec2 texCoord; void main() { vec2 dx = vec2(1.0 / texSize.x, 0.0); vec2 dy = vec2(0.0, 1.0 / texSize.y); vec4 color = texture2D(texture, texCoord); float bigTotal = 0.0; float smallTotal = 0.0; vec3 bigAverage = vec3(0.0); vec3 smallAverage = vec3(0.0); for (float x = -2.0; x <= 2.0; x += 1.0) { for (float y = -2.0; y <= 2.0; y += 1.0) { vec3 sample = texture2D(texture, texCoord + dx * x + dy * y).rgb; bigAverage += sample; bigTotal += 1.0; if (abs(x) + abs(y) < 2.0) { smallAverage += sample; smallTotal += 1.0; } } } vec3 edge = max(vec3(0.0), bigAverage / bigTotal - smallAverage / smallTotal); gl_FragColor = vec4(color.rgb - dot(edge, edge) * strength * 100000.0, color.a); } "),$.call(this,A.ink,{strength:t*t*t*t*t,texSize:[this.width,this.height]}),this}function I(t,e,i,n){return A.dotScreen=A.dotScreen||new P(null," uniform sampler2D texture; uniform vec2 center; uniform float angle; uniform float scale; uniform vec2 texSize; varying vec2 texCoord; float pattern() { float s = sin(angle), c = cos(angle); vec2 tex = texCoord * texSize - center; vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale; return (sin(point.x) * sin(point.y)) * 4.0; } void main() { vec4 color = texture2D(texture, texCoord); float average = (color.r + color.g + color.b) / 3.0; gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a); } "),$.call(this,A.dotScreen,{center:[t,e],angle:i,scale:Math.PI/n,texSize:[this.width,this.height]}),this}var A,P=function(){function t(t){return"[object Number]"==Object.prototype.toString.call(t)}function e(t,e){var i=A.createShader(t);if(A.shaderSource(i,e),A.compileShader(i),!A.getShaderParameter(i,A.COMPILE_STATUS))throw"compile error: "+A.getShaderInfoLog(i);return i}function i(t,i){if(this.vertexAttribute=null,this.texCoordAttribute=null,this.program=A.createProgram(),t=t||" attribute vec2 vertex; attribute vec2 _texCoord; varying vec2 texCoord; void main() { texCoord = _texCoord; gl_Position = vec4(vertex * 2.0 - 1.0, 0.0, 1.0); }",i="precision highp float;"+(i=i||" uniform sampler2D texture; varying vec2 texCoord; void main() { gl_FragColor = texture2D(texture, texCoord); }"),A.attachShader(this.program,e(A.VERTEX_SHADER,t)),A.attachShader(this.program,e(A.FRAGMENT_SHADER,i)),A.linkProgram(this.program),!A.getProgramParameter(this.program,A.LINK_STATUS))throw"link error: "+A.getProgramInfoLog(this.program)}return i.prototype.destroy=function(){A.deleteProgram(this.program),this.program=null},i.prototype.uniforms=function(e){for(var i in A.useProgram(this.program),e)if(e.hasOwnProperty(i)){var n=A.getUniformLocation(this.program,i);if(null!==n){var r=e[i];if(o=r,"[object Array]"==Object.prototype.toString.call(o))switch(r.length){case 1:A.uniform1fv(n,new Float32Array(r));break;case 2:A.uniform2fv(n,new Float32Array(r));break;case 3:A.uniform3fv(n,new Float32Array(r));break;case 4:A.uniform4fv(n,new Float32Array(r));break;case 9:A.uniformMatrix3fv(n,!1,new Float32Array(r));break;case 16:A.uniformMatrix4fv(n,!1,new Float32Array(r));break;default:throw"dont't know how to load uniform \""+i+'" of length '+r.length}else{if(!t(r))throw'attempted to set uniform "'+i+'" to invalid value '+(r||"undefined").toString();A.uniform1f(n,r)}}}var o;return this},i.prototype.textures=function(t){for(var e in A.useProgram(this.program),t)t.hasOwnProperty(e)&&A.uniform1i(A.getUniformLocation(this.program,e),t[e]);return this},i.prototype.drawRect=function(t,e,i,n){var r,o=A.getParameter(A.VIEWPORT);e=e!==r?(e-o[1])/o[3]:0,t=t!==r?(t-o[0])/o[2]:0,i=i!==r?(i-o[0])/o[2]:1,n=n!==r?(n-o[1])/o[3]:1,null==A.vertexBuffer&&(A.vertexBuffer=A.createBuffer()),A.bindBuffer(A.ARRAY_BUFFER,A.vertexBuffer),A.bufferData(A.ARRAY_BUFFER,new Float32Array([t,e,t,n,i,e,i,n]),A.STATIC_DRAW),null==A.texCoordBuffer&&(A.texCoordBuffer=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,A.texCoordBuffer),A.bufferData(A.ARRAY_BUFFER,new Float32Array([0,0,0,1,1,0,1,1]),A.STATIC_DRAW)),null==this.vertexAttribute&&(this.vertexAttribute=A.getAttribLocation(this.program,"vertex"),A.enableVertexAttribArray(this.vertexAttribute)),null==this.texCoordAttribute&&(this.texCoordAttribute=A.getAttribLocation(this.program,"_texCoord"),A.enableVertexAttribArray(this.texCoordAttribute)),A.useProgram(this.program),A.bindBuffer(A.ARRAY_BUFFER,A.vertexBuffer),A.vertexAttribPointer(this.vertexAttribute,2,A.FLOAT,!1,0,0),A.bindBuffer(A.ARRAY_BUFFER,A.texCoordBuffer),A.vertexAttribPointer(this.texCoordAttribute,2,A.FLOAT,!1,0,0),A.drawArrays(A.TRIANGLE_STRIP,0,4)},i.getDefaultShader=function(){return A.defaultShader=A.defaultShader||new i,A.defaultShader},i}();function k(t,e,i){return Math.max(t,Math.min(e,i))}function R(t){return{_:t,loadContentsOf:function(t){A=this._.gl,this._.loadContentsOf(t)},destroy:function(){A=this._.gl,this._.destroy()}}}function L(t){return R(G.fromElement(t))}function F(t,e){var i=A.UNSIGNED_BYTE;if(A.getExtension("OES_texture_float")&&A.getExtension("OES_texture_float_linear")){A.getExtension("WEBGL_color_buffer_float");var n=new G(100,100,A.RGBA,A.FLOAT);try{n.drawTo((function(){i=A.FLOAT}))}catch(t){}n.destroy()}this._.texture&&this._.texture.destroy(),this._.spareTexture&&this._.spareTexture.destroy(),this.width=t,this.height=e,this._.texture=new G(t,e,A.RGBA,i),this._.spareTexture=new G(t,e,A.RGBA,i),this._.extraTexture=this._.extraTexture||new G(0,0,A.RGBA,i),this._.flippedShader=this._.flippedShader||new P(null," uniform sampler2D texture; varying vec2 texCoord; void main() { gl_FragColor = texture2D(texture, vec2(texCoord.x, 1.0 - texCoord.y)); } "),this._.isInitialized=!0}function M(t,e,i){return this._.isInitialized&&t._.width==this.width&&t._.height==this.height||F.call(this,e||t._.width,i||t._.height),t._.use(),this._.texture.drawTo((function(){P.getDefaultShader().drawRect()})),this}function O(){return this._.texture.use(),this._.flippedShader.drawRect(),this}function $(t,e,i,n){(i||this._.texture).use(),this._.spareTexture.drawTo((function(){t.uniforms(e).drawRect()})),this._.spareTexture.swapWith(n||this._.texture)}function D(t){return t.parentNode.insertBefore(this,t),t.parentNode.removeChild(t),this}function j(){var t=new G(this._.texture.width,this._.texture.height,A.RGBA,A.UNSIGNED_BYTE);return this._.texture.use(),t.drawTo((function(){P.getDefaultShader().drawRect()})),R(t)}function N(){var t=this._.texture.width,e=this._.texture.height,i=new Uint8Array(t*e*4);return this._.texture.drawTo((function(){A.readPixels(0,0,t,e,A.RGBA,A.UNSIGNED_BYTE,i)})),i}function B(t){return function(){return A=this._.gl,t.apply(this,arguments)}}function U(t,e,i,n,r,o,s,a){var l=i-r,u=n-o,h=s-r,c=a-o,d=t-i+r-s,f=e-n+o-a,p=l*c-h*u,g=(d*c-h*f)/p,m=(l*f-d*u)/p;return[i-t+g*i,n-e+g*n,g,s-t+m*s,a-e+m*a,m,t,e,1]}function z(t){var e=t[0],i=t[1],n=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],u=t[8],h=e*o*u-e*s*l-i*r*u+i*s*a+n*r*l-n*o*a;return[(o*u-s*l)/h,(n*l-i*u)/h,(i*s-n*o)/h,(s*a-r*u)/h,(e*u-n*a)/h,(n*r-e*s)/h,(r*l-o*a)/h,(i*a-e*l)/h,(e*o-i*r)/h]}function V(t){var e=t.length;this.xa=[],this.ya=[],this.u=[],this.y2=[],t.sort((function(t,e){return t[0]-e[0]}));for(var i=0;i=0;--i)this.y2[i]=this.y2[i]*this.y2[i+1]+this.u[i]}t.canvas=function(){var t=document.createElement("canvas");try{A=t.getContext("experimental-webgl",{premultipliedAlpha:!1})}catch(t){A=null}if(!A)throw"This browser does not support WebGL";return t._={gl:A,isInitialized:!1,texture:null,spareTexture:null,flippedShader:null},t.texture=B(L),t.draw=B(M),t.update=B(O),t.replace=B(D),t.contents=B(j),t.getPixelArray=B(N),t.brightnessContrast=B(n),t.brightnessRGB=B(l),t.hexagonalPixelate=B(T),t.hueSaturation=B(p),t.colorHalftone=B(C),t.triangleBlur=B(w),t.unsharpMask=B(f),t.perspective=B(m),t.matrixWarp=B(y),t.bulgePinch=B(v),t.tiltShift=B(b),t.dotScreen=B(I),t.edgeWork=B(S),t.lensBlur=B(x),t.zoomBlur=B(_),t.noise=B(h),t.denoise=B(c),t.curves=B(a),t.swirl=B(g),t.ink=B(E),t.vignette=B(u),t.vibrance=B(o),t.sepia=B(d),t.gamma=B(r),t},t.splineInterpolate=s,V.prototype.interpolate=function(t){for(var e=0,i=this.ya.length-1;i-e>1;){var n=i+e>>1;this.xa[n]>t?i=n:e=n}var r=this.xa[i]-this.xa[e],o=(this.xa[i]-t)/r,s=(t-this.xa[e])/r;return o*this.ya[e]+s*this.ya[i]+((o*o*o-o)*this.y2[e]+(s*s*s-s)*this.y2[i])*(r*r)/6};var G=function(){function t(t,e,i,n){this.gl=A,this.id=A.createTexture(),this.width=t,this.height=e,this.format=i,this.type=n,A.bindTexture(A.TEXTURE_2D,this.id),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_MAG_FILTER,A.LINEAR),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_MIN_FILTER,A.LINEAR),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_S,A.CLAMP_TO_EDGE),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_T,A.CLAMP_TO_EDGE),t&&e&&A.texImage2D(A.TEXTURE_2D,0,this.format,t,e,0,this.format,this.type,null)}t.fromElement=function(e){var i=new t(0,0,A.RGBA,A.UNSIGNED_BYTE);return i.loadContentsOf(e),i},t.prototype.loadContentsOf=function(t){this.width=t.width||t.videoWidth,this.height=t.height||t.videoHeight,A.bindTexture(A.TEXTURE_2D,this.id),A.texImage2D(A.TEXTURE_2D,0,this.format,this.format,this.type,t)},t.prototype.initFromBytes=function(t,e,i){this.width=t,this.height=e,this.format=A.RGBA,this.type=A.UNSIGNED_BYTE,A.bindTexture(A.TEXTURE_2D,this.id),A.texImage2D(A.TEXTURE_2D,0,A.RGBA,t,e,0,A.RGBA,this.type,new Uint8Array(i))},t.prototype.destroy=function(){A.deleteTexture(this.id),this.id=null},t.prototype.use=function(t){A.activeTexture(A.TEXTURE0+(t||0)),A.bindTexture(A.TEXTURE_2D,this.id)},t.prototype.unuse=function(t){A.activeTexture(A.TEXTURE0+(t||0)),A.bindTexture(A.TEXTURE_2D,null)},t.prototype.ensureFormat=function(t,e,i,n){if(1==arguments.length){var r=arguments[0];t=r.width,e=r.height,i=r.format,n=r.type}t==this.width&&e==this.height&&i==this.format&&n==this.type||(this.width=t,this.height=e,this.format=i,this.type=n,A.bindTexture(A.TEXTURE_2D,this.id),A.texImage2D(A.TEXTURE_2D,0,this.format,t,e,0,this.format,this.type,null))},t.prototype.drawTo=function(t){if(A.framebuffer=A.framebuffer||A.createFramebuffer(),A.bindFramebuffer(A.FRAMEBUFFER,A.framebuffer),A.framebufferTexture2D(A.FRAMEBUFFER,A.COLOR_ATTACHMENT0,A.TEXTURE_2D,this.id,0),A.checkFramebufferStatus(A.FRAMEBUFFER)!==A.FRAMEBUFFER_COMPLETE)throw new Error("incomplete framebuffer");A.viewport(0,0,this.width,this.height),t(),A.bindFramebuffer(A.FRAMEBUFFER,null)};var e=null;function i(t){null==e&&(e=document.createElement("canvas")),e.width=t.width,e.height=t.height;var i=e.getContext("2d");return i.clearRect(0,0,e.width,e.height),i}return t.prototype.fillUsingCanvas=function(t){return t(i(this)),this.format=A.RGBA,this.type=A.UNSIGNED_BYTE,A.bindTexture(A.TEXTURE_2D,this.id),A.texImage2D(A.TEXTURE_2D,0,A.RGBA,A.RGBA,A.UNSIGNED_BYTE,e),this},t.prototype.toImage=function(t){this.use(),P.getDefaultShader().drawRect();var n=this.width*this.height*4,r=new Uint8Array(n),o=i(this),s=o.createImageData(this.width,this.height);A.readPixels(0,0,this.width,this.height,A.RGBA,A.UNSIGNED_BYTE,r);for(var a=0;a{window.addEventListener("load",(function(){var t=(new Date).getTime(),e=window.setInterval((function(){(new Date).getTime()-t>72e5?window.clearInterval(e):Vue.http.post("heartbeat").then((function(){t=(new Date).getTime()}),(function(){window.clearInterval(e)}))}),36e5)}))},463:(t,e,i)=>{"use strict";var n=Object.freeze({});function r(t){return null==t}function o(t){return null!=t}function s(t){return!0===t}function a(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function l(t){return null!==t&&"object"==typeof t}var u=Object.prototype.toString;function h(t){return"[object Object]"===u.call(t)}function c(t){return"[object RegExp]"===u.call(t)}function d(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function f(t){return o(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function p(t){return null==t?"":Array.isArray(t)||h(t)&&t.toString===u?JSON.stringify(t,null,2):String(t)}function g(t){var e=parseFloat(t);return isNaN(e)?t:e}function m(t,e){for(var i=Object.create(null),n=t.split(","),r=0;r-1)return t.splice(i,1)}}var b=Object.prototype.hasOwnProperty;function w(t,e){return b.call(t,e)}function x(t){var e=Object.create(null);return function(i){return e[i]||(e[i]=t(i))}}var S=/-(\w)/g,C=x((function(t){return t.replace(S,(function(t,e){return e?e.toUpperCase():""}))})),T=x((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),E=/\B([A-Z])/g,I=x((function(t){return t.replace(E,"-$1").toLowerCase()}));var A=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function i(i){var n=arguments.length;return n?n>1?t.apply(e,arguments):t.call(e,i):t.call(e)}return i._length=t.length,i};function P(t,e){e=e||0;for(var i=t.length-e,n=new Array(i);i--;)n[i]=t[i+e];return n}function k(t,e){for(var i in e)t[i]=e[i];return t}function R(t){for(var e={},i=0;i0,tt=Z&&Z.indexOf("edge/")>0,et=(Z&&Z.indexOf("android"),Z&&/iphone|ipad|ipod|ios/.test(Z)||"ios"===H),it=(Z&&/chrome\/\d+/.test(Z),Z&&/phantomjs/.test(Z),Z&&Z.match(/firefox\/(\d+)/)),nt={}.watch,rt=!1;if(X)try{var ot={};Object.defineProperty(ot,"passive",{get:function(){rt=!0}}),window.addEventListener("test-passive",null,ot)}catch(id){}var st=function(){return void 0===W&&(W=!X&&!Y&&void 0!==i.g&&(i.g.process&&"server"===i.g.process.env.VUE_ENV)),W},at=X&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function lt(t){return"function"==typeof t&&/native code/.test(t.toString())}var ut,ht="undefined"!=typeof Symbol&<(Symbol)&&"undefined"!=typeof Reflect&<(Reflect.ownKeys);ut="undefined"!=typeof Set&<(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var ct=L,dt=0,ft=function(){this.id=dt++,this.subs=[]};ft.prototype.addSub=function(t){this.subs.push(t)},ft.prototype.removeSub=function(t){_(this.subs,t)},ft.prototype.depend=function(){ft.target&&ft.target.addDep(this)},ft.prototype.notify=function(){var t=this.subs.slice();for(var e=0,i=t.length;e-1)if(o&&!w(r,"default"))s=!1;else if(""===s||s===I(t)){var l=Gt(String,r.type);(l<0||a0&&(pe((n=ge(n,(e||"")+"_"+i))[0])&&pe(u)&&(h[l]=bt(u.text+n[0].text),n.shift()),h.push.apply(h,n)):a(n)?pe(u)?h[l]=bt(u.text+n):""!==n&&h.push(bt(n)):pe(n)&&pe(u)?h[l]=bt(u.text+n.text):(s(t._isVList)&&o(n.tag)&&r(n.key)&&o(e)&&(n.key="__vlist"+e+"_"+i+"__"),h.push(n)));return h}function me(t,e){if(t){for(var i=Object.create(null),n=ht?Reflect.ownKeys(t):Object.keys(t),r=0;r0,s=t?!!t.$stable:!o,a=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(s&&i&&i!==n&&a===i.$key&&!o&&!i.$hasNormal)return i;for(var l in r={},t)t[l]&&"$"!==l[0]&&(r[l]=be(e,l,t[l]))}else r={};for(var u in e)u in r||(r[u]=we(e,u));return t&&Object.isExtensible(t)&&(t._normalized=r),G(r,"$stable",s),G(r,"$key",a),G(r,"$hasNormal",o),r}function be(t,e,i){var n=function(){var t=arguments.length?i.apply(null,arguments):i({});return(t=t&&"object"==typeof t&&!Array.isArray(t)?[t]:fe(t))&&(0===t.length||1===t.length&&t[0].isComment)?void 0:t};return i.proxy&&Object.defineProperty(t,e,{get:n,enumerable:!0,configurable:!0}),n}function we(t,e){return function(){return t[e]}}function xe(t,e){var i,n,r,s,a;if(Array.isArray(t)||"string"==typeof t)for(i=new Array(t.length),n=0,r=t.length;ndocument.createEvent("Event").timeStamp&&(pi=function(){return gi.now()})}function mi(){var t,e;for(fi=pi(),ci=!0,ai.sort((function(t,e){return t.id-e.id})),di=0;didi&&ai[i].id>t.id;)i--;ai.splice(i+1,0,t)}else ai.push(t);hi||(hi=!0,re(mi))}}(this)},yi.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||l(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(t){qt(t,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},yi.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},yi.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},yi.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||_(this.vm._watchers,this);for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1}};var _i={enumerable:!0,configurable:!0,get:L,set:L};function bi(t,e,i){_i.get=function(){return this[e][i]},_i.set=function(t){this[e][i]=t},Object.defineProperty(t,i,_i)}function wi(t){t._watchers=[];var e=t.$options;e.props&&function(t,e){var i=t.$options.propsData||{},n=t._props={},r=t.$options._propKeys=[];t.$parent&&Et(!1);var o=function(o){r.push(o);var s=Ut(o,e,i,t);Pt(n,o,s),o in t||bi(t,"_props",o)};for(var s in e)o(s);Et(!0)}(t,e.props),e.methods&&function(t,e){t.$options.props;for(var i in e)t[i]="function"!=typeof e[i]?L:A(e[i],t)}(t,e.methods),e.data?function(t){var e=t.$options.data;h(e=t._data="function"==typeof e?function(t,e){gt();try{return t.call(e,e)}catch(t){return qt(t,e,"data()"),{}}finally{mt()}}(e,t):e||{})||(e={});var i=Object.keys(e),n=t.$options.props,r=(t.$options.methods,i.length);for(;r--;){var o=i[r];0,n&&w(n,o)||V(o)||bi(t,"_data",o)}At(e,!0)}(t):At(t._data={},!0),e.computed&&function(t,e){var i=t._computedWatchers=Object.create(null),n=st();for(var r in e){var o=e[r],s="function"==typeof o?o:o.get;0,n||(i[r]=new yi(t,s||L,L,xi)),r in t||Si(t,r,o)}}(t,e.computed),e.watch&&e.watch!==nt&&function(t,e){for(var i in e){var n=e[i];if(Array.isArray(n))for(var r=0;r-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!c(t)&&t.test(e)}function Fi(t,e){var i=t.cache,n=t.keys,r=t._vnode;for(var o in i){var s=i[o];if(s){var a=Ri(s.componentOptions);a&&!e(a)&&Mi(i,o,n,r)}}}function Mi(t,e,i,n){var r=t[e];!r||n&&r.tag===n.tag||r.componentInstance.$destroy(),t[e]=null,_(i,e)}!function(t){t.prototype._init=function(t){var e=this;e._uid=Ii++,e._isVue=!0,t&&t._isComponent?function(t,e){var i=t.$options=Object.create(t.constructor.options),n=e._parentVnode;i.parent=e.parent,i._parentVnode=n;var r=n.componentOptions;i.propsData=r.propsData,i._parentListeners=r.listeners,i._renderChildren=r.children,i._componentTag=r.tag,e.render&&(i.render=e.render,i.staticRenderFns=e.staticRenderFns)}(e,t):e.$options=Nt(Ai(e.constructor),t||{},e),e._renderProxy=e,e._self=e,function(t){var e=t.$options,i=e.parent;if(i&&!e.abstract){for(;i.$options.abstract&&i.$parent;)i=i.$parent;i.$children.push(t)}t.$parent=i,t.$root=i?i.$root:t,t.$children=[],t.$refs={},t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(e),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&ti(t,e)}(e),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,i=t.$vnode=e._parentVnode,r=i&&i.context;t.$slots=ve(e._renderChildren,r),t.$scopedSlots=n,t._c=function(e,i,n,r){return Ge(t,e,i,n,r,!1)},t.$createElement=function(e,i,n,r){return Ge(t,e,i,n,r,!0)};var o=i&&i.data;Pt(t,"$attrs",o&&o.attrs||n,null,!0),Pt(t,"$listeners",e._parentListeners||n,null,!0)}(e),si(e,"beforeCreate"),function(t){var e=me(t.$options.inject,t);e&&(Et(!1),Object.keys(e).forEach((function(i){Pt(t,i,e[i])})),Et(!0))}(e),wi(e),function(t){var e=t.$options.provide;e&&(t._provided="function"==typeof e?e.call(t):e)}(e),si(e,"created"),e.$options.el&&e.$mount(e.$options.el)}}(Pi),function(t){var e={get:function(){return this._data}},i={get:function(){return this._props}};Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",i),t.prototype.$set=kt,t.prototype.$delete=Rt,t.prototype.$watch=function(t,e,i){var n=this;if(h(e))return Ei(n,t,e,i);(i=i||{}).user=!0;var r=new yi(n,t,e,i);if(i.immediate)try{e.call(n,r.value)}catch(t){qt(t,n,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(Pi),function(t){var e=/^hook:/;t.prototype.$on=function(t,i){var n=this;if(Array.isArray(t))for(var r=0,o=t.length;r1?P(i):i;for(var n=P(arguments,1),r='event handler for "'+t+'"',o=0,s=i.length;oparseInt(this.max)&&Mi(s,a[0],a,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return U}};Object.defineProperty(t,"config",e),t.util={warn:ct,extend:k,mergeOptions:Nt,defineReactive:Pt},t.set=kt,t.delete=Rt,t.nextTick=re,t.observable=function(t){return At(t),t},t.options=Object.create(null),N.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,k(t.options.components,$i),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var i=P(arguments,1);return i.unshift(this),"function"==typeof t.install?t.install.apply(t,i):"function"==typeof t&&t.apply(null,i),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=Nt(this.options,t),this}}(t),ki(t),function(t){N.forEach((function(e){t[e]=function(t,i){return i?("component"===e&&h(i)&&(i.name=i.name||t,i=this.options._base.extend(i)),"directive"===e&&"function"==typeof i&&(i={bind:i,update:i}),this.options[e+"s"][t]=i,i):this.options[e+"s"][t]}}))}(t)}(Pi),Object.defineProperty(Pi.prototype,"$isServer",{get:st}),Object.defineProperty(Pi.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Pi,"FunctionalRenderContext",{value:De}),Pi.version="2.6.12";var Di=m("style,class"),ji=m("input,textarea,option,select,progress"),Ni=function(t,e,i){return"value"===i&&ji(t)&&"button"!==e||"selected"===i&&"option"===t||"checked"===i&&"input"===t||"muted"===i&&"video"===t},Bi=m("contenteditable,draggable,spellcheck"),Ui=m("events,caret,typing,plaintext-only"),zi=m("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Vi="http://www.w3.org/1999/xlink",Gi=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},qi=function(t){return Gi(t)?t.slice(6,t.length):""},Wi=function(t){return null==t||!1===t};function Ki(t){for(var e=t.data,i=t,n=t;o(n.componentInstance);)(n=n.componentInstance._vnode)&&n.data&&(e=Xi(n.data,e));for(;o(i=i.parent);)i&&i.data&&(e=Xi(e,i.data));return function(t,e){if(o(t)||o(e))return Yi(t,Hi(e));return""}(e.staticClass,e.class)}function Xi(t,e){return{staticClass:Yi(t.staticClass,e.staticClass),class:o(t.class)?[t.class,e.class]:e.class}}function Yi(t,e){return t?e?t+" "+e:t:e||""}function Hi(t){return Array.isArray(t)?function(t){for(var e,i="",n=0,r=t.length;n-1?xn(t,e,i):zi(e)?Wi(i)?t.removeAttribute(e):(i="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,i)):Bi(e)?t.setAttribute(e,function(t,e){return Wi(e)||"false"===e?"false":"contenteditable"===t&&Ui(e)?e:"true"}(e,i)):Gi(e)?Wi(i)?t.removeAttributeNS(Vi,qi(e)):t.setAttributeNS(Vi,e,i):xn(t,e,i)}function xn(t,e,i){if(Wi(i))t.removeAttribute(e);else{if(J&&!Q&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==i&&!t.__ieph){var n=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",n)};t.addEventListener("input",n),t.__ieph=!0}t.setAttribute(e,i)}}var Sn={create:bn,update:bn};function Cn(t,e){var i=e.elm,n=e.data,s=t.data;if(!(r(n.staticClass)&&r(n.class)&&(r(s)||r(s.staticClass)&&r(s.class)))){var a=Ki(e),l=i._transitionClasses;o(l)&&(a=Yi(a,Hi(l))),a!==i._prevClass&&(i.setAttribute("class",a),i._prevClass=a)}}var Tn,En,In,An,Pn,kn,Rn={create:Cn,update:Cn},Ln=/[\w).+\-_$\]]/;function Fn(t){var e,i,n,r,o,s=!1,a=!1,l=!1,u=!1,h=0,c=0,d=0,f=0;for(n=0;n=0&&" "===(g=t.charAt(p));p--);g&&Ln.test(g)||(u=!0)}}else void 0===r?(f=n+1,r=t.slice(0,n).trim()):m();function m(){(o||(o=[])).push(t.slice(f,n).trim()),f=n+1}if(void 0===r?r=t.slice(0,n).trim():0!==f&&m(),o)for(n=0;n-1?{exp:t.slice(0,An),key:'"'+t.slice(An+1)+'"'}:{exp:t,key:null};En=t,An=Pn=kn=0;for(;!Hn();)Zn(In=Yn())?Qn(In):91===In&&Jn(In);return{exp:t.slice(0,Pn),key:t.slice(Pn+1,kn)}}(t);return null===i.key?t+"="+e:"$set("+i.exp+", "+i.key+", "+e+")"}function Yn(){return En.charCodeAt(++An)}function Hn(){return An>=Tn}function Zn(t){return 34===t||39===t}function Jn(t){var e=1;for(Pn=An;!Hn();)if(Zn(t=Yn()))Qn(t);else if(91===t&&e++,93===t&&e--,0===e){kn=An;break}}function Qn(t){for(var e=t;!Hn()&&(t=Yn())!==e;);}var tr,er="__r";function ir(t,e,i){var n=tr;return function r(){var o=e.apply(null,arguments);null!==o&&or(t,r,i,n)}}var nr=Ht&&!(it&&Number(it[1])<=53);function rr(t,e,i,n){if(nr){var r=fi,o=e;e=o._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=r||t.timeStamp<=0||t.target.ownerDocument!==document)return o.apply(this,arguments)}}tr.addEventListener(t,e,rt?{capture:i,passive:n}:i)}function or(t,e,i,n){(n||tr).removeEventListener(t,e._wrapper||e,i)}function sr(t,e){if(!r(t.data.on)||!r(e.data.on)){var i=e.data.on||{},n=t.data.on||{};tr=e.elm,function(t){if(o(t.__r)){var e=J?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r}o(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c)}(i),he(i,n,rr,or,ir,e.context),tr=void 0}}var ar,lr={create:sr,update:sr};function ur(t,e){if(!r(t.data.domProps)||!r(e.data.domProps)){var i,n,s=e.elm,a=t.data.domProps||{},l=e.data.domProps||{};for(i in o(l.__ob__)&&(l=e.data.domProps=k({},l)),a)i in l||(s[i]="");for(i in l){if(n=l[i],"textContent"===i||"innerHTML"===i){if(e.children&&(e.children.length=0),n===a[i])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if("value"===i&&"PROGRESS"!==s.tagName){s._value=n;var u=r(n)?"":String(n);hr(s,u)&&(s.value=u)}else if("innerHTML"===i&&Qi(s.tagName)&&r(s.innerHTML)){(ar=ar||document.createElement("div")).innerHTML=""+n+"";for(var h=ar.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;h.firstChild;)s.appendChild(h.firstChild)}else if(n!==a[i])try{s[i]=n}catch(t){}}}}function hr(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var i=!0;try{i=document.activeElement!==t}catch(t){}return i&&t.value!==e}(t,e)||function(t,e){var i=t.value,n=t._vModifiers;if(o(n)){if(n.number)return g(i)!==g(e);if(n.trim)return i.trim()!==e.trim()}return i!==e}(t,e))}var cr={create:ur,update:ur},dr=x((function(t){var e={},i=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var n=t.split(i);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}));function fr(t){var e=pr(t.style);return t.staticStyle?k(t.staticStyle,e):e}function pr(t){return Array.isArray(t)?R(t):"string"==typeof t?dr(t):t}var gr,mr=/^--/,vr=/\s*!important$/,yr=function(t,e,i){if(mr.test(e))t.style.setProperty(e,i);else if(vr.test(i))t.style.setProperty(I(e),i.replace(vr,""),"important");else{var n=br(e);if(Array.isArray(i))for(var r=0,o=i.length;r-1?e.split(Sr).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var i=" "+(t.getAttribute("class")||"")+" ";i.indexOf(" "+e+" ")<0&&t.setAttribute("class",(i+e).trim())}}function Tr(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Sr).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var i=" "+(t.getAttribute("class")||"")+" ",n=" "+e+" ";i.indexOf(n)>=0;)i=i.replace(n," ");(i=i.trim())?t.setAttribute("class",i):t.removeAttribute("class")}}function Er(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&k(e,Ir(t.name||"v")),k(e,t),e}return"string"==typeof t?Ir(t):void 0}}var Ir=x((function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}})),Ar=X&&!Q,Pr="transition",kr="animation",Rr="transition",Lr="transitionend",Fr="animation",Mr="animationend";Ar&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Rr="WebkitTransition",Lr="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Fr="WebkitAnimation",Mr="webkitAnimationEnd"));var Or=X?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function $r(t){Or((function(){Or(t)}))}function Dr(t,e){var i=t._transitionClasses||(t._transitionClasses=[]);i.indexOf(e)<0&&(i.push(e),Cr(t,e))}function jr(t,e){t._transitionClasses&&_(t._transitionClasses,e),Tr(t,e)}function Nr(t,e,i){var n=Ur(t,e),r=n.type,o=n.timeout,s=n.propCount;if(!r)return i();var a=r===Pr?Lr:Mr,l=0,u=function(){t.removeEventListener(a,h),i()},h=function(e){e.target===t&&++l>=s&&u()};setTimeout((function(){l0&&(i=Pr,h=s,c=o.length):e===kr?u>0&&(i=kr,h=u,c=l.length):c=(i=(h=Math.max(s,u))>0?s>u?Pr:kr:null)?i===Pr?o.length:l.length:0,{type:i,timeout:h,propCount:c,hasTransform:i===Pr&&Br.test(n[Rr+"Property"])}}function zr(t,e){for(;t.length1}function Xr(t,e){!0!==e.data.show&&Gr(e)}var Yr=function(t){var e,i,n={},l=t.modules,u=t.nodeOps;for(e=0;ep?_(t,r(i[v+1])?null:i[v+1].elm,i,f,v,n):f>v&&w(e,d,p)}(d,m,v,i,h):o(v)?(o(t.text)&&u.setTextContent(d,""),_(d,null,v,0,v.length-1,i)):o(m)?w(m,0,m.length-1):o(t.text)&&u.setTextContent(d,""):t.text!==e.text&&u.setTextContent(d,e.text),o(p)&&o(f=p.hook)&&o(f=f.postpatch)&&f(t,e)}}}function T(t,e,i){if(s(i)&&o(t.parent))t.parent.data.pendingInsert=e;else for(var n=0;n-1,s.selected!==o&&(s.selected=o);else if(O(to(s),n))return void(t.selectedIndex!==a&&(t.selectedIndex=a));r||(t.selectedIndex=-1)}}function Qr(t,e){return e.every((function(e){return!O(e,t)}))}function to(t){return"_value"in t?t._value:t.value}function eo(t){t.target.composing=!0}function io(t){t.target.composing&&(t.target.composing=!1,no(t.target,"input"))}function no(t,e){var i=document.createEvent("HTMLEvents");i.initEvent(e,!0,!0),t.dispatchEvent(i)}function ro(t){return!t.componentInstance||t.data&&t.data.transition?t:ro(t.componentInstance._vnode)}var oo={model:Hr,show:{bind:function(t,e,i){var n=e.value,r=(i=ro(i)).data&&i.data.transition,o=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;n&&r?(i.data.show=!0,Gr(i,(function(){t.style.display=o}))):t.style.display=n?o:"none"},update:function(t,e,i){var n=e.value;!n!=!e.oldValue&&((i=ro(i)).data&&i.data.transition?(i.data.show=!0,n?Gr(i,(function(){t.style.display=t.__vOriginalDisplay})):qr(i,(function(){t.style.display="none"}))):t.style.display=n?t.__vOriginalDisplay:"none")},unbind:function(t,e,i,n,r){r||(t.style.display=t.__vOriginalDisplay)}}},so={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function ao(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?ao(He(e.children)):t}function lo(t){var e={},i=t.$options;for(var n in i.propsData)e[n]=t[n];var r=i._parentListeners;for(var o in r)e[C(o)]=r[o];return e}function uo(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var ho=function(t){return t.tag||Ye(t)},co=function(t){return"show"===t.name},fo={name:"transition",props:so,abstract:!0,render:function(t){var e=this,i=this.$slots.default;if(i&&(i=i.filter(ho)).length){0;var n=this.mode;0;var r=i[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return r;var o=ao(r);if(!o)return r;if(this._leaving)return uo(t,r);var s="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?s+"comment":s+o.tag:a(o.key)?0===String(o.key).indexOf(s)?o.key:s+o.key:o.key;var l=(o.data||(o.data={})).transition=lo(this),u=this._vnode,h=ao(u);if(o.data.directives&&o.data.directives.some(co)&&(o.data.show=!0),h&&h.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(o,h)&&!Ye(h)&&(!h.componentInstance||!h.componentInstance._vnode.isComment)){var c=h.data.transition=k({},l);if("out-in"===n)return this._leaving=!0,ce(c,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),uo(t,r);if("in-out"===n){if(Ye(o))return u;var d,f=function(){d()};ce(l,"afterEnter",f),ce(l,"enterCancelled",f),ce(c,"delayLeave",(function(t){d=t}))}}return r}}},po=k({tag:String,moveClass:String},so);function go(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function mo(t){t.data.newPos=t.elm.getBoundingClientRect()}function vo(t){var e=t.data.pos,i=t.data.newPos,n=e.left-i.left,r=e.top-i.top;if(n||r){t.data.moved=!0;var o=t.elm.style;o.transform=o.WebkitTransform="translate("+n+"px,"+r+"px)",o.transitionDuration="0s"}}delete po.mode;var yo={Transition:fo,TransitionGroup:{props:po,beforeMount:function(){var t=this,e=this._update;this._update=function(i,n){var r=ii(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,r(),e.call(t,i,n)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",i=Object.create(null),n=this.prevChildren=this.children,r=this.$slots.default||[],o=this.children=[],s=lo(this),a=0;a-1?nn[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:nn[t]=/HTMLUnknownElement/.test(e.toString())},k(Pi.options.directives,oo),k(Pi.options.components,yo),Pi.prototype.__patch__=X?Yr:L,Pi.prototype.$mount=function(t,e){return function(t,e,i){var n;return t.$el=e,t.$options.render||(t.$options.render=_t),si(t,"beforeMount"),n=function(){t._update(t._render(),i)},new yi(t,n,L,{before:function(){t._isMounted&&!t._isDestroyed&&si(t,"beforeUpdate")}},!0),i=!1,null==t.$vnode&&(t._isMounted=!0,si(t,"mounted")),t}(this,t=t&&X?on(t):void 0,e)},X&&setTimeout((function(){U.devtools&&at&&at.emit("init",Pi)}),0);var _o=/\{\{((?:.|\r?\n)+?)\}\}/g,bo=/[-.*+?^${}()|[\]\/\\]/g,wo=x((function(t){var e=t[0].replace(bo,"\\$&"),i=t[1].replace(bo,"\\$&");return new RegExp(e+"((?:.|\\n)+?)"+i,"g")}));var xo={staticKeys:["staticClass"],transformNode:function(t,e){e.warn;var i=Gn(t,"class");i&&(t.staticClass=JSON.stringify(i));var n=Vn(t,"class",!1);n&&(t.classBinding=n)},genData:function(t){var e="";return t.staticClass&&(e+="staticClass:"+t.staticClass+","),t.classBinding&&(e+="class:"+t.classBinding+","),e}};var So,Co={staticKeys:["staticStyle"],transformNode:function(t,e){e.warn;var i=Gn(t,"style");i&&(t.staticStyle=JSON.stringify(dr(i)));var n=Vn(t,"style",!1);n&&(t.styleBinding=n)},genData:function(t){var e="";return t.staticStyle&&(e+="staticStyle:"+t.staticStyle+","),t.styleBinding&&(e+="style:("+t.styleBinding+"),"),e}},To=function(t){return(So=So||document.createElement("div")).innerHTML=t,So.textContent},Eo=m("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),Io=m("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),Ao=m("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),Po=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ko=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Ro="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+z.source+"]*",Lo="((?:"+Ro+"\\:)?"+Ro+")",Fo=new RegExp("^<"+Lo),Mo=/^\s*(\/?)>/,Oo=new RegExp("^<\\/"+Lo+"[^>]*>"),$o=/^]+>/i,Do=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},zo=/&(?:lt|gt|quot|amp|#39);/g,Vo=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Go=m("pre,textarea",!0),qo=function(t,e){return t&&Go(t)&&"\n"===e[0]};function Wo(t,e){var i=e?Vo:zo;return t.replace(i,(function(t){return Uo[t]}))}var Ko,Xo,Yo,Ho,Zo,Jo,Qo,ts,es=/^@|^v-on:/,is=/^v-|^@|^:|^#/,ns=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,rs=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,os=/^\(|\)$/g,ss=/^\[.*\]$/,as=/:(.*)$/,ls=/^:|^\.|^v-bind:/,us=/\.[^.\]]+(?=[^\]]*$)/g,hs=/^v-slot(:|$)|^#/,cs=/[\r\n]/,ds=/\s+/g,fs=x(To),ps="_empty_";function gs(t,e,i){return{type:1,tag:t,attrsList:e,attrsMap:xs(e),rawAttrsMap:{},parent:i,children:[]}}function ms(t,e){Ko=e.warn||On,Jo=e.isPreTag||F,Qo=e.mustUseProp||F,ts=e.getTagNamespace||F;var i=e.isReservedTag||F;(function(t){return!!t.component||!i(t.tag)}),Yo=$n(e.modules,"transformNode"),Ho=$n(e.modules,"preTransformNode"),Zo=$n(e.modules,"postTransformNode"),Xo=e.delimiters;var n,r,o=[],s=!1!==e.preserveWhitespace,a=e.whitespace,l=!1,u=!1;function h(t){if(c(t),l||t.processed||(t=vs(t,e)),o.length||t===n||n.if&&(t.elseif||t.else)&&_s(n,{exp:t.elseif,block:t}),r&&!t.forbidden)if(t.elseif||t.else)s=t,(a=function(t){for(var e=t.length;e--;){if(1===t[e].type)return t[e];t.pop()}}(r.children))&&a.if&&_s(a,{exp:s.elseif,block:s});else{if(t.slotScope){var i=t.slotTarget||'"default"';(r.scopedSlots||(r.scopedSlots={}))[i]=t}r.children.push(t),t.parent=r}var s,a;t.children=t.children.filter((function(t){return!t.slotScope})),c(t),t.pre&&(l=!1),Jo(t.tag)&&(u=!1);for(var h=0;h]*>)","i")),d=t.replace(c,(function(t,i,n){return u=n.length,No(h)||"noscript"===h||(i=i.replace(//g,"$1").replace(//g,"$1")),qo(h,i)&&(i=i.slice(1)),e.chars&&e.chars(i),""}));l+=t.length-d.length,t=d,E(h,l-u,l)}else{var f=t.indexOf("<");if(0===f){if(Do.test(t)){var p=t.indexOf("--\x3e");if(p>=0){e.shouldKeepComment&&e.comment(t.substring(4,p),l,l+p+3),S(p+3);continue}}if(jo.test(t)){var g=t.indexOf("]>");if(g>=0){S(g+2);continue}}var m=t.match($o);if(m){S(m[0].length);continue}var v=t.match(Oo);if(v){var y=l;S(v[0].length),E(v[1],y,l);continue}var _=C();if(_){T(_),qo(_.tagName,t)&&S(1);continue}}var b=void 0,w=void 0,x=void 0;if(f>=0){for(w=t.slice(f);!(Oo.test(w)||Fo.test(w)||Do.test(w)||jo.test(w)||(x=w.indexOf("<",1))<0);)f+=x,w=t.slice(f);b=t.substring(0,f)}f<0&&(b=t),b&&S(b.length),e.chars&&b&&e.chars(b,l-b.length,l)}if(t===i){e.chars&&e.chars(t);break}}function S(e){l+=e,t=t.substring(e)}function C(){var e=t.match(Fo);if(e){var i,n,r={tagName:e[1],attrs:[],start:l};for(S(e[0].length);!(i=t.match(Mo))&&(n=t.match(ko)||t.match(Po));)n.start=l,S(n[0].length),n.end=l,r.attrs.push(n);if(i)return r.unarySlash=i[1],S(i[0].length),r.end=l,r}}function T(t){var i=t.tagName,l=t.unarySlash;o&&("p"===n&&Ao(i)&&E(n),a(i)&&n===i&&E(i));for(var u=s(i)||!!l,h=t.attrs.length,c=new Array(h),d=0;d=0&&r[s].lowerCasedTag!==a;s--);else s=0;if(s>=0){for(var u=r.length-1;u>=s;u--)e.end&&e.end(r[u].tag,i,o);r.length=s,n=s&&r[s-1].tag}else"br"===a?e.start&&e.start(t,[],!0,i,o):"p"===a&&(e.start&&e.start(t,[],!1,i,o),e.end&&e.end(t,i,o))}E()}(t,{warn:Ko,expectHTML:e.expectHTML,isUnaryTag:e.isUnaryTag,canBeLeftOpenTag:e.canBeLeftOpenTag,shouldDecodeNewlines:e.shouldDecodeNewlines,shouldDecodeNewlinesForHref:e.shouldDecodeNewlinesForHref,shouldKeepComment:e.comments,outputSourceRange:e.outputSourceRange,start:function(t,i,s,a,c){var d=r&&r.ns||ts(t);J&&"svg"===d&&(i=function(t){for(var e=[],i=0;il&&(a.push(o=t.slice(l,r)),s.push(JSON.stringify(o)));var u=Fn(n[1].trim());s.push("_s("+u+")"),a.push({"@binding":u}),l=r+n[0].length}return l-1"+("true"===o?":("+e+")":":_q("+e+","+o+")")),zn(t,"change","var $$a="+e+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+s+");if(Array.isArray($$a)){var $$v="+(n?"_n("+r+")":r)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Xn(e,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Xn(e,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Xn(e,"$$c")+"}",null,!0)}(t,n,r);else if("input"===o&&"radio"===s)!function(t,e,i){var n=i&&i.number,r=Vn(t,"value")||"null";Dn(t,"checked","_q("+e+","+(r=n?"_n("+r+")":r)+")"),zn(t,"change",Xn(e,r),null,!0)}(t,n,r);else if("input"===o||"textarea"===o)!function(t,e,i){var n=t.attrsMap.type;0;var r=i||{},o=r.lazy,s=r.number,a=r.trim,l=!o&&"range"!==n,u=o?"change":"range"===n?er:"input",h="$event.target.value";a&&(h="$event.target.value.trim()");s&&(h="_n("+h+")");var c=Xn(e,h);l&&(c="if($event.target.composing)return;"+c);Dn(t,"value","("+e+")"),zn(t,u,c,null,!0),(a||s)&&zn(t,"blur","$forceUpdate()")}(t,n,r);else{if(!U.isReservedTag(o))return Kn(t,n,r),!1}return!0},text:function(t,e){e.value&&Dn(t,"textContent","_s("+e.value+")",e)},html:function(t,e){e.value&&Dn(t,"innerHTML","_s("+e.value+")",e)}},isPreTag:function(t){return"pre"===t},isUnaryTag:Eo,mustUseProp:Ni,canBeLeftOpenTag:Io,isReservedTag:tn,getTagNamespace:en,staticKeys:function(t){return t.reduce((function(t,e){return t.concat(e.staticKeys||[])}),[]).join(",")}(Es)},ks=x((function(t){return m("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(t?","+t:""))}));function Rs(t,e){t&&(Is=ks(e.staticKeys||""),As=e.isReservedTag||F,Ls(t),Fs(t,!1))}function Ls(t){if(t.static=function(t){if(2===t.type)return!1;if(3===t.type)return!0;return!(!t.pre&&(t.hasBindings||t.if||t.for||v(t.tag)||!As(t.tag)||function(t){for(;t.parent;){if("template"!==(t=t.parent).tag)return!1;if(t.for)return!0}return!1}(t)||!Object.keys(t).every(Is)))}(t),1===t.type){if(!As(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var e=0,i=t.children.length;e|^function(?:\s+[\w$]+)?\s*\(/,Os=/\([^)]*?\);*$/,$s=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Ds={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},js={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},Ns=function(t){return"if("+t+")return null;"},Bs={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Ns("$event.target !== $event.currentTarget"),ctrl:Ns("!$event.ctrlKey"),shift:Ns("!$event.shiftKey"),alt:Ns("!$event.altKey"),meta:Ns("!$event.metaKey"),left:Ns("'button' in $event && $event.button !== 0"),middle:Ns("'button' in $event && $event.button !== 1"),right:Ns("'button' in $event && $event.button !== 2")};function Us(t,e){var i=e?"nativeOn:":"on:",n="",r="";for(var o in t){var s=zs(t[o]);t[o]&&t[o].dynamic?r+=o+","+s+",":n+='"'+o+'":'+s+","}return n="{"+n.slice(0,-1)+"}",r?i+"_d("+n+",["+r.slice(0,-1)+"])":i+n}function zs(t){if(!t)return"function(){}";if(Array.isArray(t))return"["+t.map((function(t){return zs(t)})).join(",")+"]";var e=$s.test(t.value),i=Ms.test(t.value),n=$s.test(t.value.replace(Os,""));if(t.modifiers){var r="",o="",s=[];for(var a in t.modifiers)if(Bs[a])o+=Bs[a],Ds[a]&&s.push(a);else if("exact"===a){var l=t.modifiers;o+=Ns(["ctrl","shift","alt","meta"].filter((function(t){return!l[t]})).map((function(t){return"$event."+t+"Key"})).join("||"))}else s.push(a);return s.length&&(r+=function(t){return"if(!$event.type.indexOf('key')&&"+t.map(Vs).join("&&")+")return null;"}(s)),o&&(r+=o),"function($event){"+r+(e?"return "+t.value+"($event)":i?"return ("+t.value+")($event)":n?"return "+t.value:t.value)+"}"}return e||i?t.value:"function($event){"+(n?"return "+t.value:t.value)+"}"}function Vs(t){var e=parseInt(t,10);if(e)return"$event.keyCode!=="+e;var i=Ds[t],n=js[t];return"_k($event.keyCode,"+JSON.stringify(t)+","+JSON.stringify(i)+",$event.key,"+JSON.stringify(n)+")"}var Gs={on:function(t,e){t.wrapListeners=function(t){return"_g("+t+","+e.value+")"}},bind:function(t,e){t.wrapData=function(i){return"_b("+i+",'"+t.tag+"',"+e.value+","+(e.modifiers&&e.modifiers.prop?"true":"false")+(e.modifiers&&e.modifiers.sync?",true":"")+")"}},cloak:L},qs=function(t){this.options=t,this.warn=t.warn||On,this.transforms=$n(t.modules,"transformCode"),this.dataGenFns=$n(t.modules,"genData"),this.directives=k(k({},Gs),t.directives);var e=t.isReservedTag||F;this.maybeComponent=function(t){return!!t.component||!e(t.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Ws(t,e){var i=new qs(e);return{render:"with(this){return "+(t?Ks(t,i):'_c("div")')+"}",staticRenderFns:i.staticRenderFns}}function Ks(t,e){if(t.parent&&(t.pre=t.pre||t.parent.pre),t.staticRoot&&!t.staticProcessed)return Xs(t,e);if(t.once&&!t.onceProcessed)return Ys(t,e);if(t.for&&!t.forProcessed)return Js(t,e);if(t.if&&!t.ifProcessed)return Hs(t,e);if("template"!==t.tag||t.slotTarget||e.pre){if("slot"===t.tag)return function(t,e){var i=t.slotName||'"default"',n=ia(t,e),r="_t("+i+(n?","+n:""),o=t.attrs||t.dynamicAttrs?oa((t.attrs||[]).concat(t.dynamicAttrs||[]).map((function(t){return{name:C(t.name),value:t.value,dynamic:t.dynamic}}))):null,s=t.attrsMap["v-bind"];!o&&!s||n||(r+=",null");o&&(r+=","+o);s&&(r+=(o?"":",null")+","+s);return r+")"}(t,e);var i;if(t.component)i=function(t,e,i){var n=e.inlineTemplate?null:ia(e,i,!0);return"_c("+t+","+Qs(e,i)+(n?","+n:"")+")"}(t.component,t,e);else{var n;(!t.plain||t.pre&&e.maybeComponent(t))&&(n=Qs(t,e));var r=t.inlineTemplate?null:ia(t,e,!0);i="_c('"+t.tag+"'"+(n?","+n:"")+(r?","+r:"")+")"}for(var o=0;o>>0}(s):"")+")"}(t,t.scopedSlots,e)+","),t.model&&(i+="model:{value:"+t.model.value+",callback:"+t.model.callback+",expression:"+t.model.expression+"},"),t.inlineTemplate){var o=function(t,e){var i=t.children[0];0;if(i&&1===i.type){var n=Ws(i,e.options);return"inlineTemplate:{render:function(){"+n.render+"},staticRenderFns:["+n.staticRenderFns.map((function(t){return"function(){"+t+"}"})).join(",")+"]}"}}(t,e);o&&(i+=o+",")}return i=i.replace(/,$/,"")+"}",t.dynamicAttrs&&(i="_b("+i+',"'+t.tag+'",'+oa(t.dynamicAttrs)+")"),t.wrapData&&(i=t.wrapData(i)),t.wrapListeners&&(i=t.wrapListeners(i)),i}function ta(t){return 1===t.type&&("slot"===t.tag||t.children.some(ta))}function ea(t,e){var i=t.attrsMap["slot-scope"];if(t.if&&!t.ifProcessed&&!i)return Hs(t,e,ea,"null");if(t.for&&!t.forProcessed)return Js(t,e,ea);var n=t.slotScope===ps?"":String(t.slotScope),r="function("+n+"){return "+("template"===t.tag?t.if&&i?"("+t.if+")?"+(ia(t,e)||"undefined")+":undefined":ia(t,e)||"undefined":Ks(t,e))+"}",o=n?"":",proxy:true";return"{key:"+(t.slotTarget||'"default"')+",fn:"+r+o+"}"}function ia(t,e,i,n,r){var o=t.children;if(o.length){var s=o[0];if(1===o.length&&s.for&&"template"!==s.tag&&"slot"!==s.tag){var a=i?e.maybeComponent(s)?",1":",0":"";return""+(n||Ks)(s,e)+a}var l=i?function(t,e){for(var i=0,n=0;n':'
',ha.innerHTML.indexOf(" ")>0}var pa=!!X&&fa(!1),ga=!!X&&fa(!0),ma=x((function(t){var e=on(t);return e&&e.innerHTML})),va=Pi.prototype.$mount;Pi.prototype.$mount=function(t,e){if((t=t&&on(t))===document.body||t===document.documentElement)return this;var i=this.$options;if(!i.render){var n=i.template;if(n)if("string"==typeof n)"#"===n.charAt(0)&&(n=ma(n));else{if(!n.nodeType)return this;n=n.innerHTML}else t&&(n=function(t){if(t.outerHTML)return t.outerHTML;var e=document.createElement("div");return e.appendChild(t.cloneNode(!0)),e.innerHTML}(t));if(n){0;var r=da(n,{outputSourceRange:!1,shouldDecodeNewlines:pa,shouldDecodeNewlinesForHref:ga,delimiters:i.delimiters,comments:i.comments},this),o=r.render,s=r.staticRenderFns;i.render=o,i.staticRenderFns=s}}return va.call(this,t,e)},Pi.compile=da;const ya=Pi;function _a(t){this.state=2,this.value=void 0,this.deferred=[];var e=this;try{t((function(t){e.resolve(t)}),(function(t){e.reject(t)}))}catch(t){e.reject(t)}}_a.reject=function(t){return new _a((function(e,i){i(t)}))},_a.resolve=function(t){return new _a((function(e,i){e(t)}))},_a.all=function(t){return new _a((function(e,i){var n=0,r=[];function o(i){return function(o){r[i]=o,(n+=1)===t.length&&e(r)}}0===t.length&&e(r);for(var s=0;s=200&&o<300,this.status=o||0,this.statusText=s||"",this.headers=new el(r),this.body=t,La(t)?this.bodyText=t:(i=t,"undefined"!=typeof Blob&&i instanceof Blob&&(this.bodyBlob=t,function(t){return 0===t.type.indexOf("text")||-1!==t.type.indexOf("json")}(t)&&(this.bodyText=function(t){return new wa((function(e){var i=new FileReader;i.readAsText(t),i.onload=function(){e(i.result)}}))}(t))))}var e=t.prototype;return e.blob=function(){return $a(this.bodyBlob)},e.text=function(){return $a(this.bodyText)},e.json=function(){return $a(this.text(),(function(t){return JSON.parse(t)}))},t}();Object.defineProperty(nl.prototype,"data",{get:function(){return this.body},set:function(t){this.body=t}});var rl=function(){function t(t){this.body=null,this.params={},Na(this,t,{method:ka(t.method||"GET")}),this.headers instanceof el||(this.headers=new el(this.headers))}var e=t.prototype;return e.getUrl=function(){return Ka(this)},e.getBody=function(){return this.body},e.respondWith=function(t,e){return new nl(t,Na(e||{},{url:this.getUrl()}))},t}(),ol={"Content-Type":"application/json;charset=utf-8"};function sl(t){var e=this||{},i=function(t){var e=[tl],i=[];function n(n){for(;e.length;){var r=e.pop();if(Fa(r)){var o=function(){var e=void 0,o=void 0;if(Ma(e=r.call(t,n,(function(t){return o=t}))||o))return{v:new wa((function(n,r){i.forEach((function(i){e=$a(e,(function(e){return i.call(t,e)||e}),r)})),$a(e,n,r)}),t)};Fa(e)&&i.unshift(e)}();if("object"==typeof o)return o.v}else s="Invalid interceptor of type "+typeof r+", must be a function","undefined"!=typeof console&&Ea&&console.warn("[VueResource warn]: "+s)}var s}return Ma(t)||(t=null),n.use=function(t){e.push(t)},n}(e.$vm);return function(t){Ta.call(arguments,1).forEach((function(e){for(var i in e)void 0===t[i]&&(t[i]=e[i])}))}(t||{},e.$options,sl.options),sl.interceptors.forEach((function(t){La(t)&&(t=sl.interceptor[t]),Fa(t)&&i.use(t)})),i(new rl(t)).then((function(t){return t.ok?t:wa.reject(t)}),(function(t){var e;return t instanceof Error&&(e=t,"undefined"!=typeof console&&console.error(e)),wa.reject(t)}))}function al(t,e,i,n){var r=this||{},o={};return ja(i=Na({},al.actions,i),(function(i,s){i=Ba({url:t,params:Na({},e)},n,i),o[s]=function(){return(r.$http||sl)(ll(i,arguments))}})),o}function ll(t,e){var i,n=Na({},t),r={};switch(e.length){case 2:r=e[0],i=e[1];break;case 1:/^(POST|PUT|PATCH)$/i.test(n.method)?i=e[0]:r=e[0];break;case 0:break;default:throw"Expected up to 2 arguments [params, body], got "+e.length+" arguments"}return n.body=i,n.params=Na({},n.params,r),n}function ul(t){ul.installed||(!function(t){var e=t.config,i=t.nextTick;Sa=i,Ea=e.debug||!e.silent}(t),t.url=Ka,t.http=sl,t.resource=al,t.Promise=wa,Object.defineProperties(t.prototype,{$url:{get:function(){return Da(t.url,this,this.$options.url)}},$http:{get:function(){return Da(t.http,this,this.$options.http)}},$resource:{get:function(){return t.resource.bind(this)}},$promise:{get:function(){var e=this;return function(i){return new t.Promise(i,e)}}}}))}sl.options={},sl.headers={put:ol,post:ol,patch:ol,delete:ol,common:{Accept:"application/json, text/plain, */*"},custom:{}},sl.interceptor={before:function(t){Fa(t.before)&&t.before.call(this,t)},method:function(t){t.emulateHTTP&&/^(PUT|PATCH|DELETE)$/i.test(t.method)&&(t.headers.set("X-HTTP-Method-Override",t.method),t.method="POST")},jsonp:function(t){"JSONP"==t.method&&(t.client=Za)},json:function(t){var e=t.headers.get("Content-Type")||"";return Ma(t.body)&&0===e.indexOf("application/json")&&(t.body=JSON.stringify(t.body)),function(t){return t.bodyText?$a(t.text(),(function(e){if(0===(t.headers.get("Content-Type")||"").indexOf("application/json")||function(t){var e=t.match(/^\s*(\[|\{)/),i={"[":/]\s*$/,"{":/}\s*$/};return e&&i[e[1]].test(t)}(e))try{t.body=JSON.parse(e)}catch(e){t.body=null}else t.body=e;return t})):t}},form:function(t){var e;e=t.body,"undefined"!=typeof FormData&&e instanceof FormData?t.headers.delete("Content-Type"):Ma(t.body)&&t.emulateJSON&&(t.body=Ka.params(t.body),t.headers.set("Content-Type","application/x-www-form-urlencoded"))},header:function(t){ja(Na({},sl.headers.common,t.crossOrigin?{}:sl.headers.custom,sl.headers[Pa(t.method)]),(function(e,i){t.headers.has(i)||t.headers.set(i,e)}))},cors:function(t){if(Ia){var e=Ka.parse(location.href),i=Ka.parse(t.getUrl());i.protocol===e.protocol&&i.host===e.host||(t.crossOrigin=!0,t.emulateHTTP=!1,Ha||(t.client=Ya))}}},sl.interceptors=["before","method","jsonp","json","form","header","cors"],["get","delete","head","jsonp"].forEach((function(t){sl[t]=function(e,i){return this(Na(i||{},{url:e,method:t}))}})),["post","put","patch"].forEach((function(t){sl[t]=function(e,i,n){return this(Na(n||{},{url:e,method:t,body:i}))}})),al.actions={get:{method:"GET"},save:{method:"POST"},query:{method:"GET"},update:{method:"PUT"},remove:{method:"DELETE"},delete:{method:"DELETE"}},"undefined"!=typeof window&&window.Vue&&!window.Vue.resource&&window.Vue.use(ul);const hl=ul;window.Vue=ya,window.Vue.use(hl);var cl=function(t,e){window.addEventListener("load",(function(){var i=document.getElementById(t);i&&(e instanceof Vue||(e=new Vue(e)),e.$mount(i))}))},dl=function(t){t=Array.isArray(t)?t:t.split("."),window.biigle||(window.biigle={});for(var e=window.biigle,i=0,n=t.length;i=0;i--)if(!1===t[i].callback(e))return},on:function(t,e,i,n){var r=this,o=(t=this.prepareKeys(t)).join("+");this.compatibilityMaps.forEach((function(s){var a=t.map((function(t){return s.hasOwnProperty(t)?s[t]:t}));o!==a.join("+")&&r.on(a,e,i,n)}));var s={callback:e,priority:i=i||0};n=n||"default",this.listenerSets.hasOwnProperty(n)||(this.listenerSets[n]={});var a=this.listenerSets[n];if(a.hasOwnProperty(o)){var l,u=a[o];for(l=0;l=i);l++);l===u.length-1?u.push(s):u.splice(l,0,s)}else a[o]=[s]},off:function(t,e,i){t=this.prepareKeys(t).join("+"),i=i||"default";var n=this.listenerSets[i];if(n&&n.hasOwnProperty(t))for(var r=n[t],o=r.length-1;o>=0;o--)if(r[o].callback===e){r.splice(o,1);break}},setActiveSet:function(t){this.activeListenerSetName=t}},created:function(){document.body.addEventListener("keydown",this.handleKeyDown),document.body.addEventListener("keyup",this.handleKeyUp),window.addEventListener("focus",this.clearPressedKeys)}}),undefined,undefined,!1,null,null,null).exports;const Rl=Sl({components:{sidebarButton:Al},data:function(){return{open:!1,tabs:[],lastOpenedTab:null,tabIdSequence:0}},props:{openTab:{type:String},showButtons:{type:Boolean,default:!0},direction:{type:String,default:"right",validator:function(t){return"left"===t||"right"===t}},toggleOnKeyboard:{type:Boolean,default:!1}},computed:{classObject:function(){return{"sidebar--open":this.open,"sidebar--left":this.isLeft,"sidebar--right":!this.isLeft}},isLeft:function(){return"left"===this.direction}},methods:{registerTab:function(t){t.id=this.tabIdSequence++,this.tabs.push(t)},handleOpenTab:function(t){this.open=!0,this.lastOpenedTab=t,this.$emit("toggle",t),Pl.$emit("sidebar.toggle",t),Pl.$emit("sidebar.open.".concat(t))},handleCloseTab:function(t){this.open=!1,this.$emit("toggle",t),Pl.$emit("sidebar.toggle",t),Pl.$emit("sidebar.close.".concat(t))},toggleLastOpenedTab:function(t){this.open?(t.preventDefault(),this.$emit("close",this.lastOpenedTab)):this.lastOpenedTab?(t.preventDefault(),this.$emit("open",this.lastOpenedTab)):this.tabs.length>0&&(t.preventDefault(),this.$emit("open",this.tabs[0].name))}},watch:{openTab:function(t){this.$emit("open",t)}},created:function(){this.$on("open",this.handleOpenTab),this.$on("close",this.handleCloseTab),this.toggleOnKeyboard&&kl.on("Tab",this.toggleLastOpenedTab)},mounted:function(){this.openTab&&this.$emit("open",this.openTab)}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("aside",{staticClass:"sidebar",class:t.classObject},[t.showButtons?i("div",{staticClass:"sidebar__buttons"},t._l(t.tabs,(function(e){return i("sidebar-button",{key:e.id,attrs:{tab:e,direction:t.direction}})})),1):t._e(),t._v(" "),i("div",{staticClass:"sidebar__tabs"},[t._t("default")],2)])}),[],!1,null,null,null).exports;const Ll=Sl({data:function(){return{id:null,open:!1}},props:{name:{type:String,required:!0},icon:{type:String,required:!0},title:{type:String},href:{type:String},disabled:{type:Boolean,default:!1},highlight:{default:!1}},computed:{classObject:function(){return{"sidebar__tab--open":this.open}}},beforeCreate:function(){var t=this;this.$parent.$on("open",(function(e){t.open=e===t.name})),this.$parent.$on("close",(function(){t.open=!1})),this.$parent.registerTab(this)}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"sidebar__tab",class:t.classObject},[t._t("default")],2)}),[],!1,null,null,null).exports;function Fl(t){return null!=t}function Ml(t){return"string"==typeof t}var Ol="focus",$l="blur",Dl="click",jl="input",Nl="keydown",Bl="touchend";function Ul(t,e,i){t.addEventListener(e,i)}function zl(t,e,i){t.removeEventListener(e,i)}function Vl(t){return t&&t.nodeType===Node.ELEMENT_NODE}function Gl(t){Vl(t)&&(!t.getAttribute("tabindex")&&t.setAttribute("tabindex","-1"),t.focus())}function ql(t,e,i,n,r,o,s,a,l,u){"boolean"!=typeof s&&(l=a,a=s,s=!1);var h,c="function"==typeof i?i.options:i;if(t&&t.render&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),n&&(c._scopeId=n),o?(h=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=h):e&&(h=s?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),h)if(c.functional){var d=c.render;c.render=function(t,e){return h.call(e),d(t,e)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,h):[h]}return i}var Wl={components:{Dropdown:{render:function(t){return t(this.tag,{class:{"btn-group":"div"===this.tag,dropdown:!this.dropup,dropup:this.dropup,open:this.show}},[this.$slots.default,t("ul",{class:{"dropdown-menu":!0,"dropdown-menu-right":this.menuRight},ref:"dropdown"},[this.$slots.dropdown])])},props:{tag:{type:String,default:"div"},appendToBody:{type:Boolean,default:!1},value:Boolean,dropup:{type:Boolean,default:!1},menuRight:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},notCloseElements:Array,positionElement:null},data:function(){return{show:!1,triggerEl:void 0}},watch:{value:function(t){this.toggle(t)}},mounted:function(){this.initTrigger(),this.triggerEl&&(Ul(this.triggerEl,Dl,this.toggle),Ul(this.triggerEl,Nl,this.onKeyPress)),Ul(this.$refs.dropdown,Nl,this.onKeyPress),Ul(window,Dl,this.windowClicked),Ul(window,Bl,this.windowClicked),this.value&&this.toggle(!0)},beforeDestroy:function(){this.removeDropdownFromBody(),this.triggerEl&&(zl(this.triggerEl,Dl,this.toggle),zl(this.triggerEl,Nl,this.onKeyPress)),zl(this.$refs.dropdown,Nl,this.onKeyPress),zl(window,Dl,this.windowClicked),zl(window,Bl,this.windowClicked)},methods:{getFocusItem:function(){return this.$refs.dropdown.querySelector("li > a:focus")},onKeyPress:function(t){if(this.show){var e=this.$refs.dropdown,i=t.keyCode;if(27===i)this.toggle(!1),this.triggerEl&&this.triggerEl.focus();else if(13===i){var n=this.getFocusItem();n&&n.click()}else if(38===i||40===i){t.preventDefault(),t.stopPropagation();var r=this.getFocusItem(),o=e.querySelectorAll("li:not(.disabled) > a");if(r){for(var s=0;s0?Gl(o[s-1]):40===i&&s=0;s=o||a&&l}if(s){i=!0;break}}var u=this.$refs.dropdown.contains(e),h=this.$el.contains(e)&&!u,c=u&&"touchend"===t.type;h||i||c||this.toggle(!1)}},appendDropdownToBody:function(){try{var t=this.$refs.dropdown;t.style.display="block",document.body.appendChild(t),function(t,e,i){void 0===i&&(i={});var n=document.documentElement,r=(window.pageXOffset||n.scrollLeft)-(n.clientLeft||0),o=(window.pageYOffset||n.scrollTop)-(n.clientTop||0),s=e.getBoundingClientRect(),a=t.getBoundingClientRect();t.style.right="auto",t.style.bottom="auto",i.menuRight?t.style.left=r+s.left+s.width-a.width+"px":t.style.left=r+s.left+"px",i.dropup?t.style.top=o+s.top-a.height-4+"px":t.style.top=o+s.top+s.height+"px"}(t,this.positionElement||this.$el,this)}catch(t){}},removeDropdownFromBody:function(){try{var t=this.$refs.dropdown;t.removeAttribute("style"),this.$el.appendChild(t)}catch(t){}}}}},props:{value:{required:!0},data:Array,itemKey:String,appendToBody:{type:Boolean,default:!1},ignoreCase:{type:Boolean,default:!0},matchStart:{type:Boolean,default:!1},forceSelect:{type:Boolean,default:!1},forceClear:{type:Boolean,default:!1},limit:{type:Number,default:10},asyncSrc:String,asyncKey:String,asyncFunction:Function,debounce:{type:Number,default:200},openOnFocus:{type:Boolean,default:!0},openOnEmpty:{type:Boolean,default:!1},target:{required:!0},preselect:{type:Boolean,default:!0}},data:function(){return{inputEl:null,items:[],activeIndex:0,timeoutID:0,elements:[],open:!1,dropdownMenuEl:null}},computed:{regexOptions:function(){var t="";return this.ignoreCase&&(t+="i"),this.matchStart||(t+="g"),t}},mounted:function(){var t=this;Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(t){for(var e=(this.document||this.ownerDocument).querySelectorAll(t),i=e.length;--i>=0&&e.item(i)!==this;);return i>-1}),this.$nextTick((function(){t.initInputElByTarget(t.target),t.initListeners(),t.dropdownMenuEl=t.$refs.dropdown.$el.querySelector(".dropdown-menu"),t.value&&t.setInputTextByValue(t.value)}))},beforeDestroy:function(){this.removeListeners()},watch:{target:function(t){this.removeListeners(),this.initInputElByTarget(t),this.initListeners()},value:function(t){this.setInputTextByValue(t)}},methods:{setInputTextByValue:function(t){Ml(t)?this.inputEl.value=t:t?this.inputEl.value=this.itemKey?t[this.itemKey]:t:null===t&&(this.inputEl.value="")},hasEmptySlot:function(){return!!this.$slots.empty||!!this.$scopedSlots.empty},initInputElByTarget:function(t){var e;t&&(this.inputEl=Ml(e=t)?document.querySelector(e):Vl(e)?e:Vl(e.$el)?e.$el:null)},initListeners:function(){this.inputEl&&(this.elements=[this.inputEl],Ul(this.inputEl,Ol,this.inputFocused),Ul(this.inputEl,$l,this.inputBlured),Ul(this.inputEl,jl,this.inputChanged),Ul(this.inputEl,Nl,this.inputKeyPressed))},removeListeners:function(){this.elements=[],this.inputEl&&(zl(this.inputEl,Ol,this.inputFocused),zl(this.inputEl,$l,this.inputBlured),zl(this.inputEl,jl,this.inputChanged),zl(this.inputEl,Nl,this.inputKeyPressed))},prepareItems:function(t,e){if(void 0===e&&(e=!1),e)this.items=t.slice(0,this.limit);else{this.items=[],this.activeIndex=this.preselect?0:-1;for(var i=0,n=t.length;i=0)&&this.items.push(r),this.items.length>=this.limit)break}}},fetchItems:function(t,e){var i=this;if(clearTimeout(this.timeoutID),""!==t||this.openOnEmpty){if(this.data)this.prepareItems(this.data),this.open=this.hasEmptySlot()||Boolean(this.items.length);else if(this.asyncSrc)this.timeoutID=setTimeout((function(){i.$emit("loading"),function(t,e){void 0===e&&(e="GET");var i=new window.XMLHttpRequest,n={},r={then:function(t,e){return r.done(t).fail(e)},catch:function(t){return r.fail(t)},always:function(t){return r.done(t).fail(t)}};return["done","fail"].forEach((function(t){n[t]=[],r[t]=function(e){return e instanceof Function&&n[t].push(e),r}})),r.done(JSON.parse),i.onreadystatechange=function(){if(4===i.readyState){var t={status:i.status};if(200===i.status){var e=i.responseText;for(var r in n.done)if(s=n.done,a=r,Object.prototype.hasOwnProperty.call(s,a)&&"function"==typeof n.done[r]){var o=n.done[r](e);Fl(o)&&(e=o)}}else n.fail.forEach((function(e){return e(t)}))}var s,a},i.open(e,t),i.setRequestHeader("Accept","application/json"),i.send(),r}(i.asyncSrc+encodeURIComponent(t)).then((function(t){i.inputEl.matches(":focus")&&(i.prepareItems(i.asyncKey?t[i.asyncKey]:t,!0),i.open=i.hasEmptySlot()||Boolean(i.items.length)),i.$emit("loaded")})).catch((function(t){console.error(t),i.$emit("loaded-error")}))}),e);else if(this.asyncFunction){var n=function(t){i.inputEl.matches(":focus")&&(i.prepareItems(t,!0),i.open=i.hasEmptySlot()||Boolean(i.items.length)),i.$emit("loaded")};this.timeoutID=setTimeout((function(){i.$emit("loading"),i.asyncFunction(t,n)}),e)}}else this.open=!1},inputChanged:function(){var t=this.inputEl.value;this.fetchItems(t,this.debounce),this.$emit("input",this.forceSelect?void 0:t)},inputFocused:function(){if(this.openOnFocus){var t=this.inputEl.value;this.fetchItems(t,0)}},inputBlured:function(){var t=this;this.dropdownMenuEl.matches(":hover")||(this.open=!1),this.inputEl&&this.forceClear&&this.$nextTick((function(){void 0===t.value&&(t.inputEl.value="")}))},inputKeyPressed:function(t){if(t.stopPropagation(),this.open)switch(t.keyCode){case 13:this.activeIndex>=0?this.selectItem(this.items[this.activeIndex]):this.open=!1,t.preventDefault();break;case 27:this.open=!1;break;case 38:this.activeIndex=this.activeIndex>0?this.activeIndex-1:0;break;case 40:var e=this.items.length-1;this.activeIndex=this.activeIndex$&")}}},Kl=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("dropdown",{ref:"dropdown",attrs:{tag:"section","append-to-body":t.appendToBody,"not-close-elements":t.elements,"position-element":t.inputEl},model:{value:t.open,callback:function(e){t.open=e},expression:"open"}},[i("template",{slot:"dropdown"},[t._t("item",t._l(t.items,(function(e,n){return i("li",{class:{active:t.activeIndex===n}},[i("a",{attrs:{href:"#"},on:{click:function(i){return i.preventDefault(),t.selectItem(e)}}},[i("span",{domProps:{innerHTML:t._s(t.highlight(e))}})])])})),{items:t.items,activeIndex:t.activeIndex,select:t.selectItem,highlight:t.highlight}),t._v(" "),t.items&&0!==t.items.length?t._e():t._t("empty")],2)],2)};Kl._withStripped=!0;const Xl=ql({render:Kl,staticRenderFns:[]},undefined,Wl,undefined,false,undefined,!1,void 0,void 0,void 0);var Yl=Sl({props:{props:{type:Object,required:!0},item:{type:Object,required:!0},itemKey:{type:String,default:""}},computed:{info:function(){return this.itemKey?this.itemKey.split(".").reduce((function(t,e){return t?t[e]:t}),this.item):""}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("li",[i("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.props.select(t.item)}}},[i("span",{domProps:{innerHTML:t._s(t.props.highlight(t.item))}}),t._v(" "),t.info?i("span",[i("br"),i("small",{staticClass:"typeahead-item-info",attrs:{title:t.info},domProps:{textContent:t._s(t.info)}})]):t._e()])])}),[],!1,null,null,null);function Hl(t){return(Hl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}const Zl=Sl({components:{typeahead:Xl,typeaheadItem:Yl.exports},props:{items:{type:Array,required:!0},placeholder:{type:String,default:"Item name"},disabled:{type:Boolean,default:!1},value:{type:String,default:""},clearOnSelect:{type:Boolean,default:!1},moreInfo:{type:String,default:""},limit:{type:Number,default:5}},data:function(){return{inputElement:null,internalValue:void 0}},methods:{clear:function(){this.internalValue=void 0,this.$refs.input.value=""},emitFocus:function(t){this.$emit("focus",t)},emitBlur:function(t){this.$emit("blur",t)}},watch:{internalValue:function(t){"object"===Hl(t)&&(this.$emit("input",t),this.$emit("select",t),this.clearOnSelect&&this.clear())},value:function(t){this.internalValue=t}},created:function(){this.internalValue=this.value},mounted:function(){this.inputElement=this.$refs.input}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"typeahead clearfix"},[i("input",{ref:"input",staticClass:"form-control",attrs:{type:"text",disabled:t.disabled,placeholder:t.placeholder},on:{focus:t.emitFocus,blue:t.emitBlur}}),t._v(" "),i("typeahead",{attrs:{target:t.inputElement,data:t.items,"force-select":!0,limit:t.limit,"item-key":"name"},scopedSlots:t._u([{key:"item",fn:function(e){return t._l(e.items,(function(n,r){return i("typeahead-item",{key:r,class:{active:e.activeIndex===r},attrs:{props:e,item:n,"item-key":t.moreInfo}})}))}}]),model:{value:t.internalValue,callback:function(e){t.internalValue=e},expression:"internalValue"}})],1)}),[],!1,null,null,null).exports;var Jl={},Ql=function(t,e,i){Jl.hasOwnProperty(i)&&window.clearTimeout(Jl[i]),Jl[i]=window.setTimeout(t,e)},tu=new Vue({data:{params:{}},methods:{setSlug:function(t,e){e=e||-1;var i=window.location.pathname.replace(/\/$/,""),n=i.split("/");n.splice(e,1,t),n=n.join("/"),this.replaceState(window.location.href.replace(i,n))},set:function(t){this.params=t,this.updateSearch()},unset:function(t){delete this.params[t],this.updateSearch()},get:function(t){return this.params[t]},updateSearch:function(){var t=[],e=window.location.href;for(var i in this.params)this.params.hasOwnProperty(i)&&t.push(i+"="+this.params[i]);t=t.length>0?"?"+t.join("&"):"",window.location.search?this.replaceState(e.replace(window.location.search,t)):-1!==e.indexOf("#")?window.location.hash?this.replaceState(e.replace(window.location.hash,t+window.location.hash)):this.replaceState(e.slice(0,-1)+t):this.replaceState(e+t)},replaceState:function(t){history.replaceState(null,null,t)}},created:function(){var t=window.location.search.substr(1);if(t)for(var e,i=(t=t.split("&")).length-1;i>=0;i--)e=t[i].split("="),this.params[e[0]]=e[1]}}),eu={},iu={},nu=function(t,e,i){iu[i]=t,eu.hasOwnProperty(i)||(eu[i]=window.setTimeout((function(){iu[i](),delete eu[i]}),e))},ru=function(t){return"string"!=typeof t?"":t.charAt(0).toUpperCase()+t.slice(1)},ou=new Vue({data:{max:1,all:[]},methods:{post:function(t,e){document.fullscreenElement&&(document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()),this.all.unshift({id:Date.now(),type:t,text:e}),this.all.length>this.max&&this.all.pop()},danger:function(t){this.post("danger",t)},warning:function(t){this.post("warning",t)},success:function(t){this.post("success",t)},info:function(t){this.post("info",t)},close:function(t){for(var e=this.all.length-1;e>=0;e--)this.all[e].id===t&&this.all.splice(e,1)},handleErrorResponse:function(t){var e=t.body;if(e){if(422===t.status&&e.errors){for(var i in e.errors)this.danger(e.errors[i][0]);return}if(e.message)return void this.danger(e.message);if("string"==typeof e)return void this.danger(e)}403===t.status?this.danger("You have no permission to do that."):401===t.status?this.danger("Please log in (again)."):this.danger("The server didn't respond, sorry.")},handleResponseError:function(t){return this.handleErrorResponse(t)}}}),su=ou.handleErrorResponse;const au=Sl(ou,undefined,undefined,!1,null,null,null).exports;const lu=Sl({data:function(){return{editing:!1}},methods:{startEditing:function(){this.editing=!0,this.$emit("editing.start")},finishEditing:function(){this.editing=!1,this.$emit("editing.stop")},toggleEditing:function(){this.editing?this.finishEditing():this.startEditing()}}},undefined,undefined,!1,null,null,null).exports;const uu=Sl({components:{loader:Cl,loaderBlock:El,messageCurtain:Tl},data:function(){return{instancesLoading:0}},computed:{loading:function(){return this.instancesLoading>0}},watch:{loading:function(t){this.$emit("loading",t)}},methods:{startLoading:function(){this.instancesLoading+=1},finishLoading:function(){this.instancesLoading>0&&(this.instancesLoading-=1)},handleErrorResponse:function(t){return au.handleErrorResponse(t)}}},undefined,undefined,!1,null,null,null).exports;const hu=Sl(Vue.extend({data:function(){return{urlParams:[],storageKey:"biigle.settings",defaults:{},data:{}}},methods:{set:function(t,e){e===this.defaults[t]?this.delete(t):this.has(t)?this.data[t]=e:Vue.set(this.data,t,e),Ql(this.persist,100,this.storageKey)},delete:function(t){Vue.delete(this.data,t),this.persist()},get:function(t){return this.has(t)?this.data[t]:this.defaults[t]},has:function(t){return this.data.hasOwnProperty(t)},persist:function(){Object.keys(this.data).length>0?window.localStorage.setItem(this.storageKey,JSON.stringify(this.data)):window.localStorage.removeItem(this.storageKey)},restoreFromLocalStorage:function(){var t=JSON.parse(window.localStorage.getItem(this.storageKey));t&&Vue.set(this,"data",t)},restoreFromUrlParams:function(t){var e=this,i=tu.params;(t=t||Object.keys(i)).forEach((function(t){i.hasOwnProperty(t)&&Vue.set(e.data,t,i[t])}))},watch:function(t,e){return this.$watch("data.".concat(t),e)}},created:function(){this.restoreFromLocalStorage(),this.urlParams.length>0&&this.restoreFromUrlParams(this.urlParams)}}),undefined,undefined,!1,null,null,null).exports;function cu(t){return"function"==typeof t}function du(t){return"string"==typeof t}var fu="mouseenter",pu="mouseleave",gu="focus",mu="blur",vu="click",yu="click",_u="hover",bu="focus",wu="hover-focus",xu="outside-click",Su="top",Cu="right",Tu="bottom",Eu="left";function Iu(t,e,i){t.addEventListener(e,i)}function Au(t,e,i){t.removeEventListener(e,i)}function Pu(t){return t&&t.nodeType===Node.ELEMENT_NODE}function ku(t){Pu(t)&&Pu(t.parentNode)&&t.parentNode.removeChild(t)}function Ru(t,e){if(Pu(t))if(t.className){var i=t.className.split(" ");i.indexOf(e)<0&&(i.push(e),t.className=i.join(" "))}else t.className=e}function Lu(t,e){if(Pu(t)&&t.className){for(var i=t.className.split(" "),n=[],r=0,o=i.length;r=r.height,u=n.left+n.width/2>=r.width/2,a=n.right-n.width/2+r.width/2<=o.width;break;case Tu:l=n.bottom+r.height<=o.height,u=n.left+n.width/2>=r.width/2,a=n.right-n.width/2+r.width/2<=o.width;break;case Cu:a=n.right+r.width<=o.width,s=n.top+n.height/2>=r.height/2,l=n.bottom-n.height/2+r.height/2<=o.height;break;case Eu:u=n.left>=r.width,s=n.top+n.height/2>=r.height/2,l=n.bottom-n.height/2+r.height/2<=o.height}return s&&a&&l&&u}function Mu(){return document.querySelectorAll(".modal-backdrop").length}function Ou(t){return du(t)?document.querySelector(t):Pu(t)?t:Pu(t.$el)?t.$el:null}var $u="in";const Du={mixins:[{props:{value:{type:Boolean,default:!1},tag:{type:String,default:"span"},placement:{type:String,default:Su},autoPlacement:{type:Boolean,default:!0},appendTo:{type:null,default:"body"},positionBy:{type:null,default:null},transition:{type:Number,default:150},hideDelay:{type:Number,default:0},showDelay:{type:Number,default:0},enable:{type:Boolean,default:!0},enterable:{type:Boolean,default:!0},target:null,viewport:null,customClass:String},data:function(){return{triggerEl:null,hideTimeoutId:0,showTimeoutId:0,transitionTimeoutId:0,autoTimeoutId:0}},watch:{value:function(t){t?this.show():this.hide()},trigger:function(){this.clearListeners(),this.initListeners()},target:function(t){this.clearListeners(),this.initTriggerElByTarget(t),this.initListeners()},allContent:function(t){var e=this;this.isNotEmpty()?this.$nextTick((function(){e.isShown()&&e.resetPosition()})):this.hide()},enable:function(t){t||this.hide()}},mounted:function(){var t=this;Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(t){for(var e=(this.document||this.ownerDocument).querySelectorAll(t),i=e.length;--i>=0&&e.item(i)!==this;);return i>-1}),ku(this.$refs.popup),this.$nextTick((function(){t.initTriggerElByTarget(t.target),t.initListeners(),t.value&&t.show()}))},beforeDestroy:function(){this.clearListeners(),ku(this.$refs.popup)},methods:{initTriggerElByTarget:function(t){if(t)this.triggerEl=Ou(t);else{var e=this.$el.querySelector('[data-role="trigger"]');if(e)this.triggerEl=e;else{var i=this.$el.firstChild;this.triggerEl=i===this.$refs.popup?null:i}}},initListeners:function(){this.triggerEl&&(this.trigger===_u?(Iu(this.triggerEl,fu,this.show),Iu(this.triggerEl,pu,this.hide)):this.trigger===bu?(Iu(this.triggerEl,gu,this.show),Iu(this.triggerEl,mu,this.hide)):this.trigger===wu?(Iu(this.triggerEl,fu,this.handleAuto),Iu(this.triggerEl,pu,this.handleAuto),Iu(this.triggerEl,gu,this.handleAuto),Iu(this.triggerEl,mu,this.handleAuto)):this.trigger!==yu&&this.trigger!==xu||Iu(this.triggerEl,vu,this.toggle)),Iu(window,vu,this.windowClicked)},clearListeners:function(){this.triggerEl&&(Au(this.triggerEl,gu,this.show),Au(this.triggerEl,mu,this.hide),Au(this.triggerEl,fu,this.show),Au(this.triggerEl,pu,this.hide),Au(this.triggerEl,vu,this.toggle),Au(this.triggerEl,fu,this.handleAuto),Au(this.triggerEl,pu,this.handleAuto),Au(this.triggerEl,gu,this.handleAuto),Au(this.triggerEl,mu,this.handleAuto)),Au(window,vu,this.windowClicked),this.clearTimeouts()},clearTimeouts:function(){this.hideTimeoutId&&(clearTimeout(this.hideTimeoutId),this.hideTimeoutId=0),this.showTimeoutId&&(clearTimeout(this.showTimeoutId),this.showTimeoutId=0),this.transitionTimeoutId&&(clearTimeout(this.transitionTimeoutId),this.transitionTimeoutId=0),this.autoTimeoutId&&(clearTimeout(this.autoTimeoutId),this.autoTimeoutId=0)},resetPosition:function(){var t=this.$refs.popup;t&&(!function(t,e,i,n,r,o,s){if(Pu(t)&&Pu(e)){var a,l,u=t&&t.className&&t.className.indexOf("popover")>=0;if(null==r||"body"===r||"body"===o){var h=document.documentElement;l=(window.pageXOffset||h.scrollLeft)-(h.clientLeft||0),a=(window.pageYOffset||h.scrollTop)-(h.clientTop||0)}else{var c=Ou(o||r);l=c.scrollLeft,a=c.scrollTop}if(n){var d=[Cu,Tu,Eu,Su],f=function(e){d.forEach((function(e){Lu(t,e)})),Ru(t,e)};if(!Fu(e,t,i)){for(var p=0,g=d.length;pT&&(m=T-b.height),vE&&(v=E-b.width),i===Tu?m-=w:i===Eu?v+=w:i===Cu?v-=w:m+=w}t.style.top=m+"px",t.style.left=v+"px"}}(t,this.triggerEl,this.placement,this.autoPlacement,this.appendTo,this.positionBy,this.viewport),t.offsetHeight)},hideOnLeave:function(){(this.trigger===_u||this.trigger===wu&&!this.triggerEl.matches(":focus"))&&this.$hide()},toggle:function(){this.isShown()?this.hide():this.show()},show:function(){var t=this;if(this.enable&&this.triggerEl&&this.isNotEmpty()&&!this.isShown()){var e=this.hideTimeoutId>0;e&&(clearTimeout(this.hideTimeoutId),this.hideTimeoutId=0),this.transitionTimeoutId>0&&(clearTimeout(this.transitionTimeoutId),this.transitionTimeoutId=0),clearTimeout(this.showTimeoutId),this.showTimeoutId=setTimeout((function(){t.showTimeoutId=0;var i=t.$refs.popup;if(i){var n=Mu();if(n>1){var r="popover"===t.name?1060:1070,o=20*(n-1);i.style.zIndex=""+(r+o)}if(!e)i.className=t.name+" "+t.placement+" "+(t.customClass?t.customClass:"")+" fade",Ou(t.appendTo).appendChild(i),t.resetPosition();Ru(i,$u),t.$emit("input",!0),t.$emit("show")}}),this.showDelay)}},hide:function(){var t=this;this.showTimeoutId>0&&(clearTimeout(this.showTimeoutId),this.showTimeoutId=0),this.isShown()&&(!this.enterable||this.trigger!==_u&&this.trigger!==wu?this.$hide():(clearTimeout(this.hideTimeoutId),this.hideTimeoutId=setTimeout((function(){t.hideTimeoutId=0;var e=t.$refs.popup;e&&!e.matches(":hover")&&t.$hide()}),100)))},$hide:function(){var t=this;this.isShown()&&(clearTimeout(this.hideTimeoutId),this.hideTimeoutId=setTimeout((function(){t.hideTimeoutId=0,Lu(t.$refs.popup,$u),t.transitionTimeoutId=setTimeout((function(){t.transitionTimeoutId=0,ku(t.$refs.popup),t.$emit("input",!1),t.$emit("hide")}),t.transition)}),this.hideDelay))},isShown:function(){return function(t,e){if(!Pu(t))return!1;for(var i=t.className.split(" "),n=0,r=i.length;n1&&void 0!==arguments[1]&&arguments[1],i=t.to,n=t.from;if(i&&(n||!1!==e)&&this.transports[i])if(e)this.transports[i]=[];else{var r=this.$_getTransportIndex(t);if(r>=0){var o=this.transports[i].slice(0);o.splice(r,1),this.transports[i]=o}}},registerTarget:function(t,e,i){Vu&&(this.trackInstances&&!i&&this.targets[t]&&console.warn("[portal-vue]: Target ".concat(t," already exists")),this.$set(this.targets,t,Object.freeze([e])))},unregisterTarget:function(t){this.$delete(this.targets,t)},registerSource:function(t,e,i){Vu&&(this.trackInstances&&!i&&this.sources[t]&&console.warn("[portal-vue]: source ".concat(t," already exists")),this.$set(this.sources,t,Object.freeze([e])))},unregisterSource:function(t){this.$delete(this.sources,t)},hasTarget:function(t){return!(!this.targets[t]||!this.targets[t][0])},hasSource:function(t){return!(!this.sources[t]||!this.sources[t][0])},hasContentFor:function(t){return!!this.transports[t]&&!!this.transports[t].length},$_getTransportIndex:function(t){var e=t.to,i=t.from;for(var n in this.transports[e])if(this.transports[e][n].from===i)return+n;return-1}}}))(qu),Yu=1,Hu=ya.extend({name:"portal",props:{disabled:{type:Boolean},name:{type:String,default:function(){return String(Yu++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}}},created:function(){var t=this;this.$nextTick((function(){Xu.registerSource(t.name,t)}))},mounted:function(){this.disabled||this.sendUpdate()},updated:function(){this.disabled?this.clear():this.sendUpdate()},beforeDestroy:function(){Xu.unregisterSource(this.name),this.clear()},watch:{to:function(t,e){e&&e!==t&&this.clear(e),this.sendUpdate()}},methods:{clear:function(t){var e={from:this.name,to:t||this.to};Xu.close(e)},normalizeSlots:function(){return this.$scopedSlots.default?[this.$scopedSlots.default]:this.$slots.default},normalizeOwnChildren:function(t){return"function"==typeof t?t(this.slotProps):t},sendUpdate:function(){var t=this.normalizeSlots();if(t){var e={from:this.name,to:this.to,passengers:zu(t),order:this.order};Xu.open(e)}else this.clear()}},render:function(t){var e=this.$slots.default||this.$scopedSlots.default||[],i=this.tag;return e&&this.disabled?e.length<=1&&this.slim?this.normalizeOwnChildren(e)[0]:t(i,[this.normalizeOwnChildren(e)]):this.slim?t():t(i,{class:{"v-portal":!0},style:{display:"none"},key:"v-portal-placeholder"})}}),Zu=ya.extend({name:"portalTarget",props:{multiple:{type:Boolean,default:!1},name:{type:String,required:!0},slim:{type:Boolean,default:!1},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},data:function(){return{transports:Xu.transports,firstRender:!0}},created:function(){var t=this;this.$nextTick((function(){Xu.registerTarget(t.name,t)}))},watch:{ownTransports:function(){this.$emit("change",this.children().length>0)},name:function(t,e){Xu.unregisterTarget(e),Xu.registerTarget(t,this)}},mounted:function(){var t=this;this.transition&&this.$nextTick((function(){t.firstRender=!1}))},beforeDestroy:function(){Xu.unregisterTarget(this.name)},computed:{ownTransports:function(){var t=this.transports[this.name]||[];return this.multiple?t:0===t.length?[]:[t[t.length-1]]},passengers:function(){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.reduce((function(t,i){var n=i.passengers[0],r="function"==typeof n?n(e):i.passengers;return t.concat(r)}),[])}(this.ownTransports,this.slotProps)}},methods:{children:function(){return 0!==this.passengers.length?this.passengers:this.$scopedSlots.default?this.$scopedSlots.default(this.slotProps):this.$slots.default||[]},noWrapper:function(){var t=this.slim&&!this.transition;return t&&this.children().length>1&&console.warn("[portal-vue]: PortalTarget with `slim` option received more than one child element."),t}},render:function(t){var e=this.noWrapper(),i=this.children(),n=this.transition||this.tag;return e?i[0]:this.slim&&!n?t():t(n,{props:{tag:this.transition&&this.tag?this.tag:void 0},class:{"vue-portal-target":!0}},i)}}),Ju=0,Qu=["disabled","name","order","slim","slotProps","tag","to"],th=["multiple","transition"];ya.extend({name:"MountingPortal",inheritAttrs:!1,props:{append:{type:[Boolean,String]},bail:{type:Boolean},mountTo:{type:String,required:!0},disabled:{type:Boolean},name:{type:String,default:function(){return"mounted_"+String(Ju++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}},multiple:{type:Boolean,default:!1},targetSlim:{type:Boolean},targetSlotProps:{type:Object,default:function(){return{}}},targetTag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},created:function(){if("undefined"!=typeof document){var t=document.querySelector(this.mountTo);if(t){var e=this.$props;if(Xu.targets[e.name])e.bail?console.warn("[portal-vue]: Target ".concat(e.name," is already mounted.\n Aborting because 'bail: true' is set")):this.portalTarget=Xu.targets[e.name];else{var i=e.append;if(i){var n="string"==typeof i?i:"DIV",r=document.createElement(n);t.appendChild(r),t=r}var o=Gu(this.$props,th);o.slim=this.targetSlim,o.tag=this.targetTag,o.slotProps=this.targetSlotProps,o.name=this.to,this.portalTarget=new Zu({el:t,parent:this.$parent||this,propsData:o})}}else console.error("[portal-vue]: Mount Point '".concat(this.mountTo,"' not found in document"))}},beforeDestroy:function(){var t=this.portalTarget;if(this.append){var e=t.$el;e.parentNode.removeChild(e)}t.$destroy()},render:function(t){if(!this.portalTarget)return console.warn("[portal-vue] Target wasn't mounted"),t();if(!this.$scopedSlots.manual){var e=Gu(this.$props,Qu);return t(Hu,{props:e,attrs:this.$attrs,on:this.$listeners,scopedSlots:this.$scopedSlots},this.$slots.default)}var i=this.$scopedSlots.manual({to:this.to});return Array.isArray(i)&&(i=i[0]),i||t()}});var eh="active",ih="in";function nh(t,e,i,n,r,o,s,a,l,u){"boolean"!=typeof s&&(l=a,a=s,s=!1);var h,c="function"==typeof i?i.options:i;if(t&&t.render&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),n&&(c._scopeId=n),o?(h=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=h):e&&(h=s?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),h)if(c.functional){var d=c.render;c.render=function(t,e){return h.call(e),d(t,e)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,h):[h]}return i}var rh={components:{Portal:Hu},props:{title:{type:String,default:"Tab Title"},disabled:{type:Boolean,default:!1},tabClasses:{type:Object,default:function(){return{}}},group:String,pullRight:{type:Boolean,default:!1},hidden:{type:Boolean,default:!1}},data:function(){return{active:!0,transition:150}},watch:{active:function(t){var e=this;t?setTimeout((function(){Nu(e.$el,eh),e.$el.offsetHeight,Nu(e.$el,ih);try{e.$parent.$emit("changed",e.$parent.activeIndex)}catch(t){throw new Error(" parent must be .")}}),this.transition):(Bu(this.$el,ih),setTimeout((function(){Bu(e.$el,eh)}),this.transition))}},created:function(){try{this.$parent.tabs.push(this)}catch(t){throw new Error(" parent must be .")}},beforeDestroy:function(){!function(t,e){if(Array.isArray(t)){var i=t.indexOf(e);i>=0&&t.splice(i,1)}}(this.$parent&&this.$parent.tabs,this)},methods:{show:function(){var t=this;this.$nextTick((function(){Nu(t.$el,eh),Nu(t.$el,ih)}))}}},oh=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"tab-pane",class:{fade:t.transition>0},attrs:{role:"tabpanel"}},[t._t("default"),t._v(" "),i("portal",{attrs:{to:t._uid.toString()}},[t._t("title")],2)],2)};oh._withStripped=!0;const sh=nh({render:oh,staticRenderFns:[]},undefined,rh,undefined,false,undefined,!1,void 0,void 0,void 0);function ah(t,e){var i=arguments;if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1;r a:focus")},onKeyPress:function(t){if(this.show){var e=this.$refs.dropdown,i=t.keyCode;if(27===i)this.toggle(!1),this.triggerEl&&this.triggerEl.focus();else if(13===i){var n=this.getFocusItem();n&&n.click()}else if(38===i||40===i){t.preventDefault(),t.stopPropagation();var r=this.getFocusItem(),o=e.querySelectorAll("li:not(.disabled) > a");if(r){for(var s=0;s0?mh(o[s-1]):40===i&&s=0;s=o||a&&l}if(s){i=!0;break}}var u=this.$refs.dropdown.contains(e),h=this.$el.contains(e)&&!u,c=u&&"touchend"===t.type;h||i||c||this.toggle(!1)}},appendDropdownToBody:function(){try{var t=this.$refs.dropdown;t.style.display="block",document.body.appendChild(t),function(t,e,i){void 0===i&&(i={});var n=document.documentElement,r=(window.pageXOffset||n.scrollLeft)-(n.clientLeft||0),o=(window.pageYOffset||n.scrollTop)-(n.clientTop||0),s=e.getBoundingClientRect(),a=t.getBoundingClientRect();t.style.right="auto",t.style.bottom="auto",i.menuRight?t.style.left=r+s.left+s.width-a.width+"px":t.style.left=r+s.left+"px",i.dropup?t.style.top=o+s.top-a.height-4+"px":t.style.top=o+s.top+s.height+"px"}(t,this.positionElement||this.$el,this)}catch(t){}},removeDropdownFromBody:function(){try{var t=this.$refs.dropdown;t.removeAttribute("style"),this.$el.appendChild(t)}catch(t){}}}};function yh(t){return(yh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _h(t){return function(t){if(Array.isArray(t)){for(var e=0,i=new Array(t.length);e1&&void 0!==arguments[1]&&arguments[1],i=t.to,n=t.from;if(i&&(n||!1!==e)&&this.transports[i])if(e)this.transports[i]=[];else{var r=this.$_getTransportIndex(t);if(r>=0){var o=this.transports[i].slice(0);o.splice(r,1),this.transports[i]=o}}},registerTarget:function(t,e,i){bh&&(this.trackInstances&&!i&&this.targets[t]&&console.warn("[portal-vue]: Target ".concat(t," already exists")),this.$set(this.targets,t,Object.freeze([e])))},unregisterTarget:function(t){this.$delete(this.targets,t)},registerSource:function(t,e,i){bh&&(this.trackInstances&&!i&&this.sources[t]&&console.warn("[portal-vue]: source ".concat(t," already exists")),this.$set(this.sources,t,Object.freeze([e])))},unregisterSource:function(t){this.$delete(this.sources,t)},hasTarget:function(t){return!(!this.targets[t]||!this.targets[t][0])},hasSource:function(t){return!(!this.sources[t]||!this.sources[t][0])},hasContentFor:function(t){return!!this.transports[t]&&!!this.transports[t].length},$_getTransportIndex:function(t){var e=t.to,i=t.from;for(var n in this.transports[e])if(this.transports[e][n].from===i)return+n;return-1}}}))(xh),Eh=1,Ih=ya.extend({name:"portal",props:{disabled:{type:Boolean},name:{type:String,default:function(){return String(Eh++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}}},created:function(){var t=this;this.$nextTick((function(){Th.registerSource(t.name,t)}))},mounted:function(){this.disabled||this.sendUpdate()},updated:function(){this.disabled?this.clear():this.sendUpdate()},beforeDestroy:function(){Th.unregisterSource(this.name),this.clear()},watch:{to:function(t,e){e&&e!==t&&this.clear(e),this.sendUpdate()}},methods:{clear:function(t){var e={from:this.name,to:t||this.to};Th.close(e)},normalizeSlots:function(){return this.$scopedSlots.default?[this.$scopedSlots.default]:this.$slots.default},normalizeOwnChildren:function(t){return"function"==typeof t?t(this.slotProps):t},sendUpdate:function(){var t=this.normalizeSlots();if(t){var e={from:this.name,to:this.to,passengers:_h(t),order:this.order};Th.open(e)}else this.clear()}},render:function(t){var e=this.$slots.default||this.$scopedSlots.default||[],i=this.tag;return e&&this.disabled?e.length<=1&&this.slim?this.normalizeOwnChildren(e)[0]:t(i,[this.normalizeOwnChildren(e)]):this.slim?t():t(i,{class:{"v-portal":!0},style:{display:"none"},key:"v-portal-placeholder"})}}),Ah=ya.extend({name:"portalTarget",props:{multiple:{type:Boolean,default:!1},name:{type:String,required:!0},slim:{type:Boolean,default:!1},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},data:function(){return{transports:Th.transports,firstRender:!0}},created:function(){var t=this;this.$nextTick((function(){Th.registerTarget(t.name,t)}))},watch:{ownTransports:function(){this.$emit("change",this.children().length>0)},name:function(t,e){Th.unregisterTarget(e),Th.registerTarget(t,this)}},mounted:function(){var t=this;this.transition&&this.$nextTick((function(){t.firstRender=!1}))},beforeDestroy:function(){Th.unregisterTarget(this.name)},computed:{ownTransports:function(){var t=this.transports[this.name]||[];return this.multiple?t:0===t.length?[]:[t[t.length-1]]},passengers:function(){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.reduce((function(t,i){var n=i.passengers[0],r="function"==typeof n?n(e):i.passengers;return t.concat(r)}),[])}(this.ownTransports,this.slotProps)}},methods:{children:function(){return 0!==this.passengers.length?this.passengers:this.$scopedSlots.default?this.$scopedSlots.default(this.slotProps):this.$slots.default||[]},noWrapper:function(){var t=this.slim&&!this.transition;return t&&this.children().length>1&&console.warn("[portal-vue]: PortalTarget with `slim` option received more than one child element."),t}},render:function(t){var e=this.noWrapper(),i=this.children(),n=this.transition||this.tag;return e?i[0]:this.slim&&!n?t():t(n,{props:{tag:this.transition&&this.tag?this.tag:void 0},class:{"vue-portal-target":!0}},i)}}),Ph=0,kh=["disabled","name","order","slim","slotProps","tag","to"],Rh=["multiple","transition"];ya.extend({name:"MountingPortal",inheritAttrs:!1,props:{append:{type:[Boolean,String]},bail:{type:Boolean},mountTo:{type:String,required:!0},disabled:{type:Boolean},name:{type:String,default:function(){return"mounted_"+String(Ph++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}},multiple:{type:Boolean,default:!1},targetSlim:{type:Boolean},targetSlotProps:{type:Object,default:function(){return{}}},targetTag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},created:function(){if("undefined"!=typeof document){var t=document.querySelector(this.mountTo);if(t){var e=this.$props;if(Th.targets[e.name])e.bail?console.warn("[portal-vue]: Target ".concat(e.name," is already mounted.\n Aborting because 'bail: true' is set")):this.portalTarget=Th.targets[e.name];else{var i=e.append;if(i){var n="string"==typeof i?i:"DIV",r=document.createElement(n);t.appendChild(r),t=r}var o=wh(this.$props,Rh);o.slim=this.targetSlim,o.tag=this.targetTag,o.slotProps=this.targetSlotProps,o.name=this.to,this.portalTarget=new Ah({el:t,parent:this.$parent||this,propsData:o})}}else console.error("[portal-vue]: Mount Point '".concat(this.mountTo,"' not found in document"))}},beforeDestroy:function(){var t=this.portalTarget;if(this.append){var e=t.$el;e.parentNode.removeChild(e)}t.$destroy()},render:function(t){if(!this.portalTarget)return console.warn("[portal-vue] Target wasn't mounted"),t();if(!this.$scopedSlots.manual){var e=wh(this.$props,kh);return t(Ih,{props:e,attrs:this.$attrs,on:this.$listeners,scopedSlots:this.$scopedSlots},this.$slots.default)}var i=this.$scopedSlots.manual({to:this.to});return Array.isArray(i)&&(i=i[0]),i||t()}});var Lh="before-change";function Fh(t,e,i,n,r,o,s,a,l,u){"boolean"!=typeof s&&(l=a,a=s,s=!1);var h,c="function"==typeof i?i.options:i;if(t&&t.render&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),n&&(c._scopeId=n),o?(h=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=h):e&&(h=s?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),h)if(c.functional){var d=c.render;c.render=function(t,e){return h.call(e),d(t,e)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,h):[h]}return i}var Mh={components:{Dropdown:vh,PortalTarget:Ah},props:{value:{type:Number,validator:function(t){return t>=0}},transition:{type:Number,default:150},justified:Boolean,pills:Boolean,stacked:Boolean,customNavClass:null,customContentClass:null},data:function(){return{tabs:[],activeIndex:0}},watch:{value:{immediate:!0,handler:function(t){uh(t)&&(this.activeIndex=t,this.selectCurrent())}},tabs:function(t){var e=this;t.forEach((function(t,i){t.transition=e.transition,i===e.activeIndex&&t.show()})),this.selectCurrent()}},computed:{navClasses:function(){var t,e={nav:!0,"nav-justified":this.justified,"nav-tabs":!this.pills,"nav-pills":this.pills,"nav-stacked":this.stacked&&this.pills},i=this.customNavClass;return lh(i)?hh(i)?ah({},e,((t={})[i]=!0,t)):ah({},e,i):e},contentClasses:function(){var t,e={"tab-content":!0},i=this.customContentClass;return lh(i)?hh(i)?ah({},e,((t={})[i]=!0,t)):ah({},e,i):e},groupedTabs:function(){var t=[],e={};return this.tabs.forEach((function(i){var n,r;i.group?(n=e,r=i.group,Object.prototype.hasOwnProperty.call(n,r)?t[e[i.group]].tabs.push(i):(t.push({tabs:[i],group:i.group}),e[i.group]=t.length-1),i.active&&(t[e[i.group]].active=!0),i.pullRight&&(t[e[i.group]].pullRight=!0)):t.push(i)})),t=t.map((function(t){return Array.isArray(t.tabs)&&(t.hidden=t.tabs.filter((function(t){return t.hidden})).length===t.tabs.length),t}))}},methods:{getTabClasses:function(t,e){return void 0===e&&(e=!1),ah({active:t.active,disabled:t.disabled,"pull-right":t.pullRight&&!e},t.tabClasses)},selectCurrent:function(){var t=this,e=!1;this.tabs.forEach((function(i,n){n===t.activeIndex?(e=!i.active,i.active=!0):i.active=!1})),e&&this.$emit("change",this.activeIndex)},selectValidate:function(t){var e=this;"function"==typeof this.$listeners["before-change"]?this.$emit(Lh,this.activeIndex,t,(function(i){lh(i)||e.$select(t)})):this.$select(t)},select:function(t){this.tabs[t].disabled||t===this.activeIndex||this.selectValidate(t)},$select:function(t){uh(this.value)?this.$emit("input",t):(this.activeIndex=t,this.selectCurrent())}}},Oh=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("section",[i("ul",{class:t.navClasses,attrs:{role:"tablist"}},[t._l(t.groupedTabs,(function(e,n){return[e.tabs?i("dropdown",{directives:[{name:"show",rawName:"v-show",value:!e.hidden,expression:"!tab.hidden"}],class:t.getTabClasses(e),attrs:{role:"presentation",tag:"li"}},[i("a",{staticClass:"dropdown-toggle",attrs:{role:"tab",href:"#"},on:{click:function(t){t.preventDefault()}}},[t._v(t._s(e.group)+" "),i("span",{staticClass:"caret"})]),t._v(" "),i("template",{slot:"dropdown"},t._l(e.tabs,(function(e){return i("li",{directives:[{name:"show",rawName:"v-show",value:!e.hidden,expression:"!subTab.hidden"}],class:t.getTabClasses(e,!0)},[i("a",{attrs:{href:"#"},on:{click:function(i){i.preventDefault(),t.select(t.tabs.indexOf(e))}}},[t._v(t._s(e.title))])])})),0)],2):i("li",{directives:[{name:"show",rawName:"v-show",value:!e.hidden,expression:"!tab.hidden"}],class:t.getTabClasses(e),attrs:{role:"presentation"}},[e.$slots.title?i("portal-target",{attrs:{name:e._uid.toString(),tag:"a",role:"tab",href:"#"},nativeOn:{click:function(i){i.preventDefault(),t.select(t.tabs.indexOf(e))}}}):i("a",{attrs:{role:"tab",href:"#"},domProps:{textContent:t._s(e.title)},on:{click:function(i){i.preventDefault(),t.select(t.tabs.indexOf(e))}}})],1)]})),t._v(" "),!t.justified&&t.$slots["nav-right"]?i("li",{staticClass:"pull-right"},[t._t("nav-right")],2):t._e()],2),t._v(" "),i("div",{class:t.contentClasses},[t._t("default")],2)])};Oh._withStripped=!0;const $h=Fh({render:Oh,staticRenderFns:[]},undefined,Mh,undefined,false,undefined,!1,void 0,void 0,void 0);window.biigle={},window.biigle.$mount=cl,window.biigle.$declare=function(t,e){var i=(t=t.split(".")).pop();return dl(t)[i]=e,e},window.biigle.$require=dl,biigle.$declare("api.annotations",fl),biigle.$declare("api.images",pl),biigle.$declare("api.labels",gl),biigle.$declare("api.labelSource",ml),biigle.$declare("api.labelTree",vl),biigle.$declare("api.labelTreeVersion",yl),biigle.$declare("api.notifications",_l),biigle.$declare("api.projects",bl),biigle.$declare("api.users",wl),biigle.$declare("api.volumes",xl),biigle.$declare("core.components.loader",Cl),biigle.$declare("core.components.loaderBlock",El),biigle.$declare("core.components.powerToggle",Il),biigle.$declare("core.components.sidebar",Rl),biigle.$declare("core.components.sidebarTab",Ll),biigle.$declare("core.components.typeahead",Zl),biigle.$declare("messages",au),biigle.$declare("messages.store",au),window.$biiglePostMessage=au.post,biigle.$declare("core.mixins.editor",lu),biigle.$declare("core.mixins.loader",uu),biigle.$declare("core.models.Settings",hu),biigle.$declare("utils.debounce",Ql),biigle.$declare("utils.urlParams",tu),biigle.$declare("urlParams",tu),biigle.$declare("utils.throttle",nu),biigle.$declare("events",Pl),biigle.$declare("keyboard",kl),biigle.$declare("core.keyboard",kl),biigle.$declare("uiv.popover",Du),biigle.$declare("uiv.tab",sh),biigle.$declare("uiv.tabs",$h);const Dh=Sl({components:{message:{props:{id:{type:Number,required:!0},text:{type:String,required:!0},type:{type:String,default:"info"}},computed:{typeClass:function(){return"alert-".concat(this.type)}},methods:{close:function(){au.close(this.id)},cancelTimeout:function(){this.closeTimeoutId&&(window.clearTimeout(this.closeTimeoutId),this.closeTimeoutId=null)}},mounted:function(){"danger"!==this.type&&(this.closeTimeoutId=window.setTimeout(this.close,15e3))}}},data:function(){return{messages:au.all}},mounted:function(){var t=biigle.$require("staticMessage");t.text&&t.type&&this.$nextTick((function(){au.post(t.type,t.text)}))}},undefined,undefined,!1,null,null,null).exports;const jh=Sl(new Vue({data:{all:[],initialized:!1},computed:{unread:function(){return this.all.filter((function(t){return null===t.read_at}))},count:function(){return this.all.length},countUnread:function(){return this.unread.length}},methods:{remove:function(t){for(var e=this.all.length-1;e>=0;e--)this.all[e].id===t&&this.all.splice(e,1)},initialize:function(){if(!this.initialized){var t=biigle.$require("initialNotifications");this.all=t||[],this.initialized=!0}}}}),undefined,undefined,!1,null,null,null).exports;const Nh=Sl({components:{notification:{props:["item","removeItem"],data:function(){return{isLoading:!1}},computed:{classObject:function(){return this.item.data.type?"panel-".concat(this.item.data.type):"panel-default"},isUnread:function(){return null===this.item.read_at}},methods:{markRead:function(){var t=this;return this.isLoading=!0,_l.markRead({id:this.item.id},{}).then((function(){t.item.read_at=new Date,t.removeItem&&jh.remove(t.item.id)})).catch(au.handleErrorResponse).finally((function(){t.isLoading=!1}))},markReadAndOpenLink:function(){var t=this.item.data.actionLink;this.item.read_at?window.location=t:this.markRead().finally((function(){window.location=t}))}}}},data:function(){return{notifications:[]}},computed:{hasNotifications:function(){return jh.count>0},hasUnreadNotifications:function(){return jh.countUnread>0}},created:function(){jh.initialize(),this.notifications=jh.all}},undefined,undefined,!1,null,null,null).exports;const Bh=Sl({computed:{unread:function(){return jh.initialized?jh.countUnread:parseInt(this.$el.attributes.unread.value)},hasUnread:function(){return this.unread>0},unreadText:function(){return this.hasUnread?this.unread:"no"},title:function(){return"You have ".concat(this.unreadText," unread notification(s)")}}},undefined,undefined,!1,null,null,null).exports;const Uh=Sl({computed:{count:function(){return jh.countUnread}}},undefined,undefined,!1,null,null,null).exports;const zh=Sl({data:function(){return{body:""}},beforeMount:function(){var t=document.getElementById("system-messages-edit-form").querySelector('textarea[name="body"]');t&&(this.body=t.value)}},undefined,undefined,!1,null,null,null).exports;var Vh="click",Gh="keydown",qh="touchend";function Wh(t,e,i){t.addEventListener(e,i)}function Kh(t,e,i){t.removeEventListener(e,i)}function Xh(t){(function(t){return t&&t.nodeType===Node.ELEMENT_NODE})(t)&&(!t.getAttribute("tabindex")&&t.setAttribute("tabindex","-1"),t.focus())}const Yh={render:function(t){return t(this.tag,{class:{"btn-group":"div"===this.tag,dropdown:!this.dropup,dropup:this.dropup,open:this.show}},[this.$slots.default,t("ul",{class:{"dropdown-menu":!0,"dropdown-menu-right":this.menuRight},ref:"dropdown"},[this.$slots.dropdown])])},props:{tag:{type:String,default:"div"},appendToBody:{type:Boolean,default:!1},value:Boolean,dropup:{type:Boolean,default:!1},menuRight:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},notCloseElements:Array,positionElement:null},data:function(){return{show:!1,triggerEl:void 0}},watch:{value:function(t){this.toggle(t)}},mounted:function(){this.initTrigger(),this.triggerEl&&(Wh(this.triggerEl,Vh,this.toggle),Wh(this.triggerEl,Gh,this.onKeyPress)),Wh(this.$refs.dropdown,Gh,this.onKeyPress),Wh(window,Vh,this.windowClicked),Wh(window,qh,this.windowClicked),this.value&&this.toggle(!0)},beforeDestroy:function(){this.removeDropdownFromBody(),this.triggerEl&&(Kh(this.triggerEl,Vh,this.toggle),Kh(this.triggerEl,Gh,this.onKeyPress)),Kh(this.$refs.dropdown,Gh,this.onKeyPress),Kh(window,Vh,this.windowClicked),Kh(window,qh,this.windowClicked)},methods:{getFocusItem:function(){return this.$refs.dropdown.querySelector("li > a:focus")},onKeyPress:function(t){if(this.show){var e=this.$refs.dropdown,i=t.keyCode;if(27===i)this.toggle(!1),this.triggerEl&&this.triggerEl.focus();else if(13===i){var n=this.getFocusItem();n&&n.click()}else if(38===i||40===i){t.preventDefault(),t.stopPropagation();var r=this.getFocusItem(),o=e.querySelectorAll("li:not(.disabled) > a");if(r){for(var s=0;s0?Xh(o[s-1]):40===i&&s=0;s=o||a&&l}if(s){i=!0;break}}var u=this.$refs.dropdown.contains(e),h=this.$el.contains(e)&&!u,c=u&&"touchend"===t.type;h||i||c||this.toggle(!1)}},appendDropdownToBody:function(){try{var t=this.$refs.dropdown;t.style.display="block",document.body.appendChild(t),function(t,e,i){void 0===i&&(i={});var n=document.documentElement,r=(window.pageXOffset||n.scrollLeft)-(n.clientLeft||0),o=(window.pageYOffset||n.scrollTop)-(n.clientTop||0),s=e.getBoundingClientRect(),a=t.getBoundingClientRect();t.style.right="auto",t.style.bottom="auto",i.menuRight?t.style.left=r+s.left+s.width-a.width+"px":t.style.left=r+s.left+"px",i.dropup?t.style.top=o+s.top-a.height-4+"px":t.style.top=o+s.top+s.height+"px"}(t,this.positionElement||this.$el,this)}catch(t){}},removeDropdownFromBody:function(){try{var t=this.$refs.dropdown;t.removeAttribute("style"),this.$el.appendChild(t)}catch(t){}}}};cl("top-menu",Sl(new Vue({components:{dropdown:Yh}}),undefined,undefined,!1,null,null,null).exports),cl("messages-display",Dh),cl("notifications-list",Nh),cl("notifications-navbar-indicator",Bh),cl("notifications-unread-count",Uh),cl("system-messages-edit-form",zh);i(755);var Hh=Sl({name:"label-tree-label",data:function(){return{hover:!1,editing:!1,oldName:"",oldColor:"",newName:"",newColor:"",internalLabel:null}},props:{label:{type:Object,required:!0},showFavourites:{type:Boolean,required:!1},editable:{type:Boolean,default:!1},flat:{type:Boolean,default:!1}},computed:{showColor:function(){return!this.expandable||!this.hover},showChevronUp:function(){return!this.showColor&&this.label.open},showChevronDown:function(){return!this.showColor&&!this.label.open},classObject:function(){return{"label-tree-label--selected":this.label.selected,"label-tree-label--expandable":this.expandable,"label-tree-label--editing":this.editing}},colorStyle:function(){return{"background-color":"#"+this.label.color}},chevronStyle:function(){return{color:"#"+this.label.color}},favouriteClass:function(){return{selected:this.label.favourite}},favouriteTitle:function(){return(this.label.favourite?"Remove":"Add")+" as favourite"},editTitle:function(){return"Edit label "+this.label.name},deleteTitle:function(){return"Remove label "+this.label.name},expandable:function(){return!this.flat&&!!this.label.children},showEditButton:function(){return this.editable&&this.hover&&!this.editing}},methods:{toggleSelect:function(t){this.editing||(t.preventDefault(),this.label.selected?this.$emit("deselect",this.label,t):this.$emit("select",this.label,t))},editThis:function(){this.editing=!0,this.oldName=this.label.name,this.oldColor=this.label.color,this.newName=this.label.name,this.newColor="#"+this.label.color},saveThis:function(){var t=this;this.internalLabel.name=this.newName,this.internalLabel.color=this.newColor.substr(1),this.editing=!1,this.oldName===this.label.name&&this.oldColor===this.label.color||this.emitSave(this.label,(function(){return t.editing=!0}))},revertThis:function(){this.editing=!1,this.internalLabel.name=this.oldName,this.internalLabel.color=this.oldColor},deleteThis:function(){this.emitDelete(this.label)},toggleOpen:function(t){this.editing||(this.expandable?this.internalLabel.open=!this.label.open:this.toggleSelect(t))},toggleFavourite:function(){this.label.favourite?this.emitRemoveFavourite(this.label):this.emitAddFavourite(this.label)},emitSelect:function(t,e){this.$emit("select",t,e)},emitDeselect:function(t,e){this.$emit("deselect",t,e)},emitDelete:function(t){this.$emit("delete",t)},emitSave:function(t,e){this.$emit("save",t,e)},emitAddFavourite:function(t){this.$emit("add-favourite",t)},emitRemoveFavourite:function(t){this.$emit("remove-favourite",t)},doHover:function(){this.hover=!0},dontHover:function(){this.hover=!1}},created:function(){this.internalLabel=this.label}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("li",{staticClass:"label-tree-label",class:t.classObject},[i("div",{staticClass:"label-tree-label__name",on:{click:t.toggleOpen,mouseover:t.doHover,mouseleave:t.dontHover}},[t.editing?i("span",[i("input",{directives:[{name:"model",rawName:"v-model",value:t.newColor,expression:"newColor"}],staticClass:"form-control input-sm label-tree-color-input",attrs:{type:"color"},domProps:{value:t.newColor},on:{input:function(e){e.target.composing||(t.newColor=e.target.value)}}}),t._v(" "),i("input",{directives:[{name:"model",rawName:"v-model",value:t.newName,expression:"newName"}],staticClass:"form-control input-sm label-tree-label__name-input",attrs:{type:"text"},domProps:{value:t.newName},on:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.saveThis(e)},input:function(e){e.target.composing||(t.newName=e.target.value)}}})]):i("span",[i("span",{directives:[{name:"show",rawName:"v-show",value:t.showColor,expression:"showColor"}],staticClass:"label-tree-label__color",style:t.colorStyle}),t._v(" "),i("span",{directives:[{name:"show",rawName:"v-show",value:t.showChevronDown,expression:"showChevronDown"}],staticClass:"label-tree-label__chevron label-tree-label__chevron--down",style:t.chevronStyle}),t._v(" "),i("span",{directives:[{name:"show",rawName:"v-show",value:t.showChevronUp,expression:"showChevronUp"}],staticClass:"label-tree-label__chevron label-tree-label__chevron--up",style:t.chevronStyle}),t._v(" "),i("span",{domProps:{textContent:t._s(t.label.name)},on:{click:function(e){return e.stopPropagation(),t.toggleSelect(e)},mouseenter:t.dontHover}})]),t._v(" "),i("span",{staticClass:"label-tree-label__buttons"},[t.showFavourites?i("button",{staticClass:"label-tree-label__favourite",class:t.favouriteClass,attrs:{type:"button",title:t.favouriteTitle},on:{click:function(e){return e.stopPropagation(),t.toggleFavourite(e)}}},[i("span",{staticClass:"fa fa-star",attrs:{"aria-hidden":"true",title:""}})]):t._e(),t._v(" "),i("span",{attrs:{if:"editable"}},[i("button",{directives:[{name:"show",rawName:"v-show",value:t.showEditButton,expression:"showEditButton"}],staticClass:"btn btn-default btn-xs",attrs:{title:t.editTitle},on:{click:function(e){return e.stopPropagation(),t.editThis(e)}}},[i("span",{staticClass:"fa fa-pencil-alt",attrs:{"aria-hidden":"true"}})]),t._v(" "),i("button",{directives:[{name:"show",rawName:"v-show",value:t.editing,expression:"editing"}],staticClass:"btn btn-danger btn-sm",attrs:{title:t.deleteTitle},on:{click:function(e){return e.stopPropagation(),t.deleteThis(e)}}},[i("span",{staticClass:"fa fa-trash",attrs:{"aria-hidden":"true"}})]),t._v(" "),i("button",{directives:[{name:"show",rawName:"v-show",value:t.editing,expression:"editing"}],staticClass:"btn btn-success btn-sm",attrs:{title:"Save changes"},on:{click:function(e){return e.stopPropagation(),t.saveThis(e)}}},[i("span",{staticClass:"fa fa-check",attrs:{"aria-hidden":"true"}})]),t._v(" "),i("button",{directives:[{name:"show",rawName:"v-show",value:t.editing,expression:"editing"}],staticClass:"btn btn-default btn-sm",attrs:{title:"Revert changes"},on:{click:function(e){return e.stopPropagation(),t.revertThis(e)}}},[i("span",{staticClass:"fa fa-times",attrs:{"aria-hidden":"true"}})])])])]),t._v(" "),t.expandable&&t.label.open?i("ul",{staticClass:"label-tree__list"},t._l(t.label.children,(function(e){return i("label-tree-label",{key:e.id,attrs:{label:e,editable:t.editable,"show-favourites":t.showFavourites},on:{select:t.emitSelect,deselect:t.emitDeselect,save:t.emitSave,delete:t.emitDelete,"add-favourite":t.emitAddFavourite,"remove-favourite":t.emitRemoveFavourite}})})),1):t._e()])}),[],!1,null,null,null);const Zh=Sl({data:function(){return{collapsed:!1}},components:{labelTreeLabel:Hh.exports},props:{name:{type:String,required:!0},labels:{type:Array,required:!0},showTitle:{type:Boolean,default:!0},standalone:{type:Boolean,default:!1},collapsible:{type:Boolean,default:!0},multiselect:{type:Boolean,default:!1},allowSelectSiblings:{type:Boolean,default:!1},allowSelectChildren:{type:Boolean,default:!1},editable:{type:Boolean,default:!1},showFavourites:{type:Boolean,default:!1},flat:{type:Boolean,default:!1}},computed:{labelMap:function(){for(var t={},e=this.labels.length-1;e>=0;e--)t[this.labels[e].id]=this.labels[e];return t},compiledLabels:function(){var t={null:[]};return this.flat?this.labels.forEach((function(e){t.null.push(e)})):(this.labels.forEach((function(e){t.hasOwnProperty(e.parent_id)?t[e.parent_id].push(e):t[e.parent_id]=[e]})),this.labels.forEach((function(e){t.hasOwnProperty(e.id)?Vue.set(e,"children",t[e.id]):(Vue.set(e,"children",void 0),e.open=!1)}))),t},rootLabels:function(){return this.compiledLabels.null},collapseTitle:function(){return this.collapsed?"Expand":"Collapse"},hasNoLabels:function(){return 0===this.rootLabels.length}},methods:{hasLabel:function(t){return this.labelMap.hasOwnProperty(t)},getLabel:function(t){return this.labelMap[t]},getParents:function(t){for(var e=[];null!==t.parent_id;)t=this.getLabel(t.parent_id),e.unshift(t.id);return e},getSiblings:function(t){return null===t.parent_id?this.rootLabels:this.getLabel(t.parent_id).children},selectSiblings:function(t){this.getSiblings(t).forEach((function(t){t.selected=!0}))},deselectSiblings:function(t){this.getSiblings(t).forEach((function(t){t.selected=!1}))},selectChildren:function(t){var e=this;t.children&&t.children.forEach((function(t){t.selected=!0,e.selectChildren(t)}))},deselectChildren:function(t){var e=this;t.children&&t.children.forEach((function(t){t.selected=!1,e.deselectChildren(t)}))},emitSelect:function(t,e){this.$emit("select",t,e)},emitDeselect:function(t,e){this.$emit("deselect",t,e)},emitSave:function(t,e){this.$emit("save",t,e)},emitDelete:function(t){this.$emit("delete",t)},conditionSelectSiblings:function(t){return this.allowSelectSiblings&&t.altKey},conditionSelectChildren:function(t){return this.allowSelectChildren&&t.ctrlKey},selectLabel:function(t,e){var i=this;this.multiselect||this.clearSelectedLabels(),t&&this.hasLabel(t.id)&&(t.selected=!0,this.collapsed=!1,this.flat||(this.getParents(t).forEach((function(t){i.getLabel(t).open=!0})),this.multiselect&&(this.conditionSelectSiblings(e)&&this.selectSiblings(t),this.conditionSelectChildren(e)&&(this.selectChildren(t),this.conditionSelectSiblings(e)&&this.getSiblings(t).forEach(this.selectChildren)))))},deselectLabel:function(t,e){this.hasLabel(t.id)&&(t.selected=!1,this.conditionSelectSiblings(e)&&this.deselectSiblings(t),this.conditionSelectChildren(e)&&(this.deselectChildren(t),this.conditionSelectSiblings(e)&&this.getSiblings(t).forEach(this.deselectChildren)))},clearSelectedLabels:function(){this.labels.forEach((function(t){t.selected=!1}))},collapse:function(){if(this.collapsed)this.collapsed=!1;else{var t=!1;this.labels.forEach((function(e){t|=e.open,e.open=!1})),this.collapsed=!t}},emitAddFavourite:function(t){this.$emit("add-favourite",t)},emitRemoveFavourite:function(t){this.$emit("remove-favourite",t)},addFavouriteLabel:function(t){this.hasLabel(t.id)&&(t.favourite=!0)},removeFavouriteLabel:function(t){this.hasLabel(t.id)&&(t.favourite=!1)}},created:function(){this.labels.forEach((function(t){t.hasOwnProperty("open")||Vue.set(t,"open",!1),t.hasOwnProperty("selected")||Vue.set(t,"selected",!1),t.hasOwnProperty("favourite")||Vue.set(t,"favourite",!1)})),this.standalone?(this.$on("select",this.selectLabel),this.$on("deselect",this.deselectLabel)):(this.$parent.$on("select",this.selectLabel),this.$parent.$on("deselect",this.deselectLabel),this.$parent.$on("clear",this.clearSelectedLabels),this.$parent.$on("add-favourite",this.addFavouriteLabel),this.$parent.$on("remove-favourite",this.removeFavouriteLabel))}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"label-tree"},[t.showTitle?i("h4",{staticClass:"label-tree__title"},[t.collapsible?i("button",{staticClass:"btn btn-default btn-xs pull-right",attrs:{title:t.collapseTitle,type:"button"},on:{click:function(e){return e.stopPropagation(),t.collapse(e)}}},[t.collapsed?i("span",{staticClass:"fa fa-chevron-down",attrs:{"aria-hidden":"true"}}):i("span",{staticClass:"fa fa-chevron-up",attrs:{"aria-hidden":"true"}})]):t._e(),t._v("\n "+t._s(t.name)+"\n ")]):t._e(),t._v(" "),t.collapsed?t._e():i("ul",{staticClass:"label-tree__list"},[t._l(t.rootLabels,(function(e){return i("label-tree-label",{key:e.id,attrs:{label:e,editable:t.editable,"show-favourites":t.showFavourites,flat:t.flat},on:{select:t.emitSelect,deselect:t.emitDeselect,save:t.emitSave,delete:t.emitDelete,"add-favourite":t.emitAddFavourite,"remove-favourite":t.emitRemoveFavourite}})})),t._v(" "),t.hasNoLabels?i("li",{staticClass:"text-muted"},[t._v("No labels")]):t._e()],2)])}),[],!1,null,null,null).exports;const Jh=Sl({mixins:[Zl],props:{template:{default:''}}},undefined,undefined,!1,null,null,null).exports;const Qh=Sl({components:{typeahead:Jh,labelTree:Zh},data:function(){return{favourites:[]}},props:{trees:{type:Array,required:!0},id:{type:String},typeahead:{type:Boolean,default:!0},clearable:{type:Boolean,default:!0},multiselect:{type:Boolean,default:!1},allowSelectSiblings:{type:Boolean,default:!1},allowSelectChildren:{type:Boolean,default:!1},showFavourites:{type:Boolean,default:!1},collapsible:{type:Boolean,default:!0},listenerSet:{type:String,default:"default"}},computed:{localeCompareSupportsLocales:function(){try{"foo".localeCompare("bar","i")}catch(t){return"RangeError"===t.name}return!1},labels:function(){var t=[];if(this.trees.forEach((function(e){Array.prototype.push.apply(t,e.labels)})),this.localeCompareSupportsLocales){var e=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});t.sort((function(t,i){return e.compare(t.name,i.name)}))}else t.sort((function(t,e){return t.name0},ownId:function(){if(this.id)return this.id;var t=[];for(var e in this.trees)this.trees.hasOwnProperty(e)&&t.push(this.trees[e].id);return t.join("-")},favouriteStorageKey:function(){return"biigle.label-trees.".concat(this.ownId,".favourites")}},methods:{handleSelect:function(t,e){t&&this.$emit("select",t,e)},handleDeselect:function(t,e){this.$emit("deselect",t,e)},clear:function(){this.$emit("clear")},handleAddFavourite:function(t){this.canHaveMoreFavourites&&(this.$emit("add-favourite",t),this.favourites.push(t),this.updateFavouriteStorage())},handleRemoveFavourite:function(t){this.$emit("remove-favourite",t);var e=this.favourites.indexOf(t);-1!==e&&this.favourites.splice(e,1),this.updateFavouriteStorage()},updateFavouriteStorage:function(){this.hasFavourites?localStorage.setItem(this.favouriteStorageKey,JSON.stringify(this.favouriteIds)):localStorage.removeItem(this.favouriteStorageKey)},selectFavourite:function(t){this.favourites[t]&&this.handleSelect(this.favourites[t])}},watch:{trees:{immediate:!0,handler:function(t){t.forEach((function(t){t.version?t.versionedName=t.name+" @ "+t.version.name:t.versionedName=t.name,t.labels.forEach((function(e){e.tree=t}))}))}}},mounted:function(){var t=this;if(this.showFavourites){var e=JSON.parse(localStorage.getItem(this.favouriteStorageKey));if(e){var i=[];this.labels.forEach((function(t){var n=e.indexOf(t.id);-1!==n&&(i[n]=t)})),i.filter(Boolean).forEach((function(e){t.handleAddFavourite(e)}))}for(var n=function(e,i){kl.on(e,(function(){t.selectFavourite(i)}),0,t.listenerSet)},r=1;r<=9;r++)n(r.toString(),r-1);n("0",9)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"label-trees"},[t.typeahead||t.clearable?i("div",{staticClass:"label-trees__head"},[t.clearable?i("button",{staticClass:"btn btn-default",attrs:{title:"Clear selected labels",type:"button"},on:{click:t.clear}},[i("span",{staticClass:"fa fa-times fa-fw",attrs:{"aria-hidden":"true"}})]):t._e(),t._v(" "),t.typeahead?i("typeahead",{attrs:{items:t.labels,"more-info":"tree.versionedName",placeholder:"Find label"},on:{select:t.handleSelect}}):t._e()],1):t._e(),t._v(" "),i("div",{staticClass:"label-trees__body"},[t.hasFavourites?i("label-tree",{attrs:{name:"Favourites",labels:t.favourites,"show-favourites":t.showFavourites,flat:!0,collapsible:t.collapsible},on:{select:t.handleSelect,deselect:t.handleDeselect,"remove-favourite":t.handleRemoveFavourite}}):t._e(),t._v(" "),t._l(t.trees,(function(e){return i("label-tree",{key:e.id,attrs:{name:e.versionedName,labels:e.labels,multiselect:t.multiselect,"allow-select-siblings":t.allowSelectSiblings,"allow-select-children":t.allowSelectChildren,"show-favourites":t.showFavourites,collapsible:t.collapsible},on:{select:t.handleSelect,deselect:t.handleDeselect,"add-favourite":t.handleAddFavourite,"remove-favourite":t.handleRemoveFavourite}})}))],2)])}),[],!1,null,null,null).exports;biigle.$declare("labelTrees.components.labelTrees",Qh),biigle.$declare("labelTrees.components.labelTypeahead",Jh);const tc=Sl({mixins:[uu],data:function(){return{labelTree:null,ownProjects:[],authorizedProjects:[],authorizedOwnProjects:[],privateId:null}},components:{typeahead:Zl},computed:{isPrivate:function(){return this.labelTree.visibility_id===this.privateId},authorizableProjects:function(){var t=this;return this.ownProjects.filter((function(e){for(var i=t.authorizedProjects.length-1;i>=0;i--)if(t.authorizedProjects[i].id===e.id)return!1;return!0}))},hasAuthorizedProjects:function(){return this.authorizedProjects.length>0}},methods:{fetchOwnProjects:function(){var t=this;bl.query().then((function(e){Vue.set(t,"ownProjects",e.body)}),su)},addAuthorizedProject:function(t){var e=this;t&&!this.loading&&(this.startLoading(),vl.addAuthorizedProject({id:this.labelTree.id},{id:t.id}).then((function(){return e.authorizedProjectAdded(t)}),su).finally(this.finishLoading))},authorizedProjectAdded:function(t){this.authorizedProjects.push(t),this.authorizedOwnProjects.push(t.id)},removeAuthorizedProject:function(t){var e=this;this.startLoading(),vl.removeAuthorizedProject({id:this.labelTree.id,project_id:t.id}).then((function(){return e.authorizedProjectRemoved(t)}),su).finally(this.finishLoading)},authorizedProjectRemoved:function(t){var e;for(e=this.authorizedProjects.length-1;e>=0;e--)this.authorizedProjects[e].id===t.id&&this.authorizedProjects.splice(e,1);-1!==(e=this.authorizedOwnProjects.indexOf(t.id))&&this.authorizedOwnProjects.splice(e,1)},isOwnProject:function(t){return-1!==this.authorizedOwnProjects.indexOf(t.id)}},created:function(){this.privateId=biigle.$require("labelTrees.privateVisibilityId"),this.labelTree=biigle.$require("labelTrees.labelTree"),this.authorizedProjects=biigle.$require("labelTrees.authorizedProjects"),this.authorizedOwnProjects=biigle.$require("labelTrees.authorizedOwnProjects"),this.fetchOwnProjects()}},undefined,undefined,!1,null,null,null).exports;var ec=[0,.5,.9],ic=[360,1,1],nc=[0,2,2],rc=function(){for(var t,e,i=[0,0,0],n=i.length-1;n>=0;n--)t=10*nc[n],i[n]=(ic[n]-ec[n])*Math.random()+ec[n],i[n]=0!==t?Math.round(i[n]*t)/t:Math.round(i[n]);return"#"+(e=function(t){var e,i=t[0]/60,n=Math.floor(i),r=i-n,o=[t[2]*(1-t[1]),t[2]*(1-t[1]*r),t[2]*(1-t[1]*(1-r))];switch(n){case 1:e=[o[1],t[2],o[0]];break;case 2:e=[o[0],t[2],o[2]];break;case 3:e=[o[0],o[1],t[2]];break;case 4:e=[o[2],o[0],t[2]];break;case 5:e=[t[2],o[0],o[1]];break;default:e=[t[2],o[2],o[0]]}return e.map((function(t){return Math.round(255*t)}))}(i),e.map((function(t){return 1===(t=t.toString(16)).length?"0"+t:t}))).join("")};const oc=Sl({props:{labels:{type:Array,required:!0},color:{type:String,default:""},parent:{type:Object,default:null},name:{type:String,default:""}},components:{typeahead:Jh},computed:{selectedColor:{get:function(){return this.color},set:function(t){this.$emit("color",t)}},selectedName:{get:function(){return this.name},set:function(t){this.$emit("name",t)}},selectedParent:function(){return this.parent?this.parent.name:""},hasNoLabels:function(){return 0===this.labels.length},hasNoParent:function(){return!this.parent},hasNoName:function(){return!this.name}},methods:{refreshColor:function(){this.selectedColor=rc()},resetParent:function(){this.$emit("parent",null)},selectLabel:function(t){this.$emit("parent",t)}}},undefined,undefined,!1,null,null,null).exports;const sc=Sl({mixins:[oc],methods:{submit:function(){var t={name:this.selectedName,color:this.selectedColor};this.parent&&(t.parent_id=this.parent.id),this.$emit("submit",t)}}},undefined,undefined,!1,null,null,null).exports;var ac=Sl({props:{item:{type:Object,required:!0},recursive:{type:Boolean,required:!0},labels:{type:Array,required:!0},parent:{type:Object,default:null}},computed:{classification:function(){return this.item.parents.join(" > ")},buttonTitle:function(){return this.recursive?"Add ".concat(this.item.name," and all WoRMS parents as new labels"):this.parent?"Add ".concat(this.item.name," as a child of ").concat(this.parent.name):"Add ".concat(this.item.name," as a root label")},classObject:function(){return{"list-group-item-success":this.selected}},selected:function(){var t=this;return this.labels.some((function(e){return e.source_id==t.item.aphia_id}))}},methods:{select:function(){this.selected||this.$emit("select",this.item)}}},undefined,undefined,!1,null,null,null);var lc=Sl({mixins:[oc],components:{wormsResultItem:ac.exports},data:function(){return{results:[],recursive:!1,hasSearched:!1,unaccepted:!1,worms:null}},computed:{hasResults:function(){return this.results.length>0},recursiveButtonClass:function(){return{active:this.recursive,"btn-info":this.recursive}},unacceptedButtonClass:function(){return{active:this.unaccepted,"btn-info":this.unaccepted}}},methods:{findName:function(){var t=this;this.$emit("load-start");var e={id:this.worms.id,query:this.selectedName};this.unaccepted&&(e.unaccepted="true"),ml.query(e).then(this.updateResults,su).finally((function(){t.hasSearched=!0,t.$emit("load-finish")}))},updateResults:function(t){this.results=t.data},importItem:function(t){var e={name:t.name,color:this.selectedColor,source_id:t.aphia_id,label_source_id:this.worms.id};this.recursive?e.recursive="true":this.parent&&(e.parent_id=this.parent.id),this.$emit("submit",e)},toggleRecursive:function(){this.recursive=!this.recursive},toggleUnaccepted:function(){this.unaccepted=!this.unaccepted}},created:function(){this.worms=biigle.$require("labelTrees.wormsLabelSource")}},undefined,undefined,!1,null,null,null);const uc=Sl({mixins:[uu],data:function(){return{labelTree:null,labels:[],selectedColor:rc(),selectedLabel:null,selectedName:"",canEdit:!1}},components:{tabs:$h,tab:sh,labelTree:Zh,manualLabelForm:sc,wormsLabelForm:lc.exports},computed:{editable:function(){return!this.loading&&this.canEdit}},methods:{saveLabel:function(t,e){this.startLoading(),gl.update({id:t.id},{name:t.name,color:t.color}).catch((function(t){e(),su(t)})).finally(this.finishLoading)},deleteLabel:function(t){var e=this;this.startLoading(),gl.delete({id:t.id}).then((function(){e.labelDeleted(t)}),su).finally(this.finishLoading)},labelDeleted:function(t){this.selectedLabel&&this.selectedLabel.id===t.id&&this.deselectLabel(t);for(var e=this.labels.length-1;e>=0;e--)if(this.labels[e].id===t.id){this.labels.splice(e,1);break}},selectLabel:function(t){this.selectedLabel=t,t?(this.selectedColor="#"+t.color,this.$emit("select",t),Pl.$emit("selectLabel",t)):(this.$emit("clear"),Pl.$emit("selectLabel",null))},deselectLabel:function(t){this.selectedLabel=null,this.$emit("deselect",t),Pl.$emit("selectLabel",null)},selectColor:function(t){this.selectedColor=t},selectName:function(t){this.selectedName=t},insertLabel:function(t){Vue.set(t,"open",!1),Vue.set(t,"selected",!1);for(var e=t.name.toLowerCase(),i=0,n=this.labels.length;i=e)return void this.labels.splice(i,0,t);this.labels.push(t)},createLabel:function(t){this.loading||(this.startLoading(),gl.save({label_tree_id:this.labelTree.id},t).then(this.labelCreated,su).finally(this.finishLoading))},labelCreated:function(t){t.data.forEach(this.insertLabel),this.selectedColor=rc(),this.selectedName=""}},watch:{labels:function(t){Pl.$emit("label-trees.labels.count",t.length)}},created:function(){this.labelTree=biigle.$require("labelTrees.labelTree"),this.labels=biigle.$require("labelTrees.labels"),this.canEdit=biigle.$require("labelTrees.canEdit")}},undefined,undefined,!1,null,null,null).exports;const hc=Sl({methods:{updateCount:function(t){this.$el.textContent=t}},created:function(){Pl.$on("label-trees.labels.count",this.updateCount)}},undefined,undefined,!1,null,null,null).exports;const cc=Sl({mixins:[uu],props:{members:{type:Array,required:!0},roles:{type:Array,required:!0},defaultRole:{type:Object},disabled:{type:Boolean,default:!1}},components:{typeahead:Zl},data:function(){return{selectedMember:null,selectedRole:null,usersLoaded:!1,users:[]}},computed:{memberIds:function(){return this.members.map((function(t){return t.id}))},availableUsers:function(){var t=this;return this.users.filter((function(e){return!t.memberIds.includes(e.id)}))},canAttachMember:function(){return!this.disabled&&this.selectedMember&&this.selectedRole},selectedMemberName:function(){return this.selectedMember?this.selectedMember.name:""}},methods:{selectMember:function(t){this.selectedMember=t},attachMember:function(){var t={id:this.selectedMember.id,role_id:this.selectedRole,firstname:this.selectedMember.firstname,lastname:this.selectedMember.lastname,affiliation:this.selectedMember.affiliation};this.$emit("attach",t),this.selectedMember=null},loadUsers:function(){this.usersLoaded||(this.usersLoaded=!0,this.startLoading(),wl.query().then(this.loadedUsers,su).finally(this.finishLoading))},loadedUsers:function(t){this.users=t.data.map((function(t){return t.name=t.firstname+" "+t.lastname,t}))}},created:function(){this.defaultRole?this.selectedRole=this.defaultRole.id:this.selectedRole=this.roles[0].id}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("form",{staticClass:"form-inline",on:{submit:function(e){return e.preventDefault(),t.attachMember(e)}}},[i("loader",{attrs:{active:t.loading}}),t._v(" "),i("typeahead",{attrs:{disabled:t.disabled,items:t.availableUsers,placeholder:"User name",value:t.selectedMemberName,"more-info":"affiliation"},on:{select:t.selectMember,focus:t.loadUsers}}),t._v(" "),i("select",{directives:[{name:"model",rawName:"v-model",value:t.selectedRole,expression:"selectedRole"}],staticClass:"form-control",attrs:{disabled:t.disabled,title:"Role of the new user"},on:{change:function(e){var i=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.selectedRole=e.target.multiple?i:i[0]}}},t._l(t.roles,(function(e){return i("option",{domProps:{value:e.id,textContent:t._s(e.name)}})})),0),t._v(" "),i("button",{staticClass:"btn btn-default",attrs:{type:"submit",disabled:!t.canAttachMember}},[t._v("Add member")])],1)}),[],!1,null,null,null).exports;const dc=Sl({props:{member:{type:Object,required:!0},ownId:{type:Number,required:!0},editable:{type:Boolean,required:!0},editing:{type:Boolean,default:!1},roles:{type:Array,required:!0}},data:function(){return{roleId:null}},computed:{isOwnUser:function(){return this.member.id===this.ownId},isEditing:function(){return this.editing&&!this.isOwnUser},name:function(){return this.member.firstname+" "+this.member.lastname},role:function(){var t=this;return this.roles.find((function(e){return t.member.role_id===e.id}))},labelClass:function(){switch(this.role.name){case"admin":return"label-danger";case"expert":return"label-warning";case"editor":return"label-primary";default:return"label-default"}}},methods:{removeMember:function(){this.$emit("remove",this.member)},changeRole:function(){this.$emit("update",this.member,{role_id:this.roleId})},emitEnter:function(){this.$emit("enter",this.member)}},created:function(){this.roleId=this.member.role_id}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("li",{staticClass:"list-group-item clearfix",on:{mouseenter:t.emitEnter}},[i("h4",{staticClass:"list-group-item-heading"},[t.editable?i("span",{directives:[{name:"show",rawName:"v-show",value:t.isEditing,expression:"isEditing"}],staticClass:"pull-right"},[i("form",{staticClass:"form-inline"},[i("select",{directives:[{name:"model",rawName:"v-model",value:t.roleId,expression:"roleId"}],staticClass:"form-control input-sm",attrs:{disabled:t.isOwnUser,title:"Change the role of "+t.name},on:{change:[function(e){var i=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.roleId=e.target.multiple?i:i[0]},t.changeRole]}},t._l(t.roles,(function(e){return i("option",{domProps:{value:e.id,textContent:t._s(e.name)}})})),0),t._v(" "),i("button",{staticClass:"btn btn-default btn-sm",attrs:{disabled:t.isOwnUser,type:"button",title:"Remove "+t.name},on:{click:t.removeMember}},[i("i",{staticClass:"fa fa-trash"})])])]):t._e(),t._v(" "),i("span",{directives:[{name:"show",rawName:"v-show",value:!t.isEditing,expression:"!isEditing"}],staticClass:"pull-right label",class:t.labelClass,domProps:{textContent:t._s(t.role.name)}}),t._v(" "),i("span",{domProps:{textContent:t._s(t.name)}}),t._v(" "),t.isOwnUser?i("span",{staticClass:"text-muted"},[t._v("(you)")]):t._e()]),t._v(" "),t.member.affiliation?i("p",{staticClass:"list-group-item-text text-muted",domProps:{textContent:t._s(t.member.affiliation)}}):t._e()])}),[],!1,null,null,null).exports;const fc=Sl({props:{members:{type:Array,required:!0},ownId:{type:Number,required:!0},editable:{type:Boolean,required:!0},roles:{type:Array,required:!0}},components:{memberListItem:dc},data:function(){return{editingMemberId:null}},computed:{sortedMembers:function(){var t=this,e=this.members.slice();return e.sort((function(e,i){return e.id===t.ownId?-1:i.id===t.ownId?1:0})),e}},methods:{emitRemove:function(t){this.$emit("remove",t)},emitUpdate:function(t,e){this.$emit("update",t,e)},handleEnter:function(t){this.editable&&(this.editingMemberId=t.id)},handleLeave:function(t){null!==t.relatedTarget&&(this.editingMemberId=null)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("ul",{staticClass:"list-group",on:{mouseleave:t.handleLeave}},t._l(t.sortedMembers,(function(e){return i("member-list-item",{key:e.id,attrs:{member:e,"own-id":t.ownId,editable:t.editable,editing:t.editingMemberId===e.id,roles:t.roles},on:{remove:t.emitRemove,update:t.emitUpdate,enter:t.handleEnter}})})),1)}),[],!1,null,null,null).exports;const pc=Sl({mixins:[uu],data:function(){return{labelTree:null,members:[],roles:[],defaultRole:null,userId:null}},components:{memberList:fc,addMemberForm:cc},computed:{hasMembers:function(){return 0!==this.members.length}},methods:{attachMember:function(t){var e=this;this.startLoading(),vl.addUser({id:this.labelTree.id},{id:t.id,role_id:t.role_id}).then((function(){return e.memberAttached(t)}),su).finally(this.finishLoading)},memberAttached:function(t){this.members.push(t)},updateMember:function(t,e){var i=this;this.startLoading(),vl.updateUser({id:this.labelTree.id,user_id:t.id},{role_id:e.role_id}).then((function(){return i.memberUpdated(t,e)}),su).finally(this.finishLoading)},memberUpdated:function(t,e){t.role_id=e.role_id},removeMember:function(t){var e=this;this.startLoading(),vl.removeUser({id:this.labelTree.id,user_id:t.id}).then((function(){return e.memberRemoved(t)}),su).finally(this.finishLoading)},memberRemoved:function(t){for(var e=this.members.length-1;e>=0;e--)this.members[e].id===t.id&&this.members.splice(e,1)}},watch:{members:function(t){Pl.$emit("label-trees.members.count",t.length)}},created:function(){this.labelTree=biigle.$require("labelTrees.labelTree"),this.members=biigle.$require("labelTrees.members"),this.roles=biigle.$require("labelTrees.roles"),this.defaultRole=biigle.$require("labelTrees.defaultRole"),this.userId=biigle.$require("labelTrees.userId")}},undefined,undefined,!1,null,null,null).exports;const gc=Sl({methods:{updateCount:function(t){this.$el.textContent=t}},created:function(){Pl.$on("label-trees.members.count",this.updateCount)}},undefined,undefined,!1,null,null,null).exports;var mc=Sl({props:{item:{type:Object,required:!0},disabled:{type:Boolean,required:!1}},computed:{leftLabel:function(){return this.item.left},rightLabel:function(){return this.item.right},hasLeft:function(){return null!==this.leftLabel},hasRight:function(){return null!==this.rightLabel},labelToAdd:function(){return!this.hasLeft&&this.hasRight},labelToRemove:function(){return this.hasLeft&&!this.hasRight},labelsSame:function(){return this.hasLeft&&this.hasRight},leftColorStyle:function(){return{"background-color":"#"+this.leftLabel.color}},rightColorStyle:function(){return{"background-color":"#"+this.rightLabel.color}},classObject:function(){return{success:this.labelToAdd&&!this.accepted,"label-tree-diff-row--added":this.labelToAdd&&this.accepted,danger:this.labelToRemove&&!this.accepted,"label-tree-diff-row--removed":this.labelToRemove&&this.accepted}},labelStyle:function(){return{"padding-left":22*this.item.level+"px"}},addButtonClass:function(){return{"btn-success":this.accepted}},removeButtonClass:function(){return{"btn-danger":this.accepted}},accepted:function(){return this.item.accepted},acceptable:function(){return this.item.acceptable},labelAdded:function(){return this.labelToAdd&&this.accepted},removeTitle:function(){return this.acceptable?"Accept the deletion":"This label cannot be deleted because it or one of its child labels is used"}},methods:{emitResolved:function(){this.$emit("accepted",this.item)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("tr",{staticClass:"label-tree-diff-row",class:t.classObject},[i("td",{staticClass:"label-tree-diff-row__button"},[t.labelToAdd?i("button",{staticClass:"btn btn-sm btn-default",class:t.addButtonClass,attrs:{disabled:t.disabled,title:"Accept the addition"},on:{click:t.emitResolved}},[i("i",{staticClass:"fa fa-plus"})]):t._e(),t._v(" "),t.labelToRemove?i("button",{staticClass:"btn btn-sm btn-default",class:t.removeButtonClass,attrs:{title:t.removeTitle,disabled:!t.acceptable||t.disabled},on:{click:t.emitResolved}},[i("i",{staticClass:"fa fa-minus"})]):t._e()]),t._v(" "),i("td",{staticClass:"label-tree-diff-row__left"},[t.hasLeft?i("div",{staticClass:"label-tree-label",style:t.labelStyle},[i("div",{staticClass:"label-tree-label__name"},[i("span",{staticClass:"label-tree-label__color",style:t.leftColorStyle}),t._v(" "),i("span",{domProps:{textContent:t._s(t.leftLabel.name)}})])]):t._e(),t._v(" "),t.labelAdded?i("div",{staticClass:"label-tree-label",style:t.labelStyle},[i("div",{staticClass:"label-tree-label__name"},[i("span",{staticClass:"label-tree-label__color",style:t.rightColorStyle}),t._v(" "),i("span",{domProps:{textContent:t._s(t.rightLabel.name)}})])]):t._e()]),t._v(" "),i("td",{staticClass:"label-tree-diff-row__right"},[i("div",{staticClass:"label-tree-label",style:t.labelStyle},[t.hasRight?i("div",{staticClass:"label-tree-label__name"},[i("span",{staticClass:"label-tree-label__color",style:t.rightColorStyle}),t._v(" "),i("span",{domProps:{textContent:t._s(t.rightLabel.name)}})]):t._e()])])])}),[],!1,null,null,null);const vc=Sl({components:{labelTreeDiffRow:mc.exports},data:function(){return{diff:[]}},props:{leftLabels:{type:Array,required:!0},leftName:{type:String,default:""},rightLabels:{type:Array,required:!0},rightName:{type:String,default:""},usedLabels:{type:Array,default:function(){return[]}},disabled:{type:Boolean,default:!1}},computed:{leftLabelsById:function(){var t={};return this.leftLabels.forEach((function(e){t[e.id]=e})),t},leftLabelsAsTree:function(){var t=this.generateChildMap(this.leftLabels);return this.generateLabelsAsTree(t.null,t)},rightLabelsAsTree:function(){var t=this.generateChildMap(this.rightLabels);return this.generateLabelsAsTree(t.null,t)},usedLabelMap:function(){var t=this,e={};return this.usedLabels.forEach((function(i){do{e[i]=null,i=t.leftLabelsById[i].parent_id}while(null!==i)})),e},cannotResolveAll:function(){return this.disabled||this.diff.reduce((function(t,e){return e.acceptable?t&&e.accepted:t}),!0)},cannotResolveNone:function(){return this.disabled||this.diff.reduce((function(t,e){return e.acceptable?t&&!e.accepted:t}),!0)},hasDiff:function(){return this.diff.length>0}},methods:{generateChildMap:function(t){var e={};return t.forEach((function(t){e.hasOwnProperty(t.parent_id)?e[t.parent_id].push(t):e[t.parent_id]=[t]})),e},generateLabelsAsTree:function(t,e){var i=this;return t.map((function(t){return e.hasOwnProperty(t.id)?t.children=i.generateLabelsAsTree(e[t.id],e):t.children=[],t})).sort((function(t,e){return t.name+"-"+t.color<=e.name+"-"+e.color?-1:1}))},generateTreeDiff:function(t,e,i,n){var r=this;for(t=t.slice(),e=e.slice(),i=i||[],n=n||0;t.length>0&&e.length>0;){var o=t[0],s=e[0];o.name===s.name?(t.shift(),e.shift(),i.push({id:o.id,level:n,left:o,right:s}),this.generateTreeDiff(o.children,s.children,i,n+1)):o.name0&&t.forEach((function(t){i.push({id:t.id,level:n,accepted:!1,acceptable:!r.usedLabelMap.hasOwnProperty(t.id),left:t,right:null}),r.generateTreeDiff(t.children,[],i,n+1)})),e.length>0&&e.forEach((function(t){i.push({id:t.id,level:n,accepted:!1,acceptable:!0,left:null,right:t}),r.generateTreeDiff([],t.children,i,n+1)})),i},filterRelevantItems:function(t){var e=[];return t.forEach((function(t,i){null!==t.left&&null!==t.right||e.push(i)})),e.forEach((function(e){t[e].relevant=!0;for(var i=t[e].level,n=e;n>=0&&i>0;)t[n].level=i;)e.call(this,this.diff[n]),n+=1},doForAllParents:function(t,e){for(var i=t.level,n=this.diff.indexOf(t)-1;i>0&&n>=0;)this.diff[n].level0},labelTreeIds:function(){return this.labelTrees.map((function(t){return t.id}))},attachableLabelTrees:function(){var t=this;return this.availableLabelTrees.filter((function(e){return-1===t.labelTreeIds.indexOf(e.id)}))}},methods:{fetchAvailableLabelTrees:function(){this.fetchedAvailableLabelTrees||(this.fetchedAvailableLabelTrees=!0,this.startLoading(),bl.queryAvailableLabelTrees({id:this.project.id}).then(this.availableLabelTreesFetched,su).finally(this.finishLoading))},availableLabelTreesFetched:function(t){this.availableLabelTrees=t.data.map(this.parseLabelTreeVersionedName)},attachTree:function(t){var e=this;t&&(this.startLoading(),bl.attachLabelTree({id:this.project.id},{id:t.id}).then((function(){return e.treeAttached(t)}),su).finally(this.finishLoading))},treeAttached:function(t){for(var e=this.availableLabelTrees.length-1;e>=0;e--)this.availableLabelTrees[e].id===t.id&&this.availableLabelTrees.splice(e,1);this.labelTrees.push(t)},removeTree:function(t){var e=this;this.startLoading(),bl.detachLabelTree({id:this.project.id,label_tree_id:t.id}).then((function(){return e.treeRemoved(t)}),su).finally(this.finishLoading)},treeRemoved:function(t){for(var e=this.labelTrees.length-1;e>=0;e--)this.labelTrees[e].id===t.id&&this.labelTrees.splice(e,1);this.availableLabelTrees.push(t)},parseLabelTreeVersionedName:function(t){return t.version&&(t.name=t.name+" @ "+t.version.name),t}},watch:{labelTrees:function(t){Pl.$emit("project.label-trees.count",t.length)}},created:function(){this.canEdit=biigle.$require("projects.canEdit"),this.labelTrees=biigle.$require("projects.labelTrees").map(this.parseLabelTreeVersionedName),this.project=biigle.$require("projects.project")}},undefined,undefined,!1,null,null,null).exports;const Pc=Sl({methods:{updateCount:function(t){this.$el.textContent=t}},created:function(){Pl.$on("project.label-trees.count",this.updateCount)}},undefined,undefined,!1,null,null,null).exports;const kc=Sl({mixins:[uu],data:function(){return{project:null,canEdit:!1,members:[],roles:{},defaultRole:null,userId:null}},components:{memberList:fc,addMemberForm:cc},methods:{attachMember:function(t){var e=this;this.startLoading(),bl.addUser({id:this.project.id,user_id:t.id},{project_role_id:t.role_id}).then((function(){return e.memberAttached(t)}),su).finally(this.finishLoading)},memberAttached:function(t){this.members.push(t)},updateMember:function(t,e){var i=this;this.startLoading(),bl.updateUser({id:this.project.id,user_id:t.id},{project_role_id:e.role_id}).then((function(){return i.memberUpdated(t,e)}),su).finally(this.finishLoading)},memberUpdated:function(t,e){t.role_id=e.role_id},removeMember:function(t){var e=this;this.startLoading(),bl.removeUser({id:this.project.id,user_id:t.id}).then((function(){return e.memberRemoved(t)}),su).finally(this.finishLoading)},memberRemoved:function(t){for(var e=this.members.length-1;e>=0;e--)this.members[e].id===t.id&&this.members.splice(e,1)}},watch:{members:function(t){Pl.$emit("project.members.count",t.length)}},created:function(){this.project=biigle.$require("projects.project"),this.canEdit=biigle.$require("projects.canEdit"),this.roles=biigle.$require("projects.roles"),this.defaultRole=biigle.$require("projects.defaultRole"),this.members=biigle.$require("projects.members"),this.userId=biigle.$require("projects.userId")}},undefined,undefined,!1,null,null,null).exports;const Rc=Sl({methods:{updateCount:function(t){this.$el.textContent=t}},created:function(){Pl.$on("project.members.count",this.updateCount)}},undefined,undefined,!1,null,null,null).exports;const Lc=Sl({mixins:[uu,lu],components:{dropdown:Yh},data:function(){return{project:null,name:null,description:null,userId:null,redirectUrl:null}},computed:{hasDescription:function(){return!!this.description.length},isChanged:function(){return this.name!==this.project.name||this.description!==this.project.description},disabledClass:function(){return this.loading?"disabled":""}},methods:{discardChanges:function(){this.name=this.project.name,this.description=this.project.description,this.finishEditing()},leaveProject:function(){confirm('Do you really want to revoke your membership of project "'.concat(this.project.name,'"?'))&&(this.startLoading(),bl.removeUser({id:this.project.id,user_id:this.userId}).then(this.projectLeft,su).finally(this.finishLoading))},projectLeft:function(){var t=this;au.success("You left the project. Redirecting..."),setTimeout((function(){return location.href=t.redirectUrl}),2e3)},deleteProject:function(){confirm("Do you really want to delete the project ".concat(this.project.name,"?"))&&(this.startLoading(),bl.delete({id:this.project.id}).then(this.projectDeleted,this.maybeForceDeleteProject).finally(this.finishLoading))},maybeForceDeleteProject:function(t){400===t.status?confirm("Deleting this project will delete one or more volumes with all annotations! Do you want to continue?")&&(this.startLoading(),bl.delete({id:this.project.id},{force:!0}).then(this.projectDeleted,su).finally(this.finishLoading)):su(t)},projectDeleted:function(){var t=this;au.success("The project was deleted. Redirecting..."),setTimeout((function(){return location.href=t.redirectUrl}),2e3)},saveChanges:function(){this.startLoading(),bl.update({id:this.project.id},{name:this.name,description:this.description}).then(this.changesSaved,su).finally(this.finishLoading)},changesSaved:function(){this.project.name=this.name,this.project.description=this.description,this.finishEditing()}},created:function(){this.project=biigle.$require("projects.project"),this.name=this.project.name,this.description=this.project.description,this.userId=biigle.$require("projects.userId"),this.redirectUrl=biigle.$require("projects.redirectUrl")}},undefined,undefined,!1,null,null,null).exports,Fc=Vue.resource("api/v1/projects{/id}/attachable-volumes");const Mc=Sl({mixins:[uu],data:function(){return{project:null,volumes:[],fetchedAttachableVolumes:!1,attachableVolumes:[],filterString:"",showImageVolumes:!0,showVideoVolumes:!0}},components:{previewThumbnail:Cc,typeahead:Zl},computed:{filteredVolumes:function(){var t=this.volumes;if(this.showImageVolumes||(t=t.filter((function(t){return"image"!==t.media_type.name}))),this.showVideoVolumes||(t=t.filter((function(t){return"video"!==t.media_type.name}))),this.hasFiltering){var e=this.filterString.toLowerCase();t=t.filter((function(t){return t.name.toLowerCase().includes(e)}))}return t},hasFiltering:function(){return this.filterString.length>0},filterInputClass:function(){return this.hasFiltering?"volume-filter--active":""},hasVolumes:function(){return this.volumes.length>0},hasNoMatchingVolumes:function(){return this.hasVolumes&&0===this.filteredVolumes.length},hasMixedMediaTypes:function(){return this.volumes.some((function(t){return"image"===t.media_type.name}))&&this.volumes.some((function(t){return"video"===t.media_type.name}))},toggleImageVolumesClass:function(){return this.showVideoVolumes?"btn-default":"btn-info active"},toggleVideoVolumesClass:function(){return this.showImageVolumes?"btn-default":"btn-info active"}},methods:{removeVolume:function(t){var e=this;this.startLoading(),bl.detachVolume({id:this.project.id,volume_id:t}).then((function(){return e.volumeRemoved(t)}),(function(i){400===i.status?confirm("The volume you are about to remove belongs only to this project and will be deleted. Are you sure you want to delete this volume?")&&e.forceRemoveVolume(t):su(i)})).finally(this.finishLoading)},forceRemoveVolume:function(t){var e=this;this.startLoading(),bl.detachVolume({id:this.project.id,volume_id:t},{force:!0}).then((function(){return e.volumeRemoved(t)}),su).finally(this.finishLoading)},volumeRemoved:function(t){for(var e=this.volumes.length-1;e>=0;e--)this.volumes[e].id===t&&(this.attachableVolumes.unshift(this.volumes[e]),this.volumes.splice(e,1))},hasVolume:function(t){for(var e=this.volumes.length-1;e>=0;e--)if(this.volumes[e].id===t)return!0;return!1},attachVolume:function(t){var e=this;t&&!this.hasVolume(t.id)&&(this.startLoading(),bl.attachVolume({id:this.project.id,volume_id:t.id},{}).then((function(){return e.volumeAttached(t)}),su).finally(this.finishLoading))},volumeAttached:function(t){this.volumes.unshift(t);for(var e=this.attachableVolumes.length-1;e>=0;e--)this.attachableVolumes[e].id===t.id&&this.attachableVolumes.splice(e,1)},fetchAttachableVolumes:function(){this.fetchedAttachableVolumes||(this.fetchedAttachableVolumes=!0,this.startLoading(),Fc.get({id:this.project.id}).then(this.attachableVolumesFetched,su).finally(this.finishLoading))},attachableVolumesFetched:function(t){this.attachableVolumes=t.data.map(this.processVolumes)},clearFiltering:function(t){t.preventDefault(),this.filterString=""},toggleImageVolumes:function(){this.showVideoVolumes=!this.showVideoVolumes,this.showImageVolumes||this.showVideoVolumes||(this.showImageVolumes=!0)},toggleVideoVolumes:function(){this.showImageVolumes=!this.showImageVolumes,this.showVideoVolumes||this.showImageVolumes||(this.showVideoVolumes=!0)},processVolumes:function(t){return t.icon="image"===t.media_type.name?"image":"film",t}},watch:{volumes:function(t){Pl.$emit("project.volumes.count",t.length)}},created:function(){this.project=biigle.$require("projects.project"),this.volumes=biigle.$require("projects.volumes").map(this.processVolumes)}},undefined,undefined,!1,null,null,null).exports;const Oc=Sl({methods:{updateCount:function(t){this.$el.textContent=t}},created:function(){Pl.$on("project.volumes.count",this.updateCount)}},undefined,undefined,!1,null,null,null).exports;biigle.$mount("project-label-trees-count",Pc),biigle.$mount("project-members-count",Rc),biigle.$mount("project-volumes-count",Oc),biigle.$mount("projects-dashboard-main",Tc),biigle.$mount("projects-show-label-trees",Ac),biigle.$mount("projects-show-members",kc),biigle.$mount("projects-show-volumes",Mc),biigle.$mount("projects-title",Lc);const $c=Sl({props:{rule:{type:Object,required:!0}},data:function(){return{name:this.rule.id}},computed:{dataName:function(){return this.rule.data?this.rule.data.name:""}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("span",[i("strong",[t._v("with"),t.rule.negate?i("span",[t._v("out")]):t._e()]),t._v(" "),i("span",{domProps:{textContent:t._s(t.name)}}),t._v(" "),t.dataName?i("strong",{domProps:{textContent:t._s(t.dataName)}}):t._e()])}),[],!1,null,null,null).exports;const Dc=Sl({components:{typeahead:Zl},props:{volumeId:{type:Number,required:!0}},data:function(){return{items:[],placeholder:"",selectedItem:null,typeaheadMoreInfo:""}},computed:{value:function(){return this.selectedItem?this.selectedItem.name:""}},methods:{select:function(t){this.selectedItem=t},gotItems:function(t){this.items=t.data},parseUsernames:function(t){return t.data=t.data.map((function(t){return t.name=t.firstname+" "+t.lastname,t})),t},submit:function(){this.$emit("select",this.selectedItem)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"filter-select"},[i("typeahead",{attrs:{items:t.items,value:t.value,placeholder:t.placeholder,"more-info":t.typeaheadMoreInfo},on:{select:t.select}}),t._v(" "),i("button",{staticClass:"btn btn-default",attrs:{type:"submit",disabled:!t.selectedItem},on:{click:t.submit}},[t._v("Add rule")])],1)}),[],!1,null,null,null).exports,jc=Vue.resource("api/v1/volumes{/id}",{},{queryFilesWithFileLabels:{method:"GET",url:"api/v1/volumes{/id}/files/filter/labels"},queryFilesWithLabel:{method:"GET",url:"api/v1/volumes{/id}/files/filter/labels{/label_id}"},queryFilesWithLabelFromUser:{method:"GET",url:"api/v1/volumes{/id}/files/filter/labels/users{/user_id}"},queryFilesWithFilename:{method:"GET",url:"api/v1/volumes{/id}/files/filter/filename{/pattern}"},queryUsedFileLabels:{method:"GET",url:"api/v1/volumes{/id}/file-labels"},queryFilenames:{method:"GET",url:"api/v1/volumes{/id}/filenames"},queryFileLabels:{method:"GET",url:"api/v1/volumes{/id}/files/labels"},queryUsers:{method:"GET",url:"api/v1/volumes{/id}/users"},queryFiles:{method:"GET",url:"api/v1/volumes{/id}/files"},saveFiles:{method:"POST",url:"api/v1/volumes{/id}/files"},queryFilesWithAnnotations:{method:"GET",url:"api/v1/volumes{/id}/files/filter/annotations"},queryFilesWithAnnotationLabel:{method:"GET",url:"api/v1/volumes{/id}/files/filter/annotation-label{/label_id}"},queryFilesWithAnnotationFromUser:{method:"GET",url:"api/v1/volumes{/id}/files/filter/annotation-user{/user_id}"},queryAnnotationLabels:{method:"GET",url:"api/v1/volumes{/id}/annotation-labels"}});const Nc=[{id:"fileLabels",types:["image"],label:"image labels",help:"All images that (don't) have image labels attached.",listComponent:{mixins:[$c],data:function(){return{name:"image labels"}}},getSequence:function(t){return jc.queryFilesWithFileLabels({id:t})}},{id:"fileLabels",types:["video"],label:"video labels",help:"All videos that (don't) have video labels attached.",listComponent:{mixins:[$c],data:function(){return{name:"video labels"}}},getSequence:function(t){return jc.queryFilesWithFileLabels({id:t})}},{id:"imageLabel",types:["image"],label:"image label",help:"All images that (don't) have the given image label attached.",listComponent:{mixins:[$c],data:function(){return{name:"image label"}}},selectComponent:{mixins:[Dc],components:{typeahead:Jh},data:function(){return{placeholder:"Label name"}},created:function(){jc.queryUsedFileLabels({id:this.volumeId}).then(this.gotItems,su)}},getSequence:function(t,e){return jc.queryFilesWithLabel({id:t,label_id:e.id})}},{id:"videoLabel",types:["video"],label:"video label",help:"All videos that (don't) have the given video label attached.",listComponent:{mixins:[$c],data:function(){return{name:"video label"}}},selectComponent:{mixins:[Dc],components:{typeahead:Jh},data:function(){return{placeholder:"Label name"}},created:function(){jc.queryUsedFileLabels({id:this.volumeId}).then(this.gotItems,su)}},getSequence:function(t,e){return jc.queryFilesWithLabel({id:t,label_id:e.id})}},{id:"imageLabelUser",types:["image"],label:"image label from user",help:"All images that (don't) have one or more image labels attached by the given user.",listComponent:{mixins:[$c],data:function(){return{name:"image label from user"}}},selectComponent:{mixins:[Dc],data:function(){return{placeholder:"User name",typeaheadMoreInfo:"affiliation"}},created:function(){jc.queryUsers({id:this.volumeId}).then(this.parseUsernames,su).then(this.gotItems)}},getSequence:function(t,e){return jc.queryFilesWithLabelFromUser({id:t,user_id:e.id})}},{id:"videoLabelUser",types:["video"],label:"video label from user",help:"All videos that (don't) have one or more video labels attached by the given user.",listComponent:{mixins:[$c],data:function(){return{name:"video label from user"}}},selectComponent:{mixins:[Dc],data:function(){return{placeholder:"User name",typeaheadMoreInfo:"affiliation"}},created:function(){jc.queryUsers({id:this.volumeId}).then(this.parseUsernames,su).then(this.gotItems)}},getSequence:function(t,e){return jc.queryFilesWithLabelFromUser({id:t,user_id:e.id})}},{id:"filename",types:["image","video"],label:"filename",help:"All :types that (don't) have a filename matching the given pattern. A pattern may contain the wildcard character * that matches any string of zero or more characters.",listComponent:{mixins:[$c],computed:{dataName:function(){return this.rule.data}}},selectComponent:{template:'
\n
\n \n
\n \n
',data:function(){return{selectedItem:null}},methods:{submit:function(){this.$emit("select",this.selectedItem)}}},getSequence:function(t,e){return jc.queryFilesWithFilename({id:t,pattern:e})}},{id:"annotations",types:["image","video"],label:"annotations",help:"All :types that (don't) contain annotations.",listComponent:$c,getSequence:function(t){return jc.queryFilesWithAnnotations({id:t})}},{id:"annotationLabels",types:["image","video"],label:"annotation with label",help:"All :types that (don't) contain one or more annotations with the given label.",listComponent:{mixins:[$c],data:function(){return{name:"annotation with label"}}},selectComponent:{mixins:[Dc],components:{typeahead:Jh},data:function(){return{placeholder:"Label name"}},created:function(){jc.queryAnnotationLabels({id:this.volumeId}).then(this.gotItems,su)}},getSequence:function(t,e){return jc.queryFilesWithAnnotationLabel({id:t,label_id:e.id})}},{id:"annotationUser",types:["image","video"],label:"annotations from user",help:"All :types that (don't) contain one or more annotations from the given user.",listComponent:{mixins:[$c],data:function(){return{name:"annotations from user"}}},selectComponent:{mixins:[Dc],data:function(){return{placeholder:"User name",typeaheadMoreInfo:"affiliation"}},created:function(){jc.queryUsers({id:this.volumeId}).then(this.parseUsernames,su).then(this.gotItems)}},getSequence:function(t,e){return jc.queryFilesWithAnnotationFromUser({id:t,user_id:e.id})}}];const Bc=Sl({data:function(){return{thumbnailUrl:null,timeout:null}},props:{image:{type:Object,required:!0},emptyUrl:{type:String,required:!0},selectable:{type:Boolean,required:!1},selectedIcon:{type:String,default:"check"},selectedFade:{type:Boolean,default:!0},smallIcon:{type:Boolean,default:!1}},computed:{classObject:function(){return{"image-grid__image--selected":this.selected,"image-grid__image--selectable":this.selectable,"image-grid__image--fade":this.selectedFade,"image-grid__image--small-icon":this.smallIcon}},selected:function(){return!1},iconClass:function(){return"fa-"+this.selectedIcon},showIcon:function(){return this.selectable||this.selected},srcUrl:function(){return Array.isArray(this.thumbnailUrl)?this.thumbnailUrl[0]:this.thumbnailUrl?this.thumbnailUrl:this.emptyUrl}},methods:{toggleSelect:function(t){this.selectable&&this.$emit("select",this.image,t)},gotBlob:function(t){var e=window.URL||window.webkitURL;this.thumbnailUrl=e.createObjectURL(t.body),this.image.blob=this.thumbnailUrl},showEmptyImage:function(){this.thumbnailUrl=null}},created:function(){var t=this;this.image.thumbnailUrl?this.thumbnailUrl=this.image.thumbnailUrl:this.image.blob?this.thumbnailUrl=this.image.blob:this.getThumbnailUrl?this.thumbnailUrl=this.getThumbnailUrl():this.getBlob&&(this.timeout=setTimeout((function(){return t.getBlob().then(t.gotBlob)}),50))},beforeDestroy:function(){clearTimeout(this.timeout)}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("figure",{staticClass:"image-grid__image",class:t.classObject},[t.showIcon?i("div",{staticClass:"image-icon"},[i("i",{staticClass:"fas",class:t.iconClass})]):t._e(),t._v(" "),i("img",{attrs:{src:t.srcUrl},on:{click:t.toggleSelect,error:t.showEmptyImage}})])}),[],!1,null,null,null).exports;var Uc=Sl({data:function(){return{scrolling:!1}},props:{progress:{type:Number,required:!0}},computed:{isAtTop:function(){return 0===this.progress},isAtBottom:function(){return 1===this.progress},progressHeight:function(){return 100*this.progress+"%"}},methods:{top:function(){this.$emit("top")},prevPage:function(){this.$emit("prev-page")},prevRow:function(){this.$emit("prev-row")},beginScrolling:function(){this.scrolling=!0},stopScrolling:function(){this.scrolling=!1},scroll:function(t){this.scrolling&&this.jump(t)},jump:function(t){var e=t.target.getBoundingClientRect();this.$emit("jump",(t.clientY-e.top)/e.height)},nextRow:function(){this.$emit("next-row")},nextPage:function(){this.$emit("next-page")},bottom:function(){this.$emit("bottom")}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"image-grid-progress"},[i("div",{staticClass:"btn-group-vertical"},[i("button",{staticClass:"btn btn-default btn-xs",attrs:{type:"button",title:"Go to top 𝗛𝗼𝗺𝗲",disabled:t.isAtTop},on:{click:t.top}},[i("span",{staticClass:"fa fa-fast-backward fa-rotate-90"})]),t._v(" "),i("button",{staticClass:"btn btn-default btn-xs",attrs:{type:"button",title:"Previous page 𝗣𝗮𝗴𝗲 𝘂𝗽/𝗔𝗿𝗿𝗼𝘄 𝗹𝗲𝗳𝘁",disabled:t.isAtTop},on:{click:t.prevPage}},[i("span",{staticClass:"fa fa-step-backward fa-rotate-90"})]),t._v(" "),i("button",{staticClass:"btn btn-default btn-xs",attrs:{type:"button",title:"Previous row 𝗔𝗿𝗿𝗼𝘄 𝘂𝗽",disabled:t.isAtTop},on:{click:t.prevRow}},[i("span",{staticClass:"fa fa-chevron-up"})])]),t._v(" "),i("div",{staticClass:"image-grid-progress__bar",on:{mousedown:t.beginScrolling,mouseup:t.stopScrolling,mouseleave:t.stopScrolling,mousemove:function(e){return e.preventDefault(),t.scroll(e)},click:t.jump}},[i("div",{staticClass:"image-grid-progress__wrapper"},[i("div",{staticClass:"image-grid-progress__inner",style:{height:t.progressHeight}})])]),t._v(" "),i("div",{staticClass:"btn-group-vertical"},[i("button",{staticClass:"btn btn-default btn-xs",attrs:{type:"button",title:"Next row 𝗔𝗿𝗿𝗼𝘄 𝗱𝗼𝘄𝗻",disabled:t.isAtBottom},on:{click:t.nextRow}},[i("span",{staticClass:"fa fa-chevron-down"})]),t._v(" "),i("button",{staticClass:"btn btn-default btn-xs",attrs:{type:"button",title:"Next page 𝗣𝗮𝗴𝗲 𝗱𝗼𝘄𝗻/𝗔𝗿𝗿𝗼𝘄 𝗿𝗶𝗴𝗵𝘁",disabled:t.isAtBottom},on:{click:t.nextPage}},[i("span",{staticClass:"fa fa-step-forward fa-rotate-90"})]),t._v(" "),i("button",{staticClass:"btn btn-default btn-xs",attrs:{type:"button",title:"Go to bottom 𝗘𝗻𝗱",disabled:t.isAtBottom},on:{click:t.bottom}},[i("span",{staticClass:"fa fa-fast-forward fa-rotate-90"})])])])}),[],!1,null,null,null);const zc=Sl({data:function(){return{clientWidth:0,clientHeight:0,offset:0,imagesOffset:0,imagesOffsetTimeout:null}},components:{imageGridImage:Bc,imageGridProgress:Uc.exports},props:{images:{type:Array,required:!0},emptyUrl:{type:String,required:!0},width:{type:Number,default:135},height:{type:Number,default:180},margin:{type:Number,default:8},initialOffset:{type:Number,default:0},selectable:{type:Boolean,default:!1},selectedIcon:{type:String,default:"check"},listenerSet:{type:String,default:"default"}},computed:{columns:function(){return Math.max(1,Math.floor(this.clientWidth/(this.width+this.margin)))},rows:function(){return Math.max(1,Math.floor(this.clientHeight/(this.height+this.margin)))},imagesOffsetEnd:function(){return this.imagesOffset+this.columns*this.rows},displayedImages:function(){return this.images.slice(this.imagesOffset,this.imagesOffsetEnd)},progress:function(){return this.offset/(this.columns*this.lastRow)},lastRow:function(){return Math.max(0,Math.ceil(this.images.length/this.columns)-this.rows)},lastOffset:function(){return this.lastRow*this.columns},canScroll:function(){return this.lastRow>0}},methods:{updateDimensions:function(){this.$refs.images&&(this.clientHeight=this.$refs.images.clientHeight,this.clientWidth=this.$refs.images.clientWidth)},scrollRows:function(t,e){this.setOffset(this.offset+this.columns*t,e)},scroll:function(t){this.scrollRows(t.deltaY>=0?1:-1,!0)},advanceRow:function(){this.scrollRows(1)},advancePage:function(){this.scrollRows(this.rows)},reverseRow:function(){this.scrollRows(-1)},reversePage:function(){this.scrollRows(-this.rows)},jumpToPercent:function(t){this.setOffset(this.columns*Math.round(this.lastRow*t))},jumpToStart:function(){this.jumpToPercent(0)},jumpToEnd:function(){this.jumpToPercent(1)},emitSelect:function(t,e){this.$emit("select",t,e)},setOffset:function(t,e){var i=this;this.offset=Math.max(0,Math.min(this.lastOffset,t)),clearTimeout(this.imagesOffsetTimeout),e?this.imagesOffsetTimeout=setTimeout((function(){i.imagesOffset=i.offset}),25):this.imagesOffset=this.offset}},watch:{lastOffset:function(){this.setOffset(this.offset)},offset:function(){this.$emit("scroll",this.offset)}},created:function(){kl.on("ArrowUp",this.reverseRow,0,this.listenerSet),kl.on("w",this.reverseRow,0,this.listenerSet),kl.on("ArrowDown",this.advanceRow,0,this.listenerSet),kl.on("s",this.advanceRow,0,this.listenerSet),kl.on("ArrowLeft",this.reversePage,0,this.listenerSet),kl.on("a",this.reversePage,0,this.listenerSet),kl.on("ArrowRight",this.advancePage,0,this.listenerSet),kl.on("d",this.advancePage,0,this.listenerSet),kl.on("PageUp",this.reversePage,0,this.listenerSet),kl.on("PageDown",this.advancePage,0,this.listenerSet),kl.on("Home",this.jumpToStart,0,this.listenerSet),kl.on("End",this.jumpToEnd,0,this.listenerSet),this.setOffset(this.initialOffset)},mounted:function(){window.addEventListener("resize",this.updateDimensions),this.$on("resize",this.updateDimensions),this.$nextTick(this.updateDimensions),this.$watch("canScroll",this.updateDimensions)}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"image-grid",on:{wheel:function(e){return e.preventDefault(),t.scroll(e)}}},[i("div",{ref:"images",staticClass:"image-grid__images"},t._l(t.displayedImages,(function(e){return i("image-grid-image",{key:e.id,attrs:{image:e,"empty-url":t.emptyUrl,selectable:t.selectable,"selected-icon":t.selectedIcon},on:{select:t.emitSelect}})})),1),t._v(" "),t.canScroll?i("image-grid-progress",{attrs:{progress:t.progress},on:{top:t.jumpToStart,"prev-page":t.reversePage,"prev-row":t.reverseRow,jump:t.jumpToPercent,"next-row":t.advanceRow,"next-page":t.advancePage,bottom:t.jumpToEnd}}):t._e()],1)}),[],!1,null,null,null).exports;const Vc=Sl({props:{activeSorter:{type:String,default:""}},computed:{active:function(){return this.activeSorter===this.id},classObject:function(){return{active:this.active}}},methods:{getSequence:function(){return new Vue.Promise.resolve([])},handleClick:function(){this.active||this.$emit("select",this)}}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("button",{staticClass:"list-group-item",class:t.classObject,attrs:{title:t.title},domProps:{textContent:t._s(t.text)},on:{click:t.handleClick}})}),[],!1,null,null,null).exports;const Gc=[{id:"filename",types:["image","video"],component:{mixins:[Vc],data:function(){return{fileIds:[],title:"Sort images by filename",text:"Filename",id:"filename"}},methods:{getSequence:function(){return new Vue.Promise.resolve(this.fileIds)}},created:function(){this.fileIds=biigle.$require("volumes.fileIds")}}},{id:"id",types:["image","video"],component:{mixins:[Vc],data:function(){return{fileIds:[],title:"Sort images by ID",text:"ID",id:"id"}},computed:{ids:function(){return this.fileIds.slice().sort(this.compare)}},methods:{getSequence:function(){return new Vue.Promise.resolve(this.ids)},compare:function(t,e){return t-e}},created:function(){this.fileIds=biigle.$require("volumes.fileIds")}}},{id:"random",types:["image","video"],component:{mixins:[Vc],data:function(){return{fileIds:[],title:"Sort images randomly",text:"Random",id:"random"}},methods:{shuffle:function(t){var e,i,n;for(e=t.length-1;e>0;e--)i=Math.floor(Math.random()*(e+1)),n=t[e],t[e]=t[i],t[i]=n;return t},getSequence:function(){var t=this.shuffle(this.fileIds.slice());return new Vue.Promise.resolve(t)},handleClick:function(){this.$emit("select",this)}},created:function(){this.fileIds=biigle.$require("volumes.fileIds")}}}];biigle.$declare("annotations.api.volumes",jc),biigle.$declare("volumes.components.filterListComponent",$c),biigle.$declare("volumes.components.imageGrid",zc),biigle.$declare("volumes.components.imageGridImage",Bc),biigle.$declare("volumes.mixins.sortComponent",Vc),biigle.$declare("volumes.stores.filters",Nc),biigle.$declare("volumes.stores.sorters",Gc);const qc=Sl({props:["session","editing","editId"],computed:{title:function(){return this.editing?"Edit this annotation session":this.session.name},active:function(){var t=new Date;return this.session.starts_at_iso8601=t},currentlyEdited:function(){return this.session.id===this.editId},classObject:function(){return{"session--active":this.active,"list-group-item-info":this.currentlyEdited}}},methods:{edit:function(){this.editing&&!this.currentlyEdited&&this.$emit("edit",this.session)}}},undefined,undefined,!1,null,null,null).exports,Wc=Vue.resource("api/v1/annotation-sessions{/id}",{},{query:{method:"GET",url:"api/v1/volumes{/volume_id}/annotation-sessions"},save:{method:"POST",url:"api/v1/volumes{/volume_id}/annotation-sessions"}});const Kc=Sl({props:["user"],computed:{name:function(){return this.user.firstname+" "+this.user.lastname},title:function(){return"Remove "+this.name}},methods:{remove:function(){this.$emit("remove",this.user)}}},undefined,undefined,!1,null,null,null).exports;function Xc(t,e){var i=arguments;if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1;r=0:n.value===n.inputValue,a={btn:!0,active:n.inputType?s:n.active,disabled:n.disabled,"btn-block":n.block};a["btn-"+n.type]=Boolean(n.type),a["btn-"+n.size]=Boolean(n.size);var l,u,h,c={click:function(t){n.disabled&&t instanceof Event&&(t.preventDefault(),t.stopPropagation())}};return n.href?(l="a",h=i,u=ld(r,{on:c,class:a,attrs:{role:"button",href:n.href,target:n.target}})):n.to?(l="router-link",h=i,u=ld(r,{nativeOn:c,class:a,props:{event:n.disabled?"":"click",to:n.to,replace:n.replace,append:n.append,exact:n.exact},attrs:{role:"button"}})):n.inputType?(l="label",u=ld(r,{on:c,class:a}),h=[t("input",{attrs:{autocomplete:"off",type:n.inputType,checked:s?"checked":null,disabled:n.disabled},domProps:{checked:s},on:{input:function(t){t.stopPropagation()},change:function(){if(n.inputType===cd){var t=n.value.slice();s?t.splice(t.indexOf(n.inputValue),1):t.push(n.inputValue),o.input(t)}else o.input(n.inputValue)}}}),i]):n.justified?(l=hd,u={},h=[t("button",ld(r,{on:c,class:a,attrs:{type:n.nativeType,disabled:n.disabled}}),i)]):(l="button",h=i,u=ld(r,{on:c,class:a,attrs:{type:n.nativeType,disabled:n.disabled}})),t(l,u,h)},props:{justified:{type:Boolean,default:!1},type:{type:String,default:"default"},nativeType:{type:String,default:"button"},size:String,block:{type:Boolean,default:!1},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},value:null,inputValue:null,inputType:{type:String,validator:function(t){return t===cd||"radio"===t}}}};function fd(t,e){for(var i=e-(t+="").length;i>0;i--)t="0"+t;return t}var pd=["January","February","March","April","May","June","July","August","September","October","November","December"];function gd(t){return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds())}function md(t,e,i,n,r,o,s,a,l,u){"boolean"!=typeof s&&(l=a,a=s,s=!1);var h,c="function"==typeof i?i.options:i;if(t&&t.render&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),n&&(c._scopeId=n),o?(h=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=h):e&&(h=s?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),h)if(c.functional){var d=c.render;c.render=function(t,e){return h.call(e),d(t,e)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,h):[h]}return i}var vd={mixins:[ed],props:{month:Number,year:Number,date:Date,today:Date,limit:Object,weekStartsWith:Number,iconControlLeft:String,iconControlRight:String,dateClass:Function,yearMonthFormatter:Function,weekNumbers:Boolean},components:{Btn:dd},computed:{weekDays:function(){for(var t=[],e=this.weekStartsWith;t.length<7;)t.push(e++),e>6&&(e=0);return t},yearMonthStr:function(){return this.yearMonthFormatter?this.yearMonthFormatter(this.year,this.month):Yc(this.month)?this.year+" "+this.t("uiv.datePicker.month"+(this.month+1)):this.year},monthDayRows:function(){var t,e,i=[],n=new Date(this.year,this.month,1),r=new Date(this.year,this.month,0).getDate(),o=n.getDay(),s=(t=this.month,e=this.year,new Date(e,t+1,0).getDate()),a=0;a=this.weekStartsWith>o?7-this.weekStartsWith:0-this.weekStartsWith;for(var l=0;l<6;l++){i.push([]);for(var u=0-a;u<7-a;u++){var h=7*l+u,c={year:this.year,disabled:!1};h0?c.month=this.month-1:(c.month=11,c.year--)):h=this.limit.from),this.limit&&this.limit.to&&(p=d0?t--:(t=11,e--,this.$emit("year-change",e)),this.$emit("month-change",t)},goNextMonth:function(){var t=this.month,e=this.year;this.month<11?t++:(t=0,e++,this.$emit("year-change",e)),this.$emit("month-change",t)},changeView:function(){this.$emit("view-change","m")}}},yd=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("table",{staticStyle:{width:"100%"},attrs:{role:"grid"}},[i("thead",[i("tr",[i("td",[i("btn",{staticClass:"uiv-datepicker-pager-prev",staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goPrevMonth}},[i("i",{class:t.iconControlLeft})])],1),t._v(" "),i("td",{attrs:{colspan:t.weekNumbers?6:5}},[i("btn",{staticClass:"uiv-datepicker-title",staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.changeView}},[i("b",[t._v(t._s(t.yearMonthStr))])])],1),t._v(" "),i("td",[i("btn",{staticClass:"uiv-datepicker-pager-next",staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goNextMonth}},[i("i",{class:t.iconControlRight})])],1)]),t._v(" "),i("tr",{attrs:{align:"center"}},[t.weekNumbers?i("td"):t._e(),t._v(" "),t._l(t.weekDays,(function(e){return i("td",{attrs:{width:"14.2857142857%"}},[i("small",{staticClass:"uiv-datepicker-week"},[t._v(t._s(t.tWeekName(0===e?7:e)))])])}))],2)]),t._v(" "),i("tbody",t._l(t.monthDayRows,(function(e){return i("tr",[t.weekNumbers?i("td",{staticClass:"text-center",staticStyle:{"border-right":"1px solid #eee"}},[i("small",{staticClass:"text-muted"},[t._v(t._s(t.getWeekNumber(e[t.weekStartsWith])))])]):t._e(),t._v(" "),t._l(e,(function(e){return i("td",[i("btn",{class:e.classes,staticStyle:{border:"none"},attrs:{block:"",size:"sm","data-action":"select",type:t.getBtnType(e),disabled:e.disabled},on:{click:function(i){return t.select(e)}}},[i("span",{class:{"text-muted":t.month!==e.month},attrs:{"data-action":"select"}},[t._v(t._s(e.date))])])],1)}))],2)})),0)])};yd._withStripped=!0;var _d=md({render:yd,staticRenderFns:[]},undefined,vd,undefined,false,undefined,!1,void 0,void 0,void 0),bd={components:{Btn:dd},mixins:[ed],props:{month:Number,year:Number,iconControlLeft:String,iconControlRight:String},data:function(){return{rows:[]}},mounted:function(){for(var t=0;t<4;t++){this.rows.push([]);for(var e=0;e<3;e++)this.rows[t].push(3*t+e+1)}},methods:{tCell:function(t){return this.t("uiv.datePicker.month"+t)},getBtnClass:function(t){return t===this.month?"primary":"default"},goPrevYear:function(){this.$emit("year-change",this.year-1)},goNextYear:function(){this.$emit("year-change",this.year+1)},changeView:function(t){Yc(t)?(this.$emit("month-change",t),this.$emit("view-change","d")):this.$emit("view-change","y")}}},wd=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("table",{staticStyle:{width:"100%"},attrs:{role:"grid"}},[i("thead",[i("tr",[i("td",[i("btn",{staticClass:"uiv-datepicker-pager-prev",staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goPrevYear}},[i("i",{class:t.iconControlLeft})])],1),t._v(" "),i("td",{attrs:{colspan:"4"}},[i("btn",{staticClass:"uiv-datepicker-title",staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:function(e){return t.changeView()}}},[i("b",[t._v(t._s(t.year))])])],1),t._v(" "),i("td",[i("btn",{staticClass:"uiv-datepicker-pager-next",staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goNextYear}},[i("i",{class:t.iconControlRight})])],1)])]),t._v(" "),i("tbody",t._l(t.rows,(function(e,n){return i("tr",t._l(e,(function(e,r){return i("td",{attrs:{colspan:"2",width:"33.333333%"}},[i("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm",type:t.getBtnClass(3*n+r)},on:{click:function(e){return t.changeView(3*n+r)}}},[i("span",[t._v(t._s(t.tCell(e)))])])],1)})),0)})),0)])};wd._withStripped=!0;var xd=md({render:wd,staticRenderFns:[]},undefined,bd,undefined,false,undefined,!1,void 0,void 0,void 0),Sd={components:{Btn:dd},props:{year:Number,iconControlLeft:String,iconControlRight:String},computed:{rows:function(){for(var t=[],e=this.year-this.year%20,i=0;i<4;i++){t.push([]);for(var n=0;n<5;n++)t[i].push(e+5*i+n)}return t},yearStr:function(){var t=this.year-this.year%20;return t+" ~ "+(t+19)}},methods:{getBtnClass:function(t){return t===this.year?"primary":"default"},goPrevYear:function(){this.$emit("year-change",this.year-20)},goNextYear:function(){this.$emit("year-change",this.year+20)},changeView:function(t){this.$emit("year-change",t),this.$emit("view-change","m")}}},Cd=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("table",{staticStyle:{width:"100%"},attrs:{role:"grid"}},[i("thead",[i("tr",[i("td",[i("btn",{staticClass:"uiv-datepicker-pager-prev",staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goPrevYear}},[i("i",{class:t.iconControlLeft})])],1),t._v(" "),i("td",{attrs:{colspan:"3"}},[i("btn",{staticClass:"uiv-datepicker-title",staticStyle:{border:"none"},attrs:{block:"",size:"sm"}},[i("b",[t._v(t._s(t.yearStr))])])],1),t._v(" "),i("td",[i("btn",{staticClass:"uiv-datepicker-pager-next",staticStyle:{border:"none"},attrs:{block:"",size:"sm"},on:{click:t.goNextYear}},[i("i",{class:t.iconControlRight})])],1)])]),t._v(" "),i("tbody",t._l(t.rows,(function(e){return i("tr",t._l(e,(function(e){return i("td",{attrs:{width:"20%"}},[i("btn",{staticStyle:{border:"none"},attrs:{block:"",size:"sm",type:t.getBtnClass(e)},on:{click:function(i){return t.changeView(e)}}},[i("span",[t._v(t._s(e))])])],1)})),0)})),0)])};Cd._withStripped=!0;var Td={mixins:[ed],components:{DateView:_d,MonthView:xd,YearView:md({render:Cd,staticRenderFns:[]},undefined,Sd,undefined,false,undefined,!1,void 0,void 0,void 0),Btn:dd},props:{value:null,width:{type:Number,default:270},todayBtn:{type:Boolean,default:!0},clearBtn:{type:Boolean,default:!0},closeOnSelected:{type:Boolean,default:!0},limitFrom:null,limitTo:null,format:{type:String,default:"yyyy-MM-dd"},initialView:{type:String,default:"d"},dateParser:{type:Function,default:Date.parse},dateClass:Function,yearMonthFormatter:Function,weekStartsWith:{type:Number,default:0,validator:function(t){return t>=0&&t<=6}},weekNumbers:Boolean,iconControlLeft:{type:String,default:"glyphicon glyphicon-chevron-left"},iconControlRight:{type:String,default:"glyphicon glyphicon-chevron-right"}},data:function(){return{show:!1,now:new Date,currentMonth:0,currentYear:0,view:"d"}},computed:{valueDateObj:function(){var t=this.dateParser(this.value);if(isNaN(t))return null;var e=new Date(t);return 0!==e.getHours()&&(e=new Date(t+60*e.getTimezoneOffset()*1e3)),e},pickerStyle:function(){return{width:this.width+"px"}},pickerClass:function(){return{"uiv-datepicker":!0,"uiv-datepicker-date":"d"===this.view,"uiv-datepicker-month":"m"===this.view,"uiv-datepicker-year":"y"===this.view}},limit:function(){var t={};if(this.limitFrom){var e=this.dateParser(this.limitFrom);isNaN(e)||((e=gd(new Date(e))).setHours(0,0,0,0),t.from=e)}if(this.limitTo){var i=this.dateParser(this.limitTo);isNaN(i)||((i=gd(new Date(i))).setHours(0,0,0,0),t.to=i)}return t}},mounted:function(){this.value?this.setMonthAndYearByValue(this.value):(this.currentMonth=this.now.getMonth(),this.currentYear=this.now.getFullYear(),this.view=this.initialView)},watch:{value:function(t,e){this.setMonthAndYearByValue(t,e)}},methods:{setMonthAndYearByValue:function(t,e){var i=this.dateParser(t);if(!isNaN(i)){var n=new Date(i);0!==n.getHours()&&(n=new Date(i+60*n.getTimezoneOffset()*1e3)),this.limit&&(this.limit.from&&n=this.limit.to)?this.$emit("input",e||""):(this.currentMonth=n.getMonth(),this.currentYear=n.getFullYear())}},onMonthChange:function(t){this.currentMonth=t},onYearChange:function(t){this.currentYear=t,this.currentMonth=void 0},onDateChange:function(t){if(t&&Zc(t.date)&&Zc(t.month)&&Zc(t.year)){var e=new Date(t.year,t.month,t.date);this.$emit("input",this.format?function(t,e){try{var i=t.getFullYear(),n=t.getMonth()+1,r=t.getDate(),o=pd[n-1];return e.replace(/yyyy/g,i).replace(/MMMM/g,o).replace(/MMM/g,o.substring(0,3)).replace(/MM/g,fd(n,2)).replace(/dd/g,fd(r,2)).replace(/yy/g,i).replace(/M(?!a)/g,n).replace(/d/g,r)}catch(t){return""}}(e,this.format):e),this.currentMonth=t.month,this.currentYear=t.year}else this.$emit("input","")},onViewChange:function(t){this.view=t},selectToday:function(){this.view="d",this.onDateChange({date:this.now.getDate(),month:this.now.getMonth(),year:this.now.getFullYear()})},clearSelect:function(){this.currentMonth=this.now.getMonth(),this.currentYear=this.now.getFullYear(),this.view=this.initialView,this.onDateChange()},onPickerClick:function(t){"select"===t.target.getAttribute("data-action")&&this.closeOnSelected||t.stopPropagation()}}},Ed=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{class:t.pickerClass,style:t.pickerStyle,attrs:{"data-role":"date-picker"},on:{click:t.onPickerClick}},[i("date-view",{directives:[{name:"show",rawName:"v-show",value:"d"===t.view,expression:"view==='d'"}],attrs:{month:t.currentMonth,year:t.currentYear,date:t.valueDateObj,today:t.now,limit:t.limit,"week-starts-with":t.weekStartsWith,"icon-control-left":t.iconControlLeft,"icon-control-right":t.iconControlRight,"date-class":t.dateClass,"year-month-formatter":t.yearMonthFormatter,"week-numbers":t.weekNumbers,locale:t.locale},on:{"month-change":t.onMonthChange,"year-change":t.onYearChange,"date-change":t.onDateChange,"view-change":t.onViewChange}}),t._v(" "),i("month-view",{directives:[{name:"show",rawName:"v-show",value:"m"===t.view,expression:"view==='m'"}],attrs:{month:t.currentMonth,year:t.currentYear,"icon-control-left":t.iconControlLeft,"icon-control-right":t.iconControlRight,locale:t.locale},on:{"month-change":t.onMonthChange,"year-change":t.onYearChange,"view-change":t.onViewChange}}),t._v(" "),i("year-view",{directives:[{name:"show",rawName:"v-show",value:"y"===t.view,expression:"view==='y'"}],attrs:{year:t.currentYear,"icon-control-left":t.iconControlLeft,"icon-control-right":t.iconControlRight},on:{"year-change":t.onYearChange,"view-change":t.onViewChange}}),t._v(" "),t.todayBtn||t.clearBtn?i("div",[i("br"),t._v(" "),i("div",{staticClass:"text-center"},[t.todayBtn?i("btn",{attrs:{"data-action":"select",type:"info",size:"sm"},domProps:{textContent:t._s(t.t("uiv.datePicker.today"))},on:{click:t.selectToday}}):t._e(),t._v(" "),t.clearBtn?i("btn",{attrs:{"data-action":"select",size:"sm"},domProps:{textContent:t._s(t.t("uiv.datePicker.clear"))},on:{click:t.clearSelect}}):t._e()],1)]):t._e()],1)};Ed._withStripped=!0;const Id=Sl({props:{placeholder:{type:String,default:""},value:{type:String,default:""}},components:{dropdown:Yh,datePicker:md({render:Ed,staticRenderFns:[]},undefined,Td,undefined,false,undefined,!1,void 0,void 0,void 0)},data:function(){return{internalValue:""}},watch:{internalValue:function(t){this.$emit("input",t)},value:function(t){this.internalValue=t}},created:function(){this.internalValue=this.value}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("dropdown",[i("div",{staticClass:"input-group"},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.internalValue,expression:"internalValue"}],staticClass:"form-control",attrs:{type:"text",placeholder:t.placeholder},domProps:{value:t.internalValue},on:{input:function(e){e.target.composing||(t.internalValue=e.target.value)}}}),t._v(" "),i("div",{staticClass:"input-group-btn"},[i("button",{staticClass:"btn btn-default dropdown-toggle",attrs:{type:"button"}},[i("i",{staticClass:"fa fa-calendar"})])])]),t._v(" "),i("template",{slot:"dropdown"},[i("li",[i("date-picker",{attrs:{"icon-control-left":"fa fa-chevron-left","icon-control-right":"fa fa-chevron-right"},model:{value:t.internalValue,callback:function(e){t.internalValue=e},expression:"internalValue"}})],1)])],2)}),[],!1,null,null,null).exports;const Ad=Sl({mixins:[uu,lu],data:function(){return{volumeId:null,sessions:null,editedSession:{name:null,description:null,starts_at_iso8601:null,starts_at:null,ends_at_iso8601:null,ends_at:null,hide_other_users_annotations:!1,hide_own_annotations:!1,users:[]},users:[],errors:{}}},components:{typeahead:Zl,listItem:qc,userTag:Kc,datepickerDropdown:Id},computed:{classObject:function(){return{"panel-warning panel--editing":this.editing}},hasSessions:function(){return this.sessions.length>0},hasNewSession:function(){return void 0===this.editedSession.id},availableUsers:function(){var t=this.editedSession.users.map((function(t){return t.id}));return this.users.filter((function(e){return-1===t.indexOf(e.id)}))},orderedSessions:function(){return this.sessions.slice().sort((function(t,e){return e.starts_at_iso8601.getTime()-t.starts_at_iso8601.getTime()}))}},methods:{clone:function(t){return JSON.parse(JSON.stringify(t))},submit:function(t){var e=this;if(!this.loading){this.startLoading();var i=this.editedSession;if(this.hasNewSession)Wc.save({volume_id:this.volumeId},this.packSession(i)).then(this.sessionSaved).catch(this.handleErrorResponse).finally(this.finishLoading);else{var n={id:i.id};!0===t&&(n.force=1),Wc.update(n,this.packSession(i)).then((function(){return e.sessionUpdated(i)})).catch(this.handleConfirm("Use the Force and update the annotation session?",this.submit)).finally(this.finishLoading)}}},sessionUpdated:function(t){for(var e=this.sessions.length-1;e>=0;e--)this.sessions[e].id===t.id&&(this.sessions.splice(e,1,t),this.clearEditedSession())},sessionSaved:function(t){this.sessions.push(this.parseSession(t.data)),this.clearEditedSession()},packSession:function(t){return(t=this.clone(t)).users=t.users.map((function(t){return t.id})),t.starts_at=t.starts_at_iso8601,t.ends_at=t.ends_at_iso8601,delete t.starts_at_iso8601,delete t.ends_at_iso8601,t},handleConfirm:function(t,e){var i=this;return function(n){400===n.status?(i.finishLoading(),confirm(n.data.message+" "+t)&&e(!0)):i.handleErrorResponse(n)}},handleErrorResponse:function(t){422===t.status?this.errors=t.data.errors:su(t)},hasError:function(t){return this.errors.hasOwnProperty(t)},getError:function(t){return this.errors[t].join(" ")},editSession:function(t){this.editedSession=this.clone(t)},deleteSession:function(t){var e=this;if(!this.loading&&!this.hasNewSession&&(!0===t||confirm("Are you sure you want to delete the annotation session '".concat(this.editedSession.name,"'?")))){this.startLoading();var i=this.editedSession.id,n={id:i};!0===t&&(n.force=1),Wc.delete(n).then((function(){return e.sessionDeleted(i)})).catch(this.handleConfirm("Use the Force and delete the annotation session?",this.deleteSession)).finally(this.finishLoading)}},sessionDeleted:function(t){for(var e=this.sessions.length-1;e>=0;e--)if(this.sessions[e].id===t)return this.sessions.splice(e,1),void this.clearEditedSession()},clearEditedSession:function(){this.editedSession={name:null,description:null,starts_at_iso8601:null,starts_at:null,ends_at_iso8601:null,ends_at:null,hide_other_users_annotations:!1,hide_own_annotations:!1,users:[]}},loadUsers:function(){jc.queryUsers({id:this.volumeId}).then(this.usersLoaded,su)},usersLoaded:function(t){t.data.forEach((function(t){t.name=t.firstname+" "+t.lastname})),Vue.set(this,"users",t.data)},selectUser:function(t){this.editedSession.users.push(t)},removeUser:function(t){for(var e=this.editedSession.users.length-1;e>=0;e--)this.editedSession.users[e].id===t.id&&this.editedSession.users.splice(e,1)},stringifyDate:function(t){var e=t.getMonth()+1;return e=e<10?"0"+e:e,t.getFullYear()+"-"+e+"-"+t.getDate()},parseDate:function(t){if(t)return t=t.split("-"),new Date(t[0],t[1]-1,t[2])},parseSession:function(t){var e=new Date(t.starts_at_iso8601);return t.starts_at_iso8601=e,t.starts_at=this.stringifyDate(e),e=new Date(t.ends_at_iso8601),t.ends_at_iso8601=e,t.ends_at=this.stringifyDate(e),t}},watch:{editedSession:function(){this.errors={}},loading:function(t){t&&(this.errors={})},"editedSession.starts_at":function(t){this.editedSession.starts_at_iso8601=this.parseDate(t)},"editedSession.ends_at":function(t){this.editedSession.ends_at_iso8601=this.parseDate(t)}},created:function(){this.volumeId=biigle.$require("volumes.id"),this.sessions=biigle.$require("volumes.annotationSessions").map(this.parseSession),this.$once("editing.start",this.loadUsers)}},undefined,undefined,!1,null,null,null).exports,Pd=Vue.resource("api/v1/volumes/browser/directories{/disk}",{},{getImages:{method:"GET",url:"api/v1/volumes/browser/images{/disk}"},getVideos:{method:"GET",url:"api/v1/volumes/browser/videos{/disk}"}});const kd=Sl({mixins:[uu],data:function(){return{disks:[],url:null,mediaType:"",filenames:null,browsing:!1,storageDisk:null,breadCrumbs:[],currentDirectories:[],loadingBrowser:!1,directoryCache:{},fileCache:{}}},computed:{showFilenameWarning:function(){return this.filenames.includes(".tif")},hasDirectories:function(){return this.currentDirectories.length>0},buttonClass:function(){return{"btn-info":this.browsing}},canGoBack:function(){return this.breadCrumbs.length>0||this.disks.length>1},hasCurrentDirectory:function(){return this.breadCrumbs.length>0},currentDirectory:function(){return this.hasCurrentDirectory?this.breadCrumbs[this.breadCrumbs.length-1]:null},isImageMediaType:function(){return"image"===this.mediaType},isVideoMediaType:function(){return"video"===this.mediaType}},methods:{toggleBrowse:function(){this.browsing=!this.browsing},fetchDirectories:function(t,e){var i=this,n=t+"://"+e;if(!this.directoryCache.hasOwnProperty(n)){this.loadingBrowser=!0;var r=Pd.get({disk:t,path:e});r.finally((function(){return i.loadingBrowser=!1})),this.directoryCache[n]=r}return this.directoryCache[n]},showDirectories:function(t){this.currentDirectories=t.body},openDirectory:function(t){this.breadCrumbs.push(t)},goBack:function(){this.breadCrumbs.length>0?this.breadCrumbs.pop():this.disks.length>1&&(this.storageDisk=null)},goTo:function(t){t>=-1&&t=0;e--)t.data[e].isNew=!0,this.files.push(t.data[e]);this.filenames=""},handleRemove:function(t){var e=this;!this.loading&&confirm("Are you sure that you want to delete the ".concat(this.type," #").concat(t.id," (").concat(t.filename,")?"))&&(this.startLoading(),this.fileApi.delete({id:t.id}).then((function(){return e.fileRemoved(t.id)})).catch((function(i){if(422!==i.status)throw i;if(confirm("The ".concat(e.type," contains annotations. Proceed to delete the ").concat(e.type,"?")))return e.fileApi.delete({id:t.id},{force:!0}).then((function(){return e.fileRemoved(t.id)}))})).catch(su).finally(this.finishLoading))},fileRemoved:function(t){for(var e=this.files,i=e.length-1;i>=0;i--)if(e[i].id===t)return void e.splice(i,1)},handleErrorResponse:function(t){422===t.status?this.errors=t.data.errors:su(t)},hasError:function(t){return this.errors.hasOwnProperty(t)},getError:function(t){return this.errors[t].join("\n")},setFiles:function(t){for(var e in t.body)t.body.hasOwnProperty(e),this.files.push({id:e,filename:t.body[e]})}},watch:{loading:function(t){t&&(this.errors={})}},created:function(){this.volumeId=biigle.$require("volumes.id"),this.type=biigle.$require("volumes.type"),this.startLoading(),jc.queryFilenames({id:this.volumeId}).then(this.setFiles,su).finally(this.finishLoading)}},undefined,undefined,!1,null,null,null).exports,$d=Vue.resource("api/v1/volumes{/id}/images/metadata");const Dd=Sl({mixins:[uu],data:function(){return{volumeId:null,csv:void 0,error:!1,success:!1,message:void 0}},methods:{handleSuccess:function(){this.error=!1,this.success=!0},handleError:function(t){this.success=!1,t.data.file?Array.isArray(t.data.file)?this.error=t.data.file[0]:this.error=t.data.file:su(t)},submit:function(){if(this.csv){this.startLoading();var t=new FormData;t.append("file",this.csv),$d.save({id:this.volumeId},t).bind(this).then(this.handleSuccess,this.handleError).finally(this.finishLoading)}},setCsv:function(t){this.csv=t.target.files[0]}},created:function(){this.volumeId=biigle.$require("volumes.id")}},undefined,undefined,!1,null,null,null).exports;const jd=Sl(new Vue({components:{dropdown:Yh}}),undefined,undefined,!1,null,null,null).exports;const Nd=Sl({components:{previewThumbnail:Cc}},undefined,undefined,!1,null,null,null).exports;function Bd(t){return(Bd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}const Ud=Sl({mixins:[uu],components:{powerToggle:Il},props:{volumeId:{type:Number,required:!0},type:{type:String,required:!0},fileIds:{type:Array,required:!0},showFilenames:{type:Boolean,default:!1},loadingFilenames:{type:Boolean,default:!1}},data:function(){return{rules:[],selectedFilterId:null,negate:!1,mode:"filter",operator:"and"}},computed:{filters:function(){var t=this;return Nc.filter((function(e){return e.types&&e.types.includes(t.type)}))},selectedFilter:function(){return this.getFilter(this.selectedFilterId)},hasSelectComponent:function(){return this.selectedFilter&&this.selectedFilter.selectComponent},selectComponent:function(){return this.selectedFilter.selectComponent},hasRules:function(){return this.rules.length>0},sequence:function(){if(!this.hasRules)return this.fileIds;var t={},e={},i=0,n=0;return this.rules.forEach((function(r){r.negate?(i++,r.sequence.forEach((function(t){e[t]=e[t]+1||1}))):(n++,r.sequence.forEach((function(e){t[e]=t[e]+1||1})))})),"and"===this.operator?n>0?this.fileIds.filter((function(i){return t[i]===n&&!e.hasOwnProperty(i)})):this.fileIds.filter((function(t){return!e.hasOwnProperty(t)})):i>0?this.fileIds.filter((function(n){return t.hasOwnProperty(n)||e[n]!==i})):this.fileIds.filter((function(e){return t.hasOwnProperty(e)}))},inFilterMode:function(){return"filter"===this.mode},inFlagMode:function(){return"flag"===this.mode},usesAndOperator:function(){return"and"===this.operator},usesOrOperator:function(){return"or"===this.operator},helpText:function(){return this.selectedFilter?this.selectedFilter.help.replace(":type",this.type):null},rulesStorageKey:function(){return"biigle.volumes.".concat(this.volumeId,".filter2.rules")},modeStorageKey:function(){return"biigle.volumes.".concat(this.volumeId,".filter2.mode")},operatorStorageKey:function(){return"biigle.volumes.".concat(this.volumeId,".filter2.operator")},typeText:function(){return ru(this.type)+"s"}},methods:{filterValid:function(t){return"string"==typeof t.id&&"string"==typeof t.label&&"object"===Bd(t.listComponent)&&"function"==typeof t.getSequence},getFilter:function(t){for(var e=this.filters.length-1;e>=0;e--)if(this.filters[e].id===t)return this.filters[e];return null},hasRule:function(t){return-1!==this.rules.findIndex((function(e){return e.id===t.id&&e.negate===t.negate&&e.data===t.data}))},addRule:function(t){var e=this;if(this.selectedFilter){var i={id:this.selectedFilter.id,data:t,negate:this.negate};this.hasRule(i)||(this.startLoading(),this.selectedFilter.getSequence(this.volumeId,t).catch(su).then((function(t){return e.ruleAdded(i,t)})).finally(this.finishLoading))}},refreshRule:function(t){var e=this.getFilter(t.id);e&&(this.startLoading(),e.getSequence(this.volumeId,t.data).catch(su).then((function(e){return t.sequence=e.data})).finally(this.finishLoading))},ruleAdded:function(t,e){t.sequence=e.data,this.rules.push(t)},removeRule:function(t){this.rules.splice(t,1)},reset:function(){this.rules=[],this.selectedFilterId=null,this.negate=!1,this.mode="filter",this.operator="and"},activateFilterMode:function(){this.mode="filter"},activateFlagMode:function(){this.mode="flag"},activateAndOperator:function(){this.operator="and"},activateOrOperator:function(){this.operator="or"},emitUpdate:function(){this.$emit("update",this.sequence,this.mode,this.hasRules)},getListComponent:function(t){for(var e=this.filters.length-1;e>=0;e--)if(this.filters[e].id===t.id)return this.filters[e].listComponent},enableFilenames:function(){this.$emit("enable-filenames")},disableFilenames:function(){this.$emit("disable-filenames")}},watch:{sequence:function(){this.emitUpdate()},mode:function(){this.emitUpdate(),"filter"!==this.mode?localStorage.setItem(this.modeStorageKey,this.mode):localStorage.removeItem(this.modeStorageKey)},operator:function(){this.emitUpdate(),"and"!==this.operator?localStorage.setItem(this.operatorStorageKey,this.operator):localStorage.removeItem(this.operatorStorageKey)},rules:{handler:function(){this.rules.length>0?localStorage.setItem(this.rulesStorageKey,JSON.stringify(this.rules)):localStorage.removeItem(this.rulesStorageKey)},deep:!0}},created:function(){for(var t,e=0;e0}},methods:{canDelete:function(t){return!0===this.isAdmin||this.userId===t.user.id},emitDeleted:function(t){this.$emit("deleted",t)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("ul",{staticClass:"file-label-list"},[t._l(t.fileLabels,(function(e){return i("list-item",{key:e.id,attrs:{item:e,deletable:t.canDelete(e),type:t.type},on:{deleted:t.emitDeleted}})})),t._v(" "),t.hasImageLabels?t._e():i("li",{staticClass:"text-muted"},[t._v("No "+t._s(t.type)+" labels")])],2)}),[],!1,null,null,null).exports;var Wd=Sl({mixins:[Bc,uu],components:{fileLabelList:qd,previewThumbnail:Cc},data:function(){return{userId:null,isAdmin:!1,attachingSuccess:null,timeout:null,saving:!1,showAnnotationRoute:null}},props:{selectedLabel:{type:Object,default:null},showFilename:{type:Boolean,default:!1},showLabels:{type:Boolean,default:!1},type:{type:String,default:"image"}},computed:{alreadyHasSelectedLabel:function(){var t=this.selectedLabel;return this.image.labels.reduce((function(e,i){return e||t.id===i.label_id}),!1)},showAnnotationLink:function(){return this.showAnnotationRoute?this.showAnnotationRoute+this.image.id:""},selected:function(){return this.image.flagged},canBeSelected:function(){return this.selectable&&this.selectedLabel&&!this.alreadyHasSelectedLabel&&!this.saving},classObject:function(){return{"image-grid__image--selected":this.selected,"image-grid__image--selectable":this.canBeSelected,"image-grid__image--saving":this.selectable&&this.saving,"image-grid__image--success":!0===this.attachingSuccess,"image-grid__image--error":!1===this.attachingSuccess}},title:function(){return this.canBeSelected?"Attach "+this.selectedLabel.name:""},linkTitle:function(){return"Annotate this ".concat(this.type)}},methods:{handleClick:function(){var t=this;this.canBeSelected&&(this.saving=!0,("image"===this.type?zd.save({image_id:this.image.id},{label_id:this.selectedLabel.id}):Vd.save({video_id:this.image.id},{label_id:this.selectedLabel.id})).then(this.labelAttached,this.attachingFailed).finally(this.resetSuccess).finally((function(){return t.saving=!1})))},labelAttached:function(t){this.attachingSuccess=!0,this.image.labels.push(t.data)},attachingFailed:function(t){this.attachingSuccess=!1,su(t)},resetSuccess:function(){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.attachingSuccess=null}),3e3)},removeImageLabel:function(t){var e=this.image.labels.indexOf(t);-1!==e&&this.image.labels.splice(e,1)}},created:function(){this.userId=biigle.$require("volumes.userId"),this.isAdmin=biigle.$require("volumes.isAdmin"),this.showAnnotationRoute=biigle.$require("largo.showAnnotationRoute")}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"image-grid__image image-grid__image--volume",class:t.classObject,attrs:{title:t.title}},[!t.selectable&&t.image.annotateUrl?i("a",{staticClass:"image-link",attrs:{href:t.image.annotateUrl,title:t.linkTitle}},[i("preview-thumbnail",{attrs:{id:t.image.id,"thumb-uris":t.image.thumbnailUrl}},[i("img",{attrs:{src:t.srcUrl},on:{error:t.showEmptyImage}})])],1):i("preview-thumbnail",{attrs:{id:t.image.id,"thumb-uris":t.image.thumbnailUrl},on:{click:t.handleClick}},[i("img",{attrs:{src:t.srcUrl},on:{error:t.showEmptyImage}})]),t._v(" "),t.showFilename?i("span",{staticClass:"image-filename",attrs:{title:t.image.filename},domProps:{textContent:t._s(t.image.filename)}}):t._e(),t._v(" "),i("div",{staticClass:"image-buttons"},[t.image.infoUrl?i("a",{staticClass:"image-button",attrs:{href:t.image.infoUrl,title:"View image information"}},[i("span",{staticClass:"fa fa-info-circle",attrs:{"aria-hidden":"true"}})]):t._e()]),t._v(" "),t.showLabels?i("div",{staticClass:"image-labels",on:{wheel:function(t){t.stopPropagation()}}},[i("file-label-list",{attrs:{"file-labels":t.image.labels,"user-id":t.userId,"is-admin":t.isAdmin,type:t.type},on:{deleted:t.removeImageLabel}})],1):t._e()],1)}),[],!1,null,null,null);const Kd=Sl({mixins:[zc],components:{imageGridImage:Wd.exports},props:{selectedLabel:{type:Object,default:null},showFilenames:{type:Boolean,default:!1},showLabels:{type:Boolean,default:!1},type:{type:String,default:"image"}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"image-grid",on:{wheel:function(e){return e.preventDefault(),t.scroll(e)}}},[i("div",{ref:"images",staticClass:"image-grid__images"},t._l(t.displayedImages,(function(e){return i("image-grid-image",{key:e.id,attrs:{image:e,"empty-url":t.emptyUrl,"selected-label":t.selectedLabel,selectable:t.selectable,"selected-fade":!1,"show-filename":t.showFilenames,"show-labels":t.showLabels,type:t.type},on:{select:t.emitSelect}})})),1),t._v(" "),t.canScroll?i("image-grid-progress",{attrs:{progress:t.progress},on:{top:t.jumpToStart,"prev-page":t.reversePage,"prev-row":t.reverseRow,jump:t.jumpToPercent,"next-row":t.advanceRow,"next-page":t.advancePage,bottom:t.jumpToEnd}}):t._e()],1)}),[],!1,null,null,null).exports;const Xd=Sl({mixins:[uu],components:{labelTrees:Qh,powerToggle:Il},props:{volumeId:{type:Number,required:!0},showLabels:{type:Boolean,default:!1},loadingLabels:{type:Boolean,default:!1}},data:function(){return{labelTrees:[]}},methods:{handleSelectedLabel:function(t){this.$emit("select",t)},handleDeselectedLabel:function(t){this.$emit("deselect",t)},enableLabels:function(){this.$emit("enable-labels")},disableLabels:function(){this.$emit("disable-labels")}},created:function(){this.labelTrees=biigle.$require("volumes.labelTrees")}},undefined,undefined,!1,null,null,null).exports;const Yd=Sl({mixins:[uu],props:{volumeId:{type:Number,required:!0},type:{type:String,required:!0},fileIds:{type:Array,required:!0}},data:function(){return{direction:!0,activeSorter:null,privateSequence:[]}},computed:{sorters:function(){var t=this;return Gc.filter((function(e){return e.types&&e.types.includes(t.type)}))},defaultSorter:function(){return this.sorters[0]},isActive:function(){return this.activeSorter!==this.defaultSorter.id||!this.direction},isSortedAscending:function(){return this.direction},isSortedDescending:function(){return!this.direction},sorterStorageKey:function(){return"biigle.volumes.".concat(this.volumeId,".sorting2.sorter")},directionStorageKey:function(){return"biigle.volumes.".concat(this.volumeId,".sorting2.direction")},sequence:function(){return this.direction?this.privateSequence:this.privateSequence.slice().reverse()}},methods:{reset:function(){this.direction=!0,this.activeSorter=this.defaultSorter.id,this.privateSequence=biigle.$require("volumes.fileIds")},sortAscending:function(){this.direction=!0},sortDescending:function(){this.direction=!1},handleSelect:function(t){var e=this;this.loading||(this.startLoading(),t.getSequence().then((function(i){e.activeSorter=t.id,e.privateSequence=i})).catch(su).finally(this.finishLoading))},isValidSequence:function(t){for(var e={},i=this.fileIds,n=t.length-1;n>=0;n--)e[t[n]]=!0;for(var r=i.length-1;r>=0;r--)if(!e.hasOwnProperty(i[r]))return!1;return!0}},watch:{sequence:function(){this.$emit("update",this.sequence,this.isActive)},privateSequence:function(){this.activeSorter===this.defaultSorter.id?localStorage.removeItem(this.sorterStorageKey):localStorage.setItem(this.sorterStorageKey,JSON.stringify({id:this.activeSorter,sequence:this.privateSequence}))},direction:function(){this.direction?localStorage.removeItem(this.directionStorageKey):localStorage.setItem(this.directionStorageKey,this.direction)}},created:function(){this.privateSequence=biigle.$require("volumes.fileIds");var t=JSON.parse(localStorage.getItem(this.sorterStorageKey));t&&this.isValidSequence(t.sequence)?(this.activeSorter=t.id,this.privateSequence=t.sequence):(this.activeSorter=this.defaultSorter.id,localStorage.removeItem(this.sorterStorageKey));var e=JSON.parse(localStorage.getItem(this.directionStorageKey));null!==e&&(this.direction=e)}},undefined,undefined,!1,null,null,null).exports;var Hd=function(t){return t[0]+t[1]+"/"+t[2]+t[3]+"/"+t};const Zd=Sl({mixins:[uu],components:{sidebar:Rl,sidebarTab:Ll,imageGrid:Kd,filterTab:Ud,sortingTab:Yd,labelsTab:Xd},data:function(){return{fileIds:[],files:[],filterSequence:[],filterMode:null,filterActive:!1,sortingSequence:[],sortingActive:!1,volumeId:null,imageLabelMode:!1,selectedLabel:null,loadingFilenames:!1,showFilenames:!1,filenamesPromise:null,loadingLabels:!1,showLabels:!1,labelsPromise:null,settings:null,type:null}},computed:{sortingMap:function(){var t={};return this.sortingSequence.forEach((function(e,i){t[e]=i})),t},sortedFiles:function(){var t=this.sortingMap,e=[];return this.files.forEach((function(i){e[t[i.id]]=i})),e},filterMap:function(){var t={};return this.filterSequence.forEach((function(e){t[e]=null})),t},filesToShow:function(){var t=this.filterMap;return"flag"===this.filterMode?this.sortedFiles.map((function(e){return e.flagged=t.hasOwnProperty(e.id),e})):this.sortedFiles.filter((function(e){return e.flagged=!1,t.hasOwnProperty(e.id)}))},fileIdsToShow:function(){return this.filesToShow.map((function(t){return t.id}))},filesStorageKey:function(){return"biigle.volumes.".concat(this.volumeId,".files")},offsetStorageKey:function(){return"biigle.volumes.".concat(this.volumeId,".offset")},initialOffset:function(){return parseInt(tu.get("offset"))||parseInt(localStorage.getItem(this.offsetStorageKey))||0},filterEmpty:function(){return this.filterActive&&"flag"!==this.filterMode&&0===this.filterSequence.length}},methods:{handleSidebarToggle:function(){var t=this;this.$nextTick((function(){return t.$refs.imageGrid.$emit("resize")}))},handleSidebarOpen:function(t){this.imageLabelMode="labels"===t},handleSidebarClose:function(){this.imageLabelMode=!1},toggleLoading:function(t){t?this.startLoading():this.finishLoading()},updateFilterSequence:function(t,e,i){this.filterSequence=t,this.filterMode=e,this.filterActive=i},handleScroll:function(t){t>0?(tu.set({offset:t}),localStorage.setItem(this.offsetStorageKey,t)):(tu.unset("offset"),localStorage.removeItem(this.offsetStorageKey))},handleSelectedLabel:function(t){this.selectedLabel=t},handleDeselectedLabel:function(){this.selectedLabel=null},updateSortingSequence:function(t,e){this.sortingSequence=t,this.sortingActive=e},enableFilenames:function(){var t=this;this.filenamesPromise||(this.loadingFilenames=!0,this.filenamesPromise=jc.queryFilenames({id:this.volumeId}).then(this.setFilenames).finally((function(){return t.loadingFilenames=!1}))),this.filenamesPromise.then((function(){return t.showFilenames=!0}))},disableFilenames:function(){this.showFilenames=!1},setFilenames:function(t){this.files.forEach((function(e){e.filename=t.body[e.id]}))},enableLabels:function(){var t=this;this.labelsPromise||(this.loadingLabels=!0,this.labelsPromise=jc.queryFileLabels({id:this.volumeId}).then(this.setLabels).finally((function(){return t.loadingLabels=!1}))),this.labelsPromise.then((function(){return t.showLabels=!0}))},disableLabels:function(){this.showLabels=!1},setLabels:function(t){this.files.forEach((function(e){e.labels=t.body[e.id]}))},restoreSettings:function(){!0===this.settings.get("showFilenames")&&this.enableFilenames(),!0===this.settings.get("showLabels")&&this.enableLabels()}},watch:{fileIdsToShow:function(t){var e=this.fileIds,i=t.length===e.length;if(i)for(var n=t.length-1;n>=0;n--)if(t[n]!==e[n]){i=!1;break}i?localStorage.removeItem(this.filesStorageKey):localStorage.setItem(this.filesStorageKey,JSON.stringify(t)),Rd.count=t.length},showFilenames:function(t){this.settings.set("showFilenames",t)},showLabels:function(t){this.settings.set("showLabels",t)}},created:function(){this.type=biigle.$require("volumes.type"),this.fileIds=biigle.$require("volumes.fileIds"),this.filterSequence=this.fileIds,this.sortingSequence=this.fileIds,this.volumeId=biigle.$require("volumes.volumeId"),this.settings=new hu({data:{storageKey:"biigle.volumes.settings",defaults:{showFilenames:!1,showLabels:!1}}});var t=biigle.$require("volumes.fileUuids"),e=biigle.$require("volumes.thumbUri"),i=biigle.$require("volumes.thumbCount"),n=biigle.$require("volumes.annotateUri"),r=biigle.$require("volumes.infoUri");this.files=this.fileIds.map((function(o){var s;return s=i>1?Array.from(Array(i).keys()).map((function(i){return e.replace(":uuid",Hd(t[o])+"/"+i)})):e.replace(":uuid",Hd(t[o])),{id:o,thumbnailUrl:s,annotateUrl:n.replace(":id",o),infoUrl:r?r.replace(":id",o):void 0,flagged:!1,filename:null,labels:[]}})),this.restoreSettings()}},undefined,undefined,!1,null,null,null).exports;biigle.$mount("annotation-session-panel",Ad),biigle.$mount("create-volume-form",kd),biigle.$mount("file-panel",Od),biigle.$mount("projects-breadcrumb",jd),biigle.$mount("search-results",Nd),biigle.$mount("volume-container",Zd),biigle.$mount("volume-file-count",Ld),biigle.$mount("volume-metadata-upload",Dd);const Jd="postrender",Qd="movestart",tf="moveend";function ef(){return function(){throw new Error("Unimplemented abstract method.")}()}var nf=0;function rf(t){return t.ol_uid||(t.ol_uid=String(++nf))}var of="5.3.1";const sf="propertychange";var af="function"==typeof Object.assign?Object.assign:function(t,e){var i=arguments;if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1,o=arguments.length;r0},e.prototype.removeEventListener=function(t,e){var i=this.listeners_[t];if(i){var n=i.indexOf(e);t in this.pendingRemovals_?(i[n]=Sf,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t])}},e}(bf),Af="change",Pf="clear",kf="contextmenu",Rf="click",Lf="dblclick",Ff="error",Mf="keydown",Of="keypress",$f="load",Df="mousedown",jf="mousewheel",Nf="MSPointerDown",Bf="resize",Uf="touchstart",zf="wheel";const Vf=function(t){function e(){t.call(this),this.revision_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.changed=function(){++this.revision_,this.dispatchEvent(Af)},e.prototype.getRevision=function(){return this.revision_},e.prototype.on=function(t,e){if(Array.isArray(t)){for(var i=t.length,n=new Array(i),r=0;rr&&(l|=Sp),ao&&(l|=xp),l===bp&&(l=wp),l}function Mp(){return[1/0,1/0,-1/0,-1/0]}function Op(t,e,i,n,r){return r?(r[0]=t,r[1]=e,r[2]=i,r[3]=n,r):[t,e,i,n]}function $p(t){return Op(1/0,1/0,-1/0,-1/0,t)}function Dp(t,e){var i=t[0],n=t[1];return Op(i,n,i,n,e)}function jp(t,e,i,n,r){return Vp($p(r),t,e,i,n)}function Np(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Bp(t,e){return e[0]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function Up(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function zp(t,e){for(var i=0,n=e.length;ie[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function rg(t){return t[2]0},showThis:function(){return this.show&&this.hasAnnotations}},methods:{updateAnnotations:function(t){this.annotations=t.map((function(t){return t.get("annotation")}))}},watch:{show:{immediate:!0,handler:function(t){t?this.$parent.$on(this.watch,this.updateAnnotations):this.$parent.$off(this.watch,this.updateAnnotations)}},position:function(t){this.overlay.setPosition(t)},showThis:function(t){t?this.$parent.map.addOverlay(this.overlay):this.$parent.map.removeOverlay(this.overlay)}},mounted:function(){this.overlay=new hg({element:this.$el,offset:[15,0],positioning:this.positioning})},beforeDestroy:function(){this.$parent.map.removeOverlay(this.overlay)}},undefined,undefined,!1,null,null,null).exports;const dg=Sl({mixins:[cg],computed:{annotationLabels:function(){return this.annotations.map((function(t){return t.labels.map((function(t){return t.label.name}))}))}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"annotation-tooltip"},[i("ul",{staticClass:"annotation-tooltip__annotations"},t._l(t.annotationLabels,(function(e){return i("li",[i("ul",{staticClass:"annotation-tooltip__labels"},t._l(e,(function(e){return i("li",{domProps:{textContent:t._s(e)}})})),0)])})),0)])}),[],!1,null,null,null).exports;const fg=Sl({props:{image:{required:!0},areas:{required:!0}},data:function(){return{unitMultipliers:[1e3,1,.01,.001,1e-6,1e-9],unitNames:["km","m","cm","mm","µm","nm"]}},computed:{area:function(){return this.areas&&this.image&&this.areas[this.image.id]||-1},hasArea:function(){return-1!==this.area},pxWidthInMeter:function(){return Math.sqrt(this.area/(this.image.width*this.image.height))}},methods:{powerOfTen:function(t){return Math.pow(10,Math.floor(Math.log10(t)))}}},undefined,undefined,!1,null,null,null).exports;function pg(t,e){return t>e?1:t=0}function mg(t,e,i){var n,r=t.length;if(t[0]<=e)return 0;if(e<=t[r-1])return r-1;if(i>0){for(n=1;n1?(i=r,n=o):l>0&&(i+=s*l,n+=a*l)}return Ng(t,e,i,n)}function Ng(t,e,i,n){var r=i-t,o=n-e;return r*r+o*o}function Bg(t){return t*Math.PI/180}function Ug(t,e){var i=t%e;return i*e<0?i+e:i}function zg(t,e,i){return t+i*(e-t)}var Vg=6371008.8;function Gg(t,e,i){var n=i||Vg,r=Bg(t[1]),o=Bg(e[1]),s=(o-r)/2,a=Bg(e[0]-t[0])/2,l=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(r)*Math.cos(o);return 2*n*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}var qg={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},Wg={};Wg[qg.DEGREES]=2*Math.PI*6370997/360,Wg[qg.FEET]=.3048,Wg[qg.METERS]=1,Wg[qg.USFEET]=1200/3937;const Kg=qg;var Xg=function(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit};Xg.prototype.canWrapX=function(){return this.canWrapX_},Xg.prototype.getCode=function(){return this.code_},Xg.prototype.getExtent=function(){return this.extent_},Xg.prototype.getUnits=function(){return this.units_},Xg.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Wg[this.units_]},Xg.prototype.getWorldExtent=function(){return this.worldExtent_},Xg.prototype.getAxisOrientation=function(){return this.axisOrientation_},Xg.prototype.isGlobal=function(){return this.global_},Xg.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},Xg.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},Xg.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},Xg.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},Xg.prototype.setWorldExtent=function(t){this.worldExtent_=t},Xg.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},Xg.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};const Yg=Xg;var Hg=6378137,Zg=Math.PI*Hg,Jg=[-Zg,-Zg,Zg,Zg],Qg=[-180,-85,180,85],tm=function(t){function e(e){t.call(this,{code:e,units:Kg.METERS,extent:Jg,global:!0,worldExtent:Qg,getPointResolution:function(t,e){return t/Dg(e[1]/Hg)}})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Yg),em=[new tm("EPSG:3857"),new tm("EPSG:102100"),new tm("EPSG:102113"),new tm("EPSG:900913"),new tm("urn:ogc:def:crs:EPSG:6.18:3:3857"),new tm("urn:ogc:def:crs:EPSG::3857"),new tm("http://www.opengis.net/gml/srs/epsg.xml#3857")];function im(t,e,i){var n=t.length,r=i>1?i:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(n));for(var s=Zg,a=0;as?l=s:l<-s&&(l=-s),o[a+1]=l}return o}function nm(t,e,i){var n=t.length,r=i>1?i:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(n));for(var s=0;s1)a=i;else{if(d>0){for(var f=0;fr&&(r=u),o=a,s=l}return r}function Um(t,e,i,n,r){for(var o=0,s=i.length;o0;){for(var c=u.pop(),d=u.pop(),f=0,p=t[d],g=t[d+1],m=t[c],v=t[c+1],y=d+n;yf&&(h=y,f=_)}f>r&&(l[(h-e)/n]=1,d+n0&&g>f)&&(p<0&&m0&&m>p)?(a=c,l=d):(o[s++]=a,o[s++]=l,u=a,h=l,a=c,l=d)}}return o[s++]=a,o[s++]=l,s}function tv(t,e,i,n,r,o,s,a){for(var l=0,u=i.length;lo&&(u-a)*(o-l)-(r-a)*(h-l)>0&&s++:h<=o&&(u-a)*(o-l)-(r-a)*(h-l)<0&&s--,a=u,l=h}return 0!==s}function sv(t,e,i,n,r,o){if(0===i.length)return!1;if(!ov(t,e,i[0],n,r,o))return!1;for(var s=1,a=i.length;sb&&sv(t,e,i,n,u=(h+c)/2,p)&&(_=u,b=w),h=c}return isNaN(_)&&(_=r[o]),s?(s.push(_,p,b),s):[_,p,b]}function lv(t,e,i,n,r,o){for(var s,a=[t[e],t[e+1]],l=[];e+n=r[0]&&o[2]<=r[2]||(o[1]>=r[1]&&o[3]<=r[3]||lv(t,e,i,n,(function(t,e){return function(t,e,i){var n=!1,r=Fp(t,e),o=Fp(t,i);if(r===wp||o===wp)n=!0;else{var s,a,l=t[0],u=t[1],h=t[2],c=t[3],d=e[0],f=e[1],p=i[0],g=i[1],m=(g-f)/(p-d);o&xp&&!(r&xp)&&(n=(s=p-(g-c)/m)>=l&&s<=h),n||!(o&Sp)||r&Sp||(n=(a=g-(p-h)*m)>=u&&a<=c),n||!(o&Cp)||r&Cp||(n=(s=p-(g-u)/m)>=l&&s<=h),n||!(o&Tp)||r&Tp||(n=(a=g-(p-l)*m)>=u&&a<=c)}return n}(r,t,e)})))))}function hv(t,e,i,n,r){if(!function(t,e,i,n,r){return!!(uv(t,e,i,n,r)||ov(t,e,i,n,r[0],r[1])||ov(t,e,i,n,r[0],r[3])||ov(t,e,i,n,r[2],r[1])||ov(t,e,i,n,r[2],r[3]))}(t,e,i[0],n,r))return!1;if(1===i.length)return!0;for(var o=1,s=i.length;o0}function fv(t,e,i,n,r){for(var o=void 0!==r&&r,s=0,a=i.length;s=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||qp(t,this.intersectsCoordinate,this))}return!1},e.prototype.setCenter=function(t){var e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],n=t.slice();n[e]=n[0]+i;for(var r=1;r>1)],e))<0?s=n+1:(a=n,l=!r);return l?s:~s}(d,m);if(v<0){var y=(m-d[-v-2])/(d[-v-1]-d[-v-2]),_=e+(-v-2)*n;s=zg(t[_],t[_+n],y),a=zg(t[_+1],t[_+n+1],y)}else s=t[e+v*n],a=t[e+v*n+1]}return o?(o[0]=s,o[1]=a,o):[s,a]}function Sv(t,e,i,n,r,o){if(i==e)return null;var s;if(r>1;r=0&&!((n=t/e[r])>=i&&n<1e3);r--);return r}},watch:{show:function(t){t?this.$parent.$on(this.watch,this.updateGeometries):this.$parent.$off(this.watch,this.updateGeometries)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"annotation-tooltip"},[i("ul",{staticClass:"annotation-tooltip__annotations"},t._l(t.measuredGeometries,(function(e){return i("li",{domProps:{textContent:t._s(e)}})})),0)])}),[],!1,null,null,null);const Iv=Sl({components:{labelTooltip:dg,measureTooltip:Ev.exports},props:{showLabelTooltip:{type:Boolean,default:!1},showMeasureTooltip:{type:Boolean,default:!1}},computed:{showAnnotationTooltip:function(){return this.isDefaultInteractionMode&&(this.showLabelTooltip||this.showMeasureTooltip)}},data:function(){return{hoveredFeaturesHash:""}},methods:{annotationLayerFilter:function(t){return"annotations"===t.get("name")},updateHoveredAnnotations:function(t){var e=this.map.getFeaturesAtPixel(t.pixel,{layerFilter:this.annotationLayerFilter})||[],i=e.map((function(t){return t.getId()})).join("-");this.hoveredFeaturesHash!==i&&(this.hoveredFeaturesHash=i,this.$emit("hoverFeatures",e))},resetHoveredAnnotations:function(){this.hoveredFeaturesHash="",this.$emit("hoverFeatures",[])}},watch:{showAnnotationTooltip:function(t){t?this.map.on("pointermove",this.updateHoveredAnnotations):(this.map.un("pointermove",this.updateHoveredAnnotations),this.resetHoveredAnnotations())}}},undefined,undefined,!1,null,null,null).exports,Av={SINGLECLICK:"singleclick",CLICK:Rf,DBLCLICK:Lf,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};function Pv(t){return Math.pow(t,3)}function kv(t){return 1-Pv(1-t)}function Rv(t){return 3*t*t-2*t*t*t}function Lv(t){return t}const Fv="active";function Mv(t,e,i,n){e=t.constrainRotation(e,0),Ov(t,e,i,n)}function Ov(t,e,i,n){if(void 0!==e){var r=t.getRotation(),o=t.getCenter();void 0!==r&&o&&n>0?t.animate({rotation:e,anchor:i,duration:n,easing:kv}):t.rotate(e,i)}}function $v(t,e,i,n){var r=t.getResolution(),o=t.constrainResolution(r,e,0);if(void 0!==o){var s=t.getResolutions();o=$g(o,t.getMinResolution()||s[s.length-1],t.getMaxResolution()||s[0])}if(i&&void 0!==o&&o!==r){var a=t.getCenter(),l=t.calculateCenterZoom(o,i);l=t.constrainCenter(l),i=[(o*a[0]-r*l[0])/(o-r),(o*a[1]-r*l[1])/(o-r)]}Dv(t,o,i,n)}function Dv(t,e,i,n){if(e){var r=t.getResolution(),o=t.getCenter();if(void 0!==r&&o&&e!==r&&n)t.animate({resolution:e,anchor:i,duration:n,easing:kv});else{if(i){var s=t.calculateCenterZoom(e,i);t.setCenter(s)}t.setResolution(e)}}}const jv=function(t){function e(e){t.call(this),e.handleEvent&&(this.handleEvent=e.handleEvent),this.map_=null,this.setActive(!0)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getActive=function(){return this.get(Fv)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Fv,t)},e.prototype.setMap=function(t){this.map_=t},e}(Kf);function Nv(t){for(var e=t.length,i=0,n=0,r=0;r0}}else if(t.type==Av.POINTERDOWN){var n=this.handleDownEvent(t);n&&t.preventDefault(),this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==Av.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===Av.POINTERDOWN||e===Av.POINTERDRAG||e===Av.POINTERUP}(t)){var e=t.pointerEvent,i=e.pointerId.toString();t.type==Av.POINTERUP?delete this.trackedPointers_[i]:(t.type==Av.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=uf(this.trackedPointers_)}},e}(jv);function Uv(t){return(Uv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zv(t,e){for(var i=0;i0&&(o/=u)}return o}function ny(t,e,i,n){var r=i-t,o=n-e,s=Math.sqrt(r*r+o*o);return[Math.round(i+r/s),Math.round(n+o/s)]}function ry(t,e,i,n,r,o,s,a,l,u,h){var c=lp(Math.round(i*t),Math.round(i*e));if(0===l.length)return c.canvas;c.scale(i,i);var d=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){Bp(d,t.extent)}));var f=ig(d),p=Jp(d),g=lp(Math.round(i*f/n),Math.round(i*p/n)),m=i/n;l.forEach((function(t,e,i){var n=t.extent[0]-d[0],r=-(t.extent[3]-d[3]),o=ig(t.extent),s=Jp(t.extent);g.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,n*m,r*m,o*m,s*m)}));var v=tg(s);return a.getTriangles().forEach((function(t,e,r){var s=t.source,a=t.target,l=s[0][0],u=s[0][1],h=s[1][0],f=s[1][1],p=s[2][0],m=s[2][1],y=(a[0][0]-v[0])/o,_=-(a[0][1]-v[1])/o,b=(a[1][0]-v[0])/o,w=-(a[1][1]-v[1])/o,x=(a[2][0]-v[0])/o,S=-(a[2][1]-v[1])/o,C=l,T=u;l=0,u=0;var E=function(t){for(var e=t.length,i=0;ir&&(r=s,n=o)}if(0===r)return null;var a=t[n];t[n]=t[i],t[i]=a;for(var l=i+1;l=0;d--){c[d]=t[d][e]/t[d][d];for(var f=d-1;f>=0;f--)t[f][e]-=t[f][d]*c[d]}return c}([[h-=C,f-=T,0,0,b-y],[p-=C,m-=T,0,0,x-y],[0,0,h,f,w-_],[0,0,p,m,S-_]]);if(E){c.save(),c.beginPath();var I=(y+b+x)/3,A=(_+w+S)/3,P=ny(I,A,y,_),k=ny(I,A,b,w),R=ny(I,A,x,S);c.moveTo(k[0],k[1]),c.lineTo(P[0],P[1]),c.lineTo(R[0],R[1]),c.clip(),c.transform(E[0],E[2],E[1],E[3],y,_),c.translate(d[0]-C,d[3]-T),c.scale(n/i,-n/i),c.drawImage(g.canvas,0,0),c.restore()}})),h&&(c.save(),c.strokeStyle="black",c.lineWidth=1,a.getTriangles().forEach((function(t,e,i){var n=t.target,r=(n[0][0]-v[0])/o,s=-(n[0][1]-v[1])/o,a=(n[1][0]-v[0])/o,l=-(n[1][1]-v[1])/o,u=(n[2][0]-v[0])/o,h=-(n[2][1]-v[1])/o;c.beginPath(),c.moveTo(a,l),c.lineTo(r,s),c.lineTo(u,h),c.closePath(),c.stroke()})),c.restore()),c.canvas}var oy=function(t,e,i,n,r){this.sourceProj_=t,this.targetProj_=e;var o={},s=Sm(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return o[e]||(o[e]=s(t)),o[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&ig(n)==ig(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?ig(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?ig(this.targetProj_.getExtent()):null;var a=tg(i),l=eg(i),u=Xp(i),h=Kp(i),c=this.transformInv_(a),d=this.transformInv_(l),f=this.transformInv_(u),p=this.transformInv_(h);if(this.addQuad_(a,l,u,h,c,d,f,p,10),this.wrapsXInSource_){var g=1/0;this.triangles_.forEach((function(t,e,i){g=Math.min(g,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-g>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-g>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-g>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-g>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i.5&&h<1,f=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)f=ig(Ep([t,e,i,n]))/this.targetWorldWidth_>.25||f;!d&&this.sourceProj_.isGlobal()&&h&&(f=h>.25||f)}if(f||!this.maxSourceExtent_||ng(u,this.maxSourceExtent_)){if(!(f||isFinite(r[0])&&isFinite(r[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1]))){if(!(l>0))return;f=!0}if(l>0){if(!f){var p,g=[(t[0]+i[0])/2,(t[1]+i[1])/2],m=this.transformInv_(g);if(d)p=(Ug(r[0],c)+Ug(s[0],c))/2-Ug(m[0],c);else p=(r[0]+s[0])/2-m[0];var v=(r[1]+s[1])/2-m[1];f=p*p+v*v>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var y=[(e[0]+i[0])/2,(e[1]+i[1])/2],_=this.transformInv_(y),b=[(n[0]+t[0])/2,(n[1]+t[1])/2],w=this.transformInv_(b);this.addQuad_(t,e,y,b,r,o,_,w,l-1),this.addQuad_(b,y,i,n,w,_,s,a,l-1)}else{var x=[(t[0]+e[0])/2,(t[1]+e[1])/2],S=this.transformInv_(x),C=[(i[0]+n[0])/2,(i[1]+n[1])/2],T=this.transformInv_(C);this.addQuad_(t,x,C,n,r,S,T,a,l-1),this.addQuad_(x,e,i,C,S,o,s,T,l-1)}return}}if(d){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}this.addTriangle_(t,i,n,r,s,a),this.addTriangle_(t,e,i,r,o,s)}},oy.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,n){var r=e.source;Up(t,r[0]),Up(t,r[1]),Up(t,r[2])})),t},oy.prototype.getTriangles=function(){return this.triangles_};const sy=oy;const ay=function(t){function e(e,i,n,r,o,s){var a=e.getExtent(),l=i.getExtent(),u=l?Qp(n,l):n,h=iy(e,i,Yp(u),r),c=new sy(e,i,u,a,.5*h),d=s(c.calculateSourceExtent(),h,o),f=Qv;d&&(f=Zv);var p=d?d.getPixelRatio():1;t.call(this,n,r,p,f),this.targetProj_=i,this.maxSourceExtent_=a,this.triangulation_=c,this.targetResolution_=r,this.targetExtent_=n,this.sourceImage_=d,this.sourcePixelRatio_=p,this.canvas_=null,this.sourceListenerKey_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.state==Jv&&this.unlistenSource_(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.getProjection=function(){return this.targetProj_},e.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==Qv){var e=ig(this.targetExtent_)/this.targetResolution_,i=Jp(this.targetExtent_)/this.targetResolution_;this.canvas_=ry(e,i,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0)}this.state=t,this.changed()},e.prototype.load=function(){if(this.state==Zv){this.state=Jv,this.changed();var t=this.sourceImage_.getState();t==Qv||t==ty?this.reproject_():(this.sourceListenerKey_=gf(this.sourceImage_,Af,(function(t){var e=this.sourceImage_.getState();e!=Qv&&e!=ty||(this.unlistenSource_(),this.reproject_())}),this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){yf(this.sourceListenerKey_),this.sourceListenerKey_=null},e}(ey),ly="undefined",uy="ready";function hy(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}const cy=function(t){function e(e){t.call(this),this.projection_=vm(e.projection),this.attributions_=hy(e.attributions),this.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,this.loading=!1,this.state_=void 0!==e.state?e.state:uy,this.wrapX_=void 0!==e.wrapX&&e.wrapX}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolutions=function(){return ef()},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=hy(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(Kf);var dy="imageloadstart",fy="imageloadend",py="imageloaderror",gy=function(t){function e(e,i){t.call(this,e),this.image=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ef);const my=function(t){function e(e){t.call(this,{attributions:e.attributions,projection:e.projection,state:e.state}),this.resolutions_=void 0!==e.resolutions?e.resolutions:null,this.reprojectedImage_=null,this.reprojectedRevision_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=mg(this.resolutions_,t,0);t=this.resolutions_[e]}return t},e.prototype.getImage=function(t,e,i,n){var r=this.getProjection();if(r&&n&&!wm(r,n)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&wm(this.reprojectedImage_.getProjection(),n)&&this.reprojectedImage_.getResolution()==e&&Np(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new ay(r,n,t,e,i,function(t,e,i){return this.getImageInternal(t,e,i,r)}.bind(this)),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return r&&(n=r),this.getImageInternal(t,e,i,n)},e.prototype.getImageInternal=function(t,e,i,n){return ef()},e.prototype.handleImageChange=function(t){var e=t.target;switch(e.getState()){case Jv:this.loading=!0,this.dispatchEvent(new gy(dy,e));break;case Qv:this.loading=!1,this.dispatchEvent(new gy(fy,e));break;case ty:this.loading=!1,this.dispatchEvent(new gy(py,e))}},e}(cy);const vy=function(t){function e(e,i,n,r,o){var s=void 0!==o?Zv:Qv;void 0===i&&(i=Jp(e)/r.height),t.call(this,e,i,n,s),this.loader_=void 0!==o?o:null,this.canvas_=r,this.error_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getError=function(){return this.error_},e.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=ty):this.state=Qv,this.changed()},e.prototype.load=function(){this.state==Zv&&(this.state=Jv,this.changed(),this.loader_(this.handleLoad_.bind(this)))},e.prototype.getImage=function(){return this.canvas_},e}(ey);const yy=function(t){function e(e){t.call(this,{attributions:e.attributions,projection:e.projection,resolutions:e.resolutions,state:e.state}),this.canvas_=new vy(e.canvasExtent,void 0,1,e.canvas),this.canvasSize_=e.canvasSize?e.canvasSize:null,gf(this.canvas_,Af,this.handleImageChange,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getImageInternal=function(t,e,i,n){return ng(t,this.canvas_.getExtent())?this.canvas_:null},e}(my),_y="add",by="remove";var wy="length",xy=function(t){function e(e,i){t.call(this,e),this.element=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ef);const Sy=function(t){function e(e,i){t.call(this);var n=i||{};if(this.unique_=!!n.unique,this.array_=e||[],this.unique_)for(var r=0,o=this.array_.length;r0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;e0}},methods:{handleClick:function(){this.disabled||this.$emit("click")},handleMouseEnter:function(){!this.disabled&&this.hover&&(this.mouseOver=!0),window.clearTimeout(this.timeout)},handleMouseLeave:function(){var t=this;window.clearTimeout(this.timeout),this.timeout=window.setTimeout((function(){t.mouseOver=!1}),200)},updateActiveSubControls:function(t){t?this.activeSubControls+=1:this.activeSubControls=Math.max(0,this.activeSubControls-1)}},watch:{active:function(t){this.$parent.$emit("control-button-active",t)}},created:function(){this.$on("control-button-active",this.updateActiveSubControls)},mounted:function(){this.active&&this.$parent.$emit("control-button-active",!0)}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("span",{staticClass:"control-button btn",class:t.classObject,attrs:{title:t.title,disabled:t.disabled},on:{click:t.handleClick,mouseenter:t.handleMouseEnter,mouseleave:t.handleMouseLeave}},[i("i",{class:t.iconClass,attrs:{"aria-hidden":"true"}}),t._v(" "),t.hasSubControls?i("span",{staticClass:"control-button__sub-controls btn-group",on:{click:function(t){t.stopPropagation()}}},[t._t("default")],2):t._e()])}),[],!1,null,null,null).exports;const Ty=function(t){function e(e){if(t.call(this),this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,gf(this,Wf(this.geometryName_),this.handleGeometryChanged_,this),e)if("function"==typeof e.getSimplifiedGeometry){var i=e;this.setGeometry(i)}else{var n=e;this.setProperties(n)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){var t=new e(this.getProperties());t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var n=this.getStyle();return n&&t.setStyle(n),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(yf(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=gf(t,Af,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;var e;Array.isArray(t)?e=t:(gp("function"==typeof t.getZIndex,41),e=[t]);return function(){return e}}(t):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){vf(this,Wf(this.geometryName_),this.handleGeometryChanged_,this),this.geometryName_=t,gf(this,Wf(this.geometryName_),this.handleGeometryChanged_,this),this.handleGeometryChanged_()},e}(Kf);const Ey=function(t){function e(e,i,n){t.call(this,e),this.map=i,this.frameState=void 0!==n?n:null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ef);const Iy=function(t){function e(e,i,n,r,o){t.call(this,e,i,o),this.originalEvent=n,this.pixel=i.getEventPixel(n),this.coordinate=i.getCoordinateFromPixel(this.pixel),this.dragging=void 0!==r&&r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),this.originalEvent.stopPropagation()},e}(Ey);const Ay=function(t){function e(e,i,n,r,o){t.call(this,e,i,n.originalEvent,r,o),this.pointerEvent=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Iy);function Py(t,e){return t[0]+=e[0],t[1]+=e[1],t}function ky(t,e){var i,n,r=t[0],o=t[1],s=e[0],a=e[1],l=s[0],u=s[1],h=a[0],c=a[1],d=h-l,f=c-u,p=0===d&&0===f?0:(d*(r-l)+f*(o-u))/(d*d+f*f||0);return p<=0?(i=l,n=u):p>=1?(i=h,n=c):(i=l+p*d,n=u+p*f),[i,n]}function Ry(t,e){for(var i=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){i=!1;break}return i}function Ly(t,e){var i=Math.cos(e),n=Math.sin(e),r=t[0]*i-t[1]*n,o=t[1]*i+t[0]*n;return t[0]=r,t[1]=o,t}function Fy(t,e){return t[0]*=e,t[1]*=e,t}function My(t,e){var i=t[0]-e[0],n=t[1]-e[1];return i*i+n*n}function Oy(t,e){return Math.sqrt(My(t,e))}var $y="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",Dy=-1!==$y.indexOf("firefox"),jy=-1!==$y.indexOf("safari")&&-1==$y.indexOf("chrom"),Ny=-1!==$y.indexOf("webkit")&&-1==$y.indexOf("edge"),By=-1!==$y.indexOf("macintosh"),Uy=window.devicePixelRatio||1,zy=function(){var t=!1;try{t=!!document.createElement("canvas").getContext("2d").setLineDash}catch(t){}return t}(),Vy=(navigator,"ontouchstart"in window),Gy="PointerEvent"in window,qy=!!navigator.msPointerEnabled,Wy=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},Ky=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Xy=function(t){return t.target.getTargetElement()===document.activeElement},Yy=wf,Hy=function(t){return t.type==Av.CLICK},Zy=function(t){var e=t.originalEvent;return 0==e.button&&!(Ny&&By&&e.ctrlKey)},Jy=xf,Qy=function(t){return t.type==Av.SINGLECLICK},t_=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},e_=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},i_=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},n_=function(t){var e=t.pointerEvent;return gp(void 0!==e,56),"mouse"==e.pointerType},r_=function(t){var e=t.pointerEvent;return gp(void 0!==e,56),e.isPrimary&&0===e.button};const o_=function(t){function e(e,i,n){if(t.call(this),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(e[0]))this.setCoordinates(e,i);else if(void 0!==i&&n)this.setFlatCoordinates(i,e),this.ends_=n;else{for(var r=this.getLayout(),o=e,s=[],a=[],l=0,u=o.length;l=t.minResolution&&ethis.highWaterMark},e.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null,this.dispatchEvent(Pf)},e.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},e.prototype.forEach=function(t,e){for(var i=this.oldest_;i;)t.call(e,i.value_,i.key_,this),i=i.newer},e.prototype.get=function(t){var e=this.entries_[t];return gp(void 0!==e,15),e===this.newest_||(e===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(e.newer.older=e.older,e.older.newer=e.newer),e.newer=null,e.older=this.newest_,this.newest_.newer=e,this.newest_=e),e.value_},e.prototype.remove=function(t){var e=this.entries_[t];return gp(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},e.prototype.getCount=function(){return this.count_},e.prototype.getKeys=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},e.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},e.prototype.peekLast=function(){return this.oldest_.value_},e.prototype.peekLastKey=function(){return this.oldest_.key_},e.prototype.peekFirstKey=function(){return this.newest_.key_},e.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},e.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},e.prototype.set=function(t,e){gp(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},e.prototype.setSize=function(t){this.highWaterMark=t},e.prototype.prune=function(){for(;this.canExpireCache();)this.pop()},e}(If);var q_="10px sans-serif",W_=[0,0,0,1],K_="round",X_=[],Y_="round",H_=[0,0,0,1],Z_="center",J_="middle",Q_=[0,0,0,0],tb=new G_,eb={},ib=null,nb={},rb=function(){var t,e,i=eb,n="32px ",r=["monospace","serif"],o=r.length,s="wmytzilWMYTZIL@#/&?$%10";function a(t){for(var i=ob(),a=100;a<=700;a+=300){for(var l=a+" ",u=!0,h=0;h=200&&a.status<300){var r,o=e.getType();o==kb||o==Rb?r=a.responseText:o==Lb?(r=a.responseXML)||(r=(new DOMParser).parseFromString(a.responseText,"application/xml")):o==Pb&&(r=a.response),r?i.call(this,e.readFeatures(r,{featureProjection:s}),e.readProjection(r),e.getLastExtent()):n.call(this)}else n.call(this)}.bind(this),a.onerror=function(){n.call(this)}.bind(this),a.send()}}(t,e,(function(t,e){"function"==typeof this.addFeatures&&this.addFeatures(t)}),Sf)}function Mb(t,e){return[[-1/0,-1/0,1/0,1/0]]}const Ob="addfeature",$b="changefeature",Db="clear",jb="removefeature";var Nb=i(510),Bb=i.n(Nb),Ub=function(t){this.rbush_=Bb()(t,void 0),this.items_={}};Ub.prototype.insert=function(t,e){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[rf(e)]=i},Ub.prototype.load=function(t,e){for(var i=new Array(e.length),n=0,r=e.length;n2){var i=t[0],n=t[1],r=t[2],o=[n[0]-i[0],n[1]-i[1]];if(0===o[1])t=[[i,i,i,i]];else{var s=[-1*o[1],o[0]],a=o[0]/o[1],l=(r[0]+a*(n[1]-r[1])-n[0])/(s[0]-s[1]*a),u=[l*s[0],l*s[1]];t=[[[i[0]-u[0],i[1]-u[1]],[n[0]-u[0],n[1]-u[1]],[n[0]+u[0],n[1]+u[1]],[i[0]+u[0],i[1]+u[1]]]]}}else t=[t];var h=e;return h?h.setCoordinates(t):h=new qb(t),h};else if(this.type_===Mg)this.minPoints_=3,this.maxPoints_=3,n=function(t,e){if(t.length>2){var i=t[0],n=t[1],r=t[2],o=[n[0]-i[0],n[1]-i[1]],s=[i[0]+.5*o[0],i[1]+.5*o[1]];if(0===o[1])t=[[i,i,i,i]];else{var a=[-1*o[1],o[0]],l=o[0]/o[1],u=(r[0]+l*(n[1]-r[1])-n[0])/(a[0]-a[1]*l),h=[u*a[0],u*a[1]];t=[[[i[0],i[1]],[s[0]-h[0],s[1]-h[1]],[n[0],n[1]],[s[0]+h[0],s[1]+h[1]]]]}}else t=[t];var c=e;return c?c.setCoordinates(t):c=new Wb(t),c};else{var r,o=this.mode_;o===Kb?r=nv:o===Xb?r=Tv:o===Yb&&(r=vv),n=function(t,e){var i=e;return i?o===Yb?t[0].length?i.setCoordinates([t[0].concat([t[0][0]])]):i.setCoordinates([]):i.setCoordinates(t):i=new r(t),i}}this.geometryFunction_=n,this.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,this.overlay_=new Ab({source:new Gb({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:ew(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:t_,this.freehandCondition_,e.freehand?this.freehandCondition_=Yy:this.freehandCondition_=e.freehandCondition?e.freehandCondition:e_,gf(this,Wf(Fv),this.updateState_,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===kf&&e.preventDefault(),this.freehand_=this.mode_!==Kb&&this.freehandCondition_(e);var i=e.type===Av.POINTERMOVE,n=!0;!this.freehand_&&this.lastDragTime_&&e.type===Av.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,i=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===Av.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e),n=!1):this.freehand_&&e.type===Av.POINTERDOWN?n=!1:i?(n=e.type===Av.POINTERMOVE)&&this.freehand_?n=this.handlePointerMove_(e):(e.pointerEvent.pointerType==h_||e.type===Av.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===Av.DBLCLICK&&(n=!1),t.prototype.handleEvent.call(this,e)&&n},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t),!0):!!this.condition_(t)&&(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new Ay(Av.POINTERMOVE,t.map,t.pointerEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0)},e.prototype.handleUpEvent=function(t){var e=!0;this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t);var i=this.mode_===Hb;return this.shouldHandle_?(this.finishCoordinate_?this.freehand_||i?this.finishDrawing():this.atFinish_(t)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t):(this.startDrawing_(t),this.mode_===Kb&&this.finishDrawing()),e=!1):this.freehand_&&(this.finishCoordinate_=null,this.abortDrawing_()),!e&&this.stopClick_&&t.stopPropagation(),e},e.prototype.handlePointerMove_=function(t){if(this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,i=t.pixel,n=e[0]-i[0],r=e[1]-i[1],o=n*n+r*r;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return!0}return this.finishCoordinate_?this.modifyDrawing_(t):this.createOrUpdateSketchPoint_(t),!0},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var i=!1,n=[this.finishCoordinate_];if(this.mode_===Xb)i=this.sketchCoords_.length>this.minPoints_;else if(this.mode_===Yb){var r=this.sketchCoords_;i=r[0].length>this.minPoints_,n=[r[0][0],r[0][r[0].length-2]]}if(i)for(var o=t.map,s=0,a=n.length;s=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(n.slice()),this.geometryFunction_(i,r)):this.mode_===Yb&&((i=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(n.slice()),e&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,r)),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry();this.mode_===Xb?((t=this.sketchCoords_).splice(-2,1),this.geometryFunction_(t,e),t.length>=2&&(this.finishCoordinate_=t[t.length-2].slice())):this.mode_===Yb&&((t=this.sketchCoords_[0]).splice(-2,1),this.sketchLine_.getGeometry().setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e)),0===t.length&&(this.finishCoordinate_=null),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,i=t.getGeometry();this.mode_===Xb?(e.pop(),this.geometryFunction_(e,i)):this.mode_===Yb&&(e[0].pop(),this.geometryFunction_(e,i),e=i.getCoordinates()),this.type_===Ag?t.setGeometry(new s_([e])):this.type_===Pg?t.setGeometry(new o_([e])):this.type_===kg&&t.setGeometry(new a_([e])),this.dispatchEvent(new tw(Qb,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return t&&(this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0)),t},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.updateSketchFeatures_(),this.dispatchEvent(new tw(Jb,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing_(),this.overlay_.setMap(e?t:null)},e}(Bv);var nw={white:[255,255,255,1],blue:[0,153,255,1],orange:"#ff5e00"},rw={},ow=new _b({color:nw.white,width:5}),sw=new _b({color:nw.white,width:6}),aw=new _b({color:nw.blue,width:3}),lw=new _b({color:nw.orange,width:3}),uw=new vb({color:nw.blue}),hw=new vb({color:nw.orange}),cw=new _b({color:nw.white,width:2}),dw=new _b({color:nw.white,width:3}),fw=new _b({color:nw.white,width:2,lineDash:[3]}),pw=new _b({color:nw.blue,width:3,lineDash:[5]});const gw={colors:nw,features:function(t){var e=t.get("color");return e=e?"#"+e:nw.blue,rw.hasOwnProperty(e)||(rw[e]=[new Tb({stroke:ow,image:new gb({radius:6,fill:new vb({color:e}),stroke:cw}),fill:new vb({color:"transparent"})}),new Tb({stroke:new _b({color:e,width:3})})]),rw[e]},highlight:[new Tb({stroke:sw,image:new gb({radius:6,fill:hw,stroke:dw}),zIndex:200}),new Tb({stroke:lw,zIndex:200})],editing:[new Tb({stroke:ow,image:new gb({radius:6,fill:uw,stroke:fw})}),new Tb({stroke:pw})],viewport:[new Tb({stroke:aw}),new Tb({stroke:new _b({color:nw.white,width:1})})],cross:[new Tb({image:new pb({stroke:sw,points:4,radius1:6,radius2:0,angle:Math.PI/4})}),new Tb({image:new pb({stroke:lw,points:4,radius1:6,radius2:0,angle:Math.PI/4})})]};var mw,vw=function(t){var e=t.pointerEvent;return!(!e||"pen"!==e.pointerType)||e_(t)};const yw=Sl({computed:{isDrawing:function(){return this.interactionMode.startsWith("draw")},isDrawingPoint:function(){return"drawPoint"===this.interactionMode},isDrawingRectangle:function(){return"drawRectangle"===this.interactionMode},isDrawingCircle:function(){return"drawCircle"===this.interactionMode},isDrawingLineString:function(){return"drawLineString"===this.interactionMode},isDrawingPolygon:function(){return"drawPolygon"===this.interactionMode},isDrawingEllipse:function(){return"drawEllipse"===this.interactionMode}},methods:{draw:function(t){this["isDrawing"+t]?this.resetInteractionMode():this.hasSelectedLabel?this.canAdd&&(this.interactionMode="draw"+t):this.requireSelectedLabel()},drawPoint:function(){this.draw("Point")},drawRectangle:function(){this.draw("Rectangle")},drawCircle:function(){this.draw("Circle")},drawLineString:function(){this.draw("LineString")},drawPolygon:function(){this.draw("Polygon")},drawEllipse:function(){this.draw("Ellipse")},maybeUpdateDrawInteractionMode:function(t){mw&&(this.map.removeInteraction(mw),mw=void 0),this.isDrawing&&((mw=new iw({source:this.annotationSource,type:t.slice(4),style:gw.editing,freehandCondition:vw})).on("drawend",this.handleNewFeature),this.map.addInteraction(mw))}},watch:{selectedLabel:function(t){this.isDrawing&&!t&&this.resetInteractionMode()}},created:function(){this.canAdd&&(kl.on("a",this.drawPoint,0,this.listenerSet),kl.on("s",this.drawRectangle,0,this.listenerSet),kl.on("d",this.drawCircle,0,this.listenerSet),kl.on("Shift+d",this.drawEllipse,0,this.listenerSet),kl.on("f",this.drawLineString,0,this.listenerSet),kl.on("g",this.drawPolygon,0,this.listenerSet),this.$watch("interactionMode",this.maybeUpdateDrawInteractionMode))}},undefined,undefined,!1,null,null,null).exports;var _w=function(t){function e(e){var i=e||{};t.call(this,i),this.type=y_}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(O_);_w.prototype.getSource;const bw=_w;const ww=Sl({props:{label:{required:!0}}},undefined,undefined,!1,null,null,null).exports;const xw=Sl({data:function(){return{imageSection:[0,0],imageSectionCenter:[0,0]}},computed:{imageSectionSteps:function(){return[Math.ceil(this.image.width/(this.viewExtent[2]-this.viewExtent[0])),Math.ceil(this.image.height/(this.viewExtent[3]-this.viewExtent[1]))]},imageSectionStepSize:function(){var t,e=[this.viewExtent[2]-this.viewExtent[0],this.viewExtent[3]-this.viewExtent[1]];return this.imageSectionSteps[0]>1?(t=e[0]*this.imageSectionSteps[0]-this.image.width,e[0]-=t/(this.imageSectionSteps[0]-1)):e[0]=this.viewExtent[2],this.imageSectionSteps[1]>1?(t=e[1]*this.imageSectionSteps[1]-this.image.height,e[1]-=t/(this.imageSectionSteps[1]-1)):e[1]=this.viewExtent[3],e},imageSectionStartCenter:function(){var t=[(this.viewExtent[2]-this.viewExtent[0])/2,(this.viewExtent[3]-this.viewExtent[1])/2];return this.imageSectionSteps[0]<=1&&(t[0]=this.extent[2]/2),this.imageSectionSteps[1]<=1&&(t[1]=this.extent[3]/2),t},isLawnmowerAnnotationMode:function(){return"lawnmower"===this.annotationMode}},methods:{getImageSectionCenter:function(t){return[t[0]*this.imageSectionStepSize[0]+this.imageSectionStartCenter[0],t[1]*this.imageSectionStepSize[1]+this.imageSectionStartCenter[1]]},showImageSection:function(t){return t[0]=0&&t[1]>=0&&(this.imageSection=t,this.imageSectionCenter=this.getImageSectionCenter(t),this.map.getView().setCenter(this.imageSectionCenter),!0)},showLastImageSection:function(){this.showImageSection([this.imageSectionSteps[0]-1,this.imageSectionSteps[1]-1])},showFirstImageSection:function(){this.showImageSection([0,0])},showPreviousImageSection:function(){var t=this.imageSection[0]-1;return t>=0?this.showImageSection([t,this.imageSection[1]]):this.showImageSection([this.imageSectionSteps[0]-1,this.imageSection[1]-1])},showNextImageSection:function(){var t=this.imageSection[0]+1;return t0&&(e=Cw().gaussBlurOnlyBorder(e,this.blurRadius));for(var i=e.data,n=this.snapshot.data,r=i.length-1;r>=0;r--)0===n[4*r]&&(i[r]=0);var o=Cw().traceContours(e).filter((function(t){return!t.innner})).shift();if(o){this.simplifyTolerant>0&&(o=Cw().simplifyContours([o],this.simplifyTolerant,this.simplifyCount).shift());var s=this.fromSnapshotCoordinates(this.fromMagicWandCoordinates(o.points));this.sketchFeature?this.sketchFeature.getGeometry().setCoordinates([s]):(this.sketchFeature=new Ty(new vv([s])),this.sketchStyle&&this.sketchFeature.setStyle(this.sketchStyle),this.sketchSource.addFeature(this.sketchFeature))}}}])&&Ew(e.prototype,i),n&&Ew(e,n),o}(Bv);var Lw;const Fw=Sl({computed:{isMagicWanding:function(){return"magicWand"===this.interactionMode}},methods:{toggleMagicWand:function(){this.isMagicWanding?this.resetInteractionMode():Lw&&(this.interactionMode="magicWand")},maybeUpdateMagicWandSnapshot:function(t){t&&!t.tiled&&this.isMagicWanding&&Lw.updateSnapshot()},maybeSetMagicWandLayer:function(t,e){t&&(!0===t.tiled?e&&!0===e.tiled||Lw.setLayer(this.tiledImageLayer):e&&!0!==e.tiled||Lw.setLayer(this.imageLayer))},toggleMagicWandInteraction:function(t){t?this.hasSelectedLabel?Lw.setActive(!0):this.requireSelectedLabel():Lw.setActive(!1)}},created:function(){this.canAdd&&(kl.on("Shift+g",this.toggleMagicWand,0,this.listenerSet),this.$watch("image",this.maybeUpdateMagicWandSnapshot),this.$watch("image",this.maybeSetMagicWandLayer),this.$watch("isMagicWanding",this.toggleMagicWandInteraction))},mounted:function(){this.canAdd&&((Lw=new Rw({map:this.map,source:this.annotationSource,style:gw.editing,indicatorPointStyle:gw.editing,indicatorCrossStyle:gw.cross,simplifyTolerant:.1})).on("drawend",this.handleNewFeature),Lw.setActive(!1),this.map.addInteraction(Lw))}},undefined,undefined,!1,null,null,null).exports,Mw="pointermove",Ow="pointerdown",$w="pointerup",Dw="pointerover",jw="pointerout",Nw="pointerenter",Bw="pointerleave",Uw="pointercancel";var zw=["","unavailable","touch","pen","mouse"];function Vw(t){this.pointerMap[t.pointerId.toString()]=t;var e=this.prepareEvent_(t);this.dispatcher.down(e,t)}function Gw(t){var e=this.prepareEvent_(t);this.dispatcher.move(e,t)}function qw(t){var e=this.prepareEvent_(t);this.dispatcher.up(e,t),this.cleanup(t.pointerId)}function Ww(t){var e=this.prepareEvent_(t);this.dispatcher.leaveOut(e,t)}function Kw(t){var e=this.prepareEvent_(t);this.dispatcher.enterOver(e,t)}function Xw(t){var e=this.prepareEvent_(t);this.dispatcher.cancel(e,t),this.cleanup(t.pointerId)}function Yw(t){var e=this.dispatcher.makeEvent("lostpointercapture",t,t);this.dispatcher.dispatchEvent(e)}function Hw(t){var e=this.dispatcher.makeEvent("gotpointercapture",t,t);this.dispatcher.dispatchEvent(e)}const Zw=function(t){function e(e){var i={MSPointerDown:Vw,MSPointerMove:Gw,MSPointerUp:qw,MSPointerOut:Ww,MSPointerOver:Kw,MSPointerCancel:Xw,MSGotPointerCapture:Hw,MSLostPointerCapture:Yw};t.call(this,e,i),this.pointerMap=e.pointerMap}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvent_=function(t){var e=t;return"number"==typeof t.pointerType&&((e=this.dispatcher.cloneEvent(t,t)).pointerType=zw[t.pointerType]),e},e.prototype.cleanup=function(t){delete this.pointerMap[t.toString()]},e}(u_);function Jw(t){this.dispatcher.fireNativeEvent(t)}function Qw(t){this.dispatcher.fireNativeEvent(t)}function tx(t){this.dispatcher.fireNativeEvent(t)}function ex(t){this.dispatcher.fireNativeEvent(t)}function ix(t){this.dispatcher.fireNativeEvent(t)}function nx(t){this.dispatcher.fireNativeEvent(t)}function rx(t){this.dispatcher.fireNativeEvent(t)}function ox(t){this.dispatcher.fireNativeEvent(t)}const sx=function(t){function e(e){var i={pointerdown:Jw,pointermove:Qw,pointerup:tx,pointerout:ex,pointerover:ix,pointercancel:nx,gotpointercapture:ox,lostpointercapture:rx};t.call(this,e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(u_);var ax=!1,lx=function(t){function e(e,i,n){t.call(this,e),this.originalEvent=i;var r=n||{};this.buttons=function(t){var e;if(t.buttons||ax)e=t.buttons;else switch(t.which){case 1:e=1;break;case 2:e=4;break;case 3:e=2;break;default:e=0}return e}(r),this.pressure=function(t,e){var i=0;i=t.pressure?t.pressure:e?.5:0;return i}(r,this.buttons),this.bubbles="bubbles"in r&&r.bubbles,this.cancelable="cancelable"in r&&r.cancelable,this.view="view"in r?r.view:null,this.detail="detail"in r?r.detail:null,this.screenX="screenX"in r?r.screenX:0,this.screenY="screenY"in r?r.screenY:0,this.clientX="clientX"in r?r.clientX:0,this.clientY="clientY"in r?r.clientY:0,this.ctrlKey="ctrlKey"in r&&r.ctrlKey,this.altKey="altKey"in r&&r.altKey,this.shiftKey="shiftKey"in r&&r.shiftKey,this.metaKey="metaKey"in r&&r.metaKey,this.button="button"in r?r.button:0,this.relatedTarget="relatedTarget"in r?r.relatedTarget:null,this.pointerId="pointerId"in r?r.pointerId:0,this.width="width"in r?r.width:0,this.height="height"in r?r.height:0,this.tiltX="tiltX"in r?r.tiltX:0,this.tiltY="tiltY"in r?r.tiltY:0,this.pointerType="pointerType"in r?r.pointerType:"",this.hwTimestamp="hwTimestamp"in r?r.hwTimestamp:0,this.isPrimary="isPrimary"in r&&r.isPrimary,i.preventDefault&&(this.preventDefault=function(){i.preventDefault()})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ef);!function(){try{var t=new MouseEvent("click",{buttons:1});ax=1===t.buttons}catch(t){}}();const ux=lx;function hx(t){this.vacuumTouches_(t),this.setPrimaryTouch_(t.changedTouches[0]),this.dedupSynthMouse_(t),this.clickCount_++,this.processTouches_(t,this.overDown_)}function cx(t){this.processTouches_(t,this.moveOverOut_)}function dx(t){this.dedupSynthMouse_(t),this.processTouches_(t,this.upOut_)}function fx(t){this.processTouches_(t,this.cancelOut_)}const px=function(t){function e(e,i){var n={touchstart:hx,touchmove:cx,touchend:dx,touchcancel:fx};t.call(this,e,n),this.pointerMap=e.pointerMap,this.mouseSource=i,this.firstTouchId_=void 0,this.clickCount_=0,this.resetId_,this.dedupTimeout_=2500}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isPrimaryTouch_=function(t){return this.firstTouchId_===t.identifier},e.prototype.setPrimaryTouch_=function(t){var e=Object.keys(this.pointerMap).length;(0===e||1===e&&1..toString()in this.pointerMap)&&(this.firstTouchId_=t.identifier,this.cancelResetClickCount_())},e.prototype.removePrimaryPointer_=function(t){t.isPrimary&&(this.firstTouchId_=void 0,this.resetClickCount_())},e.prototype.resetClickCount_=function(){this.resetId_=setTimeout(this.resetClickCountHandler_.bind(this),200)},e.prototype.resetClickCountHandler_=function(){this.clickCount_=0,this.resetId_=void 0},e.prototype.cancelResetClickCount_=function(){void 0!==this.resetId_&&clearTimeout(this.resetId_)},e.prototype.touchToPointer_=function(t,e){var i=this.dispatcher.cloneEvent(t,e);return i.pointerId=e.identifier+2,i.bubbles=!0,i.cancelable=!0,i.detail=this.clickCount_,i.button=0,i.buttons=1,i.width=e.radiusX||0,i.height=e.radiusY||0,i.pressure=e.force||.5,i.isPrimary=this.isPrimaryTouch_(e),i.pointerType="touch",i.clientX=e.clientX,i.clientY=e.clientY,i.screenX=e.screenX,i.screenY=e.screenY,i},e.prototype.processTouches_=function(t,e){var i=Array.prototype.slice.call(t.changedTouches),n=i.length;function r(){t.preventDefault()}for(var o=0;o=e.length){for(var r=[],o=0;o-1&&t.splice(r,1)}),this.dedupTimeout_)}},e}(u_);var gx=[["bubbles",!1],["cancelable",!1],["view",null],["detail",null],["screenX",0],["screenY",0],["clientX",0],["clientY",0],["ctrlKey",!1],["altKey",!1],["shiftKey",!1],["metaKey",!1],["button",0],["relatedTarget",null],["buttons",0],["pointerId",0],["width",0],["height",0],["pressure",0],["tiltX",0],["tiltY",0],["pointerType",""],["hwTimestamp",0],["isPrimary",!1],["type",""],["target",null],["currentTarget",null],["which",0]];const mx=function(t){function e(e){t.call(this),this.element_=e,this.pointerMap={},this.eventMap_={},this.eventSourceList_=[],this.registerSources()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.registerSources=function(){if(Gy)this.registerSource("native",new sx(this));else if(qy)this.registerSource("ms",new Zw(this));else{var t=new v_(this);this.registerSource("mouse",t),Vy&&this.registerSource("touch",new px(this,t))}this.register_()},e.prototype.registerSource=function(t,e){var i=e,n=i.getEvents();n&&(n.forEach(function(t){var e=i.getHandlerForEvent(t);e&&(this.eventMap_[t]=e.bind(i))}.bind(this)),this.eventSourceList_.push(i))},e.prototype.register_=function(){for(var t=this.eventSourceList_.length,e=0;ethis.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(yf(this.relayedListenerKey_),this.relayedListenerKey_=null),this.pointerdownListenerKey_&&(yf(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(yf),this.dragListenerKeys_.length=0,this.documentPointerEventHandler_&&(this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null),this.pointerEventHandler_&&(this.pointerEventHandler_.dispose(),this.pointerEventHandler_=null),t.prototype.disposeInternal.call(this)},e}(If),yx="layergroup",_x="size",bx="target",wx="view",xx=0,Sx=1,Cx=2,Tx=3,Ex=4,Ix=5;var Ax=1/0,Px=function(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}};Px.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,lf(this.queuedElements_)},Px.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var n=this.keyFunction_(i);return delete this.queuedElements_[n],i},Px.prototype.enqueue=function(t){gp(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=Ax&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},Px.prototype.getCount=function(){return this.elements_.length},Px.prototype.getLeftChildIndex_=function(t){return 2*t+1},Px.prototype.getRightChildIndex_=function(t){return 2*t+2},Px.prototype.getParentIndex_=function(t){return t-1>>1},Px.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},Px.prototype.isEmpty=function(){return 0===this.elements_.length},Px.prototype.isKeyQueued=function(t){return t in this.queuedElements_},Px.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},Px.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,n=e.length,r=e[t],o=i[t],s=t;t>1;){var a=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=lt;){var s=this.getParentIndex_(e);if(!(n[s]>o))break;i[e]=i[s],n[e]=n[s],e=s}i[e]=r,n[e]=o},Px.prototype.reprioritize=function(){var t,e,i,n=this.priorityFunction_,r=this.elements_,o=this.priorities_,s=0,a=r.length;for(e=0;e0;)r=(n=this.dequeue()[0]).getKey(),(i=n.getState())===Ix?s=!0:i!==xx||r in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++o,n.load());0===o&&s&&this.tileChangeCallback_()},e}(Px);var Rx=256;function Lx(t){return t}function Fx(t,e){return void 0!==t?0:void 0}function Mx(t,e){return void 0!==t?t+e:void 0}const Ox=0,$x=1,Dx="center",jx="resolution",Nx="rotation";function Bx(t,e){setTimeout((function(){t(e)}),0)}function Ux(t){return!(t.sourceCenter&&t.targetCenter&&!Ry(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}const zx=function(t){function e(e){t.call(this);var i=af({},e);this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.updateAnimations_=this.updateAnimations_.bind(this),this.projection_=bm(i.projection,"EPSG:3857"),this.applyOptions_(i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.applyOptions_=function(t){var e={};e[Dx]=void 0!==t.center?t.center:null;var i=function(t){var e,i,n,r=28,o=2,s=void 0!==t.minZoom?t.minZoom:0,a=void 0!==t.maxZoom?t.maxZoom:r,l=void 0!==t.zoomFactor?t.zoomFactor:o;if(void 0!==t.resolutions){var u=t.resolutions;i=u[s],n=void 0!==u[a]?u[a]:u[u.length-1],e=function(t){return function(e,i,n){if(void 0!==e){var r=mg(t,e,n);r=$g(r+i,0,t.length-1);var o=Math.floor(r);if(r!=o&&o1&&"function"==typeof arguments[n-1]&&(e=arguments[n-1],--n),!this.isDef()){var r=arguments[n-1];return r.center&&this.setCenter(r.center),void 0!==r.zoom&&this.setZoom(r.zoom),void 0!==r.rotation&&this.setRotation(r.rotation),void(e&&Bx(e,!0))}for(var o=Date.now(),s=this.getCenter().slice(),a=this.getResolution(),l=this.getRotation(),u=[],h=0;h0},e.prototype.getInteracting=function(){return this.hints_[$x]>0},e.prototype.cancelAnimations=function(){this.setHint(Ox,-this.hints_[Ox]);for(var t=0,e=this.animations_.length;t=0;--i){for(var n=this.animations_[i],r=!0,o=0,s=n.length;o0?l/a.duration:1;u>=1?(a.complete=!0,u=1):r=!1;var h=a.easing(u);if(a.sourceCenter){var c=a.sourceCenter[0],d=a.sourceCenter[1],f=c+h*(a.targetCenter[0]-c),p=d+h*(a.targetCenter[1]-d);this.set(Dx,[f,p])}if(a.sourceResolution&&a.targetResolution){var g=1===h?a.targetResolution:a.sourceResolution+h*(a.targetResolution-a.sourceResolution);a.anchor&&this.set(Dx,this.calculateCenterZoom(g,a.anchor)),this.set(jx,g)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var m=1===h?Ug(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+h*(a.targetRotation-a.sourceRotation);a.anchor&&this.set(Dx,this.calculateCenterRotate(m,a.anchor)),this.set(Nx,m)}if(e=!0,!a.complete)break}}if(r){this.animations_[i]=null,this.setHint(Ox,-1);var v=n[0].callback;v&&Bx(v,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_))}},e.prototype.calculateCenterRotate=function(t,e){var i,n=this.getCenter();return void 0!==n&&(Ly(i=[n[0]-e[0],n[1]-e[1]],t-this.getRotation()),Py(i,e)),i},e.prototype.calculateCenterZoom=function(t,e){var i,n=this.getCenter(),r=this.getResolution();void 0!==n&&void 0!==r&&(i=[e[0]-t*(e[0]-n[0])/r,e[1]-t*(e[1]-n[1])/r]);return i},e.prototype.getSizeFromViewport_=function(){var t=[100,100],e='.ol-viewport[data-view="'+rf(this)+'"]',i=document.querySelector(e);if(i){var n=getComputedStyle(i);t[0]=parseInt(n.width,10),t[1]=parseInt(n.height,10)}return t},e.prototype.constrainCenter=function(t){return this.constraints_.center(t)},e.prototype.constrainResolution=function(t,e,i){var n=e||0,r=i||0;return this.constraints_.resolution(t,n,r)},e.prototype.constrainRotation=function(t,e){var i=e||0;return this.constraints_.rotation(t,i)},e.prototype.getCenter=function(){return this.get(Dx)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){var e=t||this.getSizeFromViewport_(),i=this.getCenter();gp(i,1);var n=this.getResolution();gp(void 0!==n,2);var r=this.getRotation();return gp(void 0!==r,3),Zp(i,n,r,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(jx)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){var i=e||this.getSizeFromViewport_(),n=ig(t)/i[0],r=Jp(t)/i[1];return Math.max(n,r)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.maxResolution_,n=this.minResolution_,r=Math.log(i/n)/Math.log(e);return function(t){return i/Math.pow(e,t*r)}},e.prototype.getRotation=function(){return this.get(Nx)},e.prototype.getValueForResolutionFunction=function(t){var e=t||2,i=this.maxResolution_,n=this.minResolution_,r=Math.log(i/n)/Math.log(e);return function(t){return Math.log(i/t)/Math.log(e)/r}},e.prototype.getState=function(t){var e=this.getCenter(),i=this.getProjection(),n=this.getResolution(),r=n/t,o=this.getRotation();return{center:[Math.round(e[0]/r)*r,Math.round(e[1]/r)*r],projection:void 0!==i?i:null,resolution:n,rotation:o,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,i,n=this.minZoom_||0;if(this.resolutions_){var r=mg(this.resolutions_,t,1);n=r,e=this.resolutions_[r],i=r==this.resolutions_.length-1?2:e/this.resolutions_[r+1]}else e=this.maxResolution_,i=this.zoomFactor_;return n+Math.log(e/t)/Math.log(i)},e.prototype.getResolutionForZoom=function(t){return this.constrainResolution(this.maxResolution_,t-this.minZoom_,0)},e.prototype.fit=function(t,e){var i,n=e||{},r=n.size;r||(r=this.getSizeFromViewport_()),gp(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t)?(gp(!rg(t),25),i=yv(t)):t.getType()===Lg?(i=yv(t=t.getExtent())).rotate(this.getRotation(),Yp(t)):i=t;var o,s=void 0!==n.padding?n.padding:[0,0,0,0],a=void 0===n.constrainResolution||n.constrainResolution,l=void 0!==n.nearest&&n.nearest;o=void 0!==n.minResolution?n.minResolution:void 0!==n.maxZoom?this.constrainResolution(this.maxResolution_,n.maxZoom-this.minZoom_,0):0;for(var u=i.getFlatCoordinates(),h=this.getRotation(),c=Math.cos(-h),d=Math.sin(-h),f=1/0,p=1/0,g=-1/0,m=-1/0,v=i.getStride(),y=0,_=u.length;y<_;y+=v){var b=u[y]*c-u[y+1]*d,w=u[y]*d+u[y+1]*c;f=Math.min(f,b),p=Math.min(p,w),g=Math.max(g,b),m=Math.max(m,w)}var x=this.getResolutionForExtent([f,p,g,m],[r[0]-s[1]-s[3],r[1]-s[0]-s[2]]);if(x=isNaN(x)?o:Math.max(x,o),a){var S=this.constrainResolution(x,0,0);!l&&S=0;i--){var n=e[i];if(n.getActive())if(!n.handleEvent(t))break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var i=this.maxTilesLoading_,n=i;if(t){var r=t.viewHints;r[Ox]&&(i=this.loadTilesWhileAnimating_?8:0,n=2),r[$x]&&(i=this.loadTilesWhileInteracting_?8:0,n=2)}e.getTilesLoading()0&&t[1]>0}(i)&&n&&n.isDef()){for(var a=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),l=this.getLayerGroup().getLayerStatesArray(),u={},h=0,c=l.length;h0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!_g(e,this.renderedAttributions_)){fp(this.ulElement_);for(var n=0,r=e.length;n0?t.animate({rotation:0,duration:this.duration_,easing:kv}):t.setRotation(0))},e}(Xx);const Qx=function(t){function e(e){var i=e||{};t.call(this,{element:document.createElement("div"),target:i.target});var n=void 0!==i.className?i.className:"ol-zoom",r=void 0!==i.delta?i.delta:1,o=void 0!==i.zoomInLabel?i.zoomInLabel:"+",s=void 0!==i.zoomOutLabel?i.zoomOutLabel:"−",a=void 0!==i.zoomInTipLabel?i.zoomInTipLabel:"Zoom in",l=void 0!==i.zoomOutTipLabel?i.zoomOutTipLabel:"Zoom out",u=document.createElement("button");u.className=n+"-in",u.setAttribute("type","button"),u.title=a,u.appendChild("string"==typeof o?document.createTextNode(o):o),gf(u,Rf,this.handleClick_.bind(this,r));var h=document.createElement("button");h.className=n+"-out",h.setAttribute("type","button"),h.title=l,h.appendChild("string"==typeof s?document.createTextNode(s):s),gf(h,Rf,this.handleClick_.bind(this,-r));var c=n+" "+"ol-unselectable "+op,d=this.element;d.className=c,d.appendChild(u),d.appendChild(h),this.duration_=void 0!==i.duration?i.duration:250}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var i=e.getResolution();if(i){var n=e.constrainResolution(i,t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({resolution:n,duration:this.duration_,easing:kv})):e.setResolution(n)}}},e}(Xx);var tS=function(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0};tS.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},tS.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},tS.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]0&&this.points_[i+2]>t;)i-=3;var n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;var r=this.points_[e]-this.points_[i],o=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(o,r),this.initialVelocity_=Math.sqrt(r*r+o*o)/n,this.initialVelocity_>this.minVelocity_},tS.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},tS.prototype.getAngle=function(){return this.angle_};const eS=tS;function iS(t){var e=!1;if(t.type==Av.DBLCLICK){var i=t.originalEvent,n=t.map,r=t.coordinate,o=i.shiftKey?-this.delta_:this.delta_;$v(n.getView(),o,r,this.duration_),t.preventDefault(),e=!0}return!e}const nS=function(t){function e(e){t.call(this,{handleEvent:iS});var i=e||{};this.delta_=i.delta?i.delta:1,this.duration_=void 0!==i.duration?i.duration:250}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(jv);const rS=function(t){function e(e){t.call(this,{stopDown:xf});var i=e||{};this.kinetic_=i.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1,this.condition_=i.condition?i.condition:t_,this.noKinetic_=!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().setHint($x,1));var e=this.targetPointers,i=Nv(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(i[0],i[1]),this.lastCentroid){var n=this.lastCentroid[0]-i[0],r=i[1]-this.lastCentroid[1],o=t.map.getView(),s=[n,r];Fy(s,o.getResolution()),Ly(s,o.getRotation()),Py(s,o.getCenter()),s=o.constrainCenter(s),o.setCenter(s)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=i,this.lastPointersCount_=e.length},e.prototype.handleUpEvent=function(t){var e=t.map,i=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var n=this.kinetic_.getDistance(),r=this.kinetic_.getAngle(),o=i.getCenter(),s=e.getPixelFromCoordinate(o),a=e.getCoordinateFromPixel([s[0]-n*Math.cos(r),s[1]-n*Math.sin(r)]);i.animate({center:i.constrainCenter(a),duration:500,easing:kv})}return this.panning_&&(this.panning_=!1,i.setHint($x,-1)),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.setCenter(t.frameState.viewState.center),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(Bv);const oS=function(t){function e(e){var i=e||{};t.call(this,{stopDown:xf}),this.condition_=i.condition?i.condition:Ky,this.lastAngle_=void 0,this.duration_=void 0!==i.duration?i.duration:250}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDragEvent=function(t){if(n_(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==Fx){var n=e.getSize(),r=t.pixel,o=Math.atan2(n[1]/2-r[1],r[0]-n[0]/2);if(void 0!==this.lastAngle_){var s=o-this.lastAngle_,a=i.getRotation();Ov(i,a-s)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){if(!n_(t))return!0;var e=t.map.getView();e.setHint($x,-1);var i=e.getRotation();return Mv(e,i,void 0,this.duration_),!1},e.prototype.handleDownEvent=function(t){return!!n_(t)&&(!(!Zy(t)||!this.condition_(t))&&(t.map.getView().setHint($x,1),this.lastAngle_=void 0,!0))},e}(Bv);const sS=function(t){function e(e){t.call(this),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.className="ol-box "+e,this.map_=null,this.startPixel_=null,this.endPixel_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+i,n.top=Math.min(t[1],e[1])+i,n.width=Math.abs(e[0]-t[0])+i,n.height=Math.abs(e[1]-t[1])+i},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left=e.top=e.width=e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixel,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new vv([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(bf);var aS="boxstart",lS="boxdrag",uS="boxend",hS=function(t){function e(e,i,n){t.call(this,e),this.coordinate=i,this.mapBrowserEvent=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ef);function cS(){var t=this.getMap(),e=t.getView(),i=t.getSize(),n=this.getGeometry().getExtent();if(this.out_){var r=e.calculateExtent(i),o=function(t,e){return zp($p(e),t)}([t.getPixelFromCoordinate(Kp(n)),t.getPixelFromCoordinate(eg(n))]);!function(t,e){var i=(t[2]-t[0])/2*(e-1),n=(t[3]-t[1])/2*(e-1);t[0]-=i,t[2]+=i,t[1]-=n,t[3]+=n}(r,1/e.getResolutionForExtent(o,i)),n=r}var s=e.constrainResolution(e.getResolutionForExtent(n,i)),a=Yp(n);a=e.constrainCenter(a),e.animate({resolution:s,center:a,duration:this.duration_,easing:kv})}const dS=function(t){function e(e){var i=e||{},n=i.condition?i.condition:e_;t.call(this,{condition:n,className:i.className||"ol-dragzoom",onBoxEnd:cS}),this.duration_=void 0!==i.duration?i.duration:200,this.out_=void 0!==i.out&&i.out}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(function(t){function e(e){t.call(this);var i=e||{};this.box_=new sS(i.className||"ol-dragbox"),this.minArea_=void 0!==i.minArea?i.minArea:64,this.onBoxEnd_=i.onBoxEnd?i.onBoxEnd:Sf,this.startPixel_=null,this.condition_=i.condition?i.condition:Yy,this.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:this.defaultBoxEndCondition}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.defaultBoxEndCondition=function(t,e,i){var n=i[0]-e[0],r=i[1]-e[1];return n*n+r*r>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){n_(t)&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new hS(lS,t.coordinate,t)))},e.prototype.handleUpEvent=function(t){return!n_(t)||(this.box_.setMap(null),this.boxEndCondition_(t,this.startPixel_,t.pixel)&&(this.onBoxEnd_(t),this.dispatchEvent(new hS(uS,t.coordinate,t))),!1)},e.prototype.handleDownEvent=function(t){return!!n_(t)&&(!(!Zy(t)||!this.condition_(t))&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new hS(aS,t.coordinate,t)),!0))},e}(Bv)),fS=37,pS=38,gS=39,mS=40;function vS(t){var e=!1;if(t.type==Mf){var i=t.originalEvent.keyCode;if(this.condition_(t)&&(i==mS||i==fS||i==gS||i==pS)){var n=t.map.getView(),r=n.getResolution()*this.pixelDelta_,o=0,s=0;i==mS?s=-r:i==fS?o=-r:i==gS?o=r:s=r;var a=[o,s];Ly(a,n.getRotation()),function(t,e,i){var n=t.getCenter();if(n){var r=t.constrainCenter([n[0]+e[0],n[1]+e[1]]);i?t.animate({duration:i,easing:Lv,center:r}):t.setCenter(r)}}(n,a,this.duration_),t.preventDefault(),e=!0}}return!e}const yS=function(t){function e(e){t.call(this,{handleEvent:vS});var i=e||{};this.defaultCondition_=function(t){return t_(t)&&i_(t)},this.condition_=void 0!==i.condition?i.condition:this.defaultCondition_,this.duration_=void 0!==i.duration?i.duration:100,this.pixelDelta_=void 0!==i.pixelDelta?i.pixelDelta:128}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(jv);function _S(t){var e=!1;if(t.type==Mf||t.type==Of){var i=t.originalEvent.charCode;if(this.condition_(t)&&(i=="+".charCodeAt(0)||i=="-".charCodeAt(0))){var n=t.map,r=i=="+".charCodeAt(0)?this.delta_:-this.delta_;$v(n.getView(),r,void 0,this.duration_),t.preventDefault(),e=!0}}return!e}const bS=function(t){function e(e){t.call(this,{handleEvent:_S});var i=e||{};this.condition_=i.condition?i.condition:i_,this.delta_=i.delta?i.delta:1,this.duration_=void 0!==i.duration?i.duration:100}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(jv);var wS="trackpad",xS="wheel";const SS=function(t){function e(e){var i=e||{};t.call(this,i),this.delta_=0,this.duration_=void 0!==i.duration?i.duration:250,this.timeout_=void 0!==i.timeout?i.timeout:80,this.useAnchor_=void 0===i.useAnchor||i.useAnchor,this.constrainResolution_=i.constrainResolution||!1,this.condition_=i.condition?i.condition:Yy,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.trackpadDeltaPerZoom_=300,this.trackpadZoomBuffer_=1.5}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.decrementInteractingHint_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().setHint($x,-1)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var e=t.type;if(e!==zf&&e!==jf)return!0;t.preventDefault();var i,n=t.map,r=t.originalEvent;if(this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==zf?(i=r.deltaY,Dy&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(i/=Uy),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(i*=40)):t.type==jf&&(i=-r.wheelDeltaY,jy&&(i/=3)),0===i)return!1;var o=Date.now();if(void 0===this.startTime_&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(i)<4?wS:xS),this.mode_===wS){var s=n.getView();this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):s.setHint($x,1),this.trackpadTimeoutId_=setTimeout(this.decrementInteractingHint_.bind(this),this.trackpadEventGap_);var a=s.getResolution()*Math.pow(2,i/this.trackpadDeltaPerZoom_),l=s.getMinResolution(),u=s.getMaxResolution(),h=0;if(au&&(a=Math.min(a,u*this.trackpadZoomBuffer_),h=-1),this.lastAnchor_){var c=s.calculateCenterZoom(a,this.lastAnchor_);s.setCenter(s.constrainCenter(c))}return s.setResolution(a),0===h&&this.constrainResolution_&&s.animate({resolution:s.constrainResolution(a,i>0?-1:1),easing:kv,anchor:this.lastAnchor_,duration:this.duration_}),h>0?s.animate({resolution:l,easing:kv,anchor:this.lastAnchor_,duration:500}):h<0&&s.animate({resolution:u,easing:kv,anchor:this.lastAnchor_,duration:500}),this.startTime_=o,!1}this.delta_+=i;var d=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),d),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();$v(e,-$g(this.delta_,-1,1),this.lastAnchor_,this.duration_),this.mode_=void 0,this.delta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(jv);const CS=function(t){function e(e){var i=e||{},n=i;n.stopDown||(n.stopDown=xf),t.call(this,n),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=void 0!==i.threshold?i.threshold:.3,this.duration_=void 0!==i.duration?i.duration:250}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],n=this.targetPointers[1],r=Math.atan2(n.clientY-i.clientY,n.clientX-i.clientX);if(void 0!==this.lastAngle_){var o=r-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=r;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==Fx){var l=s.getViewport().getBoundingClientRect(),u=Nv(this.targetPointers);if(u[0]-=l.left,u[1]-=l.top,this.anchor_=s.getCoordinateFromPixel(u),this.rotating_){var h=a.getRotation();s.render(),Ov(a,h+e,this.anchor_)}}},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView();if(e.setHint($x,-1),this.rotating_){var i=e.getRotation();Mv(e,i,this.anchor_,this.duration_)}return!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().setHint($x,1),!0}return!1},e}(Bv);const TS=function(t){function e(e){var i=e||{},n=i;n.stopDown||(n.stopDown=xf),t.call(this,n),this.constrainResolution_=i.constrainResolution||!1,this.anchor_=null,this.duration_=void 0!==i.duration?i.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],n=this.targetPointers[1],r=i.clientX-n.clientX,o=i.clientY-n.clientY,s=Math.sqrt(r*r+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,l=a.getView(),u=l.getResolution(),h=l.getMaxResolution(),c=l.getMinResolution(),d=u*e;d>h?(e=h/u,d=h):de.getMaxResolution()){var n=this.lastScaleDelta_-1;!function(t,e,i,n,r){e=t.constrainResolution(e,0,r),Dv(t,e,i,n)}(e,i,this.anchor_,this.duration_,n)}return!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().setHint($x,1),!0}return!1},e}(Bv);function ES(t){var e=t||{},i=new Sy,n=new eS(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new oS),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new nS({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new rS({condition:e.onFocusOnly?Xy:void 0,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new CS),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new TS({constrainResolution:e.constrainResolution,duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new yS),i.push(new bS({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new SS({condition:e.onFocusOnly?Xy:void 0,constrainResolution:e.constrainResolution,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new dS({duration:e.zoomDuration})),i}const IS=function(t){function e(e,i,n,r,o){t.call(this,e),this.vectorContext=i,this.frameState=n,this.context=r,this.glContext=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ef);var AS=function(){};AS.prototype.drawCustom=function(t,e,i){},AS.prototype.drawGeometry=function(t){},AS.prototype.setStyle=function(t){},AS.prototype.drawCircle=function(t,e){},AS.prototype.drawEllipse=function(t,e){},AS.prototype.drawFeature=function(t,e){},AS.prototype.drawGeometryCollection=function(t,e){},AS.prototype.drawLineString=function(t,e){},AS.prototype.drawMultiLineString=function(t,e){},AS.prototype.drawMultiPoint=function(t,e){},AS.prototype.drawMultiPolygon=function(t,e){},AS.prototype.drawPoint=function(t,e){},AS.prototype.drawPolygon=function(t,e){},AS.prototype.drawText=function(t,e){},AS.prototype.setFillStrokeStyle=function(t,e){},AS.prototype.setImageStyle=function(t,e){},AS.prototype.setTextStyle=function(t,e){};const PS=AS;const kS=function(t){function e(e,i,n,r,o){t.call(this),this.context_=e,this.pixelRatio_=i,this.extent_=n,this.transform_=r,this.viewRotation_=o,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=0,this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=0,this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=[1,0,0,1,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawImages_=function(t,e,i,n){if(this.image_){var r=Og(t,e,i,2,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.tmpLocalTransform_,a=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=a*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,h=r.length;uthis.maxCacheSize_){var t=0;for(var e in this.cache_){var i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},RS.prototype.get=function(t,e,i){var n=LS(t,e,i);return n in this.cache_?this.cache_[n]:null},RS.prototype.set=function(t,e,i,n){var r=LS(t,e,i);this.cache_[r]=n,++this.cacheSize_},RS.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()};var FS=new RS;function MS(t,e){FS.expire()}function OS(t,e){return t.zIndex-e.zIndex}var $S=[];const DS=function(t){function e(e){t.call(this,e);var i=e.getViewport();this.context_=lp(),this.canvas_=this.context_.canvas,this.canvas_.style.width="100%",this.canvas_.style.height="100%",this.canvas_.style.display="block",this.canvas_.className=rp,i.insertBefore(this.canvas_,i.childNodes[0]||null),this.renderedVisible_=!0,this.transform_=[1,0,0,1,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.dispatchRenderEvent=function(t,e){var i=this.getMap(),n=this.context_;if(i.hasListener(t)){var r=e.extent,o=e.pixelRatio,s=e.viewState.rotation,a=this.getTransform(e),l=new kS(n,o,r,a,s),u=new IS(t,l,e,n,null);i.dispatchEvent(u)}},e.prototype.getTransform=function(t){var e=t.viewState,i=this.canvas_.width/2,n=this.canvas_.height/2,r=t.pixelRatio/e.resolution,o=-r,s=-e.rotation,a=-e.center[0],l=-e.center[1];return Fm(this.transform_,i,n,r,o,s,a,l)},e.prototype.renderFrame=function(t){if(t){var e=this.context_,i=t.pixelRatio,n=Math.round(t.size[0]*i),r=Math.round(t.size[1]*i);this.canvas_.width!=n||this.canvas_.height!=r?(this.canvas_.width=n,this.canvas_.height=r):e.clearRect(0,0,n,r);var o=t.viewState.rotation;this.calculateMatrices2D(t),this.dispatchRenderEvent(R_,t);var s=t.layerStatesArray;!function(t,e){var i,n=t.length,r=Array(t.length);for(i=0;i=0;--l){var f=h[l],p=f.layer;if(M_(f,u)&&o.call(s,p))if(a=this.getLayerRenderer(p).forEachLayerAtCoordinate(d,e,i,n,r))return a}},e.prototype.registerLayerRenderers=function(e){t.prototype.registerLayerRenderers.call(this,e);for(var i=0,n=e.length;if[2])d=[g+p*Math.ceil((f[0]-g)/p),t[1]]}var m,v=e.layerStatesArray;for(m=v.length-1;m>=0;--m){var y=v[m],_=y.layer;if(M_(y,u)&&o.call(s,_)){var b=this.getLayerRenderer(_),w=_.getSource();if(w&&(a=b.forEachFeatureAtCoordinate(w.getWrapX()?d:t,e,i,h)),a)return a}}},e.prototype.forEachLayerAtPixel=function(t,e,i,n,r,o,s){return ef()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,n,r){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,wf,this,n,r)},e.prototype.getLayerRenderer=function(t){var e=rf(t);if(e in this.layerRenderers_)return this.layerRenderers_[e];for(var i,n=0,r=this.layerRendererConstructors_.length;n=.5&&c>=.5&&i.drawImage(n,0,0,+n.width,+n.height,Math.round(l),Math.round(u),Math.round(h),Math.round(c)),i.globalAlpha=a,o&&i.restore()}this.postCompose(i,t,e)},e.prototype.getImage=function(){return ef()},e.prototype.getImageTransform=function(){return ef()},e.prototype.forEachLayerAtCoordinate=function(t,e,i,n,r){if(this.getImage()){var o=km(this.coordinateToCanvasPixelTransform,t.slice());Fy(o,e.viewState.resolution/this.renderedResolution),this.hitCanvasContext_||(this.hitCanvasContext_=lp(1,1)),this.hitCanvasContext_.clearRect(0,0,1,1),this.hitCanvasContext_.drawImage(this.getImage(),o[0],o[1],1,1,0,0,1,1);var s=this.hitCanvasContext_.getImageData(0,0,1,1).data;return s[3]>0?n.call(r,this.getLayer(),s):void 0}},e}(jS);var BS=function(t){function e(i){if(t.call(this,i),this.image_=null,this.imageTransform_=[1,0,0,1,0,0],this.skippedFeatures_=[],this.vectorRenderer_=null,i.getType()===w_)for(var n=0,r=$S.length;nthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},zS.prototype.getHeight=function(){return this.maxY-this.minY+1},zS.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},zS.prototype.getWidth=function(){return this.maxX-this.minX+1},zS.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY};const GS=zS;var qS=function(t){function e(e,i){t.call(this,e),this.context=i?null:lp(),this.oversampling_,this.renderedExtent_=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=[1/0,1/0,-1/0,-1/0],this.tmpTileRange_=new GS(0,0,0,0),this.imageTransform_=[1,0,0,1,0,0],this.zDirection=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isDrawableTile_=function(t){var e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return i==Cx||i==Ex||i==Tx&&!n},e.prototype.getTile=function(t,e,i,n,r){var o=this.getLayer(),s=o.getSource().getTile(t,e,i,n,r);return s.getState()==Tx&&(o.getUseInterimTilesOnError()?o.getPreload()>0&&(this.newTiles_=!0):s.setState(Cx)),this.isDrawableTile_(s)||(s=s.getInterimTile()),s},e.prototype.prepareFrame=function(t,e){var i=t.pixelRatio,n=t.size,r=t.viewState,o=r.projection,s=r.resolution,a=r.center,l=this.getLayer(),u=l.getSource(),h=u.getRevision(),c=u.getTileGridForProjection(o),d=c.getZForResolution(s,this.zDirection),f=c.getResolution(d),p=Math.round(s/f)||1,g=t.extent;if(void 0!==e.extent&&(g=Qp(g,e.extent)),rg(g))return!1;var m=c.getTileRangeForExtentAndZ(g,d),v=c.getTileRangeExtent(d,m),y=u.getTilePixelRatio(i),_={};_[d]={};var b,w,x,S=this.createLoadedTileFinder(u,o,_),C=t.viewHints,T=C[Ox]||C[$x],E=this.tmpExtent,I=this.tmpTileRange_;for(this.newTiles_=!1,w=m.minX;w<=m.maxX;++w)for(x=m.minY;x<=m.maxY;++x)if(!(Date.now()-t.time>16&&T)){if(b=this.getTile(d,w,x,i,o),this.isDrawableTile_(b)){var A=rf(this);if(b.getState()==Cx){_[d][b.tileCoord.toString()]=b;var P=b.inTransition(A);this.newTiles_||!P&&-1!==this.renderedTiles.indexOf(b)||(this.newTiles_=!0)}if(1===b.getAlpha(A,t.time))continue}var k=c.getTileCoordChildTileRange(b.tileCoord,I,E),R=!1;k&&(R=S(d+1,k)),R||c.forEachTileCoordParentTileRange(b.tileCoord,S,null,I,E)}var L=f*i/y*p;if(!(this.renderedResolution&&Date.now()-t.time>16&&T)&&(this.newTiles_||!this.renderedExtent_||!Rp(this.renderedExtent_,g)||this.renderedRevision!=h||p!=this.oversampling_||!T&&L!=this.renderedResolution)){var F=this.context;if(F){var M=u.getTilePixelSize(d,i,o),O=Math.round(m.getWidth()*M[0]/p),$=Math.round(m.getHeight()*M[1]/p),D=F.canvas;D.width!=O||D.height!=$?(this.oversampling_=p,D.width=O,D.height=$):(this.renderedExtent_&&!Np(v,this.renderedExtent_)&&F.clearRect(0,0,O,$),p=this.oversampling_)}this.renderedTiles.length=0;var j,N,B,U,z,V,G,q,W,K,X=Object.keys(_).map(Number);for(X.sort((function(t,e){return t===d?1:e===d?-1:t>e?1:t0},e.prototype.drawTileImage=function(t,e,i,n,r,o,s,a,l){var u=this.getTileImage(t);if(u){var h=rf(this),c=l?t.getAlpha(h,e.time):1,d=this.getLayer().getSource();1!==c||d.getOpaque(e.viewState.projection)||this.context.clearRect(n,r,o,s);var f=c!==this.context.globalAlpha;f&&(this.context.save(),this.context.globalAlpha=c),this.context.drawImage(u,a,a,u.width-2*a,u.height-2*a,n,r,o,s),f&&this.context.restore(),1!==c?e.animate=!0:l&&t.endTransition(h)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getImageTransform=function(){return this.imageTransform_},e.prototype.getTileImage=function(t){return t.getImage()},e}(NS);qS.handles=function(t){return t.getType()===__},qS.create=function(t,e){return new qS(e)},qS.prototype.getLayer;const WS=qS;var KS=function(){};KS.prototype.getReplay=function(t,e){return ef()},KS.prototype.isEmpty=function(){return ef()},KS.prototype.addDeclutter=function(t){return ef()};const XS=KS,YS="Circle",HS="Default",ZS="Image",JS="LineString",QS="Polygon",tC="Text",eC="Ellipse";function iC(t,e,i,n,r,o,s,a){for(var l,u,h,c=[],d=t[e]>t[i-n],f=r.length,p=t[e],g=t[e+1],m=t[e+=n],v=t[e+1],y=0,_=Math.sqrt(Math.pow(m-p,2)+Math.pow(v-g,2)),b="",w=0,x=0;x0?-Math.PI:Math.PI),void 0!==h){var A=I-h;if(A+=A>Math.PI?-2*Math.PI:A<-Math.PI?2*Math.PI:0,Math.abs(A)>a)return null}var P=E/_,k=zg(p,m,P),R=zg(g,v,P);h==I?(d&&(l[0]=k,l[1]=R,l[2]=C/2),l[4]=b):(w=C,l=[k,R,C/2,I,b=S],d?c.unshift(l):c.push(l),h=I),s+=C}return c}var nC={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12,ELLIPSE:13},rC=[nC.FILL],oC=[nC.STROKE],sC=[nC.BEGIN_PATH],aC=[nC.CLOSE_PATH];const lC=nC;var uC=[QS,YS,eC,JS,ZS,tC,HS],hC={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},cC=[1/0,1/0,-1/0,-1/0],dC=[1,0,0,1,0,0];const fC=function(t){function e(e,i,n,r,o,s){t.call(this),this.declutterTree=s,this.tolerance=e,this.maxExtent=i,this.overlaps=o,this.pixelRatio=r,this.maxLineWidth=0,this.resolution=n,this.alignFill_,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=[],this.pixelCoordinates_=null,this.state={},this.viewRotation_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.replayTextBackground_=function(t,e,i,n,r,o,s){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,n),t.lineTo.apply(t,r),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),s&&(this.setStrokeStyle_(t,s),t.stroke())},e.prototype.replayImage_=function(t,e,i,n,r,o,s,a,l,u,h,c,d,f,p,g,m,v){var y=m||v;e-=r*=d,i-=o*=d;var _,b,w,x,S=p+u>n.width?n.width-u:p,C=a+h>n.height?n.height-h:a,T=g[3]+S*d+g[1],E=g[0]+C*d+g[2],I=e-g[3],A=i-g[0];(y||0!==c)&&(_=[I,A],b=[I+T,A],w=[I+T,A+E],x=[I,A+E]);var P=null;if(0!==c){var k=e+r,R=i+o;P=Fm(dC,k,R,1,1,c,-k,-R),$p(cC),Up(cC,km(dC,_)),Up(cC,km(dC,b)),Up(cC,km(dC,w)),Up(cC,km(dC,x))}else Op(I,A,I+T,A+E,cC);var L=t.canvas,F=v?v[2]*d/2:0,M=cC[0]-F<=L.width&&cC[2]+F>=0&&cC[1]-F<=L.height&&cC[3]+F>=0;if(f&&(e=Math.round(e),i=Math.round(i)),s){if(!M&&1==s[4])return;Bp(s,cC);var O=M?[t,P?P.slice(0):null,l,n,u,h,S,C,e,i,d]:null;O&&y&&O.push(m,v,_,b,w,x),s.push(O)}else M&&(y&&this.replayTextBackground_(t,_,b,w,x,m,v),db(t,P,l,n,u,h,S,C,e,i,d))},e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatCoordinates=function(t,e,i,n,r,o){var s=this.coordinates.length,a=this.getBufferedMaxExtent();o&&(e+=n);var l,u,h,c=[t[e],t[e+1]],d=[NaN,NaN],f=!0;for(l=e+n;l5){var i=t[4];if(1==i||i==t.length-5){var n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};if(!this.declutterTree.collides(n)){this.declutterTree.insert(n);for(var r=5,o=t.length;r11&&this.replayTextBackground_(s[0],s[13],s[14],s[15],s[16],s[11],s[12]),db.apply(void 0,s))}}t.length=5,$p(t)}}},e.prototype.replay_=function(t,e,i,n,r,o,s){var a;this.pixelCoordinates_&&_g(e,this.renderedTransform_)?a=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),a=Og(this.coordinates,0,this.coordinates.length,2,e,this.pixelCoordinates_),Pm(this.renderedTransform_,e));for(var l,u,h,c,d,f,p,g,m,v,y,_,b=!hf(i),w=0,x=n.length,S=0,C=0,T=0,E=null,I=null,A=this.coordinateCache_,P=this.viewRotation_,k={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:P},R=this.instructions!=n||this.overlaps?0:200;wR&&(this.fill_(t),C=0),T>R&&(t.stroke(),T=0),C||T||(t.beginPath(),c=d=NaN),++w;break;case lC.CIRCLE:var F=a[S=L[1]],M=a[S+1],O=a[S+2]-F,$=a[S+3]-M,D=Math.sqrt(O*O+$*$);t.moveTo(F+D,M),t.arc(F,M,D,0,2*Math.PI,!0),++w;break;case lC.ELLIPSE:S=L[1],l=L[2];var j=a[S],N=a[S+1],B=a[S+2],U=a[S+3],z=a[S+4],V=a[S+5],G=a[S+6],q=a[S+7];if(l-S==8){var W=.2761424*(z-j),K=.2761424*(V-N),X=.2761424*(G-B),Y=.2761424*(q-U);t.moveTo(j,N),t.bezierCurveTo(j-X,N-Y,B-W,U-K,B,U),t.bezierCurveTo(B+W,U+K,z-X,V-Y,z,V),t.bezierCurveTo(z+X,V+Y,G+W,q+K,G,q),t.bezierCurveTo(G-W,q-K,j+X,N+Y,j,N)}++w;break;case lC.CLOSE_PATH:t.closePath(),++w;break;case lC.CUSTOM:S=L[1],l=L[2];var H=L[3],Z=L[4],J=6==L.length?L[5]:void 0;k.geometry=H,k.feature=v,w in A||(A[w]=[]);var Q=A[w];J?J(a,S,l,2,Q):(Q[0]=a[S],Q[1]=a[S+1],Q.length=2),Z(Q,k),++w;break;case lC.DRAW_IMAGE:S=L[1],l=L[2],m=L[3],u=L[4],h=L[5],g=o?null:L[6];var tt=L[7],et=L[8],it=L[9],nt=L[10],rt=L[11],ot=L[12],st=L[13],at=L[14],lt=void 0,ut=void 0,ht=void 0;for(L.length>16?(lt=L[15],ut=L[16],ht=L[17]):(lt=Q_,ut=ht=!1),rt&&(ot+=P);Sthis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(t,e){var i=t.fillStyle,n=[lC.SET_FILL_STYLE,i];return"string"!=typeof i&&n.push(!0),n},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[lC.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e,i){var n=t.fillStyle;"string"==typeof n&&t.currentFillStyle==n||(void 0!==n&&this.instructions.push(e.call(this,t,i)),t.currentFillStyle=n)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,n=t.lineCap,r=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||r!=t.currentLineDash&&!_g(t.currentLineDash,r)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=r,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t,e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var i=[lC.END_GEOMETRY,e];this.instructions.push(i),this.hitDetectionInstructions.push(i)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Ap(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Ip(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(PS);const pC=function(t){function e(e,i,n,r,o,s){t.call(this,e,i,n,r,o,s),this.declutterGroup_=null,this.hitDetectionImage_=null,this.image_=null,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawCoordinates_=function(t,e,i,n){return this.appendFlatCoordinates(t,e,i,n,!1,!1)},e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),r=this.coordinates.length,o=this.drawCoordinates_(i,0,i.length,n);this.instructions.push([lC.DRAW_IMAGE,r,o,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([lC.DRAW_IMAGE,r,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(t,e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),r=this.coordinates.length,o=this.drawCoordinates_(i,0,i.length,n);this.instructions.push([lC.DRAW_IMAGE,r,o,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([lC.DRAW_IMAGE,r,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(t,e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),n=t.getSize(),r=t.getHitDetectionImage(1),o=t.getImage(1),s=t.getOrigin();this.anchorX_=i[0],this.anchorY_=i[1],this.declutterGroup_=e,this.hitDetectionImage_=r,this.image_=o,this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScale(),this.width_=n[0]},e}(fC);const gC=function(t){function e(e,i,n,r,o,s){t.call(this,e,i,n,r,o,s)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawFlatCoordinates_=function(t,e,i,n){var r=this.coordinates.length,o=this.appendFlatCoordinates(t,e,i,n,!1,!1),s=[lC.MOVE_TO_LINE_TO,r,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},e.prototype.drawLineString=function(t,e){var i=this.state,n=i.strokeStyle,r=i.lineWidth;if(void 0!==n&&void 0!==r){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([lC.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],sC);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(oC),this.endGeometry(t,e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,n=i.strokeStyle,r=i.lineWidth;if(void 0!==n&&void 0!==r){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([lC.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],sC);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),l=0,u=0,h=o.length;ut&&(v>m&&(m=v,p=y,g=o),v=0,y=o-r)),s=a,h=d,c=f),l=_,u=b}return(v+=a)>m?[y,o]:[p,g]}const yC="line";var _C={Circle:mC,Default:fC,Image:pC,LineString:gC,Polygon:mC,Text:function(t){function e(e,i,n,r,o,s){t.call(this,e,i,n,r,o,s),this.declutterGroup_,this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.widths_={},tb.prune()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawText=function(t,e){var i=this.textFillState_,n=this.textStrokeState_,r=this.textState_;if(""!==this.text_&&r&&(i||n)){var o,s,a=this.coordinates.length,l=t.getType(),u=null,h=2,c=2;if(r.placement===yC){if(!ng(this.getBufferedMaxExtent(),t.getExtent()))return;var d;if(u=t.getFlatCoordinates(),c=t.getStride(),l==Tg)d=[u.length];else if(l==Pg)d=t.getEnds();else if(l==Ig)d=t.getEnds().slice(0,1);else if(l==kg){var f=t.getEndss();for(d=[],o=0,s=f.length;o=w)&&u.push(x[o],x[o+1]);if(0==(h=u.length))return}h=this.appendFlatCoordinates(u,0,h,c,!1,!1),(r.backgroundFill||r.backgroundStroke)&&(this.setFillStrokeStyle(r.backgroundFill,r.backgroundStroke),r.backgroundFill&&(this.updateFillStyle(this.state,this.createFill,t),this.hitDetectionInstructions.push(this.createFill(this.state,t))),r.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e),this.drawTextImage_(b,a,h),this.endGeometry(t,e)}}},e.prototype.getImage=function(t,e,i,n){var r,o=n+e+t+i+this.pixelRatio;if(!tb.containsKey(o)){var s=n?this.strokeStates[n]||this.textStrokeState_:null,a=i?this.fillStates[i]||this.textFillState_:null,l=this.textStates[e]||this.textState_,u=this.pixelRatio,h=l.scale*u,c=hC[l.textAlign||Z_],d=n&&s.lineWidth?s.lineWidth:0,f=t.split("\n"),p=f.length,g=[],m=function(t,e,i){for(var n=e.length,r=0,o=0;o=o;)xC(i,t+r,t+o),xC(i,t+o,t+r),xC(i,t-o,t+r),xC(i,t-r,t+o),xC(i,t-r,t-o),xC(i,t-o,t-r),xC(i,t+o,t-r),xC(i,t+r,t-o),2*((s+=1+2*++o)-r)+1>0&&(s+=1-2*(r-=1));return wC[t]=i,i}(n);function p(t){for(var e=h.getImageData(0,0,l,l).data,i=0;i0){var r=void 0;return(!c||d!=ZS&&d!=tC||-1!==c.indexOf(t))&&(r=o(t)),r||void h.clearRect(0,0,l,l)}}this.declutterTree_&&(c=this.declutterTree_.all().map((function(t){return t.value})));var g,m,v,y,_,b=Object.keys(this.replaysByZIndex_).map(Number);for(b.sort(pg),g=b.length-1;g>=0;--g){var w=b[g].toString();for(v=this.replaysByZIndex_[w],m=uC.length-1;m>=0;--m)if(void 0!==(y=v[d=uC[m]]))if(!s||d!=ZS&&d!=tC){if(_=y.replayHitDetection(h,u,i,r,p,a))return _}else{var x=s[w];x?x.push(y,u.slice(0)):s[w]=[y,u.slice(0)]}}},e.prototype.getClipCoords=function(t){var e=this.maxExtent_,i=e[0],n=e[1],r=e[2],o=e[3],s=[i,n,i,o,r,o,r,n];return Og(s,0,8,2,t,s),s},e.prototype.getReplay=function(t,e){var i=void 0!==t?t.toString():"0",n=this.replaysByZIndex_[i];void 0===n&&(n={},this.replaysByZIndex_[i]=n);var r=n[e];void 0===r&&(r=new(0,_C[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_),n[e]=r);return r},e.prototype.getReplays=function(){return this.replaysByZIndex_},e.prototype.isEmpty=function(){return hf(this.replaysByZIndex_)},e.prototype.replay=function(t,e,i,n,r,o,s){var a=Object.keys(this.replaysByZIndex_).map(Number);a.sort(pg),t.save(),this.clip(t,e);var l,u,h,c,d,f,p=o||uC;for(l=0,u=a.length;l=r)for(n=r;nu[2];)P=R*++L,c=this.getTransform(e,P),p.replay(g,c,l,o,E),k-=R}if(hb(g,l,I/2,A/2),b&&this.dispatchRenderEvent(g,e,c),g!=t){if(_){var F=t.globalAlpha;t.globalAlpha=i.opacity,t.drawImage(g.canvas,-v,-y),t.globalAlpha=F}else t.drawImage(g.canvas,-v,-y);g.translate(-v,-y)}_||(g.globalAlpha=C)}f&&t.restore()},e.prototype.composeFrame=function(t,e,i){var n=this.getTransform(t,0);this.preCompose(i,t,n),this.compose(i,t,e),this.postCompose(i,t,e,n)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,r){if(this.replayGroup_){var o=e.viewState.resolution,s=e.viewState.rotation,a=this.getLayer(),l={};return this.replayGroup_.forEachFeatureAtCoordinate(t,o,s,i,{},(function(t){var e=rf(t);if(!(e in l))return l[e]=!0,n.call(r,t,a)}),null)}},e.prototype.handleFontsChanged_=function(t){var e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t,e){var i=this.getLayer(),n=i.getSource(),r=t.viewHints[Ox],o=t.viewHints[$x],s=i.getUpdateWhileAnimating(),a=i.getUpdateWhileInteracting();if(!this.dirty_&&!s&&r||!a&&o)return!0;var l=t.extent,u=t.viewState,h=u.projection,c=u.resolution,d=t.pixelRatio,f=i.getRevision(),p=i.getRenderBuffer(),g=i.getRenderOrder();void 0===g&&(g=TC);var m=Ip(l,p*c),v=u.projection.getExtent();if(n.getWrapX()&&u.projection.canWrapX()&&!Rp(v,t.extent)){var y=ig(v),_=Math.max(ig(m)/2,y);m[0]=v[0]-_,m[2]=v[2]+_}if(!this.dirty_&&this.renderedResolution_==c&&this.renderedRevision_==f&&this.renderedRenderOrder_==g&&Rp(this.renderedExtent_,m))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var b=new SC(IC(c,d),m,c,d,n.getOverlaps(),this.declutterTree_,i.getRenderBuffer());n.loadFeatures(m,c,h);var w=function(t){var e,n=t.getStyleFunction()||i.getStyleFunction();if(n&&(e=n(t,c)),e){var r=this.renderFeature(t,c,d,e,b);this.dirty_=this.dirty_||r}}.bind(this);if(g){var x=[];n.forEachFeatureInExtent(m,(function(t){x.push(t)})),x.sort(g);for(var S=0,C=x.length;S=0;--b){var w=m[b];if(w.getState()!=Ix)for(var x=w.tileCoord,S=v.getTileCoordExtent(x,this.tmpExtent)[0]-w.extent[0],C=void 0,T=0,E=w.tileKeys.length;T1?i.setAt(0,t.element):i.insertAt(0,t.element)}},initImageLayer:function(t){var e=this;t.getArray().forEach((function(t){e.refreshImageLayer({element:t})}))}},watch:{extent:function(){this.updateElementSize()}},created:function(){var t=new Gb;t.addFeature(this.viewport);var e=this.$parent.map;this.mapSize=e.getSize(),this.updateMapView({target:e}),e.on("change:size",this.updateMapSize),e.on("change:view",this.updateMapView),e.once("postcompose",this.updateViewport),this.minimap.addLayer(new Ab({source:t,style:gw.viewport})),e.getLayers().on("add",this.refreshImageLayer),this.minimap.on("pointerdrag",this.dragViewport),this.minimap.on("click",this.dragViewport),this.initImageLayer(e.getLayers())},mounted:function(){this.updateElementSize(),this.minimap.setTarget(this.$el),this.updateViewport()},beforeDestroy:function(){var t=this.$parent.map;this.mapView.un("change:center",this.updateViewport),this.mapView.un("change:resolution",this.updateViewport),t.un("change:size",this.updateMapSize),t.un("change:view",this.updateMapView),t.getLayers().un("add",this.refreshImageLayer)}},(function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"minimap"})}),[],!1,null,null,null).exports;var GC="modifystart",qC="modifyend",WC=function(t){function e(e,i,n){t.call(this,e),this.features=i,this.mapBrowserEvent=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ef);function KC(t,e){return t.index-e.index}function XC(t,e){var i,n,r=e.geometry;if(r.getType()===Lg){var o=r;if(1===e.index){var s=My(o.getCenter(),t),a=Math.sqrt(s)-o.getRadius();return a*a}}return i=t,n=e.segment,My(i,ky(i,n))}function YC(t,e){var i=e.geometry;return i.getType()===Lg&&1===e.index||i.getType()===Mg||i.getType()===Fg?i.getClosestPoint(t):ky(t,e.segment)}function HC(){var t=Sb();return function(e,i){return t[Cg]}}const ZC=function(t){function e(e){var i;if(t.call(this,e),this.condition_=e.condition?e.condition:r_,this.defaultDeleteCondition_=function(t){return Wy(t)&&Qy(t)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:Yy,this.vertexFeature_=null,this.vertexSegments_=null,this.lastPixel_=[0,0],this.ignoreNextSingleClick_=!1,this.modified_=!1,this.rBush_=new zb,this.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new Ab({source:new Gb({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:HC(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_,LineString:this.writeLineStringGeometry_,LinearRing:this.writeLineStringGeometry_,Polygon:this.writePolygonGeometry_,MultiPoint:this.writeMultiPointGeometry_,MultiLineString:this.writeMultiLineStringGeometry_,MultiPolygon:this.writeMultiPolygonGeometry_,Rectangle:this.writePolygonGeometry_,Ellipse:this.writePolygonGeometry_,Circle:this.writeCircleGeometry_,GeometryCollection:this.writeGeometryCollectionGeometry_},this.source_=null,e.source?(this.source_=e.source,i=new Sy(this.source_.getFeatures()),gf(this.source_,Ob,this.handleSourceAdd_,this),gf(this.source_,jb,this.handleSourceRemove_,this)):i=e.features,!i)throw new Error("The modify interaction requires features or a source");this.features_=i,this.features_.forEach(this.addFeature_.bind(this)),gf(this.features_,_y,this.handleFeatureAdd_,this),gf(this.features_,by,this.handleFeatureRemove_,this),this.lastPointerEvent_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature_=function(t){var e=t.getGeometry();e&&e.getType()in this.SEGMENT_WRITERS_&&this.SEGMENT_WRITERS_[e.getType()].call(this,t,e);var i=this.getMap();i&&i.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,i),gf(t,Af,this.handleFeatureChange_,this)},e.prototype.willModifyFeatures_=function(t){this.modified_||(this.modified_=!0,this.dispatchEvent(new WC(GC,this.features_,t)))},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),vf(t,Af,this.handleFeatureChange_,this)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,i=[];e.forEach((function(e){t===e.feature&&i.push(e)}));for(var n=i.length-1;n>=0;--n)e.remove(i[n])},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),n={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),n)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n=0;--p)this.insertVertex_.apply(this,n[p])}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var i=this.dragSegments_[e][0],n=i.geometry;if(n.getType()===Fg||n.getType()===Mg)this.features_.remove(i.feature),this.features_.push(i.feature);else if(n.getType()===Lg){var r=n.getCenter(),o=i.featureSegments[0],s=i.featureSegments[1];o.segment[0]=o.segment[1]=r,s.segment[0]=s.segment[1]=r,this.rBush_.update(Dp(r),o),this.rBush_.update(n.getExtent(),s)}else this.rBush_.update(Ep(i.segment),i)}return this.modified_&&(this.dispatchEvent(new WC(qC,this.features_,t)),this.modified_=!1),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map)},e.prototype.handlePointerAtPixel_=function(t,e){var i=e.getCoordinateFromPixel(t),n=Ip(Dp(i),e.getView().getResolution()*this.pixelTolerance_),r=this.rBush_.getInExtent(n);if(r.length>0){r.sort((function(t,e){return XC(i,t)-XC(i,e)}));var o=r[0],s=o.segment,a=YC(i,o),l=e.getPixelFromCoordinate(a),u=Oy(t,l);if(u<=this.pixelTolerance_){var h={};if(o.geometry.getType()===Lg&&1===o.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(a);else{var c=e.getPixelFromCoordinate(s[0]),d=e.getPixelFromCoordinate(s[1]),f=My(l,c),p=My(l,d);u=Math.sqrt(Math.min(f,p)),this.snappedToVertex_=u<=this.pixelTolerance_,this.snappedToVertex_&&(a=f>p?s[1]:s[0]),this.createOrUpdateVertexFeature_(a);for(var g=1,m=r.length;g=0;--r)h=rf((u=(i=c[r])[0]).feature),u.depth&&(h+="-"+u.depth.join("-")),h in d||(d[h]={}),0===i[1]?(d[h].right=u,d[h].index=u.index):1==i[1]&&(d[h].left=u,d[h].index=u.index+1);for(h in d){switch(l=d[h].right,s=d[h].left,(a=(o=d[h].index)-1)<0&&(a=0),t=e=(n=(u=void 0!==s?s:l).geometry).getCoordinates(),f=!1,n.getType()){case Pg:e[u.depth[0]].length>2&&(e[u.depth[0]].splice(o,1),f=!0);break;case Tg:e.length>2&&(e.splice(o,1),f=!0);break;case kg:t=t[u.depth[1]];case Ig:(t=t[u.depth[0]]).length>4&&(o==t.length-1&&(o=0),t.splice(o,1),f=!0,0===o&&(t.pop(),t.push(t[0]),a=t.length-1))}if(f){this.setGeometryCoordinates_(n,e);var p=[];if(void 0!==s&&(this.rBush_.remove(s),p.push(s.segment[0])),void 0!==l&&(this.rBush_.remove(l),p.push(l.segment[1])),void 0!==s&&void 0!==l){var g={depth:u.depth,feature:u.feature,geometry:u.geometry,index:a,segment:p};this.rBush_.insert(Ep(g.segment),g)}this.updateSegmentIndices_(n,o,u.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),c.length=0}}return f},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,i,n){this.rBush_.forEachInExtent(t.getExtent(),(function(r){r.geometry===t&&(void 0===i||void 0===r.depth||_g(r.depth,i))&&r.index>e&&(r.index+=n)}))},e}(Bv);const JC=Sl({props:{position:{type:Array,required:!0}},computed:{positionText:function(){return this.position.join(" × ")}}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"mouse-position-indicator",attrs:{title:"Mouse position in the image"},domProps:{textContent:t._s(t.positionText)}})}),[],!1,null,null,null).exports;const QC=Sl({components:{mousePositionIndicator:JC},props:{showMousePosition:{type:Boolean,default:!1}},data:function(){return{mousePositionIC:[0,0]}},watch:{mousePosition:function(t){var e=this;nu((function(){e.mousePositionIC=e.invertPointsYAxis(t.slice()).map(Math.round)}),100,"annotations.canvas.mouse-position-ic")}}},undefined,undefined,!1,null,null,null).exports;var tT=6371008.8,eT={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*tT,kilometers:6371.0088,kilometres:6371.0088,meters:tT,metres:tT,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:tT/1852,radians:1,yards:5825721.287490856};function iT(t,e,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=e||{},n.geometry=t,n}function nT(t,e,i){if(void 0===i&&(i={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!dT(t[0])||!dT(t[1]))throw new Error("coordinates must contain numbers");return iT({type:"Point",coordinates:t},e,i)}function rT(t,e,i){void 0===i&&(i={});for(var n=0,r=t;na||d>l||f>u)return s=o,a=i,l=d,u=f,void(r=0);var p=oT([s,o],t.properties);if(!1===e(p,i,n,f,r))return!1;r++,s=o}))&&void 0}}}))}function yT(t){var e=[1/0,1/0,-1/0,-1/0];return fT(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function wT(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")}function xT(t){return"Feature"===t.type?t.geometry:t}function ST(t,e,i){if(void 0===i&&(i={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var n=bT(t),r=xT(e),o=r.type,s=e.bbox,a=r.coordinates;if(s&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(n,s))return!1;"Polygon"===o&&(a=[a]);for(var l=!1,u=0;ut[1]!=u>t[1]&&t[0]<(l-s)*(t[1]-a)/(u-a)+s&&(n=!n)}return n}function TT(t,e,i,n){var r=i[0],o=i[1],s=t[0],a=t[1],l=e[0],u=e[1],h=l-s,c=u-a;return 0==(i[0]-s)*c-(i[1]-a)*h&&(n?"start"===n?Math.abs(h)>=Math.abs(c)?h>0?s0?a=Math.abs(c)?h>0?s<=r&&r0?a<=o&&o=Math.abs(c)?h>0?s0?a=Math.abs(c)?h>0?s<=r&&r<=l:l<=r&&r<=s:c>0?a<=o&&o<=u:u<=o&&o<=a)}const ET=function(t,e,i){void 0===i&&(i={});for(var n=bT(t),r=wT(e),o=0;oe[0])&&(!(t[2]e[1])&&!(t[3]l?s:l,a>u?a:u]),i.push(h),n})),i})(i,t.properties).forEach((function(t){t.id=e.length,e.push(t)}))}))}}(t,e)})),sT(e)};function FT(t,e,i){if(void 0===i&&(i={}),!0===i.final)return function(t,e){var i=FT(e,t);return i=(i+180)%360}(t,e);var n=bT(t),r=bT(e),o=cT(n[0]),s=cT(r[0]),a=cT(n[1]),l=cT(r[1]),u=Math.sin(s-o)*Math.cos(l),h=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(s-o);return hT(Math.atan2(u,h))}const MT=function(t,e,i){void 0===i&&(i={});var n=bT(t),r=bT(e),o=cT(r[1]-n[1]),s=cT(r[0]-n[0]),a=cT(n[1]),l=cT(r[1]),u=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(l);return lT(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),i.units)};function OT(t,e,i,n){void 0===n&&(n={});var r=bT(t),o=cT(r[0]),s=cT(r[1]),a=cT(i),l=uT(e,n.units),u=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(a));return nT([hT(o+Math.atan2(Math.sin(a)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(u))),hT(u)],n.properties)}function $T(t,e){var i=wT(t),n=wT(e);if(2!==i.length)throw new Error(" line1 must only contain 2 coordinates");if(2!==n.length)throw new Error(" line2 must only contain 2 coordinates");var r=i[0][0],o=i[0][1],s=i[1][0],a=i[1][1],l=n[0][0],u=n[0][1],h=n[1][0],c=n[1][1],d=(c-u)*(s-r)-(h-l)*(a-o),f=(h-l)*(o-u)-(c-u)*(r-l),p=(s-r)*(o-u)-(a-o)*(r-l);if(0===d)return null;var g=f/d,m=p/d;return g>=0&&g<=1&&m>=0&&m<=1?nT([r+g*(s-r),o+g*(a-o)]):null}const DT=function(t,e){var i={},n=[];if("LineString"===t.type&&(t=iT(t)),"LineString"===e.type&&(e=iT(e)),"Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var r=$T(t,e);return r&&n.push(r),sT(n)}var o=RT();return o.load(LT(e)),pT(LT(t),(function(t){pT(o.search(t),(function(e){var r=$T(t,e);if(r){var o=wT(r).join(",");i[o]||(i[o]=!0,n.push(r))}}))})),sT(n)};const jT=function(t,e,i){void 0===i&&(i={});var n=nT([1/0,1/0],{dist:1/0}),r=0;return mT(t,(function(t){for(var o=wT(t),s=0;s0&&((g=p.features[0]).properties.dist=MT(e,g,i),g.properties.location=r+MT(a,g,i)),a.properties.dist0}var GT=i(676);const qT=function(t,e,i){void 0===i&&(i={});var n=xT(t),r=xT(e),o=GT.union(n.coordinates,r.coordinates);return 0===o.length?null:1===o.length?rT(o[0],i.properties):aT(o,i.properties)};function WT(t,e){t.geometry.coordinates=ev(t.geometry.coordinates),e.geometry.coordinates=ev(e.geometry.coordinates);var i=qT(t,e);return"MultiPolygon"===i.geometry.type?i.geometry.coordinates[0]:i.geometry.coordinates}var KT=i(977),XT=i.n(KT);var YT=function(t){var e=t.pointerEvent;return e&&"pen"===e.pointerType};function HT(t,e){var i=t.originalEvent.deltaY;t.type==jf?0===(i=-t.originalEvent.wheelDeltaY)&&(i=-t.originalEvent.wheelDeltaX):0===i&&(i=t.originalEvent.deltaX);var n=5;return e<=25&&(n=1),i>0?e+n:i<0?Math.max(e-n,5):e}function ZT(t,e){return 0!=t.pointerEvent.pressure?(e=HT(t,e),Math.max(e*t.pointerEvent.pressure,5)*t.map.getView().getResolution()):e}function JT(){var t=Sb();return t[Ig]=t[Ig].concat(t[Tg]),function(e,i){return t[e.getGeometry().getType()]}}const QT=function(t){function e(e){e.freehandCondition=e.freehandCondition?e.freehandCondition:YT,t.call(this,e),this.overlay_=new Ab({source:this.overlay_.getSource(),style:e.style?e.style:JT(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.sketchPointRadius_=void 0!==e.brushRadius?e.brushRadius:100,this.condition_=void 0!==e.condition?e.condition:Yy,this.resizeCondition_=void 0!==e.resizeCondition?e.resizeCondition:e_,this.isDrawing_=!1,this.sketchCircle_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setMap=function(e){if(t.prototype.setMap.call(this,e),e){var i=e.getView();i&&this.watchViewForChangedResolution(i),e.on("change:view",function(t){this.watchViewForChangedResolution(t.target.getView())}.bind(this))}},e.prototype.watchViewForChangedResolution=function(t){t.on("change:resolution",this.updateRelativeSketchPointRadius_.bind(this))},e.prototype.handleEvent=function(e){var i=e.type,n=!0;return this.resizeCondition_(e)&&(i===zf||jf)&&(e.originalEvent.preventDefault(),this.updateAbsoluteSketchPointRadius_(e),n=!1),e.type===Av.POINTERDRAG&&this.handlingDownUpSequence&&(n=!1),t.prototype.handleEvent.call(this,e)&&n},e.prototype.handleDownEvent=function(t){return!(this.handlingDownUpSequence||!this.condition_(t))&&(this.startDrawing_(t),!0)},e.prototype.handleUpEvent=function(t){return!(!this.handlingDownUpSequence||!this.isDrawing_)&&(this.finishDrawing(),!0)},e.prototype.createOrUpdateSketchPoint_=function(t){var e=t.coordinate.slice();if(this.sketchPoint_){this.sketchPoint_.getGeometry().setCenter(e)}else{var i=t.map.getView().getResolution()*this.sketchPointRadius_;this.sketchPoint_=new Ty(new wv(e,i)),this.updateSketchFeatures_()}},e.prototype.updateRelativeSketchPointRadius_=function(t){this.sketchPoint_&&this.sketchPoint_.getGeometry().setRadius(this.sketchPointRadius_*t.target.getResolution())},e.prototype.updateAbsoluteSketchPointRadius_=function(t){this.sketchPoint_&&(this.sketchPointRadius_=HT(t,this.sketchPointRadius_),this.sketchPoint_.getGeometry().setRadius(this.sketchPointRadius_*t.map.getView().getResolution()))},e.prototype.createOrUpdateSketchCircle_=function(t){var e=t.coordinate.slice();this.sketchCircle_?(this.sketchCircle_.setCenter(e),this.sketchCircle_.setRadius(this.sketchPoint_.getGeometry().getRadius())):this.sketchCircle_=new wv(e,this.sketchPoint_.getGeometry().getRadius()),"pen"===t.originalEvent.pointerType&&this.sketchCircle_.setRadius(ZT(t,this.sketchPointRadius_))},e.prototype.startDrawing_=function(t){this.isDrawing_=!0,this.createOrUpdateSketchPoint_(t),this.createOrUpdateSketchCircle_(t);var e=t.coordinate;this.finishCoordinate_=e,this.sketchFeature_=new Ty(_v(this.sketchCircle_)),this.updateSketchFeatures_(),this.dispatchEvent(new tw(Jb,this.sketchFeature_))},e.prototype.handlePointerMove_=function(t){if(this.createOrUpdateSketchPoint_(t),this.createOrUpdateSketchCircle_(t),this.isDrawing_&&this.sketchFeature_){var e=rT(_v(this.sketchCircle_).getCoordinates()),i=this.sketchFeature_.getGeometry(),n=rT(i.getCoordinates());(VT(e,n)||IT(e,n))&&i.setCoordinates(WT(e,n))}},e.prototype.finishDrawing=function(){this.isDrawing_=!1;var t=this.abortDrawing_();t&&(this.dispatchEvent(new tw(Qb,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t))},e.prototype.getBrushRadius=function(){return this.sketchPointRadius_},e.prototype.abortDrawing_=function(){return this.sketchCircle_=null,t.prototype.abortDrawing_.call(this)},e}(iw);var tE="modifyremove";const eE=function(t){function e(e){t.call(this,e),this.overlay_.setStyle(e.style?e.style:function(){var t=Sb();return function(e,i){return t[Lg]}}()),this.sketchPoint_=null,this.sketchPointRadius_=void 0!==e.brushRadius?e.brushRadius:100,this.addCondition_=void 0!==e.addCondition?e.addCondition:Yy,this.subtractCondition_=void 0!==e.subtractCondition?e.subtractCondition:Yy,this.resizeCondition_=void 0!==e.resizeCondition?e.resizeCondition:e_,this.allowRemove_=void 0===e.allowRemove||e.allowRemove,this.isAdding_=!1,this.isSubtracting_=!1,this.sketchCircle_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setMap=function(e){if(t.prototype.setMap.call(this,e),e){var i=e.getView();i&&this.watchViewForChangedResolution(i),e.on("change:view",function(t){this.watchViewForChangedResolution(t.target.getView())}.bind(this))}},e.prototype.watchViewForChangedResolution=function(t){t.on("change:resolution",this.updateRelativeSketchPointRadius_.bind(this))},e.prototype.createOrUpdateSketchPoint_=function(t){var e=t.coordinate.slice();if(this.sketchPoint_){this.sketchPoint_.getGeometry().setCenter(e)}else{var i=t.map.getView().getResolution()*this.sketchPointRadius_;this.sketchPoint_=new Ty(new wv(e,i)),this.overlay_.getSource().addFeature(this.sketchPoint_)}},e.prototype.createOrUpdateSketchCircle_=function(t){var e=t.coordinate.slice();this.sketchCircle_?(this.sketchCircle_.setCenter(e),this.sketchCircle_.setRadius(this.sketchPoint_.getGeometry().getRadius())):this.sketchCircle_=new wv(e,this.sketchPoint_.getGeometry().getRadius()),"pen"===t.originalEvent.pointerType&&this.sketchCircle_.setRadius(ZT(t,this.sketchPointRadius_))},e.prototype.updateRelativeSketchPointRadius_=function(t){this.sketchPoint_&&this.sketchPoint_.getGeometry().setRadius(this.sketchPointRadius_*t.target.getResolution())},e.prototype.updateAbsoluteSketchPointRadius_=function(t){this.sketchPoint_&&(this.sketchPointRadius_=HT(t,this.sketchPointRadius_),this.sketchPoint_.getGeometry().setRadius(this.sketchPointRadius_*t.map.getView().getResolution()))},e.prototype.handleEvent=function(e){var i=e.type,n=!0;return this.resizeCondition_(e)&&(i===zf||jf)&&(e.originalEvent.preventDefault(),this.updateAbsoluteSketchPointRadius_(e),n=!1),t.prototype.handleEvent.call(this,e)&&n},e.prototype.handlePointerMove_=function(t){this.createOrUpdateSketchPoint_(t),this.createOrUpdateSketchCircle_(t)},e.prototype.handleDownEvent=function(t){if(!this.handlingDownUpSequence){if(this.createOrUpdateSketchPoint_(t),this.createOrUpdateSketchCircle_(t),this.subtractCondition_(t))return this.startSubtracting_(t),!0;if(this.addCondition_(t))return this.startAdding_(t),!0}return!1},e.prototype.handleUpEvent=function(t){return!(!this.handlingDownUpSequence||!this.isSubtracting_&&!this.isAdding_)&&(this.finishModifying_(t),!0)},e.prototype.startSubtracting_=function(t){this.isSubtracting_=!0,this.willModifyFeatures_(t),this.subtractCurrentFeatures_(t)},e.prototype.startAdding_=function(t){this.isAdding_=!0,this.willModifyFeatures_(t),this.addCurrentFeatures_(t)},e.prototype.handleDragEvent=function(t){this.createOrUpdateSketchPoint_(t),this.createOrUpdateSketchCircle_(t),this.isSubtracting_?this.subtractCurrentFeatures_(t):this.isAdding_&&this.addCurrentFeatures_(t)},e.prototype.subtractCurrentFeatures_=function(t){var e=_v(this.sketchCircle_),i=rT(e.getCoordinates()),n=e.getArea();this.features_.getArray().forEach((function(e){var r=e.getGeometry();try{var o=rT(r.getCoordinates())}catch(t){return}if(VT(i,o)){var s=function(t,e){t.geometry.coordinates=ev(t.geometry.coordinates),e.geometry.coordinates=ev(e.geometry.coordinates);var i=XT()(t,e);if("MultiPolygon"===i.geometry.type){for(var n,r=0,o=0;or&&(r=s,n=i.geometry.coordinates[o])}return n}return i.geometry.coordinates}(o,i);if(!this.allowRemove_&&n>new vv(s).getArea())return;r.setCoordinates(s)}else IT(i,o)&&this.allowRemove_&&(this.features_.remove(e),this.source_&&this.source_.removeFeature(e),this.dispatchEvent(new WC(tE,new Sy([e]),t)))}),this)},e.prototype.addCurrentFeatures_=function(t){var e=_v(this.sketchCircle_),i=rT(e.getCoordinates());this.features_.getArray().forEach((function(t){var n=t.getGeometry();try{var r=rT(n.getCoordinates())}catch(t){return}VT(i,r)?n.setCoordinates(WT(i,r)):IT(i,r)&&n.setCoordinates(e.getCoordinates())}),this)},e.prototype.finishModifying_=function(t){this.isSubtracting_=!1,this.isAdding_=!1,this.dispatchEvent(new WC(qC,this.features_,t))},e.prototype.getBrushRadius=function(){return this.sketchPointRadius_},e}(ZC);var iE="select",nE=function(t){function e(e,i,n,r){t.call(this,e),this.selected=i,this.deselected=n,this.mapBrowserEvent=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ef);function rE(t){if(!this.condition_(t))return!0;var e=this.addCondition_(t),i=this.removeCondition_(t),n=this.toggleCondition_(t),r=!e&&!i&&!n,o=t.map,s=this.getFeatures(),a=[],l=[];if(r){lf(this.featureLayerAssociation_),o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.filter_(t,e))return l.push(t),this.addFeatureLayerAssociation_(t,e),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var u=s.getLength()-1;u>=0;--u){var h=s.item(u),c=l.indexOf(h);c>-1?l.splice(c,1):(s.remove(h),a.push(h))}0!==l.length&&s.extend(l)}else{o.forEachFeatureAtPixel(t.pixel,function(t,r){if(this.filter_(t,r))return!e&&!n||gg(s.getArray(),t)?(i||n)&&gg(s.getArray(),t)&&(a.push(t),this.removeFeatureLayerAssociation_(t)):(l.push(t),this.addFeatureLayerAssociation_(t,r)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var d=a.length-1;d>=0;--d)s.remove(a[d]);s.extend(l)}return(l.length>0||a.length>0)&&this.dispatchEvent(new nE(iE,l,a,t)),function(t){return"pointermove"==t.type}(t)}function oE(){var t=Sb();return yg(t[Ig],t[Tg]),yg(t[Rg],t[Tg]),function(e,i){return e.getGeometry()?t[e.getGeometry().getType()]:null}}const sE=function(t){function e(e){t.call(this,{handleEvent:rE});var i=e||{};this.condition_=i.condition?i.condition:Qy,this.addCondition_=i.addCondition?i.addCondition:Jy,this.removeCondition_=i.removeCondition?i.removeCondition:Jy,this.toggleCondition_=i.toggleCondition?i.toggleCondition:e_,this.multi_=!!i.multi&&i.multi,this.filter_=i.filter?i.filter:wf,this.hitTolerance_=i.hitTolerance?i.hitTolerance:0;var n,r=new Ab({source:new Gb({useSpatialIndex:!1,features:i.features,wrapX:i.wrapX}),style:i.style?i.style:oE(),updateWhileAnimating:!0,updateWhileInteracting:!0});if(this.featureOverlay_=r,i.layers)if("function"==typeof i.layers)n=i.layers;else{var o=i.layers;n=function(t){return gg(o,t)}}else n=wf;this.layerFilter_=n,this.featureLayerAssociation_={};var s=this.getFeatures();gf(s,_y,this.addFeature_,this),gf(s,by,this.removeFeature_,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeatureLayerAssociation_=function(t,e){this.featureLayerAssociation_[rf(t)]=e},e.prototype.getFeatures=function(){return this.featureOverlay_.getSource().getFeaturesCollection()},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.getLayer=function(t){return this.featureLayerAssociation_[rf(t)]},e.prototype.getOverlay=function(){return this.featureOverlay_},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){var i=this.getMap(),n=this.getFeatures();i&&n.forEach(i.unskipFeature.bind(i)),t.prototype.setMap.call(this,e),this.featureOverlay_.setMap(e),e&&n.forEach(e.skipFeature.bind(e))},e.prototype.addFeature_=function(t){var e=this.getMap();e&&e.skipFeature(t.element)},e.prototype.removeFeature_=function(t){var e=this.getMap();e&&e.unskipFeature(t.element)},e.prototype.removeFeatureLayerAssociation_=function(t){delete this.featureLayerAssociation_[rf(t)]},e}(jv);var aE,lE,uE=50;const hE=Sl({computed:{isUsingPolygonBrush:function(){return"polygonBrush"===this.interactionMode},isUsingPolygonEraser:function(){return"polygonEraser"===this.interactionMode},isUsingPolygonFill:function(){return"polygonFill"===this.interactionMode}},methods:{togglePolygonBrush:function(){this.isUsingPolygonBrush?this.resetInteractionMode():this.hasSelectedLabel?this.canAdd&&(this.interactionMode="polygonBrush"):this.requireSelectedLabel()},togglePolygonEraser:function(){this.isUsingPolygonEraser?this.resetInteractionMode():this.canModify&&(this.interactionMode="polygonEraser")},togglePolygonFill:function(){this.isUsingPolygonFill?this.resetInteractionMode():this.canModify&&(this.interactionMode="polygonFill")},toggleCurrentInteraction:function(t){lE&&(uE=lE.getBrushRadius(),this.map.removeInteraction(lE),lE=null),this.canAdd&&"polygonBrush"===t?((lE=new QT({map:this.map,source:this.annotationSource,style:gw.editing,brushRadius:uE,resizeCondition:Wy})).on("drawend",this.handleNewFeature),this.map.addInteraction(lE)):this.canModify&&"polygonEraser"===t?((lE=new eE({map:this.map,features:this.selectInteraction.getFeatures(),style:gw.editing,brushRadius:uE,allowRemove:!1,addCondition:Jy,subtractCondition:t_,resizeCondition:Wy})).on("modifystart",this.handleFeatureModifyStart),lE.on("modifyend",this.handleFeatureModifyEnd),this.map.addInteraction(lE),this.map.addInteraction(aE)):this.canModify&&"polygonFill"===t&&((lE=new eE({map:this.map,features:this.selectInteraction.getFeatures(),style:gw.editing,brushRadius:uE,addCondition:t_,subtractCondition:Jy,resizeCondition:Wy})).on("modifystart",this.handleFeatureModifyStart),lE.on("modifyend",this.handleFeatureModifyEnd),this.map.addInteraction(lE),this.map.addInteraction(aE))}},created:function(){this.canAdd&&kl.on("e",this.togglePolygonBrush,0,this.listenerSet),this.canModify&&(kl.on("r",this.togglePolygonEraser,0,this.listenerSet),kl.on("t",this.togglePolygonFill,0,this.listenerSet)),(this.canAdd||this.canModify)&&this.$watch("interactionMode",this.toggleCurrentInteraction)},mounted:function(){this.canModify&&(aE=new sE({condition:function(t){return Hy(t)&&e_(t)},style:gw.highlight,layers:[this.annotationLayer],features:this.selectInteraction.getFeatures(),multi:!0})).on("select",this.handleFeatureSelect)}},undefined,undefined,!1,null,null,null).exports;var cE,dE;const fE=Sl({data:function(){return{regularSamplingRows:null,regularSamplingColumns:null,currentSamplingIndex:null,randomSamplingCount:null,randomLocationMemory:{}}},computed:{regularSamplingLocations:function(){for(var t=[this.image.width/this.regularSamplingColumns,this.image.height/this.regularSamplingRows],e=[t[0]/2,t[1]/2],i=[],n=this.regularSamplingRows-1;n>=0;n--)for(var r=this.regularSamplingColumns-1;r>=0;r--)i.unshift([e[0]+r*t[0],e[1]+n*t[1]]);return i},randomSamplingLocations:function(){if(!this.randomLocationMemory.hasOwnProperty(this.image.id)){for(var t=[],e=this.image.width,i=this.image.height,n=this.randomSamplingCount;n>0;n--)t.push([Math.round(Math.random()*e),Math.round(Math.random()*i)]);this.randomLocationMemory[this.image.id]=t}return this.randomLocationMemory[this.image.id]},samplingLocations:function(){return this[this.annotationMode+"Locations"]},isSamplingAnnotationMode:function(){return this.annotationMode.endsWith("Sampling")}},methods:{setSamplingData:function(t,e){"regularSampling"===t?Array.isArray(e)&&e[0]>0&&e[1]>0&&(this.regularSamplingRows=e[0],this.regularSamplingColumns=e[1]):"randomSampling"===t&&e>0&&(this.randomSamplingCount=e)},updateShownSamplingLocation:function(){var t=this.currentSamplingIndex;null!==t&&t>=0&&t=this.samplingLocations.length)&&(this.currentSamplingIndex=t,this.updateShownSamplingLocation(),!0)},createSampledAnnotation:function(){var t=this.samplingLocations[this.currentSamplingIndex];this.createPointAnnotationAt(t[0],t[1])}},watch:{isSamplingAnnotationMode:function(t){t?this.map.addLayer(cE):this.map.removeLayer(cE)},randomSamplingCount:function(){this.randomLocationMemory={}}},created:function(){cE=new Ab({source:new Gb,style:[new Tb({image:new gb({radius:6,stroke:new _b({color:"white",width:4})})}),new Tb({image:new gb({radius:6,stroke:new _b({color:[0,153,255,1],width:2,lineDash:[3]})})})],zIndex:90,updateWhileAnimating:!0,updateWhileInteracting:!0}),dE=new Ty(new nv([0,0])),cE.getSource().addFeature(dE)}},undefined,undefined,!1,null,null,null).exports;var pE=Sl({mixins:[fg],props:{resolution:{required:!0}},data:function(){return{targetWidth:100,leadingDigits:[1,2,5]}},computed:{scale:function(){return this.targetWidth*this.scaleMultiplier},scalePowerOfTen:function(){return this.powerOfTen(this.scale)},scaleMultiplier:function(){return this.hasArea?this.resolution*this.pxWidthInMeter:this.resolution||0},scaleNearest:function(){for(var t=0,e=1/0,i=this.leadingDigits.length-1;i>=0;i--){var n=this.leadingDigits[i]*this.scalePowerOfTen;Math.abs(this.scale-n)=0;i--)Math.abs(this.unitMultipliers[i]-this.scalePowerOfTen)0)||(this.translating||(this.dispatchEvent({type:"translatestart",features:this.features}),this.translating=!0),this.features.forEach((function(i){var n=i.getGeometry();n.translate(t,e),i.setGeometry(n)})),Ql((function(){i.translating=!1,i.dispatchEvent({type:"translateend",features:i.features})}),500,"ol.interactions.Translate.translateend"),!1)}}])&&TE(e.prototype,i),n&&TE(e,n),o}(function(t){function e(e){var i,n=e||{};if(t.call(this,n),this.lastCoordinate_=null,this.features_=void 0!==n.features?n.features:null,n.layers)if("function"==typeof n.layers)i=n.layers;else{var r=n.layers;i=function(t){return gg(r,t)}}else i=wf;this.layerFilter_=i,this.hitTolerance_=n.hitTolerance?n.hitTolerance:0,this.lastFeature_=null,gf(this,Wf(Fv),this.handleActiveChanged_,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDownEvent=function(t){if(this.lastFeature_=this.featuresAtPixel_(t.pixel,t.map),!this.lastCoordinate_&&this.lastFeature_){this.lastCoordinate_=t.coordinate,this.handleMoveEvent(t);var e=this.features_||new Sy([this.lastFeature_]);return this.dispatchEvent(new SE(bE,e,t.coordinate)),!0}return!1},e.prototype.handleUpEvent=function(t){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(t);var e=this.features_||new Sy([this.lastFeature_]);return this.dispatchEvent(new SE(xE,e,t.coordinate)),!0}return!1},e.prototype.handleDragEvent=function(t){if(this.lastCoordinate_){var e=t.coordinate,i=e[0]-this.lastCoordinate_[0],n=e[1]-this.lastCoordinate_[1],r=this.features_||new Sy([this.lastFeature_]);r.forEach((function(t){var e=t.getGeometry();e.translate(i,n),t.setGeometry(e)})),this.lastCoordinate_=e,this.dispatchEvent(new SE(wE,r,e))}},e.prototype.handleMoveEvent=function(t){var e=t.map.getViewport();this.featuresAtPixel_(t.pixel,t.map)?(e.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),e.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")},e.prototype.featuresAtPixel_=function(t,e){return e.forEachFeatureAtPixel(t,function(t){if(!this.features_||gg(this.features_.getArray(),t))return t}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){var i=this.getMap();t.prototype.setMap.call(this,e),this.updateState_(i)},e.prototype.handleActiveChanged_=function(){this.updateState_(null)},e.prototype.updateState_=function(t){var e=this.getMap(),i=this.getActive();e&&i||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")},e}(Bv));var RE;const LE=Sl({computed:{isTranslating:function(){return"translate"===this.interactionMode}},methods:{toggleTranslating:function(){this.isTranslating?this.resetInteractionMode():this.modifyInProgress||(this.interactionMode="translate")}},watch:{isTranslating:function(t){this.canModify&&RE.setActive(t)}},mounted:function(){this.canModify&&((RE=new kE({features:this.selectInteraction.getFeatures(),map:this.map})).setActive(!1),RE.on("translatestart",this.handleFeatureModifyStart),RE.on("translateend",this.handleFeatureModifyEnd),this.map.addInteraction(RE),kl.on("m",this.toggleTranslating,0,this.listenerSet))}},undefined,undefined,!1,null,null,null).exports;const FE=function(t){function e(e,i,n){t.call(this);var r=n||{};this.tileCoord=e,this.state=i,this.interimTile=null,this.key="",this.transition_=void 0===r.transition?250:r.transition,this.transitionStarts_={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.changed=function(){this.dispatchEvent(Af)},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==Cx)return t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==Cx){t.interimTile=null;break}t.getState()==Sx?e=t:t.getState()==xx?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){this.state=t,this.changed()},e.prototype.load=function(){},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var n=e-i+1e3/60;return n>=this.transition_?1:Pv(n/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(If);function ME(){var t=lp(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}const OE=function(t){function e(e,i,n,r,o,s){t.call(this,e,i,s),this.crossOrigin_=r,this.src_=n,this.image_=new Image,null!==r&&(this.image_.crossOrigin=r),this.imageListenerKeys_=null,this.tileLoadFunction_=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.state==Sx&&(this.unlistenImage_(),this.image_=ME()),this.interimTile&&this.interimTile.dispose(),this.state=Ix,this.changed(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.image_},e.prototype.getKey=function(){return this.src_},e.prototype.handleImageError_=function(){this.state=Tx,this.unlistenImage_(),this.image_=ME(),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=Cx:this.state=Ex,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Tx&&(this.state=xx,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==xx&&(this.state=Sx,this.changed(),this.imageListenerKeys_=[mf(this.image_,Ff,this.handleImageError_,this),mf(this.image_,$f,this.handleImageLoad_,this)],this.tileLoadFunction_(this,this.src_))},e.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(yf),this.imageListenerKeys_=null},e}(FE);function $E(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function DE(t,e,i){return t+"/"+e+"/"+i}function jE(t){return DE(t[0],t[1],t[2])}function NE(t,e){var i=/\{z\}/g,n=/\{x\}/g,r=/\{y\}/g,o=/\{-y\}/g;return function(s,a,l){return s?t.replace(i,s[0].toString()).replace(n,s[1].toString()).replace(r,(function(){return(-s[2]-1).toString()})).replace(o,(function(){var t=s[0],i=e.getFullTileRange(t);return gp(i,55),(i.getHeight()+s[2]).toString()})):void 0}}function BE(t){return 1===t.length?t[0]:function(e,i,n){if(e){var r=Ug(function(t){return(t[1]<0||i&&0===o)}))),17),!t.origins)for(var o=0,s=this.resolutions_.length-1;o=this.minZoom;){if(o=2===this.zoomFactor_?VS(s=Math.floor(s/2),s,a=Math.floor(a/2),a,n):this.getTileRangeForExtentAndZ(l,u,n),e.call(i,u,o))return!0;--u}return!1},WE.prototype.getExtent=function(){return this.extent_},WE.prototype.getMaxZoom=function(){return this.maxZoom},WE.prototype.getMinZoom=function(){return this.minZoom},WE.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},WE.prototype.getResolution=function(t){return this.resolutions_[t]},WE.prototype.getResolutions=function(){return this.resolutions_},WE.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]i||i>e.getMaxZoom())return!1;var o,s=e.getExtent();return!(o=s?e.getTileRangeForExtentAndZ(s,i):e.getFullTileRange(i))||o.containsXY(n,r)}(t,n)?t:null},e.prototype.refresh=function(){this.tileCache.clear(),this.changed()},e.prototype.useTile=function(t,e,i,n){},e}(cy),JE=function(t){function e(e,i){t.call(this,e),this.tile=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ef);const QE="tileloadstart",tI="tileloadend",eI="tileloaderror";function iI(t,e){t.getImage().src=e}const nI=function(t){function e(e){t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:iI,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible}),this.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,this.tileClass=void 0!==e.tileClass?e.tileClass:OE,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);for(var n in this.tileCache.expireCache(this.tileCache==i?e:{}),this.tileCacheForProjection){var r=this.tileCacheForProjection[n];r.expireCache(r==i?e:{})}},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!wm(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!wm(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!wm(e,t)){var i=rf(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=XE(t)),this.tileGridForProjection[i]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||wm(e,t))return this.tileCache;var i=rf(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new VE(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,e,i,n,r,o){var s=[t,e,i],a=this.getTileCoordForTileUrlFunction(s,r),l=a?this.tileUrlFunction(a,n,r):void 0,u=new this.tileClass(s,void 0!==l?xx:Ex,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=o,gf(u,Af,this.handleTileChange,this),u},e.prototype.getTile=function(t,e,i,n,r){var o=this.getProjection();if(o&&r&&!wm(o,r)){var s,a=this.getTileCacheForProjection(r),l=[t,e,i],u=jE(l);a.containsKey(u)&&(s=a.get(u));var h=this.getKey();if(s&&s.key==h)return s;var c=this.getTileGridForProjection(o),d=this.getTileGridForProjection(r),f=this.getTileCoordForTileUrlFunction(l,r),p=new GE(o,c,r,d,l,f,this.getTilePixelRatio(n),this.getGutter(),function(t,e,i,n){return this.getTileInternal(t,e,i,n,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_);return p.key=h,s?(p.interimTile=s,p.refreshInterimChain(),a.replace(u,p)):a.set(u,p),p}return this.getTileInternal(t,e,i,n,o||r)},e.prototype.getTileInternal=function(t,e,i,n,r){var o=null,s=DE(t,e,i),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var l=o;o=this.createTile_(t,e,i,n,r,a),l.getState()==xx?o.interimTile=l.interimTile:o.interimTile=l,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.createTile_(t,e,i,n,r,a),this.tileCache.set(s,o);return o},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var i=vm(t);if(i){var n=rf(i);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}},e}(function(t){function e(e){t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible}),this.generateTileUrlFunction_=!e.tileUrlFunction,this.tileLoadFunction=e.tileLoadFunction,this.tileUrlFunction=e.tileUrlFunction?e.tileUrlFunction.bind(this):UE,this.urls=null,e.urls?this.setUrls(e.urls):e.url&&this.setUrl(e.url),e.tileUrlFunction&&this.setTileUrlFunction(e.tileUrlFunction,this.key_),this.tileLoadingKeys_={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,i=t.target,n=rf(i),r=i.getState();r==Sx?(this.tileLoadingKeys_[n]=!0,e=QE):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=r==Tx?eI:r==Cx||r==Ix?tI:void 0),null!=e&&this.dispatchEvent(new JE(e,i))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=this.urls=zE(t);this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(function(t,e){for(var i=t.length,n=new Array(i),r=0;rh||s>h;)l.push([Math.ceil(o/h),Math.ceil(s/h)]),h+=h;break;case oI:for(var c=o,d=s;c>h||d>h;)l.push([Math.ceil(c/h),Math.ceil(d/h)]),c>>=1,d>>=1;break;default:gp(!1,53)}l.push([1,1]),l.reverse();for(var f=[1],p=[0],g=1,m=l.length;g0?t.animate({resolution:1,duration:this.duration_}):t.setResolution(1))}}])&&dI(e.prototype,i),n&&dI(e,n),o}(Xx);const _I=Sl({mixins:[Iv,Hv,yw,xw,Fw,zC,QC,hE,fE,gE,LE,uI],components:{minimap:VC,labelIndicator:ww,controlButton:Cy},props:{canAdd:{type:Boolean,default:!1},canModify:{type:Boolean,default:!1},canDelete:{type:Boolean,default:!1},image:{type:Object,default:null},annotations:{type:Array,default:function(){return[]}},selectedAnnotations:{type:Array,default:function(){return[]}},center:{type:Array,default:void 0},resolution:{type:Number,default:void 0},selectedLabel:{default:null},lastCreatedAnnotation:{default:null},annotationOpacity:{type:Number,default:1},annotationMode:{type:String,default:"default"},showMinimap:{type:Boolean,default:!0},listenerSet:{type:String,default:"default"}},data:function(){return{initialized:!1,focusOptions:{padding:50,duration:250,resolution:1},interactionMode:"default",mapSize:[0,0],mousePosition:[0,0],modifyInProgress:!1}},computed:{extent:function(){return this.image?[0,0,this.image.width,this.image.height]:[0,0,0,0]},viewExtent:function(){return this.initialized&&this.resolution&&this.map?this.map.getView().calculateExtent(this.mapSize):[0,0,0,0]},projection:function(){return new Yg({code:"biigle-image",units:"pixels",extent:this.extent})},selectedFeatures:function(){return this.selectInteraction?this.selectInteraction.getFeatures():[]},isDefaultInteractionMode:function(){return"default"===this.interactionMode},hasSelectedLabel:function(){return Boolean(this.selectedLabel)},hasSelectedAnnotations:function(){return this.selectedAnnotations.length>0},hasLastCreatedAnnotation:function(){return null!==this.lastCreatedAnnotation},previousButtonTitle:function(){switch(this.annotationMode){case"volare":return"Previous annotation";case"lawnmower":return"Previous image section";case"randomSampling":case"regularSampling":return"Previous sample location";default:return"Previous image"}},nextButtonTitle:function(){switch(this.annotationMode){case"volare":return"Next annotation";case"lawnmower":return"Next image section";case"randomSampling":case"regularSampling":return"Next sample location";default:return"Next image"}}},methods:{createMap:function(){var t=new hI({tipLabel:"Zoom to show whole image",label:""});kl.on("-",t.handleZoomToExtent.bind(t),0,this.listenerSet);var e=new NC({controls:[new Qx,t],interactions:ES({altShiftDragRotate:!1,doubleClickZoom:!1,keyboard:!1,shiftDragZoom:!1,pinchRotate:!1,pinchZoom:!1,mouseWheelZoom:!1})});return e.addInteraction(new SS({condition:function(t){return!e_(t)}})),t=new yI({label:""}),kl.on("+",t.zoomToNative.bind(t),0,this.listenerSet),e.addControl(t),e},declareNonReactiveProperties:function(){this.map=this.createMap(),this.imageLayer=new bw,this.tiledImageLayer=new _E,this.annotationFeatures=new Sy,this.annotationSource=new Gb({features:this.annotationFeatures}),this.annotationLayer=new Ab({source:this.annotationSource,zIndex:100,updateWhileAnimating:!0,updateWhileInteracting:!0,style:gw.features}),this.selectInteraction=new sE({condition:Hy,style:gw.highlight,layers:[this.annotationLayer],multi:!0}),this.canModify&&(this.featureRevisionMap={},this.modifyInteraction=new ZC({features:this.selectInteraction.getFeatures(),deleteCondition:function(t){return e_(t)&&Qy(t)}}))},updateMapSize:function(){this.mapSize=this.map.getSize()},updateMapView:function(t){var e=t.target.getView();this.$emit("moveend",{center:e.getCenter(),resolution:e.getResolution()})},invertPointsYAxis:function(t){for(var e=this.extent[3],i=1;i0&&e.set("color",t.labels[0].label.color),e},handleFeatureModifyStart:function(t){var e=this;this.modifyInProgress=!0,t.features.getArray().forEach((function(t){e.featureRevisionMap[t.getId()]=t.getRevision()}))},handleFeatureModifyEnd:function(t){var e=this;this.modifyInProgress=!1;var i=t.features.getArray().filter((function(t){return e.featureRevisionMap[t.getId()]!==t.getRevision()})).map((function(t){return{id:t.getId(),image_id:t.get("annotation").image_id,points:e.getPoints(t.getGeometry())}}));i.length>0&&this.$emit("update",i)},focusAnnotation:function(t,e,i){var n=this.annotationSource.getFeatureById(t.id);if(n){var r=this.map.getView(),o=e?0:this.focusOptions.duration,s=i?this.resolution:this.focusOptions.resolution,a=n.getGeometry().getExtent().slice();if(a[0]-=this.focusOptions.padding,a[1]-=this.focusOptions.padding,a[2]+=this.focusOptions.padding,a[3]+=this.focusOptions.padding,!i){var l=r.getResolutionForExtent(a);s=l>this.focusOptions.resolution?l:s}r.animate({center:Yp(a),resolution:s,duration:o})}},fitImage:function(){this.map.getView().fit(this.extent,this.map.getSize())},extractAnnotationFromFeature:function(t){return t.get("annotation")},handleFeatureSelect:function(t){this.$emit("select",t.selected.map(this.extractAnnotationFromFeature),t.deselected.map(this.extractAnnotationFromFeature))},handlePrevious:function(){this.modifyInProgress||this.$emit("previous")},conditionalHandleScroll:function(t){e_({originalEvent:t})&&this.handleScroll(t)},handleScroll:function(t){t.preventDefault();var e=t.deltaY||t.deltaX;e<0?this.handleNext():e>0&&this.handlePrevious()},handleNext:function(){this.modifyInProgress||this.$emit("next")},resetInteractionMode:function(){this.interactionMode="default"},getPoints:function(t){var e;switch(t.getType()){case"Circle":e=[t.getCenter(),[t.getRadius()]];break;case"Polygon":case"Rectangle":case"Ellipse":e=t.getCoordinates()[0];break;case"Point":e=[t.getCoordinates()];break;default:e=t.getCoordinates()}return this.convertPointsFromOlToDb(e)},handleNewFeature:function(t){var e=this;if(this.hasSelectedLabel){var i=t.feature.getGeometry();t.feature.set("color",this.selectedLabel.color);this.$emit("new",{shape:i.getType(),points:this.getPoints(i)},(function(){try{e.annotationSource.removeFeature(t.feature)}catch(t){}}))}else this.annotationSource.removeFeature(t.feature)},deleteSelectedAnnotations:function(){!this.modifyInProgress&&this.hasSelectedAnnotations&&confirm("Are you sure you want to delete all selected annotations?")&&this.$emit("delete",this.selectedAnnotations)},deleteLastCreatedAnnotation:function(){this.hasLastCreatedAnnotation&&this.$emit("delete",[this.lastCreatedAnnotation])},createPointAnnotationAt:function(t,e){if(this.hasSelectedLabel){var i=new Ty(new nv([t,e]));this.annotationSource.addFeature(i),this.handleNewFeature({feature:i})}else this.requireSelectedLabel()},requireSelectedLabel:function(){this.$emit("requires-selected-label"),this.resetInteractionMode()},render:function(){this.map&&this.map.render()},handleRegularImage:function(t){t?this.imageLayer.setSource(new yy({canvas:t.canvas,projection:this.projection,canvasExtent:this.extent,canvasSize:[t.width,t.height]})):this.imageLayer.setSource(null)},handleTiledImage:function(t){t?this.tiledImageLayer.setSource(new aI({url:t.url,size:[t.width,t.height],extent:[0,0,t.width,t.height],transition:100})):this.tiledImageLayer.setSource(null)},updateMousePosition:function(t){this.mousePosition=t.coordinate},refreshAnnotationSource:function(t,e){var i={};t.forEach((function(t){i[t.id]=null}));var n={},r=e.getFeatures(),o=r.filter((function(t){return n[t.getId()]=null,!i.hasOwnProperty(t.getId())}));o.length===r.length?e.clear(!0):(o.filter((function(t){return void 0!==t.getId()})).forEach((function(t){e.removeFeature(t)})),t=t.filter((function(t){return!n.hasOwnProperty(t.id)}))),e.addFeatures(t.map(this.createFeature))}},watch:{image:function(t,e){t?!0===t.tiled?(e&&!0===e.tiled||(this.map.removeLayer(this.imageLayer),this.map.addLayer(this.tiledImageLayer)),this.handleTiledImage(t,e)):(e&&!0!==e.tiled||(this.map.removeLayer(this.tiledImageLayer),this.map.addLayer(this.imageLayer)),this.handleRegularImage(t,e)):(this.map.removeLayer(this.tiledImageLayer),this.map.removeLayer(this.imageLayer))},annotations:function(t){this.refreshAnnotationSource(t,this.annotationSource),this.resetHoveredAnnotations()},selectedAnnotations:function(t){var e=this.annotationSource,i=this.selectedFeatures;i.clear(),t.forEach((function(t){i.push(e.getFeatureById(t.id))}))},extent:function(t,e){if(t[2]!==e[2]||t[3]!==e[3]){var i=Yp(t);this.initialized||(i=this.center||i),this.map.setView(new zx({projection:this.projection,center:i,resolution:this.resolution,zoomFactor:2,minResolution:.01,extent:t})),void 0===this.resolution&&this.map.getView().fit(t),this.initialized||(this.updateMapView({target:this.map}),this.initialized=!0)}},annotationOpacity:function(t){this.annotationLayer.setOpacity(t)},isDefaultInteractionMode:function(t){this.selectInteraction.setActive(t||this.isTranslating),this.canModify&&this.modifyInteraction.setActive(t)}},created:function(){var t=this;this.declareNonReactiveProperties(),this.annotationLayer.set("name","annotations"),this.map.addLayer(this.annotationLayer),this.imageLayer.set("name","imageRegular"),this.tiledImageLayer.set("name","imageTile"),Pl.$on("sidebar.toggle",(function(){t.$nextTick((function(){t.map.updateSize()}))})),this.map.on("change:size",this.updateMapSize),this.map.on("moveend",this.updateMapView),this.map.on("pointermove",this.updateMousePosition),this.selectInteraction.on("select",this.handleFeatureSelect),this.map.addInteraction(this.selectInteraction),kl.on(" ",this.handleNext,0,this.listenerSet),kl.on("ArrowRight",this.handleNext,0,this.listenerSet),kl.on("ArrowLeft",this.handlePrevious,0,this.listenerSet),kl.on("Escape",this.resetInteractionMode,0,this.listenerSet),this.canModify&&(this.modifyInteraction.on("modifystart",this.handleFeatureModifyStart),this.modifyInteraction.on("modifyend",this.handleFeatureModifyEnd),this.map.addInteraction(this.modifyInteraction)),this.canDelete&&(kl.on("Delete",this.deleteSelectedAnnotations,0,this.listenerSet),kl.on("Backspace",this.deleteLastCreatedAnnotation,0,this.listenerSet))},mounted:function(){this.map.setTarget(this.$el)}},undefined,undefined,!1,null,null,null).exports;const bI=Sl(new Vue({data:{cache:{}},computed:{shapeMap:function(){return biigle.$require("annotations.shapes")},inverseShapeMap:function(){var t={};for(var e in this.shapeMap)t[this.shapeMap[e]]=parseInt(e,10);return t}},methods:{parseResponse:function(t){return t.data},resolveShape:function(t){return t.shape=this.shapeMap[t.shape_id],t},resolveAllShapes:function(t){return t.forEach(this.resolveShape,this),t},setDeselected:function(t){return t.selected=!1,t},setAllDeselected:function(t){return t.forEach(this.setDeselected),t},fetchAnnotations:function(t){return this.cache.hasOwnProperty(t)||(this.cache[t]=pl.getAnnotations({id:t}).catch((function(){return Vue.Promise.reject("Failed to load annotations for image ".concat(t,"!"))})).then(this.parseResponse).then(this.resolveAllShapes)),this.cache[t].then(this.setAllDeselected)},create:function(t,e){var i=this;return e.shape_id=this.inverseShapeMap[e.shape],delete e.shape,pl.saveAnnotations({id:t},e).then(this.parseResponse).then(this.resolveShape).then(this.setDeselected).then((function(e){return i.cache[t].then((function(t){t.unshift(e)})),e}))},update:function(t){var e=this,i=fl.update({id:t.id},{points:t.points});return i.then((function(){e.cache[t.image_id].then((function(e){for(var i=e.length-1;i>=0;i--)if(e[i].id===t.id)return void(e[i].points=t.points)}))})),i},attachLabel:function(t,e){var i=fl.attachLabel({id:t.id},e);return i.then((function(e){t.labels.unshift(e.data)}),(function(){})),i},detachLabel:function(t,e){var i=fl.detachLabel({annotation_label_id:e.id});return i.then((function(){for(var i=t.labels.length-1;i>=0;i--)if(t.labels[i].id===e.id)return void t.labels.splice(i,1)})),i},delete:function(t){var e=fl.delete({id:t.id}),i=this.cache[t.image_id];return e.then((function(){i.then((function(e){for(var i=e.length-1;i>=0;i--)if(e[i].id===t.id)return void e.splice(i,1)}))})),e}}}),undefined,undefined,!1,null,null,null).exports;var wI=i(789),xI=i.n(wI);function SI(t){return(SI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function CI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function TI(t,e){return!e||"object"!==SI(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function EI(t){var e="function"==typeof Map?new Map:void 0;return(EI=function(t){if(null===t||(i=t,-1===Function.toString.call(i).indexOf("[native code]")))return t;var i;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return II(t,arguments,kI(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),PI(n,t)})(t)}function II(t,e,i){return(II=AI()?Reflect.construct:function(t,e,i){var n=[null];n.push.apply(n,e);var r=new(Function.bind.apply(t,n));return i&&PI(r,i.prototype),r}).apply(null,arguments)}function AI(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function PI(t,e){return(PI=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function kI(t){return(kI=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var RI=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&PI(t,e)}(r,t);var e,i,n=(e=r,i=AI(),function(){var t,n=kI(e);if(i){var r=kI(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return TI(this,t)});function r(){return CI(this,r),n.apply(this,arguments)}return r}(EI(Error));const LI=Sl(new Vue({data:{initialized:!1,cache:{},cachedIds:[],maxCacheSize:200,supportsColorAdjustment:!1,currentlyDrawnImage:null,colorAdjustmentDefaults:{brightnessContrast:[0,0],brightnessRGB:[0,0,0],hueSaturation:[0,0],vibrance:[0],gamma:[1]},colorAdjustment:{brightnessContrast:[0,0],brightnessRGB:[0,0,0],hueSaturation:[0,0],vibrance:[0],gamma:[1]}},computed:{imageFileUri:function(){return biigle.$require("annotations.imageFileUri")},tilesUri:function(){return biigle.$require("annotations.tilesUri")},supportedTextureSize:function(){return this.fxCanvas?this.fxCanvas._.gl.getParameter(this.fxCanvas._.gl.MAX_TEXTURE_SIZE):0},hasColorAdjustment:function(){for(var t in this.colorAdjustment)if(this.colorAdjustment.hasOwnProperty(t)&&this.isAdjustmentActive(t))return!0;return!1}},methods:{initialize:function(){this.initialized=!0,this.drawCanvas=document.createElement("canvas"),this.drawCanvas.style.imageOrientation="none",this.drawCanvas.style.visibility="hidden",this.drawCanvas.style.position="fixed",document.body.appendChild(this.drawCanvas);try{this.fxCanvas=xI().canvas(),this.fxTexture=null,this.loadedImageTexture=null}catch(t){console.warn("WebGL not supported. Color adjustment disabled.")}window.addEventListener("beforeunload",(function(){this.fxTexture&&(this.fxTexture.destroy(),this.fxCanvas.width=1,this.fxCanvas.height=1)}))},isTiledImage:function(t){return!0===t.tiled},isAdjustmentActive:function(t){var e=this;return this.colorAdjustment[t].some((function(i,n){return i!==e.colorAdjustmentDefaults[t][n]}))},checkSupportsColorAdjustment:function(t){if(!this.fxCanvas)return!1;if(this.isTiledImage(t))this.supportsColorAdjustment=!1;else{if(this.currentlyDrawnImage&&this.currentlyDrawnImage.width===t.width&&this.currentlyDrawnImage.height===t.height)return this.supportsColorAdjustment;var e=this.supportedTextureSize;if(e=0;i--)n[e].splice(i,1,t[e][i]);this.hasColorAdjustment?this.drawColorAdjustedImage(this.currentlyDrawnImage):r&&this.drawSimpleImage(this.currentlyDrawnImage)}}},watch:{cachedIds:function(t){if(t.length>this.maxCacheSize){var e=t.shift();delete this.cache[e]}}}}),undefined,undefined,!1,null,null,null).exports;const FI=Sl({props:{annotationFilters:{type:Array,default:function(){return[]}},hasActiveFilter:{type:Boolean,default:!1}},data:function(){return{chosenFilterIndex:null}},computed:{hasFilters:function(){return this.annotationFilters.length>0},chosenFilter:function(){return this.annotationFilters[this.chosenFilterIndex]},clearButtonClass:function(){return{"btn-info":this.hasActiveFilter}}},methods:{emitSelectFilter:function(t){this.$emit("select",t)},emitUnselectFilter:function(){this.$emit("unselect")}},watch:{chosenFilter:function(t,e){e&&(this.$refs.filterElement.removeChild(e.$el),e.$off("select",this.emitSelectFilter),e.$off("unselect",this.emitUnselectFilter)),this.$refs.filterElement.appendChild(t.$el),t.$on("select",this.emitSelectFilter),t.$on("unselect",this.emitUnselectFilter)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("form",{staticClass:"annotations-tab__filter form-inline",on:{submit:function(t){t.preventDefault()}}},[i("select",{directives:[{name:"model",rawName:"v-model",value:t.chosenFilterIndex,expression:"chosenFilterIndex"}],staticClass:"form-control",on:{change:function(e){var i=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.chosenFilterIndex=e.target.multiple?i:i[0]}}},t._l(t.annotationFilters,(function(e,n){return i("option",{domProps:{value:n,textContent:t._s(e.name)}})})),0),t._v(" "),i("span",{directives:[{name:"show",rawName:"v-show",value:t.chosenFilter,expression:"chosenFilter"}],ref:"filterElement"}),t._v(" "),i("input",{directives:[{name:"show",rawName:"v-show",value:!t.chosenFilter,expression:"!chosenFilter"}],staticClass:"form-control",attrs:{placeholder:"Filter annotations",type:"text",disabled:"true"}}),t._v(" "),i("button",{staticClass:"btn btn-default",class:t.clearButtonClass,attrs:{title:"Clear annotation filter",disabled:!t.hasActiveFilter},on:{click:function(e){return e.preventDefault(),t.emitUnselectFilter(e)}}},[i("i",{staticClass:"fa fa-times"})])])}),[],!1,null,null,null).exports;var MI=Sl({props:{annotation:{type:Object,required:!0},annotationLabel:{type:Object,required:!0},canDetach:{type:Boolean,default:!1}},computed:{classObject:function(){return{selected:!1!==this.annotation.selected}},shapeClass:function(){return"icon-"+this.annotation.shape.toLowerCase()},username:function(){return this.annotationLabel.user?this.annotationLabel.user.firstname+" "+this.annotationLabel.user.lastname:"(user deleted)"}},methods:{emitSelect:function(t){this.$emit("select",this.annotation,t.shiftKey)},emitDetach:function(){this.$emit("detach",this.annotation,this.annotationLabel)},emitFocus:function(){this.$emit("focus",this.annotation)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("li",{staticClass:"annotations-tab-item__sub-item",class:t.classObject,attrs:{"data-annotation-id":t.annotation.id},on:{click:t.emitSelect,dblclick:t.emitFocus}},[t.canDetach?i("button",{staticClass:"close",attrs:{type:"button",title:"Detach this label from the annotation"},on:{click:function(e){return e.stopPropagation(),t.emitDetach(e)}}},[i("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])]):t._e(),t._v(" "),i("span",{staticClass:"icon",class:t.shapeClass}),t._v(" "),i("span",{domProps:{textContent:t._s(t.username)}})])}),[],!1,null,null,null);var OI=Sl({components:{annotationItem:MI.exports},props:{label:{type:Object,default:function(){return{}}},annotations:{type:Array,default:function(){return[]}},canDetachOthers:{type:Boolean,default:!1},ownUserId:{type:Number,default:null}},data:function(){return{open:!1}},computed:{title:function(){return"Annotations with label ".concat(this.label.name)},classObject:function(){return{selected:this.isSelected}},count:function(){return this.annotationItems.length},countTitle:function(){return"There are ".concat(this.count," annotations with label ").concat(this.label.name)},colorStyle:function(){return"background-color: #"+this.label.color},isSelected:function(){return this.open||this.annotations.reduce((function(t,e){return t||!1!==e.selected}),!1)},annotationItems:function(){var t=this,e=[];return this.annotations.forEach((function(i){i.labels.forEach((function(n){n.label_id===t.label.id&&e.push({annotation:i,annotationLabel:n,canDetach:t.canDetachAnnotationLabel(n)})}))})),e}},methods:{toggleOpen:function(){this.open=!this.open},emitSelect:function(t,e){this.$emit("select",t,e)},emitDetach:function(t,e){this.$emit("detach",t,e)},emitFocus:function(t){this.$emit("focus",t)},canDetachAnnotationLabel:function(t){return this.canDetachOthers||this.ownUserId===t.user_id}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("li",{staticClass:"annotations-tab-item",class:t.classObject,attrs:{title:t.title}},[i("div",{staticClass:"annotations-tab-item__title",on:{click:t.toggleOpen}},[i("span",{staticClass:"pull-right badge",attrs:{title:t.countTitle},domProps:{textContent:t._s(t.count)}}),t._v(" "),i("span",{staticClass:"annotations-tab-item__color",style:t.colorStyle}),t._v(" "),i("span",{domProps:{textContent:t._s(t.label.name)}})]),t._v(" "),i("ul",{directives:[{name:"show",rawName:"v-show",value:t.isSelected,expression:"isSelected"}],staticClass:"annotations-tab-item__list list-unstyled"},t._l(t.annotationItems,(function(e){return i("annotation-item",{key:e.annotationLabel.id,attrs:{annotation:e.annotation,"annotation-label":e.annotationLabel,"can-detach":e.canDetach},on:{select:t.emitSelect,detach:t.emitDetach,focus:t.emitFocus}})})),1)])}),[],!1,null,null,null);const $I=Sl({components:{filters:FI,labelItem:OI.exports},props:{hasActiveFilter:{type:Boolean,default:!1},annotations:{type:Array,default:function(){return[]}},annotationFilters:{type:Array,default:function(){return[]}},canDetachOthers:{type:Boolean,default:!1},ownUserId:{type:Number,default:null},selectedAnnotations:{type:Array,default:function(){return[]}}},computed:{labelItems:function(){var t={},e={},i={};return this.annotations.forEach((function(n){n.labels.forEach((function(r){t.hasOwnProperty(r.label.id)||(t[r.label_id]=r.label,e[r.label_id]=[]);var o=n.id+"-"+r.label_id;i.hasOwnProperty(o)||(i[o]=null,e[r.label_id].push(n))}))})),Object.values(t).sort((function(t,e){return t.name.toLowerCase()>e.name.toLowerCase()?1:-1})).map((function(t){return{id:t.id,label:t,annotations:e[t.id]}}))}},methods:{handleSelect:function(t,e){!1!==t.selected&&e?this.$emit("deselect",t):this.$emit("select",t,e)},emitDetach:function(t,e){this.$emit("detach",t,e)},emitSelectFilter:function(t){this.$emit("select-filter",t)},emitUnselectFilter:function(){this.$emit("unselect-filter")},emitFocus:function(t){this.$emit("focus",t)},scrollIntoView:function(t){var e,i=this.$refs.scrollList,n=i.scrollTop,r=i.offsetHeight,o=1/0,s=0;t.forEach((function(t){for(var n=i.querySelectorAll('[data-annotation-id="'.concat(t.id,'"]')),r=n.length-1;r>=0;r--)e=n[r],o=Math.min(e.offsetTop,o),s=Math.max(e.offsetTop+e.offsetHeight,s)})),n>o?i.scrollTop=o:n+r=s-o?s-i.offsetHeight:o)}},watch:{selectedAnnotations:function(t){t.length>0&&this.$nextTick((function(){this.scrollIntoView(t)}))}}},undefined,undefined,!1,null,null,null).exports;var DI={};const jI=Sl({mixins:[$I],computed:{plugins:function(){return DI}}},undefined,undefined,!1,null,null,null).exports;var NI={};const BI=Sl({components:{labelTrees:Qh},data:function(){return{labelTrees:[],selectedLabel:null}},computed:{plugins:function(){return NI}},methods:{handleSelectedLabel:function(t){this.selectedLabel=t,this.$emit("select",t)},handleDeselectedLabel:function(){this.selectedLabel=null,this.$emit("select",null)}},created:function(){this.labelTrees=biigle.$require("annotations.labelTrees")}},undefined,undefined,!1,null,null,null).exports;const UI=Sl({data:function(){return{filenames:{},currentId:null}},computed:{filename:function(){if(this.currentId){var t=this.filenames[this.currentId].split(".");return t.length>1&&(t[t.length-1]="png"),"biigle_screenshot_"+(t=t.join(".").toLowerCase())}return"biigle_screenshot.png"}},methods:{trimCanvas:function(t){var e,i,n,r=t.getContext("2d"),o=document.createElement("canvas").getContext("2d"),s=r.getImageData(0,0,t.width,t.height),a=s.data.length,l={top:null,left:null,right:null,bottom:null};for(e=0;e0?this.annotationOpacity=0:this.annotationOpacity=1}},watch:{annotationOpacity:function(t){t=parseFloat(t),this.$emit("change","annotationOpacity",t),this.settings.set("annotationOpacity",t)},cachedImagesCount:function(t){t=parseFloat(t),this.$emit("change","cachedImagesCount",t),this.settings.set("cachedImagesCount",t)},mousePosition:function(t){this.$emit("change","mousePosition",t),this.settings.set("mousePosition",t)},zoomLevel:function(t){this.$emit("change","zoomLevel",t),this.settings.set("zoomLevel",t)},scaleLine:function(t){this.$emit("change","scaleLine",t),this.settings.set("scaleLine",t)},labelTooltip:function(t){this.$emit("change","labelTooltip",t),this.settings.set("labelTooltip",t)},measureTooltip:function(t){this.$emit("change","measureTooltip",t),this.settings.set("measureTooltip",t)},minimap:function(t){this.$emit("change","minimap",t),this.settings.set("minimap",t)},progressIndicator:function(t){this.$emit("change","progressIndicator",t),this.settings.set("progressIndicator",t)}},created:function(){var t=this;this.restoreKeys.forEach((function(e){t[e]=t.settings.get(e)})),kl.on("o",this.toggleAnnotationOpacity)}},undefined,undefined,!1,null,null,null).exports;biigle.$declare("annotations.components.annotationCanvas",_I),biigle.$declare("annotations.components.annotationsTabPlugins",DI),biigle.$declare("annotations.components.labelsTabPlugins",NI),biigle.$declare("annotations.components.settingsTabPlugins",GI),biigle.$declare("annotations.ol.AttachLabelInteraction",Kv),biigle.$declare("annotations.stores.annotations",bI),biigle.$declare("annotations.stores.images",LI),biigle.$declare("annotations.stores.styles",gw);i(576);const WI=Sl({components:{powerToggle:Il},data:function(){return{mode:"default",modes:["default","volare","lawnmower","randomSampling","regularSampling"],restoreKeys:["randomSamplingNumber","regularSamplingRows","regularSamplingColumns"],randomSamplingNumber:9,regularSamplingRows:3,regularSamplingColumns:3}},computed:{isVolareActive:function(){return"volare"===this.mode},isLawnmowerActive:function(){return"lawnmower"===this.mode},isRandomSamplingActive:function(){return"randomSampling"===this.mode},isRegularSamplingActive:function(){return"regularSampling"===this.mode}},methods:{startVolare:function(){this.setMode("volare")},startLawnmower:function(){this.setMode("lawnmower")},startRandomSampling:function(){this.setMode("randomSampling")},startRegularSampling:function(){this.setMode("regularSampling")},setMode:function(t){-1!==this.modes.indexOf(t)&&(this.mode=t)},resetMode:function(){this.mode="default"},emitAttachLabel:function(){this.$emit("attach-label")},emitCreateSample:function(){this.$emit("create-sample")}},watch:{mode:function(t,e){switch(e){case"volare":kl.off("Enter",this.emitAttachLabel);break;case"randomSampling":case"regularSampling":kl.off("Enter",this.emitCreateSample)}switch(t){case"volare":kl.on("Enter",this.emitAttachLabel);break;case"randomSampling":case"regularSampling":kl.on("Enter",this.emitCreateSample)}switch(t){case"randomSampling":this.$emit("change",t,this.randomSamplingNumber);break;case"regularSampling":this.$emit("change",t,[this.regularSamplingRows,this.regularSamplingColumns]);break;default:this.$emit("change",t)}},randomSamplingNumber:function(t){VI.set("randomSamplingNumber",t)},regularSamplingRows:function(t){VI.set("regularSamplingRows",t)},regularSamplingColumns:function(t){VI.set("regularSamplingColumns",t)}},created:function(){var t=this;this.restoreKeys.forEach((function(e){return t[e]=VI.get(e)}));var e=tu.get("annotationMode");e&&Pl.$once("images.change",(function(){return t.setMode(e)}))}},undefined,undefined,!1,null,null,null).exports;const KI=Sl({data:function(){return{isBrightnessRgbActive:!1,colorAdjustmentDefaults:{brightnessContrast:[0,0],brightnessRGB:[0,0,0],hueSaturation:[0,0],vibrance:[0],gamma:[1]},colorAdjustment:{brightnessContrast:[0,0],brightnessRGB:[0,0,0],hueSaturation:[0,0],vibrance:[0],gamma:[1]}}},methods:{resetType:function(t,e){void 0!==e?this.colorAdjustment[t].splice(e,1,this.colorAdjustmentDefaults[t][e]):this.colorAdjustment[t]=this.colorAdjustmentDefaults[t].slice()},reset:function(){for(var t in this.colorAdjustment)this.colorAdjustment.hasOwnProperty(t)&&this.resetType(t)},toggleBrightnessRgb:function(){this.isBrightnessRgbActive?this.resetType("brightnessRGB"):this.resetType("brightnessContrast",0),this.isBrightnessRgbActive=!this.isBrightnessRgbActive}},watch:{colorAdjustment:{handler:function(){this.$emit("change",this.colorAdjustment)},deep:!0}}},undefined,undefined,!1,null,null,null).exports;const XI=Sl({mixins:[uu],components:{fileLabelList:qd},props:{fileId:{required:!0,type:Number},selectedLabel:{type:Object,default:null},type:{type:String,default:"image"}},data:function(){return{cache:{},open:!1,currentLabels:[],saving:!1,userId:null,isAdmin:!1}},computed:{hasLabels:function(){return this.currentLabels.length>0},hasSelectedLabel:function(){return null!==this.selectedLabel},canAttachSelectedLabel:function(){if(this.hasSelectedLabel){for(var t=this.currentLabels.length-1;t>=0;t--)if(this.currentLabels[t].label.id===this.selectedLabel.id)return!1;return!this.saving}return!1},proposedLabelTitle:function(){return this.hasSelectedLabel?this.canAttachSelectedLabel?"Attach '".concat(this.selectedLabel.name,"' as new ").concat(this.type," label"):"The selected label is already attached.":"Please select a label first."}},methods:{startSaving:function(){this.saving=!0},finishSaving:function(){this.saving=!1},showFileLabels:function(t){this.cache.hasOwnProperty(t)||(this.startLoading(),this.currentLabels=[],"image"===this.type?this.cache[t]=zd.query({image_id:t}):this.cache[t]=Vd.query({video_id:t}),this.cache[t].finally(this.finishLoading)),this.cache[t].then(this.updateCurrentLabels,su)},updateCurrentLabels:function(t){this.currentLabels=t.body},handleDeletedLabel:function(t){for(var e=this.currentLabels.length-1;e>=0;e--)if(this.currentLabels[e].id===t.id){this.currentLabels.splice(e,1);break}},attachSelectedLabel:function(){var t=this;this.startSaving(),("image"===this.type?zd.save({image_id:this.fileId},{label_id:this.selectedLabel.id}):Vd.save({video_id:this.fileId},{label_id:this.selectedLabel.id})).then((function(e){return t.currentLabels.push(e.data)}),su).finally(this.finishSaving)},attachSelectedLabelIfPossible:function(){if(this.canAttachSelectedLabel)return this.attachSelectedLabel(),!1}},watch:{fileId:function(t){this.open&&this.showFileLabels(t)},open:function(t){t?(this.showFileLabels(this.fileId),kl.on("Enter",this.attachSelectedLabelIfPossible)):kl.off("Enter",this.attachSelectedLabelIfPossible)}},created:function(){var t=this;this.$parent.$watch("open",(function(e){return t.open=e}))}},undefined,undefined,!1,null,null,null).exports;const YI=Sl({mixins:[XI],created:function(){this.userId=biigle.$require("annotations.userId"),this.isAdmin=biigle.$require("annotations.isAdmin")}},undefined,undefined,!1,null,null,null).exports;const HI=Sl({components:{typeahead:Zl},data:function(){return{name:"",placeholder:"",selectedItem:null}},computed:{items:function(){return[]},selectedItemName:function(){return this.selectedItem?this.selectedItem.name:""}},methods:{select:function(t){this.selectedItem=t},filter:function(t){return t},reset:function(){this.selectedItem=null}},watch:{selectedItem:function(t){t?this.$emit("select",this):this.$emit("unselect")}},created:function(){this.$mount()}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("typeahead",{attrs:{items:t.items,placeholder:t.placeholder,value:t.selectedItemName},on:{select:t.select}})}),[],!1,null,null,null).exports;const ZI=Sl(Vue.extend({mixins:[HI],components:{typeahead:Jh},data:function(){return{name:"label",annotations:[],placeholder:"label name"}},computed:{items:function(){var t={};return this.annotations.forEach((function(e){e.labels.forEach((function(e){t[e.label.id]=e.label}))})),Object.values(t)}},methods:{filter:function(t){if(!this.selectedItem)return t;var e=this.selectedItem.id;return t.filter((function(t){return t.labels.reduce((function(t,i){return t||i.label.id===e}),!1)}))}}}),undefined,undefined,!1,null,null,null).exports;const JI=Sl(Vue.extend({mixins:[HI],data:function(){return{name:"session",sessions:[],placeholder:"session name"}},computed:{items:function(){return this.sessions.map((function(t){return t.starts_at=new Date(t.starts_at),t.ends_at=new Date(t.ends_at),t}))}},methods:{filter:function(t){if(!this.selectedItem)return t;var e=this.selectedItem,i={};return e.users.forEach((function(t){i[t.id]=null})),t.filter((function(t){for(var n=t.labels.length-1;n>=0;n--)if(i.hasOwnProperty(t.labels[n].user_id)){var r=new Date(t.created_at);return r>=e.starts_at&&r0)return void this.focussedAnnotationIndex--;this.focussedAnnotationIndex===-1/0?this.focussedAnnotationIndex=Math.max(this.filteredAnnotations.length-2,0):this.focussedAnnotationIndex=1/0}else if(this.isLawnmowerAnnotationMode){if(this.$refs.canvas.showPreviousImageSection())return;this.annotationModeCarry=1/0}else if(this.isSamplingAnnotationMode){if(this.$refs.canvas.showPreviousSamplingLocation())return;this.annotationModeCarry=1/0}this.imageIndex=this.getPreviousIndex(this.imageIndex)}},maybeUpdateFocussedAnnotation:function(){this.isVolareAnnotationMode?this.filteredAnnotations.length>0?this.focussedAnnotationIndex===1/0?this.focussedAnnotationIndex=this.filteredAnnotations.length-1:this.focussedAnnotationIndex=0:(this.focussedAnnotationIndex=null,this.$refs.canvas.fitImage()):this.focussedAnnotationIndex=null},maybeUpdateShownImageSection:function(){this.isLawnmowerAnnotationMode&&(this.annotationModeCarry===1/0?this.$refs.canvas.showLastImageSection():this.$refs.canvas.showFirstImageSection())},maybeUpdateShownSampling:function(t){this.isSamplingAnnotationMode&&(this.$refs.canvas.setSamplingData(this.annotationMode,t),this.annotationModeCarry===1/0?this.$nextTick(this.$refs.canvas.showLastSamplingLocation):this.$nextTick(this.$refs.canvas.showFirstSamplingLocation))},maybeUpdateAnnotationMode:function(t){this.maybeUpdateFocussedAnnotation(),this.maybeUpdateShownImageSection(),this.maybeUpdateShownSampling(t)},handleMapMoveend:function(t){this.mapCenter=t.center,this.mapResolution=t.resolution,tu.set({r:Math.round(100*t.resolution),x:Math.round(t.center[0]),y:Math.round(t.center[1])})},handleSelectAnnotation:function(t,e){!0===e||"object"===iA(e)&&e.shiftKey?t.selected=!0:this.annotations.forEach((function(e){e.selected=t.id===e.id}))},handleSelectAnnotations:function(t,e){t.forEach((function(t){t.selected=!0})),e.forEach((function(t){t.selected=!1}))},handleDeselectAnnotation:function(t){t?t.selected=!1:this.annotations.forEach((function(t){t.selected=!1}))},focusAnnotation:function(t,e,i){this.$refs.canvas.focusAnnotation(t,e,i)},handleDetachAnnotationLabel:function(t,e){this.isEditor&&(t.labels.length>1?bI.detachLabel(t,e).catch(su):confirm("Detaching the last label of an annotation deletes the whole annotation. Do you want to delete the annotation?")&&this.handleDeleteAnnotation(t))},handleDeleteAnnotation:function(t){this.isEditor&&(this.lastCreatedAnnotation&&this.lastCreatedAnnotation.id===t.id&&(this.lastCreatedAnnotation=null),Vue.set(t,"markedForDeletion",!0),bI.delete(t).catch((function(e){t.markedForDeletion=!1,su(e)})))},handleDeleteAnnotations:function(t){t.forEach(this.handleDeleteAnnotation)},handleUpdateAnnotations:function(t){this.isEditor&&Vue.Promise.all(t.map(bI.update)).catch(su)},selectAndFocusAnnotation:function(t,e){this.selectedAnnotations.forEach((function(t){t.selected=!1})),t.selected=!0,this.focusAnnotation(t,!0,e)},handleFilter:function(t){this.annotationFilter=t},resetFilter:function(){this.annotationFilter&&this.annotationFilter.reset(),this.annotationFilter=null},handleSelectedLabel:function(t){this.selectedLabel=t},handleNewAnnotation:function(t,e){this.isEditor&&(t.label_id=this.selectedLabel.id,t.confidence=1,bI.create(this.imageId,t).then(this.setLastCreatedAnnotation).catch(su).finally(e))},handleAttachLabel:function(t,e){if(e=e||this.selectedLabel,this.isEditor&&e){var i={label_id:e.id,confidence:1},n=bI.attachLabel(t,i);return n.catch(su),n}return Vue.Promise.reject()},handleSwapLabel:function(t,e){var i=this;if(e=e||this.selectedLabel,this.isEditor&&e){var n=t.labels.filter((function(t){return t.user_id===i.userId})).sort((function(t,e){return t.id-e.id})).pop();this.handleAttachLabel(t,e).then((function(){n&&i.handleDetachAnnotationLabel(t,n)})).catch(su)}},handleAttachAllSelected:function(){this.selectedAnnotations.forEach(this.handleAttachLabel)},emitImageChanged:function(){Pl.$emit("images.change",this.imageId,this.image)},cachePreviousAndNext:function(){for(var t=[],e=[this.imageId],i=Math.min(this.cachedImagesCount,this.imagesIds.length),n=1;n<=i;n++){var r=this.imagesIds[this.getNextIndex(this.imageIndex+n)];e.includes(r)||(t.push(bI.fetchAnnotations(r)),t.push(LI.fetchImage(r)),e.push(r));var o=this.imagesIds[this.getPreviousIndex(this.imageIndex-n)];e.includes(o)||(t.push(bI.fetchAnnotations(o)),t.push(LI.fetchImage(o)),e.push(o))}Vue.Promise.all(t).catch((function(){}))},setLastCreatedAnnotation:function(t){var e=this;this.lastCreatedAnnotationTimeout&&window.clearTimeout(this.lastCreatedAnnotationTimeout),this.lastCreatedAnnotation=t,this.lastCreatedAnnotationTimeout=window.setTimeout((function(){e.lastCreatedAnnotation=null}),1e4)},updateColorAdjustment:function(t){var e=this.$refs.canvas;Ql((function(){LI.updateColorAdjustment(t),e.render()}),100,"annotations.color-adjustment.update")},handleSettingsChange:function(t,e){switch(t){case"annotationOpacity":this.annotationOpacity=e;break;case"cachedImagesCount":this.cachedImagesCount=e;break;case"mousePosition":this.showMousePosition=e;break;case"zoomLevel":this.showZoomLevel=e;break;case"scaleLine":this.showScaleLine=e;break;case"labelTooltip":this.showLabelTooltip=e;break;case"measureTooltip":this.showMeasureTooltip=e;break;case"minimap":this.showMinimap=e}},handleAnnotationModeChange:function(t,e){this.annotationMode=t,this.annotationModeCarry=null,this.maybeUpdateAnnotationMode(e)},handleOpenedTab:function(t){VI.set("openTab",t)},handleClosedTab:function(){VI.delete("openTab")},handleLoadingError:function(t){t instanceof RI?this.crossOriginError=!0:au.danger(t)},createSampledAnnotation:function(){this.$refs.canvas.createSampledAnnotation()},fetchImagesArea:function(){this.imagesArea||(this.imagesArea={},eA.get({id:this.volumeId}).then(this.setImagesArea,su))},setImagesArea:function(t){this.imagesArea=t.body},handleRequiresSelectedLabel:function(){au.info("Please select a label first."),this.$refs.sidebar.$emit("open","labels")},maybeShowTilingInProgressMessage:function(){this.image.tilingInProgress&&au.warning("This image is currently being processed. Please retry later.")}},watch:{imageId:function(t){t&&(this.startLoading(),this.crossOriginError=!1,Vue.Promise.all(this.getImageAndAnnotationsPromises(t)).then(this.setCurrentImageAndAnnotations).then(this.updateUrlSlug).then(this.maybeUpdateAnnotationMode).then(this.emitImageChanged).then(this.maybeShowTilingInProgressMessage).then(this.cachePreviousAndNext).catch(this.handleLoadingError).finally(this.finishLoading))},cachedImagesCount:function(){Ql(this.cachePreviousAndNext,1e3,"annotations.cached-image-count.update")},focussedAnnotation:function(t){t&&this.selectAndFocusAnnotation(t,this.userUpdatedVolareResolution)},annotationFilter:function(){this.maybeUpdateFocussedAnnotation()},showScaleLine:function(t){t&&this.fetchImagesArea()},showMeasureTooltip:function(t){t&&this.fetchImagesArea()},isVolareAnnotationMode:function(t){t||(this.userUpdatedVolareResolution=!1)},mapResolution:function(){this.isVolareAnnotationMode&&(this.userUpdatedVolareResolution=!0)},annotations:function(t){this.annotationFilters[0].annotations=t,this.annotationFilters[1].annotations=t}},created:function(){var t=this;if(this.allImagesIds=biigle.$require("annotations.imagesIds"),this.volumeId=biigle.$require("annotations.volumeId"),this.isEditor=biigle.$require("annotations.isEditor"),this.userId=biigle.$require("annotations.userId"),this.annotationFilters=[new ZI,new tA,new QI({data:{shapes:biigle.$require("annotations.shapes")}}),new JI({data:{sessions:biigle.$require("annotations.sessions")}})],0!==this.imagesIds.length){var e=this.imagesIds.indexOf(biigle.$require("annotations.imageId"));if(-1===e&&(e=0,au.info("The requested image does not exist in your current volume filtering. Switching to the first image.")),this.imageIndex=e,void 0!==tu.get("r")&&(this.mapResolution=parseInt(tu.get("r"),10)/100),void 0!==tu.get("x")&&void 0!==tu.get("y")&&(this.mapCenter=[parseInt(tu.get("x"),10),parseInt(tu.get("y"),10)]),Pl.$on("annotations.select",this.handleSelectAnnotation),Pl.$on("annotations.deselect",this.handleDeselectAnnotation),Pl.$on("annotations.detachLabel",this.handleDetachAnnotationLabel),Pl.$on("annotations.delete",this.handleDeleteAnnotation),Pl.$on("annotations.focus",this.focusAnnotation),tu.get("annotation")){var i=parseInt(tu.get("annotation"));Pl.$once("images.change",(function(){for(var e=t.annotations,n=e.length-1;n>=0;n--)if(e[n].id===i)return void t.selectAndFocusAnnotation(e[n])}))}if(VI.has("openTab")){var n=VI.get("openTab");"color-adjustment"===n?Pl.$once("images.change",(function(){t.supportsColorAdjustment&&(t.openTab=n)})):this.openTab=n}}else au.info("Your current volume filtering contains no images.")},mounted:function(){Pl.$emit("annotations.map.init",this.$refs.canvas.map)}},undefined,undefined,!1,null,null,null).exports;var rA=function(t){return[Math.cos(2*Math.PI*t)+1,Math.sin(2*Math.PI*t)+1]};const oA=Sl({props:{fileIds:{type:Array,default:function(){return[]}},filenames:{type:Object,default:function(){return{}}},showIndicator:{type:Boolean,default:!0},currentFileId:{type:Number,required:!0},type:{type:String,required:!0}},data:function(){return{fileIdsLeft:[]}},computed:{progressPath:function(){return"M 2 1 A 1 1 0 "+(this.progress>=.5?1:0)+" 1 "+rA(this.progress).join(" ")+"L 1 1"},initialProgressPath:function(){return"M 1 1 L "+rA(this.initialProgress).join(" ")},progressTitle:function(){var t=["started at ".concat(this.initialFileNumber)];return this.hasSeenAllFiles&&t.push("seen all"),"".concat(ru(this.type)," ").concat(this.currentFileNumber," of ").concat(this.fileIds.length," (").concat(t.join(", "),")")},currentFileNumber:function(){return this.currentFileId?this.fileIds.indexOf(this.currentFileId)+1:0},progress:function(){return this.currentFileNumber/this.fileIds.length},initialProgress:function(){return this.initialFileNumber/this.fileIds.length},hasSeenAllFiles:function(){return 0===this.fileIdsLeft.length},showInitialProgressMarker:function(){return 1!==this.initialFileNumber},indicatorClass:function(){return this.hasSeenAllFiles?"progress-indicator--all":""},filenameClass:function(){return this.hasSeenAllFiles?"text-success":""},filenameTitle:function(){return this.hasSeenAllFiles?"You have seen all ".concat(this.type,"s"):""},currentFilename:function(){return this.filenames[this.currentFileId]}},watch:{currentFileId:function(t){this.fileIdsLeft=this.fileIdsLeft.filter((function(e){return e!==t}))}},created:function(){var t=this;this.initialFileNumber=this.fileIds.indexOf(this.currentFileId)+1,this.fileIdsLeft=this.fileIds.filter((function(e){return e!==t.currentFileId}))}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("span",[t.showIndicator?i("span",{staticClass:"progress-indicator-container",attrs:{title:t.progressTitle}},[i("svg",{staticClass:"progress-indicator",class:t.indicatorClass,attrs:{viewBox:"-0.2 -0.2 2.4 2.4"}},[i("circle",{staticClass:"progress-indicator__background",attrs:{cx:"1",cy:"1",r:"1"}}),t._v(" "),i("g",{staticClass:"progress-indicator__progress"},[1==t.progress?i("circle",{attrs:{cx:"1",cy:"1",r:"1"}}):i("path",{attrs:{d:t.progressPath}})]),t._v(" "),t.showInitialProgressMarker?i("path",{staticClass:"progress-indicator__marker",attrs:{d:t.initialProgressPath}}):t._e()])]):t._e(),t._v(" "),i("strong",{class:t.filenameClass,attrs:{title:t.filenameTitle},domProps:{textContent:t._s(t.currentFilename)}})])}),[],!1,null,null,null).exports;const sA=Sl({components:{breadcrumb:oA},data:function(){return{volumeId:null,allIds:[],filenames:{},showIndicator:!0,currentId:null}},computed:{currentFilename:function(){return this.filenames[this.currentId]},ids:function(){var t=this.allIds.slice(),e=window.localStorage.getItem("biigle.volumes.".concat(this.volumeId,".files"));if(e){var i={};return t.forEach((function(t){i[t]=null})),JSON.parse(e).filter((function(t){return i.hasOwnProperty(t)}))}return t}},methods:{updateShowIndicator:function(t){this.showIndicator=!1!==t},updateCurrentId:function(t){this.currentId=t}},watch:{currentFilename:function(t){document.title="Annotate ".concat(t," - BIIGLE")}},created:function(){var t=this;this.allIds=biigle.$require("annotations.imagesIds"),this.volumeId=biigle.$require("annotations.volumeId");var e={};biigle.$require("annotations.imagesFilenames").forEach((function(i,n){e[t.allIds[n]]=i})),this.filenames=e,this.currentId=biigle.$require("annotations.imageId"),Pl.$on("images.change",this.updateCurrentId),this.updateShowIndicator(VI.get("progressIndicator")),VI.watch("progressIndicator",this.updateShowIndicator)}},undefined,undefined,!1,null,null,null).exports;biigle.$mount("annotator-container",nA),biigle.$mount("annotations-navbar",sA);i(276);var aA={annotationOpacity:1,showMinimap:!0,autoplayDraw:0,showLabelTooltip:!1,showMousePosition:!1,showProgressIndicator:!0};const lA=new hu({data:{urlParams:Object.keys(aA),storageKey:"biigle.videos.settings",defaults:aA}});const uA=Sl({components:{breadcrumb:oA},data:function(){return{ids:[],volumeId:null,filenames:{},showIndicator:!0,currentId:null}},computed:{currentFilename:function(){return this.filenames[this.currentId]}},methods:{updateShowIndicator:function(t){this.showIndicator=!1!==t},updateCurrentId:function(t){this.currentId=t},initVideoIds:function(t){var e=window.localStorage.getItem("biigle.volumes.".concat(this.volumeId,".files"));if(e){var i={};return t.forEach((function(t){i[t]=null})),JSON.parse(e).filter((function(t){return i.hasOwnProperty(t)}))}return t}},watch:{currentFilename:function(t){document.title="Annotate ".concat(t," - BIIGLE")}},created:function(){this.volumeId=biigle.$require("videos.volumeId");var t=biigle.$require("videos.videoIds");this.ids=this.initVideoIds(t);var e={};biigle.$require("videos.videoFilenames").forEach((function(i,n){e[t[n]]=i})),this.filenames=e,this.currentId=biigle.$require("videos.id"),this.updateShowIndicator(lA.get("showProgressIndicator")),lA.watch("showProgressIndicator",this.updateShowIndicator),Pl.$on("video.id",this.updateCurrentId)}},undefined,undefined,!1,null,null,null).exports;const hA=Sl({components:{previewThumbnail:Cc}},undefined,undefined,!1,null,null,null).exports,cA=Vue.resource("api/v1/video-annotations{/id}",{},{query:{method:"GET",url:"api/v1/videos{/id}/annotations"},save:{method:"POST",url:"api/v1/videos{/id}/annotations"},split:{method:"POST",url:"api/v1/video-annotations{/id}/split"},link:{method:"POST",url:"api/v1/video-annotations{/id}/link"},attachLabel:{method:"POST",url:"api/v1/video-annotations{/id}/labels"},detachLabel:{method:"DELETE",url:"api/v1/video-annotation-labels{/id}"}}),dA=void 0,fA=" ",pA="fill";function gA(t){return"string"==typeof t}const mA=Math,vA=mA.abs,yA=mA.min,_A=mA.max,bA=mA.floor,wA=mA.round,xA=mA.sqrt,SA=mA.pow,CA=mA.cos,TA=mA.asin,EA=mA.sin,IA=mA.tan,AA=mA.PI,PA=2/3,kA=SA(2,-52);function RA(){throw new Error(Array.prototype.join.call(arguments,fA))}function LA(t,e){for(let i in e)t.hasOwnProperty(i)||(t[i]=e[i]);return t}var FA="undefined"!=typeof window&&window.navigator.userAgent;const MA=/(MSIE |Trident\/|Edge\/)/i.test(FA)?Array:Float32Array;function OA(t){return new MA(t)}function $A(t,e,i){const n=t.length,r=e.length;if(nt.toFixed(e.precision):wA;return t=>{const e=i*t,o=yA(bA(e),i-1);return function(t,e){if(gA(t))return t;let i=[];for(let n=0;n{if(vA(i-0)1&&(y=xA(y),i*=y,n*=y);const _=(o===s?-1:1)*xA(vA((i*i*n*n-i*i*v*v-n*n*m*m)/(i*i*v*v+n*n*m*m)));c=_*i*v/n+(t+a)/2,u=TA((e-(d=_*-n*m/i+(e+l)/2))/n),h=TA((l-d)/n),th&&(u-=HA),!s&&h>u&&(h-=HA)}let v;if(vA(h-u)>YA){const t=h,e=a,o=l;v=ZA(a=c+i*CA(h=u+YA*(s&&h>u?1:-1)),l=d+n*EA(h),i,n,r,0,s,e,o,h,t,c,d)}else v=[];const y=4/3*IA((h-u)/4);if(v.splice(0,0,2*t-(t+y*i*EA(u)),2*e-(e-y*n*CA(u)),a+y*i*EA(h),l-y*n*CA(h),a,l),!m)for(let t=0,e=v.length;t1},wholeFrame:function(){return"WholeFrame"===this.shape}},methods:{startPollTracking:function(){this.tracking=!0,this.continuePollTracking()},pollTracking:function(){cA.get({id:this.id}).then(this.maybeFinishPollTracking,this.cancelPollTracking)},maybeFinishPollTracking:function(t){var e=t.body;e.frames.length>1?(this.tracking=!1,this.frames=e.frames,this.points=e.points):this.continuePollTracking()},continuePollTracking:function(){this.pollTimeout=window.setTimeout(this.pollTracking,5e3)},cancelPollTracking:function(){au.danger("Tracking of annotation ".concat(this.id," failed.")),this.tracking=!1,this.$emit("tracking-failed",this)},interpolatePoints:function(t){if(tthis.endFrame)return[];if(this.hasGapAt(t))return[];for(var e=this.frames,i=e.length-1;i>=0&&!(e[i]<=t&&null!==e[i]);i--);if(e[i]===t)return this.points[i];var n=(t-e[i])/(e[i+1]-e[i]);return this.interpolateBetweenFrames(i,i+1,n)},interpolateBetweenFrames:function(t,e,i){var n=this.interpolationPoints[t],r=this.interpolationPoints[e];switch(this.shape){case"Rectangle":case"Ellipse":return this.interpolationPointsToRectangle(this.interpolateNaive(n,r,i));case"LineString":case"Polygon":return this.interpolatePolymorph(n,r,i);default:return this.interpolateNaive(n,r,i)}},interpolateNaive:function(t,e,i){return t.map((function(t,n){return t+(e[n]-t)*i}))},interpolatePolymorph:function(t,e,i){return function(t,e){return qA(t.map(aP),e||{})}([t,e])(i).replace(/[MCL\s]+/g," ").trim().split(" ").map((function(t){return parseInt(t,10)}))},rectangleToInterpolationPoints:function(t){var e=[t[2]-t[0],t[3]-t[1]],i=[t[6]-t[0],t[7]-t[1]],n=Math.sqrt(i[0]*i[0]+i[1]*i[1]),r=Math.sqrt(e[0]*e[0]+e[1]*e[1]),o=[e[0]/r,e[1]/r],s=[(t[0]+t[2]+t[4]+t[6])/4,(t[1]+t[3]+t[5]+t[7])/4];return[s[0],s[1],o[0],o[1],n,r]},interpolationPointsToRectangle:function(t){var e=[t[2],t[3]],i=[-e[1],e[0]],n=t[4]/2*i[0],r=t[4]/2*i[1],o=t[5]/2*e[0],s=t[5]/2*e[1];return[t[0]-o-n,t[1]-s-r,t[0]+o-n,t[1]+s-r,t[0]+o+n,t[1]+s+r,t[0]-o+n,t[1]-s+r]},polygonToSvgPath:function(t){return(t=t.slice()).unshift("M"),t.splice(3,0,"L"),t.join(" ")},hasGapAt:function(t){if(tthis.endFrame)return!1;for(var e=this.gapRanges.length-1;e>=0;e--)if(this.gapRanges[e][0]t)return!0;return!1},detachAnnotationLabel:function(t){var e=this.labels.indexOf(t);return-1!==e&&this.labels.splice(e,1),cA.detachLabel({id:t.id})},attachAnnotationLabel:function(t){return cA.attachLabel({id:this.id},{label_id:t.id}).then(this.handleAttachedLabel)},handleAttachedLabel:function(t){return this.labels.push(t.body),t},hasKeyframe:function(t){return-1!==this.frames.indexOf(t)},modify:function(t,e){var i=this.frames.indexOf(t);if(-1!==i)this.points.splice(i,1,e);else{for(var n=this.frames.length-1;n>=0&&!(this.frames[n]<=t);n--);this.frames.splice(n+1,0,t),this.points.splice(n+1,0,e)}return cA.update({id:this.id},{frames:this.frames,points:this.points})},split:function(t){return cA.split({id:this.id},{time:t}).then(this.handleFinishedSplit)},handleFinishedSplit:function(t){return this.frames=t.body[0].frames,this.points=t.body[0].points,t.body=t.body[1],t},link:function(t){return cA.link({id:this.id},{annotation_id:t.id}).then(this.handleFinishedLink)},handleFinishedLink:function(t){return this.frames=t.body.frames,this.points=t.body.points,this.labels=t.body.labels,t},deleteKeyframe:function(t){var e=this.frames.indexOf(t);return-1!==e?(this.frames.splice(e,1),this.points.splice(e,1),cA.update({id:this.id},{frames:this.frames,points:this.points})):Vue.Promise.reject("Unknown keyframe ".concat(t," of annotation ").concat(this.id))},delete:function(){return cA.delete({id:this.id})}},watch:{points:function(){this.revision+=1}},created:function(){this.shape=biigle.$require("videos.shapes")[this.shape_id]}}),undefined,undefined,!1,null,null,null).exports;const uP=Sl({mixins:[$I],methods:{handleSelect:function(t,e){t.isSelected&&e?this.$emit("deselect",t):this.$emit("select",t,t.startFrame,e)}}},undefined,undefined,!1,null,null,null).exports;const hP=Sl({components:{powerToggle:Il},data:function(){return{restoreKeys:["annotationOpacity","showMinimap","autoplayDraw","showLabelTooltip","showMousePosition","showProgressIndicator"],annotationOpacity:1,showMinimap:!0,autoplayDraw:0,showLabelTooltip:!1,showMousePosition:!1,playbackRate:1,showProgressIndicator:!0}},methods:{handleShowMinimap:function(){this.showMinimap=!0},handleHideMinimap:function(){this.showMinimap=!1},handleShowLabelTooltip:function(){this.showLabelTooltip=!0},handleHideLabelTooltip:function(){this.showLabelTooltip=!1},handleShowMousePosition:function(){this.showMousePosition=!0},handleHideMousePosition:function(){this.showMousePosition=!1},handleShowProgressIndicator:function(){this.showProgressIndicator=!0},handleHideProgressIndicator:function(){this.showProgressIndicator=!1}},watch:{annotationOpacity:function(t){t=parseFloat(t),isNaN(t)||(this.$emit("update","annotationOpacity",t),lA.set("annotationOpacity",t))},showMinimap:function(t){this.$emit("update","showMinimap",t),lA.set("showMinimap",t)},autoplayDraw:function(t){t=parseFloat(t),this.$emit("update","autoplayDraw",t),lA.set("autoplayDraw",t)},showLabelTooltip:function(t){this.$emit("update","showLabelTooltip",t),lA.set("showLabelTooltip",t)},showMousePosition:function(t){this.$emit("update","showMousePosition",t),lA.set("showMousePosition",t)},playbackRate:function(t){t=parseFloat(t),isNaN(t)||this.$emit("update","playbackRate",t)},showProgressIndicator:function(t){this.$emit("update","showProgressIndicator",t),lA.set("showProgressIndicator",t)}},created:function(){var t=this;this.restoreKeys.forEach((function(e){t[e]=lA.get(e)}))}},undefined,undefined,!1,null,null,null).exports;const cP=Sl({mixins:[XI],created:function(){var t=biigle.$require("videos.user");this.userId=t?t.id:null,this.isAdmin=biigle.$require("videos.isAdmin")}},undefined,undefined,!1,null,null,null).exports;const dP=Sl({data:function(){return{renderedAnnotationMap:{},viewFitOptions:{padding:[50,50,50,50],minResolution:1}}},computed:{annotationsRevision:function(){return this.annotations.reduce((function(t,e){return t+e.revision}),0)},annotationsPreparedToRender:function(){return this.annotations.filter((function(t){return"WholeFrame"!==t.shape})).map((function(t){return{id:t.id,start:t.startFrame,end:t.endFrame,self:t}})).sort((function(t,e){return t.start-e.start}))}},methods:{refreshAnnotations:function(t){var e=this,i=this.annotationSource,n=this.selectedFeatures,r=this.annotationsPreparedToRender,o=this.renderedAnnotationMap,s={};this.renderedAnnotationMap=s;for(var a,l=[],u=!1,h=0,c=r.length;ht)break;a=r[h],u=!0,o.hasOwnProperty(a.id)?(s[a.id]=o[a.id],delete o[a.id]):l.push(a.self)}u?Object.values(o).forEach((function(t){i.removeFeature(t),n.remove(t)})):(i.clear(),n.clear());var d=l.map(this.createFeature);d.forEach((function(t){s[t.getId()]=t,t.get("annotation").isSelected&&n.push(t)})),d.length>0&&i.addFeatures(d),Object.values(s).forEach((function(i){e.updateGeometry(i,t)}))},createFeature:function(t){var e=new Ty(this.getGeometryFromPoints(t.shape,t.points[0]));return e.setId(t.id),e.set("annotation",t),t.labels&&t.labels.length>0&&e.set("color",t.labels[0].label.color),e},updateGeometry:function(t,e){var i=t.get("annotation"),n=i.interpolatePoints(e);t.setGeometry(this.getGeometryFromPoints(i.shape,n))},getGeometryFromPoints:function(t,e){switch(e=this.convertPointsFromDbToOl(e),t){case"Point":return new nv(e[0]);case"Rectangle":return new qb([e]);case"Polygon":return new vv([e]);case"LineString":return new Tv(e);case"Circle":return new wv(e[0],e[1][0]);case"Ellipse":return new Wb([e]);default:return void console.error("Unknown annotation shape: "+t)}},getPointsFromGeometry:function(t){var e;switch(t.getType()){case"Circle":e=[t.getCenter(),[t.getRadius()]];break;case"Polygon":case"Rectangle":case"Ellipse":e=t.getCoordinates()[0];break;case"Point":e=[t.getCoordinates()];break;default:e=t.getCoordinates()}return this.convertPointsFromOlToDb(e)},invertPointsYAxis:function(t){for(var e=this.videoCanvas.height,i=1;i0&&0===this.pendingAnnotation.points.length:this.pendingAnnotation.shape&&this.pendingAnnotation.frames.length>0&&this.pendingAnnotation.points.length>0},cantFinishDrawAnnotation:function(){return!this.hasPendingAnnotation},cantFinishTrackAnnotation:function(){return!this.pendingAnnotation.frames||1!==this.pendingAnnotation.frames.length}},methods:{requireSelectedLabel:function(){this.$emit("requires-selected-label"),this.resetInteractionMode()},initPendingAnnotationLayer:function(t){this.pendingAnnotationSource=new Gb,this.pendingAnnotationLayer=new Ab({opacity:.5,source:this.pendingAnnotationSource,updateWhileAnimating:!0,updateWhileInteracting:!0,style:gw.editing}),t.addLayer(this.pendingAnnotationLayer)},draw:function(t){this["isDrawing"+t]?this.resetInteractionMode():this.hasNoSelectedLabel?this.requireSelectedLabel():this.canAdd&&(this.interactionMode="draw"+t)},drawPoint:function(){this.draw("Point")},drawRectangle:function(){this.draw("Rectangle")},drawCircle:function(){this.draw("Circle")},drawLineString:function(){this.draw("LineString")},drawPolygon:function(){this.draw("Polygon")},drawWholeFrame:function(){this.draw("WholeFrame")},maybeUpdateDrawInteractionMode:function(t){var e=t.slice(4);this.resetPendingAnnotation(e),this.drawInteraction&&(this.map.removeInteraction(this.drawInteraction),this.drawInteraction=void 0),this.isDrawing&&this.hasSelectedLabel&&(this.pause(),this.isDrawingWholeFrame?(this.pendingAnnotation.frames.push(this.video.currentTime),this.$emit("pending-annotation",this.pendingAnnotation)):(this.drawInteraction=new iw({source:this.pendingAnnotationSource,type:e,style:gw.editing}),this.drawInteraction.on("drawend",this.extendPendingAnnotation),this.map.addInteraction(this.drawInteraction)))},finishDrawAnnotation:function(){(this.isDrawing||this.isUsingPolygonBrush)&&this.hasPendingAnnotation&&(this.isDrawingWholeFrame&&!this.pendingAnnotation.frames.includes(this.video.currentTime)&&this.pendingAnnotation.frames.push(this.video.currentTime),this.$emit("create-annotation",this.pendingAnnotation),this.isDrawingWholeFrame?this.resetInteractionMode():this.resetPendingAnnotation(this.pendingAnnotation.shape))},finishTrackAnnotation:function(){this.isDrawing&&this.hasPendingAnnotation&&(this.$emit("track-annotation",this.pendingAnnotation),this.resetPendingAnnotation(this.pendingAnnotation.shape))},resetPendingAnnotation:function(t){this.pendingAnnotationSource.clear(),this.pendingAnnotation={shape:t,frames:[],points:[]},this.$emit("pending-annotation",null)},extendPendingAnnotation:function(t){var e=this.pendingAnnotation.frames[this.pendingAnnotation.frames.length-1];void 0===e||e0&&(this.play(),window.clearTimeout(this.autoplayDrawTimeout),this.autoplayDrawTimeout=window.setTimeout(this.pause,1e3*this.autoplayDraw))):this.pendingAnnotationSource.once("addfeature",(function(t){this.removeFeature(t.feature)})),this.$emit("pending-annotation",this.pendingAnnotation)}},created:function(){this.$once("map-ready",this.initPendingAnnotationLayer),this.canAdd&&(this.$watch("interactionMode",this.maybeUpdateDrawInteractionMode),kl.on("a",this.drawPoint,0,this.listenerSet),kl.on("s",this.drawRectangle,0,this.listenerSet),kl.on("d",this.drawCircle,0,this.listenerSet),kl.on("f",this.drawLineString,0,this.listenerSet),kl.on("g",this.drawPolygon,0,this.listenerSet),kl.on("h",this.drawWholeFrame,0,this.listenerSet),kl.on("Enter",this.finishDrawAnnotation,0,this.listenerSet))}},undefined,undefined,!1,null,null,null).exports;const pP=Sl({components:{mousePositionIndicator:JC},data:function(){return{mousePositionImageCoordinates:[0,0]}},methods:{updateMousePositionImageCoordinates:function(){this.mousePositionImageCoordinates=this.invertPointsYAxis(this.mousePosition.slice()).map(Math.round)}},watch:{mousePosition:function(){nu(this.updateMousePositionImageCoordinates,100,"videos.update-mouse-position-ic")}}},undefined,undefined,!1,null,null,null).exports;var gP=["Point","Circle","Rectangle","WholeFrame"];const mP=Sl({data:function(){return{isTranslating:!1}},computed:{cannotSplitAnnotation:function(){return 1!==this.selectedAnnotations.length||this.selectedAnnotations[0].frames.length<=1||-1===gP.indexOf(this.selectedAnnotations[0].shape)},cannotLinkAnnotations:function(){return 2!==this.selectedAnnotations.length||this.selectedAnnotations[0].shape_id!==this.selectedAnnotations[1].shape_id},isAttaching:function(){return"attachLabel"===this.interactionMode},isSwapping:function(){return"swapLabel"===this.interactionMode}},methods:{initModifyInteraction:function(t){this.featureRevisionMap={},this.modifyInteraction=new ZC({features:this.selectInteraction.getFeatures(),deleteCondition:function(t){return e_(t)&&Qy(t)}}),this.modifyInteraction.on("modifystart",this.handleModifyStart),this.modifyInteraction.on("modifyend",this.handleModifyEnd),t.addInteraction(this.modifyInteraction)},handleModifyStart:function(t){var e=this;t.features.getArray().forEach((function(t){e.featureRevisionMap[t.getId()]=t.getRevision()}))},handleModifyEnd:function(t){var e=this,i=t.features.getArray().filter((function(t){return e.featureRevisionMap[t.getId()]!==t.getRevision()})).map((function(t){return{annotation:t.get("annotation"),points:e.getPointsFromGeometry(t.getGeometry()),time:e.video.currentTime}}));i.length>0&&this.$emit("modify",i)},maybeUpdateModifyInteractionMode:function(t){this.modifyInteraction&&this.modifyInteraction.setActive(t)},emitDelete:function(){var t=this;this.canDelete&&this.hasSelectedAnnotations&&this.$emit("delete",this.selectedAnnotations.map((function(e){return{annotation:e,time:t.video.currentTime}})))},toggleTranslating:function(){this.resetInteractionMode(),this.isTranslating=!this.isTranslating},initTranslateInteraction:function(t){this.translateInteraction=new kE({features:this.selectedFeatures,map:t}),this.translateInteraction.setActive(!1),this.translateInteraction.on("translatestart",this.handleModifyStart),this.translateInteraction.on("translateend",this.handleModifyEnd),this.map.addInteraction(this.translateInteraction)},maybeUpdateIsTranslating:function(t){this.translateInteraction&&!t&&(this.isTranslating=!1)},resetTranslating:function(){this.isTranslating=!1},emitSplitAnnotation:function(){this.$emit("split-annotation",this.selectedAnnotations[0],this.video.currentTime)},emitLinkAnnotations:function(){this.$emit("link-annotations",this.selectedAnnotations)},toggleAttaching:function(){this.isAttaching?this.resetInteractionMode():this.interactionMode="attachLabel"},toggleSwapping:function(){this.isSwapping?this.resetInteractionMode():this.interactionMode="swapLabel"},initAttachInteraction:function(t){this.attachInteraction=new Kv({features:this.annotationFeatures,map:t}),this.attachInteraction.setActive(!1),this.attachInteraction.on("attach",this.handleAttachLabel),this.map.addInteraction(this.attachInteraction)},initSwapInteraction:function(t){this.swapInteraction=new Kv({features:this.annotationFeatures,map:t}),this.swapInteraction.setActive(!1),this.swapInteraction.on("attach",this.handleSwapLabel),this.map.addInteraction(this.swapInteraction)},handleAttachLabel:function(t){this.$emit("attach-label",t.feature.get("annotation"))},handleSwapLabel:function(t){this.$emit("swap-label",t.feature.get("annotation"))},maybeResetAttaching:function(t){this.isAttaching&&t&&this.resetInteractionMode()},maybeResetSwapping:function(t){this.isSwapping&&t&&this.resetInteractionMode()}},watch:{isTranslating:function(t){this.translateInteraction&&(this.translateInteraction.setActive(t),t?this.modifyInteraction.setActive(!1):this.isDefaultInteractionMode&&this.modifyInteraction.setActive(!0))},isAttaching:function(t){this.attachInteraction&&this.attachInteraction.setActive(t),this.$emit("attaching-active",t)},isSwapping:function(t){this.swapInteraction&&this.swapInteraction.setActive(t),this.$emit("swapping-active",t)}},created:function(){var t=this;this.canModify&&(this.$once("map-created",(function(){t.$once("map-ready",t.initModifyInteraction),t.$once("map-ready",t.initTranslateInteraction),t.$once("map-ready",t.initAttachInteraction),t.$once("map-ready",t.initSwapInteraction)})),this.$watch("isDefaultInteractionMode",this.maybeUpdateModifyInteractionMode),this.$watch("isDefaultInteractionMode",this.maybeUpdateIsTranslating),this.$watch("hasNoSelectedLabel",this.maybeResetAttaching),this.$watch("hasNoSelectedLabel",this.maybeResetSwapping),kl.on("m",this.toggleTranslating,0,this.listenerSet),kl.on("Escape",this.resetTranslating,0,this.listenerSet),kl.on("l",this.toggleAttaching,0,this.listenerSet),kl.on("Shift+l",this.toggleSwapping,0,this.listenerSet)),this.canDelete&&kl.on("Delete",this.emitDelete)}},undefined,undefined,!1,null,null,null).exports;const vP=Sl({data:function(){return{polygonBrushRadius:50}},computed:{isUsingPolygonBrush:function(){return"polygonBrush"===this.interactionMode},isUsingPolygonEraser:function(){return"polygonEraser"===this.interactionMode},isUsingPolygonFill:function(){return"polygonFill"===this.interactionMode}},methods:{togglePolygonBrush:function(){this.isUsingPolygonBrush?this.resetInteractionMode():this.hasSelectedLabel?this.canAdd&&(this.interactionMode="polygonBrush"):this.requireSelectedLabel()},togglePolygonEraser:function(){this.isUsingPolygonEraser?this.resetInteractionMode():this.canModify&&(this.interactionMode="polygonEraser")},togglePolygonFill:function(){this.isUsingPolygonFill?this.resetInteractionMode():this.canModify&&(this.interactionMode="polygonFill")},togglePolygonBrushInteraction:function(t){t?this.hasSelectedLabel&&(this.polygonBrushInteraction=new QT({source:this.pendingAnnotationSource,style:gw.editing,brushRadius:this.polygonBrushRadius,resizeCondition:Wy}),this.polygonBrushInteraction.on("drawend",this.extendPendingAnnotation),this.pendingAnnotation.shape="Polygon",this.map.addInteraction(this.polygonBrushInteraction)):(this.polygonBrushRadius=this.polygonBrushInteraction.getBrushRadius(),this.map.removeInteraction(this.polygonBrushInteraction))},togglePolygonEraserInteraction:function(t){t?(this.polygonEraserInteraction=new eE({features:this.selectInteraction.getFeatures(),style:gw.editing,brushRadius:this.polygonBrushRadius,allowRemove:!1,addCondition:Jy,subtractCondition:t_,resizeCondition:Wy}),this.polygonEraserInteraction.on("modifystart",this.handleModifyStart),this.polygonEraserInteraction.on("modifyend",this.handleModifyEnd),this.map.addInteraction(this.polygonEraserInteraction),this.map.addInteraction(this.shiftClickSelectInteraction)):(this.polygonBrushRadius=this.polygonEraserInteraction.getBrushRadius(),this.map.removeInteraction(this.polygonEraserInteraction),this.polygonEraserInteraction=null,this.map.removeInteraction(this.shiftClickSelectInteraction))},togglePolygonFillInteraction:function(t){t?(this.polygonFillInteraction=new eE({features:this.selectInteraction.getFeatures(),style:gw.editing,brushRadius:this.polygonBrushRadius,allowRemove:!1,addCondition:t_,subtractCondition:Jy,resizeCondition:Wy}),this.polygonFillInteraction.on("modifystart",this.handleModifyStart),this.polygonFillInteraction.on("modifyend",this.handleModifyEnd),this.map.addInteraction(this.polygonFillInteraction),this.map.addInteraction(this.shiftClickSelectInteraction)):(this.polygonBrushRadius=this.polygonFillInteraction.getBrushRadius(),this.map.removeInteraction(this.polygonFillInteraction),this.polygonFillInteraction=null,this.map.removeInteraction(this.shiftClickSelectInteraction))},initShiftSelectInteraction:function(){this.shiftClickSelectInteraction=new sE({condition:function(t){return Hy(t)&&e_(t)},style:gw.highlight,layers:[this.annotationLayer],features:this.selectInteraction.getFeatures(),multi:!0}),this.shiftClickSelectInteraction.on("select",this.handleFeatureSelect)}},created:function(){var t=this;this.canAdd&&(this.$watch("isUsingPolygonBrush",this.togglePolygonBrushInteraction),kl.on("e",this.togglePolygonBrush,0,this.listenerSet)),this.canModify&&(this.$once("map-created",(function(){t.$once("map-ready",t.initShiftSelectInteraction)})),this.$watch("isUsingPolygonEraser",this.togglePolygonEraserInteraction),kl.on("r",this.togglePolygonEraser,0,this.listenerSet),this.$watch("isUsingPolygonFill",this.togglePolygonFillInteraction),kl.on("t",this.togglePolygonFill,0,this.listenerSet))}},undefined,undefined,!1,null,null,null).exports;const yP=Sl({components:{labelTooltip:dg},data:function(){return{hoveredFeaturesHash:""}},computed:{showTooltip:function(){return this.isDefaultInteractionMode&&this.showLabelTooltip}},methods:{annotationLayerFilter:function(t){return"annotations"===t.get("name")},updateHoveredAnnotations:function(t){var e=this.map.getFeaturesAtPixel(t.pixel,{layerFilter:this.annotationLayerFilter})||[],i=e.map((function(t){return t.getId()})).join("-");this.hoveredFeaturesHash!==i&&(this.hoveredFeaturesHash=i,this.$emit("hoverFeatures",e))},resetHoveredAnnotations:function(){this.hoveredFeaturesHash="",this.$emit("hoverFeatures",[])},updateTooltipEventListeners:function(){this.showTooltip?this.map.on("pointermove",this.updateHoveredAnnotations):(this.map.un("pointermove",this.updateHoveredAnnotations),this.resetHoveredAnnotations())}},watch:{showTooltip:function(){this.updateTooltipEventListeners()}},created:function(){this.$once("map-created",this.updateTooltipEventListeners)}},undefined,undefined,!1,null,null,null).exports;var _P=Sl({data:function(){return{playing:!1,animationFrameId:null,refreshRate:30,renderCurrentTime:-1,refreshLastTime:Date.now(),extent:[0,0,0,0],minResolution:.01}},methods:{initVideoLayer:function(t){var e=t[0];this.videoCanvas.width=this.video.videoWidth,this.videoCanvas.height=this.video.videoHeight,this.extent=[0,0,this.videoCanvas.width,this.videoCanvas.height];var i=new Yg({code:"biigle-image",units:"pixels",extent:this.extent});this.videoLayer=new bw({name:"image",source:new yy({canvas:this.videoCanvas,projection:i,canvasExtent:this.extent,canvasSize:[this.extent[0],this.extent[1]]})}),e.addLayer(this.videoLayer),e.setView(new zx({center:[0,0],projection:i,minResolution:this.minResolution,extent:this.extent})),e.getView().fit(this.extent)},renderVideo:function(t){if(t||this.renderCurrentTime!==this.video.currentTime){this.renderCurrentTime=this.video.currentTime,this.videoCanvasCtx.drawImage(this.video,0,0,this.video.videoWidth,this.video.videoHeight),this.videoLayer.changed();var e=Date.now();(t||e-this.refreshLastTime>=this.refreshRate)&&(this.$emit("refresh",this.video.currentTime),this.refreshLastTime=e)}},startRenderLoop:function(){this.renderVideo(),this.animationFrameId=window.requestAnimationFrame(this.startRenderLoop)},stopRenderLoop:function(){window.cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null,this.renderVideo(!0)},setPlaying:function(){this.playing=!0},setPaused:function(){this.playing=!1},togglePlaying:function(){this.playing?this.pause():this.play()},play:function(){this.video.play()},pause:function(){this.video.pause(),this.renderVideo(!0)},emitMapReady:function(){this.$emit("map-ready",this.map)}},watch:{playing:function(t){t&&!this.animationFrameId?this.startRenderLoop():t||this.stopRenderLoop()}},created:function(){var t=this;this.videoCanvas=document.createElement("canvas"),this.videoCanvasCtx=this.videoCanvas.getContext("2d"),this.video.addEventListener("play",this.setPlaying),this.video.addEventListener("pause",this.setPaused),this.video.addEventListener("seeked",this.renderVideo),this.video.addEventListener("loadeddata",this.renderVideo);var e=new Vue.Promise((function(e){t.$once("map-created",e)})),i=new Vue.Promise((function(e){t.video.addEventListener("loadedmetadata",e)}));Vue.Promise.all([e,i]).then(this.initVideoLayer).then(this.emitMapReady),kl.on(" ",this.togglePlaying),this.$watch("hasError",(function(e){t.videoLayer&&t.videoLayer.setVisible(!e)}))}},undefined,undefined,!1,null,null,null);const bP=Sl({mixins:[_P.exports,dP,fP,mP,yP,pP,vP],components:{controlButton:Cy,minimap:VC},props:{annotations:{type:Array,default:function(){return[]}},annotationOpacity:{type:Number,default:1},autoplayDraw:{type:Number,default:0},canAdd:{type:Boolean,default:!1},canModify:{type:Boolean,default:!1},canDelete:{type:Boolean,default:!1},initialCenter:{type:Array,default:function(){return[0,0]}},initialResolution:{type:Number,default:0},listenerSet:{type:String,default:"default"},selectedAnnotations:{type:Array,default:function(){return[]}},selectedLabel:{type:Object},showLabelTooltip:{type:Boolean,default:!1},showMinimap:{type:Boolean,default:!0},showMousePosition:{type:Boolean,default:!0},video:{type:HTMLVideoElement,required:!0},heightOffset:{type:Number,default:0},showPrevNext:{type:Boolean,default:!0},hasError:{type:Boolean,default:!1}},data:function(){return{interactionMode:"default",mousePosition:[0,0]}},computed:{showModifyBar:function(){return this.canModify||this.canDelete},hasSelectedAnnotations:function(){return this.selectedAnnotations.length>0},hasNoSelectedAnnotations:function(){return!this.hasSelectedAnnotations},isDefaultInteractionMode:function(){return"default"===this.interactionMode},styleObject:function(){return 0!==this.heightOffset?"height: calc(65% + ".concat(this.heightOffset,"px);"):""}},methods:{createMap:function(){var t=new hI({tipLabel:"Zoom to show whole video",label:""});kl.on("-",t.handleZoomToExtent.bind(t),0,this.listenerSet);var e=new NC({controls:[new Qx,t],interactions:ES({altShiftDragRotate:!1,doubleClickZoom:!1,keyboard:!1,shiftDragZoom:!1,pinchRotate:!1,pinchZoom:!1})});return t=new yI({label:""}),kl.on("+",t.zoomToNative.bind(t),0,this.listenerSet),e.addControl(t),e},initLayersAndInteractions:function(t){this.annotationFeatures=new Sy,this.annotationSource=new Gb({features:this.annotationFeatures}),this.annotationLayer=new Ab({source:this.annotationSource,updateWhileAnimating:!0,updateWhileInteracting:!0,style:gw.features,opacity:this.annotationOpacity,name:"annotations"}),this.selectInteraction=new sE({condition:Hy,style:gw.highlight,layers:[this.annotationLayer],multi:!0}),this.selectedFeatures=this.selectInteraction.getFeatures(),this.selectInteraction.on("select",this.handleFeatureSelect),t.addLayer(this.annotationLayer),t.addInteraction(this.selectInteraction)},resetInteractionMode:function(){this.interactionMode="default"},extractAnnotationFromFeature:function(t){return t.get("annotation")},handleFeatureSelect:function(t){this.$emit("select",t.selected.map(this.extractAnnotationFromFeature),t.deselected.map(this.extractAnnotationFromFeature),this.video.currentTime)},updateMousePosition:function(t){this.mousePosition=t.coordinate},emitTrack:function(){this.$emit("track")},emitMoveend:function(t){var e=t.target.getView();this.$emit("moveend",e.getCenter(),e.getResolution())},initInitialCenterAndResolution:function(t){var e=t.getView();0!==this.initialResolution&&e.setResolution(Math.min(e.getMaxResolution(),Math.max(e.getMinResolution(),this.initialResolution))),0===this.initialCenter[0]&&0===this.initialCenter[1]||!kp(this.extent,this.initialCenter)||e.setCenter(this.initialCenter)},updateSize:function(){var t=this;this.$nextTick((function(){return t.map.updateSize()}))},emitPrevious:function(){this.$emit("previous")},emitNext:function(){this.$emit("next")},reset:function(){this.setPaused(),this.resetInteractionMode()}},watch:{selectedAnnotations:function(t){var e,i=this.annotationSource,n=this.selectedFeatures;i&&n&&(n.clear(),t.forEach((function(t){(e=i.getFeatureById(t.id))&&n.push(e)})))},isDefaultInteractionMode:function(t){this.selectInteraction.setActive(t)},annotationOpacity:function(t){this.annotationLayer&&this.annotationLayer.setOpacity(t)},heightOffset:function(){this.updateSize()}},created:function(){this.$once("map-ready",this.initLayersAndInteractions),this.$once("map-ready",this.initInitialCenterAndResolution),this.map=this.createMap(),this.$emit("map-created",this.map),this.map.on("pointermove",this.updateMousePosition),this.map.on("moveend",this.emitMoveend),kl.on("Escape",this.resetInteractionMode,0,this.listenerSet),kl.on("ArrowRight",this.emitNext,0,this.listenerSet),kl.on("ArrowLeft",this.emitPrevious,0,this.listenerSet)},mounted:function(){this.map.setTarget(this.$el)}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"video-screen",style:t.styleObject},[t.showMinimap&&!t.hasError?i("minimap",{attrs:{extent:t.extent}}):t._e(),t._v(" "),i("label-tooltip",{attrs:{watch:"hoverFeatures",show:t.showLabelTooltip,position:t.mousePosition}}),t._v(" "),i("div",{staticClass:"controls"},[i("div",{staticClass:"btn-group"},[t.showPrevNext?i("control-button",{attrs:{icon:"fa-step-backward",title:"Previous video 𝗟𝗲𝗳𝘁 𝗮𝗿𝗿𝗼𝘄"},on:{click:t.emitPrevious}}):t._e(),t._v(" "),t.playing?i("control-button",{attrs:{icon:"fa-pause",title:"Pause 𝗦𝗽𝗮𝗰𝗲𝗯𝗮𝗿",disabled:t.hasError},on:{click:t.pause}}):i("control-button",{attrs:{icon:"fa-play",title:"Play 𝗦𝗽𝗮𝗰𝗲𝗯𝗮𝗿",disabled:t.hasError},on:{click:t.play}}),t._v(" "),t.showPrevNext?i("control-button",{attrs:{icon:"fa-step-forward",title:"Next video 𝗥𝗶𝗴𝗵𝘁 𝗮𝗿𝗿𝗼𝘄"},on:{click:t.emitNext}}):t._e()],1),t._v(" "),t.canAdd?i("div",{staticClass:"btn-group"},[i("control-button",{attrs:{icon:"icon-point",title:"Start a point annotation 𝗔",hover:!1,open:t.isDrawingPoint,active:t.isDrawingPoint,disabled:t.hasError},on:{click:t.drawPoint}},[i("control-button",{attrs:{icon:"fa-check",title:"Finish the point annotation 𝗘𝗻𝘁𝗲𝗿",disabled:t.cantFinishDrawAnnotation},on:{click:t.finishDrawAnnotation}}),t._v(" "),i("control-button",{attrs:{icon:"fa-project-diagram",title:"Finish and track the point annotation",disabled:t.cantFinishTrackAnnotation},on:{click:t.finishTrackAnnotation}})],1),t._v(" "),i("control-button",{attrs:{icon:"icon-rectangle",title:"Start a rectangle annotation 𝗦",hover:!1,open:t.isDrawingRectangle,active:t.isDrawingRectangle,disabled:t.hasError},on:{click:t.drawRectangle}},[i("control-button",{attrs:{icon:"fa-check",title:"Finish the rectangle annotation 𝗘𝗻𝘁𝗲𝗿",disabled:t.cantFinishDrawAnnotation},on:{click:t.finishDrawAnnotation}})],1),t._v(" "),i("control-button",{attrs:{icon:"icon-circle",title:"Start a circle annotation 𝗗",hover:!1,open:t.isDrawingCircle,active:t.isDrawingCircle,disabled:t.hasError},on:{click:t.drawCircle}},[i("control-button",{attrs:{icon:"fa-check",title:"Finish the circle annotation 𝗘𝗻𝘁𝗲𝗿",disabled:t.cantFinishDrawAnnotation},on:{click:t.finishDrawAnnotation}}),t._v(" "),i("control-button",{attrs:{icon:"fa-project-diagram",title:"Finish and track the circle annotation",disabled:t.cantFinishTrackAnnotation},on:{click:t.finishTrackAnnotation}})],1),t._v(" "),i("control-button",{attrs:{icon:"icon-linestring",title:"Start a line annotation 𝗙",hover:!1,open:t.isDrawingLineString,active:t.isDrawingLineString,disabled:t.hasError},on:{click:t.drawLineString}},[i("control-button",{attrs:{icon:"fa-check",title:"Finish the line annotation 𝗘𝗻𝘁𝗲𝗿",disabled:t.cantFinishDrawAnnotation},on:{click:t.finishDrawAnnotation}})],1),t._v(" "),i("control-button",{attrs:{icon:"icon-polygon",title:"Start a polygon annotation 𝗚",open:t.isDrawingPolygon,active:t.isDrawingPolygon,disabled:t.hasError},on:{click:t.drawPolygon}},[t.isDrawingPolygon||t.isUsingPolygonBrush?i("control-button",{attrs:{icon:"fa-check",title:"Finish the polygon annotation 𝗘𝗻𝘁𝗲𝗿",disabled:t.cantFinishDrawAnnotation},on:{click:t.finishDrawAnnotation}}):t._e(),t._v(" "),i("control-button",{attrs:{icon:"fa-paint-brush",title:"Draw a polygon using the brush tool 𝗘",active:t.isUsingPolygonBrush},on:{click:t.togglePolygonBrush}}),t._v(" "),i("control-button",{attrs:{icon:"fa-eraser",title:"Modify selected polygons using the eraser tool 𝗥",active:t.isUsingPolygonEraser},on:{click:t.togglePolygonEraser}}),t._v(" "),i("control-button",{attrs:{icon:"fa-fill-drip",title:"Modify selected polygons using the fill tool 𝗧",active:t.isUsingPolygonFill},on:{click:t.togglePolygonFill}})],1),t._v(" "),i("control-button",{attrs:{icon:"icon-wholeframe",title:"Start a whole frame annotation 𝗛",hover:!1,open:t.isDrawingWholeFrame,active:t.isDrawingWholeFrame,disabled:t.hasError},on:{click:t.drawWholeFrame}},[i("control-button",{attrs:{icon:"fa-check",title:"Finish the whole frame annotation 𝗘𝗻𝘁𝗲𝗿",disabled:t.cantFinishDrawAnnotation},on:{click:t.finishDrawAnnotation}})],1)],1):t._e(),t._v(" "),t.showModifyBar?i("div",{staticClass:"btn-group"},[t.canModify?i("control-button",{attrs:{icon:"fa-tag",title:"Attach the currently selected label to existing annotations 𝗟",active:t.isAttaching,disabled:t.hasNoSelectedLabel||t.hasError},on:{click:t.toggleAttaching}},[i("control-button",{attrs:{icon:"fa-sync-alt",title:"Swap the most recent label of an existing annotation with the currently selected one 𝗦𝗵𝗶𝗳𝘁+𝗟",active:t.isSwapping,disabled:t.hasNoSelectedLabel||t.hasError},on:{click:t.toggleSwapping}})],1):t._e(),t._v(" "),t.canModify?i("control-button",{attrs:{icon:"fa-arrows-alt",title:"Move selected annotations 𝗠",active:t.isTranslating,disabled:t.hasError},on:{click:t.toggleTranslating}}):t._e(),t._v(" "),t.canModify?i("control-button",{attrs:{icon:"fa-link",title:"Link selected annotations",disabled:t.cannotLinkAnnotations||t.hasError},on:{click:t.emitLinkAnnotations}}):t._e(),t._v(" "),t.canModify?i("control-button",{attrs:{icon:"fa-unlink",title:"Split selected annotation",disabled:t.cannotSplitAnnotation||t.hasError},on:{click:t.emitSplitAnnotation}}):t._e(),t._v(" "),t.canDelete?i("control-button",{attrs:{icon:"fa-trash",title:"Delete selected annotations/keyframes 𝗗𝗲𝗹𝗲𝘁𝗲",disabled:t.hasNoSelectedAnnotations||t.hasError},on:{click:t.emitDelete}}):t._e()],1):t._e()]),t._v(" "),i("div",{staticClass:"indicators indicators--left"},[t.showMousePosition?i("mouse-position-indicator",{attrs:{position:t.mousePositionImageCoordinates}}):t._e()],1),t._v(" "),i("div",{staticClass:"indicators indicators--right"},[t.selectedLabel?i("div",{staticClass:"indicator",domProps:{textContent:t._s(t.selectedLabel.name)}}):t._e()])],1)}),[],!1,null,null,null).exports;const wP=Sl({props:{currentTime:{type:Number,required:!0},hoverTime:{type:Number,default:0},seeking:{type:Boolean,default:!1}},components:{loader:Cl},computed:{currentTimeText:function(){return Vue.filter("videoTime")(this.currentTime)},hoverTimeText:function(){return Vue.filter("videoTime")(this.hoverTime)},classObject:function(){return{"current-time--seeking":this.seeking,"current-time--hover":this.showHoverTime}},showHoverTime:function(){return 0!==this.hoverTime}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"current-time",class:t.classObject},[t.seeking?i("loader",{attrs:{active:!0}}):i("span",[i("span",{domProps:{textContent:t._s(t.currentTimeText)}}),t._v(" "),i("span",{directives:[{name:"show",rawName:"v-show",value:t.showHoverTime,expression:"showHoverTime"}],staticClass:"hover-time",domProps:{textContent:t._s(t.hoverTimeText)}})])],1)}),[],!1,null,null,null).exports;var xP=Sl({props:{frame:{type:Object,required:!0},startFrame:{type:Number,required:!0},segmentDuration:{type:Number,required:!0},color:{type:String,required:!0}},computed:{offset:function(){return(this.frame.time-this.startFrame)/this.segmentDuration},style:function(){return{left:100*this.offset+"%","background-color":this.color}},classObj:function(){return{"annotation-keyframe--selected":this.frame.selected}}},methods:{emitSelect:function(t){this.$emit("select",this.frame,t.shiftKey)}}},(function(){var t=this,e=t.$createElement;return(t._self._c||e)("span",{staticClass:"annotation-keyframe",class:t.classObj,style:t.style,on:{click:function(e){return e.stopPropagation(),t.emitSelect(e)}}})}),[],!1,null,null,null);var SP=Sl({components:{keyframe:xP.exports},props:{annotation:{type:Object,required:!0},label:{type:Object,required:!0},frames:{type:Array,required:!0},gap:{type:Boolean,default:!1},clipDuration:{type:Number,required:!0}},computed:{startFrame:function(){return this.frames[0]},endFrame:function(){return this.frames[this.frames.length-1]},segmentDuration:function(){return this.endFrame-this.startFrame},classObject:function(){return{"annotation-segment--gap":this.gap}},width:function(){return 100*this.segmentDuration/this.clipDuration},color:function(){return"#"+(this.label.color||"000000")},style:function(){var t={width:this.width+"%"};return this.gap?t["border-top-color"]=this.color:t["background-color"]=this.color+"66",t},keyframes:function(){if(this.gap)return[];var t=this.annotation.selected;return this.frames.map((function(e){return{time:e,selected:t===e}}))}},methods:{selectFrame:function(t,e){this.$emit("select",t.time,e)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"annotation-segment",class:t.classObject,style:t.style},t._l(t.keyframes,(function(e){return i("keyframe",{key:e.time,attrs:{frame:e,"start-frame":t.startFrame,"segment-duration":t.segmentDuration,color:t.color},on:{select:t.selectFrame}})})),1)}),[],!1,null,null,null);var CP=Sl({components:{segment:SP.exports},props:{annotation:{type:Object,required:!0},label:{type:Object,required:!0},duration:{type:Number,required:!0},elementWidth:{type:Number,required:!0}},computed:{startFrame:function(){return this.annotation.startFrame},endFrame:function(){return this.annotation.endFrame},offset:function(){var t=this.startFrame/this.duration*this.elementWidth;return this.annotation.isClip||(t=Math.min(t,this.elementWidth-9)),t},clipDuration:function(){return this.endFrame-this.startFrame},width:function(){return this.clipDuration/this.duration*this.elementWidth},style:function(){return{left:this.offset+"px",width:this.width+"px"}},segments:function(){for(var t,e=[this.annotation.frames.slice()],i=[!1],n=0;-1!==(t=e[n].indexOf(null));){var r=e[n];e[n]=r.slice(0,t),e.push([r[t-1],r[t+1]]),i.push(!0),e.push(r.slice(t+1)),i.push(!1),n+=2}return e.map((function(t,e){return{frames:t,gap:i[e]}}))},selected:function(){return this.annotation.isSelected},classObj:function(){return{"annotation-clip--selected":this.selected,"annotation-clip--compact":this.shouldBeCompact,"annotation-clip--more-compact":this.shouldBeMoreCompact,"annotation-clip--tracking":this.annotation.tracking,"annotation-clip--whole-frame":this.annotation.wholeFrame,"annotation-clip--dark":this.hasDarkColor,"annotation-clip--pending":this.annotation.pending}},minTimeBetweenFrames:function(){for(var t=1/0,e=this.annotation.frames.filter((function(t){return null!==t})),i=e.length-1;i>0;i--)t=Math.min(t,e[i]-e[i-1]);return t},minDistanceBetweenFrames:function(){return this.minTimeBetweenFrames/this.duration*this.elementWidth},shouldBeCompact:function(){return this.minDistanceBetweenFrames<=18},shouldBeMoreCompact:function(){return this.minDistanceBetweenFrames<=6},title:function(){return this.annotation.pending?"Pending annotation":this.annotation.tracking?"Tracking in progress":""},hasDarkColor:function(){var t=this.label.color||"000000",e=parseInt(t,16);return.2126*(e>>16&255)+.7152*(e>>8&255)+.0722*(e>>0&255)<128}},methods:{emitSelect:function(t,e){this.selected&&e?this.$emit("deselect",this.annotation):this.$emit("select",this.annotation,t,e)},select:function(t){var e=this.startFrame+(t.clientX-this.$el.getBoundingClientRect().left)/this.$el.clientWidth*this.clipDuration;this.emitSelect(e,t.shiftKey)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{directives:[{name:"show",rawName:"v-show",value:t.duration>0,expression:"duration > 0"}],staticClass:"annotation-clip",class:t.classObj,style:t.style,attrs:{title:t.title},on:{click:function(e){return e.stopPropagation(),t.select(e)}}},t._l(t.segments,(function(e,n){return i("segment",{key:n,attrs:{annotation:t.annotation,label:t.label,frames:e.frames,gap:e.gap,"clip-duration":t.clipDuration},on:{select:t.emitSelect}})})),1)}),[],!1,null,null,null);var TP=Sl({components:{annotationClip:CP.exports},props:{label:{type:Object,required:!0},lanes:{type:Array,required:!0},duration:{type:Number,required:!0},elementWidth:{type:Number,required:!0}},methods:{emitSelect:function(t,e,i){this.$emit("select",t,e,i)},emitDeselect:function(t){this.$emit("deselect",t)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"annotation-track"},t._l(t.lanes,(function(e){return i("div",{staticClass:"annotation-lane"},t._l(e,(function(e){return i("annotation-clip",{key:e.id,attrs:{annotation:e,"element-width":t.elementWidth,label:t.label,duration:t.duration},on:{select:t.emitSelect,deselect:t.emitDeselect}})})),1)})),0)}),[],!1,null,null,null);const EP=Sl({components:{annotationTrack:TP.exports},props:{tracks:{type:Array,required:!0},duration:{type:Number,required:!0},elementWidth:{type:Number,required:!0}},data:function(){return{dragging:!1,scrollTop:0,scrollHeight:0,clientHeight:0}},computed:{hasOverflowTop:function(){return this.scrollTop>0},hasOverflowBottom:function(){var t=this.scrollHeight-this.clientHeight-1;return t>0&&this.scrollTop0&&this.duration>0}},methods:{emitSeek:function(t){this.$emit("seek",(t.clientX-t.target.getBoundingClientRect().left)/t.target.clientWidth*this.duration)}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"video-progress",on:{click:t.emitSeek}},t._l(t.ticks,(function(t){return i("tick",{key:t,attrs:{time:t}})})),1)}),[],!1,null,null,null);const PP=Sl({components:{videoProgress:AP.exports,annotationTracks:EP},props:{tracks:{type:Array,required:function(){return[]}},duration:{type:Number,required:!0},currentTime:{type:Number,required:!0},seeking:{type:Boolean,default:!1}},data:function(){return{zoom:1,zoomFactor:.3,scrollFactor:10,initialElementWidth:0,scrollLeft:0,hoverTime:0,hasOverflowTop:!1,hasOverflowBottom:!1}},computed:{currentTimePosition:function(){return this.duration>0?this.elementWidth*this.currentTime/this.duration:0},timeIndicatorClass:function(){return{"time-indicator--seeking":this.seeking}},timeIndicatorStyle:function(){return"transform: translateX(".concat(this.currentTimePosition,"px);")},hoverTimeIndicatorStyle:function(){return"transform: translateX(".concat(this.hoverPosition,"px);")},scrollerStyle:function(){return{width:100*this.zoom+"%",left:this.scrollLeft+"px"}},elementWidth:function(){return this.initialElementWidth*this.zoom},hoverPosition:function(){return this.duration>0?this.elementWidth*this.hoverTime/this.duration:0},showHoverTime:function(){return 0!==this.hoverTime},hasOverflowLeft:function(){return this.scrollLeft<0},hasOverflowRight:function(){return this.elementWidth+this.scrollLeft>this.initialElementWidth}},methods:{updateInitialElementWidth:function(){this.initialElementWidth=this.$el.clientWidth},emitSeek:function(t){this.$emit("seek",t)},emitSelect:function(t,e,i){this.$emit("select",t,e,i)},emitDeselect:function(t){this.$emit("deselect",t)},emitScrollY:function(t){this.$emit("scroll-y",t)},handleWheel:function(t){t.shiftKey?0!==t.deltaY&&this.updateZoom(t):t.deltaX<0?this.updateScrollLeft(this.scrollLeft+this.scrollFactor):t.deltaX>0&&this.updateScrollLeft(this.scrollLeft-this.scrollFactor)},updateZoom:function(t){var e=this,i=t.clientX-this.$el.getBoundingClientRect().left,n=(t.clientX-this.$refs.scroller.getBoundingClientRect().left)/this.elementWidth,r=t.deltaY<0?this.zoomFactor:-1*this.zoomFactor;this.zoom=Math.max(1,this.zoom+r),this.$nextTick((function(){var t=n*e.elementWidth;e.updateScrollLeft(i-t)}))},handleHideHoverTime:function(){this.hoverTime=0},handleUpdateHoverTime:function(t){this.hoverTime=(t.clientX-this.$refs.scroller.getBoundingClientRect().left)/this.elementWidth*this.duration},updateScrollLeft:function(t){this.scrollLeft=Math.max(Math.min(0,t),this.initialElementWidth-this.elementWidth)},updateOverflowTop:function(t){this.hasOverflowTop=t},updateOverflowBottom:function(t){this.hasOverflowBottom=t},handleDragX:function(t){this.updateScrollLeft(this.scrollLeft+t)},updateHeight:function(){this.$refs.annotationTracks.updateClientHeight()},reset:function(){this.zoom=1,this.scrollLeft=0,this.hoverTime=0,this.hasOverflowTop=!1,this.hasOverflowBottom=!1}},watch:{hoverTime:function(t){this.$emit("hover-time",t)},initialElementWidth:function(t,e){this.updateScrollLeft(this.scrollLeft*t/e)}},created:function(){var t=this;window.addEventListener("resize",this.updateInitialElementWidth),Pl.$on("sidebar.toggle",(function(){t.$nextTick(t.updateInitialElementWidth)})),kl.on(" ",(function(t){t.preventDefault()}))},mounted:function(){this.$nextTick(this.updateInitialElementWidth)}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"scroll-strip",on:{wheel:function(e){return e.stopPropagation(),t.handleWheel(e)},mouseleave:t.handleHideHoverTime}},[i("div",{ref:"scroller",staticClass:"scroll-strip__scroller",style:t.scrollerStyle,on:{mousemove:t.handleUpdateHoverTime}},[i("video-progress",{attrs:{duration:t.duration,"element-width":t.elementWidth},on:{seek:t.emitSeek}}),t._v(" "),i("div",{staticClass:"annotation-tracks-wrapper"},[i("annotation-tracks",{ref:"annotationTracks",attrs:{tracks:t.tracks,duration:t.duration,"element-width":t.elementWidth},on:{select:t.emitSelect,deselect:t.emitDeselect,"scroll-y":t.emitScrollY,"drag-x":t.handleDragX,"overflow-top":t.updateOverflowTop,"overflow-bottom":t.updateOverflowBottom}}),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:t.hasOverflowTop,expression:"hasOverflowTop"}],staticClass:"overflow-shadow overflow-shadow--top"}),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:t.hasOverflowBottom,expression:"hasOverflowBottom"}],staticClass:"overflow-shadow overflow-shadow--bottom"})],1),t._v(" "),i("span",{staticClass:"time-indicator",class:t.timeIndicatorClass,style:t.timeIndicatorStyle}),t._v(" "),i("span",{directives:[{name:"show",rawName:"v-show",value:t.showHoverTime,expression:"showHoverTime"}],staticClass:"hover-time-indicator",style:t.hoverTimeIndicatorStyle})],1),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:t.hasOverflowLeft,expression:"hasOverflowLeft"}],staticClass:"overflow-shadow overflow-shadow--left"}),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:t.hasOverflowRight,expression:"hasOverflowRight"}],staticClass:"overflow-shadow overflow-shadow--right"})])}),[],!1,null,null,null).exports;var kP=Sl({props:{tracks:{type:Array,required:!0},scrollTop:{type:Number,default:0}},watch:{scrollTop:function(t){this.$el.scrollTop=t}}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"track-headers"},t._l(t.tracks,(function(e){return i("div",{staticClass:"track-header"},[i("div",{staticClass:"label-name",attrs:{title:e.label.name},domProps:{textContent:t._s(e.label.name)}}),t._v(" "),t._l(e.lanes,(function(t){return i("div",{staticClass:"lane-dummy"})}))],2)})),0)}),[],!1,null,null,null);const RP=Sl({components:{currentTime:wP,trackHeaders:kP.exports,scrollStrip:PP},props:{annotations:{type:Array,default:function(){return[]}},video:{type:HTMLVideoElement,required:!0},seeking:{type:Boolean,default:!1},heightOffset:{type:Number,default:0},pendingAnnotation:{type:Object,default:function(){return null}}},data:function(){return{animationFrameId:null,refreshRate:30,refreshLastTime:Date.now(),currentTime:0,duration:0,scrollTop:0,hoverTime:0}},computed:{labelMap:function(){var t={},e=this.annotations;return this.pendingAnnotation&&(e=e.slice()).push(this.pendingAnnotation),e.forEach((function(e){e.labels.forEach((function(e){t.hasOwnProperty(e.label_id)||(t[e.label_id]=e.label)}))})),t},annotationTracks:function(){var t=this,e={},i=this.annotations;return this.pendingAnnotation&&(i=i.slice()).push(this.pendingAnnotation),i.forEach((function(t){t.labels.forEach((function(i){e.hasOwnProperty(i.label_id)||(e[i.label_id]=[]),e[i.label_id].push(t)}))})),Object.keys(e).map((function(i){return{id:i,label:t.labelMap[i],lanes:t.getAnnotationTrackLanes(e[i])}}))},styleObject:function(){return 0!==this.heightOffset?"height: calc(35% + ".concat(this.heightOffset,"px);"):""}},methods:{startUpdateLoop:function(){var t=Date.now();t-this.refreshLastTime>=this.refreshRate&&(this.updateCurrentTime(),this.refreshLastTime=t),this.animationFrameId=window.requestAnimationFrame(this.startUpdateLoop)},stopUpdateLoop:function(){this.updateCurrentTime(),window.cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null},updateCurrentTime:function(){this.currentTime=this.video.currentTime},setDuration:function(){this.duration=this.video.duration},emitSeek:function(t){this.$emit("seek",t)},emitSelect:function(t,e,i){this.$emit("select",t,e,i)},emitDeselect:function(t){this.$emit("deselect",t)},handleScrollY:function(t){this.scrollTop=t},getAnnotationTrackLanes:function(t){var e=this,i=[[]],n=[[]];return t.forEach((function(t){var r=[t.startFrame,t.endFrame],o=0,s=!1;t:for(;!s;){if(n[o]){for(var a=i[o].length-1;a>=0;a--)if(e.rangesCollide(i[o][a],r)){o+=1;continue t}}else i[o]=[],n[o]=[];i[o].push(r),n[o].push(t),s=!0}})),n},rangesCollide:function(t,e){return t[0]>=e[0]&&t[0]e[0]&&t[1]<=e[1]||e[0]>=t[0]&&e[0]t[0]&&e[1]<=t[1]||t[0]===e[0]&&t[1]===e[1]},updateHoverTime:function(t){this.hoverTime=t},emitStartResize:function(t){this.$emit("start-resize",t)},reset:function(){this.currentTime=0,this.duration=0,this.scrollTop=0,this.hoverTime=0,this.$refs.scrollStrip.reset()}},watch:{heightOffset:function(){this.$refs.scrollStrip.updateHeight()}},created:function(){this.video.addEventListener("play",this.startUpdateLoop),this.video.addEventListener("pause",this.stopUpdateLoop),this.video.addEventListener("loadedmetadata",this.setDuration),this.video.addEventListener("seeked",this.updateCurrentTime)}},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"video-timeline",style:t.styleObject},[i("div",{staticClass:"grab-border",on:{mousedown:t.emitStartResize}}),t._v(" "),i("div",{staticClass:"static-strip"},[i("current-time",{attrs:{"current-time":t.currentTime,"hover-time":t.hoverTime,seeking:t.seeking}}),t._v(" "),i("track-headers",{ref:"trackheaders",attrs:{tracks:t.annotationTracks,"scroll-top":t.scrollTop}})],1),t._v(" "),i("scroll-strip",{ref:"scrollStrip",attrs:{tracks:t.annotationTracks,duration:t.duration,"current-time":t.currentTime,seeking:t.seeking},on:{seek:t.emitSeek,select:t.emitSelect,deselect:t.emitDeselect,"scroll-y":t.handleScrollY,"hover-time":t.updateHoverTime}})],1)}),[],!1,null,null,null).exports;function LP(t){return(LP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function FP(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function MP(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&BP(t,e)}function OP(t){var e=NP();return function(){var i,n=UP(t);if(e){var r=UP(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return $P(this,i)}}function $P(t,e){return!e||"object"!==LP(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function DP(t){var e="function"==typeof Map?new Map:void 0;return(DP=function(t){if(null===t||(i=t,-1===Function.toString.call(i).indexOf("[native code]")))return t;var i;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return jP(t,arguments,UP(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),BP(n,t)})(t)}function jP(t,e,i){return(jP=NP()?Reflect.construct:function(t,e,i){var n=[null];n.push.apply(n,e);var r=new(Function.bind.apply(t,n));return i&&BP(r,i.prototype),r}).apply(null,arguments)}function NP(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function BP(t,e){return(BP=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function UP(t){return(UP=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var zP=function(t){MP(i,t);var e=OP(i);function i(){return FP(this,i),e.apply(this,arguments)}return i}(DP(Error)),VP=function(t){MP(i,t);var e=OP(i);function i(){return FP(this,i),e.apply(this,arguments)}return i}(zP),GP=function(t){MP(i,t);var e=OP(i);function i(){return FP(this,i),e.apply(this,arguments)}return i}(zP),qP=function(t){MP(i,t);var e=OP(i);function i(){return FP(this,i),e.apply(this,arguments)}return i}(zP),WP=function(t){MP(i,t);var e=OP(i);function i(){return FP(this,i),e.apply(this,arguments)}return i}(zP),KP=function(t){MP(i,t);var e=OP(i);function i(){return FP(this,i),e.apply(this,arguments)}return i}(zP),XP=function(t){MP(i,t);var e=OP(i);function i(){return FP(this,i),e.apply(this,arguments)}return i}(zP);const YP=Sl({mixins:[uu],components:{videoScreen:bP,videoTimeline:RP,sidebar:Rl,sidebarTab:Ll,labelTrees:Qh,settingsTab:hP,annotationsTab:uP,videoLabelsTab:cP},data:function(){return{volumeId:null,videoId:null,videoDuration:0,videoIds:[],videoFileUri:"",shapes:[],canEdit:!1,video:null,labelTrees:[],selectedLabel:null,pendingAnnotation:null,annotations:[],seeking:!1,settings:{annotationOpacity:1,showMinimap:!0,autoplayDraw:0,showLabelTooltip:!1,showMousePosition:!1,playbackRate:1,showProgressIndicator:!0},openTab:"",urlParams:{x:0,y:0,r:0,t:0},initialCurrentTime:0,initialMapCenter:[0,0],initialMapResolution:0,initialFocussedAnnotation:0,annotationFilters:[],activeAnnotationFilter:null,resizingTimeline:!1,timelineOffsetReference:0,timelineHeightReference:0,fixedTimelineOffset:0,currentTimelineOffset:0,errors:{},error:null,user:null,attachingLabel:!1,swappingLabel:!1}},computed:{selectedAnnotations:function(){return this.filteredAnnotations.filter((function(t){return t.isSelected}))},filteredAnnotations:function(){return this.hasActiveAnnotationFilter?this.activeAnnotationFilter.filter(this.annotations):this.annotations},hasActiveAnnotationFilter:function(){return null!==this.activeAnnotationFilter},timelineHeightOffset:function(){return this.fixedTimelineOffset+this.currentTimelineOffset},screenHeightOffset:function(){return-1*this.timelineHeightOffset},classObject:function(){return this.resizingTimeline?"resizing-timeline":""},hasSiblingVideos:function(){return this.videoIds.length>1},hasError:function(){return null!==this.error},hasVideoError:function(){return this.error instanceof zP},errorMessage:function(){if(this.hasVideoError){if(this.error instanceof VP)return"The video has not been processed yet. Please try again later.";if(this.error instanceof GP)return"The video file has not been found. Please check the source.";if(this.error instanceof qP)return"The video MIME type is invalid.";if(this.error instanceof WP)return"The video codec is invalid.";if(this.error instanceof KP)return"The video file is malformed.";if(this.error instanceof XP)return"The video file is too large."}return""},errorClass:function(){return this.hasVideoError?this.error instanceof VP?"panel-warning text-warning":"panel-danger text-danger":""}},methods:{prepareAnnotation:function(t){return new lP({data:t})},setAnnotations:function(t){this.annotations=t[0].body.map(this.prepareAnnotation)},addCreatedAnnotation:function(t){var e=this.prepareAnnotation(t.body);return e.$on("tracking-failed",this.removeAnnotation),this.annotations.push(e),e},seek:function(t){var e=this;if(!this.seeking&&this.video.currentTime!==t){var i=new Vue.Promise((function(t,i){e.video.addEventListener("seeked",t),e.video.addEventListener("error",i)}));return this.seeking=!0,this.video.currentTime=t,i}return Vue.Promise.resolve()},selectAnnotation:function(t,e,i){return this.attachingLabel?(this.attachAnnotationLabel(t),Vue.Promise.resolve()):this.swappingLabel?(this.swapAnnotationLabel(t),Vue.Promise.resolve()):i?this.selectAnnotations([t],[],e):this.selectAnnotations([t],this.selectedAnnotations,e)},selectAnnotations:function(t,e,i){e.forEach((function(t){t.selected=!1}));var n=this.selectedAnnotations.length>0;return t.forEach((function(t){t.selected=i})),void 0!==i&&!1===n?this.seek(i):Vue.Promise.resolve()},deselectAnnotation:function(t){t?t.selected=!1:this.selectedAnnotations.forEach((function(t){t.selected=!1}))},updatePendingAnnotation:function(t){if(t){var e=Object.assign({},t,{shape_id:this.shapes[t.shape],labels:[{label_id:this.selectedLabel.id,label:this.selectedLabel,user:this.user}],pending:!0});this.pendingAnnotation=new lP({data:e})}else this.pendingAnnotation=null},createAnnotation:function(t){var e=this;this.updatePendingAnnotation(t);var i=this.pendingAnnotation;this.annotations.push(i);var n=i.frames.length;this.videoDuration>0&&n>0&&i.frames[n-1]>this.videoDuration&&(i.frames[n-1]=this.videoDuration);var r=Object.assign({},t,{shape_id:this.shapes[t.shape],label_id:this.selectedLabel?this.selectedLabel.id:0});return delete r.shape,cA.save({id:this.videoId},r).then(this.addCreatedAnnotation,su).finally((function(){var t=e.annotations.indexOf(i);-1!==t&&e.annotations.splice(t,1)}))},trackAnnotation:function(t){t.track=!0,this.createAnnotation(t).then(this.startPollTrackingAnnotation)},startPollTrackingAnnotation:function(t){t&&t.startPollTracking()},handleSelectedLabel:function(t){this.selectedLabel=t},handleDeselectedLabel:function(){this.selectedLabel=null},deleteAnnotationsOrKeyframes:function(t){confirm("Are you sure that you want to delete all selected annotations/keyframes?")&&t.forEach(this.deleteAnnotationOrKeyframe)},deleteAnnotationOrKeyframe:function(t){var e=this,i=t.annotation;i.isClip&&i.hasKeyframe(t.time)?i.deleteKeyframe(t.time).catch(su):i.delete().then((function(){return e.removeAnnotation(i)})).catch(su)},handleVideoSeeked:function(){this.seeking=!1},modifyAnnotations:function(t){t.forEach(this.modifyAnnotation)},modifyAnnotation:function(t){t.annotation.modify(t.time,t.points).catch(su)},handleUpdatedSettings:function(t,e){this.settings[t]=e},handleOpenedTab:function(t){lA.set("openTab",t)},handleClosedTab:function(){lA.delete("openTab")},handleToggledTab:function(){this.$refs.videoScreen.updateSize()},removeAnnotation:function(t){var e=this.annotations.indexOf(t);-1!==e&&this.annotations.splice(e,1)},splitAnnotation:function(t,e){t.split(e).then(this.addCreatedAnnotation,su)},linkAnnotations:function(t){var e=this;t[0].link(t[1]).then((function(){return e.removeAnnotation(t[1])})).catch(su)},updateMapUrlParams:function(t,e){this.urlParams.x=Math.round(t[0]),this.urlParams.y=Math.round(t[1]),this.urlParams.r=Math.round(100*e)},updateVideoUrlParams:function(){this.urlParams.t=Math.round(100*this.video.currentTime)},restoreUrlParams:function(){void 0!==tu.get("r")&&(this.initialMapResolution=parseInt(tu.get("r"),10)/100),void 0!==tu.get("x")&&void 0!==tu.get("y")&&(this.initialMapCenter=[parseInt(tu.get("x"),10),parseInt(tu.get("y"),10)]),void 0!==tu.get("t")&&(this.initialCurrentTime=parseInt(tu.get("t"),10)/100),void 0!==tu.get("annotation")&&(this.initialFocussedAnnotation=parseInt(tu.get("annotation"),10))},maybeInitCurrentTime:function(){return 0===this.initialCurrentTime||this.selectedAnnotations.length>0?Vue.Promise.resolve():this.seek(this.initialCurrentTime)},maybeFocusInitialAnnotation:function(){var t=this;if(this.initialFocussedAnnotation){var e=this.annotations.find((function(e){return e.id===t.initialFocussedAnnotation}));if(e)return this.selectAnnotation(e,e.startFrame).then((function(){return t.$refs.videoScreen.focusAnnotation(e)}))}return Vue.Promise.resolve()},detachAnnotationLabel:function(t,e){var i=this;t.labels.length>1?t.detachAnnotationLabel(e).catch(su):confirm("Detaching the last label of an annotation deletes the whole annotation. Do you want to delete the annotation?")&&t.delete().then((function(){return i.removeAnnotation(t)})).catch(su)},attachAnnotationLabel:function(t){var e=t.attachAnnotationLabel(this.selectedLabel);return e.catch(su),e},swapAnnotationLabel:function(t){var e=this,i=t.labels.filter((function(t){return t.user_id===e.user.id})).sort((function(t,e){return t.id-e.id})).pop();this.attachAnnotationLabel(t).then((function(){i&&e.detachAnnotationLabel(t,i)})).catch(su)},initAnnotationFilters:function(){var t={};for(var e in this.shapes)t[this.shapes[e]]=e;this.annotationFilters=[new ZI({data:{annotations:this.annotations}}),new tA({data:{annotations:this.annotations}}),new QI({data:{shapes:t}})]},updateAnnotationFilters:function(){this.annotationFilters[0].annotations=this.annotations,this.annotationFilters[1].annotations=this.annotations},setActiveAnnotationFilter:function(t){this.activeAnnotationFilter=t},resetAnnotationFilter:function(){this.activeAnnotationFilter&&this.activeAnnotationFilter.reset(),this.activeAnnotationFilter=null},handleRequiresSelectedLabel:function(){au.info("Please select a label first."),this.$refs.sidebar.$emit("open","labels")},startUpdateTimelineHeight:function(t){t.preventDefault(),this.resizingTimeline=!0,this.timelineOffsetReference=t.clientY,this.timelineHeightReference=this.$refs.videoTimeline.$el.offsetHeight},updateTimelineHeight:function(t){this.resizingTimeline&&(t.preventDefault(),this.currentTimelineOffset=this.timelineOffsetReference-t.clientY)},finishUpdateTimelineHeight:function(){this.resizingTimeline&&(this.resizingTimeline=!1,this.fixedTimelineOffset=this.fixedTimelineOffset+this.$refs.videoTimeline.$el.offsetHeight-this.timelineHeightReference,this.currentTimelineOffset=0)},handleVideoInformationResponse:function(t){var e=t.body;if(e.error===this.errors["not-found"])throw new GP;if(e.error===this.errors.mimetype)throw new qP;if(e.error===this.errors.codec)throw new WP;if(e.error===this.errors.malformed)throw new KP;if(e.error===this.errors["too-large"])throw new XP;if(null===e.size)throw new VP;return this.error=null,this.videoDuration=e.duration,e},handleVideoError:function(t){t instanceof zP?this.error=t:(this.error=!0,su(t))},fetchVideoContent:function(t){var e=this,i=new Vue.Promise((function(t){e.video.addEventListener("canplay",t)})),n=cA.query({id:t.id}),r=Vue.Promise.all([n,i]).then(this.setAnnotations).then(this.updateAnnotationFilters).then(this.maybeFocusInitialAnnotation).then(this.maybeInitCurrentTime);return this.video.src=this.videoFileUri.replace(":id",t.id),r},loadVideo:function(t){return this.videoId=t,Pl.$emit("video.id",t),tu.setSlug(t,-2),this.startLoading(),Md.get({id:t}).then(this.handleVideoInformationResponse).then(this.fetchVideoContent).catch(this.handleVideoError).finally(this.finishLoading)},showPreviousVideo:function(){this.reset();var t=this.videoIds.length,e=(this.videoIds.indexOf(this.videoId)+t-1)%t;this.loadVideo(this.videoIds[e]).then(this.updateVideoUrlParams)},showNextVideo:function(){this.reset();var t=this.videoIds.length,e=(this.videoIds.indexOf(this.videoId)+t+1)%t;this.loadVideo(this.videoIds[e]).then(this.updateVideoUrlParams)},reset:function(){this.annotations=[],this.seeking=!1,this.initialCurrentTime=0,this.initialFocussedAnnotation=0,this.$refs.videoTimeline.reset(),this.$refs.videoScreen.reset()},initVideoIds:function(t){var e=window.localStorage.getItem("biigle.volumes.".concat(this.volumeId,".files"));if(e){var i={};return t.forEach((function(t){i[t]=null})),JSON.parse(e).filter((function(t){return i.hasOwnProperty(t)}))}return t},handleAttachingLabelActive:function(t){this.swappingLabel=!1,this.attachingLabel=t},handleSwappingLabelActive:function(t){this.attachingLabel=!1,this.swappingLabel=t}},watch:{"settings.playbackRate":function(t){this.video.playbackRate=t},urlParams:{deep:!0,handler:function(t){tu.set(t)}}},created:function(){var t=biigle.$require("videos.shapes"),e={};Object.keys(t).forEach((function(i){e[t[i]]=parseInt(i)})),this.shapes=e,this.video=document.createElement("video"),this.videoId=biigle.$require("videos.id"),this.volumeId=biigle.$require("videos.volumeId"),this.videoIds=this.initVideoIds(biigle.$require("videos.videoIds")),this.videoFileUri=biigle.$require("videos.videoFileUri"),this.canEdit=biigle.$require("videos.isEditor"),this.labelTrees=biigle.$require("videos.labelTrees"),this.errors=biigle.$require("videos.errors"),this.user=biigle.$require("videos.user"),this.initAnnotationFilters(),this.restoreUrlParams(),this.video.muted=!0,this.video.addEventListener("error",(function(t){t.target.error.code===MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED?t.target.error.message.startsWith("404")||t.target.error.message.startsWith("403")?au.danger("Unable to access the video file."):au.danger("The video codec is not supported by your browser."):t.target.error.code!==MediaError.MEDIA_ERR_ABORTED&&au.danger("Error while loading video file.")})),this.video.addEventListener("seeked",this.handleVideoSeeked),this.video.addEventListener("pause",this.updateVideoUrlParams),this.video.addEventListener("seeked",this.updateVideoUrlParams),lA.has("openTab")&&(this.openTab=lA.get("openTab"))},mounted:function(){this.loadVideo(this.videoId)}},undefined,undefined,!1,null,null,null).exports;biigle.$mount("search-results",hA),biigle.$mount("video-annotations-navbar",uA),biigle.$mount("video-container",YP)},276:()=>{var t=new Date(0);Vue.filter("videoTime",(function(e){return t.setTime(1e3*e),t.toISOString().split("T")[1].slice(0,-2)}))},924:(t,e,i)=>{"use strict";var n=i(210),r=i(559),o=r(n("String.prototype.indexOf"));t.exports=function(t,e){var i=n(t,!!e);return"function"==typeof i&&o(t,".prototype.")>-1?r(i):i}},559:(t,e,i)=>{"use strict";var n=i(612),r=i(210),o=r("%Function.prototype.apply%"),s=r("%Function.prototype.call%"),a=r("%Reflect.apply%",!0)||n.call(s,o),l=r("%Object.getOwnPropertyDescriptor%",!0),u=r("%Object.defineProperty%",!0),h=r("%Math.max%");if(u)try{u({},"a",{value:1})}catch(t){u=null}t.exports=function(t){var e=a(n,s,arguments);if(l&&u){var i=l(e,"length");i.configurable&&u(e,"length",{value:1+h(0,t.length-(arguments.length-1))})}return e};var c=function(){return a(n,o,arguments)};u?u(t.exports,"apply",{value:c}):t.exports.apply=c},442:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>o});var n=i(645),r=i.n(n)()((function(t){return t[1]}));r.push([t.id,'.ol-box{box-sizing:border-box;border-radius:2px;border:2px solid #00f}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:rgba(0,60,136,.3);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid #eee;border-top:none;color:#eee;font-size:10px;text-align:center;margin:1px;will-change:contents,width}.ol-overlay-container{will-change:left,right,top,bottom}.ol-unsupported{display:none}.ol-unselectable,.ol-viewport{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:grab}.ol-control{position:absolute;background-color:hsla(0,0%,100%,.4);border-radius:4px;padding:2px}.ol-control:hover{background-color:hsla(0,0%,100%,.6)}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}@media print{.ol-control{display:none}}.ol-control button{display:block;margin:1px;padding:0;color:#fff;font-size:1.14em;font-weight:700;text-decoration:none;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:rgba(0,60,136,.5);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;font-size:1.2em;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:focus,.ol-control button:hover{text-decoration:none;background-color:rgba(0,60,136,.7)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em)}.ol-attribution ul{margin:0;padding:0 .5em;font-size:.7rem;line-height:1.375em;color:#000;text-shadow:0 0 2px #fff}.ol-attribution li{display:inline;list-style:none;line-height:inherit}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button,.ol-attribution ul{display:inline-block}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:hsla(0,0%,100%,.8)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0;height:1.1em;line-height:1em}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:inline-block}.ol-overviewmap .ol-overviewmap-map{border:1px solid #7b98bc;height:150px;margin:2px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:1px;left:2px;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:hsla(0,0%,100%,.8)}.ol-overviewmap-box{border:2px dotted rgba(0,60,136,.7)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}',""]);const o=r},645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i=t(e);return e[2]?"@media ".concat(e[2]," {").concat(i,"}"):i})).join("")},e.i=function(t,i,n){"string"==typeof t&&(t=[[null,t,""]]);var r={};if(n)for(var o=0;o{var n=i(215),r=i(584),o=i(609),s=i(420),a=i(847),l=i(923),u=Date.prototype.getTime;function h(t,e,i){var f=i||{};return!!(f.strict?o(t,e):t===e)||(!t||!e||"object"!=typeof t&&"object"!=typeof e?f.strict?o(t,e):t==e:function(t,e,i){var o,f;if(typeof t!=typeof e)return!1;if(c(t)||c(e))return!1;if(t.prototype!==e.prototype)return!1;if(r(t)!==r(e))return!1;var p=s(t),g=s(e);if(p!==g)return!1;if(p||g)return t.source===e.source&&a(t)===a(e);if(l(t)&&l(e))return u.call(t)===u.call(e);var m=d(t),v=d(e);if(m!==v)return!1;if(m||v){if(t.length!==e.length)return!1;for(o=0;o=0;o--)if(y[o]!=_[o])return!1;for(o=y.length-1;o>=0;o--)if(!h(t[f=y[o]],e[f],i))return!1;return!0}(t,e,f))}function c(t){return null==t}function d(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}t.exports=h},289:(t,e,i)=>{"use strict";var n=i(215),r="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=Object.defineProperty,l=a&&function(){var t={};try{for(var e in a(t,"x",{enumerable:!1,value:t}),t)return!1;return t.x===t}catch(t){return!1}}(),u=function(t,e,i,n){var r;(!(e in t)||"function"==typeof(r=n)&&"[object Function]"===o.call(r)&&n())&&(l?a(t,e,{configurable:!0,enumerable:!1,value:i,writable:!0}):t[e]=i)},h=function(t,e){var i=arguments.length>2?arguments[2]:{},o=n(e);r&&(o=s.call(o,Object.getOwnPropertySymbols(e)));for(var a=0;a{"use strict";var e="Function.prototype.bind called on incompatible ",i=Array.prototype.slice,n=Object.prototype.toString,r="[object Function]";t.exports=function(t){var o=this;if("function"!=typeof o||n.call(o)!==r)throw new TypeError(e+o);for(var s,a=i.call(arguments,1),l=function(){if(this instanceof s){var e=o.apply(this,a.concat(i.call(arguments)));return Object(e)===e?e:this}return o.apply(t,a.concat(i.call(arguments)))},u=Math.max(0,o.length-a.length),h=[],c=0;c{"use strict";var n=i(648);t.exports=Function.prototype.bind||n},657:(t,e,i)=>{var n=i(251),r=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=!(!t||!t.direction)&&t.direction,this.pseudoNode=!(!t||!t.pseudoNode)&&t.pseudoNode,this.objectComparator=t&&t.objectComparator?t.objectComparator:a};function o(t){return t.coordinates.map((function(e){return{type:t.type.replace("Multi",""),coordinates:e}}))}function s(t,e){return t.hasOwnProperty("coordinates")?t.coordinates.length===e.coordinates.length:t.length===e.length}function a(t,e){return n(t,e,{strict:!0})}r.prototype.compare=function(t,e){if(t.type!==e.type||!s(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,e);case"Feature":return this.compareFeature(t,e);default:if(0===t.type.indexOf("Multi")){var i=this,n=o(t),r=o(e);return n.every((function(t){return this.some((function(e){return i.compare(t,e)}))}),r)}}return!1},r.prototype.compareCoord=function(t,e){if(t.length!==e.length)return!1;for(var i=0;i=0&&(i=[].concat(t.slice(n,t.length),t.slice(1,n+1))),i},r.prototype.comparePath=function(t,e){var i=this;return t.every((function(t,e){return i.compareCoord(t,this[e])}),e)},r.prototype.comparePolygon=function(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var i=t.coordinates.slice(1,t.coordinates.length),n=e.coordinates.slice(1,e.coordinates.length),r=this;return i.every((function(t){return this.some((function(e){return r.compareLine(t,e,1,!0)}))}),n)}return!1},r.prototype.compareFeature=function(t,e){return!(t.id!==e.id||!this.objectComparator(t.properties,e.properties)||!this.compareBBox(t,e))&&this.compare(t.geometry,e.geometry)},r.prototype.compareBBox=function(t,e){return!!(!t.bbox&&!e.bbox||t.bbox&&e.bbox&&this.compareCoord(t.bbox,e.bbox))},r.prototype.removePseudo=function(t){return t},t.exports=r},787:(t,e,i)=>{var n=i(510),r=i(102),o=i(540),s=i(705).Z,a=o.featureEach,l=(o.coordEach,r.polygon,r.featureCollection);function u(t){var e=n(t);return e.insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:s(t),n.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:s(t),e.push(t)})):a(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:s(t),e.push(t)})),n.prototype.load.call(this,e)},e.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:s(t),n.prototype.remove.call(this,t,e)},e.clear=function(){return n.prototype.clear.call(this)},e.search=function(t){var e=n.prototype.search.call(this,this.toBBox(t));return l(e)},e.collides=function(t){return n.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=n.prototype.all.call(this);return l(t)},e.toJSON=function(){return n.prototype.toJSON.call(this)},e.fromJSON=function(t){return n.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else if("Feature"===t.type)e=s(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");e=s(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}t.exports=u,t.exports.default=u},210:(t,e,i)=>{"use strict";var n,r=SyntaxError,o=Function,s=TypeError,a=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},l=Object.getOwnPropertyDescriptor;if(l)try{l({},"")}catch(t){l=null}var u=function(){throw new s},h=l?function(){try{return u}catch(t){try{return l(arguments,"callee").get}catch(t){return u}}}():u,c=i(405)(),d=Object.getPrototypeOf||function(t){return t.__proto__},f={},p="undefined"==typeof Uint8Array?n:d(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":c?d([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":c?d(d([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&c?d((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&c?d((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":c?d(""[Symbol.iterator]()):n,"%Symbol%":c?Symbol:n,"%SyntaxError%":r,"%ThrowTypeError%":h,"%TypedArray%":p,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},m=function t(e){var i;if("%AsyncFunction%"===e)i=a("async function () {}");else if("%GeneratorFunction%"===e)i=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)i=a("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(i=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var r=t("%AsyncGenerator%");r&&(i=d(r.prototype))}return g[e]=i,i},v={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},y=i(612),_=i(642),b=y.call(Function.call,Array.prototype.concat),w=y.call(Function.apply,Array.prototype.splice),x=y.call(Function.call,String.prototype.replace),S=y.call(Function.call,String.prototype.slice),C=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,T=/\\(\\)?/g,E=function(t){var e=S(t,0,1),i=S(t,-1);if("%"===e&&"%"!==i)throw new r("invalid intrinsic syntax, expected closing `%`");if("%"===i&&"%"!==e)throw new r("invalid intrinsic syntax, expected opening `%`");var n=[];return x(t,C,(function(t,e,i,r){n[n.length]=i?x(r,T,"$1"):e||t})),n},I=function(t,e){var i,n=t;if(_(v,n)&&(n="%"+(i=v[n])[0]+"%"),_(g,n)){var o=g[n];if(o===f&&(o=m(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new r("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');var i=E(t),n=i.length>0?i[0]:"",o=I("%"+n+"%",e),a=o.name,u=o.value,h=!1,c=o.alias;c&&(n=c[0],w(i,b([0,1],c)));for(var d=1,f=!0;d=i.length){var y=l(u,p);u=(f=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:u[p]}else f=_(u,p),u=u[p];f&&!h&&(g[a]=u)}}return u}},405:(t,e,i)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,r=i(419);t.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&r())))}},419:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),i=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(i))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var r=Object.getOwnPropertyDescriptor(t,e);if(42!==r.value||!0!==r.enumerable)return!1}return!0}},642:(t,e,i)=>{"use strict";var n=i(612);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},584:(t,e,i)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,r=i(924)("Object.prototype.toString"),o=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===r(t)},s=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==r(t)&&"[object Function]"===r(t.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,t.exports=a?o:s},923:t=>{"use strict";var e=Date.prototype.getDay,i=Object.prototype.toString,n="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){return"object"==typeof t&&null!==t&&(n?function(t){try{return e.call(t),!0}catch(t){return!1}}(t):"[object Date]"===i.call(t))}},420:(t,e,i)=>{"use strict";var n,r,o,s,a=i(924),l=i(405)()&&"symbol"==typeof Symbol.toStringTag;if(l){n=a("Object.prototype.hasOwnProperty"),r=a("RegExp.prototype.exec"),o={};var u=function(){throw o};s={toString:u,valueOf:u},"symbol"==typeof Symbol.toPrimitive&&(s[Symbol.toPrimitive]=u)}var h=a("Object.prototype.toString"),c=Object.getOwnPropertyDescriptor;t.exports=l?function(t){if(!t||"object"!=typeof t)return!1;var e=c(t,"lastIndex");if(!(e&&n(e,"value")))return!1;try{r(t,s)}catch(t){return t===o}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===h(t)}},252:(t,e,i)=>{t=i.nmd(t);var n,r=((n={}).floodFill=function(t,e,i,n,r,o){return o?function(t,e,i,n,r){var o,s,a,l,u,h,c,d,f,p,g=t.data,m=t.width,v=t.height,y=t.bytes,_=-1,b=m+1,w=-1,x=v+1,S=i*m+e,C=new Uint8Array(m*v),T=new Uint8Array(r||m*v);if(1===T[S])return null;var E=[g[S*=y],g[S+1],g[S+2],g[S+3]],I=[{y:i,left:e-1,right:e+1,dir:1}];do{for(p=!1,s=(l=I.shift()).left+1;sn||o<-n||(o=g[S+1]-E[1])>n||o<-n||(o=g[S+2]-E[2])>n||o<-n))){for(h=s-1;h>-1&&(S=(d=c+h)*y,1!==T[d])&&(C[d]=1,T[d]=1,h--,!((o=g[S]-E[0])>n||o<-n))&&!((o=g[S+1]-E[1])>n||o<-n)&&!((o=g[S+2]-E[2])>n||o<-n););for(u=s+1;un||o<-n))&&!((o=g[S+1]-E[1])>n||o<-n)&&!((o=g[S+2]-E[2])>n||o<-n););h_&&(_=u-1),(a=l.y-l.dir)>=0&&a=0&&aw&&(w=l.y))}while(I.length>0);return{data:C,width:t.width,height:t.height,bounds:{minX:b,minY:x,maxX:_,maxY:w}}}(t,e,i,n,r):function(t,e,i,n,r){var o,s,a,l,u,h,c,d,f,p,g=t.data,m=t.width,v=t.height,y=t.bytes,_=-1,b=m+1,w=-1,x=v+1,S=i*m+e,C=new Uint8Array(m*v),T=new Uint8Array(r||m*v);if(1===T[S])return null;var E=[g[S*=y],g[S+1],g[S+2],g[S+3]],I=[{y:i,left:e-1,right:e+1,dir:1}];do{for(p=!1,s=(l=I.shift()).left+1;sn||o<-n||(o=g[S+1]-E[1])>n||o<-n||(o=g[S+2]-E[2])>n||o<-n)){for(p=!0,C[c+s]=1,T[c+s]=1,h=s-1;h>-1&&(S=(d=c+h)*y,1!==T[d])&&!((o=g[S]-E[0])>n||o<-n)&&!((o=g[S+1]-E[1])>n||o<-n)&&!((o=g[S+2]-E[2])>n||o<-n);)C[d]=1,T[d]=1,h--;for(u=s+1;un||o<-n)&&!((o=g[S+1]-E[1])>n||o<-n)&&!((o=g[S+2]-E[2])>n||o<-n);)C[f]=1,T[f]=1,u++;h_&&(_=u-1),(a=l.y-l.dir)>=0&&a=0&&aw&&(w=l.y))}while(I.length>0);return{data:C,width:t.width,height:t.height,bounds:{minX:b,minY:x,maxX:_,maxY:w}}}(t,e,i,n,r)},n.gaussBlur=function(t,e){var i,n,r,o,s,a,l,u=2*e+1,h=e*e,c=new Float32Array(u),d=0,f=t.width,p=t.height,g=t.data,m=t.bounds.minX,v=t.bounds.maxX,y=t.bounds.minY,_=t.bounds.maxY;for(i=0;i0?e-o:0;i0?e-s:0;i.5?1:0}return{data:x,width:f,height:p,bounds:{minX:m,minY:y,maxX:v,maxY:_}}},n.gaussBlurOnlyBorder=function(t,e,i){var n,r,o,s,a,l,u,h,c,d,f=function(t,e,i){var n,r,o,s,a,l,u,h=t.width,c=t.height,d=t.data,f=new Uint8Array(d),p=t.bounds.minX,g=t.bounds.maxX,m=t.bounds.minY,v=t.bounds.maxY,y=h*c,_=new Uint8Array(y),b=[],w=Math.max(p,1),x=Math.min(g,h-2),S=Math.max(m,1),C=Math.min(v,c-2);if(i&&i.length>0)for(a=0;a0?e-n:0;r0?e-s:0;r0?e-u:0;s.5)E[a]=1,ux&&(x=u),hC&&(C=h);else{for(d=A-h0?e-h:0;s.5?(E[a]=1,ux&&(x=u),hC&&(C=h)):E[a]=0}}return{data:E,width:y,height:_,bounds:{minX:w,minY:S,maxX:x,maxY:C}}},n.createBorderMask=function(t){var e,i,n,r,o,s=t.width,a=t.height,l=t.data,u=t.bounds.minX,h=t.bounds.maxX,c=t.bounds.minY,d=t.bounds.maxY,f=h-u+1,p=d-c+1,g=new Uint8Array(f*p),m=Math.max(u,1),v=Math.min(h,s-2),y=Math.max(c,1),_=Math.min(d,a-2);for(i=y;i<_+1;i++)for(e=m;e=Math.sqrt(v*v+y*y)?v:v>=Math.sqrt(m*m+y*y)?m:Math.abs((b*w.x-_*w.y+x.x*S.y-S.x*x.y)/y))>f&&(p=n,f=g);f>e&&(h.push(p),c.push({first:d.first,last:p}),c.push({first:p,last:d.last}))}}while(c.length>0);for(u=[],l=h.length,h.sort((function(t,e){return t-e})),o=0;oe?1:t0){var a=n+Math.floor(s/2),l={key:e[a],data:i[a],parent:t};return l.left=r(l,e,i,n,a),l.right=r(l,e,i,a+1,o),l}return null}function o(t,e,i,n,r){if(!(i>=n)){for(var s=t[i+n>>1],a=i-1,l=n+1;;){do{a++}while(r(t[a],s)<0);do{l--}while(r(t[l],s)>0);if(a>=l)break;var u=t[a];t[a]=t[l],t[l]=u,u=e[a],e[a]=e[l],e[l]=u}o(t,e,i,l,r),o(t,e,l+1,n,r)}}i.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},i.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},i.prototype._splay=function(t){for(;t.parent;){var e=t.parent;e.parent?e.left===t&&e.parent.left===e?(this.rotateRight(e.parent),this.rotateRight(e)):e.right===t&&e.parent.right===e?(this.rotateLeft(e.parent),this.rotateLeft(e)):e.left===t&&e.parent.right===e?(this.rotateRight(e),this.rotateLeft(e)):(this.rotateLeft(e),this.rotateRight(e)):e.left===t?this.rotateRight(e):this.rotateLeft(e)}},i.prototype.splay=function(t){for(var e,i,n,r,o;t.parent;)(i=(e=t.parent).parent)&&i.parent?((n=i.parent).left===i?n.left=t:n.right=t,t.parent=n):(t.parent=null,this._root=t),r=t.left,o=t.right,t===e.left?(i&&(i.left===e?(e.right?(i.left=e.right,i.left.parent=i):i.left=null,e.right=i,i.parent=e):(r?(i.right=r,r.parent=i):i.right=null,t.left=i,i.parent=t)),o?(e.left=o,o.parent=e):e.left=null,t.right=e,e.parent=t):(i&&(i.right===e?(e.left?(i.right=e.left,i.right.parent=i):i.right=null,e.left=i,i.parent=e):(o?(i.left=o,o.parent=i):i.left=null,t.right=i,i.parent=t)),r?(e.right=r,r.parent=e):e.right=null,t.left=e,e.parent=t)},i.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)},i.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},i.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},i.prototype.insert=function(t,e){var i=this._root,n=null,r=this._compare;if(this._noDuplicates)for(;i;){if(n=i,0===r(i.key,t))return;i=r(i.key,t)<0?i.right:i.left}else for(;i;)n=i,i=r(i.key,t)<0?i.right:i.left;return i={key:t,data:e,left:null,right:null,parent:n},n?r(n.key,i.key)<0?n.right=i:n.left=i:this._root=i,this.splay(i),this._size++,i},i.prototype.find=function(t){for(var e=this._root,i=this._compare;e;){var n=i(e.key,t);if(n<0)e=e.right;else{if(!(n>0))return e;e=e.left}}return null},i.prototype.contains=function(t){for(var e=this._root,i=this._compare;e;){var n=i(t,e.key);if(0===n)return!0;e=n<0?e.left:e.right}return!1},i.prototype.remove=function(t){var e=this.find(t);if(!e)return!1;if(this.splay(e),e.left)if(e.right){var i=this.minNode(e.right);i.parent!==e&&(this.replace(i,i.right),i.right=e.right,i.right.parent=i),this.replace(e,i),i.left=e.left,i.left.parent=i}else this.replace(e,e.left);else this.replace(e,e.right);return this._size--,!0},i.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},i.prototype.erase=function(t){var e=this.find(t);if(e){this.splay(e);var i=e.left,n=e.right,r=null;i&&(i.parent=null,r=this.maxNode(i),this.splay(r),this._root=r),n&&(i?r.right=n:this._root=n,n.parent=r),this._size--}},i.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},i.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;)t=e,e=e.parent;return e},i.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;)t=e,e=e.parent;return e},i.prototype.forEach=function(t){for(var e=this._root,i=[],n=!1,r=0;!n;)e?(i.push(e),e=e.left):i.length>0?(t(e=i.pop(),r++),e=e.right):n=!0;return this},i.prototype.range=function(t,e,i,n){for(var r=[],o=this._compare,s=this._root;0!==r.length||s;)if(s)r.push(s),s=s.left;else{if(o((s=r.pop()).key,e)>0)break;if(o(s.key,t)>=0&&i.call(n,s))return this;s=s.right}return this},i.prototype.keys=function(){for(var t=this._root,e=[],i=[],n=!1;!n;)t?(e.push(t),t=t.left):e.length>0?(t=e.pop(),i.push(t.key),t=t.right):n=!0;return i},i.prototype.values=function(){for(var t=this._root,e=[],i=[],n=!1;!n;)t?(e.push(t),t=t.left):e.length>0?(t=e.pop(),i.push(t.data),t=t.right):n=!0;return i},i.prototype.at=function(t){for(var e=this._root,i=[],n=!1,r=0;!n;)if(e)i.push(e),e=e.left;else if(i.length>0){if(e=i.pop(),r===t)return e;r++,e=e.right}else n=!0;return null},i.prototype.load=function(t,e,i){if(void 0===t&&(t=[]),void 0===e&&(e=[]),void 0===i&&(i=!1),0!==this._size)throw new Error("bulk-load: tree is not empty");var n=t.length;return i&&o(t,e,0,n-1,this._compare),this._root=r(null,t,e,0,n),this._size=n,this},i.prototype.min=function(){var t=this.minNode(this._root);return t?t.key:null},i.prototype.max=function(){var t=this.maxNode(this._root);return t?t.key:null},i.prototype.isEmpty=function(){return null===this._root},n.size.get=function(){return this._size},i.createTree=function(t,e,n,r,o){return new i(n,o).load(t,e,r)},Object.defineProperties(i.prototype,n);var s=0,a=1,l=2,u=3,h=0,c=1,d=2,f=3;function p(t,e,i){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=!g(e,i)||e.isVertical()?e.prevInResult:e));var n=g(t,i);t.resultTransition=n?m(t,i):0}function g(t,e){switch(t.type){case s:switch(e){case h:return!t.otherInOut;case c:return t.otherInOut;case d:return t.isSubject&&t.otherInOut||!t.isSubject&&!t.otherInOut;case f:return!0}break;case l:return e===h||e===c;case u:return e===d;case a:return!1}return!1}function m(t,e){var i,n=!t.inOut,r=!t.otherInOut;switch(e){case h:i=n&&r;break;case c:i=n||r;break;case f:i=n^r;break;case d:i=t.isSubject?n&&!r:r&&!n}return i?1:-1}var v=function(t,e,i,n,r){this.left=e,this.point=t,this.otherEvent=i,this.isSubject=n,this.type=r||s,this.inOut=!1,this.otherInOut=!1,this.prevInResult=null,this.resultTransition=0,this.otherPos=-1,this.outputContourId=-1,this.isExteriorRing=!0},y={inResult:{configurable:!0}};function _(t,e){return t[0]===e[0]&&t[1]===e[1]}v.prototype.isBelow=function(t){var e=this.point,i=this.otherEvent.point;return this.left?(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])>0:(i[0]-t[0])*(e[1]-t[1])-(e[0]-t[0])*(i[1]-t[1])>0},v.prototype.isAbove=function(t){return!this.isBelow(t)},v.prototype.isVertical=function(){return this.point[0]===this.otherEvent.point[0]},y.inResult.get=function(){return 0!==this.resultTransition},v.prototype.clone=function(){var t=new v(this.point,this.left,this.otherEvent,this.isSubject,this.type);return t.contourId=this.contourId,t.resultTransition=this.resultTransition,t.prevInResult=this.prevInResult,t.isExteriorRing=this.isExteriorRing,t.inOut=this.inOut,t.otherInOut=this.otherInOut,t},Object.defineProperties(v.prototype,y);var b=11102230246251565e-32,w=134217729,x=(3+8*b)*b;function S(t,e,i,n,r){var o,s,a,l,u=e[0],h=n[0],c=0,d=0;h>u==h>-u?(o=u,u=e[++c]):(o=h,h=n[++d]);var f=0;if(cu==h>-u?(a=o-((s=u+o)-u),u=e[++c]):(a=o-((s=h+o)-h),h=n[++d]),o=s,0!==a&&(r[f++]=a);cu==h>-u?(a=o-((s=o+u)-(l=s-o))+(u-l),u=e[++c]):(a=o-((s=o+h)-(l=s-o))+(h-l),h=n[++d]),o=s,0!==a&&(r[f++]=a);for(;c=U||-B>=U)return B;if(a=t-($+(c=t-$))+(c-r),u=i-(D+(c=i-D))+(c-r),l=e-(j+(c=e-j))+(c-o),h=n-(N+(c=n-N))+(c-o),0===a&&0===l&&0===u&&0===h)return B;if(U=A*s+x*Math.abs(B),(B+=$*h+N*a-(j*u+D*l))>=U||-B>=U)return B;c=(T=(p=a-(f=(d=w*a)-(d-a)))*(m=N-(g=(d=w*N)-(d-N)))-((b=a*N)-f*g-p*g-f*m))-(v=T-(M=(p=l-(f=(d=w*l)-(d-l)))*(m=D-(g=(d=w*D)-(d-D)))-((E=l*D)-f*g-p*g-f*m))),F[0]=T-(v+c)+(c-M),c=(_=b-((y=b+v)-(c=y-b))+(v-c))-(v=_-E),F[1]=_-(v+c)+(c-E),c=(O=y+v)-y,F[2]=y-(O-c)+(v-c),F[3]=O;var z=S(4,P,4,F,k);c=(T=(p=$-(f=(d=w*$)-(d-$)))*(m=h-(g=(d=w*h)-(d-h)))-((b=$*h)-f*g-p*g-f*m))-(v=T-(M=(p=j-(f=(d=w*j)-(d-j)))*(m=u-(g=(d=w*u)-(d-u)))-((E=j*u)-f*g-p*g-f*m))),F[0]=T-(v+c)+(c-M),c=(_=b-((y=b+v)-(c=y-b))+(v-c))-(v=_-E),F[1]=_-(v+c)+(c-E),c=(O=y+v)-y,F[2]=y-(O-c)+(v-c),F[3]=O;var V=S(z,k,4,F,R);c=(T=(p=a-(f=(d=w*a)-(d-a)))*(m=h-(g=(d=w*h)-(d-h)))-((b=a*h)-f*g-p*g-f*m))-(v=T-(M=(p=l-(f=(d=w*l)-(d-l)))*(m=u-(g=(d=w*u)-(d-u)))-((E=l*u)-f*g-p*g-f*m))),F[0]=T-(v+c)+(c-M),c=(_=b-((y=b+v)-(c=y-b))+(v-c))-(v=_-E),F[1]=_-(v+c)+(c-E),c=(O=y+v)-y,F[2]=y-(O-c)+(v-c),F[3]=O;var G=S(V,R,4,F,L);return L[G-1]}function O(t,e,i,n,r,o){var s=(e-o)*(i-r),a=(t-r)*(n-o),l=s-a;if(0===s||0===a||s>0!=a>0)return l;var u=Math.abs(s+a);return Math.abs(l)>=E*u?l:-M(t,e,i,n,r,o,u)}function $(t,e,i){var n=O(t[0],t[1],e[0],e[1],i[0],i[1]);return n>0?-1:n<0?1:0}function D(t,e){var i=t.point,n=e.point;return i[0]>n[0]?1:i[0]n[1]?1:-1:j(t,e,i)}function j(t,e,i,n){return t.left!==e.left?t.left?1:-1:0!==$(i,t.otherEvent.point,e.otherEvent.point)?t.isBelow(e.otherEvent.point)?-1:1:!t.isSubject&&e.isSubject?1:-1}function N(t,e,i){var n=new v(e,!1,t,t.isSubject),r=new v(e,!0,t.otherEvent,t.isSubject);return _(t.point,t.otherEvent.point)&&console.warn("what is that, a collapsed segment?",t),n.contourId=r.contourId=t.contourId,D(r,t.otherEvent)>0&&(t.otherEvent.left=!0,r.left=!1),t.otherEvent.otherEvent=r,t.otherEvent=n,i.push(r),i.push(n),i}function B(t,e){return t[0]*e[1]-t[1]*e[0]}function U(t,e){return t[0]*e[0]+t[1]*e[1]}function z(t,e,i,n,r){var o=[e[0]-t[0],e[1]-t[1]],s=[n[0]-i[0],n[1]-i[1]];function a(t,e,i){return[t[0]+e*i[0],t[1]+e*i[1]]}var l=[i[0]-t[0],i[1]-t[1]],u=B(o,s),h=u*u,c=U(o,o);if(h>0){var d=B(l,s)/u;if(d<0||d>1)return null;var f=B(l,o)/u;return f<0||f>1?null:0===d||1===d?r?null:[a(t,d,o)]:0===f||1===f?r?null:[a(i,f,s)]:[a(t,d,o)]}if((h=(u=B(l,o))*u)>0)return null;var p=U(o,l)/c,g=p+U(o,s)/c,m=Math.min(p,g),v=Math.max(p,g);return m<=1&&v>=0?1===m?r?null:[a(t,m>0?m:0,o)]:0===v?r?null:[a(t,v<1?v:1,o)]:r&&0===m&&1===v?null:[a(t,m>0?m:0,o),a(t,v<1?v:1,o)]:null}function V(t,e,i){var n=z(t.point,t.otherEvent.point,e.point,e.otherEvent.point),r=n?n.length:0;if(0===r)return 0;if(1===r&&(_(t.point,e.point)||_(t.otherEvent.point,e.otherEvent.point)))return 0;if(2===r&&t.isSubject===e.isSubject)return 0;if(1===r)return _(t.point,n[0])||_(t.otherEvent.point,n[0])||N(t,n[0],i),_(e.point,n[0])||_(e.otherEvent.point,n[0])||N(e,n[0],i),1;var o=[],s=!1,h=!1;return _(t.point,e.point)?s=!0:1===D(t,e)?o.push(e,t):o.push(t,e),_(t.otherEvent.point,e.otherEvent.point)?h=!0:1===D(t.otherEvent,e.otherEvent)?o.push(e.otherEvent,t.otherEvent):o.push(t.otherEvent,e.otherEvent),s&&h||s?(e.type=a,t.type=e.inOut===t.inOut?l:u,s&&!h&&N(o[1].otherEvent,o[0].point,i),2):h?(N(o[0],o[1].point,i),3):o[0]!==o[3].otherEvent?(N(o[0],o[1].point,i),N(o[1],o[2].point,i),3):(N(o[0],o[1].point,i),N(o[3].otherEvent,o[2].point,i),3)}function G(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 _(t.point,e.point)?t.isBelow(e.otherEvent.point)?-1:1:t.point[0]===e.point[0]?t.point[1]e.contourId?1:-1):1===D(t,e)?1:-1}function q(t,e,n,r,o,s){for(var a,l,u,c=new i(G),f=[],g=Math.min(r[2],o[2]);0!==t.length;){var m=t.pop();if(f.push(m),s===h&&m.point[0]>g||s===d&&m.point[0]>r[2])break;if(m.left){l=a=c.insert(m),a=a!==(u=c.minNode())?c.prev(a):null,l=c.next(l);var v=a?a.key:null;if(p(m,v,s),l&&2===V(m,l.key,t)&&(p(m,v,s),p(m,l.key,s)),a&&2===V(a.key,m,t)){var y=a;p(v,(y=y!==u?c.prev(y):null)?y.key:null,s),p(m,v,s)}}else m=m.otherEvent,l=a=c.find(m),a&&l&&(a=a!==u?c.prev(a):null,l=c.next(l),c.remove(m),l&&a&&V(a.key,l.key,t))}return f}var W=function(){this.points=[],this.holeIds=[],this.holeOf=null,this.depth=null};function K(t){var e,i,n,r,o=[];for(i=0,n=t.length;in;)o--;return o}function Y(t,e,i){var n=new W;if(null!=t.prevInResult){var r=t.prevInResult,o=r.outputContourId;if(r.resultTransition>0){var s=e[o];if(null!=s.holeOf){var a=s.holeOf;e[a].holeIds.push(i),n.holeOf=a,n.depth=e[o].depth}else e[o].holeIds.push(i),n.holeOf=o,n.depth=e[o].depth+1}else n.holeOf=null,n.depth=e[o].depth}else n.holeOf=null,n.depth=0;return n}function H(t){var e,i,n=K(t),r={},o=[],s=function(){if(!r[e]){var t=o.length,i=Y(n[e],o,t),s=function(e){r[e]=!0,n[e].outputContourId=t},a=e,l=e,u=n[e].point;for(i.points.push(u);s(a),s(a=n[a].otherPos),i.points.push(n[a].point),(a=X(a,n,r,l))!=l;);o.push(i)}};for(e=0,i=n.length;e0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)}function tt(t,e){return te?1:0}Q.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--,this.length>0&&(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,i=this.compare,n=e[t];t>0;){var r=t-1>>1,o=e[r];if(i(n,o)>=0)break;e[t]=o,t=r}e[t]=n},_down:function(t){for(var e=this.data,i=this.compare,n=this.length>>1,r=e[t];t=0)break;e[t]=a,t=o}e[t]=r}},Z.default=J;var et=Math.max,it=Math.min,nt=0;function rt(t,e,i,n,r,o){var s,a,l,u,h,c;for(s=0,a=t.length-1;s0?c.left=!0:h.left=!0;var d=l[0],f=l[1];r[0]=it(r[0],d),r[1]=it(r[1],f),r[2]=et(r[2],d),r[3]=et(r[3],f),n.push(h),n.push(c)}}function ot(t,e,i,n,r){var o,s,a,l,u,h,c=new Z(null,D);for(a=0,l=t.length;an[2]||n[0]>i[2]||i[1]>n[3]||n[1]>i[3])&&(r===h?o=st:r===d?o=t:r!==c&&r!==f||(o=t.concat(e))),o}function ut(t,e,i){"number"==typeof t[0][0][0]&&(t=[t]),"number"==typeof e[0][0][0]&&(e=[e]);var n=at(t,e,i);if(n)return n===st?null:n;var r=[1/0,1/0,-1/0,-1/0],o=[1/0,1/0,-1/0,-1/0],s=ot(t,e,r,o,i);if(n=lt(t,e,r,o,i))return n===st?null:n;for(var a=H(q(s,t,e,r,o,i)),l=[],u=0;u{},244:t=>{"use strict";var e=function(t){return t!=t};t.exports=function(t,i){return 0===t&&0===i?1/t==1/i:t===i||!(!e(t)||!e(i))}},609:(t,e,i)=>{"use strict";var n=i(289),r=i(559),o=i(244),s=i(624),a=i(281),l=r(s(),Object);n(l,{getPolyfill:s,implementation:o,shim:a}),t.exports=l},624:(t,e,i)=>{"use strict";var n=i(244);t.exports=function(){return"function"==typeof Object.is?Object.is:n}},281:(t,e,i)=>{"use strict";var n=i(624),r=i(289);t.exports=function(){var t=n();return r(Object,{is:t},{is:function(){return Object.is!==t}}),t}},987:(t,e,i)=>{"use strict";var n;if(!Object.keys){var r=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=i(414),a=Object.prototype.propertyIsEnumerable,l=!a.call({toString:null},"toString"),u=a.call((function(){}),"prototype"),h=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(t){var e=t.constructor;return e&&e.prototype===t},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!d["$"+t]&&r.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{c(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,i="[object Function]"===o.call(t),n=s(t),a=e&&"[object String]"===o.call(t),d=[];if(!e&&!i&&!n)throw new TypeError("Object.keys called on a non-object");var p=u&&i;if(a&&t.length>0&&!r.call(t,0))for(var g=0;g0)for(var m=0;m{"use strict";var n=Array.prototype.slice,r=i(414),o=Object.keys,s=o?function(t){return o(t)}:i(987),a=Object.keys;s.shim=function(){Object.keys?function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2)||(Object.keys=function(t){return r(t)?a(n.call(t)):a(t)}):Object.keys=s;return Object.keys||s},t.exports=s},414:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var i=e.call(t),n="[object Arguments]"===i;return n||(n="[object Array]"!==i&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},676:function(t,e,i){var n=i(155);t.exports=function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var i=0;ie?1:t0))break;if(null===e.right)break;if(i(t,e.right.key)>0&&(l=e.right,e.right=l.left,l.left=e,null===(e=l).right))break;o.right=e,o=e,e=e.right}}return o.right=e.left,s.left=e.right,e.left=n.right,e.right=n.left,e}function a(t,e,i,n){var o=new r(t,e);if(null===i)return o.left=o.right=null,o;var a=n(t,(i=s(t,i,n)).key);return a<0?(o.left=i.left,o.right=i,i.left=null):a>=0&&(o.right=i.right,o.left=i,i.right=null),o}function l(t,e,i){var n=null,r=null;if(e){var o=i((e=s(t,e,i)).key,t);0===o?(n=e.left,r=e.right):o<0?(r=e.right,e.right=null,n=e):(n=e.left,e.left=null,r=e)}return{left:n,right:r}}function u(t,e,i){return null===e?t:(null===t||((e=s(t.key,e,i)).left=t),e)}function h(t,e,i,n,r){if(t){n(e+(i?"└── ":"├── ")+r(t)+"\n");var o=e+(i?" ":"│ ");t.left&&h(t.left,o,!1,n,r),t.right&&h(t.right,o,!0,n,r)}}var c=function(){function t(t){void 0===t&&(t=o),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=a(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var i=new r(t,e);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var n=this._comparator,o=s(t,this._root,n),a=n(t,o.key);return 0===a?this._root=o:(a<0?(i.left=o.left,i.right=o,o.left=null):a>0&&(i.right=o.right,i.left=o,o.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,i){var n;return null===e?null:0===i(t,(e=s(t,e,i)).key)?(null===e.left?n=e.right:(n=s(t,e.left,i)).right=e.right,this._size--,n):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=s(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,i=this._comparator;e;){var n=i(t,e.key);if(0===n)return e;e=n<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=s(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,i=this._comparator;e;){var n=i(t,e.key);if(0===n)return!0;e=n<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var i=this._root,n=[],r=!1;!r;)null!==i?(n.push(i),i=i.left):0!==n.length?(i=n.pop(),t.call(e,i),i=i.right):r=!0;return this},t.prototype.range=function(t,e,i,n){for(var r=[],o=this._comparator,s=this._root;0!==r.length||s;)if(s)r.push(s),s=s.left;else{if(o((s=r.pop()).key,e)>0)break;if(o(s.key,t)>=0&&i.call(n,s))return this;s=s.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var i=e.key;return t.push(i)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var i=e.data;return t.push(i)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,i=!1,n=0,r=[];!i;)if(e)r.push(e),e=e.left;else if(r.length>0){if(e=r.pop(),n===t)return e;n++,e=e.right}else i=!0;return null},t.prototype.next=function(t){var e=this._root,i=null;if(t.right){for(i=t.right;i.left;)i=i.left;return i}for(var n=this._comparator;e;){var r=n(t.key,e.key);if(0===r)break;r<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(t){var e=this._root,i=null;if(null!==t.left){for(i=t.left;i.right;)i=i.right;return i}for(var n=this._comparator;e;){var r=n(t.key,e.key);if(0===r)break;r<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return p(this._root)},t.prototype.load=function(t,e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var n=t.length,r=this._comparator;if(i&&v(t,e,0,n-1,r),null===this._root)this._root=d(t,e,0,n),this._size=n;else{var o=m(this.toList(),f(t,e),r);n=this._size+n,this._root=g({head:o},0,n)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return h(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,i){var n=this._comparator,r=l(t,this._root,n),o=r.left,s=r.right;n(t,e)<0?s=a(e,i,s,n):o=a(e,i,o,n),this._root=u(o,s,n)},t.prototype.split=function(t){return l(t,this._root,this._comparator)},t}();function d(t,e,i,n){var o=n-i;if(o>0){var s=i+Math.floor(o/2),a=t[s],l=e[s],u=new r(a,l);return u.left=d(t,e,i,s),u.right=d(t,e,s+1,n),u}return null}function f(t,e){for(var i=new r(null,null),n=i,o=0;o0?e=(e=s=s.next=i.pop()).right:n=!0;return s.next=null,o.next}function g(t,e,i){var n=i-e;if(n>0){var r=e+Math.floor(n/2),o=g(t,e,r),s=t.head;return s.left=o,t.head=t.head.next,s.right=g(t,r+1,i),s}return null}function m(t,e,i){for(var n=new r(null,null),o=n,s=t,a=e;null!==s&&null!==a;)i(s.key,a.key)<0?(o.next=s,s=s.next):(o.next=a,a=a.next),o=o.next;return null!==s?o.next=s:null!==a&&(o.next=a),n.next}function v(t,e,i,n,r){if(!(i>=n)){for(var o=t[i+n>>1],s=i-1,a=n+1;;){do{s++}while(r(t[s],o)<0);do{a--}while(r(t[a],o)>0);if(s>=a)break;var l=t[s];t[s]=t[a],t[a]=l,l=e[s],e[s]=e[a],e[a]=l}v(t,e,i,a,r),v(t,e,a+1,n,r)}}var y=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},_=function(t,e){if(e.ur.xe.x?1:t.ye.y?1:0}}]),i(e,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,i=0,n=e.length;i=0&&l>=0?su?-1:0:o<0&&l<0?su?1:0:lo?1:0}}}]),e}(),$=0,D=function(){function e(i,n,r,o){t(this,e),this.id=++$,this.leftSE=i,i.segment=this,i.otherSE=n,this.rightSE=n,n.segment=this,n.otherSE=i,this.rings=r,this.windings=o}return i(e,null,[{key:"compare",value:function(t,e){var i=t.leftSE.point.x,n=e.leftSE.point.x,r=t.rightSE.point.x,o=e.rightSE.point.x;if(os&&a>l)return-1;var h=t.comparePoint(e.leftSE.point);if(h<0)return 1;if(h>0)return-1;var c=e.comparePoint(t.rightSE.point);return 0!==c?c:-1}if(i>n){if(sa&&s>u)return 1;var d=e.comparePoint(t.leftSE.point);if(0!==d)return d;var f=t.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(sa)return 1;if(ro){var g=t.comparePoint(e.rightSE.point);if(g<0)return 1;if(g>0)return-1}if(r!==o){var m=l-s,v=r-i,y=u-a,_=o-n;if(m>v&&y<_)return 1;if(m_)return-1}return r>o?1:ru?1:t.ide.id?1:0}}]),i(e,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:te?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,i=this.rightSE.point,n=this.vector();if(e.x===i.x)return t.x===e.x?0:t.x0&&a.swapEvents(),O.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),o.checkForConsuming()),i}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,i=this.windings.length;e0){var o=i;i=n,n=o}if(i.prev===n){var s=i;i=n,n=s}for(var a=0,l=n.rings.length;a0))throw new Error("Tried to create degenerate segment at [".concat(t.x,", ").concat(t.y,"]"));r=i,o=t,s=-1}return new e(new O(r,!0),new O(o,!1),[n],[s])}}]),e}(),j=function(){function e(i,n,r){if(t(this,e),!Array.isArray(i)||0===i.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=n,this.isExterior=r,this.segments=[],"number"!=typeof i[0][0]||"number"!=typeof i[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var o=T.round(i[0][0],i[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};for(var s=o,a=1,l=i.length;athis.bbox.ur.x&&(this.bbox.ur.x=u.x),u.y>this.bbox.ur.y&&(this.bbox.ur.y=u.y),s=u)}o.x===s.x&&o.y===s.y||this.segments.push(D.fromRing(s,o,this))}return i(e,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.segments.length;ethis.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=n}return i(e,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,i=this.interiorRings.length;ethis.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=n}return i(e,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.polys.length;e0&&(t=n)}for(var r=t.segment.prevInResult(),o=r?r.prevInResult():null;;){if(!r)return null;if(!o)return r.ringOut;if(o.ringOut!==r.ringOut)return o.ringOut.enclosingRing()!==r.ringOut?r.ringOut:r.ringOut.enclosingRing();r=o.prevInResult(),o=r?r.prevInResult():null}}}]),e}(),z=function(){function e(i){t(this,e),this.exteriorRing=i,i.poly=this,this.interiorRings=[]}return i(e,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,i=this.interiorRings.length;e1&&void 0!==arguments[1]?arguments[1]:D.compare;t(this,e),this.queue=i,this.tree=new c(n),this.segments=[]}return i(e,[{key:"process",value:function(t){var e=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),i;var n=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!n)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var r=n,o=n,s=void 0,a=void 0;void 0===s;)null===(r=this.tree.prev(r))?s=null:void 0===r.key.consumedBy&&(s=r.key);for(;void 0===a;)null===(o=this.tree.next(o))?a=null:void 0===o.key.consumedBy&&(a=o.key);if(t.isLeft){var l=null;if(s){var u=s.getIntersection(e);if(null!==u&&(e.isAnEndpoint(u)||(l=u),!s.isAnEndpoint(u)))for(var h=this._splitSafely(s,u),c=0,d=h.length;c0?(this.tree.remove(e),i.push(t)):(this.segments.push(e),e.prev=s)}else{if(s&&a){var x=s.getIntersection(a);if(null!==x){if(!s.isAnEndpoint(x))for(var S=this._splitSafely(s,x),C=0,T=S.length;Cq)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var w=new G(p),x=p.size,S=p.pop();S;){var C=S.key;if(p.size===x){var E=C.segment;throw new Error("Unable to pop() ".concat(C.isLeft?"left":"right"," SweepEvent ")+"[".concat(C.point.x,", ").concat(C.point.y,"] from segment #").concat(E.id," ")+"[".concat(E.leftSE.point.x,", ").concat(E.leftSE.point.y,"] -> ")+"[".concat(E.rightSE.point.x,", ").concat(E.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(p.size>q)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(w.segments.length>W)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var I=w.process(C),A=0,P=I.length;A1?e-1:0),n=1;n1?e-1:0),n=1;n1?e-1:0),n=1;n1?e-1:0),n=1;n{var e,i,n=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===r||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(i){try{return e.call(null,t,0)}catch(i){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:r}catch(t){e=r}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(t){i=o}}();var a,l=[],u=!1,h=-1;function c(){u&&a&&(u=!1,a.length?l=a.concat(l):h=-1,l.length&&d())}function d(){if(!u){var t=s(c);u=!0;for(var e=l.length;e;){for(a=l,l=[];++h1)for(var i=1;ir;){if(o-r>600){var a=o-r+1,l=n-r+1,u=Math.log(a),h=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*h*(a-h)/a)*(l-a/2<0?-1:1);e(t,n,Math.max(r,Math.floor(n-l*h/a+c)),Math.min(o,Math.floor(n+(a-l)*h/a+c)),s)}var d=t[n],f=r,p=o;for(i(t,r,n),s(t[o],d)>0&&i(t,r,o);f0;)p--}0===s(t[r],d)?i(t,r,p):i(t,++p,o),p<=n&&(r=p+1),n<=p&&(o=p-1)}}function i(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function n(t,e){return te?1:0}return t}()},510:(t,e,i)=>{"use strict";t.exports=r,t.exports.default=r;var n=i(166);function r(t,e){if(!(this instanceof r))return new r(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function o(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(t,e,i,r,o){for(var s,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=r||(s=e+Math.ceil((i-e)/r/2)*r,n(t,s,e,i,o),a.push(e,s,s,i))}r.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!p(t,e))return i;for(var r,o,s,a,l=[];e;){for(r=0,o=e.children.length;r=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(r,o,e)},_split:function(t,e){var i=t[e],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);var o=this._chooseSplitIndex(i,r,n),a=g(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,s(i,this.toBBox),s(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,r,o,s,l,u,h,d,f,p,g,m,v,y;for(u=h=1/0,n=e;n<=i-e;n++)r=a(t,0,n,this.toBBox),o=a(t,n,i,this.toBBox),f=r,p=o,g=void 0,m=void 0,v=void 0,y=void 0,g=Math.max(f.minX,p.minX),m=Math.max(f.minY,p.minY),v=Math.min(f.maxX,p.maxX),y=Math.min(f.maxY,p.maxY),s=Math.max(0,v-g)*Math.max(0,y-m),l=c(r)+c(o),s=e;r--)o=t.children[r],l(h,t.leaf?s(o):o),c+=d(h);return c},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)l(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():s(t[i],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},697:t=>{"use strict";var e=Object,i=TypeError;t.exports=function(){if(null!=this&&this!==e(this))throw new i("RegExp.prototype.flags getter called on non-object");var t="";return this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.sticky&&(t+="y"),t}},847:(t,e,i)=>{"use strict";var n=i(289),r=i(559),o=i(697),s=i(721),a=i(753),l=r(o);n(l,{getPolyfill:s,implementation:o,shim:a}),t.exports=l},721:(t,e,i)=>{"use strict";var n=i(697),r=i(289).supportsDescriptors,o=Object.getOwnPropertyDescriptor,s=TypeError;t.exports=function(){if(!r)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");if("gim"===/a/gim.flags){var t=o(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof/a/.dotAll)return t.get}return n}},753:(t,e,i)=>{"use strict";var n=i(289).supportsDescriptors,r=i(721),o=Object.getOwnPropertyDescriptor,s=Object.defineProperty,a=TypeError,l=Object.getPrototypeOf,u=/a/;t.exports=function(){if(!n||!l)throw new a("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=r(),e=l(u),i=o(e,"flags");return i&&i.get===t||s(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},576:(t,e,i)=>{var n=i(442);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,i(346).Z)("69d77a46",n,!0,{})},346:(t,e,i)=>{"use strict";function n(t,e){for(var i=[],n={},r=0;rp});var r="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!r)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var o={},s=r&&(document.head||document.getElementsByTagName("head")[0]),a=null,l=0,u=!1,h=function(){},c=null,d="data-vue-ssr-id",f="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function p(t,e,i,r){u=i,c=r||{};var s=n(t,e);return g(s),function(e){for(var i=[],r=0;ri.parts.length&&(n.parts.length=i.parts.length)}else{var s=[];for(r=0;r{}},i={};function n(t){var r=i[t];if(void 0!==r)return r.exports;var o=i[t]={id:t,loaded:!1,exports:{}};return e[t].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.m=e,t=[],n.O=(e,i,r,o)=>{if(!i){var s=1/0;for(u=0;u=o)&&Object.keys(n.O).every((t=>n.O[t](i[l])))?i.splice(l--,1):(a=!1,o0&&t[u-1][2]>o;u--)t[u]=t[u-1];t[u]=[i,r,o]},n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{var t={355:0,392:0};n.O.j=e=>0===t[e];var e=(e,i)=>{var r,o,[s,a,l]=i,u=0;for(r in a)n.o(a,r)&&(n.m[r]=a[r]);for(l&&l(n),e&&e(i);un(463)));var r=n.O(void 0,[392],(()=>n(798)));r=n.O(r)})(); \ No newline at end of file diff --git a/public/assets/styles/main.css b/public/assets/styles/main.css index c59226ba2..4195363d7 100644 --- a/public/assets/styles/main.css +++ b/public/assets/styles/main.css @@ -6,4 +6,4 @@ /*! * Font Awesome Free 5.15.3 by @fontawesome - https://fontawesome.com * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) - */@font-face{font-family:Font Awesome\ 5 Free;font-style:normal;font-weight:900;font-display:block;src:url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.eot?efbd5d20e407bbf85f2b3087ee67bfa1);src:url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.eot?efbd5d20e407bbf85f2b3087ee67bfa1) format("embedded-opentype"),url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.woff2?ada6e6df937f7e5e8b790dfea07109b7) format("woff2"),url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.woff?c6ec080084769a6d8a34ab35b77999cd) format("woff"),url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.ttf?07c3313b24f7b1ca85ee99b4fa7db55e) format("truetype"),url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.svg?13de59f1a36b6cb4bca0050160ff0e41) format("svg")}.fa,.fas{font-family:Font Awesome\ 5 Free;font-weight:900}.center-form{display:flex;align-items:center;justify-content:center;height:100vh}.inline-block-form{display:inline-block}.info-text__sign{position:absolute;right:14px;top:20px}.image-thumbnail,figcaption{text-align:center}.image-thumbnail{position:relative;max-width:100%;max-height:100%;overflow:hidden;background-color:#111;border:2px solid #111;border-radius:4px}.image-thumbnail:hover .caption{opacity:1}.image-thumbnail>a{display:block;height:100%}.image-thumbnail img{width:auto;height:100%}.image-thumbnail .caption{width:100%;position:absolute;bottom:0;color:#fff;padding:.5em;background:linear-gradient(transparent,rgba(0,0,0,.8)) 50% no-repeat;opacity:.75;transition:opacity .25s ease;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@supports ((-o-object-fit: contain) or (object-fit: contain)){.image-thumbnail img{width:100%;-o-object-fit:contain;object-fit:contain}}h1.no-margin,h2.no-margin,h3.no-margin,h4.no-margin,h6.no-margin{margin-top:0}.sidebar-container{display:flex;flex-direction:row;position:absolute;top:0;width:100%;height:calc(100% - 51px);margin-top:51px}.sidebar-container__content{flex:1;height:100%;position:relative}.dropdown-menu .divider{margin:3px 0}.dropdown-footer{font-size:12px;color:#888}.dropdown-footer ul{list-style:none;padding:3px 10px;text-align:center;white-space:nowrap}.dropdown-footer li{display:inline-block}.dropdown-footer li:not(:first-child):before{content:"·";margin-right:3px}.dropdown-footer a{color:inherit}.dropdown-footer a:hover{color:#fff}.sudo-mode-indicator p.navbar-text{color:#d9534f;border:1px solid #d9534f;padding:0 4px;line-height:17px;border-radius:3px;box-sizing:border-box;height:20px}@-webkit-keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@-webkit-keyframes scale-up{0%{transform-origin:top;transform:scaleY(0)}to{transform-origin:top;transform:scaleY(1)}}@keyframes scale-up{0%{transform-origin:top;transform:scaleY(0)}to{transform-origin:top;transform:scaleY(1)}}.scale-up-enter-active{-webkit-animation:scale-up .25s;animation:scale-up .25s}.scale-up-leave-active{display:none}@-webkit-keyframes rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.logo--standalone{margin-bottom:1.5em}.logo{font-size:18px;font-weight:400;text-align:center}.logo a{color:inherit;text-decoration:none}.logo__biigle{position:relative;margin-left:32px}.logo__biigle:before{position:absolute;left:-34px;top:-4px;content:"";width:32px;height:32px;background:url(/assets/images/logo.png) 50% no-repeat;background-size:contain}.logo.logo-inverse .logo__biigle{color:#111}.messages.container-fluid{margin:0 auto;position:fixed;top:0;width:100%;z-index:1000;pointer-events:none}.messages__message{text-align:center;margin-bottom:0;position:relative;pointer-events:all}[v-cloak]{display:none!important}.notifications-icon{position:relative}.notifications-icon:hover .notifications-icon__count{background-color:#de6764}.notifications-icon__count{position:absolute;top:5px;right:0;background-color:#d9534f;color:#fff;font-weight:700;-webkit-animation:blink 20s infinite;animation:blink 20s infinite}.notification__action{margin-top:10px;margin-bottom:0}.notification__tabs{margin-bottom:20px}.search-form{padding-bottom:1em}.search-form .input-group{margin-right:65px}.search-form .btn{position:absolute;right:0;top:0}.search-results{list-style:none;padding:0}.search-results>li{padding:1.5em 0;border-bottom:1px solid #444}.search-results>li:first-child{border-top:1px solid #444}.search-results__name{font-size:18px;font-weight:700}.search-thumbnail{padding-right:0;text-align:center}.search-thumbnail img{max-width:100%;max-height:45px;height:auto;border-radius:4px}.federated-search-button{margin:20px 0}.system-message__html-preview{max-height:320px;overflow-y:auto}.dashboard-version-list{max-height:100px;overflow-y:auto}.user-stats-list-group{max-height:200px;overflow-y:auto}.footer{padding:1em;margin-top:1em;text-align:right;position:relative;border-top:1px solid #111}.footer.footer--absolute{position:absolute;bottom:0;left:0;width:100%}.footer .footer-menu{display:inline-block;list-style:none;padding:0;margin:0;color:#888}.footer .footer-menu li{display:inline-block}.footer .footer-menu li:not(:first-child):before{content:"·";margin-right:5px}.footer a{color:#888}.footer a:hover{color:#fff}.activity-items{margin-bottom:20px}.activity-item{height:180px;display:block;position:relative;overflow:hidden;text-align:center;border-radius:4px;background-color:#111;border:2px solid #111}.activity-item .icon{position:absolute;top:.5em;right:.5em;color:#fff;opacity:.75}.activity-item-image{height:100%}.activity-item-image img{width:auto;height:100%;image-orientation:none}.activity-item-image figcaption{position:absolute;width:100%;bottom:0;color:#fff;opacity:.75;padding:.5em;transition:opacity .25s ease;background:linear-gradient(transparent,rgba(0,0,0,.8)) 50%}.activity-item-image:hover figcaption{opacity:1}@supports ((-o-object-fit: contain) or (object-fit: contain)){.activity-item-image img{width:100%;-o-object-fit:contain;object-fit:contain}}.loader{position:relative;display:none;width:16px;height:16px;border-radius:50%;border:3px solid hsla(0,0%,100%,.2);border-left-color:#ccc;vertical-align:middle;-webkit-animation:rotate 1.1s linear infinite;animation:rotate 1.1s linear infinite;pointer-events:none}.loader.loader--active{display:inline-block}.loader.loader--fancy{border:0;height:50px;width:50px;-webkit-animation-duration:5s;animation-duration:5s;background-color:rgba(0,0,0,.75)}.loader.loader--fancy:before{position:absolute;content:"";top:10%;left:10%;width:80%;height:80%;background:url(/assets/images/biigle-wheel.png) 50% no-repeat;background-size:contain}.loader-block{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;pointer-events:none;transition:background-color .25s ease;z-index:999}.loader-block.loader-block--active{pointer-events:auto;background-color:rgba(0,0,0,.5)}.typeahead{display:inline-block}.typeahead--block{display:block}.typeahead-item-info{display:inline-block;max-width:250px;text-overflow:ellipsis;overflow:hidden}.sidebar{display:flex}.sidebar.sidebar--left{flex-direction:row-reverse}.sidebar.sidebar--left .sidebar__buttons,.sidebar.sidebar--left .sidebar__tab{border-right:1px solid #555}.sidebar.sidebar--right .sidebar__buttons,.sidebar.sidebar--right .sidebar__tab{border-left:1px solid #555}.sidebar .sidebar__buttons{width:50px;height:100%;overflow:hidden;display:flex;flex-direction:column}.sidebar .sidebar__button{flex:1;border-radius:0;width:100%;border:0;display:flex;align-items:center}.sidebar .sidebar__button:not(:last-child){border-bottom:1px solid #555}.sidebar .sidebar__tabs{flex:1}.sidebar .sidebar__tab{display:none;padding:1em;height:100%;overflow:auto}.sidebar .sidebar__tab.sidebar__tab--open{width:300px;display:block}.sidebar .sidebar__tab.sidebar__tab--nopad{padding:0}.list-group-restricted{max-height:400px;max-width:100%;overflow:auto}.power-toggle{display:inline-block}.power-toggle .power-toggle__label{padding-left:10px}.label-tree-title{display:inline-block}.label-tree-info-form{margin-top:20px;margin-bottom:10px;line-height:1.1}.label-tree-info-form .label-tree-description{width:500px;margin-top:2px}.label-tree-info-form .label-tree-name{width:300px}.label-tree-buttons{margin-top:20px}.label-tree-labels-loader{position:absolute;top:10px;right:15px}.label-color-dot{width:1em;height:1em;border:2px solid #fff;border-radius:50%;display:inline-block;margin-right:.5em}.authorized-project-item .btn{display:none}.authorized-project-item:hover .btn{display:inline-block}.label-typeahead-item{position:relative;margin-left:-15px;padding:5px 22px}.label-typeahead-item .label-color{position:absolute;top:7px;left:.25em;width:1em;height:1em;border:2px solid #fff;border-radius:50%}.label-tree-label.label-tree-label--selected>.label-tree-label__name{color:#fff;font-weight:700}.label-tree-label.label-tree-label--expandable:not(.label-tree-label--editing)>.label-tree-label__name{text-decoration:underline}.label-tree-label.label-tree-label--editing>.label-tree-label__name{padding-left:5px}.label-tree-label .label-tree-label__chevron,.label-tree-label .label-tree-label__color{position:absolute;left:.25em;width:1em;height:1em}.label-tree-label .label-tree-label__color{top:9px;border:2px solid #fff;border-radius:50%;left:5px}.label-tree-label .label-tree-label__chevron{top:6px;left:5px;text-shadow:-1.5px 0 #fff,1.5px 0 #fff,0 -1.5px #fff,0 1.5px #fff}.label-tree-label .label-tree-label__chevron:before{position:relative;top:1px;display:inline-block;font-family:Font Awesome\ 5 Free;line-height:1}.label-tree-label .label-tree-label__chevron.label-tree-label__chevron--up:before{content:""}.label-tree-label .label-tree-label__chevron.label-tree-label__chevron--down:before{content:""}.label-tree-label .label-tree-label__name{position:relative;padding:5px 27px;border-radius:3px;word-wrap:break-word}.label-tree-label .label-tree-label__name:hover{color:#fff;cursor:pointer;background-color:#111}.label-tree-label .label-tree-label__name:hover .label-tree-label__favourite{display:inline-block}.label-tree-label .form-control.label-tree-color-input,.label-tree-label .form-control.label-tree-label__name-input{vertical-align:top;display:inline-block;width:auto}.label-tree-label .form-control.label-tree-color-input{width:50px}.label-tree-label .label-tree-label__buttons{padding-top:5px 0;position:absolute;right:5px}.label-tree-label .label-tree-label__favourite{color:#888;display:none;background:none;border:0;padding:0}.label-tree-label .label-tree-label__favourite.selected,.label-tree-label .label-tree-label__favourite:hover{color:inherit;display:inline-block}.label-tree.label-tree--panel{padding:5px}.label-tree.label-tree--panel .label-tree__list{margin:0}.label-tree__title{margin-top:0}.label-tree__list{list-style-type:none;padding:0}.label-tree__list .label-tree__list{padding-left:15px}.label-trees{display:flex;flex-direction:column;max-height:100%}.label-trees .label-trees__head{display:flex;margin-bottom:1em;min-height:34px}.label-trees .label-trees__body{flex:1;overflow:auto}.label-trees .typeahead{flex:1}.label-trees .typeahead:not(:first-child){margin-left:10px}.label-trees .label-tree:last-child .label-tree__list{margin:0}.label-tree-diff table{table-layout:fixed}.label-tree-diff table thead th:first-child{width:32px}.label-tree-diff-row td{padding:0}.label-tree-diff-row.success+.label-tree-diff-row td,.label-tree-diff-row.success td{border-color:#435e3d}.label-tree-diff-row.danger+.label-tree-diff-row td,.label-tree-diff-row.danger td{border-color:#6a3940}.label-tree-diff-row .label-tree-label__name:hover{color:inherit;cursor:default;background-color:inherit}.label-tree-diff-row .label-tree-diff-row__button{width:32px;padding:0}.label-tree-diff-row .label-tree-diff-row__left,.label-tree-diff-row .label-tree-diff-row__right{padding:0 0 0 10px}.label-tree-diff-row.label-tree-diff-row--added .label-tree-diff-row__left{color:#6ec06e}.label-tree-diff-row.label-tree-diff-row--removed .label-tree-diff-row__left{color:#de6764;text-decoration:line-through}.dashboard-project:not(:last-child){margin-bottom:20px}.dashboard-project h4{margin-top:0}.dashboard-project .preview-thumbnail{height:180px;max-width:100%}.dashboard__all-projects{padding:2em;text-align:center}.preview-thumbnail{display:block;position:relative;overflow:hidden;text-align:center;border-radius:4px;border:2px solid #111;background-color:#111}.preview-thumbnail img{width:auto;height:100%;image-orientation:none}.preview-thumbnail figcaption{position:absolute;width:100%;bottom:0;color:#fff;opacity:.75;padding:.5em;transition:opacity .25s ease;background:linear-gradient(transparent,rgba(0,0,0,.8)) 50%}.preview-thumbnail:hover figcaption{opacity:1}.preview-thumbnail.loading:hover .preview-thumbnail__progress{-webkit-animation:pulse 1s infinite;animation:pulse 1s infinite}@supports ((-o-object-fit: contain) or (object-fit: contain)){.preview-thumbnail img{width:100%;-o-object-fit:contain;object-fit:contain}}.preview-thumbnail__fallback{height:100%}.preview-thumbnail__images{position:absolute;width:100%;height:100%;top:0;left:0;display:flex;justify-content:center}.preview-thumbnail__progress{position:absolute;bottom:0;left:0;height:2px;background-color:#5bc0de;opacity:.25}.preview-thumbnail__remove{position:absolute;top:0;right:.5em;z-index:2}.preview-thumbnail__icon{position:absolute;top:.5em;right:.5em;color:#fff;opacity:.75;z-index:1}.preview-thumbnail__icon.fa-trash{color:#d9534f}.preview-thumbnail__icon.fa-trash:hover{opacity:1}.project-tree-title{display:inline-block}.project-info-form{margin-top:20px;margin-bottom:10px;line-height:1.1}.project-info-form .project-description{width:500px;margin-top:2px}.project-info-form .project-name{width:300px}.preview-thumbnail--projects{height:150px;margin:15px 0}.volumes-grid{max-height:600px;overflow-y:auto}.project-buttons{margin-top:20px}.panel-filter{display:inline-block;vertical-align:middle}.panel-filter.panel-filter--active input:not(:focus){border-color:#5bc0de}.panel-filter .form-control-feedback,.panel-filter input{height:21.6px;line-height:21.6px}.panel-filter .form-control-feedback{width:21.6px;cursor:pointer;z-index:1;pointer-events:inherit;color:#5bc0de}.panel-filter .form-group{display:inline-block;margin:0}.volume-filter{display:inline-block;vertical-align:middle}.volume-filter.volume-filter--active input:not(:focus){border-color:#5bc0de}.volume-filter .form-control-feedback{cursor:pointer;z-index:1;pointer-events:inherit;color:#5bc0de}.volume-filter .form-group{display:inline-block;margin:0}.project-tabs{margin-bottom:15px}.project-label-trees .typeahead,.project-volumes .typeahead{vertical-align:middle}.project-volumes .volume-info-well{margin-top:15px}.volume-content__messages{position:absolute;top:0;left:0;height:100%;width:100%;pointer-events:none;display:flex;align-items:center;justify-content:center}.navbar-text.navbar-volumes-breadcrumbs,.navbar-text.navbar-volumes-breadcrumbs a{color:#ccc}.panel-image{text-align:center;padding:.5em;background-color:#111}.image-grid{flex-flow:row nowrap}.image-grid,.image-grid__images{position:relative;width:100%;height:100%;overflow:hidden;display:flex}.image-grid__images{flex:1;justify-content:center;align-content:center;align-items:center;flex-wrap:wrap}.image-grid__image{height:135px;width:180px;display:inline-flex;justify-content:center;position:relative;margin:4px;border:2px solid #222;border-radius:6px;transition:border .25s ease;overflow:hidden;background-color:#111;padding:2px}.image-grid__image:hover .image-button{opacity:.75}.image-grid__image:hover .image-icon{opacity:1}.image-grid__image.image-grid__image--selected .image-icon{opacity:.5}.image-grid__image.image-grid__image--selected.image-grid__image--fade img{opacity:.25}.image-grid__image.image-grid__image--selectable{cursor:pointer}.image-grid__image.image-grid__image--small-icon .image-icon{align-items:flex-start;justify-content:flex-start;padding:.5em;font-size:2em}.image-grid__image img{width:auto;height:100%;border-radius:4px;transition:opacity .25s ease;image-orientation:none}.image-grid__image .image-buttons{position:absolute;top:6px;right:6px;width:28px}.image-grid__image .image-button{padding:.3em .5em;background-color:rgba(0,0,0,.5);border-radius:4px;color:#fff;display:block;opacity:0;transition:opacity .25s ease;border:0}.image-grid__image .image-button:not(:last-child){margin-bottom:6px}.image-grid__image .image-button:hover{opacity:1}.image-grid__image .image-icon{z-index:1;position:absolute;display:flex;align-items:center;justify-content:center;left:0;top:0;width:100%;height:100%;font-size:3em;opacity:0;pointer-events:none;transition:opacity .25s ease;text-shadow:-2px 0 #222,0 2px #222,2px 0 #222,0 -2px #222;color:#fff}@supports ((-o-object-fit: contain) or (object-fit: contain)){.image-grid__image img{width:100%;-o-object-fit:contain;object-fit:contain}}.image-grid-progress{height:100%;display:flex;flex-flow:column nowrap}.image-grid-progress .btn-group-vertical .btn{border-radius:0!important;border-right:0}.image-grid-progress__bar{flex:1;border-left:1px solid #555;position:relative}.image-grid-progress__bar .image-grid-progress__wrapper{position:absolute;left:0;right:0;top:0;bottom:0;pointer-events:none}.image-grid-progress__bar .image-grid-progress__inner{height:0%;background-color:#555;transition:background-color .1s ease}.image-grid-progress__bar:hover{cursor:pointer}.image-grid-progress__bar:hover .progress-bar__progress{background-color:#888}.filter-tab .filter-tab__buttons,.filter-tab .select-component{margin-bottom:15px}.filter-tab .list-group-item{position:relative;padding-right:30px}.filter-tab .list-group-item .close{position:absolute;top:10px;right:15px}.filter-form__selects{display:flex}.filter-form__selects .filter-select{flex:1;margin-left:12px}.filter-select{display:flex}.filter-select .typeahead{flex:1;margin-right:12px}.filter-select .typeahead .form-control{display:block}.sorting-tab .sorting-tab__buttons{margin-bottom:15px}.image-grid__image--volume{position:relative}.image-grid__image--volume.image-grid__image--selected:before{position:absolute;content:"";top:12px;left:12px;width:15px;height:15px;border-radius:50%;background-color:#5bc0de;border:2px solid #fff}.image-grid__image--volume.image-grid__image--selectable:hover{border-color:#5bc0de}.image-grid__image--volume.image-grid__image--success{border-color:#5cb85c}.image-grid__image--volume.image-grid__image--error{border-color:#d9534f}.image-grid__image--volume.image-grid__image--saving{border-color:#f0ad4e}.image-grid__image--volume .preview-thumbnail{width:100%;height:100%;border-radius:4px;transition:opacity .25s ease;border:0}.image-grid__image--volume .image-labels{position:absolute;top:0;left:0;width:135px;max-height:100%;padding:.3em .5em;background-color:rgba(0,0,0,.6);border-radius:4px;overflow-y:auto;overflow-x:hidden}.image-grid__image--volume .image-link{width:100%;text-align:center}.image-grid__image--volume .image-filename{position:absolute;left:0;bottom:0;width:100%;overflow:hidden;text-overflow:ellipsis;padding:2px 5px;background-color:rgba(0,0,0,.6);border-radius:4px;white-space:nowrap}.file-label-list{list-style:none;padding:0;margin:0}.file-label{position:relative;padding:5px 10px 5px 22px}.file-label.file-label--deleting{color:#888}.file-label .file-label__color{position:absolute;top:9px;left:.25em;width:1em;height:1em;border:2px solid #fff;border-radius:50%}.file-label .file-label__delete{position:absolute;top:5px;right:5px}.volume-files-panel .files-list{max-height:300px;overflow-y:auto}.panel:not(.panel--editing) .session{border:0}.panel.panel--editing .session:hover{background-color:#33515a;cursor:pointer}.session{position:relative;padding-left:34px}.session:after,.session:before{content:"";position:absolute;height:100%;background-color:#444}.session:before{left:14px;top:0;width:6px}.session:after{left:9px;top:12px;width:16px;height:16px;border-radius:50%}.session.session--active:before{background:linear-gradient(#444,#5bc0de 12px,#5bc0de 28px,#444)}.session.session--active:after{padding-top:1px;padding-left:1px;font-family:Font Awesome\ 5 Free;font-weight:900;line-height:1;background-color:#222;content:"";color:#5bc0de}.session .session__dates{color:#888}.session.session--active .session__dates{color:#5bc0de}.form-control.tag-list{height:auto;min-height:34px;overflow-x:auto;white-space:nowrap}.form-control.tag-list .tag{margin-right:5px}.form-control.tag-list .tag .close{float:none;font-size:16px;opacity:.5;text-shadow:none}.form-control.tag-list .tag .close:hover{opacity:.75}.volume-search-results{list-style:none;padding:0}.volume-search-results>li{padding-top:15px;padding-bottom:15px}.volume-search-results .image-thumbnail,.volume-search-results .preview-thumbnail{height:135px}.file-browser{border:1px solid #555;padding:12px;border-radius:4px}.file-browser__dirs{margin-top:1em;margin-bottom:0;max-height:200px;overflow-y:auto}.annotation-tooltip__annotations>li,.label-indicator,.minimap,.mouse-position-indicator,.scale-line-indicator,.zoom-level-indicator{z-index:1;border-radius:4px;background-color:rgba(34,34,34,.7);border:1px solid #353535;padding:.25em .5em}.navbar-default .navbar-text,.navbar-default .navbar-text a{color:#ccc}.navbar-annotations-breadcrumbs{white-space:nowrap;max-width:850px;text-overflow:ellipsis;overflow:hidden}.navbar-annotations-breadcrumbs .dropdown{position:static}.navbar-annotations-breadcrumbs .dropdown .dropdown-menu{left:auto;top:auto}.sidebar-tab__section{padding-bottom:10px;border-bottom:1px solid hsla(0,0%,100%,.1)}.ol-control.zoom-to-native button,.ol-zoom-extent button{color:#fff;display:block;font-family:Font Awesome\ 5 Free;font-weight:400}.ol-control.zoom-to-native{left:.5em;top:7.1em}.icon{min-height:16px;min-width:16px;display:inline-block;background-position:50%;background-repeat:no-repeat;background-size:contain;margin-bottom:-3px}.icon.icon-point{background-image:url(/assets/images/annotations/point.svg)}.icon.icon-rectangle{background-image:url(/assets/images/annotations/rectangle.svg)}.icon.icon-polygon{background-image:url(/assets/images/annotations/polygon.svg)}.icon.icon-linestring{background-image:url(/assets/images/annotations/linestring.svg)}.icon.icon-circle{background-image:url(/assets/images/annotations/circle.svg)}.icon.icon-ellipse{background-image:url(/assets/images/annotations/ellipse.svg)}.icon.icon-wholeframe{background-image:url(/assets/images/annotations/wholeframe.svg)}.annotations-tab-item .annotations-tab-item__sub-item:hover .icon.icon-point,.icon.active.icon-point,.icon.icon-white.icon-point{background-image:url(/assets/images/annotations/point_white.svg)}.annotations-tab-item .annotations-tab-item__sub-item:hover .icon.icon-rectangle,.icon.active.icon-rectangle,.icon.icon-white.icon-rectangle{background-image:url(/assets/images/annotations/rectangle_white.svg)}.annotations-tab-item .annotations-tab-item__sub-item:hover .icon.icon-polygon,.icon.active.icon-polygon,.icon.icon-white.icon-polygon{background-image:url(/assets/images/annotations/polygon_white.svg)}.annotations-tab-item .annotations-tab-item__sub-item:hover .icon.icon-linestring,.icon.active.icon-linestring,.icon.icon-white.icon-linestring{background-image:url(/assets/images/annotations/linestring_white.svg)}.annotations-tab-item .annotations-tab-item__sub-item:hover .icon.icon-circle,.icon.active.icon-circle,.icon.icon-white.icon-circle{background-image:url(/assets/images/annotations/circle_white.svg)}.annotations-tab-item .annotations-tab-item__sub-item:hover .icon.icon-ellipse,.icon.active.icon-ellipse,.icon.icon-white.icon-ellipse{background-image:url(/assets/images/annotations/ellipse_white.svg)}.annotations-tab-item .annotations-tab-item__sub-item:hover .icon.icon-wholeframe,.icon.active.icon-wholeframe,.icon.icon-white.icon-wholeframe{background-image:url(/assets/images/annotations/wholeframe_white.svg)}.annotations-tab-item .annotations-tab-item__sub-item.selected .icon.icon-point,.icon.icon-highlight.icon-point{background-image:url(/assets/images/annotations/point_highlight.svg)}.annotations-tab-item .annotations-tab-item__sub-item.selected .icon.icon-rectangle,.icon.icon-highlight.icon-rectangle{background-image:url(/assets/images/annotations/rectangle_highlight.svg)}.annotations-tab-item .annotations-tab-item__sub-item.selected .icon.icon-polygon,.icon.icon-highlight.icon-polygon{background-image:url(/assets/images/annotations/polygon_highlight.svg)}.annotations-tab-item .annotations-tab-item__sub-item.selected .icon.icon-linestring,.icon.icon-highlight.icon-linestring{background-image:url(/assets/images/annotations/linestring_highlight.svg)}.annotations-tab-item .annotations-tab-item__sub-item.selected .icon.icon-circle,.icon.icon-highlight.icon-circle{background-image:url(/assets/images/annotations/circle_highlight.svg)}.annotations-tab-item .annotations-tab-item__sub-item.selected .icon.icon-ellipse,.icon.icon-highlight.icon-ellipse{background-image:url(/assets/images/annotations/ellipse_highlight.svg)}.annotations-tab-item .annotations-tab-item__sub-item.selected .icon.icon-wholeframe,.icon.icon-highlight.icon-wholeframe{background-image:url(/assets/images/annotations/wholeframe_highlight.svg)}.progress-indicator-container{width:20px;height:20px;display:inline-block;vertical-align:bottom;position:relative}.progress-indicator{width:20px;height:20px;transform:rotate(-90deg)}.progress-indicator__background{fill:#ccc;opacity:.25}.progress-indicator__progress{fill:#ccc}.progress-indicator--all .progress-indicator__background,.progress-indicator--all .progress-indicator__progress{fill:#5cb85c}.progress-indicator__marker{fill:transparent;stroke:#fff;stroke-width:.1}.annotator-tab>h4:first-child{margin-top:0}.annotator-tab .sidebar-tab__section:not(:first-child){padding-top:10px}.annotator-tab .sidebar-tab__section>h5{margin-top:0}.labels-tab{height:100%;display:flex;flex-direction:column}.labels-tab .labels-tab__trees{flex:1;overflow:hidden}.labels-tab .labels-tab__plugins:not(:empty){padding-top:1em}.annotator-tab--annotation-modes .form-control--small{display:inline-block;width:70px;vertical-align:middle}.file-label-tab{display:flex;flex-flow:column;height:100%;overflow-x:hidden}.file-label-tab h4{padding:14px;margin:0;position:relative}.file-label-tab .file-label__buttons{position:absolute;top:1em;right:1em;z-index:1}.file-label-tab .file-label-list .text-muted{padding:0 1em}.file-label-tab .file-label{border-bottom:1px solid #353535;padding:1em 1em 1em 32px}.file-label-tab .file-label:first-child{border-top:1px solid #353535}.file-label-tab .file-label__color{top:1.2em;left:1em}.file-label-tab .file-label__delete{top:12px;right:14px}.annotation-canvas{position:relative;height:100%;background-image:url(/assets/images/annotations/noise.png)}.annotation-canvas__toolbar{position:absolute;bottom:.5em;width:100%;display:flex;justify-content:center;color:#fff}.annotation-canvas__toolbar .btn-group{margin-right:.5em}.annotation-canvas__left-indicators,.annotation-canvas__right-indicators{position:absolute;z-index:1;bottom:.5em}.annotation-canvas__left-indicators>:not(:first-child),.annotation-canvas__right-indicators>:not(:first-child){margin-top:.25em}.annotation-canvas__left-indicators{left:.5em}.annotation-canvas__right-indicators{right:.5em}.annotations-tab{display:flex;flex-flow:column;height:100%;overflow:none}.annotations-tab__filter{padding:1em;width:100%}.annotations-tab__filter select.form-control{width:80px}.annotations-tab__filter input.form-control{width:140px}.annotations-tab__list{position:relative;flex:1;overflow:auto;margin:0}.annotations-tab__plugins:not(:empty){padding-top:1em}.annotations-tab-item{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:0 1em;border-bottom:1px solid #353535}.annotations-tab-item:first-child{border-top:1px solid #353535}.annotations-tab-item.selected .annotations-tab-item__title{padding-bottom:.5em;font-weight:700}.annotations-tab-item .annotations-tab-item__title:hover,.annotations-tab-item.selected .annotations-tab-item__title{color:#fff}.annotations-tab-item .annotations-tab-item__title:hover .badge,.annotations-tab-item.selected .annotations-tab-item__title .badge{background-color:#fff;color:#222}.annotations-tab-item .annotations-tab-item__title{position:relative;padding:1em 0 1em 1.25em;cursor:pointer}.annotations-tab-item .annotations-tab-item__color{position:absolute;left:0;top:1.2em;width:1em;height:1em;border:2px solid #fff;border-radius:50%}.annotations-tab-item .annotations-tab-item__list{padding-bottom:1em}.annotations-tab-item .annotations-tab-item__sub-item{cursor:pointer;padding:.25em 0;color:#888}.annotations-tab-item .annotations-tab-item__sub-item.selected,.annotations-tab-item .annotations-tab-item__sub-item:hover{color:#fff}.annotations-tab-item .annotations-tab-item__sub-item .icon{margin-right:.25em}.mouse-position-indicator,.zoom-level-indicator{text-align:center}.scale-line-indicator__line{border-bottom:1px solid #ccc;display:block;text-align:center;position:relative;margin:auto}.scale-line-indicator__line:after,.scale-line-indicator__line:before{content:"";position:absolute;bottom:0;height:50%;width:1px;background-color:#ccc}.scale-line-indicator__line:before{left:0}.scale-line-indicator__line:after{right:0}.minimap{position:absolute;top:.5em;right:.5em;background-image:url(/assets/images/annotations/noise.png);padding:0;overflow:hidden;box-shadow:0 0 0 1px hsla(0,0%,100%,.25)}.control-button{position:relative;border-radius:2px;transition:background-color .25s ease;background-color:rgba(0,60,136,.5)}.control-button:not(:last-child){margin-right:2px}.control-button.active,.control-button:hover{color:#fff;background-color:rgba(0,60,136,.7)}.control-button:focus{color:#fff}.control-button__sub-controls{position:absolute;top:-4px;left:50%;transform-origin:50% 100%;transform:translate(-50%,-100%) scale(0);display:flex;flex-wrap:nowrap}.control-button__sub-controls .btn{padding:3px 6px}.control-button--open>.control-button__sub-controls{transform:translate(-50%,-100%) scale(1)}.annotation-tooltip{z-index:1;display:block;pointer-events:none;white-space:nowrap}.annotation-tooltip__annotations,.annotation-tooltip__labels{list-style:none;margin:0;padding:0}.annotation-tooltip__annotations>li:not(:first-child){margin-top:.25em}.video-container.resizing-timeline{cursor:row-resize}.video-container.resizing-timeline .video-screen,.video-container.resizing-timeline .video-timeline{pointer-events:none}.video-container .video-screen{height:65%;min-height:50%;max-height:calc(100% - 36px)}.video-container .video-timeline{height:35%;max-height:50%;min-height:36px}.video-container .error-message{position:absolute;padding:1em 0;width:100%;z-index:1;display:flex;justify-content:center;align-items:center}.settings-tab .form-control--small{display:inline-block;width:70px;vertical-align:middle}.annotation-canvas__toolbar .btn-group,.video-screen .controls .btn-group{z-index:1;background-color:hsla(0,0%,100%,.4);padding:1px;border-radius:4px;transition:all .25s ease}.annotation-canvas__toolbar .btn-group:hover,.video-screen .controls .btn-group:hover{background-color:hsla(0,0%,100%,.6)}.video-screen{background:#111;position:relative;background-image:url(/assets/images/annotations/noise.png)}.video-screen video{min-height:100%;max-height:100%;min-width:100%;max-width:100%}.video-screen .controls{position:absolute;bottom:.5em;width:100%;display:flex;justify-content:center;color:#fff}.video-screen .controls .btn-group{margin-right:.5em}.video-screen .indicators{z-index:1;position:absolute;bottom:.5em}.video-screen .indicators--right{right:.5em}.video-screen .indicators--left{left:.5em}.video-screen .indicator{border-radius:4px;background-color:rgba(34,34,34,.7);border:1px solid #353535;padding:.25em .5em}.video-screen .indicator:not(:last-child){margin-bottom:.25em}.video-timeline{position:relative;display:flex;overflow:hidden;padding-top:2px}.video-timeline .grab-border{position:absolute;top:0;left:0;width:100%;height:2px;background-color:#353535;cursor:row-resize}.video-timeline .static-strip{width:150px;border-right:1px solid #353535;display:flex;flex-direction:column}.video-timeline .scroll-strip,.video-timeline .static-strip .track-headers{flex:1}.current-time{height:34px;font-weight:700;padding:5px;border-bottom:1px solid #353535;text-align:center}.current-time--seeking,.current-time .hover-time{color:#888}.current-time--hover{padding:8px;font-size:12px}.track-headers{overflow:hidden}.track-headers .track-header{position:relative;border-bottom:1px solid #353535;padding:5px 0}.track-headers .track-header .label-name{position:absolute;top:0;left:0;padding:5px;width:100%;max-height:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.track-headers .track-header .lane-dummy{height:20px}.track-headers .track-header .lane-dummy:not(:last-child){margin-bottom:5px}.scroll-strip{position:relative;overflow:hidden}.scroll-strip .video-progress{height:34px;border-bottom:1px solid #353535}.scroll-strip .annotation-tracks-wrapper{position:relative;flex:1;overflow:hidden}.scroll-strip .time-indicator{position:absolute;top:0;left:0;height:100%;width:1px;background-color:#900;box-shadow:0 0 1px #000;will-change:transform;pointer-events:none;z-index:100}.scroll-strip .time-indicator:before{content:"";position:absolute;top:0;left:-5px;width:11px;height:3px;background-color:red}.scroll-strip .time-indicator:after{content:"";position:absolute;display:block;top:3px;left:-5px;border:5px solid transparent;border-top-color:red;width:11px;height:11px}.scroll-strip .time-indicator.time-indicator--seeking{background-color:#4d4d4d}.scroll-strip .time-indicator.time-indicator--seeking:before{background-color:grey}.scroll-strip .time-indicator.time-indicator--seeking:after{border-top-color:grey}.scroll-strip .hover-time-indicator{position:absolute;top:0;left:0;height:34px;width:1px;background-color:#888;will-change:transform;pointer-events:none}.scroll-strip .overflow-shadow{position:absolute;top:0;left:0;bottom:0;right:0;pointer-events:none}.scroll-strip .overflow-shadow--top{box-shadow:inset 0 10px 5px -5px rgba(0,0,0,.75)}.scroll-strip .overflow-shadow--bottom{box-shadow:inset 0 -10px 5px -5px rgba(0,0,0,.75)}.scroll-strip .overflow-shadow--left{box-shadow:inset 10px 0 5px -5px rgba(0,0,0,.75)}.scroll-strip .overflow-shadow--right{box-shadow:inset -10px 0 5px -5px rgba(0,0,0,.75)}.scroll-strip__scroller{position:relative;min-width:100%;height:100%;display:flex;flex-direction:column}.video-progress{position:relative;overflow:hidden;cursor:pointer}.video-progress .tick{position:absolute;left:0;top:0;width:1px;border-left:1px solid #888;color:#888;font-size:12px;padding:0 5px;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.annotation-tracks{position:relative;overflow-y:auto;overflow-x:hidden;height:100%;scrollbar-width:none}.annotation-tracks::-webkit-scrollbar{display:none}.annotation-track{position:relative;border-bottom:1px solid #353535;padding:5px 0}.annotation-track .annotation-lane{position:relative;height:20px}.annotation-track .annotation-lane:not(:last-child){margin-bottom:5px}.annotation-track .annotation-clip{height:100%}.annotation-clip{position:absolute;cursor:pointer;height:100%;min-width:9px;display:flex;flex-direction:row;align-items:center}.annotation-clip--selected:after{border:1px solid #fff;border-radius:3px}.annotation-clip--pending:after,.annotation-clip--selected:after{content:"";position:absolute;height:100%;width:100%;pointer-events:none;z-index:0}.annotation-clip--pending:after{border:2px dashed #fff;border-radius:3px}.annotation-segment{position:relative;border-radius:3px;height:100%}.annotation-segment .annotation-keyframe{position:absolute;height:100%;width:9px;border-radius:3px;left:0}.annotation-segment--gap{border-radius:0;height:0;border-top:3px dotted transparent;z-index:-1}.annotation-clip--whole-frame .annotation-segment{background:repeating-linear-gradient(45deg,transparent,transparent 2px,rgba(0,0,0,.2) 0,rgba(0,0,0,.2) 4px);background-size:100% 200%}.annotation-clip--whole-frame.annotation-clip--dark .annotation-segment{background:repeating-linear-gradient(45deg,transparent,transparent 2px,hsla(0,0%,100%,.2) 0,hsla(0,0%,100%,.2) 4px)}.annotation-keyframe{position:absolute;height:100%;width:9px;border-radius:3px;left:0;border:1px solid hsla(0,0%,100%,.5)}.annotation-keyframe:last-child:not(:only-child){transform:translateX(-100%)}.annotation-keyframe--selected{border:2px solid #fff;background-color:#ff5e00!important;z-index:1}.annotation-clip--compact{min-width:3px}.annotation-clip--compact .annotation-keyframe{width:3px}.annotation-clip--more-compact{min-width:3px}.annotation-clip--more-compact .annotation-keyframe{display:none}@-webkit-keyframes blink{49%{border-color:red}50%{border-color:rgba(255,0,0,0)}99%{border-color:rgba(255,0,0,0)}to{border-color:red}}@keyframes blink{49%{border-color:red}50%{border-color:rgba(255,0,0,0)}99%{border-color:rgba(255,0,0,0)}to{border-color:red}}.annotation-clip--tracking .annotation-keyframe{border:2px solid red;-webkit-animation:blink 1s infinite;animation:blink 1s infinite}.annotation-clip--whole-frame .annotation-keyframe{background:repeating-linear-gradient(45deg,transparent,transparent 2px,rgba(0,0,0,.3) 0,rgba(0,0,0,.3) 4px);background-size:100% 200%}.annotation-clip--whole-frame.annotation-clip--dark .annotation-keyframe{background:repeating-linear-gradient(45deg,transparent,transparent 2px,hsla(0,0%,100%,.3) 0,hsla(0,0%,100%,.3) 4px)}.uiv-datepicker .btn-default{background-color:#111} + */@font-face{font-family:Font Awesome\ 5 Free;font-style:normal;font-weight:900;font-display:block;src:url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.eot?efbd5d20e407bbf85f2b3087ee67bfa1);src:url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.eot?efbd5d20e407bbf85f2b3087ee67bfa1) format("embedded-opentype"),url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.woff2?ada6e6df937f7e5e8b790dfea07109b7) format("woff2"),url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.woff?c6ec080084769a6d8a34ab35b77999cd) format("woff"),url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.ttf?07c3313b24f7b1ca85ee99b4fa7db55e) format("truetype"),url(/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.svg?13de59f1a36b6cb4bca0050160ff0e41) format("svg")}.fa,.fas{font-family:Font Awesome\ 5 Free;font-weight:900}.center-form{display:flex;align-items:center;justify-content:center;height:100vh}.inline-block-form{display:inline-block}.info-text__sign{position:absolute;right:14px;top:20px}.image-thumbnail,figcaption{text-align:center}.image-thumbnail{position:relative;max-width:100%;max-height:100%;overflow:hidden;background-color:#111;border:2px solid #111;border-radius:4px}.image-thumbnail:hover .caption{opacity:1}.image-thumbnail>a{display:block;height:100%}.image-thumbnail img{width:auto;height:100%}.image-thumbnail .caption{width:100%;position:absolute;bottom:0;color:#fff;padding:.5em;background:linear-gradient(transparent,rgba(0,0,0,.8)) 50% no-repeat;opacity:.75;transition:opacity .25s ease;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@supports ((-o-object-fit: contain) or (object-fit: contain)){.image-thumbnail img{width:100%;-o-object-fit:contain;object-fit:contain}}h1.no-margin,h2.no-margin,h3.no-margin,h4.no-margin,h6.no-margin{margin-top:0}.sidebar-container{display:flex;flex-direction:row;position:absolute;top:0;width:100%;height:calc(100% - 51px);margin-top:51px}.sidebar-container__content{flex:1;height:100%;position:relative}.dropdown-menu .divider{margin:3px 0}.dropdown-footer{font-size:12px;color:#888}.dropdown-footer ul{list-style:none;padding:3px 10px;text-align:center;white-space:nowrap}.dropdown-footer li{display:inline-block}.dropdown-footer li:not(:first-child):before{content:"·";margin-right:3px}.dropdown-footer a{color:inherit}.dropdown-footer a:hover{color:#fff}.sudo-mode-indicator p.navbar-text{color:#d9534f;border:1px solid #d9534f;padding:0 4px;line-height:17px;border-radius:3px;box-sizing:border-box;height:20px}@-webkit-keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@-webkit-keyframes scale-up{0%{transform-origin:top;transform:scaleY(0)}to{transform-origin:top;transform:scaleY(1)}}@keyframes scale-up{0%{transform-origin:top;transform:scaleY(0)}to{transform-origin:top;transform:scaleY(1)}}.scale-up-enter-active{-webkit-animation:scale-up .25s;animation:scale-up .25s}.scale-up-leave-active{display:none}@-webkit-keyframes rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.logo--standalone{margin-bottom:1.5em}.logo{font-size:18px;font-weight:400;text-align:center}.logo a{color:inherit;text-decoration:none}.logo__biigle{position:relative;margin-left:32px}.logo__biigle:before{position:absolute;left:-34px;top:-4px;content:"";width:32px;height:32px;background:url(/assets/images/logo.png) 50% no-repeat;background-size:contain}.logo.logo-inverse .logo__biigle{color:#111}.messages.container-fluid{margin:0 auto;position:fixed;top:0;width:100%;z-index:1000;pointer-events:none}.messages__message{text-align:center;margin-bottom:0;position:relative;pointer-events:all}[v-cloak]{display:none!important}.notifications-icon{position:relative}.notifications-icon:hover .notifications-icon__count{background-color:#de6764}.notifications-icon__count{position:absolute;top:5px;right:0;background-color:#d9534f;color:#fff;font-weight:700;-webkit-animation:blink 20s infinite;animation:blink 20s infinite}.notification__action{margin-top:10px;margin-bottom:0}.notification__tabs{margin-bottom:20px}.search-form{padding-bottom:1em}.search-form .input-group{margin-right:65px}.search-form .btn{position:absolute;right:0;top:0}.search-results{list-style:none;padding:0}.search-results>li{padding:1.5em 0;border-bottom:1px solid #444}.search-results>li:first-child{border-top:1px solid #444}.search-results__name{font-size:18px;font-weight:700}.search-thumbnail{padding-right:0;text-align:center}.search-thumbnail img{max-width:100%;max-height:45px;height:auto;border-radius:4px}.federated-search-button{margin:20px 0}.system-message__html-preview{max-height:320px;overflow-y:auto}.dashboard-version-list{max-height:100px;overflow-y:auto}.user-stats-list-group{max-height:200px;overflow-y:auto}.footer{padding:1em;margin-top:1em;text-align:right;position:relative;border-top:1px solid #111}.footer.footer--absolute{position:absolute;bottom:0;left:0;width:100%}.footer .footer-menu{display:inline-block;list-style:none;padding:0;margin:0;color:#888}.footer .footer-menu li{display:inline-block}.footer .footer-menu li:not(:first-child):before{content:"·";margin-right:5px}.footer a{color:#888}.footer a:hover{color:#fff}.activity-items{margin-bottom:20px}.activity-item{height:180px;display:block;position:relative;overflow:hidden;text-align:center;border-radius:4px;background-color:#111;border:2px solid #111}.activity-item .icon{position:absolute;top:.5em;right:.5em;color:#fff;opacity:.75}.activity-item-image{height:100%}.activity-item-image img{width:auto;height:100%;image-orientation:none}.activity-item-image figcaption{position:absolute;width:100%;bottom:0;color:#fff;opacity:.75;padding:.5em;transition:opacity .25s ease;background:linear-gradient(transparent,rgba(0,0,0,.8)) 50%}.activity-item-image:hover figcaption{opacity:1}@supports ((-o-object-fit: contain) or (object-fit: contain)){.activity-item-image img{width:100%;-o-object-fit:contain;object-fit:contain}}.loader{position:relative;display:none;width:16px;height:16px;border-radius:50%;border:3px solid hsla(0,0%,100%,.2);border-left-color:#ccc;vertical-align:middle;-webkit-animation:rotate 1.1s linear infinite;animation:rotate 1.1s linear infinite;pointer-events:none}.loader.loader--active{display:inline-block}.loader.loader--fancy{border:0;height:50px;width:50px;-webkit-animation-duration:5s;animation-duration:5s;background-color:rgba(0,0,0,.75)}.loader.loader--fancy:before{position:absolute;content:"";top:10%;left:10%;width:80%;height:80%;background:url(/assets/images/biigle-wheel.png) 50% no-repeat;background-size:contain}.message-curtain.loader-block--inactive{pointer-events:none;background-color:transparent}.typeahead{display:inline-block}.typeahead--block{display:block}.typeahead-item-info{display:inline-block;max-width:250px;text-overflow:ellipsis;overflow:hidden}.sidebar{display:flex}.sidebar.sidebar--left{flex-direction:row-reverse}.sidebar.sidebar--left .sidebar__buttons,.sidebar.sidebar--left .sidebar__tab{border-right:1px solid #555}.sidebar.sidebar--right .sidebar__buttons,.sidebar.sidebar--right .sidebar__tab{border-left:1px solid #555}.sidebar .sidebar__buttons{width:50px;height:100%;overflow:hidden;display:flex;flex-direction:column}.sidebar .sidebar__button{flex:1;border-radius:0;width:100%;border:0;display:flex;align-items:center}.sidebar .sidebar__button:not(:last-child){border-bottom:1px solid #555}.sidebar .sidebar__tabs{flex:1}.sidebar .sidebar__tab{display:none;padding:1em;height:100%;overflow:auto}.sidebar .sidebar__tab.sidebar__tab--open{width:300px;display:block}.sidebar .sidebar__tab.sidebar__tab--nopad{padding:0}.list-group-restricted{max-height:400px;max-width:100%;overflow:auto}.power-toggle{display:inline-block}.power-toggle .power-toggle__label{padding-left:10px}.message-curtain{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;pointer-events:auto;transition:background-color .25s ease;z-index:999;background-color:rgba(0,0,0,.5)}.label-tree-title{display:inline-block}.label-tree-info-form{margin-top:20px;margin-bottom:10px;line-height:1.1}.label-tree-info-form .label-tree-description{width:500px;margin-top:2px}.label-tree-info-form .label-tree-name{width:300px}.label-tree-buttons{margin-top:20px}.label-tree-labels-loader{position:absolute;top:10px;right:15px}.label-color-dot{width:1em;height:1em;border:2px solid #fff;border-radius:50%;display:inline-block;margin-right:.5em}.authorized-project-item .btn{display:none}.authorized-project-item:hover .btn{display:inline-block}.label-typeahead-item{position:relative;margin-left:-15px;padding:5px 22px}.label-typeahead-item .label-color{position:absolute;top:7px;left:.25em;width:1em;height:1em;border:2px solid #fff;border-radius:50%}.label-tree-label.label-tree-label--selected>.label-tree-label__name{color:#fff;font-weight:700}.label-tree-label.label-tree-label--expandable:not(.label-tree-label--editing)>.label-tree-label__name{text-decoration:underline}.label-tree-label.label-tree-label--editing>.label-tree-label__name{padding-left:5px}.label-tree-label .label-tree-label__chevron,.label-tree-label .label-tree-label__color{position:absolute;left:.25em;width:1em;height:1em}.label-tree-label .label-tree-label__color{top:9px;border:2px solid #fff;border-radius:50%;left:5px}.label-tree-label .label-tree-label__chevron{top:6px;left:5px;text-shadow:-1.5px 0 #fff,1.5px 0 #fff,0 -1.5px #fff,0 1.5px #fff}.label-tree-label .label-tree-label__chevron:before{position:relative;top:1px;display:inline-block;font-family:Font Awesome\ 5 Free;line-height:1}.label-tree-label .label-tree-label__chevron.label-tree-label__chevron--up:before{content:""}.label-tree-label .label-tree-label__chevron.label-tree-label__chevron--down:before{content:""}.label-tree-label .label-tree-label__name{position:relative;padding:5px 27px;border-radius:3px;word-wrap:break-word}.label-tree-label .label-tree-label__name:hover{color:#fff;cursor:pointer;background-color:#111}.label-tree-label .label-tree-label__name:hover .label-tree-label__favourite{display:inline-block}.label-tree-label .form-control.label-tree-color-input,.label-tree-label .form-control.label-tree-label__name-input{vertical-align:top;display:inline-block;width:auto}.label-tree-label .form-control.label-tree-color-input{width:50px}.label-tree-label .label-tree-label__buttons{padding-top:5px 0;position:absolute;right:5px}.label-tree-label .label-tree-label__favourite{color:#888;display:none;background:none;border:0;padding:0}.label-tree-label .label-tree-label__favourite.selected,.label-tree-label .label-tree-label__favourite:hover{color:inherit;display:inline-block}.label-tree.label-tree--panel{padding:5px}.label-tree.label-tree--panel .label-tree__list{margin:0}.label-tree__title{margin-top:0}.label-tree__list{list-style-type:none;padding:0}.label-tree__list .label-tree__list{padding-left:15px}.label-trees{display:flex;flex-direction:column;max-height:100%}.label-trees .label-trees__head{display:flex;margin-bottom:1em;min-height:34px}.label-trees .label-trees__body{flex:1;overflow:auto}.label-trees .typeahead{flex:1}.label-trees .typeahead:not(:first-child){margin-left:10px}.label-trees .label-tree:last-child .label-tree__list{margin:0}.label-tree-diff table{table-layout:fixed}.label-tree-diff table thead th:first-child{width:32px}.label-tree-diff-row td{padding:0}.label-tree-diff-row.success+.label-tree-diff-row td,.label-tree-diff-row.success td{border-color:#435e3d}.label-tree-diff-row.danger+.label-tree-diff-row td,.label-tree-diff-row.danger td{border-color:#6a3940}.label-tree-diff-row .label-tree-label__name:hover{color:inherit;cursor:default;background-color:inherit}.label-tree-diff-row .label-tree-diff-row__button{width:32px;padding:0}.label-tree-diff-row .label-tree-diff-row__left,.label-tree-diff-row .label-tree-diff-row__right{padding:0 0 0 10px}.label-tree-diff-row.label-tree-diff-row--added .label-tree-diff-row__left{color:#6ec06e}.label-tree-diff-row.label-tree-diff-row--removed .label-tree-diff-row__left{color:#de6764;text-decoration:line-through}.dashboard-project:not(:last-child){margin-bottom:20px}.dashboard-project h4{margin-top:0}.dashboard-project .preview-thumbnail{height:180px;max-width:100%}.dashboard__all-projects{padding:2em;text-align:center}.preview-thumbnail{display:block;position:relative;overflow:hidden;text-align:center;border-radius:4px;border:2px solid #111;background-color:#111}.preview-thumbnail img{width:auto;height:100%;image-orientation:none}.preview-thumbnail figcaption{position:absolute;width:100%;bottom:0;color:#fff;opacity:.75;padding:.5em;transition:opacity .25s ease;background:linear-gradient(transparent,rgba(0,0,0,.8)) 50%}.preview-thumbnail:hover figcaption{opacity:1}.preview-thumbnail.loading:hover .preview-thumbnail__progress{-webkit-animation:pulse 1s infinite;animation:pulse 1s infinite}@supports ((-o-object-fit: contain) or (object-fit: contain)){.preview-thumbnail img{width:100%;-o-object-fit:contain;object-fit:contain}}.preview-thumbnail__fallback{height:100%}.preview-thumbnail__images{position:absolute;width:100%;height:100%;top:0;left:0;display:flex;justify-content:center}.preview-thumbnail__progress{position:absolute;bottom:0;left:0;height:2px;background-color:#5bc0de;opacity:.25}.preview-thumbnail__remove{position:absolute;top:0;right:.5em;z-index:2}.preview-thumbnail__icon{position:absolute;top:.5em;right:.5em;color:#fff;opacity:.75;z-index:1}.preview-thumbnail__icon.fa-trash{color:#d9534f}.preview-thumbnail__icon.fa-trash:hover{opacity:1}.project-tree-title{display:inline-block}.project-info-form{margin-top:20px;margin-bottom:10px;line-height:1.1}.project-info-form .project-description{width:500px;margin-top:2px}.project-info-form .project-name{width:300px}.preview-thumbnail--projects{height:150px;margin:15px 0}.volumes-grid{max-height:600px;overflow-y:auto}.project-buttons{margin-top:20px}.panel-filter{display:inline-block;vertical-align:middle}.panel-filter.panel-filter--active input:not(:focus){border-color:#5bc0de}.panel-filter .form-control-feedback,.panel-filter input{height:21.6px;line-height:21.6px}.panel-filter .form-control-feedback{width:21.6px;cursor:pointer;z-index:1;pointer-events:inherit;color:#5bc0de}.panel-filter .form-group{display:inline-block;margin:0}.volume-filter{display:inline-block;vertical-align:middle}.volume-filter.volume-filter--active input:not(:focus){border-color:#5bc0de}.volume-filter .form-control-feedback{cursor:pointer;z-index:1;pointer-events:inherit;color:#5bc0de}.volume-filter .form-group{display:inline-block;margin:0}.project-tabs{margin-bottom:15px}.project-label-trees .typeahead,.project-volumes .typeahead{vertical-align:middle}.project-volumes .volume-info-well{margin-top:15px}.volume-content__messages{position:absolute;top:0;left:0;height:100%;width:100%;pointer-events:none;display:flex;align-items:center;justify-content:center}.navbar-text.navbar-volumes-breadcrumbs,.navbar-text.navbar-volumes-breadcrumbs a{color:#ccc}.panel-image{text-align:center;padding:.5em;background-color:#111}.image-grid{flex-flow:row nowrap}.image-grid,.image-grid__images{position:relative;width:100%;height:100%;overflow:hidden;display:flex}.image-grid__images{flex:1;justify-content:center;align-content:center;align-items:center;flex-wrap:wrap}.image-grid__image{height:135px;width:180px;display:inline-flex;justify-content:center;position:relative;margin:4px;border:2px solid #222;border-radius:6px;transition:border .25s ease;overflow:hidden;background-color:#111;padding:2px}.image-grid__image:hover .image-button{opacity:.75}.image-grid__image:hover .image-icon{opacity:1}.image-grid__image.image-grid__image--selected .image-icon{opacity:.5}.image-grid__image.image-grid__image--selected.image-grid__image--fade img{opacity:.25}.image-grid__image.image-grid__image--selectable{cursor:pointer}.image-grid__image.image-grid__image--small-icon .image-icon{align-items:flex-start;justify-content:flex-start;padding:.5em;font-size:2em}.image-grid__image img{width:auto;height:100%;border-radius:4px;transition:opacity .25s ease;image-orientation:none}.image-grid__image .image-buttons{position:absolute;top:6px;right:6px;width:28px}.image-grid__image .image-button{padding:.3em .5em;background-color:rgba(0,0,0,.5);border-radius:4px;color:#fff;display:block;opacity:0;transition:opacity .25s ease;border:0}.image-grid__image .image-button:not(:last-child){margin-bottom:6px}.image-grid__image .image-button:hover{opacity:1}.image-grid__image .image-icon{z-index:1;position:absolute;display:flex;align-items:center;justify-content:center;left:0;top:0;width:100%;height:100%;font-size:3em;opacity:0;pointer-events:none;transition:opacity .25s ease;text-shadow:-2px 0 #222,0 2px #222,2px 0 #222,0 -2px #222;color:#fff}@supports ((-o-object-fit: contain) or (object-fit: contain)){.image-grid__image img{width:100%;-o-object-fit:contain;object-fit:contain}}.image-grid-progress{height:100%;display:flex;flex-flow:column nowrap}.image-grid-progress .btn-group-vertical .btn{border-radius:0!important;border-right:0}.image-grid-progress__bar{flex:1;border-left:1px solid #555;position:relative}.image-grid-progress__bar .image-grid-progress__wrapper{position:absolute;left:0;right:0;top:0;bottom:0;pointer-events:none}.image-grid-progress__bar .image-grid-progress__inner{height:0%;background-color:#555;transition:background-color .1s ease}.image-grid-progress__bar:hover{cursor:pointer}.image-grid-progress__bar:hover .progress-bar__progress{background-color:#888}.filter-tab .filter-tab__buttons,.filter-tab .select-component{margin-bottom:15px}.filter-tab .list-group-item{position:relative;padding-right:30px}.filter-tab .list-group-item .close{position:absolute;top:10px;right:15px}.filter-form__selects{display:flex}.filter-form__selects .filter-select{flex:1;margin-left:12px}.filter-select{display:flex}.filter-select .typeahead{flex:1;margin-right:12px}.filter-select .typeahead .form-control{display:block}.sorting-tab .sorting-tab__buttons{margin-bottom:15px}.image-grid__image--volume{position:relative}.image-grid__image--volume.image-grid__image--selected:before{position:absolute;content:"";top:12px;left:12px;width:15px;height:15px;border-radius:50%;background-color:#5bc0de;border:2px solid #fff}.image-grid__image--volume.image-grid__image--selectable:hover{border-color:#5bc0de}.image-grid__image--volume.image-grid__image--success{border-color:#5cb85c}.image-grid__image--volume.image-grid__image--error{border-color:#d9534f}.image-grid__image--volume.image-grid__image--saving{border-color:#f0ad4e}.image-grid__image--volume .preview-thumbnail{width:100%;height:100%;border-radius:4px;transition:opacity .25s ease;border:0}.image-grid__image--volume .image-labels{position:absolute;top:0;left:0;width:135px;max-height:100%;padding:.3em .5em;background-color:rgba(0,0,0,.6);border-radius:4px;overflow-y:auto;overflow-x:hidden}.image-grid__image--volume .image-link{width:100%;text-align:center}.image-grid__image--volume .image-filename{position:absolute;left:0;bottom:0;width:100%;overflow:hidden;text-overflow:ellipsis;padding:2px 5px;background-color:rgba(0,0,0,.6);border-radius:4px;white-space:nowrap}.file-label-list{list-style:none;padding:0;margin:0}.file-label{position:relative;padding:5px 10px 5px 22px}.file-label.file-label--deleting{color:#888}.file-label .file-label__color{position:absolute;top:9px;left:.25em;width:1em;height:1em;border:2px solid #fff;border-radius:50%}.file-label .file-label__delete{position:absolute;top:5px;right:5px}.volume-files-panel .files-list{max-height:300px;overflow-y:auto}.panel:not(.panel--editing) .session{border:0}.panel.panel--editing .session:hover{background-color:#33515a;cursor:pointer}.session{position:relative;padding-left:34px}.session:after,.session:before{content:"";position:absolute;height:100%;background-color:#444}.session:before{left:14px;top:0;width:6px}.session:after{left:9px;top:12px;width:16px;height:16px;border-radius:50%}.session.session--active:before{background:linear-gradient(#444,#5bc0de 12px,#5bc0de 28px,#444)}.session.session--active:after{padding-top:1px;padding-left:1px;font-family:Font Awesome\ 5 Free;font-weight:900;line-height:1;background-color:#222;content:"";color:#5bc0de}.session .session__dates{color:#888}.session.session--active .session__dates{color:#5bc0de}.form-control.tag-list{height:auto;min-height:34px;overflow-x:auto;white-space:nowrap}.form-control.tag-list .tag{margin-right:5px}.form-control.tag-list .tag .close{float:none;font-size:16px;opacity:.5;text-shadow:none}.form-control.tag-list .tag .close:hover{opacity:.75}.volume-search-results{list-style:none;padding:0}.volume-search-results>li{padding-top:15px;padding-bottom:15px}.volume-search-results .image-thumbnail,.volume-search-results .preview-thumbnail{height:135px}.file-browser{border:1px solid #555;padding:12px;border-radius:4px}.file-browser__dirs{margin-top:1em;margin-bottom:0;max-height:200px;overflow-y:auto}.annotation-tooltip__annotations>li,.label-indicator,.minimap,.mouse-position-indicator,.scale-line-indicator,.zoom-level-indicator{z-index:1;border-radius:4px;background-color:rgba(34,34,34,.7);border:1px solid #353535;padding:.25em .5em}.navbar-default .navbar-text,.navbar-default .navbar-text a{color:#ccc}.navbar-annotations-breadcrumbs{white-space:nowrap;max-width:850px;text-overflow:ellipsis;overflow:hidden}.navbar-annotations-breadcrumbs .dropdown{position:static}.navbar-annotations-breadcrumbs .dropdown .dropdown-menu{left:auto;top:auto}.sidebar-tab__section{padding-bottom:10px;border-bottom:1px solid hsla(0,0%,100%,.1)}.ol-control.zoom-to-native button,.ol-zoom-extent button{color:#fff;display:block;font-family:Font Awesome\ 5 Free;font-weight:400}.ol-control.zoom-to-native{left:.5em;top:7.1em}.icon{min-height:16px;min-width:16px;display:inline-block;background-position:50%;background-repeat:no-repeat;background-size:contain;margin-bottom:-3px}.icon.icon-point{background-image:url(/assets/images/annotations/point.svg)}.icon.icon-rectangle{background-image:url(/assets/images/annotations/rectangle.svg)}.icon.icon-polygon{background-image:url(/assets/images/annotations/polygon.svg)}.icon.icon-linestring{background-image:url(/assets/images/annotations/linestring.svg)}.icon.icon-circle{background-image:url(/assets/images/annotations/circle.svg)}.icon.icon-ellipse{background-image:url(/assets/images/annotations/ellipse.svg)}.icon.icon-wholeframe{background-image:url(/assets/images/annotations/wholeframe.svg)}.annotations-tab-item .annotations-tab-item__sub-item:hover .icon.icon-point,.icon.active.icon-point,.icon.icon-white.icon-point{background-image:url(/assets/images/annotations/point_white.svg)}.annotations-tab-item .annotations-tab-item__sub-item:hover .icon.icon-rectangle,.icon.active.icon-rectangle,.icon.icon-white.icon-rectangle{background-image:url(/assets/images/annotations/rectangle_white.svg)}.annotations-tab-item .annotations-tab-item__sub-item:hover .icon.icon-polygon,.icon.active.icon-polygon,.icon.icon-white.icon-polygon{background-image:url(/assets/images/annotations/polygon_white.svg)}.annotations-tab-item .annotations-tab-item__sub-item:hover .icon.icon-linestring,.icon.active.icon-linestring,.icon.icon-white.icon-linestring{background-image:url(/assets/images/annotations/linestring_white.svg)}.annotations-tab-item .annotations-tab-item__sub-item:hover .icon.icon-circle,.icon.active.icon-circle,.icon.icon-white.icon-circle{background-image:url(/assets/images/annotations/circle_white.svg)}.annotations-tab-item .annotations-tab-item__sub-item:hover .icon.icon-ellipse,.icon.active.icon-ellipse,.icon.icon-white.icon-ellipse{background-image:url(/assets/images/annotations/ellipse_white.svg)}.annotations-tab-item .annotations-tab-item__sub-item:hover .icon.icon-wholeframe,.icon.active.icon-wholeframe,.icon.icon-white.icon-wholeframe{background-image:url(/assets/images/annotations/wholeframe_white.svg)}.annotations-tab-item .annotations-tab-item__sub-item.selected .icon.icon-point,.icon.icon-highlight.icon-point{background-image:url(/assets/images/annotations/point_highlight.svg)}.annotations-tab-item .annotations-tab-item__sub-item.selected .icon.icon-rectangle,.icon.icon-highlight.icon-rectangle{background-image:url(/assets/images/annotations/rectangle_highlight.svg)}.annotations-tab-item .annotations-tab-item__sub-item.selected .icon.icon-polygon,.icon.icon-highlight.icon-polygon{background-image:url(/assets/images/annotations/polygon_highlight.svg)}.annotations-tab-item .annotations-tab-item__sub-item.selected .icon.icon-linestring,.icon.icon-highlight.icon-linestring{background-image:url(/assets/images/annotations/linestring_highlight.svg)}.annotations-tab-item .annotations-tab-item__sub-item.selected .icon.icon-circle,.icon.icon-highlight.icon-circle{background-image:url(/assets/images/annotations/circle_highlight.svg)}.annotations-tab-item .annotations-tab-item__sub-item.selected .icon.icon-ellipse,.icon.icon-highlight.icon-ellipse{background-image:url(/assets/images/annotations/ellipse_highlight.svg)}.annotations-tab-item .annotations-tab-item__sub-item.selected .icon.icon-wholeframe,.icon.icon-highlight.icon-wholeframe{background-image:url(/assets/images/annotations/wholeframe_highlight.svg)}.progress-indicator-container{width:20px;height:20px;display:inline-block;vertical-align:bottom;position:relative}.progress-indicator{width:20px;height:20px;transform:rotate(-90deg)}.progress-indicator__background{fill:#ccc;opacity:.25}.progress-indicator__progress{fill:#ccc}.progress-indicator--all .progress-indicator__background,.progress-indicator--all .progress-indicator__progress{fill:#5cb85c}.progress-indicator__marker{fill:transparent;stroke:#fff;stroke-width:.1}.annotator-tab>h4:first-child{margin-top:0}.annotator-tab .sidebar-tab__section:not(:first-child){padding-top:10px}.annotator-tab .sidebar-tab__section>h5{margin-top:0}.labels-tab{height:100%;display:flex;flex-direction:column}.labels-tab .labels-tab__trees{flex:1;overflow:hidden}.labels-tab .labels-tab__plugins:not(:empty){padding-top:1em}.annotator-tab--annotation-modes .form-control--small{display:inline-block;width:70px;vertical-align:middle}.file-label-tab{display:flex;flex-flow:column;height:100%;overflow-x:hidden}.file-label-tab h4{padding:14px;margin:0;position:relative}.file-label-tab .file-label__buttons{position:absolute;top:1em;right:1em;z-index:1}.file-label-tab .file-label-list .text-muted{padding:0 1em}.file-label-tab .file-label{border-bottom:1px solid #353535;padding:1em 1em 1em 32px}.file-label-tab .file-label:first-child{border-top:1px solid #353535}.file-label-tab .file-label__color{top:1.2em;left:1em}.file-label-tab .file-label__delete{top:12px;right:14px}.annotation-canvas{position:relative;height:100%;background-image:url(/assets/images/annotations/noise.png)}.annotation-canvas__toolbar{position:absolute;bottom:.5em;width:100%;display:flex;justify-content:center;color:#fff}.annotation-canvas__toolbar .btn-group{margin-right:.5em}.annotation-canvas__left-indicators,.annotation-canvas__right-indicators{position:absolute;z-index:1;bottom:.5em}.annotation-canvas__left-indicators>:not(:first-child),.annotation-canvas__right-indicators>:not(:first-child){margin-top:.25em}.annotation-canvas__left-indicators{left:.5em}.annotation-canvas__right-indicators{right:.5em}.annotations-tab{display:flex;flex-flow:column;height:100%;overflow:none}.annotations-tab__filter{padding:1em;width:100%}.annotations-tab__filter select.form-control{width:80px}.annotations-tab__filter input.form-control{width:140px}.annotations-tab__list{position:relative;flex:1;overflow:auto;margin:0}.annotations-tab__plugins:not(:empty){padding-top:1em}.annotations-tab-item{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:0 1em;border-bottom:1px solid #353535}.annotations-tab-item:first-child{border-top:1px solid #353535}.annotations-tab-item.selected .annotations-tab-item__title{padding-bottom:.5em;font-weight:700}.annotations-tab-item .annotations-tab-item__title:hover,.annotations-tab-item.selected .annotations-tab-item__title{color:#fff}.annotations-tab-item .annotations-tab-item__title:hover .badge,.annotations-tab-item.selected .annotations-tab-item__title .badge{background-color:#fff;color:#222}.annotations-tab-item .annotations-tab-item__title{position:relative;padding:1em 0 1em 1.25em;cursor:pointer}.annotations-tab-item .annotations-tab-item__color{position:absolute;left:0;top:1.2em;width:1em;height:1em;border:2px solid #fff;border-radius:50%}.annotations-tab-item .annotations-tab-item__list{padding-bottom:1em}.annotations-tab-item .annotations-tab-item__sub-item{cursor:pointer;padding:.25em 0;color:#888}.annotations-tab-item .annotations-tab-item__sub-item.selected,.annotations-tab-item .annotations-tab-item__sub-item:hover{color:#fff}.annotations-tab-item .annotations-tab-item__sub-item .icon{margin-right:.25em}.mouse-position-indicator,.zoom-level-indicator{text-align:center}.scale-line-indicator__line{border-bottom:1px solid #ccc;display:block;text-align:center;position:relative;margin:auto}.scale-line-indicator__line:after,.scale-line-indicator__line:before{content:"";position:absolute;bottom:0;height:50%;width:1px;background-color:#ccc}.scale-line-indicator__line:before{left:0}.scale-line-indicator__line:after{right:0}.minimap{position:absolute;top:.5em;right:.5em;background-image:url(/assets/images/annotations/noise.png);padding:0;overflow:hidden;box-shadow:0 0 0 1px hsla(0,0%,100%,.25)}.control-button{position:relative;border-radius:2px;transition:background-color .25s ease;background-color:rgba(0,60,136,.5)}.control-button:not(:last-child){margin-right:2px}.control-button.active,.control-button:hover{color:#fff;background-color:rgba(0,60,136,.7)}.control-button:focus{color:#fff}.control-button__sub-controls{position:absolute;top:-4px;left:50%;transform-origin:50% 100%;transform:translate(-50%,-100%) scale(0);display:flex;flex-wrap:nowrap}.control-button__sub-controls .btn{padding:3px 6px}.control-button--open>.control-button__sub-controls{transform:translate(-50%,-100%) scale(1)}.annotation-tooltip{z-index:1;display:block;pointer-events:none;white-space:nowrap}.annotation-tooltip__annotations,.annotation-tooltip__labels{list-style:none;margin:0;padding:0}.annotation-tooltip__annotations>li:not(:first-child){margin-top:.25em}.video-container.resizing-timeline{cursor:row-resize}.video-container.resizing-timeline .video-screen,.video-container.resizing-timeline .video-timeline{pointer-events:none}.video-container .video-screen{height:65%;min-height:50%;max-height:calc(100% - 36px)}.video-container .video-timeline{height:35%;max-height:50%;min-height:36px}.video-container .error-message{position:absolute;padding:1em 0;width:100%;z-index:1;display:flex;justify-content:center;align-items:center}.settings-tab .form-control--small{display:inline-block;width:70px;vertical-align:middle}.annotation-canvas__toolbar .btn-group,.video-screen .controls .btn-group{z-index:1;background-color:hsla(0,0%,100%,.4);padding:1px;border-radius:4px;transition:all .25s ease}.annotation-canvas__toolbar .btn-group:hover,.video-screen .controls .btn-group:hover{background-color:hsla(0,0%,100%,.6)}.video-screen{background:#111;position:relative;background-image:url(/assets/images/annotations/noise.png)}.video-screen video{min-height:100%;max-height:100%;min-width:100%;max-width:100%}.video-screen .controls{position:absolute;bottom:.5em;width:100%;display:flex;justify-content:center;color:#fff}.video-screen .controls .btn-group{margin-right:.5em}.video-screen .indicators{z-index:1;position:absolute;bottom:.5em}.video-screen .indicators--right{right:.5em}.video-screen .indicators--left{left:.5em}.video-screen .indicator{border-radius:4px;background-color:rgba(34,34,34,.7);border:1px solid #353535;padding:.25em .5em}.video-screen .indicator:not(:last-child){margin-bottom:.25em}.video-timeline{position:relative;display:flex;overflow:hidden;padding-top:2px}.video-timeline .grab-border{position:absolute;top:0;left:0;width:100%;height:2px;background-color:#353535;cursor:row-resize}.video-timeline .static-strip{width:150px;border-right:1px solid #353535;display:flex;flex-direction:column}.video-timeline .scroll-strip,.video-timeline .static-strip .track-headers{flex:1}.current-time{height:34px;font-weight:700;padding:5px;border-bottom:1px solid #353535;text-align:center}.current-time--seeking,.current-time .hover-time{color:#888}.current-time--hover{padding:8px;font-size:12px}.track-headers{overflow:hidden}.track-headers .track-header{position:relative;border-bottom:1px solid #353535;padding:5px 0}.track-headers .track-header .label-name{position:absolute;top:0;left:0;padding:5px;width:100%;max-height:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.track-headers .track-header .lane-dummy{height:20px}.track-headers .track-header .lane-dummy:not(:last-child){margin-bottom:5px}.scroll-strip{position:relative;overflow:hidden}.scroll-strip .video-progress{height:34px;border-bottom:1px solid #353535}.scroll-strip .annotation-tracks-wrapper{position:relative;flex:1;overflow:hidden}.scroll-strip .time-indicator{position:absolute;top:0;left:0;height:100%;width:1px;background-color:#900;box-shadow:0 0 1px #000;will-change:transform;pointer-events:none;z-index:100}.scroll-strip .time-indicator:before{content:"";position:absolute;top:0;left:-5px;width:11px;height:3px;background-color:red}.scroll-strip .time-indicator:after{content:"";position:absolute;display:block;top:3px;left:-5px;border:5px solid transparent;border-top-color:red;width:11px;height:11px}.scroll-strip .time-indicator.time-indicator--seeking{background-color:#4d4d4d}.scroll-strip .time-indicator.time-indicator--seeking:before{background-color:grey}.scroll-strip .time-indicator.time-indicator--seeking:after{border-top-color:grey}.scroll-strip .hover-time-indicator{position:absolute;top:0;left:0;height:34px;width:1px;background-color:#888;will-change:transform;pointer-events:none}.scroll-strip .overflow-shadow{position:absolute;top:0;left:0;bottom:0;right:0;pointer-events:none}.scroll-strip .overflow-shadow--top{box-shadow:inset 0 10px 5px -5px rgba(0,0,0,.75)}.scroll-strip .overflow-shadow--bottom{box-shadow:inset 0 -10px 5px -5px rgba(0,0,0,.75)}.scroll-strip .overflow-shadow--left{box-shadow:inset 10px 0 5px -5px rgba(0,0,0,.75)}.scroll-strip .overflow-shadow--right{box-shadow:inset -10px 0 5px -5px rgba(0,0,0,.75)}.scroll-strip__scroller{position:relative;min-width:100%;height:100%;display:flex;flex-direction:column}.video-progress{position:relative;overflow:hidden;cursor:pointer}.video-progress .tick{position:absolute;left:0;top:0;width:1px;border-left:1px solid #888;color:#888;font-size:12px;padding:0 5px;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.annotation-tracks{position:relative;overflow-y:auto;overflow-x:hidden;height:100%;scrollbar-width:none}.annotation-tracks::-webkit-scrollbar{display:none}.annotation-track{position:relative;border-bottom:1px solid #353535;padding:5px 0}.annotation-track .annotation-lane{position:relative;height:20px}.annotation-track .annotation-lane:not(:last-child){margin-bottom:5px}.annotation-track .annotation-clip{height:100%}.annotation-clip{position:absolute;cursor:pointer;height:100%;min-width:9px;display:flex;flex-direction:row;align-items:center}.annotation-clip--selected:after{border:1px solid #fff;border-radius:3px}.annotation-clip--pending:after,.annotation-clip--selected:after{content:"";position:absolute;height:100%;width:100%;pointer-events:none;z-index:0}.annotation-clip--pending:after{border:2px dashed #fff;border-radius:3px}.annotation-segment{position:relative;border-radius:3px;height:100%}.annotation-segment .annotation-keyframe{position:absolute;height:100%;width:9px;border-radius:3px;left:0}.annotation-segment--gap{border-radius:0;height:0;border-top:3px dotted transparent;z-index:-1}.annotation-clip--whole-frame .annotation-segment{background:repeating-linear-gradient(45deg,transparent,transparent 2px,rgba(0,0,0,.2) 0,rgba(0,0,0,.2) 4px);background-size:100% 200%}.annotation-clip--whole-frame.annotation-clip--dark .annotation-segment{background:repeating-linear-gradient(45deg,transparent,transparent 2px,hsla(0,0%,100%,.2) 0,hsla(0,0%,100%,.2) 4px)}.annotation-keyframe{position:absolute;height:100%;width:9px;border-radius:3px;left:0;border:1px solid hsla(0,0%,100%,.5)}.annotation-keyframe:last-child:not(:only-child){transform:translateX(-100%)}.annotation-keyframe--selected{border:2px solid #fff;background-color:#ff5e00!important;z-index:1}.annotation-clip--compact{min-width:3px}.annotation-clip--compact .annotation-keyframe{width:3px}.annotation-clip--more-compact{min-width:3px}.annotation-clip--more-compact .annotation-keyframe{display:none}@-webkit-keyframes blink{49%{border-color:red}50%{border-color:rgba(255,0,0,0)}99%{border-color:rgba(255,0,0,0)}to{border-color:red}}@keyframes blink{49%{border-color:red}50%{border-color:rgba(255,0,0,0)}99%{border-color:rgba(255,0,0,0)}to{border-color:red}}.annotation-clip--tracking .annotation-keyframe{border:2px solid red;-webkit-animation:blink 1s infinite;animation:blink 1s infinite}.annotation-clip--whole-frame .annotation-keyframe{background:repeating-linear-gradient(45deg,transparent,transparent 2px,rgba(0,0,0,.3) 0,rgba(0,0,0,.3) 4px);background-size:100% 200%}.annotation-clip--whole-frame.annotation-clip--dark .annotation-keyframe{background:repeating-linear-gradient(45deg,transparent,transparent 2px,hsla(0,0%,100%,.3) 0,hsla(0,0%,100%,.3) 4px)}.uiv-datepicker .btn-default{background-color:#111} diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 416151d31..a2d28e415 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,4 +1,4 @@ { - "/assets/scripts/main.js": "/assets/scripts/main.js?id=eb6371e87c99da80e2c0", - "/assets/styles/main.css": "/assets/styles/main.css?id=85e42250160e24febb38" + "/assets/scripts/main.js": "/assets/scripts/main.js?id=7beb25015f37ef585a11", + "/assets/styles/main.css": "/assets/styles/main.css?id=b8faac2691fd02d2c03d" } diff --git a/resources/assets/js/annotations/annotatorContainer.vue b/resources/assets/js/annotations/annotatorContainer.vue index 883c41b64..03c98443b 100644 --- a/resources/assets/js/annotations/annotatorContainer.vue +++ b/resources/assets/js/annotations/annotatorContainer.vue @@ -19,6 +19,7 @@ import Sidebar from '../core/components/sidebar'; import SidebarTab from '../core/components/sidebarTab'; import UserFilter from './models/UserAnnotationFilter'; import VolumeImageAreaApi from './api/volumes'; +import {CrossOriginError} from './stores/images'; import {debounce} from './../core/utils'; import {handleErrorResponse} from '../core/messages/store'; import {urlParams as UrlParams} from '../core/utils'; @@ -74,6 +75,7 @@ export default { openTab: null, userUpdatedVolareResolution: false, userId: null, + crossOriginError: false, }; }, computed: { @@ -133,6 +135,9 @@ export default { return imagesIds; }, + hasCrossOriginError() { + return !this.loading && this.crossOriginError; + }, }, methods: { getImageAndAnnotationsPromises(id) { @@ -524,7 +529,11 @@ export default { Settings.delete('openTab'); }, handleLoadingError(message) { - Messages.danger(message); + if (message instanceof CrossOriginError) { + this.crossOriginError = true; + } else { + Messages.danger(message); + } }, createSampledAnnotation() { this.$refs.canvas.createSampledAnnotation(); @@ -553,6 +562,7 @@ export default { imageId(id) { if (id) { this.startLoading(); + this.crossOriginError = false; Vue.Promise.all(this.getImageAndAnnotationsPromises(id)) .then(this.setCurrentImageAndAnnotations) .then(this.updateUrlSlug) diff --git a/resources/assets/js/annotations/components/annotationCanvas/magicWandInteraction.vue b/resources/assets/js/annotations/components/annotationCanvas/magicWandInteraction.vue index 1acf112cf..d49f5e321 100644 --- a/resources/assets/js/annotations/components/annotationCanvas/magicWandInteraction.vue +++ b/resources/assets/js/annotations/components/annotationCanvas/magicWandInteraction.vue @@ -12,11 +12,8 @@ let magicWandInteraction; export default { computed: { - crossOrigin() { - return this.image && this.image.crossOrigin; - }, isMagicWanding() { - return this.interactionMode === 'magicWand' && !this.crossOrigin; + return this.interactionMode === 'magicWand'; }, }, methods: { @@ -38,7 +35,7 @@ export default { maybeSetMagicWandLayer(image, oldImage) { // Swap source layers for the magic wand interaction if image types // change. - if (image && !this.crossOrigin) { + if (image) { if (image.tiled === true) { if (!oldImage || oldImage.tiled !== true) { magicWandInteraction.setLayer(this.tiledImageLayer); diff --git a/resources/assets/js/annotations/components/settingsTab.vue b/resources/assets/js/annotations/components/settingsTab.vue index 1dcf56d1f..158a14e0b 100644 --- a/resources/assets/js/annotations/components/settingsTab.vue +++ b/resources/assets/js/annotations/components/settingsTab.vue @@ -57,9 +57,6 @@ export default { plugins() { return plugins; }, - crossOrigin() { - return this.image && this.image.crossOrigin; - }, settings() { return Settings; }, diff --git a/resources/assets/js/annotations/stores/images.vue b/resources/assets/js/annotations/stores/images.vue index 073473bfc..1be645895 100644 --- a/resources/assets/js/annotations/stores/images.vue +++ b/resources/assets/js/annotations/stores/images.vue @@ -2,6 +2,8 @@ import Events from '../../core/events'; import fx from '../vendor/glfx'; +export class CrossOriginError extends Error {} + /** * Store for the images of the annotation tool */ @@ -103,7 +105,7 @@ export default new Vue({ }); }, checkSupportsColorAdjustment(image) { - if (!this.fxCanvas || image.crossOrigin) { + if (!this.fxCanvas) { return false; } @@ -148,7 +150,6 @@ export default new Vue({ width: 0, height: 0, canvas: document.createElement('canvas'), - crossOrigin: false, }; // Disable auto-rotation. Otherwise the canvas element might use the @@ -198,13 +199,10 @@ export default new Vue({ .catch(function (response) { // I could not find any reliable way to detect a failure due to // blocking of CORS. But the status seemed to be always 0. - // If CORS is blocked, we can still display the image but have to - // disable a few features that require reading the image data. + // Cross-origin images without CORS are no longer supported. + // see: https://github.com/biigle/core/issues/351 if (response.status === 0) { - imageWrapper.crossOrigin = true; - img.src = response.url; - - return promise; + throw new CrossOriginError(); } return Vue.Promise.reject(`Failed to load image ${id}!`); diff --git a/resources/assets/js/core/components/loaderBlock.vue b/resources/assets/js/core/components/loaderBlock.vue index f7a509853..1a49e0e7d 100644 --- a/resources/assets/js/core/components/loaderBlock.vue +++ b/resources/assets/js/core/components/loaderBlock.vue @@ -1,11 +1,12 @@ diff --git a/resources/assets/js/core/mixins/loader.vue b/resources/assets/js/core/mixins/loader.vue index bf38c6198..2b5a1ad55 100644 --- a/resources/assets/js/core/mixins/loader.vue +++ b/resources/assets/js/core/mixins/loader.vue @@ -1,6 +1,7 @@