@operato/mini-map 7.1.1 → 7.1.32

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ### [7.1.32](https://github.com/hatiolab/operato/compare/v7.1.31...v7.1.32) (2025-01-11)
7
+
8
+
9
+ ### :bug: Bug Fix
10
+
11
+ * missing .npmignore ([03db207](https://github.com/hatiolab/operato/commit/03db207498088b294ccfb9645f6839c2f11645d5))
12
+ * typo .npmignore ([df91cae](https://github.com/hatiolab/operato/commit/df91caea0f5938a3febd9307184e5b036a65e2bd))
13
+
14
+
15
+
16
+ ### [7.1.16](https://github.com/hatiolab/operato/compare/v7.1.15...v7.1.16) (2024-10-13)
17
+
18
+
19
+ ### :bug: Bug Fix
20
+
21
+ * missing datasets and annotations change event notification ([3739661](https://github.com/hatiolab/operato/commit/373966134854834146aa5f892136ad9ddd538a5c))
22
+
23
+
24
+
6
25
  ### [7.1.1](https://github.com/hatiolab/operato/compare/v7.0.80...v7.1.1) (2024-09-01)
7
26
 
8
27
  **Note:** Version bump only for package @operato/mini-map
@@ -177,7 +177,8 @@ let OxZoomableImage = class OxZoomableImage extends LitElement {
177
177
  const hostAspectRatio = hostHeight / hostWidth;
178
178
  if (aspectRatio < hostAspectRatio) {
179
179
  /* image ratio is wider than host */
180
- var minX = Math.min(0, (-hostWidth * (this.zoom - 1)) / 2 / this.zoom);
180
+ var minX = (hostWidth * (1 - this.zoom)) / 2;
181
+ minX = minX > 0 ? -minX : minX;
181
182
  var maxX = -minX;
182
183
  var minY = (hostHeight - hostWidth * aspectRatio * this.zoom) / 2 / this.zoom;
183
184
  minY = Math.min(minY, -minY);
@@ -189,7 +190,8 @@ let OxZoomableImage = class OxZoomableImage extends LitElement {
189
190
  var minX = (hostWidth - (hostHeight / aspectRatio) * this.zoom) / 2 / this.zoom;
190
191
  minX = Math.min(minX, -minX);
191
192
  var maxX = -minX;
192
- var minY = Math.min(0, (-hostHeight * (this.zoom - 1)) / 2 / this.zoom);
193
+ var minY = (-hostHeight * (1 - this.zoom)) / 2;
194
+ minY = minY > 0 ? -minY : minY;
193
195
  var maxY = -minY;
194
196
  this.left = Math.max(minX, Math.min(this.left, maxX));
195
197
  this.top = Math.max(minY, Math.min(this.top, maxY));
@@ -1 +1 @@
1
- {"version":3,"file":"ox-zoomable-image.js","sourceRoot":"","sources":["../../src/ox-zoomable-image.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,kEAAkE;AAClE,SAAS,QAAQ,CAAC,CAA0B;IAC1C,IAAI,CAAC,YAAY,UAAU,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9C,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAA;IACvC,CAAC;SAAM,IAAI,CAAC,YAAY,UAAU,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7D,MAAM,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;QAC1B,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,EAAE,CAAA;IAC/C,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGI,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QA+BY,SAAI,GAAG,CAAC,CAAA,CAAC,qBAAqB;QAC9B,SAAI,GAAG,CAAC,CAAA,CA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C,CAAA;YACvE,IAAI,IAAI,GAAG,CAAC,IAAI,CAAA;YAEhB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;YACrD,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAA;QACrD,CAAC;IACH,CAAC;;AAnND,sCAAsC;AAC/B,sBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BlB,AA1BY,CA0BZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAa;AACvB;IAAhB,KAAK,EAAE;6CAAiB;AACR;IAAhB,KAAK,EAAE;6CAAiB;AACR;IAAhB,KAAK,EAAE;4CAAgB;AACP;IAAhB,KAAK,EAAE;gDAAoB;AACX;IAAhB,KAAK,EAAE;mDAAuB;AACd;IAAhB,KAAK,EAAE;oDAAwB;AApCrB,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAqN3B","sourcesContent":["import { css, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\n// Utility function to get the point from MouseEvent or TouchEvent\nfunction getPoint(e: MouseEvent | TouchEvent): { x: number; y: number } | undefined {\n if (e instanceof MouseEvent && e.button === 0) {\n return { x: e.clientX, y: e.clientY }\n } else if (e instanceof TouchEvent && e.touches.length === 1) {\n const touch = e.touches[0]\n return { x: touch.clientX, y: touch.clientY }\n }\n return undefined\n}\n\n/**\n * Example usage:\n *\n * <html>\n * <head>\n * <script type=\"module\" src=\"path/to/ox-zoomable-image.js\"></script>\n * <style>\n * body {\n * margin: 0;\n * overflow: hidden;\n * display: flex;\n * justify-content: center;\n * align-items: center;\n * height: 100vh;\n * }\n * ox-zoomable-image {\n * width: 80%;\n * height: 80%;\n * }\n * </style>\n * </head>\n * <body>\n * <ox-zoomable-image src=\"path/to/your/image.jpg\"></ox-zoomable-image>\n * </body>\n * </html>\n */\n\n@customElement('ox-zoomable-image')\nexport class OxZoomableImage extends LitElement {\n // Define CSS styles for the component\n static styles = css`\n :host {\n display: block;\n position: relative;\n width: 100%;\n height: 100%;\n overflow: hidden;\n }\n\n :host::before {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n right: 0;\n width: 100%;\n height: 100%;\n background-image: var(\n --background-image,\n linear-gradient(var(--primary-color, lightgray), var(--primary-color, lightgray))\n );\n transform: var(--image-transform, '');\n background-repeat: no-repeat;\n background-position: center;\n background-size: contain;\n }\n `\n\n @property({ type: String }) src?: string // Source URL for the image\n @state() private zoom = 1 // Current zoom level\n @state() private left = 0 // Horizontal position\n @state() private top = 0 // Vertical position\n @state() private minZoom = 1 // Minimum zoom level\n @state() private imageWidth = 0\n @state() private imageHeight = 0\n\n private dragStart?: { x: number; y: number } // Starting point of drag\n\n // Event listeners bound to the component\n private readonly dragEndHandler = this.onDragEnd.bind(this) as EventListener\n private readonly dragMoveHandler = this.onDragMove.bind(this) as EventListener\n private readonly dragStartHandler = this.onDragStart.bind(this) as EventListener\n private readonly wheelEventHandler = this.onWheelEvent.bind(this) as EventListener\n private readonly resetHandler = this.onReset.bind(this) as EventListener\n\n connectedCallback(): void {\n super.connectedCallback()\n\n // Register event listeners for zooming and dragging\n this.addEventListener('wheel', this.wheelEventHandler)\n this.addEventListener('mousedown', this.dragStartHandler)\n this.addEventListener('touchstart', this.dragStartHandler)\n this.addEventListener('dblclick', this.resetHandler)\n\n document.addEventListener('mouseup', this.dragEndHandler)\n document.addEventListener('touchend', this.dragEndHandler)\n document.addEventListener('touchcancel', this.dragEndHandler)\n document.addEventListener('mousemove', this.dragMoveHandler)\n document.addEventListener('touchmove', this.dragMoveHandler)\n\n this.calculateMinZoom() // Calculate the minimum zoom level based on the image and container size\n }\n\n disconnectedCallback(): void {\n // Remove event listeners when the component is disconnected\n this.removeEventListener('wheel', this.wheelEventHandler)\n this.removeEventListener('mousedown', this.dragStartHandler)\n this.removeEventListener('touchstart', this.dragStartHandler)\n this.removeEventListener('dblclick', this.resetHandler)\n\n document.removeEventListener('mouseup', this.dragEndHandler)\n document.removeEventListener('touchend', this.dragEndHandler)\n document.removeEventListener('touchcancel', this.dragEndHandler)\n document.removeEventListener('mousemove', this.dragMoveHandler)\n document.removeEventListener('touchmove', this.dragMoveHandler)\n\n super.disconnectedCallback()\n }\n\n updated(changes: PropertyValues<this>): void {\n // Update the background image and transform style when properties change\n if (changes.has('src') && this.src) {\n this.style.setProperty('--background-image', `url('${this.src}')`)\n this.calculateMinZoom() // Recalculate the minimum zoom level when the source changes\n }\n this.updateTransform() // Apply the current zoom and position\n }\n\n private calculateMinZoom() {\n // Calculate the minimum zoom level to ensure the image always fills the container\n const img = new Image()\n img.src = this.src || ''\n img.onload = () => {\n this.imageWidth = img.width\n this.imageHeight = img.height\n\n const aspectRatio = img.width / img.height\n const hostAspectRatio = this.offsetWidth / this.offsetHeight\n if (aspectRatio < hostAspectRatio) {\n this.minZoom = this.offsetHeight / img.height\n } else {\n this.minZoom = this.offsetWidth / img.width\n }\n this.zoom = 1 // this.minZoom\n this.left = 0 // Center the image\n this.top = 0 // Center the image\n this.updateTransform()\n }\n }\n\n private onWheelEvent(e: WheelEvent): void {\n // Handle zoom in and out based on mouse wheel events\n e.preventDefault()\n const delta = Math.sign(e.deltaY)\n const newZoom = Math.max(1, this.zoom * (1 - delta / 20))\n const zoomFactor = newZoom / this.zoom\n\n const rect = this.getBoundingClientRect()\n const offsetX = e.clientX - rect.left - rect.width / 2\n const offsetY = e.clientY - rect.top - rect.height / 2\n\n // Adjust the position to zoom in/out relative to the center of the client rect\n this.left -= offsetX * (zoomFactor - 1)\n this.top -= offsetY * (zoomFactor - 1)\n\n this.zoom = newZoom\n this.applyBounds() // Ensure the image stays within bounds\n this.updateTransform() // Apply the new zoom and position\n }\n\n private onDragStart(e: MouseEvent | TouchEvent): void {\n // Start dragging the image\n const point = getPoint(e)\n if (point) {\n this.dragStart = point\n e.stopPropagation()\n }\n }\n\n private onDragMove(e: MouseEvent | TouchEvent): void {\n // Move the image based on drag events\n if (!this.dragStart) return\n\n const point = getPoint(e)\n if (!point) return\n\n e.stopPropagation()\n e.preventDefault()\n\n const { x, y } = point\n this.left += x - this.dragStart.x\n this.top += y - this.dragStart.y\n\n this.dragStart = point\n this.applyBounds() // Ensure the image stays within bounds\n this.updateTransform() // Apply the new position\n }\n\n private onDragEnd(e: Event): void {\n // End the drag operation\n if (this.dragStart) {\n e.stopPropagation()\n e.preventDefault()\n this.dragStart = undefined\n }\n }\n\n private onReset(e: Event): void {\n // Reset zoom and position to initial state\n this.zoom = 1\n this.left = 0\n this.top = 0\n this.updateTransform()\n }\n\n private updateTransform() {\n // Apply the current zoom and position to the image\n this.style.setProperty('--image-transform', `scale(${this.zoom}) translate(${this.left}px, ${this.top}px)`)\n }\n\n private applyBounds() {\n // Ensure the image stays within the bounds of the container\n const hostWidth = this.offsetWidth\n const hostHeight = this.offsetHeight\n\n const aspectRatio = this.imageHeight / this.imageWidth\n const hostAspectRatio = hostHeight / hostWidth\n\n if (aspectRatio < hostAspectRatio) {\n /* image ratio is wider than host */\n var minX = Math.min(0, (-hostWidth * (this.zoom - 1)) / 2 / this.zoom)\n var maxX = -minX\n\n var minY = (hostHeight - hostWidth * aspectRatio * this.zoom) / 2 / this.zoom\n minY = Math.min(minY, -minY)\n var maxY = -minY\n\n this.left = Math.max(minX, Math.min(this.left, maxX))\n this.top = Math.max(minY, Math.min(this.top, maxY))\n } else {\n var minX = (hostWidth - (hostHeight / aspectRatio) * this.zoom) / 2 / this.zoom\n minX = Math.min(minX, -minX)\n var maxX = -minX\n\n var minY = Math.min(0, (-hostHeight * (this.zoom - 1)) / 2 / this.zoom)\n var maxY = -minY\n\n this.left = Math.max(minX, Math.min(this.left, maxX))\n this.top = Math.max(minY, Math.min(this.top, maxY))\n }\n }\n}\n"]}
1
+ {"version":3,"file":"ox-zoomable-image.js","sourceRoot":"","sources":["../../src/ox-zoomable-image.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,kEAAkE;AAClE,SAAS,QAAQ,CAAC,CAA0B;IAC1C,IAAI,CAAC,YAAY,UAAU,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9C,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAA;IACvC,CAAC;SAAM,IAAI,CAAC,YAAY,UAAU,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7D,MAAM,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;QAC1B,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,EAAE,CAAA;IAC/C,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGI,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QA+BY,SAAI,GAAG,CAAC,CAAA,CAAC,qBAAqB;QAC9B,SAAI,GAAG,CAAC,CAAA,CAAC,sBAAsB;QAC/B,QAAG,GAAG,CAAC,CAAA,CAAC,oBAAoB;QAC5B,YAAO,GAAG,CAAC,CAAA,CAAC,qBAAqB;QACjC,eAAU,GAAG,CAAC,CAAA;QACd,gBAAW,GAAG,CAAC,CAAA;QAIhC,yCAAyC;QACxB,mBAAc,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IA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CAAC,CAAA;YACrD,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAA;QACrD,CAAC;IACH,CAAC;;AArND,sCAAsC;AAC/B,sBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BlB,AA1BY,CA0BZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAa;AACvB;IAAhB,KAAK,EAAE;6CAAiB;AACR;IAAhB,KAAK,EAAE;6CAAiB;AACR;IAAhB,KAAK,EAAE;4CAAgB;AACP;IAAhB,KAAK,EAAE;gDAAoB;AACX;IAAhB,KAAK,EAAE;mDAAuB;AACd;IAAhB,KAAK,EAAE;oDAAwB;AApCrB,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAuN3B","sourcesContent":["import { css, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\n// Utility function to get the point from MouseEvent or TouchEvent\nfunction getPoint(e: MouseEvent | TouchEvent): { x: number; y: number } | undefined {\n if (e instanceof MouseEvent && e.button === 0) {\n return { x: e.clientX, y: e.clientY }\n } else if (e instanceof TouchEvent && e.touches.length === 1) {\n const touch = e.touches[0]\n return { x: touch.clientX, y: touch.clientY }\n }\n return undefined\n}\n\n/**\n * Example usage:\n *\n * <html>\n * <head>\n * <script type=\"module\" src=\"path/to/ox-zoomable-image.js\"></script>\n * <style>\n * body {\n * margin: 0;\n * overflow: hidden;\n * display: flex;\n * justify-content: center;\n * align-items: center;\n * height: 100vh;\n * }\n * ox-zoomable-image {\n * width: 80%;\n * height: 80%;\n * }\n * </style>\n * </head>\n * <body>\n * <ox-zoomable-image src=\"path/to/your/image.jpg\"></ox-zoomable-image>\n * </body>\n * </html>\n */\n\n@customElement('ox-zoomable-image')\nexport class OxZoomableImage extends LitElement {\n // Define CSS styles for the component\n static styles = css`\n :host {\n display: block;\n position: relative;\n width: 100%;\n height: 100%;\n overflow: hidden;\n }\n\n :host::before {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n right: 0;\n width: 100%;\n height: 100%;\n background-image: var(\n --background-image,\n linear-gradient(var(--primary-color, lightgray), var(--primary-color, lightgray))\n );\n transform: var(--image-transform, '');\n background-repeat: no-repeat;\n background-position: center;\n background-size: contain;\n }\n `\n\n @property({ type: String }) src?: string // Source URL for the image\n @state() private zoom = 1 // Current zoom level\n @state() private left = 0 // Horizontal position\n @state() private top = 0 // Vertical position\n @state() private minZoom = 1 // Minimum zoom level\n @state() private imageWidth = 0\n @state() private imageHeight = 0\n\n private dragStart?: { x: number; y: number } // Starting point of drag\n\n // Event listeners bound to the component\n private readonly dragEndHandler = this.onDragEnd.bind(this) as EventListener\n private readonly dragMoveHandler = this.onDragMove.bind(this) as EventListener\n private readonly dragStartHandler = this.onDragStart.bind(this) as EventListener\n private readonly wheelEventHandler = this.onWheelEvent.bind(this) as EventListener\n private readonly resetHandler = this.onReset.bind(this) as EventListener\n\n connectedCallback(): void {\n super.connectedCallback()\n\n // Register event listeners for zooming and dragging\n this.addEventListener('wheel', this.wheelEventHandler)\n this.addEventListener('mousedown', this.dragStartHandler)\n this.addEventListener('touchstart', this.dragStartHandler)\n this.addEventListener('dblclick', this.resetHandler)\n\n document.addEventListener('mouseup', this.dragEndHandler)\n document.addEventListener('touchend', this.dragEndHandler)\n document.addEventListener('touchcancel', this.dragEndHandler)\n document.addEventListener('mousemove', this.dragMoveHandler)\n document.addEventListener('touchmove', this.dragMoveHandler)\n\n this.calculateMinZoom() // Calculate the minimum zoom level based on the image and container size\n }\n\n disconnectedCallback(): void {\n // Remove event listeners when the component is disconnected\n this.removeEventListener('wheel', this.wheelEventHandler)\n this.removeEventListener('mousedown', this.dragStartHandler)\n this.removeEventListener('touchstart', this.dragStartHandler)\n this.removeEventListener('dblclick', this.resetHandler)\n\n document.removeEventListener('mouseup', this.dragEndHandler)\n document.removeEventListener('touchend', this.dragEndHandler)\n document.removeEventListener('touchcancel', this.dragEndHandler)\n document.removeEventListener('mousemove', this.dragMoveHandler)\n document.removeEventListener('touchmove', this.dragMoveHandler)\n\n super.disconnectedCallback()\n }\n\n updated(changes: PropertyValues<this>): void {\n // Update the background image and transform style when properties change\n if (changes.has('src') && this.src) {\n this.style.setProperty('--background-image', `url('${this.src}')`)\n this.calculateMinZoom() // Recalculate the minimum zoom level when the source changes\n }\n this.updateTransform() // Apply the current zoom and position\n }\n\n private calculateMinZoom() {\n // Calculate the minimum zoom level to ensure the image always fills the container\n const img = new Image()\n img.src = this.src || ''\n img.onload = () => {\n this.imageWidth = img.width\n this.imageHeight = img.height\n\n const aspectRatio = img.width / img.height\n const hostAspectRatio = this.offsetWidth / this.offsetHeight\n if (aspectRatio < hostAspectRatio) {\n this.minZoom = this.offsetHeight / img.height\n } else {\n this.minZoom = this.offsetWidth / img.width\n }\n this.zoom = 1 // this.minZoom\n this.left = 0 // Center the image\n this.top = 0 // Center the image\n this.updateTransform()\n }\n }\n\n private onWheelEvent(e: WheelEvent): void {\n // Handle zoom in and out based on mouse wheel events\n e.preventDefault()\n const delta = Math.sign(e.deltaY)\n const newZoom = Math.max(1, this.zoom * (1 - delta / 20))\n const zoomFactor = newZoom / this.zoom\n\n const rect = this.getBoundingClientRect()\n const offsetX = e.clientX - rect.left - rect.width / 2\n const offsetY = e.clientY - rect.top - rect.height / 2\n\n // Adjust the position to zoom in/out relative to the center of the client rect\n this.left -= offsetX * (zoomFactor - 1)\n this.top -= offsetY * (zoomFactor - 1)\n\n this.zoom = newZoom\n this.applyBounds() // Ensure the image stays within bounds\n this.updateTransform() // Apply the new zoom and position\n }\n\n private onDragStart(e: MouseEvent | TouchEvent): void {\n // Start dragging the image\n const point = getPoint(e)\n if (point) {\n this.dragStart = point\n e.stopPropagation()\n }\n }\n\n private onDragMove(e: MouseEvent | TouchEvent): void {\n // Move the image based on drag events\n if (!this.dragStart) return\n\n const point = getPoint(e)\n if (!point) return\n\n e.stopPropagation()\n e.preventDefault()\n\n const { x, y } = point\n this.left += x - this.dragStart.x\n this.top += y - this.dragStart.y\n\n this.dragStart = point\n this.applyBounds() // Ensure the image stays within bounds\n this.updateTransform() // Apply the new position\n }\n\n private onDragEnd(e: Event): void {\n // End the drag operation\n if (this.dragStart) {\n e.stopPropagation()\n e.preventDefault()\n this.dragStart = undefined\n }\n }\n\n private onReset(e: Event): void {\n // Reset zoom and position to initial state\n this.zoom = 1\n this.left = 0\n this.top = 0\n this.updateTransform()\n }\n\n private updateTransform() {\n // Apply the current zoom and position to the image\n this.style.setProperty('--image-transform', `scale(${this.zoom}) translate(${this.left}px, ${this.top}px)`)\n }\n\n private applyBounds() {\n // Ensure the image stays within the bounds of the container\n const hostWidth = this.offsetWidth\n const hostHeight = this.offsetHeight\n\n const aspectRatio = this.imageHeight / this.imageWidth\n const hostAspectRatio = hostHeight / hostWidth\n\n if (aspectRatio < hostAspectRatio) {\n /* image ratio is wider than host */\n var minX = (hostWidth * (1 - this.zoom)) / 2\n minX = minX > 0 ? -minX : minX\n var maxX = -minX\n\n var minY = (hostHeight - hostWidth * aspectRatio * this.zoom) / 2 / this.zoom\n minY = Math.min(minY, -minY)\n var maxY = -minY\n\n this.left = Math.max(minX, Math.min(this.left, maxX))\n this.top = Math.max(minY, Math.min(this.top, maxY))\n } else {\n var minX = (hostWidth - (hostHeight / aspectRatio) * this.zoom) / 2 / this.zoom\n minX = Math.min(minX, -minX)\n var maxX = -minX\n\n var minY = (-hostHeight * (1 - this.zoom)) / 2\n minY = minY > 0 ? -minY : minY\n var maxY = -minY\n\n this.left = Math.max(minX, Math.min(this.left, maxX))\n this.top = Math.max(minY, Math.min(this.top, maxY))\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/tslib/tslib.d.ts","../../../node_modules/@lit/reactive-element/css-tag.d.ts","../../../node_modules/@lit/reactive-element/reactive-controller.d.ts","../../../node_modules/@lit/reactive-element/reactive-element.d.ts","../../../node_modules/lit-html/directive.d.ts","../../../node_modules/@types/trusted-types/lib/index.d.ts","../../../node_modules/lit-html/lit-html.d.ts","../../../node_modules/lit-element/lit-element.d.ts","../../../node_modules/lit-html/is-server.d.ts","../../../node_modules/lit/index.d.ts","../../../node_modules/@lit/reactive-element/decorators/base.d.ts","../../../node_modules/@lit/reactive-element/decorators/custom-element.d.ts","../../../node_modules/@lit/reactive-element/decorators/property.d.ts","../../../node_modules/@lit/reactive-element/decorators/state.d.ts","../../../node_modules/@lit/reactive-element/decorators/event-options.d.ts","../../../node_modules/@lit/reactive-element/decorators/query.d.ts","../../../node_modules/@lit/reactive-element/decorators/query-all.d.ts","../../../node_modules/@lit/reactive-element/decorators/query-async.d.ts","../../../node_modules/@lit/reactive-element/decorators/query-assigned-nodes.d.ts","../../../node_modules/@lit/reactive-element/decorators/query-assigned-elements.d.ts","../../../node_modules/lit/decorators.d.ts","../src/ox-mini-map.ts","../src/ox-zoomable-image.ts","../stories/ox-mini-map.stories.ts","../stories/ox-zoomable-image.stories.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/file.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../../node_modules/undici-types/retry-handler.d.ts","../../../node_modules/undici-types/retry-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/util.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/eventsource.d.ts","../../../node_modules/undici-types/filereader.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/sea.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@types/mocha/index.d.ts"],"fileInfos":[{"version":"44e584d4f6444f58791784f1d530875970993129442a847597db702a073ca68c","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4",{"version":"4af6b0c727b7a2896463d512fafd23634229adf69ac7c00e2ae15a09cb084fad","affectsGlobalScope":true},{"version":"6920e1448680767498a0b77c6a00a8e77d14d62c3da8967b171f1ddffa3c18e4","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true},{"version":"ae37d6ccd1560b0203ab88d46987393adaaa78c919e51acf32fb82c86502e98c","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"479553e3779be7d4f68e9f40cdb82d038e5ef7592010100410723ceced22a0f7","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"4a882ffbb4ed09d9b7734f784aebb1dfe488d63725c40759165c5d9c657ca029","e056bb30bf82271634daeee81f772f4a7960085f01f6d4d09c8da1ebe5f6a623","5e30131b6a5587fe666926ad1d9807e733c0a597ed12d682669fcaa331aea576",{"version":"86492a546c3308feaf1dde967afd325c321483b5e96f5fa9e9b6e691dc23fa9e","affectsGlobalScope":true},"00cb63103f9670f8094c238a4a7e252c8b4c06ba371fea5c44add7e41b7247e4","15fe687c59d62741b4494d5e623d497d55eb38966ecf5bea7f36e48fc3fbe15e","43f58358870effc43ba93c92c040dee2285cbd8685ddfa77658e498780727c4e","9a318e3a8900672b85cd3c8c3a5acf51b88049557a3ae897ccdcf2b85a8f61f9","1bcd560deed90a43c51b08aa18f7f55229f2e30974ab5ed1b7bb5721be379013","dc08fe04e50bc24d1baded4f33e942222bbdd5d77d6341a93cfe6e4e4586a3be","cdeae34aca6700620ebf3f27cf7d439c3af97595dd6e2729fa4780483add5680","3ff87ea3471b51beaf4aa8fd8f4422862b11d343fdbb55bf383e0f8cc195a445","1cc188904259bd0985b24d9dc2a160891cb5e94210901466b951716fcdb4ff62","732fb71ecb695d6f36ddcbb72ebfe4ff6b6491d45101a00fa2b75a26b80d640f","039cb05125d7621f8143616c495b8e6b54249c4e64d2754b80ff93867f7f4b01","1b81f1fa82ad30af01ab1cae91ccaddc10c48f5916bbd6d282155e44a65d858d","a0fc7a02a75802678a67000607f20266cf1a49dc0e787967efe514e31b9ed0c3","5ebf098a1d81d400b8af82807cf19893700335cf91a7b9dbd83a5d737af34b11","101cf83ac3f9c5e1a7355a02e4fbe988877ef83c4ebec0ff0f02b2af022254a3","d017e2fcd44b46ca80cd2b592a6314e75f5caab5bda230f0f4a45e964049a43a","a8992b852521a66f63e0cedc6e1f054b28f972232b6fa5ca59771db6a1c8bbea",{"version":"8ec7c5bd11865ecce36db79bc2ee3acd1d1c8639b08a10193d20c924e65c2923","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"62397ab26e7a601edbdd5785d87aa89f1affc31115084501d27e4e1560c9fa43","signature":"4b929f685ad45c68f6a68af19ac04a386c54305c333dbfab626357e447db6053"},{"version":"f0984c9c94c10ee5fbc27e781ae00e56805ae3e9bd000ac04818ce8786b85454","signature":"947aa7963125d1eb59991384b5b7f228579deb0dcbea4750a57a797d07e5df67"},{"version":"91b93c5996a18d646f782c6d0b57a6afa47e26289a12dfbfddbfd8e1db546724","signature":"4343ff0249d6e86ab07db4c3fc8f080d98e7d526acc288ecaf009fcaff34dbb4"},"e142fda89ed689ea53d6f2c93693898464c7d29a0ae71c6dc8cdfe5a1d76c775","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","8e9c23ba78aabc2e0a27033f18737a6df754067731e69dc5f52823957d60a4b6","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","4d2b0eb911816f66abe4970898f97a2cfc902bcd743cbfa5017fad79f7ef90d8","bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","24b8685c62562f5d98615c5a0c1d05f297cf5065f15246edfe99e81ec4c0e011","93507c745e8f29090efb99399c3f77bec07db17acd75634249dc92f961573387","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107",{"version":"b028f7df55fa70e9d8939bba6c57967ee4eea0fc5d1911b52289978818ab10a3","affectsGlobalScope":true},"db3ec8993b7596a4ef47f309c7b25ee2505b519c13050424d9c34701e5973315",{"version":"5a38909344f43b30b74c90623f83f4412344e992f2ff158e3b6d3725af18dc02","affectsGlobalScope":true},"af49b066a76ce26673fe49d1885cc6b44153f1071ed2d952f2a90fccba1095c9","f22fd1dc2df53eaf5ce0ff9e0a3326fc66f880d6a652210d50563ae72625455f",{"version":"3ddbdb519e87a7827c4f0c4007013f3628ca0ebb9e2b018cf31e5b2f61c593f1","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb",{"version":"6d498d4fd8036ea02a4edcae10375854a0eb1df0496cf0b9d692577d3c0fd603","affectsGlobalScope":true},"24642567d3729bcc545bacb65ee7c0db423400c7f1ef757cab25d05650064f98","fd09b892597ab93e7f79745ce725a3aaf6dd005e8db20f0c63a5d10984cba328","a3be878ff1e1964ab2dc8e0a3b67087cf838731c7f3d8f603337e7b712fdd558","5433f7f77cd1fd53f45bd82445a4e437b2f6a72a32070e907530a4fea56c30c8","9be74296ee565af0c12d7071541fdd23260f53c3da7731fb6361f61150a791f6",{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true},{"version":"f501a53b94ba382d9ba396a5c486969a3abc68309828fa67f916035f5d37fe2b","affectsGlobalScope":true},"aa658b5d765f630c312ac9202d110bbaf2b82d180376457f0a9d57b42629714a","312ac7cbd070107766a9886fd27f9faad997ef57d93fdfb4095df2c618ac8162","bcfcff784a59db3f323c25cea5ae99a903ca9292c060f2c7e470ea73aaf71b44","672ad3045f329e94002256f8ed460cfd06173a50c92cde41edaadfacffd16808","64da4965d1e0559e134d9c1621ae400279a216f87ed00c4cce4f2c7c78021712","ddbf3aac94f85dbb8e4d0360782e60020da75a0becfc0d3c69e437c645feb30f",{"version":"0166fce1204d520fdfd6b5febb3cda3deee438bcbf8ce9ffeb2b1bcde7155346","affectsGlobalScope":true},"d8b13eab85b532285031b06a971fa051bf0175d8fff68065a24a6da9c1c986cf","50c382ba1827988c59aa9cc9d046e386d55d70f762e9e352e95ee8cb7337cdb8","2178ab4b68402d1de2dda199d3e4a55f7200e3334f5a9727fbd9d16975cdf75f",{"version":"21d7e87f271e72d02f8d167edc902f90b04525edc7918f00f01dd0bd00599f7e","affectsGlobalScope":true},{"version":"6dcdc8592e04b95cee9fce2c82de3613c170e47573c5d2f464787d574a68e5eb","affectsGlobalScope":true},"a215554477f7629e3dcbc8cde104bec036b78673650272f5ffdc5a2cee399a0a","c3497fc242aabfedcd430b5932412f94f157b5906568e737f6a18cc77b36a954","cdc1de3b672f9ef03ff15c443aa1b631edca35b6ae6970a7da6400647ff74d95","139ad1dc93a503da85b7a0d5f615bddbae61ad796bc68fedd049150db67a1e26","bf01fdd3b93cf633b3f7420718457af19c57ab8cbfea49268df60bae2e84d627","15c5e91b5f08be34a78e3d976179bf5b7a9cc28dc0ef1ffebffeb3c7812a2dca","65b39cc6b610a4a4aecc321f6efb436f10c0509d686124795b4c36a5e915b89e","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","3c1f19c7abcda6b3a4cf9438a15c7307a080bd3b51dfd56b198d9f86baf19447","d3edb86744e2c19f2c1503849ac7594a5e06024f2451bacae032390f2e20314a",{"version":"ea70400f0fe63efb412817f818a4f67afeb9f7edf4c6a320064b8dabe05588d4","affectsGlobalScope":true},{"version":"8a3e61347b8f80aa5af532094498bceb0c0b257b25a6aa8ab4880fd6ed57c95a","affectsGlobalScope":true},"98e00f3613402504bc2a2c9a621800ab48e0a463d1eed062208a4ae98ad8f84c","950f6810f7c80e0cffefcf1bcc6ade3485c94394720e334c3c2be3c16b6922fb","5475df7cfc493a08483c9d7aa61cc04791aecba9d0a2efc213f23c4006d4d3cd","000720870b275764c65e9f28ac97cc9e4d9e4a36942d4750ca8603e416e9c57c",{"version":"54412c70bacb9ed547ed6caae8836f712a83ccf58d94466f3387447ec4e82dc3","affectsGlobalScope":true},{"version":"e74e7b0baa7a24f073080091427d36a75836d584b9393e6ac2b1daf1647fe65a","affectsGlobalScope":true},"4c48e931a72f6971b5add7fdb1136be1d617f124594e94595f7114af749395e0","478eb5c32250678a906d91e0529c70243fc4d75477a08f3da408e2615396f558","e686a88c9ee004c8ba12ffc9d674ca3192a4c50ed0ca6bd5b2825c289e2b2bfe",{"version":"98d547613610452ac9323fb9ec4eafc89acab77644d6e23105b3c94913f712b3","affectsGlobalScope":true},"4423fb3d6abe6eefb8d7f79eb2df9510824a216ec1c6feee46718c9b18e6d89f",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"a42be67ed1ddaec743582f41fc219db96a1b69719fccac6d1464321178d610fc",{"version":"90ebf5865e27d8966ef44b073e6e83b0ddd45058bab1d58b1e4b5a47d36396c4","affectsGlobalScope":true}],"root":[[68,71]],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"esModuleInterop":true,"experimentalDecorators":true,"importHelpers":true,"inlineSources":true,"module":99,"noEmitOnError":true,"outDir":"./","rootDir":"..","sourceMap":true,"strict":true,"target":5,"useDefineForClassFields":false},"fileIdsList":[[57],[50,57],[50,57,65],[59],[48,49],[72],[113],[114,119,148],[115,120,126,127,134,145,156],[115,116,126,134],[117,157],[118,119,127,135],[119,145,153],[120,122,126,134],[113,121],[122,123],[126],[124,126],[113,126],[126,127,128,145,156],[126,127,128,141,145,148],[111,114,161],[122,126,129,134,145,156],[126,127,129,130,134,145,153,156],[129,131,145,153,156],[72,73,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163],[126,132],[133,156,161],[122,126,134,145],[135],[136],[113,137],[72,73,113,114,115,116,117,118,119,120,121,122,123,124,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162],[139],[140],[126,141,142],[141,143,157,159],[114,126,145,146,147,148],[114,145,147],[145,146],[148],[149],[72,145],[126,151,152],[151,152],[119,134,145,153],[154],[134,155],[114,129,140,156],[119,157],[145,158],[133,159],[160],[114,119,126,128,137,145,156,159,161],[145,162],[50,53],[53],[51,52],[58,59,60,61,62,63,64,65,66],[50,53,54,55],[83,87,156],[83,145,156],[78],[80,83,153,156],[134,153],[164],[78,164],[80,83,134,156],[75,76,79,82,114,126,145,156],[83,90],[75,81],[83,104,105],[79,83,114,148,156,164],[114,164],[104,114,164],[77,78,164],[83],[77,78,79,80,81,82,83,84,85,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,105,106,107,108,109,110],[83,98],[83,90,91],[81,83,91,92],[82],[75,78,83],[83,87,91,92],[87],[81,83,86,156],[75,80,83,90],[114,145],[78,83,104,114,161,164],[47,56,67],[47,56,68],[47,53,69]],"referencedMap":[[58,1],[61,2],[59,2],[63,2],[66,3],[65,2],[64,2],[62,2],[60,4],[50,5],[72,6],[73,6],[113,7],[114,8],[115,9],[116,10],[117,11],[118,12],[119,13],[120,14],[121,15],[122,16],[123,16],[125,17],[124,18],[126,19],[127,20],[128,21],[112,22],[129,23],[130,24],[131,25],[164,26],[132,27],[133,28],[134,29],[135,30],[136,31],[137,32],[138,33],[139,34],[140,35],[141,36],[142,36],[143,37],[145,38],[147,39],[146,40],[148,41],[149,42],[150,43],[151,44],[152,45],[153,46],[154,47],[155,48],[156,49],[157,50],[158,51],[159,52],[160,53],[161,54],[162,55],[54,56],[51,57],[53,58],[67,59],[56,60],[90,61],[100,62],[89,61],[110,63],[81,64],[80,65],[109,66],[103,67],[108,68],[83,69],[97,70],[82,71],[106,72],[78,73],[77,74],[107,75],[79,76],[84,77],[88,77],[111,78],[101,79],[92,80],[93,81],[95,82],[91,83],[94,84],[104,66],[86,85],[87,86],[96,87],[76,88],[99,79],[98,77],[105,89],[68,90],[69,90],[70,91],[71,92]]},"version":"5.5.4"}
1
+ {"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/tslib/tslib.d.ts","../../../node_modules/@lit/reactive-element/css-tag.d.ts","../../../node_modules/@lit/reactive-element/reactive-controller.d.ts","../../../node_modules/@lit/reactive-element/reactive-element.d.ts","../../../node_modules/lit-html/directive.d.ts","../../../node_modules/@types/trusted-types/lib/index.d.ts","../../../node_modules/lit-html/lit-html.d.ts","../../../node_modules/lit-element/lit-element.d.ts","../../../node_modules/lit-html/is-server.d.ts","../../../node_modules/lit/index.d.ts","../../../node_modules/@lit/reactive-element/decorators/base.d.ts","../../../node_modules/@lit/reactive-element/decorators/custom-element.d.ts","../../../node_modules/@lit/reactive-element/decorators/property.d.ts","../../../node_modules/@lit/reactive-element/decorators/state.d.ts","../../../node_modules/@lit/reactive-element/decorators/event-options.d.ts","../../../node_modules/@lit/reactive-element/decorators/query.d.ts","../../../node_modules/@lit/reactive-element/decorators/query-all.d.ts","../../../node_modules/@lit/reactive-element/decorators/query-async.d.ts","../../../node_modules/@lit/reactive-element/decorators/query-assigned-nodes.d.ts","../../../node_modules/@lit/reactive-element/decorators/query-assigned-elements.d.ts","../../../node_modules/lit/decorators.d.ts","../src/ox-mini-map.ts","../src/ox-zoomable-image.ts","../stories/ox-mini-map.stories.ts","../stories/ox-zoomable-image.stories.ts","../../../node_modules/@types/node/compatibility/disposable.d.ts","../../../node_modules/@types/node/compatibility/indexable.d.ts","../../../node_modules/@types/node/compatibility/iterators.d.ts","../../../node_modules/@types/node/compatibility/index.d.ts","../../../node_modules/@types/node/globals.typedarray.d.ts","../../../node_modules/@types/node/buffer.buffer.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/file.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../../node_modules/undici-types/retry-handler.d.ts","../../../node_modules/undici-types/retry-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/util.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/eventsource.d.ts","../../../node_modules/undici-types/filereader.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/sea.d.ts","../../../node_modules/@types/node/sqlite.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@types/mocha/index.d.ts"],"fileIdsList":[[77,120],[57,77,120],[50,57,77,120],[50,57,65,77,120],[59,77,120],[48,49,77,120],[77,117,120],[77,119,120],[120],[77,120,125,155],[77,120,121,126,132,133,140,152,163],[77,120,121,122,132,140],[72,73,74,77,120],[77,120,123,164],[77,120,124,125,133,141],[77,120,125,152,160],[77,120,126,128,132,140],[77,119,120,127],[77,120,128,129],[77,120,132],[77,120,130,132],[77,119,120,132],[77,120,132,133,134,152,163],[77,120,132,133,134,147,152,155],[77,115,120,168],[77,115,120,128,132,135,140,152,163],[77,120,132,133,135,136,140,152,160,163],[77,120,135,137,152,160,163],[75,76,77,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169],[77,120,132,138],[77,120,139,163,168],[77,120,128,132,140,152],[77,120,141],[77,120,142],[77,119,120,143],[77,117,118,119,120,121,122,123,124,125,126,127,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169],[77,120,145],[77,120,146],[77,120,132,147,148],[77,120,147,149,164,166],[77,120,132,152,153,154,155],[77,120,152,154],[77,120,152,153],[77,120,155],[77,120,156],[77,117,120,152],[77,120,132,158,159],[77,120,158,159],[77,120,125,140,152,160],[77,120,161],[77,120,140,162],[77,120,135,146,163],[77,120,125,164],[77,120,152,165],[77,120,139,166],[77,120,167],[77,120,125,132,134,143,152,163,166,168],[77,120,152,169],[50,53,77,120],[53,77,120],[51,52,77,120],[58,59,60,61,62,63,64,65,66,77,120],[50,53,54,55,77,120],[77,87,91,120,163],[77,87,120,152,163],[77,82,120],[77,84,87,120,160,163],[77,120,140,160],[77,120,170],[77,82,120,170],[77,84,87,120,140,163],[77,79,80,83,86,120,132,152,163],[77,87,94,120],[77,79,85,120],[77,87,108,109,120],[77,83,87,120,155,163,170],[77,108,120,170],[77,81,82,120,170],[77,87,120],[77,81,82,83,84,85,86,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,109,110,111,112,113,114,120],[77,87,102,120],[77,87,94,95,120],[77,85,87,95,96,120],[77,86,120],[77,79,82,87,120],[77,87,91,95,96,120],[77,91,120],[77,85,87,90,120,163],[77,79,84,87,94,120],[77,120,152],[77,82,87,108,120,168,170],[47,56,67,77,120],[47,56,68,77,120],[47,53,69,77,120]],"fileInfos":[{"version":"e41c290ef7dd7dab3493e6cbe5909e0148edf4a8dad0271be08edec368a0f7b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"4fd3f3422b2d2a3dfd5cdd0f387b3a8ec45f006c6ea896a4cb41264c2100bb2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"62bb211266ee48b2d0edf0d8d1b191f0c24fc379a82bd4c1692a082c540bc6b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"f1e2a172204962276504466a6393426d2ca9c54894b1ad0a6c9dad867a65f876","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"a6a5253138c5432c68a1510c70fe78a644fe2e632111ba778e1978010d6edfec","impliedFormat":1},{"version":"e056bb30bf82271634daeee81f772f4a7960085f01f6d4d09c8da1ebe5f6a623","impliedFormat":99},{"version":"5e30131b6a5587fe666926ad1d9807e733c0a597ed12d682669fcaa331aea576","impliedFormat":99},{"version":"86492a546c3308feaf1dde967afd325c321483b5e96f5fa9e9b6e691dc23fa9e","affectsGlobalScope":true,"impliedFormat":99},{"version":"00cb63103f9670f8094c238a4a7e252c8b4c06ba371fea5c44add7e41b7247e4","impliedFormat":99},{"version":"15fe687c59d62741b4494d5e623d497d55eb38966ecf5bea7f36e48fc3fbe15e","impliedFormat":1},{"version":"43f58358870effc43ba93c92c040dee2285cbd8685ddfa77658e498780727c4e","impliedFormat":99},{"version":"9a318e3a8900672b85cd3c8c3a5acf51b88049557a3ae897ccdcf2b85a8f61f9","impliedFormat":99},{"version":"1bcd560deed90a43c51b08aa18f7f55229f2e30974ab5ed1b7bb5721be379013","impliedFormat":99},{"version":"dc08fe04e50bc24d1baded4f33e942222bbdd5d77d6341a93cfe6e4e4586a3be","impliedFormat":99},{"version":"cdeae34aca6700620ebf3f27cf7d439c3af97595dd6e2729fa4780483add5680","impliedFormat":99},{"version":"3ff87ea3471b51beaf4aa8fd8f4422862b11d343fdbb55bf383e0f8cc195a445","impliedFormat":99},{"version":"1cc188904259bd0985b24d9dc2a160891cb5e94210901466b951716fcdb4ff62","impliedFormat":99},{"version":"732fb71ecb695d6f36ddcbb72ebfe4ff6b6491d45101a00fa2b75a26b80d640f","impliedFormat":99},{"version":"039cb05125d7621f8143616c495b8e6b54249c4e64d2754b80ff93867f7f4b01","impliedFormat":99},{"version":"1b81f1fa82ad30af01ab1cae91ccaddc10c48f5916bbd6d282155e44a65d858d","impliedFormat":99},{"version":"a0fc7a02a75802678a67000607f20266cf1a49dc0e787967efe514e31b9ed0c3","impliedFormat":99},{"version":"5ebf098a1d81d400b8af82807cf19893700335cf91a7b9dbd83a5d737af34b11","impliedFormat":99},{"version":"101cf83ac3f9c5e1a7355a02e4fbe988877ef83c4ebec0ff0f02b2af022254a3","impliedFormat":99},{"version":"d017e2fcd44b46ca80cd2b592a6314e75f5caab5bda230f0f4a45e964049a43a","impliedFormat":99},{"version":"a8992b852521a66f63e0cedc6e1f054b28f972232b6fa5ca59771db6a1c8bbea","impliedFormat":99},{"version":"8ec7c5bd11865ecce36db79bc2ee3acd1d1c8639b08a10193d20c924e65c2923","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"50f2ba3b7c9a7d28078d8f06aef1d4b9d9e5a7364d2541e1e49cde30360e2762","signature":"4b929f685ad45c68f6a68af19ac04a386c54305c333dbfab626357e447db6053"},{"version":"f0984c9c94c10ee5fbc27e781ae00e56805ae3e9bd000ac04818ce8786b85454","signature":"947aa7963125d1eb59991384b5b7f228579deb0dcbea4750a57a797d07e5df67"},{"version":"91b93c5996a18d646f782c6d0b57a6afa47e26289a12dfbfddbfd8e1db546724","signature":"4343ff0249d6e86ab07db4c3fc8f080d98e7d526acc288ecaf009fcaff34dbb4"},{"version":"70521b6ab0dcba37539e5303104f29b721bfb2940b2776da4cc818c07e1fefc1","affectsGlobalScope":true,"impliedFormat":1},{"version":"030e350db2525514580ed054f712ffb22d273e6bc7eddc1bb7eda1e0ba5d395e","affectsGlobalScope":true,"impliedFormat":1},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"a79e62f1e20467e11a904399b8b18b18c0c6eea6b50c1168bf215356d5bebfaf","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fd06258805d26c72f5997e07a23155d322d5f05387adb3744a791fe6a0b042d","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e9c23ba78aabc2e0a27033f18737a6df754067731e69dc5f52823957d60a4b6","impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"ba97261afafe85aafe76d988e65e531da8e8cf791c49caf0531f5dd1689bd91b","affectsGlobalScope":true,"impliedFormat":1},{"version":"f52e8dacc97d71dcc96af29e49584353f9c54cb916d132e3e768d8b8129c928d","impliedFormat":1},{"version":"7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","impliedFormat":1},{"version":"76103716ba397bbb61f9fa9c9090dca59f39f9047cb1352b2179c5d8e7f4e8d0","impliedFormat":1},{"version":"53eac70430b30089a3a1959d8306b0f9cfaf0de75224b68ef25243e0b5ad1ca3","affectsGlobalScope":true,"impliedFormat":1},{"version":"4314c7a11517e221f7296b46547dbc4df047115b182f544d072bdccffa57fc72","impliedFormat":1},{"version":"115971d64632ea4742b5b115fb64ed04bcaae2c3c342f13d9ba7e3f9ee39c4e7","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","impliedFormat":1},{"version":"86956cc2eb9dd371d6fab493d326a574afedebf76eef3fa7833b8e0d9b52d6f1","affectsGlobalScope":true,"impliedFormat":1},{"version":"24642567d3729bcc545bacb65ee7c0db423400c7f1ef757cab25d05650064f98","impliedFormat":1},{"version":"e6f5a38687bebe43a4cef426b69d34373ef68be9a6b1538ec0a371e69f309354","impliedFormat":1},{"version":"a6bf63d17324010ca1fbf0389cab83f93389bb0b9a01dc8a346d092f65b3605f","impliedFormat":1},{"version":"e009777bef4b023a999b2e5b9a136ff2cde37dc3f77c744a02840f05b18be8ff","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true,"impliedFormat":1},{"version":"88bc59b32d0d5b4e5d9632ac38edea23454057e643684c3c0b94511296f2998c","affectsGlobalScope":true,"impliedFormat":1},{"version":"e9ad08a376ac84948fcca0013d6f1d4ae4f9522e26b91f87945b97c99d7cc30b","impliedFormat":1},{"version":"eaf9ee1d90a35d56264f0bf39842282c58b9219e112ac7d0c1bce98c6c5da672","impliedFormat":1},{"version":"c15c4427ae7fd1dcd7f312a8a447ac93581b0d4664ddf151ecd07de4bf2bb9d7","impliedFormat":1},{"version":"5135bdd72cc05a8192bd2e92f0914d7fc43ee077d1293dc622a049b7035a0afb","impliedFormat":1},{"version":"4f80de3a11c0d2f1329a72e92c7416b2f7eab14f67e92cac63bb4e8d01c6edc8","impliedFormat":1},{"version":"6d386bc0d7f3afa1d401afc3e00ed6b09205a354a9795196caed937494a713e6","impliedFormat":1},{"version":"07562498d06bc1db00536c886f38e5f9892f8aef7a3720a25db714be4c775952","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4047ed87e765bd3bcc316a0c4c4c8b0061628460d8a5412d1c4b53a4658665a","impliedFormat":1},{"version":"b1b6ee0d012aeebe11d776a155d8979730440082797695fc8e2a5c326285678f","impliedFormat":1},{"version":"45875bcae57270aeb3ebc73a5e3fb4c7b9d91d6b045f107c1d8513c28ece71c0","impliedFormat":1},{"version":"3eb62baae4df08c9173e6903d3ca45942ccec8c3659b0565684a75f3292cffbb","affectsGlobalScope":true,"impliedFormat":1},{"version":"a85683ef86875f4ad4c6b7301bbcc63fb379a8d80d3d3fd735ee57f48ef8a47e","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"c6b4e0a02545304935ecbf7de7a8e056a31bb50939b5b321c9d50a405b5a0bba","impliedFormat":1},{"version":"fab29e6d649aa074a6b91e3bdf2bff484934a46067f6ee97a30fcd9762ae2213","impliedFormat":1},{"version":"8145e07aad6da5f23f2fcd8c8e4c5c13fb26ee986a79d03b0829b8fce152d8b2","impliedFormat":1},{"version":"e1120271ebbc9952fdc7b2dd3e145560e52e06956345e6fdf91d70ca4886464f","impliedFormat":1},{"version":"15c5e91b5f08be34a78e3d976179bf5b7a9cc28dc0ef1ffebffeb3c7812a2dca","impliedFormat":1},{"version":"58832ded29e0094047596544ac391d68c799d7bd7d35936f47221857141628f1","impliedFormat":1},{"version":"553870e516f8c772b89f3820576152ebc70181d7994d96917bb943e37da7f8a7","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","impliedFormat":1},{"version":"745c4240220559bd340c8aeb6e3c5270a709d3565e934dc22a69c304703956bc","affectsGlobalScope":true,"impliedFormat":1},{"version":"2754d8221d77c7b382096651925eb476f1066b3348da4b73fe71ced7801edada","impliedFormat":1},{"version":"9212c6e9d80cb45441a3614e95afd7235a55a18584c2ed32d6c1aca5a0c53d93","affectsGlobalScope":true,"impliedFormat":1},{"version":"bef91efa0baea5d0e0f0f27b574a8bc100ce62a6d7e70220a0d58af6acab5e89","affectsGlobalScope":true,"impliedFormat":1},{"version":"282fd2a1268a25345b830497b4b7bf5037a5e04f6a9c44c840cb605e19fea841","impliedFormat":1},{"version":"5360a27d3ebca11b224d7d3e38e3e2c63f8290cb1fcf6c3610401898f8e68bc3","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"7d6ff413e198d25639f9f01f16673e7df4e4bd2875a42455afd4ecc02ef156da","affectsGlobalScope":true,"impliedFormat":1},{"version":"6bd91a2a356600dee28eb0438082d0799a18a974a6537c4410a796bab749813c","affectsGlobalScope":true,"impliedFormat":1},{"version":"f689c4237b70ae6be5f0e4180e8833f34ace40529d1acc0676ab8fb8f70457d7","impliedFormat":1},{"version":"ae25afbbf1ed5df63a177d67b9048bf7481067f1b8dc9c39212e59db94fc9fc6","impliedFormat":1},{"version":"ac5ed35e649cdd8143131964336ab9076937fa91802ec760b3ea63b59175c10a","impliedFormat":1},{"version":"52a8e7e8a1454b6d1b5ad428efae3870ffc56f2c02d923467f2940c454aa9aec","affectsGlobalScope":true,"impliedFormat":1},{"version":"78dc0513cc4f1642906b74dda42146bcbd9df7401717d6e89ea6d72d12ecb539","impliedFormat":1},{"version":"ad90122e1cb599b3bc06a11710eb5489101be678f2920f2322b0ac3e195af78d","impliedFormat":1},{"version":"29f72ec1289ae3aeda78bf14b38086d3d803262ac13904b400422941a26a3636","affectsGlobalScope":true,"impliedFormat":1}],"root":[[68,71]],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"esModuleInterop":true,"experimentalDecorators":true,"importHelpers":true,"inlineSources":true,"module":99,"noEmitOnError":true,"outDir":"./","rootDir":"..","skipLibCheck":true,"sourceMap":true,"strict":true,"target":5,"useDefineForClassFields":false},"referencedMap":[[48,1],[57,1],[58,2],[61,3],[59,3],[63,3],[66,4],[65,3],[64,3],[62,3],[60,5],[49,1],[50,6],[171,1],[117,7],[118,7],[119,8],[77,9],[120,10],[121,11],[122,12],[72,1],[75,13],[73,1],[74,1],[123,14],[124,15],[125,16],[126,17],[127,18],[128,19],[129,19],[131,20],[130,21],[132,22],[133,23],[134,24],[116,25],[76,1],[135,26],[136,27],[137,28],[170,29],[138,30],[139,31],[140,32],[141,33],[142,34],[143,35],[144,36],[145,37],[146,38],[147,39],[148,39],[149,40],[150,1],[151,1],[152,41],[154,42],[153,43],[155,44],[156,45],[157,46],[158,47],[159,48],[160,49],[161,50],[162,51],[163,52],[164,53],[165,54],[166,55],[167,56],[168,57],[169,58],[52,1],[78,1],[54,59],[51,60],[55,1],[53,61],[67,62],[56,63],[47,1],[45,1],[46,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[19,1],[20,1],[4,1],[21,1],[25,1],[22,1],[23,1],[24,1],[26,1],[27,1],[28,1],[5,1],[29,1],[30,1],[31,1],[32,1],[6,1],[36,1],[33,1],[34,1],[35,1],[37,1],[7,1],[38,1],[43,1],[44,1],[39,1],[40,1],[41,1],[42,1],[1,1],[94,64],[104,65],[93,64],[114,66],[85,67],[84,68],[113,69],[107,70],[112,71],[87,72],[101,73],[86,74],[110,75],[82,76],[81,69],[111,77],[83,78],[88,79],[89,1],[92,79],[79,1],[115,80],[105,81],[96,82],[97,83],[99,84],[95,85],[98,86],[108,69],[90,87],[91,88],[100,89],[80,90],[103,81],[102,79],[106,1],[109,91],[68,92],[69,92],[70,93],[71,94]],"version":"5.7.3"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@operato/mini-map",
3
3
  "description": "Webcomponent mini-map following open-wc recommendations",
4
4
  "author": "heartyoh",
5
- "version": "7.1.1",
5
+ "version": "7.1.32",
6
6
  "main": "dist/src/index.js",
7
7
  "module": "dist/src/index.js",
8
8
  "license": "MIT",
@@ -80,5 +80,5 @@
80
80
  "prettier --write"
81
81
  ]
82
82
  },
83
- "gitHead": "ae4071a0210106d56dd9b2499400e44b79d93940"
83
+ "gitHead": "c4f5ed0b63d49d02c5a155b592c0ecf681c92cf7"
84
84
  }
package/.editorconfig DELETED
@@ -1,29 +0,0 @@
1
- # EditorConfig helps developers define and maintain consistent
2
- # coding styles between different editors and IDEs
3
- # editorconfig.org
4
-
5
- root = true
6
-
7
-
8
- [*]
9
-
10
- # Change these settings to your own preference
11
- indent_style = space
12
- indent_size = 2
13
-
14
- # We recommend you to keep these unchanged
15
- end_of_line = lf
16
- charset = utf-8
17
- trim_trailing_whitespace = true
18
- insert_final_newline = true
19
-
20
- [*.md]
21
- trim_trailing_whitespace = false
22
-
23
- [*.json]
24
- indent_size = 2
25
-
26
- [*.{html,js,md}]
27
- block_comment_start = /**
28
- block_comment = *
29
- block_comment_end = */
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- stories: ['../dist/stories/**/*.stories.{js,md,mdx}'],
3
- };
@@ -1,8 +0,0 @@
1
- import { storybookPlugin } from '@web/dev-server-storybook';
2
- import baseConfig from '../web-dev-server.config.mjs';
3
-
4
- export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
5
- ...baseConfig,
6
- open: '/',
7
- plugins: [storybookPlugin({ type: 'web-components' }), ...baseConfig.plugins],
8
- });
package/demo/index.html DELETED
@@ -1,35 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en-GB">
3
- <head>
4
- <meta charset="utf-8" />
5
- <style>
6
- body {
7
- display: flex;
8
- width: 100vw;
9
- height: 100dvh;
10
- margin: 0;
11
- padding: 0;
12
- }
13
-
14
- #demo {
15
- flex: 1;
16
- background-color: red;
17
- }
18
- </style>
19
- </head>
20
- <body>
21
- <div id="demo"></div>
22
-
23
- <script type="module">
24
- import { minimap } from '../dist/src/mini-map.js'
25
-
26
- pulltorefresh({
27
- container: document.body,
28
- scrollable: document.querySelector('#demo'),
29
- refresh: () => {
30
- console.log('refreshed...')
31
- }
32
- })
33
- </script>
34
- </body>
35
- </html>
@@ -1,214 +0,0 @@
1
- import { html, css, LitElement, PropertyValueMap } from 'lit'
2
- import { customElement, property } from 'lit/decorators.js'
3
-
4
- @customElement('ox-mini-map')
5
- class OxMiniMapComponent extends LitElement {
6
- static styles = css`
7
- :host {
8
- display: flex;
9
- position: relative;
10
- background-color: gray;
11
- width: 200px; /* 기본 너비 */
12
- height: 150px; /* 기본 높이 */
13
- }
14
-
15
- #minimap {
16
- position: absolute;
17
- top: 50%;
18
- left: 50%;
19
- transform: translate(-50%, -50%);
20
- box-sizing: border-box;
21
- width: 100%;
22
- height: 100%;
23
- background-color: var(--md-sys-color-surface);
24
- overflow: hidden;
25
- }
26
-
27
- #viewport {
28
- position: absolute;
29
- border: 1px dashed blue;
30
- box-sizing: border-box;
31
- cursor: move;
32
- background-color: rgba(255, 255, 255, 0.5);
33
- }
34
- `
35
-
36
- @property({ type: Object }) target: HTMLElement | null = null
37
- private isDragging = false
38
- private startX = 0
39
- private startY = 0
40
- private initialScrollLeft = 0
41
- private initialScrollTop = 0
42
- private observer: MutationObserver | null = null
43
-
44
- connectedCallback() {
45
- super.connectedCallback()
46
- window.addEventListener('resize', this.handleResize.bind(this))
47
- this.addEventListener('mousemove', this.handleMouseMove.bind(this))
48
- this.addEventListener('mouseup', this.handleMouseUp.bind(this))
49
- if (this.target) {
50
- this.observeTarget(this.target)
51
- }
52
- }
53
-
54
- disconnectedCallback() {
55
- super.disconnectedCallback()
56
- window.removeEventListener('resize', this.handleResize.bind(this))
57
- window.removeEventListener('mousemove', this.handleMouseMove.bind(this))
58
- window.removeEventListener('mouseup', this.handleMouseUp.bind(this))
59
- if (this.observer) {
60
- this.observer.disconnect()
61
- this.observer = null
62
- }
63
- }
64
-
65
- firstUpdated(changes: PropertyValueMap<any> | Map<PropertyKey, unknown>) {
66
- super.firstUpdated(changes)
67
- this.updateTarget()
68
- }
69
-
70
- updated(changedProperties: Map<string, any>) {
71
- if (changedProperties.has('target')) {
72
- this.updateTarget()
73
- if (this.target) {
74
- this.observeTarget(this.target)
75
- }
76
- }
77
- }
78
-
79
- handleResize() {
80
- this.updateTarget()
81
- }
82
-
83
- observeTarget(target: HTMLElement) {
84
- if (this.observer) {
85
- this.observer.disconnect()
86
- }
87
- this.observer = new MutationObserver(() => {
88
- this.updateTarget()
89
- })
90
- this.observer.observe(target, { attributes: true, attributeFilter: ['style'] })
91
- }
92
-
93
- updateTarget() {
94
- const target = this.target || this.parentElement
95
- if (!target) {
96
- return
97
- }
98
-
99
- const targetStyle = window.getComputedStyle(target)
100
- const transform = targetStyle.transform
101
- const scaleMatch = /scale\(([^,]+),?([^)]+)?\)/.exec(transform)
102
- const leftMatch = /translate\(([^,]+)px, ?([^)]+)?px\)/.exec(transform)
103
-
104
- let scale = 1
105
- let left = 0
106
- let top = 0
107
-
108
- if (scaleMatch) {
109
- scale = parseFloat(scaleMatch[1])
110
- }
111
-
112
- if (leftMatch) {
113
- left = parseFloat(leftMatch[1])
114
- top = parseFloat(leftMatch[2] || '0')
115
- }
116
-
117
- const targetRatio = target.scrollHeight / target.scrollWidth
118
- const thisRatio = this.offsetHeight / this.offsetWidth
119
-
120
- const scaleMinimap =
121
- targetRatio > thisRatio ? this.offsetHeight / target.scrollHeight : this.offsetWidth / target.scrollWidth
122
-
123
- const minimapHeight = target.scrollHeight * scaleMinimap
124
- const minimapWidth = target.scrollWidth * scaleMinimap
125
-
126
- const viewportHeight = target.clientHeight * scaleMinimap
127
- const viewportWidth = target.clientWidth * scaleMinimap
128
-
129
- const minimap = this.shadowRoot?.getElementById('minimap') as HTMLElement
130
- const viewport = this.shadowRoot?.getElementById('viewport') as HTMLElement
131
-
132
- minimap.style.width = `${minimapWidth}px`
133
- minimap.style.height = `${minimapHeight}px`
134
-
135
- viewport.style.width = `${viewportWidth}px`
136
- viewport.style.height = `${viewportHeight}px`
137
-
138
- this.updateViewportPosition(scale, left, top)
139
- }
140
-
141
- updateViewportPosition(scale: number, left: number, top: number) {
142
- const target = this.target || this.parentElement
143
- if (!target) {
144
- return
145
- }
146
-
147
- const targetRatio = target.scrollHeight / target.scrollWidth
148
- const thisRatio = this.offsetHeight / this.offsetWidth
149
-
150
- const scaleMinimap =
151
- targetRatio > thisRatio ? this.offsetHeight / target.scrollHeight : this.offsetWidth / target.scrollWidth
152
-
153
- const viewport = this.shadowRoot?.getElementById('viewport') as HTMLElement
154
- viewport.style.transform = `scale(${scale}) translate(${left * scaleMinimap}px, ${top * scaleMinimap}px)`
155
- }
156
-
157
- handleMouseDown(event: MouseEvent) {
158
- this.isDragging = true
159
- this.startX = event.clientX
160
- this.startY = event.clientY
161
-
162
- const target = this.target || this.parentElement
163
- if (target) {
164
- this.initialScrollLeft = target.scrollLeft
165
- this.initialScrollTop = target.scrollTop
166
- }
167
-
168
- window.addEventListener('mousemove', this.handleMouseMove.bind(this))
169
- window.addEventListener('mouseup', this.handleMouseUp.bind(this))
170
-
171
- event.preventDefault()
172
- }
173
-
174
- handleMouseMove(event: MouseEvent) {
175
- if (!this.isDragging) return
176
-
177
- const deltaX = event.clientX - this.startX
178
- const deltaY = event.clientY - this.startY
179
-
180
- const target = this.target || this.parentElement
181
- if (!target) return
182
-
183
- const targetRatio = target.scrollHeight / target.scrollWidth
184
- const thisRatio = this.offsetHeight / this.offsetWidth
185
-
186
- const scale =
187
- targetRatio > thisRatio ? this.offsetHeight / target.scrollHeight : this.offsetWidth / target.scrollWidth
188
-
189
- const scrollX = deltaX / scale
190
- const scrollY = deltaY / scale
191
-
192
- target.scrollLeft = this.initialScrollLeft + scrollX
193
- target.scrollTop = this.initialScrollTop + scrollY
194
-
195
- this.updateViewportPosition(1, target.scrollLeft, target.scrollTop) // Assuming no additional transform during drag
196
-
197
- event.preventDefault()
198
- }
199
-
200
- handleMouseUp(event: MouseEvent) {
201
- this.isDragging = false
202
- window.removeEventListener('mousemove', this.handleMouseMove.bind(this))
203
- window.removeEventListener('mouseup', this.handleMouseUp.bind(this))
204
- event.preventDefault()
205
- }
206
-
207
- render() {
208
- return html`
209
- <div id="minimap">
210
- <div id="viewport" @mousedown=${this.handleMouseDown}></div>
211
- </div>
212
- `
213
- }
214
- }
@@ -1,256 +0,0 @@
1
- import { css, LitElement, PropertyValues } from 'lit'
2
- import { customElement, property, state } from 'lit/decorators.js'
3
-
4
- // Utility function to get the point from MouseEvent or TouchEvent
5
- function getPoint(e: MouseEvent | TouchEvent): { x: number; y: number } | undefined {
6
- if (e instanceof MouseEvent && e.button === 0) {
7
- return { x: e.clientX, y: e.clientY }
8
- } else if (e instanceof TouchEvent && e.touches.length === 1) {
9
- const touch = e.touches[0]
10
- return { x: touch.clientX, y: touch.clientY }
11
- }
12
- return undefined
13
- }
14
-
15
- /**
16
- * Example usage:
17
- *
18
- * <html>
19
- * <head>
20
- * <script type="module" src="path/to/ox-zoomable-image.js"></script>
21
- * <style>
22
- * body {
23
- * margin: 0;
24
- * overflow: hidden;
25
- * display: flex;
26
- * justify-content: center;
27
- * align-items: center;
28
- * height: 100vh;
29
- * }
30
- * ox-zoomable-image {
31
- * width: 80%;
32
- * height: 80%;
33
- * }
34
- * </style>
35
- * </head>
36
- * <body>
37
- * <ox-zoomable-image src="path/to/your/image.jpg"></ox-zoomable-image>
38
- * </body>
39
- * </html>
40
- */
41
-
42
- @customElement('ox-zoomable-image')
43
- export class OxZoomableImage extends LitElement {
44
- // Define CSS styles for the component
45
- static styles = css`
46
- :host {
47
- display: block;
48
- position: relative;
49
- width: 100%;
50
- height: 100%;
51
- overflow: hidden;
52
- }
53
-
54
- :host::before {
55
- content: '';
56
- display: block;
57
- position: absolute;
58
- top: 0;
59
- right: 0;
60
- width: 100%;
61
- height: 100%;
62
- background-image: var(
63
- --background-image,
64
- linear-gradient(var(--primary-color, lightgray), var(--primary-color, lightgray))
65
- );
66
- transform: var(--image-transform, '');
67
- background-repeat: no-repeat;
68
- background-position: center;
69
- background-size: contain;
70
- }
71
- `
72
-
73
- @property({ type: String }) src?: string // Source URL for the image
74
- @state() private zoom = 1 // Current zoom level
75
- @state() private left = 0 // Horizontal position
76
- @state() private top = 0 // Vertical position
77
- @state() private minZoom = 1 // Minimum zoom level
78
- @state() private imageWidth = 0
79
- @state() private imageHeight = 0
80
-
81
- private dragStart?: { x: number; y: number } // Starting point of drag
82
-
83
- // Event listeners bound to the component
84
- private readonly dragEndHandler = this.onDragEnd.bind(this) as EventListener
85
- private readonly dragMoveHandler = this.onDragMove.bind(this) as EventListener
86
- private readonly dragStartHandler = this.onDragStart.bind(this) as EventListener
87
- private readonly wheelEventHandler = this.onWheelEvent.bind(this) as EventListener
88
- private readonly resetHandler = this.onReset.bind(this) as EventListener
89
-
90
- connectedCallback(): void {
91
- super.connectedCallback()
92
-
93
- // Register event listeners for zooming and dragging
94
- this.addEventListener('wheel', this.wheelEventHandler)
95
- this.addEventListener('mousedown', this.dragStartHandler)
96
- this.addEventListener('touchstart', this.dragStartHandler)
97
- this.addEventListener('dblclick', this.resetHandler)
98
-
99
- document.addEventListener('mouseup', this.dragEndHandler)
100
- document.addEventListener('touchend', this.dragEndHandler)
101
- document.addEventListener('touchcancel', this.dragEndHandler)
102
- document.addEventListener('mousemove', this.dragMoveHandler)
103
- document.addEventListener('touchmove', this.dragMoveHandler)
104
-
105
- this.calculateMinZoom() // Calculate the minimum zoom level based on the image and container size
106
- }
107
-
108
- disconnectedCallback(): void {
109
- // Remove event listeners when the component is disconnected
110
- this.removeEventListener('wheel', this.wheelEventHandler)
111
- this.removeEventListener('mousedown', this.dragStartHandler)
112
- this.removeEventListener('touchstart', this.dragStartHandler)
113
- this.removeEventListener('dblclick', this.resetHandler)
114
-
115
- document.removeEventListener('mouseup', this.dragEndHandler)
116
- document.removeEventListener('touchend', this.dragEndHandler)
117
- document.removeEventListener('touchcancel', this.dragEndHandler)
118
- document.removeEventListener('mousemove', this.dragMoveHandler)
119
- document.removeEventListener('touchmove', this.dragMoveHandler)
120
-
121
- super.disconnectedCallback()
122
- }
123
-
124
- updated(changes: PropertyValues<this>): void {
125
- // Update the background image and transform style when properties change
126
- if (changes.has('src') && this.src) {
127
- this.style.setProperty('--background-image', `url('${this.src}')`)
128
- this.calculateMinZoom() // Recalculate the minimum zoom level when the source changes
129
- }
130
- this.updateTransform() // Apply the current zoom and position
131
- }
132
-
133
- private calculateMinZoom() {
134
- // Calculate the minimum zoom level to ensure the image always fills the container
135
- const img = new Image()
136
- img.src = this.src || ''
137
- img.onload = () => {
138
- this.imageWidth = img.width
139
- this.imageHeight = img.height
140
-
141
- const aspectRatio = img.width / img.height
142
- const hostAspectRatio = this.offsetWidth / this.offsetHeight
143
- if (aspectRatio < hostAspectRatio) {
144
- this.minZoom = this.offsetHeight / img.height
145
- } else {
146
- this.minZoom = this.offsetWidth / img.width
147
- }
148
- this.zoom = 1 // this.minZoom
149
- this.left = 0 // Center the image
150
- this.top = 0 // Center the image
151
- this.updateTransform()
152
- }
153
- }
154
-
155
- private onWheelEvent(e: WheelEvent): void {
156
- // Handle zoom in and out based on mouse wheel events
157
- e.preventDefault()
158
- const delta = Math.sign(e.deltaY)
159
- const newZoom = Math.max(1, this.zoom * (1 - delta / 20))
160
- const zoomFactor = newZoom / this.zoom
161
-
162
- const rect = this.getBoundingClientRect()
163
- const offsetX = e.clientX - rect.left - rect.width / 2
164
- const offsetY = e.clientY - rect.top - rect.height / 2
165
-
166
- // Adjust the position to zoom in/out relative to the center of the client rect
167
- this.left -= offsetX * (zoomFactor - 1)
168
- this.top -= offsetY * (zoomFactor - 1)
169
-
170
- this.zoom = newZoom
171
- this.applyBounds() // Ensure the image stays within bounds
172
- this.updateTransform() // Apply the new zoom and position
173
- }
174
-
175
- private onDragStart(e: MouseEvent | TouchEvent): void {
176
- // Start dragging the image
177
- const point = getPoint(e)
178
- if (point) {
179
- this.dragStart = point
180
- e.stopPropagation()
181
- }
182
- }
183
-
184
- private onDragMove(e: MouseEvent | TouchEvent): void {
185
- // Move the image based on drag events
186
- if (!this.dragStart) return
187
-
188
- const point = getPoint(e)
189
- if (!point) return
190
-
191
- e.stopPropagation()
192
- e.preventDefault()
193
-
194
- const { x, y } = point
195
- this.left += x - this.dragStart.x
196
- this.top += y - this.dragStart.y
197
-
198
- this.dragStart = point
199
- this.applyBounds() // Ensure the image stays within bounds
200
- this.updateTransform() // Apply the new position
201
- }
202
-
203
- private onDragEnd(e: Event): void {
204
- // End the drag operation
205
- if (this.dragStart) {
206
- e.stopPropagation()
207
- e.preventDefault()
208
- this.dragStart = undefined
209
- }
210
- }
211
-
212
- private onReset(e: Event): void {
213
- // Reset zoom and position to initial state
214
- this.zoom = 1
215
- this.left = 0
216
- this.top = 0
217
- this.updateTransform()
218
- }
219
-
220
- private updateTransform() {
221
- // Apply the current zoom and position to the image
222
- this.style.setProperty('--image-transform', `scale(${this.zoom}) translate(${this.left}px, ${this.top}px)`)
223
- }
224
-
225
- private applyBounds() {
226
- // Ensure the image stays within the bounds of the container
227
- const hostWidth = this.offsetWidth
228
- const hostHeight = this.offsetHeight
229
-
230
- const aspectRatio = this.imageHeight / this.imageWidth
231
- const hostAspectRatio = hostHeight / hostWidth
232
-
233
- if (aspectRatio < hostAspectRatio) {
234
- /* image ratio is wider than host */
235
- var minX = Math.min(0, (-hostWidth * (this.zoom - 1)) / 2 / this.zoom)
236
- var maxX = -minX
237
-
238
- var minY = (hostHeight - hostWidth * aspectRatio * this.zoom) / 2 / this.zoom
239
- minY = Math.min(minY, -minY)
240
- var maxY = -minY
241
-
242
- this.left = Math.max(minX, Math.min(this.left, maxX))
243
- this.top = Math.max(minY, Math.min(this.top, maxY))
244
- } else {
245
- var minX = (hostWidth - (hostHeight / aspectRatio) * this.zoom) / 2 / this.zoom
246
- minX = Math.min(minX, -minX)
247
- var maxX = -minX
248
-
249
- var minY = Math.min(0, (-hostHeight * (this.zoom - 1)) / 2 / this.zoom)
250
- var maxY = -minY
251
-
252
- this.left = Math.max(minX, Math.min(this.left, maxX))
253
- this.top = Math.max(minY, Math.min(this.top, maxY))
254
- }
255
- }
256
- }
@@ -1,54 +0,0 @@
1
- import { html, TemplateResult } from 'lit'
2
- import '../src/ox-mini-map.js'
3
-
4
- export default {
5
- title: 'MiniMap',
6
- component: 'ox-mini-map',
7
- argTypes: {}
8
- }
9
-
10
- interface Story<T> {
11
- (args: T): TemplateResult
12
- args?: Partial<T>
13
- argTypes?: Record<string, unknown>
14
- }
15
-
16
- interface ArgTypes {}
17
-
18
- const Template: Story<ArgTypes> = ({}: ArgTypes) => html`
19
- <style>
20
- #parent {
21
- padding: 0;
22
- margin: 0;
23
- width: 600px;
24
- height: 400px;
25
- background-color: red;
26
- position: relative; /* Make the parent element the reference for the mini map */
27
- overflow: auto;
28
- }
29
-
30
- #content {
31
- flex: 1;
32
- width: 1200px;
33
- height: 1000px;
34
- background-image: url('https://via.placeholder.com/800x600.png'); /* Fix the background image URL */
35
- background-size: cover;
36
- }
37
-
38
- ox-mini-map {
39
- position: fixed; /* Fix to the bottom right of the parent element */
40
- width: 160px;
41
- height: 120px;
42
- bottom: 10px;
43
- right: 10px;
44
- }
45
- </style>
46
-
47
- <div id="parent">
48
- <div id="content"></div>
49
- <ox-mini-map .target=${document.getElementById('parent')}></ox-mini-map>
50
- </div>
51
- `
52
-
53
- export const Regular = Template.bind({})
54
- Regular.args = {}
@@ -1,58 +0,0 @@
1
- import { html, TemplateResult } from 'lit-html'
2
- import '../src/ox-zoomable-image' // 경로를 실제 경로로 변경하세요.
3
-
4
- export default {
5
- title: 'OxZoomableImage',
6
- component: 'ox-zoomable-image',
7
- argTypes: {
8
- src: { control: 'text' },
9
- width: { control: 'number' },
10
- height: { control: 'number' }
11
- }
12
- }
13
-
14
- interface Story<T> {
15
- (args: T): TemplateResult
16
- args?: Partial<T>
17
- argTypes?: Record<string, unknown>
18
- }
19
-
20
- interface OxZoomableImageProps {
21
- src: string
22
- width: number
23
- height: number
24
- }
25
-
26
- const Template: Story<OxZoomableImageProps> = ({ src, width, height }: OxZoomableImageProps) => html`
27
- <style>
28
- ox-zoomable-image {
29
- width: ${width}px;
30
- height: ${height}px;
31
- background-color: red;
32
- padding: 0;
33
- margin: 100px;
34
- }
35
- </style>
36
- <ox-zoomable-image src=${src}></ox-zoomable-image>
37
- `
38
-
39
- export const Default = Template.bind({})
40
- Default.args = {
41
- src: 'https://via.placeholder.com/800x600.png', // 기본 이미지 URL을 실제 경로로 변경하세요.
42
- width: 400,
43
- height: 600
44
- }
45
-
46
- export const Wide = Template.bind({})
47
- Wide.args = {
48
- src: 'https://via.placeholder.com/800x600.png', // 기본 이미지 URL을 실제 경로로 변경하세요.
49
- width: 600,
50
- height: 300
51
- }
52
-
53
- export const CustomImage = Template.bind({})
54
- CustomImage.args = {
55
- src: 'https://via.placeholder.com/1200x800.png', // 다른 테스트 이미지 URL을 실제 경로로 변경하세요.
56
- width: 400,
57
- height: 600
58
- }
package/tsconfig.json DELETED
@@ -1,24 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2018",
4
- "module": "esnext",
5
- "moduleResolution": "node",
6
- "noEmitOnError": true,
7
- "lib": ["es2017", "dom"],
8
- "strict": true,
9
- "esModuleInterop": true,
10
- "allowSyntheticDefaultImports": true,
11
- "experimentalDecorators": true,
12
- "useDefineForClassFields": false,
13
- "importHelpers": true,
14
- "outDir": "dist",
15
- "sourceMap": true,
16
- "inlineSources": true,
17
- "rootDir": "./",
18
- "declaration": true,
19
- "incremental": true,
20
- "skipLibCheck": true,
21
- "types": ["node", "mocha"]
22
- },
23
- "include": ["**/*.ts", "*.d.ts"]
24
- }
@@ -1,27 +0,0 @@
1
- // import { hmrPlugin, presets } from '@open-wc/dev-server-hmr';
2
-
3
- /** Use Hot Module replacement by adding --hmr to the start command */
4
- const hmr = process.argv.includes('--hmr');
5
-
6
- export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
7
- open: '/demo/',
8
- /** Use regular watch mode if HMR is not enabled. */
9
- watch: !hmr,
10
- /** Resolve bare module imports */
11
- nodeResolve: {
12
- exportConditions: ['browser', 'development'],
13
- },
14
-
15
- /** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
16
- // esbuildTarget: 'auto'
17
-
18
- /** Set appIndex to enable SPA routing */
19
- // appIndex: 'demo/index.html',
20
-
21
- plugins: [
22
- /** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
23
- // hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
24
- ],
25
-
26
- // See documentation for all available options
27
- });
@@ -1,41 +0,0 @@
1
- // import { playwrightLauncher } from '@web/test-runner-playwright';
2
-
3
- const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
4
-
5
- export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
6
- /** Test files to run */
7
- files: 'dist/test/**/*.test.js',
8
-
9
- /** Resolve bare module imports */
10
- nodeResolve: {
11
- exportConditions: ['browser', 'development'],
12
- },
13
-
14
- /** Filter out lit dev mode logs */
15
- filterBrowserLogs(log) {
16
- for (const arg of log.args) {
17
- if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
18
- return false;
19
- }
20
- }
21
- return true;
22
- },
23
-
24
- /** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
25
- // esbuildTarget: 'auto',
26
-
27
- /** Amount of browsers to run concurrently */
28
- // concurrentBrowsers: 2,
29
-
30
- /** Amount of test files per browser to test concurrently */
31
- // concurrency: 1,
32
-
33
- /** Browsers to run tests on */
34
- // browsers: [
35
- // playwrightLauncher({ product: 'chromium' }),
36
- // playwrightLauncher({ product: 'firefox' }),
37
- // playwrightLauncher({ product: 'webkit' }),
38
- // ],
39
-
40
- // See documentation for all available options
41
- });