diff --git a/LocateText.py b/LocateText.py old mode 100755 new mode 100644 index 1cd31c9..9421b0d --- a/LocateText.py +++ b/LocateText.py @@ -1,79 +1,135 @@ #!/usr/bin/python -# vim: set ts=2 expandtab: -""" -Module: LocateText -Desc: -Author: John O'Neil -Email: oneil.john@gmail.com -DATE: Saturday, Sept 14th 2013 - - Setment raw manga scan and output image - with text areas outlined in red. - -""" -#import clean_page as clean + +import image_io as imgio import connected_components as cc -import run_length_smoothing as rls import clean_page as clean import ocr import segmentation as seg import furigana -import arg import defaults -from imageio import imwrite import numpy as np import cv2 -import sys + +import arg import argparse +import sys import os -import scipy.ndimage -import datetime +import time -if __name__ == '__main__': +def process_image(infile, outfile, path, anno_dir_exists=False): + + t0 = time.perf_counter() + + # get correct output paths + path = imgio.normalize_path(path) + img_out, txt_out = imgio.get_output_directory(path, infile, path, os.path.splitext(infile)[0] + '.txt', outfile) + html_path = os.path.split(img_out)[0] + + img = cv2.imread(path+infile) + img_copy = img.copy() + gray = clean.grayscale(img) + + binary_threshold=arg.integer_value('binary_threshold',default_value=defaults.BINARY_THRESHOLD) + if arg.boolean_value('verbose'): + print('Binarizing with threshold value of ' + str(binary_threshold)) + inv_binary = cv2.bitwise_not(clean.binarize(gray, threshold=binary_threshold)) + + # python MangaOCR.py -p -o + segmented_image = seg.segment_image(gray) + segmented_image = segmented_image[:,:,2] + + components = cc.get_connected_components(segmented_image) + + if arg.boolean_value('debug'): + cc.draw_bounding_boxes(img,components,color=(255,0,0),line_size=2) + imgio.save_image(img, img_out) + else: + cc.draw_bounding_boxes(img,components,color=(255,0,0),line_size=2) + imgio.save_image(img, img_out) + + if arg.boolean_value('verbose'): + t1 = time.perf_counter() + print(f"Image processing done in {t1} seconds") - proc_start_time = datetime.datetime.now() - - parser = arg.parser - parser = argparse.ArgumentParser(description='Generate HTML annotation for raw manga scan with detected OCR\'d text.') - parser.add_argument('infile', help='Input (color) raw Manga scan image to annoate.') - parser.add_argument('-o','--output', dest='outfile', help='Output html file.') - parser.add_argument('-v','--verbose', help='Verbose operation. Print status messages during processing', action="store_true") - parser.add_argument('--display', help='Display output using OPENCV api and block program exit.', action="store_true") - parser.add_argument('--furigana', help='Attempt to suppress furigana characters which interfere with OCR.', action="store_true") - #parser.add_argument('-d','--debug', help='Overlay input image into output.', action="store_true") - parser.add_argument('--sigma', help='Std Dev of gaussian preprocesing filter.',type=float,default=None) - parser.add_argument('--binary_threshold', help='Binarization threshold value from 0 to 255.',type=int,default=defaults.BINARY_THRESHOLD) - #parser.add_argument('--segment_threshold', help='Threshold for nonzero pixels to separete vert/horiz text lines.',type=int,default=1) - parser.add_argument('--additional_filtering', help='Attempt to filter false text positives by histogram processing.', action="store_true") - arg.value = parser.parse_args() - - infile = arg.string_value('infile') - outfile = arg.string_value('outfile',default_value=infile + '.text_areas.png') - - if not os.path.isfile(infile): - print('Please provide a regular existing input file. Use -h option for help.') - sys.exit(-1) - img = cv2.imread(infile) - gray = clean.grayscale(img) - - binary_threshold=arg.integer_value('binary_threshold',default_value=defaults.BINARY_THRESHOLD) - if arg.boolean_value('verbose'): - print('Binarizing with threshold value of ' + str(binary_threshold)) - inv_binary = cv2.bitwise_not(clean.binarize(gray, threshold=binary_threshold)) - binary = clean.binarize(gray, threshold=binary_threshold) - - segmented_image = seg.segment_image(gray) - segmented_image = segmented_image[:,:,2] - components = cc.get_connected_components(segmented_image) - cc.draw_bounding_boxes(img,components,color=(255,0,0),line_size=2) - - imwrite(outfile, img) - - if arg.boolean_value('display'): - cv2.imshow('segmented_image',segmented_image) - - if cv2.waitKey(0) == 27: - cv2.destroyAllWindows() - cv2.destroyAllWindows() + if (not arg.boolean_value('html')): return + + texts = ocr.ocr_on_bounding_boxes(img_copy, components) + + if arg.boolean_value('verbose'): + t2 = time.perf_counter() + print(f"OCR done in {t2} seconds") + + if (arg.boolean_value('debug')): + imgio.save_text(texts, txt_out) + + html_out = imgio.generate_html(os.path.split(img_out)[1], components, texts) + if (not anno_dir_exists): + imgio.copytree_('./annotorious/', imgio.normalize_path(html_path)+'annotorious/') + anno_dir_exists = True + + imgio.save_webpage(html_out, os.path.splitext(img_out)[0]+'.html') + + return anno_dir_exists + +def main(): + + # Working commands + # python MangaOCR_dev.py -i -o + # python MangaOCR_dev.py -p -o + # python MangaOCR_dev.py -p --default_directory + + parser = arg.parser + parser = argparse.ArgumentParser(description='Generate text file containing OCR\'d text.') + group = parser.add_mutually_exclusive_group(required=True) + group.add_argument('-i', '--infile', help='Input image to annotate.', dest='infile', type=str) + group.add_argument('-p', '--inpath', help='Path to directory containing image(s)', dest='inpath', type=str) + parser.add_argument('-o','--output', help='Output file or filepath.', dest='outfile') + parser.add_argument('-s','--scheme', help='Output naming scheme. Appended to input filename', dest='scheme', type=str, default='_text') + parser.add_argument('-v','--verbose', help='Verbose operation. Print status messages during processing', action="store_true") + # parser.add_argument('-d','--debug', help='Overlay input image into output.', action="store_true") + parser.add_argument('--html', help='Display output in an html file.', action="store_true") + parser.add_argument('--furigana', help='Attempt to suppress furigana characters which interfere with OCR.', action="store_true") + parser.add_argument('--sigma', help='Std Dev of gaussian preprocesing filter.',type=float,default=None) + parser.add_argument('--binary_threshold', help='Binarization threshold value from 0 to 255.',type=int,default=defaults.BINARY_THRESHOLD) + parser.add_argument('--additional_filtering', help='Attempt to filter false text positives by histogram processing.', action="store_true") + parser.add_argument('--default_directory', help='Store output in predefined folders.', action="store_true") + arg.value = parser.parse_args() + + infile = arg.string_value('infile') + inpath = arg.string_value('inpath') + scheme = arg.string_value('scheme') + outfile = arg.string_value('outfile') + + if os.path.isfile(infile): + if arg.boolean_value('verbose'): + print('File exists. Performing OCR . . .') + path_, infile_ = os.path.split(infile) + process_image(infile_, outfile, path_) + sys.exit(-1) + + infiles = os.listdir(inpath) + anno_dir_exists = False + if infiles: + if arg.boolean_value('verbose'): + print('Non-empty directory. Attempting to perform ocr on all files . . .') + for infile_ in infiles: + try: + outfile_ = outfile + anno_dir_exists = process_image(infile_, outfile_, inpath, anno_dir_exists) + except AttributeError as e: + if arg.boolean_value('verbose'): + print('Input file \"', infile_, '\" is not an image', sep='') + sys.exit(-1) + + # More error handling + if not (os.path.isfile(infile) or inpath): + print('Please provide a regular existing input file. Use -h option for help.') + sys.exit(-1) + if not (infiles): + print('Directory is empty. Place images on the desired folder. Use -h option for help.') + sys.exit(-1) + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/README.md b/README.md index 73a8490..7c5f0c1 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,21 @@ Overview -------- This repository holds some experiments I did in summer 2013 during a sudden interest in text detection in images. It uses some standard techniques (run length smoothing, connected component analysis) and some experimental stuff. Overall, I was able to get in the neighborhood of where I wanted to be, but the results are very processing intensive and not terribly reliable. +Usage +----- +Provide an input file or path using the arguments `-i` and `-p`, respectively. When an input path is provided, all files in the directory are processed. The user may provide a corresponding output file or path using the `-o` argument. The output is saved in the default file/directory if no output argument is defined. +``` + python LocateText.py -i -o + python LocateText.py -p -o + python LocateText.py -p --default_directory +``` +Other useful arguments: +``` + --html : Display output in an html file. + --default-directory : Store output in predefined folders. This is recommended for processing images in a directory since the input may be overwritten. + --additional_filtering : Attempt to filter false text positives by histogram processing. +``` + State ----- I haven't bothered to form this into a python library. It's just a series of scripts each trying out various things, such as: @@ -19,17 +34,17 @@ I haven't bothered to form this into a python library. It's just a series of scr Text Location Example --------------------- Here's an example run of a page from Weekly Young Magazine #31 2013. The input image is as follows (jpg). -![Input image](https://github.com/johnoneil/MangaTextDetection/blob/master/test/194.jpg?raw=true) +![Input image](doc/194.jpg) -An initial estimate of text locations can be found by the 'LocateText.py' script: +An initial estimate of text locations can be found by the `LocateText.py` script: ``` - ../LocateText.py '週刊ヤングマガジン31号194.jpg' -o 194_text_locations.png + python LocateText.py -i 194.jpg ``` With the results as follows (estimated text marked with red boxes): -![locate text output](https://github.com/johnoneil/MangaTextDetection/blob/master/test/194_text_locations_thumb.png?raw=true) +![Locate text output](doc/194_text_areas_no_filter.jpg) Note that in the output above you see several of the implementation deficiencies. For example, there are several small false positives scattered around, and some major false positives on the girl's sleeve and eyes in panels 2 and 3. Also note that many large areas of text were not detected (false negatives). Despite how pleased I was with the results (and I was more pleased than you could possibly believe) significant improvements are needed. @@ -39,63 +54,33 @@ Text Segmentation Example To more easily separate text from background you can also segment the image, with text areas and non text being separated into different (RGB) color channels. This easily allows you to remove estimated text from image entirely or vice-versa. Use the command: ``` -./segmentation.py '週刊ヤングマガジン31号194.jpg' -o 194_segmentation.png + python segmentation.py 194.jpg -o 194_segmentation.png ``` The results follow: -![Input image](https://github.com/johnoneil/MangaTextDetection/blob/master/test/194_segmentation_thumb.png?raw=true) +![Segmentation image](doc/194_segmentation.png) OCR and Html Generation ----------------------- -I did take the time to run simple OCR on some of the located text regions, with mixed results. I used the python tesseract package (pytesser) but found the results were not generally good for vertical text, among other issues. -The script ocr.py should run ocr on detected text regions, and output the results to the command line. -``` -../ocr.py '週刊ヤングマガジン31号194.jpg' -Test blob assigned to no row on pass 2 -Test blob assigned to no row on pass 3 -0,0 1294x2020 71% :ぅん'・ 結局 -玉子かけご飯が -一 番ぉぃしぃと +I did take the time to run simple OCR on some of the located text regions. This uses the python wrapper for Google's OCR engine Tesseract (pytesserract). Unlike the original version of the `ocr.py` script, text is assumed to be vertically aligned. -从 -胤 -赫 -囃 -包 -け -H」 -の -も -側 -鵬 +I also embedded those results in an HTML output, allowing "readers" to hover on Japanese Text, revealing the OCR output, which can be edited/copied/pasted. This is by using the optional argument `--html`. Some examples can be seen below: -はフィクショ穴ぁり、 登場する人物 +![OCR output success](doc/194_html_ocr_success.png) +![OCR output success](doc/194_html_ocr_failure.png) -※この物語 - -``` -You can see some fragmented positives, but in all the results for this page are abysmal. - -I also embedded those results in an HTML output, allowing "readers" to hover on Japanese Text, revealing the OCR output, which can be edited/copied/pasted. This is via the script MangaDetectText. A (more successful) example of this can be seen below: - -![locate text output](https://github.com/johnoneil/MangaTextDetection/blob/master/test/example.png?raw=true) +Even after using `jpn_vert` trained data, results are still unreliable. Most of the bounding boxes with larger width return successful results. Error mostly happens when the bounding box only has one line of vertically-aligned text. Dependencies ----------------------- You should be able to install most of the dependencies via pip, or you could use your operating systems package manager (e.g. Mac OS X http://brew.sh/) -### Python 2.7+ +### Python 3+ https://www.python.org/ Install as per OS instructions. -### Pip - -http://pip.readthedocs.org/en/latest/index.html - -Install as per OS instructions. - ### Numpy http://www.numpy.org/ @@ -141,8 +126,9 @@ Install as per OS instructions, this should also include the python bindings. https://code.google.com/p/tesseract-ocr/ Install as per OS instructions, then use pip to install the python bindings. -Don't forget to include your target language's trained data sets. +Don't forget to include your target language's trained data sets and set the `tesseract_cmd` PATH. (See `ocr.py` script) ``` -pip install python-tesseract +Edit line 7 of ocr.py script: +pytesseract.pytesseract.tesseract_cmd = ``` diff --git a/annotorious.css b/annotorious.css deleted file mode 100644 index 9a455e3..0000000 --- a/annotorious.css +++ /dev/null @@ -1,271 +0,0 @@ -/** Global item styles **/ - -.annotorious-opacity-fade { - -moz-transition-property: opacity; - -moz-transition-duration: 0.5s; - -moz-transition-delay: 0s; - -webkit-transition-property: opacity; - -webkit-transition-duration: 0.5s; - -webkit-transition-delay: 0s; - -o-transition-property: opacity; - -o-transition-duration: 0.5s; - -o-transition-delay: 0s; - transition-property: opacity; - transition-duration: 0.5s; - transition-delay: 0s; -} - -.annotorious-item-focus { - opacity:1.0; -} - -.annotorious-item-unfocus { - opacity:0.4; -} - -/** Hint/help popup **/ - -.annotorious-hint-msg { - background-color:rgba(0,0,0,0.5); - margin:4px; - padding:8px 15px 8px 30px; - font-family: 'lucida grande',tahoma,verdana,arial,sans-serif; - line-height: normal; - font-size:12px; - color:#fff; - border-radius:4px; - -moz-border-radius:4px; - -webkit-border-radius:4px; - -khtml-border-radius:4px; -} - -.annotorious-hint-icon { - position:absolute; - top:6px; - left: 5px; - background:url('feather_icon.png'); - background-repeat:no-repeat; - width:19px; - height:22px; - margin:2px 4px 0px 6px; -} - -/** Popup **/ - -.annotorious-popup { - line-height:135%; - font-family:Arial, Verdana, Sans; - font-size:12px; - color:#000; - background-color:#fff; - border:1px solid #ccc; - padding:9px 8px; - word-wrap:break-word; - width:180px; - border-radius: 3px; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - -khtml-border-radius: 3px; - -moz-box-shadow:0px 5px 15px #111; - -webkit-box-shadow:0px 5px 15px #111; - box-shadow:0px 5px 15px #111; - - -moz-transition-property: opacity; - -moz-transition-duration: 0.5s; - -moz-transition-delay: 0s; - -webkit-transition-property: opacity; - -webkit-transition-duration: 0.5s; - -webkit-transition-delay: 0s; - -o-transition-property: opacity; - -o-transition-duration: 0.5s; - -o-transition-delay: 0s; - transition-property: opacity; - transition-duration: 0.5s; - transition-delay: 0s; -} - -.annotorious-popup-empty { - color:#999; - font-style:italic; -} - -.annotorious-popup-buttons { - float:right; - margin:0px 0px 1px 10px; - height:16px; - - -moz-transition-property: opacity; - -moz-transition-duration: 1s; - -moz-transition-delay: 0s; - -webkit-transition-property: opacity; - -webkit-transition-duration: 1s; - -webkit-transition-delay: 0s; - -o-transition-property: opacity; - -o-transition-duration: 1s; - -o-transition-delay: 0s; - transition-property: opacity; - transition-duration: 1s; - transition-delay: 0s; -} - -.annotorious-popup-button { - font-size:10px; - text-decoration:none; - display:inline-block; - color:#000; - font-weight:bold; - margin-left:5px; - opacity:0.4; - - -moz-transition-property: opacity; - -moz-transition-duration: 0.5s; - -moz-transition-delay: 0s; - -webkit-transition-property: opacity; - -webkit-transition-duration: 0.5s; - -webkit-transition-delay: 0s; - -o-transition-property: opacity; - -o-transition-duration: 0.5s; - -o-transition-delay: 0s; - transition-property: opacity; - transition-duration: 0.5s; - transition-delay: 0s; -} - -.annotorious-popup-button:hover { - background-color:transparent; -} - -.annotorious-popup-button-active { - opacity:0.9; -} - -.annotorious-popup-button-edit { - background:url(pencil.png); - width:16px; - height:16px; - text-indent:100px; - overflow:hidden; -} - -.annotorious-popup-button-delete { - background:url(delete.png); - width:16px; - height:16px; - text-indent:100px; - overflow:hidden; - float:right; -} - -.annotorious-popup-field { - border-top:1px solid #ccc; - margin:6px 0px 0px 0px; - padding-top:2px; -} - -/** Editor **/ - -.annotorious-editor { - line-height: normal; - padding:0px 0px 2px 0px; - background-color:#f2f2f2; - color:#000; - opacity:0.97; - border:1px solid #ccc; - border-radius: 3px; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - -khtml-border-radius: 3px; - -moz-box-shadow:0px 5px 15px #111; - -webkit-box-shadow:0px 5px 15px #111; - box-shadow:0px 5px 15px #111; -} - -.annotorious-editor-text { - border-width:0px 0px 1px 0px; - border-style:solid; - border-color:#ccc; - line-height: normal; - background-color:#fff; - width:240px; - height:50px; - outline:none; - font-family:Verdana, Arial; - font-size:11px; - padding:4px; - margin:0px; - color:#000; - text-shadow:none; - overflow-y:auto; - display:block; -} - -.annotorious-editor-button-container { - padding-top:2px; -} - -.annotorious-editor-button { - float:right; - line-height: normal; - display:inline-block; - text-align:center; - text-decoration:none; - font-family:Verdana, Arial; - font-size:10px; - border:1px solid #777; - color:#ddd; - padding:3px 8px; - margin:1px 2px 0px 1px; - cursor:pointer; - cursor:hand; - background:-webkit-gradient(linear, left top, left bottom, from(#888), to(#555)); - background:-moz-linear-gradient(top, #888, #555); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#888888', endColorstr='#555555'); - -moz-border-radius:2px; - -webkit-border-radius:2px; - -khtml-border-radius:2px; - border-radius:2px; -} - -.annotorious-editor-button:hover { - background:#999; -} - -.annotorious-editor-field { - border-bottom:1px solid #ccc; - margin:0px; - background-color:#fff; - padding:3px; - font-family:Verdana, Arial; - font-size:12px; -} - -/** OpenLayers module **/ -.annotorious-ol-boxmarker-outer { - border:1px solid #000; -} - -.annotorious-ol-boxmarker-inner { - border:1px solid #fff; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - -ms-box-sizing: border-box; - box-sizing: border-box; -} - -.annotorious-ol-hint { - line-height: normal; - font-family:Arial, Verdana, Sans; - font-size:16px; - color:#000; - background-color:#fff; - margin:0px; - padding:9px; - border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - -khtml-border-radius: 5px; -} - -.annotorious-ol-hint-secondary { - background-color:#fff000; -} diff --git a/annotorious.min.js b/annotorious.min.js deleted file mode 100644 index c622c13..0000000 --- a/annotorious.min.js +++ /dev/null @@ -1,240 +0,0 @@ -function g(a){throw a;}var i=void 0,j=!0,m=null,n=!1;function aa(){return function(){}}function q(a){return function(){return this[a]}}function ba(a){return function(){return a}}var r,s=this;function ca(a,b){var c=a.split("."),d=s;!(c[0]in d)&&d.execScript&&d.execScript("var "+c[0]);for(var f;c.length&&(f=c.shift());)!c.length&&da(b)?d[f]=b:d=d[f]?d[f]:d[f]={}}function ea(){}function fa(a){a.ob=function(){return a.ld?a.ld:a.ld=new a}} -function ga(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function da(a){return a!==i}function ha(a){return"array"==ga(a)}function ia(a){var b=ga(a);return"array"==b||"object"==b&&"number"==typeof a.length}function t(a){return"string"==typeof a}function u(a){return"function"==ga(a)}function ja(a){var b=typeof a;return"object"==b&&a!=m||"function"==b}function ka(a){return a[la]||(a[la]=++ma)}var la="closure_uid_"+Math.floor(2147483648*Math.random()).toString(36),ma=0; -function na(a,b,c){return a.call.apply(a.bind,arguments)}function oa(a,b,c){a||g(Error());if(2")&&(a=a.replace(xa,">"));-1!=a.indexOf('"')&&(a=a.replace(ya,"""));return a}var va=/&/g,wa=//g,ya=/\"/g,ua=/[&<>\"]/;function za(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};var z=Array.prototype,Aa=z.indexOf?function(a,b,c){return z.indexOf.call(a,b,c)}:function(a,b,c){c=c==m?0:0>c?Math.max(0,a.length+c):c;if(t(a))return!t(b)||1!=b.length?-1:a.indexOf(b,c);for(;cc?m:t(a)?a.charAt(c):a[c]}function Fa(a,b){return 0<=Aa(a,b)}function C(a,b){var c=Aa(a,b);0<=c&&z.splice.call(a,c,1)}function Ga(a){var b=a.length;if(0=arguments.length?z.slice.call(a,b):z.slice.call(a,b,c)}function Ja(a,b){return a>b?1:aparseFloat(Wa)){Va=String($a);break a}}Va=Wa}var bb={}; -function I(a){var b;if(!(b=bb[a])){b=0;for(var c=sa(String(Va)).split("."),d=sa(String(a)).split("."),f=Math.max(c.length,d.length),e=0;0==b&&e(0==y[1].length?0:parseInt(y[1],10))?1:0)||((0==w[2].length)< -(0==y[2].length)?-1:(0==w[2].length)>(0==y[2].length)?1:0)||(w[2]y[2]?1:0)}while(0==b)}b=bb[a]=0<=b}return b}var cb={};function db(a){return cb[a]||(cb[a]=F&&!!document.documentMode&&document.documentMode>=a)};var eb,fb=!F||db(9);!G&&!F||F&&db(9)||G&&I("1.9.1");F&&I("9");var gb=F||D||H;function hb(a){a=a.className;return t(a)&&a.match(/\S+/g)||[]}function ib(a,b){var c=hb(a),d=Ia(arguments,1),f=c.length+d.length;jb(c,d);a.className=c.join(" ");return c.length==f}function kb(a,b){var c=hb(a),d=Ia(arguments,1),f=lb(c,d);a.className=f.join(" ");return f.length==c.length-d.length}function jb(a,b){for(var c=0;c");e=e.join("")}e=f.createElement(e);if(h)if(t(h))e.className=h;else if(ha(h))ib.apply(m,[e].concat(h));else{var k=e;ob(h,function(a,b){"style"==b?k.style.cssText=a:"class"==b?k.className=a:"for"==b?k.htmlFor=a:b in tb?k.setAttribute(tb[b],a):0==b.lastIndexOf("aria-",0)||0== -b.lastIndexOf("data-",0)?k.setAttribute(b,a):k[b]=a})}2a):n}function sb(a){this.I=a||s.document||document}r=sb.prototype;r.Yc=rb;r.c=function(a){return t(a)?this.I.getElementById(a):a};r.createElement=function(a){return this.I.createElement(a)};r.createTextNode=function(a){return this.I.createTextNode(a)}; -function Cb(a){var b=a.I,a=!H?b.documentElement:b.body,b=b.parentWindow||b.defaultView;return new J(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}r.appendChild=function(a,b){a.appendChild(b)};r.append=function(a,b){vb(K(a),a,arguments,1)};r.contains=Ab;var Db;Db=ba(j);/* - Portions of this code are from the Dojo Toolkit, received by - The Closure Library Authors under the BSD license. All other code is - Copyright 2005-2009 The Closure Library Authors. All Rights Reserved. - -The "New" BSD License: - -Copyright (c) 2005-2009, The Dojo Foundation -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - Neither the name of the Dojo Foundation nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -function Eb(a,b){var c=b||[];a&&c.push(a);return c}var Fb=H&&"BackCompat"==document.compatMode,Gb=document.firstChild.children?"children":"childNodes",Hb=n; -function Ib(a){function b(){0<=p&&(x.id=c(p,A).replace(/\\/g,""),p=-1);if(0<=w){var a=w==A?m:c(w,A);0>">~+".indexOf(a)?x.D=a:x.Lb=a;w=-1}0<=k&&(x.W.push(c(k+1,A).replace(/\\/g,"")),k=-1)}function c(b,c){return sa(a.slice(b,c))}for(var a=0<=">~+".indexOf(a.slice(-1))?a+" * ":a+" ",d=[],f=-1,e=-1,h=-1,l=-1,k=-1,p=-1,w=-1,y="",E="",Q,A=0,Fe=a.length,x=m,L=m;y=E,E=a.charAt(A),Af?f=f%d&&d+f%d:0=d&&(e=f-f%d),f%=d):0>d&&(d*=-1,0=e&&(0>h||a<=h)&&a%d==f};b=f}var l=parseInt(b,10);return function(a){return Tb(a)== -l}}},Yb=F?function(a){var b=a.toLowerCase();"class"==b&&(a="className");return function(c){return Hb?c.getAttribute(a):c[a]||c[b]}}:function(a){return function(b){return b&&b.getAttribute&&b.hasAttribute(a)}}; -function Wb(a,b){if(!a)return Db;var b=b||{},c=m;b.A||(c=Jb(c,Kb));b.D||"*"!=a.D&&(c=Jb(c,function(b){return b&&b.tagName==a.kc()}));b.W||B(a.W,function(a,b){var e=RegExp("(?:^|\\s)"+a+"(?:\\s|$)");c=Jb(c,function(a){return e.test(a.className)});c.count=b});b.ua||B(a.ua,function(a){var b=a.name;Xb[b]&&(c=Jb(c,Xb[b](b,a.value)))});b.xb||B(a.xb,function(a){var b,e=a.gc;a.type&&Mb[a.type]?b=Mb[a.type](e,a.rc):e.length&&(b=Yb(e));b&&(c=Jb(c,b))});b.id||a.id&&(c=Jb(c,function(b){return!!b&&b.id==a.id})); -c||"default"in b||(c=Db);return c}var Zb={}; -function $b(a){var b=Zb[a.Oa];if(b)return b;var c=a.jd,c=c?c.Lb:"",d=Wb(a,{A:1}),f="*"==a.D,e=document.getElementsByClassName;if(c)if(e={A:1},f&&(e.D=1),d=Wb(a,e),"+"==c)var h=d,b=function(a,b,c){for(;a=a[Ob];)if(!Nb||Kb(a)){(!c||ac(a,c))&&h(a)&&b.push(a);break}return b};else if("~"==c)var l=d,b=function(a,b,c){for(a=a[Ob];a;){if(Qb(a)){if(c&&!ac(a,c))break;l(a)&&b.push(a)}a=a[Ob]}return b};else{if(">"==c)var k=d,k=k||Db,b=function(a,b,c){for(var d=0,f=a[Gb];a=f[d++];)Qb(a)&&((!c||ac(a,c))&&k(a,d))&& -b.push(a);return b}}else if(a.id)d=!a.od&&f?Db:Wb(a,{A:1,id:1}),b=function(b,c){var f=rb(b).c(a.id),e;if(e=f&&d(f))if(!(e=9==b.nodeType)){for(e=f.parentNode;e&&e!=b;)e=e.parentNode;e=!!e}if(e)return Eb(f,c)};else if(e&&/\{\s*\[native code\]\s*\}/.test(String(e))&&a.W.length&&!Fb)var d=Wb(a,{A:1,W:1,id:1}),p=a.W.join(" "),b=function(a,b){for(var c=Eb(0,b),f,e=0,h=a.getElementsByClassName(p);f=h[e++];)d(f,a)&&c.push(f);return c};else!f&&!a.od?b=function(b,c){for(var d=Eb(0,c),f,e=0,h=b.getElementsByTagName(a.kc());f= -h[e++];)d.push(f);return d}:(d=Wb(a,{A:1,D:1,id:1}),b=function(b,c){for(var f=Eb(0,c),e,h=0,k=b.getElementsByTagName(a.kc());e=k[h++];)d(e,b)&&f.push(e);return f});return Zb[a.Oa]=b}var bc={},cc={};function dc(a){var b=Ib(sa(a));if(1==b.length){var c=$b(b[0]);return function(a){if(a=c(a,[]))a.Kb=j;return a}}return function(a){for(var a=Eb(a),c,e,h=b.length,l,k,p=0;p~+".indexOf(c)&&(!F||-1==a.indexOf(":"))&&!(Fb&&0<=a.indexOf("."))&&-1==a.indexOf(":contains")&&-1==a.indexOf("|=")){var f=0<=">~+".indexOf(a.charAt(a.length-1))?a+" *":a;return cc[a]=function(b){try{9==b.nodeType||d||g("");var c=b.querySelectorAll(f);F?c.Ed=j:c.Kb=j;return c}catch(e){return fc(a,j)(b)}}}var e=a.split(/\s*,\s*/);return bc[a]= -2>e.length?dc(a):function(a){for(var b=0,c=[],d;d=e[b++];)c=c.concat(dc(d)(a));return c}}var gc=0,hc=F?function(a){return Hb?a.getAttribute("_uid")||a.setAttribute("_uid",++gc)||gc:a.uniqueID}:function(a){return a._uid||(a._uid=++gc)};function ac(a,b){if(!b)return 1;var c=hc(a);return!b[c]?b[c]=1:0} -function ic(a){if(a&&a.Kb)return a;var b=[];if(!a||!a.length)return b;a[0]&&b.push(a[0]);if(2>a.length)return b;gc++;if(F&&Hb){var c=gc+"";a[0].setAttribute("_zipIdx",c);for(var d=1,f;f=a[d];d++)a[d].getAttribute("_zipIdx")!=c&&b.push(f),f.setAttribute("_zipIdx",c)}else if(F&&a.Ed)try{for(d=1;f=a[d];d++)Kb(f)&&b.push(f)}catch(e){}else{a[0]&&(a[0]._zipIdx=gc);for(d=1;f=a[d];d++)a[d]._zipIdx!=gc&&b.push(f),f._zipIdx=gc}return b} -function M(a,b){if(!a)return[];if(a.constructor==Array)return a;if(!t(a))return[a];if(t(b)&&(b=t(b)?document.getElementById(b):b,!b))return[];var b=b||document,c=b.ownerDocument||b.documentElement;Hb=b.contentType&&"application/xml"==b.contentType||D&&(b.doctype||"[object XMLDocument]"==c.toString())||!!c&&(F?c.xml:b.xmlVersion||c.xmlVersion);return(c=fc(a)(b))&&c.Kb?c:ic(c)}M.ua=Xb;ca("goog.dom.query",M);ca("goog.dom.query.pseudos",M.ua);var jc=!F||db(9),kc=!F||db(9),lc=F&&!I("9");!H||I("528");G&&I("1.9b")||F&&I("8")||D&&I("9.5")||H&&I("528");G&&!I("8")||F&&I("9");function mc(){0!=nc&&(this.ee=Error().stack,ka(this))}var nc=0;mc.prototype.Tc=n;function oc(a,b){this.type=a;this.currentTarget=this.target=b}r=oc.prototype;r.ta=n;r.defaultPrevented=n;r.Nb=j;r.stopPropagation=function(){this.ta=j};r.preventDefault=function(){this.defaultPrevented=j;this.Nb=n};function pc(a){a.preventDefault()};function qc(a){qc[" "](a);return a}qc[" "]=ea;function rc(a,b){a&&this.init(a,b)}v(rc,oc);var sc=[1,4,2];r=rc.prototype;r.target=m;r.relatedTarget=m;r.offsetX=0;r.offsetY=0;r.clientX=0;r.clientY=0;r.screenX=0;r.screenY=0;r.button=0;r.keyCode=0;r.charCode=0;r.ctrlKey=n;r.altKey=n;r.shiftKey=n;r.metaKey=n;r.vc=n;r.n=m; -r.init=function(a,b){var c=this.type=a.type;oc.call(this,c);this.target=a.target||a.srcElement;this.currentTarget=b;var d=a.relatedTarget;if(d){if(G){var f;a:{try{qc(d.nodeName);f=j;break a}catch(e){}f=n}f||(d=m)}}else"mouseover"==c?d=a.fromElement:"mouseout"==c&&(d=a.toElement);this.relatedTarget=d;this.offsetX=H||a.offsetX!==i?a.offsetX:a.layerX;this.offsetY=H||a.offsetY!==i?a.offsetY:a.layerY;this.clientX=a.clientX!==i?a.clientX:a.pageX;this.clientY=a.clientY!==i?a.clientY:a.pageY;this.screenX= -a.screenX||0;this.screenY=a.screenY||0;this.button=a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.vc=Oa?a.metaKey:a.ctrlKey;this.state=a.state;this.n=a;a.defaultPrevented&&this.preventDefault();delete this.ta};function tc(a){return(jc?0==a.n.button:"click"==a.type?j:!!(a.n.button&sc[0]))&&!(H&&Oa&&a.ctrlKey)} -r.stopPropagation=function(){rc.G.stopPropagation.call(this);this.n.stopPropagation?this.n.stopPropagation():this.n.cancelBubble=j};r.preventDefault=function(){rc.G.preventDefault.call(this);var a=this.n;if(a.preventDefault)a.preventDefault();else if(a.returnValue=n,lc)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};r.Fd=q("n");function uc(){}var vc=0;r=uc.prototype;r.key=0;r.va=n;r.Oc=n;r.init=function(a,b,c,d,f,e){u(a)?this.nd=j:a&&a.handleEvent&&u(a.handleEvent)?this.nd=n:g(Error("Invalid listener argument"));this.Na=a;this.sd=b;this.src=c;this.type=d;this.capture=!!f;this.Ja=e;this.Oc=n;this.key=++vc;this.va=n};r.handleEvent=function(a){return this.nd?this.Na.call(this.Ja||this.src,a):this.Na.handleEvent.call(this.Na,a)};var wc={},N={},xc={},yc={}; -function O(a,b,c,d,f){if(b){if(ha(b)){for(var e=0;ee.keyCode||e.returnValue!=i)return j;a:{var p=n;if(0==e.keyCode)try{e.keyCode=-1;break a}catch(w){p=j}if(p||e.returnValue==i)e.returnValue=j}}p=new rc;p.init(e,this);e=j;try{if(l){for(var y=[],E=p.currentTarget;E;E=E.parentNode)y.push(E);h=f[j];h.K=h.m;for(var Q= -y.length-1;!p.ta&&0<=Q&&h.K;Q--)p.currentTarget=y[Q],e&=Dc(h,y[Q],d,j,p);if(k){h=f[n];h.K=h.m;for(Q=0;!p.ta&&Q=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom};function Kc(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}Kc.prototype.contains=function(a){return a instanceof Kc?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height};function S(a,b,c){t(b)?Lc(a,c,b):ob(b,qa(Lc,a))}function Lc(a,b,c){a.style[za(c)]=b}function T(a,b){var c=K(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,m))?c[b]||c.getPropertyValue(b)||"":""}function Mc(a,b){return a.currentStyle?a.currentStyle[b]:m}function Nc(a,b){return T(a,b)||Mc(a,b)||a.style&&a.style[b]}function Oc(a,b,c){var d,f=G&&(Oa||Ua)&&I("1.9");b instanceof J?(d=b.x,b=b.y):(d=b,b=c);a.style.left=Pc(d,f);a.style.top=Pc(b,f)} -function Qc(a){var b=a.getBoundingClientRect();F&&(a=a.ownerDocument,b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+a.body.clientTop);return b} -function Rc(a){if(F&&!db(8))return a.offsetParent;for(var b=K(a),c=Nc(a,"position"),d="fixed"==c||"absolute"==c,a=a.parentNode;a&&a!=b;a=a.parentNode)if(c=Nc(a,"position"),d=d&&"static"==c&&a!=b.documentElement&&a!=b.body,!d&&(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight||"fixed"==c||"absolute"==c||"relative"==c))return a;return m} -function Sc(a){var b,c=K(a),d=Nc(a,"position"),f=G&&c.getBoxObjectFor&&!a.getBoundingClientRect&&"absolute"==d&&(b=c.getBoxObjectFor(a))&&(0>b.screenX||0>b.screenY),e=new J(0,0),h;b=c?K(c):document;if(h=F)if(h=!db(9))rb(b),h=n;h=h?b.body:b.documentElement;if(a==h)return e;if(a.getBoundingClientRect)b=Qc(a),a=Cb(rb(c)),e.x=b.left+a.x,e.y=b.top+a.y;else if(c.getBoxObjectFor&&!f)b=c.getBoxObjectFor(a),a=c.getBoxObjectFor(h),e.x=b.screenX-a.screenX,e.y=b.screenY-a.screenY;else{f=a;do{e.x+=f.offsetLeft; -e.y+=f.offsetTop;f!=a&&(e.x+=f.clientLeft||0,e.y+=f.clientTop||0);if(H&&"fixed"==Nc(f,"position")){e.x+=c.body.scrollLeft;e.y+=c.body.scrollTop;break}f=f.offsetParent}while(f&&f!=a);if(D||H&&"absolute"==d)e.y-=c.body.offsetTop;for(f=a;(f=Rc(f))&&f!=c.body&&f!=h;)if(e.x-=f.scrollLeft,!D||"TR"!=f.tagName)e.y-=f.scrollTop}return e}function Tc(a,b){var c=Uc(a),d=Uc(b);return new J(c.x-d.x,c.y-d.y)} -function Uc(a){var b=new J;if(1==a.nodeType){if(a.getBoundingClientRect){var c=Qc(a);b.x=c.left;b.y=c.top}else{var c=Cb(rb(a)),d=Sc(a);b.x=d.x-c.x;b.y=d.y-c.y}if(G&&!I(12)){var f;F?f="-ms-transform":H?f="-webkit-transform":D?f="-o-transform":G&&(f="-moz-transform");var e;f&&(e=Nc(a,f));e||(e=Nc(a,"transform"));e?(a=e.match(Vc),a=!a?new J(0,0):new J(parseFloat(a[1]),parseFloat(a[2]))):a=new J(0,0);b=new J(b.x+a.x,b.y+a.y)}}else f=u(a.Fd),e=a,a.targetTouches?e=a.targetTouches[0]:f&&a.n.targetTouches&& -(e=a.n.targetTouches[0]),b.x=e.clientX,b.y=e.clientY;return b}function Wc(a,b,c){b instanceof nb?(c=b.height,b=b.width):c==i&&g(Error("missing height argument"));a.style.width=Pc(b,j);a.style.height=Pc(c,j)}function Pc(a,b){"number"==typeof a&&(a=(b?Math.round(a):a)+"px");return a} -function Xc(a){if("none"!=Nc(a,"display"))return Yc(a);var b=a.style,c=b.display,d=b.visibility,f=b.position;b.visibility="hidden";b.position="absolute";b.display="inline";a=Yc(a);b.display=c;b.position=f;b.visibility=d;return a}function Yc(a){var b=a.offsetWidth,c=a.offsetHeight,d=H&&!b&&!c;return(!da(b)||d)&&a.getBoundingClientRect?(a=Qc(a),new nb(a.right-a.left,a.bottom-a.top)):new nb(b,c)}function Zc(a){var b=Sc(a),a=Xc(a);return new Kc(b.x,b.y,a.width,a.height)} -function U(a,b){var c=a.style;"opacity"in c?c.opacity=b:"MozOpacity"in c?c.MozOpacity=b:"filter"in c&&(c.filter=""===b?"":"alpha(opacity="+100*b+")")}function V(a,b){a.style.display=b?"":"none"}function $c(a){return"rtl"==Nc(a,"direction")}var ad=G?"MozUserSelect":H?"WebkitUserSelect":m; -function bd(a,b){if(/^\d+px?$/.test(b))return parseInt(b,10);var c=a.style.left,d=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=b;var f=a.style.pixelLeft;a.style.left=c;a.runtimeStyle.left=d;return f} -function cd(a,b){if(F){var c=bd(a,Mc(a,b+"Left")),d=bd(a,Mc(a,b+"Right")),f=bd(a,Mc(a,b+"Top")),e=bd(a,Mc(a,b+"Bottom"));return new Jc(f,d,e,c)}c=T(a,b+"Left");d=T(a,b+"Right");f=T(a,b+"Top");e=T(a,b+"Bottom");return new Jc(parseFloat(f),parseFloat(d),parseFloat(e),parseFloat(c))}var dd={thin:2,medium:4,thick:6};function ed(a,b){if("none"==Mc(a,b+"Style"))return 0;var c=Mc(a,b+"Width");return c in dd?dd[c]:bd(a,c)} -function fd(a){if(F){var b=ed(a,"borderLeft"),c=ed(a,"borderRight"),d=ed(a,"borderTop"),a=ed(a,"borderBottom");return new Jc(d,c,a,b)}b=T(a,"borderLeftWidth");c=T(a,"borderRightWidth");d=T(a,"borderTopWidth");a=T(a,"borderBottomWidth");return new Jc(parseFloat(d),parseFloat(c),parseFloat(a),parseFloat(b))}var Vc=/matrix\([0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, ([0-9\.\-]+)p?x?, ([0-9\.\-]+)p?x?\)/;function gd(a,b,c){mc.call(this);this.target=a;this.handle=b||a;this.pc=c||new Kc(NaN,NaN,NaN,NaN);this.I=K(a);this.fa=new Fc(this);O(this.handle,["touchstart","mousedown"],this.Yd,n,this)}v(gd,Ic);var hd=F||G&&I("1.9.3");r=gd.prototype;r.clientX=0;r.clientY=0;r.screenX=0;r.screenY=0;r.wd=0;r.xd=0;r.Ea=0;r.Fa=0;r.Vc=j;r.pa=n;r.hd=0;r.Pd=0;r.Md=n;r.Bc=n;r.Bb=q("fa");function id(a){da(a.ka)||(a.ka=$c(a.target));return a.ka} -r.Yd=function(a){var b="mousedown"==a.type;if(this.Vc&&!this.pa&&(!b||tc(a))){jd(a);if(0==this.hd)if(this.dispatchEvent(new kd("start",this,a.clientX,a.clientY,a)))this.pa=j,a.preventDefault();else return;else a.preventDefault();var b=this.I,c=b.documentElement,d=!hd;R(this.fa,b,["touchmove","mousemove"],this.Kd,d);R(this.fa,b,["touchend","mouseup"],this.zb,d);hd?(c.setCapture(n),R(this.fa,c,"losecapture",this.zb)):R(this.fa,b?b.parentWindow||b.defaultView:window,"blur",this.zb);F&&this.Md&&R(this.fa, -b,"dragstart",pc);this.Vd&&R(this.fa,this.Vd,"scroll",this.Sd,d);this.clientX=this.wd=a.clientX;this.clientY=this.xd=a.clientY;this.screenX=a.screenX;this.screenY=a.screenY;this.Bc?(a=this.target,b=a.offsetLeft,c=a.offsetParent,!c&&"fixed"==Nc(a,"position")&&(c=K(a).documentElement),c?(G?(d=fd(c),b+=d.left):db(8)&&(d=fd(c),b-=d.left),a=$c(c)?c.clientWidth-(b+a.offsetWidth):b):a=b):a=this.target.offsetLeft;this.Ea=a;this.Fa=this.target.offsetTop;this.tc=Cb(rb(this.I));this.Pd=ra()}else this.dispatchEvent("earlycancel")}; -r.zb=function(a,b){this.fa.Mb();hd&&this.I.releaseCapture();if(this.pa){jd(a);this.pa=n;var c=ld(this,this.Ea),d=md(this,this.Fa);this.dispatchEvent(new kd("end",this,a.clientX,a.clientY,a,c,d,b||"touchcancel"==a.type))}else this.dispatchEvent("earlycancel");("touchend"==a.type||"touchcancel"==a.type)&&a.preventDefault()}; -function jd(a){var b=a.type;"touchstart"==b||"touchmove"==b?a.init(a.n.targetTouches[0],a.currentTarget):("touchend"==b||"touchcancel"==b)&&a.init(a.n.changedTouches[0],a.currentTarget)} -r.Kd=function(a){if(this.Vc){jd(a);var b=(this.Bc&&id(this)?-1:1)*(a.clientX-this.clientX),c=a.clientY-this.clientY;this.clientX=a.clientX;this.clientY=a.clientY;this.screenX=a.screenX;this.screenY=a.screenY;if(!this.pa){var d=this.wd-this.clientX,f=this.xd-this.clientY;if(d*d+f*f>this.hd)if(this.dispatchEvent(new kd("start",this,a.clientX,a.clientY,a)))this.pa=j;else{this.Tc||this.zb(a);return}}c=nd(this,b,c);b=c.x;c=c.y;this.pa&&this.dispatchEvent(new kd("beforedrag",this,a.clientX,a.clientY,a, -b,c))&&(od(this,a,b,c),a.preventDefault())}};function nd(a,b,c){var d=Cb(rb(a.I)),b=b+(d.x-a.tc.x),c=c+(d.y-a.tc.y);a.tc=d;a.Ea+=b;a.Fa+=c;b=ld(a,a.Ea);a=md(a,a.Fa);return new J(b,a)}r.Sd=function(a){var b=nd(this,0,0);a.clientX=this.clientX;a.clientY=this.clientY;od(this,a,b.x,b.y)};function od(a,b,c,d){a.Sc(c,d);a.dispatchEvent(new kd("drag",a,b.clientX,b.clientY,b,c,d))} -function ld(a,b){var c=a.pc,d=!isNaN(c.left)?c.left:m,c=!isNaN(c.width)?c.width:0;return Math.min(d!=m?d+c:Infinity,Math.max(d!=m?d:-Infinity,b))}function md(a,b){var c=a.pc,d=!isNaN(c.top)?c.top:m,c=!isNaN(c.height)?c.height:0;return Math.min(d!=m?d+c:Infinity,Math.max(d!=m?d:-Infinity,b))}r.Sc=function(a,b){this.Bc&&id(this)?this.target.style.right=a+"px":this.target.style.left=a+"px";this.target.style.top=b+"px"}; -function kd(a,b,c,d,f,e,h,l){oc.call(this,a);this.clientX=c;this.clientY=d;this.ce=f;this.left=da(e)?e:b.Ea;this.top=da(h)?h:b.Fa;this.ge=b;this.fe=!!l}v(kd,oc);function pd(a){for(var b=0,c=0;a&&!isNaN(a.offsetLeft)&&!isNaN(a.offsetTop);)b+=a.offsetLeft-a.scrollLeft,c+=a.offsetTop-a.scrollTop,a=a.offsetParent;return{top:c,left:b}};function qd(){this.Va=[]}qd.prototype.k=function(a,b){this.Va[a]||(this.Va[a]=[]);this.Va[a].push(b)};qd.prototype.Pa=function(a,b){var c=this.Va[a];c&&C(c,b)};qd.prototype.fireEvent=function(a,b){var c=n,d=this.Va[a];d&&B(d,function(a){a=a(b);da(a)&&!a&&(c=j)});return c};function rd(a,b){this.S={};this.h=[];var c=arguments.length;if(12*this.m&&sd(this),j):n};function sd(a){if(a.m!=a.h.length){for(var b=0,c=0;bwd(a)?-1:1)*b,h=e.x-c.x,k=e.y-c.y,p=0l?-1:0,l=Math.sqrt(Math.pow(l,2)/(1+Math.pow(h/k,2)));d.push({x:e.x+Math.abs(h/k*l)*(0h?-1:0)*p,y:e.y+Math.abs(l)*(0k?-1:0)*p})}return d};function yd(a,b,c,d){0c&&(c=a[e].x),a[e].xf&&(f=a[e].y),a[e].ywd(c)?-1:1;if(4>c.length)c=xd(c,d*b);else{for(var f=c.length-1,e=1,h=[],l=0;lc.length-1&&(e=0);c=h}return new zd("polygon",new vd(c))} -function Dd(a,b){if("rect"==a.type){var c=a.geometry,d=b({x:c.x,y:c.y}),c=b({x:c.x+c.width,y:c.y+c.height});return new zd("rect",new yd(d.x,d.y,c.x-d.x,c.y-d.y))}if("polygon"==a.type){var f=[];B(a.geometry.points,function(a){f.push(b(a))});return new zd("polygon",new vd(f))}}function Ed(a){return JSON.stringify(a.geometry)}window.annotorious||(window.annotorious={});window.annotorious.geometry||(window.annotorious.geometry={},window.annotorious.geometry.expand=Cd);function Fd(a,b,c){this.src=a;this.text=b;this.shapes=[c];this.context=document.URL};function Gd(){}function Hd(a,b){a.f=new rd;a.Ec=[];a.Za=[];a.Ba=[];a.ya=[];a.Tb=[];a.rb={La:n,Ka:n};a.Sa=new rd;a.Lc=b}function Id(a,b){var c=a.Sa(b);c||(c={La:n,Ka:n},c.set(b,c));return c} -function Jd(a,b){var c=a.jc(b);if(!a.f.get(c)){var d=a.rd(b),f=[],e=[];B(a.Ec,function(a){d.k(a.type,a.Ja)});B(a.Za,function(a){if(a.onInitAnnotator)a.onInitAnnotator(d)});B(a.ya,function(a){a.src==c&&(d.z(a),f.push(a))});B(a.Tb,function(a){a.src==c&&(d.w(a),e.push(a))});B(f,function(b){C(a.ya,b)});B(e,function(b){C(a.Tb,b)});var h=a.Sa.get(c);h?(h.La&&d.O(),h.Ka&&d.Y(),a.Sa.remove(c)):(a.rb.La&&d.O(),a.rb.Ka&&d.Y());a.f.set(c,d);C(a.Ba,b)}} -function Kd(a){var b,c;for(c=a.Ba.length;0window.pageYOffset&&e+h>window.pageXOffset)&&Jd(a,b)}}function Ld(a,b,c){if(b){var d=a.f.get(b);d?c?d.wa():d.Y():Id(a,b).Ka=c}else B(W(a.f),function(a){c?a.wa():a.Y()}),a.rb.Ka=c,B(W(a.Sa),function(a){a.Ka=c})} -function Md(a,b,c){if(b){var d=a.f.get(b);d?c?d.$():d.O():Id(a,b).La=c}else B(W(a.f),function(a){c?a.$():a.O()}),a.rb.La=c,B(W(a.Sa),function(a){a.La=c})}r=Gd.prototype;r.ea=function(a,b){var c=i,d=i;t(a)?(c=a,d=b):u(a)&&(d=a);c?(c=this.f.get(c))&&c.ea(d):B(W(this.f),function(a){a.ea(d)})};r.z=function(a,b){if(Nd(this,a.src)){var c=this.f.get(a.src);c?c.z(a,b):(this.ya.push(a),b&&C(this.ya,b))}};r.k=function(a,b){B(W(this.f),function(c){c.k(a,b)});this.Ec.push({type:a,Ja:b})}; -r.wb=function(a){this.Za.push(a);B(W(this.f),function(b){if(a.onInitAnnotator)a.onInitAnnotator(b)})};function Nd(a,b){return td(a.f.S,b)?j:Ea(a.Ba,function(c){return a.jc(c)==b})!=m}r.R=function(a){a?(a=this.f.get(a))&&a.R():(B(W(this.f),function(a){a.R()}),this.f.clear())};r.qa=function(a){if(Nd(this,a)&&(a=this.f.get(a)))return a.qa().getName()}; -r.J=function(a){if(a){var b=this.f.get(a);return b?b.J():Ba(this.ya,function(b){return b.src==a})}var c=[];B(W(this.f),function(a){Ha(c,a.J())});Ha(c,this.ya);return c};r.ra=function(a){if(Nd(this,a)&&(a=this.f.get(a)))return Ca(a.ra(),function(a){return a.getName()})};r.Y=function(a){Ld(this,a,n)};r.O=function(a){Md(this,a,n)};r.o=function(a){if(a){if(Nd(this,a.src)){var b=this.f.get(a.src);b&&b.o(a)}}else B(W(this.f),function(a){a.o()})}; -r.init=function(){this.Lc&&Ha(this.Ba,this.Lc());Kd(this);var a=this,b=O(window,"scroll",function(){0",ae:"&",je:"\u00a0",le:'"',be:"'"},Td={a:0,abbr:0,acronym:0,address:0,applet:16,area:2,b:0,base:18,basefont:18,bdo:0,big:0,blockquote:0,body:49,br:2,button:0,caption:0,center:0,cite:0,code:0,col:2,colgroup:1,dd:1,del:0,dfn:0,dir:0,div:0,dl:0,dt:1,em:0,fieldset:0,font:0,form:0,frame:18,frameset:16,h1:0,h2:0,h3:0,h4:0,h5:0,h6:0,head:49,hr:2,html:49,i:0,iframe:20,img:2,input:2,ins:0,isindex:18,kbd:0,label:0,legend:0,li:1,link:18,map:0,menu:0,meta:18,noframes:20,noscript:20,object:16, -ol:0,optgroup:0,option:1,p:1,param:18,pre:0,q:0,s:0,samp:0,script:20,select:0,small:0,span:0,strike:0,strong:0,style:20,sub:0,sup:0,table:0,tbody:1,td:1,textarea:8,tfoot:1,th:1,thead:1,title:24,tr:1,tt:0,u:0,ul:0,"var":0},Ud=/&/g,Vd=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,Wd=//g,Yd=/\"/g,Zd=/=/g,$d=/\0/g,ae=/&(#\d+|#x[0-9A-Fa-f]+|\w+);/g,be=/^#(\d+)$/,ce=/^#x([0-9A-Fa-f]+)$/,de=RegExp("^\\s*(?:(?:([a-z][a-z-]*)(\\s*=\\s*(\"[^\"]*\"|'[^']*'|(?=[a-z][a-z-]*\\s*=)|[^>\"'\\s]*))?)|(/?>)|[^a-z\\s>]+)", -"i"),ee=RegExp("^(?:&(\\#[0-9]+|\\#[x][0-9a-f]+|\\w+);|<[!]--[\\s\\S]*?--\>|]*>|<\\?[^>*]*>|<(/)?([a-z][a-z0-9]*)|([^<&>]+)|([<&>]))","i"); -Rd.prototype.parse=function(a,b){var c=m,d=n,f=[],e,h,l;a.M=[];for(a.ha=n;b;){var k=b.match(d?de:ee),b=b.substring(k[0].length);if(d)if(k[1]){var p=k[1].toLowerCase();if(k[2]){k=k[3];switch(k.charCodeAt(0)){case 34:case 39:k=k.substring(1,k.length-1)}k=k.replace($d,"").replace(ae,pa(this.Nd,this))}else k=p;f.push(p,k)}else k[4]&&(h!==i&&(l?a.vd&&a.vd(e,f):a.Wc&&a.Wc(e)),l&&h&12&&(c=c===m?b.toLowerCase():c.substring(c.length-b.length),d=c.indexOf("d&&(d=b.length),h&4?a.Pc&&a.Pc(b.substring(0, -d)):a.ud&&a.ud(b.substring(0,d).replace(Vd,"&$1").replace(Wd,"<").replace(Xd,">")),b=b.substring(d)),e=h=l=i,f.length=0,d=n);else if(k[1])fe(a,k[0]);else if(k[3])l=!k[2],d=j,e=k[3].toLowerCase(),h=Td.hasOwnProperty(e)?Td[e]:i;else if(k[4])fe(a,k[4]);else if(k[5])switch(k[5]){case "<":fe(a,"<");break;case ">":fe(a,">");break;default:fe(a,"&")}}for(c=a.M.length;0<=--c;)a.aa.append("");a.M.length=0}; -Rd.prototype.Nd=function(a){a=a.toLowerCase();if(Sd.hasOwnProperty(a))return Sd[a];var b=a.match(be);return b?String.fromCharCode(parseInt(b[1],10)):(b=a.match(ce))?String.fromCharCode(parseInt(b[1],16)):""};function ge(){};/* - Portions of this code are from the google-caja project, received by - Google under the Apache license (http://code.google.com/p/google-caja/). - All other code is Copyright 2009 Google, Inc. All Rights Reserved. - -// Copyright (C) 2006 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -*/ -function he(a,b,c){this.aa=a;this.M=[];this.ha=n;this.zd=b;this.Jb=c}v(he,ge); -var ie={"*::class":9,"*::dir":0,"*::id":4,"*::lang":0,"*::onclick":2,"*::ondblclick":2,"*::onkeydown":2,"*::onkeypress":2,"*::onkeyup":2,"*::onload":2,"*::onmousedown":2,"*::onmousemove":2,"*::onmouseout":2,"*::onmouseover":2,"*::onmouseup":2,"*::style":3,"*::title":0,"*::accesskey":0,"*::tabindex":0,"*::onfocus":2,"*::onblur":2,"a::coords":0,"a::href":1,"a::hreflang":0,"a::name":7,"a::onblur":2,"a::rel":0,"a::rev":0,"a::shape":0,"a::target":10,"a::type":0,"area::accesskey":0,"area::alt":0,"area::coords":0, -"area::href":1,"area::nohref":0,"area::onfocus":2,"area::shape":0,"area::tabindex":0,"area::target":10,"bdo::dir":0,"blockquote::cite":1,"br::clear":0,"button::accesskey":0,"button::disabled":0,"button::name":8,"button::onblur":2,"button::onfocus":2,"button::tabindex":0,"button::type":0,"button::value":0,"caption::align":0,"col::align":0,"col::char":0,"col::charoff":0,"col::span":0,"col::valign":0,"col::width":0,"colgroup::align":0,"colgroup::char":0,"colgroup::charoff":0,"colgroup::span":0,"colgroup::valign":0, -"colgroup::width":0,"del::cite":1,"del::datetime":0,"dir::compact":0,"div::align":0,"dl::compact":0,"font::color":0,"font::face":0,"font::size":0,"form::accept":0,"form::action":1,"form::autocomplete":0,"form::enctype":0,"form::method":0,"form::name":7,"form::onreset":2,"form::onsubmit":2,"form::target":10,"h1::align":0,"h2::align":0,"h3::align":0,"h4::align":0,"h5::align":0,"h6::align":0,"hr::align":0,"hr::noshade":0,"hr::size":0,"hr::width":0,"img::align":0,"img::alt":0,"img::border":0,"img::height":0, -"img::hspace":0,"img::ismap":0,"img::longdesc":1,"img::name":7,"img::src":1,"img::usemap":11,"img::vspace":0,"img::width":0,"input::accept":0,"input::accesskey":0,"input::autocomplete":0,"input::align":0,"input::alt":0,"input::checked":0,"input::disabled":0,"input::ismap":0,"input::maxlength":0,"input::name":8,"input::onblur":2,"input::onchange":2,"input::onfocus":2,"input::onselect":2,"input::readonly":0,"input::size":0,"input::src":1,"input::tabindex":0,"input::type":0,"input::usemap":11,"input::value":0, -"ins::cite":1,"ins::datetime":0,"label::accesskey":0,"label::for":5,"label::onblur":2,"label::onfocus":2,"legend::accesskey":0,"legend::align":0,"li::type":0,"li::value":0,"map::name":7,"menu::compact":0,"ol::compact":0,"ol::start":0,"ol::type":0,"optgroup::disabled":0,"optgroup::label":0,"option::disabled":0,"option::label":0,"option::selected":0,"option::value":0,"p::align":0,"pre::width":0,"q::cite":1,"select::disabled":0,"select::multiple":0,"select::name":8,"select::onblur":2,"select::onchange":2, -"select::onfocus":2,"select::size":0,"select::tabindex":0,"table::align":0,"table::bgcolor":0,"table::border":0,"table::cellpadding":0,"table::cellspacing":0,"table::frame":0,"table::rules":0,"table::summary":0,"table::width":0,"tbody::align":0,"tbody::char":0,"tbody::charoff":0,"tbody::valign":0,"td::abbr":0,"td::align":0,"td::axis":0,"td::bgcolor":0,"td::char":0,"td::charoff":0,"td::colspan":0,"td::headers":6,"td::height":0,"td::nowrap":0,"td::rowspan":0,"td::scope":0,"td::valign":0,"td::width":0, -"textarea::accesskey":0,"textarea::cols":0,"textarea::disabled":0,"textarea::name":8,"textarea::onblur":2,"textarea::onchange":2,"textarea::onfocus":2,"textarea::onselect":2,"textarea::readonly":0,"textarea::rows":0,"textarea::tabindex":0,"tfoot::align":0,"tfoot::char":0,"tfoot::charoff":0,"tfoot::valign":0,"th::abbr":0,"th::align":0,"th::axis":0,"th::bgcolor":0,"th::char":0,"th::charoff":0,"th::colspan":0,"th::headers":6,"th::height":0,"th::nowrap":0,"th::rowspan":0,"th::scope":0,"th::valign":0, -"th::width":0,"thead::align":0,"thead::char":0,"thead::charoff":0,"thead::valign":0,"tr::align":0,"tr::bgcolor":0,"tr::char":0,"tr::charoff":0,"tr::valign":0,"ul::compact":0,"ul::type":0}; -he.prototype.vd=function(a,b){if(!this.ha&&Td.hasOwnProperty(a)){var c=Td[a];if(!(c&32))if(c&16)this.ha=!(c&2);else{for(var d=b,f=0;f")}}}}; -he.prototype.Wc=function(a){if(this.ha)this.ha=n;else if(Td.hasOwnProperty(a)){var b=Td[a];if(!(b&50)){if(b&1)for(b=this.M.length;0<=--b;){var c=this.M[b];if(c===a)break;if(!(Td[c]&1))return}else for(b=this.M.length;0<=--b&&this.M[b]!==a;);if(!(0>b)){for(var d=this.M.length;--d>b;)c=this.M[d],Td[c]&1||this.aa.append("");this.M.length=b;this.aa.append("")}}}};function fe(a,b){a.ha||a.aa.append(b)}he.prototype.ud=function(a){this.ha||this.aa.append(a)}; -he.prototype.Pc=function(a){this.ha||this.aa.append(a)};function je(a,b,c,d,f){if(!F&&(!H||!I("525")))return j;if(Oa&&f)return ke(a);if(f&&!d||!c&&(17==b||18==b)||F&&d&&b==a)return n;switch(a){case 13:return!(F&&db(9));case 27:return!H}return ke(a)}function ke(a){if(48<=a&&57>=a||96<=a&&106>=a||65<=a&&90>=a||H&&0==a)return j;switch(a){case 32:case 63:case 107:case 109:case 110:case 111:case 186:case 59:case 189:case 187:case 61:case 188:case 190:case 191:case 192:case 222:case 219:case 220:case 221:return j;default:return n}} -function le(a){switch(a){case 61:return 187;case 59:return 186;case 224:return 91;case 0:return 224;default:return a}};function me(a,b){mc.call(this);a&&ne(this,a,b)}v(me,Ic);r=me.prototype;r.B=m;r.Eb=m;r.nc=m;r.Fb=m;r.ja=-1;r.ia=-1;r.fc=n; -var oe={3:13,12:144,63232:38,63233:40,63234:37,63235:39,63236:112,63237:113,63238:114,63239:115,63240:116,63241:117,63242:118,63243:119,63244:120,63245:121,63246:122,63247:123,63248:44,63272:46,63273:36,63275:35,63276:33,63277:34,63289:144,63302:45},pe={Up:38,Down:40,Left:37,Right:39,Enter:13,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,"U+007F":46,Home:36,End:35,PageUp:33,PageDown:34,Insert:45},qe=F||H&&I("525"),re=Oa&&G;r=me.prototype; -r.Hd=function(a){if(H&&(17==this.ja&&!a.ctrlKey||18==this.ja&&!a.altKey))this.ia=this.ja=-1;qe&&!je(a.keyCode,this.ja,a.shiftKey,a.ctrlKey,a.altKey)?this.handleEvent(a):(this.ia=G?le(a.keyCode):a.keyCode,re&&(this.fc=a.altKey))};r.Jd=function(a){this.ia=this.ja=-1;this.fc=a.altKey}; -r.handleEvent=function(a){var b=a.n,c,d,f=b.altKey;F&&"keypress"==a.type?(c=this.ia,d=13!=c&&27!=c?b.keyCode:0):H&&"keypress"==a.type?(c=this.ia,d=0<=b.charCode&&63232>b.charCode&&ke(c)?b.charCode:0):D?(c=this.ia,d=ke(c)?b.keyCode:0):(c=b.keyCode||this.ia,d=b.charCode||0,re&&(f=this.fc),Oa&&(63==d&&224==c)&&(c=191));var e=c,h=b.keyIdentifier;c?63232<=c&&c in oe?e=oe[c]:25==c&&a.shiftKey&&(e=9):h&&h in pe&&(e=pe[h]);a=e==this.ja;this.ja=e;b=new se(e,d,a,b);b.altKey=f;this.dispatchEvent(b)};r.c=q("B"); -function ne(a,b,c){a.Fb&&a.detach();a.B=b;a.Eb=O(a.B,"keypress",a,c);a.nc=O(a.B,"keydown",a.Hd,c,a);a.Fb=O(a.B,"keyup",a.Jd,c,a)}r.detach=function(){this.Eb&&(P(this.Eb),P(this.nc),P(this.Fb),this.Fb=this.nc=this.Eb=m);this.B=m;this.ia=this.ja=-1};function se(a,b,c,d){d&&this.init(d,i);this.type="key";this.keyCode=a;this.charCode=b;this.repeat=c}v(se,rc);function te(){}fa(te);te.prototype.Rd=0;te.ob();function ue(a){mc.call(this);this.ib=a||rb();this.ka=ve}v(ue,Ic);ue.prototype.Ld=te.ob();var ve=m;function we(a,b){switch(a){case 1:return b?"disable":"enable";case 2:return b?"highlight":"unhighlight";case 4:return b?"activate":"deactivate";case 8:return b?"select":"unselect";case 16:return b?"check":"uncheck";case 32:return b?"focus":"blur";case 64:return b?"open":"close"}g(Error("Invalid component state"))}r=ue.prototype;r.Db=m;r.Z=n;r.B=m;r.ka=m;r.sa=m;r.fb=m;r.Da=m;r.$d=n;r.c=q("B"); -r.Bb=function(){return this.lc||(this.lc=new Fc(this))};r.zc=function(a){this.sa&&this.sa!=a&&g(Error("Method not supported"));ue.G.zc.call(this,a)};r.Yc=q("ib");r.hb=function(a){this.Z&&g(Error("Component already rendered"));if(a&&this.eb(a)){this.$d=j;if(!this.ib||this.ib.I!=K(a))this.ib=rb(a);this.Rc(a);this.Ga()}else g(Error("Invalid element to decorate"))};r.eb=ba(j);r.Rc=function(a){this.B=a};r.Ga=function(){function a(a){!a.Z&&a.c()&&a.Ga()}this.Z=j;this.fb&&B(this.fb,a,i)}; -r.Ab=function(){function a(a){a.Z&&a.Ab()}this.fb&&B(this.fb,a,i);this.lc&&this.lc.Mb();this.Z=n};r.mb=q("B");r.Qa=function(a){this.Z&&g(Error("Component already rendered"));this.ka=a}; -r.removeChild=function(a,b){if(a){var c=t(a)?a:a.Db||(a.Db=":"+(a.Ld.Rd++).toString(36)),d;this.Da&&c?(d=this.Da,d=(c in d?d[c]:i)||m):d=m;a=d;c&&a&&(d=this.Da,c in d&&delete d[c],C(this.fb,a),b&&(a.Ab(),a.B&&xb(a.B)),c=a,c==m&&g(Error("Unable to set parent component")),c.sa=m,ue.G.zc.call(c,m))}a||g(Error("Child is not in parent component"));return a};function xe(){}var ye;fa(xe);r=xe.prototype;r.mb=function(a){return a};r.jb=function(a,b,c){if(a=a.c?a.c():a)if(F&&!I("7")){var d=ze(hb(a),b);d.push(b);qa(c?ib:kb,a).apply(m,d)}else c?ib(a,b):kb(a,b)};r.eb=ba(j); -r.hb=function(a,b){if(b.id){var c=b.id;if(a.sa&&a.sa.Da){var d=a.sa.Da,f=a.Db;f in d&&delete d[f];d=a.sa.Da;c in d&&g(Error('The object already contains the key "'+c+'"'));d[c]=a}a.Db=c}(c=this.mb(b))&&c.firstChild?(c=c.firstChild.nextSibling?Ga(c.childNodes):c.firstChild,a.gb=c):a.gb=m;var e=0,h=this.nb(),l=this.nb(),k=n,p=n,c=n,d=hb(b);B(d,function(a){if(!k&&a==h)k=j,l==h&&(p=j);else if(!p&&a==l)p=j;else{var b=e;if(!this.yd){this.yb||Ae(this);var c=this.yb,d={},f;for(f in c)d[c[f]]=f;this.yd=d}a= -parseInt(this.yd[a],10);e=b|(isNaN(a)?0:a)}},this);a.r=e;k||(d.push(h),l==h&&(p=j));p||d.push(l);(f=a.X)&&d.push.apply(d,f);if(F&&!I("7")){var w=ze(d);0c;b.style.borderWidth="10px";a.wc=b.scrollHeight>d;b.style.height="100px";100!=b.offsetHeight&&(a.Ib=j);xb(b);a.gd=j}var b=a.c(),c=a.c().scrollHeight,f=a.c(),d=f.offsetHeight-f.clientHeight;if(!a.xc)var e=a.pb,d=d-(e.top+e.bottom); -a.wc||(f=fd(f),d-=f.top+f.bottom);c+=0k?(Re(this,k),b.style.overflowY="",f=j):h!=e?Re(this,e):this.ga||(this.ga=e);!d&&(!f&&Me)&&(a=j)}else Se(this);this.Ma=n;a&&(a=this.c(),this.Ma||(this.Ma=j,b=n,a.value||(a.value=" ",b=j),(f=a.scrollHeight)?(e=Qe(this),d=Oe(this),h=Pe(this),!(d&&e<=d)&&!(h&&e>=h)&&(h=this.pb,a.style.paddingBottom=h.bottom+1+"px",Qe(this)== -e&&(a.style.paddingBottom=h.bottom+f+"px",a.scrollTop=0,f=Qe(this)-f,f>=d?Re(this,f):Re(this,d)),a.style.paddingBottom=h.bottom+"px")):Se(this),b&&(a.value=""),this.Ma=n));c!=this.ga&&this.dispatchEvent("resize")}};r.Qd=function(){var a=this.c(),b=a.offsetHeight;a.filters&&a.filters.length&&(a=a.filters.item("DXImageTransform.Microsoft.DropShadow"))&&(b-=a.offX);b!=this.ga&&(this.ga=this.pd=b)};F&&I(8);function Te(a){return"object"===typeof a&&a&&0===a.de?a.content:String(a).replace(Ue,Ve)}var We={"\x00":"�",'"':""","&":"&","'":"'","<":"<",">":">","\t":" ","\n":" ","\x0B":" ","\f":" ","\r":" "," ":" ","-":"-","/":"/","=":"=","`":"`","\u0085":"…","\u00a0":" ","\u2028":"
","\u2029":"
"};function Ve(a){return We[a]}var Ue=/[\x00\x22\x26\x27\x3c\x3e]/g;function Xe(){return''} -function Ye(){return''};function Ze(a){function b(){var a=d.Ca;a.c()&&a.Ia()}this.element=Od(Ye);this.d=a;this.Cd=a.getItem();this.Ca=new Le("");this.Ad=M(".annotorious-editor-button-cancel",this.element)[0];this.Dc=M(".annotorious-editor-button-save",this.element)[0];var c;c=this.Dc;gb?c=c.parentElement:(c=c.parentNode,c=zb(c)?c:m);this.Bd=c;this.Ua=[];var d=this;O(this.Ad,"click",function(b){b.preventDefault();a.stopSelection(d.Jc);d.close()});O(this.Dc,"click",function(b){b.preventDefault();b=d.Xc();a.z(b);a.stopSelection(); -d.Jc?a.fireEvent("onAnnotationUpdated",b):a.fireEvent("onAnnotationCreated",b);d.close()});V(this.element,n);a.element.appendChild(this.element);this.Ca.hb(M(".annotorious-editor-text",this.element)[0]);var f=this.element;c=document.createElement("div");S(c,"position","absolute");S(c,"top","0px");S(c,"right","0px");S(c,"width","5px");S(c,"height","100%");S(c,"cursor","e-resize");f.appendChild(c);var e=fd(f),e=Zc(f).width-e.right-e.left;c=new gd(c);c.pc=new Kc(e,0,800,0)||new Kc(NaN,NaN,NaN,NaN);c.Sc= -function(a){S(f,"width",a+"px");b&&b()}}r=Ze.prototype;r.dc=function(a){var b=ub("div","annotorious-editor-field");t(a)?b.innerHTML=a:u(a)?this.Ua.push({A:b,ic:a}):zb(a)&&b.appendChild(a);a=this.Bd;a.parentNode&&a.parentNode.insertBefore(b,a)};r.open=function(a){(this.sb=this.Jc=a)&&this.Ca.la(String(a.text));V(this.element,j);this.Ca.c().focus();B(this.Ua,function(b){var c=b.ic(a);t(c)?b.A.innerHTML=c:zb(c)&&(wb(b.A),b.A.appendChild(c))})};r.close=function(){V(this.element,n);this.Ca.la("")}; -r.setPosition=function(a){Oc(this.element,a.x,a.y)};r.Xc=function(){var a;a=this.Ca.c().value;var b=new Qd;(new Rd).parse(new he(b,function(a){return a},i),a);a=b.toString();this.sb?this.sb.text=a:this.sb=new Fd(this.Cd.src,a,this.d.qa().getShape());return this.sb};Ze.prototype.addField=Ze.prototype.dc;Ze.prototype.getAnnotation=Ze.prototype.Xc;function $e(a,b,c){var d=this;c||(c="Click and Drag to Annotate");this.element=Od(af,{sc:c});this.d=a;this.Gc=M(".annotorious-hint-msg",this.element)[0];this.Fc=M(".annotorious-hint-icon",this.element)[0];this.bc=function(){d.show()};this.ac=function(){bf(d)};this.Rb();bf(this);b.appendChild(this.element)} -$e.prototype.Rb=function(){var a=this;this.Ic=O(this.Fc,"mouseover",function(){a.show();window.clearTimeout(a.Xb)});this.Hc=O(this.Fc,"mouseout",function(){bf(a)});this.d.k("onMouseOverItem",this.bc);this.d.k("onMouseOutOfItem",this.ac)};$e.prototype.tb=function(){P(this.Ic);P(this.Hc);this.d.Pa("onMouseOverItem",this.bc);this.d.Pa("onMouseOutOfItem",this.ac)};$e.prototype.show=function(){window.clearTimeout(this.Xb);U(this.Gc,0.8);var a=this;this.Xb=window.setTimeout(function(){bf(a)},3E3)}; -function bf(a){window.clearTimeout(a.Xb);U(a.Gc,0)}$e.prototype.R=function(){this.tb();delete this.Ic;delete this.Hc;delete this.bc;delete this.ac;xb(this.element)};function cf(a){this.element=Od(Xe);this.d=a;this.Dd=M(".annotorious-popup-text",this.element)[0];this.N=M(".annotorious-popup-buttons",this.element)[0];this.Vb=n;this.Ua=[];var b=M(".annotorious-popup-button-edit",this.N)[0],c=M(".annotorious-popup-button-delete",this.N)[0],d=this;O(b,"mouseover",function(){ib(b,"annotorious-popup-button-active")});O(b,"mouseout",function(){kb(b,"annotorious-popup-button-active")});O(b,"click",function(){U(d.element,0);S(d.element,"pointer-events","none");a.Uc(d.e)}); -O(c,"mouseover",function(){ib(c,"annotorious-popup-button-active")});O(c,"mouseout",function(){kb(c,"annotorious-popup-button-active")});O(c,"click",function(){a.fireEvent("beforeAnnotationRemoved",d.e)||(U(d.element,0),S(d.element,"pointer-events","none"),a.w(d.e),a.fireEvent("onAnnotationRemoved",d.e))});df&&(O(this.element,"mouseover",function(){window.clearTimeout(d.Ub);0.9>(d.N.style[za("opacity")]||"")&&U(d.N,0.9);d.clearHideTimer()}),O(this.element,"mouseout",function(){U(d.N,0);d.startHideTimer()}), -a.k("onMouseOutOfItem",function(){d.startHideTimer()}));U(this.N,0);U(this.element,0);S(this.element,"pointer-events","none");a.element.appendChild(this.element)}r=cf.prototype;r.dc=function(a){var b=ub("div","annotorious-popup-field");t(a)?b.innerHTML=a:u(a)?this.Ua.push({A:b,ic:a}):zb(a)&&b.appendChild(a);this.element.appendChild(b)}; -r.startHideTimer=function(){this.Vb=n;if(!this.$a){var a=this;this.$a=window.setTimeout(function(){a.d.fireEvent("beforePopupHide",a);a.Vb||(U(a.element,0),S(a.element,"pointer-events","none"),U(a.N,0.9),delete a.$a)},150)}};r.clearHideTimer=function(){this.Vb=j;this.$a&&(window.clearTimeout(this.$a),delete this.$a)}; -r.show=function(a,b){this.clearHideTimer();b&&this.setPosition(b);a&&this.setAnnotation(a);this.Ub&&window.clearTimeout(this.Ub);U(this.N,0.9);if(df){var c=this;this.Ub=window.setTimeout(function(){U(c.N,0)},1E3)}U(this.element,0.9);S(this.element,"pointer-events","auto")};r.setPosition=function(a){Oc(this.element,new J(a.x,a.y))}; -r.setAnnotation=function(a){this.e=a;this.Dd.innerHTML=a.text?a.text.replace(/\n/g,"
"):'No comment';"editable"in a&&a.editable==n?V(this.N,n):V(this.N,j);B(this.Ua,function(b){var c=b.ic(a);t(c)?b.A.innerHTML=c:zb(c)&&(wb(b.A),b.A.appendChild(c))})};cf.prototype.addField=cf.prototype.dc;function ef(a,b){this.T=a;this.d=b;this.xa=[];this.V=[];this.F=this.T.getContext("2d");this.ma=j;this.ub=n;var c=this;O(this.T,ff,function(a){if(c.ma){var b=gf(c,a.offsetX,a.offsetY);b?(c.ub=c.ub&&b==c.e,c.e?c.e!=b&&(c.ma=n,c.d.popup.startHideTimer()):(c.e=b,hf(c),c.d.fireEvent("onMouseOverAnnotation",{na:c.e,mouseEvent:a}))):!c.ub&&c.e&&(c.ma=n,c.d.popup.startHideTimer())}else c.Ta=a});b.k("onMouseOutOfItem",function(){delete c.e;c.ma=j});b.k("beforePopupHide",function(){if(!c.ma&&c.Ta){var a=c.e; -c.e=gf(c,c.Ta.offsetX,c.Ta.offsetY);c.ma=j;a!=c.e?(hf(c),c.d.fireEvent("onMouseOutOfAnnotation",{na:a,mouseEvent:c.Ta}),c.d.fireEvent("onMouseOverAnnotation",{na:c.e,mouseEvent:c.Ta})):c.e&&c.d.popup.clearHideTimer()}else hf(c)})}r=ef.prototype;r.z=function(a,b){b&&(b==this.e&&delete this.e,C(this.xa,b),delete this.V[Ed(b.shapes[0])]);this.xa.push(a);var c=a.shapes[0];if("pixel"!=c.units)var d=this,c=Dd(c,function(a){return d.d.kb(a)});this.V[Ed(a.shapes[0])]=c;hf(this)}; -r.w=function(a){a==this.e&&delete this.e;C(this.xa,a);delete this.V[Ed(a.shapes[0])];hf(this)};r.J=function(){return Ga(this.xa)};r.o=function(a){(this.e=a)?this.ub=j:this.d.popup.startHideTimer();hf(this);this.ma=j};function gf(a,b,c){a=a.lb(b,c);if(0e.geometry.x+e.geometry.width||b>e.geometry.y+e.geometry.height?n:j;else if("polygon"==e.type){e=e.geometry.points;for(var h=n,l=e.length-1,k=0;kb!=e[l].y>b&&a<(e[l].x-e[k].x)*(b-e[k].y)/(e[l].y-e[k].y)+e[k].x&&(h=!h),l=k;e=h}else e=n;e&&c.push(f)});z.sort.call(c,function(a,b){var c=d.V[Ed(a.shapes[0])],l=d.V[Ed(b.shapes[0])];return Ad(c)- -Ad(l)}||Ja);return c};function jf(a,b,c){var d=Ea(a.d.ra(),function(a){return a.getSupportedShapeType()==b.type});d?d.drawShape(a.F,b,c):console.log("WARNING unsupported shape type: "+b.type)}function hf(a){a.F.clearRect(0,0,a.T.width,a.T.height);B(a.xa,function(b){jf(a,a.V[Ed(b.shapes[0])])});if(a.e){var b=a.V[Ed(a.e.shapes[0])];jf(a,b,j);b=Bd(b).geometry;a.d.popup.show(a.e,new ud(b.x,b.y+b.height+5))}};var kf="ontouchstart"in window,df=!kf,lf=kf?"touchstart":"mousedown",mf=kf?"touchenter":"mouseover",ff=kf?"touchmove":"mousemove",nf=kf?"touchend":"mouseup",of=kf?"touchleave":"mouseout";function pf(a,b){var c=n;return c=!a.offsetX||!a.offsetY&&a.n.changedTouches?{x:a.n.changedTouches[0].clientX-pd(b).left,y:a.n.changedTouches[0].clientY-pd(b).top}:{x:a.offsetX,y:a.offsetY}};function qf(){}r=qf.prototype;r.init=function(a,b){this.T=a;this.d=b;this.F=a.getContext("2d");this.F.lineWidth=1;this.Wb=n}; -r.Rb=function(){var a=this,b=this.T;this.Zb=O(this.T,ff,function(c){c=pf(c,b);if(a.Wb){a.H={x:c.x,y:c.y};a.F.clearRect(0,0,b.width,b.height);var c=a.H.x-a.j.x,d=a.H.y-a.j.y;a.F.strokeStyle="#000000";a.F.strokeRect(a.j.x+0.5,a.j.y+0.5,c,d);a.F.strokeStyle="#ffffff";0d?a.F.strokeRect(a.j.x+1.5,a.j.y-0.5,c-2,d+2):0>c&&0>d?a.F.strokeRect(a.j.x-0.5,a.j.y-0.5,c+2,d+2):a.F.strokeRect(a.j.x-0.5,a.j.y+1.5,c+2,d-2)}});this.$b=O(b,nf,function(c){var d= -pf(c,b),f=a.getShape(),c=c.n?c.n:c;a.Wb=n;f?(a.tb(),a.d.fireEvent("onSelectionCompleted",{mouseEvent:c,shape:f,viewportBounds:a.getViewportBounds()})):(a.d.fireEvent("onSelectionCanceled"),c=a.d.lb(d.x,d.y),0this.j.x?(a=this.H.x,b=this.j.x):(a=this.j.x,b=this.H.x);var c,d;this.H.y>this.j.y?(c=this.j.y,d=this.H.y):(c=this.H.y,d=this.j.y);return{top:c,right:a,bottom:d,left:b}}; -r.drawShape=function(a,b,c){if("rect"==b.type){var d;c?(c="#fff000",d=1.2):(c="#ffffff",d=1);b=b.geometry;a.strokeStyle="#000000";a.lineWidth=d;a.strokeRect(b.x+0.5,b.y+0.5,b.width+1,b.height+1);a.strokeStyle=c;a.strokeRect(b.x+1.5,b.y+1.5,b.width-1,b.height-1)}};function rf(a){return''} -function af(a){return'
'+Te(a.sc)+'
'};function sf(a,b){function c(b,c){S(d,"margin-"+b,c+"px");S(a,"margin-"+b,0);S(a,"padding-"+b,0)}this.ba=a;this.Kc={padding:a.style.padding,margin:a.style.margin};this.v=new qd;this.cb=[];this.cc=j;this.element=ub("div","annotorious-annotationlayer");S(this.element,"position","relative");S(this.element,"display","inline-block");var d=this.element,f=cd(a,"margin"),e=cd(a,"padding");(0!=f.top||0!=e.top)&&c("top",f.top+e.top);(0!=f.right||0!=e.right)&&c("right",f.right+e.right);(0!=f.bottom||0!=e.bottom)&& -c("bottom",f.bottom+e.bottom);(0!=f.left||0!=e.left)&&c("left",f.left+e.left);f=Zc(a);Wc(this.element,f.width,f.height);yb(this.element,a);this.element.appendChild(a);this.da=Od(rf,{width:f.width,height:f.height});df&&ib(this.da,"annotorious-item-unfocus");this.element.appendChild(this.da);this.g=Od(rf,{width:f.width,height:f.height});df&&V(this.g,n);this.element.appendChild(this.g);this.popup=b?b:new cf(this);f=new qf;f.init(this.g,this);this.cb.push(f);this.za=f;this.editor=new Ze(this);this.l= -new ef(this.da,this);this.Wa=new $e(this,this.element);var h=this;df&&(O(this.element,mf,function(a){a=a.relatedTarget;if(!a||!Ab(h.element,a))h.v.fireEvent("onMouseOverItem"),mb(h.da,"annotorious-item-unfocus","annotorious-item-focus")}),O(this.element,of,function(a){a=a.relatedTarget;if(!a||!Ab(h.element,a))h.v.fireEvent("onMouseOutOfItem"),mb(h.da,"annotorious-item-focus","annotorious-item-unfocus")}));var l=kf?this.g:this.da;O(l,lf,function(a){a=pf(a,l);h.l.o(i);h.cc?(V(h.g,j),h.za.startSelection(a.x, -a.y)):(a=h.l.lb(a.x,a.y),0
'+Te(a.sc)+"
"};function wf(a,b){this.ca=a;this.Xa=Zc(b.element);this.Q=b.popup;S(this.Q.element,"z-index",99E3);this.Ya=[];this.Sb=new OpenLayers.Layer.Boxes("Annotorious");this.ca.addLayer(this.Sb);var c=this;this.ca.events.register("move",this.ca,function(){c.Aa&&xf(c)});b.k("beforePopupHide",function(){c.Yb==c.Aa?c.Q.clearHideTimer():yf(c,c.Yb,c.Aa)})} -function xf(a){var b=a.Aa.Hb.div,c=Zc(b),d=Tc(b,a.ca.div),b=d.y,d=d.x,f=c.width,e=c.height,c=Zc(a.Q.element),b={y:b+e+5};d+c.width>a.Xa.width?(mb(a.Q.element,"top-left","top-right"),b.x=d+f-c.width):(mb(a.Q.element,"top-right","top-left"),b.x=d);0>b.x&&(b.x=0);b.x+c.width>a.Xa.width&&(b.x=a.Xa.width-c.width);b.y+c.height>a.Xa.height&&(b.y=a.Xa.height-c.height);a.Q.setPosition(b)} -function yf(a,b,c){b?(Tc(b.Hb.div,a.ca.div),za("height"),S(b.kd,"border-color","#fff000"),a.Aa=b,a.Q.setAnnotation(b.na),xf(a),a.Q.show()):delete a.Aa;c&&S(c.kd,"border-color","#fff")} -wf.prototype.z=function(a){var b=a.shapes[0].geometry,b=new OpenLayers.Marker.Box(new OpenLayers.Bounds(b.x,b.y,b.x+b.width,b.y+b.height));ib(b.div,"annotorious-ol-boxmarker-outer");S(b.div,"border",m);var c=ub("div","annotorious-ol-boxmarker-inner");Wc(c,"100%","100%");b.div.appendChild(c);var d={na:a,Hb:b,kd:c},f=this;O(c,"mouseover",function(){f.Aa||yf(f,d);f.Yb=d});O(c,"mouseout",function(){delete f.Yb;f.Q.startHideTimer()});this.Ya.push(d);z.sort.call(this.Ya,function(a,b){return Ad(b.na.shapes[0])- -Ad(a.na.shapes[0])}||Ja);var e=1E4;B(this.Ya,function(a){S(a.Hb.div,"z-index",e);e++});this.Sb.addMarker(b)};wf.prototype.w=function(a){var b=Ea(this.Ya,function(b){return b.na==a});b&&(C(this.Ya,b),this.Sb.removeMarker(b.Hb))};wf.prototype.J=aa();wf.prototype.o=function(a){a||this.Q.startHideTimer()};function zf(a){this.ca=a;this.U=a.div;var b=parseInt(T(this.U,"width"),10),c=parseInt(T(this.U,"height"),10);this.v=new qd;this.element=ub("div","annotorious-annotationlayer");S(this.element,"position","relative");Wc(this.element,b,c);yb(this.element,this.U);this.element.appendChild(this.U);this.ab=Od(vf,{sc:"Click and Drag"});S(this.ab,"z-index",9998);U(this.ab,0);this.element.appendChild(this.ab);this.popup=new cf(this);this.l=new wf(a,this);this.g=Od(rf,{width:b,height:c});V(this.g,n);S(this.g, -"z-index",9999);this.element.appendChild(this.g);this.bb=new qf;this.bb.init(this.g,this);this.vb=i;this.editor=new Ze(this);S(this.editor.element,"z-index",1E4);var d=this;O(this.element,"mouseover",function(a){a=a.relatedTarget;(!a||!Ab(d.element,a))&&d.v.fireEvent("onMouseOverItem")});O(this.element,"mouseout",function(a){a=a.relatedTarget;(!a||!Ab(d.element,a))&&d.v.fireEvent("onMouseOutOfItem")});O(this.g,"mousedown",function(a){var b=Uc(d.U);d.bb.startSelection(a.clientX-b.x,a.clientY-b.y)}); -this.v.k("onSelectionCompleted",function(a){S(d.g,"pointer-events","none");a=a.viewportBounds;d.editor.setPosition(new ud(a.left+d.U.offsetLeft,a.bottom+4+d.U.offsetTop));d.editor.open()});this.v.k("onSelectionCanceled",function(){d.stopSelection()})}r=zf.prototype;r.$=aa();r.O=aa();r.ea=function(a){S(this.g,"pointer-events","auto");var b=this;V(this.g,j);U(this.ab,0.8);window.setTimeout(function(){U(b.ab,0)},2E3);a&&(this.vb=a)}; -r.Uc=function(a){this.l.w(a);var b=this.bb,c=this;if(b){V(this.g,j);this.l.o(i);var d=this.g.getContext("2d"),f=Dd(a.shapes[0],function(a){return c.kb(a)});b.drawShape(d,f);b=Bd(f).geometry;this.editor.setPosition(new ud(b.x+this.U.offsetLeft,b.y+b.height+4+this.U.offsetTop));this.editor.open(a)}};r.z=function(a){this.l.z(a)};r.k=function(a,b){this.v.k(a,b)};r.Mc=aa();r.fireEvent=function(a,b){return this.v.fireEvent(a,b)}; -r.kb=function(a){a=this.ca.getViewPortPxFromLonLat(new OpenLayers.LonLat(a.x,a.y));return{x:a.x,y:a.y}};r.qa=q("bb");r.J=aa();r.ra=aa();r.getItem=function(){return{src:"map://openlayers/something"}};r.o=function(a){this.l.o(a)};r.w=function(a){this.l.w(a)};r.Pa=function(a,b){this.v.Pa(a,b)};r.qb=aa();r.stopSelection=function(a){V(this.g,n);this.vb&&(this.vb(),delete this.vb);this.bb.stopSelection();a&&this.l.z(a)}; -r.Pb=function(a){a=this.ca.getLonLatFromPixel(new OpenLayers.Pixel(a.x,a.y));return{x:a.lon,y:a.lat}};function Af(){Hd(this)}v(Af,Gd);Af.prototype.jc=ba("map://openlayers/something");Af.prototype.rd=function(a){return new zf(a)};Af.prototype.Ac=function(a){return a instanceof OpenLayers.Map};function Z(){function a(){B(b.t,function(a){a.init()});B(b.Za,function(a){a.initPlugin&&a.initPlugin(b);B(b.t,function(b){b.wb(a)})})}this.t=[new uf];window.OpenLayers&&this.t.push(new Af);this.Za=[];var b=this;window.addEventListener?window.addEventListener("load",a,n):window.attachEvent&&window.attachEvent("onload",a)}function $(a,b){return Ea(a.t,function(a){return Nd(a,b)})}r=Z.prototype; -r.ea=function(a,b){var c=i,d=i;t(a)?(c=a,d=b):u(a)&&(d=a);if(c){var f=$(this,c);f&&f.ea(c,d)}else B(this.t,function(a){a.ea(d)})};r.z=function(a,b){var c=$(this,a.src);c&&c.z(a,b)};r.k=function(a,b){B(this.t,function(c){c.k(a,b)})};r.wb=function(a,b){try{var c=new window.annotorious.plugin[a](b);"complete"==document.readyState?(c.initPlugin&&c.initPlugin(this),B(this.t,function(a){a.wb(c)})):this.Za.push(c)}catch(d){console.log("Could not load plugin: "+a)}}; -r.R=function(a){if(a){var b=$(this,a);b&&b.R(a)}else B(this.t,function(a){a.R()})};r.qa=function(a){var b=$(this,a);if(b)return b.qa(a)};r.J=function(a){if(a){var b=$(this,a);return b?b.J(a):[]}var c=[];B(this.t,function(a){Ha(c,a.J())});return c};r.ra=function(a){var b=$(this,a);return b?b.ra(a):[]};r.Y=function(a){if(a){var b=$(this,a);b&&b.Y(a)}else B(this.t,function(a){a.Y()})};r.O=function(a){if(a){var b=$(this,a);b&&b.O(a)}else B(this.t,function(a){a.O()})}; -r.o=function(a){if(a){var b=$(this,a.src);b&&b.o(a)}else B(this.t,function(a){a.o()})};r.qc=function(a){var b=Ea(this.t,function(b){return b.Ac(a)});b?b.qc(a):g("Error: Annotorious does not support this media type in the current version or build configuration.")};r.Mb=function(a){var b=this;B(this.J(a),function(a){b.w(a)})};r.w=function(a){var b=$(this,a.src);b&&b.w(a)};r.reset=function(){B(this.t,function(a){a.R();a.init()})};r.qb=function(a,b){var c=$(this,a);c&&c.qb(a,b)}; -r.Xd=function(a){a?this.$(i):this.O(i)};r.wa=function(a){if(a){var b=$(this,a);b&&b.wa(a)}else B(this.t,function(a){a.wa()})};r.$=function(a){if(a){var b=$(this,a);b&&b.$(a)}else B(this.t,function(a){a.$()})};window.anno=new Z;Z.prototype.activateSelector=Z.prototype.ea;Z.prototype.addAnnotation=Z.prototype.z;Z.prototype.addHandler=Z.prototype.k;Z.prototype.addPlugin=Z.prototype.wb;Z.prototype.destroy=Z.prototype.R;Z.prototype.getActiveSelector=Z.prototype.qa;Z.prototype.getAnnotations=Z.prototype.J;Z.prototype.getAvailableSelectors=Z.prototype.ra;Z.prototype.hideAnnotations=Z.prototype.Y;Z.prototype.hideSelectionWidget=Z.prototype.O;Z.prototype.highlightAnnotation=Z.prototype.o;Z.prototype.makeAnnotatable=Z.prototype.qc; -Z.prototype.removeAll=Z.prototype.Mb;Z.prototype.removeAnnotation=Z.prototype.w;Z.prototype.reset=Z.prototype.reset;Z.prototype.setActiveSelector=Z.prototype.qb;Z.prototype.showAnnotations=Z.prototype.wa;Z.prototype.showSelectionWidget=Z.prototype.$;window.annotorious||(window.annotorious={});window.annotorious.plugin||(window.annotorious.plugin={});Z.prototype.setSelectionEnabled=Z.prototype.Xd; diff --git a/annotorious/annotorious.min.css b/annotorious/annotorious.min.css new file mode 100644 index 0000000..49fdaf6 --- /dev/null +++ b/annotorious/annotorious.min.css @@ -0,0 +1,6 @@ +.r6o-drawing{cursor:none}.r6o-relations-layer.readonly .handle rect{pointer-events:none}.r6o-relations-layer{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.r6o-relations-layer circle{stroke:#515151;stroke-width:0.4;fill:#3f3f3f}.r6o-relations-layer path{stroke:#595959;stroke-linecap:round;stroke-linejoin:round;fill:transparent}.r6o-relations-layer path.connection{stroke-width:1.6;stroke-dasharray:2,3}.r6o-relations-layer path.r6o-arrow{stroke-width:1.8;fill:#7f7f7f}.r6o-relations-layer .handle rect{stroke-width:1;stroke:#595959;fill:#fff;pointer-events:auto;cursor:pointer}.r6o-relations-layer .handle text{font-size:10px}.r6o-relations-layer .hover{stroke:rgba(63,63,63,0.9);stroke-width:1.4;fill:transparent} + +.r6o-editor{top:0;left:0}.a9s-annotationlayer{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.a9s-selection-mask{stroke:none;fill:transparent;pointer-events:none}.a9s-annotation rect,.a9s-annotation polygon,.a9s-selection rect,.a9s-selection polygon{fill:transparent;cursor:pointer;vector-effect:non-scaling-stroke}.a9s-annotation .a9s-inner,.a9s-selection .a9s-inner{stroke:#fff;stroke-width:1px}.a9s-annotation .a9s-inner:hover,.a9s-selection .a9s-inner:hover{stroke:#fff000}.a9s-annotation .a9s-outer,.a9s-selection .a9s-outer{stroke:rgba(0,0,0,0.7);stroke-width:3px}.a9s-annotation.selected .a9s-inner,.a9s-selection .a9s-inner{stroke:#fff000}.a9s-annotation.editable .a9s-inner{stroke:#fff000;cursor:move}.a9s-annotation.editable .a9s-inner:hover{fill:rgba(255,240,0,0.1)}.a9s-handle{cursor:move}.a9s-handle .a9s-handle-inner{stroke:#fff000;fill:#000}.a9s-handle .a9s-handle-outer{stroke:#000;fill:#fff}.a9s-handle:hover .a9s-handle-inner{fill:#fff000} + +.r6o-btn{background-color:#4483c4;border:1px solid #4483c4;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-size:14px;margin:0;outline:none;text-decoration:none;white-space:nowrap;padding:6px 18px;min-width:70px;vertical-align:middle;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.r6o-btn *{vertical-align:middle}.r6o-btn .r6o-icon{margin-right:4px}.r6o-btn:disabled{border-color:#a3c2e2 !important;background-color:#a3c2e2 !important}.r6o-btn:hover{background-color:#4f92d7;border-color:#4f92d7}.r6o-btn.outline{border:1px solid #4483c4;color:#4483c4;background-color:transparent;text-shadow:none}.r6o-annotation{background-color:rgba(255,165,0,0.2);border-bottom:2px solid orange;cursor:pointer}.r6o-selection{background-color:rgba(207,207,255,0.63);cursor:pointer}.r6o-hide-selection::selection,.r6o-hide-selection ::selection{background:transparent}.r6o-hide-selection::-moz-selection .r6o-hide-selection ::-moz-selection{background:transparent}.r6o-autocomplete{display:inline;position:relative}.r6o-autocomplete div[role=combobox]{display:inline}.r6o-autocomplete input{outline:none;border:none;width:80px;height:100%;line-height:14px;white-space:pre;box-sizing:border-box;background-color:transparent;font-size:14px;color:#3f3f3f}.r6o-autocomplete ul{position:absolute;margin:0;padding:0;list-style-type:none;background-color:#fff;border-radius:3px;border:1px solid #d6d7d9;box-sizing:border-box;box-shadow:0 0 20px rgba(0,0,0,0.25)}.r6o-autocomplete ul:empty{display:none}.r6o-autocomplete li{box-sizing:border-box;padding:2px 12px;width:100%;cursor:pointer}.r6o-editable-text{max-height:120px;overflow:auto;outline:none;min-height:2em;font-size:14px;font-family:'Lato', sans-serif}.r6o-editable-text:empty:not(:focus):before{content:attr(data-placeholder);color:#c2c2c2}.r6o-widget.comment{font-size:14px;min-height:3em;background-color:#fff;position:relative}.r6o-widget.comment .r6o-editable-text,.r6o-widget.comment .r6o-readonly-comment{padding:10px;width:100%;box-sizing:border-box;outline:none;border:none;background-color:transparent;resize:none}.r6o-widget.comment .r6o-editable-text::-webkit-input-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text::-moz-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text:-moz-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text:-ms-input-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-lastmodified{border:1px solid #e5e5e5;display:inline-block;border-radius:2px;margin:0 10px 8px 10px;padding:4px 5px;line-height:100%;font-size:12px}.r6o-widget.comment .r6o-lastmodified .r6o-lastmodified-at{color:#757575;padding-left:3px}.r6o-widget.comment .r6o-arrow-down{position:absolute;height:20px;width:20px;top:9px;right:9px;line-height:22px;background-color:#fff;text-align:center;-webkit-font-smoothing:antialiased;border:1px solid #e5e5e5;cursor:pointer;-webkit-border-radius:1px;-khtml-border-radius:1px;-moz-border-radius:1px;border-radius:1px}.r6o-widget.comment .r6o-arrow-down.r6o-menu-open{border-color:#4483c4}.r6o-widget.comment .r6o-comment-dropdown-menu{position:absolute;top:32px;right:8px;background-color:#fff;border:1px solid #e5e5e5;list-style-type:none;margin:0;padding:5px 0;z-index:9999;-webkit-box-shadow:0 2px 4px rgba(0,0,0,0.2);-moz-box-shadow:0 2px 4px rgba(0,0,0,0.2);box-shadow:0 2px 4px rgba(0,0,0,0.2)}.r6o-widget.comment .r6o-comment-dropdown-menu li{padding:0 15px;cursor:pointer}.r6o-widget.comment .r6o-comment-dropdown-menu li:hover{background-color:#ecf0f1}.r6o-widget.comment.editable{background-color:#ecf0f1}.r6o-tags:empty{display:none}@media all and (-ms-high-contrast: none), (-ms-high-contrast: active){.r6o-widget.tag .r6o-taglist li{height:27px}.r6o-widget.tag .r6o-taglist li .r6o-delete-wrapper .r6o-delete{position:relative;top:-4px}}.r6o-widget.r6o-tag{background-color:#ecf0f1;border-bottom:1px solid #e5e5e5;padding:1px 3px;display:flex}.r6o-widget.r6o-tag ul{margin:0;padding:0;list-style-type:none}.r6o-widget.r6o-tag ul.r6o-taglist{flex:0;white-space:nowrap}.r6o-widget.r6o-tag ul.r6o-taglist li{margin:0;display:inline-block;margin:1px 1px 1px 0;padding:0;vertical-align:middle;overflow:hidden;font-size:12px;background-color:#fff;border:1px solid #d6d7d9;cursor:pointer;position:relative;line-height:180%;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 4px rgba(0,0,0,0.1);-moz-box-shadow:0 0 4px rgba(0,0,0,0.1);box-shadow:0 0 4px rgba(0,0,0,0.1)}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-label{padding:2px 8px;display:inline-block}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper{display:inline-block;padding:2px 0;color:#fff;width:0;height:100%;background-color:#4483c4;-webkit-border-top-right-radius:2px;-webkit-border-bottom-right-radius:2px;-khtml-border-radius-topright:2px;-khtml-border-radius-bottomright:2px;-moz-border-radius-topright:2px;-moz-border-radius-bottomright:2px;border-top-right-radius:2px;border-bottom-right-radius:2px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper .r6o-delete{padding:2px 6px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper svg{vertical-align:text-top}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-enter-active{width:24px;transition:width 200ms}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-enter-done{width:24px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-exit{width:24px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-exit-active{width:0;transition:width 200ms}.r6o-widget.r6o-tag .r6o-autocomplete{flex:1;position:relative}.r6o-widget.r6o-tag .r6o-autocomplete li{font-size:14px}.r6o-widget.r6o-tag input{width:100%;padding:0 3px;min-width:80px;outline:none;border:none;line-height:170%;background-color:transparent;color:#3f3f3f}.r6o-widget.r6o-tag input::-webkit-input-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input::-moz-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input:-moz-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input:-ms-input-placeholder{color:#c2c2c2}.r6o-editor{position:absolute;z-index:99999;margin-top:18px;margin-left:-14px;width:400px;color:#3f3f3f;opacity:0;font-family:'Lato', sans-serif;font-size:17px;line-height:27px;-webkit-transition:opacity 0.1s ease-in-out;-moz-transition:opacity 0.1s ease-in-out;transition:opacity 0.1s ease-in-out}.r6o-editor .r6o-arrow{position:absolute;overflow:hidden;top:-12px;left:12px;width:28px;height:12px}.r6o-editor .r6o-arrow:after{content:'';position:absolute;top:5px;left:5px;width:18px;height:18px;background-color:#fff;-webkit-backface-visibility:hidden;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.r6o-editor .r6o-editor-inner{background-color:#fff;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px;-webkit-box-shadow:2px 2px 42px rgba(0,0,0,0.4);-moz-box-shadow:2px 2px 42px rgba(0,0,0,0.4);box-shadow:2px 2px 42px rgba(0,0,0,0.4)}.r6o-editor .r6o-editor-inner .r6o-widget:first-child{-webkit-border-top-left-radius:2px;-webkit-border-top-right-radius:2px;-khtml-border-radius-topleft:2px;-khtml-border-radius-topright:2px;-moz-border-radius-topleft:2px;-moz-border-radius-topright:2px;border-top-left-radius:2px;border-top-right-radius:2px}.r6o-editor .r6o-editor-inner .r6o-widget{border-bottom:1px solid #e5e5e5}.r6o-editor .r6o-footer{text-align:right;padding:8px 0}.r6o-editor .r6o-footer .r6o-btn{margin-right:8px}.r6o-editor.align-right{margin-left:8px}.r6o-editor.align-right .r6o-arrow{left:auto;right:12px}.r6o-editor.align-bottom{margin-bottom:14px}.r6o-editor.align-bottom .r6o-arrow{top:auto;bottom:-12px}.r6o-editor.align-bottom .r6o-arrow::after{top:-11px;box-shadow:none}.r6o-purposedropdown{width:150px;display:inline-block}.r6o-relation-editor{position:absolute;font-family:'Lato', sans-serif;font-size:17px;line-height:27px;-webkit-box-shadow:0 1px 14px rgba(0,0,0,0.4);-moz-box-shadow:0 1px 14px rgba(0,0,0,0.4);box-shadow:0 1px 14px rgba(0,0,0,0.4);-webkit-border-radius:3px;-khtml-border-radius:3px;-moz-border-radius:3px;border-radius:3px;transform:translate(-50%, -50%);background-color:#fff}.r6o-relation-editor svg{vertical-align:middle;shape-rendering:geometricPrecision}.r6o-relation-editor *{box-sizing:border-box}.r6o-relation-editor .input-wrapper{height:34px;padding:0 6px;margin-right:68px;font-size:14px;background-color:#ecf0f1;cursor:text;-webkit-border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-radius-topleft:3px;-khtml-border-radius-bottomleft:3px;-moz-border-radius-topleft:3px;-moz-border-radius-bottomleft:3px;border-top-left-radius:3px;border-bottom-left-radius:3px}.r6o-relation-editor .input-wrapper .r6o-autocomplete ul{position:relative;left:-6px}.r6o-relation-editor .buttons{position:absolute;display:inline-flex;top:0;right:0}.r6o-relation-editor .buttons span{height:34px;display:inline-block;width:34px;text-align:center;font-size:14px;cursor:pointer;padding:1px 0}.r6o-relation-editor .buttons .delete{background-color:#fff;color:#9ca4b1;border-left:1px solid #e5e5e5}.r6o-relation-editor .buttons .delete:hover{background-color:#f6f6f6}.r6o-relation-editor .buttons .ok{background-color:#4483c4;color:#fff;-webkit-border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;-khtml-border-radius-topright:3px;-khtml-border-radius-bottomright:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px;border-top-right-radius:3px;border-bottom-right-radius:3px}.r6o-relation-editor .buttons .ok:hover{background-color:#4f92d7}.r6o-noselect{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} + diff --git a/annotorious/annotorious.min.js b/annotorious/annotorious.min.js new file mode 100644 index 0000000..add0fd2 --- /dev/null +++ b/annotorious/annotorious.min.js @@ -0,0 +1,40 @@ +/** +* BSD 3-Clause License +* +* Copyright (c) 2020, Pelagios Network +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this +* list of conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, +* this list of conditions and the following disclaimer in the documentation +* and/or other materials provided with the distribution. +* +* 3. Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Annotorious",[],t):"object"==typeof exports?exports.Annotorious=t():e.Annotorious=t()}(window,function(){return r={},o.m=n=[function(e,t,n){"use strict";n.r(t),n.d(t,"version",function(){return L}),n.d(t,"Children",function(){return v}),n.d(t,"render",function(){return I}),n.d(t,"hydrate",function(){return M}),n.d(t,"unmountComponentAtNode",function(){return H}),n.d(t,"createPortal",function(){return C}),n.d(t,"createFactory",function(){return F}),n.d(t,"cloneElement",function(){return V}),n.d(t,"isValidElement",function(){return U}),n.d(t,"findDOMNode",function(){return B}),n.d(t,"PureComponent",function(){return l}),n.d(t,"memo",function(){return p}),n.d(t,"forwardRef",function(){return h}),n.d(t,"unstable_batchedUpdates",function(){return z}),n.d(t,"Suspense",function(){return b}),n.d(t,"SuspenseList",function(){return O}),n.d(t,"lazy",function(){return w});var r=n(8);n.d(t,"useState",function(){return r.k}),n.d(t,"useReducer",function(){return r.i}),n.d(t,"useEffect",function(){return r.d}),n.d(t,"useLayoutEffect",function(){return r.g}),n.d(t,"useRef",function(){return r.j}),n.d(t,"useImperativeHandle",function(){return r.f}),n.d(t,"useMemo",function(){return r.h}),n.d(t,"useCallback",function(){return r.a}),n.d(t,"useContext",function(){return r.b}),n.d(t,"useDebugValue",function(){return r.c}),n.d(t,"useErrorBoundary",function(){return r.e});var a=n(3);function o(e,t){for(var n in t)e[n]=t[n];return e}function i(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}n.d(t,"createElement",function(){return a.f}),n.d(t,"createContext",function(){return a.e}),n.d(t,"createRef",function(){return a.g}),n.d(t,"Fragment",function(){return a.b}),n.d(t,"Component",function(){return a.a});var u,c,s,l=(u=a.a,s=u,(c=f).prototype=Object.create(s.prototype),(c.prototype.constructor=c).__proto__=s,f.prototype.shouldComponentUpdate=function(e,t){return i(this.props,e)||i(this.state,t)},f);function f(e){var t;return(t=u.call(this,e)||this).isPureReactComponent=!0,t}function p(t,r){function n(e){var t=this.props.ref,n=t==e.ref;return!n&&t&&(t.call?t(null):t.current=null),r?!r(this.props,e)||!n:i(this.props,e)}function e(e){return this.shouldComponentUpdate=n,Object(a.f)(t,o({},e))}return e.prototype.isReactComponent=!0,e.displayName="Memo("+(t.displayName||t.name)+")",e.t=!0,e}var d=a.i.__b;function h(n){function e(e){var t=o({},e);return delete t.ref,n(t,e.ref)}return e.prototype.isReactComponent=e.t=!0,e.displayName="ForwardRef("+(n.displayName||n.name)+")",e}a.i.__b=function(e){e.type&&e.type.t&&e.ref&&(e.props.ref=e.ref,e.ref=null),d&&d(e)};function y(e,r){return e?Object(a.k)(e).reduce(function(e,t,n){return e.concat(r(t,n))},[]):null}var v={map:y,forEach:y,count:function(e){return e?Object(a.k)(e).length:0},only:function(e){if(1!==(e=Object(a.k)(e)).length)throw new Error("Children.only() expects only one child.");return e[0]},toArray:a.k},m=a.i.__e;function g(e){return e&&((e=o({},e)).__c=null,e.__k=e.__k&&e.__k.map(g)),e}function b(){this.__u=0,this.o=null,this.__b=null}function S(e){var t=e.__.__c;return t&&t.u&&t.u(e)}function w(t){var n,r,o;function e(e){if(n||(n=t()).then(function(e){r=e.default||e},function(e){o=e}),o)throw o;if(!r)throw n;return Object(a.f)(r,e)}return e.displayName="Lazy",e.t=!0,e}function O(){this.i=null,this.l=null}a.i.__e=function(e,t,n){if(e.then)for(var r,o=t;o=o.__;)if((r=o.__c)&&r.__c)return r.__c(e,t.__c);m(e,t,n)},(b.prototype=new a.a).__c=function(e,t){var n=this;null==n.o&&(n.o=[]),n.o.push(t);function r(){i||(i=!0,o?o(a):a())}var o=S(n.__v),i=!1;t.__c=t.componentWillUnmount,t.componentWillUnmount=function(){r(),t.__c&&t.__c()};var a=function(){var e;if(!--n.__u)for(n.__v.__k[0]=n.state.u,n.setState({u:n.__b=null});e=n.o.pop();)e.forceUpdate()};n.__u++||n.setState({u:n.__b=n.__v.__k[0]}),e.then(r,r)},b.prototype.render=function(e,t){return this.__b&&(this.__v.__k[0]=g(this.__b),this.__b=null),[Object(a.f)(a.a,null,t.u?null:e.children),t.u&&e.fallback]};function _(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;3=n.__.length&&n.__.push({}),n.__[e]}function h(e){return u=1,y(j,e)}function y(n,e,t){var r=d(o++,2);return r.__c||(r.__c=i,r.__=[t?t(e):j(void 0,e),function(e){var t=n(r.__[0],e);r.__[0]!==t&&(r.__[0]=t,r.__c.setState({}))}]),r.__}function v(e,t){var n=d(o++,3);!a.i.__s&&C(n.__H,t)&&(n.__=e,n.__H=t,i.__H.__h.push(n))}function m(e,t){var n=d(o++,4);!a.i.__s&&C(n.__H,t)&&(n.__=e,n.__H=t,i.__h.push(n))}function g(e){return u=5,S(function(){return{current:e}},[])}function b(e,t,n){u=6,m(function(){"function"==typeof e?e(t()):e&&(e.current=t())},null==n?n:n.concat(e))}function S(e,t){var n=d(o++,7);return C(n.__H,t)?(n.__H=t,n.__h=e,n.__=e()):n.__}function w(e,t){return u=8,S(function(){return e},t)}function O(e){var t=i.context[e.__c],n=d(o++,9);return n.__c=e,t?(null==n.__&&(n.__=!0,t.sub(i)),t.props.value):e.__}function _(e,t){a.i.useDebugValue&&a.i.useDebugValue(t?t(e):e)}function x(e){var t=d(o++,10),n=h();return t.__=e,i.componentDidCatch||(i.componentDidCatch=function(e){t.__&&t.__(e),n[1](e)}),[n[0],function(){n[1](void 0)}]}function E(){c.some(function(t){if(t.__P)try{t.__H.__h.forEach(A),t.__H.__h.forEach(P),t.__H.__h=[]}catch(e){return t.__H.__h=[],a.i.__e(e,t.__v),!0}}),c=[]}function A(e){e.t&&e.t()}function P(e){var t=e.__();"function"==typeof t&&(e.t=t)}function C(n,e){return!n||e.some(function(e,t){return e!==n[t]})}function j(e,t){return"function"==typeof t?t(e):t}a.i.__r=function(e){s&&s(e),o=0,(i=e.__c).__H&&(i.__H.__h.forEach(A),i.__H.__h.forEach(P),i.__H.__h=[])},a.i.diffed=function(e){l&&l(e);var t=e.__c;if(t){var n=t.__H;n&&n.__h.length&&(1!==c.push(t)&&r===a.i.requestAnimationFrame||((r=a.i.requestAnimationFrame)||function(e){function t(){clearTimeout(r),cancelAnimationFrame(n),setTimeout(e)}var n,r=setTimeout(t,100);"undefined"!=typeof window&&(n=requestAnimationFrame(t))})(E))}},a.i.__c=function(e,n){n.some(function(t){try{t.__h.forEach(A),t.__h=t.__h.filter(function(e){return!e.__||P(e)})}catch(e){n.some(function(e){e.__h&&(e.__h=[])}),n=[],a.i.__e(e,t.__v)}}),f&&f(e,n)},a.i.unmount=function(e){p&&p(e);var t=e.__c;if(t){var n=t.__H;if(n)try{n.__.forEach(function(e){return e.t&&e.t()})}catch(e){a.i.__e(e,t.__v)}}}},function(e,t,n){var r=n(55)("wks"),o=n(35),i=n(4).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},function(e,t){function n(){}n.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r"+o+""}var o=n(1),i=n(5),a=n(30),u=/"/g;e.exports=function(t,e){var n={};n[t]=e(r),o(o.P+o.F*i(function(){var e=""[t]('"');return e!==e.toLowerCase()||3document.F=Object<\/script>"),e.close(),l=e.F;n--;)delete l[s][u[n]];return l()};e.exports=Object.create||function(e,t){var n;return null!==e?(o[s]=i(e),n=new o,o[s]=null,n[c]=e):n=l(),void 0===t?n:a(n,t)}},function(e,t,n){var r=n(119),o=n(72).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},function(e,t,n){var r=n(19),o=n(15),i=n(71)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(9)("unscopables"),o=Array.prototype;null==o[r]&&n(20)(o,r,{}),e.exports=function(e){o[r][e]=!0}},function(e,t,n){var r=n(7);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,n){var r=n(14).f,o=n(19),i=n(9)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){function r(e,t,n){var r={},o=u(function(){return!!c[e]()||"​…"!="​…"[e]()}),i=r[e]=o?t(f):c[e];n&&(r[n]=i),a(a.P+a.F*o,"String",r)}var a=n(1),o=n(30),u=n(5),c=n(75),i="["+c+"]",s=RegExp("^"+i+i+"*"),l=RegExp(i+i+"*$"),f=r.trim=function(e,t){return e=String(o(e)),1&t&&(e=e.replace(s,"")),2&t&&(e=e.replace(l,"")),e};e.exports=r},function(e,t){e.exports={}},function(e,t,n){"use strict";var r=n(4),o=n(14),i=n(13),a=n(9)("species");e.exports=function(e){var t=r[e];i&&t&&!t[a]&&o.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var o=n(17);e.exports=function(e,t,n){for(var r in t)o(e,r,t[r],n);return e}},function(e,t,n){var r=n(29);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var o=n(29),i=n(9)("toStringTag"),a="Arguments"==o(function(){return arguments}());e.exports=function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:a?o(t):"Object"==(r=o(t))&&"function"==typeof t.callee?"Arguments":r}},function(e,t,n){var o=n(6),i=n(24),a=n(9)("species");e.exports=function(e,t){var n,r=o(e).constructor;return void 0===r||null==(n=o(r)[a])?t:i(n)}},function(e,t,n){"use strict";var r=n(186);e.exports=Function.prototype.bind||r},function(e,t,n){var r=n(12),o=n(4),i="__core-js_shared__",a=o[i]||(o[i]={});(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(36)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t,n){var c=n(21),s=n(11),l=n(38);e.exports=function(u){return function(e,t,n){var r,o=c(e),i=s(o.length),a=l(n,i);if(u&&t!=t){for(;a")}),g=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(n,e,t){var r=h(n),i=!p(function(){var e={};return e[r]=function(){return 7},7!=""[n](e)}),o=i?!p(function(){var e=!1,t=/a/;return t.exec=function(){return e=!0,null},"split"===n&&(t.constructor={},t.constructor[v]=function(){return t}),t[r](""),!e}):void 0;if(!i||!o||"replace"===n&&!m||"split"===n&&!g){var a=/./[r],u=t(d,r,""[n],function(e,t,n,r,o){return t.exec===y?i&&!o?{done:!0,value:a.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),c=u[0],s=u[1];l(String.prototype,n,c),f(RegExp.prototype,r,2==e?function(e,t){return s.call(e,this,t)}:function(e){return s.call(e,this)})}}},function(e,t,n){var p=n(23),d=n(132),h=n(85),y=n(6),v=n(11),m=n(87),g={},b={};(t=e.exports=function(e,t,n,r,o){var i,a,u,c,s=o?function(){return e}:m(e),l=p(n,r,t?2:1),f=0;if("function"!=typeof s)throw TypeError(e+" is not iterable!");if(h(s)){for(i=v(e.length);f>>=1)&&(t+=t))1&r&&(n+=t);return n}},function(e,t){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},function(e,t){var n=Math.expm1;e.exports=!n||22025.465794806718=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(e,t,n){"use strict";var r,o,a=n(60),u=RegExp.prototype.exec,c=String.prototype.replace,i=u,s="lastIndex",l=(r=/a/,o=/b*/g,u.call(r,"a"),u.call(o,"a"),0!==r[s]||0!==o[s]),f=void 0!==/()??/.exec("")[1];(l||f)&&(i=function(e){var t,n,r,o,i=this;return f&&(n=new RegExp("^"+i.source+"$(?!\\s)",a.call(i))),l&&(t=i[s]),r=u.call(i,e),l&&r&&(i[s]=i.global?r.index+r[0].length:t),f&&r&&1>1,l=23===t?j(2,-24)-j(2,-77):0,f=0,p=e<0||0===e&&1/e<0?1:0;for((e=C(e))!=e||e===A?(o=e!=e?1:0,r=c):(r=k(I(e)/M),e*(i=j(2,-r))<1&&(r--,i*=2),2<=(e+=1<=r+s?l/i:l*j(2,1-s))*i&&(r++,i/=2),c<=r+s?(o=0,r=c):1<=r+s?(o=(e*i-1)*j(2,t),r+=s):(o=e*j(2,s-1)*j(2,t),r=0));8<=t;a[f++]=255&o,o/=256,t-=8);for(r=r<>1,u=o-7,c=n-1,s=e[c--],l=127&s;for(s>>=7;0>=-u,u+=t;0>8&255]}function z(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function W(e){return F(e,52,8)}function G(e){return F(e,23,4)}function $(e,t,n){y(e[S],t,{get:function(){return this[n]}})}function q(e,t,n,r){var o=d(+n);if(o+t>e[D])throw E(w);var i=e[N]._b,a=o+e[L],u=i.slice(a,a+t);return r?u:u.reverse()}function K(e,t,n,r,o,i){var a=d(+n);if(a+t>e[D])throw E(w);for(var u=e[N]._b,c=a+e[L],s=r(+o),l=0;lZ;)(Y=X[Z++])in O||u(O,Y,P[Y]);i||(J.constructor=O)}var Q=new _(new O(2)),ee=_[S].setInt8;Q.setInt8(0,2147483648),Q.setInt8(1,2147483649),!Q.getInt8(0)&&Q.getInt8(1)||c(_[S],{setInt8:function(e,t){ee.call(this,e,t<<24>>24)},setUint8:function(e,t){ee.call(this,e,t<<24>>24)}},!0)}else O=function(e){l(this,O,g);var t=d(e);this._b=v.call(new Array(t),0),this[D]=t},_=function(e,t,n){l(this,_,b),l(e,O,b);var r=e[D],o=f(t);if(o<0||r>24},getUint8:function(e){return q(this,1,e)[0]},getInt16:function(e,t){var n=q(this,2,e,t);return(n[1]<<8|n[0])<<16>>16},getUint16:function(e,t){var n=q(this,2,e,t);return n[1]<<8|n[0]},getInt32:function(e,t){return V(q(this,4,e,t))},getUint32:function(e,t){return V(q(this,4,e,t))>>>0},getFloat32:function(e,t){return U(q(this,4,e,t),23,4)},getFloat64:function(e,t){return U(q(this,8,e,t),52,8)},setInt8:function(e,t){K(this,1,e,H,t)},setUint8:function(e,t){K(this,1,e,H,t)},setInt16:function(e,t,n){K(this,2,e,B,t,n)},setUint16:function(e,t,n){K(this,2,e,B,t,n)},setInt32:function(e,t,n){K(this,4,e,z,t,n)},setUint32:function(e,t,n){K(this,4,e,z,t,n)},setFloat32:function(e,t,n){K(this,4,e,G,t,n)},setFloat64:function(e,t,n){K(this,8,e,W,t,n)}});m(O,g),m(_,b),u(_[S],a.VIEW,!0),t[g]=O,t[b]=_},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(e){return"object"===n(e)?null!==e:"function"==typeof e}},function(e,t,n){e.exports=!n(149)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t=n.length){var h=m(a,f);a=(l=!!h)&&"get"in h&&!("originalValue"in h.get)?h.get:a[f]}else l=w(a,f),a=a[f];l&&!u&&(g[i]=a)}}return a}},function(o,e,i){"use strict";(function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var n=e.Symbol,r=i(189);o.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"===t(n("foo"))&&("symbol"===t(Symbol("bar"))&&r())))}}).call(this,i(188))},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t,n,r){var o;t in e&&("function"!=typeof(o=r)||"[object Function]"!==i.call(o)||!r())||(f?l(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n)}function o(e,t,n){var r=2=n.length){var d=v(u,p);if(f=!!d,!(t||p in u))throw new y("base intrinsic for "+e+" exists, but the property is not available.");u=f&&"get"in d&&!("originalValue"in d.get)?d.get:u[p]}else f=w(u,p),u=u[p];f&&!c&&(g[a]=u)}}return u}},function(e,t,n){"use strict";var r=n(112);e.exports=function(){return String.prototype.trim&&"​"==="​".trim()?String.prototype.trim:r}},function(e,t,n){var r=n(116);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);no;)a(r,n=t[o++])&&(~c(i,n)||i.push(n));return i}},function(e,t,n){var a=n(14),u=n(6),c=n(37);e.exports=n(13)?Object.defineProperties:function(e,t){u(e);for(var n,r=c(t),o=r.length,i=0;i>>0||(a.test(n)?16:10))}:r},function(e,t,n){var r=n(4).parseFloat,o=n(45).trim;e.exports=1/r(n(75)+"-0")!=-1/0?function(e){var t=o(String(e),3),n=r(t);return 0===n&&"-"==t.charAt(0)?-0:n}:r},function(e,t,n){var r=n(29);e.exports=function(e,t){if("number"!=typeof e&&"Number"!=r(e))throw TypeError(t);return+e}},function(e,t,n){var r=n(7),o=Math.floor;e.exports=function(e){return!r(e)&&isFinite(e)&&o(e)===e}},function(e,t){e.exports=Math.log1p||function(e){return-1e-8<(e=+e)&&e<1e-8?e-e*e/2:Math.log(1+e)}},function(e,t,n){"use strict";var r=n(39),o=n(34),i=n(44),a={};n(20)(a,n(9)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:o(1,n)}),i(e,t+" Iterator")}},function(e,t,n){var i=n(6);e.exports=function(t,e,n,r){try{return r?e(i(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&i(o.call(t)),e}}},function(e,t,n){var r=n(329);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){var l=n(24),f=n(15),p=n(50),d=n(11);e.exports=function(e,t,n,r,o){l(t);var i=f(e),a=p(i),u=d(i.length),c=o?u-1:0,s=o?-1:1;if(n<2)for(;;){if(c in a){r=a[c],c+=s;break}if(c+=s,o?c<0:u<=c)throw TypeError("Reduce of empty array with no initial value")}for(;o?0<=c:ce;)t(r[e++]);l._c=[],l._n=!1,n&&!l._h&&L(l)})}}function i(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),o(t,!0))}function a(e){var n,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===e)throw j("Promise can't be resolved itself");(n=f(e))?_(function(){var t={_w:r,_d:!1};try{n.call(e,h(a,t,1),h(i,t,1))}catch(e){i.call(t,e)}}):(r._v=e,r._s=1,o(r,!1))}catch(e){i.call({_w:r,_d:!1},e)}}}var u,c,s,l,p=n(36),d=n(4),h=n(23),y=n(52),v=n(1),m=n(7),g=n(24),b=n(48),S=n(63),w=n(53),O=n(92).set,_=n(349)(),x=n(140),E=n(350),A=n(64),P=n(141),C="Promise",j=d.TypeError,k=d.process,I=k&&k.versions,M=I&&I.v8||"",R=d[C],T="process"==y(k),N=c=x.f,D=!!function(){try{var e=R.resolve(1),t=(e.constructor={})[n(9)("species")]=function(e){e(r,r)};return(T||"function"==typeof PromiseRejectionEvent)&&e.then(r)instanceof t&&0!==M.indexOf("6.6")&&-1===A.indexOf("Chrome/66")}catch(e){}}(),L=function(i){O.call(d,function(){var e,t,n,r=i._v,o=F(i);if(o&&(e=E(function(){T?k.emit("unhandledRejection",r,i):(t=d.onunhandledrejection)?t({promise:i,reason:r}):(n=d.console)&&n.error&&n.error("Unhandled promise rejection",r)}),i._h=T||F(i)?2:1),i._a=void 0,o&&e.e)throw e.v})},F=function(e){return 1!==e._h&&0===(e._a||e._c).length},U=function(t){O.call(d,function(){var e;T?k.emit("rejectionHandled",t):(e=d.onrejectionhandled)&&e({promise:t,reason:t._v})})};D||(R=function(e){b(this,R,C,"_h"),g(e),u.call(this);try{e(h(a,this,1),h(i,this,1))}catch(e){i.call(this,e)}},(u=function(){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(49)(R.prototype,{then:function(e,t){var n=N(w(this,R));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=T?k.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&o(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),s=function(){var e=new u;this.promise=e,this.resolve=h(a,e,1),this.reject=h(i,e,1)},x.f=N=function(e){return e===R||e===l?new s:c(e)}),v(v.G+v.W+v.F*!D,{Promise:R}),n(44)(R,C),n(47)(C),l=n(12)[C],v(v.S+v.F*!D,C,{reject:function(e){var t=N(this);return(0,t.reject)(e),t.promise}}),v(v.S+v.F*(p||!D),C,{resolve:function(e){return P(p&&this===l?R:this,e)}}),v(v.S+v.F*!(D&&n(59)(function(e){R.all(e).catch(r)})),C,{all:function(e){var a=this,t=N(a),u=t.resolve,c=t.reject,n=E(function(){var r=[],o=0,i=1;S(e,!1,function(e){var t=o++,n=!1;r.push(void 0),i++,a.resolve(e).then(function(e){n||(n=!0,r[t]=e,--i||u(r))},c)}),--i||u(r)});return n.e&&c(n.v),t.promise},race:function(e){var t=this,n=N(t),r=n.reject,o=E(function(){S(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},function(e,t,n){"use strict";var o=n(24);function r(e){var n,r;this.promise=new e(function(e,t){if(void 0!==n||void 0!==r)throw TypeError("Bad Promise constructor");n=e,r=t}),this.resolve=o(n),this.reject=o(r)}e.exports.f=function(e){return new r(e)}},function(e,t,n){var r=n(6),o=n(7),i=n(140);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){"use strict";function a(e,t){var n,r=h(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n}var u=n(14).f,c=n(39),s=n(49),l=n(23),f=n(48),p=n(63),r=n(81),o=n(136),i=n(47),d=n(13),h=n(33).fastKey,y=n(43),v=d?"_s":"size";e.exports={getConstructor:function(e,i,n,r){var o=e(function(e,t){f(e,o,i,"_i"),e._t=i,e._i=c(null),e._f=void 0,e._l=void 0,e[v]=0,null!=t&&p(t,n,e[r],e)});return s(o.prototype,{clear:function(){for(var e=y(this,i),t=e._i,n=e._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete t[n.i];e._f=e._l=void 0,e[v]=0},delete:function(e){var t=y(this,i),n=a(t,e);if(n){var r=n.n,o=n.p;delete t._i[n.i],n.r=!0,o&&(o.n=r),r&&(r.p=o),t._f==n&&(t._f=r),t._l==n&&(t._l=o),t[v]--}return!!n},forEach:function(e,t){y(this,i);for(var n,r=l(e,1c&&(s=s.slice(0,c)),r?s+o:o+s}},function(e,t,n){var c=n(13),s=n(37),l=n(21),f=n(51).f;e.exports=function(u){return function(e){for(var t,n=l(e),r=s(n),o=r.length,i=0,a=[];i-1},get:function e(t){return o[r.indexOf(t)]},set:function e(t,n){if(r.indexOf(t)===-1){r.push(t);o.push(n)}},delete:function e(t){var n=r.indexOf(t);if(n>-1){r.splice(n,1);o.splice(n,1)}}}}(),d=function e(t){return new Event(t,{bubbles:true})};try{new Event("test")}catch(e){d=function e(t){var n=document.createEvent("Event");n.initEvent(t,true,false);return n}}function r(o){if(!o||!o.nodeName||o.nodeName!=="TEXTAREA"||p.has(o))return;var n=null;var r=null;var i=null;function e(){var e=window.getComputedStyle(o,null);if(e.resize==="vertical"){o.style.resize="none"}else if(e.resize==="both"){o.style.resize="horizontal"}if(e.boxSizing==="content-box"){n=-(parseFloat(e.paddingTop)+parseFloat(e.paddingBottom))}else{n=parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth)}if(isNaN(n)){n=0}s()}function a(e){{var t=o.style.width;o.style.width="0px";o.offsetWidth;o.style.width=t}o.style.overflowY=e}function u(e){var t=[];while(e&&e.parentNode&&e.parentNode instanceof Element){if(e.parentNode.scrollTop){t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop})}e=e.parentNode}return t}function c(){if(o.scrollHeight===0){return}var e=u(o);var t=document.documentElement&&document.documentElement.scrollTop;o.style.height="";o.style.height=o.scrollHeight+n+"px";r=o.clientWidth;e.forEach(function(e){e.node.scrollTop=e.scrollTop});if(t){document.documentElement.scrollTop=t}}function s(){c();var e=Math.round(parseFloat(o.style.height));var t=window.getComputedStyle(o,null);var n=t.boxSizing==="content-box"?Math.round(parseFloat(t.height)):o.offsetHeight;if(no;)f(K,t=n[o++])||t==W||t==y||r.push(t);return r}function s(e){for(var t,n=e===J,r=U(n?Y:C(e)),o=[],i=0;r.length>i;)!f(K,t=r[i++])||n&&!f(J,t)||o.push(K[t]);return o}var l=n(4),f=n(19),p=n(13),d=n(1),h=n(17),y=n(33).KEY,v=n(5),m=n(55),g=n(44),b=n(35),S=n(9),w=n(70),O=n(118),_=n(240),x=n(58),E=n(6),A=n(7),P=n(15),C=n(21),j=n(32),k=n(34),I=n(39),M=n(121),R=n(26),T=n(57),N=n(14),D=n(37),L=R.f,F=N.f,U=M.f,V=l.Symbol,H=l.JSON,B=H&&H.stringify,z="prototype",W=S("_hidden"),G=S("toPrimitive"),$={}.propertyIsEnumerable,q=m("symbol-registry"),K=m("symbols"),Y=m("op-symbols"),J=Object[z],X="function"==typeof V&&!!T.f,Z=l.QObject,Q=!Z||!Z[z]||!Z[z].findChild,ee=p&&v(function(){return 7!=I(F({},"a",{get:function(){return F(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=L(J,t);r&&delete J[t],F(e,t,n),r&&e!==J&&F(J,t,r)}:F,te=X&&"symbol"==r(V.iterator)?function(e){return"symbol"==r(e)}:function(e){return e instanceof V},ne=function(e,t,n){return e===J&&ne(Y,t,n),E(e),t=j(t,!0),E(n),f(K,t)?(n.enumerable?(f(e,W)&&e[W][t]&&(e[W][t]=!1),n=I(n,{enumerable:k(0,!1)})):(f(e,W)||F(e,W,k(1,{})),e[W][t]=!0),ee(e,t,n)):F(e,t,n)};X||(h((V=function(e){if(this instanceof V)throw TypeError("Symbol is not a constructor!");var n=b(0oe;)S(re[oe++]);for(var ie=D(S.store),ae=0;ie.length>ae;)O(ie[ae++]);d(d.S+d.F*!X,"Symbol",{for:function(e){return f(q,e+="")?q[e]:q[e]=V(e)},keyFor:function(e){if(!te(e))throw TypeError(e+" is not a symbol!");for(var t in q)if(q[t]===e)return t},useSetter:function(){Q=!0},useSimple:function(){Q=!1}}),d(d.S+d.F*!X,"Object",{create:function(e,t){return void 0===t?I(e):i(I(e),t)},defineProperty:ne,defineProperties:i,getOwnPropertyDescriptor:u,getOwnPropertyNames:c,getOwnPropertySymbols:s});var ue=v(function(){T.f(1)});d(d.S+d.F*ue,"Object",{getOwnPropertySymbols:function(e){return T.f(P(e))}}),H&&d(d.S+d.F*(!X||v(function(){var e=V();return"[null]"!=B([e])||"{}"!=B({a:e})||"{}"!=B(Object(e))})),"JSON",{stringify:function(e){for(var t,n,r=[e],o=1;oa;)i.call(e,r=o[a++])&&t.push(r);return t}},function(e,t,n){var r=n(1);r(r.S,"Object",{create:n(39)})},function(e,t,n){var r=n(1);r(r.S+r.F*!n(13),"Object",{defineProperty:n(14).f})},function(e,t,n){var r=n(1);r(r.S+r.F*!n(13),"Object",{defineProperties:n(120)})},function(e,t,n){var r=n(21),o=n(26).f;n(27)("getOwnPropertyDescriptor",function(){return function(e,t){return o(r(e),t)}})},function(e,t,n){var r=n(15),o=n(41);n(27)("getPrototypeOf",function(){return function(e){return o(r(e))}})},function(e,t,n){var r=n(15),o=n(37);n(27)("keys",function(){return function(e){return o(r(e))}})},function(e,t,n){n(27)("getOwnPropertyNames",function(){return n(121).f})},function(e,t,n){var r=n(7),o=n(33).onFreeze;n(27)("freeze",function(t){return function(e){return t&&r(e)?t(o(e)):e}})},function(e,t,n){var r=n(7),o=n(33).onFreeze;n(27)("seal",function(t){return function(e){return t&&r(e)?t(o(e)):e}})},function(e,t,n){var r=n(7),o=n(33).onFreeze;n(27)("preventExtensions",function(t){return function(e){return t&&r(e)?t(o(e)):e}})},function(e,t,n){var r=n(7);n(27)("isFrozen",function(t){return function(e){return!r(e)||!!t&&t(e)}})},function(e,t,n){var r=n(7);n(27)("isSealed",function(t){return function(e){return!r(e)||!!t&&t(e)}})},function(e,t,n){var r=n(7);n(27)("isExtensible",function(t){return function(e){return!!r(e)&&(!t||t(e))}})},function(e,t,n){var r=n(1);r(r.S+r.F,"Object",{assign:n(122)})},function(e,t,n){var r=n(1);r(r.S,"Object",{is:n(123)})},function(e,t,n){var r=n(1);r(r.S,"Object",{setPrototypeOf:n(74).set})},function(e,t,n){"use strict";var r=n(52),o={};o[n(9)("toStringTag")]="z",o+""!="[object z]"&&n(17)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},function(e,t,n){var r=n(1);r(r.P,"Function",{bind:n(124)})},function(e,t,n){var r=n(14).f,o=Function.prototype,i=/^\s*function ([^ (]*)/;"name"in o||n(13)&&r(o,"name",{configurable:!0,get:function(){try{return(""+this).match(i)[1]}catch(e){return""}}})},function(e,t,n){"use strict";var r=n(7),o=n(41),i=n(9)("hasInstance"),a=Function.prototype;i in a||n(14).f(a,i,{value:function(e){if("function"!=typeof this||!r(e))return!1;if(!r(this.prototype))return e instanceof this;for(;e=o(e);)if(this.prototype===e)return!0;return!1}})},function(e,t,n){var r=n(1),o=n(126);r(r.G+r.F*(parseInt!=o),{parseInt:o})},function(e,t,n){var r=n(1),o=n(127);r(r.G+r.F*(parseFloat!=o),{parseFloat:o})},function(e,t,n){"use strict";function r(e){var t=l(e,!1);if("string"==typeof t&&2O;O++)i(v,S=w[O])&&!i(y,S)&&p(y,S,f(v,S));(y.prototype=m).constructor=y,n(17)(o,h,y)}},function(e,t,n){"use strict";function s(e,t){for(var n=-1,r=t;++n<6;)r+=e*a[n],a[n]=r%1e7,r=i(r/1e7)}function l(e){for(var t=6,n=0;0<=--t;)n+=a[t],a[t]=i(n/e),n=n%e*1e7}function f(){for(var e=6,t="";0<=--e;)if(""!==t||0===e||0!==a[e]){var n=String(a[e]);t=""===t?n:t+y.call("0",7-n.length)+n}return t}function p(e,t,n){return 0===t?n:t%2==1?p(e,t-1,n*e):p(e*e,t/2,n)}var r=n(1),d=n(25),h=n(128),y=n(77),o=1..toFixed,i=Math.floor,a=[0,0,0,0,0,0],v="Number.toFixed: incorrect invocation!";r(r.P+r.F*(!!o&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(5)(function(){o.call({})})),"Number",{toFixed:function(e){var t,n,r,o,i=h(this,v),a=d(e),u="",c="0";if(a<0||20>>=0)?31-Math.floor(Math.log(e+.5)*Math.LOG2E):32}})},function(e,t,n){var r=n(1),o=Math.exp;r(r.S,"Math",{cosh:function(e){return(o(e=+e)+o(-e))/2}})},function(e,t,n){var r=n(1),o=n(79);r(r.S+r.F*(o!=Math.expm1),"Math",{expm1:o})},function(e,t,n){var r=n(1);r(r.S,"Math",{fround:n(283)})},function(e,t,n){var i=n(78),r=Math.pow,a=r(2,-52),u=r(2,-23),c=r(2,127)*(2-u),s=r(2,-126);e.exports=Math.fround||function(e){var t,n,r=Math.abs(e),o=i(e);return r>>16)*i+o*(65535&r>>>16)<<16>>>0)}})},function(e,t,n){var r=n(1);r(r.S,"Math",{log10:function(e){return Math.log(e)*Math.LOG10E}})},function(e,t,n){var r=n(1);r(r.S,"Math",{log1p:n(130)})},function(e,t,n){var r=n(1);r(r.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},function(e,t,n){var r=n(1);r(r.S,"Math",{sign:n(78)})},function(e,t,n){var r=n(1),o=n(79),i=Math.exp;r(r.S+r.F*n(5)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function(e){return Math.abs(e=+e)<1?(o(e)-o(-e))/2:(i(e-1)-i(-e-1))*(Math.E/2)}})},function(e,t,n){var r=n(1),o=n(79),i=Math.exp;r(r.S,"Math",{tanh:function(e){var t=o(e=+e),n=o(-e);return t==1/0?1:n==1/0?-1:(t-n)/(i(e)+i(-e))}})},function(e,t,n){var r=n(1);r(r.S,"Math",{trunc:function(e){return(0>10),t%1024+56320))}return n.join("")}})},function(e,t,n){var r=n(1),a=n(21),u=n(11);r(r.S,"String",{raw:function(e){for(var t=a(e.raw),n=u(t.length),r=arguments.length,o=[],i=0;i=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){"use strict";var r=n(1),o=n(80)(!1);r(r.P,"String",{codePointAt:function(e){return o(this,e)}})},function(e,t,n){"use strict";var r=n(1),u=n(11),c=n(82),s="endsWith",l=""[s];r(r.P+r.F*n(84)(s),"String",{endsWith:function(e,t){var n=c(this,e,s),r=1m;)y(v[m++]);(f.constructor=s).prototype=f,n(17)(r,"RegExp",s)}n(47)("RegExp")},function(e,t,n){"use strict";n(138);function r(e){n(17)(RegExp.prototype,u,e,!0)}var o=n(6),i=n(60),a=n(13),u="toString",c=/./[u];n(5)(function(){return"/a/b"!=c.call({source:"a",flags:"b"})})?r(function(){var e=o(this);return"/".concat(e.source,"/","flags"in e?e.flags:!a&&e instanceof RegExp?i.call(e):void 0)}):c.name!=u&&r(function(){return c.call(this)})},function(e,t,n){"use strict";var f=n(6),p=n(11),d=n(91),h=n(61);n(62)("match",1,function(r,o,s,l){return[function(e){var t=r(this),n=null==e?void 0:e[o];return void 0!==n?n.call(e,t):new RegExp(e)[o](String(t))},function(e){var t=l(s,e,this);if(t.done)return t.value;var n=f(e),r=String(this);if(!n.global)return h(n,r);for(var o,i=n.unicode,a=[],u=n.lastIndex=0;null!==(o=h(n,r));){var c=String(o[0]);""===(a[u]=c)&&(n.lastIndex=d(r,p(n.lastIndex),i)),u++}return 0===u?null:a}]})},function(e,t,n){"use strict";var x=n(6),r=n(15),E=n(11),A=n(25),P=n(91),C=n(61),j=Math.max,k=Math.min,p=Math.floor,d=/\$([$&`']|\d\d?|<[^>]*>)/g,h=/\$([$&`']|\d\d?)/g;n(62)("replace",2,function(o,i,w,O){return[function(e,t){var n=o(this),r=null==e?void 0:e[i];return void 0!==r?r.call(e,n,t):w.call(String(n),e,t)},function(e,t){var n=O(w,e,this,t);if(n.done)return n.value;var r=x(e),o=String(this),i="function"==typeof t;i||(t=String(t));var a=r.global;if(a){var u=r.unicode;r.lastIndex=0}for(var c=[];;){var s=C(r,o);if(null===s)break;if(c.push(s),!a)break;""===String(s[0])&&(r.lastIndex=P(o,E(r.lastIndex),u))}for(var l,f="",p=0,d=0;d>>0,l=new RegExp(e.source,u+"g");(r=p.call(l,n))&&!(c<(o=l[y])&&(a.push(n.slice(c,r.index)),1=s));)l[y]===r.index&&l[y]++;return c===n[h]?!i&&l.test("")||a.push(""):a.push(n.slice(c)),a[h]>s?a.slice(0,s):a}:"0"[a](void 0,0)[h]?function(e,t){return void 0===e&&0===t?[]:v.call(this,e,t)}:v,[function(e,t){var n=o(this),r=null==e?void 0:e[i];return void 0!==r?r.call(e,n,t):g.call(String(n),e,t)},function(e,t){var n=m(g,e,this,t,g!==v);if(n.done)return n.value;var r=b(e),o=String(this),i=S(r,RegExp),a=r.unicode,u=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(A?"y":"g"),c=new i(A?r:"^(?:"+r.source+")",u),s=void 0===t?E:t>>>0;if(0==s)return[];if(0===o.length)return null===_(c,o)?[o]:[];for(var l=0,f=0,p=[];f=t.length)return{value:void 0,done:!0}}while(!((e=t[this._i++])in this._t));return{value:e,done:!1}}),o(o.S,"Reflect",{enumerate:function(e){return new r(e)}})},function(e,t,n){var a=n(26),u=n(41),c=n(19),r=n(1),s=n(7),l=n(6);r(r.S,"Reflect",{get:function e(t,n){var r,o,i=arguments.length<3?t:arguments[2];return l(t)===i?t[n]:(r=a.f(t,n))?c(r,"value")?r.value:void 0!==r.get?r.get.call(i):void 0:s(o=u(t))?e(o,n,i):void 0}})},function(e,t,n){var r=n(26),o=n(1),i=n(6);o(o.S,"Reflect",{getOwnPropertyDescriptor:function(e,t){return r.f(i(e),t)}})},function(e,t,n){var r=n(1),o=n(41),i=n(6);r(r.S,"Reflect",{getPrototypeOf:function(e){return o(i(e))}})},function(e,t,n){var r=n(1);r(r.S,"Reflect",{has:function(e,t){return t in e}})},function(e,t,n){var r=n(1),o=n(6),i=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(e){return o(e),!i||i(e)}})},function(e,t,n){var r=n(1);r(r.S,"Reflect",{ownKeys:n(145)})},function(e,t,n){var r=n(1),o=n(6),i=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(e){o(e);try{return i&&i(e),!0}catch(e){return!1}}})},function(e,t,n){var c=n(14),s=n(26),l=n(41),f=n(19),r=n(1),p=n(34),d=n(6),h=n(7);r(r.S,"Reflect",{set:function e(t,n,r){var o,i,a=arguments.length<4?t:arguments[3],u=s.f(d(t),n);if(!u){if(h(i=l(t)))return e(i,n,r,a);u=p(0)}if(f(u,"value")){if(!1===u.writable||!h(a))return!1;if(o=s.f(a,n)){if(o.get||o.set||!1===o.writable)return!1;o.value=r,c.f(a,n,o)}else c.f(a,n,p(0,r));return!0}return void 0!==u.set&&(u.set.call(a,r),!0)}})},function(e,t,n){var r=n(1),o=n(74);o&&r(r.S,"Reflect",{setPrototypeOf:function(e,t){o.check(e,t);try{return o.set(e,t),!0}catch(e){return!1}}})},function(e,t,n){n(381),e.exports=n(12).Array.includes},function(e,t,n){"use strict";var r=n(1),o=n(56)(!0);r(r.P,"Array",{includes:function(e,t){return o(this,e,1u;)void 0!==(n=o(r,t=i[u++]))&&f(a,t,n);return a}})},function(e,t,n){n(398),e.exports=n(12).Object.values},function(e,t,n){var r=n(1),o=n(147)(!1);r(r.S,"Object",{values:function(e){return o(e)}})},function(e,t,n){n(400),e.exports=n(12).Object.entries},function(e,t,n){var r=n(1),o=n(147)(!0);r(r.S,"Object",{entries:function(e){return o(e)}})},function(e,t,n){"use strict";n(139),n(402),e.exports=n(12).Promise.finally},function(e,t,n){"use strict";var r=n(1),o=n(12),i=n(4),a=n(53),u=n(141);r(r.P+r.R,"Promise",{finally:function(t){var n=a(this,o.Promise||i.Promise),e="function"==typeof t;return this.then(e?function(e){return u(n,t()).then(function(){return e})}:t,e?function(e){return u(n,t()).then(function(){throw e})}:t)}})},function(e,t,n){n(404),n(405),n(406),e.exports=n(12)},function(e,t,n){function r(o){return function(e,t){var n=2=f[o]&&o=f[n]&&n>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},Ne={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function De(e){return(De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Le(e){return 45===e.charCodeAt(1)}var Fe=/[A-Z]|^ms/g,Ue=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Ve=function(e){return null!=e&&"boolean"!=typeof e},He=function(t){var n={};return function(e){return void 0===n[e]&&(n[e]=t(e)),n[e]}}(function(e){return Le(e)?e:e.replace(Fe,"-$&").toLowerCase()}),Be=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Ue,function(e,t,n){return We={name:t,styles:n,next:We},t})}return 1===Ne[e]||Le(e)||"number"!=typeof t||0===t?t:t+"px"};function ze(e,t,n,r){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(De(n)){case"boolean":return"";case"object":if(1===n.anim)return We={name:n.name,styles:n.styles,next:We},n.name;if(void 0===n.styles)return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);nr.bottom?gt(t,Math.min(n.offsetTop+n.clientHeight-t.offsetHeight+i,t.scrollHeight)):o.top-ii.length-1&&(a=i.length-1):"last"===t&&(a=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[a],focusedValue:null}),this.announceAriaLiveContext({event:"menu",context:{isDisabled:Fn(i[a])}})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(Vn):Bn(Bn({},Vn),this.props.theme):Vn}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.getStyles,n=this.setValue,r=this.selectOption,o=this.props,i=o.classNamePrefix,a=o.isMulti,u=o.isRtl,c=o.options,s=this.state.selectValue,l=this.hasValue();return{cx:function(e,t,n){var r,o,i=[n];if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&i.push("".concat((r=e,(o=a)?"-"===o[0]?r+o:r+"__"+o:r)));return i.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}.bind(null,i),clearValue:e,getStyles:t,getValue:function(){return s},hasValue:l,isMulti:a,isRtl:u,options:c,selectOption:r,setValue:n,selectProps:o,theme:this.getTheme()}}},{key:"getNextFocusedValue",value:function(e){if(this.clearFocusValueOnUpdate)return this.clearFocusValueOnUpdate=!1,null;var t=this.state,n=t.focusedValue,r=t.selectValue.indexOf(n);if(-1e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nwindow.innerWidth&&(t.classList.add("align-right"),t.style.left="".concat(l-p.width+i-r.left,"px")),p.bottom>window.innerHeight){var d=s+a,h=r.bottom+a;t.classList.add("align-bottom"),t.style.top="auto",t.style.bottom="".concat(h-d,"px")}};function vi(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n",'')),(new DOMParser).parseFromString(n,"image/svg+xml").documentElement)).firstChild}}function aa(e){var t=ia(e),n=document.createElementNS(Gi,"g"),r=t.cloneNode(!0);r.setAttribute("class","a9s-inner");var o=t.cloneNode(!0);return o.setAttribute("class","a9s-outer"),n.appendChild(o),n.appendChild(r),n}function ua(e,t){var n=e.querySelector(".a9s-inner").cloneNode(!0);n.removeAttribute("class"),n.removeAttribute("xmlns");var r=n.outerHTML||(new XMLSerializer).serializeToString(n);return r=r.replace(' xmlns="'.concat(Gi,'"'),""),{source:t.src,selector:{type:"SvgSelector",value:"".concat(r,"")}}}function ca(e){var t=e.targets[0];if(t)return Array.isArray(t.selector)?t.selector[0]:t.selector}var sa=function(e){var t=e.selector("FragmentSelector");if(null!=t&&t.conformsTo.startsWith("http://www.w3.org/TR/media-frags")){var n=t.value,r=n.includes(":")?n.substring(n.indexOf("=")+1,n.indexOf(":")):"pixel",o=Yi((n.includes(":")?n.substring(n.indexOf(":")+1):n.substring(n.indexOf("=")+1)).split(",").map(parseFloat),4);return{x:o[0],y:o[1],w:o[2],h:o[3],format:r}}},la={FragmentSelector:ta,SvgSelector:aa},fa={FragmentSelector:function(e){var t=sa(e);return t.w*t.h},SvgSelector:function(){return 0}},pa=function(e){return la[ca(e).type](e)},da=function(e){return fa[ca(e).type](e)};function ha(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n + + + + + + + + +
+

OCR Results

+ +
+ + + + diff --git a/arg.py b/arg.py index b7a4c0f..784ef57 100644 --- a/arg.py +++ b/arg.py @@ -9,7 +9,7 @@ Import this argparser into modules, so they all can be driven off a 'global' argparser. - + """ import argparse diff --git a/clean_page.py b/clean_page.py old mode 100755 new mode 100644 index 38e2ad9..3fde159 --- a/clean_page.py +++ b/clean_page.py @@ -21,7 +21,7 @@ Subsequent tooling and processing should seqment the resultant image and masks for text isolation into lines and OCR. - + """ import numpy as np @@ -52,7 +52,7 @@ def clean_page(img, max_scale=defaults.CC_SCALE_MAX, min_scale=defaults.CC_SCALE print('Binarizing image with sigma value of ' + str(sigma)) gaussian_binary = binarize(gaussian_filtered, threshold=binary_threshold) binary = binarize(gray, threshold=binary_threshold) - + #Draw out statistics on average connected component size in the rescaled, binary image average_size = cc.average_size(gaussian_binary) #print 'Initial mask average size is ' + str(average_size) @@ -67,7 +67,7 @@ def clean_page(img, max_scale=defaults.CC_SCALE_MAX, min_scale=defaults.CC_SCALE #final mask is size filtered connected components on canny mask final_mask = cc.form_mask(canny_mask, max_size, min_size) - + #apply mask and return images cleaned = cv2.bitwise_not(final_mask * binary) return (cv2.bitwise_not(binary), final_mask, cleaned) @@ -136,7 +136,7 @@ def form_canny_mask(img, mask=None): cv2.imwrite(outfile,cleaned) if binary is not None: cv2.imwrite(binary_outfile, binary) - + if arg.boolean_value('display'): cv2.imshow('Binary',binary) cv2.imshow('Cleaned',cleaned) @@ -145,4 +145,3 @@ def form_canny_mask(img, mask=None): if cv2.waitKey(0) == 27: cv2.destroyAllWindows() cv2.destroyAllWindows() - diff --git a/connected_components.py b/connected_components.py index 9445667..9ab122c 100644 --- a/connected_components.py +++ b/connected_components.py @@ -10,7 +10,7 @@ Connected component generation and manipulation utility functions. - + """ import numpy as np import scipy.ndimage @@ -29,6 +29,11 @@ def height_bb(a): def area_nz(slice, image): return np.count_nonzero(image[slice]) +def rectangle_to_2d_slice(rects): + pass + +# TODO: Remove scipy.ndimage dependency +# Can be achieved using cv2.findContours def get_connected_components(image): s = scipy.ndimage.morphology.generate_binary_structure(2,2) labels,n = scipy.ndimage.measurements.label(image)#,structure=s) @@ -139,4 +144,3 @@ def form_mask(img, max_size, min_size): #mask = bounding_boxes(img,sorted_components,max_size,min_size) mask = masks(img,sorted_components,max_size,min_size) return mask - diff --git a/defaults.py b/defaults.py index 8516b7e..8571507 100644 --- a/defaults.py +++ b/defaults.py @@ -8,7 +8,7 @@ DATE: Friday, Sept 6th 2013 Default parameter values. - + """ BINARY_THRESHOLD = 190 @@ -25,4 +25,9 @@ FURIGANA_BINARY_THRESHOLD=240 MINIMUM_TEXT_SIZE_THRESHOLD=7 MAXIMUM_VERTICAL_SPACE_VARIANCE=5.0 - +OCR_LANGUAGE='jpn_vert' +TEXT_DIRECTION=1 +IMAGE_OUTPUT_DIRECTORY='images/' +TEXT_OUTPUT_DIRECTORY='text/' +PATH_TO_HTML_TEMPLATE='./annotorious/template.html' +NAMING_SCHEME='_text_areas' diff --git a/doc/194.jpg b/doc/194.jpg new file mode 100644 index 0000000..67d4cde Binary files /dev/null and b/doc/194.jpg differ diff --git a/doc/194_html_ocr_failure.png b/doc/194_html_ocr_failure.png new file mode 100644 index 0000000..f241eac Binary files /dev/null and b/doc/194_html_ocr_failure.png differ diff --git a/doc/194_html_ocr_failure_thumb.png b/doc/194_html_ocr_failure_thumb.png new file mode 100644 index 0000000..70a7bf3 Binary files /dev/null and b/doc/194_html_ocr_failure_thumb.png differ diff --git a/doc/194_html_ocr_success.png b/doc/194_html_ocr_success.png new file mode 100644 index 0000000..3a33a0e Binary files /dev/null and b/doc/194_html_ocr_success.png differ diff --git a/doc/194_html_ocr_success_thumb.png b/doc/194_html_ocr_success_thumb.png new file mode 100644 index 0000000..67d04d8 Binary files /dev/null and b/doc/194_html_ocr_success_thumb.png differ diff --git a/doc/194_segmentation.png b/doc/194_segmentation.png new file mode 100644 index 0000000..21b2187 Binary files /dev/null and b/doc/194_segmentation.png differ diff --git a/doc/194_text_areas_filtered.jpg b/doc/194_text_areas_filtered.jpg new file mode 100644 index 0000000..bcc202a Binary files /dev/null and b/doc/194_text_areas_filtered.jpg differ diff --git a/doc/194_text_areas_no_filter.jpg b/doc/194_text_areas_no_filter.jpg new file mode 100644 index 0000000..569ec9c Binary files /dev/null and b/doc/194_text_areas_no_filter.jpg differ diff --git a/doc/194_text_locations.png b/doc/194_text_locations.png new file mode 100644 index 0000000..64e5b3c Binary files /dev/null and b/doc/194_text_locations.png differ diff --git a/doc/194_text_locations_thumb.png b/doc/194_text_locations_thumb.png new file mode 100644 index 0000000..fb71f19 Binary files /dev/null and b/doc/194_text_locations_thumb.png differ diff --git a/doc/ocr_results/194.html b/doc/ocr_results/194.html new file mode 100644 index 0000000..3c3111d --- /dev/null +++ b/doc/ocr_results/194.html @@ -0,0 +1,60 @@ + + + + + + + + + +
+

OCR Results

+ +
+ + + + diff --git a/doc/ocr_results/annotorious/annotorious.min.css b/doc/ocr_results/annotorious/annotorious.min.css new file mode 100644 index 0000000..49fdaf6 --- /dev/null +++ b/doc/ocr_results/annotorious/annotorious.min.css @@ -0,0 +1,6 @@ +.r6o-drawing{cursor:none}.r6o-relations-layer.readonly .handle rect{pointer-events:none}.r6o-relations-layer{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.r6o-relations-layer circle{stroke:#515151;stroke-width:0.4;fill:#3f3f3f}.r6o-relations-layer path{stroke:#595959;stroke-linecap:round;stroke-linejoin:round;fill:transparent}.r6o-relations-layer path.connection{stroke-width:1.6;stroke-dasharray:2,3}.r6o-relations-layer path.r6o-arrow{stroke-width:1.8;fill:#7f7f7f}.r6o-relations-layer .handle rect{stroke-width:1;stroke:#595959;fill:#fff;pointer-events:auto;cursor:pointer}.r6o-relations-layer .handle text{font-size:10px}.r6o-relations-layer .hover{stroke:rgba(63,63,63,0.9);stroke-width:1.4;fill:transparent} + +.r6o-editor{top:0;left:0}.a9s-annotationlayer{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.a9s-selection-mask{stroke:none;fill:transparent;pointer-events:none}.a9s-annotation rect,.a9s-annotation polygon,.a9s-selection rect,.a9s-selection polygon{fill:transparent;cursor:pointer;vector-effect:non-scaling-stroke}.a9s-annotation .a9s-inner,.a9s-selection .a9s-inner{stroke:#fff;stroke-width:1px}.a9s-annotation .a9s-inner:hover,.a9s-selection .a9s-inner:hover{stroke:#fff000}.a9s-annotation .a9s-outer,.a9s-selection .a9s-outer{stroke:rgba(0,0,0,0.7);stroke-width:3px}.a9s-annotation.selected .a9s-inner,.a9s-selection .a9s-inner{stroke:#fff000}.a9s-annotation.editable .a9s-inner{stroke:#fff000;cursor:move}.a9s-annotation.editable .a9s-inner:hover{fill:rgba(255,240,0,0.1)}.a9s-handle{cursor:move}.a9s-handle .a9s-handle-inner{stroke:#fff000;fill:#000}.a9s-handle .a9s-handle-outer{stroke:#000;fill:#fff}.a9s-handle:hover .a9s-handle-inner{fill:#fff000} + +.r6o-btn{background-color:#4483c4;border:1px solid #4483c4;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-size:14px;margin:0;outline:none;text-decoration:none;white-space:nowrap;padding:6px 18px;min-width:70px;vertical-align:middle;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.r6o-btn *{vertical-align:middle}.r6o-btn .r6o-icon{margin-right:4px}.r6o-btn:disabled{border-color:#a3c2e2 !important;background-color:#a3c2e2 !important}.r6o-btn:hover{background-color:#4f92d7;border-color:#4f92d7}.r6o-btn.outline{border:1px solid #4483c4;color:#4483c4;background-color:transparent;text-shadow:none}.r6o-annotation{background-color:rgba(255,165,0,0.2);border-bottom:2px solid orange;cursor:pointer}.r6o-selection{background-color:rgba(207,207,255,0.63);cursor:pointer}.r6o-hide-selection::selection,.r6o-hide-selection ::selection{background:transparent}.r6o-hide-selection::-moz-selection .r6o-hide-selection ::-moz-selection{background:transparent}.r6o-autocomplete{display:inline;position:relative}.r6o-autocomplete div[role=combobox]{display:inline}.r6o-autocomplete input{outline:none;border:none;width:80px;height:100%;line-height:14px;white-space:pre;box-sizing:border-box;background-color:transparent;font-size:14px;color:#3f3f3f}.r6o-autocomplete ul{position:absolute;margin:0;padding:0;list-style-type:none;background-color:#fff;border-radius:3px;border:1px solid #d6d7d9;box-sizing:border-box;box-shadow:0 0 20px rgba(0,0,0,0.25)}.r6o-autocomplete ul:empty{display:none}.r6o-autocomplete li{box-sizing:border-box;padding:2px 12px;width:100%;cursor:pointer}.r6o-editable-text{max-height:120px;overflow:auto;outline:none;min-height:2em;font-size:14px;font-family:'Lato', sans-serif}.r6o-editable-text:empty:not(:focus):before{content:attr(data-placeholder);color:#c2c2c2}.r6o-widget.comment{font-size:14px;min-height:3em;background-color:#fff;position:relative}.r6o-widget.comment .r6o-editable-text,.r6o-widget.comment .r6o-readonly-comment{padding:10px;width:100%;box-sizing:border-box;outline:none;border:none;background-color:transparent;resize:none}.r6o-widget.comment .r6o-editable-text::-webkit-input-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text::-moz-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text:-moz-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text:-ms-input-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-lastmodified{border:1px solid #e5e5e5;display:inline-block;border-radius:2px;margin:0 10px 8px 10px;padding:4px 5px;line-height:100%;font-size:12px}.r6o-widget.comment .r6o-lastmodified .r6o-lastmodified-at{color:#757575;padding-left:3px}.r6o-widget.comment .r6o-arrow-down{position:absolute;height:20px;width:20px;top:9px;right:9px;line-height:22px;background-color:#fff;text-align:center;-webkit-font-smoothing:antialiased;border:1px solid #e5e5e5;cursor:pointer;-webkit-border-radius:1px;-khtml-border-radius:1px;-moz-border-radius:1px;border-radius:1px}.r6o-widget.comment .r6o-arrow-down.r6o-menu-open{border-color:#4483c4}.r6o-widget.comment .r6o-comment-dropdown-menu{position:absolute;top:32px;right:8px;background-color:#fff;border:1px solid #e5e5e5;list-style-type:none;margin:0;padding:5px 0;z-index:9999;-webkit-box-shadow:0 2px 4px rgba(0,0,0,0.2);-moz-box-shadow:0 2px 4px rgba(0,0,0,0.2);box-shadow:0 2px 4px rgba(0,0,0,0.2)}.r6o-widget.comment .r6o-comment-dropdown-menu li{padding:0 15px;cursor:pointer}.r6o-widget.comment .r6o-comment-dropdown-menu li:hover{background-color:#ecf0f1}.r6o-widget.comment.editable{background-color:#ecf0f1}.r6o-tags:empty{display:none}@media all and (-ms-high-contrast: none), (-ms-high-contrast: active){.r6o-widget.tag .r6o-taglist li{height:27px}.r6o-widget.tag .r6o-taglist li .r6o-delete-wrapper .r6o-delete{position:relative;top:-4px}}.r6o-widget.r6o-tag{background-color:#ecf0f1;border-bottom:1px solid #e5e5e5;padding:1px 3px;display:flex}.r6o-widget.r6o-tag ul{margin:0;padding:0;list-style-type:none}.r6o-widget.r6o-tag ul.r6o-taglist{flex:0;white-space:nowrap}.r6o-widget.r6o-tag ul.r6o-taglist li{margin:0;display:inline-block;margin:1px 1px 1px 0;padding:0;vertical-align:middle;overflow:hidden;font-size:12px;background-color:#fff;border:1px solid #d6d7d9;cursor:pointer;position:relative;line-height:180%;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 4px rgba(0,0,0,0.1);-moz-box-shadow:0 0 4px rgba(0,0,0,0.1);box-shadow:0 0 4px rgba(0,0,0,0.1)}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-label{padding:2px 8px;display:inline-block}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper{display:inline-block;padding:2px 0;color:#fff;width:0;height:100%;background-color:#4483c4;-webkit-border-top-right-radius:2px;-webkit-border-bottom-right-radius:2px;-khtml-border-radius-topright:2px;-khtml-border-radius-bottomright:2px;-moz-border-radius-topright:2px;-moz-border-radius-bottomright:2px;border-top-right-radius:2px;border-bottom-right-radius:2px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper .r6o-delete{padding:2px 6px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper svg{vertical-align:text-top}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-enter-active{width:24px;transition:width 200ms}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-enter-done{width:24px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-exit{width:24px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-exit-active{width:0;transition:width 200ms}.r6o-widget.r6o-tag .r6o-autocomplete{flex:1;position:relative}.r6o-widget.r6o-tag .r6o-autocomplete li{font-size:14px}.r6o-widget.r6o-tag input{width:100%;padding:0 3px;min-width:80px;outline:none;border:none;line-height:170%;background-color:transparent;color:#3f3f3f}.r6o-widget.r6o-tag input::-webkit-input-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input::-moz-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input:-moz-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input:-ms-input-placeholder{color:#c2c2c2}.r6o-editor{position:absolute;z-index:99999;margin-top:18px;margin-left:-14px;width:400px;color:#3f3f3f;opacity:0;font-family:'Lato', sans-serif;font-size:17px;line-height:27px;-webkit-transition:opacity 0.1s ease-in-out;-moz-transition:opacity 0.1s ease-in-out;transition:opacity 0.1s ease-in-out}.r6o-editor .r6o-arrow{position:absolute;overflow:hidden;top:-12px;left:12px;width:28px;height:12px}.r6o-editor .r6o-arrow:after{content:'';position:absolute;top:5px;left:5px;width:18px;height:18px;background-color:#fff;-webkit-backface-visibility:hidden;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.r6o-editor .r6o-editor-inner{background-color:#fff;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px;-webkit-box-shadow:2px 2px 42px rgba(0,0,0,0.4);-moz-box-shadow:2px 2px 42px rgba(0,0,0,0.4);box-shadow:2px 2px 42px rgba(0,0,0,0.4)}.r6o-editor .r6o-editor-inner .r6o-widget:first-child{-webkit-border-top-left-radius:2px;-webkit-border-top-right-radius:2px;-khtml-border-radius-topleft:2px;-khtml-border-radius-topright:2px;-moz-border-radius-topleft:2px;-moz-border-radius-topright:2px;border-top-left-radius:2px;border-top-right-radius:2px}.r6o-editor .r6o-editor-inner .r6o-widget{border-bottom:1px solid #e5e5e5}.r6o-editor .r6o-footer{text-align:right;padding:8px 0}.r6o-editor .r6o-footer .r6o-btn{margin-right:8px}.r6o-editor.align-right{margin-left:8px}.r6o-editor.align-right .r6o-arrow{left:auto;right:12px}.r6o-editor.align-bottom{margin-bottom:14px}.r6o-editor.align-bottom .r6o-arrow{top:auto;bottom:-12px}.r6o-editor.align-bottom .r6o-arrow::after{top:-11px;box-shadow:none}.r6o-purposedropdown{width:150px;display:inline-block}.r6o-relation-editor{position:absolute;font-family:'Lato', sans-serif;font-size:17px;line-height:27px;-webkit-box-shadow:0 1px 14px rgba(0,0,0,0.4);-moz-box-shadow:0 1px 14px rgba(0,0,0,0.4);box-shadow:0 1px 14px rgba(0,0,0,0.4);-webkit-border-radius:3px;-khtml-border-radius:3px;-moz-border-radius:3px;border-radius:3px;transform:translate(-50%, -50%);background-color:#fff}.r6o-relation-editor svg{vertical-align:middle;shape-rendering:geometricPrecision}.r6o-relation-editor *{box-sizing:border-box}.r6o-relation-editor .input-wrapper{height:34px;padding:0 6px;margin-right:68px;font-size:14px;background-color:#ecf0f1;cursor:text;-webkit-border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-radius-topleft:3px;-khtml-border-radius-bottomleft:3px;-moz-border-radius-topleft:3px;-moz-border-radius-bottomleft:3px;border-top-left-radius:3px;border-bottom-left-radius:3px}.r6o-relation-editor .input-wrapper .r6o-autocomplete ul{position:relative;left:-6px}.r6o-relation-editor .buttons{position:absolute;display:inline-flex;top:0;right:0}.r6o-relation-editor .buttons span{height:34px;display:inline-block;width:34px;text-align:center;font-size:14px;cursor:pointer;padding:1px 0}.r6o-relation-editor .buttons .delete{background-color:#fff;color:#9ca4b1;border-left:1px solid #e5e5e5}.r6o-relation-editor .buttons .delete:hover{background-color:#f6f6f6}.r6o-relation-editor .buttons .ok{background-color:#4483c4;color:#fff;-webkit-border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;-khtml-border-radius-topright:3px;-khtml-border-radius-bottomright:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px;border-top-right-radius:3px;border-bottom-right-radius:3px}.r6o-relation-editor .buttons .ok:hover{background-color:#4f92d7}.r6o-noselect{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} + diff --git a/doc/ocr_results/annotorious/annotorious.min.js b/doc/ocr_results/annotorious/annotorious.min.js new file mode 100644 index 0000000..add0fd2 --- /dev/null +++ b/doc/ocr_results/annotorious/annotorious.min.js @@ -0,0 +1,40 @@ +/** +* BSD 3-Clause License +* +* Copyright (c) 2020, Pelagios Network +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this +* list of conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, +* this list of conditions and the following disclaimer in the documentation +* and/or other materials provided with the distribution. +* +* 3. Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Annotorious",[],t):"object"==typeof exports?exports.Annotorious=t():e.Annotorious=t()}(window,function(){return r={},o.m=n=[function(e,t,n){"use strict";n.r(t),n.d(t,"version",function(){return L}),n.d(t,"Children",function(){return v}),n.d(t,"render",function(){return I}),n.d(t,"hydrate",function(){return M}),n.d(t,"unmountComponentAtNode",function(){return H}),n.d(t,"createPortal",function(){return C}),n.d(t,"createFactory",function(){return F}),n.d(t,"cloneElement",function(){return V}),n.d(t,"isValidElement",function(){return U}),n.d(t,"findDOMNode",function(){return B}),n.d(t,"PureComponent",function(){return l}),n.d(t,"memo",function(){return p}),n.d(t,"forwardRef",function(){return h}),n.d(t,"unstable_batchedUpdates",function(){return z}),n.d(t,"Suspense",function(){return b}),n.d(t,"SuspenseList",function(){return O}),n.d(t,"lazy",function(){return w});var r=n(8);n.d(t,"useState",function(){return r.k}),n.d(t,"useReducer",function(){return r.i}),n.d(t,"useEffect",function(){return r.d}),n.d(t,"useLayoutEffect",function(){return r.g}),n.d(t,"useRef",function(){return r.j}),n.d(t,"useImperativeHandle",function(){return r.f}),n.d(t,"useMemo",function(){return r.h}),n.d(t,"useCallback",function(){return r.a}),n.d(t,"useContext",function(){return r.b}),n.d(t,"useDebugValue",function(){return r.c}),n.d(t,"useErrorBoundary",function(){return r.e});var a=n(3);function o(e,t){for(var n in t)e[n]=t[n];return e}function i(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}n.d(t,"createElement",function(){return a.f}),n.d(t,"createContext",function(){return a.e}),n.d(t,"createRef",function(){return a.g}),n.d(t,"Fragment",function(){return a.b}),n.d(t,"Component",function(){return a.a});var u,c,s,l=(u=a.a,s=u,(c=f).prototype=Object.create(s.prototype),(c.prototype.constructor=c).__proto__=s,f.prototype.shouldComponentUpdate=function(e,t){return i(this.props,e)||i(this.state,t)},f);function f(e){var t;return(t=u.call(this,e)||this).isPureReactComponent=!0,t}function p(t,r){function n(e){var t=this.props.ref,n=t==e.ref;return!n&&t&&(t.call?t(null):t.current=null),r?!r(this.props,e)||!n:i(this.props,e)}function e(e){return this.shouldComponentUpdate=n,Object(a.f)(t,o({},e))}return e.prototype.isReactComponent=!0,e.displayName="Memo("+(t.displayName||t.name)+")",e.t=!0,e}var d=a.i.__b;function h(n){function e(e){var t=o({},e);return delete t.ref,n(t,e.ref)}return e.prototype.isReactComponent=e.t=!0,e.displayName="ForwardRef("+(n.displayName||n.name)+")",e}a.i.__b=function(e){e.type&&e.type.t&&e.ref&&(e.props.ref=e.ref,e.ref=null),d&&d(e)};function y(e,r){return e?Object(a.k)(e).reduce(function(e,t,n){return e.concat(r(t,n))},[]):null}var v={map:y,forEach:y,count:function(e){return e?Object(a.k)(e).length:0},only:function(e){if(1!==(e=Object(a.k)(e)).length)throw new Error("Children.only() expects only one child.");return e[0]},toArray:a.k},m=a.i.__e;function g(e){return e&&((e=o({},e)).__c=null,e.__k=e.__k&&e.__k.map(g)),e}function b(){this.__u=0,this.o=null,this.__b=null}function S(e){var t=e.__.__c;return t&&t.u&&t.u(e)}function w(t){var n,r,o;function e(e){if(n||(n=t()).then(function(e){r=e.default||e},function(e){o=e}),o)throw o;if(!r)throw n;return Object(a.f)(r,e)}return e.displayName="Lazy",e.t=!0,e}function O(){this.i=null,this.l=null}a.i.__e=function(e,t,n){if(e.then)for(var r,o=t;o=o.__;)if((r=o.__c)&&r.__c)return r.__c(e,t.__c);m(e,t,n)},(b.prototype=new a.a).__c=function(e,t){var n=this;null==n.o&&(n.o=[]),n.o.push(t);function r(){i||(i=!0,o?o(a):a())}var o=S(n.__v),i=!1;t.__c=t.componentWillUnmount,t.componentWillUnmount=function(){r(),t.__c&&t.__c()};var a=function(){var e;if(!--n.__u)for(n.__v.__k[0]=n.state.u,n.setState({u:n.__b=null});e=n.o.pop();)e.forceUpdate()};n.__u++||n.setState({u:n.__b=n.__v.__k[0]}),e.then(r,r)},b.prototype.render=function(e,t){return this.__b&&(this.__v.__k[0]=g(this.__b),this.__b=null),[Object(a.f)(a.a,null,t.u?null:e.children),t.u&&e.fallback]};function _(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;3=n.__.length&&n.__.push({}),n.__[e]}function h(e){return u=1,y(j,e)}function y(n,e,t){var r=d(o++,2);return r.__c||(r.__c=i,r.__=[t?t(e):j(void 0,e),function(e){var t=n(r.__[0],e);r.__[0]!==t&&(r.__[0]=t,r.__c.setState({}))}]),r.__}function v(e,t){var n=d(o++,3);!a.i.__s&&C(n.__H,t)&&(n.__=e,n.__H=t,i.__H.__h.push(n))}function m(e,t){var n=d(o++,4);!a.i.__s&&C(n.__H,t)&&(n.__=e,n.__H=t,i.__h.push(n))}function g(e){return u=5,S(function(){return{current:e}},[])}function b(e,t,n){u=6,m(function(){"function"==typeof e?e(t()):e&&(e.current=t())},null==n?n:n.concat(e))}function S(e,t){var n=d(o++,7);return C(n.__H,t)?(n.__H=t,n.__h=e,n.__=e()):n.__}function w(e,t){return u=8,S(function(){return e},t)}function O(e){var t=i.context[e.__c],n=d(o++,9);return n.__c=e,t?(null==n.__&&(n.__=!0,t.sub(i)),t.props.value):e.__}function _(e,t){a.i.useDebugValue&&a.i.useDebugValue(t?t(e):e)}function x(e){var t=d(o++,10),n=h();return t.__=e,i.componentDidCatch||(i.componentDidCatch=function(e){t.__&&t.__(e),n[1](e)}),[n[0],function(){n[1](void 0)}]}function E(){c.some(function(t){if(t.__P)try{t.__H.__h.forEach(A),t.__H.__h.forEach(P),t.__H.__h=[]}catch(e){return t.__H.__h=[],a.i.__e(e,t.__v),!0}}),c=[]}function A(e){e.t&&e.t()}function P(e){var t=e.__();"function"==typeof t&&(e.t=t)}function C(n,e){return!n||e.some(function(e,t){return e!==n[t]})}function j(e,t){return"function"==typeof t?t(e):t}a.i.__r=function(e){s&&s(e),o=0,(i=e.__c).__H&&(i.__H.__h.forEach(A),i.__H.__h.forEach(P),i.__H.__h=[])},a.i.diffed=function(e){l&&l(e);var t=e.__c;if(t){var n=t.__H;n&&n.__h.length&&(1!==c.push(t)&&r===a.i.requestAnimationFrame||((r=a.i.requestAnimationFrame)||function(e){function t(){clearTimeout(r),cancelAnimationFrame(n),setTimeout(e)}var n,r=setTimeout(t,100);"undefined"!=typeof window&&(n=requestAnimationFrame(t))})(E))}},a.i.__c=function(e,n){n.some(function(t){try{t.__h.forEach(A),t.__h=t.__h.filter(function(e){return!e.__||P(e)})}catch(e){n.some(function(e){e.__h&&(e.__h=[])}),n=[],a.i.__e(e,t.__v)}}),f&&f(e,n)},a.i.unmount=function(e){p&&p(e);var t=e.__c;if(t){var n=t.__H;if(n)try{n.__.forEach(function(e){return e.t&&e.t()})}catch(e){a.i.__e(e,t.__v)}}}},function(e,t,n){var r=n(55)("wks"),o=n(35),i=n(4).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},function(e,t){function n(){}n.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r"+o+""}var o=n(1),i=n(5),a=n(30),u=/"/g;e.exports=function(t,e){var n={};n[t]=e(r),o(o.P+o.F*i(function(){var e=""[t]('"');return e!==e.toLowerCase()||3document.F=Object<\/script>"),e.close(),l=e.F;n--;)delete l[s][u[n]];return l()};e.exports=Object.create||function(e,t){var n;return null!==e?(o[s]=i(e),n=new o,o[s]=null,n[c]=e):n=l(),void 0===t?n:a(n,t)}},function(e,t,n){var r=n(119),o=n(72).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},function(e,t,n){var r=n(19),o=n(15),i=n(71)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(9)("unscopables"),o=Array.prototype;null==o[r]&&n(20)(o,r,{}),e.exports=function(e){o[r][e]=!0}},function(e,t,n){var r=n(7);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,n){var r=n(14).f,o=n(19),i=n(9)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){function r(e,t,n){var r={},o=u(function(){return!!c[e]()||"​…"!="​…"[e]()}),i=r[e]=o?t(f):c[e];n&&(r[n]=i),a(a.P+a.F*o,"String",r)}var a=n(1),o=n(30),u=n(5),c=n(75),i="["+c+"]",s=RegExp("^"+i+i+"*"),l=RegExp(i+i+"*$"),f=r.trim=function(e,t){return e=String(o(e)),1&t&&(e=e.replace(s,"")),2&t&&(e=e.replace(l,"")),e};e.exports=r},function(e,t){e.exports={}},function(e,t,n){"use strict";var r=n(4),o=n(14),i=n(13),a=n(9)("species");e.exports=function(e){var t=r[e];i&&t&&!t[a]&&o.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var o=n(17);e.exports=function(e,t,n){for(var r in t)o(e,r,t[r],n);return e}},function(e,t,n){var r=n(29);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var o=n(29),i=n(9)("toStringTag"),a="Arguments"==o(function(){return arguments}());e.exports=function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:a?o(t):"Object"==(r=o(t))&&"function"==typeof t.callee?"Arguments":r}},function(e,t,n){var o=n(6),i=n(24),a=n(9)("species");e.exports=function(e,t){var n,r=o(e).constructor;return void 0===r||null==(n=o(r)[a])?t:i(n)}},function(e,t,n){"use strict";var r=n(186);e.exports=Function.prototype.bind||r},function(e,t,n){var r=n(12),o=n(4),i="__core-js_shared__",a=o[i]||(o[i]={});(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(36)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t,n){var c=n(21),s=n(11),l=n(38);e.exports=function(u){return function(e,t,n){var r,o=c(e),i=s(o.length),a=l(n,i);if(u&&t!=t){for(;a")}),g=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(n,e,t){var r=h(n),i=!p(function(){var e={};return e[r]=function(){return 7},7!=""[n](e)}),o=i?!p(function(){var e=!1,t=/a/;return t.exec=function(){return e=!0,null},"split"===n&&(t.constructor={},t.constructor[v]=function(){return t}),t[r](""),!e}):void 0;if(!i||!o||"replace"===n&&!m||"split"===n&&!g){var a=/./[r],u=t(d,r,""[n],function(e,t,n,r,o){return t.exec===y?i&&!o?{done:!0,value:a.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),c=u[0],s=u[1];l(String.prototype,n,c),f(RegExp.prototype,r,2==e?function(e,t){return s.call(e,this,t)}:function(e){return s.call(e,this)})}}},function(e,t,n){var p=n(23),d=n(132),h=n(85),y=n(6),v=n(11),m=n(87),g={},b={};(t=e.exports=function(e,t,n,r,o){var i,a,u,c,s=o?function(){return e}:m(e),l=p(n,r,t?2:1),f=0;if("function"!=typeof s)throw TypeError(e+" is not iterable!");if(h(s)){for(i=v(e.length);f>>=1)&&(t+=t))1&r&&(n+=t);return n}},function(e,t){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},function(e,t){var n=Math.expm1;e.exports=!n||22025.465794806718=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(e,t,n){"use strict";var r,o,a=n(60),u=RegExp.prototype.exec,c=String.prototype.replace,i=u,s="lastIndex",l=(r=/a/,o=/b*/g,u.call(r,"a"),u.call(o,"a"),0!==r[s]||0!==o[s]),f=void 0!==/()??/.exec("")[1];(l||f)&&(i=function(e){var t,n,r,o,i=this;return f&&(n=new RegExp("^"+i.source+"$(?!\\s)",a.call(i))),l&&(t=i[s]),r=u.call(i,e),l&&r&&(i[s]=i.global?r.index+r[0].length:t),f&&r&&1>1,l=23===t?j(2,-24)-j(2,-77):0,f=0,p=e<0||0===e&&1/e<0?1:0;for((e=C(e))!=e||e===A?(o=e!=e?1:0,r=c):(r=k(I(e)/M),e*(i=j(2,-r))<1&&(r--,i*=2),2<=(e+=1<=r+s?l/i:l*j(2,1-s))*i&&(r++,i/=2),c<=r+s?(o=0,r=c):1<=r+s?(o=(e*i-1)*j(2,t),r+=s):(o=e*j(2,s-1)*j(2,t),r=0));8<=t;a[f++]=255&o,o/=256,t-=8);for(r=r<>1,u=o-7,c=n-1,s=e[c--],l=127&s;for(s>>=7;0>=-u,u+=t;0>8&255]}function z(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function W(e){return F(e,52,8)}function G(e){return F(e,23,4)}function $(e,t,n){y(e[S],t,{get:function(){return this[n]}})}function q(e,t,n,r){var o=d(+n);if(o+t>e[D])throw E(w);var i=e[N]._b,a=o+e[L],u=i.slice(a,a+t);return r?u:u.reverse()}function K(e,t,n,r,o,i){var a=d(+n);if(a+t>e[D])throw E(w);for(var u=e[N]._b,c=a+e[L],s=r(+o),l=0;lZ;)(Y=X[Z++])in O||u(O,Y,P[Y]);i||(J.constructor=O)}var Q=new _(new O(2)),ee=_[S].setInt8;Q.setInt8(0,2147483648),Q.setInt8(1,2147483649),!Q.getInt8(0)&&Q.getInt8(1)||c(_[S],{setInt8:function(e,t){ee.call(this,e,t<<24>>24)},setUint8:function(e,t){ee.call(this,e,t<<24>>24)}},!0)}else O=function(e){l(this,O,g);var t=d(e);this._b=v.call(new Array(t),0),this[D]=t},_=function(e,t,n){l(this,_,b),l(e,O,b);var r=e[D],o=f(t);if(o<0||r>24},getUint8:function(e){return q(this,1,e)[0]},getInt16:function(e,t){var n=q(this,2,e,t);return(n[1]<<8|n[0])<<16>>16},getUint16:function(e,t){var n=q(this,2,e,t);return n[1]<<8|n[0]},getInt32:function(e,t){return V(q(this,4,e,t))},getUint32:function(e,t){return V(q(this,4,e,t))>>>0},getFloat32:function(e,t){return U(q(this,4,e,t),23,4)},getFloat64:function(e,t){return U(q(this,8,e,t),52,8)},setInt8:function(e,t){K(this,1,e,H,t)},setUint8:function(e,t){K(this,1,e,H,t)},setInt16:function(e,t,n){K(this,2,e,B,t,n)},setUint16:function(e,t,n){K(this,2,e,B,t,n)},setInt32:function(e,t,n){K(this,4,e,z,t,n)},setUint32:function(e,t,n){K(this,4,e,z,t,n)},setFloat32:function(e,t,n){K(this,4,e,G,t,n)},setFloat64:function(e,t,n){K(this,8,e,W,t,n)}});m(O,g),m(_,b),u(_[S],a.VIEW,!0),t[g]=O,t[b]=_},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(e){return"object"===n(e)?null!==e:"function"==typeof e}},function(e,t,n){e.exports=!n(149)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t=n.length){var h=m(a,f);a=(l=!!h)&&"get"in h&&!("originalValue"in h.get)?h.get:a[f]}else l=w(a,f),a=a[f];l&&!u&&(g[i]=a)}}return a}},function(o,e,i){"use strict";(function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var n=e.Symbol,r=i(189);o.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"===t(n("foo"))&&("symbol"===t(Symbol("bar"))&&r())))}}).call(this,i(188))},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t,n,r){var o;t in e&&("function"!=typeof(o=r)||"[object Function]"!==i.call(o)||!r())||(f?l(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n)}function o(e,t,n){var r=2=n.length){var d=v(u,p);if(f=!!d,!(t||p in u))throw new y("base intrinsic for "+e+" exists, but the property is not available.");u=f&&"get"in d&&!("originalValue"in d.get)?d.get:u[p]}else f=w(u,p),u=u[p];f&&!c&&(g[a]=u)}}return u}},function(e,t,n){"use strict";var r=n(112);e.exports=function(){return String.prototype.trim&&"​"==="​".trim()?String.prototype.trim:r}},function(e,t,n){var r=n(116);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);no;)a(r,n=t[o++])&&(~c(i,n)||i.push(n));return i}},function(e,t,n){var a=n(14),u=n(6),c=n(37);e.exports=n(13)?Object.defineProperties:function(e,t){u(e);for(var n,r=c(t),o=r.length,i=0;i>>0||(a.test(n)?16:10))}:r},function(e,t,n){var r=n(4).parseFloat,o=n(45).trim;e.exports=1/r(n(75)+"-0")!=-1/0?function(e){var t=o(String(e),3),n=r(t);return 0===n&&"-"==t.charAt(0)?-0:n}:r},function(e,t,n){var r=n(29);e.exports=function(e,t){if("number"!=typeof e&&"Number"!=r(e))throw TypeError(t);return+e}},function(e,t,n){var r=n(7),o=Math.floor;e.exports=function(e){return!r(e)&&isFinite(e)&&o(e)===e}},function(e,t){e.exports=Math.log1p||function(e){return-1e-8<(e=+e)&&e<1e-8?e-e*e/2:Math.log(1+e)}},function(e,t,n){"use strict";var r=n(39),o=n(34),i=n(44),a={};n(20)(a,n(9)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:o(1,n)}),i(e,t+" Iterator")}},function(e,t,n){var i=n(6);e.exports=function(t,e,n,r){try{return r?e(i(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&i(o.call(t)),e}}},function(e,t,n){var r=n(329);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){var l=n(24),f=n(15),p=n(50),d=n(11);e.exports=function(e,t,n,r,o){l(t);var i=f(e),a=p(i),u=d(i.length),c=o?u-1:0,s=o?-1:1;if(n<2)for(;;){if(c in a){r=a[c],c+=s;break}if(c+=s,o?c<0:u<=c)throw TypeError("Reduce of empty array with no initial value")}for(;o?0<=c:ce;)t(r[e++]);l._c=[],l._n=!1,n&&!l._h&&L(l)})}}function i(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),o(t,!0))}function a(e){var n,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===e)throw j("Promise can't be resolved itself");(n=f(e))?_(function(){var t={_w:r,_d:!1};try{n.call(e,h(a,t,1),h(i,t,1))}catch(e){i.call(t,e)}}):(r._v=e,r._s=1,o(r,!1))}catch(e){i.call({_w:r,_d:!1},e)}}}var u,c,s,l,p=n(36),d=n(4),h=n(23),y=n(52),v=n(1),m=n(7),g=n(24),b=n(48),S=n(63),w=n(53),O=n(92).set,_=n(349)(),x=n(140),E=n(350),A=n(64),P=n(141),C="Promise",j=d.TypeError,k=d.process,I=k&&k.versions,M=I&&I.v8||"",R=d[C],T="process"==y(k),N=c=x.f,D=!!function(){try{var e=R.resolve(1),t=(e.constructor={})[n(9)("species")]=function(e){e(r,r)};return(T||"function"==typeof PromiseRejectionEvent)&&e.then(r)instanceof t&&0!==M.indexOf("6.6")&&-1===A.indexOf("Chrome/66")}catch(e){}}(),L=function(i){O.call(d,function(){var e,t,n,r=i._v,o=F(i);if(o&&(e=E(function(){T?k.emit("unhandledRejection",r,i):(t=d.onunhandledrejection)?t({promise:i,reason:r}):(n=d.console)&&n.error&&n.error("Unhandled promise rejection",r)}),i._h=T||F(i)?2:1),i._a=void 0,o&&e.e)throw e.v})},F=function(e){return 1!==e._h&&0===(e._a||e._c).length},U=function(t){O.call(d,function(){var e;T?k.emit("rejectionHandled",t):(e=d.onrejectionhandled)&&e({promise:t,reason:t._v})})};D||(R=function(e){b(this,R,C,"_h"),g(e),u.call(this);try{e(h(a,this,1),h(i,this,1))}catch(e){i.call(this,e)}},(u=function(){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(49)(R.prototype,{then:function(e,t){var n=N(w(this,R));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=T?k.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&o(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),s=function(){var e=new u;this.promise=e,this.resolve=h(a,e,1),this.reject=h(i,e,1)},x.f=N=function(e){return e===R||e===l?new s:c(e)}),v(v.G+v.W+v.F*!D,{Promise:R}),n(44)(R,C),n(47)(C),l=n(12)[C],v(v.S+v.F*!D,C,{reject:function(e){var t=N(this);return(0,t.reject)(e),t.promise}}),v(v.S+v.F*(p||!D),C,{resolve:function(e){return P(p&&this===l?R:this,e)}}),v(v.S+v.F*!(D&&n(59)(function(e){R.all(e).catch(r)})),C,{all:function(e){var a=this,t=N(a),u=t.resolve,c=t.reject,n=E(function(){var r=[],o=0,i=1;S(e,!1,function(e){var t=o++,n=!1;r.push(void 0),i++,a.resolve(e).then(function(e){n||(n=!0,r[t]=e,--i||u(r))},c)}),--i||u(r)});return n.e&&c(n.v),t.promise},race:function(e){var t=this,n=N(t),r=n.reject,o=E(function(){S(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},function(e,t,n){"use strict";var o=n(24);function r(e){var n,r;this.promise=new e(function(e,t){if(void 0!==n||void 0!==r)throw TypeError("Bad Promise constructor");n=e,r=t}),this.resolve=o(n),this.reject=o(r)}e.exports.f=function(e){return new r(e)}},function(e,t,n){var r=n(6),o=n(7),i=n(140);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){"use strict";function a(e,t){var n,r=h(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n}var u=n(14).f,c=n(39),s=n(49),l=n(23),f=n(48),p=n(63),r=n(81),o=n(136),i=n(47),d=n(13),h=n(33).fastKey,y=n(43),v=d?"_s":"size";e.exports={getConstructor:function(e,i,n,r){var o=e(function(e,t){f(e,o,i,"_i"),e._t=i,e._i=c(null),e._f=void 0,e._l=void 0,e[v]=0,null!=t&&p(t,n,e[r],e)});return s(o.prototype,{clear:function(){for(var e=y(this,i),t=e._i,n=e._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete t[n.i];e._f=e._l=void 0,e[v]=0},delete:function(e){var t=y(this,i),n=a(t,e);if(n){var r=n.n,o=n.p;delete t._i[n.i],n.r=!0,o&&(o.n=r),r&&(r.p=o),t._f==n&&(t._f=r),t._l==n&&(t._l=o),t[v]--}return!!n},forEach:function(e,t){y(this,i);for(var n,r=l(e,1c&&(s=s.slice(0,c)),r?s+o:o+s}},function(e,t,n){var c=n(13),s=n(37),l=n(21),f=n(51).f;e.exports=function(u){return function(e){for(var t,n=l(e),r=s(n),o=r.length,i=0,a=[];i-1},get:function e(t){return o[r.indexOf(t)]},set:function e(t,n){if(r.indexOf(t)===-1){r.push(t);o.push(n)}},delete:function e(t){var n=r.indexOf(t);if(n>-1){r.splice(n,1);o.splice(n,1)}}}}(),d=function e(t){return new Event(t,{bubbles:true})};try{new Event("test")}catch(e){d=function e(t){var n=document.createEvent("Event");n.initEvent(t,true,false);return n}}function r(o){if(!o||!o.nodeName||o.nodeName!=="TEXTAREA"||p.has(o))return;var n=null;var r=null;var i=null;function e(){var e=window.getComputedStyle(o,null);if(e.resize==="vertical"){o.style.resize="none"}else if(e.resize==="both"){o.style.resize="horizontal"}if(e.boxSizing==="content-box"){n=-(parseFloat(e.paddingTop)+parseFloat(e.paddingBottom))}else{n=parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth)}if(isNaN(n)){n=0}s()}function a(e){{var t=o.style.width;o.style.width="0px";o.offsetWidth;o.style.width=t}o.style.overflowY=e}function u(e){var t=[];while(e&&e.parentNode&&e.parentNode instanceof Element){if(e.parentNode.scrollTop){t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop})}e=e.parentNode}return t}function c(){if(o.scrollHeight===0){return}var e=u(o);var t=document.documentElement&&document.documentElement.scrollTop;o.style.height="";o.style.height=o.scrollHeight+n+"px";r=o.clientWidth;e.forEach(function(e){e.node.scrollTop=e.scrollTop});if(t){document.documentElement.scrollTop=t}}function s(){c();var e=Math.round(parseFloat(o.style.height));var t=window.getComputedStyle(o,null);var n=t.boxSizing==="content-box"?Math.round(parseFloat(t.height)):o.offsetHeight;if(no;)f(K,t=n[o++])||t==W||t==y||r.push(t);return r}function s(e){for(var t,n=e===J,r=U(n?Y:C(e)),o=[],i=0;r.length>i;)!f(K,t=r[i++])||n&&!f(J,t)||o.push(K[t]);return o}var l=n(4),f=n(19),p=n(13),d=n(1),h=n(17),y=n(33).KEY,v=n(5),m=n(55),g=n(44),b=n(35),S=n(9),w=n(70),O=n(118),_=n(240),x=n(58),E=n(6),A=n(7),P=n(15),C=n(21),j=n(32),k=n(34),I=n(39),M=n(121),R=n(26),T=n(57),N=n(14),D=n(37),L=R.f,F=N.f,U=M.f,V=l.Symbol,H=l.JSON,B=H&&H.stringify,z="prototype",W=S("_hidden"),G=S("toPrimitive"),$={}.propertyIsEnumerable,q=m("symbol-registry"),K=m("symbols"),Y=m("op-symbols"),J=Object[z],X="function"==typeof V&&!!T.f,Z=l.QObject,Q=!Z||!Z[z]||!Z[z].findChild,ee=p&&v(function(){return 7!=I(F({},"a",{get:function(){return F(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=L(J,t);r&&delete J[t],F(e,t,n),r&&e!==J&&F(J,t,r)}:F,te=X&&"symbol"==r(V.iterator)?function(e){return"symbol"==r(e)}:function(e){return e instanceof V},ne=function(e,t,n){return e===J&&ne(Y,t,n),E(e),t=j(t,!0),E(n),f(K,t)?(n.enumerable?(f(e,W)&&e[W][t]&&(e[W][t]=!1),n=I(n,{enumerable:k(0,!1)})):(f(e,W)||F(e,W,k(1,{})),e[W][t]=!0),ee(e,t,n)):F(e,t,n)};X||(h((V=function(e){if(this instanceof V)throw TypeError("Symbol is not a constructor!");var n=b(0oe;)S(re[oe++]);for(var ie=D(S.store),ae=0;ie.length>ae;)O(ie[ae++]);d(d.S+d.F*!X,"Symbol",{for:function(e){return f(q,e+="")?q[e]:q[e]=V(e)},keyFor:function(e){if(!te(e))throw TypeError(e+" is not a symbol!");for(var t in q)if(q[t]===e)return t},useSetter:function(){Q=!0},useSimple:function(){Q=!1}}),d(d.S+d.F*!X,"Object",{create:function(e,t){return void 0===t?I(e):i(I(e),t)},defineProperty:ne,defineProperties:i,getOwnPropertyDescriptor:u,getOwnPropertyNames:c,getOwnPropertySymbols:s});var ue=v(function(){T.f(1)});d(d.S+d.F*ue,"Object",{getOwnPropertySymbols:function(e){return T.f(P(e))}}),H&&d(d.S+d.F*(!X||v(function(){var e=V();return"[null]"!=B([e])||"{}"!=B({a:e})||"{}"!=B(Object(e))})),"JSON",{stringify:function(e){for(var t,n,r=[e],o=1;oa;)i.call(e,r=o[a++])&&t.push(r);return t}},function(e,t,n){var r=n(1);r(r.S,"Object",{create:n(39)})},function(e,t,n){var r=n(1);r(r.S+r.F*!n(13),"Object",{defineProperty:n(14).f})},function(e,t,n){var r=n(1);r(r.S+r.F*!n(13),"Object",{defineProperties:n(120)})},function(e,t,n){var r=n(21),o=n(26).f;n(27)("getOwnPropertyDescriptor",function(){return function(e,t){return o(r(e),t)}})},function(e,t,n){var r=n(15),o=n(41);n(27)("getPrototypeOf",function(){return function(e){return o(r(e))}})},function(e,t,n){var r=n(15),o=n(37);n(27)("keys",function(){return function(e){return o(r(e))}})},function(e,t,n){n(27)("getOwnPropertyNames",function(){return n(121).f})},function(e,t,n){var r=n(7),o=n(33).onFreeze;n(27)("freeze",function(t){return function(e){return t&&r(e)?t(o(e)):e}})},function(e,t,n){var r=n(7),o=n(33).onFreeze;n(27)("seal",function(t){return function(e){return t&&r(e)?t(o(e)):e}})},function(e,t,n){var r=n(7),o=n(33).onFreeze;n(27)("preventExtensions",function(t){return function(e){return t&&r(e)?t(o(e)):e}})},function(e,t,n){var r=n(7);n(27)("isFrozen",function(t){return function(e){return!r(e)||!!t&&t(e)}})},function(e,t,n){var r=n(7);n(27)("isSealed",function(t){return function(e){return!r(e)||!!t&&t(e)}})},function(e,t,n){var r=n(7);n(27)("isExtensible",function(t){return function(e){return!!r(e)&&(!t||t(e))}})},function(e,t,n){var r=n(1);r(r.S+r.F,"Object",{assign:n(122)})},function(e,t,n){var r=n(1);r(r.S,"Object",{is:n(123)})},function(e,t,n){var r=n(1);r(r.S,"Object",{setPrototypeOf:n(74).set})},function(e,t,n){"use strict";var r=n(52),o={};o[n(9)("toStringTag")]="z",o+""!="[object z]"&&n(17)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},function(e,t,n){var r=n(1);r(r.P,"Function",{bind:n(124)})},function(e,t,n){var r=n(14).f,o=Function.prototype,i=/^\s*function ([^ (]*)/;"name"in o||n(13)&&r(o,"name",{configurable:!0,get:function(){try{return(""+this).match(i)[1]}catch(e){return""}}})},function(e,t,n){"use strict";var r=n(7),o=n(41),i=n(9)("hasInstance"),a=Function.prototype;i in a||n(14).f(a,i,{value:function(e){if("function"!=typeof this||!r(e))return!1;if(!r(this.prototype))return e instanceof this;for(;e=o(e);)if(this.prototype===e)return!0;return!1}})},function(e,t,n){var r=n(1),o=n(126);r(r.G+r.F*(parseInt!=o),{parseInt:o})},function(e,t,n){var r=n(1),o=n(127);r(r.G+r.F*(parseFloat!=o),{parseFloat:o})},function(e,t,n){"use strict";function r(e){var t=l(e,!1);if("string"==typeof t&&2O;O++)i(v,S=w[O])&&!i(y,S)&&p(y,S,f(v,S));(y.prototype=m).constructor=y,n(17)(o,h,y)}},function(e,t,n){"use strict";function s(e,t){for(var n=-1,r=t;++n<6;)r+=e*a[n],a[n]=r%1e7,r=i(r/1e7)}function l(e){for(var t=6,n=0;0<=--t;)n+=a[t],a[t]=i(n/e),n=n%e*1e7}function f(){for(var e=6,t="";0<=--e;)if(""!==t||0===e||0!==a[e]){var n=String(a[e]);t=""===t?n:t+y.call("0",7-n.length)+n}return t}function p(e,t,n){return 0===t?n:t%2==1?p(e,t-1,n*e):p(e*e,t/2,n)}var r=n(1),d=n(25),h=n(128),y=n(77),o=1..toFixed,i=Math.floor,a=[0,0,0,0,0,0],v="Number.toFixed: incorrect invocation!";r(r.P+r.F*(!!o&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(5)(function(){o.call({})})),"Number",{toFixed:function(e){var t,n,r,o,i=h(this,v),a=d(e),u="",c="0";if(a<0||20>>=0)?31-Math.floor(Math.log(e+.5)*Math.LOG2E):32}})},function(e,t,n){var r=n(1),o=Math.exp;r(r.S,"Math",{cosh:function(e){return(o(e=+e)+o(-e))/2}})},function(e,t,n){var r=n(1),o=n(79);r(r.S+r.F*(o!=Math.expm1),"Math",{expm1:o})},function(e,t,n){var r=n(1);r(r.S,"Math",{fround:n(283)})},function(e,t,n){var i=n(78),r=Math.pow,a=r(2,-52),u=r(2,-23),c=r(2,127)*(2-u),s=r(2,-126);e.exports=Math.fround||function(e){var t,n,r=Math.abs(e),o=i(e);return r>>16)*i+o*(65535&r>>>16)<<16>>>0)}})},function(e,t,n){var r=n(1);r(r.S,"Math",{log10:function(e){return Math.log(e)*Math.LOG10E}})},function(e,t,n){var r=n(1);r(r.S,"Math",{log1p:n(130)})},function(e,t,n){var r=n(1);r(r.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},function(e,t,n){var r=n(1);r(r.S,"Math",{sign:n(78)})},function(e,t,n){var r=n(1),o=n(79),i=Math.exp;r(r.S+r.F*n(5)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function(e){return Math.abs(e=+e)<1?(o(e)-o(-e))/2:(i(e-1)-i(-e-1))*(Math.E/2)}})},function(e,t,n){var r=n(1),o=n(79),i=Math.exp;r(r.S,"Math",{tanh:function(e){var t=o(e=+e),n=o(-e);return t==1/0?1:n==1/0?-1:(t-n)/(i(e)+i(-e))}})},function(e,t,n){var r=n(1);r(r.S,"Math",{trunc:function(e){return(0>10),t%1024+56320))}return n.join("")}})},function(e,t,n){var r=n(1),a=n(21),u=n(11);r(r.S,"String",{raw:function(e){for(var t=a(e.raw),n=u(t.length),r=arguments.length,o=[],i=0;i=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){"use strict";var r=n(1),o=n(80)(!1);r(r.P,"String",{codePointAt:function(e){return o(this,e)}})},function(e,t,n){"use strict";var r=n(1),u=n(11),c=n(82),s="endsWith",l=""[s];r(r.P+r.F*n(84)(s),"String",{endsWith:function(e,t){var n=c(this,e,s),r=1m;)y(v[m++]);(f.constructor=s).prototype=f,n(17)(r,"RegExp",s)}n(47)("RegExp")},function(e,t,n){"use strict";n(138);function r(e){n(17)(RegExp.prototype,u,e,!0)}var o=n(6),i=n(60),a=n(13),u="toString",c=/./[u];n(5)(function(){return"/a/b"!=c.call({source:"a",flags:"b"})})?r(function(){var e=o(this);return"/".concat(e.source,"/","flags"in e?e.flags:!a&&e instanceof RegExp?i.call(e):void 0)}):c.name!=u&&r(function(){return c.call(this)})},function(e,t,n){"use strict";var f=n(6),p=n(11),d=n(91),h=n(61);n(62)("match",1,function(r,o,s,l){return[function(e){var t=r(this),n=null==e?void 0:e[o];return void 0!==n?n.call(e,t):new RegExp(e)[o](String(t))},function(e){var t=l(s,e,this);if(t.done)return t.value;var n=f(e),r=String(this);if(!n.global)return h(n,r);for(var o,i=n.unicode,a=[],u=n.lastIndex=0;null!==(o=h(n,r));){var c=String(o[0]);""===(a[u]=c)&&(n.lastIndex=d(r,p(n.lastIndex),i)),u++}return 0===u?null:a}]})},function(e,t,n){"use strict";var x=n(6),r=n(15),E=n(11),A=n(25),P=n(91),C=n(61),j=Math.max,k=Math.min,p=Math.floor,d=/\$([$&`']|\d\d?|<[^>]*>)/g,h=/\$([$&`']|\d\d?)/g;n(62)("replace",2,function(o,i,w,O){return[function(e,t){var n=o(this),r=null==e?void 0:e[i];return void 0!==r?r.call(e,n,t):w.call(String(n),e,t)},function(e,t){var n=O(w,e,this,t);if(n.done)return n.value;var r=x(e),o=String(this),i="function"==typeof t;i||(t=String(t));var a=r.global;if(a){var u=r.unicode;r.lastIndex=0}for(var c=[];;){var s=C(r,o);if(null===s)break;if(c.push(s),!a)break;""===String(s[0])&&(r.lastIndex=P(o,E(r.lastIndex),u))}for(var l,f="",p=0,d=0;d>>0,l=new RegExp(e.source,u+"g");(r=p.call(l,n))&&!(c<(o=l[y])&&(a.push(n.slice(c,r.index)),1=s));)l[y]===r.index&&l[y]++;return c===n[h]?!i&&l.test("")||a.push(""):a.push(n.slice(c)),a[h]>s?a.slice(0,s):a}:"0"[a](void 0,0)[h]?function(e,t){return void 0===e&&0===t?[]:v.call(this,e,t)}:v,[function(e,t){var n=o(this),r=null==e?void 0:e[i];return void 0!==r?r.call(e,n,t):g.call(String(n),e,t)},function(e,t){var n=m(g,e,this,t,g!==v);if(n.done)return n.value;var r=b(e),o=String(this),i=S(r,RegExp),a=r.unicode,u=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(A?"y":"g"),c=new i(A?r:"^(?:"+r.source+")",u),s=void 0===t?E:t>>>0;if(0==s)return[];if(0===o.length)return null===_(c,o)?[o]:[];for(var l=0,f=0,p=[];f=t.length)return{value:void 0,done:!0}}while(!((e=t[this._i++])in this._t));return{value:e,done:!1}}),o(o.S,"Reflect",{enumerate:function(e){return new r(e)}})},function(e,t,n){var a=n(26),u=n(41),c=n(19),r=n(1),s=n(7),l=n(6);r(r.S,"Reflect",{get:function e(t,n){var r,o,i=arguments.length<3?t:arguments[2];return l(t)===i?t[n]:(r=a.f(t,n))?c(r,"value")?r.value:void 0!==r.get?r.get.call(i):void 0:s(o=u(t))?e(o,n,i):void 0}})},function(e,t,n){var r=n(26),o=n(1),i=n(6);o(o.S,"Reflect",{getOwnPropertyDescriptor:function(e,t){return r.f(i(e),t)}})},function(e,t,n){var r=n(1),o=n(41),i=n(6);r(r.S,"Reflect",{getPrototypeOf:function(e){return o(i(e))}})},function(e,t,n){var r=n(1);r(r.S,"Reflect",{has:function(e,t){return t in e}})},function(e,t,n){var r=n(1),o=n(6),i=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(e){return o(e),!i||i(e)}})},function(e,t,n){var r=n(1);r(r.S,"Reflect",{ownKeys:n(145)})},function(e,t,n){var r=n(1),o=n(6),i=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(e){o(e);try{return i&&i(e),!0}catch(e){return!1}}})},function(e,t,n){var c=n(14),s=n(26),l=n(41),f=n(19),r=n(1),p=n(34),d=n(6),h=n(7);r(r.S,"Reflect",{set:function e(t,n,r){var o,i,a=arguments.length<4?t:arguments[3],u=s.f(d(t),n);if(!u){if(h(i=l(t)))return e(i,n,r,a);u=p(0)}if(f(u,"value")){if(!1===u.writable||!h(a))return!1;if(o=s.f(a,n)){if(o.get||o.set||!1===o.writable)return!1;o.value=r,c.f(a,n,o)}else c.f(a,n,p(0,r));return!0}return void 0!==u.set&&(u.set.call(a,r),!0)}})},function(e,t,n){var r=n(1),o=n(74);o&&r(r.S,"Reflect",{setPrototypeOf:function(e,t){o.check(e,t);try{return o.set(e,t),!0}catch(e){return!1}}})},function(e,t,n){n(381),e.exports=n(12).Array.includes},function(e,t,n){"use strict";var r=n(1),o=n(56)(!0);r(r.P,"Array",{includes:function(e,t){return o(this,e,1u;)void 0!==(n=o(r,t=i[u++]))&&f(a,t,n);return a}})},function(e,t,n){n(398),e.exports=n(12).Object.values},function(e,t,n){var r=n(1),o=n(147)(!1);r(r.S,"Object",{values:function(e){return o(e)}})},function(e,t,n){n(400),e.exports=n(12).Object.entries},function(e,t,n){var r=n(1),o=n(147)(!0);r(r.S,"Object",{entries:function(e){return o(e)}})},function(e,t,n){"use strict";n(139),n(402),e.exports=n(12).Promise.finally},function(e,t,n){"use strict";var r=n(1),o=n(12),i=n(4),a=n(53),u=n(141);r(r.P+r.R,"Promise",{finally:function(t){var n=a(this,o.Promise||i.Promise),e="function"==typeof t;return this.then(e?function(e){return u(n,t()).then(function(){return e})}:t,e?function(e){return u(n,t()).then(function(){throw e})}:t)}})},function(e,t,n){n(404),n(405),n(406),e.exports=n(12)},function(e,t,n){function r(o){return function(e,t){var n=2=f[o]&&o=f[n]&&n>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},Ne={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function De(e){return(De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Le(e){return 45===e.charCodeAt(1)}var Fe=/[A-Z]|^ms/g,Ue=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Ve=function(e){return null!=e&&"boolean"!=typeof e},He=function(t){var n={};return function(e){return void 0===n[e]&&(n[e]=t(e)),n[e]}}(function(e){return Le(e)?e:e.replace(Fe,"-$&").toLowerCase()}),Be=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Ue,function(e,t,n){return We={name:t,styles:n,next:We},t})}return 1===Ne[e]||Le(e)||"number"!=typeof t||0===t?t:t+"px"};function ze(e,t,n,r){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(De(n)){case"boolean":return"";case"object":if(1===n.anim)return We={name:n.name,styles:n.styles,next:We},n.name;if(void 0===n.styles)return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);nr.bottom?gt(t,Math.min(n.offsetTop+n.clientHeight-t.offsetHeight+i,t.scrollHeight)):o.top-ii.length-1&&(a=i.length-1):"last"===t&&(a=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[a],focusedValue:null}),this.announceAriaLiveContext({event:"menu",context:{isDisabled:Fn(i[a])}})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(Vn):Bn(Bn({},Vn),this.props.theme):Vn}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.getStyles,n=this.setValue,r=this.selectOption,o=this.props,i=o.classNamePrefix,a=o.isMulti,u=o.isRtl,c=o.options,s=this.state.selectValue,l=this.hasValue();return{cx:function(e,t,n){var r,o,i=[n];if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&i.push("".concat((r=e,(o=a)?"-"===o[0]?r+o:r+"__"+o:r)));return i.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}.bind(null,i),clearValue:e,getStyles:t,getValue:function(){return s},hasValue:l,isMulti:a,isRtl:u,options:c,selectOption:r,setValue:n,selectProps:o,theme:this.getTheme()}}},{key:"getNextFocusedValue",value:function(e){if(this.clearFocusValueOnUpdate)return this.clearFocusValueOnUpdate=!1,null;var t=this.state,n=t.focusedValue,r=t.selectValue.indexOf(n);if(-1e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nwindow.innerWidth&&(t.classList.add("align-right"),t.style.left="".concat(l-p.width+i-r.left,"px")),p.bottom>window.innerHeight){var d=s+a,h=r.bottom+a;t.classList.add("align-bottom"),t.style.top="auto",t.style.bottom="".concat(h-d,"px")}};function vi(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n",'')),(new DOMParser).parseFromString(n,"image/svg+xml").documentElement)).firstChild}}function aa(e){var t=ia(e),n=document.createElementNS(Gi,"g"),r=t.cloneNode(!0);r.setAttribute("class","a9s-inner");var o=t.cloneNode(!0);return o.setAttribute("class","a9s-outer"),n.appendChild(o),n.appendChild(r),n}function ua(e,t){var n=e.querySelector(".a9s-inner").cloneNode(!0);n.removeAttribute("class"),n.removeAttribute("xmlns");var r=n.outerHTML||(new XMLSerializer).serializeToString(n);return r=r.replace(' xmlns="'.concat(Gi,'"'),""),{source:t.src,selector:{type:"SvgSelector",value:"".concat(r,"")}}}function ca(e){var t=e.targets[0];if(t)return Array.isArray(t.selector)?t.selector[0]:t.selector}var sa=function(e){var t=e.selector("FragmentSelector");if(null!=t&&t.conformsTo.startsWith("http://www.w3.org/TR/media-frags")){var n=t.value,r=n.includes(":")?n.substring(n.indexOf("=")+1,n.indexOf(":")):"pixel",o=Yi((n.includes(":")?n.substring(n.indexOf(":")+1):n.substring(n.indexOf("=")+1)).split(",").map(parseFloat),4);return{x:o[0],y:o[1],w:o[2],h:o[3],format:r}}},la={FragmentSelector:ta,SvgSelector:aa},fa={FragmentSelector:function(e){var t=sa(e);return t.w*t.h},SvgSelector:function(){return 0}},pa=function(e){return la[ca(e).type](e)},da=function(e){return fa[ca(e).type](e)};function ha(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0 return mask - ''' def draw_bounding_boxes(img,connected_components,max_size=0,min_size=0,color=(0,0,255),line_size=2): for component in connected_components: @@ -81,6 +80,7 @@ def draw_bounding_boxes(img,connected_components,max_size=0,min_size=0,color=(0, (ys,xs)=component[:2] cv2.rectangle(img,(xs.start,ys.start),(xs.stop,ys.stop),color,line_size) ''' + def filter_by_size(image,connected_components,max_size,min_size): filtered = [] for cc in connected_components: @@ -199,8 +199,6 @@ def binarize(image, threshold=180): binary[high_values] = 255 return binary - - def main(): #proc_start_time = datetime.datetime.now() diff --git a/find_word_balloons.py b/find_word_balloons.py old mode 100755 new mode 100644 index 5bf5c89..e5556e5 --- a/find_word_balloons.py +++ b/find_word_balloons.py @@ -6,7 +6,7 @@ Author: John O'Neil Email: oneil.john@gmail.com DATE: Sunday, June 22nd 2014 - + """ import argparse @@ -130,7 +130,6 @@ def binarize(image, threshold=180): binary[high_values] = 255 return binary - def contains(cc_a, cc_b, ddw=5, ddh=5): w = width_bb(cc_a) dw = 0 @@ -176,7 +175,6 @@ def contains(self, cc_b): return cc_b[0].start>=(self.bounding_box[0].start-dh) and cc_b[0].stop<=(self.bounding_box[0].stop+dh) and \ cc_b[1].start>=(self.bounding_box[1].start-dw) and cc_b[1].stop<=(self.bounding_box[1].stop+dw) - class BalloonCandidate(ConnectedComponent): def __init__(self, index, bounding_box, labels): ConnectedComponent.__init__(self, index, bounding_box, labels) @@ -272,8 +270,6 @@ def generate_holes_mask(candidate_balloons, binary): #mask[two_d_slice] |= b.labels[two_d_slice]==False return (final_balloons, mask) - - def main(): #proc_start_time = datetime.datetime.now() @@ -341,8 +337,6 @@ def main(): #4 for each balloon candidate, attempt to find character candidates #characters, character_mask = find_characters_in_balloon_candidates(candidate_balloons) - - plt.subplot(241) plt.imshow(image, cmap=cm.Greys_r) plt.subplot(242) @@ -358,7 +352,6 @@ def main(): plt.show() - if __name__ == '__main__': main() diff --git a/furigana.py b/furigana.py old mode 100755 new mode 100644 index 46a57fe..9a81243 --- a/furigana.py +++ b/furigana.py @@ -11,7 +11,7 @@ on low resolution manga scans. This scipt attempts to estimate furigana sections of given (pre segmented) text areas. - + """ import numpy as np @@ -130,7 +130,6 @@ def estimate_furigana_from_files(filename, segmentation_filename): segmentation = seg[:,:,2] return estimate_furigana(gray, segmentation) - def main(): parser = arg.parser parser = argparse.ArgumentParser(description='Estimate areas of furigana in segmented raw manga scan.') @@ -171,4 +170,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/image_io.py b/image_io.py new file mode 100644 index 0000000..d0dfe17 --- /dev/null +++ b/image_io.py @@ -0,0 +1,88 @@ +# Perform OCR on an image or +# images in a directory + +import defaults +import arg +import ocr + +from imageio import imwrite +import cv2 +import os +import shutil + +def normalize_path(path): + if path[-1] != '/': path=path+'/' + return path + +def copytree_(src, dst): + extensions = ['.css', '.js'] + for f in os.listdir(src): + if (os.path.splitext(f)[1] not in extensions): + continue + try: + shutil.copy(src+f, dst) + except OSError as e: + os.mkdir(dst) + shutil.copy(src+f, dst) + +def save_text(texts, path): + path = os.path.splitext(path)[0]+'.txt' + try: + with open(path, "w", encoding='utf-8') as txt_file: + for text in texts: + txt_file.write(" ".join(text) + "\n") + except FileNotFoundError as e: + os.mkdir(os.path.split(path)[0]) + with open(path, "w", encoding='utf-8') as txt_file: + for text in texts: + txt_file.write(" ".join(text) + "\n") + +def save_image(img, path): + try: + imwrite(path, img) + except FileNotFoundError as e: + os.mkdir(os.path.split(path)[0]) + imwrite(path, img) + +def generate_html(img_path, rects, texts, name='image'): + + text_boxes = ocr.create_textboxes(rects, texts) + + text_boxes_as_dict = '[' + for tb in text_boxes: + text_boxes_as_dict += tb.export_as_dict() + ',' + text_boxes_as_dict = text_boxes_as_dict[:-1] + ']' + + path_to_template = defaults.PATH_TO_HTML_TEMPLATE + f_template = open(path_to_template, 'r') + template = f_template.read() + f_template.close() + + anno_path = os.path.split(img_path)[0] + 'annotorious/' + + html_out = template.format(img_name=name, img_path=img_path, textBoxes=text_boxes_as_dict) + + return html_out + +def save_webpage(html_out, html_path): + + with open(html_path, "w", encoding='utf-8') as txt_file: + txt_file.write(html_out) + +def get_output_directory(img_path, img_name, txt_path, txt_name, outfile): + + if (arg.is_defined('infile') and arg.is_defined('outfile')): + img_path, img_name = os.path.split(outfile) + img_path = normalize_path(img_path) + txt_path = img_path + txt_name = os.path.splitext(img_name)[0] + '.txt' + + if (arg.is_defined('inpath') and arg.is_defined('outfile')): + img_path = normalize_path(outfile) + txt_path = normalize_path(outfile) + + if arg.boolean_value('default_directory'): + img_path = img_path+defaults.IMAGE_OUTPUT_DIRECTORY + txt_path = txt_path+defaults.TEXT_OUTPUT_DIRECTORY + + return (img_path+img_name, txt_path+txt_name) diff --git a/ocr.py b/ocr.py old mode 100755 new mode 100644 index 29768b3..11216d5 --- a/ocr.py +++ b/ocr.py @@ -1,226 +1,124 @@ -#!/usr/bin/python -# vim: set ts=2 expandtab: -""" -Module: ocr -Desc: -Author: John O'Neil -Email: oneil.john@gmail.com -DATE: Saturday, August 10th 2013 - Revision: Thursday, August 15th 2013 - - Run OCR on some text bounding boxes. - -""" -#import clean_page as clean -import connected_components as cc -import run_length_smoothing as rls -import segmentation -import clean_page as clean -import arg -import defaults -import argparse - -import numpy as np -import cv2 -import sys -import os -import scipy.ndimage -from pylab import zeros,amax,median - import pytesseract +import cv2 +import numpy as np -class Blurb(object): - def __init__(self, x, y, w, h, text, confidence=100.0): - self.x=x - self.y=y - self.w=w - self.h=h - self.text = text - self.confidence = confidence +from segmentation import dimensions_2d_slice +import defaults +pytesseract.pytesseract.tesseract_cmd = 'C:/Program Files/Tesseract-OCR/tesseract.exe' + +class textBox: + def __init__(self, x, y, w, h, text): + self.x = x + self.y = y + self.w = w + self.h = h + self.text = text + def export_as_dict(self): + return f"{{x:{self.x},y:{self.y},w:{self.w},h:{self.h},text:\"{self.text}\"}}" def draw_2d_slices(img,slices,color=(0,0,255),line_size=1): - for entry in slices: - vert=entry[0] - horiz=entry[1] - cv2.rectangle(img,(horiz.start,vert.start),(horiz.stop,vert.stop),color,line_size) - -def max_width_2d_slices(lines): - max_width = 0 - for line in lines: - width = line[1].stop - line[1].start - if width>max_width: - width = max_width - return max_width - -def estimate_furigana(lines): - max_width = max_width_2d_slices(lines) - furigana = [] - non_furigana = [] - for line in lines: - width = line[1].stop - line[1].start - if width < max_width*0.5: - furigana.append(line) - else: - non_furigana.append(line) - return (furigana, non_furigana) + for entry in slices: + vert=entry[0] + horiz=entry[1] + cv2.rectangle(img,(horiz.start,vert.start),(horiz.stop,vert.stop),color,line_size) def segment_into_lines(img,component, min_segment_threshold=1): - (ys,xs)=component[:2] - w=xs.stop-xs.start - h=ys.stop-ys.start - x = xs.start - y = ys.start - aspect = float(w)/float(h) - - vertical = [] - start_col = xs.start - for col in range(xs.start,xs.stop): - count = np.count_nonzero(img[ys.start:ys.stop,col]) - if count<=min_segment_threshold or col==(xs.stop): - if start_col>=0: - vertical.append((slice(ys.start,ys.stop),slice(start_col,col))) - start_col=-1 - elif start_col < 0: - start_col=col - - #detect horizontal rows of non-zero pixels - horizontal=[] - start_row = ys.start - for row in range(ys.start,ys.stop): - count = np.count_nonzero(img[row,xs.start:xs.stop]) - if count<=min_segment_threshold or row==(ys.stop): - if start_row>=0: - horizontal.append((slice(start_row,row),slice(xs.start,xs.stop))) - start_row=-1 - elif start_row < 0: - start_row=row - - #we've now broken up the original bounding box into possible vertical - #and horizontal lines. - #We now wish to: - #1) Determine if the original bounding box contains text running V or H - #2) Eliminate all bounding boxes (don't return them in our output lists) that - # we can't explicitly say have some "regularity" in their line width/heights - #3) Eliminate all bounding boxes that can't be divided into v/h lines at all(???) - #also we will give possible vertical text runs preference as they're more common - #if len(vertical)<2 and len(horizontal)<2:continue - return (aspect, vertical, horizontal) - -def ocr_on_bounding_boxes(img, components): - - blurbs = [] - for component in components: - (aspect, vertical, horizontal) = segment_into_lines(img, component) + (ys,xs)=component[:2] + w=xs.stop-xs.start + h=ys.stop-ys.start + x = xs.start + y = ys.start + aspect = float(w)/float(h) + + vertical = [] + start_col = xs.start + for col in range(xs.start,xs.stop): + count = np.count_nonzero(img[ys.start:ys.stop,col]) + if count<=min_segment_threshold or col==(xs.stop): + if start_col>=0: + vertical.append((slice(ys.start,ys.stop),slice(start_col,col))) + start_col=-1 + elif start_col < 0: + start_col=col + + #detect horizontal rows of non-zero pixels + horizontal=[] + start_row = ys.start + for row in range(ys.start,ys.stop): + count = np.count_nonzero(img[row,xs.start:xs.stop]) + if count<=min_segment_threshold or row==(ys.stop): + if start_row>=0: + horizontal.append((slice(start_row,row),slice(xs.start,xs.stop))) + start_row=-1 + elif start_row < 0: + start_row=row + + #we've now broken up the original bounding box into possible vertical + #and horizontal lines. + #We now wish to: + #1) Determine if the original bounding box contains text running V or H + #2) Eliminate all bounding boxes (don't return them in our output lists) that + # we can't explicitly say have some "regularity" in their line width/heights + #3) Eliminate all bounding boxes that can't be divided into v/h lines at all(???) + #also we will give possible vertical text runs preference as they're more common #if len(vertical)<2 and len(horizontal)<2:continue + return (aspect, vertical, horizontal) - #attempt to separately process furigana - #(furigana, non_furigana) = estimate_furigana(vertical) - - ''' - from http://code.google.com/p/tesseract-ocr/wiki/ControlParams - Useful parameters for Japanese and Chinese - - Some Japanese tesseract user found these parameters helpful for increasing tesseract-ocr (3.02) accuracy for Japanese : - - Name Suggested value Description - chop_enable T Chop enable. - use_new_state_cost F Use new state cost heuristics for segmentation state evaluation - segment_segcost_rating F Incorporate segmentation cost in word rating? - enable_new_segsearch 0 Enable new segmentation search path. - language_model_ngram_on 0 Turn on/off the use of character ngram model. - textord_force_make_prop_words F Force proportional word segmentation on all rows. - ''' - #now run OCR on this bounding box - api = pytesseract.TessBaseAPI() - api.Init(".","jpn",pytesseract.OEM_DEFAULT) - #handle single column lines as "vertical align" and Auto segmentation otherwise - if len(vertical)<2: - api.SetPageSegMode(5)#pytesseract.PSM_VERTICAL_ALIGN)#PSM_AUTO)#PSM_SINGLECHAR)# - else: - api.SetPageSegMode(pytesseract.PSM_AUTO)#PSM_SINGLECHAR)# - api.SetVariable('chop_enable','T') - api.SetVariable('use_new_state_cost','F') - api.SetVariable('segment_segcost_rating','F') - api.SetVariable('enable_new_segsearch','0') - api.SetVariable('language_model_ngram_on','0') - api.SetVariable('textord_force_make_prop_words','F') - api.SetVariable('tessedit_char_blacklist', '}>0 and len(txt)>0: - blurb = Blurb(x, y, w, h, txt, confidence=conf) - blurbs.append(blurb) - - ''' - for line in non_furigana: - x=line[1].start - y=line[0].start - w=line[1].stop-x - h=line[0].stop-y - roi = cv2.cv.CreateImage((w,h), 8, 1) - sub = cv2.cv.GetSubRect(cv2.cv.fromarray(img), (x, y, w, h)) - cv2.cv.Copy(sub, roi) - pytesseract.SetCvImage(roi, api) - txt=api.GetUTF8Text() - conf=api.MeanTextConf() - if conf>0: - blurb = Blurb(x, y, w, h, txt, confidence=conf) - blurbs.append(blurb) - ''' - return blurbs - -def main(): - parser = arg.parser - parser = argparse.ArgumentParser(description='Basic OCR on raw manga scan.') - parser.add_argument('infile', help='Input (color) raw Manga scan image to clean.') - parser.add_argument('-o','--output', dest='outfile', help='Output (color) cleaned raw manga scan image.') - parser.add_argument('-v','--verbose', help='Verbose operation. Print status messages during processing', action="store_true") - #parser.add_argument('-d','--debug', help='Overlay input image into output.', action="store_true") - parser.add_argument('--sigma', help='Std Dev of gaussian preprocesing filter.',type=float,default=None) - parser.add_argument('--binary_threshold', help='Binarization threshold value from 0 to 255.',type=int,default=defaults.BINARY_THRESHOLD) - parser.add_argument('--furigana', help='Attempt to suppress furigana characters to improve OCR.', action="store_true") - parser.add_argument('--segment_threshold', help='Threshold for nonzero pixels to separete vert/horiz text lines.',type=int,default=defaults.SEGMENTATION_THRESHOLD) - - arg.value = parser.parse_args() - - infile = arg.string_value('infile') - outfile = arg.string_value('outfile', default_value=infile + '.html') - - if not os.path.isfile(infile): - print('Please provide a regular existing input file. Use -h option for help.') - sys.exit(-1) - - if arg.boolean_value('verbose'): - print('\tProcessing file ' + infile) - print('\tGenerating output ' + outfile) - - img = cv2.imread(infile) - gray = clean.grayscale(img) - binary = clean.binarize(gray) - - segmented = segmentation.segment_image_file(infile) - - components = cc.get_connected_components(segmented) - - #perhaps do more strict filtering of connected components because sections of characters - #will not be dripped from run length smoothed areas? Yes. Results quite good. - #filtered = cc.filter_by_size(img,components,average_size*100,average_size*1) - - blurbs = ocr_on_bounding_boxes(binary, components) - for blurb in blurbs: - print (str(blurb.x)+','+str(blurb.y)+' '+str(blurb.w)+'x'+str(blurb.h)+' '+ str(blurb.confidence)+'% :'+ blurb.text) - - -if __name__ == '__main__': - main() +def create_textboxes(rects, texts): + + text_boxes = [] + + for i, rect in enumerate(rects): + x, y, w, h = dimensions_2d_slice(rect[:2]) + text_boxes.append(textBox(x,y,w,h,texts[i])) + return text_boxes + +def extend_bounding_rects(img, components): + + extended_rects = [] + + for component in components: + (y,x) = component[:2] + x_padding = 5 #int(x.stop * 0.05) + y_padding = 5 #int(y.stop * 0.05) + + x_start = max(0, x.start - x_padding) + y_start = max(0, y.start - y_padding) + x_stop = min(img.shape[1], x.stop + 2*x_padding) + y_stop = min(img.shape[0], y.stop + 2*y_padding) + + roi = img[y_start:y_stop, x_start:x_stop] + extended_rects.append(roi) + + return extended_rects + +def filter_text(text): + for ch in ['\n','\f','\"','\'']: + if ch in text: + text = text.replace(ch,' ') + return text + +def ocr_on_bounding_boxes(img, components, path=''): + + texts = [] + extended_rects = extend_bounding_rects(img, components) + + lang = defaults.OCR_LANGUAGE + oem = 1 + psm = defaults.TEXT_DIRECTION + config = f"-l {lang} --oem {oem} --psm {psm}" + + for rect in extended_rects: + text = pytesseract.image_to_string(rect, config=(config)) + text = filter_text(text) + texts.append(text) + + return texts + +# TODO: 1. Export image to an html file and +# annotate the page with the recognized text. (DONE) +# 2. Supress furigana when running OCR +# 3. Use 'jpn' package instead of 'jpn_vert' +# on bounding boxes that are likely to be +# read horizontally. \ No newline at end of file diff --git a/old/LocateText.py b/old/LocateText.py new file mode 100644 index 0000000..5008140 --- /dev/null +++ b/old/LocateText.py @@ -0,0 +1,78 @@ +#!/usr/bin/python +# vim: set ts=2 expandtab: +""" +Module: LocateText +Desc: +Author: John O'Neil +Email: oneil.john@gmail.com +DATE: Saturday, Sept 14th 2013 + + Setment raw manga scan and output image + with text areas outlined in red. + +""" +import connected_components as cc +import run_length_smoothing as rls +import clean_page as clean +import ocr +import segmentation as seg +import furigana +import arg +import defaults +from imageio import imwrite + +import numpy as np +import cv2 +import sys +import argparse +import os +import scipy.ndimage +import datetime + +if __name__ == '__main__': + + proc_start_time = datetime.datetime.now() + + parser = arg.parser + parser = argparse.ArgumentParser(description='Generate HTML annotation for raw manga scan with detected OCR\'d text.') + parser.add_argument('infile', help='Input (color) raw Manga scan image to annoate.') + parser.add_argument('-o','--output', dest='outfile', help='Output html file.') + parser.add_argument('-v','--verbose', help='Verbose operation. Print status messages during processing', action="store_true") + parser.add_argument('--display', help='Display output using OPENCV api and block program exit.', action="store_true") + parser.add_argument('--furigana', help='Attempt to suppress furigana characters which interfere with OCR.', action="store_true") + #parser.add_argument('-d','--debug', help='Overlay input image into output.', action="store_true") + parser.add_argument('--sigma', help='Std Dev of gaussian preprocesing filter.',type=float,default=None) + parser.add_argument('--binary_threshold', help='Binarization threshold value from 0 to 255.',type=int,default=defaults.BINARY_THRESHOLD) + #parser.add_argument('--segment_threshold', help='Threshold for nonzero pixels to separete vert/horiz text lines.',type=int,default=1) + parser.add_argument('--additional_filtering', help='Attempt to filter false text positives by histogram processing.', action="store_true") + arg.value = parser.parse_args() + + infile = arg.string_value('infile') + outfile = arg.string_value('outfile',default_value=infile + '.text_areas.png') + + if not os.path.isfile(infile): + print('Please provide a regular existing input file. Use -h option for help.') + sys.exit(-1) + img = cv2.imread(infile) + img_copy = img.copy() + gray = clean.grayscale(img) + + binary_threshold=arg.integer_value('binary_threshold',default_value=defaults.BINARY_THRESHOLD) + if arg.boolean_value('verbose'): + print('Binarizing with threshold value of ' + str(binary_threshold)) + inv_binary = cv2.bitwise_not(clean.binarize(gray, threshold=binary_threshold)) + binary = clean.binarize(gray, threshold=binary_threshold) + + segmented_image = seg.segment_image(gray) + segmented_image = segmented_image[:,:,2] + components = cc.get_connected_components(segmented_image) + cc.draw_bounding_boxes(img,components,color=(255,0,0),line_size=2) + + imwrite(outfile, img) + + if arg.boolean_value('display'): + cv2.imshow('segmented_image',segmented_image) + + if cv2.waitKey(0) == 27: + cv2.destroyAllWindows() + cv2.destroyAllWindows() diff --git a/MangaDetectText b/old/MangaDetectText old mode 100755 new mode 100644 similarity index 98% rename from MangaDetectText rename to old/MangaDetectText index 972d33d..8e8b3a3 --- a/MangaDetectText +++ b/old/MangaDetectText @@ -10,9 +10,8 @@ DATE: Saturday, August 25th 2013 Front to back end Manga text detection. Input is image file of raw manga image Output is HTML page annotating image with detected text. - + """ -#import clean_page as clean import connected_components as cc import run_length_smoothing as rls import clean_page as clean @@ -30,7 +29,6 @@ import os import scipy.ndimage import datetime - if __name__ == '__main__': proc_start_time = datetime.datetime.now() @@ -164,12 +162,12 @@ if __name__ == '__main__': # print str(blurb.confidence)+'% :'+ blurb.text #open(outfile, "w").write(render_to_string(template, c)) open(outfile, "w").write(t.render(c).encode("utf-8")) - - + + if arg.boolean_value('display'): cv2.imshow('img',img) #cv2.imwrite('segmented.png',img) - cv2.imshow('run_length_smoothed_or',run_length_smoothed_or) + #cv2.imshow('run_length_smoothed_or',run_length_smoothed_or) #cv2.imwrite('run_length_smoothed.png',run_length_smoothed_or) #cv2.imwrite('cleaned.png',cleaned) diff --git a/old/README.md b/old/README.md new file mode 100644 index 0000000..4d73649 --- /dev/null +++ b/old/README.md @@ -0,0 +1,148 @@ +MangaTextDetection +================== + +Experiments in text localization and detection in raw manga scans. Mostly using OpenCV python API. + + +Overview +-------- +This repository holds some experiments I did in summer 2013 during a sudden interest in text detection in images. It uses some standard techniques (run length smoothing, connected component analysis) and some experimental stuff. Overall, I was able to get in the neighborhood of where I wanted to be, but the results are very processing intensive and not terribly reliable. + +State +----- +I haven't bothered to form this into a python library. It's just a series of scripts each trying out various things, such as: +* Isolating bounding boxes for text areas on a raw manga page. +* Identifying ares of furigana text (pronunciation guide, which can screw up OCR) in text bounding boxes. +* Preparing identified text areas for basic OCR. + + +Text Location Example +--------------------- +Here's an example run of a page from Weekly Young Magazine #31 2013. The input image is as follows (jpg). +![Input image](https://github.com/johnoneil/MangaTextDetection/blob/master/test/194.jpg?raw=true) + +An initial estimate of text locations can be found by the 'LocateText.py' script: + +``` + ../LocateText.py '週刊ヤングマガジン31号194.jpg' -o 194_text_locations.png +``` + +With the results as follows (estimated text marked with red boxes): + +![locate text output](https://github.com/johnoneil/MangaTextDetection/blob/master/test/194_text_locations_thumb.png?raw=true) + +Note that in the output above you see several of the implementation deficiencies. For example, there are several small false positives scattered around, and some major false positives on the girl's sleeve and eyes in panels 2 and 3. +Also note that many large areas of text were not detected (false negatives). Despite how pleased I was with the results (and I was more pleased than you could possibly believe) significant improvements are needed. + +Text Segmentation Example +------------------------- +To more easily separate text from background you can also segment the image, with text areas and non text being separated into different (RGB) color channels. This easily allows you to remove estimated text from image entirely or vice-versa. +Use the command: +``` +./segmentation.py '週刊ヤングマガジン31号194.jpg' -o 194_segmentation.png +``` +The results follow: + +![Input image](https://github.com/johnoneil/MangaTextDetection/blob/master/test/194_segmentation_thumb.png?raw=true) + +OCR and Html Generation +----------------------- +I did take the time to run simple OCR on some of the located text regions, with mixed results. I used the python tesseract package (pytesser) but found the results were not generally good for vertical text, among other issues. +The script ocr.py should run ocr on detected text regions, and output the results to the command line. +``` +../ocr.py '週刊ヤングマガジン31号194.jpg' +Test blob assigned to no row on pass 2 +Test blob assigned to no row on pass 3 +0,0 1294x2020 71% :ぅん'・ 結局 +玉子かけご飯が +一 番ぉぃしぃと + +从 +胤 +赫 +囃 +包 +け +H」 +の +も +側 +鵬 + +はフィクショ穴ぁり、 登場する人物 + +※この物語 + +``` +You can see some fragmented positives, but in all the results for this page are abysmal. + +I also embedded those results in an HTML output, allowing "readers" to hover on Japanese Text, revealing the OCR output, which can be edited/copied/pasted. This is via the script MangaDetectText. A (more successful) example of this can be seen below: + +![locate text output](https://github.com/johnoneil/MangaTextDetection/blob/master/test/example.png?raw=true) + +Dependencies +----------------------- +You should be able to install most of the dependencies via pip, or you could use your operating systems package manager (e.g. Mac OS X http://brew.sh/) + +### Python 3+ + +https://www.python.org/ + +Install as per OS instructions. + +### Pip + +http://pip.readthedocs.org/en/latest/index.html + +Install as per OS instructions. + +### Numpy + +http://www.numpy.org/ + +``` +pip install numpy +``` + +### Scipy + +http://www.scipy.org/index.html + +``` +pip install scipy +``` + +### Matplotlib (contains PyLab) + +http://matplotlib.org/ + +``` +pip install matplotlib +``` + +### Pillow + +http://pillow.readthedocs.org/en/latest/ + +``` +pip install Pillow +``` + +### OpenCV + +http://opencv.org/ + +``` +Install as per OS instructions, this should also include the python bindings. +``` + +### Tesseract + +https://code.google.com/p/tesseract-ocr/ + +Install as per OS instructions, then use pip to install the python bindings. +Don't forget to include your target language's trained data sets. + +``` +pip install pytesseract +``` diff --git a/old/connected_component_test.py b/old/connected_component_test.py old mode 100755 new mode 100644 diff --git a/old/detect_text.py b/old/detect_text.py old mode 100755 new mode 100644 diff --git a/old/kmeans_test1.py b/old/kmeans_test1.py old mode 100755 new mode 100644 diff --git a/makefile b/old/makefile similarity index 100% rename from makefile rename to old/makefile diff --git a/old/ocr.py b/old/ocr.py new file mode 100644 index 0000000..8639a45 --- /dev/null +++ b/old/ocr.py @@ -0,0 +1,224 @@ +#!/usr/bin/python +# vim: set ts=2 expandtab: +""" +Module: ocr +Desc: +Author: John O'Neil +Email: oneil.john@gmail.com +DATE: Saturday, August 10th 2013 + Revision: Thursday, August 15th 2013 + + Run OCR on some text bounding boxes. + +""" + +import connected_components as cc +import run_length_smoothing as rls +import segmentation +import clean_page as clean +import arg +import defaults +import argparse + +import numpy as np +import cv2 +import sys +import os +import scipy.ndimage +from pylab import zeros,amax,median + +import pytesseract + +class Blurb(object): + def __init__(self, x, y, w, h, text, confidence=100.0): + self.x=x + self.y=y + self.w=w + self.h=h + self.text = text + self.confidence = confidence + +def draw_2d_slices(img,slices,color=(0,0,255),line_size=1): + for entry in slices: + vert=entry[0] + horiz=entry[1] + cv2.rectangle(img,(horiz.start,vert.start),(horiz.stop,vert.stop),color,line_size) + +def max_width_2d_slices(lines): + max_width = 0 + for line in lines: + width = line[1].stop - line[1].start + if width>max_width: + width = max_width + return max_width + +def estimate_furigana(lines): + max_width = max_width_2d_slices(lines) + furigana = [] + non_furigana = [] + for line in lines: + width = line[1].stop - line[1].start + if width < max_width*0.5: + furigana.append(line) + else: + non_furigana.append(line) + return (furigana, non_furigana) + +def segment_into_lines(img,component, min_segment_threshold=1): + (ys,xs)=component[:2] + w=xs.stop-xs.start + h=ys.stop-ys.start + x = xs.start + y = ys.start + aspect = float(w)/float(h) + + vertical = [] + start_col = xs.start + for col in range(xs.start,xs.stop): + count = np.count_nonzero(img[ys.start:ys.stop,col]) + if count<=min_segment_threshold or col==(xs.stop): + if start_col>=0: + vertical.append((slice(ys.start,ys.stop),slice(start_col,col))) + start_col=-1 + elif start_col < 0: + start_col=col + + #detect horizontal rows of non-zero pixels + horizontal=[] + start_row = ys.start + for row in range(ys.start,ys.stop): + count = np.count_nonzero(img[row,xs.start:xs.stop]) + if count<=min_segment_threshold or row==(ys.stop): + if start_row>=0: + horizontal.append((slice(start_row,row),slice(xs.start,xs.stop))) + start_row=-1 + elif start_row < 0: + start_row=row + + #we've now broken up the original bounding box into possible vertical + #and horizontal lines. + #We now wish to: + #1) Determine if the original bounding box contains text running V or H + #2) Eliminate all bounding boxes (don't return them in our output lists) that + # we can't explicitly say have some "regularity" in their line width/heights + #3) Eliminate all bounding boxes that can't be divided into v/h lines at all(???) + #also we will give possible vertical text runs preference as they're more common + #if len(vertical)<2 and len(horizontal)<2:continue + return (aspect, vertical, horizontal) + +def ocr_on_bounding_boxes(img, components): + + blurbs = [] + for component in components: + (aspect, vertical, horizontal) = segment_into_lines(img, component) + #if len(vertical)<2 and len(horizontal)<2:continue + + #attempt to separately process furigana + #(furigana, non_furigana) = estimate_furigana(vertical) + + ''' + from http://code.google.com/p/tesseract-ocr/wiki/ControlParams + Useful parameters for Japanese and Chinese + + Some Japanese tesseract user found these parameters helpful for increasing tesseract-ocr (3.02) accuracy for Japanese : + + Name Suggested value Description + chop_enable T Chop enable. + use_new_state_cost F Use new state cost heuristics for segmentation state evaluation + segment_segcost_rating F Incorporate segmentation cost in word rating? + enable_new_segsearch 0 Enable new segmentation search path. + language_model_ngram_on 0 Turn on/off the use of character ngram model. + textord_force_make_prop_words F Force proportional word segmentation on all rows. + ''' + #now run OCR on this bounding box + api = pytesseract.TessBaseAPI() + api.Init(".","jpn",pytesseract.OEM_DEFAULT) + #handle single column lines as "vertical align" and Auto segmentation otherwise + if len(vertical)<2: + api.SetPageSegMode(5)#pytesseract.PSM_VERTICAL_ALIGN)#PSM_AUTO)#PSM_SINGLECHAR)# + else: + api.SetPageSegMode(pytesseract.PSM_AUTO)#PSM_SINGLECHAR)# + api.SetVariable('chop_enable','T') + api.SetVariable('use_new_state_cost','F') + api.SetVariable('segment_segcost_rating','F') + api.SetVariable('enable_new_segsearch','0') + api.SetVariable('language_model_ngram_on','0') + api.SetVariable('textord_force_make_prop_words','F') + api.SetVariable('tessedit_char_blacklist', '}>0 and len(txt)>0: + blurb = Blurb(x, y, w, h, txt, confidence=conf) + blurbs.append(blurb) + + ''' + for line in non_furigana: + x=line[1].start + y=line[0].start + w=line[1].stop-x + h=line[0].stop-y + roi = cv2.cv.CreateImage((w,h), 8, 1) + sub = cv2.cv.GetSubRect(cv2.cv.fromarray(img), (x, y, w, h)) + cv2.cv.Copy(sub, roi) + pytesseract.SetCvImage(roi, api) + txt=api.GetUTF8Text() + conf=api.MeanTextConf() + if conf>0: + blurb = Blurb(x, y, w, h, txt, confidence=conf) + blurbs.append(blurb) + ''' + return blurbs + +def main(): + parser = arg.parser + parser = argparse.ArgumentParser(description='Basic OCR on raw manga scan.') + parser.add_argument('infile', help='Input (color) raw Manga scan image to clean.') + parser.add_argument('-o','--output', dest='outfile', help='Output (color) cleaned raw manga scan image.') + parser.add_argument('-v','--verbose', help='Verbose operation. Print status messages during processing', action="store_true") + #parser.add_argument('-d','--debug', help='Overlay input image into output.', action="store_true") + parser.add_argument('--sigma', help='Std Dev of gaussian preprocesing filter.',type=float,default=None) + parser.add_argument('--binary_threshold', help='Binarization threshold value from 0 to 255.',type=int,default=defaults.BINARY_THRESHOLD) + parser.add_argument('--furigana', help='Attempt to suppress furigana characters to improve OCR.', action="store_true") + parser.add_argument('--segment_threshold', help='Threshold for nonzero pixels to separete vert/horiz text lines.',type=int,default=defaults.SEGMENTATION_THRESHOLD) + + arg.value = parser.parse_args() + + infile = arg.string_value('infile') + outfile = arg.string_value('outfile', default_value=infile + '.html') + + if not os.path.isfile(infile): + print('Please provide a regular existing input file. Use -h option for help.') + sys.exit(-1) + + if arg.boolean_value('verbose'): + print('\tProcessing file ' + infile) + print('\tGenerating output ' + outfile) + + img = cv2.imread(infile) + gray = clean.grayscale(img) + binary = clean.binarize(gray) + + segmented = segmentation.segment_image_file(infile) + + components = cc.get_connected_components(segmented) + + #perhaps do more strict filtering of connected components because sections of characters + #will not be dripped from run length smoothed areas? Yes. Results quite good. + #filtered = cc.filter_by_size(img,components,average_size*100,average_size*1) + + blurbs = ocr_on_bounding_boxes(binary, components) + for blurb in blurbs: + print (str(blurb.x)+','+str(blurb.y)+' '+str(blurb.w)+'x'+str(blurb.h)+' '+ str(blurb.confidence)+'% :'+ blurb.text) + +if __name__ == '__main__': + main() diff --git a/old/ocr_on_bounding_boxes.py b/old/ocr_on_bounding_boxes.py old mode 100755 new mode 100644 diff --git a/run_length_smoothing.py b/run_length_smoothing.py old mode 100755 new mode 100644 index cb093c3..b60825d --- a/run_length_smoothing.py +++ b/run_length_smoothing.py @@ -10,7 +10,7 @@ Experiment to use run length smoothing techniques to detect vertical or horizontal runs of characters in cleaned manga pages. - + """ import numpy as np diff --git a/segment_by_ar.py b/segment_by_ar.py old mode 100755 new mode 100644 index a65ca5a..403e2b1 --- a/segment_by_ar.py +++ b/segment_by_ar.py @@ -6,7 +6,7 @@ Author: John O'Neil Email: oneil.john@gmail.com DATE: Sunday, June 22nd 2014 - + """ import argparse @@ -108,7 +108,6 @@ def binarize(image, threshold=180): binary[high_values] = 255 return binary - def contains(cc_a, cc_b): w = width_bb(cc_a) dw = w/5 @@ -166,7 +165,5 @@ def main(): plt.show() - if __name__ == '__main__': main() - diff --git a/segmentation.py b/segmentation.py old mode 100755 new mode 100644 index f1e8922..8002523 --- a/segmentation.py +++ b/segmentation.py @@ -10,7 +10,7 @@ Input a manga raw scan image. Output a single image with text areas blocked in color. - + """ import numpy as np @@ -100,7 +100,7 @@ def segment_image(img, max_scale=defaults.CC_SCALE_MAX, min_scale=defaults.CC_SC cleaned = cv2.bitwise_not(cleaned)*furigana_mask cleaned = cv2.bitwise_not(cleaned) text_only = cleaned2segmented(cleaned, average_size) - + (text_like_areas, nontext_like_areas) = filter_text_like_areas(img, segmentation=text_only, average_size=average_size) if arg.boolean_value('verbose'): print('**********there are ' + str(len(text_like_areas)) + ' text like areas total.') @@ -147,7 +147,7 @@ def filter_text_like_areas(img, segmentation, average_size): #First step is to estimate furigana like elements so they can be masked furigana_areas = furigana.estimate_furigana(img, segmentation) furigana_mask = np.array(furigana_areas==0,'B') - + #binarize the image, clean it via the segmentation and remove furigana too binary_threshold = arg.integer_value('binary_threshold',default_value=defaults.BINARY_THRESHOLD) if arg.boolean_value('verbose'): @@ -299,7 +299,6 @@ def slicing_list_stats(slicings): mean = np.mean(widths) variance = np.std(widths) return (mean, variance) - def area_is_text_like(img, area, average_size): #use basic 'ladder' building technique to see if area features somewhat @@ -428,7 +427,7 @@ def main(): parser.add_argument('--additional_filtering', help='Attempt to filter false text positives by histogram processing.', action="store_true") arg.value = parser.parse_args() - + infile = arg.string_value('infile') outfile = arg.string_value('outfile', default_value=infile + '.segmented.png') binary_outfile = infile + '.binary.png' @@ -447,7 +446,7 @@ def main(): #cv2.imwrite(outfile,segmented) #if binary is not None: # cv2.imwrite(binary_outfile, binary) - + if arg.boolean_value('display'): cv2.imshow('Segmented', segmented) #cv2.imshow('Cleaned',cleaned) diff --git a/test/annotorious.css b/test/annotorious.css deleted file mode 100644 index 9a455e3..0000000 --- a/test/annotorious.css +++ /dev/null @@ -1,271 +0,0 @@ -/** Global item styles **/ - -.annotorious-opacity-fade { - -moz-transition-property: opacity; - -moz-transition-duration: 0.5s; - -moz-transition-delay: 0s; - -webkit-transition-property: opacity; - -webkit-transition-duration: 0.5s; - -webkit-transition-delay: 0s; - -o-transition-property: opacity; - -o-transition-duration: 0.5s; - -o-transition-delay: 0s; - transition-property: opacity; - transition-duration: 0.5s; - transition-delay: 0s; -} - -.annotorious-item-focus { - opacity:1.0; -} - -.annotorious-item-unfocus { - opacity:0.4; -} - -/** Hint/help popup **/ - -.annotorious-hint-msg { - background-color:rgba(0,0,0,0.5); - margin:4px; - padding:8px 15px 8px 30px; - font-family: 'lucida grande',tahoma,verdana,arial,sans-serif; - line-height: normal; - font-size:12px; - color:#fff; - border-radius:4px; - -moz-border-radius:4px; - -webkit-border-radius:4px; - -khtml-border-radius:4px; -} - -.annotorious-hint-icon { - position:absolute; - top:6px; - left: 5px; - background:url('feather_icon.png'); - background-repeat:no-repeat; - width:19px; - height:22px; - margin:2px 4px 0px 6px; -} - -/** Popup **/ - -.annotorious-popup { - line-height:135%; - font-family:Arial, Verdana, Sans; - font-size:12px; - color:#000; - background-color:#fff; - border:1px solid #ccc; - padding:9px 8px; - word-wrap:break-word; - width:180px; - border-radius: 3px; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - -khtml-border-radius: 3px; - -moz-box-shadow:0px 5px 15px #111; - -webkit-box-shadow:0px 5px 15px #111; - box-shadow:0px 5px 15px #111; - - -moz-transition-property: opacity; - -moz-transition-duration: 0.5s; - -moz-transition-delay: 0s; - -webkit-transition-property: opacity; - -webkit-transition-duration: 0.5s; - -webkit-transition-delay: 0s; - -o-transition-property: opacity; - -o-transition-duration: 0.5s; - -o-transition-delay: 0s; - transition-property: opacity; - transition-duration: 0.5s; - transition-delay: 0s; -} - -.annotorious-popup-empty { - color:#999; - font-style:italic; -} - -.annotorious-popup-buttons { - float:right; - margin:0px 0px 1px 10px; - height:16px; - - -moz-transition-property: opacity; - -moz-transition-duration: 1s; - -moz-transition-delay: 0s; - -webkit-transition-property: opacity; - -webkit-transition-duration: 1s; - -webkit-transition-delay: 0s; - -o-transition-property: opacity; - -o-transition-duration: 1s; - -o-transition-delay: 0s; - transition-property: opacity; - transition-duration: 1s; - transition-delay: 0s; -} - -.annotorious-popup-button { - font-size:10px; - text-decoration:none; - display:inline-block; - color:#000; - font-weight:bold; - margin-left:5px; - opacity:0.4; - - -moz-transition-property: opacity; - -moz-transition-duration: 0.5s; - -moz-transition-delay: 0s; - -webkit-transition-property: opacity; - -webkit-transition-duration: 0.5s; - -webkit-transition-delay: 0s; - -o-transition-property: opacity; - -o-transition-duration: 0.5s; - -o-transition-delay: 0s; - transition-property: opacity; - transition-duration: 0.5s; - transition-delay: 0s; -} - -.annotorious-popup-button:hover { - background-color:transparent; -} - -.annotorious-popup-button-active { - opacity:0.9; -} - -.annotorious-popup-button-edit { - background:url(pencil.png); - width:16px; - height:16px; - text-indent:100px; - overflow:hidden; -} - -.annotorious-popup-button-delete { - background:url(delete.png); - width:16px; - height:16px; - text-indent:100px; - overflow:hidden; - float:right; -} - -.annotorious-popup-field { - border-top:1px solid #ccc; - margin:6px 0px 0px 0px; - padding-top:2px; -} - -/** Editor **/ - -.annotorious-editor { - line-height: normal; - padding:0px 0px 2px 0px; - background-color:#f2f2f2; - color:#000; - opacity:0.97; - border:1px solid #ccc; - border-radius: 3px; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - -khtml-border-radius: 3px; - -moz-box-shadow:0px 5px 15px #111; - -webkit-box-shadow:0px 5px 15px #111; - box-shadow:0px 5px 15px #111; -} - -.annotorious-editor-text { - border-width:0px 0px 1px 0px; - border-style:solid; - border-color:#ccc; - line-height: normal; - background-color:#fff; - width:240px; - height:50px; - outline:none; - font-family:Verdana, Arial; - font-size:11px; - padding:4px; - margin:0px; - color:#000; - text-shadow:none; - overflow-y:auto; - display:block; -} - -.annotorious-editor-button-container { - padding-top:2px; -} - -.annotorious-editor-button { - float:right; - line-height: normal; - display:inline-block; - text-align:center; - text-decoration:none; - font-family:Verdana, Arial; - font-size:10px; - border:1px solid #777; - color:#ddd; - padding:3px 8px; - margin:1px 2px 0px 1px; - cursor:pointer; - cursor:hand; - background:-webkit-gradient(linear, left top, left bottom, from(#888), to(#555)); - background:-moz-linear-gradient(top, #888, #555); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#888888', endColorstr='#555555'); - -moz-border-radius:2px; - -webkit-border-radius:2px; - -khtml-border-radius:2px; - border-radius:2px; -} - -.annotorious-editor-button:hover { - background:#999; -} - -.annotorious-editor-field { - border-bottom:1px solid #ccc; - margin:0px; - background-color:#fff; - padding:3px; - font-family:Verdana, Arial; - font-size:12px; -} - -/** OpenLayers module **/ -.annotorious-ol-boxmarker-outer { - border:1px solid #000; -} - -.annotorious-ol-boxmarker-inner { - border:1px solid #fff; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - -ms-box-sizing: border-box; - box-sizing: border-box; -} - -.annotorious-ol-hint { - line-height: normal; - font-family:Arial, Verdana, Sans; - font-size:16px; - color:#000; - background-color:#fff; - margin:0px; - padding:9px; - border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - -khtml-border-radius: 5px; -} - -.annotorious-ol-hint-secondary { - background-color:#fff000; -} diff --git a/test/annotorious.min.js b/test/annotorious.min.js deleted file mode 100644 index c622c13..0000000 --- a/test/annotorious.min.js +++ /dev/null @@ -1,240 +0,0 @@ -function g(a){throw a;}var i=void 0,j=!0,m=null,n=!1;function aa(){return function(){}}function q(a){return function(){return this[a]}}function ba(a){return function(){return a}}var r,s=this;function ca(a,b){var c=a.split("."),d=s;!(c[0]in d)&&d.execScript&&d.execScript("var "+c[0]);for(var f;c.length&&(f=c.shift());)!c.length&&da(b)?d[f]=b:d=d[f]?d[f]:d[f]={}}function ea(){}function fa(a){a.ob=function(){return a.ld?a.ld:a.ld=new a}} -function ga(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function da(a){return a!==i}function ha(a){return"array"==ga(a)}function ia(a){var b=ga(a);return"array"==b||"object"==b&&"number"==typeof a.length}function t(a){return"string"==typeof a}function u(a){return"function"==ga(a)}function ja(a){var b=typeof a;return"object"==b&&a!=m||"function"==b}function ka(a){return a[la]||(a[la]=++ma)}var la="closure_uid_"+Math.floor(2147483648*Math.random()).toString(36),ma=0; -function na(a,b,c){return a.call.apply(a.bind,arguments)}function oa(a,b,c){a||g(Error());if(2")&&(a=a.replace(xa,">"));-1!=a.indexOf('"')&&(a=a.replace(ya,"""));return a}var va=/&/g,wa=//g,ya=/\"/g,ua=/[&<>\"]/;function za(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};var z=Array.prototype,Aa=z.indexOf?function(a,b,c){return z.indexOf.call(a,b,c)}:function(a,b,c){c=c==m?0:0>c?Math.max(0,a.length+c):c;if(t(a))return!t(b)||1!=b.length?-1:a.indexOf(b,c);for(;cc?m:t(a)?a.charAt(c):a[c]}function Fa(a,b){return 0<=Aa(a,b)}function C(a,b){var c=Aa(a,b);0<=c&&z.splice.call(a,c,1)}function Ga(a){var b=a.length;if(0=arguments.length?z.slice.call(a,b):z.slice.call(a,b,c)}function Ja(a,b){return a>b?1:aparseFloat(Wa)){Va=String($a);break a}}Va=Wa}var bb={}; -function I(a){var b;if(!(b=bb[a])){b=0;for(var c=sa(String(Va)).split("."),d=sa(String(a)).split("."),f=Math.max(c.length,d.length),e=0;0==b&&e(0==y[1].length?0:parseInt(y[1],10))?1:0)||((0==w[2].length)< -(0==y[2].length)?-1:(0==w[2].length)>(0==y[2].length)?1:0)||(w[2]y[2]?1:0)}while(0==b)}b=bb[a]=0<=b}return b}var cb={};function db(a){return cb[a]||(cb[a]=F&&!!document.documentMode&&document.documentMode>=a)};var eb,fb=!F||db(9);!G&&!F||F&&db(9)||G&&I("1.9.1");F&&I("9");var gb=F||D||H;function hb(a){a=a.className;return t(a)&&a.match(/\S+/g)||[]}function ib(a,b){var c=hb(a),d=Ia(arguments,1),f=c.length+d.length;jb(c,d);a.className=c.join(" ");return c.length==f}function kb(a,b){var c=hb(a),d=Ia(arguments,1),f=lb(c,d);a.className=f.join(" ");return f.length==c.length-d.length}function jb(a,b){for(var c=0;c");e=e.join("")}e=f.createElement(e);if(h)if(t(h))e.className=h;else if(ha(h))ib.apply(m,[e].concat(h));else{var k=e;ob(h,function(a,b){"style"==b?k.style.cssText=a:"class"==b?k.className=a:"for"==b?k.htmlFor=a:b in tb?k.setAttribute(tb[b],a):0==b.lastIndexOf("aria-",0)||0== -b.lastIndexOf("data-",0)?k.setAttribute(b,a):k[b]=a})}2a):n}function sb(a){this.I=a||s.document||document}r=sb.prototype;r.Yc=rb;r.c=function(a){return t(a)?this.I.getElementById(a):a};r.createElement=function(a){return this.I.createElement(a)};r.createTextNode=function(a){return this.I.createTextNode(a)}; -function Cb(a){var b=a.I,a=!H?b.documentElement:b.body,b=b.parentWindow||b.defaultView;return new J(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}r.appendChild=function(a,b){a.appendChild(b)};r.append=function(a,b){vb(K(a),a,arguments,1)};r.contains=Ab;var Db;Db=ba(j);/* - Portions of this code are from the Dojo Toolkit, received by - The Closure Library Authors under the BSD license. All other code is - Copyright 2005-2009 The Closure Library Authors. All Rights Reserved. - -The "New" BSD License: - -Copyright (c) 2005-2009, The Dojo Foundation -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - Neither the name of the Dojo Foundation nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -function Eb(a,b){var c=b||[];a&&c.push(a);return c}var Fb=H&&"BackCompat"==document.compatMode,Gb=document.firstChild.children?"children":"childNodes",Hb=n; -function Ib(a){function b(){0<=p&&(x.id=c(p,A).replace(/\\/g,""),p=-1);if(0<=w){var a=w==A?m:c(w,A);0>">~+".indexOf(a)?x.D=a:x.Lb=a;w=-1}0<=k&&(x.W.push(c(k+1,A).replace(/\\/g,"")),k=-1)}function c(b,c){return sa(a.slice(b,c))}for(var a=0<=">~+".indexOf(a.slice(-1))?a+" * ":a+" ",d=[],f=-1,e=-1,h=-1,l=-1,k=-1,p=-1,w=-1,y="",E="",Q,A=0,Fe=a.length,x=m,L=m;y=E,E=a.charAt(A),Af?f=f%d&&d+f%d:0=d&&(e=f-f%d),f%=d):0>d&&(d*=-1,0=e&&(0>h||a<=h)&&a%d==f};b=f}var l=parseInt(b,10);return function(a){return Tb(a)== -l}}},Yb=F?function(a){var b=a.toLowerCase();"class"==b&&(a="className");return function(c){return Hb?c.getAttribute(a):c[a]||c[b]}}:function(a){return function(b){return b&&b.getAttribute&&b.hasAttribute(a)}}; -function Wb(a,b){if(!a)return Db;var b=b||{},c=m;b.A||(c=Jb(c,Kb));b.D||"*"!=a.D&&(c=Jb(c,function(b){return b&&b.tagName==a.kc()}));b.W||B(a.W,function(a,b){var e=RegExp("(?:^|\\s)"+a+"(?:\\s|$)");c=Jb(c,function(a){return e.test(a.className)});c.count=b});b.ua||B(a.ua,function(a){var b=a.name;Xb[b]&&(c=Jb(c,Xb[b](b,a.value)))});b.xb||B(a.xb,function(a){var b,e=a.gc;a.type&&Mb[a.type]?b=Mb[a.type](e,a.rc):e.length&&(b=Yb(e));b&&(c=Jb(c,b))});b.id||a.id&&(c=Jb(c,function(b){return!!b&&b.id==a.id})); -c||"default"in b||(c=Db);return c}var Zb={}; -function $b(a){var b=Zb[a.Oa];if(b)return b;var c=a.jd,c=c?c.Lb:"",d=Wb(a,{A:1}),f="*"==a.D,e=document.getElementsByClassName;if(c)if(e={A:1},f&&(e.D=1),d=Wb(a,e),"+"==c)var h=d,b=function(a,b,c){for(;a=a[Ob];)if(!Nb||Kb(a)){(!c||ac(a,c))&&h(a)&&b.push(a);break}return b};else if("~"==c)var l=d,b=function(a,b,c){for(a=a[Ob];a;){if(Qb(a)){if(c&&!ac(a,c))break;l(a)&&b.push(a)}a=a[Ob]}return b};else{if(">"==c)var k=d,k=k||Db,b=function(a,b,c){for(var d=0,f=a[Gb];a=f[d++];)Qb(a)&&((!c||ac(a,c))&&k(a,d))&& -b.push(a);return b}}else if(a.id)d=!a.od&&f?Db:Wb(a,{A:1,id:1}),b=function(b,c){var f=rb(b).c(a.id),e;if(e=f&&d(f))if(!(e=9==b.nodeType)){for(e=f.parentNode;e&&e!=b;)e=e.parentNode;e=!!e}if(e)return Eb(f,c)};else if(e&&/\{\s*\[native code\]\s*\}/.test(String(e))&&a.W.length&&!Fb)var d=Wb(a,{A:1,W:1,id:1}),p=a.W.join(" "),b=function(a,b){for(var c=Eb(0,b),f,e=0,h=a.getElementsByClassName(p);f=h[e++];)d(f,a)&&c.push(f);return c};else!f&&!a.od?b=function(b,c){for(var d=Eb(0,c),f,e=0,h=b.getElementsByTagName(a.kc());f= -h[e++];)d.push(f);return d}:(d=Wb(a,{A:1,D:1,id:1}),b=function(b,c){for(var f=Eb(0,c),e,h=0,k=b.getElementsByTagName(a.kc());e=k[h++];)d(e,b)&&f.push(e);return f});return Zb[a.Oa]=b}var bc={},cc={};function dc(a){var b=Ib(sa(a));if(1==b.length){var c=$b(b[0]);return function(a){if(a=c(a,[]))a.Kb=j;return a}}return function(a){for(var a=Eb(a),c,e,h=b.length,l,k,p=0;p~+".indexOf(c)&&(!F||-1==a.indexOf(":"))&&!(Fb&&0<=a.indexOf("."))&&-1==a.indexOf(":contains")&&-1==a.indexOf("|=")){var f=0<=">~+".indexOf(a.charAt(a.length-1))?a+" *":a;return cc[a]=function(b){try{9==b.nodeType||d||g("");var c=b.querySelectorAll(f);F?c.Ed=j:c.Kb=j;return c}catch(e){return fc(a,j)(b)}}}var e=a.split(/\s*,\s*/);return bc[a]= -2>e.length?dc(a):function(a){for(var b=0,c=[],d;d=e[b++];)c=c.concat(dc(d)(a));return c}}var gc=0,hc=F?function(a){return Hb?a.getAttribute("_uid")||a.setAttribute("_uid",++gc)||gc:a.uniqueID}:function(a){return a._uid||(a._uid=++gc)};function ac(a,b){if(!b)return 1;var c=hc(a);return!b[c]?b[c]=1:0} -function ic(a){if(a&&a.Kb)return a;var b=[];if(!a||!a.length)return b;a[0]&&b.push(a[0]);if(2>a.length)return b;gc++;if(F&&Hb){var c=gc+"";a[0].setAttribute("_zipIdx",c);for(var d=1,f;f=a[d];d++)a[d].getAttribute("_zipIdx")!=c&&b.push(f),f.setAttribute("_zipIdx",c)}else if(F&&a.Ed)try{for(d=1;f=a[d];d++)Kb(f)&&b.push(f)}catch(e){}else{a[0]&&(a[0]._zipIdx=gc);for(d=1;f=a[d];d++)a[d]._zipIdx!=gc&&b.push(f),f._zipIdx=gc}return b} -function M(a,b){if(!a)return[];if(a.constructor==Array)return a;if(!t(a))return[a];if(t(b)&&(b=t(b)?document.getElementById(b):b,!b))return[];var b=b||document,c=b.ownerDocument||b.documentElement;Hb=b.contentType&&"application/xml"==b.contentType||D&&(b.doctype||"[object XMLDocument]"==c.toString())||!!c&&(F?c.xml:b.xmlVersion||c.xmlVersion);return(c=fc(a)(b))&&c.Kb?c:ic(c)}M.ua=Xb;ca("goog.dom.query",M);ca("goog.dom.query.pseudos",M.ua);var jc=!F||db(9),kc=!F||db(9),lc=F&&!I("9");!H||I("528");G&&I("1.9b")||F&&I("8")||D&&I("9.5")||H&&I("528");G&&!I("8")||F&&I("9");function mc(){0!=nc&&(this.ee=Error().stack,ka(this))}var nc=0;mc.prototype.Tc=n;function oc(a,b){this.type=a;this.currentTarget=this.target=b}r=oc.prototype;r.ta=n;r.defaultPrevented=n;r.Nb=j;r.stopPropagation=function(){this.ta=j};r.preventDefault=function(){this.defaultPrevented=j;this.Nb=n};function pc(a){a.preventDefault()};function qc(a){qc[" "](a);return a}qc[" "]=ea;function rc(a,b){a&&this.init(a,b)}v(rc,oc);var sc=[1,4,2];r=rc.prototype;r.target=m;r.relatedTarget=m;r.offsetX=0;r.offsetY=0;r.clientX=0;r.clientY=0;r.screenX=0;r.screenY=0;r.button=0;r.keyCode=0;r.charCode=0;r.ctrlKey=n;r.altKey=n;r.shiftKey=n;r.metaKey=n;r.vc=n;r.n=m; -r.init=function(a,b){var c=this.type=a.type;oc.call(this,c);this.target=a.target||a.srcElement;this.currentTarget=b;var d=a.relatedTarget;if(d){if(G){var f;a:{try{qc(d.nodeName);f=j;break a}catch(e){}f=n}f||(d=m)}}else"mouseover"==c?d=a.fromElement:"mouseout"==c&&(d=a.toElement);this.relatedTarget=d;this.offsetX=H||a.offsetX!==i?a.offsetX:a.layerX;this.offsetY=H||a.offsetY!==i?a.offsetY:a.layerY;this.clientX=a.clientX!==i?a.clientX:a.pageX;this.clientY=a.clientY!==i?a.clientY:a.pageY;this.screenX= -a.screenX||0;this.screenY=a.screenY||0;this.button=a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.vc=Oa?a.metaKey:a.ctrlKey;this.state=a.state;this.n=a;a.defaultPrevented&&this.preventDefault();delete this.ta};function tc(a){return(jc?0==a.n.button:"click"==a.type?j:!!(a.n.button&sc[0]))&&!(H&&Oa&&a.ctrlKey)} -r.stopPropagation=function(){rc.G.stopPropagation.call(this);this.n.stopPropagation?this.n.stopPropagation():this.n.cancelBubble=j};r.preventDefault=function(){rc.G.preventDefault.call(this);var a=this.n;if(a.preventDefault)a.preventDefault();else if(a.returnValue=n,lc)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};r.Fd=q("n");function uc(){}var vc=0;r=uc.prototype;r.key=0;r.va=n;r.Oc=n;r.init=function(a,b,c,d,f,e){u(a)?this.nd=j:a&&a.handleEvent&&u(a.handleEvent)?this.nd=n:g(Error("Invalid listener argument"));this.Na=a;this.sd=b;this.src=c;this.type=d;this.capture=!!f;this.Ja=e;this.Oc=n;this.key=++vc;this.va=n};r.handleEvent=function(a){return this.nd?this.Na.call(this.Ja||this.src,a):this.Na.handleEvent.call(this.Na,a)};var wc={},N={},xc={},yc={}; -function O(a,b,c,d,f){if(b){if(ha(b)){for(var e=0;ee.keyCode||e.returnValue!=i)return j;a:{var p=n;if(0==e.keyCode)try{e.keyCode=-1;break a}catch(w){p=j}if(p||e.returnValue==i)e.returnValue=j}}p=new rc;p.init(e,this);e=j;try{if(l){for(var y=[],E=p.currentTarget;E;E=E.parentNode)y.push(E);h=f[j];h.K=h.m;for(var Q= -y.length-1;!p.ta&&0<=Q&&h.K;Q--)p.currentTarget=y[Q],e&=Dc(h,y[Q],d,j,p);if(k){h=f[n];h.K=h.m;for(Q=0;!p.ta&&Q=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom};function Kc(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}Kc.prototype.contains=function(a){return a instanceof Kc?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height};function S(a,b,c){t(b)?Lc(a,c,b):ob(b,qa(Lc,a))}function Lc(a,b,c){a.style[za(c)]=b}function T(a,b){var c=K(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,m))?c[b]||c.getPropertyValue(b)||"":""}function Mc(a,b){return a.currentStyle?a.currentStyle[b]:m}function Nc(a,b){return T(a,b)||Mc(a,b)||a.style&&a.style[b]}function Oc(a,b,c){var d,f=G&&(Oa||Ua)&&I("1.9");b instanceof J?(d=b.x,b=b.y):(d=b,b=c);a.style.left=Pc(d,f);a.style.top=Pc(b,f)} -function Qc(a){var b=a.getBoundingClientRect();F&&(a=a.ownerDocument,b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+a.body.clientTop);return b} -function Rc(a){if(F&&!db(8))return a.offsetParent;for(var b=K(a),c=Nc(a,"position"),d="fixed"==c||"absolute"==c,a=a.parentNode;a&&a!=b;a=a.parentNode)if(c=Nc(a,"position"),d=d&&"static"==c&&a!=b.documentElement&&a!=b.body,!d&&(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight||"fixed"==c||"absolute"==c||"relative"==c))return a;return m} -function Sc(a){var b,c=K(a),d=Nc(a,"position"),f=G&&c.getBoxObjectFor&&!a.getBoundingClientRect&&"absolute"==d&&(b=c.getBoxObjectFor(a))&&(0>b.screenX||0>b.screenY),e=new J(0,0),h;b=c?K(c):document;if(h=F)if(h=!db(9))rb(b),h=n;h=h?b.body:b.documentElement;if(a==h)return e;if(a.getBoundingClientRect)b=Qc(a),a=Cb(rb(c)),e.x=b.left+a.x,e.y=b.top+a.y;else if(c.getBoxObjectFor&&!f)b=c.getBoxObjectFor(a),a=c.getBoxObjectFor(h),e.x=b.screenX-a.screenX,e.y=b.screenY-a.screenY;else{f=a;do{e.x+=f.offsetLeft; -e.y+=f.offsetTop;f!=a&&(e.x+=f.clientLeft||0,e.y+=f.clientTop||0);if(H&&"fixed"==Nc(f,"position")){e.x+=c.body.scrollLeft;e.y+=c.body.scrollTop;break}f=f.offsetParent}while(f&&f!=a);if(D||H&&"absolute"==d)e.y-=c.body.offsetTop;for(f=a;(f=Rc(f))&&f!=c.body&&f!=h;)if(e.x-=f.scrollLeft,!D||"TR"!=f.tagName)e.y-=f.scrollTop}return e}function Tc(a,b){var c=Uc(a),d=Uc(b);return new J(c.x-d.x,c.y-d.y)} -function Uc(a){var b=new J;if(1==a.nodeType){if(a.getBoundingClientRect){var c=Qc(a);b.x=c.left;b.y=c.top}else{var c=Cb(rb(a)),d=Sc(a);b.x=d.x-c.x;b.y=d.y-c.y}if(G&&!I(12)){var f;F?f="-ms-transform":H?f="-webkit-transform":D?f="-o-transform":G&&(f="-moz-transform");var e;f&&(e=Nc(a,f));e||(e=Nc(a,"transform"));e?(a=e.match(Vc),a=!a?new J(0,0):new J(parseFloat(a[1]),parseFloat(a[2]))):a=new J(0,0);b=new J(b.x+a.x,b.y+a.y)}}else f=u(a.Fd),e=a,a.targetTouches?e=a.targetTouches[0]:f&&a.n.targetTouches&& -(e=a.n.targetTouches[0]),b.x=e.clientX,b.y=e.clientY;return b}function Wc(a,b,c){b instanceof nb?(c=b.height,b=b.width):c==i&&g(Error("missing height argument"));a.style.width=Pc(b,j);a.style.height=Pc(c,j)}function Pc(a,b){"number"==typeof a&&(a=(b?Math.round(a):a)+"px");return a} -function Xc(a){if("none"!=Nc(a,"display"))return Yc(a);var b=a.style,c=b.display,d=b.visibility,f=b.position;b.visibility="hidden";b.position="absolute";b.display="inline";a=Yc(a);b.display=c;b.position=f;b.visibility=d;return a}function Yc(a){var b=a.offsetWidth,c=a.offsetHeight,d=H&&!b&&!c;return(!da(b)||d)&&a.getBoundingClientRect?(a=Qc(a),new nb(a.right-a.left,a.bottom-a.top)):new nb(b,c)}function Zc(a){var b=Sc(a),a=Xc(a);return new Kc(b.x,b.y,a.width,a.height)} -function U(a,b){var c=a.style;"opacity"in c?c.opacity=b:"MozOpacity"in c?c.MozOpacity=b:"filter"in c&&(c.filter=""===b?"":"alpha(opacity="+100*b+")")}function V(a,b){a.style.display=b?"":"none"}function $c(a){return"rtl"==Nc(a,"direction")}var ad=G?"MozUserSelect":H?"WebkitUserSelect":m; -function bd(a,b){if(/^\d+px?$/.test(b))return parseInt(b,10);var c=a.style.left,d=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=b;var f=a.style.pixelLeft;a.style.left=c;a.runtimeStyle.left=d;return f} -function cd(a,b){if(F){var c=bd(a,Mc(a,b+"Left")),d=bd(a,Mc(a,b+"Right")),f=bd(a,Mc(a,b+"Top")),e=bd(a,Mc(a,b+"Bottom"));return new Jc(f,d,e,c)}c=T(a,b+"Left");d=T(a,b+"Right");f=T(a,b+"Top");e=T(a,b+"Bottom");return new Jc(parseFloat(f),parseFloat(d),parseFloat(e),parseFloat(c))}var dd={thin:2,medium:4,thick:6};function ed(a,b){if("none"==Mc(a,b+"Style"))return 0;var c=Mc(a,b+"Width");return c in dd?dd[c]:bd(a,c)} -function fd(a){if(F){var b=ed(a,"borderLeft"),c=ed(a,"borderRight"),d=ed(a,"borderTop"),a=ed(a,"borderBottom");return new Jc(d,c,a,b)}b=T(a,"borderLeftWidth");c=T(a,"borderRightWidth");d=T(a,"borderTopWidth");a=T(a,"borderBottomWidth");return new Jc(parseFloat(d),parseFloat(c),parseFloat(a),parseFloat(b))}var Vc=/matrix\([0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, ([0-9\.\-]+)p?x?, ([0-9\.\-]+)p?x?\)/;function gd(a,b,c){mc.call(this);this.target=a;this.handle=b||a;this.pc=c||new Kc(NaN,NaN,NaN,NaN);this.I=K(a);this.fa=new Fc(this);O(this.handle,["touchstart","mousedown"],this.Yd,n,this)}v(gd,Ic);var hd=F||G&&I("1.9.3");r=gd.prototype;r.clientX=0;r.clientY=0;r.screenX=0;r.screenY=0;r.wd=0;r.xd=0;r.Ea=0;r.Fa=0;r.Vc=j;r.pa=n;r.hd=0;r.Pd=0;r.Md=n;r.Bc=n;r.Bb=q("fa");function id(a){da(a.ka)||(a.ka=$c(a.target));return a.ka} -r.Yd=function(a){var b="mousedown"==a.type;if(this.Vc&&!this.pa&&(!b||tc(a))){jd(a);if(0==this.hd)if(this.dispatchEvent(new kd("start",this,a.clientX,a.clientY,a)))this.pa=j,a.preventDefault();else return;else a.preventDefault();var b=this.I,c=b.documentElement,d=!hd;R(this.fa,b,["touchmove","mousemove"],this.Kd,d);R(this.fa,b,["touchend","mouseup"],this.zb,d);hd?(c.setCapture(n),R(this.fa,c,"losecapture",this.zb)):R(this.fa,b?b.parentWindow||b.defaultView:window,"blur",this.zb);F&&this.Md&&R(this.fa, -b,"dragstart",pc);this.Vd&&R(this.fa,this.Vd,"scroll",this.Sd,d);this.clientX=this.wd=a.clientX;this.clientY=this.xd=a.clientY;this.screenX=a.screenX;this.screenY=a.screenY;this.Bc?(a=this.target,b=a.offsetLeft,c=a.offsetParent,!c&&"fixed"==Nc(a,"position")&&(c=K(a).documentElement),c?(G?(d=fd(c),b+=d.left):db(8)&&(d=fd(c),b-=d.left),a=$c(c)?c.clientWidth-(b+a.offsetWidth):b):a=b):a=this.target.offsetLeft;this.Ea=a;this.Fa=this.target.offsetTop;this.tc=Cb(rb(this.I));this.Pd=ra()}else this.dispatchEvent("earlycancel")}; -r.zb=function(a,b){this.fa.Mb();hd&&this.I.releaseCapture();if(this.pa){jd(a);this.pa=n;var c=ld(this,this.Ea),d=md(this,this.Fa);this.dispatchEvent(new kd("end",this,a.clientX,a.clientY,a,c,d,b||"touchcancel"==a.type))}else this.dispatchEvent("earlycancel");("touchend"==a.type||"touchcancel"==a.type)&&a.preventDefault()}; -function jd(a){var b=a.type;"touchstart"==b||"touchmove"==b?a.init(a.n.targetTouches[0],a.currentTarget):("touchend"==b||"touchcancel"==b)&&a.init(a.n.changedTouches[0],a.currentTarget)} -r.Kd=function(a){if(this.Vc){jd(a);var b=(this.Bc&&id(this)?-1:1)*(a.clientX-this.clientX),c=a.clientY-this.clientY;this.clientX=a.clientX;this.clientY=a.clientY;this.screenX=a.screenX;this.screenY=a.screenY;if(!this.pa){var d=this.wd-this.clientX,f=this.xd-this.clientY;if(d*d+f*f>this.hd)if(this.dispatchEvent(new kd("start",this,a.clientX,a.clientY,a)))this.pa=j;else{this.Tc||this.zb(a);return}}c=nd(this,b,c);b=c.x;c=c.y;this.pa&&this.dispatchEvent(new kd("beforedrag",this,a.clientX,a.clientY,a, -b,c))&&(od(this,a,b,c),a.preventDefault())}};function nd(a,b,c){var d=Cb(rb(a.I)),b=b+(d.x-a.tc.x),c=c+(d.y-a.tc.y);a.tc=d;a.Ea+=b;a.Fa+=c;b=ld(a,a.Ea);a=md(a,a.Fa);return new J(b,a)}r.Sd=function(a){var b=nd(this,0,0);a.clientX=this.clientX;a.clientY=this.clientY;od(this,a,b.x,b.y)};function od(a,b,c,d){a.Sc(c,d);a.dispatchEvent(new kd("drag",a,b.clientX,b.clientY,b,c,d))} -function ld(a,b){var c=a.pc,d=!isNaN(c.left)?c.left:m,c=!isNaN(c.width)?c.width:0;return Math.min(d!=m?d+c:Infinity,Math.max(d!=m?d:-Infinity,b))}function md(a,b){var c=a.pc,d=!isNaN(c.top)?c.top:m,c=!isNaN(c.height)?c.height:0;return Math.min(d!=m?d+c:Infinity,Math.max(d!=m?d:-Infinity,b))}r.Sc=function(a,b){this.Bc&&id(this)?this.target.style.right=a+"px":this.target.style.left=a+"px";this.target.style.top=b+"px"}; -function kd(a,b,c,d,f,e,h,l){oc.call(this,a);this.clientX=c;this.clientY=d;this.ce=f;this.left=da(e)?e:b.Ea;this.top=da(h)?h:b.Fa;this.ge=b;this.fe=!!l}v(kd,oc);function pd(a){for(var b=0,c=0;a&&!isNaN(a.offsetLeft)&&!isNaN(a.offsetTop);)b+=a.offsetLeft-a.scrollLeft,c+=a.offsetTop-a.scrollTop,a=a.offsetParent;return{top:c,left:b}};function qd(){this.Va=[]}qd.prototype.k=function(a,b){this.Va[a]||(this.Va[a]=[]);this.Va[a].push(b)};qd.prototype.Pa=function(a,b){var c=this.Va[a];c&&C(c,b)};qd.prototype.fireEvent=function(a,b){var c=n,d=this.Va[a];d&&B(d,function(a){a=a(b);da(a)&&!a&&(c=j)});return c};function rd(a,b){this.S={};this.h=[];var c=arguments.length;if(12*this.m&&sd(this),j):n};function sd(a){if(a.m!=a.h.length){for(var b=0,c=0;bwd(a)?-1:1)*b,h=e.x-c.x,k=e.y-c.y,p=0l?-1:0,l=Math.sqrt(Math.pow(l,2)/(1+Math.pow(h/k,2)));d.push({x:e.x+Math.abs(h/k*l)*(0h?-1:0)*p,y:e.y+Math.abs(l)*(0k?-1:0)*p})}return d};function yd(a,b,c,d){0c&&(c=a[e].x),a[e].xf&&(f=a[e].y),a[e].ywd(c)?-1:1;if(4>c.length)c=xd(c,d*b);else{for(var f=c.length-1,e=1,h=[],l=0;lc.length-1&&(e=0);c=h}return new zd("polygon",new vd(c))} -function Dd(a,b){if("rect"==a.type){var c=a.geometry,d=b({x:c.x,y:c.y}),c=b({x:c.x+c.width,y:c.y+c.height});return new zd("rect",new yd(d.x,d.y,c.x-d.x,c.y-d.y))}if("polygon"==a.type){var f=[];B(a.geometry.points,function(a){f.push(b(a))});return new zd("polygon",new vd(f))}}function Ed(a){return JSON.stringify(a.geometry)}window.annotorious||(window.annotorious={});window.annotorious.geometry||(window.annotorious.geometry={},window.annotorious.geometry.expand=Cd);function Fd(a,b,c){this.src=a;this.text=b;this.shapes=[c];this.context=document.URL};function Gd(){}function Hd(a,b){a.f=new rd;a.Ec=[];a.Za=[];a.Ba=[];a.ya=[];a.Tb=[];a.rb={La:n,Ka:n};a.Sa=new rd;a.Lc=b}function Id(a,b){var c=a.Sa(b);c||(c={La:n,Ka:n},c.set(b,c));return c} -function Jd(a,b){var c=a.jc(b);if(!a.f.get(c)){var d=a.rd(b),f=[],e=[];B(a.Ec,function(a){d.k(a.type,a.Ja)});B(a.Za,function(a){if(a.onInitAnnotator)a.onInitAnnotator(d)});B(a.ya,function(a){a.src==c&&(d.z(a),f.push(a))});B(a.Tb,function(a){a.src==c&&(d.w(a),e.push(a))});B(f,function(b){C(a.ya,b)});B(e,function(b){C(a.Tb,b)});var h=a.Sa.get(c);h?(h.La&&d.O(),h.Ka&&d.Y(),a.Sa.remove(c)):(a.rb.La&&d.O(),a.rb.Ka&&d.Y());a.f.set(c,d);C(a.Ba,b)}} -function Kd(a){var b,c;for(c=a.Ba.length;0window.pageYOffset&&e+h>window.pageXOffset)&&Jd(a,b)}}function Ld(a,b,c){if(b){var d=a.f.get(b);d?c?d.wa():d.Y():Id(a,b).Ka=c}else B(W(a.f),function(a){c?a.wa():a.Y()}),a.rb.Ka=c,B(W(a.Sa),function(a){a.Ka=c})} -function Md(a,b,c){if(b){var d=a.f.get(b);d?c?d.$():d.O():Id(a,b).La=c}else B(W(a.f),function(a){c?a.$():a.O()}),a.rb.La=c,B(W(a.Sa),function(a){a.La=c})}r=Gd.prototype;r.ea=function(a,b){var c=i,d=i;t(a)?(c=a,d=b):u(a)&&(d=a);c?(c=this.f.get(c))&&c.ea(d):B(W(this.f),function(a){a.ea(d)})};r.z=function(a,b){if(Nd(this,a.src)){var c=this.f.get(a.src);c?c.z(a,b):(this.ya.push(a),b&&C(this.ya,b))}};r.k=function(a,b){B(W(this.f),function(c){c.k(a,b)});this.Ec.push({type:a,Ja:b})}; -r.wb=function(a){this.Za.push(a);B(W(this.f),function(b){if(a.onInitAnnotator)a.onInitAnnotator(b)})};function Nd(a,b){return td(a.f.S,b)?j:Ea(a.Ba,function(c){return a.jc(c)==b})!=m}r.R=function(a){a?(a=this.f.get(a))&&a.R():(B(W(this.f),function(a){a.R()}),this.f.clear())};r.qa=function(a){if(Nd(this,a)&&(a=this.f.get(a)))return a.qa().getName()}; -r.J=function(a){if(a){var b=this.f.get(a);return b?b.J():Ba(this.ya,function(b){return b.src==a})}var c=[];B(W(this.f),function(a){Ha(c,a.J())});Ha(c,this.ya);return c};r.ra=function(a){if(Nd(this,a)&&(a=this.f.get(a)))return Ca(a.ra(),function(a){return a.getName()})};r.Y=function(a){Ld(this,a,n)};r.O=function(a){Md(this,a,n)};r.o=function(a){if(a){if(Nd(this,a.src)){var b=this.f.get(a.src);b&&b.o(a)}}else B(W(this.f),function(a){a.o()})}; -r.init=function(){this.Lc&&Ha(this.Ba,this.Lc());Kd(this);var a=this,b=O(window,"scroll",function(){0",ae:"&",je:"\u00a0",le:'"',be:"'"},Td={a:0,abbr:0,acronym:0,address:0,applet:16,area:2,b:0,base:18,basefont:18,bdo:0,big:0,blockquote:0,body:49,br:2,button:0,caption:0,center:0,cite:0,code:0,col:2,colgroup:1,dd:1,del:0,dfn:0,dir:0,div:0,dl:0,dt:1,em:0,fieldset:0,font:0,form:0,frame:18,frameset:16,h1:0,h2:0,h3:0,h4:0,h5:0,h6:0,head:49,hr:2,html:49,i:0,iframe:20,img:2,input:2,ins:0,isindex:18,kbd:0,label:0,legend:0,li:1,link:18,map:0,menu:0,meta:18,noframes:20,noscript:20,object:16, -ol:0,optgroup:0,option:1,p:1,param:18,pre:0,q:0,s:0,samp:0,script:20,select:0,small:0,span:0,strike:0,strong:0,style:20,sub:0,sup:0,table:0,tbody:1,td:1,textarea:8,tfoot:1,th:1,thead:1,title:24,tr:1,tt:0,u:0,ul:0,"var":0},Ud=/&/g,Vd=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,Wd=//g,Yd=/\"/g,Zd=/=/g,$d=/\0/g,ae=/&(#\d+|#x[0-9A-Fa-f]+|\w+);/g,be=/^#(\d+)$/,ce=/^#x([0-9A-Fa-f]+)$/,de=RegExp("^\\s*(?:(?:([a-z][a-z-]*)(\\s*=\\s*(\"[^\"]*\"|'[^']*'|(?=[a-z][a-z-]*\\s*=)|[^>\"'\\s]*))?)|(/?>)|[^a-z\\s>]+)", -"i"),ee=RegExp("^(?:&(\\#[0-9]+|\\#[x][0-9a-f]+|\\w+);|<[!]--[\\s\\S]*?--\>|]*>|<\\?[^>*]*>|<(/)?([a-z][a-z0-9]*)|([^<&>]+)|([<&>]))","i"); -Rd.prototype.parse=function(a,b){var c=m,d=n,f=[],e,h,l;a.M=[];for(a.ha=n;b;){var k=b.match(d?de:ee),b=b.substring(k[0].length);if(d)if(k[1]){var p=k[1].toLowerCase();if(k[2]){k=k[3];switch(k.charCodeAt(0)){case 34:case 39:k=k.substring(1,k.length-1)}k=k.replace($d,"").replace(ae,pa(this.Nd,this))}else k=p;f.push(p,k)}else k[4]&&(h!==i&&(l?a.vd&&a.vd(e,f):a.Wc&&a.Wc(e)),l&&h&12&&(c=c===m?b.toLowerCase():c.substring(c.length-b.length),d=c.indexOf("d&&(d=b.length),h&4?a.Pc&&a.Pc(b.substring(0, -d)):a.ud&&a.ud(b.substring(0,d).replace(Vd,"&$1").replace(Wd,"<").replace(Xd,">")),b=b.substring(d)),e=h=l=i,f.length=0,d=n);else if(k[1])fe(a,k[0]);else if(k[3])l=!k[2],d=j,e=k[3].toLowerCase(),h=Td.hasOwnProperty(e)?Td[e]:i;else if(k[4])fe(a,k[4]);else if(k[5])switch(k[5]){case "<":fe(a,"<");break;case ">":fe(a,">");break;default:fe(a,"&")}}for(c=a.M.length;0<=--c;)a.aa.append("");a.M.length=0}; -Rd.prototype.Nd=function(a){a=a.toLowerCase();if(Sd.hasOwnProperty(a))return Sd[a];var b=a.match(be);return b?String.fromCharCode(parseInt(b[1],10)):(b=a.match(ce))?String.fromCharCode(parseInt(b[1],16)):""};function ge(){};/* - Portions of this code are from the google-caja project, received by - Google under the Apache license (http://code.google.com/p/google-caja/). - All other code is Copyright 2009 Google, Inc. All Rights Reserved. - -// Copyright (C) 2006 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -*/ -function he(a,b,c){this.aa=a;this.M=[];this.ha=n;this.zd=b;this.Jb=c}v(he,ge); -var ie={"*::class":9,"*::dir":0,"*::id":4,"*::lang":0,"*::onclick":2,"*::ondblclick":2,"*::onkeydown":2,"*::onkeypress":2,"*::onkeyup":2,"*::onload":2,"*::onmousedown":2,"*::onmousemove":2,"*::onmouseout":2,"*::onmouseover":2,"*::onmouseup":2,"*::style":3,"*::title":0,"*::accesskey":0,"*::tabindex":0,"*::onfocus":2,"*::onblur":2,"a::coords":0,"a::href":1,"a::hreflang":0,"a::name":7,"a::onblur":2,"a::rel":0,"a::rev":0,"a::shape":0,"a::target":10,"a::type":0,"area::accesskey":0,"area::alt":0,"area::coords":0, -"area::href":1,"area::nohref":0,"area::onfocus":2,"area::shape":0,"area::tabindex":0,"area::target":10,"bdo::dir":0,"blockquote::cite":1,"br::clear":0,"button::accesskey":0,"button::disabled":0,"button::name":8,"button::onblur":2,"button::onfocus":2,"button::tabindex":0,"button::type":0,"button::value":0,"caption::align":0,"col::align":0,"col::char":0,"col::charoff":0,"col::span":0,"col::valign":0,"col::width":0,"colgroup::align":0,"colgroup::char":0,"colgroup::charoff":0,"colgroup::span":0,"colgroup::valign":0, -"colgroup::width":0,"del::cite":1,"del::datetime":0,"dir::compact":0,"div::align":0,"dl::compact":0,"font::color":0,"font::face":0,"font::size":0,"form::accept":0,"form::action":1,"form::autocomplete":0,"form::enctype":0,"form::method":0,"form::name":7,"form::onreset":2,"form::onsubmit":2,"form::target":10,"h1::align":0,"h2::align":0,"h3::align":0,"h4::align":0,"h5::align":0,"h6::align":0,"hr::align":0,"hr::noshade":0,"hr::size":0,"hr::width":0,"img::align":0,"img::alt":0,"img::border":0,"img::height":0, -"img::hspace":0,"img::ismap":0,"img::longdesc":1,"img::name":7,"img::src":1,"img::usemap":11,"img::vspace":0,"img::width":0,"input::accept":0,"input::accesskey":0,"input::autocomplete":0,"input::align":0,"input::alt":0,"input::checked":0,"input::disabled":0,"input::ismap":0,"input::maxlength":0,"input::name":8,"input::onblur":2,"input::onchange":2,"input::onfocus":2,"input::onselect":2,"input::readonly":0,"input::size":0,"input::src":1,"input::tabindex":0,"input::type":0,"input::usemap":11,"input::value":0, -"ins::cite":1,"ins::datetime":0,"label::accesskey":0,"label::for":5,"label::onblur":2,"label::onfocus":2,"legend::accesskey":0,"legend::align":0,"li::type":0,"li::value":0,"map::name":7,"menu::compact":0,"ol::compact":0,"ol::start":0,"ol::type":0,"optgroup::disabled":0,"optgroup::label":0,"option::disabled":0,"option::label":0,"option::selected":0,"option::value":0,"p::align":0,"pre::width":0,"q::cite":1,"select::disabled":0,"select::multiple":0,"select::name":8,"select::onblur":2,"select::onchange":2, -"select::onfocus":2,"select::size":0,"select::tabindex":0,"table::align":0,"table::bgcolor":0,"table::border":0,"table::cellpadding":0,"table::cellspacing":0,"table::frame":0,"table::rules":0,"table::summary":0,"table::width":0,"tbody::align":0,"tbody::char":0,"tbody::charoff":0,"tbody::valign":0,"td::abbr":0,"td::align":0,"td::axis":0,"td::bgcolor":0,"td::char":0,"td::charoff":0,"td::colspan":0,"td::headers":6,"td::height":0,"td::nowrap":0,"td::rowspan":0,"td::scope":0,"td::valign":0,"td::width":0, -"textarea::accesskey":0,"textarea::cols":0,"textarea::disabled":0,"textarea::name":8,"textarea::onblur":2,"textarea::onchange":2,"textarea::onfocus":2,"textarea::onselect":2,"textarea::readonly":0,"textarea::rows":0,"textarea::tabindex":0,"tfoot::align":0,"tfoot::char":0,"tfoot::charoff":0,"tfoot::valign":0,"th::abbr":0,"th::align":0,"th::axis":0,"th::bgcolor":0,"th::char":0,"th::charoff":0,"th::colspan":0,"th::headers":6,"th::height":0,"th::nowrap":0,"th::rowspan":0,"th::scope":0,"th::valign":0, -"th::width":0,"thead::align":0,"thead::char":0,"thead::charoff":0,"thead::valign":0,"tr::align":0,"tr::bgcolor":0,"tr::char":0,"tr::charoff":0,"tr::valign":0,"ul::compact":0,"ul::type":0}; -he.prototype.vd=function(a,b){if(!this.ha&&Td.hasOwnProperty(a)){var c=Td[a];if(!(c&32))if(c&16)this.ha=!(c&2);else{for(var d=b,f=0;f")}}}}; -he.prototype.Wc=function(a){if(this.ha)this.ha=n;else if(Td.hasOwnProperty(a)){var b=Td[a];if(!(b&50)){if(b&1)for(b=this.M.length;0<=--b;){var c=this.M[b];if(c===a)break;if(!(Td[c]&1))return}else for(b=this.M.length;0<=--b&&this.M[b]!==a;);if(!(0>b)){for(var d=this.M.length;--d>b;)c=this.M[d],Td[c]&1||this.aa.append("");this.M.length=b;this.aa.append("")}}}};function fe(a,b){a.ha||a.aa.append(b)}he.prototype.ud=function(a){this.ha||this.aa.append(a)}; -he.prototype.Pc=function(a){this.ha||this.aa.append(a)};function je(a,b,c,d,f){if(!F&&(!H||!I("525")))return j;if(Oa&&f)return ke(a);if(f&&!d||!c&&(17==b||18==b)||F&&d&&b==a)return n;switch(a){case 13:return!(F&&db(9));case 27:return!H}return ke(a)}function ke(a){if(48<=a&&57>=a||96<=a&&106>=a||65<=a&&90>=a||H&&0==a)return j;switch(a){case 32:case 63:case 107:case 109:case 110:case 111:case 186:case 59:case 189:case 187:case 61:case 188:case 190:case 191:case 192:case 222:case 219:case 220:case 221:return j;default:return n}} -function le(a){switch(a){case 61:return 187;case 59:return 186;case 224:return 91;case 0:return 224;default:return a}};function me(a,b){mc.call(this);a&&ne(this,a,b)}v(me,Ic);r=me.prototype;r.B=m;r.Eb=m;r.nc=m;r.Fb=m;r.ja=-1;r.ia=-1;r.fc=n; -var oe={3:13,12:144,63232:38,63233:40,63234:37,63235:39,63236:112,63237:113,63238:114,63239:115,63240:116,63241:117,63242:118,63243:119,63244:120,63245:121,63246:122,63247:123,63248:44,63272:46,63273:36,63275:35,63276:33,63277:34,63289:144,63302:45},pe={Up:38,Down:40,Left:37,Right:39,Enter:13,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,"U+007F":46,Home:36,End:35,PageUp:33,PageDown:34,Insert:45},qe=F||H&&I("525"),re=Oa&&G;r=me.prototype; -r.Hd=function(a){if(H&&(17==this.ja&&!a.ctrlKey||18==this.ja&&!a.altKey))this.ia=this.ja=-1;qe&&!je(a.keyCode,this.ja,a.shiftKey,a.ctrlKey,a.altKey)?this.handleEvent(a):(this.ia=G?le(a.keyCode):a.keyCode,re&&(this.fc=a.altKey))};r.Jd=function(a){this.ia=this.ja=-1;this.fc=a.altKey}; -r.handleEvent=function(a){var b=a.n,c,d,f=b.altKey;F&&"keypress"==a.type?(c=this.ia,d=13!=c&&27!=c?b.keyCode:0):H&&"keypress"==a.type?(c=this.ia,d=0<=b.charCode&&63232>b.charCode&&ke(c)?b.charCode:0):D?(c=this.ia,d=ke(c)?b.keyCode:0):(c=b.keyCode||this.ia,d=b.charCode||0,re&&(f=this.fc),Oa&&(63==d&&224==c)&&(c=191));var e=c,h=b.keyIdentifier;c?63232<=c&&c in oe?e=oe[c]:25==c&&a.shiftKey&&(e=9):h&&h in pe&&(e=pe[h]);a=e==this.ja;this.ja=e;b=new se(e,d,a,b);b.altKey=f;this.dispatchEvent(b)};r.c=q("B"); -function ne(a,b,c){a.Fb&&a.detach();a.B=b;a.Eb=O(a.B,"keypress",a,c);a.nc=O(a.B,"keydown",a.Hd,c,a);a.Fb=O(a.B,"keyup",a.Jd,c,a)}r.detach=function(){this.Eb&&(P(this.Eb),P(this.nc),P(this.Fb),this.Fb=this.nc=this.Eb=m);this.B=m;this.ia=this.ja=-1};function se(a,b,c,d){d&&this.init(d,i);this.type="key";this.keyCode=a;this.charCode=b;this.repeat=c}v(se,rc);function te(){}fa(te);te.prototype.Rd=0;te.ob();function ue(a){mc.call(this);this.ib=a||rb();this.ka=ve}v(ue,Ic);ue.prototype.Ld=te.ob();var ve=m;function we(a,b){switch(a){case 1:return b?"disable":"enable";case 2:return b?"highlight":"unhighlight";case 4:return b?"activate":"deactivate";case 8:return b?"select":"unselect";case 16:return b?"check":"uncheck";case 32:return b?"focus":"blur";case 64:return b?"open":"close"}g(Error("Invalid component state"))}r=ue.prototype;r.Db=m;r.Z=n;r.B=m;r.ka=m;r.sa=m;r.fb=m;r.Da=m;r.$d=n;r.c=q("B"); -r.Bb=function(){return this.lc||(this.lc=new Fc(this))};r.zc=function(a){this.sa&&this.sa!=a&&g(Error("Method not supported"));ue.G.zc.call(this,a)};r.Yc=q("ib");r.hb=function(a){this.Z&&g(Error("Component already rendered"));if(a&&this.eb(a)){this.$d=j;if(!this.ib||this.ib.I!=K(a))this.ib=rb(a);this.Rc(a);this.Ga()}else g(Error("Invalid element to decorate"))};r.eb=ba(j);r.Rc=function(a){this.B=a};r.Ga=function(){function a(a){!a.Z&&a.c()&&a.Ga()}this.Z=j;this.fb&&B(this.fb,a,i)}; -r.Ab=function(){function a(a){a.Z&&a.Ab()}this.fb&&B(this.fb,a,i);this.lc&&this.lc.Mb();this.Z=n};r.mb=q("B");r.Qa=function(a){this.Z&&g(Error("Component already rendered"));this.ka=a}; -r.removeChild=function(a,b){if(a){var c=t(a)?a:a.Db||(a.Db=":"+(a.Ld.Rd++).toString(36)),d;this.Da&&c?(d=this.Da,d=(c in d?d[c]:i)||m):d=m;a=d;c&&a&&(d=this.Da,c in d&&delete d[c],C(this.fb,a),b&&(a.Ab(),a.B&&xb(a.B)),c=a,c==m&&g(Error("Unable to set parent component")),c.sa=m,ue.G.zc.call(c,m))}a||g(Error("Child is not in parent component"));return a};function xe(){}var ye;fa(xe);r=xe.prototype;r.mb=function(a){return a};r.jb=function(a,b,c){if(a=a.c?a.c():a)if(F&&!I("7")){var d=ze(hb(a),b);d.push(b);qa(c?ib:kb,a).apply(m,d)}else c?ib(a,b):kb(a,b)};r.eb=ba(j); -r.hb=function(a,b){if(b.id){var c=b.id;if(a.sa&&a.sa.Da){var d=a.sa.Da,f=a.Db;f in d&&delete d[f];d=a.sa.Da;c in d&&g(Error('The object already contains the key "'+c+'"'));d[c]=a}a.Db=c}(c=this.mb(b))&&c.firstChild?(c=c.firstChild.nextSibling?Ga(c.childNodes):c.firstChild,a.gb=c):a.gb=m;var e=0,h=this.nb(),l=this.nb(),k=n,p=n,c=n,d=hb(b);B(d,function(a){if(!k&&a==h)k=j,l==h&&(p=j);else if(!p&&a==l)p=j;else{var b=e;if(!this.yd){this.yb||Ae(this);var c=this.yb,d={},f;for(f in c)d[c[f]]=f;this.yd=d}a= -parseInt(this.yd[a],10);e=b|(isNaN(a)?0:a)}},this);a.r=e;k||(d.push(h),l==h&&(p=j));p||d.push(l);(f=a.X)&&d.push.apply(d,f);if(F&&!I("7")){var w=ze(d);0c;b.style.borderWidth="10px";a.wc=b.scrollHeight>d;b.style.height="100px";100!=b.offsetHeight&&(a.Ib=j);xb(b);a.gd=j}var b=a.c(),c=a.c().scrollHeight,f=a.c(),d=f.offsetHeight-f.clientHeight;if(!a.xc)var e=a.pb,d=d-(e.top+e.bottom); -a.wc||(f=fd(f),d-=f.top+f.bottom);c+=0k?(Re(this,k),b.style.overflowY="",f=j):h!=e?Re(this,e):this.ga||(this.ga=e);!d&&(!f&&Me)&&(a=j)}else Se(this);this.Ma=n;a&&(a=this.c(),this.Ma||(this.Ma=j,b=n,a.value||(a.value=" ",b=j),(f=a.scrollHeight)?(e=Qe(this),d=Oe(this),h=Pe(this),!(d&&e<=d)&&!(h&&e>=h)&&(h=this.pb,a.style.paddingBottom=h.bottom+1+"px",Qe(this)== -e&&(a.style.paddingBottom=h.bottom+f+"px",a.scrollTop=0,f=Qe(this)-f,f>=d?Re(this,f):Re(this,d)),a.style.paddingBottom=h.bottom+"px")):Se(this),b&&(a.value=""),this.Ma=n));c!=this.ga&&this.dispatchEvent("resize")}};r.Qd=function(){var a=this.c(),b=a.offsetHeight;a.filters&&a.filters.length&&(a=a.filters.item("DXImageTransform.Microsoft.DropShadow"))&&(b-=a.offX);b!=this.ga&&(this.ga=this.pd=b)};F&&I(8);function Te(a){return"object"===typeof a&&a&&0===a.de?a.content:String(a).replace(Ue,Ve)}var We={"\x00":"�",'"':""","&":"&","'":"'","<":"<",">":">","\t":" ","\n":" ","\x0B":" ","\f":" ","\r":" "," ":" ","-":"-","/":"/","=":"=","`":"`","\u0085":"…","\u00a0":" ","\u2028":"
","\u2029":"
"};function Ve(a){return We[a]}var Ue=/[\x00\x22\x26\x27\x3c\x3e]/g;function Xe(){return''} -function Ye(){return''};function Ze(a){function b(){var a=d.Ca;a.c()&&a.Ia()}this.element=Od(Ye);this.d=a;this.Cd=a.getItem();this.Ca=new Le("");this.Ad=M(".annotorious-editor-button-cancel",this.element)[0];this.Dc=M(".annotorious-editor-button-save",this.element)[0];var c;c=this.Dc;gb?c=c.parentElement:(c=c.parentNode,c=zb(c)?c:m);this.Bd=c;this.Ua=[];var d=this;O(this.Ad,"click",function(b){b.preventDefault();a.stopSelection(d.Jc);d.close()});O(this.Dc,"click",function(b){b.preventDefault();b=d.Xc();a.z(b);a.stopSelection(); -d.Jc?a.fireEvent("onAnnotationUpdated",b):a.fireEvent("onAnnotationCreated",b);d.close()});V(this.element,n);a.element.appendChild(this.element);this.Ca.hb(M(".annotorious-editor-text",this.element)[0]);var f=this.element;c=document.createElement("div");S(c,"position","absolute");S(c,"top","0px");S(c,"right","0px");S(c,"width","5px");S(c,"height","100%");S(c,"cursor","e-resize");f.appendChild(c);var e=fd(f),e=Zc(f).width-e.right-e.left;c=new gd(c);c.pc=new Kc(e,0,800,0)||new Kc(NaN,NaN,NaN,NaN);c.Sc= -function(a){S(f,"width",a+"px");b&&b()}}r=Ze.prototype;r.dc=function(a){var b=ub("div","annotorious-editor-field");t(a)?b.innerHTML=a:u(a)?this.Ua.push({A:b,ic:a}):zb(a)&&b.appendChild(a);a=this.Bd;a.parentNode&&a.parentNode.insertBefore(b,a)};r.open=function(a){(this.sb=this.Jc=a)&&this.Ca.la(String(a.text));V(this.element,j);this.Ca.c().focus();B(this.Ua,function(b){var c=b.ic(a);t(c)?b.A.innerHTML=c:zb(c)&&(wb(b.A),b.A.appendChild(c))})};r.close=function(){V(this.element,n);this.Ca.la("")}; -r.setPosition=function(a){Oc(this.element,a.x,a.y)};r.Xc=function(){var a;a=this.Ca.c().value;var b=new Qd;(new Rd).parse(new he(b,function(a){return a},i),a);a=b.toString();this.sb?this.sb.text=a:this.sb=new Fd(this.Cd.src,a,this.d.qa().getShape());return this.sb};Ze.prototype.addField=Ze.prototype.dc;Ze.prototype.getAnnotation=Ze.prototype.Xc;function $e(a,b,c){var d=this;c||(c="Click and Drag to Annotate");this.element=Od(af,{sc:c});this.d=a;this.Gc=M(".annotorious-hint-msg",this.element)[0];this.Fc=M(".annotorious-hint-icon",this.element)[0];this.bc=function(){d.show()};this.ac=function(){bf(d)};this.Rb();bf(this);b.appendChild(this.element)} -$e.prototype.Rb=function(){var a=this;this.Ic=O(this.Fc,"mouseover",function(){a.show();window.clearTimeout(a.Xb)});this.Hc=O(this.Fc,"mouseout",function(){bf(a)});this.d.k("onMouseOverItem",this.bc);this.d.k("onMouseOutOfItem",this.ac)};$e.prototype.tb=function(){P(this.Ic);P(this.Hc);this.d.Pa("onMouseOverItem",this.bc);this.d.Pa("onMouseOutOfItem",this.ac)};$e.prototype.show=function(){window.clearTimeout(this.Xb);U(this.Gc,0.8);var a=this;this.Xb=window.setTimeout(function(){bf(a)},3E3)}; -function bf(a){window.clearTimeout(a.Xb);U(a.Gc,0)}$e.prototype.R=function(){this.tb();delete this.Ic;delete this.Hc;delete this.bc;delete this.ac;xb(this.element)};function cf(a){this.element=Od(Xe);this.d=a;this.Dd=M(".annotorious-popup-text",this.element)[0];this.N=M(".annotorious-popup-buttons",this.element)[0];this.Vb=n;this.Ua=[];var b=M(".annotorious-popup-button-edit",this.N)[0],c=M(".annotorious-popup-button-delete",this.N)[0],d=this;O(b,"mouseover",function(){ib(b,"annotorious-popup-button-active")});O(b,"mouseout",function(){kb(b,"annotorious-popup-button-active")});O(b,"click",function(){U(d.element,0);S(d.element,"pointer-events","none");a.Uc(d.e)}); -O(c,"mouseover",function(){ib(c,"annotorious-popup-button-active")});O(c,"mouseout",function(){kb(c,"annotorious-popup-button-active")});O(c,"click",function(){a.fireEvent("beforeAnnotationRemoved",d.e)||(U(d.element,0),S(d.element,"pointer-events","none"),a.w(d.e),a.fireEvent("onAnnotationRemoved",d.e))});df&&(O(this.element,"mouseover",function(){window.clearTimeout(d.Ub);0.9>(d.N.style[za("opacity")]||"")&&U(d.N,0.9);d.clearHideTimer()}),O(this.element,"mouseout",function(){U(d.N,0);d.startHideTimer()}), -a.k("onMouseOutOfItem",function(){d.startHideTimer()}));U(this.N,0);U(this.element,0);S(this.element,"pointer-events","none");a.element.appendChild(this.element)}r=cf.prototype;r.dc=function(a){var b=ub("div","annotorious-popup-field");t(a)?b.innerHTML=a:u(a)?this.Ua.push({A:b,ic:a}):zb(a)&&b.appendChild(a);this.element.appendChild(b)}; -r.startHideTimer=function(){this.Vb=n;if(!this.$a){var a=this;this.$a=window.setTimeout(function(){a.d.fireEvent("beforePopupHide",a);a.Vb||(U(a.element,0),S(a.element,"pointer-events","none"),U(a.N,0.9),delete a.$a)},150)}};r.clearHideTimer=function(){this.Vb=j;this.$a&&(window.clearTimeout(this.$a),delete this.$a)}; -r.show=function(a,b){this.clearHideTimer();b&&this.setPosition(b);a&&this.setAnnotation(a);this.Ub&&window.clearTimeout(this.Ub);U(this.N,0.9);if(df){var c=this;this.Ub=window.setTimeout(function(){U(c.N,0)},1E3)}U(this.element,0.9);S(this.element,"pointer-events","auto")};r.setPosition=function(a){Oc(this.element,new J(a.x,a.y))}; -r.setAnnotation=function(a){this.e=a;this.Dd.innerHTML=a.text?a.text.replace(/\n/g,"
"):'No comment';"editable"in a&&a.editable==n?V(this.N,n):V(this.N,j);B(this.Ua,function(b){var c=b.ic(a);t(c)?b.A.innerHTML=c:zb(c)&&(wb(b.A),b.A.appendChild(c))})};cf.prototype.addField=cf.prototype.dc;function ef(a,b){this.T=a;this.d=b;this.xa=[];this.V=[];this.F=this.T.getContext("2d");this.ma=j;this.ub=n;var c=this;O(this.T,ff,function(a){if(c.ma){var b=gf(c,a.offsetX,a.offsetY);b?(c.ub=c.ub&&b==c.e,c.e?c.e!=b&&(c.ma=n,c.d.popup.startHideTimer()):(c.e=b,hf(c),c.d.fireEvent("onMouseOverAnnotation",{na:c.e,mouseEvent:a}))):!c.ub&&c.e&&(c.ma=n,c.d.popup.startHideTimer())}else c.Ta=a});b.k("onMouseOutOfItem",function(){delete c.e;c.ma=j});b.k("beforePopupHide",function(){if(!c.ma&&c.Ta){var a=c.e; -c.e=gf(c,c.Ta.offsetX,c.Ta.offsetY);c.ma=j;a!=c.e?(hf(c),c.d.fireEvent("onMouseOutOfAnnotation",{na:a,mouseEvent:c.Ta}),c.d.fireEvent("onMouseOverAnnotation",{na:c.e,mouseEvent:c.Ta})):c.e&&c.d.popup.clearHideTimer()}else hf(c)})}r=ef.prototype;r.z=function(a,b){b&&(b==this.e&&delete this.e,C(this.xa,b),delete this.V[Ed(b.shapes[0])]);this.xa.push(a);var c=a.shapes[0];if("pixel"!=c.units)var d=this,c=Dd(c,function(a){return d.d.kb(a)});this.V[Ed(a.shapes[0])]=c;hf(this)}; -r.w=function(a){a==this.e&&delete this.e;C(this.xa,a);delete this.V[Ed(a.shapes[0])];hf(this)};r.J=function(){return Ga(this.xa)};r.o=function(a){(this.e=a)?this.ub=j:this.d.popup.startHideTimer();hf(this);this.ma=j};function gf(a,b,c){a=a.lb(b,c);if(0e.geometry.x+e.geometry.width||b>e.geometry.y+e.geometry.height?n:j;else if("polygon"==e.type){e=e.geometry.points;for(var h=n,l=e.length-1,k=0;kb!=e[l].y>b&&a<(e[l].x-e[k].x)*(b-e[k].y)/(e[l].y-e[k].y)+e[k].x&&(h=!h),l=k;e=h}else e=n;e&&c.push(f)});z.sort.call(c,function(a,b){var c=d.V[Ed(a.shapes[0])],l=d.V[Ed(b.shapes[0])];return Ad(c)- -Ad(l)}||Ja);return c};function jf(a,b,c){var d=Ea(a.d.ra(),function(a){return a.getSupportedShapeType()==b.type});d?d.drawShape(a.F,b,c):console.log("WARNING unsupported shape type: "+b.type)}function hf(a){a.F.clearRect(0,0,a.T.width,a.T.height);B(a.xa,function(b){jf(a,a.V[Ed(b.shapes[0])])});if(a.e){var b=a.V[Ed(a.e.shapes[0])];jf(a,b,j);b=Bd(b).geometry;a.d.popup.show(a.e,new ud(b.x,b.y+b.height+5))}};var kf="ontouchstart"in window,df=!kf,lf=kf?"touchstart":"mousedown",mf=kf?"touchenter":"mouseover",ff=kf?"touchmove":"mousemove",nf=kf?"touchend":"mouseup",of=kf?"touchleave":"mouseout";function pf(a,b){var c=n;return c=!a.offsetX||!a.offsetY&&a.n.changedTouches?{x:a.n.changedTouches[0].clientX-pd(b).left,y:a.n.changedTouches[0].clientY-pd(b).top}:{x:a.offsetX,y:a.offsetY}};function qf(){}r=qf.prototype;r.init=function(a,b){this.T=a;this.d=b;this.F=a.getContext("2d");this.F.lineWidth=1;this.Wb=n}; -r.Rb=function(){var a=this,b=this.T;this.Zb=O(this.T,ff,function(c){c=pf(c,b);if(a.Wb){a.H={x:c.x,y:c.y};a.F.clearRect(0,0,b.width,b.height);var c=a.H.x-a.j.x,d=a.H.y-a.j.y;a.F.strokeStyle="#000000";a.F.strokeRect(a.j.x+0.5,a.j.y+0.5,c,d);a.F.strokeStyle="#ffffff";0d?a.F.strokeRect(a.j.x+1.5,a.j.y-0.5,c-2,d+2):0>c&&0>d?a.F.strokeRect(a.j.x-0.5,a.j.y-0.5,c+2,d+2):a.F.strokeRect(a.j.x-0.5,a.j.y+1.5,c+2,d-2)}});this.$b=O(b,nf,function(c){var d= -pf(c,b),f=a.getShape(),c=c.n?c.n:c;a.Wb=n;f?(a.tb(),a.d.fireEvent("onSelectionCompleted",{mouseEvent:c,shape:f,viewportBounds:a.getViewportBounds()})):(a.d.fireEvent("onSelectionCanceled"),c=a.d.lb(d.x,d.y),0this.j.x?(a=this.H.x,b=this.j.x):(a=this.j.x,b=this.H.x);var c,d;this.H.y>this.j.y?(c=this.j.y,d=this.H.y):(c=this.H.y,d=this.j.y);return{top:c,right:a,bottom:d,left:b}}; -r.drawShape=function(a,b,c){if("rect"==b.type){var d;c?(c="#fff000",d=1.2):(c="#ffffff",d=1);b=b.geometry;a.strokeStyle="#000000";a.lineWidth=d;a.strokeRect(b.x+0.5,b.y+0.5,b.width+1,b.height+1);a.strokeStyle=c;a.strokeRect(b.x+1.5,b.y+1.5,b.width-1,b.height-1)}};function rf(a){return''} -function af(a){return'
'+Te(a.sc)+'
'};function sf(a,b){function c(b,c){S(d,"margin-"+b,c+"px");S(a,"margin-"+b,0);S(a,"padding-"+b,0)}this.ba=a;this.Kc={padding:a.style.padding,margin:a.style.margin};this.v=new qd;this.cb=[];this.cc=j;this.element=ub("div","annotorious-annotationlayer");S(this.element,"position","relative");S(this.element,"display","inline-block");var d=this.element,f=cd(a,"margin"),e=cd(a,"padding");(0!=f.top||0!=e.top)&&c("top",f.top+e.top);(0!=f.right||0!=e.right)&&c("right",f.right+e.right);(0!=f.bottom||0!=e.bottom)&& -c("bottom",f.bottom+e.bottom);(0!=f.left||0!=e.left)&&c("left",f.left+e.left);f=Zc(a);Wc(this.element,f.width,f.height);yb(this.element,a);this.element.appendChild(a);this.da=Od(rf,{width:f.width,height:f.height});df&&ib(this.da,"annotorious-item-unfocus");this.element.appendChild(this.da);this.g=Od(rf,{width:f.width,height:f.height});df&&V(this.g,n);this.element.appendChild(this.g);this.popup=b?b:new cf(this);f=new qf;f.init(this.g,this);this.cb.push(f);this.za=f;this.editor=new Ze(this);this.l= -new ef(this.da,this);this.Wa=new $e(this,this.element);var h=this;df&&(O(this.element,mf,function(a){a=a.relatedTarget;if(!a||!Ab(h.element,a))h.v.fireEvent("onMouseOverItem"),mb(h.da,"annotorious-item-unfocus","annotorious-item-focus")}),O(this.element,of,function(a){a=a.relatedTarget;if(!a||!Ab(h.element,a))h.v.fireEvent("onMouseOutOfItem"),mb(h.da,"annotorious-item-focus","annotorious-item-unfocus")}));var l=kf?this.g:this.da;O(l,lf,function(a){a=pf(a,l);h.l.o(i);h.cc?(V(h.g,j),h.za.startSelection(a.x, -a.y)):(a=h.l.lb(a.x,a.y),0
'+Te(a.sc)+"
"};function wf(a,b){this.ca=a;this.Xa=Zc(b.element);this.Q=b.popup;S(this.Q.element,"z-index",99E3);this.Ya=[];this.Sb=new OpenLayers.Layer.Boxes("Annotorious");this.ca.addLayer(this.Sb);var c=this;this.ca.events.register("move",this.ca,function(){c.Aa&&xf(c)});b.k("beforePopupHide",function(){c.Yb==c.Aa?c.Q.clearHideTimer():yf(c,c.Yb,c.Aa)})} -function xf(a){var b=a.Aa.Hb.div,c=Zc(b),d=Tc(b,a.ca.div),b=d.y,d=d.x,f=c.width,e=c.height,c=Zc(a.Q.element),b={y:b+e+5};d+c.width>a.Xa.width?(mb(a.Q.element,"top-left","top-right"),b.x=d+f-c.width):(mb(a.Q.element,"top-right","top-left"),b.x=d);0>b.x&&(b.x=0);b.x+c.width>a.Xa.width&&(b.x=a.Xa.width-c.width);b.y+c.height>a.Xa.height&&(b.y=a.Xa.height-c.height);a.Q.setPosition(b)} -function yf(a,b,c){b?(Tc(b.Hb.div,a.ca.div),za("height"),S(b.kd,"border-color","#fff000"),a.Aa=b,a.Q.setAnnotation(b.na),xf(a),a.Q.show()):delete a.Aa;c&&S(c.kd,"border-color","#fff")} -wf.prototype.z=function(a){var b=a.shapes[0].geometry,b=new OpenLayers.Marker.Box(new OpenLayers.Bounds(b.x,b.y,b.x+b.width,b.y+b.height));ib(b.div,"annotorious-ol-boxmarker-outer");S(b.div,"border",m);var c=ub("div","annotorious-ol-boxmarker-inner");Wc(c,"100%","100%");b.div.appendChild(c);var d={na:a,Hb:b,kd:c},f=this;O(c,"mouseover",function(){f.Aa||yf(f,d);f.Yb=d});O(c,"mouseout",function(){delete f.Yb;f.Q.startHideTimer()});this.Ya.push(d);z.sort.call(this.Ya,function(a,b){return Ad(b.na.shapes[0])- -Ad(a.na.shapes[0])}||Ja);var e=1E4;B(this.Ya,function(a){S(a.Hb.div,"z-index",e);e++});this.Sb.addMarker(b)};wf.prototype.w=function(a){var b=Ea(this.Ya,function(b){return b.na==a});b&&(C(this.Ya,b),this.Sb.removeMarker(b.Hb))};wf.prototype.J=aa();wf.prototype.o=function(a){a||this.Q.startHideTimer()};function zf(a){this.ca=a;this.U=a.div;var b=parseInt(T(this.U,"width"),10),c=parseInt(T(this.U,"height"),10);this.v=new qd;this.element=ub("div","annotorious-annotationlayer");S(this.element,"position","relative");Wc(this.element,b,c);yb(this.element,this.U);this.element.appendChild(this.U);this.ab=Od(vf,{sc:"Click and Drag"});S(this.ab,"z-index",9998);U(this.ab,0);this.element.appendChild(this.ab);this.popup=new cf(this);this.l=new wf(a,this);this.g=Od(rf,{width:b,height:c});V(this.g,n);S(this.g, -"z-index",9999);this.element.appendChild(this.g);this.bb=new qf;this.bb.init(this.g,this);this.vb=i;this.editor=new Ze(this);S(this.editor.element,"z-index",1E4);var d=this;O(this.element,"mouseover",function(a){a=a.relatedTarget;(!a||!Ab(d.element,a))&&d.v.fireEvent("onMouseOverItem")});O(this.element,"mouseout",function(a){a=a.relatedTarget;(!a||!Ab(d.element,a))&&d.v.fireEvent("onMouseOutOfItem")});O(this.g,"mousedown",function(a){var b=Uc(d.U);d.bb.startSelection(a.clientX-b.x,a.clientY-b.y)}); -this.v.k("onSelectionCompleted",function(a){S(d.g,"pointer-events","none");a=a.viewportBounds;d.editor.setPosition(new ud(a.left+d.U.offsetLeft,a.bottom+4+d.U.offsetTop));d.editor.open()});this.v.k("onSelectionCanceled",function(){d.stopSelection()})}r=zf.prototype;r.$=aa();r.O=aa();r.ea=function(a){S(this.g,"pointer-events","auto");var b=this;V(this.g,j);U(this.ab,0.8);window.setTimeout(function(){U(b.ab,0)},2E3);a&&(this.vb=a)}; -r.Uc=function(a){this.l.w(a);var b=this.bb,c=this;if(b){V(this.g,j);this.l.o(i);var d=this.g.getContext("2d"),f=Dd(a.shapes[0],function(a){return c.kb(a)});b.drawShape(d,f);b=Bd(f).geometry;this.editor.setPosition(new ud(b.x+this.U.offsetLeft,b.y+b.height+4+this.U.offsetTop));this.editor.open(a)}};r.z=function(a){this.l.z(a)};r.k=function(a,b){this.v.k(a,b)};r.Mc=aa();r.fireEvent=function(a,b){return this.v.fireEvent(a,b)}; -r.kb=function(a){a=this.ca.getViewPortPxFromLonLat(new OpenLayers.LonLat(a.x,a.y));return{x:a.x,y:a.y}};r.qa=q("bb");r.J=aa();r.ra=aa();r.getItem=function(){return{src:"map://openlayers/something"}};r.o=function(a){this.l.o(a)};r.w=function(a){this.l.w(a)};r.Pa=function(a,b){this.v.Pa(a,b)};r.qb=aa();r.stopSelection=function(a){V(this.g,n);this.vb&&(this.vb(),delete this.vb);this.bb.stopSelection();a&&this.l.z(a)}; -r.Pb=function(a){a=this.ca.getLonLatFromPixel(new OpenLayers.Pixel(a.x,a.y));return{x:a.lon,y:a.lat}};function Af(){Hd(this)}v(Af,Gd);Af.prototype.jc=ba("map://openlayers/something");Af.prototype.rd=function(a){return new zf(a)};Af.prototype.Ac=function(a){return a instanceof OpenLayers.Map};function Z(){function a(){B(b.t,function(a){a.init()});B(b.Za,function(a){a.initPlugin&&a.initPlugin(b);B(b.t,function(b){b.wb(a)})})}this.t=[new uf];window.OpenLayers&&this.t.push(new Af);this.Za=[];var b=this;window.addEventListener?window.addEventListener("load",a,n):window.attachEvent&&window.attachEvent("onload",a)}function $(a,b){return Ea(a.t,function(a){return Nd(a,b)})}r=Z.prototype; -r.ea=function(a,b){var c=i,d=i;t(a)?(c=a,d=b):u(a)&&(d=a);if(c){var f=$(this,c);f&&f.ea(c,d)}else B(this.t,function(a){a.ea(d)})};r.z=function(a,b){var c=$(this,a.src);c&&c.z(a,b)};r.k=function(a,b){B(this.t,function(c){c.k(a,b)})};r.wb=function(a,b){try{var c=new window.annotorious.plugin[a](b);"complete"==document.readyState?(c.initPlugin&&c.initPlugin(this),B(this.t,function(a){a.wb(c)})):this.Za.push(c)}catch(d){console.log("Could not load plugin: "+a)}}; -r.R=function(a){if(a){var b=$(this,a);b&&b.R(a)}else B(this.t,function(a){a.R()})};r.qa=function(a){var b=$(this,a);if(b)return b.qa(a)};r.J=function(a){if(a){var b=$(this,a);return b?b.J(a):[]}var c=[];B(this.t,function(a){Ha(c,a.J())});return c};r.ra=function(a){var b=$(this,a);return b?b.ra(a):[]};r.Y=function(a){if(a){var b=$(this,a);b&&b.Y(a)}else B(this.t,function(a){a.Y()})};r.O=function(a){if(a){var b=$(this,a);b&&b.O(a)}else B(this.t,function(a){a.O()})}; -r.o=function(a){if(a){var b=$(this,a.src);b&&b.o(a)}else B(this.t,function(a){a.o()})};r.qc=function(a){var b=Ea(this.t,function(b){return b.Ac(a)});b?b.qc(a):g("Error: Annotorious does not support this media type in the current version or build configuration.")};r.Mb=function(a){var b=this;B(this.J(a),function(a){b.w(a)})};r.w=function(a){var b=$(this,a.src);b&&b.w(a)};r.reset=function(){B(this.t,function(a){a.R();a.init()})};r.qb=function(a,b){var c=$(this,a);c&&c.qb(a,b)}; -r.Xd=function(a){a?this.$(i):this.O(i)};r.wa=function(a){if(a){var b=$(this,a);b&&b.wa(a)}else B(this.t,function(a){a.wa()})};r.$=function(a){if(a){var b=$(this,a);b&&b.$(a)}else B(this.t,function(a){a.$()})};window.anno=new Z;Z.prototype.activateSelector=Z.prototype.ea;Z.prototype.addAnnotation=Z.prototype.z;Z.prototype.addHandler=Z.prototype.k;Z.prototype.addPlugin=Z.prototype.wb;Z.prototype.destroy=Z.prototype.R;Z.prototype.getActiveSelector=Z.prototype.qa;Z.prototype.getAnnotations=Z.prototype.J;Z.prototype.getAvailableSelectors=Z.prototype.ra;Z.prototype.hideAnnotations=Z.prototype.Y;Z.prototype.hideSelectionWidget=Z.prototype.O;Z.prototype.highlightAnnotation=Z.prototype.o;Z.prototype.makeAnnotatable=Z.prototype.qc; -Z.prototype.removeAll=Z.prototype.Mb;Z.prototype.removeAnnotation=Z.prototype.w;Z.prototype.reset=Z.prototype.reset;Z.prototype.setActiveSelector=Z.prototype.qb;Z.prototype.showAnnotations=Z.prototype.wa;Z.prototype.showSelectionWidget=Z.prototype.$;window.annotorious||(window.annotorious={});window.annotorious.plugin||(window.annotorious.plugin={});Z.prototype.setSelectionEnabled=Z.prototype.Xd; diff --git a/test/dir_test/001.jpg b/test/dir_test/001.jpg new file mode 100644 index 0000000..44e4074 Binary files /dev/null and b/test/dir_test/001.jpg differ diff --git a/test/dir_test/002.jpg b/test/dir_test/002.jpg new file mode 100644 index 0000000..ccac41b Binary files /dev/null and b/test/dir_test/002.jpg differ diff --git a/test/dir_test/003.jpg b/test/dir_test/003.jpg new file mode 100644 index 0000000..d5b3a5e Binary files /dev/null and b/test/dir_test/003.jpg differ diff --git a/test/dir_test/004.jpg b/test/dir_test/004.jpg new file mode 100644 index 0000000..a79da8a Binary files /dev/null and b/test/dir_test/004.jpg differ diff --git a/test/dir_test/005.jpg b/test/dir_test/005.jpg new file mode 100644 index 0000000..68e7905 Binary files /dev/null and b/test/dir_test/005.jpg differ diff --git a/test/dir_test/006.jpg b/test/dir_test/006.jpg new file mode 100644 index 0000000..e10d50b Binary files /dev/null and b/test/dir_test/006.jpg differ diff --git a/test/dir_test/007.jpg b/test/dir_test/007.jpg new file mode 100644 index 0000000..fbecc16 Binary files /dev/null and b/test/dir_test/007.jpg differ diff --git a/test/dir_test/008.jpg b/test/dir_test/008.jpg new file mode 100644 index 0000000..9d510e7 Binary files /dev/null and b/test/dir_test/008.jpg differ diff --git a/test/dir_test/009.jpg b/test/dir_test/009.jpg new file mode 100644 index 0000000..74a99b4 Binary files /dev/null and b/test/dir_test/009.jpg differ diff --git a/test/dir_test/010.jpg b/test/dir_test/010.jpg new file mode 100644 index 0000000..ef7a2f5 Binary files /dev/null and b/test/dir_test/010.jpg differ diff --git a/test/dir_test/011.jpg b/test/dir_test/011.jpg new file mode 100644 index 0000000..a17e109 Binary files /dev/null and b/test/dir_test/011.jpg differ diff --git a/test/dir_test/012.jpg b/test/dir_test/012.jpg new file mode 100644 index 0000000..e6a0728 Binary files /dev/null and b/test/dir_test/012.jpg differ diff --git a/test/dir_test/013.jpg b/test/dir_test/013.jpg new file mode 100644 index 0000000..dd61c01 Binary files /dev/null and b/test/dir_test/013.jpg differ diff --git a/test/dir_test/014.jpg b/test/dir_test/014.jpg new file mode 100644 index 0000000..fc0168b Binary files /dev/null and b/test/dir_test/014.jpg differ diff --git a/test/dir_test/015.jpg b/test/dir_test/015.jpg new file mode 100644 index 0000000..657475d Binary files /dev/null and b/test/dir_test/015.jpg differ diff --git a/test/dir_test/016.jpg b/test/dir_test/016.jpg new file mode 100644 index 0000000..d24bd94 Binary files /dev/null and b/test/dir_test/016.jpg differ diff --git a/test/dir_test/017.jpg b/test/dir_test/017.jpg new file mode 100644 index 0000000..0e10e74 Binary files /dev/null and b/test/dir_test/017.jpg differ diff --git a/test/dir_test/018.jpg b/test/dir_test/018.jpg new file mode 100644 index 0000000..514b595 Binary files /dev/null and b/test/dir_test/018.jpg differ diff --git a/test/dir_test/019.jpg b/test/dir_test/019.jpg new file mode 100644 index 0000000..56c0901 Binary files /dev/null and b/test/dir_test/019.jpg differ