diff --git a/.gitignore b/.gitignore index 9c5e89f..3643458 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.idea image/image.txt image/dzi image/dzi_edited diff --git a/README.md b/README.md index 26f8a7f..8032724 100644 --- a/README.md +++ b/README.md @@ -9,4 +9,6 @@ uses 1. https://github.com/Deprecator16/OpenSeadragonSmartScrollZoom/ 2. https://github.com/openseadragon/openseadragon 3. https://github.com/annotorious/annotorious-openseadragon + 1. https://github.com/wattapik/recogito-client-core + 2. ^ you have to build the above with the recogito core i have here 4. https://github.com/VoidVolker/MagickSlicer diff --git a/image/script/generate_annotations.py b/image/script/generate_annotations.py index 5bc49a0..5e50348 100644 --- a/image/script/generate_annotations.py +++ b/image/script/generate_annotations.py @@ -1,25 +1,21 @@ import json import uuid -import requests +import aiohttp +import asyncio -def get_post_data(folder_name): +async def get_post_data(session, folder_name): url = f"https://sketchersunited.org/posts/{folder_name.split('by')[0]}" headers = {"Accept": "text/json"} - response = requests.get(url, headers=headers) - if response.status_code == 200: - return response.json() - return None + async with session.get(url, headers=headers) as response: + if response.status == 200: + return await response.json() + return None -with open('image.txt', 'r') as file: - lines = file.readlines() - -annotations = [] - -for line in lines: +async def process_line(session, line): folder_name, x, y, _, _, _ = line.strip().split() annotation_id = str(uuid.uuid4()) - post_data = get_post_data(folder_name) + post_data = await get_post_data(session, folder_name) if post_data: annotation_text = f'🖼️ {post_data["post"]["title"]}
👤 @{post_data["post"]["profile"]["username"]}' else: @@ -44,10 +40,22 @@ for line in lines: } } - annotations.append(annotation) print(f"Appended annotation for {folder_name}") + return annotation -with open('../annotations/annotations.w3c.json', 'w') as output_file: - json.dump(annotations, output_file, indent=2) +async def main(): + annotations = [] + async with aiohttp.ClientSession() as session: + with open('image.txt', 'r') as file: + lines = file.readlines() -print("Annotations JSON file created.") + tasks = [process_line(session, line) for line in lines] + annotations = await asyncio.gather(*tasks) + + with open('../annotations/annotations.w3c.json', 'w') as output_file: + json.dump(annotations, output_file, indent=2) + + print("Annotations JSON file created.") + +# Run the asynchronous code +asyncio.run(main()) diff --git a/index.html b/index.html index 2933aa8..b816bb6 100644 --- a/index.html +++ b/index.html @@ -1,107 +1,115 @@ - - - - Sketchers United Collaboration + - - - - + + Sketchers United Collaboration - - + + + + - - - + + + + + + -
+
+
+
+ +
+
- - - - + + +
+ 🌈 Here now: Loading... +
+ + + +
+ +
+
+ + + + + + + + + diff --git a/script/annotations.js b/script/annotations.js index cbadca0..3558045 100644 --- a/script/annotations.js +++ b/script/annotations.js @@ -4,27 +4,4 @@ anno.escape = false; anno.loadAnnotations('annotations/annotations.w3c.json'); let annotationText = "" -function renderHTML() -{ - const observer = new MutationObserver(() => { - const annotationTextElement = document.querySelector('.r6o-readonly-comment'); - if (annotationTextElement) { - annotationTextElement.innerHTML = annotationText - observer.disconnect(); - } - }); - - observer.observe(document.body, { childList: true, subtree: true }); -} - -anno.on('clickAnnotation', function(annotation, element) -{ - annotationText = annotation.body[0].value - renderHTML() -}); - -viewer.addHandler('update-viewport', function(event) -{ - renderHTML() -}); diff --git a/script/openseadragon/annotorious.min.css b/script/openseadragon/annotorious.min.css index 2c889d8..ec798cd 100644 --- a/script/openseadragon/annotorious.min.css +++ b/script/openseadragon/annotorious.min.css @@ -1 +1,5 @@ -.r6o-editor{top:0;left:0;margin-left:-19px}.a9s-annotationlayer{position:absolute;top:0;left:0;width:100%;height:100%;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.a9s-annotationlayer.no-cursor,.a9s-annotationlayer.no-cursor *{cursor:none!important}.a9s-crosshair line{stroke-width:1px;stroke:#00000080;pointer-events:none;vector-effect:non-scaling-stroke;shape-rendering:crispEdges}.a9s-selection-mask{stroke:none;fill:transparent;pointer-events:none}.a9s-annotation rect,.a9s-annotation circle,.a9s-annotation ellipse,.a9s-annotation path,.a9s-annotation polygon,.a9s-annotation line,.a9s-selection rect,.a9s-selection circle,.a9s-selection ellipse,.a9s-selection path,.a9s-selection polygon,.a9s-selection line{fill:transparent;cursor:pointer;vector-effect:non-scaling-stroke}.a9s-annotation .a9s-inner,.a9s-selection .a9s-inner{stroke:#fff;stroke-width:1px;fill:transparent}.a9s-annotation .a9s-inner:hover,.a9s-selection .a9s-inner:hover{stroke:#fff000}.a9s-annotation .a9s-outer,.a9s-selection .a9s-outer{stroke:#000000b3;stroke-width:3px;fill:none}.a9s-annotation .a9s-formatter-el,.a9s-selection .a9s-formatter-el{overflow:visible}.a9s-annotation.a9s-point .a9s-inner{display:none}.a9s-annotation.a9s-point .a9s-outer{stroke:#5a5a5a;stroke-width:1.5px;fill:#ffffff80}.a9s-annotation.a9s-point .a9s-outer:hover{fill:#fff000}.a9s-annotation.selected .a9s-inner,.a9s-selection .a9s-inner{stroke:#fff000}.a9s-annotation.editable .a9s-inner{stroke:#fff000;cursor:move!important}.a9s-annotation.editable .a9s-inner:hover{fill:#fff0001a}.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;cursor:pointer}.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-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 #00000040}.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-readonly-comment{white-space:pre-line}.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;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,.2);-moz-box-shadow:0 2px 4px rgba(0,0,0,.2);box-shadow:0 2px 4px #0003}.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 .r6o-purposedropdown{position:relative;z-index:2}.r6o-widget.comment.editable{background-color:#ecf0f1}.r6o-widget.r6o-tag: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;z-index:1}.r6o-widget.r6o-tag ul.r6o-taglist{flex:0;white-space:nowrap}.r6o-widget.r6o-tag ul.r6o-taglist li{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,.1);-moz-box-shadow:0 0 4px rgba(0,0,0,.1);box-shadow:0 0 4px #0000001a}.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 .2s}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-enter-done,.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 .2s}.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;width:400px;color:#3f3f3f;opacity:0;font-family:Lato,sans-serif;font-size:17px;line-height:27px;-webkit-transition:opacity .2s ease-in;-moz-transition:opacity .2s ease-in;transition:opacity .2s ease-in}.r6o-editor .r6o-arrow{position:absolute;overflow:hidden;top:-12px;left:12px;width:28px;height:12px;display:none}.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,.4);-moz-box-shadow:2px 2px 42px rgba(0,0,0,.4);box-shadow:2px 2px 42px #0006}.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{position:relative;text-align:right;padding:8px 0}.r6o-editor .r6o-footer .r6o-btn{margin-right:8px}.r6o-editor .r6o-footer .r6o-btn.delete-annotation{position:absolute;top:7px;left:7px;background-color:transparent;border:none;color:#4483c4;width:32px;height:32px;min-width:0;border-radius:100%;padding:0;display:flex;justify-content:center;align-items:center;-webkit-transition:all .1s ease-in;-moz-transition:all .1s ease-in;-o-transition:all .1s ease-in;transition:all .1s ease-in}.r6o-editor .r6o-footer .r6o-btn.delete-annotation:hover{color:#fff;background-color:#ef352c}@media (max-width: 640px){.r6o-editor{width:260px}}.r6o-editor.r6o-arrow-top .r6o-arrow{display:block}.r6o-editor.r6o-arrow-right{margin-left:8px}.r6o-editor.r6o-arrow-right .r6o-arrow{left:auto;right:12px}.r6o-editor.r6o-arrow-bottom .r6o-arrow{display:block;top:auto;bottom:-12px}.r6o-editor.r6o-arrow-bottom .r6o-arrow:after{top:-11px;box-shadow:none}.r6o-editor.pushed .r6o-arrow,.r6o-editor.dragged .r6o-arrow{display:none}.r6o-editor .r6o-draggable{cursor:move}.r6o-purposedropdown{width:150px;display:inline-block}.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}.a9s-annotation.hover .a9s-inner{stroke:#fff000}.a9s-annotation:not(.hover):hover .a9s-inner{stroke:#fff}.a9s-osd-crosshair-container{position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;pointer-events:none} +.r6o-editor{top:0;left:0;margin-left:-19px}.a9s-annotationlayer{position:absolute;top:0;left:0;width:100%;height:100%;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.a9s-annotationlayer.no-cursor{cursor:none !important}.a9s-annotationlayer.no-cursor *{cursor:none !important}.a9s-crosshair line{stroke-width:1px;stroke:rgba(0,0,0,.5);pointer-events:none;vector-effect:non-scaling-stroke;shape-rendering:crispEdges}.a9s-selection-mask{stroke:none;fill:transparent;pointer-events:none}.a9s-annotation rect,.a9s-annotation circle,.a9s-annotation ellipse,.a9s-annotation path,.a9s-annotation polygon,.a9s-annotation line,.a9s-selection rect,.a9s-selection circle,.a9s-selection ellipse,.a9s-selection path,.a9s-selection polygon,.a9s-selection line{fill:transparent;cursor:pointer;vector-effect:non-scaling-stroke}.a9s-annotation .a9s-inner,.a9s-selection .a9s-inner{stroke:#fff;stroke-width:1px;fill:transparent}.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,.7);stroke-width:3px;fill:none}.a9s-annotation .a9s-formatter-el,.a9s-selection .a9s-formatter-el{overflow:visible}.a9s-annotation.a9s-point .a9s-inner{display:none}.a9s-annotation.a9s-point .a9s-outer{stroke:#5a5a5a;stroke-width:1.5px;fill:rgba(255,255,255,.5)}.a9s-annotation.a9s-point .a9s-outer:hover{fill:#fff000}.a9s-annotation.selected .a9s-inner,.a9s-selection .a9s-inner{stroke:#fff000}.a9s-annotation.editable .a9s-inner{stroke:#fff000;cursor:move !important}.a9s-annotation.editable .a9s-inner:hover{fill:rgba(255,240,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;cursor:pointer}.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-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,.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-readonly-comment{white-space:pre-line}.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,.2);-moz-box-shadow:0 2px 4px rgba(0,0,0,.2);box-shadow:0 2px 4px rgba(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 .r6o-purposedropdown{position:relative;z-index:2}.r6o-widget.comment.editable{background-color:#ecf0f1}.r6o-widget.r6o-tag: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;z-index:1}.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,.1);-moz-box-shadow:0 0 4px rgba(0,0,0,.1);box-shadow:0 0 4px rgba(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;width:400px;color:#3f3f3f;opacity:0;font-family:"Lato",sans-serif;font-size:17px;line-height:27px;-webkit-transition:opacity .2s ease-in;-moz-transition:opacity .2s ease-in;transition:opacity .2s ease-in}.r6o-editor .r6o-arrow{position:absolute;overflow:hidden;top:-12px;left:12px;width:28px;height:12px;display:none}.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,.4);-moz-box-shadow:2px 2px 42px rgba(0,0,0,.4);box-shadow:2px 2px 42px rgba(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{position:relative;text-align:right;padding:8px 0}.r6o-editor .r6o-footer .r6o-btn{margin-right:8px}.r6o-editor .r6o-footer .r6o-btn.delete-annotation{position:absolute;top:7px;left:7px;background-color:transparent;border:none;color:#4483c4;width:32px;height:32px;min-width:0;border-radius:100%;padding:0;display:flex;justify-content:center;align-items:center;-webkit-transition:all .1s ease-in;-moz-transition:all .1s ease-in;-o-transition:all .1s ease-in;transition:all .1s ease-in}.r6o-editor .r6o-footer .r6o-btn.delete-annotation:hover{color:#fff;background-color:#ef352c}@media(max-width: 640px){.r6o-editor{width:260px}}.r6o-editor.r6o-arrow-top .r6o-arrow{display:block}.r6o-editor.r6o-arrow-right{margin-left:8px}.r6o-editor.r6o-arrow-right .r6o-arrow{left:auto;right:12px}.r6o-editor.r6o-arrow-bottom .r6o-arrow{display:block;top:auto;bottom:-12px}.r6o-editor.r6o-arrow-bottom .r6o-arrow::after{top:-11px;box-shadow:none}.r6o-editor.pushed .r6o-arrow,.r6o-editor.dragged .r6o-arrow{display:none}.r6o-editor .r6o-draggable{cursor:move}.r6o-purposedropdown{width:150px;display:inline-block}.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} +.a9s-annotation.hover .a9s-inner{stroke:#fff000}.a9s-annotation:not(.hover):hover .a9s-inner{stroke:#fff}.a9s-osd-crosshair-container{position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;pointer-events:none} + +/*# sourceMappingURL=annotorious.min.css.map*/ \ No newline at end of file diff --git a/script/openseadragon/openseadragon-annotorious.min.js b/script/openseadragon/openseadragon-annotorious.min.js index b1e593c..621117b 100644 --- a/script/openseadragon/openseadragon-annotorious.min.js +++ b/script/openseadragon/openseadragon-annotorious.min.js @@ -1,29 +1,3 @@ -(function(ke,X){typeof exports=="object"&&typeof module!="undefined"?module.exports=X():typeof define=="function"&&define.amd?define(X):(ke=typeof globalThis!="undefined"?globalThis:ke||self,ke.OpenSeadragon=ke.OpenSeadragon||{},ke.OpenSeadragon.Annotorious=X())})(this,function(){"use strict";var Rx=Object.defineProperty;var Mx=(ke,X,xt)=>X in ke?Rx(ke,X,{enumerable:!0,configurable:!0,writable:!0,value:xt}):ke[X]=xt;var P=(ke,X,xt)=>(Mx(ke,typeof X!="symbol"?X+"":X,xt),xt);var ke,X,xt,yn,vs,ys,ws,Yn={},bs=[],od=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function ft(i,t){for(var e in t)i[e]=t[e];return i}function Ss(i){var t=i.parentNode;t&&t.removeChild(i)}function Oe(i,t,e){var n,r,o,s={};for(o in t)o=="key"?n=t[o]:o=="ref"?r=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?ke.call(arguments,2):e),typeof i=="function"&&i.defaultProps!=null)for(o in i.defaultProps)s[o]===void 0&&(s[o]=i.defaultProps[o]);return wn(i,s,n,r,null)}function wn(i,t,e,n,r){var o={type:i,props:t,key:e,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:r==null?++xt:r};return r==null&&X.vnode!=null&&X.vnode(o),o}function ur(){return{current:null}}function nt(i){return i.children}function Pe(i,t){this.props=i,this.context=t}function jt(i,t){if(t==null)return i.__?jt(i.__,i.__.__k.indexOf(i)+1):null;for(var e;t0?wn(g.type,g.props,g.key,null,g.__v):g)!=null){if(g.__=e,g.__b=e.__b+1,(d=T[c])===null||d&&g.key==d.key&&g.type===d.type)T[c]=void 0;else for(h=0;h2&&(s.children=arguments.length>3?ke.call(arguments,2):e),wn(i.type,s,n||i.key,r||i.ref,null)}function Sn(i,t){var e={__c:t="__cC"+ws++,__:i,Consumer:function(n,r){return n.children(r)},Provider:function(n){var r,o;return this.getChildContext||(r=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(s){this.props.value!==s.value&&r.some(cr)},this.sub=function(s){r.push(s);var a=s.componentWillUnmount;s.componentWillUnmount=function(){r.splice(r.indexOf(s),1),a&&a.call(s)}}),n.children}};return e.Provider.__=e.Consumer.contextType=e}ke=bs.slice,X={__e:function(i,t){for(var e,n,r;t=t.__;)if((e=t.__c)&&!e.__)try{if((n=e.constructor)&&n.getDerivedStateFromError!=null&&(e.setState(n.getDerivedStateFromError(i)),r=e.__d),e.componentDidCatch!=null&&(e.componentDidCatch(i),r=e.__d),r)return e.__E=e}catch(o){i=o}throw i}},xt=0,Pe.prototype.setState=function(i,t){var e;e=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=ft({},this.state),typeof i=="function"&&(i=i(ft({},e),this.props)),i&&ft(e,i),i!=null&&this.__v&&(t&&this.__h.push(t),cr(this))},Pe.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),cr(this))},Pe.prototype.render=nt,yn=[],vs=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Zn.__r=0,ws=0;var Ft,Le,Fs,Gt=0,dr=[],ks=X.__b,Ls=X.__r,Bs=X.diffed,Is=X.__c,Ns=X.unmount;function qt(i,t){X.__h&&X.__h(Le,i,Gt||t),Gt=0;var e=Le.__H||(Le.__H={__:[],__h:[]});return i>=e.__.length&&e.__.push({}),e.__[i]}function mt(i){return Gt=1,fr(Us,i)}function fr(i,t,e){var n=qt(Ft++,2);return n.t=i,n.__c||(n.__=[e?e(t):Us(void 0,t),function(r){var o=n.t(n.__[0],r);n.__[0]!==o&&(n.__=[o,n.__[1]],n.__c.setState({}))}],n.__c=Le),n.__}function kt(i,t){var e=qt(Ft++,3);!X.__s&&gr(e.__H,t)&&(e.__=i,e.__H=t,Le.__H.__h.push(e))}function pr(i,t){var e=qt(Ft++,4);!X.__s&&gr(e.__H,t)&&(e.__=i,e.__H=t,Le.__h.push(e))}function ot(i){return Gt=5,gt(function(){return{current:i}},[])}function Hs(i,t,e){Gt=6,pr(function(){typeof i=="function"?i(t()):i&&(i.current=t())},e==null?e:e.concat(i))}function gt(i,t){var e=qt(Ft++,7);return gr(e.__H,t)&&(e.__=i(),e.__H=t,e.__h=i),e.__}function st(i,t){return Gt=8,gt(function(){return i},t)}function En(i){var t=Le.context[i.__c],e=qt(Ft++,9);return e.c=i,t?(e.__==null&&(e.__=!0,t.sub(Le)),t.props.value):i.__}function zs(i,t){X.useDebugValue&&X.useDebugValue(t?t(i):i)}function cd(i){var t=qt(Ft++,10),e=mt();return t.__=i,Le.componentDidCatch||(Le.componentDidCatch=function(n){t.__&&t.__(n),e[1](n)}),[e[0],function(){e[1](void 0)}]}function hd(){var i;for(dr.sort(function(t,e){return t.__v.__b-e.__v.__b});i=dr.pop();)if(i.__P)try{i.__H.__h.forEach(Jn),i.__H.__h.forEach(mr),i.__H.__h=[]}catch(t){i.__H.__h=[],X.__e(t,i.__v)}}X.__b=function(i){Le=null,ks&&ks(i)},X.__r=function(i){Ls&&Ls(i),Ft=0;var t=(Le=i.__c).__H;t&&(t.__h.forEach(Jn),t.__h.forEach(mr),t.__h=[])},X.diffed=function(i){Bs&&Bs(i);var t=i.__c;t&&t.__H&&t.__H.__h.length&&(dr.push(t)!==1&&Fs===X.requestAnimationFrame||((Fs=X.requestAnimationFrame)||function(e){var n,r=function(){clearTimeout(o),Vs&&cancelAnimationFrame(n),setTimeout(e)},o=setTimeout(r,100);Vs&&(n=requestAnimationFrame(r))})(hd)),Le=null},X.__c=function(i,t){t.some(function(e){try{e.__h.forEach(Jn),e.__h=e.__h.filter(function(n){return!n.__||mr(n)})}catch(n){t.some(function(r){r.__h&&(r.__h=[])}),t=[],X.__e(n,e.__v)}}),Is&&Is(i,t)},X.unmount=function(i){Ns&&Ns(i);var t,e=i.__c;e&&e.__H&&(e.__H.__.forEach(function(n){try{Jn(n)}catch(r){t=r}}),t&&X.__e(t,e.__v))};var Vs=typeof requestAnimationFrame=="function";function Jn(i){var t=Le,e=i.__c;typeof e=="function"&&(i.__c=void 0,e()),Le=t}function mr(i){var t=Le;i.__c=i.__(),Le=t}function gr(i,t){return!i||i.length!==t.length||t.some(function(e,n){return e!==i[n]})}function Us(i,t){return typeof t=="function"?t(i):t}function Ws(i,t){for(var e in t)i[e]=t[e];return i}function vr(i,t){for(var e in i)if(e!=="__source"&&!(e in t))return!0;for(var n in t)if(n!=="__source"&&i[n]!==t[n])return!0;return!1}function xn(i){this.props=i}function js(i,t){function e(r){var o=this.props.ref,s=o==r.ref;return!s&&o&&(o.call?o(null):o.current=null),t?!t(this.props,r)||!s:vr(this.props,r)}function n(r){return this.shouldComponentUpdate=e,Oe(i,r)}return n.displayName="Memo("+(i.displayName||i.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n}(xn.prototype=new Pe).isPureReactComponent=!0,xn.prototype.shouldComponentUpdate=function(i,t){return vr(this.props,i)||vr(this.state,t)};var Gs=X.__b;X.__b=function(i){i.type&&i.type.__f&&i.ref&&(i.props.ref=i.ref,i.ref=null),Gs&&Gs(i)};var dd=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function yr(i){function t(e,n){var r=Ws({},e);return delete r.ref,i(r,(n=e.ref||n)&&(typeof n!="object"||"current"in n)?n:null)}return t.$$typeof=dd,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(i.displayName||i.name)+")",t}var qs=function(i,t){return i==null?null:pt(pt(i).map(t))},Xs={map:qs,forEach:qs,count:function(i){return i?pt(i).length:0},only:function(i){var t=pt(i);if(t.length!==1)throw"Children.only";return t[0]},toArray:pt},fd=X.__e;X.__e=function(i,t,e){if(i.then){for(var n,r=t;r=r.__;)if((n=r.__c)&&n.__c)return t.__e==null&&(t.__e=e.__e,t.__k=e.__k),n.__c(i,t)}fd(i,t,e)};var Ys=X.unmount;function _n(){this.__u=0,this.t=null,this.__b=null}function Zs(i){var t=i.__.__c;return t&&t.__e&&t.__e(i)}function Ks(i){var t,e,n;function r(o){if(t||(t=i()).then(function(s){e=s.default||s},function(s){n=s}),n)throw n;if(!e)throw t;return Oe(e,o)}return r.displayName="Lazy",r.__f=!0,r}function Xt(){this.u=null,this.o=null}X.unmount=function(i){var t=i.__c;t&&t.__R&&t.__R(),t&&i.__h===!0&&(i.type=null),Ys&&Ys(i)},(_n.prototype=new Pe).__c=function(i,t){var e=t.__c,n=this;n.t==null&&(n.t=[]),n.t.push(e);var r=Zs(n.__v),o=!1,s=function(){o||(o=!0,e.__R=null,r?r(a):a())};e.__R=s;var a=function(){if(!--n.__u){if(n.state.__e){var u=n.state.__e;n.__v.__k[0]=function h(d,g,y){return d&&(d.__v=null,d.__k=d.__k&&d.__k.map(function(x){return h(x,g,y)}),d.__c&&d.__c.__P===g&&(d.__e&&y.insertBefore(d.__e,d.__d),d.__c.__e=!0,d.__c.__P=y)),d}(u,u.__c.__P,u.__c.__O)}var c;for(n.setState({__e:n.__b=null});c=n.t.pop();)c.forceUpdate()}},l=t.__h===!0;n.__u++||l||n.setState({__e:n.__b=n.__v.__k[0]}),i.then(s,s)},_n.prototype.componentWillUnmount=function(){this.t=[]},_n.prototype.render=function(i,t){if(this.__b){if(this.__v.__k){var e=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=function o(s,a,l){return s&&(s.__c&&s.__c.__H&&(s.__c.__H.__.forEach(function(u){typeof u.__c=="function"&&u.__c()}),s.__c.__H=null),(s=Ws({},s)).__c!=null&&(s.__c.__P===l&&(s.__c.__P=a),s.__c=null),s.__k=s.__k&&s.__k.map(function(u){return o(u,a,l)})),s}(this.__b,e,n.__O=n.__P)}this.__b=null}var r=t.__e&&Oe(nt,null,i.fallback);return r&&(r.__h=null),[Oe(nt,null,t.__e?null:i.children),r]};var Js=function(i,t,e){if(++e[1]===e[0]&&i.o.delete(t),i.props.revealOrder&&(i.props.revealOrder[0]!=="t"||!i.o.size))for(e=i.u;e;){for(;e.length>3;)e.pop()();if(e[1]>>1,1),t.i.removeChild(n)}}),bn(Oe(pd,{context:t.context},i.__v),t.l)):t.l&&t.componentWillUnmount()}function wr(i,t){return Oe(md,{__v:i,i:t})}(Xt.prototype=new Pe).__e=function(i){var t=this,e=Zs(t.__v),n=t.o.get(i);return n[0]++,function(r){var o=function(){t.props.revealOrder?(n.push(r),Js(t,i,n)):r()};e?e(o):o()}},Xt.prototype.render=function(i){this.u=null,this.o=new Map;var t=pt(i.children);i.revealOrder&&i.revealOrder[0]==="b"&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return i.children},Xt.prototype.componentDidUpdate=Xt.prototype.componentDidMount=function(){var i=this;this.o.forEach(function(t,e){Js(i,e,t)})};var Qs=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,gd=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,vd=typeof document!="undefined",yd=function(i){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(i)};function $s(i,t,e){return t.__k==null&&(t.textContent=""),bn(i,t),typeof e=="function"&&e(),i?i.__c:null}function ea(i,t,e){return Ms(i,t),typeof e=="function"&&e(),i?i.__c:null}Pe.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(i){Object.defineProperty(Pe.prototype,i,{configurable:!0,get:function(){return this["UNSAFE_"+i]},set:function(t){Object.defineProperty(this,i,{configurable:!0,writable:!0,value:t})}})});var ta=X.event;function wd(){}function bd(){return this.cancelBubble}function Sd(){return this.defaultPrevented}X.event=function(i){return ta&&(i=ta(i)),i.persist=wd,i.isPropagationStopped=bd,i.isDefaultPrevented=Sd,i.nativeEvent=i};var na,ia={configurable:!0,get:function(){return this.class}},ra=X.vnode;X.vnode=function(i){var t=i.type,e=i.props,n=e;if(typeof t=="string"){var r=t.indexOf("-")===-1;for(var o in n={},e){var s=e[o];vd&&o==="children"&&t==="noscript"||o==="value"&&"defaultValue"in e&&s==null||(o==="defaultValue"&&"value"in e&&e.value==null?o="value":o==="download"&&s===!0?s="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+t)&&!yd(e.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp)/.test(o)?o=o.toLowerCase():r&&gd.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():s===null&&(s=void 0),n[o]=s)}t=="select"&&n.multiple&&Array.isArray(n.value)&&(n.value=pt(e.children).forEach(function(a){a.props.selected=n.value.indexOf(a.props.value)!=-1})),t=="select"&&n.defaultValue!=null&&(n.value=pt(e.children).forEach(function(a){a.props.selected=n.multiple?n.defaultValue.indexOf(a.props.value)!=-1:n.defaultValue==a.props.value})),i.props=n,e.class!=e.className&&(ia.enumerable="className"in e,e.className!=null&&(n.class=e.className),Object.defineProperty(n,"className",ia))}i.$$typeof=Qs,ra&&ra(i)};var oa=X.__r;X.__r=function(i){oa&&oa(i),na=i.__c};var sa={ReactCurrentDispatcher:{current:{readContext:function(i){return na.__n[i.__c].props.value}}}},Ed="17.0.2";function aa(i){return Oe.bind(null,i)}function br(i){return!!i&&i.$$typeof===Qs}function la(i){return br(i)?ud.apply(null,arguments):i}function ua(i){return!!i.__k&&(bn(null,i),!0)}function ca(i){return i&&(i.base||i.nodeType===1&&i)||null}var ha=function(i,t){return i(t)},da=function(i,t){return i(t)},xd=nt,k={useState:mt,useReducer:fr,useEffect:kt,useLayoutEffect:pr,useRef:ot,useImperativeHandle:Hs,useMemo:gt,useCallback:st,useContext:En,useDebugValue:zs,version:"17.0.2",Children:Xs,render:$s,hydrate:ea,unmountComponentAtNode:ua,createPortal:wr,createElement:Oe,createContext:Sn,createFactory:aa,cloneElement:la,createRef:ur,Fragment:nt,isValidElement:br,findDOMNode:ca,Component:Pe,PureComponent:xn,memo:js,forwardRef:yr,flushSync:da,unstable_batchedUpdates:ha,StrictMode:nt,Suspense:_n,SuspenseList:Xt,lazy:Ks,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:sa},Sr=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:k,version:Ed,Children:Xs,render:$s,hydrate:ea,unmountComponentAtNode:ua,createPortal:wr,createFactory:aa,cloneElement:la,isValidElement:br,findDOMNode:ca,PureComponent:xn,memo:js,forwardRef:yr,flushSync:da,unstable_batchedUpdates:ha,StrictMode:xd,Suspense:_n,SuspenseList:Xt,lazy:Ks,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:sa,createElement:Oe,createContext:Sn,createRef:ur,Fragment:nt,Component:Pe,useState:mt,useReducer:fr,useEffect:kt,useLayoutEffect:pr,useRef:ot,useImperativeHandle:Hs,useMemo:gt,useCallback:st,useContext:En,useDebugValue:zs,useErrorBoundary:cd}),_t=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function _d(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Er(i){if(i.__esModule)return i;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(i).forEach(function(e){var n=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:function(){return i[e]}})}),t}var xr={exports:{}};function _r(){}_r.prototype={on:function(i,t,e){var n=this.e||(this.e={});return(n[i]||(n[i]=[])).push({fn:t,ctx:e}),this},once:function(i,t,e){var n=this;function r(){n.off(i,r),t.apply(e,arguments)}return r._=t,this.on(i,r,e)},emit:function(i){var t=[].slice.call(arguments,1),e=((this.e||(this.e={}))[i]||[]).slice(),n=0,r=e.length;for(n;n0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window=="undefined")return"";var n=(i=window.document)===null||i===void 0||(t=i.documentElement)===null||t===void 0?void 0:t.style;if(!n||e in n)return"";for(var r=0;r: Unmounted during event!");return t}var ti={},ni={};Object.defineProperty(ni,"__esModule",{value:!0}),ni.default=uf;function uf(){}function ii(i){return ii=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ii(i)}Object.defineProperty(ti,"__esModule",{value:!0}),ti.default=void 0;var Or=hf(Yt),Ye=Rr(Tn.exports),cf=Rr(Yt),Ve=xe,Tt=lt,Dr=at,Cn=Rr(ni);function Rr(i){return i&&i.__esModule?i:{default:i}}function Aa(i){if(typeof WeakMap!="function")return null;var t=new WeakMap,e=new WeakMap;return(Aa=function(r){return r?e:t})(i)}function hf(i,t){if(!t&&i&&i.__esModule)return i;if(i===null||ii(i)!=="object"&&typeof i!="function")return{default:i};var e=Aa(t);if(e&&e.has(i))return e.get(i);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in i)if(o!=="default"&&Object.prototype.hasOwnProperty.call(i,o)){var s=r?Object.getOwnPropertyDescriptor(i,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=i[o]}return n.default=i,e&&e.set(i,n),n}function Oa(i,t){return mf(i)||pf(i,t)||ff(i,t)||df()}function df(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ff(i,t){if(!!i){if(typeof i=="string")return Da(i,t);var e=Object.prototype.toString.call(i).slice(8,-1);if(e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set")return Array.from(i);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Da(i,t)}}function Da(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,n=new Array(t);e not mounted on DragStart!");var u=l.ownerDocument;if(!(n.props.disabled||!(a.target instanceof u.defaultView.Node)||n.props.handle&&!(0,Ve.matchesSelectorAndParentsTo)(a.target,n.props.handle,l)||n.props.cancel&&(0,Ve.matchesSelectorAndParentsTo)(a.target,n.props.cancel,l))){a.type==="touchstart"&&a.preventDefault();var c=(0,Ve.getTouchIdentifier)(a);n.setState({touchIdentifier:c});var h=(0,Tt.getControlPosition)(a,c,Ue(n));if(h!=null){var d=h.x,g=h.y,y=(0,Tt.createCoreData)(Ue(n),d,g);(0,Cn.default)("DraggableCore: handleDragStart: %j",y),(0,Cn.default)("calling",n.props.onStart);var x=n.props.onStart(a,y);x===!1||n.mounted===!1||(n.props.enableUserSelectHack&&(0,Ve.addUserSelectStyles)(u),n.setState({dragging:!0,lastX:d,lastY:g}),(0,Ve.addEvent)(u,Ct.move,n.handleDrag),(0,Ve.addEvent)(u,Ct.stop,n.handleDragStop))}}}),it(Ue(n),"handleDrag",function(a){var l=(0,Tt.getControlPosition)(a,n.state.touchIdentifier,Ue(n));if(l!=null){var u=l.x,c=l.y;if(Array.isArray(n.props.grid)){var h=u-n.state.lastX,d=c-n.state.lastY,g=(0,Tt.snapToGrid)(n.props.grid,h,d),y=Oa(g,2);if(h=y[0],d=y[1],!h&&!d)return;u=n.state.lastX+h,c=n.state.lastY+d}var x=(0,Tt.createCoreData)(Ue(n),u,c);(0,Cn.default)("DraggableCore: handleDrag: %j",x);var b=n.props.onDrag(a,x);if(b===!1||n.mounted===!1){try{n.handleDragStop(new MouseEvent("mouseup"))}catch{var T=document.createEvent("MouseEvents");T.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.handleDragStop(T)}return}n.setState({lastX:u,lastY:c})}}),it(Ue(n),"handleDragStop",function(a){if(!!n.state.dragging){var l=(0,Tt.getControlPosition)(a,n.state.touchIdentifier,Ue(n));if(l!=null){var u=l.x,c=l.y;if(Array.isArray(n.props.grid)){var h=u-n.state.lastX||0,d=c-n.state.lastY||0,g=(0,Tt.snapToGrid)(n.props.grid,h,d),y=Oa(g,2);h=y[0],d=y[1],u=n.state.lastX+h,c=n.state.lastY+d}var x=(0,Tt.createCoreData)(Ue(n),u,c),b=n.props.onStop(a,x);if(b===!1||n.mounted===!1)return!1;var T=n.findDOMNode();T&&n.props.enableUserSelectHack&&(0,Ve.removeUserSelectStyles)(T.ownerDocument),(0,Cn.default)("DraggableCore: handleDragStop: %j",x),n.setState({dragging:!1,lastX:NaN,lastY:NaN}),T&&((0,Cn.default)("DraggableCore: Removing handlers"),(0,Ve.removeEvent)(T.ownerDocument,Ct.move,n.handleDrag),(0,Ve.removeEvent)(T.ownerDocument,Ct.stop,n.handleDragStop))}}}),it(Ue(n),"onMouseDown",function(a){return Ct=rt.mouse,n.handleDragStart(a)}),it(Ue(n),"onMouseUp",function(a){return Ct=rt.mouse,n.handleDragStop(a)}),it(Ue(n),"onTouchStart",function(a){return Ct=rt.touch,n.handleDragStart(a)}),it(Ue(n),"onTouchEnd",function(a){return Ct=rt.touch,n.handleDragStop(a)}),n}return vf(e,[{key:"componentDidMount",value:function(){this.mounted=!0;var r=this.findDOMNode();r&&(0,Ve.addEvent)(r,rt.touch.start,this.onTouchStart,{passive:!1})}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var r=this.findDOMNode();if(r){var o=r.ownerDocument;(0,Ve.removeEvent)(o,rt.mouse.move,this.handleDrag),(0,Ve.removeEvent)(o,rt.touch.move,this.handleDrag),(0,Ve.removeEvent)(o,rt.mouse.stop,this.handleDragStop),(0,Ve.removeEvent)(o,rt.touch.stop,this.handleDragStop),(0,Ve.removeEvent)(r,rt.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Ve.removeUserSelectStyles)(o)}}},{key:"findDOMNode",value:function(){var r,o,s;return(r=this.props)!==null&&r!==void 0&&r.nodeRef?(o=this.props)===null||o===void 0||(s=o.nodeRef)===null||s===void 0?void 0:s.current:cf.default.findDOMNode(this)}},{key:"render",value:function(){return Or.cloneElement(Or.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}]),e}(Or.Component);ti.default=oi,it(oi,"displayName","DraggableCore"),it(oi,"propTypes",{allowAnyClick:Ye.default.bool,disabled:Ye.default.bool,enableUserSelectHack:Ye.default.bool,offsetParent:function(t,e){if(t[e]&&t[e].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:Ye.default.arrayOf(Ye.default.number),handle:Ye.default.string,cancel:Ye.default.string,nodeRef:Ye.default.object,onStart:Ye.default.func,onDrag:Ye.default.func,onStop:Ye.default.func,onMouseDown:Ye.default.func,scale:Ye.default.number,className:Dr.dontSetMe,style:Dr.dontSetMe,transform:Dr.dontSetMe}),it(oi,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(i){function t(F){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(H){return typeof H}:function(H){return H&&typeof Symbol=="function"&&H.constructor===Symbol&&H!==Symbol.prototype?"symbol":typeof H},t(F)}Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"DraggableCore",{enumerable:!0,get:function(){return u.default}}),i.default=void 0;var e=y(Yt),n=d(Tn.exports),r=d(Yt),o=d(Dd),s=xe,a=lt,l=at,u=d(ti),c=d(ni),h=["axis","bounds","children","defaultPosition","defaultClassName","defaultClassNameDragging","defaultClassNameDragged","position","positionOffset","scale"];function d(F){return F&&F.__esModule?F:{default:F}}function g(F){if(typeof WeakMap!="function")return null;var H=new WeakMap,U=new WeakMap;return(g=function(j){return j?U:H})(F)}function y(F,H){if(!H&&F&&F.__esModule)return F;if(F===null||t(F)!=="object"&&typeof F!="function")return{default:F};var U=g(H);if(U&&U.has(F))return U.get(F);var W={},j=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var $ in F)if($!=="default"&&Object.prototype.hasOwnProperty.call(F,$)){var ae=j?Object.getOwnPropertyDescriptor(F,$):null;ae&&(ae.get||ae.set)?Object.defineProperty(W,$,ae):W[$]=F[$]}return W.default=F,U&&U.set(F,W),W}function x(){return x=Object.assign||function(F){for(var H=1;H=0)&&(!Object.prototype.propertyIsEnumerable.call(F,W)||(U[W]=F[W]))}return U}function T(F,H){if(F==null)return{};var U={},W=Object.keys(F),j,$;for($=0;$=0)&&(U[j]=F[j]);return U}function f(F,H){var U=Object.keys(F);if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(F);H&&(W=W.filter(function(j){return Object.getOwnPropertyDescriptor(F,j).enumerable})),U.push.apply(U,W)}return U}function E(F){for(var H=1;HF.length)&&(H=F.length);for(var U=0,W=new Array(H);U, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element."),j}return V(U,[{key:"componentDidMount",value:function(){typeof window.SVGElement!="undefined"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}},{key:"componentWillUnmount",value:function(){this.setState({dragging:!1})}},{key:"findDOMNode",value:function(){var j,$,ae;return(j=($=this.props)===null||$===void 0||(ae=$.nodeRef)===null||ae===void 0?void 0:ae.current)!==null&&j!==void 0?j:r.default.findDOMNode(this)}},{key:"render",value:function(){var j,$=this.props;$.axis,$.bounds;var ae=$.children,we=$.defaultPosition,me=$.defaultClassName,Qe=$.defaultClassNameDragging,$e=$.defaultClassNameDragged,et=$.position,p=$.positionOffset;$.scale;var _=b($,h),R={},N=null,L=Boolean(et),J=!L||this.state.dragging,q=et||we,fe={x:(0,a.canDragX)(this)&&J?this.state.x:q.x,y:(0,a.canDragY)(this)&&J?this.state.y:q.y};this.state.isElementSVG?N=(0,s.createSVGTransform)(fe,p):R=(0,s.createCSSTransform)(fe,p);var Se=(0,o.default)(ae.props.className||"",me,(j={},G(j,Qe,this.state.dragging),G(j,$e,this.state.dragged),j));return e.createElement(u.default,x({},_,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(ae),{className:Se,style:E(E({},ae.props.style),R),transform:N}))}}],[{key:"getDerivedStateFromProps",value:function(j,$){var ae=j.position,we=$.prevPropsPosition;return ae&&(!we||ae.x!==we.x||ae.y!==we.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:ae,prevPropsPosition:we}),{x:ae.x,y:ae.y,prevPropsPosition:E({},ae)}):null}}]),U}(e.Component);i.default=Me,G(Me,"displayName","Draggable"),G(Me,"propTypes",E(E({},u.default.propTypes),{},{axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:l.dontSetMe,style:l.dontSetMe,transform:l.dontSetMe})),G(Me,"defaultProps",E(E({},u.default.defaultProps),{},{axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1}))}(fa);var Ma=fa,Fa=Ma.default,Ef=Ma.DraggableCore;$n.exports=Fa,$n.exports.default=Fa,$n.exports.DraggableCore=Ef;var xf=$n.exports,_f=["second","minute","hour","day","week","month","year"];function Tf(i,t){if(t===0)return["just now","right now"];var e=_f[Math.floor(t/2)];return i>1&&(e+="s"),[i+" "+e+" ago","in "+i+" "+e]}var Cf=["\u79D2","\u5206\u949F","\u5C0F\u65F6","\u5929","\u5468","\u4E2A\u6708","\u5E74"];function Pf(i,t){if(t===0)return["\u521A\u521A","\u7247\u523B\u540E"];var e=Cf[~~(t/2)];return[i+" "+e+"\u524D",i+" "+e+"\u540E"]}var Fr={},_e=function(i,t){Fr[i]=t},ka=function(i){return Fr[i]||Fr.en_US},Bt=[60,60,24,7,365/7/12,12];function La(i){return i instanceof Date?i:!isNaN(i)||/^\d+$/.test(i)?new Date(parseInt(i)):(i=(i||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(i))}function Ba(i,t){var e=i<0?1:0;i=Math.abs(i);for(var n=i,r=0;i>=Bt[r]&&r(r===0?9:1)&&(r+=1),t(i,r,n)[e].replace("%s",i.toString())}function Ia(i,t){var e=t?La(t):new Date;return(+e-+La(i))/1e3}function Af(i){for(var t=1,e=0,n=Math.abs(i);i>=Bt[e]&&e{i.current&&!i.current.contains(event.target)&&t()};kt(()=>(document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)))}var Ua=Object.prototype.toString,Wa=function(t){var e=Ua.call(t),n=e==="[object Arguments]";return n||(n=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Ua.call(t.callee)==="[object Function]"),n},ja;if(!Object.keys){var si=Object.prototype.hasOwnProperty,Ga=Object.prototype.toString,Nf=Wa,qa=Object.prototype.propertyIsEnumerable,Hf=!qa.call({toString:null},"toString"),zf=qa.call(function(){},"prototype"),ai=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Ir=function(i){var t=i.constructor;return t&&t.prototype===i},Vf={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},Uf=function(){if(typeof window=="undefined")return!1;for(var i in window)try{if(!Vf["$"+i]&&si.call(window,i)&&window[i]!==null&&typeof window[i]=="object")try{Ir(window[i])}catch{return!0}}catch{return!0}return!1}(),Wf=function(i){if(typeof window=="undefined"||!Uf)return Ir(i);try{return Ir(i)}catch{return!1}};ja=function(t){var e=t!==null&&typeof t=="object",n=Ga.call(t)==="[object Function]",r=Nf(t),o=e&&Ga.call(t)==="[object String]",s=[];if(!e&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var a=zf&&n;if(o&&t.length>0&&!si.call(t,0))for(var l=0;l0)for(var u=0;u1&&typeof e!="boolean")throw new Jt('"allowMissing" argument must be a boolean');if(cp(/^%?[^%]*%?$/,t)===null)throw new Kt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=fp(t),r=n.length>0?n[0]:"",o=pp("%"+r+"%",e),s=o.name,a=o.value,l=!1,u=o.alias;u&&(r=u[0],up(n,lp([0,1],u)));for(var c=1,h=!0;c=n.length){var x=It(a,d);h=!!x,h&&"get"in x&&!("originalValue"in x.get)?a=x.get:a=a[d]}else h=ui(a,d),a=a[d];h&&!l&&(Nt[s]=a)}}return a},mp=Be,Ur=mp("%Object.defineProperty%",!0),Wr=function(){if(Ur)try{return Ur({},"a",{value:1}),!0}catch{return!1}return!1};Wr.hasArrayLengthDefineBug=function(){if(!Wr())return null;try{return Ur([],"length",{value:1}).length!==1}catch{return!0}};var gp=Wr,vp=Xf,yp=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",wp=Object.prototype.toString,bp=Array.prototype.concat,il=Object.defineProperty,Sp=function(i){return typeof i=="function"&&wp.call(i)==="[object Function]"},Ep=gp(),rl=il&&Ep,xp=function(i,t,e,n){if(t in i){if(n===!0){if(i[t]===e)return}else if(!Sp(n)||!n())return}rl?il(i,t,{configurable:!0,enumerable:!1,value:e,writable:!0}):i[t]=e},ol=function(i,t){var e=arguments.length>2?arguments[2]:{},n=vp(t);yp&&(n=bp.call(n,Object.getOwnPropertySymbols(t)));for(var r=0;r-1?al(n):n},Tp=Be,Cp=Tp("%TypeError%"),Pp=function(t,e){if(t==null)throw new Cp(e||"Cannot call method on "+t);return t},On=Pp,Ap=Be,ll=Ap("%Array%"),Op=!ll.isArray&&vt("Object.prototype.toString"),Dp=ll.isArray||function(t){return Op(t)==="[object Array]"},Rp=Dp,ul=Be,Mp=vt,Fp=ul("%TypeError%"),kp=Rp,Lp=ul("%Reflect.apply%",!0)||Mp("Function.prototype.apply"),Bp=function(t,e){var n=arguments.length>2?arguments[2]:[];if(!kp(n))throw new Fp("Assertion failed: optional `argumentsList`, if provided, must be a List");return Lp(t,e,n)},Ip={},Np=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:Ip}),Hp=Er(Np),jr=typeof Map=="function"&&Map.prototype,Gr=Object.getOwnPropertyDescriptor&&jr?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,hi=jr&&Gr&&typeof Gr.get=="function"?Gr.get:null,cl=jr&&Map.prototype.forEach,qr=typeof Set=="function"&&Set.prototype,Xr=Object.getOwnPropertyDescriptor&&qr?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,di=qr&&Xr&&typeof Xr.get=="function"?Xr.get:null,hl=qr&&Set.prototype.forEach,zp=typeof WeakMap=="function"&&WeakMap.prototype,Dn=zp?WeakMap.prototype.has:null,Vp=typeof WeakSet=="function"&&WeakSet.prototype,Rn=Vp?WeakSet.prototype.has:null,Up=typeof WeakRef=="function"&&WeakRef.prototype,dl=Up?WeakRef.prototype.deref:null,Wp=Boolean.prototype.valueOf,jp=Object.prototype.toString,Gp=Function.prototype.toString,qp=String.prototype.match,Yr=String.prototype.slice,Pt=String.prototype.replace,Xp=String.prototype.toUpperCase,fl=String.prototype.toLowerCase,pl=RegExp.prototype.test,ml=Array.prototype.concat,ut=Array.prototype.join,Yp=Array.prototype.slice,gl=Math.floor,Zr=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Kr=Object.getOwnPropertySymbols,Jr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,tn=typeof Symbol=="function"&&typeof Symbol.iterator=="object",We=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===tn?"object":"symbol")?Symbol.toStringTag:null,vl=Object.prototype.propertyIsEnumerable,yl=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(i){return i.__proto__}:null);function wl(i,t){if(i===1/0||i===-1/0||i!==i||i&&i>-1e3&&i<1e3||pl.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof i=="number"){var n=i<0?-gl(-i):gl(i);if(n!==i){var r=String(n),o=Yr.call(t,r.length+1);return Pt.call(r,e,"$&_")+"."+Pt.call(Pt.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Pt.call(t,e,"$&_")}var Qr=Hp,bl=Qr.custom,Sl=_l(bl)?bl:null,Zp=function i(t,e,n,r){var o=e||{};if(At(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(At(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=At(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(At(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(At(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof t=="undefined")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return Cl(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var l=String(t);return a?wl(t,l):l}if(typeof t=="bigint"){var u=String(t)+"n";return a?wl(t,u):u}var c=typeof o.depth=="undefined"?5:o.depth;if(typeof n=="undefined"&&(n=0),n>=c&&c>0&&typeof t=="object")return $r(t)?"[Array]":"[Object]";var h=fm(o,n);if(typeof r=="undefined")r=[];else if(Tl(r,t)>=0)return"[Circular]";function d(K,Q,le){if(Q&&(r=Yp.call(r),r.push(Q)),le){var re={depth:o.depth};return At(o,"quoteStyle")&&(re.quoteStyle=o.quoteStyle),i(K,re,n+1,r)}return i(K,o,n+1,r)}if(typeof t=="function"&&!xl(t)){var g=rm(t),y=fi(t,d);return"[Function"+(g?": "+g:" (anonymous)")+"]"+(y.length>0?" { "+ut.call(y,", ")+" }":"")}if(_l(t)){var x=tn?Pt.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Jr.call(t);return typeof t=="object"&&!tn?Mn(x):x}if(cm(t)){for(var b="<"+fl.call(String(t.nodeName)),T=t.attributes||[],f=0;f",b}if($r(t)){if(t.length===0)return"[]";var E=fi(t,d);return h&&!dm(E)?"["+to(E,h)+"]":"[ "+ut.call(E,", ")+" ]"}if(Qp(t)){var A=fi(t,d);return!("cause"in Error.prototype)&&"cause"in t&&!vl.call(t,"cause")?"{ ["+String(t)+"] "+ut.call(ml.call("[cause]: "+d(t.cause),A),", ")+" }":A.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+ut.call(A,", ")+" }"}if(typeof t=="object"&&s){if(Sl&&typeof t[Sl]=="function"&&Qr)return Qr(t,{depth:c-n});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(om(t)){var C=[];return cl&&cl.call(t,function(K,Q){C.push(d(Q,t,!0)+" => "+d(K,t))}),Pl("Map",hi.call(t),C,h)}if(lm(t)){var O=[];return hl&&hl.call(t,function(K){O.push(d(K,t))}),Pl("Set",di.call(t),O,h)}if(sm(t))return eo("WeakMap");if(um(t))return eo("WeakSet");if(am(t))return eo("WeakRef");if(em(t))return Mn(d(Number(t)));if(nm(t))return Mn(d(Zr.call(t)));if(tm(t))return Mn(Wp.call(t));if($p(t))return Mn(d(String(t)));if(!Jp(t)&&!xl(t)){var D=fi(t,d),I=yl?yl(t)===Object.prototype:t instanceof Object||t.constructor===Object,B=t instanceof Object?"":"null prototype",Z=!I&&We&&Object(t)===t&&We in t?Yr.call(Ot(t),8,-1):B?"Object":"",Y=I||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",V=Y+(Z||B?"["+ut.call(ml.call([],Z||[],B||[]),": ")+"] ":"");return D.length===0?V+"{}":h?V+"{"+to(D,h)+"}":V+"{ "+ut.call(D,", ")+" }"}return String(t)};function El(i,t,e){var n=(e.quoteStyle||t)==="double"?'"':"'";return n+i+n}function Kp(i){return Pt.call(String(i),/"/g,""")}function $r(i){return Ot(i)==="[object Array]"&&(!We||!(typeof i=="object"&&We in i))}function Jp(i){return Ot(i)==="[object Date]"&&(!We||!(typeof i=="object"&&We in i))}function xl(i){return Ot(i)==="[object RegExp]"&&(!We||!(typeof i=="object"&&We in i))}function Qp(i){return Ot(i)==="[object Error]"&&(!We||!(typeof i=="object"&&We in i))}function $p(i){return Ot(i)==="[object String]"&&(!We||!(typeof i=="object"&&We in i))}function em(i){return Ot(i)==="[object Number]"&&(!We||!(typeof i=="object"&&We in i))}function tm(i){return Ot(i)==="[object Boolean]"&&(!We||!(typeof i=="object"&&We in i))}function _l(i){if(tn)return i&&typeof i=="object"&&i instanceof Symbol;if(typeof i=="symbol")return!0;if(!i||typeof i!="object"||!Jr)return!1;try{return Jr.call(i),!0}catch{}return!1}function nm(i){if(!i||typeof i!="object"||!Zr)return!1;try{return Zr.call(i),!0}catch{}return!1}var im=Object.prototype.hasOwnProperty||function(i){return i in this};function At(i,t){return im.call(i,t)}function Ot(i){return jp.call(i)}function rm(i){if(i.name)return i.name;var t=qp.call(Gp.call(i),/^function\s*([\w$]+)/);return t?t[1]:null}function Tl(i,t){if(i.indexOf)return i.indexOf(t);for(var e=0,n=i.length;et.maxStringLength){var e=i.length-t.maxStringLength,n="... "+e+" more character"+(e>1?"s":"");return Cl(Yr.call(i,0,t.maxStringLength),t)+n}var r=Pt.call(Pt.call(i,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,hm);return El(r,"single",t)}function hm(i){var t=i.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+Xp.call(t.toString(16))}function Mn(i){return"Object("+i+")"}function eo(i){return i+" { ? }"}function Pl(i,t,e,n){var r=n?to(e,n):ut.call(e,", ");return i+" ("+t+") {"+r+"}"}function dm(i){for(var t=0;t=0)return!1;return!0}function fm(i,t){var e;if(i.indent===" ")e=" ";else if(typeof i.indent=="number"&&i.indent>0)e=ut.call(Array(i.indent+1)," ");else return null;return{base:e,prev:ut.call(Array(t+1),e)}}function to(i,t){if(i.length===0)return"";var e=` -`+t.prev+t.base;return e+ut.call(i,","+e)+` -`+t.prev}function fi(i,t){var e=$r(i),n=[];if(e){n.length=i.length;for(var r=0;r1&&(arguments[1]===String?e="string":arguments[1]===Number&&(e="number"));var n;if(rg&&(Symbol.toPrimitive?n=ag(t,Symbol.toPrimitive):Bl(t)&&(n=Symbol.prototype.valueOf)),typeof n!="undefined"){var r=n.call(t,e);if(lo(r))return r;throw new TypeError("unable to convert exotic object to primitive")}return e==="default"&&(og(t)||Bl(t))&&(e="string"),sg(t,e==="default"?"number":e)},Il=lg,ug=function(t){return arguments.length>1?Il(t,arguments[1]):Il(t)},uo=vt,Nl=so(),Hl,zl,co,ho;if(Nl){Hl=uo("Object.prototype.hasOwnProperty"),zl=uo("RegExp.prototype.exec"),co={};var fo=function(){throw co};ho={toString:fo,valueOf:fo},typeof Symbol.toPrimitive=="symbol"&&(ho[Symbol.toPrimitive]=fo)}var cg=uo("Object.prototype.toString"),hg=Object.getOwnPropertyDescriptor,dg="[object RegExp]",fg=Nl?function(t){if(!t||typeof t!="object")return!1;var e=hg(t,"lastIndex"),n=e&&Hl(e,"value");if(!n)return!1;try{zl(t,ho)}catch(r){return r===co}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:cg(t)===dg},pg=vt,mg=Be,gg=fg,vg=pg("RegExp.prototype.exec"),yg=mg("%TypeError%"),wg=function(t){if(!gg(t))throw new yg("`regex` must be a RegExp");return function(n){return vg(t,n)!==null}},Vl=Be,bg=Vl("%String%"),Sg=Vl("%TypeError%"),Ul=function(t){if(typeof t=="symbol")throw new Sg("Cannot convert a Symbol value to a string");return bg(t)},Eg=On,xg=Ul,_g=vt,Wl=_g("String.prototype.replace"),jl=/^\s$/.test("\u180E"),Tg=jl?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,Cg=jl?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/,Gl=function(){var t=xg(Eg(this));return Wl(Wl(t,Tg,""),Cg,"")},Pg=Gl,ql="\u200B",rn="\u180E",Xl=function(){return String.prototype.trim&&ql.trim()===ql&&rn.trim()===rn&&("_"+rn).trim()==="_"+rn&&(rn+"_").trim()===rn+"_"?String.prototype.trim:Pg},Ag=en,Og=Xl,Dg=function(){var t=Og();return Ag(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t},Rg=An.exports,Mg=en,Fg=On,kg=Gl,Yl=Xl,Lg=Dg,Bg=Rg(Yl()),Zl=function(t){return Fg(t),Bg(t)};Mg(Zl,{getPolyfill:Yl,implementation:kg,shim:Lg});var Kl=Zl,gi=Be,po=gi("%Number%"),Ig=gi("%RegExp%"),Ng=gi("%TypeError%"),Jl=gi("%parseInt%"),Hg=vt,vi=wg,Ql=Hg("String.prototype.slice"),zg=vi(/^0b[01]+$/i),Vg=vi(/^0o[0-7]+$/i),Ug=vi(/^[-+]0x[0-9a-f]+$/i),Wg=["\x85","\u200B","\uFFFE"].join(""),jg=new Ig("["+Wg+"]","g"),Gg=vi(jg),qg=Kl,Xg=Fn,Yg=function i(t){if(Xg(t)!=="String")throw new Ng("Assertion failed: `argument` is not a String");if(zg(t))return po(Jl(Ql(t,2),2));if(Vg(t))return po(Jl(Ql(t,2),8));if(Gg(t)||Ug(t))return NaN;var e=qg(t);return e!==t?i(e):po(t)},$l=Be,eu=$l("%TypeError%"),tu=$l("%Number%"),Zg=jm,Kg=ug,Jg=Yg,Qg=function(t){var e=Zg(t)?t:Kg(t,tu);if(typeof e=="symbol")throw new eu("Cannot convert a Symbol value to a number");if(typeof e=="bigint")throw new eu("Conversion from 'BigInt' to 'number' is not allowed.");return typeof e=="string"?Jg(e):tu(e)},nu=Number.isNaN||function(t){return t!==t},$g=nu,ev=function(i){return(typeof i=="number"||typeof i=="bigint")&&!$g(i)&&i!==1/0&&i!==-1/0},tv=function(t){return t>=0?1:-1},nv=zm,iv=Wm,rv=Qg,ov=nu,sv=ev,av=tv,lv=function(t){var e=rv(t);if(ov(e)||e===0)return 0;if(!sv(e))return e;var n=iv(nv(e));return n===0?0:av(e)*n},iu=Im,uv=lv,cv=function(t){var e=uv(t);return e<=0?0:e>iu?iu:e},hv=Be,dv=hv("%TypeError%"),fv=Dl,pv=cv,mv=Fn,gv=function(t){if(mv(t)!=="Object")throw new dv("Assertion failed: `obj` must be an Object");return pv(fv(t,"length"))},vv=Be,yv=vv("%Object%"),wv=On,bv=function(t){return wv(t),yv(t)},Sv=String.prototype.valueOf,Ev=function(t){try{return Sv.call(t),!0}catch{return!1}},xv=Object.prototype.toString,_v="[object String]",Tv=so(),Cv=function(t){return typeof t=="string"?!0:typeof t!="object"?!1:Tv?Ev(t):xv.call(t)===_v},Pv=Be,Av=vt,Ov=Pv("%TypeError%"),Dv=Bp,Rv=Dl,Mv=xm,Fv=km,kv=gv,Lv=bv,Bv=Ul,Iv=Cv,Nv=Av("String.prototype.split"),ru=Object("a"),Hv=ru[0]!=="a"||!(0 in ru),ou=function(t){var e=Lv(this),n=Hv&&Iv(this)?Nv(this,""):e,r=kv(n);if(!Fv(t))throw new Ov("Array.prototype.forEach callback must be a function");var o;arguments.length>1&&(o=arguments[1]);for(var s=0;s=12&&t<=14)?1:2},vu={pluralTypes:{arabic:function(i){if(i<3)return i;var t=i%100;return t>=3&&t<=10?3:t>=11?4:5},bosnian_serbian:go,chinese:function(){return 0},croatian:go,french:function(i){return i>=2?1:0},german:function(i){return i!==1?1:0},russian:go,lithuanian:function(i){return i%10===1&&i%100!==11?0:i%10>=2&&i%10<=9&&(i%100<11||i%100>19)?1:2},czech:function(i){return i===1?0:i>=2&&i<=4?1:2},polish:function(i){if(i===1)return 0;var t=i%10;return 2<=t&&t<=4&&(i%100<10||i%100>=20)?1:2},icelandic:function(i){return i%10!==1||i%100===11?1:0},slovenian:function(i){var t=i%100;return t===1?0:t===2?1:t===3||t===4?2:3},romanian:function(i){if(i===1)return 0;var t=i%100;return i===0||t>=2&&t<=19?1:2}},pluralTypeToLanguages:{arabic:["ar"],bosnian_serbian:["bs-Latn-BA","bs-Cyrl-BA","srl-RS","sr-RS"],chinese:["id","id-ID","ja","ko","ko-KR","lo","ms","th","th-TH","zh"],croatian:["hr","hr-HR"],german:["fa","da","de","en","es","fi","el","he","hi-IN","hu","hu-HU","it","nl","no","pt","sv","tr"],french:["fr","tl","pt-br"],russian:["ru","ru-RU"],lithuanian:["lt"],czech:["cs","cs-CZ","sk"],polish:["pl"],icelandic:["is","mk"],slovenian:["sl-SL"],romanian:["ro"]}};function gy(i){var t={};return yi(mo(i),function(e){var n=e[0],r=e[1];yi(r,function(o){t[o]=n})}),t}function vy(i,t){var e=gy(i.pluralTypeToLanguages);return e[t]||e[gu.call(t,/-/,1)[0]]||e.en}function yy(i,t,e){return i.pluralTypes[t](e)}function wy(){var i={};return function(t,e){var n=i[e];return n&&!t.pluralTypes[n]&&(n=null,i[e]=n),n||(n=vy(t,e),n&&(i[e]=n)),n}}function yu(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function by(i){var t=i&&i.prefix||"%{",e=i&&i.suffix||"}";if(t===wi||e===wi)throw new RangeError('"'+wi+'" token is reserved for pluralization');return new RegExp(yu(t)+"(.*?)"+yu(e),"g")}var Sy=wy(),Ey=/%\{(.*?)\}/g;function vo(i,t,e,n,r,o){if(typeof i!="string")throw new TypeError("Polyglot.transformPhrase expects argument #1 to be string");if(t==null)return i;var s=i,a=n||Ey,l=o||mu,u=typeof t=="number"?{smart_count:t}:t;if(u.smart_count!=null&&i){var c=r||vu,h=gu.call(i,wi),d=e||"en",g=Sy(c,d),y=yy(c,g,u.smart_count);s=py(h[y]||h[0])}return s=l.call(s,a,function(x,b){return!pu(u,b)||u[b]==null?x:u[b]}),s}function yt(i){var t=i||{};this.phrases={},this.extend(t.phrases||{}),this.currentLocale=t.locale||"en";var e=t.allowMissing?vo:null;this.onMissingKey=typeof t.onMissingKey=="function"?t.onMissingKey:e,this.warn=t.warn||my,this.replaceImplementation=t.replace||mu,this.tokenRegex=by(t.interpolation),this.pluralRules=t.pluralRules||vu}yt.prototype.locale=function(i){return i&&(this.currentLocale=i),this.currentLocale},yt.prototype.extend=function(i,t){yi(mo(i||{}),function(e){var n=e[0],r=e[1],o=t?t+"."+n:n;typeof r=="object"?this.extend(r,o):this.phrases[o]=r},this)},yt.prototype.unset=function(i,t){typeof i=="string"?delete this.phrases[i]:yi(mo(i||{}),function(e){var n=e[0],r=e[1],o=t?t+"."+n:n;typeof r=="object"?this.unset(r,o):delete this.phrases[o]},this)},yt.prototype.clear=function(){this.phrases={}},yt.prototype.replace=function(i){this.clear(),this.extend(i)},yt.prototype.t=function(i,t){var e,n,r=t==null?{}:t;if(typeof this.phrases[i]=="string")e=this.phrases[i];else if(typeof r._=="string")e=r._;else if(this.onMissingKey){var o=this.onMissingKey;n=o(i,r,this.currentLocale,this.tokenRegex,this.pluralRules,this.replaceImplementation)}else this.warn('Missing translation for key: "'+i+'"'),n=i;return typeof e=="string"&&(n=vo(e,r,this.currentLocale,this.tokenRegex,this.pluralRules,this.replaceImplementation)),n},yt.prototype.has=function(i){return pu(this.phrases,i)},yt.transformPhrase=function(t,e,n){return vo(t,e,n)};var xy=yt,_y={"Add a comment...":"\u0625\u0636\u0627\u0641\u0629 \u062A\u0639\u0644\u064A\u0642","Add a reply...":"\u0625\u0636\u0627\u0641\u0629 \u0631\u062F","Add tag...":"\u0625\u0636\u0627\u0641\u0629 \u0639\u0644\u0627\u0645\u0629",Cancel:"\u0625\u0644\u063A\u0627\u0621",Close:"\u0625\u063A\u0644\u0627\u0642",Edit:"Edit",Delete:"Delete",Ok:"\u062A\u0645"},Ty={"Add a comment...":"Napsat koment\xE1\u0159...","Add a reply...":"Odpov\u011Bd\u011Bt...","Add tag...":"P\u0159idat \u0161t\xEDtek...",Cancel:"Zru\u0161it",Close:"Zav\u0159\xEDt",Edit:"Upravit",Delete:"Smazat",Ok:"Ok"},Cy={"Add a comment...":"Kommentar schreiben...","Add a reply...":"Antwort schreiben...","Add tag...":"Tag...",Cancel:"Abbrechen",Close:"Schliessen",Edit:"Bearbeiten",Delete:"L\xF6schen",Ok:"Ok"},Py={"Add a comment...":"\u03A3\u03C7\u03BF\u03BB\u03AF\u03B1\u03C3\u03B5...","Add a reply...":"\u0391\u03C0\u03AC\u03BD\u03C4\u03B7\u03C3\u03B5...","Add tag...":"\u03A0\u03C1\u03CC\u03C3\u03B8\u03B5\u03C3\u03B5 tag...",Cancel:"\u0386\u03BA\u03C5\u03C1\u03BF",Close:"\u039A\u03BB\u03B5\u03AF\u03C3\u03B9\u03BC\u03BF",Edit:"\u0395\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1",Delete:"\u0394\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE",Ok:"Ok"},Ay={"Add a comment...":"Agregar un comentario...","Add a reply...":"Agregar una respuesta...","Add tag...":"Etiquetar...",Cancel:"Cancelar",Close:"Cerrar",Edit:"Editar",Delete:"Eliminar",Ok:"Ok"},Oy={"Add a comment...":"Lis\xE4\xE4 kommentti","Add a reply...":"Lis\xE4\xE4 vastaus","Add tag...":"Lis\xE4\xE4 tunniste",Cancel:"Peruuta",Close:"Sulje",Edit:"Muokkaa",Delete:"Poista",Ok:"Ok"},Dy={"Add a comment...":"Ajouter un commentaire...","Add a reply...":"Ajouter une r\xE9ponse...","Add tag...":"Ajouter une \xE9tiquette...",Cancel:"Annuler",Close:"Fermer",Edit:"\xC9diter",Delete:"Supprimer",Ok:"Ok"},Ry={"Add a comment...":"Engadir un comentario...","Add a reply...":"Engadir unha resposta...","Add tag...":"Etiquetar...",Cancel:"Cancelar",Close:"Pechar",Edit:"Edit",Delete:"Delete",Ok:"Ok"},My={"Add a comment...":"\u091F\u093F\u092A\u094D\u092A\u0923\u0940 \u091C\u094B\u0921\u093C\u0947\u0902","Add a reply...":"\u091C\u0935\u093E\u092C \u0926\u0947\u0902","Add tag...":"\u091F\u0948\u0917 \u0932\u0917\u093E\u090F\u0901",Cancel:"\u0930\u0926\u094D\u0926 \u0915\u0930\u0947\u0902",Close:"\u092C\u0902\u0926 \u0915\u0930\u0947\u0902",Edit:"\u0938\u0902\u092A\u093E\u0926\u093F\u0924 \u0915\u0930\u0947\u0902",Delete:"\u0939\u091F\u093E\u090F\u0901",Ok:"\u0920\u0940\u0915 \u0939\u0948"},Fy={"Add a comment...":"Commenta...","Add a reply...":"Rispondi...","Add tag...":"Aggiungi tag...",Cancel:"Annulla",Close:"Chiudi",Edit:"Edit",Delete:"Delete",Ok:"Ok"},ky={"Add a comment...":"\u30B3\u30E1\u30F3\u30C8\u3092\u8FFD\u52A0\u3059\u308B...","Add a reply...":"\u8FD4\u4FE1\u3059\u308B...","Add tag...":"\u30BF\u30B0\u3092\u8FFD\u52A0\u3059\u308B...",Cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",Close:"\u9589\u3058\u308B",Edit:"\u7DE8\u96C6",Delete:"\u524A\u9664",Ok:"Ok"},Ly={"Add a comment...":"\uB313\uAE00 \uCD94\uAC00","Add a reply...":"\uB2F5\uAE00 \uCD94\uAC00","Add tag...":"\uD0DC\uADF8 \uCD94\uAC00",Cancel:"\uCDE8\uC18C",Close:"\uB2EB\uAE30",Edit:"\uC218\uC815",Delete:"\uC0AD\uC81C",Ok:"\uD655\uC778"},By={"Add a comment...":"Commentaar toevoegen...","Add a reply...":"Antwoord toevoegen...","Add tag...":"Tag toevoegen...",Cancel:"Afbreken",Close:"Sluiten",Edit:"Bewerken",Delete:"Verwijderen",Ok:"Ok"},Iy={"Add a comment...":"Adicionar um coment\xE1rio...","Add a reply...":"Adicionar uma resposta...","Add tag...":"Etiquetar...",Cancel:"Cancelar",Close:"Fechar",Edit:"Editar",Delete:"Apagar",Ok:"Ok"},Ny={"Add a comment...":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439...","Add a reply...":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043E\u0442\u0432\u0435\u0442...","Add tag...":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0442\u044D\u0433...",Cancel:"\u041E\u0442\u043C\u0435\u043D\u0430",Close:"\u0417\u0430\u043A\u0440\u044B\u0442\u044C",Edit:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C",Delete:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C",Ok:"\u041E\u043A"},Hy={"Add a comment...":"Skriv en kommentar...","Add a reply...":"Skriv ett svar...","Add tag...":"Tagg...",Cancel:"Cancel",Close:"St\xE4ng",Edit:"Edit",Delete:"Delete",Ok:"Ok"},zy={"Add a comment...":"\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E04\u0E2D\u0E21\u0E40\u0E21\u0E19\u0E15\u0E4C...","Add a reply...":"\u0E15\u0E2D\u0E1A\u0E01\u0E25\u0E31\u0E1A...","Add tag...":"\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E41\u0E17\u0E47\u0E01...",Cancel:"\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01",Close:"\u0E1B\u0E34\u0E14",Edit:"\u0E41\u0E01\u0E49\u0E44\u0E02",Delete:"\u0E25\u0E1A",Ok:"\u0E15\u0E01\u0E25\u0E07"},Vy={"Add a comment...":"Yorum ekle...","Add a reply...":"Cevap ekle...","Add tag...":"Tag Ekle...",Cancel:"\u0130ptal",Close:"Kapat",Edit:"D\xFCzenle",Delete:"Sil",Ok:"Tamam"},Uy={"Add a comment...":"\u062A\u0628\u0635\u0631\u06C1 \u06A9\u0631\u06CC\u06BA","Add a reply...":"\u062C\u0648\u0627\u0628 \u062F\u06CC\u06BA","Add tag...":"\u0679\u06CC\u06AF \u0644\u06AF\u0627\u0626\u06CC\u06BA",Cancel:"\u0645\u0646\u0633\u0648\u062E \u06A9\u0631\u06CC\u06BA",Close:"\u0628\u0646\u062F \u06A9\u0631\u06CC\u06BA",Edit:"\u062A\u0631\u0645\u06CC\u0645 \u06A9\u0631\u06CC\u06BA",Delete:"\u06C1\u0679\u0627\u0626\u06CC\u06BA",Ok:"\u0679\u06BE\u06CC\u06A9 \u06C1\u06D2"},Wy={"Add a comment...":"\u6DFB\u52A0\u8BC4\u8BBA...","Add a reply...":"\u6DFB\u52A0\u56DE\u590D...","Add tag...":"\u6DFB\u52A0\u6807\u7B7E...",Cancel:"\u53D6\u6D88",Close:"\u5173\u95ED",Edit:"\u7F16\u8F91",Delete:"\u5220\u9664",Ok:"\u786E\u8BA4"},jy={"Add a comment...":"\u6DFB\u52A0\u8A55\u8AD6...","Add a reply...":"\u6DFB\u52A0\u56DE\u8986...","Add tag...":"\u6DFB\u52A0\u6A19\u7C64...",Cancel:"\u53D6\u6D88",Close:"\u95DC\u9589",Edit:"\u7DE8\u8F2F",Delete:"\u522A\u9664",Ok:"\u78BA\u8A8D"},wu={};Object.defineProperty(wu,"__esModule",{value:!0});var yo=[["\u062B\u0627\u0646\u064A\u0629","\u062B\u0627\u0646\u064A\u062A\u064A\u0646","%s \u062B\u0648\u0627\u0646","%s \u062B\u0627\u0646\u064A\u0629"],["\u062F\u0642\u064A\u0642\u0629","\u062F\u0642\u064A\u0642\u062A\u064A\u0646","%s \u062F\u0642\u0627\u0626\u0642","%s \u062F\u0642\u064A\u0642\u0629"],["\u0633\u0627\u0639\u0629","\u0633\u0627\u0639\u062A\u064A\u0646","%s \u0633\u0627\u0639\u0627\u062A","%s \u0633\u0627\u0639\u0629"],["\u064A\u0648\u0645","\u064A\u0648\u0645\u064A\u0646","%s \u0623\u064A\u0627\u0645","%s \u064A\u0648\u0645\u0627\u064B"],["\u0623\u0633\u0628\u0648\u0639","\u0623\u0633\u0628\u0648\u0639\u064A\u0646","%s \u0623\u0633\u0627\u0628\u064A\u0639","%s \u0623\u0633\u0628\u0648\u0639\u0627\u064B"],["\u0634\u0647\u0631","\u0634\u0647\u0631\u064A\u0646","%s \u0623\u0634\u0647\u0631","%s \u0634\u0647\u0631\u0627\u064B"],["\u0639\u0627\u0645","\u0639\u0627\u0645\u064A\u0646","%s \u0623\u0639\u0648\u0627\u0645","%s \u0639\u0627\u0645\u0627\u064B"]];function Gy(i,t){return t<3?yo[i][t-1]:t>=3&&t<=10?yo[i][2]:yo[i][3]}function qy(i,t){if(t===0)return["\u0645\u0646\u0630 \u0644\u062D\u0638\u0627\u062A","\u0628\u0639\u062F \u0644\u062D\u0638\u0627\u062A"];var e=Gy(Math.floor(t/2),i);return["\u0645\u0646\u0630 "+e,"\u0628\u0639\u062F "+e]}var Xy=wu.default=qy,bu={};Object.defineProperty(bu,"__esModule",{value:!0});function Yy(i,t){var e=0,n=t==1||t==3||t==5||t==7||t==9||t==11||t==13;return n&&i>=5&&(e=1),[[["pr\xE1v\u011B te\u010F","pr\xE1v\u011B te\u010F"]],[["p\u0159ed %s vte\u0159inami","za %s vte\u0159iny"],["p\u0159ed %s vte\u0159inami","za %s vte\u0159in"]],[["p\u0159ed minutou","za minutu"]],[["p\u0159ed %s minutami","za %s minuty"],["p\u0159ed %s minutami","za %s minut"]],[["p\u0159ed hodinou","za hodinu"]],[["p\u0159ed %s hodinami","za %s hodiny"],["p\u0159ed %s hodinami","za %s hodin"]],[["v\u010Dera","z\xEDtra"]],[["p\u0159ed %s dny","za %s dny"],["p\u0159ed %s dny","za %s dn\u016F"]],[["minul\xFD t\xFDden","p\u0159\xED\u0161t\xED t\xFDden"]],[["p\u0159ed %s t\xFDdny","za %s t\xFDdny"],["p\u0159ed %s t\xFDdny","za %s t\xFDdn\u016F"]],[["minul\xFD m\u011Bs\xEDc","p\u0159\xEDst\xED m\u011Bs\xEDc"]],[["p\u0159ed %s m\u011Bs\xEDci","za %s m\u011Bs\xEDce"],["p\u0159ed %s m\u011Bs\xEDci","za %s m\u011Bs\xEDc\u016F"]],[["p\u0159ed rokem","p\u0159\xEDst\xED rok"]],[["p\u0159ed %s lety","za %s roky"],["p\u0159ed %s lety","za %s let"]]][t][e]}var Zy=bu.default=Yy,Su={};Object.defineProperty(Su,"__esModule",{value:!0});function Ky(i,t){return[["gerade eben","vor einer Weile"],["vor %s Sekunden","in %s Sekunden"],["vor 1 Minute","in 1 Minute"],["vor %s Minuten","in %s Minuten"],["vor 1 Stunde","in 1 Stunde"],["vor %s Stunden","in %s Stunden"],["vor 1 Tag","in 1 Tag"],["vor %s Tagen","in %s Tagen"],["vor 1 Woche","in 1 Woche"],["vor %s Wochen","in %s Wochen"],["vor 1 Monat","in 1 Monat"],["vor %s Monaten","in %s Monaten"],["vor 1 Jahr","in 1 Jahr"],["vor %s Jahren","in %s Jahren"]][t]}var Jy=Su.default=Ky,Eu={};Object.defineProperty(Eu,"__esModule",{value:!0});function Qy(i,t){return[["\u03BC\u03CC\u03BB\u03B9\u03C2 \u03C4\u03CE\u03C1\u03B1","\u03C3\u03B5 \u03BB\u03AF\u03B3\u03BF"],["%s \u03B4\u03B5\u03C5\u03C4\u03B5\u03C1\u03CC\u03BB\u03B5\u03C0\u03C4\u03B1 \u03C0\u03C1\u03B9\u03BD","\u03C3\u03B5 %s \u03B4\u03B5\u03C5\u03C4\u03B5\u03C1\u03CC\u03BB\u03B5\u03C0\u03C4\u03B1"],["1 \u03BB\u03B5\u03C0\u03C4\u03CC \u03C0\u03C1\u03B9\u03BD","\u03C3\u03B5 1 \u03BB\u03B5\u03C0\u03C4\u03CC"],["%s \u03BB\u03B5\u03C0\u03C4\u03AC \u03C0\u03C1\u03B9\u03BD","\u03C3\u03B5 %s \u03BB\u03B5\u03C0\u03C4\u03AC"],["1 \u03CE\u03C1\u03B1 \u03C0\u03C1\u03B9\u03BD","\u03C3\u03B5 1 \u03CE\u03C1\u03B1"],["%s \u03CE\u03C1\u03B5\u03C2 \u03C0\u03C1\u03B9\u03BD","\u03C3\u03B5 %s \u03CE\u03C1\u03B5\u03C2"],["1 \u03BC\u03AD\u03C1\u03B1 \u03C0\u03C1\u03B9\u03BD","\u03C3\u03B5 1 \u03BC\u03AD\u03C1\u03B1"],["%s \u03BC\u03AD\u03C1\u03B5\u03C2 \u03C0\u03C1\u03B9\u03BD","\u03C3\u03B5 %s \u03BC\u03AD\u03C1\u03B5\u03C2"],["1 \u03B5\u03B2\u03B4\u03BF\u03BC\u03AC\u03B4\u03B1 \u03C0\u03C1\u03B9\u03BD","\u03C3\u03B5 1 \u03B5\u03B2\u03B4\u03BF\u03BC\u03AC\u03B4\u03B1"],["%s \u03B5\u03B2\u03B4\u03BF\u03BC\u03AC\u03B4\u03B5\u03C2 \u03C0\u03C1\u03B9\u03BD","\u03C3\u03B5 %s \u03B5\u03B2\u03B4\u03BF\u03BC\u03AC\u03B4\u03B5\u03C2"],["1 \u03BC\u03AE\u03BD\u03B1 \u03C0\u03C1\u03B9\u03BD","\u03C3\u03B5 1 \u03BC\u03AE\u03BD\u03B1"],["%s \u03BC\u03AE\u03BD\u03B5\u03C2 \u03C0\u03C1\u03B9\u03BD","\u03C3\u03B5 %s \u03BC\u03AE\u03BD\u03B5\u03C2"],["1 \u03C7\u03C1\u03CC\u03BD\u03BF \u03C0\u03C1\u03B9\u03BD","\u03C3\u03B5 1 \u03C7\u03C1\u03CC\u03BD\u03BF"],["%s \u03C7\u03C1\u03CC\u03BD\u03B9\u03B1 \u03C0\u03C1\u03B9\u03BD","\u03C3\u03B5 %s \u03C7\u03C1\u03CC\u03BD\u03B9\u03B1"]][t]}var $y=Eu.default=Qy,xu={};Object.defineProperty(xu,"__esModule",{value:!0});function e0(i,t){return[["justo ahora","en un rato"],["hace %s segundos","en %s segundos"],["hace 1 minuto","en 1 minuto"],["hace %s minutos","en %s minutos"],["hace 1 hora","en 1 hora"],["hace %s horas","en %s horas"],["hace 1 d\xEDa","en 1 d\xEDa"],["hace %s d\xEDas","en %s d\xEDas"],["hace 1 semana","en 1 semana"],["hace %s semanas","en %s semanas"],["hace 1 mes","en 1 mes"],["hace %s meses","en %s meses"],["hace 1 a\xF1o","en 1 a\xF1o"],["hace %s a\xF1os","en %s a\xF1os"]][t]}var t0=xu.default=e0,_u={};Object.defineProperty(_u,"__esModule",{value:!0});function n0(i,t){return[["juuri \xE4sken","juuri nyt"],["%s sekuntia sitten","%s sekunnin p\xE4\xE4st\xE4"],["minuutti sitten","minuutin p\xE4\xE4st\xE4"],["%s minuuttia sitten","%s minuutin p\xE4\xE4st\xE4"],["tunti sitten","tunnin p\xE4\xE4st\xE4"],["%s tuntia sitten","%s tunnin p\xE4\xE4st\xE4"],["p\xE4iv\xE4 sitten","p\xE4iv\xE4n p\xE4\xE4st\xE4"],["%s p\xE4iv\xE4\xE4 sitten","%s p\xE4iv\xE4n p\xE4\xE4st\xE4"],["viikko sitten","viikon p\xE4\xE4st\xE4"],["%s viikkoa sitten","%s viikon p\xE4\xE4st\xE4"],["kuukausi sitten","kuukauden p\xE4\xE4st\xE4"],["%s kuukautta sitten","%s kuukauden p\xE4\xE4st\xE4"],["vuosi sitten","vuoden p\xE4\xE4st\xE4"],["%s vuotta sitten","%s vuoden p\xE4\xE4st\xE4"]][t]}var i0=_u.default=n0,Tu={};Object.defineProperty(Tu,"__esModule",{value:!0});function r0(i,t){return[["\xE0 l'instant","dans un instant"],["il y a %s secondes","dans %s secondes"],["il y a 1 minute","dans 1 minute"],["il y a %s minutes","dans %s minutes"],["il y a 1 heure","dans 1 heure"],["il y a %s heures","dans %s heures"],["il y a 1 jour","dans 1 jour"],["il y a %s jours","dans %s jours"],["il y a 1 semaine","dans 1 semaine"],["il y a %s semaines","dans %s semaines"],["il y a 1 mois","dans 1 mois"],["il y a %s mois","dans %s mois"],["il y a 1 an","dans 1 an"],["il y a %s ans","dans %s ans"]][t]}var o0=Tu.default=r0,Cu={};Object.defineProperty(Cu,"__esModule",{value:!0});function s0(i,t){return[["xusto agora","daqu\xED a un pouco"],["hai %s segundos","en %s segundos"],["hai 1 minuto","nun minuto"],["hai %s minutos","en %s minutos"],["hai 1 hora","nunha hora"],["hai %s horas","en %s horas"],["hai 1 d\xEDa","nun d\xEDa"],["hai %s d\xEDas","en %s d\xEDas"],["hai 1 semana","nunha semana"],["hai %s semanas","en %s semanas"],["hai 1 mes","nun mes"],["hai %s meses","en %s meses"],["hai 1 ano","nun ano"],["hai %s anos","en %s anos"]][t]}var a0=Cu.default=s0,Pu={};Object.defineProperty(Pu,"__esModule",{value:!0});function l0(i,t){return[["\u0905\u092D\u0940","\u0915\u0941\u091B \u0938\u092E\u092F"],["%s \u0938\u0947\u0915\u0902\u0921 \u092A\u0939\u0932\u0947","%s \u0938\u0947\u0915\u0902\u0921 \u092E\u0947\u0902"],["1 \u092E\u093F\u0928\u091F \u092A\u0939\u0932\u0947","1 \u092E\u093F\u0928\u091F \u092E\u0947\u0902"],["%s \u092E\u093F\u0928\u091F \u092A\u0939\u0932\u0947","%s \u092E\u093F\u0928\u091F \u092E\u0947\u0902"],["1 \u0918\u0902\u091F\u0947 \u092A\u0939\u0932\u0947","1 \u0918\u0902\u091F\u0947 \u092E\u0947\u0902"],["%s \u0918\u0902\u091F\u0947 \u092A\u0939\u0932\u0947","%s \u0918\u0902\u091F\u0947 \u092E\u0947\u0902"],["1 \u0926\u093F\u0928 \u092A\u0939\u0932\u0947","1 \u0926\u093F\u0928 \u092E\u0947\u0902"],["%s \u0926\u093F\u0928 \u092A\u0939\u0932\u0947","%s \u0926\u093F\u0928\u094B\u0902 \u092E\u0947\u0902"],["1 \u0938\u092A\u094D\u0924\u093E\u0939 \u092A\u0939\u0932\u0947","1 \u0938\u092A\u094D\u0924\u093E\u0939 \u092E\u0947\u0902"],["%s \u0939\u092B\u094D\u0924\u0947 \u092A\u0939\u0932\u0947","%s \u0939\u092B\u094D\u0924\u094B\u0902 \u092E\u0947\u0902"],["1 \u092E\u0939\u0940\u0928\u0947 \u092A\u0939\u0932\u0947","1 \u092E\u0939\u0940\u0928\u0947 \u092E\u0947\u0902"],["%s \u092E\u0939\u0940\u0928\u0947 \u092A\u0939\u0932\u0947","%s \u092E\u0939\u0940\u0928\u094B\u0902 \u092E\u0947\u0902"],["1 \u0938\u093E\u0932 \u092A\u0939\u0932\u0947","1 \u0938\u093E\u0932 \u092E\u0947\u0902"],["%s \u0938\u093E\u0932 \u092A\u0939\u0932\u0947","%s \u0938\u093E\u0932 \u092E\u0947\u0902"]][t]}var u0=Pu.default=l0,Au={};Object.defineProperty(Au,"__esModule",{value:!0});function c0(i,t){return[["poco fa","fra poco"],["%s secondi fa","fra %s secondi"],["un minuto fa","fra un minuto"],["%s minuti fa","fra %s minuti"],["un'ora fa","fra un'ora"],["%s ore fa","fra %s ore"],["un giorno fa","fra un giorno"],["%s giorni fa","fra %s giorni"],["una settimana fa","fra una settimana"],["%s settimane fa","fra %s settimane"],["un mese fa","fra un mese"],["%s mesi fa","fra %s mesi"],["un anno fa","fra un anno"],["%s anni fa","fra %s anni"]][t]}var h0=Au.default=c0,Ou={};Object.defineProperty(Ou,"__esModule",{value:!0});function d0(i,t){return[["\u3059\u3053\u3057\u524D","\u3059\u3050\u306B"],["%s\u79D2\u524D","%s\u79D2\u4EE5\u5185"],["1\u5206\u524D","1\u5206\u4EE5\u5185"],["%s\u5206\u524D","%s\u5206\u4EE5\u5185"],["1\u6642\u9593\u524D","1\u6642\u9593\u4EE5\u5185"],["%s\u6642\u9593\u524D","%s\u6642\u9593\u4EE5\u5185"],["1\u65E5\u524D","1\u65E5\u4EE5\u5185"],["%s\u65E5\u524D","%s\u65E5\u4EE5\u5185"],["1\u9031\u9593\u524D","1\u9031\u9593\u4EE5\u5185"],["%s\u9031\u9593\u524D","%s\u9031\u9593\u4EE5\u5185"],["1\u30F6\u6708\u524D","1\u30F6\u6708\u4EE5\u5185"],["%s\u30F6\u6708\u524D","%s\u30F6\u6708\u4EE5\u5185"],["1\u5E74\u524D","1\u5E74\u4EE5\u5185"],["%s\u5E74\u524D","%s\u5E74\u4EE5\u5185"]][t]}var f0=Ou.default=d0,Du={};Object.defineProperty(Du,"__esModule",{value:!0});function p0(i,t){return[["\uBC29\uAE08","\uACE7"],["%s\uCD08 \uC804","%s\uCD08 \uD6C4"],["1\uBD84 \uC804","1\uBD84 \uD6C4"],["%s\uBD84 \uC804","%s\uBD84 \uD6C4"],["1\uC2DC\uAC04 \uC804","1\uC2DC\uAC04 \uD6C4"],["%s\uC2DC\uAC04 \uC804","%s\uC2DC\uAC04 \uD6C4"],["1\uC77C \uC804","1\uC77C \uD6C4"],["%s\uC77C \uC804","%s\uC77C \uD6C4"],["1\uC8FC\uC77C \uC804","1\uC8FC\uC77C \uD6C4"],["%s\uC8FC\uC77C \uC804","%s\uC8FC\uC77C \uD6C4"],["1\uAC1C\uC6D4 \uC804","1\uAC1C\uC6D4 \uD6C4"],["%s\uAC1C\uC6D4 \uC804","%s\uAC1C\uC6D4 \uD6C4"],["1\uB144 \uC804","1\uB144 \uD6C4"],["%s\uB144 \uC804","%s\uB144 \uD6C4"]][t]}var m0=Du.default=p0,Ru={};Object.defineProperty(Ru,"__esModule",{value:!0});function g0(i,t){return[["recent","binnenkort"],["%s seconden geleden","binnen %s seconden"],["1 minuut geleden","binnen 1 minuut"],["%s minuten geleden","binnen %s minuten"],["1 uur geleden","binnen 1 uur"],["%s uur geleden","binnen %s uur"],["1 dag geleden","binnen 1 dag"],["%s dagen geleden","binnen %s dagen"],["1 week geleden","binnen 1 week"],["%s weken geleden","binnen %s weken"],["1 maand geleden","binnen 1 maand"],["%s maanden geleden","binnen %s maanden"],["1 jaar geleden","binnen 1 jaar"],["%s jaar geleden","binnen %s jaar"]][t]}var v0=Ru.default=g0,Mu={};Object.defineProperty(Mu,"__esModule",{value:!0});function y0(i,t){return[["agora mesmo","agora"],["h\xE1 %s segundos","em %s segundos"],["h\xE1 um minuto","em um minuto"],["h\xE1 %s minutos","em %s minutos"],["h\xE1 uma hora","em uma hora"],["h\xE1 %s horas","em %s horas"],["h\xE1 um dia","em um dia"],["h\xE1 %s dias","em %s dias"],["h\xE1 uma semana","em uma semana"],["h\xE1 %s semanas","em %s semanas"],["h\xE1 um m\xEAs","em um m\xEAs"],["h\xE1 %s meses","em %s meses"],["h\xE1 um ano","em um ano"],["h\xE1 %s anos","em %s anos"]][t]}var w0=Mu.default=y0,Fu={};Object.defineProperty(Fu,"__esModule",{value:!0});function Ht(i,t,e,n,r){var o=r%10,s=n;return r===1?s=i:o===1&&r>20?s=t:o>1&&o<5&&(r>20||r<10)&&(s=e),s}var ku=Ht.bind(null,"\u0441\u0435\u043A\u0443\u043D\u0434\u0443","%s \u0441\u0435\u043A\u0443\u043D\u0434\u0443","%s \u0441\u0435\u043A\u0443\u043D\u0434\u044B","%s \u0441\u0435\u043A\u0443\u043D\u0434"),Lu=Ht.bind(null,"\u043C\u0438\u043D\u0443\u0442\u0443","%s \u043C\u0438\u043D\u0443\u0442\u0443","%s \u043C\u0438\u043D\u0443\u0442\u044B","%s \u043C\u0438\u043D\u0443\u0442"),Bu=Ht.bind(null,"\u0447\u0430\u0441","%s \u0447\u0430\u0441","%s \u0447\u0430\u0441\u0430","%s \u0447\u0430\u0441\u043E\u0432"),Iu=Ht.bind(null,"\u0434\u0435\u043D\u044C","%s \u0434\u0435\u043D\u044C","%s \u0434\u043D\u044F","%s \u0434\u043D\u0435\u0439"),Nu=Ht.bind(null,"\u043D\u0435\u0434\u0435\u043B\u044E","%s \u043D\u0435\u0434\u0435\u043B\u044E","%s \u043D\u0435\u0434\u0435\u043B\u0438","%s \u043D\u0435\u0434\u0435\u043B\u044C"),Hu=Ht.bind(null,"\u043C\u0435\u0441\u044F\u0446","%s \u043C\u0435\u0441\u044F\u0446","%s \u043C\u0435\u0441\u044F\u0446\u0430","%s \u043C\u0435\u0441\u044F\u0446\u0435\u0432"),zu=Ht.bind(null,"\u0433\u043E\u0434","%s \u0433\u043E\u0434","%s \u0433\u043E\u0434\u0430","%s \u043B\u0435\u0442");function b0(i,t){switch(t){case 0:return["\u0442\u043E\u043B\u044C\u043A\u043E \u0447\u0442\u043E","\u0447\u0435\u0440\u0435\u0437 \u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0441\u0435\u043A\u0443\u043D\u0434"];case 1:return[ku(i)+" \u043D\u0430\u0437\u0430\u0434","\u0447\u0435\u0440\u0435\u0437 "+ku(i)];case 2:case 3:return[Lu(i)+" \u043D\u0430\u0437\u0430\u0434","\u0447\u0435\u0440\u0435\u0437 "+Lu(i)];case 4:case 5:return[Bu(i)+" \u043D\u0430\u0437\u0430\u0434","\u0447\u0435\u0440\u0435\u0437 "+Bu(i)];case 6:return["\u0432\u0447\u0435\u0440\u0430","\u0437\u0430\u0432\u0442\u0440\u0430"];case 7:return[Iu(i)+" \u043D\u0430\u0437\u0430\u0434","\u0447\u0435\u0440\u0435\u0437 "+Iu(i)];case 8:case 9:return[Nu(i)+" \u043D\u0430\u0437\u0430\u0434","\u0447\u0435\u0440\u0435\u0437 "+Nu(i)];case 10:case 11:return[Hu(i)+" \u043D\u0430\u0437\u0430\u0434","\u0447\u0435\u0440\u0435\u0437 "+Hu(i)];case 12:case 13:return[zu(i)+" \u043D\u0430\u0437\u0430\u0434","\u0447\u0435\u0440\u0435\u0437 "+zu(i)];default:return["",""]}}var S0=Fu.default=b0,Vu={};Object.defineProperty(Vu,"__esModule",{value:!0});function E0(i,t){return[["just nu","om en stund"],["%s sekunder sedan","om %s sekunder"],["1 minut sedan","om 1 minut"],["%s minuter sedan","om %s minuter"],["1 timme sedan","om 1 timme"],["%s timmar sedan","om %s timmar"],["1 dag sedan","om 1 dag"],["%s dagar sedan","om %s dagar"],["1 vecka sedan","om 1 vecka"],["%s veckor sedan","om %s veckor"],["1 m\xE5nad sedan","om 1 m\xE5nad"],["%s m\xE5nader sedan","om %s m\xE5nader"],["1 \xE5r sedan","om 1 \xE5r"],["%s \xE5r sedan","om %s \xE5r"]][t]}var x0=Vu.default=E0,Uu={};Object.defineProperty(Uu,"__esModule",{value:!0});function _0(i,t){return[["\u0E40\u0E21\u0E37\u0E48\u0E2D\u0E2A\u0E31\u0E01\u0E04\u0E23\u0E39\u0E48\u0E19\u0E35\u0E49","\u0E2D\u0E35\u0E01\u0E2A\u0E31\u0E01\u0E04\u0E23\u0E39\u0E48"],["%s \u0E27\u0E34\u0E19\u0E32\u0E17\u0E35\u0E17\u0E35\u0E48\u0E41\u0E25\u0E49\u0E27","\u0E43\u0E19 %s \u0E27\u0E34\u0E19\u0E32\u0E17\u0E35"],["1 \u0E19\u0E32\u0E17\u0E35\u0E17\u0E35\u0E48\u0E41\u0E25\u0E49\u0E27","\u0E43\u0E19 1 \u0E19\u0E32\u0E17\u0E35"],["%s \u0E19\u0E32\u0E17\u0E35\u0E17\u0E35\u0E48\u0E41\u0E25\u0E49\u0E27","\u0E43\u0E19 %s \u0E19\u0E32\u0E17\u0E35"],["1 \u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07\u0E17\u0E35\u0E48\u0E41\u0E25\u0E49\u0E27","\u0E43\u0E19 1 \u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07"],["%s \u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07\u0E17\u0E35\u0E48\u0E41\u0E25\u0E49\u0E27","\u0E43\u0E19 %s \u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07"],["1 \u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E25\u0E49\u0E27","\u0E43\u0E19 1 \u0E27\u0E31\u0E19"],["%s \u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E25\u0E49\u0E27","\u0E43\u0E19 %s \u0E27\u0E31\u0E19"],["1 \u0E2D\u0E32\u0E17\u0E34\u0E15\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E41\u0E25\u0E49\u0E27","\u0E43\u0E19 1 \u0E2D\u0E32\u0E17\u0E34\u0E15\u0E22\u0E4C"],["%s \u0E2D\u0E32\u0E17\u0E34\u0E15\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E41\u0E25\u0E49\u0E27","\u0E43\u0E19 %s \u0E2D\u0E32\u0E17\u0E34\u0E15\u0E22\u0E4C"],["1 \u0E40\u0E14\u0E37\u0E2D\u0E19\u0E17\u0E35\u0E48\u0E41\u0E25\u0E49\u0E27","\u0E43\u0E19 1 \u0E40\u0E14\u0E37\u0E2D\u0E19"],["%s \u0E40\u0E14\u0E37\u0E2D\u0E19\u0E17\u0E35\u0E48\u0E41\u0E25\u0E49\u0E27","\u0E43\u0E19 %s \u0E40\u0E14\u0E37\u0E2D\u0E19"],["1 \u0E1B\u0E35\u0E17\u0E35\u0E48\u0E41\u0E25\u0E49\u0E27","\u0E43\u0E19 1 \u0E1B\u0E35"],["%s \u0E1B\u0E35\u0E17\u0E35\u0E48\u0E41\u0E25\u0E49\u0E27","\u0E43\u0E19 %s \u0E1B\u0E35"]][t]}var T0=Uu.default=_0,Wu={};Object.defineProperty(Wu,"__esModule",{value:!0});function C0(i,t){return[["az \xF6nce","\u015Fimdi"],["%s saniye \xF6nce","%s saniye i\xE7inde"],["1 dakika \xF6nce","1 dakika i\xE7inde"],["%s dakika \xF6nce","%s dakika i\xE7inde"],["1 saat \xF6nce","1 saat i\xE7inde"],["%s saat \xF6nce","%s saat i\xE7inde"],["1 g\xFCn \xF6nce","1 g\xFCn i\xE7inde"],["%s g\xFCn \xF6nce","%s g\xFCn i\xE7inde"],["1 hafta \xF6nce","1 hafta i\xE7inde"],["%s hafta \xF6nce","%s hafta i\xE7inde"],["1 ay \xF6nce","1 ay i\xE7inde"],["%s ay \xF6nce","%s ay i\xE7inde"],["1 y\u0131l \xF6nce","1 y\u0131l i\xE7inde"],["%s y\u0131l \xF6nce","%s y\u0131l i\xE7inde"]][t]}var P0=Wu.default=C0,ju={};Object.defineProperty(ju,"__esModule",{value:!0});var A0=["\u79D2","\u5206\u949F","\u5C0F\u65F6","\u5929","\u5468","\u4E2A\u6708","\u5E74"];function O0(i,t){if(t===0)return["\u521A\u521A","\u7247\u523B\u540E"];var e=A0[~~(t/2)];return[i+" "+e+"\u524D",i+" "+e+"\u540E"]}var D0=ju.default=O0,Gu={};Object.defineProperty(Gu,"__esModule",{value:!0});function R0(i,t){return[["\u525B\u525B","\u7247\u523B\u5F8C"],["%s \u79D2\u524D","%s \u79D2\u5F8C"],["1 \u5206\u9418\u524D","1 \u5206\u9418\u5F8C"],["%s \u5206\u9418\u524D","%s \u5206\u9418\u5F8C"],["1 \u5C0F\u6642\u524D","1 \u5C0F\u6642\u5F8C"],["%s \u5C0F\u6642\u524D","%s \u5C0F\u6642\u5F8C"],["1 \u5929\u524D","1 \u5929\u5F8C"],["%s \u5929\u524D","%s \u5929\u5F8C"],["1 \u9031\u524D","1 \u9031\u5F8C"],["%s \u9031\u524D","%s \u9031\u5F8C"],["1 \u500B\u6708\u524D","1 \u500B\u6708\u5F8C"],["%s \u500B\u6708\u524D","%s \u500B\u6708\u5F8C"],["1 \u5E74\u524D","1 \u5E74\u5F8C"],["%s \u5E74\u524D","%s \u5E74\u5F8C"]][t]}var M0=Gu.default=R0;const on={ar:_y,cs:Ty,de:Cy,el:Py,es:Ay,fi:Oy,fr:Dy,gl:Ry,hi:My,it:Fy,ja:ky,ko:Ly,nl:By,pt:Iy,ru:Ny,sv:Hy,th:zy,tr:Vy,ur:Uy,"zh-CN":Wy,"zh-TW":jy},F0=Object.keys(on),zt=new xy({allowMissing:!0});zt.init=(i,t)=>{zt.clear(),i&&(zt.locale(i),zt.extend(on[i])),t&&zt.extend(t)},_e("ar",Xy),_e("cs",Zy),_e("de",Jy),_e("el",$y),_e("es",t0),_e("fi",i0),_e("fr",o0),_e("gl",a0),_e("hi",u0),_e("it",h0),_e("ja",f0),_e("ko",m0),_e("nl",v0),_e("pt",w0),_e("ru",S0),_e("sv",x0),_e("th",T0),_e("tr",P0),_e("zh-CN",D0),_e("zh-TW",M0),zt.registerMessages=(i,t)=>{on[i]?on[i]={...on[i],...t}:on[i]=t};var Ze=zt,k0=i=>{const t=ot();return If(t,()=>i.onClickOutside()),k.createElement("ul",{ref:t,className:"r6o-comment-dropdown-menu"},k.createElement("li",{onClick:i.onEdit},Ze.t("Edit")),k.createElement("li",{onClick:i.onDelete},Ze.t("Delete")))},qu={},wo={},bo={exports:{}};/*! - autosize 4.0.4 - license: MIT - http://www.jacklmoore.com/autosize -*/(function(i,t){(function(e,n){n(i,t)})(_t,function(e,n){var r=typeof Map=="function"?new Map:function(){var c=[],h=[];return{has:function(g){return c.indexOf(g)>-1},get:function(g){return h[c.indexOf(g)]},set:function(g,y){c.indexOf(g)===-1&&(c.push(g),h.push(y))},delete:function(g){var y=c.indexOf(g);y>-1&&(c.splice(y,1),h.splice(y,1))}}}(),o=function(h){return new Event(h,{bubbles:!0})};try{new Event("test")}catch{o=function(d){var g=document.createEvent("Event");return g.initEvent(d,!0,!1),g}}function s(c){if(!c||!c.nodeName||c.nodeName!=="TEXTAREA"||r.has(c))return;var h=null,d=null,g=null;function y(){var C=window.getComputedStyle(c,null);C.resize==="vertical"?c.style.resize="none":C.resize==="both"&&(c.style.resize="horizontal"),C.boxSizing==="content-box"?h=-(parseFloat(C.paddingTop)+parseFloat(C.paddingBottom)):h=parseFloat(C.borderTopWidth)+parseFloat(C.borderBottomWidth),isNaN(h)&&(h=0),f()}function x(C){{var O=c.style.width;c.style.width="0px",c.offsetWidth,c.style.width=O}c.style.overflowY=C}function b(C){for(var O=[];C&&C.parentNode&&C.parentNode instanceof Element;)C.parentNode.scrollTop&&O.push({node:C.parentNode,scrollTop:C.parentNode.scrollTop}),C=C.parentNode;return O}function T(){if(c.scrollHeight!==0){var C=b(c),O=document.documentElement&&document.documentElement.scrollTop;c.style.height="",c.style.height=c.scrollHeight+h+"px",d=c.clientWidth,C.forEach(function(D){D.node.scrollTop=D.scrollTop}),O&&(document.documentElement.scrollTop=O)}}function f(){T();var C=Math.round(parseFloat(c.style.height)),O=window.getComputedStyle(c,null),D=O.boxSizing==="content-box"?Math.round(parseFloat(O.height)):c.offsetHeight;if(D{e.which===13&&e.ctrlKey&&this.props.onSaveAndClose()});P(this,"onKeyUp",e=>{e.which===46&&e.stopPropagation()});this.element=ur()}componentDidMount(){this.props.focus&&this.element.current&&this.element.current.focus({preventScroll:!0})}render(){return k.createElement(j0,{ref:this.element,className:"r6o-editable-text",value:this.props.content,placeholder:this.props.placeholder||Ze.t("Add a comment..."),disabled:!this.props.editable,onChange:this.props.onChange,onKeyUp:this.onKeyUp,onKeyDown:this.onKeyDown})}}function ne(){return ne=Object.assign?Object.assign.bind():function(i){for(var t=1;t0?Ie(an,--Ge):0,sn--,Ce===10&&(sn=1,Ti--),Ce}function Ke(){return Ce=Ge2||Nn(Ce)>3?"":" "}function rw(i,t){for(;--t&&Ke()&&!(Ce<48||Ce>102||Ce>57&&Ce<65||Ce>70&&Ce<97););return In(i,Pi()+(t<6&&ht()==32&&Ke()==32))}function Po(i){for(;Ke();)switch(Ce){case i:return Ge;case 34:case 39:i!==34&&i!==39&&Po(Ce);break;case 40:i===41&&Po(i);break;case 92:Ke();break}return Ge}function ow(i,t){for(;Ke()&&i+Ce!==47+10;)if(i+Ce===42+42&&ht()===47)break;return"/*"+In(t,Ge-1)+"*"+xi(i===47?i:Ke())}function sw(i){for(;!Nn(ht());)Ke();return In(i,Ge)}function aw(i){return ec(Oi("",null,null,null,[""],i=$u(i),0,[0],i))}function Oi(i,t,e,n,r,o,s,a,l){for(var u=0,c=0,h=s,d=0,g=0,y=0,x=1,b=1,T=1,f=0,E="",A=r,C=o,O=n,D=E;b;)switch(y=f,f=Ke()){case 40:if(y!=108&&Ie(D,h-1)==58){To(D+=ye(Ai(f),"&","&\f"),"&\f")!=-1&&(T=-1);break}case 34:case 39:case 91:D+=Ai(f);break;case 9:case 10:case 13:case 32:D+=iw(y);break;case 92:D+=rw(Pi()-1,7);continue;case 47:switch(ht()){case 42:case 47:_i(lw(ow(Ke(),Pi()),t,e),l);break;default:D+="/"}break;case 123*x:a[u++]=ct(D)*T;case 125*x:case 59:case 0:switch(f){case 0:case 125:b=0;case 59+c:T==-1&&(D=ye(D,/\f/g,"")),g>0&&ct(D)-h&&_i(g>32?nc(D+";",n,e,h-1):nc(ye(D," ","")+";",n,e,h-2),l);break;case 59:D+=";";default:if(_i(O=tc(D,t,e,u,c,r,a,E,A=[],C=[],h),o),f===123)if(c===0)Oi(D,t,O,O,A,o,h,a,C);else switch(d===99&&Ie(D,3)===110?100:d){case 100:case 108:case 109:case 115:Oi(i,O,O,n&&_i(tc(i,O,O,0,0,r,a,E,r,A=[],h),C),r,C,h,a,n?A:C);break;default:Oi(D,O,O,O,[""],C,0,a,C)}}u=c=g=0,x=T=1,E=D="",h=s;break;case 58:h=1+ct(D),g=y;default:if(x<1){if(f==123)--x;else if(f==125&&x++==0&&nw()==125)continue}switch(D+=xi(f),f*x){case 38:T=c>0?1:(D+="\f",-1);break;case 44:a[u++]=(ct(D)-1)*T,T=1;break;case 64:ht()===45&&(D+=Ai(Ke())),d=ht(),c=h=ct(E=D+=sw(Pi())),f++;break;case 45:y===45&&ct(D)==2&&(x=0)}}return o}function tc(i,t,e,n,r,o,s,a,l,u,c){for(var h=r-1,d=r===0?o:[""],g=Co(d),y=0,x=0,b=0;y0?d[T]+" "+f:ye(f,/&\f/g,d[T])))&&(l[b++]=E);return Ci(i,t,e,r===0?xo:a,l,u,c)}function lw(i,t,e){return Ci(i,t,e,Zu,xi(tw()),Ln(i,2,-2),0)}function nc(i,t,e,n){return Ci(i,t,e,_o,Ln(i,0,n),Ln(i,n+1,-1),n)}function ln(i,t){for(var e="",n=Co(i),r=0;r6)switch(Ie(i,t+1)){case 109:if(Ie(i,t+4)!==45)break;case 102:return ye(i,/(.+:)(.+)-([^]+)/,"$1"+ve+"$2-$3$1"+Ei+(Ie(i,t+3)==108?"$3":"$2-$3"))+i;case 115:return~To(i,"stretch")?rc(ye(i,"stretch","fill-available"),t)+i:i}break;case 4949:if(Ie(i,t+1)!==115)break;case 6444:switch(Ie(i,ct(i)-3-(~To(i,"!important")&&10))){case 107:return ye(i,":",":"+ve)+i;case 101:return ye(i,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ve+(Ie(i,14)===45?"inline-":"")+"box$3$1"+ve+"$2$3$1"+je+"$2box$3")+i}break;case 5936:switch(Ie(i,t+11)){case 114:return ve+i+je+ye(i,/[svh]\w+-[tblr]{2}/,"tb")+i;case 108:return ve+i+je+ye(i,/[svh]\w+-[tblr]{2}/,"tb-rl")+i;case 45:return ve+i+je+ye(i,/[svh]\w+-[tblr]{2}/,"lr")+i}return ve+i+je+i+i}return i}var yw=function(t,e,n,r){if(t.length>-1&&!t.return)switch(t.type){case _o:t.return=rc(t.value,t.length);break;case Ku:return ln([Bn(t,{value:ye(t.value,"@","@"+ve)})],r);case xo:if(t.length)return ew(t.props,function(o){switch($0(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ln([Bn(t,{props:[ye(o,/:(read-\w+)/,":"+Ei+"$1")]})],r);case"::placeholder":return ln([Bn(t,{props:[ye(o,/:(plac\w+)/,":"+ve+"input-$1")]}),Bn(t,{props:[ye(o,/:(plac\w+)/,":"+Ei+"$1")]}),Bn(t,{props:[ye(o,/:(plac\w+)/,je+"input-$1")]})],r)}return""})}},ww=[yw],bw=function(t){var e=t.key;if(e==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(x){var b=x.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(x),x.setAttribute("data-s",""))})}var r=t.stylisPlugins||ww,o={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+e+' "]'),function(x){for(var b=x.getAttribute("data-emotion").split(" "),T=1;T=4;++n,r-=4)e=i.charCodeAt(n)&255|(i.charCodeAt(++n)&255)<<8|(i.charCodeAt(++n)&255)<<16|(i.charCodeAt(++n)&255)<<24,e=(e&65535)*1540483477+((e>>>16)*59797<<16),e^=e>>>24,t=(e&65535)*1540483477+((e>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(r){case 3:t^=(i.charCodeAt(n+2)&255)<<16;case 2:t^=(i.charCodeAt(n+1)&255)<<8;case 1:t^=i.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Dw={animationIterationCount:1,aspectRatio: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},Rw=/[A-Z]|^ms/g,Mw=/_EMO_([^_]+?)_([^]*?)_EMO_/g,hc=function(t){return t.charCodeAt(1)===45},dc=function(t){return t!=null&&typeof t!="boolean"},Mo=dw(function(i){return hc(i)?i:i.replace(Rw,"-$&").toLowerCase()}),fc=function(t,e){switch(t){case"animation":case"animationName":if(typeof e=="string")return e.replace(Mw,function(n,r,o){return dt={name:r,styles:o,next:dt},r})}return Dw[t]!==1&&!hc(t)&&typeof e=="number"&&e!==0?e+"px":e},R1="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function Hn(i,t,e){if(e==null)return"";if(e.__emotion_styles!==void 0)return e;switch(typeof e){case"boolean":return"";case"object":{if(e.anim===1)return dt={name:e.name,styles:e.styles,next:dt},e.name;if(e.styles!==void 0){var n=e.next;if(n!==void 0)for(;n!==void 0;)dt={name:n.name,styles:n.styles,next:dt},n=n.next;var r=e.styles+";";return r}return Fw(i,t,e)}case"function":{if(i!==void 0){var o=dt,s=e(i);return dt=o,Hn(i,t,s)}break}}if(t==null)return e;var a=t[e];return a!==void 0?a:e}function Fw(i,t,e){var n="";if(Array.isArray(e))for(var r=0;r=0)&&(e[r]=i[r]);return e}function un(i,t){if(i==null)return{};var e=Io(i,t),n,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(i);for(r=0;r=0)&&(!Object.prototype.propertyIsEnumerable.call(i,n)||(e[n]=i[n]))}return e}function cn(i){return cn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cn(i)}var wc={};Object.defineProperty(wc,"__esModule",{value:!0});var No=Object.assign||function(i){for(var t=1;t=0||!Object.prototype.hasOwnProperty.call(i,n)||(e[n]=i[n]);return e}function Yw(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function Zw(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function Kw(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var xc={position:"absolute",top:0,left:0,visibility:"hidden",height:0,overflow:"scroll",whiteSpace:"pre"},Jw=["extraWidth","injectStyles","inputClassName","inputRef","inputStyle","minWidth","onAutosize","placeholderIsMinWidth"],Qw=function(t){return Jw.forEach(function(e){return delete t[e]}),t},_c=function(t,e){e.style.fontSize=t.fontSize,e.style.fontFamily=t.fontFamily,e.style.fontWeight=t.fontWeight,e.style.fontStyle=t.fontStyle,e.style.letterSpacing=t.letterSpacing,e.style.textTransform=t.textTransform},Tc=typeof window!="undefined"&&window.navigator?/MSIE |Trident\/|Edge\//.test(window.navigator.userAgent):!1,Cc=function(){return Tc?"_"+Math.random().toString(36).substr(2,12):void 0},Ho=function(i){Kw(t,i),bc(t,null,[{key:"getDerivedStateFromProps",value:function(n,r){var o=n.id;return o!==r.prevId?{inputId:o||Cc(),prevId:o}:null}}]);function t(e){Yw(this,t);var n=Zw(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.inputRef=function(r){n.input=r,typeof n.props.inputRef=="function"&&n.props.inputRef(r)},n.placeHolderSizerRef=function(r){n.placeHolderSizer=r},n.sizerRef=function(r){n.sizer=r},n.state={inputWidth:e.minWidth,inputId:e.id||Cc(),prevId:e.id},n}return bc(t,[{key:"componentDidMount",value:function(){this.mounted=!0,this.copyInputStyles(),this.updateInputWidth()}},{key:"componentDidUpdate",value:function(n,r){r.inputWidth!==this.state.inputWidth&&typeof this.props.onAutosize=="function"&&this.props.onAutosize(this.state.inputWidth),this.updateInputWidth()}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"copyInputStyles",value:function(){if(!(!this.mounted||!window.getComputedStyle)){var n=this.input&&window.getComputedStyle(this.input);!n||(_c(n,this.sizer),this.placeHolderSizer&&_c(n,this.placeHolderSizer))}}},{key:"updateInputWidth",value:function(){if(!(!this.mounted||!this.sizer||typeof this.sizer.scrollWidth=="undefined")){var n=void 0;this.props.placeholder&&(!this.props.value||this.props.value&&this.props.placeholderIsMinWidth)?n=Math.max(this.sizer.scrollWidth,this.placeHolderSizer.scrollWidth)+2:n=this.sizer.scrollWidth+2;var r=this.props.type==="number"&&this.props.extraWidth===void 0?16:parseInt(this.props.extraWidth)||0;n+=r,n-1}function Mc(i){return zo(i)?window.pageYOffset:i.scrollTop}function Xi(i,t){if(zo(i)){window.scrollTo(0,t);return}i.scrollTop=t}function ab(i){var t=getComputedStyle(i),e=t.position==="absolute",n=/(auto|scroll)/,r=document.documentElement;if(t.position==="fixed")return r;for(var o=i;o=o.parentElement;)if(t=getComputedStyle(o),!(e&&t.position==="static")&&n.test(t.overflow+t.overflowY+t.overflowX))return o;return r}function lb(i,t,e,n){return e*((i=i/n-1)*i*i+1)+t}function Yi(i,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:qi,r=Mc(i),o=t-r,s=10,a=0;function l(){a+=s;var u=lb(a,r,o,e);Xi(i,u),ae.bottom?Xi(i,Math.min(t.offsetTop+t.clientHeight-i.offsetHeight+r,i.scrollHeight)):n.top-r=x)return{placement:"bottom",maxHeight:t};if(Z>=x&&!s)return o&&Yi(u,Y,K),{placement:"bottom",maxHeight:t};if(!s&&Z>=n||s&&I>=n){o&&Yi(u,Y,K);var Q=s?I-C:Z-C;return{placement:"bottom",maxHeight:Q}}if(r==="auto"||s){var le=t,re=s?D:B;return re>=n&&(le=Math.min(re-C-l.controlHeight,t)),{placement:"top",maxHeight:le}}if(r==="bottom")return o&&Xi(u,Y),{placement:"bottom",maxHeight:t};break;case"top":if(D>=x)return{placement:"top",maxHeight:t};if(B>=x&&!s)return o&&Yi(u,V,K),{placement:"top",maxHeight:t};if(!s&&B>=n||s&&D>=n){var se=t;return(!s&&B>=n||s&&D>=n)&&(se=s?D-O:B-O),o&&Yi(u,V,K),{placement:"top",maxHeight:se}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}function mb(i){var t={bottom:"top",top:"bottom"};return i?t[i]:"bottom"}var Vo=function(t){return t==="auto"?"bottom":t},gb=function(t){var e,n=t.placement,r=t.theme,o=r.borderRadius,s=r.spacing,a=r.colors;return e={label:"menu"},wt(e,mb(n),"100%"),wt(e,"backgroundColor",a.neutral0),wt(e,"borderRadius",o),wt(e,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),wt(e,"marginBottom",s.menuGutter),wt(e,"marginTop",s.menuGutter),wt(e,"position","absolute"),wt(e,"width","100%"),wt(e,"zIndex",1),e},Lc=Sn({getPortalPlacement:null}),Bc=function(i){Wi(e,i);var t=Gi(e);function e(){var n;zi(this,e);for(var r=arguments.length,o=new Array(r),s=0;si.length)&&(t=i.length);for(var e=0,n=new Array(t);e-1}};function xS(i){i.in,i.out,i.onExited,i.appear,i.enter,i.exit;var t=i.innerRef;i.emotion;var e=un(i,["in","out","onExited","appear","enter","exit","innerRef","emotion"]);return ie("input",ne({ref:t},e,{css:Bo({label:"dummyInput",background:0,border:0,fontSize:"inherit",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(0)"},"","")}))}var _S=function(t){t.preventDefault(),t.stopPropagation()};function TS(i){var t=i.isEnabled,e=i.onBottomArrive,n=i.onBottomLeave,r=i.onTopArrive,o=i.onTopLeave,s=ot(!1),a=ot(!1),l=ot(0),u=ot(null),c=st(function(b,T){if(u.current!==null){var f=u.current,E=f.scrollTop,A=f.scrollHeight,C=f.clientHeight,O=u.current,D=T>0,I=A-C-E,B=!1;I>T&&s.current&&(n&&n(b),s.current=!1),D&&a.current&&(o&&o(b),a.current=!1),D&&T>I?(e&&!s.current&&e(b),O.scrollTop=A,B=!0,s.current=!0):!D&&-T>E&&(r&&!a.current&&r(b),O.scrollTop=0,B=!0,a.current=!0),B&&_S(b)}},[]),h=st(function(b){c(b,b.deltaY)},[c]),d=st(function(b){l.current=b.changedTouches[0].clientY},[]),g=st(function(b){var T=l.current-b.changedTouches[0].clientY;c(b,T)},[c]),y=st(function(b){if(!!b){var T=fb?{passive:!1}:!1;typeof b.addEventListener=="function"&&b.addEventListener("wheel",h,T),typeof b.addEventListener=="function"&&b.addEventListener("touchstart",d,T),typeof b.addEventListener=="function"&&b.addEventListener("touchmove",g,T)}},[g,d,h]),x=st(function(b){!b||(typeof b.removeEventListener=="function"&&b.removeEventListener("wheel",h,!1),typeof b.removeEventListener=="function"&&b.removeEventListener("touchstart",d,!1),typeof b.removeEventListener=="function"&&b.removeEventListener("touchmove",g,!1))},[g,d,h]);return kt(function(){if(!!t){var b=u.current;return y(b),function(){x(b)}}},[t,y,x]),function(b){u.current=b}}var Qc=["boxSizing","height","overflow","paddingRight","position"],$c={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function eh(i){i.preventDefault()}function th(i){i.stopPropagation()}function nh(){var i=this.scrollTop,t=this.scrollHeight,e=i+this.offsetHeight;i===0?this.scrollTop=1:e===t&&(this.scrollTop=i-1)}function ih(){return"ontouchstart"in window||navigator.maxTouchPoints}var rh=!!(typeof window!="undefined"&&window.document&&window.document.createElement),Vn=0,hn={capture:!1,passive:!1};function CS(i){var t=i.isEnabled,e=i.accountForScrollbars,n=e===void 0?!0:e,r=ot({}),o=ot(null),s=st(function(l){if(!!rh){var u=document.body,c=u&&u.style;if(n&&Qc.forEach(function(y){var x=c&&c[y];r.current[y]=x}),n&&Vn<1){var h=parseInt(r.current.paddingRight,10)||0,d=document.body?document.body.clientWidth:0,g=window.innerWidth-d+h||0;Object.keys($c).forEach(function(y){var x=$c[y];c&&(c[y]=x)}),c&&(c.paddingRight="".concat(g,"px"))}u&&ih()&&(u.addEventListener("touchmove",eh,hn),l&&(l.addEventListener("touchstart",nh,hn),l.addEventListener("touchmove",th,hn))),Vn+=1}},[]),a=st(function(l){if(!!rh){var u=document.body,c=u&&u.style;Vn=Math.max(Vn-1,0),n&&Vn<1&&Qc.forEach(function(h){var d=r.current[h];c&&(c[h]=d)}),u&&ih()&&(u.removeEventListener("touchmove",eh,hn),l&&(l.removeEventListener("touchstart",nh,hn),l.removeEventListener("touchmove",th,hn)))}},[]);return kt(function(){if(!!t){var l=o.current;return s(l),function(){a(l)}}},[t,s,a]),function(l){o.current=l}}var PS=function(){return document.activeElement&&document.activeElement.blur()},AS={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function OS(i){var t=i.children,e=i.lockEnabled,n=i.captureEnabled,r=n===void 0?!0:n,o=i.onBottomArrive,s=i.onBottomLeave,a=i.onTopArrive,l=i.onTopLeave,u=TS({isEnabled:r,onBottomArrive:o,onBottomLeave:s,onTopArrive:a,onTopLeave:l}),c=CS({isEnabled:e}),h=function(g){u(g),c(g)};return ie(k.Fragment,null,e&&ie("div",{onClick:PS,css:AS}),t(h))}var DS=function(t){return t.label},RS=function(t){return t.label},MS=function(t){return t.value},FS=function(t){return!!t.isDisabled},kS={clearIndicator:Fb,container:_b,control:Hb,dropdownIndicator:Rb,group:Vb,groupHeading:Wb,indicatorsContainer:Ab,indicatorSeparator:Lb,input:Gb,loadingIndicator:Nb,loadingMessage:Sb,menu:gb,menuList:yb,menuPortal:Eb,multiValue:Yb,multiValueLabel:Zb,multiValueRemove:Kb,noOptionsMessage:bb,option:eS,placeholder:nS,singleValue:rS,valueContainer:Cb},LS={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},BS=4,oh=4,IS=38,NS=oh*2,HS={baseUnit:oh,controlHeight:IS,menuGutter:NS},Zo={borderRadius:BS,colors:LS,spacing:HS},zS={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Fc(),captureMenuScroll:!Fc(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:ES(),formatGroupLabel:DS,getOptionLabel:RS,getOptionValue:MS,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:FS,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!hb(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var e=t.count;return"".concat(e," result").concat(e!==1?"s":""," available")},styles:{},tabIndex:"0",tabSelectsValue:!0};function sh(i,t,e,n){var r=hh(i,t,e),o=dh(i,t,e),s=ch(i,t),a=Ki(i,t);return{type:"option",data:t,isDisabled:r,isSelected:o,label:s,value:a,index:n}}function ah(i,t){return i.options.map(function(e,n){if(e.options){var r=e.options.map(function(s,a){return sh(i,s,t,a)}).filter(function(s){return uh(i,s)});return r.length>0?{type:"group",data:e,options:r,index:n}:void 0}var o=sh(i,e,t,n);return uh(i,o)?o:void 0}).filter(function(e){return!!e})}function lh(i){return i.reduce(function(t,e){return e.type==="group"?t.push.apply(t,Xc(e.options.map(function(n){return n.data}))):t.push(e.data),t},[])}function VS(i,t){return lh(ah(i,t))}function uh(i,t){var e=i.inputValue,n=e===void 0?"":e,r=t.data,o=t.isSelected,s=t.label,a=t.value;return(!ph(i)||!o)&&fh(i,{label:s,value:a,data:r},n)}function US(i,t){var e=i.focusedValue,n=i.selectValue,r=n.indexOf(e);if(r>-1){var o=t.indexOf(e);if(o>-1)return e;if(r-1?e:t[0]}var ch=function(t,e){return t.getOptionLabel(e)},Ki=function(t,e){return t.getOptionValue(e)};function hh(i,t,e){return typeof i.isOptionDisabled=="function"?i.isOptionDisabled(t,e):!1}function dh(i,t,e){if(e.indexOf(t)>-1)return!0;if(typeof i.isOptionSelected=="function")return i.isOptionSelected(t,e);var n=Ki(i,t);return e.some(function(r){return Ki(i,r)===n})}function fh(i,t,e){return i.filterOption?i.filterOption(t,e):!0}var ph=function(t){var e=t.hideSelectedOptions,n=t.isMulti;return e===void 0?n:e},jS=1,mh=function(i){Wi(e,i);var t=Gi(e);function e(n){var r;return zi(this,e),r=t.call(this,n),r.state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.instancePrefix="",r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.controlRef=null,r.getControlRef=function(o){r.controlRef=o},r.focusedOptionRef=null,r.getFocusedOptionRef=function(o){r.focusedOptionRef=o},r.menuListRef=null,r.getMenuListRef=function(o){r.menuListRef=o},r.inputRef=null,r.getInputRef=function(o){r.inputRef=o},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(o,s){var a=r.props,l=a.onChange,u=a.name;s.name=u,r.ariaOnChange(o,s),l(o,s)},r.setValue=function(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"set-value",a=arguments.length>2?arguments[2]:void 0,l=r.props,u=l.closeMenuOnSelect,c=l.isMulti;r.onInputChange("",{action:"set-value"}),u&&(r.setState({inputIsHiddenAfterUpdate:!c}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(o,{action:s,option:a})},r.selectOption=function(o){var s=r.props,a=s.blurInputOnSelect,l=s.isMulti,u=s.name,c=r.state.selectValue,h=l&&r.isOptionSelected(o,c),d=r.isOptionDisabled(o,c);if(h){var g=r.getOptionValue(o);r.setValue(c.filter(function(y){return r.getOptionValue(y)!==g}),"deselect-option",o)}else if(!d)l?r.setValue([].concat(Xc(c),[o]),"select-option",o):r.setValue(o,"select-option");else{r.ariaOnChange(o,{action:"select-option",name:u});return}a&&r.blurInput()},r.removeValue=function(o){var s=r.props.isMulti,a=r.state.selectValue,l=r.getOptionValue(o),u=a.filter(function(h){return r.getOptionValue(h)!==l}),c=s?u:u[0]||null;r.onChange(c,{action:"remove-value",removedValue:o}),r.focusInput()},r.clearValue=function(){var o=r.state.selectValue;r.onChange(r.props.isMulti?[]:null,{action:"clear",removedValues:o})},r.popValue=function(){var o=r.props.isMulti,s=r.state.selectValue,a=s[s.length-1],l=s.slice(0,s.length-1),u=o?l:l[0]||null;r.onChange(u,{action:"pop-value",removedValue:a})},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var o=arguments.length,s=new Array(o),a=0;ac||u>c}},r.onTouchEnd=function(o){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(o.target)&&r.menuListRef&&!r.menuListRef.contains(o.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(o){r.userIsDragging||r.onControlMouseDown(o)},r.onClearIndicatorTouchEnd=function(o){r.userIsDragging||r.onClearIndicatorMouseDown(o)},r.onDropdownIndicatorTouchEnd=function(o){r.userIsDragging||r.onDropdownIndicatorMouseDown(o)},r.handleInputChange=function(o){var s=o.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(s,{action:"input-change"}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(o){r.props.onFocus&&r.props.onFocus(o),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(o){if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(o),r.onInputChange("",{action:"input-blur"}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(o){r.blockOptionHover||r.state.focusedOption===o||r.setState({focusedOption:o})},r.shouldHideSelectedOptions=function(){return ph(r.props)},r.onKeyDown=function(o){var s=r.props,a=s.isMulti,l=s.backspaceRemovesValue,u=s.escapeClearsValue,c=s.inputValue,h=s.isClearable,d=s.isDisabled,g=s.menuIsOpen,y=s.onKeyDown,x=s.tabSelectsValue,b=s.openMenuOnFocus,T=r.state,f=T.focusedOption,E=T.focusedValue,A=T.selectValue;if(!d&&!(typeof y=="function"&&(y(o),o.defaultPrevented))){switch(r.blockOptionHover=!0,o.key){case"ArrowLeft":if(!a||c)return;r.focusValue("previous");break;case"ArrowRight":if(!a||c)return;r.focusValue("next");break;case"Delete":case"Backspace":if(c)return;if(E)r.removeValue(E);else{if(!l)return;a?r.popValue():h&&r.clearValue()}break;case"Tab":if(r.isComposing||o.shiftKey||!g||!x||!f||b&&r.isOptionSelected(f,A))return;r.selectOption(f);break;case"Enter":if(o.keyCode===229)break;if(g){if(!f||r.isComposing)return;r.selectOption(f);break}return;case"Escape":g?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close"}),r.onMenuClose()):h&&u&&r.clearValue();break;case" ":if(c)return;if(!g){r.openMenu("first");break}if(!f)return;r.selectOption(f);break;case"ArrowUp":g?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":g?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!g)return;r.focusOption("pageup");break;case"PageDown":if(!g)return;r.focusOption("pagedown");break;case"Home":if(!g)return;r.focusOption("first");break;case"End":if(!g)return;r.focusOption("last");break;default:return}o.preventDefault()}},r.instancePrefix="react-select-"+(r.props.instanceId||++jS),r.state.selectValue=Dc(n.value),r}return Vi(e,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentDidUpdate",value:function(r){var o=this.props,s=o.isDisabled,a=o.menuIsOpen,l=this.state.isFocused;(l&&!s&&r.isDisabled||l&&a&&!r.menuIsOpen)&&this.focusInput(),l&&s&&!r.isDisabled&&this.setState({isFocused:!1},this.onMenuClose),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(ub(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close"}),this.props.onMenuClose()}},{key:"onInputChange",value:function(r,o){this.props.onInputChange(r,o)}},{key:"focusInput",value:function(){!this.inputRef||this.inputRef.focus()}},{key:"blurInput",value:function(){!this.inputRef||this.inputRef.blur()}},{key:"openMenu",value:function(r){var o=this,s=this.state,a=s.selectValue,l=s.isFocused,u=this.buildFocusableOptions(),c=r==="first"?0:u.length-1;if(!this.props.isMulti){var h=u.indexOf(a[0]);h>-1&&(c=h)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c]},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(r){var o=this.state,s=o.selectValue,a=o.focusedValue;if(!!this.props.isMulti){this.setState({focusedOption:null});var l=s.indexOf(a);a||(l=-1);var u=s.length-1,c=-1;if(!!s.length){switch(r){case"previous":l===0?c=0:l===-1?c=u:c=l-1;break;case"next":l>-1&&l0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,s=this.state.focusedOption,a=this.getFocusableOptions();if(!!a.length){var l=0,u=a.indexOf(s);s||(u=-1),r==="up"?l=u>0?u-1:a.length-1:r==="down"?l=(u+1)%a.length:r==="pageup"?(l=u-o,l<0&&(l=0)):r==="pagedown"?(l=u+o,l>a.length-1&&(l=a.length-1)):r==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Zo):Ne(Ne({},Zo),this.props.theme):Zo}},{key:"getCommonProps",value:function(){var r=this.clearValue,o=this.cx,s=this.getStyles,a=this.getValue,l=this.selectOption,u=this.setValue,c=this.props,h=c.isMulti,d=c.isRtl,g=c.options,y=this.hasValue();return{clearValue:r,cx:o,getStyles:s,getValue:a,hasValue:y,isMulti:h,isRtl:d,options:g,selectOption:l,selectProps:c,setValue:u,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,o=r.isClearable,s=r.isMulti;return o===void 0?s:o}},{key:"isOptionDisabled",value:function(r,o){return hh(this.props,r,o)}},{key:"isOptionSelected",value:function(r,o){return dh(this.props,r,o)}},{key:"filterOption",value:function(r,o){return fh(this.props,r,o)}},{key:"formatOptionLabel",value:function(r,o){if(typeof this.props.formatOptionLabel=="function"){var s=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(r,{context:o,inputValue:s,selectValue:a})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var r=this.props,o=r.isDisabled,s=r.isSearchable,a=r.inputId,l=r.inputValue,u=r.tabIndex,c=r.form,h=this.getComponents(),d=h.Input,g=this.state.inputIsHidden,y=this.commonProps,x=a||this.getElementId("input"),b={"aria-autocomplete":"list","aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"]};return s?k.createElement(d,ne({},y,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:x,innerRef:this.getInputRef,isDisabled:o,isHidden:g,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:l},b)):k.createElement(xS,ne({id:x,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:qi,onFocus:this.onInputFocus,readOnly:!0,disabled:o,tabIndex:u,form:c,value:""},b))}},{key:"renderPlaceholderOrValue",value:function(){var r=this,o=this.getComponents(),s=o.MultiValue,a=o.MultiValueContainer,l=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,h=o.Placeholder,d=this.commonProps,g=this.props,y=g.controlShouldRenderValue,x=g.isDisabled,b=g.isMulti,T=g.inputValue,f=g.placeholder,E=this.state,A=E.selectValue,C=E.focusedValue,O=E.isFocused;if(!this.hasValue()||!y)return T?null:k.createElement(h,ne({},d,{key:"placeholder",isDisabled:x,isFocused:O}),f);if(b){var D=A.map(function(B,Z){var Y=B===C;return k.createElement(s,ne({},d,{components:{Container:a,Label:l,Remove:u},isFocused:Y,isDisabled:x,key:"".concat(r.getOptionValue(B)).concat(Z),index:Z,removeProps:{onClick:function(){return r.removeValue(B)},onTouchEnd:function(){return r.removeValue(B)},onMouseDown:function(K){K.preventDefault(),K.stopPropagation()}},data:B}),r.formatOptionLabel(B,"value"))});return D}if(T)return null;var I=A[0];return k.createElement(c,ne({},d,{data:I,isDisabled:x}),this.formatOptionLabel(I,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),o=r.ClearIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||u)return null;var h={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return k.createElement(o,ne({},s,{innerProps:h,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),o=r.LoadingIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!o||!u)return null;var h={"aria-hidden":"true"};return k.createElement(o,ne({},s,{innerProps:h,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator,s=r.IndicatorSeparator;if(!o||!s)return null;var a=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return k.createElement(s,ne({},a,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator;if(!o)return null;var s=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return k.createElement(o,ne({},s,{innerProps:u,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var r=this,o=this.getComponents(),s=o.Group,a=o.GroupHeading,l=o.Menu,u=o.MenuList,c=o.MenuPortal,h=o.LoadingMessage,d=o.NoOptionsMessage,g=o.Option,y=this.commonProps,x=this.state.focusedOption,b=this.props,T=b.captureMenuScroll,f=b.inputValue,E=b.isLoading,A=b.loadingMessage,C=b.minMenuHeight,O=b.maxMenuHeight,D=b.menuIsOpen,I=b.menuPlacement,B=b.menuPosition,Z=b.menuPortalTarget,Y=b.menuShouldBlockScroll,V=b.menuShouldScrollIntoView,K=b.noOptionsMessage,Q=b.onMenuScrollToTop,le=b.onMenuScrollToBottom;if(!D)return null;var re=function(H,U){var W=H.type,j=H.data,$=H.isDisabled,ae=H.isSelected,we=H.label,me=H.value,Qe=x===j,$e=$?void 0:function(){return r.onOptionHover(j)},et=$?void 0:function(){return r.selectOption(j)},p="".concat(r.getElementId("option"),"-").concat(U),_={id:p,onClick:et,onMouseMove:$e,onMouseOver:$e,tabIndex:-1};return k.createElement(g,ne({},y,{innerProps:_,data:j,isDisabled:$,isSelected:ae,key:p,label:we,type:W,value:me,isFocused:Qe,innerRef:Qe?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(H.data,"menu"))},se;if(this.hasOptions())se=this.getCategorizedOptions().map(function(F){if(F.type==="group"){var H=F.data,U=F.options,W=F.index,j="".concat(r.getElementId("group"),"-").concat(W),$="".concat(j,"-heading");return k.createElement(s,ne({},y,{key:j,data:H,options:U,Heading:a,headingProps:{id:$,data:F.data},label:r.formatGroupLabel(F.data)}),F.options.map(function(ae){return re(ae,"".concat(W,"-").concat(ae.index))}))}else if(F.type==="option")return re(F,"".concat(F.index))});else if(E){var de=A({inputValue:f});if(de===null)return null;se=k.createElement(h,y,de)}else{var pe=K({inputValue:f});if(pe===null)return null;se=k.createElement(d,y,pe)}var G={minMenuHeight:C,maxMenuHeight:O,menuPlacement:I,menuPosition:B,menuShouldScrollIntoView:V},Me=k.createElement(Bc,ne({},y,G),function(F){var H=F.ref,U=F.placerProps,W=U.placement,j=U.maxHeight;return k.createElement(l,ne({},y,G,{innerRef:H,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:E,placement:W}),k.createElement(OS,{captureEnabled:T,onTopArrive:Q,onBottomArrive:le,lockEnabled:Y},function($){return k.createElement(u,ne({},y,{innerRef:function(we){r.getMenuListRef(we),$(we)},isLoading:E,maxHeight:j,focusedOption:x}),se)}))});return Z||B==="fixed"?k.createElement(c,ne({},y,{appendTo:Z,controlElement:this.controlRef,menuPlacement:I,menuPosition:B}),Me):Me}},{key:"renderFormField",value:function(){var r=this,o=this.props,s=o.delimiter,a=o.isDisabled,l=o.isMulti,u=o.name,c=this.state.selectValue;if(!(!u||a))if(l)if(s){var h=c.map(function(y){return r.getOptionValue(y)}).join(s);return k.createElement("input",{name:u,type:"hidden",value:h})}else{var d=c.length>0?c.map(function(y,x){return k.createElement("input",{key:"i-".concat(x),name:u,type:"hidden",value:r.getOptionValue(y)})}):k.createElement("input",{name:u,type:"hidden"});return k.createElement("div",null,d)}else{var g=c[0]?this.getOptionValue(c[0]):"";return k.createElement("input",{name:u,type:"hidden",value:g})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,o=this.state,s=o.ariaSelection,a=o.focusedOption,l=o.focusedValue,u=o.isFocused,c=o.selectValue,h=this.getFocusableOptions();return k.createElement(yS,ne({},r,{ariaSelection:s,focusedOption:a,focusedValue:l,isFocused:u,selectValue:c,focusableOptions:h}))}},{key:"render",value:function(){var r=this.getComponents(),o=r.Control,s=r.IndicatorsContainer,a=r.SelectContainer,l=r.ValueContainer,u=this.props,c=u.className,h=u.id,d=u.isDisabled,g=u.menuIsOpen,y=this.state.isFocused,x=this.commonProps=this.getCommonProps();return k.createElement(a,ne({},x,{className:c,innerProps:{id:h,onKeyDown:this.onKeyDown},isDisabled:d,isFocused:y}),this.renderLiveRegion(),k.createElement(o,ne({},x,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:d,isFocused:y,menuIsOpen:g}),k.createElement(l,ne({},x,{isDisabled:d}),this.renderPlaceholderOrValue(),this.renderInput()),k.createElement(s,ne({},x,{isDisabled:d}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,o){var s=o.prevProps,a=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,u=r.options,c=r.value,h=r.menuIsOpen,d=r.inputValue,g={};if(s&&(c!==s.value||u!==s.options||h!==s.menuIsOpen||d!==s.inputValue)){var y=Dc(c),x=h?VS(r,y):[],b=a?US(o,y):null,T=WS(o,x);g={selectValue:y,focusedOption:T,focusedValue:b,clearFocusValueOnUpdate:!1}}var f=l!=null&&r!==s?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{};return Ne(Ne(Ne({},g),f),{},{prevProps:r})}}]),e}(Pe);mh.defaultProps=zS;var GS={defaultInputValue:"",defaultMenuIsOpen:!1,defaultValue:null},qS=function(t){var e,n;return n=e=function(r){Wi(s,r);var o=Gi(s);function s(){var a;zi(this,s);for(var l=arguments.length,u=new Array(l),c=0;c1?c-1:0),d=1;d{const t=i.content?Ko.find(e=>e.value===i.content):null;return k.createElement("div",{className:"r6o-purposedropdown"},k.createElement(YS,{value:t,onChange:i.onChange,options:Ko,isDisabled:!i.editable}))};const ZS=i=>k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1000 940",width:i.width},k.createElement("metadata",null,"IcoFont Icons"),k.createElement("title",null,"simple-down"),k.createElement("glyph",{glyphName:"simple-down",unicode:"\uEAB2",horizAdvX:"1000"}),k.createElement("path",{fill:"currentColor",d:"M200 392.6l300 300 300-300-85.10000000000002-85.10000000000002-214.89999999999998 214.79999999999995-214.89999999999998-214.89999999999998-85.10000000000002 85.20000000000005z"})),KS=i=>k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"180 150 700 800",width:i.width},k.createElement("metadata",null,"IcoFont Icons"),k.createElement("title",null,"close"),k.createElement("glyph",{glyphName:"close",unicode:"\uEEE4",horizAdvX:"1000"}),k.createElement("path",{fill:"currentColor",d:"M709.8 206.6c-64.39999999999998 65.50000000000003-128.89999999999998 131.20000000000002-194.19999999999993 197.6-8.600000000000023 8.699999999999989-22.400000000000034 8.800000000000011-31 0-65-66-129.70000000000005-131.8-194.5-197.6-8.600000000000023-8.699999999999989-22.400000000000034-8.599999999999994-30.900000000000034 0.09999999999999432-15.699999999999989 16.200000000000017-31.099999999999994 32.30000000000001-47.099999999999994 48.80000000000001-8.5 8.800000000000011-8.299999999999983 23 0.20000000000001705 31.69999999999999 63.099999999999966 64.19999999999999 127.89999999999998 130.10000000000002 193.59999999999997 197 8.600000000000023 8.699999999999989 8.5 22.80000000000001 0 31.599999999999966-65.19999999999999 66.40000000000009-130.2 132.5-194.7 198.10000000000002-8.5 8.700000000000045-8.5 22.800000000000068 0.20000000000001705 31.399999999999977l47.79999999999998 47.90000000000009c8.600000000000023 8.599999999999909 22.600000000000023 8.599999999999909 31.100000000000023-0.10000000000002274l194.2-197.30000000000007c8.600000000000023-8.699999999999932 22.399999999999977-8.699999999999932 31 0 64.70000000000005 65.80000000000007 129.20000000000005 131.4000000000001 194.20000000000005 197.5 8.599999999999909 8.700000000000045 22.5 8.800000000000068 31 0.10000000000002274 16-16.199999999999932 31.699999999999932-32.19999999999993 47.59999999999991-48.299999999999955 8.600000000000023-8.700000000000045 8.600000000000023-22.899999999999977 0.10000000000002274-31.600000000000023-63.799999999999955-65-128.5-130.89999999999998-194.19999999999993-197.79999999999995-8.600000000000023-8.700000000000045-8.600000000000023-22.900000000000034 0-31.600000000000023 65.19999999999993-66.40000000000003 130.0999999999999-132.5 194.5-198.20000000000005 8.599999999999909-8.699999999999989 8.5-22.799999999999955-0.10000000000002274-31.49999999999997l-47.80000000000007-48.099999999999994c-8.5-8.5-22.399999999999977-8.400000000000006-31 0.29999999999998295z"})),JS=i=>k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",width:i.width},k.createElement("path",{fill:"currentColor",d:"M268 416h24a12 12 0 0 0 12-12V188a12 12 0 0 0-12-12h-24a12 12 0 0 0-12 12v216a12 12 0 0 0 12 12zM432 80h-82.41l-34-56.7A48 48 0 0 0 274.41 0H173.59a48 48 0 0 0-41.16 23.3L98.41 80H16A16 16 0 0 0 0 96v16a16 16 0 0 0 16 16h16v336a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128h16a16 16 0 0 0 16-16V96a16 16 0 0 0-16-16zM171.84 50.91A6 6 0 0 1 177 48h94a6 6 0 0 1 5.15 2.91L293.61 80H154.39zM368 464H80V128h288zm-212-48h24a12 12 0 0 0 12-12V188a12 12 0 0 0-12-12h-24a12 12 0 0 0-12 12v216a12 12 0 0 0 12 12z"}));var QS=i=>{const[t,e]=mt(!1),[n,r]=mt(!1),o=h=>{e(!0),r(!1)},s=h=>{i.onDelete(i.body),r(!1)},a=h=>i.onUpdate(i.body,{...i.body,value:h.target.value}),l=h=>i.onUpdate(i.body,{...i.body,purpose:h.value}),u=i.body.modified||i.body.created,c=i.body.creator&&k.createElement("div",{className:"r6o-lastmodified"},k.createElement("span",{className:"r6o-lastmodified-by"},i.body.creator.name||i.body.creator.id),i.body.created&&k.createElement("span",{className:"r6o-lastmodified-at"},k.createElement(Bf,{datetime:i.env.toClientTime(u),locale:Ze.locale()})));return i.readOnly?k.createElement("div",{className:"r6o-widget comment"},k.createElement("div",{className:"r6o-readonly-comment"},i.body.value),c):k.createElement("div",{className:t?"r6o-widget comment editable":"r6o-widget comment"},k.createElement(Yu,{editable:t,content:i.body.value,onChange:a,onSaveAndClose:i.onSaveAndClose}),!t&&c,i.purposeSelector&&k.createElement(gh,{editable:t,content:i.body.purpose,onChange:l,onSaveAndClose:i.onSaveAndClose}),k.createElement("div",{className:n?"r6o-icon r6o-arrow-down r6o-menu-open":"r6o-icon r6o-arrow-down",onClick:()=>r(!n)},k.createElement(ZS,{width:12})),n&&k.createElement(k0,{onEdit:o,onDelete:s,onClickOutside:()=>r(!1)}))};const $S=Ko.map(i=>i.value),vh=(i,t)=>{const e=t?$S.indexOf(i.purpose)>-1:i.purpose=="commenting"||i.purpose=="replying";return i.type==="TextualBody"&&(!Object.prototype.hasOwnProperty.call(i,"purpose")||e)},yh=(i,t)=>{var e,n;if(t.editable===!0)return!1;if(t.editable===!1)return!0;if(t.editable==="MINE_ONLY"){const r=(e=i.creator)==null?void 0:e.id;return((n=t.env.user)==null?void 0:n.id)!==r}return t.readOnly},eE=(i,t)=>i||{type:"TextualBody",value:"",purpose:t?"replying":"commenting",draft:!0},wh=i=>{const t=i.annotation?i.annotation.bodies.filter(l=>vh(l,i.purposeSelector)):[],e=eE(t.find(l=>l.draft==!0),t.length>1),n=t.filter(l=>l!=e),r=l=>{const u=e.value,c=l.target.value;u.length===0&&c.length>0?i.onAppendBody({...e,value:c}):u.length>0&&c.length===0?i.onRemoveBody(e):i.onUpdateBody(e,{...e,value:c})},o=l=>i.onUpdateBody(e,{...e,purpose:l.value}),s=!i.readOnly&&i.annotation,a=n.length===0||!i.disableReply;return k.createElement(k.Fragment,null,n.map((l,u)=>k.createElement(QS,{key:u,env:i.env,purposeSelector:i.purposeSelector,readOnly:yh(l,i),body:l,onUpdate:i.onUpdateBody,onDelete:i.onRemoveBody,onSaveAndClose:i.onSaveAndClose})),s&&a&&k.createElement("div",{className:"r6o-widget comment editable"},k.createElement(Yu,{focus:i.focus,content:e.value,editable:!0,placeholder:n.length>0?Ze.t("Add a reply..."):i.textPlaceHolder||Ze.t("Add a comment..."),onChange:r,onSaveAndClose:()=>i.onSaveAndClose()}),i.purposeSelector&&e.value.length>0&&k.createElement(gh,{editable:!0,content:e.purpose,onChange:o,onSaveAndClose:()=>i.onSaveAndClose()})))};wh.disableDelete=(i,t)=>i.bodies.filter(n=>vh(n,t.purposeSelector)).some(n=>yh(n,t));var bh=wh;function Sh(i,t){i.prototype=Object.create(t.prototype),i.prototype.constructor=i,Ui(i,t)}function tE(i,t){return i.classList?!!t&&i.classList.contains(t):(" "+(i.className.baseVal||i.className)+" ").indexOf(" "+t+" ")!==-1}function nE(i,t){i.classList?i.classList.add(t):tE(i,t)||(typeof i.className=="string"?i.className=i.className+" "+t:i.setAttribute("class",(i.className&&i.className.baseVal||"")+" "+t))}function Eh(i,t){return i.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function iE(i,t){i.classList?i.classList.remove(t):typeof i.className=="string"?i.className=Eh(i.className,t):i.setAttribute("class",Eh(i.className&&i.className.baseVal||"",t))}var xh={disabled:!1},_h=k.createContext(null),Th=function(t){return t.scrollTop},Un="unmounted",Vt="exited",Ut="entering",dn="entered",Jo="exiting",bt=function(i){Sh(t,i);function t(n,r){var o;o=i.call(this,n,r)||this;var s=r,a=s&&!s.isMounting?n.enter:n.appear,l;return o.appearStatus=null,n.in?a?(l=Vt,o.appearStatus=Ut):l=dn:n.unmountOnExit||n.mountOnEnter?l=Un:l=Vt,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(r,o){var s=r.in;return s&&o.status===Un?{status:Vt}:null};var e=t.prototype;return e.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},e.componentDidUpdate=function(r){var o=null;if(r!==this.props){var s=this.state.status;this.props.in?s!==Ut&&s!==dn&&(o=Ut):(s===Ut||s===dn)&&(o=Jo)}this.updateStatus(!1,o)},e.componentWillUnmount=function(){this.cancelNextCallback()},e.getTimeouts=function(){var r=this.props.timeout,o,s,a;return o=s=a=r,r!=null&&typeof r!="number"&&(o=r.exit,s=r.enter,a=r.appear!==void 0?r.appear:s),{exit:o,enter:s,appear:a}},e.updateStatus=function(r,o){if(r===void 0&&(r=!1),o!==null)if(this.cancelNextCallback(),o===Ut){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:k.findDOMNode(this);s&&Th(s)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Vt&&this.setState({status:Un})},e.performEnter=function(r){var o=this,s=this.props.enter,a=this.context?this.context.isMounting:r,l=this.props.nodeRef?[a]:[k.findDOMNode(this),a],u=l[0],c=l[1],h=this.getTimeouts(),d=a?h.appear:h.enter;if(!r&&!s||xh.disabled){this.safeSetState({status:dn},function(){o.props.onEntered(u)});return}this.props.onEnter(u,c),this.safeSetState({status:Ut},function(){o.props.onEntering(u,c),o.onTransitionEnd(d,function(){o.safeSetState({status:dn},function(){o.props.onEntered(u,c)})})})},e.performExit=function(){var r=this,o=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:k.findDOMNode(this);if(!o||xh.disabled){this.safeSetState({status:Vt},function(){r.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:Jo},function(){r.props.onExiting(a),r.onTransitionEnd(s.exit,function(){r.safeSetState({status:Vt},function(){r.props.onExited(a)})})})},e.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},e.safeSetState=function(r,o){o=this.setNextCallback(o),this.setState(r,o)},e.setNextCallback=function(r){var o=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,o.nextCallback=null,r(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},e.onTransitionEnd=function(r,o){this.setNextCallback(o);var s=this.props.nodeRef?this.props.nodeRef.current:k.findDOMNode(this),a=r==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],u=l[0],c=l[1];this.props.addEndListener(u,c)}r!=null&&setTimeout(this.nextCallback,r)},e.render=function(){var r=this.state.status;if(r===Un)return null;var o=this.props,s=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var a=Io(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return k.createElement(_h.Provider,{value:null},typeof s=="function"?s(r,a):k.cloneElement(k.Children.only(s),a))},t}(k.Component);bt.contextType=_h,bt.propTypes={};function fn(){}bt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:fn,onEntering:fn,onEntered:fn,onExit:fn,onExiting:fn,onExited:fn},bt.UNMOUNTED=Un,bt.EXITED=Vt,bt.ENTERING=Ut,bt.ENTERED=dn,bt.EXITING=Jo;var rE=bt,oE=function(t,e){return t&&e&&e.split(" ").forEach(function(n){return nE(t,n)})},Qo=function(t,e){return t&&e&&e.split(" ").forEach(function(n){return iE(t,n)})},$o=function(i){Sh(t,i);function t(){for(var n,r=arguments.length,o=new Array(r),s=0;st.filter(e=>(e.label?e.label:e).toLowerCase().startsWith(i.toLowerCase())),lE=(i,t)=>t(i);var uE=i=>{const t=ot(),[e,n]=mt(i.initialValue||""),[r,o]=mt([]),[s,a]=mt(null);kt(()=>{i.focus&&t.current.querySelector("input").focus({preventScroll:!0})},[]),kt(()=>{i.onChange&&i.onChange(e)},[e]);const l=d=>{if(typeof i.vocabulary=="function"){const g=lE(d,i.vocabulary);g.then?g.then(o):o(g)}else{const g=aE(d,i.vocabulary);o(g)}},u=()=>{if(s!==null)i.onSubmit(r[s]);else{const d=e.trim();if(d){const g=Array.isArray(i.vocabulary)?i.vocabulary.find(y=>(y.label||y).toLowerCase()===d.toLowerCase()):null;g?i.onSubmit(g):i.onSubmit(d)}}n(""),o([]),a(null)},c=d=>{if(d.which===13)u();else if(d.which===27)i.onCancel&&i.onCancel();else if(r.length>0){if(d.which===38)if(s===null)a(0);else{const g=Math.max(0,s-1);a(g)}else if(d.which===40)if(s===null)a(0);else{const g=Math.min(r.length-1,s+1);a(g)}}else d.which===40&&Array.isArray(i.vocabulary)&&o(i.vocabulary)},h=d=>{const{value:g}=d.target;n(g),a(null),g?l(g):o([])};return k.createElement("div",{ref:t,className:"r6o-autocomplete"},k.createElement("div",null,k.createElement("input",{onKeyDown:c,onChange:h,value:e,placeholder:i.placeholder})),k.createElement("ul",null,r.length>0&&r.map((d,g)=>k.createElement("li",{key:`${d.label?d.label:d}${g}`,onClick:u,onMouseEnter:()=>a(g),style:s===g?{backgroundColor:"#bde4ff"}:{}},d.label?d.label:d))))};const cE=i=>i||{type:"TextualBody",value:"",purpose:"tagging",draft:!0};var Ch=i=>{const t=i.annotation?i.annotation.bodies.filter(h=>h.purpose==="tagging"):[],e=cE(t.slice().reverse().find(h=>h.draft)),n=t.filter(h=>h!=e),[r,o]=mt(!1),s=h=>d=>{o(r===h?!1:h)},a=h=>{const d=e.value.trim(),g=h.trim();d.length===0&&g.length>0?i.onAppendBody({...e,value:g}):d.length>0&&g.length===0?i.onRemoveBody(e):d!==g&&i.onUpdateBody(e,{...e,value:g})},l=h=>d=>{d.stopPropagation(),i.onRemoveBody(h)},u=h=>{const d=h.uri?{type:"SpecificResource",purpose:"tagging",source:{id:h.uri,label:h.label}}:{type:"TextualBody",purpose:"tagging",value:h.label||h};e.value.trim().length===0?i.onAppendBody(d):i.onUpdateBody(e,d)},c=h=>h.value||h.source.label;return k.createElement("div",{className:"r6o-widget r6o-tag"},n.length>0&&k.createElement("ul",{className:"r6o-taglist"},n.map(h=>k.createElement("li",{key:c(h),onClick:s(h)},k.createElement("span",{className:"r6o-label"},c(h)),!i.readOnly&&k.createElement(sE,{in:r===h,timeout:200,classNames:"r6o-delete"},k.createElement("span",{className:"r6o-delete-wrapper",onClick:l(h)},k.createElement("span",{className:"r6o-delete"},k.createElement(KS,{width:12}))))))),!i.readOnly&&k.createElement(uE,{focus:i.focus,placeholder:i.textPlaceHolder||Ze.t("Add tag..."),vocabulary:i.vocabulary||[],onChange:a,onSubmit:u}))};class Ph extends Pe{constructor(t){super(t),this.element=k.createRef()}renderWidget(t){const e=this.props.widget({annotation:t.annotation,readOnly:t.readOnly,...t.config,onAppendBody:(n,r)=>t.onAppendBody(n,r),onUpdateBody:(n,r,o)=>t.onUpdateBody(n,r,o),onUpsertBody:(n,r,o)=>t.onUpsertBody(n,r,o),onRemoveBody:(n,r)=>t.onRemoveBody(n,r),onBatchModify:(n,r)=>t.onBatchModify(n,r),onSetProperty:(n,r)=>t.onSetProperty(n,r),onAddContext:n=>t.onAddContext(n),onSaveAndClose:()=>t.onSaveAndClose()});for(;this.element.current.firstChild;)this.element.current.removeChild(this.element.current.lastChild);this.element.current.appendChild(e)}componentDidMount(){this.renderWidget(this.props)}componentWillReceiveProps(t){this.element.current&&this.props.annotation!==t.annotation&&this.renderWidget(t)}render(){return k.createElement("div",{ref:this.element,className:"widget"})}}window.React=k,window.ReactDOM=k;const hE={COMMENT:bh,TAG:Ch},dE=[k.createElement(bh,null),k.createElement(Ch,null)],fE=i=>{const t=n=>{var r;return typeof n=="function"&&!!((r=n.prototype)!=null&&r.isReactComponent)},e=n=>typeof n=="function"&&(String(n).match(/return .+\(['|"].+['|"],\s*\{/g)||String(n).match(/return .+preact_compat/)||String(n).match(/return .+\.createElement/g));return t(i)||e(i)},pE=i=>{const t=(e,n,r)=>{if(typeof e=="string"||e instanceof String)return k.createElement(hE[e],n);if((r==null?void 0:r.toLowerCase())==="react")return k.createElement(e,n);if((r==null?void 0:r.toLowerCase())==="plainjs")return k.createElement(Ph,{widget:e,config:n});if(fE(e))return k.createElement(e,n);if(typeof e=="function"||e instanceof Function)return k.createElement(Ph,{widget:e,config:n});throw`${e} is not a valid plugin`};if(i.widget){const{widget:e,force:n,...r}=i;return t(e,r,n)}else return t(i)},Ah=14;var Oh=(i,t,e,n)=>{const r=i.getBoundingClientRect();t.className="r6o-editor r6o-arrow-top r6o-arrow-left";const{left:o,top:s,right:a,bottom:l}=e.getBoundingClientRect();if(t.style.top=`${l-r.top+Ah}px`,t.style.left=`${o-r.left}px`,n){const u=t.children[1].getBoundingClientRect(),{innerWidth:c,innerHeight:h}=i.ownerDocument.defaultView;if(u.right>c&&(t.classList.remove("r6o-arrow-left"),t.classList.add("r6o-arrow-right"),t.style.left=`${a-u.width-r.left}px`),u.bottom>h){t.classList.remove("r6o-arrow-top"),t.classList.add("r6o-arrow-bottom");const g=t.children[1].getBoundingClientRect().height;t.style.top=`${s-r.top-g-Ah}px`}const d=t.children[1].getBoundingClientRect();if(d.top<0){t.classList.add("pushed","down"),t.style.top=`${-r.top}px`;const g=l-r.top;d.height-r.top>g&&t.classList.remove("r6o-arrow-bottom")}d.left<0&&(t.classList.add("pushed","right"),t.style.left=`${-r.left}px`),requestAnimationFrame(()=>t.style.opacity=1)}};const Dh=i=>{const{top:t,left:e,width:n,height:r}=i.getBoundingClientRect();return`${t}, ${e}, ${n}, ${r}`};class mE extends Pe{constructor(e){super(e);P(this,"initResizeObserver",()=>{const e=this.props.autoPosition===void 0?!0:this.props.autoPosition;if(window!=null&&window.ResizeObserver){const n=new ResizeObserver(()=>{this.state.dragged||Oh(this.props.wrapperEl,this.element.current,this.props.selectedElement,e)});return n.observe(this.props.wrapperEl),()=>n.disconnect()}else this.state.dragged||Oh(this.props.wrapperEl,this.element.current,this.props.selectedElement,e)});P(this,"creationMeta",e=>{const n={},{user:r}=this.props.env;return r&&(n.creator={},r.id&&(n.creator.id=r.id),r.displayName&&(n.creator.name=r.displayName),n[e.created?"modified":"created"]=this.props.env.getCurrentTimeAdjusted()),n});P(this,"getCurrentAnnotation",()=>this.state.currentAnnotation.clone());P(this,"hasChanges",()=>{var e;return!((e=this.props.annotation)!=null&&e.isEqual(this.state.currentAnnotation))});P(this,"updateCurrentAnnotation",(e,n)=>{this.setState({currentAnnotation:this.state.currentAnnotation.clone(e)},()=>{n?this.onOk():this.props.onChanged&&this.props.onChanged()})});P(this,"onAppendBody",(e,n)=>this.updateCurrentAnnotation({body:[...this.state.currentAnnotation.bodies,{...e,...this.creationMeta(e)}]},n));P(this,"onUpdateBody",(e,n,r)=>this.updateCurrentAnnotation({body:this.state.currentAnnotation.bodies.map(o=>o===e?{...n,...this.creationMeta(n)}:o)},r));P(this,"onRemoveBody",(e,n)=>this.updateCurrentAnnotation({body:this.state.currentAnnotation.bodies.filter(r=>r!==e)},n));P(this,"onUpsertBody",(e,n,r)=>{if(e==null&&n!=null)this.onAppendBody(n,r);else if(e!=null&&n!=null)this.onUpdateBody(e,n,r);else if(e!=null&&n==null){const o=this.state.currentAnnotation.bodies.find(s=>s.purpose===e.purpose);o?this.onUpdateBody(o,e,r):this.onAppendBody(e,r)}});P(this,"onBatchModify",(e,n)=>{const r=e.filter(u=>u.action==="upsert"&&u.body).map(u=>({previous:this.state.currentAnnotation.bodies.find(c=>c.purpose===u.body.purpose),updated:{...u.body,...this.creationMeta(u.body)}})),o=e.filter(u=>u.action==="remove").map(u=>u.body),s=[...e.filter(u=>u.action==="append"||u.action==="upsert"&&u.updated&&!u.previous).map(u=>({...u.body,...this.creationMeta(u.body)})),...r.filter(u=>!u.previous).map(u=>u.updated)],a=[...e.filter(u=>u.action==="update"||u.action==="upsert"&&u.updated&&u.previous).map(u=>({previous:u.previous,updated:{...u.updated,...this.creationMeta(u.updated)}})),...r.filter(u=>u.previous)],l=[...this.state.currentAnnotation.bodies.filter(u=>!o.includes(u)).map(u=>{const c=a.find(h=>h.previous===u);return c?c.updated:u}),...s];this.updateCurrentAnnotation({body:l},n)});P(this,"onSetProperty",(e,n)=>{if(["@context","id","type","body","target"].includes(e))throw new Exception(`Cannot set ${e} - not allowed`);if(n)this.updateCurrentAnnotation({[e]:n});else{const o=this.currentAnnotation.clone();delete o[e],this.setState({currentAnnotation:o})}});P(this,"onAddContext",e=>{const{currentAnnotation:n}=this.state,r=Array.isArray(n.context)?n.context:[n.context];r.indexOf(e)<0&&(r.push(e),this.updateCurrentAnnotation({"@context":r}))});P(this,"onCancel",()=>this.props.onCancel(this.props.annotation));P(this,"onOk",()=>{const e=r=>r.clone({body:r.bodies.map(({draft:o,...s})=>s)}),{currentAnnotation:n}=this.state;n.bodies.length===0&&!this.props.allowEmpty?n.isSelection?this.onCancel():this.props.onAnnotationDeleted(this.props.annotation):n.isSelection?this.props.onAnnotationCreated(e(n).toAnnotation()):this.props.onAnnotationUpdated(e(n),this.props.annotation)});P(this,"onDelete",()=>this.props.onAnnotationDeleted(this.props.annotation));this.element=k.createRef(),this.state={currentAnnotation:e.annotation,dragged:!1,selectionBounds:Dh(e.selectedElement)}}componentWillReceiveProps(e){var o;const{selectionBounds:n}=this.state,r=Dh(e.selectedElement);(o=this.props.annotation)!=null&&o.isEqual(e.annotation)?this.setState({selectionBounds:r}):this.setState({currentAnnotation:e.annotation,selectionBounds:r}),this.props.modifiedTarget!=e.modifiedTarget&&this.state.currentAnnotation&&this.updateCurrentAnnotation({target:this.props.modifiedTarget}),n!=r&&this.element.current&&(this.removeObserver&&this.removeObserver(),this.removeObserver=this.initResizeObserver())}componentDidMount(){this.removeObserver=this.initResizeObserver(),new MutationObserver(()=>{this.element.current&&(this.removeObserver&&this.removeObserver(),this.removeObserver=this.initResizeObserver())}).observe(this.element.current,{childList:!0,subtree:!0})}componentWillUnmount(){this.removeObserver&&this.removeObserver()}render(){const{currentAnnotation:e}=this.state,n=this.props.widgets?this.props.widgets.map(pE):dE,r=s=>s.type.disableDelete?s.type.disableDelete(e,{...s.props,readOnly:this.props.readOnly,env:this.props.env}):!1,o=e&&(e.bodies.length>0||this.props.allowEmpty)&&!this.props.readOnly&&!e.isSelection&&!n.some(r);return k.createElement(xf,{disabled:!this.props.detachable,handle:".r6o-draggable",cancel:".r6o-btn, .r6o-btn *",onDrag:()=>this.setState({dragged:!0})},k.createElement("div",{ref:this.element,className:this.state.dragged?"r6o-editor dragged":"r6o-editor"},k.createElement("div",{className:"r6o-arrow"}),k.createElement("div",{className:"r6o-editor-inner"},n.map((s,a)=>k.cloneElement(s,{key:`${a}`,focus:a===0,annotation:e,readOnly:this.props.readOnly,env:this.props.env,onAppendBody:this.onAppendBody,onUpdateBody:this.onUpdateBody,onRemoveBody:this.onRemoveBody,onUpsertBody:this.onUpsertBody,onBatchModify:this.onBatchModify,onSetProperty:this.onSetProperty,onAddContext:this.onAddContext,onSaveAndClose:this.onOk})),this.props.readOnly?k.createElement("div",{className:"r6o-footer"},k.createElement("button",{className:"r6o-btn",onClick:this.onCancel},Ze.t("Close"))):k.createElement("div",{className:this.props.detachable?"r6o-footer r6o-draggable":"r6o-footer"},o&&k.createElement("button",{className:"r6o-btn left delete-annotation",title:Ze.t("Delete"),onClick:this.onDelete},k.createElement(JS,{width:12})),k.createElement("button",{className:"r6o-btn outline",onClick:this.onCancel},Ze.t("Cancel")),k.createElement("button",{className:"r6o-btn ",onClick:this.onOk},Ze.t("Ok"))))))}}var Ji,gE=new Uint8Array(16);function vE(){if(!Ji&&(Ji=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Ji))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ji(gE)}var yE=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function wE(i){return typeof i=="string"&&yE.test(i)}for(var He=[],es=0;es<256;++es)He.push((es+256).toString(16).substr(1));function bE(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=(He[i[t+0]]+He[i[t+1]]+He[i[t+2]]+He[i[t+3]]+"-"+He[i[t+4]]+He[i[t+5]]+"-"+He[i[t+6]]+He[i[t+7]]+"-"+He[i[t+8]]+He[i[t+9]]+"-"+He[i[t+10]]+He[i[t+11]]+He[i[t+12]]+He[i[t+13]]+He[i[t+14]]+He[i[t+15]]).toLowerCase();if(!wE(e))throw TypeError("Stringified UUID is invalid");return e}function Rh(i,t,e){i=i||{};var n=i.random||(i.rng||vE)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){e=e||0;for(var r=0;r<16;++r)t[e+r]=n[r];return t}return bE(n)}var SE=function i(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,o;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!i(t[r],e[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){var s=o[r];if(!i(t[s],e[s]))return!1}return!0}return t!==t&&e!==e},Mh=SE;const lr=class{constructor(t,e){P(this,"clone",(t,e)=>new lr({...this.underlying,...t},{...this.opts,...e}));P(this,"selector",t=>{const{target:e}=this.underlying;if(e.selector)return(Array.isArray(e.selector)?e.selector:[e.selector]).find(r=>r.type===t)});this.underlying=t,this.opts=e}isEqual(t){return(t==null?void 0:t.type)!=="Annotation"?!1:this.underlying===t.underlying?!0:!this.underlying.id||!t.underlying.id?!1:Mh(this.underlying,t.underlying)}get readOnly(){var t;return(t=this.opts)==null?void 0:t.readOnly}get id(){return this.underlying.id}get context(){return this.underlying["@context"]}get type(){return this.underlying.type}get motivation(){return this.underlying.motivation}get body(){return this.underlying.body}get target(){return this.underlying.target}get bodies(){return Array.isArray(this.underlying.body)?this.underlying.body:[this.underlying.body]}set bodies(t){this.underlying.body=t}get targets(){return Array.isArray(this.underlying.target)?this.underlying.target:[this.underlying.target]}get quote(){var t;return(t=this.selector("TextQuoteSelector"))==null?void 0:t.exact}get start(){var t;return(t=this.selector("TextPositionSelector"))==null?void 0:t.start}get end(){var t;return(t=this.selector("TextPositionSelector"))==null?void 0:t.end}};let St=lr;P(St,"create",t=>{const e={"@context":"http://www.w3.org/ns/anno.jsonld",type:"Annotation",id:`#${Rh()}`,body:[]};return new lr({...e,...t})});class Wn{constructor(t,e){P(this,"clone",t=>{const e=new Wn;return e.underlying=JSON.parse(JSON.stringify(this.underlying)),t&&(e.underlying={...e.underlying,...t}),e});P(this,"selector",t=>{const{target:e}=this.underlying;if(e.selector)return(Array.isArray(e.selector)?e.selector:[e.selector]).find(r=>r.type===t)});P(this,"toAnnotation",()=>{const t=Object.assign({},this.underlying,{type:"Annotation",id:`#${Rh()}`});return new St(t)});this.underlying={"@context":"http://www.w3.org/ns/anno.jsonld",type:"Selection",body:e||[],target:t}}get context(){return this.underlying["@context"]}get type(){return this.underlying.type}get body(){return this.underlying.body}get target(){return this.underlying.target}get targets(){return Array.isArray(this.underlying.target)?this.underlying.target:[this.underlying.target]}isEqual(t){return t?Mh(this.underlying,t.underlying):!1}get bodies(){return Array.isArray(this.underlying.body)?this.underlying.body:[this.underlying.body]}get quote(){var t;return(t=this.selector("TextQuoteSelector"))==null?void 0:t.exact}get isSelection(){return!0}}let ts=0;var EE=()=>({setServerTime:i=>{const t=Date.now();ts=i-t},getCurrentTimeAdjusted:()=>new Date(Date.now()+ts).toISOString(),toClientTime:i=>Date.parse(i)-ts});const xE=(i,t)=>{if(i){const e=i==="auto"?window.navigator.userLanguage||window.navigator.language:i,n=e.split("-")[0].toLowerCase(),r=[e,n].find(o=>F0.includes(o));r||console.warn(`Unsupported locale '${e}'. Falling back to default en.`),Ze.init(r,t)}else Ze.init(null,t)};var Fh={exports:{}};(function(i){//! openseadragon 3.0.0 -//! Built on 2021-12-15 -//! Git commit: v3.0.0-0-3eded36 -//! http://openseadragon.github.io -//! License: http://openseadragon.github.io/license/ -function t(e){return new t.Viewer(e)}(function(e){e.version={versionStr:"3.0.0",major:parseInt("3",10),minor:parseInt("0",10),revision:parseInt("0",10)};var n={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object"},r=Object.prototype.toString,o=Object.prototype.hasOwnProperty;e.isFunction=function(s){return e.type(s)==="function"},e.isArray=Array.isArray||function(s){return e.type(s)==="array"},e.isWindow=function(s){return s&&typeof s=="object"&&"setInterval"in s},e.type=function(s){return s==null?String(s):n[r.call(s)]||"object"},e.isPlainObject=function(s){if(!s||t.type(s)!=="object"||s.nodeType||e.isWindow(s)||s.constructor&&!o.call(s,"constructor")&&!o.call(s.constructor.prototype,"isPrototypeOf"))return!1;var a;for(var l in s)a=l;return a===void 0||o.call(s,a)},e.isEmptyObject=function(s){for(var a in s)return!1;return!0},e.freezeObject=function(s){return Object.freeze?e.freezeObject=Object.freeze:e.freezeObject=function(a){return a},e.freezeObject(s)},e.supportsCanvas=function(){var s=document.createElement("canvas");return!!(e.isFunction(s.getContext)&&s.getContext("2d"))}(),e.isCanvasTainted=function(s){var a=!1;try{s.getContext("2d").getImageData(0,0,1,1)}catch{a=!0}return a},e.supportsAddEventListener=function(){return!!(document.documentElement.addEventListener&&document.addEventListener)}(),e.supportsRemoveEventListener=function(){return!!(document.documentElement.removeEventListener&&document.removeEventListener)}(),e.supportsEventListenerOptions=function(){var s=0;if(e.supportsAddEventListener)try{var a={get capture(){return s++,!1},get once(){return s++,!1},get passive(){return s++,!1}};window.addEventListener("test",null,a),window.removeEventListener("test",null,a)}catch{s=0}return s>=3}(),e.getCurrentPixelDensityRatio=function(){if(e.supportsCanvas){var s=document.createElement("canvas").getContext("2d"),a=window.devicePixelRatio||1,l=s.webkitBackingStorePixelRatio||s.mozBackingStorePixelRatio||s.msBackingStorePixelRatio||s.oBackingStorePixelRatio||s.backingStorePixelRatio||1;return Math.max(a,1)/l}else return 1},e.pixelDensityRatio=e.getCurrentPixelDensityRatio()})(t),function(e){e.extend=function(){var l,u,c,h,d,g,y=arguments[0]||{},x=arguments.length,b=!1,T=1;for(typeof y=="boolean"&&(b=y,y=arguments[1]||{},T=2),typeof y!="object"&&!t.isFunction(y)&&(y={}),x===T&&(y=this,--T);T=c.x&&u.x=c.y},getMousePosition:function(l){if(typeof l.pageX=="number")e.getMousePosition=function(u){var c=new e.Point;return c.x=u.pageX,c.y=u.pageY,c};else if(typeof l.clientX=="number")e.getMousePosition=function(u){var c=new e.Point;return c.x=u.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,c.y=u.clientY+document.body.scrollTop+document.documentElement.scrollTop,c};else throw new Error("Unknown event mouse position, no known technique.");return e.getMousePosition(l)},getPageScroll:function(){var l=document.documentElement||{},u=document.body||{};if(typeof window.pageXOffset=="number")e.getPageScroll=function(){return new e.Point(window.pageXOffset,window.pageYOffset)};else if(u.scrollLeft||u.scrollTop)e.getPageScroll=function(){return new e.Point(document.body.scrollLeft,document.body.scrollTop)};else if(l.scrollLeft||l.scrollTop)e.getPageScroll=function(){return new e.Point(document.documentElement.scrollLeft,document.documentElement.scrollTop)};else return new e.Point(0,0);return e.getPageScroll()},setPageScroll:function(l){if(typeof window.scrollTo!="undefined")e.setPageScroll=function(h){window.scrollTo(h.x,h.y)};else{var u=e.getPageScroll();if(u.x===l.x&&u.y===l.y)return;document.body.scrollLeft=l.x,document.body.scrollTop=l.y;var c=e.getPageScroll();if(c.x!==u.x&&c.y!==u.y){e.setPageScroll=function(h){document.body.scrollLeft=h.x,document.body.scrollTop=h.y};return}if(document.documentElement.scrollLeft=l.x,document.documentElement.scrollTop=l.y,c=e.getPageScroll(),c.x!==u.x&&c.y!==u.y){e.setPageScroll=function(h){document.documentElement.scrollLeft=h.x,document.documentElement.scrollTop=h.y};return}e.setPageScroll=function(h){}}e.setPageScroll(l)},getWindowSize:function(){var l=document.documentElement||{},u=document.body||{};if(typeof window.innerWidth=="number")e.getWindowSize=function(){return new e.Point(window.innerWidth,window.innerHeight)};else if(l.clientWidth||l.clientHeight)e.getWindowSize=function(){return new e.Point(document.documentElement.clientWidth,document.documentElement.clientHeight)};else if(u.clientWidth||u.clientHeight)e.getWindowSize=function(){return new e.Point(document.body.clientWidth,document.body.clientHeight)};else throw new Error("Unknown window size, no known technique.");return e.getWindowSize()},makeCenteredNode:function(l){l=e.getElement(l);var u=[e.makeNeutralElement("div"),e.makeNeutralElement("div"),e.makeNeutralElement("div")];return e.extend(u[0].style,{display:"table",height:"100%",width:"100%"}),e.extend(u[1].style,{display:"table-row"}),e.extend(u[2].style,{display:"table-cell",verticalAlign:"middle",textAlign:"center"}),u[0].appendChild(u[1]),u[1].appendChild(u[2]),u[2].appendChild(l),u[0]},makeNeutralElement:function(l){var u=document.createElement(l),c=u.style;return c.background="transparent none",c.border="none",c.margin="0px",c.padding="0px",c.position="static",u},now:function(){return Date.now?e.now=Date.now:e.now=function(){return new Date().getTime()},e.now()},makeTransparentImage:function(l){var u=e.makeNeutralElement("img");return u.src=l,u},setElementOpacity:function(l,u,c){var h,d;l=e.getElement(l),c&&!e.Browser.alpha&&(u=Math.round(u)),e.Browser.opacity?l.style.opacity=u<1?u:"":u<1?(h=Math.round(100*u),d="alpha(opacity="+h+")",l.style.filter=d):l.style.filter=""},setElementTouchActionNone:function(l){l=e.getElement(l),typeof l.style.touchAction!="undefined"?l.style.touchAction="none":typeof l.style.msTouchAction!="undefined"&&(l.style.msTouchAction="none")},setElementPointerEvents:function(l,u){l=e.getElement(l),typeof l.style.pointerEvents!="undefined"&&(l.style.pointerEvents=u)},setElementPointerEventsNone:function(l){e.setElementPointerEvents(l,"none")},addClass:function(l,u){l=e.getElement(l),l.className?(" "+l.className+" ").indexOf(" "+u+" ")===-1&&(l.className+=" "+u):l.className=u},indexOf:function(l,u,c){return Array.prototype.indexOf?this.indexOf=function(h,d,g){return h.indexOf(d,g)}:this.indexOf=function(h,d,g){var y,x=g||0,b;if(!h)throw new TypeError;if(b=h.length,b===0||x>=b)return-1;for(x<0&&(x=b-Math.abs(x)),y=x;y=200&&x.status<300||x.status===0&&y!=="http:"&&y!=="https:"?u(x):(e.console.log("AJAX request returned %d: %s",x.status,l),e.isFunction(c)&&c(x)))};try{if(x.open("GET",l,!0),g&&(x.responseType=g),d)for(var b in d)Object.prototype.hasOwnProperty.call(d,b)&&d[b]&&x.setRequestHeader(b,d[b]);h&&(x.withCredentials=!0),x.send(null)}catch(T){e.console.log("%s while making AJAX request: %s",T.name,T.message),x.onreadystatechange=function(){},e.isFunction(c)&&c(x,T)}return x},jsonp:function(l){var u,c=l.url,h=document.head||document.getElementsByTagName("head")[0]||document.documentElement,d=l.callbackName||"openseadragon"+e.now(),g=window[d],y="$1"+d+"$2",x=l.param||"callback",b=l.callback;c=c.replace(/(=)\?(&|$)|\?\?/i,y),c+=(/\?/.test(c)?"&":"?")+x+"="+d,window[d]=function(T){if(g)window[d]=g;else try{delete window[d]}catch{}b&&e.isFunction(b)&&b(T)},u=document.createElement("script"),(l.async!==void 0||l.async!==!1)&&(u.async="async"),l.scriptCharset&&(u.charset=l.scriptCharset),u.src=c,u.onload=u.onreadystatechange=function(T,f){(f||!u.readyState||/loaded|complete/.test(u.readyState))&&(u.onload=u.onreadystatechange=null,h&&u.parentNode&&h.removeChild(u),u=void 0)},h.insertBefore(u,h.firstChild)},createFromDZI:function(){throw"OpenSeadragon.createFromDZI is deprecated, use Viewer.open."},parseXml:function(l){if(window.DOMParser)e.parseXml=function(u){var c=null,h;return h=new DOMParser,c=h.parseFromString(u,"text/xml"),c};else if(window.ActiveXObject)e.parseXml=function(u){var c=null;return c=new ActiveXObject("Microsoft.XMLDOM"),c.async=!1,c.loadXML(u),c};else throw new Error("Browser doesn't support XML DOM.");return e.parseXml(l)},parseJSON:function(l){return e.parseJSON=window.JSON.parse,e.parseJSON(l)},imageFormatSupported:function(l){return l=l||"",!!o[l.toLowerCase()]},setImageFormatsSupported:function(l){e.extend(o,l)}});var r=function(l){};e.console=window.console||{log:r,debug:r,info:r,warn:r,error:r,assert:r},e.Browser={vendor:e.BROWSERS.UNKNOWN,version:0,alpha:!0};var o={bmp:!1,jpeg:!0,jpg:!0,png:!0,tif:!1,wdp:!1},s={};(function(){var l=navigator.appVersion,u=navigator.userAgent,c;switch(navigator.appName){case"Microsoft Internet Explorer":!!window.attachEvent&&!!window.ActiveXObject&&(e.Browser.vendor=e.BROWSERS.IE,e.Browser.version=parseFloat(u.substring(u.indexOf("MSIE")+5,u.indexOf(";",u.indexOf("MSIE")))));break;case"Netscape":window.addEventListener&&(u.indexOf("Edge")>=0?(e.Browser.vendor=e.BROWSERS.EDGE,e.Browser.version=parseFloat(u.substring(u.indexOf("Edge")+5))):u.indexOf("Edg")>=0?(e.Browser.vendor=e.BROWSERS.CHROMEEDGE,e.Browser.version=parseFloat(u.substring(u.indexOf("Edg")+4))):u.indexOf("Firefox")>=0?(e.Browser.vendor=e.BROWSERS.FIREFOX,e.Browser.version=parseFloat(u.substring(u.indexOf("Firefox")+8))):u.indexOf("Safari")>=0?(e.Browser.vendor=u.indexOf("Chrome")>=0?e.BROWSERS.CHROME:e.BROWSERS.SAFARI,e.Browser.version=parseFloat(u.substring(u.substring(0,u.indexOf("Safari")).lastIndexOf("/")+1,u.indexOf("Safari")))):(c=new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})"),c.exec(u)!==null&&(e.Browser.vendor=e.BROWSERS.IE,e.Browser.version=parseFloat(RegExp.$1))));break;case"Opera":e.Browser.vendor=e.BROWSERS.OPERA,e.Browser.version=parseFloat(l);break}var h=window.location.search.substring(1),d=h.split("&"),g,y,x;for(x=0;x0){var b=g.substring(0,y),T=g.substring(y+1);try{s[b]=decodeURIComponent(T)}catch{e.console.error("Ignoring malformed URL parameter: %s=%s",b,T)}}e.Browser.alpha=!(e.Browser.vendor===e.BROWSERS.CHROME&&e.Browser.version<2),e.Browser.opacity=!0,e.Browser.vendor===e.BROWSERS.IE&&e.Browser.version<11&&e.console.error("Internet Explorer versions < 11 are not supported by OpenSeadragon")})(),function(l){var u=l.requestAnimationFrame||l.mozRequestAnimationFrame||l.webkitRequestAnimationFrame||l.msRequestAnimationFrame,c=l.cancelAnimationFrame||l.mozCancelAnimationFrame||l.webkitCancelAnimationFrame||l.msCancelAnimationFrame;if(u&&c)e.requestAnimationFrame=function(){return u.apply(l,arguments)},e.cancelAnimationFrame=function(){return c.apply(l,arguments)};else{var h=[],d=[],g=0,y;e.requestAnimationFrame=function(x){return h.push([++g,x]),y||(y=setInterval(function(){if(h.length){var b=e.now(),T=d;for(d=h,h=T;d.length;)d.shift()[1](b)}else clearInterval(y),y=void 0},1e3/50)),g},e.cancelAnimationFrame=function(x){var b,T;for(b=0,T=h.length;b8||"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",e.MouseTracker.subscribeEvents=["click","dblclick","keydown","keyup","keypress","focus","blur","contextmenu",e.MouseTracker.wheelEventName],e.MouseTracker.wheelEventName==="DOMMouseScroll"&&e.MouseTracker.subscribeEvents.push("MozMousePixelScroll"),window.PointerEvent?(e.MouseTracker.havePointerEvents=!0,e.MouseTracker.subscribeEvents.push("pointerenter","pointerleave","pointerover","pointerout","pointerdown","pointerup","pointermove","pointercancel"),e.MouseTracker.havePointerCapture=function(){var v=document.createElement("div");return e.isFunction(v.setPointerCapture)&&e.isFunction(v.releasePointerCapture)}(),e.MouseTracker.havePointerCapture&&e.MouseTracker.subscribeEvents.push("gotpointercapture","lostpointercapture")):(e.MouseTracker.havePointerEvents=!1,e.MouseTracker.subscribeEvents.push("mouseenter","mouseleave","mouseover","mouseout","mousedown","mouseup","mousemove"),e.MouseTracker.mousePointerId="legacy-mouse",e.MouseTracker.havePointerCapture=function(){var v=document.createElement("div");return e.isFunction(v.setCapture)&&e.isFunction(v.releaseCapture)}(),e.MouseTracker.havePointerCapture&&e.MouseTracker.subscribeEvents.push("losecapture"),"ontouchstart"in window&&e.MouseTracker.subscribeEvents.push("touchstart","touchend","touchmove","touchcancel"),"ongesturestart"in window&&e.MouseTracker.subscribeEvents.push("gesturestart","gesturechange")),e.MouseTracker.GesturePointList=function(v){this._gPoints=[],this.type=v,this.buttons=0,this.contacts=0,this.clicks=0,this.captureCount=0},e.MouseTracker.GesturePointList.prototype={getLength:function(){return this._gPoints.length},asArray:function(){return this._gPoints},add:function(v){return this._gPoints.push(v)},removeById:function(v){var m,w=this._gPoints.length;for(m=0;m1&&(this.type==="mouse"||this.type==="pen")&&(e.console.warn("GesturePointList.addContact() Implausible contacts value"),this.contacts=1)},removeContact:function(){--this.contacts,this.contacts<0&&(e.console.warn("GesturePointList.removeContact() Implausible contacts value"),this.contacts=0)}};function s(v){var m=n[v.hash],w,S,M,z,ee,Ee=m.activePointersLists.length;for(w=0;w0){for(ee=[],z=M.asArray(),S=0;Sm.touches.length-M&&e.console.warn("Tracked touch contact count doesn't match event.touches.length");var Ee={originalEvent:m,eventType:"pointerdown",pointerType:"touch",isEmulated:!1};for(L(v,Ee),S=0;S0&&m.removeContact(),S=m.removeById(w.id)):S=m.getLength(),S}function N(v,m){switch(m.eventType){case"pointermove":m.isStoppable=!0,m.isCancelable=!0,m.preventDefault=!1,m.preventGesture=!v.hasGestureHandlers,m.stopPropagation=!1;break;case"pointerover":case"pointerout":case"contextmenu":case"keydown":case"keyup":case"keypress":m.isStoppable=!0,m.isCancelable=!0,m.preventDefault=!1,m.preventGesture=!1,m.stopPropagation=!1;break;case"pointerdown":m.isStoppable=!0,m.isCancelable=!0,m.preventDefault=!1,m.preventGesture=!v.hasGestureHandlers,m.stopPropagation=!1;break;case"pointerup":m.isStoppable=!0,m.isCancelable=!0,m.preventDefault=!1,m.preventGesture=!v.hasGestureHandlers,m.stopPropagation=!1;break;case"wheel":m.isStoppable=!0,m.isCancelable=!0,m.preventDefault=!1,m.preventGesture=!v.hasScrollHandler,m.stopPropagation=!1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":m.isStoppable=!0,m.isCancelable=!1,m.preventDefault=!1,m.preventGesture=!1,m.stopPropagation=!1;break;case"click":m.isStoppable=!0,m.isCancelable=!0,m.preventDefault=!!v.clickHandler,m.preventGesture=!1,m.stopPropagation=!1;break;case"dblclick":m.isStoppable=!0,m.isCancelable=!0,m.preventDefault=!!v.dblClickHandler,m.preventGesture=!1,m.stopPropagation=!1;break;case"focus":case"blur":case"pointerenter":case"pointerleave":default:m.isStoppable=!1,m.isCancelable=!1,m.preventDefault=!1,m.preventGesture=!1,m.stopPropagation=!1;break}}function L(v,m){m.eventSource=v,m.eventPhase=m.originalEvent&&typeof m.originalEvent.eventPhase!="undefined"?m.originalEvent.eventPhase:0,m.defaultPrevented=e.eventIsCanceled(m.originalEvent),m.shouldCapture=!1,m.shouldReleaseCapture=!1,m.userData=v.userData,N(v,m),v.preProcessEventHandler&&v.preProcessEventHandler(m)}function J(v,m,w){var S=v.getActivePointersListByType(m.type),M=S.getById(m.id);M?w&&!M.captured?(M.captured=!0,S.captureCount++):!w&&M.captured&&(M.captured=!1,S.captureCount--,S.captureCount<0&&(S.captureCount=0,e.console.warn("updatePointerCaptured() - pointsList.captureCount went negative"))):e.console.warn("updatePointerCaptured() called on untracked pointer")}function q(v,m,w){var S=v.getActivePointersListByType(w.type),M;M=S.getById(w.id),M?(M.insideElement=!0,M.lastPos=M.currentPos,M.lastTime=M.currentTime,M.currentPos=w.currentPos,M.currentTime=w.currentTime,w=M):(w.captured=!1,w.insideElementPressed=!1,w.insideElement=!0,_(S,w)),v.enterHandler&&v.enterHandler({eventSource:v,pointerType:w.type,position:T(w.currentPos,v.element),buttons:S.buttons,pointers:v.getActivePointerCount(),insideElementPressed:w.insideElementPressed,buttonDownAny:S.buttons!==0,isTouchEvent:w.type==="touch",originalEvent:m.originalEvent,userData:v.userData})}function fe(v,m,w){var S=v.getActivePointersListByType(w.type),M,z;M=S.getById(w.id),M?(M.captured?(M.insideElement=!1,M.lastPos=M.currentPos,M.lastTime=M.currentTime,M.currentPos=w.currentPos,M.currentTime=w.currentTime):R(v,S,M),w=M):(w.captured=!1,w.insideElementPressed=!1),(v.leaveHandler||v.exitHandler)&&(z={eventSource:v,pointerType:w.type,position:w.currentPos&&T(w.currentPos,v.element),buttons:S.buttons,pointers:v.getActivePointerCount(),insideElementPressed:w.insideElementPressed,buttonDownAny:S.buttons!==0,isTouchEvent:w.type==="touch",originalEvent:m.originalEvent,userData:v.userData},v.leaveHandler&&v.leaveHandler(z),v.exitHandler&&v.exitHandler(z))}function Se(v,m,w){var S,M;S=v.getActivePointersListByType(w.type),M=S.getById(w.id),M?w=M:(w.captured=!1,w.insideElementPressed=!1),v.overHandler&&v.overHandler({eventSource:v,pointerType:w.type,position:T(w.currentPos,v.element),buttons:S.buttons,pointers:v.getActivePointerCount(),insideElementPressed:w.insideElementPressed,buttonDownAny:S.buttons!==0,isTouchEvent:w.type==="touch",originalEvent:m.originalEvent,userData:v.userData})}function ge(v,m,w){var S,M;S=v.getActivePointersListByType(w.type),M=S.getById(w.id),M?w=M:(w.captured=!1,w.insideElementPressed=!1),v.outHandler&&v.outHandler({eventSource:v,pointerType:w.type,position:w.currentPos&&T(w.currentPos,v.element),buttons:S.buttons,pointers:v.getActivePointerCount(),insideElementPressed:w.insideElementPressed,buttonDownAny:S.buttons!==0,isTouchEvent:w.type==="touch",originalEvent:m.originalEvent,userData:v.userData})}function oe(v,m,w,S){var M=n[v.hash],z=v.getActivePointersListByType(w.type),ee;if(typeof m.originalEvent.buttons!="undefined"?z.buttons=m.originalEvent.buttons:S===0?z.buttons|=1:S===1?z.buttons|=4:S===2?z.buttons|=2:S===3?z.buttons|=8:S===4?z.buttons|=16:S===5&&(z.buttons|=32),S!==0){m.shouldCapture=!1,m.shouldReleaseCapture=!1,v.nonPrimaryPressHandler&&!m.preventGesture&&!m.defaultPrevented&&(m.preventDefault=!0,v.nonPrimaryPressHandler({eventSource:v,pointerType:w.type,position:T(w.currentPos,v.element),button:S,buttons:z.buttons,isTouchEvent:w.type==="touch",originalEvent:m.originalEvent,userData:v.userData}));return}if(ee=z.getById(w.id),ee)ee.insideElementPressed=!0,ee.insideElement=!0,ee.originalTarget=m.originalEvent.target,ee.contactPos=w.currentPos,ee.contactTime=w.currentTime,ee.lastPos=ee.currentPos,ee.lastTime=ee.currentTime,ee.currentPos=w.currentPos,ee.currentTime=w.currentTime,w=ee;else{e.console.warn("pointerdown event on untracked pointer"),w.captured=!1,w.insideElementPressed=!0,w.insideElement=!0,w.originalTarget=m.originalEvent.target,_(z,w);return}z.addContact(),!m.preventGesture&&!m.defaultPrevented?(m.shouldCapture=!0,m.shouldReleaseCapture=!1,m.preventDefault=!0,(v.dragHandler||v.dragEndHandler||v.pinchHandler)&&e.MouseTracker.gesturePointVelocityTracker.addPoint(v,w),z.contacts===1?v.pressHandler&&!m.preventGesture&&v.pressHandler({eventSource:v,pointerType:w.type,position:T(w.contactPos,v.element),buttons:z.buttons,isTouchEvent:w.type==="touch",originalEvent:m.originalEvent,userData:v.userData}):z.contacts===2&&v.pinchHandler&&w.type==="touch"&&(M.pinchGPoints=z.asArray(),M.lastPinchDist=M.currentPinchDist=M.pinchGPoints[0].currentPos.distanceTo(M.pinchGPoints[1].currentPos),M.lastPinchCenter=M.currentPinchCenter=f(M.pinchGPoints[0].currentPos,M.pinchGPoints[1].currentPos))):(m.shouldCapture=!1,m.shouldReleaseCapture=!1)}function Te(v,m,w,S){var M=n[v.hash],z=v.getActivePointersListByType(w.type),ee,Ee,te,tt=!1,Fe;if(typeof m.originalEvent.buttons!="undefined"?z.buttons=m.originalEvent.buttons:S===0?z.buttons^=-2:S===1?z.buttons^=-5:S===2?z.buttons^=-3:S===3?z.buttons^=-9:S===4?z.buttons^=-17:S===5&&(z.buttons^=-33),m.shouldCapture=!1,S!==0){m.shouldReleaseCapture=!1,v.nonPrimaryReleaseHandler&&!m.preventGesture&&!m.defaultPrevented&&(m.preventDefault=!0,v.nonPrimaryReleaseHandler({eventSource:v,pointerType:w.type,position:T(w.currentPos,v.element),button:S,buttons:z.buttons,isTouchEvent:w.type==="touch",originalEvent:m.originalEvent,userData:v.userData}));return}te=z.getById(w.id),te?(z.removeContact(),te.captured&&(tt=!0),te.lastPos=te.currentPos,te.lastTime=te.currentTime,te.currentPos=w.currentPos,te.currentTime=w.currentTime,te.insideElement||R(v,z,te),ee=te.currentPos,Ee=te.currentTime):(e.console.warn("updatePointerUp(): pointerup on untracked gPoint"),w.captured=!1,w.insideElementPressed=!1,w.insideElement=!0,_(z,w),te=w),!m.preventGesture&&!m.defaultPrevented&&(tt?(m.shouldReleaseCapture=!0,m.preventDefault=!0,(v.dragHandler||v.dragEndHandler||v.pinchHandler)&&e.MouseTracker.gesturePointVelocityTracker.removePoint(v,te),z.contacts===0?(v.releaseHandler&&v.releaseHandler({eventSource:v,pointerType:te.type,position:T(ee,v.element),buttons:z.buttons,insideElementPressed:te.insideElementPressed,insideElementReleased:te.insideElement,isTouchEvent:te.type==="touch",originalEvent:m.originalEvent,userData:v.userData}),v.dragEndHandler&&M.sentDragEvent&&v.dragEndHandler({eventSource:v,pointerType:te.type,position:T(te.currentPos,v.element),speed:te.speed,direction:te.direction,shift:m.originalEvent.shiftKey,isTouchEvent:te.type==="touch",originalEvent:m.originalEvent,userData:v.userData}),M.sentDragEvent=!1,(v.clickHandler||v.dblClickHandler)&&te.insideElement&&(Fe=Ee-te.contactTime<=v.clickTimeThreshold&&te.contactPos.distanceTo(ee)<=v.clickDistThreshold,v.clickHandler&&v.clickHandler({eventSource:v,pointerType:te.type,position:T(te.currentPos,v.element),quick:Fe,shift:m.originalEvent.shiftKey,isTouchEvent:te.type==="touch",originalEvent:m.originalEvent,originalTarget:te.originalTarget,userData:v.userData}),v.dblClickHandler&&Fe&&(z.clicks++,z.clicks===1?(M.lastClickPos=ee,M.dblClickTimeOut=setTimeout(function(){z.clicks=0},v.dblClickTimeThreshold)):z.clicks===2&&(clearTimeout(M.dblClickTimeOut),z.clicks=0,M.lastClickPos.distanceTo(ee)<=v.dblClickDistThreshold&&v.dblClickHandler({eventSource:v,pointerType:te.type,position:T(te.currentPos,v.element),shift:m.originalEvent.shiftKey,isTouchEvent:te.type==="touch",originalEvent:m.originalEvent,userData:v.userData}),M.lastClickPos=null)))):z.contacts===2&&v.pinchHandler&&te.type==="touch"&&(M.pinchGPoints=z.asArray(),M.lastPinchDist=M.currentPinchDist=M.pinchGPoints[0].currentPos.distanceTo(M.pinchGPoints[1].currentPos),M.lastPinchCenter=M.currentPinchCenter=f(M.pinchGPoints[0].currentPos,M.pinchGPoints[1].currentPos))):(m.shouldReleaseCapture=!1,v.releaseHandler&&(v.releaseHandler({eventSource:v,pointerType:te.type,position:T(ee,v.element),buttons:z.buttons,insideElementPressed:te.insideElementPressed,insideElementReleased:te.insideElement,isTouchEvent:te.type==="touch",originalEvent:m.originalEvent,userData:v.userData}),m.preventDefault=!0)))}function he(v,m,w){var S=n[v.hash],M=v.getActivePointersListByType(w.type),z,ee,Ee;if(typeof m.originalEvent.buttons!="undefined"&&(M.buttons=m.originalEvent.buttons),z=M.getById(w.id),z)z.lastPos=z.currentPos,z.lastTime=z.currentTime,z.currentPos=w.currentPos,z.currentTime=w.currentTime;else return;m.shouldCapture=!1,m.shouldReleaseCapture=!1,v.stopHandler&&w.type==="mouse"&&(clearTimeout(v.stopTimeOut),v.stopTimeOut=setTimeout(function(){Mt(v,m.originalEvent,w.type)},v.stopDelay)),M.contacts===0?v.moveHandler&&v.moveHandler({eventSource:v,pointerType:w.type,position:T(w.currentPos,v.element),buttons:M.buttons,isTouchEvent:w.type==="touch",originalEvent:m.originalEvent,userData:v.userData}):M.contacts===1?(v.moveHandler&&(z=M.asArray()[0],v.moveHandler({eventSource:v,pointerType:z.type,position:T(z.currentPos,v.element),buttons:M.buttons,isTouchEvent:z.type==="touch",originalEvent:m.originalEvent,userData:v.userData})),v.dragHandler&&!m.preventGesture&&!m.defaultPrevented&&(z=M.asArray()[0],Ee=z.currentPos.minus(z.lastPos),v.dragHandler({eventSource:v,pointerType:z.type,position:T(z.currentPos,v.element),buttons:M.buttons,delta:Ee,speed:z.speed,direction:z.direction,shift:m.originalEvent.shiftKey,isTouchEvent:z.type==="touch",originalEvent:m.originalEvent,userData:v.userData}),m.preventDefault=!0,S.sentDragEvent=!0)):M.contacts===2&&(v.moveHandler&&(ee=M.asArray(),v.moveHandler({eventSource:v,pointerType:ee[0].type,position:T(f(ee[0].currentPos,ee[1].currentPos),v.element),buttons:M.buttons,isTouchEvent:ee[0].type==="touch",originalEvent:m.originalEvent,userData:v.userData})),v.pinchHandler&&w.type==="touch"&&!m.preventGesture&&!m.defaultPrevented&&(Ee=S.pinchGPoints[0].currentPos.distanceTo(S.pinchGPoints[1].currentPos),Ee!==S.currentPinchDist&&(S.lastPinchDist=S.currentPinchDist,S.currentPinchDist=Ee,S.lastPinchCenter=S.currentPinchCenter,S.currentPinchCenter=f(S.pinchGPoints[0].currentPos,S.pinchGPoints[1].currentPos),v.pinchHandler({eventSource:v,pointerType:"touch",gesturePoints:S.pinchGPoints,lastCenter:T(S.lastPinchCenter,v.element),center:T(S.currentPinchCenter,v.element),lastDistance:S.lastPinchDist,distance:S.currentPinchDist,shift:m.originalEvent.shiftKey,originalEvent:m.originalEvent,userData:v.userData}),m.preventDefault=!0)))}function ze(v,m,w){var S=v.getActivePointersListByType(w.type),M;M=S.getById(w.id),M&&R(v,S,M)}function Mt(v,m,w){v.stopHandler&&v.stopHandler({eventSource:v,pointerType:w,position:b(m,v.element),buttons:v.getActivePointersListByType(w).buttons,isTouchEvent:w==="touch",originalEvent:m,userData:v.userData})}}(t),function(e){e.ControlAnchor={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_RIGHT:3,BOTTOM_LEFT:4,ABSOLUTE:5},e.Control=function(n,r,o){var s=n.parentNode;typeof r=="number"&&(e.console.error("Passing an anchor directly into the OpenSeadragon.Control constructor is deprecated; please use an options object instead. Support for this deprecated variant is scheduled for removal in December 2013"),r={anchor:r}),r.attachToViewer=typeof r.attachToViewer=="undefined"?!0:r.attachToViewer,this.autoFade=typeof r.autoFade=="undefined"?!0:r.autoFade,this.element=n,this.anchor=r.anchor,this.container=o,this.anchor===e.ControlAnchor.ABSOLUTE?(this.wrapper=e.makeNeutralElement("div"),this.wrapper.style.position="absolute",this.wrapper.style.top=typeof r.top=="number"?r.top+"px":r.top,this.wrapper.style.left=typeof r.left=="number"?r.left+"px":r.left,this.wrapper.style.height=typeof r.height=="number"?r.height+"px":r.height,this.wrapper.style.width=typeof r.width=="number"?r.width+"px":r.width,this.wrapper.style.margin="0px",this.wrapper.style.padding="0px",this.element.style.position="relative",this.element.style.top="0px",this.element.style.left="0px",this.element.style.height="100%",this.element.style.width="100%"):(this.wrapper=e.makeNeutralElement("div"),this.wrapper.style.display="inline-block",this.anchor===e.ControlAnchor.NONE&&(this.wrapper.style.width=this.wrapper.style.height="100%")),this.wrapper.appendChild(this.element),r.attachToViewer?this.anchor===e.ControlAnchor.TOP_RIGHT||this.anchor===e.ControlAnchor.BOTTOM_RIGHT?this.container.insertBefore(this.wrapper,this.container.firstChild):this.container.appendChild(this.wrapper):s.appendChild(this.wrapper)},e.Control.prototype={destroy:function(){this.wrapper.removeChild(this.element),this.anchor!==e.ControlAnchor.NONE&&this.container.removeChild(this.wrapper)},isVisible:function(){return this.wrapper.style.display!=="none"},setVisible:function(n){this.wrapper.style.display=n?this.anchor===e.ControlAnchor.ABSOLUTE?"block":"inline-block":"none"},setOpacity:function(n){this.element[e.SIGNAL]&&e.Browser.vendor===e.BROWSERS.IE?e.setElementOpacity(this.element,n,!0):e.setElementOpacity(this.wrapper,n,!0)}}}(t),function(e){e.ControlDock=function(r){var o=["topleft","topright","bottomright","bottomleft"],s,a;for(e.extend(!0,this,{id:"controldock-"+e.now()+"-"+Math.floor(Math.random()*1e6),container:e.makeNeutralElement("div"),controls:[]},r),this.container.onsubmit=function(){return!1},this.element&&(this.element=e.getElement(this.element),this.element.appendChild(this.container),this.element.style.position="relative",this.container.style.width="100%",this.container.style.height="100%"),a=0;a=0)){switch(o.anchor){case e.ControlAnchor.TOP_RIGHT:s=this.controls.topright,r.style.position="relative",r.style.paddingRight="0px",r.style.paddingTop="0px";break;case e.ControlAnchor.BOTTOM_RIGHT:s=this.controls.bottomright,r.style.position="relative",r.style.paddingRight="0px",r.style.paddingBottom="0px";break;case e.ControlAnchor.BOTTOM_LEFT:s=this.controls.bottomleft,r.style.position="relative",r.style.paddingLeft="0px",r.style.paddingBottom="0px";break;case e.ControlAnchor.TOP_LEFT:s=this.controls.topleft,r.style.position="relative",r.style.paddingLeft="0px",r.style.paddingTop="0px";break;case e.ControlAnchor.ABSOLUTE:s=this.container,r.style.margin="0px",r.style.padding="0px";break;default:case e.ControlAnchor.NONE:s=this.container,r.style.margin="0px",r.style.padding="0px";break}this.controls.push(new e.Control(r,o,s)),r.style.display="inline-block"}},removeControl:function(r){r=e.getElement(r);var o=n(this,r);return o>=0&&(this.controls[o].destroy(),this.controls.splice(o,1)),this},clearControls:function(){for(;this.controls.length>0;)this.controls.pop().destroy();return this},areControlsEnabled:function(){var r;for(r=this.controls.length-1;r>=0;r--)if(this.controls[r].isVisible())return!0;return!1},setControlsEnabled:function(r){var o;for(o=this.controls.length-1;o>=0;o--)this.controls[o].setVisible(r);return this}};function n(r,o){var s=r.controls,a;for(a=s.length-1;a>=0;a--)if(s[a].element===o)return a;return-1}}(t),function(e){e.Placement=e.freezeObject({CENTER:0,TOP_LEFT:1,TOP:2,TOP_RIGHT:3,RIGHT:4,BOTTOM_RIGHT:5,BOTTOM:6,BOTTOM_LEFT:7,LEFT:8,properties:{0:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1},1:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},2:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},3:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!0,isVerticallyCentered:!1,isBottom:!1},4:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!0,isBottom:!1},5:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!1,isBottom:!0},6:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},7:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},8:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1}}})}(t),function(e){var n={},r=1;e.Viewer=function(p){var _=arguments,R=this,N;if(e.isPlainObject(p)||(p={id:_[0],xmlPath:_.length>1?_[1]:void 0,prefixUrl:_.length>2?_[2]:void 0,controls:_.length>3?_[3]:void 0,overlays:_.length>4?_[4]:void 0}),p.config&&(e.extend(!0,p,p.config),delete p.config),e.extend(!0,this,{id:p.id,hash:p.hash||r++,initialPage:0,element:null,container:null,canvas:null,overlays:[],overlaysContainer:null,previousBody:[],customControls:[],source:null,drawer:null,world:null,viewport:null,navigator:null,collectionViewport:null,collectionDrawer:null,navImages:null,buttons:null,profiler:null},e.DEFAULT_SETTINGS,p),typeof this.hash=="undefined")throw new Error("A hash must be defined, either by specifying options.id or options.hash.");for(typeof n[this.hash]!="undefined"&&e.console.warn("Hash "+this.hash+" has already been used."),n[this.hash]={fsBoundsDelta:new e.Point(1,1),prevContainerSize:null,animating:!1,forceRedraw:!1,mouseInside:!1,group:null,zooming:!1,zoomFactor:null,lastZoomTime:null,fullPage:!1,onfullscreenchange:null},this._sequenceIndex=0,this._firstOpen=!0,this._updateRequestId=null,this._loadQueue=[],this.currentOverlays=[],this._updatePixelDensityRatioBind=null,this._lastScrollTime=e.now(),e.EventSource.call(this),this.addHandler("open-failed",function(L){var J=e.getString("Errors.OpenFailed",L.eventSource,L.message);R._showMessage(J)}),e.ControlDock.call(this,p),this.xmlPath&&(this.tileSources=[this.xmlPath]),this.element=this.element||document.getElementById(this.id),this.canvas=e.makeNeutralElement("div"),this.canvas.className="openseadragon-canvas",function(L){L.width="100%",L.height="100%",L.overflow="hidden",L.position="absolute",L.top="0px",L.left="0px"}(this.canvas.style),e.setElementTouchActionNone(this.canvas),p.tabIndex!==""&&(this.canvas.tabIndex=p.tabIndex===void 0?0:p.tabIndex),this.container.className="openseadragon-container",function(L){L.width="100%",L.height="100%",L.position="relative",L.overflow="hidden",L.left="0px",L.top="0px",L.textAlign="left"}(this.container.style),e.setElementTouchActionNone(this.container),this.container.insertBefore(this.canvas,this.container.firstChild),this.element.appendChild(this.container),this.bodyWidth=document.body.style.width,this.bodyHeight=document.body.style.height,this.bodyOverflow=document.body.style.overflow,this.docOverflow=document.documentElement.style.overflow,this.innerTracker=new e.MouseTracker({userData:"Viewer.innerTracker",element:this.canvas,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,contextMenuHandler:e.delegate(this,b),keyDownHandler:e.delegate(this,T),keyHandler:e.delegate(this,f),clickHandler:e.delegate(this,E),dblClickHandler:e.delegate(this,A),dragHandler:e.delegate(this,C),dragEndHandler:e.delegate(this,O),enterHandler:e.delegate(this,D),leaveHandler:e.delegate(this,I),pressHandler:e.delegate(this,B),releaseHandler:e.delegate(this,Z),nonPrimaryPressHandler:e.delegate(this,Y),nonPrimaryReleaseHandler:e.delegate(this,V),scrollHandler:e.delegate(this,Q),pinchHandler:e.delegate(this,K)}),this.outerTracker=new e.MouseTracker({userData:"Viewer.outerTracker",element:this.container,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,enterHandler:e.delegate(this,le),leaveHandler:e.delegate(this,re)}),this.toolbar&&(this.toolbar=new e.ControlDock({element:this.toolbar})),this.bindStandardControls(),n[this.hash].prevContainerSize=o(this.container),this.world=new e.World({viewer:this}),this.world.addHandler("add-item",function(L){R.source=R.world.getItemAt(0).source,n[R.hash].forceRedraw=!0,R._updateRequestId||(R._updateRequestId=u(R,se))}),this.world.addHandler("remove-item",function(L){R.world.getItemCount()?R.source=R.world.getItemAt(0).source:R.source=null,n[R.hash].forceRedraw=!0}),this.world.addHandler("metrics-change",function(L){R.viewport&&R.viewport._setContentBounds(R.world.getHomeBounds(),R.world.getContentFactor())}),this.world.addHandler("item-index-change",function(L){R.source=R.world.getItemAt(0).source}),this.viewport=new e.Viewport({containerSize:n[this.hash].prevContainerSize,springStiffness:this.springStiffness,animationTime:this.animationTime,minZoomImageRatio:this.minZoomImageRatio,maxZoomPixelRatio:this.maxZoomPixelRatio,visibilityRatio:this.visibilityRatio,wrapHorizontal:this.wrapHorizontal,wrapVertical:this.wrapVertical,defaultZoomLevel:this.defaultZoomLevel,minZoomLevel:this.minZoomLevel,maxZoomLevel:this.maxZoomLevel,viewer:this,degrees:this.degrees,flipped:this.flipped,navigatorRotate:this.navigatorRotate,homeFillsViewer:this.homeFillsViewer,margins:this.viewportMargins}),this.viewport._setContentBounds(this.world.getHomeBounds(),this.world.getContentFactor()),this.imageLoader=new e.ImageLoader({jobLimit:this.imageLoaderLimit,timeout:p.timeout}),this.tileCache=new e.TileCache({maxImageCacheCount:this.maxImageCacheCount}),this.drawer=new e.Drawer({viewer:this,viewport:this.viewport,element:this.canvas,debugGridColor:this.debugGridColor}),this.overlaysContainer=e.makeNeutralElement("div"),this.canvas.appendChild(this.overlaysContainer),this.drawer.canRotate()||(this.rotateLeft&&(N=this.buttonGroup.buttons.indexOf(this.rotateLeft),this.buttonGroup.buttons.splice(N,1),this.buttonGroup.element.removeChild(this.rotateLeft.element)),this.rotateRight&&(N=this.buttonGroup.buttons.indexOf(this.rotateRight),this.buttonGroup.buttons.splice(N,1),this.buttonGroup.element.removeChild(this.rotateRight.element))),this._addUpdatePixelDensityRatioEvent(),this.showNavigator&&(this.navigator=new e.Navigator({id:this.navigatorId,position:this.navigatorPosition,sizeRatio:this.navigatorSizeRatio,maintainSizeRatio:this.navigatorMaintainSizeRatio,top:this.navigatorTop,left:this.navigatorLeft,width:this.navigatorWidth,height:this.navigatorHeight,autoResize:this.navigatorAutoResize,autoFade:this.navigatorAutoFade,prefixUrl:this.prefixUrl,viewer:this,navigatorRotate:this.navigatorRotate,background:this.navigatorBackground,opacity:this.navigatorOpacity,borderColor:this.navigatorBorderColor,displayRegionColor:this.navigatorDisplayRegionColor,crossOriginPolicy:this.crossOriginPolicy})),this.sequenceMode&&this.bindSequenceControls(),this.tileSources&&this.open(this.tileSources),N=0;N-1&&p.index=0&&p=0)return this;var J=a(this,L);return this.currentOverlays.push(J),J.drawHTML(this.overlaysContainer,this.viewport),this.raiseEvent("add-overlay",{element:p,location:L.location,placement:L.placement}),this},updateOverlay:function(p,_,R){var N;return p=e.getElement(p),N=l(this.currentOverlays,p),N>=0&&(this.currentOverlays[N].update(_,R),n[this.hash].forceRedraw=!0,this.raiseEvent("update-overlay",{element:p,location:_,placement:R})),this},removeOverlay:function(p){var _;return p=e.getElement(p),_=l(this.currentOverlays,p),_>=0&&(this.currentOverlays[_].destroy(),this.currentOverlays.splice(_,1),n[this.hash].forceRedraw=!0,this.raiseEvent("remove-overlay",{element:p})),this},clearOverlays:function(){for(;this.currentOverlays.length>0;)this.currentOverlays.pop().destroy();return n[this.hash].forceRedraw=!0,this.raiseEvent("clear-overlay",{}),this},getOverlayById:function(p){var _;return p=e.getElement(p),_=l(this.currentOverlays,p),_>=0?this.currentOverlays[_]:null},_updateSequenceButtons:function(p){this.nextButton&&(!this.tileSources||this.tileSources.length-1===p?this.navPrevNextWrap||this.nextButton.disable():this.nextButton.enable()),this.previousButton&&(p>0?this.previousButton.enable():this.navPrevNextWrap||this.previousButton.disable())},_showMessage:function(p){this._hideMessage();var _=e.makeNeutralElement("div");_.appendChild(document.createTextNode(p)),this.messageDiv=e.makeCenteredNode(_),e.addClass(this.messageDiv,"openseadragon-message"),this.container.appendChild(this.messageDiv)},_hideMessage:function(){var p=this.messageDiv;p&&(p.parentNode.removeChild(p),delete this.messageDiv)},gestureSettingsByDeviceType:function(p){switch(p){case"mouse":return this.gestureSettingsMouse;case"touch":return this.gestureSettingsTouch;case"pen":return this.gestureSettingsPen;default:return this.gestureSettingsUnknown}},_drawOverlays:function(){var p,_=this.currentOverlays.length;for(p=0;p<_;p++)this.currentOverlays[p].drawHTML(this.overlaysContainer,this.viewport)},_cancelPendingImages:function(){this._loadQueue=[]},removeReferenceStrip:function(){this.showReferenceStrip=!1,this.referenceStrip&&(this.referenceStrip.destroy(),this.referenceStrip=null)},addReferenceStrip:function(){if(this.showReferenceStrip=!0,this.sequenceMode){if(this.referenceStrip)return;this.tileSources.length&&this.tileSources.length>1&&(this.referenceStrip=new e.ReferenceStrip({id:this.referenceStripElement,position:this.referenceStripPosition,sizeRatio:this.referenceStripSizeRatio,scroll:this.referenceStripScroll,height:this.referenceStripHeight,width:this.referenceStripWidth,tileSources:this.tileSources,prefixUrl:this.prefixUrl,useCanvas:this.useCanvas,viewer:this}),this.referenceStrip.setFocus(this._sequenceIndex))}else e.console.warn('Attempting to display a reference strip while "sequenceMode" is off.')},_addUpdatePixelDensityRatioEvent:function(){this._updatePixelDensityRatioBind=this._updatePixelDensityRatio.bind(this),e.addEvent(window,"resize",this._updatePixelDensityRatioBind)},_removeUpdatePixelDensityRatioEvent:function(){e.removeEvent(window,"resize",this._updatePixelDensityRatioBind)},_updatePixelDensityRatio:function(){var p=e.pixelDensityRatio,_=e.getCurrentPixelDensityRatio();p!==_&&(e.pixelDensityRatio=_,this.world.resetItems(),this.forceRedraw())},goToPreviousPage:function(){var p=this._sequenceIndex-1;this.navPrevNextWrap&&p<0&&(p+=this.tileSources.length),this.goToPage(p)},goToNextPage:function(){var p=this._sequenceIndex+1;this.navPrevNextWrap&&p>=this.tileSources.length&&(p=0),this.goToPage(p)}});function o(p){return p=e.getElement(p),new e.Point(p.clientWidth===0?1:p.clientWidth,p.clientHeight===0?1:p.clientHeight)}function s(p,_,R,N,L){var J=p;if(e.type(_)==="string"){if(_.match(/^\s*<.*>\s*$/))_=e.parseXml(_);else if(_.match(/^\s*[{[].*[}\]]\s*$/))try{var q=e.parseJSON(_);_=q}catch{}}function fe(Se,ge){Se.ready?N(Se):(Se.addHandler("ready",function(){N(Se)}),Se.addHandler("open-failed",function(oe){L({message:oe.message,source:ge})}))}setTimeout(function(){if(e.type(_)==="string")_=new e.TileSource({url:_,crossOriginPolicy:R.crossOriginPolicy!==void 0?R.crossOriginPolicy:p.crossOriginPolicy,ajaxWithCredentials:p.ajaxWithCredentials,ajaxHeaders:R.ajaxHeaders?R.ajaxHeaders:p.ajaxHeaders,useCanvas:p.useCanvas,success:function(Te){N(Te.tileSource)}}),_.addHandler("open-failed",function(Te){L(Te)});else if(e.isPlainObject(_)||_.nodeType)if(_.crossOriginPolicy===void 0&&(R.crossOriginPolicy!==void 0||p.crossOriginPolicy!==void 0)&&(_.crossOriginPolicy=R.crossOriginPolicy!==void 0?R.crossOriginPolicy:p.crossOriginPolicy),_.ajaxWithCredentials===void 0&&(_.ajaxWithCredentials=p.ajaxWithCredentials),_.useCanvas===void 0&&(_.useCanvas=p.useCanvas),e.isFunction(_.getTileUrl)){var Se=new e.TileSource(_);Se.getTileUrl=_.getTileUrl,N(Se)}else{var ge=e.TileSource.determineType(J,_);if(!ge){L({message:"Unable to load TileSource",source:_});return}var oe=ge.prototype.configure.apply(J,[_]);fe(new ge(oe),_)}else fe(_,_)})}function a(p,_){if(_ instanceof e.Overlay)return _;var R=null;if(_.element)R=e.getElement(_.element);else{var N=_.id?_.id:"openseadragon-overlay-"+Math.floor(Math.random()*1e7);R=e.getElement(_.id),R||(R=document.createElement("a"),R.href="#/overlay/"+N),R.id=N,e.addClass(R,_.className?_.className:"openseadragon-overlay")}var L=_.location,J=_.width,q=_.height;if(!L){var fe=_.x,Se=_.y;if(_.px!==void 0){var ge=p.viewport.imageToViewportRectangle(new e.Rect(_.px,_.py,J||0,q||0));fe=ge.x,Se=ge.y,J=J!==void 0?ge.width:void 0,q=q!==void 0?ge.height:void 0}L=new e.Point(fe,Se)}var oe=_.placement;return oe&&e.type(oe)==="string"&&(oe=e.Placement[_.placement.toUpperCase()]),new e.Overlay({element:R,location:L,placement:oe,onDraw:_.onDraw,checkResize:_.checkResize,width:J,height:q,rotationMode:_.rotationMode})}function l(p,_){var R;for(R=p.length-1;R>=0;R--)if(p[R].element===_)return R;return-1}function u(p,_){return e.requestAnimationFrame(function(){_(p)})}function c(p){e.requestAnimationFrame(function(){d(p)})}function h(p){!p.autoHideControls||(p.controlsShouldFade=!0,p.controlsFadeBeginTime=e.now()+p.controlsFadeDelay,window.setTimeout(function(){c(p)},p.controlsFadeDelay))}function d(p){var _,R,N,L;if(p.controlsShouldFade){for(_=e.now(),R=_-p.controlsFadeBeginTime,N=1-R/p.controlsFadeLength,N=Math.min(1,N),N=Math.max(0,N),L=p.controls.length-1;L>=0;L--)p.controls[L].autoFade&&p.controls[L].setOpacity(N);N>0&&c(p)}}function g(p){var _;for(p.controlsShouldFade=!1,_=p.controls.length-1;_>=0;_--)p.controls[_].setOpacity(1)}function y(){g(this)}function x(){h(this)}function b(p){var _={tracker:p.eventSource,position:p.position,originalEvent:p.originalEvent,preventDefault:p.preventDefault};this.raiseEvent("canvas-contextmenu",_),p.preventDefault=_.preventDefault}function T(p){var _={originalEvent:p.originalEvent,preventDefaultAction:!1,preventVerticalPan:p.preventVerticalPan,preventHorizontalPan:p.preventHorizontalPan};if(this.raiseEvent("canvas-key",_),!_.preventDefaultAction&&!p.ctrl&&!p.alt&&!p.meta)switch(p.keyCode){case 38:_.preventVerticalPan||(p.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,-this.pixelsPerArrowPress))),this.viewport.applyConstraints()),p.preventDefault=!0;break;case 40:_.preventVerticalPan||(p.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,this.pixelsPerArrowPress))),this.viewport.applyConstraints()),p.preventDefault=!0;break;case 37:_.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(-this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),p.preventDefault=!0;break;case 39:_.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),p.preventDefault=!0;break;default:p.preventDefault=!1;break}else p.preventDefault=!1}function f(p){var _={originalEvent:p.originalEvent,preventDefaultAction:!1,preventVerticalPan:p.preventVerticalPan,preventHorizontalPan:p.preventHorizontalPan};if(this.raiseEvent("canvas-key",_),!_.preventDefaultAction&&!p.ctrl&&!p.alt&&!p.meta)switch(p.keyCode){case 43:case 61:this.viewport.zoomBy(1.1),this.viewport.applyConstraints(),p.preventDefault=!0;break;case 45:this.viewport.zoomBy(.9),this.viewport.applyConstraints(),p.preventDefault=!0;break;case 48:this.viewport.goHome(),this.viewport.applyConstraints(),p.preventDefault=!0;break;case 119:case 87:_.preventVerticalPan||(p.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,-40))),this.viewport.applyConstraints()),p.preventDefault=!0;break;case 115:case 83:_.preventVerticalPan||(p.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(0,40))),this.viewport.applyConstraints()),p.preventDefault=!0;break;case 97:_.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(-40,0))),this.viewport.applyConstraints()),p.preventDefault=!0;break;case 100:_.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new e.Point(40,0))),this.viewport.applyConstraints()),p.preventDefault=!0;break;case 114:this.viewport.flipped?this.viewport.setRotation(e.positiveModulo(this.viewport.degrees-this.rotationIncrement,360)):this.viewport.setRotation(e.positiveModulo(this.viewport.degrees+this.rotationIncrement,360)),this.viewport.applyConstraints(),p.preventDefault=!0;break;case 82:this.viewport.flipped?this.viewport.setRotation(e.positiveModulo(this.viewport.degrees+this.rotationIncrement,360)):this.viewport.setRotation(e.positiveModulo(this.viewport.degrees-this.rotationIncrement,360)),this.viewport.applyConstraints(),p.preventDefault=!0;break;case 102:this.viewport.toggleFlip(),p.preventDefault=!0;break;case 106:this.goToPreviousPage();break;case 107:this.goToNextPage();break;default:p.preventDefault=!1;break}else p.preventDefault=!1}function E(p){var _,R=document.activeElement===this.canvas;R||this.canvas.focus(),this.viewport.flipped&&(p.position.x=this.viewport.getContainerSize().x-p.position.x);var N={tracker:p.eventSource,position:p.position,quick:p.quick,shift:p.shift,originalEvent:p.originalEvent,originalTarget:p.originalTarget,preventDefaultAction:!1};this.raiseEvent("canvas-click",N),!N.preventDefaultAction&&this.viewport&&p.quick&&(_=this.gestureSettingsByDeviceType(p.pointerType),_.clickToZoom&&(this.viewport.zoomBy(p.shift?1/this.zoomPerClick:this.zoomPerClick,_.zoomToRefPoint?this.viewport.pointFromPixel(p.position,!0):null),this.viewport.applyConstraints()))}function A(p){var _,R={tracker:p.eventSource,position:p.position,shift:p.shift,originalEvent:p.originalEvent,preventDefaultAction:!1};this.raiseEvent("canvas-double-click",R),!R.preventDefaultAction&&this.viewport&&(_=this.gestureSettingsByDeviceType(p.pointerType),_.dblClickToZoom&&(this.viewport.zoomBy(p.shift?1/this.zoomPerClick:this.zoomPerClick,_.zoomToRefPoint?this.viewport.pointFromPixel(p.position,!0):null),this.viewport.applyConstraints()))}function C(p){var _,R={tracker:p.eventSource,pointerType:p.pointerType,position:p.position,delta:p.delta,speed:p.speed,direction:p.direction,shift:p.shift,originalEvent:p.originalEvent,preventDefaultAction:!1};if(this.raiseEvent("canvas-drag",R),_=this.gestureSettingsByDeviceType(p.pointerType),_.dragToPan&&!R.preventDefaultAction&&this.viewport){if(this.panHorizontal||(p.delta.x=0),this.panVertical||(p.delta.y=0),this.viewport.flipped&&(p.delta.x=-p.delta.x),this.constrainDuringPan){var N=this.viewport.deltaPointsFromPixels(p.delta.negate());this.viewport.centerSpringX.target.value+=N.x,this.viewport.centerSpringY.target.value+=N.y;var L=this.viewport.getBounds(),J=this.viewport.getConstrainedBounds();this.viewport.centerSpringX.target.value-=N.x,this.viewport.centerSpringY.target.value-=N.y,L.x!==J.x&&(p.delta.x=0),L.y!==J.y&&(p.delta.y=0)}this.viewport.panBy(this.viewport.deltaPointsFromPixels(p.delta.negate()),_.flickEnabled&&!this.constrainDuringPan)}}function O(p){var _={tracker:p.eventSource,pointerType:p.pointerType,position:p.position,speed:p.speed,direction:p.direction,shift:p.shift,originalEvent:p.originalEvent,preventDefaultAction:!1};if(this.raiseEvent("canvas-drag-end",_),!_.preventDefaultAction&&this.viewport){var R=this.gestureSettingsByDeviceType(p.pointerType);if(R.flickEnabled&&p.speed>=R.flickMinSpeed){var N=0;this.panHorizontal&&(N=R.flickMomentum*p.speed*Math.cos(p.direction));var L=0;this.panVertical&&(L=R.flickMomentum*p.speed*Math.sin(p.direction));var J=this.viewport.pixelFromPoint(this.viewport.getCenter(!0)),q=this.viewport.pointFromPixel(new e.Point(J.x-N,J.y-L));this.viewport.panTo(q,!1)}this.viewport.applyConstraints()}}function D(p){this.raiseEvent("canvas-enter",{tracker:p.eventSource,pointerType:p.pointerType,position:p.position,buttons:p.buttons,pointers:p.pointers,insideElementPressed:p.insideElementPressed,buttonDownAny:p.buttonDownAny,originalEvent:p.originalEvent})}function I(p){this.raiseEvent("canvas-exit",{tracker:p.eventSource,pointerType:p.pointerType,position:p.position,buttons:p.buttons,pointers:p.pointers,insideElementPressed:p.insideElementPressed,buttonDownAny:p.buttonDownAny,originalEvent:p.originalEvent})}function B(p){this.raiseEvent("canvas-press",{tracker:p.eventSource,pointerType:p.pointerType,position:p.position,insideElementPressed:p.insideElementPressed,insideElementReleased:p.insideElementReleased,originalEvent:p.originalEvent})}function Z(p){this.raiseEvent("canvas-release",{tracker:p.eventSource,pointerType:p.pointerType,position:p.position,insideElementPressed:p.insideElementPressed,insideElementReleased:p.insideElementReleased,originalEvent:p.originalEvent})}function Y(p){this.raiseEvent("canvas-nonprimary-press",{tracker:p.eventSource,position:p.position,pointerType:p.pointerType,button:p.button,buttons:p.buttons,originalEvent:p.originalEvent})}function V(p){this.raiseEvent("canvas-nonprimary-release",{tracker:p.eventSource,position:p.position,pointerType:p.pointerType,button:p.button,buttons:p.buttons,originalEvent:p.originalEvent})}function K(p){var _,R,N,L,J={tracker:p.eventSource,pointerType:p.pointerType,gesturePoints:p.gesturePoints,lastCenter:p.lastCenter,center:p.center,lastDistance:p.lastDistance,distance:p.distance,shift:p.shift,originalEvent:p.originalEvent,preventDefaultPanAction:!1,preventDefaultZoomAction:!1,preventDefaultRotateAction:!1};if(this.raiseEvent("canvas-pinch",J),this.viewport&&(_=this.gestureSettingsByDeviceType(p.pointerType),_.pinchToZoom&&(!J.preventDefaultPanAction||!J.preventDefaultZoomAction)&&(R=this.viewport.pointFromPixel(p.center,!0),J.preventDefaultZoomAction||this.viewport.zoomBy(p.distance/p.lastDistance,R,!0),_.zoomToRefPoint&&!J.preventDefaultPanAction&&(N=this.viewport.pointFromPixel(p.lastCenter,!0),L=N.minus(R),this.panHorizontal||(L.x=0),this.panVertical||(L.y=0),this.viewport.panBy(L,!0)),this.viewport.applyConstraints()),_.pinchRotate&&!J.preventDefaultRotateAction)){var q=Math.atan2(p.gesturePoints[0].currentPos.y-p.gesturePoints[1].currentPos.y,p.gesturePoints[0].currentPos.x-p.gesturePoints[1].currentPos.x),fe=Math.atan2(p.gesturePoints[0].lastPos.y-p.gesturePoints[1].lastPos.y,p.gesturePoints[0].lastPos.x-p.gesturePoints[1].lastPos.x);this.viewport.setRotation(this.viewport.getRotation()+(q-fe)*(180/Math.PI))}}function Q(p){var _,R,N,L,J;L=e.now(),J=L-this._lastScrollTime,J>this.minScrollDeltaTime?(this._lastScrollTime=L,_={tracker:p.eventSource,position:p.position,scroll:p.scroll,shift:p.shift,originalEvent:p.originalEvent,preventDefaultAction:!1,preventDefault:!0},this.raiseEvent("canvas-scroll",_),!_.preventDefaultAction&&this.viewport&&(this.viewport.flipped&&(p.position.x=this.viewport.getContainerSize().x-p.position.x),R=this.gestureSettingsByDeviceType(p.pointerType),R.scrollToZoom&&(N=Math.pow(this.zoomPerScroll,p.scroll),this.viewport.zoomBy(N,R.zoomToRefPoint?this.viewport.pointFromPixel(p.position,!0):null),this.viewport.applyConstraints())),p.preventDefault=_.preventDefault):p.preventDefault=!0}function le(p){n[this.hash].mouseInside=!0,g(this),this.raiseEvent("container-enter",{tracker:p.eventSource,pointerType:p.pointerType,position:p.position,buttons:p.buttons,pointers:p.pointers,insideElementPressed:p.insideElementPressed,buttonDownAny:p.buttonDownAny,originalEvent:p.originalEvent})}function re(p){p.pointers<1&&(n[this.hash].mouseInside=!1,n[this.hash].animating||h(this)),this.raiseEvent("container-exit",{tracker:p.eventSource,pointerType:p.pointerType,position:p.position,buttons:p.buttons,pointers:p.pointers,insideElementPressed:p.insideElementPressed,buttonDownAny:p.buttonDownAny,originalEvent:p.originalEvent})}function se(p){de(p),p.isOpen()?p._updateRequestId=u(p,se):p._updateRequestId=!1}function de(p){if(!(p._opening||!n[p.hash])){if(p.autoResize){var _=o(p.container),R=n[p.hash].prevContainerSize;if(!_.equals(R)){var N=p.viewport;if(p.preserveImageSizeOnResize){var L=R.x/_.x,J=N.getZoom()*L,q=N.getCenter();N.resize(_,!1),N.zoomTo(J,null,!0),N.panTo(q,!0)}else{var fe=N.getBounds();N.resize(_,!0),N.fitBoundsWithConstraints(fe,!0)}n[p.hash].prevContainerSize=_,n[p.hash].forceRedraw=!0}}var Se=p.viewport.update(),ge=p.world.update()||Se;Se&&p.raiseEvent("viewport-change"),p.referenceStrip&&(ge=p.referenceStrip.update(p.viewport)||ge),!n[p.hash].animating&&ge&&(p.raiseEvent("animation-start"),g(p)),(ge||n[p.hash].forceRedraw||p.world.needsDraw())&&(pe(p),p._drawOverlays(),p.navigator&&p.navigator.update(p.viewport),n[p.hash].forceRedraw=!1,ge&&p.raiseEvent("animation")),n[p.hash].animating&&!ge&&(p.raiseEvent("animation-finish"),n[p.hash].mouseInside||h(p)),n[p.hash].animating=ge}}function pe(p){p.imageLoader.clear(),p.drawer.clear(),p.world.draw(),p.raiseEvent("update-viewport",{})}function G(p,_){return p?p+_:_}function Me(){n[this.hash].lastZoomTime=e.now(),n[this.hash].zoomFactor=this.zoomPerSecond,n[this.hash].zooming=!0,U(this)}function F(){n[this.hash].lastZoomTime=e.now(),n[this.hash].zoomFactor=1/this.zoomPerSecond,n[this.hash].zooming=!0,U(this)}function H(){n[this.hash].zooming=!1}function U(p){e.requestAnimationFrame(e.delegate(p,W))}function W(){var p,_,R;n[this.hash].zooming&&this.viewport&&(p=e.now(),_=p-n[this.hash].lastZoomTime,R=Math.pow(n[this.hash].zoomFactor,_/1e3),this.viewport.zoomBy(R),this.viewport.applyConstraints(),n[this.hash].lastZoomTime=p,U(this))}function j(){this.viewport&&(n[this.hash].zooming=!1,this.viewport.zoomBy(this.zoomPerClick/1),this.viewport.applyConstraints())}function $(){this.viewport&&(n[this.hash].zooming=!1,this.viewport.zoomBy(1/this.zoomPerClick),this.viewport.applyConstraints())}function ae(){this.buttonGroup&&(this.buttonGroup.emulateEnter(),this.buttonGroup.emulateLeave())}function we(){this.viewport&&this.viewport.goHome()}function me(){this.isFullPage()&&!e.isFullScreen()?this.setFullPage(!1):this.setFullScreen(!this.isFullPage()),this.buttonGroup&&this.buttonGroup.emulateLeave(),this.fullPageButton.element.focus(),this.viewport&&this.viewport.applyConstraints()}function Qe(){if(this.viewport){var p=this.viewport.getRotation();this.viewport.flipped?p=e.positiveModulo(p+this.rotationIncrement,360):p=e.positiveModulo(p-this.rotationIncrement,360),this.viewport.setRotation(p)}}function $e(){if(this.viewport){var p=this.viewport.getRotation();this.viewport.flipped?p=e.positiveModulo(p-this.rotationIncrement,360):p=e.positiveModulo(p+this.rotationIncrement,360),this.viewport.setRotation(p)}}function et(){this.viewport.toggleFlip()}}(t),function(e){e.Navigator=function(u){var c=u.viewer,h=this,d,g;u.id?(this.element=document.getElementById(u.id),u.controlOptions={anchor:e.ControlAnchor.NONE,attachToViewer:!1,autoFade:!1}):(u.id="navigator-"+e.now(),this.element=e.makeNeutralElement("div"),u.controlOptions={anchor:e.ControlAnchor.TOP_RIGHT,attachToViewer:!0,autoFade:u.autoFade},u.position&&(u.position==="BOTTOM_RIGHT"?u.controlOptions.anchor=e.ControlAnchor.BOTTOM_RIGHT:u.position==="BOTTOM_LEFT"?u.controlOptions.anchor=e.ControlAnchor.BOTTOM_LEFT:u.position==="TOP_RIGHT"?u.controlOptions.anchor=e.ControlAnchor.TOP_RIGHT:u.position==="TOP_LEFT"?u.controlOptions.anchor=e.ControlAnchor.TOP_LEFT:u.position==="ABSOLUTE"&&(u.controlOptions.anchor=e.ControlAnchor.ABSOLUTE,u.controlOptions.top=u.top,u.controlOptions.left=u.left,u.controlOptions.height=u.height,u.controlOptions.width=u.width))),this.element.id=u.id,this.element.className+=" navigator",u=e.extend(!0,{sizeRatio:e.DEFAULT_SETTINGS.navigatorSizeRatio},u,{element:this.element,tabIndex:-1,showNavigator:!1,mouseNavEnabled:!1,showNavigationControl:!1,showSequenceControl:!1,immediateRender:!0,blendTime:0,animationTime:0,autoResize:u.autoResize,minZoomImageRatio:1,background:u.background,opacity:u.opacity,borderColor:u.borderColor,displayRegionColor:u.displayRegionColor}),u.minPixelRatio=this.minPixelRatio=c.minPixelRatio,e.setElementTouchActionNone(this.element),this.borderWidth=2,this.fudge=new e.Point(1,1),this.totalBorderWidths=new e.Point(this.borderWidth*2,this.borderWidth*2).minus(this.fudge),u.controlOptions.anchor!==e.ControlAnchor.NONE&&function(b,T){b.margin="0px",b.border=T+"px solid "+u.borderColor,b.padding="0px",b.background=u.background,b.opacity=u.opacity,b.overflow="hidden"}(this.element.style,this.borderWidth),this.displayRegion=e.makeNeutralElement("div"),this.displayRegion.id=this.element.id+"-displayregion",this.displayRegion.className="displayregion",function(b,T){b.position="relative",b.top="0px",b.left="0px",b.fontSize="0px",b.overflow="hidden",b.border=T+"px solid "+u.displayRegionColor,b.margin="0px",b.padding="0px",b.background="transparent",b.float="left",b.cssFloat="left",b.styleFloat="left",b.zIndex=999999999,b.cursor="default"}(this.displayRegion.style,this.borderWidth),e.setElementPointerEventsNone(this.displayRegion),e.setElementTouchActionNone(this.displayRegion),this.displayRegionContainer=e.makeNeutralElement("div"),this.displayRegionContainer.id=this.element.id+"-displayregioncontainer",this.displayRegionContainer.className="displayregioncontainer",this.displayRegionContainer.style.width="100%",this.displayRegionContainer.style.height="100%",e.setElementPointerEventsNone(this.displayRegionContainer),e.setElementTouchActionNone(this.displayRegionContainer),c.addControl(this.element,u.controlOptions),this._resizeWithViewer=u.controlOptions.anchor!==e.ControlAnchor.ABSOLUTE&&u.controlOptions.anchor!==e.ControlAnchor.NONE,u.width&&u.height?(this.setWidth(u.width),this.setHeight(u.height)):this._resizeWithViewer&&(d=e.getElementSize(c.element),this.element.style.height=Math.round(d.y*u.sizeRatio)+"px",this.element.style.width=Math.round(d.x*u.sizeRatio)+"px",this.oldViewerSize=d,g=e.getElementSize(this.element),this.elementArea=g.x*g.y),this.oldContainerSize=new e.Point(0,0),e.Viewer.apply(this,[u]),this.displayRegionContainer.appendChild(this.displayRegion),this.element.getElementsByTagName("div")[0].appendChild(this.displayRegionContainer);function y(b){a(h.displayRegionContainer,b),a(h.displayRegion,-b),h.viewport.setRotation(b)}if(u.navigatorRotate){var x=u.viewer.viewport?u.viewer.viewport.getRotation():u.viewer.degrees||0;y(x),u.viewer.addHandler("rotate",function(b){y(b.degrees)})}this.innerTracker.destroy(),this.innerTracker=new e.MouseTracker({userData:"Navigator.innerTracker",element:this.element,dragHandler:e.delegate(this,r),clickHandler:e.delegate(this,n),releaseHandler:e.delegate(this,o),scrollHandler:e.delegate(this,s),preProcessEventHandler:function(b){b.eventType==="wheel"&&(b.preventDefault=!0)}}),this.outerTracker.userData="Navigator.outerTracker",e.setElementPointerEventsNone(this.canvas),e.setElementPointerEventsNone(this.container),this.addHandler("reset-size",function(){h.viewport&&h.viewport.goHome(!0)}),c.world.addHandler("item-index-change",function(b){window.setTimeout(function(){var T=h.world.getItemAt(b.previousIndex);h.world.setItemIndex(T,b.newIndex)},1)}),c.world.addHandler("remove-item",function(b){var T=b.item,f=h._getMatchingItem(T);f&&h.world.removeItem(f)}),this.update(c.viewport)},e.extend(e.Navigator.prototype,e.EventSource.prototype,e.Viewer.prototype,{updateSize:function(){if(this.viewport){var u=new e.Point(this.container.clientWidth===0?1:this.container.clientWidth,this.container.clientHeight===0?1:this.container.clientHeight);u.equals(this.oldContainerSize)||(this.viewport.resize(u,!0),this.viewport.goHome(!0),this.oldContainerSize=u,this.drawer.clear(),this.world.draw())}},setWidth:function(u){this.width=u,this.element.style.width=typeof u=="number"?u+"px":u,this._resizeWithViewer=!1},setHeight:function(u){this.height=u,this.element.style.height=typeof u=="number"?u+"px":u,this._resizeWithViewer=!1},setFlip:function(u){return this.viewport.setFlip(u),this.setDisplayTransform(this.viewer.viewport.getFlip()?"scale(-1,1)":"scale(1,1)"),this},setDisplayTransform:function(u){l(this.displayRegion,u),l(this.canvas,u),l(this.element,u)},update:function(u){var c,h,d,g,y,x;if(c=e.getElementSize(this.viewer.element),this._resizeWithViewer&&c.x&&c.y&&!c.equals(this.oldViewerSize)&&(this.oldViewerSize=c,this.maintainSizeRatio||!this.elementArea?(h=c.x*this.sizeRatio,d=c.y*this.sizeRatio):(h=Math.sqrt(this.elementArea*(c.x/c.y)),d=this.elementArea/h),this.element.style.width=Math.round(h)+"px",this.element.style.height=Math.round(d)+"px",this.elementArea||(this.elementArea=h*d),this.updateSize()),u&&this.viewport){g=u.getBoundsNoRotate(!0),y=this.viewport.pixelFromPointNoRotate(g.getTopLeft(),!1),x=this.viewport.pixelFromPointNoRotate(g.getBottomRight(),!1).minus(this.totalBorderWidths);var b=this.displayRegion.style;b.display=this.world.getItemCount()?"block":"none",b.top=Math.round(y.y)+"px",b.left=Math.round(y.x)+"px";var T=Math.abs(y.x-x.x),f=Math.abs(y.y-x.y);b.width=Math.round(Math.max(T,0))+"px",b.height=Math.round(Math.max(f,0))+"px"}},addTiledImage:function(u){var c=this,h=u.originalTiledImage;delete u.original;var d=e.extend({},u,{success:function(g){var y=g.item;y._originalForNavigator=h,c._matchBounds(y,h,!0),c._matchOpacity(y,h),c._matchCompositeOperation(y,h);function x(){c._matchBounds(y,h)}function b(){c._matchOpacity(y,h)}function T(){c._matchCompositeOperation(y,h)}h.addHandler("bounds-change",x),h.addHandler("clip-change",x),h.addHandler("opacity-change",b),h.addHandler("composite-operation-change",T)}});return e.Viewer.prototype.addTiledImage.apply(this,[d])},destroy:function(){return e.Viewer.prototype.destroy.apply(this)},_getMatchingItem:function(u){for(var c=this.world.getItemCount(),h,d=0;d1||o.y>1));r++);return r-1},getTileAtPoint:function(r,o){var s=o.x>=0&&o.x<=1&&o.y>=0&&o.y<=1/this.aspectRatio;e.console.assert(s,"[TileSource.getTileAtPoint] must be called with a valid point.");var a=this.dimensions.x*this.getLevelScale(r),l=o.x*a,u=o.y*a,c=Math.floor(l/this.getTileWidth(r)),h=Math.floor(u/this.getTileHeight(r));o.x>=1&&(c=this.getNumTiles(r).x-1);var d=1e-15;return o.y>=1/this.aspectRatio-d&&(h=this.getNumTiles(r).y-1),new e.Point(c,h)},getTileBounds:function(r,o,s,a){var l=this.dimensions.times(this.getLevelScale(r)),u=this.getTileWidth(r),c=this.getTileHeight(r),h=o===0?0:u*o-this.tileOverlap,d=s===0?0:c*s-this.tileOverlap,g=u+(o===0?1:2)*this.tileOverlap,y=c+(s===0?1:2)*this.tileOverlap,x=1/l.x;return g=Math.min(g,l.x-h),y=Math.min(y,l.y-d),a?new e.Rect(0,0,g,y):new e.Rect(h*x,d*x,g*x,y*x)},getImageInfo:function(r){var o=this,s,a,l,u,c,h,d;r&&(c=r.split("/"),h=c[c.length-1],d=h.lastIndexOf("."),d>-1&&(c[c.length-1]=h.slice(0,d))),a=function(g){typeof g=="string"&&(g=e.parseXml(g));var y=e.TileSource.determineType(o,g,r);if(!y){o.raiseEvent("open-failed",{message:"Unable to load TileSource",source:r});return}u=y.prototype.configure.apply(o,[g,r]),u.ajaxWithCredentials===void 0&&(u.ajaxWithCredentials=o.ajaxWithCredentials),l=new y(u),o.ready=!0,o.raiseEvent("ready",{tileSource:l})},r.match(/\.js$/)?(s=r.split("/").pop().replace(".js",""),e.jsonp({url:r,async:!1,callbackName:s,callback:a})):e.makeAjaxRequest({url:r,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,success:function(g){var y=n(g);a(y)},error:function(g,y){var x;try{x="HTTP "+g.status+" attempting to load TileSource"}catch{var b;typeof y=="undefined"||!y.toString?b="Unknown error":b=y.toString(),x=b+" attempting to load TileSource"}o.raiseEvent("open-failed",{message:x,source:r})}})},supports:function(r,o){return!1},configure:function(r,o){throw new Error("Method not implemented.")},getTileUrl:function(r,o,s){throw new Error("Method not implemented.")},getTileAjaxHeaders:function(r,o,s){return{}},tileExists:function(r,o,s){var a=this.getNumTiles(r);return r>=this.minLevel&&r<=this.maxLevel&&o>=0&&s>=0&&o=0;y--)for(x=this.displayRects[y],b=x.minLevel;b<=x.maxLevel;b++)this._levelRects[b]||(this._levelRects[b]=[]),this._levelRects[b].push(x);e.TileSource.apply(this,[T])},e.extend(e.DziTileSource.prototype,e.TileSource.prototype,{supports:function(o,s){var a;return o.Image?a=o.Image.xmlns:o.documentElement&&(o.documentElement.localName==="Image"||o.documentElement.tagName==="Image")&&(a=o.documentElement.namespaceURI),a=(a||"").toLowerCase(),a.indexOf("schemas.microsoft.com/deepzoom/2008")!==-1||a.indexOf("schemas.microsoft.com/deepzoom/2009")!==-1},configure:function(o,s){var a;return e.isPlainObject(o)?a=r(this,o):a=n(this,o),s&&!a.tilesUrl&&(a.tilesUrl=s.replace(/([^/]+?)(\.(dzi|xml|js)?(\?[^/]*)?)?\/?$/,"$1_files/"),s.search(/\.(dzi|xml|js)\?/)!==-1?a.queryParams=s.match(/\?.*/):a.queryParams=""),a},getTileUrl:function(o,s,a){return[this.tilesUrl,o,"/",s,"_",a,".",this.fileFormat,this.queryParams].join("")},tileExists:function(o,s,a){var l=this._levelRects[o],u,c,h,d,g,y,x;if(this.minLevel&&othis.maxLevel)return!1;if(!l||!l.length)return!0;for(x=l.length-1;x>=0;x--)if(u=l[x],!(ou.maxLevel)&&(c=this.getLevelScale(o),h=u.x*c,d=u.y*c,g=h+u.width*c,y=d+u.height*c,h=Math.floor(h/this._tileWidth),d=Math.floor(d/this._tileWidth),g=Math.ceil(g/this._tileWidth),y=Math.ceil(y/this._tileWidth),h<=s&&s0?a.tileSize=Math.max.apply(null,g):a.tileSize=h}else this.sizes&&this.sizes.length>0?(this.emulateLegacyImagePyramid=!0,a.levels=r(this),e.extend(!0,a,{width:a.levels[a.levels.length-1].width,height:a.levels[a.levels.length-1].height,tileSize:Math.max(a.height,a.width),tileOverlap:0,minLevel:0,maxLevel:a.levels.length-1}),this.levels=a.levels):e.console.error("Nothing in the info.json to construct image pyramids from");if(!a.maxLevel&&!this.emulateLegacyImagePyramid)if(!this.scale_factors)a.maxLevel=Number(Math.ceil(Math.log(Math.max(this.width,this.height),2)));else{var x=Math.max.apply(null,this.scale_factors);a.maxLevel=Math.round(Math.log(x)*Math.LOG2E)}e.TileSource.apply(this,[a])},e.extend(e.IIIFTileSource.prototype,e.TileSource.prototype,{supports:function(a,l){return a.protocol&&a.protocol==="http://iiif.io/api/image"||a["@context"]&&(a["@context"]==="http://library.stanford.edu/iiif/image-api/1.1/context.json"||a["@context"]==="http://iiif.io/api/image/1/context.json")||a.profile&&a.profile.indexOf("http://library.stanford.edu/iiif/image-api/compliance.html")===0||a.identifier&&a.width&&a.height?!0:!!(a.documentElement&&a.documentElement.tagName==="info"&&a.documentElement.namespaceURI==="http://library.stanford.edu/iiif/image-api/ns/")},configure:function(a,l){if(e.isPlainObject(a)){if(!a["@context"])a["@context"]="http://iiif.io/api/image/1.0/context.json",a["@id"]=l.replace("/info.json",""),a.version=1;else{var c=a["@context"];if(Array.isArray(c)){for(var h=0;h0&&a>=this.minLevel&&a<=this.maxLevel&&(l=this.levels[a].width/this.levels[this.maxLevel].width),l}return e.TileSource.prototype.getLevelScale.call(this,a)},getNumTiles:function(a){if(this.emulateLegacyImagePyramid){var l=this.getLevelScale(a);return l?new e.Point(1,1):new e.Point(0,0)}return e.TileSource.prototype.getNumTiles.call(this,a)},getTileAtPoint:function(a,l){return this.emulateLegacyImagePyramid?new e.Point(0,0):e.TileSource.prototype.getTileAtPoint.call(this,a,l)},getTileUrl:function(a,l,u){if(this.emulateLegacyImagePyramid){var c=null;return this.levels.length>0&&a>=this.minLevel&&a<=this.maxLevel&&(c=this.levels[a].url),c}var h="0",d=Math.pow(.5,this.maxLevel-a),g=Math.ceil(this.width*d),y=Math.ceil(this.height*d),x,b,T,f,E,A,C,O,D,I,B,Z,Y,V;return x=this.getTileWidth(a),b=this.getTileHeight(a),T=Math.ceil(x/d),f=Math.ceil(b/d),this.version===1?Y="native."+this.tileFormat:Y="default."+this.tileFormat,g1&&a.profile[1].supports&&(h=a.profile[1].supports.indexOf("sizeByW")!==-1),a.version===3&&a.extraFeatures&&(h=a.extraFeatures.indexOf("sizeByWh")!==-1),!c||h}function r(a){for(var l=[],u=0;uc?h=u/256:h=c/256,l.maxLevel=Math.ceil(Math.log(h)/Math.log(2))-1,l.tileSize=256,l.width=u,l.height=c,e.TileSource.apply(this,[l])},e.extend(e.TmsTileSource.prototype,e.TileSource.prototype,{supports:function(n,r){return n.type&&n.type==="tiledmapservice"},configure:function(n,r){return n},getTileUrl:function(n,r,o){var s=this.getNumTiles(n).y-1;return this.tilesUrl+n+"/"+r+"/"+(s-o)+".png"}})}(t),function(e){e.ZoomifyTileSource=function(n){typeof n.tileSize=="undefined"&&(n.tileSize=256),typeof n.fileFormat=="undefined"&&(n.fileFormat="jpg",this.fileFormat=n.fileFormat);var r={x:n.width,y:n.height};for(n.imageSizes=[{x:n.width,y:n.height}],n.gridSize=[this._getGridSize(n.width,n.height,n.tileSize)];parseInt(r.x,10)>n.tileSize||parseInt(r.y,10)>n.tileSize;)r.x=Math.floor(r.x/2),r.y=Math.floor(r.y/2),n.imageSizes.push({x:r.x,y:r.y}),n.gridSize.push(this._getGridSize(r.x,r.y,n.tileSize));n.imageSizes.reverse(),n.gridSize.reverse(),n.minLevel=0,n.maxLevel=n.gridSize.length-1,t.TileSource.apply(this,[n])},e.extend(e.ZoomifyTileSource.prototype,e.TileSource.prototype,{_getGridSize:function(n,r,o){return{x:Math.ceil(n/o),y:Math.ceil(r/o)}},_calculateAbsoluteTileNumber:function(n,r,o){for(var s=0,a={},l=0;l0?(l=a.levels[a.levels.length-1].width,u=a.levels[a.levels.length-1].height):(l=0,u=0,e.console.error("No supported image formats found")),e.extend(!0,a,{width:l,height:u,tileSize:Math.max(u,l),tileOverlap:0,minLevel:0,maxLevel:a.levels.length>0?a.levels.length-1:0}),e.TileSource.apply(this,[a]),this.levels=a.levels},e.extend(e.LegacyTileSource.prototype,e.TileSource.prototype,{supports:function(s,a){return s.type&&s.type==="legacy-image-pyramid"||s.documentElement&&s.documentElement.getAttribute("type")==="legacy-image-pyramid"},configure:function(s,a){var l;return e.isPlainObject(s)?l=o(this,s):l=r(this,s),l},getLevelScale:function(s){var a=NaN;return this.levels.length>0&&s>=this.minLevel&&s<=this.maxLevel&&(a=this.levels[s].width/this.levels[this.maxLevel].width),a},getNumTiles:function(s){var a=this.getLevelScale(s);return a?new e.Point(1,1):new e.Point(0,0)},getTileUrl:function(s,a,l){var u=null;return this.levels.length>0&&s>=this.minLevel&&s<=this.maxLevel&&(u=this.levels[s].url),u}});function n(s){var a=[],l,u;for(u=0;u");return a.sort(function(c,h){return c.height-h.height})}function r(s,a){if(!a||!a.documentElement)throw new Error(e.getString("Errors.Xml"));var l=a.documentElement,u=l.tagName,c=null,h=[],d,g;if(u==="image")try{for(c={type:l.getAttribute("type"),levels:[]},h=l.getElementsByTagName("level"),g=0;g=this.minLevel&&n<=this.maxLevel&&(r=this.levels[n].width/this.levels[this.maxLevel].width),r},getNumTiles:function(n){var r=this.getLevelScale(n);return r?new e.Point(1,1):new e.Point(0,0)},getTileUrl:function(n,r,o){var s=null;return n>=this.minLevel&&n<=this.maxLevel&&(s=this.levels[n].url),s},getContext2D:function(n,r,o){var s=null;return n>=this.minLevel&&n<=this.maxLevel&&(s=this.levels[n].context2D),s},destroy:function(){this._freeupCanvasMemory()},_buildLevels:function(){var n=[{url:this._image.src,width:this._image.naturalWidth,height:this._image.naturalHeight}];if(!this.buildPyramid||!e.supportsCanvas||!this.useCanvas)return delete this._image,n;var r=this._image.naturalWidth,o=this._image.naturalHeight,s=document.createElement("canvas"),a=s.getContext("2d");if(s.width=r,s.height=o,a.drawImage(this._image,0,0,r,o),n[0].context2D=a,delete this._image,e.isCanvasTainted(s))return n;for(;r>=2&&o>=2;){r=Math.floor(r/2),o=Math.floor(o/2);var l=document.createElement("canvas"),u=l.getContext("2d");l.width=r,l.height=o,u.drawImage(s,0,0,r,o),n.splice(0,0,{context2D:u,width:r,height:o}),s=l,a=u}return n},_freeupCanvasMemory:function(){for(var n=0;n0&&n(u))}function o(u){u.shouldFade=!0,u.fadeBeginTime=e.now()+u.fadeDelay,window.setTimeout(function(){n(u)},u.fadeDelay)}function s(u){u.shouldFade=!1,u.imgGroup&&e.setElementOpacity(u.imgGroup,1,!0)}function a(u,c){u.element.disabled||(c>=e.ButtonState.GROUP&&u.currentState===e.ButtonState.REST&&(s(u),u.currentState=e.ButtonState.GROUP),c>=e.ButtonState.HOVER&&u.currentState===e.ButtonState.GROUP&&(u.imgHover&&(u.imgHover.style.visibility=""),u.currentState=e.ButtonState.HOVER),c>=e.ButtonState.DOWN&&u.currentState===e.ButtonState.HOVER&&(u.imgDown&&(u.imgDown.style.visibility=""),u.currentState=e.ButtonState.DOWN))}function l(u,c){u.element.disabled||(c<=e.ButtonState.HOVER&&u.currentState===e.ButtonState.DOWN&&(u.imgDown&&(u.imgDown.style.visibility="hidden"),u.currentState=e.ButtonState.HOVER),c<=e.ButtonState.GROUP&&u.currentState===e.ButtonState.HOVER&&(u.imgHover&&(u.imgHover.style.visibility="hidden"),u.currentState=e.ButtonState.GROUP),c<=e.ButtonState.REST&&u.currentState===e.ButtonState.GROUP&&(o(u),u.currentState=e.ButtonState.REST))}}(t),function(e){e.ButtonGroup=function(n){e.extend(!0,this,{buttons:[],clickTimeThreshold:e.DEFAULT_SETTINGS.clickTimeThreshold,clickDistThreshold:e.DEFAULT_SETTINGS.clickDistThreshold,labelText:""},n);var r=this.buttons.concat([]),o=this,s;if(this.element=n.element||e.makeNeutralElement("div"),!n.group)for(this.element.style.display="inline-block",s=0;s=270?(l=this.getTopRight(),this.x=l.x,this.y=l.y,u=this.height,this.height=this.width,this.width=u,this.degrees-=270):this.degrees>=180?(l=this.getBottomRight(),this.x=l.x,this.y=l.y,this.degrees-=180):this.degrees>=90&&(l=this.getBottomLeft(),this.x=l.x,this.y=l.y,u=this.height,this.height=this.width,this.width=u,this.degrees-=90)},e.Rect.fromSummits=function(n,r,o){var s=n.distanceTo(r),a=n.distanceTo(o),l=r.minus(n),u=Math.atan(l.y/l.x);return l.x<0?u+=Math.PI:l.y<0&&(u+=2*Math.PI),new e.Rect(n.x,n.y,s,a,u/Math.PI*180)},e.Rect.prototype={clone:function(){return new e.Rect(this.x,this.y,this.width,this.height,this.degrees)},getAspectRatio:function(){return this.width/this.height},getTopLeft:function(){return new e.Point(this.x,this.y)},getBottomRight:function(){return new e.Point(this.x+this.width,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getTopRight:function(){return new e.Point(this.x+this.width,this.y).rotate(this.degrees,this.getTopLeft())},getBottomLeft:function(){return new e.Point(this.x,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getCenter:function(){return new e.Point(this.x+this.width/2,this.y+this.height/2).rotate(this.degrees,this.getTopLeft())},getSize:function(){return new e.Point(this.width,this.height)},equals:function(n){return n instanceof e.Rect&&this.x===n.x&&this.y===n.y&&this.width===n.width&&this.height===n.height&&this.degrees===n.degrees},times:function(n){return new e.Rect(this.x*n,this.y*n,this.width*n,this.height*n,this.degrees)},translate:function(n){return new e.Rect(this.x+n.x,this.y+n.y,this.width,this.height,this.degrees)},union:function(n){var r=this.getBoundingBox(),o=n.getBoundingBox(),s=Math.min(r.x,o.x),a=Math.min(r.y,o.y),l=Math.max(r.x+r.width,o.x+o.width),u=Math.max(r.y+r.height,o.y+o.height);return new e.Rect(s,a,l-s,u-a)},intersection:function(n){var r=1e-10,o=[],s=this.getTopLeft();n.containsPoint(s,r)&&o.push(s);var a=this.getTopRight();n.containsPoint(a,r)&&o.push(a);var l=this.getBottomLeft();n.containsPoint(l,r)&&o.push(l);var u=this.getBottomRight();n.containsPoint(u,r)&&o.push(u);var c=n.getTopLeft();this.containsPoint(c,r)&&o.push(c);var h=n.getTopRight();this.containsPoint(h,r)&&o.push(h);var d=n.getBottomLeft();this.containsPoint(d,r)&&o.push(d);var g=n.getBottomRight();this.containsPoint(g,r)&&o.push(g);for(var y=this._getSegments(),x=n._getSegments(),b=0;bD&&(D=Y.x),Y.yB&&(B=Y.y)}return new e.Rect(O,I,D-O,B-I)},_getSegments:function(){var n=this.getTopLeft(),r=this.getTopRight(),o=this.getBottomLeft(),s=this.getBottomRight();return[[n,r],[r,s],[s,o],[o,n]]},rotate:function(n,r){if(n=e.positiveModulo(n,360),n===0)return this.clone();r=r||this.getCenter();var o=this.getTopLeft().rotate(n,r),s=this.getTopRight().rotate(n,r),a=s.minus(o);a=a.apply(function(u){var c=1e-15;return Math.abs(u)=-r&&(n.x-s.x)*l.x+(n.y-s.y)*l.y<=r&&(n.x-o.x)*u.x+(n.y-o.y)*u.y>=-r&&(n.x-a.x)*u.x+(n.y-a.y)*u.y<=r},toString:function(){return"["+Math.round(this.x*100)/100+", "+Math.round(this.y*100)/100+", "+Math.round(this.width*100)/100+"x"+Math.round(this.height*100)/100+", "+Math.round(this.degrees*100)/100+"deg]"}}}(t),function(e){var n={};e.ReferenceStrip=function(d){var g=this,y=d.viewer,x=e.getElementSize(y.element),b,T,f;for(d.id||(d.id="referencestrip-"+e.now(),this.element=e.makeNeutralElement("div"),this.element.id=d.id,this.element.className="referencestrip"),d=e.extend(!0,{sizeRatio:e.DEFAULT_SETTINGS.referenceStripSizeRatio,position:e.DEFAULT_SETTINGS.referenceStripPosition,scroll:e.DEFAULT_SETTINGS.referenceStripScroll,clickTimeThreshold:e.DEFAULT_SETTINGS.clickTimeThreshold},d,{element:this.element}),e.extend(this,d),n[this.id]={animating:!1},this.minPixelRatio=this.viewer.minPixelRatio,this.element.tabIndex=0,T=this.element.style,T.marginTop="0px",T.marginRight="0px",T.marginBottom="0px",T.marginLeft="0px",T.left="0px",T.bottom="0px",T.border="0px",T.background="#000",T.position="relative",e.setElementTouchActionNone(this.element),e.setElementOpacity(this.element,.8),this.viewer=y,this.tracker=new e.MouseTracker({userData:"ReferenceStrip.tracker",element:this.element,clickHandler:e.delegate(this,r),dragHandler:e.delegate(this,o),scrollHandler:e.delegate(this,s),enterHandler:e.delegate(this,l),leaveHandler:e.delegate(this,u),keyDownHandler:e.delegate(this,c),keyHandler:e.delegate(this,h),preProcessEventHandler:function(E){E.eventType==="wheel"&&(E.preventDefault=!0)}}),d.width&&d.height?(this.element.style.width=d.width+"px",this.element.style.height=d.height+"px",y.addControl(this.element,{anchor:e.ControlAnchor.BOTTOM_LEFT})):d.scroll==="horizontal"?(this.element.style.width=x.x*d.sizeRatio*y.tileSources.length+12*y.tileSources.length+"px",this.element.style.height=x.y*d.sizeRatio+"px",y.addControl(this.element,{anchor:e.ControlAnchor.BOTTOM_LEFT})):(this.element.style.height=x.y*d.sizeRatio*y.tileSources.length+12*y.tileSources.length+"px",this.element.style.width=x.x*d.sizeRatio+"px",y.addControl(this.element,{anchor:e.ControlAnchor.TOP_LEFT})),this.panelWidth=x.x*this.sizeRatio+8,this.panelHeight=x.y*this.sizeRatio+8,this.panels=[],this.miniViewers={},f=0;fT+y.x-this.panelWidth?(E=Math.min(E,x-y.x),this.element.style.marginLeft=-E+"px",a(this,y.x,-E)):Ef+y.y-this.panelHeight?(E=Math.min(E,b-y.y),this.element.style.marginTop=-E+"px",a(this,y.y,-E)):E0?g>-(x-T.x)&&(this.element.style.marginLeft=g+d.delta.x*2+"px",a(this,T.x,g+d.delta.x*2)):-d.delta.x<0&&g<0&&(this.element.style.marginLeft=g+d.delta.x*2+"px",a(this,T.x,g+d.delta.x*2)):-d.delta.y>0?y>-(b-T.y)&&(this.element.style.marginTop=y+d.delta.y*2+"px",a(this,T.y,y+d.delta.y*2)):-d.delta.y<0&&y<0&&(this.element.style.marginTop=y+d.delta.y*2+"px",a(this,T.y,y+d.delta.y*2))}}function s(d){if(this.element){var g=Number(this.element.style.marginLeft.replace("px","")),y=Number(this.element.style.marginTop.replace("px","")),x=Number(this.element.style.width.replace("px","")),b=Number(this.element.style.height.replace("px","")),T=e.getElementSize(this.viewer.canvas);this.scroll==="horizontal"?d.scroll>0?g>-(x-T.x)&&(this.element.style.marginLeft=g-d.scroll*60+"px",a(this,T.x,g-d.scroll*60)):d.scroll<0&&g<0&&(this.element.style.marginLeft=g-d.scroll*60+"px",a(this,T.x,g-d.scroll*60)):d.scroll<0?y>T.y-b&&(this.element.style.marginTop=y+d.scroll*60+"px",a(this,T.y,y+d.scroll*60)):d.scroll>0&&y<0&&(this.element.style.marginTop=y+d.scroll*60+"px",a(this,T.y,y+d.scroll*60)),d.preventDefault=!0}}function a(d,g,y){var x,b,T,f,E,A;for(d.scroll==="horizontal"?x=d.panelWidth:x=d.panelHeight,b=Math.ceil(g/x)+5,T=Math.ceil((Math.abs(y)+g)/x)+1,b=T-b,b=b<0?0:b,E=b;E1?o[1].springStiffness:5,animationTime:o.length>1?o[1].animationTime:1.5}),e.console.assert(typeof r.springStiffness=="number"&&r.springStiffness!==0,"[OpenSeadragon.Spring] options.springStiffness must be a non-zero number"),e.console.assert(typeof r.animationTime=="number"&&r.animationTime>=0,"[OpenSeadragon.Spring] options.animationTime must be a number greater than or equal to 0"),r.exponential&&(this._exponential=!0,delete r.exponential),e.extend(!0,this,r),this.current={value:typeof this.initial=="number"?this.initial:this._exponential?0:1,time:e.now()},e.console.assert(!this._exponential||this.current.value!==0,"[OpenSeadragon.Spring] value must be non-zero for exponential springs"),this.start={value:this.current.value,time:this.current.time},this.target={value:this.current.value,time:this.current.time},this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},e.Spring.prototype={resetTo:function(r){e.console.assert(!this._exponential||r!==0,"[OpenSeadragon.Spring.resetTo] target must be non-zero for exponential springs"),this.start.value=this.target.value=this.current.value=r,this.start.time=this.target.time=this.current.time=e.now(),this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},springTo:function(r){e.console.assert(!this._exponential||r!==0,"[OpenSeadragon.Spring.springTo] target must be non-zero for exponential springs"),this.start.value=this.current.value,this.start.time=this.current.time,this.target.value=r,this.target.time=this.start.time+1e3*this.animationTime,this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},shiftBy:function(r){this.start.value+=r,this.target.value+=r,this._exponential&&(e.console.assert(this.target.value!==0&&this.start.value!==0,"[OpenSeadragon.Spring.shiftBy] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},setExponential:function(r){this._exponential=r,this._exponential&&(e.console.assert(this.current.value!==0&&this.target.value!==0&&this.start.value!==0,"[OpenSeadragon.Spring.setExponential] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},update:function(){this.current.time=e.now();var r,o;this._exponential?(r=this.start._logValue,o=this.target._logValue):(r=this.start.value,o=this.target.value);var s=this.current.time>=this.target.time?o:r+(o-r)*n(this.springStiffness,(this.current.time-this.start.time)/(this.target.time-this.start.time)),a=this.current.value;return this._exponential?this.current.value=Math.exp(s):this.current.value=s,a!==this.current.value},isAtTargetValue:function(){return this.current.value===this.target.value}};function n(r,o){return(1-Math.exp(r*-o))/(1-Math.exp(-r))}}(t),function(e){function n(o){e.extend(!0,this,{timeout:e.DEFAULT_SETTINGS.timeout,jobId:null},o),this.image=null}n.prototype={errorMsg:null,start:function(){var o=this,s=this.abort;this.image=new Image,this.image.onload=function(){o.finish(!0)},this.image.onabort=this.image.onerror=function(){o.errorMsg="Image load aborted",o.finish(!1)},this.jobId=window.setTimeout(function(){o.errorMsg="Image load exceeded timeout ("+o.timeout+" ms)",o.finish(!1)},this.timeout),this.loadWithAjax?(this.request=e.makeAjaxRequest({url:this.src,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,responseType:"arraybuffer",success:function(a){var l;try{l=new window.Blob([a.response])}catch(d){var u=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if(d.name==="TypeError"&&u){var c=new u;c.append(a.response),l=c.getBlob()}}l.size===0&&(o.errorMsg="Empty image response.",o.finish(!1));var h=(window.URL||window.webkitURL).createObjectURL(l);o.image.src=h},error:function(a){o.errorMsg="Image load aborted - XHR error",o.finish(!1)}}),this.abort=function(){o.request.abort(),typeof s=="function"&&s()}):(this.crossOriginPolicy!==!1&&(this.image.crossOrigin=this.crossOriginPolicy),this.image.src=this.src)},finish:function(o){this.image.onload=this.image.onerror=this.image.onabort=null,o||(this.image=null),this.jobId&&window.clearTimeout(this.jobId),this.callback(this)}},e.ImageLoader=function(o){e.extend(!0,this,{jobLimit:e.DEFAULT_SETTINGS.imageLoaderLimit,timeout:e.DEFAULT_SETTINGS.timeout,jobQueue:[],jobsInProgress:0},o)},e.ImageLoader.prototype={addJob:function(o){var s=this,a=function(c){r(s,c,o.callback)},l={src:o.src,loadWithAjax:o.loadWithAjax,ajaxHeaders:o.loadWithAjax?o.ajaxHeaders:null,crossOriginPolicy:o.crossOriginPolicy,ajaxWithCredentials:o.ajaxWithCredentials,callback:a,abort:o.abort,timeout:this.timeout},u=new n(l);!this.jobLimit||this.jobsInProgress0&&(l=o.jobQueue.shift(),l.start(),o.jobsInProgress++),a(s.image,s.errorMsg,s.request)}}(t),function(e){e.Tile=function(n,r,o,s,a,l,u,c,h,d){this.level=n,this.x=r,this.y=o,this.bounds=s,this.sourceBounds=d,this.exists=a,this.url=l,this.context2D=u,this.loadWithAjax=c,this.ajaxHeaders=h,this.ajaxHeaders?this.cacheKey=this.url+"+"+JSON.stringify(this.ajaxHeaders):this.cacheKey=this.url,this.loaded=!1,this.loading=!1,this.element=null,this.imgElement=null,this.image=null,this.style=null,this.position=null,this.size=null,this.flipped=!1,this.blendStart=null,this.opacity=null,this.squaredDistance=null,this.visibility=null,this.beingDrawn=!1,this.lastTouchTime=0,this.isRightMost=!1,this.isBottomMost=!1},e.Tile.prototype={toString:function(){return this.level+"/"+this.x+"_"+this.y},_hasTransparencyChannel:function(){return!!this.context2D||this.url.match(".png")},drawHTML:function(n){if(!this.cacheImageRecord){e.console.warn("[Tile.drawHTML] attempting to draw tile %s when it's not cached",this.toString());return}if(!this.loaded){e.console.warn("Attempting to draw tile %s when it's not yet loaded.",this.toString());return}this.element||(this.element=e.makeNeutralElement("div"),this.imgElement=this.cacheImageRecord.getImage().cloneNode(),this.imgElement.style.msInterpolationMode="nearest-neighbor",this.imgElement.style.width="100%",this.imgElement.style.height="100%",this.style=this.element.style,this.style.position="absolute"),this.element.parentNode!==n&&n.appendChild(this.element),this.imgElement.parentNode!==this.element&&this.element.appendChild(this.imgElement),this.style.top=this.position.y+"px",this.style.left=this.position.x+"px",this.style.height=this.size.y+"px",this.style.width=this.size.x+"px",this.flipped&&(this.style.transform="scaleX(-1)"),e.setElementOpacity(this.element,this.opacity)},drawCanvas:function(n,r,o,s){var a=this.position.times(e.pixelDensityRatio),l=this.size.times(e.pixelDensityRatio),u;if(!this.context2D&&!this.cacheImageRecord){e.console.warn("[Tile.drawCanvas] attempting to draw tile %s when it's not cached",this.toString());return}if(u=this.context2D||this.cacheImageRecord.getRenderedContext(),!this.loaded||!u){e.console.warn("Attempting to draw tile %s when it's not yet loaded.",this.toString());return}n.save(),n.globalAlpha=this.opacity,typeof o=="number"&&o!==1&&(a=a.times(o),l=l.times(o)),s instanceof e.Point&&(a=a.plus(s)),n.globalAlpha===1&&this._hasTransparencyChannel()&&n.clearRect(a.x,a.y,l.x,l.y),r({context:n,tile:this,rendered:u});var c,h;this.sourceBounds?(c=Math.min(this.sourceBounds.width,u.canvas.width),h=Math.min(this.sourceBounds.height,u.canvas.height)):(c=u.canvas.width,h=u.canvas.height),n.translate(a.x+l.x/2,0),this.flipped&&n.scale(-1,1),n.drawImage(u.canvas,0,0,c,h,-l.x/2,a.y,l.x,l.y),n.restore()},getScaleForEdgeSmoothing:function(){var n;if(this.cacheImageRecord)n=this.cacheImageRecord.getRenderedContext();else if(this.context2D)n=this.context2D;else return e.console.warn("[Tile.drawCanvas] attempting to get tile scale %s when tile's not cached",this.toString()),1;return n.canvas.width/(this.size.x*e.pixelDensityRatio)},getTranslationForEdgeSmoothing:function(n,r,o){var s=Math.max(1,Math.ceil((o.x-r.x)/2)),a=Math.max(1,Math.ceil((o.y-r.y)/2));return new e.Point(s,a).minus(this.position.times(e.pixelDensityRatio).times(n||1).apply(function(l){return l%1}))},unload:function(){this.imgElement&&this.imgElement.parentNode&&this.imgElement.parentNode.removeChild(this.imgElement),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null,this.imgElement=null,this.loaded=!1,this.loading=!1}}}(t),function(e){e.OverlayPlacement=e.Placement,e.OverlayRotationMode=e.freezeObject({NO_ROTATION:1,EXACT:2,BOUNDING_BOX:3}),e.Overlay=function(n,r,o){var s;e.isPlainObject(n)?s=n:s={element:n,location:r,placement:o},this.element=s.element,this.style=s.element.style,this._init(s)},e.Overlay.prototype={_init:function(n){this.location=n.location,this.placement=n.placement===void 0?e.Placement.TOP_LEFT:n.placement,this.onDraw=n.onDraw,this.checkResize=n.checkResize===void 0?!0:n.checkResize,this.width=n.width===void 0?null:n.width,this.height=n.height===void 0?null:n.height,this.rotationMode=n.rotationMode||e.OverlayRotationMode.EXACT,this.location instanceof e.Rect&&(this.width=this.location.width,this.height=this.location.height,this.location=this.location.getTopLeft(),this.placement=e.Placement.TOP_LEFT),this.scales=this.width!==null&&this.height!==null,this.bounds=new e.Rect(this.location.x,this.location.y,this.width,this.height),this.position=this.location},adjust:function(n,r){var o=e.Placement.properties[this.placement];!o||(o.isHorizontallyCentered?n.x-=r.x/2:o.isRight&&(n.x-=r.x),o.isVerticallyCentered?n.y-=r.y/2:o.isBottom&&(n.y-=r.y))},destroy:function(){var n=this.element,r=this.style;n.parentNode&&(n.parentNode.removeChild(n),n.prevElementParent&&(r.display="none",document.body.appendChild(n))),this.onDraw=null,r.top="",r.left="",r.position="",this.width!==null&&(r.width=""),this.height!==null&&(r.height="");var o=e.getCssPropertyWithVendorPrefix("transformOrigin"),s=e.getCssPropertyWithVendorPrefix("transform");o&&s&&(r[o]="",r[s]="")},drawHTML:function(n,r){var o=this.element;o.parentNode!==n&&(o.prevElementParent=o.parentNode,o.prevNextSibling=o.nextSibling,n.appendChild(o),this.style.position="absolute",this.size=e.getElementSize(o));var s=this._getOverlayPositionAndSize(r),a=s.position,l=this.size=s.size,u=s.rotate;if(this.onDraw)this.onDraw(a,l,this.element);else{var c=this.style;c.left=a.x+"px",c.top=a.y+"px",this.width!==null&&(c.width=l.x+"px"),this.height!==null&&(c.height=l.y+"px");var h=e.getCssPropertyWithVendorPrefix("transformOrigin"),d=e.getCssPropertyWithVendorPrefix("transform");h&&d&&(u?(c[h]=this._getTransformOrigin(),c[d]="rotate("+u+"deg)"):(c[h]="",c[d]="")),c.display="block"}},_getOverlayPositionAndSize:function(n){var r=n.pixelFromPoint(this.location,!0),o=this._getSizeInPixels(n);this.adjust(r,o);var s=0;if(n.degrees&&this.rotationMode!==e.OverlayRotationMode.NO_ROTATION)if(this.rotationMode===e.OverlayRotationMode.BOUNDING_BOX&&this.width!==null&&this.height!==null){var a=new e.Rect(r.x,r.y,o.x,o.y),l=this._getBoundingBox(a,n.degrees);r=l.getTopLeft(),o=l.getSize()}else s=n.degrees;return{position:r,size:o,rotate:s}},_getSizeInPixels:function(n){var r=this.size.x,o=this.size.y;if(this.width!==null||this.height!==null){var s=n.deltaPixelsFromPointsNoRotate(new e.Point(this.width||0,this.height||0),!0);this.width!==null&&(r=s.x),this.height!==null&&(o=s.y)}if(this.checkResize&&(this.width===null||this.height===null)){var a=this.size=e.getElementSize(this.element);this.width===null&&(r=a.x),this.height===null&&(o=a.y)}return new e.Point(r,o)},_getBoundingBox:function(n,r){var o=this._getPlacementPoint(n);return n.rotate(r,o).getBoundingBox()},_getPlacementPoint:function(n){var r=new e.Point(n.x,n.y),o=e.Placement.properties[this.placement];return o&&(o.isHorizontallyCentered?r.x+=n.width/2:o.isRight&&(r.x+=n.width),o.isVerticallyCentered?r.y+=n.height/2:o.isBottom&&(r.y+=n.height)),r},_getTransformOrigin:function(){var n="",r=e.Placement.properties[this.placement];return r&&(r.isLeft?n="left":r.isRight&&(n="right"),r.isTop?n+=" top":r.isBottom&&(n+=" bottom")),n},update:function(n,r){var o=e.isPlainObject(n)?n:{location:n,placement:r};this._init({location:o.location||this.location,placement:o.placement!==void 0?o.placement:this.placement,onDraw:o.onDraw||this.onDraw,checkResize:o.checkResize||this.checkResize,width:o.width!==void 0?o.width:this.width,height:o.height!==void 0?o.height:this.height,rotationMode:o.rotationMode||this.rotationMode})},getBounds:function(n){e.console.assert(n,"A viewport must now be passed to Overlay.getBounds.");var r=this.width,o=this.height;if(r===null||o===null){var s=n.deltaPointsFromPixelsNoRotate(this.size,!0);r===null&&(r=s.x),o===null&&(o=s.y)}var a=this.location.clone();return this.adjust(a,new e.Point(r,o)),this._adjustBoundsForRotation(n,new e.Rect(a.x,a.y,r,o))},_adjustBoundsForRotation:function(n,r){if(!n||n.degrees===0||this.rotationMode===e.OverlayRotationMode.EXACT)return r;if(this.rotationMode===e.OverlayRotationMode.BOUNDING_BOX){if(this.width===null||this.height===null)return r;var o=this._getOverlayPositionAndSize(n);return n.viewerElementToViewportRectangle(new e.Rect(o.position.x,o.position.y,o.size.x,o.size.y))}return r.rotate(-n.degrees,this._getPlacementPoint(r))}}}(t),function(e){e.Drawer=function(n){e.console.assert(n.viewer,"[Drawer] options.viewer is required");var r=arguments;if(e.isPlainObject(n)||(n={source:r[0],viewport:r[1],element:r[2]}),e.console.assert(n.viewport,"[Drawer] options.viewport is required"),e.console.assert(n.element,"[Drawer] options.element is required"),n.source&&e.console.error("[Drawer] options.source is no longer accepted; use TiledImage instead"),this.viewer=n.viewer,this.viewport=n.viewport,this.debugGridColor=typeof n.debugGridColor=="string"?[n.debugGridColor]:n.debugGridColor||e.DEFAULT_SETTINGS.debugGridColor,n.opacity&&e.console.error("[Drawer] options.opacity is no longer accepted; set the opacity on the TiledImage instead"),this.useCanvas=e.supportsCanvas&&(this.viewer?this.viewer.useCanvas:!0),this.container=e.getElement(n.element),this.canvas=e.makeNeutralElement(this.useCanvas?"canvas":"div"),this.context=this.useCanvas?this.canvas.getContext("2d"):null,this.sketchCanvas=null,this.sketchContext=null,this.element=this.container,this.container.dir="ltr",this.useCanvas){var o=this._calculateCanvasSize();this.canvas.width=o.x,this.canvas.height=o.y}this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.position="absolute",e.setElementOpacity(this.canvas,this.opacity,!0),e.setElementPointerEventsNone(this.canvas),e.setElementTouchActionNone(this.canvas),this.container.style.textAlign="left",this.container.appendChild(this.canvas),this._imageSmoothingEnabled=!0},e.Drawer.prototype={addOverlay:function(n,r,o,s){return e.console.error("drawer.addOverlay is deprecated. Use viewer.addOverlay instead."),this.viewer.addOverlay(n,r,o,s),this},updateOverlay:function(n,r,o){return e.console.error("drawer.updateOverlay is deprecated. Use viewer.updateOverlay instead."),this.viewer.updateOverlay(n,r,o),this},removeOverlay:function(n){return e.console.error("drawer.removeOverlay is deprecated. Use viewer.removeOverlay instead."),this.viewer.removeOverlay(n),this},clearOverlays:function(){return e.console.error("drawer.clearOverlays is deprecated. Use viewer.clearOverlays instead."),this.viewer.clearOverlays(),this},viewportCoordToDrawerCoord:function(n){var r=this.viewport.pixelFromPointNoRotate(n,!0);return new e.Point(r.x*e.pixelDensityRatio,r.y*e.pixelDensityRatio)},clipWithPolygons:function(n,r){if(!!this.useCanvas){var o=this._getContext(r);o.beginPath(),n.forEach(function(s){s.forEach(function(a,l){o[l===0?"moveTo":"lineTo"](a.x,a.y)})}),o.clip()}},setOpacity:function(n){e.console.error("drawer.setOpacity is deprecated. Use tiledImage.setOpacity instead.");for(var r=this.viewer.world,o=0;or&&(r=s)}return r},needsUpdate:function(){return e.console.error("[Drawer.needsUpdate] this function is deprecated. Use World.needsDraw instead."),this.viewer.world.needsDraw()},numTilesLoaded:function(){return e.console.error("[Drawer.numTilesLoaded] this function is deprecated. Use TileCache.numTilesLoaded instead."),this.viewer.tileCache.numTilesLoaded()},reset:function(){return e.console.error("[Drawer.reset] this function is deprecated. Use World.resetItems instead."),this.viewer.world.resetItems(),this},update:function(){return e.console.error("[Drawer.update] this function is deprecated. Use Drawer.clear and World.draw instead."),this.clear(),this.viewer.world.draw(),this},canRotate:function(){return this.useCanvas},destroy:function(){this.canvas.width=1,this.canvas.height=1,this.sketchCanvas=null,this.sketchContext=null},clear:function(){if(this.canvas.innerHTML="",this.useCanvas){var n=this._calculateCanvasSize();if((this.canvas.width!==n.x||this.canvas.height!==n.y)&&(this.canvas.width=n.x,this.canvas.height=n.y,this._updateImageSmoothingEnabled(this.context),this.sketchCanvas!==null)){var r=this._calculateSketchCanvasSize();this.sketchCanvas.width=r.x,this.sketchCanvas.height=r.y,this._updateImageSmoothingEnabled(this.sketchContext)}this._clear()}},_clear:function(n,r){if(!!this.useCanvas){var o=this._getContext(n);if(r)o.clearRect(r.x,r.y,r.width,r.height);else{var s=o.canvas;o.clearRect(0,0,s.width,s.height)}}},viewportToDrawerRectangle:function(n){var r=this.viewport.pixelFromPointNoRotate(n.getTopLeft(),!0),o=this.viewport.deltaPixelsFromPointsNoRotate(n.getSize(),!0);return new e.Rect(r.x*e.pixelDensityRatio,r.y*e.pixelDensityRatio,o.x*e.pixelDensityRatio,o.y*e.pixelDensityRatio)},drawTile:function(n,r,o,s,a){if(e.console.assert(n,"[Drawer.drawTile] tile is required"),e.console.assert(r,"[Drawer.drawTile] drawingHandler is required"),this.useCanvas){var l=this._getContext(o);s=s||1,n.drawCanvas(l,r,s,a)}else n.drawHTML(this.canvas)},_getContext:function(n){var r=this.context;if(n){if(this.sketchCanvas===null){this.sketchCanvas=document.createElement("canvas");var o=this._calculateSketchCanvasSize();if(this.sketchCanvas.width=o.x,this.sketchCanvas.height=o.y,this.sketchContext=this.sketchCanvas.getContext("2d"),this.viewport.getRotation()===0){var s=this;this.viewer.addHandler("rotate",function a(){if(s.viewport.getRotation()!==0){s.viewer.removeHandler("rotate",a);var l=s._calculateSketchCanvasSize();s.sketchCanvas.width=l.x,s.sketchCanvas.height=l.y}})}this._updateImageSmoothingEnabled(this.sketchContext)}r=this.sketchContext}return r},saveContext:function(n){!this.useCanvas||this._getContext(n).save()},restoreContext:function(n){!this.useCanvas||this._getContext(n).restore()},setClip:function(n,r){if(!!this.useCanvas){var o=this._getContext(r);o.beginPath(),o.rect(n.x,n.y,n.width,n.height),o.clip()}},drawRectangle:function(n,r,o){if(!!this.useCanvas){var s=this._getContext(o);s.save(),s.fillStyle=r,s.fillRect(n.x,n.y,n.width,n.height),s.restore()}},blendSketch:function(n,r,o,s){var a=n;if(e.isPlainObject(a)||(a={opacity:n,scale:r,translate:o,compositeOperation:s}),!(!this.useCanvas||!this.sketchCanvas)){n=a.opacity,s=a.compositeOperation;var l=a.bounds;if(this.context.save(),this.context.globalAlpha=n,s&&(this.context.globalCompositeOperation=s),l)l.x<0&&(l.width+=l.x,l.x=0),l.x+l.width>this.canvas.width&&(l.width=this.canvas.width-l.x),l.y<0&&(l.height+=l.y,l.y=0),l.y+l.height>this.canvas.height&&(l.height=this.canvas.height-l.y),this.context.drawImage(this.sketchCanvas,l.x,l.y,l.width,l.height,l.x,l.y,l.width,l.height);else{r=a.scale||1,o=a.translate;var u=o instanceof e.Point?o:new e.Point(0,0),c=0,h=0;if(o){var d=this.sketchCanvas.width-this.canvas.width,g=this.sketchCanvas.height-this.canvas.height;c=Math.round(d/2),h=Math.round(g/2)}this.context.drawImage(this.sketchCanvas,u.x-c*r,u.y-h*r,(this.canvas.width+2*c)*r,(this.canvas.height+2*h)*r,-c,-h,this.canvas.width+2*c,this.canvas.height+2*h)}this.context.restore()}},drawDebugInfo:function(n,r,o,s){if(!!this.useCanvas){var a=this.viewer.world.getIndexOfItem(s)%this.debugGridColor.length,l=this.context;l.save(),l.lineWidth=2*e.pixelDensityRatio,l.font="small-caps bold "+13*e.pixelDensityRatio+"px arial",l.strokeStyle=this.debugGridColor[a],l.fillStyle=this.debugGridColor[a],this.viewport.degrees!==0&&this._offsetForRotation({degrees:this.viewport.degrees}),s.getRotation(!0)%360!==0&&this._offsetForRotation({degrees:s.getRotation(!0),point:s.viewport.pixelFromPointNoRotate(s._getRotationPoint(!0),!0)}),s.viewport.degrees===0&&s.getRotation(!0)%360===0&&s._drawer.viewer.viewport.getFlip()&&s._drawer._flip(),l.strokeRect(n.position.x*e.pixelDensityRatio,n.position.y*e.pixelDensityRatio,n.size.x*e.pixelDensityRatio,n.size.y*e.pixelDensityRatio);var u=(n.position.x+n.size.x/2)*e.pixelDensityRatio,c=(n.position.y+n.size.y/2)*e.pixelDensityRatio;l.translate(u,c),l.rotate(Math.PI/180*-this.viewport.degrees),l.translate(-u,-c),n.x===0&&n.y===0&&(l.fillText("Zoom: "+this.viewport.getZoom(),n.position.x*e.pixelDensityRatio,(n.position.y-30)*e.pixelDensityRatio),l.fillText("Pan: "+this.viewport.getBounds().toString(),n.position.x*e.pixelDensityRatio,(n.position.y-20)*e.pixelDensityRatio)),l.fillText("Level: "+n.level,(n.position.x+10)*e.pixelDensityRatio,(n.position.y+20)*e.pixelDensityRatio),l.fillText("Column: "+n.x,(n.position.x+10)*e.pixelDensityRatio,(n.position.y+30)*e.pixelDensityRatio),l.fillText("Row: "+n.y,(n.position.x+10)*e.pixelDensityRatio,(n.position.y+40)*e.pixelDensityRatio),l.fillText("Order: "+o+" of "+r,(n.position.x+10)*e.pixelDensityRatio,(n.position.y+50)*e.pixelDensityRatio),l.fillText("Size: "+n.size.toString(),(n.position.x+10)*e.pixelDensityRatio,(n.position.y+60)*e.pixelDensityRatio),l.fillText("Position: "+n.position.toString(),(n.position.x+10)*e.pixelDensityRatio,(n.position.y+70)*e.pixelDensityRatio),this.viewport.degrees!==0&&this._restoreRotationChanges(),s.getRotation(!0)%360!==0&&this._restoreRotationChanges(),s.viewport.degrees===0&&s.getRotation(!0)%360===0&&s._drawer.viewer.viewport.getFlip()&&s._drawer._flip(),l.restore()}},debugRect:function(n){if(this.useCanvas){var r=this.context;r.save(),r.lineWidth=2*e.pixelDensityRatio,r.strokeStyle=this.debugGridColor[0],r.fillStyle=this.debugGridColor[0],r.strokeRect(n.x*e.pixelDensityRatio,n.y*e.pixelDensityRatio,n.width*e.pixelDensityRatio,n.height*e.pixelDensityRatio),r.restore()}},setImageSmoothingEnabled:function(n){this.useCanvas&&(this._imageSmoothingEnabled=n,this._updateImageSmoothingEnabled(this.context),this.viewer.forceRedraw())},_updateImageSmoothingEnabled:function(n){n.msImageSmoothingEnabled=this._imageSmoothingEnabled,n.imageSmoothingEnabled=this._imageSmoothingEnabled},getCanvasSize:function(n){var r=this._getContext(n).canvas;return new e.Point(r.width,r.height)},getCanvasCenter:function(){return new e.Point(this.canvas.width/2,this.canvas.height/2)},_offsetForRotation:function(n){var r=n.point?n.point.times(e.pixelDensityRatio):this.getCanvasCenter(),o=this._getContext(n.useSketch);o.save(),o.translate(r.x,r.y),this.viewer.viewport.flipped?(o.rotate(Math.PI/180*-n.degrees),o.scale(-1,1)):o.rotate(Math.PI/180*n.degrees),o.translate(-r.x,-r.y)},_flip:function(n){n=n||{};var r=n.point?n.point.times(e.pixelDensityRatio):this.getCanvasCenter(),o=this._getContext(n.useSketch);o.translate(r.x,0),o.scale(-1,1),o.translate(-r.x,0)},_restoreRotationChanges:function(n){var r=this._getContext(n);r.restore()},_calculateCanvasSize:function(){var n=e.pixelDensityRatio,r=this.viewport.getContainerSize();return{x:Math.round(r.x*n),y:Math.round(r.y*n)}},_calculateSketchCanvasSize:function(){var n=this._calculateCanvasSize();if(this.viewport.getRotation()===0)return n;var r=Math.ceil(Math.sqrt(n.x*n.x+n.y*n.y));return{x:r,y:r}}}}(t),function(e){e.Viewport=function(n){var r=arguments;r.length&&r[0]instanceof e.Point&&(n={containerSize:r[0],contentSize:r[1],config:r[2]}),n.config&&(e.extend(!0,n,n.config),delete n.config),this._margins=e.extend({left:0,top:0,right:0,bottom:0},n.margins||{}),delete n.margins,e.extend(!0,this,{containerSize:null,contentSize:null,zoomPoint:null,viewer:null,springStiffness:e.DEFAULT_SETTINGS.springStiffness,animationTime:e.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:e.DEFAULT_SETTINGS.minZoomImageRatio,maxZoomPixelRatio:e.DEFAULT_SETTINGS.maxZoomPixelRatio,visibilityRatio:e.DEFAULT_SETTINGS.visibilityRatio,wrapHorizontal:e.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:e.DEFAULT_SETTINGS.wrapVertical,defaultZoomLevel:e.DEFAULT_SETTINGS.defaultZoomLevel,minZoomLevel:e.DEFAULT_SETTINGS.minZoomLevel,maxZoomLevel:e.DEFAULT_SETTINGS.maxZoomLevel,degrees:e.DEFAULT_SETTINGS.degrees,flipped:e.DEFAULT_SETTINGS.flipped,homeFillsViewer:e.DEFAULT_SETTINGS.homeFillsViewer},n),this._updateContainerInnerSize(),this.centerSpringX=new e.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.centerSpringY=new e.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.zoomSpring=new e.Spring({exponential:!0,initial:1,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,this._setContentBounds(new e.Rect(0,0,1,1),1),this.goHome(!0),this.update()},e.Viewport.prototype={resetContentSize:function(n){return e.console.assert(n,"[Viewport.resetContentSize] contentSize is required"),e.console.assert(n instanceof e.Point,"[Viewport.resetContentSize] contentSize must be an OpenSeadragon.Point"),e.console.assert(n.x>0,"[Viewport.resetContentSize] contentSize.x must be greater than 0"),e.console.assert(n.y>0,"[Viewport.resetContentSize] contentSize.y must be greater than 0"),this._setContentBounds(new e.Rect(0,0,1,n.y/n.x),n.x),this},setHomeBounds:function(n,r){e.console.error("[Viewport.setHomeBounds] this function is deprecated; The content bounds should not be set manually."),this._setContentBounds(n,r)},_setContentBounds:function(n,r){e.console.assert(n,"[Viewport._setContentBounds] bounds is required"),e.console.assert(n instanceof e.Rect,"[Viewport._setContentBounds] bounds must be an OpenSeadragon.Rect"),e.console.assert(n.width>0,"[Viewport._setContentBounds] bounds.width must be greater than 0"),e.console.assert(n.height>0,"[Viewport._setContentBounds] bounds.height must be greater than 0"),this._contentBoundsNoRotate=n.clone(),this._contentSizeNoRotate=this._contentBoundsNoRotate.getSize().times(r),this._contentBounds=n.rotate(this.degrees).getBoundingBox(),this._contentSize=this._contentBounds.getSize().times(r),this._contentAspectRatio=this._contentSize.x/this._contentSize.y,this.viewer&&this.viewer.raiseEvent("reset-size",{contentSize:this._contentSizeNoRotate.clone(),contentFactor:r,homeBounds:this._contentBoundsNoRotate.clone(),contentBounds:this._contentBounds.clone()})},getHomeZoom:function(){if(this.defaultZoomLevel)return this.defaultZoomLevel;var n=this._contentAspectRatio/this.getAspectRatio(),r;return this.homeFillsViewer?r=n>=1?n:1:r=n>=1?1:n,r/this._contentBounds.width},getHomeBounds:function(){return this.getHomeBoundsNoRotate().rotate(-this.getRotation())},getHomeBoundsNoRotate:function(){var n=this._contentBounds.getCenter(),r=1/this.getHomeZoom(),o=r/this.getAspectRatio();return new e.Rect(n.x-r/2,n.y-o/2,r,o)},goHome:function(n){return this.viewer&&this.viewer.raiseEvent("home",{immediately:n}),this.fitBounds(this.getHomeBounds(),n)},getMinZoom:function(){var n=this.getHomeZoom(),r=this.minZoomLevel?this.minZoomLevel:this.minZoomImageRatio*n;return r},getMaxZoom:function(){var n=this.maxZoomLevel;return n||(n=this._contentSize.x*this.maxZoomPixelRatio/this._containerInnerSize.x,n/=this._contentBounds.width),Math.max(n,this.getHomeZoom())},getAspectRatio:function(){return this._containerInnerSize.x/this._containerInnerSize.y},getContainerSize:function(){return new e.Point(this.containerSize.x,this.containerSize.y)},getMargins:function(){return e.extend({},this._margins)},setMargins:function(n){e.console.assert(e.type(n)==="object","[Viewport.setMargins] margins must be an object"),this._margins=e.extend({left:0,top:0,right:0,bottom:0},n),this._updateContainerInnerSize(),this.viewer&&this.viewer.forceRedraw()},getBounds:function(n){return this.getBoundsNoRotate(n).rotate(-this.getRotation())},getBoundsNoRotate:function(n){var r=this.getCenter(n),o=1/this.getZoom(n),s=o/this.getAspectRatio();return new e.Rect(r.x-o/2,r.y-s/2,o,s)},getBoundsWithMargins:function(n){return this.getBoundsNoRotateWithMargins(n).rotate(-this.getRotation(),this.getCenter(n))},getBoundsNoRotateWithMargins:function(n){var r=this.getBoundsNoRotate(n),o=this._containerInnerSize.x*this.getZoom(n);return r.x-=this._margins.left/o,r.y-=this._margins.top/o,r.width+=(this._margins.left+this._margins.right)/o,r.height+=(this._margins.top+this._margins.bottom)/o,r},getCenter:function(n){var r=new e.Point(this.centerSpringX.current.value,this.centerSpringY.current.value),o=new e.Point(this.centerSpringX.target.value,this.centerSpringY.target.value),s,a,l,u,c,h,d,g;return n?r:this.zoomPoint?(s=this.pixelFromPoint(this.zoomPoint,!0),a=this.getZoom(),l=1/a,u=l/this.getAspectRatio(),c=new e.Rect(r.x-l/2,r.y-u/2,l,u),h=this._pixelFromPoint(this.zoomPoint,c),d=h.minus(s),g=d.divide(this._containerInnerSize.x*a),o.plus(g)):o},getZoom:function(n){return n?this.zoomSpring.current.value:this.zoomSpring.target.value},_applyZoomConstraints:function(n){return Math.max(Math.min(n,this.getMaxZoom()),this.getMinZoom())},_applyBoundaryConstraints:function(n){var r=new e.Rect(n.x,n.y,n.width,n.height);if(!this.wrapHorizontal){var o=this.visibilityRatio*r.width,s=r.x+r.width,a=this._contentBoundsNoRotate.x+this._contentBoundsNoRotate.width,l=this._contentBoundsNoRotate.x-s+o,u=a-r.x-o;o>this._contentBoundsNoRotate.width?r.x+=(l+u)/2:u<0?r.x+=u:l>0&&(r.x+=l)}if(!this.wrapVertical){var c=this.visibilityRatio*r.height,h=r.y+r.height,d=this._contentBoundsNoRotate.y+this._contentBoundsNoRotate.height,g=this._contentBoundsNoRotate.y-h+c,y=d-r.y-c;c>this._contentBoundsNoRotate.height?r.y+=(g+y)/2:y<0?r.y+=y:g>0&&(r.y+=g)}return r},_raiseConstraintsEvent:function(n){this.viewer&&this.viewer.raiseEvent("constrain",{immediately:n})},applyConstraints:function(n){var r=this.getZoom(),o=this._applyZoomConstraints(r);r!==o&&this.zoomTo(o,this.zoomPoint,n);var s=this.getBoundsNoRotate(),a=this._applyBoundaryConstraints(s);return this._raiseConstraintsEvent(n),(s.x!==a.x||s.y!==a.y||n)&&this.fitBounds(a.rotate(-this.getRotation()),n),this},ensureVisible:function(n){return this.applyConstraints(n)},_fitBounds:function(n,r){r=r||{};var o=r.immediately||!1,s=r.constraints||!1,a=this.getAspectRatio(),l=n.getCenter(),u=new e.Rect(n.x,n.y,n.width,n.height,n.degrees+this.getRotation()).getBoundingBox();u.getAspectRatio()>=a?u.height=u.width/a:u.width=u.height*a,u.x=l.x-u.width/2,u.y=l.y-u.height/2;var c=1/u.width;if(s){var h=u.getAspectRatio(),d=this._applyZoomConstraints(c);c!==d&&(c=d,u.width=1/c,u.x=l.x-u.width/2,u.height=u.width/h,u.y=l.y-u.height/2),u=this._applyBoundaryConstraints(u),l=u.getCenter(),this._raiseConstraintsEvent(o)}if(o)return this.panTo(l,!0),this.zoomTo(c,null,!0);this.panTo(this.getCenter(!0),!0),this.zoomTo(this.getZoom(!0),null,!0);var g=this.getBounds(),y=this.getZoom();if(y===0||Math.abs(c/y-1)<1e-8)return this.zoomTo(c,!0),this.panTo(l,o);u=u.rotate(-this.getRotation());var x=u.getTopLeft().times(c).minus(g.getTopLeft().times(y)).divide(c-y);return this.zoomTo(c,x,o)},fitBounds:function(n,r){return this._fitBounds(n,{immediately:r,constraints:!1})},fitBoundsWithConstraints:function(n,r){return this._fitBounds(n,{immediately:r,constraints:!0})},fitVertically:function(n){var r=new e.Rect(this._contentBounds.x+this._contentBounds.width/2,this._contentBounds.y,0,this._contentBounds.height);return this.fitBounds(r,n)},fitHorizontally:function(n){var r=new e.Rect(this._contentBounds.x,this._contentBounds.y+this._contentBounds.height/2,this._contentBounds.width,0);return this.fitBounds(r,n)},getConstrainedBounds:function(n){var r,o;return r=this.getBounds(n),o=this._applyBoundaryConstraints(r),o},panBy:function(n,r){var o=new e.Point(this.centerSpringX.target.value,this.centerSpringY.target.value);return this.panTo(o.plus(n),r)},panTo:function(n,r){return r?(this.centerSpringX.resetTo(n.x),this.centerSpringY.resetTo(n.y)):(this.centerSpringX.springTo(n.x),this.centerSpringY.springTo(n.y)),this.viewer&&this.viewer.raiseEvent("pan",{center:n,immediately:r}),this},zoomBy:function(n,r,o){return this.zoomTo(this.zoomSpring.target.value*n,r,o)},zoomTo:function(n,r,o){var s=this;return this.zoomPoint=r instanceof e.Point&&!isNaN(r.x)&&!isNaN(r.y)?r:null,o?this._adjustCenterSpringsForZoomPoint(function(){s.zoomSpring.resetTo(n)}):this.zoomSpring.springTo(n),this.viewer&&this.viewer.raiseEvent("zoom",{zoom:n,refPoint:r,immediately:o}),this},setRotation:function(n){return!this.viewer||!this.viewer.drawer.canRotate()?this:(this.degrees=e.positiveModulo(n,360),this._setContentBounds(this.viewer.world.getHomeBounds(),this.viewer.world.getContentFactor()),this.viewer.forceRedraw(),this.viewer.raiseEvent("rotate",{degrees:n}),this)},getRotation:function(){return this.degrees},resize:function(n,r){var o=this.getBoundsNoRotate(),s=o,a;return this.containerSize.x=n.x,this.containerSize.y=n.y,this._updateContainerInnerSize(),r&&(a=n.x/this.containerSize.x,s.width=o.width*a,s.height=s.width/this.getAspectRatio()),this.viewer&&this.viewer.raiseEvent("resize",{newContainerSize:n,maintain:r}),this.fitBounds(s,!0)},_updateContainerInnerSize:function(){this._containerInnerSize=new e.Point(Math.max(1,this.containerSize.x-(this._margins.left+this._margins.right)),Math.max(1,this.containerSize.y-(this._margins.top+this._margins.bottom)))},update:function(){var n=this;this._adjustCenterSpringsForZoomPoint(function(){n.zoomSpring.update()}),this.centerSpringX.update(),this.centerSpringY.update();var r=this.centerSpringX.current.value!==this._oldCenterX||this.centerSpringY.current.value!==this._oldCenterY||this.zoomSpring.current.value!==this._oldZoom;return this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,r},_adjustCenterSpringsForZoomPoint:function(n){if(this.zoomPoint){var r=this.pixelFromPoint(this.zoomPoint,!0);n();var o=this.pixelFromPoint(this.zoomPoint,!0),s=o.minus(r),a=this.deltaPointsFromPixels(s,!0);this.centerSpringX.shiftBy(a.x),this.centerSpringY.shiftBy(a.y),this.zoomSpring.isAtTargetValue()&&(this.zoomPoint=null)}else n()},deltaPixelsFromPointsNoRotate:function(n,r){return n.times(this._containerInnerSize.x*this.getZoom(r))},deltaPixelsFromPoints:function(n,r){return this.deltaPixelsFromPointsNoRotate(n.rotate(this.getRotation()),r)},deltaPointsFromPixelsNoRotate:function(n,r){return n.divide(this._containerInnerSize.x*this.getZoom(r))},deltaPointsFromPixels:function(n,r){return this.deltaPointsFromPixelsNoRotate(n,r).rotate(-this.getRotation())},pixelFromPointNoRotate:function(n,r){return this._pixelFromPointNoRotate(n,this.getBoundsNoRotate(r))},pixelFromPoint:function(n,r){return this._pixelFromPoint(n,this.getBoundsNoRotate(r))},_pixelFromPointNoRotate:function(n,r){return n.minus(r.getTopLeft()).times(this._containerInnerSize.x/r.width).plus(new e.Point(this._margins.left,this._margins.top))},_pixelFromPoint:function(n,r){return this._pixelFromPointNoRotate(n.rotate(this.getRotation(),this.getCenter(!0)),r)},pointFromPixelNoRotate:function(n,r){var o=this.getBoundsNoRotate(r);return n.minus(new e.Point(this._margins.left,this._margins.top)).divide(this._containerInnerSize.x/o.width).plus(o.getTopLeft())},pointFromPixel:function(n,r){return this.pointFromPixelNoRotate(n,r).rotate(-this.getRotation(),this.getCenter(!0))},_viewportToImageDelta:function(n,r){var o=this._contentBoundsNoRotate.width;return new e.Point(n*this._contentSizeNoRotate.x/o,r*this._contentSizeNoRotate.x/o)},viewportToImageCoordinates:function(n,r){if(n instanceof e.Point)return this.viewportToImageCoordinates(n.x,n.y);if(this.viewer){var o=this.viewer.world.getItemCount();if(o>1)e.console.error("[Viewport.viewportToImageCoordinates] is not accurate with multi-image; use TiledImage.viewportToImageCoordinates instead.");else if(o===1){var s=this.viewer.world.getItemAt(0);return s.viewportToImageCoordinates(n,r,!0)}}return this._viewportToImageDelta(n-this._contentBoundsNoRotate.x,r-this._contentBoundsNoRotate.y)},_imageToViewportDelta:function(n,r){var o=this._contentBoundsNoRotate.width;return new e.Point(n/this._contentSizeNoRotate.x*o,r/this._contentSizeNoRotate.x*o)},imageToViewportCoordinates:function(n,r){if(n instanceof e.Point)return this.imageToViewportCoordinates(n.x,n.y);if(this.viewer){var o=this.viewer.world.getItemCount();if(o>1)e.console.error("[Viewport.imageToViewportCoordinates] is not accurate with multi-image; use TiledImage.imageToViewportCoordinates instead.");else if(o===1){var s=this.viewer.world.getItemAt(0);return s.imageToViewportCoordinates(n,r,!0)}}var a=this._imageToViewportDelta(n,r);return a.x+=this._contentBoundsNoRotate.x,a.y+=this._contentBoundsNoRotate.y,a},imageToViewportRectangle:function(n,r,o,s){var a=n;if(a instanceof e.Rect||(a=new e.Rect(n,r,o,s)),this.viewer){var l=this.viewer.world.getItemCount();if(l>1)e.console.error("[Viewport.imageToViewportRectangle] is not accurate with multi-image; use TiledImage.imageToViewportRectangle instead.");else if(l===1){var u=this.viewer.world.getItemAt(0);return u.imageToViewportRectangle(n,r,o,s,!0)}}var c=this.imageToViewportCoordinates(a.x,a.y),h=this._imageToViewportDelta(a.width,a.height);return new e.Rect(c.x,c.y,h.x,h.y,a.degrees)},viewportToImageRectangle:function(n,r,o,s){var a=n;if(a instanceof e.Rect||(a=new e.Rect(n,r,o,s)),this.viewer){var l=this.viewer.world.getItemCount();if(l>1)e.console.error("[Viewport.viewportToImageRectangle] is not accurate with multi-image; use TiledImage.viewportToImageRectangle instead.");else if(l===1){var u=this.viewer.world.getItemAt(0);return u.viewportToImageRectangle(n,r,o,s,!0)}}var c=this.viewportToImageCoordinates(a.x,a.y),h=this._viewportToImageDelta(a.width,a.height);return new e.Rect(c.x,c.y,h.x,h.y,a.degrees)},viewerElementToImageCoordinates:function(n){var r=this.pointFromPixel(n,!0);return this.viewportToImageCoordinates(r)},imageToViewerElementCoordinates:function(n){var r=this.imageToViewportCoordinates(n);return this.pixelFromPoint(r,!0)},windowToImageCoordinates:function(n){e.console.assert(this.viewer,"[Viewport.windowToImageCoordinates] the viewport must have a viewer.");var r=n.minus(e.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(r)},imageToWindowCoordinates:function(n){e.console.assert(this.viewer,"[Viewport.imageToWindowCoordinates] the viewport must have a viewer.");var r=this.imageToViewerElementCoordinates(n);return r.plus(e.getElementPosition(this.viewer.element))},viewerElementToViewportCoordinates:function(n){return this.pointFromPixel(n,!0)},viewportToViewerElementCoordinates:function(n){return this.pixelFromPoint(n,!0)},viewerElementToViewportRectangle:function(n){return e.Rect.fromSummits(this.pointFromPixel(n.getTopLeft(),!0),this.pointFromPixel(n.getTopRight(),!0),this.pointFromPixel(n.getBottomLeft(),!0))},viewportToViewerElementRectangle:function(n){return e.Rect.fromSummits(this.pixelFromPoint(n.getTopLeft(),!0),this.pixelFromPoint(n.getTopRight(),!0),this.pixelFromPoint(n.getBottomLeft(),!0))},windowToViewportCoordinates:function(n){e.console.assert(this.viewer,"[Viewport.windowToViewportCoordinates] the viewport must have a viewer.");var r=n.minus(e.getElementPosition(this.viewer.element));return this.viewerElementToViewportCoordinates(r)},viewportToWindowCoordinates:function(n){e.console.assert(this.viewer,"[Viewport.viewportToWindowCoordinates] the viewport must have a viewer.");var r=this.viewportToViewerElementCoordinates(n);return r.plus(e.getElementPosition(this.viewer.element))},viewportToImageZoom:function(n){if(this.viewer){var r=this.viewer.world.getItemCount();if(r>1)e.console.error("[Viewport.viewportToImageZoom] is not accurate with multi-image.");else if(r===1){var o=this.viewer.world.getItemAt(0);return o.viewportToImageZoom(n)}}var s=this._contentSizeNoRotate.x,a=this._containerInnerSize.x,l=this._contentBoundsNoRotate.width,u=a/s*l;return n*u},imageToViewportZoom:function(n){if(this.viewer){var r=this.viewer.world.getItemCount();if(r>1)e.console.error("[Viewport.imageToViewportZoom] is not accurate with multi-image.");else if(r===1){var o=this.viewer.world.getItemAt(0);return o.imageToViewportZoom(n)}}var s=this._contentSizeNoRotate.x,a=this._containerInnerSize.x,l=this._contentBoundsNoRotate.width,u=s/a/l;return n*u},toggleFlip:function(){return this.setFlip(!this.getFlip()),this},getFlip:function(){return this.flipped},setFlip:function(n){return this.flipped===n?this:(this.flipped=n,this.viewer.navigator&&this.viewer.navigator.setFlip(this.getFlip()),this.viewer.forceRedraw(),this.viewer.raiseEvent("flip",{flipped:n}),this)}}}(t),function(e){e.TiledImage=function(f){var E=this;e.console.assert(f.tileCache,"[TiledImage] options.tileCache is required"),e.console.assert(f.drawer,"[TiledImage] options.drawer is required"),e.console.assert(f.viewer,"[TiledImage] options.viewer is required"),e.console.assert(f.imageLoader,"[TiledImage] options.imageLoader is required"),e.console.assert(f.source,"[TiledImage] options.source is required"),e.console.assert(!f.clip||f.clip instanceof e.Rect,"[TiledImage] options.clip must be an OpenSeadragon.Rect if present"),e.EventSource.call(this),this._tileCache=f.tileCache,delete f.tileCache,this._drawer=f.drawer,delete f.drawer,this._imageLoader=f.imageLoader,delete f.imageLoader,f.clip instanceof e.Rect&&(this._clip=f.clip.clone()),delete f.clip;var A=f.x||0;delete f.x;var C=f.y||0;delete f.y,this.normHeight=f.source.dimensions.y/f.source.dimensions.x,this.contentAspectX=f.source.dimensions.x/f.source.dimensions.y;var O=1;f.width?(O=f.width,delete f.width,f.height&&(e.console.error("specifying both width and height to a tiledImage is not supported"),delete f.height)):f.height&&(O=f.height/this.normHeight,delete f.height);var D=f.fitBounds;delete f.fitBounds;var I=f.fitBoundsPlacement||t.Placement.CENTER;delete f.fitBoundsPlacement;var B=f.degrees||0;delete f.degrees,e.extend(!0,this,{viewer:null,tilesMatrix:{},coverage:{},loadingCoverage:{},lastDrawn:[],lastResetTime:0,_midDraw:!1,_needsDraw:!0,_hasOpaqueTile:!1,_tilesLoading:0,springStiffness:e.DEFAULT_SETTINGS.springStiffness,animationTime:e.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:e.DEFAULT_SETTINGS.minZoomImageRatio,wrapHorizontal:e.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:e.DEFAULT_SETTINGS.wrapVertical,immediateRender:e.DEFAULT_SETTINGS.immediateRender,blendTime:e.DEFAULT_SETTINGS.blendTime,alwaysBlend:e.DEFAULT_SETTINGS.alwaysBlend,minPixelRatio:e.DEFAULT_SETTINGS.minPixelRatio,smoothTileEdgesMinZoom:e.DEFAULT_SETTINGS.smoothTileEdgesMinZoom,iOSDevice:e.DEFAULT_SETTINGS.iOSDevice,debugMode:e.DEFAULT_SETTINGS.debugMode,crossOriginPolicy:e.DEFAULT_SETTINGS.crossOriginPolicy,ajaxWithCredentials:e.DEFAULT_SETTINGS.ajaxWithCredentials,placeholderFillStyle:e.DEFAULT_SETTINGS.placeholderFillStyle,opacity:e.DEFAULT_SETTINGS.opacity,preload:e.DEFAULT_SETTINGS.preload,compositeOperation:e.DEFAULT_SETTINGS.compositeOperation},f),this._preload=this.preload,delete this.preload,this._fullyLoaded=!1,this._xSpring=new e.Spring({initial:A,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._ySpring=new e.Spring({initial:C,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._scaleSpring=new e.Spring({initial:O,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._degreesSpring=new e.Spring({initial:B,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._updateForScale(),D&&this.fitBounds(D,I,!0),this._drawingHandler=function(Z){E.viewer.raiseEvent("tile-drawing",e.extend({tiledImage:E},Z))}},e.extend(e.TiledImage.prototype,e.EventSource.prototype,{needsDraw:function(){return this._needsDraw},getFullyLoaded:function(){return this._fullyLoaded},_setFullyLoaded:function(f){f!==this._fullyLoaded&&(this._fullyLoaded=f,this.raiseEvent("fully-loaded-change",{fullyLoaded:this._fullyLoaded}))},reset:function(){this._tileCache.clearTilesFor(this),this.lastResetTime=e.now(),this._needsDraw=!0},update:function(){var f=this._xSpring.update(),E=this._ySpring.update(),A=this._scaleSpring.update(),C=this._degreesSpring.update();return f||E||A||C?(this._updateForScale(),this._needsDraw=!0,!0):!1},draw:function(){this.opacity!==0||this._preload?(this._midDraw=!0,this._updateViewport(),this._midDraw=!1):this._needsDraw=!1},destroy:function(){this.reset(),this.source.destroy&&this.source.destroy()},getBounds:function(f){return this.getBoundsNoRotate(f).rotate(this.getRotation(f),this._getRotationPoint(f))},getBoundsNoRotate:function(f){return f?new e.Rect(this._xSpring.current.value,this._ySpring.current.value,this._worldWidthCurrent,this._worldHeightCurrent):new e.Rect(this._xSpring.target.value,this._ySpring.target.value,this._worldWidthTarget,this._worldHeightTarget)},getWorldBounds:function(){return e.console.error("[TiledImage.getWorldBounds] is deprecated; use TiledImage.getBounds instead"),this.getBounds()},getClippedBounds:function(f){var E=this.getBoundsNoRotate(f);if(this._clip){var A=f?this._worldWidthCurrent:this._worldWidthTarget,C=A/this.source.dimensions.x,O=this._clip.times(C);E=new e.Rect(E.x+O.x,E.y+O.y,O.width,O.height)}return E.rotate(this.getRotation(f),this._getRotationPoint(f))},getTileBounds:function(f,E,A){var C=this.source.getNumTiles(f),O=(C.x+E%C.x)%C.x,D=(C.y+A%C.y)%C.y,I=this.source.getTileBounds(f,O,D);return this.getFlip()&&(I.x=1-I.x-I.width),I.x+=(E-O)/C.x,I.y+=this._worldHeightCurrent/this._worldWidthCurrent*((A-D)/C.y),I},getContentSize:function(){return new e.Point(this.source.dimensions.x,this.source.dimensions.y)},getSizeInWindowCoordinates:function(){var f=this.imageToWindowCoordinates(new e.Point(0,0)),E=this.imageToWindowCoordinates(this.getContentSize());return new e.Point(E.x-f.x,E.y-f.y)},_viewportToImageDelta:function(f,E,A){var C=A?this._scaleSpring.current.value:this._scaleSpring.target.value;return new e.Point(f*(this.source.dimensions.x/C),E*(this.source.dimensions.y*this.contentAspectX/C))},viewportToImageCoordinates:function(f,E,A){var C;return f instanceof e.Point?(A=E,C=f):C=new e.Point(f,E),C=C.rotate(-this.getRotation(A),this._getRotationPoint(A)),A?this._viewportToImageDelta(C.x-this._xSpring.current.value,C.y-this._ySpring.current.value):this._viewportToImageDelta(C.x-this._xSpring.target.value,C.y-this._ySpring.target.value)},_imageToViewportDelta:function(f,E,A){var C=A?this._scaleSpring.current.value:this._scaleSpring.target.value;return new e.Point(f/this.source.dimensions.x*C,E/this.source.dimensions.y/this.contentAspectX*C)},imageToViewportCoordinates:function(f,E,A){f instanceof e.Point&&(A=E,E=f.y,f=f.x);var C=this._imageToViewportDelta(f,E);return A?(C.x+=this._xSpring.current.value,C.y+=this._ySpring.current.value):(C.x+=this._xSpring.target.value,C.y+=this._ySpring.target.value),C.rotate(this.getRotation(A),this._getRotationPoint(A))},imageToViewportRectangle:function(f,E,A,C,O){var D=f;D instanceof e.Rect?O=E:D=new e.Rect(f,E,A,C);var I=this.imageToViewportCoordinates(D.getTopLeft(),O),B=this._imageToViewportDelta(D.width,D.height,O);return new e.Rect(I.x,I.y,B.x,B.y,D.degrees+this.getRotation(O))},viewportToImageRectangle:function(f,E,A,C,O){var D=f;f instanceof e.Rect?O=E:D=new e.Rect(f,E,A,C);var I=this.viewportToImageCoordinates(D.getTopLeft(),O),B=this._viewportToImageDelta(D.width,D.height,O);return new e.Rect(I.x,I.y,B.x,B.y,D.degrees-this.getRotation(O))},viewerElementToImageCoordinates:function(f){var E=this.viewport.pointFromPixel(f,!0);return this.viewportToImageCoordinates(E)},imageToViewerElementCoordinates:function(f){var E=this.imageToViewportCoordinates(f);return this.viewport.pixelFromPoint(E,!0)},windowToImageCoordinates:function(f){var E=f.minus(t.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(E)},imageToWindowCoordinates:function(f){var E=this.imageToViewerElementCoordinates(f);return E.plus(t.getElementPosition(this.viewer.element))},_viewportToTiledImageRectangle:function(f){var E=this._scaleSpring.current.value;return f=f.rotate(-this.getRotation(!0),this._getRotationPoint(!0)),new e.Rect((f.x-this._xSpring.current.value)/E,(f.y-this._ySpring.current.value)/E,f.width/E,f.height/E,f.degrees)},viewportToImageZoom:function(f){var E=this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x;return E*f},imageToViewportZoom:function(f){var E=this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x;return f/E},setPosition:function(f,E){var A=this._xSpring.target.value===f.x&&this._ySpring.target.value===f.y;if(E){if(A&&this._xSpring.current.value===f.x&&this._ySpring.current.value===f.y)return;this._xSpring.resetTo(f.x),this._ySpring.resetTo(f.y),this._needsDraw=!0}else{if(A)return;this._xSpring.springTo(f.x),this._ySpring.springTo(f.y),this._needsDraw=!0}A||this._raiseBoundsChange()},setWidth:function(f,E){this._setScale(f,E)},setHeight:function(f,E){this._setScale(f/this.normHeight,E)},setCroppingPolygons:function(f){var E=function(C){return C instanceof e.Point||typeof C.x=="number"&&typeof C.y=="number"},A=function(C){return C.map(function(O){try{if(E(O))return{x:O.x,y:O.y};throw new Error}catch{throw new Error("A Provided cropping polygon point is not supported")}})};try{if(!e.isArray(f))throw new Error("Provided cropping polygon is not an array");this._croppingPolygons=f.map(function(C){return A(C)})}catch(C){e.console.error("[TiledImage.setCroppingPolygons] Cropping polygon format not supported"),e.console.error(C),this._croppingPolygons=null}},resetCroppingPolygons:function(){this._croppingPolygons=null},fitBounds:function(f,E,A){E=E||e.Placement.CENTER;var C=e.Placement.properties[E],O=this.contentAspectX,D=0,I=0,B=1,Z=1;if(this._clip&&(O=this._clip.getAspectRatio(),B=this._clip.width/this.source.dimensions.x,Z=this._clip.height/this.source.dimensions.y,f.getAspectRatio()>O?(D=this._clip.x/this._clip.height*f.height,I=this._clip.y/this._clip.height*f.height):(D=this._clip.x/this._clip.width*f.width,I=this._clip.y/this._clip.width*f.width)),f.getAspectRatio()>O){var Y=f.height/Z,V=0;C.isHorizontallyCentered?V=(f.width-f.height*O)/2:C.isRight&&(V=f.width-f.height*O),this.setPosition(new e.Point(f.x-D+V,f.y-I),A),this.setHeight(Y,A)}else{var K=f.width/B,Q=0;C.isVerticallyCentered?Q=(f.height-f.width/O)/2:C.isBottom&&(Q=f.height-f.width/O),this.setPosition(new e.Point(f.x-D,f.y-I+Q),A),this.setWidth(K,A)}},getClip:function(){return this._clip?this._clip.clone():null},setClip:function(f){e.console.assert(!f||f instanceof e.Rect,"[TiledImage.setClip] newClip must be an OpenSeadragon.Rect or null"),f instanceof e.Rect?this._clip=f.clone():this._clip=null,this._needsDraw=!0,this.raiseEvent("clip-change")},getFlip:function(){return!!this.flipped},setFlip:function(f){this.flipped=!!f,this._needsDraw=!0,this._raiseBoundsChange()},getOpacity:function(){return this.opacity},setOpacity:function(f){f!==this.opacity&&(this.opacity=f,this._needsDraw=!0,this.raiseEvent("opacity-change",{opacity:this.opacity}))},getPreload:function(){return this._preload},setPreload:function(f){this._preload=!!f,this._needsDraw=!0},getRotation:function(f){return f?this._degreesSpring.current.value:this._degreesSpring.target.value},setRotation:function(f,E){this._degreesSpring.target.value===f&&this._degreesSpring.isAtTargetValue()||(E?this._degreesSpring.resetTo(f):this._degreesSpring.springTo(f),this._needsDraw=!0,this._raiseBoundsChange())},_getRotationPoint:function(f){return this.getBoundsNoRotate(f).getCenter()},getCompositeOperation:function(){return this.compositeOperation},setCompositeOperation:function(f){f!==this.compositeOperation&&(this.compositeOperation=f,this._needsDraw=!0,this.raiseEvent("composite-operation-change",{compositeOperation:this.compositeOperation}))},_setScale:function(f,E){var A=this._scaleSpring.target.value===f;if(E){if(A&&this._scaleSpring.current.value===f)return;this._scaleSpring.resetTo(f),this._updateForScale(),this._needsDraw=!0}else{if(A)return;this._scaleSpring.springTo(f),this._updateForScale(),this._needsDraw=!0}A||this._raiseBoundsChange()},_updateForScale:function(){this._worldWidthTarget=this._scaleSpring.target.value,this._worldHeightTarget=this.normHeight*this._scaleSpring.target.value,this._worldWidthCurrent=this._scaleSpring.current.value,this._worldHeightCurrent=this.normHeight*this._scaleSpring.current.value},_raiseBoundsChange:function(){this.raiseEvent("bounds-change")},_isBottomItem:function(){return this.viewer.world.getItemAt(0)===this},_getLevelsInterval:function(){var f=Math.max(this.source.minLevel,Math.floor(Math.log(this.minZoomImageRatio)/Math.log(2))),E=this.viewport.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(0),!0).x*this._scaleSpring.current.value,A=Math.min(Math.abs(this.source.maxLevel),Math.abs(Math.floor(Math.log(E/this.minPixelRatio)/Math.log(2))));return A=Math.max(A,this.source.minLevel||0),f=Math.min(f,A),{lowestLevel:f,highestLevel:A}},_updateViewport:function(){for(this._needsDraw=!1,this._tilesLoading=0,this.loadingCoverage={};this.lastDrawn.length>0;){var f=this.lastDrawn.pop();f.beingDrawn=!1}var E=this.viewport,A=this._viewportToTiledImageRectangle(E.getBoundsWithMargins(!0));if(!this.wrapHorizontal&&!this.wrapVertical){var C=this._viewportToTiledImageRectangle(this.getClippedBounds(!0));if(A=A.intersection(C),A===null)return}for(var O=this._getLevelsInterval(),D=O.lowestLevel,I=O.highestLevel,B=null,Z=!1,Y=e.now(),V=I;V>=D;V--){var K=!1,Q=E.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(V),!0).x*this._scaleSpring.current.value;if(V===D||!Z&&Q>=this.minPixelRatio)K=!0,Z=!0;else if(!Z)continue;var le=E.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(V),!1).x*this._scaleSpring.current.value,re=E.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(Math.max(this.source.getClosestLevel(),0)),!1).x*this._scaleSpring.current.value,se=this.immediateRender?1:re,de=Math.min(1,(Q-.5)/.5),pe=se/Math.abs(se-le);if(B=n(this,Z,K,V,de,pe,A,Y,B),h(this.coverage,V))break}b(this,this.lastDrawn),B&&!B.context2D?(s(this,B,Y),this._needsDraw=!0,this._setFullyLoaded(!1)):this._setFullyLoaded(this._tilesLoading===0)},_getCornerTiles:function(f,E,A){var C,O;this.wrapHorizontal?(C=e.positiveModulo(E.x,1),O=e.positiveModulo(A.x,1)):(C=Math.max(0,E.x),O=Math.min(1,A.x));var D,I,B=1/this.source.aspectRatio;this.wrapVertical?(D=e.positiveModulo(E.y,B),I=e.positiveModulo(A.y,B)):(D=Math.max(0,E.y),I=Math.min(B,A.y));var Z=this.source.getTileAtPoint(f,new e.Point(C,D)),Y=this.source.getTileAtPoint(f,new e.Point(O,I)),V=this.source.getNumTiles(f);return this.wrapHorizontal&&(Z.x+=V.x*Math.floor(E.x),Y.x+=V.x*Math.floor(A.x)),this.wrapVertical&&(Z.y+=V.y*Math.floor(E.y/B),Y.y+=V.y*Math.floor(A.y/B)),{topLeft:Z,bottomRight:Y}}});function n(f,E,A,C,O,D,I,B,Z){var Y=I.getBoundingBox().getTopLeft(),V=I.getBoundingBox().getBottomRight();f.viewer&&f.viewer.raiseEvent("update-level",{tiledImage:f,havedrawn:E,level:C,opacity:O,visibility:D,drawArea:I,topleft:Y,bottomright:V,currenttime:B,best:Z}),y(f.coverage,C),y(f.loadingCoverage,C);var K=f._getCornerTiles(C,Y,V),Q=K.topLeft,le=K.bottomRight,re=f.source.getNumTiles(C),se=f.viewport.pixelFromPoint(f.viewport.getCenter());f.getFlip()&&(le.x+=1,f.wrapHorizontal||(le.x=Math.min(le.x,re.x-1)));for(var de=Q.x;de<=le.x;de++)for(var pe=Q.y;pe<=le.y;pe++){var G;if(f.getFlip()){var Me=(re.x+de%re.x)%re.x;G=de+re.x-Me-Me-1}else G=de;I.intersection(f.getTileBounds(C,G,pe))!==null&&(Z=r(f,A,E,G,pe,C,O,D,se,re,B,Z))}return Z}function r(f,E,A,C,O,D,I,B,Z,Y,V,K){var Q=o(C,O,D,f,f.source,f.tilesMatrix,V,Y,f._worldWidthCurrent,f._worldHeightCurrent),le=A;f.viewer&&f.viewer.raiseEvent("update-tile",{tiledImage:f,tile:Q}),g(f.coverage,D,C,O,!1);var re=Q.loaded||Q.loading||d(f.loadingCoverage,D,C,O);if(g(f.loadingCoverage,D,C,O,re),!Q.exists||(E&&!le&&(d(f.coverage,D,C,O)?g(f.coverage,D,C,O,!0):le=!0),!le))return K;if(u(Q,f.source.tileOverlap,f.viewport,Z,B,f),!Q.loaded)if(Q.context2D)l(f,Q);else{var se=f._tileCache.getImageRecord(Q.cacheKey);if(se){var de=se.getImage();l(f,Q,de)}}if(Q.loaded){var pe=c(f,Q,C,O,D,I,V);pe&&(f._needsDraw=!0)}else Q.loading?f._tilesLoading++:re||(K=x(K,Q));return K}function o(f,E,A,C,O,D,I,B,Z,Y){var V,K,Q,le,re,se,de,pe,G;return D[A]||(D[A]={}),D[A][f]||(D[A][f]={}),(!D[A][f][E]||!D[A][f][E].flipped!=!C.flipped)&&(V=(B.x+f%B.x)%B.x,K=(B.y+E%B.y)%B.y,Q=C.getTileBounds(A,f,E),le=O.getTileBounds(A,V,K,!0),re=O.tileExists(A,V,K),se=O.getTileUrl(A,V,K),C.loadTilesWithAjax?(de=O.getTileAjaxHeaders(A,V,K),e.isPlainObject(C.ajaxHeaders)&&(de=e.extend({},C.ajaxHeaders,de))):de=null,pe=O.getContext2D?O.getContext2D(A,V,K):void 0,G=new e.Tile(A,f,E,Q,re,se,pe,C.loadTilesWithAjax,de,le),C.getFlip()?V===0&&(G.isRightMost=!0):V===B.x-1&&(G.isRightMost=!0),K===B.y-1&&(G.isBottomMost=!0),G.flipped=C.flipped,D[A][f][E]=G),G=D[A][f][E],G.lastTouchTime=I,G}function s(f,E,A){E.loading=!0,f._imageLoader.addJob({src:E.url,loadWithAjax:E.loadWithAjax,ajaxHeaders:E.ajaxHeaders,crossOriginPolicy:f.crossOriginPolicy,ajaxWithCredentials:f.ajaxWithCredentials,callback:function(C,O,D){a(f,E,A,C,O,D)},abort:function(){E.loading=!1}})}function a(f,E,A,C,O,D){if(!C){e.console.log("Tile %s failed to load: %s - error: %s",E,E.url,O),f.viewer.raiseEvent("tile-load-failed",{tile:E,tiledImage:f,time:A,message:O,tileRequest:D}),E.loading=!1,E.exists=!1;return}if(Af.visibility||E.visibility===f.visibility&&E.squaredDistance1&&B>f.smoothTileEdgesMinZoom&&!f.iOSDevice&&f.getRotation(!0)%360===0&&e.supportsCanvas&&(C=!0,O=A.getScaleForEdgeSmoothing(),D=A.getTranslationForEdgeSmoothing(O,f._drawer.getCanvasSize(!1),f._drawer.getCanvasSize(!0)));var Z;C&&(O||(Z=f.viewport.viewportToViewerElementRectangle(f.getClippedBounds(!0)).getIntegerBoundingBox(),f._drawer.viewer.viewport.getFlip()&&(f.viewport.degrees!==0||f.getRotation(!0)%360!==0)&&(Z.x=f._drawer.viewer.container.clientWidth-(Z.x+Z.width)),Z=Z.times(e.pixelDensityRatio)),f._drawer._clear(!0,Z)),O||(f.viewport.degrees!==0&&f._drawer._offsetForRotation({degrees:f.viewport.degrees,useSketch:C}),f.getRotation(!0)%360!==0&&f._drawer._offsetForRotation({degrees:f.getRotation(!0),point:f.viewport.pixelFromPointNoRotate(f._getRotationPoint(!0),!0),useSketch:C}),f.viewport.degrees===0&&f.getRotation(!0)%360===0&&f._drawer.viewer.viewport.getFlip()&&f._drawer._flip());var Y=!1;if(f._clip){f._drawer.saveContext(C);var V=f.imageToViewportRectangle(f._clip,!0);V=V.rotate(-f.getRotation(!0),f._getRotationPoint(!0));var K=f._drawer.viewportToDrawerRectangle(V);O&&(K=K.times(O)),D&&(K=K.translate(D)),f._drawer.setClip(K,C),Y=!0}if(f._croppingPolygons){f._drawer.saveContext(C);try{var Q=f._croppingPolygons.map(function(de){return de.map(function(pe){var G=f.imageToViewportCoordinates(pe.x,pe.y,!0).rotate(-f.getRotation(!0),f._getRotationPoint(!0)),Me=f._drawer.viewportCoordToDrawerCoord(G);return O&&(Me=Me.times(O)),Me})});f._drawer.clipWithPolygons(Q,C)}catch(de){e.console.error(de)}Y=!0}if(f.placeholderFillStyle&&f._hasOpaqueTile===!1){var le=f._drawer.viewportToDrawerRectangle(f.getBounds(!0));O&&(le=le.times(O)),D&&(le=le.translate(D));var re=null;typeof f.placeholderFillStyle=="function"?re=f.placeholderFillStyle(f,f._drawer.context):re=f.placeholderFillStyle,f._drawer.drawRectangle(le,re,C)}for(var se=E.length-1;se>=0;se--)A=E[se],f._drawer.drawTile(A,f._drawingHandler,C,O,D),A.beingDrawn=!0,f.viewer&&f.viewer.raiseEvent("tile-drawn",{tiledImage:f,tile:A});Y&&f._drawer.restoreContext(C),O||(f.getRotation(!0)%360!==0&&f._drawer._restoreRotationChanges(C),f.viewport.degrees!==0&&f._drawer._restoreRotationChanges(C)),C&&(O&&(f.viewport.degrees!==0&&f._drawer._offsetForRotation({degrees:f.viewport.degrees,useSketch:!1}),f.getRotation(!0)%360!==0&&f._drawer._offsetForRotation({degrees:f.getRotation(!0),point:f.viewport.pixelFromPointNoRotate(f._getRotationPoint(!0),!0),useSketch:!1})),f._drawer.blendSketch({opacity:f.opacity,scale:O,translate:D,compositeOperation:f.compositeOperation,bounds:Z}),O&&(f.getRotation(!0)%360!==0&&f._drawer._restoreRotationChanges(!1),f.viewport.degrees!==0&&f._drawer._restoreRotationChanges(!1))),O||f.viewport.degrees===0&&f.getRotation(!0)%360===0&&f._drawer.viewer.viewport.getFlip()&&f._drawer._flip(),T(f,E)}}function T(f,E){if(f.debugMode)for(var A=E.length-1;A>=0;A--){var C=E[A];try{f._drawer.drawDebugInfo(C,E.length,A,f)}catch(O){e.console.error(O)}}}}(t),function(e){var n=function(o){e.console.assert(o,"[TileCache.cacheTile] options is required"),e.console.assert(o.tile,"[TileCache.cacheTile] options.tile is required"),e.console.assert(o.tiledImage,"[TileCache.cacheTile] options.tiledImage is required"),this.tile=o.tile,this.tiledImage=o.tiledImage},r=function(o){e.console.assert(o,"[ImageRecord] options is required"),e.console.assert(o.image,"[ImageRecord] options.image is required"),this._image=o.image,this._tiles=[]};r.prototype={destroy:function(){this._image=null,this._renderedContext=null,this._tiles=null},getImage:function(){return this._image},getRenderedContext:function(){if(!this._renderedContext){var o=document.createElement("canvas");o.width=this._image.width,o.height=this._image.height,this._renderedContext=o.getContext("2d"),this._renderedContext.drawImage(this._image,0,0),this._image=null}return this._renderedContext},setRenderedContext:function(o){e.console.error("ImageRecord.setRenderedContext is deprecated. The rendered context should be created by the ImageRecord itself when calling ImageRecord.getRenderedContext."),this._renderedContext=o},addTile:function(o){e.console.assert(o,"[ImageRecord.addTile] tile is required"),this._tiles.push(o)},removeTile:function(o){for(var s=0;sthis._maxImageCacheCount){for(var u=null,c=-1,h=null,d,g,y,x,b,T,f=this._tilesLoaded.length-1;f>=0;f--)if(T=this._tilesLoaded[f],d=T.tile,!(d.level<=s||d.beingDrawn)){if(!u){u=d,c=f,h=T;continue}x=d.lastTouchTime,g=u.lastTouchTime,b=d.level,y=u.level,(xy)&&(u=d,c=f,h=T)}u&&c>=0&&(this._unloadTile(h),a=c)}this._tilesLoaded[a]=new n({tile:o.tile,tiledImage:o.tiledImage})},clearTilesFor:function(o){e.console.assert(o,"[TileCache.clearTilesFor] tiledImage is required");for(var s,a=0;a=this._items.length)throw new Error("Index bigger than number of layers.");r===o||o===-1||(this._items.splice(o,1),this._items.splice(r,0,n),this._needsDraw=!0,this.raiseEvent("item-index-change",{item:n,previousIndex:o,newIndex:r}))},removeItem:function(n){e.console.assert(n,"[World.removeItem] item is required");var r=e.indexOf(this._items,n);r!==-1&&(n.removeHandler("bounds-change",this._delegatedFigureSizes),n.removeHandler("clip-change",this._delegatedFigureSizes),n.destroy(),this._items.splice(r,1),this._figureSizes(),this._needsDraw=!0,this._raiseRemoveItem(n))},removeAll:function(){this.viewer._cancelPendingImages();var n,r;for(r=0;rx.height?b=l:b=l*(x.width/x.height),T=b*(x.height/x.width),f=new e.Point(d+(l-b)/2,g+(l-T)/2),y.setPosition(f,r),y.setWidth(b,r),o==="horizontal"?d+=c:g+=c;this.setAutoRefigureSizes(!0)},_figureSizes:function(){var n=this._homeBounds?this._homeBounds.clone():null,r=this._contentSize?this._contentSize.clone():null,o=this._contentFactor||0;if(!this._items.length)this._homeBounds=new e.Rect(0,0,1,1),this._contentSize=new e.Point(1,1),this._contentFactor=1;else{var s=this._items[0],a=s.getBounds();this._contentFactor=s.getContentSize().x/a.width;for(var l=s.getClippedBounds().getBoundingBox(),u=l.x,c=l.y,h=l.x+l.width,d=l.y+l.height,g=1;g{const t=i.getAttribute("class");return t?new Set(t.split(" ")):new Set},Et=(i,t)=>{const e=ns(i);e.add(t),i.setAttribute("class",Array.from(e).join(" "))},Qi=(i,t)=>{const e=ns(i);e.delete(t),e.size===0?i.removeAttribute("class"):i.setAttribute("class",Array.from(e).join(" "))},is=(i,t)=>ns(i).has(t),Rt=(i,t)=>{const e=i.selector("FragmentSelector");if(e!=null&&e.conformsTo.startsWith("http://www.w3.org/TR/media-frags")){const{value:n}=e,r=n.includes(":")?n.substring(n.indexOf("=")+1,n.indexOf(":")):"pixel",o=n.includes(":")?n.substring(n.indexOf(":")+1):n.substring(n.indexOf("=")+1);let[s,a,l,u]=o.split(",").map(parseFloat);return r.toLowerCase()==="percent"&&(s=s*t.naturalWidth/100,a=a*t.naturalHeight/100,l=l*t.naturalWidth/100,u=u*t.naturalHeight/100),{x:s,y:a,w:l,h:u}}},_E=(i,t,e,n,r)=>({source:r==null?void 0:r.src,selector:{type:"FragmentSelector",conformsTo:"http://www.w3.org/TR/media-frags/",value:`xywh=pixel:${i},${t},${e},${n}`}}),TE=(i,t,e,n,r)=>{const o=i/r.naturalWidth*100,s=t/r.naturalHeight*100,a=e/r.naturalWidth*100,l=n/r.naturalHeight*100;return{source:r.src,selector:{type:"FragmentSelector",conformsTo:"http://www.w3.org/TR/media-frags/",value:`xywh=percent:${o},${s},${a},${l}`}}},pn=(i,t,e,n,r,o)=>(o==null?void 0:o.toLowerCase())==="percent"?TE(i,t,e,n,r):_E(i,t,e,n,r),$i=(i,t,e,n,r)=>{i.setAttribute("x",t),i.setAttribute("y",e),i.setAttribute("width",n),i.setAttribute("height",r)},er=(i,t,e)=>{i.setAttribute("cx",t),i.setAttribute("cy",e),i.setAttribute("r",7)},kh=(i,t,e,n,r)=>{const o=document.createElementNS(ce,"path");o.setAttribute("fill-rule","evenodd");const{naturalWidth:s,naturalHeight:a}=i;return o.setAttribute("d",`M0 0 h${s} v${a} h-${s} z M${t} ${e} h${n} v${r} h-${n} z`),o},Lh=(i,t,e,n,r,o)=>{const{naturalWidth:s,naturalHeight:a}=t;i.setAttribute("d",`M0 0 h${s} v${a} h-${s} z M${e} ${n} h${r} v${o} h-${r} z`)},rs=(i,t,e,n)=>{const{x:r,y:o,w:s,h:a}=i.type==="Annotation"||i.type==="Selection"?Rt(i,t):{x:i,y:t,w:e,h:n},l=document.createElementNS(ce,"g");if(s===0&&a===0){Et(l,"a9s-point"),Et(l,"a9s-non-scaling"),l.setAttribute("transform-origin",`${r} ${o}`);const u=document.createElementNS(ce,"circle"),c=document.createElementNS(ce,"circle");c.setAttribute("class","a9s-inner"),er(c,r,o),u.setAttribute("class","a9s-outer"),er(u,r,o),l.appendChild(u),l.appendChild(c)}else{const u=document.createElementNS(ce,"rect"),c=document.createElementNS(ce,"rect");c.setAttribute("class","a9s-inner"),$i(c,r,o,s,a),u.setAttribute("class","a9s-outer"),$i(u,r,o,s,a),l.appendChild(u),l.appendChild(c)}return l},os=i=>{const t=i.querySelector(".a9s-outer");if(t.nodeName==="rect"){const e=parseFloat(t.getAttribute("x")),n=parseFloat(t.getAttribute("y")),r=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height"));return{x:e,y:n,w:r,h:o}}else{const e=parseFloat(t.getAttribute("cx")),n=parseFloat(t.getAttribute("cy"));return{x:e,y:n,w:0,h:0}}},Bh=(i,t,e,n,r)=>{const o=i.querySelector(".a9s-inner"),s=i.querySelector(".a9s-outer");s.nodeName==="rect"?($i(o,t,e,n,r),$i(s,t,e,n,r)):(er(o,t,e),er(s,t,e))},CE=(i,t)=>{const{w:e,h:n}=Rt(i,t);return e*n};class PE{constructor(t,e,n,r,o){P(this,"dragTo",(t,e)=>{this.group.style.display=null,this.opposite=[t,e];const{x:n,y:r,w:o,h:s}=this.bbox;Lh(this.mask,this.env.image,n,r,o,s),Bh(this.rect,n,r,o,s)});P(this,"getBoundingClientRect",()=>this.rect.getBoundingClientRect());P(this,"toSelection",()=>{const{x:t,y:e,w:n,h:r}=this.bbox;return new Wn(pn(t,e,n,r,this.env.image,this.config.fragmentUnit))});P(this,"destroy",()=>{this.group.parentNode.removeChild(this.group),this.mask=null,this.rect=null,this.group=null});this.anchor=[t,e],this.opposite=[t,e],this.config=r,this.env=o,this.group=document.createElementNS(ce,"g"),this.mask=kh(o.image,t,e,2,2),this.mask.setAttribute("class","a9s-selection-mask"),this.rect=rs(t,e,2,2),this.rect.setAttribute("class","a9s-selection"),this.group.style.pointerEvents="none",this.group.style.display="none",this.group.appendChild(this.mask),this.group.appendChild(this.rect),n.appendChild(this.group)}get bbox(){const t=this.opposite[0]-this.anchor[0],e=this.opposite[1]-this.anchor[1];return{x:t>0?this.anchor[0]:this.opposite[0],y:e>0?this.anchor[1]:this.opposite[1],w:Math.max(1,Math.abs(t)),h:Math.max(1,Math.abs(e))}}get element(){return this.rect}}const AE={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup"},ss=()=>"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,OE=i=>{let t=null;const e=(r,o)=>new MouseEvent(r,{screenX:o.screenX,screenY:o.screenY,clientX:o.clientX,clientY:o.clientY,pageX:o.pageX,pageY:o.pageY,bubbles:!0}),n=r=>{const o=r.changedTouches[0],s=e(AE[r.type],o);o.target.dispatchEvent(s),r.preventDefault(),(r.type==="touchstart"||r.type==="touchmove")&&(t&&clearTimeout(t),t=setTimeout(()=>{const a=e("dblclick",o);o.target.dispatchEvent(a)},800)),r.type==="touchend"&&t&&clearTimeout(t)};i.addEventListener("touchstart",n,!0),i.addEventListener("touchmove",n,!0),i.addEventListener("touchend",n,!0),i.addEventListener("touchcancel",n,!0)},tr="An implementation is missing",DE=ss();class Ih extends Qn{constructor(e,n,r){super();P(this,"enableResponsive",()=>{window.ResizeObserver&&(this.resizeObserver=new ResizeObserver(()=>{const e=this.svg.getBoundingClientRect(),{width:n,height:r}=this.svg.viewBox.baseVal;this.scale=Math.max(n/e.width,r/e.height),this.onScaleChanged&&this.onScaleChanged(this.scale)}),this.resizeObserver.observe(this.svg.parentNode))});P(this,"getSVGPoint",e=>{const n=this.svg.createSVGPoint();if(DE){const r=this.svg.getBoundingClientRect(),o=e.clientX-r.x,s=e.clientY-r.y,{left:a,top:l}=this.svg.getBoundingClientRect();return n.x=o+a,n.y=s+l,n.matrixTransform(this.g.getScreenCTM().inverse())}else return n.x=e.offsetX,n.y=e.offsetY,n.matrixTransform(this.g.getCTM().inverse())});P(this,"drawHandle",(e,n)=>{const r=document.createElementNS(ce,"g");r.setAttribute("class","a9s-handle");const o=document.createElementNS(ce,"g"),s=c=>{const h=document.createElementNS(ce,"circle");return h.setAttribute("cx",e),h.setAttribute("cy",n),h.setAttribute("r",c),h.setAttribute("transform-origin",`${e} ${n}`),h},a=this.config.handleRadius||6,l=s(a);l.setAttribute("class","a9s-handle-inner");const u=s(a+1);return u.setAttribute("class","a9s-handle-outer"),o.appendChild(u),o.appendChild(l),r.appendChild(o),r});P(this,"setHandleXY",(e,n,r)=>{const o=e.querySelector(".a9s-handle-inner");o.setAttribute("cx",n),o.setAttribute("cy",r),o.setAttribute("transform-origin",`${n} ${r}`);const s=e.querySelector(".a9s-handle-outer");s.setAttribute("cx",n),s.setAttribute("cy",r),s.setAttribute("transform-origin",`${n} ${r}`)});P(this,"getHandleXY",e=>{const n=e.querySelector(".a9s-handle-outer");return{x:parseFloat(n.getAttribute("cx")),y:parseFloat(n.getAttribute("cy"))}});P(this,"scaleHandle",e=>{const n=e.querySelector(".a9s-handle-inner"),r=e.querySelector(".a9s-handle-outer"),o=this.scale*(this.config.handleRadius||6);n.setAttribute("r",o),r.setAttribute("r",o)});this.svg=e.closest("svg"),this.g=e,this.config=n,this.env=r,this.scale=1;const{image:o}=r;(o instanceof Element||o instanceof HTMLDocument)&&this.enableResponsive()}destroy(){this.resizeObserver&&this.resizeObserver.disconnect(),this.resizeObserver=null}}class as extends Ih{constructor(e,n,r){super(e,n,r);P(this,"attachListeners",({mouseMove:e,mouseUp:n,dblClick:r})=>{e&&(this.mouseMove=o=>{const{x:s,y:a}=this.getSVGPoint(o);this.started||(this.emit("startSelection",{x:s,y:a}),this.started=!0),e(s,a,o)},this.svg.addEventListener("mousemove",this.mouseMove)),n&&(this.mouseUp=o=>{if(o.button!==0)return;const{x:s,y:a}=this.getSVGPoint(o);n(s,a,o)},document.addEventListener("mouseup",this.mouseUp)),r&&(this.dblClick=o=>{const{x:s,y:a}=this.getSVGPoint(o);r(s,a,o)},document.addEventListener("dblclick",this.dblClick))});P(this,"detachListeners",()=>{this.mouseMove&&this.svg.removeEventListener("mousemove",this.mouseMove),this.mouseUp&&document.removeEventListener("mouseup",this.mouseUp),this.dblClick&&document.removeEventListener("dblclick",this.dblClick)});P(this,"start",(e,n)=>{const{x:r,y:o}=this.getSVGPoint(e),{naturalWidth:s,naturalHeight:a}=this.env.image,l=r<0?0:r>s?s:r,u=o<0?0:o>a?a:o;this.startDrawing(l,u,n,e)});P(this,"startDrawing",e=>{throw new Error(tr)});P(this,"createEditableShape",(e,n)=>{throw new Error(tr)});this.started=!1}get isDrawing(){throw new Error(tr)}}as.supports=i=>{throw new Error(tr)};const Nh="An implementation is missing";class Hh extends Ih{constructor(e,n,r,o){super(n,r,o);P(this,"updateState",e=>{throw new Error(Nh)});this.annotation=e}get element(){throw new Error(Nh)}}const RE=/firefox/i.test(navigator.userAgent),zh=(i,t,e,n,r)=>{i.setAttribute("width",n),i.setAttribute("height",r),RE?(i.setAttribute("x",0),i.setAttribute("y",0),i.setAttribute("transform",`translate(${t}, ${e})`)):(i.setAttribute("x",t),i.setAttribute("y",e))},ME=(i,t)=>{const{x:e,y:n,width:r,height:o}=t.getBBox(),s=document.createElementNS(ce,"svg");s.setAttribute("class","a9s-formatter-el"),zh(s,e,n,r,o);const a=document.createElementNS(ce,"g");a.appendChild(i),s.appendChild(a),t.append(s)},nr=(i,t,e)=>{if(!e)return i;const n=e.reduce((a,l)=>{const u=l(t);if(!u)return a;if(typeof u=="string"||u instanceof String)a.className=a.className?`${a.className} ${u}`:u;else if(u.nodeType===Node.ELEMENT_NODE)a.elements=a.elements?[...a.elements,u]:[u];else{const{className:c,style:h,element:d}=u;c&&(a.className=a.className?`${a.className} ${c}`:c),h&&(a.style=a.style?`${a.style} ${h}`:h),d&&(a.elements=a.elements?[...a.elements,d]:[d])}for(const c in u)u.hasOwnProperty(c)&&c.startsWith("data-")&&(a[c]=u[c]);return a},{}),{className:r,style:o,elements:s}=n;if(r&&Et(i,r),o){const a=i.querySelector(".a9s-outer"),l=i.querySelector(".a9s-inner");a&&l?(a.setAttribute("style","display:none"),l.setAttribute("style",o)):i.setAttribute("style",o)}s&&s.forEach(a=>ME(a,i));for(const a in n)n.hasOwnProperty(a)&&a.startsWith("data-")&&i.setAttribute(a,n[a])},Vh=(i,t,e,n,r)=>{const o=i.querySelector(".a9s-formatter-el");o&&zh(o,t,e,n,r)},jn="corner",ir="edge";class FE extends Hh{constructor(e,n,r,o){super(e,n,r,o);P(this,"onScaleChanged",()=>this.handles.map(this.scaleHandle));P(this,"setSize",(e,n,r,o)=>{Bh(this.rectangle,e,n,r,o),Lh(this.mask,this.env.image,e,n,r,o),Vh(this.elementGroup,e,n,r,o);const[s,a,l,u,c,h,d,g]=this.handles;this.setHandleXY(s,e,n),this.setHandleXY(a,e+r,n),this.setHandleXY(l,e+r,n+o),this.setHandleXY(u,e,n+o),this.enableEdgeControls&&(this.setHandleXY(c,e+r/2,n),this.setHandleXY(h,e+r,n+o/2),this.setHandleXY(d,e+r/2,n+o),this.setHandleXY(g,e,n+o/2))});P(this,"stretchCorners",(e,n,r)=>{const o=this.getHandleXY(n),s=r.x-o.x,a=r.y-o.y,l=s>0?o.x:r.x,u=a>0?o.y:r.y,c=Math.abs(s),h=Math.abs(a);return this.setSize(l,u,c,h),{x:l,y:u,w:c,h}});P(this,"stretchEdge",(e,n,r)=>{const o=this.getHandleXY(n),s=os(this.rectangle),a=e%2===0,l=a?s.w:r.x-o.x,u=a?r.y-o.y:s.h,c=a?s.x:l>0?o.x:r.x,h=a?u>0?o.y:r.y:s.y,d=Math.abs(l),g=Math.abs(u);return this.setSize(c,h,d,g),{x:c,y:h,w:d,h:g}});P(this,"onGrab",(e,n)=>r=>{if(r.button!==0)return;this.grabbedElem=e,this.grabbedType=n;const o=this.getSVGPoint(r),{x:s,y:a}=os(this.rectangle);this.mouseOffset={x:o.x-s,y:o.y-a}});P(this,"onMouseMove",e=>{if(e.button!==0)return;const n=(r,o)=>r<0?0:r>o?o:r;if(this.grabbedElem){const r=this.getSVGPoint(e);if(this.grabbedElem===this.rectangle){const{w:o,h:s}=os(this.rectangle),{naturalWidth:a,naturalHeight:l}=this.env.image,u=n(r.x-this.mouseOffset.x,a-o),c=n(r.y-this.mouseOffset.y,l-s);this.setSize(u,c,o,s),this.emit("update",pn(u,c,o,s,this.env.image,this.config.fragmentUnit))}else{const o=this.handles.indexOf(this.grabbedElem),s=this.handles[o^2],{x:a,y:l,w:u,h:c}=this.grabbedType===jn?this.stretchCorners(o,s,r):this.stretchEdge(o,s,r);this.emit("update",pn(a,l,u,c,this.env.image,this.config.fragmentUnit))}}});P(this,"onMouseUp",e=>{this.grabbedElem=null,this.grabbedType=null,this.mouseOffset=null});P(this,"updateState",e=>{const{x:n,y:r,w:o,h:s}=Rt(e,this.env.image);this.setSize(n,r,o,s)});this.svg.addEventListener("mousemove",this.onMouseMove),this.svg.addEventListener("mouseup",this.onMouseUp);const{x:s,y:a,w:l,h:u}=Rt(e,o.image);this.containerGroup=document.createElementNS(ce,"g"),this.mask=kh(o.image,s,a,l,u),this.mask.setAttribute("class","a9s-selection-mask"),this.containerGroup.appendChild(this.mask),this.elementGroup=document.createElementNS(ce,"g"),this.elementGroup.setAttribute("class","a9s-annotation editable selected"),this.elementGroup.setAttribute("data-id",e.id),this.rectangle=rs(s,a,l,u),this.rectangle.querySelector(".a9s-inner").addEventListener("mousedown",this.onGrab(this.rectangle)),this.elementGroup.appendChild(this.rectangle),this.enableEdgeControls=r.enableEdgeControls;const c=this.enableEdgeControls?[[s+l/2,a,ir],[s+l,a+u/2,ir],[s+l/2,a+u,ir],[s,a+u/2,ir]]:[];this.handles=[[s,a,jn],[s+l,a,jn],[s+l,a+u,jn],[s,a+u,jn],...c].map(h=>{const[d,g,y]=h,x=this.drawHandle(d,g);return x.addEventListener("mousedown",this.onGrab(x,y)),this.elementGroup.appendChild(x),x}),this.containerGroup.appendChild(this.elementGroup),n.appendChild(this.containerGroup),nr(this.rectangle,e,r.formatters),this.grabbedElem=null,this.grabbedType=null,this.mouseOffset=null}get element(){return this.elementGroup}destroy(){this.containerGroup.parentNode.removeChild(this.containerGroup),super.destroy()}}class rr extends as{constructor(e,n,r){super(e,n,r);P(this,"startDrawing",(e,n)=>{this.attachListeners({mouseMove:this.onMouseMove,mouseUp:this.onMouseUp}),this.rubberband=new PE(e,n,this.g,this.config,this.env)});P(this,"stop",()=>{this.rubberband&&(this.rubberband.destroy(),this.rubberband=null)});P(this,"onMouseMove",(e,n)=>{const{naturalWidth:r,naturalHeight:o}=this.env.image,s=Math.min(Math.max(e,0),r),a=Math.min(Math.max(n,0),o);this.rubberband.dragTo(s,a)});P(this,"onMouseUp",()=>{this.detachListeners(),this.started=!1;const{width:e,height:n}=this.rubberband.getBoundingClientRect(),r=this.config.minSelectionWidth||4,o=this.config.minSelectionHeight||4;if(e>=r&&n>=o){const{element:s}=this.rubberband;s.annotation=this.rubberband.toSelection(),this.emit("complete",s)}else this.emit("cancel");this.stop()});P(this,"createEditableShape",(e,n)=>new FE(e,this.g,{...this.config,formatters:n},this.env));this.rubberband=null}get isDrawing(){return this.rubberband!=null}}rr.identifier="rect",rr.supports=i=>{const t=i.selector("FragmentSelector");return t==null?void 0:t.conformsTo.startsWith("http://www.w3.org/TR/media-frags")};const or=i=>{let t=0,e=i.length-1;for(let n=0;n{const r=i[0]-t,o=i[1]-e;return Math.sqrt(r*r+o*o)<=n},LE=(i,t,e,n,r,o)=>{const s=o||0,a=Math.cos(s),l=Math.sin(s),u=i[0]-t,c=i[1]-e,h=a*u+l*c,d=l*u-a*c;return h*h/(n*n)+d*d/(r*r)<=1},ls=(i,t)=>{const e=i[0],n=i[1];let r=!1;for(let o=0,s=t.length-1;on!=c>n&&e<(u-a)*(n-l)/(c-l)+a&&(r=!r)}return r},BE=(i,t)=>{for(let e of i)if(!ls(e,t))return!1;return!0},IE=(i,t,e,n,r,o)=>{const s=i[0],a=i[1],l=n-t,u=r-e,c=Math.sqrt(l*l+u*u);return Math.abs((s-t)*u-(a-e)*l)/c<=o},Uh=i=>{const t=i.getAttribute("d").split(/(?=M|m|L|l|H|h|V|v|Z|z)/g).map(r=>r.trim()),e=[];let n=[];for(let r of t){const o=r.substring(0,1);if(o.toLowerCase()==="z")e.push([...n]),n=[];else{const s=r.substring(1).split(" ").map(c=>parseFloat(c.trim())),a=o===o.toUpperCase(),l=a?s[0]:s[0]+n[n.length-1][0],u=a?s[1]:s[1]+n[n.length-1][1];n.push([l,u])}}return n.length>0&&e.push([...n]),e},NE=i=>{const n=new XMLSerializer().serializeToString(i.documentElement).replace("",``);return new DOMParser().parseFromString(n,"image/svg+xml").documentElement},Wh=i=>{const t=n=>{Array.from(n.attributes).forEach(r=>{r.name.startsWith("on")&&n.removeAttribute(r.name)})},e=i.getElementsByTagName("script");return Array.from(e).reverse().forEach(n=>n.parentNode.removeChild(n)),t(i),Array.from(i.querySelectorAll("*")).forEach(t),i},Wt=i=>{const t=i.selector("SvgSelector");if(t){const e=new DOMParser,{value:n}=t,r=e.parseFromString(n,"image/svg+xml"),o=r.lookupPrefix(ce),s=r.lookupNamespaceURI(null);return o||s?Wh(r).firstChild:Wh(NE(r)).firstChild}},jh=i=>{const t=Wt(i),e=document.createElementNS(ce,"g"),n=t.cloneNode(!0);n.setAttribute("class","a9s-inner");const r=t.cloneNode(!0);return r.setAttribute("class","a9s-outer"),e.appendChild(r),e.appendChild(n),e},us=(i,t)=>{const e=i.querySelector(".a9s-inner").cloneNode(!0);e.removeAttribute("class"),e.removeAttribute("xmlns");let n=e.outerHTML||new XMLSerializer().serializeToString(e);return n=n.replace(` xmlns="${ce}"`,""),{source:t==null?void 0:t.src,selector:{type:"SvgSelector",value:`${n}`}}},HE=i=>{const t=Wt(i),e=t.nodeName.toLowerCase();if(e==="polygon")return zE(t);if(e==="circle")return VE(t);if(e==="ellipse")return UE(t);if(e=="path")return WE(t);if(e=="line")return 0;throw`Unsupported SVG shape type: ${e}`},zE=i=>{const t=i.getAttribute("points").trim().split(" ").map(e=>e.split(",").map(n=>parseFloat(n.trim())));return or(t)},VE=i=>{const t=i.getAttribute("r");return t*t*Math.PI},UE=i=>{const t=i.getAttribute("rx"),e=i.getAttribute("ry");return t*e*Math.PI},WE=i=>{const t=Uh(i);if(t.length==1)return or(t[0]);{const e=r=>t.find(o=>{if(r!==o)return BE(r,o)});let n=0;for(let r of t)e(r)?n-=or(r):n+=or(r);return n}};class Gh{constructor(t,e){P(this,"redraw",()=>{this.mask.setAttribute("d",`M0 0 h${this.w} v${this.h} h-${this.w} z M${this.polygon.getAttribute("points")} z`)});P(this,"destroy",()=>this.mask.parentNode.removeChild(this.mask));this.w=t.naturalWidth,this.h=t.naturalHeight,this.polygon=e,this.mask=document.createElementNS(ce,"path"),this.mask.setAttribute("fill-rule","evenodd"),this.mask.setAttribute("class","a9s-selection-mask"),this.mask.setAttribute("d",`M0 0 h${this.w} v${this.h} h-${this.w} z M${this.polygon.getAttribute("points")} z`)}get element(){return this.mask}}class jE{constructor(t,e,n){P(this,"setPoints",t=>{const e=t.map(n=>`${n[0]},${n[1]}`).join(" ");this.outer.setAttribute("points",e),this.inner.setAttribute("points",e)});P(this,"getBoundingClientRect",()=>this.outer.getBoundingClientRect());P(this,"dragTo",t=>{this.group.style.display=null,this.mousepos=t;const e=[...this.points,t];this.setPoints(e),this.mask.redraw()});P(this,"addPoint",()=>{const[t,e]=this.mousepos,n=this.points[this.points.length-1];Math.pow(t-n[0],2)+Math.pow(e-n[1],2)>4&&(this.points=[...this.points,this.mousepos],this.setPoints(this.points),this.mask.redraw())});P(this,"destroy",()=>{this.group.parentNode.removeChild(this.group),this.polygon=null,this.group=null});P(this,"toSelection",()=>new Wn(us(this.group,this.env.image)));this.points=[t],this.env=n,this.mousepos=t,this.group=document.createElementNS(ce,"g"),this.polygon=document.createElementNS(ce,"g"),this.polygon.setAttribute("class","a9s-selection"),this.outer=document.createElementNS(ce,"polygon"),this.outer.setAttribute("class","a9s-outer"),this.inner=document.createElementNS(ce,"polygon"),this.inner.setAttribute("class","a9s-inner"),this.setPoints(this.points),this.mask=new Gh(n.image,this.inner),this.polygon.appendChild(this.outer),this.polygon.appendChild(this.inner),this.group.style.display="none",this.group.appendChild(this.mask.element),this.group.appendChild(this.polygon),e.appendChild(this.group)}get element(){return this.polygon}}const cs=i=>{const t=i.querySelector(".a9s-inner").points,e=[];for(let n=0;ni.querySelector(".a9s-inner").getBBox();class qE extends Hh{constructor(e,n,r,o){super(e,n,r,o);P(this,"onScaleChanged",()=>this.handles.map(this.scaleHandle));P(this,"setPoints",e=>{const n=h=>Math.round(10*h)/10,r=e.map(h=>`${n(h.x)},${n(h.y)}`).join(" ");this.shape.querySelector(".a9s-inner").setAttribute("points",r);const s=this.shape.querySelector(".a9s-outer");s.setAttribute("points",r),this.mask.redraw();const{x:a,y:l,width:u,height:c}=s.getBBox();Vh(this.elementGroup,a,l,u,c)});P(this,"onGrab",e=>n=>{n.button===0&&(this.grabbedElem=e,this.grabbedAt=this.getSVGPoint(n))});P(this,"onMouseMove",e=>{const n=(r,o,s)=>r+o<0?-r:r+o>s?s-r:o;if(this.grabbedElem){const r=this.getSVGPoint(e);if(this.grabbedElem===this.shape){const{x:o,y:s,width:a,height:l}=GE(this.shape),{naturalWidth:u,naturalHeight:c}=this.env.image,h=n(o,r.x-this.grabbedAt.x,u-a),d=n(s,r.y-this.grabbedAt.y,c-l),g=cs(this.shape).map(y=>({x:y.x+h,y:y.y+d}));this.grabbedAt=r,this.setPoints(g),g.forEach((y,x)=>this.setHandleXY(this.handles[x],y.x,y.y)),this.emit("update",us(this.shape,this.env.image))}else{const o=this.handles.indexOf(this.grabbedElem),s=cs(this.shape).map((a,l)=>l===o?r:a);this.setPoints(s),this.setHandleXY(this.handles[o],r.x,r.y),this.emit("update",us(this.shape,this.env.image))}}});P(this,"onMouseUp",e=>{this.grabbedElem=null,this.grabbedAt=null});P(this,"updateState",e=>{const n=Wt(e).getAttribute("points").split(" ").map(r=>{const[o,s]=r.split(",").map(a=>parseFloat(a.trim()));return{x:o,y:s}});this.setPoints(n),n.forEach((r,o)=>this.setHandleXY(this.handles[o],r.x,r.y))});P(this,"destroy",()=>{this.containerGroup.parentNode.removeChild(this.containerGroup),super.destroy()});this.svg.addEventListener("mousemove",this.onMouseMove),this.svg.addEventListener("mouseup",this.onMouseUp),this.containerGroup=document.createElementNS(ce,"g"),this.shape=jh(e),this.shape.querySelector(".a9s-inner").addEventListener("mousedown",this.onGrab(this.shape)),this.mask=new Gh(o.image,this.shape.querySelector(".a9s-inner")),this.containerGroup.appendChild(this.mask.element),this.elementGroup=document.createElementNS(ce,"g"),this.elementGroup.setAttribute("class","a9s-annotation editable selected"),this.elementGroup.setAttribute("data-id",e.id),this.elementGroup.appendChild(this.shape),this.handles=cs(this.shape).map(s=>{const a=this.drawHandle(s.x,s.y);return a.addEventListener("mousedown",this.onGrab(a)),this.elementGroup.appendChild(a),a}),this.containerGroup.appendChild(this.elementGroup),n.appendChild(this.containerGroup),nr(this.shape,e,r.formatters),this.grabbedElem=null,this.grabbedAt=null}get element(){return this.elementGroup}}class hs extends as{constructor(e,n,r){super(e,n,r);P(this,"startDrawing",(e,n,r)=>{this._isDrawing=!0,this._startOnSingleClick=r,this.attachListeners({mouseMove:this.onMouseMove,mouseUp:this.onMouseUp,dblClick:this.onDblClick}),this.rubberband=new jE([e,n],this.g,this.env)});P(this,"stop",()=>{this.detachListeners(),this._isDrawing=!1,this.rubberband&&(this.rubberband.destroy(),this.rubberband=null)});P(this,"onMouseMove",(e,n)=>this.rubberband.dragTo([e,n]));P(this,"onMouseUp",()=>{const{width:e,height:n}=this.rubberband.getBoundingClientRect(),r=this.config.minSelectionWidth||4,o=this.config.minSelectionHeight||4;e>=r||n>=o?this.rubberband.addPoint():this._startOnSingleClick||(this.emit("cancel"),this.stop())});P(this,"onDblClick",()=>{this._isDrawing=!1;const e=this.rubberband.element;e.annotation=this.rubberband.toSelection(),this.emit("complete",e),this.stop()});P(this,"createEditableShape",(e,n)=>new qE(e,this.g,{...this.config,formatters:n},this.env));this._isDrawing=!1,this._startOnSingleClick=!1}get isDrawing(){return this._isDrawing}}hs.identifier="polygon",hs.supports=i=>{var e;const t=i.selector("SvgSelector");if(t)return(e=t.value)==null?void 0:e.match(/^this._registered.map(e=>e.identifier));P(this,"registerTool",e=>{const n=e.identifier;this.listTools().includes(n)&&this.unregisterTool(n),this._registered.unshift(e)});P(this,"unregisterTool",e=>this._registered=this._registered.filter(n=>n.identifier!==e));P(this,"setCurrent",e=>{this._current&&this._current.destroy();const n=typeof e=="string"||e instanceof String?this._registered.find(r=>r.identifier===e):e;this._current=new n(this._g,this._config,this._env),this._current.on("startSelection",r=>this.emit("startSelection",r)),this._current.on("complete",r=>this.emit("complete",r)),this._current.on("cancel",r=>this.emit("cancel",r))});P(this,"forAnnotation",e=>{var a;const[n,...r]=e.targets,o=(a=n.renderedVia)==null?void 0:a.name,s=o?this._registered.find(l=>l.identifier===o):this._registered.find(l=>l.supports(e));return s?new s(this._g,this._config,this._env):null});this._g=e,this._config=n,this._env=r,this._registered=[rr,hs],this.setCurrent(rr)}get current(){return this._current}}const YE={FragmentSelector:rs,SvgSelector:jh},ZE={FragmentSelector:CE,SvgSelector:HE},qh=i=>{const t=i.targets[0];if(t)return Array.isArray(t.selector)?t.selector[0]:t.selector},ds=(i,t)=>YE[qh(i).type](i,t),Xh=(i,t)=>ZE[qh(i).type](i,t);class KE{constructor(t){const e=document.createElementNS(ce,"svg");e.setAttribute("class","a9s-osd-crosshair-container");const n=document.createElementNS(ce,"g");n.setAttribute("class","a9s-crosshair"),e.appendChild(n);const r=document.createElementNS(ce,"line"),o=document.createElementNS(ce,"line");n.appendChild(r),n.appendChild(o),t.parentElement.appendChild(e);const s=a=>{const{offsetX:l,offsetY:u}=a,c=t.parentElement.offsetWidth,h=t.parentElement.offsetHeight;r.setAttribute("x1",0),r.setAttribute("y1",u),r.setAttribute("x2",c),r.setAttribute("y2",u),o.setAttribute("x1",l),o.setAttribute("y1",0),o.setAttribute("x2",l),o.setAttribute("y2",h)};t.addEventListener("pointermove",s),t.parentElement.addEventListener("pointermove",s)}}function JE(i,t,e,n,r){Yh(i,t,e||0,n||i.length-1,r||QE)}function Yh(i,t,e,n,r){for(;n>e;){if(n-e>600){var o=n-e+1,s=t-e+1,a=Math.log(o),l=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1),c=Math.max(e,Math.floor(t-s*l/o+u)),h=Math.min(n,Math.floor(t+(o-s)*l/o+u));Yh(i,t,c,h,r)}var d=i[t],g=e,y=n;for(Gn(i,e,t),r(i[n],d)>0&&Gn(i,e,n);g0;)y--}r(i[e],d)===0?Gn(i,e,y):(y++,Gn(i,y,n)),y<=t&&(e=y+1),t<=y&&(n=y-1)}}function Gn(i,t,e){var n=i[t];i[t]=i[e],i[e]=n}function QE(i,t){return it?1:0}class $E{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!ar(t,e))return n;const r=this.toBBox,o=[];for(;e;){for(let s=0;s=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(r,o,e)}_split(t,e){const n=t[e],r=n.children.length,o=this._minEntries;this._chooseSplitAxis(n,o,r);const s=this._chooseSplitIndex(n,o,r),a=gn(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,mn(n,this.toBBox),mn(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)}_splitRoot(t,e){this.data=gn([t,e]),this.data.height=t.height+1,this.data.leaf=!1,mn(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let r,o=1/0,s=1/0;for(let a=e;a<=n-e;a++){const l=qn(t,0,a,this.toBBox),u=qn(t,a,n,this.toBBox),c=rx(l,u),h=fs(l)+fs(u);c=e;u--){const c=t.children[u];Xn(a,t.leaf?o(c):c),l+=sr(a)}return l}_adjustParentBBoxes(t,e,n){for(let r=n;r>=0;r--)Xn(e[r],t)}_condense(t){for(let e=t.length-1,n;e>=0;e--)t[e].children.length===0?e>0?(n=t[e-1].children,n.splice(n.indexOf(t[e]),1)):this.clear():mn(t[e],this.toBBox)}}function ex(i,t,e){if(!e)return t.indexOf(i);for(let n=0;n=i.minX&&t.maxY>=i.minY}function gn(i){return{children:i,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Zh(i,t,e,n,r){const o=[t,e];for(;o.length;){if(e=o.pop(),t=o.pop(),e-t<=n)continue;const s=t+Math.ceil((e-t)/n/2)*n;JE(i,s,t,e,r),o.push(t,s,s,e)}}const ms=(i,t)=>{if(i.targets[0].selector.type==="FragmentSelector"){const{x:n,y:r,w:o,h:s}=Rt(i,t);return{minX:n,minY:r,maxX:n+o,maxY:r+s}}else{const n=ds(i,t),r=document.createElementNS(ce,"svg");r.style.position="absolute",r.style.opacity=0,r.style.top=0,r.style.left=0,r.appendChild(n),document.body.appendChild(r);const{x:o,y:s,width:a,height:l}=n.getBBox();return document.body.removeChild(r),{minX:o,minY:s,maxX:o+a,maxY:s+l}}},ox=i=>{var e;const t=i.targets[0];return Array.isArray(t.selector)?t.selector[0].type:(e=t.selector)==null?void 0:e.type},sx=(i,t,e,n)=>{const r=Wt(e),o=r.nodeName.toLowerCase(),s=[i,t];if(o==="polygon"){const a=Array.from(r.points).map(l=>[l.x,l.y]);return ls(s,a)}else if(o==="circle"){const a=r.getAttribute("cx"),l=r.getAttribute("cy"),u=r.getAttribute("r");return kE(s,a,l,u)}else if(o==="ellipse"){const a=r.getAttribute("cx"),l=r.getAttribute("cy"),u=r.getAttribute("rx"),c=r.getAttribute("ry");return LE(s,a,l,u,c)}else{if(o==="path")return Uh(r).find(l=>ls(s,l));if(o==="line"){const a=parseInt(r.getAttribute("x1")),l=parseInt(r.getAttribute("y1")),u=parseInt(r.getAttribute("x2")),c=parseInt(r.getAttribute("y2"));return IE(s,a,l,u,c,n)}else throw`Unsupported SVG shape type: ${o}`}};class ax{constructor(t){P(this,"clear",()=>this.spatial_index.clear());P(this,"getAnnotationAt",(t,e,n)=>{const r=n?5/n:5,s=this.spatial_index.search({minX:t-r,minY:e-r,maxX:t+r,maxY:e+r}).map(a=>a.annotation).filter(a=>{const l=ox(a);if(l==="FragmentSelector")return!0;if(l==="SvgSelector")return sx(t,e,a,r);throw`Unsupported selector type: ${l}`});if(s.length>0)return s.sort((a,l)=>Xh(a,this.env.image)-Xh(l,this.env.image)),s[0]});P(this,"getAnnotationsIntersecting",t=>{const e=t.minX,n=e?t:ms(t,this.env.image),r=this.spatial_index.search(n).map(o=>o.annotation);return e?r:r.filter(o=>!o.isEqual(t))});P(this,"insert",t=>{(Array.isArray(t)?t:[t]).forEach(n=>{this.spatial_index.insert({...ms(n,this.env.image),annotation:n})})});P(this,"getBounds",t=>this.getBounds(t,this.env.image));P(this,"remove",t=>{const e={...ms(t,this.env.image),annotation:t};this.spatial_index.remove(e,(n,r)=>n.annotation.id===r.annotation.id)});this.env=t,t.store=this,this.spatial_index=new $E}}const Kh=(i,t)=>{const r=(is(t,".a9s-annotation")?t:t.closest(".a9s-annotation")).querySelector(".a9s-outer").getBoundingClientRect(),{canvas:o}=i.drawer,s=o.getBoundingClientRect(),a=o.width/s.width,l=o.height/s.height,u=r.x-s.x,c=r.y-s.y,{width:h,height:d}=r,g=document.createElement("CANVAS"),y=g.getContext("2d");g.width=h,g.height=d,y.drawImage(o,u*a,c*l,h*a,d*l,0,0,h,d);const x=i.viewport.viewerElementToImageCoordinates(new OpenSeadragon.Point(u,c)),b=i.viewport.viewportToImageZoom(i.viewport.getZoom());return{snippet:g,transform:T=>{const f=x.x+T[0]/a/b,E=x.y+T[1]/l/b;return[f,E]}}},lx=ss();class Jh extends Qn{constructor(e){super();P(this,"_getShapeAt",e=>{const n=a=>{const l=this.svg.createSVGPoint();if(window.TouchEvent&&a instanceof TouchEvent){const u=this.svg.getBoundingClientRect(),c=a.touches[0],h=c.clientX-u.x,d=c.clientY-u.y,{left:g,top:y}=this.svg.getBoundingClientRect();return l.x=h+g,l.y=d+y,l.matrixTransform(this.g.getScreenCTM().inverse())}else return l.x=a.offsetX,l.y=a.offsetY,l.matrixTransform(this.g.getCTM().inverse())},{x:r,y:o}=n(e),s=this.store.getAnnotationAt(r,o,this.currentScale());if(s)return this.findShape(s)});P(this,"_initDrawingTools",e=>{var l;let n=!1,r=!1,o=!1;this.tools=new XE(this.g,this.config,this.env),this.tools.on("complete",u=>{r=!1,this.onDrawingComplete(u)}),this.mouseTracker=new Dt.MouseTracker({element:this.svg,preProcessEventHandler:u=>{this.mouseTracker.enabled||(u.preventDefault=!1,u.preventGesture=!0),this.selectedShape&&u.eventType==="wheel"&&(u.preventDefault=!1,this.viewer.canvas.dispatchEvent(new u.originalEvent.constructor(u.eventType,u.originalEvent)))},pressHandler:u=>{this.tools.current.isDrawing||(this.tools.current.start(u.originalEvent,this.drawOnSingleClick&&!this.hoveredShape),e||this.scaleTool(this.tools.current))},moveHandler:u=>{if(this.tools.current.isDrawing){const{x:c,y:h}=this.tools.current.getSVGPoint(u.originalEvent);!u.buttons||!r?(u.originalEvent.stopPropagation(),this.tools.current.onMouseMove(c,h,u.originalEvent),n||(this.emit("startSelection",{x:c,y:h}),n=!0)):(!o&&this.tools.current.onDragStart&&this.tools.current.onDragStart(c,h,u.originalEvent),o=!0)}},releaseHandler:u=>{if(this.tools.current.isDrawing){r=!0;const{x:c,y:h}=this.tools.current.getSVGPoint(u.originalEvent);n&&this.emit("endSelection",{x:c,y:h}),this.tools.current.onMouseUp(c,h,u.originalEvent),o&&this.tools.current.onDragEnd&&this.tools.current.onDragEnd()}n=!1,o=!1}});const s=this.config.hotkey?this.config.hotkey.key?this.config.hotkey.key.toLowerCase():this.config.hotkey.toLowerCase():"shift",a=(l=this.config.hotkey)==null?void 0:l.inverted;this.mouseTracker.enabled=a,this.onKeyDown&&document.removeEventListener("keydown",this.onKeyDown),this.onKeyUp&&document.removeEventListener("keydown",this.onKeyDown),this.onKeyDown=u=>{if(u.key.toLowerCase()===s&&!this.selectedShape){const c=!this.readOnly&&!a;this.mouseTracker.enabled=c,this.tools.current.enabled=c}},this.onKeyUp=u=>{u.key.toLowerCase()===s&&!this.tools.current.isDrawing&&(this.mouseTracker.enabled=a,this.tools.current.enabled=a)},document.addEventListener("keydown",this.onKeyDown),document.addEventListener("keyup",this.onKeyUp)});P(this,"_initMouseEvents",()=>{this.svg.addEventListener("mousemove",n=>{var r,o;if(!((r=this.tools)!=null&&r.current.isDrawing)&&!n.target.closest(".a9s-annotation.editable.selected")){const a=this._getShapeAt(n);if((a==null?void 0:a.annotation)!==((o=this.hoveredShape)==null?void 0:o.annotation)){if(this.hoveredShape){const l=this.hoveredShape.element||this.hoveredShape;Qi(l,"hover"),this.emit("mouseLeaveAnnotation",this.hoveredShape.annotation,this.hoveredShape)}a&&(Et(a,"hover"),this.emit("mouseEnterAnnotation",a.annotation,a))}this.hoveredShape=a}}),this.svg.parentElement.addEventListener("mouseleave",()=>{this.hoveredShape&&(Qi(this.hoveredShape,"hover"),this.emit("mouseLeaveAnnotation",this.hoveredShape.annotation,this.hoveredShape),this.hoveredShape=null)});let e=null;this.viewer.addHandler("canvas-press",()=>e=new Date().getTime()),this.viewer.addHandler("canvas-click",n=>{var o;const{originalEvent:r}=n;if(!(((o=this.tools.current)==null?void 0:o.isDrawing)||this.disableSelect)&&new Date().getTime()-e<250){const l=r.target.closest(".a9s-annotation.editable.selected")?this.selectedShape:this._getShapeAt(r);l?(n.preventDefaultAction=!0,this.selectShape(l)):l||(this.deselect(),this.emit("select",{}))}this.disableSelect&&this.hoveredShape&&this.emit("clickAnnotation",this.hoveredShape.annotation,this.hoveredShape)})});P(this,"_lazy",e=>{if(this.viewer.world.getItemAt(0))e();else{const n=()=>{e(),this.viewer.removeHandler("open",n),this.viewer.world.removeHandler("add-item",n)};this.viewer.addHandler("open",n),this.viewer.world.addHandler("add-item",n)}});P(this,"_refreshNonScalingAnnotations",()=>{const e=this.currentScale();Array.from(this.svg.querySelectorAll(".a9s-non-scaling")).forEach(n=>n.setAttribute("transform",`scale(${1/e})`))});P(this,"addAnnotation",(e,n)=>{const r=n||this.g,o=ds(e,this.env.image);return Et(o,"a9s-annotation"),o.setAttribute("data-id",e.id),o.annotation=e,r.appendChild(o),nr(o,e,this.formatters),this.scaleFormatterElements(o),o});P(this,"addDrawingTool",e=>this.tools.registerTool(e));P(this,"addOrUpdateAnnotation",(e,n)=>{var s;const r=(s=this.selectedShape)==null?void 0:s.annotation;(r===e||(r==null?void 0:r.isSelection)||r==n)&&this.deselect(),n&&this.removeAnnotation(e),this.removeAnnotation(e);const o=this.addAnnotation(e);is(o,"a9s-non-scaling")&&o.setAttribute("transform",`scale(${1/this.currentScale()})`),this.store.insert(e)});P(this,"currentScale",()=>{const e=this.viewer.viewport.getContainerSize().x;return this.viewer.viewport.getZoom(!0)*e/this.viewer.world.getContentFactor()});P(this,"deselect",()=>{var e;if((e=this.tools)==null||e.current.stop(),this.selectedShape){const{annotation:n}=this.selectedShape;if(this.selectedShape.destroy){if(this.selectedShape.mouseTracker.destroy(),this.selectedShape.destroy(),!n.isSelection){const r=this.addAnnotation(n);is(r,"a9s-non-scaling")&&r.setAttribute("transform",`scale(${1/this.currentScale()})`)}}else Qi(this.selectedShape,"selected");this.selectedShape=null}});P(this,"destroy",()=>{this.deselect(),this.svg.parentNode.removeChild(this.svg)});P(this,"findShape",e=>{const n=e!=null&&e.id?e.id:e;return this.g.querySelector(`.a9s-annotation[data-id="${n}"]`)});P(this,"_fit",(e,n,r)=>{const o=this.findShape(e);if(o){const s=n?typeof n=="boolean"?n:n.immediately:!1,a=(n==null?void 0:n.padding)||0,l=this.viewer.container.getBoundingClientRect(),u=Math.min(2*a/l.width,2*a/l.height),{x:c,y:h,width:d,height:g}=o.getBBox(),y=c-u*d,x=h-u*g,b=d+2*u*d,T=g+2*u*g,f=this.viewer.viewport.imageToViewportRectangle(y,x,b,T);this.viewer.viewport[r](f,s)}});P(this,"fitBounds",(e,n)=>this._fit(e,n,"fitBounds"));P(this,"fitBoundsWithConstraints",(e,n)=>this._fit(e,n,"fitBoundsWithConstraints"));P(this,"getAnnotations",()=>Array.from(this.g.querySelectorAll(".a9s-annotation")).map(n=>n.annotation));P(this,"getAnnotationsIntersecting",e=>{const n=e.id?e:this.findShape(e).annotation;return this.store.getAnnotationsIntersecting(n)});P(this,"getImageSnippetById",e=>{const n=this.findShape(e);if(n)return Kh(this.viewer,n)});P(this,"getSelectedImageSnippet",()=>{var e;if(this.selectedShape){const n=(e=this.selectedShape.element)!=null?e:this.selectedShape;return Kh(this.viewer,n)}});P(this,"init",e=>{this.deselect(),Array.from(this.g.querySelectorAll(".a9s-annotation")).forEach(r=>this.g.removeChild(r)),this.store.clear(),this._lazy(()=>{console.time("Took"),console.log("Drawing..."),this.loaded||(this.g.style.display="none"),e.forEach(r=>this.addAnnotation(r)),console.log("Indexing..."),this.store.insert(e),console.timeEnd("Took"),this.resize()})});P(this,"listDrawingTools",()=>this.tools.listTools());P(this,"overrideId",(e,n)=>{const r=this.findShape(e);r.setAttribute("data-id",n);const{annotation:o}=r,s=o.clone({id:n});return r.annotation=s,this.store.remove(o),this.store.insert(s),s});P(this,"panTo",(e,n)=>{const r=this.findShape(e);if(r){const{top:o,left:s,width:a,height:l}=r.getBoundingClientRect(),u=s+a/2+window.scrollX,c=o+l/2+window.scrollY,h=this.viewer.viewport.windowToViewportCoordinates(new Dt.Point(u,c));this.viewer.viewport.panTo(h,n)}});P(this,"removeAnnotation",e=>{var o,s;const n=e.type?e.id:e;((o=this.selectedShape)==null?void 0:o.annotation.id)===n&&this.deselect();const r=this.findShape(e);if(r){const{annotation:a}=r;((s=this.selectedShape)==null?void 0:s.annotation)===a&&this.deselect(),r.parentNode.removeChild(r),this.store.remove(a)}});P(this,"removeDrawingTool",e=>{var n;return(n=this.tools)==null?void 0:n.unregisterTool(e)});P(this,"scaleFormatterElements",e=>{const n=1/this.currentScale();if(e){const r=e.querySelector(".a9s-formatter-el");r&&r.firstChild.setAttribute("transform",`scale(${n})`)}else Array.from(this.g.querySelectorAll(".a9s-formatter-el")).forEach(o=>o.firstChild.setAttribute("transform",`scale(${n})`))});P(this,"scaleTool",e=>{if(e){const n=1/this.currentScale();e.scale=n,e.onScaleChanged&&e.onScaleChanged(n)}});P(this,"selectAnnotation",(e,n)=>{this.selectedShape&&this.deselect();const r=this.findShape(e);if(r){this.selectShape(r,n);const o=this.selectedShape.element?this.selectedShape.element:this.selectedShape;return{annotation:r.annotation,element:o}}else this.deselect()});P(this,"selectShape",(e,n)=>{var s;if(!n&&!e.annotation.isSelection&&this.emit("clickAnnotation",e.annotation,e),((s=this.selectedShape)==null?void 0:s.annotation)===e.annotation)return;this.selectedShape&&this.selectedShape.annotation!==e.annotation&&this.deselect();const{annotation:r}=e;if(this.readOnly||r.readOnly||this.headless)this.selectedShape=e,Et(e,"selected"),n||this.emit("select",{annotation:r,element:e,skipEvent:n});else{const a=this.tools.forAnnotation(r);if(a){setTimeout(()=>{e.parentNode.removeChild(e),n||this.emit("select",{annotation:r,element:this.selectedShape.element})},1),this.selectedShape=a.createEditableShape(r,this.formatters),this.scaleTool(this.selectedShape),this.scaleFormatterElements(this.selectedShape.element),this.selectedShape.element.annotation=r;const l=new Dt.MouseTracker({element:this.svg,preProcessEventHandler:u=>{u.stopPropagation=!0,u.preventDefault=!1,u.preventGesture=!0}}).setTracking(!1);this.selectedShape.element.addEventListener("mouseenter",()=>{this.hoveredShape=this.selectedShape,l.setTracking(!0)}),this.selectedShape.element.addEventListener("mouseleave",()=>{this.hoveredShape=null,l.setTracking(!1)}),this.selectedShape.mouseTracker=l,this.selectedShape.on("update",u=>this.emit("updateTarget",this.selectedShape.element,u))}else this.selectedShape=e,n||this.emit("select",{annotation:r,element:this.selectedShape})}});P(this,"setDrawingEnabled",e=>{if(this.mouseTracker){const n=e&&!this.readOnly;this.mouseTracker.enabled=n,this.mouseTracker.setTracking(n),this.tools.current&&(this.tools.current.enabled=n)}});P(this,"setDrawingTool",e=>{var n;this.tools&&((n=this.tools.current)==null||n.stop(),this.tools.setCurrent(e))});P(this,"setVisible",e=>{e?this.svg.style.display=null:(this.deselect(),this.svg.style.display="none")});P(this,"stopDrawing",()=>{var e;(e=this.tools)!=null&&e.current&&(this.tools.current.isDrawing&&this.tools.current.stop(),this.mouseTracker.enabled=!1,this.tools.current.enabled=!1)});this.viewer=e.viewer,this.config=e.config,this.env=e.env,this.readOnly=e.config.readOnly,this.headless=e.config.headless,e.config.formatter?this.formatters=[e.config.formatter]:e.config.formatters&&(this.formatters=Array.isArray(e.config.formatters)?e.config.formatters:[e.config.formatters]),this.disableSelect=e.config.disableSelect,this.drawOnSingleClick=e.config.drawOnSingleClick,this.svg=document.createElementNS(ce,"svg"),lx?(this.svg.setAttribute("class","a9s-annotationlayer a9s-osd-annotationlayer touch"),OE(this.svg)):this.svg.setAttribute("class","a9s-annotationlayer a9s-osd-annotationlayer"),this.g=document.createElementNS(ce,"g"),this.svg.appendChild(this.g),this.viewer.canvas.appendChild(this.svg),this.viewer.addHandler("animation",()=>this.resize()),this.viewer.addHandler("rotate",()=>this.resize()),this.viewer.addHandler("resize",()=>this.resize()),this.viewer.addHandler("flip",()=>this.resize()),this.loaded=!1;const n=()=>{const{x:r,y:o}=this.viewer.world.getItemAt(0).source.dimensions,s=this.viewer.world.getItemAt(0).source["@id"]||new URL(this.viewer.world.getItemAt(0).source.url,document.baseURI).href;this.env.image={src:s,naturalWidth:r,naturalHeight:o},e.config.crosshair&&(this.crosshair||(this.crosshair=new KE(this.svg),Et(this.svg,"no-cursor"))),this.loaded||this.emit("load",s),this.loaded=!0,this.g.style.display="inline",this.resize()};this.viewer.addHandler("open",n),this.viewer.world.addHandler("add-item",n),this.viewer.world.getItemAt(0)&&n(),this.store=new ax(this.env),this.selectedShape=null,this.hoveredShape=null,this._initMouseEvents()}resize(){var a;const e=this.viewer.viewport.getFlip(),n=this.viewer.viewport.pixelFromPoint(new Dt.Point(0,0),!0);e&&(n.x=this.viewer.viewport._containerInnerSize.x-n.x);const r=this.currentScale(),o=e?-r:r,s=this.viewer.viewport.getRotation();this.g.setAttribute("transform",`translate(${n.x}, ${n.y}) scale(${o}, ${r}) rotate(${s})`),this._refreshNonScalingAnnotations(),this.scaleFormatterElements(),this.selectedShape&&(this.selectedShape.element?(this.scaleTool(this.selectedShape),this.emit("viewportChange",this.selectedShape.element)):this.emit("viewportChange",this.selectedShape)),(a=this.tools)!=null&&a.current&&this.scaleTool(this.tools.current)}}class ux extends Jh{constructor(e){super(e);P(this,"onDrawingComplete",e=>{var n;this.mouseTracker.enabled=(n=this.config.hotkey)==null?void 0:n.inverted,this.selectShape(e),this.emit("createSelection",e.annotation)});this._initDrawingTools()}}const gs=i=>{const t=i.viewport.viewportToImageRectangle(i.viewport.getBounds(!0)),e=i.viewport.getContainerSize().x,r=i.viewport.getZoom(!0)*e/i.world.getContentFactor();return{extent:t,scale:r}},cx=i=>{var e;const t=i.targets[0];return t?Array.isArray(t.selector)?t.selector[0].type:(e=t.selector)==null?void 0:e.type:null},Qh=(i,t)=>{const{extent:e,scale:n}=gs(i),{selector:r}=t,o=St.create({target:t});if(r.type==="SvgSelector"){const s=Wt(o),a=s.nodeName.toLowerCase();let l=null;if(a==="polygon")l=hx(s,e,n);else if(a==="circle")l=dx(s,e,n);else if(a==="ellipse")l=fx(s,e,n);else if(a==="path")l=px(s,e,n);else throw`Unsupported SVG shape type: ${a}`;let u=l.outerHTML||new XMLSerializer().serializeToString(l);return u=u.replace(` xmlns="${ce}"`,""),{...t,selector:{type:"SvgSelector",value:`${u}`}}}else if(r.type==="FragmentSelector"){const{x:s,y:a,w:l,h:u}=Rt(o),c=e.x+s/n,h=e.y+a/n,d=l/n,g=u/n;return l===0&&u===0?{...pn(c,h,d,g),renderedVia:{name:"point"}}:pn(c,h,d,g)}else throw`Unsupported selector type: ${r.type}`},hx=(i,t,e)=>{const r=Array.from(i.points).map(o=>{const s=t.x+o.x/e,a=t.y+o.y/e;return s+","+a}).join(" ");return i.setAttribute("points",r),i},dx=(i,t,e)=>{const n=parseFloat(i.getAttribute("cx")),r=parseFloat(i.getAttribute("cy")),o=parseFloat(i.getAttribute("r"));return i.setAttribute("cx",t.x+n/e),i.setAttribute("cy",t.y+r/e),i.setAttribute("r",o/e),i},fx=(i,t,e)=>{const n=parseFloat(i.getAttribute("cx")),r=parseFloat(i.getAttribute("cy")),o=parseFloat(i.getAttribute("rx")),s=parseFloat(i.getAttribute("ry"));return i.setAttribute("cx",t.x+n/e),i.setAttribute("cy",t.y+r/e),i.setAttribute("rx",o/e),i.setAttribute("ry",s/e),i},px=(i,t,e)=>{const r=i.getAttribute("d").split(/(?=M|m|L|l|H|h|V|v|Z|z)/g).map(o=>o.trim()).map(o=>{const s=o.substring(0,1);if(s.toLowerCase()==="z")return s;{const a=o.substring(1).split(" ").map(h=>parseFloat(h.trim())),l=s===s.toUpperCase(),u=l?t.x+a[0]/e:a[0]/e,c=l?t.y+a[1]/e:a[1]/e;return s+" "+u+" "+c}}).join(" ");return i.setAttribute("d",r),i},$h=(i,t)=>{const{extent:e,scale:n}=gs(i),r=t.selector("FragmentSelector");if(t.selector("SvgSelector")){const s=Wt(t),a=s.nodeName.toLowerCase();let l=null;if(a==="polygon")l=mx(s,e,n);else if(a==="circle")l=gx(s,e,n);else if(a==="ellipse")l=vx(s,e,n);else if(a==="path")l=yx(s,e,n);else throw`Unsupported SVG shape type: ${a}`;let u=l.outerHTML||new XMLSerializer().serializeToString(l);u=u.replace(` xmlns="${ce}"`,"");const c={selector:{type:"SvgSelector",value:`${u}`}};return t.clone({target:c})}else if(r){const{x:s,y:a,w:l,h:u}=Rt(t),c=(s-e.x)*n,h=(a-e.y)*n,d=pn(c,h,l*n,u*n);return t.clone({target:d})}},mx=(i,t,e)=>{const r=Array.from(i.points).map(o=>{const s=e*(o.x-t.x),a=e*(o.y-t.y);return s+","+a}).join(" ");return i.setAttribute("points",r),i},gx=(i,t,e)=>{const n=i.getAttribute("cx"),r=i.getAttribute("cy"),o=i.getAttribute("r");return i.setAttribute("cx",e*(n-t.x)),i.setAttribute("cy",e*(r-t.y)),i.setAttribute("r",o*e),i},vx=(i,t,e)=>{const n=i.getAttribute("cx"),r=i.getAttribute("cy"),o=i.getAttribute("rx"),s=i.getAttribute("ry");return i.setAttribute("cx",e*(n-t.x)),i.setAttribute("cy",e*(r-t.y)),i.setAttribute("rx",o*e),i.setAttribute("ry",s*e),i},yx=(i,t,e)=>{const r=i.getAttribute("d").split(/(?=M|m|L|l|H|h|V|v|Z|z)/g).map(o=>o.trim()).map(o=>{const s=o.substring(0,1);if(s.toLowerCase()==="z")return s;{const a=o.substring(1).split(" ").filter(h=>h).map(h=>parseFloat(h.trim())),l=s===s.toUpperCase(),u=l?e*(a[0]-t.x):e*a[0],c=l?e*(a[1]-t.y):e*a[1];return s+" "+u+" "+c}}).join(" ");return i.setAttribute("d",r),i},ed=(i,t)=>{const{extent:e,scale:n}=gs(i),r=cx(t.annotation);if(r==="FragmentSelector")wx(t,e,n);else if(r==="SvgSelector")bx(t,e,n);else throw`Unsupported selector type type: ${r}`;const o=t.querySelector(".a9s-formatter-el");if(o){const{x:s,y:a}=t.querySelector(".a9s-inner").getBBox();o.setAttribute("x",s),o.setAttribute("y",a)}},wx=(i,t,e)=>{const{x:n,y:r,w:o,h:s}=Rt(i.annotation),a=i.querySelector(".a9s-outer"),l=i.querySelector(".a9s-inner"),u=e*(n-t.x),c=e*(r-t.y);o===0&&s===0?[a,l].forEach(h=>{h.setAttribute("cx",u),h.setAttribute("cy",c)}):[a,l].forEach(h=>{h.setAttribute("x",u),h.setAttribute("y",c),h.setAttribute("width",o*e),h.setAttribute("height",s*e)})},bx=(i,t,e)=>{const n=Wt(i.annotation),r=n.nodeName.toLowerCase();if(r==="polygon")Sx(i,n,t,e);else if(r==="circle")Ex(i,n,t,e);else if(r==="ellipse")xx(i,n,t,e);else if(r==="path")_x(i,n,t,e);else throw`Unsupported SVG shape type: ${r}`},Sx=(i,t,e,n)=>{const o=Array.from(t.points).map(l=>{const u=n*(l.x-e.x),c=n*(l.y-e.y);return u+","+c}).join(" ");i.querySelector(".a9s-outer").setAttribute("points",o),i.querySelector(".a9s-inner").setAttribute("points",o)},Ex=(i,t,e,n)=>{const r=n*(t.getAttribute("cx")-e.x),o=n*(t.getAttribute("cy")-e.y),s=n*t.getAttribute("r"),a=i.querySelector(".a9s-outer");a.setAttribute("cx",r),a.setAttribute("cy",o),a.setAttribute("r",s);const l=i.querySelector(".a9s-inner");l.setAttribute("cx",r),l.setAttribute("cy",o),l.setAttribute("r",s)},xx=(i,t,e,n)=>{const r=n*(t.getAttribute("cx")-e.x),o=n*(t.getAttribute("cy")-e.y),s=n*t.getAttribute("rx"),a=n*t.getAttribute("ry"),l=i.querySelector(".a9s-outer");l.setAttribute("cx",r),l.setAttribute("cy",o),l.setAttribute("rx",s),l.setAttribute("ry",a);const u=i.querySelector(".a9s-inner");u.setAttribute("cx",r),u.setAttribute("cy",o),u.setAttribute("rx",s),u.setAttribute("ry",a)},_x=(i,t,e,n)=>{const o=t.getAttribute("d").split(/(?=M|m|L|l|H|h|V|v|Z|z)/g).map(s=>s.trim()).map(s=>{const a=s.substring(0,1);if(a.toLowerCase()==="z")return a;{const l=s.substring(1).split(" ").filter(d=>d).map(d=>parseFloat(d.trim())),u=a===a.toUpperCase(),c=u?n*(l[0]-e.x):n*l[0],h=u?n*(l[1]-e.y):n*l[1];return a+" "+c+" "+h}}).join(" ");i.querySelector(".a9s-inner").setAttribute("d",o),i.querySelector(".a9s-outer").setAttribute("d",o)},Tx=ss();class Cx extends Jh{constructor(e){super(e);P(this,"_fit",(e,n,r)=>{const o=n?typeof n=="boolean"?n:n.immediately:!1,s=(n==null?void 0:n.padding)||0,a=this.findShape(e);if(a){const l=this.viewer.container.getBoundingClientRect(),u=a.getBoundingClientRect(),c=u.x-l.x,h=u.y-l.y,{width:d,height:g}=u,y=c-s,x=h-s,b=d+2*s,T=g+2*s,f=this.viewer.viewport.viewerElementToViewportRectangle(new Dt.Rect(y,x,b,T));this.viewer.viewport[r](f,o)}});P(this,"_getShapeAt",e=>{const n=l=>{if(Tx){const u=this.svg.getBoundingClientRect(),c=l.clientX-u.x,h=l.clientY-u.y;return new Dt.Point(c,h)}else return new Dt.Point(l.offsetX,l.offsetY)},r=this.viewer.viewport.viewerElementToViewportCoordinates(n(e)),{x:o,y:s}=this.viewer.viewport.viewportToImageCoordinates(r.x,r.y),a=this.store.getAnnotationAt(o,s,this.currentScale());if(a)return this.findShape(a)});P(this,"_refreshNonScalingAnnotations",()=>{});P(this,"addAnnotation",(e,n)=>{const r=n||this.g,o=ds(e,this.env.image);return Et(o,"a9s-annotation"),o.setAttribute("data-id",e.id),o.annotation=e,ed(this.viewer,o),r.appendChild(o),nr(o,e,this.formatters),o});P(this,"addOrUpdateAnnotation",(e,n)=>{var o;const r=(o=this.selectedShape)==null?void 0:o.annotation;(r===e||(r==null?void 0:r.isSelection)||r==n)&&this.deselect(),n&&this.removeAnnotation(e),this.removeAnnotation(e),this.addAnnotation(e),this.store.insert(e)});P(this,"deselect",()=>{var e;if((e=this.tools)==null||e.current.stop(),this.selectedShape){const{annotation:n}=this.selectedShape;this.selectedShape.destroy?(this.selectedShape.mouseTracker.destroy(),this.selectedShape.destroy(),n.isSelection||this.addAnnotation(n)):Qi(this.selectedShape,"selected"),this.selectedShape=null}});P(this,"onDrawingComplete",e=>{const n=e.annotation.clone({target:Qh(this.viewer,e.annotation.target)});e.annotation=n,this.selectShape(e),this.emit("createSelection",e.annotation),this.mouseTracker.enabled=!1});P(this,"selectShape",(e,n)=>{var s;if(!n&&!e.annotation.isSelection&&this.emit("clickAnnotation",e.annotation,e),((s=this.selectedShape)==null?void 0:s.annotation)===e.annotation)return;this.selectedShape&&this.selectedShape.annotation!==e.annotation&&this.deselect(!0);const{annotation:r}=e;if(this.readOnly||r.readOnly||this.headless)this.selectedShape=e,Et(e,"selected"),n||this.emit("select",{annotation:r,element:e,skipEvent:n});else{setTimeout(()=>{e.parentNode.removeChild(e),n||this.emit("select",{annotation:r,element:this.selectedShape.element})},1);const a=this.tools.forAnnotation(r);this.selectedShape=a.createEditableShape(r),this.selectedShape.element.annotation=r;const l=$h(this.viewer,r);this.selectedShape.updateState(l);const u=new Dt.MouseTracker({element:this.svg,preProcessEventHandler:c=>{c.stopPropagation=!0,c.preventDefault=!1,c.preventGesture=!0}}).setTracking(!1);this.selectedShape.element.addEventListener("mouseenter",()=>{this.hoveredShape=this.selectedShape,u.setTracking(!0)}),this.selectedShape.element.addEventListener("mouseleave",()=>{this.hoveredShape=null,u.setTracking(!1)}),this.selectedShape.mouseTracker=u,this.selectedShape.on("update",c=>{const h=Qh(this.viewer,c);this.selectedShape.element.annotation=this.selectedShape.annotation.clone({target:h}),this.emit("updateTarget",this.selectedShape.element,h)})}});this._initDrawingTools(!0)}resize(){if(!this.store)return;if(Array.from(this.g.querySelectorAll(".a9s-annotation:not(.selected)")).forEach(n=>ed(this.viewer,n)),this.selectedShape)if(this.selectedShape.element){const n=$h(this.viewer,this.selectedShape.element.annotation);this.selectedShape.updateState&&this.selectedShape.updateState(n),this.emit("viewportChange",this.selectedShape.element)}else this.emit("viewportChange",this.selectedShape)}}var Px=0;function td(i,t,e,n,r){var o,s,a={};for(s in t)s=="ref"?o=t[s]:a[s]=t[s];var l={type:i,props:a,key:e,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--Px,__source:n,__self:r};if(typeof i=="function"&&(o=i.defaultProps))for(s in o)a[s]===void 0&&(a[s]=o[s]);return X.vnode&&X.vnode(l),l}class Ax extends Pe{constructor(e){super(e);P(this,"clearState",e=>this.setState({selectedAnnotation:null,selectedDOMElement:null,modifiedTarget:null,beforeHeadlessModify:null},e));P(this,"forwardEvent",(e,n)=>{this.annotationLayer.on(e,(r,o)=>{this.props[n](r.clone(),o)})});P(this,"onKeyUp",e=>{if(e.which===27){this.annotationLayer.stopDrawing();const{selectedAnnotation:n}=this.state;n&&(this.cancelSelected(),this.props.onCancelSelected(n))}else if(e.which===46){const{disableDeleteKey:n}=this.props.config;if(!n){const{selectedAnnotation:r}=this.state;r&&(r.isSelection?this.onCancelAnnotation(r):this.onDeleteAnnotation(r))}}});P(this,"handleStartSelect",e=>this.props.onSelectionStarted(e));P(this,"handleEndSelect",e=>this.props.onSelectionEnded(e));P(this,"handleSelect",(e,n)=>{this.state.editorDisabled?this.onHeadlessSelect(e,n):this.onNormalSelect(e,n)});P(this,"onNormalSelect",(e,n)=>{const{annotation:r,element:o}=e;if(r){const s=()=>{this.setState({selectedAnnotation:r,selectedDOMElement:o,modifiedTarget:null},()=>{n||(r.isSelection?this.props.onSelectionCreated(r.clone()):this.props.onAnnotationSelected(r.clone(),o))})},{selectedAnnotation:a}=this.state;a&&!a.isEqual(r)?this.clearState(()=>{this.props.onCancelSelected(a),s()}):s()}else{const{selectedAnnotation:s}=this.state;s?this.clearState(()=>this.props.onCancelSelected(s)):this.clearState()}});P(this,"onHeadlessSelect",(e,n)=>{this.saveSelected().then(()=>{this.onNormalSelect(e,n)})});P(this,"handleUpdateTarget",(e,n)=>{this.setState({selectedDOMElement:e,modifiedTarget:n});const r=JSON.parse(JSON.stringify(n));this.props.onSelectionTargetChanged(r)});P(this,"handleViewportChange",e=>this.setState({selectedDOMElement:e}));P(this,"overrideAnnotationId",e=>n=>{const{id:r}=e;this.state.selectedAnnotation?this.setState({selectedAnnotation:null,selectedDOMElement:null,modifiedTarget:null},()=>{this.annotationLayer.overrideId(r,n)}):this.annotationLayer.overrideId(r,n)});P(this,"onCreateOrUpdateAnnotation",(e,n)=>(r,o)=>{let s=r.isSelection?r.toAnnotation():r;s=this.state.modifiedTarget?s.clone({target:this.state.modifiedTarget}):s.clone(),this.clearState(()=>{this.annotationLayer.addOrUpdateAnnotation(s,o),o?this.props[e](s,o.clone()):this.props[e](s,this.overrideAnnotationId(s)),n&&n()})});P(this,"onDeleteAnnotation",e=>{this.clearState(),this.annotationLayer.removeAnnotation(e),this.props.onAnnotationDeleted(e)});P(this,"onCancelAnnotation",(e,n)=>{this.state.editorDisabled||this.annotationLayer.deselect(),this.props.onCancelSelected(e),this.clearState(n)});P(this,"addAnnotation",e=>{var n;e.id===((n=this.state.selectedAnnotation)==null?void 0:n.id)&&(this.annotationLayer.deselect(),this.clearState()),this.annotationLayer.addOrUpdateAnnotation(e.clone())});P(this,"addDrawingTool",e=>this.annotationLayer.addDrawingTool(e));P(this,"cancelSelected",()=>new Promise(e=>{this.annotationLayer.deselect(),this.state.selectedAnnotation?this.clearState(e):e()}));P(this,"fitBounds",(e,n)=>this.annotationLayer.fitBounds(e,n));P(this,"fitBoundsWithConstraints",(e,n)=>this.annotationLayer.fitBoundsWithConstraints(e,n));P(this,"getAnnotationById",e=>{var n;return(n=this.annotationLayer.findShape(e))==null?void 0:n.annotation});P(this,"getAnnotations",()=>this.annotationLayer.getAnnotations().map(e=>e.clone()));P(this,"getAnnotationsIntersecting",e=>this.annotationLayer.getAnnotationsIntersecting(e));P(this,"getImageSnippetById",e=>this.annotationLayer.getImageSnippetById(e));P(this,"getSelected",()=>{var e;if(this.state.selectedAnnotation)return this.state.editorDisabled?this.state.selectedAnnotation:(e=this._editor.current)==null?void 0:e.getCurrentAnnotation()});P(this,"getSelectedImageSnippet",()=>this.annotationLayer.getSelectedImageSnippet());P(this,"listDrawingTools",()=>this.annotationLayer.listDrawingTools());P(this,"panTo",(e,n)=>this.annotationLayer.panTo(e,n));P(this,"removeAnnotation",e=>this.annotationLayer.removeAnnotation(e));P(this,"removeDrawingTool",e=>this.annotationLayer.removeDrawingTool(e));P(this,"saveSelected",()=>new Promise(e=>{const n=this.state.selectedAnnotation;if(n)if(this._editor.current)this._editor.current.onOk(),e();else if(n.isSelection)n.bodies.length>0||this.props.config.allowEmpty?this.onCreateOrUpdateAnnotation("onAnnotationCreated",e)(n):(this.annotationLayer.deselect(),e());else{const{beforeHeadlessModify:r,modifiedTarget:o}=this.state;r?this.onCreateOrUpdateAnnotation("onAnnotationUpdated",e)(n,r):o?this.onCreateOrUpdateAnnotation("onAnnotationUpdated",e)(n,n):this.onCancelAnnotation(n,e)}else e()}));P(this,"selectAnnotation",e=>{const n=this.annotationLayer.selectAnnotation(e,!0);if(n)return this.handleSelect(n,!0),n.annotation.clone();this.clearState()});P(this,"setAnnotations",e=>this.annotationLayer.init(e.map(n=>n.clone())));P(this,"setDrawingEnabled",e=>this.annotationLayer.setDrawingEnabled(e));P(this,"setDrawingTool",e=>this.annotationLayer.setDrawingTool(e));P(this,"setVisible",e=>{this.annotationLayer.setVisible(e),e||this.clearState()});P(this,"updateSelected",(e,n)=>new Promise(r=>{this.state.selectedAnnotation&&(n?this.state.selectedAnnotation.isSelection?this.onCreateOrUpdateAnnotation("onAnnotationCreated",r)(e):this.onCreateOrUpdateAnnotation("onAnnotationUpdated",r)(e,this.state.selectedAnnotation):this.setState({selectedAnnotation:e,beforeHeadlessModify:this.state.beforeHeadlessModify||this.state.selectedAnnotation},r))}));this.state={selectedAnnotation:null,selectedDOMElement:null,modifiedTarget:null,readOnly:e.config.readOnly,editorDisabled:e.config.disableEditor,widgets:e.config.widgets,beforeHeadlessModify:null},this._editor=k.createRef()}componentDidMount(){this.annotationLayer=this.props.config.gigapixelMode?new Cx(this.props):new ux(this.props),this.annotationLayer.on("load",this.props.onLoad),this.annotationLayer.on("startSelection",this.handleStartSelect),this.annotationLayer.on("endSelection",this.handleEndSelect),this.annotationLayer.on("select",this.handleSelect),this.annotationLayer.on("updateTarget",this.handleUpdateTarget),this.annotationLayer.on("viewportChange",this.handleViewportChange),this.forwardEvent("clickAnnotation","onClickAnnotation"),this.forwardEvent("mouseEnterAnnotation","onMouseEnterAnnotation"),this.forwardEvent("mouseLeaveAnnotation","onMouseLeaveAnnotation"),document.addEventListener("keyup",this.onKeyUp)}componentWillUnmount(){this.annotationLayer.destroy(),document.removeEventListener("keyup",this.onKeyUp)}get disableEditor(){return this.state.editorDisabled}set disableEditor(e){this.setState({editorDisabled:e})}get disableSelect(){return this.annotationLayer.disableSelect}set disableSelect(e){this.annotationLayer.disableSelect=e}get formatters(){return this.annotationLayer.formatters}set formatters(e){this.annotationLayer.formatters=e}get readOnly(){return this.state.readOnly}set readOnly(e){this.annotationLayer.readOnly=e,this.setState({readOnly:e})}get widgets(){return this.state.widgets}set widgets(e){this.setState({widgets:e})}render(){var r;const e=this.state.selectedAnnotation&&!this.state.editorDisabled,n=this.state.readOnly||((r=this.state.selectedAnnotation)==null?void 0:r.readOnly);return e&&td(mE,{ref:this._editor,detachable:!0,wrapperEl:this.props.wrapperEl,annotation:this.state.selectedAnnotation,modifiedTarget:this.state.modifiedTarget,selectedElement:this.state.selectedDOMElement,readOnly:n,allowEmpty:this.props.config.allowEmpty,widgets:this.state.widgets,env:this.props.env,onAnnotationCreated:this.onCreateOrUpdateAnnotation("onAnnotationCreated"),onAnnotationUpdated:this.onCreateOrUpdateAnnotation("onAnnotationUpdated"),onAnnotationDeleted:this.onDeleteAnnotation,onCancel:this.onCancelAnnotation})}}var I1="",N1="",H1="";class Ox{constructor(t,e){P(this,"handleAnnotationCreated",(t,e)=>this._emitter.emit("createAnnotation",t.underlying,e));P(this,"handleAnnotationDeleted",t=>this._emitter.emit("deleteAnnotation",t.underlying));P(this,"handleAnnotationSelected",(t,e)=>this._emitter.emit("selectAnnotation",t.underlying,e));P(this,"handleAnnotationUpdated",(t,e)=>this._emitter.emit("updateAnnotation",t.underlying,e.underlying));P(this,"handleCancelSelected",t=>this._emitter.emit("cancelSelected",t.underlying));P(this,"handleClickAnnotation",(t,e)=>this._emitter.emit("clickAnnotation",t.underlying,e));P(this,"handleLoad",t=>this._emitter.emit("load",t));P(this,"handleSelectionCreated",t=>this._emitter.emit("createSelection",t.underlying));P(this,"handleSelectionStarted",t=>this._emitter.emit("startSelection",t));P(this,"handleSelectionEnded",t=>this._emitter.emit("endSelection",t));P(this,"handleSelectionTargetChanged",t=>this._emitter.emit("changeSelectionTarget",t));P(this,"handleMouseEnterAnnotation",(t,e)=>this._emitter.emit("mouseEnterAnnotation",t.underlying,e));P(this,"handleMouseLeaveAnnotation",(t,e)=>this._emitter.emit("mouseLeaveAnnotation",t.underlying,e));P(this,"_wrap",t=>(t==null?void 0:t.type)==="Annotation"?new St(t):t);P(this,"addAnnotation",t=>this._app.current.addAnnotation(new St(t)));P(this,"addDrawingTool",t=>this._app.current.addDrawingTool(t));P(this,"cancelSelected",()=>this._app.current.cancelSelected());P(this,"clearAnnotations",()=>this.setAnnotations([]));P(this,"clearAuthInfo",()=>this._env.user=null);P(this,"destroy",()=>k.unmountComponentAtNode(this.appContainerEl));P(this,"fitBounds",(t,e)=>this._app.current.fitBounds(this._wrap(t),e));P(this,"fitBoundsWithConstraints",(t,e)=>this._app.current.fitBoundsWithConstraints(this._wrap(t),e));P(this,"getAnnotationById",t=>{const e=this._app.current.getAnnotationById(t);return e==null?void 0:e.underlying});P(this,"getAnnotations",()=>this._app.current.getAnnotations().map(e=>e.underlying));P(this,"getAnnotationsIntersecting",t=>this._app.current.getAnnotationsIntersecting(this._wrap(t)));P(this,"getImageSnippetById",t=>this._app.current.getImageSnippetById(t));P(this,"getSelected",()=>{const t=this._app.current.getSelected();return t==null?void 0:t.underlying});P(this,"getSelectedImageSnippet",()=>this._app.current.getSelectedImageSnippet());P(this,"listDrawingTools",()=>this._app.current.listDrawingTools());P(this,"loadAnnotations",t=>fetch(t).then(e=>e.json()).then(e=>(this.setAnnotations(e),e)));P(this,"off",(t,e)=>this._emitter.off(t,e));P(this,"on",(t,e)=>this._emitter.on(t,e));P(this,"once",(t,e)=>this._emitter.once(t,e));P(this,"panTo",(t,e)=>this._app.current.panTo(this._wrap(t),e));P(this,"removeAnnotation",t=>this._app.current.removeAnnotation(this._wrap(t)));P(this,"removeDrawingTool",t=>this._app.current.removeDrawingTool(t));P(this,"saveSelected",()=>this._app.current.saveSelected());P(this,"selectAnnotation",t=>{const e=this._app.current.selectAnnotation(this._wrap(t));return e==null?void 0:e.underlying});P(this,"setAnnotations",t=>{const n=(t||[]).map(r=>new St(r));this._app.current.setAnnotations(n)});P(this,"setAuthInfo",t=>this._env.user=t);P(this,"setDrawingEnabled",t=>this._app.current.setDrawingEnabled(t));P(this,"setDrawingTool",t=>this._app.current.setDrawingTool(t));P(this,"setServerTime",t=>this._env.setServerTime(t));P(this,"setVisible",t=>this._app.current.setVisible(t));P(this,"updateSelected",(t,e)=>{let n=null;t.type==="Annotation"?n=new St(t):t.type==="Selection"&&(n=new Wn(t.target,t.body)),n&&this._app.current.updateSelected(n,e)});const n=e||{};this._app=k.createRef(),this._emitter=new Qn,this._env=EE(),this._element=t.element,window.getComputedStyle(this._element).getPropertyValue("position")==="static"&&(this._element.style.position="relative"),xE(n.locale,n.messages),this.appContainerEl=document.createElement("DIV"),this._element.appendChild(this.appContainerEl),k.render(td(Ax,{ref:this._app,viewer:t,wrapperEl:this._element,config:n,env:this._env,onSelectionStarted:this.handleSelectionStarted,onSelectionEnded:this.handleSelectionEnded,onSelectionCreated:this.handleSelectionCreated,onSelectionTargetChanged:this.handleSelectionTargetChanged,onAnnotationCreated:this.handleAnnotationCreated,onAnnotationSelected:this.handleAnnotationSelected,onAnnotationUpdated:this.handleAnnotationUpdated,onAnnotationDeleted:this.handleAnnotationDeleted,onCancelSelected:this.handleCancelSelected,onClickAnnotation:this.handleClickAnnotation,onLoad:this.handleLoad,onMouseEnterAnnotation:this.handleMouseEnterAnnotation,onMouseLeaveAnnotation:this.handleMouseLeaveAnnotation}),this.appContainerEl)}get disableEditor(){return this._app.current.disableEditor}set disableEditor(t){this._app.current.disableEditor=t}get disableSelect(){return this._app.current.disableSelect}set disableSelect(t){this._app.current.disableSelect=t}get formatters(){return this._app.current.formatters||[]}set formatters(t){if(t){const e=Array.isArray(t)?t:[t];this._app.current.formatters=e}else this._app.current.formatters=null}get readOnly(){return this._app.current.readOnly}set readOnly(t){this._app.current.readOnly=t}get widgets(){return this._app.current.widgets}set widgets(t){this._app.current.widgets=t}}var Dx=(i,t)=>new Ox(i,t);return Dx}); -//# sourceMappingURL=annotorious-openseadragon.umd.js.map +/*! For license information please see openseadragon-annotorious.min.js.LICENSE.txt */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("openseadragon")):"function"==typeof define&&define.amd?define(["openseadragon"],t):"object"==typeof exports?exports.OpenSeadragon=t(require("openseadragon")):(e.OpenSeadragon=e.OpenSeadragon||{},e.OpenSeadragon.Annotorious=t(e.OpenSeadragon))}(self,(e=>(()=>{var t={3094:e=>{"use strict";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},t(e)}e.exports=function e(n,r){if(n===r)return!0;if(n&&r&&"object"==t(n)&&"object"==t(r)){if(n.constructor!==r.constructor)return!1;var o,i,a;if(Array.isArray(n)){if((o=n.length)!=r.length)return!1;for(i=o;0!=i--;)if(!e(n[i],r[i]))return!1;return!0}if(n.constructor===RegExp)return n.source===r.source&&n.flags===r.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===r.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===r.toString();if((o=(a=Object.keys(n)).length)!==Object.keys(r).length)return!1;for(i=o;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,a[i]))return!1;for(i=o;0!=i--;){var u=a[i];if(!e(n[u],r[u]))return!1}return!0}return n!=n&&r!=r}},4741:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Children:()=>Ee,Component:()=>g,Fragment:()=>b,PureComponent:()=>ge,StrictMode:()=>it,Suspense:()=>Pe,SuspenseList:()=>Te,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>Ze,cloneElement:()=>et,createContext:()=>V,createElement:()=>m,createFactory:()=>Ke,createPortal:()=>Ne,createRef:()=>v,default:()=>at,findDOMNode:()=>nt,flushSync:()=>ot,forwardRef:()=>_e,hydrate:()=>Ve,isValidElement:()=>Qe,lazy:()=>ke,memo:()=>Se,render:()=>Fe,unmountComponentAtNode:()=>tt,unstable_batchedUpdates:()=>rt,useCallback:()=>ae,useContext:()=>ue,useDebugValue:()=>se,useEffect:()=>te,useErrorBoundary:()=>le,useImperativeHandle:()=>oe,useLayoutEffect:()=>ne,useMemo:()=>ie,useReducer:()=>ee,useRef:()=>re,useState:()=>Q,version:()=>Je});var r,o,i,a,u,s,l,c={},f=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function d(e,t){for(var n in t)e[n]=t[n];return e}function y(e){var t=e.parentNode;t&&t.removeChild(e)}function m(e,t,n){var o,i,a,u={};for(a in t)"key"==a?o=t[a]:"ref"==a?i=t[a]:u[a]=t[a];if(arguments.length>2&&(u.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===u[a]&&(u[a]=e.defaultProps[a]);return h(e,u,o,i,null)}function h(e,t,n,r,a){var u={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==a?++i:a};return null==a&&null!=o.vnode&&o.vnode(u),u}function v(){return{current:null}}function b(e){return e.children}function g(e,t){this.props=e,this.context=t}function S(e,t){if(null==t)return e.__?S(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t0?h(m.type,m.props,m.key,null,m.__v):m)){if(m.__=n,m.__b=n.__b+1,null===(y=O[p])||y&&m.key==y.key&&m.type===y.type)O[p]=void 0;else for(d=0;d<_;d++){if((y=O[d])&&m.key==y.key&&m.type===y.type){O[d]=void 0;break}y=null}D(e,m,y=y||c,o,i,a,u,s,l),v=m.__e,(d=m.ref)&&y.ref!=d&&(w||(w=[]),y.ref&&w.push(y.ref,null,m),w.push(d,m.__c||v,m)),null!=v?(null==g&&(g=v),"function"==typeof m.type&&m.__k===y.__k?m.__d=s=E(m,s,e):s=j(e,m,y,O,v,s),"function"==typeof n.type&&(n.__d=s)):s&&y.__e==s&&s.parentNode!=e&&(s=S(y))}for(n.__e=g,p=_;p--;)null!=O[p]&&("function"==typeof n.type&&null!=O[p].__e&&O[p].__e==n.__d&&(n.__d=S(r,p+1)),I(O[p],O[p]));if(w)for(p=0;p2&&(u.children=arguments.length>3?r.call(arguments,2):n),h(e.type,u,o||e.key,i||e.ref,null)}function V(e,t){var n={__c:t="__cC"+l++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(O)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=f.slice,o={__e:function(e,t){for(var n,r,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e),o=n.__d),o)return n.__E=n}catch(t){e=t}throw e}},i=0,g.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof e&&(e=e(d({},n),this.props)),e&&d(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),O(this))},g.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),O(this))},g.prototype.render=b,a=[],u="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_.__r=0,l=0;var H,z,W,$=0,Y=[],X=o.__b,G=o.__r,q=o.diffed,Z=o.__c,J=o.unmount;function K(e,t){o.__h&&o.__h(z,e,$||t),$=0;var n=z.__H||(z.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Q(e){return $=1,ee(me,e)}function ee(e,t,n){var r=K(H++,2);return r.t=e,r.__c||(r.__=[n?n(t):me(void 0,t),function(e){var t=r.t(r.__[0],e);r.__[0]!==t&&(r.__=[t,r.__[1]],r.__c.setState({}))}],r.__c=z),r.__}function te(e,t){var n=K(H++,3);!o.__s&&ye(n.__H,t)&&(n.__=e,n.__H=t,z.__H.__h.push(n))}function ne(e,t){var n=K(H++,4);!o.__s&&ye(n.__H,t)&&(n.__=e,n.__H=t,z.__h.push(n))}function re(e){return $=5,ie((function(){return{current:e}}),[])}function oe(e,t,n){$=6,ne((function(){"function"==typeof e?e(t()):e&&(e.current=t())}),null==n?n:n.concat(e))}function ie(e,t){var n=K(H++,7);return ye(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ae(e,t){return $=8,ie((function(){return e}),t)}function ue(e){var t=z.context[e.__c],n=K(H++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(z)),t.props.value):e.__}function se(e,t){o.useDebugValue&&o.useDebugValue(t?t(e):e)}function le(e){var t=K(H++,10),n=Q();return t.__=e,z.componentDidCatch||(z.componentDidCatch=function(e){t.__&&t.__(e),n[1](e)}),[n[0],function(){n[1](void 0)}]}function ce(){var e;for(Y.sort((function(e,t){return e.__v.__b-t.__v.__b}));e=Y.pop();)if(e.__P)try{e.__H.__h.forEach(pe),e.__H.__h.forEach(de),e.__H.__h=[]}catch(t){e.__H.__h=[],o.__e(t,e.__v)}}o.__b=function(e){z=null,X&&X(e)},o.__r=function(e){G&&G(e),H=0;var t=(z=e.__c).__H;t&&(t.__h.forEach(pe),t.__h.forEach(de),t.__h=[])},o.diffed=function(e){q&&q(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==Y.push(t)&&W===o.requestAnimationFrame||((W=o.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),fe&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);fe&&(t=requestAnimationFrame(n))})(ce)),z=null},o.__c=function(e,t){t.some((function(e){try{e.__h.forEach(pe),e.__h=e.__h.filter((function(e){return!e.__||de(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],o.__e(n,e.__v)}})),Z&&Z(e,t)},o.unmount=function(e){J&&J(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{pe(e)}catch(e){t=e}})),t&&o.__e(t,n.__v))};var fe="function"==typeof requestAnimationFrame;function pe(e){var t=z,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),z=t}function de(e){var t=z;e.__c=e.__(),z=t}function ye(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function me(e,t){return"function"==typeof t?t(e):t}function he(e){return he="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},he(e)}function ve(e,t){for(var n in t)e[n]=t[n];return e}function be(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}function ge(e){this.props=e}function Se(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:be(this.props,e)}function r(t){return this.shouldComponentUpdate=n,m(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(ge.prototype=new g).isPureReactComponent=!0,ge.prototype.shouldComponentUpdate=function(e,t){return be(this.props,e)||be(this.state,t)};var we=o.__b;o.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),we&&we(e)};var Oe="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function _e(e){function t(t,n){var r=ve({},t);return delete r.ref,e(r,(n=t.ref||n)&&("object"!=he(n)||"current"in n)?n:null)}return t.$$typeof=Oe,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Ae=function(e,t){return null==e?null:x(x(e).map(t))},Ee={map:Ae,forEach:Ae,count:function(e){return e?x(e).length:0},only:function(e){var t=x(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:x},xe=o.__e;o.__e=function(e,t,n){if(e.then)for(var r,o=t;o=o.__;)if((r=o.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);xe(e,t,n)};var je=o.unmount;function Pe(){this.__u=0,this.t=null,this.__b=null}function Ce(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function ke(e){var t,n,r;function o(o){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return m(n,o)}return o.displayName="Lazy",o.__f=!0,o}function Te(){this.u=null,this.o=null}o.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),je&&je(e)},(Pe.prototype=new g).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=Ce(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(u):u())};n.__R=a;var u=function(){if(!--r.__u){if(r.state.__e){var e=r.state.__e;r.__v.__k[0]=function e(t,n,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)})),t.__c&&t.__c.__P===n&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate()}},s=!0===t.__h;r.__u++||s||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(a,a)},Pe.prototype.componentWillUnmount=function(){this.t=[]},Pe.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=ve({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)}))),t}(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__e&&m(b,null,e.fallback);return o&&(o.__h=null),[m(b,null,t.__e?null:e.children),o]};var De=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.i.removeChild(e)}}),B(m(Me,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function Ne(e,t){return m(Re,{__v:e,i:t})}(Te.prototype=new g).__e=function(e){var t=this,n=Ce(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),De(t,e,r)):o()};n?n(i):i()}},Te.prototype.render=function(e){this.u=null,this.o=new Map;var t=x(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},Te.prototype.componentDidUpdate=Te.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){De(e,n,t)}))};var Ie="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Le=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Be="undefined"!=typeof document,Ue=function(e){return("undefined"!=typeof Symbol&&"symbol"==he(Symbol())?/fil|che|rad/i:/fil|che|ra/i).test(e)};function Fe(e,t,n){return null==t.__k&&(t.textContent=""),B(e,t),"function"==typeof n&&n(),e?e.__c:null}function Ve(e,t,n){return U(e,t),"function"==typeof n&&n(),e?e.__c:null}g.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(g.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var He=o.event;function ze(){}function We(){return this.cancelBubble}function $e(){return this.defaultPrevented}o.event=function(e){return He&&(e=He(e)),e.persist=ze,e.isPropagationStopped=We,e.isDefaultPrevented=$e,e.nativeEvent=e};var Ye,Xe={configurable:!0,get:function(){return this.class}},Ge=o.vnode;o.vnode=function(e){var t=e.type,n=e.props,r=n;if("string"==typeof t){var o=-1===t.indexOf("-");for(var i in r={},n){var a=n[i];Be&&"children"===i&&"noscript"===t||"value"===i&&"defaultValue"in n&&null==a||("defaultValue"===i&&"value"in n&&null==n.value?i="value":"download"===i&&!0===a?a="":/ondoubleclick/i.test(i)?i="ondblclick":/^onchange(textarea|input)/i.test(i+t)&&!Ue(n.type)?i="oninput":/^onfocus$/i.test(i)?i="onfocusin":/^onblur$/i.test(i)?i="onfocusout":/^on(Ani|Tra|Tou|BeforeInp)/.test(i)?i=i.toLowerCase():o&&Le.test(i)?i=i.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===a&&(a=void 0),r[i]=a)}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=x(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=x(n.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r,n.class!=n.className&&(Xe.enumerable="className"in n,null!=n.className&&(r.class=n.className),Object.defineProperty(r,"className",Xe))}e.$$typeof=Ie,Ge&&Ge(e)};var qe=o.__r;o.__r=function(e){qe&&qe(e),Ye=e.__c};var Ze={ReactCurrentDispatcher:{current:{readContext:function(e){return Ye.__n[e.__c].props.value}}}},Je="17.0.2";function Ke(e){return m.bind(null,e)}function Qe(e){return!!e&&e.$$typeof===Ie}function et(e){return Qe(e)?F.apply(null,arguments):e}function tt(e){return!!e.__k&&(B(null,e),!0)}function nt(e){return e&&(e.base||1===e.nodeType&&e)||null}var rt=function(e,t){return e(t)},ot=function(e,t){return e(t)},it=b;const at={useState:Q,useReducer:ee,useEffect:te,useLayoutEffect:ne,useRef:re,useImperativeHandle:oe,useMemo:ie,useCallback:ae,useContext:ue,useDebugValue:se,version:"17.0.2",Children:Ee,render:Fe,hydrate:Ve,unmountComponentAtNode:tt,createPortal:Ne,createElement:m,createContext:V,createFactory:Ke,cloneElement:et,createRef:v,Fragment:b,isValidElement:Qe,findDOMNode:nt,Component:g,PureComponent:ge,memo:Se,forwardRef:_e,flushSync:ot,unstable_batchedUpdates:rt,StrictMode:b,Suspense:Pe,SuspenseList:Te,lazy:ke,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Ze}},7072:function(e,t,n){var r,o,i;function a(e){return a="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},a(e)}i=function(){"use strict";function e(e,r,o,i,a){!function e(n,r,o,i,a){for(;i>o;){if(i-o>600){var u=i-o+1,s=r-o+1,l=Math.log(u),c=.5*Math.exp(2*l/3),f=.5*Math.sqrt(l*c*(u-c)/u)*(s-u/2<0?-1:1);e(n,r,Math.max(o,Math.floor(r-s*c/u+f)),Math.min(i,Math.floor(r+(u-s)*c/u+f)),a)}var p=n[r],d=o,y=i;for(t(n,o,r),a(n[i],p)>0&&t(n,o,i);d0;)y--}0===a(n[o],p)?t(n,o,y):t(n,++y,i),y<=r&&(o=y+1),r<=y&&(i=y-1)}}(e,r,o||0,i||e.length-1,a||n)}function t(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function n(e,t){return et?1:0}var r=function(e){void 0===e&&(e=9),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(e,t,n){if(!n)return t.indexOf(e);for(var r=0;r=e.minX&&t.maxY>=e.minY}function y(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(t,n,r,o,i){for(var a=[n,r];a.length;)if(!((r=a.pop())-(n=a.pop())<=o)){var u=n+Math.ceil((r-n)/o/2)*o;e(t,u,n,r,i),a.push(n,u,u,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(e){var t=this.data,n=[];if(!d(e,t))return n;for(var r=this.toBBox,o=[];t;){for(var i=0;i=0&&o[t].children.length>this._maxEntries;)this._split(o,t),t--;this._adjustParentBBoxes(r,o,t)},r.prototype._split=function(e,t){var n=e[t],r=n.children.length,o=this._minEntries;this._chooseSplitAxis(n,o,r);var a=this._chooseSplitIndex(n,o,r),u=y(n.children.splice(a,n.children.length-a));u.height=n.height,u.leaf=n.leaf,i(n,this.toBBox),i(u,this.toBBox),t?e[t-1].children.push(u):this._splitRoot(n,u)},r.prototype._splitRoot=function(e,t){this.data=y([e,t]),this.data.height=e.height+1,this.data.leaf=!1,i(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(e,t,n){for(var r,o,i,u,s,l,f,p=1/0,d=1/0,y=t;y<=n-t;y++){var m=a(e,0,y,this.toBBox),h=a(e,y,n,this.toBBox),v=(o=m,i=h,u=Math.max(o.minX,i.minX),s=Math.max(o.minY,i.minY),l=Math.min(o.maxX,i.maxX),f=Math.min(o.maxY,i.maxY),Math.max(0,l-u)*Math.max(0,f-s)),b=c(m)+c(h);v=t;d--){var y=e.children[d];u(s,e.leaf?o(y):y),l+=f(s)}return l},r.prototype._adjustParentBBoxes=function(e,t,n){for(var r=n;r>=0;r--)u(t[r],e)},r.prototype._condense=function(e){for(var t=e.length-1,n=void 0;t>=0;t--)0===e[t].children.length?t>0?(n=e[t-1].children).splice(n.indexOf(e[t]),1):this.clear():i(e[t],this.toBBox)},r},"object"==a(t)?e.exports=i():void 0===(o="function"==typeof(r=i)?r.call(t,n,t,e):r)||(e.exports=o)},8773:e=>{function t(){}t.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{"use strict";var r=n(5252),o=n(408),i=r("%TypeError%"),a=n(7589),u=n(8257),s=n(1736),l=n(536),c=n(1552),f=n(5429),p=n(9365),d=n(7927),y=o("String.prototype.split"),m=Object("a"),h="a"!==m[0]||!(0 in m);e.exports=function(e){var t,n=f(this),r=h&&d(this)?y(this,""):n,o=c(r);if(!l(e))throw new i("Array.prototype.forEach callback must be a function");arguments.length>1&&(t=arguments[1]);for(var m=0;m{"use strict";var r=n(1722),o=n(9935),i=n(408),a=n(1120),u=n(6521),s=n(9574),l=s(),c=n(8200),f=i("Array.prototype.slice"),p=o.apply(l),d=function(e,t){return a(e),p(e,f(arguments,1))};r(d,{getPolyfill:s,implementation:u,shim:c}),e.exports=d},9574:(e,t,n)=>{"use strict";var r=n(3250),o=n(6521);e.exports=function(){var e=Array.prototype.forEach;return r(e)?e:o}},8200:(e,t,n)=>{"use strict";var r=n(1722),o=n(9574);e.exports=function(){var e=o();return r(Array.prototype,{forEach:e},{forEach:function(){return Array.prototype.forEach!==e}}),e}},5263:function(e,t){var n,r;n=function(e,t){"use strict";var n,r,o="function"==typeof Map?new Map:(n=[],r=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return r[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),r.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),r.splice(t,1))}}),i=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){i=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function a(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!o.has(e)){var t=null,n=null,r=null,a=function(){e.clientWidth!==n&&f()},u=function(t){window.removeEventListener("resize",a,!1),e.removeEventListener("input",f,!1),e.removeEventListener("keyup",f,!1),e.removeEventListener("autosize:destroy",u,!1),e.removeEventListener("autosize:update",f,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),o.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",u,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",f,!1),window.addEventListener("resize",a,!1),e.addEventListener("input",f,!1),e.addEventListener("autosize:update",f,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",o.set(e,{destroy:u,update:f}),"vertical"===(s=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===s.resize&&(e.style.resize="horizontal"),t="content-box"===s.boxSizing?-(parseFloat(s.paddingTop)+parseFloat(s.paddingBottom)):parseFloat(s.borderTopWidth)+parseFloat(s.borderBottomWidth),isNaN(t)&&(t=0),f()}var s;function l(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function c(){if(0!==e.scrollHeight){var r=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),o=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,r.forEach((function(e){e.node.scrollTop=e.scrollTop})),o&&(document.documentElement.scrollTop=o)}}function f(){c();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),o="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(o{"use strict";var r=n(5252),o=n(9935),i=o(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&i(e,".prototype.")>-1?o(n):n}},9935:(e,t,n)=>{"use strict";var r=n(4974),o=n(5252),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),u=o("%Reflect.apply%",!0)||r.call(a,i),s=o("%Object.getOwnPropertyDescriptor%",!0),l=o("%Object.defineProperty%",!0),c=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function(e){var t=u(r,a,arguments);return s&&l&&s(t,"length").configurable&&l(t,"length",{value:1+c(0,e.length-(arguments.length-1))}),t};var f=function(){return u(r,i,arguments)};l?l(e.exports,"apply",{value:f}):e.exports.apply=f},8247:(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},r(e)}function o(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"===r(e))if(Array.isArray(e))for(t=0;ti})},6161:e=>{e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},1722:(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},r(e)}var o=n(7437),i="function"==typeof Symbol&&"symbol"===r(Symbol("foo")),a=Object.prototype.toString,u=Array.prototype.concat,s=Object.defineProperty,l=s&&function(){var e={};try{for(var t in s(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(e){return!1}}(),c=function(e,t,n,r){var o;(!(t in e)||"function"==typeof(o=r)&&"[object Function]"===a.call(o)&&r())&&(l?s(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n)},f=function(e,t){var n=arguments.length>2?arguments[2]:{},r=o(t);i&&(r=u.call(r,Object.getOwnPropertySymbols(t)));for(var a=0;a{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},t(e)}e.exports=function(e){var n=!0,r=!0,o=!1;if("function"==typeof e){try{e.call("f",(function(e,r,o){"object"!==t(o)&&(n=!1)})),e.call([null],(function(){"use strict";r="string"==typeof this}),"x")}catch(e){o=!0}return!o&&n&&r}return!1}},3386:(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},r(e)}var o="function"==typeof Symbol&&"symbol"===r(Symbol.iterator),i=n(359),a=n(5600),u=n(9449),s=n(5912);e.exports=function(e){if(i(e))return e;var t,n="default";if(arguments.length>1&&(arguments[1]===String?n="string":arguments[1]===Number&&(n="number")),o&&(Symbol.toPrimitive?t=function(e,t){var n=e[t];if(null!=n){if(!a(n))throw new TypeError(n+" returned for property "+t+" of object "+e+" is not a function");return n}}(e,Symbol.toPrimitive):s(e)&&(t=Symbol.prototype.valueOf)),void 0!==t){var r=t.call(e,n);if(i(r))return r;throw new TypeError("unable to convert exotic object to primitive")}return"default"===n&&(u(e)||s(e))&&(n="string"),function(e,t){if(null==e)throw new TypeError("Cannot call method on "+e);if("string"!=typeof t||"number"!==t&&"string"!==t)throw new TypeError('hint must be "string" or "number"');var n,r,o,u="string"===t?["toString","valueOf"]:["valueOf","toString"];for(o=0;o{"use strict";var r=Object.prototype.toString,o=n(359),i=n(5600),a=function(e){var t;if((t=arguments.length>1?arguments[1]:"[object Date]"===r.call(e)?String:Number)===String||t===Number){var n,a,u=t===String?["toString","valueOf"]:["valueOf","toString"];for(a=0;a1?a(e,arguments[1]):a(e)}},359:e=>{"use strict";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},t(e)}e.exports=function(e){return null===e||"function"!=typeof e&&"object"!==t(e)}},286:e=>{"use strict";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},t(e)}e.exports=function e(n,r){if(n===r)return!0;if(n&&r&&"object"==t(n)&&"object"==t(r)){if(n.constructor!==r.constructor)return!1;var o,i,a;if(Array.isArray(n)){if((o=n.length)!=r.length)return!1;for(i=o;0!=i--;)if(!e(n[i],r[i]))return!1;return!0}if(n.constructor===RegExp)return n.source===r.source&&n.flags===r.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===r.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===r.toString();if((o=(a=Object.keys(n)).length)!==Object.keys(r).length)return!1;for(i=o;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,a[i]))return!1;for(i=o;0!=i--;){var u=a[i];if(!e(n[u],r[u]))return!1}return!0}return n!=n&&r!=r}},4315:e=>{"use strict";var t=Array.prototype.slice,n=Object.prototype.toString;e.exports=function(e){var r=this;if("function"!=typeof r||"[object Function]"!==n.call(r))throw new TypeError("Function.prototype.bind called on incompatible "+r);for(var o,i=t.call(arguments,1),a=Math.max(0,r.length-i.length),u=[],s=0;s{"use strict";var r=n(4315);e.exports=Function.prototype.bind||r},5252:(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},r(e)}var o,i=SyntaxError,a=Function,u=TypeError,s=function(e){try{return a('"use strict"; return ('+e+").constructor;")()}catch(e){}},l=Object.getOwnPropertyDescriptor;if(l)try{l({},"")}catch(e){l=null}var c=function(){throw new u},f=l?function(){try{return c}catch(e){try{return l(arguments,"callee").get}catch(e){return c}}}():c,p=n(8462)(),d=Object.getPrototypeOf||function(e){return e.__proto__},y={},m="undefined"==typeof Uint8Array?o:d(Uint8Array),h={"%AggregateError%":"undefined"==typeof AggregateError?o:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?o:ArrayBuffer,"%ArrayIteratorPrototype%":p?d([][Symbol.iterator]()):o,"%AsyncFromSyncIteratorPrototype%":o,"%AsyncFunction%":y,"%AsyncGenerator%":y,"%AsyncGeneratorFunction%":y,"%AsyncIteratorPrototype%":y,"%Atomics%":"undefined"==typeof Atomics?o:Atomics,"%BigInt%":"undefined"==typeof BigInt?o:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?o:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?o:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?o:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?o:FinalizationRegistry,"%Function%":a,"%GeneratorFunction%":y,"%Int8Array%":"undefined"==typeof Int8Array?o:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?o:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?o:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p?d(d([][Symbol.iterator]())):o,"%JSON%":"object"===("undefined"==typeof JSON?"undefined":r(JSON))?JSON:o,"%Map%":"undefined"==typeof Map?o:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&p?d((new Map)[Symbol.iterator]()):o,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?o:Promise,"%Proxy%":"undefined"==typeof Proxy?o:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?o:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?o:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&p?d((new Set)[Symbol.iterator]()):o,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?o:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p?d(""[Symbol.iterator]()):o,"%Symbol%":p?Symbol:o,"%SyntaxError%":i,"%ThrowTypeError%":f,"%TypedArray%":m,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?o:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?o:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?o:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?o:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?o:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?o:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?o:WeakSet},v=function e(t){var n;if("%AsyncFunction%"===t)n=s("async function () {}");else if("%GeneratorFunction%"===t)n=s("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=s("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(n=d(o.prototype))}return h[t]=n,n},b={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},g=n(4974),S=n(6205),w=g.call(Function.call,Array.prototype.concat),O=g.call(Function.apply,Array.prototype.splice),_=g.call(Function.call,String.prototype.replace),A=g.call(Function.call,String.prototype.slice),E=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,x=/\\(\\)?/g,j=function(e,t){var n,r=e;if(S(b,r)&&(r="%"+(n=b[r])[0]+"%"),S(h,r)){var o=h[r];if(o===y&&(o=v(r)),void 0===o&&!t)throw new u("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new u('"allowMissing" argument must be a boolean');var n=function(e){var t=A(e,0,1),n=A(e,-1);if("%"===t&&"%"!==n)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var r=[];return _(e,E,(function(e,t,n,o){r[r.length]=n?_(o,x,"$1"):t||e})),r}(e),r=n.length>0?n[0]:"",o=j("%"+r+"%",t),a=o.name,s=o.value,c=!1,f=o.alias;f&&(r=f[0],O(n,w([0,1],f)));for(var p=1,d=!0;p=n.length){var b=l(s,y);s=(d=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:s[y]}else d=S(s,y),s=s[y];d&&!c&&(h[a]=s)}}return s}},8462:(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},r(e)}var o="undefined"!=typeof Symbol&&Symbol,i=n(2329);e.exports=function(){return"function"==typeof o&&"function"==typeof Symbol&&"symbol"===r(o("foo"))&&"symbol"===r(Symbol("bar"))&&i()}},2329:e=>{"use strict";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},t(e)}e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"===t(Symbol.iterator))return!0;var e={},n=Symbol("test"),r=Object(n);if("string"==typeof n)return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(n in e[n]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==n)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,n);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},5675:(e,t,n)=>{"use strict";var r=n(2329);e.exports=function(){return r()&&!!Symbol.toStringTag}},6205:(e,t,n)=>{"use strict";var r=n(4974);e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},4120:(e,t,n)=>{"use strict";var r=n(6050),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},u={};function s(e){return r.isMemo(e)?a:u[e.$$typeof]||o}u[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},u[r.Memo]=a;var l=Object.defineProperty,c=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,y=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(y){var o=d(n);o&&o!==y&&e(t,o,r)}var a=c(n);f&&(a=a.concat(f(n)));for(var u=s(t),m=s(n),h=0;h{"use strict";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},t(e)}var n,r,o=Function.prototype.toString,i="object"===("undefined"==typeof Reflect?"undefined":t(Reflect))&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{n=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,n)}catch(e){e!==r&&(i=null)}else i=null;var a=/^\s*class\b/,u=function(e){try{var t=o.call(e);return a.test(t)}catch(e){return!1}},s=Object.prototype.toString,l="function"==typeof Symbol&&!!Symbol.toStringTag,c="object"===("undefined"==typeof document?"undefined":t(document))&&void 0===document.all&&void 0!==document.all?document.all:{};e.exports=i?function(e){if(e===c)return!0;if(!e)return!1;if("function"!=typeof e&&"object"!==t(e))return!1;if("function"==typeof e&&!e.prototype)return!0;try{i(e,null,n)}catch(e){if(e!==r)return!1}return!u(e)}:function(e){if(e===c)return!0;if(!e)return!1;if("function"!=typeof e&&"object"!==t(e))return!1;if("function"==typeof e&&!e.prototype)return!0;if(l)return function(e){try{return!u(e)&&(o.call(e),!0)}catch(e){return!1}}(e);if(u(e))return!1;var n=s.call(e);return"[object Function]"===n||"[object GeneratorFunction]"===n}},9449:(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},r(e)}var o=Date.prototype.getDay,i=Object.prototype.toString,a=n(5675)();e.exports=function(e){return"object"===r(e)&&null!==e&&(a?function(e){try{return o.call(e),!0}catch(e){return!1}}(e):"[object Date]"===i.call(e))}},7927:(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},r(e)}var o=String.prototype.valueOf,i=Object.prototype.toString,a=n(5675)();e.exports=function(e){return"string"==typeof e||"object"===r(e)&&(a?function(e){try{return o.call(e),!0}catch(e){return!1}}(e):"[object String]"===i.call(e))}},5912:(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},r(e)}var o=Object.prototype.toString;if(n(8462)()){var i=Symbol.prototype.toString,a=/^Symbol\(.*\)$/;e.exports=function(e){if("symbol"===r(e))return!0;if("[object Symbol]"!==o.call(e))return!1;try{return function(e){return"symbol"===r(e.valueOf())&&a.test(i.call(e))}(e)}catch(e){return!1}}}else e.exports=function(e){return!1}},4482:(e,t,n)=>{var r=n(6161);e.exports=function(e){var t=r(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var o=e.style.lineHeight;e.style.lineHeight=t+"em",t=r(e,"line-height"),n=parseFloat(t,10),o?e.style.lineHeight=o:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var i=e.nodeName,a=document.createElement(i);a.innerHTML=" ","TEXTAREA"===i.toUpperCase()&&a.setAttribute("rows","1");var u=r(e,"font-size");a.style.fontSize=u,a.style.padding="0px",a.style.border="0px";var s=document.body;s.appendChild(a),n=a.offsetHeight,s.removeChild(a)}return n}},2612:(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},r(e)}var o=n(6157),i=n(3697),a=n(697),u=n(6205),s=n(4758),l=function(e){a(!1,e)},c=String.prototype.replace,f=String.prototype.split,p="||||",d=function(e){var t=e%100,n=t%10;return 11!==t&&1===n?0:2<=n&&n<=4&&!(t>=12&&t<=14)?1:2},y={pluralTypes:{arabic:function(e){if(e<3)return e;var t=e%100;return t>=3&&t<=10?3:t>=11?4:5},bosnian_serbian:d,chinese:function(){return 0},croatian:d,french:function(e){return e>=2?1:0},german:function(e){return 1!==e?1:0},russian:d,lithuanian:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=9&&(e%100<11||e%100>19)?1:2},czech:function(e){return 1===e?0:e>=2&&e<=4?1:2},polish:function(e){if(1===e)return 0;var t=e%10;return 2<=t&&t<=4&&(e%100<10||e%100>=20)?1:2},icelandic:function(e){return e%10!=1||e%100==11?1:0},slovenian:function(e){var t=e%100;return 1===t?0:2===t?1:3===t||4===t?2:3}},pluralTypeToLanguages:{arabic:["ar"],bosnian_serbian:["bs-Latn-BA","bs-Cyrl-BA","srl-RS","sr-RS"],chinese:["id","id-ID","ja","ko","ko-KR","lo","ms","th","th-TH","zh"],croatian:["hr","hr-HR"],german:["fa","da","de","en","es","fi","el","he","hi-IN","hu","hu-HU","it","nl","no","pt","sv","tr"],french:["fr","tl","pt-br"],russian:["ru","ru-RU"],lithuanian:["lt"],czech:["cs","cs-CZ","sk"],polish:["pl"],icelandic:["is"],slovenian:["sl-SL"]}};function m(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var h,v=(h={},function(e,t){var n=h[t];return n&&!e.pluralTypes[n]&&(n=null,h[t]=n),n||(n=function(e,t){var n,r,a=(n=e.pluralTypeToLanguages,r={},o(i(n),(function(e){var t=e[0],n=e[1];o(n,(function(e){r[e]=t}))})),r);return a[t]||a[f.call(t,/-/,1)[0]]||a.en}(e,t))&&(h[t]=n),n}),b=/%\{(.*?)\}/g;function g(e,t,n,r,o){if("string"!=typeof e)throw new TypeError("Polyglot.transformPhrase expects argument #1 to be string");if(null==t)return e;var i=e,a=r||b,l="number"==typeof t?{smart_count:t}:t;if(null!=l.smart_count&&e){var d=o||y,m=f.call(e,p),h=function(e,t,n){return e.pluralTypes[t](n)}(d,v(d,n||"en"),l.smart_count);i=s(m[h]||m[0])}return c.call(i,a,(function(e,t){return u(l,t)&&null!=l[t]?l[t]:e}))}function S(e){var t=e||{};this.phrases={},this.extend(t.phrases||{}),this.currentLocale=t.locale||"en";var n=t.allowMissing?g:null;this.onMissingKey="function"==typeof t.onMissingKey?t.onMissingKey:n,this.warn=t.warn||l,this.tokenRegex=function(e){var t=e&&e.prefix||"%{",n=e&&e.suffix||"}";if(t===p||n===p)throw new RangeError('"'+p+'" token is reserved for pluralization');return new RegExp(m(t)+"(.*?)"+m(n),"g")}(t.interpolation),this.pluralRules=t.pluralRules||y}S.prototype.locale=function(e){return e&&(this.currentLocale=e),this.currentLocale},S.prototype.extend=function(e,t){o(i(e||{}),(function(e){var n=e[0],o=e[1],i=t?t+"."+n:n;"object"===r(o)?this.extend(o,i):this.phrases[i]=o}),this)},S.prototype.unset=function(e,t){"string"==typeof e?delete this.phrases[e]:o(i(e||{}),(function(e){var n=e[0],o=e[1],i=t?t+"."+n:n;"object"===r(o)?this.unset(o,i):delete this.phrases[i]}),this)},S.prototype.clear=function(){this.phrases={}},S.prototype.replace=function(e){this.clear(),this.extend(e)},S.prototype.t=function(e,t){var n,r,o=null==t?{}:t;return"string"==typeof this.phrases[e]?n=this.phrases[e]:"string"==typeof o._?n=o._:this.onMissingKey?r=(0,this.onMissingKey)(e,o,this.currentLocale,this.tokenRegex,this.pluralRules):(this.warn('Missing translation for key: "'+e+'"'),r=e),"string"==typeof n&&(r=g(n,o,this.currentLocale,this.tokenRegex,this.pluralRules)),r},S.prototype.has=function(e){return u(this.phrases,e)},S.transformPhrase=function(e,t,n){return g(e,t,n)},e.exports=S},7147:(e,t,n)=>{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},r(e)}var o="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,a=o&&i&&"function"==typeof i.get?i.get:null,u=o&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=s&&l&&"function"==typeof l.get?l.get:null,f=s&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,m=Boolean.prototype.valueOf,h=Object.prototype.toString,v=Function.prototype.toString,b=String.prototype.match,g="function"==typeof BigInt?BigInt.prototype.valueOf:null,S=Object.getOwnPropertySymbols,w="function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?Symbol.prototype.toString:null,O="function"==typeof Symbol&&"object"===r(Symbol.iterator),_=Object.prototype.propertyIsEnumerable,A=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null),E=n(6003).custom,x=E&&T(E)?E:null,j="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null;function P(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function C(e){return String(e).replace(/"/g,""")}function k(e){return!("[object Array]"!==R(e)||j&&"object"===r(e)&&j in e)}function T(e){if(O)return e&&"object"===r(e)&&e instanceof Symbol;if("symbol"===r(e))return!0;if(!e||"object"!==r(e)||!w)return!1;try{return w.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,o,i){var s=n||{};if(M(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(M(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=!M(s,"customInspect")||s.customInspect;if("boolean"!=typeof l&&"symbol"!==l)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(M(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return I(t,s);if("number"==typeof t)return 0===t?1/0/t>0?"0":"-0":String(t);if("bigint"==typeof t)return String(t)+"n";var h=void 0===s.depth?5:s.depth;if(void 0===o&&(o=0),o>=h&&h>0&&"object"===r(t))return k(t)?"[Array]":"[Object]";var S,_=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=Array(e.indent+1).join(" ")}return{base:n,prev:Array(t+1).join(n)}}(s,o);if(void 0===i)i=[];else if(N(i,t)>=0)return"[Circular]";function E(t,n,r){if(n&&(i=i.slice()).push(n),r){var a={depth:s.depth};return M(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),e(t,a,o+1,i)}return e(t,s,o+1,i)}if("function"==typeof t){var D=function(e){if(e.name)return e.name;var t=b.call(v.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),L=H(t,E);return"[Function"+(D?": "+D:" (anonymous)")+"]"+(L.length>0?" { "+L.join(", ")+" }":"")}if(T(t)){var z=O?String(t).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):w.call(t);return"object"!==r(t)||O?z:B(z)}if((S=t)&&"object"===r(S)&&("undefined"!=typeof HTMLElement&&S instanceof HTMLElement||"string"==typeof S.nodeName&&"function"==typeof S.getAttribute)){for(var W="<"+String(t.nodeName).toLowerCase(),$=t.attributes||[],Y=0;Y<$.length;Y++)W+=" "+$[Y].name+"="+P(C($[Y].value),"double",s);return W+=">",t.childNodes&&t.childNodes.length&&(W+="..."),W+""}if(k(t)){if(0===t.length)return"[]";var X=H(t,E);return _&&!function(e){for(var t=0;t=0)return!1;return!0}(X)?"["+V(X,_)+"]":"[ "+X.join(", ")+" ]"}if(function(e){return!("[object Error]"!==R(e)||j&&"object"===r(e)&&j in e)}(t)){var G=H(t,E);return 0===G.length?"["+String(t)+"]":"{ ["+String(t)+"] "+G.join(", ")+" }"}if("object"===r(t)&&l){if(x&&"function"==typeof t[x])return t[x]();if("symbol"!==l&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!a||!e||"object"!==r(e))return!1;try{a.call(e);try{c.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var q=[];return u.call(t,(function(e,n){q.push(E(n,t,!0)+" => "+E(e,t))})),F("Map",a.call(t),q,_)}if(function(e){if(!c||!e||"object"!==r(e))return!1;try{c.call(e);try{a.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var Z=[];return f.call(t,(function(e){Z.push(E(e,t))})),F("Set",c.call(t),Z,_)}if(function(e){if(!p||!e||"object"!==r(e))return!1;try{p.call(e,p);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return U("WeakMap");if(function(e){if(!d||!e||"object"!==r(e))return!1;try{d.call(e,d);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return U("WeakSet");if(function(e){if(!y||!e||"object"!==r(e))return!1;try{return y.call(e),!0}catch(e){}return!1}(t))return U("WeakRef");if(function(e){return!("[object Number]"!==R(e)||j&&"object"===r(e)&&j in e)}(t))return B(E(Number(t)));if(function(e){if(!e||"object"!==r(e)||!g)return!1;try{return g.call(e),!0}catch(e){}return!1}(t))return B(E(g.call(t)));if(function(e){return!("[object Boolean]"!==R(e)||j&&"object"===r(e)&&j in e)}(t))return B(m.call(t));if(function(e){return!("[object String]"!==R(e)||j&&"object"===r(e)&&j in e)}(t))return B(E(String(t)));if(!function(e){return!("[object Date]"!==R(e)||j&&"object"===r(e)&&j in e)}(t)&&!function(e){return!("[object RegExp]"!==R(e)||j&&"object"===r(e)&&j in e)}(t)){var J=H(t,E),K=A?A(t)===Object.prototype:t instanceof Object||t.constructor===Object,Q=t instanceof Object?"":"null prototype",ee=!K&&j&&Object(t)===t&&j in t?R(t).slice(8,-1):Q?"Object":"",te=(K||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(ee||Q?"["+[].concat(ee||[],Q||[]).join(": ")+"] ":"");return 0===J.length?te+"{}":_?te+"{"+V(J,_)+"}":te+"{ "+J.join(", ")+" }"}return String(t)};var D=Object.prototype.hasOwnProperty||function(e){return e in this};function M(e,t){return D.call(e,t)}function R(e){return h.call(e)}function N(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return I(e.slice(0,t.maxStringLength),t)+r}return P(e.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,L),"single",t)}function L(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+t.toString(16).toUpperCase()}function B(e){return"Object("+e+")"}function U(e){return e+" { ? }"}function F(e,t,n,r){return e+" ("+t+") {"+(r?V(n,r):n.join(", "))+"}"}function V(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+e.join(","+n)+"\n"+t.prev}function H(e,t){var n=k(e),r=[];if(n){r.length=e.length;for(var o=0;o{"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},r(e)}var o;if(!Object.keys){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,u=n(5393),s=Object.prototype.propertyIsEnumerable,l=!s.call({toString:null},"toString"),c=s.call((function(){}),"prototype"),f=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],p=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},y=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!d["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"===r(window[e]))try{p(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();o=function(e){var t=null!==e&&"object"===r(e),n="[object Function]"===a.call(e),o=u(e),s=t&&"[object String]"===a.call(e),d=[];if(!t&&!n&&!o)throw new TypeError("Object.keys called on a non-object");var m=c&&n;if(s&&e.length>0&&!i.call(e,0))for(var h=0;h0)for(var v=0;v{"use strict";var r=Array.prototype.slice,o=n(5393),i=Object.keys,a=i?function(e){return i(e)}:n(7095),u=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return o(e)?u(r.call(e)):u(e)})}else Object.keys=a;return Object.keys||a},e.exports=a},5393:e=>{"use strict";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},t(e)}var n=Object.prototype.toString;e.exports=function(e){var r=n.call(e),o="[object Arguments]"===r;return o||(o="[object Array]"!==r&&null!==e&&"object"===t(e)&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===n.call(e.callee)),o}},8904:(e,t,n)=>{"use strict";var r=n(1120),o=n(408),i=o("Object.prototype.propertyIsEnumerable"),a=o("Array.prototype.push");e.exports=function(e){var t=r(e),n=[];for(var o in t)i(t,o)&&a(n,[o,t[o]]);return n}},3697:(e,t,n)=>{"use strict";var r=n(1722),o=n(9935),i=n(8904),a=n(2600),u=n(8435),s=o(a(),Object);r(s,{getPolyfill:a,implementation:i,shim:u}),e.exports=s},2600:(e,t,n)=>{"use strict";var r=n(8904);e.exports=function(){return"function"==typeof Object.entries?Object.entries:r}},8435:(e,t,n)=>{"use strict";var r=n(2600),o=n(1722);e.exports=function(){var e=r();return o(Object,{entries:e},{entries:function(){return Object.entries!==e}}),e}},521:(e,t,n)=>{"use strict";var r=n(7280);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},1752:(e,t,n)=>{e.exports=n(521)()},7280:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},8289:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n{"use strict";var r=n(8289);t.Z=r.TextareaAutosize},7092:(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},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return f.default}}),t.default=void 0;var o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=m(t);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var u=i?Object.getOwnPropertyDescriptor(e,a):null;u&&(u.get||u.set)?Object.defineProperty(o,a,u):o[a]=e[a]}return o.default=e,n&&n.set(e,o),o}(n(4741)),i=y(n(1752)),a=y(n(4741)),u=y(n(8247)),s=n(7693),l=n(9167),c=n(8035),f=y(n(4953)),p=y(n(8489)),d=["axis","bounds","children","defaultPosition","defaultClassName","defaultClassNameDragging","defaultClassNameDragged","position","positionOffset","scale"];function y(e){return e&&e.__esModule?e:{default:e}}function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(m=function(e){return e?n:t})(e)}function h(){return h=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element."),t}return t=v,i=[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.position,r=t.prevPropsPosition;return!n||r&&n.x===r.x&&n.y===r.y?null:((0,p.default)("Draggable: getDerivedStateFromProps %j",{position:n,prevPropsPosition:r}),{x:n.x,y:n.y,prevPropsPosition:b({},n)})}}],(n=[{key:"componentDidMount",value:function(){void 0!==window.SVGElement&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}},{key:"componentWillUnmount",value:function(){this.setState({dragging:!1})}},{key:"findDOMNode",value:function(){var e,t,n;return null!==(e=null===(t=this.props)||void 0===t||null===(n=t.nodeRef)||void 0===n?void 0:n.current)&&void 0!==e?e:a.default.findDOMNode(this)}},{key:"render",value:function(){var e,t=this.props,n=(t.axis,t.bounds,t.children),r=t.defaultPosition,i=t.defaultClassName,a=t.defaultClassNameDragging,c=t.defaultClassNameDragged,p=t.position,y=t.positionOffset,m=(t.scale,function(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;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,d)),v={},g=null,S=!Boolean(p)||this.state.dragging,w=p||r,O={x:(0,l.canDragX)(this)&&S?this.state.x:w.x,y:(0,l.canDragY)(this)&&S?this.state.y:w.y};this.state.isElementSVG?g=(0,s.createSVGTransform)(O,y):v=(0,s.createCSSTransform)(O,y);var _=(0,u.default)(n.props.className||"",i,(A(e={},a,this.state.dragging),A(e,c,this.state.dragged),e));return o.createElement(f.default,h({},m,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),o.cloneElement(o.Children.only(n),{className:_,style:b(b({},n.props.style),v),transform:g}))}}])&&S(t.prototype,n),i&&S(t,i),v}(o.Component);t.default=E,A(E,"displayName","Draggable"),A(E,"propTypes",b(b({},f.default.propTypes),{},{axis:i.default.oneOf(["both","x","y","none"]),bounds:i.default.oneOfType([i.default.shape({left:i.default.number,right:i.default.number,top:i.default.number,bottom:i.default.number}),i.default.string,i.default.oneOf([!1])]),defaultClassName:i.default.string,defaultClassNameDragging:i.default.string,defaultClassNameDragged:i.default.string,defaultPosition:i.default.shape({x:i.default.number,y:i.default.number}),positionOffset:i.default.shape({x:i.default.oneOfType([i.default.number,i.default.string]),y:i.default.oneOfType([i.default.number,i.default.string])}),position:i.default.shape({x:i.default.number,y:i.default.number}),className:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe})),A(E,"defaultProps",b(b({},f.default.defaultProps),{},{axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1}))},4953:(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},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var u=i?Object.getOwnPropertyDescriptor(e,a):null;u&&(u.get||u.set)?Object.defineProperty(o,a,u):o[a]=e[a]}return o.default=e,n&&n.set(e,o),o}(n(4741)),i=f(n(1752)),a=f(n(4741)),u=n(7693),s=n(9167),l=n(8035),c=f(n(8489));function f(e){return e&&e.__esModule?e:{default:e}}function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n not mounted on DragStart!");var r=n.ownerDocument;if(!(e.props.disabled||!(t.target instanceof r.defaultView.Node)||e.props.handle&&!(0,u.matchesSelectorAndParentsTo)(t.target,e.props.handle,n)||e.props.cancel&&(0,u.matchesSelectorAndParentsTo)(t.target,e.props.cancel,n))){"touchstart"===t.type&&t.preventDefault();var o=(0,u.getTouchIdentifier)(t);e.setState({touchIdentifier:o});var i=(0,s.getControlPosition)(t,o,h(e));if(null!=i){var a=i.x,l=i.y,f=(0,s.createCoreData)(h(e),a,l);(0,c.default)("DraggableCore: handleDragStart: %j",f),(0,c.default)("calling",e.props.onStart),!1!==e.props.onStart(t,f)&&!1!==e.mounted&&(e.props.enableUserSelectHack&&(0,u.addUserSelectStyles)(r),e.setState({dragging:!0,lastX:a,lastY:l}),(0,u.addEvent)(r,w.move,e.handleDrag),(0,u.addEvent)(r,w.stop,e.handleDragStop))}}})),b(h(e),"handleDrag",(function(t){var n,r,o=(0,s.getControlPosition)(t,e.state.touchIdentifier,h(e));if(null!=o){var i=o.x,a=o.y;if(Array.isArray(e.props.grid)){var u=i-e.state.lastX,l=a-e.state.lastY,f=(n=(0,s.snapToGrid)(e.props.grid,u,l),r=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(n,r)||function(e,t){if(e){if("string"==typeof e)return d(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(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());if(u=f[0],l=f[1],!u&&!l)return;i=e.state.lastX+u,a=e.state.lastY+l}var p=(0,s.createCoreData)(h(e),i,a);if((0,c.default)("DraggableCore: handleDrag: %j",p),!1!==e.props.onDrag(t,p)&&!1!==e.mounted)e.setState({lastX:i,lastY:a});else try{e.handleDragStop(new MouseEvent("mouseup"))}catch(t){var y=document.createEvent("MouseEvents");y.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.handleDragStop(y)}}})),b(h(e),"handleDragStop",(function(t){if(e.state.dragging){var n=(0,s.getControlPosition)(t,e.state.touchIdentifier,h(e));if(null!=n){var r=n.x,o=n.y,i=(0,s.createCoreData)(h(e),r,o);if(!1===e.props.onStop(t,i)||!1===e.mounted)return!1;var a=e.findDOMNode();a&&e.props.enableUserSelectHack&&(0,u.removeUserSelectStyles)(a.ownerDocument),(0,c.default)("DraggableCore: handleDragStop: %j",i),e.setState({dragging:!1,lastX:NaN,lastY:NaN}),a&&((0,c.default)("DraggableCore: Removing handlers"),(0,u.removeEvent)(a.ownerDocument,w.move,e.handleDrag),(0,u.removeEvent)(a.ownerDocument,w.stop,e.handleDragStop))}}})),b(h(e),"onMouseDown",(function(t){return w=S,e.handleDragStart(t)})),b(h(e),"onMouseUp",(function(t){return w=S,e.handleDragStop(t)})),b(h(e),"onTouchStart",(function(t){return w=g,e.handleDragStart(t)})),b(h(e),"onTouchEnd",(function(t){return w=g,e.handleDragStop(t)})),e}return t=p,(n=[{key:"componentDidMount",value:function(){this.mounted=!0;var e=this.findDOMNode();e&&(0,u.addEvent)(e,g.start,this.onTouchStart,{passive:!1})}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var e=this.findDOMNode();if(e){var t=e.ownerDocument;(0,u.removeEvent)(t,S.move,this.handleDrag),(0,u.removeEvent)(t,g.move,this.handleDrag),(0,u.removeEvent)(t,S.stop,this.handleDragStop),(0,u.removeEvent)(t,g.stop,this.handleDragStop),(0,u.removeEvent)(e,g.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,u.removeUserSelectStyles)(t)}}},{key:"findDOMNode",value:function(){var e,t,n;return null!==(e=null===(t=this.props)||void 0===t||null===(n=t.nodeRef)||void 0===n?void 0:n.current)&&void 0!==e?e:a.default.findDOMNode(this)}},{key:"render",value:function(){return o.cloneElement(o.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}])&&y(t.prototype,n),p}(o.Component);t.default=O,b(O,"displayName","DraggableCore"),b(O,"propTypes",{allowAnyClick:i.default.bool,disabled:i.default.bool,enableUserSelectHack:i.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:i.default.arrayOf(i.default.number),handle:i.default.string,cancel:i.default.string,nodeRef:i.default.object,onStart:i.default.func,onDrag:i.default.func,onStop:i.default.func,onMouseDown:i.default.func,scale:i.default.number,className:l.dontSetMe,style:l.dontSetMe,transform:l.dontSetMe}),b(O,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})},9734:(e,t,n)=>{"use strict";var r=n(7092),o=r.default,i=r.DraggableCore;e.exports=o,e.exports.default=o,e.exports.DraggableCore=i},7693:(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},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.matchesSelector=f,t.matchesSelectorAndParentsTo=function(e,t,n){var r=e;do{if(f(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1},t.addEvent=function(e,t,n,r){if(e){var o=s({capture:!0},r);e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}},t.removeEvent=function(e,t,n,r){if(e){var o=s({capture:!0},r);e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}},t.outerHeight=function(e){var t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return(t+=(0,o.int)(n.borderTopWidth))+(0,o.int)(n.borderBottomWidth)},t.outerWidth=function(e){var t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return(t+=(0,o.int)(n.borderLeftWidth))+(0,o.int)(n.borderRightWidth)},t.innerHeight=function(e){var t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return(t-=(0,o.int)(n.paddingTop))-(0,o.int)(n.paddingBottom)},t.innerWidth=function(e){var t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return(t-=(0,o.int)(n.paddingLeft))-(0,o.int)(n.paddingRight)},t.offsetXYFromParent=function(e,t,n){var r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect();return{x:(e.clientX+t.scrollLeft-r.left)/n,y:(e.clientY+t.scrollTop-r.top)/n}},t.createCSSTransform=function(e,t){var n=p(e,t,"px");return l({},(0,i.browserPrefixToKey)("transform",i.default),n)},t.createSVGTransform=function(e,t){return p(e,t,"")},t.getTranslation=p,t.getTouch=function(e,t){return e.targetTouches&&(0,o.findInArray)(e.targetTouches,(function(e){return t===e.identifier}))||e.changedTouches&&(0,o.findInArray)(e.changedTouches,(function(e){return t===e.identifier}))},t.getTouchIdentifier=function(e){return e.targetTouches&&e.targetTouches[0]?e.targetTouches[0].identifier:e.changedTouches&&e.changedTouches[0]?e.changedTouches[0].identifier:void 0},t.addUserSelectStyles=function(e){if(e){var t=e.getElementById("react-draggable-style-el");t||((t=e.createElement("style")).type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t)),e.body&&d(e.body,"react-draggable-transparent-selection")}},t.removeUserSelectStyles=function(e){if(e)try{if(e.body&&y(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{var t=(e.defaultView||window).getSelection();t&&"Caret"!==t.type&&t.removeAllRanges()}}catch(e){}},t.addClassName=d,t.removeClassName=y;var o=n(8035),i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var s=i?Object.getOwnPropertyDescriptor(e,u):null;s&&(s.get||s.set)?Object.defineProperty(o,u,s):o[u]=e[u]}return o.default=e,n&&n.set(e,o),o}(n(5876));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPrefix=r,t.browserPrefixToKey=o,t.browserPrefixToStyle=function(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e},t.default=void 0;var n=["Moz","Webkit","O","ms"];function r(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window)return"";var i=null===(e=window.document)||void 0===e||null===(t=e.documentElement)||void 0===t?void 0:t.style;if(!i)return"";if(r in i)return"";for(var a=0;a{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){}},9167:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBoundPosition=function(e,t,n){if(!e.props.bounds)return[t,n];var a=e.props.bounds;a="string"==typeof a?a:function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}(a);var u=i(e);if("string"==typeof a){var s,l=u.ownerDocument,c=l.defaultView;if(!((s="parent"===a?u.parentNode:l.querySelector(a))instanceof c.HTMLElement))throw new Error('Bounds selector "'+a+'" could not find an element.');var f=s,p=c.getComputedStyle(u),d=c.getComputedStyle(f);a={left:-u.offsetLeft+(0,r.int)(d.paddingLeft)+(0,r.int)(p.marginLeft),top:-u.offsetTop+(0,r.int)(d.paddingTop)+(0,r.int)(p.marginTop),right:(0,o.innerWidth)(f)-(0,o.outerWidth)(u)-u.offsetLeft+(0,r.int)(d.paddingRight)-(0,r.int)(p.marginRight),bottom:(0,o.innerHeight)(f)-(0,o.outerHeight)(u)-u.offsetTop+(0,r.int)(d.paddingBottom)-(0,r.int)(p.marginBottom)}}return(0,r.isNum)(a.right)&&(t=Math.min(t,a.right)),(0,r.isNum)(a.bottom)&&(n=Math.min(n,a.bottom)),(0,r.isNum)(a.left)&&(t=Math.max(t,a.left)),(0,r.isNum)(a.top)&&(n=Math.max(n,a.top)),[t,n]},t.snapToGrid=function(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]},t.canDragX=function(e){return"both"===e.props.axis||"x"===e.props.axis},t.canDragY=function(e){return"both"===e.props.axis||"y"===e.props.axis},t.getControlPosition=function(e,t,n){var r="number"==typeof t?(0,o.getTouch)(e,t):null;if("number"==typeof t&&!r)return null;var a=i(n),u=n.props.offsetParent||a.offsetParent||a.ownerDocument.body;return(0,o.offsetXYFromParent)(r||e,u,n.props.scale)},t.createCoreData=function(e,t,n){var o=e.state,a=!(0,r.isNum)(o.lastX),u=i(e);return a?{node:u,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:u,deltaX:t-o.lastX,deltaY:n-o.lastY,lastX:o.lastX,lastY:o.lastY,x:t,y:n}},t.createDraggableData=function(e,t){var n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}};var r=n(8035),o=n(7693);function i(e){var t=e.findDOMNode();if(!t)throw new Error(": Unmounted during event!");return t}},8035:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findInArray=function(e,t){for(var n=0,r=e.length;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},r(e)}var o=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(this.props,[]);return function(e){f.forEach((function(t){return delete e[t]}))}(r),r.className=this.props.inputClassName,r.id=this.state.inputId,r.style=n,u.default.createElement("div",{className:this.props.className,style:t},this.renderStyles(),u.default.createElement("input",o({},r,{ref:this.inputRef})),u.default.createElement("div",{ref:this.sizerRef,style:c},e),this.props.placeholder?u.default.createElement("div",{ref:this.placeHolderSizerRef,style:c},this.props.placeholder):null)}}]),t}(a.Component);m.propTypes={className:s.default.string,defaultValue:s.default.any,extraWidth:s.default.oneOfType([s.default.number,s.default.string]),id:s.default.string,injectStyles:s.default.bool,inputClassName:s.default.string,inputRef:s.default.func,inputStyle:s.default.object,minWidth:s.default.oneOfType([s.default.number,s.default.string]),onAutosize:s.default.func,onChange:s.default.func,placeholder:s.default.string,placeholderIsMinWidth:s.default.bool,style:s.default.object,value:s.default.any},m.defaultProps={minWidth:1,injectStyles:!0},t.Z=m},9025:(e,t)=>{"use strict";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},n(e)}var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,u=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,y=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.suspense_list"):60120,h=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116,b=r?Symbol.for("react.block"):60121,g=r?Symbol.for("react.fundamental"):60117,S=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function O(e){if("object"===n(e)&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case f:case p:case a:case s:case u:case y:return e;default:switch(e=e&&e.$$typeof){case c:case d:case v:case h:case l:return e;default:return t}}case i:return t}}}function _(e){return O(e)===p}t.AsyncMode=f,t.ConcurrentMode=p,t.ContextConsumer=c,t.ContextProvider=l,t.Element=o,t.ForwardRef=d,t.Fragment=a,t.Lazy=v,t.Memo=h,t.Portal=i,t.Profiler=s,t.StrictMode=u,t.Suspense=y,t.isAsyncMode=function(e){return _(e)||O(e)===f},t.isConcurrentMode=_,t.isContextConsumer=function(e){return O(e)===c},t.isContextProvider=function(e){return O(e)===l},t.isElement=function(e){return"object"===n(e)&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return O(e)===d},t.isFragment=function(e){return O(e)===a},t.isLazy=function(e){return O(e)===v},t.isMemo=function(e){return O(e)===h},t.isPortal=function(e){return O(e)===i},t.isProfiler=function(e){return O(e)===s},t.isStrictMode=function(e){return O(e)===u},t.isSuspense=function(e){return O(e)===y},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===p||e===s||e===u||e===y||e===m||"object"===n(e)&&null!==e&&(e.$$typeof===v||e.$$typeof===h||e.$$typeof===l||e.$$typeof===c||e.$$typeof===d||e.$$typeof===g||e.$$typeof===S||e.$$typeof===w||e.$$typeof===b)},t.typeOf=O},6050:(e,t,n)=>{"use strict";e.exports=n(9025)},1399:(e,t,n)=>{"use strict";var r=n(1120),o=n(9365),i=n(408)("String.prototype.replace"),a=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,u=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;e.exports=function(){var e=o(r(this));return i(i(e,a,""),u,"")}},4758:(e,t,n)=>{"use strict";var r=n(9935),o=n(1722),i=n(1399),a=n(6936),u=n(1171),s=r(a());o(s,{getPolyfill:a,implementation:i,shim:u}),e.exports=s},6936:(e,t,n)=>{"use strict";var r=n(1399);e.exports=function(){return String.prototype.trim&&"​"==="​".trim()?String.prototype.trim:r}},1171:(e,t,n)=>{"use strict";var r=n(1722),o=n(6936);e.exports=function(){var e=o();return r(String.prototype,{trim:e},{trim:function(){return String.prototype.trim!==e}}),e}},9687:(e,t)=>{"use strict";var n=[["ثانية","ثانيتين","%s ثوان","%s ثانية"],["دقيقة","دقيقتين","%s دقائق","%s دقيقة"],["ساعة","ساعتين","%s ساعات","%s ساعة"],["يوم","يومين","%s أيام","%s يوماً"],["أسبوع","أسبوعين","%s أسابيع","%s أسبوعاً"],["شهر","شهرين","%s أشهر","%s شهراً"],["عام","عامين","%s أعوام","%s عاماً"]];t.Z=function(e,t){if(0===t)return["منذ لحظات","بعد لحظات"];var r,o,i=(r=Math.floor(t/2),(o=e)<3?n[r][o-1]:o>=3&&o<=10?n[r][2]:n[r][3]);return["منذ "+i,"بعد "+i]}},6405:(e,t)=>{"use strict";t.Z=function(e,t){var n=0;return(1==t||3==t||5==t||7==t||9==t||11==t||13==t)&&e>=5&&(n=1),[[["právě teď","právě teď"]],[["před %s vteřinami","za %s vteřiny"],["před %s vteřinami","za %s vteřin"]],[["před minutou","za minutu"]],[["před %s minutami","za %s minuty"],["před %s minutami","za %s minut"]],[["před hodinou","za hodinu"]],[["před %s hodinami","za %s hodiny"],["před %s hodinami","za %s hodin"]],[["včera","zítra"]],[["před %s dny","za %s dny"],["před %s dny","za %s dnů"]],[["minulý týden","příští týden"]],[["před %s týdny","za %s týdny"],["před %s týdny","za %s týdnů"]],[["minulý měsíc","přístí měsíc"]],[["před %s měsíci","za %s měsíce"],["před %s měsíci","za %s měsíců"]],[["před rokem","přístí rok"]],[["před %s lety","za %s roky"],["před %s lety","za %s let"]]][t][n]}},6885:(e,t)=>{"use strict";t.Z=function(e,t){return[["gerade eben","vor einer Weile"],["vor %s Sekunden","in %s Sekunden"],["vor 1 Minute","in 1 Minute"],["vor %s Minuten","in %s Minuten"],["vor 1 Stunde","in 1 Stunde"],["vor %s Stunden","in %s Stunden"],["vor 1 Tag","in 1 Tag"],["vor %s Tagen","in %s Tagen"],["vor 1 Woche","in 1 Woche"],["vor %s Wochen","in %s Wochen"],["vor 1 Monat","in 1 Monat"],["vor %s Monaten","in %s Monaten"],["vor 1 Jahr","in 1 Jahr"],["vor %s Jahren","in %s Jahren"]][t]}},3741:(e,t)=>{"use strict";t.Z=function(e,t){return[["μόλις τώρα","σε λίγο"],["%s δευτερόλεπτα πριν","σε %s δευτερόλεπτα"],["1 λεπτό πριν","σε 1 λεπτό"],["%s λεπτά πριν","σε %s λεπτά"],["1 ώρα πριν","σε 1 ώρα"],["%s ώρες πριν","σε %s ώρες"],["1 μέρα πριν","σε 1 μέρα"],["%s μέρες πριν","σε %s μέρες"],["1 εβδομάδα πριν","σε 1 εβδομάδα"],["%s εβδομάδες πριν","σε %s εβδομάδες"],["1 μήνα πριν","σε 1 μήνα"],["%s μήνες πριν","σε %s μήνες"],["1 χρόνο πριν","σε 1 χρόνο"],["%s χρόνια πριν","σε %s χρόνια"]][t]}},2305:(e,t)=>{"use strict";t.Z=function(e,t){return[["justo ahora","en un rato"],["hace %s segundos","en %s segundos"],["hace 1 minuto","en 1 minuto"],["hace %s minutos","en %s minutos"],["hace 1 hora","en 1 hora"],["hace %s horas","en %s horas"],["hace 1 día","en 1 día"],["hace %s días","en %s días"],["hace 1 semana","en 1 semana"],["hace %s semanas","en %s semanas"],["hace 1 mes","en 1 mes"],["hace %s meses","en %s meses"],["hace 1 año","en 1 año"],["hace %s años","en %s años"]][t]}},426:(e,t)=>{"use strict";t.Z=function(e,t){return[["juuri äsken","juuri nyt"],["%s sekuntia sitten","%s sekunnin päästä"],["minuutti sitten","minuutin päästä"],["%s minuuttia sitten","%s minuutin päästä"],["tunti sitten","tunnin päästä"],["%s tuntia sitten","%s tunnin päästä"],["päivä sitten","päivän päästä"],["%s päivää sitten","%s päivän päästä"],["viikko sitten","viikon päästä"],["%s viikkoa sitten","%s viikon päästä"],["kuukausi sitten","kuukauden päästä"],["%s kuukautta sitten","%s kuukauden päästä"],["vuosi sitten","vuoden päästä"],["%s vuotta sitten","%s vuoden päästä"]][t]}},485:(e,t)=>{"use strict";t.Z=function(e,t){return[["à l'instant","dans un instant"],["il y a %s secondes","dans %s secondes"],["il y a 1 minute","dans 1 minute"],["il y a %s minutes","dans %s minutes"],["il y a 1 heure","dans 1 heure"],["il y a %s heures","dans %s heures"],["il y a 1 jour","dans 1 jour"],["il y a %s jours","dans %s jours"],["il y a 1 semaine","dans 1 semaine"],["il y a %s semaines","dans %s semaines"],["il y a 1 mois","dans 1 mois"],["il y a %s mois","dans %s mois"],["il y a 1 an","dans 1 an"],["il y a %s ans","dans %s ans"]][t]}},8981:(e,t)=>{"use strict";t.Z=function(e,t){return[["xusto agora","daquí a un pouco"],["hai %s segundos","en %s segundos"],["hai 1 minuto","nun minuto"],["hai %s minutos","en %s minutos"],["hai 1 hora","nunha hora"],["hai %s horas","en %s horas"],["hai 1 día","nun día"],["hai %s días","en %s días"],["hai 1 semana","nunha semana"],["hai %s semanas","en %s semanas"],["hai 1 mes","nun mes"],["hai %s meses","en %s meses"],["hai 1 ano","nun ano"],["hai %s anos","en %s anos"]][t]}},4742:(e,t)=>{"use strict";t.Z=function(e,t){return[["अभी","कुछ समय"],["%s सेकंड पहले","%s सेकंड में"],["1 मिनट पहले","1 मिनट में"],["%s मिनट पहले","%s मिनट में"],["1 घंटे पहले","1 घंटे में"],["%s घंटे पहले","%s घंटे में"],["1 दिन पहले","1 दिन में"],["%s दिन पहले","%s दिनों में"],["1 सप्ताह पहले","1 सप्ताह में"],["%s हफ्ते पहले","%s हफ्तों में"],["1 महीने पहले","1 महीने में"],["%s महीने पहले","%s महीनों में"],["1 साल पहले","1 साल में"],["%s साल पहले","%s साल में"]][t]}},2083:(e,t)=>{"use strict";t.Z=function(e,t){return[["poco fa","fra poco"],["%s secondi fa","fra %s secondi"],["un minuto fa","fra un minuto"],["%s minuti fa","fra %s minuti"],["un'ora fa","fra un'ora"],["%s ore fa","fra %s ore"],["un giorno fa","fra un giorno"],["%s giorni fa","fra %s giorni"],["una settimana fa","fra una settimana"],["%s settimane fa","fra %s settimane"],["un mese fa","fra un mese"],["%s mesi fa","fra %s mesi"],["un anno fa","fra un anno"],["%s anni fa","fra %s anni"]][t]}},681:(e,t)=>{"use strict";t.Z=function(e,t){return[["すこし前","すぐに"],["%s秒前","%s秒以内"],["1分前","1分以内"],["%s分前","%s分以内"],["1時間前","1時間以内"],["%s時間前","%s時間以内"],["1日前","1日以内"],["%s日前","%s日以内"],["1週間前","1週間以内"],["%s週間前","%s週間以内"],["1ヶ月前","1ヶ月以内"],["%sヶ月前","%sヶ月以内"],["1年前","1年以内"],["%s年前","%s年以内"]][t]}},333:(e,t)=>{"use strict";t.Z=function(e,t){return[["방금","곧"],["%s초 전","%s초 후"],["1분 전","1분 후"],["%s분 전","%s분 후"],["1시간 전","1시간 후"],["%s시간 전","%s시간 후"],["1일 전","1일 후"],["%s일 전","%s일 후"],["1주일 전","1주일 후"],["%s주일 전","%s주일 후"],["1개월 전","1개월 후"],["%s개월 전","%s개월 후"],["1년 전","1년 후"],["%s년 전","%s년 후"]][t]}},4970:(e,t)=>{"use strict";t.Z=function(e,t){return[["recent","binnenkort"],["%s seconden geleden","binnen %s seconden"],["1 minuut geleden","binnen 1 minuut"],["%s minuten geleden","binnen %s minuten"],["1 uur geleden","binnen 1 uur"],["%s uur geleden","binnen %s uur"],["1 dag geleden","binnen 1 dag"],["%s dagen geleden","binnen %s dagen"],["1 week geleden","binnen 1 week"],["%s weken geleden","binnen %s weken"],["1 maand geleden","binnen 1 maand"],["%s maanden geleden","binnen %s maanden"],["1 jaar geleden","binnen 1 jaar"],["%s jaar geleden","binnen %s jaar"]][t]}},2312:(e,t)=>{"use strict";t.Z=function(e,t){return[["agora mesmo","agora"],["há %s segundos","em %s segundos"],["há um minuto","em um minuto"],["há %s minutos","em %s minutos"],["há uma hora","em uma hora"],["há %s horas","em %s horas"],["há um dia","em um dia"],["há %s dias","em %s dias"],["há uma semana","em uma semana"],["há %s semanas","em %s semanas"],["há um mês","em um mês"],["há %s meses","em %s meses"],["há um ano","em um ano"],["há %s anos","em %s anos"]][t]}},5776:(e,t)=>{"use strict";function n(e,t,n,r,o){var i=o%10,a=r;return 1===o?a=e:1===i&&o>20?a=t:i>1&&i<5&&(o>20||o<10)&&(a=n),a}var r=n.bind(null,"секунду","%s секунду","%s секунды","%s секунд"),o=n.bind(null,"минуту","%s минуту","%s минуты","%s минут"),i=n.bind(null,"час","%s час","%s часа","%s часов"),a=n.bind(null,"день","%s день","%s дня","%s дней"),u=n.bind(null,"неделю","%s неделю","%s недели","%s недель"),s=n.bind(null,"месяц","%s месяц","%s месяца","%s месяцев"),l=n.bind(null,"год","%s год","%s года","%s лет");t.Z=function(e,t){switch(t){case 0:return["только что","через несколько секунд"];case 1:return[r(e)+" назад","через "+r(e)];case 2:case 3:return[o(e)+" назад","через "+o(e)];case 4:case 5:return[i(e)+" назад","через "+i(e)];case 6:return["вчера","завтра"];case 7:return[a(e)+" назад","через "+a(e)];case 8:case 9:return[u(e)+" назад","через "+u(e)];case 10:case 11:return[s(e)+" назад","через "+s(e)];case 12:case 13:return[l(e)+" назад","через "+l(e)];default:return["",""]}}},7681:(e,t)=>{"use strict";t.Z=function(e,t){return[["just nu","om en stund"],["%s sekunder sedan","om %s sekunder"],["1 minut sedan","om 1 minut"],["%s minuter sedan","om %s minuter"],["1 timme sedan","om 1 timme"],["%s timmar sedan","om %s timmar"],["1 dag sedan","om 1 dag"],["%s dagar sedan","om %s dagar"],["1 vecka sedan","om 1 vecka"],["%s veckor sedan","om %s veckor"],["1 månad sedan","om 1 månad"],["%s månader sedan","om %s månader"],["1 år sedan","om 1 år"],["%s år sedan","om %s år"]][t]}},2112:(e,t)=>{"use strict";t.Z=function(e,t){return[["เมื่อสักครู่นี้","อีกสักครู่"],["%s วินาทีที่แล้ว","ใน %s วินาที"],["1 นาทีที่แล้ว","ใน 1 นาที"],["%s นาทีที่แล้ว","ใน %s นาที"],["1 ชั่วโมงที่แล้ว","ใน 1 ชั่วโมง"],["%s ชั่วโมงที่แล้ว","ใน %s ชั่วโมง"],["1 วันที่แล้ว","ใน 1 วัน"],["%s วันที่แล้ว","ใน %s วัน"],["1 อาทิตย์ที่แล้ว","ใน 1 อาทิตย์"],["%s อาทิตย์ที่แล้ว","ใน %s อาทิตย์"],["1 เดือนที่แล้ว","ใน 1 เดือน"],["%s เดือนที่แล้ว","ใน %s เดือน"],["1 ปีที่แล้ว","ใน 1 ปี"],["%s ปีที่แล้ว","ใน %s ปี"]][t]}},5874:(e,t)=>{"use strict";t.Z=function(e,t){return[["az önce","şimdi"],["%s saniye önce","%s saniye içinde"],["1 dakika önce","1 dakika içinde"],["%s dakika önce","%s dakika içinde"],["1 saat önce","1 saat içinde"],["%s saat önce","%s saat içinde"],["1 gün önce","1 gün içinde"],["%s gün önce","%s gün içinde"],["1 hafta önce","1 hafta içinde"],["%s hafta önce","%s hafta içinde"],["1 ay önce","1 ay içinde"],["%s ay önce","%s ay içinde"],["1 yıl önce","1 yıl içinde"],["%s yıl önce","%s yıl içinde"]][t]}},9372:(e,t)=>{"use strict";var n=["秒","分钟","小时","天","周","个月","年"];t.Z=function(e,t){if(0===t)return["刚刚","片刻后"];var r=n[~~(t/2)];return[e+" "+r+"前",e+" "+r+"后"]}},3941:(e,t)=>{"use strict";t.Z=function(e,t){return[["剛剛","片刻後"],["%s 秒前","%s 秒後"],["1 分鐘前","1 分鐘後"],["%s 分鐘前","%s 分鐘後"],["1 小時前","1 小時後"],["%s 小時前","%s 小時後"],["1 天前","1 天後"],["%s 天前","%s 天後"],["1 週前","1 週後"],["%s 週前","%s 週後"],["1 個月前","1 個月後"],["%s 個月前","%s 個月後"],["1 年前","1 年後"],["%s 年前","%s 年後"]][t]}},697:e=>{"use strict";e.exports=function(){}},2593:t=>{"use strict";t.exports=e},6003:()=>{},7589:(e,t,n)=>{"use strict";var r=n(5252),o=n(408),i=r("%TypeError%"),a=n(1172),u=r("%Reflect.apply%",!0)||o("%Function.prototype.apply%");e.exports=function(e,t){var n=arguments.length>2?arguments[2]:[];if(!a(n))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return u(e,t,n)}},8257:(e,t,n)=>{"use strict";var r=n(5252)("%TypeError%"),o=n(7147),i=n(2222),a=n(7732);e.exports=function(e,t){if("Object"!==a(e))throw new r("Assertion failed: Type(O) is not Object");if(!i(t))throw new r("Assertion failed: IsPropertyKey(P) is not true, got "+o(t));return e[t]}},1736:(e,t,n)=>{"use strict";var r=n(5252)("%TypeError%"),o=n(2222),i=n(7732);e.exports=function(e,t){if("Object"!==i(e))throw new r("Assertion failed: `O` must be an Object");if(!o(t))throw new r("Assertion failed: `P` must be a Property Key");return t in e}},1172:(e,t,n)=>{"use strict";var r=n(5252)("%Array%"),o=!r.isArray&&n(408)("Object.prototype.toString");e.exports=r.isArray||function(e){return"[object Array]"===o(e)}},536:(e,t,n)=>{"use strict";e.exports=n(5600)},2222:e=>{"use strict";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},t(e)}e.exports=function(e){return"string"==typeof e||"symbol"===t(e)}},1552:(e,t,n)=>{"use strict";var r=n(5252)("%TypeError%"),o=n(8257),i=n(3909),a=n(7732);e.exports=function(e){if("Object"!==a(e))throw new r("Assertion failed: `obj` must be an Object");return i(o(e,"length"))}},1120:(e,t,n)=>{"use strict";e.exports=n(2968)},2060:(e,t,n)=>{"use strict";var r=n(5155),o=n(5626);e.exports=function(e){var t=o(e);return 0!==t&&(t=r(t)),0===t?0:t}},3909:(e,t,n)=>{"use strict";var r=n(610),o=n(2060);e.exports=function(e){var t=o(e);return t<=0?0:t>r?r:t}},5626:(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},r(e)}var o=n(5252),i=o("%TypeError%"),a=o("%Number%"),u=o("%RegExp%"),s=o("%parseInt%"),l=n(408),c=n(3231),f=n(4942),p=l("String.prototype.slice"),d=c(/^0b[01]+$/i),y=c(/^0o[0-7]+$/i),m=c(/^[-+]0x[0-9a-f]+$/i),h=c(new u("["+["…","​","￾"].join("")+"]","g")),v=["\t\n\v\f\r   ᠎    ","          \u2028","\u2029\ufeff"].join(""),b=new RegExp("(^["+v+"]+)|(["+v+"]+$)","g"),g=l("String.prototype.replace"),S=n(7225);e.exports=function e(t){var n=f(t)?t:S(t,a);if("symbol"===r(n))throw new i("Cannot convert a Symbol value to a number");if("bigint"==typeof n)throw new i("Conversion from 'BigInt' to 'number' is not allowed.");if("string"==typeof n){if(d(n))return e(s(p(n,2),2));if(y(n))return e(s(p(n,2),8));if(h(n)||m(n))return NaN;var o=function(e){return g(e,b,"")}(n);if(o!==n)return e(o)}return a(n)}},5429:(e,t,n)=>{"use strict";var r=n(5252)("%Object%"),o=n(1120);e.exports=function(e){return o(e),r(e)}},7225:(e,t,n)=>{"use strict";var r=n(3386);e.exports=function(e){return arguments.length>1?r(e,arguments[1]):r(e)}},9365:(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},r(e)}var o=n(5252),i=o("%String%"),a=o("%TypeError%");e.exports=function(e){if("symbol"===r(e))throw new a("Cannot convert a Symbol value to a string");return i(e)}},7732:(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},r(e)}var o=n(8801);e.exports=function(e){return"symbol"===r(e)?"Symbol":"bigint"==typeof e?"BigInt":o(e)}},2968:(e,t,n)=>{"use strict";var r=n(5252)("%TypeError%");e.exports=function(e,t){if(null==e)throw new r(t||"Cannot call method on "+e);return e}},5155:(e,t,n)=>{"use strict";var r=n(7865),o=n(6421),i=n(2721),a=n(7946),u=n(5817),s=n(8665);e.exports=function(e){var t=i(e);return a(t)?0:0!==t&&u(t)?s(t)*o(r(t)):t}},2721:(e,t,n)=>{"use strict";var r=n(6081);e.exports=function(e){var t=r(e,Number);if("string"!=typeof t)return+t;var n=t.replace(/^[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+|[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+$/g,"");return/^0[ob]|^[+-]0x/.test(n)?NaN:+n}},6081:(e,t,n)=>{"use strict";e.exports=n(8190)},8801:e=>{"use strict";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},t(e)}e.exports=function(e){return null===e?"Null":void 0===e?"Undefined":"function"==typeof e||"object"===t(e)?"Object":"number"==typeof e?"Number":"boolean"==typeof e?"Boolean":"string"==typeof e?"String":void 0}},7865:(e,t,n)=>{"use strict";var r=n(5252)("%Math.abs%");e.exports=function(e){return r(e)}},6421:e=>{"use strict";var t=Math.floor;e.exports=function(e){return t(e)}},5817:e=>{"use strict";var t=Number.isNaN||function(e){return e!=e};e.exports=Number.isFinite||function(e){return"number"==typeof e&&!t(e)&&e!==1/0&&e!==-1/0}},7946:e=>{"use strict";e.exports=Number.isNaN||function(e){return e!=e}},4942:e=>{"use strict";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},t(e)}e.exports=function(e){return null===e||"function"!=typeof e&&"object"!==t(e)}},610:(e,t,n)=>{"use strict";var r=n(5252),o=r("%Math%"),i=r("%Number%");e.exports=i.MAX_SAFE_INTEGER||o.pow(2,53)-1},3231:(e,t,n)=>{"use strict";var r=n(5252)("RegExp.prototype.test"),o=n(9935);e.exports=function(e){return o(r,e)}},8665:e=>{"use strict";e.exports=function(e){return e>=0?1:-1}}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e].call(i.exports,i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";r.d(o,{default:()=>Ec});var e=r(4741),t=r(8773),n=r.n(t),i=r(9734),a=r.n(i),u=["second","minute","hour","day","week","month","year"],s=["秒","分钟","小时","天","周","个月","年"],l={},c=function(e,t){l[e]=t},f=function(e){return l[e]||l.en_US},p=[60,60,24,7,365/7/12,12];function d(e){return e instanceof Date?e:!isNaN(e)||/^\d+$/.test(e)?new Date(parseInt(e)):(e=(e||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(e))}function y(e,t){for(var n=e<0?1:0,r=e=Math.abs(e),o=0;e>=p[o]&&o(0==(o*=2)?9:1)&&(o+=1),t(e,o,r)[n].replace("%s",e.toString())}function m(e,t){return(+(t?d(t):new Date)-+d(e))/1e3}var h="timeago-id";function v(e){return parseInt(e.getAttribute(h))}var b={},g=function(e){clearTimeout(e),delete b[e]};function S(e,t,n,r){g(v(e));var o=r.relativeDate,i=r.minInterval,a=m(t,o);e.innerText=y(a,n);var u=setTimeout((function(){S(e,t,n,r)}),Math.min(1e3*Math.max(function(e){for(var t=1,n=0,r=Math.abs(e);e>=p[n]&&n1&&(n+="s"),[e+" "+n+" ago","in "+e+" "+n]})),c("zh_CN",(function(e,t){if(0===t)return["刚刚","片刻后"];var n=s[~~(t/2)];return[e+" "+n+"前",e+" "+n+"后"]}));var O,_=(O=function(e,t){return O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},O(e,t)},function(e,t){function n(){this.constructor=e}O(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),A=function(){return A=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?He(Ke,--Ze):0,Ge--,10===Je&&(Ge=1,Xe--),Je}function nt(){return Je=Ze2||at(Je)>3?"":" "}function ft(e,t){for(;--t&&nt()&&!(Je<48||Je>102||Je>57&&Je<65||Je>70&&Je<97););return it(e,ot()+(t<6&&32==rt()&&32==nt()))}function pt(e){for(;nt();)switch(Je){case e:return Ze;case 34:case 39:34!==e&&39!==e&&pt(Je);break;case 40:41===e&&pt(e);break;case 92:nt()}return Ze}function dt(e,t){for(;nt()&&e+Je!==57&&(e+Je!==84||47!==rt()););return"/*"+it(t,Ze-1)+"*"+Le(47===e?e:nt())}function yt(e){for(;!at(rt());)nt();return it(e,Ze)}var mt="-ms-",ht="-moz-",vt="-webkit-",bt="comm",gt="rule",St="decl",wt="@keyframes";function Ot(e,t){for(var n="",r=$e(e),o=0;o0&&We(_)-f&&Ye(d>32?Pt(_+";",r,n,f-1):Pt(Fe(_," ","")+";",r,n,f-2),s);break;case 59:_+=";";default:if(Ye(O=xt(_,t,n,l,c,o,u,g,S=[],w=[],f),i),123===b)if(0===c)Et(_,t,O,O,S,i,f,u,w);else switch(99===p&&110===He(_,3)?100:p){case 100:case 108:case 109:case 115:Et(e,O,O,r&&Ye(xt(e,O,O,0,0,o,u,g,o,S=[],f),w),o,w,f,u,r?S:w);break;default:Et(_,O,O,O,[""],w,0,u,w)}}l=c=d=0,m=v=1,g=_="",f=a;break;case 58:f=1+We(_),d=y;default:if(m<1)if(123==b)--m;else if(125==b&&0==m++&&125==tt())continue;switch(_+=Le(b),b*m){case 38:v=c>0?1:(_+="\f",-1);break;case 44:u[l++]=(We(_)-1)*v,v=1;break;case 64:45===rt()&&(_+=lt(nt())),p=rt(),c=f=We(g=_+=yt(ot())),b++;break;case 45:45===y&&2==We(_)&&(m=0)}}return i}function xt(e,t,n,r,o,i,a,u,s,l,c){for(var f=o-1,p=0===o?i:[""],d=$e(p),y=0,m=0,h=0;y0?p[v]+" "+b:Fe(b,/&\f/g,p[v])))&&(s[h++]=g);return Qe(e,t,n,0===o?gt:u,s,l,c)}function jt(e,t,n){return Qe(e,t,n,bt,Le(Je),ze(e,2,-2),0)}function Pt(e,t,n,r){return Qe(e,t,n,St,ze(e,0,r),ze(e,r+1,-1),r)}var Ct=function(e,t,n){for(var r=0,o=0;r=o,o=rt(),38===r&&12===o&&(t[n]=1),!at(o);)nt();return it(e,Ze)},kt=new WeakMap,Tt=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||kt.get(n))&&!r){kt.set(e,!0);for(var o=[],i=function(e,t){return st(function(e,t){var n=-1,r=44;do{switch(at(r)){case 0:38===r&&12===rt()&&(t[n]=1),e[n]+=Ct(Ze-1,t,n);break;case 2:e[n]+=lt(r);break;case 4:if(44===r){e[++n]=58===rt()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Le(r)}}while(r=nt());return e}(ut(e),t))}(t,o),a=n.props,u=0,s=0;u6)switch(He(e,t+1)){case 109:if(45!==He(e,t+4))break;case 102:return Fe(e,/(.+:)(.+)-([^]+)/,"$1"+vt+"$2-$3$1"+ht+(108==He(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Ve(e,"stretch")?Mt(Fe(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==He(e,t+1))break;case 6444:switch(He(e,We(e)-3-(~Ve(e,"!important")&&10))){case 107:return Fe(e,":",":"+vt)+e;case 101:return Fe(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+vt+(45===He(e,14)?"inline-":"")+"box$3$1"+vt+"$2$3$1"+mt+"$2box$3")+e}break;case 5936:switch(He(e,t+11)){case 114:return vt+e+mt+Fe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return vt+e+mt+Fe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return vt+e+mt+Fe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return vt+e+mt+e+e}return e}var Rt=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case St:e.return=Mt(e.value,e.length);break;case wt:return Ot([et(e,{value:Fe(e.value,"@","@"+vt)})],r);case gt:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return Ot([et(e,{props:[Fe(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return Ot([et(e,{props:[Fe(t,/:(plac\w+)/,":"+vt+"input-$1")]}),et(e,{props:[Fe(t,/:(plac\w+)/,":-moz-$1")]}),et(e,{props:[Fe(t,/:(plac\w+)/,mt+"input-$1")]})],r)}return""}))}}],Nt=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r,o,i=e.stylisPlugins||Rt,a={},u=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>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)}(o)+s;return{name:l,styles:o,next:qt}},Kt=!!e.useInsertionEffect&&e.useInsertionEffect,Qt=Kt||function(e){return e()};Kt||e.useLayoutEffect;var en={}.hasOwnProperty,tn=e.createContext("undefined"!=typeof HTMLElement?Nt({key:"css"}):null),nn=(tn.Provider,function(t){return(0,e.forwardRef)((function(n,r){var o=(0,e.useContext)(tn);return t(n,o,r)}))}),rn=e.createContext({}),on="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",an=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Lt(t,n,r),Qt((function(){return Bt(t,n,r)})),null},un=nn((function(t,n,r){var o=t.css;"string"==typeof o&&void 0!==n.registered[o]&&(o=n.registered[o]);var i=t[on],a=[o],u="";"string"==typeof t.className?u=It(n.registered,a,t.className):null!=t.className&&(u=t.className+" ");var s=Jt(a,void 0,e.useContext(rn));u+=n.key+"-"+s.name;var l={};for(var c in t)en.call(t,c)&&"css"!==c&&c!==on&&(l[c]=t[c]);return l.ref=r,l.className=u,e.createElement(e.Fragment,null,e.createElement(an,{cache:n,serialized:s,isStringTag:"string"==typeof i}),e.createElement(i,l))}));function sn(e){return sn="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},sn(e)}r(4120);var ln=function(t,n){var r=arguments;if(null==n||!en.call(n,"css"))return e.createElement.apply(void 0,r);var o=r.length,i=new Array(o);i[0]=un,i[1]=function(e,t){var n={};for(var r in t)en.call(t,r)&&(n[r]=t[r]);return n[on]=e,n}(t,n);for(var a=2;a=0||(o[n]=e[n]);return o}function mn(e,t){if(null==e)return{};var n,r,o=yn(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function hn(e){return hn="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},hn(e)}var vn=r(5334);function bn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gn(e){var t=function(e,t){if("object"!==hn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==hn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===hn(t)?t:String(t)}function Sn(e,t){for(var n=0;n-1}function Ln(e){return In(e)?window.pageYOffset:e.scrollTop}function Bn(e,t){In(e)?window.scrollTo(0,t):e.scrollTop=t}function Un(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Tn,o=Ln(e),i=t-o,a=0;!function t(){var u,s=i*((u=(u=a+=10)/n-1)*u*u+1)+o;Bn(e,s),a=d)return{placement:"bottom",maxHeight:t};if(_>=d&&!a)return i&&Un(s,A,x),{placement:"bottom",maxHeight:t};if(!a&&_>=r||a&&w>=r)return i&&Un(s,A,x),{placement:"bottom",maxHeight:a?w-b:_-b};if("auto"===o||a){var j=t,P=a?S:O;return P>=r&&(j=Math.min(P-b-u.controlHeight,t)),{placement:"top",maxHeight:j}}if("bottom"===o)return i&&Bn(s,A),{placement:"bottom",maxHeight:t};break;case"top":if(S>=d)return{placement:"top",maxHeight:t};if(O>=d&&!a)return i&&Un(s,E,x),{placement:"top",maxHeight:t};if(!a&&O>=r||a&&S>=r){var C=t;return(!a&&O>=r||a&&S>=r)&&(C=a?S-g:O-g),i&&Un(s,E,x),{placement:"top",maxHeight:C}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return l}({maxHeight:o,menuEl:t,minHeight:r,placement:i,shouldScroll:u&&!l,isFixedPosition:l,theme:s}),f=e.context.getPortalPlacement;f&&f(c),e.setState(c)}},e.getUpdatedProps=function(){var t=e.props.menuPlacement,n=e.state.placement||$n(t);return Pn(Pn({},e.props),{},{placement:n,maxHeight:e.state.maxHeight})},e}return wn(n,[{key:"render",value:function(){return(0,this.props.children)({ref:this.getPlacement,placerProps:this.getUpdatedProps()})}}]),n}(e.Component);Xn.contextType=Yn;var Gn=function(e){var t=e.theme,n=t.spacing.baseUnit;return{color:t.colors.neutral40,padding:"".concat(2*n,"px ").concat(3*n,"px"),textAlign:"center"}},qn=Gn,Zn=Gn,Jn=function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps;return ln("div",Re({css:o("noOptionsMessage",e),className:r({"menu-notice":!0,"menu-notice--no-options":!0},n)},i),t)};Jn.defaultProps={children:"No options"};var Kn=function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps;return ln("div",Re({css:o("loadingMessage",e),className:r({"menu-notice":!0,"menu-notice--loading":!0},n)},i),t)};Kn.defaultProps={children:"Loading..."};var Qn,er,tr,nr=function(t){_n(r,t);var n=kn(r);function r(){var e;bn(this,r);for(var t=arguments.length,o=new Array(t),i=0;ie.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,m=f-p-l,h=!1;m>t&&u.current&&(o&&o(e),u.current=!1),y&&s.current&&(a&&a(e),s.current=!1),y&&t>m?(r&&!u.current&&r(e),d.scrollTop=f,h=!0,u.current=!0):!y&&-t>l&&(i&&!s.current&&i(e),d.scrollTop=0,h=!0,s.current=!0),h&&function(e){e.preventDefault(),e.stopPropagation()}(e)}}),[]),p=(0,e.useCallback)((function(e){f(e,e.deltaY)}),[f]),d=(0,e.useCallback)((function(e){l.current=e.changedTouches[0].clientY}),[]),y=(0,e.useCallback)((function(e){var t=l.current-e.changedTouches[0].clientY;f(e,t)}),[f]),m=(0,e.useCallback)((function(e){if(e){var t=!!Wn&&{passive:!1};"function"==typeof e.addEventListener&&e.addEventListener("wheel",p,t),"function"==typeof e.addEventListener&&e.addEventListener("touchstart",d,t),"function"==typeof e.addEventListener&&e.addEventListener("touchmove",y,t)}}),[y,d,p]),h=(0,e.useCallback)((function(e){e&&("function"==typeof e.removeEventListener&&e.removeEventListener("wheel",p,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchstart",d,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchmove",y,!1))}),[y,d,p]);return(0,e.useEffect)((function(){if(n){var e=c.current;return m(e),function(){h(e)}}}),[n,m,h]),function(e){c.current=e}}({isEnabled:void 0===o||o,onBottomArrive:t.onBottomArrive,onBottomLeave:t.onBottomLeave,onTopArrive:t.onTopArrive,onTopLeave:t.onTopLeave}),a=function(t){var n=t.isEnabled,r=t.accountForScrollbars,o=void 0===r||r,i=(0,e.useRef)({}),a=(0,e.useRef)(null),u=(0,e.useCallback)((function(e){if(Wr){var t=document.body,n=t&&t.style;if(o&&Br.forEach((function(e){var t=n&&n[e];i.current[e]=t})),o&&$r<1){var r=parseInt(i.current.paddingRight,10)||0,a=document.body?document.body.clientWidth:0,u=window.innerWidth-a+r||0;Object.keys(Ur).forEach((function(e){var t=Ur[e];n&&(n[e]=t)})),n&&(n.paddingRight="".concat(u,"px"))}t&&zr()&&(t.addEventListener("touchmove",Fr,Yr),e&&(e.addEventListener("touchstart",Hr,Yr),e.addEventListener("touchmove",Vr,Yr))),$r+=1}}),[]),s=(0,e.useCallback)((function(e){if(Wr){var t=document.body,n=t&&t.style;$r=Math.max($r-1,0),o&&$r<1&&Br.forEach((function(e){var t=i.current[e];n&&(n[e]=t)})),t&&zr()&&(t.removeEventListener("touchmove",Fr,Yr),e&&(e.removeEventListener("touchstart",Hr,Yr),e.removeEventListener("touchmove",Vr,Yr)))}}),[]);return(0,e.useEffect)((function(){if(n){var e=a.current;return u(e),function(){s(e)}}}),[n,u,s]),function(e){a.current=e}}({isEnabled:r});return ln(e.default.Fragment,null,r&&ln("div",{onClick:Xr,css:Gr}),n((function(e){i(e),a(e)})))}var Zr={clearIndicator:lr,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":null,pointerEvents:t?"none":null,position:"relative"}},control:function(e){var t=e.isDisabled,n=e.isFocused,r=e.theme,o=r.colors,i=r.borderRadius,a=r.spacing;return{label:"control",alignItems:"center",backgroundColor:t?o.neutral5:o.neutral0,borderColor:t?o.neutral10:n?o.primary:o.neutral20,borderRadius:i,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px ".concat(o.primary):null,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:a.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:n?o.primary:o.neutral30}}},dropdownIndicator:sr,group:function(e){var t=e.theme.spacing;return{paddingBottom:2*t.baseUnit,paddingTop:2*t.baseUnit}},groupHeading:function(e){var t=e.theme.spacing;return{label:"group",color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:"500",marginBottom:"0.25em",paddingLeft:3*t.baseUnit,paddingRight:3*t.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing.baseUnit,o=n.colors;return{label:"indicatorSeparator",alignSelf:"stretch",backgroundColor:t?o.neutral10:o.neutral20,marginBottom:2*r,marginTop:2*r,width:1}},input:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,o=n.colors;return{margin:r.baseUnit/2,paddingBottom:r.baseUnit/2,paddingTop:r.baseUnit/2,visibility:t?"hidden":"visible",color:o.neutral80}},loadingIndicator:function(e){var t=e.isFocused,n=e.size,r=e.theme,o=r.colors,i=r.spacing.baseUnit;return{label:"loadingIndicator",color:t?o.neutral60:o.neutral20,display:"flex",padding:2*i,transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"}},loadingMessage:Zn,menu:function(e){var t,n=e.placement,r=e.theme,o=r.borderRadius,i=r.spacing,a=r.colors;return An(t={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(n),"100%"),An(t,"backgroundColor",a.neutral0),An(t,"borderRadius",o),An(t,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),An(t,"marginBottom",i.menuGutter),An(t,"marginTop",i.menuGutter),An(t,"position","absolute"),An(t,"width","100%"),An(t,"zIndex",1),t},menuList:function(e){var t=e.maxHeight,n=e.theme.spacing.baseUnit;return{maxHeight:t,overflowY:"auto",paddingBottom:n,paddingTop:n,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},multiValue:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius;return{label:"multiValue",backgroundColor:t.colors.neutral10,borderRadius:r/2,display:"flex",margin:n.baseUnit/2,minWidth:0}},multiValueLabel:function(e){var t=e.theme,n=t.borderRadius,r=t.colors,o=e.cropWithEllipsis;return{borderRadius:n/2,color:r.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:o?"ellipsis":null,whiteSpace:"nowrap"}},multiValueRemove:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius,o=t.colors;return{alignItems:"center",borderRadius:r/2,backgroundColor:e.isFocused&&o.dangerLight,display:"flex",paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}}},noOptionsMessage:qn,option:function(e){var t=e.isDisabled,n=e.isFocused,r=e.isSelected,o=e.theme,i=o.spacing,a=o.colors;return{label:"option",backgroundColor:r?a.primary:n?a.primary25:"transparent",color:t?a.neutral20:r?a.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:"".concat(2*i.baseUnit,"px ").concat(3*i.baseUnit,"px"),width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:!t&&(r?a.primary:a.primary50)}}},placeholder:function(e){var t=e.theme,n=t.spacing;return{label:"placeholder",color:t.colors.neutral50,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2,position:"absolute",top:"50%",transform:"translateY(-50%)"}},singleValue:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,o=n.colors;return{label:"singleValue",color:t?o.neutral40:o.neutral80,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2,maxWidth:"calc(100% - ".concat(2*r.baseUnit,"px)"),overflow:"hidden",position:"absolute",textOverflow:"ellipsis",whiteSpace:"nowrap",top:"50%",transform:"translateY(-50%)"}},valueContainer:function(e){var t=e.theme.spacing;return{alignItems:"center",display:"flex",flex:1,flexWrap:"wrap",padding:"".concat(t.baseUnit/2,"px ").concat(2*t.baseUnit,"px"),WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}}},Jr={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},Kr={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Fn(),captureMenuScroll:!Fn(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){var n=Pn({ignoreCase:!0,ignoreAccents:!0,stringify:Ir,trim:!0,matchFrom:"any"},void 0),r=n.ignoreCase,o=n.ignoreAccents,i=n.stringify,a=n.trim,u=n.matchFrom,s=a?Nr(t):t,l=a?Nr(i(e)):i(e);return r&&(s=s.toLowerCase(),l=l.toLowerCase()),o&&(s=Rr(s),l=Mr(l)),"start"===u?l.substr(0,s.length)===s:l.indexOf(s)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:"0",tabSelectsValue:!0};function Qr(e,t,n,r){return{type:"option",data:t,isDisabled:io(e,t,n),isSelected:ao(e,t,n),label:ro(e,t),value:oo(e,t),index:r}}function eo(e,t){return e.options.map((function(n,r){if(n.options){var o=n.options.map((function(n,r){return Qr(e,n,t,r)})).filter((function(t){return no(e,t)}));return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var i=Qr(e,n,t,r);return no(e,i)?i:void 0})).filter((function(e){return!!e}))}function to(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,Sr(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function no(e,t){var n=e.inputValue,r=void 0===n?"":n,o=t.data,i=t.isSelected,a=t.label,u=t.value;return(!so(e)||!i)&&uo(e,{label:a,value:u,data:o},r)}var ro=function(e,t){return e.getOptionLabel(t)},oo=function(e,t){return e.getOptionValue(t)};function io(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function ao(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var r=oo(e,t);return n.some((function(t){return oo(e,t)===r}))}function uo(e,t,n){return!e.filterOption||e.filterOption(t,n)}var so=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},lo=1,co=function(t){_n(r,t);var n=kn(r);function r(e){var t;return bn(this,r),(t=n.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},t.blockOptionHover=!1,t.isComposing=!1,t.commonProps=void 0,t.initialTouchX=0,t.initialTouchY=0,t.instancePrefix="",t.openAfterFocus=!1,t.scrollToFocusedOptionOnUpdate=!1,t.userIsDragging=void 0,t.controlRef=null,t.getControlRef=function(e){t.controlRef=e},t.focusedOptionRef=null,t.getFocusedOptionRef=function(e){t.focusedOptionRef=e},t.menuListRef=null,t.getMenuListRef=function(e){t.menuListRef=e},t.inputRef=null,t.getInputRef=function(e){t.inputRef=e},t.focus=t.focusInput,t.blur=t.blurInput,t.onChange=function(e,n){var r=t.props,o=r.onChange,i=r.name;n.name=i,t.ariaOnChange(e,n),o(e,n)},t.setValue=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"set-value",r=arguments.length>2?arguments[2]:void 0,o=t.props,i=o.closeMenuOnSelect,a=o.isMulti;t.onInputChange("",{action:"set-value"}),i&&(t.setState({inputIsHiddenAfterUpdate:!a}),t.onMenuClose()),t.setState({clearFocusValueOnUpdate:!0}),t.onChange(e,{action:n,option:r})},t.selectOption=function(e){var n=t.props,r=n.blurInputOnSelect,o=n.isMulti,i=n.name,a=t.state.selectValue,u=o&&t.isOptionSelected(e,a),s=t.isOptionDisabled(e,a);if(u){var l=t.getOptionValue(e);t.setValue(a.filter((function(e){return t.getOptionValue(e)!==l})),"deselect-option",e)}else{if(s)return void t.ariaOnChange(e,{action:"select-option",name:i});o?t.setValue([].concat(Sr(a),[e]),"select-option",e):t.setValue(e,"select-option")}r&&t.blurInput()},t.removeValue=function(e){var n=t.props.isMulti,r=t.state.selectValue,o=t.getOptionValue(e),i=r.filter((function(e){return t.getOptionValue(e)!==o})),a=n?i:i[0]||null;t.onChange(a,{action:"remove-value",removedValue:e}),t.focusInput()},t.clearValue=function(){var e=t.state.selectValue;t.onChange(t.props.isMulti?[]:null,{action:"clear",removedValues:e})},t.popValue=function(){var e=t.props.isMulti,n=t.state.selectValue,r=n[n.length-1],o=n.slice(0,n.length-1),i=e?o:o[0]||null;t.onChange(i,{action:"pop-value",removedValue:r})},t.getValue=function(){return t.state.selectValue},t.cx=function(){for(var e=arguments.length,n=new Array(e),r=0;r5||i>5}},t.onTouchEnd=function(e){t.userIsDragging||(t.controlRef&&!t.controlRef.contains(e.target)&&t.menuListRef&&!t.menuListRef.contains(e.target)&&t.blurInput(),t.initialTouchX=0,t.initialTouchY=0)},t.onControlTouchEnd=function(e){t.userIsDragging||t.onControlMouseDown(e)},t.onClearIndicatorTouchEnd=function(e){t.userIsDragging||t.onClearIndicatorMouseDown(e)},t.onDropdownIndicatorTouchEnd=function(e){t.userIsDragging||t.onDropdownIndicatorMouseDown(e)},t.handleInputChange=function(e){var n=e.currentTarget.value;t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange(n,{action:"input-change"}),t.props.menuIsOpen||t.onMenuOpen()},t.onInputFocus=function(e){t.props.onFocus&&t.props.onFocus(e),t.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(t.openAfterFocus||t.props.openMenuOnFocus)&&t.openMenu("first"),t.openAfterFocus=!1},t.onInputBlur=function(e){t.menuListRef&&t.menuListRef.contains(document.activeElement)?t.inputRef.focus():(t.props.onBlur&&t.props.onBlur(e),t.onInputChange("",{action:"input-blur"}),t.onMenuClose(),t.setState({focusedValue:null,isFocused:!1}))},t.onOptionHover=function(e){t.blockOptionHover||t.state.focusedOption===e||t.setState({focusedOption:e})},t.shouldHideSelectedOptions=function(){return so(t.props)},t.onKeyDown=function(e){var n=t.props,r=n.isMulti,o=n.backspaceRemovesValue,i=n.escapeClearsValue,a=n.inputValue,u=n.isClearable,s=n.isDisabled,l=n.menuIsOpen,c=n.onKeyDown,f=n.tabSelectsValue,p=n.openMenuOnFocus,d=t.state,y=d.focusedOption,m=d.focusedValue,h=d.selectValue;if(!(s||"function"==typeof c&&(c(e),e.defaultPrevented))){switch(t.blockOptionHover=!0,e.key){case"ArrowLeft":if(!r||a)return;t.focusValue("previous");break;case"ArrowRight":if(!r||a)return;t.focusValue("next");break;case"Delete":case"Backspace":if(a)return;if(m)t.removeValue(m);else{if(!o)return;r?t.popValue():u&&t.clearValue()}break;case"Tab":if(t.isComposing)return;if(e.shiftKey||!l||!f||!y||p&&t.isOptionSelected(y,h))return;t.selectOption(y);break;case"Enter":if(229===e.keyCode)break;if(l){if(!y)return;if(t.isComposing)return;t.selectOption(y);break}return;case"Escape":l?(t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange("",{action:"menu-close"}),t.onMenuClose()):u&&i&&t.clearValue();break;case" ":if(a)return;if(!l){t.openMenu("first");break}if(!y)return;t.selectOption(y);break;case"ArrowUp":l?t.focusOption("up"):t.openMenu("last");break;case"ArrowDown":l?t.focusOption("down"):t.openMenu("first");break;case"PageUp":if(!l)return;t.focusOption("pageup");break;case"PageDown":if(!l)return;t.focusOption("pagedown");break;case"Home":if(!l)return;t.focusOption("first");break;case"End":if(!l)return;t.focusOption("last");break;default:return}e.preventDefault()}},t.instancePrefix="react-select-"+(t.props.instanceId||++lo),t.state.selectValue=Rn(e.value),t}return wn(r,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentDidUpdate",value:function(e){var t,n,r,o,i,a=this.props,u=a.isDisabled,s=a.menuIsOpen,l=this.state.isFocused;(l&&!u&&e.isDisabled||l&&s&&!e.menuIsOpen)&&this.focusInput(),l&&u&&!e.isDisabled&&this.setState({isFocused:!1},this.onMenuClose),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(t=this.menuListRef,n=this.focusedOptionRef,r=t.getBoundingClientRect(),o=n.getBoundingClientRect(),i=n.offsetHeight/3,o.bottom+i>r.bottom?Bn(t,Math.min(n.offsetTop+n.clientHeight-t.offsetHeight+i,t.scrollHeight)):o.top-i-1&&(a=u)}this.scrollToFocusedOptionOnUpdate=!(o&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:i[a]},(function(){return t.onMenuOpen()}))}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,r=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var o=n.indexOf(r);r||(o=-1);var i=n.length-1,a=-1;if(n.length){switch(e){case"previous":a=0===o?0:-1===o?i:o-1;break;case"next":o>-1&&o0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,r=this.getFocusableOptions();if(r.length){var o=0,i=r.indexOf(n);n||(i=-1),"up"===e?o=i>0?i-1:r.length-1:"down"===e?o=(i+1)%r.length:"pageup"===e?(o=i-t)<0&&(o=0):"pagedown"===e?(o=i+t)>r.length-1&&(o=r.length-1):"last"===e&&(o=r.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:r[o],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(Jr):Pn(Pn({},Jr),this.props.theme):Jr}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,r=this.getValue,o=this.selectOption,i=this.setValue,a=this.props,u=a.isMulti,s=a.isRtl,l=a.options;return{clearValue:e,cx:t,getStyles:n,getValue:r,hasValue:this.hasValue(),isMulti:u,isRtl:s,options:l,selectOption:o,selectProps:a,setValue:i,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return io(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return ao(this.props,e,t)}},{key:"filterOption",value:function(e,t){return uo(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var t=this.props,n=t.isDisabled,r=t.isSearchable,o=t.inputId,i=t.inputValue,a=t.tabIndex,u=t.form,s=this.getComponents().Input,l=this.state.inputIsHidden,c=this.commonProps,f=o||this.getElementId("input"),p={"aria-autocomplete":"list","aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"]};return r?e.default.createElement(s,Re({},c,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:f,innerRef:this.getInputRef,isDisabled:n,isHidden:l,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:a,form:u,type:"text",value:i},p)):e.default.createElement(Lr,Re({id:f,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Tn,onFocus:this.onInputFocus,readOnly:!0,disabled:n,tabIndex:a,form:u,value:""},p))}},{key:"renderPlaceholderOrValue",value:function(){var t=this,n=this.getComponents(),r=n.MultiValue,o=n.MultiValueContainer,i=n.MultiValueLabel,a=n.MultiValueRemove,u=n.SingleValue,s=n.Placeholder,l=this.commonProps,c=this.props,f=c.controlShouldRenderValue,p=c.isDisabled,d=c.isMulti,y=c.inputValue,m=c.placeholder,h=this.state,v=h.selectValue,b=h.focusedValue,g=h.isFocused;if(!this.hasValue()||!f)return y?null:e.default.createElement(s,Re({},l,{key:"placeholder",isDisabled:p,isFocused:g}),m);if(d){var S=v.map((function(n,u){var s=n===b;return e.default.createElement(r,Re({},l,{components:{Container:o,Label:i,Remove:a},isFocused:s,isDisabled:p,key:"".concat(t.getOptionValue(n)).concat(u),index:u,removeProps:{onClick:function(){return t.removeValue(n)},onTouchEnd:function(){return t.removeValue(n)},onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}},data:n}),t.formatOptionLabel(n,"value"))}));return S}if(y)return null;var w=v[0];return e.default.createElement(u,Re({},l,{data:w,isDisabled:p}),this.formatOptionLabel(w,"value"))}},{key:"renderClearIndicator",value:function(){var t=this.getComponents().ClearIndicator,n=this.commonProps,r=this.props,o=r.isDisabled,i=r.isLoading,a=this.state.isFocused;if(!this.isClearable()||!t||o||!this.hasValue()||i)return null;var u={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return e.default.createElement(t,Re({},n,{innerProps:u,isFocused:a}))}},{key:"renderLoadingIndicator",value:function(){var t=this.getComponents().LoadingIndicator,n=this.commonProps,r=this.props,o=r.isDisabled,i=r.isLoading,a=this.state.isFocused;return t&&i?e.default.createElement(t,Re({},n,{innerProps:{"aria-hidden":"true"},isDisabled:o,isFocused:a})):null}},{key:"renderIndicatorSeparator",value:function(){var t=this.getComponents(),n=t.DropdownIndicator,r=t.IndicatorSeparator;if(!n||!r)return null;var o=this.commonProps,i=this.props.isDisabled,a=this.state.isFocused;return e.default.createElement(r,Re({},o,{isDisabled:i,isFocused:a}))}},{key:"renderDropdownIndicator",value:function(){var t=this.getComponents().DropdownIndicator;if(!t)return null;var n=this.commonProps,r=this.props.isDisabled,o=this.state.isFocused,i={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return e.default.createElement(t,Re({},n,{innerProps:i,isDisabled:r,isFocused:o}))}},{key:"renderMenu",value:function(){var t=this,n=this.getComponents(),r=n.Group,o=n.GroupHeading,i=n.Menu,a=n.MenuList,u=n.MenuPortal,s=n.LoadingMessage,l=n.NoOptionsMessage,c=n.Option,f=this.commonProps,p=this.state.focusedOption,d=this.props,y=d.captureMenuScroll,m=d.inputValue,h=d.isLoading,v=d.loadingMessage,b=d.minMenuHeight,g=d.maxMenuHeight,S=d.menuIsOpen,w=d.menuPlacement,O=d.menuPosition,_=d.menuPortalTarget,A=d.menuShouldBlockScroll,E=d.menuShouldScrollIntoView,x=d.noOptionsMessage,j=d.onMenuScrollToTop,P=d.onMenuScrollToBottom;if(!S)return null;var C,k=function(n,r){var o=n.type,i=n.data,a=n.isDisabled,u=n.isSelected,s=n.label,l=n.value,d=p===i,y=a?void 0:function(){return t.onOptionHover(i)},m=a?void 0:function(){return t.selectOption(i)},h="".concat(t.getElementId("option"),"-").concat(r),v={id:h,onClick:m,onMouseMove:y,onMouseOver:y,tabIndex:-1};return e.default.createElement(c,Re({},f,{innerProps:v,data:i,isDisabled:a,isSelected:u,key:h,label:s,type:o,value:l,isFocused:d,innerRef:d?t.getFocusedOptionRef:void 0}),t.formatOptionLabel(n.data,"menu"))};if(this.hasOptions())C=this.getCategorizedOptions().map((function(n){if("group"===n.type){var i=n.data,a=n.options,u=n.index,s="".concat(t.getElementId("group"),"-").concat(u),l="".concat(s,"-heading");return e.default.createElement(r,Re({},f,{key:s,data:i,options:a,Heading:o,headingProps:{id:l,data:n.data},label:t.formatGroupLabel(n.data)}),n.options.map((function(e){return k(e,"".concat(u,"-").concat(e.index))})))}if("option"===n.type)return k(n,"".concat(n.index))}));else if(h){var T=v({inputValue:m});if(null===T)return null;C=e.default.createElement(s,f,T)}else{var D=x({inputValue:m});if(null===D)return null;C=e.default.createElement(l,f,D)}var M={minMenuHeight:b,maxMenuHeight:g,menuPlacement:w,menuPosition:O,menuShouldScrollIntoView:E},R=e.default.createElement(Xn,Re({},f,M),(function(n){var r=n.ref,o=n.placerProps,u=o.placement,s=o.maxHeight;return e.default.createElement(i,Re({},f,M,{innerRef:r,innerProps:{onMouseDown:t.onMenuMouseDown,onMouseMove:t.onMenuMouseMove},isLoading:h,placement:u}),e.default.createElement(qr,{captureEnabled:y,onTopArrive:j,onBottomArrive:P,lockEnabled:A},(function(n){return e.default.createElement(a,Re({},f,{innerRef:function(e){t.getMenuListRef(e),n(e)},isLoading:h,maxHeight:s,focusedOption:p}),C)})))}));return _||"fixed"===O?e.default.createElement(u,Re({},f,{appendTo:_,controlElement:this.controlRef,menuPlacement:w,menuPosition:O}),R):R}},{key:"renderFormField",value:function(){var t=this,n=this.props,r=n.delimiter,o=n.isDisabled,i=n.isMulti,a=n.name,u=this.state.selectValue;if(a&&!o){if(i){if(r){var s=u.map((function(e){return t.getOptionValue(e)})).join(r);return e.default.createElement("input",{name:a,type:"hidden",value:s})}var l=u.length>0?u.map((function(n,r){return e.default.createElement("input",{key:"i-".concat(r),name:a,type:"hidden",value:t.getOptionValue(n)})})):e.default.createElement("input",{name:a,type:"hidden"});return e.default.createElement("div",null,l)}var c=u[0]?this.getOptionValue(u[0]):"";return e.default.createElement("input",{name:a,type:"hidden",value:c})}}},{key:"renderLiveRegion",value:function(){var t=this.commonProps,n=this.state,r=n.ariaSelection,o=n.focusedOption,i=n.focusedValue,a=n.isFocused,u=n.selectValue,s=this.getFocusableOptions();return e.default.createElement(xr,Re({},t,{ariaSelection:r,focusedOption:o,focusedValue:i,isFocused:a,selectValue:u,focusableOptions:s}))}},{key:"render",value:function(){var t=this.getComponents(),n=t.Control,r=t.IndicatorsContainer,o=t.SelectContainer,i=t.ValueContainer,a=this.props,u=a.className,s=a.id,l=a.isDisabled,c=a.menuIsOpen,f=this.state.isFocused,p=this.commonProps=this.getCommonProps();return e.default.createElement(o,Re({},p,{className:u,innerProps:{id:s,onKeyDown:this.onKeyDown},isDisabled:l,isFocused:f}),this.renderLiveRegion(),e.default.createElement(n,Re({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:l,isFocused:f,menuIsOpen:c}),e.default.createElement(i,Re({},p,{isDisabled:l}),this.renderPlaceholderOrValue(),this.renderInput()),e.default.createElement(r,Re({},p,{isDisabled:l}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,r=t.clearFocusValueOnUpdate,o=t.inputIsHiddenAfterUpdate,i=e.options,a=e.value,u=e.menuIsOpen,s=e.inputValue,l={};if(n&&(a!==n.value||i!==n.options||u!==n.menuIsOpen||s!==n.inputValue)){var c=Rn(a),f=u?function(e,t){return to(eo(e,t))}(e,c):[],p=r?function(e,t){var n=e.focusedValue,r=e.selectValue.indexOf(n);if(r>-1){if(t.indexOf(n)>-1)return n;if(r-1?n:t[0]}(t,f);l={selectValue:c,focusedOption:d,focusedValue:p,clearFocusValueOnUpdate:!1}}var y=null!=o&&e!==n?{inputIsHidden:o,inputIsHiddenAfterUpdate:void 0}:{};return Pn(Pn(Pn({},l),y),{},{prevProps:e})}}]),r}(e.Component);co.defaultProps=Kr;var fo,po,yo,mo=(e.Component,fo=co,yo=po=function(t){_n(r,t);var n=kn(r);function r(){var e;bn(this,r);for(var t=arguments.length,o=new Array(t),i=0;i1?n-1:0),o=1;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1:"commenting"==e.purpose||"replying"==e.purpose;return"TextualBody"===e.type&&(!Object.prototype.hasOwnProperty.call(e,"purpose")||n)},No=function(e,t){if(!0===t.editable)return!1;if(!1===t.editable)return!0;if("MINE_ONLY"===t.editable){var n,r,o=null===(n=e.creator)||void 0===n?void 0:n.id;return(null===(r=t.env.user)||void 0===r?void 0:r.id)!==o}return t.readOnly},Io=function(t){var n,r,o=t.annotation?t.annotation.bodies.filter((function(e){return Ro(e,t.purposeSelector)})):[],i=(n=o.find((function(e){return 1==e.draft})),r=o.length>1,n||{type:"TextualBody",value:"",purpose:r?"replying":"commenting",draft:!0}),a=o.filter((function(e){return e!=i})),u=!t.readOnly&&t.annotation,s=0===a.length||!t.disableReply;return e.default.createElement(e.default.Fragment,null,a.map((function(n,r){return e.default.createElement(Po,{key:r,env:t.env,purposeSelector:t.purposeSelector,readOnly:No(n,t),body:n,onUpdate:t.onUpdateBody,onDelete:t.onRemoveBody,onSaveAndClose:t.onSaveAndClose})})),u&&s&&e.default.createElement("div",{className:"r6o-widget comment editable"},e.default.createElement(Me,{focus:t.focus,content:i.value,editable:!0,placeholder:a.length>0?_e.t("Add a reply..."):t.textPlaceHolder||_e.t("Add a comment..."),onChange:function(e){var n=i.value,r=e.target.value;0===n.length&&r.length>0?t.onAppendBody(To(To({},i),{},{value:r})):n.length>0&&0===r.length?t.onRemoveBody(i):t.onUpdateBody(i,To(To({},i),{},{value:r}))},onSaveAndClose:function(){return t.onSaveAndClose()}}),t.purposeSelector&&i.value.length>0&&e.default.createElement(bo,{editable:!0,content:i.purpose,onChange:function(e){return t.onUpdateBody(i,To(To({},i),{},{purpose:e.value}))},onSaveAndClose:function(){return t.onSaveAndClose()}})))};Io.disableDelete=function(e,t){return e.bodies.filter((function(e){return Ro(e,t.purposeSelector)})).some((function(e){return No(e,t)}))};const Lo=Io;function Bo(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,On(e,t)}function Uo(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}r(1752);const Fo=e.default.createContext(null);var Vo="unmounted",Ho="exited",zo="entering",Wo="entered",$o="exiting",Yo=function(t){function n(e,n){var r;r=t.call(this,e,n)||this;var o,i=n&&!n.isMounting?e.enter:e.appear;return r.appearStatus=null,e.in?i?(o=Ho,r.appearStatus=zo):o=Wo:o=e.unmountOnExit||e.mountOnEnter?Vo:Ho,r.state={status:o},r.nextCallback=null,r}Bo(n,t),n.getDerivedStateFromProps=function(e,t){return e.in&&t.status===Vo?{status:Ho}:null};var r=n.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==zo&&n!==Wo&&(t=zo):n!==zo&&n!==Wo||(t=$o)}this.updateStatus(!1,t)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},r.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),t===zo?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===Ho&&this.setState({status:Vo})},r.performEnter=function(t){var n=this,r=this.props.enter,o=this.context?this.context.isMounting:t,i=this.props.nodeRef?[o]:[e.default.findDOMNode(this),o],a=i[0],u=i[1],s=this.getTimeouts(),l=o?s.appear:s.enter;t||r?(this.props.onEnter(a,u),this.safeSetState({status:zo},(function(){n.props.onEntering(a,u),n.onTransitionEnd(l,(function(){n.safeSetState({status:Wo},(function(){n.props.onEntered(a,u)}))}))}))):this.safeSetState({status:Wo},(function(){n.props.onEntered(a)}))},r.performExit=function(){var t=this,n=this.props.exit,r=this.getTimeouts(),o=this.props.nodeRef?void 0:e.default.findDOMNode(this);n?(this.props.onExit(o),this.safeSetState({status:$o},(function(){t.props.onExiting(o),t.onTransitionEnd(r.exit,(function(){t.safeSetState({status:Ho},(function(){t.props.onExited(o)}))}))}))):this.safeSetState({status:Ho},(function(){t.props.onExited(o)}))},r.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},r.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},r.onTransitionEnd=function(t,n){this.setNextCallback(n);var r=this.props.nodeRef?this.props.nodeRef.current:e.default.findDOMNode(this),o=null==t&&!this.props.addEndListener;if(r&&!o){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[r,this.nextCallback],a=i[0],u=i[1];this.props.addEndListener(a,u)}null!=t&&setTimeout(this.nextCallback,t)}else setTimeout(this.nextCallback,0)},r.render=function(){var t=this.state.status;if(t===Vo)return null;var n=this.props,r=n.children,o=(n.in,n.mountOnEnter,n.unmountOnExit,n.appear,n.enter,n.exit,n.timeout,n.addEndListener,n.onEnter,n.onEntering,n.onEntered,n.onExit,n.onExiting,n.onExited,n.nodeRef,yn(n,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return e.default.createElement(Fo.Provider,{value:null},"function"==typeof r?r(t,o):e.default.cloneElement(e.default.Children.only(r),o))},n}(e.default.Component);function Xo(){}Yo.contextType=Fo,Yo.propTypes={},Yo.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Xo,onEntering:Xo,onEntered:Xo,onExit:Xo,onExiting:Xo,onExited:Xo},Yo.UNMOUNTED=Vo,Yo.EXITED=Ho,Yo.ENTERING=zo,Yo.ENTERED=Wo,Yo.EXITING=$o;const Go=Yo;var qo=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=Uo(n.className,r):n.setAttribute("class",Uo(n.className&&n.className.baseVal||"",r)));var n,r}))},Zo=function(t){function n(){for(var e,n=arguments.length,r=new Array(n),o=0;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){if(38===e.which)if(null===c)f(0);else{var n=Math.max(0,c-1);f(n)}else if(40===e.which)if(null===c)f(0);else{var r=Math.min(u.length-1,c+1);f(r)}}else 40===e.which&&Array.isArray(t.vocabulary)&&s(t.vocabulary)},onChange:function(e){var n=e.target.value;i(n),f(null),n?function(e){if("function"==typeof t.vocabulary){var n=(o=e,(0,t.vocabulary)(o));n.then?n.then(s):s(n)}else{var r=function(e,t){return t.filter((function(t){return(t.label?t.label:t).toLowerCase().startsWith(e.toLowerCase())}))}(e,t.vocabulary);s(r)}var o}(n):s([])},value:o,placeholder:t.placeholder})),e.default.createElement("ul",null,u.length>0&&u.map((function(t,n){return e.default.createElement("li",{key:"".concat(t.label?t.label:t).concat(n),onClick:p,onMouseEnter:function(){return f(n)},style:c===n?{backgroundColor:"#bde4ff"}:{}},t.label?t.label:t)}))))};function ti(e){return ti="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},ti(e)}function ni(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ri(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&e.default.createElement("ul",{className:"r6o-taglist"},o.map((function(n){return e.default.createElement("li",{key:c(n),onClick:s(n)},e.default.createElement("span",{className:"r6o-label"},c(n)),!t.readOnly&&e.default.createElement(Jo,{in:a===n,timeout:200,classNames:"r6o-delete"},e.default.createElement("span",{className:"r6o-delete-wrapper",onClick:l(n)},e.default.createElement("span",{className:"r6o-delete"},e.default.createElement(So,{width:12})))))}))),!t.readOnly&&e.default.createElement(ei,{focus:t.focus,placeholder:t.textPlaceHolder||_e.t("Add tag..."),vocabulary:t.vocabulary||[],onChange:function(e){var n=r.value.trim(),o=e.trim();0===n.length&&o.length>0?t.onAppendBody(ri(ri({},r),{},{value:o})):n.length>0&&0===o.length?t.onRemoveBody(r):n!==o&&t.onUpdateBody(r,ri(ri({},r),{},{value:o}))},onSubmit:function(e){var n=e.uri?{type:"SpecificResource",purpose:"tagging",source:{id:e.uri,label:e.label}}:{type:"TextualBody",purpose:"tagging",value:e.label||e};0===r.value.trim().length?t.onAppendBody(n):t.onUpdateBody(r,n)}}))};function ui(e){return ui="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},ui(e)}function si(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function li(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,hi),o)}return n(t)};const Si=function(e,t,n,r){var o=e.getBoundingClientRect();t.className="r6o-editor r6o-arrow-top r6o-arrow-left";var i=n.getBoundingClientRect(),a=i.left,u=i.top,s=i.right,l=i.bottom;if(t.style.top="".concat(l-o.top+14,"px"),t.style.left="".concat(a-o.left,"px"),r){var c=t.children[1].getBoundingClientRect(),f=e.ownerDocument.defaultView,p=f.innerWidth,d=f.innerHeight;if(c.right>p&&(t.classList.remove("r6o-arrow-left"),t.classList.add("r6o-arrow-right"),t.style.left="".concat(s-c.width-o.left,"px")),c.bottom>d){t.classList.remove("r6o-arrow-top"),t.classList.add("r6o-arrow-bottom");var y=t.children[1].getBoundingClientRect().height;t.style.top="".concat(u-o.top-y-14,"px")}var m=t.children[1].getBoundingClientRect();if(m.top<0){t.classList.add("pushed","down"),t.style.top="".concat(-o.top,"px");var h=l-o.top;m.height-o.top>h&&t.classList.remove("r6o-arrow-bottom")}m.left<0&&(t.classList.add("pushed","right"),t.style.left="".concat(-o.left,"px")),requestAnimationFrame((function(){return t.style.opacity=1}))}};var wi=["draft"];function Oi(e){return Oi="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},Oi(e)}function _i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ai(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,wi)}))})},t=n.state.currentAnnotation;0!==t.bodies.length||n.props.allowEmpty?t.isSelection?n.props.onAnnotationCreated(e(t).toAnnotation()):n.props.onAnnotationUpdated(e(t),n.props.annotation):t.isSelection?n.onCancel():n.props.onAnnotationDeleted(n.props.annotation)})),Ti(Ci(n),"onDelete",(function(){return n.props.onAnnotationDeleted(n.props.annotation)})),n.element=e.default.createRef(),n.state={currentAnnotation:t.annotation,dragged:!1,selectionBounds:Ri(t.selectedElement)},n}return n=s,r=[{key:"componentWillReceiveProps",value:function(e){var t,n=this.state.selectionBounds,r=Ri(e.selectedElement);null!==(t=this.props.annotation)&&void 0!==t&&t.isEqual(e.annotation)?this.setState({selectionBounds:r}):this.setState({currentAnnotation:e.annotation,selectionBounds:r}),this.props.modifiedTarget!=e.modifiedTarget&&this.state.currentAnnotation&&this.updateCurrentAnnotation({target:this.props.modifiedTarget}),n!=r&&this.element.current&&(this.removeObserver&&this.removeObserver(),this.removeObserver=this.initResizeObserver())}},{key:"componentDidMount",value:function(){var e=this;this.removeObserver=this.initResizeObserver(),new MutationObserver((function(){e.element.current&&(e.removeObserver&&e.removeObserver(),e.removeObserver=e.initResizeObserver())})).observe(this.element.current,{childList:!0,subtree:!0})}},{key:"componentWillUnmount",value:function(){this.removeObserver&&this.removeObserver()}},{key:"render",value:function(){var t=this,n=this.state.currentAnnotation,r=this.props.widgets?this.props.widgets.map(gi):bi,o=n&&(n.bodies.length>0||this.props.allowEmpty)&&!this.props.readOnly&&!n.isSelection&&!r.some((function(e){return!!e.type.disableDelete&&e.type.disableDelete(n,Ai(Ai({},e.props),{},{readOnly:t.props.readOnly,env:t.props.env}))}));return e.default.createElement(a(),{disabled:!this.props.detachable,handle:".r6o-draggable",cancel:".r6o-btn, .r6o-btn *",onDrag:function(){return t.setState({dragged:!0})}},e.default.createElement("div",{ref:this.element,className:this.state.dragged?"r6o-editor dragged":"r6o-editor"},e.default.createElement("div",{className:"r6o-arrow"}),e.default.createElement("div",{className:"r6o-editor-inner"},r.map((function(r,o){return e.default.cloneElement(r,{key:"".concat(o),focus:0===o,annotation:n,readOnly:t.props.readOnly,env:t.props.env,onAppendBody:t.onAppendBody,onUpdateBody:t.onUpdateBody,onRemoveBody:t.onRemoveBody,onUpsertBody:t.onUpsertBody,onBatchModify:t.onBatchModify,onSetProperty:t.onSetProperty,onAddContext:t.onAddContext,onSaveAndClose:t.onOk})})),this.props.readOnly?e.default.createElement("div",{className:"r6o-footer"},e.default.createElement("button",{className:"r6o-btn",onClick:this.onCancel},_e.t("Close"))):e.default.createElement("div",{className:this.props.detachable?"r6o-footer r6o-draggable":"r6o-footer"},o&&e.default.createElement("button",{className:"r6o-btn left delete-annotation",title:_e.t("Delete"),onClick:this.onDelete},e.default.createElement(wo,{width:12})),e.default.createElement("button",{className:"r6o-btn outline",onClick:this.onCancel},_e.t("Cancel")),e.default.createElement("button",{className:"r6o-btn ",onClick:this.onOk},_e.t("Ok"))))))}}],r&&ji(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(e.Component),Ii=r(2593),Li=r.n(Ii),Bi="http://www.w3.org/2000/svg",Ui=function(e){var t=e.getAttribute("class");return t?new Set(t.split(" ")):new Set},Fi=function(e,t){var n=Ui(e);n.add(t),e.setAttribute("class",Array.from(n).join(" "))},Vi=function(e,t){var n=Ui(e);n.delete(t),0===n.size?e.removeAttribute("class"):e.setAttribute("class",Array.from(n).join(" "))},Hi=function(e,t){return Ui(e).has(t)},zi=new Uint8Array(16);function Wi(){if(!Mi&&!(Mi="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Mi(zi)}const $i=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var Yi=[],Xi=0;Xi<256;++Xi)Yi.push((Xi+256).toString(16).substr(1));const Gi=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Yi[e[t+0]]+Yi[e[t+1]]+Yi[e[t+2]]+Yi[e[t+3]]+"-"+Yi[e[t+4]]+Yi[e[t+5]]+"-"+Yi[e[t+6]]+Yi[e[t+7]]+"-"+Yi[e[t+8]]+Yi[e[t+9]]+"-"+Yi[e[t+10]]+Yi[e[t+11]]+Yi[e[t+12]]+Yi[e[t+13]]+Yi[e[t+14]]+Yi[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&$i.test(e)}(n))throw TypeError("Stringified UUID is invalid");return n},qi=function(e,t,n){var r=(e=e||{}).random||(e.rng||Wi)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return Gi(r)};var Zi=r(3094),Ji=r.n(Zi);function Ki(e){return Ki="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},Ki(e)}function Qi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ea(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?this.anchor[0]:this.opposite[0],y:t>0?this.anchor[1]:this.opposite[1],w:Math.max(1,Math.abs(e)),h:Math.max(1,Math.abs(t))}}},{key:"element",get:function(){return this.rect}}],n&&_a(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),ja={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup"},Pa=function(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0};function Ca(e){return Ca="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},Ca(e)}function ka(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ta(e,t){for(var n=0;nu?u:r,c=o<0?0:o>s?s:o;i.startDrawing(l,c,t,e)})),Ba(Ia(i),"startDrawing",(function(e){throw new Error(Fa)})),Ba(Ia(i),"createEditableShape",(function(e,t){throw new Error(Fa)})),i.started=!1,i}return Da(n,[{key:"isDrawing",get:function(){throw new Error(Fa)}}]),n}(Ha);function Wa(e){return Wa="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},Wa(e)}function $a(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?r.x:n.x,s=a>0?r.y:n.y,l=Math.abs(i),c=Math.abs(a);return o.setSize(u,s,l,c),{x:u,y:s,w:l,h:c}})),pu(cu(o),"stretchEdge",(function(e,t,n){var r=o.getHandleXY(t),i=Sa(o.rectangle),a=e%2==0,u=a?i.w:n.x-r.x,s=a?n.y-r.y:i.h,l=a?i.x:u>0?r.x:n.x,c=a?s>0?r.y:n.y:i.y,f=Math.abs(u),p=Math.abs(s);return o.setSize(l,c,f,p),{x:l,y:c,w:f,h:p}})),pu(cu(o),"onGrab",(function(e,t){return function(n){if(0===n.button){o.grabbedElem=e,o.grabbedType=t;var r=o.getSVGPoint(n),i=Sa(o.rectangle),a=i.x,u=i.y;o.mouseOffset={x:r.x-a,y:r.y-u}}}})),pu(cu(o),"onMouseMove",(function(e){if(0===e.button){var t=function(e,t){return e<0?0:e>t?t:e};if(o.grabbedElem){var n=o.getSVGPoint(e);if(o.grabbedElem===o.rectangle){var r=Sa(o.rectangle),i=r.w,a=r.h,u=o.env.image,s=u.naturalWidth,l=u.naturalHeight,c=t(n.x-o.mouseOffset.x,s-i),f=t(n.y-o.mouseOffset.y,l-a);o.setSize(c,f,i,a),o.emit("update",ya(c,f,i,a,o.env.image,o.config.fragmentUnit))}else{var p=o.handles.indexOf(o.grabbedElem),d=o.handles[2^p],y=o.grabbedType===yu?o.stretchCorners(p,d,n):o.stretchEdge(p,d,n),m=y.x,h=y.y,v=y.w,b=y.h;o.emit("update",ya(m,h,v,b,o.env.image,o.config.fragmentUnit))}}}})),pu(cu(o),"onMouseUp",(function(e){o.grabbedElem=null,o.grabbedType=null,o.mouseOffset=null})),pu(cu(o),"updateState",(function(e){var t=da(e,o.env.image),n=t.x,r=t.y,i=t.w,a=t.h;o.setSize(n,r,i,a)})),o.svg.addEventListener("mousemove",o.onMouseMove),o.svg.addEventListener("mouseup",o.onMouseUp);var u=da(e,r.image),s=u.x,l=u.y,c=u.w,f=u.h;o.containerGroup=document.createElementNS(Bi,"g"),o.mask=va(r.image,s,l,c,f),o.mask.setAttribute("class","a9s-selection-mask"),o.containerGroup.appendChild(o.mask),o.elementGroup=document.createElementNS(Bi,"g"),o.elementGroup.setAttribute("class","a9s-annotation editable selected"),o.elementGroup.setAttribute("data-id",e.id),o.rectangle=ga(s,l,c,f),o.rectangle.querySelector(".a9s-inner").addEventListener("mousedown",o.onGrab(o.rectangle)),o.elementGroup.appendChild(o.rectangle),o.enableEdgeControls=n.enableEdgeControls;var p=o.enableEdgeControls?[[s+c/2,l,mu],[s+c,l+f/2,mu],[s+c/2,l+f,mu],[s,l+f/2,mu]]:[];return o.handles=[[s,l,yu],[s+c,l,yu],[s+c,l+f,yu],[s,l+f,yu]].concat(p).map((function(e){var t=iu(e,3),n=t[0],r=t[1],i=t[2],a=o.drawHandle(n,r);return a.addEventListener("mousedown",o.onGrab(a,i)),o.elementGroup.appendChild(a),a})),o.containerGroup.appendChild(o.elementGroup),t.appendChild(o.containerGroup),nu(o.rectangle,e,n.formatters),o.grabbedElem=null,o.grabbedType=null,o.mouseOffset=null,o}return t=a,(n=[{key:"element",get:function(){return this.elementGroup}},{key:"destroy",value:function(){this.containerGroup.parentNode.removeChild(this.containerGroup),su(fu(a.prototype),"destroy",this).call(this)}}])&&uu(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(Ja);function vu(e){return vu="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},vu(e)}function bu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gu(e){for(var t=1;t=o&&n>=i){var a=r.rubberband.element;a.annotation=r.rubberband.toSelection(),r.emit("complete",a)}else r.emit("cancel");r.stop()})),Au(Ou(r),"createEditableShape",(function(e,t){return new hu(e,r.g,gu(gu({},r.config),{},{formatters:t}),r.env)})),r.rubberband=null,r}return t=a,(n=[{key:"isDrawing",get:function(){return null!=this.rubberband}}])&&Su(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(za);function ju(e){return function(e){if(Array.isArray(e))return ku(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Cu(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pu(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Cu(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Cu(e,t){if(e){if("string"==typeof e)return ku(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(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ku(e,t):void 0}}function ku(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nr!=c>r&&n<(l-u)*(r-s)/(c-s)+u&&(o=!o)}return o},Mu=function(e){var t,n=[],r=[],o=Pu(e.getAttribute("d").split(/(?=M|m|L|l|H|h|V|v|Z|z)/g).map((function(e){return e.trim()})));try{for(o.s();!(t=o.n()).done;){var i=t.value,a=i.substring(0,1);if("z"===a.toLowerCase())n.push(ju(r)),r=[];else{var u=i.substring(1).split(" ").map((function(e){return parseFloat(e.trim())})),s=a===a.toUpperCase(),l=s?u[0]:u[0]+r[r.length-1][0],c=s?u[1]:u[1]+r[r.length-1][1];r.push([l,c])}}}catch(e){o.e(e)}finally{o.f()}return r.length>0&&n.push(ju(r)),n};function Ru(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n",'')),(new DOMParser).parseFromString(n,"image/svg+xml").documentElement)).firstChild}},Lu=function(e){var t=Iu(e),n=document.createElementNS(Bi,"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},Bu=function(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(Bi,'"'),""),{source:null==t?void 0:t.src,selector:{type:"SvgSelector",value:"".concat(r,"")}}},Uu=function(e){var t=Mu(e);if(1==t.length)return Tu(t[0]);var n,r=function(e){return t.find((function(t){if(e!==t)return function(e,t){var n,r=Pu(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(!Du(o,t))return!1}}catch(e){r.e(e)}finally{r.f()}return!0}(e,t)}))},o=0,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ru(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(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ru(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(i.s();!(n=i.n()).done;){var a=n.value;r(a)?o-=Tu(a):o+=Tu(a)}}catch(e){i.e(e)}finally{i.f()}return o};function Fu(e){return Fu="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},Fu(e)}function Vu(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n4&&(o.points=[].concat(Yu(o.points),[o.mousepos]),o.setPoints(o.points),o.mask.redraw())})),Zu(this,"destroy",(function(){o.group.parentNode.removeChild(o.group),o.polygon=null,o.group=null})),Zu(this,"toSelection",(function(){return new fa(Bu(o.group,o.env.image))})),this.points=[t],this.env=r,this.mousepos=t,this.group=document.createElementNS(Bi,"g"),this.polygon=document.createElementNS(Bi,"g"),this.polygon.setAttribute("class","a9s-selection"),this.outer=document.createElementNS(Bi,"polygon"),this.outer.setAttribute("class","a9s-outer"),this.inner=document.createElementNS(Bi,"polygon"),this.inner.setAttribute("class","a9s-inner"),this.setPoints(this.points),this.mask=new Wu(r.image,this.inner),this.polygon.appendChild(this.outer),this.polygon.appendChild(this.inner),this.group.style.display="none",this.group.appendChild(this.mask.element),this.group.appendChild(this.polygon),n.appendChild(this.group)}var t,n;return t=e,(n=[{key:"element",get:function(){return this.polygon}}])&&qu(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Qu(e){return Qu="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},Qu(e)}function es(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nn?n-e:t};if(u.grabbedElem){var n=u.getSVGPoint(e);if(u.grabbedElem===u.shape){var r=u.shape.querySelector(".a9s-inner").getBBox(),o=r.x,i=r.y,a=r.width,s=r.height,l=u.env.image,c=l.naturalWidth,f=l.naturalHeight,p=t(o,n.x-u.grabbedAt.x,c-a),d=t(i,n.y-u.grabbedAt.y,f-s),y=ss(u.shape).map((function(e){return{x:e.x+p,y:e.y+d}}));u.grabbedAt=n,u.setPoints(y),y.forEach((function(e,t){return u.setHandleXY(u.handles[t],e.x,e.y)})),u.emit("update",Bu(u.shape,u.env.image))}else{var m=u.handles.indexOf(u.grabbedElem),h=ss(u.shape).map((function(e,t){return t===m?n:e}));u.setPoints(h),u.setHandleXY(u.handles[m],n.x,n.y),u.emit("update",Bu(u.shape,u.env.image))}}})),as(rs(u),"onMouseUp",(function(e){u.grabbedElem=null,u.grabbedAt=null})),as(rs(u),"updateState",(function(e){var t=Iu(e).getAttribute("points").split(" ").map((function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,u=[],s=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);s=!0);}catch(e){l=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return es(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(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?es(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.split(",").map((function(e){return parseFloat(e.trim())})),2);return{x:t[0],y:t[1]}}));u.setPoints(t),t.forEach((function(e,t){return u.setHandleXY(u.handles[t],e.x,e.y)}))})),as(rs(u),"destroy",(function(){u.containerGroup.parentNode.removeChild(u.containerGroup),os((o=rs(u),is(a.prototype)),"destroy",o).call(o)})),u.svg.addEventListener("mousemove",u.onMouseMove),u.svg.addEventListener("mouseup",u.onMouseUp),u.containerGroup=document.createElementNS(Bi,"g"),u.shape=Lu(e),u.shape.querySelector(".a9s-inner").addEventListener("mousedown",u.onGrab(u.shape)),u.mask=new Wu(r.image,u.shape.querySelector(".a9s-inner")),u.containerGroup.appendChild(u.mask.element),u.elementGroup=document.createElementNS(Bi,"g"),u.elementGroup.setAttribute("class","a9s-annotation editable selected"),u.elementGroup.setAttribute("data-id",e.id),u.elementGroup.appendChild(u.shape),u.handles=ss(u.shape).map((function(e){var t=u.drawHandle(e.x,e.y);return t.addEventListener("mousedown",u.onGrab(t)),u.elementGroup.appendChild(t),t})),u.containerGroup.appendChild(u.elementGroup),t.appendChild(u.containerGroup),nu(u.shape,e,n.formatters),u.grabbedElem=null,u.grabbedAt=null,u}return t=a,(n=[{key:"element",get:function(){return this.elementGroup}}])&&ts(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(Ja);function cs(e){return cs="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},cs(e)}function fs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ps(e){for(var t=1;t=o||n>=i?r.rubberband.addPoint():r._startOnSingleClick||(r.emit("cancel"),r.stop())})),vs(ms(r),"onDblClick",(function(){r._isDrawing=!1;var e=r.rubberband.element;e.annotation=r.rubberband.toSelection(),r.emit("complete",e),r.stop()})),vs(ms(r),"createEditableShape",(function(e,t){return new ls(e,r.g,ps(ps({},r.config),{},{formatters:t}),r.env)})),r._isDrawing=!1,r._startOnSingleClick=!1,r}return t=a,(n=[{key:"isDrawing",get:function(){return this._isDrawing}}])&&ds(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(za);function Ss(e){return Ss="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},Ss(e)}function ws(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0)return i.sort((function(e,t){return Ms(e,n.env.image)-Ms(t,n.env.image)})),i[0]})),$s(this,"getAnnotationsIntersecting",(function(e){var t=e.minX,r=t?e:Xs(e,n.env.image),o=n.spatial_index.search(r).map((function(e){return e.annotation}));return t?o:o.filter((function(t){return!t.isEqual(e)}))})),$s(this,"insert",(function(e){(Array.isArray(e)?e:[e]).forEach((function(e){n.spatial_index.insert(Hs(Hs({},Xs(e,n.env.image)),{},{annotation:e}))}))})),$s(this,"getBounds",(function(e){return n.getBounds(e,n.env.image)})),$s(this,"remove",(function(e){var t=Hs(Hs({},Xs(e,n.env.image)),{},{annotation:e});n.spatial_index.remove(t,(function(e,t){return e.annotation.id===t.annotation.id}))})),this.env=t,t.store=this,this.spatial_index=new(Us())})),qs=function(e,t){var n=(Hi(t,".a9s-annotation")?t:t.closest(".a9s-annotation")).querySelector(".a9s-outer").getBoundingClientRect(),r=e.drawer.canvas,o=r.getBoundingClientRect(),i=r.width/o.width,a=r.height/o.height,u=n.x-o.x,s=n.y-o.y,l=n.width,c=n.height,f=document.createElement("CANVAS"),p=f.getContext("2d");f.width=l,f.height=c,p.drawImage(r,u*i,s*a,l*i,c*a,0,0,l,c);var d=e.viewport.viewerElementToImageCoordinates(new OpenSeadragon.Point(u,s)),y=e.viewport.viewportToImageZoom(e.viewport.getZoom());return{snippet:f,transform:function(e){return[d.x+e[0]/i/y,d.y+e[1]/a/y]}}};function Zs(e){return Zs="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},Zs(e)}function Js(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ks(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0,n=(yl[e[t+0]]+yl[e[t+1]]+yl[e[t+2]]+yl[e[t+3]]+"-"+yl[e[t+4]]+yl[e[t+5]]+"-"+yl[e[t+6]]+yl[e[t+7]]+"-"+yl[e[t+8]]+yl[e[t+9]]+"-"+yl[e[t+10]]+yl[e[t+11]]+yl[e[t+12]]+yl[e[t+13]]+yl[e[t+14]]+yl[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&dl.test(e)}(n))throw TypeError("Stringified UUID is invalid");return n},vl=function(e,t,n){var r=(e=e||{}).random||(e.rng||pl)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return hl(r)};var bl=r(286),gl=r.n(bl);function Sl(e){return Sl="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},Sl(e)}function wl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ol(e){for(var t=1;t".concat(c,"")}})}if("FragmentSelector"===i.type){var f=da(a),p=f.x,d=f.y,y=f.w,m=f.h,h=r.x+p/o,v=r.y+d/o,b=y/o,g=m/o;return 0===y&&0===m?Cl(Cl({},ya(h,v,b,g)),{},{renderedVia:{name:"point"}}):ya(h,v,b,g)}throw"Unsupported selector type: ".concat(i.type)},Ml=function(e,t,n){var r=Array.from(e.points).map((function(e){return t.x+e.x/n+","+(t.y+e.y/n)})).join(" ");return e.setAttribute("points",r),e},Rl=function(e,t,n){var r=parseFloat(e.getAttribute("cx")),o=parseFloat(e.getAttribute("cy")),i=parseFloat(e.getAttribute("r"));return e.setAttribute("cx",t.x+r/n),e.setAttribute("cy",t.y+o/n),e.setAttribute("r",i/n),e},Nl=function(e,t,n){var r=parseFloat(e.getAttribute("cx")),o=parseFloat(e.getAttribute("cy")),i=parseFloat(e.getAttribute("rx")),a=parseFloat(e.getAttribute("ry"));return e.setAttribute("cx",t.x+r/n),e.setAttribute("cy",t.y+o/n),e.setAttribute("rx",i/n),e.setAttribute("ry",a/n),e},Il=function(e,t,n){var r=e.getAttribute("d").split(/(?=M|m|L|l|H|h|V|v|Z|z)/g).map((function(e){return e.trim()})).map((function(e){var r=e.substring(0,1);if("z"===r.toLowerCase())return r;var o=e.substring(1).split(" ").map((function(e){return parseFloat(e.trim())})),i=r===r.toUpperCase();return r+" "+(i?t.x+o[0]/n:o[0]/n)+" "+(i?t.y+o[1]/n:o[1]/n)})).join(" ");return e.setAttribute("d",r),e},Ll=function(e,t){var n=Tl(e),r=n.extent,o=n.scale,i=t.selector("FragmentSelector");if(t.selector("SvgSelector")){var a=Iu(t),u=a.nodeName.toLowerCase(),s=null;if("polygon"===u)s=Bl(a,r,o);else if("circle"===u)s=Ul(a,r,o);else if("ellipse"===u)s=Fl(a,r,o);else{if("path"!==u)throw"Unsupported SVG shape type: ".concat(u);s=Vl(a,r,o)}var l=s.outerHTML||(new XMLSerializer).serializeToString(s);l=l.replace(' xmlns="'.concat(Bi,'"'),"");var c={selector:{type:"SvgSelector",value:"".concat(l,"")}};return t.clone({target:c})}if(i){var f=da(t),p=f.x,d=f.y,y=f.w,m=f.h,h=(p-r.x)*o,v=(d-r.y)*o,b=ya(h,v,y*o,m*o);return t.clone({target:b})}},Bl=function(e,t,n){var r=Array.from(e.points).map((function(e){return n*(e.x-t.x)+","+n*(e.y-t.y)})).join(" ");return e.setAttribute("points",r),e},Ul=function(e,t,n){var r=e.getAttribute("cx"),o=e.getAttribute("cy"),i=e.getAttribute("r");return e.setAttribute("cx",n*(r-t.x)),e.setAttribute("cy",n*(o-t.y)),e.setAttribute("r",i*n),e},Fl=function(e,t,n){var r=e.getAttribute("cx"),o=e.getAttribute("cy"),i=e.getAttribute("rx"),a=e.getAttribute("ry");return e.setAttribute("cx",n*(r-t.x)),e.setAttribute("cy",n*(o-t.y)),e.setAttribute("rx",i*n),e.setAttribute("ry",a*n),e},Vl=function(e,t,n){var r=e.getAttribute("d").split(/(?=M|m|L|l|H|h|V|v|Z|z)/g).map((function(e){return e.trim()})).map((function(e){var r=e.substring(0,1);if("z"===r.toLowerCase())return r;var o=e.substring(1).split(" ").filter((function(e){return e})).map((function(e){return parseFloat(e.trim())})),i=r===r.toUpperCase();return r+" "+(i?n*(o[0]-t.x):n*o[0])+" "+(i?n*(o[1]-t.y):n*o[1])})).join(" ");return e.setAttribute("d",r),e},Hl=function(e,t){var n,r,o=Tl(e),i=o.extent,a=o.scale,u=(r=t.annotation.targets[0])?Array.isArray(r.selector)?r.selector[0].type:null===(n=r.selector)||void 0===n?void 0:n.type:null;if("FragmentSelector"===u)zl(t,i,a);else{if("SvgSelector"!==u)throw"Unsupported selector type type: ".concat(u);Wl(t,i,a)}var s=t.querySelector(".a9s-formatter-el");if(s){var l=t.querySelector(".a9s-inner").getBBox(),c=l.x,f=l.y;s.setAttribute("x",c),s.setAttribute("y",f)}},zl=function(e,t,n){var r=da(e.annotation),o=r.x,i=r.y,a=r.w,u=r.h,s=e.querySelector(".a9s-outer"),l=e.querySelector(".a9s-inner"),c=n*(o-t.x),f=n*(i-t.y);[s,l].forEach(0===a&&0===u?function(e){e.setAttribute("cx",c),e.setAttribute("cy",f)}:function(e){e.setAttribute("x",c),e.setAttribute("y",f),e.setAttribute("width",a*n),e.setAttribute("height",u*n)})},Wl=function(e,t,n){var r=Iu(e.annotation),o=r.nodeName.toLowerCase();if("polygon"===o)$l(e,r,t,n);else if("circle"===o)Yl(e,r,t,n);else if("ellipse"===o)Xl(e,r,t,n);else{if("path"!==o)throw"Unsupported SVG shape type: ".concat(o);Gl(e,r,t,n)}},$l=function(e,t,n,r){var o=Array.from(t.points).map((function(e){return r*(e.x-n.x)+","+r*(e.y-n.y)})).join(" ");e.querySelector(".a9s-outer").setAttribute("points",o),e.querySelector(".a9s-inner").setAttribute("points",o)},Yl=function(e,t,n,r){var o=r*(t.getAttribute("cx")-n.x),i=r*(t.getAttribute("cy")-n.y),a=r*t.getAttribute("r"),u=e.querySelector(".a9s-outer");u.setAttribute("cx",o),u.setAttribute("cy",i),u.setAttribute("r",a);var s=e.querySelector(".a9s-inner");s.setAttribute("cx",o),s.setAttribute("cy",i),s.setAttribute("r",a)},Xl=function(e,t,n,r){var o=r*(t.getAttribute("cx")-n.x),i=r*(t.getAttribute("cy")-n.y),a=r*t.getAttribute("rx"),u=r*t.getAttribute("ry"),s=e.querySelector(".a9s-outer");s.setAttribute("cx",o),s.setAttribute("cy",i),s.setAttribute("rx",a),s.setAttribute("ry",u);var l=e.querySelector(".a9s-inner");l.setAttribute("cx",o),l.setAttribute("cy",i),l.setAttribute("rx",a),l.setAttribute("ry",u)},Gl=function(e,t,n,r){var o=t.getAttribute("d").split(/(?=M|m|L|l|H|h|V|v|Z|z)/g).map((function(e){return e.trim()})).map((function(e){var t=e.substring(0,1);if("z"===t.toLowerCase())return t;var o=e.substring(1).split(" ").filter((function(e){return e})).map((function(e){return parseFloat(e.trim())})),i=t===t.toUpperCase();return t+" "+(i?r*(o[0]-n.x):r*o[0])+" "+(i?r*(o[1]-n.y):r*o[1])})).join(" ");e.querySelector(".a9s-inner").setAttribute("d",o),e.querySelector(".a9s-outer").setAttribute("d",o)};function ql(e){return ql="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},ql(e)}function Zl(e,t){for(var n=0;n0||n.props.config.allowEmpty?n.onCreateOrUpdateAnnotation("onAnnotationCreated",e)(t):(n.annotationLayer.deselect(),e());else{var r=n.state,o=r.beforeHeadlessModify,i=r.modifiedTarget;o?n.onCreateOrUpdateAnnotation("onAnnotationUpdated",e)(t,o):i?n.onCreateOrUpdateAnnotation("onAnnotationUpdated",e)(t,t):n.onCancelAnnotation(t,e)}else e()}))})),lc(uc(n),"selectAnnotation",(function(e){var t=n.annotationLayer.selectAnnotation(e,!0);if(t)return n.handleSelect(t,!0),t.annotation.clone();n.clearState()})),lc(uc(n),"setAnnotations",(function(e){return n.annotationLayer.init(e.map((function(e){return e.clone()})))})),lc(uc(n),"setDrawingEnabled",(function(e){return n.annotationLayer.setDrawingEnabled(e)})),lc(uc(n),"setDrawingTool",(function(e){return n.annotationLayer.setDrawingTool(e)})),lc(uc(n),"setVisible",(function(e){n.annotationLayer.setVisible(e),e||n.clearState()})),lc(uc(n),"updateSelected",(function(e,t){return new Promise((function(r){n.state.selectedAnnotation&&(t?n.state.selectedAnnotation.isSelection?n.onCreateOrUpdateAnnotation("onAnnotationCreated",r)(e):n.onCreateOrUpdateAnnotation("onAnnotationUpdated",r)(e,n.state.selectedAnnotation):n.setState({selectedAnnotation:e,beforeHeadlessModify:n.state.beforeHeadlessModify||n.state.selectedAnnotation},r))}))})),n.state={selectedAnnotation:null,selectedDOMElement:null,modifiedTarget:null,readOnly:t.config.readOnly,editorDisabled:t.config.disableEditor,widgets:t.config.widgets,beforeHeadlessModify:null},n._editor=e.default.createRef(),n}return n=u,(r=[{key:"componentDidMount",value:function(){this.annotationLayer=this.props.config.gigapixelMode?new rc(this.props):new cl(this.props),this.annotationLayer.on("load",this.props.onLoad),this.annotationLayer.on("startSelection",this.handleStartSelect),this.annotationLayer.on("endSelection",this.handleEndSelect),this.annotationLayer.on("select",this.handleSelect),this.annotationLayer.on("updateTarget",this.handleUpdateTarget),this.annotationLayer.on("viewportChange",this.handleViewportChange),this.forwardEvent("clickAnnotation","onClickAnnotation"),this.forwardEvent("mouseEnterAnnotation","onMouseEnterAnnotation"),this.forwardEvent("mouseLeaveAnnotation","onMouseLeaveAnnotation"),document.addEventListener("keyup",this.onKeyUp)}},{key:"componentWillUnmount",value:function(){this.annotationLayer.destroy(),document.removeEventListener("keyup",this.onKeyUp)}},{key:"disableEditor",get:function(){return this.state.editorDisabled},set:function(e){this.setState({editorDisabled:e})}},{key:"disableSelect",get:function(){return this.annotationLayer.disableSelect},set:function(e){this.annotationLayer.disableSelect=e}},{key:"formatters",get:function(){return this.annotationLayer.formatters},set:function(e){this.annotationLayer.formatters=e}},{key:"readOnly",get:function(){return this.state.readOnly},set:function(e){this.annotationLayer.readOnly=e,this.setState({readOnly:e})}},{key:"widgets",get:function(){return this.state.widgets},set:function(e){this.setState({widgets:e})}},{key:"render",value:function(){var t,n=this.state.selectedAnnotation&&!this.state.editorDisabled,r=this.state.readOnly||(null===(t=this.state.selectedAnnotation)||void 0===t?void 0:t.readOnly);return n&&e.default.createElement(Ni,{ref:this._editor,detachable:!0,wrapperEl:this.props.wrapperEl,annotation:this.state.selectedAnnotation,modifiedTarget:this.state.modifiedTarget,selectedElement:this.state.selectedDOMElement,readOnly:r,allowEmpty:this.props.config.allowEmpty,widgets:this.state.widgets,env:this.props.env,onAnnotationCreated:this.onCreateOrUpdateAnnotation("onAnnotationCreated"),onAnnotationUpdated:this.onCreateOrUpdateAnnotation("onAnnotationUpdated"),onAnnotationDeleted:this.onDeleteAnnotation,onCancel:this.onCancelAnnotation})}}])&&ic(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),u}(e.Component);function pc(e){return pc="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},pc(e)}function dc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yc(e){for(var t=1;t