@sketch-hq/sketch-web-renderer 3.1.7 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/index.js +1 -1
  3. package/dist/module-debug.wasm +0 -0
  4. package/dist/module-release.wasm +0 -0
  5. package/dist/static/js/{web-renderer-a0852e681d80b27f4541.chunk.js → web-renderer-e4d5f4f314c42815f663.chunk.js} +0 -0
  6. package/dist/ts/react/SketchWebReact.d.ts +21 -6
  7. package/dist/ts/react/SketchWebReact.d.ts.map +1 -1
  8. package/dist/ts/react/contexts.d.ts +1 -1
  9. package/dist/ts/react/hooks/state.d.ts +1 -1
  10. package/dist/ts/react/index.d.ts +0 -1
  11. package/dist/ts/react/index.d.ts.map +1 -1
  12. package/package.json +3 -4
  13. package/dist/ts/react/CSSResets.d.ts +0 -5
  14. package/dist/ts/react/CSSResets.d.ts.map +0 -1
  15. package/dist/ts/react/ShadowRoot.d.ts +0 -16
  16. package/dist/ts/react/ShadowRoot.d.ts.map +0 -1
  17. package/dist/ts/react/overlays/ArtboardsInfoOverlay/ArrowIcon.svg.d.ts +0 -2
  18. package/dist/ts/react/overlays/ArtboardsInfoOverlay/ArrowIcon.svg.d.ts.map +0 -1
  19. package/dist/ts/react/overlays/ArtboardsInfoOverlay/Artboard.d.ts +0 -26
  20. package/dist/ts/react/overlays/ArtboardsInfoOverlay/Artboard.d.ts.map +0 -1
  21. package/dist/ts/react/overlays/ArtboardsInfoOverlay/ArtboardsInfoOverlay.d.ts +0 -14
  22. package/dist/ts/react/overlays/ArtboardsInfoOverlay/ArtboardsInfoOverlay.d.ts.map +0 -1
  23. package/dist/ts/react/overlays/ArtboardsInfoOverlay/ArtboardsInfoOverlay.styled.d.ts +0 -22
  24. package/dist/ts/react/overlays/ArtboardsInfoOverlay/ArtboardsInfoOverlay.styled.d.ts.map +0 -1
  25. package/dist/ts/react/overlays/ArtboardsInfoOverlay/index.d.ts +0 -2
  26. package/dist/ts/react/overlays/ArtboardsInfoOverlay/index.d.ts.map +0 -1
  27. package/dist/ts/react/overlays/Overlay/Document.d.ts +0 -12
  28. package/dist/ts/react/overlays/Overlay/Document.d.ts.map +0 -1
  29. package/dist/ts/react/overlays/Overlay/Overlay.d.ts +0 -12
  30. package/dist/ts/react/overlays/Overlay/Overlay.d.ts.map +0 -1
  31. package/dist/ts/react/overlays/Overlay/Overlay.styled.d.ts +0 -3
  32. package/dist/ts/react/overlays/Overlay/Overlay.styled.d.ts.map +0 -1
  33. package/dist/ts/react/overlays/Overlay/index.d.ts +0 -2
  34. package/dist/ts/react/overlays/Overlay/index.d.ts.map +0 -1
  35. package/dist/ts/react/overlays/index.d.ts +0 -3
  36. package/dist/ts/react/overlays/index.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @sketch-hq/sketch-web-renderer
2
2
 
3
+ ## 3.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e2b9ef78: Remove the shadow root and overlays from Web-renderer
8
+
9
+ ## 3.1.8
10
+
11
+ ### Patch Changes
12
+
13
+ - 4a0550a1: Use linear interpolation for tiled images
14
+ - 1339274a: Alpha masks are now always in high resolution
15
+ - 1b49e7eb: Correctly render masked background blurs
16
+ - 78b0da7c: Correctly draw background blurs
17
+ - 66cf29e2: Correctly render background blur applied to transparent layers
18
+
3
19
  ## 3.1.7
4
20
 
5
21
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"),require("react-dom"),require("styled-components"));else if("function"==typeof define&&define.amd)define(["react","react-dom","styled-components"],t);else{var n="object"==typeof exports?t(require("react"),require("react-dom"),require("styled-components")):t(e.react,e["react-dom"],e["styled-components"]);for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(self,(function(e,t,n){return(()=>{var o,r,i,a,s={975:(e,t,n)=>{"use strict";function o(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((o=o.apply(e,t||[])).next())}))}n.d(t,{M:()=>f});const r=["geforce 320m","geforce 8600","geforce 8600m gt","geforce 8800 gs","geforce 8800 gt","geforce 9400","geforce 9400m g","geforce 9400m","geforce 9600m gt","geforce 9600m","geforce fx go5200","geforce gt 120","geforce gt 130","geforce gt 330m","geforce gtx 285","google swiftshader","intel g41","intel g45","intel gma 4500mhd","intel gma x3100","intel hd 3000","intel q45","legacy","mali-2","mali-3","mali-4","quadro fx 1500","quadro fx 4","quadro fx 5","radeon hd 2400","radeon hd 2600","radeon hd 4670","radeon hd 4850","radeon hd 4870","radeon hd 5670","radeon hd 5750","radeon hd 6290","radeon hd 6300","radeon hd 6310","radeon hd 6320","radeon hd 6490m","radeon hd 6630m","radeon hd 6750m","radeon hd 6770m","radeon hd 6970m","sgx 543","sgx543"];function i(e){return e.toLowerCase().replace(/^angle ?\((.+)\)*$/,"$1").replace(/\s(\d{1,2}gb|direct3d.+$)|\(r\)| \([^)]+\)$/g,"")}const a="undefined"==typeof window,s=(()=>{if(a)return;const{userAgent:e,platform:t,maxTouchPoints:n}=window.navigator,o=/(iphone|ipod|ipad)/i.test(e),r="iPad"===t||"MacIntel"===t&&n>0&&!window.MSStream;return{isIpad:r,isMobile:/android/i.test(e)||o||r,isSafari12:/Version\/12.+Safari/.test(e)}})(),u=[],c=[];function l(e,t){if(e===t)return 0;const n=e;e.length>t.length&&(e=t,t=n);let o=e.length,r=t.length;for(;o>0&&e.charCodeAt(~-o)===t.charCodeAt(~-r);)o--,r--;let i,a=0;for(;a<o&&e.charCodeAt(a)===t.charCodeAt(a);)a++;if(o-=a,r-=a,0===o)return r;let s,l,d=0,h=0,f=0;for(;h<o;)c[h]=e.charCodeAt(a+h),u[h]=++h;for(;f<r;)for(i=t.charCodeAt(a+f),s=f++,d=f,h=0;h<o;h++)l=i===c[h]?s:s+1,s=u[h],d=u[h]=s>d?l>d?d+1:l:l>s?s+1:l;return d}function d(e){return null!=e}class h extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}const f=({mobileTiers:e=[0,15,30,60],desktopTiers:t=[0,15,30,60],override:n={},glContext:u,failIfMajorPerformanceCaveat:c=!1,benchmarksURL:f="https://unpkg.com/detect-gpu@4.0.37/dist/benchmarks"}={})=>o(void 0,void 0,void 0,(function*(){const v={};if(a)return{tier:0,type:"SSR"};const{isIpad:p=!!(null==s?void 0:s.isIpad),isMobile:m=!!(null==s?void 0:s.isMobile),screenSize:g=window.screen,loadBenchmarks:b=(e=>o(void 0,void 0,void 0,(function*(){const t=yield fetch(`${f}/${e}`).then((e=>e.json()));if(parseInt(t.shift().split(".")[0],10)<4)throw new h("Detect GPU benchmark data is out of date. Please update to version 4x");return t})))}=n;let{renderer:y}=n;const w=(e,t,n,o,r)=>({device:r,fps:o,gpu:n,isMobile:m,tier:e,type:t});let C,k="";if(y)y=i(y),C=[y];else{const e=u||function(e,t=!1){const n={alpha:!1,antialias:!1,depth:!1,failIfMajorPerformanceCaveat:t,powerPreference:"high-performance",stencil:!1};e&&delete n.powerPreference;const o=window.document.createElement("canvas"),r=o.getContext("webgl",n)||o.getContext("experimental-webgl",n);return null!=r?r:void 0}(null==s?void 0:s.isSafari12,c);if(!e)return w(0,"WEBGL_UNSUPPORTED");const t=e.getExtension("WEBGL_debug_renderer_info");if(t&&(y=e.getParameter(t.UNMASKED_RENDERER_WEBGL)),!y)return w(1,"FALLBACK");k=y,y=i(y),C=function(e,t,n){return"apple gpu"===t?function(e,t,n){if(!n)return[t];const o=function(e){const t=e.createShader(35633),n=e.createShader(35632),o=e.createProgram();if(!(n&&t&&o))return;e.shaderSource(t,"\n precision highp float;\n attribute vec3 aPosition;\n varying float vvv;\n void main() {\n vvv = 0.31622776601683794;\n gl_Position = vec4(aPosition, 1.0);\n }\n "),e.shaderSource(n,"\n precision highp float;\n varying float vvv;\n void main() {\n vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * vvv;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n gl_FragColor = enc;\n }\n "),e.compileShader(t),e.compileShader(n),e.attachShader(o,t),e.attachShader(o,n),e.linkProgram(o),e.detachShader(o,t),e.detachShader(o,n),e.deleteShader(t),e.deleteShader(n),e.useProgram(o);const r=e.createBuffer();e.bindBuffer(34962,r),e.bufferData(34962,new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),35044);const i=e.getAttribLocation(o,"aPosition");e.vertexAttribPointer(i,3,5126,!1,0,0),e.enableVertexAttribArray(i),e.clearColor(1,1,1,1),e.clear(16384),e.viewport(0,0,1,1),e.drawArrays(4,0,3);const a=new Uint8Array(4);return e.readPixels(0,0,1,1,6408,5121,a),e.deleteProgram(o),e.deleteBuffer(r),a.join("")}(e),r="801621810",i="8016218135",a="80162181161",u=(null==s?void 0:s.isIpad)?[["a7",a,12],["a8",i,15],["a8x",i,15],["a9",i,15],["a9x",i,15],["a10",i,15],["a10x",i,15],["a12",r,15],["a12x",r,15],["a12z",r,15],["a14",r,15],["m1",r,15]]:[["a7",a,12],["a8",i,12],["a9",i,15],["a10",i,15],["a11",r,15],["a12",r,15],["a13",r,15],["a14",r,15]];let c;return"80162181255"===o?c=u.filter((([,,e])=>e>=14)):(c=u.filter((([,e])=>e===o)),c.length||(c=u)),c.map((([e])=>`apple ${e} gpu`))}(e,t,n):[t]}(e,y,m)}const P=(yield Promise.all(C.map((function(e){var t;return o(this,void 0,void 0,(function*(){const n=(e=>{const t=m?["adreno","apple","mali-t","mali","nvidia","powervr"]:["intel","apple","amd","radeon","nvidia","geforce"];for(const n of t)if(e.includes(n))return n})(e);if(!n)return;const o=`${m?"m":"d"}-${n}${p?"-ipad":""}.json`,r=v[o]=null!==(t=v[o])&&void 0!==t?t:b(o);let i;try{i=yield r}catch(n){if(n instanceof h)throw n;return}const a=function(e){var t;const n=(e=e.replace(/\([^)]+\)/,"")).match(/\d+/)||e.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);return null!==(t=null==n?void 0:n.join("").replace(/\W|amd/g,""))&&void 0!==t?t:""}(e);let s=i.filter((([,e])=>e===a));s.length||(s=i.filter((([t])=>t.includes(e))));const u=s.length;if(0===u)return;let c,[d,,,f]=u>1?s.map((t=>[t,l(e,t[0])])).sort((([,e],[,t])=>e-t))[0][0]:s[0],y=Number.MAX_VALUE;const{devicePixelRatio:w}=window,C=g.width*w*g.height*w;for(const e of f){const[t,n]=e,o=t*n,r=Math.abs(C-o);r<y&&(y=r,c=e)}if(!c)return;const[,,k,P]=c;return[y,k,d,P]}))})))).filter(d).sort((([e=Number.MAX_VALUE,t],[n=Number.MAX_VALUE,o])=>e===n?t-o:e-n));if(!P.length){const e=r.find((e=>y.includes(e)));return e?w(0,"BLOCKLISTED",e):w(1,"FALLBACK",`${y} (${k})`)}const[,E,x,S]=P[0];if(-1===E)return w(0,"BLOCKLISTED",x,E,S);const M=m?e:t;let W=0;for(let e=0;e<M.length;e++)E>=M[e]&&(W=e);return w(W,"BENCHMARK",x,E,S)}))},519:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o={delayedDraw:!0,useNewTiledRenderer:!0,offscreenCanvas:!1,safariWebGL2:!1,pageBoundariesLimit:!1}},946:(e,t,n)=>{"use strict";n.d(t,{d:()=>B});var o,r=n(354),i=function(){function e(){this.removeListenerCallbacks=[]}return e.prototype.add=function(e,t,n,o){e.addEventListener(t,n,o);var r=function(){e.removeEventListener(t,n,o)};return this.removeListenerCallbacks.push(r),r},e.prototype.dispose=function(){this.removeListenerCallbacks.forEach((function(e){return e()}))},e}(),a=n(388),s=function(){function e(e,t){var n=this;this.cameraMoveState={status:"inactive"},this.endInteractionDebounced=(0,a.Ds)((function(){"inactive"!==n.cameraMoveState.status&&("moving"===n.cameraMoveState.status&&n.onCameraMoveEnd(),n.setCameraMoveStatus("inactive"))}),100),this.onCameraMoveStart=e,this.onCameraMoveEnd=t}return e.prototype.dispose=function(){this.endInteractionDebounced.cancel(),this.cameraMoveState={status:"inactive"}},e.prototype.handleCameraMoveEvent=function(){var e;this.endInteractionDebounced(),"inactive"===this.cameraMoveState.status&&this.setCameraMoveStatus("uncertain"),"uncertain"===this.cameraMoveState.status&&(e=this.cameraMoveState,Date.now()-e.interactionStartTimestamp>=20)&&(this.onCameraMoveStart(),this.setCameraMoveStatus("moving"))},e.prototype.setCameraMoveStatus=function(e){this.cameraMoveState="uncertain"===e?{status:"uncertain",interactionStartTimestamp:Date.now()}:{status:e}},e}(),u=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),c=function(){return(c=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},l=function(e){function t(t,n){var o=e.call(this)||this;return o.listenersCollector=new i,o.state={panning:!1,zooming:!1,pinchToZoomLastDistance:0,lastPan:{x:0,y:0},zoomCenter:{x:0,y:0},lastGestureScale:1,mouse:{x:0,y:0},isCameraLocked:!1,isWaitingForSecondClick:!1,lastMouseClickPosition:{x:0,y:0}},o.handleGestureStart=function(e){e.preventDefault(),o.state.isCameraLocked||(o.state.lastGestureScale=e.scale,o.emitZoomStartEvent())},o.handleGestureChange=function(e){if(e.preventDefault(),!o.state.isCameraLocked){o.state.zoomCenter=o.getCorrectPointerPosition(e);var t=e.scale/o.state.lastGestureScale;o.state.lastGestureScale=e.scale,o.emitZoomEvent(t,o.state.zoomCenter,!1),o.cameraMoveTracker.handleCameraMoveEvent()}},o.handleGestureEnd=function(e){e.preventDefault(),o.emitZoomEndEvent()},o.handlePointerDown=function(e){(e instanceof MouseEvent&&0===e.button||(0,a.z6)(e))&&(e.preventDefault(),o.updateMousePosition(e),o.handlePanStart(),o.handleTouchPinchToZoomStart(e),o.emit("mousedown"))},o.handlePanStart=function(){o.state.panning=!0,o.state.lastPan.x=o.state.mouse.x,o.state.lastPan.y=o.state.mouse.y},o.handleTouchPinchToZoomStart=function(e){var t;if(e.touches&&!((null===(t=e.touches)||void 0===t?void 0:t.length)<2)){o.emitZoomStartEvent();var n=e.touches[0],r=e.touches[1];o.state.pinchToZoomLastDistance=Math.hypot(n.clientX-r.clientX,n.clientY-r.clientY)}},o.handlePointerMove=function(e){(0,a.z6)(e)&&o.handleTouchPinchToZoomChange(e),o.state.panning||o.updateMousePosition(e)},o.handleTouchPinchToZoomChange=function(e){var t;if(e.touches&&!((null===(t=e.touches)||void 0===t?void 0:t.length)<2)){var n=e.touches[0],r=e.touches[1],i=Math.hypot(n.clientX-r.clientX,n.clientY-r.clientY),a=o.clampPointerToTargetBounds({x:(n.clientX+r.clientX)/2,y:(n.clientY+r.clientY)/2}),s=i/Math.max(o.state.pinchToZoomLastDistance,1);o.state.pinchToZoomLastDistance=i,o.emitZoomEvent(s,a,!1)}},o.handlePanMove=function(e){if(o.state.panning&&!o.state.isCameraLocked){var t=o.getCorrectPointerPosition(e),n=o.state.lastPan.x-t.x,r=o.state.lastPan.y-t.y;o.state.lastPan.x=t.x,o.state.lastPan.y=t.y,o.emit("panChange",-n,-r),o.cameraMoveTracker.handleCameraMoveEvent()}},o.handleDoubleClick=function(e){if(!("undefined"!=typeof TouchEvent&&e instanceof TouchEvent&&e.touches.length>0)){var t=o.getCorrectPointerPosition(e),n=Math.hypot(o.state.lastMouseClickPosition.x-t.x,o.state.lastMouseClickPosition.y-t.y)>("undefined"!=typeof TouchEvent&&e instanceof TouchEvent?15:0);if(!o.state.isWaitingForSecondClick||n)return o.state.isWaitingForSecondClick=!0,o.state.lastMouseClickPosition=o.getCorrectPointerPosition(e),void o.resetDoubleClick();o.state.isWaitingForSecondClick=!1,o.emit("doubleClick")}},o.resetDoubleClick=(0,a.Ds)((function(){o.state.isWaitingForSecondClick=!1}),500),o.handlePanEnd=function(){o.state.panning=!1},o.handlePointerUp=function(e){var t;o.handleTouchPinchToZoomEnd(e),(null===(t=e.touches)||void 0===t?void 0:t.length)>1||o.emit("mouseup")},o.handleTouchPinchToZoomEnd=function(e){var t;(null===(t=e.touches)||void 0===t?void 0:t.length)>2||o.emitZoomEndEvent()},o.handleMouseWheel=function(e){if(e.preventDefault(),!o.state.isCameraLocked){var t=e.metaKey||e.ctrlKey;if(o.updateMousePosition(e),t){var n=e.ctrlKey?-1:1;o.state.zoomCenter=o.getCorrectPointerPosition(e);var r=1+.01*e.deltaY*n;o.emitZoomEvent(r,o.state.zoomCenter)}else o.emit("panChange",-e.deltaX,-e.deltaY);o.cameraMoveTracker.handleCameraMoveEvent()}},o.emitZoomEndEvent=(0,a.Ds)((function(){o.state.zooming&&(o.state.zooming=!1,o.emit("zoomEnd"))}),90),o.handleCameraMoveStart=function(){o.emit("cameraMoveStart")},o.handleCameraMoveEnd=function(){o.emit("cameraMoveEnd")},o.target=t,o.settings=n,o.targetBounds=t.getBoundingClientRect(),o.addListeners(),o.cameraMoveTracker=new s(o.handleCameraMoveStart,o.handleCameraMoveEnd),o}return u(t,e),t.prototype.updateTargetBounds=function(){this.targetBounds=this.target.getBoundingClientRect()},t.prototype.addListeners=function(){this.addTouchEventListeners(),this.addMouseEventListeners(),this.addSafariGesturesEventListeners()},t.prototype.addMouseEventListeners=function(){this.listenersCollector.add(this.target,"mousedown",this.handlePointerDown),this.listenersCollector.add(this.target,"mousemove",this.handlePointerMove),this.listenersCollector.add(document,"mousemove",this.handlePanMove),this.listenersCollector.add(this.target,"mouseup",this.handlePointerUp),this.listenersCollector.add(document,"mouseup",this.handlePanEnd),this.listenersCollector.add(this.target,"wheel",this.handleMouseWheel),this.listenersCollector.add(this.target,"mouseup",this.handleDoubleClick)},t.prototype.addTouchEventListeners=function(){this.listenersCollector.add(this.target,"touchstart",this.handlePointerDown),this.listenersCollector.add(document,"touchmove",this.handlePanMove,{passive:!0}),this.listenersCollector.add(this.target,"touchmove",this.handlePointerMove,{passive:!0}),this.listenersCollector.add(this.target,"touchend",this.handlePointerUp),this.listenersCollector.add(this.target,"touchcancel",this.handlePointerUp),this.listenersCollector.add(document,"touchend",this.handlePanEnd),this.listenersCollector.add(this.target,"touchend",this.handleDoubleClick)},t.prototype.addSafariGesturesEventListeners=function(){(0,a.b1)()||(this.listenersCollector.add(this.target,"gesturestart",this.handleGestureStart,{capture:!0}),this.listenersCollector.add(this.target,"gesturechange",this.handleGestureChange,{capture:!0}),this.listenersCollector.add(this.target,"gestureend",this.handleGestureEnd,{capture:!0}))},t.prototype.clampPointerToTargetBounds=function(e){return{x:(0,a.uZ)(e.x-this.targetBounds.x,0,this.target.clientWidth),y:(0,a.uZ)(e.y-this.targetBounds.y,0,this.target.clientHeight)}},t.prototype.getCorrectPointerPosition=function(e){var t,n={x:0,y:0};if((null===(t=e.touches)||void 0===t?void 0:t.length)>1){var o=e,r=o.touches[0],i=o.touches[1];n={x:(r.clientX+i.clientX)/2,y:(r.clientY+i.clientY)/2}}else n=(0,a.MP)(e);return this.clampPointerToTargetBounds(n)},t.prototype.updateMousePosition=function(e){this.state.mouse=this.getCorrectPointerPosition(e),this.emit("mousemove",this.state.mouse.x,this.state.mouse.y)},t.prototype.emitZoomEvent=function(e,t,n){void 0===n&&(n=!0),n&&this.emitZoomStartEvent(),this.emit("zoomChange",e,t),n&&this.emitZoomEndEvent()},t.prototype.emitZoomStartEvent=function(){this.state.zooming||(this.state.zooming=!0,this.emit("zoomStart"))},t.prototype.getMouse=function(){return c({},this.state.mouse)},t.prototype.setMouse=function(e,t){this.state.mouse.x=e,this.state.mouse.y=t,this.emit("mousemove",this.state.mouse.x,this.state.mouse.y)},t.prototype.setIsCameraLocked=function(e){this.state.isCameraLocked=e},t.prototype.getMinZoomLevel=function(){return this.settings.minimumZoomLevel},t.prototype.getMaxZoomLevel=function(){return this.settings.maximumZoomLevel},t.prototype.dispose=function(){this.listenersCollector.dispose(),this.cameraMoveTracker.dispose()},t}(r.v),d=n(475),h=n(419);const f=Symbol("Comlink.proxy"),v=Symbol("Comlink.endpoint"),p=Symbol("Comlink.releaseProxy"),m=Symbol("Comlink.thrown"),g=e=>"object"==typeof e&&null!==e||"function"==typeof e,b=new Map([["proxy",{canHandle:e=>g(e)&&e[f],serialize(e){const{port1:t,port2:n}=new MessageChannel;return y(e,t),[n,[n]]},deserialize:e=>(e.start(),C(e))}],["throw",{canHandle:e=>g(e)&&m in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function y(e,t=self){t.addEventListener("message",(function n(o){if(!o||!o.data)return;const{id:r,type:i,path:a}=Object.assign({path:[]},o.data),s=(o.data.argumentList||[]).map(L);let u;try{const t=a.slice(0,-1).reduce(((e,t)=>e[t]),e),n=a.reduce(((e,t)=>e[t]),e);switch(i){case"GET":u=n;break;case"SET":t[a.slice(-1)[0]]=L(o.data.value),u=!0;break;case"APPLY":u=n.apply(t,s);break;case"CONSTRUCT":u=M(new n(...s));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;y(e,n),u=S(t,[t])}break;case"RELEASE":u=void 0;break;default:return}}catch(e){u={value:e,[m]:0}}Promise.resolve(u).catch((e=>({value:e,[m]:0}))).then((e=>{const[o,a]=W(e);t.postMessage(Object.assign(Object.assign({},o),{id:r}),a),"RELEASE"===i&&(t.removeEventListener("message",n),w(t))}))})),t.start&&t.start()}function w(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function C(e,t){return P(e,[],t)}function k(e){if(e)throw new Error("Proxy has been released and is not useable")}function P(e,t=[],n=function(){}){let o=!1;const r=new Proxy(n,{get(n,i){if(k(o),i===p)return()=>D(e,{type:"RELEASE",path:t.map((e=>e.toString()))}).then((()=>{w(e),o=!0}));if("then"===i){if(0===t.length)return{then:()=>r};const n=D(e,{type:"GET",path:t.map((e=>e.toString()))}).then(L);return n.then.bind(n)}return P(e,[...t,i])},set(n,r,i){k(o);const[a,s]=W(i);return D(e,{type:"SET",path:[...t,r].map((e=>e.toString())),value:a},s).then(L)},apply(n,r,i){k(o);const a=t[t.length-1];if(a===v)return D(e,{type:"ENDPOINT"}).then(L);if("bind"===a)return P(e,t.slice(0,-1));const[s,u]=E(i);return D(e,{type:"APPLY",path:t.map((e=>e.toString())),argumentList:s},u).then(L)},construct(n,r){k(o);const[i,a]=E(r);return D(e,{type:"CONSTRUCT",path:t.map((e=>e.toString())),argumentList:i},a).then(L)}});return r}function E(e){const t=e.map(W);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const x=new WeakMap;function S(e,t){return x.set(e,t),e}function M(e){return Object.assign(e,{[f]:!0})}function W(e){for(const[t,n]of b)if(n.canHandle(e)){const[o,r]=n.serialize(e);return[{type:"HANDLER",name:t,value:o},r]}return[{type:"RAW",value:e},x.get(e)||[]]}function L(e){switch(e.type){case"HANDLER":return b.get(e.name).deserialize(e.value);case"RAW":return e.value}}function D(e,t,n){return new Promise((o=>{const r=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.addEventListener("message",(function t(n){n.data&&n.data.id&&n.data.id===r&&(e.removeEventListener("message",t),o(n.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:r},t),n)}))}var O,Z=n(849),R=n(519),T=n(332),z=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),A=function(e){function t(t){var n=e.call(this)||this;return n.listenersCollector=new i,n.handleKeyUp=function(e){n.emit("keyUp",e.code)},n.target=t,n.addListeners(),n}return z(t,e),t.prototype.addListeners=function(){this.listenersCollector.add(this.target,"keyup",this.handleKeyUp)},t.prototype.dispose=function(){this.listenersCollector.dispose()},t}(r.v),j=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),I=function(){return(I=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},_=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((o=o.apply(e,t||[])).next())}))},F=function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},G=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,r++)o[r]=i[a];return o};!function(e){e[e.browser=0]="browser",e[e.worker=1]="worker"}(O||(O={}));var B=function(e){function t(t){var n,o=e.call(this)||this;o.listenersCollector=new i,o.handleZoomStart=function(){o.emit("zoomStart")},o.handleZoomEnd=function(){o.emit("zoomEnd")},o.handleCameraMoveStart=function(){var e;null===(e=o.sketchWeb)||void 0===e||e.setIsCameraMoving(!0)},o.handleCameraMoveEnd=function(){var e;null===(e=o.sketchWeb)||void 0===e||e.setIsCameraMoving(!1)},o.handleMouseChange=function(e,t){var n;null===(n=o.sketchWeb)||void 0===n||n.setMouse(e,t)},o.handlePanChange=function(e,t){return _(o,void 0,void 0,(function(){var n;return F(this,(function(o){return null===(n=this.sketchWeb)||void 0===n||n.addPan(e,t),this.emitPanEvent(),[2]}))}))},o.handleZoomChange=function(e,t){return _(o,void 0,void 0,(function(){var n;return F(this,(function(o){return null===(n=this.sketchWeb)||void 0===n||n.addZoom(e,t),this.emitZoomEvent(),this.emitPanEvent(),[2]}))}))},o.handleCanvasResizeObserver=function(e){o.resizeCanvas(e[0].contentRect)},o.resizeCanvas=function(e){var t=e.width,n=e.height;window.requestAnimationFrame((function(){var e;o.setCanvasSize(t,n),o.gestureManager.updateTargetBounds(),null===(e=o.sketchWeb)||void 0===e||e.setSize(t,n,o.getDevicePixelRatio())}))};var r=null!==(n=t.featureFlags)&&void 0!==n?n:{};return o.featureFlags=I(I({},R.Z),r),o.settings=t,o.canvas=t.canvas,o.gestureManager=new l(o.settings.container,{minimumZoomLevel:t.minimumZoomLevel,maximumZoomLevel:t.maximumZoomLevel}),o.keyboardManager=new A(document.body),Z.Z.active=t.mode===T.p.debug,o.init(),o}return j(t,e),t.prototype.init=function(){var e;return _(this,void 0,void 0,(function(){var t,n,o;return F(this,(function(r){switch(r.label){case 0:return this.setCanvasSize(this.settings.container.clientWidth,this.settings.container.clientHeight),[4,this.initSketchWeb()];case 1:return r.sent(),[4,null===(e=this.sketchWeb)||void 0===e?void 0:e.getStatus()];case 2:return"FILE_READY"!==(null==(t=r.sent())?void 0:t.type)?[2]:(n=void 0!==this.settings.initialZoom,o=void 0!==this.settings.initialPan,n||o?n?[4,this.setZoom(this.settings.initialZoom)]:[3,4]:[3,7]);case 3:r.sent(),r.label=4;case 4:return o?[4,this.setPan(this.settings.initialPan.x,this.settings.initialPan.y,this.settings.initialPan.centerPointInViewport)]:[3,6];case 5:r.sent(),r.label=6;case 6:return[3,9];case 7:return[4,this.zoomToFit()];case 8:r.sent(),r.label=9;case 9:return this.sketchWeb.startRendering(),this.addListeners(),[2]}}))}))},t.prototype.initSketchWeb=function(){return _(this,void 0,void 0,(function(){var e,t,o,r,i;return F(this,(function(a){switch(a.label){case 0:return e=this.featureFlags.offscreenCanvas&&"function"==typeof this.canvas.transferControlToOffscreen,t=I(I({},this.settings),{size:{width:this.canvas.width,height:this.canvas.height},pixelRatio:this.getDevicePixelRatio(),featureFlags:this.featureFlags}),e?(this.environment=O.worker,Z.Z.debug("Using offscreen canvas"),this.offscreenCanvas=this.canvas.transferControlToOffscreen(),this.worker=new Worker(new URL(n.p+n.u(667),n.b),{type:void 0}),o=C(this.worker),r=this,[4,new o(S(I(I({},t),{canvas:this.offscreenCanvas}),[this.offscreenCanvas]))]):[3,2];case 1:return r.sketchWeb=a.sent(),[3,3];case 2:this.environment=O.browser,Z.Z.debug("Using normal canvas"),this.sketchWeb=new d.U(t),a.label=3;case 3:return(i=this.sketchWeb).on("status",this.forwardEvent("status")),i.on("fileReady",this.forwardEvent("fileReady")),i.on("metric",this.forwardEvent("metric")),i.on("warnings",this.forwardEvent("warnings")),i.on("allImagesReady",this.forwardEvent("allImagesReady")),i.on("deviceInfo",this.forwardEvent("deviceInfo")),[4,this.sketchWeb.init()];case 4:return a.sent(),[2]}}))}))},t.prototype.forwardEvent=function(e){var t=this,n=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];t.emit.apply(t,G([e],n))};return this.environment===O.worker?M(n):n},t.prototype.isRunningInsideWorker=function(){return this.environment===O.worker},t.prototype.looseWebGLContext=function(){var e;null===(e=this.sketchWeb)||void 0===e||e.looseWebGLContext()},t.prototype.addListeners=function(){this.canvasResizeObserver=new ResizeObserver(this.handleCanvasResizeObserver),this.canvasResizeObserver.observe(this.settings.container),this.listenersCollector.add(window,"orientationchange",this.handleDeviceOrientationChange),this.gestureManager.on("panChange",this.handlePanChange),this.gestureManager.on("mousemove",this.handleMouseChange),this.gestureManager.on("zoomChange",this.handleZoomChange),this.gestureManager.on("zoomStart",this.handleZoomStart),this.gestureManager.on("zoomEnd",this.handleZoomEnd),this.gestureManager.on("cameraMoveStart",this.handleCameraMoveStart),this.gestureManager.on("cameraMoveEnd",this.handleCameraMoveEnd)},t.prototype.emitPanEvent=function(){var e;return _(this,void 0,void 0,(function(){var t;return F(this,(function(n){switch(n.label){case 0:return[4,null===(e=this.sketchWeb)||void 0===e?void 0:e.getPan()];case 1:return(t=n.sent())?(this.emit("pan",t.x,t.y),[2]):[2]}}))}))},t.prototype.emitZoomEvent=function(){var e;return _(this,void 0,void 0,(function(){var t;return F(this,(function(n){switch(n.label){case 0:return[4,null===(e=this.sketchWeb)||void 0===e?void 0:e.getZoom()];case 1:return void 0===(t=n.sent())||this.emit("zoom",t),[2]}}))}))},t.prototype.getDevicePixelRatio=function(){return(0,h.uZ)(window.devicePixelRatio,1,2)},t.prototype.setCanvasSize=function(e,t){this.canvas.style.width=e+"px",this.canvas.style.height=t+"px",this.canvas.width=e*this.getDevicePixelRatio(),this.canvas.height=t*this.getDevicePixelRatio()},t.prototype.handleDeviceOrientationChange=function(){this.resizeCanvas({width:this.settings.container.clientWidth,height:this.settings.container.clientHeight})},t.prototype.setBackgroundColor=function(e){var t;null===(t=this.sketchWeb)||void 0===t||t.setBackgroundColor(e)},t.prototype.zoomToFit=function(){return _(this,void 0,void 0,(function(){return F(this,(function(e){switch(e.label){case 0:return[4,this.sketchWeb.scaleDocumentToFit()];case 1:return e.sent(),this.emitZoomEvent(),this.emitPanEvent(),[2]}}))}))},t.prototype.getStatus=function(){var e;return _(this,void 0,void 0,(function(){return F(this,(function(t){return[2,null===(e=this.sketchWeb)||void 0===e?void 0:e.getStatus()]}))}))},t.prototype.generateDocumentPNG=function(){var e;return _(this,void 0,void 0,(function(){return F(this,(function(t){return[2,null===(e=this.sketchWeb)||void 0===e?void 0:e.generateDocumentPNG()]}))}))},t.prototype.getDocument=function(){var e;return null===(e=this.sketchWeb)||void 0===e?void 0:e.getDocument()},t.prototype.getArtboardAtPosition=function(e,t){var n;return _(this,void 0,void 0,(function(){return F(this,(function(o){switch(o.label){case 0:return[4,null===(n=this.sketchWeb)||void 0===n?void 0:n.getArtboardAtPosition(e,t)];case 1:return[2,o.sent()||null]}}))}))},t.prototype.getPanAtPosition=function(e,t){var n;return null===(n=this.sketchWeb)||void 0===n?void 0:n.getPanAtPosition(e,t)},t.prototype.setPan=function(e,t,n){var o;return _(this,void 0,void 0,(function(){return F(this,(function(r){switch(r.label){case 0:return[4,null===(o=this.sketchWeb)||void 0===o?void 0:o.setPan(e,t,Boolean(n))];case 1:return r.sent(),this.emitPanEvent(),[2]}}))}))},t.prototype.setZoom=function(e,t){var n;return _(this,void 0,void 0,(function(){var o;return F(this,(function(r){return o=null!=t?t:this.getCanvasCenterPoint(),null===(n=this.sketchWeb)||void 0===n||n.setZoom(e,o),this.emitZoomEvent(),this.emitPanEvent(),[2]}))}))},t.prototype.getCanvasCenterPoint=function(){var e=this.canvas.getBoundingClientRect();return{x:e.width/2+e.x,y:e.height/2+e.y}},t.prototype.getZoom=function(){var e;return null===(e=this.sketchWeb)||void 0===e?void 0:e.getZoom()},t.prototype.getPan=function(){var e;return null===(e=this.sketchWeb)||void 0===e?void 0:e.getPan()},t.prototype.dispose=function(){var e,t,n,o;return _(this,void 0,void 0,(function(){return F(this,(function(r){switch(r.label){case 0:return this.gestureManager.dispose(),this.keyboardManager.dispose(),this.listenersCollector.dispose(),null===(e=this.canvasResizeObserver)||void 0===e||e.disconnect(),this.isRunningInsideWorker()?[4,null===(t=this.sketchWeb)||void 0===t?void 0:t.dispose()]:[3,2];case 1:return r.sent(),null===(n=this.worker)||void 0===n||n.terminate(),[3,3];case 2:null===(o=this.sketchWeb)||void 0===o||o.dispose(),r.label=3;case 3:return[2]}}))}))},t}(r.v)},475:(e,t,n)=>{"use strict";n.d(t,{U:()=>m});var o,r=n(419),i=n(519),a=n(354),s=n(108),u=n(849),c=n(758),l=n(332),d=n(975),h=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),f=function(){return(f=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},v=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((o=o.apply(e,t||[])).next())}))},p=function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},m=(globalThis.indexedDB,function(e){function t(t){var n=t.canvas,o=t.locateFile,a=t.filePath,c=t.imagesURLFormat,d=t.imagesURLMap,h=t.backgroundColor,v=void 0===h?{r:1,g:1,b:1,a:1}:h,p=t.size,m=t.pixelRatio,g=t.mode,b=t.showTilesBorders,y=void 0!==b&&b,w=t.minimumZoomLevel,C=t.maximumZoomLevel,k=t.preserveDrawingBuffer,P=void 0!==k&&k,E=t.panBoundariesPadding,x=void 0===E?40:E,S=t.featureFlags,M=void 0===S?{}:S,W=e.call(this)||this;return W.status={type:"INIT"},W.isZooming=!1,W.handleWebGLContextLost=function(){W.setStatus({type:"WEBGL_CONTEXT_LOST"})},W.debouncedFullDraw=(0,r.Ds)((function(){return W.draw(!0)}),60),W.notifyZoomDidEndDebounced=(0,r.Ds)((function(){var e;W.isZooming&&(W.isZooming=!1,null===(e=W.sketchWebWasm)||void 0===e||e.setIsZooming(!1),W.delayedDraw())}),80),W.canvas=n,W.locateFile=o,W.filePath=a,W.imagesURLFormat=c,W.imagesURLMap=d,W.backgroundColor=v,W.size=p,W.pixelRatio=m,W.mode=g,W.showTilesBorders=y,W.currentWebGLVersion=(0,r.wX)(),W.zoomLevels={min:w,max:C},W.preserveDrawingBuffer=P,W.panBoundariesPadding=x,W.featureFlags=f(f({},i.Z),M),u.Z.active=g===l.p.debug,W.traceFirstPaint=new s.S("FirstPaint"),W}return h(t,e),t.prototype.collectAndEmitDeviceInfo=function(){return v(this,void 0,void 0,(function(){var e;return p(this,(function(t){switch(t.label){case 0:return[4,(0,d.M)()];case 1:return e=t.sent(),this.deviceInfo=f(f({},e),{hardwareConcurrency:navigator.hardwareConcurrency}),this.emit("deviceInfo",this.deviceInfo),[2]}}))}))},t.prototype.init=function(){return v(this,void 0,void 0,(function(){var e;return p(this,(function(t){switch(t.label){case 0:this.setStatus({type:"INIT"}),this.collectAndEmitDeviceInfo(),t.label=1;case 1:return t.trys.push([1,5,,6]),[4,this.initSketchWebWasm()];case 2:return t.sent(),[4,this.setFile(this.filePath)];case 3:return t.sent(),[4,this.preloadImages()];case 4:return t.sent(),[3,6];case 5:return e=t.sent(),[2,this.fail(e instanceof c.k?e:new c.k("ERROR","Unexpected exception initializing the web renderer",e))];case 6:return[2]}}))}))},t.prototype.preloadImages=function(){var e=this;return new Promise((function(t){var n;null===(n=e.sketchWebWasm)||void 0===n||n.preloadImages((function(){t()}))}))},t.prototype.startRendering=function(){this.traceInitialRender=new s.S("InitialRender"),this.setStatus({type:"DRAWING_FILE"}),this.draw(!0,!1),this.sketchWebWasm.startRenderLoop()},t.prototype.createJSBridge=function(){var e=this;return{logDebug:function(e){u.Z.debug("[C++] "+e)},logWarning:function(e){u.Z.warning("[C++] "+e)},logError:function(e){u.Z.error("[C++] "+e)},emitMetric:function(t,n,o,r){e.emit("metric",{id:t,start:n,end:o,duration:r})},resolveImageUrl:function(t){return e.imagesURLFormat?e.imagesURLFormat.replace(":imageId",t):e.imagesURLMap&&e.imagesURLMap[t]?e.imagesURLMap[t]:(u.Z.warning("Not able to resolve the url for the image with UUID: "+t),"")},onDrawComplete:this.handleDrawComplete.bind(this),onAllImagesReady:function(){e.emit("allImagesReady")}}},t.prototype.downloadImages=function(){var e=this;return new Promise((function(t){var n,o=new s.S("ImagesDownload");null===(n=e.sketchWebWasm)||void 0===n||n.downloadImages((function(){o.printMeasurement(),e.emit("metric",o.measure()),u.Z.debug("Images downloaded"),t()}))}))},t.prototype.initSketchWebWasm=function(){return v(this,void 0,void 0,(function(){var e,t,o,r,i,a,d,h=this;return p(this,(function(f){switch(f.label){case 0:return e=new s.S("WasmModuleDownload"),this.mode!==l.p.debug?[3,2]:[4,n.e(706).then(n.t.bind(n,706,23))];case 1:return t=f.sent(),[3,4];case 2:return[4,n.e(610).then(n.t.bind(n,610,23))];case 3:t=f.sent(),f.label=4;case 4:o=t.default,f.label=5;case 5:return f.trys.push([5,7,,8]),r=this,[4,o({FeatureFlags:this.featureFlags,currentWebGLVersion:this.currentWebGLVersion,locateFile:function(e){return h.locateFile.replace("{file}",e)},bridge:this.createJSBridge()})];case 6:return r.wasmModule=f.sent(),[3,8];case 7:throw i=f.sent(),new c.k("WASM_ERROR","An error occurred while trying to create the wasm module.",i);case 8:if(e.printMeasurement(),this.emit("metric",e.measure()),a={majorVersion:this.currentWebGLVersion,antialias:!1,alpha:!1,stencil:!1,depth:!1,powerPreference:"high-performance",preserveDrawingBuffer:this.preserveDrawingBuffer},u.Z.debug("Using WebGL "+a.majorVersion),!(d=this.wasmModule.GL.createContext(this.canvas,a)))throw new c.k("WEBGL_ERROR","Unable to create WebGL context. WebGL might be unsupported, disabled, or this device is not able to run WebGL correctly.");this.webglCtxHandle=d;try{this.sketchWebWasm=this.wasmModule.SketchWeb.MakeGL(this.webglCtxHandle,this.canvas.width,this.size.height,this.pixelRatio,{showTilesBorders:this.showTilesBorders})}catch(e){throw new c.k("WASM_ERROR","An error occurred while trying to create the SketchWebWasm object.",e)}return this.sketchWebWasm.setBackgroundColor(this.backgroundColor.r,this.backgroundColor.g,this.backgroundColor.b,this.backgroundColor.a),this.sketchWebWasm.setZoomLevels(this.zoomLevels.min,this.zoomLevels.max),this.sketchWebWasm.setPanBoundariesPadding(this.panBoundariesPadding),this.canvas.addEventListener("webglcontextlost",this.handleWebGLContextLost),[2]}}))}))},t.prototype.setBackgroundColor=function(e){var t;e.r===this.backgroundColor.r&&e.g===this.backgroundColor.g&&e.b===this.backgroundColor.b&&e.a===this.backgroundColor.a||(null===(t=this.sketchWebWasm)||void 0===t||t.setBackgroundColor(e.r,e.g,e.b,e.a),this.backgroundColor=e,this.delayedDraw())},t.prototype.generateDocumentPNG=function(){return v(this,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return[4,this.downloadImages()];case 1:return e.sent(),[2,this.sketchWebWasm.generateDocumentPNG()]}}))}))},t.prototype.handleDrawComplete=function(){"DRAWING_FILE"===this.status.type&&(this.traceInitialRender.printMeasurement(),this.emit("metric",this.traceInitialRender.measure()),this.traceFirstPaint.printMeasurement(),this.emit("metric",this.traceFirstPaint.measure()),this.setStatus({type:"READY"}),this.downloadImages())},t.prototype.looseWebGLContext=function(){var e=this.wasmModule.GL.getContext(this.webglCtxHandle);if(e){var t=e.GLctx.getExtension("WEBGL_lose_context");t?t.loseContext():console.warn("Unable to retrieve WEBGL_lose_context extension")}else console.warn("Unable to loose context. WebGL rendering context not found")},t.prototype.scaleDocumentToFit=function(){var e;null===(e=this.sketchWebWasm)||void 0===e||e.scaleDocumentToFit(),this.delayedDraw()},t.prototype.setFile=function(e){return v(this,void 0,void 0,(function(){var t=this;return p(this,(function(n){return this.setStatus({type:"LOADING_FILE"}),[2,new Promise((function(n,o){t.sketchWebWasm.setFile(e,(function(e,o,r,i){if(void 0===i&&(i=[]),i.length){u.Z.debug("Parser warnings: "+i);var a=i.map((function(e){return{key:e}}));t.emit("warnings",a)}t.setStatus({type:"FILE_READY"}),t.emit("fileReady",t.getDocument(),e,o,r),n()}),(function(){return o(new c.k("FILE_ERROR","Error encountered while fetching and parsing the file"))}))}))]}))}))},t.prototype.delayedDraw=function(){if(!this.featureFlags.delayedDraw)return this.draw(!0);this.draw(),this.debouncedFullDraw()},t.prototype.draw=function(e,t){var n;void 0===e&&(e=!1),void 0===t&&(t=!1),null===(n=this.sketchWebWasm)||void 0===n||n.setNeedsUpdate(e,t)},t.prototype.fail=function(e){this.setStatus({type:"FAILURE",code:e.code,message:e.toString()+(e.cause?"\nWrapped Error: "+e.cause.toString():"")}),u.Z.error(e),e.cause&&u.Z.error(e.cause)},t.prototype.setPixelRatio=function(e){this.pixelRatio=e,this.setSize(this.size.width*this.pixelRatio,this.size.height*this.pixelRatio,this.pixelRatio),this.delayedDraw()},t.prototype.setSize=function(e,t,n){var o;this.size.width=e*n,this.size.height=t*n,this.canvas.width=e*n,this.canvas.height=t*n,null===(o=this.sketchWebWasm)||void 0===o||o.resize(e,t,n)},t.prototype.setStatus=function(e){"FAILURE"!==this.status.type&&(u.Z.debug("Status transition "+this.status.type+" => "+e.type+"}"),this.status=e,this.emit("status",e))},t.prototype.getDocument=function(){if(!this.sketchWebWasm)return null;if(!this.cachedDocumentInfo||this.cachedDocumentInfo.filePath!==this.filePath){var e=this.sketchWebWasm.getPRFile();this.cachedDocumentInfo={filePath:this.filePath,document:f(f({},e),{artboards:(0,r.gi)(e.artboards)})}}return this.cachedDocumentInfo.document},t.prototype.getArtboardAtPosition=function(e,t){var n;return null===(n=this.sketchWebWasm)||void 0===n?void 0:n.getArtboardAtPosition(e,t)},t.prototype.getPanAtPosition=function(e,t){var n;return null===(n=this.sketchWebWasm)||void 0===n?void 0:n.getPanAtPosition(e,t)},t.prototype.getStatus=function(){return this.status},t.prototype.setZoom=function(e,t){var n,o;null===(n=this.sketchWebWasm)||void 0===n||n.setZoomCenter(t.x,t.y),null===(o=this.sketchWebWasm)||void 0===o||o.setZoom(e),this.delayedDraw()},t.prototype.addZoom=function(e,t){var n,o;this.notifyZoomDidStart(),null===(n=this.sketchWebWasm)||void 0===n||n.setZoomCenter(t.x,t.y),null===(o=this.sketchWebWasm)||void 0===o||o.addZoom(e),this.notifyZoomDidEndDebounced(),this.delayedDraw()},t.prototype.notifyZoomDidStart=function(){var e;this.isZooming||(this.isZooming=!0,null===(e=this.sketchWebWasm)||void 0===e||e.setIsZooming(!0))},t.prototype.setPan=function(e,t,n){var o;void 0===n&&(n=!1),null===(o=this.sketchWebWasm)||void 0===o||o.setPan(e,t,n),this.delayedDraw()},t.prototype.addPan=function(e,t){var n;null===(n=this.sketchWebWasm)||void 0===n||n.addPan(e,t),this.delayedDraw()},t.prototype.getPan=function(){if(this.sketchWebWasm)return this.sketchWebWasm.getPan()},t.prototype.getZoom=function(){var e;return null===(e=this.sketchWebWasm)||void 0===e?void 0:e.getZoom()},t.prototype.setMouse=function(e,t){var n;null===(n=this.sketchWebWasm)||void 0===n||n.setMouse(e,t)},t.prototype.setIsCameraMoving=function(e){var t;null===(t=this.sketchWebWasm)||void 0===t||t.setIsCameraMoving(e)},t.prototype.dispose=function(){var e,t;try{null===(e=this.sketchWebWasm)||void 0===e||e.stopRenderLoop(),null===(t=this.sketchWebWasm)||void 0===t||t.delete(),this.looseWebGLContext(),this.sketchWebWasm=null,this.wasmModule=null}catch(e){this.fail(new c.k("ERROR","Unexpected exception while disposing the SketchWebWasm object",e))}},t}(a.v))},550:(e,t,n)=>{"use strict";n.d(t,{j4:()=>Te,aV:()=>ke,z0:()=>me,oW:()=>oe,jr:()=>D,tm:()=>j,ky:()=>M,zX:()=>Y,ex:()=>G,Jw:()=>B,m_:()=>U,Yy:()=>A,d6:()=>Z,aP:()=>O,EY:()=>N,pt:()=>F,od:()=>L,ph:()=>I,lt:()=>z,$z:()=>S,BO:()=>W,us:()=>_});var o=n(297),r=n.n(o),i=n(332),a=n(849),s=(0,o.createContext)(void 0),u=function(){var e=(0,o.useContext)(s);if(void 0===e)throw Error("useSketchWebInternalContext must be used within a SketchWebProvider");return e},c=n(419),l=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,r++)o[r]=i[a];return o},d=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return a.Z.debug.apply(a.Z,l(["SketchWebReact"],e))};function h(e){return(0,c.b1)()?{onTouchEnd:e}:{onClick:e}}var f,v,p,m,g,b,y=(0,o.createContext)(void 0),w=(0,o.createContext)(void 0),C=(0,o.createContext)(void 0),k=(0,o.createContext)(void 0),P=(0,o.createContext)(void 0),E=(0,o.createContext)(void 0),x=(0,o.createContext)(void 0),S=function(){var e=(0,o.useContext)(y);if(void 0===e)throw Error("useStatus must be used within a SketchWebProvider");return e},M=function(){var e=(0,o.useContext)(w);if(void 0===e)throw Error("useDocument must be used within a SketchWebProvider");return e},W=function(){var e=(0,o.useContext)(C);if(void 0===e)throw Error("useZoom must be used within a SketchWebProvider");return e},L=function(){var e=(0,o.useContext)(E);if(void 0===e)throw Error("usePan must be used within a SketchWebProvider");return e},D=function(){var e=(0,o.useContext)(x);if(void 0===e)throw Error("useCursor must be used within a SketchWebProvider");return e},O=function(){var e=(0,o.useContext)(k);if(void 0===status)throw Error("useIsCameraZooming must be used within a SketchWebProvider");return e},Z=function(){var e=(0,o.useContext)(P);if(void 0===status)throw Error("useIsCameraMoving must be used within a SketchWebProvider");return e},R=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((o=o.apply(e,t||[])).next())}))},T=function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},z=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(t){d("setZoom",t),null==e||e.setZoom(t)}),[e])},A=function(){var e=z(),t=W();return(0,o.useCallback)((function(){var n;d("incrementZoom"),"number"==typeof t&&(n=t>=1?Math.round(2*t):t>.5?1:2*t,e(n))}),[e,t])},j=function(){var e=z(),t=W();return(0,o.useCallback)((function(){d("decrementZoom"),"number"==typeof t&&e(t/2)}),[e,t])},I=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(t){var n=t.x,o=t.y,r=t.centerPointInViewport;d("setPan",n,o,"centerPointInViewport",r),null==e||e.setPan(n,o,r)}),[e])},_=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(){d("zoomToFit"),null==e||e.zoomToFit()}),[e])},F=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(){d("looseWebGLContext"),null==e||e.looseWebGLContext()}),[e])},G=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(){return R(void 0,void 0,void 0,(function(){return T(this,(function(t){switch(t.label){case 0:return d("generateDocumentPNG"),[4,null==e?void 0:e.generateDocumentPNG()];case 1:return[2,t.sent()]}}))}))}),[e])},B=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(t,n){return R(void 0,void 0,void 0,(function(){return T(this,(function(o){switch(o.label){case 0:return d("getArtboardAtPosition",t,n),[4,null==e?void 0:e.getArtboardAtPosition(t,n)];case 1:return[2,o.sent()||null]}}))}))}),[e])},U=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(t,n){return R(void 0,void 0,void 0,(function(){return T(this,(function(o){switch(o.label){case 0:return d("getPanAtPosition",t,n),[4,null==e?void 0:e.getPanAtPosition(t,n)];case 1:return[2,o.sent()||null]}}))}))}),[e])},N=function(){var e=(0,u().getManager)();return(0,o.useCallback)((function(t){d("setIsCameraLocked",t),null==e||e.gestureManager.setIsCameraLocked(t)}),[e])},Y=function(e,t){var n=(0,u().getManager)();(0,o.useEffect)((function(){return null==n||n.on(e,t),function(){null==n||n.off(e,t)}}),[e,n,t])},X=n(268),V=n.n(X),q=n(914),$=n.n(q),H=(0,q.createGlobalStyle)(f||(p=["\n *:where(:not(iframe, canvas, img, svg, video):not(svg *, symbol *)) {\n all: unset;\n display: revert;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n"],m=["\n *:where(:not(iframe, canvas, img, svg, video):not(svg *, symbol *)) {\n all: unset;\n display: revert;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n"],Object.defineProperty?Object.defineProperty(p,"raw",{value:m}):p.raw=m,f=p)),K=function(){return(K=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},J=(0,q.createGlobalStyle)(v||(v=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n ","\n"],["\n ","\n"])),(function(e){return e.injectedStyles})),Q=function(e){var t=e.children,n=e.injectedStyles,i=(0,o.useRef)(null),a=(0,o.useState)(null),s=a[0],u=a[1];return r().createElement("div",{ref:function(e){e&&(i.current=e,e.shadowRoot||u(e.attachShadow({mode:"open",delegatesFocus:!0})))},style:{position:"relative",width:"100%",height:"100%"}},s&&V().createPortal(r().createElement(q.StyleSheetManager,{target:s},r().createElement(r().Fragment,null,r().createElement(H,null),n&&r().createElement(J,{injectedStyles:n}),t)),s))},ee=function(){return(ee=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},te={position:"relative",width:"100%",height:"100%",touchAction:"manipulation"},ne={position:"absolute",top:0,left:0},oe=(g=function(e){a.Z.active=e.mode===i.p.debug;var t=e.filePath,n=e.locateFile,s=e.imagesURLFormat,c=e.imagesURLMap,l=e.backgroundColor,d=e.mode,h=e.showTilesBorders,f=e.minimumZoomLevel,v=e.maximumZoomLevel,p=e.preserveDrawingBuffer,m=e.panBoundariesPadding,g=e.initialPan,b=e.initialZoom,y=e.children,w=e.containerProps,C=void 0===w?{}:w,k=e.canvasProps,P=void 0===k?{}:k,E=e.featureFlags,x=void 0===E?{}:E,M=(0,o.useRef)(null),W=(0,o.useRef)(null),L=(0,o.useState)(!1),O=L[0],Z=L[1],R=(0,o.useCallback)((function(){return Z(!0)}),[]),T=u(),z=T.dispose,A=T.init,j=T.setSettings,I=D(),_=S();Y("allImagesReady",R),(0,o.useEffect)((function(){j({locateFile:n,imagesURLFormat:s,imagesURLMap:c,backgroundColor:l,mode:d,showTilesBorders:h,minimumZoomLevel:f,maximumZoomLevel:v,preserveDrawingBuffer:p,panBoundariesPadding:m,initialPan:g,initialZoom:b,featureFlags:x})}),[j,n,s,c,l,d,h,f,v,p,m,g,b,x]),(0,o.useEffect)((function(){if(t)return A(t,M.current,W.current),function(){z()}}),[z,A,t]);var F=(0,o.useMemo)((function(){var t;return null!==(t=e.cursor)&&void 0!==t?t:I}),[e.cursor,I]),G=(0,o.useMemo)((function(){return ee(ee({},te),{cursor:F})}),[F]);return r().createElement("div",ee({},C,{ref:W,style:G}),t&&r().createElement("canvas",ee({},P,{key:t,ref:M,"data-sketchweb-all-images-ready":O,"data-testid":"sketchweb-canvas","data-sketchweb-status":"sketchweb-status-"+((null==_?void 0:_.type.toLowerCase())||"null"),style:ne})),"READY"===(null==_?void 0:_.type)&&y)},function(e){var t=e.injectedStyles,n=e.useShadowRoot,o=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(e,["injectedStyles","useShadowRoot"]);return n?r().createElement(Q,{injectedStyles:t},r().createElement(g,K({},o))):r().createElement(g,K({},o))}),re=n(946);!function(e){e.Draggable="grab",e.Dragging="grabbing",e.Hover="pointer",e.Default="auto"}(b||(b={}));var ie,ae,se,ue,ce,le,de,he,fe=function(){return(fe=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},ve=function(e,t){switch(d('dispatched: "'+t.type+'"',t),t.type){case"on-status":return fe(fe({},e),{status:t.status});case"on-file-ready":return fe(fe({},e),{document:t.document});case"on-zoom":return fe(fe({},e),{zoom:t.zoom});case"on-pan":return fe(fe({},e),{pan:t.pan});case"dispose":return fe(fe({},e),{status:null,zoom:null,pan:null,cursor:b.Default});case"post-init":return fe(fe({},e),{status:t.status,zoom:t.zoom});case"on-camera-zoom-start":return fe(fe({},e),{isCameraZooming:!0});case"on-camera-zoom-end":return fe(fe({},e),{isCameraZooming:!1});case"on-camera-move-start":return fe(fe({},e),{cursor:e.isMouseDown?b.Dragging:b.Draggable,isCameraMoving:!0});case"on-camera-move-end":return fe(fe({},e),{isCameraMoving:!1});case"on-mouse-down":return fe(fe({},e),{cursor:b.Dragging,isMouseDown:!0});case"on-mouse-up":return fe(fe({},e),{cursor:b.Draggable,isMouseDown:!1});default:return e}},pe=function(){return(pe=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},me=function(e){var t=e.children,n=(0,o.useRef)(null),i=(0,o.useRef)(null),a=(0,o.useReducer)(ve,{pan:null,zoom:null,status:null,document:null,isCameraZooming:!1,isCameraMoving:!1,cursor:b.Default,isMouseDown:!1}),u=a[0],c=u.status,l=u.document,h=u.zoom,f=u.pan,v=u.isCameraZooming,p=u.isCameraMoving,m=u.cursor,g=a[1],S=(0,o.useCallback)((function(e){return g({type:"on-zoom",zoom:e})}),[]),M=(0,o.useCallback)((function(e,t){return g({type:"on-pan",pan:{x:e,y:t}})}),[]),W=(0,o.useCallback)((function(e){g({type:"on-status",status:e})}),[]),L=(0,o.useCallback)((function(e){g({type:"on-file-ready",document:e})}),[]),D=(0,o.useCallback)((function(){return g({type:"on-mouse-down"})}),[]),O=(0,o.useCallback)((function(){return g({type:"on-mouse-up"})}),[]),Z=(0,o.useCallback)((function(){return g({type:"on-camera-zoom-start"})}),[]),R=(0,o.useCallback)((function(){return g({type:"on-camera-zoom-end"})}),[]),T=(0,o.useCallback)((function(){return g({type:"on-camera-move-start"})}),[]),z=(0,o.useCallback)((function(){return g({type:"on-camera-move-end"})}),[]),A=(0,o.useCallback)((function(){var e=n.current;e&&(d("dispose"),e.off("status",W),e.off("fileReady",L),e.off("zoom",S),e.off("pan",M),e.gestureManager.off("mousedown",D),e.gestureManager.off("mouseup",O),e.gestureManager.off("zoomStart",Z),e.gestureManager.off("zoomEnd",R),e.gestureManager.off("cameraMoveStart",T),e.gestureManager.off("cameraMoveEnd",z),e.dispose(),n.current=null,g({type:"dispose"}))}),[W,L,M,S,O,D,Z,R,T,z]),j=(0,o.useCallback)((function(e,t,o){if(""!==e&&t&&o&&i.current){d("init");var r=new re.d(pe(pe({},i.current),{filePath:e,container:o,canvas:t}));r.on("status",W),r.on("fileReady",L),r.on("zoom",S),r.on("pan",M),r.gestureManager.on("mousedown",D),r.gestureManager.on("mouseup",O),r.gestureManager.on("zoomStart",Z),r.gestureManager.on("zoomEnd",R),r.gestureManager.on("cameraMoveStart",T),r.gestureManager.on("cameraMoveEnd",z),a=void 0,s=void 0,c=function(){var e,t;return function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}(this,(function(n){switch(n.label){case 0:return e=g,t={type:"post-init"},[4,r.getZoom()];case 1:return t.zoom=n.sent()||null,[4,r.getStatus()];case 2:return t.status=n.sent()||null,[4,r.getPan()];case 3:return e.apply(void 0,[(t.pan=n.sent()||null,t)]),[2]}}))},new((u=void 0)||(u=Promise))((function(e,t){function n(e){try{r(c.next(e))}catch(e){t(e)}}function o(e){try{r(c.throw(e))}catch(e){t(e)}}function r(t){var r;t.done?e(t.value):(r=t.value,r instanceof u?r:new u((function(e){e(r)}))).then(n,o)}r((c=c.apply(a,s||[])).next())})),n.current=r}var a,s,u,c}),[W,L,S,M,D,O,Z,R,T,z]),I=(0,o.useCallback)((function(e){var t;d("setSettings",e),e.backgroundColor&&(null===(t=n.current)||void 0===t||t.setBackgroundColor(e.backgroundColor)),i.current=e}),[]),_=(0,o.useCallback)((function(){return n.current}),[]),F=(0,o.useMemo)((function(){return{dispose:A,init:j,setSettings:I,getManager:_,dispatch:g}}),[A,j,I,_]);return r().createElement(s.Provider,{value:F},r().createElement(y.Provider,{value:c},r().createElement(w.Provider,{value:l},r().createElement(C.Provider,{value:h},r().createElement(E.Provider,{value:f},r().createElement(k.Provider,{value:v},r().createElement(P.Provider,{value:p},r().createElement(x.Provider,{value:m},t))))))))},ge=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},be=$().div(ie||(ie=ge(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n"],["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n"]))),ye=$().div(ae||(ae=ge(["\n position: absolute;\n top: 0;\n left: 0;\n transform-origin: top left;\n"],["\n position: absolute;\n top: 0;\n left: 0;\n transform-origin: top left;\n"]))),we=function(e){var t=e.document,n=e.children,o=L()||{x:0,y:0},i=W()||1,a=Z(),s=O();return r().createElement(ye,{style:{willChange:a?"transform, width, height":"",pointerEvents:a?"none":"auto",width:t.bounds.width*i+"px",height:t.bounds.height*i+"px",transform:"translate3d("+o.x*i+"px, "+o.y*i+"px, 0)",display:s?"none":"block"}},n)},Ce=function(){return(Ce=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},ke=function(e){var t=e.children,n=e.onClick,o=M();return o?r().createElement(be,Ce({},h(n)),r().createElement(we,{document:o},t)):null},Pe=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},Ee=$().div(se||(se=Pe(["\n position: absolute;\n box-sizing: border-box;\n cursor: pointer;\n\n // Just some default font styles\n font-size: 12px;\n font-style: normal;\n font-family: sans-serif;\n\n font: ",";\n\n ","\n"],["\n position: absolute;\n box-sizing: border-box;\n cursor: pointer;\n\n // Just some default font styles\n font-size: 12px;\n font-style: normal;\n font-family: sans-serif;\n\n font: ",";\n\n ","\n"])),(function(e){return e.font}),(function(e){return e.selected?"box-shadow: 0 0 0 4px "+e.outlineColor+";":"\n &:hover {\n box-shadow: 0 0 0 2px "+e.outlineColor+";\n }\n "})),xe=$().div(ue||(ue=Pe(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: auto;\n padding: 0 0 6px 0;\n transform: translateY(-100%);\n display: flex;\n pointer-events: none;\n visibility: ",";\n align-items: center;\n"],["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: auto;\n padding: 0 0 6px 0;\n transform: translateY(-100%);\n display: flex;\n pointer-events: none;\n visibility: ",";\n align-items: center;\n"])),(function(e){return e.visible?"visible":"hidden"})),Se=$().span(ce||(ce=Pe(["\n position: relative;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n user-select: none;\n pointer-events: auto;\n color: ",";\n"],["\n position: relative;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n user-select: none;\n pointer-events: auto;\n color: ",";\n"])),(function(e){return e.textColor})),Me=$().button(le||(le=Pe(["\n position: relative;\n white-space: nowrap;\n margin-right: 0;\n margin-left: auto;\n align-items: center;\n pointer-events: auto;\n display: ",";\n font: inherit;\n"],["\n position: relative;\n white-space: nowrap;\n margin-right: 0;\n margin-left: auto;\n align-items: center;\n pointer-events: auto;\n display: ",";\n font: inherit;\n"])),(function(e){return e.visible?"flex":"none"})),We=$().span(de||(de=Pe(["\n color: ",";\n display: ",";\n font: inherit;\n"],["\n color: ",";\n display: ",";\n font: inherit;\n"])),(function(e){return e.textColor}),(function(e){return e.visible?"initial":"none"})),Le=$().span(he||(he=Pe(["\n position: relative;\n width: 14px;\n height: 14px;\n margin-left: 4px;\n"],["\n position: relative;\n width: 14px;\n height: 14px;\n margin-left: 4px;\n"])));function De(){return r().createElement(Le,null,r().createElement("svg",{viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},r().createElement("g",{fill:"none",fillRule:"evenodd"},r().createElement("path",{d:"M6.755 0h.49c1.55 0 2.708.278 3.686.801a5.452 5.452 0 0 1 2.268 2.268c.523.978.801 2.136.801 3.686v.49c0 1.55-.278 2.708-.801 3.686a5.452 5.452 0 0 1-2.268 2.268c-.978.523-2.136.801-3.686.801h-.49c-1.55 0-2.708-.278-3.686-.801A5.452 5.452 0 0 1 .801 10.93C.278 9.953 0 8.795 0 7.245v-.49c0-1.55.278-2.708.801-3.686A5.452 5.452 0 0 1 3.07.801C4.047.278 5.205 0 6.755 0Z",fillOpacity:".083",fill:"#000",fillRule:"nonzero"}),r().createElement("path",{strokeOpacity:".55",stroke:"#000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 9.5 10 7 7.5 4.5M8.5 7H4"}))))}var Oe=function(){return(Oe=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},Ze=r().forwardRef((function(e,t){var n,i=e.document,a=e.artboard,s=e.selected,u=e.onClick,c=e.onDoubleClick,l=e.onCTAClick,d=e.font,f=e.outlineColor,v=e.nameTextColor,p=e.ctaTextColor,m=e.ctaText,g=null!==(n=W())&&void 0!==n?n:1,b=a.bounds.width*g,y=b>100,w=b>160,C=(0,o.useMemo)((function(){var e=a.bounds,t=i.bounds;return{x:(e.x-t.x)/t.width*100,y:(e.y-t.y)/t.height*100,width:e.width/t.width*100,height:e.height/t.height*100}}),[a.bounds,i.bounds]),k=C.x,P=C.y,E=C.width,x=C.height;return r().createElement(Ee,Oe({ref:t,selected:s,font:d,outlineColor:f},h((function(e){null==u||u(a,e)})),{onDoubleClick:function(e){null==c||c(a,e)},style:{left:k+"%",top:P+"%",width:E+"%",height:x+"%"}}),r().createElement(xe,{visible:y},r().createElement(Se,{textColor:v},a.name),r().createElement(Me,Oe({visible:s},h((function(e){null==l||l(a,e)}))),r().createElement(We,{textColor:p,visible:w},m),r().createElement(De,null))))}));Ze.displayName="Artboard";var Re=function(){return(Re=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},Te=function(e){var t=e.artboardStyle,n=e.onGoToArtboard,i=M(),a=(0,o.useState)(null),s=a[0],u=a[1],c=(0,o.useRef)({});function l(e,t){u(e.objectId)}function d(e){null==n||n(e.objectId,"doubleClick")}function h(e){null==n||n(e.objectId,"CTA")}return(0,o.useEffect)((function(){function e(e){"Enter"===e.key&&s&&(null==n||n(s,"keyPressEnter"))}return window.document.body.addEventListener("keypress",e),function(){window.document.body.removeEventListener("keypress",e)}}),[n,s]),i?r().createElement(ke,{onClick:function(e){var t;for(var n in c.current)if(null===(t=c.current[n])||void 0===t?void 0:t.contains(e.target))return;u(null)}},i.artboards.map((function(e){return r().createElement(Ze,Re({ref:function(t){return c.current[e.objectId]=t},key:e.objectId,selected:s===e.objectId,onClick:l,onDoubleClick:d,onCTAClick:h,artboard:e,document:i},t))}))):null}},758:(e,t,n)=>{"use strict";n.d(t,{k:()=>i});var o,r=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(n,o,r){var i=this.constructor,a=e.call(this,"("+n+") "+o)||this;return a.code=n,a.cause=r,a.name=t.name,Object.setPrototypeOf(a,i.prototype),a}return r(t,e),t}(Error)},18:()=>{},689:()=>{},332:(e,t,n)=>{"use strict";var o;n.d(t,{p:()=>o}),function(e){e.debug="debug",e.release="release"}(o||(o={}))},119:()=>{},650:()=>{},312:()=>{},552:(e,t,n)=>{"use strict";n.d(t,{v:()=>o});var o=function(){function e(){this.listeners={}}return e.prototype.on=function(e,t){var n,o;this.listeners[e]=null!==(n=this.listeners[e])&&void 0!==n?n:new Set,null===(o=this.listeners[e])||void 0===o||o.add(t)},e.prototype.off=function(e,t){var n;null===(n=this.listeners[e])||void 0===n||n.delete(t)},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var o=this.listeners[e];(null==o?void 0:o.size)&&o.forEach((function(e){Promise.resolve().then((function(){e.apply(void 0,t)}))}))},e}()},354:(e,t,n)=>{"use strict";n.d(t,{v:()=>o.v});var o=n(552)},849:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,r++)o[r]=i[a];return o};const r=new(function(){function e(){this.active=!0}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.active&&console.debug.apply(console,o(["[SketchWeb] [Debug]"],e))},e.prototype.warning=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.active&&console.warn.apply(console,o(["[SketchWeb] [Warn]"],e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.error.apply(console,o(["[SketchWeb] [Error]"],e))},e}())},108:(e,t,n)=>{"use strict";n.d(t,{S:()=>r});var o=n(849),r=function(){function e(e){this.label=e,this.startTime=performance.now(),this.startTimestamp=Date.now(),o.Z.debug("[Performance] Start: "+this.label)}return e.prototype.measure=function(){return{duration:performance.now()-this.startTime,end:Date.now(),start:this.startTimestamp,id:this.label}},e.prototype.printMeasurement=function(){var e=this.measure().duration;if(e<1e3){var t=e.toFixed(2);o.Z.debug("[Performance] End: "+this.label+" -> "+t+" ms")}else{var n=(e/1e3).toFixed(2);o.Z.debug("[Performance] End: "+this.label+" -> "+n+" s")}},e}()},419:(e,t,n)=>{"use strict";n.d(t,{uZ:()=>o.uZ,gi:()=>o.gi,Ds:()=>o.Ds,wX:()=>o.wX,b1:()=>o.b1});var o=n(388)},388:(e,t,n)=>{"use strict";n.d(t,{Ds:()=>i,MP:()=>a,uZ:()=>s,wX:()=>u,gi:()=>c,b1:()=>l,z6:()=>d});var o=n(519),r=n(66);function i(e,t){var n;function o(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];clearTimeout(n),n=setTimeout((function(){e.apply(void 0,o)}),t)}return o.cancel=function(){n&&clearTimeout(n)},o}function a(e){var t,n,o,r,i,a,s,u;return{x:null!==(r=null!==(t=e.pageX)&&void 0!==t?t:null===(o=null===(n=e.touches)||void 0===n?void 0:n[0])||void 0===o?void 0:o.pageX)&&void 0!==r?r:e.clientX,y:null!==(u=null!==(i=e.pageY)&&void 0!==i?i:null===(s=null===(a=e.touches)||void 0===a?void 0:a[0])||void 0===s?void 0:s.pageY)&&void 0!==u?u:e.clientY}}function s(e,t,n){return Math.max(t,Math.min(n,e))}function u(){return(0,r.t)()&&!o.Z.safariWebGL2?1:"undefined"!=typeof WebGL2RenderingContext?2:1}function c(e){for(var t=e.size(),n=[],o=0;o<t;++o){var r=e.get(o);n.push(r)}return n}function l(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function d(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent||void 0!==e.touches||void 0!==e.targetTouches||void 0!==e.changedTouches}},66:(e,t,n)=>{"use strict";n.d(t,{t:()=>r});var o=/(iPhone|Macintosh|iPad)(.*)(Version)\/(0|[1-9]\d*)\.(0|[1-9]\d*)\.?(0|[1-9]\d*)?/,r=function(e){if(void 0===e&&(e=window.navigator.userAgent),e.includes("Chrome/")||e.includes("Chromium/")||e.includes("Opera/")||e.includes("Firefox/"))return null;var t=e.match(o);if(!t)return null;var n=t[1];return"Macintosh"!==n&&"iPad"!==n&&"iPhone"!==n?null:{hardware:n,version:{major:parseInt(t[4])||0,minor:parseInt(t[5])||0,patch:parseInt(t[6])||0}}}},297:t=>{"use strict";t.exports=e},268:e=>{"use strict";e.exports=t},914:e=>{"use strict";e.exports=n}},u={};function c(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return s[e](n,n.exports,c),n.exports}c.m=s,c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);c.r(n);var i={};o=o||[null,r({}),r([]),r(r)];for(var a=2&t&&e;"object"==typeof a&&!~o.indexOf(a);a=r(a))Object.getOwnPropertyNames(a).forEach((t=>i[t]=()=>e[t]));return i.default=()=>e,c.d(n,i),n},c.d=(e,t)=>{for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce(((t,n)=>(c.f[n](e,t),t)),[])),c.u=e=>"static/js/web-renderer-"+{610:"17fd55cdb979ed59dbc9",667:"a0852e681d80b27f4541",706:"b584c7152f956c9cbea5"}[e]+".chunk.js",c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},a="@sketch-hq/sketch-web-renderer:",c.l=(e,t,n,o)=>{if(i[e])i[e].push(t);else{var r,s;if(void 0!==n)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var d=u[l];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==a+n){r=d;break}}r||(s=!0,(r=document.createElement("script")).charset="utf-8",r.timeout=120,c.nc&&r.setAttribute("nonce",c.nc),r.setAttribute("data-webpack",a+n),r.src=e),i[e]=[t];var h=(t,n)=>{r.onerror=r.onload=null,clearTimeout(f);var o=i[e];if(delete i[e],r.parentNode&&r.parentNode.removeChild(r),o&&o.forEach((e=>e(n))),t)return t(n)},f=setTimeout(h.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=h.bind(null,r.onerror),r.onload=h.bind(null,r.onload),s&&document.head.appendChild(r)}},c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.p="/",(()=>{c.b=document.baseURI||self.location.href;var e={826:0};c.f.j=(t,n)=>{var o=c.o(e,t)?e[t]:void 0;if(0!==o)if(o)n.push(o[2]);else{var r=new Promise(((n,r)=>o=e[t]=[n,r]));n.push(o[2]=r);var i=c.p+c.u(t),a=new Error;c.l(i,(n=>{if(c.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var r=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+r+": "+i+")",a.name="ChunkLoadError",a.type=r,a.request=i,o[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var o,r,[i,a,s]=n,u=0;if(i.some((t=>0!==e[t]))){for(o in a)c.o(a,o)&&(c.m[o]=a[o]);s&&s(c)}for(t&&t(n);u<i.length;u++)r=i[u],c.o(e,r)&&e[r]&&e[r][0](),e[i[u]]=0},n=self.webpackChunk_sketch_hq_sketch_web_renderer=self.webpackChunk_sketch_hq_sketch_web_renderer||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var l={};return(()=>{"use strict";c.r(l),c.d(l,{default:()=>v,DefaultFeatureFlags:()=>p,SketchWeb:()=>n.U,SketchWebMode:()=>a.p,SketchWebError:()=>u.k,ArtboardsInfoOverlay:()=>f.j4,Overlay:()=>f.aV,SketchWebProvider:()=>f.z0,SketchWebReact:()=>f.oW,useCursor:()=>f.jr,useDecrementZoom:()=>f.tm,useDocument:()=>f.ky,useEvent:()=>f.zX,useGenerateDocumentPNG:()=>f.ex,useGetArtboardAtPosititon:()=>f.Jw,useGetPanAtPosition:()=>f.m_,useIncrementZoom:()=>f.Yy,useIsCameraMoving:()=>f.d6,useIsCameraZooming:()=>f.aP,useLockCamera:()=>f.EY,useLooseWebGLContext:()=>f.pt,usePan:()=>f.od,useSetPan:()=>f.ph,useSetZoom:()=>f.lt,useStatus:()=>f.$z,useZoom:()=>f.BO,useZoomToFit:()=>f.us});var e=c(946),t=c(519),n=c(475),o=c(18),r={};for(const e in o)["default","DefaultFeatureFlags","SketchWeb"].indexOf(e)<0&&(r[e]=()=>o[e]);c.d(l,r);var i=c(119);r={};for(const e in i)["default","DefaultFeatureFlags","SketchWeb"].indexOf(e)<0&&(r[e]=()=>i[e]);c.d(l,r);var a=c(332),s=c(312);r={};for(const e in s)["default","DefaultFeatureFlags","SketchWeb","SketchWebMode"].indexOf(e)<0&&(r[e]=()=>s[e]);c.d(l,r);var u=c(758),d=c(689);r={};for(const e in d)["default","DefaultFeatureFlags","SketchWeb","SketchWebMode","SketchWebError"].indexOf(e)<0&&(r[e]=()=>d[e]);c.d(l,r);var h=c(650);r={};for(const e in h)["default","DefaultFeatureFlags","SketchWeb","SketchWebMode","SketchWebError"].indexOf(e)<0&&(r[e]=()=>h[e]);c.d(l,r);var f=c(550);const v=e.d;var p=t.Z})(),l})()}));
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"));else if("function"==typeof define&&define.amd)define(["react"],t);else{var n="object"==typeof exports?t(require("react")):t(e.react);for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(self,(function(e){return(()=>{var t,n,o,r,i={975:(e,t,n)=>{"use strict";function o(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((o=o.apply(e,t||[])).next())}))}n.d(t,{M:()=>f});const r=["geforce 320m","geforce 8600","geforce 8600m gt","geforce 8800 gs","geforce 8800 gt","geforce 9400","geforce 9400m g","geforce 9400m","geforce 9600m gt","geforce 9600m","geforce fx go5200","geforce gt 120","geforce gt 130","geforce gt 330m","geforce gtx 285","google swiftshader","intel g41","intel g45","intel gma 4500mhd","intel gma x3100","intel hd 3000","intel q45","legacy","mali-2","mali-3","mali-4","quadro fx 1500","quadro fx 4","quadro fx 5","radeon hd 2400","radeon hd 2600","radeon hd 4670","radeon hd 4850","radeon hd 4870","radeon hd 5670","radeon hd 5750","radeon hd 6290","radeon hd 6300","radeon hd 6310","radeon hd 6320","radeon hd 6490m","radeon hd 6630m","radeon hd 6750m","radeon hd 6770m","radeon hd 6970m","sgx 543","sgx543"];function i(e){return e.toLowerCase().replace(/^angle ?\((.+)\)*$/,"$1").replace(/\s(\d{1,2}gb|direct3d.+$)|\(r\)| \([^)]+\)$/g,"")}const a="undefined"==typeof window,s=(()=>{if(a)return;const{userAgent:e,platform:t,maxTouchPoints:n}=window.navigator,o=/(iphone|ipod|ipad)/i.test(e),r="iPad"===t||"MacIntel"===t&&n>0&&!window.MSStream;return{isIpad:r,isMobile:/android/i.test(e)||o||r,isSafari12:/Version\/12.+Safari/.test(e)}})(),u=[],c=[];function l(e,t){if(e===t)return 0;const n=e;e.length>t.length&&(e=t,t=n);let o=e.length,r=t.length;for(;o>0&&e.charCodeAt(~-o)===t.charCodeAt(~-r);)o--,r--;let i,a=0;for(;a<o&&e.charCodeAt(a)===t.charCodeAt(a);)a++;if(o-=a,r-=a,0===o)return r;let s,l,d=0,h=0,f=0;for(;h<o;)c[h]=e.charCodeAt(a+h),u[h]=++h;for(;f<r;)for(i=t.charCodeAt(a+f),s=f++,d=f,h=0;h<o;h++)l=i===c[h]?s:s+1,s=u[h],d=u[h]=s>d?l>d?d+1:l:l>s?s+1:l;return d}function d(e){return null!=e}class h extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}const f=({mobileTiers:e=[0,15,30,60],desktopTiers:t=[0,15,30,60],override:n={},glContext:u,failIfMajorPerformanceCaveat:c=!1,benchmarksURL:f="https://unpkg.com/detect-gpu@4.0.37/dist/benchmarks"}={})=>o(void 0,void 0,void 0,(function*(){const v={};if(a)return{tier:0,type:"SSR"};const{isIpad:m=!!(null==s?void 0:s.isIpad),isMobile:p=!!(null==s?void 0:s.isMobile),screenSize:g=window.screen,loadBenchmarks:b=(e=>o(void 0,void 0,void 0,(function*(){const t=yield fetch(`${f}/${e}`).then((e=>e.json()));if(parseInt(t.shift().split(".")[0],10)<4)throw new h("Detect GPU benchmark data is out of date. Please update to version 4x");return t})))}=n;let{renderer:y}=n;const w=(e,t,n,o,r)=>({device:r,fps:o,gpu:n,isMobile:p,tier:e,type:t});let C,k="";if(y)y=i(y),C=[y];else{const e=u||function(e,t=!1){const n={alpha:!1,antialias:!1,depth:!1,failIfMajorPerformanceCaveat:t,powerPreference:"high-performance",stencil:!1};e&&delete n.powerPreference;const o=window.document.createElement("canvas"),r=o.getContext("webgl",n)||o.getContext("experimental-webgl",n);return null!=r?r:void 0}(null==s?void 0:s.isSafari12,c);if(!e)return w(0,"WEBGL_UNSUPPORTED");const t=e.getExtension("WEBGL_debug_renderer_info");if(t&&(y=e.getParameter(t.UNMASKED_RENDERER_WEBGL)),!y)return w(1,"FALLBACK");k=y,y=i(y),C=function(e,t,n){return"apple gpu"===t?function(e,t,n){if(!n)return[t];const o=function(e){const t=e.createShader(35633),n=e.createShader(35632),o=e.createProgram();if(!(n&&t&&o))return;e.shaderSource(t,"\n precision highp float;\n attribute vec3 aPosition;\n varying float vvv;\n void main() {\n vvv = 0.31622776601683794;\n gl_Position = vec4(aPosition, 1.0);\n }\n "),e.shaderSource(n,"\n precision highp float;\n varying float vvv;\n void main() {\n vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * vvv;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n gl_FragColor = enc;\n }\n "),e.compileShader(t),e.compileShader(n),e.attachShader(o,t),e.attachShader(o,n),e.linkProgram(o),e.detachShader(o,t),e.detachShader(o,n),e.deleteShader(t),e.deleteShader(n),e.useProgram(o);const r=e.createBuffer();e.bindBuffer(34962,r),e.bufferData(34962,new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),35044);const i=e.getAttribLocation(o,"aPosition");e.vertexAttribPointer(i,3,5126,!1,0,0),e.enableVertexAttribArray(i),e.clearColor(1,1,1,1),e.clear(16384),e.viewport(0,0,1,1),e.drawArrays(4,0,3);const a=new Uint8Array(4);return e.readPixels(0,0,1,1,6408,5121,a),e.deleteProgram(o),e.deleteBuffer(r),a.join("")}(e),r="801621810",i="8016218135",a="80162181161",u=(null==s?void 0:s.isIpad)?[["a7",a,12],["a8",i,15],["a8x",i,15],["a9",i,15],["a9x",i,15],["a10",i,15],["a10x",i,15],["a12",r,15],["a12x",r,15],["a12z",r,15],["a14",r,15],["m1",r,15]]:[["a7",a,12],["a8",i,12],["a9",i,15],["a10",i,15],["a11",r,15],["a12",r,15],["a13",r,15],["a14",r,15]];let c;return"80162181255"===o?c=u.filter((([,,e])=>e>=14)):(c=u.filter((([,e])=>e===o)),c.length||(c=u)),c.map((([e])=>`apple ${e} gpu`))}(e,t,n):[t]}(e,y,p)}const P=(yield Promise.all(C.map((function(e){var t;return o(this,void 0,void 0,(function*(){const n=(e=>{const t=p?["adreno","apple","mali-t","mali","nvidia","powervr"]:["intel","apple","amd","radeon","nvidia","geforce"];for(const n of t)if(e.includes(n))return n})(e);if(!n)return;const o=`${p?"m":"d"}-${n}${m?"-ipad":""}.json`,r=v[o]=null!==(t=v[o])&&void 0!==t?t:b(o);let i;try{i=yield r}catch(n){if(n instanceof h)throw n;return}const a=function(e){var t;const n=(e=e.replace(/\([^)]+\)/,"")).match(/\d+/)||e.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);return null!==(t=null==n?void 0:n.join("").replace(/\W|amd/g,""))&&void 0!==t?t:""}(e);let s=i.filter((([,e])=>e===a));s.length||(s=i.filter((([t])=>t.includes(e))));const u=s.length;if(0===u)return;let c,[d,,,f]=u>1?s.map((t=>[t,l(e,t[0])])).sort((([,e],[,t])=>e-t))[0][0]:s[0],y=Number.MAX_VALUE;const{devicePixelRatio:w}=window,C=g.width*w*g.height*w;for(const e of f){const[t,n]=e,o=t*n,r=Math.abs(C-o);r<y&&(y=r,c=e)}if(!c)return;const[,,k,P]=c;return[y,k,d,P]}))})))).filter(d).sort((([e=Number.MAX_VALUE,t],[n=Number.MAX_VALUE,o])=>e===n?t-o:e-n));if(!P.length){const e=r.find((e=>y.includes(e)));return e?w(0,"BLOCKLISTED",e):w(1,"FALLBACK",`${y} (${k})`)}const[,E,W,M]=P[0];if(-1===E)return w(0,"BLOCKLISTED",W,E,M);const S=p?e:t;let x=0;for(let e=0;e<S.length;e++)E>=S[e]&&(x=e);return w(x,"BENCHMARK",W,E,M)}))},519:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const o={delayedDraw:!0,useNewTiledRenderer:!0,offscreenCanvas:!1,safariWebGL2:!1,pageBoundariesLimit:!1}},946:(e,t,n)=>{"use strict";n.d(t,{d:()=>B});var o,r=n(354),i=function(){function e(){this.removeListenerCallbacks=[]}return e.prototype.add=function(e,t,n,o){e.addEventListener(t,n,o);var r=function(){e.removeEventListener(t,n,o)};return this.removeListenerCallbacks.push(r),r},e.prototype.dispose=function(){this.removeListenerCallbacks.forEach((function(e){return e()}))},e}(),a=n(388),s=function(){function e(e,t){var n=this;this.cameraMoveState={status:"inactive"},this.endInteractionDebounced=(0,a.Ds)((function(){"inactive"!==n.cameraMoveState.status&&("moving"===n.cameraMoveState.status&&n.onCameraMoveEnd(),n.setCameraMoveStatus("inactive"))}),100),this.onCameraMoveStart=e,this.onCameraMoveEnd=t}return e.prototype.dispose=function(){this.endInteractionDebounced.cancel(),this.cameraMoveState={status:"inactive"}},e.prototype.handleCameraMoveEvent=function(){var e;this.endInteractionDebounced(),"inactive"===this.cameraMoveState.status&&this.setCameraMoveStatus("uncertain"),"uncertain"===this.cameraMoveState.status&&(e=this.cameraMoveState,Date.now()-e.interactionStartTimestamp>=20)&&(this.onCameraMoveStart(),this.setCameraMoveStatus("moving"))},e.prototype.setCameraMoveStatus=function(e){this.cameraMoveState="uncertain"===e?{status:"uncertain",interactionStartTimestamp:Date.now()}:{status:e}},e}(),u=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),c=function(){return(c=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},l=function(e){function t(t,n){var o=e.call(this)||this;return o.listenersCollector=new i,o.state={panning:!1,zooming:!1,pinchToZoomLastDistance:0,lastPan:{x:0,y:0},zoomCenter:{x:0,y:0},lastGestureScale:1,mouse:{x:0,y:0},isCameraLocked:!1,isWaitingForSecondClick:!1,lastMouseClickPosition:{x:0,y:0}},o.handleGestureStart=function(e){e.preventDefault(),o.state.isCameraLocked||(o.state.lastGestureScale=e.scale,o.emitZoomStartEvent())},o.handleGestureChange=function(e){if(e.preventDefault(),!o.state.isCameraLocked){o.state.zoomCenter=o.getCorrectPointerPosition(e);var t=e.scale/o.state.lastGestureScale;o.state.lastGestureScale=e.scale,o.emitZoomEvent(t,o.state.zoomCenter,!1),o.cameraMoveTracker.handleCameraMoveEvent()}},o.handleGestureEnd=function(e){e.preventDefault(),o.emitZoomEndEvent()},o.handlePointerDown=function(e){(e instanceof MouseEvent&&0===e.button||(0,a.z6)(e))&&(e.preventDefault(),o.updateMousePosition(e),o.handlePanStart(),o.handleTouchPinchToZoomStart(e),o.emit("mousedown"))},o.handlePanStart=function(){o.state.panning=!0,o.state.lastPan.x=o.state.mouse.x,o.state.lastPan.y=o.state.mouse.y},o.handleTouchPinchToZoomStart=function(e){var t;if(e.touches&&!((null===(t=e.touches)||void 0===t?void 0:t.length)<2)){o.emitZoomStartEvent();var n=e.touches[0],r=e.touches[1];o.state.pinchToZoomLastDistance=Math.hypot(n.clientX-r.clientX,n.clientY-r.clientY)}},o.handlePointerMove=function(e){(0,a.z6)(e)&&o.handleTouchPinchToZoomChange(e),o.state.panning||o.updateMousePosition(e)},o.handleTouchPinchToZoomChange=function(e){var t;if(e.touches&&!((null===(t=e.touches)||void 0===t?void 0:t.length)<2)){var n=e.touches[0],r=e.touches[1],i=Math.hypot(n.clientX-r.clientX,n.clientY-r.clientY),a=o.clampPointerToTargetBounds({x:(n.clientX+r.clientX)/2,y:(n.clientY+r.clientY)/2}),s=i/Math.max(o.state.pinchToZoomLastDistance,1);o.state.pinchToZoomLastDistance=i,o.emitZoomEvent(s,a,!1)}},o.handlePanMove=function(e){if(o.state.panning&&!o.state.isCameraLocked){var t=o.getCorrectPointerPosition(e),n=o.state.lastPan.x-t.x,r=o.state.lastPan.y-t.y;o.state.lastPan.x=t.x,o.state.lastPan.y=t.y,o.emit("panChange",-n,-r),o.cameraMoveTracker.handleCameraMoveEvent()}},o.handleDoubleClick=function(e){if(!("undefined"!=typeof TouchEvent&&e instanceof TouchEvent&&e.touches.length>0)){var t=o.getCorrectPointerPosition(e),n=Math.hypot(o.state.lastMouseClickPosition.x-t.x,o.state.lastMouseClickPosition.y-t.y)>("undefined"!=typeof TouchEvent&&e instanceof TouchEvent?15:0);if(!o.state.isWaitingForSecondClick||n)return o.state.isWaitingForSecondClick=!0,o.state.lastMouseClickPosition=o.getCorrectPointerPosition(e),void o.resetDoubleClick();o.state.isWaitingForSecondClick=!1,o.emit("doubleClick")}},o.resetDoubleClick=(0,a.Ds)((function(){o.state.isWaitingForSecondClick=!1}),500),o.handlePanEnd=function(){o.state.panning=!1},o.handlePointerUp=function(e){var t;o.handleTouchPinchToZoomEnd(e),(null===(t=e.touches)||void 0===t?void 0:t.length)>1||o.emit("mouseup")},o.handleTouchPinchToZoomEnd=function(e){var t;(null===(t=e.touches)||void 0===t?void 0:t.length)>2||o.emitZoomEndEvent()},o.handleMouseWheel=function(e){if(e.preventDefault(),!o.state.isCameraLocked){var t=e.metaKey||e.ctrlKey;if(o.updateMousePosition(e),t){var n=e.ctrlKey?-1:1;o.state.zoomCenter=o.getCorrectPointerPosition(e);var r=1+.01*e.deltaY*n;o.emitZoomEvent(r,o.state.zoomCenter)}else o.emit("panChange",-e.deltaX,-e.deltaY);o.cameraMoveTracker.handleCameraMoveEvent()}},o.emitZoomEndEvent=(0,a.Ds)((function(){o.state.zooming&&(o.state.zooming=!1,o.emit("zoomEnd"))}),90),o.handleCameraMoveStart=function(){o.emit("cameraMoveStart")},o.handleCameraMoveEnd=function(){o.emit("cameraMoveEnd")},o.target=t,o.settings=n,o.targetBounds=t.getBoundingClientRect(),o.addListeners(),o.cameraMoveTracker=new s(o.handleCameraMoveStart,o.handleCameraMoveEnd),o}return u(t,e),t.prototype.updateTargetBounds=function(){this.targetBounds=this.target.getBoundingClientRect()},t.prototype.addListeners=function(){this.addTouchEventListeners(),this.addMouseEventListeners(),this.addSafariGesturesEventListeners()},t.prototype.addMouseEventListeners=function(){this.listenersCollector.add(this.target,"mousedown",this.handlePointerDown),this.listenersCollector.add(this.target,"mousemove",this.handlePointerMove),this.listenersCollector.add(document,"mousemove",this.handlePanMove),this.listenersCollector.add(this.target,"mouseup",this.handlePointerUp),this.listenersCollector.add(document,"mouseup",this.handlePanEnd),this.listenersCollector.add(this.target,"wheel",this.handleMouseWheel),this.listenersCollector.add(this.target,"mouseup",this.handleDoubleClick)},t.prototype.addTouchEventListeners=function(){this.listenersCollector.add(this.target,"touchstart",this.handlePointerDown),this.listenersCollector.add(document,"touchmove",this.handlePanMove,{passive:!0}),this.listenersCollector.add(this.target,"touchmove",this.handlePointerMove,{passive:!0}),this.listenersCollector.add(this.target,"touchend",this.handlePointerUp),this.listenersCollector.add(this.target,"touchcancel",this.handlePointerUp),this.listenersCollector.add(document,"touchend",this.handlePanEnd),this.listenersCollector.add(this.target,"touchend",this.handleDoubleClick)},t.prototype.addSafariGesturesEventListeners=function(){(0,a.b1)()||(this.listenersCollector.add(this.target,"gesturestart",this.handleGestureStart,{capture:!0}),this.listenersCollector.add(this.target,"gesturechange",this.handleGestureChange,{capture:!0}),this.listenersCollector.add(this.target,"gestureend",this.handleGestureEnd,{capture:!0}))},t.prototype.clampPointerToTargetBounds=function(e){return{x:(0,a.uZ)(e.x-this.targetBounds.x,0,this.target.clientWidth),y:(0,a.uZ)(e.y-this.targetBounds.y,0,this.target.clientHeight)}},t.prototype.getCorrectPointerPosition=function(e){var t,n={x:0,y:0};if((null===(t=e.touches)||void 0===t?void 0:t.length)>1){var o=e,r=o.touches[0],i=o.touches[1];n={x:(r.clientX+i.clientX)/2,y:(r.clientY+i.clientY)/2}}else n=(0,a.MP)(e);return this.clampPointerToTargetBounds(n)},t.prototype.updateMousePosition=function(e){this.state.mouse=this.getCorrectPointerPosition(e),this.emit("mousemove",this.state.mouse.x,this.state.mouse.y)},t.prototype.emitZoomEvent=function(e,t,n){void 0===n&&(n=!0),n&&this.emitZoomStartEvent(),this.emit("zoomChange",e,t),n&&this.emitZoomEndEvent()},t.prototype.emitZoomStartEvent=function(){this.state.zooming||(this.state.zooming=!0,this.emit("zoomStart"))},t.prototype.getMouse=function(){return c({},this.state.mouse)},t.prototype.setMouse=function(e,t){this.state.mouse.x=e,this.state.mouse.y=t,this.emit("mousemove",this.state.mouse.x,this.state.mouse.y)},t.prototype.setIsCameraLocked=function(e){this.state.isCameraLocked=e},t.prototype.getMinZoomLevel=function(){return this.settings.minimumZoomLevel},t.prototype.getMaxZoomLevel=function(){return this.settings.maximumZoomLevel},t.prototype.dispose=function(){this.listenersCollector.dispose(),this.cameraMoveTracker.dispose()},t}(r.v),d=n(475),h=n(419);const f=Symbol("Comlink.proxy"),v=Symbol("Comlink.endpoint"),m=Symbol("Comlink.releaseProxy"),p=Symbol("Comlink.thrown"),g=e=>"object"==typeof e&&null!==e||"function"==typeof e,b=new Map([["proxy",{canHandle:e=>g(e)&&e[f],serialize(e){const{port1:t,port2:n}=new MessageChannel;return y(e,t),[n,[n]]},deserialize:e=>(e.start(),C(e))}],["throw",{canHandle:e=>g(e)&&p in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function y(e,t=self){t.addEventListener("message",(function n(o){if(!o||!o.data)return;const{id:r,type:i,path:a}=Object.assign({path:[]},o.data),s=(o.data.argumentList||[]).map(L);let u;try{const t=a.slice(0,-1).reduce(((e,t)=>e[t]),e),n=a.reduce(((e,t)=>e[t]),e);switch(i){case"GET":u=n;break;case"SET":t[a.slice(-1)[0]]=L(o.data.value),u=!0;break;case"APPLY":u=n.apply(t,s);break;case"CONSTRUCT":u=S(new n(...s));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;y(e,n),u=M(t,[t])}break;case"RELEASE":u=void 0;break;default:return}}catch(e){u={value:e,[p]:0}}Promise.resolve(u).catch((e=>({value:e,[p]:0}))).then((e=>{const[o,a]=x(e);t.postMessage(Object.assign(Object.assign({},o),{id:r}),a),"RELEASE"===i&&(t.removeEventListener("message",n),w(t))}))})),t.start&&t.start()}function w(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function C(e,t){return P(e,[],t)}function k(e){if(e)throw new Error("Proxy has been released and is not useable")}function P(e,t=[],n=function(){}){let o=!1;const r=new Proxy(n,{get(n,i){if(k(o),i===m)return()=>D(e,{type:"RELEASE",path:t.map((e=>e.toString()))}).then((()=>{w(e),o=!0}));if("then"===i){if(0===t.length)return{then:()=>r};const n=D(e,{type:"GET",path:t.map((e=>e.toString()))}).then(L);return n.then.bind(n)}return P(e,[...t,i])},set(n,r,i){k(o);const[a,s]=x(i);return D(e,{type:"SET",path:[...t,r].map((e=>e.toString())),value:a},s).then(L)},apply(n,r,i){k(o);const a=t[t.length-1];if(a===v)return D(e,{type:"ENDPOINT"}).then(L);if("bind"===a)return P(e,t.slice(0,-1));const[s,u]=E(i);return D(e,{type:"APPLY",path:t.map((e=>e.toString())),argumentList:s},u).then(L)},construct(n,r){k(o);const[i,a]=E(r);return D(e,{type:"CONSTRUCT",path:t.map((e=>e.toString())),argumentList:i},a).then(L)}});return r}function E(e){const t=e.map(x);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const W=new WeakMap;function M(e,t){return W.set(e,t),e}function S(e){return Object.assign(e,{[f]:!0})}function x(e){for(const[t,n]of b)if(n.canHandle(e)){const[o,r]=n.serialize(e);return[{type:"HANDLER",name:t,value:o},r]}return[{type:"RAW",value:e},W.get(e)||[]]}function L(e){switch(e.type){case"HANDLER":return b.get(e.name).deserialize(e.value);case"RAW":return e.value}}function D(e,t,n){return new Promise((o=>{const r=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.addEventListener("message",(function t(n){n.data&&n.data.id&&n.data.id===r&&(e.removeEventListener("message",t),o(n.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:r},t),n)}))}var Z,R=n(849),T=n(519),O=n(332),z=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),A=function(e){function t(t){var n=e.call(this)||this;return n.listenersCollector=new i,n.handleKeyUp=function(e){n.emit("keyUp",e.code)},n.target=t,n.addListeners(),n}return z(t,e),t.prototype.addListeners=function(){this.listenersCollector.add(this.target,"keyup",this.handleKeyUp)},t.prototype.dispose=function(){this.listenersCollector.dispose()},t}(r.v),_=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),I=function(){return(I=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},F=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((o=o.apply(e,t||[])).next())}))},G=function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},j=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,r++)o[r]=i[a];return o};!function(e){e[e.browser=0]="browser",e[e.worker=1]="worker"}(Z||(Z={}));var B=function(e){function t(t){var n,o=e.call(this)||this;o.listenersCollector=new i,o.handleZoomStart=function(){o.emit("zoomStart")},o.handleZoomEnd=function(){o.emit("zoomEnd")},o.handleCameraMoveStart=function(){var e;null===(e=o.sketchWeb)||void 0===e||e.setIsCameraMoving(!0)},o.handleCameraMoveEnd=function(){var e;null===(e=o.sketchWeb)||void 0===e||e.setIsCameraMoving(!1)},o.handleMouseChange=function(e,t){var n;null===(n=o.sketchWeb)||void 0===n||n.setMouse(e,t)},o.handlePanChange=function(e,t){return F(o,void 0,void 0,(function(){var n;return G(this,(function(o){return null===(n=this.sketchWeb)||void 0===n||n.addPan(e,t),this.emitPanEvent(),[2]}))}))},o.handleZoomChange=function(e,t){return F(o,void 0,void 0,(function(){var n;return G(this,(function(o){return null===(n=this.sketchWeb)||void 0===n||n.addZoom(e,t),this.emitZoomEvent(),this.emitPanEvent(),[2]}))}))},o.handleCanvasResizeObserver=function(e){o.resizeCanvas(e[0].contentRect)},o.resizeCanvas=function(e){var t=e.width,n=e.height;window.requestAnimationFrame((function(){var e;o.setCanvasSize(t,n),o.gestureManager.updateTargetBounds(),null===(e=o.sketchWeb)||void 0===e||e.setSize(t,n,o.getDevicePixelRatio())}))};var r=null!==(n=t.featureFlags)&&void 0!==n?n:{};return o.featureFlags=I(I({},T.Z),r),o.settings=t,o.canvas=t.canvas,o.gestureManager=new l(o.settings.container,{minimumZoomLevel:t.minimumZoomLevel,maximumZoomLevel:t.maximumZoomLevel}),o.keyboardManager=new A(document.body),R.Z.active=t.mode===O.p.debug,o.init(),o}return _(t,e),t.prototype.init=function(){var e;return F(this,void 0,void 0,(function(){var t,n,o;return G(this,(function(r){switch(r.label){case 0:return this.setCanvasSize(this.settings.container.clientWidth,this.settings.container.clientHeight),[4,this.initSketchWeb()];case 1:return r.sent(),[4,null===(e=this.sketchWeb)||void 0===e?void 0:e.getStatus()];case 2:return"FILE_READY"!==(null==(t=r.sent())?void 0:t.type)?[2]:(n=void 0!==this.settings.initialZoom,o=void 0!==this.settings.initialPan,n||o?n?[4,this.setZoom(this.settings.initialZoom)]:[3,4]:[3,7]);case 3:r.sent(),r.label=4;case 4:return o?[4,this.setPan(this.settings.initialPan.x,this.settings.initialPan.y,this.settings.initialPan.centerPointInViewport)]:[3,6];case 5:r.sent(),r.label=6;case 6:return[3,9];case 7:return[4,this.zoomToFit()];case 8:r.sent(),r.label=9;case 9:return this.sketchWeb.startRendering(),this.addListeners(),[2]}}))}))},t.prototype.initSketchWeb=function(){return F(this,void 0,void 0,(function(){var e,t,o,r,i;return G(this,(function(a){switch(a.label){case 0:return e=this.featureFlags.offscreenCanvas&&"function"==typeof this.canvas.transferControlToOffscreen,t=I(I({},this.settings),{size:{width:this.canvas.width,height:this.canvas.height},pixelRatio:this.getDevicePixelRatio(),featureFlags:this.featureFlags}),e?(this.environment=Z.worker,R.Z.debug("Using offscreen canvas"),this.offscreenCanvas=this.canvas.transferControlToOffscreen(),this.worker=new Worker(new URL(n.p+n.u(667),n.b),{type:void 0}),o=C(this.worker),r=this,[4,new o(M(I(I({},t),{canvas:this.offscreenCanvas}),[this.offscreenCanvas]))]):[3,2];case 1:return r.sketchWeb=a.sent(),[3,3];case 2:this.environment=Z.browser,R.Z.debug("Using normal canvas"),this.sketchWeb=new d.U(t),a.label=3;case 3:return(i=this.sketchWeb).on("status",this.forwardEvent("status")),i.on("fileReady",this.forwardEvent("fileReady")),i.on("metric",this.forwardEvent("metric")),i.on("warnings",this.forwardEvent("warnings")),i.on("allImagesReady",this.forwardEvent("allImagesReady")),i.on("deviceInfo",this.forwardEvent("deviceInfo")),[4,this.sketchWeb.init()];case 4:return a.sent(),[2]}}))}))},t.prototype.forwardEvent=function(e){var t=this,n=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];t.emit.apply(t,j([e],n))};return this.environment===Z.worker?S(n):n},t.prototype.isRunningInsideWorker=function(){return this.environment===Z.worker},t.prototype.looseWebGLContext=function(){var e;null===(e=this.sketchWeb)||void 0===e||e.looseWebGLContext()},t.prototype.addListeners=function(){this.canvasResizeObserver=new ResizeObserver(this.handleCanvasResizeObserver),this.canvasResizeObserver.observe(this.settings.container),this.listenersCollector.add(window,"orientationchange",this.handleDeviceOrientationChange),this.gestureManager.on("panChange",this.handlePanChange),this.gestureManager.on("mousemove",this.handleMouseChange),this.gestureManager.on("zoomChange",this.handleZoomChange),this.gestureManager.on("zoomStart",this.handleZoomStart),this.gestureManager.on("zoomEnd",this.handleZoomEnd),this.gestureManager.on("cameraMoveStart",this.handleCameraMoveStart),this.gestureManager.on("cameraMoveEnd",this.handleCameraMoveEnd)},t.prototype.emitPanEvent=function(){var e;return F(this,void 0,void 0,(function(){var t;return G(this,(function(n){switch(n.label){case 0:return[4,null===(e=this.sketchWeb)||void 0===e?void 0:e.getPan()];case 1:return(t=n.sent())?(this.emit("pan",t.x,t.y),[2]):[2]}}))}))},t.prototype.emitZoomEvent=function(){var e;return F(this,void 0,void 0,(function(){var t;return G(this,(function(n){switch(n.label){case 0:return[4,null===(e=this.sketchWeb)||void 0===e?void 0:e.getZoom()];case 1:return void 0===(t=n.sent())||this.emit("zoom",t),[2]}}))}))},t.prototype.getDevicePixelRatio=function(){return(0,h.uZ)(window.devicePixelRatio,1,2)},t.prototype.setCanvasSize=function(e,t){this.canvas.style.width=e+"px",this.canvas.style.height=t+"px",this.canvas.width=e*this.getDevicePixelRatio(),this.canvas.height=t*this.getDevicePixelRatio()},t.prototype.handleDeviceOrientationChange=function(){this.resizeCanvas({width:this.settings.container.clientWidth,height:this.settings.container.clientHeight})},t.prototype.setBackgroundColor=function(e){var t;null===(t=this.sketchWeb)||void 0===t||t.setBackgroundColor(e)},t.prototype.zoomToFit=function(){return F(this,void 0,void 0,(function(){return G(this,(function(e){switch(e.label){case 0:return[4,this.sketchWeb.scaleDocumentToFit()];case 1:return e.sent(),this.emitZoomEvent(),this.emitPanEvent(),[2]}}))}))},t.prototype.getStatus=function(){var e;return F(this,void 0,void 0,(function(){return G(this,(function(t){return[2,null===(e=this.sketchWeb)||void 0===e?void 0:e.getStatus()]}))}))},t.prototype.generateDocumentPNG=function(){var e;return F(this,void 0,void 0,(function(){return G(this,(function(t){return[2,null===(e=this.sketchWeb)||void 0===e?void 0:e.generateDocumentPNG()]}))}))},t.prototype.getDocument=function(){var e;return null===(e=this.sketchWeb)||void 0===e?void 0:e.getDocument()},t.prototype.getArtboardAtPosition=function(e,t){var n;return F(this,void 0,void 0,(function(){return G(this,(function(o){switch(o.label){case 0:return[4,null===(n=this.sketchWeb)||void 0===n?void 0:n.getArtboardAtPosition(e,t)];case 1:return[2,o.sent()||null]}}))}))},t.prototype.getPanAtPosition=function(e,t){var n;return null===(n=this.sketchWeb)||void 0===n?void 0:n.getPanAtPosition(e,t)},t.prototype.setPan=function(e,t,n){var o;return F(this,void 0,void 0,(function(){return G(this,(function(r){switch(r.label){case 0:return[4,null===(o=this.sketchWeb)||void 0===o?void 0:o.setPan(e,t,Boolean(n))];case 1:return r.sent(),this.emitPanEvent(),[2]}}))}))},t.prototype.setZoom=function(e,t){var n;return F(this,void 0,void 0,(function(){var o;return G(this,(function(r){return o=null!=t?t:this.getCanvasCenterPoint(),null===(n=this.sketchWeb)||void 0===n||n.setZoom(e,o),this.emitZoomEvent(),this.emitPanEvent(),[2]}))}))},t.prototype.getCanvasCenterPoint=function(){var e=this.canvas.getBoundingClientRect();return{x:e.width/2+e.x,y:e.height/2+e.y}},t.prototype.getZoom=function(){var e;return null===(e=this.sketchWeb)||void 0===e?void 0:e.getZoom()},t.prototype.getPan=function(){var e;return null===(e=this.sketchWeb)||void 0===e?void 0:e.getPan()},t.prototype.dispose=function(){var e,t,n,o;return F(this,void 0,void 0,(function(){return G(this,(function(r){switch(r.label){case 0:return this.gestureManager.dispose(),this.keyboardManager.dispose(),this.listenersCollector.dispose(),null===(e=this.canvasResizeObserver)||void 0===e||e.disconnect(),this.isRunningInsideWorker()?[4,null===(t=this.sketchWeb)||void 0===t?void 0:t.dispose()]:[3,2];case 1:return r.sent(),null===(n=this.worker)||void 0===n||n.terminate(),[3,3];case 2:null===(o=this.sketchWeb)||void 0===o||o.dispose(),r.label=3;case 3:return[2]}}))}))},t}(r.v)},475:(e,t,n)=>{"use strict";n.d(t,{U:()=>p});var o,r=n(419),i=n(519),a=n(354),s=n(108),u=n(849),c=n(758),l=n(332),d=n(975),h=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),f=function(){return(f=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},v=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((o=o.apply(e,t||[])).next())}))},m=function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},p=(globalThis.indexedDB,function(e){function t(t){var n=t.canvas,o=t.locateFile,a=t.filePath,c=t.imagesURLFormat,d=t.imagesURLMap,h=t.backgroundColor,v=void 0===h?{r:1,g:1,b:1,a:1}:h,m=t.size,p=t.pixelRatio,g=t.mode,b=t.showTilesBorders,y=void 0!==b&&b,w=t.minimumZoomLevel,C=t.maximumZoomLevel,k=t.preserveDrawingBuffer,P=void 0!==k&&k,E=t.panBoundariesPadding,W=void 0===E?40:E,M=t.featureFlags,S=void 0===M?{}:M,x=e.call(this)||this;return x.status={type:"INIT"},x.isZooming=!1,x.handleWebGLContextLost=function(){x.setStatus({type:"WEBGL_CONTEXT_LOST"})},x.debouncedFullDraw=(0,r.Ds)((function(){return x.draw(!0)}),60),x.notifyZoomDidEndDebounced=(0,r.Ds)((function(){var e;x.isZooming&&(x.isZooming=!1,null===(e=x.sketchWebWasm)||void 0===e||e.setIsZooming(!1),x.delayedDraw())}),80),x.canvas=n,x.locateFile=o,x.filePath=a,x.imagesURLFormat=c,x.imagesURLMap=d,x.backgroundColor=v,x.size=m,x.pixelRatio=p,x.mode=g,x.showTilesBorders=y,x.currentWebGLVersion=(0,r.wX)(),x.zoomLevels={min:w,max:C},x.preserveDrawingBuffer=P,x.panBoundariesPadding=W,x.featureFlags=f(f({},i.Z),S),u.Z.active=g===l.p.debug,x.traceFirstPaint=new s.S("FirstPaint"),x}return h(t,e),t.prototype.collectAndEmitDeviceInfo=function(){return v(this,void 0,void 0,(function(){var e;return m(this,(function(t){switch(t.label){case 0:return[4,(0,d.M)()];case 1:return e=t.sent(),this.deviceInfo=f(f({},e),{hardwareConcurrency:navigator.hardwareConcurrency}),this.emit("deviceInfo",this.deviceInfo),[2]}}))}))},t.prototype.init=function(){return v(this,void 0,void 0,(function(){var e;return m(this,(function(t){switch(t.label){case 0:this.setStatus({type:"INIT"}),this.collectAndEmitDeviceInfo(),t.label=1;case 1:return t.trys.push([1,5,,6]),[4,this.initSketchWebWasm()];case 2:return t.sent(),[4,this.setFile(this.filePath)];case 3:return t.sent(),[4,this.preloadImages()];case 4:return t.sent(),[3,6];case 5:return e=t.sent(),[2,this.fail(e instanceof c.k?e:new c.k("ERROR","Unexpected exception initializing the web renderer",e))];case 6:return[2]}}))}))},t.prototype.preloadImages=function(){var e=this;return new Promise((function(t){var n;null===(n=e.sketchWebWasm)||void 0===n||n.preloadImages((function(){t()}))}))},t.prototype.startRendering=function(){this.traceInitialRender=new s.S("InitialRender"),this.setStatus({type:"DRAWING_FILE"}),this.draw(!0,!1),this.sketchWebWasm.startRenderLoop()},t.prototype.createJSBridge=function(){var e=this;return{logDebug:function(e){u.Z.debug("[C++] "+e)},logWarning:function(e){u.Z.warning("[C++] "+e)},logError:function(e){u.Z.error("[C++] "+e)},emitMetric:function(t,n,o,r){e.emit("metric",{id:t,start:n,end:o,duration:r})},resolveImageUrl:function(t){return e.imagesURLFormat?e.imagesURLFormat.replace(":imageId",t):e.imagesURLMap&&e.imagesURLMap[t]?e.imagesURLMap[t]:(u.Z.warning("Not able to resolve the url for the image with UUID: "+t),"")},onDrawComplete:this.handleDrawComplete.bind(this),onAllImagesReady:function(){e.emit("allImagesReady")}}},t.prototype.downloadImages=function(){var e=this;return new Promise((function(t){var n,o=new s.S("ImagesDownload");null===(n=e.sketchWebWasm)||void 0===n||n.downloadImages((function(){o.printMeasurement(),e.emit("metric",o.measure()),u.Z.debug("Images downloaded"),t()}))}))},t.prototype.initSketchWebWasm=function(){return v(this,void 0,void 0,(function(){var e,t,o,r,i,a,d,h=this;return m(this,(function(f){switch(f.label){case 0:return e=new s.S("WasmModuleDownload"),this.mode!==l.p.debug?[3,2]:[4,n.e(706).then(n.t.bind(n,706,23))];case 1:return t=f.sent(),[3,4];case 2:return[4,n.e(610).then(n.t.bind(n,610,23))];case 3:t=f.sent(),f.label=4;case 4:o=t.default,f.label=5;case 5:return f.trys.push([5,7,,8]),r=this,[4,o({FeatureFlags:this.featureFlags,currentWebGLVersion:this.currentWebGLVersion,locateFile:function(e){return h.locateFile.replace("{file}",e)},bridge:this.createJSBridge()})];case 6:return r.wasmModule=f.sent(),[3,8];case 7:throw i=f.sent(),new c.k("WASM_ERROR","An error occurred while trying to create the wasm module.",i);case 8:if(e.printMeasurement(),this.emit("metric",e.measure()),a={majorVersion:this.currentWebGLVersion,antialias:!1,alpha:!1,stencil:!1,depth:!1,powerPreference:"high-performance",preserveDrawingBuffer:this.preserveDrawingBuffer},u.Z.debug("Using WebGL "+a.majorVersion),!(d=this.wasmModule.GL.createContext(this.canvas,a)))throw new c.k("WEBGL_ERROR","Unable to create WebGL context. WebGL might be unsupported, disabled, or this device is not able to run WebGL correctly.");this.webglCtxHandle=d;try{this.sketchWebWasm=this.wasmModule.SketchWeb.MakeGL(this.webglCtxHandle,this.canvas.width,this.size.height,this.pixelRatio,{showTilesBorders:this.showTilesBorders})}catch(e){throw new c.k("WASM_ERROR","An error occurred while trying to create the SketchWebWasm object.",e)}return this.sketchWebWasm.setBackgroundColor(this.backgroundColor.r,this.backgroundColor.g,this.backgroundColor.b,this.backgroundColor.a),this.sketchWebWasm.setZoomLevels(this.zoomLevels.min,this.zoomLevels.max),this.sketchWebWasm.setPanBoundariesPadding(this.panBoundariesPadding),this.canvas.addEventListener("webglcontextlost",this.handleWebGLContextLost),[2]}}))}))},t.prototype.setBackgroundColor=function(e){var t;e.r===this.backgroundColor.r&&e.g===this.backgroundColor.g&&e.b===this.backgroundColor.b&&e.a===this.backgroundColor.a||(null===(t=this.sketchWebWasm)||void 0===t||t.setBackgroundColor(e.r,e.g,e.b,e.a),this.backgroundColor=e,this.delayedDraw())},t.prototype.generateDocumentPNG=function(){return v(this,void 0,void 0,(function(){return m(this,(function(e){switch(e.label){case 0:return[4,this.downloadImages()];case 1:return e.sent(),[2,this.sketchWebWasm.generateDocumentPNG()]}}))}))},t.prototype.handleDrawComplete=function(){"DRAWING_FILE"===this.status.type&&(this.traceInitialRender.printMeasurement(),this.emit("metric",this.traceInitialRender.measure()),this.traceFirstPaint.printMeasurement(),this.emit("metric",this.traceFirstPaint.measure()),this.setStatus({type:"READY"}),this.downloadImages())},t.prototype.looseWebGLContext=function(){var e=this.wasmModule.GL.getContext(this.webglCtxHandle);if(e){var t=e.GLctx.getExtension("WEBGL_lose_context");t?t.loseContext():console.warn("Unable to retrieve WEBGL_lose_context extension")}else console.warn("Unable to loose context. WebGL rendering context not found")},t.prototype.scaleDocumentToFit=function(){var e;null===(e=this.sketchWebWasm)||void 0===e||e.scaleDocumentToFit(),this.delayedDraw()},t.prototype.setFile=function(e){return v(this,void 0,void 0,(function(){var t=this;return m(this,(function(n){return this.setStatus({type:"LOADING_FILE"}),[2,new Promise((function(n,o){t.sketchWebWasm.setFile(e,(function(e,o,r,i){if(void 0===i&&(i=[]),i.length){u.Z.debug("Parser warnings: "+i);var a=i.map((function(e){return{key:e}}));t.emit("warnings",a)}t.setStatus({type:"FILE_READY"}),t.emit("fileReady",t.getDocument(),e,o,r),n()}),(function(){return o(new c.k("FILE_ERROR","Error encountered while fetching and parsing the file"))}))}))]}))}))},t.prototype.delayedDraw=function(){if(!this.featureFlags.delayedDraw)return this.draw(!0);this.draw(),this.debouncedFullDraw()},t.prototype.draw=function(e,t){var n;void 0===e&&(e=!1),void 0===t&&(t=!1),null===(n=this.sketchWebWasm)||void 0===n||n.setNeedsUpdate(e,t)},t.prototype.fail=function(e){this.setStatus({type:"FAILURE",code:e.code,message:e.toString()+(e.cause?"\nWrapped Error: "+e.cause.toString():"")}),u.Z.error(e),e.cause&&u.Z.error(e.cause)},t.prototype.setPixelRatio=function(e){this.pixelRatio=e,this.setSize(this.size.width*this.pixelRatio,this.size.height*this.pixelRatio,this.pixelRatio),this.delayedDraw()},t.prototype.setSize=function(e,t,n){var o;this.size.width=e*n,this.size.height=t*n,this.canvas.width=e*n,this.canvas.height=t*n,null===(o=this.sketchWebWasm)||void 0===o||o.resize(e,t,n)},t.prototype.setStatus=function(e){"FAILURE"!==this.status.type&&(u.Z.debug("Status transition "+this.status.type+" => "+e.type+"}"),this.status=e,this.emit("status",e))},t.prototype.getDocument=function(){if(!this.sketchWebWasm)return null;if(!this.cachedDocumentInfo||this.cachedDocumentInfo.filePath!==this.filePath){var e=this.sketchWebWasm.getPRFile();this.cachedDocumentInfo={filePath:this.filePath,document:f(f({},e),{artboards:(0,r.gi)(e.artboards)})}}return this.cachedDocumentInfo.document},t.prototype.getArtboardAtPosition=function(e,t){var n;return null===(n=this.sketchWebWasm)||void 0===n?void 0:n.getArtboardAtPosition(e,t)},t.prototype.getPanAtPosition=function(e,t){var n;return null===(n=this.sketchWebWasm)||void 0===n?void 0:n.getPanAtPosition(e,t)},t.prototype.getStatus=function(){return this.status},t.prototype.setZoom=function(e,t){var n,o;null===(n=this.sketchWebWasm)||void 0===n||n.setZoomCenter(t.x,t.y),null===(o=this.sketchWebWasm)||void 0===o||o.setZoom(e),this.delayedDraw()},t.prototype.addZoom=function(e,t){var n,o;this.notifyZoomDidStart(),null===(n=this.sketchWebWasm)||void 0===n||n.setZoomCenter(t.x,t.y),null===(o=this.sketchWebWasm)||void 0===o||o.addZoom(e),this.notifyZoomDidEndDebounced(),this.delayedDraw()},t.prototype.notifyZoomDidStart=function(){var e;this.isZooming||(this.isZooming=!0,null===(e=this.sketchWebWasm)||void 0===e||e.setIsZooming(!0))},t.prototype.setPan=function(e,t,n){var o;void 0===n&&(n=!1),null===(o=this.sketchWebWasm)||void 0===o||o.setPan(e,t,n),this.delayedDraw()},t.prototype.addPan=function(e,t){var n;null===(n=this.sketchWebWasm)||void 0===n||n.addPan(e,t),this.delayedDraw()},t.prototype.getPan=function(){if(this.sketchWebWasm)return this.sketchWebWasm.getPan()},t.prototype.getZoom=function(){var e;return null===(e=this.sketchWebWasm)||void 0===e?void 0:e.getZoom()},t.prototype.setMouse=function(e,t){var n;null===(n=this.sketchWebWasm)||void 0===n||n.setMouse(e,t)},t.prototype.setIsCameraMoving=function(e){var t;null===(t=this.sketchWebWasm)||void 0===t||t.setIsCameraMoving(e)},t.prototype.dispose=function(){var e,t;try{null===(e=this.sketchWebWasm)||void 0===e||e.stopRenderLoop(),null===(t=this.sketchWebWasm)||void 0===t||t.delete(),this.looseWebGLContext(),this.sketchWebWasm=null,this.wasmModule=null}catch(e){this.fail(new c.k("ERROR","Unexpected exception while disposing the SketchWebWasm object",e))}},t}(a.v))},536:(e,t,n)=>{"use strict";n.d(t,{z0:()=>V,oW:()=>B,jr:()=>P,tm:()=>D,ky:()=>w,zX:()=>I,ex:()=>O,Jw:()=>z,m_:()=>A,Yy:()=>L,d6:()=>W,aP:()=>E,EY:()=>_,pt:()=>T,od:()=>k,ph:()=>Z,lt:()=>x,$z:()=>y,BO:()=>C,us:()=>R});var o,r=n(297),i=n.n(r),a=n(332),s=n(849),u=(0,r.createContext)(void 0),c=function(){var e=(0,r.useContext)(u);if(void 0===e)throw Error("useSketchWebInternalContext must be used within a SketchWebProvider");return e},l=(n(419),function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,r++)o[r]=i[a];return o}),d=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.Z.debug.apply(s.Z,l(["SketchWebReact"],e))},h=(0,r.createContext)(void 0),f=(0,r.createContext)(void 0),v=(0,r.createContext)(void 0),m=(0,r.createContext)(void 0),p=(0,r.createContext)(void 0),g=(0,r.createContext)(void 0),b=(0,r.createContext)(void 0),y=function(){var e=(0,r.useContext)(h);if(void 0===e)throw Error("useStatus must be used within a SketchWebProvider");return e},w=function(){var e=(0,r.useContext)(f);if(void 0===e)throw Error("useDocument must be used within a SketchWebProvider");return e},C=function(){var e=(0,r.useContext)(v);if(void 0===e)throw Error("useZoom must be used within a SketchWebProvider");return e},k=function(){var e=(0,r.useContext)(g);if(void 0===e)throw Error("usePan must be used within a SketchWebProvider");return e},P=function(){var e=(0,r.useContext)(b);if(void 0===e)throw Error("useCursor must be used within a SketchWebProvider");return e},E=function(){var e=(0,r.useContext)(m);if(void 0===status)throw Error("useIsCameraZooming must be used within a SketchWebProvider");return e},W=function(){var e=(0,r.useContext)(p);if(void 0===status)throw Error("useIsCameraMoving must be used within a SketchWebProvider");return e},M=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((o=o.apply(e,t||[])).next())}))},S=function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},x=function(){var e=(0,c().getManager)();return(0,r.useCallback)((function(t){d("setZoom",t),null==e||e.setZoom(t)}),[e])},L=function(){var e=x(),t=C();return(0,r.useCallback)((function(){var n;d("incrementZoom"),"number"==typeof t&&(n=t>=1?Math.round(2*t):t>.5?1:2*t,e(n))}),[e,t])},D=function(){var e=x(),t=C();return(0,r.useCallback)((function(){d("decrementZoom"),"number"==typeof t&&e(t/2)}),[e,t])},Z=function(){var e=(0,c().getManager)();return(0,r.useCallback)((function(t){var n=t.x,o=t.y,r=t.centerPointInViewport;d("setPan",n,o,"centerPointInViewport",r),null==e||e.setPan(n,o,r)}),[e])},R=function(){var e=(0,c().getManager)();return(0,r.useCallback)((function(){d("zoomToFit"),null==e||e.zoomToFit()}),[e])},T=function(){var e=(0,c().getManager)();return(0,r.useCallback)((function(){d("looseWebGLContext"),null==e||e.looseWebGLContext()}),[e])},O=function(){var e=(0,c().getManager)();return(0,r.useCallback)((function(){return M(void 0,void 0,void 0,(function(){return S(this,(function(t){switch(t.label){case 0:return d("generateDocumentPNG"),[4,null==e?void 0:e.generateDocumentPNG()];case 1:return[2,t.sent()]}}))}))}),[e])},z=function(){var e=(0,c().getManager)();return(0,r.useCallback)((function(t,n){return M(void 0,void 0,void 0,(function(){return S(this,(function(o){switch(o.label){case 0:return d("getArtboardAtPosition",t,n),[4,null==e?void 0:e.getArtboardAtPosition(t,n)];case 1:return[2,o.sent()||null]}}))}))}),[e])},A=function(){var e=(0,c().getManager)();return(0,r.useCallback)((function(t,n){return M(void 0,void 0,void 0,(function(){return S(this,(function(o){switch(o.label){case 0:return d("getPanAtPosition",t,n),[4,null==e?void 0:e.getPanAtPosition(t,n)];case 1:return[2,o.sent()||null]}}))}))}),[e])},_=function(){var e=(0,c().getManager)();return(0,r.useCallback)((function(t){d("setIsCameraLocked",t),null==e||e.gestureManager.setIsCameraLocked(t)}),[e])},I=function(e,t){var n=(0,c().getManager)();(0,r.useEffect)((function(){return null==n||n.on(e,t),function(){null==n||n.off(e,t)}}),[e,n,t])},F=function(){return(F=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},G={position:"relative",width:"100%",height:"100%",touchAction:"manipulation"},j={position:"absolute",top:0,left:0},B=function(e){s.Z.active=e.mode===a.p.debug;var t=e.filePath,n=e.locateFile,o=e.imagesURLFormat,u=e.imagesURLMap,l=e.backgroundColor,d=e.mode,h=e.showTilesBorders,f=e.minimumZoomLevel,v=e.maximumZoomLevel,m=e.preserveDrawingBuffer,p=e.panBoundariesPadding,g=e.initialPan,b=e.initialZoom,w=e.children,C=e.containerProps,k=void 0===C?{}:C,E=e.canvasProps,W=void 0===E?{}:E,M=e.featureFlags,S=void 0===M?{}:M,x=(0,r.useRef)(null),L=(0,r.useRef)(null),D=(0,r.useState)(!1),Z=D[0],R=D[1],T=(0,r.useCallback)((function(){return R(!0)}),[]),O=c(),z=O.dispose,A=O.init,_=O.setSettings,B=P(),U=y();I("allImagesReady",T),(0,r.useEffect)((function(){_({locateFile:n,imagesURLFormat:o,imagesURLMap:u,backgroundColor:l,mode:d,showTilesBorders:h,minimumZoomLevel:f,maximumZoomLevel:v,preserveDrawingBuffer:m,panBoundariesPadding:p,initialPan:g,initialZoom:b,featureFlags:S})}),[_,n,o,u,l,d,h,f,v,m,p,g,b,S]),(0,r.useEffect)((function(){if(t)return A(t,x.current,L.current),function(){z()}}),[z,A,t]);var N=(0,r.useMemo)((function(){var t;return null!==(t=e.cursor)&&void 0!==t?t:B}),[e.cursor,B]),X=(0,r.useMemo)((function(){return F(F({},G),{cursor:N})}),[N]);return i().createElement("div",F({},k,{ref:L,style:X}),t&&i().createElement("canvas",F({},W,{key:t,ref:x,"data-sketchweb-all-images-ready":Z,"data-testid":"sketchweb-canvas","data-sketchweb-status":"sketchweb-status-"+((null==U?void 0:U.type.toLowerCase())||"null"),style:j})),"READY"===(null==U?void 0:U.type)&&w)},U=n(946);!function(e){e.Draggable="grab",e.Dragging="grabbing",e.Hover="pointer",e.Default="auto"}(o||(o={}));var N=function(){return(N=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},X=function(e,t){switch(d('dispatched: "'+t.type+'"',t),t.type){case"on-status":return N(N({},e),{status:t.status});case"on-file-ready":return N(N({},e),{document:t.document});case"on-zoom":return N(N({},e),{zoom:t.zoom});case"on-pan":return N(N({},e),{pan:t.pan});case"dispose":return N(N({},e),{status:null,zoom:null,pan:null,cursor:o.Default});case"post-init":return N(N({},e),{status:t.status,zoom:t.zoom});case"on-camera-zoom-start":return N(N({},e),{isCameraZooming:!0});case"on-camera-zoom-end":return N(N({},e),{isCameraZooming:!1});case"on-camera-move-start":return N(N({},e),{cursor:e.isMouseDown?o.Dragging:o.Draggable,isCameraMoving:!0});case"on-camera-move-end":return N(N({},e),{isCameraMoving:!1});case"on-mouse-down":return N(N({},e),{cursor:o.Dragging,isMouseDown:!0});case"on-mouse-up":return N(N({},e),{cursor:o.Draggable,isMouseDown:!1});default:return e}},Y=function(){return(Y=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},V=function(e){var t=e.children,n=(0,r.useRef)(null),a=(0,r.useRef)(null),s=(0,r.useReducer)(X,{pan:null,zoom:null,status:null,document:null,isCameraZooming:!1,isCameraMoving:!1,cursor:o.Default,isMouseDown:!1}),c=s[0],l=c.status,y=c.document,w=c.zoom,C=c.pan,k=c.isCameraZooming,P=c.isCameraMoving,E=c.cursor,W=s[1],M=(0,r.useCallback)((function(e){return W({type:"on-zoom",zoom:e})}),[]),S=(0,r.useCallback)((function(e,t){return W({type:"on-pan",pan:{x:e,y:t}})}),[]),x=(0,r.useCallback)((function(e){W({type:"on-status",status:e})}),[]),L=(0,r.useCallback)((function(e){W({type:"on-file-ready",document:e})}),[]),D=(0,r.useCallback)((function(){return W({type:"on-mouse-down"})}),[]),Z=(0,r.useCallback)((function(){return W({type:"on-mouse-up"})}),[]),R=(0,r.useCallback)((function(){return W({type:"on-camera-zoom-start"})}),[]),T=(0,r.useCallback)((function(){return W({type:"on-camera-zoom-end"})}),[]),O=(0,r.useCallback)((function(){return W({type:"on-camera-move-start"})}),[]),z=(0,r.useCallback)((function(){return W({type:"on-camera-move-end"})}),[]),A=(0,r.useCallback)((function(){var e=n.current;e&&(d("dispose"),e.off("status",x),e.off("fileReady",L),e.off("zoom",M),e.off("pan",S),e.gestureManager.off("mousedown",D),e.gestureManager.off("mouseup",Z),e.gestureManager.off("zoomStart",R),e.gestureManager.off("zoomEnd",T),e.gestureManager.off("cameraMoveStart",O),e.gestureManager.off("cameraMoveEnd",z),e.dispose(),n.current=null,W({type:"dispose"}))}),[x,L,S,M,Z,D,R,T,O,z]),_=(0,r.useCallback)((function(e,t,o){if(""!==e&&t&&o&&a.current){d("init");var r=new U.d(Y(Y({},a.current),{filePath:e,container:o,canvas:t}));r.on("status",x),r.on("fileReady",L),r.on("zoom",M),r.on("pan",S),r.gestureManager.on("mousedown",D),r.gestureManager.on("mouseup",Z),r.gestureManager.on("zoomStart",R),r.gestureManager.on("zoomEnd",T),r.gestureManager.on("cameraMoveStart",O),r.gestureManager.on("cameraMoveEnd",z),i=void 0,s=void 0,c=function(){var e,t;return function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}(this,(function(n){switch(n.label){case 0:return e=W,t={type:"post-init"},[4,r.getZoom()];case 1:return t.zoom=n.sent()||null,[4,r.getStatus()];case 2:return t.status=n.sent()||null,[4,r.getPan()];case 3:return e.apply(void 0,[(t.pan=n.sent()||null,t)]),[2]}}))},new((u=void 0)||(u=Promise))((function(e,t){function n(e){try{r(c.next(e))}catch(e){t(e)}}function o(e){try{r(c.throw(e))}catch(e){t(e)}}function r(t){var r;t.done?e(t.value):(r=t.value,r instanceof u?r:new u((function(e){e(r)}))).then(n,o)}r((c=c.apply(i,s||[])).next())})),n.current=r}var i,s,u,c}),[x,L,M,S,D,Z,R,T,O,z]),I=(0,r.useCallback)((function(e){var t;d("setSettings",e),e.backgroundColor&&(null===(t=n.current)||void 0===t||t.setBackgroundColor(e.backgroundColor)),a.current=e}),[]),F=(0,r.useCallback)((function(){return n.current}),[]),G=(0,r.useMemo)((function(){return{dispose:A,init:_,setSettings:I,getManager:F,dispatch:W}}),[A,_,I,F]);return i().createElement(u.Provider,{value:G},i().createElement(h.Provider,{value:l},i().createElement(f.Provider,{value:y},i().createElement(v.Provider,{value:w},i().createElement(g.Provider,{value:C},i().createElement(m.Provider,{value:k},i().createElement(p.Provider,{value:P},i().createElement(b.Provider,{value:E},t))))))))}},758:(e,t,n)=>{"use strict";n.d(t,{k:()=>i});var o,r=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(n,o,r){var i=this.constructor,a=e.call(this,"("+n+") "+o)||this;return a.code=n,a.cause=r,a.name=t.name,Object.setPrototypeOf(a,i.prototype),a}return r(t,e),t}(Error)},18:()=>{},689:()=>{},332:(e,t,n)=>{"use strict";var o;n.d(t,{p:()=>o}),function(e){e.debug="debug",e.release="release"}(o||(o={}))},119:()=>{},650:()=>{},312:()=>{},552:(e,t,n)=>{"use strict";n.d(t,{v:()=>o});var o=function(){function e(){this.listeners={}}return e.prototype.on=function(e,t){var n,o;this.listeners[e]=null!==(n=this.listeners[e])&&void 0!==n?n:new Set,null===(o=this.listeners[e])||void 0===o||o.add(t)},e.prototype.off=function(e,t){var n;null===(n=this.listeners[e])||void 0===n||n.delete(t)},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var o=this.listeners[e];(null==o?void 0:o.size)&&o.forEach((function(e){Promise.resolve().then((function(){e.apply(void 0,t)}))}))},e}()},354:(e,t,n)=>{"use strict";n.d(t,{v:()=>o.v});var o=n(552)},849:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,r++)o[r]=i[a];return o};const r=new(function(){function e(){this.active=!0}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.active&&console.debug.apply(console,o(["[SketchWeb] [Debug]"],e))},e.prototype.warning=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.active&&console.warn.apply(console,o(["[SketchWeb] [Warn]"],e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.error.apply(console,o(["[SketchWeb] [Error]"],e))},e}())},108:(e,t,n)=>{"use strict";n.d(t,{S:()=>r});var o=n(849),r=function(){function e(e){this.label=e,this.startTime=performance.now(),this.startTimestamp=Date.now(),o.Z.debug("[Performance] Start: "+this.label)}return e.prototype.measure=function(){return{duration:performance.now()-this.startTime,end:Date.now(),start:this.startTimestamp,id:this.label}},e.prototype.printMeasurement=function(){var e=this.measure().duration;if(e<1e3){var t=e.toFixed(2);o.Z.debug("[Performance] End: "+this.label+" -> "+t+" ms")}else{var n=(e/1e3).toFixed(2);o.Z.debug("[Performance] End: "+this.label+" -> "+n+" s")}},e}()},419:(e,t,n)=>{"use strict";n.d(t,{uZ:()=>o.uZ,gi:()=>o.gi,Ds:()=>o.Ds,wX:()=>o.wX});var o=n(388)},388:(e,t,n)=>{"use strict";n.d(t,{Ds:()=>i,MP:()=>a,uZ:()=>s,wX:()=>u,gi:()=>c,b1:()=>l,z6:()=>d});var o=n(519),r=n(66);function i(e,t){var n;function o(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];clearTimeout(n),n=setTimeout((function(){e.apply(void 0,o)}),t)}return o.cancel=function(){n&&clearTimeout(n)},o}function a(e){var t,n,o,r,i,a,s,u;return{x:null!==(r=null!==(t=e.pageX)&&void 0!==t?t:null===(o=null===(n=e.touches)||void 0===n?void 0:n[0])||void 0===o?void 0:o.pageX)&&void 0!==r?r:e.clientX,y:null!==(u=null!==(i=e.pageY)&&void 0!==i?i:null===(s=null===(a=e.touches)||void 0===a?void 0:a[0])||void 0===s?void 0:s.pageY)&&void 0!==u?u:e.clientY}}function s(e,t,n){return Math.max(t,Math.min(n,e))}function u(){return(0,r.t)()&&!o.Z.safariWebGL2?1:"undefined"!=typeof WebGL2RenderingContext?2:1}function c(e){for(var t=e.size(),n=[],o=0;o<t;++o){var r=e.get(o);n.push(r)}return n}function l(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function d(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent||void 0!==e.touches||void 0!==e.targetTouches||void 0!==e.changedTouches}},66:(e,t,n)=>{"use strict";n.d(t,{t:()=>r});var o=/(iPhone|Macintosh|iPad)(.*)(Version)\/(0|[1-9]\d*)\.(0|[1-9]\d*)\.?(0|[1-9]\d*)?/,r=function(e){if(void 0===e&&(e=window.navigator.userAgent),e.includes("Chrome/")||e.includes("Chromium/")||e.includes("Opera/")||e.includes("Firefox/"))return null;var t=e.match(o);if(!t)return null;var n=t[1];return"Macintosh"!==n&&"iPad"!==n&&"iPhone"!==n?null:{hardware:n,version:{major:parseInt(t[4])||0,minor:parseInt(t[5])||0,patch:parseInt(t[6])||0}}}},297:t=>{"use strict";t.exports=e}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return i[e](n,n.exports,s),n.exports}s.m=i,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},n=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(e,o){if(1&o&&(e=this(e)),8&o)return e;if("object"==typeof e&&e){if(4&o&&e.__esModule)return e;if(16&o&&"function"==typeof e.then)return e}var r=Object.create(null);s.r(r);var i={};t=t||[null,n({}),n([]),n(n)];for(var a=2&o&&e;"object"==typeof a&&!~t.indexOf(a);a=n(a))Object.getOwnPropertyNames(a).forEach((t=>i[t]=()=>e[t]));return i.default=()=>e,s.d(r,i),r},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>"static/js/web-renderer-"+{610:"17fd55cdb979ed59dbc9",667:"e4d5f4f314c42815f663",706:"b584c7152f956c9cbea5"}[e]+".chunk.js",s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={},r="@sketch-hq/sketch-web-renderer:",s.l=(e,t,n,i)=>{if(o[e])o[e].push(t);else{var a,u;if(void 0!==n)for(var c=document.getElementsByTagName("script"),l=0;l<c.length;l++){var d=c[l];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==r+n){a=d;break}}a||(u=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,s.nc&&a.setAttribute("nonce",s.nc),a.setAttribute("data-webpack",r+n),a.src=e),o[e]=[t];var h=(t,n)=>{a.onerror=a.onload=null,clearTimeout(f);var r=o[e];if(delete o[e],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach((e=>e(n))),t)return t(n)},f=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),u&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.p="/",(()=>{s.b=document.baseURI||self.location.href;var e={826:0};s.f.j=(t,n)=>{var o=s.o(e,t)?e[t]:void 0;if(0!==o)if(o)n.push(o[2]);else{var r=new Promise(((n,r)=>o=e[t]=[n,r]));n.push(o[2]=r);var i=s.p+s.u(t),a=new Error;s.l(i,(n=>{if(s.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var r=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+r+": "+i+")",a.name="ChunkLoadError",a.type=r,a.request=i,o[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var o,r,[i,a,u]=n,c=0;if(i.some((t=>0!==e[t]))){for(o in a)s.o(a,o)&&(s.m[o]=a[o]);u&&u(s)}for(t&&t(n);c<i.length;c++)r=i[c],s.o(e,r)&&e[r]&&e[r][0](),e[i[c]]=0},n=self.webpackChunk_sketch_hq_sketch_web_renderer=self.webpackChunk_sketch_hq_sketch_web_renderer||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var u={};return(()=>{"use strict";s.r(u),s.d(u,{default:()=>v,DefaultFeatureFlags:()=>m,SketchWeb:()=>n.U,SketchWebMode:()=>a.p,SketchWebError:()=>l.k,SketchWebProvider:()=>f.z0,SketchWebReact:()=>f.oW,useCursor:()=>f.jr,useDecrementZoom:()=>f.tm,useDocument:()=>f.ky,useEvent:()=>f.zX,useGenerateDocumentPNG:()=>f.ex,useGetArtboardAtPosititon:()=>f.Jw,useGetPanAtPosition:()=>f.m_,useIncrementZoom:()=>f.Yy,useIsCameraMoving:()=>f.d6,useIsCameraZooming:()=>f.aP,useLockCamera:()=>f.EY,useLooseWebGLContext:()=>f.pt,usePan:()=>f.od,useSetPan:()=>f.ph,useSetZoom:()=>f.lt,useStatus:()=>f.$z,useZoom:()=>f.BO,useZoomToFit:()=>f.us});var e=s(946),t=s(519),n=s(475),o=s(18),r={};for(const e in o)["default","DefaultFeatureFlags","SketchWeb"].indexOf(e)<0&&(r[e]=()=>o[e]);s.d(u,r);var i=s(119);r={};for(const e in i)["default","DefaultFeatureFlags","SketchWeb"].indexOf(e)<0&&(r[e]=()=>i[e]);s.d(u,r);var a=s(332),c=s(312);r={};for(const e in c)["default","DefaultFeatureFlags","SketchWeb","SketchWebMode"].indexOf(e)<0&&(r[e]=()=>c[e]);s.d(u,r);var l=s(758),d=s(689);r={};for(const e in d)["default","DefaultFeatureFlags","SketchWeb","SketchWebMode","SketchWebError"].indexOf(e)<0&&(r[e]=()=>d[e]);s.d(u,r);var h=s(650);r={};for(const e in h)["default","DefaultFeatureFlags","SketchWeb","SketchWebMode","SketchWebError"].indexOf(e)<0&&(r[e]=()=>h[e]);s.d(u,r);var f=s(536);const v=e.d;var m=t.Z})(),u})()}));
Binary file
Binary file
@@ -1,13 +1,28 @@
1
- import React from 'react';
1
+ import React, { FC } from 'react';
2
2
  import { ManagerSettings } from '../Manager';
3
3
  export declare type SketchWebProps = Omit<ManagerSettings, 'filePath' | 'container' | 'canvas'> & Partial<Pick<ManagerSettings, 'filePath'>> & {
4
4
  cursor?: string;
5
5
  containerProps?: React.HTMLAttributes<HTMLDivElement>;
6
6
  canvasProps?: React.HTMLAttributes<HTMLCanvasElement>;
7
7
  };
8
- export declare const SketchWebReact: React.FC<Pick<ManagerSettings, "featureFlags" | "locateFile" | "imagesURLFormat" | "imagesURLMap" | "backgroundColor" | "mode" | "showTilesBorders" | "minimumZoomLevel" | "maximumZoomLevel" | "preserveDrawingBuffer" | "panBoundariesPadding" | "initialZoom" | "initialPan"> & Partial<Pick<ManagerSettings, "filePath">> & {
9
- cursor?: string | undefined;
10
- containerProps?: React.HTMLAttributes<HTMLDivElement> | undefined;
11
- canvasProps?: React.HTMLAttributes<HTMLCanvasElement> | undefined;
12
- } & import("./ShadowRoot").ShadowRootProps & import("./ShadowRoot").WithShadowRootProps>;
8
+ /**
9
+ * The SketchWebReact component renders a canvas element, and connects it to the
10
+ * Manager instance wrapped by SketchWebProvider. The props passed to this
11
+ * component mostly match the static settings passed to the Manager.
12
+ *
13
+ * Rendering the SketchWebReact component has no side effects initially aside
14
+ * from establishing the canvas element in the DOM. However, when the `filePath`
15
+ * prop is defined the renderer will begin to init and eventually draw to the
16
+ * canvas. If `filePath` is changed then the renderer will dispose and re-init
17
+ * to begin rendering the new file.
18
+ *
19
+ * Currently `filePath` is the only "reactive" prop, all the other settings
20
+ * props can be changed, but they will only take effect the next time `filePath`
21
+ * changes and the renderer (re)inits.
22
+ *
23
+ * To interact with the renderer use the various hooks exposed by the package,
24
+ * these can be used to access state values, listen to events and perform
25
+ * actions.
26
+ */
27
+ export declare const SketchWebReact: FC<SketchWebProps>;
13
28
  //# sourceMappingURL=SketchWebReact.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SketchWebReact.d.ts","sourceRoot":"","sources":["../../../src/ts/react/SketchWebReact.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAO5C,oBAAY,cAAc,GAAG,IAAI,CAC/B,eAAe,EACf,UAAU,GAAG,WAAW,GAAG,QAAQ,CACpC,GACC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC,GAAG;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,cAAc,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAA;IACrD,WAAW,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAA;CACtD,CAAA;AAwJH,eAAO,MAAM,cAAc;;;;wFAAsC,CAAA"}
1
+ {"version":3,"file":"SketchWebReact.d.ts","sourceRoot":"","sources":["../../../src/ts/react/SketchWebReact.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,EAAE,EAMH,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAM5C,oBAAY,cAAc,GAAG,IAAI,CAC/B,eAAe,EACf,UAAU,GAAG,WAAW,GAAG,QAAQ,CACpC,GACC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC,GAAG;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,cAAc,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAA;IACrD,WAAW,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAA;CACtD,CAAA;AAkBH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,cAAc,CAiH7C,CAAA"}
@@ -47,5 +47,5 @@ export declare const PanContext: import("react").Context<{
47
47
  /**
48
48
  * Context for the renderer `cursor` value.
49
49
  */
50
- export declare const CursorContext: import("react").Context<"auto" | "grab" | "grabbing" | "pointer" | undefined>;
50
+ export declare const CursorContext: import("react").Context<"grab" | "grabbing" | "pointer" | "auto" | undefined>;
51
51
  //# sourceMappingURL=contexts.d.ts.map
@@ -38,7 +38,7 @@ export declare const usePan: () => {
38
38
  /**
39
39
  * Access the renderer `cursor` value.
40
40
  */
41
- export declare const useCursor: () => "auto" | "grab" | "grabbing" | "pointer";
41
+ export declare const useCursor: () => "grab" | "grabbing" | "pointer" | "auto";
42
42
  /**
43
43
  * Access the renderer `isCameraMoving` value.
44
44
  */
@@ -1,5 +1,4 @@
1
1
  export * from './SketchWebReact';
2
2
  export * from './SketchWebProvider';
3
3
  export * from './hooks';
4
- export * from './overlays';
5
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ts/react/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ts/react/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,SAAS,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sketch-hq/sketch-web-renderer",
3
- "version": "3.1.7",
3
+ "version": "3.2.0",
4
4
  "license": "UNLICENSED",
5
5
  "description": "Sketch Web Renderer",
6
6
  "repository": "git@github.com:sketch-hq/web-renderer",
@@ -35,7 +35,8 @@
35
35
  "test:unit": "yarn test:unit:ts && yarn test:unit:cpp",
36
36
  "test:cy": "yarn cypress run --browser chrome --headless",
37
37
  "test:cy:dashboard": "yarn cypress open",
38
- "test:compare": "yarn build:pr_compare && ./tools/scripts/launch_compare_tests.sh",
38
+ "test:compare:all": "yarn build:pr_compare && ./tools/scripts/launch_compare_tests_all.sh",
39
+ "test:compare": "yarn build:pr_compare && ./tools/scripts/launch_compare_test.sh",
39
40
  "test": "yarn test:unit && yarn test:cy && yarn test:compare",
40
41
  "lint:type-check": "yarn tsc --noemit && yarn tsc --noemit --project ./cypress/tsconfig.json"
41
42
  },
@@ -48,7 +49,6 @@
48
49
  "@types/react": "^17.0.3",
49
50
  "@types/react-dom": "^17.0.3",
50
51
  "@types/resize-observer-browser": "^0.1.6",
51
- "@types/styled-components": "5.1.1",
52
52
  "@types/uuid": "^8.3.1",
53
53
  "@types/xml2js": "^0.4.9",
54
54
  "axios": "^0.23.0",
@@ -62,7 +62,6 @@
62
62
  "pixelmatch": "^5.2.1",
63
63
  "react": "^17.0.2",
64
64
  "react-dom": "^17.0.2",
65
- "styled-components": "^5.1.1",
66
65
  "ts-jest": "^27.0.5",
67
66
  "ts-loader": "^8.1.0",
68
67
  "ts-node": "^9.1.1",
@@ -1,5 +0,0 @@
1
- /**
2
- * @see https://github.com/elad2412/the-new-css-reset
3
- */
4
- export declare const CSSResets: import("styled-components").GlobalStyleComponent<{}, import("styled-components").DefaultTheme>;
5
- //# sourceMappingURL=CSSResets.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CSSResets.d.ts","sourceRoot":"","sources":["../../../src/ts/react/CSSResets.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,SAAS,gGAWrB,CAAA"}
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
- import { FlattenSimpleInterpolation } from 'styled-components';
3
- export interface ShadowRootProps {
4
- injectedStyles?: string | FlattenSimpleInterpolation;
5
- }
6
- export interface WithShadowRootProps {
7
- useShadowRoot: boolean;
8
- }
9
- /**
10
- * The ShadowRoot component creates the ShadowDom asynchronously,
11
- * so the useEffect hooks are invoked before the ShadowDom is created, and this means that the children are still not rendered.
12
- *
13
- * By keeping the child as a separate component in the tree, the useEffects will be invoked correctly.
14
- */
15
- export declare function withShadowRoot<Props>(Element: React.ComponentType<Props>): React.FC<Props & ShadowRootProps & WithShadowRootProps>;
16
- //# sourceMappingURL=ShadowRoot.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ShadowRoot.d.ts","sourceRoot":"","sources":["../../../src/ts/react/ShadowRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAA;AAE/C,OAAO,EAGL,0BAA0B,EAC3B,MAAM,mBAAmB,CAAA;AAG1B,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,EAAE,MAAM,GAAG,0BAA0B,CAAA;CACrD;AAoED,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,OAAO,CAAA;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,2DAgBxE"}
@@ -1,2 +0,0 @@
1
- export declare function ArrowIcon(): JSX.Element;
2
- //# sourceMappingURL=ArrowIcon.svg.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ArrowIcon.svg.d.ts","sourceRoot":"","sources":["../../../../../src/ts/react/overlays/ArtboardsInfoOverlay/ArrowIcon.svg.tsx"],"names":[],"mappings":"AAGA,wBAAgB,SAAS,gBAuBxB"}
@@ -1,26 +0,0 @@
1
- import React from 'react';
2
- import { SketchWebDocument, SketchWebArtboard } from '../../../types/WASM';
3
- export interface ArtboardStyle {
4
- font: string;
5
- outlineColor: string;
6
- nameTextColor: string;
7
- ctaTextColor: string;
8
- ctaText: string;
9
- }
10
- declare type MouseEventCallback = (artboard: SketchWebArtboard, e: React.MouseEvent<HTMLElement> | React.TouchEvent<HTMLElement>) => void;
11
- export interface ArtboardProps extends ArtboardStyle {
12
- document: SketchWebDocument;
13
- artboard: SketchWebArtboard;
14
- selected?: boolean;
15
- onClick?: MouseEventCallback;
16
- onDoubleClick?: MouseEventCallback;
17
- onCTAClick?: MouseEventCallback;
18
- }
19
- /**
20
- * This element takes care of:
21
- * - Rendering the artboard name, cta and artboard outline.
22
- * - Tracking the user events on the artboard and emit them when needed.
23
- */
24
- export declare const Artboard: React.ForwardRefExoticComponent<ArtboardProps & React.RefAttributes<HTMLDivElement>>;
25
- export {};
26
- //# sourceMappingURL=Artboard.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Artboard.d.ts","sourceRoot":"","sources":["../../../../../src/ts/react/overlays/ArtboardsInfoOverlay/Artboard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAEtC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAW1E,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,aAAK,kBAAkB,GAAG,CACxB,QAAQ,EAAE,iBAAiB,EAC3B,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAC7D,IAAI,CAAA;AAET,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,kBAAkB,CAAA;IAC5B,aAAa,CAAC,EAAE,kBAAkB,CAAA;IAClC,UAAU,CAAC,EAAE,kBAAkB,CAAA;CAChC;AAED;;;;GAIG;AACH,eAAO,MAAM,QAAQ,sFAuFpB,CAAA"}
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { ArtboardStyle } from './Artboard';
3
- export declare type GoToArtboardEventActionType = 'keyPressEnter' | 'doubleClick' | 'CTA';
4
- interface ArtboardsInfoOverlayProps {
5
- artboardStyle: ArtboardStyle;
6
- onGoToArtboard?: (artboardUUID: string, actionType: GoToArtboardEventActionType) => void;
7
- }
8
- /**
9
- * This is an overlay that renders the artboards' names,
10
- * cta, outline and tracks interactions on them.
11
- */
12
- export declare const ArtboardsInfoOverlay: React.FC<ArtboardsInfoOverlayProps>;
13
- export {};
14
- //# sourceMappingURL=ArtboardsInfoOverlay.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ArtboardsInfoOverlay.d.ts","sourceRoot":"","sources":["../../../../../src/ts/react/overlays/ArtboardsInfoOverlay/ArtboardsInfoOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAG1D,OAAO,EAAY,aAAa,EAAE,MAAM,YAAY,CAAA;AAGpD,oBAAY,2BAA2B,GACnC,eAAe,GACf,aAAa,GACb,KAAK,CAAA;AAET,UAAU,yBAAyB;IACjC,aAAa,EAAE,aAAa,CAAA;IAC5B,cAAc,CAAC,EAAE,CACf,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,2BAA2B,KACpC,IAAI,CAAA;CACV;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA2EpE,CAAA"}
@@ -1,22 +0,0 @@
1
- interface ArtboardProps {
2
- outlineColor: string;
3
- font: string;
4
- selected?: boolean;
5
- }
6
- export declare const Artboard: import("styled-components").StyledComponent<"div", any, ArtboardProps, never>;
7
- export declare const ArtboardHeader: import("styled-components").StyledComponent<"div", any, {
8
- visible?: boolean | undefined;
9
- }, never>;
10
- export declare const ArtboardName: import("styled-components").StyledComponent<"span", any, {
11
- textColor: string;
12
- }, never>;
13
- export declare const ArtboardCTA: import("styled-components").StyledComponent<"button", any, {
14
- visible?: boolean | undefined;
15
- }, never>;
16
- export declare const ArtboardCTAText: import("styled-components").StyledComponent<"span", any, {
17
- textColor: string;
18
- visible?: boolean | undefined;
19
- }, never>;
20
- export declare const ArrowIconWrapper: import("styled-components").StyledComponent<"span", any, {}, never>;
21
- export {};
22
- //# sourceMappingURL=ArtboardsInfoOverlay.styled.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ArtboardsInfoOverlay.styled.d.ts","sourceRoot":"","sources":["../../../../../src/ts/react/overlays/ArtboardsInfoOverlay/ArtboardsInfoOverlay.styled.ts"],"names":[],"mappings":"AAEA,UAAU,aAAa;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,eAAO,MAAM,QAAQ,+EAoBpB,CAAA;AAED,eAAO,MAAM,cAAc;;SAY1B,CAAA;AAED,eAAO,MAAM,YAAY;eAA4B,MAAM;SAQ1D,CAAA;AAED,eAAO,MAAM,WAAW;;SAWvB,CAAA;AAED,eAAO,MAAM,eAAe;eACf,MAAM;;SAMlB,CAAA;AAED,eAAO,MAAM,gBAAgB,qEAK5B,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './ArtboardsInfoOverlay';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ts/react/overlays/ArtboardsInfoOverlay/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA"}
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import { SketchWebDocument } from '../../../types/WASM';
3
- declare type DocumentProps = {
4
- document: SketchWebDocument;
5
- };
6
- /**
7
- * This component renders a transparent div having the same size as the document.
8
- * It also takes into consideration the zoom, pan position.
9
- */
10
- export declare const Document: React.FC<DocumentProps>;
11
- export {};
12
- //# sourceMappingURL=Document.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Document.d.ts","sourceRoot":"","sources":["../../../../../src/ts/react/overlays/Overlay/Document.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,aAAK,aAAa,GAAG;IACnB,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAsB5C,CAAA"}
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- interface OverlayProps {
3
- onClick?: (event: React.MouseEvent<HTMLElement> | React.TouchEvent<HTMLElement>) => void;
4
- }
5
- /**
6
- * This is the base overlay component that can be used to wrap any new overlay.
7
- * It automatically tracks the document bounds on screen, so the child overlay
8
- * can just display the items without having to worry about the zoom, pan, document bounds, etc.
9
- */
10
- export declare const Overlay: React.FC<OverlayProps>;
11
- export {};
12
- //# sourceMappingURL=Overlay.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../../../../../src/ts/react/overlays/Overlay/Overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,UAAU,YAAY;IACpB,OAAO,CAAC,EAAE,CACR,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KACjE,IAAI,CAAA;CACV;AAED;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAU1C,CAAA"}
@@ -1,3 +0,0 @@
1
- export declare const Overlay: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export declare const Document: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- //# sourceMappingURL=Overlay.styled.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Overlay.styled.d.ts","sourceRoot":"","sources":["../../../../../src/ts/react/overlays/Overlay/Overlay.styled.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,oEAOnB,CAAA;AAED,eAAO,MAAM,QAAQ,oEAKpB,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './Overlay';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ts/react/overlays/Overlay/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA"}
@@ -1,3 +0,0 @@
1
- export * from './Overlay';
2
- export * from './ArtboardsInfoOverlay';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ts/react/overlays/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,wBAAwB,CAAA"}