@vertexvis/viewer 0.10.2-canary.7 → 0.11.0

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.
Files changed (139) hide show
  1. package/dist/cjs/{browser.esm-ae55f058.js → browser.esm-17419694.js} +25 -25
  2. package/dist/cjs/{bundle.esm-c457ad4d.js → bundle.esm-b79513ef.js} +231 -207
  3. package/dist/cjs/{constants-4277684a.js → constants-1d65ed39.js} +1 -1
  4. package/dist/cjs/{cursors-b93b43ef.js → cursors-8aaf500f.js} +1 -1
  5. package/dist/cjs/{dom-cdb50ebc.js → dom-40804039.js} +1 -1
  6. package/dist/cjs/index.cjs.js +8 -7
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/{markup-3dac4cef.js → markup-e84a143f.js} +11 -2
  9. package/dist/cjs/{measurement-b494bf55.js → measurement-4579193b.js} +2 -2
  10. package/dist/cjs/{orientation-42cc9e8d.js → orientation-09d0f3ef.js} +14 -7
  11. package/dist/cjs/{png-decoder-2add73dd.js → png-decoder-97ea96ba.js} +3 -3
  12. package/dist/cjs/{scene-23a0a330.js → scene-4397373a.js} +28524 -2446
  13. package/dist/cjs/{utils-6933381f.js → utils-414e6cfe.js} +2 -2
  14. package/dist/cjs/utils-440f0f7d.js +61 -0
  15. package/dist/cjs/vertex-scene-tree.cjs.entry.js +6 -5
  16. package/dist/cjs/vertex-viewer-dom-element_3.cjs.entry.js +4 -4
  17. package/dist/cjs/{vertex-viewer-markup-arrow_2.cjs.entry.js → vertex-viewer-markup-arrow_3.cjs.entry.js} +267 -4
  18. package/dist/cjs/vertex-viewer-markup-tool.cjs.entry.js +43 -9
  19. package/dist/cjs/vertex-viewer-markup.cjs.entry.js +25 -5
  20. package/dist/cjs/vertex-viewer-measurement-distance_2.cjs.entry.js +8 -8
  21. package/dist/cjs/vertex-viewer-measurement-tool.cjs.entry.js +5 -5
  22. package/dist/cjs/vertex-viewer-measurements.cjs.entry.js +5 -5
  23. package/dist/cjs/vertex-viewer-view-cube.cjs.entry.js +3 -3
  24. package/dist/cjs/vertex-viewer.cjs.entry.js +141 -48
  25. package/dist/cjs/viewer.cjs.js +1 -1
  26. package/dist/cjs/{viewport-e69f8223.js → viewport-fc405a48.js} +31 -7
  27. package/dist/collection/collection-manifest.json +1 -0
  28. package/dist/collection/components/scene-tree/scene-tree.js +3 -2
  29. package/dist/collection/components/viewer/viewer.js +28 -3
  30. package/dist/collection/components/viewer-markup/utils.js +65 -1
  31. package/dist/collection/components/viewer-markup/viewer-markup.js +72 -16
  32. package/dist/collection/components/viewer-markup-circle/utils.js +2 -55
  33. package/dist/collection/components/viewer-markup-circle/viewer-markup-circle.js +4 -4
  34. package/dist/collection/components/viewer-markup-freeform.tsx/utils.js +10 -0
  35. package/dist/collection/components/viewer-markup-freeform.tsx/viewer-markup-freeform.css +157 -0
  36. package/dist/collection/components/viewer-markup-freeform.tsx/viewer-markup-freeform.js +413 -0
  37. package/dist/collection/components/viewer-markup-tool/viewer-markup-tool.js +63 -9
  38. package/dist/collection/components/viewer-measurement-distance/viewer-measurement-distance-components.js +1 -1
  39. package/dist/collection/components/viewer-measurement-distance/viewer-measurement-distance.js +2 -2
  40. package/dist/collection/lib/cursors.js +1 -1
  41. package/dist/collection/lib/interactions/baseInteractionHandler.js +5 -4
  42. package/dist/collection/lib/interactions/flyToPartKeyInteraction.js +1 -1
  43. package/dist/collection/lib/interactions/interactionApi.js +101 -22
  44. package/dist/collection/lib/interactions/mouseInteractions.js +17 -15
  45. package/dist/collection/lib/interactions/multiTouchInteractionHandler.js +2 -2
  46. package/dist/collection/lib/mappers.js +4 -3
  47. package/dist/collection/lib/scenes/camera.js +8 -2
  48. package/dist/collection/lib/scenes/operations.js +1 -1
  49. package/dist/collection/lib/scenes/scene.js +5 -2
  50. package/dist/collection/lib/types/frame.js +8 -2
  51. package/dist/collection/lib/types/markup.js +9 -1
  52. package/dist/collection/lib/types/stencilBuffer.js +2 -2
  53. package/dist/collection/lib/types/viewport.js +32 -8
  54. package/dist/collection/testing/fixtures.js +2 -1
  55. package/dist/esm/{browser.esm-7dbdf78a.js → browser.esm-e4fb17dc.js} +25 -25
  56. package/dist/esm/{bundle.esm-590d2273.js → bundle.esm-d891316f.js} +232 -208
  57. package/dist/esm/{constants-083f6b2c.js → constants-037e417f.js} +1 -1
  58. package/dist/esm/{cursors-39294365.js → cursors-00835249.js} +1 -1
  59. package/dist/esm/{dom-43682375.js → dom-d0877f90.js} +1 -1
  60. package/dist/esm/index.js +7 -7
  61. package/dist/esm/index.mjs +7 -7
  62. package/dist/esm/loader.js +1 -1
  63. package/dist/esm/loader.mjs +1 -1
  64. package/dist/esm/{markup-3ce3dccd.js → markup-9b29aa94.js} +11 -3
  65. package/dist/esm/{measurement-78bd27fc.js → measurement-8430d5d6.js} +2 -2
  66. package/dist/esm/{orientation-c3e2af18.js → orientation-bb34b652.js} +14 -7
  67. package/dist/esm/{png-decoder-dfb97536.js → png-decoder-c4745070.js} +3 -3
  68. package/dist/esm/{scene-30ac6229.js → scene-72760305.js} +28532 -2454
  69. package/dist/esm/utils-5fe43b8a.js +52 -0
  70. package/dist/esm/{utils-b857bd7c.js → utils-f8e0baf7.js} +2 -2
  71. package/dist/esm/vertex-scene-tree.entry.js +6 -5
  72. package/dist/esm/vertex-viewer-dom-element_3.entry.js +4 -4
  73. package/dist/esm/{vertex-viewer-markup-arrow_2.entry.js → vertex-viewer-markup-arrow_3.entry.js} +267 -5
  74. package/dist/esm/vertex-viewer-markup-tool.entry.js +43 -9
  75. package/dist/esm/vertex-viewer-markup.entry.js +25 -5
  76. package/dist/esm/vertex-viewer-measurement-distance_2.entry.js +8 -8
  77. package/dist/esm/vertex-viewer-measurement-tool.entry.js +5 -5
  78. package/dist/esm/vertex-viewer-measurements.entry.js +5 -5
  79. package/dist/esm/vertex-viewer-view-cube.entry.js +3 -3
  80. package/dist/esm/vertex-viewer.entry.js +141 -48
  81. package/dist/esm/viewer.js +1 -1
  82. package/dist/esm/{viewport-8fea0743.js → viewport-d6f5cd7b.js} +31 -7
  83. package/dist/types/components/viewer/viewer.d.ts +4 -0
  84. package/dist/types/components/viewer-markup/utils.d.ts +8 -0
  85. package/dist/types/components/viewer-markup/viewer-markup.d.ts +13 -6
  86. package/dist/types/components/viewer-markup-circle/utils.d.ts +1 -4
  87. package/dist/types/components/viewer-markup-freeform.tsx/utils.d.ts +3 -0
  88. package/dist/types/components/viewer-markup-freeform.tsx/viewer-markup-freeform.d.ts +116 -0
  89. package/dist/types/components/viewer-markup-tool/viewer-markup-tool.d.ts +13 -1
  90. package/dist/types/components.d.ts +107 -10
  91. package/dist/types/lib/interactions/interactionApi.d.ts +22 -6
  92. package/dist/types/lib/interactions/mouseInteractions.d.ts +7 -6
  93. package/dist/types/lib/scenes/camera.d.ts +5 -1
  94. package/dist/types/lib/scenes/scene.d.ts +1 -1
  95. package/dist/types/lib/types/frame.d.ts +4 -1
  96. package/dist/types/lib/types/markup.d.ts +12 -1
  97. package/dist/types/lib/types/viewport.d.ts +17 -0
  98. package/dist/viewer/index.esm.js +1 -1
  99. package/dist/viewer/p-012fb54f.js +4 -0
  100. package/dist/viewer/{p-3dc15d99.entry.js → p-117324c0.entry.js} +1 -1
  101. package/dist/viewer/{p-1ee75110.entry.js → p-1c772ec1.entry.js} +1 -1
  102. package/dist/viewer/p-1f8a238b.js +4 -0
  103. package/dist/viewer/p-21e8510d.js +4 -0
  104. package/dist/viewer/{p-e3105f9a.entry.js → p-3c2aff67.entry.js} +1 -1
  105. package/dist/viewer/p-5389e9d4.js +4 -0
  106. package/dist/viewer/p-59d075d4.js +17 -0
  107. package/dist/viewer/{p-5b078339.js → p-62c6f482.js} +1 -1
  108. package/dist/viewer/p-640cb5f8.js +18 -0
  109. package/dist/viewer/p-68aaf1f8.entry.js +4 -0
  110. package/dist/viewer/{p-05b2444e.js → p-75682963.js} +1 -1
  111. package/dist/viewer/{p-4183c421.entry.js → p-79c45c02.entry.js} +1 -1
  112. package/dist/viewer/p-835e158e.js +4 -0
  113. package/dist/viewer/p-8c255868.entry.js +4 -0
  114. package/dist/viewer/{p-f4a492e1.js → p-9faabd97.js} +1 -1
  115. package/dist/viewer/p-b122ee39.js +4 -0
  116. package/dist/viewer/p-b36b3d1a.js +4 -0
  117. package/dist/viewer/{p-7c71db57.entry.js → p-bc9e6919.entry.js} +1 -1
  118. package/dist/viewer/{p-f090a3f3.entry.js → p-c818c80e.entry.js} +1 -1
  119. package/dist/viewer/{p-e96bc9a2.js → p-d42a482c.js} +1 -1
  120. package/dist/viewer/p-f43e8cc2.entry.js +4 -0
  121. package/dist/viewer/p-f75436be.entry.js +4 -0
  122. package/dist/viewer/viewer.esm.js +1 -1
  123. package/package.json +18 -16
  124. package/readme.md +6 -6
  125. package/dist/cjs/utils-96f244e1.js +0 -104
  126. package/dist/esm/utils-a550c58f.js +0 -96
  127. package/dist/viewer/p-11bdd2c4.js +0 -4
  128. package/dist/viewer/p-14182324.entry.js +0 -4
  129. package/dist/viewer/p-2768474e.js +0 -4
  130. package/dist/viewer/p-2e11803d.js +0 -4
  131. package/dist/viewer/p-6d4ab5fc.js +0 -17
  132. package/dist/viewer/p-964642c6.js +0 -4
  133. package/dist/viewer/p-9e856d0a.entry.js +0 -4
  134. package/dist/viewer/p-a717d9ff.js +0 -4
  135. package/dist/viewer/p-a9434d8e.entry.js +0 -4
  136. package/dist/viewer/p-af806858.js +0 -4
  137. package/dist/viewer/p-b5c350a7.js +0 -4
  138. package/dist/viewer/p-d912dd24.js +0 -18
  139. package/dist/viewer/p-f6d75616.entry.js +0 -4
@@ -1,4 +1,4 @@
1
1
  /**!
2
2
  * Copyright (c) 2021 Vertex Software LLC. All rights reserved.
3
3
  */
4
- import{r as e,c as t,h as s,H as n,g as a}from"./p-c9d8a379.js";import{M as i,i as r}from"./p-5b078339.js";import{s as h}from"./p-c738296e.js";import"./p-b5c350a7.js";import{D as d}from"./p-af806858.js";import"./p-d912dd24.js";import"./p-6d4ab5fc.js";const o=class{constructor(s){e(this,s),this.measurementAdded=t(this,"measurementAdded",7),this.measurementRemoved=t(this,"measurementRemoved",7),this.tool="distance",this.units="millimeters",this.fractionalDigits=2,this.disabled=!1,this.snapDistance=i}async addMeasurement(e){if(e instanceof d){const{start:t,end:s,invalid:n,id:a}=e,i=this.createDistanceMeasurementElement();return i.id=a,i.start=t,i.end=s,i.invalid=n,this.updatePropsOnMeasurement(i),this.hostEl.appendChild(i),this.measurementAdded.emit(i),i}throw new Error(`Cannot add measurement. Unknown type '${e}'.`)}async removeMeasurement(e){const t=(await this.getMeasurementElements()).find((t=>t.id===e));return null!=t&&(t.remove(),this.measurementRemoved.emit(t)),t}async getMeasurementElement(e){return(await this.getMeasurementElements()).find((t=>t.id===e))}async getMeasurementElements(){return Array.from(this.hostEl.children).filter(r)}async handleSelectedMeasurementIdChanged(){(await this.getMeasurementElements()).forEach((e=>{e.mode=e.id===this.selectedMeasurementId?"edit":""}))}handleToolChanged(){this.updatePropsOnMeasurementTool()}async handleViewerChanged(e){this.updatePropsOnMeasurementTool(),this.updatePropsOnMeasurements()}handleDisabledChanged(){this.updatePropsOnMeasurementTool()}handleDistanceTemplateIdChanged(){this.updatePropsOnMeasurementTool()}handleUnitsChanged(){this.updatePropsOnMeasurementTool(),this.updatePropsOnMeasurements()}handleFractionalDigitsChanged(){this.updatePropsOnMeasurementTool(),this.updatePropsOnMeasurements()}handleSnapDistanceChanged(){this.updatePropsOnMeasurementTool(),this.updatePropsOnMeasurements()}async handleMeasureEnd(e){const t=e;await this.addMeasurement(t.detail),this.selectedMeasurementId=t.detail.id}async handleMeasurementPointerDown(e){if(!this.disabled){const t=e.target,s=(await this.getMeasurementElements()).find((e=>e===t));null!=(null==s?void 0:s.id)&&""!==(null==s?void 0:s.id)&&(this.selectedMeasurementId=t.id)}}componentDidLoad(){this.updatePropsOnMeasurementTool()}render(){return s(n,null,s("slot",null))}createDistanceMeasurementElement(){if(null!=this.distanceTemplateId){const e=h(window.document.body,this.distanceTemplateId,r,(()=>console.warn(`Distance template with ID ${this.distanceTemplateId} not found. Using default distance element.`)),(()=>console.warn("Distance template does not contain a vertex-viewer-measurement-distance. Using default distance element.")));if(null!=e)return e}return document.createElement("vertex-viewer-measurement-distance")}async updatePropsOnMeasurements(){(await this.getMeasurementElements()).forEach((e=>this.updatePropsOnMeasurement(e)))}updatePropsOnMeasurement(e){e.fractionalDigits=this.fractionalDigits,e.units=this.units,e.snapDistance=this.snapDistance,e.viewer=this.viewer,e.classList.add("viewer-measurements__measurement")}updatePropsOnMeasurementTool(){const e=this.getMeasurementTool();null!=e&&(e.disabled=this.disabled,e.distanceTemplateId=this.distanceTemplateId,e.tool=this.tool,e.fractionalDigits=this.fractionalDigits,e.units=this.units,e.snapDistance=this.snapDistance,e.viewer=this.viewer)}getMeasurementTool(){return this.hostEl.querySelector("vertex-viewer-measurement-tool")}get hostEl(){return a(this)}static get watchers(){return{selectedMeasurementId:["handleSelectedMeasurementIdChanged"],tool:["handleToolChanged"],viewer:["handleViewerChanged"],disabled:["handleDisabledChanged"],distanceTemplateId:["handleDistanceTemplateIdChanged"],units:["handleUnitsChanged"],fractionalDigits:["handleFractionalDigitsChanged"],snapDistance:["handleSnapDistanceChanged"]}}};o.style=":host{display:block;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none}::slotted(.viewer-measurements__measurement[mode='']){cursor:pointer}::slotted(.viewer-measurements__measurement[mode='edit']){z-index:1}::slotted(.viewer-measurements__measurement[interacting-anchor='start']),::slotted(.viewer-measurements__measurement[interacting-anchor='end']),::slotted(vertex-viewer-measurement-tool[is-measuring]){z-index:2}";export{o as vertex_viewer_measurements}
4
+ import{r as e,c as t,h as s,H as n,g as a}from"./p-c9d8a379.js";import{M as i,i as r}from"./p-62c6f482.js";import{s as h}from"./p-c738296e.js";import"./p-21e8510d.js";import{D as d}from"./p-012fb54f.js";import"./p-640cb5f8.js";import"./p-59d075d4.js";const o=class{constructor(s){e(this,s),this.measurementAdded=t(this,"measurementAdded",7),this.measurementRemoved=t(this,"measurementRemoved",7),this.tool="distance",this.units="millimeters",this.fractionalDigits=2,this.disabled=!1,this.snapDistance=i}async addMeasurement(e){if(e instanceof d){const{start:t,end:s,invalid:n,id:a}=e,i=this.createDistanceMeasurementElement();return i.id=a,i.start=t,i.end=s,i.invalid=n,this.updatePropsOnMeasurement(i),this.hostEl.appendChild(i),this.measurementAdded.emit(i),i}throw new Error(`Cannot add measurement. Unknown type '${e}'.`)}async removeMeasurement(e){const t=(await this.getMeasurementElements()).find((t=>t.id===e));return null!=t&&(t.remove(),this.measurementRemoved.emit(t)),t}async getMeasurementElement(e){return(await this.getMeasurementElements()).find((t=>t.id===e))}async getMeasurementElements(){return Array.from(this.hostEl.children).filter(r)}async handleSelectedMeasurementIdChanged(){(await this.getMeasurementElements()).forEach((e=>{e.mode=e.id===this.selectedMeasurementId?"edit":""}))}handleToolChanged(){this.updatePropsOnMeasurementTool()}async handleViewerChanged(e){this.updatePropsOnMeasurementTool(),this.updatePropsOnMeasurements()}handleDisabledChanged(){this.updatePropsOnMeasurementTool()}handleDistanceTemplateIdChanged(){this.updatePropsOnMeasurementTool()}handleUnitsChanged(){this.updatePropsOnMeasurementTool(),this.updatePropsOnMeasurements()}handleFractionalDigitsChanged(){this.updatePropsOnMeasurementTool(),this.updatePropsOnMeasurements()}handleSnapDistanceChanged(){this.updatePropsOnMeasurementTool(),this.updatePropsOnMeasurements()}async handleMeasureEnd(e){const t=e;await this.addMeasurement(t.detail),this.selectedMeasurementId=t.detail.id}async handleMeasurementPointerDown(e){if(!this.disabled){const t=e.target,s=(await this.getMeasurementElements()).find((e=>e===t));null!=(null==s?void 0:s.id)&&""!==(null==s?void 0:s.id)&&(this.selectedMeasurementId=t.id)}}componentDidLoad(){this.updatePropsOnMeasurementTool()}render(){return s(n,null,s("slot",null))}createDistanceMeasurementElement(){if(null!=this.distanceTemplateId){const e=h(window.document.body,this.distanceTemplateId,r,(()=>console.warn(`Distance template with ID ${this.distanceTemplateId} not found. Using default distance element.`)),(()=>console.warn("Distance template does not contain a vertex-viewer-measurement-distance. Using default distance element.")));if(null!=e)return e}return document.createElement("vertex-viewer-measurement-distance")}async updatePropsOnMeasurements(){(await this.getMeasurementElements()).forEach((e=>this.updatePropsOnMeasurement(e)))}updatePropsOnMeasurement(e){e.fractionalDigits=this.fractionalDigits,e.units=this.units,e.snapDistance=this.snapDistance,e.viewer=this.viewer,e.classList.add("viewer-measurements__measurement")}updatePropsOnMeasurementTool(){const e=this.getMeasurementTool();null!=e&&(e.disabled=this.disabled,e.distanceTemplateId=this.distanceTemplateId,e.tool=this.tool,e.fractionalDigits=this.fractionalDigits,e.units=this.units,e.snapDistance=this.snapDistance,e.viewer=this.viewer)}getMeasurementTool(){return this.hostEl.querySelector("vertex-viewer-measurement-tool")}get hostEl(){return a(this)}static get watchers(){return{selectedMeasurementId:["handleSelectedMeasurementIdChanged"],tool:["handleToolChanged"],viewer:["handleViewerChanged"],disabled:["handleDisabledChanged"],distanceTemplateId:["handleDistanceTemplateIdChanged"],units:["handleUnitsChanged"],fractionalDigits:["handleFractionalDigitsChanged"],snapDistance:["handleSnapDistanceChanged"]}}};o.style=":host{display:block;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none}::slotted(.viewer-measurements__measurement[mode='']){cursor:pointer}::slotted(.viewer-measurements__measurement[mode='edit']){z-index:1}::slotted(.viewer-measurements__measurement[interacting-anchor='start']),::slotted(.viewer-measurements__measurement[interacting-anchor='end']),::slotted(vertex-viewer-measurement-tool[is-measuring]){z-index:2}";export{o as vertex_viewer_measurements}
@@ -0,0 +1,4 @@
1
+ /**!
2
+ * Copyright (c) 2021 Vertex Software LLC. All rights reserved.
3
+ */
4
+ import{a as t,b as e,d as n}from"./p-640cb5f8.js";import{c as r}from"./p-112455b1.js";const i=t=>Object.assign(Error(t.message),{name:t.name,stack:t.stack}),a=t=>({__error_marker:"$$error",message:t.message,name:t.name,stack:t.stack});let s,o={deserialize(t){return(e=t)&&"object"==typeof e&&"__error_marker"in e&&"$$error"===e.__error_marker?i(t):t;var e},serialize:t=>t instanceof Error?a(t):t};function h(t){return o.deserialize(t)}function l(t){return o.serialize(t)}function d(){return s||(s=function(){try{throw new Error}catch(t){const e=(""+t.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(e)return(""+e[0]).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)?\/[^/]+(?:\?.*)?$/,"$1")+"/"}return"/"}()),s}const c="undefined"!=typeof navigator&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:4,u=t=>/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(t);function f(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}let _;function p(){return _||(_=function(){if("undefined"==typeof Worker)return class{constructor(){throw Error("No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn't support workers in workers.")}};class t extends Worker{constructor(t,e){var n,r;"string"==typeof t&&e&&e._baseURL?t=new URL(t,e._baseURL):"string"==typeof t&&!u(t)&&d().match(/^file:\/\//i)&&(t=new URL(t,d().replace(/\/[^\/]+$/,"/")),(null===(n=null==e?void 0:e.CORSWorkaround)||void 0===n||n)&&(t=f(`importScripts(${JSON.stringify(t)});`))),"string"==typeof t&&u(t)&&(null===(r=null==e?void 0:e.CORSWorkaround)||void 0===r||r)&&(t=f(`importScripts(${JSON.stringify(t)});`)),super(t,e)}}class e extends t{constructor(t,e){super(window.URL.createObjectURL(t),e)}static fromText(t,n){const r=new window.Blob([t],{type:"text/javascript"});return new e(r,n)}}return{blob:e,default:t}}()),_}var w=1e3,m=60*w,g=60*m,b=24*g,y=function(t,e){e=e||{};var n=typeof t;if("string"===n&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*n;case"weeks":case"week":case"w":return 6048e5*n;case"days":case"day":case"d":return n*b;case"hours":case"hour":case"hrs":case"hr":case"h":return n*g;case"minutes":case"minute":case"mins":case"min":case"m":return n*m;case"seconds":case"second":case"secs":case"sec":case"s":return n*w;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}(t);if("number"===n&&isFinite(t))return e.long?function(t){var e=Math.abs(t);return e>=b?v(t,e,b,"day"):e>=g?v(t,e,g,"hour"):e>=m?v(t,e,m,"minute"):e>=w?v(t,e,w,"second"):t+" ms"}(t):function(t){var e=Math.abs(t);return e>=b?Math.round(t/b)+"d":e>=g?Math.round(t/g)+"h":e>=m?Math.round(t/m)+"m":e>=w?Math.round(t/w)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function v(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}var k=r((function(t,e){e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(r++,"%c"===t&&(i=r))})),e.splice(i,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t},e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=function(t){function e(t){let r,i,a,s=null;function o(...t){if(!o.enabled)return;const n=o,i=Number(new Date);n.diff=i-(r||i),n.prev=r,n.curr=i,r=i,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let a=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";a++;const s=e.formatters[i];return"function"==typeof s&&(r=s.call(n,t[a]),t.splice(a,1),a--),r})),e.formatArgs.call(n,t),(n.log||e.log).apply(n,t)}return o.namespace=t,o.useColors=e.useColors(),o.color=e.selectColor(t),o.extend=n,o.destroy=e.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==e.namespaces&&(i=e.namespaces,a=e.enabled(t)),a),set:t=>{s=t}}),"function"==typeof e.init&&e.init(o),o}function n(t,n){const r=e(this.namespace+(void 0===n?":":n)+t);return r.log=this.log,r}function r(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){const t=[...e.names.map(r),...e.skips.map(r).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let n;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(t=r[n].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=y,e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((n=>{e[n]=t[n]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let n=0;for(let e=0;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e),n|=0;return e.colors[Math.abs(n)%e.colors.length]},e.enable(e.load()),e}(e);const{formatters:n}=t.exports;n.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}));const E=()=>"function"==typeof Symbol,A=t=>E()&&Boolean(Symbol[t]),x=t=>A(t)?Symbol[t]:"@@"+t;A("asyncIterator")||(Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for("Symbol.asyncIterator"));const C=x("iterator"),U=x("observable"),T=x("species");function R(t,e){const n=t[e];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function z(t){let e=t.constructor;return void 0!==e&&(e=e[T],null===e&&(e=void 0)),void 0!==e?e:Z}function O(t){O.log?O.log(t):setTimeout((()=>{throw t}),0)}function S(t){Promise.resolve().then((()=>{try{t()}catch(t){O(t)}}))}function F(t){const e=t._cleanup;if(void 0!==e&&(t._cleanup=void 0,e))try{if("function"==typeof e)e();else{const t=R(e,"unsubscribe");t&&t.call(e)}}catch(t){O(t)}}function I(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function N(t,e,n){t._state="running";const r=t._observer;try{const i=r?R(r,e):void 0;switch(e){case"next":i&&i.call(r,n);break;case"error":if(I(t),!i)throw n;i.call(r,n);break;case"complete":I(t),i&&i.call(r)}}catch(t){O(t)}"closed"===t._state?F(t):"running"===t._state&&(t._state="ready")}function L(t,e,n){if("closed"!==t._state)return"buffering"===t._state?(t._queue=t._queue||[],void t._queue.push({type:e,value:n})):"ready"!==t._state?(t._state="buffering",t._queue=[{type:e,value:n}],void S((()=>function(t){const e=t._queue;if(e){t._queue=void 0,t._state="ready";for(const n of e)if(N(t,n.type,n.value),"closed"===t._state)break}}(t)))):void N(t,e,n)}class D{constructor(t,e){this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";const n=new B(this);try{this._cleanup=e.call(void 0,n)}catch(t){n.error(t)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(I(this),F(this))}}class B{constructor(t){this._subscription=t}get closed(){return"closed"===this._subscription._state}next(t){L(this._subscription,"next",t)}error(t){L(this._subscription,"error",t)}complete(){L(this._subscription,"complete")}}class Z{constructor(t){if(!(this instanceof Z))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}subscribe(t,e,n){return"object"==typeof t&&null!==t||(t={next:t,error:e,complete:n}),new D(t,this._subscriber)}pipe(t,...e){let n=this;for(const r of[t,...e])n=r(n);return n}tap(t,e,n){const r="object"!=typeof t||null===t?{next:t,error:e,complete:n}:t;return new Z((t=>this.subscribe({next(e){r.next&&r.next(e),t.next(e)},error(e){r.error&&r.error(e),t.error(e)},complete(){r.complete&&r.complete(),t.complete()},start(t){r.start&&r.start(t)}})))}forEach(t){return new Promise(((e,n)=>{if("function"!=typeof t)return void n(new TypeError(t+" is not a function"));function r(){i.unsubscribe(),e(void 0)}const i=this.subscribe({next(e){try{t(e,r)}catch(t){n(t),i.unsubscribe()}},error(t){n(t)},complete(){e(void 0)}})}))}map(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return new(z(this))((e=>this.subscribe({next(n){let r=n;try{r=t(n)}catch(t){return e.error(t)}e.next(r)},error(t){e.error(t)},complete(){e.complete()}})))}filter(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return new(z(this))((e=>this.subscribe({next(n){try{if(!t(n))return}catch(t){return e.error(t)}e.next(n)},error(t){e.error(t)},complete(){e.complete()}})))}reduce(t,e){if("function"!=typeof t)throw new TypeError(t+" is not a function");const n=z(this),r=arguments.length>1;let i=!1,a=e;return new n((e=>this.subscribe({next(n){const s=!i;if(i=!0,!s||r)try{a=t(a,n)}catch(t){return e.error(t)}else a=n},error(t){e.error(t)},complete(){if(!i&&!r)return e.error(new TypeError("Cannot reduce an empty sequence"));e.next(a),e.complete()}})))}concat(...t){const e=z(this);return new e((n=>{let r,i=0;return function a(s){r=s.subscribe({next(t){n.next(t)},error(t){n.error(t)},complete(){i===t.length?(r=void 0,n.complete()):a(e.from(t[i++]))}})}(this),()=>{r&&(r.unsubscribe(),r=void 0)}}))}flatMap(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");const e=z(this);return new e((n=>{const r=[],i=this.subscribe({next(i){let s;if(t)try{s=t(i)}catch(t){return n.error(t)}else s=i;const o=e.from(s).subscribe({next(t){n.next(t)},error(t){n.error(t)},complete(){const t=r.indexOf(o);t>=0&&r.splice(t,1),a()}});r.push(o)},error(t){n.error(t)},complete(){a()}});function a(){i.closed&&0===r.length&&n.complete()}return()=>{r.forEach((t=>t.unsubscribe())),i.unsubscribe()}}))}[U](){return this}static from(t){const e="function"==typeof this?this:Z;if(null==t)throw new TypeError(t+" is not an object");const n=R(t,U);if(n){const r=n.call(t);if(Object(r)!==r)throw new TypeError(r+" is not an object");return function(t){return t instanceof Z}(r)&&r.constructor===e?r:new e((t=>r.subscribe(t)))}if(A("iterator")){const n=R(t,C);if(n)return new e((e=>{S((()=>{if(!e.closed){for(const r of n.call(t))if(e.next(r),e.closed)return;e.complete()}}))}))}if(Array.isArray(t))return new e((e=>{S((()=>{if(!e.closed){for(const n of t)if(e.next(n),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")}static of(...t){return new("function"==typeof this?this:Z)((e=>{S((()=>{if(!e.closed){for(const n of t)if(e.next(n),e.closed)return;e.complete()}}))}))}static get[T](){return this}}E()&&Object.defineProperty(Z,Symbol("extensions"),{value:{symbol:U,hostReportError:O},configurable:!0});class M extends Z{constructor(){super((t=>(this._observers.add(t),()=>this._observers.delete(t)))),this._observers=new Set}next(t){for(const e of this._observers)e.next(t)}error(t){for(const e of this._observers)e.error(t)}complete(){for(const t of this._observers)t.complete()}}function j(t){const e=new M;let n,r=0;return new Z((i=>{n||(n=t.subscribe(e));const a=e.subscribe(i);return r++,()=>{r--,a.unsubscribe(),0===r&&(function(t){"function"==typeof t?t():t&&"function"==typeof t.unsubscribe&&t.unsubscribe()}(n),n=void 0)}}))}function P(t){return Promise.all(t.map((t=>{const e=t=>({status:"fulfilled",value:t}),n=t=>({status:"rejected",reason:t}),r=Promise.resolve(t);try{return r.then(e,n)}catch(t){return Promise.reject(t)}})))}var H;!function(t){t.initialized="initialized",t.taskCanceled="taskCanceled",t.taskCompleted="taskCompleted",t.taskFailed="taskFailed",t.taskQueued="taskQueued",t.taskQueueDrained="taskQueueDrained",t.taskStart="taskStart",t.terminated="terminated"}(H||(H={}));const W=Symbol("thread.errors"),$=Symbol("thread.events"),K=Symbol("thread.terminate"),G=Symbol("thread.transferable"),Y=Symbol("thread.worker");const Q=t=>t[K]();var X=function(t,e,n,r){return new(n||(n=Promise))((function(i,a){function s(t){try{h(r.next(t))}catch(t){a(t)}}function o(t){try{h(r.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,o)}h((r=r.apply(t,e||[])).next())}))};let V=1;class q{constructor(t,e){this.eventSubject=new M,this.initErrors=[],this.isClosing=!1,this.nextTaskID=1,this.taskQueue=[];const n="number"==typeof e?{size:e}:e||{},{size:r=c}=n;var i;this.debug=k(`threads:pool:${i=n.name||String(V++),i.replace(/\W/g," ").trim().replace(/\s+/g,"-")}`),this.options=n,this.workers=function(t,e){return function(t){const e=[];for(let n=0;n<t;n++)e.push(n);return e}(e).map((()=>({init:t(),runningTasks:[]})))}(t,r),this.eventObservable=j(Z.from(this.eventSubject)),Promise.all(this.workers.map((t=>t.init))).then((()=>this.eventSubject.next({type:H.initialized,size:this.workers.length})),(t=>{this.debug("Error while initializing pool worker:",t),this.eventSubject.error(t),this.initErrors.push(t)}))}findIdlingWorker(){const{concurrency:t=1}=this.options;return this.workers.find((e=>e.runningTasks.length<t))}runPoolTask(t,e){return X(this,void 0,void 0,(function*(){const n=this.workers.indexOf(t)+1;this.debug(`Running task #${e.id} on worker #${n}...`),this.eventSubject.next({type:H.taskStart,taskID:e.id,workerID:n});try{const r=yield e.run(yield t.init);this.debug(`Task #${e.id} completed successfully`),this.eventSubject.next({type:H.taskCompleted,returnValue:r,taskID:e.id,workerID:n})}catch(t){this.debug(`Task #${e.id} failed`),this.eventSubject.next({type:H.taskFailed,taskID:e.id,error:t,workerID:n})}}))}run(t,e){return X(this,void 0,void 0,(function*(){const n=(()=>X(this,void 0,void 0,(function*(){yield new Promise((t=>setTimeout(t,0)));try{yield this.runPoolTask(t,e)}finally{t.runningTasks=t.runningTasks.filter((t=>t!==n)),this.isClosing||this.scheduleWork()}})))();t.runningTasks.push(n)}))}scheduleWork(){this.debug("Attempt de-queueing a task in order to run it...");const t=this.findIdlingWorker();if(!t)return;const e=this.taskQueue.shift();if(!e)return this.debug("Task queue is empty"),void this.eventSubject.next({type:H.taskQueueDrained});this.run(t,e)}taskCompletion(t){return new Promise(((e,n)=>{const r=this.events().subscribe((i=>{i.type===H.taskCompleted&&i.taskID===t?(r.unsubscribe(),e(i.returnValue)):i.type===H.taskFailed&&i.taskID===t?(r.unsubscribe(),n(i.error)):i.type===H.terminated&&(r.unsubscribe(),n(Error("Pool has been terminated before task was run.")))}))}))}settled(t=!1){return X(this,void 0,void 0,(function*(){const e=()=>{return t=t=>t.runningTasks,this.workers.reduce(((e,n)=>[...e,...t(n)]),[]);var t},n=[],r=this.eventObservable.subscribe((t=>{t.type===H.taskFailed&&n.push(t.error)}));return this.initErrors.length>0?Promise.reject(this.initErrors[0]):t&&0===this.taskQueue.length?(yield P(e()),n):(yield new Promise(((t,e)=>{const n=this.eventObservable.subscribe({next(e){e.type===H.taskQueueDrained&&(n.unsubscribe(),t(void 0))},error:e})})),yield P(e()),r.unsubscribe(),n)}))}completed(t=!1){return X(this,void 0,void 0,(function*(){const e=this.settled(t),n=new Promise(((t,n)=>{const r=this.eventObservable.subscribe({next(i){i.type===H.taskQueueDrained?(r.unsubscribe(),t(e)):i.type===H.taskFailed&&(r.unsubscribe(),n(i.error))},error:n})})),r=yield Promise.race([e,n]);if(r.length>0)throw r[0]}))}events(){return this.eventObservable}queue(t){const{maxQueuedJobs:e=1/0}=this.options;if(this.isClosing)throw Error("Cannot schedule pool tasks after terminate() has been called.");if(this.initErrors.length>0)throw this.initErrors[0];const n=this.nextTaskID++,r=this.taskCompletion(n);r.catch((t=>{this.debug(`Task #${n} errored:`,t)}));const i={id:n,run:t,cancel:()=>{-1!==this.taskQueue.indexOf(i)&&(this.taskQueue=this.taskQueue.filter((t=>t!==i)),this.eventSubject.next({type:H.taskCanceled,taskID:i.id}))},then:r.then.bind(r)};if(this.taskQueue.length>=e)throw Error("Maximum number of pool tasks queued. Refusing to queue another one.\nThis usually happens for one of two reasons: We are either at peak workload right now or some tasks just won't finish, thus blocking the pool.");return this.debug(`Queueing task #${i.id}...`),this.taskQueue.push(i),this.eventSubject.next({type:H.taskQueued,taskID:i.id}),this.scheduleWork(),i}terminate(t){return X(this,void 0,void 0,(function*(){this.isClosing=!0,t||(yield this.completed(!0)),this.eventSubject.next({type:H.terminated,remainingQueue:[...this.taskQueue]}),this.eventSubject.complete(),yield Promise.all(this.workers.map((t=>X(this,void 0,void 0,(function*(){return Q(yield t.init)})))))}))}}function J(t,e){return new q(t,e)}q.EventType=H,J.EventType=H;const tt=J,et=()=>{};var nt;!function(t){t.internalError="internalError",t.message="message",t.termination="termination"}(nt||(nt={}));const rt=()=>{},it=t=>t,at=t=>Promise.resolve().then(t);function st(t){throw t}class ot extends Z{constructor(t){super((e=>{const n=this,r=Object.assign(Object.assign({},e),{complete(){e.complete(),n.onCompletion()},error(t){e.error(t),n.onError(t)},next(t){e.next(t),n.onNext(t)}});try{return this.initHasRun=!0,t(r)}catch(t){r.error(t)}})),this.initHasRun=!1,this.fulfillmentCallbacks=[],this.rejectionCallbacks=[],this.firstValueSet=!1,this.state="pending"}onNext(t){this.firstValueSet||(this.firstValue=t,this.firstValueSet=!0)}onError(t){this.state="rejected",this.rejection=t;for(const e of this.rejectionCallbacks)at((()=>e(t)))}onCompletion(){this.state="fulfilled";for(const t of this.fulfillmentCallbacks)at((()=>t(this.firstValue)))}then(t,e){const n=t||it,r=e||st;let i=!1;return new Promise(((t,e)=>{const a=n=>{if(!i){i=!0;try{t(r(n))}catch(t){e(t)}}};return this.initHasRun||this.subscribe({error:a}),"fulfilled"===this.state?t(n(this.firstValue)):"rejected"===this.state?(i=!0,t(r(this.rejection))):(this.fulfillmentCallbacks.push((e=>{try{t(n(e))}catch(t){a(t)}})),void this.rejectionCallbacks.push(a))}))}catch(t){return this.then(void 0,t)}finally(t){const e=t||rt;return this.then((t=>(e(),t)),(()=>e()))}static from(t){return function(t){return t&&"function"==typeof t.then}(t)?new ot((e=>{t.then((t=>{e.next(t),e.complete()}),(t=>{e.error(t)}))})):super.from(t)}}function ht(t,e){if(!e){if(!(n=t)||"object"!=typeof n)throw Error();e=[t]}var n;return{[G]:!0,send:t,transferables:e}}var lt,dt;!function(t){t.cancel="cancel",t.run="run"}(lt||(lt={})),function(t){t.error="error",t.init="init",t.result="result",t.running="running",t.uncaughtError="uncaughtError"}(dt||(dt={}));const ct=k("threads:master:messages");let ut=1;function ft(t,e){return(...n)=>{const r=ut++,{args:i,transferables:a}=function(t){if(0===t.length)return{args:[],transferables:[]};const e=[],n=[];for(const i of t)(r=i)&&"object"==typeof r&&r[G]?(e.push(l(i.send)),n.push(...i.transferables)):e.push(l(i));var r,i;return{args:e,transferables:0===n.length?n:(i=n,Array.from(new Set(i)))}}(n),s={type:lt.run,uid:r,method:e,args:i};ct("Sending command to run function to worker:",s);try{t.postMessage(s,a)}catch(t){return ot.from(Promise.reject(t))}return ot.from(j(function(t,e){return new Z((n=>{let r;const i=a=>{var s;if(ct("Message from worker:",a.data),a.data&&a.data.uid===e)if((s=a.data)&&s.type===dt.running)r=a.data.resultType;else if((t=>t&&t.type===dt.result)(a.data))"promise"===r?(void 0!==a.data.payload&&n.next(h(a.data.payload)),n.complete(),t.removeEventListener("message",i)):(a.data.payload&&n.next(h(a.data.payload)),a.data.complete&&(n.complete(),t.removeEventListener("message",i)));else if((t=>t&&t.type===dt.error)(a.data)){const e=h(a.data.error);n.error(e),t.removeEventListener("message",i)}};return t.addEventListener("message",i),()=>{"observable"!==r&&r||t.postMessage({type:lt.cancel,uid:e}),t.removeEventListener("message",i)}}))}(t,r)))}}var _t=function(t,e,n,r){return new(n||(n=Promise))((function(i,a){function s(t){try{h(r.next(t))}catch(t){a(t)}}function o(t){try{h(r.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,o)}h((r=r.apply(t,e||[])).next())}))};const pt=k("threads:master:messages"),wt=k("threads:master:spawn"),mt=k("threads:master:thread-utils"),gt="undefined"!=typeof process&&process.env.THREADS_WORKER_INIT_TIMEOUT?Number.parseInt(process.env.THREADS_WORKER_INIT_TIMEOUT,10):1e4;function bt(t,e,n,r){const i=n.filter((t=>t.type===nt.internalError)).map((t=>t.error));return Object.assign(t,{[W]:i,[$]:n,[K]:r,[Y]:e})}function yt(t,e){return _t(this,void 0,void 0,(function*(){wt("Initializing new thread");const n=e&&e.timeout?e.timeout:gt,r=(yield function(t,e,n){return _t(this,void 0,void 0,(function*(){let r;const i=new Promise(((t,i)=>{r=setTimeout((()=>i(Error(n))),e)})),a=yield Promise.race([t,i]);return clearTimeout(r),a}))}(function(t){return new Promise(((e,n)=>{const r=i=>{var a;pt("Message from worker before finishing initialization:",i.data),(a=i.data)&&"init"===a.type?(t.removeEventListener("message",r),e(i.data)):(t=>t&&"uncaughtError"===t.type)(i.data)&&(t.removeEventListener("message",r),n(h(i.data.error)))};t.addEventListener("message",r)}))}(t),n,`Timeout: Did not receive an init message from worker after ${n}ms. Make sure the worker calls expose().`)).exposed,{termination:i,terminate:a}=function(t){const[e,n]=function(){let t,e=!1,n=et;return[new Promise((r=>{e?r(t):n=r})),r=>{e=!0,t=r,n(t)}]}();return{terminate:()=>_t(this,void 0,void 0,(function*(){mt("Terminating worker"),yield t.terminate(),n()})),termination:e}}(t),s=function(t,e){return new Z((n=>{const r=t=>{n.next({type:nt.message,data:t.data})},i=t=>{mt("Unhandled promise rejection event in thread:",t);const e={type:nt.internalError,error:Error(t.reason)};n.next(e)};t.addEventListener("message",r),t.addEventListener("unhandledrejection",i),e.then((()=>{const e={type:nt.termination};t.removeEventListener("message",r),t.removeEventListener("unhandledrejection",i),n.next(e),n.complete()}))}))}(t,i);if("function"===r.type)return bt(ft(t),t,s,a);if("module"===r.type)return bt(function(t,e){const n={};for(const r of e)n[r]=ft(t,r);return n}(t,r.methods),t,s,a);throw Error(`Worker init message states unexpected type of expose(): ${r.type}`)}))}const vt=p().blob;p();var kt=function(){function r(){this.threads=[],this.pools=[]}return r.prototype.addThread=function(t){this.threads.push(t)},r.prototype.addPool=function(t){this.pools.push(t)},r.prototype.terminate=function(r){return void 0===r&&(r=!1),t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,Promise.all(n(n([],this.threads.map((function(t){return Q(t)}))),this.pools.map((function(t){return t.terminate(r)}))))];case 1:return t.sent(),[2]}}))}))},r}(),Et=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();function At(t,e){var n=Et[e];return null!=n&&t instanceof n}function xt(t){return At(t,"ArrayBuffer")||At(t,"MessagePort")||At(t,"ImageBitmap")||At(t,"OffscreenCanvas")}function Ct(t){return xt(t)?ht(t):null!=t&&"object"==typeof t?ht(t,Ut(t)):t}function Ut(t){if(xt(t))return[t];if("object"==typeof t){if(Array.isArray(t)){var e=[];return t.forEach((function(t){return e.push.apply(e,Ut(t))})),e}return function(t){return At(t,"Int8Array")||At(t,"Uint8Array")||At(t,"Uint8ClampedArray")||At(t,"Int16Array")||At(t,"Uint16Array")||At(t,"Int32Array")||At(t,"Uint32Array")||At(t,"Float32Array")||At(t,"Float64Array")||At(t,"BigInt64Array")||At(t,"BigUint64Array")}(t)?[t.buffer]:null!=t?Object.values(t).reduce((function(t,e){return t.push.apply(t,Ut(e)),t}),[]):[]}return[]}function Tt(){return new kt}function Rt(){return vt.fromText('!function(){"use strict";\n/*! *****************************************************************************\n Copyright (c) Microsoft Corporation.\n\n Permission to use, copy, modify, and/or distribute this software for any\n purpose with or without fee is hereby granted.\n\n THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n PERFORMANCE OF THIS SOFTWARE.\n ***************************************************************************** */function t(t,e,n,i){return new(n||(n=Promise))((function(r,a){function s(t){try{l(i.next(t))}catch(t){a(t)}}function o(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,o)}l((i=i.apply(t,e||[])).next())}))}function e(t,e){var n,i,r,a,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,i=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){s.label=a[1];break}if(6===a[0]&&s.label<r[1]){s.label=r[1],r=a;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(a);break}r[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,o])}}}const n={deserialize:t=>Object.assign(Error(t.message),{name:t.name,stack:t.stack}),serialize:t=>({__error_marker:"$$error",message:t.message,name:t.name,stack:t.stack})};let i={deserialize(t){return(e=t)&&"object"==typeof e&&"__error_marker"in e&&"$$error"===e.__error_marker?n.deserialize(t):t;var e},serialize:t=>t instanceof Error?n.serialize(t):t};function r(t){return i.deserialize(t)}function a(t){return i.serialize(t)}const s=Symbol("thread.transferable");function o(t,e){if(!e){if(!(n=t)||"object"!=typeof n)throw Error();e=[t]}var n;return{[s]:!0,send:t,transferables:e}}var l,h;!function(t){t.cancel="cancel",t.run="run"}(l||(l={})),function(t){t.error="error",t.init="init",t.result="result",t.running="running",t.uncaughtError="uncaughtError"}(h||(h={}));var d=function(){const t="undefined"!=typeof self&&"undefined"!=typeof Window&&self instanceof Window;return!("undefined"==typeof self||!self.postMessage||t)},f=function(t,e){self.postMessage(t,e)},c=function(t){const e=e=>{t(e.data)};return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}},u=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function s(t){try{l(i.next(t))}catch(t){a(t)}}function o(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,o)}l((i=i.apply(t,e||[])).next())}))};let _=!1;const p=new Map,w=t=>t&&t.type===l.run,b=t=>{return!!(e=t)&&("symbol"==typeof Symbol.observable&&"function"==typeof e[Symbol.observable]?e===e[Symbol.observable]():"function"==typeof e["@@observable"]&&e===e["@@observable"]())||function(t){return t&&"object"==typeof t&&"function"==typeof t.subscribe}(t);var e};function g(t){return function(t){return t&&"object"==typeof t&&t[s]}(t)?{payload:t.send,transferables:t.transferables}:{payload:t,transferables:void 0}}function m(t,e){const{payload:n,transferables:i}=g(e),r={type:h.error,uid:t,error:a(n)};f(r,i)}function y(t,e,n){const{payload:i,transferables:r}=g(n),a={type:h.result,uid:t,complete:!!e||void 0,payload:i};f(a,r)}function k(t){try{const e={type:h.uncaughtError,error:a(t)};f(e)}catch(e){console.error("Not reporting uncaught error back to master thread as it occured while reporting an uncaught error already.Latest error:",e,"Original error:",t)}}function v(t,e,n){return u(this,void 0,void 0,(function*(){let i;try{i=e(...n)}catch(e){return m(t,e)}const r=b(i)?"observable":"promise";if(function(t,e){const n={type:h.running,uid:t,resultType:e};f(n)}(t,r),b(i)){const e=i.subscribe((e=>y(t,!1,a(e))),(e=>{m(t,a(e)),p.delete(t)}),(()=>{y(t,!0),p.delete(t)}));p.set(t,e)}else try{const e=yield i;y(t,!0,a(e))}catch(e){m(t,a(e))}}))}function E(t){if(!d())throw Error("expose() called in the master thread.");if(_)throw Error("expose() called more than once. This is not possible. Pass an object to expose() if you want to expose multiple functions.");if(_=!0,"function"==typeof t)c((e=>{w(e)&&!e.method&&v(e.uid,t,e.args.map(r))})),function(){const t={type:h.init,exposed:{type:"function"}};f(t)}();else{if("object"!=typeof t||!t)throw Error(`Invalid argument passed to expose(). Expected a function or an object, got: ${t}`);c((e=>{w(e)&&e.method&&v(e.uid,t[e.method],e.args.map(r))}));!function(t){const e={type:h.init,exposed:{type:"module",methods:t}};f(e)}(Object.keys(t).filter((e=>"function"==typeof t[e])))}c((t=>{if((e=t)&&e.type===l.cancel){const e=t.uid,n=p.get(e);n&&(n.unsubscribe(),p.delete(e))}var e}))}"undefined"!=typeof self&&"function"==typeof self.addEventListener&&d()&&(self.addEventListener("error",(t=>{setTimeout((()=>k(t.error||t)),250)})),self.addEventListener("unhandledrejection",(t=>{const e=t.reason;e&&"string"==typeof e.message&&setTimeout((()=>k(e)),250)}))),"undefined"!=typeof process&&"function"==typeof process.on&&d()&&(process.on("uncaughtException",(t=>{setTimeout((()=>k(t)),250)})),process.on("unhandledRejection",(t=>{t&&"string"==typeof t.message&&setTimeout((()=>k(t)),250)})));var A=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();function x(t,e){var n=A[e];return null!=n&&t instanceof n}function U(t){return x(t,"ArrayBuffer")||x(t,"MessagePort")||x(t,"ImageBitmap")||x(t,"OffscreenCanvas")}function z(t){return U(t)?o(t):null!=t&&"object"==typeof t?o(t,R(t)):t}function R(t){if(U(t))return[t];if("object"==typeof t){if(Array.isArray(t)){var e=[];return t.forEach((function(t){return e.push.apply(e,R(t))})),e}return function(t){return x(t,"Int8Array")||x(t,"Uint8Array")||x(t,"Uint8ClampedArray")||x(t,"Int16Array")||x(t,"Uint16Array")||x(t,"Int32Array")||x(t,"Uint32Array")||x(t,"Float32Array")||x(t,"Float64Array")||x(t,"BigInt64Array")||x(t,"BigUint64Array")}(t)?[t.buffer]:null!=t?Object.values(t).reduce((function(t,e){return t.push.apply(t,R(e)),t}),[]):[]}return[]}!function(t){if(t.TextEncoder&&t.TextDecoder)return!1;function e(t="utf-8"){if("utf-8"!==t)throw new RangeError(`Failed to construct \'TextEncoder\': The encoding label provided (\'${t}\') is invalid.`)}function n(t="utf-8",e={fatal:!1}){if("utf-8"!==t)throw new RangeError(`Failed to construct \'TextDecoder\': The encoding label provided (\'${t}\') is invalid.`);if(e.fatal)throw new Error("Failed to construct \'TextDecoder\': the \'fatal\' option is unsupported.")}Object.defineProperty(e.prototype,"encoding",{value:"utf-8"}),e.prototype.encode=function(t,e={stream:!1}){if(e.stream)throw new Error("Failed to encode: the \'stream\' option is unsupported.");let n=0;const i=t.length;let r=0,a=Math.max(32,i+(i>>1)+7),s=new Uint8Array(a>>3<<3);for(;n<i;){let e=t.charCodeAt(n++);if(e>=55296&&e<=56319){if(n<i){const i=t.charCodeAt(n);56320==(64512&i)&&(++n,e=((1023&e)<<10)+(1023&i)+65536)}if(e>=55296&&e<=56319)continue}if(r+4>s.length){a+=8,a*=1+n/t.length*2,a=a>>3<<3;const e=new Uint8Array(a);e.set(s),s=e}if(0!=(4294967168&e)){if(0==(4294965248&e))s[r++]=e>>6&31|192;else if(0==(4294901760&e))s[r++]=e>>12&15|224,s[r++]=e>>6&63|128;else{if(0!=(4292870144&e))continue;s[r++]=e>>18&7|240,s[r++]=e>>12&63|128,s[r++]=e>>6&63|128}s[r++]=63&e|128}else s[r++]=e}return s.slice(0,r)},Object.defineProperty(n.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(n.prototype,"fatal",{value:!1}),Object.defineProperty(n.prototype,"ignoreBOM",{value:!1}),n.prototype.decode=function(t,e={stream:!1}){if(e.stream)throw new Error("Failed to decode: the \'stream\' option is unsupported.");const n=new Uint8Array(t);let i=0;const r=n.length,a=[];for(;i<r;){const t=n[i++];if(0===t)break;if(0==(128&t))a.push(t);else if(192==(224&t)){const e=63&n[i++];a.push((31&t)<<6|e)}else if(224==(240&t)){const e=63&n[i++],r=63&n[i++];a.push((31&t)<<12|e<<6|r)}else if(240==(248&t)){let e=(7&t)<<18|(63&n[i++])<<12|(63&n[i++])<<6|63&n[i++];e>65535&&(e-=65536,a.push(e>>>10&1023|55296),e=56320|1023&e),a.push(e)}}return String.fromCharCode.apply(null,a)},t.TextEncoder=e,t.TextDecoder=n}("undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0);const L=new TextDecoder("utf-8");const N=new TextEncoder;class O{constructor(t=8192,e={}){let n=!1;"number"==typeof t?t=new ArrayBuffer(t):(n=!0,this.lastWrittenByte=t.byteLength);const i=e.offset?e.offset>>>0:0,r=t.byteLength-i;let a=i;(ArrayBuffer.isView(t)||t instanceof O)&&(t.byteLength!==t.buffer.byteLength&&(a=t.byteOffset+i),t=t.buffer),this.lastWrittenByte=n?r:0,this.buffer=t,this.length=r,this.byteLength=r,this.byteOffset=a,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,a,r),this._mark=0,this._marks=[]}available(t=1){return this.offset+t<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(t=1){return this.offset+=t,this}seek(t){return this.offset=t,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const t=this._marks.pop();if(void 0===t)throw new Error("Mark stack empty");return this.seek(t),this}rewind(){return this.offset=0,this}ensureAvailable(t=1){if(!this.available(t)){const e=2*(this.offset+t),n=new Uint8Array(e);n.set(new Uint8Array(this.buffer)),this.buffer=n.buffer,this.length=this.byteLength=e,this._data=new DataView(this.buffer)}return this}readBoolean(){return 0!==this.readUint8()}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(t=1){const e=new Uint8Array(t);for(let n=0;n<t;n++)e[n]=this.readByte();return e}readInt16(){const t=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,t}readUint16(){const t=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,t}readInt32(){const t=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,t}readUint32(){const t=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat32(){const t=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat64(){const t=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}readChar(){return String.fromCharCode(this.readInt8())}readChars(t=1){let e="";for(let n=0;n<t;n++)e+=this.readChar();return e}readUtf8(t=1){return e=this.readBytes(t),L.decode(e);var e}writeBoolean(t){return this.writeUint8(t?255:0),this}writeInt8(t){return this.ensureAvailable(1),this._data.setInt8(this.offset++,t),this._updateLastWrittenByte(),this}writeUint8(t){return this.ensureAvailable(1),this._data.setUint8(this.offset++,t),this._updateLastWrittenByte(),this}writeByte(t){return this.writeUint8(t)}writeBytes(t){this.ensureAvailable(t.length);for(let e=0;e<t.length;e++)this._data.setUint8(this.offset++,t[e]);return this._updateLastWrittenByte(),this}writeInt16(t){return this.ensureAvailable(2),this._data.setInt16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(t){return this.ensureAvailable(2),this._data.setUint16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(t){return this.ensureAvailable(4),this._data.setInt32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(t){return this.ensureAvailable(4),this._data.setUint32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(t){return this.ensureAvailable(4),this._data.setFloat32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(t){return this.ensureAvailable(8),this._data.setFloat64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(t){return this.writeUint8(t.charCodeAt(0))}writeChars(t){for(let e=0;e<t.length;e++)this.writeUint8(t.charCodeAt(e));return this}writeUtf8(t){return this.writeBytes(function(t){return N.encode(t)}(t))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}\n/*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */function T(t){let e=t.length;for(;--e>=0;)t[e]=0}const S=256,I=286,D=30,B=15,Z=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),C=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),F=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),M=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),H=new Array(576);T(H);const P=new Array(60);T(P);const j=new Array(512);T(j);const W=new Array(256);T(W);const K=new Array(29);T(K);const $=new Array(D);function Y(t,e,n,i,r){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=t&&t.length}let G,X,V;function q(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}T($);const J=t=>t<256?j[t]:j[256+(t>>>7)],Q=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},tt=(t,e,n)=>{t.bi_valid>16-n?(t.bi_buf|=e<<t.bi_valid&65535,Q(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=n-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)},et=(t,e,n)=>{tt(t,n[2*e],n[2*e+1])},nt=(t,e)=>{let n=0;do{n|=1&t,t>>>=1,n<<=1}while(--e>0);return n>>>1},it=(t,e,n)=>{const i=new Array(16);let r,a,s=0;for(r=1;r<=B;r++)i[r]=s=s+n[r-1]<<1;for(a=0;a<=e;a++){let e=t[2*a+1];0!==e&&(t[2*a]=nt(i[e]++,e))}},rt=t=>{let e;for(e=0;e<I;e++)t.dyn_ltree[2*e]=0;for(e=0;e<D;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},at=t=>{t.bi_valid>8?Q(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},st=(t,e,n,i)=>{const r=2*e,a=2*n;return t[r]<t[a]||t[r]===t[a]&&i[e]<=i[n]},ot=(t,e,n)=>{const i=t.heap[n];let r=n<<1;for(;r<=t.heap_len&&(r<t.heap_len&&st(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!st(e,i,t.heap[r],t.depth));)t.heap[n]=t.heap[r],n=r,r<<=1;t.heap[n]=i},lt=(t,e,n)=>{let i,r,a,s,o=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],r=t.pending_buf[t.l_buf+o],o++,0===i?et(t,r,e):(a=W[r],et(t,a+S+1,e),s=Z[a],0!==s&&(r-=K[a],tt(t,r,s)),i--,a=J(i),et(t,a,n),s=C[a],0!==s&&(i-=$[a],tt(t,i,s)))}while(o<t.last_lit);et(t,256,e)},ht=(t,e)=>{const n=e.dyn_tree,i=e.stat_desc.static_tree,r=e.stat_desc.has_stree,a=e.stat_desc.elems;let s,o,l,h=-1;for(t.heap_len=0,t.heap_max=573,s=0;s<a;s++)0!==n[2*s]?(t.heap[++t.heap_len]=h=s,t.depth[s]=0):n[2*s+1]=0;for(;t.heap_len<2;)l=t.heap[++t.heap_len]=h<2?++h:0,n[2*l]=1,t.depth[l]=0,t.opt_len--,r&&(t.static_len-=i[2*l+1]);for(e.max_code=h,s=t.heap_len>>1;s>=1;s--)ot(t,n,s);l=a;do{s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],ot(t,n,1),o=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=o,n[2*l]=n[2*s]+n[2*o],t.depth[l]=(t.depth[s]>=t.depth[o]?t.depth[s]:t.depth[o])+1,n[2*s+1]=n[2*o+1]=l,t.heap[1]=l++,ot(t,n,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const n=e.dyn_tree,i=e.max_code,r=e.stat_desc.static_tree,a=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length;let h,d,f,c,u,_,p=0;for(c=0;c<=B;c++)t.bl_count[c]=0;for(n[2*t.heap[t.heap_max]+1]=0,h=t.heap_max+1;h<573;h++)d=t.heap[h],c=n[2*n[2*d+1]+1]+1,c>l&&(c=l,p++),n[2*d+1]=c,d>i||(t.bl_count[c]++,u=0,d>=o&&(u=s[d-o]),_=n[2*d],t.opt_len+=_*(c+u),a&&(t.static_len+=_*(r[2*d+1]+u)));if(0!==p){do{for(c=l-1;0===t.bl_count[c];)c--;t.bl_count[c]--,t.bl_count[c+1]+=2,t.bl_count[l]--,p-=2}while(p>0);for(c=l;0!==c;c--)for(d=t.bl_count[c];0!==d;)f=t.heap[--h],f>i||(n[2*f+1]!==c&&(t.opt_len+=(c-n[2*f+1])*n[2*f],n[2*f+1]=c),d--)}})(t,e),it(n,h,t.bl_count)},dt=(t,e,n)=>{let i,r,a=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(n+1)+1]=65535,i=0;i<=n;i++)r=s,s=e[2*(i+1)+1],++o<l&&r===s||(o<h?t.bl_tree[2*r]+=o:0!==r?(r!==a&&t.bl_tree[2*r]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,a=r,0===s?(l=138,h=3):r===s?(l=6,h=3):(l=7,h=4))},ft=(t,e,n)=>{let i,r,a=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),i=0;i<=n;i++)if(r=s,s=e[2*(i+1)+1],!(++o<l&&r===s)){if(o<h)do{et(t,r,t.bl_tree)}while(0!=--o);else 0!==r?(r!==a&&(et(t,r,t.bl_tree),o--),et(t,16,t.bl_tree),tt(t,o-3,2)):o<=10?(et(t,17,t.bl_tree),tt(t,o-3,3)):(et(t,18,t.bl_tree),tt(t,o-11,7));o=0,a=r,0===s?(l=138,h=3):r===s?(l=6,h=3):(l=7,h=4)}};let ct=!1;const ut=(t,e,n,i)=>{tt(t,0+(i?1:0),3),((t,e,n,i)=>{at(t),i&&(Q(t,n),Q(t,~n)),t.pending_buf.set(t.window.subarray(e,e+n),t.pending),t.pending+=n})(t,e,n,!0)};var _t=(t,e,n,i)=>{let r,a,s=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<S;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),ht(t,t.l_desc),ht(t,t.d_desc),s=(t=>{let e;for(dt(t,t.dyn_ltree,t.l_desc.max_code),dt(t,t.dyn_dtree,t.d_desc.max_code),ht(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*M[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),r=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=r&&(r=a)):r=a=n+5,n+4<=r&&-1!==e?ut(t,e,n,i):4===t.strategy||a===r?(tt(t,2+(i?1:0),3),lt(t,H,P)):(tt(t,4+(i?1:0),3),((t,e,n,i)=>{let r;for(tt(t,e-257,5),tt(t,n-1,5),tt(t,i-4,4),r=0;r<i;r++)tt(t,t.bl_tree[2*M[r]+1],3);ft(t,t.dyn_ltree,e-1),ft(t,t.dyn_dtree,n-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),lt(t,t.dyn_ltree,t.dyn_dtree)),rt(t),i&&at(t)},pt={_tr_init:t=>{ct||((()=>{let t,e,n,i,r;const a=new Array(16);for(n=0,i=0;i<28;i++)for(K[i]=n,t=0;t<1<<Z[i];t++)W[n++]=i;for(W[n-1]=i,r=0,i=0;i<16;i++)for($[i]=r,t=0;t<1<<C[i];t++)j[r++]=i;for(r>>=7;i<D;i++)for($[i]=r<<7,t=0;t<1<<C[i]-7;t++)j[256+r++]=i;for(e=0;e<=B;e++)a[e]=0;for(t=0;t<=143;)H[2*t+1]=8,t++,a[8]++;for(;t<=255;)H[2*t+1]=9,t++,a[9]++;for(;t<=279;)H[2*t+1]=7,t++,a[7]++;for(;t<=287;)H[2*t+1]=8,t++,a[8]++;for(it(H,287,a),t=0;t<D;t++)P[2*t+1]=5,P[2*t]=nt(t,5);G=new Y(H,Z,257,I,B),X=new Y(P,C,0,D,B),V=new Y(new Array(0),F,0,19,7)})(),ct=!0),t.l_desc=new q(t.dyn_ltree,G),t.d_desc=new q(t.dyn_dtree,X),t.bl_desc=new q(t.bl_tree,V),t.bi_buf=0,t.bi_valid=0,rt(t)},_tr_stored_block:ut,_tr_flush_block:_t,_tr_tally:(t,e,n)=>(t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(W[n]+S+1)]++,t.dyn_dtree[2*J(e)]++),t.last_lit===t.lit_bufsize-1),_tr_align:t=>{tt(t,2,3),et(t,256,H),(t=>{16===t.bi_valid?(Q(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var wt=(t,e,n,i)=>{let r=65535&t|0,a=t>>>16&65535|0,s=0;for(;0!==n;){s=n>2e3?2e3:n,n-=s;do{r=r+e[i++]|0,a=a+r|0}while(--s);r%=65521,a%=65521}return r|a<<16|0};const bt=new Uint32Array((()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e})());var gt=(t,e,n,i)=>{const r=bt,a=i+n;t^=-1;for(let n=i;n<a;n++)t=t>>>8^r[255&(t^e[n])];return-1^t},mt={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},yt={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:kt,_tr_stored_block:vt,_tr_flush_block:Et,_tr_tally:At,_tr_align:xt}=pt,{Z_NO_FLUSH:Ut,Z_PARTIAL_FLUSH:zt,Z_FULL_FLUSH:Rt,Z_FINISH:Lt,Z_BLOCK:Nt,Z_OK:Ot,Z_STREAM_END:Tt,Z_STREAM_ERROR:St,Z_DATA_ERROR:It,Z_BUF_ERROR:Dt,Z_DEFAULT_COMPRESSION:Bt,Z_FILTERED:Zt,Z_HUFFMAN_ONLY:Ct,Z_RLE:Ft,Z_FIXED:Mt,Z_DEFAULT_STRATEGY:Ht,Z_UNKNOWN:Pt,Z_DEFLATED:jt}=yt,Wt=258,Kt=262,$t=103,Yt=113,Gt=666,Xt=(t,e)=>(t.msg=mt[e],e),Vt=t=>(t<<1)-(t>4?9:0),qt=t=>{let e=t.length;for(;--e>=0;)t[e]=0};let Jt=(t,e,n)=>(e<<t.hash_shift^n)&t.hash_mask;const Qt=t=>{const e=t.state;let n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+n),t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))},te=(t,e)=>{Et(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Qt(t.strm)},ee=(t,e)=>{t.pending_buf[t.pending++]=e},ne=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},ie=(t,e,n,i)=>{let r=t.avail_in;return r>i&&(r=i),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),n),1===t.state.wrap?t.adler=wt(t.adler,e,r,n):2===t.state.wrap&&(t.adler=gt(t.adler,e,r,n)),t.next_in+=r,t.total_in+=r,r)},re=(t,e)=>{let n,i,r=t.max_chain_length,a=t.strstart,s=t.prev_length,o=t.nice_match;const l=t.strstart>t.w_size-Kt?t.strstart-(t.w_size-Kt):0,h=t.window,d=t.w_mask,f=t.prev,c=t.strstart+Wt;let u=h[a+s-1],_=h[a+s];t.prev_length>=t.good_match&&(r>>=2),o>t.lookahead&&(o=t.lookahead);do{if(n=e,h[n+s]===_&&h[n+s-1]===u&&h[n]===h[a]&&h[++n]===h[a+1]){a+=2,n++;do{}while(h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&a<c);if(i=Wt-(c-a),a=c-Wt,i>s){if(t.match_start=e,s=i,i>=o)break;u=h[a+s-1],_=h[a+s]}}}while((e=f[e&d])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead},ae=t=>{const e=t.w_size;let n,i,r,a,s;do{if(a=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Kt)){t.window.set(t.window.subarray(e,e+e),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,i=t.hash_size,n=i;do{r=t.head[--n],t.head[n]=r>=e?r-e:0}while(--i);i=e,n=i;do{r=t.prev[--n],t.prev[n]=r>=e?r-e:0}while(--i);a+=e}if(0===t.strm.avail_in)break;if(i=ie(t.strm,t.window,t.strstart+t.lookahead,a),t.lookahead+=i,t.lookahead+t.insert>=3)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=Jt(t,t.ins_h,t.window[s+1]);t.insert&&(t.ins_h=Jt(t,t.ins_h,t.window[s+3-1]),t.prev[s&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=s,s++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<Kt&&0!==t.strm.avail_in)},se=(t,e)=>{let n,i;for(;;){if(t.lookahead<Kt){if(ae(t),t.lookahead<Kt&&e===Ut)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=Jt(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-Kt&&(t.match_length=re(t,n)),t.match_length>=3)if(i=At(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=Jt(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Jt(t,t.ins_h,t.window[t.strstart+1]);else i=At(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(te(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===Lt?(te(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(te(t,!1),0===t.strm.avail_out)?1:2},oe=(t,e)=>{let n,i,r;for(;;){if(t.lookahead<Kt){if(ae(t),t.lookahead<Kt&&e===Ut)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=Jt(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-Kt&&(t.match_length=re(t,n),t.match_length<=5&&(t.strategy===Zt||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,i=At(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=Jt(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(te(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=At(t,0,t.window[t.strstart-1]),i&&te(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=At(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===Lt?(te(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(te(t,!1),0===t.strm.avail_out)?1:2};function le(t,e,n,i,r){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=i,this.func=r}const he=[new le(0,0,0,0,((t,e)=>{let n=65535;for(n>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ae(t),0===t.lookahead&&e===Ut)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;const i=t.block_start+n;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,te(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-Kt&&(te(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Lt?(te(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(te(t,!1),t.strm.avail_out),1)})),new le(4,4,8,4,se),new le(4,5,16,8,se),new le(4,6,32,32,se),new le(4,4,16,16,oe),new le(8,16,32,32,oe),new le(8,16,128,128,oe),new le(8,32,128,256,oe),new le(32,128,258,1024,oe),new le(32,258,258,4096,oe)];function de(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=jt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),qt(this.dyn_ltree),qt(this.dyn_dtree),qt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),qt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),qt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const fe=t=>{if(!t||!t.state)return Xt(t,St);t.total_in=t.total_out=0,t.data_type=Pt;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:Yt,t.adler=2===e.wrap?0:1,e.last_flush=Ut,kt(e),Ot},ce=t=>{const e=fe(t);var n;return e===Ot&&((n=t.state).window_size=2*n.w_size,qt(n.head),n.max_lazy_match=he[n.level].max_lazy,n.good_match=he[n.level].good_length,n.nice_match=he[n.level].nice_length,n.max_chain_length=he[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=2,n.match_available=0,n.ins_h=0),e},ue=(t,e,n,i,r,a)=>{if(!t)return St;let s=1;if(e===Bt&&(e=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),r<1||r>9||n!==jt||i<8||i>15||e<0||e>9||a<0||a>Mt)return Xt(t,St);8===i&&(i=9);const o=new de;return t.state=o,o.strm=t,o.wrap=s,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=r+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<r+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=e,o.strategy=a,o.method=n,ce(t)};var _e={deflateInit:(t,e)=>ue(t,e,jt,15,8,Ht),deflateInit2:ue,deflateReset:ce,deflateResetKeep:fe,deflateSetHeader:(t,e)=>t&&t.state?2!==t.state.wrap?St:(t.state.gzhead=e,Ot):St,deflate:(t,e)=>{let n,i;if(!t||!t.state||e>Nt||e<0)return t?Xt(t,St):St;const r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===Gt&&e!==Lt)return Xt(t,0===t.avail_out?Dt:St);r.strm=t;const a=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,ee(r,31),ee(r,139),ee(r,8),r.gzhead?(ee(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),ee(r,255&r.gzhead.time),ee(r,r.gzhead.time>>8&255),ee(r,r.gzhead.time>>16&255),ee(r,r.gzhead.time>>24&255),ee(r,9===r.level?2:r.strategy>=Ct||r.level<2?4:0),ee(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(ee(r,255&r.gzhead.extra.length),ee(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=gt(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(ee(r,0),ee(r,0),ee(r,0),ee(r,0),ee(r,0),ee(r,9===r.level?2:r.strategy>=Ct||r.level<2?4:0),ee(r,3),r.status=Yt);else{let e=jt+(r.w_bits-8<<4)<<8,n=-1;n=r.strategy>=Ct||r.level<2?0:r.level<6?1:6===r.level?2:3,e|=n<<6,0!==r.strstart&&(e|=32),e+=31-e%31,r.status=Yt,ne(r,e),0!==r.strstart&&(ne(r,t.adler>>>16),ne(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(n=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>n&&(t.adler=gt(t.adler,r.pending_buf,r.pending-n,n)),Qt(t),n=r.pending,r.pending!==r.pending_buf_size));)ee(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>n&&(t.adler=gt(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){n=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>n&&(t.adler=gt(t.adler,r.pending_buf,r.pending-n,n)),Qt(t),n=r.pending,r.pending===r.pending_buf_size)){i=1;break}i=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,ee(r,i)}while(0!==i);r.gzhead.hcrc&&r.pending>n&&(t.adler=gt(t.adler,r.pending_buf,r.pending-n,n)),0===i&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){n=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>n&&(t.adler=gt(t.adler,r.pending_buf,r.pending-n,n)),Qt(t),n=r.pending,r.pending===r.pending_buf_size)){i=1;break}i=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,ee(r,i)}while(0!==i);r.gzhead.hcrc&&r.pending>n&&(t.adler=gt(t.adler,r.pending_buf,r.pending-n,n)),0===i&&(r.status=$t)}else r.status=$t;if(r.status===$t&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Qt(t),r.pending+2<=r.pending_buf_size&&(ee(r,255&t.adler),ee(r,t.adler>>8&255),t.adler=0,r.status=Yt)):r.status=Yt),0!==r.pending){if(Qt(t),0===t.avail_out)return r.last_flush=-1,Ot}else if(0===t.avail_in&&Vt(e)<=Vt(a)&&e!==Lt)return Xt(t,Dt);if(r.status===Gt&&0!==t.avail_in)return Xt(t,Dt);if(0!==t.avail_in||0!==r.lookahead||e!==Ut&&r.status!==Gt){let n=r.strategy===Ct?((t,e)=>{let n;for(;;){if(0===t.lookahead&&(ae(t),0===t.lookahead)){if(e===Ut)return 1;break}if(t.match_length=0,n=At(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(te(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Lt?(te(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(te(t,!1),0===t.strm.avail_out)?1:2})(r,e):r.strategy===Ft?((t,e)=>{let n,i,r,a;const s=t.window;for(;;){if(t.lookahead<=Wt){if(ae(t),t.lookahead<=Wt&&e===Ut)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(r=t.strstart-1,i=s[r],i===s[++r]&&i===s[++r]&&i===s[++r])){a=t.strstart+Wt;do{}while(i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&r<a);t.match_length=Wt-(a-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(n=At(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=At(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(te(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Lt?(te(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(te(t,!1),0===t.strm.avail_out)?1:2})(r,e):he[r.level].func(r,e);if(3!==n&&4!==n||(r.status=Gt),1===n||3===n)return 0===t.avail_out&&(r.last_flush=-1),Ot;if(2===n&&(e===zt?xt(r):e!==Nt&&(vt(r,0,0,!1),e===Rt&&(qt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),Qt(t),0===t.avail_out))return r.last_flush=-1,Ot}return e!==Lt?Ot:r.wrap<=0?Tt:(2===r.wrap?(ee(r,255&t.adler),ee(r,t.adler>>8&255),ee(r,t.adler>>16&255),ee(r,t.adler>>24&255),ee(r,255&t.total_in),ee(r,t.total_in>>8&255),ee(r,t.total_in>>16&255),ee(r,t.total_in>>24&255)):(ne(r,t.adler>>>16),ne(r,65535&t.adler)),Qt(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?Ot:Tt)},deflateEnd:t=>{if(!t||!t.state)return St;const e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==$t&&e!==Yt&&e!==Gt?Xt(t,St):(t.state=null,e===Yt?Xt(t,It):Ot)},deflateSetDictionary:(t,e)=>{let n=e.length;if(!t||!t.state)return St;const i=t.state,r=i.wrap;if(2===r||1===r&&42!==i.status||i.lookahead)return St;if(1===r&&(t.adler=wt(t.adler,e,n,0)),i.wrap=0,n>=i.w_size){0===r&&(qt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(n-i.w_size,n),0),e=t,n=i.w_size}const a=t.avail_in,s=t.next_in,o=t.input;for(t.avail_in=n,t.next_in=0,t.input=e,ae(i);i.lookahead>=3;){let t=i.strstart,e=i.lookahead-2;do{i.ins_h=Jt(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=2,ae(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=s,t.input=o,t.avail_in=a,i.wrap=r,Ot},deflateInfo:"pako deflate (from Nodeca project)"};const pe=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var we=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const e in n)pe(n,e)&&(t[e]=n[e])}}return t},be=t=>{let e=0;for(let n=0,i=t.length;n<i;n++)e+=t[n].length;const n=new Uint8Array(e);for(let e=0,i=0,r=t.length;e<r;e++){let r=t[e];n.set(r,i),i+=r.length}return n};let ge=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){ge=!1}const me=new Uint8Array(256);for(let t=0;t<256;t++)me[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;me[254]=me[254]=1;var ye=t=>{let e,n,i,r,a,s=t.length,o=0;for(r=0;r<s;r++)n=t.charCodeAt(r),55296==(64512&n)&&r+1<s&&(i=t.charCodeAt(r+1),56320==(64512&i)&&(n=65536+(n-55296<<10)+(i-56320),r++)),o+=n<128?1:n<2048?2:n<65536?3:4;for(e=new Uint8Array(o),a=0,r=0;a<o;r++)n=t.charCodeAt(r),55296==(64512&n)&&r+1<s&&(i=t.charCodeAt(r+1),56320==(64512&i)&&(n=65536+(n-55296<<10)+(i-56320),r++)),n<128?e[a++]=n:n<2048?(e[a++]=192|n>>>6,e[a++]=128|63&n):n<65536?(e[a++]=224|n>>>12,e[a++]=128|n>>>6&63,e[a++]=128|63&n):(e[a++]=240|n>>>18,e[a++]=128|n>>>12&63,e[a++]=128|n>>>6&63,e[a++]=128|63&n);return e},ke=(t,e)=>{let n,i;const r=e||t.length,a=new Array(2*r);for(i=0,n=0;n<r;){let e=t[n++];if(e<128){a[i++]=e;continue}let s=me[e];if(s>4)a[i++]=65533,n+=s-1;else{for(e&=2===s?31:3===s?15:7;s>1&&n<r;)e=e<<6|63&t[n++],s--;s>1?a[i++]=65533:e<65536?a[i++]=e:(e-=65536,a[i++]=55296|e>>10&1023,a[i++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&ge)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let i=0;i<e;i++)n+=String.fromCharCode(t[i]);return n})(a,i)},ve=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let n=e-1;for(;n>=0&&128==(192&t[n]);)n--;return n<0||0===n?e:n+me[t[n]]>e?n:e};var Ee=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Ae=Object.prototype.toString,{Z_NO_FLUSH:xe,Z_SYNC_FLUSH:Ue,Z_FULL_FLUSH:ze,Z_FINISH:Re,Z_OK:Le,Z_STREAM_END:Ne,Z_DEFAULT_COMPRESSION:Oe,Z_DEFAULT_STRATEGY:Te,Z_DEFLATED:Se}=yt;function Ie(t){this.options=we({level:Oe,method:Se,chunkSize:16384,windowBits:15,memLevel:8,strategy:Te},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ee,this.strm.avail_out=0;let n=_e.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==Le)throw new Error(mt[n]);if(e.header&&_e.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?ye(e.dictionary):"[object ArrayBuffer]"===Ae.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,n=_e.deflateSetDictionary(this.strm,t),n!==Le)throw new Error(mt[n]);this._dict_set=!0}}Ie.prototype.push=function(t,e){const n=this.strm,i=this.options.chunkSize;let r,a;if(this.ended)return!1;for(a=e===~~e?e:!0===e?Re:xe,"string"==typeof t?n.input=ye(t):"[object ArrayBuffer]"===Ae.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),(a===Ue||a===ze)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(r=_e.deflate(n,a),r===Ne)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),r=_e.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Le;if(0!==n.avail_out){if(a>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},Ie.prototype.onData=function(t){this.chunks.push(t)},Ie.prototype.onEnd=function(t){t===Le&&(this.result=be(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var De=function(t,e){let n,i,r,a,s,o,l,h,d,f,c,u,_,p,w,b,g,m,y,k,v,E,A,x;const U=t.state;n=t.next_in,A=t.input,i=n+(t.avail_in-5),r=t.next_out,x=t.output,a=r-(e-t.avail_out),s=r+(t.avail_out-257),o=U.dmax,l=U.wsize,h=U.whave,d=U.wnext,f=U.window,c=U.hold,u=U.bits,_=U.lencode,p=U.distcode,w=(1<<U.lenbits)-1,b=(1<<U.distbits)-1;t:do{u<15&&(c+=A[n++]<<u,u+=8,c+=A[n++]<<u,u+=8),g=_[c&w];e:for(;;){if(m=g>>>24,c>>>=m,u-=m,m=g>>>16&255,0===m)x[r++]=65535&g;else{if(!(16&m)){if(0==(64&m)){g=_[(65535&g)+(c&(1<<m)-1)];continue e}if(32&m){U.mode=12;break t}t.msg="invalid literal/length code",U.mode=30;break t}y=65535&g,m&=15,m&&(u<m&&(c+=A[n++]<<u,u+=8),y+=c&(1<<m)-1,c>>>=m,u-=m),u<15&&(c+=A[n++]<<u,u+=8,c+=A[n++]<<u,u+=8),g=p[c&b];n:for(;;){if(m=g>>>24,c>>>=m,u-=m,m=g>>>16&255,!(16&m)){if(0==(64&m)){g=p[(65535&g)+(c&(1<<m)-1)];continue n}t.msg="invalid distance code",U.mode=30;break t}if(k=65535&g,m&=15,u<m&&(c+=A[n++]<<u,u+=8,u<m&&(c+=A[n++]<<u,u+=8)),k+=c&(1<<m)-1,k>o){t.msg="invalid distance too far back",U.mode=30;break t}if(c>>>=m,u-=m,m=r-a,k>m){if(m=k-m,m>h&&U.sane){t.msg="invalid distance too far back",U.mode=30;break t}if(v=0,E=f,0===d){if(v+=l-m,m<y){y-=m;do{x[r++]=f[v++]}while(--m);v=r-k,E=x}}else if(d<m){if(v+=l+d-m,m-=d,m<y){y-=m;do{x[r++]=f[v++]}while(--m);if(v=0,d<y){m=d,y-=m;do{x[r++]=f[v++]}while(--m);v=r-k,E=x}}}else if(v+=d-m,m<y){y-=m;do{x[r++]=f[v++]}while(--m);v=r-k,E=x}for(;y>2;)x[r++]=E[v++],x[r++]=E[v++],x[r++]=E[v++],y-=3;y&&(x[r++]=E[v++],y>1&&(x[r++]=E[v++]))}else{v=r-k;do{x[r++]=x[v++],x[r++]=x[v++],x[r++]=x[v++],y-=3}while(y>2);y&&(x[r++]=x[v++],y>1&&(x[r++]=x[v++]))}break}}break}}while(n<i&&r<s);y=u>>3,n-=y,u-=y<<3,c&=(1<<u)-1,t.next_in=n,t.next_out=r,t.avail_in=n<i?i-n+5:5-(n-i),t.avail_out=r<s?s-r+257:257-(r-s),U.hold=c,U.bits=u};const Be=15,Ze=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Ce=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Fe=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Me=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var He=(t,e,n,i,r,a,s,o)=>{const l=o.bits;let h,d,f,c,u,_,p=0,w=0,b=0,g=0,m=0,y=0,k=0,v=0,E=0,A=0,x=null,U=0;const z=new Uint16Array(16),R=new Uint16Array(16);let L,N,O,T=null,S=0;for(p=0;p<=Be;p++)z[p]=0;for(w=0;w<i;w++)z[e[n+w]]++;for(m=l,g=Be;g>=1&&0===z[g];g--);if(m>g&&(m=g),0===g)return r[a++]=20971520,r[a++]=20971520,o.bits=1,0;for(b=1;b<g&&0===z[b];b++);for(m<b&&(m=b),v=1,p=1;p<=Be;p++)if(v<<=1,v-=z[p],v<0)return-1;if(v>0&&(0===t||1!==g))return-1;for(R[1]=0,p=1;p<Be;p++)R[p+1]=R[p]+z[p];for(w=0;w<i;w++)0!==e[n+w]&&(s[R[e[n+w]]++]=w);if(0===t?(x=T=s,_=19):1===t?(x=Ze,U-=257,T=Ce,S-=257,_=256):(x=Fe,T=Me,_=-1),A=0,w=0,p=b,u=a,y=m,k=0,f=-1,E=1<<m,c=E-1,1===t&&E>852||2===t&&E>592)return 1;for(;;){L=p-k,s[w]<_?(N=0,O=s[w]):s[w]>_?(N=T[S+s[w]],O=x[U+s[w]]):(N=96,O=0),h=1<<p-k,d=1<<y,b=d;do{d-=h,r[u+(A>>k)+d]=L<<24|N<<16|O|0}while(0!==d);for(h=1<<p-1;A&h;)h>>=1;if(0!==h?(A&=h-1,A+=h):A=0,w++,0==--z[p]){if(p===g)break;p=e[n+s[w]]}if(p>m&&(A&c)!==f){for(0===k&&(k=m),u+=b,y=p-k,v=1<<y;y+k<g&&(v-=z[y+k],!(v<=0));)y++,v<<=1;if(E+=1<<y,1===t&&E>852||2===t&&E>592)return 1;f=A&c,r[f]=m<<24|y<<16|u-a|0}}return 0!==A&&(r[u+A]=p-k<<24|64<<16|0),o.bits=m,0};const{Z_FINISH:Pe,Z_BLOCK:je,Z_TREES:We,Z_OK:Ke,Z_STREAM_END:$e,Z_NEED_DICT:Ye,Z_STREAM_ERROR:Ge,Z_DATA_ERROR:Xe,Z_MEM_ERROR:Ve,Z_BUF_ERROR:qe,Z_DEFLATED:Je}=yt,Qe=12,tn=30,en=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function nn(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const rn=t=>{if(!t||!t.state)return Ge;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,Ke},an=t=>{if(!t||!t.state)return Ge;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,rn(t)},sn=(t,e)=>{let n;if(!t||!t.state)return Ge;const i=t.state;return e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?Ge:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=n,i.wbits=e,an(t))},on=(t,e)=>{if(!t)return Ge;const n=new nn;t.state=n,n.window=null;const i=sn(t,e);return i!==Ke&&(t.state=null),i};let ln,hn,dn=!0;const fn=t=>{if(dn){ln=new Int32Array(512),hn=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(He(1,t.lens,0,288,ln,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;He(2,t.lens,0,32,hn,0,t.work,{bits:5}),dn=!1}t.lencode=ln,t.lenbits=9,t.distcode=hn,t.distbits=5},cn=(t,e,n,i)=>{let r;const a=t.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),i>=a.wsize?(a.window.set(e.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(r=a.wsize-a.wnext,r>i&&(r=i),a.window.set(e.subarray(n-i,n-i+r),a.wnext),(i-=r)?(a.window.set(e.subarray(n-i,n),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=r,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=r))),0};var un={inflateReset:an,inflateReset2:sn,inflateResetKeep:rn,inflateInit:t=>on(t,15),inflateInit2:on,inflate:(t,e)=>{let n,i,r,a,s,o,l,h,d,f,c,u,_,p,w,b,g,m,y,k,v,E,A=0;const x=new Uint8Array(4);let U,z;const R=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return Ge;n=t.state,n.mode===Qe&&(n.mode=13),s=t.next_out,r=t.output,l=t.avail_out,a=t.next_in,i=t.input,o=t.avail_in,h=n.hold,d=n.bits,f=o,c=l,E=Ke;t:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;d<16;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}if(2&n.wrap&&35615===h){n.check=0,x[0]=255&h,x[1]=h>>>8&255,n.check=gt(n.check,x,2,0),h=0,d=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",n.mode=tn;break}if((15&h)!==Je){t.msg="unknown compression method",n.mode=tn;break}if(h>>>=4,d-=4,v=8+(15&h),0===n.wbits)n.wbits=v;else if(v>n.wbits){t.msg="invalid window size",n.mode=tn;break}n.dmax=1<<n.wbits,t.adler=n.check=1,n.mode=512&h?10:Qe,h=0,d=0;break;case 2:for(;d<16;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}if(n.flags=h,(255&n.flags)!==Je){t.msg="unknown compression method",n.mode=tn;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=tn;break}n.head&&(n.head.text=h>>8&1),512&n.flags&&(x[0]=255&h,x[1]=h>>>8&255,n.check=gt(n.check,x,2,0)),h=0,d=0,n.mode=3;case 3:for(;d<32;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}n.head&&(n.head.time=h),512&n.flags&&(x[0]=255&h,x[1]=h>>>8&255,x[2]=h>>>16&255,x[3]=h>>>24&255,n.check=gt(n.check,x,4,0)),h=0,d=0,n.mode=4;case 4:for(;d<16;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}n.head&&(n.head.xflags=255&h,n.head.os=h>>8),512&n.flags&&(x[0]=255&h,x[1]=h>>>8&255,n.check=gt(n.check,x,2,0)),h=0,d=0,n.mode=5;case 5:if(1024&n.flags){for(;d<16;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}n.length=h,n.head&&(n.head.extra_len=h),512&n.flags&&(x[0]=255&h,x[1]=h>>>8&255,n.check=gt(n.check,x,2,0)),h=0,d=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(u=n.length,u>o&&(u=o),u&&(n.head&&(v=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(i.subarray(a,a+u),v)),512&n.flags&&(n.check=gt(n.check,i,u,a)),o-=u,a+=u,n.length-=u),n.length))break t;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===o)break t;u=0;do{v=i[a+u++],n.head&&v&&n.length<65536&&(n.head.name+=String.fromCharCode(v))}while(v&&u<o);if(512&n.flags&&(n.check=gt(n.check,i,u,a)),o-=u,a+=u,v)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===o)break t;u=0;do{v=i[a+u++],n.head&&v&&n.length<65536&&(n.head.comment+=String.fromCharCode(v))}while(v&&u<o);if(512&n.flags&&(n.check=gt(n.check,i,u,a)),o-=u,a+=u,v)break t}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;d<16;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}if(h!==(65535&n.check)){t.msg="header crc mismatch",n.mode=tn;break}h=0,d=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=Qe;break;case 10:for(;d<32;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}t.adler=n.check=en(h),h=0,d=0,n.mode=11;case 11:if(0===n.havedict)return t.next_out=s,t.avail_out=l,t.next_in=a,t.avail_in=o,n.hold=h,n.bits=d,Ye;t.adler=n.check=1,n.mode=Qe;case Qe:if(e===je||e===We)break t;case 13:if(n.last){h>>>=7&d,d-=7&d,n.mode=27;break}for(;d<3;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}switch(n.last=1&h,h>>>=1,d-=1,3&h){case 0:n.mode=14;break;case 1:if(fn(n),n.mode=20,e===We){h>>>=2,d-=2;break t}break;case 2:n.mode=17;break;case 3:t.msg="invalid block type",n.mode=tn}h>>>=2,d-=2;break;case 14:for(h>>>=7&d,d-=7&d;d<32;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}if((65535&h)!=(h>>>16^65535)){t.msg="invalid stored block lengths",n.mode=tn;break}if(n.length=65535&h,h=0,d=0,n.mode=15,e===We)break t;case 15:n.mode=16;case 16:if(u=n.length,u){if(u>o&&(u=o),u>l&&(u=l),0===u)break t;r.set(i.subarray(a,a+u),s),o-=u,a+=u,l-=u,s+=u,n.length-=u;break}n.mode=Qe;break;case 17:for(;d<14;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}if(n.nlen=257+(31&h),h>>>=5,d-=5,n.ndist=1+(31&h),h>>>=5,d-=5,n.ncode=4+(15&h),h>>>=4,d-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=tn;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;d<3;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}n.lens[R[n.have++]]=7&h,h>>>=3,d-=3}for(;n.have<19;)n.lens[R[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,U={bits:n.lenbits},E=He(0,n.lens,0,19,n.lencode,0,n.work,U),n.lenbits=U.bits,E){t.msg="invalid code lengths set",n.mode=tn;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;A=n.lencode[h&(1<<n.lenbits)-1],w=A>>>24,b=A>>>16&255,g=65535&A,!(w<=d);){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}if(g<16)h>>>=w,d-=w,n.lens[n.have++]=g;else{if(16===g){for(z=w+2;d<z;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}if(h>>>=w,d-=w,0===n.have){t.msg="invalid bit length repeat",n.mode=tn;break}v=n.lens[n.have-1],u=3+(3&h),h>>>=2,d-=2}else if(17===g){for(z=w+3;d<z;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}h>>>=w,d-=w,v=0,u=3+(7&h),h>>>=3,d-=3}else{for(z=w+7;d<z;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}h>>>=w,d-=w,v=0,u=11+(127&h),h>>>=7,d-=7}if(n.have+u>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=tn;break}for(;u--;)n.lens[n.have++]=v}}if(n.mode===tn)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=tn;break}if(n.lenbits=9,U={bits:n.lenbits},E=He(1,n.lens,0,n.nlen,n.lencode,0,n.work,U),n.lenbits=U.bits,E){t.msg="invalid literal/lengths set",n.mode=tn;break}if(n.distbits=6,n.distcode=n.distdyn,U={bits:n.distbits},E=He(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,U),n.distbits=U.bits,E){t.msg="invalid distances set",n.mode=tn;break}if(n.mode=20,e===We)break t;case 20:n.mode=21;case 21:if(o>=6&&l>=258){t.next_out=s,t.avail_out=l,t.next_in=a,t.avail_in=o,n.hold=h,n.bits=d,De(t,c),s=t.next_out,r=t.output,l=t.avail_out,a=t.next_in,i=t.input,o=t.avail_in,h=n.hold,d=n.bits,n.mode===Qe&&(n.back=-1);break}for(n.back=0;A=n.lencode[h&(1<<n.lenbits)-1],w=A>>>24,b=A>>>16&255,g=65535&A,!(w<=d);){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}if(b&&0==(240&b)){for(m=w,y=b,k=g;A=n.lencode[k+((h&(1<<m+y)-1)>>m)],w=A>>>24,b=A>>>16&255,g=65535&A,!(m+w<=d);){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}h>>>=m,d-=m,n.back+=m}if(h>>>=w,d-=w,n.back+=w,n.length=g,0===b){n.mode=26;break}if(32&b){n.back=-1,n.mode=Qe;break}if(64&b){t.msg="invalid literal/length code",n.mode=tn;break}n.extra=15&b,n.mode=22;case 22:if(n.extra){for(z=n.extra;d<z;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}n.length+=h&(1<<n.extra)-1,h>>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;A=n.distcode[h&(1<<n.distbits)-1],w=A>>>24,b=A>>>16&255,g=65535&A,!(w<=d);){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}if(0==(240&b)){for(m=w,y=b,k=g;A=n.distcode[k+((h&(1<<m+y)-1)>>m)],w=A>>>24,b=A>>>16&255,g=65535&A,!(m+w<=d);){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}h>>>=m,d-=m,n.back+=m}if(h>>>=w,d-=w,n.back+=w,64&b){t.msg="invalid distance code",n.mode=tn;break}n.offset=g,n.extra=15&b,n.mode=24;case 24:if(n.extra){for(z=n.extra;d<z;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}n.offset+=h&(1<<n.extra)-1,h>>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=tn;break}n.mode=25;case 25:if(0===l)break t;if(u=c-l,n.offset>u){if(u=n.offset-u,u>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=tn;break}u>n.wnext?(u-=n.wnext,_=n.wsize-u):_=n.wnext-u,u>n.length&&(u=n.length),p=n.window}else p=r,_=s-n.offset,u=n.length;u>l&&(u=l),l-=u,n.length-=u;do{r[s++]=p[_++]}while(--u);0===n.length&&(n.mode=21);break;case 26:if(0===l)break t;r[s++]=n.length,l--,n.mode=21;break;case 27:if(n.wrap){for(;d<32;){if(0===o)break t;o--,h|=i[a++]<<d,d+=8}if(c-=l,t.total_out+=c,n.total+=c,c&&(t.adler=n.check=n.flags?gt(n.check,r,c,s-c):wt(n.check,r,c,s-c)),c=l,(n.flags?h:en(h))!==n.check){t.msg="incorrect data check",n.mode=tn;break}h=0,d=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;d<32;){if(0===o)break t;o--,h+=i[a++]<<d,d+=8}if(h!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=tn;break}h=0,d=0}n.mode=29;case 29:E=$e;break t;case tn:E=Xe;break t;case 31:return Ve;default:return Ge}return t.next_out=s,t.avail_out=l,t.next_in=a,t.avail_in=o,n.hold=h,n.bits=d,(n.wsize||c!==t.avail_out&&n.mode<tn&&(n.mode<27||e!==Pe))&&cn(t,t.output,t.next_out,c-t.avail_out),f-=t.avail_in,c-=t.avail_out,t.total_in+=f,t.total_out+=c,n.total+=c,n.wrap&&c&&(t.adler=n.check=n.flags?gt(n.check,r,c,t.next_out-c):wt(n.check,r,c,t.next_out-c)),t.data_type=n.bits+(n.last?64:0)+(n.mode===Qe?128:0)+(20===n.mode||15===n.mode?256:0),(0===f&&0===c||e===Pe)&&E===Ke&&(E=qe),E},inflateEnd:t=>{if(!t||!t.state)return Ge;let e=t.state;return e.window&&(e.window=null),t.state=null,Ke},inflateGetHeader:(t,e)=>{if(!t||!t.state)return Ge;const n=t.state;return 0==(2&n.wrap)?Ge:(n.head=e,e.done=!1,Ke)},inflateSetDictionary:(t,e)=>{const n=e.length;let i,r,a;return t&&t.state?(i=t.state,0!==i.wrap&&11!==i.mode?Ge:11===i.mode&&(r=1,r=wt(r,e,n,0),r!==i.check)?Xe:(a=cn(t,e,n,n),a?(i.mode=31,Ve):(i.havedict=1,Ke))):Ge},inflateInfo:"pako inflate (from Nodeca project)"};var _n=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const pn=Object.prototype.toString,{Z_NO_FLUSH:wn,Z_FINISH:bn,Z_OK:gn,Z_STREAM_END:mn,Z_NEED_DICT:yn,Z_STREAM_ERROR:kn,Z_DATA_ERROR:vn,Z_MEM_ERROR:En}=yt;function An(t){this.options=we({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ee,this.strm.avail_out=0;let n=un.inflateInit2(this.strm,e.windowBits);if(n!==gn)throw new Error(mt[n]);if(this.header=new _n,un.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=ye(e.dictionary):"[object ArrayBuffer]"===pn.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=un.inflateSetDictionary(this.strm,e.dictionary),n!==gn)))throw new Error(mt[n])}function xn(t,e){const n=new An(e);if(n.push(t),n.err)throw n.msg||mt[n.err];return n.result}An.prototype.push=function(t,e){const n=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let a,s,o;if(this.ended)return!1;for(s=e===~~e?e:!0===e?bn:wn,"[object ArrayBuffer]"===pn.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),a=un.inflate(n,s),a===yn&&r&&(a=un.inflateSetDictionary(n,r),a===gn?a=un.inflate(n,s):a===vn&&(a=yn));n.avail_in>0&&a===mn&&n.state.wrap>0&&0!==t[n.next_in];)un.inflateReset(n),a=un.inflate(n,s);switch(a){case kn:case vn:case yn:case En:return this.onEnd(a),this.ended=!0,!1}if(o=n.avail_out,n.next_out&&(0===n.avail_out||a===mn))if("string"===this.options.to){let t=ve(n.output,n.next_out),e=n.next_out-t,r=ke(n.output,t);n.next_out=e,n.avail_out=i-e,e&&n.output.set(n.output.subarray(t,t+e),0),this.onData(r)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(a!==gn||0!==o){if(a===mn)return a=un.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},An.prototype.onData=function(t){this.chunks.push(t)},An.prototype.onEnd=function(t){t===gn&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=be(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Un={Inflate:An,inflate:xn,inflateRaw:function(t,e){return(e=e||{}).raw=!0,xn(t,e)},ungzip:xn,constants:yt};const{Inflate:zn,inflate:Rn,inflateRaw:Ln,ungzip:Nn}=Un;var On=zn;const Tn=[137,80,78,71,13,10,26,10],Sn=[];for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++)1&e?e=3988292384^e>>>1:e>>>=1;Sn[t]=e}const In=4294967295;function Dn(t,e){return(function(t,e,n){let i=t;for(let t=0;t<n;t++)i=Sn[255&(i^e[t])]^i>>>8;return i}(In,t,e)^In)>>>0}var Bn,Zn,Cn,Fn;!function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.GREYSCALE=0]="GREYSCALE",t[t.TRUECOLOUR=2]="TRUECOLOUR",t[t.INDEXED_COLOUR=3]="INDEXED_COLOUR",t[t.GREYSCALE_ALPHA=4]="GREYSCALE_ALPHA",t[t.TRUECOLOUR_ALPHA=6]="TRUECOLOUR_ALPHA"}(Bn||(Bn={})),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.DEFLATE=0]="DEFLATE"}(Zn||(Zn={})),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.ADAPTIVE=0]="ADAPTIVE"}(Cn||(Cn={})),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.NO_INTERLACE=0]="NO_INTERLACE",t[t.ADAM7=1]="ADAM7"}(Fn||(Fn={}));const Mn=new Uint8Array(0),Hn=new Uint16Array([255]),Pn=255===new Uint8Array(Hn.buffer)[0];class jn extends O{constructor(t,e={}){super(t);const{checkCrc:n=!1}=e;this._checkCrc=n,this._inflator=new On,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._end=!1,this._hasPalette=!1,this._palette=[],this._compressionMethod=Zn.UNKNOWN,this._filterMethod=Cn.UNKNOWN,this._interlaceMethod=Fn.UNKNOWN,this._colorType=-1,this.setBigEndian()}decode(){for(this.decodeSignature();!this._end;)this.decodeChunk();return this.decodeImage(),this._png}decodeSignature(){for(let t=0;t<Tn.length;t++)if(this.readUint8()!==Tn[t])throw new Error(`wrong PNG signature. Byte at ${t} should be ${Tn[t]}.`)}decodeChunk(){const t=this.readUint32(),e=this.readChars(4),n=this.offset;switch(e){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(t);break;case"IDAT":this.decodeIDAT(t);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(t);break;case"tEXt":this.decodetEXt(t);break;case"pHYs":this.decodepHYs();break;default:this.skip(t)}if(this.offset-n!==t)throw new Error(`Length mismatch while decoding chunk ${e}`);if(this._checkCrc){const n=this.readUint32(),i=t+4,r=Dn(new Uint8Array(this.buffer,this.byteOffset+this.offset-i-4,i),i);if(r!==n)throw new Error(`CRC mismatch for chunk ${e}. Expected ${n}, found ${r}`)}else this.skip(4)}decodeIHDR(){const t=this._png;t.width=this.readUint32(),t.height=this.readUint32(),t.depth=function(t){if(1!==t&&2!==t&&4!==t&&8!==t&&16!==t)throw new Error(`invalid bit depth: ${t}`);return t}(this.readUint8());const e=this.readUint8();let n;switch(this._colorType=e,e){case Bn.GREYSCALE:n=1;break;case Bn.TRUECOLOUR:n=3;break;case Bn.INDEXED_COLOUR:n=1;break;case Bn.GREYSCALE_ALPHA:n=2;break;case Bn.TRUECOLOUR_ALPHA:n=4;break;default:throw new Error(`Unknown color type: ${e}`)}if(this._png.channels=n,this._compressionMethod=this.readUint8(),this._compressionMethod!==Zn.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodePLTE(t){if(t%3!=0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${t}`);const e=t/3;this._hasPalette=!0;const n=[];this._palette=n;for(let t=0;t<e;t++)n.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(t){this._inflator.push(new Uint8Array(this.buffer,this.offset+this.byteOffset,t)),this.skip(t)}decodetRNS(t){if(3===this._colorType){if(t>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${t} vs ${this._palette.length})`);let e=0;for(;e<t;e++){const t=this.readByte();this._palette[e].push(t)}for(;e<this._palette.length;e++)this._palette[e].push(255)}}decodetEXt(t){let e,n="";for(;"\0"!==(e=this.readChar());)n+=e;this._png.text[n]=this.readChars(t-n.length-1)}decodepHYs(){const t=this.readUint32(),e=this.readUint32(),n=this.readByte();this._png.resolution={x:t,y:e,unit:n}}decodeImage(){if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const t=this._inflator.result;if(this._filterMethod!==Cn.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod!==Fn.NO_INTERLACE)throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this.decodeInterlaceNull(t)}decodeInterlaceNull(t){const e=this._png.height,n=this._png.channels*this._png.depth/8,i=this._png.width*n,r=new Uint8Array(this._png.height*i);let a,s,o=Mn,l=0;for(let h=0;h<e;h++){switch(a=t.subarray(l+1,l+1+i),s=r.subarray(h*i,(h+1)*i),t[l]){case 0:Wn(a,s,i);break;case 1:Kn(a,s,i,n);break;case 2:$n(a,s,o,i);break;case 3:Yn(a,s,o,i,n);break;case 4:Gn(a,s,o,i,n);break;default:throw new Error(`Unsupported filter: ${t[l]}`)}o=s,l+=i+1}if(this._hasPalette&&(this._png.palette=this._palette),16===this._png.depth){const t=new Uint16Array(r.buffer);if(Pn)for(let e=0;e<t.length;e++)t[e]=(255&(h=t[e]))<<8|h>>8&255;this._png.data=t}else this._png.data=r;var h}}function Wn(t,e,n){for(let i=0;i<n;i++)e[i]=t[i]}function Kn(t,e,n,i){let r=0;for(;r<i;r++)e[r]=t[r];for(;r<n;r++)e[r]=t[r]+e[r-i]&255}function $n(t,e,n,i){let r=0;if(0===n.length)for(;r<i;r++)e[r]=t[r];else for(;r<i;r++)e[r]=t[r]+n[r]&255}function Yn(t,e,n,i,r){let a=0;if(0===n.length){for(;a<r;a++)e[a]=t[a];for(;a<i;a++)e[a]=t[a]+(e[a-r]>>1)&255}else{for(;a<r;a++)e[a]=t[a]+(n[a]>>1)&255;for(;a<i;a++)e[a]=t[a]+(e[a-r]+n[a]>>1)&255}}function Gn(t,e,n,i,r){let a=0;if(0===n.length){for(;a<r;a++)e[a]=t[a];for(;a<i;a++)e[a]=t[a]+e[a-r]&255}else{for(;a<r;a++)e[a]=t[a]+n[a]&255;for(;a<i;a++)e[a]=t[a]+Xn(e[a-r],n[a],n[a-r])&255}}function Xn(t,e,n){const i=t+e-n,r=Math.abs(i-t),a=Math.abs(i-e),s=Math.abs(i-n);return r<=a&&r<=s?t:a<=s?e:n}var Vn;!function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.METRE=1]="METRE"}(Vn||(Vn={}));!function(n,i){var r=(void 0===i?{}:i).expose,a=void 0===r?E:r;function s(n){var i=this;return function(){for(var r=[],a=0;a<arguments.length;a++)r[a]=arguments[a];return t(i,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,n.apply(void 0,r)];case 1:return[2,z(t.sent())]}}))}))}}if("function"==typeof n)return a(s(n));var o=Object.entries(n).reduce((function(t,e){var n=e[0],i=e[1];return t[n]=s(i),t}),{});a(o)}((async t=>{return new jn(t,e).decode();var e}))}();\n',{name:"png-decoder-worker.js"})}async function zt(t){const e=await yt(Rt());return null!=t&&t.addThread(e),(...t)=>e.apply(null,[...t.map((t=>Ct(t)))])}function Ot(t){return tt((()=>zt(t.terminate)),t)}export{Tt as makeController,Rt as makeWorker,Ot as spawnPool,zt as spawnWorker}
@@ -0,0 +1,4 @@
1
+ /**!
2
+ * Copyright (c) 2021 Vertex Software LLC. All rights reserved.
3
+ */
4
+ import{m as t,c as e}from"./p-59d075d4.js";import{e as s,v as i,f as n,p as r,r as o,m as a,g as h}from"./p-640cb5f8.js";function c(t,e){const n=s.center(t),r=i.subtract(e.position,n),o=i.subtract(t.max,n),a=Math.abs(i.dot(i.subtract(e.lookAt,e.position),r))/i.magnitude(i.subtract(e.lookAt,e.position)),h=1.1*i.magnitude(o);let c=a+h,u=.01*c;if(u>a-h){if(u>1e3){const t=u-1e3;u=1e3,c-=t}}else u=a-h;return{far:c,near:u}}class u{constructor(t,e,s,i,n,r){this.camera=t,this.frameDimensions=e,this.imageRect=s,this.imageScale=i,this.data=n,this.imageDimensions=r}static fromPng(t,e,s,i,r){if(t.data instanceof Uint16Array)return new u(e,s,i,r,t.data,n.create(t.width,t.height));throw new Error("Expected depth PNG to have depth of 16-bit")}getLinearDepthAtPoint(t,e){const{near:s,far:i}=this.camera;return this.getNormalizedDepthAtPoint(t,e)*(i-s)+s}getNormalizedDepthAtPoint(t,e){const{width:s,height:i}=this.imageDimensions,n=r.subtract(t,this.imageRect),o=1/this.imageScale,a=r.scale(n,o,o);if(a.x>=0&&a.y>=0&&a.x<s&&a.y<i){const t=Math.floor(a.x)+Math.floor(a.y)*s,i=this.data[t],n=i===u.MAX_DEPTH_VALUE&&null!=e?e:i;return(null!=n?n:u.MAX_DEPTH_VALUE)/u.MAX_DEPTH_VALUE}return null!=e?e:1}isDepthAtFarPlane(t){return this.getNormalizedDepthAtPoint(t)<1}getWorldPoint(t,e,s){const n=this.getLinearDepthAtPoint(t,s),r=i.subtract(this.camera.lookAt,this.camera.position),a=o.at(e,this.camera.far),h=i.subtract(a,this.camera.position),c=i.dot(r,h)/(i.magnitude(r)*i.magnitude(h));return o.at(e,n/c)}isOccluded(t,e){const{position:s,direction:n,projectionViewMatrix:r}=this.camera,o=i.subtract(t,s),a=i.project(o,n),h=i.magnitude(a),c=i.transformMatrix(t,r),u=e.transformVectorToViewport(c),l=e.transformPointToFrame(u,this);return h>this.getLinearDepthAtPoint(l)}}let l,m;async function w(){return null==m&&(m=(null==l&&(console.debug("Loading PNG worker module"),l=async function(){return __sc_import_viewer("./p-1f8a238b.js")}()),l).then((async({spawnPool:t})=>{const e=function(){var t;if("undefined"!=typeof window){const e=null!==(t=window.navigator.hardwareConcurrency)&&void 0!==t?t:8;return Math.ceil(e/4)}return 1}();return console.debug(`Spawning PNG worker pool [size=${e}]`),t({size:e})}))),m}u.MAX_DEPTH_VALUE=65535;const d=async t=>(await w()).queue((e=>e(t)));w();class f{constructor(t,e,s,i,n,r){this.correlationIds=t,this.sequenceNumber=e,this.dimensions=s,this.image=i,this.scene=n,this.depthBufferBytes=r}async depthBuffer(){return null==this.cachedDepthBuffer&&(this.cachedDepthBuffer=null!=this.depthBufferBytes?this.decodeDepthBuffer(this.depthBufferBytes):Promise.resolve(void 0)),this.cachedDepthBuffer}async decodeDepthBuffer(t){const e=await d(t);return u.fromPng(e,this.scene.camera,this.dimensions,this.image.imageRect,this.image.imageScale)}}class g{constructor(t,e,s,i){this.frameDimensions=t,this.imageRect=e,this.imageScale=s,this.imageBytes=i}}class p{constructor(t,e,s,i,n){this.camera=t,this.boundingBox=e,this.crossSection=s,this.worldOrientation=i,this.hasChanged=n}}class x{constructor(t,e,s,i,n,r,o){this.position=t,this.lookAt=e,this.up=s,this.near=i,this.far=n,this.aspectRatio=r,this.fovY=o}static fromBoundingBox(t,e,s){const{near:i,far:n}=c(e,t);return new x(t.position,t.lookAt,t.up,i,n,s,45)}computeCameraMatrices(){if(null==this.cameraMatrices){const t=a.makeLookAtView(this.position,this.lookAt,this.up),e=a.invert(t),s=a.makePerspective(this.near,this.far,this.fovY,this.aspectRatio),i=a.invert(s),n=a.multiply(s,t);this.cameraMatrices={viewMatrix:t,worldMatrix:e,projectionMatrix:s,projectionMatrixInverse:i,projectionViewMatrix:n}}return this.cameraMatrices}get direction(){return i.normalize(i.subtract(this.lookAt,this.position))}get worldMatrix(){return this.computeCameraMatrices().worldMatrix}get viewMatrix(){return this.computeCameraMatrices().viewMatrix}get projectionMatrix(){return this.computeCameraMatrices().projectionMatrix}get projectionMatrixInverse(){return this.computeCameraMatrices().projectionMatrixInverse}get projectionViewMatrix(){return this.computeCameraMatrices().projectionViewMatrix}}class v{constructor(t){this.scale=t}translateWorldToReal(t){return t*this.scale}translateRealToWorld(t){return t/this.scale}}class b{constructor(t){this.unitType=t,this.unit=b.units[t]}translateWorldValueToReal(t){return this.unit.converter.translateWorldToReal(t)}translateRealValueToWorld(t){return this.unit.converter.translateRealToWorld(t)}translateWorldPointToReal(t){return{x:this.unit.converter.translateWorldToReal(t.x),y:this.unit.converter.translateWorldToReal(t.y),z:this.unit.converter.translateWorldToReal(t.z)}}translateRealPointToWorld(t){return{x:this.unit.converter.translateRealToWorld(t.x),y:this.unit.converter.translateRealToWorld(t.y),z:this.unit.converter.translateRealToWorld(t.z)}}}b.units={millimeters:{name:"Millimeters",abbreviatedName:"mm",converter:new class extends v{constructor(){super(1)}}},centimeters:{name:"Centimeters",abbreviatedName:"cm",converter:new class extends v{constructor(){super(.01)}}},meters:{name:"Meters",abbreviatedName:"m",converter:new class extends v{constructor(){super(.001)}}},inches:{name:"Inches",abbreviatedName:"in",converter:new class extends v{constructor(){super(1/25.4)}}},feet:{name:"Feet",abbreviatedName:"ft",converter:new class extends v{constructor(){super(1/(25.4*12))}}},yards:{name:"Yards",abbreviatedName:"yd",converter:new class extends v{constructor(){super(1/(25.4*12*3))}}}};class M{constructor(t,e){this.position=t,this.up=e}transformMatrix(t){const e=i.transformMatrix(this.position,t),s=i.transformMatrix(this.up,t);return new M(e,s)}}M.FRONT=new M(i.back(),i.up()),M.LEFT=new M(i.right(),i.up()),M.RIGHT=new M(i.left(),i.up()),M.BACK=new M(i.forward(),i.up()),M.TOP=new M(i.up(),i.forward()),M.BOTTOM=new M(i.down(),i.back()),M.TOP_FRONT_RIGHT=new M(i.add(i.back(),i.up(),i.left()),i.up()),M.TOP_FRONT_LEFT=new M(i.add(i.back(),i.up(),i.right()),i.up()),M.BOTTOM_FRONT_RIGHT=new M(i.add(i.back(),i.down(),i.left()),i.up()),M.BOTTOM_FRONT_LEFT=new M(i.add(i.back(),i.down(),i.right()),i.up()),M.TOP_BACK_LEFT=new M(i.add(i.forward(),i.up(),i.right()),i.up()),M.TOP_BACK_RIGHT=new M(i.add(i.forward(),i.up(),i.left()),i.up()),M.BOTTOM_BACK_LEFT=new M(i.add(i.forward(),i.down(),i.right()),i.up()),M.BOTTOM_BACK_RIGHT=new M(i.add(i.forward(),i.down(),i.left()),i.up()),M.TOP_FRONT=new M(i.add(i.back(),i.up()),i.up()),M.BOTTOM_FRONT=new M(i.add(i.back(),i.down()),i.up()),M.FRONT_RIGHT=new M(i.add(i.back(),i.left()),i.up()),M.FRONT_LEFT=new M(i.add(i.back(),i.right()),i.up()),M.TOP_BACK=new M(i.add(i.forward(),i.up()),i.up()),M.BOTTOM_BACK=new M(i.add(i.forward(),i.down()),i.up()),M.BACK_LEFT=new M(i.add(i.forward(),i.right()),i.up()),M.BACK_RIGHT=new M(i.add(i.forward(),i.left()),i.up()),M.TOP_LEFT=new M(i.add(i.up(),i.right()),i.up()),M.TOP_RIGHT=new M(i.add(i.up(),i.left()),i.up()),M.BOTTOM_LEFT=new M(i.add(i.down(),i.right()),i.up()),M.BOTTOM_RIGHT=new M(i.add(i.down(),i.left()),i.up());const y=t.defineMapper(t.read(t.requiredProp("r"),t.requiredProp("g"),t.requiredProp("b")),(([t,s,i])=>e.create(t,s,i))),P=t.defineMapper(t.read(t.requiredProp("x"),t.requiredProp("y"),t.requiredProp("z")),(([t,e,s])=>i.create(t,e,s))),A=t.defineMapper(t.read(t.requiredProp("xmin"),t.requiredProp("ymin"),t.requiredProp("zmin"),t.requiredProp("xmax"),t.requiredProp("ymax"),t.requiredProp("zmax")),(([t,e,n,r,o,a])=>s.create(i.create(t,e,n),i.create(r,o,a)))),B=t.defineMapper(t.read(t.requiredProp("width"),t.requiredProp("height")),(([t,e])=>n.create(t,e))),N=t.defineMapper(t.read(t.requiredProp("x"),t.requiredProp("y"),t.requiredProp("width"),t.requiredProp("height")),(([t,e,s,i])=>h.create(t,e,s,i))),j=t.defineMapper(t.read(t.mapProp("position",t.compose(t.required("position"),P)),t.mapProp("lookAt",t.compose(t.required("lookAt"),P)),t.mapProp("up",t.compose(t.required("up"),P))),(([t,e,s])=>({position:t,lookAt:e,up:s}))),R=t.defineMapper(t.read(t.mapProp("normal",t.compose(t.required("normal"),P)),t.requiredProp("offset")),(([t,e])=>({normal:t,offset:e}))),C=t.defineMapper(t.read(t.mapProp("frameDimensions",t.compose(t.required("frameDimensions"),B)),t.mapProp("imageRect",t.compose(t.required("imageRect"),N)),t.mapProp("scaleFactor",t.required("scaleFactor"))),(([t,e,s])=>({frameDimensions:t,imageRect:e,scaleFactor:s}))),z=t.defineMapper(t.read(t.mapProp("sectionPlanes",t.compose(t.required("sectionPlanes"),t.mapArray(R))),t.mapProp("highlightColor",t.ifDefined(y))),(([t,e])=>function(t={}){return{sectionPlanes:t.sectionPlanes||[],highlightColor:t.highlightColor}}({sectionPlanes:t,highlightColor:e||void 0}))),D=t.defineMapper(t.read(t.mapProp("imageAttributes",t.compose(t.required("imageAttributes"),C))),(([t])=>t)),F=t.defineMapper(t.read(D,t.mapProp("image",t.required("image"))),(([t,e])=>new g(t.frameDimensions,t.imageRect,t.scaleFactor,e))),W=t.defineMapper(t.read(t.mapProp("camera",t.compose(t.required("camera"),j)),t.mapProp("visibleBoundingBox",t.compose(t.required("visibleBoundingBox"),A)),t.mapProp("crossSectioning",t.compose(t.required("crossSectioning"),z)),t.requiredProp("hasChanged")),(([t,e,s,i])=>({camera:t,boundingBox:e,crossSectioning:s,hasChanged:i}))),S=t.defineMapper(t.read(t.mapProp("sceneAttributes",t.compose(t.required("sceneAttributes"),W))),(([t])=>t)),T=t.defineMapper(t.read(S,D),(([t,e])=>x.fromBoundingBox(t.camera,t.boundingBox,n.aspectRatio(e.frameDimensions))));function k(e){return t.ifInvalidThrow(function(e){return t.defineMapper(t.read(t.mapProp("frameCorrelationIds",(t=>null!=t?t:[])),t.requiredProp("sequenceNumber"),t.compose(D,t.getProp("frameDimensions")),function(e){return t.defineMapper(t.read(S,T),(([t,s])=>new p(s,t.boundingBox,t.crossSectioning,e,t.hasChanged)))}(e),F,t.getProp("depthBuffer")),(([t,e,s,i,n,r])=>new f(t,e,s,n,i,(null==r?void 0:r.value)||void 0)))}(e))}const I=t.defineMapper(t.compose(t.required("orientation"),t.read(t.mapProp("up",t.compose(t.required("up"),P)),t.mapProp("front",t.compose(t.required("front"),P)))),(([t,e])=>new q(t,e))),V=t.ifInvalidThrow(I),E=t.defineMapper(t.read(t.mapRequiredProp("imageAttributes",C),t.requiredProp("stencilBuffer")),(([t,e])=>({imageAttributes:t,stencilBuffer:e}))),G=t.mapRequiredProp("stencilBuffer",E),_=t.ifInvalidThrow(G),L=e.create(0,0,0);class O{constructor(t){this.viewer=t,this.handleInteractionStarted=()=>{this.invalidateStencilBuffer(),this.pendingInteractionFinished=new Promise((t=>{this.pendingInteractionFinishedResolver=t}))},this.handleInteractionFinished=()=>{var t;null===(t=this.pendingInteractionFinishedResolver)||void 0===t||t.call(this),this.pendingInteractionFinished=void 0,this.pendingInteractionFinishedResolver=void 0},this.invalidateStencilBuffer=()=>{this.pendingStencilBuffer=void 0},t.addEventListener("interactionStarted",this.handleInteractionStarted),t.addEventListener("interactionFinished",this.handleInteractionFinished),t.addEventListener("frameReceived",(()=>{this.invalidateStencilBuffer()}))}async fetch(){const t=await this.viewer.isSceneReady()?await this.viewer.scene():void 0;if(null!=t&&(t.crossSectioning().current().sectionPlanes.length>0||null!=this.viewer.featureLines)&&null!=this.viewer.stream){const t=await this.viewer.stream.getStencilBuffer(!0),{stencilBuffer:e,imageAttributes:s}=_(t),i=await d(e);return U.fromPng(i,s.frameDimensions,s.imageRect,s.scaleFactor)}}latest(){return null==this.pendingStencilBuffer&&(this.pendingStencilBuffer=this.fetch()),this.pendingStencilBuffer}async latestAfterInteraction(){return await this.pendingInteractionFinished,this.latest()}}class U{constructor(t,e,s,i,n){this.frameDimensions=t,this.imageBytes=e,this.imageChannels=s,this.imageRect=i,this.imageScale=n}static fromPng(t,e,s,i){if(t.data instanceof Uint8Array)return new U(e,t.data,t.channels,s,i);throw new Error("Expected stencil PNG to have depth of 8-bit")}getColor(t){const{width:s,height:i}=this.imageRect,n=r.subtract(t,this.imageRect),o=1/this.imageScale,a=r.scale(n,o,o);if(a.x>=0&&a.y>=0&&a.x<s&&a.y<i){const t=(Math.floor(a.x)+Math.floor(a.y)*s)*this.imageChannels,i=e.create(this.imageBytes[t+0],this.imageBytes[t+1],this.imageBytes[t+2]);return function(t){return t.r===L.r&&t.g===L.g&&t.b===L.b}(i)?void 0:i}}getNearestPixel(t,e,s=(()=>!0)){const i=2*e,n=r.create(t.x-e,t.y-e),o=[];for(let a=0;a<i*i;a++){const h=a%i,c=Math.floor(a/i),u=r.add(n,{x:h,y:c});if(r.distance(u,t)<=e){const t=this.getColor(u);null!=t&&s(t)&&o.push(u)}}return o.sort(((e,s)=>r.distance(e,t)-r.distance(s,t)))[0]}}class q{constructor(t,e){this.y=t,this.z=e}get matrix(){const t=this.z,e=this.y,s=i.cross(e,t);return a.makeBasis(s,e,t)}}q.DEFAULT=new q(i.up(),i.back());export{f as F,b as M,q as O,O as S,g as a,p as b,x as c,k as d,M as e,c as f,V as m}
@@ -1,4 +1,4 @@
1
1
  /**!
2
2
  * Copyright (c) 2021 Vertex Software LLC. All rights reserved.
3
3
  */
4
- import{h as e,F as t,r as i,H as o}from"./p-c9d8a379.js";import{v as r,q as a,s as n}from"./p-d912dd24.js";import{r as c}from"./p-9f048664.js";import{O as s,c as d,e as h}from"./p-b5c350a7.js";import{c as l}from"./p-f482325b.js";import"./p-6d4ab5fc.js";import"./p-112455b1.js";const f={front:{direction:r.back(),quaternion:a.create()},back:{direction:r.forward(),quaternion:a.fromAxisAngle(r.up(),Math.PI)},left:{direction:r.right(),quaternion:a.fromAxisAngle(r.down(),Math.PI/2)},right:{direction:r.left(),quaternion:a.fromAxisAngle(r.up(),Math.PI/2)},top:{direction:r.up(),quaternion:a.fromAxisAngle(r.right(),Math.PI/2)},bottom:{direction:r.down(),quaternion:a.fromAxisAngle(r.left(),Math.PI/2)}},b=({label:i,length:o,rotationAxis:c})=>{const s={width:`${o+5}px`},d=a.fromAxisAngle(c,Math.PI/2),h=r.scale(o+15,r.right());return e(t,null,e("vertex-viewer-dom-group",{quaternion:d},e("vertex-viewer-dom-element",{style:s,billboardOff:!0,interactionsOff:!0},e("div",{class:`triad-axis triad-axis-${i.toLowerCase()}`})),e("vertex-viewer-dom-element",{rotation:n.create({x:Math.PI/2,y:0,z:0}),style:s,billboardOff:!0,interactionsOff:!0},e("div",{class:`triad-axis triad-axis-${i.toLowerCase()}`})),e("vertex-viewer-dom-element",{position:h,interactionsOff:!0},e("div",{class:`triad-label triad-label-${i.toLowerCase()}`},i))))},g=({label:t,length:i,side:o,disabled:a,onPointerDown:n})=>{const{direction:c,quaternion:s}=f[o],d=r.scale(i/2-.1,c);return e("vertex-viewer-dom-element",{class:l("cube-side",{disabled:a}),position:d,quaternion:s,style:{width:`${i}px`,height:`${i}px`},onPointerDown:n,billboardOff:!0},e("div",{class:`cube-side-face cube-side-face-${t.toLowerCase()}`},t))},v=({length:t,face1Side:i,face1Corner:o,face2Side:a,face2Corner:n,face3Side:c,face3Corner:s,disabled:d,onPointerDown:h})=>{const{direction:b,quaternion:g}=f[i],{direction:v,quaternion:u}=f[a],{direction:w,quaternion:p}=f[c],m=r.scale(t/2,b),x=r.scale(t/2,v),S=r.scale(t/2,w),k={width:`${t}px`,height:`${t}px`};return e("vertex-viewer-dom-group",{class:l("cube-corner",{disabled:d}),onPointerDown:h},e("vertex-viewer-dom-element",{position:m,quaternion:g,style:k,billboardOff:!0},e("div",{class:`cube-corner-face ${o}`})),e("vertex-viewer-dom-element",{position:x,quaternion:u,style:k,billboardOff:!0},e("div",{class:`cube-corner-face ${n}`})),e("vertex-viewer-dom-element",{position:S,quaternion:p,style:k,billboardOff:!0},e("div",{class:`cube-corner-face ${s}`})))},u=({length:t,face1Side:i,face2Side:o,face1Edge:a,face2Edge:n,disabled:c,onPointerDown:s})=>{const{direction:d,quaternion:h}=f[i],{direction:b,quaternion:g}=f[o],v=r.scale(t/2,d),u=r.scale(t/2,b),w={width:`${t}px`,height:`${t}px`};return e("vertex-viewer-dom-group",{class:l("cube-edge",{disabled:c}),onPointerDown:s},e("vertex-viewer-dom-element",{position:v,quaternion:h,style:w,billboardOff:!0},e("div",{class:`cube-edge-face ${a}`})),e("vertex-viewer-dom-element",{position:u,quaternion:g,style:w,billboardOff:!0},e("div",{class:`cube-edge-face ${n}`})))},w=({length:t})=>{const{direction:i,quaternion:o}=f.top,a=r.scale(-t/2,i);return e("vertex-viewer-dom-element",{class:"cube-shadow",position:a,quaternion:o,style:{width:`${t}px`,height:`${t}px`},billboardOff:!0,interactionsOff:!0},e("div",{class:"cube-shadow-face"}))},p=class{constructor(e){i(this,e),this.boxLength=80,this.triadPosition=r.origin(),this.xPositiveLabel="Left",this.xNegativeLabel="Right",this.yPositiveLabel="Top",this.yNegativeLabel="Bottom",this.zPositiveLabel="Front",this.zNegativeLabel="Back",this.standardViewsOff=!1,this.animationDuration=500,this.triadOff=!1,this.worldOrientation=s.DEFAULT,this.updateMatrices=()=>{var e;if(null!=(null===(e=this.viewer)||void 0===e?void 0:e.frame)){const{camera:e}=this.viewer.frame.scene,t=this.boxLength/2;this.triadPosition=r.create(-t-5,-t-5,-t-5);const i=21.5;this.camera=new d(r.scale(3.125*this.boxLength,r.negate(e.direction)),r.origin(),e.up,.1,100,1,i),this.worldOrientation=this.viewer.frame.scene.worldOrientation}}}handleViewerChanged(e,t){null==t||t.removeEventListener("frameDrawn",this.updateMatrices),null==e||e.addEventListener("frameDrawn",this.updateMatrices),this.updateMatrices()}handleStandardView(e){return this.standardViewsOff?async()=>{}:async()=>{if(null!=this.viewer){const t=await this.viewer.scene(),i=this.animationDuration>0?{animation:{milliseconds:this.animationDuration}}:{},o=e.transformMatrix(this.worldOrientation.matrix);t.camera().standardView(o).viewAll().render(i)}}}componentWillLoad(){this.handleViewerChanged(this.viewer)}componentDidLoad(){null!=this.rendererEl&&(new ResizeObserver((()=>this.handleRendererResized())).observe(this.rendererEl),this.handleRendererResized())}handleRendererResized(){c((()=>{if(null!=this.rendererEl){const e=this.rendererEl.getBoundingClientRect();this.boxLength=Math.min(e.width,e.height)}}))}render(){return e(o,null,e("vertex-viewer-dom-renderer",{ref:e=>this.rendererEl=e,class:"renderer",camera:this.camera},!this.triadOff&&e("vertex-viewer-dom-group",{class:"triad",position:this.triadPosition},e(b,{label:"X",length:this.boxLength,rotationAxis:r.origin()}),e(b,{label:"Y",length:this.boxLength,rotationAxis:r.forward()}),e(b,{label:"Z",length:this.boxLength,rotationAxis:r.up()})),e("vertex-viewer-dom-group",{class:"cube",matrix:this.worldOrientation.matrix},e(w,{length:this.boxLength+10}),e(g,{label:this.zPositiveLabel,length:this.boxLength,side:"front",onPointerDown:this.handleStandardView(h.FRONT),disabled:this.standardViewsOff}),e(g,{label:this.zNegativeLabel,length:this.boxLength,side:"back",onPointerDown:this.handleStandardView(h.BACK),disabled:this.standardViewsOff}),e(g,{label:this.xNegativeLabel,length:this.boxLength,side:"left",onPointerDown:this.handleStandardView(h.LEFT),disabled:this.standardViewsOff}),e(g,{label:this.xPositiveLabel,length:this.boxLength,side:"right",onPointerDown:this.handleStandardView(h.RIGHT),disabled:this.standardViewsOff}),e(g,{label:this.yPositiveLabel,length:this.boxLength,side:"top",onPointerDown:this.handleStandardView(h.TOP),disabled:this.standardViewsOff}),e(g,{label:this.yNegativeLabel,length:this.boxLength,side:"bottom",onPointerDown:this.handleStandardView(h.BOTTOM),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"top",face1Edge:"bottom",face2Side:"front",face2Edge:"top",onPointerDown:this.handleStandardView(h.TOP_FRONT),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"front",face1Edge:"right",face2Side:"left",face2Edge:"left",onPointerDown:this.handleStandardView(h.FRONT_LEFT),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"bottom",face1Edge:"top",face2Side:"front",face2Edge:"bottom",onPointerDown:this.handleStandardView(h.BOTTOM_FRONT),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"front",face1Edge:"left",face2Side:"right",face2Edge:"right",onPointerDown:this.handleStandardView(h.FRONT_RIGHT),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"top",face1Edge:"right",face2Side:"left",face2Edge:"top",onPointerDown:this.handleStandardView(h.TOP_LEFT),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"back",face1Edge:"left",face2Side:"left",face2Edge:"right",onPointerDown:this.handleStandardView(h.BACK_LEFT),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"bottom",face1Edge:"right",face2Side:"left",face2Edge:"bottom",onPointerDown:this.handleStandardView(h.BOTTOM_LEFT),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"top",face1Edge:"top",face2Side:"back",face2Edge:"top",onPointerDown:this.handleStandardView(h.TOP_BACK),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"back",face1Edge:"right",face2Side:"right",face2Edge:"left",onPointerDown:this.handleStandardView(h.BACK_RIGHT),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"bottom",face1Edge:"bottom",face2Side:"back",face2Edge:"bottom",onPointerDown:this.handleStandardView(h.BOTTOM_BACK),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"top",face1Edge:"left",face2Side:"right",face2Edge:"top",onPointerDown:this.handleStandardView(h.TOP_RIGHT),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"bottom",face1Edge:"left",face2Side:"right",face2Edge:"bottom",onPointerDown:this.handleStandardView(h.BOTTOM_RIGHT),disabled:this.standardViewsOff}),e(v,{length:this.boxLength,face1Side:"top",face1Corner:"bottom-left",face2Side:"front",face2Corner:"top-left",face3Side:"right",face3Corner:"top-right",onPointerDown:this.handleStandardView(h.TOP_FRONT_RIGHT),disabled:this.standardViewsOff}),e(v,{length:this.boxLength,face1Side:"top",face1Corner:"bottom-right",face2Side:"front",face2Corner:"top-right",face3Side:"left",face3Corner:"top-left",onPointerDown:this.handleStandardView(h.TOP_FRONT_LEFT),disabled:this.standardViewsOff}),e(v,{length:this.boxLength,face1Side:"bottom",face1Corner:"top-right",face2Side:"front",face2Corner:"bottom-right",face3Side:"left",face3Corner:"bottom-left",onPointerDown:this.handleStandardView(h.BOTTOM_FRONT_LEFT),disabled:this.standardViewsOff}),e(v,{length:this.boxLength,face1Side:"bottom",face1Corner:"top-left",face2Side:"front",face2Corner:"bottom-left",face3Side:"right",face3Corner:"bottom-right",onPointerDown:this.handleStandardView(h.BOTTOM_FRONT_RIGHT),disabled:this.standardViewsOff}),e(v,{length:this.boxLength,face1Side:"top",face1Corner:"top-right",face2Side:"back",face2Corner:"top-left",face3Side:"left",face3Corner:"top-right",onPointerDown:this.handleStandardView(h.TOP_BACK_LEFT),disabled:this.standardViewsOff}),e(v,{length:this.boxLength,face1Side:"top",face1Corner:"top-left",face2Side:"back",face2Corner:"top-right",face3Side:"right",face3Corner:"top-left",onPointerDown:this.handleStandardView(h.TOP_BACK_RIGHT),disabled:this.standardViewsOff}),e(v,{length:this.boxLength,face1Side:"bottom",face1Corner:"bottom-left",face2Side:"back",face2Corner:"bottom-right",face3Side:"right",face3Corner:"bottom-left",onPointerDown:this.handleStandardView(h.BOTTOM_BACK_RIGHT),disabled:this.standardViewsOff}),e(v,{length:this.boxLength,face1Side:"bottom",face1Corner:"bottom-right",face2Side:"back",face2Corner:"bottom-left",face3Side:"left",face3Corner:"bottom-right",onPointerDown:this.handleStandardView(h.BOTTOM_BACK_LEFT),disabled:this.standardViewsOff}))))}static get watchers(){return{viewer:["handleViewerChanged"]}}};p.style=":host{--viewer-view-cube-side-background:var(--white);--viewer-view-cube-side-background-hover:var(--blue-500);--viewer-view-cube-side-background-hover-opacity:0.25;--viewer-view-cube-side-border:1.5px solid var(--neutral-500);--viewer-view-cube-edge-length:12px;--viewer-view-cube-opacity:0.8;display:block;color:var(--neutral-700);width:80px;height:80px;margin:20px;position:relative;display:flex;align-items:center;justify-content:center;user-select:none}.renderer{position:unset;width:100%;height:100%;overflow:visible}.reference-point{width:5px;height:5px;border-radius:50%;background-color:black}.triad{pointer-events:none}.triad-axis{width:100%;height:1.5px;outline:1px solid transparent;transform:translateX(50%)}.triad-axis-x{background-color:#ea3324}.triad-axis-y{background-color:#4faf32}.triad-axis-z{background-color:#0000ff}.triad-label{font-family:Arial, Helvetica, sans-serif;font-size:0.6875rem}.triad-label-x{color:#ea3324}.triad-label-y{color:#4faf32}.triad-label-z{color:#0000ff}.cube{pointer-events:initial}.cube:hover .cube-side-face{opacity:1}.cube-side{backface-visibility:hidden;-webkit-backface-visibility:hidden}.cube-side-face{box-sizing:border-box;font-size:0.875rem;text-transform:uppercase;width:100%;height:100%;background-color:var(--viewer-view-cube-side-background);border:var(--viewer-view-cube-side-border);display:flex;align-items:center;justify-content:center;outline:1px solid transparent;opacity:var(--viewer-view-cube-opacity);transition:opacity 0.2s ease-in-out}.cube-side-face::before{content:'';position:absolute;left:calc(var(--viewer-view-cube-edge-length) - 4px);right:calc(var(--viewer-view-cube-edge-length) - 4px);top:calc(var(--viewer-view-cube-edge-length) - 4px);bottom:calc(var(--viewer-view-cube-edge-length) - 4px)}.cube-corner,.cube-edge{position:relative}.cube-corner-face,.cube-edge-face{position:absolute;backface-visibility:hidden;-webkit-backface-visibility:hidden}.cube-edge-face.top{top:0;left:var(--viewer-view-cube-edge-length);right:var(--viewer-view-cube-edge-length);height:var(--viewer-view-cube-edge-length)}.cube-edge-face.bottom{bottom:0;left:var(--viewer-view-cube-edge-length);right:var(--viewer-view-cube-edge-length);height:var(--viewer-view-cube-edge-length)}.cube-edge-face.left{left:0;top:var(--viewer-view-cube-edge-length);bottom:var(--viewer-view-cube-edge-length);width:var(--viewer-view-cube-edge-length)}.cube-edge-face.right{right:0;top:var(--viewer-view-cube-edge-length);bottom:var(--viewer-view-cube-edge-length);width:var(--viewer-view-cube-edge-length)}.cube-corner-face{width:var(--viewer-view-cube-edge-length);height:var(--viewer-view-cube-edge-length)}.cube-corner-face.top-left{top:0;left:0}.cube-corner-face.top-right{top:0;right:0}.cube-corner-face.bottom-right{bottom:0;right:0}.cube-corner-face.bottom-left{bottom:0;left:0}.cube-shadow{backface-visibility:hidden;-webkit-backface-visibility:hidden}.cube-shadow-face{position:absolute;left:4px;right:4px;top:4px;bottom:4px;background-color:black;opacity:0.12;filter:blur(4px)}.cube-corner .cube-corner-face,.cube-edge .cube-edge-face,.cube-side .cube-side-face::before{background:var(--viewer-view-cube-side-background-hover);opacity:0}.cube-corner:hover .cube-corner-face,.cube-edge:hover .cube-edge-face,.cube-side:hover .cube-side-face::before{opacity:var(--viewer-view-cube-side-background-hover-opacity)}.cube-corner.disabled,.cube-edge.disabled,.cube-side.disabled{pointer-events:none}";export{p as vertex_viewer_view_cube}
4
+ import{h as e,F as t,r as i,H as o}from"./p-c9d8a379.js";import{v as r,q as a,s as n}from"./p-640cb5f8.js";import{r as c}from"./p-9f048664.js";import{O as s,c as d,e as h}from"./p-21e8510d.js";import{c as l}from"./p-f482325b.js";import"./p-59d075d4.js";import"./p-112455b1.js";const f={front:{direction:r.back(),quaternion:a.create()},back:{direction:r.forward(),quaternion:a.fromAxisAngle(r.up(),Math.PI)},left:{direction:r.right(),quaternion:a.fromAxisAngle(r.down(),Math.PI/2)},right:{direction:r.left(),quaternion:a.fromAxisAngle(r.up(),Math.PI/2)},top:{direction:r.up(),quaternion:a.fromAxisAngle(r.right(),Math.PI/2)},bottom:{direction:r.down(),quaternion:a.fromAxisAngle(r.left(),Math.PI/2)}},b=({label:i,length:o,rotationAxis:c})=>{const s={width:`${o+5}px`},d=a.fromAxisAngle(c,Math.PI/2),h=r.scale(o+15,r.right());return e(t,null,e("vertex-viewer-dom-group",{quaternion:d},e("vertex-viewer-dom-element",{style:s,billboardOff:!0,interactionsOff:!0},e("div",{class:`triad-axis triad-axis-${i.toLowerCase()}`})),e("vertex-viewer-dom-element",{rotation:n.create({x:Math.PI/2,y:0,z:0}),style:s,billboardOff:!0,interactionsOff:!0},e("div",{class:`triad-axis triad-axis-${i.toLowerCase()}`})),e("vertex-viewer-dom-element",{position:h,interactionsOff:!0},e("div",{class:`triad-label triad-label-${i.toLowerCase()}`},i))))},g=({label:t,length:i,side:o,disabled:a,onPointerDown:n})=>{const{direction:c,quaternion:s}=f[o],d=r.scale(i/2-.1,c);return e("vertex-viewer-dom-element",{class:l("cube-side",{disabled:a}),position:d,quaternion:s,style:{width:`${i}px`,height:`${i}px`},onPointerDown:n,billboardOff:!0},e("div",{class:`cube-side-face cube-side-face-${t.toLowerCase()}`},t))},v=({length:t,face1Side:i,face1Corner:o,face2Side:a,face2Corner:n,face3Side:c,face3Corner:s,disabled:d,onPointerDown:h})=>{const{direction:b,quaternion:g}=f[i],{direction:v,quaternion:u}=f[a],{direction:w,quaternion:p}=f[c],m=r.scale(t/2,b),x=r.scale(t/2,v),S=r.scale(t/2,w),k={width:`${t}px`,height:`${t}px`};return e("vertex-viewer-dom-group",{class:l("cube-corner",{disabled:d}),onPointerDown:h},e("vertex-viewer-dom-element",{position:m,quaternion:g,style:k,billboardOff:!0},e("div",{class:`cube-corner-face ${o}`})),e("vertex-viewer-dom-element",{position:x,quaternion:u,style:k,billboardOff:!0},e("div",{class:`cube-corner-face ${n}`})),e("vertex-viewer-dom-element",{position:S,quaternion:p,style:k,billboardOff:!0},e("div",{class:`cube-corner-face ${s}`})))},u=({length:t,face1Side:i,face2Side:o,face1Edge:a,face2Edge:n,disabled:c,onPointerDown:s})=>{const{direction:d,quaternion:h}=f[i],{direction:b,quaternion:g}=f[o],v=r.scale(t/2,d),u=r.scale(t/2,b),w={width:`${t}px`,height:`${t}px`};return e("vertex-viewer-dom-group",{class:l("cube-edge",{disabled:c}),onPointerDown:s},e("vertex-viewer-dom-element",{position:v,quaternion:h,style:w,billboardOff:!0},e("div",{class:`cube-edge-face ${a}`})),e("vertex-viewer-dom-element",{position:u,quaternion:g,style:w,billboardOff:!0},e("div",{class:`cube-edge-face ${n}`})))},w=({length:t})=>{const{direction:i,quaternion:o}=f.top,a=r.scale(-t/2,i);return e("vertex-viewer-dom-element",{class:"cube-shadow",position:a,quaternion:o,style:{width:`${t}px`,height:`${t}px`},billboardOff:!0,interactionsOff:!0},e("div",{class:"cube-shadow-face"}))},p=class{constructor(e){i(this,e),this.boxLength=80,this.triadPosition=r.origin(),this.xPositiveLabel="Left",this.xNegativeLabel="Right",this.yPositiveLabel="Top",this.yNegativeLabel="Bottom",this.zPositiveLabel="Front",this.zNegativeLabel="Back",this.standardViewsOff=!1,this.animationDuration=500,this.triadOff=!1,this.worldOrientation=s.DEFAULT,this.updateMatrices=()=>{var e;if(null!=(null===(e=this.viewer)||void 0===e?void 0:e.frame)){const{camera:e}=this.viewer.frame.scene,t=this.boxLength/2;this.triadPosition=r.create(-t-5,-t-5,-t-5);const i=21.5;this.camera=new d(r.scale(3.125*this.boxLength,r.negate(e.direction)),r.origin(),e.up,.1,100,1,i),this.worldOrientation=this.viewer.frame.scene.worldOrientation}}}handleViewerChanged(e,t){null==t||t.removeEventListener("frameDrawn",this.updateMatrices),null==e||e.addEventListener("frameDrawn",this.updateMatrices),this.updateMatrices()}handleStandardView(e){return this.standardViewsOff?async()=>{}:async()=>{if(null!=this.viewer){const t=await this.viewer.scene(),i=this.animationDuration>0?{animation:{milliseconds:this.animationDuration}}:{},o=e.transformMatrix(this.worldOrientation.matrix);t.camera().standardView(o).viewAll().render(i)}}}componentWillLoad(){this.handleViewerChanged(this.viewer)}componentDidLoad(){null!=this.rendererEl&&(new ResizeObserver((()=>this.handleRendererResized())).observe(this.rendererEl),this.handleRendererResized())}handleRendererResized(){c((()=>{if(null!=this.rendererEl){const e=this.rendererEl.getBoundingClientRect();this.boxLength=Math.min(e.width,e.height)}}))}render(){return e(o,null,e("vertex-viewer-dom-renderer",{ref:e=>this.rendererEl=e,class:"renderer",camera:this.camera},!this.triadOff&&e("vertex-viewer-dom-group",{class:"triad",position:this.triadPosition},e(b,{label:"X",length:this.boxLength,rotationAxis:r.origin()}),e(b,{label:"Y",length:this.boxLength,rotationAxis:r.forward()}),e(b,{label:"Z",length:this.boxLength,rotationAxis:r.up()})),e("vertex-viewer-dom-group",{class:"cube",matrix:this.worldOrientation.matrix},e(w,{length:this.boxLength+10}),e(g,{label:this.zPositiveLabel,length:this.boxLength,side:"front",onPointerDown:this.handleStandardView(h.FRONT),disabled:this.standardViewsOff}),e(g,{label:this.zNegativeLabel,length:this.boxLength,side:"back",onPointerDown:this.handleStandardView(h.BACK),disabled:this.standardViewsOff}),e(g,{label:this.xNegativeLabel,length:this.boxLength,side:"left",onPointerDown:this.handleStandardView(h.LEFT),disabled:this.standardViewsOff}),e(g,{label:this.xPositiveLabel,length:this.boxLength,side:"right",onPointerDown:this.handleStandardView(h.RIGHT),disabled:this.standardViewsOff}),e(g,{label:this.yPositiveLabel,length:this.boxLength,side:"top",onPointerDown:this.handleStandardView(h.TOP),disabled:this.standardViewsOff}),e(g,{label:this.yNegativeLabel,length:this.boxLength,side:"bottom",onPointerDown:this.handleStandardView(h.BOTTOM),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"top",face1Edge:"bottom",face2Side:"front",face2Edge:"top",onPointerDown:this.handleStandardView(h.TOP_FRONT),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"front",face1Edge:"right",face2Side:"left",face2Edge:"left",onPointerDown:this.handleStandardView(h.FRONT_LEFT),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"bottom",face1Edge:"top",face2Side:"front",face2Edge:"bottom",onPointerDown:this.handleStandardView(h.BOTTOM_FRONT),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"front",face1Edge:"left",face2Side:"right",face2Edge:"right",onPointerDown:this.handleStandardView(h.FRONT_RIGHT),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"top",face1Edge:"right",face2Side:"left",face2Edge:"top",onPointerDown:this.handleStandardView(h.TOP_LEFT),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"back",face1Edge:"left",face2Side:"left",face2Edge:"right",onPointerDown:this.handleStandardView(h.BACK_LEFT),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"bottom",face1Edge:"right",face2Side:"left",face2Edge:"bottom",onPointerDown:this.handleStandardView(h.BOTTOM_LEFT),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"top",face1Edge:"top",face2Side:"back",face2Edge:"top",onPointerDown:this.handleStandardView(h.TOP_BACK),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"back",face1Edge:"right",face2Side:"right",face2Edge:"left",onPointerDown:this.handleStandardView(h.BACK_RIGHT),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"bottom",face1Edge:"bottom",face2Side:"back",face2Edge:"bottom",onPointerDown:this.handleStandardView(h.BOTTOM_BACK),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"top",face1Edge:"left",face2Side:"right",face2Edge:"top",onPointerDown:this.handleStandardView(h.TOP_RIGHT),disabled:this.standardViewsOff}),e(u,{length:this.boxLength,face1Side:"bottom",face1Edge:"left",face2Side:"right",face2Edge:"bottom",onPointerDown:this.handleStandardView(h.BOTTOM_RIGHT),disabled:this.standardViewsOff}),e(v,{length:this.boxLength,face1Side:"top",face1Corner:"bottom-left",face2Side:"front",face2Corner:"top-left",face3Side:"right",face3Corner:"top-right",onPointerDown:this.handleStandardView(h.TOP_FRONT_RIGHT),disabled:this.standardViewsOff}),e(v,{length:this.boxLength,face1Side:"top",face1Corner:"bottom-right",face2Side:"front",face2Corner:"top-right",face3Side:"left",face3Corner:"top-left",onPointerDown:this.handleStandardView(h.TOP_FRONT_LEFT),disabled:this.standardViewsOff}),e(v,{length:this.boxLength,face1Side:"bottom",face1Corner:"top-right",face2Side:"front",face2Corner:"bottom-right",face3Side:"left",face3Corner:"bottom-left",onPointerDown:this.handleStandardView(h.BOTTOM_FRONT_LEFT),disabled:this.standardViewsOff}),e(v,{length:this.boxLength,face1Side:"bottom",face1Corner:"top-left",face2Side:"front",face2Corner:"bottom-left",face3Side:"right",face3Corner:"bottom-right",onPointerDown:this.handleStandardView(h.BOTTOM_FRONT_RIGHT),disabled:this.standardViewsOff}),e(v,{length:this.boxLength,face1Side:"top",face1Corner:"top-right",face2Side:"back",face2Corner:"top-left",face3Side:"left",face3Corner:"top-right",onPointerDown:this.handleStandardView(h.TOP_BACK_LEFT),disabled:this.standardViewsOff}),e(v,{length:this.boxLength,face1Side:"top",face1Corner:"top-left",face2Side:"back",face2Corner:"top-right",face3Side:"right",face3Corner:"top-left",onPointerDown:this.handleStandardView(h.TOP_BACK_RIGHT),disabled:this.standardViewsOff}),e(v,{length:this.boxLength,face1Side:"bottom",face1Corner:"bottom-left",face2Side:"back",face2Corner:"bottom-right",face3Side:"right",face3Corner:"bottom-left",onPointerDown:this.handleStandardView(h.BOTTOM_BACK_RIGHT),disabled:this.standardViewsOff}),e(v,{length:this.boxLength,face1Side:"bottom",face1Corner:"bottom-right",face2Side:"back",face2Corner:"bottom-left",face3Side:"left",face3Corner:"bottom-right",onPointerDown:this.handleStandardView(h.BOTTOM_BACK_LEFT),disabled:this.standardViewsOff}))))}static get watchers(){return{viewer:["handleViewerChanged"]}}};p.style=":host{--viewer-view-cube-side-background:var(--white);--viewer-view-cube-side-background-hover:var(--blue-500);--viewer-view-cube-side-background-hover-opacity:0.25;--viewer-view-cube-side-border:1.5px solid var(--neutral-500);--viewer-view-cube-edge-length:12px;--viewer-view-cube-opacity:0.8;display:block;color:var(--neutral-700);width:80px;height:80px;margin:20px;position:relative;display:flex;align-items:center;justify-content:center;user-select:none}.renderer{position:unset;width:100%;height:100%;overflow:visible}.reference-point{width:5px;height:5px;border-radius:50%;background-color:black}.triad{pointer-events:none}.triad-axis{width:100%;height:1.5px;outline:1px solid transparent;transform:translateX(50%)}.triad-axis-x{background-color:#ea3324}.triad-axis-y{background-color:#4faf32}.triad-axis-z{background-color:#0000ff}.triad-label{font-family:Arial, Helvetica, sans-serif;font-size:0.6875rem}.triad-label-x{color:#ea3324}.triad-label-y{color:#4faf32}.triad-label-z{color:#0000ff}.cube{pointer-events:initial}.cube:hover .cube-side-face{opacity:1}.cube-side{backface-visibility:hidden;-webkit-backface-visibility:hidden}.cube-side-face{box-sizing:border-box;font-size:0.875rem;text-transform:uppercase;width:100%;height:100%;background-color:var(--viewer-view-cube-side-background);border:var(--viewer-view-cube-side-border);display:flex;align-items:center;justify-content:center;outline:1px solid transparent;opacity:var(--viewer-view-cube-opacity);transition:opacity 0.2s ease-in-out}.cube-side-face::before{content:'';position:absolute;left:calc(var(--viewer-view-cube-edge-length) - 4px);right:calc(var(--viewer-view-cube-edge-length) - 4px);top:calc(var(--viewer-view-cube-edge-length) - 4px);bottom:calc(var(--viewer-view-cube-edge-length) - 4px)}.cube-corner,.cube-edge{position:relative}.cube-corner-face,.cube-edge-face{position:absolute;backface-visibility:hidden;-webkit-backface-visibility:hidden}.cube-edge-face.top{top:0;left:var(--viewer-view-cube-edge-length);right:var(--viewer-view-cube-edge-length);height:var(--viewer-view-cube-edge-length)}.cube-edge-face.bottom{bottom:0;left:var(--viewer-view-cube-edge-length);right:var(--viewer-view-cube-edge-length);height:var(--viewer-view-cube-edge-length)}.cube-edge-face.left{left:0;top:var(--viewer-view-cube-edge-length);bottom:var(--viewer-view-cube-edge-length);width:var(--viewer-view-cube-edge-length)}.cube-edge-face.right{right:0;top:var(--viewer-view-cube-edge-length);bottom:var(--viewer-view-cube-edge-length);width:var(--viewer-view-cube-edge-length)}.cube-corner-face{width:var(--viewer-view-cube-edge-length);height:var(--viewer-view-cube-edge-length)}.cube-corner-face.top-left{top:0;left:0}.cube-corner-face.top-right{top:0;right:0}.cube-corner-face.bottom-right{bottom:0;right:0}.cube-corner-face.bottom-left{bottom:0;left:0}.cube-shadow{backface-visibility:hidden;-webkit-backface-visibility:hidden}.cube-shadow-face{position:absolute;left:4px;right:4px;top:4px;bottom:4px;background-color:black;opacity:0.12;filter:blur(4px)}.cube-corner .cube-corner-face,.cube-edge .cube-edge-face,.cube-side .cube-side-face::before{background:var(--viewer-view-cube-side-background-hover);opacity:0}.cube-corner:hover .cube-corner-face,.cube-edge:hover .cube-edge-face,.cube-side:hover .cube-side-face::before{opacity:var(--viewer-view-cube-side-background-hover-opacity)}.cube-corner.disabled,.cube-edge.disabled,.cube-side.disabled{pointer-events:none}";export{p as vertex_viewer_view_cube}
@@ -0,0 +1,4 @@
1
+ /**!
2
+ * Copyright (c) 2021 Vertex Software LLC. All rights reserved.
3
+ */
4
+ import{p as s,g as r}from"./p-640cb5f8.js";import{a as o}from"./p-59d075d4.js";class l{constructor(r){var l,i,a;this.start=null!==(l=r.start)&&void 0!==l?l:s.create(),this.end=null!==(i=r.end)&&void 0!==i?i:s.create(),this.id=null!==(a=r.id)&&void 0!==a?a:`arrow-markup--${o.create()}`}}class i{constructor(s){var l,i;this.bounds=null!==(l=s.bounds)&&void 0!==l?l:r.create(0,0,0,0),this.id=null!==(i=s.id)&&void 0!==i?i:`circle-markup--${o.create()}`}}class a{constructor(s){var l,i,a;this.bounds=null!==(l=s.bounds)&&void 0!==l?l:r.create(0,0,0,0),this.points=null!==(i=s.points)&&void 0!==i?i:[],this.id=null!==(a=s.id)&&void 0!==a?a:`freeform-markup--${o.create()}`}}export{l as A,i as C,a as F}
@@ -0,0 +1,17 @@
1
+ /**!
2
+ * Copyright (c) 2021 Vertex Software LLC. All rights reserved.
3
+ */
4
+ import{_ as r,a as n,i as t,d as e,c as u,b as i}from"./p-640cb5f8.js";var o=Object.freeze({__proto__:null,delay:function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return n(this,void 0,void 0,(function(){var n,t,e;return i(this,(function(u){switch(u.label){case 0:return"number"!=typeof(n=r[0])?[3,4]:(t=r[1],e=new Promise((function(r){return setTimeout(r,n)})),null==t?[3,2]:[4,e]);case 1:return u.sent(),[2,t];case 2:return[2,e];case 3:return[3,5];case 4:return[2,Promise.reject(new TypeError("First argument to `delay` must be a number"))];case 5:return[2]}}))}))},timeout:function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var t=r[0];if("number"==typeof t){var e=r[1],u=new Promise((function(r,n){return setTimeout((function(){return n(new Error("Promise timed out after "+t+"ms"))}),t)}));return null!=e?Promise.race([e,u]):u}return Promise.reject("First argument to `timeout` must be a number")}}),f=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(.+)\s*\)/,a=/^(#|0x)?([A-Fa-f0-9]{6})$/,s=function(r,n,t,e){return void 0===e&&(e=255),{r,g:n,b:t,a:e}},v=function(r){var n=16777215&r;return s(n>>16&255,n>>8&255,255&n)},l=function(r){var n=a.exec(r);if(null!=n)return v(parseInt(n[2],16))},d=function(r){var n=r.toString(16);return 1===n.length?"0"+n:n},p=Object.freeze({__proto__:null,create:s,fromNumber:v,fromHexString:l,fromCss:function(r){var n=f.exec(r);if(null!=n)return s(parseInt(n[1]),parseInt(n[2]),parseInt(n[3]));var t=c.exec(r);return null!=t?s(parseInt(t[1]),parseInt(t[2]),parseInt(t[3]),Math.floor(255*parseFloat(t[4]))):a.test(r)?l(r):void 0},fromArray:function(r){return s(r[0],r[1],r[2],r[3])},isInvisible:function(r){return 0===r.a},isOpaque:function(r){return 255===r.a},toHexString:function(r){return"#"+d(r.r)+d(r.g)+d(r.b)}}),h=function(n){function t(r){var t=n.call(this,"Validation error while mapping object.")||this;return t.errors=r,t}return r(t,n),t}(Error);function b(r){return function(n){return null!=n?n:{errors:[r+" is required."]}}}function y(r,n){return function(t){return n(t[r])}}function m(r){return null!=r&&r.hasOwnProperty("errors")}function j(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return function(n){return r.reduce((function(r,n){return m(r)?r:n(r)}),n)}}var w=Object.freeze({__proto__:null,MapperValidationError:h,required:b,requiredProp:function(r){return function(n){var t=n[r];return null!=t?t:{errors:[r+" is required"]}}},ifDefined:function(r){return function(n){return null!=n?r(n):n}},getProp:function(r){return function(n){return n[r]}},mapProp:y,mapRequiredProp:function(r,n){return y(r,j(b(r.toString()),n))},mapArray:function(r){return function(n){if(n.length>0){var u=t(n),i=u[0],o=u.slice(1),f=r(i);return o.reduce((function(n,u){var i=r(u);return m(i)?m(n)?{errors:e(e([],t(n.errors),!1),t(i.errors),!1)}:i:m(n)?n:e(e([],t(n),!1),[i],!1)}),m(f)?f:[f])}return[]}},isInvalid:m,ifInvalidThrow:function(r){return function(n){var t=r(n);if(m(t))throw new h(t.errors);return t}},read:function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return function(n){return r.reduce((function(r,u){var i=u(n);return m(i)?m(r)?{errors:e(e([],t(r.errors),!1),t(i.errors),!1)}:i:m(r)?r:e(e([],t(r),!1),[i],!1)}),[])}},defineMapper:function(r,n){return function(t){var e,u,i=r(t);return u=n,m(e=i)?e:u(e)}},compose:j});
5
+ /*!
6
+ * isobject <https://github.com/jonschlinkert/isobject>
7
+ *
8
+ * Copyright (c) 2014-2017, Jon Schlinkert.
9
+ * Released under the MIT License.
10
+ */
11
+ /*!
12
+ * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
13
+ *
14
+ * Copyright (c) 2014-2017, Jon Schlinkert.
15
+ * Released under the MIT License.
16
+ */
17
+ function _(r){return 1==(null!=(n=r)&&"object"==typeof n&&!1===Array.isArray(n))&&"[object Object]"===Object.prototype.toString.call(r);var n}var g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},O={exports:{}};!function(r,n){var t="__lodash_hash_undefined__",e=9007199254740991,u="[object Arguments]",i="[object Array]",o="[object Boolean]",f="[object Date]",c="[object Error]",a="[object Function]",s="[object Map]",v="[object Number]",l="[object Object]",d="[object Promise]",p="[object RegExp]",h="[object Set]",b="[object String]",y="[object WeakMap]",m="[object ArrayBuffer]",j="[object DataView]",w=/^\[object .+?Constructor\]$/,_=/^(?:0|[1-9]\d*)$/,O={};O["[object Float32Array]"]=O["[object Float64Array]"]=O["[object Int8Array]"]=O["[object Int16Array]"]=O["[object Int32Array]"]=O["[object Uint8Array]"]=O["[object Uint8ClampedArray]"]=O["[object Uint16Array]"]=O["[object Uint32Array]"]=!0,O[u]=O[i]=O[m]=O[o]=O[j]=O[f]=O[c]=O[a]=O[s]=O[v]=O[l]=O[p]=O[h]=O[b]=O[y]=!1;var A="object"==typeof g&&g&&g.Object===Object&&g,P="object"==typeof self&&self&&self.Object===Object&&self,E=A||P||Function("return this")(),S=n&&!n.nodeType&&n,I=S&&r&&!r.nodeType&&r,q=I&&I.exports===S,F=q&&A.process,C=function(){try{return F&&F.binding&&F.binding("util")}catch(r){}}(),M=C&&C.isTypedArray;function $(r,n){for(var t=-1,e=null==r?0:r.length;++t<e;)if(n(r[t],t,r))return!0;return!1}function x(r){var n=-1,t=Array(r.size);return r.forEach((function(r,e){t[++n]=[e,r]})),t}function T(r){var n=-1,t=Array(r.size);return r.forEach((function(r){t[++n]=r})),t}var k,D,R,U=Array.prototype,N=Object.prototype,V=E["__core-js_shared__"],Q=Function.prototype.toString,B=N.hasOwnProperty,H=(k=/[^.]+$/.exec(V&&V.keys&&V.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",J=N.toString,W=RegExp("^"+Q.call(B).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),G=q?E.Buffer:void 0,L=E.Symbol,z=E.Uint8Array,K=N.propertyIsEnumerable,X=U.splice,Y=L?L.toStringTag:void 0,Z=Object.getOwnPropertySymbols,rr=G?G.isBuffer:void 0,nr=(D=Object.keys,R=Object,function(r){return D(R(r))}),tr=Sr(E,"DataView"),er=Sr(E,"Map"),ur=Sr(E,"Promise"),ir=Sr(E,"Set"),or=Sr(E,"WeakMap"),fr=Sr(Object,"create"),cr=Cr(tr),ar=Cr(er),sr=Cr(ur),vr=Cr(ir),lr=Cr(or),dr=L?L.prototype:void 0,pr=dr?dr.valueOf:void 0;function hr(r){var n=-1,t=null==r?0:r.length;for(this.clear();++n<t;){var e=r[n];this.set(e[0],e[1])}}function br(r){var n=-1,t=null==r?0:r.length;for(this.clear();++n<t;){var e=r[n];this.set(e[0],e[1])}}function yr(r){var n=-1,t=null==r?0:r.length;for(this.clear();++n<t;){var e=r[n];this.set(e[0],e[1])}}function mr(r){var n=-1,t=null==r?0:r.length;for(this.__data__=new yr;++n<t;)this.add(r[n])}function jr(r){var n=this.__data__=new br(r);this.size=n.size}function wr(r,n){for(var t=r.length;t--;)if(Mr(r[t][0],n))return t;return-1}function _r(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":Y&&Y in Object(r)?function(r){var n=B.call(r,Y),t=r[Y];try{r[Y]=void 0;var e=!0}catch(r){}var u=J.call(r);return e&&(n?r[Y]=t:delete r[Y]),u}(r):function(r){return J.call(r)}(r)}function gr(r){return Ur(r)&&_r(r)==u}function Or(r,n,t,e,a){return r===n||(null==r||null==n||!Ur(r)&&!Ur(n)?r!=r&&n!=n:function(r,n,t,e,a,d){var y=xr(r),w=xr(n),_=y?i:qr(r),g=w?i:qr(n),O=(_=_==u?l:_)==l,A=(g=g==u?l:g)==l,P=_==g;if(P&&Tr(r)){if(!Tr(n))return!1;y=!0,O=!1}if(P&&!O)return d||(d=new jr),y||Nr(r)?Ar(r,n,t,e,a,d):function(r,n,t,e,u,i,a){switch(t){case j:if(r.byteLength!=n.byteLength||r.byteOffset!=n.byteOffset)return!1;r=r.buffer,n=n.buffer;case m:return!(r.byteLength!=n.byteLength||!i(new z(r),new z(n)));case o:case f:case v:return Mr(+r,+n);case c:return r.name==n.name&&r.message==n.message;case p:case b:return r==n+"";case s:var l=x;case h:if(l||(l=T),r.size!=n.size&&!(1&e))return!1;var d=a.get(r);if(d)return d==n;e|=2,a.set(r,n);var y=Ar(l(r),l(n),e,u,i,a);return a.delete(r),y;case"[object Symbol]":if(pr)return pr.call(r)==pr.call(n)}return!1}(r,n,_,t,e,a,d);if(!(1&t)){var E=O&&B.call(r,"__wrapped__"),S=A&&B.call(n,"__wrapped__");if(E||S){var I=E?r.value():r,q=S?n.value():n;return d||(d=new jr),a(I,q,t,e,d)}}return!!P&&(d||(d=new jr),function(r,n,t,e,u,i){var o=1&t,f=Pr(r),c=f.length;if(c!=Pr(n).length&&!o)return!1;for(var a=c;a--;){var s=f[a];if(!(o?s in n:B.call(n,s)))return!1}var v=i.get(r);if(v&&i.get(n))return v==n;var l=!0;i.set(r,n),i.set(n,r);for(var d=o;++a<c;){var p=r[s=f[a]],h=n[s];if(e)var b=o?e(h,p,s,n,r,i):e(p,h,s,r,n,i);if(!(void 0===b?p===h||u(p,h,t,e,i):b)){l=!1;break}d||(d="constructor"==s)}if(l&&!d){var y=r.constructor,m=n.constructor;y==m||!("constructor"in r)||!("constructor"in n)||"function"==typeof y&&y instanceof y&&"function"==typeof m&&m instanceof m||(l=!1)}return i.delete(r),i.delete(n),l}(r,n,t,e,a,d))}(r,n,t,e,Or,a))}function Ar(r,n,t,e,u,i){var o=1&t,f=r.length,c=n.length;if(f!=c&&!(o&&c>f))return!1;var a=i.get(r);if(a&&i.get(n))return a==n;var s=-1,v=!0,l=2&t?new mr:void 0;for(i.set(r,n),i.set(n,r);++s<f;){var d=r[s],p=n[s];if(e)var h=o?e(p,d,s,n,r,i):e(d,p,s,r,n,i);if(void 0!==h){if(h)continue;v=!1;break}if(l){if(!$(n,(function(r,n){if(!l.has(n)&&(d===r||u(d,r,t,e,i)))return l.push(n)}))){v=!1;break}}else if(d!==p&&!u(d,p,t,e,i)){v=!1;break}}return i.delete(r),i.delete(n),v}function Pr(r){return function(r,n,t){var e=n(r);return xr(r)?e:function(r,n){for(var t=-1,e=n.length,u=r.length;++t<e;)r[u+t]=n[t];return r}(e,t(r))}(r,Vr,Ir)}function Er(r,n){var t,e,u=r.__data__;return("string"==(e=typeof(t=n))||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t)?u["string"==typeof n?"string":"hash"]:u.map}function Sr(r,n){var t=function(r,n){return null==r?void 0:r[n]}(r,n);return function(r){return!(!Rr(r)||function(r){return!!H&&H in r}(r))&&(kr(r)?W:w).test(Cr(r))}(t)?t:void 0}hr.prototype.clear=function(){this.__data__=fr?fr(null):{},this.size=0},hr.prototype.delete=function(r){var n=this.has(r)&&delete this.__data__[r];return this.size-=n?1:0,n},hr.prototype.get=function(r){var n=this.__data__;if(fr){var e=n[r];return e===t?void 0:e}return B.call(n,r)?n[r]:void 0},hr.prototype.has=function(r){var n=this.__data__;return fr?void 0!==n[r]:B.call(n,r)},hr.prototype.set=function(r,n){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=fr&&void 0===n?t:n,this},br.prototype.clear=function(){this.__data__=[],this.size=0},br.prototype.delete=function(r){var n=this.__data__,t=wr(n,r);return!(t<0||(t==n.length-1?n.pop():X.call(n,t,1),--this.size,0))},br.prototype.get=function(r){var n=this.__data__,t=wr(n,r);return t<0?void 0:n[t][1]},br.prototype.has=function(r){return wr(this.__data__,r)>-1},br.prototype.set=function(r,n){var t=this.__data__,e=wr(t,r);return e<0?(++this.size,t.push([r,n])):t[e][1]=n,this},yr.prototype.clear=function(){this.size=0,this.__data__={hash:new hr,map:new(er||br),string:new hr}},yr.prototype.delete=function(r){var n=Er(this,r).delete(r);return this.size-=n?1:0,n},yr.prototype.get=function(r){return Er(this,r).get(r)},yr.prototype.has=function(r){return Er(this,r).has(r)},yr.prototype.set=function(r,n){var t=Er(this,r),e=t.size;return t.set(r,n),this.size+=t.size==e?0:1,this},mr.prototype.add=mr.prototype.push=function(r){return this.__data__.set(r,t),this},mr.prototype.has=function(r){return this.__data__.has(r)},jr.prototype.clear=function(){this.__data__=new br,this.size=0},jr.prototype.delete=function(r){var n=this.__data__,t=n.delete(r);return this.size=n.size,t},jr.prototype.get=function(r){return this.__data__.get(r)},jr.prototype.has=function(r){return this.__data__.has(r)},jr.prototype.set=function(r,n){var t=this.__data__;if(t instanceof br){var e=t.__data__;if(!er||e.length<199)return e.push([r,n]),this.size=++t.size,this;t=this.__data__=new yr(e)}return t.set(r,n),this.size=t.size,this};var Ir=Z?function(r){return null==r?[]:(r=Object(r),function(n){for(var t=-1,e=null==n?0:n.length,u=0,i=[];++t<e;){var o=n[t];K.call(r,o)&&(i[u++]=o)}return i}(Z(r)))}:function(){return[]},qr=_r;function Fr(r,n){return!!(n=null==n?e:n)&&("number"==typeof r||_.test(r))&&r>-1&&r%1==0&&r<n}function Cr(r){if(null!=r){try{return Q.call(r)}catch(r){}try{return r+""}catch(r){}}return""}function Mr(r,n){return r===n||r!=r&&n!=n}(tr&&qr(new tr(new ArrayBuffer(1)))!=j||er&&qr(new er)!=s||ur&&qr(ur.resolve())!=d||ir&&qr(new ir)!=h||or&&qr(new or)!=y)&&(qr=function(r){var n=_r(r),t=n==l?r.constructor:void 0,e=t?Cr(t):"";if(e)switch(e){case cr:return j;case ar:return s;case sr:return d;case vr:return h;case lr:return y}return n});var $r=gr(function(){return arguments}())?gr:function(r){return Ur(r)&&B.call(r,"callee")&&!K.call(r,"callee")},xr=Array.isArray,Tr=rr||function(){return!1};function kr(r){if(!Rr(r))return!1;var n=_r(r);return n==a||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n}function Dr(r){return"number"==typeof r&&r>-1&&r%1==0&&r<=e}function Rr(r){var n=typeof r;return null!=r&&("object"==n||"function"==n)}function Ur(r){return null!=r&&"object"==typeof r}var Nr=M?function(r){return function(n){return r(n)}}(M):function(r){return Ur(r)&&Dr(r.length)&&!!O[_r(r)]};function Vr(r){return null!=(n=r)&&Dr(n.length)&&!kr(n)?function(r,n){var t=xr(r),e=!t&&$r(r),u=!t&&!e&&Tr(r),i=!t&&!e&&!u&&Nr(r),o=t||e||u||i,f=o?function(r,n){for(var t=-1,e=Array(r);++t<r;)e[t]=n(t);return e}(r.length,String):[],c=f.length;for(var a in r)!n&&!B.call(r,a)||o&&("length"==a||u&&("offset"==a||"parent"==a)||i&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||Fr(a,c))||f.push(a);return f}(r):function(r){if((n=r)!==("function"==typeof(t=n&&n.constructor)&&t.prototype||N))return nr(r);var n,t,e=[];for(var u in Object(r))B.call(r,u)&&"constructor"!=u&&e.push(u);return e}(r);var n}r.exports=function(r,n){return Or(r,n)}}(O,O.exports);var A=O.exports;function P(r){return!1!==_(n=r)&&"function"==typeof(t=n.constructor)&&!1!==_(e=t.prototype)&&!1!==e.hasOwnProperty("isPrototypeOf");var n,t,e}var E,S=Object.freeze({__proto__:null,defaults:function r(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var i=t(n),o=i[0],f=i.slice(1),c=u({},o);if(0===f.length)return c;if(1===f.length){var a=f[0];for(var s in a)null==c[s]?c[s]=a[s]:P(c[s])&&(c[s]=r(c[s],a[s]));return c}return f.reduce((function(n,t){return r(n,t)}),o)},isPlainObject:P,isEqual:function(r,n){return A(r,n)},toPairs:function(r){return null!=r?Object.keys(r).map((function(n){return[n,r[n]]})):[]},fromPairs:function(r){return Array.isArray(r)?r.reduce((function(r,n){var t;return null!=n?u(u({},r),((t={})[n[0]]=n[1],t)):r}),{}):{}}}),I=function(r,n){return r<n?-1:r>n?1:0},q=function(r){var n=/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(r);return null!=n?{scheme:n[2],authority:n[4],path:n[5],query:n[7],fragment:n[9]}:{}},F=function(r,n){var t="/"===r[0]?r:"/"+r;return u(u({},n),{path:t})},C=function(r){return null!=r.path?D(r.path.split("/")):[]},M=function(r,n){if(null!=r[1]){var i=e(e([],t(T(n)),!1),[r],!1);return u(u({},n),{query:i.map((function(r){return r.map(encodeURIComponent).join("=")})).join("&")})}return n},$=function(r,n){return r.reduce((function(r,n){return M(n,r)}),n)},x=function(r,n){return R(r).reduce((function(r,n){return M(n,r)}),n)},T=function(r){return null!=r.query?k(r.query):[]},k=function(r){return r.split("&").map((function(r){return r.split("=").map((function(r){return decodeURIComponent(r)}))}))},D=function(r){return r.filter((function(r){return r.length>0}))},R=function(r){var n=[];for(var t in r)n.push([t,r[t]]);return n},U=function(r){return r.concat().sort((n=I,function(r,e){var u=t(r,1)[0],i=t(e,1);return n(u,i[0])}));var n},N=Object.freeze({__proto__:null,parse:q,parseAndAddParams:function(r,n){var t=q(r);return n?x(n,t):t},isEqual:function(r,n){var t=JSON.stringify(U(T(r))),e=JSON.stringify(U(T(n)));return r.scheme===n.scheme&&r.authority===n.authority&&r.path===n.path&&r.fragment===n.fragment&&t===e},replacePath:F,pathAsArray:C,appendPath:function(r,n){var t=C(n),e=D(r.split("/"));return F(t.concat(e).join("/"),n)},addQueryString:function(r,n){var t=k(r);return $(t,n)},addQueryEntry:M,addQueryEntries:$,addQueryParams:x,replaceFragment:function(r,n){return u(u({},n),{fragment:r})},queryAsArray:T,queryAsMap:function(r){return T(r).reduce((function(r,n){var e,i=t(n,2),o=i[0],f=i[1];return u(u({},r),((e={})[o]=f,e))}),{})},toString:function(r){var n="";return null!=r.scheme&&r.scheme.length>0&&(n=r.scheme+":"),null!=r.authority&&r.authority.length>0&&(n+="//"+r.authority),n+=r.path,null!=r.query&&r.query.length>0&&(n+="?"+r.query),null!=r.fragment&&r.fragment.length>0&&(n+="#"+r.fragment),n}}),V=new Uint8Array(16);function Q(){if(!E&&!(E="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return E(V)}var B=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function H(r){return"string"==typeof r&&B.test(r)}for(var J,W,G=[],L=0;L<256;++L)G.push((L+256).toString(16).substr(1));var z=0,K=0;function X(r,n,t){var e=n&&t||0,u=n||new Array(16),i=(r=r||{}).node||J,o=void 0!==r.clockseq?r.clockseq:W;if(null==i||null==o){var f=r.random||(r.rng||Q)();null==i&&(i=J=[1|f[0],f[1],f[2],f[3],f[4],f[5]]),null==o&&(o=W=16383&(f[6]<<8|f[7]))}var c=void 0!==r.msecs?r.msecs:Date.now(),a=void 0!==r.nsecs?r.nsecs:K+1,s=c-z+(a-K)/1e4;if(s<0&&void 0===r.clockseq&&(o=o+1&16383),(s<0||c>z)&&void 0===r.nsecs&&(a=0),a>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");z=c,K=a,W=o;var v=(1e4*(268435455&(c+=122192928e5))+a)%4294967296;u[e++]=v>>>24&255,u[e++]=v>>>16&255,u[e++]=v>>>8&255,u[e++]=255&v;var l=c/4294967296*1e4&268435455;u[e++]=l>>>8&255,u[e++]=255&l,u[e++]=l>>>24&15|16,u[e++]=l>>>16&255,u[e++]=o>>>8|128,u[e++]=255&o;for(var d=0;d<6;++d)u[e+d]=i[d];return n||function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(G[r[n+0]]+G[r[n+1]]+G[r[n+2]]+G[r[n+3]]+"-"+G[r[n+4]]+G[r[n+5]]+"-"+G[r[n+6]]+G[r[n+7]]+"-"+G[r[n+8]]+G[r[n+9]]+"-"+G[r[n+10]]+G[r[n+11]]+G[r[n+12]]+G[r[n+13]]+G[r[n+14]]+G[r[n+15]]).toLowerCase();if(!H(t))throw TypeError("Stringified UUID is invalid");return t}(u)}var Y=Object.freeze({__proto__:null,create:function(){return X()}}),Z=function(){function r(){this.listeners=[]}return r.prototype.on=function(r){var n=this;return this.listeners.push(r),{dispose:function(){return n.off(r)}}},r.prototype.off=function(r){var n=this.listeners.indexOf(r);-1!==n&&this.listeners.splice(n,1)},r.prototype.emit=function(r){this.listeners.forEach((function(n){return n(r)}))},r}();export{Z as E,Y as a,o as b,p as c,w as m,S as o,N as u}
@@ -1,4 +1,4 @@
1
1
  /**!
2
2
  * Copyright (c) 2021 Vertex Software LLC. All rights reserved.
3
3
  */
4
- import{v as t,p as n,h as e,o as r}from"./p-d912dd24.js";function i(t,n,e,{ignoreDepthTest:r=!1}={}){if(null!=n){const i=e.transformPointToFrame(t,n),a=n.isDepthAtFarPlane(i),o=e.transformPointToWorldSpace(t,n);return a||r?o:void 0}}function a(n,e,r){const i=t.transformMatrix(n,e);return r.transformVectorToViewport(i)}function o(i,o,s){const{start:d,end:c,hideStart:u,hideEnd:E}=function(n,i){const{camera:a,projectionViewMatrix:o,viewport:s}=i,d=t.dot(t.subtract(n.start,a.position),a.direction),c=t.dot(t.subtract(n.end,a.position),a.direction),u=d<a.near,E=c<a.near;if(u||E){const t=s.plane(a),i=e.intersectLine(t,n),d=r.create({start:u&&null!=i?i:n.start,end:E&&null!=i?i:n.end}),c=r.transformMatrix(d,o);return{start:s.transformVectorToViewport(c.start),end:s.transformVectorToViewport(c.end),hideStart:u,hideEnd:E}}{const t=r.transformMatrix(n,o);return{start:s.transformVectorToViewport(t.start),end:s.transformVectorToViewport(t.end),hideStart:!1,hideEnd:!1}}}(i,s);return{startPt:d,endPt:c,labelPt:n.lerp(d,c,.5),indicatorPt:"none"!==o?function(t,n,e){return a("start"===n?t.start:t.end,e.projectionViewMatrix,e.viewport)}(i,o,s):void 0,hideStart:u,hideEnd:E}}function s(t){return t instanceof HTMLElement&&"VERTEX-VIEWER-MEASUREMENT-DISTANCE"===t.nodeName}const d=16,c=10;export{d as M,c as a,a as b,o as g,s as i,i as t}
4
+ import{v as t,p as n,h as e,o as r}from"./p-640cb5f8.js";function i(t,n,e,{ignoreDepthTest:r=!1}={}){if(null!=n){const i=e.transformPointToFrame(t,n),a=n.isDepthAtFarPlane(i),o=e.transformPointToWorldSpace(t,n);return a||r?o:void 0}}function a(n,e,r){const i=t.transformMatrix(n,e);return r.transformVectorToViewport(i)}function o(i,o,s){const{start:d,end:c,hideStart:u,hideEnd:E}=function(n,i){const{camera:a,projectionViewMatrix:o,viewport:s}=i,d=t.dot(t.subtract(n.start,a.position),a.direction),c=t.dot(t.subtract(n.end,a.position),a.direction),u=d<a.near,E=c<a.near;if(u||E){const t=s.plane(a),i=e.intersectLine(t,n),d=r.create({start:u&&null!=i?i:n.start,end:E&&null!=i?i:n.end}),c=r.transformMatrix(d,o);return{start:s.transformVectorToViewport(c.start),end:s.transformVectorToViewport(c.end),hideStart:u,hideEnd:E}}{const t=r.transformMatrix(n,o);return{start:s.transformVectorToViewport(t.start),end:s.transformVectorToViewport(t.end),hideStart:!1,hideEnd:!1}}}(i,s);return{startPt:d,endPt:c,labelPt:n.lerp(d,c,.5),indicatorPt:"none"!==o?function(t,n,e){return a("start"===n?t.start:t.end,e.projectionViewMatrix,e.viewport)}(i,o,s):void 0,hideStart:u,hideEnd:E}}function s(t){return t instanceof HTMLElement&&"VERTEX-VIEWER-MEASUREMENT-DISTANCE"===t.nodeName}const d=16,c=10;export{d as M,c as a,a as b,o as g,s as i,i as t}
@@ -0,0 +1,18 @@
1
+ /**!
2
+ * Copyright (c) 2021 Vertex Software LLC. All rights reserved.
3
+ */
4
+ /*! *****************************************************************************
5
+ Copyright (c) Microsoft Corporation.
6
+
7
+ Permission to use, copy, modify, and/or distribute this software for any
8
+ purpose with or without fee is hereby granted.
9
+
10
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16
+ PERFORMANCE OF THIS SOFTWARE.
17
+ ***************************************************************************** */
18
+ var n=function(t,r){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function u(){this.constructor=t}n(t,r),t.prototype=null===r?Object.create(r):(u.prototype=r.prototype,new u)}var r=function(){return(r=Object.assign||function(n){for(var t,r=1,u=arguments.length;r<u;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}).apply(this,arguments)};function u(n,t){var r={};for(var u in n)Object.prototype.hasOwnProperty.call(n,u)&&t.indexOf(u)<0&&(r[u]=n[u]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(u=Object.getOwnPropertySymbols(n);o<u.length;o++)t.indexOf(u[o])<0&&Object.prototype.propertyIsEnumerable.call(n,u[o])&&(r[u[o]]=n[u[o]])}return r}function o(n,t,r,u){return new(r||(r=Promise))((function(o,e){function i(n){try{c(u.next(n))}catch(n){e(n)}}function a(n){try{c(u.throw(n))}catch(n){e(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof r?t:new r((function(n){n(t)}))).then(i,a)}c((u=u.apply(n,t||[])).next())}))}function e(n,t){var r,u,o,e,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return e={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function a(e){return function(a){return function(e){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,u&&(o=2&e[0]?u.return:e[0]?u.throw||((o=u.return)&&o.call(u),0):u.next)&&!(o=o.call(u,e[1])).done)return o;switch(u=0,o&&(e=[2&e[0],o.value]),e[0]){case 0:case 1:o=e;break;case 4:return i.label++,{value:e[1],done:!1};case 5:i.label++,u=e[1],e=[0];continue;case 7:e=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==e[0]&&2!==e[0])){i=0;continue}if(3===e[0]&&(!o||e[1]>o[0]&&e[1]<o[3])){i.label=e[1];break}if(6===e[0]&&i.label<o[1]){i.label=o[1],o=e;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(e);break}o[2]&&i.ops.pop(),i.trys.pop();continue}e=t.call(n,i)}catch(n){e=[6,n],u=0}finally{r=o=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,a])}}}function i(n,t){var r="function"==typeof Symbol&&n[Symbol.iterator];if(!r)return n;var u,o,e=r.call(n),i=[];try{for(;(void 0===t||t-- >0)&&!(u=e.next()).done;)i.push(u.value)}catch(n){o={error:n}}finally{try{u&&!u.done&&(r=e.return)&&r.call(e)}finally{if(o)throw o.error}}return i}function a(n,t,r){if(r||2===arguments.length)for(var u,o=0,e=t.length;o<e;o++)!u&&o in t||(u||(u=Array.prototype.slice.call(t,0,o)),u[o]=t[o]);return n.concat(u||Array.prototype.slice.call(t))}function c(n,t,r){return Math.max(t,Math.min(r,n))}function f(n,t,r){return(r=c(r,0,1))*(t-n)+n}function h(n,t){return void 0===n&&(n=0),void 0===t&&(t=0),{x:n,y:t}}function l(n,t){return{x:n.x-t.x,y:n.y-t.y}}function v(n,t){return{x:n.x+t.x,y:n.y+t.y}}function s(n,t){return n.x===t.x&&n.y===t.y}var d=Object.freeze({__proto__:null,create:h,polar:function(n,t){return h(Math.cos(t)*n,Math.sin(t)*n)},distance:function(n,t){var r=l(n,t);return Math.sqrt(r.x*r.x+r.y*r.y)},subtract:l,add:v,isEqual:s,lerp:function(n,t,r){return{x:f(n.x,t.x,r),y:f(n.y,t.y,r)}},negate:function(n){return h(-n.x,-n.y)},scale:function(n,t,r){return{x:n.x*t,y:n.y*r}},fromJson:function(n){var t=JSON.parse(n);return Array.isArray(t)?h(t[0],t[1]):h(t.x,t.y)}});function M(n){return(n+3600)%360}function y(n){return n*(180/Math.PI)}function m(n){return n*(Math.PI/180)}var x=Object.freeze({__proto__:null,fromPoints:function(n,t){var r=l(t,n);return Math.atan2(r.y,r.x)},fromPointsInDegrees:function(n,t){var r=l(t,n);return M(y(Math.atan2(r.y,r.x))-270)},normalize:M,toDegrees:y,toRadians:m});function _(n,t,r,u,o,e,i,a,c,f,h,l,v,s,d,M){return[n,o,c,v,t,e,f,s,r,i,h,d,u,a,l,M]}function z(n){return[1,0,0,0,0,1,0,0,0,0,1,0,n.x,n.y,n.z,1]}function b(n){var t=n.x,r=n.y,u=n.z,o=n.w,e=t+t,i=r+r,a=u+u,c=t*e,f=t*i,h=t*a,l=r*i,v=r*a,s=u*a,d=o*e,M=o*i,y=o*a;return[1-(l+s),f-y,h+M,0,f+y,1-(c+s),v-d,0,h-M,v+d,1-(c+l),0,0,0,0,1]}function p(n){return[n.x,0,0,0,0,n.y,0,0,0,0,n.z,0,0,0,0,1]}function w(n,t,r,u,o,e){return[2*o/(t-n),0,0,0,0,2*o/(r-u),0,0,(t+n)/(t-n),(r+u)/(r-u),-(e+o)/(e-o),-1,0,0,-2*e*o/(e-o),0]}function O(n,t){var r=n[0],u=n[4],o=n[8],e=n[12],i=n[1],a=n[5],c=n[9],f=n[13],h=n[2],l=n[6],v=n[10],s=n[14],d=n[3],M=n[7],y=n[11],m=n[15],x=t[0],_=t[4],z=t[8],b=t[12],p=t[1],w=t[5],O=t[9],j=t[13],g=t[2],k=t[6],A=t[10],S=t[14],P=t[3],T=t[7],q=t[11],J=t[15],R=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return R[0]=r*x+u*p+o*g+e*P,R[4]=r*_+u*w+o*k+e*T,R[8]=r*z+u*O+o*A+e*q,R[12]=r*b+u*j+o*S+e*J,R[1]=i*x+a*p+c*g+f*P,R[5]=i*_+a*w+c*k+f*T,R[9]=i*z+a*O+c*A+f*q,R[13]=i*b+a*j+c*S+f*J,R[2]=h*x+l*p+v*g+s*P,R[6]=h*_+l*w+v*k+s*T,R[10]=h*z+l*O+v*A+s*q,R[14]=h*b+l*j+v*S+s*J,R[3]=d*x+M*p+y*g+m*P,R[7]=d*_+M*w+y*k+m*T,R[11]=d*z+M*O+y*A+m*q,R[15]=d*b+M*j+y*S+m*J,R}function j(n){return{m11:n[0],m12:n[4],m13:n[8],m14:n[12],m21:n[1],m22:n[5],m23:n[9],m24:n[13],m31:n[2],m32:n[6],m33:n[10],m34:n[14],m41:n[3],m42:n[7],m43:n[11],m44:n[15]}}var g=Object.freeze({__proto__:null,fromValues:_,fromObject:function(n){return _(n.m11,n.m12,n.m13,n.m14,n.m21,n.m22,n.m23,n.m24,n.m31,n.m32,n.m33,n.m34,n.m41,n.m42,n.m43,n.m44)},makeIdentity:function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},makeZero:function(){return[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},makeTranslation:z,makeRotation:b,makeScale:p,makeTRS:function(n,t,r){var u=z(n),o=b(t),e=p(r);return O(O(u,o),e)},makeBasis:function(n,t,r){return[n.x,n.y,n.z,0,t.x,t.y,t.z,0,r.x,r.y,r.z,0,0,0,0,1]},makeRotationAxis:function(n,t){var r=Math.cos(t),u=Math.sin(t),o=1-r,e=n.x,i=n.y,a=n.z,c=o*e,f=o*i;return[c*e+r,c*i+u*a,c*a-u*i,0,c*i-u*a,f*i+r,f*a+u*e,0,c*a+u*i,f*a-u*e,o*a*a+r,0,0,0,0,1]},makeFrustum:w,makePerspective:function(n,t,r,u){var o=n*Math.tan(m(r/2)),e=o*u;return w(-e,e,o,-o,n,t)},makeLookAtView:function(n,t,r){var u=T(F(n,t)),o=T(R(r,u)),e=R(u,o),i=-D(o,n),a=-D(e,n),c=-D(u,n);return[o.x,e.x,u.x,0,o.y,e.y,u.y,0,o.z,e.z,u.z,0,i,a,c,1]},makeLookAt:function(n,t,r){var u=T(F(n,t)),o=T(R(r,u)),e=R(u,o);return[o.x,o.y,o.z,0,e.x,e.y,e.z,0,u.x,u.y,u.z,0,n.x,n.y,n.z,1]},invert:function(n){var t=n[0],r=n[1],u=n[2],o=n[3],e=n[4],i=n[5],a=n[6],c=n[7],f=n[8],h=n[9],l=n[10],v=n[11],s=n[12],d=n[13],M=n[14],y=n[15],m=t*i-r*e,x=t*a-u*e,_=t*c-o*e,z=r*a-u*i,b=r*c-o*i,p=u*c-o*a,w=f*d-h*s,O=f*M-l*s,j=f*y-v*s,g=h*M-l*d,k=h*y-v*d,A=l*y-v*M,S=m*A-x*k+_*g+z*j-b*O+p*w;return S?[(i*A-a*k+c*g)*(S=1/S),(u*k-r*A-o*g)*S,(d*p-M*b+y*z)*S,(l*b-h*p-v*z)*S,(a*j-e*A-c*O)*S,(t*A-u*j+o*O)*S,(M*_-s*p-y*x)*S,(f*p-l*_+v*x)*S,(e*k-i*j+c*w)*S,(r*j-t*k-o*w)*S,(s*b-d*_+y*m)*S,(h*_-f*b-v*m)*S,(i*O-e*g-a*w)*S,(t*g-r*O+u*w)*S,(d*x-s*z-M*m)*S,(f*z-h*x+l*m)*S]:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},lookAt:function(n,t,u,o){var e=F(t,u);0===J(e)&&(e=r(r({},e),{z:1}));var i=R(o,e=T(e));0===J(i)&&(i=R(o,e=T(e=1===Math.abs(o.z)?r(r({},e),{x:e.x+1e-4}):r(r({},e),{z:e.z+1e-4}))));var c=R(e,i=T(i)),f=a([],n,!0);return f[0]=i.x,f[4]=c.x,f[8]=e.x,f[1]=i.y,f[5]=c.y,f[9]=e.y,f[2]=i.z,f[6]=c.z,f[10]=e.z,f},multiply:O,transpose:function(n){return[n[0],n[4],n[8],n[12],n[1],n[5],n[9],n[13],n[2],n[6],n[10],n[14],n[3],n[7],n[11],n[15]]},scale:function(n,t){var r=t.x,u=t.y,o=t.z,e=a([],n,!0);return e[0]*=r,e[4]*=u,e[8]*=o,e[1]*=r,e[5]*=u,e[9]*=o,e[2]*=r,e[6]*=u,e[10]*=o,e[3]*=r,e[7]*=u,e[11]*=o,e},position:function(n,t){var r=a([],n,!0);return r[12]=t[12],r[13]=t[13],r[14]=t[14],r},toObject:j,isType:function(n){return Array.isArray(n)&&16===n.length}});function k(){for(var n,t,r,u,o,e,i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return 1===i.length?{x:null!==(n=i[0].x)&&void 0!==n?n:0,y:null!==(t=i[0].y)&&void 0!==t?t:0,z:null!==(r=i[0].z)&&void 0!==r?r:0}:3===i.length?{x:null!==(u=i[0])&&void 0!==u?u:0,y:null!==(o=i[1])&&void 0!==o?o:0,z:null!==(e=i[2])&&void 0!==e?e:0}:{x:0,y:0,z:0}}function A(n){var t=j(n);return{x:Math.hypot(t.m11,t.m21,t.m31),y:Math.hypot(t.m12,t.m22,t.m32),z:Math.hypot(t.m13,t.m23,t.m33)}}function S(){return k(0,0,-1)}function P(){return k(0,0,0)}function T(n){var t=q(n);return{x:n.x/t,y:n.y/t,z:n.z/t}}function q(n){return Math.sqrt(J(n))}function J(n){return n.x*n.x+n.y*n.y+n.z*n.z}function R(n,t){return{x:n.y*t.z-n.z*t.y,y:n.z*t.x-n.x*t.z,z:n.x*t.y-n.y*t.x}}function N(n){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce((function(n,t){return{x:n.x+t.x,y:n.y+t.y,z:n.z+t.z}}),n)}function F(n){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce((function(n,t){return{x:n.x-t.x,y:n.y-t.y,z:n.z-t.z}}),n)}function E(n,t){return{x:t.x*n,y:t.y*n,z:t.z*n}}function D(n,t){return n.x*t.x+n.y*t.y+n.z*t.z}function L(n,t){var r=n.x,u=n.y,o=n.z,e=1/(t[3]*r+t[7]*u+t[11]*o+t[15]);return{x:(t[0]*r+t[4]*u+t[8]*o+t[12])*e,y:(t[1]*r+t[5]*u+t[9]*o+t[13])*e,z:(t[2]*r+t[6]*u+t[10]*o+t[14])*e}}function V(n,t){return Math.sqrt(C(n,t))}function C(n,t){var r=F(n,t),u=r.x,o=r.y,e=r.z;return u*u+o*o+e*e}function I(n,t){return k(Math.max(n.x,t.x),Math.max(n.y,t.y),Math.max(n.z,t.z))}function B(n,t){return k(Math.min(n.x,t.x),Math.min(n.y,t.y),Math.min(n.z,t.z))}function G(n,t,r){return{x:f(n.x,t.x,r),y:f(n.y,t.y,r),z:f(n.z,t.z,r)}}var W=Object.freeze({__proto__:null,create:k,isValid:function(n){return[n.x,n.y,n.z].every((function(n){return isFinite(n)&&!isNaN(n)}))},fromMatrixScale:A,fromMatrixPosition:function(n){var t=j(n);return{x:t.m14,y:t.m24,z:t.m34}},fromJson:function(n){var t=JSON.parse(n);return Array.isArray(t)?k(t[0],t[1],t[2]):k(t.x,t.y,t.z)},fromArray:function(n,t){return void 0===t&&(t=0),k(n[t],n[t+1],n[t+2])},toArray:function(n){return[n.x,n.y,n.z]},right:function(){return k(1,0,0)},up:function(){return k(0,1,0)},forward:S,left:function(){return k(-1,0,0)},down:function(){return k(0,-1,0)},back:function(){return k(0,0,1)},origin:P,normalize:T,magnitude:q,magnitudeSquared:J,cross:R,add:N,subtract:F,multiply:function(n,t){return{x:n.x*t.x,y:n.y*t.y,z:n.z*t.z}},scale:E,dot:D,angleTo:function(n,t){var r=D(n,t)/(q(n)*q(t));return Math.acos(r)},project:function(n,t){return E(D(t,n)/q(t),t)},rotateAboutAxis:function(n,t,r,u){if(0!==n){var o=t.x,e=t.y,i=t.z,a=u.x,c=u.y,f=u.z,h=r.x,l=r.y,v=r.z;return{x:(a*(l*l+v*v)-h*(c*l+f*v-h*o-l*e-v*i))*(1-Math.cos(n))+o*Math.cos(n)+(-f*l+c*v-v*e+l*i)*Math.sin(n),y:(c*(h*h+v*v)-l*(a*h+f*v-h*o-l*e-v*i))*(1-Math.cos(n))+e*Math.cos(n)+(f*h-a*v+v*o-h*i)*Math.sin(n),z:(f*(h*h+l*l)-v*(a*h+c*l-h*o-l*e-v*i))*(1-Math.cos(n))+i*Math.cos(n)+(-c*h+a*l-l*o+h*e)*Math.sin(n)}}return t},transformMatrix:L,distance:V,distanceSquared:C,isEqual:function(n,t){return n.x===t.x&&n.y===t.y&&n.z===t.z},max:I,min:B,negate:function(n){return{x:-n.x,y:-n.y,z:-n.z}},lerp:G,transformNdcToWorldSpace:function(n,t,r){return L(L(n,r),t)}}),Z=function(n,t){return{min:n,max:t}};function H(n){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var u=a([n],t,!0);return u.reduce((function(n,t){return Z(B(n.min,t.min),I(n.max,t.max))}))}var K=Object.freeze({__proto__:null,create:Z,fromVectors:function(n){return H.apply(void 0,n.map((function(n){return Z(n,n)})))},center:function(n){return E(.5,N(n.min,n.max))},union:H});function Q(n,t,r,u){return{x:n,y:t,width:r,height:u}}function U(n,t){return Q(n.x,n.y,t.width,t.height)}function X(n,t){var r=Math.min(n.width/t.width,n.height/t.height),u=cn(r,t);return U(l(tn(n),hn(u)),u)}function Y(n,t){var r=Math.max(n.width/t.width,n.height/t.height),u=cn(r,t);return U(l(tn(n),hn(u)),u)}function $(n,t){var r=Math.min(Math.sqrt(n/nn(t)),1),u=fn(cn(r,t));return U(l(tn(t),hn(u)),u)}function nn(n){return n.width*n.height}function tn(n){return{x:n.x+n.width/2,y:n.y+n.height/2}}function rn(n){return h(n.x,n.y)}var un=Object.freeze({__proto__:null,create:Q,fromDimensions:function(n){return Q(0,0,n.width,n.height)},fromPointAndDimensions:U,fromPoints:function(n,t){var r=Math.min(n.x,t.x),u=Math.min(n.y,t.y);return Q(r,u,Math.max(n.x,t.x)-r,Math.max(n.y,t.y)-u)},containFit:X,cropFit:Y,scaleFit:$,scale:function n(t,r,u){return null==u?n(t,r,r):Q(t.x*r,t.y*u,t.width*r,t.height*u)},isEqual:function(n,t){return s(n,t)&&en(n,t)},offset:function(n,t){return U(v(rn(t),n),t)},area:nn,center:tn,topLeft:rn,bottomRight:function(n){return h(n.x+n.width,n.y+n.height)},isPortrait:function(n){return n.width<n.height},isLandscape:function(n){return n.width>n.height},isSquare:function(n){return n.width===n.height},pad:function(n,t){return Q(n.x-t,n.y-t,n.width+2*t,n.height+2*t)},fromJson:function(n){var t=JSON.parse(n);return Array.isArray(t)?Q(t[0],t[1],t[2],t[3]):Q(t.x,t.y,t.width,t.height)}}),on=function(n,t){return{width:n,height:t}},en=function(n,t){return n.width===t.width&&n.height===t.height},an=function(n,t,r){return{width:r.width*n,height:r.height*t}},cn=function(n,t){return an(n,n,t)},fn=function(n){return{width:Math.floor(n.width),height:Math.floor(n.height)}},hn=function(n){return{x:n.width/2,y:n.height/2}};function ln(n,t){return void 0===t&&(t=h()),U(t,n)}var vn=Object.freeze({__proto__:null,create:on,square:function(n){return on(n,n)},isEqual:en,scale:an,proportionalScale:cn,trim:function(n,t){return{width:Math.min(n.width,t.width),height:Math.min(n.height,t.height)}},containFit:function(n,t){var r=X(ln(n),ln(t));return{width:r.width,height:r.height}},cropFit:function(n,t){var r=Y(ln(n),ln(t));return{width:r.width,height:r.height}},scaleFit:function(n,t){var r=$(n,ln(t));return{width:r.width,height:r.height}},round:function(n){return{width:Math.round(n.width),height:Math.round(n.height)}},floor:fn,center:hn,aspectRatio:function(n){return n.width/n.height},area:function(n){return n.width*n.height},fitToRatio:function(n,t){return t.width>=t.height*n?on(t.height*n,t.height):on(t.width,t.width/n)},toRectangle:ln});function sn(n){var t,r,u,o;return void 0===n&&(n={}),{x:null!==(t=n.x)&&void 0!==t?t:0,y:null!==(r=n.y)&&void 0!==r?r:0,z:null!==(u=n.z)&&void 0!==u?u:0,order:null!==(o=n.order)&&void 0!==o?o:"xyz"}}var dn=Object.freeze({__proto__:null,create:sn,fromDegrees:function(n){void 0===n&&(n={});var t=n.x,r=n.y,u=void 0===r?0:r,o=n.z,e=void 0===o?0:o,i=n.order;return sn({x:m(void 0===t?0:t),y:m(u),z:m(e),order:i})},fromRotationMatrix:function(n,t){void 0===t&&(t="xyz");var r=j(n),u=0,o=0,e=0;return"xyz"===t?(o=Math.asin(c(r.m13,-1,1)),Math.abs(r.m13)<.9999999?(u=Math.atan2(-r.m23,r.m33),e=Math.atan2(-r.m12,r.m11)):(u=Math.atan2(r.m32,r.m22),e=0)):"yxz"===t?(u=Math.asin(-c(r.m23,-1,1)),Math.abs(r.m23)<.9999999?(o=Math.atan2(r.m13,r.m33),e=Math.atan2(r.m21,r.m22)):(o=Math.atan2(-r.m31,r.m11),e=0)):"zxy"===t?(u=Math.asin(c(r.m32,-1,1)),Math.abs(r.m32)<.9999999?(o=Math.atan2(-r.m31,r.m33),e=Math.atan2(-r.m12,r.m22)):(o=0,e=Math.atan2(r.m21,r.m11))):"zyx"===t?(o=Math.asin(-c(r.m31,-1,1)),Math.abs(r.m31)<.9999999?(u=Math.atan2(r.m32,r.m33),e=Math.atan2(r.m21,r.m11)):(u=0,e=Math.atan2(-r.m12,r.m22))):"yzx"===t?(e=Math.asin(c(r.m21,-1,1)),Math.abs(r.m21)<.9999999?(u=Math.atan2(-r.m23,r.m22),o=Math.atan2(-r.m31,r.m11)):(u=0,o=Math.atan2(r.m13,r.m33))):"xzy"===t&&(e=Math.asin(-c(r.m12,-1,1)),Math.abs(r.m12)<.9999999?(u=Math.atan2(r.m32,r.m22),o=Math.atan2(r.m13,r.m11)):(u=Math.atan2(-r.m23,r.m33),o=0)),{x:u,y:o,z:e,order:t}},fromJson:function(n){var t=JSON.parse(n);if(Array.isArray(t)){var r=t[3];return{x:t[0],y:t[1],z:t[2],order:void 0===r?"xyz":r}}var u=t.order;return{x:t.x,y:t.y,z:t.z,order:void 0===u?"xyz":u}},isType:function(n){var t=n;return null!=t&&t.hasOwnProperty("x")&&t.hasOwnProperty("y")&&t.hasOwnProperty("z")&&t.hasOwnProperty("order")}});function Mn(n){return F(n.end,n.start)}var yn=Object.freeze({__proto__:null,create:function(n){var t,r;return void 0===n&&(n={}),{start:null!==(t=n.start)&&void 0!==t?t:P(),end:null!==(r=n.end)&&void 0!==r?r:P()}},center:function(n){return G(n.start,n.end,.5)},transformMatrix:function(n,t){return{start:L(n.start,t),end:L(n.end,t)}},distance:function(n){return V(n.start,n.end)},distanceSquared:function(n){return C(n.start,n.end)},direction:Mn}),mn=function(n,t,r,u,o,e){return void 0===n&&(n=1),void 0===t&&(t=0),void 0===r&&(r=0),void 0===u&&(u=1),void 0===o&&(o=0),void 0===e&&(e=0),{a:n,b:t,c:r,d:u,tx:o,ty:e}},xn=function(){return mn()},_n=function(n,t){var r=m(n),u=Math.cos(r),o=Math.sin(r);return mn(t.a*u+t.c*o,t.b*u+t.d*o,t.a*-o+t.c*u,t.b*-o+t.d*u,t.tx,t.ty)},zn=function(n,t,r){return mn(r.a,r.b,r.c,r.d,r.a*n+r.c*t+r.tx,r.b*n+r.d*t+r.ty)},bn=Object.freeze({__proto__:null,create:mn,identity:xn,translation:function(n,t){return zn(n,t,xn())},rotation:function(n){return _n(n,xn())},rotate:_n,translate:zn,transformPoint:function(n,t){return h(n.a*t.x+n.c*t.y+n.tx,n.b*t.x+n.d*t.y+n.ty)}}),pn=Object.freeze({__proto__:null,create:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return 2===n.length?{a:n[0].x,b:n[0].y,c:n[1].x,d:n[1].y}:4===n.length?{a:n[0],b:n[1],c:n[2],d:n[3]}:{a:0,b:0,c:0,d:0}},determinant:function(n){return n.a*n.d-n.b*n.c},dot:function(n){return n.a*n.c+n.b*n.d}});function wn(n){return void 0===n&&(n={}),r({normal:P(),constant:0},n)}function On(n,t){return D(n.normal,t)+n.constant}var jn=Object.freeze({__proto__:null,create:wn,fromNormalAndCoplanarPoint:function(n,t){return wn({normal:n,constant:-D(t,n)})},distanceToPoint:On,intersectLine:function(n,t){var r=Mn(t),u=D(n.normal,r);if(0===u)return 0===On(n,t.start)?t.start:void 0;var o=-(D(t.start,n.normal)+n.constant)/u;return o<0||o>1?void 0:N(t.start,E(o,r))},projectPoint:function(n,t){return N(t,E(-On(n,t),n.normal))}});function gn(n){return void 0===n&&(n={}),r({x:0,y:0,z:0,w:1},n)}var kn=Object.freeze({__proto__:null,create:gn,fromJson:function(n){var t=JSON.parse(n);return Array.isArray(t)?gn({x:t[0],y:t[1],z:t[2],w:t[3]}):gn(t)},fromAxisAngle:function(n,t){var r=t/2,u=Math.sin(r);return{x:n.x*u,y:n.y*u,z:n.z*u,w:Math.cos(r)}},fromMatrixRotation:function(n){var t,r=j(n),u=A(n),o=1/u.x,e=1/u.y,i=1/u.z,a=r.m11*o,c=r.m21*e,f=r.m31*i,h=r.m12*o,l=r.m22*e,v=r.m32*i,s=r.m13*o,d=r.m23*e,M=r.m33*i,y=a+l+M;return y>0?{x:(v-d)/(t=2*Math.sqrt(y+1)),y:(s-f)/t,z:(c-h)/t,w:.25*t}:a>l&&a>M?{x:.25*(t=2*Math.sqrt(1+a-l-M)),y:(c+h)/t,z:(s+f)/t,w:t}:l>M?{x:(c+h)/(t=2*Math.sqrt(1+l-a-M)),y:.25*t,z:(v+d)/t,w:(s-f)/t}:{x:(s+f)/(t=2*Math.sqrt(1+M-a-l)),y:(v+d)/t,z:.25*t,w:(c-h)/t}},fromEuler:function(n){var t=n.x,r=n.y,u=n.z,o=n.order,e=Math.cos(t/2),i=Math.cos(r/2),a=Math.cos(u/2),c=Math.sin(t/2),f=Math.sin(r/2),h=Math.sin(u/2),l=0,v=0,s=0,d=0;switch(o){case"xyz":l=c*i*a+e*f*h,v=e*f*a-c*i*h,s=e*i*h+c*f*a,d=e*i*a-c*f*h;break;case"yxz":l=c*i*a+e*f*h,v=e*f*a-c*i*h,s=e*i*h-c*f*a,d=e*i*a+c*f*h;break;case"zxy":l=c*i*a-e*f*h,v=e*f*a+c*i*h,s=e*i*h+c*f*a,d=e*i*a-c*f*h;break;case"zyx":l=c*i*a-e*f*h,v=e*f*a+c*i*h,s=e*i*h-c*f*a,d=e*i*a+c*f*h;break;case"yzx":l=c*i*a+e*f*h,v=e*f*a+c*i*h,s=e*i*h-c*f*a,d=e*i*a-c*f*h;break;case"xzy":l=c*i*a-e*f*h,v=e*f*a-c*i*h,s=e*i*h+c*f*a,d=e*i*a+c*f*h}return{x:l,y:v,z:s,w:d}},multiply:function(n,t){return{x:n.x*t.w+n.w*t.x+n.y*t.z-n.z*t.y,y:n.y*t.w+n.w*t.y+n.z*t.x-n.x*t.z,z:n.z*t.w+n.w*t.z+n.x*t.y-n.y*t.x,w:n.w*t.w-n.x*t.x-n.y*t.y-n.z*t.z}},isType:function(n){var t=n;return null!=t&&t.hasOwnProperty("x")&&t.hasOwnProperty("y")&&t.hasOwnProperty("z")&&t.hasOwnProperty("w")}});function An(n,t){return N(E(t,n.direction),n.origin)}function Sn(n,t){var r=D(t.normal,n.direction);if(0===r)return 0===On(t,n.origin)?0:void 0;var u=-(D(n.origin,t.normal)+t.constant)/r;return u>=0?u:void 0}var Pn=Object.freeze({__proto__:null,create:function(n){var t,r;return void 0===n&&(n={}),{origin:null!==(t=n.origin)&&void 0!==t?t:P(),direction:null!==(r=n.direction)&&void 0!==r?r:S()}},at:An,distanceToPlane:Sn,intersectPlane:function(n,t){var r=Sn(n,t);return null!=r?An(n,r):void 0}});export{t as _,o as a,e as b,r as c,a as d,K as e,vn as f,un as g,jn as h,i,u as j,x as k,pn as l,g as m,bn as n,yn as o,d as p,kn as q,Pn as r,dn as s,W as v}
@@ -0,0 +1,4 @@
1
+ /**!
2
+ * Copyright (c) 2021 Vertex Software LLC. All rights reserved.
3
+ */
4
+ import{r as e,c as t,h as r,H as n,g as a}from"./p-c9d8a379.js";import{s as i}from"./p-c738296e.js";import{A as s,C as o,F as l}from"./p-5389e9d4.js";import{i as d,a as h,b as u}from"./p-835e158e.js";import"./p-640cb5f8.js";import"./p-59d075d4.js";const p=class{constructor(r){e(this,r),this.markupAdded=t(this,"markupAdded",7),this.markupRemoved=t(this,"markupRemoved",7),this.tool="arrow",this.disabled=!1}async addMarkup(e){if(e instanceof s){const{start:t,end:r,id:n}=e,a=this.createArrowMarkupElement();return a.id=n,a.start=t,a.end=r,this.appendMarkupElement(a)}if(e instanceof o){const{bounds:t,id:r}=e,n=this.createCircleMarkupElement();return n.id=r,n.bounds=t,this.appendMarkupElement(n)}if(e instanceof l){const{bounds:t,points:r,id:n}=e,a=this.createFreeformMarkupElement();return a.id=n,a.points=r,a.bounds=t,this.appendMarkupElement(a)}throw new Error(`Cannot add markup. Unknown type '${e}'.`)}async removeMarkup(e){const t=await this.getMarkupElement(e);return null!=t&&(t.remove(),this.markupRemoved.emit(t)),t}async getMarkupElements(){return Array.from(this.hostEl.children).filter((e=>d(e)||h(e)||u(e)))}async getMarkupElement(e){return(await this.getMarkupElements()).find((t=>t.id===e))}async handleSelectedMarkupIdChanged(){(await this.getMarkupElements()).forEach((e=>{e.mode=e.id===this.selectedMarkupId?"edit":""}))}handleToolChanged(){this.updatePropsOnMarkupTool()}handleArrowTemplateIdChanged(){this.updatePropsOnMarkupTool()}handleCircleTemplateIdChanged(){this.updatePropsOnMarkupTool()}async handleViewerChanged(e){this.updatePropsOnMarkupTool(),this.updatePropsOnMarkups()}handleDisabledChanged(){this.updatePropsOnMarkupTool()}async handleMarkupEnd(e){const t=e;await this.addMarkup(t.detail),this.selectedMarkupId=t.detail.id}async handleMarkupEditCancel(){this.selectedMarkupId=void 0}async handleMarkupPointerDown(e){if(!this.disabled){const t=e.target,r=(await this.getMarkupElements()).find((e=>e===t));null!=(null==r?void 0:r.id)&&""!==(null==r?void 0:r.id)&&(this.selectedMarkupId=t.id)}}componentDidLoad(){this.updatePropsOnMarkupTool()}render(){return r(n,null,r("slot",null))}appendMarkupElement(e){return this.updatePropsOnMarkup(e),this.hostEl.appendChild(e),this.markupAdded.emit(e),e}createArrowMarkupElement(){if(null!=this.arrowTemplateId){const e=i(window.document.body,this.arrowTemplateId,d,(()=>console.warn(`Arrow template with ID ${this.arrowTemplateId} not found. Using default arrow element.`)),(()=>console.warn("Arrow template does not contain a vertex-viewer-markup-arrow. Using default arrow element.")));if(null!=e)return e}return document.createElement("vertex-viewer-markup-arrow")}createCircleMarkupElement(){if(null!=this.circleTemplateId){const e=i(window.document.body,this.circleTemplateId,h,(()=>console.warn(`Circle template with ID ${this.circleTemplateId} not found. Using default circle element.`)),(()=>console.warn("Circle template does not contain a vertex-viewer-markup-circle. Using default circle element.")));if(null!=e)return e}return document.createElement("vertex-viewer-markup-circle")}createFreeformMarkupElement(){if(null!=this.freeformTemplateId){const e=i(window.document.body,this.freeformTemplateId,u,(()=>console.warn(`Freeform template with ID ${this.freeformTemplateId} not found. Using default freeform element.`)),(()=>console.warn("Freeform template does not contain a vertex-viewer-markup-freeform. Using default freeform element.")));if(null!=e)return e}return document.createElement("vertex-viewer-markup-freeform")}async updatePropsOnMarkups(){(await this.getMarkupElements()).forEach((e=>this.updatePropsOnMarkup(e)))}updatePropsOnMarkup(e){e.viewer=this.viewer,e.classList.add("viewer-markup__markup")}updatePropsOnMarkupTool(){const e=this.getMarkupTool();null!=e&&(e.disabled=this.disabled,e.arrowTemplateId=this.arrowTemplateId,e.circleTemplateId=this.circleTemplateId,e.freeformTemplateId=this.freeformTemplateId,e.tool=this.tool,e.viewer=this.viewer)}getMarkupTool(){return this.hostEl.querySelector("vertex-viewer-markup-tool")}get hostEl(){return a(this)}static get watchers(){return{selectedMarkupId:["handleSelectedMarkupIdChanged"],tool:["handleToolChanged"],arrowTemplateId:["handleArrowTemplateIdChanged"],circleTemplateId:["handleCircleTemplateIdChanged"],viewer:["handleViewerChanged"],disabled:["handleDisabledChanged"]}}};p.style=":host{display:block;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none}";export{p as vertex_viewer_markup}
@@ -1,4 +1,4 @@
1
1
  /**!
2
2
  * Copyright (c) 2021 Vertex Software LLC. All rights reserved.
3
3
  */
4
- import{p as n}from"./p-d912dd24.js";function t(t,r){const o=n.create(t.clientX,t.clientY);return null==r?o:n.subtract(o,n.create(r.left,r.top))}function r(n){const{x:t,y:r}=n;return`translate(-50%, -50%) translate(${t}px, ${r}px)`}function o(n){var t,r;return"string"==typeof n?n:[`url("${n.url}")`,null!==(t=n.offsetX)&&void 0!==t?t:0,null!==(r=n.offsetY)&&void 0!==r?r:0,", auto"].join(" ")}export{r as a,o as c,t as g}
4
+ import{p as n}from"./p-640cb5f8.js";function t(t,r){const o=n.create(t.clientX,t.clientY);return null==r?o:n.subtract(o,n.create(r.left,r.top))}function r(n){const{x:t,y:r}=n;return`translate(-50%, -50%) translate(${t}px, ${r}px)`}function o(n){var t,r;return"string"==typeof n?n:[`url("${n.url}")`,null!==(t=n.offsetX)&&void 0!==t?t:0,null!==(r=n.offsetY)&&void 0!==r?r:0,", auto"].join(" ")}export{r as a,o as c,t as g}
@@ -1,4 +1,4 @@
1
1
  /**!
2
2
  * Copyright (c) 2021 Vertex Software LLC. All rights reserved.
3
3
  */
4
- import{r as e,c as t,h as s,H as i,g as n}from"./p-c9d8a379.js";import{s as a}from"./p-c738296e.js";import"./p-b5c350a7.js";import{D as h}from"./p-af806858.js";import{M as d,i as l}from"./p-5b078339.js";import"./p-6d4ab5fc.js";import"./p-d912dd24.js";const o=class{constructor(s){e(this,s),this.measureBegin=t(this,"measureBegin",7),this.measureEnd=t(this,"measureEnd",7),this.tool="distance",this.units="millimeters",this.fractionalDigits=2,this.disabled=!1,this.isMeasuring=!1,this.snapDistance=d,this.stateMap={},this.handleMeasurementEditBegin=()=>{this.isMeasuring=!0,this.measureBegin.emit()},this.handleMeasurementEditEnd=()=>{const{measurementElement:e}=this.stateMap;if(l(e)){const{start:t,end:s,invalid:i}=e;this.isMeasuring=!1,e.start=void 0,e.end=void 0,e.invalid=!1,null!=t&&null!=s&&this.measureEnd.emit(new h({start:t,end:s,invalid:i}))}}}handleViewerChanged(){null!=this.stateMap.measurementElement&&(this.stateMap.measurementElement.viewer=this.viewer)}handleToolChanged(){this.updateMeasurementElement()}handleDistanceTemplateIdChanged(){this.updateMeasurementElement()}handleDisabledChanged(){this.updateMeasurementElement()}handleUnitsChanged(){this.updateMeasurementElement()}handleFractionalDigitsChanged(){this.updateMeasurementElement()}handleSnapDistanceChanged(){this.updateMeasurementElement()}componentDidLoad(){this.updateMeasurementElement()}render(){return this.disabled?s(i,null):s(i,null,"distance"===this.tool?s("vertex-viewer-layer",null,s("slot",null)):`Unsupported tool type '${this.tool}'.`)}createDistanceMeasurementElement(){if(null!=this.distanceTemplateId){const e=a(window.document.body,this.distanceTemplateId,l,(()=>console.warn(`Distance template with ID ${this.distanceTemplateId} not found. Using default distance element.`)),(()=>console.warn("Distance template does not contain a vertex-viewer-measurement-distance. Using default distance element.")));if(null!=e)return e}return document.createElement("vertex-viewer-measurement-distance")}updateMeasurementElement(){const{measurementElement:e}=this.stateMap;if(null!=e&&(e.remove(),e.viewer=void 0,e.removeEventListener("editBegin",this.handleMeasurementEditBegin),e.removeEventListener("editEnd",this.handleMeasurementEditEnd)),!this.disabled){const e=this.createDistanceMeasurementElement();e.mode="replace",e.units=this.units,e.snapDistance=this.snapDistance,e.fractionalDigits=this.fractionalDigits,e.viewer=this.viewer,e.addEventListener("editBegin",this.handleMeasurementEditBegin),e.addEventListener("editEnd",this.handleMeasurementEditEnd),this.stateMap.measurementElement=e,this.hostEl.append(e)}}get hostEl(){return n(this)}static get watchers(){return{viewer:["handleViewerChanged"],tool:["handleToolChanged"],distanceTemplateId:["handleDistanceTemplateIdChanged"],disabled:["handleDisabledChanged"],units:["handleUnitsChanged"],fractionalDigits:["handleFractionalDigitsChanged"],snapDistance:["handleSnapDistanceChanged"]}}};o.style=":host{position:absolute;top:0;bottom:0;left:0;right:0}";export{o as vertex_viewer_measurement_tool}
4
+ import{r as e,c as t,h as s,H as i,g as n}from"./p-c9d8a379.js";import{s as a}from"./p-c738296e.js";import"./p-21e8510d.js";import{D as h}from"./p-012fb54f.js";import{M as d,i as l}from"./p-62c6f482.js";import"./p-59d075d4.js";import"./p-640cb5f8.js";const o=class{constructor(s){e(this,s),this.measureBegin=t(this,"measureBegin",7),this.measureEnd=t(this,"measureEnd",7),this.tool="distance",this.units="millimeters",this.fractionalDigits=2,this.disabled=!1,this.isMeasuring=!1,this.snapDistance=d,this.stateMap={},this.handleMeasurementEditBegin=()=>{this.isMeasuring=!0,this.measureBegin.emit()},this.handleMeasurementEditEnd=()=>{const{measurementElement:e}=this.stateMap;if(l(e)){const{start:t,end:s,invalid:i}=e;this.isMeasuring=!1,e.start=void 0,e.end=void 0,e.invalid=!1,null!=t&&null!=s&&this.measureEnd.emit(new h({start:t,end:s,invalid:i}))}}}handleViewerChanged(){null!=this.stateMap.measurementElement&&(this.stateMap.measurementElement.viewer=this.viewer)}handleToolChanged(){this.updateMeasurementElement()}handleDistanceTemplateIdChanged(){this.updateMeasurementElement()}handleDisabledChanged(){this.updateMeasurementElement()}handleUnitsChanged(){this.updateMeasurementElement()}handleFractionalDigitsChanged(){this.updateMeasurementElement()}handleSnapDistanceChanged(){this.updateMeasurementElement()}componentDidLoad(){this.updateMeasurementElement()}render(){return this.disabled?s(i,null):s(i,null,"distance"===this.tool?s("vertex-viewer-layer",null,s("slot",null)):`Unsupported tool type '${this.tool}'.`)}createDistanceMeasurementElement(){if(null!=this.distanceTemplateId){const e=a(window.document.body,this.distanceTemplateId,l,(()=>console.warn(`Distance template with ID ${this.distanceTemplateId} not found. Using default distance element.`)),(()=>console.warn("Distance template does not contain a vertex-viewer-measurement-distance. Using default distance element.")));if(null!=e)return e}return document.createElement("vertex-viewer-measurement-distance")}updateMeasurementElement(){const{measurementElement:e}=this.stateMap;if(null!=e&&(e.remove(),e.viewer=void 0,e.removeEventListener("editBegin",this.handleMeasurementEditBegin),e.removeEventListener("editEnd",this.handleMeasurementEditEnd)),!this.disabled){const e=this.createDistanceMeasurementElement();e.mode="replace",e.units=this.units,e.snapDistance=this.snapDistance,e.fractionalDigits=this.fractionalDigits,e.viewer=this.viewer,e.addEventListener("editBegin",this.handleMeasurementEditBegin),e.addEventListener("editEnd",this.handleMeasurementEditEnd),this.stateMap.measurementElement=e,this.hostEl.append(e)}}get hostEl(){return n(this)}static get watchers(){return{viewer:["handleViewerChanged"],tool:["handleToolChanged"],distanceTemplateId:["handleDistanceTemplateIdChanged"],disabled:["handleDisabledChanged"],units:["handleUnitsChanged"],fractionalDigits:["handleFractionalDigitsChanged"],snapDistance:["handleSnapDistanceChanged"]}}};o.style=":host{position:absolute;top:0;bottom:0;left:0;right:0}";export{o as vertex_viewer_measurement_tool}
@@ -0,0 +1,4 @@
1
+ /**!
2
+ * Copyright (c) 2021 Vertex Software LLC. All rights reserved.
3
+ */
4
+ import{p as n,n as t,k as e,g as r}from"./p-640cb5f8.js";function s(r,s,a=60){const f=n.distance(r,s),i=e.normalize(e.toDegrees(e.fromPoints(r,s))-270),o=Math.max(4,Math.min(16,.25*f)),E=o/Math.cos(e.toRadians(90-a)),u=t.rotation(i),c=n.polar(E,e.toRadians(2*a)),R=n.polar(E,e.toRadians(a)),M=n.polar(o,e.toRadians(90));return{tip:s,left:n.add(s,t.transformPoint(u,c)),right:n.add(s,t.transformPoint(u,R)),base:n.add(s,t.transformPoint(u,M))}}function a(n){return[n.tip,n.right,n.base,n.left].map((n=>`${n.x},${n.y}`)).join(" ")}function f(n){return n instanceof HTMLElement&&"VERTEX-VIEWER-MARKUP-ARROW"===n.nodeName}function i(t){return"string"==typeof t?n.fromJson(t):t}function o(n){return n instanceof HTMLElement&&"VERTEX-VIEWER-MARKUP-CIRCLE"===n.nodeName}function E(n){return"string"==typeof n?r.fromJson(n):n}function u(t){return"string"==typeof t?JSON.parse(t).map((t=>n.fromJson(JSON.stringify(t)))):t}function c(n){return n instanceof HTMLElement&&"VERTEX-VIEWER-MARKUP-FREEFORM"===n.nodeName}export{o as a,c as b,s as c,a as d,E as e,u as f,f as i,i as p}