@bimdata/viewer 2.11.0 → 2.11.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @copyright 2014-2015 J\xE9r\xE9my Heleine
|
|
4
4
|
* @copyright 2015-2025 Damien "Mistic" Sorel
|
|
5
5
|
* @licence MIT (https://opensource.org/licenses/MIT)
|
|
6
|
-
*/.psv-container{--psv-core-loaded: true;container-name:psv-container;container-type:size;width:100%;height:100%;margin:0;padding:0;position:relative;background:radial-gradient(#fff,#fdfdfd 16%,#fbfbfb 33%,#f8f8f8 49%,#efefef 66%,#dfdfdf 82%,#bfbfbf);overflow:hidden}.psv-container *{box-sizing:content-box}.psv-canvas-container{position:absolute;top:0;left:0;z-index:0;transition:opacity linear .1s}.psv-fullscreen-emulation{position:fixed!important;top:0!important;left:0!important;width:100%!important;height:100%!important}.psv-loader-container{display:flex;align-items:center;justify-content:center;position:absolute;top:0;left:0;width:100%;height:100%;z-index:80}.psv-loader{--psv-loader-border: 3px;--psv-loader-tickness: 10px;position:relative;display:flex;justify-content:center;align-items:center;color:#ffffffb3;width:150px;height:150px}.psv-loader-canvas{position:absolute;top:0;left:0;width:100%;height:100%;color:#3d3d3d80;z-index:-1}.psv-loader-text{font:600 16px sans-serif;text-align:center}.psv-loader--undefined .psv-loader-canvas{animation:psv-loader 2s cubic-bezier(.75,.25,.25,.75) infinite}@keyframes psv-loader{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.psv-navbar{display:flex;position:absolute;z-index:90;bottom:-40px;left:0;width:100%;height:40px;background:#3d3d3d80;transition:bottom ease-in-out .1s;font:16px sans-serif;cursor:default}.psv-navbar--open{bottom:0}.psv-navbar,.psv-navbar *{box-sizing:content-box}.psv-button{flex:0 0 auto;padding:10px;position:relative;cursor:pointer;height:20px;width:20px;background:transparent;color:#ffffffb3}.psv-button--active{background:#fff3}.psv-button--disabled{pointer-events:none;opacity:.5}.psv-button-svg{width:100%;transform:scale(1);transition:transform .2s ease;vertical-align:initial}.psv-button:not(.psv-button--disabled):focus-visible{outline:2px solid #007cff;outline-offset:-2px}.psv-container:not(.psv--is-touch) .psv-button--hover-scale:not(.psv-button--disabled):hover .psv-button-svg{transform:scale(1.2)}.psv-move-button+.psv-move-button{margin-left:-10px}.psv-download-button{color:#ffffffb3!important;text-decoration:none!important}.psv-download-button:before,.psv-download-button:after{display:none!important}.psv-custom-button{width:auto;min-width:20px}.psv-custom-button--no-padding{padding:0;height:100%}.psv-caption{flex:1 1 100%;color:#ffffffb3;overflow:hidden;text-align:center;cursor:unset;padding:unset;height:unset;width:unset}.psv-caption-content{display:inline-block;padding:10px;white-space:nowrap}.psv-zoom-range.psv-button{width:80px;height:1px;margin:10px 0;padding:9.5px 0;max-width:600px}.psv-zoom-range-line{position:relative;width:80px;height:1px;background:#ffffffb3;transition:all .3s ease}.psv-zoom-range-handle{position:absolute;border-radius:50%;top:-3px;width:7px;height:7px;background:#ffffffb3;transform:scale(1);transition:transform .3s ease}.psv-zoom-range:not(.psv-button--disabled):hover .psv-zoom-range-line{box-shadow:0 0 2px #ffffffb3}.psv-zoom-range:not(.psv-button--disabled):hover .psv-zoom-range-handle{transform:scale(1.3)}.psv-notification{position:absolute;z-index:100;bottom:-40px;display:flex;justify-content:center;box-sizing:border-box;width:100%;padding:0 2em;opacity:0;transition-property:opacity,bottom;transition-timing-function:ease-in-out;transition-duration:.2s}.psv-notification-content{max-width:50em;background:#3d3d3dcc;border-radius:4px;padding:.5em 1em;font:14px sans-serif;color:#fff}.psv-notification--visible{opacity:100;bottom:80px}.psv-overlay{display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;z-index:110;top:0;right:0;bottom:0;left:0;background:radial-gradient(#fff,#fdfdfd 16%,#fbfbfb 33%,#f8f8f8 49%,#efefef 66%,#dfdfdf 82%,#bfbfbf);opacity:.8;cursor:default}.psv-overlay-image{width:100%;text-align:center;color:#303030}.psv-overlay-image svg{width:50%}@container psv-container (orientation: landscape){.psv-overlay-image svg{width:33%}}.psv-overlay-title{color:#000;margin-top:1em;font:30px sans-serif;text-align:center}.psv-overlay-text{color:#000c;font:20px sans-serif;opacity:.8;text-align:center}.psv-panel{position:absolute;z-index:90;right:0;height:100%;width:400px;max-width:calc(100% - 9px);background:#0a0a0ab3;transform:translate3d(100%,0,0);opacity:0;transition-property:opacity,transform;transition-timing-function:ease-in-out;transition-duration:.1s;cursor:default;margin-left:9px}.psv--has-navbar .psv-panel{height:calc(100% - 40px)}.psv-panel-close-button{display:none;position:absolute;top:-1px;right:0;width:19.2px;height:19.2px;padding:6.4px;background:transparent;color:#fff;transition:background .3s ease-in-out;cursor:pointer}.psv-panel-close-button svg{transition:transform .3s ease-in-out}.psv-panel-close-button:hover{background:#000000e6}.psv-panel-close-button:hover svg{transform:scale(-1)}.psv-panel-resizer{display:none;position:absolute;top:0;left:-9px;width:9px;height:100%;background-color:#000000e6;cursor:col-resize}.psv-panel-resizer:before{content:"";position:absolute;top:50%;left:5.5px;margin-top:-14.5px;width:1px;height:1px;box-shadow:1px 0 #fff,3px 0 #fff,5px 0 #fff,1px 2px #fff,3px 2px #fff,5px 2px #fff,1px 4px #fff,3px 4px #fff,5px 4px #fff,1px 6px #fff,3px 6px #fff,5px 6px #fff,1px 8px #fff,3px 8px #fff,5px 8px #fff,1px 10px #fff,3px 10px #fff,5px 10px #fff,1px 12px #fff,3px 12px #fff,5px 12px #fff,1px 14px #fff,3px 14px #fff,5px 14px #fff,1px 16px #fff,3px 16px #fff,5px 16px #fff,1px 18px #fff,3px 18px #fff,5px 18px #fff,1px 20px #fff,3px 20px #fff,5px 20px #fff,1px 22px #fff,3px 22px #fff,5px 22px #fff,1px 24px #fff,3px 24px #fff,5px 24px #fff,1px 26px #fff,3px 26px #fff,5px 26px #fff,1px 28px #fff,3px 28px #fff,5px 28px #fff;background:transparent}.psv-panel-content{width:100%;height:100%;box-sizing:border-box;color:#dcdcdc;font:16px sans-serif;overflow:auto}.psv-panel-content:not(.psv-panel-content--no-margin){padding:1em}.psv-panel-content--no-interaction{-webkit-user-select:none;user-select:none;pointer-events:none}.psv-panel--open{transform:translateZ(0);opacity:1;transition-duration:.2s}.psv-panel--open .psv-panel-close-button,.psv-panel--open .psv-panel-resizer{display:block}@container psv-container (max-width: 400px){.psv-panel{width:100%!important;max-width:none}.psv-panel-resizer{display:none!important}}.psv-panel-menu{height:100%;display:flex;flex-direction:column}.psv-panel-menu-title{flex:none;display:flex;align-items:center;font:24px sans-serif;margin:24px 12px}.psv-panel-menu-title svg{width:24px;height:24px;margin-right:12px}.psv-panel-menu-list{flex:1;list-style:none;margin:0;padding:0;overflow-x:hidden}.psv-panel-menu-item{min-height:1.5em;padding:.5em 1em;cursor:pointer;display:flex;align-items:center;justify-content:flex-start;transition:background .1s ease-in-out}.psv-panel-menu-item--active{outline:1px solid currentcolor;outline-offset:-1px}.psv-panel-menu-item-icon{flex:none;height:1.5em;width:1.5em;margin-right:.5em}.psv-panel-menu-item-icon img{max-width:100%;max-height:100%}.psv-panel-menu-item-icon svg{width:100%;height:100%}.psv-panel-menu-item:focus-visible{outline:2px solid #007cff;outline-offset:-2px}.psv-panel-menu--stripped .psv-panel-menu-item:hover{background:#fff3}.psv-panel-menu--stripped .psv-panel-menu-item:nth-child(odd),.psv-panel-menu--stripped .psv-panel-menu-item:nth-child(odd):before{background:#ffffff1a}.psv-panel-menu--stripped .psv-panel-menu-item:nth-child(2n),.psv-panel-menu--stripped .psv-panel-menu-item:nth-child(2n):before{background:transparent}.psv-container:not(.psv--is-touch) .psv-panel-menu-item:hover{background:#fff3}.psv-tooltip{position:absolute;z-index:50;box-sizing:border-box;max-width:200px;background:#3d3d3dcc;border-radius:4px;opacity:0;transition-property:opacity,transform;transition-timing-function:ease-in-out;transition-duration:.1s;cursor:default}.psv-tooltip-content{color:#fff;font:14px sans-serif;text-shadow:0 1px #000;padding:.5em 1em}.psv-tooltip-arrow{position:absolute;height:0;width:0;border:7px solid transparent}.psv-tooltip--top-left,.psv-tooltip--top-center,.psv-tooltip--top-right{transform:translate3d(0,5px,0)}.psv-tooltip--top-left .psv-tooltip-arrow,.psv-tooltip--top-center .psv-tooltip-arrow,.psv-tooltip--top-right .psv-tooltip-arrow{border-top-color:#3d3d3dcc}.psv-tooltip--bottom-left,.psv-tooltip--bottom-center,.psv-tooltip--bottom-right{transform:translate3d(0,-5px,0)}.psv-tooltip--bottom-left .psv-tooltip-arrow,.psv-tooltip--bottom-center .psv-tooltip-arrow,.psv-tooltip--bottom-right .psv-tooltip-arrow{border-bottom-color:#3d3d3dcc}.psv-tooltip--left-top,.psv-tooltip--center-left,.psv-tooltip--left-bottom{transform:translate3d(5px,0,0)}.psv-tooltip--left-top .psv-tooltip-arrow,.psv-tooltip--center-left .psv-tooltip-arrow,.psv-tooltip--left-bottom .psv-tooltip-arrow{border-left-color:#3d3d3dcc}.psv-tooltip--right-top,.psv-tooltip--center-right,.psv-tooltip--right-bottom{transform:translate3d(-5px,0,0)}.psv-tooltip--right-top .psv-tooltip-arrow,.psv-tooltip--center-right .psv-tooltip-arrow,.psv-tooltip--right-bottom .psv-tooltip-arrow{border-right-color:#3d3d3dcc}.psv-tooltip--left-top,.psv-tooltip--top-left{box-shadow:-3px -3px #5a5a5ab3}.psv-tooltip--top-center{box-shadow:0 -3px #5a5a5ab3}.psv-tooltip--right-top,.psv-tooltip--top-right{box-shadow:3px -3px #5a5a5ab3}.psv-tooltip--left-bottom,.psv-tooltip--bottom-left{box-shadow:-3px 3px #5a5a5ab3}.psv-tooltip--bottom-center{box-shadow:0 3px #5a5a5ab3}.psv-tooltip--right-bottom,.psv-tooltip--bottom-right{box-shadow:3px 3px #5a5a5ab3}.psv-tooltip--center-left{box-shadow:-3px 0 #5a5a5ab3}.psv-tooltip--center-right{box-shadow:3px 0 #5a5a5ab3}.psv-tooltip--visible{transform:translateZ(0);opacity:1}.bimdata-viewer-photosphere[data-v-6d247701]{width:100%;height:100%;position:relative;overflow:hidden}.bimdata-viewer-photosphere__viewer__canvas[data-v-6d247701]{position:absolute;width:100%;height:100%}.psv-loader-container,.psv-overlay{z-index:1}.success-modal[data-v-79d3a107]{margin:var(--spacing-unit);align-items:center;display:flex;flex-direction:column;justify-content:space-between;min-width:500px;position:relative}.success-modal__close[data-v-79d3a107]{position:absolute;right:0;top:0}.success-modal__close .bimdata-pie-spinner[data-v-79d3a107]{height:23px;width:23px}.success-modal__title[data-v-79d3a107]{margin:calc(var(--spacing-unit) * 3) 0 calc(var(--spacing-unit) * 2);display:inline-flex;align-items:center}.success-modal__title h2[data-v-79d3a107]{margin:0;font-size:20px}.success-modal__title--icon[data-v-79d3a107]{margin-left:calc(var(--spacing-unit) / 2)}.success-modal__text[data-v-79d3a107]{margin:0;width:300px;text-align:center;line-height:1.5;color:var(--color-granite-light);font-size:12px}.success-modal__button[data-v-79d3a107]{margin:calc(var(--spacing-unit) * 2) 0}.bimdata-modal-manager[data-v-2c579fcd]{z-index:3;position:absolute;left:0;right:0}.bimdata-modal-manager.full[data-v-2c579fcd]{height:100%;display:flex;align-items:center;justify-content:center}.bimdata-modal-manager.full .bimdata-modal-manager__content[data-v-2c579fcd]{max-height:100%;margin:1rem 0;display:block;position:absolute;background-color:var(--color-white);overflow:auto}.bimdata-modal-manager.full[data-v-2c579fcd]:before{content:"";position:absolute;width:100%;height:100%;left:0;top:0;background-color:var(--color-primary);opacity:.8}.bimdata-modal-manager.banner[data-v-2c579fcd]{position:absolute;bottom:0;display:flex;justify-content:center}.bimdata-modal-manager.banner .bimdata-modal-manager__content[data-v-2c579fcd]{width:550px;margin-bottom:50px}.side-panel[data-v-ced3f116]{width:var(--side-panel-width);height:100%;flex-shrink:0;background-color:var(--color-white)}.plugins-as-button .tools-menu__info[data-v-72f2ce01]{position:absolute;top:3px;left:3px;font-size:11px;font-weight:700}.plugins-as-button .tools-menu__info~svg[data-v-72f2ce01]{margin-top:6px}.plugins-as-button .open .bimdata-btn[data-v-72f2ce01]{background-color:var(--color-secondary)}.plugins-as-button__submenu[data-v-72f2ce01]{position:absolute;top:0;box-shadow:var(--box-shadow);background-color:var(--color-white)}.plugins-as-button__submenu--right[data-v-72f2ce01]{left:calc(100% + (var(--spacing-unit)) / 2);right:auto}.plugins-as-button__submenu--right__simple[data-v-72f2ce01]{padding:var(--spacing-unit);width:229px;display:flex;flex-direction:column;justify-content:center;left:calc(100% + var(--spacing-unit));top:0}.plugins-as-button__submenu--right__panel[data-v-72f2ce01]{width:400px;height:calc(var(--bimdata-local-context-height) - 24px);left:calc(100% + var(--spacing-unit));z-index:1}.plugins-as-button__submenu--right__free[data-v-72f2ce01]{left:calc(100% + var(--spacing-unit));z-index:1}.plugins-as-button__submenu--left[data-v-72f2ce01]{right:calc(100% + (var(--spacing-unit)) / 2);left:auto}.plugins-as-button__submenu--left__simple[data-v-72f2ce01]{padding:var(--spacing-unit);width:187px;display:flex;flex-direction:column;justify-content:center;right:calc(100% + var(--spacing-unit));top:0}.plugins-as-button__submenu--left__panel[data-v-72f2ce01]{width:400px;height:calc(var(--bimdata-local-context-height) - 24px);right:calc(100% + var(--spacing-unit));z-index:1}.plugins-as-button__submenu--left__free[data-v-72f2ce01]{right:calc(100% + var(--spacing-unit));z-index:1}.plugins-as-button__panel__header[data-v-72f2ce01]{padding:0 var(--spacing-unit);height:42px;background-color:var(--color-silver-light);display:flex;justify-content:space-between;align-items:center}.plugins-as-button__panel__content[data-v-72f2ce01],.plugins-as-button .panel__content[data-v-72f2ce01]{height:calc(100% - 42px)}.plugins-as-button .panel__content .plugin-component-instance-container[data-v-72f2ce01]{height:100%}.side-column[data-v-f11ec0c8]{position:absolute;top:var(--spacing-unit);display:flex;flex-direction:column}.side-column--left[data-v-f11ec0c8],.side-column--right[data-v-f11ec0c8]{z-index:1}.side-column--left[data-v-f11ec0c8]{left:var(--spacing-unit)}.side-column--right[data-v-f11ec0c8]{right:var(--spacing-unit)}.layout-settings[data-v-d37dfd4d]{transition:background-color 1s;width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;position:relative;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.layout-settings[data-v-d37dfd4d]:before{content:"";position:absolute;width:100%;height:100%;left:0;top:0;background-color:var(--color-primary);opacity:.8;z-index:-1}.layout-settings__header[data-v-d37dfd4d]{color:var(--color-white);font-size:small;margin-bottom:12px}.layout-settings__split[data-v-d37dfd4d]{display:flex;justify-content:space-between}.layout-settings__split .bimdata-btn[data-v-d37dfd4d]{margin:15px;padding:20px 40px}.layout-settings__split__text[data-v-d37dfd4d]{margin-left:8px}.layout-settings__buttons[data-v-d37dfd4d]{position:absolute;top:0;right:0;display:flex;flex-direction:column;justify-content:center;align-items:center;margin:15px;padding:0}.layout-settings__buttons[data-v-d37dfd4d]>*{margin-bottom:15px}.layout-settings__buttons .bimdata-btn__fill[data-v-d37dfd4d]:disabled{color:var(--color-primary)}.layout-settings--swap[data-v-d37dfd4d]{cursor:grab;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}.layout-settings--swap[data-v-d37dfd4d]:before{background-color:var(--color-primary);opacity:.3;z-index:-1}.layout-settings--dragging[data-v-d37dfd4d]{cursor:grabbing}.layout-settings--dragover[data-v-d37dfd4d]:before{background-color:var(--color-primary-light)}.window-container[data-v-8a549a80]{height:100%;position:relative;overflow:hidden;background-color:var(--bimdata-viewer-background-color, #f5f5f5);container-type:inline-size}.window-container__content[data-v-8a549a80]{display:flex;height:100%}.window-container__content__center[data-v-8a549a80]{position:relative;flex-grow:1;overflow:hidden}.window-container__content__center__viewer[data-v-8a549a80]{position:absolute;width:100%;height:100%}.window-container__layout-settings[data-v-8a549a80]{position:absolute;top:0;left:0;width:100%;height:100%}.context-menu[data-v-5b87d4a3]{padding:9px 0;position:absolute;background-color:var(--color-white);box-shadow:var(--box-shadow);border-radius:3px;list-style:none;z-index:3}.context-menu__element[data-v-5b87d4a3]{height:calc(var(--spacing-unit) * 3);padding:0 var(--spacing-unit);cursor:pointer;display:flex;align-items:center;justify-content:space-between;position:relative}.context-menu__element[data-v-5b87d4a3]:hover{background-color:var(--color-silver-light)}.context-menu__element .separator[data-v-5b87d4a3]{position:absolute;top:0;left:0;background-color:var(--color-silver);height:1px;width:100%}.context-menu__element .menu-text[data-v-5b87d4a3]{color:var(--color-primary);font-size:12px}.context-menu__element .menu-picto[data-v-5b87d4a3]{font-size:10px}.context-menu__spinner[data-v-5b87d4a3]{display:flex;justify-content:center;align-items:center;height:calc(var(--spacing-unit) * 3);padding:0 var(--spacing-unit)}.viewer-header[data-v-5c9ea6b6]{padding:0 10px;height:var(--bimdata-viewer-header-height, 40px);border-bottom:solid 2px var(--color-silver);background-color:var(--color-silver-light);display:flex;align-items:center;justify-content:space-between}.viewer-header__content[data-v-5c9ea6b6]{flex-grow:1;display:flex;align-items:center;justify-content:space-between}.viewer-header__content__left[data-v-5c9ea6b6]{display:flex;align-items:center;gap:calc(var(--spacing-unit) / 2)}.viewer-header__content__right[data-v-5c9ea6b6]{display:flex;align-items:center;justify-content:space-between}.viewer-header__version[data-v-5c9ea6b6]{font-size:small}.bimdata-separator[data-v-79a3b3af]{position:relative;cursor:ew-resize;flex-shrink:0}.bimdata-separator__line[data-v-79a3b3af]{background-color:#d8d8d8;height:100%;width:2px}.bimdata-separator__resizer[data-v-79a3b3af]{position:absolute;top:0;bottom:0;right:-9px;width:20px;z-index:2}.bimdata-global-side-panel[data-v-82d0d4cb]{display:flex;justify-content:space-around;height:100%;z-index:1;box-shadow:var(--box-shadow)}.bimdata-global-side-panel__component[data-v-82d0d4cb]{flex-grow:1;overflow:hidden;height:100%}.bimdata-viewer[data-v-0c1c941a]{height:100%;font-size:14px;position:relative;background-color:var(--bimdata-viewer-background-color, #f5f5f5);overflow:hidden}.bimdata-viewer__content[data-v-0c1c941a]{display:flex;justify-content:space-between;position:relative;overflow:hidden}.bimdata-viewer textarea[data-v-0c1c941a]{font-family:roboto,Helvetica,Arial,sans-serif}.bimdata-viewer .viewer__logo[data-v-0c1c941a]{position:absolute;bottom:var(--spacing-unit);left:0;display:flex;flex-direction:column;align-items:center}.bimdata-viewer .viewer__logo svg[data-v-0c1c941a]{width:72px;height:40px}.bimdata-viewer .viewer__logo .version[data-v-0c1c941a]{font-size:70%;min-width:72px;text-align:center}.bimdata-viewer .area[data-v-0c1c941a]{overflow:hidden}.bimdata-viewer{font-family:roboto,Helvetica,Arial,sans-serif;color:var(--color-primary)}.bimdata-viewer *,.bimdata-viewer *:before,.bimdata-viewer *:after{box-sizing:border-box}.bimdata-viewer .bimdata-context-loading-overlay{background-color:#ffffff80;position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center}.bimdata-info-length[data-v-34c2cf79]{padding:0 calc(var(--spacing-unit) / 2);height:18px;display:flex;align-items:center;justify-content:center;background-color:var(--color-primary);color:var(--color-white);border-radius:3px;line-height:1.5;font-size:11px}.bimdata-models[data-v-34c2cf79]{position:relative}.bimdata-models--window-positioning[data-v-34c2cf79]{position:absolute;z-index:1;top:var(--spacing-unit);left:calc(var(--bimdata-local-context-center-width) / 2);transform:translate(-50%)}.bimdata-models__list[data-v-34c2cf79]{width:var(--bimdata-models-width)}.bimdata-models__list[data-v-34c2cf79] li{height:30px;position:relative}.bimdata-models__header[data-v-34c2cf79]{display:flex;align-items:center;width:calc(100% - 33px)}.bimdata-models__header__loader[data-v-34c2cf79]{width:100%;display:flex;justify-content:center;align-items:center}.bimdata-models__header__picto[data-v-34c2cf79]{display:flex}.bimdata-models__header__number[data-v-34c2cf79]{margin-left:var(--spacing-unit)}.bimdata-models__header__number--empty[data-v-34c2cf79]{background-color:var(--color-granite)}.bimdata-models__header__name[data-v-34c2cf79]{margin-left:var(--spacing-unit);width:calc(100% - 61px)}.bimdata-models__header__name span[data-v-34c2cf79]{font-size:12px}.bimdata-models__header__name--empty[data-v-34c2cf79]{color:var(--color-granite)}.bimdata-models__preview[data-v-34c2cf79]{pointer-events:none;z-index:3;position:absolute;height:200px;width:200px;border:7px solid white;overflow:hidden;background-color:var(--color-silver-light)}.bimdata-models__preview img[data-v-34c2cf79]{height:100%}.bimdata-models__model[data-v-34c2cf79]{width:100%;height:100%;display:flex;align-items:center;padding:0 var(--spacing-unit)}.bimdata-models__model__name--disabled[data-v-34c2cf79]{color:var(--color-silver-dark)}.bimdata-models__model__spinner[data-v-34c2cf79]{position:absolute;top:0;right:0;margin:0 var(--spacing-unit);display:flex;align-items:center;height:100%}.bimdata-models[data-v-34c2cf79] .submenu{max-height:350px}.bimdata-models[data-v-34c2cf79] .submenu .bimdata-paginated-list__elements{height:auto;max-height:300px;overflow:auto}.bimdata-models[data-v-34c2cf79] .submenu .submenu--down li{padding:0}.bimdata-info-length[data-v-44e6af66]{padding:0 calc(var(--spacing-unit) / 2);height:18px;display:flex;align-items:center;justify-content:center;background-color:var(--color-primary);color:var(--color-white);border-radius:3px;line-height:1.5;font-size:11px}.bimdata-multi-model-loader[data-v-44e6af66]{position:relative;display:flex;align-items:center}.bimdata-multi-model-loader--window-positioning[data-v-44e6af66]{position:absolute;z-index:1;top:var(--spacing-unit);left:calc(var(--bimdata-local-context-center-width) / 2);transform:translate(-50%)}.bimdata-multi-model-loader__header-container[data-v-44e6af66]{display:flex;align-items:center;justify-content:center}.bimdata-multi-model-loader__header[data-v-44e6af66]{display:flex;align-items:center;justify-content:center;width:350px;height:34px;padding:0 var(--spacing-unit);background-color:#fff;box-shadow:var(--box-shadow);border-radius:2px;cursor:pointer}.bimdata-multi-model-loader__header__loader[data-v-44e6af66]{width:100%;display:flex;justify-content:center;align-items:center}.bimdata-multi-model-loader__header__picto[data-v-44e6af66]{display:flex}.bimdata-multi-model-loader__header__number[data-v-44e6af66]{margin-left:var(--spacing-unit)}.bimdata-multi-model-loader__header__number--empty[data-v-44e6af66]{background-color:var(--color-granite)}.bimdata-multi-model-loader__header__name[data-v-44e6af66]{margin-left:var(--spacing-unit);width:calc(100% - 61px);font-size:12px}.bimdata-multi-model-loader__header__name--empty[data-v-44e6af66]{color:var(--color-granite)}.bimdata-multi-model-loader__main[data-v-44e6af66]{width:480px;background-color:#fff;box-shadow:var(--box-shadow);padding:calc(var(--spacing-unit) * 2) 0;display:flex;flex-direction:column}.bimdata-multi-model-loader__main__model[data-v-44e6af66]{width:100%;height:30px;display:flex;align-items:center;gap:8px;padding:0 calc(var(--spacing-unit) * 2);cursor:pointer}.bimdata-multi-model-loader__main__model[data-v-44e6af66]:hover{background-color:var(--color-silver-light)}.bimdata-multi-model-loader__main__model--disabled[data-v-44e6af66]{cursor:default}.bimdata-multi-model-loader__main__model__name--disabled[data-v-44e6af66]{color:var(--color-silver-dark)}.bimdata-multi-model-loader__main__model__spinner[data-v-44e6af66]{width:16px;margin:auto;display:flex;align-items:center;height:100%}.bimdata-multi-model-loader__main__validate[data-v-44e6af66]{margin-top:var(--spacing-unit);margin-right:calc(var(--spacing-unit) * 2);align-self:end}.bimdata-multi-model-loader__preview[data-v-44e6af66]{pointer-events:none;z-index:3;position:absolute;height:200px;width:200px;border:7px solid white;overflow:hidden;background-color:var(--color-silver-light)}.bimdata-multi-model-loader__preview img[data-v-44e6af66]{height:100%}.bimdata__no-model[data-v-5ffd9bc0]{position:absolute;top:0;left:0;right:0;bottom:0;opacity:var(--no-model--opacity);transition:opacity 1s ease-in;display:flex;flex-direction:column;justify-content:center;align-items:center;color:var(--color-silver-dark);font-size:medium}.bimdata__no-model svg[data-v-5ffd9bc0]{height:200px;width:200px}`)),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();var j_e=Object.defineProperty,Mre=t=>{throw TypeError(t)},H_e=(t,e,i)=>e in t?j_e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,It=(t,e,i)=>H_e(t,typeof e!="symbol"?e+"":e,i),FU=(t,e,i)=>e.has(t)||Mre("Cannot "+i),B=(t,e,i)=>(FU(t,e,"read from private field"),i?i.call(t):e.get(t)),ne=(t,e,i)=>e.has(t)?Mre("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),ee=(t,e,i,r)=>(FU(t,e,"write to private field"),r?r.call(t,i):e.set(t,i),i),oe=(t,e,i)=>(FU(t,e,"access private method"),i),Ql=(t,e,i,r)=>({set _(o){ee(t,e,o,i)},get _(){return B(t,e,r)}});function V_e(t,e){for(var i=0;i<e.length;i++){const r=e[i];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in t)){const n=Object.getOwnPropertyDescriptor(r,o);n&&Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const aE=t=>`Context Menu --- Cannot "${t}" because the context menu is disabled. Consider enabling it in the makeBIMDataViewer configuration object if you want to use it.`,z_e={preventDefault(){console.warn(aE("preventDefault"))},registerContextCommand(){console.warn(aE("registerContextCommand"))},registerCommand(){console.warn(aE("registerCommand"))},open(){console.warn(aE("open"))}},Sa=t=>e=>e[t],Sr=t=>e=>e[t],Eg=t=>e=>!e[t],bh=(t,e)=>i=>t(i)&&e(i),Ev=Sa("id");function q_e({state:t,getObjects:e=()=>[]}){return[{name:"selectAll",key:"C",execute:()=>t.selectObjects(e().filter(bh(Sr("visible"),Eg("selected"))).map(Ev))},{name:"deselectAll",key:"V",execute:()=>t.deselectObjects(e().filter(Sr("selected")).map(Ev))},{name:"selectSimilar",key:"Y",execute:()=>{const i=e(),r=i.filter(bh(Sr("visible"),Sr("selected")));if(r.length===1&&r[0].type!==void 0){const o=r[0],n=i.filter(s=>s.visible&&s.type===o.type&&s.id!==o.id).map(Ev);t.selectObjects(n)}}},{name:"hide",key:"H",execute:()=>{const i=e().filter(bh(Sr("selected"),Sr("visible"))),r=i.filter(Sr("selected"));r.length>0&&t.deselectObjects(r.map(Ev)),t.hideObjects(i.map(Ev))}},{name:"showAll",key:"R",execute:()=>{const i=e().filter(Eg("visible")).map(Ev);i.length>0&&t.showObjects(i)}}]}const G_e=t=>{const e=[];let i=!1,r=null;function o(u){if(i&&u.target.tagName!=="INPUT"&&u.target.tagName!=="TEXTAREA"){const h=n(u);h&&(u.preventDefault(),u.stopPropagation(),h.execute())}}function n(u){const h=e.filter(p=>Pre(p,u));return h.length?h.find(p=>p.context===r)||h.find(p=>p.context==null):null}document.addEventListener("keydown",o);function s(){document.removeEventListener("keydown",o)}function a(u={},h){const{name:p,key:g,execute:f,ctrlKey:A=!1,shiftKey:m=!1,altKey:v=!1}=u;if(!p)return console.error("Cannot register shortcut without a name."),!1;if(!f||typeof f!="function")return console.error("Cannot register shortcut without an execute function."),!1;if(g==null)return console.error("Cannot register shortcut without a key."),!1;const y=e.find(w=>Pre(w,u)&&w.context==h);if(y)return console.error(`A shortcut on the key "${u.key}" is already registered on this context with the name "${y.name}".`),!1;const b=e.find(w=>w.name===u.name&&w.context===h);return b?(console.error(`A shortcut with the name "${u.name}" is already registered on this context on the key "${b.key}".`),!1):(e.push({name:p,key:g,context:h,execute:f,ctrlKey:A,shiftKey:m,altKey:v}),!0)}function l(u,h){const p=e.find(g=>g.name===u&&g.context===h);return p?(e.splice(e.indexOf(p),1),!0):!1}function c(u,h){return e.find(p=>p.name===u&&p.context==h)}function d(u){return e.filter(h=>h.context==u)}return{shortcuts:e,getShortcut:c,getShortcuts:d,registerShortcut:a,unregisterShortcut:l,destroy:s,getDefaultShortcuts(u,h=t){return q_e({state:h,getObjects:u})},get active(){return i},set active(u){i=u},get activeLocalContext(){return r},set activeLocalContext(u){r=u}}};function Pre(t,e){const{key:i,ctrlKey:r=!1,shiftKey:o=!1,metaKey:n=!1,altKey:s=!1}=e;return t.key.toUpperCase()===i.toUpperCase()&&t.ctrlKey===(r||n)&&t.shiftKey===o&&t.altKey===s}/*!
|
|
6
|
+
*/.psv-container{--psv-core-loaded: true;container-name:psv-container;container-type:size;width:100%;height:100%;margin:0;padding:0;position:relative;background:radial-gradient(#fff,#fdfdfd 16%,#fbfbfb 33%,#f8f8f8 49%,#efefef 66%,#dfdfdf 82%,#bfbfbf);overflow:hidden}.psv-container *{box-sizing:content-box}.psv-canvas-container{position:absolute;top:0;left:0;z-index:0;transition:opacity linear .1s}.psv-fullscreen-emulation{position:fixed!important;top:0!important;left:0!important;width:100%!important;height:100%!important}.psv-loader-container{display:flex;align-items:center;justify-content:center;position:absolute;top:0;left:0;width:100%;height:100%;z-index:80}.psv-loader{--psv-loader-border: 3px;--psv-loader-tickness: 10px;position:relative;display:flex;justify-content:center;align-items:center;color:#ffffffb3;width:150px;height:150px}.psv-loader-canvas{position:absolute;top:0;left:0;width:100%;height:100%;color:#3d3d3d80;z-index:-1}.psv-loader-text{font:600 16px sans-serif;text-align:center}.psv-loader--undefined .psv-loader-canvas{animation:psv-loader 2s cubic-bezier(.75,.25,.25,.75) infinite}@keyframes psv-loader{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.psv-navbar{display:flex;position:absolute;z-index:90;bottom:-40px;left:0;width:100%;height:40px;background:#3d3d3d80;transition:bottom ease-in-out .1s;font:16px sans-serif;cursor:default}.psv-navbar--open{bottom:0}.psv-navbar,.psv-navbar *{box-sizing:content-box}.psv-button{flex:0 0 auto;padding:10px;position:relative;cursor:pointer;height:20px;width:20px;background:transparent;color:#ffffffb3}.psv-button--active{background:#fff3}.psv-button--disabled{pointer-events:none;opacity:.5}.psv-button-svg{width:100%;transform:scale(1);transition:transform .2s ease;vertical-align:initial}.psv-button:not(.psv-button--disabled):focus-visible{outline:2px solid #007cff;outline-offset:-2px}.psv-container:not(.psv--is-touch) .psv-button--hover-scale:not(.psv-button--disabled):hover .psv-button-svg{transform:scale(1.2)}.psv-move-button+.psv-move-button{margin-left:-10px}.psv-download-button{color:#ffffffb3!important;text-decoration:none!important}.psv-download-button:before,.psv-download-button:after{display:none!important}.psv-custom-button{width:auto;min-width:20px}.psv-custom-button--no-padding{padding:0;height:100%}.psv-caption{flex:1 1 100%;color:#ffffffb3;overflow:hidden;text-align:center;cursor:unset;padding:unset;height:unset;width:unset}.psv-caption-content{display:inline-block;padding:10px;white-space:nowrap}.psv-zoom-range.psv-button{width:80px;height:1px;margin:10px 0;padding:9.5px 0;max-width:600px}.psv-zoom-range-line{position:relative;width:80px;height:1px;background:#ffffffb3;transition:all .3s ease}.psv-zoom-range-handle{position:absolute;border-radius:50%;top:-3px;width:7px;height:7px;background:#ffffffb3;transform:scale(1);transition:transform .3s ease}.psv-zoom-range:not(.psv-button--disabled):hover .psv-zoom-range-line{box-shadow:0 0 2px #ffffffb3}.psv-zoom-range:not(.psv-button--disabled):hover .psv-zoom-range-handle{transform:scale(1.3)}.psv-notification{position:absolute;z-index:100;bottom:-40px;display:flex;justify-content:center;box-sizing:border-box;width:100%;padding:0 2em;opacity:0;transition-property:opacity,bottom;transition-timing-function:ease-in-out;transition-duration:.2s}.psv-notification-content{max-width:50em;background:#3d3d3dcc;border-radius:4px;padding:.5em 1em;font:14px sans-serif;color:#fff}.psv-notification--visible{opacity:100;bottom:80px}.psv-overlay{display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;z-index:110;top:0;right:0;bottom:0;left:0;background:radial-gradient(#fff,#fdfdfd 16%,#fbfbfb 33%,#f8f8f8 49%,#efefef 66%,#dfdfdf 82%,#bfbfbf);opacity:.8;cursor:default}.psv-overlay-image{width:100%;text-align:center;color:#303030}.psv-overlay-image svg{width:50%}@container psv-container (orientation: landscape){.psv-overlay-image svg{width:33%}}.psv-overlay-title{color:#000;margin-top:1em;font:30px sans-serif;text-align:center}.psv-overlay-text{color:#000c;font:20px sans-serif;opacity:.8;text-align:center}.psv-panel{position:absolute;z-index:90;right:0;height:100%;width:400px;max-width:calc(100% - 9px);background:#0a0a0ab3;transform:translate3d(100%,0,0);opacity:0;transition-property:opacity,transform;transition-timing-function:ease-in-out;transition-duration:.1s;cursor:default;margin-left:9px}.psv--has-navbar .psv-panel{height:calc(100% - 40px)}.psv-panel-close-button{display:none;position:absolute;top:-1px;right:0;width:19.2px;height:19.2px;padding:6.4px;background:transparent;color:#fff;transition:background .3s ease-in-out;cursor:pointer}.psv-panel-close-button svg{transition:transform .3s ease-in-out}.psv-panel-close-button:hover{background:#000000e6}.psv-panel-close-button:hover svg{transform:scale(-1)}.psv-panel-resizer{display:none;position:absolute;top:0;left:-9px;width:9px;height:100%;background-color:#000000e6;cursor:col-resize}.psv-panel-resizer:before{content:"";position:absolute;top:50%;left:5.5px;margin-top:-14.5px;width:1px;height:1px;box-shadow:1px 0 #fff,3px 0 #fff,5px 0 #fff,1px 2px #fff,3px 2px #fff,5px 2px #fff,1px 4px #fff,3px 4px #fff,5px 4px #fff,1px 6px #fff,3px 6px #fff,5px 6px #fff,1px 8px #fff,3px 8px #fff,5px 8px #fff,1px 10px #fff,3px 10px #fff,5px 10px #fff,1px 12px #fff,3px 12px #fff,5px 12px #fff,1px 14px #fff,3px 14px #fff,5px 14px #fff,1px 16px #fff,3px 16px #fff,5px 16px #fff,1px 18px #fff,3px 18px #fff,5px 18px #fff,1px 20px #fff,3px 20px #fff,5px 20px #fff,1px 22px #fff,3px 22px #fff,5px 22px #fff,1px 24px #fff,3px 24px #fff,5px 24px #fff,1px 26px #fff,3px 26px #fff,5px 26px #fff,1px 28px #fff,3px 28px #fff,5px 28px #fff;background:transparent}.psv-panel-content{width:100%;height:100%;box-sizing:border-box;color:#dcdcdc;font:16px sans-serif;overflow:auto}.psv-panel-content:not(.psv-panel-content--no-margin){padding:1em}.psv-panel-content--no-interaction{-webkit-user-select:none;user-select:none;pointer-events:none}.psv-panel--open{transform:translateZ(0);opacity:1;transition-duration:.2s}.psv-panel--open .psv-panel-close-button,.psv-panel--open .psv-panel-resizer{display:block}@container psv-container (max-width: 400px){.psv-panel{width:100%!important;max-width:none}.psv-panel-resizer{display:none!important}}.psv-panel-menu{height:100%;display:flex;flex-direction:column}.psv-panel-menu-title{flex:none;display:flex;align-items:center;font:24px sans-serif;margin:24px 12px}.psv-panel-menu-title svg{width:24px;height:24px;margin-right:12px}.psv-panel-menu-list{flex:1;list-style:none;margin:0;padding:0;overflow-x:hidden}.psv-panel-menu-item{min-height:1.5em;padding:.5em 1em;cursor:pointer;display:flex;align-items:center;justify-content:flex-start;transition:background .1s ease-in-out}.psv-panel-menu-item--active{outline:1px solid currentcolor;outline-offset:-1px}.psv-panel-menu-item-icon{flex:none;height:1.5em;width:1.5em;margin-right:.5em}.psv-panel-menu-item-icon img{max-width:100%;max-height:100%}.psv-panel-menu-item-icon svg{width:100%;height:100%}.psv-panel-menu-item:focus-visible{outline:2px solid #007cff;outline-offset:-2px}.psv-panel-menu--stripped .psv-panel-menu-item:hover{background:#fff3}.psv-panel-menu--stripped .psv-panel-menu-item:nth-child(odd),.psv-panel-menu--stripped .psv-panel-menu-item:nth-child(odd):before{background:#ffffff1a}.psv-panel-menu--stripped .psv-panel-menu-item:nth-child(2n),.psv-panel-menu--stripped .psv-panel-menu-item:nth-child(2n):before{background:transparent}.psv-container:not(.psv--is-touch) .psv-panel-menu-item:hover{background:#fff3}.psv-tooltip{position:absolute;z-index:50;box-sizing:border-box;max-width:200px;background:#3d3d3dcc;border-radius:4px;opacity:0;transition-property:opacity,transform;transition-timing-function:ease-in-out;transition-duration:.1s;cursor:default}.psv-tooltip-content{color:#fff;font:14px sans-serif;text-shadow:0 1px #000;padding:.5em 1em}.psv-tooltip-arrow{position:absolute;height:0;width:0;border:7px solid transparent}.psv-tooltip--top-left,.psv-tooltip--top-center,.psv-tooltip--top-right{transform:translate3d(0,5px,0)}.psv-tooltip--top-left .psv-tooltip-arrow,.psv-tooltip--top-center .psv-tooltip-arrow,.psv-tooltip--top-right .psv-tooltip-arrow{border-top-color:#3d3d3dcc}.psv-tooltip--bottom-left,.psv-tooltip--bottom-center,.psv-tooltip--bottom-right{transform:translate3d(0,-5px,0)}.psv-tooltip--bottom-left .psv-tooltip-arrow,.psv-tooltip--bottom-center .psv-tooltip-arrow,.psv-tooltip--bottom-right .psv-tooltip-arrow{border-bottom-color:#3d3d3dcc}.psv-tooltip--left-top,.psv-tooltip--center-left,.psv-tooltip--left-bottom{transform:translate3d(5px,0,0)}.psv-tooltip--left-top .psv-tooltip-arrow,.psv-tooltip--center-left .psv-tooltip-arrow,.psv-tooltip--left-bottom .psv-tooltip-arrow{border-left-color:#3d3d3dcc}.psv-tooltip--right-top,.psv-tooltip--center-right,.psv-tooltip--right-bottom{transform:translate3d(-5px,0,0)}.psv-tooltip--right-top .psv-tooltip-arrow,.psv-tooltip--center-right .psv-tooltip-arrow,.psv-tooltip--right-bottom .psv-tooltip-arrow{border-right-color:#3d3d3dcc}.psv-tooltip--left-top,.psv-tooltip--top-left{box-shadow:-3px -3px #5a5a5ab3}.psv-tooltip--top-center{box-shadow:0 -3px #5a5a5ab3}.psv-tooltip--right-top,.psv-tooltip--top-right{box-shadow:3px -3px #5a5a5ab3}.psv-tooltip--left-bottom,.psv-tooltip--bottom-left{box-shadow:-3px 3px #5a5a5ab3}.psv-tooltip--bottom-center{box-shadow:0 3px #5a5a5ab3}.psv-tooltip--right-bottom,.psv-tooltip--bottom-right{box-shadow:3px 3px #5a5a5ab3}.psv-tooltip--center-left{box-shadow:-3px 0 #5a5a5ab3}.psv-tooltip--center-right{box-shadow:3px 0 #5a5a5ab3}.psv-tooltip--visible{transform:translateZ(0);opacity:1}.bimdata-viewer-photosphere[data-v-6d247701]{width:100%;height:100%;position:relative;overflow:hidden}.bimdata-viewer-photosphere__viewer__canvas[data-v-6d247701]{position:absolute;width:100%;height:100%}.psv-loader-container,.psv-overlay{z-index:1}.success-modal[data-v-79d3a107]{margin:var(--spacing-unit);align-items:center;display:flex;flex-direction:column;justify-content:space-between;min-width:500px;position:relative}.success-modal__close[data-v-79d3a107]{position:absolute;right:0;top:0}.success-modal__close .bimdata-pie-spinner[data-v-79d3a107]{height:23px;width:23px}.success-modal__title[data-v-79d3a107]{margin:calc(var(--spacing-unit) * 3) 0 calc(var(--spacing-unit) * 2);display:inline-flex;align-items:center}.success-modal__title h2[data-v-79d3a107]{margin:0;font-size:20px}.success-modal__title--icon[data-v-79d3a107]{margin-left:calc(var(--spacing-unit) / 2)}.success-modal__text[data-v-79d3a107]{margin:0;width:300px;text-align:center;line-height:1.5;color:var(--color-granite-light);font-size:12px}.success-modal__button[data-v-79d3a107]{margin:calc(var(--spacing-unit) * 2) 0}.bimdata-modal-manager[data-v-2c579fcd]{z-index:3;position:absolute;left:0;right:0}.bimdata-modal-manager.full[data-v-2c579fcd]{height:100%;display:flex;align-items:center;justify-content:center}.bimdata-modal-manager.full .bimdata-modal-manager__content[data-v-2c579fcd]{max-height:100%;margin:1rem 0;display:block;position:absolute;background-color:var(--color-white);overflow:auto}.bimdata-modal-manager.full[data-v-2c579fcd]:before{content:"";position:absolute;width:100%;height:100%;left:0;top:0;background-color:var(--color-primary);opacity:.8}.bimdata-modal-manager.banner[data-v-2c579fcd]{position:absolute;bottom:0;display:flex;justify-content:center}.bimdata-modal-manager.banner .bimdata-modal-manager__content[data-v-2c579fcd]{width:550px;margin-bottom:50px}.side-panel[data-v-ced3f116]{width:var(--side-panel-width);height:100%;flex-shrink:0;background-color:var(--color-white)}.plugins-as-button .tools-menu__info[data-v-72f2ce01]{position:absolute;top:3px;left:3px;font-size:11px;font-weight:700}.plugins-as-button .tools-menu__info~svg[data-v-72f2ce01]{margin-top:6px}.plugins-as-button .open .bimdata-btn[data-v-72f2ce01]{background-color:var(--color-secondary)}.plugins-as-button__submenu[data-v-72f2ce01]{position:absolute;top:0;box-shadow:var(--box-shadow);background-color:var(--color-white)}.plugins-as-button__submenu--right[data-v-72f2ce01]{left:calc(100% + (var(--spacing-unit)) / 2);right:auto}.plugins-as-button__submenu--right__simple[data-v-72f2ce01]{padding:var(--spacing-unit);width:229px;display:flex;flex-direction:column;justify-content:center;left:calc(100% + var(--spacing-unit));top:0}.plugins-as-button__submenu--right__panel[data-v-72f2ce01]{width:400px;height:calc(var(--bimdata-local-context-height) - 24px);left:calc(100% + var(--spacing-unit));z-index:1}.plugins-as-button__submenu--right__free[data-v-72f2ce01]{left:calc(100% + var(--spacing-unit));z-index:1}.plugins-as-button__submenu--left[data-v-72f2ce01]{right:calc(100% + (var(--spacing-unit)) / 2);left:auto}.plugins-as-button__submenu--left__simple[data-v-72f2ce01]{padding:var(--spacing-unit);width:187px;display:flex;flex-direction:column;justify-content:center;right:calc(100% + var(--spacing-unit));top:0}.plugins-as-button__submenu--left__panel[data-v-72f2ce01]{width:400px;height:calc(var(--bimdata-local-context-height) - 24px);right:calc(100% + var(--spacing-unit));z-index:1}.plugins-as-button__submenu--left__free[data-v-72f2ce01]{right:calc(100% + var(--spacing-unit));z-index:1}.plugins-as-button__panel__header[data-v-72f2ce01]{padding:0 var(--spacing-unit);height:42px;background-color:var(--color-silver-light);display:flex;justify-content:space-between;align-items:center}.plugins-as-button__panel__content[data-v-72f2ce01],.plugins-as-button .panel__content[data-v-72f2ce01]{height:calc(100% - 42px)}.plugins-as-button .panel__content .plugin-component-instance-container[data-v-72f2ce01]{height:100%}.side-column[data-v-f11ec0c8]{position:absolute;top:var(--spacing-unit);display:flex;flex-direction:column}.side-column--left[data-v-f11ec0c8],.side-column--right[data-v-f11ec0c8]{z-index:1}.side-column--left[data-v-f11ec0c8]{left:var(--spacing-unit)}.side-column--right[data-v-f11ec0c8]{right:var(--spacing-unit)}.layout-settings[data-v-d37dfd4d]{transition:background-color 1s;width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;position:relative;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.layout-settings[data-v-d37dfd4d]:before{content:"";position:absolute;width:100%;height:100%;left:0;top:0;background-color:var(--color-primary);opacity:.8;z-index:-1}.layout-settings__header[data-v-d37dfd4d]{color:var(--color-white);font-size:small;margin-bottom:12px}.layout-settings__split[data-v-d37dfd4d]{display:flex;justify-content:space-between}.layout-settings__split .bimdata-btn[data-v-d37dfd4d]{margin:15px;padding:20px 40px}.layout-settings__split__text[data-v-d37dfd4d]{margin-left:8px}.layout-settings__buttons[data-v-d37dfd4d]{position:absolute;top:0;right:0;display:flex;flex-direction:column;justify-content:center;align-items:center;margin:15px;padding:0}.layout-settings__buttons[data-v-d37dfd4d]>*{margin-bottom:15px}.layout-settings__buttons .bimdata-btn__fill[data-v-d37dfd4d]:disabled{color:var(--color-primary)}.layout-settings--swap[data-v-d37dfd4d]{cursor:grab;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}.layout-settings--swap[data-v-d37dfd4d]:before{background-color:var(--color-primary);opacity:.3;z-index:-1}.layout-settings--dragging[data-v-d37dfd4d]{cursor:grabbing}.layout-settings--dragover[data-v-d37dfd4d]:before{background-color:var(--color-primary-light)}.window-container[data-v-4d6af796]{height:100%;position:relative;overflow:hidden;background-color:var(--bimdata-viewer-background-color, #f5f5f5);container-type:inline-size}.window-container__content[data-v-4d6af796]{display:flex;height:100%}.window-container__content__center[data-v-4d6af796]{position:relative;flex-grow:1;overflow:hidden}.window-container__content__center__viewer[data-v-4d6af796]{position:absolute;width:100%;height:100%}.window-container__layout-settings[data-v-4d6af796]{position:absolute;top:0;left:0;width:100%;height:100%}.context-menu[data-v-5b87d4a3]{padding:9px 0;position:absolute;background-color:var(--color-white);box-shadow:var(--box-shadow);border-radius:3px;list-style:none;z-index:3}.context-menu__element[data-v-5b87d4a3]{height:calc(var(--spacing-unit) * 3);padding:0 var(--spacing-unit);cursor:pointer;display:flex;align-items:center;justify-content:space-between;position:relative}.context-menu__element[data-v-5b87d4a3]:hover{background-color:var(--color-silver-light)}.context-menu__element .separator[data-v-5b87d4a3]{position:absolute;top:0;left:0;background-color:var(--color-silver);height:1px;width:100%}.context-menu__element .menu-text[data-v-5b87d4a3]{color:var(--color-primary);font-size:12px}.context-menu__element .menu-picto[data-v-5b87d4a3]{font-size:10px}.context-menu__spinner[data-v-5b87d4a3]{display:flex;justify-content:center;align-items:center;height:calc(var(--spacing-unit) * 3);padding:0 var(--spacing-unit)}.viewer-header[data-v-5c9ea6b6]{padding:0 10px;height:var(--bimdata-viewer-header-height, 40px);border-bottom:solid 2px var(--color-silver);background-color:var(--color-silver-light);display:flex;align-items:center;justify-content:space-between}.viewer-header__content[data-v-5c9ea6b6]{flex-grow:1;display:flex;align-items:center;justify-content:space-between}.viewer-header__content__left[data-v-5c9ea6b6]{display:flex;align-items:center;gap:calc(var(--spacing-unit) / 2)}.viewer-header__content__right[data-v-5c9ea6b6]{display:flex;align-items:center;justify-content:space-between}.viewer-header__version[data-v-5c9ea6b6]{font-size:small}.bimdata-separator[data-v-79a3b3af]{position:relative;cursor:ew-resize;flex-shrink:0}.bimdata-separator__line[data-v-79a3b3af]{background-color:#d8d8d8;height:100%;width:2px}.bimdata-separator__resizer[data-v-79a3b3af]{position:absolute;top:0;bottom:0;right:-9px;width:20px;z-index:2}.bimdata-global-side-panel[data-v-82d0d4cb]{display:flex;justify-content:space-around;height:100%;z-index:1;box-shadow:var(--box-shadow)}.bimdata-global-side-panel__component[data-v-82d0d4cb]{flex-grow:1;overflow:hidden;height:100%}.bimdata-viewer[data-v-0c1c941a]{height:100%;font-size:14px;position:relative;background-color:var(--bimdata-viewer-background-color, #f5f5f5);overflow:hidden}.bimdata-viewer__content[data-v-0c1c941a]{display:flex;justify-content:space-between;position:relative;overflow:hidden}.bimdata-viewer textarea[data-v-0c1c941a]{font-family:roboto,Helvetica,Arial,sans-serif}.bimdata-viewer .viewer__logo[data-v-0c1c941a]{position:absolute;bottom:var(--spacing-unit);left:0;display:flex;flex-direction:column;align-items:center}.bimdata-viewer .viewer__logo svg[data-v-0c1c941a]{width:72px;height:40px}.bimdata-viewer .viewer__logo .version[data-v-0c1c941a]{font-size:70%;min-width:72px;text-align:center}.bimdata-viewer .area[data-v-0c1c941a]{overflow:hidden}.bimdata-viewer{font-family:roboto,Helvetica,Arial,sans-serif;color:var(--color-primary)}.bimdata-viewer *,.bimdata-viewer *:before,.bimdata-viewer *:after{box-sizing:border-box}.bimdata-viewer .bimdata-context-loading-overlay{background-color:#ffffff80;position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center}.bimdata-info-length[data-v-34c2cf79]{padding:0 calc(var(--spacing-unit) / 2);height:18px;display:flex;align-items:center;justify-content:center;background-color:var(--color-primary);color:var(--color-white);border-radius:3px;line-height:1.5;font-size:11px}.bimdata-models[data-v-34c2cf79]{position:relative}.bimdata-models--window-positioning[data-v-34c2cf79]{position:absolute;z-index:1;top:var(--spacing-unit);left:calc(var(--bimdata-local-context-center-width) / 2);transform:translate(-50%)}.bimdata-models__list[data-v-34c2cf79]{width:var(--bimdata-models-width)}.bimdata-models__list[data-v-34c2cf79] li{height:30px;position:relative}.bimdata-models__header[data-v-34c2cf79]{display:flex;align-items:center;width:calc(100% - 33px)}.bimdata-models__header__loader[data-v-34c2cf79]{width:100%;display:flex;justify-content:center;align-items:center}.bimdata-models__header__picto[data-v-34c2cf79]{display:flex}.bimdata-models__header__number[data-v-34c2cf79]{margin-left:var(--spacing-unit)}.bimdata-models__header__number--empty[data-v-34c2cf79]{background-color:var(--color-granite)}.bimdata-models__header__name[data-v-34c2cf79]{margin-left:var(--spacing-unit);width:calc(100% - 61px)}.bimdata-models__header__name span[data-v-34c2cf79]{font-size:12px}.bimdata-models__header__name--empty[data-v-34c2cf79]{color:var(--color-granite)}.bimdata-models__preview[data-v-34c2cf79]{pointer-events:none;z-index:3;position:absolute;height:200px;width:200px;border:7px solid white;overflow:hidden;background-color:var(--color-silver-light)}.bimdata-models__preview img[data-v-34c2cf79]{height:100%}.bimdata-models__model[data-v-34c2cf79]{width:100%;height:100%;display:flex;align-items:center;padding:0 var(--spacing-unit)}.bimdata-models__model__name--disabled[data-v-34c2cf79]{color:var(--color-silver-dark)}.bimdata-models__model__spinner[data-v-34c2cf79]{position:absolute;top:0;right:0;margin:0 var(--spacing-unit);display:flex;align-items:center;height:100%}.bimdata-models[data-v-34c2cf79] .submenu{max-height:350px}.bimdata-models[data-v-34c2cf79] .submenu .bimdata-paginated-list__elements{height:auto;max-height:300px;overflow:auto}.bimdata-models[data-v-34c2cf79] .submenu .submenu--down li{padding:0}.bimdata-info-length[data-v-44e6af66]{padding:0 calc(var(--spacing-unit) / 2);height:18px;display:flex;align-items:center;justify-content:center;background-color:var(--color-primary);color:var(--color-white);border-radius:3px;line-height:1.5;font-size:11px}.bimdata-multi-model-loader[data-v-44e6af66]{position:relative;display:flex;align-items:center}.bimdata-multi-model-loader--window-positioning[data-v-44e6af66]{position:absolute;z-index:1;top:var(--spacing-unit);left:calc(var(--bimdata-local-context-center-width) / 2);transform:translate(-50%)}.bimdata-multi-model-loader__header-container[data-v-44e6af66]{display:flex;align-items:center;justify-content:center}.bimdata-multi-model-loader__header[data-v-44e6af66]{display:flex;align-items:center;justify-content:center;width:350px;height:34px;padding:0 var(--spacing-unit);background-color:#fff;box-shadow:var(--box-shadow);border-radius:2px;cursor:pointer}.bimdata-multi-model-loader__header__loader[data-v-44e6af66]{width:100%;display:flex;justify-content:center;align-items:center}.bimdata-multi-model-loader__header__picto[data-v-44e6af66]{display:flex}.bimdata-multi-model-loader__header__number[data-v-44e6af66]{margin-left:var(--spacing-unit)}.bimdata-multi-model-loader__header__number--empty[data-v-44e6af66]{background-color:var(--color-granite)}.bimdata-multi-model-loader__header__name[data-v-44e6af66]{margin-left:var(--spacing-unit);width:calc(100% - 61px);font-size:12px}.bimdata-multi-model-loader__header__name--empty[data-v-44e6af66]{color:var(--color-granite)}.bimdata-multi-model-loader__main[data-v-44e6af66]{width:480px;background-color:#fff;box-shadow:var(--box-shadow);padding:calc(var(--spacing-unit) * 2) 0;display:flex;flex-direction:column}.bimdata-multi-model-loader__main__model[data-v-44e6af66]{width:100%;height:30px;display:flex;align-items:center;gap:8px;padding:0 calc(var(--spacing-unit) * 2);cursor:pointer}.bimdata-multi-model-loader__main__model[data-v-44e6af66]:hover{background-color:var(--color-silver-light)}.bimdata-multi-model-loader__main__model--disabled[data-v-44e6af66]{cursor:default}.bimdata-multi-model-loader__main__model__name--disabled[data-v-44e6af66]{color:var(--color-silver-dark)}.bimdata-multi-model-loader__main__model__spinner[data-v-44e6af66]{width:16px;margin:auto;display:flex;align-items:center;height:100%}.bimdata-multi-model-loader__main__validate[data-v-44e6af66]{margin-top:var(--spacing-unit);margin-right:calc(var(--spacing-unit) * 2);align-self:end}.bimdata-multi-model-loader__preview[data-v-44e6af66]{pointer-events:none;z-index:3;position:absolute;height:200px;width:200px;border:7px solid white;overflow:hidden;background-color:var(--color-silver-light)}.bimdata-multi-model-loader__preview img[data-v-44e6af66]{height:100%}.bimdata__no-model[data-v-5ffd9bc0]{position:absolute;top:0;left:0;right:0;bottom:0;opacity:var(--no-model--opacity);transition:opacity 1s ease-in;display:flex;flex-direction:column;justify-content:center;align-items:center;color:var(--color-silver-dark);font-size:medium}.bimdata__no-model svg[data-v-5ffd9bc0]{height:200px;width:200px}`)),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();var j_e=Object.defineProperty,Mre=t=>{throw TypeError(t)},H_e=(t,e,i)=>e in t?j_e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,It=(t,e,i)=>H_e(t,typeof e!="symbol"?e+"":e,i),FU=(t,e,i)=>e.has(t)||Mre("Cannot "+i),B=(t,e,i)=>(FU(t,e,"read from private field"),i?i.call(t):e.get(t)),ne=(t,e,i)=>e.has(t)?Mre("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),ee=(t,e,i,r)=>(FU(t,e,"write to private field"),r?r.call(t,i):e.set(t,i),i),oe=(t,e,i)=>(FU(t,e,"access private method"),i),Ql=(t,e,i,r)=>({set _(o){ee(t,e,o,i)},get _(){return B(t,e,r)}});function V_e(t,e){for(var i=0;i<e.length;i++){const r=e[i];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in t)){const n=Object.getOwnPropertyDescriptor(r,o);n&&Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const aE=t=>`Context Menu --- Cannot "${t}" because the context menu is disabled. Consider enabling it in the makeBIMDataViewer configuration object if you want to use it.`,z_e={preventDefault(){console.warn(aE("preventDefault"))},registerContextCommand(){console.warn(aE("registerContextCommand"))},registerCommand(){console.warn(aE("registerCommand"))},open(){console.warn(aE("open"))}},Sa=t=>e=>e[t],Sr=t=>e=>e[t],Eg=t=>e=>!e[t],bh=(t,e)=>i=>t(i)&&e(i),Ev=Sa("id");function q_e({state:t,getObjects:e=()=>[]}){return[{name:"selectAll",key:"C",execute:()=>t.selectObjects(e().filter(bh(Sr("visible"),Eg("selected"))).map(Ev))},{name:"deselectAll",key:"V",execute:()=>t.deselectObjects(e().filter(Sr("selected")).map(Ev))},{name:"selectSimilar",key:"Y",execute:()=>{const i=e(),r=i.filter(bh(Sr("visible"),Sr("selected")));if(r.length===1&&r[0].type!==void 0){const o=r[0],n=i.filter(s=>s.visible&&s.type===o.type&&s.id!==o.id).map(Ev);t.selectObjects(n)}}},{name:"hide",key:"H",execute:()=>{const i=e().filter(bh(Sr("selected"),Sr("visible"))),r=i.filter(Sr("selected"));r.length>0&&t.deselectObjects(r.map(Ev)),t.hideObjects(i.map(Ev))}},{name:"showAll",key:"R",execute:()=>{const i=e().filter(Eg("visible")).map(Ev);i.length>0&&t.showObjects(i)}}]}const G_e=t=>{const e=[];let i=!1,r=null;function o(u){if(i&&u.target.tagName!=="INPUT"&&u.target.tagName!=="TEXTAREA"){const h=n(u);h&&(u.preventDefault(),u.stopPropagation(),h.execute())}}function n(u){const h=e.filter(p=>Pre(p,u));return h.length?h.find(p=>p.context===r)||h.find(p=>p.context==null):null}document.addEventListener("keydown",o);function s(){document.removeEventListener("keydown",o)}function a(u={},h){const{name:p,key:g,execute:f,ctrlKey:A=!1,shiftKey:m=!1,altKey:v=!1}=u;if(!p)return console.error("Cannot register shortcut without a name."),!1;if(!f||typeof f!="function")return console.error("Cannot register shortcut without an execute function."),!1;if(g==null)return console.error("Cannot register shortcut without a key."),!1;const y=e.find(w=>Pre(w,u)&&w.context==h);if(y)return console.error(`A shortcut on the key "${u.key}" is already registered on this context with the name "${y.name}".`),!1;const b=e.find(w=>w.name===u.name&&w.context===h);return b?(console.error(`A shortcut with the name "${u.name}" is already registered on this context on the key "${b.key}".`),!1):(e.push({name:p,key:g,context:h,execute:f,ctrlKey:A,shiftKey:m,altKey:v}),!0)}function l(u,h){const p=e.find(g=>g.name===u&&g.context===h);return p?(e.splice(e.indexOf(p),1),!0):!1}function c(u,h){return e.find(p=>p.name===u&&p.context==h)}function d(u){return e.filter(h=>h.context==u)}return{shortcuts:e,getShortcut:c,getShortcuts:d,registerShortcut:a,unregisterShortcut:l,destroy:s,getDefaultShortcuts(u,h=t){return q_e({state:h,getObjects:u})},get active(){return i},set active(u){i=u},get activeLocalContext(){return r},set activeLocalContext(u){r=u}}};function Pre(t,e){const{key:i,ctrlKey:r=!1,shiftKey:o=!1,metaKey:n=!1,altKey:s=!1}=e;return t.key.toUpperCase()===i.toUpperCase()&&t.ctrlKey===(r||n)&&t.shiftKey===o&&t.altKey===s}/*!
|
|
7
7
|
* shared v11.1.3
|
|
8
8
|
* (c) 2025 kazuya kawaguchi
|
|
9
9
|
* Released under the MIT License.
|
|
@@ -5517,12 +5517,12 @@ void main() {
|
|
|
5517
5517
|
`,r=()=>e.useDataURI?"data:text/javascript,"+encodeURIComponent(i):URL.createObjectURL(new Blob([i],{type:"text/javascript"}));t({workerScripts:{inflate:[r],deflate:[r]}})}const uDi="Writer iterator completed too soon",hDi="Content-Type",pDi=64*1024,LPe="writable";let vY=class{constructor(){this.size=0}init(){this.initialized=!0}},_Pe=class extends vY{get readable(){const t=this,{chunkSize:e=pDi}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(r){const{offset:o=0,size:n,diskNumberStart:s}=i,{chunkOffset:a}=this,l=n===sa?e:Math.min(e,n-a),c=await qa(t,o+a,l,s);r.enqueue(c),a+e>n||n===sa&&!c.length&&l?r.close():this.chunkOffset+=e}});return i}};class FPe extends _Pe{constructor(e){super(),Object.assign(this,{blob:e,size:e.size})}async readUint8Array(e,i){const r=this,o=e+i;let n=await(e||o<r.size?r.blob.slice(e,o):r.blob).arrayBuffer();return n.byteLength>i&&(n=n.slice(e,o)),new Uint8Array(n)}}class OPe extends vY{constructor(e){super();const i=this,r=new TransformStream,o=[];e&&o.push([hDi,e]),Object.defineProperty(i,LPe,{get(){return r.writable}}),i.blob=new Response(r.readable,{headers:o}).blob()}getData(){return this.blob}}class fDi extends OPe{constructor(e){super(e),Object.assign(this,{encoding:e,utf8:!e||e.toLowerCase()=="utf-8"})}async getData(){const{encoding:e,utf8:i}=this,r=await super.getData();if(r.text&&i)return r.text();{const o=new FileReader;return new Promise((n,s)=>{Object.assign(o,{onload:({target:a})=>n(a.result),onerror:()=>s(o.error)}),o.readAsText(r,e)})}}}class gDi extends _Pe{constructor(e){super(),this.readers=e}async init(){const e=this,{readers:i}=e;e.lastDiskNumber=0,e.lastDiskOffset=0,await Promise.all(i.map(async(r,o)=>{await r.init(),o!=i.length-1&&(e.lastDiskOffset+=r.size),e.size+=r.size})),super.init()}async readUint8Array(e,i,r=0){const o=this,{readers:n}=this;let s,a=r;a==-1&&(a=n.length-1);let l=e;for(;l>=n[a].size;)l-=n[a].size,a++;const c=n[a],d=c.size;if(l+i<=d)s=await qa(c,l,i);else{const u=d-l;s=new Uint8Array(i),s.set(await qa(c,l,u)),s.set(await o.readUint8Array(e+u,i-u,r),u)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}}class UPe extends vY{constructor(e,i=4294967295){super();const r=this;Object.assign(r,{diskNumber:0,diskOffset:0,size:0,maxSize:i,availableSize:i});let o,n,s;const a=new WritableStream({async write(d){const{availableSize:u}=r;if(s)d.length>=u?(await l(d.slice(0,u)),await c(),r.diskOffset+=o.size,r.diskNumber++,s=null,await this.write(d.slice(u))):await l(d);else{const{value:h,done:p}=await e.next();if(p&&!h)throw new Error(uDi);o=h,o.size=0,o.maxSize&&(r.maxSize=o.maxSize),r.availableSize=r.maxSize,await aL(o),n=h.writable,s=n.getWriter(),await this.write(d)}},async close(){await s.ready,await c()}});Object.defineProperty(r,LPe,{get(){return a}});async function l(d){const u=d.length;u&&(await s.ready,await s.write(d),o.size+=u,r.size+=u,r.availableSize-=u)}async function c(){n.size=o.size,await s.close()}}}async function aL(t,e){if(t.init&&!t.initialized)await t.init(e);else return Promise.resolve()}function mDi(t){return Array.isArray(t)&&(t=new gDi(t)),t instanceof ReadableStream&&(t={readable:t}),t}function ADi(t){t.writable===sa&&typeof t.next==Sx&&(t=new UPe(t)),t instanceof WritableStream&&(t={writable:t});const{writable:e}=t;return e.size===sa&&(e.size=0),t instanceof UPe||Object.assign(t,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),t}function qa(t,e,i,r){return t.readUint8Array(e,i,r)}const NPe="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),vDi=NPe.length==256;function bDi(t){if(vDi){let e="";for(let i=0;i<t.length;i++)e+=NPe[t[i]];return e}else return new TextDecoder().decode(t)}function lL(t,e){return e&&e.trim().toLowerCase()=="cp437"?bDi(t):new TextDecoder(e).decode(t)}const jPe="filename",HPe="rawFilename",VPe="comment",zPe="rawComment",qPe="uncompressedSize",GPe="compressedSize",QPe="offset",bY="diskNumberStart",yY="lastModDate",wY="rawLastModDate",KPe="lastAccessDate",yDi="rawLastAccessDate",WPe="creationDate",wDi="rawCreationDate",CDi="internalFileAttribute",xDi="internalFileAttributes",kDi="externalFileAttribute",MDi="externalFileAttributes",PDi="msDosCompatible",EDi="zip64",SDi="encrypted",BDi="version",IDi="versionMadeBy",TDi="zipCrypto",RDi="directory",DDi="executable",LDi=[jPe,HPe,GPe,qPe,yY,wY,VPe,zPe,KPe,WPe,QPe,bY,bY,CDi,xDi,kDi,MDi,PDi,EDi,SDi,BDi,IDi,TDi,RDi,DDi,"bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class ZPe{constructor(e){LDi.forEach(i=>this[i]=e[i])}}const CY="File format is not recognized",_Di="End of central directory not found",FDi="End of Zip64 central directory locator not found",ODi="Central directory header not found",UDi="Local file header not found",NDi="Zip64 extra field not found",jDi="File contains encrypted entry",HDi="Encryption method not supported",JPe="Compression method not supported",XPe="Split zip file",YPe="utf-8",$Pe="cp437",VDi=[[qPe,Xm],[GPe,Xm],[QPe,Xm],[bY,h2]],zDi={[h2]:{getValue:Hn,bytes:4},[Xm]:{getValue:cL,bytes:8}};class qDi{constructor(e,i={}){Object.assign(this,{reader:mDi(e),options:i,config:xRi()})}async*getEntriesGenerator(e={}){const i=this;let{reader:r}=i;const{config:o}=i;if(await aL(r),(r.size===sa||!r.readUint8Array)&&(r=new FPe(await new Response(r.readable).blob()),await aL(r)),r.size<i7)throw new Error(CY);r.chunkSize=kRi(o);const n=await JDi(r,dRi,r.size,i7,h2*16);if(!n){const S=await qa(r,0,4),I=Us(S);throw Hn(I)==cRi?new Error(XPe):new Error(_Di)}const s=Us(n);let a=Hn(s,12),l=Hn(s,16);const c=n.offset,d=Os(s,20),u=c+i7+d;let h=Os(s,4);const p=r.lastDiskNumber||0;let g=Os(s,6),f=Os(s,8),A=0,m=0;if(l==Xm||a==Xm||f==h2||g==h2){const S=await qa(r,n.offset-aY,aY),I=Us(S);if(Hn(I,0)==uRi){l=cL(I,8);let R=await qa(r,l,lY,-1),L=Us(R);const j=n.offset-aY-lY;if(Hn(L,0)!=qMe&&l!=j){const H=l;l=j,A=l-H,R=await qa(r,l,lY,-1),L=Us(R)}if(Hn(L,0)!=qMe)throw new Error(FDi);h==h2&&(h=Hn(L,16)),g==h2&&(g=Hn(L,20)),f==h2&&(f=cL(L,32)),a==Xm&&(a=cL(L,40)),l-=a}}if(l>=r.size&&(A=r.size-l-a-i7,l=r.size-a-i7),p!=h)throw new Error(XPe);if(l<0)throw new Error(CY);let v=0,y=await qa(r,l,a,g),b=Us(y);if(a){const S=n.offset-a;if(Hn(b,v)!=zMe&&l!=S){const I=l;l=S,A+=l-I,y=await qa(r,l,a,g),b=Us(y)}}const w=n.offset-l-(r.lastDiskOffset||0);if(a!=w&&w>=0&&(a=w,y=await qa(r,l,a,g),b=Us(y)),l<0||l>=r.size)throw new Error(CY);const C=El(i,e,"filenameEncoding"),M=El(i,e,"commentEncoding");for(let S=0;S<f;S++){const I=new GDi(r,o,i.options);if(Hn(b,v)!=zMe)throw new Error(ODi);eEe(I,b,v+6);const R=!!I.bitFlag.languageEncodingFlag,L=v+46,j=L+I.filenameLength,H=j+I.extraFieldLength,U=Os(b,v+4),z=U>>8==0,Z=U>>8==3,Y=y.subarray(L,j),de=Os(b,v+32),he=H+de,ve=y.subarray(H,he),Ee=R,we=R,De=Hn(b,v+38),Se=z&&(n7(b,v+38)&WMe)==WMe||Z&&(De>>16&ZMe)==ZMe||Y.length&&Y[Y.length-1]==XMe.charCodeAt(0),J=Z&&(De>>16&JMe)==JMe,se=Hn(b,v+42)+A;Object.assign(I,{versionMadeBy:U,msDosCompatible:z,compressedSize:0,uncompressedSize:0,commentLength:de,directory:Se,offset:se,diskNumberStart:Os(b,v+34),internalFileAttributes:Os(b,v+36),externalFileAttributes:De,rawFilename:Y,filenameUTF8:Ee,commentUTF8:we,rawExtraField:y.subarray(j,H),executable:J}),I.internalFileAttribute=I.internalFileAttributes,I.externalFileAttribute=I.externalFileAttributes;const ce=El(i,e,"decodeText")||lL,ue=Ee?YPe:C||$Pe,Ie=we?YPe:M||$Pe;let Ve=ce(Y,ue);Ve===sa&&(Ve=lL(Y,ue));let ie=ce(ve,Ie);ie===sa&&(ie=lL(ve,Ie)),Object.assign(I,{rawComment:ve,filename:Ve,comment:ie,directory:Se||Ve.endsWith(XMe)}),m=Math.max(se,m),tEe(I,I,b,v+6),I.zipCrypto=I.encrypted&&!I.extraFieldAES;const q=new ZPe(I);q.getData=(me,be)=>I.getData(me,q,be),v=he;const{onprogress:ge}=e;if(ge)try{await ge(S+1,f,new ZPe(I))}catch{}yield q}const P=El(i,e,"extractPrependedData"),E=El(i,e,"extractAppendedData");return P&&(i.prependedData=m>0?await qa(r,0,m):new Uint8Array),i.comment=d?await qa(r,c+i7,d):new Uint8Array,E&&(i.appendedData=u<r.size?await qa(r,u,r.size-u):new Uint8Array),!0}async getEntries(e={}){const i=[];for await(const r of this.getEntriesGenerator(e))i.push(r);return i}async close(){}}class GDi{constructor(e,i,r){Object.assign(this,{reader:e,config:i,options:r})}async getData(e,i,r={}){const o=this,{reader:n,offset:s,diskNumberStart:a,extraFieldAES:l,compressionMethod:c,config:d,bitFlag:u,signature:h,rawLastModDate:p,uncompressedSize:g,compressedSize:f}=o,A=i.localDirectory={},m=await qa(n,s,30,a),v=Us(m);let y=El(o,r,"password"),b=El(o,r,"rawPassword");const w=El(o,r,"passThrough");if(y=y&&y.length&&y,b=b&&b.length&&b,l&&l.originalCompressionMethod!=aRi)throw new Error(JPe);if(c!=sRi&&c!=nRi&&!w)throw new Error(JPe);if(Hn(v,0)!=lRi)throw new Error(UDi);eEe(A,v,4),A.rawExtraField=A.extraFieldLength?await qa(n,s+30+A.filenameLength,A.extraFieldLength,a):new Uint8Array,tEe(o,A,v,4,!0),Object.assign(i,{lastAccessDate:A.lastAccessDate,creationDate:A.creationDate});const C=o.encrypted&&A.encrypted&&!w,M=C&&!l;if(w||(i.zipCrypto=M),C){if(!M&&l.strength===sa)throw new Error(HDi);if(!y&&!b)throw new Error(jDi)}const P=s+30+A.filenameLength+A.extraFieldLength,E=f,S=n.readable;Object.assign(S,{diskNumberStart:a,offset:P,size:E});const I=El(o,r,"signal"),R=El(o,r,"checkPasswordOnly");R&&(e=new WritableStream),e=ADi(e),await aL(e,w?f:g);const{writable:L}=e,{onstart:j,onprogress:H,onend:U}=r,z={options:{codecType:EPe,password:y,rawPassword:b,zipCrypto:M,encryptionStrength:l&&l.strength,signed:El(o,r,"checkSignature")&&!w,passwordVerification:M&&(u.dataDescriptor?p>>>8&255:h>>>24&255),signature:h,compressed:c!=0&&!w,encrypted:o.encrypted&&!w,useWebWorkers:El(o,r,"useWebWorkers"),useCompressionStream:El(o,r,"useCompressionStream"),transferStreams:El(o,r,"transferStreams"),checkPasswordOnly:R},config:d,streamOptions:{signal:I,size:E,onstart:j,onprogress:H,onend:U}};let Z=0;try{({outputSize:Z}=await lDi({readable:S,writable:L},z))}catch(Y){if(!R||Y.message!=uY)throw Y}finally{const Y=El(o,r,"preventClose");L.size+=Z,!Y&&!L.locked&&await L.getWriter().close()}return R?sa:e.getData?e.getData():L}}function eEe(t,e,i){const r=t.rawBitFlag=Os(e,i+2),o=(r&GMe)==GMe,n=Hn(e,i+6);Object.assign(t,{encrypted:o,version:Os(e,i),bitFlag:{level:(r&yRi)>>1,dataDescriptor:(r&QMe)==QMe,languageEncodingFlag:(r&KMe)==KMe},rawLastModDate:n,lastModDate:XDi(n),filenameLength:Os(e,i+22),extraFieldLength:Os(e,i+24)})}function tEe(t,e,i,r,o){const{rawExtraField:n}=e,s=e.extraField=new Map,a=Us(new Uint8Array(n));let l=0;try{for(;l<n.length;){const m=Os(a,l),v=Os(a,l+2);s.set(m,{type:m,data:n.slice(l+4,l+4+v)}),l+=4+v}}catch{}const c=Os(i,r+4);Object.assign(e,{signature:Hn(i,r+10),uncompressedSize:Hn(i,r+18),compressedSize:Hn(i,r+14)});const d=s.get(hRi);d&&(QDi(d,e),e.extraFieldZip64=d);const u=s.get(ARi);u&&(iEe(u,jPe,HPe,e,t),e.extraFieldUnicodePath=u);const h=s.get(vRi);h&&(iEe(h,VPe,zPe,e,t),e.extraFieldUnicodeComment=h);const p=s.get(pRi);p?(KDi(p,e,c),e.extraFieldAES=p):e.compressionMethod=c;const g=s.get(fRi);g&&(WDi(g,e),e.extraFieldNTFS=g);const f=s.get(mRi);f&&(ZDi(f,e,o),e.extraFieldExtendedTimestamp=f);const A=s.get(bRi);A&&(e.extraFieldUSDZ=A)}function QDi(t,e){e.zip64=!0;const i=Us(t.data),r=VDi.filter(([o,n])=>e[o]==n);for(let o=0,n=0;o<r.length;o++){const[s,a]=r[o];if(e[s]==a){const l=zDi[a];e[s]=t[s]=l.getValue(i,n),n+=l.bytes}else if(t[s])throw new Error(NDi)}}function iEe(t,e,i,r,o){const n=Us(t.data),s=new rL;s.append(o[i]);const a=Us(new Uint8Array(4));a.setUint32(0,s.get(),!0);const l=Hn(n,1);Object.assign(t,{version:n7(n,0),[e]:lL(t.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&l==Hn(a,0)}),t.valid&&(r[e]=t[e],r[e+"UTF8"]=!0)}function KDi(t,e,i){const r=Us(t.data),o=n7(r,4);Object.assign(t,{vendorVersion:n7(r,0),vendorId:n7(r,2),strength:o,originalCompressionMethod:i,compressionMethod:Os(r,5)}),e.compressionMethod=t.compressionMethod}function WDi(t,e){const i=Us(t.data);let r=4,o;try{for(;r<t.data.length&&!o;){const n=Os(i,r),s=Os(i,r+2);n==gRi&&(o=t.data.slice(r+4,r+4+s)),r+=4+s}}catch{}try{if(o&&o.length==24){const n=Us(o),s=n.getBigUint64(0,!0),a=n.getBigUint64(8,!0),l=n.getBigUint64(16,!0);Object.assign(t,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:l});const c=xY(s),d=xY(a),u=xY(l),h={lastModDate:c,lastAccessDate:d,creationDate:u};Object.assign(t,h),Object.assign(e,h)}}catch{}}function ZDi(t,e,i){const r=Us(t.data),o=n7(r,0),n=[],s=[];i?((o&1)==1&&(n.push(yY),s.push(wY)),(o&2)==2&&(n.push(KPe),s.push(yDi)),(o&4)==4&&(n.push(WPe),s.push(wDi))):t.data.length>=5&&(n.push(yY),s.push(wY));let a=1;n.forEach((l,c)=>{if(t.data.length>=a+4){const d=Hn(r,a);e[l]=t[l]=new Date(d*1e3);const u=s[c];t[u]=d}a+=4})}async function JDi(t,e,i,r,o){const n=new Uint8Array(4),s=Us(n);YDi(s,0,e);const a=r+o;return await l(r)||await l(Math.min(a,i));async function l(c){const d=i-c,u=await qa(t,d,c);for(let h=u.length-r;h>=0;h--)if(u[h]==n[0]&&u[h+1]==n[1]&&u[h+2]==n[2]&&u[h+3]==n[3])return{offset:d+h,buffer:u.slice(h,h+r).buffer}}}function El(t,e,i){return e[i]===sa?t.options[i]:e[i]}function XDi(t){const e=(t&4294901760)>>16,i=t&65535;try{return new Date(1980+((e&65024)>>9),((e&480)>>5)-1,e&31,(i&63488)>>11,(i&2016)>>5,(i&31)*2,0)}catch{}}function xY(t){return new Date(Number(t/BigInt(1e4)-BigInt(116444736e5)))}function n7(t,e){return t.getUint8(e)}function Os(t,e){return t.getUint16(e,!0)}function Hn(t,e){return t.getUint32(e,!0)}function cL(t,e){return Number(t.getBigUint64(e,!0))}function YDi(t,e,i){t.setUint32(e,i,!0)}function Us(t){return new DataView(t.buffer)}let rEe;try{rEe=import.meta.url}catch{}cY({baseURL:rEe}),dDi(cY),cY({Deflate:OTi,Inflate:oRi});function $Di(t){return{getDetailedExtensions(e){return[]},getExtensions(e){return[]},getFullTopics(e,i,r,o,n,s,a){return[]},getTopics(e,i,r,o){return[]}}}function eLi(t){return{checkProjectAccess(e,i){return{has_read_permission:!0,has_write_permission:!1,has_admin_permission:!1,token_scopes:["bcf:read","document:read","model:read"],usable_scopes:["bcf:read","document:read","model:read"],user_role:50,user:null}},getProjectDMSTree(e,i){return{}},getDocumentHistories(e,i,r){return[]},getProjectUsers(e,i){return[]}}}function tLi(t={}){var e,i,r,o,n,s,a,l,c,d;const u=t,h=((e=u.units)==null?void 0:e.reduce((b,w)=>(w.conversion_baseunit=u.units[w.conversion_baseunit_index],delete w.conversion_baseunit_index,b[w.id]=w,b),{}))??{},p=((i=u.definitions)==null?void 0:i.reduce((b,w)=>(w.unit=u.units[w.unit_id],delete w.unit_id,b[w.id]=w,b),{}))??{},g=((r=u.property_sets)==null?void 0:r.reduce((b,w)=>(w.properties.forEach(C=>{C.definition=u.definitions[C.def_id],delete C.def_id}),b[w.id]=w,b),{}))??{},f=((o=u.classifications)==null?void 0:o.reduce((b,w)=>(w.name=w.type,w.title=w.description,b[w.id]=w,b),{}))??{},A=((n=u.layers)==null?void 0:n.reduce((b,w)=>(w.elements=[],b[w.id]=w,b),{}))??{},m=((s=u.systems)==null?void 0:s.reduce((b,w)=>(w.elements=[],b[w.uuid]=w,b),{}))??{},v={};v.materials_data=((a=u.materials)==null?void 0:a.materials_data.reduce((b,w)=>(w.property_sets=w.psets.map(C=>u.property_sets[C]),delete w.psets,delete w.step_id,b[w.id]=w,b),{}))??{},v.list_components=((l=u.materials)==null?void 0:l.list_components.reduce((b,w)=>(w.material=u.materials.materials_data[w.material],w.option=u.materials.options[w.material_option],b[w.id]=w,delete w.id,b),{}))??{},v.options=((c=u.materials)==null?void 0:c.options.reduce((b,w)=>(w.list_components=w.material_list.map(C=>u.materials.list_components[C]),b[w.id]=w,b),{}))??{};const y={};return(d=u.elements)==null||d.forEach(b=>{b.attributes=u.property_sets[b.attributes],b.property_sets=b.psets.map(w=>u.property_sets[w]),delete b.psets,b.classifications=b.classifications.map(w=>u.classifications[w]),b.systems=b.systems.map(w=>{const C=u.systems[w];return C.elements.push(b.uuid),C}),b.layers=b.layers.map(w=>{const C=u.layers[w];return C.elements.push(b.uuid),C}),b.material_list=b.material_list.map(w=>u.materials.list_components[w]),y[b.uuid]=b}),{units:h,definitions:p,property_sets:g,classifications:f,layers:A,systems:m,materials:v,elements:y}}function iLi(t){const e={};return Object.values(t).forEach(i=>{e[i.uuid]={},e[i.uuid].attributes={},i.attributes.properties.forEach(r=>{e[i.uuid].attributes[r.definition.name]=r.value}),i.property_sets.forEach(r=>{e[i.uuid][r.name]={},r.properties.forEach(o=>{e[i.uuid][r.name][o.definition.name]=o.value})})}),e}function rLi(t){return Object.values(t).forEach(e=>{e.formattedRawElements=tLi(e.rawElements)}),{getModels(e,i,r,o,n){let s=Object.values(t).map(a=>a.model);return s=s.filter(a=>!(a.type==="PDF"&&a.parent_id)),r?.length>0&&(s=s.filter(a=>r.includes(a.source))),o?.length>0&&(s=s.filter(a=>o.includes(a.status))),n?.length>0&&(s=s.filter(a=>n.includes(a.type))),s},getModel(e,i,r){return t[i].model},getTileset(e,i,r,o){console.warn("[BIMData Viewer] Offline Warning: `getTileset` is not available in offline mode.")},getBuildings(e,i,r){return t[i].buildings},getBuildingPlanPositioning(e,i,r,o,n){const s=this.getBuilding(i,o,n,e).plans.find(a=>a.plan.id===r);return{translation_x:s.translation_x,translation_y:s.translation_y,rotate_z:s.rotate_z,scale:s.scale,opacity:s.opacity}},getBuilding(e,i,r,o){return t[i].buildings.find(n=>n.uuid===o)},getModelClassifications(e,i,r){return Object.values(t[i].formattedRawElements.classifications)},listClassificationElementRelations(e,i,r){return Object.values(t[i].formattedRawElements.elements).flatMap(o=>o.classifications.map(n=>({element_uuid:o.uuid,classification_id:n.id})))},getElementsFromClassification(e,i,r,o){return t[r].formattedRawElements.classifications[i].elements},getDrawings(e,i,r){return t[i].drawings},getDrawing(e,i,r,o){return this.getDrawings(e,r,o).find(n=>n.id===i)},getElements(e,i,r,o,n,s){return Object.values(t[i].formattedRawElements.elements).filter(a=>s?a.type===s:o?a.classifications.some(l=>l.name===o):n?a.classifications.some(l=>l.notation===n):!0)},getElementLinkedDocuments(e,i,r){return console.warn("[BIMData Viewer] Offline Warning: `getElementLinkedDocuments` is not available in offline mode."),[]},async getRawElements(e,i,r,o,n,s){return t[i].rawElements},getSimpleElements(e,i,r,o,n,s){const a=this.getElements(e,i,r,o,n,s);return iLi(a)},getClassificationsOfElement(e,i,r,o){return this.getElement(e,r,o,i).classifications},getDocumentsOfElement(e,i,r,o){return console.warn("[BIMData Viewer] Offline Warning: `getDocumentsOfElement` is not available in offline mode."),[]},getMaterials(e,i,r,o){return this.getElement(e,r,o,i).material_list.map(n=>n.material)},getMaterial(e,i,r,o,n){return this.getMaterials(e,i,o,n).find(s=>s.id===r)},getElementPropertySets(e,i,r,o){return this.getElement(e,r,o,i).property_sets},getElementPropertySet(e,i,r,o,n){return this.getElementPropertySets(e,i,o,n).find(s=>s.id===r)},getElementPropertySetProperties(e,i,r,o,n){return this.getElementPropertySet(e,i,n,r,o).properties},getElementPropertySetProperty(e,i,r,o,n,s){return this.getElementPropertySetProperties(e,i,o,n,s).find(a=>a.id===r)},getElementPropertySetPropertyDefinitions(e,i,r,o,n,s){return[this.getElementPropertySetProperty(e,i,n,r,o,s).definition]},getElementPropertySetPropertyDefinition(e,i,r,o,n,s,a){const l=this.getElementPropertySetProperty(e,i,s,o,n,a).definition;return l.id===r?l:void 0},getElementPropertySetPropertyDefinitionUnits(e,i,r,o,n,s,a){return[this.getElementPropertySetPropertyDefinition(e,i,s,r,o,n,a).unit]},getElementPropertySetPropertyDefinitionUnit(e,i,r,o,n,s,a,l){const c=this.getElementPropertySetPropertyDefinition(e,i,a,o,n,s,l).unit;return c.id===r?c:void 0},getElement(e,i,r,o){return t[i].formattedRawElements.elements[o]},getSimpleElement(e,i,r,o){return this.getSimpleElements(e,i,r)[o]},getLayers(e,i,r){return Object.values(t[i].formattedRawElements.layers)},getLayer(e,i,r,o){return this.getLayers(e,r,o).find(n=>n.id===i)},getModelMaterials(e,i,r){return Object.values(t[i].formattedRawElements.materials.materials_data)},getModelMaterial(e,i,r,o){return this.getModelMaterials(e,r,o).find(n=>n.id===i)},getProcessorHandlers(e,i,r){return console.warn("[BIMData Viewer] Offline Warning: `getProcessorHandlers` is not available in offline mode."),[]},getProcessorHandler(e,i,r,o){console.warn("[BIMData Viewer] Offline Warning: `getProcessorHandler` is not available in offline mode.")},getModelProperties(e,i,r){return t[i].properties},getModelProperty(e,i,r,o){return t[r].properties.find(n=>n.id===i)},getModelPropertyDefinitions(e,i,r){return Object.values(t[i].formattedRawElements.definitions)},getModelPropertyDefinition(e,i,r,o){return this.getModelPropertyDefinitions(e,r,o).find(n=>n.id===i)},getPropertySets(e,i,r){return Object.values(t[i].formattedRawElements.property_sets)},getPropertySet(e,i,r,o){return this.getPropertySets(e,r,o).find(n=>n.id===i)},getSpaces(e,i,r){return t[i].spaces},getSpace(e,i,r,o){return t[r].spaces.find(n=>n.id===i)},getStoreys(e,i,r){return t[i].storeys},getStoreyPlanPositioning(e,i,r,o,n){const s=this.getStorey(e,r,o,n).plans.find(a=>a.plan.id===i);return{translation_x:s.translation_x,translation_y:s.translation_y,rotate_z:s.rotate_z,scale:s.scale,opacity:s.opacity}},getStorey(e,i,r,o){return t[i].storeys.find(n=>n.uuid===o)},getSystems(e,i,r){return Object.values(t[i].formattedRawElements.systems)},getSystem(e,i,r,o){return this.getSystems(e,i,r).find(n=>n.uuid===o)},getModelUnits(e,i,r){return Object.values(t[i].formattedRawElements.units)},getModelUnit(e,i,r,o){return this.getModelUnits(e,r,o).find(n=>n.id===i)},getZones(e,i,r,o){return t[i].zones.filter(n=>o?n.color===o:!0)},getZone(e,i,r,o){return t[r].zones.find(n=>n.id===i)},getZoneSpaces(e,i,r,o){return this.getZone(e,o,i,r).spaces},getZoneSpace(e,i,r,o,n){return this.getZoneSpaces(e,r,o,n).find(s=>s.id===i)}}}async function oLi(t){const e=t.find(r=>r.filename==="data.json"),i=await e?.getData(new fDi);return i?JSON.parse(i):null}async function Lx(t,e,i){const r=t.find(n=>n.filename===`${e.id}/${i}`),o=await r?.getData(new OPe);return o?URL.createObjectURL(o):null}async function nLi(t,e){await Promise.all([Lx(t,e,"document_file").then(i=>e.document&&(e.document.file=i)),Lx(t,e,"structure_file").then(i=>e.structure_file=i),Lx(t,e,"map_file").then(i=>e.map_file=i),Lx(t,e,"binary_2d_file").then(i=>e.binary_2d_file=i),...e.xkt_files.map((i,r)=>Lx(t,e,`xkt_file_v${i.version}`).then(o=>e.xkt_files[r]={version:i.version,file:o}))])}async function sLi(t){const e=await new qDi(new FPe(t)).getEntries(),i=await oLi(e);return await Promise.all(Object.values(i).flatMap(({model:r,buildings:o=[],storeys:n=[]})=>[r].concat(r.children).concat(o.flatMap(s=>s.plans).map(s=>s.plan)).concat(n.flatMap(s=>s.plans).map(s=>s.plan))).map(r=>nLi(e,r))),i}function kY(t,e,i){return new Proxy(t[i],{get:function(r,o){if(e[o])return e[o];throw new Error(`[BIMData Viewer] Offline Error: method \`${i}.${o}\` is not mocked.`)}})}async function aLi(t,e,i){var r,o,n;typeof t=="string"&&(t=await fetch(t).then(d=>d.blob()));const s=await sLi(t),a=$Di(),l=eLi(),c=rLi(s);return Object.assign(a,(r=i.methods)==null?void 0:r.bcfApi),Object.assign(l,(o=i.methods)==null?void 0:o.collaborationApi),Object.assign(c,(n=i.methods)==null?void 0:n.modelApi),Object.assign({},e,{bcfApi:kY(e,a,"bcfApi"),collaborationApi:kY(e,l,"collaborationApi"),modelApi:kY(e,c,"modelApi")})}class lLi{constructor(e={}){const{apiUrl:i,archiveUrl:r,pdfBackendUrl:o,cloudId:n,projectId:s,accessToken:a,offline:l}=e;this.apiUrl=i,this.archiveUrl=r,this.pdfBackendUrl=o,this.cloudId=n,this.projectId=s,this._accessToken=a,this.offline=l??{enabled:!1};const c=WK.makeBIMDataApiClient({apiUrl:i,accessToken:a});this.apiClient=c,this.ready=Promise.resolve(),this.getModelsPromise=null,Object.assign(c,{BcfApi:function(){return console.warn("[BIMData Viewer] DEPRECATED - API - please use `apiClient.bcfApi` instead of `new apiClient.BcfApi()`."),c.bcfApi},CollaborationApi:function(){return console.warn("[BIMData Viewer] DEPRECATED - API - please use `apiClient.collaborationApi` instead of `new apiClient.CollaborationApi()`."),c.collaborationApi},ModelApi:function(){return console.warn("[BIMData Viewer] DEPRECATED - API - please use `apiClient.modelApi` instead of `new apiClient.ModelApi()`."),c.modelApi},IfcApi:function(){return console.warn("[BIMData Viewer] DEPRECATED - API - please use `apiClient.modelApi` instead of `new apiClient.IfcApi()`."),new Proxy(c.modelApi,{get:function(d,u,h){const p=u.replace("Deprecated","").replace("Ifc","Model");return Reflect.get(d,p,h)}})}})}get accessToken(){return this._accessToken}set accessToken(e){this._accessToken=e,this.apiClient.accessToken=e}async getAvailableModels(e=null,i=!1){return i&&(this.getModelsPromise=null),this.getModelsPromise||(this.getModelsPromise=this.apiClient.modelApi.getModels(this.cloudId,this.projectId)),(await this.getModelsPromise).filter(r=>e?.includes(r.type)??!0)}getModel(e){const{cloudId:i,projectId:r,apiClient:o}=this;return o.modelApi.getModel(i,e,r)}getIfc(e){return console.warn("[BIMData Viewer] DEPRECATED - API - please use the `getModel` method instead of `getIfc`."),this.getModel(e)}async getModelStructure(e){const i=(await(await fetch(e.structure_file)).json())[0];return Cf(i),i}getIfcStructure(e){return console.warn("[BIMData Viewer] DEPRECATED - API - please use the getModelStructure method instead of getIfcStructure."),this.getModelStructure(e)}async getRawElements(e){const{cloudId:i,projectId:r,apiClient:o}=this,n=await o.modelApi.getRawElements(i,e,r);n.units.forEach(a=>{a.conversion_baseunit=n.units[a.conversion_baseunit_index],delete a.conversion_baseunit_index}),n.definitions.forEach(a=>{a.unit=n.units[a.unit_id],delete a.unit_id}),n.property_sets.forEach(a=>{a.properties.forEach(l=>{l.definition=n.definitions[l.def_id],delete l.def_id})});const s={};return n.elements.forEach(a=>{a.attributes=n.property_sets[a.attributes],a.property_sets=a.psets.map(l=>n.property_sets[l]),Object.assign(a,{get propertySets(){return console.warn("propertySets is deprecated, please use property_sets instead."),a.property_sets}}),delete a.psets,a.classifications=a.classifications.map(l=>n.classifications[l]),a.systems=a.systems.map(l=>n.systems[l]),a.layers=a.layers.map(l=>n.layers[l]),s[a.uuid]=a}),s}getStoreys(e){const{cloudId:i,projectId:r,apiClient:o}=this;return o.modelApi.getStoreys(i,e,r)}createModel(e){const{cloudId:i,projectId:r,apiClient:o}=this;return o.modelApi.createModel(i,r,{document_id:e})}async waitForModelProcess(e){const i=["C","E","X"];return i.includes(e.status)?e:new Promise((r,o)=>{const n=setInterval(async()=>{try{let s=await this.getModel(e.id);i.includes(s.status)&&(clearInterval(n),r(s))}catch(s){clearInterval(n),o(s)}},1e3)})}async createStoreyPlan(e,i,r){const{cloudId:o,projectId:n,apiClient:s}=this,a=await this.createModel(r);return await s.modelApi.createStoreyPlan(o,e,n,i,{id:a.id}),a}deleteStoreyPlan(e,i,r){const{cloudId:o,projectId:n,apiClient:s}=this;return s.modelApi.deleteStoreyPlan(o,r,e,n,i)}updatePlanPositioning(e,i,r,o){const{cloudId:n,projectId:s,apiClient:a}=this;return a.modelApi.updateStoreyPlanPositioning(n,r,e,s,i,o)}async enableOfflineMode(e,i={}){let r;this.ready=new Promise(o=>r=o),this.apiClient=await aLi(e,this.apiClient,i),this.offline.enabled=!0,r()}disableOfflineMode(){this.offline.enabled&&(this.apiClient=WK.makeBIMDataApiClient({apiUrl:this.apiUrl,accessToken:this.accessToken}),this.offline.enabled=!1)}}function cLi(t){const e=[{methodName:"selectObjects",property:"selected",value:!0,eventName:"objects-selected",exlusiveIndex:1},{methodName:"deselectObjects",property:"selected",value:!1,eventName:"objects-deselected"},{methodName:"highlightObjects",property:"highlighted",value:!0,eventName:"objects-highlighted"},{methodName:"unhighlightObjects",property:"highlighted",value:!1,eventName:"objects-unhighlighted"},{methodName:"showObjects",property:"visible",value:!0,eventName:"objects-shown"},{methodName:"hideObjects",property:"visible",value:!1,eventName:"objects-hidden"},{methodName:"xrayObjects",property:"xrayed",value:!0,eventName:"objects-xrayed"},{methodName:"unxrayObjects",property:"xrayed",value:!1,eventName:"objects-unxrayed"},{methodName:"setObjectsPickable",property:"pickable",value:!0,eventName:"objects-pickable"},{methodName:"setObjectsUnpickable",property:"pickable",value:!1,eventName:"objects-unpickable"}],i=e.reduce((o,n)=>(o[n.methodName]=function(s,a){r(this,n,a);const{property:l,value:c}=n,d=[];for(const u of s){const h=t.get(u);try{h[l]=c,d.push(h)}catch{console.warn(`object with id ${u} does not exist`)}}this.hub.emit(n.eventName,{objects:d,options:{...a}})},o[`${n.methodName}ByUuids`]=function(s,a){r(this,n,a);const{property:l,value:c}=n,d=s.map(u=>this.uuidsMap.get(u)).filter(u=>u?.length>0).flatMap(u=>u.map(h=>(h[l]=c,h)));this.hub.emit(n.eventName,{objects:d,options:{...a}})},o),{}),r=(o,n,s)=>{if(n.exlusiveIndex!==void 0&&s!=null&&s.exclusive){const a=e[n.exlusiveIndex],{property:l,value:c}=n;o[a.methodName](o.objects.filter(d=>d[l]===c).map(d=>d.id),{options:{...s}})}};return{...i,colorizeObjects(o,n,s){const a=[];for(const l of o)try{const c=t.get(l);c.color=n,a.push(c)}catch{console.warn(`object with id ${l} does not exist`)}this.hub.emit("objects-colorized",{objects:a,color:n,options:{...s}})},colorizeObjectsByUuids(o,n,s){const a=o.flatMap(l=>this.uuidsMap.get(l));this.colorizeObjects(a.map(l=>l.id),n,s)},get objects(){return Array.from(t.values())},get objectsIds(){return this.objects.map(o=>o.id)},get objectsUuids(){return Array.from(new Set(this.objects.map(o=>o.uuid)))},get objectsMap(){return t}}}const dLi=Object.freeze({EXA:10**18,PETA:10**15,TERA:10**12,GIGA:10**9,MEGA:10**6,KILO:10**3,HECTO:10**2,DECA:10,DECI:10**-1,CENTI:10**-2,MILLI:10**-3,MICRO:10**-6,NANO:10**-9,PICO:10**-12,FEMTO:10**-15,ATTO:10**-18});async function uLi(t,e,i){async function r(d,u){try{const h=(await t.apiClient.modelApi.getElement(t.cloudId,i,t.projectId,d)).attributes.properties.find(p=>p.definition.name===u);if(h){const p=h.definition.unit;if(p){const{name:g,prefix:f}=p;g!=="METRE"&&console.warn(`[Viewer] Elevation unit other that "METRE" are not supported. Unit "${g}" fallback to "METRE".`);const A=dLi[f];return A===void 0&&console.warn(`[Viewer] Elevation unit prefix "${f}" is unknown and will be ignored.`),(h.value??0)*(A??1)}else return h.value??0}}catch(h){console.warn(`[Models] Cannot get elevation of object with uuid ${d}: ${h}`)}return 0}const o=new Map,n=new Map,s=new Map;function a(){const d=new Set(e.map(u=>{var h,p;return(p=(h=u.object)==null?void 0:h.site)==null?void 0:p.uuid}).filter(Boolean));return e3(d,10,(u,h)=>{r(u,"RefElevation").then(p=>{o.set(u,p),h()},h)})}function l(){const d=new Set(e.map(u=>{var h,p;return(p=(h=u.object)==null?void 0:h.building)==null?void 0:p.uuid}).filter(Boolean));return e3(d,10,(u,h)=>{r(u,"ElevationOfRefHeight").then(p=>{n.set(u,p),h()},h)})}function c(){return e3(e,10,(d,u)=>{r(d.uuid,"Elevation").then(h=>{s.set(d.uuid,h),u()},u)})}await Promise.all([a(),l(),c()]),e.forEach((d,u)=>{var h,p,g,f;const A=s.get(d.uuid)??u;d.elevation=A;const m=n.get((p=(h=d.object)==null?void 0:h.building)==null?void 0:p.uuid);if(m==null){const v=o.get((f=(g=d.object)==null?void 0:g.site)==null?void 0:f.uuid)??0;d.absoluteElevation=A+v}else d.absoluteElevation=A+m}),e.forEach((d,u)=>{var h,p;d.topElevation=((h=e[u+1])==null?void 0:h.elevation)??1/0,d.absoluteTopElevation=((p=e[u+1])==null?void 0:p.absoluteElevation)??1/0})}async function hLi(t,e,i){e.every(r=>r.bimdata_elevation!==null&&r.bimdata_elevation!==void 0)?(e.forEach(r=>{r.elevation=r.bimdata_elevation,r.absoluteElevation=r.bimdata_elevation}),e.forEach((r,o)=>{var n,s;r.topElevation=((n=e[o+1])==null?void 0:n.elevation)??1/0,r.absoluteTopElevation=((s=e[o+1])==null?void 0:s.absoluteElevation)??1/0})):await uLi(t,e,i)}class Yie{constructor(e){const{archived:i,binary_2d_file:r,children:o,created_at:n,creator:s,document:a,document_id:l,errors:c,gltf_file:d,id:u,layout_name:h,map_file:p,name:g,north_vector:f,page_number:A,parent_id:m,preview_file:v,project_id:y,recommanded_2d_angle:b,size_ratio:w,source:C,status:M,structure_file:P,systems_file:E,transform:S,type:I,updated_at:R,version:L,viewer_360_file:j,warnings:H,world_position:U,xkt_file:z,xkt_files:Z}=e;this.id=u,this.name=g,this.type=I,this.archived=i,this.binary_2d_file=r,this.children=o?.map(Y=>new Yie(Y))??[],this.created_at=n,this.creator=s,this.document=a,this.document_id=l,this.errors=c,this.gltf_file=d,this.map_file=p,this.north_vector=f,this.page_number=A,this.parent_id=m,this.preview_file=v,this.project_id=y,this.recommanded_2d_angle=b,this.size_ratio=w,this.source=C,this.status=M,this.structure_file=P,this.systems_file=E,this.transform=S,this.updated_at=R,this.version=L,this.viewer_360_file=j,this.warnings=H,this.world_position=U,this.xkt_file=z,this.xkt_files=Z,this.layout_name=h}}class MY{constructor(e,i,r,o){this.model=i,this.storey=r,this.index=o,this.key=`${r.key}-${e.plan.id}-${o}`,this.translation_x=e.translation_x??0,this.translation_y=e.translation_y??0,this.rotate_z=e.rotate_z??0,this.scale=e.scale??1,this.opacity=e.opacity??1,this.plan=e.plan,this.plan.transform={translate:[this.translation_x,this.translation_y],rotate:this.rotate_z,scale:this.scale,opacity:this.opacity}}}class pLi{constructor(e,i){this.model=i;const{name:r,uuid:o,plans:n,plans_unreachable_count:s,bimdata_elevation:a}=e;this.name=r,this.uuid=o,this.bimdata_elevation=a,this.key=`${i.id}-${this.uuid}`,this.plans_unreachable_count=s,this.plans=n.map((l,c)=>new MY(l,i,this,c)),this.object=i.uuids.get(this.uuid),this.objects=null,this.elevation=null,this.absoluteElevation=null,this.topElevation=null,this.absoluteTopElevation=null}get uuids(){return new Map([...this.objects.values()].map(e=>[e.uuid,e]))}}class $ie extends jz{constructor(e,i){super(e,i,"zone");const{id:r,uuid:o,name:n,created_at:s,updated_at:a,parent_id:l,order:c,zones:d=[],spaces:u=[],color:h,storey_uuid:p}=e;this.id=r,this.uuid=o,this.name=n,this.created_at=s,this.updated_at=a,this.parent_id=l,this.order=c,this.zones=d.map(g=>new $ie(g,i)),this.spaces=u,this.color=h,this.storey_uuid=p}getContainedSpaces(){const e=Array.from(this.spaces);for(const i of this.zones)e.push(...i.getContainedSpaces());return e}get area(){return this.getContainedSpaces().filter(e=>e.geometry).reduce((e,i)=>e+fLi(i.geometry),0)}get perimeter(){return this.getContainedSpaces().filter(e=>e.geometry).reduce((e,i)=>e+gLi(i.geometry),0)}}function fLi(t){let e=0;const i=t.length;for(let r=0;r<i;r++){const o=(r+1)%i;e+=t[r].x*t[o].y,e-=t[o].x*t[r].y}return Math.abs(e)/2}function gLi(t){let e=0;const i=t.length;for(let r=0;r<i;r++){const o=(r+1)%i;e+=Math.sqrt(Math.pow(t[o].x-t[r].x,2)+Math.pow(t[o].y-t[r].y,2))}return e}class mLi extends Yie{constructor(e,i,{structure:r,zones:o,systems:n,storeys:s}={}){var a,l;if(super(i),this._stateObjectMap=e,this.uuids=new Map,r){const u=B1e(r,this,e),h=mDt(u);this.structure=u,this.objects=h,h.forEach(p=>{p.uuid&&this.uuids.set(p.uuid,p)})}else this.structure=null,this.objects=[];this.zones=[],this.setZones(o??[]),n?.forEach(u=>{const h=new jz(u,this,"system");this.uuids.set(h.uuid,h),e.set(h.id,h),this.objects.unshift(h)}),this.storeys=s?.map(u=>new pLi(u,this)).sort(pp("order",!1))??[];const c=new Map(this.storeys.map(u=>[u.uuid,new Set])),d=this.type==="DWG"?"layout":"storey";for(const u of this.objects)u.type!==d&&c.has((a=u[d])==null?void 0:a.uuid)&&c.get((l=u[d])==null?void 0:l.uuid).add(u);for(const u of this.storeys){const h=c.get(u.uuid);u.objects=h?[...h.values()]:[]}this.objects.forEach(u=>{var h,p;u.parent=this.uuids.get((h=u.parent)==null?void 0:h.uuid),u.children=(p=u.children)==null?void 0:p.map(g=>this.uuids.get(g.uuid)).filter(Boolean)})}setZones(e=[]){this.zones.forEach(i=>{this._stateObjectMap.delete(i.id),this.uuids.delete(i.uuid),this.objects.splice(this.objects.indexOf(i),1)}),this.zones=e.map(i=>{const r=new $ie(i,this);return this._stateObjectMap.set(r.id,r),this.uuids.set(r.uuid,r),this.objects.unshift(r),r})}}const ALi=(t,e,i)=>{const{api:r}=i;async function o(n,s={}){if(typeof n=="string"&&(console.warn(`[State] 'loadModel' called with id ${n} as string and parsed as integer.`),n=parseInt(n)),t.get(n))return console.warn(`[State] 'loadModel' called with id ${n}}, model already loaded.`),t.get(n);const a=[r.apiClient.modelApi.getZones(r.cloudId,n,r.projectId)];let l;s.pdfPageModel?l=s.pdfPageModel:(l=await r.getModel(n),a.push(r.apiClient.modelApi.getSystems(r.cloudId,n,r.projectId)),a.push(r.getStoreys(n)),l.parent_id&&!t.get(l.parent_id)&&await o(l.parent_id),l.structure_file&&a.push(r.getModelStructure(l)));const[c,d=[],u=[],h]=await Promise.all(a),p=new mLi(e,l,{structure:h,zones:c,systems:d,storeys:u});return await hLi(r,p.storeys,p.id),t.set(n,p),p}return{get models(){return Array.from(t.values())},get ifcs(){return console.warn("[BIMData Viewer] DEPRECATED - State model - please use the models instead of ifcs."),Array.from(t.values()).filter(n=>!n.type||n.type==="IFC")},get modelsMap(){return t},get ifcsMap(){return console.warn("[BIMData Viewer] DEPRECATED - State model - please use the modelsMap instead of ifcsMap."),new Map([...t].filter(([,n])=>!n.type||n.type==="IFC"))},async loadModels(n,s){const a=await Promise.all(n.map(l=>o(l,s)));if(a.length>0){const l=a.filter(c=>!c.type||c.type==="IFC");l.length&&this.hub.emit("ifcs-loaded",{ifcs:l}),this.hub.emit("models-loaded",{models:a}),i.globalContext.hub.emit("models-loaded",{models:a}),this.hub.emit("objects-added",{objects:a.flatMap(c=>c.objects)})}return a},loadIfcs(n){return console.warn("[BIMData Viewer] DEPRECATED - State model - please use the loadModels method instead of loadIfcs."),this.loadModels(n)},unloadModels(n){const s=[],a=[];if(n.forEach(l=>{const c=t.get(l);c?(t.delete(l),c.objects.map(d=>(a.push(d),d.id)).forEach(d=>e.delete(d)),s.push(c)):console.warn(`[State] Cannot unload model with id ${l} because it is not loaded.`)}),a.length>0&&this.hub.emit("objects-removed",{objects:a}),s.length>0){const l=s.filter(c=>!c.type||c.type==="IFC");l.length&&this.hub.emit("ifcs-unloaded",{ifcs:l}),this.hub.emit("models-unloaded",{models:s})}return s},unloadIfcs(n){return console.warn("[BIMData Viewer] DEPRECATED - State model - please use the unloadModels method instead of unloadIfcs."),this.unloadModels(n)},getStoreyFromAbsoluteElevation(n,s){var a;if(!n.storeys)return null;for(let l=0;l<n.storeys.length;l++)if(s>=n.storeys[l].absoluteElevation&&s<(((a=n.storeys[l+1])==null?void 0:a.absoluteElevation)??1/0))return n.storeys[l];return n.storeys[0]}}};function vLi(t){return{async createPlan(e,i,r,o){const n=await t.api.createStoreyPlan(e.id,i.uuid,r.id);await t.api.updatePlanPositioning(e.id,i.uuid,n.id,o);const s=new MY({...o,plan:n},e,i,e.storeys.length);return i.plans.push(s),this.hub.emit("plan-created",{plan:s}),s},async updatePlan(e,i=null){const r=await t.api.updatePlanPositioning(e.model.id,e.storey.uuid,e.plan.id,e);return Object.assign(e,new MY({...r,plan:e.plan},e.model,e.storey,e.index)),this.hub.emit("plan-updated",{plan:e,prevPlan:i}),e},async deletePlan(e){await t.api.deleteStoreyPlan(e.model.id,e.storey.uuid,e.plan.id),e.storey.plans=e.storey.plans.filter(i=>i.key!==e.key),this.hub.emit("plan-deleted",{plan:e})}}}const bLi=(t,e)=>{const i={getObjectsByUuids(r){return r.flatMap(o=>this.uuidsMap.get(o))},getObject(r){return console.warn("[BIMData Viewer] DEPRECATED - State - `getObject` is deprecated, use `objectsMap.get` instead."),e.get(r)},getIfc(r){return console.warn("[BIMData Viewer] DEPRECATED - State - `getIfc` is deprecated, use `modelsMap.get` instead."),t.get(r)},get colorizedObjects(){return Array.from(e.values()).filter(r=>!!r.color)},get colorizedObjectsIds(){return this.colorizedObjects.map(r=>r.id)},get colorizedObjectsUuids(){return Array.from(new Set(this.colorizedObjects.map(r=>r.uuid)))},getObjectsOfType(r){return Array.from(e.values()).filter(o=>o.type===r)},getTypesOf(r){typeof r.map>"u"&&(r=[...r]);const o=new Set;return r.forEach(n=>{const s=e.get(n);s&&s.type&&o.add(s.type)}),Array.from(o).sort()},getObjectsWithTheSameTypeAs(r){const o=this.getTypesOf(r);return[...e.values()].filter(n=>o.includes(n.type))}};return yLi.forEach(r=>{Object.defineProperty(i,r.name,{get(){return Array.from(e.values()).filter(o=>o[r.property]===r.value).map(o=>Object.freeze(Object.defineProperties({},Object.getOwnPropertyDescriptors(o))))}}),Object.defineProperty(i,`${r.name}Ids`,{get(){return this[r.name].map(wLi)}}),Object.defineProperty(i,`${r.name}Uuids`,{get(){return Array.from(new Set(this[r.name].map(CLi)))}})}),i},yLi=[{name:"selectedObjects",property:"selected",value:!0},{name:"deselectedObjects",property:"selected",value:!1},{name:"highlightedObjects",property:"highlighted",value:!0},{name:"unhighlightedObjects",property:"highlighted",value:!1},{name:"visibleObjects",property:"visible",value:!0},{name:"unvisibleObjects",property:"visible",value:!1},{name:"xrayedObjects",property:"xrayed",value:!0},{name:"unxrayedObjects",property:"xrayed",value:!1},{name:"pickableObjects",property:"pickable",value:!0},{name:"unpickableObjects",property:"pickable",value:!1}];function wLi(t){return t.id}function CLi(t){return t.uuid}function PY(t,e,i){var r;return(r=t.mixins)!=null&&r.some(o=>o[i])||(t.mixins?t.mixins[t.mixins.length]=e:t.mixins=[e]),t}const oEe=Symbol("annotation-mixin-id");function xLi(){let t=0;const e=new Map;return{get annotations(){return Array.from(e.values())},addAnnotation({x:i=0,y:r=0,z:o=0,draggable:n=!0,grabberSelector:s,component:a={render(){}},props:l={}}={},c){const d=this,u=t++,h={get id(){return u},get x(){return i},set x(p){i=p,d.hub.emit("annotation-updated",{annotation:h})},get y(){return r},set y(p){r=p,d.hub.emit("annotation-updated",{annotation:h})},get z(){return o},set z(p){o=p,d.hub.emit("annotation-updated",{annotation:h})},draggable:n,grabberSelector:s,component:a,props:l};return PY(h.component,{[oEe]:!0,inject:["$viewer"]},oEe),e.set(u,h),this.hub.emit("annotation-added",{annotation:h,options:c}),h},removeAnnotation(i,r){return e.has(i.id)?(e.delete(i.id),this.hub.emit("annotation-removed",{annotation:i,options:r}),!0):!1},clearAnnotations(){e.forEach(i=>this.removeAnnotation(i))}}}function kLi(t){const e=new Map,i=new Map,r={uuidsMap:{get(o){const n=[];return e.forEach(s=>{const a=s.uuids.get(o);a&&n.push(a)}),n}},hub:new df};return[ALi(e,i,t),cLi(i),vLi(t),xLi(),bLi(e,i)].forEach(o=>Object.defineProperties(r,Object.getOwnPropertyDescriptors(o))),r}function MLi(t){if(t?.type==="container")BLi(t);else if(t?.type==="zone")SLi(t);else throw new TypeError("AREAS CORE - Layout first child must be a zone or a container.");return PLi(t),t}function PLi(t){let e=new Set,i=new Set;for(let r of t)if(r.id!=null)if(r.type==="zone"){if(e.has(r.id))throw new Error("AREAS CORE - Cannot add the same zone id twice.");e.add(r.id)}else{if(i.has(r.id))throw new Error("AREAS CORE - Cannot add the same container id twice.");i.add(r.id)}}function ELi(t){nEe(t.layout,"zone",t.zoneIdManager),nEe(t.layout,"container",t.containerIdManager)}function nEe(t,e,i){let r=[...t].filter(o=>o.type===e);r.map(o=>o.id).filter(o=>o!=null).forEach(o=>i.add(o)),r.filter(o=>o.id===void 0||o.id===null).forEach(o=>{o.id=i.nextId()})}function SLi(t){if(typeof t!="object")throw new TypeError("AREAS CORE - Invalid zone. Zone must be an object.");if(t?.type!=="zone")throw new TypeError('AREAS CORE - Invalid zone. A zone must be of type "zone".');return t}function BLi(t){var e,i;if(typeof t!="object")throw new TypeError("AREAS CORE - Invalid container. A container must be an object.");if(t?.type!=="container")throw new TypeError('AREAS CORE - Invalid container. Container must be of type "container".');if(t!=null&&t.direction&&!["row","column"].includes(t.direction))throw new TypeError('AREAS CORE - Invalid container. Container direction must be of type "row" or "column".');if(((e=t?.children)==null?void 0:e.length)<2)throw new TypeError("AREAS CORE - Invalid container. Container children must have at least 2 children.");if(((i=t?.children)==null?void 0:i.reduce((r,o)=>r+o?.ratio,0))!==100)throw new TypeError("AREAS CORE - Invalid container. The sum of container children ratios must be equal to 100.");return t}function sEe(t){var e;return(e=t.children)!=null&&e.length&&t.children.forEach(i=>{Object.defineProperty(i,Symbol.iterator,{value:sEe(i),configurable:!0})}),function*(){var i;if(yield t,(i=t.children)==null?void 0:i.length)for(let r of t.children)yield*r}}function s7(t){return Object.defineProperty(t,Symbol.iterator,{value:sEe(t),configurable:!0}),t}function aEe(){let t=1,e=new Set;return{nextId(){for(;!this.isIdAvailable(t);)t++;return e.add(t),t},isIdAvailable(i){return!e.has(i)},add(i){return this.isIdAvailable(i)?(e.add(i),i):!1}}}function lEe(t){var e;if(!t)return;let i=Object.assign({},t);return((e=t.children)==null?void 0:e.length)>0&&(i.children=t.children.map(lEe)),i}function ILi(t){return e=>{let i=t.getZone(e);if(!i)return!1;let r=t.getParent(i);if(!r)throw new Error("AREAS CORE - Cannot delete root Zone");let o=r.children.indexOf(i);if(r.children.length>2){let n=r.children[o-1],s=r.children[o+1];o===0?s.ratio+=i.ratio:o===r.children.length-1?n.ratio+=i.ratio:(n.ratio+=Math.floor(i.ratio/2),s.ratio+=Math.ceil(i.ratio/2)),r.children=r.children.filter(a=>a.type!=="zone"||a.id!==e)}else{let n=r.children[o===1?0:1];n.ratio=r.ratio;let s=t.getParent(r);if(s){let a=s.children.indexOf(r);s.children.splice(a,1,n)}else t.layout=n}return!0}}var TLi=ILi;function RLi(t){return()=>cEe(t.layout,[t.layout])}function cEe(t,e=[]){var i;return(i=t.children)==null||i.forEach(r=>{e.push(r),r.type==="container"&&cEe(r,e)}),e}var DLi=RLi;function LLi(t){return e=>{if(!e)throw new TypeError("AREAS CORE - fail to get parent: container child is null or undefined");return t.layout.type==="zone"?null:dEe(t.layout,e)}}function dEe(t,e){for(let i of t.children){if(i===e)return t;if(i.type==="container"){let r=dEe(i,e);if(r)return r}}return null}var _Li=LLi;function FLi(t){return e=>t.layout.type==="zone"?t.layout.id===e?t.layout:null:uEe(t.layout,e)}function uEe(t,e){for(let i of t.children)if(i.type==="zone"){if(i.id===e)return i}else{let r=uEe(i,e);if(r)return r}return null}var OLi=FLi;function ULi(t){return(e,i)=>{if(typeof i!="number")throw new TypeError("AREAS CORE - resize value must be a number.");let r=t.getParent(e),o=r.children.findIndex(s=>s===e);if(o===-1)return!1;let n=r.children[o+1];if(n){let s=e.ratio+n.ratio,a=e.ratio+i;return a=a<0?0:a,a=a>s?s:a,e.ratio=a,n.ratio=s-a,!0}else return!1}}var NLi=ULi;function jLi(t){return(e,i=50,r="row",o=!0,n=null)=>{let s=t.getZone(e);if(!s)throw new Error(`AREAS CORE - fail to split zone ${e}: zone does not exist.`);if(typeof i!="number"||i<0||i>100)throw new TypeError(`AREAS CORE - fail to split zone: invalid ratio ${i}, ratio should be a number between 0 and 100.`);if(r!=="row"&&r!=="column")throw new TypeError(`AREAS CORE - fail to split zone: invalid direction ${r}, direction should be 'row' or 'column'.`);let a=t.getParent(s),l=s7({id:t.zoneIdManager.nextId(),type:"zone",...n});if(a){let c=a.children.findIndex(d=>d===s);if(a.direction===r)o?(l.ratio=Math.floor(s.ratio*(100-i)/100),s.ratio=Math.ceil(s.ratio*i/100),a.children.splice(c,1,s,l)):(l.ratio=Math.floor(s.ratio*i/100),s.ratio=Math.ceil(s.ratio*(100-i)/100),a.children.splice(c,1,l,s));else{let d=s7({id:t.containerIdManager.nextId(),type:"container",direction:r,ratio:s.ratio});o?(l.ratio=Math.floor(100-i),s.ratio=Math.ceil(i),d.children=[s,l]):(l.ratio=Math.floor(i),s.ratio=Math.ceil(100-i),d.children=[l,s]),a.children.splice(c,1,d)}}else{let c=s7({id:t.containerIdManager.nextId(),type:"container",direction:r});o?(l.ratio=Math.floor(100-i),s.ratio=Math.ceil(i),c.children=[s,l]):(l.ratio=Math.floor(i),s.ratio=Math.ceil(100-i),c.children=[l,s]),t._layout=c}return l}}var HLi=jLi;function VLi(t){return(e=50,i="row",r=!0,o=null)=>{let n=t.layout;if(typeof e!="number"||e<0||e>100)throw new TypeError(`AREAS CORE - fail to split layout: invalid ratio ${e}, ratio should be a number between 0 and 100.`);if(i!=="row"&&i!=="column")throw new TypeError(`AREAS CORE - fail to split layout: invalid direction ${i}, direction should be 'row' or 'column'.`);let s=s7({id:t.zoneIdManager.nextId(),type:"zone",...o}),a=s7({id:t.containerIdManager.nextId(),type:"container",direction:i});return r?(s.ratio=Math.floor(100-e),n.ratio=Math.ceil(e),a.children=[n,s]):(s.ratio=Math.floor(e),n.ratio=Math.ceil(100-e),a.children=[s,n]),t._layout=a,s}}var zLi=VLi;function qLi(t){return(e,i)=>{let r=t.getZone(e),o=t.getZone(i);if(!r)throw new Error(`AREAS CORE - fail to swap zone ${e}: zone does not exist.`);if(!o)throw new Error(`AREAS CORE - fail to swap to zone ${i}: zone does not exist.`);let n=t.getParent(r),s=t.getParent(o),a=n.children.indexOf(r),l=s.children.indexOf(o),c=r.ratio,d=o.ratio;r.ratio=d,o.ratio=c,n.children[a]=o,s.children[l]=r}}var GLi=qLi;function QLi(t){let e={_layout:null,get layout(){return this._layout},set layout(i){i||(i={type:"zone"}),s7(i),MLi(i),this._layout=i,ELi(e)},zoneIdManager:aEe(),containerIdManager:aEe()};return e.layout=t,e.deleteZone=TLi(e),e.getNodes=DLi(e),e.getParent=_Li(e),e.getZone=OLi(e),e.resize=NLi(e),e.splitZone=HLi(e),e.splitLayout=zLi(e),e.swapZones=GLi(e),e}var KLi=QLi;function hEe(t=1,e=0,i=100){return Math.min(Math.max(e,t),i)}function pEe(t,e){let i=t.getParent(e);if(i){let{width:r,height:o}=pEe(t,i),n=i.children.length-1;return i.direction==="column"?{width:r,height:Math.max(0,(o-n*t.separatorSize)*(e.ratio/100))}:{width:Math.max(0,(r-n*t.separatorSize)*(e.ratio/100)),height:o}}else return{width:t.width,height:t.height}}function fEe(t,e,i){let{width:r,height:o}=pEe(t,e),n=e.children.length-1;if(e.direction==="column"){let s=1-n*t.separatorSize/o;return{height:`${hEe(i.ratio*s,0,100)}%`,width:"100%"}}else{let s=1-n*t.separatorSize/r;return{height:"100%",width:`${hEe(i.ratio*s,0,100)}%`}}}function WLi(t,e){let i={ref:t.contentManager.getRef(e.id),id:`zone-${e.id}`,class:"areas-zone",style:{flexGrow:0,overflow:"hidden"},key:e.id},r=t.getParent(e);if(r){let{width:o,height:n}=fEe(t,r,e);i.style={width:o,height:n}}else i.style={height:"100%"};return t.vue.h("div",i)}var EY=WLi;function ZLi(t,e,i){let{separatorSize:r,separatorDetectionMargin:o,separatorDetectionZIndex:n}=t,s=e.direction==="column",a={ref:`separator-${e.id}-${i+1}`,class:"areas-separator",style:{[s?"height":"width"]:`${r}px`,backgroundColor:"var(--areas-separator-color, black)",flexShrink:0,position:"relative"}},l=s?"ns-resize":"ew-resize",c=t.vue.h("div",{style:{position:"absolute",[s?"height":"width"]:`${o*2}px`,[s?"width":"height"]:"100%",[s?"top":"left"]:`${-o+r/2}px`,zIndex:n,cursor:l},onPointerdown:d=>JLi(t,e,i,d)});return t.vue.h("div",a,t.resizable?[c]:null)}function JLi(t,e,i,r){r.preventDefault(),r.stopPropagation();let o=r.currentTarget;o.setPointerCapture(r.pointerId);let n=a=>XLi(t,e,i,a),s=()=>{o.removeEventListener("pointermove",n)};o.addEventListener("pointermove",n),o.addEventListener("pointerup",s,{once:!0})}function XLi(t,e,i,r){let o=e.children[i],n=e.direction==="column"?"height":"width",{separatorDetectionMargin:s}=t,a=(e.direction==="column"?r.offsetY:r.offsetX)-s,l=t.root.$refs[`container-${e.id}`].getBoundingClientRect()[n],c=a/l*100;t.resize(o,c)}var YLi=ZLi;function SY(t,e){let i={ref:`container-${e.id}`,id:`container-${e.id}`,class:"areas-container",style:{height:"100%",display:"flex",flexDirection:e.direction}},r=t.getParent(e);if(r){let{width:s,height:a}=fEe(t,r,e);i.style.width=s,i.style.height=a}let o=e.children.length-1,n=e.children.map((s,a)=>a<=o-1?[s.type==="zone"?EY(t,s):SY(t,s),YLi(t,e,a)]:s.type==="zone"?EY(t,s):SY(t,s));return t.vue.h("div",i,[n])}var $Li=SY;function e_i(t){let e=new Map,i=new Map,r=new Map;e.set("default",{component:{render(){return t.vue.h("div","Default component")}}});function o(n){return n&&!e.has(n)&&(console.warn(`[AREAS] Content with name ${n} is not registered, fallback to 'default'.`),n="default"),e.get(n)}return{registerContent(n,s){e.set(n,{name:n,component:s})},renderContent(n){return[...n].filter(s=>s.type==="zone").forEach(s=>{i.set(s.id,Object.assign({},o(s.content??"default"),{ref:t.vue.ref(null),options:{zoneId:s.id,...s.options,key:s.id},name:s.content??"default"}))}),t.vue.h("div",{style:{display:"none"}},[...i.values()].map(s=>t.vue.h(s.component,{...s.options,ref:s.ref})))},link(){[...r.entries()].forEach(([n,s])=>{let a=i.get(n);if(!a)return;let l=a.ref.value.$el,c=s.value;for(;c.lastChild;)c.removeChild(c.lastChild);c.appendChild(l)})},getElementZoneId(n){var s;for(let[a,l]of[...r.entries()])if((s=l.value)!=null&&s.contains(n))return a;return null},getRef(n){let s=r.get(n);return s||(s=t.vue.ref(null),r.set(n,s)),s},deleteZoneContent(n){i.delete(n),r.delete(n)},clean(){i.clear(),r.clear()}}}var t_i=e_i;function i_i(t,e,i){let r=e.ref(0),o=e.ref(0),{separatorSize:n=2,separatorDetectionMargin:s=10,separatorDetectionZIndex:a=2,resizable:l=!0}=i??{},c=e.ref(!!l),d={vue:e,core:t,zones:e.ref([]),get resizable(){return c.value},set resizable(h){c.value=h},get width(){return r.value},get height(){return o.value},get separatorSize(){return n},get separatorDetectionMargin(){return s},get separatorDetectionZIndex(){return a},getParent(h){return this.core.getParent(h)},async coreLayoutSync(h=!1){!this.layout||(h?this.layout.value=this.core.layout:e.triggerRef(this.layout),await e.nextTick(),this.contentManager.link())},resize(h,p){this.core.resize(h,p),e.triggerRef(this.layout)},async split(h,p,g,f,A){let m=this.core.splitZone(h,p,g,f,A);return await this.coreLayoutSync(this.zones.value.length===1),m},async splitLayout(h,p,g,f){let A=this.core.splitLayout(h,p,g,f);return await this.coreLayoutSync(!0),A},async delete(h){let p=!1,g=this.core.getZone(h);if(g){let A=this.core.getParent(g);p=A?.children.length===2&&this.core.getParent(A)===null}this.contentManager.deleteZoneContent(h);let f=this.core.deleteZone(h);return await this.coreLayoutSync(p),f},async swap(h,p){let g=this.core.swapZones(h,p);return await this.coreLayoutSync(),g},destroy(){var h;(h=this.resizeObserver)==null||h.disconnect()},root:null,get component(){return this.layout=e.shallowRef(t.layout),e.watch(this.layout,h=>{this.zones.value=[...h].filter(p=>p.type==="zone")},{immediate:!0}),{created(){d.root=this},mounted(){let{width:h,height:p}=this.$el.getBoundingClientRect();r.value=h,o.value=p,d.resizeObserver=new ResizeObserver(g=>g.forEach(f=>{let{width:A,height:m}=f.target.getBoundingClientRect();r.value=A,o.value=m})),d.resizeObserver.observe(this.$el),d.contentManager.link()},render(){return e.h("div",{class:"areas-root"},[d.contentManager.renderContent(d.layout.value),u(d.layout.value)])}}}};d.contentManager=t_i(d);function u(h){return h.type==="zone"?EY(d,h):$Li(d,h)}return d}var r_i=i_i;function o_i(t,e=null,i=null){let r=KLi(e),o=r_i(r,t,i);return Object.freeze({core:r,renderer:o,destroy(){o.destroy()},swap(n,s){return this.renderer.swap(n,s)},split(n,s,a,l,c){return this.renderer.split(n,s,a,l,c)},splitLayout(n,s,a,l){return this.renderer.splitLayout(n,s,a,l)},delete(n){return this.renderer.delete(n)},registerContent(n,s){this.renderer.contentManager.registerContent(n,s)},getElementZoneId(n){return this.renderer.contentManager.getElementZoneId(n)},get layout(){return lEe(this.core.layout)},set layout(n){this.core.layout=n,this.renderer.contentManager.clean(),this.renderer.coreLayoutSync(!0)},get component(){return this.renderer.component},get resizable(){return this.renderer.resizable},set resizable(n){this.renderer.resizable=n}})}var n_i=o_i;function s_i(t){return Array.isArray(t?.children)?mEe(t):gEe(t)}function gEe(t,e=100){return{type:"zone",ratio:e,options:typeof t=="string"?{windowName:t}:t}}function mEe(t,e=100){return{type:"container",ratio:e,direction:t.direction,children:t.children.map((i,r)=>Array.isArray(i?.children)?mEe(i,t.ratios[r]):gEe(i,t.ratios[r]))}}function a_i(t,e,i=!0){return t.type==="zone"?AEe(t,e,i):vEe(t,e,i)}function AEe(t,e,i=!0){var r,o;const n=e.get(t.id);if(!n)throw new Error(`[Layout parser] Local context with id ${t.id} not found`);return{windowName:((r=n.window)==null?void 0:r.name)??null,windowState:{modelIds:n.loadedModelIds,viewpoint:(i||void 0)&&n.viewer&&n.getViewpoint(),storey:(o=n.selectedStorey)==null?void 0:o.key}}}function vEe(t,e,i=!0){return{direction:t.direction,ratios:t.children.map(r=>r.ratio),children:t.children.map(r=>r.type==="zone"?AEe(r,e,i):vEe(r,e,i))}}const l_i={props:{text:{type:String,default:""}},emits:["close"]},c_i={class:"success-modal"},d_i={class:"success-modal__close"},u_i={class:"success-modal__title"},h_i={class:"success-modal__title--icon"},p_i={class:"success-modal__text"},f_i={class:"success-modal__button"};function g_i(t,e,i,r,o,n){const s=D("BIMDataIconClose"),a=D("BIMDataPieSpinner"),l=D("BIMDataIconSuccess"),c=D("BIMDataButton");return T(),O("div",c_i,[k("div",d_i,[_(a,{delay:5,onStop:e[1]||(e[1]=d=>t.$emit("close"))},{default:G(()=>[_(s,{class:"icon-close",size:"xxxs",onClick:e[0]||(e[0]=d=>t.$emit("close"))})]),_:1})]),k("div",u_i,[k("h2",null,$(t.$t("modal.success")),1),k("span",h_i,[_(l,{class:"fill-primary"})])]),k("div",p_i,$(i.text||t.$t("modal.success")),1),k("div",f_i,[_(c,{class:"bimdata-btn__fill bimdata-btn__fill--primary bimdata-btn__radius",onClick:e[2]||(e[2]=d=>t.$emit("close"))},{default:G(()=>[gt($(t.$t("modal.button")),1)]),_:1})])])}const m_i=W(l_i,[["render",g_i],["__scopeId","data-v-79d3a107"]]),bEe=Symbol("modal-mixin-id"),A_i={inject:["$viewer"],data(){return{modals:[]}},computed:{notBlocking(){var t;return((t=this.modal)==null?void 0:t.blocking)===!1},modal(){return this.modals.length?this.modals[0]:null},positionning(){var t;if(!((t=this.modal)!=null&&t.positions))return;const e=this.modal.positions;return{top:e.top?`${e.top}`:"0",right:e.right?`${e.right}`:"0",bottom:e.bottom?`${e.bottom} `:"0",left:e.left?`${e.left}`:"0"}}},created(){document.addEventListener("keydown",e=>{this.notBlocking&&e.key==="Escape"&&this.clearModal()});const t=this;this.mixin={[bEe]:!0,beforeCreate(){!this._.setupState.$viewer&&(this.$plugin=t.$plugin,this.$viewer=t.$viewer)}}},methods:{pushModal(t,e={},{display:i="full",positions:r,blocking:o=!0,exclusive:n=!1}={}){n&&(this.modals=[]),this.inject$viewerRecursively(t),this.modals.push({component:Lc(t),props:e,display:i,positions:r,blocking:o})},clearModal(){this.modals.shift()},clearModals(){this.modals=[]},inject$viewerRecursively(t){PY(t,this.mixin,bEe),t.components&&Object.values(t.components).forEach(e=>this.inject$viewerRecursively(e))},getModal(t){const e={success:m_i};if(Object.keys(e).includes(t))return e[t];console.warn(`Modal name unknown : ${t}`)}}},v_i={class:"bimdata-modal-manager__content"};function b_i(t,e,i,r,o,n){const s=sr("click-away");return n.modal?(T(),O("div",{key:0,class:ke(["bimdata-modal-manager",{full:n.modal.display==="full",banner:n.modal.display==="banner"}]),style:Pe(n.positionning),onClick:e[0]||(e[0]=_t(a=>n.notBlocking?n.clearModal():null,["self"]))},[Ot((T(),O("div",v_i,[(T(),te(No(n.modal.component),dl(n.modal.props,{onClose:n.clearModal}),null,16,["onClose"]))])),[[s,()=>n.notBlocking?n.clearModal():null,"mousedown"]])],6)):ye("",!0)}const yEe=W(A_i,[["render",b_i],["__scopeId","data-v-2c579fcd"]]),y_i={props:{plugin:{type:Object,required:!0}},setup(t){const e=Ut("$viewer"),{plugin:i}=t;Bo("$plugin",i),wEe(i.component,e.localContext,i)}},BY=Symbol("plugin-mixin-id");function wEe(t,e,i,r=!0){var o;if((o=t.mixins)!=null&&o.some(s=>s[BY]))return;const n={[BY]:!0,beforeCreate(){!this._.setupState.$viewer&&(this.$plugin=i,this.$viewer=e.$viewer),Object.defineProperties(this,{$isOpen:{get(){return i.isOpen}},$loading:{get(){return i.loading}},$shown:{get(){return i.shown}}}),r&&(i.componentInstance=this,i.isViewer&&(e.viewer=this))},methods:{$open(...s){i.open(...s)},$close(...s){i.close(...s)},$show(){i.show()},$hide(){i.hide()}}};r&&(n.props={plugin:{type:Object,required:!0}},n.provide={pluginInstance:i},n.created=function(){e.hub.emit("plugin-created",{name:i.name,plugin:this}),e.$viewer.globalContext.hub.emit("plugin-created",{name:i.name,plugin:this})},n.unmounted=function(){e.hub.emit("plugin-destroyed",{name:i.name,plugin:this}),e.$viewer.globalContext.hub.emit("plugin-destroyed",{name:i.name,plugin:this})}),PY(t,n,BY),t.components&&Object.values(t.components).forEach(s=>wEe(s,e,i,!1))}function w_i(t,e,i,r,o,n){return Ot((T(),te(No(i.plugin.component),{class:"plugin-component-instance-container",plugin:i.plugin},null,8,["plugin"])),[[Ai,i.plugin.shown]])}const _x=W(y_i,[["render",w_i]]),C_i={components:{PluginComponentInstanceContainer:_x},props:{plugin:{type:Object,required:!0,validator(t){return t.sidePanel.width?typeof t.sidePanel.width=="number":t.sidePanel}}}};function x_i(t,e,i,r,o,n){const s=D("PluginComponentInstanceContainer");return Ot((T(),O("div",{class:"side-panel",style:Pe(`
|
|
5518
5518
|
--side-panel-width: ${i.plugin.sidePanelWidth}px;
|
|
5519
5519
|
${i.plugin.sidePanel.position==="left"?"border-right":"border-left"}: 1px solid var(--color-silver);
|
|
5520
|
-
`)},[_(s,{plugin:i.plugin,style:{height:"100%"}},null,8,["plugin"])],4)),[[Ai,i.plugin.shown]])}const k_i=W(C_i,[["render",x_i],["__scopeId","data-v-ced3f116"]]),M_i={props:{name:{type:String,default:"box"},content:{type:String,default:""},width:{type:[Number,String],default:20},height:{type:[Number,String],default:20},color:{type:String,default:"currentColor"},x:{type:[Number,String],default:20},y:{type:[Number,String],default:20}},computed:{viewBox(){return`0 0 ${this.x} ${this.y}`}}},P_i=["width","height","viewBox","aria-labelledby","fill"],E_i=["innerHTML"];function S_i(t,e,i,r,o,n){return T(),O("svg",{xmlns:"http://www.w3.org/2000/svg",width:i.width,height:i.height,viewBox:n.viewBox,"aria-labelledby":i.name,fill:i.color,role:"presentation"},[k("g",{innerHTML:i.content},null,8,E_i)],8,P_i)}const B_i=W(M_i,[["render",S_i]]),I_i=["src"],T_i={__name:"PluginIcon",props:{plugin:{type:Object,required:!0},isOpen:{type:Boolean,required:!0}},setup(t){const e=t,i=Ao(null);return Ph(()=>{e.isOpen&&e.plugin.button.iconOpen?i.value=e.plugin.button.iconOpen:e.plugin.button.icon?i.value=e.plugin.button.icon:i.value={component:"BIMDataIcon",options:{name:"default",size:"m"}}}),(r,o)=>i.value.imgUri?(T(),O("img",{key:0,src:i.value.imgUri,style:{"max-width":"40px","max-height":"40px"}},null,8,I_i)):i.value.svgPath?(T(),te(B_i,dl({key:1},i.value.options,{content:i.value.svgPath}),null,16,["content"])):i.value.component?(T(),te(No(i.value.component),bd(dl({key:2},i.value.options)),null,16)):ye("",!0)}},R_i={key:0,class:"tools-menu__info"},D_i={class:"window"},L_i={class:"plugins-as-button__content"},__i={class:"plugins-as-button__panel__header"},F_i={class:"panel__content"},O_i={__name:"PluginAsButton",props:{plugin:{type:Object,required:!0},active:{type:Boolean,required:!0},position:{type:String,required:!0,validator(t){return["right","left"].includes(t)}}},emits:["focus"],setup(t,{emit:e}){const i=e,r=Ut("$viewer"),{localContext:o}=r,n=t,{active:s}=DE(n),a=n.plugin,l=ut(()=>a.isOpen),c=ut(()=>a.buttonText),d=ut(()=>n.active?2:1);function u(){l.value&&i("focus")}function h(){l.value?a.close():a.open()}function p(){_o(()=>{l.value&&!a.button.keepOpen&&!a.loading&&a.close()})}return(g,f)=>{const A=D("BIMDataSpinner"),m=D("BIMDataButton"),v=D("BIMDataTooltip"),y=sr("click-away");return Ot((T(),O("div",{class:"plugins-as-button",style:Pe({zIndex:d.value,position:zt(a).button.content==="simple"?"relative":null})},[k("div",{class:"tools-menu m-b-12",onMouseenter:u},[_(v,{ref:"tooltip",class:ke({open:l.value}),text:zt(a).button.tooltip?g.$t(zt(a).button.tooltip):zt(a).name,position:t.position==="left"?"right":"left",disabled:l.value},{default:G(()=>[_(m,{width:"45px",height:"45px",fill:"",icon:"",color:"default",class:ke({focus:zt(s)}),"data-test":`plugin-${zt(a).name}`,onClick:f[0]||(f[0]=b=>h())},{default:G(()=>[c.value?(T(),O("span",R_i,$(zt(KEt)(c.value,zt(a).button.truncateSize||4)),1)):ye("",!0),zt(a).loading?(T(),te(A,{key:1})):(T(),te(T_i,{key:2,plugin:zt(a),"is-open":l.value},null,8,["plugin","is-open"]))]),_:1},8,["class","data-test"])]),_:1},8,["class","text","position","disabled"])],32),k("div",D_i,[_(dr,{name:`slide-fade-${t.position}`},{default:G(()=>[Ot(k("span",L_i,[zt(a).button.content==="panel"?(T(),O("div",{key:0,class:ke(["plugins-as-button__submenu",`plugins-as-button__submenu--${t.position==="right"?"left":"right"}__panel`])},[k("div",__i,$(zt(a).button.tooltip?g.$t(zt(a).button.tooltip):zt(a).name),1),k("div",F_i,[_(_x,{plugin:zt(a)},null,8,["plugin"])])],2)):(T(),te(_x,{key:1,class:ke(["plugins-as-button__submenu",`plugins-as-button__submenu--${t.position==="right"?"left":"right"}__${zt(a).button.content||"free"}`]),plugin:zt(a)},null,8,["class","plugin"]))],512),[[Ai,l.value]])]),_:1},8,["name"])])],4)),[[y,p]])}}},U_i=W(O_i,[["__scopeId","data-v-72f2ce01"]]),N_i={__name:"SideColumn",props:{plugins:{type:Array,default:()=>[]},position:{type:String,required:!0,validator(t){return["right","left"].includes(t)}}},setup(t){const e=t,i=Ao(null);return(r,o)=>(T(),O("div",{class:ke(["side-column",`side-column--${e.position}`])},[(T(!0),O(Pt,null,Xt(e.plugins,n=>(T(),O(Pt,{key:n.name},[n.button.content==="none"?(T(),te(_x,{key:0,plugin:n,onMouseenter:s=>i.value=n},null,8,["plugin","onMouseenter"])):Ot((T(),te(U_i,{key:1,plugin:n,position:e.position,active:i.value===n,onFocus:s=>i.value=n},null,8,["plugin","position","active","onFocus"])),[[Ai,n.shown]])],64))),128))],2))}},j_i=W(N_i,[["__scopeId","data-v-f11ec0c8"]]),H_i={},V_i={width:"23",height:"22",viewBox:"0 0 23 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function z_i(t,e){return T(),O("svg",V_i,e[0]||(e[0]=[k("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M-1.39472e-07 10.1037L3.19075 13.2944L6.3815 10.1037L4.25434 10.1037L4.25434 5.31755C4.25434 5.17754 4.30509 4.94384 4.42614 4.77572C4.47895 4.70237 4.54133 4.64599 4.62063 4.60508C4.69908 4.56461 4.83161 4.51987 5.05202 4.51987L11.1676 4.51987L11.1676 2.3927L5.05202 2.3927C3.96087 2.3927 3.17625 2.87117 2.69987 3.5328C2.26254 4.14021 2.12717 4.83714 2.12717 5.31755L2.12717 10.1037L-1.39472e-07 10.1037Z",fill:"currentColor"},null,-1),k("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23 11.9657L19.8092 8.7749L16.6185 11.9657L18.7457 11.9657L18.7457 16.7518C18.7457 16.8918 18.6949 17.1255 18.5739 17.2936C18.521 17.367 18.4587 17.4233 18.3794 17.4643C18.3009 17.5047 18.1684 17.5495 17.948 17.5495L11.8324 17.5495L11.8324 19.6766L17.948 19.6766C19.0391 19.6766 19.8238 19.1982 20.3001 18.5365C20.7375 17.9291 20.8728 17.2322 20.8728 16.7518L20.8728 11.9657L23 11.9657Z",fill:"currentColor"},null,-1),k("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0 15.6879C0 14.9536 0.595228 14.3584 1.32948 14.3584H8.24277C8.97703 14.3584 9.57225 14.9536 9.57225 15.6879V19.9422C9.57225 20.6765 8.97703 21.2717 8.24277 21.2717H1.32948C0.595228 21.2717 0 20.6765 0 19.9422V15.6879ZM1.59538 15.9538V19.6763H7.97688V15.9538H1.59538Z",fill:"currentColor"},null,-1),k("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.2948 1.32948C13.2948 0.595229 13.89 0 14.6243 0H21.5376C22.2718 0 22.8671 0.595228 22.8671 1.32948V5.58382C22.8671 6.31807 22.2718 6.91329 21.5376 6.91329H14.6243C13.89 6.91329 13.2948 6.31807 13.2948 5.58382V1.32948ZM14.8902 1.59538V5.31792H21.2717V1.59538H14.8902Z",fill:"currentColor"},null,-1)]))}const q_i=W(H_i,[["render",z_i]]),G_i={props:{color:{type:String,default:"currentColor"},size:{type:Number,default:1}}},Q_i=["width","height"],K_i=["fill"];function W_i(t,e,i,r,o,n){return T(),O("svg",{width:23*i.size,height:28*i.size,viewBox:"0 0 23 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[k("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.81498 1.39408C7.83109 1.39042 7.84845 1.38833 7.86714 1.38833H8.34975C8.73313 1.38833 9.04391 1.07754 9.04391 0.694167C9.04391 0.310789 8.73313 0 8.34975 0H7.86714C7.74418 0 7.62361 0.0138267 7.5072 0.0402917C7.18421 0.113723 6.96548 0.401367 6.96677 0.719361C6.64878 0.718068 6.36114 0.936792 6.28771 1.25978C6.26124 1.37619 6.24741 1.49677 6.24741 1.61972V2.10233C6.24741 2.48571 6.5582 2.7965 6.94158 2.7965C7.32496 2.7965 7.63575 2.48571 7.63575 2.10233V1.61972C7.63575 1.60103 7.63783 1.58368 7.64149 1.56756C7.65339 1.51525 7.65903 1.46297 7.65892 1.4115C7.71038 1.41162 7.76266 1.40597 7.81498 1.39408ZM10.7628 0C10.3794 0 10.0686 0.310789 10.0686 0.694167C10.0686 1.07754 10.3794 1.38833 10.7628 1.38833H11.728C12.1114 1.38833 12.4222 1.07754 12.4222 0.694167C12.4222 0.310789 12.1114 0 11.728 0H10.7628ZM14.1411 0C13.7577 0 13.4469 0.310789 13.4469 0.694167C13.4469 1.07754 13.7577 1.38833 14.1411 1.38833H15.1063C15.4897 1.38833 15.8005 1.07754 15.8005 0.694167C15.8005 0.310789 15.4897 0 15.1063 0H14.1411ZM17.5194 0C17.136 0 16.8252 0.310789 16.8252 0.694167C16.8252 1.07754 17.136 1.38833 17.5194 1.38833H18.4846C18.868 1.38833 19.1788 1.07754 19.1788 0.694167C19.1788 0.310789 18.868 0 18.4846 0H17.5194ZM20.8976 0C20.5143 0 20.2035 0.310789 20.2035 0.694167C20.2035 1.07754 20.5143 1.38833 20.8976 1.38833H21.3803C21.3989 1.38833 21.4163 1.39042 21.4324 1.39408C21.4847 1.40597 21.537 1.41162 21.5885 1.4115C21.5884 1.46297 21.594 1.51525 21.6059 1.56756C21.6096 1.58368 21.6116 1.60103 21.6116 1.61972V2.10233C21.6116 2.48571 21.9224 2.7965 22.3058 2.7965C22.6892 2.7965 23 2.48571 23 2.10233V1.61972C23 1.49677 22.9861 1.37619 22.9597 1.25978C22.8863 0.936791 22.5986 0.718068 22.2806 0.719361C22.2819 0.401367 22.0632 0.113723 21.7402 0.0402916C21.6238 0.0138267 21.5032 0 21.3803 0H20.8976ZM23 4.51539C23 4.13201 22.6892 3.82122 22.3058 3.82122C21.9224 3.82122 21.6116 4.13201 21.6116 4.51539V5.48061C21.6116 5.86399 21.9224 6.17478 22.3058 6.17478C22.6892 6.17478 23 5.86399 23 5.48061V4.51539ZM23 7.89367C23 7.51029 22.6892 7.1995 22.3058 7.1995C21.9224 7.1995 21.6116 7.51029 21.6116 7.89367V8.85889C21.6116 9.24227 21.9224 9.55306 22.3058 9.55306C22.6892 9.55306 23 9.24227 23 8.85889V7.89367ZM23 11.2719C23 10.8886 22.6892 10.5778 22.3058 10.5778C21.9224 10.5778 21.6116 10.8886 21.6116 11.2719V12.2372C21.6116 12.6205 21.9224 12.9313 22.3058 12.9313C22.6892 12.9313 23 12.6205 23 12.2372V11.2719ZM23 14.6502C23 14.2669 22.6892 13.9561 22.3058 13.9561C21.9224 13.9561 21.6116 14.2669 21.6116 14.6502V15.1328C21.6116 15.1515 21.6096 15.1689 21.6059 15.185C21.594 15.2373 21.5884 15.2896 21.5885 15.3411C21.537 15.3409 21.4847 15.3466 21.4324 15.3585C21.4163 15.3621 21.3989 15.3642 21.3803 15.3642H20.8976C20.5143 15.3642 20.2035 15.675 20.2035 16.0584C20.2035 16.4418 20.5143 16.7526 20.8976 16.7526H21.3803C21.5032 16.7526 21.6238 16.7387 21.7402 16.7123C22.0632 16.6388 22.2819 16.3512 22.2806 16.0332C22.5986 16.0345 22.8863 15.8158 22.9597 15.4928C22.9861 15.3764 23 15.2558 23 15.1328V14.6502ZM14.6474 13.9116C14.2294 13.4884 13.7764 13.3132 13.2767 13.5451C13.1394 13.6088 13.0164 13.7642 12.965 13.9976C12.9404 14.1092 12.9387 14.2154 12.952 14.2991C12.9615 14.3593 12.9761 14.3926 12.9832 14.4062L13.3718 14.7996C13.6232 15.0542 13.6207 15.4644 13.3661 15.7158C13.1116 15.9673 12.7014 15.9648 12.4499 15.7102L11.1619 14.4063C11.0696 14.3373 10.7782 14.256 10.4038 14.5402C10.265 14.6456 10.1892 14.8021 10.164 15.0159C10.146 15.1695 10.1586 15.3254 10.1806 15.4503L11.5483 16.8349C11.7998 17.0894 11.7973 17.4997 11.5427 17.7511C11.2881 18.0026 10.8779 18.0001 10.6265 17.7455L8.84977 15.9469C8.73834 15.8341 8.59086 15.7372 8.44955 15.7103C8.34989 15.6913 8.17941 15.6888 7.92486 15.922C7.40908 16.3944 7.60249 16.7531 7.61982 16.7853C7.62079 16.7871 7.62121 16.7879 7.62092 16.7876L8.36876 17.5446L8.36898 17.5449L9.63136 18.8228C9.88282 19.0774 9.8803 19.4876 9.62574 19.7391C9.37117 19.9905 8.96096 19.988 8.7095 19.7335L7.50459 18.5137C7.39104 18.4504 7.3071 18.431 7.25026 18.426C7.18448 18.4203 7.12354 18.4313 7.05978 18.4573C6.91636 18.5159 6.79333 18.6313 6.65652 18.7691C6.4611 19.004 6.42638 19.1929 6.43343 19.3189C6.44127 19.4591 6.50463 19.5852 6.59048 19.673L9.52673 22.586C9.77984 22.8371 9.78249 23.2456 9.53265 23.4999C9.2828 23.7543 8.87438 23.759 8.61876 23.5104L8.22865 23.1311V23.623C8.24763 24.1981 8.60657 24.7179 9.15357 25.1243C9.71443 25.541 10.3301 25.7301 10.6198 25.7301H14.6969C15.587 25.6238 16.1129 25.3237 16.2057 25.252C17.6012 24.1569 18.629 22.8236 18.9789 22.282C19.965 20.0757 18.9393 18.2565 18.341 17.6508L14.6474 13.9116ZM6.93288 21.8379V23.6327L6.93312 23.6505C6.96401 24.7762 7.65626 25.6261 8.38077 26.1644C9.09398 26.6943 9.97451 27.0259 10.6198 27.0259H14.7343C14.7585 27.0259 14.7826 27.0245 14.8067 27.0218C15.9128 26.8974 16.6893 26.5178 17.0025 26.2739L17.0044 26.2724C18.5682 25.0455 19.7067 23.557 20.0979 22.9372C20.1134 22.9127 20.1272 22.8871 20.1393 22.8607C21.4417 20.0111 20.126 17.614 19.2629 16.7402L17.6781 15.1359V6.01643C17.6781 4.8663 16.7457 3.93393 15.5956 3.93393H2.0825C0.932367 3.93393 0 4.8663 0 6.01643V19.5295C0 20.6797 0.932368 21.612 2.0825 21.612H6.70519L6.93288 21.8379ZM5.13682 19.2982H2.31389V6.24782H15.3642V12.8096C14.7425 12.2755 13.8096 11.8694 12.7314 12.3697C12.2925 12.5733 12.0053 12.926 11.8384 13.2984C11.1789 12.8743 10.2855 13.0031 9.62023 13.5082C9.24833 13.7906 9.04821 14.1549 8.94823 14.5061C8.86696 14.4778 8.7815 14.4544 8.69206 14.4374C8.15818 14.3357 7.58059 14.4801 7.04965 14.9664C6.21364 15.7322 6.13093 16.6828 6.43561 17.319C6.09639 17.4901 5.85345 17.7375 5.73648 17.8566L5.71719 17.8762C5.70638 17.8871 5.69596 17.8985 5.68595 17.9101C5.31058 18.3486 5.1343 18.8291 5.13682 19.2982Z",fill:i.color},null,8,K_i)],8,Q_i)}const CEe=W(G_i,[["render",W_i]]),Z_i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAYAAAA4qEECAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAkhSURBVHgB7Z3NbhvXFcfPvRTkWg5QdqW2aRAaTbMokHKUOpLQTahNYdMGTD2BqSewuuvO1BNYWnZl+QmkAIWoeqPRpoioGBrKbRAgATQGkiDJJgyQSIli3pNz5oMcUqT4oRnxXkk/QCA5M6Q4/7nzn3vOuXcIYBjW9N8LYCASDAPF2CMrl0uDYRgltPW3vMUP6vDGfTAMo4RWdfGAH4VQRTAMo4QWgL4/o7BMsw9jhA5sI+O9EJA2zT6METq0jRDT7MMYoRu2EWKYfRghdItthBhmH0YI3W4bISbZhxFCn7CNEIPsQ3uhO9pGiEH2ob3Q3WwjxBT7SFRoPq2t2UIGzkBX2wgxxD4SE9qaubuIhzcOEI8PsjP5g2GybidtA22lMAcIq41FhthHIkJbs/kiAj4GgWFLy1DWbc26dTs3wMc0bQOhhlBfrO6U517slrerlY0FpdQCrXB5tQn2kYjQiNCxhamUGKjl+baBtpBqan/nPyvRdS92N1eFwDmvdRtgH2OgKdbs7YzC+nK7wFGcDzddelh4573b2/j9r9hmbNAUAQlAO16UUj5pX/4KX1n/rzyrwiUkBQnwzZefOZNv/JGOosh5C9hjRf2f/6s8+wAuKUO36KPn7xYlitq1W8/Xu23DvvnT8cSvr40ffufYdg0uMUMJ/dPzv65B0L+lC5I9/u7eHCSM9V5QxhLwZrhMAlbpQug6uxsOaM7AQh/tWRmp5EF02c91NfXatBP7zlqz93J0QbwvUBYjXcVOuGRP3DtZCi6Q2jGw0LhnpY99oRs7Pi7Vb8SUE5s1eF21o4kSAjyEAREIS05lowSaMZx1fGSRbYhHHJUJxNL4LecpxAR36xDlFpxIJKFNwjugqPUyEjL05clOggtu67YOWdq8Tq07ke7dsHgiq9Rewya8iFAty4kfV7pdTL3+NsADgaJIu5OJrHIpYpzTRWxthD7ZkikiFLjQr1DB+9fAa+Uh6FDYPgUakEg/ehgmf/825UYg571AtVqtbM5/9flnffs+b/v1F5/+a/L1t24KIQKxxW8nX/8T0PJtGDGJZu+y03e/tabzpZ7bUhKKRC76r9AlkRdgSOTEtUVgLw+gU3aRWzuMmMSEpuzdQ/ZaFPCo57YoGr0LL1F0Bhx7vSYUNA8Up1Ejnz8qkhR6hVsnpzdP287POaMVvGk1jouXF8BEctZ8oRx1di+x7N3+TnmZHpZ7bafq8n1BfTbvOeIqxAQFL0+RAx3vBfX5R5zdG3nNkETOeU+oK8dJfYgJOjNsCs8bF1PKhWdhhGhQnBX+KS0w/nyFCIIb7+OFBSNEA6ExA8mhTcbQuBH/pqJtKYvxUqMo0/Da947p+WwtWzQHGNmZ/B5K2MOU2sKjib1OwxV4zIh1614ODEBLoRFTXG+0EFUJFS56vXIYexL2hf0DcXeLx4zwgRh23Mh5MrR1eDv9w0QBpaDM2c8rTuXZOsSAlSuk8eg4R2qv71c2l7xl0/deolBrwUAZ6h+n1vwgB7kL53L4HhwIO06LYeui/XssBAc/9e2zBFMDCR0VFw8pSyYpnUlBRlwityCahQWQiv4P55pe1TiSxDqJTAeiWinP8+q/zOZdymmU1NF1HnCzAjHBESZ9tu1HmRLoLLKHFb2n0B3F5b32EqzoColLECOcq8jO3LE5oZ+dzj9BgTVUlGsWyk2NiSoojiLZ8ZrBiAS5jRxdoog9zN7/cGOJrIltic+gHCJnGAcXvaPQp4vbBKm6Ut2JP7HOeWhKNHHatCj4n5LIQol5Z7fs8nrKCtYoAilaM3eoOAsuefnj4PvYkACcpOILc+vSwURvCN2vuM3/A6vkobGVsKIEX3b+z37lGz7eLbdEjVQ+m0MQW5QZfBx+P75wvtjdTCTvHFhIieqRpc5b9BZ9zJq+U0AhH/YlbuNzocYVZ0iYj7sMI+Adp57HlKqL+9T809ySkxI5JLCQInQbFN+gTXTqKMDEsT3mVMrr78zk6cyAAglYaLkIdYO3UYpbmwsjImgtsV34euGXynqJHEANkXM3dJatChKZe0KedbzY2eChWvy3QKLflyw4nC56Et0pnQnqmadsEIqLq1RM/qBdlxMXw75Fp9d4eJ0Di3m44FCprdSxNfcQN8qp3bueogtR4IgskX60JgSW0SzHDSBulL4Dlm6iX3QL8SxjSHGjDBWCt4sOh+M5en7hWjW15pxSqjSsuFHOnCYNRL+QeOWwmNA6Hx3CmTrun/JznpUVZ23xvLiqsJwTV0KfE1dCnxNXQp8TRlwMOxFcIDP8XKYgt/ffjZfR+qHz0b9t0AjthPb7rvJ9fi6l2u7exfJEzkTeRxGcCvMRLv3dBI3QTmgWmfK5peA5P9rR9ZTBLViz9wQVbdM8YcUUjPNoIcWi13JPn6WlHTqMvfNDW544Tx4rWqZGXBxGbh1UfF0nB7C8tGtKbfXxDhd8D86Ek4PwWN2EcVmDOmjLyFs0l4ggMhWiJyhsvm8HQmq5sSgln+Ar0cdBGh1aeHR1Z2PKu9GJd++N/rKA8vrY0/DGKMCtW3PP1mqeYQhPMgqEc0l4h75lY7gXAi7u75S9WqE/L1E+ak40amzExWM6ePJB2IPhg8h3roERoWXAghKXg9I+tdSWeyq5UmAjLRveGIX/eLgEHl1f82bSst+jPBCRZoSgbBgh2swzjPL1559uT/7h7TTpNNtciv4gmkr5k07v+cp1f/zdG2+9JKGLJ9eiu3+GKXVxoKV1hLA11FFmQWHf81v8cSqCa3yWV4Kiyo+YOPzHZb9fyBVXXBIGnYCpwzTk09A415EGnl7RS8Bw9H+9Lt4EjdFWaB4nTb2FGnfTuk3c927Lyff3AJXRvWCrdfZOKeENC+aJ+948laB1N+awhLflpLAcNEdroVM3xtcj04z5xicH2en8mt+K/eEHTJxzyJNC6340k525s9X5vkkh6FKSSatqSif0v1F3YB9dMcA2GO2FbrOPE5hgG4z2Qnu9D6G65KvRNWV4mBk/D9LNPgyxDcYIobvZhym2wRghdGf7MMc2GHN+lKzdPgyyDcYYodvtwyTbYIwRutU+zLINxqyfQg3twzDbYIwSOrQP02zDSPjWEmAg5g1ypEIrGMgvJG+j0Idlmd0AAAAASUVORK5CYII=",IY=document.createElement("img");IY.src=Z_i,IY.style.cursor="grabbing";function J_i({dataTransferType:t="areas_zone-id",getData:e=()=>null,onDropCB:i=()=>{}}={}){const r=Oe(!1),o=Oe(!1);function n(u){u.dataTransfer.types.includes(t)&&(u.preventDefault(),u.dataTransfer.dropEffect="move")}function s(){o.value=!1}function a(u){r.value=!0,u.dataTransfer.setData(t,e()),u.dataTransfer.effectAllowed="move",u.dataTransfer.setDragImage(IY,45,45)}function l(){r.value=!1}function c(u){o.value=!1;const h=parseInt(u.dataTransfer.getData(t),10);i?.(h)}function d(u){u.dataTransfer.types.includes(t)&&(o.value=!0)}return{dragging:r,dragover:o,onDragOver:n,onDragLeave:s,onDragStart:a,onDragEnd:l,onDrop:c,onDragEnter:d}}const X_i=["draggable"],Y_i={class:"layout-settings__header"},$_i={key:0,class:"layout-settings__swap"},eFi={key:1,class:"layout-settings__split"},tFi={class:"layout-settings__split__text"},iFi={class:"layout-settings__split__text"},rFi={key:2,class:"layout-settings__buttons"},oFi={__name:"LayoutSettings",setup(t){const e=Ut("$viewer"),{localContext:i}=e,r=ut(()=>i.window),o=ut(()=>e.globalContext.localContexts.length>1),n=ut(()=>e.layout.settings.swap),s=ut(()=>e.layout.settings.full);function a(){e.layout.settings.swap=!e.layout.settings.swap}function l(){i.loadWindow(null),e.layout.settings.edit=!1}function c(){i.close()}function d(C="row"){e.globalContext.open({localContextId:i.id,ratio:50,direction:C})}function u(){d(),e.layout.settings.edit=!1}function h(){d("column"),e.layout.settings.edit=!1}Ht(()=>e.globalContext.localContexts.length,C=>{var M;C===1&&e.layout.settings.edit&&((M=e.globalContext.localContexts[0].window)==null?void 0:M.header)===!1&&(e.layout.settings.edit=!1)});const{dragging:p,dragover:g,onDragOver:f,onDragLeave:A,onDragStart:m,onDragEnd:v,onDrop:y,onDragEnter:b}=J_i({getData:()=>String(i.id),onDropCB:C=>{Number.isNaN(C)||e.globalContext.swap(C,i.id)}}),w=ut(()=>e.layout.settings.swap);return(C,M)=>{const P=D("BIMDataIconWindowRight"),E=D("BIMDataButton"),S=D("BIMDataIconWindowBottom"),I=D("BIMDataIconDelete"),R=D("BIMDataTooltip");return T(),O("div",{class:ke(["layout-settings",{"layout-settings--swap":n.value,"layout-settings--dragging":zt(p),"layout-settings--dragover":zt(g)}]),draggable:w.value,onDragover:M[0]||(M[0]=(...L)=>zt(f)&&zt(f)(...L)),onDragleave:M[1]||(M[1]=(...L)=>zt(A)&&zt(A)(...L)),onDragenter:M[2]||(M[2]=(...L)=>zt(b)&&zt(b)(...L)),onDragstart:M[3]||(M[3]=_t((...L)=>zt(m)&&zt(m)(...L),["self"])),onDrop:M[4]||(M[4]=(...L)=>zt(y)&&zt(y)(...L)),onDragend:M[5]||(M[5]=(...L)=>zt(v)&&zt(v)(...L))},[k("div",Y_i,$(C.$t(n.value?"window-manager.swap":"window-manager.description"))+". ",1),n.value?(T(),O("div",$_i,[_(CEe,{color:"#ffffff",size:2})])):(T(),O("div",eFi,[_(E,{color:"default",fill:"",square:"",icon:"",height:"50px",style:{padding:"var(--spacing-unit)"},onClick:u},{default:G(()=>[_(P),k("span",tFi,$(C.$t("window-manager.vertical")),1)]),_:1}),_(E,{color:"default",fill:"",square:"",icon:"",height:"50px",style:{padding:"var(--spacing-unit)"},onClick:h},{default:G(()=>[_(S),k("span",iFi,$(C.$t("window-manager.horizontal")),1)]),_:1})])),s.value?(T(),O("div",rFi,[o.value?(T(),te(R,{key:0,text:C.$t("global.delete"),position:"left"},{default:G(()=>[_(E,{disabled:n.value,fill:"",square:"",icon:"",color:"default",width:"50px",height:"50px",onClick:c},{default:G(()=>[_(I,{fill:"",color:"high"})]),_:1},8,["disabled"])]),_:1},8,["text"])):ye("",!0),o.value?(T(),te(R,{key:1,text:C.$t("window-manager.swap_tooltip"),position:"left"},{default:G(()=>[_(E,{fill:"",square:"",icon:"",color:n.value?"secondary":"default",width:"50px",height:"50px",onClick:a},{default:G(()=>[_(CEe)]),_:1},8,["color"])]),_:1},8,["text"])):ye("",!0),r.value?(T(),te(R,{key:2,text:C.$t("window-manager.change"),position:"left"},{default:G(()=>[_(E,{disabled:n.value,fill:"",square:"",icon:"",color:"default",width:"50px",height:"50px",onClick:l},{default:G(()=>[_(q_i)]),_:1},8,["disabled"])]),_:1},8,["text"])):ye("",!0)])):ye("",!0)],42,X_i)}}},nFi=W(oFi,[["__scopeId","data-v-d37dfd4d"]]);function sFi(t,e=()=>{}){const i=Oe(0),r=Oe(0),o=Oe(0),n=Oe(0),s=l=>{l.forEach(c=>{const{width:d,height:u,x:h,y:p}=c.target.getBoundingClientRect();i.value=d,r.value=u,o.value=h,n.value=p,e?.({width:i.value,height:r.value,x:o.value,y:n.value})})},a=new ResizeObserver(s);return Br(()=>{a.observe(t.value)}),So(()=>a.disconnect()),{width:i,height:r,x:o,y:n}}class aFi extends Yle{constructor(e){super(e);const{width:i,height:r,x:o,y:n}=sFi(this.templateRef,s=>this.hub.emit("context-resize",s));this._resolution=Oe(1),this._width=i,this._height=r,this._x=o,this._y=n}get width(){return this._width.value}get height(){return this._height.value}get x(){return this._x.value}get y(){return this._y.value}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}}class lFi extends aFi{constructor(e){super(e),this.viewer=null,this._annotationMode=Oe(!1)}get annotationMode(){return this._annotationMode.value}async getSnapshot(){if(!this.viewer)throw new Error("[localContext.getSnapshot] Error: no viewer registered in this localContext.");await this.hideUI();const e=await this.viewer.getSnapshot();return await this.showUI(),e}getViewpoint(e){if(!this.viewer)throw new Error("[localContext.getViewpoint] Error: no viewer registered in this localContext.");return this.viewer.getViewpoint(e)}setViewpoint(e,i){if(!this.viewer)throw new Error("[localContext.setViewpoint] Error: no viewer registered in this localContext.");this.viewer.setViewpoint(e,i)}startAnnotationMode(e){if(!this.viewer)throw new Error("[localContext.startAnnotationMode] Error: no viewer registered in this localContext.");if(!this.annotationMode)return this._annotationMode.value=!0,this.viewer.startAnnotationMode(e)}stopAnnotationMode(){if(!this.viewer)throw new Error("[localContext.stopAnnotationMode] Error: no viewer registered in this localContext.");this._annotationMode.value=!1,this.viewer.stopAnnotationMode()}fitView(e){if(!this.viewer)throw new Error("[localContext.fitView] Error: no viewer registered in this localContext.");this.viewer.fitView(e)}async showUI(){if(!this.viewer)throw new Error("[localContext.showUI] Error: no viewer registered in this localContext.");this.pluginComponentInstances.forEach(e=>e.$show()),this.viewer.showUI(),await _o()}async hideUI({exceptions:e=[]}={}){if(!this.viewer)throw new Error("[localContext.hideUI] Error: no viewer registered in this localContext.");e.push(this.viewer.$plugin.name),[...this.pluginComponentInstances.entries()].filter(([i])=>!e.includes(i)).forEach(([,i])=>i.$hide()),this.viewer.hideUI(),await _o()}}class cFi extends lFi{constructor(e){super(e),this.modelTypes=null,this.multiModel=!0,this._loadedModels=Ao([]),this._loadingModelIds=Oe([]),this._selectedStorey=Ao(null),this._shownPlans=Ao([]),this._loadedModelIds=ut(()=>this._loadedModels.value.map(i=>i.id)),this._automaticFirstModelsLoading=!1,this._globalContextSubscription=null,So(()=>{e.globalContext.hub.off(this._globalContextSubscription)})}get loadedModels(){return this._loadedModels.value}get loadingModelIds(){return this._loadingModelIds.value}get loadedModelIds(){return this._loadedModelIds.value}get selectedStorey(){return this._selectedStorey.value}async loadModels(e,i={}){var r;const o=this._$viewer;if(!Array.isArray(e))throw new Error("[BIMDataViewer - Local State] loadModels requires an array of model ids.");this.multiModel||(e.length>1&&(e=[e[0]]),this.loadedModels.length>0&&this.unloadModels(this.loadedModelIds)),this.loadingModelIds.push(...e),this.hub.emit("models-loading",{ids:e});const n=[],s=[];for(const l of e)this.loadedModelIds.includes(l)||(o.state.modelsMap.has(l)?n.push(o.state.modelsMap.get(l)):s.push(l));n.push(...await o.state.loadModels(s)),this._loadingModelIds.value=this.loadingModelIds.filter(l=>!e.includes(l));const a=n.filter(l=>{var c;return((c=this.modelTypes)==null?void 0:c.includes(l.type))??!0});if(a.forEach(l=>{l.status!=="C"&&console.warn(`[BIMDataViewer - Local State] Model with id ${l.id} has an uncompleted status, loading may fail`)}),a.length!==0&&(this._loadedModels.value=[...this.loadedModels,...a],await((r=this.viewer)==null?void 0:r.loadModels(a,i)),this.hub.emit("models-loaded",{models:a}),o.globalContext.hub.emit("models-loaded",{models:a,emitter:this})),i!=null&&i.viewpoint&&this.viewer&&this.setViewpoint(i.viewpoint),i!=null&&i.storey){const l=a.flatMap(c=>c.storeys).find(c=>c.key===i.storey);l&&this.selectStorey(l)}return a}unloadModels(e){var i;const{loadedModels:r,$viewer:o}=this;if(!Array.isArray(e))throw new Error("[BIMDataViewer - Local State] unloadModels requires an array of ids.");const n=e.map(s=>o.state.modelsMap.get(s)).filter(Boolean);return n.length===0?!1:(this._loadedModels.value=r.filter(s=>!n.includes(s)),(i=this.viewer)==null||i.unloadModels(n),this.selectedStorey&&n.some(s=>s.storeys.some(a=>a.key===this.selectedStorey.key))&&this.selectStorey(null),this.hub.emit("models-unloaded",{models:n}),o.globalContext.hub.emit("models-unloaded",{models:n,emitter:this}),n)}get automaticFirstModelsLoading(){return this._automaticFirstModelsLoading}set automaticFirstModelsLoading(e){this._automaticFirstModelsLoading=e,e?this._onAutomaticFirstModelsLoading():this._$viewer.globalContext.hub.off(this._globalContextSubscription)}async _onAutomaticFirstModelsLoading(){const{_loadedModels:e,_loadingModelIds:i,$viewer:r}=this,o=r.globalContext.loadedModels.filter(a=>{var l;return((l=this.modelTypes)==null?void 0:l.includes(a.type))??!0});o.length>0&&this.loadModels(o.map(a=>a.id)),r.globalContext.hub.off(this._globalContextSubscription);const n=a=>{a=a.filter(l=>{var c;return((c=this.modelTypes)==null?void 0:c.includes(l.type))??!0}),a.length>0&&e.value.length===0&&i.value.length===0&&this.loadModels(a.map(l=>l.id))};await _o();let s=!0;this._globalContextSubscription=r.globalContext.hub.on("models-loaded",({models:a,emitter:l})=>{!s&&l===this||n(a)},{getLastEvent:!0}),s=!1}selectStorey(e,i=!0){this._selectedStorey.value=e,this.shownPlans.length>0&&this.shownPlans.forEach(r=>this.hidePlan(r)),i&&e?.plans.length>0&&e.plans.forEach(r=>this.showPlan(r)),this.hub.emit("storey-selected",{storey:e})}get shownPlans(){return this._shownPlans.value}showPlan(e){return this._shownPlans.value.some(i=>i.key===e.key)?!1:(this._shownPlans.value=[...this._shownPlans.value,e],this.hub.emit("plan-shown",{plan:e}),!0)}hidePlan(e){return this._shownPlans.value.some(i=>i.key===e.key)?(this._shownPlans.value=this._shownPlans.value.filter(i=>i.key!==e.key),this.hub.emit("plan-hidden",{plan:e}),!0):!1}}class dFi extends cFi{constructor(e,i){super(e),this.id=i,this._window=Ao(null),this.pluginInstances=new Map,So(()=>{this.unloadWindow()})}get $viewer(){const e=this;return new Proxy(this._$viewer,{get(i,r,o){return r==="localContext"?e:Reflect.get(i,r,o)}})}get pluginComponentInstances(){return new Map([...this.pluginInstances.values()].filter(e=>e.componentInstance).map(e=>[e.name,e.componentInstance]))}get plugins(){return this.pluginComponentInstances}get window(){return this._window.value}unloadWindow(){if(!this.window)return!1;const e=this.window,i=this.window.name;return this.pluginInstances.clear(),this._window.value=null,this.loadedModelIds.length>0&&this.unloadModels(this.loadedModelIds),this.automaticFirstModelsLoading=!1,this._$viewer.globalContext.hub.emit("window-close",{window:e,name:i,localContext:this}),!0}async loadWindow(e=null,i=null){const r=!!this.window;if(this.unloadWindow(),e===null)return null;if(r&&await _o(),!this.$viewer.windowManager.registeredWindows.has(e)){const l=`Cannot load window with name "${e}" because it is not registered.`;return console.warn(l),null}this._window.value=this.$viewer.windowManager.registeredWindows.get(e);const o=Array.from(this.window.plugins??[]);this.pluginInstances.clear(),o.map(l=>this.$viewer.pluginManager.getPluginInstance(l,this)).filter(Boolean).sort(({button:{stance:l=0}={}},{button:{stance:c=0}={}})=>l-c).forEach(l=>this.pluginInstances.set(l.name,l)),this.modelTypes=Array.isArray(this.window.modelTypes)?this.window.modelTypes:null,this.multiModel=this.window.multiModel??!0,this._loadedModels.value=[],this._loadingModelIds.value=[];const{modelIds:n,viewpoint:s,storey:a}=i??{};return this.window.noModel!==!0&&(n?.length>0?(this.automaticFirstModelsLoading=!1,this.loadModels(n,{viewpoint:s,storey:a})):this.automaticFirstModelsLoading=!0),this._$viewer.globalContext.hub.emit("window-open",{window:this.window,name:this.window.name,localContext:this}),this.window}close(){return this._$viewer.globalContext.close(this.id)}getPlugin(e){return console.warn("[BIMData Viewer] DEPRECATED - Ambigous name. Do not use localContext.getPlugin(name), use the localContext.pluginComponentInstances Map instead."),this.pluginComponentInstances.get(e)}}const uFi={name:"WindowContainer",components:{PluginComponentInstanceContainer:_x,LayoutSettings:nFi,SidePanel:k_i,SideColumn:j_i,ModalManager:yEe},inject:["$viewer"],props:{windowName:{type:String,default:null},windowState:{type:Object,default:null},zoneId:{type:Number,required:!0}},setup(t){const e=Ut("$viewer"),{globalContext:i}=e,r=new dFi(e,t.zoneId);Bo("$viewer",r.$viewer);const{templateRef:o}=r,n=()=>{o.value&&(o.value.scrollTop=0,o.value.scrollLeft=0)};Br(()=>{o.value.addEventListener("scroll",n,{passive:!0})});const s=()=>{i.activeLocalContext=r},a=()=>{i.activeLocalContext===r&&(i.activeLocalContext=null)},l=ut(()=>{var d;const u=[];let h=null,p=null;const g=[],f=[],A=[];return r.window?A.push(...r.pluginInstances.values()):((d=e.windowManager.defaultWindow)==null?void 0:d.plugins.length)>0&&A.push(...e.windowManager.defaultWindow.plugins.map(m=>e.pluginManager.getPluginInstance(m,this)).filter(Boolean).sort(({button:{stance:m=0}={}},{button:{stance:v=0}={}})=>m-v)),A.forEach(m=>{!m.button&&!m.sidePanel?m.isViewer?u.unshift(m):u.push(m):m.sidePanel?m.sidePanel.position==="left"?(h&&console.warn(`[BIMDataViewer - WindowContainer] Window ${r.window.name}, Multiple left side panels are not supported. Only the last one will be displayed.`),h=m):m.sidePanel.position==="right"&&(p&&console.warn(`[BIMDataViewer - WindowContainer] Window ${r.window.name}, Multiple right side panels are not supported. Only the last one will be displayed.`),p=m):m.button.position==="left"?g.push(m):m.button.position==="right"&&f.push(m)}),u.reverse(),{free:u,leftSidePanel:h,rightSidePanel:p,leftButtonColumn:g,rightButtonColumn:f}});r.loadWindow(t.windowName,t.windowState);const c=ut(()=>{const d=l.value.leftSidePanel,u=d!=null&&d.shown?d.sidePanel.width:0,h=l.value.rightSidePanel,p=h!=null&&h.shown?h.sidePanel.width:0;return r.width-u-p});return{onMouseEnter:s,onMouseLeave:a,templateRef:o,modalManagerTemplateRef:r.modalManagerTemplateRef,windowPlugins:l,layoutSettingsDisplayed:ut(()=>e.layout.settings.edit),spinner:ut(()=>r.spinner),loading:ut(()=>r.loading),width:ut(()=>r.width),height:ut(()=>r.height),resolution:ut(()=>r.resolution),localContext:r,centerWidth:c}},created(){this.$viewer.windowManager.windowContainers.push(this)},unmounted(){const t=this.$viewer.windowManager.windowContainers.indexOf(this);t!==-1&&this.$viewer.windowManager.windowContainers.splice(t,1)}},hFi={class:"window-container__content"},pFi={class:"window-container__content__center"},fFi={key:0,class:"bimdata-context-loading-overlay",style:{"z-index":"2"}},gFi={key:1,class:"window-container__layout-settings",style:{"z-index":"5"}};function mFi(t,e,i,r,o,n){const s=D("ModalManager"),a=D("SidePanel"),l=D("PluginComponentInstanceContainer"),c=D("SideColumn"),d=D("BIMDataSpinner"),u=D("LayoutSettings");return T(),O("div",{ref:"templateRef",class:"window-container",style:Pe(`
|
|
5520
|
+
`)},[_(s,{plugin:i.plugin,style:{height:"100%"}},null,8,["plugin"])],4)),[[Ai,i.plugin.shown]])}const k_i=W(C_i,[["render",x_i],["__scopeId","data-v-ced3f116"]]),M_i={props:{name:{type:String,default:"box"},content:{type:String,default:""},width:{type:[Number,String],default:20},height:{type:[Number,String],default:20},color:{type:String,default:"currentColor"},x:{type:[Number,String],default:20},y:{type:[Number,String],default:20}},computed:{viewBox(){return`0 0 ${this.x} ${this.y}`}}},P_i=["width","height","viewBox","aria-labelledby","fill"],E_i=["innerHTML"];function S_i(t,e,i,r,o,n){return T(),O("svg",{xmlns:"http://www.w3.org/2000/svg",width:i.width,height:i.height,viewBox:n.viewBox,"aria-labelledby":i.name,fill:i.color,role:"presentation"},[k("g",{innerHTML:i.content},null,8,E_i)],8,P_i)}const B_i=W(M_i,[["render",S_i]]),I_i=["src"],T_i={__name:"PluginIcon",props:{plugin:{type:Object,required:!0},isOpen:{type:Boolean,required:!0}},setup(t){const e=t,i=Ao(null);return Ph(()=>{e.isOpen&&e.plugin.button.iconOpen?i.value=e.plugin.button.iconOpen:e.plugin.button.icon?i.value=e.plugin.button.icon:i.value={component:"BIMDataIcon",options:{name:"default",size:"m"}}}),(r,o)=>i.value.imgUri?(T(),O("img",{key:0,src:i.value.imgUri,style:{"max-width":"40px","max-height":"40px"}},null,8,I_i)):i.value.svgPath?(T(),te(B_i,dl({key:1},i.value.options,{content:i.value.svgPath}),null,16,["content"])):i.value.component?(T(),te(No(i.value.component),bd(dl({key:2},i.value.options)),null,16)):ye("",!0)}},R_i={key:0,class:"tools-menu__info"},D_i={class:"window"},L_i={class:"plugins-as-button__content"},__i={class:"plugins-as-button__panel__header"},F_i={class:"panel__content"},O_i={__name:"PluginAsButton",props:{plugin:{type:Object,required:!0},active:{type:Boolean,required:!0},position:{type:String,required:!0,validator(t){return["right","left"].includes(t)}}},emits:["focus"],setup(t,{emit:e}){const i=e,r=Ut("$viewer"),{localContext:o}=r,n=t,{active:s}=DE(n),a=n.plugin,l=ut(()=>a.isOpen),c=ut(()=>a.buttonText),d=ut(()=>n.active?2:1);function u(){l.value&&i("focus")}function h(){l.value?a.close():a.open()}function p(){_o(()=>{l.value&&!a.button.keepOpen&&!a.loading&&a.close()})}return(g,f)=>{const A=D("BIMDataSpinner"),m=D("BIMDataButton"),v=D("BIMDataTooltip"),y=sr("click-away");return Ot((T(),O("div",{class:"plugins-as-button",style:Pe({zIndex:d.value,position:zt(a).button.content==="simple"?"relative":null})},[k("div",{class:"tools-menu m-b-12",onMouseenter:u},[_(v,{ref:"tooltip",class:ke({open:l.value}),text:zt(a).button.tooltip?g.$t(zt(a).button.tooltip):zt(a).name,position:t.position==="left"?"right":"left",disabled:l.value},{default:G(()=>[_(m,{width:"45px",height:"45px",fill:"",icon:"",color:"default",class:ke({focus:zt(s)}),"data-test":`plugin-${zt(a).name}`,onClick:f[0]||(f[0]=b=>h())},{default:G(()=>[c.value?(T(),O("span",R_i,$(zt(KEt)(c.value,zt(a).button.truncateSize||4)),1)):ye("",!0),zt(a).loading?(T(),te(A,{key:1})):(T(),te(T_i,{key:2,plugin:zt(a),"is-open":l.value},null,8,["plugin","is-open"]))]),_:1},8,["class","data-test"])]),_:1},8,["class","text","position","disabled"])],32),k("div",D_i,[_(dr,{name:`slide-fade-${t.position}`},{default:G(()=>[Ot(k("span",L_i,[zt(a).button.content==="panel"?(T(),O("div",{key:0,class:ke(["plugins-as-button__submenu",`plugins-as-button__submenu--${t.position==="right"?"left":"right"}__panel`])},[k("div",__i,$(zt(a).button.tooltip?g.$t(zt(a).button.tooltip):zt(a).name),1),k("div",F_i,[_(_x,{plugin:zt(a)},null,8,["plugin"])])],2)):(T(),te(_x,{key:1,class:ke(["plugins-as-button__submenu",`plugins-as-button__submenu--${t.position==="right"?"left":"right"}__${zt(a).button.content||"free"}`]),plugin:zt(a)},null,8,["class","plugin"]))],512),[[Ai,l.value]])]),_:1},8,["name"])])],4)),[[y,p]])}}},U_i=W(O_i,[["__scopeId","data-v-72f2ce01"]]),N_i={__name:"SideColumn",props:{plugins:{type:Array,default:()=>[]},position:{type:String,required:!0,validator(t){return["right","left"].includes(t)}}},setup(t){const e=t,i=Ao(null);return(r,o)=>(T(),O("div",{class:ke(["side-column",`side-column--${e.position}`])},[(T(!0),O(Pt,null,Xt(e.plugins,n=>(T(),O(Pt,{key:n.name},[n.button.content==="none"?(T(),te(_x,{key:0,plugin:n,onMouseenter:s=>i.value=n},null,8,["plugin","onMouseenter"])):Ot((T(),te(U_i,{key:1,plugin:n,position:e.position,active:i.value===n,onFocus:s=>i.value=n},null,8,["plugin","position","active","onFocus"])),[[Ai,n.shown]])],64))),128))],2))}},j_i=W(N_i,[["__scopeId","data-v-f11ec0c8"]]),H_i={},V_i={width:"23",height:"22",viewBox:"0 0 23 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function z_i(t,e){return T(),O("svg",V_i,e[0]||(e[0]=[k("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M-1.39472e-07 10.1037L3.19075 13.2944L6.3815 10.1037L4.25434 10.1037L4.25434 5.31755C4.25434 5.17754 4.30509 4.94384 4.42614 4.77572C4.47895 4.70237 4.54133 4.64599 4.62063 4.60508C4.69908 4.56461 4.83161 4.51987 5.05202 4.51987L11.1676 4.51987L11.1676 2.3927L5.05202 2.3927C3.96087 2.3927 3.17625 2.87117 2.69987 3.5328C2.26254 4.14021 2.12717 4.83714 2.12717 5.31755L2.12717 10.1037L-1.39472e-07 10.1037Z",fill:"currentColor"},null,-1),k("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23 11.9657L19.8092 8.7749L16.6185 11.9657L18.7457 11.9657L18.7457 16.7518C18.7457 16.8918 18.6949 17.1255 18.5739 17.2936C18.521 17.367 18.4587 17.4233 18.3794 17.4643C18.3009 17.5047 18.1684 17.5495 17.948 17.5495L11.8324 17.5495L11.8324 19.6766L17.948 19.6766C19.0391 19.6766 19.8238 19.1982 20.3001 18.5365C20.7375 17.9291 20.8728 17.2322 20.8728 16.7518L20.8728 11.9657L23 11.9657Z",fill:"currentColor"},null,-1),k("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0 15.6879C0 14.9536 0.595228 14.3584 1.32948 14.3584H8.24277C8.97703 14.3584 9.57225 14.9536 9.57225 15.6879V19.9422C9.57225 20.6765 8.97703 21.2717 8.24277 21.2717H1.32948C0.595228 21.2717 0 20.6765 0 19.9422V15.6879ZM1.59538 15.9538V19.6763H7.97688V15.9538H1.59538Z",fill:"currentColor"},null,-1),k("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.2948 1.32948C13.2948 0.595229 13.89 0 14.6243 0H21.5376C22.2718 0 22.8671 0.595228 22.8671 1.32948V5.58382C22.8671 6.31807 22.2718 6.91329 21.5376 6.91329H14.6243C13.89 6.91329 13.2948 6.31807 13.2948 5.58382V1.32948ZM14.8902 1.59538V5.31792H21.2717V1.59538H14.8902Z",fill:"currentColor"},null,-1)]))}const q_i=W(H_i,[["render",z_i]]),G_i={props:{color:{type:String,default:"currentColor"},size:{type:Number,default:1}}},Q_i=["width","height"],K_i=["fill"];function W_i(t,e,i,r,o,n){return T(),O("svg",{width:23*i.size,height:28*i.size,viewBox:"0 0 23 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[k("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.81498 1.39408C7.83109 1.39042 7.84845 1.38833 7.86714 1.38833H8.34975C8.73313 1.38833 9.04391 1.07754 9.04391 0.694167C9.04391 0.310789 8.73313 0 8.34975 0H7.86714C7.74418 0 7.62361 0.0138267 7.5072 0.0402917C7.18421 0.113723 6.96548 0.401367 6.96677 0.719361C6.64878 0.718068 6.36114 0.936792 6.28771 1.25978C6.26124 1.37619 6.24741 1.49677 6.24741 1.61972V2.10233C6.24741 2.48571 6.5582 2.7965 6.94158 2.7965C7.32496 2.7965 7.63575 2.48571 7.63575 2.10233V1.61972C7.63575 1.60103 7.63783 1.58368 7.64149 1.56756C7.65339 1.51525 7.65903 1.46297 7.65892 1.4115C7.71038 1.41162 7.76266 1.40597 7.81498 1.39408ZM10.7628 0C10.3794 0 10.0686 0.310789 10.0686 0.694167C10.0686 1.07754 10.3794 1.38833 10.7628 1.38833H11.728C12.1114 1.38833 12.4222 1.07754 12.4222 0.694167C12.4222 0.310789 12.1114 0 11.728 0H10.7628ZM14.1411 0C13.7577 0 13.4469 0.310789 13.4469 0.694167C13.4469 1.07754 13.7577 1.38833 14.1411 1.38833H15.1063C15.4897 1.38833 15.8005 1.07754 15.8005 0.694167C15.8005 0.310789 15.4897 0 15.1063 0H14.1411ZM17.5194 0C17.136 0 16.8252 0.310789 16.8252 0.694167C16.8252 1.07754 17.136 1.38833 17.5194 1.38833H18.4846C18.868 1.38833 19.1788 1.07754 19.1788 0.694167C19.1788 0.310789 18.868 0 18.4846 0H17.5194ZM20.8976 0C20.5143 0 20.2035 0.310789 20.2035 0.694167C20.2035 1.07754 20.5143 1.38833 20.8976 1.38833H21.3803C21.3989 1.38833 21.4163 1.39042 21.4324 1.39408C21.4847 1.40597 21.537 1.41162 21.5885 1.4115C21.5884 1.46297 21.594 1.51525 21.6059 1.56756C21.6096 1.58368 21.6116 1.60103 21.6116 1.61972V2.10233C21.6116 2.48571 21.9224 2.7965 22.3058 2.7965C22.6892 2.7965 23 2.48571 23 2.10233V1.61972C23 1.49677 22.9861 1.37619 22.9597 1.25978C22.8863 0.936791 22.5986 0.718068 22.2806 0.719361C22.2819 0.401367 22.0632 0.113723 21.7402 0.0402916C21.6238 0.0138267 21.5032 0 21.3803 0H20.8976ZM23 4.51539C23 4.13201 22.6892 3.82122 22.3058 3.82122C21.9224 3.82122 21.6116 4.13201 21.6116 4.51539V5.48061C21.6116 5.86399 21.9224 6.17478 22.3058 6.17478C22.6892 6.17478 23 5.86399 23 5.48061V4.51539ZM23 7.89367C23 7.51029 22.6892 7.1995 22.3058 7.1995C21.9224 7.1995 21.6116 7.51029 21.6116 7.89367V8.85889C21.6116 9.24227 21.9224 9.55306 22.3058 9.55306C22.6892 9.55306 23 9.24227 23 8.85889V7.89367ZM23 11.2719C23 10.8886 22.6892 10.5778 22.3058 10.5778C21.9224 10.5778 21.6116 10.8886 21.6116 11.2719V12.2372C21.6116 12.6205 21.9224 12.9313 22.3058 12.9313C22.6892 12.9313 23 12.6205 23 12.2372V11.2719ZM23 14.6502C23 14.2669 22.6892 13.9561 22.3058 13.9561C21.9224 13.9561 21.6116 14.2669 21.6116 14.6502V15.1328C21.6116 15.1515 21.6096 15.1689 21.6059 15.185C21.594 15.2373 21.5884 15.2896 21.5885 15.3411C21.537 15.3409 21.4847 15.3466 21.4324 15.3585C21.4163 15.3621 21.3989 15.3642 21.3803 15.3642H20.8976C20.5143 15.3642 20.2035 15.675 20.2035 16.0584C20.2035 16.4418 20.5143 16.7526 20.8976 16.7526H21.3803C21.5032 16.7526 21.6238 16.7387 21.7402 16.7123C22.0632 16.6388 22.2819 16.3512 22.2806 16.0332C22.5986 16.0345 22.8863 15.8158 22.9597 15.4928C22.9861 15.3764 23 15.2558 23 15.1328V14.6502ZM14.6474 13.9116C14.2294 13.4884 13.7764 13.3132 13.2767 13.5451C13.1394 13.6088 13.0164 13.7642 12.965 13.9976C12.9404 14.1092 12.9387 14.2154 12.952 14.2991C12.9615 14.3593 12.9761 14.3926 12.9832 14.4062L13.3718 14.7996C13.6232 15.0542 13.6207 15.4644 13.3661 15.7158C13.1116 15.9673 12.7014 15.9648 12.4499 15.7102L11.1619 14.4063C11.0696 14.3373 10.7782 14.256 10.4038 14.5402C10.265 14.6456 10.1892 14.8021 10.164 15.0159C10.146 15.1695 10.1586 15.3254 10.1806 15.4503L11.5483 16.8349C11.7998 17.0894 11.7973 17.4997 11.5427 17.7511C11.2881 18.0026 10.8779 18.0001 10.6265 17.7455L8.84977 15.9469C8.73834 15.8341 8.59086 15.7372 8.44955 15.7103C8.34989 15.6913 8.17941 15.6888 7.92486 15.922C7.40908 16.3944 7.60249 16.7531 7.61982 16.7853C7.62079 16.7871 7.62121 16.7879 7.62092 16.7876L8.36876 17.5446L8.36898 17.5449L9.63136 18.8228C9.88282 19.0774 9.8803 19.4876 9.62574 19.7391C9.37117 19.9905 8.96096 19.988 8.7095 19.7335L7.50459 18.5137C7.39104 18.4504 7.3071 18.431 7.25026 18.426C7.18448 18.4203 7.12354 18.4313 7.05978 18.4573C6.91636 18.5159 6.79333 18.6313 6.65652 18.7691C6.4611 19.004 6.42638 19.1929 6.43343 19.3189C6.44127 19.4591 6.50463 19.5852 6.59048 19.673L9.52673 22.586C9.77984 22.8371 9.78249 23.2456 9.53265 23.4999C9.2828 23.7543 8.87438 23.759 8.61876 23.5104L8.22865 23.1311V23.623C8.24763 24.1981 8.60657 24.7179 9.15357 25.1243C9.71443 25.541 10.3301 25.7301 10.6198 25.7301H14.6969C15.587 25.6238 16.1129 25.3237 16.2057 25.252C17.6012 24.1569 18.629 22.8236 18.9789 22.282C19.965 20.0757 18.9393 18.2565 18.341 17.6508L14.6474 13.9116ZM6.93288 21.8379V23.6327L6.93312 23.6505C6.96401 24.7762 7.65626 25.6261 8.38077 26.1644C9.09398 26.6943 9.97451 27.0259 10.6198 27.0259H14.7343C14.7585 27.0259 14.7826 27.0245 14.8067 27.0218C15.9128 26.8974 16.6893 26.5178 17.0025 26.2739L17.0044 26.2724C18.5682 25.0455 19.7067 23.557 20.0979 22.9372C20.1134 22.9127 20.1272 22.8871 20.1393 22.8607C21.4417 20.0111 20.126 17.614 19.2629 16.7402L17.6781 15.1359V6.01643C17.6781 4.8663 16.7457 3.93393 15.5956 3.93393H2.0825C0.932367 3.93393 0 4.8663 0 6.01643V19.5295C0 20.6797 0.932368 21.612 2.0825 21.612H6.70519L6.93288 21.8379ZM5.13682 19.2982H2.31389V6.24782H15.3642V12.8096C14.7425 12.2755 13.8096 11.8694 12.7314 12.3697C12.2925 12.5733 12.0053 12.926 11.8384 13.2984C11.1789 12.8743 10.2855 13.0031 9.62023 13.5082C9.24833 13.7906 9.04821 14.1549 8.94823 14.5061C8.86696 14.4778 8.7815 14.4544 8.69206 14.4374C8.15818 14.3357 7.58059 14.4801 7.04965 14.9664C6.21364 15.7322 6.13093 16.6828 6.43561 17.319C6.09639 17.4901 5.85345 17.7375 5.73648 17.8566L5.71719 17.8762C5.70638 17.8871 5.69596 17.8985 5.68595 17.9101C5.31058 18.3486 5.1343 18.8291 5.13682 19.2982Z",fill:i.color},null,8,K_i)],8,Q_i)}const CEe=W(G_i,[["render",W_i]]),Z_i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAYAAAA4qEECAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAkhSURBVHgB7Z3NbhvXFcfPvRTkWg5QdqW2aRAaTbMokHKUOpLQTahNYdMGTD2BqSewuuvO1BNYWnZl+QmkAIWoeqPRpoioGBrKbRAgATQGkiDJJgyQSIli3pNz5oMcUqT4oRnxXkk/QCA5M6Q4/7nzn3vOuXcIYBjW9N8LYCASDAPF2CMrl0uDYRgltPW3vMUP6vDGfTAMo4RWdfGAH4VQRTAMo4QWgL4/o7BMsw9jhA5sI+O9EJA2zT6METq0jRDT7MMYoRu2EWKYfRghdItthBhmH0YI3W4bISbZhxFCn7CNEIPsQ3uhO9pGiEH2ob3Q3WwjxBT7SFRoPq2t2UIGzkBX2wgxxD4SE9qaubuIhzcOEI8PsjP5g2GybidtA22lMAcIq41FhthHIkJbs/kiAj4GgWFLy1DWbc26dTs3wMc0bQOhhlBfrO6U517slrerlY0FpdQCrXB5tQn2kYjQiNCxhamUGKjl+baBtpBqan/nPyvRdS92N1eFwDmvdRtgH2OgKdbs7YzC+nK7wFGcDzddelh4573b2/j9r9hmbNAUAQlAO16UUj5pX/4KX1n/rzyrwiUkBQnwzZefOZNv/JGOosh5C9hjRf2f/6s8+wAuKUO36KPn7xYlitq1W8/Xu23DvvnT8cSvr40ffufYdg0uMUMJ/dPzv65B0L+lC5I9/u7eHCSM9V5QxhLwZrhMAlbpQug6uxsOaM7AQh/tWRmp5EF02c91NfXatBP7zlqz93J0QbwvUBYjXcVOuGRP3DtZCi6Q2jGw0LhnpY99oRs7Pi7Vb8SUE5s1eF21o4kSAjyEAREIS05lowSaMZx1fGSRbYhHHJUJxNL4LecpxAR36xDlFpxIJKFNwjugqPUyEjL05clOggtu67YOWdq8Tq07ke7dsHgiq9Rewya8iFAty4kfV7pdTL3+NsADgaJIu5OJrHIpYpzTRWxthD7ZkikiFLjQr1DB+9fAa+Uh6FDYPgUakEg/ehgmf/825UYg571AtVqtbM5/9flnffs+b/v1F5/+a/L1t24KIQKxxW8nX/8T0PJtGDGJZu+y03e/tabzpZ7bUhKKRC76r9AlkRdgSOTEtUVgLw+gU3aRWzuMmMSEpuzdQ/ZaFPCo57YoGr0LL1F0Bhx7vSYUNA8Up1Ejnz8qkhR6hVsnpzdP287POaMVvGk1jouXF8BEctZ8oRx1di+x7N3+TnmZHpZ7bafq8n1BfTbvOeIqxAQFL0+RAx3vBfX5R5zdG3nNkETOeU+oK8dJfYgJOjNsCs8bF1PKhWdhhGhQnBX+KS0w/nyFCIIb7+OFBSNEA6ExA8mhTcbQuBH/pqJtKYvxUqMo0/Da947p+WwtWzQHGNmZ/B5K2MOU2sKjib1OwxV4zIh1614ODEBLoRFTXG+0EFUJFS56vXIYexL2hf0DcXeLx4zwgRh23Mh5MrR1eDv9w0QBpaDM2c8rTuXZOsSAlSuk8eg4R2qv71c2l7xl0/deolBrwUAZ6h+n1vwgB7kL53L4HhwIO06LYeui/XssBAc/9e2zBFMDCR0VFw8pSyYpnUlBRlwityCahQWQiv4P55pe1TiSxDqJTAeiWinP8+q/zOZdymmU1NF1HnCzAjHBESZ9tu1HmRLoLLKHFb2n0B3F5b32EqzoColLECOcq8jO3LE5oZ+dzj9BgTVUlGsWyk2NiSoojiLZ8ZrBiAS5jRxdoog9zN7/cGOJrIltic+gHCJnGAcXvaPQp4vbBKm6Ut2JP7HOeWhKNHHatCj4n5LIQol5Z7fs8nrKCtYoAilaM3eoOAsuefnj4PvYkACcpOILc+vSwURvCN2vuM3/A6vkobGVsKIEX3b+z37lGz7eLbdEjVQ+m0MQW5QZfBx+P75wvtjdTCTvHFhIieqRpc5b9BZ9zJq+U0AhH/YlbuNzocYVZ0iYj7sMI+Adp57HlKqL+9T809ySkxI5JLCQInQbFN+gTXTqKMDEsT3mVMrr78zk6cyAAglYaLkIdYO3UYpbmwsjImgtsV34euGXynqJHEANkXM3dJatChKZe0KedbzY2eChWvy3QKLflyw4nC56Et0pnQnqmadsEIqLq1RM/qBdlxMXw75Fp9d4eJ0Di3m44FCprdSxNfcQN8qp3bueogtR4IgskX60JgSW0SzHDSBulL4Dlm6iX3QL8SxjSHGjDBWCt4sOh+M5en7hWjW15pxSqjSsuFHOnCYNRL+QeOWwmNA6Hx3CmTrun/JznpUVZ23xvLiqsJwTV0KfE1dCnxNXQp8TRlwMOxFcIDP8XKYgt/ffjZfR+qHz0b9t0AjthPb7rvJ9fi6l2u7exfJEzkTeRxGcCvMRLv3dBI3QTmgWmfK5peA5P9rR9ZTBLViz9wQVbdM8YcUUjPNoIcWi13JPn6WlHTqMvfNDW544Tx4rWqZGXBxGbh1UfF0nB7C8tGtKbfXxDhd8D86Ek4PwWN2EcVmDOmjLyFs0l4ggMhWiJyhsvm8HQmq5sSgln+Ar0cdBGh1aeHR1Z2PKu9GJd++N/rKA8vrY0/DGKMCtW3PP1mqeYQhPMgqEc0l4h75lY7gXAi7u75S9WqE/L1E+ak40amzExWM6ePJB2IPhg8h3roERoWXAghKXg9I+tdSWeyq5UmAjLRveGIX/eLgEHl1f82bSst+jPBCRZoSgbBgh2swzjPL1559uT/7h7TTpNNtciv4gmkr5k07v+cp1f/zdG2+9JKGLJ9eiu3+GKXVxoKV1hLA11FFmQWHf81v8cSqCa3yWV4Kiyo+YOPzHZb9fyBVXXBIGnYCpwzTk09A415EGnl7RS8Bw9H+9Lt4EjdFWaB4nTb2FGnfTuk3c927Lyff3AJXRvWCrdfZOKeENC+aJ+948laB1N+awhLflpLAcNEdroVM3xtcj04z5xicH2en8mt+K/eEHTJxzyJNC6340k525s9X5vkkh6FKSSatqSif0v1F3YB9dMcA2GO2FbrOPE5hgG4z2Qnu9D6G65KvRNWV4mBk/D9LNPgyxDcYIobvZhym2wRghdGf7MMc2GHN+lKzdPgyyDcYYodvtwyTbYIwRutU+zLINxqyfQg3twzDbYIwSOrQP02zDSPjWEmAg5g1ypEIrGMgvJG+j0Idlmd0AAAAASUVORK5CYII=",IY=document.createElement("img");IY.src=Z_i,IY.style.cursor="grabbing";function J_i({dataTransferType:t="areas_zone-id",getData:e=()=>null,onDropCB:i=()=>{}}={}){const r=Oe(!1),o=Oe(!1);function n(u){u.dataTransfer.types.includes(t)&&(u.preventDefault(),u.dataTransfer.dropEffect="move")}function s(){o.value=!1}function a(u){r.value=!0,u.dataTransfer.setData(t,e()),u.dataTransfer.effectAllowed="move",u.dataTransfer.setDragImage(IY,45,45)}function l(){r.value=!1}function c(u){o.value=!1;const h=parseInt(u.dataTransfer.getData(t),10);i?.(h)}function d(u){u.dataTransfer.types.includes(t)&&(o.value=!0)}return{dragging:r,dragover:o,onDragOver:n,onDragLeave:s,onDragStart:a,onDragEnd:l,onDrop:c,onDragEnter:d}}const X_i=["draggable"],Y_i={class:"layout-settings__header"},$_i={key:0,class:"layout-settings__swap"},eFi={key:1,class:"layout-settings__split"},tFi={class:"layout-settings__split__text"},iFi={class:"layout-settings__split__text"},rFi={key:2,class:"layout-settings__buttons"},oFi={__name:"LayoutSettings",setup(t){const e=Ut("$viewer"),{localContext:i}=e,r=ut(()=>i.window),o=ut(()=>e.globalContext.localContexts.length>1),n=ut(()=>e.layout.settings.swap),s=ut(()=>e.layout.settings.full);function a(){e.layout.settings.swap=!e.layout.settings.swap}function l(){i.loadWindow(null),e.layout.settings.edit=!1}function c(){i.close()}function d(C="row"){e.globalContext.open({localContextId:i.id,ratio:50,direction:C})}function u(){d(),e.layout.settings.edit=!1}function h(){d("column"),e.layout.settings.edit=!1}Ht(()=>e.globalContext.localContexts.length,C=>{var M;C===1&&e.layout.settings.edit&&((M=e.globalContext.localContexts[0].window)==null?void 0:M.header)===!1&&(e.layout.settings.edit=!1)});const{dragging:p,dragover:g,onDragOver:f,onDragLeave:A,onDragStart:m,onDragEnd:v,onDrop:y,onDragEnter:b}=J_i({getData:()=>String(i.id),onDropCB:C=>{Number.isNaN(C)||e.globalContext.swap(C,i.id)}}),w=ut(()=>e.layout.settings.swap);return(C,M)=>{const P=D("BIMDataIconWindowRight"),E=D("BIMDataButton"),S=D("BIMDataIconWindowBottom"),I=D("BIMDataIconDelete"),R=D("BIMDataTooltip");return T(),O("div",{class:ke(["layout-settings",{"layout-settings--swap":n.value,"layout-settings--dragging":zt(p),"layout-settings--dragover":zt(g)}]),draggable:w.value,onDragover:M[0]||(M[0]=(...L)=>zt(f)&&zt(f)(...L)),onDragleave:M[1]||(M[1]=(...L)=>zt(A)&&zt(A)(...L)),onDragenter:M[2]||(M[2]=(...L)=>zt(b)&&zt(b)(...L)),onDragstart:M[3]||(M[3]=_t((...L)=>zt(m)&&zt(m)(...L),["self"])),onDrop:M[4]||(M[4]=(...L)=>zt(y)&&zt(y)(...L)),onDragend:M[5]||(M[5]=(...L)=>zt(v)&&zt(v)(...L))},[k("div",Y_i,$(C.$t(n.value?"window-manager.swap":"window-manager.description"))+". ",1),n.value?(T(),O("div",$_i,[_(CEe,{color:"#ffffff",size:2})])):(T(),O("div",eFi,[_(E,{color:"default",fill:"",square:"",icon:"",height:"50px",style:{padding:"var(--spacing-unit)"},onClick:u},{default:G(()=>[_(P),k("span",tFi,$(C.$t("window-manager.vertical")),1)]),_:1}),_(E,{color:"default",fill:"",square:"",icon:"",height:"50px",style:{padding:"var(--spacing-unit)"},onClick:h},{default:G(()=>[_(S),k("span",iFi,$(C.$t("window-manager.horizontal")),1)]),_:1})])),s.value?(T(),O("div",rFi,[o.value?(T(),te(R,{key:0,text:C.$t("global.delete"),position:"left"},{default:G(()=>[_(E,{disabled:n.value,fill:"",square:"",icon:"",color:"default",width:"50px",height:"50px",onClick:c},{default:G(()=>[_(I,{fill:"",color:"high"})]),_:1},8,["disabled"])]),_:1},8,["text"])):ye("",!0),o.value?(T(),te(R,{key:1,text:C.$t("window-manager.swap_tooltip"),position:"left"},{default:G(()=>[_(E,{fill:"",square:"",icon:"",color:n.value?"secondary":"default",width:"50px",height:"50px",onClick:a},{default:G(()=>[_(CEe)]),_:1},8,["color"])]),_:1},8,["text"])):ye("",!0),r.value?(T(),te(R,{key:2,text:C.$t("window-manager.change"),position:"left"},{default:G(()=>[_(E,{disabled:n.value,fill:"",square:"",icon:"",color:"default",width:"50px",height:"50px",onClick:l},{default:G(()=>[_(q_i)]),_:1},8,["disabled"])]),_:1},8,["text"])):ye("",!0)])):ye("",!0)],42,X_i)}}},nFi=W(oFi,[["__scopeId","data-v-d37dfd4d"]]);function sFi(t,e=()=>{}){const i=Oe(0),r=Oe(0),o=Oe(0),n=Oe(0),s=l=>{l.forEach(c=>{const{width:d,height:u,x:h,y:p}=c.target.getBoundingClientRect();i.value=d,r.value=u,o.value=h,n.value=p,e?.({width:i.value,height:r.value,x:o.value,y:n.value})})},a=new ResizeObserver(s);return Br(()=>{a.observe(t.value)}),So(()=>a.disconnect()),{width:i,height:r,x:o,y:n}}class aFi extends Yle{constructor(e){super(e);const{width:i,height:r,x:o,y:n}=sFi(this.templateRef,s=>this.hub.emit("context-resize",s));this._resolution=Oe(1),this._width=i,this._height=r,this._x=o,this._y=n}get width(){return this._width.value}get height(){return this._height.value}get x(){return this._x.value}get y(){return this._y.value}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}}class lFi extends aFi{constructor(e){super(e),this.viewer=null,this._annotationMode=Oe(!1)}get annotationMode(){return this._annotationMode.value}async getSnapshot(){if(!this.viewer)throw new Error("[localContext.getSnapshot] Error: no viewer registered in this localContext.");await this.hideUI();const e=await this.viewer.getSnapshot();return await this.showUI(),e}getViewpoint(e){if(!this.viewer)throw new Error("[localContext.getViewpoint] Error: no viewer registered in this localContext.");return this.viewer.getViewpoint(e)}setViewpoint(e,i){if(!this.viewer)throw new Error("[localContext.setViewpoint] Error: no viewer registered in this localContext.");this.viewer.setViewpoint(e,i)}startAnnotationMode(e){if(!this.viewer)throw new Error("[localContext.startAnnotationMode] Error: no viewer registered in this localContext.");if(!this.annotationMode)return this._annotationMode.value=!0,this.viewer.startAnnotationMode(e)}stopAnnotationMode(){if(!this.viewer)throw new Error("[localContext.stopAnnotationMode] Error: no viewer registered in this localContext.");this._annotationMode.value=!1,this.viewer.stopAnnotationMode()}fitView(e){if(!this.viewer)throw new Error("[localContext.fitView] Error: no viewer registered in this localContext.");this.viewer.fitView(e)}async showUI(){if(!this.viewer)throw new Error("[localContext.showUI] Error: no viewer registered in this localContext.");this.pluginComponentInstances.forEach(e=>e.$show()),this.viewer.showUI(),await _o()}async hideUI({exceptions:e=[]}={}){if(!this.viewer)throw new Error("[localContext.hideUI] Error: no viewer registered in this localContext.");e.push(this.viewer.$plugin.name),[...this.pluginComponentInstances.entries()].filter(([i])=>!e.includes(i)).forEach(([,i])=>i.$hide()),this.viewer.hideUI(),await _o()}}class cFi extends lFi{constructor(e){super(e),this.modelTypes=null,this.multiModel=!0,this._loadedModels=Ao([]),this._loadingModelIds=Oe([]),this._selectedStorey=Ao(null),this._shownPlans=Ao([]),this._loadedModelIds=ut(()=>this._loadedModels.value.map(i=>i.id)),this._automaticFirstModelsLoading=!1,this._globalContextSubscription=null,So(()=>{e.globalContext.hub.off(this._globalContextSubscription)})}get loadedModels(){return this._loadedModels.value}get loadingModelIds(){return this._loadingModelIds.value}get loadedModelIds(){return this._loadedModelIds.value}get selectedStorey(){return this._selectedStorey.value}async loadModels(e,i={}){var r;const o=this._$viewer;if(!Array.isArray(e))throw new Error("[BIMDataViewer - Local State] loadModels requires an array of model ids.");this.multiModel||(e.length>1&&(e=[e[0]]),this.loadedModels.length>0&&this.unloadModels(this.loadedModelIds)),this.loadingModelIds.push(...e),this.hub.emit("models-loading",{ids:e});const n=[],s=[];for(const l of e)this.loadedModelIds.includes(l)||(o.state.modelsMap.has(l)?n.push(o.state.modelsMap.get(l)):s.push(l));n.push(...await o.state.loadModels(s)),this._loadingModelIds.value=this.loadingModelIds.filter(l=>!e.includes(l));const a=n.filter(l=>{var c;return((c=this.modelTypes)==null?void 0:c.includes(l.type))??!0});if(a.forEach(l=>{l.status!=="C"&&console.warn(`[BIMDataViewer - Local State] Model with id ${l.id} has an uncompleted status, loading may fail`)}),a.length!==0&&(this._loadedModels.value=[...this.loadedModels,...a],await((r=this.viewer)==null?void 0:r.loadModels(a,i)),this.hub.emit("models-loaded",{models:a}),o.globalContext.hub.emit("models-loaded",{models:a,emitter:this})),i!=null&&i.viewpoint&&this.viewer&&this.setViewpoint(i.viewpoint),i!=null&&i.storey){const l=a.flatMap(c=>c.storeys).find(c=>c.key===i.storey);l&&this.selectStorey(l)}return a}unloadModels(e){var i;const{loadedModels:r,$viewer:o}=this;if(!Array.isArray(e))throw new Error("[BIMDataViewer - Local State] unloadModels requires an array of ids.");const n=e.map(s=>o.state.modelsMap.get(s)).filter(Boolean);return n.length===0?!1:(this._loadedModels.value=r.filter(s=>!n.includes(s)),(i=this.viewer)==null||i.unloadModels(n),this.selectedStorey&&n.some(s=>s.storeys.some(a=>a.key===this.selectedStorey.key))&&this.selectStorey(null),this.hub.emit("models-unloaded",{models:n}),o.globalContext.hub.emit("models-unloaded",{models:n,emitter:this}),n)}get automaticFirstModelsLoading(){return this._automaticFirstModelsLoading}set automaticFirstModelsLoading(e){this._automaticFirstModelsLoading=e,e?this._onAutomaticFirstModelsLoading():this._$viewer.globalContext.hub.off(this._globalContextSubscription)}async _onAutomaticFirstModelsLoading(){const{_loadedModels:e,_loadingModelIds:i,$viewer:r}=this,o=r.globalContext.loadedModels.filter(a=>{var l;return((l=this.modelTypes)==null?void 0:l.includes(a.type))??!0});o.length>0&&this.loadModels(o.map(a=>a.id)),r.globalContext.hub.off(this._globalContextSubscription);const n=a=>{a=a.filter(l=>{var c;return((c=this.modelTypes)==null?void 0:c.includes(l.type))??!0}),a.length>0&&e.value.length===0&&i.value.length===0&&this.loadModels(a.map(l=>l.id))};await _o();let s=!0;this._globalContextSubscription=r.globalContext.hub.on("models-loaded",({models:a,emitter:l})=>{!s&&l===this||n(a)},{getLastEvent:!0}),s=!1}selectStorey(e,i=!0){this._selectedStorey.value=e,this.shownPlans.length>0&&this.shownPlans.forEach(r=>this.hidePlan(r)),i&&e?.plans.length>0&&e.plans.forEach(r=>this.showPlan(r)),this.hub.emit("storey-selected",{storey:e})}get shownPlans(){return this._shownPlans.value}showPlan(e){return this._shownPlans.value.some(i=>i.key===e.key)?!1:(this._shownPlans.value=[...this._shownPlans.value,e],this.hub.emit("plan-shown",{plan:e}),!0)}hidePlan(e){return this._shownPlans.value.some(i=>i.key===e.key)?(this._shownPlans.value=this._shownPlans.value.filter(i=>i.key!==e.key),this.hub.emit("plan-hidden",{plan:e}),!0):!1}}class dFi extends cFi{constructor(e,i){super(e),this.id=i,this._window=Ao(null),this.pluginInstances=new Map,So(()=>{this.unloadWindow()})}get $viewer(){const e=this;return new Proxy(this._$viewer,{get(i,r,o){return r==="localContext"?e:Reflect.get(i,r,o)}})}get pluginComponentInstances(){return new Map([...this.pluginInstances.values()].filter(e=>e.componentInstance).map(e=>[e.name,e.componentInstance]))}get plugins(){return this.pluginComponentInstances}get window(){return this._window.value}unloadWindow(){if(!this.window)return!1;const e=this.window,i=this.window.name;return this.pluginInstances.clear(),this._window.value=null,this.loadedModelIds.length>0&&this.unloadModels(this.loadedModelIds),this.automaticFirstModelsLoading=!1,this._$viewer.globalContext.hub.emit("window-close",{window:e,name:i,localContext:this}),!0}async loadWindow(e=null,i=null){const r=!!this.window;if(this.unloadWindow(),e===null)return null;if(r&&await _o(),!this.$viewer.windowManager.registeredWindows.has(e)){const l=`Cannot load window with name "${e}" because it is not registered.`;return console.warn(l),null}this._window.value=this.$viewer.windowManager.registeredWindows.get(e);const o=Array.from(this.window.plugins??[]);this.pluginInstances.clear(),o.map(l=>this.$viewer.pluginManager.getPluginInstance(l,this)).filter(Boolean).sort(({button:{stance:l=0}={}},{button:{stance:c=0}={}})=>l-c).forEach(l=>this.pluginInstances.set(l.name,l)),this.modelTypes=Array.isArray(this.window.modelTypes)?this.window.modelTypes:null,this.multiModel=this.window.multiModel??!0,this._loadedModels.value=[],this._loadingModelIds.value=[];const{modelIds:n,viewpoint:s,storey:a}=i??{};return this.window.noModel!==!0&&(n?.length>0?(this.automaticFirstModelsLoading=!1,this.loadModels(n,{viewpoint:s,storey:a})):this.automaticFirstModelsLoading=!0),this._$viewer.globalContext.hub.emit("window-open",{window:this.window,name:this.window.name,localContext:this}),this.window}close(){return this._$viewer.globalContext.close(this.id)}getPlugin(e){return console.warn("[BIMData Viewer] DEPRECATED - Ambigous name. Do not use localContext.getPlugin(name), use the localContext.pluginComponentInstances Map instead."),this.pluginComponentInstances.get(e)}}const uFi={name:"WindowContainer",components:{PluginComponentInstanceContainer:_x,LayoutSettings:nFi,SidePanel:k_i,SideColumn:j_i,ModalManager:yEe},inject:["$viewer"],props:{windowName:{type:String,default:null},windowState:{type:Object,default:null},zoneId:{type:Number,required:!0}},setup(t){const e=Ut("$viewer"),{globalContext:i}=e,r=new dFi(e,t.zoneId);Bo("$viewer",r.$viewer);const{templateRef:o}=r,n=()=>{o.value&&(o.value.scrollTop=0,o.value.scrollLeft=0)};Br(()=>{o.value.addEventListener("scroll",n,{passive:!0})});const s=()=>{i.activeLocalContext=r},a=()=>{i.activeLocalContext===r&&(i.activeLocalContext=null)},l=ut(()=>{var d;const u=[];let h=null,p=null;const g=[],f=[],A=[];return r.window?A.push(...r.pluginInstances.values()):((d=e.windowManager.defaultWindow)==null?void 0:d.plugins.length)>0&&A.push(...e.windowManager.defaultWindow.plugins.map(m=>e.pluginManager.getPluginInstance(m,this)).filter(Boolean).sort(({button:{stance:m=0}={}},{button:{stance:v=0}={}})=>m-v)),A.forEach(m=>{!m.button&&!m.sidePanel?m.isViewer?u.unshift(m):u.push(m):m.sidePanel?m.sidePanel.position==="left"?(h&&console.warn(`[BIMDataViewer - WindowContainer] Window ${r.window.name}, Multiple left side panels are not supported. Only the last one will be displayed.`),h=m):m.sidePanel.position==="right"&&(p&&console.warn(`[BIMDataViewer - WindowContainer] Window ${r.window.name}, Multiple right side panels are not supported. Only the last one will be displayed.`),p=m):m.button.position==="left"?g.push(m):m.button.position==="right"&&f.push(m)}),{free:u,leftSidePanel:h,rightSidePanel:p,leftButtonColumn:g,rightButtonColumn:f}});r.loadWindow(t.windowName,t.windowState);const c=ut(()=>{const d=l.value.leftSidePanel,u=d!=null&&d.shown?d.sidePanel.width:0,h=l.value.rightSidePanel,p=h!=null&&h.shown?h.sidePanel.width:0;return r.width-u-p});return{onMouseEnter:s,onMouseLeave:a,templateRef:o,modalManagerTemplateRef:r.modalManagerTemplateRef,windowPlugins:l,layoutSettingsDisplayed:ut(()=>e.layout.settings.edit),spinner:ut(()=>r.spinner),loading:ut(()=>r.loading),width:ut(()=>r.width),height:ut(()=>r.height),resolution:ut(()=>r.resolution),localContext:r,centerWidth:c}},created(){this.$viewer.windowManager.windowContainers.push(this)},unmounted(){const t=this.$viewer.windowManager.windowContainers.indexOf(this);t!==-1&&this.$viewer.windowManager.windowContainers.splice(t,1)}},hFi={class:"window-container__content"},pFi={class:"window-container__content__center"},fFi={key:0,class:"bimdata-context-loading-overlay",style:{"z-index":"2"}},gFi={key:1,class:"window-container__layout-settings",style:{"z-index":"5"}};function mFi(t,e,i,r,o,n){const s=D("ModalManager"),a=D("SidePanel"),l=D("PluginComponentInstanceContainer"),c=D("SideColumn"),d=D("BIMDataSpinner"),u=D("LayoutSettings");return T(),O("div",{ref:"templateRef",class:"window-container",style:Pe(`
|
|
5521
5521
|
--bimdata-local-context-height: ${r.height}px;
|
|
5522
5522
|
--bimdata-local-context-width: ${r.width}px;
|
|
5523
5523
|
--bimdata-local-context-center-width: ${r.centerWidth}px;
|
|
5524
5524
|
--bimdata-local-context-resolution: ${r.resolution};
|
|
5525
|
-
`),onMouseenter:e[0]||(e[0]=(...h)=>r.onMouseEnter&&r.onMouseEnter(...h)),onMouseleave:e[1]||(e[1]=(...h)=>r.onMouseLeave&&r.onMouseLeave(...h))},[_(s,{ref:"modalManagerTemplateRef"},null,512),k("div",hFi,[r.windowPlugins.leftSidePanel?(T(),te(a,{key:0,plugin:r.windowPlugins.leftSidePanel},null,8,["plugin"])):ye("",!0),k("div",pFi,[(T(!0),O(Pt,null,Xt(r.windowPlugins.free,h=>(T(),te(l,{key:h.name,class:ke({"window-container__content__center__viewer":h.isViewer}),plugin:h},null,8,["class","plugin"]))),128)),_(c,{position:"left",plugins:r.windowPlugins.leftButtonColumn},null,8,["plugins"]),_(c,{position:"right",plugins:r.windowPlugins.rightButtonColumn},null,8,["plugins"])]),r.windowPlugins.rightSidePanel?(T(),te(a,{key:1,plugin:r.windowPlugins.rightSidePanel},null,8,["plugin"])):ye("",!0)]),r.loading?(T(),O("div",fFi,[r.spinner&&r.spinner.component?(T(),te(No(r.spinner.component),bd(dl({key:0},r.spinner.props)),null,16)):(T(),te(d,{key:1,size:"20px",border:"3px"}))])):ye("",!0),r.layoutSettingsDisplayed?(T(),O("div",gFi,[_(u)])):ye("",!0)],36)}const AFi=W(uFi,[["render",mFi],["__scopeId","data-v-8a549a80"]]);let vFi=class{constructor(t=!0){const e=n_i(_le,null,{resizable:t});e.registerContent("default",AFi),this.settings=Ta({edit:!1,swap:!1,full:!1}),this.areas=e}get resizable(){return this.areas.resizable}set resizable(t){this.areas.resizable=t}apply(t=null){this.areas.layout=t?s_i(t):null}copy(t,e=!0){return a_i(this.areas.layout,t,e)}open({ratio:t,direction:e,insertAfter:i,windowName:r=null,windowState:o=null,localContextId:n=null}={}){const s=r?{options:{windowName:r,windowState:o}}:null;return n===null?this.areas.splitLayout(t,e,i,s):this.areas.split(n,t,e,i,s)}swap(t,e){return this.areas.swap(t,e)}close(t){return this.areas.delete(t)}compare(t,e){var i,r;if(!t&&!e)return!0;if(!t||!e)return!1;if(typeof t=="string"&&typeof e=="string")return t===e;if(typeof t=="string"||typeof e=="string")return!1;if(t.windowName&&e.windowName){if(t.windowName!==e.windowName)return!1;const o=new Set((i=t.windowState)==null?void 0:i.modelIds),n=new Set((r=e.windowState)==null?void 0:r.modelIds);return o.size===n.size&&[...o].every(s=>n.has(s))}return t.windowName||e.windowName||t.direction!==e.direction||t.children.length!==e.children.length?!1:t.children.every((o,n)=>this.compare(o,e.children[n]))}};const bFi="2.11.0",yFi={version:bFi};class wFi{constructor({plugins:e,api:i,ui:r,locale:o="fr"}){this.pluginManager=new vTi(e),this.windowManager=new yTi,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new lLi(i),this.globalContext=new YVe(this),this.state=kLi(this),this.shortcutManager=G_e(this.state),this.uiSettings=r||{},this.i18n=new JVe(o),this._contextMenu=null,this.layout=new vFi(this.uiSettings.resizable!==!1),this.localContext=null,window.$viewer=this}get version(){return yFi.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||z_e}set contextMenu(e){this._contextMenu=e}get registeredWindows(){return[...this.windowManager.registeredWindows.keys()]}get registeredPlugins(){return[...this.pluginManager.registeredPlugins.keys()]}get pluginsCfg(){return this.pluginManager.cfg}registerPlugin(e){this.pluginManager.registerPlugin(e),this.windowManager.registerAndAddPluginsToWindows([e])}}function CFi(t,e={}){e.backgroundColor&&(t.style.setProperty("--bimdata-viewer-background-color",e.backgroundColor),e.backgroundColor==="transparent"&&t.style.setProperty("--areas-separator-color","transparent")),e.colorPrimary&&t.style.setProperty("--color-primary",e.colorPrimary),e.colorPrimaryLighter&&t.style.setProperty("--color-primary-lighter",e.colorPrimaryLighter),e.colorPrimaryLight&&t.style.setProperty("--color-primary-light",e.colorPrimaryLight),e.colorPrimaryDark&&t.style.setProperty("--color-primary-dark",e.colorPrimaryDark),e.colorSecondary&&t.style.setProperty("--color-secondary",e.colorSecondary),e.colorSecondaryLighter&&t.style.setProperty("--color-secondary-lighter",e.colorSecondaryLighter),e.colorSecondaryLight&&t.style.setProperty("--color-secondary-light",e.colorSecondaryLight),e.colorSecondaryDark&&t.style.setProperty("--color-secondary-dark",e.colorSecondaryDark),e.colorSilverLight&&t.style.setProperty("--color-silver-light",e.colorSilverLight),e.colorSilver&&t.style.setProperty("--color-silver",e.colorSilver),e.colorSilverDark&&t.style.setProperty("--color-silver-dark",e.colorSilverDark),e.colorGraniteLight&&t.style.setProperty("--color-granite-light",e.colorGraniteLight),e.colorGranite&&t.style.setProperty("--color-granite",e.colorGranite),e.colorSuccess&&t.style.setProperty("--color-success",e.colorSuccess),e.colorSuccessLighter&&t.style.setProperty("--color-success-Lighter",e.colorSuccessLighter),e.colorSuccessLight&&t.style.setProperty("--color-success-Light",e.colorSuccessLight),e.colorSuccessDark&&t.style.setProperty("--color-success-Dark",e.colorSuccessDark),e.colorWarning&&t.style.setProperty("--color-warning",e.colorWarning),e.colorWarningLighter&&t.style.setProperty("--color-warning-Lighter",e.colorWarningLighter),e.colorWarningLight&&t.style.setProperty("--color-warning-Light",e.colorWarningLight),e.colorWarningDark&&t.style.setProperty("--color-warning-Dark",e.colorWarningDark),e.colorHigh&&t.style.setProperty("--color-high",e.colorHigh),e.colorHighLighter&&t.style.setProperty("--color-high-lighter",e.colorHighLighter),e.colorHighLight&&t.style.setProperty("--color-high-light",e.colorHighLight),e.colorHighDark&&t.style.setProperty("--color-high-dark",e.colorHighDark),e.colorText&&t.style.setProperty("--color-text",e.colorText),(!e.backgroundColor||e.backgroundColor!=="transparent")&&t.style.setProperty("--areas-separator-color","rgba(216, 216, 216, 1)"),e.headerHeight!=null&&t.style.setProperty("--bimdata-viewer-header-height",e.headerHeight),t.style.setProperty("--areas-background-color","transparent")}const xFi=Object.freeze({25:"GUEST",50:"USER",100:"ADMIN"}),a7=Object.freeze({READ:"read",WRITE:"write"});function xEe(t){const e={};return t.forEach(i=>{const[r,o]=i.split(":");e[r]?e[r].push(o):e[r]=[o]}),e}const kFi={token_scopes:[],usable_scopes:[],user_role:25};function kEe(t=kFi){var e,i,r,o,n,s;const a=xEe(t.token_scopes),l=xEe(t.usable_scopes);return{...w1e(t),tokenScopes:a,usableScopes:l,userRole:xFi[t.user_role],user:t.user?w1e(t.user):null,hasBcfReadPermission:((e=l.bcf)==null?void 0:e.includes(a7.READ))??!1,hasBcfWritePermission:((i=l.bcf)==null?void 0:i.includes(a7.WRITE))??!1,hasModelReadPermission:((r=l.model)==null?void 0:r.includes(a7.READ))??!1,hasModelWritePermission:((o=l.model)==null?void 0:o.includes(a7.WRITE))??!1,hasDocReadPermission:((n=l.document)==null?void 0:n.includes(a7.READ))??!1,hasDocWritePermission:((s=l.document)==null?void 0:s.includes(a7.WRITE))??!1}}const MFi={BcfFilters:{filtersButton:"Filter",filtersTitle:"Filter",priorityLabel:"Priorit\xE4t",statusLabel:"Status",assignedToLabel:"Zugewiesen an",creatorsLabel:"Erstellt von",tagsLabel:"Tags",resetButton:"Zur\xFCcksetzen",searchButton:"Suchen",undefined:"Nicht definiert",datePlaceholder:"Erstellungsdatum"},BcfSettings:{goBackButton:"Zur\xFCck",title:"BCF-Parameter",text:"Erstellen, f\xFCllen und listen Sie die BCF-Einstellungen auf, die Sie f\xFCr dieses Projekt haben m\xF6chten.",validateButton:"Die BCF-Parameter anerkennen"},BcfStatistics:{emptyText:"F\xFCgen Sie Fragen hinzu, um zugeh\xF6rige Statistiken hier anzuzeigen.",issues:"Probleme",extension:{Priority:"Priorit\xE4t",PriorityNotDefined:"Keine Priorit\xE4t",PriorityTitle:"Priorit\xE4ten",Status:"Status",StatusNotDefined:"Kein Status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priorit\xE4t:",noPriority:"Keine",assignedTo:"Zugewiesen an :",elements:"Elemente",notSpecified:"Nicht definiert",see:"Anzeigen"},BcfTopicCreationCard:{text:"Ein neues BCF-Thema erstellen",createBcfSideTitle:"Ein Problem melden"},BcfTopicForm:{dragDropImageText:"Bitte w\xE4hlen Sie eine Datei aus.",addObjectButton:"Objekt",addAnnotationButton:"Annotation",annotationButtonTooltip:"Zu diesem Thema gibt es derzeit keine Ansichten.",addPictureButton:"F\xFCgen Sie ein Bild hinzu.",titlePlaceholder:"Titel *",titleErrorMessage:"Titel fehlt",typeLabel:"Typ",priorityLabel:"Priorit\xE4t",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",dueDateLabel:"F\xE4lligkeitsdatum (TT.MM.JJJJ)",descriptionLabel:"Beschreibung",labelsLabel:"Tags",createButton:"Best\xE4tigen",updateButton:"\xC4nderungen \xFCbernehmen",modalText:"Sie sind dabei, die Bearbeitung der Ausgabe {Name} zu beenden, aber es gibt noch ungespeicherte \xC4nderungen.",cancelButton:"\xC4nderungen verwerfen",continueButton:"\xC4nderungen fortsetzen",createTitle:"Ein Problem melden",dragDropImageTextTablet:"Foto machen",takeSnapshot:"Mach einen Schnappschuss",importFile:"Eine Datei importieren",searchPlaceholder:"Suchen",emptySearch:"kein Ergebnis"},BcfTopicOverview:{openViewer:"Im Viewer \xF6ffnen",openViewerNoModels:"Es sind keine Vorlagen zur Ansicht bereit",elements:"{count} Elemente",noElements:"kein Element",type:"Typ",noTypeSpecified:"Kein Typ angegeben",description:"Beschreibung",noDescriptionProvided:"Keine Beschreibung angegeben",assignedTo:"Zugeteilt an",notAssigned:"Nicht zugewiesen",dueDate:"F\xE4lligkeitsdatum",noDueDate:"Kein F\xE4lligkeitsdatum",informations:"Informationen",status:"Status",noStatusSpecified:"Kein Status angegeben",stage:"Phase",noStageProvided:"Keine Phase angegeben",priority:"Priorit\xE4t",priorityNotDefined:"Nicht definiert",tags:"Tags",noTags:"Keine Tags",commentButton:"Ein Kommentar ver\xF6ffentlichen",deleteText:"Sie l\xF6schen jetzt {Name}",deleteBcfButton:"Dieses BCF l\xF6schen",keepBcfButton:"Dieses BCF beibehalten",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE4t",status:"Status",title:"Titel",creator:"Autor",date:"Datum"}},BcfTopicActionsCell:{seeButton:"Anzeigen"},BcfTopicComments:{commentButton:"Ein Kommentar verfassen",commentLabel:"Ein Kommentar verfassen",commentText:"Kommentar",cancelButton:"Abbrechen",publishButton:"Ver\xF6ffentlichen",commentsText:"Kommentare",deleteCommentText:"Diesen Kommentar l\xF6schen?",deleteButton:"L\xF6schen",takeSnapshot:"Mach einen Schnappschuss"},BcfTopicPriorityCell:{noPriority:"Keine"},SettingCard:{addButton:"ein Element hinzuf\xFCgen",cancelButton:"Abbrechen",validateButton:"Best\xE4tigen",deleteExtensionText:"Diesen Parameter l\xF6schen",deleteButton:"L\xF6schen",title:{Priority:"Priorit\xE4ten",Label:"Tags",Status:"Status",Type:"Typen",Stage:"Phasen"},input:{Priority:"Eine neue Priorit\xE4t hinzuf\xFCgen",Label:"Ein neues Etikett hinzuf\xFCgen",Status:"Einen neuen Status hinzuf\xFCgen",Type:"Einen neuen Typ hinzuf\xFCgen",Stage:"Eine neue Phase hinzuf\xFCgen"},text:{Priority:"Liste der Priorit\xE4ten",Label:"Liste von Tags",Status:"Liste der Status",Type:"Liste der Typen",Stage:"Liste der Phasen"}}},PFi={BcfComponents:MFi},EFi={BcfFilters:{filtersButton:"Filters",filtersTitle:"Filters",priorityLabel:"Priority",statusLabel:"Status",assignedToLabel:"Assigned to",creatorsLabel:"Created by",tagsLabel:"Tags",resetButton:"Reset",searchButton:"Search",undefined:"Not defined",datePlaceholder:"Creation date"},BcfSettings:{goBackButton:"Back",title:"BCF Settings",text:"Create, enter in, and list the BCF settings you would like to have for this project",validateButton:"Validate BCF settings"},BcfStatistics:{emptyText:"Add BCF Topics to start to have some stats here.",issues:"issues",extension:{Priority:"Priority",PriorityNotDefined:"No priority",PriorityTitle:"Priorities",Status:"Status",StatusNotDefined:"No status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priority: ",noPriority:"None",assignedTo:"Assigned to: ",elements:"Elements",notSpecified:"Not specified",see:"See"},BcfTopicCreationCard:{text:"Create a new BCF topic",createBcfSideTitle:"Report a problem"},BcfTopicForm:{dragDropImageText:"Please select a file",addObjectButton:"Object",addAnnotationButton:"Annotation",annotationButtonTooltip:"This topic has no viewpoint",addPictureButton:"Add a picture",titlePlaceholder:"Title *",titleErrorMessage:"Missing title",typeLabel:"Type",priorityLabel:"Priority",statusLabel:"Status",stageLabel:"Stage",assignedToLabel:"Assigned to",dueDateLabel:"Due date",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Validate",updateButton:"Modify this BCF",modalText:"You are about to quit editing issue {name} but there are unsaved changes.",cancelButton:"Discard changes",continueButton:"Continue editing",createTitle:"Report a problem",dragDropImageTextTablet:"Take a picture",takeSnapshot:"Take a snapshot",importFile:"Import a file",searchPlaceholder:"Search",emptySearch:"No result"},BcfTopicOverview:{openViewer:"Open in viewer",openViewerNoModels:"No model to open",elements:"{count} Elements",noElements:"No element",type:"Type",noTypeSpecified:"No type specified",description:"Description",noDescriptionProvided:"No description provided",assignedTo:"Assigned to",notAssigned:"Not assigned",dueDate:"Due date",noDueDate:"No due date",informations:"Informations",status:"Status",noStatusSpecified:"No status specified",stage:"Stage",noStageProvided:"No stage provided",priority:"Priority",priorityNotDefined:"Not defined",tags:"Tags",noTags:"No tags",commentButton:"Post a comment",deleteText:"You are about to delete {name}",deleteBcfButton:"Delete this BCF",keepBcfButton:"Keep this BCF",author:"Author"},BcfTopicsTable:{headers:{index:"#",priority:"Priority",status:"Status",title:"Title",creator:"Author",date:"Date"}},BcfTopicActionsCell:{seeButton:"See"},BcfTopicComments:{commentButton:"Post a comment",commentLabel:"Post a comment",commentText:"Comment",cancelButton:"Cancel",publishButton:"Publish",commentsText:"Comments",deleteCommentText:"Delete this comment ?",deleteButton:"Delete",takeSnapshot:"Take a snapshot"},BcfTopicPriorityCell:{noPriority:"None"},SettingCard:{addButton:"add an element",cancelButton:"Cancel",validateButton:"Validate",deleteExtensionText:"Remove this setting",deleteButton:"Delete",title:{Priority:"Priorities",Label:"Labels",Status:"Status",Type:"Types",Stage:"Stages"},input:{Priority:"Add a new priority",Label:"Add a new label",Status:"Add new status",Type:"Add a new type",Stage:"Add a new stage"},text:{Priority:"Priority list",Label:"Labels list",Status:"Status list",Type:"Type list",Stage:"Stage list"}}},SFi={BcfComponents:EFi},BFi={BcfFilters:{filtersButton:"Filtros",filtersTitle:"Filtros",priorityLabel:"Prioridad",statusLabel:"Estado",assignedToLabel:"Asignado a",creatorsLabel:"Creado por",tagsLabel:"Etiquetas:",resetButton:"Restablecer",searchButton:"Buscar en",undefined:"No definido",datePlaceholder:"Fecha de creaci\xF3n"},BcfSettings:{goBackButton:"Volver",title:"Par\xE1metros del BCF",text:"Cree, rellene y enumere los par\xE1metros del BCF que desea tener en este proyecto",validateButton:"Validar los par\xE1metros del BCF"},BcfStatistics:{emptyText:"A\xF1ada preguntas para ver las estad\xEDsticas asociadas aqu\xED.",issues:"problemas",extension:{Priority:"Prioridad",PriorityNotDefined:"Sin prioridad",PriorityTitle:"Prioridades",Status:"Estado",StatusNotDefined:"Sin estado",StatusTitle:"Estatutos"}},BcfTopicCard:{priority:"Prioridad :",noPriority:"Sin",assignedTo:"Asignado a :",elements:"Elementos",notSpecified:"No definido",see:"Ver"},BcfTopicCreationCard:{text:"Crear un nuevo tema BCF",createBcfSideTitle:"Informar de un problema"},BcfTopicForm:{dragDropImageText:"Seleccione un archivo",addObjectButton:"Objeto",addAnnotationButton:"Anotaci\xF3n",annotationButtonTooltip:"Actualmente este tema no posee ning\xFAn punto de vista",addPictureButton:"A\xF1adir una imagen",titlePlaceholder:"T\xEDtulo *",titleErrorMessage:"Falta el t\xEDtulo",typeLabel:"Tipo",priorityLabel:"Prioridad",statusLabel:"Estado",stageLabel:"Fase",assignedToLabel:"Asignado a",dueDateLabel:"Fecha de vencimiento (DD/MM/AAAA)",descriptionLabel:"Descripci\xF3n",labelsLabel:"Etiquetas",createButton:"Validar",updateButton:"Modificar este BCF",modalText:"Est\xE1 a punto de salir de la edici\xF3n del problema de {name} pero hay cambios sin guardar.",cancelButton:"Cancelar los cambios",continueButton:"Continuar con los cambios",createTitle:"Informar de un problema",dragDropImageTextTablet:"Tomar una fotograf\xEDa",takeSnapshot:"Tomar un snapshot",importFile:"Importar un archivo",searchPlaceholder:"Buscar",emptySearch:"No hay resultados"},BcfTopicOverview:{openViewer:"Abrir en el visor",openViewerNoModels:"No hay ning\xFAn modelo listo para la visualizaci\xF3n",elements:"{count} Elementos",noElements:"Ning\xFAn elemento",type:"Tipo",noTypeSpecified:"No se especifica el tipo",description:"Descripci\xF3n",noDescriptionProvided:"No hay descripci\xF3n",assignedTo:"Asignado a",notAssigned:"No asignado",dueDate:"Plazo",noDueDate:"Sin fecha de vencimiento",informations:"Informaci\xF3n",status:"Estado",noStatusSpecified:"No se especifica el estado",stage:"Fase",noStageProvided:"No se indica ninguna fase",priority:"Prioridad",priorityNotDefined:"No definido",tags:"Etiquetas",noTags:"Sin etiquetas",commentButton:"Publicar un comentario",deleteText:"Est\xE1s a punto de borrar {name}",deleteBcfButton:"Borrar este BCF",keepBcfButton:"Mantenga este BCF",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Prioridad",status:"Estado",title:"T\xEDtulo",creator:"Autor",date:"Fecha"}},BcfTopicActionsCell:{seeButton:"Ver"},BcfTopicComments:{commentButton:"Publicar un comentario",commentLabel:"Publicar un comentario",commentText:"Comentario",cancelButton:"Cancelar",publishButton:"Publicar",commentsText:"comentarios",deleteCommentText:"\xBFBorrar este comentario?",deleteButton:"Borrar",takeSnapshot:"Tomar un snapshot"},BcfTopicPriorityCell:{noPriority:"Sin"},SettingCard:{addButton:"a\xF1adir un elemento",cancelButton:"Cancelar",validateButton:"Validar",deleteExtensionText:"Borrar esta configuraci\xF3n",deleteButton:"Borrar",title:{Priority:"Prioridades",Label:"Etiquetas:",Status:"Estatutos",Type:"Tipos",Stage:"Fases"},input:{Priority:"A\xF1adir una nueva prioridad",Label:"A\xF1adir una nueva etiqueta",Status:"A\xF1adir un nuevo estado",Type:"A\xF1adir un nuevo tipo",Stage:"A\xF1adir una nueva fase"},text:{Priority:"Lista de prioridades",Label:"Lista de etiquetas",Status:"Lista de estatutos",Type:"Lista de tipos",Stage:"Lista de fases"}}},IFi={BcfComponents:BFi},TFi={BcfFilters:{filtersButton:"Filtres",filtersTitle:"Filtres",priorityLabel:"Priorit\xE9",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assign\xE9 \xE0",creatorsLabel:"Cr\xE9\xE9 par",tagsLabel:"Tags",resetButton:"R\xE9initialiser",searchButton:"Rechercher",undefined:"Non d\xE9fini",datePlaceholder:"Date de cr\xE9ation"},BcfSettings:{goBackButton:"Retour",title:"Param\xE8tres BCF",text:"Cr\xE9ez, renseignez et listez les param\xE8tres BCF que vous souhaitez avoir sur ce projet",validateButton:"Valider les param\xE8tres BCF"},BcfStatistics:{emptyText:"Ajoutez des questions pour voir les statistiques associ\xE9es ici.",issues:"probl\xE8mes",extension:{Priority:"Priorit\xE9",PriorityNotDefined:"Aucune priorit\xE9",PriorityTitle:"Priorit\xE9s",Status:"Statut",StatusNotDefined:"Aucun statut",StatusTitle:"Statuts"}},BcfTopicCard:{priority:"Priorit\xE9 : ",noPriority:"Aucune",assignedTo:"Assign\xE9 \xE0 : ",elements:"{n} \xC9lements",notSpecified:"Non d\xE9fini",see:"Voir"},BcfTopicCreationCard:{text:"Cr\xE9er un nouveau topic BCF",createBcfSideTitle:"Signaler un probl\xE8me"},BcfTopicForm:{dragDropImageText:"Veuillez s\xE9lectionner un fichier",addObjectButton:"Objet",addAnnotationButton:"Annotation",annotationButtonTooltip:"Ce topic ne poss\xE8de actuellement aucun point de vue",addPictureButton:"Ajouter une image",titlePlaceholder:"Titre *",titleErrorMessage:"Titre manquant",typeLabel:"Type",priorityLabel:"Priorit\xE9",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assign\xE9 \xE0",dueDateLabel:"Date d'\xE9ch\xE9ance",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Valider",updateButton:"Modifier ce BCF",modalText:"Vous \xEAtes sur le point de quitter l'\xE9dition de l'issue {name} mais il y'a des modifications non enregistr\xE9es.",cancelButton:"Annuler les modifications",continueButton:"Continuer les modifications",createTitle:"Signaler un probl\xE8me",dragDropImageTextTablet:"Prendre une photo",takeSnapshot:"Prendre un snapshot",importFile:"Importer un fichier",searchPlaceholder:"Rechercher",emptySearch:"Pas de r\xE9sultat"},BcfTopicOverview:{openViewer:"Ouvrir dans le viewer",openViewerNoModels:"Il n'y a aucun mod\xE8le pr\xEAt pour une visualisation",elements:"{count} \xC9lements",noElements:"Aucun \xE9l\xE9ment concern\xE9",type:"Type",noTypeSpecified:"Pas de type sp\xE9cifi\xE9",description:"Description",noDescriptionProvided:"Pas de description renseign\xE9e",assignedTo:"Assign\xE9 \xE0",notAssigned:"Non assign\xE9",dueDate:"\xC9ch\xE9ance",noDueDate:"Pas de date d'\xE9ch\xE9ance",informations:"Informations",status:"Statut",noStatusSpecified:"Pas de statut sp\xE9cifi\xE9",stage:"Phase",noStageProvided:"Pas de phase renseign\xE9e",priority:"Priorit\xE9",priorityNotDefined:"Non d\xE9fini",tags:"Tags",noTags:"Pas de tags",commentButton:"Poster un commentaire",deleteText:"Vous \xEAtes sur le point de supprimer {name}",deleteBcfButton:"Supprimer ce BCF",keepBcfButton:"Conserver ce BCF",author:"Auteur"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE9",status:"Statut",title:"Titre",creator:"Auteur",date:"Date"}},BcfTopicActionsCell:{seeButton:"Voir"},BcfTopicComments:{commentButton:"Poster un commentaire",commentLabel:"Poster un commentaire",commentText:"Commentaire",cancelButton:"Annuler",publishButton:"Publier",commentsText:"commentaires",deleteCommentText:"Supprimer ce commentaire ?",deleteButton:"Supprimer",takeSnapshot:"Prendre un snapshot"},BcfTopicPriorityCell:{noPriority:"Aucune"},SettingCard:{addButton:"ajouter un \xE9l\xE9ment",cancelButton:"Annuler",validateButton:"Valider",deleteExtensionText:"Supprimmer ce param\xE8tre",deleteButton:"Supprimer",title:{Priority:"Priorit\xE9s",Label:"Tags",Status:"Statuts",Type:"Types",Stage:"Phases"},input:{Priority:"Ajouter une nouvelle priorit\xE9",Label:"Ajouter un nouveau label",Status:"Ajouter un nouveau statut",Type:"Ajouter un nouveau type",Stage:"Ajouter une nouvelle phase"},text:{Priority:"Liste des priorit\xE9s",Label:"Liste des tags",Status:"Liste des statuts",Type:"Liste des types",Stage:"Liste des phases"}}},RFi={BcfComponents:TFi},DFi={BcfFilters:{filtersButton:"Filtri",filtersTitle:"Filtri",priorityLabel:"Priorit\xE0",statusLabel:"Stato",datePlaceholder:"Data di creazione",assignedToLabel:"Assegnato a",creatorsLabel:"Creato da",tagsLabel:"Etichette",resetButton:"Ripristina",searchButton:"Cerca",undefined:"Non definito"},BcfSettings:{goBackButton:"Indietro",title:"Parametri BCF",text:"Creare, notificare e elencare i parametri BCF che si desidera avere su questo progetto",validateButton:"Conferma i parametri BCF"},BcfStatistics:{emptyText:"Aggiungi delle domande per vedere le statistiche associate qui.",issues:"problemi",extension:{Priority:"Priorit\xE0",PriorityNotDefined:"Nessuna priorit\xE0",PriorityTitle:"Priorit\xE0",Status:"Stato",StatusNotDefined:"Nessuno stato",StatusTitle:"Stati"}},BcfTopicCard:{priority:"Priorit\xE0:",noPriority:"Nessuno",assignedTo:"Assegnato a:",elements:"Elementi",noElements:"0 elementi",notSpecified:"Non definito",see:"Visualizza"},BcfTopicCreationCard:{text:"Crea un nuovo topic BCF",createBcfSideTitle:"Segnala un problema"},BcfTopicForm:{dragDropImageText:"Selezionare un file",addObjectButton:"Oggetto",addAnnotationButton:"Annotazione",annotationButtonTooltip:"Attualmente questo argomento non presenta alcun punto di vista",addPictureButton:"Aggiungere un'immagine",titlePlaceholder:"Titolo *",titleErrorMessage:"Titolo mancante",typeLabel:"Tipo",priorityLabel:"Priorit\xE0",statusLabel:"Stato",stageLabel:"Fase",assignedToLabel:"Assegnato a",dueDateLabel:"Data di scadenza",descriptionLabel:"Descrizione",labelsLabel:"Tag",createButton:"Conferma",updateButton:"Modificare questo BCF",modalText:"State per abbandonare la modifica di {name} ma ci sono modifiche non salvate.",cancelButton:"Annullare le modifiche",continueButton:"Continuare le modifiche",createTitle:"Segnala un problema"},BcfTopicOverview:{openViewer:"Apri nel visualizzatore",openViewerNoModels:"Non esistono modelli pronti per la visualizzazione",elements:"{count} Elementi",noElements:"Nessun elemento",type:"Tipo",noTypeSpecified:"Nessun tipo specificato",description:"Descrizione",noDescriptionProvided:"Nessuna descrizione inserita",assignedTo:"Assegnato a",notAssigned:"Non assegnato",dueDate:"Scadenza",noDueDate:"Nessuna data di scadenza",informations:"Informazioni",status:"Stato",noStatusSpecified:"Nessuno stato specificato",stage:"Fase",noStageProvided:"Nessuna fase inserita",priority:"Priorit\xE0",priorityNotDefined:"Non definita",tags:"Etichette",noTags:"Nessuna etichetta",commentButton:"Pubblica un commento",deleteText:"Stai per eliminare {name}",deleteBcfButton:"Elimina questo BCF",keepBcfButton:"Conserva questo BCF",author:"Autore"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE0",status:"Stato",title:"Titolo",creator:"Autore",date:"Data"}},BcfTopicActionsCell:{seeButton:"Visualizza"},BcfTopicComments:{commentButton:"Pubblica un commento",commentLabel:"Pubblica un commento",commentText:"Commento",cancelButton:"Annulla",publishButton:"Pubblica",commentsText:"commenti",deleteCommentText:"Eliminare questo commento?",deleteButton:"Elimina"},BcfTopicPriorityCell:{noPriority:"Nessuno"},SettingCard:{addButton:"aggiungi un elemento",cancelButton:"Annulla",validateButton:"Conferma",deleteExtensionText:"Elimina questo parametro",deleteButton:"Elimina",title:{Priority:"Priorit\xE0",Label:"Etichette",Status:"Stati",Type:"Tipi",Stage:"Fasi"},input:{Priority:"Aggiungi una nuova priorit\xE0",Label:"Aggiungi una nuova etichetta",Status:"Aggiungi un nuovo stato",Type:"Aggiungi un nuovo tipo",Stage:"Aggiungi una nuova fase"},text:{Priority:"Elenco delle priorit\xE0",Label:"Elenco delle etichette",Status:"Elenco degli stati",Type:"Elenco dei tipi",Stage:"Elenco delle fasi"}}},LFi={BcfComponents:DFi},_Fi={de:PFi,en:SFi,es:IFi,fr:RFi,it:LFi},FFi=({apiClient:t,fetchUsers:e,i18nPlugin:i}={})=>({install(r){t?vo.setup({apiClient:t,fetchUsers:e}):console.error("[BCF Components Plugin] No api client provided. You must provide an api client for the components to work properly."),i?Object.entries(_Fi).forEach(([o,n])=>{i.global.mergeLocaleMessage(o,n)}):console.warn("[BCF Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(vWe).forEach(([o,n])=>{r.component(o,n)})}}),OFi={title:"Building Maker",back:"Zur\xFCck",list:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",createButton:"Neues Projekt",updateButton:"Umbenennen",deleteButton:"L\xF6schen"},form:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",input:"Name des Geb\xE4udes",error:"Ung\xFCltiger Name",createButton:"Erstellen",updateButton:"Best\xE4tigen"},view:{addStoreyButton:"Etage",addPlanButton:"Grundriss",closeButton:"Fertigstellen",submitFilesButton:"Best\xE4tigen"},storeyForm:{title:"Neue Etage",input:"Name",error:"Ung\xFCltiger Name",cancelButton:"Abbrechen",submitButton:"Best\xE4tigen"}},UFi={creationFormTitle:"Ordner erstellen",renameFormPlaceholder:"Datei- / Ordnernam",nameInputPlaceholder:"Ordnername",emptyFolder:"Dieser Ordner ist leer",newFolderSuccess:"Neuer Ordner erstellt",renameFolderSuccess:"Umbenannter Ordner",deleteFolderSuccess:"Ordner gel\xF6scht",newFileSuccess:"Datei hinzugef\xFCgt",renameFileSuccess:"Umbenannte Datei",deleteFileSuccess:"Datei gel\xF6scht",nameInputErrorMessage:"Ung\xFCltiger name",cancel:"Abbrechen",submit:"Best\xE4tigen",buttonText:"Neuer Ordner",addFileButtonText:"Datei laden",rename:"Umbenennen",view:"Sehen",download:"Herunterladen",delete:"L\xF6schen",deleteTitle:"Dateien l\xF6schen",deleteDetail:"Sie sind im Begriff, die folgenden Dateien / Ordner endg\xFCltig zu l\xF6schen"},NFi={BuildingMaker:OFi,FileManager:UFi},jFi={t:{back:"Back",cancel:"Cancel",create:"Create",delete:"Delete",download:"Download",finish:"Finish",rename:"Rename",search:"Search",see:"View",storey:"Storey",validate:"Validate"}},HFi={title:"Building Maker",list:{text:"Create and edit storeys, then download your PDFs.",new:"New project"},form:{input:"Building name",error:"Invalid"},view:{addStorey:"Add Storey",addFile:"Add File",addPlan:"Add Plan"},storeyForm:{title:"New storey",input:"Name",error:"Invalid name"}},VFi={creationFormTitle:"Create folder",renameFormPlaceholder:"Folder/File name",nameInputPlaceholder:"Folder name",emptyFolder:"This folder is empty",newFolderSuccess:"New folder created",renameFolderSuccess:"Folder renamed",deleteFolderSuccess:"Folder deleted",newFileSuccess:"File added",renameFileSuccess:"File renamed",deleteFileSuccess:"File deleted",nameInputErrorMessage:"Invalid name",buttonText:"New folder",addFileButtonText:"Upload a file",deleteTitle:"Deleting Files",deleteDetail:"You are about to permanently delete the following files / folders",dmsRoot:"Root of the project's DMS",pdfPageSelectorTitle:"Select a page"},zFi={title:"Meta-Building Structure",tab:{structure:"Structure",zones:"Zones",equipments:"Equipments"},StoreySelector:{placeholder:"Select a storey"}},qFi={title:"Photosphere Building"},GFi={BIMDataComponents:jFi,BuildingMaker:HFi,FileManager:VFi,MetaBuildingStructure:zFi,PhotosphereBuilding:qFi},QFi={title:"Building Maker",back:"Vuelta",list:{text:"Cree y edite los pisos despu\xE9s cargue los PDF.",createButton:"Nuevo proyecto",updateButton:"Renombrar",deleteButton:"Suprimir"},form:{text:"Cree y edite los pisos despu\xE9s cargue los PDF.",input:"Nombre del edificio",error:"Nombre no v\xE1lido",createButton:"Crear",updateButton:"Validar"},view:{addStoreyButton:"Piso",addPlanButton:"Plano",closeButton:"Terminar",submitFilesButton:"Validar"},storeyForm:{title:"Nuevo piso",input:"Nombre",error:"Nombre no v\xE1lido",cancelButton:"Anular",submitButton:"Validar"}},KFi={creationFormTitle:"Crear un archivo",renameFormPlaceholder:"Nombre de archivo / carpeta",nameInputPlaceholder:"Nombre de la carpeta",emptyFolder:"Esta carpeta est\xE1 vac\xEDa",newFolderSuccess:"Nueva carpeta creada",renameFolderSuccess:"Carpeta renombrada",deleteFolderSuccess:"Carpeta eliminada",newFileSuccess:"Archivo agregado",renameFileSuccess:"Archivo renombrado",deleteFileSuccess:"Archivo eliminado",nameInputErrorMessage:"Nombre inv\xE1lida",cancel:"Cancelar",submit:"Validar",buttonText:"Carpeta nueva",addFileButtonText:"Cargar un archivo",rename:"Renombrar",view:"Ver",download:"Descargar",delete:"Borrar",deleteTitle:"Eliminar archivos",deleteDetail:"Est\xE1 a punto de eliminar permanentemente los siguientes archivos / carpetas"},WFi={BuildingMaker:QFi,FileManager:KFi},ZFi={t:{back:"Retour",cancel:"Annuler",create:"Cr\xE9er",delete:"Supprimer",download:"T\xE9l\xE9charger",finish:"Terminer",rename:"Renommer",search:"Rechercher",see:"Voir",storey:"\xC9tage",validate:"Valider"}},JFi={title:"Building Maker",list:{text:"Cr\xE9ez et \xE9ditez les \xE9tages puis t\xE9l\xE9chagez vos PDF.",new:"Nouveau projet"},form:{input:"Nom du b\xE2timent",error:"Nom invalide"},view:{addStorey:"Ajouter un \xC9tage",addFile:"Ajouter un fichier",addPlan:"Ajouter un plan"},storeyForm:{title:"Nouvel \xE9tage",input:"Nom",error:"Nom invalide"}},XFi={creationFormTitle:"Cr\xE9er un dossier",renameFormPlaceholder:"Nom du fichier/dosier",nameInputPlaceholder:"Nom du dossier",emptyFolder:"Ce dossier est vide",newFolderSuccess:"Nouveau dossier cr\xE9\xE9",renameFolderSuccess:"Dossier renomm\xE9",deleteFolderSuccess:"Dossier supprim\xE9",newFileSuccess:"Fichier ajout\xE9",renameFileSuccess:"Fichier renomm\xE9",deleteFileSuccess:"Fichier supprim\xE9",nameInputErrorMessage:"Nom invalide",buttonText:"Nouveau dossier",addFileButtonText:"Charger un fichier",deleteTitle:"Supression de fichiers",deleteDetail:"Vous \xEAtes sur le point de supprimer d\xE9finitivement les fichiers/dossiers suivants",dmsRoot:"Racine de la GED du projet",pdfPageSelectorTitle:"S\xE9lectionner une page"},YFi={title:"Structure M\xE9ta-Building",tab:{structure:"Structure",zones:"Zones",equipments:"\xC9quipements"},StoreySelector:{placeholder:"S\xE9lectionner un \xE9tage"}},$Fi={title:"Photosph\xE8re Building"},eOi={BIMDataComponents:ZFi,BuildingMaker:JFi,FileManager:XFi,MetaBuildingStructure:YFi,PhotosphereBuilding:$Fi},tOi={title:"Building Maker",back:"Reso",list:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",createButton:"Nuovo progetto",updateButton:"Rinominare",deleteButton:"Eliminare"},form:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",input:"Nome della costruzione",error:"Nome non corretto",createButton:"Creare",updateButton:"Convalidare"},view:{addStoreyButton:"Piano",addPlanButton:"Mappa",closeButton:"Finire",submitFilesButton:"Convalidare"},storeyForm:{title:"Nuovo piano",input:"Nome",error:"Nome non corretto",cancelButton:"Annullare",submitButton:"Convalidare"}},iOi={creationFormTitle:"Crea una cartella",renameFormPlaceholder:"Nome file/cartella",nameInputPlaceholder:"Nome della cartella",emptyFolder:"Questa cartella \xE8 vuota",newFolderSuccess:"Nuova cartella creata",renameFolderSuccess:"Cartella rinominata",deleteFolderSuccess:"Cartella eliminata",newFileSuccess:"File aggiunto",renameFileSuccess:"File rinominato",deleteFileSuccess:"File cancellato",nameInputErrorMessage:"Nome non valido",cancel:"Annulla",submit:"Invia",buttonText:"Nuova cartella",addFileButtonText:"Carica un file",rename:"Rinominare",view:"Vedere",download:"Scaricare",delete:"Cancellare",deleteTitle:"Eliminazione di file",deleteDetail:"Stai per eliminare definitivamente i seguenti file/cartelle"},rOi={BuildingMaker:tOi,FileManager:iOi},oOi={de:NFi,en:GFi,es:WFi,fr:eOi,it:rOi},nOi=({i18nPlugin:t}={})=>({install(e){t?Object.entries(oOi).forEach(([i,r])=>{t.global.mergeLocaleMessage(i,r)}):console.warn("[BIMData Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(j4i).forEach(([i,r])=>{e.component(i,r)})}}),sOi={beforeMount(t,e){if(typeof e.value!="function")throw Error(`click away directive needs function, got ${typeof e.value}`);t.clickAwayHandler=i=>{(i.path||i.composedPath&&i.composedPath()).find(r=>r===t)||e.value()},window.addEventListener("mousedown",t.clickAwayHandler,!0)},unmounted(t){window.removeEventListener("mousedown",t.clickAwayHandler,!0),delete t.clickAwayHandler}},aOi=Object.freeze(Object.defineProperty({__proto__:null,BIMDataClickAway:Rh,BIMDataClickInputAway:sOi},Symbol.toStringTag,{value:"Module"})),lOi=t=>({install(e){Object.entries(d8t).forEach(([i,r])=>{e.component(i,r)}),Object.entries(aOi).forEach(([i,r])=>e.directive(i.split("BIMData")[1],r))}}),cOi={name:"LiWrapper",render(){return Ln("li",this.$slots.default())}};function dOi(t,e){var i=new Set([]);return t.forEach(r=>{e.has(r)||i.add(r)}),i}const n1=Sa("id"),uOi=({contextMenu:t,objects:e=[],state:i=t.$viewer.state,pictos:r})=>[{name:"selectAll",get group(){return t.groupPositions.select},position:1,get label(){return t.$t("context_menu.select_all")},get picto(){return r.get(this.name)},execute:()=>i.selectObjects(e.filter(bh(Sr("visible"),Eg("selected"))).map(n1)),predicate:()=>e.some(bh(Sr("visible"),Eg("selected")))},{name:"deselectAll",get group(){return t.groupPositions.select},position:2,get label(){return t.$t("context_menu.deselect_all")},get picto(){return r.get(this.name)},execute:()=>i.deselectObjects(e.filter(Sr("selected")).map(n1)),predicate:()=>e.some(Sr("selected"))},{name:"selectSimilar",get group(){return t.groupPositions.select},position:3,get label(){return t.$t("context_menu.select_similar")},get picto(){return r.get(this.name)},execute(){const o=e.filter(n=>n.visible&&n.type===this.selectedObject.type&&n.id!==this.selectedObject.id).map(n1);i.selectObjects(o)},selectedObject:null,predicate(){const o=e.filter(bh(Sr("visible"),Sr("selected")));return o.length===1&&o[0].type!==void 0?(this.selectedObject=o[0],!0):(this.selectedObject=null,!1)}},{name:"reverseSelection",get label(){return t.$t("context_menu.reverse_selection")},get group(){return t.groupPositions.select},position:4,execute:()=>{const o=new Set(e.filter(Sr("selected")).map(n1)),n=new Set(e.filter(Sr("visible")).map(n1));i.selectObjects(Array.from(dOi(n,o)),{exclusive:!0})},predicate:()=>e.some(bh(Eg("selected"),Sr("visible")))&&e.some(bh(Sr("selected"),Sr("visible")))},{name:"showAll",get group(){return t.groupPositions.visibility},position:1,get label(){return t.$t("context_menu.show_all")},get picto(){return r.get(this.name)},execute:()=>i.showObjects(e.filter(Eg("visible")).map(n1)),predicate:()=>e.some(Eg("visible"))},{name:"hide",get group(){return t.groupPositions.visibility},position:2,get label(){return t.$t("context_menu.hide")},get picto(){return r.get(this.name)},objectsToHide:null,execute(){const o=this.objectsToHide.filter(Sr("selected"));o.length>0&&i.deselectObjects(o.map(n1)),i.hideObjects(this.objectsToHide.map(n1))},predicate(){return this.objectsToHide=e.filter(bh(Sr("selected"),Sr("visible"))),this.objectsToHide.length>0}},{name:"hideAll",get group(){return t.groupPositions.visibility},position:3,get label(){return t.$t("context_menu.hide_all")},execute:()=>{const o=e.filter(Sr("visible"));o.some(Sr("selected"))&&i.deselectObjects(o.filter(Sr("selected")).map(n1)),i.hideObjects(o.map(n1))},predicate:()=>e.some(Sr("visible"))}].filter(o=>o.predicate()),hOi={components:{LiWrapper:cOi},inject:["$viewer"],data(){return{defaultPrevented:!1,displayed:!1,top:null,bottom:null,left:null,width:200,nextCommandId:1,currentCommands:[],contextCommands:[],registeredCommands:[],groupPositions:{select:10,visibility:20},asyncPredicateRunning:!1}},computed:{position(){return{top:this.top?this.top+"px":"unset",bottom:this.bottom?this.bottom+"px":"unset",left:this.left+"px",width:this.width+"px"}}},watch:{displayed(t){t?document.addEventListener("keydown",this.onKeyDown):document.removeEventListener("keydown",this.onKeyDown)}},created(){this.$viewer.contextMenu=this,this.asyncPredicates=new Set},methods:{onKeyDown(t){t.key==="Escape"&&this.away()},setPosition(t){const e=(document.fullscreenElement?document.fullscreenElement:this.$parent.$el).getBoundingClientRect();this.left=t.clientX-e.left,this.top=t.clientY-e.top,this.left+this.width>e.width&&(this.left=this.left-this.width),t.clientY>e.top+e.height/2?(this.bottom=e.height-this.top,this.top=null):this.bottom=null},typeCheckCommand(t={}){let e=null;if((!t.execute||typeof t.execute!="function")&!t.component&&(e="Cannot register context menu command. A command must have an execute function or a component property."),t.label||(e="Cannot register context menu command. A command must have a label."),e)throw console.error(e),new Error(e);return t.id=this.nextCommandId++,t},open(t){this.currentCommands=[],this.setPosition(t),this.originEvent=t,t.preventDefault(),this.setCurrentCommands(),this.groupCurrentCommands(),this.defaultPrevented=!1,this.displayed=!0,document.fullscreenElement?(this.$el.parentElement.removeChild(this.$el),this.adoptiveParent=document.fullscreenElement,this.adoptiveParent.appendChild(this.$el)):this.adoptiveParent&&this.adoptiveParent!==this.$viewer.globalContext.el&&(this.adoptiveParent.removeChild(this.$el),this.$viewer.globalContext.el.appendChild(this.$el),this.adoptiveParent=null)},setCurrentCommands(){this.asyncPredicates.clear(),this.asyncPredicateRunning=!1,this.defaultPrevented||this.registeredCommands.forEach(async t=>{if(typeof t.predicate=="function"){const e=t.predicate(this.$viewer.globalContext.activeLocalContext);if(e===!0)this.currentCommands.push(t);else if(typeof e?.then=="function"){this.asyncPredicates.add(e),this.asyncPredicateRunning=!0;const i=await e;this.asyncPredicates.has(e)&&(this.asyncPredicates.delete(e),this.asyncPredicateRunning=this.asyncPredicates.size>0,i===!0&&this.currentCommands.push(t))}}else this.currentCommands.push(t)}),this.currentCommands.push(...this.contextCommands),this.contextCommands=[]},getDefaultCommands({objects:t=[],state:e=this.$viewer.state,context:i=null}){const r=new Map;return i&&this.$viewer.shortcutManager.getShortcuts(i).forEach(o=>r.set(o.name,o.key)),uOi({contextMenu:this,objects:t,state:e,pictos:r})},executeCommand(t){if(t.execute&&(t.execute(this.originEvent),this.displayed=!1),t.component&&!t.menu)throw new Error("Command with component property must have a `menu` property")},away(){this.displayed=!1},groupCurrentCommands(){const t=new Map;this.currentCommands.forEach(i=>{(i.group===null||i.group===void 0)&&(i.group=0),t.has(i.group)?t.get(i.group).push(i):t.set(i.group,[i])}),t.forEach(i=>i.sort((r,o)=>(r.position=r.position||0,o.position=o.position||0,r.position-o.position)));const e=[...t.keys()].sort((i,r)=>i-r).map(i=>t.get(i)).flat();this.currentCommands=e},isGroupIntersection(t){if(t===0)return!1;const e=this.currentCommands[t-1],i=this.currentCommands[t];return e.group<i.group},registerContextCommand(t){const e=this.typeCheckCommand(t);return this.contextCommands.push(e),t.id},registerCommand(t){const e=this.typeCheckCommand(t);return this.registeredCommands.push(e),t.id},unregisterCommand(t){return this.registeredCommands.find(e=>e.id===t)?(this.registeredCommands=this.registeredCommands.filter(e=>e.id!==t),!0):!1},preventDefault(){this.defaultPrevented=!0}}},pOi={key:0,class:"separator"},fOi={class:"menu-text"},gOi={key:1,class:"menu-picto"},mOi={key:0,class:"context-menu__spinner"};function AOi(t,e,i,r,o,n){const s=D("BIMDataIconChevron"),a=D("LiWrapper"),l=D("BIMDataSpinner"),c=sr("click-away");return o.displayed&&(o.currentCommands.length||o.asyncPredicateRunning)?Ot((T(),O("ul",{key:0,class:"bimdata-list context-menu",style:Pe(n.position)},[(T(!0),O(Pt,null,Xt(o.currentCommands,(d,u)=>(T(),te(a,{key:d.label,class:"context-menu__element",onClick:h=>n.executeCommand(d)},{default:G(()=>[n.isGroupIntersection(u)?(T(),O("div",pOi)):ye("",!0),k("div",fOi,$(d.label),1),!d.component&&d.picto?(T(),O("span",gOi,$(d.picto),1)):d.component?(T(),te(s,{key:2,size:"xxs",class:"fill-primary"})):ye("",!0)]),_:2},1032,["onClick"]))),128)),o.asyncPredicateRunning?(T(),O("li",mOi,[_(l)])):ye("",!0)],4)),[[c,n.away]]):ye("",!0)}const vOi=W(hOi,[["render",AOi],["__scopeId","data-v-5b87d4a3"]]),bOi={name:"ViewerHeader",inject:["$viewer"],props:{visible:{type:Boolean,default:!0}},setup(){const t=Ut("$viewer"),e=Ta(new Map),i=o=>{if(!o.name)throw new TypeError("[Viewer Header] Content must have a name");if(e.has(o.name))throw new Error(`[Viewer Header] Content with name ${o.name} already exists`);e.set(o.name,o)},r=o=>e.has(o)?(e.delete(o),!0):!1;return{logo:t.uiSettings.bimdataLogo!==!1,version:t.uiSettings.version!==!1?t.version:null,headerContent:e,headerRightContentComponents:ut(()=>Array.from(e.values()).filter(o=>o.position==="right").sort((o,n)=>o.order-n.order).map(o=>o.component)),headerLeftContentComponents:ut(()=>Array.from(e.values()).filter(o=>o.position==="left").sort((o,n)=>o.order-n.order).map(o=>o.component)),addContent:i,removeContent:r}}},yOi={class:"viewer-header"},wOi={class:"viewer-header__content"},COi={class:"viewer-header__content__left"},xOi={class:"viewer-header__content__right"},kOi={key:0,class:"m-l-6 flex items-center"},MOi={key:1,class:"viewer-header__version"};function POi(t,e,i,r,o,n){const s=D("BIMDataIllustration");return Ot((T(),O("div",yOi,[k("div",wOi,[k("div",COi,[(T(!0),O(Pt,null,Xt(r.headerLeftContentComponents,a=>(T(),te(No(a),{key:a.name}))),128))]),k("div",xOi,[(T(!0),O(Pt,null,Xt(r.headerRightContentComponents,a=>(T(),te(No(a),{key:a.name}))),128))])]),r.logo||r.version?(T(),O("div",kOi,[r.logo?(T(),te(s,{key:0,name:"logo",width:"30px",height:"30px"})):ye("",!0),r.version?(T(),O("div",MOi,$(r.version),1)):ye("",!0)])):ye("",!0)],512)),[[Ai,i.visible]])}const EOi=W(bOi,[["render",POi],["__scopeId","data-v-5c9ea6b6"]]),SOi={emits:["resize"],setup(t,{emit:e}){return{onResizerMousedown:i=>{i.preventDefault();let r=i.clientX;const o=s=>{s.preventDefault();const a=s.clientX-r;r=s.clientX,e("resize",a)},n=s=>{s.preventDefault(),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",o),window.addEventListener("mouseup",n)}}}},BOi={class:"bimdata-separator"};function IOi(t,e,i,r,o,n){return T(),O("div",BOi,[e[1]||(e[1]=k("div",{class:"bimdata-separator__line"},null,-1)),k("div",{class:"bimdata-separator__resizer",onMousedown:e[0]||(e[0]=(...s)=>r.onResizerMousedown&&r.onResizerMousedown(...s))},null,32)])}const TOi=W(SOi,[["render",IOi],["__scopeId","data-v-79a3b3af"]]),ROi={components:{Separator:TOi},props:{position:{type:String,required:!0,validator(t){return["left","right"].includes(t)}},sidePanel:{type:Object,required:!0,validator(t){if(t.width&&(typeof t.width!="number"||t.width<0))return console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof t.width}`),!1;const e=typeof t?.component=="object";return e||console.error("[GlobalSidePanel] sidePanel must have a component property"),e}}},setup(t){const e=Oe(null),i=Oe(t.sidePanel.width??400),r=(o,n=1)=>{const s=i.value+o*n;i.value=Math.max(0,s)};return Ht(()=>t.sidePanel,()=>{Object.defineProperty(t.sidePanel,"width",{get(){return i.value},set(o){if(typeof o!="number"||o<=0){console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof o}`);return}i.value=o}}),Object.defineProperty(t.sidePanel,"componentInstance",{get(){return e.value},enumerable:!0})},{immediate:!0}),{componentInstance:e,width:i,onResize:r}}},DOi={class:"bimdata-global-side-panel__component"};function LOi(t,e,i,r,o,n){const s=D("Separator");return T(),O("div",{class:"bimdata-global-side-panel",style:Pe(`width: ${r.width}px`)},[i.sidePanel.resizable&&i.position==="right"?(T(),te(s,{key:0,onResize:e[0]||(e[0]=a=>r.onResize(a,-1))})):ye("",!0),k("div",DOi,[(T(),te(No(i.sidePanel.component),{ref:"componentInstance"},null,512))]),i.sidePanel.resizable&&i.position==="left"?(T(),te(s,{key:1,onResize:e[1]||(e[1]=a=>r.onResize(a))})):ye("",!0)],4)}const _Oi=W(ROi,[["render",LOi],["__scopeId","data-v-82d0d4cb"]]),FOi={name:"BimdataViewer",components:{ContextMenu:vOi,ViewerHeader:EOi,ModalManager:yEe,GlobalSidePanel:_Oi},setup(){const t=Ut("$viewer"),{globalContext:e,shortcutManager:i}=t;So(()=>{i&&i.destroy(),e.hub.clear()}),Br(()=>{t.pluginManager.runPluginsScripts(t)});const r=ut(()=>{var p;return t.uiSettings.bimdataLogo!==!1&&(e.localContexts.length!==1||((p=e.localContexts[0].window)==null?void 0:p.logoAndVersion))}),o=ut(()=>{var p;return t.uiSettings.version!==!1&&(e.localContexts.length!==1||(p=e.localContexts[0].window)!=null&&p.logoAndVersion)?t.version:null}),n=ut(()=>e.leftSidePanel),s=ut(()=>e.rightSidePanel),a=ut(()=>{var p;const g=t.uiSettings.header!==!1,f=e.localContexts.length===1&&((p=e.localContexts[0].window)==null?void 0:p.header)===!1,A=!!(n.value||s.value);return g&&(!f||A)}),l=t.uiSettings.contextMenu!==!1,c=Oe(null);function d(p){l&&c.value.open(p)}function u(){t.shortcutManager.active=!0}function h(){t.shortcutManager.active=!1}return{Layout:t.layout.areas.component,onContextMenu:d,onMouseenter:u,onMouseleave:h,isHeaderVisible:a,viewerTemplateRef:e.templateRef,modalManagerTemplateRef:e.modalManagerTemplateRef,headerTemplateRef:e.headerTemplateRef,contextMenuTemplateRef:c,contextMenuEnabled:l,bimdataLogoOnSingleWindow:r,viewerVersionOnSingleWindow:o,version:t.version,loading:ut(()=>e.loading),spinner:ut(()=>e.spinner),leftSidePanel:n,rightSidePanel:s}}},OOi={key:1,class:"bimdata-context-loading-overlay",style:{"z-index":"3"}},UOi={key:2,class:"viewer__logo"},NOi={key:1,class:"version m-t-6"};function jOi(t,e,i,r,o,n){const s=D("ModalManager"),a=D("ContextMenu"),l=D("ViewerHeader"),c=D("GlobalSidePanel"),d=D("BIMDataSpinner"),u=D("BIMDataIllustration");return T(),O("div",{id:"bimdata-viewer",ref:"viewerTemplateRef",class:"bimdata-viewer bimdata-design-system bimdata-scrollbar",onContextmenu:e[0]||(e[0]=(...h)=>r.onContextMenu&&r.onContextMenu(...h)),onMouseenter:e[1]||(e[1]=(...h)=>r.onMouseenter&&r.onMouseenter(...h)),onMouseleave:e[2]||(e[2]=(...h)=>r.onMouseleave&&r.onMouseleave(...h))},[_(s,{ref:"modalManagerTemplateRef"},null,512),r.contextMenuEnabled?(T(),te(a,{key:0,ref:"contextMenuTemplateRef"},null,512)):ye("",!0),_(l,{ref:"headerTemplateRef",visible:r.isHeaderVisible},null,8,["visible"]),k("div",{class:"bimdata-viewer__content",style:Pe(r.isHeaderVisible?"height: calc(100% - var(--bimdata-viewer-header-height, 40px))":"height: 100%")},[r.leftSidePanel?(T(),te(c,{key:0,"side-panel":r.leftSidePanel,position:"left"},null,8,["side-panel"])):ye("",!0),(T(),te(No(r.Layout),{style:"height: 100%; flex-grow: 1;"})),r.rightSidePanel?(T(),te(c,{key:1,"side-panel":r.rightSidePanel,position:"right"},null,8,["side-panel"])):ye("",!0)],4),r.loading?(T(),O("div",OOi,[r.spinner&&r.spinner.component?(T(),te(No(r.spinner.component),bd(dl({key:0},r.spinner.props)),null,16)):(T(),te(d,{key:1,size:"40px",border:"5px"}))])):ye("",!0),!r.isHeaderVisible&&(r.bimdataLogoOnSingleWindow||r.viewerVersionOnSingleWindow)?(T(),O("div",UOi,[r.bimdataLogoOnSingleWindow?(T(),te(u,{key:0,name:"logo"})):ye("",!0),r.viewerVersionOnSingleWindow?(T(),O("div",NOi,$(r.version),1)):ye("",!0)])):ye("",!0)],544)}const HOi=W(FOi,[["render",jOi],["__scopeId","data-v-0c1c941a"]]),VOi=["src"],zOi={class:"bimdata-models__header"},qOi={key:0,class:"bimdata-models__header__loader"},GOi={class:"bimdata-models__header__picto"},QOi={class:"bimdata-models__header__name"},KOi={key:0,class:"bimdata-models__header__name--empty"},WOi={key:1,class:"bimdata-models__header__name--empty"},ZOi={key:3},JOi=["onMousemove","onClick"],XOi={__name:"Models",props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:"350px"}},setup(t){const e=t,i=Ut("$viewer"),r=Oe(),o=Oe(0),n=Oe(0),s=Oe(),a=Ao([]),l=Oe(!1),c=ut(()=>i.localContext.loadedModels),d=ut(()=>i.localContext.loadedModelIds),u=ut(()=>i.localContext.loadingModelIds),h=ut(()=>i.localContext.multiModel),p=ut(()=>(e.customFilter?a.value.filter(e.customFilter):a.value).map(C=>c.value.find(M=>{var P;return((P=M.document)==null?void 0:P.head_id)!=null&&M.document.head_id===C.document.id})??C)),g=C=>d.value.includes(C),f=C=>u.value.includes(C),A=ut(()=>{var C;const{x:M,y:P}=((C=s.value)==null?void 0:C.getBoundingClientRect())??{x:0,y:0};return`top:${n.value-P}px; left:${o.value-M}px;`}),m=C=>{!h.value&&g(C.id)||u.value.length>0||(i.localContext.loadedModelIds.includes(C.id)?i.localContext.unloadModels([C.id]):i.localContext.loadModels([C.id]))},v=C=>{switch(C){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},y=(C,M)=>{C!=null&&C.viewer_360_file&&(o.value=M.clientX,n.value=M.clientY),r.value=C?.viewer_360_file},b=async C=>{l.value=!0;try{return(await i.api.apiClient.modelApi.getModels(i.api.cloudId,i.api.projectId,void 0,void 0,C)).filter(M=>i.state.models.some(P=>P.archived)||!M.archived).sort(pp("updated_at",!1))}catch(M){console.error("[Models] Cannot get project models. Error: ",M)}finally{l.value=!1}return[]},w=C=>{var M;return((M=C.children)==null?void 0:M.some(P=>g(P.id)))??!1};return b(i.localContext.modelTypes).then(C=>{a.value=C}),(C,M)=>{const P=D("BIMDataSpinner"),E=D("BIMDataIconModel3D"),S=D("BIMDataTextbox"),I=D("BIMDataCheckbox"),R=D("BIMDataRadio"),L=D("BIMDataIcon"),j=D("BIMDataDropdownList");return T(),O("div",{ref_key:"templateRef",ref:s,class:ke(["bimdata-models",{"bimdata-models--window-positioning":t.windowPositioning}])},[r.value?(T(),O("div",{key:0,class:"bimdata-models__preview",style:Pe(A.value)},[k("img",{src:r.value},null,8,VOi)],4)):ye("",!0),_(j,{style:Pe(`--bimdata-models-width: ${t.width};`),width:t.width,list:p.value,"element-key":"id","per-page":40,loading:l.value,class:"bimdata-models__list",disabled:p.value.length===0,onElementClick:m},{header:G(({isOpen:H})=>[k("div",zOi,[l.value||u.value.length>0?(T(),O("div",qOi,[_(P)])):(T(),O(Pt,{key:1},[k("div",GOi,[_(E)]),k("div",{class:ke(["bimdata-models__header__number bimdata-info-length",{"bimdata-models__header__number--empty":d.value.length===0}])},[k("span",null,$(d.value.length),1)],2),k("div",QOi,[p.value.length===0?(T(),O("span",KOi,$(C.$t("model.no_model")),1)):d.value.length===0?(T(),O("span",WOi,$(C.$t("model.no_loaded_model")),1)):d.value.length===1?(T(),te(S,{key:2,text:c.value[0].name,tooltip:!H},null,8,["text","tooltip"])):d.value.length>1?(T(),O("span",ZOi,$(C.$t("model.selected_models")),1)):ye("",!0)])],64))])]),element:G(({element:H,close:U})=>[k("div",{class:"bimdata-models__model",onMousemove:z=>t.preview&&y(H,z),onMouseout:M[0]||(M[0]=z=>t.preview&&y()),onClick:()=>{!h.value&&!g(H.id)&&U()}},[h.value?(T(),te(I,{key:0,"model-value":g(H.id)||w(H),disabled:H.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])):(T(),te(R,{key:1,"model-value":g(H.id)||w(H),disabled:H.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])),_(L,{margin:"0 calc(var(--spacing-unit) / 2)",name:v(H.status),size:"xs",class:ke({"fill-success":H.status==="C","fill-high":H.status==="E"})},null,8,["name","class"]),_(S,{class:ke({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":H.status!=="C"||u.value.length>0}),text:H.name,width:`calc(100% -
|
|
5525
|
+
`),onMouseenter:e[0]||(e[0]=(...h)=>r.onMouseEnter&&r.onMouseEnter(...h)),onMouseleave:e[1]||(e[1]=(...h)=>r.onMouseLeave&&r.onMouseLeave(...h))},[_(s,{ref:"modalManagerTemplateRef"},null,512),k("div",hFi,[r.windowPlugins.leftSidePanel?(T(),te(a,{key:0,plugin:r.windowPlugins.leftSidePanel},null,8,["plugin"])):ye("",!0),k("div",pFi,[(T(!0),O(Pt,null,Xt(r.windowPlugins.free,h=>(T(),te(l,{key:h.name,class:ke({"window-container__content__center__viewer":h.isViewer}),plugin:h},null,8,["class","plugin"]))),128)),_(c,{position:"left",plugins:r.windowPlugins.leftButtonColumn},null,8,["plugins"]),_(c,{position:"right",plugins:r.windowPlugins.rightButtonColumn},null,8,["plugins"])]),r.windowPlugins.rightSidePanel?(T(),te(a,{key:1,plugin:r.windowPlugins.rightSidePanel},null,8,["plugin"])):ye("",!0)]),r.loading?(T(),O("div",fFi,[r.spinner&&r.spinner.component?(T(),te(No(r.spinner.component),bd(dl({key:0},r.spinner.props)),null,16)):(T(),te(d,{key:1,size:"20px",border:"3px"}))])):ye("",!0),r.layoutSettingsDisplayed?(T(),O("div",gFi,[_(u)])):ye("",!0)],36)}const AFi=W(uFi,[["render",mFi],["__scopeId","data-v-4d6af796"]]);let vFi=class{constructor(t=!0){const e=n_i(_le,null,{resizable:t});e.registerContent("default",AFi),this.settings=Ta({edit:!1,swap:!1,full:!1}),this.areas=e}get resizable(){return this.areas.resizable}set resizable(t){this.areas.resizable=t}apply(t=null){this.areas.layout=t?s_i(t):null}copy(t,e=!0){return a_i(this.areas.layout,t,e)}open({ratio:t,direction:e,insertAfter:i,windowName:r=null,windowState:o=null,localContextId:n=null}={}){const s=r?{options:{windowName:r,windowState:o}}:null;return n===null?this.areas.splitLayout(t,e,i,s):this.areas.split(n,t,e,i,s)}swap(t,e){return this.areas.swap(t,e)}close(t){return this.areas.delete(t)}compare(t,e){var i,r;if(!t&&!e)return!0;if(!t||!e)return!1;if(typeof t=="string"&&typeof e=="string")return t===e;if(typeof t=="string"||typeof e=="string")return!1;if(t.windowName&&e.windowName){if(t.windowName!==e.windowName)return!1;const o=new Set((i=t.windowState)==null?void 0:i.modelIds),n=new Set((r=e.windowState)==null?void 0:r.modelIds);return o.size===n.size&&[...o].every(s=>n.has(s))}return t.windowName||e.windowName||t.direction!==e.direction||t.children.length!==e.children.length?!1:t.children.every((o,n)=>this.compare(o,e.children[n]))}};const bFi="2.11.1-beta.1",yFi={version:bFi};class wFi{constructor({plugins:e,api:i,ui:r,locale:o="fr"}){this.pluginManager=new vTi(e),this.windowManager=new yTi,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new lLi(i),this.globalContext=new YVe(this),this.state=kLi(this),this.shortcutManager=G_e(this.state),this.uiSettings=r||{},this.i18n=new JVe(o),this._contextMenu=null,this.layout=new vFi(this.uiSettings.resizable!==!1),this.localContext=null,window.$viewer=this}get version(){return yFi.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||z_e}set contextMenu(e){this._contextMenu=e}get registeredWindows(){return[...this.windowManager.registeredWindows.keys()]}get registeredPlugins(){return[...this.pluginManager.registeredPlugins.keys()]}get pluginsCfg(){return this.pluginManager.cfg}registerPlugin(e){this.pluginManager.registerPlugin(e),this.windowManager.registerAndAddPluginsToWindows([e])}}function CFi(t,e={}){e.backgroundColor&&(t.style.setProperty("--bimdata-viewer-background-color",e.backgroundColor),e.backgroundColor==="transparent"&&t.style.setProperty("--areas-separator-color","transparent")),e.colorPrimary&&t.style.setProperty("--color-primary",e.colorPrimary),e.colorPrimaryLighter&&t.style.setProperty("--color-primary-lighter",e.colorPrimaryLighter),e.colorPrimaryLight&&t.style.setProperty("--color-primary-light",e.colorPrimaryLight),e.colorPrimaryDark&&t.style.setProperty("--color-primary-dark",e.colorPrimaryDark),e.colorSecondary&&t.style.setProperty("--color-secondary",e.colorSecondary),e.colorSecondaryLighter&&t.style.setProperty("--color-secondary-lighter",e.colorSecondaryLighter),e.colorSecondaryLight&&t.style.setProperty("--color-secondary-light",e.colorSecondaryLight),e.colorSecondaryDark&&t.style.setProperty("--color-secondary-dark",e.colorSecondaryDark),e.colorSilverLight&&t.style.setProperty("--color-silver-light",e.colorSilverLight),e.colorSilver&&t.style.setProperty("--color-silver",e.colorSilver),e.colorSilverDark&&t.style.setProperty("--color-silver-dark",e.colorSilverDark),e.colorGraniteLight&&t.style.setProperty("--color-granite-light",e.colorGraniteLight),e.colorGranite&&t.style.setProperty("--color-granite",e.colorGranite),e.colorSuccess&&t.style.setProperty("--color-success",e.colorSuccess),e.colorSuccessLighter&&t.style.setProperty("--color-success-Lighter",e.colorSuccessLighter),e.colorSuccessLight&&t.style.setProperty("--color-success-Light",e.colorSuccessLight),e.colorSuccessDark&&t.style.setProperty("--color-success-Dark",e.colorSuccessDark),e.colorWarning&&t.style.setProperty("--color-warning",e.colorWarning),e.colorWarningLighter&&t.style.setProperty("--color-warning-Lighter",e.colorWarningLighter),e.colorWarningLight&&t.style.setProperty("--color-warning-Light",e.colorWarningLight),e.colorWarningDark&&t.style.setProperty("--color-warning-Dark",e.colorWarningDark),e.colorHigh&&t.style.setProperty("--color-high",e.colorHigh),e.colorHighLighter&&t.style.setProperty("--color-high-lighter",e.colorHighLighter),e.colorHighLight&&t.style.setProperty("--color-high-light",e.colorHighLight),e.colorHighDark&&t.style.setProperty("--color-high-dark",e.colorHighDark),e.colorText&&t.style.setProperty("--color-text",e.colorText),(!e.backgroundColor||e.backgroundColor!=="transparent")&&t.style.setProperty("--areas-separator-color","rgba(216, 216, 216, 1)"),e.headerHeight!=null&&t.style.setProperty("--bimdata-viewer-header-height",e.headerHeight),t.style.setProperty("--areas-background-color","transparent")}const xFi=Object.freeze({25:"GUEST",50:"USER",100:"ADMIN"}),a7=Object.freeze({READ:"read",WRITE:"write"});function xEe(t){const e={};return t.forEach(i=>{const[r,o]=i.split(":");e[r]?e[r].push(o):e[r]=[o]}),e}const kFi={token_scopes:[],usable_scopes:[],user_role:25};function kEe(t=kFi){var e,i,r,o,n,s;const a=xEe(t.token_scopes),l=xEe(t.usable_scopes);return{...w1e(t),tokenScopes:a,usableScopes:l,userRole:xFi[t.user_role],user:t.user?w1e(t.user):null,hasBcfReadPermission:((e=l.bcf)==null?void 0:e.includes(a7.READ))??!1,hasBcfWritePermission:((i=l.bcf)==null?void 0:i.includes(a7.WRITE))??!1,hasModelReadPermission:((r=l.model)==null?void 0:r.includes(a7.READ))??!1,hasModelWritePermission:((o=l.model)==null?void 0:o.includes(a7.WRITE))??!1,hasDocReadPermission:((n=l.document)==null?void 0:n.includes(a7.READ))??!1,hasDocWritePermission:((s=l.document)==null?void 0:s.includes(a7.WRITE))??!1}}const MFi={BcfFilters:{filtersButton:"Filter",filtersTitle:"Filter",priorityLabel:"Priorit\xE4t",statusLabel:"Status",assignedToLabel:"Zugewiesen an",creatorsLabel:"Erstellt von",tagsLabel:"Tags",resetButton:"Zur\xFCcksetzen",searchButton:"Suchen",undefined:"Nicht definiert",datePlaceholder:"Erstellungsdatum"},BcfSettings:{goBackButton:"Zur\xFCck",title:"BCF-Parameter",text:"Erstellen, f\xFCllen und listen Sie die BCF-Einstellungen auf, die Sie f\xFCr dieses Projekt haben m\xF6chten.",validateButton:"Die BCF-Parameter anerkennen"},BcfStatistics:{emptyText:"F\xFCgen Sie Fragen hinzu, um zugeh\xF6rige Statistiken hier anzuzeigen.",issues:"Probleme",extension:{Priority:"Priorit\xE4t",PriorityNotDefined:"Keine Priorit\xE4t",PriorityTitle:"Priorit\xE4ten",Status:"Status",StatusNotDefined:"Kein Status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priorit\xE4t:",noPriority:"Keine",assignedTo:"Zugewiesen an :",elements:"Elemente",notSpecified:"Nicht definiert",see:"Anzeigen"},BcfTopicCreationCard:{text:"Ein neues BCF-Thema erstellen",createBcfSideTitle:"Ein Problem melden"},BcfTopicForm:{dragDropImageText:"Bitte w\xE4hlen Sie eine Datei aus.",addObjectButton:"Objekt",addAnnotationButton:"Annotation",annotationButtonTooltip:"Zu diesem Thema gibt es derzeit keine Ansichten.",addPictureButton:"F\xFCgen Sie ein Bild hinzu.",titlePlaceholder:"Titel *",titleErrorMessage:"Titel fehlt",typeLabel:"Typ",priorityLabel:"Priorit\xE4t",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",dueDateLabel:"F\xE4lligkeitsdatum (TT.MM.JJJJ)",descriptionLabel:"Beschreibung",labelsLabel:"Tags",createButton:"Best\xE4tigen",updateButton:"\xC4nderungen \xFCbernehmen",modalText:"Sie sind dabei, die Bearbeitung der Ausgabe {Name} zu beenden, aber es gibt noch ungespeicherte \xC4nderungen.",cancelButton:"\xC4nderungen verwerfen",continueButton:"\xC4nderungen fortsetzen",createTitle:"Ein Problem melden",dragDropImageTextTablet:"Foto machen",takeSnapshot:"Mach einen Schnappschuss",importFile:"Eine Datei importieren",searchPlaceholder:"Suchen",emptySearch:"kein Ergebnis"},BcfTopicOverview:{openViewer:"Im Viewer \xF6ffnen",openViewerNoModels:"Es sind keine Vorlagen zur Ansicht bereit",elements:"{count} Elemente",noElements:"kein Element",type:"Typ",noTypeSpecified:"Kein Typ angegeben",description:"Beschreibung",noDescriptionProvided:"Keine Beschreibung angegeben",assignedTo:"Zugeteilt an",notAssigned:"Nicht zugewiesen",dueDate:"F\xE4lligkeitsdatum",noDueDate:"Kein F\xE4lligkeitsdatum",informations:"Informationen",status:"Status",noStatusSpecified:"Kein Status angegeben",stage:"Phase",noStageProvided:"Keine Phase angegeben",priority:"Priorit\xE4t",priorityNotDefined:"Nicht definiert",tags:"Tags",noTags:"Keine Tags",commentButton:"Ein Kommentar ver\xF6ffentlichen",deleteText:"Sie l\xF6schen jetzt {Name}",deleteBcfButton:"Dieses BCF l\xF6schen",keepBcfButton:"Dieses BCF beibehalten",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE4t",status:"Status",title:"Titel",creator:"Autor",date:"Datum"}},BcfTopicActionsCell:{seeButton:"Anzeigen"},BcfTopicComments:{commentButton:"Ein Kommentar verfassen",commentLabel:"Ein Kommentar verfassen",commentText:"Kommentar",cancelButton:"Abbrechen",publishButton:"Ver\xF6ffentlichen",commentsText:"Kommentare",deleteCommentText:"Diesen Kommentar l\xF6schen?",deleteButton:"L\xF6schen",takeSnapshot:"Mach einen Schnappschuss"},BcfTopicPriorityCell:{noPriority:"Keine"},SettingCard:{addButton:"ein Element hinzuf\xFCgen",cancelButton:"Abbrechen",validateButton:"Best\xE4tigen",deleteExtensionText:"Diesen Parameter l\xF6schen",deleteButton:"L\xF6schen",title:{Priority:"Priorit\xE4ten",Label:"Tags",Status:"Status",Type:"Typen",Stage:"Phasen"},input:{Priority:"Eine neue Priorit\xE4t hinzuf\xFCgen",Label:"Ein neues Etikett hinzuf\xFCgen",Status:"Einen neuen Status hinzuf\xFCgen",Type:"Einen neuen Typ hinzuf\xFCgen",Stage:"Eine neue Phase hinzuf\xFCgen"},text:{Priority:"Liste der Priorit\xE4ten",Label:"Liste von Tags",Status:"Liste der Status",Type:"Liste der Typen",Stage:"Liste der Phasen"}}},PFi={BcfComponents:MFi},EFi={BcfFilters:{filtersButton:"Filters",filtersTitle:"Filters",priorityLabel:"Priority",statusLabel:"Status",assignedToLabel:"Assigned to",creatorsLabel:"Created by",tagsLabel:"Tags",resetButton:"Reset",searchButton:"Search",undefined:"Not defined",datePlaceholder:"Creation date"},BcfSettings:{goBackButton:"Back",title:"BCF Settings",text:"Create, enter in, and list the BCF settings you would like to have for this project",validateButton:"Validate BCF settings"},BcfStatistics:{emptyText:"Add BCF Topics to start to have some stats here.",issues:"issues",extension:{Priority:"Priority",PriorityNotDefined:"No priority",PriorityTitle:"Priorities",Status:"Status",StatusNotDefined:"No status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priority: ",noPriority:"None",assignedTo:"Assigned to: ",elements:"Elements",notSpecified:"Not specified",see:"See"},BcfTopicCreationCard:{text:"Create a new BCF topic",createBcfSideTitle:"Report a problem"},BcfTopicForm:{dragDropImageText:"Please select a file",addObjectButton:"Object",addAnnotationButton:"Annotation",annotationButtonTooltip:"This topic has no viewpoint",addPictureButton:"Add a picture",titlePlaceholder:"Title *",titleErrorMessage:"Missing title",typeLabel:"Type",priorityLabel:"Priority",statusLabel:"Status",stageLabel:"Stage",assignedToLabel:"Assigned to",dueDateLabel:"Due date",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Validate",updateButton:"Modify this BCF",modalText:"You are about to quit editing issue {name} but there are unsaved changes.",cancelButton:"Discard changes",continueButton:"Continue editing",createTitle:"Report a problem",dragDropImageTextTablet:"Take a picture",takeSnapshot:"Take a snapshot",importFile:"Import a file",searchPlaceholder:"Search",emptySearch:"No result"},BcfTopicOverview:{openViewer:"Open in viewer",openViewerNoModels:"No model to open",elements:"{count} Elements",noElements:"No element",type:"Type",noTypeSpecified:"No type specified",description:"Description",noDescriptionProvided:"No description provided",assignedTo:"Assigned to",notAssigned:"Not assigned",dueDate:"Due date",noDueDate:"No due date",informations:"Informations",status:"Status",noStatusSpecified:"No status specified",stage:"Stage",noStageProvided:"No stage provided",priority:"Priority",priorityNotDefined:"Not defined",tags:"Tags",noTags:"No tags",commentButton:"Post a comment",deleteText:"You are about to delete {name}",deleteBcfButton:"Delete this BCF",keepBcfButton:"Keep this BCF",author:"Author"},BcfTopicsTable:{headers:{index:"#",priority:"Priority",status:"Status",title:"Title",creator:"Author",date:"Date"}},BcfTopicActionsCell:{seeButton:"See"},BcfTopicComments:{commentButton:"Post a comment",commentLabel:"Post a comment",commentText:"Comment",cancelButton:"Cancel",publishButton:"Publish",commentsText:"Comments",deleteCommentText:"Delete this comment ?",deleteButton:"Delete",takeSnapshot:"Take a snapshot"},BcfTopicPriorityCell:{noPriority:"None"},SettingCard:{addButton:"add an element",cancelButton:"Cancel",validateButton:"Validate",deleteExtensionText:"Remove this setting",deleteButton:"Delete",title:{Priority:"Priorities",Label:"Labels",Status:"Status",Type:"Types",Stage:"Stages"},input:{Priority:"Add a new priority",Label:"Add a new label",Status:"Add new status",Type:"Add a new type",Stage:"Add a new stage"},text:{Priority:"Priority list",Label:"Labels list",Status:"Status list",Type:"Type list",Stage:"Stage list"}}},SFi={BcfComponents:EFi},BFi={BcfFilters:{filtersButton:"Filtros",filtersTitle:"Filtros",priorityLabel:"Prioridad",statusLabel:"Estado",assignedToLabel:"Asignado a",creatorsLabel:"Creado por",tagsLabel:"Etiquetas:",resetButton:"Restablecer",searchButton:"Buscar en",undefined:"No definido",datePlaceholder:"Fecha de creaci\xF3n"},BcfSettings:{goBackButton:"Volver",title:"Par\xE1metros del BCF",text:"Cree, rellene y enumere los par\xE1metros del BCF que desea tener en este proyecto",validateButton:"Validar los par\xE1metros del BCF"},BcfStatistics:{emptyText:"A\xF1ada preguntas para ver las estad\xEDsticas asociadas aqu\xED.",issues:"problemas",extension:{Priority:"Prioridad",PriorityNotDefined:"Sin prioridad",PriorityTitle:"Prioridades",Status:"Estado",StatusNotDefined:"Sin estado",StatusTitle:"Estatutos"}},BcfTopicCard:{priority:"Prioridad :",noPriority:"Sin",assignedTo:"Asignado a :",elements:"Elementos",notSpecified:"No definido",see:"Ver"},BcfTopicCreationCard:{text:"Crear un nuevo tema BCF",createBcfSideTitle:"Informar de un problema"},BcfTopicForm:{dragDropImageText:"Seleccione un archivo",addObjectButton:"Objeto",addAnnotationButton:"Anotaci\xF3n",annotationButtonTooltip:"Actualmente este tema no posee ning\xFAn punto de vista",addPictureButton:"A\xF1adir una imagen",titlePlaceholder:"T\xEDtulo *",titleErrorMessage:"Falta el t\xEDtulo",typeLabel:"Tipo",priorityLabel:"Prioridad",statusLabel:"Estado",stageLabel:"Fase",assignedToLabel:"Asignado a",dueDateLabel:"Fecha de vencimiento (DD/MM/AAAA)",descriptionLabel:"Descripci\xF3n",labelsLabel:"Etiquetas",createButton:"Validar",updateButton:"Modificar este BCF",modalText:"Est\xE1 a punto de salir de la edici\xF3n del problema de {name} pero hay cambios sin guardar.",cancelButton:"Cancelar los cambios",continueButton:"Continuar con los cambios",createTitle:"Informar de un problema",dragDropImageTextTablet:"Tomar una fotograf\xEDa",takeSnapshot:"Tomar un snapshot",importFile:"Importar un archivo",searchPlaceholder:"Buscar",emptySearch:"No hay resultados"},BcfTopicOverview:{openViewer:"Abrir en el visor",openViewerNoModels:"No hay ning\xFAn modelo listo para la visualizaci\xF3n",elements:"{count} Elementos",noElements:"Ning\xFAn elemento",type:"Tipo",noTypeSpecified:"No se especifica el tipo",description:"Descripci\xF3n",noDescriptionProvided:"No hay descripci\xF3n",assignedTo:"Asignado a",notAssigned:"No asignado",dueDate:"Plazo",noDueDate:"Sin fecha de vencimiento",informations:"Informaci\xF3n",status:"Estado",noStatusSpecified:"No se especifica el estado",stage:"Fase",noStageProvided:"No se indica ninguna fase",priority:"Prioridad",priorityNotDefined:"No definido",tags:"Etiquetas",noTags:"Sin etiquetas",commentButton:"Publicar un comentario",deleteText:"Est\xE1s a punto de borrar {name}",deleteBcfButton:"Borrar este BCF",keepBcfButton:"Mantenga este BCF",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Prioridad",status:"Estado",title:"T\xEDtulo",creator:"Autor",date:"Fecha"}},BcfTopicActionsCell:{seeButton:"Ver"},BcfTopicComments:{commentButton:"Publicar un comentario",commentLabel:"Publicar un comentario",commentText:"Comentario",cancelButton:"Cancelar",publishButton:"Publicar",commentsText:"comentarios",deleteCommentText:"\xBFBorrar este comentario?",deleteButton:"Borrar",takeSnapshot:"Tomar un snapshot"},BcfTopicPriorityCell:{noPriority:"Sin"},SettingCard:{addButton:"a\xF1adir un elemento",cancelButton:"Cancelar",validateButton:"Validar",deleteExtensionText:"Borrar esta configuraci\xF3n",deleteButton:"Borrar",title:{Priority:"Prioridades",Label:"Etiquetas:",Status:"Estatutos",Type:"Tipos",Stage:"Fases"},input:{Priority:"A\xF1adir una nueva prioridad",Label:"A\xF1adir una nueva etiqueta",Status:"A\xF1adir un nuevo estado",Type:"A\xF1adir un nuevo tipo",Stage:"A\xF1adir una nueva fase"},text:{Priority:"Lista de prioridades",Label:"Lista de etiquetas",Status:"Lista de estatutos",Type:"Lista de tipos",Stage:"Lista de fases"}}},IFi={BcfComponents:BFi},TFi={BcfFilters:{filtersButton:"Filtres",filtersTitle:"Filtres",priorityLabel:"Priorit\xE9",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assign\xE9 \xE0",creatorsLabel:"Cr\xE9\xE9 par",tagsLabel:"Tags",resetButton:"R\xE9initialiser",searchButton:"Rechercher",undefined:"Non d\xE9fini",datePlaceholder:"Date de cr\xE9ation"},BcfSettings:{goBackButton:"Retour",title:"Param\xE8tres BCF",text:"Cr\xE9ez, renseignez et listez les param\xE8tres BCF que vous souhaitez avoir sur ce projet",validateButton:"Valider les param\xE8tres BCF"},BcfStatistics:{emptyText:"Ajoutez des questions pour voir les statistiques associ\xE9es ici.",issues:"probl\xE8mes",extension:{Priority:"Priorit\xE9",PriorityNotDefined:"Aucune priorit\xE9",PriorityTitle:"Priorit\xE9s",Status:"Statut",StatusNotDefined:"Aucun statut",StatusTitle:"Statuts"}},BcfTopicCard:{priority:"Priorit\xE9 : ",noPriority:"Aucune",assignedTo:"Assign\xE9 \xE0 : ",elements:"{n} \xC9lements",notSpecified:"Non d\xE9fini",see:"Voir"},BcfTopicCreationCard:{text:"Cr\xE9er un nouveau topic BCF",createBcfSideTitle:"Signaler un probl\xE8me"},BcfTopicForm:{dragDropImageText:"Veuillez s\xE9lectionner un fichier",addObjectButton:"Objet",addAnnotationButton:"Annotation",annotationButtonTooltip:"Ce topic ne poss\xE8de actuellement aucun point de vue",addPictureButton:"Ajouter une image",titlePlaceholder:"Titre *",titleErrorMessage:"Titre manquant",typeLabel:"Type",priorityLabel:"Priorit\xE9",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assign\xE9 \xE0",dueDateLabel:"Date d'\xE9ch\xE9ance",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Valider",updateButton:"Modifier ce BCF",modalText:"Vous \xEAtes sur le point de quitter l'\xE9dition de l'issue {name} mais il y'a des modifications non enregistr\xE9es.",cancelButton:"Annuler les modifications",continueButton:"Continuer les modifications",createTitle:"Signaler un probl\xE8me",dragDropImageTextTablet:"Prendre une photo",takeSnapshot:"Prendre un snapshot",importFile:"Importer un fichier",searchPlaceholder:"Rechercher",emptySearch:"Pas de r\xE9sultat"},BcfTopicOverview:{openViewer:"Ouvrir dans le viewer",openViewerNoModels:"Il n'y a aucun mod\xE8le pr\xEAt pour une visualisation",elements:"{count} \xC9lements",noElements:"Aucun \xE9l\xE9ment concern\xE9",type:"Type",noTypeSpecified:"Pas de type sp\xE9cifi\xE9",description:"Description",noDescriptionProvided:"Pas de description renseign\xE9e",assignedTo:"Assign\xE9 \xE0",notAssigned:"Non assign\xE9",dueDate:"\xC9ch\xE9ance",noDueDate:"Pas de date d'\xE9ch\xE9ance",informations:"Informations",status:"Statut",noStatusSpecified:"Pas de statut sp\xE9cifi\xE9",stage:"Phase",noStageProvided:"Pas de phase renseign\xE9e",priority:"Priorit\xE9",priorityNotDefined:"Non d\xE9fini",tags:"Tags",noTags:"Pas de tags",commentButton:"Poster un commentaire",deleteText:"Vous \xEAtes sur le point de supprimer {name}",deleteBcfButton:"Supprimer ce BCF",keepBcfButton:"Conserver ce BCF",author:"Auteur"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE9",status:"Statut",title:"Titre",creator:"Auteur",date:"Date"}},BcfTopicActionsCell:{seeButton:"Voir"},BcfTopicComments:{commentButton:"Poster un commentaire",commentLabel:"Poster un commentaire",commentText:"Commentaire",cancelButton:"Annuler",publishButton:"Publier",commentsText:"commentaires",deleteCommentText:"Supprimer ce commentaire ?",deleteButton:"Supprimer",takeSnapshot:"Prendre un snapshot"},BcfTopicPriorityCell:{noPriority:"Aucune"},SettingCard:{addButton:"ajouter un \xE9l\xE9ment",cancelButton:"Annuler",validateButton:"Valider",deleteExtensionText:"Supprimmer ce param\xE8tre",deleteButton:"Supprimer",title:{Priority:"Priorit\xE9s",Label:"Tags",Status:"Statuts",Type:"Types",Stage:"Phases"},input:{Priority:"Ajouter une nouvelle priorit\xE9",Label:"Ajouter un nouveau label",Status:"Ajouter un nouveau statut",Type:"Ajouter un nouveau type",Stage:"Ajouter une nouvelle phase"},text:{Priority:"Liste des priorit\xE9s",Label:"Liste des tags",Status:"Liste des statuts",Type:"Liste des types",Stage:"Liste des phases"}}},RFi={BcfComponents:TFi},DFi={BcfFilters:{filtersButton:"Filtri",filtersTitle:"Filtri",priorityLabel:"Priorit\xE0",statusLabel:"Stato",datePlaceholder:"Data di creazione",assignedToLabel:"Assegnato a",creatorsLabel:"Creato da",tagsLabel:"Etichette",resetButton:"Ripristina",searchButton:"Cerca",undefined:"Non definito"},BcfSettings:{goBackButton:"Indietro",title:"Parametri BCF",text:"Creare, notificare e elencare i parametri BCF che si desidera avere su questo progetto",validateButton:"Conferma i parametri BCF"},BcfStatistics:{emptyText:"Aggiungi delle domande per vedere le statistiche associate qui.",issues:"problemi",extension:{Priority:"Priorit\xE0",PriorityNotDefined:"Nessuna priorit\xE0",PriorityTitle:"Priorit\xE0",Status:"Stato",StatusNotDefined:"Nessuno stato",StatusTitle:"Stati"}},BcfTopicCard:{priority:"Priorit\xE0:",noPriority:"Nessuno",assignedTo:"Assegnato a:",elements:"Elementi",noElements:"0 elementi",notSpecified:"Non definito",see:"Visualizza"},BcfTopicCreationCard:{text:"Crea un nuovo topic BCF",createBcfSideTitle:"Segnala un problema"},BcfTopicForm:{dragDropImageText:"Selezionare un file",addObjectButton:"Oggetto",addAnnotationButton:"Annotazione",annotationButtonTooltip:"Attualmente questo argomento non presenta alcun punto di vista",addPictureButton:"Aggiungere un'immagine",titlePlaceholder:"Titolo *",titleErrorMessage:"Titolo mancante",typeLabel:"Tipo",priorityLabel:"Priorit\xE0",statusLabel:"Stato",stageLabel:"Fase",assignedToLabel:"Assegnato a",dueDateLabel:"Data di scadenza",descriptionLabel:"Descrizione",labelsLabel:"Tag",createButton:"Conferma",updateButton:"Modificare questo BCF",modalText:"State per abbandonare la modifica di {name} ma ci sono modifiche non salvate.",cancelButton:"Annullare le modifiche",continueButton:"Continuare le modifiche",createTitle:"Segnala un problema"},BcfTopicOverview:{openViewer:"Apri nel visualizzatore",openViewerNoModels:"Non esistono modelli pronti per la visualizzazione",elements:"{count} Elementi",noElements:"Nessun elemento",type:"Tipo",noTypeSpecified:"Nessun tipo specificato",description:"Descrizione",noDescriptionProvided:"Nessuna descrizione inserita",assignedTo:"Assegnato a",notAssigned:"Non assegnato",dueDate:"Scadenza",noDueDate:"Nessuna data di scadenza",informations:"Informazioni",status:"Stato",noStatusSpecified:"Nessuno stato specificato",stage:"Fase",noStageProvided:"Nessuna fase inserita",priority:"Priorit\xE0",priorityNotDefined:"Non definita",tags:"Etichette",noTags:"Nessuna etichetta",commentButton:"Pubblica un commento",deleteText:"Stai per eliminare {name}",deleteBcfButton:"Elimina questo BCF",keepBcfButton:"Conserva questo BCF",author:"Autore"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE0",status:"Stato",title:"Titolo",creator:"Autore",date:"Data"}},BcfTopicActionsCell:{seeButton:"Visualizza"},BcfTopicComments:{commentButton:"Pubblica un commento",commentLabel:"Pubblica un commento",commentText:"Commento",cancelButton:"Annulla",publishButton:"Pubblica",commentsText:"commenti",deleteCommentText:"Eliminare questo commento?",deleteButton:"Elimina"},BcfTopicPriorityCell:{noPriority:"Nessuno"},SettingCard:{addButton:"aggiungi un elemento",cancelButton:"Annulla",validateButton:"Conferma",deleteExtensionText:"Elimina questo parametro",deleteButton:"Elimina",title:{Priority:"Priorit\xE0",Label:"Etichette",Status:"Stati",Type:"Tipi",Stage:"Fasi"},input:{Priority:"Aggiungi una nuova priorit\xE0",Label:"Aggiungi una nuova etichetta",Status:"Aggiungi un nuovo stato",Type:"Aggiungi un nuovo tipo",Stage:"Aggiungi una nuova fase"},text:{Priority:"Elenco delle priorit\xE0",Label:"Elenco delle etichette",Status:"Elenco degli stati",Type:"Elenco dei tipi",Stage:"Elenco delle fasi"}}},LFi={BcfComponents:DFi},_Fi={de:PFi,en:SFi,es:IFi,fr:RFi,it:LFi},FFi=({apiClient:t,fetchUsers:e,i18nPlugin:i}={})=>({install(r){t?vo.setup({apiClient:t,fetchUsers:e}):console.error("[BCF Components Plugin] No api client provided. You must provide an api client for the components to work properly."),i?Object.entries(_Fi).forEach(([o,n])=>{i.global.mergeLocaleMessage(o,n)}):console.warn("[BCF Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(vWe).forEach(([o,n])=>{r.component(o,n)})}}),OFi={title:"Building Maker",back:"Zur\xFCck",list:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",createButton:"Neues Projekt",updateButton:"Umbenennen",deleteButton:"L\xF6schen"},form:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",input:"Name des Geb\xE4udes",error:"Ung\xFCltiger Name",createButton:"Erstellen",updateButton:"Best\xE4tigen"},view:{addStoreyButton:"Etage",addPlanButton:"Grundriss",closeButton:"Fertigstellen",submitFilesButton:"Best\xE4tigen"},storeyForm:{title:"Neue Etage",input:"Name",error:"Ung\xFCltiger Name",cancelButton:"Abbrechen",submitButton:"Best\xE4tigen"}},UFi={creationFormTitle:"Ordner erstellen",renameFormPlaceholder:"Datei- / Ordnernam",nameInputPlaceholder:"Ordnername",emptyFolder:"Dieser Ordner ist leer",newFolderSuccess:"Neuer Ordner erstellt",renameFolderSuccess:"Umbenannter Ordner",deleteFolderSuccess:"Ordner gel\xF6scht",newFileSuccess:"Datei hinzugef\xFCgt",renameFileSuccess:"Umbenannte Datei",deleteFileSuccess:"Datei gel\xF6scht",nameInputErrorMessage:"Ung\xFCltiger name",cancel:"Abbrechen",submit:"Best\xE4tigen",buttonText:"Neuer Ordner",addFileButtonText:"Datei laden",rename:"Umbenennen",view:"Sehen",download:"Herunterladen",delete:"L\xF6schen",deleteTitle:"Dateien l\xF6schen",deleteDetail:"Sie sind im Begriff, die folgenden Dateien / Ordner endg\xFCltig zu l\xF6schen"},NFi={BuildingMaker:OFi,FileManager:UFi},jFi={t:{back:"Back",cancel:"Cancel",create:"Create",delete:"Delete",download:"Download",finish:"Finish",rename:"Rename",search:"Search",see:"View",storey:"Storey",validate:"Validate"}},HFi={title:"Building Maker",list:{text:"Create and edit storeys, then download your PDFs.",new:"New project"},form:{input:"Building name",error:"Invalid"},view:{addStorey:"Add Storey",addFile:"Add File",addPlan:"Add Plan"},storeyForm:{title:"New storey",input:"Name",error:"Invalid name"}},VFi={creationFormTitle:"Create folder",renameFormPlaceholder:"Folder/File name",nameInputPlaceholder:"Folder name",emptyFolder:"This folder is empty",newFolderSuccess:"New folder created",renameFolderSuccess:"Folder renamed",deleteFolderSuccess:"Folder deleted",newFileSuccess:"File added",renameFileSuccess:"File renamed",deleteFileSuccess:"File deleted",nameInputErrorMessage:"Invalid name",buttonText:"New folder",addFileButtonText:"Upload a file",deleteTitle:"Deleting Files",deleteDetail:"You are about to permanently delete the following files / folders",dmsRoot:"Root of the project's DMS",pdfPageSelectorTitle:"Select a page"},zFi={title:"Meta-Building Structure",tab:{structure:"Structure",zones:"Zones",equipments:"Equipments"},StoreySelector:{placeholder:"Select a storey"}},qFi={title:"Photosphere Building"},GFi={BIMDataComponents:jFi,BuildingMaker:HFi,FileManager:VFi,MetaBuildingStructure:zFi,PhotosphereBuilding:qFi},QFi={title:"Building Maker",back:"Vuelta",list:{text:"Cree y edite los pisos despu\xE9s cargue los PDF.",createButton:"Nuevo proyecto",updateButton:"Renombrar",deleteButton:"Suprimir"},form:{text:"Cree y edite los pisos despu\xE9s cargue los PDF.",input:"Nombre del edificio",error:"Nombre no v\xE1lido",createButton:"Crear",updateButton:"Validar"},view:{addStoreyButton:"Piso",addPlanButton:"Plano",closeButton:"Terminar",submitFilesButton:"Validar"},storeyForm:{title:"Nuevo piso",input:"Nombre",error:"Nombre no v\xE1lido",cancelButton:"Anular",submitButton:"Validar"}},KFi={creationFormTitle:"Crear un archivo",renameFormPlaceholder:"Nombre de archivo / carpeta",nameInputPlaceholder:"Nombre de la carpeta",emptyFolder:"Esta carpeta est\xE1 vac\xEDa",newFolderSuccess:"Nueva carpeta creada",renameFolderSuccess:"Carpeta renombrada",deleteFolderSuccess:"Carpeta eliminada",newFileSuccess:"Archivo agregado",renameFileSuccess:"Archivo renombrado",deleteFileSuccess:"Archivo eliminado",nameInputErrorMessage:"Nombre inv\xE1lida",cancel:"Cancelar",submit:"Validar",buttonText:"Carpeta nueva",addFileButtonText:"Cargar un archivo",rename:"Renombrar",view:"Ver",download:"Descargar",delete:"Borrar",deleteTitle:"Eliminar archivos",deleteDetail:"Est\xE1 a punto de eliminar permanentemente los siguientes archivos / carpetas"},WFi={BuildingMaker:QFi,FileManager:KFi},ZFi={t:{back:"Retour",cancel:"Annuler",create:"Cr\xE9er",delete:"Supprimer",download:"T\xE9l\xE9charger",finish:"Terminer",rename:"Renommer",search:"Rechercher",see:"Voir",storey:"\xC9tage",validate:"Valider"}},JFi={title:"Building Maker",list:{text:"Cr\xE9ez et \xE9ditez les \xE9tages puis t\xE9l\xE9chagez vos PDF.",new:"Nouveau projet"},form:{input:"Nom du b\xE2timent",error:"Nom invalide"},view:{addStorey:"Ajouter un \xC9tage",addFile:"Ajouter un fichier",addPlan:"Ajouter un plan"},storeyForm:{title:"Nouvel \xE9tage",input:"Nom",error:"Nom invalide"}},XFi={creationFormTitle:"Cr\xE9er un dossier",renameFormPlaceholder:"Nom du fichier/dosier",nameInputPlaceholder:"Nom du dossier",emptyFolder:"Ce dossier est vide",newFolderSuccess:"Nouveau dossier cr\xE9\xE9",renameFolderSuccess:"Dossier renomm\xE9",deleteFolderSuccess:"Dossier supprim\xE9",newFileSuccess:"Fichier ajout\xE9",renameFileSuccess:"Fichier renomm\xE9",deleteFileSuccess:"Fichier supprim\xE9",nameInputErrorMessage:"Nom invalide",buttonText:"Nouveau dossier",addFileButtonText:"Charger un fichier",deleteTitle:"Supression de fichiers",deleteDetail:"Vous \xEAtes sur le point de supprimer d\xE9finitivement les fichiers/dossiers suivants",dmsRoot:"Racine de la GED du projet",pdfPageSelectorTitle:"S\xE9lectionner une page"},YFi={title:"Structure M\xE9ta-Building",tab:{structure:"Structure",zones:"Zones",equipments:"\xC9quipements"},StoreySelector:{placeholder:"S\xE9lectionner un \xE9tage"}},$Fi={title:"Photosph\xE8re Building"},eOi={BIMDataComponents:ZFi,BuildingMaker:JFi,FileManager:XFi,MetaBuildingStructure:YFi,PhotosphereBuilding:$Fi},tOi={title:"Building Maker",back:"Reso",list:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",createButton:"Nuovo progetto",updateButton:"Rinominare",deleteButton:"Eliminare"},form:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",input:"Nome della costruzione",error:"Nome non corretto",createButton:"Creare",updateButton:"Convalidare"},view:{addStoreyButton:"Piano",addPlanButton:"Mappa",closeButton:"Finire",submitFilesButton:"Convalidare"},storeyForm:{title:"Nuovo piano",input:"Nome",error:"Nome non corretto",cancelButton:"Annullare",submitButton:"Convalidare"}},iOi={creationFormTitle:"Crea una cartella",renameFormPlaceholder:"Nome file/cartella",nameInputPlaceholder:"Nome della cartella",emptyFolder:"Questa cartella \xE8 vuota",newFolderSuccess:"Nuova cartella creata",renameFolderSuccess:"Cartella rinominata",deleteFolderSuccess:"Cartella eliminata",newFileSuccess:"File aggiunto",renameFileSuccess:"File rinominato",deleteFileSuccess:"File cancellato",nameInputErrorMessage:"Nome non valido",cancel:"Annulla",submit:"Invia",buttonText:"Nuova cartella",addFileButtonText:"Carica un file",rename:"Rinominare",view:"Vedere",download:"Scaricare",delete:"Cancellare",deleteTitle:"Eliminazione di file",deleteDetail:"Stai per eliminare definitivamente i seguenti file/cartelle"},rOi={BuildingMaker:tOi,FileManager:iOi},oOi={de:NFi,en:GFi,es:WFi,fr:eOi,it:rOi},nOi=({i18nPlugin:t}={})=>({install(e){t?Object.entries(oOi).forEach(([i,r])=>{t.global.mergeLocaleMessage(i,r)}):console.warn("[BIMData Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(j4i).forEach(([i,r])=>{e.component(i,r)})}}),sOi={beforeMount(t,e){if(typeof e.value!="function")throw Error(`click away directive needs function, got ${typeof e.value}`);t.clickAwayHandler=i=>{(i.path||i.composedPath&&i.composedPath()).find(r=>r===t)||e.value()},window.addEventListener("mousedown",t.clickAwayHandler,!0)},unmounted(t){window.removeEventListener("mousedown",t.clickAwayHandler,!0),delete t.clickAwayHandler}},aOi=Object.freeze(Object.defineProperty({__proto__:null,BIMDataClickAway:Rh,BIMDataClickInputAway:sOi},Symbol.toStringTag,{value:"Module"})),lOi=t=>({install(e){Object.entries(d8t).forEach(([i,r])=>{e.component(i,r)}),Object.entries(aOi).forEach(([i,r])=>e.directive(i.split("BIMData")[1],r))}}),cOi={name:"LiWrapper",render(){return Ln("li",this.$slots.default())}};function dOi(t,e){var i=new Set([]);return t.forEach(r=>{e.has(r)||i.add(r)}),i}const n1=Sa("id"),uOi=({contextMenu:t,objects:e=[],state:i=t.$viewer.state,pictos:r})=>[{name:"selectAll",get group(){return t.groupPositions.select},position:1,get label(){return t.$t("context_menu.select_all")},get picto(){return r.get(this.name)},execute:()=>i.selectObjects(e.filter(bh(Sr("visible"),Eg("selected"))).map(n1)),predicate:()=>e.some(bh(Sr("visible"),Eg("selected")))},{name:"deselectAll",get group(){return t.groupPositions.select},position:2,get label(){return t.$t("context_menu.deselect_all")},get picto(){return r.get(this.name)},execute:()=>i.deselectObjects(e.filter(Sr("selected")).map(n1)),predicate:()=>e.some(Sr("selected"))},{name:"selectSimilar",get group(){return t.groupPositions.select},position:3,get label(){return t.$t("context_menu.select_similar")},get picto(){return r.get(this.name)},execute(){const o=e.filter(n=>n.visible&&n.type===this.selectedObject.type&&n.id!==this.selectedObject.id).map(n1);i.selectObjects(o)},selectedObject:null,predicate(){const o=e.filter(bh(Sr("visible"),Sr("selected")));return o.length===1&&o[0].type!==void 0?(this.selectedObject=o[0],!0):(this.selectedObject=null,!1)}},{name:"reverseSelection",get label(){return t.$t("context_menu.reverse_selection")},get group(){return t.groupPositions.select},position:4,execute:()=>{const o=new Set(e.filter(Sr("selected")).map(n1)),n=new Set(e.filter(Sr("visible")).map(n1));i.selectObjects(Array.from(dOi(n,o)),{exclusive:!0})},predicate:()=>e.some(bh(Eg("selected"),Sr("visible")))&&e.some(bh(Sr("selected"),Sr("visible")))},{name:"showAll",get group(){return t.groupPositions.visibility},position:1,get label(){return t.$t("context_menu.show_all")},get picto(){return r.get(this.name)},execute:()=>i.showObjects(e.filter(Eg("visible")).map(n1)),predicate:()=>e.some(Eg("visible"))},{name:"hide",get group(){return t.groupPositions.visibility},position:2,get label(){return t.$t("context_menu.hide")},get picto(){return r.get(this.name)},objectsToHide:null,execute(){const o=this.objectsToHide.filter(Sr("selected"));o.length>0&&i.deselectObjects(o.map(n1)),i.hideObjects(this.objectsToHide.map(n1))},predicate(){return this.objectsToHide=e.filter(bh(Sr("selected"),Sr("visible"))),this.objectsToHide.length>0}},{name:"hideAll",get group(){return t.groupPositions.visibility},position:3,get label(){return t.$t("context_menu.hide_all")},execute:()=>{const o=e.filter(Sr("visible"));o.some(Sr("selected"))&&i.deselectObjects(o.filter(Sr("selected")).map(n1)),i.hideObjects(o.map(n1))},predicate:()=>e.some(Sr("visible"))}].filter(o=>o.predicate()),hOi={components:{LiWrapper:cOi},inject:["$viewer"],data(){return{defaultPrevented:!1,displayed:!1,top:null,bottom:null,left:null,width:200,nextCommandId:1,currentCommands:[],contextCommands:[],registeredCommands:[],groupPositions:{select:10,visibility:20},asyncPredicateRunning:!1}},computed:{position(){return{top:this.top?this.top+"px":"unset",bottom:this.bottom?this.bottom+"px":"unset",left:this.left+"px",width:this.width+"px"}}},watch:{displayed(t){t?document.addEventListener("keydown",this.onKeyDown):document.removeEventListener("keydown",this.onKeyDown)}},created(){this.$viewer.contextMenu=this,this.asyncPredicates=new Set},methods:{onKeyDown(t){t.key==="Escape"&&this.away()},setPosition(t){const e=(document.fullscreenElement?document.fullscreenElement:this.$parent.$el).getBoundingClientRect();this.left=t.clientX-e.left,this.top=t.clientY-e.top,this.left+this.width>e.width&&(this.left=this.left-this.width),t.clientY>e.top+e.height/2?(this.bottom=e.height-this.top,this.top=null):this.bottom=null},typeCheckCommand(t={}){let e=null;if((!t.execute||typeof t.execute!="function")&!t.component&&(e="Cannot register context menu command. A command must have an execute function or a component property."),t.label||(e="Cannot register context menu command. A command must have a label."),e)throw console.error(e),new Error(e);return t.id=this.nextCommandId++,t},open(t){this.currentCommands=[],this.setPosition(t),this.originEvent=t,t.preventDefault(),this.setCurrentCommands(),this.groupCurrentCommands(),this.defaultPrevented=!1,this.displayed=!0,document.fullscreenElement?(this.$el.parentElement.removeChild(this.$el),this.adoptiveParent=document.fullscreenElement,this.adoptiveParent.appendChild(this.$el)):this.adoptiveParent&&this.adoptiveParent!==this.$viewer.globalContext.el&&(this.adoptiveParent.removeChild(this.$el),this.$viewer.globalContext.el.appendChild(this.$el),this.adoptiveParent=null)},setCurrentCommands(){this.asyncPredicates.clear(),this.asyncPredicateRunning=!1,this.defaultPrevented||this.registeredCommands.forEach(async t=>{if(typeof t.predicate=="function"){const e=t.predicate(this.$viewer.globalContext.activeLocalContext);if(e===!0)this.currentCommands.push(t);else if(typeof e?.then=="function"){this.asyncPredicates.add(e),this.asyncPredicateRunning=!0;const i=await e;this.asyncPredicates.has(e)&&(this.asyncPredicates.delete(e),this.asyncPredicateRunning=this.asyncPredicates.size>0,i===!0&&this.currentCommands.push(t))}}else this.currentCommands.push(t)}),this.currentCommands.push(...this.contextCommands),this.contextCommands=[]},getDefaultCommands({objects:t=[],state:e=this.$viewer.state,context:i=null}){const r=new Map;return i&&this.$viewer.shortcutManager.getShortcuts(i).forEach(o=>r.set(o.name,o.key)),uOi({contextMenu:this,objects:t,state:e,pictos:r})},executeCommand(t){if(t.execute&&(t.execute(this.originEvent),this.displayed=!1),t.component&&!t.menu)throw new Error("Command with component property must have a `menu` property")},away(){this.displayed=!1},groupCurrentCommands(){const t=new Map;this.currentCommands.forEach(i=>{(i.group===null||i.group===void 0)&&(i.group=0),t.has(i.group)?t.get(i.group).push(i):t.set(i.group,[i])}),t.forEach(i=>i.sort((r,o)=>(r.position=r.position||0,o.position=o.position||0,r.position-o.position)));const e=[...t.keys()].sort((i,r)=>i-r).map(i=>t.get(i)).flat();this.currentCommands=e},isGroupIntersection(t){if(t===0)return!1;const e=this.currentCommands[t-1],i=this.currentCommands[t];return e.group<i.group},registerContextCommand(t){const e=this.typeCheckCommand(t);return this.contextCommands.push(e),t.id},registerCommand(t){const e=this.typeCheckCommand(t);return this.registeredCommands.push(e),t.id},unregisterCommand(t){return this.registeredCommands.find(e=>e.id===t)?(this.registeredCommands=this.registeredCommands.filter(e=>e.id!==t),!0):!1},preventDefault(){this.defaultPrevented=!0}}},pOi={key:0,class:"separator"},fOi={class:"menu-text"},gOi={key:1,class:"menu-picto"},mOi={key:0,class:"context-menu__spinner"};function AOi(t,e,i,r,o,n){const s=D("BIMDataIconChevron"),a=D("LiWrapper"),l=D("BIMDataSpinner"),c=sr("click-away");return o.displayed&&(o.currentCommands.length||o.asyncPredicateRunning)?Ot((T(),O("ul",{key:0,class:"bimdata-list context-menu",style:Pe(n.position)},[(T(!0),O(Pt,null,Xt(o.currentCommands,(d,u)=>(T(),te(a,{key:d.label,class:"context-menu__element",onClick:h=>n.executeCommand(d)},{default:G(()=>[n.isGroupIntersection(u)?(T(),O("div",pOi)):ye("",!0),k("div",fOi,$(d.label),1),!d.component&&d.picto?(T(),O("span",gOi,$(d.picto),1)):d.component?(T(),te(s,{key:2,size:"xxs",class:"fill-primary"})):ye("",!0)]),_:2},1032,["onClick"]))),128)),o.asyncPredicateRunning?(T(),O("li",mOi,[_(l)])):ye("",!0)],4)),[[c,n.away]]):ye("",!0)}const vOi=W(hOi,[["render",AOi],["__scopeId","data-v-5b87d4a3"]]),bOi={name:"ViewerHeader",inject:["$viewer"],props:{visible:{type:Boolean,default:!0}},setup(){const t=Ut("$viewer"),e=Ta(new Map),i=o=>{if(!o.name)throw new TypeError("[Viewer Header] Content must have a name");if(e.has(o.name))throw new Error(`[Viewer Header] Content with name ${o.name} already exists`);e.set(o.name,o)},r=o=>e.has(o)?(e.delete(o),!0):!1;return{logo:t.uiSettings.bimdataLogo!==!1,version:t.uiSettings.version!==!1?t.version:null,headerContent:e,headerRightContentComponents:ut(()=>Array.from(e.values()).filter(o=>o.position==="right").sort((o,n)=>o.order-n.order).map(o=>o.component)),headerLeftContentComponents:ut(()=>Array.from(e.values()).filter(o=>o.position==="left").sort((o,n)=>o.order-n.order).map(o=>o.component)),addContent:i,removeContent:r}}},yOi={class:"viewer-header"},wOi={class:"viewer-header__content"},COi={class:"viewer-header__content__left"},xOi={class:"viewer-header__content__right"},kOi={key:0,class:"m-l-6 flex items-center"},MOi={key:1,class:"viewer-header__version"};function POi(t,e,i,r,o,n){const s=D("BIMDataIllustration");return Ot((T(),O("div",yOi,[k("div",wOi,[k("div",COi,[(T(!0),O(Pt,null,Xt(r.headerLeftContentComponents,a=>(T(),te(No(a),{key:a.name}))),128))]),k("div",xOi,[(T(!0),O(Pt,null,Xt(r.headerRightContentComponents,a=>(T(),te(No(a),{key:a.name}))),128))])]),r.logo||r.version?(T(),O("div",kOi,[r.logo?(T(),te(s,{key:0,name:"logo",width:"30px",height:"30px"})):ye("",!0),r.version?(T(),O("div",MOi,$(r.version),1)):ye("",!0)])):ye("",!0)],512)),[[Ai,i.visible]])}const EOi=W(bOi,[["render",POi],["__scopeId","data-v-5c9ea6b6"]]),SOi={emits:["resize"],setup(t,{emit:e}){return{onResizerMousedown:i=>{i.preventDefault();let r=i.clientX;const o=s=>{s.preventDefault();const a=s.clientX-r;r=s.clientX,e("resize",a)},n=s=>{s.preventDefault(),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",o),window.addEventListener("mouseup",n)}}}},BOi={class:"bimdata-separator"};function IOi(t,e,i,r,o,n){return T(),O("div",BOi,[e[1]||(e[1]=k("div",{class:"bimdata-separator__line"},null,-1)),k("div",{class:"bimdata-separator__resizer",onMousedown:e[0]||(e[0]=(...s)=>r.onResizerMousedown&&r.onResizerMousedown(...s))},null,32)])}const TOi=W(SOi,[["render",IOi],["__scopeId","data-v-79a3b3af"]]),ROi={components:{Separator:TOi},props:{position:{type:String,required:!0,validator(t){return["left","right"].includes(t)}},sidePanel:{type:Object,required:!0,validator(t){if(t.width&&(typeof t.width!="number"||t.width<0))return console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof t.width}`),!1;const e=typeof t?.component=="object";return e||console.error("[GlobalSidePanel] sidePanel must have a component property"),e}}},setup(t){const e=Oe(null),i=Oe(t.sidePanel.width??400),r=(o,n=1)=>{const s=i.value+o*n;i.value=Math.max(0,s)};return Ht(()=>t.sidePanel,()=>{Object.defineProperty(t.sidePanel,"width",{get(){return i.value},set(o){if(typeof o!="number"||o<=0){console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof o}`);return}i.value=o}}),Object.defineProperty(t.sidePanel,"componentInstance",{get(){return e.value},enumerable:!0})},{immediate:!0}),{componentInstance:e,width:i,onResize:r}}},DOi={class:"bimdata-global-side-panel__component"};function LOi(t,e,i,r,o,n){const s=D("Separator");return T(),O("div",{class:"bimdata-global-side-panel",style:Pe(`width: ${r.width}px`)},[i.sidePanel.resizable&&i.position==="right"?(T(),te(s,{key:0,onResize:e[0]||(e[0]=a=>r.onResize(a,-1))})):ye("",!0),k("div",DOi,[(T(),te(No(i.sidePanel.component),{ref:"componentInstance"},null,512))]),i.sidePanel.resizable&&i.position==="left"?(T(),te(s,{key:1,onResize:e[1]||(e[1]=a=>r.onResize(a))})):ye("",!0)],4)}const _Oi=W(ROi,[["render",LOi],["__scopeId","data-v-82d0d4cb"]]),FOi={name:"BimdataViewer",components:{ContextMenu:vOi,ViewerHeader:EOi,ModalManager:yEe,GlobalSidePanel:_Oi},setup(){const t=Ut("$viewer"),{globalContext:e,shortcutManager:i}=t;So(()=>{i&&i.destroy(),e.hub.clear()}),Br(()=>{t.pluginManager.runPluginsScripts(t)});const r=ut(()=>{var p;return t.uiSettings.bimdataLogo!==!1&&(e.localContexts.length!==1||((p=e.localContexts[0].window)==null?void 0:p.logoAndVersion))}),o=ut(()=>{var p;return t.uiSettings.version!==!1&&(e.localContexts.length!==1||(p=e.localContexts[0].window)!=null&&p.logoAndVersion)?t.version:null}),n=ut(()=>e.leftSidePanel),s=ut(()=>e.rightSidePanel),a=ut(()=>{var p;const g=t.uiSettings.header!==!1,f=e.localContexts.length===1&&((p=e.localContexts[0].window)==null?void 0:p.header)===!1,A=!!(n.value||s.value);return g&&(!f||A)}),l=t.uiSettings.contextMenu!==!1,c=Oe(null);function d(p){l&&c.value.open(p)}function u(){t.shortcutManager.active=!0}function h(){t.shortcutManager.active=!1}return{Layout:t.layout.areas.component,onContextMenu:d,onMouseenter:u,onMouseleave:h,isHeaderVisible:a,viewerTemplateRef:e.templateRef,modalManagerTemplateRef:e.modalManagerTemplateRef,headerTemplateRef:e.headerTemplateRef,contextMenuTemplateRef:c,contextMenuEnabled:l,bimdataLogoOnSingleWindow:r,viewerVersionOnSingleWindow:o,version:t.version,loading:ut(()=>e.loading),spinner:ut(()=>e.spinner),leftSidePanel:n,rightSidePanel:s}}},OOi={key:1,class:"bimdata-context-loading-overlay",style:{"z-index":"3"}},UOi={key:2,class:"viewer__logo"},NOi={key:1,class:"version m-t-6"};function jOi(t,e,i,r,o,n){const s=D("ModalManager"),a=D("ContextMenu"),l=D("ViewerHeader"),c=D("GlobalSidePanel"),d=D("BIMDataSpinner"),u=D("BIMDataIllustration");return T(),O("div",{id:"bimdata-viewer",ref:"viewerTemplateRef",class:"bimdata-viewer bimdata-design-system bimdata-scrollbar",onContextmenu:e[0]||(e[0]=(...h)=>r.onContextMenu&&r.onContextMenu(...h)),onMouseenter:e[1]||(e[1]=(...h)=>r.onMouseenter&&r.onMouseenter(...h)),onMouseleave:e[2]||(e[2]=(...h)=>r.onMouseleave&&r.onMouseleave(...h))},[_(s,{ref:"modalManagerTemplateRef"},null,512),r.contextMenuEnabled?(T(),te(a,{key:0,ref:"contextMenuTemplateRef"},null,512)):ye("",!0),_(l,{ref:"headerTemplateRef",visible:r.isHeaderVisible},null,8,["visible"]),k("div",{class:"bimdata-viewer__content",style:Pe(r.isHeaderVisible?"height: calc(100% - var(--bimdata-viewer-header-height, 40px))":"height: 100%")},[r.leftSidePanel?(T(),te(c,{key:0,"side-panel":r.leftSidePanel,position:"left"},null,8,["side-panel"])):ye("",!0),(T(),te(No(r.Layout),{style:"height: 100%; flex-grow: 1;"})),r.rightSidePanel?(T(),te(c,{key:1,"side-panel":r.rightSidePanel,position:"right"},null,8,["side-panel"])):ye("",!0)],4),r.loading?(T(),O("div",OOi,[r.spinner&&r.spinner.component?(T(),te(No(r.spinner.component),bd(dl({key:0},r.spinner.props)),null,16)):(T(),te(d,{key:1,size:"40px",border:"5px"}))])):ye("",!0),!r.isHeaderVisible&&(r.bimdataLogoOnSingleWindow||r.viewerVersionOnSingleWindow)?(T(),O("div",UOi,[r.bimdataLogoOnSingleWindow?(T(),te(u,{key:0,name:"logo"})):ye("",!0),r.viewerVersionOnSingleWindow?(T(),O("div",NOi,$(r.version),1)):ye("",!0)])):ye("",!0)],544)}const HOi=W(FOi,[["render",jOi],["__scopeId","data-v-0c1c941a"]]),VOi=["src"],zOi={class:"bimdata-models__header"},qOi={key:0,class:"bimdata-models__header__loader"},GOi={class:"bimdata-models__header__picto"},QOi={class:"bimdata-models__header__name"},KOi={key:0,class:"bimdata-models__header__name--empty"},WOi={key:1,class:"bimdata-models__header__name--empty"},ZOi={key:3},JOi=["onMousemove","onClick"],XOi={__name:"Models",props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:"350px"}},setup(t){const e=t,i=Ut("$viewer"),r=Oe(),o=Oe(0),n=Oe(0),s=Oe(),a=Ao([]),l=Oe(!1),c=ut(()=>i.localContext.loadedModels),d=ut(()=>i.localContext.loadedModelIds),u=ut(()=>i.localContext.loadingModelIds),h=ut(()=>i.localContext.multiModel),p=ut(()=>(e.customFilter?a.value.filter(e.customFilter):a.value).map(C=>c.value.find(M=>{var P;return((P=M.document)==null?void 0:P.head_id)!=null&&M.document.head_id===C.document.id})??C)),g=C=>d.value.includes(C),f=C=>u.value.includes(C),A=ut(()=>{var C;const{x:M,y:P}=((C=s.value)==null?void 0:C.getBoundingClientRect())??{x:0,y:0};return`top:${n.value-P}px; left:${o.value-M}px;`}),m=C=>{!h.value&&g(C.id)||u.value.length>0||(i.localContext.loadedModelIds.includes(C.id)?i.localContext.unloadModels([C.id]):i.localContext.loadModels([C.id]))},v=C=>{switch(C){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},y=(C,M)=>{C!=null&&C.viewer_360_file&&(o.value=M.clientX,n.value=M.clientY),r.value=C?.viewer_360_file},b=async C=>{l.value=!0;try{return(await i.api.apiClient.modelApi.getModels(i.api.cloudId,i.api.projectId,void 0,void 0,C)).filter(M=>i.state.models.some(P=>P.archived)||!M.archived).sort(pp("updated_at",!1))}catch(M){console.error("[Models] Cannot get project models. Error: ",M)}finally{l.value=!1}return[]},w=C=>{var M;return((M=C.children)==null?void 0:M.some(P=>g(P.id)))??!1};return b(i.localContext.modelTypes).then(C=>{a.value=C}),(C,M)=>{const P=D("BIMDataSpinner"),E=D("BIMDataIconModel3D"),S=D("BIMDataTextbox"),I=D("BIMDataCheckbox"),R=D("BIMDataRadio"),L=D("BIMDataIcon"),j=D("BIMDataDropdownList");return T(),O("div",{ref_key:"templateRef",ref:s,class:ke(["bimdata-models",{"bimdata-models--window-positioning":t.windowPositioning}])},[r.value?(T(),O("div",{key:0,class:"bimdata-models__preview",style:Pe(A.value)},[k("img",{src:r.value},null,8,VOi)],4)):ye("",!0),_(j,{style:Pe(`--bimdata-models-width: ${t.width};`),width:t.width,list:p.value,"element-key":"id","per-page":40,loading:l.value,class:"bimdata-models__list",disabled:p.value.length===0,onElementClick:m},{header:G(({isOpen:H})=>[k("div",zOi,[l.value||u.value.length>0?(T(),O("div",qOi,[_(P)])):(T(),O(Pt,{key:1},[k("div",GOi,[_(E)]),k("div",{class:ke(["bimdata-models__header__number bimdata-info-length",{"bimdata-models__header__number--empty":d.value.length===0}])},[k("span",null,$(d.value.length),1)],2),k("div",QOi,[p.value.length===0?(T(),O("span",KOi,$(C.$t("model.no_model")),1)):d.value.length===0?(T(),O("span",WOi,$(C.$t("model.no_loaded_model")),1)):d.value.length===1?(T(),te(S,{key:2,text:c.value[0].name,tooltip:!H},null,8,["text","tooltip"])):d.value.length>1?(T(),O("span",ZOi,$(C.$t("model.selected_models")),1)):ye("",!0)])],64))])]),element:G(({element:H,close:U})=>[k("div",{class:"bimdata-models__model",onMousemove:z=>t.preview&&y(H,z),onMouseout:M[0]||(M[0]=z=>t.preview&&y()),onClick:()=>{!h.value&&!g(H.id)&&U()}},[h.value?(T(),te(I,{key:0,"model-value":g(H.id)||w(H),disabled:H.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])):(T(),te(R,{key:1,"model-value":g(H.id)||w(H),disabled:H.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])),_(L,{margin:"0 calc(var(--spacing-unit) / 2)",name:v(H.status),size:"xs",class:ke({"fill-success":H.status==="C","fill-high":H.status==="E"})},null,8,["name","class"]),_(S,{class:ke({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":H.status!=="C"||u.value.length>0}),text:H.name,width:`calc(100% -
|
|
5526
5526
|
${h.value?13:23}px - 2 * 6px - 16px)`},null,8,["class","text","width"]),H.document&&!H.document.is_head_version?(T(),te(L,{key:2,name:"versioning",fill:"",color:"default",size:"xs",margin:"0 0 0 6px"})):ye("",!0)],40,JOi),f(H.id)?(T(),te(P,{key:0,class:"bimdata-models__model__spinner"})):ye("",!0)]),_:1},8,["style","width","list","loading","disabled"])],2)}}},MEe=W(XOi,[["__scopeId","data-v-34c2cf79"]]),YOi="data:image/svg+xml,%3csvg%20width='16'%20height='21'%20viewBox='0%200%2016%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.47193%202.76644C7.65699%202.84439%207.77716%203.02565%207.777%203.22661L7.77339%207.94624C7.77318%208.22238%207.54916%208.44655%207.27301%208.44693L2.4192%208.45366C2.21569%208.45394%202.03258%208.33085%201.95617%208.1424C1.87975%207.95394%201.92528%207.73773%202.07129%207.59566L6.92872%202.86931C7.0729%202.72902%207.28688%202.6885%207.47193%202.76644ZM3.65141%207.45195L6.77378%207.44762L6.7761%204.41157L3.65141%207.45195ZM5.81657%200.893911L6.02338%200.893274L13.3879%200.870595C14.679%200.866619%2015.7208%201.91642%2015.722%203.20083L15.2221%203.20237L15.722%203.20052L15.722%203.20083L15.745%2017.8999L15.745%2017.9002C15.7462%2019.1846%2014.7063%2020.2408%2013.4153%2020.2448L2.35929%2020.2788C1.07114%2020.2828%200.0171799%2019.2362%200.0159721%2017.9486L0.00563138%206.92409L0.00543684%206.71668L0.152103%206.56972L5.67032%201.04045L5.81657%200.893911ZM6.23113%201.89264L1.00582%207.12841L1.01597%2017.9455C1.01666%2018.6791%201.62068%2019.2811%202.35835%2019.2788L13.4143%2019.2448C14.1484%2019.2425%2014.7456%2018.6402%2014.745%2017.9035C14.745%2017.9034%2014.745%2017.9033%2014.745%2017.9033L14.722%203.20423L14.722%203.20391C14.7213%202.46716%2014.123%201.86833%2013.3888%201.87059L6.23113%201.89264Z'%20fill='%232F374A'/%3e%3c/svg%3e",$Oi=["src"],eUi={key:0,class:"bimdata-multi-model-loader__header-container"},tUi={key:0,class:"bimdata-multi-model-loader__header__loader"},iUi={class:"bimdata-multi-model-loader__header__picto"},rUi=["src"],oUi={class:"bimdata-multi-model-loader__header__name"},nUi={key:0,class:"bimdata-multi-model-loader__header__name--empty"},sUi={key:1,class:"bimdata-multi-model-loader__header__name--empty"},aUi={key:3},lUi={key:1,class:"bimdata-multi-model-loader__main"},cUi=["onMousemove","onClick"],dUi={__name:"BIMDataMultiModelLoader",props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:"350px"}},setup(t){const e=t,i=Ut("$viewer"),r=Oe(),o=Oe(0),n=Oe(0),s=Oe(),a=Ao([]),l=Oe(!1),c=Oe(!0),d=R=>{R.key==="Escape"?c.value=!0:R.key==="Enter"&&P()};Ht(c,R=>{R?(window.removeEventListener("keydown",d),y.clear(),v.clear(),r.value=null):window.addEventListener("keydown",d)});const u=ut(()=>i.localContext.loadedModels),h=ut(()=>i.localContext.loadedModelIds),p=ut(()=>i.localContext.loadingModelIds),g=ut(()=>i.localContext.multiModel),f=ut(()=>(e.customFilter?a.value.filter(e.customFilter):a.value).map(R=>u.value.find(L=>{var j;return((j=L.document)==null?void 0:j.head_id)!=null&&L.document.head_id===R.document.id})??R)),A=R=>h.value.includes(R),m=R=>p.value.includes(R),v=Ta(new Set),y=Ta(new Set),b=R=>{var L;return((L=R.children)==null?void 0:L.some(j=>A(j.id)))??!1},w=R=>(A(R.id)||b(R)||v.has(R))&&!y.has(R),C=ut(()=>{const{x:R,y:L}=s.value.getBoundingClientRect();return`top:${n.value-L}px; left:${o.value-R}px;`}),M=R=>{R.status==="C"&&(!g.value&&A(R.id)||(A(R.id)?y.has(R)?y.delete(R):y.add(R):v.has(R)?v.delete(R):v.add(R)))},P=()=>{v.size>0&&i.localContext.loadModels(Array.from(v).map(R=>R.id)),y.size>0&&i.localContext.unloadModels(Array.from(y).map(R=>R.id)),c.value=!0},E=R=>{switch(R){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},S=R=>R.document&&!R.document.is_head_version,I=(R,L)=>{!e.preview||c.value||(R!=null&&R.viewer_360_file&&(o.value=L.clientX,n.value=L.clientY),r.value=R?.viewer_360_file)};return(async R=>{l.value=!0;try{return(await i.api.apiClient.modelApi.getModels(i.api.cloudId,i.api.projectId,void 0,void 0,R)).filter(L=>i.state.models.some(j=>j.archived)||!L.archived).sort(pp("updated_at",!1))}catch(L){console.error("[Models] Cannot get project models. Error: ",L)}finally{l.value=!1}return[]})(i.localContext.modelTypes).then(R=>{a.value=R}),(R,L)=>{const j=D("BIMDataSpinner"),H=D("BIMDataTextbox"),U=D("BIMDataIconChevron"),z=D("BIMDataButton"),Z=D("BIMDataIconFileIfcPolychrome"),Y=D("BIMDataCheckbox"),de=D("BIMDataRadio"),he=D("BIMDataIcon"),ve=D("BIMDataPaginatedList"),Ee=sr("click-away");return T(),O("div",{ref_key:"templateRef",ref:s,class:ke(["bimdata-multi-model-loader",{"bimdata-multi-model-loader--window-positioning":t.windowPositioning}])},[r.value?(T(),O("div",{key:0,class:"bimdata-multi-model-loader__preview",style:Pe(C.value)},[k("img",{src:r.value},null,8,$Oi)],4)):ye("",!0),_(dr,{name:"fade",mode:"out-in"},{default:G(()=>[c.value?(T(),O("div",eUi,[Et(R.$slots,"left",{},void 0,!0),k("div",{class:"bimdata-multi-model-loader__header",onClick:L[0]||(L[0]=we=>c.value=!1)},[l.value||p.value.length>0?(T(),O("div",tUi,[_(j)])):(T(),O(Pt,{key:1},[k("div",iUi,[k("img",{src:zt(YOi),alt:"file icon"},null,8,rUi)]),k("div",{class:ke(["bimdata-multi-model-loader__header__number bimdata-info-length",{"bimdata-multi-model-loader__header__number--empty":h.value.length===0}])},[k("span",null,$(h.value.length),1)],2),k("div",oUi,[f.value.length===0?(T(),O("span",nUi,$(R.$t("model.no_model")),1)):h.value.length===0?(T(),O("span",sUi,$(R.$t("model.no_loaded_model")),1)):h.value.length===1?(T(),te(H,{key:2,text:u.value[0].name,tooltip:c.value,width:"233px"},null,8,["text","tooltip"])):h.value.length>1?(T(),O("span",aUi,$(R.$t("model.selected_models")),1)):ye("",!0)]),_(z,{color:"default",icon:"",radius:"",fill:"",width:"21px",height:"21px"},{default:G(()=>[_(U,{size:"xxxs"})]),_:1})],64))]),Et(R.$slots,"right",{},void 0,!0)])):Ot((T(),O("div",lUi,[_(ve,{list:f.value,"per-page":10},{element:G(({element:we})=>[k("div",{class:ke(["bimdata-multi-model-loader__main__model",{"bimdata-multi-model-loader__main__model--disabled":we.status!=="C"}]),onMousemove:De=>I(we,De),onMouseout:L[1]||(L[1]=De=>I()),onClick:De=>M(we)},[_(Z,{fill:"",color:"default",size:"xs"}),g.value?(T(),te(Y,{key:0,"model-value":w(we),disabled:we.status!=="C"},null,8,["model-value","disabled"])):(T(),te(de,{key:1,"model-value":w(we),disabled:we.status!=="C"},null,8,["model-value","disabled"])),_(H,{class:ke({"bimdata-multi-model-loader__main__model__name":!0,"bimdata-multi-model-loader__main__model__name--disabled":we.status!=="C"}),text:we.name,width:S(we)?"333px":"363px"},null,8,["class","text","width"]),S(we)?(T(),te(he,{key:2,name:"versioning",fill:"",color:"default",size:"xs",margin:"0 0 0 6px"})):ye("",!0),m(we.id)?(T(),te(j,{key:3,class:"bimdata-multi-model-loader__main__model__spinner"})):(T(),te(he,{key:4,name:E(we.status),size:"xs",class:ke({"fill-success":we.status==="C","fill-high":we.status==="E"})},null,8,["name","class"]))],42,cUi)]),_:1},8,["list"]),_(z,{class:"bimdata-multi-model-loader__main__validate",width:"93px",color:"primary",fill:"",radius:"",disabled:zt(v).size===0&&zt(y).size===0,onClick:P},{default:G(()=>[gt($(R.$t("global.validate")),1)]),_:1},8,["disabled"])])),[[Ee,()=>c.value=!0]])]),_:3})],2)}}},uUi=W(dUi,[["__scopeId","data-v-44e6af66"]]),hUi={data(){return{shown:!1}},mounted(){setTimeout(()=>{this.shown=!0},500)}};function pUi(t,e,i,r,o,n){const s=D("BIMDataIllustration");return T(),O("div",{class:"bimdata__no-model",style:Pe({"--no-model--opacity":o.shown?1:0})},[_(s,{name:"emptyViewer",x:"90",y:"90"}),k("span",null,$(t.$t("model.select_model")),1)],4)}const PEe=W(hUi,[["render",pUi],["__scopeId","data-v-5ffd9bc0"]]);window.BIMDataViewerVue=_le;class fUi{constructor(e={}){var i,r;const{api:o={},ui:n}=e;this.uiCfg=n,o.apiUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `apiUrl` not set, use 'https://api.bimdata.io' by default."),o.apiUrl="https://api.bimdata.io"),o.archiveUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `archiveUrl` not set, use 'https://archive.bimdata.io' by default."),o.archiveUrl="https://archive.bimdata.io"),o.pdfBackendUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `pdfBackendUrl` not set, use 'https://pdf-backend.bimdata.io' by default."),o.pdfBackendUrl="https://pdf-backend.bimdata.io"),o.ifcIds&&(console.warn("[BIMData Viewer] DEPRECATED - Viewer config - please use the `modelIds` property instead of `ifcIds`."),o.modelIds===void 0&&(o.modelIds=o.ifcIds)),o.modelIds||(o.modelIds=[]),(i=o.offline)!=null&&i.dataFile&&(o.offline.data=o.offline.dataFile),this.$viewer=new wFi(e),(r=o.offline)!=null&&r.enabled?this.$viewer.api.enableOfflineMode(o.offline.data,o.offline.options).then(()=>this.state.loadModels(o.modelIds)):(this.$viewer.globalContext.loadingProcessStart(),this.state.loadModels(o.modelIds).finally(()=>this.$viewer.globalContext.loadingProcessEnd())),this.vueApp=null}get state(){return this.$viewer.state}get api(){return this.$viewer.api}async mount(e,i="3d"){var r;const{$viewer:o}=this;await o.api.ready;try{const u=await o.api.apiClient.collaborationApi.checkProjectAccess(o.api.cloudId,o.api.projectId);o.api.permissions=kEe(u)}catch{o.api.permissions=kEe()}const n=this.api.accessToken,{i18n:s}=o;s.registerTranslations(o.pluginManager.pluginTranslations),o.layout.apply(i);const a={i18n:s.i18nVuePlugin,data(){return{accessToken:n}},render(){return Ln(HOi,{style:"height: 100%"})}},l=Uy(a).use(s.i18nVuePlugin).use(lOi()).use(nOi({i18nPlugin:s.i18nVuePlugin})).use(FFi({apiClient:o.api.apiClient,i18nPlugin:s.i18nVuePlugin}));l.provide("$viewer",o),l.component("BIMDataModelLoader",MEe),l.component("BIMDataMultiModelLoader",uUi),l.component("BIMDataNoModelWindowPlaceHolder",PEe),l.component("BIMDataStoreySelector",qq),l.component("ModelsLoader",MEe),l.component("NoModelWindowPlaceHolder",PEe);const c=e instanceof HTMLElement?e:document.querySelector(e);c&&(c.style.height="100%");const d=l.mount(e);return d.$viewer=o,CFi(d.$el,(r=this.uiCfg)==null?void 0:r.style),typeof window<"u"&&(window.bimdataViewer=d),this.vueApp=l,d}destroy(){var e;(e=this.vueApp)==null||e.unmount()}setLocale(e){if(!Xle.includes(e))throw new Error(`Viewer available locales are ${Xle.join(", ")}.`);this.$viewer.i18n.locale=e}registerPlugin(e){this.$viewer.registerPlugin(e)}registerWindow(e){return this.$viewer.windowManager.registerWindow(e)}unregisterWindow(e){return this.$viewer.windowManager.unregisterWindow(e)}setAccessToken(e){this.api.accessToken=e}async loadModels(e){this.$viewer.globalContext.loadingProcessStart();const i=await this.state.loadModels(e);return this.$viewer.globalContext.loadingProcessEnd(),i}loadIfcs(e){return console.warn("[BIMData Viewer] DEPRECATED - Viewer - please use the loadModels method instead of loadIfcs."),this.loadModels(e)}}const EEe=(t={})=>new fUi(t);window.makeBIMDataViewer=EEe;const Sl=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),TY=[.001,0,0,.001,0,0],RY=1.35,rd={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},A2={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},gUi="pdfjs_internal_editor_",Qi={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,SIGNATURE:101},Tr={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35,DRAW_STEP:41},mUi={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},Ga={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},dL={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},es={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},l7={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},uL={ERRORS:0,WARNINGS:1,INFOS:5},hL={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},pL={moveTo:0,lineTo:1,curveTo:2,closePath:3},AUi={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let fL=uL.WARNINGS;function vUi(t){Number.isInteger(t)&&(fL=t)}function bUi(){return fL}function gL(t){fL>=uL.INFOS&&console.log(`Info: ${t}`)}function $i(t){fL>=uL.WARNINGS&&console.log(`Warning: ${t}`)}function Mo(t){throw new Error(t)}function ts(t,e){t||Mo(e)}function yUi(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function SEe(t,e=null,i=null){if(!t)return null;if(i&&typeof t=="string"){if(i.addDefaultProtocol&&t.startsWith("www.")){const o=t.match(/\./g);o?.length>=2&&(t=`http://${t}`)}if(i.tryConvertEncoding)try{t=MUi(t)}catch{}}const r=e?URL.parse(t,e):URL.parse(t);return yUi(r)?r:null}function BEe(t,e,i=!1){const r=URL.parse(t);return r?(r.hash=e,r.href):i&&SEe(t,"http://example.com")?t.split("#",1)[0]+`${e?`#${e}`:""}`:""}function br(t,e,i,r=!1){return Object.defineProperty(t,e,{value:i,enumerable:!r,configurable:!0,writable:!1}),i}const eA=function(){function t(e,i){this.message=e,this.name=i}return t.prototype=new Error,t.constructor=t,t}();let IEe=class extends eA{constructor(t,e){super(t,"PasswordException"),this.code=e}},DY=class extends eA{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}},LY=class extends eA{constructor(t){super(t,"InvalidPDFException")}},mL=class extends eA{constructor(t,e,i){super(t,"ResponseException"),this.status=e,this.missing=i}},wUi=class extends eA{constructor(t){super(t,"FormatError")}},v2=class extends eA{constructor(t){super(t,"AbortException")}};function TEe(t){(typeof t!="object"||t?.length===void 0)&&Mo("Invalid argument for bytesToString");const e=t.length,i=8192;if(e<i)return String.fromCharCode.apply(null,t);const r=[];for(let o=0;o<e;o+=i){const n=Math.min(o+i,e),s=t.subarray(o,n);r.push(String.fromCharCode.apply(null,s))}return r.join("")}function Fx(t){typeof t!="string"&&Mo("Invalid argument for stringToBytes");const e=t.length,i=new Uint8Array(e);for(let r=0;r<e;++r)i[r]=t.charCodeAt(r)&255;return i}function CUi(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,t&255)}function xUi(){const t=new Uint8Array(4);return t[0]=1,new Uint32Array(t.buffer,0,1)[0]===1}function kUi(){try{return new Function(""),!0}catch{return!1}}class aa{static get isLittleEndian(){return br(this,"isLittleEndian",xUi())}static get isEvalSupported(){return br(this,"isEvalSupported",kUi())}static get isOffscreenCanvasSupported(){return br(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return br(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){if(typeof navigator<"u"&&typeof navigator?.platform=="string"&&typeof navigator?.userAgent=="string"){const{platform:e,userAgent:i}=navigator;return br(this,"platform",{isAndroid:i.includes("Android"),isLinux:e.includes("Linux"),isMac:e.includes("Mac"),isWindows:e.includes("Win"),isFirefox:i.includes("Firefox")})}return br(this,"platform",{isAndroid:!1,isLinux:!1,isMac:!1,isWindows:!1,isFirefox:!1})}static get isCSSRoundSupported(){var e,i;return br(this,"isCSSRoundSupported",(i=(e=globalThis.CSS)==null?void 0:e.supports)==null?void 0:i.call(e,"width: round(1.5px, 1px)"))}}const _Y=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));var tA,FY,AL,OY;let vi=(FY=class{static makeHexColor(t,e,i){return`#${_Y[t]}${_Y[e]}${_Y[i]}`}static scaleMinMax(t,e){let i;t[0]?(t[0]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[3],e[3]*=t[3]):(i=e[0],e[0]=e[1],e[1]=i,i=e[2],e[2]=e[3],e[3]=i,t[1]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e,i=0){const r=t[i],o=t[i+1];t[i]=r*e[0]+o*e[2]+e[4],t[i+1]=r*e[1]+o*e[3]+e[5]}static applyTransformToBezier(t,e,i=0){const r=e[0],o=e[1],n=e[2],s=e[3],a=e[4],l=e[5];for(let c=0;c<6;c+=2){const d=t[i+c],u=t[i+c+1];t[i+c]=d*r+u*n+a,t[i+c+1]=d*o+u*s+l}}static applyInverseTransform(t,e){const i=t[0],r=t[1],o=e[0]*e[3]-e[1]*e[2];t[0]=(i*e[3]-r*e[2]+e[2]*e[5]-e[4]*e[3])/o,t[1]=(-i*e[1]+r*e[0]+e[4]*e[1]-e[5]*e[0])/o}static axialAlignedBoundingBox(t,e,i){const r=e[0],o=e[1],n=e[2],s=e[3],a=e[4],l=e[5],c=t[0],d=t[1],u=t[2],h=t[3];let p=r*c+a,g=p,f=r*u+a,A=f,m=s*d+l,v=m,y=s*h+l,b=y;if(o!==0||n!==0){const w=o*c,C=o*u,M=n*d,P=n*h;p+=M,A+=M,f+=P,g+=P,m+=w,b+=w,y+=C,v+=C}i[0]=Math.min(i[0],p,f,g,A),i[1]=Math.min(i[1],m,y,v,b),i[2]=Math.max(i[2],p,f,g,A),i[3]=Math.max(i[3],m,y,v,b)}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t,e){const i=t[0],r=t[1],o=t[2],n=t[3],s=i**2+r**2,a=i*o+r*n,l=o**2+n**2,c=(s+l)/2,d=Math.sqrt(c**2-(s*l-a**2));e[0]=Math.sqrt(c+d||1),e[1]=Math.sqrt(c-d||1)}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),r=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>r)return null;const o=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),n=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return o>n?null:[i,o,r,n]}static pointBoundingBox(t,e,i){i[0]=Math.min(i[0],t),i[1]=Math.min(i[1],e),i[2]=Math.max(i[2],t),i[3]=Math.max(i[3],e)}static rectBoundingBox(t,e,i,r,o){o[0]=Math.min(o[0],t,i),o[1]=Math.min(o[1],e,r),o[2]=Math.max(o[2],t,i),o[3]=Math.max(o[3],e,r)}static bezierBoundingBox(t,e,i,r,o,n,s,a,l){l[0]=Math.min(l[0],t,s),l[1]=Math.min(l[1],e,a),l[2]=Math.max(l[2],t,s),l[3]=Math.max(l[3],e,a),oe(this,tA,OY).call(this,t,i,o,s,e,r,n,a,3*(-t+3*(i-o)+s),6*(t-2*i+o),3*(i-t),l),oe(this,tA,OY).call(this,t,i,o,s,e,r,n,a,3*(-e+3*(r-n)+a),6*(e-2*r+n),3*(r-e),l)}},tA=new WeakSet,AL=function(t,e,i,r,o,n,s,a,l,c){if(l<=0||l>=1)return;const d=1-l,u=l*l,h=u*l,p=d*(d*(d*t+3*l*e)+3*u*i)+h*r,g=d*(d*(d*o+3*l*n)+3*u*s)+h*a;c[0]=Math.min(c[0],p),c[1]=Math.min(c[1],g),c[2]=Math.max(c[2],p),c[3]=Math.max(c[3],g)},OY=function(t,e,i,r,o,n,s,a,l,c,d,u){if(Math.abs(l)<1e-12){Math.abs(c)>=1e-12&&oe(this,tA,AL).call(this,t,e,i,r,o,n,s,a,-d/c,u);return}const h=c**2-4*d*l;if(h<0)return;const p=Math.sqrt(h),g=2*l;oe(this,tA,AL).call(this,t,e,i,r,o,n,s,a,(-c+p)/g,u),oe(this,tA,AL).call(this,t,e,i,r,o,n,s,a,(-c-p)/g,u)},ne(FY,tA),FY);function MUi(t){return decodeURIComponent(escape(t))}let UY=null,REe=null;function PUi(t){return UY||(UY=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,REe=new Map([["\uFB05","\u017Ft"]])),t.replaceAll(UY,(e,i,r)=>i?i.normalize("NFKC"):REe.get(r))}function DEe(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const t=new Uint8Array(32);return crypto.getRandomValues(t),TEe(t)}const NY="pdfjs_internal_id_";function EUi(t,e,i){if(!Array.isArray(i)||i.length<2)return!1;const[r,o,...n]=i;if(!t(r)&&!Number.isInteger(r)||!e(o))return!1;const s=n.length;let a=!0;switch(o.name){case"XYZ":if(s<2||s>3)return!1;break;case"Fit":case"FitB":return s===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(s>1)return!1;break;case"FitR":if(s!==4)return!1;a=!1;break;default:return!1}for(const l of n)if(!(typeof l=="number"||a&&l===null))return!1;return!0}function Bl(t,e,i){return Math.min(Math.max(t,e),i)}function LEe(t){return Uint8Array.prototype.toBase64?t.toBase64():btoa(TEe(t))}function SUi(t){return Uint8Array.fromBase64?Uint8Array.fromBase64(t):Fx(atob(t))}typeof Promise.try!="function"&&(Promise.try=function(t,...e){return new Promise(i=>{i(t(...e))})}),typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(t){return t.reduce((e,i)=>e+i,0)});const Wp="http://www.w3.org/2000/svg",c7=class{};It(c7,"CSS",96),It(c7,"PDF",72),It(c7,"PDF_TO_CSS_UNITS",c7.CSS/c7.PDF);let d7=c7;async function Ox(t,e="text"){if(u7(t,document.baseURI)){const i=await fetch(t);if(!i.ok)throw new Error(i.statusText);switch(e){case"arraybuffer":return i.arrayBuffer();case"blob":return i.blob();case"json":return i.json()}return i.text()}return new Promise((i,r)=>{const o=new XMLHttpRequest;o.open("GET",t,!0),o.responseType=e,o.onreadystatechange=()=>{if(o.readyState===XMLHttpRequest.DONE){if(o.status===200||o.status===0){switch(e){case"arraybuffer":case"blob":case"json":i(o.response);return}i(o.responseText);return}r(new Error(o.statusText))}},o.send(null)})}class qP{constructor({viewBox:e,userUnit:i,scale:r,rotation:o,offsetX:n=0,offsetY:s=0,dontFlip:a=!1}){this.viewBox=e,this.userUnit=i,this.scale=r,this.rotation=o,this.offsetX=n,this.offsetY=s,r*=i;const l=(e[2]+e[0])/2,c=(e[3]+e[1])/2;let d,u,h,p;switch(o%=360,o<0&&(o+=360),o){case 180:d=-1,u=0,h=0,p=1;break;case 90:d=0,u=1,h=1,p=0;break;case 270:d=0,u=-1,h=-1,p=0;break;case 0:d=1,u=0,h=0,p=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(h=-h,p=-p);let g,f,A,m;d===0?(g=Math.abs(c-e[1])*r+n,f=Math.abs(l-e[0])*r+s,A=(e[3]-e[1])*r,m=(e[2]-e[0])*r):(g=Math.abs(l-e[0])*r+n,f=Math.abs(c-e[1])*r+s,A=(e[2]-e[0])*r,m=(e[3]-e[1])*r),this.transform=[d*r,u*r,h*r,p*r,g-d*r*l-h*r*c,f-u*r*l-p*r*c],this.width=A,this.height=m}get rawDims(){const e=this.viewBox;return br(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:i=this.rotation,offsetX:r=this.offsetX,offsetY:o=this.offsetY,dontFlip:n=!1}={}){return new qP({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:e,rotation:i,offsetX:r,offsetY:o,dontFlip:n})}convertToViewportPoint(e,i){const r=[e,i];return vi.applyTransform(r,this.transform),r}convertToViewportRectangle(e){const i=[e[0],e[1]];vi.applyTransform(i,this.transform);const r=[e[2],e[3]];return vi.applyTransform(r,this.transform),[i[0],i[1],r[0],r[1]]}convertToPdfPoint(e,i){const r=[e,i];return vi.applyInverseTransform(r,this.transform),r}}class jY extends eA{constructor(e,i=0){super(e,"RenderingCancelledException"),this.extraDelay=i}}function vL(t){const e=t.length;let i=0;for(;i<e&&t[i].trim()==="";)i++;return t.substring(i,i+5).toLowerCase()==="data:"}function HY(t){return typeof t=="string"&&/\.pdf$/i.test(t)}function BUi(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function IUi(t,e="document.pdf"){if(typeof t!="string")return e;if(vL(t))return $i('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const i=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,r=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,o=i.exec(t);let n=r.exec(o[1])||r.exec(o[2])||r.exec(o[3]);if(n&&(n=n[0],n.includes("%")))try{n=r.exec(decodeURIComponent(n))[0]}catch{}return n||e}class _Ee{constructor(){It(this,"started",Object.create(null)),It(this,"times",[])}time(e){e in this.started&&$i(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||$i(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let i=0;for(const{name:r}of this.times)i=Math.max(r.length,i);for(const{name:r,start:o,end:n}of this.times)e.push(`${r.padEnd(i)} ${n-o}ms
|
|
5527
5527
|
`);return e.join("")}}function u7(t,e){const i=e?URL.parse(t,e):URL.parse(t);return i?.protocol==="http:"||i?.protocol==="https:"}function Zu(t){t.preventDefault()}function is(t){t.preventDefault(),t.stopPropagation()}var Ux;class VY{static toDateObject(e){if(!e||typeof e!="string")return null;B(this,Ux)||ee(this,Ux,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const i=B(this,Ux).exec(e);if(!i)return null;const r=parseInt(i[1],10);let o=parseInt(i[2],10);o=o>=1&&o<=12?o-1:0;let n=parseInt(i[3],10);n=n>=1&&n<=31?n:1;let s=parseInt(i[4],10);s=s>=0&&s<=23?s:0;let a=parseInt(i[5],10);a=a>=0&&a<=59?a:0;let l=parseInt(i[6],10);l=l>=0&&l<=59?l:0;const c=i[7]||"Z";let d=parseInt(i[8],10);d=d>=0&&d<=23?d:0;let u=parseInt(i[9],10)||0;return u=u>=0&&u<=59?u:0,c==="-"?(s+=d,a+=u):c==="+"&&(s-=d,a-=u),new Date(Date.UTC(r,o,n,s,a,l))}}Ux=new WeakMap,ne(VY,Ux);function TUi(t,{scale:e=1,rotation:i=0}){const{width:r,height:o}=t.attributes.style,n=[0,0,parseInt(r),parseInt(o)];return new qP({viewBox:n,userUnit:1,scale:e,rotation:i})}function zY(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map(e=>parseInt(e)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):($i(`Not a valid color format: "${t}"`),[0,0,0])}function RUi(t){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const i of t.keys()){e.style.color=i;const r=window.getComputedStyle(e).color;t.set(i,zY(r))}e.remove()}function pn(t){const{a:e,b:i,c:r,d:o,e:n,f:s}=t.getTransform();return[e,i,r,o,n,s]}function s1(t){const{a:e,b:i,c:r,d:o,e:n,f:s}=t.getTransform().invertSelf();return[e,i,r,o,n,s]}function iA(t,e,i=!1,r=!0){if(e instanceof qP){const{pageWidth:o,pageHeight:n}=e.rawDims,{style:s}=t,a=aa.isCSSRoundSupported,l=`var(--total-scale-factor) * ${o}px`,c=`var(--total-scale-factor) * ${n}px`,d=a?`round(down, ${l}, var(--scale-round-x))`:`calc(${l})`,u=a?`round(down, ${c}, var(--scale-round-y))`:`calc(${c})`;!i||e.rotation%180===0?(s.width=d,s.height=u):(s.width=u,s.height=d)}r&&t.setAttribute("data-main-rotation",e.rotation)}class F0{constructor(){const{pixelRatio:e}=F0;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(e,i,r,o){let n=1/0,s=1/0,a=1/0;r>0&&(n=Math.sqrt(r/(e*i))),o!==-1&&(s=o/e,a=o/i);const l=Math.min(n,s,a);return this.sx>l||this.sy>l?(this.sx=l,this.sy=l,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}}const qY=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];var rA,h7,Ju,oA,bL,Nx,jx,GY,FEe,Vd,OEe,UEe,Hx,NEe,yL;const wL=class aU{constructor(e){ne(this,Vd),ne(this,rA,null),ne(this,h7,null),ne(this,Ju),ne(this,oA,null),ne(this,bL,null),ne(this,Nx,null),ee(this,Ju,e),B(aU,jx)||ee(aU,jx,Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"}))}render(){const e=ee(this,rA,document.createElement("div"));e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const i=B(this,Ju)._uiManager._signal;e.addEventListener("contextmenu",Zu,{signal:i}),e.addEventListener("pointerdown",oe(aU,GY,FEe),{signal:i});const r=ee(this,oA,document.createElement("div"));r.className="buttons",e.append(r);const o=B(this,Ju).toolbarPosition;if(o){const{style:n}=e,s=B(this,Ju)._uiManager.direction==="ltr"?1-o[0]:o[0];n.insetInlineEnd=`${100*s}%`,n.top=`calc(${100*o[1]}% + var(--editor-toolbar-vert-offset))`}return oe(this,Vd,NEe).call(this),e}get div(){return B(this,rA)}hide(){var e;B(this,rA).classList.add("hidden"),(e=B(this,h7))==null||e.hideDropdown()}show(){var e;B(this,rA).classList.remove("hidden"),(e=B(this,bL))==null||e.shown()}async addAltText(e){const i=await e.render();oe(this,Vd,Hx).call(this,i),B(this,oA).prepend(i,B(this,Vd,yL)),ee(this,bL,e)}addColorPicker(e){ee(this,h7,e);const i=e.renderButton();oe(this,Vd,Hx).call(this,i),B(this,oA).prepend(i,B(this,Vd,yL))}async addEditSignatureButton(e){const i=ee(this,Nx,await e.renderEditButton(B(this,Ju)));oe(this,Vd,Hx).call(this,i),B(this,oA).prepend(i,B(this,Vd,yL))}updateEditSignatureButton(e){B(this,Nx)&&(B(this,Nx).title=e)}remove(){var e;B(this,rA).remove(),(e=B(this,h7))==null||e.destroy(),ee(this,h7,null)}};rA=new WeakMap,h7=new WeakMap,Ju=new WeakMap,oA=new WeakMap,bL=new WeakMap,Nx=new WeakMap,jx=new WeakMap,GY=new WeakSet,FEe=function(t){t.stopPropagation()},Vd=new WeakSet,OEe=function(t){B(this,Ju)._focusEventsAllowed=!1,is(t)},UEe=function(t){B(this,Ju)._focusEventsAllowed=!0,is(t)},Hx=function(t){const e=B(this,Ju)._uiManager._signal;t.addEventListener("focusin",oe(this,Vd,OEe).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",oe(this,Vd,UEe).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",Zu,{signal:e})},NEe=function(){const{editorType:t,_uiManager:e}=B(this,Ju),i=document.createElement("button");i.className="delete",i.tabIndex=0,i.setAttribute("data-l10n-id",B(wL,jx)[t]),oe(this,Vd,Hx).call(this,i),i.addEventListener("click",r=>{e.delete()},{signal:e._signal}),B(this,oA).append(i)},yL=function(){const t=document.createElement("div");return t.className="divider",t},ne(wL,GY),ne(wL,jx,null);let DUi=wL;var CL,nA,p7,Vx,jEe,HEe,VEe;class LUi{constructor(e){ne(this,Vx),ne(this,CL,null),ne(this,nA,null),ne(this,p7),ee(this,p7,e)}show(e,i,r){const[o,n]=oe(this,Vx,HEe).call(this,i,r),{style:s}=B(this,nA)||ee(this,nA,oe(this,Vx,jEe).call(this));e.append(B(this,nA)),s.insetInlineEnd=`${100*o}%`,s.top=`calc(${100*n}% + var(--editor-toolbar-vert-offset))`}hide(){B(this,nA).remove()}}CL=new WeakMap,nA=new WeakMap,p7=new WeakMap,Vx=new WeakSet,jEe=function(){const t=ee(this,nA,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",Zu,{signal:B(this,p7)._signal});const e=ee(this,CL,document.createElement("div"));return e.className="buttons",t.append(e),oe(this,Vx,VEe).call(this),t},HEe=function(t,e){let i=0,r=0;for(const o of t){const n=o.y+o.height;if(n<i)continue;const s=o.x+(e?o.width:0);if(n>i){r=s,i=n;continue}e?s>r&&(r=s):s<r&&(r=s)}return[e?1-r:r,i]},VEe=function(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const e=document.createElement("span");t.append(e),e.className="visuallyHidden",e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const i=B(this,p7)._signal;t.addEventListener("contextmenu",Zu,{signal:i}),t.addEventListener("click",()=>{B(this,p7).highlightSelection("floating_button")},{signal:i}),B(this,CL).append(t)};function QY(t,e,i){for(const r of i)e.addEventListener(r,t[r].bind(t))}var KY;class _Ui{constructor(){ne(this,KY,0)}get id(){return`${gUi}${Ql(this,KY)._++}`}}KY=new WeakMap;var zx,xL,Cs,qx,kL;const zEe=class{constructor(){ne(this,qx),ne(this,zx,DEe()),ne(this,xL,0),ne(this,Cs,null)}static get _isSVGFittingCanvas(){const e='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',i=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),r=new Image;r.src=e;const o=r.decode().then(()=>(i.drawImage(r,0,0,1,1,0,0,1,3),new Uint32Array(i.getImageData(0,0,1,1).data.buffer)[0]===0));return br(this,"_isSVGFittingCanvas",o)}async getFromFile(e){const{lastModified:i,name:r,size:o,type:n}=e;return oe(this,qx,kL).call(this,`${i}_${r}_${o}_${n}`,e)}async getFromUrl(e){return oe(this,qx,kL).call(this,e,e)}async getFromBlob(e,i){const r=await i;return oe(this,qx,kL).call(this,e,r)}async getFromId(e){B(this,Cs)||ee(this,Cs,new Map);const i=B(this,Cs).get(e);if(!i)return null;if(i.bitmap)return i.refCounter+=1,i;if(i.file)return this.getFromFile(i.file);if(i.blobPromise){const{blobPromise:r}=i;return delete i.blobPromise,this.getFromBlob(i.id,r)}return this.getFromUrl(i.url)}getFromCanvas(e,i){B(this,Cs)||ee(this,Cs,new Map);let r=B(this,Cs).get(e);if(r!=null&&r.bitmap)return r.refCounter+=1,r;const o=new OffscreenCanvas(i.width,i.height);return o.getContext("2d").drawImage(i,0,0),r={bitmap:o.transferToImageBitmap(),id:`image_${B(this,zx)}_${Ql(this,xL)._++}`,refCounter:1,isSvg:!1},B(this,Cs).set(e,r),B(this,Cs).set(r.id,r),r}getSvgUrl(e){const i=B(this,Cs).get(e);return i!=null&&i.isSvg?i.svgUrl:null}deleteId(e){var i;B(this,Cs)||ee(this,Cs,new Map);const r=B(this,Cs).get(e);if(!r||(r.refCounter-=1,r.refCounter!==0))return;const{bitmap:o}=r;if(!r.url&&!r.file){const n=new OffscreenCanvas(o.width,o.height);n.getContext("bitmaprenderer").transferFromImageBitmap(o),r.blobPromise=n.convertToBlob()}(i=o.close)==null||i.call(o),r.bitmap=null}isValidId(e){return e.startsWith(`image_${B(this,zx)}_`)}};zx=new WeakMap,xL=new WeakMap,Cs=new WeakMap,qx=new WeakSet,kL=async function(t,e){B(this,Cs)||ee(this,Cs,new Map);let i=B(this,Cs).get(t);if(i===null)return null;if(i!=null&&i.bitmap)return i.refCounter+=1,i;try{i||(i={bitmap:null,id:`image_${B(this,zx)}_${Ql(this,xL)._++}`,refCounter:0,isSvg:!1});let r;if(typeof e=="string"?(i.url=e,r=await Ox(e,"blob")):e instanceof File?r=i.file=e:e instanceof Blob&&(r=e),r.type==="image/svg+xml"){const o=zEe._isSVGFittingCanvas,n=new FileReader,s=new Image,a=new Promise((l,c)=>{s.onload=()=>{i.bitmap=s,i.isSvg=!0,l()},n.onload=async()=>{const d=i.svgUrl=n.result;s.src=await o?`${d}#svgView(preserveAspectRatio(none))`:d},s.onerror=n.onerror=c});n.readAsDataURL(r),await a}else i.bitmap=await createImageBitmap(r);i.refCounter=1}catch(r){$i(r),i=null}return B(this,Cs).set(t,i),i&&B(this,Cs).set(i.id,i),i};let FUi=zEe;var rs,sA,ML,$o;class OUi{constructor(e=128){ne(this,rs,[]),ne(this,sA,!1),ne(this,ML),ne(this,$o,-1),ee(this,ML,e)}add({cmd:e,undo:i,post:r,mustExec:o,type:n=NaN,overwriteIfSameType:s=!1,keepUndo:a=!1}){if(o&&e(),B(this,sA))return;const l={cmd:e,undo:i,post:r,type:n};if(B(this,$o)===-1){B(this,rs).length>0&&(B(this,rs).length=0),ee(this,$o,0),B(this,rs).push(l);return}if(s&&B(this,rs)[B(this,$o)].type===n){a&&(l.undo=B(this,rs)[B(this,$o)].undo),B(this,rs)[B(this,$o)]=l;return}const c=B(this,$o)+1;c===B(this,ML)?B(this,rs).splice(0,1):(ee(this,$o,c),c<B(this,rs).length&&B(this,rs).splice(c)),B(this,rs).push(l)}undo(){if(B(this,$o)===-1)return;ee(this,sA,!0);const{undo:e,post:i}=B(this,rs)[B(this,$o)];e(),i?.(),ee(this,sA,!1),ee(this,$o,B(this,$o)-1)}redo(){if(B(this,$o)<B(this,rs).length-1){ee(this,$o,B(this,$o)+1),ee(this,sA,!0);const{cmd:e,post:i}=B(this,rs)[B(this,$o)];e(),i?.(),ee(this,sA,!1)}}hasSomethingToUndo(){return B(this,$o)!==-1}hasSomethingToRedo(){return B(this,$o)<B(this,rs).length-1}cleanType(e){if(B(this,$o)!==-1){for(let i=B(this,$o);i>=0;i--)if(B(this,rs)[i].type!==e){B(this,rs).splice(i+1,B(this,$o)-i),ee(this,$o,i);return}B(this,rs).length=0,ee(this,$o,-1)}}destroy(){ee(this,rs,null)}}rs=new WeakMap,sA=new WeakMap,ML=new WeakMap,$o=new WeakMap;var WY,qEe;class Gx{constructor(e){ne(this,WY),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:i}=aa.platform;for(const[r,o,n={}]of e)for(const s of r){const a=s.startsWith("mac+");i&&a?(this.callbacks.set(s.slice(4),{callback:o,options:n}),this.allKeys.add(s.split("+").at(-1))):!i&&!a&&(this.callbacks.set(s,{callback:o,options:n}),this.allKeys.add(s.split("+").at(-1)))}}exec(e,i){if(!this.allKeys.has(i.key))return;const r=this.callbacks.get(oe(this,WY,qEe).call(this,i));if(!r)return;const{callback:o,options:{bubbles:n=!1,args:s=[],checker:a=null}}=r;a&&!a(e,i)||(o.bind(e,...s,i)(),n||is(i))}}WY=new WeakSet,qEe=function(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const e=this.buffer.join("+");return this.buffer.length=0,e};const GEe=class p_e{get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return RUi(e),br(this,"_colors",e)}convert(e){const i=zY(e);if(!window.matchMedia("(forced-colors: active)").matches)return i;for(const[r,o]of this._colors)if(o.every((n,s)=>n===i[s]))return p_e._colorsMapping.get(r);return i}getHexCode(e){const i=this._colors.get(e);return i?vi.makeHexColor(...i):e}};It(GEe,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let UUi=GEe;var Qx,zd,Ns,Qa,Kx,b2,f7,Xu,aA,lA,Wx,g7,Zp,a1,m7,PL,EL,Zx,SL,Jp,cA,Jx,dA,l1,ZY,uA,BL,hA,A7,v7,y2,IL,la,Po,w2,pA,b7,Xx,TL,fA,Xp,C2,RL,Yu,Pi,DL,JY,QEe,KEe,LL,WEe,ZEe,JEe,XY,XEe,YY,$Y,YEe,Il,Yp,$Ee,eSe,e$,tSe,Yx,t$;const i$=class Vie{constructor(e,i,r,o,n,s,a,l,c,d,u,h,p,g){ne(this,Pi),ne(this,Qx,new AbortController),ne(this,zd,null),ne(this,Ns,new Map),ne(this,Qa,new Map),ne(this,Kx,null),ne(this,b2,null),ne(this,f7,null),ne(this,Xu,new OUi),ne(this,aA,null),ne(this,lA,null),ne(this,Wx,0),ne(this,g7,new Set),ne(this,Zp,null),ne(this,a1,null),ne(this,m7,new Set),It(this,"_editorUndoBar",null),ne(this,PL,!1),ne(this,EL,!1),ne(this,Zx,!1),ne(this,SL,null),ne(this,Jp,null),ne(this,cA,null),ne(this,Jx,null),ne(this,dA,!1),ne(this,l1,null),ne(this,ZY,new _Ui),ne(this,uA,!1),ne(this,BL,!1),ne(this,hA,null),ne(this,A7,null),ne(this,v7,null),ne(this,y2,null),ne(this,IL,null),ne(this,la,Qi.NONE),ne(this,Po,new Set),ne(this,w2,null),ne(this,pA,null),ne(this,b7,null),ne(this,Xx,null),ne(this,TL,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1}),ne(this,fA,[0,0]),ne(this,Xp,null),ne(this,C2,null),ne(this,RL,null),ne(this,Yu,null);const f=this._signal=B(this,Qx).signal;ee(this,C2,e),ee(this,RL,i),ee(this,Kx,r),ee(this,pA,o),this._eventBus=n,n._on("editingaction",this.onEditingAction.bind(this),{signal:f}),n._on("pagechanging",this.onPageChanging.bind(this),{signal:f}),n._on("scalechanging",this.onScaleChanging.bind(this),{signal:f}),n._on("rotationchanging",this.onRotationChanging.bind(this),{signal:f}),n._on("setpreference",this.onSetPreference.bind(this),{signal:f}),n._on("switchannotationeditorparams",A=>this.updateParams(A.type,A.value),{signal:f}),oe(this,Pi,WEe).call(this),oe(this,Pi,YEe).call(this),oe(this,Pi,XY).call(this),ee(this,b2,s.annotationStorage),ee(this,SL,s.filterFactory),ee(this,b7,a),ee(this,Jx,l||null),ee(this,PL,c),ee(this,EL,d),ee(this,Zx,u),ee(this,IL,h||null),this.viewParameters={realScale:d7.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=p||null,this._supportsPinchToZoom=g!==!1}static get _keyboardManager(){const e=Vie.prototype,i=s=>B(s,C2).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&s.hasSomethingToControl(),r=(s,{target:a})=>{if(a instanceof HTMLInputElement){const{type:l}=a;return l!=="text"&&l!=="number"}return!0},o=this.TRANSLATE_SMALL,n=this.TRANSLATE_BIG;return br(this,"_keyboardManager",new Gx([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:r}],[["ctrl+z","mac+meta+z"],e.undo,{checker:r}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:r}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:r}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(s,{target:a})=>!(a instanceof HTMLButtonElement)&&B(s,C2).contains(a)&&!s.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(s,{target:a})=>!(a instanceof HTMLButtonElement)&&B(s,C2).contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-o,0],checker:i}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-n,0],checker:i}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[o,0],checker:i}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[n,0],checker:i}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-o],checker:i}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-n],checker:i}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,o],checker:i}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,n],checker:i}]]))}destroy(){var e,i,r,o,n,s,a,l;(e=B(this,Yu))==null||e.resolve(),ee(this,Yu,null),(i=B(this,Qx))==null||i.abort(),ee(this,Qx,null),this._signal=null;for(const c of B(this,Qa).values())c.destroy();B(this,Qa).clear(),B(this,Ns).clear(),B(this,m7).clear(),(r=B(this,y2))==null||r.clear(),ee(this,zd,null),B(this,Po).clear(),B(this,Xu).destroy(),(o=B(this,Kx))==null||o.destroy(),(n=B(this,pA))==null||n.destroy(),(s=B(this,l1))==null||s.hide(),ee(this,l1,null),(a=B(this,v7))==null||a.destroy(),ee(this,v7,null),B(this,Jp)&&(clearTimeout(B(this,Jp)),ee(this,Jp,null)),B(this,Xp)&&(clearTimeout(B(this,Xp)),ee(this,Xp,null)),(l=this._editorUndoBar)==null||l.destroy()}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return B(this,IL)}get useNewAltTextFlow(){return B(this,EL)}get useNewAltTextWhenAddingImage(){return B(this,Zx)}get hcmFilter(){return br(this,"hcmFilter",B(this,b7)?B(this,SL).addHCMFilter(B(this,b7).foreground,B(this,b7).background):"none")}get direction(){return br(this,"direction",getComputedStyle(B(this,C2)).direction)}get highlightColors(){return br(this,"highlightColors",B(this,Jx)?new Map(B(this,Jx).split(",").map(e=>e.split("=").map(i=>i.trim()))):null)}get highlightColorNames(){return br(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),ee(this,lA,e)}setMainHighlightColorPicker(e){ee(this,v7,e)}editAltText(e,i=!1){var r;(r=B(this,Kx))==null||r.editAltText(this,e,i)}getSignature(e){var i;(i=B(this,pA))==null||i.getSignature({uiManager:this,editor:e})}get signatureManager(){return B(this,pA)}switchToMode(e,i){this._eventBus.on("annotationeditormodechanged",i,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,i){this._eventBus.dispatch("setpreference",{source:this,name:e,value:i})}onSetPreference({name:e,value:i}){switch(e){case"enableNewAltTextWhenAddingImage":ee(this,Zx,i);break}}onPageChanging({pageNumber:e}){ee(this,Wx,e-1)}focusMainContainer(){B(this,C2).focus()}findParent(e,i){for(const r of B(this,Qa).values()){const{x:o,y:n,width:s,height:a}=r.div.getBoundingClientRect();if(e>=o&&e<=o+s&&i>=n&&i<=n+a)return r}return null}disableUserSelect(e=!1){B(this,RL).classList.toggle("noUserSelect",e)}addShouldRescale(e){B(this,m7).add(e)}removeShouldRescale(e){B(this,m7).delete(e)}onScaleChanging({scale:e}){var i;this.commitOrRemove(),this.viewParameters.realScale=e*d7.PDF_TO_CSS_UNITS;for(const r of B(this,m7))r.onScaleChanging();(i=B(this,lA))==null||i.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}highlightSelection(e=""){const i=document.getSelection();if(!i||i.isCollapsed)return;const{anchorNode:r,anchorOffset:o,focusNode:n,focusOffset:s}=i,a=i.toString(),l=oe(this,Pi,DL).call(this,i).closest(".textLayer"),c=this.getSelectionBoxes(l);if(!c)return;i.empty();const d=oe(this,Pi,JY).call(this,l),u=B(this,la)===Qi.NONE,h=()=>{d?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:c,anchorNode:r,anchorOffset:o,focusNode:n,focusOffset:s,text:a}),u&&this.showAllEditors("highlight",!0,!0)};if(u){this.switchToMode(Qi.HIGHLIGHT,h);return}h()}addToAnnotationStorage(e){!e.isEmpty()&&B(this,b2)&&!B(this,b2).has(e.id)&&B(this,b2).setValue(e.id,e)}blur(){if(this.isShiftKeyDown=!1,B(this,dA)&&(ee(this,dA,!1),oe(this,Pi,LL).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const i of B(this,Po))if(i.div.contains(e)){ee(this,A7,[i,e]),i._focusEventsAllowed=!1;break}}focus(){if(!B(this,A7))return;const[e,i]=B(this,A7);ee(this,A7,null),i.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),i.focus()}addEditListeners(){oe(this,Pi,XY).call(this),oe(this,Pi,YY).call(this)}removeEditListeners(){oe(this,Pi,XEe).call(this),oe(this,Pi,$Y).call(this)}dragOver(e){for(const{type:i}of e.dataTransfer.items)for(const r of B(this,a1))if(r.isHandlingMimeForPasting(i)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(const i of e.dataTransfer.items)for(const r of B(this,a1))if(r.isHandlingMimeForPasting(i.type)){r.paste(i,this.currentLayer),e.preventDefault();return}}copy(e){var i;if(e.preventDefault(),(i=B(this,zd))==null||i.commitOrRemove(),!this.hasSelection)return;const r=[];for(const o of B(this,Po)){const n=o.serialize(!0);n&&r.push(n)}r.length!==0&&e.clipboardData.setData("application/pdfjs",JSON.stringify(r))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();const{clipboardData:i}=e;for(const n of i.items)for(const s of B(this,a1))if(s.isHandlingMimeForPasting(n.type)){s.paste(n,this.currentLayer);return}let r=i.getData("application/pdfjs");if(!r)return;try{r=JSON.parse(r)}catch(n){$i(`paste: "${n.message}".`);return}if(!Array.isArray(r))return;this.unselectAll();const o=this.currentLayer;try{const n=[];for(const l of r){const c=await o.deserialize(l);if(!c)return;n.push(c)}const s=()=>{for(const l of n)oe(this,Pi,e$).call(this,l);oe(this,Pi,t$).call(this,n)},a=()=>{for(const l of n)l.remove()};this.addCommands({cmd:s,undo:a,mustExec:!0})}catch(n){$i(`paste: "${n.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),B(this,la)!==Qi.NONE&&!this.isEditorHandlingKeyboard&&Vie._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,B(this,dA)&&(ee(this,dA,!1),oe(this,Pi,LL).call(this,"main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break}}setEditingState(e){e?(oe(this,Pi,ZEe).call(this),oe(this,Pi,YY).call(this),oe(this,Pi,Il).call(this,{isEditing:B(this,la)!==Qi.NONE,isEmpty:oe(this,Pi,Yx).call(this),hasSomethingToUndo:B(this,Xu).hasSomethingToUndo(),hasSomethingToRedo:B(this,Xu).hasSomethingToRedo(),hasSelectedEditor:!1})):(oe(this,Pi,JEe).call(this),oe(this,Pi,$Y).call(this),oe(this,Pi,Il).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!B(this,a1)){ee(this,a1,e);for(const i of B(this,a1))oe(this,Pi,Yp).call(this,i.defaultPropertiesToUpdate)}}getId(){return B(this,ZY).id}get currentLayer(){return B(this,Qa).get(B(this,Wx))}getLayer(e){return B(this,Qa).get(e)}get currentPageIndex(){return B(this,Wx)}addLayer(e){B(this,Qa).set(e.pageIndex,e),B(this,uA)?e.enable():e.disable()}removeLayer(e){B(this,Qa).delete(e.pageIndex)}async updateMode(e,i=null,r=!1){var o,n,s;if(B(this,la)!==e&&!(B(this,Yu)&&(await B(this,Yu).promise,!B(this,Yu)))){if(ee(this,Yu,Promise.withResolvers()),(o=B(this,lA))==null||o.commitOrRemove(),ee(this,la,e),e===Qi.NONE){this.setEditingState(!1),oe(this,Pi,eSe).call(this),(n=this._editorUndoBar)==null||n.hide(),B(this,Yu).resolve();return}e===Qi.SIGNATURE&&await((s=B(this,pA))==null?void 0:s.loadSignatures()),this.setEditingState(!0),await oe(this,Pi,$Ee).call(this),this.unselectAll();for(const a of B(this,Qa).values())a.updateMode(e);if(!i){r&&this.addNewEditorFromKeyboard(),B(this,Yu).resolve();return}for(const a of B(this,Ns).values())a.annotationElementId===i?(this.setSelected(a),a.enterInEditMode()):a.unselect();B(this,Yu).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e!==B(this,la)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,i){var r;if(B(this,a1)){switch(e){case Tr.CREATE:this.currentLayer.addNewEditor(i);return;case Tr.HIGHLIGHT_DEFAULT_COLOR:(r=B(this,v7))==null||r.updateColor(i);break;case Tr.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(B(this,Xx)||ee(this,Xx,new Map)).set(e,i),this.showAllEditors("highlight",i);break}for(const o of B(this,Po))o.updateParams(e,i);for(const o of B(this,a1))o.updateDefaultParams(e,i)}}showAllEditors(e,i,r=!1){var o;for(const n of B(this,Ns).values())n.editorType===e&&n.show(i);(((o=B(this,Xx))==null?void 0:o.get(Tr.HIGHLIGHT_SHOW_ALL))??!0)!==i&&oe(this,Pi,Yp).call(this,[[Tr.HIGHLIGHT_SHOW_ALL,i]])}enableWaiting(e=!1){if(B(this,BL)!==e){ee(this,BL,e);for(const i of B(this,Qa).values())e?i.disableClick():i.enableClick(),i.div.classList.toggle("waiting",e)}}getEditors(e){const i=[];for(const r of B(this,Ns).values())r.pageIndex===e&&i.push(r);return i}getEditor(e){return B(this,Ns).get(e)}addEditor(e){B(this,Ns).set(e.id,e)}removeEditor(e){var i,r;e.div.contains(document.activeElement)&&(B(this,Jp)&&clearTimeout(B(this,Jp)),ee(this,Jp,setTimeout(()=>{this.focusMainContainer(),ee(this,Jp,null)},0))),B(this,Ns).delete(e.id),e.annotationElementId&&((i=B(this,y2))==null||i.delete(e.annotationElementId)),this.unselect(e),(!e.annotationElementId||!B(this,g7).has(e.annotationElementId))&&((r=B(this,b2))==null||r.remove(e.id))}addDeletedAnnotationElement(e){B(this,g7).add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return B(this,g7).has(e)}removeDeletedAnnotationElement(e){B(this,g7).delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}setActiveEditor(e){B(this,zd)!==e&&(ee(this,zd,e),e&&oe(this,Pi,Yp).call(this,e.propertiesToUpdate))}updateUI(e){B(this,Pi,tSe)===e&&oe(this,Pi,Yp).call(this,e.propertiesToUpdate)}updateUIForDefaultProperties(e){oe(this,Pi,Yp).call(this,e.defaultPropertiesToUpdate)}toggleSelected(e){if(B(this,Po).has(e)){B(this,Po).delete(e),e.unselect(),oe(this,Pi,Il).call(this,{hasSelectedEditor:this.hasSelection});return}B(this,Po).add(e),e.select(),oe(this,Pi,Yp).call(this,e.propertiesToUpdate),oe(this,Pi,Il).call(this,{hasSelectedEditor:!0})}setSelected(e){var i;(i=B(this,lA))==null||i.commitOrRemove();for(const r of B(this,Po))r!==e&&r.unselect();B(this,Po).clear(),B(this,Po).add(e),e.select(),oe(this,Pi,Yp).call(this,e.propertiesToUpdate),oe(this,Pi,Il).call(this,{hasSelectedEditor:!0})}isSelected(e){return B(this,Po).has(e)}get firstSelectedEditor(){return B(this,Po).values().next().value}unselect(e){e.unselect(),B(this,Po).delete(e),oe(this,Pi,Il).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return B(this,Po).size!==0}get isEnterHandled(){return B(this,Po).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){var e;B(this,Xu).undo(),oe(this,Pi,Il).call(this,{hasSomethingToUndo:B(this,Xu).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:oe(this,Pi,Yx).call(this)}),(e=this._editorUndoBar)==null||e.hide()}redo(){B(this,Xu).redo(),oe(this,Pi,Il).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:B(this,Xu).hasSomethingToRedo(),isEmpty:oe(this,Pi,Yx).call(this)})}addCommands(e){B(this,Xu).add(e),oe(this,Pi,Il).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:oe(this,Pi,Yx).call(this)})}cleanUndoStack(e){B(this,Xu).cleanType(e)}delete(){var e;this.commitOrRemove();const i=(e=this.currentLayer)==null?void 0:e.endDrawingSession(!0);if(!this.hasSelection&&!i)return;const r=i?[i]:[...B(this,Po)],o=()=>{var s;(s=this._editorUndoBar)==null||s.show(n,r.length===1?r[0].editorType:r.length);for(const a of r)a.remove()},n=()=>{for(const s of r)oe(this,Pi,e$).call(this,s)};this.addCommands({cmd:o,undo:n,mustExec:!0})}commitOrRemove(){var e;(e=B(this,zd))==null||e.commitOrRemove()}hasSomethingToControl(){return B(this,zd)||this.hasSelection}selectAll(){for(const e of B(this,Po))e.commit();oe(this,Pi,t$).call(this,B(this,Ns).values())}unselectAll(){var e;if(!(B(this,zd)&&(B(this,zd).commitOrRemove(),B(this,la)!==Qi.NONE))&&!((e=B(this,lA))!=null&&e.commitOrRemove())&&this.hasSelection){for(const i of B(this,Po))i.unselect();B(this,Po).clear(),oe(this,Pi,Il).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(e,i,r=!1){if(r||this.commitOrRemove(),!this.hasSelection)return;B(this,fA)[0]+=e,B(this,fA)[1]+=i;const[o,n]=B(this,fA),s=[...B(this,Po)];B(this,Xp)&&clearTimeout(B(this,Xp)),ee(this,Xp,setTimeout(()=>{ee(this,Xp,null),B(this,fA)[0]=B(this,fA)[1]=0,this.addCommands({cmd:()=>{for(const l of s)B(this,Ns).has(l.id)&&(l.translateInPage(o,n),l.translationDone())},undo:()=>{for(const l of s)B(this,Ns).has(l.id)&&(l.translateInPage(-o,-n),l.translationDone())},mustExec:!1})},1e3));for(const l of s)l.translateInPage(e,i),l.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),ee(this,Zp,new Map);for(const e of B(this,Po))B(this,Zp).set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!B(this,Zp))return!1;this.disableUserSelect(!1);const e=B(this,Zp);ee(this,Zp,null);let i=!1;for(const[{x:o,y:n,pageIndex:s},a]of e)a.newX=o,a.newY=n,a.newPageIndex=s,i||(i=o!==a.savedX||n!==a.savedY||s!==a.savedPageIndex);if(!i)return!1;const r=(o,n,s,a)=>{if(B(this,Ns).has(o.id)){const l=B(this,Qa).get(a);l?o._setParentAndPosition(l,n,s):(o.pageIndex=a,o.x=n,o.y=s)}};return this.addCommands({cmd:()=>{for(const[o,{newX:n,newY:s,newPageIndex:a}]of e)r(o,n,s,a)},undo:()=>{for(const[o,{savedX:n,savedY:s,savedPageIndex:a}]of e)r(o,n,s,a)},mustExec:!0}),!0}dragSelectedEditors(e,i){if(B(this,Zp))for(const r of B(this,Zp).keys())r.drag(e,i)}rebuild(e){if(e.parent===null){const i=this.getLayer(e.pageIndex);i?(i.changeParent(e),i.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){var e;return((e=this.getActive())==null?void 0:e.shouldGetKeyboardEvents())||B(this,Po).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return B(this,zd)===e}getActive(){return B(this,zd)}getMode(){return B(this,la)}get imageManager(){return br(this,"imageManager",new FUi)}getSelectionBoxes(e){if(!e)return null;const i=document.getSelection();for(let c=0,d=i.rangeCount;c<d;c++)if(!e.contains(i.getRangeAt(c).commonAncestorContainer))return null;const{x:r,y:o,width:n,height:s}=e.getBoundingClientRect();let a;switch(e.getAttribute("data-main-rotation")){case"90":a=(c,d,u,h)=>({x:(d-o)/s,y:1-(c+u-r)/n,width:h/s,height:u/n});break;case"180":a=(c,d,u,h)=>({x:1-(c+u-r)/n,y:1-(d+h-o)/s,width:u/n,height:h/s});break;case"270":a=(c,d,u,h)=>({x:1-(d+h-o)/s,y:(c-r)/n,width:h/s,height:u/n});break;default:a=(c,d,u,h)=>({x:(c-r)/n,y:(d-o)/s,width:u/n,height:h/s});break}const l=[];for(let c=0,d=i.rangeCount;c<d;c++){const u=i.getRangeAt(c);if(!u.collapsed)for(const{x:h,y:p,width:g,height:f}of u.getClientRects())g===0||f===0||l.push(a(h,p,g,f))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:e,id:i}){(B(this,f7)||ee(this,f7,new Map)).set(e,i)}removeChangedExistingAnnotation({annotationElementId:e}){var i;(i=B(this,f7))==null||i.delete(e)}renderAnnotationElement(e){var i;const r=(i=B(this,f7))==null?void 0:i.get(e.data.id);if(!r)return;const o=B(this,b2).getRawValue(r);o&&(B(this,la)===Qi.NONE&&!o.hasBeenModified||o.renderAnnotationElement(e))}setMissingCanvas(e,i,r){var o;const n=(o=B(this,y2))==null?void 0:o.get(e);n&&(n.setCanvas(i,r),B(this,y2).delete(e))}addMissingCanvas(e,i){(B(this,y2)||ee(this,y2,new Map)).set(e,i)}};Qx=new WeakMap,zd=new WeakMap,Ns=new WeakMap,Qa=new WeakMap,Kx=new WeakMap,b2=new WeakMap,f7=new WeakMap,Xu=new WeakMap,aA=new WeakMap,lA=new WeakMap,Wx=new WeakMap,g7=new WeakMap,Zp=new WeakMap,a1=new WeakMap,m7=new WeakMap,PL=new WeakMap,EL=new WeakMap,Zx=new WeakMap,SL=new WeakMap,Jp=new WeakMap,cA=new WeakMap,Jx=new WeakMap,dA=new WeakMap,l1=new WeakMap,ZY=new WeakMap,uA=new WeakMap,BL=new WeakMap,hA=new WeakMap,A7=new WeakMap,v7=new WeakMap,y2=new WeakMap,IL=new WeakMap,la=new WeakMap,Po=new WeakMap,w2=new WeakMap,pA=new WeakMap,b7=new WeakMap,Xx=new WeakMap,TL=new WeakMap,fA=new WeakMap,Xp=new WeakMap,C2=new WeakMap,RL=new WeakMap,Yu=new WeakMap,Pi=new WeakSet,DL=function({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t},JY=function(t){const{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(const i of B(this,Qa).values())if(i.hasTextLayer(t))return i;return null},QEe=function(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=oe(this,Pi,DL).call(this,t).closest(".textLayer"),i=this.getSelectionBoxes(e);i&&(B(this,l1)||ee(this,l1,new LUi(this)),B(this,l1).show(e,i,this.direction==="ltr"))},KEe=function(){var t,e,i;const r=document.getSelection();if(!r||r.isCollapsed){B(this,w2)&&((t=B(this,l1))==null||t.hide(),ee(this,w2,null),oe(this,Pi,Il).call(this,{hasSelectedText:!1}));return}const{anchorNode:o}=r;if(o===B(this,w2))return;const n=oe(this,Pi,DL).call(this,r).closest(".textLayer");if(!n){B(this,w2)&&((e=B(this,l1))==null||e.hide(),ee(this,w2,null),oe(this,Pi,Il).call(this,{hasSelectedText:!1}));return}if((i=B(this,l1))==null||i.hide(),ee(this,w2,o),oe(this,Pi,Il).call(this,{hasSelectedText:!0}),!(B(this,la)!==Qi.HIGHLIGHT&&B(this,la)!==Qi.NONE)&&(B(this,la)===Qi.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),ee(this,dA,this.isShiftKeyDown),!this.isShiftKeyDown)){const s=B(this,la)===Qi.HIGHLIGHT?oe(this,Pi,JY).call(this,n):null;s?.toggleDrawing();const a=new AbortController,l=this.combinedSignal(a),c=d=>{d.type==="pointerup"&&d.button!==0||(a.abort(),s?.toggleDrawing(!0),d.type==="pointerup"&&oe(this,Pi,LL).call(this,"main_toolbar"))};window.addEventListener("pointerup",c,{signal:l}),window.addEventListener("blur",c,{signal:l})}},LL=function(t=""){B(this,la)===Qi.HIGHLIGHT?this.highlightSelection(t):B(this,PL)&&oe(this,Pi,QEe).call(this)},WEe=function(){document.addEventListener("selectionchange",oe(this,Pi,KEe).bind(this),{signal:this._signal})},ZEe=function(){if(B(this,cA))return;ee(this,cA,new AbortController);const t=this.combinedSignal(B(this,cA));window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})},JEe=function(){var t;(t=B(this,cA))==null||t.abort(),ee(this,cA,null)},XY=function(){if(B(this,hA))return;ee(this,hA,new AbortController);const t=this.combinedSignal(B(this,hA));window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})},XEe=function(){var t;(t=B(this,hA))==null||t.abort(),ee(this,hA,null)},YY=function(){if(B(this,aA))return;ee(this,aA,new AbortController);const t=this.combinedSignal(B(this,aA));document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})},$Y=function(){var t;(t=B(this,aA))==null||t.abort(),ee(this,aA,null)},YEe=function(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})},Il=function(t){Object.entries(t).some(([e,i])=>B(this,TL)[e]!==i)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(B(this,TL),t)}),B(this,la)===Qi.HIGHLIGHT&&t.hasSelectedEditor===!1&&oe(this,Pi,Yp).call(this,[[Tr.HIGHLIGHT_FREE,!0]]))},Yp=function(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})},$Ee=async function(){if(!B(this,uA)){ee(this,uA,!0);const t=[];for(const e of B(this,Qa).values())t.push(e.enable());await Promise.all(t);for(const e of B(this,Ns).values())e.enable()}},eSe=function(){if(this.unselectAll(),B(this,uA)){ee(this,uA,!1);for(const t of B(this,Qa).values())t.disable();for(const t of B(this,Ns).values())t.disable()}},e$=function(t){const e=B(this,Qa).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))},tSe=function(){let t=null;for(t of B(this,Po));return t},Yx=function(){if(B(this,Ns).size===0)return!0;if(B(this,Ns).size===1)for(const t of B(this,Ns).values())return t.isEmpty();return!1},t$=function(t){for(const e of B(this,Po))e.unselect();B(this,Po).clear();for(const e of t)e.isEmpty()||(B(this,Po).add(e),e.select());oe(this,Pi,Il).call(this,{hasSelectedEditor:this.hasSelection})},It(i$,"TRANSLATE_SMALL",1),It(i$,"TRANSLATE_BIG",10);let $x=i$;var ca,$p,c1,ek,e0,qd,tk,t0,od,x2,y7,i0,k2,r0,ik,_L;const rk=class Cg{constructor(e){ne(this,r0),ne(this,ca,null),ne(this,$p,!1),ne(this,c1,null),ne(this,ek,null),ne(this,e0,null),ne(this,qd,null),ne(this,tk,!1),ne(this,t0,null),ne(this,od,null),ne(this,x2,null),ne(this,y7,null),ne(this,i0,!1),ee(this,od,e),ee(this,i0,e._uiManager.useNewAltTextFlow),B(Cg,k2)||ee(Cg,k2,Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"}))}static initialize(e){Cg._l10n??(Cg._l10n=e)}async render(){const e=ee(this,c1,document.createElement("button"));e.className="altText",e.tabIndex="0";const i=ee(this,ek,document.createElement("span"));e.append(i),B(this,i0)?(e.classList.add("new"),e.setAttribute("data-l10n-id",B(Cg,k2).missing),i.setAttribute("data-l10n-id",B(Cg,k2)["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),i.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const r=B(this,od)._uiManager._signal;e.addEventListener("contextmenu",Zu,{signal:r}),e.addEventListener("pointerdown",n=>n.stopPropagation(),{signal:r});const o=n=>{n.preventDefault(),B(this,od)._uiManager.editAltText(B(this,od)),B(this,i0)&&B(this,od)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:B(this,r0,ik)}})};return e.addEventListener("click",o,{capture:!0,signal:r}),e.addEventListener("keydown",n=>{n.target===e&&n.key==="Enter"&&(ee(this,tk,!0),o(n))},{signal:r}),await oe(this,r0,_L).call(this),e}finish(){B(this,c1)&&(B(this,c1).focus({focusVisible:B(this,tk)}),ee(this,tk,!1))}isEmpty(){return B(this,i0)?B(this,ca)===null:!B(this,ca)&&!B(this,$p)}hasData(){return B(this,i0)?B(this,ca)!==null||!!B(this,x2):this.isEmpty()}get guessedText(){return B(this,x2)}async setGuessedText(e){B(this,ca)===null&&(ee(this,x2,e),ee(this,y7,await Cg._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e})),oe(this,r0,_L).call(this))}toggleAltTextBadge(e=!1){var i;if(!B(this,i0)||B(this,ca)){(i=B(this,t0))==null||i.remove(),ee(this,t0,null);return}if(!B(this,t0)){const r=ee(this,t0,document.createElement("div"));r.className="noAltTextBadge",B(this,od).div.append(r)}B(this,t0).classList.toggle("hidden",!e)}serialize(e){let i=B(this,ca);return!e&&B(this,x2)===i&&(i=B(this,y7)),{altText:i,decorative:B(this,$p),guessedText:B(this,x2),textWithDisclaimer:B(this,y7)}}get data(){return{altText:B(this,ca),decorative:B(this,$p)}}set data({altText:e,decorative:i,guessedText:r,textWithDisclaimer:o,cancel:n=!1}){r&&(ee(this,x2,r),ee(this,y7,o)),!(B(this,ca)===e&&B(this,$p)===i)&&(n||(ee(this,ca,e),ee(this,$p,i)),oe(this,r0,_L).call(this))}toggle(e=!1){B(this,c1)&&(!e&&B(this,qd)&&(clearTimeout(B(this,qd)),ee(this,qd,null)),B(this,c1).disabled=!e)}shown(){B(this,od)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:B(this,r0,ik)}})}destroy(){var e,i;(e=B(this,c1))==null||e.remove(),ee(this,c1,null),ee(this,ek,null),ee(this,e0,null),(i=B(this,t0))==null||i.remove(),ee(this,t0,null)}};ca=new WeakMap,$p=new WeakMap,c1=new WeakMap,ek=new WeakMap,e0=new WeakMap,qd=new WeakMap,tk=new WeakMap,t0=new WeakMap,od=new WeakMap,x2=new WeakMap,y7=new WeakMap,i0=new WeakMap,k2=new WeakMap,r0=new WeakSet,ik=function(){return B(this,ca)&&"added"||B(this,ca)===null&&this.guessedText&&"review"||"missing"},_L=async function(){var t,e,i;const r=B(this,c1);if(!r)return;if(B(this,i0)){if(r.classList.toggle("done",!!B(this,ca)),r.setAttribute("data-l10n-id",B(rk,k2)[B(this,r0,ik)]),(t=B(this,ek))==null||t.setAttribute("data-l10n-id",B(rk,k2)[`${B(this,r0,ik)}-label`]),!B(this,ca)){(e=B(this,e0))==null||e.remove();return}}else{if(!B(this,ca)&&!B(this,$p)){r.classList.remove("done"),(i=B(this,e0))==null||i.remove();return}r.classList.add("done"),r.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let o=B(this,e0);if(!o){ee(this,e0,o=document.createElement("span")),o.className="tooltip",o.setAttribute("role","tooltip"),o.id=`alt-text-tooltip-${B(this,od).id}`;const s=100,a=B(this,od)._uiManager._signal;a.addEventListener("abort",()=>{clearTimeout(B(this,qd)),ee(this,qd,null)},{once:!0}),r.addEventListener("mouseenter",()=>{ee(this,qd,setTimeout(()=>{ee(this,qd,null),B(this,e0).classList.add("show"),B(this,od)._reportTelemetry({action:"alt_text_tooltip"})},s))},{signal:a}),r.addEventListener("mouseleave",()=>{var l;B(this,qd)&&(clearTimeout(B(this,qd)),ee(this,qd,null)),(l=B(this,e0))==null||l.classList.remove("show")},{signal:a})}B(this,$p)?o.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(o.removeAttribute("data-l10n-id"),o.textContent=B(this,ca)),o.parentNode||r.append(o);const n=B(this,od).getElementForAltText();n?.setAttribute("aria-describedby",o.id)},ne(rk,k2,null),It(rk,"_l10n",null);let iSe=rk;var ok,w7,FL,OL,UL,NL,jL,M2,C7,P2,x7,E2,nk,rSe,oSe,nSe;const sSe=class{constructor({container:e,isPinchingDisabled:i=null,isPinchingStopped:r=null,onPinchStart:o=null,onPinching:n=null,onPinchEnd:s=null,signal:a}){ne(this,nk),ne(this,ok),ne(this,w7,!1),ne(this,FL,null),ne(this,OL),ne(this,UL),ne(this,NL),ne(this,jL),ne(this,M2,null),ne(this,C7),ne(this,P2,null),ne(this,x7),ne(this,E2,null),ee(this,ok,e),ee(this,FL,r),ee(this,OL,i),ee(this,UL,o),ee(this,NL,n),ee(this,jL,s),ee(this,x7,new AbortController),ee(this,C7,AbortSignal.any([a,B(this,x7).signal])),e.addEventListener("touchstart",oe(this,nk,rSe).bind(this),{passive:!1,signal:B(this,C7)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/F0.pixelRatio}destroy(){var e,i;(e=B(this,x7))==null||e.abort(),ee(this,x7,null),(i=B(this,M2))==null||i.abort(),ee(this,M2,null)}};ok=new WeakMap,w7=new WeakMap,FL=new WeakMap,OL=new WeakMap,UL=new WeakMap,NL=new WeakMap,jL=new WeakMap,M2=new WeakMap,C7=new WeakMap,P2=new WeakMap,x7=new WeakMap,E2=new WeakMap,nk=new WeakSet,rSe=function(t){var e,i,r;if((e=B(this,OL))!=null&&e.call(this))return;if(t.touches.length===1){if(B(this,M2))return;const s=ee(this,M2,new AbortController),a=AbortSignal.any([B(this,C7),s.signal]),l=B(this,ok),c={capture:!0,signal:a,passive:!1},d=u=>{var h;u.pointerType==="touch"&&((h=B(this,M2))==null||h.abort(),ee(this,M2,null))};l.addEventListener("pointerdown",u=>{u.pointerType==="touch"&&(is(u),d(u))},c),l.addEventListener("pointerup",d,c),l.addEventListener("pointercancel",d,c);return}if(!B(this,E2)){ee(this,E2,new AbortController);const s=AbortSignal.any([B(this,C7),B(this,E2).signal]),a=B(this,ok),l={signal:s,capture:!1,passive:!1};a.addEventListener("touchmove",oe(this,nk,oSe).bind(this),l);const c=oe(this,nk,nSe).bind(this);a.addEventListener("touchend",c,l),a.addEventListener("touchcancel",c,l),l.capture=!0,a.addEventListener("pointerdown",is,l),a.addEventListener("pointermove",is,l),a.addEventListener("pointercancel",is,l),a.addEventListener("pointerup",is,l),(i=B(this,UL))==null||i.call(this)}if(is(t),t.touches.length!==2||(r=B(this,FL))!=null&&r.call(this)){ee(this,P2,null);return}let[o,n]=t.touches;o.identifier>n.identifier&&([o,n]=[n,o]),ee(this,P2,{touch0X:o.screenX,touch0Y:o.screenY,touch1X:n.screenX,touch1Y:n.screenY})},oSe=function(t){var e;if(!B(this,P2)||t.touches.length!==2)return;is(t);let[i,r]=t.touches;i.identifier>r.identifier&&([i,r]=[r,i]);const{screenX:o,screenY:n}=i,{screenX:s,screenY:a}=r,l=B(this,P2),{touch0X:c,touch0Y:d,touch1X:u,touch1Y:h}=l,p=u-c,g=h-d,f=s-o,A=a-n,m=Math.hypot(f,A)||1,v=Math.hypot(p,g)||1;if(!B(this,w7)&&Math.abs(v-m)<=sSe.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=o,l.touch0Y=n,l.touch1X=s,l.touch1Y=a,!B(this,w7)){ee(this,w7,!0);return}const y=[(o+s)/2,(n+a)/2];(e=B(this,NL))==null||e.call(this,y,v,m)},nSe=function(t){var e;t.touches.length>=2||(B(this,E2)&&(B(this,E2).abort(),ee(this,E2,null),(e=B(this,jL))==null||e.call(this)),B(this,P2)&&(is(t),ee(this,P2,null),ee(this,w7,!1)))};let aSe=sSe;var k7,d1,en,sk,gA,HL,M7,Ka,P7,S2,mA,VL,E7,Wa,zL,S7,B2,o0,ak,lk,Gd,AA,qL,r$,Qr,o$,GL,n$,QL,lSe,cSe,s$,KL,a$,dSe,uSe,hSe,l$,pSe,c$,fSe,gSe,mSe,d$,ck;const Vn=class xa{constructor(e){ne(this,Qr),ne(this,k7,null),ne(this,d1,null),ne(this,en,null),ne(this,sk,!1),ne(this,gA,null),ne(this,HL,""),ne(this,M7,!1),ne(this,Ka,null),ne(this,P7,null),ne(this,S2,null),ne(this,mA,null),ne(this,VL,""),ne(this,E7,!1),ne(this,Wa,null),ne(this,zL,!1),ne(this,S7,!1),ne(this,B2,!1),ne(this,o0,null),ne(this,ak,0),ne(this,lk,0),ne(this,Gd,null),ne(this,AA,null),It(this,"_isCopy",!1),It(this,"_editToolbar",null),It(this,"_initialOptions",Object.create(null)),It(this,"_initialData",null),It(this,"_isVisible",!0),It(this,"_uiManager",null),It(this,"_focusEventsAllowed",!0),ne(this,qL,!1),ne(this,r$,xa._zIndex++),this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null;const{rotation:i,rawDims:{pageWidth:r,pageHeight:o,pageX:n,pageY:s}}=this.parent.viewport;this.rotation=i,this.pageRotation=(360+i-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[r,o],this.pageTranslation=[n,s];const[a,l]=this.parentDimensions;this.x=e.x/a,this.y=e.y/l,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const e=xa.prototype._resizeWithKeyboard,i=$x.TRANSLATE_SMALL,r=$x.TRANSLATE_BIG;return br(this,"_resizerKeyboardManager",new Gx([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-i,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-r,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[i,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[r,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-i]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-r]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,i]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,r]}],[["Escape","mac+Escape"],xa.prototype._stopResizingWithKeyboard]]))}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get isDrawer(){return!1}static get _defaultLineColor(){return br(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const i=new NUi({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});i.annotationElementId=e.annotationElementId,i.deleted=!0,i._uiManager.addToAnnotationStorage(i)}static initialize(e,i){if(xa._l10n??(xa._l10n=e),xa._l10nResizer||(xa._l10nResizer=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"})),xa._borderLineWidth!==-1)return;const r=getComputedStyle(document.documentElement);xa._borderLineWidth=parseFloat(r.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,i){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,i){Mo("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return B(this,qL)}set _isDraggable(e){var i;ee(this,qL,e),(i=this.div)==null||i.classList.toggle("draggable",e)}get isEnterHandled(){return!0}center(){const[e,i]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*i/(e*2),this.y+=this.width*e/(i*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*i/(e*2),this.y-=this.width*e/(i*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=B(this,r$)}setParent(e){e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):oe(this,Qr,ck).call(this),this.parent=e}focusin(e){this._focusEventsAllowed&&(B(this,E7)?ee(this,E7,!1):this.parent.setSelected(this))}focusout(e){var i;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const r=e.relatedTarget;r!=null&&r.closest(`#${this.id}`)||(e.preventDefault(),(i=this.parent)!=null&&i.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,i,r,o){const[n,s]=this.parentDimensions;[r,o]=this.screenToPageTranslation(r,o),this.x=(e+r)/n,this.y=(i+o)/s,this.fixAndSetPosition()}_moveAfterPaste(e,i){const[r,o]=this.parentDimensions;this.setAt(e*r,i*o,this.width*r,this.height*o),this._onTranslated()}translate(e,i){oe(this,Qr,o$).call(this,this.parentDimensions,e,i)}translateInPage(e,i){B(this,Wa)||ee(this,Wa,[this.x,this.y,this.width,this.height]),oe(this,Qr,o$).call(this,this.pageDimensions,e,i),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,i){B(this,Wa)||ee(this,Wa,[this.x,this.y,this.width,this.height]);const{div:r,parentDimensions:[o,n]}=this;if(this.x+=e/o,this.y+=i/n,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:u,y:h}=this.div.getBoundingClientRect();this.parent.findNewParent(this,u,h)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:a}=this;const[l,c]=this.getBaseTranslation();s+=l,a+=c;const{style:d}=r;d.left=`${(100*s).toFixed(2)}%`,d.top=`${(100*a).toFixed(2)}%`,this._onTranslating(s,a),r.scrollIntoView({block:"nearest"})}_onTranslating(e,i){}_onTranslated(e,i){}get _hasBeenMoved(){return!!B(this,Wa)&&(B(this,Wa)[0]!==this.x||B(this,Wa)[1]!==this.y)}get _hasBeenResized(){return!!B(this,Wa)&&(B(this,Wa)[2]!==this.width||B(this,Wa)[3]!==this.height)}getBaseTranslation(){const[e,i]=this.parentDimensions,{_borderLineWidth:r}=xa,o=r/e,n=r/i;switch(this.rotation){case 90:return[-o,n];case 180:return[o,n];case 270:return[o,-n];default:return[-o,-n]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const{div:{style:i},pageDimensions:[r,o]}=this;let{x:n,y:s,width:a,height:l}=this;if(a*=r,l*=o,n*=r,s*=o,this._mustFixPosition)switch(e){case 0:n=Bl(n,0,r-a),s=Bl(s,0,o-l);break;case 90:n=Bl(n,0,r-l),s=Bl(s,a,o);break;case 180:n=Bl(n,a,r),s=Bl(s,l,o);break;case 270:n=Bl(n,l,r),s=Bl(s,0,o-a);break}this.x=n/=r,this.y=s/=o;const[c,d]=this.getBaseTranslation();n+=c,s+=d,i.left=`${(100*n).toFixed(2)}%`,i.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(e,i){var r;return oe(r=xa,GL,n$).call(r,e,i,this.parentRotation)}pageTranslationToScreen(e,i){var r;return oe(r=xa,GL,n$).call(r,e,i,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:e,pageDimensions:[i,r]}=this;return[i*e,r*e]}setDims(e,i){const[r,o]=this.parentDimensions,{style:n}=this.div;n.width=`${(100*e/r).toFixed(2)}%`,B(this,M7)||(n.height=`${(100*i/o).toFixed(2)}%`)}fixDims(){const{style:e}=this.div,{height:i,width:r}=e,o=r.endsWith("%"),n=!B(this,M7)&&i.endsWith("%");if(o&&n)return;const[s,a]=this.parentDimensions;o||(e.width=`${(100*parseFloat(r)/s).toFixed(2)}%`),!B(this,M7)&&!n&&(e.height=`${(100*parseFloat(i)/a).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}_onResized(){}static _round(e){return Math.round(e*1e4)/1e4}_onResizing(){}altTextFinish(){var e;(e=B(this,en))==null||e.finish()}async addEditToolbar(){return this._editToolbar||B(this,S7)?this._editToolbar:(this._editToolbar=new DUi(this),this.div.append(this._editToolbar.render()),B(this,en)&&await this._editToolbar.addAltText(B(this,en)),this._editToolbar)}removeEditToolbar(){var e;this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,(e=B(this,en))==null||e.destroy())}addContainer(e){var i;const r=(i=this._editToolbar)==null?void 0:i.div;r?r.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){B(this,en)||(iSe.initialize(xa._l10n),ee(this,en,new iSe(this)),B(this,k7)&&(B(this,en).data=B(this,k7),ee(this,k7,null)),await this.addEditToolbar())}get altTextData(){var e;return(e=B(this,en))==null?void 0:e.data}set altTextData(e){B(this,en)&&(B(this,en).data=e)}get guessedAltText(){var e;return(e=B(this,en))==null?void 0:e.guessedText}async setGuessedAltText(e){var i;await((i=B(this,en))==null?void 0:i.setGuessedText(e))}serializeAltText(e){var i;return(i=B(this,en))==null?void 0:i.serialize(e)}hasAltText(){return!!B(this,en)&&!B(this,en).isEmpty()}hasAltTextData(){var e;return((e=B(this,en))==null?void 0:e.hasData())??!1}render(){var e;const i=this.div=document.createElement("div");i.setAttribute("data-editor-rotation",(360-this.rotation)%360),i.className=this.name,i.setAttribute("id",this.id),i.tabIndex=B(this,sk)?-1:0,i.setAttribute("role","application"),this.defaultL10nId&&i.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||i.classList.add("hidden"),this.setInForeground(),oe(this,Qr,c$).call(this);const[r,o]=this.parentDimensions;this.parentRotation%180!==0&&(i.style.maxWidth=`${(100*o/r).toFixed(2)}%`,i.style.maxHeight=`${(100*r/o).toFixed(2)}%`);const[n,s]=this.getInitialTranslation();return this.translate(n,s),QY(this,i,["keydown","pointerdown"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(B(this,AA)||ee(this,AA,new aSe({container:i,isPinchingDisabled:()=>!this.isSelected,onPinchStart:oe(this,Qr,dSe).bind(this),onPinching:oe(this,Qr,uSe).bind(this),onPinchEnd:oe(this,Qr,hSe).bind(this),signal:this._uiManager._signal}))),(e=this._uiManager._editorUndoBar)==null||e.hide(),i}pointerdown(e){const{isMac:i}=aa.platform;if(e.button!==0||e.ctrlKey&&i){e.preventDefault();return}if(ee(this,E7,!0),this._isDraggable){oe(this,Qr,pSe).call(this,e);return}oe(this,Qr,l$).call(this,e)}get isSelected(){return this._uiManager.isSelected(this)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){B(this,o0)&&clearTimeout(B(this,o0)),ee(this,o0,setTimeout(()=>{var e;ee(this,o0,null),(e=this.parent)==null||e.moveEditorInDOM(this)},0))}_setParentAndPosition(e,i,r){e.changeParent(this),this.x=i,this.y=r,this.fixAndSetPosition(),this._onTranslated()}getRect(e,i,r=this.rotation){const o=this.parentScale,[n,s]=this.pageDimensions,[a,l]=this.pageTranslation,c=e/o,d=i/o,u=this.x*n,h=this.y*s,p=this.width*n,g=this.height*s;switch(r){case 0:return[u+c+a,s-h-d-g+l,u+c+p+a,s-h-d+l];case 90:return[u+d+a,s-h+c+l,u+d+g+a,s-h+c+p+l];case 180:return[u-c-p+a,s-h+d+l,u-c+a,s-h+d+g+l];case 270:return[u-d-g+a,s-h-c-p+l,u-d+a,s-h-c+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,i){const[r,o,n,s]=e,a=n-r,l=s-o;switch(this.rotation){case 0:return[r,i-s,a,l];case 90:return[r,i-o,l,a];case 180:return[n,i-o,a,l];case 270:return[n,i-s,l,a];default:throw new Error("Invalid rotation")}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){ee(this,S7,!0)}disableEditMode(){ee(this,S7,!1)}isInEditMode(){return B(this,S7)}shouldGetKeyboardEvents(){return B(this,B2)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:e,left:i,bottom:r,right:o}=this.getClientDimensions(),{innerHeight:n,innerWidth:s}=window;return i<s&&o>0&&e<n&&r>0}rebuild(){oe(this,Qr,c$).call(this)}rotate(e){}resize(){}serializeDeleted(){var e;return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:((e=this._initialData)==null?void 0:e.popupRef)||""}}serialize(e=!1,i=null){Mo("An editor must be serializable")}static async deserialize(e,i,r){const o=new this.prototype.constructor({parent:i,id:i.getNextId(),uiManager:r});o.rotation=e.rotation,ee(o,k7,e.accessibilityData),o._isCopy=e.isCopy||!1;const[n,s]=o.pageDimensions,[a,l,c,d]=o.getRectInCurrentCoords(e.rect,s);return o.x=a/n,o.y=l/s,o.width=c/n,o.height=d/s,o}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){var e,i;if((e=B(this,mA))==null||e.abort(),ee(this,mA,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),B(this,o0)&&(clearTimeout(B(this,o0)),ee(this,o0,null)),oe(this,Qr,ck).call(this),this.removeEditToolbar(),B(this,Gd)){for(const r of B(this,Gd).values())clearTimeout(r);ee(this,Gd,null)}this.parent=null,(i=B(this,AA))==null||i.destroy(),ee(this,AA,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(oe(this,Qr,lSe).call(this),B(this,Ka).classList.remove("hidden"))}get toolbarPosition(){return null}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),ee(this,S2,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const i=B(this,Ka).children;if(!B(this,d1)){ee(this,d1,Array.from(i));const s=oe(this,Qr,fSe).bind(this),a=oe(this,Qr,gSe).bind(this),l=this._uiManager._signal;for(const c of B(this,d1)){const d=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",s,{signal:l}),c.addEventListener("blur",a,{signal:l}),c.addEventListener("focus",oe(this,Qr,mSe).bind(this,d),{signal:l}),c.setAttribute("data-l10n-id",xa._l10nResizer[d])}}const r=B(this,d1)[0];let o=0;for(const s of i){if(s===r)break;o++}const n=(360-this.rotation+this.parentRotation)%360/90*(B(this,d1).length/4);if(n!==o){if(n<o)for(let a=0;a<o-n;a++)B(this,Ka).append(B(this,Ka).firstChild);else if(n>o)for(let a=0;a<n-o;a++)B(this,Ka).firstChild.before(B(this,Ka).lastChild);let s=0;for(const a of i){const l=B(this,d1)[s++].getAttribute("data-resizer-name");a.setAttribute("data-l10n-id",xa._l10nResizer[l])}}oe(this,Qr,d$).call(this,0),ee(this,B2,!0),B(this,Ka).firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}_resizeWithKeyboard(e,i){B(this,B2)&&oe(this,Qr,a$).call(this,B(this,VL),{deltaX:e,deltaY:i,fromKeyboard:!0})}_stopResizingWithKeyboard(){oe(this,Qr,ck).call(this),this.div.focus()}select(){var e,i,r;if(this.makeResizable(),(e=this.div)==null||e.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{var o,n;(o=this.div)!=null&&o.classList.contains("selectedEditor")&&((n=this._editToolbar)==null||n.show())});return}(i=this._editToolbar)==null||i.show(),(r=B(this,en))==null||r.toggleAltTextBadge(!1)}unselect(){var e,i,r,o,n;(e=B(this,Ka))==null||e.classList.add("hidden"),(i=this.div)==null||i.classList.remove("selectedEditor"),(r=this.div)!=null&&r.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),(o=this._editToolbar)==null||o.hide(),(n=B(this,en))==null||n.toggleAltTextBadge(!0)}updateParams(e,i){}disableEditing(){}enableEditing(){}enterInEditMode(){}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return B(this,zL)}set isEditing(e){ee(this,zL,e),this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,i){ee(this,M7,!0);const r=e/i,{style:o}=this.div;o.aspectRatio=r,o.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,i=!1){if(i){B(this,Gd)||ee(this,Gd,new Map);const{action:r}=e;let o=B(this,Gd).get(r);o&&clearTimeout(o),o=setTimeout(()=>{this._reportTelemetry(e),B(this,Gd).delete(r),B(this,Gd).size===0&&ee(this,Gd,null)},xa._telemetryTimeout),B(this,Gd).set(r,o);return}e.type||(e.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),ee(this,sk,!1)}disable(){this.div&&(this.div.tabIndex=-1),ee(this,sk,!0)}renderAnnotationElement(e){let i=e.container.querySelector(".annotationContent");if(!i)i=document.createElement("div"),i.classList.add("annotationContent",this.editorType),e.container.prepend(i);else if(i.nodeName==="CANVAS"){const r=i;i=document.createElement("div"),i.classList.add("annotationContent",this.editorType),r.before(i)}return i}resetAnnotationElement(e){const{firstChild:i}=e.container;i?.nodeName==="DIV"&&i.classList.contains("annotationContent")&&i.remove()}};k7=new WeakMap,d1=new WeakMap,en=new WeakMap,sk=new WeakMap,gA=new WeakMap,HL=new WeakMap,M7=new WeakMap,Ka=new WeakMap,P7=new WeakMap,S2=new WeakMap,mA=new WeakMap,VL=new WeakMap,E7=new WeakMap,Wa=new WeakMap,zL=new WeakMap,S7=new WeakMap,B2=new WeakMap,o0=new WeakMap,ak=new WeakMap,lk=new WeakMap,Gd=new WeakMap,AA=new WeakMap,qL=new WeakMap,r$=new WeakMap,Qr=new WeakSet,o$=function([t,e],i,r){[i,r]=this.screenToPageTranslation(i,r),this.x+=i/t,this.y+=r/e,this._onTranslating(this.x,this.y),this.fixAndSetPosition()},GL=new WeakSet,n$=function(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}},QL=function(t){switch(t){case 90:{const[e,i]=this.pageDimensions;return[0,-e/i,i/e,0]}case 180:return[-1,0,0,-1];case 270:{const[e,i]=this.pageDimensions;return[0,e/i,-i/e,0]}default:return[1,0,0,1]}},lSe=function(){if(B(this,Ka))return;ee(this,Ka,document.createElement("div")),B(this,Ka).classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const i of t){const r=document.createElement("div");B(this,Ka).append(r),r.classList.add("resizer",i),r.setAttribute("data-resizer-name",i),r.addEventListener("pointerdown",oe(this,Qr,cSe).bind(this,i),{signal:e}),r.addEventListener("contextmenu",Zu,{signal:e}),r.tabIndex=-1}this.div.prepend(B(this,Ka))},cSe=function(t,e){var i;e.preventDefault();const{isMac:r}=aa.platform;if(e.button!==0||e.ctrlKey&&r)return;(i=B(this,en))==null||i.toggle(!1);const o=this._isDraggable;this._isDraggable=!1,ee(this,P7,[e.screenX,e.screenY]);const n=new AbortController,s=this._uiManager.combinedSignal(n);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",oe(this,Qr,a$).bind(this,t),{passive:!0,capture:!0,signal:s}),window.addEventListener("touchmove",is,{passive:!1,signal:s}),window.addEventListener("contextmenu",Zu,{signal:s}),ee(this,S2,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const a=this.parent.div.style.cursor,l=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const c=()=>{var d;n.abort(),this.parent.togglePointerEvents(!0),(d=B(this,en))==null||d.toggle(!0),this._isDraggable=o,this.parent.div.style.cursor=a,this.div.style.cursor=l,oe(this,Qr,KL).call(this)};window.addEventListener("pointerup",c,{signal:s}),window.addEventListener("blur",c,{signal:s})},s$=function(t,e,i,r){this.width=i,this.height=r,this.x=t,this.y=e;const[o,n]=this.parentDimensions;this.setDims(o*i,n*r),this.fixAndSetPosition(),this._onResized()},KL=function(){if(!B(this,S2))return;const{savedX:t,savedY:e,savedWidth:i,savedHeight:r}=B(this,S2);ee(this,S2,null);const o=this.x,n=this.y,s=this.width,a=this.height;o===t&&n===e&&s===i&&a===r||this.addCommands({cmd:oe(this,Qr,s$).bind(this,o,n,s,a),undo:oe(this,Qr,s$).bind(this,t,e,i,r),mustExec:!0})},a$=function(t,e){const[i,r]=this.parentDimensions,o=this.x,n=this.y,s=this.width,a=this.height,l=Vn.MIN_SIZE/i,c=Vn.MIN_SIZE/r,d=oe(this,Qr,QL).call(this,this.rotation),u=(H,U)=>[d[0]*H+d[2]*U,d[1]*H+d[3]*U],h=oe(this,Qr,QL).call(this,360-this.rotation),p=(H,U)=>[h[0]*H+h[2]*U,h[1]*H+h[3]*U];let g,f,A=!1,m=!1;switch(t){case"topLeft":A=!0,g=(H,U)=>[0,0],f=(H,U)=>[H,U];break;case"topMiddle":g=(H,U)=>[H/2,0],f=(H,U)=>[H/2,U];break;case"topRight":A=!0,g=(H,U)=>[H,0],f=(H,U)=>[0,U];break;case"middleRight":m=!0,g=(H,U)=>[H,U/2],f=(H,U)=>[0,U/2];break;case"bottomRight":A=!0,g=(H,U)=>[H,U],f=(H,U)=>[0,0];break;case"bottomMiddle":g=(H,U)=>[H/2,U],f=(H,U)=>[H/2,0];break;case"bottomLeft":A=!0,g=(H,U)=>[0,U],f=(H,U)=>[H,0];break;case"middleLeft":m=!0,g=(H,U)=>[0,U/2],f=(H,U)=>[H,U/2];break}const v=g(s,a),y=f(s,a);let b=u(...y);const w=Vn._round(o+b[0]),C=Vn._round(n+b[1]);let M=1,P=1,E,S;if(e.fromKeyboard)({deltaX:E,deltaY:S}=e);else{const{screenX:H,screenY:U}=e,[z,Z]=B(this,P7);[E,S]=this.screenToPageTranslation(H-z,U-Z),B(this,P7)[0]=H,B(this,P7)[1]=U}if([E,S]=p(E/i,S/r),A){const H=Math.hypot(s,a);M=P=Math.max(Math.min(Math.hypot(y[0]-v[0]-E,y[1]-v[1]-S)/H,1/s,1/a),l/s,c/a)}else m?M=Bl(Math.abs(y[0]-v[0]-E),l,1)/s:P=Bl(Math.abs(y[1]-v[1]-S),c,1)/a;const I=Vn._round(s*M),R=Vn._round(a*P);b=u(...f(I,R));const L=w-b[0],j=C-b[1];B(this,Wa)||ee(this,Wa,[this.x,this.y,this.width,this.height]),this.width=I,this.height=R,this.x=L,this.y=j,this.setDims(i*I,r*R),this.fixAndSetPosition(),this._onResizing()},dSe=function(){var t;ee(this,S2,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),(t=B(this,en))==null||t.toggle(!1),this.parent.togglePointerEvents(!1)},uSe=function(t,e,i){let r=.7*(i/e)+1-.7;if(r===1)return;const o=oe(this,Qr,QL).call(this,this.rotation),n=(b,w)=>[o[0]*b+o[2]*w,o[1]*b+o[3]*w],[s,a]=this.parentDimensions,l=this.x,c=this.y,d=this.width,u=this.height,h=Vn.MIN_SIZE/s,p=Vn.MIN_SIZE/a;r=Math.max(Math.min(r,1/d,1/u),h/d,p/u);const g=Vn._round(d*r),f=Vn._round(u*r);if(g===d&&f===u)return;B(this,Wa)||ee(this,Wa,[l,c,d,u]);const A=n(d/2,u/2),m=Vn._round(l+A[0]),v=Vn._round(c+A[1]),y=n(g/2,f/2);this.x=m-y[0],this.y=v-y[1],this.width=g,this.height=f,this.setDims(s*g,a*f),this.fixAndSetPosition(),this._onResizing()},hSe=function(){var t;(t=B(this,en))==null||t.toggle(!0),this.parent.togglePointerEvents(!0),oe(this,Qr,KL).call(this)},l$=function(t){const{isMac:e}=aa.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)},pSe=function(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();let i=!1;const r=new AbortController,o=this._uiManager.combinedSignal(r),n={capture:!0,passive:!1,signal:o},s=l=>{r.abort(),ee(this,gA,null),ee(this,E7,!1),this._uiManager.endDragSession()||oe(this,Qr,l$).call(this,l),i&&this._onStopDragging()};e&&(ee(this,ak,t.clientX),ee(this,lk,t.clientY),ee(this,gA,t.pointerId),ee(this,HL,t.pointerType),window.addEventListener("pointermove",l=>{i||(i=!0,this._onStartDragging());const{clientX:c,clientY:d,pointerId:u}=l;if(u!==B(this,gA)){is(l);return}const[h,p]=this.screenToPageTranslation(c-B(this,ak),d-B(this,lk));ee(this,ak,c),ee(this,lk,d),this._uiManager.dragSelectedEditors(h,p)},n),window.addEventListener("touchmove",is,n),window.addEventListener("pointerdown",l=>{l.pointerType===B(this,HL)&&(B(this,AA)||l.isPrimary)&&s(l),is(l)},n));const a=l=>{if(!B(this,gA)||B(this,gA)===l.pointerId){s(l);return}is(l)};window.addEventListener("pointerup",a,{signal:o}),window.addEventListener("blur",a,{signal:o})},c$=function(){if(B(this,mA)||!this.div)return;ee(this,mA,new AbortController);const t=this._uiManager.combinedSignal(B(this,mA));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})},fSe=function(t){Vn._resizerKeyboardManager.exec(this,t)},gSe=function(t){var e;B(this,B2)&&((e=t.relatedTarget)==null?void 0:e.parentNode)!==B(this,Ka)&&oe(this,Qr,ck).call(this)},mSe=function(t){ee(this,VL,B(this,B2)?t:"")},d$=function(t){if(B(this,d1))for(const e of B(this,d1))e.tabIndex=t},ck=function(){ee(this,B2,!1),oe(this,Qr,d$).call(this,-1),oe(this,Qr,KL).call(this)},ne(Vn,GL),It(Vn,"_l10n",null),It(Vn,"_l10nResizer",null),It(Vn,"_borderLineWidth",-1),It(Vn,"_colorManager",new UUi),It(Vn,"_zIndex",1),It(Vn,"_telemetryTimeout",1e3);let tn=Vn;class NUi extends tn{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const ASe=3285377520,Qd=4294901760,u1=65535;let vSe=class{constructor(t){this.h1=t?t&4294967295:ASe,this.h2=t?t&4294967295:ASe}update(t){let e,i;if(typeof t=="string"){e=new Uint8Array(t.length*2),i=0;for(let g=0,f=t.length;g<f;g++){const A=t.charCodeAt(g);A<=255?e[i++]=A:(e[i++]=A>>>8,e[i++]=A&255)}}else if(ArrayBuffer.isView(t))e=t.slice(),i=e.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const r=i>>2,o=i-r*4,n=new Uint32Array(e.buffer,0,r);let s=0,a=0,l=this.h1,c=this.h2;const d=3432918353,u=461845907,h=d&u1,p=u&u1;for(let g=0;g<r;g++)g&1?(s=n[g],s=s*d&Qd|s*h&u1,s=s<<15|s>>>17,s=s*u&Qd|s*p&u1,l^=s,l=l<<13|l>>>19,l=l*5+3864292196):(a=n[g],a=a*d&Qd|a*h&u1,a=a<<15|a>>>17,a=a*u&Qd|a*p&u1,c^=a,c=c<<13|c>>>19,c=c*5+3864292196);switch(s=0,o){case 3:s^=e[r*4+2]<<16;case 2:s^=e[r*4+1]<<8;case 1:s^=e[r*4],s=s*d&Qd|s*h&u1,s=s<<15|s>>>17,s=s*u&Qd|s*p&u1,r&1?l^=s:c^=s}this.h1=l,this.h2=c}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=t*3981806797&Qd|t*36045&u1,e=e*4283543511&Qd|((e<<16|t>>>16)*2950163797&Qd)>>>16,t^=e>>>1,t=t*444984403&Qd|t*60499&u1,e=e*3301882366&Qd|((e<<16|t>>>16)*3120437893&Qd)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}};const u$=Object.freeze({map:null,hash:"",transfer:void 0});var B7,I7,Za,h$,bSe;class p${constructor(){ne(this,h$),ne(this,B7,!1),ne(this,I7,null),ne(this,Za,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,i){const r=B(this,Za).get(e);return r===void 0?i:Object.assign(i,r)}getRawValue(e){return B(this,Za).get(e)}remove(e){if(B(this,Za).delete(e),B(this,Za).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const i of B(this,Za).values())if(i instanceof tn)return;this.onAnnotationEditor(null)}}setValue(e,i){const r=B(this,Za).get(e);let o=!1;if(r!==void 0)for(const[n,s]of Object.entries(i))r[n]!==s&&(o=!0,r[n]=s);else o=!0,B(this,Za).set(e,i);o&&oe(this,h$,bSe).call(this),i instanceof tn&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(i.constructor._type)}has(e){return B(this,Za).has(e)}get size(){return B(this,Za).size}resetModified(){B(this,B7)&&(ee(this,B7,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new ySe(this)}get serializable(){if(B(this,Za).size===0)return u$;const e=new Map,i=new vSe,r=[],o=Object.create(null);let n=!1;for(const[s,a]of B(this,Za)){const l=a instanceof tn?a.serialize(!1,o):a;l&&(e.set(s,l),i.update(`${s}:${JSON.stringify(l)}`),n||(n=!!l.bitmap))}if(n)for(const s of e.values())s.bitmap&&r.push(s.bitmap);return e.size>0?{map:e,hash:i.hexdigest(),transfer:r}:u$}get editorStats(){let e=null;const i=new Map;for(const r of B(this,Za).values()){if(!(r instanceof tn))continue;const o=r.telemetryFinalData;if(!o)continue;const{type:n}=o;i.has(n)||i.set(n,Object.getPrototypeOf(r).constructor),e||(e=Object.create(null));const s=e[n]||(e[n]=new Map);for(const[a,l]of Object.entries(o)){if(a==="type")continue;let c=s.get(a);c||(c=new Map,s.set(a,c));const d=c.get(l)??0;c.set(l,d+1)}}for(const[r,o]of i)e[r]=o.computeTelemetryFinalData(e[r]);return e}resetModifiedIds(){ee(this,I7,null)}get modifiedIds(){if(B(this,I7))return B(this,I7);const e=[];for(const i of B(this,Za).values())!(i instanceof tn)||!i.annotationElementId||!i.serialize()||e.push(i.annotationElementId);return ee(this,I7,{ids:new Set(e),hash:e.join(",")})}[Symbol.iterator](){return B(this,Za).entries()}}B7=new WeakMap,I7=new WeakMap,Za=new WeakMap,h$=new WeakSet,bSe=function(){B(this,B7)||(ee(this,B7,!0),typeof this.onSetModified=="function"&&this.onSetModified())};var WL;class ySe extends p${constructor(e){super(),ne(this,WL);const{map:i,hash:r,transfer:o}=e.serializable,n=structuredClone(i,o?{transfer:o}:null);ee(this,WL,{map:n,hash:r,transfer:o})}get print(){Mo("Should not call PrintAnnotationStorage.print")}get serializable(){return B(this,WL)}get modifiedIds(){return br(this,"modifiedIds",{ids:new Set,hash:""})}}WL=new WeakMap;var dk;class jUi{constructor({ownerDocument:e=globalThis.document,styleElement:i=null}){ne(this,dk,new Set),this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const i=this.styleElement.sheet;i.insertRule(e,i.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),B(this,dk).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,disableFontFace:i,_inspectFont:r}){if(!(!e||B(this,dk).has(e.loadedName))){if(ts(!i,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:o,src:n,style:s}=e,a=new FontFace(o,n,s);this.addNativeFontFace(a);try{await a.load(),B(this,dk).add(o),r?.(e)}catch{$i(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}Mo("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){const r=e.createNativeFontFace();if(r){this.addNativeFontFace(r);try{await r.loaded}catch(o){throw $i(`Failed to load font '${r.family}': '${o}'.`),e.disableFontFace=!0,o}}return}const i=e.createFontFaceRule();if(i){if(this.insertRule(i),this.isSyncFontLoadingSupported)return;await new Promise(r=>{const o=this._queueLoadingCallback(r);this._prepareFontLoadEvent(e,o)})}}get isFontLoadingAPISupported(){var e;const i=!!((e=this._document)!=null&&e.fonts);return br(this,"isFontLoadingAPISupported",i)}get isSyncFontLoadingSupported(){return br(this,"isSyncFontLoadingSupported",Sl||aa.platform.isFirefox)}_queueLoadingCallback(e){function i(){for(ts(!o.done,"completeRequest() cannot be called twice."),o.done=!0;r.length>0&&r[0].done;){const n=r.shift();setTimeout(n.callback,0)}}const{loadingRequests:r}=this,o={done:!1,complete:i,callback:e};return r.push(o),o}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return br(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,i){function r(y,b){return y.charCodeAt(b)<<24|y.charCodeAt(b+1)<<16|y.charCodeAt(b+2)<<8|y.charCodeAt(b+3)&255}function o(y,b,w,C){const M=y.substring(0,b),P=y.substring(b+w);return M+C+P}let n,s;const a=this._document.createElement("canvas");a.width=1,a.height=1;const l=a.getContext("2d");let c=0;function d(y,b){if(++c>30){$i("Load test font never loaded."),b();return}if(l.font="30px "+y,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){b();return}setTimeout(d.bind(null,y,b))}const u=`lt${Date.now()}${this.loadTestFontId++}`;let h=this._loadTestFont;h=o(h,976,u.length,u);const p=16,g=1482184792;let f=r(h,p);for(n=0,s=u.length-3;n<s;n+=4)f=f-g+r(u,n)|0;n<u.length&&(f=f-g+r(u+"XXX",n)|0),h=o(h,p,4,CUi(f));const A=`url(data:font/opentype;base64,${btoa(h)});`,m=`@font-face {font-family:"${u}";src:${A}}`;this.insertRule(m);const v=this._document.createElement("div");v.style.visibility="hidden",v.style.width=v.style.height="10px",v.style.position="absolute",v.style.top=v.style.left="0px";for(const y of[e.loadedName,u]){const b=this._document.createElement("span");b.textContent="Hi",b.style.fontFamily=y,v.append(b)}this._document.body.append(v),d(u,()=>{v.remove(),i.complete()})}}dk=new WeakMap;class HUi{constructor(e,i=null){this.compiledGlyphs=Object.create(null);for(const r in e)this[r]=e[r];this._inspectFont=i}createNativeFontFace(){var e;if(!this.data||this.disableFontFace)return null;let i;if(!this.cssFontInfo)i=new FontFace(this.loadedName,this.data,{});else{const r={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(r.style=`oblique ${this.cssFontInfo.italicAngle}deg`),i=new FontFace(this.cssFontInfo.fontFamily,this.data,r)}return(e=this._inspectFont)==null||e.call(this,this),i}createFontFaceRule(){var e;if(!this.data||this.disableFontFace)return null;const i=`url(data:${this.mimetype};base64,${LEe(this.data)});`;let r;if(!this.cssFontInfo)r=`@font-face {font-family:"${this.loadedName}";src:${i}}`;else{let o=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(o+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),r=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${o}src:${i}}`}return(e=this._inspectFont)==null||e.call(this,this,i),r}getPathGenerator(e,i){if(this.compiledGlyphs[i]!==void 0)return this.compiledGlyphs[i];const r=this.loadedName+"_path_"+i;let o;try{o=e.get(r)}catch(s){$i(`getPathGenerator - ignoring character: "${s}".`)}const n=new Path2D(o||"");return this.fontExtraProperties||e.delete(r),this.compiledGlyphs[i]=n}}const ZL={DATA:1,ERROR:2},os={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function wSe(){}function mc(t){if(t instanceof v2||t instanceof LY||t instanceof IEe||t instanceof mL||t instanceof DY)return t;switch(t instanceof Error||typeof t=="object"&&t!==null||Mo('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new v2(t.message);case"InvalidPDFException":return new LY(t.message);case"PasswordException":return new IEe(t.message,t.code);case"ResponseException":return new mL(t.message,t.status,t.missing);case"UnknownErrorException":return new DY(t.message,t.details)}return new DY(t.message,t.toString())}var uk,I2,CSe,xSe,kSe,JL,MSe;let hk=(MSe=class{constructor(t,e,i){ne(this,I2),ne(this,uk,new AbortController),this.sourceName=t,this.targetName=e,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),i.addEventListener("message",oe(this,I2,CSe).bind(this),{signal:B(this,uk).signal})}on(t,e){const i=this.actionHandler;if(i[t])throw new Error(`There is already an actionName called "${t}"`);i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}sendWithPromise(t,e,i){const r=this.callbackId++,o=Promise.withResolvers();this.callbackCapabilities[r]=o;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:r,data:e},i)}catch(n){o.reject(n)}return o.promise}sendWithStream(t,e,i,r){const o=this.streamId++,n=this.sourceName,s=this.targetName,a=this.comObj;return new ReadableStream({start:l=>{const c=Promise.withResolvers();return this.streamControllers[o]={controller:l,startCall:c,pullCall:null,cancelCall:null,isClosed:!1},a.postMessage({sourceName:n,targetName:s,action:t,streamId:o,data:e,desiredSize:l.desiredSize},r),c.promise},pull:l=>{const c=Promise.withResolvers();return this.streamControllers[o].pullCall=c,a.postMessage({sourceName:n,targetName:s,stream:os.PULL,streamId:o,desiredSize:l.desiredSize}),c.promise},cancel:l=>{ts(l instanceof Error,"cancel must have a valid reason");const c=Promise.withResolvers();return this.streamControllers[o].cancelCall=c,this.streamControllers[o].isClosed=!0,a.postMessage({sourceName:n,targetName:s,stream:os.CANCEL,streamId:o,reason:mc(l)}),c.promise}},i)}destroy(){var t;(t=B(this,uk))==null||t.abort(),ee(this,uk,null)}},uk=new WeakMap,I2=new WeakSet,CSe=function({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream){oe(this,I2,kSe).call(this,t);return}if(t.callback){const i=t.callbackId,r=this.callbackCapabilities[i];if(!r)throw new Error(`Cannot resolve callback ${i}`);if(delete this.callbackCapabilities[i],t.callback===ZL.DATA)r.resolve(t.data);else if(t.callback===ZL.ERROR)r.reject(mc(t.reason));else throw new Error("Unexpected callback case");return}const e=this.actionHandler[t.action];if(!e)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const i=this.sourceName,r=t.sourceName,o=this.comObj;Promise.try(e,t.data).then(function(n){o.postMessage({sourceName:i,targetName:r,callback:ZL.DATA,callbackId:t.callbackId,data:n})},function(n){o.postMessage({sourceName:i,targetName:r,callback:ZL.ERROR,callbackId:t.callbackId,reason:mc(n)})});return}if(t.streamId){oe(this,I2,xSe).call(this,t);return}e(t.data)},xSe=function(t){const e=t.streamId,i=this.sourceName,r=t.sourceName,o=this.comObj,n=this,s=this.actionHandler[t.action],a={enqueue(l,c=1,d){if(this.isCancelled)return;const u=this.desiredSize;this.desiredSize-=c,u>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),o.postMessage({sourceName:i,targetName:r,stream:os.ENQUEUE,streamId:e,chunk:l},d)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:i,targetName:r,stream:os.CLOSE,streamId:e}),delete n.streamSinks[e])},error(l){ts(l instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,o.postMessage({sourceName:i,targetName:r,stream:os.ERROR,streamId:e,reason:mc(l)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};a.sinkCapability.resolve(),a.ready=a.sinkCapability.promise,this.streamSinks[e]=a,Promise.try(s,t.data,a).then(function(){o.postMessage({sourceName:i,targetName:r,stream:os.START_COMPLETE,streamId:e,success:!0})},function(l){o.postMessage({sourceName:i,targetName:r,stream:os.START_COMPLETE,streamId:e,reason:mc(l)})})},kSe=function(t){const e=t.streamId,i=this.sourceName,r=t.sourceName,o=this.comObj,n=this.streamControllers[e],s=this.streamSinks[e];switch(t.stream){case os.START_COMPLETE:t.success?n.startCall.resolve():n.startCall.reject(mc(t.reason));break;case os.PULL_COMPLETE:t.success?n.pullCall.resolve():n.pullCall.reject(mc(t.reason));break;case os.PULL:if(!s){o.postMessage({sourceName:i,targetName:r,stream:os.PULL_COMPLETE,streamId:e,success:!0});break}s.desiredSize<=0&&t.desiredSize>0&&s.sinkCapability.resolve(),s.desiredSize=t.desiredSize,Promise.try(s.onPull||wSe).then(function(){o.postMessage({sourceName:i,targetName:r,stream:os.PULL_COMPLETE,streamId:e,success:!0})},function(l){o.postMessage({sourceName:i,targetName:r,stream:os.PULL_COMPLETE,streamId:e,reason:mc(l)})});break;case os.ENQUEUE:if(ts(n,"enqueue should have stream controller"),n.isClosed)break;n.controller.enqueue(t.chunk);break;case os.CLOSE:if(ts(n,"close should have stream controller"),n.isClosed)break;n.isClosed=!0,n.controller.close(),oe(this,I2,JL).call(this,n,e);break;case os.ERROR:ts(n,"error should have stream controller"),n.controller.error(mc(t.reason)),oe(this,I2,JL).call(this,n,e);break;case os.CANCEL_COMPLETE:t.success?n.cancelCall.resolve():n.cancelCall.reject(mc(t.reason)),oe(this,I2,JL).call(this,n,e);break;case os.CANCEL:if(!s)break;const a=mc(t.reason);Promise.try(s.onCancel||wSe,a).then(function(){o.postMessage({sourceName:i,targetName:r,stream:os.CANCEL_COMPLETE,streamId:e,success:!0})},function(l){o.postMessage({sourceName:i,targetName:r,stream:os.CANCEL_COMPLETE,streamId:e,reason:mc(l)})}),s.sinkCapability.reject(a),s.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}},JL=async function(t,e){var i,r,o;await Promise.allSettled([(i=t.startCall)==null?void 0:i.promise,(r=t.pullCall)==null?void 0:r.promise,(o=t.cancelCall)==null?void 0:o.promise]),delete this.streamControllers[e]},MSe);var XL;class PSe{constructor({enableHWA:e=!1}){ne(this,XL,!1),ee(this,XL,e)}create(e,i){if(e<=0||i<=0)throw new Error("Invalid canvas size");const r=this._createCanvas(e,i);return{canvas:r,context:r.getContext("2d",{willReadFrequently:!B(this,XL)})}}reset(e,i,r){if(!e.canvas)throw new Error("Canvas is not specified");if(i<=0||r<=0)throw new Error("Invalid canvas size");e.canvas.width=i,e.canvas.height=r}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,i){Mo("Abstract method `_createCanvas` called.")}}XL=new WeakMap;class VUi extends PSe{constructor({ownerDocument:e=globalThis.document,enableHWA:i=!1}){super({enableHWA:i}),this._document=e}_createCanvas(e,i){const r=this._document.createElement("canvas");return r.width=e,r.height=i,r}}class ESe{constructor({baseUrl:e=null,isCompressed:i=!0}){this.baseUrl=e,this.isCompressed=i}async fetch({name:e}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw new Error("CMap name must be specified.");const i=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(i).then(r=>({cMapData:r,isCompressed:this.isCompressed})).catch(r=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${i}`)})}async _fetch(e){Mo("Abstract method `_fetch` called.")}}class SSe extends ESe{async _fetch(e){const i=await Ox(e,this.isCompressed?"arraybuffer":"text");return i instanceof ArrayBuffer?new Uint8Array(i):Fx(i)}}class BSe{addFilter(e){return"none"}addHCMFilter(e,i){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,i,r,o,n){return"none"}destroy(e=!1){}}var T7,R7,T2,R2,Tl,vA,D7,Ei,Ja,pk,L7,YL,_7,ISe,f$,F7,fk,gk,g$,mk;class zUi extends BSe{constructor({docId:e,ownerDocument:i=globalThis.document}){super(),ne(this,Ei),ne(this,T7),ne(this,R7),ne(this,T2),ne(this,R2),ne(this,Tl),ne(this,vA),ne(this,D7,0),ee(this,R2,e),ee(this,Tl,i)}addFilter(e){if(!e)return"none";let i=B(this,Ei,Ja).get(e);if(i)return i;const[r,o,n]=oe(this,Ei,YL).call(this,e),s=e.length===1?r:`${r}${o}${n}`;if(i=B(this,Ei,Ja).get(s),i)return B(this,Ei,Ja).set(e,i),i;const a=`g_${B(this,R2)}_transfer_map_${Ql(this,D7)._++}`,l=oe(this,Ei,_7).call(this,a);B(this,Ei,Ja).set(e,l),B(this,Ei,Ja).set(s,l);const c=oe(this,Ei,F7).call(this,a);return oe(this,Ei,gk).call(this,r,o,n,c),l}addHCMFilter(e,i){var r;const o=`${e}-${i}`,n="base";let s=B(this,Ei,pk).get(n);if(s?.key===o||(s?((r=s.filter)==null||r.remove(),s.key=o,s.url="none",s.filter=null):(s={key:o,url:"none",filter:null},B(this,Ei,pk).set(n,s)),!e||!i))return s.url;const a=oe(this,Ei,mk).call(this,e);e=vi.makeHexColor(...a);const l=oe(this,Ei,mk).call(this,i);if(i=vi.makeHexColor(...l),B(this,Ei,L7).style.color="",e==="#000000"&&i==="#ffffff"||e===i)return s.url;const c=new Array(256);for(let g=0;g<=255;g++){const f=g/255;c[g]=f<=.03928?f/12.92:((f+.055)/1.055)**2.4}const d=c.join(","),u=`g_${B(this,R2)}_hcm_filter`,h=s.filter=oe(this,Ei,F7).call(this,u);oe(this,Ei,gk).call(this,d,d,d,h),oe(this,Ei,f$).call(this,h);const p=(g,f)=>{const A=a[g]/255,m=l[g]/255,v=new Array(f+1);for(let y=0;y<=f;y++)v[y]=A+y/f*(m-A);return v.join(",")};return oe(this,Ei,gk).call(this,p(0,5),p(1,5),p(2,5),h),s.url=oe(this,Ei,_7).call(this,u),s.url}addAlphaFilter(e){let i=B(this,Ei,Ja).get(e);if(i)return i;const[r]=oe(this,Ei,YL).call(this,[e]),o=`alpha_${r}`;if(i=B(this,Ei,Ja).get(o),i)return B(this,Ei,Ja).set(e,i),i;const n=`g_${B(this,R2)}_alpha_map_${Ql(this,D7)._++}`,s=oe(this,Ei,_7).call(this,n);B(this,Ei,Ja).set(e,s),B(this,Ei,Ja).set(o,s);const a=oe(this,Ei,F7).call(this,n);return oe(this,Ei,g$).call(this,r,a),s}addLuminosityFilter(e){let i=B(this,Ei,Ja).get(e||"luminosity");if(i)return i;let r,o;if(e?([r]=oe(this,Ei,YL).call(this,[e]),o=`luminosity_${r}`):o="luminosity",i=B(this,Ei,Ja).get(o),i)return B(this,Ei,Ja).set(e,i),i;const n=`g_${B(this,R2)}_luminosity_map_${Ql(this,D7)._++}`,s=oe(this,Ei,_7).call(this,n);B(this,Ei,Ja).set(e,s),B(this,Ei,Ja).set(o,s);const a=oe(this,Ei,F7).call(this,n);return oe(this,Ei,ISe).call(this,a),e&&oe(this,Ei,g$).call(this,r,a),s}addHighlightHCMFilter(e,i,r,o,n){var s;const a=`${i}-${r}-${o}-${n}`;let l=B(this,Ei,pk).get(e);if(l?.key===a||(l?((s=l.filter)==null||s.remove(),l.key=a,l.url="none",l.filter=null):(l={key:a,url:"none",filter:null},B(this,Ei,pk).set(e,l)),!i||!r))return l.url;const[c,d]=[i,r].map(oe(this,Ei,mk).bind(this));let u=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),h=Math.round(.2126*d[0]+.7152*d[1]+.0722*d[2]),[p,g]=[o,n].map(oe(this,Ei,mk).bind(this));h<u&&([u,h,p,g]=[h,u,g,p]),B(this,Ei,L7).style.color="";const f=(v,y,b)=>{const w=new Array(256),C=(h-u)/b,M=v/255,P=(y-v)/(255*b);let E=0;for(let S=0;S<=b;S++){const I=Math.round(u+S*C),R=M+S*P;for(let L=E;L<=I;L++)w[L]=R;E=I+1}for(let S=E;S<256;S++)w[S]=w[E-1];return w.join(",")},A=`g_${B(this,R2)}_hcm_${e}_filter`,m=l.filter=oe(this,Ei,F7).call(this,A);return oe(this,Ei,f$).call(this,m),oe(this,Ei,gk).call(this,f(p[0],g[0],5),f(p[1],g[1],5),f(p[2],g[2],5),m),l.url=oe(this,Ei,_7).call(this,A),l.url}destroy(e=!1){var i,r,o,n;e&&(i=B(this,vA))!=null&&i.size||((r=B(this,T2))==null||r.parentNode.parentNode.remove(),ee(this,T2,null),(o=B(this,R7))==null||o.clear(),ee(this,R7,null),(n=B(this,vA))==null||n.clear(),ee(this,vA,null),ee(this,D7,0))}}T7=new WeakMap,R7=new WeakMap,T2=new WeakMap,R2=new WeakMap,Tl=new WeakMap,vA=new WeakMap,D7=new WeakMap,Ei=new WeakSet,Ja=function(){return B(this,R7)||ee(this,R7,new Map)},pk=function(){return B(this,vA)||ee(this,vA,new Map)},L7=function(){if(!B(this,T2)){const t=B(this,Tl).createElement("div"),{style:e}=t;e.visibility="hidden",e.contain="strict",e.width=e.height=0,e.position="absolute",e.top=e.left=0,e.zIndex=-1;const i=B(this,Tl).createElementNS(Wp,"svg");i.setAttribute("width",0),i.setAttribute("height",0),ee(this,T2,B(this,Tl).createElementNS(Wp,"defs")),t.append(i),i.append(B(this,T2)),B(this,Tl).body.append(t)}return B(this,T2)},YL=function(t){if(t.length===1){const a=t[0],l=new Array(256);for(let d=0;d<256;d++)l[d]=a[d]/255;const c=l.join(",");return[c,c,c]}const[e,i,r]=t,o=new Array(256),n=new Array(256),s=new Array(256);for(let a=0;a<256;a++)o[a]=e[a]/255,n[a]=i[a]/255,s[a]=r[a]/255;return[o.join(","),n.join(","),s.join(",")]},_7=function(t){if(B(this,T7)===void 0){ee(this,T7,"");const e=B(this,Tl).URL;e!==B(this,Tl).baseURI&&(vL(e)?$i('#createUrl: ignore "data:"-URL for performance reasons.'):ee(this,T7,BEe(e,"")))}return`url(${B(this,T7)}#${t})`},ISe=function(t){const e=B(this,Tl).createElementNS(Wp,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(e)},f$=function(t){const e=B(this,Tl).createElementNS(Wp,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(e)},F7=function(t){const e=B(this,Tl).createElementNS(Wp,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),B(this,Ei,L7).append(e),e},fk=function(t,e,i){const r=B(this,Tl).createElementNS(Wp,e);r.setAttribute("type","discrete"),r.setAttribute("tableValues",i),t.append(r)},gk=function(t,e,i,r){const o=B(this,Tl).createElementNS(Wp,"feComponentTransfer");r.append(o),oe(this,Ei,fk).call(this,o,"feFuncR",t),oe(this,Ei,fk).call(this,o,"feFuncG",e),oe(this,Ei,fk).call(this,o,"feFuncB",i)},g$=function(t,e){const i=B(this,Tl).createElementNS(Wp,"feComponentTransfer");e.append(i),oe(this,Ei,fk).call(this,i,"feFuncA",t)},mk=function(t){return B(this,Ei,L7).style.color=t,zY(getComputedStyle(B(this,Ei,L7)).getPropertyValue("color"))};class TSe{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");const i=`${this.baseUrl}${e}`;return this._fetch(i).catch(r=>{throw new Error(`Unable to load font data at: ${i}`)})}async _fetch(e){Mo("Abstract method `_fetch` called.")}}class RSe extends TSe{async _fetch(e){const i=await Ox(e,"arraybuffer");return new Uint8Array(i)}}class DSe{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!e)throw new Error("Wasm filename must be specified.");const i=`${this.baseUrl}${e}`;return this._fetch(i).catch(r=>{throw new Error(`Unable to load wasm data at: ${i}`)})}async _fetch(e){Mo("Abstract method `_fetch` called.")}}class LSe extends DSe{async _fetch(e){const i=await Ox(e,"arraybuffer");return new Uint8Array(i)}}Sl&&$i("Please use the `legacy` build in Node.js environments.");async function m$(t){const e=await process.getBuiltinModule("fs").promises.readFile(t);return new Uint8Array(e)}class qUi extends BSe{}class GUi extends PSe{_createCanvas(e,i){return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(e,i)}}class QUi extends ESe{async _fetch(e){return m$(e)}}class KUi extends TSe{async _fetch(e){return m$(e)}}class WUi extends DSe{async _fetch(e){return m$(e)}}const da={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function A$(t,e){if(!e)return;const i=e[2]-e[0],r=e[3]-e[1],o=new Path2D;o.rect(e[0],e[1],i,r),t.clip(o)}class v${isModifyingCurrentTransform(){return!1}getPattern(){Mo("Abstract method `getPattern` called.")}}class ZUi extends v${constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let i;this._type==="axial"?i=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(i=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const r of this._colorStops)i.addColorStop(r[0],r[1]);return i}getPattern(e,i,r,o){let n;if(o===da.STROKE||o===da.FILL){const s=i.current.getClippedPathBoundingBox(o,pn(e))||[0,0,0,0],a=Math.ceil(s[2]-s[0])||1,l=Math.ceil(s[3]-s[1])||1,c=i.cachedCanvases.getCanvas("pattern",a,l),d=c.context;d.clearRect(0,0,d.canvas.width,d.canvas.height),d.beginPath(),d.rect(0,0,d.canvas.width,d.canvas.height),d.translate(-s[0],-s[1]),r=vi.transform(r,[1,0,0,1,s[0],s[1]]),d.transform(...i.baseTransform),this.matrix&&d.transform(...this.matrix),A$(d,this._bbox),d.fillStyle=this._createGradient(d),d.fill(),n=e.createPattern(c.canvas,"no-repeat");const u=new DOMMatrix(r);n.setTransform(u)}else A$(e,this._bbox),n=this._createGradient(e);return n}}function b$(t,e,i,r,o,n,s,a){const l=e.coords,c=e.colors,d=t.data,u=t.width*4;let h;l[i+1]>l[r+1]&&(h=i,i=r,r=h,h=n,n=s,s=h),l[r+1]>l[o+1]&&(h=r,r=o,o=h,h=s,s=a,a=h),l[i+1]>l[r+1]&&(h=i,i=r,r=h,h=n,n=s,s=h);const p=(l[i]+e.offsetX)*e.scaleX,g=(l[i+1]+e.offsetY)*e.scaleY,f=(l[r]+e.offsetX)*e.scaleX,A=(l[r+1]+e.offsetY)*e.scaleY,m=(l[o]+e.offsetX)*e.scaleX,v=(l[o+1]+e.offsetY)*e.scaleY;if(g>=v)return;const y=c[n],b=c[n+1],w=c[n+2],C=c[s],M=c[s+1],P=c[s+2],E=c[a],S=c[a+1],I=c[a+2],R=Math.round(g),L=Math.round(v);let j,H,U,z,Z,Y,de,he;for(let ve=R;ve<=L;ve++){if(ve<A){const J=ve<g?0:(g-ve)/(g-A);j=p-(p-f)*J,H=y-(y-C)*J,U=b-(b-M)*J,z=w-(w-P)*J}else{let J;ve>v?J=1:A===v?J=0:J=(A-ve)/(A-v),j=f-(f-m)*J,H=C-(C-E)*J,U=M-(M-S)*J,z=P-(P-I)*J}let Ee;ve<g?Ee=0:ve>v?Ee=1:Ee=(g-ve)/(g-v),Z=p-(p-m)*Ee,Y=y-(y-E)*Ee,de=b-(b-S)*Ee,he=w-(w-I)*Ee;const we=Math.round(Math.min(j,Z)),De=Math.round(Math.max(j,Z));let Se=u*ve+we*4;for(let J=we;J<=De;J++)Ee=(j-J)/(j-Z),Ee<0?Ee=0:Ee>1&&(Ee=1),d[Se++]=H-(H-Y)*Ee|0,d[Se++]=U-(U-de)*Ee|0,d[Se++]=z-(z-he)*Ee|0,d[Se++]=255}}function JUi(t,e,i){const r=e.coords,o=e.colors;let n,s;switch(e.type){case"lattice":const a=e.verticesPerRow,l=Math.floor(r.length/a)-1,c=a-1;for(n=0;n<l;n++){let d=n*a;for(let u=0;u<c;u++,d++)b$(t,i,r[d],r[d+1],r[d+a],o[d],o[d+1],o[d+a]),b$(t,i,r[d+a+1],r[d+1],r[d+a],o[d+a+1],o[d+1],o[d+a])}break;case"triangles":for(n=0,s=r.length;n<s;n+=3)b$(t,i,r[n],r[n+1],r[n+2],o[n],o[n+1],o[n+2]);break;default:throw new Error("illegal figure")}}class XUi extends v${constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[6],this._background=e[7],this.matrix=null}_createMeshCanvas(e,i,r){const o=Math.floor(this._bounds[0]),n=Math.floor(this._bounds[1]),s=Math.ceil(this._bounds[2])-o,a=Math.ceil(this._bounds[3])-n,l=Math.min(Math.ceil(Math.abs(s*e[0]*1.1)),3e3),c=Math.min(Math.ceil(Math.abs(a*e[1]*1.1)),3e3),d=s/l,u=a/c,h={coords:this._coords,colors:this._colors,offsetX:-o,offsetY:-n,scaleX:1/d,scaleY:1/u},p=l+2*2,g=c+2*2,f=r.getCanvas("mesh",p,g),A=f.context,m=A.createImageData(l,c);if(i){const v=m.data;for(let y=0,b=v.length;y<b;y+=4)v[y]=i[0],v[y+1]=i[1],v[y+2]=i[2],v[y+3]=255}for(const v of this._figures)JUi(m,v,h);return A.putImageData(m,2,2),{canvas:f.canvas,offsetX:o-2*d,offsetY:n-2*u,scaleX:d,scaleY:u}}isModifyingCurrentTransform(){return!0}getPattern(e,i,r,o){A$(e,this._bbox);const n=new Float32Array(2);if(o===da.SHADING)vi.singularValueDecompose2dScale(pn(e),n);else if(this.matrix){vi.singularValueDecompose2dScale(this.matrix,n);const[a,l]=n;vi.singularValueDecompose2dScale(i.baseTransform,n),n[0]*=a,n[1]*=l}else vi.singularValueDecompose2dScale(i.baseTransform,n);const s=this._createMeshCanvas(n,o===da.SHADING?null:this._background,i.cachedCanvases);return o!==da.SHADING&&(e.setTransform(...i.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(s.offsetX,s.offsetY),e.scale(s.scaleX,s.scaleY),e.createPattern(s.canvas,"no-repeat")}}class YUi extends v${getPattern(){return"hotpink"}}function $Ui(t){switch(t[0]){case"RadialAxial":return new ZUi(t);case"Mesh":return new XUi(t);case"Dummy":return new YUi}throw new Error(`Unknown IR type: ${t[0]}`)}const _Se={COLORED:1,UNCOLORED:2},FSe=class f_e{constructor(e,i,r,o){this.color=e[1],this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.ctx=i,this.canvasGraphicsFactory=r,this.baseTransform=o}createPatternCanvas(e){const{bbox:i,operatorList:r,paintType:o,tilingType:n,color:s,canvasGraphicsFactory:a}=this;let{xstep:l,ystep:c}=this;l=Math.abs(l),c=Math.abs(c),gL("TilingType: "+n);const d=i[0],u=i[1],h=i[2],p=i[3],g=h-d,f=p-u,A=new Float32Array(2);vi.singularValueDecompose2dScale(this.matrix,A);const[m,v]=A;vi.singularValueDecompose2dScale(this.baseTransform,A);const y=m*A[0],b=v*A[1];let w=g,C=f,M=!1,P=!1;const E=Math.ceil(l*y),S=Math.ceil(c*b),I=Math.ceil(g*y),R=Math.ceil(f*b);E>=I?w=l:M=!0,S>=R?C=c:P=!0;const L=this.getSizeAndScale(w,this.ctx.canvas.width,y),j=this.getSizeAndScale(C,this.ctx.canvas.height,b),H=e.cachedCanvases.getCanvas("pattern",L.size,j.size),U=H.context,z=a.createCanvasGraphics(U);if(z.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(z,o,s),U.translate(-L.scale*d,-j.scale*u),z.transform(L.scale,0,0,j.scale,0,0),U.save(),this.clipBbox(z,d,u,h,p),z.baseTransform=pn(z.ctx),z.executeOperatorList(r),z.endDrawing(),U.restore(),M||P){const Z=H.canvas;M&&(w=l),P&&(C=c);const Y=this.getSizeAndScale(w,this.ctx.canvas.width,y),de=this.getSizeAndScale(C,this.ctx.canvas.height,b),he=Y.size,ve=de.size,Ee=e.cachedCanvases.getCanvas("pattern-workaround",he,ve),we=Ee.context,De=M?Math.floor(g/l):0,Se=P?Math.floor(f/c):0;for(let J=0;J<=De;J++)for(let se=0;se<=Se;se++)we.drawImage(Z,he*J,ve*se,he,ve,0,0,he,ve);return{canvas:Ee.canvas,scaleX:Y.scale,scaleY:de.scale,offsetX:d,offsetY:u}}return{canvas:H.canvas,scaleX:L.scale,scaleY:j.scale,offsetX:d,offsetY:u}}getSizeAndScale(e,i,r){const o=Math.max(f_e.MAX_PATTERN_SIZE,i);let n=Math.ceil(e*r);return n>=o?n=o:r=n/e,{scale:r,size:n}}clipBbox(e,i,r,o,n){const s=o-i,a=n-r;e.ctx.rect(i,r,s,a),vi.axialAlignedBoundingBox([i,r,o,n],pn(e.ctx),e.current.minMax),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,i,r){const o=e.ctx,n=e.current;switch(i){case _Se.COLORED:const s=this.ctx;o.fillStyle=s.fillStyle,o.strokeStyle=s.strokeStyle,n.fillColor=s.fillStyle,n.strokeColor=s.strokeStyle;break;case _Se.UNCOLORED:const a=vi.makeHexColor(r[0],r[1],r[2]);o.fillStyle=a,o.strokeStyle=a,n.fillColor=a,n.strokeColor=a;break;default:throw new wUi(`Unsupported paint type: ${i}`)}}isModifyingCurrentTransform(){return!1}getPattern(e,i,r,o){let n=r;o!==da.SHADING&&(n=vi.transform(n,i.baseTransform),this.matrix&&(n=vi.transform(n,this.matrix)));const s=this.createPatternCanvas(i);let a=new DOMMatrix(n);a=a.translate(s.offsetX,s.offsetY),a=a.scale(1/s.scaleX,1/s.scaleY);const l=e.createPattern(s.canvas,"repeat");return l.setTransform(a),l}};It(FSe,"MAX_PATTERN_SIZE",3e3);let eNi=FSe;function tNi({src:t,srcPos:e=0,dest:i,width:r,height:o,nonBlackColor:n=4294967295,inverseDecode:s=!1}){const a=aa.isLittleEndian?4278190080:255,[l,c]=s?[n,a]:[a,n],d=r>>3,u=r&7,h=t.length;i=new Uint32Array(i.buffer);let p=0;for(let g=0;g<o;g++){for(const A=e+d;e<A;e++){const m=e<h?t[e]:255;i[p++]=m&128?c:l,i[p++]=m&64?c:l,i[p++]=m&32?c:l,i[p++]=m&16?c:l,i[p++]=m&8?c:l,i[p++]=m&4?c:l,i[p++]=m&2?c:l,i[p++]=m&1?c:l}if(u===0)continue;const f=e<h?t[e++]:255;for(let A=0;A<u;A++)i[p++]=f&1<<7-A?c:l}return{srcPos:e,destPos:p}}const OSe=16,USe=100,iNi=15,NSe=10,Ac=16,y$=new DOMMatrix,nd=new Float32Array(2),O7=new Float32Array([1/0,1/0,-1/0,-1/0]);function rNi(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()},t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(i,r){e.translate(i,r),this.__originalTranslate(i,r)},t.scale=function(i,r){e.scale(i,r),this.__originalScale(i,r)},t.transform=function(i,r,o,n,s,a){e.transform(i,r,o,n,s,a),this.__originalTransform(i,r,o,n,s,a)},t.setTransform=function(i,r,o,n,s,a){e.setTransform(i,r,o,n,s,a),this.__originalSetTransform(i,r,o,n,s,a)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(i){e.rotate(i),this.__originalRotate(i)},t.clip=function(i){e.clip(i),this.__originalClip(i)},t.moveTo=function(i,r){e.moveTo(i,r),this.__originalMoveTo(i,r)},t.lineTo=function(i,r){e.lineTo(i,r),this.__originalLineTo(i,r)},t.bezierCurveTo=function(i,r,o,n,s,a){e.bezierCurveTo(i,r,o,n,s,a),this.__originalBezierCurveTo(i,r,o,n,s,a)},t.rect=function(i,r,o,n){e.rect(i,r,o,n),this.__originalRect(i,r,o,n)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}class oNi{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,i,r){let o;return this.cache[e]!==void 0?(o=this.cache[e],this.canvasFactory.reset(o,i,r)):(o=this.canvasFactory.create(i,r),this.cache[e]=o),o}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const i=this.cache[e];this.canvasFactory.destroy(i),delete this.cache[e]}}}function $L(t,e,i,r,o,n,s,a,l,c){const[d,u,h,p,g,f]=pn(t);if(u===0&&h===0){const v=s*d+g,y=Math.round(v),b=a*p+f,w=Math.round(b),C=(s+l)*d+g,M=Math.abs(Math.round(C)-y)||1,P=(a+c)*p+f,E=Math.abs(Math.round(P)-w)||1;return t.setTransform(Math.sign(d),0,0,Math.sign(p),y,w),t.drawImage(e,i,r,o,n,0,0,M,E),t.setTransform(d,u,h,p,g,f),[M,E]}if(d===0&&p===0){const v=a*h+g,y=Math.round(v),b=s*u+f,w=Math.round(b),C=(a+c)*h+g,M=Math.abs(Math.round(C)-y)||1,P=(s+l)*u+f,E=Math.abs(Math.round(P)-w)||1;return t.setTransform(0,Math.sign(u),Math.sign(h),0,y,w),t.drawImage(e,i,r,o,n,0,0,E,M),t.setTransform(d,u,h,p,g,f),[E,M]}t.drawImage(e,i,r,o,n,s,a,l,c);const A=Math.hypot(d,u),m=Math.hypot(h,p);return[A*l,m*c]}class jSe{constructor(e,i){It(this,"alphaIsShape",!1),It(this,"fontSize",0),It(this,"fontSizeScale",1),It(this,"textMatrix",null),It(this,"textMatrixScale",1),It(this,"fontMatrix",TY),It(this,"leading",0),It(this,"x",0),It(this,"y",0),It(this,"lineX",0),It(this,"lineY",0),It(this,"charSpacing",0),It(this,"wordSpacing",0),It(this,"textHScale",1),It(this,"textRenderingMode",Ga.FILL),It(this,"textRise",0),It(this,"fillColor","#000000"),It(this,"strokeColor","#000000"),It(this,"patternFill",!1),It(this,"patternStroke",!1),It(this,"fillAlpha",1),It(this,"strokeAlpha",1),It(this,"lineWidth",1),It(this,"activeSMask",null),It(this,"transferMaps","none"),this.clipBox=new Float32Array([0,0,e,i]),this.minMax=O7.slice()}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e.minMax=this.minMax.slice(),e}getPathBoundingBox(e=da.FILL,i=null){const r=this.minMax.slice();if(e===da.STROKE){i||Mo("Stroke bounding box must include transform."),vi.singularValueDecompose2dScale(i,nd);const o=nd[0]*this.lineWidth/2,n=nd[1]*this.lineWidth/2;r[0]-=o,r[1]-=n,r[2]+=o,r[3]+=n}return r}updateClipFromPath(){const e=vi.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(e){this.clipBox.set(e,0),this.minMax.set(O7,0)}getClippedPathBoundingBox(e=da.FILL,i=null){return vi.intersect(this.clipBox,this.getPathBoundingBox(e,i))}}function HSe(t,e){if(e instanceof ImageData){t.putImageData(e,0,0);return}const i=e.height,r=e.width,o=i%Ac,n=(i-o)/Ac,s=o===0?n:n+1,a=t.createImageData(r,Ac);let l=0,c;const d=e.data,u=a.data;let h,p,g,f;if(e.kind===dL.GRAYSCALE_1BPP){const A=d.byteLength,m=new Uint32Array(u.buffer,0,u.byteLength>>2),v=m.length,y=r+7>>3,b=4294967295,w=aa.isLittleEndian?4278190080:255;for(h=0;h<s;h++){for(g=h<n?Ac:o,c=0,p=0;p<g;p++){const C=A-l;let M=0;const P=C>y?r:C*8-7,E=P&-8;let S=0,I=0;for(;M<E;M+=8)I=d[l++],m[c++]=I&128?b:w,m[c++]=I&64?b:w,m[c++]=I&32?b:w,m[c++]=I&16?b:w,m[c++]=I&8?b:w,m[c++]=I&4?b:w,m[c++]=I&2?b:w,m[c++]=I&1?b:w;for(;M<P;M++)S===0&&(I=d[l++],S=128),m[c++]=I&S?b:w,S>>=1}for(;c<v;)m[c++]=0;t.putImageData(a,0,h*Ac)}}else if(e.kind===dL.RGBA_32BPP){for(p=0,f=r*Ac*4,h=0;h<n;h++)u.set(d.subarray(l,l+f)),l+=f,t.putImageData(a,0,p),p+=Ac;h<s&&(f=r*o*4,u.set(d.subarray(l,l+f)),t.putImageData(a,0,p))}else if(e.kind===dL.RGB_24BPP)for(g=Ac,f=r*g,h=0;h<s;h++){for(h>=n&&(g=o,f=r*g),c=0,p=f;p--;)u[c++]=d[l++],u[c++]=d[l++],u[c++]=d[l++],u[c++]=255;t.putImageData(a,0,h*Ac)}else throw new Error(`bad image kind: ${e.kind}`)}function VSe(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}const i=e.height,r=e.width,o=i%Ac,n=(i-o)/Ac,s=o===0?n:n+1,a=t.createImageData(r,Ac);let l=0;const c=e.data,d=a.data;for(let u=0;u<s;u++){const h=u<n?Ac:o;({srcPos:l}=tNi({src:c,srcPos:l,dest:d,width:r,height:h,nonBlackColor:0})),t.putImageData(a,0,u*Ac)}}function Ak(t,e){const i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const r of i)t[r]!==void 0&&(e[r]=t[r]);t.setLineDash!==void 0&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function e_(t){t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",t.setLineDash!==void 0&&(t.setLineDash([]),t.lineDashOffset=0);const{filter:e}=t;e!=="none"&&e!==""&&(t.filter="none")}function zSe(t,e){if(e)return!0;vi.singularValueDecompose2dScale(t,nd);const i=Math.fround(F0.pixelRatio*d7.PDF_TO_CSS_UNITS);return nd[0]<=i&&nd[1]<=i}const nNi=["butt","round","square"],sNi=["miter","round","bevel"],aNi={},qSe={};var D2,w$,C$,x$;const lNi=class g_e{constructor(e,i,r,o,n,{optionalContentConfig:s,markedContentStack:a=null},l,c){ne(this,D2),this.ctx=e,this.current=new jSe(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=i,this.objs=r,this.canvasFactory=o,this.filterFactory=n,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=a||[],this.optionalContentConfig=s,this.cachedCanvases=new oNi(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=l,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(e,i=null){return typeof e=="string"?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):i}beginDrawing({transform:e,viewport:i,transparency:r=!1,background:o=null}){const n=this.ctx.canvas.width,s=this.ctx.canvas.height,a=this.ctx.fillStyle;if(this.ctx.fillStyle=o||"#ffffff",this.ctx.fillRect(0,0,n,s),this.ctx.fillStyle=a,r){const l=this.cachedCanvases.getCanvas("transparent",n,s);this.compositeCtx=this.ctx,this.transparentCanvas=l.canvas,this.ctx=l.context,this.ctx.save(),this.ctx.transform(...pn(this.compositeCtx))}this.ctx.save(),e_(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...i.transform),this.viewportScale=i.scale,this.baseTransform=pn(this.ctx)}executeOperatorList(e,i,r,o){const n=e.argsArray,s=e.fnArray;let a=i||0;const l=n.length;if(l===a)return a;const c=l-a>NSe&&typeof r=="function",d=c?Date.now()+iNi:0;let u=0;const h=this.commonObjs,p=this.objs;let g;for(;;){if(o!==void 0&&a===o.nextBreakPoint)return o.breakIt(a,r),a;if(g=s[a],g!==hL.dependency)this[g].apply(this,n[a]);else for(const f of n[a]){const A=f.startsWith("g_")?h:p;if(!A.has(f))return A.get(f,r),a}if(a++,a===l)return a;if(c&&++u>NSe){if(Date.now()>d)return r(),a;u=0}}}endDrawing(){oe(this,D2,w$).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const i of e.values())typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement&&(i.width=i.height=0);e.clear()}this._cachedBitmapsMap.clear(),oe(this,D2,C$).call(this)}_scaleImage(e,i){const r=e.width??e.displayWidth,o=e.height??e.displayHeight;let n=Math.max(Math.hypot(i[0],i[1]),1),s=Math.max(Math.hypot(i[2],i[3]),1),a=r,l=o,c="prescale1",d,u;for(;n>2&&a>1||s>2&&l>1;){let h=a,p=l;n>2&&a>1&&(h=a>=16384?Math.floor(a/2)-1||1:Math.ceil(a/2),n/=a/h),s>2&&l>1&&(p=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,s/=l/p),d=this.cachedCanvases.getCanvas(c,h,p),u=d.context,u.clearRect(0,0,h,p),u.drawImage(e,0,0,a,l,0,0,h,p),e=d.canvas,a=h,l=p,c=c==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:a,paintHeight:l}}_createMaskCanvas(e){const i=this.ctx,{width:r,height:o}=e,n=this.current.fillColor,s=this.current.patternFill,a=pn(i);let l,c,d,u;if((e.bitmap||e.data)&&e.count>1){const E=e.bitmap||e.data.buffer;c=JSON.stringify(s?a:[a.slice(0,4),n]),l=this._cachedBitmapsMap.get(E),l||(l=new Map,this._cachedBitmapsMap.set(E,l));const S=l.get(c);if(S&&!s){const I=Math.round(Math.min(a[0],a[2])+a[4]),R=Math.round(Math.min(a[1],a[3])+a[5]);return{canvas:S,offsetX:I,offsetY:R}}d=S}d||(u=this.cachedCanvases.getCanvas("maskCanvas",r,o),VSe(u.context,e));let h=vi.transform(a,[1/r,0,0,-1/o,0,0]);h=vi.transform(h,[1,0,0,1,0,-o]);const p=O7.slice();vi.axialAlignedBoundingBox([0,0,r,o],h,p);const[g,f,A,m]=p,v=Math.round(A-g)||1,y=Math.round(m-f)||1,b=this.cachedCanvases.getCanvas("fillCanvas",v,y),w=b.context,C=g,M=f;w.translate(-C,-M),w.transform(...h),d||(d=this._scaleImage(u.canvas,s1(w)),d=d.img,l&&s&&l.set(c,d)),w.imageSmoothingEnabled=zSe(pn(w),e.interpolate),$L(w,d,0,0,d.width,d.height,0,0,r,o),w.globalCompositeOperation="source-in";const P=vi.transform(s1(w),[1,0,0,1,-C,-M]);return w.fillStyle=s?n.getPattern(i,this,P,da.FILL):n,w.fillRect(0,0,r,o),l&&!s&&(this.cachedCanvases.delete("fillCanvas"),l.set(c,b.canvas)),{canvas:b.canvas,offsetX:Math.round(C),offsetY:Math.round(M)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=nNi[e]}setLineJoin(e){this.ctx.lineJoin=sNi[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,i){const r=this.ctx;r.setLineDash!==void 0&&(r.setLineDash(e),r.lineDashOffset=i)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[i,r]of e)switch(i){case"LW":this.setLineWidth(r);break;case"LC":this.setLineCap(r);break;case"LJ":this.setLineJoin(r);break;case"ML":this.setMiterLimit(r);break;case"D":this.setDash(r[0],r[1]);break;case"RI":this.setRenderingIntent(r);break;case"FL":this.setFlatness(r);break;case"Font":this.setFont(r[0],r[1]);break;case"CA":this.current.strokeAlpha=r;break;case"ca":this.ctx.globalAlpha=this.current.fillAlpha=r;break;case"BM":this.ctx.globalCompositeOperation=r;break;case"SMask":this.current.activeSMask=r?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(r);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,i=this.ctx.canvas.height,r="smaskGroupAt"+this.groupLevel,o=this.cachedCanvases.getCanvas(r,e,i);this.suspendedCtx=this.ctx;const n=this.ctx=o.context;n.setTransform(this.suspendedCtx.getTransform()),Ak(this.suspendedCtx,n),rNi(n,this.suspendedCtx),this.setGState([["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Ak(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const i=this.current.activeSMask,r=this.suspendedCtx;this.composeSMask(r,i,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(e,i,r,o){const n=o[0],s=o[1],a=o[2]-n,l=o[3]-s;a===0||l===0||(this.genericComposeSMask(i.context,r,a,l,i.subtype,i.backdrop,i.transferMap,n,s,i.offsetX,i.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(r.canvas,0,0),e.restore())}genericComposeSMask(e,i,r,o,n,s,a,l,c,d,u){let h=e.canvas,p=l-d,g=c-u;if(s){const A=vi.makeHexColor(...s);if(p<0||g<0||p+r>h.width||g+o>h.height){const m=this.cachedCanvases.getCanvas("maskExtension",r,o),v=m.context;v.drawImage(h,-p,-g),v.globalCompositeOperation="destination-atop",v.fillStyle=A,v.fillRect(0,0,r,o),v.globalCompositeOperation="source-over",h=m.canvas,p=g=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const m=new Path2D;m.rect(p,g,r,o),e.clip(m),e.globalCompositeOperation="destination-atop",e.fillStyle=A,e.fillRect(p,g,r,o),e.restore()}}i.save(),i.globalAlpha=1,i.setTransform(1,0,0,1,0,0),n==="Alpha"&&a?i.filter=this.filterFactory.addAlphaFilter(a):n==="Luminosity"&&(i.filter=this.filterFactory.addLuminosityFilter(a));const f=new Path2D;f.rect(l,c,r,o),i.clip(f),i.globalCompositeOperation="destination-in",i.drawImage(h,p,g,r,o,l,c,r,o),i.restore()}save(){this.inSMaskMode&&Ak(this.ctx,this.suspendedCtx),this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){if(this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&Ak(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(e,i,r,o,n,s){this.ctx.transform(e,i,r,o,n,s),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,i,r){let[o]=i;if(!r){o||(o=i[0]=new Path2D),this[e](o);return}if(!(o instanceof Path2D)){const n=i[0]=new Path2D;for(let s=0,a=o.length;s<a;)switch(o[s++]){case pL.moveTo:n.moveTo(o[s++],o[s++]);break;case pL.lineTo:n.lineTo(o[s++],o[s++]);break;case pL.curveTo:n.bezierCurveTo(o[s++],o[s++],o[s++],o[s++],o[s++],o[s++]);break;case pL.closePath:n.closePath();break;default:$i(`Unrecognized drawing path operator: ${o[s-1]}`);break}o=n}vi.axialAlignedBoundingBox(r,pn(this.ctx),this.current.minMax),this[e](o)}closePath(){this.ctx.closePath()}stroke(e,i=!0){const r=this.ctx,o=this.current.strokeColor;if(r.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof o=="object"&&o!=null&&o.getPattern){const n=o.isModifyingCurrentTransform()?r.getTransform():null;if(r.save(),r.strokeStyle=o.getPattern(r,this,s1(r),da.STROKE),n){const s=new Path2D;s.addPath(e,r.getTransform().invertSelf().multiplySelf(n)),e=s}this.rescaleAndStroke(e,!1),r.restore()}else this.rescaleAndStroke(e,!0);i&&this.consumePath(e,this.current.getClippedPathBoundingBox(da.STROKE,pn(this.ctx))),r.globalAlpha=this.current.fillAlpha}closeStroke(e){this.stroke(e)}fill(e,i=!0){const r=this.ctx,o=this.current.fillColor,n=this.current.patternFill;let s=!1;if(n){const l=o.isModifyingCurrentTransform()?r.getTransform():null;if(r.save(),r.fillStyle=o.getPattern(r,this,s1(r),da.FILL),l){const c=new Path2D;c.addPath(e,r.getTransform().invertSelf().multiplySelf(l)),e=c}s=!0}const a=this.current.getClippedPathBoundingBox();this.contentVisible&&a!==null&&(this.pendingEOFill?(r.fill(e,"evenodd"),this.pendingEOFill=!1):r.fill(e)),s&&r.restore(),i&&this.consumePath(e,a)}eoFill(e){this.pendingEOFill=!0,this.fill(e)}fillStroke(e){this.fill(e,!1),this.stroke(e,!1),this.consumePath(e)}eoFillStroke(e){this.pendingEOFill=!0,this.fillStroke(e)}closeFillStroke(e){this.fillStroke(e)}closeEOFillStroke(e){this.pendingEOFill=!0,this.fillStroke(e)}endPath(e){this.consumePath(e)}rawFillPath(e){this.ctx.fill(e)}clip(){this.pendingClip=aNi}eoClip(){this.pendingClip=qSe}beginText(){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const e=this.pendingTextPaths,i=this.ctx;if(e===void 0)return;const r=new Path2D,o=i.getTransform().invertSelf();for(const{transform:n,x:s,y:a,fontSize:l,path:c}of e)r.addPath(c,new DOMMatrix(n).preMultiplySelf(o).translate(s,a).scale(l,-l));i.clip(r),delete this.pendingTextPaths}setCharSpacing(e){this.current.charSpacing=e}setWordSpacing(e){this.current.wordSpacing=e}setHScale(e){this.current.textHScale=e/100}setLeading(e){this.current.leading=-e}setFont(e,i){var r;const o=this.commonObjs.get(e),n=this.current;if(!o)throw new Error(`Can't find font for ${e}`);if(n.fontMatrix=o.fontMatrix||TY,(n.fontMatrix[0]===0||n.fontMatrix[3]===0)&&$i("Invalid font matrix for font "+e),i<0?(i=-i,n.fontDirection=-1):n.fontDirection=1,this.current.font=o,this.current.fontSize=i,o.isType3Font)return;const s=o.loadedName||"sans-serif",a=((r=o.systemFontInfo)==null?void 0:r.css)||`"${s}", ${o.fallbackName}`;let l="normal";o.black?l="900":o.bold&&(l="bold");const c=o.italic?"italic":"normal";let d=i;i<OSe?d=OSe:i>USe&&(d=USe),this.current.fontSizeScale=i/d,this.ctx.font=`${c} ${l} ${d}px ${a}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,i){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=i}setLeadingMoveText(e,i){this.setLeading(-i),this.moveText(e,i)}setTextMatrix(e){const{current:i}=this;i.textMatrix=e,i.textMatrixScale=Math.hypot(e[0],e[1]),i.x=i.lineX=0,i.y=i.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,i,r,o,n){const s=this.ctx,a=this.current,l=a.font,c=a.textRenderingMode,d=a.fontSize/a.fontSizeScale,u=c&Ga.FILL_STROKE_MASK,h=!!(c&Ga.ADD_TO_PATH_FLAG),p=a.patternFill&&!l.missingFile,g=a.patternStroke&&!l.missingFile;let f;if((l.disableFontFace||h||p||g)&&(f=l.getPathGenerator(this.commonObjs,e)),l.disableFontFace||p||g){s.save(),s.translate(i,r),s.scale(d,-d);let A;if((u===Ga.FILL||u===Ga.FILL_STROKE)&&(o?(A=s.getTransform(),s.setTransform(...o),s.fill(oe(this,D2,x$).call(this,f,A,o))):s.fill(f)),u===Ga.STROKE||u===Ga.FILL_STROKE)if(n){A||(A=s.getTransform()),s.setTransform(...n);const{a:m,b:v,c:y,d:b}=A,w=vi.inverseTransform(n),C=vi.transform([m,v,y,b,0,0],w);vi.singularValueDecompose2dScale(C,nd),s.lineWidth*=Math.max(nd[0],nd[1])/d,s.stroke(oe(this,D2,x$).call(this,f,A,n))}else s.lineWidth/=d,s.stroke(f);s.restore()}else(u===Ga.FILL||u===Ga.FILL_STROKE)&&s.fillText(e,i,r),(u===Ga.STROKE||u===Ga.FILL_STROKE)&&s.strokeText(e,i,r);h&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:pn(s),x:i,y:r,fontSize:d,path:f})}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const i=e.getImageData(0,0,10,10).data;let r=!1;for(let o=3;o<i.length;o+=4)if(i[o]>0&&i[o]<255){r=!0;break}return br(this,"isFontSubpixelAAEnabled",r)}showText(e){const i=this.current,r=i.font;if(r.isType3Font)return this.showType3Text(e);const o=i.fontSize;if(o===0)return;const n=this.ctx,s=i.fontSizeScale,a=i.charSpacing,l=i.wordSpacing,c=i.fontDirection,d=i.textHScale*c,u=e.length,h=r.vertical,p=h?1:-1,g=r.defaultVMetrics,f=o*i.fontMatrix[0],A=i.textRenderingMode===Ga.FILL&&!r.disableFontFace&&!i.patternFill;n.save(),i.textMatrix&&n.transform(...i.textMatrix),n.translate(i.x,i.y+i.textRise),c>0?n.scale(d,-1):n.scale(d,1);let m,v;if(i.patternFill){n.save();const M=i.fillColor.getPattern(n,this,s1(n),da.FILL);m=pn(n),n.restore(),n.fillStyle=M}if(i.patternStroke){n.save();const M=i.strokeColor.getPattern(n,this,s1(n),da.STROKE);v=pn(n),n.restore(),n.strokeStyle=M}let y=i.lineWidth;const b=i.textMatrixScale;if(b===0||y===0){const M=i.textRenderingMode&Ga.FILL_STROKE_MASK;(M===Ga.STROKE||M===Ga.FILL_STROKE)&&(y=this.getSinglePixelWidth())}else y/=b;if(s!==1&&(n.scale(s,s),y/=s),n.lineWidth=y,r.isInvalidPDFjsFont){const M=[];let P=0;for(const E of e)M.push(E.unicode),P+=E.width;n.fillText(M.join(""),0,0),i.x+=P*f*d,n.restore(),this.compose();return}let w=0,C;for(C=0;C<u;++C){const M=e[C];if(typeof M=="number"){w+=p*M*o/1e3;continue}let P=!1;const E=(M.isSpace?l:0)+a,S=M.fontChar,I=M.accent;let R,L,j=M.width;if(h){const U=M.vmetric||g,z=-(M.vmetric?U[1]:j*.5)*f,Z=U[2]*f;j=U?-U[0]:j,R=z/s,L=(w+Z)/s}else R=w/s,L=0;if(r.remeasure&&j>0){const U=n.measureText(S).width*1e3/o*s;if(j<U&&this.isFontSubpixelAAEnabled){const z=j/U;P=!0,n.save(),n.scale(z,1),R/=z}else j!==U&&(R+=(j-U)/2e3*o/s)}if(this.contentVisible&&(M.isInFont||r.missingFile)){if(A&&!I)n.fillText(S,R,L);else if(this.paintChar(S,R,L,m,v),I){const U=R+o*I.offset.x/s,z=L-o*I.offset.y/s;this.paintChar(I.fontChar,U,z,m,v)}}const H=h?j*f-E*c:j*f+E*c;w+=H,P&&n.restore()}h?i.y-=w:i.x+=w*d,n.restore(),this.compose()}showType3Text(e){const i=this.ctx,r=this.current,o=r.font,n=r.fontSize,s=r.fontDirection,a=o.vertical?1:-1,l=r.charSpacing,c=r.wordSpacing,d=r.textHScale*s,u=r.fontMatrix||TY,h=e.length,p=r.textRenderingMode===Ga.INVISIBLE;let g,f,A,m;if(!(p||n===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,i.save(),r.textMatrix&&i.transform(...r.textMatrix),i.translate(r.x,r.y+r.textRise),i.scale(d,s),g=0;g<h;++g){if(f=e[g],typeof f=="number"){m=a*f*n/1e3,this.ctx.translate(m,0),r.x+=m*d;continue}const v=(f.isSpace?c:0)+l,y=o.charProcOperatorList[f.operatorListId];y?this.contentVisible&&(this.save(),i.scale(n,n),i.transform(...u),this.executeOperatorList(y),this.restore()):$i(`Type3 character "${f.operatorListId}" is not available.`);const b=[f.width,0];vi.applyTransform(b,u),A=b[0]*n+v,i.translate(A,0),r.x+=A*d}i.restore()}}setCharWidth(e,i){}setCharWidthAndBounds(e,i,r,o,n,s){const a=new Path2D;a.rect(r,o,n-r,s-o),this.ctx.clip(a),this.endPath()}getColorN_Pattern(e){let i;if(e[0]==="TilingPattern"){const r=this.baseTransform||pn(this.ctx),o={createCanvasGraphics:n=>new g_e(n,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};i=new eNi(e,this.ctx,o,r)}else i=this._getPattern(e[1],e[2]);return i}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments),this.current.patternStroke=!0}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,i,r){this.ctx.strokeStyle=this.current.strokeColor=vi.makeHexColor(e,i,r),this.current.patternStroke=!1}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(e,i,r){this.ctx.fillStyle=this.current.fillColor=vi.makeHexColor(e,i,r),this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,i=null){let r;return this.cachedPatterns.has(e)?r=this.cachedPatterns.get(e):(r=$Ui(this.getObject(e)),this.cachedPatterns.set(e,r)),i&&(r.matrix=i),r}shadingFill(e){if(!this.contentVisible)return;const i=this.ctx;this.save();const r=this._getPattern(e);i.fillStyle=r.getPattern(i,this,s1(i),da.SHADING);const o=s1(i);if(o){const{width:n,height:s}=i.canvas,a=O7.slice();vi.axialAlignedBoundingBox([0,0,n,s],o,a);const[l,c,d,u]=a;this.ctx.fillRect(l,c,d-l,u-c)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Mo("Should not call beginInlineImage")}beginImageData(){Mo("Should not call beginImageData")}paintFormXObjectBegin(e,i){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),e&&this.transform(...e),this.baseTransform=pn(this.ctx),i)){vi.axialAlignedBoundingBox(i,this.baseTransform,this.current.minMax);const[r,o,n,s]=i,a=new Path2D;a.rect(r,o,n-r,s-o),this.ctx.clip(a),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const i=this.ctx;e.isolated||gL("TODO: Support non-isolated groups."),e.knockout&&$i("Knockout groups not supported.");const r=pn(i);if(e.matrix&&i.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let o=O7.slice();vi.axialAlignedBoundingBox(e.bbox,pn(i),o);const n=[0,0,i.canvas.width,i.canvas.height];o=vi.intersect(o,n)||[0,0,0,0];const s=Math.floor(o[0]),a=Math.floor(o[1]),l=Math.max(Math.ceil(o[2])-s,1),c=Math.max(Math.ceil(o[3])-a,1);this.current.startNewPathAndClipBox([0,0,l,c]);let d="groupAt"+this.groupLevel;e.smask&&(d+="_smask_"+this.smaskCounter++%2);const u=this.cachedCanvases.getCanvas(d,l,c),h=u.context;h.translate(-s,-a),h.transform(...r);let p=new Path2D;const[g,f,A,m]=e.bbox;if(p.rect(g,f,A-g,m-f),e.matrix){const v=new Path2D;v.addPath(p,new DOMMatrix(e.matrix)),p=v}h.clip(p),e.smask?this.smaskStack.push({canvas:u.canvas,context:h,offsetX:s,offsetY:a,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(i.setTransform(1,0,0,1,0,0),i.translate(s,a),i.save()),Ak(i,h),this.ctx=h,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(i),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const i=this.ctx,r=this.groupStack.pop();if(this.ctx=r,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const o=pn(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...o);const n=O7.slice();vi.axialAlignedBoundingBox([0,0,i.canvas.width,i.canvas.height],o,n),this.ctx.drawImage(i.canvas,0,0),this.ctx.restore(),this.compose(n)}}beginAnnotation(e,i,r,o,n){if(oe(this,D2,w$).call(this),e_(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),i){const s=i[2]-i[0],a=i[3]-i[1];if(n&&this.annotationCanvasMap){r=r.slice(),r[4]-=i[0],r[5]-=i[1],i=i.slice(),i[0]=i[1]=0,i[2]=s,i[3]=a,vi.singularValueDecompose2dScale(pn(this.ctx),nd);const{viewportScale:l}=this,c=Math.ceil(s*this.outputScaleX*l),d=Math.ceil(a*this.outputScaleY*l);this.annotationCanvas=this.canvasFactory.create(c,d);const{canvas:u,context:h}=this.annotationCanvas;this.annotationCanvasMap.set(e,u),this.annotationCanvas.savedCtx=this.ctx,this.ctx=h,this.ctx.save(),this.ctx.setTransform(nd[0],0,0,-nd[1],0,a*nd[1]),e_(this.ctx)}else{e_(this.ctx),this.endPath();const l=new Path2D;l.rect(i[0],i[1],s,a),this.ctx.clip(l)}}this.current=new jSe(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...r),this.transform(...o)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),oe(this,D2,C$).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const i=e.count;e=this.getObject(e.data,e),e.count=i;const r=this.ctx,o=this._createMaskCanvas(e),n=o.canvas;r.save(),r.setTransform(1,0,0,1,0,0),r.drawImage(n,o.offsetX,o.offsetY),r.restore(),this.compose()}paintImageMaskXObjectRepeat(e,i,r=0,o=0,n,s){if(!this.contentVisible)return;e=this.getObject(e.data,e);const a=this.ctx;a.save();const l=pn(a);a.transform(i,r,o,n,0,0);const c=this._createMaskCanvas(e);a.setTransform(1,0,0,1,c.offsetX-l[4],c.offsetY-l[5]);for(let d=0,u=s.length;d<u;d+=2){const h=vi.transform(l,[i,r,o,n,s[d],s[d+1]]);a.drawImage(c.canvas,h[4],h[5])}a.restore(),this.compose()}paintImageMaskXObjectGroup(e){if(!this.contentVisible)return;const i=this.ctx,r=this.current.fillColor,o=this.current.patternFill;for(const n of e){const{data:s,width:a,height:l,transform:c}=n,d=this.cachedCanvases.getCanvas("maskCanvas",a,l),u=d.context;u.save();const h=this.getObject(s,n);VSe(u,h),u.globalCompositeOperation="source-in",u.fillStyle=o?r.getPattern(u,this,s1(i),da.FILL):r,u.fillRect(0,0,a,l),u.restore(),i.save(),i.transform(...c),i.scale(1,-1),$L(i,d.canvas,0,0,a,l,0,-1,1,1),i.restore()}this.compose()}paintImageXObject(e){if(!this.contentVisible)return;const i=this.getObject(e);if(!i){$i("Dependent image isn't ready yet");return}this.paintInlineImageXObject(i)}paintImageXObjectRepeat(e,i,r,o){if(!this.contentVisible)return;const n=this.getObject(e);if(!n){$i("Dependent image isn't ready yet");return}const s=n.width,a=n.height,l=[];for(let c=0,d=o.length;c<d;c+=2)l.push({transform:[i,0,0,r,o[c],o[c+1]],x:0,y:0,w:s,h:a});this.paintInlineImageXObjectGroup(n,l)}applyTransferMapsToCanvas(e){return this.current.transferMaps!=="none"&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps==="none")return e.bitmap;const{bitmap:i,width:r,height:o}=e,n=this.cachedCanvases.getCanvas("inlineImage",r,o),s=n.context;return s.filter=this.current.transferMaps,s.drawImage(i,0,0),s.filter="none",n.canvas}paintInlineImageXObject(e){if(!this.contentVisible)return;const i=e.width,r=e.height,o=this.ctx;this.save();const{filter:n}=o;n!=="none"&&n!==""&&(o.filter="none"),o.scale(1/i,-1/r);let s;if(e.bitmap)s=this.applyTransferMapsToBitmap(e);else if(typeof HTMLElement=="function"&&e instanceof HTMLElement||!e.data)s=e;else{const l=this.cachedCanvases.getCanvas("inlineImage",i,r).context;HSe(l,e),s=this.applyTransferMapsToCanvas(l)}const a=this._scaleImage(s,s1(o));o.imageSmoothingEnabled=zSe(pn(o),e.interpolate),$L(o,a.img,0,0,a.paintWidth,a.paintHeight,0,-r,i,r),this.compose(),this.restore()}paintInlineImageXObjectGroup(e,i){if(!this.contentVisible)return;const r=this.ctx;let o;if(e.bitmap)o=e.bitmap;else{const n=e.width,s=e.height,a=this.cachedCanvases.getCanvas("inlineImage",n,s).context;HSe(a,e),o=this.applyTransferMapsToCanvas(a)}for(const n of i)r.save(),r.transform(...n.transform),r.scale(1,-1),$L(r,o,n.x,n.y,n.w,n.h,0,-1,1,1),r.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e){}markPointProps(e,i){}beginMarkedContent(e){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,i){e==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(i)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(e,i){const r=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(i);const o=this.ctx;this.pendingClip&&(r||(this.pendingClip===qSe?o.clip(e,"evenodd"):o.clip(e)),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=pn(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const i=Math.abs(e[0]*e[3]-e[2]*e[1]),r=Math.hypot(e[0],e[2]),o=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(r,o)/i}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:e}=this.current,{a:i,b:r,c:o,d:n}=this.ctx.getTransform();let s,a;if(r===0&&o===0){const l=Math.abs(i),c=Math.abs(n);if(l===c)if(e===0)s=a=1/l;else{const d=l*e;s=a=d<1?1/d:1}else if(e===0)s=1/l,a=1/c;else{const d=l*e,u=c*e;s=d<1?1/d:1,a=u<1?1/u:1}}else{const l=Math.abs(i*n-r*o),c=Math.hypot(i,r),d=Math.hypot(o,n);if(e===0)s=d/l,a=c/l;else{const u=e*l;s=d>u?d/u:1,a=c>u?c/u:1}}this._cachedScaleForStroking[0]=s,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(e,i){const{ctx:r,current:{lineWidth:o}}=this,[n,s]=this.getScaleForStroking();if(n===s){r.lineWidth=(o||1)*n,r.stroke(e);return}const a=r.getLineDash();i&&r.save(),r.scale(n,s),y$.a=1/n,y$.d=1/s;const l=new Path2D;if(l.addPath(e,y$),a.length>0){const c=Math.max(n,s);r.setLineDash(a.map(d=>d/c)),r.lineDashOffset/=c}r.lineWidth=o||1,r.stroke(l),i&&r.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}};D2=new WeakSet,w$=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},C$=function(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(t!=="none"){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}},x$=function(t,e,i){const r=new Path2D;return r.addPath(t,new DOMMatrix(i).invertSelf().multiplySelf(e)),r};let t_=lNi;for(const t in hL)t_.prototype[t]!==void 0&&(t_.prototype[hL[t]]=t_.prototype[t]);var i_,r_;class n0{static get workerPort(){return B(this,i_)}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");ee(this,i_,e)}static get workerSrc(){return B(this,r_)}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");ee(this,r_,e)}}i_=new WeakMap,r_=new WeakMap,ne(n0,i_,null),ne(n0,r_,"");var vk,o_;class cNi{constructor({parsedData:e,rawData:i}){ne(this,vk),ne(this,o_),ee(this,vk,e),ee(this,o_,i)}getRaw(){return B(this,o_)}get(e){return B(this,vk).get(e)??null}[Symbol.iterator](){return B(this,vk).entries()}}vk=new WeakMap,o_=new WeakMap;const U7=Symbol("INTERNAL");var n_,s_,a_,bk;class dNi{constructor(e,{name:i,intent:r,usage:o,rbGroups:n}){ne(this,n_,!1),ne(this,s_,!1),ne(this,a_,!1),ne(this,bk,!0),ee(this,n_,!!(e&rd.DISPLAY)),ee(this,s_,!!(e&rd.PRINT)),this.name=i,this.intent=r,this.usage=o,this.rbGroups=n}get visible(){if(B(this,a_))return B(this,bk);if(!B(this,bk))return!1;const{print:e,view:i}=this.usage;return B(this,n_)?i?.viewState!=="OFF":B(this,s_)?e?.printState!=="OFF":!0}_setVisible(e,i,r=!1){e!==U7&&Mo("Internal method `_setVisible` called."),ee(this,a_,r),ee(this,bk,i)}}n_=new WeakMap,s_=new WeakMap,a_=new WeakMap,bk=new WeakMap;var bA,Io,yk,wk,l_,k$;class uNi{constructor(e,i=rd.DISPLAY){if(ne(this,l_),ne(this,bA,null),ne(this,Io,new Map),ne(this,yk,null),ne(this,wk,null),this.renderingIntent=i,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,ee(this,wk,e.order);for(const r of e.groups)B(this,Io).set(r.id,new dNi(i,r));if(e.baseState==="OFF")for(const r of B(this,Io).values())r._setVisible(U7,!1);for(const r of e.on)B(this,Io).get(r)._setVisible(U7,!0);for(const r of e.off)B(this,Io).get(r)._setVisible(U7,!1);ee(this,yk,this.getHash())}}isVisible(e){if(B(this,Io).size===0)return!0;if(!e)return gL("Optional content group not defined."),!0;if(e.type==="OCG")return B(this,Io).has(e.id)?B(this,Io).get(e.id).visible:($i(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return oe(this,l_,k$).call(this,e.expression);if(!e.policy||e.policy==="AnyOn"){for(const i of e.ids){if(!B(this,Io).has(i))return $i(`Optional content group not found: ${i}`),!0;if(B(this,Io).get(i).visible)return!0}return!1}else if(e.policy==="AllOn"){for(const i of e.ids){if(!B(this,Io).has(i))return $i(`Optional content group not found: ${i}`),!0;if(!B(this,Io).get(i).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(const i of e.ids){if(!B(this,Io).has(i))return $i(`Optional content group not found: ${i}`),!0;if(!B(this,Io).get(i).visible)return!0}return!1}else if(e.policy==="AllOff"){for(const i of e.ids){if(!B(this,Io).has(i))return $i(`Optional content group not found: ${i}`),!0;if(B(this,Io).get(i).visible)return!1}return!0}return $i(`Unknown optional content policy ${e.policy}.`),!0}return $i(`Unknown group type ${e.type}.`),!0}setVisibility(e,i=!0,r=!0){var o;const n=B(this,Io).get(e);if(!n){$i(`Optional content group not found: ${e}`);return}if(r&&i&&n.rbGroups.length)for(const s of n.rbGroups)for(const a of s)a!==e&&((o=B(this,Io).get(a))==null||o._setVisible(U7,!1,!0));n._setVisible(U7,!!i,!0),ee(this,bA,null)}setOCGState({state:e,preserveRB:i}){let r;for(const o of e){switch(o){case"ON":case"OFF":case"Toggle":r=o;continue}const n=B(this,Io).get(o);if(n)switch(r){case"ON":this.setVisibility(o,!0,i);break;case"OFF":this.setVisibility(o,!1,i);break;case"Toggle":this.setVisibility(o,!n.visible,i);break}}ee(this,bA,null)}get hasInitialVisibility(){return B(this,yk)===null||this.getHash()===B(this,yk)}getOrder(){return B(this,Io).size?B(this,wk)?B(this,wk).slice():[...B(this,Io).keys()]:null}getGroup(e){return B(this,Io).get(e)||null}getHash(){if(B(this,bA)!==null)return B(this,bA);const e=new vSe;for(const[i,r]of B(this,Io))e.update(`${i}:${r.visible}`);return ee(this,bA,e.hexdigest())}[Symbol.iterator](){return B(this,Io).entries()}}bA=new WeakMap,Io=new WeakMap,yk=new WeakMap,wk=new WeakMap,l_=new WeakSet,k$=function(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let r=1;r<e;r++){const o=t[r];let n;if(Array.isArray(o))n=oe(this,l_,k$).call(this,o);else if(B(this,Io).has(o))n=B(this,Io).get(o).visible;else return $i(`Optional content group not found: ${o}`),!0;switch(i){case"And":if(!n)return!1;break;case"Or":if(n)return!0;break;case"Not":return!n;default:return!0}}return i==="And"};class hNi{constructor(e,{disableRange:i=!1,disableStream:r=!1}){ts(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:o,initialData:n,progressiveDone:s,contentDispositionFilename:a}=e;if(this._queuedChunks=[],this._progressiveDone=s,this._contentDispositionFilename=a,n?.length>0){const l=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!r,this._isRangeSupported=!i,this._contentLength=o,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((l,c)=>{this._onReceiveData({begin:l,chunk:c})}),e.addProgressListener((l,c)=>{this._onProgress({loaded:l,total:c})}),e.addProgressiveReadListener(l=>{this._onReceiveData({chunk:l})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:i}){const r=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;if(e===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(r):this._queuedChunks.push(r);else{const o=this._rangeReaders.some(function(n){return n._begin!==e?!1:(n._enqueue(r),!0)});ts(o,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}_onProgress(e){var i,r,o,n;e.total===void 0?(r=(i=this._rangeReaders[0])==null?void 0:i.onProgress)==null||r.call(i,{loaded:e.loaded}):(n=(o=this._fullRequestReader)==null?void 0:o.onProgress)==null||n.call(o,{loaded:e.loaded,total:e.total})}_onProgressiveDone(){var e;(e=this._fullRequestReader)==null||e.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const i=this._rangeReaders.indexOf(e);i>=0&&this._rangeReaders.splice(i,1)}getFullReader(){ts(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new pNi(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,i){if(i<=this._progressiveDataLength)return null;const r=new fNi(this,e,i);return this._pdfDataRangeTransport.requestDataRange(e,i),this._rangeReaders.push(r),r}cancelAllRequests(e){var i;(i=this._fullRequestReader)==null||i.cancel(e);for(const r of this._rangeReaders.slice(0))r.cancel(e);this._pdfDataRangeTransport.abort()}}class pNi{constructor(e,i,r=!1,o=null){this._stream=e,this._done=r||!1,this._filename=HY(o)?o:null,this._queuedChunks=i||[],this._loaded=0;for(const n of this._queuedChunks)this._loaded+=n.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class fNi{constructor(e,i,r){this._stream=e,this._begin=i,this._end=r,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length===0)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const i=this._queuedChunk;return this._queuedChunk=null,{value:i,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function gNi(t){let e=!0,i=r("filename\\*","i").exec(t);if(i){i=i[1];let d=a(i);return d=unescape(d),d=l(d),d=c(d),n(d)}if(i=s(t),i){const d=c(i);return n(d)}if(i=r("filename","i").exec(t),i){i=i[1];let d=a(i);return d=c(d),n(d)}function r(d,u){return new RegExp("(?:^|;)\\s*"+d+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',u)}function o(d,u){if(d){if(!/^[\x00-\xFF]+$/.test(u))return u;try{const h=new TextDecoder(d,{fatal:!0}),p=Fx(u);u=h.decode(p),e=!1}catch{}}return u}function n(d){return e&&/[\x80-\xff]/.test(d)&&(d=o("utf-8",d),e&&(d=o("iso-8859-1",d))),d}function s(d){const u=[];let h;const p=r("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(h=p.exec(d))!==null;){let[,f,A,m]=h;if(f=parseInt(f,10),f in u){if(f===0)break;continue}u[f]=[A,m]}const g=[];for(let f=0;f<u.length&&f in u;++f){let[A,m]=u[f];m=a(m),A&&(m=unescape(m),f===0&&(m=l(m))),g.push(m)}return g.join("")}function a(d){if(d.startsWith('"')){const u=d.slice(1).split('\\"');for(let h=0;h<u.length;++h){const p=u[h].indexOf('"');p!==-1&&(u[h]=u[h].slice(0,p),u.length=h+1),u[h]=u[h].replaceAll(/\\(.)/g,"$1")}d=u.join('"')}return d}function l(d){const u=d.indexOf("'");if(u===-1)return d;const h=d.slice(0,u),p=d.slice(u+1).replace(/^[^']*'/,"");return o(h,p)}function c(d){return!d.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(d)?d:d.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(u,h,p,g){if(p==="q"||p==="Q")return g=g.replaceAll("_"," "),g=g.replaceAll(/=([0-9a-fA-F]{2})/g,function(f,A){return String.fromCharCode(parseInt(A,16))}),o(h,g);try{g=atob(g)}catch{}return o(h,g)})}return""}function GSe(t,e){const i=new Headers;if(!t||!e||typeof e!="object")return i;for(const r in e){const o=e[r];o!==void 0&&i.append(r,o)}return i}function c_(t){var e;return((e=URL.parse(t))==null?void 0:e.origin)??null}function QSe({responseHeaders:t,isHttp:e,rangeChunkSize:i,disableRange:r}){const o={allowRangeRequests:!1,suggestedLength:void 0},n=parseInt(t.get("Content-Length"),10);return!Number.isInteger(n)||(o.suggestedLength=n,n<=2*i)||r||!e||t.get("Accept-Ranges")!=="bytes"||(t.get("Content-Encoding")||"identity")!=="identity"||(o.allowRangeRequests=!0),o}function KSe(t){const e=t.get("Content-Disposition");if(e){let i=gNi(e);if(i.includes("%"))try{i=decodeURIComponent(i)}catch{}if(HY(i))return i}return null}function Ck(t,e){return new mL(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t,t===404||t===0&&e.startsWith("file:"))}function WSe(t){return t===200||t===206}function ZSe(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function JSe(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:($i(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class XSe{constructor(e){It(this,"_responseOrigin",null),this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=GSe(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}getFullReader(){return ts(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new mNi(this),this._fullRequestReader}getRangeReader(e,i){if(i<=this._progressiveDataLength)return null;const r=new ANi(this,e,i);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){var i;(i=this._fullRequestReader)==null||i.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class mNi{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const i=e.source;this._withCredentials=i.withCredentials||!1,this._contentLength=i.length,this._headersCapability=Promise.withResolvers(),this._disableRange=i.disableRange||!1,this._rangeChunkSize=i.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!i.disableStream,this._isRangeSupported=!i.disableRange;const r=new Headers(e.headers),o=i.url;fetch(o,ZSe(r,this._withCredentials,this._abortController)).then(n=>{if(e._responseOrigin=c_(n.url),!WSe(n.status))throw Ck(n.status,o);this._reader=n.body.getReader(),this._headersCapability.resolve();const s=n.headers,{allowRangeRequests:a,suggestedLength:l}=QSe({responseHeaders:s,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=l||this._contentLength,this._filename=KSe(s),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new v2("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;await this._headersCapability.promise;const{value:i,done:r}=await this._reader.read();return r?{value:i,done:r}:(this._loaded+=i.byteLength,(e=this.onProgress)==null||e.call(this,{loaded:this._loaded,total:this._contentLength}),{value:JSe(i),done:!1})}cancel(e){var i;(i=this._reader)==null||i.cancel(e),this._abortController.abort()}}class ANi{constructor(e,i,r){this._stream=e,this._reader=null,this._loaded=0;const o=e.source;this._withCredentials=o.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!o.disableStream,this._abortController=new AbortController;const n=new Headers(e.headers);n.append("Range",`bytes=${i}-${r-1}`);const s=o.url;fetch(s,ZSe(n,this._withCredentials,this._abortController)).then(a=>{const l=c_(a.url);if(l!==e._responseOrigin)throw new Error(`Expected range response-origin "${l}" to match "${e._responseOrigin}".`);if(!WSe(a.status))throw Ck(a.status,s);this._readCapability.resolve(),this._reader=a.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;await this._readCapability.promise;const{value:i,done:r}=await this._reader.read();return r?{value:i,done:r}:(this._loaded+=i.byteLength,(e=this.onProgress)==null||e.call(this,{loaded:this._loaded}),{value:JSe(i),done:!1})}cancel(e){var i;(i=this._reader)==null||i.cancel(e),this._abortController.abort()}}const M$=200,P$=206;function vNi(t){const e=t.response;return typeof e!="string"?e:Fx(e).buffer}class bNi{constructor({url:e,httpHeaders:i,withCredentials:r}){It(this,"_responseOrigin",null),this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=GSe(this.isHttp,i),this.withCredentials=r||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(e){const i=new XMLHttpRequest,r=this.currXhrId++,o=this.pendingRequests[r]={xhr:i};i.open("GET",this.url),i.withCredentials=this.withCredentials;for(const[n,s]of this.headers)i.setRequestHeader(n,s);return this.isHttp&&"begin"in e&&"end"in e?(i.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),o.expectedStatus=P$):o.expectedStatus=M$,i.responseType="arraybuffer",ts(e.onError,"Expected `onError` callback to be provided."),i.onerror=()=>{e.onError(i.status)},i.onreadystatechange=this.onStateChange.bind(this,r),i.onprogress=this.onProgress.bind(this,r),o.onHeadersReceived=e.onHeadersReceived,o.onDone=e.onDone,o.onError=e.onError,o.onProgress=e.onProgress,i.send(null),r}onProgress(e,i){var r;const o=this.pendingRequests[e];o&&((r=o.onProgress)==null||r.call(o,i))}onStateChange(e,i){const r=this.pendingRequests[e];if(!r)return;const o=r.xhr;if(o.readyState>=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),o.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],o.status===0&&this.isHttp){r.onError(o.status);return}const n=o.status||M$;if(!(n===M$&&r.expectedStatus===P$)&&n!==r.expectedStatus){r.onError(o.status);return}const s=vNi(o);if(n===P$){const a=o.getResponseHeader("Content-Range"),l=/bytes (\d+)-(\d+)\/(\d+)/.exec(a);l?r.onDone({begin:parseInt(l[1],10),chunk:s}):($i('Missing or invalid "Content-Range" header.'),r.onError(0))}else s?r.onDone({begin:0,chunk:s}):r.onError(o.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const i=this.pendingRequests[e].xhr;delete this.pendingRequests[e],i.abort()}}class yNi{constructor(e){this._source=e,this._manager=new bNi(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const i=this._rangeRequestReaders.indexOf(e);i>=0&&this._rangeRequestReaders.splice(i,1)}getFullReader(){return ts(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new wNi(this._manager,this._source),this._fullRequestReader}getRangeReader(e,i){const r=new CNi(this._manager,e,i);return r.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(r),r}cancelAllRequests(e){var i;(i=this._fullRequestReader)==null||i.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class wNi{constructor(e,i){this._manager=e,this._url=i.url,this._fullRequestId=e.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=i.disableRange||!1,this._contentLength=i.length,this._rangeChunkSize=i.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const e=this._fullRequestId,i=this._manager.getRequestXhr(e);this._manager._responseOrigin=c_(i.responseURL);const r=i.getAllResponseHeaders(),o=new Headers(r?r.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(a=>{const[l,...c]=a.split(": ");return[l,c.join(": ")]}):[]),{allowRangeRequests:n,suggestedLength:s}=QSe({responseHeaders:o,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=KSe(o),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=Ck(e,this._url),this._headersCapability.reject(this._storedError);for(const i of this._requests)i.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){var i;(i=this.onProgress)==null||i.call(this,{loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersCapability.reject(e);for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class CNi{constructor(e,i,r){this._manager=e,this._url=e.url,this._requestId=e.request({begin:i,end:r,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){var e;const i=c_((e=this._manager.getRequestXhr(this._requestId))==null?void 0:e.responseURL);i!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${i}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){var e;(e=this.onClosed)==null||e.call(this,this)}_onDone(e){const i=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:i,done:!1}):this._queuedChunk=i,this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError??(this._storedError=Ck(e,this._url));for(const i of this._requests)i.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){var i;this.isStreamingSupported||(i=this.onProgress)==null||i.call(this,{loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const i=this._queuedChunk;return this._queuedChunk=null,{value:i,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const xNi=/^[a-z][a-z0-9\-+.]+:/i;function kNi(t){if(xNi.test(t))return new URL(t);const e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(t))}class MNi{constructor(e){this.source=e,this.url=kNi(e.url),ts(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}getFullReader(){return ts(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new PNi(this),this._fullRequestReader}getRangeReader(e,i){if(i<=this._progressiveDataLength)return null;const r=new ENi(this,e,i);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){var i;(i=this._fullRequestReader)==null||i.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class PNi{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const i=e.source;this._contentLength=i.length,this._loaded=0,this._filename=null,this._disableRange=i.disableRange||!1,this._rangeChunkSize=i.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!i.disableStream,this._isRangeSupported=!i.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const r=process.getBuiltinModule("fs");r.promises.lstat(this._url).then(o=>{this._contentLength=o.size,this._setReadableStream(r.createReadStream(this._url)),this._headersCapability.resolve()},o=>{o.code==="ENOENT"&&(o=Ck(0,this._url.href)),this._storedError=o,this._headersCapability.reject(o)})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const i=this._readableStream.read();return i===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=i.length,(e=this.onProgress)==null||e.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(i).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",i=>{this._error(i)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new v2("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class ENi{constructor(e,i,r){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const o=e.source;this._isStreamingSupported=!o.disableStream;const n=process.getBuiltinModule("fs");this._setReadableStream(n.createReadStream(this._url,{start:i,end:r-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const i=this._readableStream.read();return i===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=i.length,(e=this.onProgress)==null||e.call(this,{loaded:this._loaded}),{value:new Uint8Array(i).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",i=>{this._error(i)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const SNi=1e5,YSe=30;var $Se,yA,sd,d_,u_,wA,L2,h_,p_,N7,xk,kk,CA,Mk,f_,Pk,j7,g_,m_,Ek,H7,A_,xA,Sk,V7,eBe,tBe,E$,s0,v_,S$,iBe,rBe;const vc=class DP{constructor({textContentSource:e,container:i,viewport:r}){ne(this,V7),ne(this,yA,Promise.withResolvers()),ne(this,sd,null),ne(this,d_,!1),ne(this,u_,!!(($Se=globalThis.FontInspector)!=null&&$Se.enabled)),ne(this,wA,null),ne(this,L2,null),ne(this,h_,0),ne(this,p_,0),ne(this,N7,null),ne(this,xk,null),ne(this,kk,0),ne(this,CA,0),ne(this,Mk,Object.create(null)),ne(this,f_,[]),ne(this,Pk,null),ne(this,j7,[]),ne(this,g_,new WeakMap),ne(this,m_,null);var o;if(e instanceof ReadableStream)ee(this,Pk,e);else if(typeof e=="object")ee(this,Pk,new ReadableStream({start(c){c.enqueue(e),c.close()}}));else throw new Error('No "textContentSource" parameter specified.');ee(this,sd,ee(this,xk,i)),ee(this,CA,r.scale*F0.pixelRatio),ee(this,kk,r.rotation),ee(this,L2,{div:null,properties:null,ctx:null});const{pageWidth:n,pageHeight:s,pageX:a,pageY:l}=r.rawDims;ee(this,m_,[1,0,0,-1,-a,l+s]),ee(this,p_,n),ee(this,h_,s),oe(o=DP,s0,iBe).call(o),iA(i,r),B(this,yA).promise.finally(()=>{B(DP,Sk).delete(this),ee(this,L2,null),ee(this,Mk,null)}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:e,isFirefox:i}=aa.platform;return br(this,"fontFamilyMap",new Map([["sans-serif",`${e&&i?"Calibri, ":""}sans-serif`],["monospace",`${e&&i?"Lucida Console, ":""}monospace`]]))}render(){const e=()=>{B(this,N7).read().then(({value:i,done:r})=>{if(r){B(this,yA).resolve();return}B(this,wA)??ee(this,wA,i.lang),Object.assign(B(this,Mk),i.styles),oe(this,V7,eBe).call(this,i.items),e()},B(this,yA).reject)};return ee(this,N7,B(this,Pk).getReader()),B(DP,Sk).add(this),e(),B(this,yA).promise}update({viewport:e,onBefore:i=null}){var r;const o=e.scale*F0.pixelRatio,n=e.rotation;if(n!==B(this,kk)&&(i?.(),ee(this,kk,n),iA(B(this,xk),{rotation:n})),o!==B(this,CA)){i?.(),ee(this,CA,o);const s={div:null,properties:null,ctx:oe(r=DP,s0,v_).call(r,B(this,wA))};for(const a of B(this,j7))s.properties=B(this,g_).get(a),s.div=a,oe(this,V7,E$).call(this,s)}}cancel(){var e;const i=new v2("TextLayer task cancelled.");(e=B(this,N7))==null||e.cancel(i).catch(()=>{}),ee(this,N7,null),B(this,yA).reject(i)}get textDivs(){return B(this,j7)}get textContentItemsStr(){return B(this,f_)}static cleanup(){if(!(B(this,Sk).size>0)){B(this,Ek).clear();for(const{canvas:e}of B(this,H7).values())e.remove();B(this,H7).clear()}}};yA=new WeakMap,sd=new WeakMap,d_=new WeakMap,u_=new WeakMap,wA=new WeakMap,L2=new WeakMap,h_=new WeakMap,p_=new WeakMap,N7=new WeakMap,xk=new WeakMap,kk=new WeakMap,CA=new WeakMap,Mk=new WeakMap,f_=new WeakMap,Pk=new WeakMap,j7=new WeakMap,g_=new WeakMap,m_=new WeakMap,Ek=new WeakMap,H7=new WeakMap,A_=new WeakMap,xA=new WeakMap,Sk=new WeakMap,V7=new WeakSet,eBe=function(t){var e,i;if(B(this,d_))return;(i=B(this,L2)).ctx??(i.ctx=oe(e=vc,s0,v_).call(e,B(this,wA)));const r=B(this,j7),o=B(this,f_);for(const n of t){if(r.length>SNi){$i("Ignoring additional textDivs for performance reasons."),ee(this,d_,!0);return}if(n.str===void 0){if(n.type==="beginMarkedContentProps"||n.type==="beginMarkedContent"){const s=B(this,sd);ee(this,sd,document.createElement("span")),B(this,sd).classList.add("markedContent"),n.id!==null&&B(this,sd).setAttribute("id",`${n.id}`),s.append(B(this,sd))}else n.type==="endMarkedContent"&&ee(this,sd,B(this,sd).parentNode);continue}o.push(n.str),oe(this,V7,tBe).call(this,n)}},tBe=function(t){var e;const i=document.createElement("span"),r={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};B(this,j7).push(i);const o=vi.transform(B(this,m_),t.transform);let n=Math.atan2(o[1],o[0]);const s=B(this,Mk)[t.fontName];s.vertical&&(n+=Math.PI/2);let a=B(this,u_)&&s.fontSubstitution||s.fontFamily;a=vc.fontFamilyMap.get(a)||a;const l=Math.hypot(o[2],o[3]),c=l*oe(e=vc,s0,rBe).call(e,a,s,B(this,wA));let d,u;n===0?(d=o[4],u=o[5]-c):(d=o[4]+c*Math.sin(n),u=o[5]-c*Math.cos(n));const h="calc(var(--total-scale-factor) *",p=i.style;B(this,sd)===B(this,xk)?(p.left=`${(100*d/B(this,p_)).toFixed(2)}%`,p.top=`${(100*u/B(this,h_)).toFixed(2)}%`):(p.left=`${h}${d.toFixed(2)}px)`,p.top=`${h}${u.toFixed(2)}px)`),p.fontSize=`${h}${(B(vc,xA)*l).toFixed(2)}px)`,p.fontFamily=a,r.fontSize=l,i.setAttribute("role","presentation"),i.textContent=t.str,i.dir=t.dir,B(this,u_)&&(i.dataset.fontName=s.fontSubstitutionLoadedName||t.fontName),n!==0&&(r.angle=n*(180/Math.PI));let g=!1;if(t.str.length>1)g=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){const f=Math.abs(t.transform[0]),A=Math.abs(t.transform[3]);f!==A&&Math.max(f,A)/Math.min(f,A)>1.5&&(g=!0)}if(g&&(r.canvasWidth=s.vertical?t.height:t.width),B(this,g_).set(i,r),B(this,L2).div=i,B(this,L2).properties=r,oe(this,V7,E$).call(this,B(this,L2)),r.hasText&&B(this,sd).append(i),r.hasEOL){const f=document.createElement("br");f.setAttribute("role","presentation"),B(this,sd).append(f)}},E$=function(t){var e;const{div:i,properties:r,ctx:o}=t,{style:n}=i;let s="";if(B(vc,xA)>1&&(s=`scale(${1/B(vc,xA)})`),r.canvasWidth!==0&&r.hasText){const{fontFamily:a}=n,{canvasWidth:l,fontSize:c}=r;oe(e=vc,s0,S$).call(e,o,c*B(this,CA),a);const{width:d}=o.measureText(i.textContent);d>0&&(s=`scaleX(${l*B(this,CA)/d}) ${s}`)}r.angle!==0&&(s=`rotate(${r.angle}deg) ${s}`),s.length>0&&(n.transform=s)},s0=new WeakSet,v_=function(t=null){let e=B(this,H7).get(t||(t=""));if(!e){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=t,document.body.append(i),e=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),B(this,H7).set(t,e),B(this,A_).set(e,{size:0,family:""})}return e},S$=function(t,e,i){const r=B(this,A_).get(t);e===r.size&&i===r.family||(t.font=`${e}px ${i}`,r.size=e,r.family=i)},iBe=function(){if(B(this,xA)!==null)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),ee(this,xA,t.getBoundingClientRect().height),t.remove()},rBe=function(t,e,i){const r=B(this,Ek).get(t);if(r)return r;const o=oe(this,s0,v_).call(this,i);o.canvas.width=o.canvas.height=YSe,oe(this,s0,S$).call(this,o,YSe,t);const n=o.measureText(""),s=n.fontBoundingBoxAscent,a=Math.abs(n.fontBoundingBoxDescent);o.canvas.width=o.canvas.height=0;let l=.8;return s?l=s/(s+a):(aa.platform.isFirefox&&$i("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),e.ascent?l=e.ascent:e.descent&&(l=1+e.descent)),B(this,Ek).set(t,l),l},ne(vc,s0),ne(vc,Ek,new Map),ne(vc,H7,new Map),ne(vc,A_,new WeakMap),ne(vc,xA,null),ne(vc,Sk,new Set);let B$=vc;class GP{static textContent(e){const i=[],r={items:i,styles:Object.create(null)};function o(n){var s;if(!n)return;let a=null;const l=n.name;if(l==="#text")a=n.value;else if(GP.shouldBuildText(l))(s=n?.attributes)!=null&&s.textContent?a=n.attributes.textContent:n.value&&(a=n.value);else return;if(a!==null&&i.push({str:a}),!!n.children)for(const c of n.children)o(c)}return o(e),r}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}}const BNi=65536,INi=100;function oBe(t={}){typeof t=="string"||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e=new _Ni,{docId:i}=e,r=t.url?TNi(t.url):null,o=t.data?RNi(t.data):null,n=t.httpHeaders||null,s=t.withCredentials===!0,a=t.password??null,l=t.range instanceof sBe?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:BNi;let d=t.worker instanceof C_?t.worker:null;const u=t.verbosity,h=typeof t.docBaseUrl=="string"&&!vL(t.docBaseUrl)?t.docBaseUrl:null,p=b_(t.cMapUrl),g=t.cMapPacked!==!1,f=t.CMapReaderFactory||(Sl?QUi:SSe),A=b_(t.iccUrl),m=b_(t.standardFontDataUrl),v=t.StandardFontDataFactory||(Sl?KUi:RSe),y=b_(t.wasmUrl),b=t.WasmFactory||(Sl?WUi:LSe),w=t.stopAtErrors!==!0,C=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,M=t.isEvalSupported!==!1,P=typeof t.isOffscreenCanvasSupported=="boolean"?t.isOffscreenCanvasSupported:!Sl,E=typeof t.isImageDecoderSupported=="boolean"?t.isImageDecoderSupported:!Sl&&(aa.platform.isFirefox||!globalThis.chrome),S=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,I=typeof t.disableFontFace=="boolean"?t.disableFontFace:Sl,R=t.fontExtraProperties===!0,L=t.enableXfa===!0,j=t.ownerDocument||globalThis.document,H=t.disableRange===!0,U=t.disableStream===!0,z=t.disableAutoFetch===!0,Z=t.pdfBug===!0,Y=t.CanvasFactory||(Sl?GUi:VUi),de=t.FilterFactory||(Sl?qUi:zUi),he=t.enableHWA===!0,ve=t.useWasm!==!1,Ee=l?l.length:t.length??NaN,we=typeof t.useSystemFonts=="boolean"?t.useSystemFonts:!Sl&&!I,De=typeof t.useWorkerFetch=="boolean"?t.useWorkerFetch:!!(f===SSe&&v===RSe&&b===LSe&&p&&m&&y&&u7(p,document.baseURI)&&u7(m,document.baseURI)&&u7(y,document.baseURI)),Se=null;vUi(u);const J={canvasFactory:new Y({ownerDocument:j,enableHWA:he}),filterFactory:new de({docId:i,ownerDocument:j}),cMapReaderFactory:De?null:new f({baseUrl:p,isCompressed:g}),standardFontDataFactory:De?null:new v({baseUrl:m}),wasmFactory:De?null:new b({baseUrl:y})};if(!d){const ue={verbosity:u,port:n0.workerPort};d=ue.port?C_.fromPort(ue):new C_(ue),e._worker=d}const se={docId:i,apiVersion:"5.2.133",data:o,password:a,disableAutoFetch:z,rangeChunkSize:c,length:Ee,docBaseUrl:h,enableXfa:L,evaluatorOptions:{maxImageSize:C,disableFontFace:I,ignoreErrors:w,isEvalSupported:M,isOffscreenCanvasSupported:P,isImageDecoderSupported:E,canvasMaxAreaInBytes:S,fontExtraProperties:R,useSystemFonts:we,useWasm:ve,useWorkerFetch:De,cMapUrl:p,iccUrl:A,standardFontDataUrl:m,wasmUrl:y}},ce={ownerDocument:j,pdfBug:Z,styleElement:Se,loadingParams:{disableAutoFetch:z,enableXfa:L}};return d.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const ue=d.messageHandler.sendWithPromise("GetDocRequest",se,o?[o.buffer]:null);let Ie;if(l)Ie=new hNi(l,{disableRange:H,disableStream:U});else if(!o){if(!r)throw new Error("getDocument - no `url` parameter provided.");let Ve;if(Sl)if(u7(r)){if(typeof fetch>"u"||typeof Response>"u"||!("body"in Response.prototype))throw new Error("getDocument - the Fetch API was disabled in Node.js, see `--no-experimental-fetch`.");Ve=XSe}else Ve=MNi;else Ve=u7(r)?XSe:yNi;Ie=new Ve({url:r,length:Ee,httpHeaders:n,withCredentials:s,rangeChunkSize:c,disableRange:H,disableStream:U})}return ue.then(Ve=>{if(e.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const ie=new hk(i,Ve,d.port),q=new NNi(ie,e,Ie,ce,J);e._transport=q,ie.send("Ready",null)})}).catch(e._capability.reject),e}function TNi(t){if(t instanceof URL)return t.href;if(typeof t=="string"){if(Sl)return t;const e=URL.parse(t,window.location);if(e)return e.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function RNi(t){if(Sl&&typeof Buffer<"u"&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if(typeof t=="string")return Fx(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||typeof t=="object"&&!isNaN(t?.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function b_(t){if(typeof t!="string")return null;if(t.endsWith("/"))return t;throw new Error(`Invalid factory url: "${t}" must include trailing slash.`)}const I$=t=>typeof t=="object"&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0,DNi=t=>typeof t=="object"&&typeof t?.name=="string",LNi=EUi.bind(null,I$,DNi);var T$;const nBe=class m_e{constructor(){It(this,"_capability",Promise.withResolvers()),It(this,"_transport",null),It(this,"_worker",null),It(this,"docId",`d${Ql(m_e,T$)._++}`),It(this,"destroyed",!1),It(this,"onPassword",null),It(this,"onProgress",null)}get promise(){return this._capability.promise}async destroy(){var e,i,r,o;this.destroyed=!0;try{(e=this._worker)!=null&&e.port&&(this._worker._pendingDestroy=!0),await((i=this._transport)==null?void 0:i.destroy())}catch(n){throw(r=this._worker)!=null&&r.port&&delete this._worker._pendingDestroy,n}this._transport=null,(o=this._worker)==null||o.destroy(),this._worker=null}async getData(){return this._transport.getData()}};T$=new WeakMap,ne(nBe,T$,0);let _Ni=nBe;class sBe{constructor(e,i,r=!1,o=null){this.length=e,this.initialData=i,this.progressiveDone=r,this.contentDispositionFilename=o,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,i){for(const r of this._rangeListeners)r(e,i)}onDataProgress(e,i){this._readyCapability.promise.then(()=>{for(const r of this._progressListeners)r(e,i)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(const i of this._progressiveReadListeners)i(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,i){Mo("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class FNi{constructor(e,i){this._pdfInfo=e,this._transport=i}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return br(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){const{renderingIntent:i}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(i)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}var _2,z7,Bk;class ONi{constructor(e,i,r,o=!1){ne(this,z7),ne(this,_2,!1),this._pageIndex=e,this._pageInfo=i,this._transport=r,this._stats=o?new _Ee:null,this._pdfBug=o,this.commonObjs=r.commonObjs,this.objs=new aBe,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:i=this.rotate,offsetX:r=0,offsetY:o=0,dontFlip:n=!1}={}){return new qP({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:i,offsetX:r,offsetY:o,dontFlip:n})}getAnnotations({intent:e="display"}={}){const{renderingIntent:i}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,i)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return br(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var e;return((e=this._transport._htmlForXfa)==null?void 0:e.children[this._pageIndex])||null}render({canvasContext:e,viewport:i,intent:r="display",annotationMode:o=A2.ENABLE,transform:n=null,background:s=null,optionalContentConfigPromise:a=null,annotationCanvasMap:l=null,pageColors:c=null,printAnnotationStorage:d=null,isEditing:u=!1}){var h,p;(h=this._stats)==null||h.time("Overall");const g=this._transport.getRenderingIntent(r,o,d,u),{renderingIntent:f,cacheKey:A}=g;ee(this,_2,!1),a||(a=this._transport.getOptionalContentConfig(f));let m=this._intentStates.get(A);m||(m=Object.create(null),this._intentStates.set(A,m)),m.streamReaderCancelTimeout&&(clearTimeout(m.streamReaderCancelTimeout),m.streamReaderCancelTimeout=null);const v=!!(f&rd.PRINT);m.displayReadyCapability||(m.displayReadyCapability=Promise.withResolvers(),m.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(p=this._stats)==null||p.time("Page Request"),this._pumpOperatorList(g));const y=C=>{var M;m.renderTasks.delete(b),v&&ee(this,_2,!0),oe(this,z7,Bk).call(this),C?(b.capability.reject(C),this._abortOperatorList({intentState:m,reason:C instanceof Error?C:new Error(C)})):b.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),(M=globalThis.Stats)!=null&&M.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},b=new HNi({callback:y,params:{canvasContext:e,viewport:i,transform:n,background:s},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:m.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!v,pdfBug:this._pdfBug,pageColors:c});(m.renderTasks||(m.renderTasks=new Set)).add(b);const w=b.task;return Promise.all([m.displayReadyCapability.promise,a]).then(([C,M])=>{var P;if(this.destroyed){y();return}if((P=this._stats)==null||P.time("Rendering"),!(M.renderingIntent&f))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");b.initializeGraphics({transparency:C,optionalContentConfig:M}),b.operatorListChanged()}).catch(y),w}getOperatorList({intent:e="display",annotationMode:i=A2.ENABLE,printAnnotationStorage:r=null,isEditing:o=!1}={}){var n;function s(){l.operatorList.lastChunk&&(l.opListReadCapability.resolve(l.operatorList),l.renderTasks.delete(c))}const a=this._transport.getRenderingIntent(e,i,r,o,!0);let l=this._intentStates.get(a.cacheKey);l||(l=Object.create(null),this._intentStates.set(a.cacheKey,l));let c;return l.opListReadCapability||(c=Object.create(null),c.operatorListChanged=s,l.opListReadCapability=Promise.withResolvers(),(l.renderTasks||(l.renderTasks=new Set)).add(c),l.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(n=this._stats)==null||n.time("Page Request"),this._pumpOperatorList(a)),l.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:i=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:i===!0},{highWaterMark:100,size(r){return r.items.length}})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(r=>GP.textContent(r));const i=this.streamTextContent(e);return new Promise(function(r,o){function n(){s.read().then(function({value:l,done:c}){if(c){r(a);return}a.lang??(a.lang=l.lang),Object.assign(a.styles,l.styles),a.items.push(...l.items),n()},o)}const s=i.getReader(),a={items:[],styles:Object.create(null),lang:null};n()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const i of this._intentStates.values())if(this._abortOperatorList({intentState:i,reason:new Error("Page was destroyed."),force:!0}),!i.opListReadCapability)for(const r of i.renderTasks)e.push(r.completed),r.cancel();return this.objs.clear(),ee(this,_2,!1),Promise.all(e)}cleanup(e=!1){ee(this,_2,!0);const i=oe(this,z7,Bk).call(this);return e&&i&&this._stats&&(this._stats=new _Ee),i}_startRenderPage(e,i){var r,o;const n=this._intentStates.get(i);n&&((r=this._stats)==null||r.timeEnd("Page Request"),(o=n.displayReadyCapability)==null||o.resolve(e))}_renderPageChunk(e,i){for(let r=0,o=e.length;r<o;r++)i.operatorList.fnArray.push(e.fnArray[r]),i.operatorList.argsArray.push(e.argsArray[r]);i.operatorList.lastChunk=e.lastChunk,i.operatorList.separateAnnots=e.separateAnnots;for(const r of i.renderTasks)r.operatorListChanged();e.lastChunk&&oe(this,z7,Bk).call(this)}_pumpOperatorList({renderingIntent:e,cacheKey:i,annotationStorageSerializable:r,modifiedIds:o}){const{map:n,transfer:s}=r,a=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:i,annotationStorage:n,modifiedIds:o},s).getReader(),l=this._intentStates.get(i);l.streamReader=a;const c=()=>{a.read().then(({value:d,done:u})=>{if(u){l.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(d,l),c())},d=>{if(l.streamReader=null,!this._transport.destroyed){if(l.operatorList){l.operatorList.lastChunk=!0;for(const u of l.renderTasks)u.operatorListChanged();oe(this,z7,Bk).call(this)}if(l.displayReadyCapability)l.displayReadyCapability.reject(d);else if(l.opListReadCapability)l.opListReadCapability.reject(d);else throw d}})};c()}_abortOperatorList({intentState:e,reason:i,force:r=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!r){if(e.renderTasks.size>0)return;if(i instanceof jY){let o=INi;i.extraDelay>0&&i.extraDelay<1e3&&(o+=i.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:i,force:!0})},o);return}}if(e.streamReader.cancel(new v2(i.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[o,n]of this._intentStates)if(n===e){this._intentStates.delete(o);break}this.cleanup()}}}get stats(){return this._stats}}_2=new WeakMap,z7=new WeakSet,Bk=function(){if(!B(this,_2)||this.destroyed)return!1;for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),ee(this,_2,!1),!0};var F2,R$;class UNi{constructor(){ne(this,F2,new Map),ne(this,R$,Promise.resolve())}postMessage(e,i){const r={data:structuredClone(e,i?{transfer:i}:null)};B(this,R$).then(()=>{for(const[o]of B(this,F2))o.call(this,r)})}addEventListener(e,i,r=null){let o=null;if(r?.signal instanceof AbortSignal){const{signal:n}=r;if(n.aborted){$i("LoopbackPort - cannot use an `aborted` signal.");return}const s=()=>this.removeEventListener(e,i);o=()=>n.removeEventListener("abort",s),n.addEventListener("abort",s)}B(this,F2).set(i,o)}removeEventListener(e,i){const r=B(this,F2).get(i);r?.(),B(this,F2).delete(i)}terminate(){for(const[,e]of B(this,F2))e?.();B(this,F2).clear()}}F2=new WeakMap,R$=new WeakMap;var D$,q7,kA,Ik,y_,Tk,w_;const O2=class ql{constructor({name:e=null,port:i=null,verbosity:r=bUi()}={}){ne(this,Ik);var o;if(this.name=e,this.destroyed=!1,this.verbosity=r,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,i){if((o=B(ql,kA))!=null&&o.has(i))throw new Error("Cannot use more than one PDFWorker per port.");(B(ql,kA)||ee(ql,kA,new WeakMap)).set(i,this),this._initializeFromPort(i);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new hk("main","worker",e),this._messageHandler.on("ready",function(){}),oe(this,Ik,y_).call(this)}_initialize(){if(B(ql,q7)||B(ql,Tk,w_)){this._setupFakeWorker();return}let{workerSrc:e}=ql;try{ql._isSameOrigin(window.location,e)||(e=ql._createCDNWrapper(new URL(e,window.location).href));const i=new Worker(e,{type:"module"}),r=new hk("main","worker",i),o=()=>{n.abort(),r.destroy(),i.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},n=new AbortController;i.addEventListener("error",()=>{this._webWorker||o()},{signal:n.signal}),r.on("test",a=>{if(n.abort(),this.destroyed||!a){o();return}this._messageHandler=r,this._port=i,this._webWorker=i,oe(this,Ik,y_).call(this)}),r.on("ready",a=>{if(n.abort(),this.destroyed){o();return}try{s()}catch{this._setupFakeWorker()}});const s=()=>{const a=new Uint8Array;r.send("test",a,[a.buffer])};s();return}catch{gL("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){B(ql,q7)||($i("Setting up fake worker."),ee(ql,q7,!0)),ql._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const i=new UNi;this._port=i;const r=`fake${Ql(ql,D$)._++}`,o=new hk(r+"_worker",r,i);e.setup(o,i),this._messageHandler=new hk(r,r+"_worker",i),oe(this,Ik,y_).call(this)}).catch(e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){var e,i,r;this.destroyed=!0,(e=this._webWorker)==null||e.terminate(),this._webWorker=null,(i=B(ql,kA))==null||i.delete(this._port),this._port=null,(r=this._messageHandler)==null||r.destroy(),this._messageHandler=null}static fromPort(e){var i;if(!(e!=null&&e.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const r=(i=B(this,kA))==null?void 0:i.get(e.port);if(r){if(r._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return r}return new ql(e)}static get workerSrc(){if(n0.workerSrc)return n0.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return br(this,"_setupFakeWorkerGlobal",(async()=>B(this,Tk,w_)?B(this,Tk,w_):(await import(this.workerSrc)).WorkerMessageHandler)())}};D$=new WeakMap,q7=new WeakMap,kA=new WeakMap,Ik=new WeakSet,y_=function(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})},Tk=new WeakSet,w_=function(){var t;try{return((t=globalThis.pdfjsWorker)==null?void 0:t.WorkerMessageHandler)||null}catch{return null}},ne(O2,Tk),ne(O2,D$,0),ne(O2,q7,!1),ne(O2,kA),Sl&&(ee(O2,q7,!0),n0.workerSrc||(n0.workerSrc="./pdf.worker.mjs")),O2._isSameOrigin=(t,e)=>{const i=URL.parse(t);if(!(i!=null&&i.origin)||i.origin==="null")return!1;const r=new URL(e,i);return i.origin===r.origin},O2._createCDNWrapper=t=>{const e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))};let C_=O2;var U2,a0,Rk,Dk,N2,G7,Lk;class NNi{constructor(e,i,r,o,n){ne(this,G7),ne(this,U2,new Map),ne(this,a0,new Map),ne(this,Rk,new Map),ne(this,Dk,new Map),ne(this,N2,null),this.messageHandler=e,this.loadingTask=i,this.commonObjs=new aBe,this.fontLoader=new jUi({ownerDocument:o.ownerDocument,styleElement:o.styleElement}),this.loadingParams=o.loadingParams,this._params=o,this.canvasFactory=n.canvasFactory,this.filterFactory=n.filterFactory,this.cMapReaderFactory=n.cMapReaderFactory,this.standardFontDataFactory=n.standardFontDataFactory,this.wasmFactory=n.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}get annotationStorage(){return br(this,"annotationStorage",new p$)}getRenderingIntent(e,i=A2.ENABLE,r=null,o=!1,n=!1){let s=rd.DISPLAY,a=u$;switch(e){case"any":s=rd.ANY;break;case"display":break;case"print":s=rd.PRINT;break;default:$i(`getRenderingIntent - invalid intent: ${e}`)}const l=s&rd.PRINT&&r instanceof ySe?r:this.annotationStorage;switch(i){case A2.DISABLE:s+=rd.ANNOTATIONS_DISABLE;break;case A2.ENABLE:break;case A2.ENABLE_FORMS:s+=rd.ANNOTATIONS_FORMS;break;case A2.ENABLE_STORAGE:s+=rd.ANNOTATIONS_STORAGE,a=l.serializable;break;default:$i(`getRenderingIntent - invalid annotationMode: ${i}`)}o&&(s+=rd.IS_EDITING),n&&(s+=rd.OPLIST);const{ids:c,hash:d}=l.modifiedIds,u=[s,a.hash,d];return{renderingIntent:s,cacheKey:u.join("_"),annotationStorageSerializable:a,modifiedIds:c}}destroy(){var e;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),(e=B(this,N2))==null||e.reject(new Error("Worker was destroyed during onPassword callback"));const i=[];for(const o of B(this,a0).values())i.push(o._destroy());B(this,a0).clear(),B(this,Rk).clear(),B(this,Dk).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const r=this.messageHandler.sendWithPromise("Terminate",null);return i.push(r),Promise.all(i).then(()=>{var o,n;this.commonObjs.clear(),this.fontLoader.clear(),B(this,U2).clear(),this.filterFactory.destroy(),B$.cleanup(),(o=this._networkStream)==null||o.cancelAllRequests(new v2("Worker was terminated.")),(n=this.messageHandler)==null||n.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:i}=this;e.on("GetReader",(r,o)=>{ts(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=n=>{this._lastProgress={loaded:n.loaded,total:n.total}},o.onPull=()=>{this._fullReader.read().then(function({value:n,done:s}){if(s){o.close();return}ts(n instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),o.enqueue(new Uint8Array(n),1,[n])}).catch(n=>{o.error(n)})},o.onCancel=n=>{this._fullReader.cancel(n),o.ready.catch(s=>{if(!this.destroyed)throw s})}}),e.on("ReaderHeadersReady",async r=>{var o;await this._fullReader.headersReady;const{isStreamingSupported:n,isRangeSupported:s,contentLength:a}=this._fullReader;return(!n||!s)&&(this._lastProgress&&((o=i.onProgress)==null||o.call(i,this._lastProgress)),this._fullReader.onProgress=l=>{var c;(c=i.onProgress)==null||c.call(i,{loaded:l.loaded,total:l.total})}),{isStreamingSupported:n,isRangeSupported:s,contentLength:a}}),e.on("GetRangeReader",(r,o)=>{ts(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const n=this._networkStream.getRangeReader(r.begin,r.end);if(!n){o.close();return}o.onPull=()=>{n.read().then(function({value:s,done:a}){if(a){o.close();return}ts(s instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),o.enqueue(new Uint8Array(s),1,[s])}).catch(s=>{o.error(s)})},o.onCancel=s=>{n.cancel(s),o.ready.catch(a=>{if(!this.destroyed)throw a})}}),e.on("GetDoc",({pdfInfo:r})=>{this._numPages=r.numPages,this._htmlForXfa=r.htmlForXfa,delete r.htmlForXfa,i._capability.resolve(new FNi(r,this))}),e.on("DocException",r=>{i._capability.reject(mc(r))}),e.on("PasswordRequest",r=>{ee(this,N2,Promise.withResolvers());try{if(!i.onPassword)throw mc(r);const o=n=>{n instanceof Error?B(this,N2).reject(n):B(this,N2).resolve({password:n})};i.onPassword(o,r.code)}catch(o){B(this,N2).reject(o)}return B(this,N2).promise}),e.on("DataLoaded",r=>{var o;(o=i.onProgress)==null||o.call(i,{loaded:r.length,total:r.length}),this.downloadInfoCapability.resolve(r)}),e.on("StartRenderPage",r=>{this.destroyed||B(this,a0).get(r.pageIndex)._startRenderPage(r.transparency,r.cacheKey)}),e.on("commonobj",([r,o,n])=>{var s;if(this.destroyed||this.commonObjs.has(r))return null;switch(o){case"Font":if("error"in n){const d=n.error;$i(`Error during font loading: ${d}`),this.commonObjs.resolve(r,d);break}const a=this._params.pdfBug&&(s=globalThis.FontInspector)!=null&&s.enabled?(d,u)=>globalThis.FontInspector.fontAdded(d,u):null,l=new HUi(n,a);this.fontLoader.bind(l).catch(()=>e.sendWithPromise("FontFallback",{id:r})).finally(()=>{!l.fontExtraProperties&&l.data&&(l.data=null),this.commonObjs.resolve(r,l)});break;case"CopyLocalImage":const{imageRef:c}=n;ts(c,"The imageRef must be defined.");for(const d of B(this,a0).values())for(const[,u]of d.objs)if(u?.ref===c)return u.dataLen?(this.commonObjs.resolve(r,structuredClone(u)),u.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(r,n);break;default:throw new Error(`Got unknown common object type ${o}`)}return null}),e.on("obj",([r,o,n,s])=>{var a;if(this.destroyed)return;const l=B(this,a0).get(o);if(!l.objs.has(r)){if(l._intentStates.size===0){(a=s?.bitmap)==null||a.close();return}switch(n){case"Image":case"Pattern":l.objs.resolve(r,s);break;default:throw new Error(`Got unknown object type ${n}`)}}}),e.on("DocProgress",r=>{var o;this.destroyed||(o=i.onProgress)==null||o.call(i,{loaded:r.loaded,total:r.total})}),e.on("FetchBinaryData",async r=>{if(this.destroyed)throw new Error("Worker was destroyed.");const o=this[r.type];if(!o)throw new Error(`${r.type} not initialized, see the \`useWorkerFetch\` parameter.`);return o.fetch(r)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var e;this.annotationStorage.size<=0&&$i("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:i,transfer:r}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:i,filename:((e=this._fullReader)==null?void 0:e.filename)??null},r).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const i=e-1,r=B(this,Rk).get(i);if(r)return r;const o=this.messageHandler.sendWithPromise("GetPage",{pageIndex:i}).then(n=>{if(this.destroyed)throw new Error("Transport destroyed");n.refStr&&B(this,Dk).set(n.refStr,e);const s=new ONi(i,n,this,this._params.pdfBug);return B(this,a0).set(i,s),s});return B(this,Rk).set(i,o),o}getPageIndex(e){return I$(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,i){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:i})}getFieldObjects(){return oe(this,G7,Lk).call(this,"GetFieldObjects")}hasJSActions(){return oe(this,G7,Lk).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return oe(this,G7,Lk).call(this,"GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return oe(this,G7,Lk).call(this,"GetOptionalContentConfig").then(i=>new uNi(i,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",i=B(this,U2).get(e);if(i)return i;const r=this.messageHandler.sendWithPromise(e,null).then(o=>{var n,s;return{info:o[0],metadata:o[1]?new cNi(o[1]):null,contentDispositionFilename:((n=this._fullReader)==null?void 0:n.filename)??null,contentLength:((s=this._fullReader)==null?void 0:s.contentLength)??null}});return B(this,U2).set(e,r),r}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const i of B(this,a0).values())if(!i.cleanup())throw new Error(`startCleanup: Page ${i.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),B(this,U2).clear(),this.filterFactory.destroy(!0),B$.cleanup()}}cachedPageNumber(e){if(!I$(e))return null;const i=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return B(this,Dk).get(i)??null}}U2=new WeakMap,a0=new WeakMap,Rk=new WeakMap,Dk=new WeakMap,N2=new WeakMap,G7=new WeakSet,Lk=function(t,e=null){const i=B(this,U2).get(t);if(i)return i;const r=this.messageHandler.sendWithPromise(t,e);return B(this,U2).set(t,r),r};const _k=Symbol("INITIAL_DATA");var Kd,x_,L$;class aBe{constructor(){ne(this,x_),ne(this,Kd,Object.create(null))}get(e,i=null){if(i){const o=oe(this,x_,L$).call(this,e);return o.promise.then(()=>i(o.data)),null}const r=B(this,Kd)[e];if(!r||r.data===_k)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return r.data}has(e){const i=B(this,Kd)[e];return!!i&&i.data!==_k}delete(e){const i=B(this,Kd)[e];return!i||i.data===_k?!1:(delete B(this,Kd)[e],!0)}resolve(e,i=null){const r=oe(this,x_,L$).call(this,e);r.data=i,r.resolve()}clear(){var e;for(const i in B(this,Kd)){const{data:r}=B(this,Kd)[i];(e=r?.bitmap)==null||e.close()}ee(this,Kd,Object.create(null))}*[Symbol.iterator](){for(const e in B(this,Kd)){const{data:i}=B(this,Kd)[e];i!==_k&&(yield[e,i])}}}Kd=new WeakMap,x_=new WeakSet,L$=function(t){var e;return(e=B(this,Kd))[t]||(e[t]={...Promise.withResolvers(),data:_k})};var MA;class jNi{constructor(e){ne(this,MA,null),It(this,"onContinue",null),It(this,"onError",null),ee(this,MA,e)}get promise(){return B(this,MA).capability.promise}cancel(e=0){B(this,MA).cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=B(this,MA).operatorList;if(!e)return!1;const{annotationCanvasMap:i}=B(this,MA);return e.form||e.canvas&&i?.size>0}}MA=new WeakMap;var PA,Q7;const lBe=class LP{constructor({callback:e,params:i,objs:r,commonObjs:o,annotationCanvasMap:n,operatorList:s,pageIndex:a,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:d=!1,pdfBug:u=!1,pageColors:h=null}){ne(this,PA,null),this.callback=e,this.params=i,this.objs=r,this.commonObjs=o,this.annotationCanvasMap=n,this.operatorListIdx=null,this.operatorList=s,this._pageIndex=a,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=u,this.pageColors=h,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=d===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new jNi(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=i.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:i}){var r,o;if(this.cancelled)return;if(this._canvas){if(B(LP,Q7).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");B(LP,Q7).add(this._canvas)}this._pdfBug&&(r=globalThis.StepperManager)!=null&&r.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:n,viewport:s,transform:a,background:l}=this.params;this.gfx=new t_(n,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:i},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:a,viewport:s,transparency:e,background:l}),this.operatorListIdx=0,this.graphicsReady=!0,(o=this.graphicsReadyCallback)==null||o.call(this)}cancel(e=null,i=0){var r,o,n;this.running=!1,this.cancelled=!0,(r=this.gfx)==null||r.endDrawing(),B(this,PA)&&(window.cancelAnimationFrame(B(this,PA)),ee(this,PA,null)),B(LP,Q7).delete(this._canvas),e||(e=new jY(`Rendering cancelled, page ${this._pageIndex+1}`,i)),this.callback(e),(n=(o=this.task).onError)==null||n.call(o,e)}operatorListChanged(){var e;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(e=this.stepper)==null||e.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?ee(this,PA,window.requestAnimationFrame(()=>{ee(this,PA,null),this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),B(LP,Q7).delete(this._canvas),this.callback())))}};PA=new WeakMap,Q7=new WeakMap,ne(lBe,Q7,new WeakSet);let HNi=lBe;const VNi="5.2.133",zNi="4f7761353";function cBe(t){return Math.floor(Math.max(0,Math.min(1,t))*255).toString(16).padStart(2,"0")}function Fk(t){return Math.max(0,Math.min(255,255*t))}class dBe{static CMYK_G([e,i,r,o]){return["G",1-Math.min(1,.3*e+.59*r+.11*i+o)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return e=Fk(e),[e,e,e]}static G_HTML([e]){const i=cBe(e);return`#${i}${i}${i}`}static RGB_G([e,i,r]){return["G",.3*e+.59*i+.11*r]}static RGB_rgb(e){return e.map(Fk)}static RGB_HTML(e){return`#${e.map(cBe).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,i,r,o]){return["RGB",1-Math.min(1,e+o),1-Math.min(1,r+o),1-Math.min(1,i+o)]}static CMYK_rgb([e,i,r,o]){return[Fk(1-Math.min(1,e+o)),Fk(1-Math.min(1,r+o)),Fk(1-Math.min(1,i+o))]}static CMYK_HTML(e){const i=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(i)}static RGB_CMYK([e,i,r]){const o=1-e,n=1-i,s=1-r,a=Math.min(o,n,s);return["CMYK",o,n,s,a]}}class qNi{create(e,i,r=!1){if(e<=0||i<=0)throw new Error("Invalid SVG dimensions");const o=this._createSVG("svg:svg");return o.setAttribute("version","1.1"),r||(o.setAttribute("width",`${e}px`),o.setAttribute("height",`${i}px`)),o.setAttribute("preserveAspectRatio","none"),o.setAttribute("viewBox",`0 0 ${e} ${i}`),o}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){Mo("Abstract method `_createSVG` called.")}}class k_ extends qNi{_createSVG(e){return document.createElementNS(Wp,e)}}class uBe{static setupStorage(e,i,r,o,n){const s=o.getValue(i,{value:null});switch(r.name){case"textarea":if(s.value!==null&&(e.textContent=s.value),n==="print")break;e.addEventListener("input",a=>{o.setValue(i,{value:a.target.value})});break;case"input":if(r.attributes.type==="radio"||r.attributes.type==="checkbox"){if(s.value===r.attributes.xfaOn?e.setAttribute("checked",!0):s.value===r.attributes.xfaOff&&e.removeAttribute("checked"),n==="print")break;e.addEventListener("change",a=>{o.setValue(i,{value:a.target.checked?a.target.getAttribute("xfaOn"):a.target.getAttribute("xfaOff")})})}else{if(s.value!==null&&e.setAttribute("value",s.value),n==="print")break;e.addEventListener("input",a=>{o.setValue(i,{value:a.target.value})})}break;case"select":if(s.value!==null){e.setAttribute("value",s.value);for(const a of r.children)a.attributes.value===s.value?a.attributes.selected=!0:a.attributes.hasOwnProperty("selected")&&delete a.attributes.selected}e.addEventListener("input",a=>{const l=a.target.options,c=l.selectedIndex===-1?"":l[l.selectedIndex].value;o.setValue(i,{value:c})});break}}static setAttributes({html:e,element:i,storage:r=null,intent:o,linkService:n}){const{attributes:s}=i,a=e instanceof HTMLAnchorElement;s.type==="radio"&&(s.name=`${s.name}-${o}`);for(const[l,c]of Object.entries(s))if(c!=null)switch(l){case"class":c.length&&e.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!a||l!=="href"&&l!=="newWindow")&&e.setAttribute(l,c)}a&&n.addLinkAttributes(e,s.href,s.newWindow),r&&s.dataId&&this.setupStorage(e,s.dataId,i,r)}static render(e){var i,r;const o=e.annotationStorage,n=e.linkService,s=e.xfaHtml,a=e.intent||"display",l=document.createElement(s.name);s.attributes&&this.setAttributes({html:l,element:s,intent:a,linkService:n});const c=a!=="richText",d=e.div;if(d.append(l),e.viewport){const p=`matrix(${e.viewport.transform.join(",")})`;d.style.transform=p}c&&d.setAttribute("class","xfaLayer xfaFont");const u=[];if(s.children.length===0){if(s.value){const p=document.createTextNode(s.value);l.append(p),c&&GP.shouldBuildText(s.name)&&u.push(p)}return{textDivs:u}}const h=[[s,-1,l]];for(;h.length>0;){const[p,g,f]=h.at(-1);if(g+1===p.children.length){h.pop();continue}const A=p.children[++h.at(-1)[1]];if(A===null)continue;const{name:m}=A;if(m==="#text"){const y=document.createTextNode(A.value);u.push(y),f.append(y);continue}const v=(i=A?.attributes)!=null&&i.xmlns?document.createElementNS(A.attributes.xmlns,m):document.createElement(m);if(f.append(v),A.attributes&&this.setAttributes({html:v,element:A,storage:o,intent:a,linkService:n}),((r=A.children)==null?void 0:r.length)>0)h.push([A,-1,v]);else if(A.value){const y=document.createTextNode(A.value);c&&GP.shouldBuildText(m)&&u.push(y),v.append(y)}}for(const p of d.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))p.setAttribute("readOnly",!0);return{textDivs:u}}static update(e){const i=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=i,e.div.hidden=!1}}const Ok=1e3,GNi=9,EA=new WeakSet;class hBe{static create(e){switch(e.data.annotationType){case es.LINK:return new gBe(e);case es.TEXT:return new KNi(e);case es.WIDGET:switch(e.data.fieldType){case"Tx":return new WNi(e);case"Btn":return e.data.radioButton?new mBe(e):e.data.checkBox?new JNi(e):new XNi(e);case"Ch":return new YNi(e);case"Sig":return new ZNi(e)}return new IA(e);case es.POPUP:return new F$(e);case es.FREETEXT:return new wBe(e);case es.LINE:return new eji(e);case es.SQUARE:return new tji(e);case es.CIRCLE:return new iji(e);case es.POLYLINE:return new CBe(e);case es.CARET:return new oji(e);case es.INK:return new V$(e);case es.POLYGON:return new rji(e);case es.HIGHLIGHT:return new xBe(e);case es.UNDERLINE:return new nji(e);case es.SQUIGGLY:return new sji(e);case es.STRIKEOUT:return new aji(e);case es.STAMP:return new kBe(e);case es.FILEATTACHMENT:return new lji(e);default:return new xs(e)}}}var SA,Uk,Nk,M_,_$;const QNi=class A_e{constructor(e,{isRenderable:i=!1,ignoreBorder:r=!1,createQuadrilaterals:o=!1}={}){ne(this,M_),ne(this,SA,null),ne(this,Uk,!1),ne(this,Nk,null),this.isRenderable=i,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,i&&(this.container=this._createContainer(r)),o&&this._createQuadrilaterals()}static _hasPopupData({titleObj:e,contentsObj:i,richText:r}){return!!(e!=null&&e.str||i!=null&&i.str||r!=null&&r.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return A_e._hasPopupData(this.data)}updateEdited(e){var i;if(!this.container)return;B(this,SA)||ee(this,SA,{rect:this.data.rect.slice(0)});const{rect:r}=e;r&&oe(this,M_,_$).call(this,r),(i=B(this,Nk))==null||i.popup.updateEdited(e)}resetEdited(){var e;B(this,SA)&&(oe(this,M_,_$).call(this,B(this,SA).rect),(e=B(this,Nk))==null||e.popup.resetEdited(),ee(this,SA,null))}_createContainer(e){const{data:i,parent:{page:r,viewport:o}}=this,n=document.createElement("section");n.setAttribute("data-annotation-id",i.id),this instanceof IA||(n.tabIndex=Ok);const{style:s}=n;if(s.zIndex=this.parent.zIndex++,i.alternativeText&&(n.title=i.alternativeText),i.noRotate&&n.classList.add("norotate"),!i.rect||this instanceof F$){const{rotation:f}=i;return!i.hasOwnCanvas&&f!==0&&this.setRotation(f,n),n}const{width:a,height:l}=this;if(!e&&i.borderStyle.width>0){s.borderWidth=`${i.borderStyle.width}px`;const f=i.borderStyle.horizontalCornerRadius,A=i.borderStyle.verticalCornerRadius;if(f>0||A>0){const v=`calc(${f}px * var(--total-scale-factor)) / calc(${A}px * var(--total-scale-factor))`;s.borderRadius=v}else if(this instanceof mBe){const v=`calc(${a}px * var(--total-scale-factor)) / calc(${l}px * var(--total-scale-factor))`;s.borderRadius=v}switch(i.borderStyle.style){case l7.SOLID:s.borderStyle="solid";break;case l7.DASHED:s.borderStyle="dashed";break;case l7.BEVELED:$i("Unimplemented border style: beveled");break;case l7.INSET:$i("Unimplemented border style: inset");break;case l7.UNDERLINE:s.borderBottomStyle="solid";break}const m=i.borderColor||null;m?(ee(this,Uk,!0),s.borderColor=vi.makeHexColor(m[0]|0,m[1]|0,m[2]|0)):s.borderWidth=0}const c=vi.normalizeRect([i.rect[0],r.view[3]-i.rect[1]+r.view[1],i.rect[2],r.view[3]-i.rect[3]+r.view[1]]),{pageWidth:d,pageHeight:u,pageX:h,pageY:p}=o.rawDims;s.left=`${100*(c[0]-h)/d}%`,s.top=`${100*(c[1]-p)/u}%`;const{rotation:g}=i;return i.hasOwnCanvas||g===0?(s.width=`${100*a/d}%`,s.height=`${100*l/u}%`):this.setRotation(g,n),n}setRotation(e,i=this.container){if(!this.data.rect)return;const{pageWidth:r,pageHeight:o}=this.parent.viewport.rawDims;let{width:n,height:s}=this;e%180!==0&&([n,s]=[s,n]),i.style.width=`${100*n/r}%`,i.style.height=`${100*s/o}%`,i.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(i,r,o)=>{const n=o.detail[i],s=n[0],a=n.slice(1);o.target.style[r]=dBe[`${s}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[r]:dBe[`${s}_rgb`](a)})};return br(this,"_commonActions",{display:i=>{const{display:r}=i.detail,o=r%2===1;this.container.style.visibility=o?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:o,noPrint:r===1||r===2})},print:i=>{this.annotationStorage.setValue(this.data.id,{noPrint:!i.detail.print})},hidden:i=>{const{hidden:r}=i.detail;this.container.style.visibility=r?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:r,noView:r})},focus:i=>{setTimeout(()=>i.target.focus({preventScroll:!1}),0)},userName:i=>{i.target.title=i.detail.userName},readonly:i=>{i.target.disabled=i.detail.readonly},required:i=>{this._setRequired(i.target,i.detail.required)},bgColor:i=>{e("bgColor","backgroundColor",i)},fillColor:i=>{e("fillColor","backgroundColor",i)},fgColor:i=>{e("fgColor","color",i)},textColor:i=>{e("textColor","color",i)},borderColor:i=>{e("borderColor","borderColor",i)},strokeColor:i=>{e("strokeColor","borderColor",i)},rotation:i=>{const r=i.detail.rotation;this.setRotation(r),this.annotationStorage.setValue(this.data.id,{rotation:r})}})}_dispatchEventFromSandbox(e,i){const r=this._commonActions;for(const o of Object.keys(i.detail)){const n=e[o]||r[o];n?.(i)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const i=this.annotationStorage.getRawValue(this.data.id);if(!i)return;const r=this._commonActions;for(const[o,n]of Object.entries(i)){const s=r[o];if(s){const a={detail:{[o]:n},target:e};s(a),delete i[o]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[i,r,o,n]=this.data.rect.map(f=>Math.fround(f));if(e.length===8){const[f,A,m,v]=e.subarray(2,6);if(o===f&&n===A&&i===m&&r===v)return}const{style:s}=this.container;let a;if(B(this,Uk)){const{borderColor:f,borderWidth:A}=s;s.borderWidth=0,a=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${f}" stroke-width="${A}">`],this.container.classList.add("hasBorder")}const l=o-i,c=n-r,{svgFactory:d}=this,u=d.createElement("svg");u.classList.add("quadrilateralsContainer"),u.setAttribute("width",0),u.setAttribute("height",0);const h=d.createElement("defs");u.append(h);const p=d.createElement("clipPath"),g=`clippath_${this.data.id}`;p.setAttribute("id",g),p.setAttribute("clipPathUnits","objectBoundingBox"),h.append(p);for(let f=2,A=e.length;f<A;f+=8){const m=e[f],v=e[f+1],y=e[f+2],b=e[f+3],w=d.createElement("rect"),C=(y-i)/l,M=(n-v)/c,P=(m-y)/l,E=(v-b)/c;w.setAttribute("x",C),w.setAttribute("y",M),w.setAttribute("width",P),w.setAttribute("height",E),p.append(w),a?.push(`<rect vector-effect="non-scaling-stroke" x="${C}" y="${M}" width="${P}" height="${E}"/>`)}B(this,Uk)&&(a.push("</g></svg>')"),s.backgroundImage=a.join("")),this.container.append(u),this.container.style.clipPath=`url(#${g})`}_createPopup(){const{data:e}=this,i=ee(this,Nk,new F$({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation},parent:this.parent,elements:[this]}));this.parent.div.append(i.render())}render(){Mo("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,i=null){const r=[];if(this._fieldObjects){const o=this._fieldObjects[e];if(o)for(const{page:n,id:s,exportValues:a}of o){if(n===-1||s===i)continue;const l=typeof a=="string"?a:null,c=document.querySelector(`[data-element-id="${s}"]`);if(c&&!EA.has(c)){$i(`_getElementsByName - element not allowed: ${s}`);continue}r.push({id:s,exportValue:l,domElement:c})}return r}for(const o of document.getElementsByName(e)){const{exportValue:n}=o,s=o.getAttribute("data-element-id");s!==i&&EA.has(o)&&r.push({id:s,exportValue:n,domElement:o})}return r}show(){var e;this.container&&(this.container.hidden=!1),(e=this.popup)==null||e.maybeShow()}hide(){var e;this.container&&(this.container.hidden=!0),(e=this.popup)==null||e.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const i of e)i.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:e,data:{id:i}}=this;this.container.addEventListener("dblclick",()=>{var r;(r=this.linkService.eventBus)==null||r.dispatch("switchannotationeditormode",{source:this,mode:e,editId:i})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}};SA=new WeakMap,Uk=new WeakMap,Nk=new WeakMap,M_=new WeakSet,_$=function(t){const{container:{style:e},data:{rect:i,rotation:r},parent:{viewport:{rawDims:{pageWidth:o,pageHeight:n,pageX:s,pageY:a}}}}=this;i?.splice(0,4,...t),e.left=`${100*(t[0]-s)/o}%`,e.top=`${100*(n-t[3]+a)/n}%`,r===0?(e.width=`${100*(t[2]-t[0])/o}%`,e.height=`${100*(t[3]-t[1])/n}%`):this.setRotation(r)};let xs=QNi;var h1,BA,pBe,fBe;class gBe extends xs{constructor(e,i=null){super(e,{isRenderable:!0,ignoreBorder:!!(i!=null&&i.ignoreBorder),createQuadrilaterals:!0}),ne(this,h1),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:i}=this,r=document.createElement("a");r.setAttribute("data-element-id",e.id);let o=!1;return e.url?(i.addLinkAttributes(r,e.url,e.newWindow),o=!0):e.action?(this._bindNamedAction(r,e.action),o=!0):e.attachment?(oe(this,h1,pBe).call(this,r,e.attachment,e.attachmentDest),o=!0):e.setOCGState?(oe(this,h1,fBe).call(this,r,e.setOCGState),o=!0):e.dest?(this._bindLink(r,e.dest),o=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(r,e),o=!0),e.resetForm?(this._bindResetFormAction(r,e.resetForm),o=!0):this.isTooltipOnly&&!o&&(this._bindLink(r,""),o=!0)),this.container.classList.add("linkAnnotation"),o&&this.container.append(r),this.container}_bindLink(e,i){e.href=this.linkService.getDestinationHash(i),e.onclick=()=>(i&&this.linkService.goToDestination(i),!1),(i||i==="")&&oe(this,h1,BA).call(this)}_bindNamedAction(e,i){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(i),!1),oe(this,h1,BA).call(this)}_bindJSAction(e,i){e.href=this.linkService.getAnchorUrl("");const r=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const o of Object.keys(i.actions)){const n=r.get(o);n&&(e[n]=()=>{var s;return(s=this.linkService.eventBus)==null||s.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i.id,name:o}}),!1})}e.onclick||(e.onclick=()=>!1),oe(this,h1,BA).call(this)}_bindResetFormAction(e,i){const r=e.onclick;if(r||(e.href=this.linkService.getAnchorUrl("")),oe(this,h1,BA).call(this),!this._fieldObjects){$i('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),r||(e.onclick=()=>!1);return}e.onclick=()=>{var o;r?.();const{fields:n,refs:s,include:a}=i,l=[];if(n.length!==0||s.length!==0){const u=new Set(s);for(const h of n){const p=this._fieldObjects[h]||[];for(const{id:g}of p)u.add(g)}for(const h of Object.values(this._fieldObjects))for(const p of h)u.has(p.id)===a&&l.push(p)}else for(const u of Object.values(this._fieldObjects))l.push(...u);const c=this.annotationStorage,d=[];for(const u of l){const{id:h}=u;switch(d.push(h),u.type){case"text":{const g=u.defaultValue||"";c.setValue(h,{value:g});break}case"checkbox":case"radiobutton":{const g=u.defaultValue===u.exportValues;c.setValue(h,{value:g});break}case"combobox":case"listbox":{const g=u.defaultValue||"";c.setValue(h,{value:g});break}default:continue}const p=document.querySelector(`[data-element-id="${h}"]`);if(p){if(!EA.has(p)){$i(`_bindResetFormAction - element not allowed: ${h}`);continue}}else continue;p.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:d,name:"ResetForm"}})),!1}}}h1=new WeakSet,BA=function(){this.container.setAttribute("data-internal-link","")},pBe=function(t,e,i=null){t.href=this.linkService.getAnchorUrl(""),e.description&&(t.title=e.description),t.onclick=()=>{var r;return(r=this.downloadManager)==null||r.openOrDownloadData(e.content,e.filename,i),!1},oe(this,h1,BA).call(this)},fBe=function(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),oe(this,h1,BA).call(this)};class KNi extends xs{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}}class IA extends xs{render(){return this.container}showElementAndHideCanvas(e){var i;this.data.hasOwnCanvas&&(((i=e.previousSibling)==null?void 0:i.nodeName)==="CANVAS"&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return aa.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,i,r,o,n){r.includes("mouse")?e.addEventListener(r,s=>{var a;(a=this.linkService.eventBus)==null||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:o,value:n(s),shift:s.shiftKey,modifier:this._getKeyModifier(s)}})}):e.addEventListener(r,s=>{var a;if(r==="blur"){if(!i.focused||!s.relatedTarget)return;i.focused=!1}else if(r==="focus"){if(i.focused)return;i.focused=!0}n&&((a=this.linkService.eventBus)==null||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:o,value:n(s)}}))})}_setEventListeners(e,i,r,o){var n,s,a;for(const[l,c]of r)(c==="Action"||(n=this.data.actions)!=null&&n[c])&&((c==="Focus"||c==="Blur")&&(i||(i={focused:!1})),this._setEventListener(e,i,l,c,o),c==="Focus"&&!((s=this.data.actions)!=null&&s.Blur)?this._setEventListener(e,i,"blur","Blur",null):c==="Blur"&&!((a=this.data.actions)!=null&&a.Focus)&&this._setEventListener(e,i,"focus","Focus",null))}_setBackgroundColor(e){const i=this.data.backgroundColor||null;e.style.backgroundColor=i===null?"transparent":vi.makeHexColor(i[0],i[1],i[2])}_setTextStyle(e){const i=["left","center","right"],{fontColor:r}=this.data.defaultAppearanceData,o=this.data.defaultAppearanceData.fontSize||GNi,n=e.style;let s;const a=2,l=c=>Math.round(10*c)/10;if(this.data.multiLine){const c=Math.abs(this.data.rect[3]-this.data.rect[1]-a),d=Math.round(c/(RY*o))||1,u=c/d;s=Math.min(o,l(u/RY))}else{const c=Math.abs(this.data.rect[3]-this.data.rect[1]-a);s=Math.min(o,l(c/RY))}n.fontSize=`calc(${s}px * var(--total-scale-factor))`,n.color=vi.makeHexColor(r[0],r[1],r[2]),this.data.textAlignment!==null&&(n.textAlign=i[this.data.textAlignment])}_setRequired(e,i){i?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",i)}}class WNi extends IA{constructor(e){const i=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:i})}setPropertyOnSiblings(e,i,r,o){const n=this.annotationStorage;for(const s of this._getElementsByName(e.name,e.id))s.domElement&&(s.domElement[i]=r),n.setValue(s.id,{[o]:r})}render(){var e,i;const r=this.annotationStorage,o=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){const s=r.getValue(o,{value:this.data.fieldValue});let a=s.value||"";const l=r.getValue(o,{charLimit:this.data.maxLen}).charLimit;l&&a.length>l&&(a=a.slice(0,l));let c=s.formattedValue||((e=this.data.textContent)==null?void 0:e.join(`
|
|
5528
5528
|
`))||null;c&&this.data.comb&&(c=c.replaceAll(/\s+/g,""));const d={userValue:a,formattedValue:c,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=c??a,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type=this.data.password?"password":"text",n.setAttribute("value",c??a),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),EA.add(n),n.setAttribute("data-element-id",o),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=Ok,this._setRequired(n,this.data.required),l&&(n.maxLength=l),n.addEventListener("input",h=>{r.setValue(o,{value:h.target.value}),this.setPropertyOnSiblings(n,"value",h.target.value,"value"),d.formattedValue=null}),n.addEventListener("resetform",h=>{const p=this.data.defaultFieldValue??"";n.value=d.userValue=p,d.formattedValue=null});let u=h=>{const{formattedValue:p}=d;p!=null&&(h.target.value=p),h.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",p=>{var g;if(d.focused)return;const{target:f}=p;d.userValue&&(f.value=d.userValue),d.lastCommittedValue=f.value,d.commitKey=1,(g=this.data.actions)!=null&&g.Focus||(d.focused=!0)}),n.addEventListener("updatefromsandbox",p=>{this.showElementAndHideCanvas(p.target);const g={value(f){d.userValue=f.detail.value??"",r.setValue(o,{value:d.userValue.toString()}),f.target.value=d.userValue},formattedValue(f){const{formattedValue:A}=f.detail;d.formattedValue=A,A!=null&&f.target!==document.activeElement&&(f.target.value=A),r.setValue(o,{formattedValue:A})},selRange(f){f.target.setSelectionRange(...f.detail.selRange)},charLimit:f=>{var A;const{charLimit:m}=f.detail,{target:v}=f;if(m===0){v.removeAttribute("maxLength");return}v.setAttribute("maxLength",m);let y=d.userValue;!y||y.length<=m||(y=y.slice(0,m),v.value=d.userValue=y,r.setValue(o,{value:y}),(A=this.linkService.eventBus)==null||A.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:y,willCommit:!0,commitKey:1,selStart:v.selectionStart,selEnd:v.selectionEnd}}))}};this._dispatchEventFromSandbox(g,p)}),n.addEventListener("keydown",p=>{var g;d.commitKey=1;let f=-1;if(p.key==="Escape"?f=0:p.key==="Enter"&&!this.data.multiLine?f=2:p.key==="Tab"&&(d.commitKey=3),f===-1)return;const{value:A}=p.target;d.lastCommittedValue!==A&&(d.lastCommittedValue=A,d.userValue=A,(g=this.linkService.eventBus)==null||g.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:A,willCommit:!0,commitKey:f,selStart:p.target.selectionStart,selEnd:p.target.selectionEnd}}))});const h=u;u=null,n.addEventListener("blur",p=>{var g,f;if(!d.focused||!p.relatedTarget)return;(g=this.data.actions)!=null&&g.Blur||(d.focused=!1);const{value:A}=p.target;d.userValue=A,d.lastCommittedValue!==A&&((f=this.linkService.eventBus)==null||f.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:A,willCommit:!0,commitKey:d.commitKey,selStart:p.target.selectionStart,selEnd:p.target.selectionEnd}})),h(p)}),(i=this.data.actions)!=null&&i.Keystroke&&n.addEventListener("beforeinput",p=>{var g;d.lastCommittedValue=null;const{data:f,target:A}=p,{value:m,selectionStart:v,selectionEnd:y}=A;let b=v,w=y;switch(p.inputType){case"deleteWordBackward":{const C=m.substring(0,v).match(/\w*[^\w]*$/);C&&(b-=C[0].length);break}case"deleteWordForward":{const C=m.substring(v).match(/^[^\w]*\w*/);C&&(w+=C[0].length);break}case"deleteContentBackward":v===y&&(b-=1);break;case"deleteContentForward":v===y&&(w+=1);break}p.preventDefault(),(g=this.linkService.eventBus)==null||g.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:m,change:f||"",willCommit:!1,selStart:b,selEnd:w}})}),this._setEventListeners(n,d,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],p=>p.target.value)}if(u&&n.addEventListener("blur",u),this.data.comb){const h=(this.data.rect[2]-this.data.rect[0])/l;n.classList.add("comb"),n.style.letterSpacing=`calc(${h}px * var(--total-scale-factor) - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell",this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class ZNi extends IA{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class JNi extends IA{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,i=this.data,r=i.id;let o=e.getValue(r,{value:i.exportValue===i.fieldValue}).value;typeof o=="string"&&(o=o!=="Off",e.setValue(r,{value:o})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const n=document.createElement("input");return EA.add(n),n.setAttribute("data-element-id",r),n.disabled=i.readOnly,this._setRequired(n,this.data.required),n.type="checkbox",n.name=i.fieldName,o&&n.setAttribute("checked",!0),n.setAttribute("exportValue",i.exportValue),n.tabIndex=Ok,n.addEventListener("change",s=>{const{name:a,checked:l}=s.target;for(const c of this._getElementsByName(a,r)){const d=l&&c.exportValue===i.exportValue;c.domElement&&(c.domElement.checked=d),e.setValue(c.id,{value:d})}e.setValue(r,{value:l})}),n.addEventListener("resetform",s=>{const a=i.defaultFieldValue||"Off";s.target.checked=a===i.exportValue}),this.enableScripting&&this.hasJSActions&&(n.addEventListener("updatefromsandbox",s=>{const a={value(l){l.target.checked=l.detail.value!=="Off",e.setValue(r,{value:l.target.checked})}};this._dispatchEventFromSandbox(a,s)}),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],s=>s.target.checked)),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class mBe extends IA{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,i=this.data,r=i.id;let o=e.getValue(r,{value:i.fieldValue===i.buttonValue}).value;if(typeof o=="string"&&(o=o!==i.buttonValue,e.setValue(r,{value:o})),o)for(const s of this._getElementsByName(i.fieldName,r))e.setValue(s.id,{value:!1});const n=document.createElement("input");if(EA.add(n),n.setAttribute("data-element-id",r),n.disabled=i.readOnly,this._setRequired(n,this.data.required),n.type="radio",n.name=i.fieldName,o&&n.setAttribute("checked",!0),n.tabIndex=Ok,n.addEventListener("change",s=>{const{name:a,checked:l}=s.target;for(const c of this._getElementsByName(a,r))e.setValue(c.id,{value:!1});e.setValue(r,{value:l})}),n.addEventListener("resetform",s=>{const a=i.defaultFieldValue;s.target.checked=a!=null&&a===i.buttonValue}),this.enableScripting&&this.hasJSActions){const s=i.buttonValue;n.addEventListener("updatefromsandbox",a=>{const l={value:c=>{const d=s===c.detail.value;for(const u of this._getElementsByName(c.target.name)){const h=d&&u.id===r;u.domElement&&(u.domElement.checked=h),e.setValue(u.id,{value:h})}}};this._dispatchEventFromSandbox(l,a)}),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],a=>a.target.checked)}return this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class XNi extends gBe{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");const i=e.lastChild;return this.enableScripting&&this.hasJSActions&&i&&(this._setDefaultPropertiesFromJS(i),i.addEventListener("updatefromsandbox",r=>{this._dispatchEventFromSandbox({},r)})),e}}class YNi extends IA{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,i=this.data.id,r=e.getValue(i,{value:this.data.fieldValue}),o=document.createElement("select");EA.add(o),o.setAttribute("data-element-id",i),o.disabled=this.data.readOnly,this._setRequired(o,this.data.required),o.name=this.data.fieldName,o.tabIndex=Ok;let n=this.data.combo&&this.data.options.length>0;this.data.combo||(o.size=this.data.options.length,this.data.multiSelect&&(o.multiple=!0)),o.addEventListener("resetform",d=>{const u=this.data.defaultFieldValue;for(const h of o.options)h.selected=h.value===u});for(const d of this.data.options){const u=document.createElement("option");u.textContent=d.displayValue,u.value=d.exportValue,r.value.includes(d.exportValue)&&(u.setAttribute("selected",!0),n=!1),o.append(u)}let s=null;if(n){const d=document.createElement("option");d.value=" ",d.setAttribute("hidden",!0),d.setAttribute("selected",!0),o.prepend(d),s=()=>{d.remove(),o.removeEventListener("input",s),s=null},o.addEventListener("input",s)}const a=d=>{const u=d?"value":"textContent",{options:h,multiple:p}=o;return p?Array.prototype.filter.call(h,g=>g.selected).map(g=>g[u]):h.selectedIndex===-1?null:h[h.selectedIndex][u]};let l=a(!1);const c=d=>{const u=d.target.options;return Array.prototype.map.call(u,h=>({displayValue:h.textContent,exportValue:h.value}))};return this.enableScripting&&this.hasJSActions?(o.addEventListener("updatefromsandbox",d=>{const u={value(h){s?.();const p=h.detail.value,g=new Set(Array.isArray(p)?p:[p]);for(const f of o.options)f.selected=g.has(f.value);e.setValue(i,{value:a(!0)}),l=a(!1)},multipleSelection(h){o.multiple=!0},remove(h){const p=o.options,g=h.detail.remove;p[g].selected=!1,o.remove(g),p.length>0&&Array.prototype.findIndex.call(p,f=>f.selected)===-1&&(p[0].selected=!0),e.setValue(i,{value:a(!0),items:c(h)}),l=a(!1)},clear(h){for(;o.length!==0;)o.remove(0);e.setValue(i,{value:null,items:[]}),l=a(!1)},insert(h){const{index:p,displayValue:g,exportValue:f}=h.detail.insert,A=o.children[p],m=document.createElement("option");m.textContent=g,m.value=f,A?A.before(m):o.append(m),e.setValue(i,{value:a(!0),items:c(h)}),l=a(!1)},items(h){const{items:p}=h.detail;for(;o.length!==0;)o.remove(0);for(const g of p){const{displayValue:f,exportValue:A}=g,m=document.createElement("option");m.textContent=f,m.value=A,o.append(m)}o.options.length>0&&(o.options[0].selected=!0),e.setValue(i,{value:a(!0),items:c(h)}),l=a(!1)},indices(h){const p=new Set(h.detail.indices);for(const g of h.target.options)g.selected=p.has(g.index);e.setValue(i,{value:a(!0)}),l=a(!1)},editable(h){h.target.disabled=!h.detail.editable}};this._dispatchEventFromSandbox(u,d)}),o.addEventListener("input",d=>{var u;const h=a(!0),p=a(!1);e.setValue(i,{value:h}),d.preventDefault(),(u=this.linkService.eventBus)==null||u.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:l,change:p,changeEx:h,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(o,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],d=>d.target.value)):o.addEventListener("input",function(d){e.setValue(i,{value:a(!0)})}),this.data.combo&&this._setTextStyle(o),this._setBackgroundColor(o),this._setDefaultPropertiesFromJS(o),this.container.append(o),this.container}}class F$ extends xs{constructor(e){const{data:i,elements:r}=e;super(e,{isRenderable:xs._hasPopupData(i)}),this.elements=r,this.popup=null}render(){this.container.classList.add("popupAnnotation");const e=this.popup=new $Ni({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),i=[];for(const r of this.elements)r.popup=e,r.container.ariaHasPopup="dialog",i.push(r.data.id),r.addHighlightArea();return this.container.setAttribute("aria-controls",i.map(r=>`${NY}${r}`).join(",")),this.container}}var jk,O$,U$,Hk,Vk,zn,j2,zk,P_,E_,qk,H2,p1,V2,S_,z2,B_,TA,K7,ks,I_,N$,ABe,vBe,bBe,yBe,T_,R_,j$;class $Ni{constructor({container:e,color:i,elements:r,titleObj:o,modificationDate:n,contentsObj:s,richText:a,parent:l,rect:c,parentRect:d,open:u}){ne(this,ks),ne(this,jk,oe(this,ks,bBe).bind(this)),ne(this,O$,oe(this,ks,j$).bind(this)),ne(this,U$,oe(this,ks,R_).bind(this)),ne(this,Hk,oe(this,ks,T_).bind(this)),ne(this,Vk,null),ne(this,zn,null),ne(this,j2,null),ne(this,zk,null),ne(this,P_,null),ne(this,E_,null),ne(this,qk,null),ne(this,H2,!1),ne(this,p1,null),ne(this,V2,null),ne(this,S_,null),ne(this,z2,null),ne(this,B_,null),ne(this,TA,null),ne(this,K7,!1);var h;ee(this,zn,e),ee(this,B_,o),ee(this,j2,s),ee(this,z2,a),ee(this,E_,l),ee(this,Vk,i),ee(this,S_,c),ee(this,qk,d),ee(this,P_,r),ee(this,zk,VY.toDateObject(n)),this.trigger=r.flatMap(p=>p.getElementsToTriggerPopup());for(const p of this.trigger)p.addEventListener("click",B(this,Hk)),p.addEventListener("mouseenter",B(this,U$)),p.addEventListener("mouseleave",B(this,O$)),p.classList.add("popupTriggerArea");for(const p of r)(h=p.container)==null||h.addEventListener("keydown",B(this,jk));B(this,zn).hidden=!0,u&&oe(this,ks,T_).call(this)}render(){if(B(this,p1))return;const e=ee(this,p1,document.createElement("div"));if(e.className="popup",B(this,Vk)){const n=e.style.outlineColor=vi.makeHexColor(...B(this,Vk));e.style.backgroundColor=`color-mix(in srgb, ${n} 30%, white)`}const i=document.createElement("span");i.className="header";const r=document.createElement("h1");if(i.append(r),{dir:r.dir,str:r.textContent}=B(this,B_),e.append(i),B(this,zk)){const n=document.createElement("span");n.classList.add("popupDate"),n.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),n.setAttribute("data-l10n-args",JSON.stringify({dateObj:B(this,zk).valueOf()})),i.append(n)}const o=B(this,ks,I_);if(o)uBe.render({xfaHtml:o,intent:"richText",div:e}),e.lastChild.classList.add("richText","popupContent");else{const n=this._formatContents(B(this,j2));e.append(n)}B(this,zn).append(e)}_formatContents({str:e,dir:i}){const r=document.createElement("p");r.classList.add("popupContent"),r.dir=i;const o=e.split(/(?:\r\n?|\n)/);for(let n=0,s=o.length;n<s;++n){const a=o[n];r.append(document.createTextNode(a)),n<s-1&&r.append(document.createElement("br"))}return r}updateEdited({rect:e,popupContent:i}){var r;B(this,TA)||ee(this,TA,{contentsObj:B(this,j2),richText:B(this,z2)}),e&&ee(this,V2,null),i&&(ee(this,z2,oe(this,ks,vBe).call(this,i)),ee(this,j2,null)),(r=B(this,p1))==null||r.remove(),ee(this,p1,null)}resetEdited(){var e;B(this,TA)&&({contentsObj:Ql(this,j2)._,richText:Ql(this,z2)._}=B(this,TA),ee(this,TA,null),(e=B(this,p1))==null||e.remove(),ee(this,p1,null),ee(this,V2,null))}forceHide(){ee(this,K7,this.isVisible),B(this,K7)&&(B(this,zn).hidden=!0)}maybeShow(){B(this,K7)&&(B(this,p1)||oe(this,ks,R_).call(this),ee(this,K7,!1),B(this,zn).hidden=!1)}get isVisible(){return B(this,zn).hidden===!1}}jk=new WeakMap,O$=new WeakMap,U$=new WeakMap,Hk=new WeakMap,Vk=new WeakMap,zn=new WeakMap,j2=new WeakMap,zk=new WeakMap,P_=new WeakMap,E_=new WeakMap,qk=new WeakMap,H2=new WeakMap,p1=new WeakMap,V2=new WeakMap,S_=new WeakMap,z2=new WeakMap,B_=new WeakMap,TA=new WeakMap,K7=new WeakMap,ks=new WeakSet,I_=function(){const t=B(this,z2),e=B(this,j2);return t!=null&&t.str&&(!(e!=null&&e.str)||e.str===t.str)&&B(this,z2).html||null},N$=function(){var t,e,i;return((i=(e=(t=B(this,ks,I_))==null?void 0:t.attributes)==null?void 0:e.style)==null?void 0:i.fontSize)||0},ABe=function(){var t,e,i;return((i=(e=(t=B(this,ks,I_))==null?void 0:t.attributes)==null?void 0:e.style)==null?void 0:i.color)||null},vBe=function(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},r={style:{color:B(this,ks,ABe),fontSize:B(this,ks,N$)?`calc(${B(this,ks,N$)}px * var(--total-scale-factor))`:""}};for(const o of t.split(`
|