diff --git a/frontend/src/components/StickerCanvas.vue b/frontend/src/components/StickerCanvas.vue index a47dc74..30966ea 100644 --- a/frontend/src/components/StickerCanvas.vue +++ b/frontend/src/components/StickerCanvas.vue @@ -221,7 +221,7 @@ function imageStickerConfig(s: StickerLayer) { } import { STICKERS } from '@/assets/stickers/index' -import { CUSTOM_STICKER_ASSETS, customAssetUrl } from '@/assets/stickers/customAssets' +import { CUSTOM_STICKER_ASSETS } from '@/assets/stickers/customAssets' function emojiFor(s: StickerLayer): string { // New stickers carry the glyph directly; legacy stickers fall back to diff --git a/frontend/src/components/StickerTray.vue b/frontend/src/components/StickerTray.vue index 36bc950..4370bef 100644 --- a/frontend/src/components/StickerTray.vue +++ b/frontend/src/components/StickerTray.vue @@ -46,7 +46,6 @@

Any emoji

Tap the box, then pick from your keyboard's emoji button.

([]) -const emojiInputRef = ref() onMounted(() => { recents.value = loadRecents() diff --git a/public/build/assets/BaseBottomSheet-BMI-Oljh.js b/public/build/assets/BaseBottomSheet-BMI-Oljh.js deleted file mode 100644 index 671bf01..0000000 --- a/public/build/assets/BaseBottomSheet-BMI-Oljh.js +++ /dev/null @@ -1 +0,0 @@ -import{D as e,E as t,F as n,H as r,K as i,L as a,M as o,R as s,S as c,_ as l,a as u,d,f,g as p,m,q as h,r as g,t as _,v,x as y,y as b,z as x}from"./_plugin-vue_export-helper-eepT72yB.js";var S=g(`devices`,()=>{let e=r([]),t=r(!1),n=r(null);async function i(r={}){r.silent||(t.value=!0),n.value=null;try{let t=await fetch(`/api/devices`);if(!t.ok)throw Error(`Failed to load devices`);e.value=await t.json()}catch(e){n.value=e instanceof Error?e.message:`Unknown error`}finally{t.value=!1}}async function a(t,n){let r=await fetch(`/api/devices/${t}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)});if(!r.ok)throw Error(`Failed to update device`);let i=await r.json(),a=e.value.findIndex(e=>e.id===t);return a!==-1&&(e.value[a]=i),i}async function o(t,n){let r=await fetch(`/api/devices/${t}/lock`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({imageId:n})});if(!r.ok)throw Error(`Failed to lock image`);let i=await r.json(),a=e.value.findIndex(e=>e.id===t);return a!==-1&&(e.value[a]=i),i}async function s(t){if(!(await fetch(`/api/devices/${t}`,{method:`DELETE`})).ok)throw Error(`Failed to remove device`);e.value=e.value.filter(e=>e.id!==t)}async function c(t){let n=await fetch(`/api/devices/${t}/lock`,{method:`DELETE`});if(!n.ok)throw Error(`Failed to unlock`);let r=await n.json(),i=e.value.findIndex(e=>e.id===t);return i!==-1&&(e.value[i]=r),r}return{devices:e,loading:t,error:n,fetchDevices:i,updateDevice:a,removeDevice:s,lockImage:o,unlockImage:c}}),C=g(`upload`,()=>{let e=r(null),t=r(null),n=r(null),i=r(null),a=r(null),o=r(null),s=r([]),c=r(null),l=r([]),u=r(null);function d(n,r){_(),e.value=n,t.value=URL.createObjectURL(n),c.value=r??null,l.value=r?[r]:[]}async function f(n,r){_();let i=await(await fetch(n.originalUrl)).blob();e.value=new File([i],n.originalFilename,{type:i.type}),t.value=URL.createObjectURL(i),u.value=n.id,a.value=n.cropParams??null,o.value=n.cropOrientation??null,s.value=n.stickerState?[...n.stickerState]:[],l.value=n.approvedDeviceIds,c.value=r??null}function p(e,t,r){i.value&&URL.revokeObjectURL(i.value),n.value=e,i.value=URL.createObjectURL(e),a.value=t,o.value=r}function m(e){s.value=[...s.value,e]}function h(e,t){s.value=s.value.map(n=>n.id===e?{...n,...t}:n)}function g(e){s.value=s.value.filter(t=>t.id!==e)}function _(){t.value&&URL.revokeObjectURL(t.value),i.value&&URL.revokeObjectURL(i.value),e.value=null,t.value=null,n.value=null,i.value=null,a.value=null,o.value=null,s.value=[],c.value=null,l.value=[],u.value=null}return{originalFile:e,originalUrl:t,croppedBlob:n,croppedUrl:i,cropParams:a,cropOrientation:o,stickers:s,contextDeviceId:c,selectedDeviceIds:l,editingImageId:u,init:d,initEdit:f,setCrop:p,addSticker:m,updateSticker:h,removeSticker:g,cleanup:_}}),w={key:0,class:`btn__spinner`,"aria-hidden":`true`},T=_(c({__name:`BaseButton`,props:{variant:{default:`primary`},tag:{default:`button`},type:{default:`button`},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},setup(e){return(r,i)=>(o(),l(a(e.tag),t({type:e.tag===`button`?e.type:void 0,disabled:e.disabled||e.loading,class:[`btn`,`btn--${e.variant}`,{"btn--loading":e.loading}]},r.$attrs),{default:x(()=>[e.loading?(o(),b(`span`,w)):v(``,!0),n(r.$slots,`default`,{},void 0,!0)]),_:3},16,[`type`,`disabled`,`class`]))}}),[[`__scopeId`,`data-v-7d3f1e61`]]),E=[`aria-label`],D=80,O=_(c({__name:`BaseBottomSheet`,props:{modelValue:{type:Boolean},label:{}},emits:[`update:modelValue`],setup(t,{emit:a}){let c=t,g=a,_=r(null),S=r(0),C=r(!1),w=0,T=null,O=null;function k(){g(`update:modelValue`,!1)}function A(e){w=e.touches[0].clientY,C.value=!0,S.value=0}function j(e){if(!C.value)return;let t=e.touches[0].clientY-w;S.value=t>0?t:0}function M(){C.value&&(C.value=!1,S.value>D&&k(),S.value=0)}function N(e){e.pointerType!==`touch`&&(w=e.clientY,C.value=!0,S.value=0,T=e.pointerId,e.currentTarget.setPointerCapture(e.pointerId),window.addEventListener(`pointermove`,P),window.addEventListener(`pointerup`,F),window.addEventListener(`pointercancel`,F))}function P(e){if(!C.value||e.pointerId!==T)return;let t=e.clientY-w;S.value=t>0?t:0}function F(e){e.pointerId===T&&(T=null,window.removeEventListener(`pointermove`,P),window.removeEventListener(`pointerup`,F),window.removeEventListener(`pointercancel`,F),M())}return s(()=>c.modelValue,async t=>{t?(O=document.activeElement,await e(),_.value?.focus()):(O?.focus(),O=null,S.value=0,C.value=!1)}),(e,r)=>(o(),l(m,{to:`body`},[y(u,{name:`sheet`},{default:x(()=>[t.modelValue?(o(),b(`div`,{key:0,class:`sheet-overlay`,role:`dialog`,"aria-label":t.label,"aria-modal":`true`,onClick:f(k,[`self`]),onKeydown:d(k,[`esc`])},[p(`div`,{ref_key:`sheetRef`,ref:_,class:i([`sheet`,{"sheet--dragging":C.value}]),style:h(S.value>0?{transform:`translateY(${S.value}px)`}:void 0),tabindex:`-1`},[p(`div`,{class:`sheet__handle-target`,onTouchstartPassive:A,onTouchmovePassive:j,onTouchend:M,onTouchcancel:M,onPointerdown:N,"aria-hidden":`true`},[...r[0]||=[p(`div`,{class:`sheet__handle`},null,-1)]],32),n(e.$slots,`default`,{},void 0,!0)],6)],40,E)):v(``,!0)]),_:3})]))}}),[[`__scopeId`,`data-v-967683c3`]]);export{S as i,T as n,C as r,O as t}; \ No newline at end of file diff --git a/public/build/assets/BaseBottomSheet-Bsol3Sat.js b/public/build/assets/BaseBottomSheet-Bsol3Sat.js new file mode 100644 index 0000000..56901a5 --- /dev/null +++ b/public/build/assets/BaseBottomSheet-Bsol3Sat.js @@ -0,0 +1 @@ +import{B as e,C as t,D as n,I as r,J as i,N as a,O as o,R as s,S as c,U as l,_ as u,a as d,d as f,f as p,g as m,m as h,q as g,r as _,t as v,v as y,y as b,z as x}from"./_plugin-vue_export-helper-BNDVmFr7.js";var S=_(`devices`,()=>{let e=l([]),t=l(!1),n=l(null);async function r(r={}){r.silent||(t.value=!0),n.value=null;try{let t=await fetch(`/api/devices`);if(!t.ok)throw Error(`Failed to load devices`);e.value=await t.json()}catch(e){n.value=e instanceof Error?e.message:`Unknown error`}finally{t.value=!1}}async function i(t,n){let r=await fetch(`/api/devices/${t}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)});if(!r.ok)throw Error(`Failed to update device`);let i=await r.json(),a=e.value.findIndex(e=>e.id===t);return a!==-1&&(e.value[a]=i),i}async function a(t,n){let r=await fetch(`/api/devices/${t}/lock`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({imageId:n})});if(!r.ok)throw Error(`Failed to lock image`);let i=await r.json(),a=e.value.findIndex(e=>e.id===t);return a!==-1&&(e.value[a]=i),i}async function o(t){if(!(await fetch(`/api/devices/${t}`,{method:`DELETE`})).ok)throw Error(`Failed to remove device`);e.value=e.value.filter(e=>e.id!==t)}async function s(t){let n=await fetch(`/api/devices/${t}/lock`,{method:`DELETE`});if(!n.ok)throw Error(`Failed to unlock`);let r=await n.json(),i=e.value.findIndex(e=>e.id===t);return i!==-1&&(e.value[i]=r),r}return{devices:e,loading:t,error:n,fetchDevices:r,updateDevice:i,removeDevice:o,lockImage:a,unlockImage:s}}),C=_(`upload`,()=>{let e=l(null),t=l(null),n=l(null),r=l(null),i=l(null),a=l(null),o=l([]),s=l(null),c=l([]),u=l(null);function d(n,r){_(),e.value=n,t.value=URL.createObjectURL(n),s.value=r??null,c.value=r?[r]:[]}async function f(n,r){_();let l=await(await fetch(n.originalUrl)).blob();e.value=new File([l],n.originalFilename,{type:l.type}),t.value=URL.createObjectURL(l),u.value=n.id,i.value=n.cropParams??null,a.value=n.cropOrientation??null,o.value=n.stickerState?[...n.stickerState]:[],c.value=n.approvedDeviceIds,s.value=r??null}function p(e,t,o){r.value&&URL.revokeObjectURL(r.value),n.value=e,r.value=URL.createObjectURL(e),i.value=t,a.value=o}function m(e){o.value=[...o.value,e]}function h(e,t){o.value=o.value.map(n=>n.id===e?{...n,...t}:n)}function g(e){o.value=o.value.filter(t=>t.id!==e)}function _(){t.value&&URL.revokeObjectURL(t.value),r.value&&URL.revokeObjectURL(r.value),e.value=null,t.value=null,n.value=null,r.value=null,i.value=null,a.value=null,o.value=[],s.value=null,c.value=[],u.value=null}return{originalFile:e,originalUrl:t,croppedBlob:n,croppedUrl:r,cropParams:i,cropOrientation:a,stickers:o,contextDeviceId:s,selectedDeviceIds:c,editingImageId:u,init:d,initEdit:f,setCrop:p,addSticker:m,updateSticker:h,removeSticker:g,cleanup:_}}),w={key:0,class:`btn__spinner`,"aria-hidden":`true`},T=v(t({__name:`BaseButton`,props:{variant:{default:`primary`},tag:{default:`button`},type:{default:`button`},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},setup(t){return(i,o)=>(a(),u(s(t.tag),n({type:t.tag===`button`?t.type:void 0,disabled:t.disabled||t.loading,class:[`btn`,`btn--${t.variant}`,{"btn--loading":t.loading}]},i.$attrs),{default:e(()=>[t.loading?(a(),b(`span`,w)):y(``,!0),r(i.$slots,`default`,{},void 0,!0)]),_:3},16,[`type`,`disabled`,`class`]))}}),[[`__scopeId`,`data-v-7d3f1e61`]]),E=[`aria-label`],D=80,O=v(t({__name:`BaseBottomSheet`,props:{modelValue:{type:Boolean},label:{}},emits:[`update:modelValue`],setup(t,{emit:n}){let s=t,_=n,v=l(null),S=l(0),C=l(!1),w=0,T=null,O=null;function k(){_(`update:modelValue`,!1)}function A(e){w=e.touches[0].clientY,C.value=!0,S.value=0}function j(e){if(!C.value)return;let t=e.touches[0].clientY-w;S.value=t>0?t:0}function M(){C.value&&(C.value=!1,S.value>D&&k(),S.value=0)}function N(e){e.pointerType!==`touch`&&(w=e.clientY,C.value=!0,S.value=0,T=e.pointerId,e.currentTarget.setPointerCapture(e.pointerId),window.addEventListener(`pointermove`,P),window.addEventListener(`pointerup`,F),window.addEventListener(`pointercancel`,F))}function P(e){if(!C.value||e.pointerId!==T)return;let t=e.clientY-w;S.value=t>0?t:0}function F(e){e.pointerId===T&&(T=null,window.removeEventListener(`pointermove`,P),window.removeEventListener(`pointerup`,F),window.removeEventListener(`pointercancel`,F),M())}return x(()=>s.modelValue,async e=>{e?(O=document.activeElement,await o(),v.value?.focus()):(O?.focus(),O=null,S.value=0,C.value=!1)}),(n,o)=>(a(),u(h,{to:`body`},[c(d,{name:`sheet`},{default:e(()=>[t.modelValue?(a(),b(`div`,{key:0,class:`sheet-overlay`,role:`dialog`,"aria-label":t.label,"aria-modal":`true`,onClick:p(k,[`self`]),onKeydown:f(k,[`esc`])},[m(`div`,{ref_key:`sheetRef`,ref:v,class:g([`sheet`,{"sheet--dragging":C.value}]),style:i(S.value>0?{transform:`translateY(${S.value}px)`}:void 0),tabindex:`-1`},[m(`div`,{class:`sheet__handle-target`,onTouchstartPassive:A,onTouchmovePassive:j,onTouchend:M,onTouchcancel:M,onPointerdown:N,"aria-hidden":`true`},[...o[0]||=[m(`div`,{class:`sheet__handle`},null,-1)]],32),r(n.$slots,`default`,{},void 0,!0)],6)],40,E)):y(``,!0)]),_:3})]))}}),[[`__scopeId`,`data-v-967683c3`]]);export{S as i,T as n,C as r,O as t}; \ No newline at end of file diff --git a/public/build/assets/DevicePicker-1UBxnMbg.js b/public/build/assets/DevicePicker-1UBxnMbg.js new file mode 100644 index 0000000..134932e --- /dev/null +++ b/public/build/assets/DevicePicker-1UBxnMbg.js @@ -0,0 +1 @@ +import{B as e,C as t,F as n,N as r,S as i,Y as a,_ as o,g as s,h as c,p as l,t as u,x as d,y as f}from"./_plugin-vue_export-helper-BNDVmFr7.js";import{n as p,t as m}from"./BaseBottomSheet-Bsol3Sat.js";var h={class:`device-picker__list`},g=[`checked`,`onChange`],_={class:`device-picker__name`},v={class:`device-picker__orientation`},y=u(t({__name:`DevicePicker`,props:{modelValue:{type:Boolean},devices:{},selected:{},uploading:{type:Boolean}},emits:[`update:modelValue`,`update:selected`,`confirm`],setup(t,{emit:u}){let y=t,b=u;function x(e){y.selected.includes(e)?b(`update:selected`,y.selected.filter(t=>t!==e)):b(`update:selected`,[...y.selected,e])}let S=c(()=>{let e=y.selected.length;return e===0?`Add to frame`:`Add to ${e} frame${e>1?`s`:``}`});return(c,u)=>(r(),o(m,{"model-value":t.modelValue,label:`Choose frames`,"onUpdate:modelValue":u[1]||=e=>c.$emit(`update:modelValue`,e)},{default:e(()=>[u[2]||=s(`h2`,{class:`device-picker__title`},`Add to frames`,-1),u[3]||=s(`p`,{class:`device-picker__sub`},`Choose which frames will show this photo.`,-1),s(`div`,h,[(r(!0),f(l,null,n(t.devices,e=>(r(),f(`label`,{key:e.id,class:`device-picker__row`},[s(`input`,{type:`checkbox`,class:`device-picker__check`,checked:t.selected.includes(e.id),onChange:t=>x(e.id)},null,40,g),s(`span`,_,a(e.name),1),s(`span`,v,a(e.orientation),1)]))),128))]),i(p,{variant:`primary`,class:`device-picker__confirm`,disabled:t.selected.length===0||t.uploading,onClick:u[0]||=e=>c.$emit(`confirm`)},{default:e(()=>[d(a(t.uploading?`Uploading…`:S.value),1)]),_:1},8,[`disabled`])]),_:1},8,[`model-value`]))}}),[[`__scopeId`,`data-v-a6466fa5`]]);export{y as t}; \ No newline at end of file diff --git a/public/build/assets/DevicePicker-C6ucVR6N.js b/public/build/assets/DevicePicker-C6ucVR6N.js deleted file mode 100644 index b5a30b8..0000000 --- a/public/build/assets/DevicePicker-C6ucVR6N.js +++ /dev/null @@ -1 +0,0 @@ -import{J as e,M as t,P as n,S as r,_ as i,b as a,g as o,h as s,p as c,t as l,x as u,y as d,z as f}from"./_plugin-vue_export-helper-eepT72yB.js";import{n as p,t as m}from"./BaseBottomSheet-BMI-Oljh.js";var h={class:`device-picker__list`},g=[`checked`,`onChange`],_={class:`device-picker__name`},v={class:`device-picker__orientation`},y=l(r({__name:`DevicePicker`,props:{modelValue:{type:Boolean},devices:{},selected:{},uploading:{type:Boolean}},emits:[`update:modelValue`,`update:selected`,`confirm`],setup(r,{emit:l}){let y=r,b=l;function x(e){y.selected.includes(e)?b(`update:selected`,y.selected.filter(t=>t!==e)):b(`update:selected`,[...y.selected,e])}let S=s(()=>{let e=y.selected.length;return e===0?`Add to frame`:`Add to ${e} frame${e>1?`s`:``}`});return(s,l)=>(t(),i(m,{"model-value":r.modelValue,label:`Choose frames`,"onUpdate:modelValue":l[1]||=e=>s.$emit(`update:modelValue`,e)},{default:f(()=>[l[2]||=o(`h2`,{class:`device-picker__title`},`Add to frames`,-1),l[3]||=o(`p`,{class:`device-picker__sub`},`Choose which frames will show this photo.`,-1),o(`div`,h,[(t(!0),d(c,null,n(r.devices,n=>(t(),d(`label`,{key:n.id,class:`device-picker__row`},[o(`input`,{type:`checkbox`,class:`device-picker__check`,checked:r.selected.includes(n.id),onChange:e=>x(n.id)},null,40,g),o(`span`,_,e(n.name),1),o(`span`,v,e(n.orientation),1)]))),128))]),u(p,{variant:`primary`,class:`device-picker__confirm`,disabled:r.selected.length===0||r.uploading,onClick:l[0]||=e=>s.$emit(`confirm`)},{default:f(()=>[a(e(r.uploading?`Uploading…`:S.value),1)]),_:1},8,[`disabled`])]),_:1},8,[`model-value`]))}}),[[`__scopeId`,`data-v-a6466fa5`]]);export{y as t}; \ No newline at end of file diff --git a/public/build/assets/HomeView-BDJhYpJV.js b/public/build/assets/HomeView-BDJhYpJV.js deleted file mode 100644 index 6c8f46a..0000000 --- a/public/build/assets/HomeView-BDJhYpJV.js +++ /dev/null @@ -1 +0,0 @@ -import{A as e,B as t,E as n,G as r,H as i,J as a,K as o,M as s,P as c,R as l,S as u,_ as ee,a as te,b as ne,c as re,f as ie,g as d,h as f,i as p,k as ae,l as m,m as oe,p as h,q as g,t as _,u as se,v,x as y,y as b,z as x}from"./_plugin-vue_export-helper-eepT72yB.js";import{o as ce,s as le}from"./index-BO5caB_f.js";import{i as S,n as C,r as ue,t as de}from"./BaseBottomSheet-BMI-Oljh.js";import{t as fe}from"./PullToRefresh-BEXU4J3A.js";var w=`https://pictureframe.edholm.me/devices/`;function pe(){let{devices:t}=p(S()),n=new Map,r=new Map,i=window.__PF_MERCURE_URL__;if(!i)return{connectedCount:()=>0};function a(e){if(!n.has(e))try{let s=new URL(i);s.searchParams.append(`topic`,w+e);let c=new EventSource(s.toString(),{withCredentials:!0});c.onmessage=e=>{try{let n=JSON.parse(e.data);if(`deleted`in n&&n.deleted===!0){t.value=t.value.filter(e=>e.id!==n.id),o(n.id);return}let r=n,i=t.value.findIndex(e=>e.id===r.id);i!==-1&&(t.value[i]=r)}catch(e){console.warn(`[mercure] parse error`,e)}},c.onerror=()=>{if(c.readyState===EventSource.CLOSED){o(e);let t=window.setTimeout(()=>{r.delete(e),a(e)},5e3);r.set(e,t)}},n.set(e,c)}catch(t){console.warn(`[mercure] open failed for device `+e,t)}}function o(e){let t=n.get(e);t&&(t.close(),n.delete(e));let i=r.get(e);i!==void 0&&(clearTimeout(i),r.delete(e))}return l(t,e=>{let t=new Set(e.map(e=>e.id));for(let e of t)n.has(e)||a(e);for(let e of[...n.keys()])t.has(e)||o(e)},{immediate:!0,deep:!1}),e(()=>{for(let e of[...n.keys()])o(e)}),{connectedCount:()=>n.size}}var T=[`src`,`alt`],E={class:`frame-card__body`},D={class:`frame-card__info`},O={class:`frame-card__name`},me={class:`frame-card__status-line`,"aria-live":`polite`},k={class:`frame-card__status-text`},A={key:0,class:`frame-card__sync-line`},j={key:0},he={key:1,class:`frame-card__sync-sep`,"aria-hidden":`true`},M={key:2},N={key:1,class:`frame-card__count`},P={key:0},F={key:1,"aria-hidden":`true`},I=_(u({__name:`FrameCard`,props:{deviceId:{},name:{},size:{},status:{},orientation:{},thumbnailUrl:{},photoCount:{},lastSync:{},nextSync:{}},emits:[`add-photo`,`edit`],setup(e){let t=e,n=f(()=>({})),r=f(()=>t.size===`large`?{aspectRatio:t.orientation===`portrait`?`3 / 5`:`5 / 3`}:{}),i=f(()=>{switch(t.status){case`ok`:return`Online`;case`sync-fail`:return`Sync issue`;case`offline`:return`Offline`}});return(t,c)=>(s(),b(`div`,{class:o([`frame-card`,`frame-card--${e.size}`,`frame-card--${e.status}`])},[e.size===`large`?(s(),b(`button`,{key:0,class:`frame-card__settings-btn`,type:`button`,"aria-label":`Frame settings`,onClick:c[0]||=n=>t.$emit(`edit`,e.deviceId)},[...c[2]||=[d(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,"aria-hidden":`true`},[d(`circle`,{cx:`12`,cy:`12`,r:`3`}),d(`path`,{d:`M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z`})],-1)]])):v(``,!0),d(`div`,{class:`frame-card__preview`,style:g(n.value)},[e.thumbnailUrl?(s(),b(`img`,{key:0,src:e.thumbnailUrl,alt:`Current photo on ${e.name}`,class:`frame-card__img`},null,8,T)):(s(),b(`div`,{key:1,class:`frame-card__empty-preview`,style:g(r.value),"aria-hidden":`true`},[...c[3]||=[d(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`},[d(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`}),d(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`}),d(`polyline`,{points:`21,15 16,10 5,21`})],-1)]],4))],4),d(`div`,E,[d(`div`,D,[d(`p`,O,a(e.name),1),d(`p`,me,[c[4]||=d(`span`,{class:`frame-card__status-dot`,"aria-hidden":`true`},null,-1),d(`span`,k,a(i.value),1)]),e.size===`large`&&(e.lastSync||e.nextSync)?(s(),b(`p`,A,[e.lastSync?(s(),b(`span`,j,`synced `+a(e.lastSync),1)):v(``,!0),e.lastSync&&e.nextSync?(s(),b(`span`,he,`·`)):v(``,!0),e.nextSync?(s(),b(`span`,M,a(e.nextSync),1)):v(``,!0)])):e.size===`compact`&&e.photoCount!==void 0?(s(),b(`p`,N,a(e.photoCount)+` `+a(e.photoCount===1?`photo`:`photos`),1)):v(``,!0)]),y(C,{variant:e.size===`large`?`primary`:`icon-pill`,"aria-label":`Add photo to ${e.name}`,class:`frame-card__add-btn`,onClick:c[1]||=n=>t.$emit(`add-photo`,e.deviceId)},{default:x(()=>[e.size===`large`?(s(),b(`span`,P,`+ Add Photo`)):(s(),b(`span`,F,`+`))]),_:1},8,[`variant`,`aria-label`])])],2))}}),[[`__scopeId`,`data-v-608d39a4`]]),L=[`id`,`value`,`type`],R=[`for`],z=[`id`],ge=_(u({__name:`BaseInput`,props:{modelValue:{default:``},label:{},type:{default:`text`},error:{},id:{}},emits:[`update:modelValue`,`blur`],setup(e,{emit:t}){let r=e,i=t,c=f(()=>r.id??`input-${Math.random().toString(36).slice(2)}`);return(t,r)=>(s(),b(`div`,{class:o([`input-wrap`,{"input-wrap--error":!!e.error,"input-wrap--filled":!!e.modelValue}])},[d(`input`,n({id:c.value},t.$attrs,{value:e.modelValue,type:e.type,class:`input-wrap__field`,placeholder:` `,onInput:r[0]||=e=>i(`update:modelValue`,e.target.value),onBlur:r[1]||=e=>i(`blur`,e)}),null,16,L),d(`label`,{for:c.value,class:`input-wrap__label`},a(e.label),9,R),e.error?(s(),b(`p`,{key:0,id:`${c.value}-error`,class:`input-wrap__error`,role:`alert`},a(e.error),9,z)):v(``,!0)],2))}}),[[`__scopeId`,`data-v-c8235ab2`]]),B={class:`orientation-picker`,role:`radiogroup`,"aria-label":`Display orientation`},V=[`aria-checked`,`aria-label`,`onClick`],H=[`viewBox`],U=[`stroke`,`fill`],W=[`fill`],G={class:`orientation-opt__label`},K={class:`orientation-opt__sub`},_e=_(u({__name:`OrientationPicker`,props:{modelValue:{}},emits:[`update:modelValue`],setup(e){let t=[{value:`landscape`,label:`Landscape`,sub:`Ribbon at bottom`,viewBox:`0 0 48 48`,rect:{x:4,y:12,width:40,height:24},ribbon:{x:20,y:36,width:8,height:5}},{value:`portrait`,label:`Portrait`,sub:`Ribbon on left`,viewBox:`0 0 48 48`,rect:{x:12,y:4,width:24,height:40},ribbon:{x:7,y:20,width:5,height:8}}];return(r,i)=>(s(),b(`div`,B,[(s(),b(h,null,c(t,t=>d(`button`,{key:t.value,type:`button`,role:`radio`,"aria-checked":e.modelValue===t.value,"aria-label":t.label,class:o([`orientation-opt`,{"orientation-opt--active":e.modelValue===t.value}]),onClick:e=>r.$emit(`update:modelValue`,t.value)},[(s(),b(`svg`,{class:`orientation-opt__diagram`,viewBox:t.viewBox,fill:`none`,"aria-hidden":`true`},[d(`rect`,n({ref_for:!0},t.rect,{rx:`2`,stroke:e.modelValue===t.value?`var(--color-primary)`:`currentColor`,"stroke-width":`1.5`,fill:e.modelValue===t.value?`color-mix(in srgb, var(--color-primary) 12%, transparent)`:`var(--color-surface-2)`}),null,16,U),d(`rect`,n({ref_for:!0},t.ribbon,{fill:e.modelValue===t.value?`var(--color-primary)`:`var(--color-text-muted)`,rx:`1`}),null,16,W)],8,H)),d(`span`,G,a(t.label),1),d(`span`,K,a(t.sub),1)],10,V)),64))]))}}),[[`__scopeId`,`data-v-679dae08`]]),ve={class:`home-view`},ye={key:0,class:`home-view__loading`,"aria-live":`polite`},be={key:1,class:`home-view__empty`},xe={key:2,class:`home-view__single`},Se=[`aria-label`],Ce={class:`home-view__sheet-field`},we={class:`home-view__sheet-field`},Te={class:`home-view__sheet-field`},Ee={key:0,class:`home-view__times-mode`},De={class:`home-view__times-list`},Oe=[`value`,`onChange`],ke=[`value`],Ae=[`value`,`onChange`],je=[`value`],Me=[`value`,`onChange`],Ne=[`aria-label`,`onClick`],Pe={key:0,class:`home-view__times-empty`},Fe=[`label`],Ie=[`value`],Le={key:1,class:`home-view__interval-mode`},Re={class:`home-view__interval-input-row`},ze={class:`home-view__next-update`,"aria-live":`polite`},Be={class:`home-view__sheet-field`},Ve={class:`home-view__rotation-checkbox`},He={class:`home-view__remove-modal-card`},Ue={class:`home-view__remove-confirm-actions`},We=[`disabled`],Ge=[`disabled`],q=_(u({__name:`HomeView`,setup(n){function o(e){return e.wakeTimes.length>0?1440*60*1e3:e.rotationIntervalMinutes*6e4}function l(e){if(!e.lastSeenAt)return`offline`;let t=Date.now()-new Date(e.lastSeenAt).getTime(),n=o(e);return t<=n?`ok`:t<=2*n?`sync-fail`:`offline`}function u(e){if(!e.lastSeenAt)return null;let t=Date.now()-new Date(e.lastSeenAt).getTime();if(t<6e4)return`just now`;if(t<36e5)return`${Math.round(t/6e4)}m ago`;if(t<864e5)return`${Math.round(t/36e5)}h ago`;let n=Math.round(t/864e5);return n===1?`yesterday`:`${n} days ago`}function p(e){let t=Math.floor(e/60),n=e%60,r=t>=12?`PM`:`AM`,i=t%12;i===0&&(i=12);let a=n===0?``:`:${String(n).padStart(2,`0`)}`;return`${i}${a} ${r}`}function g(e,t){let n=new Intl.DateTimeFormat(`en-GB`,{timeZone:t,hour:`2-digit`,minute:`2-digit`,hour12:!1}).formatToParts(e),r=parseInt(n.find(e=>e.type===`hour`)?.value??`0`,10),i=parseInt(n.find(e=>e.type===`minute`)?.value??`0`,10);return r*60+i}function _(e,t){if(e.length===0)return null;let n=g(new Date,t),r=null,i=1/0;for(let t of e){let e=t>n?t-n:1440+(t-n);en})}return r}function w(e){let t=null;if(e.nextPollExpectedAt)t=new Date(e.nextPollExpectedAt).getTime();else if(e.wakeTimes.length>0){let t=_(e.wakeTimes,e.timezone||`UTC`);return t?`next sync ~${p(t.minutes)} ${t.today?`today`:`tomorrow`}`:null}else if(e.lastSeenAt)t=new Date(e.lastSeenAt).getTime()+e.rotationIntervalMinutes*6e4;else return null;let n=t-Date.now();if(n<=0)return null;if(n<6e4)return`next sync in <1m`;if(n<36e5)return`next sync in ${Math.round(n/6e4)}m`;if(n<864e5){let n=e.timezone||`UTC`,r=g(new Date(t),n),i=Ze(new Date(t),n),a=i===0?`today`:i===1?`tomorrow`:`in ${i}d`;return`next sync ~${p(r)} ${a}`}return`next sync in ${Math.round(n/864e5)}d`}function T(e){return e.currentImageId?`/api/devices/${e.id}/preview?v=${e.currentImageId}`:void 0}let E=le(),D=ce(),O=S(),me=ue();pe(),ae(async()=>{await O.fetchDevices(),document.addEventListener(`visibilitychange`,k);let e=Number(D.query.setup);e&&($(e),E.replace({query:{...D.query,setup:void 0}}))}),e(()=>{document.removeEventListener(`visibilitychange`,k)});function k(){document.visibilityState===`visible`&&O.fetchDevices({silent:!0})}let A=i(null);function j(){return window.scrollY>0?!1:(A.value?.scrollTop??0)===0}async function he(){await O.fetchDevices({silent:!0})}function M(e){let t=document.createElement(`input`);t.type=`file`,t.accept=`image/jpeg,image/png,image/webp,image/gif`,t.onchange=()=>{let n=t.files?.[0];n&&(me.init(n,e),E.push(`/upload`))},t.click()}let N=[1,2,3,4,5,6,7,8,9,10,11,12],P=[0,5,10,15,20,25,30,35,40,45,50,55];function F(e){let t=Math.floor(e/60),n=e%60,r=t>=12?`PM`:`AM`,i=t%12;return i===0&&(i=12),{h:i,mm:n,p:r}}function L(e,t,n){let r=e%12;return n===`PM`&&(r+=12),r*60+t}let R=[{label:`Americas`,zones:[{value:`America/New_York`,label:`Eastern — New York, Toronto`},{value:`America/Chicago`,label:`Central — Chicago, Mexico City`},{value:`America/Denver`,label:`Mountain — Denver, Calgary`},{value:`America/Phoenix`,label:`Mountain (no DST) — Phoenix`},{value:`America/Los_Angeles`,label:`Pacific — Los Angeles, Vancouver`},{value:`America/Anchorage`,label:`Alaska — Anchorage`},{value:`Pacific/Honolulu`,label:`Hawaii — Honolulu`},{value:`America/Sao_Paulo`,label:`Brasília — São Paulo`},{value:`America/Argentina/Buenos_Aires`,label:`Argentina — Buenos Aires`},{value:`America/Bogota`,label:`Colombia — Bogotá`}]},{label:`Europe`,zones:[{value:`Europe/London`,label:`GMT/BST — London, Dublin`},{value:`Europe/Lisbon`,label:`WET/WEST — Lisbon`},{value:`Europe/Paris`,label:`CET/CEST — Paris, Brussels, Amsterdam`},{value:`Europe/Berlin`,label:`CET/CEST — Berlin, Vienna, Zurich`},{value:`Europe/Stockholm`,label:`CET/CEST — Stockholm, Oslo, Copenhagen`},{value:`Europe/Helsinki`,label:`EET/EEST — Helsinki, Tallinn, Riga`},{value:`Europe/Warsaw`,label:`CET/CEST — Warsaw, Prague, Budapest`},{value:`Europe/Rome`,label:`CET/CEST — Rome, Madrid`},{value:`Europe/Athens`,label:`EET/EEST — Athens, Bucharest`},{value:`Europe/Istanbul`,label:`TRT — Istanbul`},{value:`Europe/Moscow`,label:`MSK — Moscow`}]},{label:`Asia & Pacific`,zones:[{value:`Asia/Dubai`,label:`GST — Dubai, Abu Dhabi`},{value:`Asia/Karachi`,label:`PKT — Karachi, Islamabad`},{value:`Asia/Kolkata`,label:`IST — India`},{value:`Asia/Dhaka`,label:`BST — Dhaka, Bangladesh`},{value:`Asia/Bangkok`,label:`ICT — Bangkok, Jakarta, Hanoi`},{value:`Asia/Singapore`,label:`SGT — Singapore, Kuala Lumpur`},{value:`Asia/Shanghai`,label:`CST — Beijing, Shanghai, Taipei`},{value:`Asia/Seoul`,label:`KST — Seoul`},{value:`Asia/Tokyo`,label:`JST — Tokyo`},{value:`Australia/Sydney`,label:`AEDT/AEST — Sydney, Melbourne`},{value:`Australia/Brisbane`,label:`AEST (no DST) — Brisbane`},{value:`Australia/Perth`,label:`AWST — Perth`},{value:`Pacific/Auckland`,label:`NZDT/NZST — Auckland`}]},{label:`Africa & Middle East`,zones:[{value:`Africa/Cairo`,label:`EET — Cairo`},{value:`Africa/Nairobi`,label:`EAT — Nairobi, East Africa`},{value:`Africa/Johannesburg`,label:`SAST — Johannesburg`},{value:`Africa/Lagos`,label:`WAT — Lagos, West Africa`}]},{label:`UTC`,zones:[{value:`UTC`,label:`UTC — Coordinated Universal Time`}]}],z=i(!1),B=i(!1),V=i(!1),H=i(!1),U=i(null),W=i(``),G=i(`landscape`),K=i(`interval`),q=i([]),J=i(60),Y=i(`UTC`),X=i(`oldest_upload`),Z=i(!1),Ke=[540,1080,720,1260,360,900,450,1170,0];function qe(){for(let e of Ke)if(!q.value.includes(e)){q.value=[...q.value,e];return}for(let e=0;e<1440;e+=5)if(!q.value.includes(e)){q.value=[...q.value,e];return}}function Je(e){q.value=q.value.filter((t,n)=>n!==e)}function Q(e,t,n){let r=F(q.value[e]),i=t===`h`?parseInt(n,10):r.h,a=t===`mm`?parseInt(n,10):r.mm,o=t===`p`?n:r.p,s=[...q.value];s[e]=L(i,a,o),q.value=s}let Ye=f(()=>{let e=U.value;if(!e)return``;let t=e.timezone||`UTC`,n;if(e.nextPollExpectedAt)n=new Date(e.nextPollExpectedAt).getTime();else if(e.lastSeenAt){let r=new Date(e.lastSeenAt).getTime();n=e.wakeTimes.length>0?Xe(r,e.wakeTimes,t):r+e.rotationIntervalMinutes*6e4}else return`Next update: when the frame next connects`;return nt.id===e);t&&(U.value=t,W.value=t.name,G.value=t.orientation,Y.value=t.timezone??`UTC`,J.value=t.rotationIntervalMinutes,q.value=[...t.wakeTimes],K.value=t.wakeTimes.length>0?`times`:`interval`,X.value=t.rotationMode,Z.value=t.prioritizeNeverShown,H.value=!1,z.value=!0)}async function $e(){if(U.value){V.value=!0;try{await O.removeDevice(U.value.id),z.value=!1,H.value=!1}finally{V.value=!1}}}async function et(){if(U.value){B.value=!0;try{let e={name:W.value.trim()||U.value.name,orientation:G.value,timezone:Y.value,rotationMode:X.value,prioritizeNeverShown:Z.value};K.value===`times`?e.wakeTimes=[...q.value]:(e.wakeTimes=[],e.rotationIntervalMinutes=Math.max(1,Math.min(1440,J.value||1))),await O.updateDevice(U.value.id,e),z.value=!1}finally{B.value=!1}}}return(e,n)=>(s(),b(h,null,[d(`main`,ve,[y(fe,{"is-at-top":j,"on-refresh":he},{default:x(()=>[r(O).loading?(s(),b(`div`,ye,` Loading… `)):r(O).devices.length===0?(s(),b(`div`,be,[...n[11]||=[d(`div`,{class:`home-view__empty-card`},[d(`svg`,{class:`home-view__empty-icon`,width:`48`,height:`48`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,"aria-hidden":`true`},[d(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`}),d(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`}),d(`polyline`,{points:`21,15 16,10 5,21`})]),d(`p`,{class:`home-view__empty-title`},`Set up your first frame`),d(`p`,{class:`home-view__empty-sub`},` Power on your pictureFrame device and scan the QR code it displays to get started. `)],-1)]])):r(O).devices.length===1?(s(),b(`div`,xe,[y(I,{deviceId:r(O).devices[0].id,name:r(O).devices[0].name,size:`large`,status:l(r(O).devices[0]),orientation:r(O).devices[0].orientation,thumbnailUrl:T(r(O).devices[0]),lastSync:u(r(O).devices[0]),nextSync:w(r(O).devices[0]),onAddPhoto:M,onEdit:$},null,8,[`deviceId`,`name`,`status`,`orientation`,`thumbnailUrl`,`lastSync`,`nextSync`])])):(s(),b(`div`,{key:3,ref_key:`stackEl`,ref:A,class:`home-view__stack`,role:`list`,"aria-label":`Frames`},[(s(!0),b(h,null,c(r(O).devices,e=>(s(),b(`div`,{key:e.id,class:`home-view__slide`,role:`listitem`,"aria-label":e.name},[y(I,{deviceId:e.id,name:e.name,size:`large`,status:l(e),orientation:e.orientation,thumbnailUrl:T(e),lastSync:u(e),nextSync:w(e),onAddPhoto:M,onEdit:$},null,8,[`deviceId`,`name`,`status`,`orientation`,`thumbnailUrl`,`lastSync`,`nextSync`])],8,Se))),128))],512))]),_:1})]),y(de,{modelValue:z.value,"onUpdate:modelValue":n[8]||=e=>z.value=e,label:`Frame settings`},{default:x(()=>[n[24]||=d(`h2`,{class:`home-view__sheet-title`},`Frame settings`,-1),d(`div`,Ce,[y(ge,{modelValue:W.value,"onUpdate:modelValue":n[0]||=e=>W.value=e,label:`Frame name`,maxlength:`100`},null,8,[`modelValue`])]),d(`div`,we,[n[12]||=d(`p`,{class:`home-view__sheet-label`},`Orientation`,-1),y(_e,{modelValue:G.value,"onUpdate:modelValue":n[1]||=e=>G.value=e},null,8,[`modelValue`])]),d(`div`,Te,[n[19]||=d(`p`,{class:`home-view__sheet-label`},`Update frequency`,-1),t(d(`select`,{class:`home-view__mode-select`,"onUpdate:modelValue":n[2]||=e=>K.value=e,"aria-label":`Update frequency mode`},[...n[13]||=[d(`option`,{value:`times`},`At specific time(s)`,-1),d(`option`,{value:`interval`},`Every X minutes`,-1)]],512),[[m,K.value]]),K.value===`times`?(s(),b(`div`,Ee,[d(`div`,De,[(s(!0),b(h,null,c(q.value,(e,t)=>(s(),b(`div`,{key:t,class:`home-view__time-row`},[d(`select`,{class:`home-view__time-part`,value:F(e).h,"aria-label":`Hour`,onChange:e=>Q(t,`h`,e.target.value)},[(s(),b(h,null,c(N,e=>d(`option`,{key:e,value:e},a(e),9,ke)),64))],40,Oe),n[16]||=d(`span`,{class:`home-view__time-sep`},`:`,-1),d(`select`,{class:`home-view__time-part`,value:F(e).mm,"aria-label":`Minutes`,onChange:e=>Q(t,`mm`,e.target.value)},[(s(),b(h,null,c(P,e=>d(`option`,{key:e,value:e},a(String(e).padStart(2,`0`)),9,je)),64))],40,Ae),d(`select`,{class:`home-view__time-part home-view__time-part--ampm`,value:F(e).p,"aria-label":`AM or PM`,onChange:e=>Q(t,`p`,e.target.value)},[...n[14]||=[d(`option`,{value:`AM`},`AM`,-1),d(`option`,{value:`PM`},`PM`,-1)]],40,Me),d(`button`,{type:`button`,class:`home-view__time-remove`,"aria-label":`Remove ${p(e)}`,onClick:e=>Je(t)},[...n[15]||=[d(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"aria-hidden":`true`},[d(`polyline`,{points:`3 6 5 6 21 6`}),d(`path`,{d:`M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6`}),d(`path`,{d:`M10 11v6`}),d(`path`,{d:`M14 11v6`})],-1)]],8,Ne)]))),128)),q.value.length===0?(s(),b(`p`,Pe,`No update times yet — add one below.`)):v(``,!0)]),d(`button`,{type:`button`,class:`home-view__time-add`,onClick:qe},`+ Add time`),t(d(`select`,{class:`home-view__tz-select`,"onUpdate:modelValue":n[3]||=e=>Y.value=e},[(s(),b(h,null,c(R,e=>d(`optgroup`,{key:e.label,label:e.label},[(s(!0),b(h,null,c(e.zones,e=>(s(),b(`option`,{key:e.value,value:e.value},a(e.label),9,Ie))),128))],8,Fe)),64))],512),[[m,Y.value]])])):(s(),b(`div`,Le,[d(`div`,Re,[n[17]||=d(`span`,null,`Every`,-1),t(d(`input`,{type:`number`,inputmode:`numeric`,pattern:`[0-9]*`,min:`1`,max:`1440`,class:`home-view__interval-input`,"onUpdate:modelValue":n[4]||=e=>J.value=e,"aria-label":`Update interval in minutes`},null,512),[[se,J.value,void 0,{number:!0}]]),n[18]||=d(`span`,null,`minutes`,-1)])])),d(`p`,ze,a(Ye.value),1),n[20]||=d(`p`,{class:`home-view__propagation-note`},` Changes will only take effect at the next device update. To force an immediate refresh, briefly disconnect and reconnect the frame’s power. `,-1)]),d(`div`,Be,[n[23]||=d(`p`,{class:`home-view__sheet-label`},`Image selection`,-1),t(d(`select`,{class:`home-view__mode-select`,"onUpdate:modelValue":n[5]||=e=>X.value=e,"aria-label":`Image selection mode`},[...n[21]||=[d(`option`,{value:`oldest_upload`},`Oldest upload first`,-1),d(`option`,{value:`newest_upload`},`Newest upload first`,-1),d(`option`,{value:`least_recently_shown`},`Least recently shown`,-1),d(`option`,{value:`random`},`Random`,-1)]],512),[[m,X.value]]),d(`label`,Ve,[t(d(`input`,{type:`checkbox`,"onUpdate:modelValue":n[6]||=e=>Z.value=e},null,512),[[re,Z.value]]),n[22]||=d(`span`,null,`Show never-shown images first`,-1)])]),y(C,{variant:`primary`,class:`home-view__sheet-save`,disabled:B.value,onClick:et},{default:x(()=>[ne(a(B.value?`Saving…`:`Save`),1)]),_:1},8,[`disabled`]),d(`button`,{type:`button`,class:`home-view__remove`,onClick:n[7]||=e=>H.value=!0},`Remove this frame`)]),_:1},8,[`modelValue`]),(s(),ee(oe,{to:`body`},[y(te,{name:`home-view__remove-modal`},{default:x(()=>[H.value?(s(),b(`div`,{key:0,class:`home-view__remove-modal`,role:`alertdialog`,"aria-labelledby":`remove-confirm-title`,onClick:n[10]||=ie(e=>H.value=!1,[`self`])},[d(`div`,He,[n[25]||=d(`p`,{class:`home-view__remove-confirm-title`,id:`remove-confirm-title`},` Remove this frame? `,-1),n[26]||=d(`p`,{class:`home-view__remove-confirm-body`},` Use this if you’re selling or giving away the frame. It deletes this frame from your account and unlinks it from your photos so the next owner can claim it fresh. This can’t be undone. `,-1),n[27]||=d(`p`,{class:`home-view__remove-confirm-aside`},` On the frame itself, the new owner can also do a factory reset by holding the small button on the back until the screen starts to flash. (If they only tap it briefly, the frame just refreshes its current image — keep holding until it flashes.) `,-1),d(`div`,Ue,[d(`button`,{type:`button`,class:`home-view__remove-cancel`,disabled:V.value,onClick:n[9]||=e=>H.value=!1},`Cancel`,8,We),d(`button`,{type:`button`,class:`home-view__remove-confirm-btn`,disabled:V.value,onClick:$e},a(V.value?`Removing…`:`Yes, remove`),9,Ge)])])])):v(``,!0)]),_:1})]))],64))}}),[[`__scopeId`,`data-v-31f99454`]]);export{q as default}; \ No newline at end of file diff --git a/public/build/assets/HomeView-BVevNXVc.js b/public/build/assets/HomeView-BVevNXVc.js new file mode 100644 index 0000000..8d8889d --- /dev/null +++ b/public/build/assets/HomeView-BVevNXVc.js @@ -0,0 +1 @@ +import{A as e,B as t,C as n,D as r,F as i,J as a,K as o,N as s,S as c,U as l,V as u,Y as d,_ as ee,a as te,c as ne,f as re,g as f,h as p,i as m,j as ie,l as h,m as ae,p as g,q as _,t as v,u as oe,v as y,x as se,y as b,z as x}from"./_plugin-vue_export-helper-BNDVmFr7.js";import{o as ce,s as le}from"./index-DdJ5jHP4.js";import{i as S,n as C,r as ue,t as de}from"./BaseBottomSheet-Bsol3Sat.js";import{t as fe}from"./PullToRefresh-CeDTOC7P.js";var w=`https://pictureframe.edholm.me/devices/`;function pe(){let{devices:e}=m(S()),t=new Map,n=new Map,r=window.__PF_MERCURE_URL__;if(!r)return{connectedCount:()=>0};function i(o){if(!t.has(o))try{let s=new URL(r);s.searchParams.append(`topic`,w+o);let c=new EventSource(s.toString(),{withCredentials:!0});c.onmessage=t=>{try{let n=JSON.parse(t.data);if(`deleted`in n&&n.deleted===!0){e.value=e.value.filter(e=>e.id!==n.id),a(n.id);return}let r=n,i=e.value.findIndex(e=>e.id===r.id);i!==-1&&(e.value[i]=r)}catch(e){console.warn(`[mercure] parse error`,e)}},c.onerror=()=>{if(c.readyState===EventSource.CLOSED){a(o);let e=window.setTimeout(()=>{n.delete(o),i(o)},5e3);n.set(o,e)}},t.set(o,c)}catch(e){console.warn(`[mercure] open failed for device `+o,e)}}function a(e){let r=t.get(e);r&&(r.close(),t.delete(e));let i=n.get(e);i!==void 0&&(clearTimeout(i),n.delete(e))}return x(e,e=>{let n=new Set(e.map(e=>e.id));for(let e of n)t.has(e)||i(e);for(let e of[...t.keys()])n.has(e)||a(e)},{immediate:!0,deep:!1}),ie(()=>{for(let e of[...t.keys()])a(e)}),{connectedCount:()=>t.size}}var T=[`src`,`alt`],E={class:`frame-card__body`},D={class:`frame-card__info`},O={class:`frame-card__name`},me={class:`frame-card__status-line`,"aria-live":`polite`},k={class:`frame-card__status-text`},A={key:0,class:`frame-card__sync-line`},he={key:0},j={key:1,class:`frame-card__sync-sep`,"aria-hidden":`true`},M={key:2},N={key:1,class:`frame-card__count`},P={key:0},F={key:1,"aria-hidden":`true`},I=v(n({__name:`FrameCard`,props:{deviceId:{},name:{},size:{},status:{},orientation:{},thumbnailUrl:{},photoCount:{},lastSync:{},nextSync:{}},emits:[`add-photo`,`edit`],setup(e){let n=e,r=p(()=>({})),i=p(()=>n.size===`large`?{aspectRatio:n.orientation===`portrait`?`3 / 5`:`5 / 3`}:{}),o=p(()=>{switch(n.status){case`ok`:return`Online`;case`sync-fail`:return`Sync issue`;case`offline`:return`Offline`}});return(n,l)=>(s(),b(`div`,{class:_([`frame-card`,`frame-card--${e.size}`,`frame-card--${e.status}`])},[e.size===`large`?(s(),b(`button`,{key:0,class:`frame-card__settings-btn`,type:`button`,"aria-label":`Frame settings`,onClick:l[0]||=t=>n.$emit(`edit`,e.deviceId)},[...l[2]||=[f(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,"aria-hidden":`true`},[f(`circle`,{cx:`12`,cy:`12`,r:`3`}),f(`path`,{d:`M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z`})],-1)]])):y(``,!0),f(`div`,{class:`frame-card__preview`,style:a(r.value)},[e.thumbnailUrl?(s(),b(`img`,{key:0,src:e.thumbnailUrl,alt:`Current photo on ${e.name}`,class:`frame-card__img`},null,8,T)):(s(),b(`div`,{key:1,class:`frame-card__empty-preview`,style:a(i.value),"aria-hidden":`true`},[...l[3]||=[f(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`},[f(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`}),f(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`}),f(`polyline`,{points:`21,15 16,10 5,21`})],-1)]],4))],4),f(`div`,E,[f(`div`,D,[f(`p`,O,d(e.name),1),f(`p`,me,[l[4]||=f(`span`,{class:`frame-card__status-dot`,"aria-hidden":`true`},null,-1),f(`span`,k,d(o.value),1)]),e.size===`large`&&(e.lastSync||e.nextSync)?(s(),b(`p`,A,[e.lastSync?(s(),b(`span`,he,`synced `+d(e.lastSync),1)):y(``,!0),e.lastSync&&e.nextSync?(s(),b(`span`,j,`·`)):y(``,!0),e.nextSync?(s(),b(`span`,M,d(e.nextSync),1)):y(``,!0)])):e.size===`compact`&&e.photoCount!==void 0?(s(),b(`p`,N,d(e.photoCount)+` `+d(e.photoCount===1?`photo`:`photos`),1)):y(``,!0)]),c(C,{variant:e.size===`large`?`primary`:`icon-pill`,"aria-label":`Add photo to ${e.name}`,class:`frame-card__add-btn`,onClick:l[1]||=t=>n.$emit(`add-photo`,e.deviceId)},{default:t(()=>[e.size===`large`?(s(),b(`span`,P,`+ Add Photo`)):(s(),b(`span`,F,`+`))]),_:1},8,[`variant`,`aria-label`])])],2))}}),[[`__scopeId`,`data-v-608d39a4`]]),L=[`id`,`value`,`type`],R=[`for`],z=[`id`],ge=v(n({__name:`BaseInput`,props:{modelValue:{default:``},label:{},type:{default:`text`},error:{},id:{}},emits:[`update:modelValue`,`blur`],setup(e,{emit:t}){let n=e,i=t,a=p(()=>n.id??`input-${Math.random().toString(36).slice(2)}`);return(t,n)=>(s(),b(`div`,{class:_([`input-wrap`,{"input-wrap--error":!!e.error,"input-wrap--filled":!!e.modelValue}])},[f(`input`,r({id:a.value},t.$attrs,{value:e.modelValue,type:e.type,class:`input-wrap__field`,placeholder:` `,onInput:n[0]||=e=>i(`update:modelValue`,e.target.value),onBlur:n[1]||=e=>i(`blur`,e)}),null,16,L),f(`label`,{for:a.value,class:`input-wrap__label`},d(e.label),9,R),e.error?(s(),b(`p`,{key:0,id:`${a.value}-error`,class:`input-wrap__error`,role:`alert`},d(e.error),9,z)):y(``,!0)],2))}}),[[`__scopeId`,`data-v-c8235ab2`]]),B={class:`orientation-picker`,role:`radiogroup`,"aria-label":`Display orientation`},V=[`aria-checked`,`aria-label`,`onClick`],H=[`viewBox`],U=[`stroke`,`fill`],W=[`fill`],G={class:`orientation-opt__label`},K={class:`orientation-opt__sub`},_e=v(n({__name:`OrientationPicker`,props:{modelValue:{}},emits:[`update:modelValue`],setup(e){let t=[{value:`landscape`,label:`Landscape`,sub:`Ribbon at bottom`,viewBox:`0 0 48 48`,rect:{x:4,y:12,width:40,height:24},ribbon:{x:20,y:36,width:8,height:5}},{value:`portrait`,label:`Portrait`,sub:`Ribbon on left`,viewBox:`0 0 48 48`,rect:{x:12,y:4,width:24,height:40},ribbon:{x:7,y:20,width:5,height:8}}];return(n,a)=>(s(),b(`div`,B,[(s(),b(g,null,i(t,t=>f(`button`,{key:t.value,type:`button`,role:`radio`,"aria-checked":e.modelValue===t.value,"aria-label":t.label,class:_([`orientation-opt`,{"orientation-opt--active":e.modelValue===t.value}]),onClick:e=>n.$emit(`update:modelValue`,t.value)},[(s(),b(`svg`,{class:`orientation-opt__diagram`,viewBox:t.viewBox,fill:`none`,"aria-hidden":`true`},[f(`rect`,r({ref_for:!0},t.rect,{rx:`2`,stroke:e.modelValue===t.value?`var(--color-primary)`:`currentColor`,"stroke-width":`1.5`,fill:e.modelValue===t.value?`color-mix(in srgb, var(--color-primary) 12%, transparent)`:`var(--color-surface-2)`}),null,16,U),f(`rect`,r({ref_for:!0},t.ribbon,{fill:e.modelValue===t.value?`var(--color-primary)`:`var(--color-text-muted)`,rx:`1`}),null,16,W)],8,H)),f(`span`,G,d(t.label),1),f(`span`,K,d(t.sub),1)],10,V)),64))]))}}),[[`__scopeId`,`data-v-679dae08`]]),ve={class:`home-view`},ye={key:0,class:`home-view__loading`,"aria-live":`polite`},be={key:1,class:`home-view__empty`},xe={key:2,class:`home-view__single`},Se=[`aria-label`],Ce={class:`home-view__sheet-field`},we={class:`home-view__sheet-field`},Te={class:`home-view__sheet-field`},Ee={key:0,class:`home-view__times-mode`},De={class:`home-view__times-list`},Oe=[`value`,`onChange`],ke=[`value`],Ae=[`value`,`onChange`],je=[`value`],Me=[`value`,`onChange`],Ne=[`aria-label`,`onClick`],Pe={key:0,class:`home-view__times-empty`},Fe=[`label`],Ie=[`value`],Le={key:1,class:`home-view__interval-mode`},Re={class:`home-view__interval-input-row`},ze={class:`home-view__next-update`,"aria-live":`polite`},Be={class:`home-view__sheet-field`},Ve={class:`home-view__rotation-checkbox`},He={class:`home-view__remove-modal-card`},Ue={class:`home-view__remove-confirm-actions`},We=[`disabled`],Ge=[`disabled`],q=v(n({__name:`HomeView`,setup(n){function r(e){return e.wakeTimes.length>0?1440*60*1e3:e.rotationIntervalMinutes*6e4}function a(e){if(!e.lastSeenAt)return`offline`;let t=Date.now()-new Date(e.lastSeenAt).getTime(),n=r(e);return t<=n?`ok`:t<=2*n?`sync-fail`:`offline`}function m(e){if(!e.lastSeenAt)return null;let t=Date.now()-new Date(e.lastSeenAt).getTime();if(t<6e4)return`just now`;if(t<36e5)return`${Math.round(t/6e4)}m ago`;if(t<864e5)return`${Math.round(t/36e5)}h ago`;let n=Math.round(t/864e5);return n===1?`yesterday`:`${n} days ago`}function _(e){let t=Math.floor(e/60),n=e%60,r=t>=12?`PM`:`AM`,i=t%12;i===0&&(i=12);let a=n===0?``:`:${String(n).padStart(2,`0`)}`;return`${i}${a} ${r}`}function v(e,t){let n=new Intl.DateTimeFormat(`en-GB`,{timeZone:t,hour:`2-digit`,minute:`2-digit`,hour12:!1}).formatToParts(e),r=parseInt(n.find(e=>e.type===`hour`)?.value??`0`,10),i=parseInt(n.find(e=>e.type===`minute`)?.value??`0`,10);return r*60+i}function x(e,t){if(e.length===0)return null;let n=v(new Date,t),r=null,i=1/0;for(let t of e){let e=t>n?t-n:1440+(t-n);en})}return r}function w(e){let t=null;if(e.nextPollExpectedAt)t=new Date(e.nextPollExpectedAt).getTime();else if(e.wakeTimes.length>0){let t=x(e.wakeTimes,e.timezone||`UTC`);return t?`next sync ~${_(t.minutes)} ${t.today?`today`:`tomorrow`}`:null}else if(e.lastSeenAt)t=new Date(e.lastSeenAt).getTime()+e.rotationIntervalMinutes*6e4;else return null;let n=t-Date.now();if(n<=0)return null;if(n<6e4)return`next sync in <1m`;if(n<36e5)return`next sync in ${Math.round(n/6e4)}m`;if(n<864e5){let n=e.timezone||`UTC`,r=v(new Date(t),n),i=Ze(new Date(t),n),a=i===0?`today`:i===1?`tomorrow`:`in ${i}d`;return`next sync ~${_(r)} ${a}`}return`next sync in ${Math.round(n/864e5)}d`}function T(e){return e.currentImageId?`/api/devices/${e.id}/preview?v=${e.currentImageId}`:void 0}let E=le(),D=ce(),O=S(),me=ue();pe(),e(async()=>{await O.fetchDevices(),document.addEventListener(`visibilitychange`,k);let e=Number(D.query.setup);e&&($(e),E.replace({query:{...D.query,setup:void 0}}))}),ie(()=>{document.removeEventListener(`visibilitychange`,k)});function k(){document.visibilityState===`visible`&&O.fetchDevices({silent:!0})}let A=l(null);function he(){return window.scrollY>0?!1:(A.value?.scrollTop??0)===0}async function j(){await O.fetchDevices({silent:!0})}function M(e){let t=document.createElement(`input`);t.type=`file`,t.accept=`image/jpeg,image/png,image/webp,image/gif`,t.onchange=()=>{let n=t.files?.[0];n&&(me.init(n,e),E.push(`/upload`))},t.click()}let N=[1,2,3,4,5,6,7,8,9,10,11,12],P=[0,5,10,15,20,25,30,35,40,45,50,55];function F(e){let t=Math.floor(e/60),n=e%60,r=t>=12?`PM`:`AM`,i=t%12;return i===0&&(i=12),{h:i,mm:n,p:r}}function L(e,t,n){let r=e%12;return n===`PM`&&(r+=12),r*60+t}let R=[{label:`Americas`,zones:[{value:`America/New_York`,label:`Eastern — New York, Toronto`},{value:`America/Chicago`,label:`Central — Chicago, Mexico City`},{value:`America/Denver`,label:`Mountain — Denver, Calgary`},{value:`America/Phoenix`,label:`Mountain (no DST) — Phoenix`},{value:`America/Los_Angeles`,label:`Pacific — Los Angeles, Vancouver`},{value:`America/Anchorage`,label:`Alaska — Anchorage`},{value:`Pacific/Honolulu`,label:`Hawaii — Honolulu`},{value:`America/Sao_Paulo`,label:`Brasília — São Paulo`},{value:`America/Argentina/Buenos_Aires`,label:`Argentina — Buenos Aires`},{value:`America/Bogota`,label:`Colombia — Bogotá`}]},{label:`Europe`,zones:[{value:`Europe/London`,label:`GMT/BST — London, Dublin`},{value:`Europe/Lisbon`,label:`WET/WEST — Lisbon`},{value:`Europe/Paris`,label:`CET/CEST — Paris, Brussels, Amsterdam`},{value:`Europe/Berlin`,label:`CET/CEST — Berlin, Vienna, Zurich`},{value:`Europe/Stockholm`,label:`CET/CEST — Stockholm, Oslo, Copenhagen`},{value:`Europe/Helsinki`,label:`EET/EEST — Helsinki, Tallinn, Riga`},{value:`Europe/Warsaw`,label:`CET/CEST — Warsaw, Prague, Budapest`},{value:`Europe/Rome`,label:`CET/CEST — Rome, Madrid`},{value:`Europe/Athens`,label:`EET/EEST — Athens, Bucharest`},{value:`Europe/Istanbul`,label:`TRT — Istanbul`},{value:`Europe/Moscow`,label:`MSK — Moscow`}]},{label:`Asia & Pacific`,zones:[{value:`Asia/Dubai`,label:`GST — Dubai, Abu Dhabi`},{value:`Asia/Karachi`,label:`PKT — Karachi, Islamabad`},{value:`Asia/Kolkata`,label:`IST — India`},{value:`Asia/Dhaka`,label:`BST — Dhaka, Bangladesh`},{value:`Asia/Bangkok`,label:`ICT — Bangkok, Jakarta, Hanoi`},{value:`Asia/Singapore`,label:`SGT — Singapore, Kuala Lumpur`},{value:`Asia/Shanghai`,label:`CST — Beijing, Shanghai, Taipei`},{value:`Asia/Seoul`,label:`KST — Seoul`},{value:`Asia/Tokyo`,label:`JST — Tokyo`},{value:`Australia/Sydney`,label:`AEDT/AEST — Sydney, Melbourne`},{value:`Australia/Brisbane`,label:`AEST (no DST) — Brisbane`},{value:`Australia/Perth`,label:`AWST — Perth`},{value:`Pacific/Auckland`,label:`NZDT/NZST — Auckland`}]},{label:`Africa & Middle East`,zones:[{value:`Africa/Cairo`,label:`EET — Cairo`},{value:`Africa/Nairobi`,label:`EAT — Nairobi, East Africa`},{value:`Africa/Johannesburg`,label:`SAST — Johannesburg`},{value:`Africa/Lagos`,label:`WAT — Lagos, West Africa`}]},{label:`UTC`,zones:[{value:`UTC`,label:`UTC — Coordinated Universal Time`}]}],z=l(!1),B=l(!1),V=l(!1),H=l(!1),U=l(null),W=l(``),G=l(`landscape`),K=l(`interval`),q=l([]),J=l(60),Y=l(`UTC`),X=l(`oldest_upload`),Z=l(!1),Ke=[540,1080,720,1260,360,900,450,1170,0];function qe(){for(let e of Ke)if(!q.value.includes(e)){q.value=[...q.value,e];return}for(let e=0;e<1440;e+=5)if(!q.value.includes(e)){q.value=[...q.value,e];return}}function Je(e){q.value=q.value.filter((t,n)=>n!==e)}function Q(e,t,n){let r=F(q.value[e]),i=t===`h`?parseInt(n,10):r.h,a=t===`mm`?parseInt(n,10):r.mm,o=t===`p`?n:r.p,s=[...q.value];s[e]=L(i,a,o),q.value=s}let Ye=p(()=>{let e=U.value;if(!e)return``;let t=e.timezone||`UTC`,n;if(e.nextPollExpectedAt)n=new Date(e.nextPollExpectedAt).getTime();else if(e.lastSeenAt){let r=new Date(e.lastSeenAt).getTime();n=e.wakeTimes.length>0?Xe(r,e.wakeTimes,t):r+e.rotationIntervalMinutes*6e4}else return`Next update: when the frame next connects`;return nt.id===e);t&&(U.value=t,W.value=t.name,G.value=t.orientation,Y.value=t.timezone??`UTC`,J.value=t.rotationIntervalMinutes,q.value=[...t.wakeTimes],K.value=t.wakeTimes.length>0?`times`:`interval`,X.value=t.rotationMode,Z.value=t.prioritizeNeverShown,H.value=!1,z.value=!0)}async function $e(){if(U.value){V.value=!0;try{await O.removeDevice(U.value.id),z.value=!1,H.value=!1}finally{V.value=!1}}}async function et(){if(U.value){B.value=!0;try{let e={name:W.value.trim()||U.value.name,orientation:G.value,timezone:Y.value,rotationMode:X.value,prioritizeNeverShown:Z.value};K.value===`times`?e.wakeTimes=[...q.value]:(e.wakeTimes=[],e.rotationIntervalMinutes=Math.max(1,Math.min(1440,J.value||1))),await O.updateDevice(U.value.id,e),z.value=!1}finally{B.value=!1}}}return(e,n)=>(s(),b(g,null,[f(`main`,ve,[c(fe,{"is-at-top":he,"on-refresh":j},{default:t(()=>[o(O).loading?(s(),b(`div`,ye,` Loading… `)):o(O).devices.length===0?(s(),b(`div`,be,[...n[11]||=[f(`div`,{class:`home-view__empty-card`},[f(`svg`,{class:`home-view__empty-icon`,width:`48`,height:`48`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,"aria-hidden":`true`},[f(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`}),f(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`}),f(`polyline`,{points:`21,15 16,10 5,21`})]),f(`p`,{class:`home-view__empty-title`},`Set up your first frame`),f(`p`,{class:`home-view__empty-sub`},` Power on your pictureFrame device and scan the QR code it displays to get started. `)],-1)]])):o(O).devices.length===1?(s(),b(`div`,xe,[c(I,{deviceId:o(O).devices[0].id,name:o(O).devices[0].name,size:`large`,status:a(o(O).devices[0]),orientation:o(O).devices[0].orientation,thumbnailUrl:T(o(O).devices[0]),lastSync:m(o(O).devices[0]),nextSync:w(o(O).devices[0]),onAddPhoto:M,onEdit:$},null,8,[`deviceId`,`name`,`status`,`orientation`,`thumbnailUrl`,`lastSync`,`nextSync`])])):(s(),b(`div`,{key:3,ref_key:`stackEl`,ref:A,class:`home-view__stack`,role:`list`,"aria-label":`Frames`},[(s(!0),b(g,null,i(o(O).devices,e=>(s(),b(`div`,{key:e.id,class:`home-view__slide`,role:`listitem`,"aria-label":e.name},[c(I,{deviceId:e.id,name:e.name,size:`large`,status:a(e),orientation:e.orientation,thumbnailUrl:T(e),lastSync:m(e),nextSync:w(e),onAddPhoto:M,onEdit:$},null,8,[`deviceId`,`name`,`status`,`orientation`,`thumbnailUrl`,`lastSync`,`nextSync`])],8,Se))),128))],512))]),_:1})]),c(de,{modelValue:z.value,"onUpdate:modelValue":n[8]||=e=>z.value=e,label:`Frame settings`},{default:t(()=>[n[24]||=f(`h2`,{class:`home-view__sheet-title`},`Frame settings`,-1),f(`div`,Ce,[c(ge,{modelValue:W.value,"onUpdate:modelValue":n[0]||=e=>W.value=e,label:`Frame name`,maxlength:`100`},null,8,[`modelValue`])]),f(`div`,we,[n[12]||=f(`p`,{class:`home-view__sheet-label`},`Orientation`,-1),c(_e,{modelValue:G.value,"onUpdate:modelValue":n[1]||=e=>G.value=e},null,8,[`modelValue`])]),f(`div`,Te,[n[19]||=f(`p`,{class:`home-view__sheet-label`},`Update frequency`,-1),u(f(`select`,{class:`home-view__mode-select`,"onUpdate:modelValue":n[2]||=e=>K.value=e,"aria-label":`Update frequency mode`},[...n[13]||=[f(`option`,{value:`times`},`At specific time(s)`,-1),f(`option`,{value:`interval`},`Every X minutes`,-1)]],512),[[h,K.value]]),K.value===`times`?(s(),b(`div`,Ee,[f(`div`,De,[(s(!0),b(g,null,i(q.value,(e,t)=>(s(),b(`div`,{key:t,class:`home-view__time-row`},[f(`select`,{class:`home-view__time-part`,value:F(e).h,"aria-label":`Hour`,onChange:e=>Q(t,`h`,e.target.value)},[(s(),b(g,null,i(N,e=>f(`option`,{key:e,value:e},d(e),9,ke)),64))],40,Oe),n[16]||=f(`span`,{class:`home-view__time-sep`},`:`,-1),f(`select`,{class:`home-view__time-part`,value:F(e).mm,"aria-label":`Minutes`,onChange:e=>Q(t,`mm`,e.target.value)},[(s(),b(g,null,i(P,e=>f(`option`,{key:e,value:e},d(String(e).padStart(2,`0`)),9,je)),64))],40,Ae),f(`select`,{class:`home-view__time-part home-view__time-part--ampm`,value:F(e).p,"aria-label":`AM or PM`,onChange:e=>Q(t,`p`,e.target.value)},[...n[14]||=[f(`option`,{value:`AM`},`AM`,-1),f(`option`,{value:`PM`},`PM`,-1)]],40,Me),f(`button`,{type:`button`,class:`home-view__time-remove`,"aria-label":`Remove ${_(e)}`,onClick:e=>Je(t)},[...n[15]||=[f(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"aria-hidden":`true`},[f(`polyline`,{points:`3 6 5 6 21 6`}),f(`path`,{d:`M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6`}),f(`path`,{d:`M10 11v6`}),f(`path`,{d:`M14 11v6`})],-1)]],8,Ne)]))),128)),q.value.length===0?(s(),b(`p`,Pe,`No update times yet — add one below.`)):y(``,!0)]),f(`button`,{type:`button`,class:`home-view__time-add`,onClick:qe},`+ Add time`),u(f(`select`,{class:`home-view__tz-select`,"onUpdate:modelValue":n[3]||=e=>Y.value=e},[(s(),b(g,null,i(R,e=>f(`optgroup`,{key:e.label,label:e.label},[(s(!0),b(g,null,i(e.zones,e=>(s(),b(`option`,{key:e.value,value:e.value},d(e.label),9,Ie))),128))],8,Fe)),64))],512),[[h,Y.value]])])):(s(),b(`div`,Le,[f(`div`,Re,[n[17]||=f(`span`,null,`Every`,-1),u(f(`input`,{type:`number`,inputmode:`numeric`,pattern:`[0-9]*`,min:`1`,max:`1440`,class:`home-view__interval-input`,"onUpdate:modelValue":n[4]||=e=>J.value=e,"aria-label":`Update interval in minutes`},null,512),[[oe,J.value,void 0,{number:!0}]]),n[18]||=f(`span`,null,`minutes`,-1)])])),f(`p`,ze,d(Ye.value),1),n[20]||=f(`p`,{class:`home-view__propagation-note`},` Changes will only take effect at the next device update. To force an immediate refresh, briefly disconnect and reconnect the frame’s power. `,-1)]),f(`div`,Be,[n[23]||=f(`p`,{class:`home-view__sheet-label`},`Image selection`,-1),u(f(`select`,{class:`home-view__mode-select`,"onUpdate:modelValue":n[5]||=e=>X.value=e,"aria-label":`Image selection mode`},[...n[21]||=[f(`option`,{value:`oldest_upload`},`Oldest upload first`,-1),f(`option`,{value:`newest_upload`},`Newest upload first`,-1),f(`option`,{value:`least_recently_shown`},`Least recently shown`,-1),f(`option`,{value:`random`},`Random`,-1)]],512),[[h,X.value]]),f(`label`,Ve,[u(f(`input`,{type:`checkbox`,"onUpdate:modelValue":n[6]||=e=>Z.value=e},null,512),[[ne,Z.value]]),n[22]||=f(`span`,null,`Show never-shown images first`,-1)])]),c(C,{variant:`primary`,class:`home-view__sheet-save`,disabled:B.value,onClick:et},{default:t(()=>[se(d(B.value?`Saving…`:`Save`),1)]),_:1},8,[`disabled`]),f(`button`,{type:`button`,class:`home-view__remove`,onClick:n[7]||=e=>H.value=!0},`Remove this frame`)]),_:1},8,[`modelValue`]),(s(),ee(ae,{to:`body`},[c(te,{name:`home-view__remove-modal`},{default:t(()=>[H.value?(s(),b(`div`,{key:0,class:`home-view__remove-modal`,role:`alertdialog`,"aria-labelledby":`remove-confirm-title`,onClick:n[10]||=re(e=>H.value=!1,[`self`])},[f(`div`,He,[n[25]||=f(`p`,{class:`home-view__remove-confirm-title`,id:`remove-confirm-title`},` Remove this frame? `,-1),n[26]||=f(`p`,{class:`home-view__remove-confirm-body`},` Use this if you’re selling or giving away the frame. It deletes this frame from your account and unlinks it from your photos so the next owner can claim it fresh. This can’t be undone. `,-1),n[27]||=f(`p`,{class:`home-view__remove-confirm-aside`},` On the frame itself, the new owner can also do a factory reset by holding the small button on the back until the screen starts to flash. (If they only tap it briefly, the frame just refreshes its current image — keep holding until it flashes.) `,-1),f(`div`,Ue,[f(`button`,{type:`button`,class:`home-view__remove-cancel`,disabled:V.value,onClick:n[9]||=e=>H.value=!1},`Cancel`,8,We),f(`button`,{type:`button`,class:`home-view__remove-confirm-btn`,disabled:V.value,onClick:$e},d(V.value?`Removing…`:`Yes, remove`),9,Ge)])])])):y(``,!0)]),_:1})]))],64))}}),[[`__scopeId`,`data-v-31f99454`]]);export{q as default}; \ No newline at end of file diff --git a/public/build/assets/LibraryView-E5I_Q1_A.js b/public/build/assets/LibraryView-BmJwebDM.js similarity index 63% rename from public/build/assets/LibraryView-E5I_Q1_A.js rename to public/build/assets/LibraryView-BmJwebDM.js index 57c1363..f5c00b9 100644 --- a/public/build/assets/LibraryView-E5I_Q1_A.js +++ b/public/build/assets/LibraryView-BmJwebDM.js @@ -1 +1 @@ -import{B as e,G as t,H as n,J as r,K as i,M as a,P as o,R as s,S as c,_ as l,b as u,d,f,g as p,h as m,k as h,p as g,t as _,u as v,v as y,x as b,y as x,z as S}from"./_plugin-vue_export-helper-eepT72yB.js";import{a as C,i as w,o as T,s as E}from"./index-BO5caB_f.js";import{i as D,n as O,r as ee,t as k}from"./BaseBottomSheet-BMI-Oljh.js";import{t as te}from"./PullToRefresh-BEXU4J3A.js";import{t as A}from"./DevicePicker-C6ucVR6N.js";var j={class:`approve-card`},M=[`src`,`alt`],N={class:`approve-card__body`},P={class:`approve-card__from`},F={class:`approve-card__date`},I={key:0,class:`approve-card__status`},L={class:`approve-card__actions`},R=_(c({__name:`ApproveCard`,props:{item:{}},emits:[`updated`],setup(e,{emit:o}){let s=e,c=o,d=C(),f=D(),h=n(!1),_=n(!1),v=n([]),w=m(()=>new Date(s.item.sharedAt).toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`}));async function T(){h.value=!1,_.value=!0;try{c(`updated`,await d.approveShared(s.item.id,v.value))}finally{_.value=!1,v.value=[]}}async function E(){_.value=!0;try{c(`updated`,await d.declineShared(s.item.id))}finally{_.value=!1}}return(n,o)=>(a(),x(g,null,[p(`div`,j,[p(`img`,{src:e.item.thumbnailUrl,alt:`Photo from ${e.item.sharedBy}`,class:`approve-card__thumb`,loading:`lazy`},null,8,M),p(`div`,N,[p(`p`,P,[o[3]||=u(`From `,-1),p(`strong`,null,r(e.item.sharedBy),1)]),p(`p`,F,r(w.value),1),e.item.status===`pending`?y(``,!0):(a(),x(`div`,I,[p(`span`,{class:i([`approve-card__badge`,`approve-card__badge--${e.item.status}`])},r(e.item.status),3)])),p(`div`,L,[e.item.status===`pending`||e.item.status===`declined`?(a(),l(O,{key:0,variant:`primary`,size:`sm`,disabled:_.value,onClick:o[0]||=e=>h.value=!0},{default:S(()=>[u(r(e.item.status===`declined`?`Add anyway`:`Add to frame`),1)]),_:1},8,[`disabled`])):y(``,!0),e.item.status===`pending`||e.item.status===`approved`?(a(),l(O,{key:1,variant:`ghost`,size:`sm`,disabled:_.value,onClick:E},{default:S(()=>[u(r(e.item.status===`approved`?`Remove`:`Decline`),1)]),_:1},8,[`disabled`])):y(``,!0)])])]),b(A,{modelValue:h.value,"onUpdate:modelValue":o[1]||=e=>h.value=e,devices:t(f).devices,selected:v.value,uploading:_.value,"confirm-label":`Add to frames`,"onUpdate:selected":o[2]||=e=>v.value=e,onConfirm:T},null,8,[`modelValue`,`devices`,`selected`,`uploading`])],64))}}),[[`__scopeId`,`data-v-6d3dd8b4`]]),z={class:`share-sheet__field`},B=[`onKeydown`],V={key:0,class:`share-sheet__error`},H={key:1,class:`share-sheet__success`},ne=_(c({__name:`ShareSheet`,props:{modelValue:{type:Boolean},imageId:{}},emits:[`update:modelValue`],setup(t,{emit:i}){let o=t,s=C(),c=n(``),m=n(!1),h=n(``),g=n(``);async function _(){if(h.value=``,g.value=``,c.value.trim()){m.value=!0;try{await s.shareImage(o.imageId,c.value.trim()),g.value=`Invite sent to ${c.value.trim()}`,c.value=``}catch(e){h.value=e instanceof Error?e.message:`Failed to send`}finally{m.value=!1}}}return(n,i)=>(a(),l(k,{"model-value":t.modelValue,label:`Share photo`,"onUpdate:modelValue":i[1]||=e=>n.$emit(`update:modelValue`,e)},{default:S(()=>[i[2]||=p(`h2`,{class:`share-sheet__title`},`Share with someone`,-1),i[3]||=p(`p`,{class:`share-sheet__sub`},`They'll get an email and can add it to their frame.`,-1),p(`div`,z,[e(p(`input`,{"onUpdate:modelValue":i[0]||=e=>c.value=e,type:`email`,class:`share-sheet__input`,placeholder:`their@email.com`,autocomplete:`email`,onKeydown:d(f(_,[`prevent`]),[`enter`])},null,40,B),[[v,c.value]])]),h.value?(a(),x(`p`,V,r(h.value),1)):y(``,!0),g.value?(a(),x(`p`,H,r(g.value),1)):y(``,!0),b(O,{variant:`primary`,class:`share-sheet__btn`,disabled:m.value||!c.value.trim(),onClick:_},{default:S(()=>[u(r(m.value?`Sending…`:`Send invite`),1)]),_:1},8,[`disabled`])]),_:1},8,[`model-value`]))}}),[[`__scopeId`,`data-v-24296e7b`]]),re={class:`library`},ie={class:`library__header`},ae={class:`library__tabs`,role:`tablist`},oe=[`aria-selected`,`onClick`],se={key:0,class:`library__loading`},ce={key:0,class:`library__empty`},le={key:1,class:`library__grid`},ue={class:`library__thumb`},de=[`src`,`alt`],fe={class:`library__thumb-actions`},pe=[`aria-label`,`title`,`onClick`],me=[`aria-label`,`disabled`,`onClick`],he={key:0,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"aria-hidden":`true`},ge={key:1,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"aria-hidden":`true`},_e=[`aria-label`,`onClick`],ve=[`onClick`],ye={key:0,class:`library__approvals`},be=[`aria-label`,`onClick`],xe={key:1,class:`library__locks`},Se=[`aria-label`,`onClick`],Ce={width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"aria-hidden":`true`},we={key:0,d:`M7 11V7a5 5 0 0 1 10 0v4`},Te={key:1,d:`M7 11V7a5 5 0 0 1 9.9-1`},Ee={class:`library__subtabs`,role:`tablist`},De=[`aria-selected`,`onClick`],Oe={key:0,class:`library__loading`},ke={key:1,class:`library__shared-empty`},Ae={class:`library__empty-title`},je={class:`library__empty-sub`},Me={key:2,class:`library__shared-list`},Ne={key:3,class:`library__pagination`},Pe=[`disabled`],Fe={class:`library__page-info`},Ie=[`disabled`],Le={class:`library__sheet-actions`},U=_(c({__name:`LibraryView`,setup(e){let c=E(),d=C(),f=D(),_=ee(),v=w(),A=T(),j=[{id:`all`,label:`All`},{id:`mine`,label:`Mine`},{id:`shared`,label:`Shared`}];function M(e){return j.some(t=>t.id===e)?e:`all`}let N=n(M(A.query.tab));s(()=>A.query.tab,e=>{let t=M(e);t!==N.value&&(N.value=t,t===`shared`&&V(F.value))});let P=[{id:`pending`,label:`Pending`},{id:`approved`,label:`Approved`},{id:`declined`,label:`Declined`}],F=n(`pending`),I=n([]),L=n(!1),z=n(1),B=n(1);async function V(e,t=1){L.value=!0;try{let n=await d.fetchSharedImages(e,t);I.value=n.items,z.value=n.page,B.value=n.totalPages}finally{L.value=!1}}function H(e){F.value=e,V(e,1)}function U(e){V(F.value,e)}function Re(e){let t=I.value.findIndex(t=>t.id===e.id);t!==-1&&(I.value[t]=e)}h(()=>{d.fetchImages(),f.fetchDevices(),d.fetchPendingCount(),N.value===`shared`&&V(F.value)});function ze(){let e=document.createElement(`input`);e.type=`file`,e.accept=`image/jpeg,image/png,image/webp,image/gif`,e.onchange=()=>{let t=e.files?.[0];t&&(_.init(t),c.push(`/upload`))},e.click()}function Be(){return window.scrollY===0}async function Ve(){await Promise.all([d.fetchImages({silent:!0}),d.fetchPendingCount(),f.fetchDevices({silent:!0}),N.value===`shared`?V(F.value,z.value):Promise.resolve()])}let W=m(()=>d.images),G=n(!1),K=n(null);function He(e){K.value=e,G.value=!0}let q=n(null);async function J(e,t){if(!q.value){q.value=e.id;try{await _.initEdit(e,t),c.push(`/upload`)}catch{v.show(`Could not load photo for editing`,`error`)}finally{q.value=null}}}function Y(e){if(e.cropOrientation)return e.cropOrientation;let t=e.cropParams;return!t?.natW||!t?.natH?null:t.natW>=t.natH?`landscape`:`portrait`}function X(e){let t=Y(e);if(!t)return null;for(let n of e.approvedDeviceIds){let e=f.devices.find(e=>e.id===n);if(e&&e.orientation!==t)return e}return null}async function Ue(e,t){try{t.lockedImageId===e?await f.unlockImage(t.id):await f.lockImage(t.id,e)}catch{v.show(`Failed to update lock`,`error`)}}async function We(e,t,n){try{await d.setApproval(e,t,n)}catch{v.show(`Failed to update frame approval`,`error`)}}let Z=n(!1),Q=n(null),$=n(!1);function Ge(e){Q.value=e,Z.value=!0}async function Ke(){if(Q.value){$.value=!0;try{await d.deleteImage(Q.value),Z.value=!1,v.show(`Photo deleted`,`success`)}catch{v.show(`Delete failed`,`error`)}finally{$.value=!1}}}return(e,n)=>(a(),x(`main`,re,[b(te,{"is-at-top":Be,"on-refresh":Ve},{default:S(()=>[p(`div`,ie,[b(O,{variant:`primary`,class:`library__add-btn`,onClick:ze},{default:S(()=>[...n[5]||=[u(` + Add Photo `,-1)]]),_:1})]),p(`div`,ae,[(a(),x(g,null,o(j,e=>p(`button`,{key:e.id,type:`button`,role:`tab`,"aria-selected":N.value===e.id,class:i([`library__tab`,{"library__tab--active":N.value===e.id}]),onClick:t=>N.value=e.id},r(e.label),11,oe)),64))]),t(d).loading?(a(),x(`div`,se,`Loading…`)):N.value===`shared`?(a(),x(g,{key:2},[p(`div`,Ee,[(a(),x(g,null,o(P,e=>p(`button`,{key:e.id,type:`button`,role:`tab`,"aria-selected":F.value===e.id,class:i([`library__subtab`,{"library__subtab--active":F.value===e.id}]),onClick:t=>H(e.id)},r(e.label),11,De)),64))]),L.value?(a(),x(`div`,Oe,`Loading…`)):I.value.length===0?(a(),x(`div`,ke,[n[13]||=p(`svg`,{width:`48`,height:`48`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,"aria-hidden":`true`},[p(`circle`,{cx:`18`,cy:`5`,r:`3`}),p(`circle`,{cx:`6`,cy:`12`,r:`3`}),p(`circle`,{cx:`18`,cy:`19`,r:`3`}),p(`line`,{x1:`8.59`,y1:`13.51`,x2:`15.42`,y2:`17.49`}),p(`line`,{x1:`15.41`,y1:`6.51`,x2:`8.59`,y2:`10.49`})],-1),p(`p`,Ae,r(F.value===`pending`?`No pending photos`:F.value===`approved`?`No approved photos`:`No declined photos`),1),p(`p`,je,r(F.value===`pending`?`Photos shared with you will appear here.`:`Photos you've added to a frame will appear here.`),1)])):(a(),x(`div`,Me,[(a(!0),x(g,null,o(I.value,e=>(a(),l(R,{key:e.id,item:e,onUpdated:Re},null,8,[`item`]))),128))])),B.value>1?(a(),x(`div`,Ne,[p(`button`,{class:`library__page-btn`,disabled:z.value<=1,onClick:n[0]||=e=>U(z.value-1)},`← Prev`,8,Pe),p(`span`,Fe,r(z.value)+` / `+r(B.value),1),p(`button`,{class:`library__page-btn`,disabled:z.value>=B.value,onClick:n[1]||=e=>U(z.value+1)},`Next →`,8,Ie)])):y(``,!0)],64)):(a(),x(g,{key:1},[W.value.length===0?(a(),x(`div`,ce,[...n[6]||=[p(`svg`,{width:`48`,height:`48`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,"aria-hidden":`true`},[p(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`}),p(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`}),p(`polyline`,{points:`21,15 16,10 5,21`})],-1),p(`p`,{class:`library__empty-title`},`No photos yet`,-1),p(`p`,{class:`library__empty-sub`},`Tap "+ Add Photo" above to upload your first one.`,-1)]])):(a(),x(`div`,le,[(a(!0),x(g,null,o(W.value,e=>(a(),x(`div`,{key:e.id,class:`library__item`},[p(`div`,ue,[p(`img`,{src:e.thumbnailUrl,alt:e.originalFilename,class:`library__img`,loading:`lazy`},null,8,de),p(`div`,fe,[X(e)?(a(),x(`button`,{key:0,class:`library__action-btn library__action-btn--warn`,type:`button`,"aria-label":`Crop orientation does not match ${X(e).name}; tap to re-crop`,title:`Cropped ${Y(e)}, but ${X(e).name} is set to ${X(e).orientation}.`,onClick:t=>J(e,X(e).id)},[...n[7]||=[p(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"aria-hidden":`true`},[p(`path`,{d:`M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z`}),p(`line`,{x1:`12`,y1:`9`,x2:`12`,y2:`13`}),p(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`})],-1)]],8,pe)):y(``,!0),p(`button`,{class:`library__action-btn`,type:`button`,"aria-label":`Edit ${e.originalFilename}`,disabled:q.value===e.id,onClick:t=>J(e)},[q.value===e.id?(a(),x(`svg`,ge,[...n[9]||=[p(`circle`,{cx:`12`,cy:`12`,r:`10`},null,-1),p(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`12`},null,-1),p(`line`,{x1:`12`,y1:`16`,x2:`12.01`,y2:`16`},null,-1)]])):(a(),x(`svg`,he,[...n[8]||=[p(`path`,{d:`M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`},null,-1),p(`path`,{d:`M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z`},null,-1)]]))],8,me),p(`button`,{class:`library__action-btn`,type:`button`,"aria-label":`Share ${e.originalFilename}`,onClick:t=>He(e.id)},[...n[10]||=[p(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"aria-hidden":`true`},[p(`circle`,{cx:`18`,cy:`5`,r:`3`}),p(`circle`,{cx:`6`,cy:`12`,r:`3`}),p(`circle`,{cx:`18`,cy:`19`,r:`3`}),p(`line`,{x1:`8.59`,y1:`13.51`,x2:`15.42`,y2:`17.49`}),p(`line`,{x1:`15.41`,y1:`6.51`,x2:`8.59`,y2:`10.49`})],-1)]],8,_e),p(`button`,{class:`library__action-btn library__action-btn--danger`,type:`button`,"aria-label":`Delete photo`,onClick:t=>Ge(e.id)},[...n[11]||=[p(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"aria-hidden":`true`},[p(`polyline`,{points:`3 6 5 6 21 6`}),p(`path`,{d:`M19 6l-1 14H6L5 6`}),p(`path`,{d:`M10 11v6M14 11v6`}),p(`path`,{d:`M9 6V4h6v2`})],-1)]],8,ve)])]),t(f).devices.length>0?(a(),x(`div`,ye,[(a(!0),x(g,null,o(t(f).devices,t=>(a(),x(`button`,{key:t.id,class:i([`library__approval-chip`,{"library__approval-chip--on":e.approvedDeviceIds.includes(t.id)}]),type:`button`,"aria-label":`${e.approvedDeviceIds.includes(t.id)?`Remove from`:`Add to`} ${t.name}`,onClick:n=>We(e.id,t.id,!e.approvedDeviceIds.includes(t.id))},r(t.name),11,be))),128))])):y(``,!0),t(f).devices.length>0?(a(),x(`div`,xe,[(a(!0),x(g,null,o(t(f).devices.filter(t=>e.approvedDeviceIds.includes(t.id)),t=>(a(),x(`button`,{key:t.id,class:i([`library__lock-chip`,{"library__lock-chip--on":t.lockedImageId===e.id}]),type:`button`,"aria-label":`${t.lockedImageId===e.id?`Unlock from`:`Lock to`} ${t.name}`,onClick:n=>Ue(e.id,t)},[(a(),x(`svg`,Ce,[n[12]||=p(`rect`,{x:`3`,y:`11`,width:`18`,height:`11`,rx:`2`,ry:`2`},null,-1),t.lockedImageId===e.id?(a(),x(`path`,we)):(a(),x(`path`,Te))])),u(` `+r(t.name),1)],10,Se))),128))])):y(``,!0)]))),128))]))],64))]),_:1}),K.value===null?y(``,!0):(a(),l(ne,{key:0,modelValue:G.value,"onUpdate:modelValue":n[2]||=e=>G.value=e,"image-id":K.value},null,8,[`modelValue`,`image-id`])),b(k,{modelValue:Z.value,"onUpdate:modelValue":n[4]||=e=>Z.value=e,label:`Delete photo`},{default:S(()=>[n[15]||=p(`h2`,{class:`library__sheet-title`},`Delete this photo?`,-1),n[16]||=p(`p`,{class:`library__sheet-sub`},`It will be removed from all frames.`,-1),p(`div`,Le,[b(O,{variant:`secondary`,onClick:n[3]||=e=>Z.value=!1},{default:S(()=>[...n[14]||=[u(`Cancel`,-1)]]),_:1}),b(O,{variant:`destructive`,disabled:$.value,onClick:Ke},{default:S(()=>[u(r($.value?`Deleting…`:`Delete`),1)]),_:1},8,[`disabled`])])]),_:1},8,[`modelValue`])]))}}),[[`__scopeId`,`data-v-d22a9085`]]);export{U as default}; \ No newline at end of file +import{A as e,B as t,C as n,F as r,K as i,N as a,S as o,U as s,V as c,Y as l,_ as u,d,f,g as p,h as m,p as h,q as g,t as _,u as v,v as y,x as b,y as x,z as S}from"./_plugin-vue_export-helper-BNDVmFr7.js";import{a as C,i as w,o as T,s as E}from"./index-DdJ5jHP4.js";import{i as D,n as O,r as ee,t as k}from"./BaseBottomSheet-Bsol3Sat.js";import{t as te}from"./PullToRefresh-CeDTOC7P.js";import{t as A}from"./DevicePicker-1UBxnMbg.js";var j={class:`approve-card`},M=[`src`,`alt`],N={class:`approve-card__body`},P={class:`approve-card__from`},F={class:`approve-card__date`},I={key:0,class:`approve-card__status`},L={class:`approve-card__actions`},R=_(n({__name:`ApproveCard`,props:{item:{}},emits:[`updated`],setup(e,{emit:n}){let r=e,c=n,d=C(),f=D(),_=s(!1),v=s(!1),S=s([]),w=m(()=>new Date(r.item.sharedAt).toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`}));async function T(){_.value=!1,v.value=!0;try{c(`updated`,await d.approveShared(r.item.id,S.value))}finally{v.value=!1,S.value=[]}}async function E(){v.value=!0;try{c(`updated`,await d.declineShared(r.item.id))}finally{v.value=!1}}return(n,r)=>(a(),x(h,null,[p(`div`,j,[p(`img`,{src:e.item.thumbnailUrl,alt:`Photo from ${e.item.sharedBy}`,class:`approve-card__thumb`,loading:`lazy`},null,8,M),p(`div`,N,[p(`p`,P,[r[3]||=b(`From `,-1),p(`strong`,null,l(e.item.sharedBy),1)]),p(`p`,F,l(w.value),1),e.item.status===`pending`?y(``,!0):(a(),x(`div`,I,[p(`span`,{class:g([`approve-card__badge`,`approve-card__badge--${e.item.status}`])},l(e.item.status),3)])),p(`div`,L,[e.item.status===`pending`||e.item.status===`declined`?(a(),u(O,{key:0,variant:`primary`,size:`sm`,disabled:v.value,onClick:r[0]||=e=>_.value=!0},{default:t(()=>[b(l(e.item.status===`declined`?`Add anyway`:`Add to frame`),1)]),_:1},8,[`disabled`])):y(``,!0),e.item.status===`pending`||e.item.status===`approved`?(a(),u(O,{key:1,variant:`ghost`,size:`sm`,disabled:v.value,onClick:E},{default:t(()=>[b(l(e.item.status===`approved`?`Remove`:`Decline`),1)]),_:1},8,[`disabled`])):y(``,!0)])])]),o(A,{modelValue:_.value,"onUpdate:modelValue":r[1]||=e=>_.value=e,devices:i(f).devices,selected:S.value,uploading:v.value,"confirm-label":`Add to frames`,"onUpdate:selected":r[2]||=e=>S.value=e,onConfirm:T},null,8,[`modelValue`,`devices`,`selected`,`uploading`])],64))}}),[[`__scopeId`,`data-v-6d3dd8b4`]]),z={class:`share-sheet__field`},B=[`onKeydown`],V={key:0,class:`share-sheet__error`},H={key:1,class:`share-sheet__success`},ne=_(n({__name:`ShareSheet`,props:{modelValue:{type:Boolean},imageId:{}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=e,i=C(),m=s(``),h=s(!1),g=s(``),_=s(``);async function S(){if(g.value=``,_.value=``,m.value.trim()){h.value=!0;try{await i.shareImage(r.imageId,m.value.trim()),_.value=`Invite sent to ${m.value.trim()}`,m.value=``}catch(e){g.value=e instanceof Error?e.message:`Failed to send`}finally{h.value=!1}}}return(n,r)=>(a(),u(k,{"model-value":e.modelValue,label:`Share photo`,"onUpdate:modelValue":r[1]||=e=>n.$emit(`update:modelValue`,e)},{default:t(()=>[r[2]||=p(`h2`,{class:`share-sheet__title`},`Share with someone`,-1),r[3]||=p(`p`,{class:`share-sheet__sub`},`They'll get an email and can add it to their frame.`,-1),p(`div`,z,[c(p(`input`,{"onUpdate:modelValue":r[0]||=e=>m.value=e,type:`email`,class:`share-sheet__input`,placeholder:`their@email.com`,autocomplete:`email`,onKeydown:d(f(S,[`prevent`]),[`enter`])},null,40,B),[[v,m.value]])]),g.value?(a(),x(`p`,V,l(g.value),1)):y(``,!0),_.value?(a(),x(`p`,H,l(_.value),1)):y(``,!0),o(O,{variant:`primary`,class:`share-sheet__btn`,disabled:h.value||!m.value.trim(),onClick:S},{default:t(()=>[b(l(h.value?`Sending…`:`Send invite`),1)]),_:1},8,[`disabled`])]),_:1},8,[`model-value`]))}}),[[`__scopeId`,`data-v-24296e7b`]]),re={class:`library`},ie={class:`library__header`},ae={class:`library__tabs`,role:`tablist`},oe=[`aria-selected`,`onClick`],se={key:0,class:`library__loading`},ce={key:0,class:`library__empty`},le={key:1,class:`library__grid`},ue={class:`library__thumb`},de=[`src`,`alt`],fe={class:`library__thumb-actions`},pe=[`aria-label`,`title`,`onClick`],me=[`aria-label`,`disabled`,`onClick`],he={key:0,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"aria-hidden":`true`},ge={key:1,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"aria-hidden":`true`},_e=[`aria-label`,`onClick`],ve=[`onClick`],ye={key:0,class:`library__approvals`},be=[`aria-label`,`onClick`],xe={key:1,class:`library__locks`},Se=[`aria-label`,`onClick`],Ce={width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"aria-hidden":`true`},we={key:0,d:`M7 11V7a5 5 0 0 1 10 0v4`},Te={key:1,d:`M7 11V7a5 5 0 0 1 9.9-1`},Ee={class:`library__subtabs`,role:`tablist`},De=[`aria-selected`,`onClick`],Oe={key:0,class:`library__loading`},ke={key:1,class:`library__shared-empty`},Ae={class:`library__empty-title`},je={class:`library__empty-sub`},Me={key:2,class:`library__shared-list`},Ne={key:3,class:`library__pagination`},Pe=[`disabled`],Fe={class:`library__page-info`},Ie=[`disabled`],Le={class:`library__sheet-actions`},U=_(n({__name:`LibraryView`,setup(n){let c=E(),d=C(),f=D(),_=ee(),v=w(),A=T(),j=[{id:`all`,label:`All`},{id:`mine`,label:`Mine`},{id:`shared`,label:`Shared`}];function M(e){return j.some(t=>t.id===e)?e:`all`}let N=s(M(A.query.tab));S(()=>A.query.tab,e=>{let t=M(e);t!==N.value&&(N.value=t,t===`shared`&&V(F.value))});let P=[{id:`pending`,label:`Pending`},{id:`approved`,label:`Approved`},{id:`declined`,label:`Declined`}],F=s(`pending`),I=s([]),L=s(!1),z=s(1),B=s(1);async function V(e,t=1){L.value=!0;try{let n=await d.fetchSharedImages(e,t);I.value=n.items,z.value=n.page,B.value=n.totalPages}finally{L.value=!1}}function H(e){F.value=e,V(e,1)}function U(e){V(F.value,e)}function Re(e){let t=I.value.findIndex(t=>t.id===e.id);t!==-1&&(I.value[t]=e)}e(()=>{d.fetchImages(),f.fetchDevices(),d.fetchPendingCount(),N.value===`shared`&&V(F.value)});function ze(){let e=document.createElement(`input`);e.type=`file`,e.accept=`image/jpeg,image/png,image/webp,image/gif`,e.onchange=()=>{let t=e.files?.[0];t&&(_.init(t),c.push(`/upload`))},e.click()}function Be(){return window.scrollY===0}async function Ve(){await Promise.all([d.fetchImages({silent:!0}),d.fetchPendingCount(),f.fetchDevices({silent:!0}),N.value===`shared`?V(F.value,z.value):Promise.resolve()])}let W=m(()=>d.images),G=s(!1),K=s(null);function He(e){K.value=e,G.value=!0}let q=s(null);async function J(e,t){if(!q.value){q.value=e.id;try{await _.initEdit(e,t),c.push(`/upload`)}catch{v.show(`Could not load photo for editing`,`error`)}finally{q.value=null}}}function Y(e){if(e.cropOrientation)return e.cropOrientation;let t=e.cropParams;return!t?.natW||!t?.natH?null:t.natW>=t.natH?`landscape`:`portrait`}function X(e){let t=Y(e);if(!t)return null;for(let n of e.approvedDeviceIds){let e=f.devices.find(e=>e.id===n);if(e&&e.orientation!==t)return e}return null}async function Ue(e,t){try{t.lockedImageId===e?await f.unlockImage(t.id):await f.lockImage(t.id,e)}catch{v.show(`Failed to update lock`,`error`)}}async function We(e,t,n){try{await d.setApproval(e,t,n)}catch{v.show(`Failed to update frame approval`,`error`)}}let Z=s(!1),Q=s(null),$=s(!1);function Ge(e){Q.value=e,Z.value=!0}async function Ke(){if(Q.value){$.value=!0;try{await d.deleteImage(Q.value),Z.value=!1,v.show(`Photo deleted`,`success`)}catch{v.show(`Delete failed`,`error`)}finally{$.value=!1}}}return(e,n)=>(a(),x(`main`,re,[o(te,{"is-at-top":Be,"on-refresh":Ve},{default:t(()=>[p(`div`,ie,[o(O,{variant:`primary`,class:`library__add-btn`,onClick:ze},{default:t(()=>[...n[5]||=[b(` + Add Photo `,-1)]]),_:1})]),p(`div`,ae,[(a(),x(h,null,r(j,e=>p(`button`,{key:e.id,type:`button`,role:`tab`,"aria-selected":N.value===e.id,class:g([`library__tab`,{"library__tab--active":N.value===e.id}]),onClick:t=>N.value=e.id},l(e.label),11,oe)),64))]),i(d).loading?(a(),x(`div`,se,`Loading…`)):N.value===`shared`?(a(),x(h,{key:2},[p(`div`,Ee,[(a(),x(h,null,r(P,e=>p(`button`,{key:e.id,type:`button`,role:`tab`,"aria-selected":F.value===e.id,class:g([`library__subtab`,{"library__subtab--active":F.value===e.id}]),onClick:t=>H(e.id)},l(e.label),11,De)),64))]),L.value?(a(),x(`div`,Oe,`Loading…`)):I.value.length===0?(a(),x(`div`,ke,[n[13]||=p(`svg`,{width:`48`,height:`48`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,"aria-hidden":`true`},[p(`circle`,{cx:`18`,cy:`5`,r:`3`}),p(`circle`,{cx:`6`,cy:`12`,r:`3`}),p(`circle`,{cx:`18`,cy:`19`,r:`3`}),p(`line`,{x1:`8.59`,y1:`13.51`,x2:`15.42`,y2:`17.49`}),p(`line`,{x1:`15.41`,y1:`6.51`,x2:`8.59`,y2:`10.49`})],-1),p(`p`,Ae,l(F.value===`pending`?`No pending photos`:F.value===`approved`?`No approved photos`:`No declined photos`),1),p(`p`,je,l(F.value===`pending`?`Photos shared with you will appear here.`:`Photos you've added to a frame will appear here.`),1)])):(a(),x(`div`,Me,[(a(!0),x(h,null,r(I.value,e=>(a(),u(R,{key:e.id,item:e,onUpdated:Re},null,8,[`item`]))),128))])),B.value>1?(a(),x(`div`,Ne,[p(`button`,{class:`library__page-btn`,disabled:z.value<=1,onClick:n[0]||=e=>U(z.value-1)},`← Prev`,8,Pe),p(`span`,Fe,l(z.value)+` / `+l(B.value),1),p(`button`,{class:`library__page-btn`,disabled:z.value>=B.value,onClick:n[1]||=e=>U(z.value+1)},`Next →`,8,Ie)])):y(``,!0)],64)):(a(),x(h,{key:1},[W.value.length===0?(a(),x(`div`,ce,[...n[6]||=[p(`svg`,{width:`48`,height:`48`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,"aria-hidden":`true`},[p(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`}),p(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`}),p(`polyline`,{points:`21,15 16,10 5,21`})],-1),p(`p`,{class:`library__empty-title`},`No photos yet`,-1),p(`p`,{class:`library__empty-sub`},`Tap "+ Add Photo" above to upload your first one.`,-1)]])):(a(),x(`div`,le,[(a(!0),x(h,null,r(W.value,e=>(a(),x(`div`,{key:e.id,class:`library__item`},[p(`div`,ue,[p(`img`,{src:e.thumbnailUrl,alt:e.originalFilename,class:`library__img`,loading:`lazy`},null,8,de),p(`div`,fe,[X(e)?(a(),x(`button`,{key:0,class:`library__action-btn library__action-btn--warn`,type:`button`,"aria-label":`Crop orientation does not match ${X(e).name}; tap to re-crop`,title:`Cropped ${Y(e)}, but ${X(e).name} is set to ${X(e).orientation}.`,onClick:t=>J(e,X(e).id)},[...n[7]||=[p(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"aria-hidden":`true`},[p(`path`,{d:`M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z`}),p(`line`,{x1:`12`,y1:`9`,x2:`12`,y2:`13`}),p(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`})],-1)]],8,pe)):y(``,!0),p(`button`,{class:`library__action-btn`,type:`button`,"aria-label":`Edit ${e.originalFilename}`,disabled:q.value===e.id,onClick:t=>J(e)},[q.value===e.id?(a(),x(`svg`,ge,[...n[9]||=[p(`circle`,{cx:`12`,cy:`12`,r:`10`},null,-1),p(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`12`},null,-1),p(`line`,{x1:`12`,y1:`16`,x2:`12.01`,y2:`16`},null,-1)]])):(a(),x(`svg`,he,[...n[8]||=[p(`path`,{d:`M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`},null,-1),p(`path`,{d:`M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z`},null,-1)]]))],8,me),p(`button`,{class:`library__action-btn`,type:`button`,"aria-label":`Share ${e.originalFilename}`,onClick:t=>He(e.id)},[...n[10]||=[p(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"aria-hidden":`true`},[p(`circle`,{cx:`18`,cy:`5`,r:`3`}),p(`circle`,{cx:`6`,cy:`12`,r:`3`}),p(`circle`,{cx:`18`,cy:`19`,r:`3`}),p(`line`,{x1:`8.59`,y1:`13.51`,x2:`15.42`,y2:`17.49`}),p(`line`,{x1:`15.41`,y1:`6.51`,x2:`8.59`,y2:`10.49`})],-1)]],8,_e),p(`button`,{class:`library__action-btn library__action-btn--danger`,type:`button`,"aria-label":`Delete photo`,onClick:t=>Ge(e.id)},[...n[11]||=[p(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"aria-hidden":`true`},[p(`polyline`,{points:`3 6 5 6 21 6`}),p(`path`,{d:`M19 6l-1 14H6L5 6`}),p(`path`,{d:`M10 11v6M14 11v6`}),p(`path`,{d:`M9 6V4h6v2`})],-1)]],8,ve)])]),i(f).devices.length>0?(a(),x(`div`,ye,[(a(!0),x(h,null,r(i(f).devices,t=>(a(),x(`button`,{key:t.id,class:g([`library__approval-chip`,{"library__approval-chip--on":e.approvedDeviceIds.includes(t.id)}]),type:`button`,"aria-label":`${e.approvedDeviceIds.includes(t.id)?`Remove from`:`Add to`} ${t.name}`,onClick:n=>We(e.id,t.id,!e.approvedDeviceIds.includes(t.id))},l(t.name),11,be))),128))])):y(``,!0),i(f).devices.length>0?(a(),x(`div`,xe,[(a(!0),x(h,null,r(i(f).devices.filter(t=>e.approvedDeviceIds.includes(t.id)),t=>(a(),x(`button`,{key:t.id,class:g([`library__lock-chip`,{"library__lock-chip--on":t.lockedImageId===e.id}]),type:`button`,"aria-label":`${t.lockedImageId===e.id?`Unlock from`:`Lock to`} ${t.name}`,onClick:n=>Ue(e.id,t)},[(a(),x(`svg`,Ce,[n[12]||=p(`rect`,{x:`3`,y:`11`,width:`18`,height:`11`,rx:`2`,ry:`2`},null,-1),t.lockedImageId===e.id?(a(),x(`path`,we)):(a(),x(`path`,Te))])),b(` `+l(t.name),1)],10,Se))),128))])):y(``,!0)]))),128))]))],64))]),_:1}),K.value===null?y(``,!0):(a(),u(ne,{key:0,modelValue:G.value,"onUpdate:modelValue":n[2]||=e=>G.value=e,"image-id":K.value},null,8,[`modelValue`,`image-id`])),o(k,{modelValue:Z.value,"onUpdate:modelValue":n[4]||=e=>Z.value=e,label:`Delete photo`},{default:t(()=>[n[15]||=p(`h2`,{class:`library__sheet-title`},`Delete this photo?`,-1),n[16]||=p(`p`,{class:`library__sheet-sub`},`It will be removed from all frames.`,-1),p(`div`,Le,[o(O,{variant:`secondary`,onClick:n[3]||=e=>Z.value=!1},{default:t(()=>[...n[14]||=[b(`Cancel`,-1)]]),_:1}),o(O,{variant:`destructive`,disabled:$.value,onClick:Ke},{default:t(()=>[b(l($.value?`Deleting…`:`Delete`),1)]),_:1},8,[`disabled`])])]),_:1},8,[`modelValue`])]))}}),[[`__scopeId`,`data-v-d22a9085`]]);export{U as default}; \ No newline at end of file diff --git a/public/build/assets/PullToRefresh-BEXU4J3A.js b/public/build/assets/PullToRefresh-CeDTOC7P.js similarity index 69% rename from public/build/assets/PullToRefresh-BEXU4J3A.js rename to public/build/assets/PullToRefresh-CeDTOC7P.js index a03efb8..1c29a21 100644 --- a/public/build/assets/PullToRefresh-BEXU4J3A.js +++ b/public/build/assets/PullToRefresh-CeDTOC7P.js @@ -1 +1 @@ -import{F as e,H as t,K as n,M as r,S as i,g as a,h as o,q as s,t as c,y as l}from"./_plugin-vue_export-helper-eepT72yB.js";var u={key:1,class:`ptr__spinner`,role:`status`,"aria-label":`Refreshing`},d=c(i({__name:`PullToRefresh`,props:{isAtTop:{},onRefresh:{},threshold:{default:80},maxPull:{default:140}},setup(i){let c=i,d=t(0),f=t(!1),p=0,m=0,h=!1,g=null,_=o(()=>Math.min(d.value/c.threshold,1)),v=o(()=>f.value?1:Math.min(d.value/c.threshold,1)),y=o(()=>({transform:`translateY(${d.value}px)`,transition:h?`none`:`transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1)`}));function b(e){f.value||c.isAtTop&&!c.isAtTop()||e.touches.length===1&&(p=e.touches[0].clientY,m=e.touches[0].clientX,h=!0,g=null)}function x(e){if(!h)return;let t=e.touches[0].clientX-m,n=e.touches[0].clientY-p;if(g===null){if(Math.abs(t)<6&&Math.abs(n)<6)return;g=Math.abs(t)>Math.abs(n)?`x`:`y`}if(g===`x`||n<=0){h=!1,d.value=0;return}if(c.isAtTop&&!c.isAtTop()){h=!1,d.value=0;return}let r=n=c.threshold){f.value=!0,d.value=c.threshold*.7;try{await c.onRefresh()}catch(e){console.error(`Pull-to-refresh failed:`,e)}finally{f.value=!1,d.value=0}}else d.value=0}return(t,i)=>(r(),l(`div`,{class:`ptr`,onTouchstartPassive:b,onTouchmove:x,onTouchend:S,onTouchcancel:S},[a(`div`,{class:n([`ptr__indicator`,{"ptr__indicator--ready":_.value>=1}]),style:s({opacity:v.value,transform:`translateY(${d.value*.6}px)`}),"aria-hidden":`true`},[f.value?(r(),l(`div`,u)):(r(),l(`svg`,{key:0,class:`ptr__arrow`,viewBox:`0 0 24 24`,style:s({transform:`rotate(${_.value*180}deg)`})},[...i[0]||=[a(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`},null,-1),a(`polyline`,{points:`6 13 12 19 18 13`,stroke:`currentColor`,"stroke-width":`2.5`,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,-1)]],4))],6),a(`div`,{class:`ptr__content`,style:s(y.value)},[e(t.$slots,`default`,{},void 0,!0)],4)],32))}}),[[`__scopeId`,`data-v-e2242f3c`]]);export{d as t}; \ No newline at end of file +import{C as e,I as t,J as n,N as r,U as i,g as a,h as o,q as s,t as c,y as l}from"./_plugin-vue_export-helper-BNDVmFr7.js";var u={key:1,class:`ptr__spinner`,role:`status`,"aria-label":`Refreshing`},d=c(e({__name:`PullToRefresh`,props:{isAtTop:{},onRefresh:{},threshold:{default:80},maxPull:{default:140}},setup(e){let c=e,d=i(0),f=i(!1),p=0,m=0,h=!1,g=null,_=o(()=>Math.min(d.value/c.threshold,1)),v=o(()=>f.value?1:Math.min(d.value/c.threshold,1)),y=o(()=>({transform:`translateY(${d.value}px)`,transition:h?`none`:`transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1)`}));function b(e){f.value||c.isAtTop&&!c.isAtTop()||e.touches.length===1&&(p=e.touches[0].clientY,m=e.touches[0].clientX,h=!0,g=null)}function x(e){if(!h)return;let t=e.touches[0].clientX-m,n=e.touches[0].clientY-p;if(g===null){if(Math.abs(t)<6&&Math.abs(n)<6)return;g=Math.abs(t)>Math.abs(n)?`x`:`y`}if(g===`x`||n<=0){h=!1,d.value=0;return}if(c.isAtTop&&!c.isAtTop()){h=!1,d.value=0;return}let r=n=c.threshold){f.value=!0,d.value=c.threshold*.7;try{await c.onRefresh()}catch(e){console.error(`Pull-to-refresh failed:`,e)}finally{f.value=!1,d.value=0}}else d.value=0}return(e,i)=>(r(),l(`div`,{class:`ptr`,onTouchstartPassive:b,onTouchmove:x,onTouchend:S,onTouchcancel:S},[a(`div`,{class:s([`ptr__indicator`,{"ptr__indicator--ready":_.value>=1}]),style:n({opacity:v.value,transform:`translateY(${d.value*.6}px)`}),"aria-hidden":`true`},[f.value?(r(),l(`div`,u)):(r(),l(`svg`,{key:0,class:`ptr__arrow`,viewBox:`0 0 24 24`,style:n({transform:`rotate(${_.value*180}deg)`})},[...i[0]||=[a(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`},null,-1),a(`polyline`,{points:`6 13 12 19 18 13`,stroke:`currentColor`,"stroke-width":`2.5`,fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,-1)]],4))],6),a(`div`,{class:`ptr__content`,style:n(y.value)},[t(e.$slots,`default`,{},void 0,!0)],4)],32))}}),[[`__scopeId`,`data-v-e2242f3c`]]);export{d as t}; \ No newline at end of file diff --git a/public/build/assets/SettingsView-BuwptVaB.js b/public/build/assets/SettingsView-BuwptVaB.js deleted file mode 100644 index 9e271d2..0000000 --- a/public/build/assets/SettingsView-BuwptVaB.js +++ /dev/null @@ -1 +0,0 @@ -import{G as e,H as t,J as n,K as r,M as i,P as a,S as o,b as s,f as c,g as l,h as u,p as d,q as f,t as p,v as m,y as h}from"./_plugin-vue_export-helper-eepT72yB.js";import{n as g,r as _,t as v}from"./index-BO5caB_f.js";var y=t(null),b=t(!1);function x(){return typeof window>`u`?!1:window.matchMedia?.(`(display-mode: standalone)`).matches?!0:window.navigator.standalone===!0}function S(){if(typeof navigator>`u`)return!1;let e=navigator.userAgent,t=e.includes(`Mac`)&&navigator.maxTouchPoints>1;return/iPhone|iPod/.test(e)||t}var C=!1;function w(){C||typeof window>`u`||(C=!0,b.value=x(),window.addEventListener(`beforeinstallprompt`,e=>{e.preventDefault(),y.value=e}),window.addEventListener(`appinstalled`,()=>{y.value=null,b.value=!0}),window.matchMedia?.(`(display-mode: standalone)`).addEventListener(`change`,e=>{b.value=e.matches}))}w();function T(){let e=S(),t=u(()=>y.value!==null);async function n(){let e=y.value;if(!e)return!1;await e.prompt();let t=await e.userChoice;return y.value=null,t.outcome===`accepted`}return{isStandalone:b,isIOS:e,canPromptInstall:t,install:n}}var E={class:`settings`},D={key:0,class:`settings__section`},O={class:`settings__section`},k={class:`theme-grid`,role:`radiogroup`,"aria-label":`Choose theme`},A=[`aria-checked`,`aria-label`,`onClick`],j={class:`theme-swatch__label`},M={key:0,class:`theme-swatch__check`,"aria-hidden":`true`},N={class:`settings__section`},P={class:`settings__row`},F={class:`settings__row-value`},I={class:`install-modal__card`},L={id:`install-modal-title`,class:`install-modal__title`},R={class:`install-modal__steps`},z={key:0},B={key:1},V={key:0},H=p(o({__name:`SettingsView`,setup(o){let p=_(),{saveTheme:y}=g(),{isStandalone:b,isIOS:x,canPromptInstall:S,install:C}=T(),w=u(()=>p.user?.theme??`warm-craft`),H=t(!1);function U(e){y(e)}async function W(){!await C()&&!S.value&&(H.value=!0)}return(t,o)=>(i(),h(`main`,E,[o[18]||=l(`h1`,{class:`settings__title`},`Settings`,-1),e(b)?m(``,!0):(i(),h(`section`,D,[o[3]||=l(`h2`,{class:`settings__section-title`},`Install app`,-1),o[4]||=l(`p`,{class:`settings__hint`},` Pin pictureFrame to your home screen so it opens like a native app. `,-1),e(S)?(i(),h(`button`,{key:0,type:`button`,class:`settings__install`,onClick:W},` Install pictureFrame `)):(i(),h(`button`,{key:1,type:`button`,class:`settings__install`,onClick:o[0]||=e=>H.value=!0},` Add to Home Screen `))])),l(`section`,O,[o[6]||=l(`h2`,{class:`settings__section-title`},`Theme`,-1),l(`div`,k,[(i(!0),h(d,null,a(e(v),e=>(i(),h(`button`,{key:e.id,type:`button`,role:`radio`,"aria-checked":w.value===e.id,"aria-label":e.label,class:r([`theme-swatch`,{"theme-swatch--active":w.value===e.id}]),style:f({"--swatch-bg":e.bg,"--swatch-primary":e.primary,"--swatch-text":e.text}),onClick:t=>U(e.id)},[o[5]||=l(`span`,{class:`theme-swatch__preview`,"aria-hidden":`true`},[l(`span`,{class:`theme-swatch__bar`}),l(`span`,{class:`theme-swatch__dot`})],-1),l(`span`,j,n(e.label),1),w.value===e.id?(i(),h(`span`,M,`✓`)):m(``,!0)],14,A))),128))])]),l(`section`,N,[o[8]||=l(`h2`,{class:`settings__section-title`},`Account`,-1),l(`div`,P,[o[7]||=l(`span`,{class:`settings__row-label`},`Signed in as`,-1),l(`span`,F,n(e(p).user?.email),1)]),o[9]||=l(`a`,{href:`/logout`,class:`settings__logout`},`Sign out`,-1)]),H.value?(i(),h(`div`,{key:1,class:`install-modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`install-modal-title`,onClick:o[2]||=c(e=>H.value=!1,[`self`])},[l(`div`,I,[l(`button`,{type:`button`,class:`install-modal__close`,"aria-label":`Close`,onClick:o[1]||=e=>H.value=!1},`×`),l(`h2`,L,n(e(x)?`Add to your iPhone home screen`:`Add to your home screen`),1),l(`ol`,R,[e(x)?(i(),h(`li`,z,[...o[10]||=[s(` Tap the `,-1),l(`strong`,null,`Share`,-1),s(` icon at the bottom of Safari (the square with an up-arrow). `,-1)]])):(i(),h(`li`,B,[...o[11]||=[s(` Open your browser's menu (usually the three dots `,-1),l(`strong`,null,`⋮`,-1),s(` in the top right). `,-1)]])),l(`li`,null,[o[13]||=s(` Scroll down and tap `,-1),o[14]||=l(`strong`,null,`Add to Home Screen`,-1),e(x)?m(``,!0):(i(),h(`span`,V,[...o[12]||=[s(`or `,-1),l(`strong`,null,`Install app`,-1)]])),o[15]||=s(`. `,-1)]),o[16]||=l(`li`,null,[s(` Tap `),l(`strong`,null,`Add`),s(` in the top right to confirm. `)],-1)]),o[17]||=l(`p`,{class:`install-modal__footer`},` The app will appear on your home screen and open without browser chrome the next time you launch it. `,-1)])])):m(``,!0)]))}}),[[`__scopeId`,`data-v-6f8a8b72`]]);export{H as default}; \ No newline at end of file diff --git a/public/build/assets/SettingsView-DWXOcfNX.js b/public/build/assets/SettingsView-DWXOcfNX.js new file mode 100644 index 0000000..924cc87 --- /dev/null +++ b/public/build/assets/SettingsView-DWXOcfNX.js @@ -0,0 +1 @@ +import{C as e,F as t,J as n,K as r,N as i,U as a,Y as o,f as s,g as c,h as l,p as u,q as d,t as f,v as p,x as m,y as h}from"./_plugin-vue_export-helper-BNDVmFr7.js";import{n as g,r as _,t as v}from"./index-DdJ5jHP4.js";var y=a(null),b=a(!1);function x(){return typeof window>`u`?!1:window.matchMedia?.(`(display-mode: standalone)`).matches?!0:window.navigator.standalone===!0}function S(){if(typeof navigator>`u`)return!1;let e=navigator.userAgent,t=e.includes(`Mac`)&&navigator.maxTouchPoints>1;return/iPhone|iPod/.test(e)||t}var C=!1;function w(){C||typeof window>`u`||(C=!0,b.value=x(),window.addEventListener(`beforeinstallprompt`,e=>{e.preventDefault(),y.value=e}),window.addEventListener(`appinstalled`,()=>{y.value=null,b.value=!0}),window.matchMedia?.(`(display-mode: standalone)`).addEventListener(`change`,e=>{b.value=e.matches}))}w();function T(){let e=S(),t=l(()=>y.value!==null);async function n(){let e=y.value;if(!e)return!1;await e.prompt();let t=await e.userChoice;return y.value=null,t.outcome===`accepted`}return{isStandalone:b,isIOS:e,canPromptInstall:t,install:n}}var E={class:`settings`},D={key:0,class:`settings__section`},O={class:`settings__section`},k={class:`theme-grid`,role:`radiogroup`,"aria-label":`Choose theme`},A=[`aria-checked`,`aria-label`,`onClick`],j={class:`theme-swatch__label`},M={key:0,class:`theme-swatch__check`,"aria-hidden":`true`},N={class:`settings__section`},P={class:`settings__row`},F={class:`settings__row-value`},I={class:`install-modal__card`},L={id:`install-modal-title`,class:`install-modal__title`},R={class:`install-modal__steps`},z={key:0},B={key:1},V={key:0},H=f(e({__name:`SettingsView`,setup(e){let f=_(),{saveTheme:y}=g(),{isStandalone:b,isIOS:x,canPromptInstall:S,install:C}=T(),w=l(()=>f.user?.theme??`warm-craft`),H=a(!1);function U(e){y(e)}async function W(){!await C()&&!S.value&&(H.value=!0)}return(e,a)=>(i(),h(`main`,E,[a[18]||=c(`h1`,{class:`settings__title`},`Settings`,-1),r(b)?p(``,!0):(i(),h(`section`,D,[a[3]||=c(`h2`,{class:`settings__section-title`},`Install app`,-1),a[4]||=c(`p`,{class:`settings__hint`},` Pin pictureFrame to your home screen so it opens like a native app. `,-1),r(S)?(i(),h(`button`,{key:0,type:`button`,class:`settings__install`,onClick:W},` Install pictureFrame `)):(i(),h(`button`,{key:1,type:`button`,class:`settings__install`,onClick:a[0]||=e=>H.value=!0},` Add to Home Screen `))])),c(`section`,O,[a[6]||=c(`h2`,{class:`settings__section-title`},`Theme`,-1),c(`div`,k,[(i(!0),h(u,null,t(r(v),e=>(i(),h(`button`,{key:e.id,type:`button`,role:`radio`,"aria-checked":w.value===e.id,"aria-label":e.label,class:d([`theme-swatch`,{"theme-swatch--active":w.value===e.id}]),style:n({"--swatch-bg":e.bg,"--swatch-primary":e.primary,"--swatch-text":e.text}),onClick:t=>U(e.id)},[a[5]||=c(`span`,{class:`theme-swatch__preview`,"aria-hidden":`true`},[c(`span`,{class:`theme-swatch__bar`}),c(`span`,{class:`theme-swatch__dot`})],-1),c(`span`,j,o(e.label),1),w.value===e.id?(i(),h(`span`,M,`✓`)):p(``,!0)],14,A))),128))])]),c(`section`,N,[a[8]||=c(`h2`,{class:`settings__section-title`},`Account`,-1),c(`div`,P,[a[7]||=c(`span`,{class:`settings__row-label`},`Signed in as`,-1),c(`span`,F,o(r(f).user?.email),1)]),a[9]||=c(`a`,{href:`/logout`,class:`settings__logout`},`Sign out`,-1)]),H.value?(i(),h(`div`,{key:1,class:`install-modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`install-modal-title`,onClick:a[2]||=s(e=>H.value=!1,[`self`])},[c(`div`,I,[c(`button`,{type:`button`,class:`install-modal__close`,"aria-label":`Close`,onClick:a[1]||=e=>H.value=!1},`×`),c(`h2`,L,o(r(x)?`Add to your iPhone home screen`:`Add to your home screen`),1),c(`ol`,R,[r(x)?(i(),h(`li`,z,[...a[10]||=[m(` Tap the `,-1),c(`strong`,null,`Share`,-1),m(` icon at the bottom of Safari (the square with an up-arrow). `,-1)]])):(i(),h(`li`,B,[...a[11]||=[m(` Open your browser's menu (usually the three dots `,-1),c(`strong`,null,`⋮`,-1),m(` in the top right). `,-1)]])),c(`li`,null,[a[13]||=m(` Scroll down and tap `,-1),a[14]||=c(`strong`,null,`Add to Home Screen`,-1),r(x)?p(``,!0):(i(),h(`span`,V,[...a[12]||=[m(`or `,-1),c(`strong`,null,`Install app`,-1)]])),a[15]||=m(`. `,-1)]),a[16]||=c(`li`,null,[m(` Tap `),c(`strong`,null,`Add`),m(` in the top right to confirm. `)],-1)]),a[17]||=c(`p`,{class:`install-modal__footer`},` The app will appear on your home screen. Open it from there and it runs like a regular app — no address bar, no tabs. `,-1)])])):p(``,!0)]))}}),[[`__scopeId`,`data-v-fb5d8496`]]);export{H as default}; \ No newline at end of file diff --git a/public/build/assets/SettingsView-Ce_UCsin.css b/public/build/assets/SettingsView-DmUQdUmU.css similarity index 57% rename from public/build/assets/SettingsView-Ce_UCsin.css rename to public/build/assets/SettingsView-DmUQdUmU.css index 974933c..00e2966 100644 --- a/public/build/assets/SettingsView-Ce_UCsin.css +++ b/public/build/assets/SettingsView-DmUQdUmU.css @@ -1 +1 @@ -.settings[data-v-6f8a8b72]{padding:var(--space-4) var(--space-4) calc(var(--bottom-nav-height) + var(--space-6));max-width:480px;margin:0 auto}.settings__title[data-v-6f8a8b72]{font-size:var(--text-xl);margin-bottom:var(--space-6);font-weight:700}.settings__section[data-v-6f8a8b72]{margin-bottom:var(--space-6)}.settings__section-title[data-v-6f8a8b72]{font-size:var(--text-sm);color:var(--color-text-muted);text-transform:uppercase;letter-spacing:.06em;margin-bottom:var(--space-3);font-weight:700}.settings__row[data-v-6f8a8b72]{padding:var(--space-3) 0;border-bottom:1px solid var(--color-border);font-size:var(--text-base);justify-content:space-between;align-items:center;display:flex}.settings__row-label[data-v-6f8a8b72]{color:var(--color-text-muted)}.settings__row-value[data-v-6f8a8b72]{font-weight:600}.settings__logout[data-v-6f8a8b72]{min-height:var(--touch-min);padding:var(--space-3) 0;color:var(--color-destructive);font-weight:600;font-size:var(--text-base);align-items:center;text-decoration:none;display:flex}.settings__hint[data-v-6f8a8b72]{color:var(--color-text-muted);font-size:var(--text-sm);margin-bottom:var(--space-3);line-height:1.4}.settings__install[data-v-6f8a8b72]{width:100%;min-height:var(--touch-min);background:var(--color-primary);color:var(--color-on-primary);border-radius:var(--radius-pill,9999px);font-size:var(--text-base);cursor:pointer;border:none;justify-content:center;align-items:center;font-weight:700;display:flex}.install-modal[data-v-6f8a8b72]{padding:var(--space-4);z-index:100;background:#00000080;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.install-modal__card[data-v-6f8a8b72]{background:var(--color-surface);color:var(--color-text);border-radius:var(--radius-lg,16px);padding:var(--space-5);width:100%;max-width:380px;position:relative;box-shadow:0 20px 60px #00000040}.install-modal__close[data-v-6f8a8b72]{top:var(--space-2);right:var(--space-3);color:var(--color-text-muted);cursor:pointer;padding:var(--space-1) var(--space-2);background:0 0;border:none;font-size:1.75rem;line-height:1;position:absolute}.install-modal__title[data-v-6f8a8b72]{font-size:var(--text-lg);margin-bottom:var(--space-3);padding-right:var(--space-5);font-weight:700}.install-modal__steps[data-v-6f8a8b72]{margin:0 0 var(--space-3) var(--space-4);padding:0;line-height:1.5}.install-modal__steps li[data-v-6f8a8b72]{margin-bottom:var(--space-2)}.install-modal__footer[data-v-6f8a8b72]{color:var(--color-text-muted);font-size:var(--text-sm);margin-top:var(--space-3);border-top:1px solid var(--color-border);padding-top:var(--space-3);line-height:1.4}.theme-grid[data-v-6f8a8b72]{gap:var(--space-3);grid-template-columns:repeat(3,1fr);display:grid}.theme-swatch[data-v-6f8a8b72]{align-items:center;gap:var(--space-2);padding:var(--space-3);background:var(--swatch-bg);border-radius:var(--radius-md);cursor:pointer;transition:border-color var(--duration-fast);min-height:var(--touch-min);border:2px solid #0000;flex-direction:column;display:flex;position:relative}.theme-swatch--active[data-v-6f8a8b72]{border-color:var(--swatch-primary)}.theme-swatch__preview[data-v-6f8a8b72]{border-radius:var(--radius-sm);background:var(--swatch-bg);border:1px solid color-mix(in srgb, var(--swatch-text) 15%, transparent);flex-direction:column;justify-content:center;gap:4px;width:100%;height:36px;padding:0 6px;display:flex}.theme-swatch__bar[data-v-6f8a8b72]{background:var(--swatch-primary);border-radius:3px;width:60%;height:6px;display:block}.theme-swatch__dot[data-v-6f8a8b72]{background:var(--swatch-text);opacity:.4;border-radius:2px;width:80%;height:4px;display:block}.theme-swatch__label[data-v-6f8a8b72]{font-size:var(--text-xs);color:var(--color-text);text-align:center;font-weight:600;line-height:1.2}.theme-swatch__check[data-v-6f8a8b72]{top:var(--space-1);right:var(--space-2);font-size:var(--text-sm);color:var(--swatch-primary);font-weight:700;position:absolute} +.settings[data-v-fb5d8496]{padding:var(--space-4) var(--space-4) calc(var(--bottom-nav-height) + var(--space-6));max-width:480px;margin:0 auto}.settings__title[data-v-fb5d8496]{font-size:var(--text-xl);margin-bottom:var(--space-6);font-weight:700}.settings__section[data-v-fb5d8496]{margin-bottom:var(--space-6)}.settings__section-title[data-v-fb5d8496]{font-size:var(--text-sm);color:var(--color-text-muted);text-transform:uppercase;letter-spacing:.06em;margin-bottom:var(--space-3);font-weight:700}.settings__row[data-v-fb5d8496]{padding:var(--space-3) 0;border-bottom:1px solid var(--color-border);font-size:var(--text-base);justify-content:space-between;align-items:center;display:flex}.settings__row-label[data-v-fb5d8496]{color:var(--color-text-muted)}.settings__row-value[data-v-fb5d8496]{font-weight:600}.settings__logout[data-v-fb5d8496]{min-height:var(--touch-min);padding:var(--space-3) 0;color:var(--color-destructive);font-weight:600;font-size:var(--text-base);align-items:center;text-decoration:none;display:flex}.settings__hint[data-v-fb5d8496]{color:var(--color-text-muted);font-size:var(--text-sm);margin-bottom:var(--space-3);line-height:1.4}.settings__install[data-v-fb5d8496]{width:100%;min-height:var(--touch-min);background:var(--color-primary);color:var(--color-on-primary);border-radius:var(--radius-pill,9999px);font-size:var(--text-base);cursor:pointer;border:none;justify-content:center;align-items:center;font-weight:700;display:flex}.install-modal[data-v-fb5d8496]{padding:var(--space-4);z-index:100;background:#00000080;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.install-modal__card[data-v-fb5d8496]{background:var(--color-surface);color:var(--color-text);border-radius:var(--radius-lg,16px);padding:var(--space-5);width:100%;max-width:380px;position:relative;box-shadow:0 20px 60px #00000040}.install-modal__close[data-v-fb5d8496]{top:var(--space-2);right:var(--space-3);color:var(--color-text-muted);cursor:pointer;padding:var(--space-1) var(--space-2);background:0 0;border:none;font-size:1.75rem;line-height:1;position:absolute}.install-modal__title[data-v-fb5d8496]{font-size:var(--text-lg);margin-bottom:var(--space-3);padding-right:var(--space-5);font-weight:700}.install-modal__steps[data-v-fb5d8496]{margin:0 0 var(--space-3) var(--space-4);padding:0;line-height:1.5}.install-modal__steps li[data-v-fb5d8496]{margin-bottom:var(--space-2)}.install-modal__footer[data-v-fb5d8496]{color:var(--color-text-muted);font-size:var(--text-sm);margin-top:var(--space-3);border-top:1px solid var(--color-border);padding-top:var(--space-3);line-height:1.4}.theme-grid[data-v-fb5d8496]{gap:var(--space-3);grid-template-columns:repeat(3,1fr);display:grid}.theme-swatch[data-v-fb5d8496]{align-items:center;gap:var(--space-2);padding:var(--space-3);background:var(--swatch-bg);border-radius:var(--radius-md);cursor:pointer;transition:border-color var(--duration-fast);min-height:var(--touch-min);border:2px solid #0000;flex-direction:column;display:flex;position:relative}.theme-swatch--active[data-v-fb5d8496]{border-color:var(--swatch-primary)}.theme-swatch__preview[data-v-fb5d8496]{border-radius:var(--radius-sm);background:var(--swatch-bg);border:1px solid color-mix(in srgb, var(--swatch-text) 15%, transparent);flex-direction:column;justify-content:center;gap:4px;width:100%;height:36px;padding:0 6px;display:flex}.theme-swatch__bar[data-v-fb5d8496]{background:var(--swatch-primary);border-radius:3px;width:60%;height:6px;display:block}.theme-swatch__dot[data-v-fb5d8496]{background:var(--swatch-text);opacity:.4;border-radius:2px;width:80%;height:4px;display:block}.theme-swatch__label[data-v-fb5d8496]{font-size:var(--text-xs);color:var(--color-text);text-align:center;font-weight:600;line-height:1.2}.theme-swatch__check[data-v-fb5d8496]{top:var(--space-1);right:var(--space-2);font-size:var(--text-sm);color:var(--swatch-primary);font-weight:700;position:absolute} diff --git a/public/build/assets/UploadView-C0dEQPr3.js b/public/build/assets/UploadView-C0dEQPr3.js new file mode 100644 index 0000000..6014b95 --- /dev/null +++ b/public/build/assets/UploadView-C0dEQPr3.js @@ -0,0 +1 @@ +import{A as e,B as t,C as n,F as r,J as i,K as a,L as o,N as s,O as c,S as l,U as u,Y as d,_ as f,b as p,f as m,g as h,h as g,k as _,p as v,q as y,t as b,v as x,x as S,y as C,z as w}from"./_plugin-vue_export-helper-BNDVmFr7.js";import{a as T,i as E,s as D}from"./index-DdJ5jHP4.js";import{i as O,n as ee,r as k,t as A}from"./BaseBottomSheet-Bsol3Sat.js";import{t as j}from"./DevicePicker-1UBxnMbg.js";var M={class:`crop-editor__top`},N={key:0,class:`crop-editor__label`},P={class:`crop-editor__orient`,role:`radiogroup`,"aria-label":`Crop orientation`},F=[`aria-checked`,`aria-label`,`onClick`],I={width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"aria-hidden":`true`},L={key:0,x:`2`,y:`6`,width:`20`,height:`12`,rx:`1.5`},te={key:1,x:`6`,y:`2`,width:`12`,height:`20`,rx:`1.5`},R={key:1,class:`crop-editor__mismatch`,role:`status`},ne={class:`crop-editor__actions`},z=b(n({__name:`CropEditor`,props:{src:{},orientation:{},deviceName:{},initialParams:{},initialOrientation:{}},emits:[`crop`],setup(n,{emit:i}){let a=n,o=i,c=[{value:`landscape`,label:`Landscape crop`},{value:`portrait`,label:`Portrait crop`}],f=u(a.initialOrientation??a.orientation),p=g(()=>f.value===`landscape`?{w:1600,h:960}:{w:960,h:1600}),m=g(()=>p.value.w/p.value.h),b=g(()=>f.value!==a.orientation),T=u(),E=u(),D=null,O=null,k=0,A=u(0),j=u(0),z=u(1),B={x:0,y:0,w:0,h:0},V=1;function re(e){f.value!==e&&(f.value=e,A.value=0,j.value=0,z.value=1,H())}function H(){let e=E.value,t=T.value;if(!e||!t)return;let n=t.getBoundingClientRect(),r=n.height-80,i=n.width;e.width=i,e.height=r,D=e.getContext(`2d`);let a=i-48,o=r-48,s,c;a/o>m.value?(c=o,s=c*m.value):(s=a,c=s/m.value),B={x:(i-s)/2,y:(r-c)/2,w:s,h:c},O&&U()}function U(){O&&(V=Math.max(B.w/O.naturalWidth,B.h/O.naturalHeight),a.initialParams?W(a.initialParams):(z.value=1,A.value=0,j.value=0,K()))}function W(e){if(!O)return;let t=B.w/e.natW;z.value=t/V,A.value=t*(O.naturalWidth/2-e.natX-e.natW/2),j.value=t*(O.naturalHeight/2-e.natY-e.natH/2);let[n,r]=G(A.value,j.value);A.value=n,j.value=r,K()}function G(e,t){if(!O)return[e,t];let n=V*z.value,r=O.naturalWidth*n,i=O.naturalHeight*n,a=(r-B.w)/2,o=(i-B.h)/2;return[Math.max(-a,Math.min(a,e)),Math.max(-o,Math.min(o,t))]}function K(){if(!D||!O||!E.value)return;let{width:e,height:t}=E.value,n=V*z.value,r=O.naturalWidth*n,i=O.naturalHeight*n,a=B.x+B.w/2+A.value,o=B.y+B.h/2+j.value,s=a-r/2,c=o-i/2;D.clearRect(0,0,e,t),D.drawImage(O,s,c,r,i);let l=B.x+B.w,u=B.y+B.h;D.fillStyle=`rgba(0,0,0,0.6)`,D.fillRect(0,0,e,B.y),D.fillRect(0,u,e,t-u),D.fillRect(0,B.y,B.x,B.h),D.fillRect(l,B.y,e-l,B.h),D.strokeStyle=`#fff`,D.lineWidth=2,D.strokeRect(B.x,B.y,B.w,B.h),D.lineWidth=3,[[B.x,B.y,20,0,0,20],[B.x+B.w,B.y,-20,0,0,20],[B.x,B.y+B.h,20,0,0,-20],[B.x+B.w,B.y+B.h,-20,0,0,-20]].forEach(([e,t,n,r,i,a])=>{D.beginPath(),D.moveTo(e+n,t+r),D.lineTo(e,t),D.lineTo(e+i,t+a),D.stroke()})}let q=new Map,J=0;function Y(e){if(E.value?.setPointerCapture(e.pointerId),q.set(e.pointerId,{x:e.clientX,y:e.clientY}),q.size===2){let e=[...q.values()];J=Math.hypot(e[1].x-e[0].x,e[1].y-e[0].y)}}function X(e){if(!q.has(e.pointerId))return;let t=q.get(e.pointerId);if(q.set(e.pointerId,{x:e.clientX,y:e.clientY}),q.size===1){let n=e.clientX-t.x,r=e.clientY-t.y,[i,a]=G(A.value+n,j.value+r);A.value=i,j.value=a,Q();return}if(q.size===2){let e=[...q.values()],t=Math.hypot(e[1].x-e[0].x,e[1].y-e[0].y);if(J>0){let e=t/J;z.value=Math.max(1,z.value*e);let[n,r]=G(A.value,j.value);A.value=n,j.value=r,Q()}J=t}}function Z(e){q.delete(e.pointerId),J=0}function Q(){cancelAnimationFrame(k),k=requestAnimationFrame(K)}async function ie(){if(!O)return;let e=V*z.value,t=B.x+B.w/2+A.value,n=B.y+B.h/2+j.value,r=t-O.naturalWidth*e/2,i=n-O.naturalHeight*e/2,a=(B.x-r)/e,s=(B.y-i)/e,c=B.w/e,l=B.h/e,{w:u,h:d}=p.value,m=new OffscreenCanvas(u,d);m.getContext(`2d`).drawImage(O,a,s,c,l,0,0,u,d),o(`crop`,{blob:await m.convertToBlob({type:`image/jpeg`,quality:.92}),params:{natX:a,natY:s,natW:c,natH:l},orientation:f.value})}let ae=new ResizeObserver(H);return e(()=>{T.value&&ae.observe(T.value),H(),O=new Image,O.onload=()=>{H(),U()},O.src=a.src}),w(()=>a.src,e=>{O&&(O.onload=()=>U(),O.src=e)}),_(()=>{ae.disconnect(),cancelAnimationFrame(k)}),(e,i)=>(s(),C(`div`,{class:`crop-editor`,ref_key:`containerRef`,ref:T},[h(`canvas`,{ref_key:`canvasRef`,ref:E,class:`crop-editor__canvas`,onPointerdown:Y,onPointermove:X,onPointerup:Z,onPointercancel:Z},null,544),h(`div`,M,[n.deviceName?(s(),C(`div`,N,d(n.deviceName),1)):x(``,!0),h(`div`,P,[(s(),C(v,null,r(c,e=>h(`button`,{key:e.value,type:`button`,role:`radio`,"aria-checked":f.value===e.value,"aria-label":e.label,class:y([`crop-editor__orient-btn`,{"crop-editor__orient-btn--active":f.value===e.value}]),onClick:t=>re(e.value)},[(s(),C(`svg`,I,[e.value===`landscape`?(s(),C(`rect`,L)):(s(),C(`rect`,te))]))],10,F)),64))]),b.value?(s(),C(`div`,R,[i[0]||=h(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"aria-hidden":`true`},[h(`path`,{d:`M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z`}),h(`line`,{x1:`12`,y1:`9`,x2:`12`,y2:`13`}),h(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`})],-1),h(`span`,null,`Frame is set to `+d(n.orientation)+`. Switch the frame in Settings to display this crop.`,1)])):x(``,!0)]),h(`div`,ne,[l(ee,{variant:`primary`,class:`crop-editor__use-btn`,onClick:ie},{default:t(()=>[...i[1]||=[S(` Use this crop `,-1)]]),_:1})])],512))}}),[[`__scopeId`,`data-v-9ad25e6f`]]),B=[{id:`santa-hat`,label:`Santa hat`,url:`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2064%2064'%3e%3cpath%20d='M%208%2052%20L%2056%2052%20Q%2050%2030%2042%2012%20Q%2032%2022%2024%2032%20Q%2014%2042%208%2052%20Z'%20fill='%23cf2030'/%3e%3cpath%20d='M%2024%2032%20Q%2014%2042%208%2052%20Q%2018%2050%2028%2044%20Q%2026%2038%2024%2032%20Z'%20fill='%23a8141d'%20opacity='0.55'/%3e%3crect%20x='6'%20y='48'%20width='52'%20height='10'%20rx='5'%20fill='%23ffffff'/%3e%3cellipse%20cx='14'%20cy='53'%20rx='2.2'%20ry='1.6'%20fill='%23ececec'/%3e%3cellipse%20cx='28'%20cy='53'%20rx='2.2'%20ry='1.6'%20fill='%23ececec'/%3e%3cellipse%20cx='42'%20cy='53'%20rx='2.2'%20ry='1.6'%20fill='%23ececec'/%3e%3cellipse%20cx='52'%20cy='53'%20rx='2'%20ry='1.4'%20fill='%23ececec'/%3e%3ccircle%20cx='42'%20cy='12'%20r='7.5'%20fill='%23ffffff'/%3e%3ccircle%20cx='40'%20cy='10'%20r='2'%20fill='%23f4f4f4'%20opacity='0.6'/%3e%3c/svg%3e`}],V={class:`sticker-tray`},re={key:0,class:`sticker-tray__section`},H={class:`sticker-tray__row`},U=[`aria-label`,`onClick`],W={key:0,class:`sticker-tray__emoji`,"aria-hidden":`true`},G=[`src`],K={class:`sticker-tray__section`},q={class:`sticker-tray__row`},J=[`aria-label`,`onClick`],Y=[`src`,`alt`],X={class:`sticker-tray__section`},Z=`pf.stickerTray.recents`,Q=12,ie=b(n({__name:`StickerTray`,props:{modelValue:{type:Boolean}},emits:[`update:modelValue`,`pick`],setup(n,{emit:i}){let o=i,c=u([]);e(()=>{c.value=l()});function l(){try{let e=localStorage.getItem(Z);return e?JSON.parse(e).map(e=>{if(e.kind===`image`&&e.imageAsset){let t=B.find(t=>t.id===e.imageAsset);return{...e,url:t?.url,label:t?.label??e.label}}return e}).filter(e=>e.kind===`emoji`?!!e.emoji:!!e.url):[]}catch{return[]}}function p(){try{localStorage.setItem(Z,JSON.stringify(c.value))}catch{}}function m(e){c.value=[e,...c.value.filter(t=>t.key!==e.key)].slice(0,Q),p()}function g(e){if(!e)return null;if(typeof Intl<`u`&&Intl.Segmenter){let t=[...new Intl.Segmenter(void 0,{granularity:`grapheme`}).segment(e)];return t[t.length-1]?.segment??null}return[...e].pop()??null}function _(e){let t=e.target,n=g(t.value);t.value=``,n&&(m({key:`emoji:${n}`,kind:`emoji`,label:n,emoji:n}),o(`pick`,{emoji:n}))}function y(e){m({key:`image:${e.id}`,kind:`image`,label:e.label,imageAsset:e.id,url:e.url}),o(`pick`,{imageAsset:e.id})}function b(e){m(e),e.kind===`emoji`&&e.emoji?o(`pick`,{emoji:e.emoji}):e.kind===`image`&&e.imageAsset&&o(`pick`,{imageAsset:e.imageAsset})}return(e,i)=>(s(),f(A,{"model-value":n.modelValue,label:`Add sticker`,"onUpdate:modelValue":i[0]||=t=>e.$emit(`update:modelValue`,t)},{default:t(()=>[h(`div`,V,[c.value.length?(s(),C(`section`,re,[i[1]||=h(`h3`,{class:`sticker-tray__heading`},`Recent`,-1),h(`div`,H,[(s(!0),C(v,null,r(c.value,e=>(s(),C(`button`,{key:e.key,type:`button`,class:`sticker-tray__chip`,"aria-label":e.label,onClick:t=>b(e)},[e.kind===`emoji`?(s(),C(`span`,W,d(e.emoji),1)):(s(),C(`img`,{key:1,src:e.url,alt:``,class:`sticker-tray__img`},null,8,G))],8,U))),128))])])):x(``,!0),h(`section`,K,[i[2]||=h(`h3`,{class:`sticker-tray__heading`},`Stickers`,-1),h(`div`,q,[(s(!0),C(v,null,r(a(B),e=>(s(),C(`button`,{key:e.id,type:`button`,class:`sticker-tray__chip`,"aria-label":e.label,onClick:t=>y(e)},[h(`img`,{src:e.url,alt:e.label,class:`sticker-tray__img`},null,8,Y)],8,J))),128))])]),h(`section`,X,[i[3]||=h(`h3`,{class:`sticker-tray__heading`},`Any emoji`,-1),i[4]||=h(`p`,{class:`sticker-tray__hint`},`Tap the box, then pick from your keyboard's emoji button.`,-1),h(`input`,{type:`text`,class:`sticker-tray__emoji-input`,inputmode:`text`,autocomplete:`off`,autocorrect:`off`,autocapitalize:`off`,spellcheck:`false`,placeholder:`😀 🎉 🐶 …`,"aria-label":`Emoji input — use your keyboard's emoji button`,onInput:_},null,32)])])]),_:1},8,[`model-value`]))}}),[[`__scopeId`,`data-v-9a64b78a`]]),ae=[{id:`sea-snow`,category:`seasonal`,label:`Snowflake`,emoji:`❄️`},{id:`sea-sun`,category:`seasonal`,label:`Sun`,emoji:`☀️`},{id:`sea-leaves`,category:`seasonal`,label:`Autumn`,emoji:`🍂`},{id:`sea-blossom`,category:`seasonal`,label:`Blossom`,emoji:`🌸`},{id:`sea-snowman`,category:`seasonal`,label:`Snowman`,emoji:`⛄`},{id:`hol-tree`,category:`holidays`,label:`Tree`,emoji:`🎄`},{id:`hol-gift`,category:`holidays`,label:`Gift`,emoji:`🎁`},{id:`hol-heart`,category:`holidays`,label:`Heart`,emoji:`❤️`},{id:`hol-party`,category:`holidays`,label:`Party`,emoji:`🎉`},{id:`hol-cake`,category:`holidays`,label:`Cake`,emoji:`🎂`},{id:`fun-star`,category:`fun`,label:`Star`,emoji:`⭐`},{id:`fun-rainbow`,category:`fun`,label:`Rainbow`,emoji:`🌈`},{id:`fun-balloon`,category:`fun`,label:`Balloon`,emoji:`🎈`},{id:`fun-sparkle`,category:`fun`,label:`Sparkles`,emoji:`✨`},{id:`fun-fire`,category:`fun`,label:`Fire`,emoji:`🔥`},{id:`fam-house`,category:`family`,label:`Home`,emoji:`🏠`},{id:`fam-paw`,category:`family`,label:`Paw`,emoji:`🐾`},{id:`fam-camera`,category:`family`,label:`Camera`,emoji:`📷`},{id:`fam-plane`,category:`family`,label:`Airplane`,emoji:`✈️`},{id:`fam-music`,category:`family`,label:`Music`,emoji:`🎵`},{id:`nat-tree`,category:`nature`,label:`Tree`,emoji:`🌲`},{id:`nat-flower`,category:`nature`,label:`Flower`,emoji:`🌺`},{id:`nat-bee`,category:`nature`,label:`Bee`,emoji:`🐝`},{id:`nat-fly`,category:`nature`,label:`Butterfly`,emoji:`🦋`},{id:`nat-moon`,category:`nature`,label:`Moon`,emoji:`🌙`}],oe={class:`sticker-canvas__bar`},se=52,$=96,ce=b(n({__name:`StickerCanvas`,props:{croppedUrl:{},orientation:{},stickers:{}},emits:[`add-sticker`,`update-sticker`,`remove-sticker`,`done`],setup(n,{emit:a}){let d=n,y=a,b=u(),T=u(),E=u(),D=u(),O=u(!1),k=u(null),A=u(375),j=u(225),M=d.orientation===`landscape`?1600/960:960/1600;function N(){if(!b.value)return;let{width:e,height:t}=b.value.getBoundingClientRect(),n=t-72;e/n>M?(j.value=n,A.value=n*M):(A.value=e,j.value=e/M),I()}let P=new ResizeObserver(N);e(()=>{b.value&&P.observe(b.value),N(),pe()}),_(()=>{P.disconnect(),me(),U?.()}),w(()=>d.stickers,()=>{if(!k.value)return;let e=(D.value?.getNode())?.findOne(`#${k.value}`);e&&W(e)},{deep:!0});let F=u(null);function I(){let e=new Image;e.onload=()=>{F.value=e},e.src=d.croppedUrl}w(()=>d.croppedUrl,()=>I(),{immediate:!0});let L=u({});e(()=>{for(let e of B){let t=new Image;t.onload=()=>{L.value={...L.value,[e.id]:t}},t.src=e.url}});let te=g(()=>({width:A.value,height:j.value})),R=g(()=>({image:F.value,x:0,y:0,width:A.value,height:j.value})),ne={enabledAnchors:[`top-left`,`top-right`,`bottom-left`,`bottom-right`],rotateEnabled:!0,borderStroke:`rgba(255,255,255,0.8)`,anchorFill:`#fff`,anchorSize:18,keepRatio:!0,boundBoxFunc:(e,t)=>t};function z(e){return{id:e.id,text:re(e),fontSize:se,fontFamily:`"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif`,x:e.x,y:e.y,scaleX:e.scale,scaleY:e.scale,rotation:e.rotation,draggable:!0,offsetX:se/2,offsetY:se/2}}function V(e){return{id:e.id,image:e.imageAsset?L.value[e.imageAsset]:null,x:e.x,y:e.y,width:$,height:$,scaleX:e.scale,scaleY:e.scale,rotation:e.rotation,draggable:!0,offsetX:$/2,offsetY:$/2}}function re(e){return e.emoji?e.emoji:ae.find(t=>t.id===e.type)?.emoji??`⭐`}let H=u(null),U=null;function W(e){let t=e.getClientRect(),n=t.x+t.width+4-14,r=t.y-4-14;n=Math.max(14,Math.min(A.value-14,n)),r=Math.max(14,Math.min(j.value-14,r)),H.value={x:n,y:r}}function G(e){U?.(),U=null;let t=(D.value?.getNode())?.findOne(`#${e}`);if(!t){H.value=null;return}W(t),t.on(`dragmove.handle transform.handle transformend.handle dragend.handle`,()=>W(t)),U=()=>t.off(`.handle`)}function K(e,t){t.cancelBubble=!0,k.value=e,c(()=>{let t=(D.value?.getNode())?.findOne(`#${e}`),n=E.value?.getNode();t&&n&&n.nodes([t]),G(e)})}function q(e){e.target===e.target.getStage()&&(k.value=null,E.value?.getNode()?.nodes([]),U?.(),U=null,H.value=null)}function J(){k.value&&(y(`remove-sticker`,k.value),k.value=null,E.value?.getNode()?.nodes([]),U?.(),U=null,H.value=null)}function Y(e,t){y(`update-sticker`,e,{x:t.target.x(),y:t.target.y()})}function X(e,t){y(`update-sticker`,e,{x:t.target.x(),y:t.target.y(),scale:t.target.scaleX(),rotation:t.target.rotation()})}function Z(e){let t={id:`${e.imageAsset??e.emoji??`sticker`}-${Date.now()}`,type:e.imageAsset?`image`:`emoji`,emoji:e.emoji,imageAsset:e.imageAsset,x:A.value/2,y:j.value/2,scale:1,rotation:0};y(`add-sticker`,t),O.value=!1,c(()=>K(t.id,{cancelBubble:!1}))}let Q=0,ce=1;function le(e){let t=e[0].clientX-e[1].clientX,n=e[0].clientY-e[1].clientY;return Math.hypot(t,n)}function ue(e){e.touches.length!==2||!k.value||(Q=le(e.touches),ce=d.stickers.find(e=>e.id===k.value)?.scale??1)}function de(e){if(e.touches.length!==2||!k.value||Q===0)return;e.preventDefault();let t=Math.max(.2,Math.min(6,ce*(le(e.touches)/Q)));y(`update-sticker`,k.value,{scale:t})}function fe(){Q=0,ce=1}function pe(){let e=b.value;e&&(e.addEventListener(`touchstart`,ue,{passive:!0}),e.addEventListener(`touchmove`,de,{passive:!1}),e.addEventListener(`touchend`,fe,{passive:!0}))}function me(){let e=b.value;e&&(e.removeEventListener(`touchstart`,ue),e.removeEventListener(`touchmove`,de),e.removeEventListener(`touchend`,fe))}async function he(){k.value=null,E.value?.getNode()?.nodes([]),await c();let e=T.value?.getNode();if(!e)return;let t=(d.orientation===`landscape`?1600:960)/A.value,n=await e.toBlob({pixelRatio:t,mimeType:`image/jpeg`,quality:.92});n&&y(`done`,n)}return(e,a)=>{let c=o(`v-image`),u=o(`v-layer`),d=o(`v-text`),g=o(`v-transformer`),_=o(`v-stage`);return s(),C(`div`,{class:`sticker-canvas`,ref_key:`containerRef`,ref:b},[l(_,{ref_key:`stageRef`,ref:T,config:te.value,onClick:q,onTap:q},{default:t(()=>[l(u,null,{default:t(()=>[l(c,{config:R.value},null,8,[`config`])]),_:1}),l(u,{ref_key:`stickerLayerRef`,ref:D},{default:t(()=>[(s(!0),C(v,null,r(n.stickers,e=>(s(),C(v,{key:e.id},[e.imageAsset?(s(),f(c,{key:0,config:V(e),onClick:t=>K(e.id,t),onTap:t=>K(e.id,t),onDragend:t=>Y(e.id,t),onTransformend:t=>X(e.id,t)},null,8,[`config`,`onClick`,`onTap`,`onDragend`,`onTransformend`])):(s(),f(d,{key:1,config:z(e),onClick:t=>K(e.id,t),onTap:t=>K(e.id,t),onDragend:t=>Y(e.id,t),onTransformend:t=>X(e.id,t)},null,8,[`config`,`onClick`,`onTap`,`onDragend`,`onTransformend`]))],64))),128)),l(g,{ref_key:`transformerRef`,ref:E,config:ne},null,512)]),_:1},512)]),_:1},8,[`config`]),H.value?(s(),C(`button`,{key:0,class:`sticker-canvas__delete-handle`,type:`button`,"aria-label":`Remove sticker`,style:i({left:H.value.x+`px`,top:H.value.y+`px`}),onPointerdown:a[0]||=m(()=>{},[`stop`]),onClick:m(J,[`stop`])},[...a[3]||=[p(``,1)]],36)):x(``,!0),h(`div`,oe,[h(`button`,{class:`sticker-canvas__add-btn`,type:`button`,onClick:a[1]||=e=>O.value=!0},[...a[4]||=[h(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"aria-hidden":`true`},[h(`circle`,{cx:`12`,cy:`12`,r:`10`}),h(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`16`}),h(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`})],-1),S(` Add sticker `,-1)]]),l(ee,{variant:`primary`,class:`sticker-canvas__next-btn`,onClick:he},{default:t(()=>[...a[5]||=[S(`Next`,-1)]]),_:1})]),l(ie,{modelValue:O.value,"onUpdate:modelValue":a[2]||=e=>O.value=e,onPick:Z},null,8,[`modelValue`])],512)}}}),[[`__scopeId`,`data-v-0487769c`]]),le={class:`upload-view`},ue={class:`upload-view__header`},de=[`aria-label`],fe={key:0,width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"aria-hidden":`true`},pe={key:1,width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"aria-hidden":`true`},me={class:`upload-view__step-label`},he={key:2,class:`upload-view__done`},ge={class:`upload-view__done-title`},_e=b(n({__name:`UploadView`,setup(n){let r=D(),i=k(),o=O(),c=T(),p=E(),m=u(`crop`),_=u(!1),v=u(!1),y=null,b=g(()=>i.editingImageId!==null);e(async()=>{if(await o.fetchDevices(),!i.originalFile){r.replace(`/`);return}m.value=`crop`});let w=g(()=>i.contextDeviceId?o.devices.find(e=>e.id===i.contextDeviceId):o.devices[0]),A=g(()=>w.value?.orientation??`landscape`),M=g(()=>i.cropOrientation??A.value),N=g(()=>w.value?.name),P=g(()=>m.value===`crop`?b.value?`Edit crop`:`Crop photo`:m.value===`stickers`?`Add stickers`:b.value?`Updated`:`Added`);function F({blob:e,params:t,orientation:n}){i.setCrop(e,t,n),m.value=`stickers`}function I(){i.croppedBlob&&(y=i.croppedBlob,b.value?R():v.value=!0)}function L(e){y=e,b.value?R():v.value=!0}function te(){if(m.value===`crop`){i.cleanup(),r.replace(`/library`);return}m.value===`stickers`&&(m.value=`crop`)}async function R(){if(y){_.value=!0;try{let e=new File([y],`photo.jpg`,{type:`image/jpeg`});if(b.value){await c.reprocessImage(i.editingImageId,e,{cropParams:i.cropParams??void 0,stickerState:i.stickers,cropOrientation:i.cropOrientation??void 0}),v.value=!1,m.value=`done`;return}let t=await c.uploadImage(e,{original:i.originalFile??void 0,cropParams:i.cropParams??void 0,stickerState:i.stickers,cropOrientation:i.cropOrientation??void 0});await Promise.all(i.selectedDeviceIds.map(e=>c.setApproval(t.id,e,!0))),v.value=!1,m.value=`done`}catch(e){p.show(e instanceof Error?e.message:`Upload failed`,`error`)}finally{_.value=!1}}}function ne(){i.cleanup(),r.replace(`/library`)}return(e,n)=>(s(),C(`div`,le,[h(`header`,ue,[m.value===`done`?x(``,!0):(s(),C(`button`,{key:0,class:`upload-view__back`,type:`button`,"aria-label":m.value===`crop`?`Cancel`:`Back`,onClick:te},[m.value===`crop`?(s(),C(`svg`,fe,[...n[2]||=[h(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`},null,-1),h(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`},null,-1)]])):(s(),C(`svg`,pe,[...n[3]||=[h(`polyline`,{points:`15 18 9 12 15 6`},null,-1)]]))],8,de)),h(`span`,me,d(P.value),1),m.value===`stickers`?(s(),C(`button`,{key:1,class:`upload-view__skip`,type:`button`,onClick:I},`Skip`)):x(``,!0)]),m.value===`crop`&&a(i).originalUrl?(s(),f(z,{key:0,src:a(i).originalUrl,orientation:A.value,"device-name":N.value,"initial-params":a(i).cropParams,"initial-orientation":a(i).cropOrientation,class:`upload-view__stage`,onCrop:F},null,8,[`src`,`orientation`,`device-name`,`initial-params`,`initial-orientation`])):m.value===`stickers`&&a(i).croppedUrl?(s(),f(ce,{key:1,"cropped-url":a(i).croppedUrl,orientation:M.value,stickers:a(i).stickers,class:`upload-view__stage`,onAddSticker:a(i).addSticker,onUpdateSticker:a(i).updateSticker,onRemoveSticker:a(i).removeSticker,onDone:L},null,8,[`cropped-url`,`orientation`,`stickers`,`onAddSticker`,`onUpdateSticker`,`onRemoveSticker`])):m.value===`done`?(s(),C(`div`,he,[n[5]||=h(`div`,{class:`upload-view__done-icon`,"aria-hidden":`true`},`🎉`,-1),h(`p`,ge,d(b.value?`Photo updated!`:`Photo added!`),1),n[6]||=h(`p`,{class:`upload-view__done-sub`},`It'll appear on your frame at the next update.`,-1),l(ee,{variant:`primary`,class:`upload-view__done-btn`,onClick:ne},{default:t(()=>[...n[4]||=[S(`Done`,-1)]]),_:1})])):x(``,!0),b.value?x(``,!0):(s(),f(j,{key:3,modelValue:v.value,"onUpdate:modelValue":n[0]||=e=>v.value=e,devices:a(o).devices,selected:a(i).selectedDeviceIds,uploading:_.value,"onUpdate:selected":n[1]||=e=>a(i).selectedDeviceIds=e,onConfirm:R},null,8,[`modelValue`,`devices`,`selected`,`uploading`]))]))}}),[[`__scopeId`,`data-v-af5b9c38`]]);export{_e as default}; \ No newline at end of file diff --git a/public/build/assets/UploadView-CH8tyGyv.css b/public/build/assets/UploadView-CH8tyGyv.css deleted file mode 100644 index 8a618e8..0000000 --- a/public/build/assets/UploadView-CH8tyGyv.css +++ /dev/null @@ -1 +0,0 @@ -.crop-editor[data-v-85d7731b]{touch-action:none;background:#000;flex-direction:column;flex:1;min-height:0;display:flex;position:relative}.crop-editor__canvas[data-v-85d7731b]{touch-action:none;cursor:grab;flex:1;min-height:0;display:block}.crop-editor__canvas[data-v-85d7731b]:active{cursor:grabbing}.crop-editor__top[data-v-85d7731b]{pointer-events:none;flex-direction:column;align-items:center;gap:8px;display:flex;position:absolute;top:12px;left:12px;right:12px}.crop-editor__label[data-v-85d7731b]{color:#fff;font-size:var(--text-xs);letter-spacing:.04em;background:#0009;border-radius:999px;padding:4px 12px;font-weight:700}.crop-editor__orient[data-v-85d7731b]{pointer-events:auto;background:#0009;border-radius:999px;gap:4px;padding:4px;display:flex}.crop-editor__orient-btn[data-v-85d7731b]{color:#ffffffa6;cursor:pointer;width:36px;height:32px;transition:background var(--duration-fast), color var(--duration-fast);background:0 0;border:none;border-radius:999px;justify-content:center;align-items:center;display:flex}.crop-editor__orient-btn--active[data-v-85d7731b]{color:#000;background:#fff}.crop-editor__mismatch[data-v-85d7731b]{pointer-events:auto;background:var(--color-warning,#f59e0b);color:#fff;font-size:var(--text-xs);border-radius:999px;align-items:center;gap:6px;max-width:100%;padding:6px 12px;font-weight:600;line-height:1.3;display:flex}.crop-editor__mismatch svg[data-v-85d7731b]{flex-shrink:0}.crop-editor__actions[data-v-85d7731b]{padding:var(--space-4);justify-content:center;display:flex;position:absolute;bottom:0;left:0;right:0}.crop-editor__use-btn[data-v-85d7731b]{width:100%;max-width:320px}.sticker-tray__cats[data-v-7eada75b]{gap:var(--space-2);padding-bottom:var(--space-3);scrollbar-width:none;display:flex;overflow-x:auto}.sticker-tray__cats[data-v-7eada75b]::-webkit-scrollbar{display:none}.sticker-tray__cat[data-v-7eada75b]{border:1.5px solid var(--color-border);font-size:var(--text-sm);white-space:nowrap;cursor:pointer;color:var(--color-text-muted);transition:all var(--duration-fast);background:0 0;border-radius:999px;padding:6px 14px;font-weight:600}.sticker-tray__cat--active[data-v-7eada75b]{background:var(--color-primary);border-color:var(--color-primary);color:var(--color-primary-fg)}.sticker-tray__grid[data-v-7eada75b]{gap:var(--space-2);grid-template-columns:repeat(5,1fr);display:grid}.sticker-tray__item[data-v-7eada75b]{padding:var(--space-2) var(--space-1);border-radius:var(--radius-sm);cursor:pointer;transition:background var(--duration-fast);background:0 0;border:none;flex-direction:column;align-items:center;gap:4px;display:flex}.sticker-tray__item[data-v-7eada75b]:active{background:var(--color-surface-2)}.sticker-tray__emoji[data-v-7eada75b]{font-family:Apple Color Emoji,Segoe UI Emoji,Noto Color Emoji,sans-serif;font-size:36px;line-height:1}.sticker-tray__label[data-v-7eada75b]{color:var(--color-text-muted);text-align:center;font-size:10px;font-weight:600;line-height:1.2}.sticker-canvas[data-v-fb52db70]{background:#111;flex-direction:column;flex:1;align-items:center;min-height:0;display:flex;position:relative;overflow:hidden}.sticker-canvas[data-v-fb52db70] .konvajs-content{flex-shrink:0}.sticker-canvas__delete[data-v-fb52db70]{top:var(--space-3);right:var(--space-3);cursor:pointer;color:#fff;z-index:10;background:#c81e1ed9;border:none;border-radius:50%;justify-content:center;align-items:center;width:36px;height:36px;display:flex;position:absolute}.sticker-canvas__bar[data-v-fb52db70]{align-items:center;gap:var(--space-3);height:72px;padding:0 var(--space-4);background:var(--color-surface);border-top:1px solid var(--color-border);display:flex;position:absolute;bottom:0;left:0;right:0}.sticker-canvas__add-btn[data-v-fb52db70]{align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-4);border-radius:var(--radius-md);border:1.5px solid var(--color-border);color:var(--color-text);font-size:var(--text-sm);cursor:pointer;white-space:nowrap;background:0 0;font-weight:600;display:flex}.sticker-canvas__next-btn[data-v-fb52db70]{min-width:96px;margin-left:auto}.upload-view[data-v-af5b9c38]{z-index:100;background:var(--color-bg);padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);flex-direction:column;display:flex;position:fixed;inset:0}.upload-view__header[data-v-af5b9c38]{height:56px;padding:0 var(--space-4);background:var(--color-surface);border-bottom:1px solid var(--color-border);flex-shrink:0;align-items:center;display:flex;position:relative}.upload-view__back[data-v-af5b9c38]{cursor:pointer;width:40px;height:40px;color:var(--color-text);background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;margin-left:-8px;display:flex}.upload-view__step-label[data-v-af5b9c38]{font-size:var(--text-base);color:var(--color-text);font-weight:700;position:absolute;left:50%;transform:translate(-50%)}.upload-view__skip[data-v-af5b9c38]{font-size:var(--text-sm);color:var(--color-text-muted);cursor:pointer;padding:var(--space-2) 0;background:0 0;border:none;margin-left:auto;font-weight:600}.upload-view__stage[data-v-af5b9c38]{flex:1;min-height:0}.upload-view__done[data-v-af5b9c38]{justify-content:center;align-items:center;gap:var(--space-4);padding:var(--space-6) var(--space-5);text-align:center;flex-direction:column;flex:1;display:flex}.upload-view__done-icon[data-v-af5b9c38]{font-family:Apple Color Emoji,Segoe UI Emoji,Noto Color Emoji,sans-serif;font-size:64px;line-height:1}.upload-view__done-title[data-v-af5b9c38]{font-size:var(--text-xl);font-weight:700}.upload-view__done-sub[data-v-af5b9c38]{font-size:var(--text-sm);color:var(--color-text-muted);max-width:260px;line-height:1.5}.upload-view__done-btn[data-v-af5b9c38]{width:100%;max-width:320px} diff --git a/public/build/assets/UploadView-CiBmd_8U.js b/public/build/assets/UploadView-CiBmd_8U.js deleted file mode 100644 index 2b6b9fe..0000000 --- a/public/build/assets/UploadView-CiBmd_8U.js +++ /dev/null @@ -1 +0,0 @@ -import{D as e,G as t,H as n,I as r,J as i,K as a,M as o,O as s,P as c,R as l,S as u,_ as d,b as f,g as p,h as m,k as ee,p as h,t as g,v as _,x as v,y,z as b}from"./_plugin-vue_export-helper-eepT72yB.js";import{a as x,i as S,s as C}from"./index-BO5caB_f.js";import{i as w,n as te,r as T,t as E}from"./BaseBottomSheet-BMI-Oljh.js";import{t as D}from"./DevicePicker-C6ucVR6N.js";var O={class:`crop-editor__top`},k={key:0,class:`crop-editor__label`},A={class:`crop-editor__orient`,role:`radiogroup`,"aria-label":`Crop orientation`},j=[`aria-checked`,`aria-label`,`onClick`],M={width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"aria-hidden":`true`},N={key:0,x:`2`,y:`6`,width:`20`,height:`12`,rx:`1.5`},P={key:1,x:`6`,y:`2`,width:`12`,height:`20`,rx:`1.5`},F={key:1,class:`crop-editor__mismatch`,role:`status`},ne={class:`crop-editor__actions`},I=g(u({__name:`CropEditor`,props:{src:{},orientation:{},deviceName:{},initialParams:{},initialOrientation:{}},emits:[`crop`],setup(e,{emit:t}){let r=e,u=t,d=[{value:`landscape`,label:`Landscape crop`},{value:`portrait`,label:`Portrait crop`}],g=n(r.initialOrientation??r.orientation),x=m(()=>g.value===`landscape`?{w:1600,h:960}:{w:960,h:1600}),S=m(()=>x.value.w/x.value.h),C=m(()=>g.value!==r.orientation),w=n(),T=n(),E=null,D=null,I=0,L=n(0),R=n(0),z=n(1),B={x:0,y:0,w:0,h:0},V=1;function re(e){g.value!==e&&(g.value=e,L.value=0,R.value=0,z.value=1,H())}function H(){let e=T.value,t=w.value;if(!e||!t)return;let n=t.getBoundingClientRect(),r=n.height-80,i=n.width;e.width=i,e.height=r,E=e.getContext(`2d`);let a=i-48,o=r-48,s,c;a/o>S.value?(c=o,s=c*S.value):(s=a,c=s/S.value),B={x:(i-s)/2,y:(r-c)/2,w:s,h:c},D&&U()}function U(){D&&(V=Math.max(B.w/D.naturalWidth,B.h/D.naturalHeight),r.initialParams?W(r.initialParams):(z.value=1,L.value=0,R.value=0,K()))}function W(e){if(!D)return;let t=B.w/e.natW;z.value=t/V,L.value=t*(D.naturalWidth/2-e.natX-e.natW/2),R.value=t*(D.naturalHeight/2-e.natY-e.natH/2);let[n,r]=G(L.value,R.value);L.value=n,R.value=r,K()}function G(e,t){if(!D)return[e,t];let n=V*z.value,r=D.naturalWidth*n,i=D.naturalHeight*n,a=(r-B.w)/2,o=(i-B.h)/2;return[Math.max(-a,Math.min(a,e)),Math.max(-o,Math.min(o,t))]}function K(){if(!E||!D||!T.value)return;let{width:e,height:t}=T.value,n=V*z.value,r=D.naturalWidth*n,i=D.naturalHeight*n,a=B.x+B.w/2+L.value,o=B.y+B.h/2+R.value,s=a-r/2,c=o-i/2;E.clearRect(0,0,e,t),E.drawImage(D,s,c,r,i),E.save(),E.fillStyle=`rgba(0,0,0,0.55)`,E.fillRect(0,0,e,t),E.globalCompositeOperation=`destination-out`,E.fillRect(B.x,B.y,B.w,B.h),E.restore(),E.strokeStyle=`#fff`,E.lineWidth=2,E.strokeRect(B.x,B.y,B.w,B.h),E.lineWidth=3,[[B.x,B.y,20,0,0,20],[B.x+B.w,B.y,-20,0,0,20],[B.x,B.y+B.h,20,0,0,-20],[B.x+B.w,B.y+B.h,-20,0,0,-20]].forEach(([e,t,n,r,i,a])=>{E.beginPath(),E.moveTo(e+n,t+r),E.lineTo(e,t),E.lineTo(e+i,t+a),E.stroke()})}let q=new Map,J=0;function Y(e){if(T.value?.setPointerCapture(e.pointerId),q.set(e.pointerId,{x:e.clientX,y:e.clientY}),q.size===2){let e=[...q.values()];J=Math.hypot(e[1].x-e[0].x,e[1].y-e[0].y)}}function X(e){if(!q.has(e.pointerId))return;let t=q.get(e.pointerId);if(q.set(e.pointerId,{x:e.clientX,y:e.clientY}),q.size===1){let n=e.clientX-t.x,r=e.clientY-t.y,[i,a]=G(L.value+n,R.value+r);L.value=i,R.value=a,Q();return}if(q.size===2){let e=[...q.values()],t=Math.hypot(e[1].x-e[0].x,e[1].y-e[0].y);if(J>0){let e=t/J;z.value=Math.max(1,z.value*e);let[n,r]=G(L.value,R.value);L.value=n,R.value=r,Q()}J=t}}function Z(e){q.delete(e.pointerId),J=0}function Q(){cancelAnimationFrame(I),I=requestAnimationFrame(K)}async function ie(){if(!D)return;let e=V*z.value,t=B.x+B.w/2+L.value,n=B.y+B.h/2+R.value,r=t-D.naturalWidth*e/2,i=n-D.naturalHeight*e/2,a=(B.x-r)/e,o=(B.y-i)/e,s=B.w/e,c=B.h/e,{w:l,h:d}=x.value,f=new OffscreenCanvas(l,d);f.getContext(`2d`).drawImage(D,a,o,s,c,0,0,l,d),u(`crop`,{blob:await f.convertToBlob({type:`image/jpeg`,quality:.92}),params:{natX:a,natY:o,natW:s,natH:c},orientation:g.value})}let $=new ResizeObserver(H);return ee(()=>{w.value&&$.observe(w.value),H(),D=new Image,D.onload=()=>{H(),U()},D.src=r.src}),l(()=>r.src,e=>{D&&(D.onload=()=>U(),D.src=e)}),s(()=>{$.disconnect(),cancelAnimationFrame(I)}),(t,n)=>(o(),y(`div`,{class:`crop-editor`,ref_key:`containerRef`,ref:w},[p(`canvas`,{ref_key:`canvasRef`,ref:T,class:`crop-editor__canvas`,onPointerdown:Y,onPointermove:X,onPointerup:Z,onPointercancel:Z},null,544),p(`div`,O,[e.deviceName?(o(),y(`div`,k,i(e.deviceName),1)):_(``,!0),p(`div`,A,[(o(),y(h,null,c(d,e=>p(`button`,{key:e.value,type:`button`,role:`radio`,"aria-checked":g.value===e.value,"aria-label":e.label,class:a([`crop-editor__orient-btn`,{"crop-editor__orient-btn--active":g.value===e.value}]),onClick:t=>re(e.value)},[(o(),y(`svg`,M,[e.value===`landscape`?(o(),y(`rect`,N)):(o(),y(`rect`,P))]))],10,j)),64))]),C.value?(o(),y(`div`,F,[n[0]||=p(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"aria-hidden":`true`},[p(`path`,{d:`M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z`}),p(`line`,{x1:`12`,y1:`9`,x2:`12`,y2:`13`}),p(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`})],-1),p(`span`,null,`Frame is set to `+i(e.orientation)+`. Switch the frame in Settings to display this crop.`,1)])):_(``,!0)]),p(`div`,ne,[v(te,{variant:`primary`,class:`crop-editor__use-btn`,onClick:ie},{default:b(()=>[...n[1]||=[f(` Use this crop `,-1)]]),_:1})])],512))}}),[[`__scopeId`,`data-v-85d7731b`]]),L=[{id:`seasonal`,label:`Seasonal`},{id:`holidays`,label:`Holidays`},{id:`fun`,label:`Fun`},{id:`family`,label:`Family`},{id:`nature`,label:`Nature`}],R=[{id:`sea-snow`,category:`seasonal`,label:`Snowflake`,emoji:`❄️`},{id:`sea-sun`,category:`seasonal`,label:`Sun`,emoji:`☀️`},{id:`sea-leaves`,category:`seasonal`,label:`Autumn`,emoji:`🍂`},{id:`sea-blossom`,category:`seasonal`,label:`Blossom`,emoji:`🌸`},{id:`sea-snowman`,category:`seasonal`,label:`Snowman`,emoji:`⛄`},{id:`hol-tree`,category:`holidays`,label:`Tree`,emoji:`🎄`},{id:`hol-gift`,category:`holidays`,label:`Gift`,emoji:`🎁`},{id:`hol-heart`,category:`holidays`,label:`Heart`,emoji:`❤️`},{id:`hol-party`,category:`holidays`,label:`Party`,emoji:`🎉`},{id:`hol-cake`,category:`holidays`,label:`Cake`,emoji:`🎂`},{id:`fun-star`,category:`fun`,label:`Star`,emoji:`⭐`},{id:`fun-rainbow`,category:`fun`,label:`Rainbow`,emoji:`🌈`},{id:`fun-balloon`,category:`fun`,label:`Balloon`,emoji:`🎈`},{id:`fun-sparkle`,category:`fun`,label:`Sparkles`,emoji:`✨`},{id:`fun-fire`,category:`fun`,label:`Fire`,emoji:`🔥`},{id:`fam-house`,category:`family`,label:`Home`,emoji:`🏠`},{id:`fam-paw`,category:`family`,label:`Paw`,emoji:`🐾`},{id:`fam-camera`,category:`family`,label:`Camera`,emoji:`📷`},{id:`fam-plane`,category:`family`,label:`Airplane`,emoji:`✈️`},{id:`fam-music`,category:`family`,label:`Music`,emoji:`🎵`},{id:`nat-tree`,category:`nature`,label:`Tree`,emoji:`🌲`},{id:`nat-flower`,category:`nature`,label:`Flower`,emoji:`🌺`},{id:`nat-bee`,category:`nature`,label:`Bee`,emoji:`🐝`},{id:`nat-fly`,category:`nature`,label:`Butterfly`,emoji:`🦋`},{id:`nat-moon`,category:`nature`,label:`Moon`,emoji:`🌙`}],z={class:`sticker-tray`},B={class:`sticker-tray__cats`,role:`tablist`},V=[`onClick`],re={class:`sticker-tray__grid`,role:`tabpanel`},H=[`aria-label`,`onClick`],U={class:`sticker-tray__emoji`,"aria-hidden":`true`},W={class:`sticker-tray__label`},G=g(u({__name:`StickerTray`,props:{modelValue:{type:Boolean}},emits:[`update:modelValue`,`pick`],setup(e){let r=n(`seasonal`),s=m(()=>R.filter(e=>e.category===r.value));return(n,l)=>(o(),d(E,{"model-value":e.modelValue,label:`Add sticker`,"onUpdate:modelValue":l[0]||=e=>n.$emit(`update:modelValue`,e)},{default:b(()=>[p(`div`,z,[p(`div`,B,[(o(!0),y(h,null,c(t(L),e=>(o(),y(`button`,{key:e.id,type:`button`,role:`tab`,class:a([`sticker-tray__cat`,{"sticker-tray__cat--active":r.value===e.id}]),onClick:t=>r.value=e.id},i(e.label),11,V))),128))]),p(`div`,re,[(o(!0),y(h,null,c(s.value,e=>(o(),y(`button`,{key:e.id,type:`button`,class:`sticker-tray__item`,"aria-label":e.label,onClick:t=>n.$emit(`pick`,e.id)},[p(`span`,U,i(e.emoji),1),p(`span`,W,i(e.label),1)],8,H))),128))])])]),_:1},8,[`model-value`]))}}),[[`__scopeId`,`data-v-7eada75b`]]),K={class:`sticker-canvas__bar`},q=52,J=g(u({__name:`StickerCanvas`,props:{croppedUrl:{},orientation:{},stickers:{}},emits:[`add-sticker`,`update-sticker`,`remove-sticker`,`done`],setup(t,{emit:i}){let a=t,u=i,g=n(),x=n(),S=n(),C=n(),w=n(!1),T=n(null),E=n(375),D=n(225),O=a.orientation===`landscape`?1600/960:960/1600;function k(){if(!g.value)return;let{width:e,height:t}=g.value.getBoundingClientRect(),n=t-72;e/n>O?(D.value=n,E.value=n*O):(E.value=e,D.value=e/O),M()}let A=new ResizeObserver(k);ee(()=>{g.value&&A.observe(g.value),k(),Q()}),s(()=>{A.disconnect(),ie()});let j=n(null);function M(){let e=new Image;e.onload=()=>{j.value=e},e.src=a.croppedUrl}l(()=>a.croppedUrl,()=>M(),{immediate:!0});let N=m(()=>({width:E.value,height:D.value})),P=m(()=>({image:j.value,x:0,y:0,width:E.value,height:D.value})),F={enabledAnchors:[`top-left`,`top-right`,`bottom-left`,`bottom-right`],rotateEnabled:!0,borderStroke:`rgba(255,255,255,0.8)`,anchorFill:`#fff`,anchorSize:18,keepRatio:!0,boundBoxFunc:(e,t)=>t};function ne(e){return{id:e.id,text:I(e.type),fontSize:q,fontFamily:`"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif`,x:e.x,y:e.y,scaleX:e.scale,scaleY:e.scale,rotation:e.rotation,draggable:!0,offsetX:q/2,offsetY:q/2}}function I(e){return R.find(t=>t.id===e)?.emoji??`⭐`}function L(t,n){n.cancelBubble=!0,T.value=t,e(()=>{let e=(C.value?.getNode())?.findOne(`#${t}`),n=S.value?.getNode();e&&n&&n.nodes([e])})}function z(e){e.target===e.target.getStage()&&(T.value=null,S.value?.getNode()?.nodes([]))}function B(){T.value&&(u(`remove-sticker`,T.value),T.value=null,S.value?.getNode()?.nodes([]))}function V(e,t){u(`update-sticker`,e,{x:t.target.x(),y:t.target.y()})}function re(e,t){u(`update-sticker`,e,{x:t.target.x(),y:t.target.y(),scale:t.target.scaleX(),rotation:t.target.rotation()})}function H(t){let n={id:`${t}-${Date.now()}`,type:t,x:E.value/2,y:D.value/2,scale:1,rotation:0};u(`add-sticker`,n),w.value=!1,e(()=>L(n.id,{cancelBubble:!1}))}let U=0,W=1;function J(e){let t=e[0].clientX-e[1].clientX,n=e[0].clientY-e[1].clientY;return Math.hypot(t,n)}function Y(e){e.touches.length!==2||!T.value||(U=J(e.touches),W=a.stickers.find(e=>e.id===T.value)?.scale??1)}function X(e){if(e.touches.length!==2||!T.value||U===0)return;e.preventDefault();let t=Math.max(.2,Math.min(6,W*(J(e.touches)/U)));u(`update-sticker`,T.value,{scale:t})}function Z(){U=0,W=1}function Q(){let e=g.value;e&&(e.addEventListener(`touchstart`,Y,{passive:!0}),e.addEventListener(`touchmove`,X,{passive:!1}),e.addEventListener(`touchend`,Z,{passive:!0}))}function ie(){let e=g.value;e&&(e.removeEventListener(`touchstart`,Y),e.removeEventListener(`touchmove`,X),e.removeEventListener(`touchend`,Z))}async function $(){T.value=null,S.value?.getNode()?.nodes([]),await e();let t=x.value?.getNode();if(!t)return;let n=(a.orientation===`landscape`?1600:960)/E.value,r=await t.toBlob({pixelRatio:n,mimeType:`image/jpeg`,quality:.92});r&&u(`done`,r)}return(e,n)=>{let i=r(`v-image`),a=r(`v-layer`),s=r(`v-text`),l=r(`v-transformer`),u=r(`v-stage`);return o(),y(`div`,{class:`sticker-canvas`,ref_key:`containerRef`,ref:g},[v(u,{ref_key:`stageRef`,ref:x,config:N.value,onClick:z,onTap:z},{default:b(()=>[v(a,null,{default:b(()=>[v(i,{config:P.value},null,8,[`config`])]),_:1}),v(a,{ref_key:`stickerLayerRef`,ref:C},{default:b(()=>[(o(!0),y(h,null,c(t.stickers,e=>(o(),d(s,{key:e.id,config:ne(e),onClick:t=>L(e.id,t),onTap:t=>L(e.id,t),onDragend:t=>V(e.id,t),onTransformend:t=>re(e.id,t)},null,8,[`config`,`onClick`,`onTap`,`onDragend`,`onTransformend`]))),128)),v(l,{ref_key:`transformerRef`,ref:S,config:F},null,512)]),_:1},512)]),_:1},8,[`config`]),T.value?(o(),y(`button`,{key:0,class:`sticker-canvas__delete`,type:`button`,"aria-label":`Remove sticker`,onClick:B},[...n[2]||=[p(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"aria-hidden":`true`},[p(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),p(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]])):_(``,!0),p(`div`,K,[p(`button`,{class:`sticker-canvas__add-btn`,type:`button`,onClick:n[0]||=e=>w.value=!0},[...n[3]||=[p(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"aria-hidden":`true`},[p(`circle`,{cx:`12`,cy:`12`,r:`10`}),p(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`16`}),p(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`})],-1),f(` Add sticker `,-1)]]),v(te,{variant:`primary`,class:`sticker-canvas__next-btn`,onClick:$},{default:b(()=>[...n[4]||=[f(`Next`,-1)]]),_:1})]),v(G,{modelValue:w.value,"onUpdate:modelValue":n[1]||=e=>w.value=e,onPick:H},null,8,[`modelValue`])],512)}}}),[[`__scopeId`,`data-v-fb52db70`]]),Y={class:`upload-view`},X={class:`upload-view__header`},Z=[`aria-label`],Q={key:0,width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"aria-hidden":`true`},ie={key:1,width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"aria-hidden":`true`},$={class:`upload-view__step-label`},ae={key:2,class:`upload-view__done`},oe={class:`upload-view__done-title`},se=g(u({__name:`UploadView`,setup(e){let r=C(),a=T(),s=w(),c=x(),l=S(),u=n(`crop`),h=n(!1),g=n(!1),E=null,O=m(()=>a.editingImageId!==null);ee(async()=>{if(await s.fetchDevices(),!a.originalFile){r.replace(`/`);return}u.value=`crop`});let k=m(()=>a.contextDeviceId?s.devices.find(e=>e.id===a.contextDeviceId):s.devices[0]),A=m(()=>k.value?.orientation??`landscape`),j=m(()=>a.cropOrientation??A.value),M=m(()=>k.value?.name),N=m(()=>u.value===`crop`?O.value?`Edit crop`:`Crop photo`:u.value===`stickers`?`Add stickers`:O.value?`Updated`:`Added`);function P({blob:e,params:t,orientation:n}){a.setCrop(e,t,n),u.value=`stickers`}function F(){a.croppedBlob&&(E=a.croppedBlob,O.value?R():g.value=!0)}function ne(e){E=e,O.value?R():g.value=!0}function L(){if(u.value===`crop`){a.cleanup(),r.replace(`/library`);return}u.value===`stickers`&&(u.value=`crop`)}async function R(){if(E){h.value=!0;try{let e=new File([E],`photo.jpg`,{type:`image/jpeg`});if(O.value){await c.reprocessImage(a.editingImageId,e,{cropParams:a.cropParams??void 0,stickerState:a.stickers,cropOrientation:a.cropOrientation??void 0}),g.value=!1,u.value=`done`;return}let t=await c.uploadImage(e,{original:a.originalFile??void 0,cropParams:a.cropParams??void 0,stickerState:a.stickers,cropOrientation:a.cropOrientation??void 0});await Promise.all(a.selectedDeviceIds.map(e=>c.setApproval(t.id,e,!0))),g.value=!1,u.value=`done`}catch(e){l.show(e instanceof Error?e.message:`Upload failed`,`error`)}finally{h.value=!1}}}function z(){a.cleanup(),r.replace(`/library`)}return(e,n)=>(o(),y(`div`,Y,[p(`header`,X,[u.value===`done`?_(``,!0):(o(),y(`button`,{key:0,class:`upload-view__back`,type:`button`,"aria-label":u.value===`crop`?`Cancel`:`Back`,onClick:L},[u.value===`crop`?(o(),y(`svg`,Q,[...n[2]||=[p(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`},null,-1),p(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`},null,-1)]])):(o(),y(`svg`,ie,[...n[3]||=[p(`polyline`,{points:`15 18 9 12 15 6`},null,-1)]]))],8,Z)),p(`span`,$,i(N.value),1),u.value===`stickers`?(o(),y(`button`,{key:1,class:`upload-view__skip`,type:`button`,onClick:F},`Skip`)):_(``,!0)]),u.value===`crop`&&t(a).originalUrl?(o(),d(I,{key:0,src:t(a).originalUrl,orientation:A.value,"device-name":M.value,"initial-params":t(a).cropParams,"initial-orientation":t(a).cropOrientation,class:`upload-view__stage`,onCrop:P},null,8,[`src`,`orientation`,`device-name`,`initial-params`,`initial-orientation`])):u.value===`stickers`&&t(a).croppedUrl?(o(),d(J,{key:1,"cropped-url":t(a).croppedUrl,orientation:j.value,stickers:t(a).stickers,class:`upload-view__stage`,onAddSticker:t(a).addSticker,onUpdateSticker:t(a).updateSticker,onRemoveSticker:t(a).removeSticker,onDone:ne},null,8,[`cropped-url`,`orientation`,`stickers`,`onAddSticker`,`onUpdateSticker`,`onRemoveSticker`])):u.value===`done`?(o(),y(`div`,ae,[n[5]||=p(`div`,{class:`upload-view__done-icon`,"aria-hidden":`true`},`🎉`,-1),p(`p`,oe,i(O.value?`Photo updated!`:`Photo added!`),1),n[6]||=p(`p`,{class:`upload-view__done-sub`},`It'll appear on your frame at the next update.`,-1),v(te,{variant:`primary`,class:`upload-view__done-btn`,onClick:z},{default:b(()=>[...n[4]||=[f(`Done`,-1)]]),_:1})])):_(``,!0),O.value?_(``,!0):(o(),d(D,{key:3,modelValue:g.value,"onUpdate:modelValue":n[0]||=e=>g.value=e,devices:t(s).devices,selected:t(a).selectedDeviceIds,uploading:h.value,"onUpdate:selected":n[1]||=e=>t(a).selectedDeviceIds=e,onConfirm:R},null,8,[`modelValue`,`devices`,`selected`,`uploading`]))]))}}),[[`__scopeId`,`data-v-af5b9c38`]]);export{se as default}; \ No newline at end of file diff --git a/public/build/assets/UploadView-CnlRrn7b.css b/public/build/assets/UploadView-CnlRrn7b.css new file mode 100644 index 0000000..feb55fc --- /dev/null +++ b/public/build/assets/UploadView-CnlRrn7b.css @@ -0,0 +1 @@ +.crop-editor[data-v-9ad25e6f]{touch-action:none;background:#000;flex-direction:column;flex:1;min-height:0;display:flex;position:relative}.crop-editor__canvas[data-v-9ad25e6f]{touch-action:none;cursor:grab;flex:1;min-height:0;display:block}.crop-editor__canvas[data-v-9ad25e6f]:active{cursor:grabbing}.crop-editor__top[data-v-9ad25e6f]{pointer-events:none;flex-direction:column;align-items:center;gap:8px;display:flex;position:absolute;top:12px;left:12px;right:12px}.crop-editor__label[data-v-9ad25e6f]{color:#fff;font-size:var(--text-xs);letter-spacing:.04em;background:#0009;border-radius:999px;padding:4px 12px;font-weight:700}.crop-editor__orient[data-v-9ad25e6f]{pointer-events:auto;background:#0009;border-radius:999px;gap:4px;padding:4px;display:flex}.crop-editor__orient-btn[data-v-9ad25e6f]{color:#ffffffa6;cursor:pointer;width:36px;height:32px;transition:background var(--duration-fast), color var(--duration-fast);background:0 0;border:none;border-radius:999px;justify-content:center;align-items:center;display:flex}.crop-editor__orient-btn--active[data-v-9ad25e6f]{color:#000;background:#fff}.crop-editor__mismatch[data-v-9ad25e6f]{pointer-events:auto;background:var(--color-warning,#f59e0b);color:#fff;font-size:var(--text-xs);border-radius:999px;align-items:center;gap:6px;max-width:100%;padding:6px 12px;font-weight:600;line-height:1.3;display:flex}.crop-editor__mismatch svg[data-v-9ad25e6f]{flex-shrink:0}.crop-editor__actions[data-v-9ad25e6f]{padding:var(--space-4);justify-content:center;display:flex;position:absolute;bottom:0;left:0;right:0}.crop-editor__use-btn[data-v-9ad25e6f]{width:100%;max-width:320px}.sticker-tray__section[data-v-9a64b78a]{margin-bottom:var(--space-4)}.sticker-tray__section[data-v-9a64b78a]:last-child{margin-bottom:0}.sticker-tray__heading[data-v-9a64b78a]{font-size:var(--text-xs);text-transform:uppercase;letter-spacing:.06em;color:var(--color-text-muted);margin:0 0 var(--space-2);font-weight:700}.sticker-tray__hint[data-v-9a64b78a]{font-size:var(--text-xs);color:var(--color-text-muted);margin:0 0 var(--space-2);line-height:1.4}.sticker-tray__row[data-v-9a64b78a]{gap:var(--space-2);flex-wrap:wrap;display:flex}.sticker-tray__chip[data-v-9a64b78a]{border:1.5px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-surface);cursor:pointer;width:56px;height:56px;transition:background var(--duration-fast), border-color var(--duration-fast);justify-content:center;align-items:center;display:flex}.sticker-tray__chip[data-v-9a64b78a]:active{background:var(--color-surface-2);border-color:var(--color-primary)}.sticker-tray__emoji[data-v-9a64b78a]{font-family:Apple Color Emoji,Segoe UI Emoji,Noto Color Emoji,sans-serif;font-size:32px;line-height:1}.sticker-tray__img[data-v-9a64b78a]{object-fit:contain;pointer-events:none;width:40px;height:40px}.sticker-tray__emoji-input[data-v-9a64b78a]{width:100%;min-height:var(--touch-min);padding:0 var(--space-3);border:1.5px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-surface);color:var(--color-text);font-family:inherit;font-size:18px}.sticker-tray__emoji-input[data-v-9a64b78a]:focus{outline:2px solid var(--color-primary);outline-offset:2px;border-color:var(--color-primary)}.sticker-canvas[data-v-0487769c]{background:#111;flex-direction:column;flex:1;align-items:center;min-height:0;display:flex;position:relative;overflow:hidden}.sticker-canvas[data-v-0487769c] .konvajs-content{flex-shrink:0}.sticker-canvas__delete-handle[data-v-0487769c]{cursor:pointer;color:#fff;z-index:10;touch-action:none;background:#c81e1ef2;border:2px solid #fff;border-radius:50%;justify-content:center;align-items:center;width:28px;height:28px;margin:0;padding:0;display:flex;position:absolute;transform:translate(-50%,-50%);box-shadow:0 2px 6px #0006}.sticker-canvas__bar[data-v-0487769c]{align-items:center;gap:var(--space-3);height:72px;padding:0 var(--space-4);background:var(--color-surface);border-top:1px solid var(--color-border);display:flex;position:absolute;bottom:0;left:0;right:0}.sticker-canvas__add-btn[data-v-0487769c]{align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-4);border-radius:var(--radius-md);border:1.5px solid var(--color-border);color:var(--color-text);font-size:var(--text-sm);cursor:pointer;white-space:nowrap;background:0 0;font-weight:600;display:flex}.sticker-canvas__next-btn[data-v-0487769c]{min-width:96px;margin-left:auto}.upload-view[data-v-af5b9c38]{z-index:100;background:var(--color-bg);padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);flex-direction:column;display:flex;position:fixed;inset:0}.upload-view__header[data-v-af5b9c38]{height:56px;padding:0 var(--space-4);background:var(--color-surface);border-bottom:1px solid var(--color-border);flex-shrink:0;align-items:center;display:flex;position:relative}.upload-view__back[data-v-af5b9c38]{cursor:pointer;width:40px;height:40px;color:var(--color-text);background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;margin-left:-8px;display:flex}.upload-view__step-label[data-v-af5b9c38]{font-size:var(--text-base);color:var(--color-text);font-weight:700;position:absolute;left:50%;transform:translate(-50%)}.upload-view__skip[data-v-af5b9c38]{font-size:var(--text-sm);color:var(--color-text-muted);cursor:pointer;padding:var(--space-2) 0;background:0 0;border:none;margin-left:auto;font-weight:600}.upload-view__stage[data-v-af5b9c38]{flex:1;min-height:0}.upload-view__done[data-v-af5b9c38]{justify-content:center;align-items:center;gap:var(--space-4);padding:var(--space-6) var(--space-5);text-align:center;flex-direction:column;flex:1;display:flex}.upload-view__done-icon[data-v-af5b9c38]{font-family:Apple Color Emoji,Segoe UI Emoji,Noto Color Emoji,sans-serif;font-size:64px;line-height:1}.upload-view__done-title[data-v-af5b9c38]{font-size:var(--text-xl);font-weight:700}.upload-view__done-sub[data-v-af5b9c38]{font-size:var(--text-sm);color:var(--color-text-muted);max-width:260px;line-height:1.5}.upload-view__done-btn[data-v-af5b9c38]{width:100%;max-width:320px} diff --git a/public/build/assets/_plugin-vue_export-helper-eepT72yB.js b/public/build/assets/_plugin-vue_export-helper-BNDVmFr7.js similarity index 68% rename from public/build/assets/_plugin-vue_export-helper-eepT72yB.js rename to public/build/assets/_plugin-vue_export-helper-BNDVmFr7.js index 35944df..11045fa 100644 --- a/public/build/assets/_plugin-vue_export-helper-eepT72yB.js +++ b/public/build/assets/_plugin-vue_export-helper-BNDVmFr7.js @@ -1 +1 @@ -function e(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var t={},n=[],r=()=>{},i=()=>!1,a=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),o=e=>e.startsWith(`onUpdate:`),s=Object.assign,c=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},l=Object.prototype.hasOwnProperty,u=(e,t)=>l.call(e,t),d=Array.isArray,f=e=>x(e)===`[object Map]`,p=e=>x(e)===`[object Set]`,m=e=>x(e)===`[object Date]`,h=e=>typeof e==`function`,g=e=>typeof e==`string`,_=e=>typeof e==`symbol`,v=e=>typeof e==`object`&&!!e,y=e=>(v(e)||h(e))&&h(e.then)&&h(e.catch),b=Object.prototype.toString,x=e=>b.call(e),S=e=>x(e).slice(8,-1),C=e=>x(e)===`[object Object]`,w=e=>g(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,T=e(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ee=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},te=/-\w/g,E=ee(e=>e.replace(te,e=>e.slice(1).toUpperCase())),ne=/\B([A-Z])/g,D=ee(e=>e.replace(ne,`-$1`).toLowerCase()),re=ee(e=>e.charAt(0).toUpperCase()+e.slice(1)),ie=ee(e=>e?`on${re(e)}`:``),O=(e,t)=>!Object.is(e,t),ae=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},oe=e=>{let t=parseFloat(e);return isNaN(t)?e:t},se=e=>{let t=g(e)?Number(e):NaN;return isNaN(t)?e:t},ce,le=()=>ce||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function ue(e){if(d(e)){let t={};for(let n=0;n{if(e){let n=e.split(fe);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function he(e){let t=``;if(g(e))t=e;else if(d(e))for(let n=0;nbe(e,t))}var Se=e=>!!(e&&e.__v_isRef===!0),Ce=e=>g(e)?e:e==null?``:d(e)||v(e)&&(e.toString===b||!h(e.toString))?Se(e)?Ce(e.value):JSON.stringify(e,we,2):String(e),we=(e,t)=>Se(t)?we(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Te(t,r)+` =>`]=n,e),{})}:p(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Te(e))}:_(t)?Te(t):v(t)&&!d(t)&&!C(t)?String(t):t,Te=(e,t=``)=>_(e)?`Symbol(${e.description??t})`:e,A,Ee=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=A,!e&&A&&(this.index=(A.scopes||=[]).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e0&&--this._on===0){if(A===this)A=this.prevScope;else{let e=A;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t0)return;if(Pe){let e=Pe;for(Pe=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Ne;){let t=Ne;for(Ne=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function Re(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ze(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),He(r),Ue(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function Be(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ve(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ve(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Je)||(e.globalVersion=Je,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Be(e))))return;e.flags|=2;let t=e.dep,n=j,r=M;j=e,M=!0;try{Re(e);let n=e.fn(e._value);(t.version===0||O(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{j=n,M=r,ze(e),e.flags&=-3}}function He(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)He(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Ue(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var M=!0,We=[];function Ge(){We.push(M),M=!1}function Ke(){let e=We.pop();M=e===void 0?!0:e}function qe(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=j;j=void 0;try{t()}finally{j=e}}}var Je=0,Ye=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Xe=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!j||!M||j===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==j)t=this.activeLink=new Ye(j,this),j.deps?(t.prevDep=j.depsTail,j.depsTail.nextDep=t,j.depsTail=t):j.deps=j.depsTail=t,Ze(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=j.depsTail,t.nextDep=void 0,j.depsTail.nextDep=t,j.depsTail=t,j.deps===t&&(j.deps=e)}return t}trigger(e){this.version++,Je++,this.notify(e)}notify(e){Ie();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Le()}}};function Ze(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)Ze(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var Qe=new WeakMap,$e=Symbol(``),et=Symbol(``),tt=Symbol(``);function N(e,t,n){if(M&&j){let t=Qe.get(e);t||Qe.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new Xe),r.map=t,r.key=n),r.track()}}function nt(e,t,n,r,i,a){let o=Qe.get(e);if(!o){Je++;return}let s=e=>{e&&e.trigger()};if(Ie(),t===`clear`)o.forEach(s);else{let i=d(e),a=i&&w(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===tt||!_(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(tt)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get($e)),f(e)&&s(o.get(et)));break;case`delete`:i||(s(o.get($e)),f(e)&&s(o.get(et)));break;case`set`:f(e)&&s(o.get($e));break}}Le()}function rt(e,t){let n=Qe.get(e);return n&&n.get(t)}function it(e){let t=I(e);return t===e?t:(N(t,`iterate`,tt),F(e)?t:t.map(L))}function at(e){return N(e=I(e),`iterate`,tt),e}function P(e,t){return Ht(e)?Gt(Vt(e)?L(t):t):L(t)}var ot={__proto__:null,[Symbol.iterator](){return st(this,Symbol.iterator,e=>P(this,e))},concat(...e){return it(this).concat(...e.map(e=>d(e)?it(e):e))},entries(){return st(this,`entries`,e=>(e[1]=P(this,e[1]),e))},every(e,t){return lt(this,`every`,e,t,void 0,arguments)},filter(e,t){return lt(this,`filter`,e,t,e=>e.map(e=>P(this,e)),arguments)},find(e,t){return lt(this,`find`,e,t,e=>P(this,e),arguments)},findIndex(e,t){return lt(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return lt(this,`findLast`,e,t,e=>P(this,e),arguments)},findLastIndex(e,t){return lt(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return lt(this,`forEach`,e,t,void 0,arguments)},includes(...e){return dt(this,`includes`,e)},indexOf(...e){return dt(this,`indexOf`,e)},join(e){return it(this).join(e)},lastIndexOf(...e){return dt(this,`lastIndexOf`,e)},map(e,t){return lt(this,`map`,e,t,void 0,arguments)},pop(){return ft(this,`pop`)},push(...e){return ft(this,`push`,e)},reduce(e,...t){return ut(this,`reduce`,e,t)},reduceRight(e,...t){return ut(this,`reduceRight`,e,t)},shift(){return ft(this,`shift`)},some(e,t){return lt(this,`some`,e,t,void 0,arguments)},splice(...e){return ft(this,`splice`,e)},toReversed(){return it(this).toReversed()},toSorted(e){return it(this).toSorted(e)},toSpliced(...e){return it(this).toSpliced(...e)},unshift(...e){return ft(this,`unshift`,e)},values(){return st(this,`values`,e=>P(this,e))}};function st(e,t,n){let r=at(e),i=r[t]();return r!==e&&!F(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var ct=Array.prototype;function lt(e,t,n,r,i,a){let o=at(e),s=o!==e&&!F(e),c=o[t];if(c!==ct[t]){let t=c.apply(e,a);return s?L(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,P(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function ut(e,t,n,r){let i=at(e),a=i!==e&&!F(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=P(e,t)),n.call(this,t,P(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?P(e,c):c}function dt(e,t,n){let r=I(e);N(r,`iterate`,tt);let i=r[t](...n);return(i===-1||i===!1)&&Ut(n[0])?(n[0]=I(n[0]),r[t](...n)):i}function ft(e,t,n=[]){Ge(),Ie();let r=I(e)[t].apply(e,n);return Le(),Ke(),r}var pt=e(`__proto__,__v_isRef,__isVue`),mt=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(_));function ht(e){_(e)||(e=String(e));let t=I(this);return N(t,`has`,e),t.hasOwnProperty(e)}var gt=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?Pt:Nt:i?Mt:jt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=d(e);if(!r){let e;if(a&&(e=ot[t]))return e;if(t===`hasOwnProperty`)return ht}let o=Reflect.get(e,t,R(e)?e:n);if((_(t)?mt.has(t):pt(t))||(r||N(e,`get`,t),i))return o;if(R(o)){let e=a&&w(t)?o:o.value;return r&&v(e)?zt(e):e}return v(o)?r?zt(o):Lt(o):o}},_t=class extends gt{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=d(e)&&w(t);if(!this._isShallow){let e=Ht(i);if(!F(n)&&!Ht(n)&&(i=I(i),n=I(n)),!a&&R(i)&&!R(n))return e||(i.value=n),!0}let o=a?Number(t)e,Ct=e=>Reflect.getPrototypeOf(e);function wt(e,t,n){return function(...r){let i=this.__v_raw,a=I(i),o=f(a),c=e===`entries`||e===Symbol.iterator&&o,l=e===`keys`&&o,u=i[e](...r),d=n?St:t?Gt:L;return!t&&N(a,`iterate`,l?et:$e),s(Object.create(u),{next(){let{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:c?[d(e[0]),d(e[1])]:d(e),done:t}}})}}function Tt(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function Et(e,t){let n={get(n){let r=this.__v_raw,i=I(r),a=I(n);e||(O(n,a)&&N(i,`get`,n),N(i,`get`,a));let{has:o}=Ct(i),s=t?St:e?Gt:L;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&N(I(t),`iterate`,$e),t.size},has(t){let n=this.__v_raw,r=I(n),i=I(t);return e||(O(t,i)&&N(r,`has`,t),N(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=I(a),s=t?St:e?Gt:L;return!e&&N(o,`iterate`,$e),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return s(n,e?{add:Tt(`add`),set:Tt(`set`),delete:Tt(`delete`),clear:Tt(`clear`)}:{add(e){let n=I(this),r=Ct(n),i=I(e),a=!t&&!F(e)&&!Ht(e)?i:e;return r.has.call(n,a)||O(e,a)&&r.has.call(n,e)||O(i,a)&&r.has.call(n,i)||(n.add(a),nt(n,`add`,a,a)),this},set(e,n){!t&&!F(n)&&!Ht(n)&&(n=I(n));let r=I(this),{has:i,get:a}=Ct(r),o=i.call(r,e);o||=(e=I(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?O(n,s)&&nt(r,`set`,e,n,s):nt(r,`add`,e,n),this},delete(e){let t=I(this),{has:n,get:r}=Ct(t),i=n.call(t,e);i||=(e=I(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&nt(t,`delete`,e,void 0,a),o},clear(){let e=I(this),t=e.size!==0,n=e.clear();return t&&nt(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=wt(r,e,t)}),n}function Dt(e,t){let n=Et(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(u(n,r)&&r in t?n:t,r,i)}var Ot={get:Dt(!1,!1)},kt={get:Dt(!1,!0)},At={get:Dt(!0,!1)},jt=new WeakMap,Mt=new WeakMap,Nt=new WeakMap,Pt=new WeakMap;function Ft(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function It(e){return e.__v_skip||!Object.isExtensible(e)?0:Ft(S(e))}function Lt(e){return Ht(e)?e:Bt(e,!1,yt,Ot,jt)}function Rt(e){return Bt(e,!1,xt,kt,Mt)}function zt(e){return Bt(e,!0,bt,At,Nt)}function Bt(e,t,n,r,i){if(!v(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;let a=It(e);if(a===0)return e;let o=i.get(e);if(o)return o;let s=new Proxy(e,a===2?r:n);return i.set(e,s),s}function Vt(e){return Ht(e)?Vt(e.__v_raw):!!(e&&e.__v_isReactive)}function Ht(e){return!!(e&&e.__v_isReadonly)}function F(e){return!!(e&&e.__v_isShallow)}function Ut(e){return e?!!e.__v_raw:!1}function I(e){let t=e&&e.__v_raw;return t?I(t):e}function Wt(e){return!u(e,`__v_skip`)&&Object.isExtensible(e)&&k(e,`__v_skip`,!0),e}var L=e=>v(e)?Lt(e):e,Gt=e=>v(e)?zt(e):e;function R(e){return e?e.__v_isRef===!0:!1}function Kt(e){return Jt(e,!1)}function qt(e){return Jt(e,!0)}function Jt(e,t){return R(e)?e:new Yt(e,t)}var Yt=class{constructor(e,t){this.dep=new Xe,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:I(e),this._value=t?e:L(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||F(e)||Ht(e);e=n?e:I(e),O(e,t)&&(this._rawValue=e,this._value=n?e:L(e),this.dep.trigger())}};function Xt(e){return R(e)?e.value:e}var Zt={get:(e,t,n)=>t===`__v_raw`?e:Xt(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return R(i)&&!R(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function Qt(e){return Vt(e)?e:new Proxy(e,Zt)}function $t(e){let t=d(e)?Array(e.length):{};for(let n in e)t[n]=rn(e,n);return t}var en=class{constructor(e,t,n){this._object=e,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0,this._key=_(t)?t:String(t),this._raw=I(e);let r=!0,i=e;if(!d(e)||_(this._key)||!w(this._key))do r=!Ut(i)||F(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=Xt(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&R(this._raw[this._key])){let t=this._object[this._key];if(R(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return rt(this._raw,this._key)}},tn=class{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}};function nn(e,t,n){return R(e)?e:h(e)?new tn(e):v(e)&&arguments.length>1?rn(e,t,n):Kt(e)}function rn(e,t,n){return new en(e,t,n)}var an=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Xe(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Je-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&j!==this)return Fe(this,!0),!0}get value(){let e=this.dep.track();return Ve(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function on(e,t,n=!1){let r,i;return h(e)?r=e:(r=e.get,i=e.set),new an(r,i,n)}var sn={},cn=new WeakMap,ln=void 0;function un(e,t=!1,n=ln){if(n){let t=cn.get(n);t||cn.set(n,t=[]),t.push(e)}}function dn(e,n,i=t){let{immediate:a,deep:o,once:s,scheduler:l,augmentJob:u,call:f}=i,p=e=>o?e:F(e)||o===!1||o===0?fn(e,1):fn(e),m,g,_,v,y=!1,b=!1;if(R(e)?(g=()=>e.value,y=F(e)):Vt(e)?(g=()=>p(e),y=!0):d(e)?(b=!0,y=e.some(e=>Vt(e)||F(e)),g=()=>e.map(e=>{if(R(e))return e.value;if(Vt(e))return p(e);if(h(e))return f?f(e,2):e()})):g=h(e)?n?f?()=>f(e,2):e:()=>{if(_){Ge();try{_()}finally{Ke()}}let t=ln;ln=m;try{return f?f(e,3,[v]):e(v)}finally{ln=t}}:r,n&&o){let e=g,t=o===!0?1/0:o;g=()=>fn(e(),t)}let x=Oe(),S=()=>{m.stop(),x&&x.active&&c(x.effects,m)};if(s&&n){let e=n;n=(...t)=>{e(...t),S()}}let C=b?Array(e.length).fill(sn):sn,w=e=>{if(!(!(m.flags&1)||!m.dirty&&!e))if(n){let e=m.run();if(o||y||(b?e.some((e,t)=>O(e,C[t])):O(e,C))){_&&_();let t=ln;ln=m;try{let t=[e,C===sn?void 0:b&&C[0]===sn?[]:C,v];C=e,f?f(n,3,t):n(...t)}finally{ln=t}}}else m.run()};return u&&u(w),m=new je(g),m.scheduler=l?()=>l(w,!1):w,v=e=>un(e,!1,m),_=m.onStop=()=>{let e=cn.get(m);if(e){if(f)f(e,4);else for(let t of e)t();cn.delete(m)}},n?a?w(!0):C=m.run():l?l(w.bind(null,!0),!0):m.run(),S.pause=m.pause.bind(m),S.resume=m.resume.bind(m),S.stop=S,S}function fn(e,t=1/0,n){if(t<=0||!v(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,R(e))fn(e.value,t,n);else if(d(e))for(let r=0;r{fn(e,t,n)});else if(C(e)){for(let r in e)fn(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&fn(e[r],t,n)}return e}function pn(e,t,n,r){try{return r?e(...r):e()}catch(e){mn(e,t,n)}}function z(e,t,n,r){if(h(e)){let i=pn(e,t,n,r);return i&&y(i)&&i.catch(e=>{mn(e,t,n)}),i}if(d(e)){let i=[];for(let a=0;a>>1,i=B[r],a=On(i);a=On(n)?B.push(e):B.splice(Sn(t),0,e),e.flags|=1,wn()}}function wn(){bn||=yn.then(kn)}function Tn(e){d(e)?gn.push(...e):_n&&e.id===-1?_n.splice(vn+1,0,e):e.flags&1||(gn.push(e),e.flags|=1),wn()}function En(e,t,n=V+1){for(;nOn(e)-On(t));if(gn.length=0,_n){_n.push(...e);return}for(_n=e,vn=0;vn<_n.length;vn++){let e=_n[vn];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}_n=null,vn=0}}var On=e=>e.id==null?e.flags&2?-1:1/0:e.id;function kn(e){try{for(V=0;V{r._d&&pa(-1);let i=jn(t),a;try{a=e(...n)}finally{jn(i),r._d&&pa(1)}return a};return r._n=!0,r._c=!0,r._d=!0,r}function Nn(e,n){if(H===null)return e;let r=Ja(H),i=e.dirs||=[];for(let e=0;e1)return n&&h(t)?t.call(r&&r.proxy):t}}function Ln(){return!!(Na()||vi)}var Rn=Symbol.for(`v-scx`),zn=()=>In(Rn);function Bn(e,t,n){return Vn(e,t,n)}function Vn(e,n,i=t){let{immediate:a,deep:o,flush:c,once:l}=i,u=s({},i),d=n&&a||!n&&c!==`post`,f;if(za){if(c===`sync`){let e=zn();f=e.__watcherHandles||=[]}else if(!d){let e=()=>{};return e.stop=r,e.resume=r,e.pause=r,e}}let p=$;u.call=(e,t,n)=>z(e,p,t,n);let m=!1;c===`post`?u.scheduler=e=>{K(e,p&&p.suspense)}:c!==`sync`&&(m=!0,u.scheduler=(e,t)=>{t?e():Cn(e)}),u.augmentJob=e=>{n&&(e.flags|=4),m&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};let h=dn(e,n,u);return za&&(f?f.push(h):d&&h()),h}function Hn(e,t,n){let r=this.proxy,i=g(e)?e.includes(`.`)?Un(r,e):()=>r[e]:e.bind(r,r),a;h(t)?a=t:(a=t.handler,n=t);let o=Ia(this),s=Vn(i,a.bind(r),n);return o(),s}function Un(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;ee.__isTeleport,qn=e=>e&&(e.disabled||e.disabled===``),Jn=e=>e&&(e.defer||e.defer===``),Yn=e=>typeof SVGElement<`u`&&e instanceof SVGElement,Xn=e=>typeof MathMLElement==`function`&&e instanceof MathMLElement,Zn=(e,t)=>{let n=e&&e.to;return g(n)?t?t(n):null:n},Qn={name:`Teleport`,__isTeleport:!0,process(e,t,n,r,i,a,o,s,c,l){let{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:m,createText:h,createComment:g,parentNode:_}}=l,v=qn(t.props),{dynamicChildren:y}=t,b=(e,t,n)=>{e.shapeFlag&16&&u(e.children,t,n,i,a,o,s,c)},x=(e=t)=>{let n=qn(e.props),r=e.target=Zn(e.props,m),a=rr(r,e,h,p);r&&(o!==`svg`&&Yn(r)?o=`svg`:o!==`mathml`&&Xn(r)&&(o=`mathml`),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(r),n||(b(e,r,a),nr(e,!1)))},S=e=>{let t=()=>{Wn.get(e)===t&&(Wn.delete(e),qn(e.props)&&(b(e,_(e.el)||n,e.anchor),nr(e,!0)),x(e))};Wn.set(e,t),K(t,a)};if(e==null){let e=t.el=h(``),i=t.anchor=h(``);if(p(e,n,r),p(i,n,r),Jn(t.props)||a&&a.pendingBranch){S(t);return}v&&(b(t,n,i),nr(t,!0)),x()}else{t.el=e.el;let r=t.anchor=e.anchor,u=Wn.get(e);if(u){u.flags|=8,Wn.delete(e),S(t);return}t.targetStart=e.targetStart;let p=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=qn(e.props),_=g?n:p,b=g?r:h;if(o===`svg`||Yn(p)?o=`svg`:(o===`mathml`||Xn(p))&&(o=`mathml`),y?(f(e.dynamicChildren,y,_,i,a,o,s),ea(e,t,!0)):c||d(e,t,_,b,i,a,o,s,!1),v)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):$n(t,n,r,l,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=t.target=Zn(t.props,m);e&&$n(t,e,null,l,0)}else g&&$n(t,p,h,l,1);nr(t,v)}},remove(e,t,n,{um:r,o:{remove:i}},a){let{shapeFlag:o,children:s,anchor:c,targetStart:l,targetAnchor:u,target:d,props:f}=e,p=a||!qn(f),m=Wn.get(e);if(m&&(m.flags|=8,Wn.delete(e),p=!1),d&&(i(l),i(u)),a&&i(c),o&16)for(let e=0;e{e.isMounted=!0}),Fr(()=>{e.isUnmounting=!0}),e}var W=[Function,Array],or={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:W,onEnter:W,onAfterEnter:W,onEnterCancelled:W,onBeforeLeave:W,onLeave:W,onAfterLeave:W,onLeaveCancelled:W,onBeforeAppear:W,onAppear:W,onAfterAppear:W,onAppearCancelled:W},sr=e=>{let t=e.subTree;return t.component?sr(t.component):t},cr={name:`BaseTransition`,props:or,setup(e,{slots:t}){let n=Na(),r=ar();return()=>{let i=t.default&&gr(t.default(),!0),a=i&&i.length?lr(i):n.subTree?Ea():void 0;if(!a)return;let o=I(e),{mode:s}=o;if(r.isLeaving)return pr(a);let c=mr(a);if(!c)return pr(a);let l=fr(c,o,r,n,e=>l=e);c.type!==J&&hr(c,l);let u=n.subTree&&mr(n.subTree);if(u&&u.type!==J&&!va(u,c)&&sr(n).type!==J){let e=fr(u,o,r,n);if(hr(u,e),s===`out-in`&&c.type!==J)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete e.afterLeave,u=void 0},pr(a);s===`in-out`&&c.type!==J?e.delayLeave=(e,t,n)=>{let i=dr(r,u);i[String(u.key)]=u,e[U]=()=>{t(),e[U]=void 0,delete l.delayedLeave,u=void 0},l.delayedLeave=()=>{n(),delete l.delayedLeave,u=void 0}}:u=void 0}else u&&=void 0;return a}}};function lr(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==J){t=n;break}}return t}var ur=cr;function dr(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function fr(e,t,n,r,i){let{appear:a,mode:o,persisted:s=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:p,onLeave:m,onAfterLeave:h,onLeaveCancelled:g,onBeforeAppear:_,onAppear:v,onAfterAppear:y,onAppearCancelled:b}=t,x=String(e.key),S=dr(n,e),C=(e,t)=>{e&&z(e,r,9,t)},w=(e,t)=>{let n=t[1];C(e,t),d(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},T={mode:o,persisted:s,beforeEnter(t){let r=c;if(!n.isMounted)if(a)r=_||c;else return;t[U]&&t[U](!0);let i=S[x];i&&va(e,i)&&i.el[U]&&i.el[U](),C(r,[t])},enter(t){if(S[x]===e)return;let r=l,i=u,o=f;if(!n.isMounted)if(a)r=v||l,i=y||u,o=b||f;else return;let s=!1;t[ir]=e=>{s||(s=!0,C(e?o:i,[t]),T.delayedLeave&&T.delayedLeave(),t[ir]=void 0)};let c=t[ir].bind(null,!1);r?w(r,[t,c]):c()},leave(t,r){let i=String(e.key);if(t[ir]&&t[ir](!0),n.isUnmounting)return r();C(p,[t]);let a=!1;t[U]=n=>{a||(a=!0,r(),C(n?g:h,[t]),t[U]=void 0,S[i]===e&&delete S[i])};let o=t[U].bind(null,!1);S[i]=e,m?w(m,[t,o]):o()},clone(e){let a=fr(e,t,n,r,i);return i&&i(a),a}};return T}function pr(e){if(wr(e))return e=wa(e),e.children=null,e}function mr(e){if(!wr(e))return Kn(e.type)&&e.children?lr(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&h(n.default))return n.default()}}function hr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,hr(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function gr(e,t=!1,n){let r=[],i=0;for(let a=0;a1)for(let e=0;exr(e,n&&(d(n)?n[t]:n),r,a,o));return}if(Cr(a)&&!o){a.shapeFlag&512&&a.type.__asyncResolved&&a.component.subTree.component&&xr(e,n,r,a.component.subTree);return}let s=a.shapeFlag&4?Ja(a.component):a.el,l=o?null:s,{i:f,r:p}=e,m=n&&n.r,_=f.refs===t?f.refs={}:f.refs,v=f.setupState,y=I(v),b=v===t?i:e=>yr(_,e)?!1:u(y,e),x=(e,t)=>!(t&&yr(_,t));if(m!=null&&m!==p){if(Sr(n),g(m))_[m]=null,b(m)&&(v[m]=null);else if(R(m)){let e=n;x(m,e.k)&&(m.value=null),e.k&&(_[e.k]=null)}}if(h(p))pn(p,f,12,[l,_]);else{let t=g(p),n=R(p);if(t||n){let i=()=>{if(e.f){let n=t?b(p)?v[p]:_[p]:x(p)||!e.k?p.value:_[e.k];if(o)d(n)&&c(n,s);else if(d(n))n.includes(s)||n.push(s);else if(t)_[p]=[s],b(p)&&(v[p]=_[p]);else{let t=[s];x(p,e.k)&&(p.value=t),e.k&&(_[e.k]=t)}}else t?(_[p]=l,b(p)&&(v[p]=l)):n&&(x(p,e.k)&&(p.value=l),e.k&&(_[e.k]=l))};if(l){let t=()=>{i(),br.delete(e)};t.id=-1,br.set(e,t),K(t,r)}else Sr(e),i()}}}function Sr(e){let t=br.get(e);t&&(t.flags|=8,br.delete(e))}le().requestIdleCallback,le().cancelIdleCallback;var Cr=e=>!!e.type.__asyncLoader,wr=e=>e.type.__isKeepAlive;function Tr(e,t){Dr(e,`a`,t)}function Er(e,t){Dr(e,`da`,t)}function Dr(e,t,n=$){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(kr(t,r,n),n){let e=n.parent;for(;e&&e.parent;)wr(e.parent.vnode)&&Or(r,t,n,e),e=e.parent}}function Or(e,t,n,r){let i=kr(t,e,r,!0);Ir(()=>{c(r[t],i)},n)}function kr(e,t,n=$,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{Ge();let i=Ia(n),a=z(t,n,e,r);return i(),Ke(),a};return r?i.unshift(a):i.push(a),a}}var Ar=e=>(t,n=$)=>{(!za||e===`sp`)&&kr(e,(...e)=>t(...e),n)},jr=Ar(`bm`),Mr=Ar(`m`),Nr=Ar(`bu`),Pr=Ar(`u`),Fr=Ar(`bum`),Ir=Ar(`um`),Lr=Ar(`sp`),Rr=Ar(`rtg`),zr=Ar(`rtc`);function Br(e,t=$){kr(`ec`,e,t)}var Vr=`components`;function Hr(e,t){return Gr(Vr,e,!0,t)||e}var Ur=Symbol.for(`v-ndc`);function Wr(e){return g(e)?Gr(Vr,e,!1)||e:e||Ur}function Gr(e,t,n=!0,r=!1){let i=H||$;if(i){let n=i.type;if(e===Vr){let e=Ya(n,!1);if(e&&(e===t||e===E(t)||e===re(E(t))))return n}let a=Kr(i[e]||n[e],t)||Kr(i.appContext[e],t);return!a&&r?n:a}}function Kr(e,t){return e&&(e[t]||e[E(t)]||e[re(E(t))])}function qr(e,t,n,r){let i,a=n&&n[r],o=d(e);if(o||g(e)){let n=o&&Vt(e),r=!1,s=!1;n&&(r=!F(e),s=Ht(e),e=at(e)),i=Array(e.length);for(let n=0,o=e.length;nt(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r0;return t!==`default`&&(n.name=t),ua(),ga(q,null,[X(`slot`,n,r&&r())],e?-2:64)}let a=e[t];a&&a._c&&(a._d=!1),ua();let o=a&&Yr(a(n)),s=n.key||o&&o.key,c=ga(q,{key:(s&&!_(s)?s:`_${t}`)+(!o&&r?`_fb`:``)},o||(r?r():[]),o&&e._===1?64:-2);return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),a&&a._c&&(a._d=!0),c}function Yr(e){return e.some(e=>_a(e)?!(e.type===J||e.type===q&&!Yr(e.children)):!0)?e:null}var Xr=e=>e?Ra(e)?Ja(e):Xr(e.parent):null,Zr=s(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Xr(e.parent),$root:e=>Xr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>oi(e),$forceUpdate:e=>e.f||=()=>{Cn(e.update)},$nextTick:e=>e.n||=xn.bind(e.proxy),$watch:e=>Hn.bind(e)}),Qr=(e,n)=>e!==t&&!e.__isScriptSetup&&u(e,n),$r={get({_:e},n){if(n===`__v_skip`)return!0;let{ctx:r,setupState:i,data:a,props:o,accessCache:s,type:c,appContext:l}=e;if(n[0]!==`$`){let e=s[n];if(e!==void 0)switch(e){case 1:return i[n];case 2:return a[n];case 4:return r[n];case 3:return o[n]}else if(Qr(i,n))return s[n]=1,i[n];else if(a!==t&&u(a,n))return s[n]=2,a[n];else if(u(o,n))return s[n]=3,o[n];else if(r!==t&&u(r,n))return s[n]=4,r[n];else ti&&(s[n]=0)}let d=Zr[n],f,p;if(d)return n===`$attrs`&&N(e.attrs,`get`,``),d(e);if((f=c.__cssModules)&&(f=f[n]))return f;if(r!==t&&u(r,n))return s[n]=4,r[n];if(p=l.config.globalProperties,u(p,n))return p[n]},set({_:e},n,r){let{data:i,setupState:a,ctx:o}=e;return Qr(a,n)?(a[n]=r,!0):i!==t&&u(i,n)?(i[n]=r,!0):u(e.props,n)||n[0]===`$`&&n.slice(1)in e?!1:(o[n]=r,!0)},has({_:{data:e,setupState:n,accessCache:r,ctx:i,appContext:a,props:o,type:s}},c){let l;return!!(r[c]||e!==t&&c[0]!==`$`&&u(e,c)||Qr(n,c)||u(o,c)||u(i,c)||u(Zr,c)||u(a.config.globalProperties,c)||(l=s.__cssModules)&&l[c])},defineProperty(e,t,n){return n.get==null?u(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};function ei(e){return d(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}var ti=!0;function ni(e){let t=oi(e),n=e.proxy,i=e.ctx;ti=!1,t.beforeCreate&&ii(t.beforeCreate,e,`bc`);let{data:a,computed:o,methods:s,watch:c,provide:l,inject:u,created:f,beforeMount:p,mounted:m,beforeUpdate:g,updated:_,activated:y,deactivated:b,beforeDestroy:x,beforeUnmount:S,destroyed:C,unmounted:w,render:T,renderTracked:ee,renderTriggered:te,errorCaptured:E,serverPrefetch:ne,expose:D,inheritAttrs:re,components:ie,directives:O,filters:ae}=t;if(u&&ri(u,i,null),s)for(let e in s){let t=s[e];h(t)&&(i[e]=t.bind(n))}if(a){let t=a.call(n,n);v(t)&&(e.data=Lt(t))}if(ti=!0,o)for(let e in o){let t=o[e],a=Za({get:h(t)?t.bind(n,n):h(t.get)?t.get.bind(n,n):r,set:!h(t)&&h(t.set)?t.set.bind(n):r});Object.defineProperty(i,e,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(c)for(let e in c)ai(c[e],i,n,e);if(l){let e=h(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{Fn(t,e[t])})}f&&ii(f,e,`c`);function k(e,t){d(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(k(jr,p),k(Mr,m),k(Nr,g),k(Pr,_),k(Tr,y),k(Er,b),k(Br,E),k(zr,ee),k(Rr,te),k(Fr,S),k(Ir,w),k(Lr,ne),d(D))if(D.length){let t=e.exposed||={};D.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={};T&&e.render===r&&(e.render=T),re!=null&&(e.inheritAttrs=re),ie&&(e.components=ie),O&&(e.directives=O),ne&&vr(e)}function ri(e,t,n=r){d(e)&&(e=di(e));for(let n in e){let r=e[n],i;i=v(r)?`default`in r?In(r.from||n,r.default,!0):In(r.from||n):In(r),R(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function ii(e,t,n){z(d(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function ai(e,t,n,r){let i=r.includes(`.`)?Un(n,r):()=>n[r];if(g(e)){let n=t[e];h(n)&&Bn(i,n)}else if(h(e))Bn(i,e.bind(n));else if(v(e))if(d(e))e.forEach(e=>ai(e,t,n,r));else{let r=h(e.handler)?e.handler.bind(n):t[e.handler];h(r)&&Bn(i,r,e)}}function oi(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>si(c,e,o,!0)),si(c,t,o)),v(t)&&a.set(t,c),c}function si(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&si(e,a,n,!0),i&&i.forEach(t=>si(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=ci[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var ci={data:li,props:pi,emits:pi,methods:fi,computed:fi,beforeCreate:G,created:G,beforeMount:G,mounted:G,beforeUpdate:G,updated:G,beforeDestroy:G,beforeUnmount:G,destroyed:G,unmounted:G,activated:G,deactivated:G,errorCaptured:G,serverPrefetch:G,components:fi,directives:fi,watch:mi,provide:li,inject:ui};function li(e,t){return t?e?function(){return s(h(e)?e.call(this,this):e,h(t)?t.call(this,this):t)}:t:e}function ui(e,t){return fi(di(e),di(t))}function di(e){if(d(e)){let t={};for(let n=0;nt===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${E(t)}Modifiers`]||e[`${D(t)}Modifiers`];function bi(e,n,...r){if(e.isUnmounted)return;let i=e.vnode.props||t,a=r,o=n.startsWith(`update:`),s=o&&yi(i,n.slice(7));s&&(s.trim&&(a=r.map(e=>g(e)?e.trim():e)),s.number&&(a=r.map(oe)));let c,l=i[c=ie(n)]||i[c=ie(E(n))];!l&&o&&(l=i[c=ie(D(n))]),l&&z(l,e,6,a);let u=i[c+`Once`];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,z(u,e,6,a)}}var xi=new WeakMap;function Si(e,t,n=!1){let r=n?xi:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},c=!1;if(!h(e)){let r=e=>{let n=Si(e,t,!0);n&&(c=!0,s(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!c?(v(e)&&r.set(e,null),null):(d(a)?a.forEach(e=>o[e]=null):s(o,a),v(e)&&r.set(e,o),o)}function Ci(e,t){return!e||!a(t)?!1:(t=t.slice(2).replace(/Once$/,``),u(e,t[0].toLowerCase()+t.slice(1))||u(e,D(t))||u(e,t))}function wi(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:s,attrs:c,emit:l,render:u,renderCache:d,props:f,data:p,setupState:m,ctx:h,inheritAttrs:g}=e,_=jn(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=Z(u.call(t,e,d,f,m,p,h)),y=c}else{let e=t;v=Z(e.length>1?e(f,{attrs:c,slots:s,emit:l}):e(f,null)),y=t.props?c:Ti(c)}}catch(t){la.length=0,mn(t,e,1),v=X(J)}let b=v;if(y&&g!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(o)&&(y=Ei(y,a)),b=wa(b,y,!1,!0))}return n.dirs&&(b=wa(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&hr(b,n.transition),v=b,jn(_),v}var Ti=e=>{let t;for(let n in e)(n===`class`||n===`style`||a(n))&&((t||={})[n]=e[n]);return t},Ei=(e,t)=>{let n={};for(let r in e)(!o(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Di(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Oi(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;tObject.create(ji),Ni=e=>Object.getPrototypeOf(e)===ji;function Pi(e,t,n,r=!1){let i={},a=Mi();e.propsDefaults=Object.create(null),Ii(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);n?e.props=r?i:Rt(i):e.type.props?e.props=i:e.props=a,e.attrs=a}function Fi(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=I(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r{p=!0;let[t,n]=zi(e,r,!0);s(l,t),n&&f.push(...n)};!i&&r.mixins.length&&r.mixins.forEach(t),e.extends&&t(e.extends),e.mixins&&e.mixins.forEach(t)}if(!c&&!p)return v(e)&&a.set(e,n),n;if(d(c))for(let e=0;ee===`_`||e===`_ctx`||e===`$stable`,Hi=e=>d(e)?e.map(Z):[Z(e)],Ui=(e,t,n)=>{if(t._n)return t;let r=Mn((...e)=>Hi(t(...e)),n);return r._c=!1,r},Wi=(e,t,n)=>{let r=e._ctx;for(let n in e){if(Vi(n))continue;let i=e[n];if(h(i))t[n]=Ui(n,i,r);else if(i!=null){let e=Hi(i);t[n]=()=>e}}},Gi=(e,t)=>{let n=Hi(t);e.slots.default=()=>n},Ki=(e,t,n)=>{for(let r in t)(n||!Vi(r))&&(e[r]=t[r])},qi=(e,t,n)=>{let r=e.slots=Mi();if(e.vnode.shapeFlag&32){let e=t._;e?(Ki(r,t,n),n&&k(r,`_`,e,!0)):Wi(t,r)}else t&&Gi(e,t)},Ji=(e,n,r)=>{let{vnode:i,slots:a}=e,o=!0,s=t;if(i.shapeFlag&32){let e=n._;e?r&&e===1?o=!1:Ki(a,n,r):(o=!n.$stable,Wi(n,a)),s=n}else n&&(Gi(e,n),s={default:1});if(o)for(let e in a)!Vi(e)&&s[e]==null&&delete a[e]},K=oa;function Yi(e){return Xi(e)}function Xi(e,i){let a=le();a.__VUE__=!0;let{insert:o,remove:s,patchProp:c,createElement:l,createText:u,createComment:d,setText:f,setElementText:p,parentNode:m,nextSibling:h,setScopeId:g=r,insertStaticContent:_}=e,v=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!va(e,t)&&(r=ye(e),me(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case sa:y(e,t,n,r);break;case J:b(e,t,n,r);break;case ca:e??x(t,n,r,o);break;case q:ie(e,t,n,r,i,a,o,s,c);break;default:d&1?w(e,t,n,r,i,a,o,s,c):d&6?O(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,Se)}u!=null&&i?xr(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&xr(e.ref,null,a,e,!0)},y=(e,t,n,r)=>{if(e==null)o(t.el=u(t.children),n,r);else{let n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},b=(e,t,n,r)=>{e==null?o(t.el=d(t.children||``),n,r):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=({el:e,anchor:t},n,r)=>{let i;for(;e&&e!==t;)i=h(e),o(e,n,r),e=i;o(t,n,r)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),s(e),e=n;s(t)},w=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)ee(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),ne(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},ee=(e,t,n,r,i,a,s,u)=>{let d,f,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(d=e.el=l(e.type,a,m&&m.is,m),h&8?p(d,e.children):h&16&&E(e.children,d,null,r,i,Zi(e,a),s,u),_&&Pn(e,null,r,`created`),te(d,e,e.scopeId,s,r),m){for(let e in m)e!==`value`&&!T(e)&&c(d,e,null,m[e],a,r);`value`in m&&c(d,`value`,null,m.value,a),(f=m.onVnodeBeforeMount)&&Q(f,r,e)}_&&Pn(e,null,r,`beforeMount`);let v=$i(i,g);v&&g.beforeEnter(d),o(d,t,n),((f=m&&m.onVnodeMounted)||v||_)&&K(()=>{try{f&&Q(f,r,e),v&&g.enter(d),_&&Pn(e,null,r,`mounted`)}finally{}},i)},te=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t{for(let l=c;l{let l=n.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:f}=n;u|=e.patchFlag&16;let m=e.props||t,h=n.props||t,g;if(r&&Qi(r,!1),(g=h.onVnodeBeforeUpdate)&&Q(g,r,n,e),f&&Pn(n,e,r,`beforeUpdate`),r&&Qi(r,!0),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&p(l,``),d?D(e.dynamicChildren,d,l,r,i,Zi(n,a),o):s||ue(e,n,l,null,r,i,Zi(n,a),o,!1),u>0){if(u&16)re(l,m,h,r,a);else if(u&2&&m.class!==h.class&&c(l,`class`,null,h.class,a),u&4&&c(l,`style`,m.style,h.style,a),u&8){let e=n.dynamicProps;for(let t=0;t{g&&Q(g,r,n,e),f&&Pn(n,e,r,`updated`)},i)},D=(e,t,n,r,i,a,o)=>{for(let s=0;s{if(n!==r){if(n!==t)for(let t in n)!T(t)&&!(t in r)&&c(e,t,n[t],null,a,i);for(let t in r){if(T(t))continue;let o=r[t],s=n[t];o!==s&&t!==`value`&&c(e,t,s,o,a,i)}`value`in r&&c(e,`value`,n.value,r.value,a)}},ie=(e,t,n,r,i,a,s,c,l)=>{let d=t.el=e?e.el:u(``),f=t.anchor=e?e.anchor:u(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(c=c?c.concat(h):h),e==null?(o(d,n,r),o(f,n,r),E(t.children||[],n,f,i,a,s,c,l)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(D(e.dynamicChildren,m,n,i,a,s,c),(t.key!=null||i&&t===i.subTree)&&ea(e,t,!0)):ue(e,t,n,f,i,a,s,c,l)},O=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):k(t,n,r,i,a,o,c):oe(e,t,c)},k=(e,t,n,r,i,a,o)=>{let s=e.component=Ma(e,r,i);if(wr(e)&&(s.ctx.renderer=Se),Ba(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,se,o),!e.el){let r=s.subTree=X(J);b(null,r,t,n),e.placeholder=r.el}}else se(s,e,t,n,i,a,o)},oe=(e,t,n)=>{let r=t.component=e.component;if(Di(e,t,n))if(r.asyncDep&&!r.asyncResolved){ce(r,t,n);return}else r.next=t,r.update();else t.el=e.el,r.vnode=t},se=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=na(e);if(n){t&&(t.el=c.el,ce(e,t,o)),n.asyncDep.then(()=>{K(()=>{e.isUnmounted||l()},i)});return}}let u=t,d;Qi(e,!1),t?(t.el=c.el,ce(e,t,o)):t=c,n&&ae(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&Q(d,s,t,c),Qi(e,!0);let f=wi(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el),ye(p),e,i,a),t.el=f.el,u===null&&Ai(e,f.el),r&&K(r,i),(d=t.props&&t.props.onVnodeUpdated)&&K(()=>Q(d,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Cr(t);if(Qi(e,!1),l&&ae(l),!m&&(o=c&&c.onVnodeBeforeMount)&&Q(o,d,t),Qi(e,!0),s&&we){let t=()=>{e.subTree=wi(e),we(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=wi(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&K(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;K(()=>Q(o,d,e),i)}(t.shapeFlag&256||d&&Cr(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&K(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new je(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>Cn(u),Qi(e,!0),l()},ce=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,Fi(e,t.props,r,n),Ji(e,t.children,n),Ge(),En(e),Ke()},ue=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:m}=t;if(f>0){if(f&128){fe(l,d,n,r,i,a,o,s,c);return}else if(f&256){de(l,d,n,r,i,a,o,s,c);return}}m&8?(u&16&&ve(l,i,a),d!==l&&p(n,d)):u&16?m&16?fe(l,d,n,r,i,a,o,s,c):ve(l,i,a,!0):(u&8&&p(n,``),m&16&&E(d,n,r,i,a,o,s,c))},de=(e,t,r,i,a,o,s,c,l)=>{e||=n,t||=n;let u=e.length,d=t.length,f=Math.min(u,d),p;for(p=0;pd?ve(e,a,o,!0,!1,f):E(t,r,i,a,o,s,c,l,f)},fe=(e,t,r,i,a,o,s,c,l)=>{let u=0,d=t.length,f=e.length-1,p=d-1;for(;u<=f&&u<=p;){let n=e[u],i=t[u]=l?Da(t[u]):Z(t[u]);if(va(n,i))v(n,i,r,null,a,o,s,c,l);else break;u++}for(;u<=f&&u<=p;){let n=e[f],i=t[p]=l?Da(t[p]):Z(t[p]);if(va(n,i))v(n,i,r,null,a,o,s,c,l);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,n=ep)for(;u<=f;)me(e[u],a,o,!0),u++;else{let m=u,h=u,g=new Map;for(u=h;u<=p;u++){let e=t[u]=l?Da(t[u]):Z(t[u]);e.key!=null&&g.set(e.key,u)}let _,y=0,b=p-h+1,x=!1,S=0,C=Array(b);for(u=0;u=b){me(n,a,o,!0);continue}let i;if(n.key!=null)i=g.get(n.key);else for(_=h;_<=p;_++)if(C[_-h]===0&&va(n,t[_])){i=_;break}i===void 0?me(n,a,o,!0):(C[i-h]=u+1,i>=S?S=i:x=!0,v(n,t[i],r,null,a,o,s,c,l),y++)}let w=x?ta(C):n;for(_=w.length-1,u=b-1;u>=0;u--){let e=h+u,n=t[e],f=t[e+1],p=e+1{let{el:a,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){pe(e.component.subTree,t,n,r);return}if(d&128){e.suspense.move(t,n,r);return}if(d&64){c.move(e,t,n,Se);return}if(c===q){o(a,t,n);for(let e=0;el.enter(a),i);else{let{leave:r,delayLeave:i,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?s(a):o(a,t,n)},d=()=>{a._isLeaving&&a[U](!0),r(a,()=>{u(),c&&c()})};i?i(a,u,d):d()}else o(a,t,n)},me=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null&&(Ge(),xr(s,null,n,e,!0),Ke()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!Cr(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&Q(_,t,e),u&6)_e(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&Pn(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,Se,r):l&&!l.hasOnce&&(a!==q||d>0&&d&64)?ve(l,t,n,!1,!0):(a===q&&d&384||!i&&u&16)&&ve(c,t,n),r&&he(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&K(()=>{_&&Q(_,t,e),h&&Pn(e,null,t,`unmounted`),v&&(e.el=null)},n)},he=e=>{let{type:t,el:n,anchor:r,transition:i}=e;if(t===q){ge(n,r);return}if(t===ca){C(e);return}let a=()=>{s(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(e.shapeFlag&1&&i&&!i.persisted){let{leave:t,delayLeave:r}=i,o=()=>t(n,a);r?r(e.el,a,o):o()}else a()},ge=(e,t)=>{let n;for(;e!==t;)n=h(e),s(e),e=n;s(t)},_e=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;ra(c),ra(l),r&&ae(r),i.stop(),a&&(a.flags|=8,me(o,e,t,n)),s&&K(s,t),K(()=>{e.isUnmounted=!0},t)},ve=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o{if(e.shapeFlag&6)return ye(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[Gn];return n?h(n):t},be=!1,xe=(e,t,n)=>{let r;e==null?t._vnode&&(me(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,be||=(be=!0,En(r),Dn(),!1)},Se={p:v,um:me,m:pe,r:he,mt:k,mc:E,pc:ue,pbc:D,n:ye,o:e},Ce,we;return i&&([Ce,we]=i(Se)),{render:xe,hydrate:Ce,createApp:_i(xe,Ce)}}function Zi({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function Qi({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function $i(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ea(e,t,n=!1){let r=e.children,i=t.children;if(d(r)&&d(i))for(let e=0;e>1,e[n[s]]0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-- >0;)n[a]=o,o=t[o];return n}function na(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:na(t)}function ra(e){if(e)for(let t=0;te.__isSuspense;function oa(e,t){t&&t.pendingBranch?d(e)?t.effects.push(...e):t.effects.push(e):Tn(e)}var q=Symbol.for(`v-fgt`),sa=Symbol.for(`v-txt`),J=Symbol.for(`v-cmt`),ca=Symbol.for(`v-stc`),la=[],Y=null;function ua(e=!1){la.push(Y=e?null:[])}function da(){la.pop(),Y=la[la.length-1]||null}var fa=1;function pa(e,t=!1){fa+=e,e<0&&Y&&t&&(Y.hasOnce=!0)}function ma(e){return e.dynamicChildren=fa>0?Y||n:null,da(),fa>0&&Y&&Y.push(e),e}function ha(e,t,n,r,i,a){return ma(xa(e,t,n,r,i,a,!0))}function ga(e,t,n,r,i){return ma(X(e,t,n,r,i,!0))}function _a(e){return e?e.__v_isVNode===!0:!1}function va(e,t){return e.type===t.type&&e.key===t.key}var ya=({key:e})=>e??null,ba=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:g(e)||R(e)||h(e)?{i:H,r:e,k:t,f:!!n}:e);function xa(e,t=null,n=null,r=0,i=null,a=e===q?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ya(t),ref:t&&ba(t),scopeId:An,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:H};return s?(Oa(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=g(n)?8:16),fa>0&&!o&&Y&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&Y.push(c),c}var X=Sa;function Sa(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===Ur)&&(e=J),_a(e)){let r=wa(e,t,!0);return n&&Oa(r,n),fa>0&&!a&&Y&&(r.shapeFlag&6?Y[Y.indexOf(e)]=r:Y.push(r)),r.patchFlag=-2,r}if(Xa(e)&&(e=e.__vccOpts),t){t=Ca(t);let{class:e,style:n}=t;e&&!g(e)&&(t.class=he(e)),v(n)&&(Ut(n)&&!d(n)&&(n=s({},n)),t.style=ue(n))}let o=g(e)?1:aa(e)?128:Kn(e)?64:v(e)?4:h(e)?2:0;return xa(e,t,n,r,i,o,a,!0)}function Ca(e){return e?Ut(e)||Ni(e)?s({},e):e:null}function wa(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?ka(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&ya(l),ref:t&&t.ref?n&&a?d(a)?a.concat(ba(t)):[a,ba(t)]:ba(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==q?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&wa(e.ssContent),ssFallback:e.ssFallback&&wa(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&hr(u,c.clone(u)),u}function Ta(e=` `,t=0){return X(sa,null,e,t)}function Ea(e=``,t=!1){return t?(ua(),ga(J,null,e)):X(J,null,e)}function Z(e){return e==null||typeof e==`boolean`?X(J):d(e)?X(q,null,e.slice()):_a(e)?Da(e):X(sa,null,String(e))}function Da(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:wa(e)}function Oa(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(d(t))n=16;else if(typeof t==`object`)if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),Oa(e,n()),n._c&&(n._d=!0));return}else{n=32;let r=t._;!r&&!Ni(t)?t._ctx=H:r===3&&H&&(H.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else h(t)?(t={default:t,_ctx:H},n=32):(t=String(t),r&64?(n=16,t=[Ta(t)]):n=8);e.children=t,e.shapeFlag|=n}function ka(...e){let t={};for(let n=0;n$||H,Pa,Fa;{let e=le(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};Pa=t(`__VUE_INSTANCE_SETTERS__`,e=>$=e),Fa=t(`__VUE_SSR_SETTERS__`,e=>za=e)}var Ia=e=>{let t=$;return Pa(e),e.scope.on(),()=>{e.scope.off(),Pa(t)}},La=()=>{$&&$.scope.off(),Pa(null)};function Ra(e){return e.vnode.shapeFlag&4}var za=!1;function Ba(e,t=!1,n=!1){t&&Fa(t);let{props:r,children:i}=e.vnode,a=Ra(e);Pi(e,r,a,t),qi(e,i,n||t);let o=a?Va(e,t):void 0;return t&&Fa(!1),o}function Va(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,$r);let{setup:r}=n;if(r){Ge();let n=e.setupContext=r.length>1?qa(e):null,i=Ia(e),a=pn(r,e,0,[e.props,n]),o=y(a);if(Ke(),i(),(o||e.sp)&&!Cr(e)&&vr(e),o){if(a.then(La,La),t)return a.then(n=>{Ha(e,n,t)}).catch(t=>{mn(t,e,0)});e.asyncDep=a}else Ha(e,a,t)}else Ga(e,t)}function Ha(e,t,n){h(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:v(t)&&(e.setupState=Qt(t)),Ga(e,n)}var Ua,Wa;function Ga(e,t,n){let i=e.type;if(!e.render){if(!t&&Ua&&!i.render){let t=i.template||oi(e).template;if(t){let{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:a,compilerOptions:o}=i;i.render=Ua(t,s(s({isCustomElement:n,delimiters:a},r),o))}}e.render=i.render||r,Wa&&Wa(e)}{let t=Ia(e);Ge();try{ni(e)}finally{Ke(),t()}}}var Ka={get(e,t){return N(e,`get`,``),e[t]}};function qa(e){return{attrs:new Proxy(e.attrs,Ka),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function Ja(e){return e.exposed?e.exposeProxy||=new Proxy(Qt(Wt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Zr)return Zr[n](e)},has(e,t){return t in e||t in Zr}}):e.proxy}function Ya(e,t=!0){return h(e)?e.displayName||e.name:e.name||t&&e.__name}function Xa(e){return h(e)&&`__vccOpts`in e}var Za=(e,t)=>on(e,t,za);function Qa(e,t,n){try{pa(-1);let r=arguments.length;return r===2?v(t)&&!d(t)?_a(t)?X(e,null,[t]):X(e,t):X(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&_a(n)&&(n=[n]),X(e,t,n))}finally{pa(1)}}var $a=`3.5.33`,eo=void 0,to=typeof window<`u`&&window.trustedTypes;if(to)try{eo=to.createPolicy(`vue`,{createHTML:e=>e})}catch{}var no=eo?e=>eo.createHTML(e):e=>e,ro=`http://www.w3.org/2000/svg`,io=`http://www.w3.org/1998/Math/MathML`,ao=typeof document<`u`?document:null,oo=ao&&ao.createElement(`template`),so={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?ao.createElementNS(ro,e):t===`mathml`?ao.createElementNS(io,e):n?ao.createElement(e,{is:n}):ao.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>ao.createTextNode(e),createComment:e=>ao.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ao.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{oo.innerHTML=no(r===`svg`?`${e}`:r===`mathml`?`${e}`:e);let i=oo.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},co=`transition`,lo=`animation`,uo=Symbol(`_vtc`),fo={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},po=s({},or,fo),mo=(e=>(e.displayName=`Transition`,e.props=po,e))((e,{slots:t})=>Qa(ur,_o(e),t)),ho=(e,t=[])=>{d(e)?e.forEach(e=>e(...t)):e&&e(...t)},go=e=>e?d(e)?e.some(e=>e.length>1):e.length>1:!1;function _o(e){let t={};for(let n in e)n in fo||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:c=`${n}-enter-to`,appearFromClass:l=a,appearActiveClass:u=o,appearToClass:d=c,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=e,h=vo(i),g=h&&h[0],_=h&&h[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:b,onLeave:x,onLeaveCancelled:S,onBeforeAppear:C=v,onAppear:w=y,onAppearCancelled:T=b}=t,ee=(e,t,n,r)=>{e._enterCancelled=r,xo(e,t?d:c),xo(e,t?u:o),n&&n()},te=(e,t)=>{e._isLeaving=!1,xo(e,f),xo(e,m),xo(e,p),t&&t()},E=e=>(t,n)=>{let i=e?w:y,o=()=>ee(t,e,n);ho(i,[t,o]),So(()=>{xo(t,e?l:a),bo(t,e?d:c),go(i)||wo(t,r,g,o)})};return s(t,{onBeforeEnter(e){ho(v,[e]),bo(e,a),bo(e,o)},onBeforeAppear(e){ho(C,[e]),bo(e,l),bo(e,u)},onEnter:E(!1),onAppear:E(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>te(e,t);bo(e,f),e._enterCancelled?(bo(e,p),Oo(e)):(Oo(e),bo(e,p)),So(()=>{e._isLeaving&&(xo(e,f),bo(e,m),go(x)||wo(e,r,_,n))}),ho(x,[e,n])},onEnterCancelled(e){ee(e,!1,void 0,!0),ho(b,[e])},onAppearCancelled(e){ee(e,!0,void 0,!0),ho(T,[e])},onLeaveCancelled(e){te(e),ho(S,[e])}})}function vo(e){if(e==null)return null;if(v(e))return[yo(e.enter),yo(e.leave)];{let t=yo(e);return[t,t]}}function yo(e){return se(e)}function bo(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[uo]||(e[uo]=new Set)).add(t)}function xo(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[uo];n&&(n.delete(t),n.size||(e[uo]=void 0))}function So(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Co=0;function wo(e,t,n,r){let i=e._endId=++Co,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=To(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u(n[e]||``).split(`, `),i=r(`${co}Delay`),a=r(`${co}Duration`),o=Eo(i,a),s=r(`${lo}Delay`),c=r(`${lo}Duration`),l=Eo(s,c),u=null,d=0,f=0;t===co?o>0&&(u=co,d=o,f=a.length):t===lo?l>0&&(u=lo,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?co:lo:null,f=u?u===co?a.length:c.length:0);let p=u===co&&/\b(?:transform|all)(?:,|$)/.test(r(`${co}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function Eo(e,t){for(;e.lengthDo(t)+Do(e[n])))}function Do(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function Oo(e){return(e?e.ownerDocument:document).body.offsetHeight}function ko(e,t,n){let r=e[uo];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var Ao=Symbol(`_vod`),jo=Symbol(`_vsh`),Mo=Symbol(``),No=/(?:^|;)\s*display\s*:/;function Po(e,t,n){let r=e.style,i=g(n),a=!1;if(n&&!i){if(t)if(g(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Io(r,t,``)}else for(let e in t)n[e]??Io(r,e,``);for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Io(r,i,``):Bo(e,i,!g(t)&&t?t[i]:void 0,o)||Io(r,i,o)}}else if(i){if(t!==n){let e=r[Mo];e&&(n+=`;`+e),r.cssText=n,a=No.test(n)}}else t&&e.removeAttribute(`style`);Ao in e&&(e[Ao]=a?r.display:``,e[jo]&&(r.display=`none`))}var Fo=/\s*!important$/;function Io(e,t,n){if(d(n))n.forEach(n=>Io(e,t,n));else if(n??=``,t.startsWith(`--`))e.setProperty(t,n);else{let r=zo(e,t);Fo.test(n)?e.setProperty(D(r),n.replace(Fo,``),`important`):e[r]=n}}var Lo=[`Webkit`,`Moz`,`ms`],Ro={};function zo(e,t){let n=Ro[t];if(n)return n;let r=E(t);if(r!==`filter`&&r in e)return Ro[t]=r;r=re(r);for(let n=0;nXo||=(Zo.then(()=>Xo=0),Date.now());function $o(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;z(es(e,n.value),t,5,[e])};return n.value=e,n.attached=Qo(),n}function es(e,t){if(d(t)){let n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}else return t}var ts=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,ns=(e,t,n,r,i,s)=>{let c=i===`svg`;t===`class`?ko(e,r,c):t===`style`?Po(e,n,r):a(t)?o(t)||qo(e,t,n,r,s):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):rs(e,t,r,c))?(Uo(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&Ho(e,t,r,c,s,t!==`value`)):e._isVueCE&&(is(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!g(r)))?Uo(e,E(t),r,s,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),Ho(e,t,r,c))};function rs(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&ts(t)&&h(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return ts(t)&&g(n)?!1:t in e}function is(e,t){let n=e._def.props;if(!n)return!1;let r=E(t);return Array.isArray(n)?n.some(e=>E(e)===r):Object.keys(n).some(e=>E(e)===r)}var as=new WeakMap,os=new WeakMap,ss=Symbol(`_moveCb`),cs=Symbol(`_enterCb`),ls=(e=>(delete e.props.mode,e))({name:`TransitionGroup`,props:s({},po,{tag:String,moveClass:String}),setup(e,{slots:t}){let n=Na(),r=ar(),i,a;return Pr(()=>{if(!i.length)return;let t=e.moveClass||`${e.name||`v`}-move`;if(!ms(i[0].el,n.vnode.el,t)){i=[];return}i.forEach(us),i.forEach(ds);let r=i.filter(fs);Oo(n.vnode.el),r.forEach(e=>{let n=e.el,r=n.style;bo(n,t),r.transform=r.webkitTransform=r.transitionDuration=``;let i=n[ss]=e=>{e&&e.target!==n||(!e||e.propertyName.endsWith(`transform`))&&(n.removeEventListener(`transitionend`,i),n[ss]=null,xo(n,t))};n.addEventListener(`transitionend`,i)}),i=[]}),()=>{let o=I(e),s=_o(o),c=o.tag||q;if(i=[],a)for(let e=0;e{e.split(/\s+/).forEach(e=>e&&r.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&r.classList.add(e)),r.style.display=`none`;let a=t.nodeType===1?t:t.parentNode;a.appendChild(r);let{hasTransform:o}=To(r);return a.removeChild(r),o}var hs=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return d(t)?e=>ae(t,e):t};function gs(e){e.target.composing=!0}function _s(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var vs=Symbol(`_assign`);function ys(e,t,n){return t&&(e=e.trim()),n&&(e=oe(e)),e}var bs={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[vs]=hs(i);let a=r||i.props&&i.props.type===`number`;Wo(e,t?`change`:`input`,t=>{t.target.composing||e[vs](ys(e.value,n,a))}),(n||a)&&Wo(e,`change`,()=>{e.value=ys(e.value,n,a)}),t||(Wo(e,`compositionstart`,gs),Wo(e,`compositionend`,_s),Wo(e,`change`,_s))},mounted(e,{value:t}){e.value=t??``},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[vs]=hs(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?oe(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},xs={deep:!0,created(e,t,n){e[vs]=hs(n),Wo(e,`change`,()=>{let t=e._modelValue,n=Ts(e),r=e.checked,i=e[vs];if(d(t)){let e=xe(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(p(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(Es(e,r))})},mounted:Ss,beforeUpdate(e,t,n){e[vs]=hs(n),Ss(e,t,n)}};function Ss(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(d(t))i=xe(t,r.props.value)>-1;else if(p(t))i=t.has(r.props.value);else{if(t===n)return;i=be(t,Es(e,!0))}e.checked!==i&&(e.checked=i)}var Cs={deep:!0,created(e,{value:t,modifiers:{number:n}},r){let i=p(t);Wo(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?oe(Ts(e)):Ts(e));e[vs](e.multiple?i?new Set(t):t:t[0]),e._assigning=!0,xn(()=>{e._assigning=!1})}),e[vs]=hs(r)},mounted(e,{value:t}){ws(e,t)},beforeUpdate(e,t,n){e[vs]=hs(n)},updated(e,{value:t}){e._assigning||ws(e,t)}};function ws(e,t){let n=e.multiple,r=d(t);if(!(n&&!r&&!p(t))){for(let i=0,a=e.options.length;iString(e)===String(o)):a.selected=xe(t,o)>-1}else a.selected=t.has(o);else if(be(Ts(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ts(e){return`_value`in e?e._value:e.value}function Es(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var Ds=[`ctrl`,`shift`,`alt`,`meta`],Os={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>Ds.some(n=>e[`${n}Key`]&&!t.includes(n))},ks=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=D(n.key);if(t.some(e=>e===r||As[e]===r))return e(n)}))},Ms=s({patchProp:ns},so),Ns;function Ps(){return Ns||=Yi(Ms)}var Fs=((...e)=>{let t=Ps().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Ls(e);if(!r)return;let i=t._component;!h(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Is(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function Is(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function Ls(e){return g(e)?document.querySelector(e):e}var Rs=typeof window<`u`,zs,Bs=e=>zs=e,Vs=Symbol();function Hs(e){return e&&typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`&&typeof e.toJSON!=`function`}var Us;(function(e){e.direct=`direct`,e.patchObject=`patch object`,e.patchFunction=`patch function`})(Us||={});var Ws=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:typeof globalThis==`object`?globalThis:{HTMLElement:null};function Gs(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function Ks(e,t,n){let r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){Zs(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function qs(e){let t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function Js(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window,detail:0,screenX:80,screenY:20,clientX:80,clientY:20,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});e.dispatchEvent(t)}}var Ys=typeof navigator==`object`?navigator:{userAgent:``},Xs=/Macintosh/.test(Ys.userAgent)&&/AppleWebKit/.test(Ys.userAgent)&&!/Safari/.test(Ys.userAgent),Zs=Rs?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!Xs?Qs:`msSaveOrOpenBlob`in Ys?$s:ec:()=>{};function Qs(e,t=`download`,n){let r=document.createElement(`a`);r.download=t,r.rel=`noopener`,typeof e==`string`?(r.href=e,r.origin===location.origin?Js(r):qs(r.href)?Ks(e,t,n):(r.target=`_blank`,Js(r))):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){Js(r)},0))}function $s(e,t=`download`,n){if(typeof e==`string`)if(qs(e))Ks(e,t,n);else{let t=document.createElement(`a`);t.href=e,t.target=`_blank`,setTimeout(function(){Js(t)})}else navigator.msSaveOrOpenBlob(Gs(e,n),t)}function ec(e,t,n,r){if(r||=open(``,`_blank`),r&&(r.document.title=r.document.body.innerText=`downloading...`),typeof e==`string`)return Ks(e,t,n);let i=e.type===`application/octet-stream`,a=/constructor/i.test(String(Ws.HTMLElement))||`safari`in Ws,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a||Xs)&&typeof FileReader<`u`){let t=new FileReader;t.onloadend=function(){let e=t.result;if(typeof e!=`string`)throw r=null,Error(`Wrong reader.result type`);e=o?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),r?r.location.href=e:location.assign(e),r=null},t.readAsDataURL(e)}else{let t=URL.createObjectURL(e);r?r.location.assign(t):location.href=t,r=null,setTimeout(function(){URL.revokeObjectURL(t)},4e4)}}var{assign:tc}=Object;function nc(){let e=De(!0),t=e.run(()=>Kt({})),n=[],r=[],i=Wt({install(e){Bs(i),i._a=e,e.provide(Vs,i),e.config.globalProperties.$pinia=i,r.forEach(e=>n.push(e)),r=[]},use(e){return this._a?n.push(e):r.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}var rc=()=>{};function ic(e,t,n,r=rc){e.add(t);let i=()=>{e.delete(t)&&r()};return!n&&Oe()&&ke(i),i}function ac(e,...t){e.forEach(e=>{e(...t)})}var oc=e=>e(),sc=Symbol(),cc=Symbol();function lc(e,t){e instanceof Map&&t instanceof Map?t.forEach((t,n)=>e.set(n,t)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(let n in t){if(!t.hasOwnProperty(n))continue;let r=t[n],i=e[n];Hs(i)&&Hs(r)&&e.hasOwnProperty(n)&&!R(r)&&!Vt(r)?e[n]=lc(i,r):e[n]=r}return e}var uc=Symbol();function dc(e){return!Hs(e)||!Object.prototype.hasOwnProperty.call(e,uc)}var{assign:fc}=Object;function pc(e){return!!(R(e)&&e.effect)}function mc(e,t,n,r){let{state:i,actions:a,getters:o}=t,s=n.state.value[e],c;function l(){return s||(n.state.value[e]=i?i():{}),fc($t(n.state.value[e]),a,Object.keys(o||{}).reduce((t,r)=>(t[r]=Wt(Za(()=>{Bs(n);let t=n._s.get(e);return o[r].call(t,t)})),t),{}))}return c=hc(e,l,t,n,r,!0),c}function hc(e,t,n={},r,i,a){let o,s=fc({actions:{}},n),c={deep:!0},l,u,d=new Set,f=new Set,p=r.state.value[e];!a&&!p&&(r.state.value[e]={});let m;function h(t){let n;l=u=!1,typeof t==`function`?(t(r.state.value[e]),n={type:Us.patchFunction,storeId:e,events:void 0}):(lc(r.state.value[e],t),n={type:Us.patchObject,payload:t,storeId:e,events:void 0});let i=m=Symbol();xn().then(()=>{m===i&&(l=!0)}),u=!0,ac(d,n,r.state.value[e])}let g=a?function(){let{state:e}=n,t=e?e():{};this.$patch(e=>{fc(e,t)})}:rc;function _(){o.stop(),d.clear(),f.clear(),r._s.delete(e)}let v=(t,n=``)=>{if(sc in t)return t[cc]=n,t;let i=function(){Bs(r);let n=Array.from(arguments),a=new Set,o=new Set;function s(e){a.add(e)}function c(e){o.add(e)}ac(f,{args:n,name:i[cc],store:y,after:s,onError:c});let l;try{l=t.apply(this&&this.$id===e?this:y,n)}catch(e){throw ac(o,e),e}return l instanceof Promise?l.then(e=>(ac(a,e),e)).catch(e=>(ac(o,e),Promise.reject(e))):(ac(a,l),l)};return i[sc]=!0,i[cc]=n,i},y=Lt({_p:r,$id:e,$onAction:ic.bind(null,f),$patch:h,$reset:g,$subscribe(t,n={}){let i=ic(d,t,n.detached,()=>a()),a=o.run(()=>Bn(()=>r.state.value[e],r=>{(n.flush===`sync`?u:l)&&t({storeId:e,type:Us.direct,events:void 0},r)},fc({},c,n)));return i},$dispose:_});r._s.set(e,y);let b=(r._a&&r._a.runWithContext||oc)(()=>r._e.run(()=>(o=De()).run(()=>t({action:v}))));for(let t in b){let n=b[t];R(n)&&!pc(n)||Vt(n)?a||(p&&dc(n)&&(R(n)?n.value=p[t]:lc(n,p[t])),r.state.value[e][t]=n):typeof n==`function`&&(b[t]=v(n,t),s.actions[t]=n)}return fc(y,b),fc(I(y),b),Object.defineProperty(y,`$state`,{get:()=>r.state.value[e],set:e=>{h(t=>{fc(t,e)})}}),r._p.forEach(e=>{fc(y,o.run(()=>e({store:y,app:r._a,pinia:r,options:s})))}),p&&a&&n.hydrate&&n.hydrate(y.$state,p),l=!0,u=!0,y}function gc(e,t,n){let r,i=typeof t==`function`;r=i?n:t;function a(n,a){let o=Ln();return n||=o?In(Vs,null):null,n&&Bs(n),n=zs,n._s.has(e)||(i?hc(e,t,r,n):mc(e,r,n)),n._s.get(e)}return a.$id=e,a}function _c(e){let t=I(e),n={};for(let r in t){let i=t[r];i.effect?n[r]=Za({get:()=>e[r],set(t){e[r]=t}}):(R(i)||Vt(i))&&(n[r]=nn(e,r))}return n}var vc=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n};export{Ir as A,Nn as B,Na as C,xn as D,ka as E,Jr as F,Xt as G,Kt as H,Hr as I,Ce as J,he as K,Wr as L,ua as M,Fn as N,Fr as O,qr as P,Bn as R,_r as S,In as T,Rt as U,Lt as V,qt as W,ga as _,mo as a,Ta as b,xs as c,js as d,ks as f,xa as g,Za as h,_c as i,Pr as j,Mr as k,Cs as l,tr as m,nc as n,ls as o,q as p,ue as q,gc as r,Fs as s,vc as t,bs as u,Ea as v,Qa as w,X as x,ha as y,Mn as z}; \ No newline at end of file +function e(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var t={},n=[],r=()=>{},i=()=>!1,a=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),o=e=>e.startsWith(`onUpdate:`),s=Object.assign,c=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},l=Object.prototype.hasOwnProperty,u=(e,t)=>l.call(e,t),d=Array.isArray,f=e=>x(e)===`[object Map]`,p=e=>x(e)===`[object Set]`,m=e=>x(e)===`[object Date]`,h=e=>typeof e==`function`,g=e=>typeof e==`string`,_=e=>typeof e==`symbol`,v=e=>typeof e==`object`&&!!e,y=e=>(v(e)||h(e))&&h(e.then)&&h(e.catch),b=Object.prototype.toString,x=e=>b.call(e),S=e=>x(e).slice(8,-1),C=e=>x(e)===`[object Object]`,w=e=>g(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,T=e(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ee=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},te=/-\w/g,E=ee(e=>e.replace(te,e=>e.slice(1).toUpperCase())),ne=/\B([A-Z])/g,D=ee(e=>e.replace(ne,`-$1`).toLowerCase()),re=ee(e=>e.charAt(0).toUpperCase()+e.slice(1)),ie=ee(e=>e?`on${re(e)}`:``),O=(e,t)=>!Object.is(e,t),ae=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},oe=e=>{let t=parseFloat(e);return isNaN(t)?e:t},se=e=>{let t=g(e)?Number(e):NaN;return isNaN(t)?e:t},ce,le=()=>ce||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function ue(e){if(d(e)){let t={};for(let n=0;n{if(e){let n=e.split(fe);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function he(e){let t=``;if(g(e))t=e;else if(d(e))for(let n=0;nbe(e,t))}var Se=e=>!!(e&&e.__v_isRef===!0),Ce=e=>g(e)?e:e==null?``:d(e)||v(e)&&(e.toString===b||!h(e.toString))?Se(e)?Ce(e.value):JSON.stringify(e,we,2):String(e),we=(e,t)=>Se(t)?we(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Te(t,r)+` =>`]=n,e),{})}:p(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Te(e))}:_(t)?Te(t):v(t)&&!d(t)&&!C(t)?String(t):t,Te=(e,t=``)=>_(e)?`Symbol(${e.description??t})`:e,A,Ee=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=A,!e&&A&&(this.index=(A.scopes||=[]).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e0&&--this._on===0){if(A===this)A=this.prevScope;else{let e=A;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t0)return;if(Pe){let e=Pe;for(Pe=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Ne;){let t=Ne;for(Ne=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function Re(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ze(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),He(r),Ue(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function Be(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ve(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ve(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Je)||(e.globalVersion=Je,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Be(e))))return;e.flags|=2;let t=e.dep,n=j,r=M;j=e,M=!0;try{Re(e);let n=e.fn(e._value);(t.version===0||O(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{j=n,M=r,ze(e),e.flags&=-3}}function He(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)He(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Ue(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var M=!0,We=[];function Ge(){We.push(M),M=!1}function Ke(){let e=We.pop();M=e===void 0?!0:e}function qe(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=j;j=void 0;try{t()}finally{j=e}}}var Je=0,Ye=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Xe=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!j||!M||j===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==j)t=this.activeLink=new Ye(j,this),j.deps?(t.prevDep=j.depsTail,j.depsTail.nextDep=t,j.depsTail=t):j.deps=j.depsTail=t,Ze(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=j.depsTail,t.nextDep=void 0,j.depsTail.nextDep=t,j.depsTail=t,j.deps===t&&(j.deps=e)}return t}trigger(e){this.version++,Je++,this.notify(e)}notify(e){Ie();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Le()}}};function Ze(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)Ze(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var Qe=new WeakMap,$e=Symbol(``),et=Symbol(``),tt=Symbol(``);function N(e,t,n){if(M&&j){let t=Qe.get(e);t||Qe.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new Xe),r.map=t,r.key=n),r.track()}}function nt(e,t,n,r,i,a){let o=Qe.get(e);if(!o){Je++;return}let s=e=>{e&&e.trigger()};if(Ie(),t===`clear`)o.forEach(s);else{let i=d(e),a=i&&w(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===tt||!_(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(tt)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get($e)),f(e)&&s(o.get(et)));break;case`delete`:i||(s(o.get($e)),f(e)&&s(o.get(et)));break;case`set`:f(e)&&s(o.get($e));break}}Le()}function rt(e,t){let n=Qe.get(e);return n&&n.get(t)}function it(e){let t=I(e);return t===e?t:(N(t,`iterate`,tt),F(e)?t:t.map(L))}function at(e){return N(e=I(e),`iterate`,tt),e}function P(e,t){return Ht(e)?Gt(Vt(e)?L(t):t):L(t)}var ot={__proto__:null,[Symbol.iterator](){return st(this,Symbol.iterator,e=>P(this,e))},concat(...e){return it(this).concat(...e.map(e=>d(e)?it(e):e))},entries(){return st(this,`entries`,e=>(e[1]=P(this,e[1]),e))},every(e,t){return lt(this,`every`,e,t,void 0,arguments)},filter(e,t){return lt(this,`filter`,e,t,e=>e.map(e=>P(this,e)),arguments)},find(e,t){return lt(this,`find`,e,t,e=>P(this,e),arguments)},findIndex(e,t){return lt(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return lt(this,`findLast`,e,t,e=>P(this,e),arguments)},findLastIndex(e,t){return lt(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return lt(this,`forEach`,e,t,void 0,arguments)},includes(...e){return dt(this,`includes`,e)},indexOf(...e){return dt(this,`indexOf`,e)},join(e){return it(this).join(e)},lastIndexOf(...e){return dt(this,`lastIndexOf`,e)},map(e,t){return lt(this,`map`,e,t,void 0,arguments)},pop(){return ft(this,`pop`)},push(...e){return ft(this,`push`,e)},reduce(e,...t){return ut(this,`reduce`,e,t)},reduceRight(e,...t){return ut(this,`reduceRight`,e,t)},shift(){return ft(this,`shift`)},some(e,t){return lt(this,`some`,e,t,void 0,arguments)},splice(...e){return ft(this,`splice`,e)},toReversed(){return it(this).toReversed()},toSorted(e){return it(this).toSorted(e)},toSpliced(...e){return it(this).toSpliced(...e)},unshift(...e){return ft(this,`unshift`,e)},values(){return st(this,`values`,e=>P(this,e))}};function st(e,t,n){let r=at(e),i=r[t]();return r!==e&&!F(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var ct=Array.prototype;function lt(e,t,n,r,i,a){let o=at(e),s=o!==e&&!F(e),c=o[t];if(c!==ct[t]){let t=c.apply(e,a);return s?L(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,P(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function ut(e,t,n,r){let i=at(e),a=i!==e&&!F(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=P(e,t)),n.call(this,t,P(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?P(e,c):c}function dt(e,t,n){let r=I(e);N(r,`iterate`,tt);let i=r[t](...n);return(i===-1||i===!1)&&Ut(n[0])?(n[0]=I(n[0]),r[t](...n)):i}function ft(e,t,n=[]){Ge(),Ie();let r=I(e)[t].apply(e,n);return Le(),Ke(),r}var pt=e(`__proto__,__v_isRef,__isVue`),mt=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(_));function ht(e){_(e)||(e=String(e));let t=I(this);return N(t,`has`,e),t.hasOwnProperty(e)}var gt=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?Pt:Nt:i?Mt:jt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=d(e);if(!r){let e;if(a&&(e=ot[t]))return e;if(t===`hasOwnProperty`)return ht}let o=Reflect.get(e,t,R(e)?e:n);if((_(t)?mt.has(t):pt(t))||(r||N(e,`get`,t),i))return o;if(R(o)){let e=a&&w(t)?o:o.value;return r&&v(e)?zt(e):e}return v(o)?r?zt(o):Lt(o):o}},_t=class extends gt{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=d(e)&&w(t);if(!this._isShallow){let e=Ht(i);if(!F(n)&&!Ht(n)&&(i=I(i),n=I(n)),!a&&R(i)&&!R(n))return e||(i.value=n),!0}let o=a?Number(t)e,Ct=e=>Reflect.getPrototypeOf(e);function wt(e,t,n){return function(...r){let i=this.__v_raw,a=I(i),o=f(a),c=e===`entries`||e===Symbol.iterator&&o,l=e===`keys`&&o,u=i[e](...r),d=n?St:t?Gt:L;return!t&&N(a,`iterate`,l?et:$e),s(Object.create(u),{next(){let{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:c?[d(e[0]),d(e[1])]:d(e),done:t}}})}}function Tt(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function Et(e,t){let n={get(n){let r=this.__v_raw,i=I(r),a=I(n);e||(O(n,a)&&N(i,`get`,n),N(i,`get`,a));let{has:o}=Ct(i),s=t?St:e?Gt:L;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&N(I(t),`iterate`,$e),t.size},has(t){let n=this.__v_raw,r=I(n),i=I(t);return e||(O(t,i)&&N(r,`has`,t),N(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=I(a),s=t?St:e?Gt:L;return!e&&N(o,`iterate`,$e),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return s(n,e?{add:Tt(`add`),set:Tt(`set`),delete:Tt(`delete`),clear:Tt(`clear`)}:{add(e){let n=I(this),r=Ct(n),i=I(e),a=!t&&!F(e)&&!Ht(e)?i:e;return r.has.call(n,a)||O(e,a)&&r.has.call(n,e)||O(i,a)&&r.has.call(n,i)||(n.add(a),nt(n,`add`,a,a)),this},set(e,n){!t&&!F(n)&&!Ht(n)&&(n=I(n));let r=I(this),{has:i,get:a}=Ct(r),o=i.call(r,e);o||=(e=I(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?O(n,s)&&nt(r,`set`,e,n,s):nt(r,`add`,e,n),this},delete(e){let t=I(this),{has:n,get:r}=Ct(t),i=n.call(t,e);i||=(e=I(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&nt(t,`delete`,e,void 0,a),o},clear(){let e=I(this),t=e.size!==0,n=e.clear();return t&&nt(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=wt(r,e,t)}),n}function Dt(e,t){let n=Et(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(u(n,r)&&r in t?n:t,r,i)}var Ot={get:Dt(!1,!1)},kt={get:Dt(!1,!0)},At={get:Dt(!0,!1)},jt=new WeakMap,Mt=new WeakMap,Nt=new WeakMap,Pt=new WeakMap;function Ft(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function It(e){return e.__v_skip||!Object.isExtensible(e)?0:Ft(S(e))}function Lt(e){return Ht(e)?e:Bt(e,!1,yt,Ot,jt)}function Rt(e){return Bt(e,!1,xt,kt,Mt)}function zt(e){return Bt(e,!0,bt,At,Nt)}function Bt(e,t,n,r,i){if(!v(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;let a=It(e);if(a===0)return e;let o=i.get(e);if(o)return o;let s=new Proxy(e,a===2?r:n);return i.set(e,s),s}function Vt(e){return Ht(e)?Vt(e.__v_raw):!!(e&&e.__v_isReactive)}function Ht(e){return!!(e&&e.__v_isReadonly)}function F(e){return!!(e&&e.__v_isShallow)}function Ut(e){return e?!!e.__v_raw:!1}function I(e){let t=e&&e.__v_raw;return t?I(t):e}function Wt(e){return!u(e,`__v_skip`)&&Object.isExtensible(e)&&k(e,`__v_skip`,!0),e}var L=e=>v(e)?Lt(e):e,Gt=e=>v(e)?zt(e):e;function R(e){return e?e.__v_isRef===!0:!1}function Kt(e){return Jt(e,!1)}function qt(e){return Jt(e,!0)}function Jt(e,t){return R(e)?e:new Yt(e,t)}var Yt=class{constructor(e,t){this.dep=new Xe,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:I(e),this._value=t?e:L(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||F(e)||Ht(e);e=n?e:I(e),O(e,t)&&(this._rawValue=e,this._value=n?e:L(e),this.dep.trigger())}};function Xt(e){return R(e)?e.value:e}var Zt={get:(e,t,n)=>t===`__v_raw`?e:Xt(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return R(i)&&!R(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function Qt(e){return Vt(e)?e:new Proxy(e,Zt)}function $t(e){let t=d(e)?Array(e.length):{};for(let n in e)t[n]=rn(e,n);return t}var en=class{constructor(e,t,n){this._object=e,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0,this._key=_(t)?t:String(t),this._raw=I(e);let r=!0,i=e;if(!d(e)||_(this._key)||!w(this._key))do r=!Ut(i)||F(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=Xt(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&R(this._raw[this._key])){let t=this._object[this._key];if(R(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return rt(this._raw,this._key)}},tn=class{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}};function nn(e,t,n){return R(e)?e:h(e)?new tn(e):v(e)&&arguments.length>1?rn(e,t,n):Kt(e)}function rn(e,t,n){return new en(e,t,n)}var an=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Xe(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Je-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&j!==this)return Fe(this,!0),!0}get value(){let e=this.dep.track();return Ve(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function on(e,t,n=!1){let r,i;return h(e)?r=e:(r=e.get,i=e.set),new an(r,i,n)}var sn={},cn=new WeakMap,ln=void 0;function un(e,t=!1,n=ln){if(n){let t=cn.get(n);t||cn.set(n,t=[]),t.push(e)}}function dn(e,n,i=t){let{immediate:a,deep:o,once:s,scheduler:l,augmentJob:u,call:f}=i,p=e=>o?e:F(e)||o===!1||o===0?fn(e,1):fn(e),m,g,_,v,y=!1,b=!1;if(R(e)?(g=()=>e.value,y=F(e)):Vt(e)?(g=()=>p(e),y=!0):d(e)?(b=!0,y=e.some(e=>Vt(e)||F(e)),g=()=>e.map(e=>{if(R(e))return e.value;if(Vt(e))return p(e);if(h(e))return f?f(e,2):e()})):g=h(e)?n?f?()=>f(e,2):e:()=>{if(_){Ge();try{_()}finally{Ke()}}let t=ln;ln=m;try{return f?f(e,3,[v]):e(v)}finally{ln=t}}:r,n&&o){let e=g,t=o===!0?1/0:o;g=()=>fn(e(),t)}let x=Oe(),S=()=>{m.stop(),x&&x.active&&c(x.effects,m)};if(s&&n){let e=n;n=(...t)=>{e(...t),S()}}let C=b?Array(e.length).fill(sn):sn,w=e=>{if(!(!(m.flags&1)||!m.dirty&&!e))if(n){let e=m.run();if(o||y||(b?e.some((e,t)=>O(e,C[t])):O(e,C))){_&&_();let t=ln;ln=m;try{let t=[e,C===sn?void 0:b&&C[0]===sn?[]:C,v];C=e,f?f(n,3,t):n(...t)}finally{ln=t}}}else m.run()};return u&&u(w),m=new je(g),m.scheduler=l?()=>l(w,!1):w,v=e=>un(e,!1,m),_=m.onStop=()=>{let e=cn.get(m);if(e){if(f)f(e,4);else for(let t of e)t();cn.delete(m)}},n?a?w(!0):C=m.run():l?l(w.bind(null,!0),!0):m.run(),S.pause=m.pause.bind(m),S.resume=m.resume.bind(m),S.stop=S,S}function fn(e,t=1/0,n){if(t<=0||!v(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,R(e))fn(e.value,t,n);else if(d(e))for(let r=0;r{fn(e,t,n)});else if(C(e)){for(let r in e)fn(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&fn(e[r],t,n)}return e}function pn(e,t,n,r){try{return r?e(...r):e()}catch(e){mn(e,t,n)}}function z(e,t,n,r){if(h(e)){let i=pn(e,t,n,r);return i&&y(i)&&i.catch(e=>{mn(e,t,n)}),i}if(d(e)){let i=[];for(let a=0;a>>1,i=B[r],a=On(i);a=On(n)?B.push(e):B.splice(Sn(t),0,e),e.flags|=1,wn()}}function wn(){bn||=yn.then(kn)}function Tn(e){d(e)?gn.push(...e):_n&&e.id===-1?_n.splice(vn+1,0,e):e.flags&1||(gn.push(e),e.flags|=1),wn()}function En(e,t,n=V+1){for(;nOn(e)-On(t));if(gn.length=0,_n){_n.push(...e);return}for(_n=e,vn=0;vn<_n.length;vn++){let e=_n[vn];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}_n=null,vn=0}}var On=e=>e.id==null?e.flags&2?-1:1/0:e.id;function kn(e){try{for(V=0;V{r._d&&pa(-1);let i=jn(t),a;try{a=e(...n)}finally{jn(i),r._d&&pa(1)}return a};return r._n=!0,r._c=!0,r._d=!0,r}function Nn(e,n){if(H===null)return e;let r=Ya(H),i=e.dirs||=[];for(let e=0;e1)return n&&h(t)?t.call(r&&r.proxy):t}}function Ln(){return!!(Pa()||vi)}var Rn=Symbol.for(`v-scx`),zn=()=>In(Rn);function Bn(e,t,n){return Vn(e,t,n)}function Vn(e,n,i=t){let{immediate:a,deep:o,flush:c,once:l}=i,u=s({},i),d=n&&a||!n&&c!==`post`,f;if(Ba){if(c===`sync`){let e=zn();f=e.__watcherHandles||=[]}else if(!d){let e=()=>{};return e.stop=r,e.resume=r,e.pause=r,e}}let p=$;u.call=(e,t,n)=>z(e,p,t,n);let m=!1;c===`post`?u.scheduler=e=>{K(e,p&&p.suspense)}:c!==`sync`&&(m=!0,u.scheduler=(e,t)=>{t?e():Cn(e)}),u.augmentJob=e=>{n&&(e.flags|=4),m&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};let h=dn(e,n,u);return Ba&&(f?f.push(h):d&&h()),h}function Hn(e,t,n){let r=this.proxy,i=g(e)?e.includes(`.`)?Un(r,e):()=>r[e]:e.bind(r,r),a;h(t)?a=t:(a=t.handler,n=t);let o=La(this),s=Vn(i,a.bind(r),n);return o(),s}function Un(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;ee.__isTeleport,qn=e=>e&&(e.disabled||e.disabled===``),Jn=e=>e&&(e.defer||e.defer===``),Yn=e=>typeof SVGElement<`u`&&e instanceof SVGElement,Xn=e=>typeof MathMLElement==`function`&&e instanceof MathMLElement,Zn=(e,t)=>{let n=e&&e.to;return g(n)?t?t(n):null:n},Qn={name:`Teleport`,__isTeleport:!0,process(e,t,n,r,i,a,o,s,c,l){let{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:m,createText:h,createComment:g,parentNode:_}}=l,v=qn(t.props),{dynamicChildren:y}=t,b=(e,t,n)=>{e.shapeFlag&16&&u(e.children,t,n,i,a,o,s,c)},x=(e=t)=>{let n=qn(e.props),r=e.target=Zn(e.props,m),a=rr(r,e,h,p);r&&(o!==`svg`&&Yn(r)?o=`svg`:o!==`mathml`&&Xn(r)&&(o=`mathml`),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(r),n||(b(e,r,a),nr(e,!1)))},S=e=>{let t=()=>{Wn.get(e)===t&&(Wn.delete(e),qn(e.props)&&(b(e,_(e.el)||n,e.anchor),nr(e,!0)),x(e))};Wn.set(e,t),K(t,a)};if(e==null){let e=t.el=h(``),i=t.anchor=h(``);if(p(e,n,r),p(i,n,r),Jn(t.props)||a&&a.pendingBranch){S(t);return}v&&(b(t,n,i),nr(t,!0)),x()}else{t.el=e.el;let r=t.anchor=e.anchor,u=Wn.get(e);if(u){u.flags|=8,Wn.delete(e),S(t);return}t.targetStart=e.targetStart;let p=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=qn(e.props),_=g?n:p,b=g?r:h;if(o===`svg`||Yn(p)?o=`svg`:(o===`mathml`||Xn(p))&&(o=`mathml`),y?(f(e.dynamicChildren,y,_,i,a,o,s),ea(e,t,!0)):c||d(e,t,_,b,i,a,o,s,!1),v)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):$n(t,n,r,l,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=t.target=Zn(t.props,m);e&&$n(t,e,null,l,0)}else g&&$n(t,p,h,l,1);nr(t,v)}},remove(e,t,n,{um:r,o:{remove:i}},a){let{shapeFlag:o,children:s,anchor:c,targetStart:l,targetAnchor:u,target:d,props:f}=e,p=a||!qn(f),m=Wn.get(e);if(m&&(m.flags|=8,Wn.delete(e),p=!1),d&&(i(l),i(u)),a&&i(c),o&16)for(let e=0;e{e.isMounted=!0}),Fr(()=>{e.isUnmounting=!0}),e}var W=[Function,Array],or={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:W,onEnter:W,onAfterEnter:W,onEnterCancelled:W,onBeforeLeave:W,onLeave:W,onAfterLeave:W,onLeaveCancelled:W,onBeforeAppear:W,onAppear:W,onAfterAppear:W,onAppearCancelled:W},sr=e=>{let t=e.subTree;return t.component?sr(t.component):t},cr={name:`BaseTransition`,props:or,setup(e,{slots:t}){let n=Pa(),r=ar();return()=>{let i=t.default&&gr(t.default(),!0),a=i&&i.length?lr(i):n.subTree?Da():void 0;if(!a)return;let o=I(e),{mode:s}=o;if(r.isLeaving)return pr(a);let c=mr(a);if(!c)return pr(a);let l=fr(c,o,r,n,e=>l=e);c.type!==J&&hr(c,l);let u=n.subTree&&mr(n.subTree);if(u&&u.type!==J&&!va(u,c)&&sr(n).type!==J){let e=fr(u,o,r,n);if(hr(u,e),s===`out-in`&&c.type!==J)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete e.afterLeave,u=void 0},pr(a);s===`in-out`&&c.type!==J?e.delayLeave=(e,t,n)=>{let i=dr(r,u);i[String(u.key)]=u,e[U]=()=>{t(),e[U]=void 0,delete l.delayedLeave,u=void 0},l.delayedLeave=()=>{n(),delete l.delayedLeave,u=void 0}}:u=void 0}else u&&=void 0;return a}}};function lr(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==J){t=n;break}}return t}var ur=cr;function dr(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function fr(e,t,n,r,i){let{appear:a,mode:o,persisted:s=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:p,onLeave:m,onAfterLeave:h,onLeaveCancelled:g,onBeforeAppear:_,onAppear:v,onAfterAppear:y,onAppearCancelled:b}=t,x=String(e.key),S=dr(n,e),C=(e,t)=>{e&&z(e,r,9,t)},w=(e,t)=>{let n=t[1];C(e,t),d(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},T={mode:o,persisted:s,beforeEnter(t){let r=c;if(!n.isMounted)if(a)r=_||c;else return;t[U]&&t[U](!0);let i=S[x];i&&va(e,i)&&i.el[U]&&i.el[U](),C(r,[t])},enter(t){if(S[x]===e)return;let r=l,i=u,o=f;if(!n.isMounted)if(a)r=v||l,i=y||u,o=b||f;else return;let s=!1;t[ir]=e=>{s||(s=!0,C(e?o:i,[t]),T.delayedLeave&&T.delayedLeave(),t[ir]=void 0)};let c=t[ir].bind(null,!1);r?w(r,[t,c]):c()},leave(t,r){let i=String(e.key);if(t[ir]&&t[ir](!0),n.isUnmounting)return r();C(p,[t]);let a=!1;t[U]=n=>{a||(a=!0,r(),C(n?g:h,[t]),t[U]=void 0,S[i]===e&&delete S[i])};let o=t[U].bind(null,!1);S[i]=e,m?w(m,[t,o]):o()},clone(e){let a=fr(e,t,n,r,i);return i&&i(a),a}};return T}function pr(e){if(wr(e))return e=wa(e),e.children=null,e}function mr(e){if(!wr(e))return Kn(e.type)&&e.children?lr(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&h(n.default))return n.default()}}function hr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,hr(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function gr(e,t=!1,n){let r=[],i=0;for(let a=0;a1)for(let e=0;exr(e,n&&(d(n)?n[t]:n),r,a,o));return}if(Cr(a)&&!o){a.shapeFlag&512&&a.type.__asyncResolved&&a.component.subTree.component&&xr(e,n,r,a.component.subTree);return}let s=a.shapeFlag&4?Ya(a.component):a.el,l=o?null:s,{i:f,r:p}=e,m=n&&n.r,_=f.refs===t?f.refs={}:f.refs,v=f.setupState,y=I(v),b=v===t?i:e=>yr(_,e)?!1:u(y,e),x=(e,t)=>!(t&&yr(_,t));if(m!=null&&m!==p){if(Sr(n),g(m))_[m]=null,b(m)&&(v[m]=null);else if(R(m)){let e=n;x(m,e.k)&&(m.value=null),e.k&&(_[e.k]=null)}}if(h(p))pn(p,f,12,[l,_]);else{let t=g(p),n=R(p);if(t||n){let i=()=>{if(e.f){let n=t?b(p)?v[p]:_[p]:x(p)||!e.k?p.value:_[e.k];if(o)d(n)&&c(n,s);else if(d(n))n.includes(s)||n.push(s);else if(t)_[p]=[s],b(p)&&(v[p]=_[p]);else{let t=[s];x(p,e.k)&&(p.value=t),e.k&&(_[e.k]=t)}}else t?(_[p]=l,b(p)&&(v[p]=l)):n&&(x(p,e.k)&&(p.value=l),e.k&&(_[e.k]=l))};if(l){let t=()=>{i(),br.delete(e)};t.id=-1,br.set(e,t),K(t,r)}else Sr(e),i()}}}function Sr(e){let t=br.get(e);t&&(t.flags|=8,br.delete(e))}le().requestIdleCallback,le().cancelIdleCallback;var Cr=e=>!!e.type.__asyncLoader,wr=e=>e.type.__isKeepAlive;function Tr(e,t){Dr(e,`a`,t)}function Er(e,t){Dr(e,`da`,t)}function Dr(e,t,n=$){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(kr(t,r,n),n){let e=n.parent;for(;e&&e.parent;)wr(e.parent.vnode)&&Or(r,t,n,e),e=e.parent}}function Or(e,t,n,r){let i=kr(t,e,r,!0);Ir(()=>{c(r[t],i)},n)}function kr(e,t,n=$,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{Ge();let i=La(n),a=z(t,n,e,r);return i(),Ke(),a};return r?i.unshift(a):i.push(a),a}}var Ar=e=>(t,n=$)=>{(!Ba||e===`sp`)&&kr(e,(...e)=>t(...e),n)},jr=Ar(`bm`),Mr=Ar(`m`),Nr=Ar(`bu`),Pr=Ar(`u`),Fr=Ar(`bum`),Ir=Ar(`um`),Lr=Ar(`sp`),Rr=Ar(`rtg`),zr=Ar(`rtc`);function Br(e,t=$){kr(`ec`,e,t)}var Vr=`components`;function Hr(e,t){return Gr(Vr,e,!0,t)||e}var Ur=Symbol.for(`v-ndc`);function Wr(e){return g(e)?Gr(Vr,e,!1)||e:e||Ur}function Gr(e,t,n=!0,r=!1){let i=H||$;if(i){let n=i.type;if(e===Vr){let e=Xa(n,!1);if(e&&(e===t||e===E(t)||e===re(E(t))))return n}let a=Kr(i[e]||n[e],t)||Kr(i.appContext[e],t);return!a&&r?n:a}}function Kr(e,t){return e&&(e[t]||e[E(t)]||e[re(E(t))])}function qr(e,t,n,r){let i,a=n&&n[r],o=d(e);if(o||g(e)){let n=o&&Vt(e),r=!1,s=!1;n&&(r=!F(e),s=Ht(e),e=at(e)),i=Array(e.length);for(let n=0,o=e.length;nt(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r0;return t!==`default`&&(n.name=t),ua(),ga(q,null,[X(`slot`,n,r&&r())],e?-2:64)}let a=e[t];a&&a._c&&(a._d=!1),ua();let o=a&&Yr(a(n)),s=n.key||o&&o.key,c=ga(q,{key:(s&&!_(s)?s:`_${t}`)+(!o&&r?`_fb`:``)},o||(r?r():[]),o&&e._===1?64:-2);return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),a&&a._c&&(a._d=!0),c}function Yr(e){return e.some(e=>_a(e)?!(e.type===J||e.type===q&&!Yr(e.children)):!0)?e:null}var Xr=e=>e?za(e)?Ya(e):Xr(e.parent):null,Zr=s(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Xr(e.parent),$root:e=>Xr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>oi(e),$forceUpdate:e=>e.f||=()=>{Cn(e.update)},$nextTick:e=>e.n||=xn.bind(e.proxy),$watch:e=>Hn.bind(e)}),Qr=(e,n)=>e!==t&&!e.__isScriptSetup&&u(e,n),$r={get({_:e},n){if(n===`__v_skip`)return!0;let{ctx:r,setupState:i,data:a,props:o,accessCache:s,type:c,appContext:l}=e;if(n[0]!==`$`){let e=s[n];if(e!==void 0)switch(e){case 1:return i[n];case 2:return a[n];case 4:return r[n];case 3:return o[n]}else if(Qr(i,n))return s[n]=1,i[n];else if(a!==t&&u(a,n))return s[n]=2,a[n];else if(u(o,n))return s[n]=3,o[n];else if(r!==t&&u(r,n))return s[n]=4,r[n];else ti&&(s[n]=0)}let d=Zr[n],f,p;if(d)return n===`$attrs`&&N(e.attrs,`get`,``),d(e);if((f=c.__cssModules)&&(f=f[n]))return f;if(r!==t&&u(r,n))return s[n]=4,r[n];if(p=l.config.globalProperties,u(p,n))return p[n]},set({_:e},n,r){let{data:i,setupState:a,ctx:o}=e;return Qr(a,n)?(a[n]=r,!0):i!==t&&u(i,n)?(i[n]=r,!0):u(e.props,n)||n[0]===`$`&&n.slice(1)in e?!1:(o[n]=r,!0)},has({_:{data:e,setupState:n,accessCache:r,ctx:i,appContext:a,props:o,type:s}},c){let l;return!!(r[c]||e!==t&&c[0]!==`$`&&u(e,c)||Qr(n,c)||u(o,c)||u(i,c)||u(Zr,c)||u(a.config.globalProperties,c)||(l=s.__cssModules)&&l[c])},defineProperty(e,t,n){return n.get==null?u(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};function ei(e){return d(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}var ti=!0;function ni(e){let t=oi(e),n=e.proxy,i=e.ctx;ti=!1,t.beforeCreate&&ii(t.beforeCreate,e,`bc`);let{data:a,computed:o,methods:s,watch:c,provide:l,inject:u,created:f,beforeMount:p,mounted:m,beforeUpdate:g,updated:_,activated:y,deactivated:b,beforeDestroy:x,beforeUnmount:S,destroyed:C,unmounted:w,render:T,renderTracked:ee,renderTriggered:te,errorCaptured:E,serverPrefetch:ne,expose:D,inheritAttrs:re,components:ie,directives:O,filters:ae}=t;if(u&&ri(u,i,null),s)for(let e in s){let t=s[e];h(t)&&(i[e]=t.bind(n))}if(a){let t=a.call(n,n);v(t)&&(e.data=Lt(t))}if(ti=!0,o)for(let e in o){let t=o[e],a=Qa({get:h(t)?t.bind(n,n):h(t.get)?t.get.bind(n,n):r,set:!h(t)&&h(t.set)?t.set.bind(n):r});Object.defineProperty(i,e,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(c)for(let e in c)ai(c[e],i,n,e);if(l){let e=h(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{Fn(t,e[t])})}f&&ii(f,e,`c`);function k(e,t){d(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(k(jr,p),k(Mr,m),k(Nr,g),k(Pr,_),k(Tr,y),k(Er,b),k(Br,E),k(zr,ee),k(Rr,te),k(Fr,S),k(Ir,w),k(Lr,ne),d(D))if(D.length){let t=e.exposed||={};D.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={};T&&e.render===r&&(e.render=T),re!=null&&(e.inheritAttrs=re),ie&&(e.components=ie),O&&(e.directives=O),ne&&vr(e)}function ri(e,t,n=r){d(e)&&(e=di(e));for(let n in e){let r=e[n],i;i=v(r)?`default`in r?In(r.from||n,r.default,!0):In(r.from||n):In(r),R(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function ii(e,t,n){z(d(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function ai(e,t,n,r){let i=r.includes(`.`)?Un(n,r):()=>n[r];if(g(e)){let n=t[e];h(n)&&Bn(i,n)}else if(h(e))Bn(i,e.bind(n));else if(v(e))if(d(e))e.forEach(e=>ai(e,t,n,r));else{let r=h(e.handler)?e.handler.bind(n):t[e.handler];h(r)&&Bn(i,r,e)}}function oi(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>si(c,e,o,!0)),si(c,t,o)),v(t)&&a.set(t,c),c}function si(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&si(e,a,n,!0),i&&i.forEach(t=>si(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=ci[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var ci={data:li,props:pi,emits:pi,methods:fi,computed:fi,beforeCreate:G,created:G,beforeMount:G,mounted:G,beforeUpdate:G,updated:G,beforeDestroy:G,beforeUnmount:G,destroyed:G,unmounted:G,activated:G,deactivated:G,errorCaptured:G,serverPrefetch:G,components:fi,directives:fi,watch:mi,provide:li,inject:ui};function li(e,t){return t?e?function(){return s(h(e)?e.call(this,this):e,h(t)?t.call(this,this):t)}:t:e}function ui(e,t){return fi(di(e),di(t))}function di(e){if(d(e)){let t={};for(let n=0;nt===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${E(t)}Modifiers`]||e[`${D(t)}Modifiers`];function bi(e,n,...r){if(e.isUnmounted)return;let i=e.vnode.props||t,a=r,o=n.startsWith(`update:`),s=o&&yi(i,n.slice(7));s&&(s.trim&&(a=r.map(e=>g(e)?e.trim():e)),s.number&&(a=r.map(oe)));let c,l=i[c=ie(n)]||i[c=ie(E(n))];!l&&o&&(l=i[c=ie(D(n))]),l&&z(l,e,6,a);let u=i[c+`Once`];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,z(u,e,6,a)}}var xi=new WeakMap;function Si(e,t,n=!1){let r=n?xi:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},c=!1;if(!h(e)){let r=e=>{let n=Si(e,t,!0);n&&(c=!0,s(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!c?(v(e)&&r.set(e,null),null):(d(a)?a.forEach(e=>o[e]=null):s(o,a),v(e)&&r.set(e,o),o)}function Ci(e,t){return!e||!a(t)?!1:(t=t.slice(2).replace(/Once$/,``),u(e,t[0].toLowerCase()+t.slice(1))||u(e,D(t))||u(e,t))}function wi(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:s,attrs:c,emit:l,render:u,renderCache:d,props:f,data:p,setupState:m,ctx:h,inheritAttrs:g}=e,_=jn(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=Z(u.call(t,e,d,f,m,p,h)),y=c}else{let e=t;v=Z(e.length>1?e(f,{attrs:c,slots:s,emit:l}):e(f,null)),y=t.props?c:Ti(c)}}catch(t){la.length=0,mn(t,e,1),v=X(J)}let b=v;if(y&&g!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(o)&&(y=Ei(y,a)),b=wa(b,y,!1,!0))}return n.dirs&&(b=wa(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&hr(b,n.transition),v=b,jn(_),v}var Ti=e=>{let t;for(let n in e)(n===`class`||n===`style`||a(n))&&((t||={})[n]=e[n]);return t},Ei=(e,t)=>{let n={};for(let r in e)(!o(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Di(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Oi(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;tObject.create(ji),Ni=e=>Object.getPrototypeOf(e)===ji;function Pi(e,t,n,r=!1){let i={},a=Mi();e.propsDefaults=Object.create(null),Ii(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);n?e.props=r?i:Rt(i):e.type.props?e.props=i:e.props=a,e.attrs=a}function Fi(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=I(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r{p=!0;let[t,n]=zi(e,r,!0);s(l,t),n&&f.push(...n)};!i&&r.mixins.length&&r.mixins.forEach(t),e.extends&&t(e.extends),e.mixins&&e.mixins.forEach(t)}if(!c&&!p)return v(e)&&a.set(e,n),n;if(d(c))for(let e=0;ee===`_`||e===`_ctx`||e===`$stable`,Hi=e=>d(e)?e.map(Z):[Z(e)],Ui=(e,t,n)=>{if(t._n)return t;let r=Mn((...e)=>Hi(t(...e)),n);return r._c=!1,r},Wi=(e,t,n)=>{let r=e._ctx;for(let n in e){if(Vi(n))continue;let i=e[n];if(h(i))t[n]=Ui(n,i,r);else if(i!=null){let e=Hi(i);t[n]=()=>e}}},Gi=(e,t)=>{let n=Hi(t);e.slots.default=()=>n},Ki=(e,t,n)=>{for(let r in t)(n||!Vi(r))&&(e[r]=t[r])},qi=(e,t,n)=>{let r=e.slots=Mi();if(e.vnode.shapeFlag&32){let e=t._;e?(Ki(r,t,n),n&&k(r,`_`,e,!0)):Wi(t,r)}else t&&Gi(e,t)},Ji=(e,n,r)=>{let{vnode:i,slots:a}=e,o=!0,s=t;if(i.shapeFlag&32){let e=n._;e?r&&e===1?o=!1:Ki(a,n,r):(o=!n.$stable,Wi(n,a)),s=n}else n&&(Gi(e,n),s={default:1});if(o)for(let e in a)!Vi(e)&&s[e]==null&&delete a[e]},K=oa;function Yi(e){return Xi(e)}function Xi(e,i){let a=le();a.__VUE__=!0;let{insert:o,remove:s,patchProp:c,createElement:l,createText:u,createComment:d,setText:f,setElementText:p,parentNode:m,nextSibling:h,setScopeId:g=r,insertStaticContent:_}=e,v=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!va(e,t)&&(r=ye(e),me(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case sa:y(e,t,n,r);break;case J:b(e,t,n,r);break;case ca:e??x(t,n,r,o);break;case q:ie(e,t,n,r,i,a,o,s,c);break;default:d&1?w(e,t,n,r,i,a,o,s,c):d&6?O(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,Se)}u!=null&&i?xr(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&xr(e.ref,null,a,e,!0)},y=(e,t,n,r)=>{if(e==null)o(t.el=u(t.children),n,r);else{let n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},b=(e,t,n,r)=>{e==null?o(t.el=d(t.children||``),n,r):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=({el:e,anchor:t},n,r)=>{let i;for(;e&&e!==t;)i=h(e),o(e,n,r),e=i;o(t,n,r)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),s(e),e=n;s(t)},w=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)ee(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),ne(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},ee=(e,t,n,r,i,a,s,u)=>{let d,f,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(d=e.el=l(e.type,a,m&&m.is,m),h&8?p(d,e.children):h&16&&E(e.children,d,null,r,i,Zi(e,a),s,u),_&&Pn(e,null,r,`created`),te(d,e,e.scopeId,s,r),m){for(let e in m)e!==`value`&&!T(e)&&c(d,e,null,m[e],a,r);`value`in m&&c(d,`value`,null,m.value,a),(f=m.onVnodeBeforeMount)&&Q(f,r,e)}_&&Pn(e,null,r,`beforeMount`);let v=$i(i,g);v&&g.beforeEnter(d),o(d,t,n),((f=m&&m.onVnodeMounted)||v||_)&&K(()=>{try{f&&Q(f,r,e),v&&g.enter(d),_&&Pn(e,null,r,`mounted`)}finally{}},i)},te=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t{for(let l=c;l{let l=n.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:f}=n;u|=e.patchFlag&16;let m=e.props||t,h=n.props||t,g;if(r&&Qi(r,!1),(g=h.onVnodeBeforeUpdate)&&Q(g,r,n,e),f&&Pn(n,e,r,`beforeUpdate`),r&&Qi(r,!0),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&p(l,``),d?D(e.dynamicChildren,d,l,r,i,Zi(n,a),o):s||ue(e,n,l,null,r,i,Zi(n,a),o,!1),u>0){if(u&16)re(l,m,h,r,a);else if(u&2&&m.class!==h.class&&c(l,`class`,null,h.class,a),u&4&&c(l,`style`,m.style,h.style,a),u&8){let e=n.dynamicProps;for(let t=0;t{g&&Q(g,r,n,e),f&&Pn(n,e,r,`updated`)},i)},D=(e,t,n,r,i,a,o)=>{for(let s=0;s{if(n!==r){if(n!==t)for(let t in n)!T(t)&&!(t in r)&&c(e,t,n[t],null,a,i);for(let t in r){if(T(t))continue;let o=r[t],s=n[t];o!==s&&t!==`value`&&c(e,t,s,o,a,i)}`value`in r&&c(e,`value`,n.value,r.value,a)}},ie=(e,t,n,r,i,a,s,c,l)=>{let d=t.el=e?e.el:u(``),f=t.anchor=e?e.anchor:u(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(c=c?c.concat(h):h),e==null?(o(d,n,r),o(f,n,r),E(t.children||[],n,f,i,a,s,c,l)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(D(e.dynamicChildren,m,n,i,a,s,c),(t.key!=null||i&&t===i.subTree)&&ea(e,t,!0)):ue(e,t,n,f,i,a,s,c,l)},O=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):k(t,n,r,i,a,o,c):oe(e,t,c)},k=(e,t,n,r,i,a,o)=>{let s=e.component=Na(e,r,i);if(wr(e)&&(s.ctx.renderer=Se),Va(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,se,o),!e.el){let r=s.subTree=X(J);b(null,r,t,n),e.placeholder=r.el}}else se(s,e,t,n,i,a,o)},oe=(e,t,n)=>{let r=t.component=e.component;if(Di(e,t,n))if(r.asyncDep&&!r.asyncResolved){ce(r,t,n);return}else r.next=t,r.update();else t.el=e.el,r.vnode=t},se=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=na(e);if(n){t&&(t.el=c.el,ce(e,t,o)),n.asyncDep.then(()=>{K(()=>{e.isUnmounted||l()},i)});return}}let u=t,d;Qi(e,!1),t?(t.el=c.el,ce(e,t,o)):t=c,n&&ae(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&Q(d,s,t,c),Qi(e,!0);let f=wi(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el),ye(p),e,i,a),t.el=f.el,u===null&&Ai(e,f.el),r&&K(r,i),(d=t.props&&t.props.onVnodeUpdated)&&K(()=>Q(d,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Cr(t);if(Qi(e,!1),l&&ae(l),!m&&(o=c&&c.onVnodeBeforeMount)&&Q(o,d,t),Qi(e,!0),s&&we){let t=()=>{e.subTree=wi(e),we(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=wi(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&K(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;K(()=>Q(o,d,e),i)}(t.shapeFlag&256||d&&Cr(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&K(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new je(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>Cn(u),Qi(e,!0),l()},ce=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,Fi(e,t.props,r,n),Ji(e,t.children,n),Ge(),En(e),Ke()},ue=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:m}=t;if(f>0){if(f&128){fe(l,d,n,r,i,a,o,s,c);return}else if(f&256){de(l,d,n,r,i,a,o,s,c);return}}m&8?(u&16&&ve(l,i,a),d!==l&&p(n,d)):u&16?m&16?fe(l,d,n,r,i,a,o,s,c):ve(l,i,a,!0):(u&8&&p(n,``),m&16&&E(d,n,r,i,a,o,s,c))},de=(e,t,r,i,a,o,s,c,l)=>{e||=n,t||=n;let u=e.length,d=t.length,f=Math.min(u,d),p;for(p=0;pd?ve(e,a,o,!0,!1,f):E(t,r,i,a,o,s,c,l,f)},fe=(e,t,r,i,a,o,s,c,l)=>{let u=0,d=t.length,f=e.length-1,p=d-1;for(;u<=f&&u<=p;){let n=e[u],i=t[u]=l?Oa(t[u]):Z(t[u]);if(va(n,i))v(n,i,r,null,a,o,s,c,l);else break;u++}for(;u<=f&&u<=p;){let n=e[f],i=t[p]=l?Oa(t[p]):Z(t[p]);if(va(n,i))v(n,i,r,null,a,o,s,c,l);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,n=ep)for(;u<=f;)me(e[u],a,o,!0),u++;else{let m=u,h=u,g=new Map;for(u=h;u<=p;u++){let e=t[u]=l?Oa(t[u]):Z(t[u]);e.key!=null&&g.set(e.key,u)}let _,y=0,b=p-h+1,x=!1,S=0,C=Array(b);for(u=0;u=b){me(n,a,o,!0);continue}let i;if(n.key!=null)i=g.get(n.key);else for(_=h;_<=p;_++)if(C[_-h]===0&&va(n,t[_])){i=_;break}i===void 0?me(n,a,o,!0):(C[i-h]=u+1,i>=S?S=i:x=!0,v(n,t[i],r,null,a,o,s,c,l),y++)}let w=x?ta(C):n;for(_=w.length-1,u=b-1;u>=0;u--){let e=h+u,n=t[e],f=t[e+1],p=e+1{let{el:a,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){pe(e.component.subTree,t,n,r);return}if(d&128){e.suspense.move(t,n,r);return}if(d&64){c.move(e,t,n,Se);return}if(c===q){o(a,t,n);for(let e=0;el.enter(a),i);else{let{leave:r,delayLeave:i,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?s(a):o(a,t,n)},d=()=>{a._isLeaving&&a[U](!0),r(a,()=>{u(),c&&c()})};i?i(a,u,d):d()}else o(a,t,n)},me=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null&&(Ge(),xr(s,null,n,e,!0),Ke()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!Cr(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&Q(_,t,e),u&6)_e(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&Pn(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,Se,r):l&&!l.hasOnce&&(a!==q||d>0&&d&64)?ve(l,t,n,!1,!0):(a===q&&d&384||!i&&u&16)&&ve(c,t,n),r&&he(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&K(()=>{_&&Q(_,t,e),h&&Pn(e,null,t,`unmounted`),v&&(e.el=null)},n)},he=e=>{let{type:t,el:n,anchor:r,transition:i}=e;if(t===q){ge(n,r);return}if(t===ca){C(e);return}let a=()=>{s(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(e.shapeFlag&1&&i&&!i.persisted){let{leave:t,delayLeave:r}=i,o=()=>t(n,a);r?r(e.el,a,o):o()}else a()},ge=(e,t)=>{let n;for(;e!==t;)n=h(e),s(e),e=n;s(t)},_e=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;ra(c),ra(l),r&&ae(r),i.stop(),a&&(a.flags|=8,me(o,e,t,n)),s&&K(s,t),K(()=>{e.isUnmounted=!0},t)},ve=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o{if(e.shapeFlag&6)return ye(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[Gn];return n?h(n):t},be=!1,xe=(e,t,n)=>{let r;e==null?t._vnode&&(me(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,be||=(be=!0,En(r),Dn(),!1)},Se={p:v,um:me,m:pe,r:he,mt:k,mc:E,pc:ue,pbc:D,n:ye,o:e},Ce,we;return i&&([Ce,we]=i(Se)),{render:xe,hydrate:Ce,createApp:_i(xe,Ce)}}function Zi({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function Qi({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function $i(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ea(e,t,n=!1){let r=e.children,i=t.children;if(d(r)&&d(i))for(let e=0;e>1,e[n[s]]0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-- >0;)n[a]=o,o=t[o];return n}function na(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:na(t)}function ra(e){if(e)for(let t=0;te.__isSuspense;function oa(e,t){t&&t.pendingBranch?d(e)?t.effects.push(...e):t.effects.push(e):Tn(e)}var q=Symbol.for(`v-fgt`),sa=Symbol.for(`v-txt`),J=Symbol.for(`v-cmt`),ca=Symbol.for(`v-stc`),la=[],Y=null;function ua(e=!1){la.push(Y=e?null:[])}function da(){la.pop(),Y=la[la.length-1]||null}var fa=1;function pa(e,t=!1){fa+=e,e<0&&Y&&t&&(Y.hasOnce=!0)}function ma(e){return e.dynamicChildren=fa>0?Y||n:null,da(),fa>0&&Y&&Y.push(e),e}function ha(e,t,n,r,i,a){return ma(xa(e,t,n,r,i,a,!0))}function ga(e,t,n,r,i){return ma(X(e,t,n,r,i,!0))}function _a(e){return e?e.__v_isVNode===!0:!1}function va(e,t){return e.type===t.type&&e.key===t.key}var ya=({key:e})=>e??null,ba=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:g(e)||R(e)||h(e)?{i:H,r:e,k:t,f:!!n}:e);function xa(e,t=null,n=null,r=0,i=null,a=e===q?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ya(t),ref:t&&ba(t),scopeId:An,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:H};return s?(ka(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=g(n)?8:16),fa>0&&!o&&Y&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&Y.push(c),c}var X=Sa;function Sa(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===Ur)&&(e=J),_a(e)){let r=wa(e,t,!0);return n&&ka(r,n),fa>0&&!a&&Y&&(r.shapeFlag&6?Y[Y.indexOf(e)]=r:Y.push(r)),r.patchFlag=-2,r}if(Za(e)&&(e=e.__vccOpts),t){t=Ca(t);let{class:e,style:n}=t;e&&!g(e)&&(t.class=he(e)),v(n)&&(Ut(n)&&!d(n)&&(n=s({},n)),t.style=ue(n))}let o=g(e)?1:aa(e)?128:Kn(e)?64:v(e)?4:h(e)?2:0;return xa(e,t,n,r,i,o,a,!0)}function Ca(e){return e?Ut(e)||Ni(e)?s({},e):e:null}function wa(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?Aa(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&ya(l),ref:t&&t.ref?n&&a?d(a)?a.concat(ba(t)):[a,ba(t)]:ba(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==q?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&wa(e.ssContent),ssFallback:e.ssFallback&&wa(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&hr(u,c.clone(u)),u}function Ta(e=` `,t=0){return X(sa,null,e,t)}function Ea(e,t){let n=X(ca,null,e);return n.staticCount=t,n}function Da(e=``,t=!1){return t?(ua(),ga(J,null,e)):X(J,null,e)}function Z(e){return e==null||typeof e==`boolean`?X(J):d(e)?X(q,null,e.slice()):_a(e)?Oa(e):X(sa,null,String(e))}function Oa(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:wa(e)}function ka(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(d(t))n=16;else if(typeof t==`object`)if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),ka(e,n()),n._c&&(n._d=!0));return}else{n=32;let r=t._;!r&&!Ni(t)?t._ctx=H:r===3&&H&&(H.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else h(t)?(t={default:t,_ctx:H},n=32):(t=String(t),r&64?(n=16,t=[Ta(t)]):n=8);e.children=t,e.shapeFlag|=n}function Aa(...e){let t={};for(let n=0;n$||H,Fa,Ia;{let e=le(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};Fa=t(`__VUE_INSTANCE_SETTERS__`,e=>$=e),Ia=t(`__VUE_SSR_SETTERS__`,e=>Ba=e)}var La=e=>{let t=$;return Fa(e),e.scope.on(),()=>{e.scope.off(),Fa(t)}},Ra=()=>{$&&$.scope.off(),Fa(null)};function za(e){return e.vnode.shapeFlag&4}var Ba=!1;function Va(e,t=!1,n=!1){t&&Ia(t);let{props:r,children:i}=e.vnode,a=za(e);Pi(e,r,a,t),qi(e,i,n||t);let o=a?Ha(e,t):void 0;return t&&Ia(!1),o}function Ha(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,$r);let{setup:r}=n;if(r){Ge();let n=e.setupContext=r.length>1?Ja(e):null,i=La(e),a=pn(r,e,0,[e.props,n]),o=y(a);if(Ke(),i(),(o||e.sp)&&!Cr(e)&&vr(e),o){if(a.then(Ra,Ra),t)return a.then(n=>{Ua(e,n,t)}).catch(t=>{mn(t,e,0)});e.asyncDep=a}else Ua(e,a,t)}else Ka(e,t)}function Ua(e,t,n){h(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:v(t)&&(e.setupState=Qt(t)),Ka(e,n)}var Wa,Ga;function Ka(e,t,n){let i=e.type;if(!e.render){if(!t&&Wa&&!i.render){let t=i.template||oi(e).template;if(t){let{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:a,compilerOptions:o}=i;i.render=Wa(t,s(s({isCustomElement:n,delimiters:a},r),o))}}e.render=i.render||r,Ga&&Ga(e)}{let t=La(e);Ge();try{ni(e)}finally{Ke(),t()}}}var qa={get(e,t){return N(e,`get`,``),e[t]}};function Ja(e){return{attrs:new Proxy(e.attrs,qa),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function Ya(e){return e.exposed?e.exposeProxy||=new Proxy(Qt(Wt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Zr)return Zr[n](e)},has(e,t){return t in e||t in Zr}}):e.proxy}function Xa(e,t=!0){return h(e)?e.displayName||e.name:e.name||t&&e.__name}function Za(e){return h(e)&&`__vccOpts`in e}var Qa=(e,t)=>on(e,t,Ba);function $a(e,t,n){try{pa(-1);let r=arguments.length;return r===2?v(t)&&!d(t)?_a(t)?X(e,null,[t]):X(e,t):X(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&_a(n)&&(n=[n]),X(e,t,n))}finally{pa(1)}}var eo=`3.5.33`,to=void 0,no=typeof window<`u`&&window.trustedTypes;if(no)try{to=no.createPolicy(`vue`,{createHTML:e=>e})}catch{}var ro=to?e=>to.createHTML(e):e=>e,io=`http://www.w3.org/2000/svg`,ao=`http://www.w3.org/1998/Math/MathML`,oo=typeof document<`u`?document:null,so=oo&&oo.createElement(`template`),co={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?oo.createElementNS(io,e):t===`mathml`?oo.createElementNS(ao,e):n?oo.createElement(e,{is:n}):oo.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>oo.createTextNode(e),createComment:e=>oo.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>oo.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{so.innerHTML=ro(r===`svg`?`${e}`:r===`mathml`?`${e}`:e);let i=so.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},lo=`transition`,uo=`animation`,fo=Symbol(`_vtc`),po={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},mo=s({},or,po),ho=(e=>(e.displayName=`Transition`,e.props=mo,e))((e,{slots:t})=>$a(ur,vo(e),t)),go=(e,t=[])=>{d(e)?e.forEach(e=>e(...t)):e&&e(...t)},_o=e=>e?d(e)?e.some(e=>e.length>1):e.length>1:!1;function vo(e){let t={};for(let n in e)n in po||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:c=`${n}-enter-to`,appearFromClass:l=a,appearActiveClass:u=o,appearToClass:d=c,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=e,h=yo(i),g=h&&h[0],_=h&&h[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:b,onLeave:x,onLeaveCancelled:S,onBeforeAppear:C=v,onAppear:w=y,onAppearCancelled:T=b}=t,ee=(e,t,n,r)=>{e._enterCancelled=r,So(e,t?d:c),So(e,t?u:o),n&&n()},te=(e,t)=>{e._isLeaving=!1,So(e,f),So(e,m),So(e,p),t&&t()},E=e=>(t,n)=>{let i=e?w:y,o=()=>ee(t,e,n);go(i,[t,o]),Co(()=>{So(t,e?l:a),xo(t,e?d:c),_o(i)||To(t,r,g,o)})};return s(t,{onBeforeEnter(e){go(v,[e]),xo(e,a),xo(e,o)},onBeforeAppear(e){go(C,[e]),xo(e,l),xo(e,u)},onEnter:E(!1),onAppear:E(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>te(e,t);xo(e,f),e._enterCancelled?(xo(e,p),ko(e)):(ko(e),xo(e,p)),Co(()=>{e._isLeaving&&(So(e,f),xo(e,m),_o(x)||To(e,r,_,n))}),go(x,[e,n])},onEnterCancelled(e){ee(e,!1,void 0,!0),go(b,[e])},onAppearCancelled(e){ee(e,!0,void 0,!0),go(T,[e])},onLeaveCancelled(e){te(e),go(S,[e])}})}function yo(e){if(e==null)return null;if(v(e))return[bo(e.enter),bo(e.leave)];{let t=bo(e);return[t,t]}}function bo(e){return se(e)}function xo(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[fo]||(e[fo]=new Set)).add(t)}function So(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[fo];n&&(n.delete(t),n.size||(e[fo]=void 0))}function Co(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var wo=0;function To(e,t,n,r){let i=e._endId=++wo,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=Eo(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u(n[e]||``).split(`, `),i=r(`${lo}Delay`),a=r(`${lo}Duration`),o=Do(i,a),s=r(`${uo}Delay`),c=r(`${uo}Duration`),l=Do(s,c),u=null,d=0,f=0;t===lo?o>0&&(u=lo,d=o,f=a.length):t===uo?l>0&&(u=uo,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?lo:uo:null,f=u?u===lo?a.length:c.length:0);let p=u===lo&&/\b(?:transform|all)(?:,|$)/.test(r(`${lo}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function Do(e,t){for(;e.lengthOo(t)+Oo(e[n])))}function Oo(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function ko(e){return(e?e.ownerDocument:document).body.offsetHeight}function Ao(e,t,n){let r=e[fo];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var jo=Symbol(`_vod`),Mo=Symbol(`_vsh`),No=Symbol(``),Po=/(?:^|;)\s*display\s*:/;function Fo(e,t,n){let r=e.style,i=g(n),a=!1;if(n&&!i){if(t)if(g(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Lo(r,t,``)}else for(let e in t)n[e]??Lo(r,e,``);for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Lo(r,i,``):Vo(e,i,!g(t)&&t?t[i]:void 0,o)||Lo(r,i,o)}}else if(i){if(t!==n){let e=r[No];e&&(n+=`;`+e),r.cssText=n,a=Po.test(n)}}else t&&e.removeAttribute(`style`);jo in e&&(e[jo]=a?r.display:``,e[Mo]&&(r.display=`none`))}var Io=/\s*!important$/;function Lo(e,t,n){if(d(n))n.forEach(n=>Lo(e,t,n));else if(n??=``,t.startsWith(`--`))e.setProperty(t,n);else{let r=Bo(e,t);Io.test(n)?e.setProperty(D(r),n.replace(Io,``),`important`):e[r]=n}}var Ro=[`Webkit`,`Moz`,`ms`],zo={};function Bo(e,t){let n=zo[t];if(n)return n;let r=E(t);if(r!==`filter`&&r in e)return zo[t]=r;r=re(r);for(let n=0;nZo||=(Qo.then(()=>Zo=0),Date.now());function es(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;z(ts(e,n.value),t,5,[e])};return n.value=e,n.attached=$o(),n}function ts(e,t){if(d(t)){let n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}else return t}var ns=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,rs=(e,t,n,r,i,s)=>{let c=i===`svg`;t===`class`?Ao(e,r,c):t===`style`?Fo(e,n,r):a(t)?o(t)||Jo(e,t,n,r,s):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):is(e,t,r,c))?(Wo(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&Uo(e,t,r,c,s,t!==`value`)):e._isVueCE&&(as(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!g(r)))?Wo(e,E(t),r,s,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),Uo(e,t,r,c))};function is(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&ns(t)&&h(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return ns(t)&&g(n)?!1:t in e}function as(e,t){let n=e._def.props;if(!n)return!1;let r=E(t);return Array.isArray(n)?n.some(e=>E(e)===r):Object.keys(n).some(e=>E(e)===r)}var os=new WeakMap,ss=new WeakMap,cs=Symbol(`_moveCb`),ls=Symbol(`_enterCb`),us=(e=>(delete e.props.mode,e))({name:`TransitionGroup`,props:s({},mo,{tag:String,moveClass:String}),setup(e,{slots:t}){let n=Pa(),r=ar(),i,a;return Pr(()=>{if(!i.length)return;let t=e.moveClass||`${e.name||`v`}-move`;if(!hs(i[0].el,n.vnode.el,t)){i=[];return}i.forEach(ds),i.forEach(fs);let r=i.filter(ps);ko(n.vnode.el),r.forEach(e=>{let n=e.el,r=n.style;xo(n,t),r.transform=r.webkitTransform=r.transitionDuration=``;let i=n[cs]=e=>{e&&e.target!==n||(!e||e.propertyName.endsWith(`transform`))&&(n.removeEventListener(`transitionend`,i),n[cs]=null,So(n,t))};n.addEventListener(`transitionend`,i)}),i=[]}),()=>{let o=I(e),s=vo(o),c=o.tag||q;if(i=[],a)for(let e=0;e{e.split(/\s+/).forEach(e=>e&&r.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&r.classList.add(e)),r.style.display=`none`;let a=t.nodeType===1?t:t.parentNode;a.appendChild(r);let{hasTransform:o}=Eo(r);return a.removeChild(r),o}var gs=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return d(t)?e=>ae(t,e):t};function _s(e){e.target.composing=!0}function vs(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var ys=Symbol(`_assign`);function bs(e,t,n){return t&&(e=e.trim()),n&&(e=oe(e)),e}var xs={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[ys]=gs(i);let a=r||i.props&&i.props.type===`number`;Go(e,t?`change`:`input`,t=>{t.target.composing||e[ys](bs(e.value,n,a))}),(n||a)&&Go(e,`change`,()=>{e.value=bs(e.value,n,a)}),t||(Go(e,`compositionstart`,_s),Go(e,`compositionend`,vs),Go(e,`change`,vs))},mounted(e,{value:t}){e.value=t??``},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[ys]=gs(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?oe(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},Ss={deep:!0,created(e,t,n){e[ys]=gs(n),Go(e,`change`,()=>{let t=e._modelValue,n=Es(e),r=e.checked,i=e[ys];if(d(t)){let e=xe(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(p(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(Ds(e,r))})},mounted:Cs,beforeUpdate(e,t,n){e[ys]=gs(n),Cs(e,t,n)}};function Cs(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(d(t))i=xe(t,r.props.value)>-1;else if(p(t))i=t.has(r.props.value);else{if(t===n)return;i=be(t,Ds(e,!0))}e.checked!==i&&(e.checked=i)}var ws={deep:!0,created(e,{value:t,modifiers:{number:n}},r){let i=p(t);Go(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?oe(Es(e)):Es(e));e[ys](e.multiple?i?new Set(t):t:t[0]),e._assigning=!0,xn(()=>{e._assigning=!1})}),e[ys]=gs(r)},mounted(e,{value:t}){Ts(e,t)},beforeUpdate(e,t,n){e[ys]=gs(n)},updated(e,{value:t}){e._assigning||Ts(e,t)}};function Ts(e,t){let n=e.multiple,r=d(t);if(!(n&&!r&&!p(t))){for(let i=0,a=e.options.length;iString(e)===String(o)):a.selected=xe(t,o)>-1}else a.selected=t.has(o);else if(be(Es(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Es(e){return`_value`in e?e._value:e.value}function Ds(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var Os=[`ctrl`,`shift`,`alt`,`meta`],ks={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>Os.some(n=>e[`${n}Key`]&&!t.includes(n))},As=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=D(n.key);if(t.some(e=>e===r||js[e]===r))return e(n)}))},Ns=s({patchProp:rs},co),Ps;function Fs(){return Ps||=Yi(Ns)}var Is=((...e)=>{let t=Fs().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Rs(e);if(!r)return;let i=t._component;!h(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Ls(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function Ls(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function Rs(e){return g(e)?document.querySelector(e):e}var zs=typeof window<`u`,Bs,Vs=e=>Bs=e,Hs=Symbol();function Us(e){return e&&typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`&&typeof e.toJSON!=`function`}var Ws;(function(e){e.direct=`direct`,e.patchObject=`patch object`,e.patchFunction=`patch function`})(Ws||={});var Gs=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:typeof globalThis==`object`?globalThis:{HTMLElement:null};function Ks(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function qs(e,t,n){let r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){Qs(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function Js(e){let t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function Ys(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window,detail:0,screenX:80,screenY:20,clientX:80,clientY:20,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});e.dispatchEvent(t)}}var Xs=typeof navigator==`object`?navigator:{userAgent:``},Zs=/Macintosh/.test(Xs.userAgent)&&/AppleWebKit/.test(Xs.userAgent)&&!/Safari/.test(Xs.userAgent),Qs=zs?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!Zs?$s:`msSaveOrOpenBlob`in Xs?ec:tc:()=>{};function $s(e,t=`download`,n){let r=document.createElement(`a`);r.download=t,r.rel=`noopener`,typeof e==`string`?(r.href=e,r.origin===location.origin?Ys(r):Js(r.href)?qs(e,t,n):(r.target=`_blank`,Ys(r))):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){Ys(r)},0))}function ec(e,t=`download`,n){if(typeof e==`string`)if(Js(e))qs(e,t,n);else{let t=document.createElement(`a`);t.href=e,t.target=`_blank`,setTimeout(function(){Ys(t)})}else navigator.msSaveOrOpenBlob(Ks(e,n),t)}function tc(e,t,n,r){if(r||=open(``,`_blank`),r&&(r.document.title=r.document.body.innerText=`downloading...`),typeof e==`string`)return qs(e,t,n);let i=e.type===`application/octet-stream`,a=/constructor/i.test(String(Gs.HTMLElement))||`safari`in Gs,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a||Zs)&&typeof FileReader<`u`){let t=new FileReader;t.onloadend=function(){let e=t.result;if(typeof e!=`string`)throw r=null,Error(`Wrong reader.result type`);e=o?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),r?r.location.href=e:location.assign(e),r=null},t.readAsDataURL(e)}else{let t=URL.createObjectURL(e);r?r.location.assign(t):location.href=t,r=null,setTimeout(function(){URL.revokeObjectURL(t)},4e4)}}var{assign:nc}=Object;function rc(){let e=De(!0),t=e.run(()=>Kt({})),n=[],r=[],i=Wt({install(e){Vs(i),i._a=e,e.provide(Hs,i),e.config.globalProperties.$pinia=i,r.forEach(e=>n.push(e)),r=[]},use(e){return this._a?n.push(e):r.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}var ic=()=>{};function ac(e,t,n,r=ic){e.add(t);let i=()=>{e.delete(t)&&r()};return!n&&Oe()&&ke(i),i}function oc(e,...t){e.forEach(e=>{e(...t)})}var sc=e=>e(),cc=Symbol(),lc=Symbol();function uc(e,t){e instanceof Map&&t instanceof Map?t.forEach((t,n)=>e.set(n,t)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(let n in t){if(!t.hasOwnProperty(n))continue;let r=t[n],i=e[n];Us(i)&&Us(r)&&e.hasOwnProperty(n)&&!R(r)&&!Vt(r)?e[n]=uc(i,r):e[n]=r}return e}var dc=Symbol();function fc(e){return!Us(e)||!Object.prototype.hasOwnProperty.call(e,dc)}var{assign:pc}=Object;function mc(e){return!!(R(e)&&e.effect)}function hc(e,t,n,r){let{state:i,actions:a,getters:o}=t,s=n.state.value[e],c;function l(){return s||(n.state.value[e]=i?i():{}),pc($t(n.state.value[e]),a,Object.keys(o||{}).reduce((t,r)=>(t[r]=Wt(Qa(()=>{Vs(n);let t=n._s.get(e);return o[r].call(t,t)})),t),{}))}return c=gc(e,l,t,n,r,!0),c}function gc(e,t,n={},r,i,a){let o,s=pc({actions:{}},n),c={deep:!0},l,u,d=new Set,f=new Set,p=r.state.value[e];!a&&!p&&(r.state.value[e]={});let m;function h(t){let n;l=u=!1,typeof t==`function`?(t(r.state.value[e]),n={type:Ws.patchFunction,storeId:e,events:void 0}):(uc(r.state.value[e],t),n={type:Ws.patchObject,payload:t,storeId:e,events:void 0});let i=m=Symbol();xn().then(()=>{m===i&&(l=!0)}),u=!0,oc(d,n,r.state.value[e])}let g=a?function(){let{state:e}=n,t=e?e():{};this.$patch(e=>{pc(e,t)})}:ic;function _(){o.stop(),d.clear(),f.clear(),r._s.delete(e)}let v=(t,n=``)=>{if(cc in t)return t[lc]=n,t;let i=function(){Vs(r);let n=Array.from(arguments),a=new Set,o=new Set;function s(e){a.add(e)}function c(e){o.add(e)}oc(f,{args:n,name:i[lc],store:y,after:s,onError:c});let l;try{l=t.apply(this&&this.$id===e?this:y,n)}catch(e){throw oc(o,e),e}return l instanceof Promise?l.then(e=>(oc(a,e),e)).catch(e=>(oc(o,e),Promise.reject(e))):(oc(a,l),l)};return i[cc]=!0,i[lc]=n,i},y=Lt({_p:r,$id:e,$onAction:ac.bind(null,f),$patch:h,$reset:g,$subscribe(t,n={}){let i=ac(d,t,n.detached,()=>a()),a=o.run(()=>Bn(()=>r.state.value[e],r=>{(n.flush===`sync`?u:l)&&t({storeId:e,type:Ws.direct,events:void 0},r)},pc({},c,n)));return i},$dispose:_});r._s.set(e,y);let b=(r._a&&r._a.runWithContext||sc)(()=>r._e.run(()=>(o=De()).run(()=>t({action:v}))));for(let t in b){let n=b[t];R(n)&&!mc(n)||Vt(n)?a||(p&&fc(n)&&(R(n)?n.value=p[t]:uc(n,p[t])),r.state.value[e][t]=n):typeof n==`function`&&(b[t]=v(n,t),s.actions[t]=n)}return pc(y,b),pc(I(y),b),Object.defineProperty(y,`$state`,{get:()=>r.state.value[e],set:e=>{h(t=>{pc(t,e)})}}),r._p.forEach(e=>{pc(y,o.run(()=>e({store:y,app:r._a,pinia:r,options:s})))}),p&&a&&n.hydrate&&n.hydrate(y.$state,p),l=!0,u=!0,y}function _c(e,t,n){let r,i=typeof t==`function`;r=i?n:t;function a(n,a){let o=Ln();return n||=o?In(Hs,null):null,n&&Vs(n),n=Bs,n._s.has(e)||(i?gc(e,t,r,n):hc(e,r,n)),n._s.get(e)}return a.$id=e,a}function vc(e){let t=I(e),n={};for(let r in t){let i=t[r];i.effect?n[r]=Qa({get:()=>e[r],set(t){e[r]=t}}):(R(i)||Vt(i))&&(n[r]=nn(e,r))}return n}var yc=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n};export{Mr as A,Mn as B,_r as C,Aa as D,In as E,qr as F,qt as G,Lt as H,Jr as I,ue as J,Xt as K,Hr as L,Pr as M,ua as N,xn as O,Fn as P,Wr as R,X as S,$a as T,Kt as U,Nn as V,Rt as W,Ce as Y,ga as _,ho as a,Ea as b,Ss as c,Ms as d,As as f,xa as g,Qa as h,vc as i,Ir as j,Fr as k,ws as l,tr as m,rc as n,us as o,q as p,he as q,_c as r,Is as s,yc as t,xs as u,Da as v,Pa as w,Ta as x,ha as y,Bn as z}; \ No newline at end of file diff --git a/public/build/assets/index-BO5caB_f.js b/public/build/assets/index-DdJ5jHP4.js similarity index 50% rename from public/build/assets/index-BO5caB_f.js rename to public/build/assets/index-DdJ5jHP4.js index b4cdcfb..a8bec5c 100644 --- a/public/build/assets/index-BO5caB_f.js +++ b/public/build/assets/index-DdJ5jHP4.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomeView-BDJhYpJV.js","assets/_plugin-vue_export-helper-eepT72yB.js","assets/BaseBottomSheet-BMI-Oljh.js","assets/BaseBottomSheet-9_gNUOjo.css","assets/PullToRefresh-BEXU4J3A.js","assets/PullToRefresh-Dh6ArHZZ.css","assets/HomeView-f_EEqurX.css","assets/LibraryView-E5I_Q1_A.js","assets/DevicePicker-C6ucVR6N.js","assets/DevicePicker-B4xrdE2f.css","assets/LibraryView-jkY9po1z.css","assets/UploadView-CiBmd_8U.js","assets/UploadView-CH8tyGyv.css","assets/SettingsView-BuwptVaB.js","assets/SettingsView-Ce_UCsin.css"])))=>i.map(i=>d[i]); -import{A as e,C as t,D as n,G as r,H as i,I as a,J as o,K as s,M as c,N as l,O as u,P as d,R as f,S as p,T as m,U as h,V as g,W as _,_ as v,b as y,g as b,h as x,j as S,k as C,n as w,o as ee,p as te,r as ne,s as T,t as E,v as re,w as D,x as O,y as k,z as A}from"./_plugin-vue_export-helper-eepT72yB.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var j=Math.PI/180;function M(){return typeof window<`u`&&({}.toString.call(window)===`[object Window]`||{}.toString.call(window)===`[object global]`)}var ie=typeof global<`u`?global:typeof window<`u`?window:typeof WorkerGlobalScope<`u`?self:{},N={_global:ie,version:`10.3.0`,isBrowser:M(),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle(e){return N.angleDeg?e*j:e},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_renderBackend:`web`,legacyTextRendering:!1,pixelRatio:typeof window<`u`&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return N.DD.isDragging},isTransforming(){return N.Transformer?.isTransforming()??!1},isDragReady(){return!!N.DD.node},releaseCanvasOnDestroy:!0,document:ie.document,_injectGlobal(e){ie.Konva!==void 0&&console.error(`Several Konva instances detected. It is not recommended to use multiple Konva instances in the same environment.`),ie.Konva=e}},P=e=>{N[e.prototype.getClassName()]=e};N._injectGlobal(N);var ae=`Konva.js unsupported environment. +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomeView-BVevNXVc.js","assets/_plugin-vue_export-helper-BNDVmFr7.js","assets/BaseBottomSheet-Bsol3Sat.js","assets/BaseBottomSheet-9_gNUOjo.css","assets/PullToRefresh-CeDTOC7P.js","assets/PullToRefresh-Dh6ArHZZ.css","assets/HomeView-f_EEqurX.css","assets/LibraryView-BmJwebDM.js","assets/DevicePicker-1UBxnMbg.js","assets/DevicePicker-B4xrdE2f.css","assets/LibraryView-jkY9po1z.css","assets/UploadView-C0dEQPr3.js","assets/UploadView-CnlRrn7b.css","assets/SettingsView-DWXOcfNX.js","assets/SettingsView-DmUQdUmU.css"])))=>i.map(i=>d[i]); +import{A as e,B as t,C as n,E as r,F as i,G as a,H as o,K as s,L as c,M as l,N as u,O as d,P as f,S as p,T as m,U as h,W as g,Y as _,_ as v,g as y,h as b,j as x,k as S,n as C,o as w,p as ee,q as te,r as ne,s as T,t as E,v as re,w as D,x as ie,y as O,z as k}from"./_plugin-vue_export-helper-BNDVmFr7.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var A=Math.PI/180;function j(){return typeof window<`u`&&({}.toString.call(window)===`[object Window]`||{}.toString.call(window)===`[object global]`)}var ae=typeof global<`u`?global:typeof window<`u`?window:typeof WorkerGlobalScope<`u`?self:{},M={_global:ae,version:`10.3.0`,isBrowser:j(),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle(e){return M.angleDeg?e*A:e},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_renderBackend:`web`,legacyTextRendering:!1,pixelRatio:typeof window<`u`&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return M.DD.isDragging},isTransforming(){return M.Transformer?.isTransforming()??!1},isDragReady(){return!!M.DD.node},releaseCanvasOnDestroy:!0,document:ae.document,_injectGlobal(e){ae.Konva!==void 0&&console.error(`Several Konva instances detected. It is not recommended to use multiple Konva instances in the same environment.`),ae.Konva=e}},N=e=>{M[e.prototype.getClassName()]=e};M._injectGlobal(M);var oe=`Konva.js unsupported environment. Looks like you are trying to use Konva.js in Node.js environment. because "document" object is undefined. @@ -12,5 +12,5 @@ or bash: npm install skia-canvas js: import "konva/skia-backend"; -`,oe=()=>{if(typeof document>`u`)throw Error(ae)},F=class e{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new e(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){let t=this.m;return{x:t[0]*e.x+t[2]*e.y+t[4],y:t[1]*e.x+t[3]*e.y+t[5]}}translate(e,t){return this.m[4]+=this.m[0]*e+this.m[2]*t,this.m[5]+=this.m[1]*e+this.m[3]*t,this}scale(e,t){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=t,this.m[3]*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),r=this.m[0]*t+this.m[2]*n,i=this.m[1]*t+this.m[3]*n,a=this.m[0]*-n+this.m[2]*t,o=this.m[1]*-n+this.m[3]*t;return this.m[0]=r,this.m[1]=i,this.m[2]=a,this.m[3]=o,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,t){let n=this.m[0]+this.m[2]*t,r=this.m[1]+this.m[3]*t,i=this.m[2]+this.m[0]*e,a=this.m[3]+this.m[1]*e;return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=a,this}multiply(e){let t=this.m[0]*e.m[0]+this.m[2]*e.m[1],n=this.m[1]*e.m[0]+this.m[3]*e.m[1],r=this.m[0]*e.m[2]+this.m[2]*e.m[3],i=this.m[1]*e.m[2]+this.m[3]*e.m[3],a=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],o=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=i,this.m[4]=a,this.m[5]=o,this}invert(){let e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),t=this.m[3]*e,n=-this.m[1]*e,r=-this.m[2]*e,i=this.m[0]*e,a=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),o=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=i,this.m[4]=a,this.m[5]=o,this}getMatrix(){return this.m}decompose(){let e=this.m[0],t=this.m[1],n=this.m[2],r=this.m[3],i=this.m[4],a=this.m[5],o=e*r-t*n,s={x:i,y:a,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(e!=0||t!=0){let i=Math.sqrt(e*e+t*t);s.rotation=t>0?Math.acos(e/i):-Math.acos(e/i),s.scaleX=i,s.scaleY=o/i,s.skewX=(e*n+t*r)/o,s.skewY=0}else if(n!=0||r!=0){let i=Math.sqrt(n*n+r*r);s.rotation=Math.PI/2-(r>0?Math.acos(-n/i):-Math.acos(n/i)),s.scaleX=o/i,s.scaleY=i,s.skewX=0,s.skewY=(e*n+t*r)/o}return s.rotation=I._getRotation(s.rotation),s}},se=`[object Array]`,ce=`[object Number]`,le=`[object String]`,ue=`[object Boolean]`,de=Math.PI/180,fe=180/Math.PI,pe=`#`,me=``,he=`0`,ge=`Konva warning: `,_e=`Konva error: `,ve=`rgb(`,ye={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},be=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,xe=[],Se=null,Ce=typeof requestAnimationFrame<`u`&&requestAnimationFrame||function(e){setTimeout(e,16)},I={_isElement(e){return!!(e&&e.nodeType==1)},_isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject(e){return!!e&&e.constructor===Object},_isArray(e){return Object.prototype.toString.call(e)===se},_isNumber(e){return Object.prototype.toString.call(e)===ce&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===le},_isBoolean(e){return Object.prototype.toString.call(e)===ue},isObject(e){return e instanceof Object},isValidSelector(e){if(typeof e!=`string`)return!1;let t=e[0];return t===`#`||t===`.`||t===t.toUpperCase()},_sign(e){return e===0||e>0?1:-1},requestAnimFrame(e){xe.push(e),xe.length===1&&Ce(function(){let e=xe;xe=[],e.forEach(function(e){e()})})},createCanvasElement(){oe();let e=document.createElement(`canvas`);try{e.style=e.style||{}}catch{}return e},createImageElement(){return oe(),document.createElement(`img`)},_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){let n=I.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex(e,t,n){return((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)},_hexToRgb(e){e=e.replace(pe,me);let t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){let e=(Math.random()*16777215<<0).toString(16);for(;e.length<6;)e=he+e;return pe+e},isCanvasFarblingActive(){if(Se!==null)return Se;if(typeof document>`u`)return Se=!1,!1;let e=this.createCanvasElement();e.width=10,e.height=10;let t=e.getContext(`2d`,{willReadFrequently:!0});t.clearRect(0,0,10,10),t.fillStyle=`#282828`,t.fillRect(0,0,10,10);let n=t.getImageData(0,0,10,10).data,r=!1;for(let e=0;e<100;e++)if(n[e*4]!==40||n[e*4+1]!==40||n[e*4+2]!==40||n[e*4+3]!==255){r=!0;break}return Se=r,this.releaseCanvas(e),Se},getHitColor(){let e=this.getRandomColor();return this.isCanvasFarblingActive()?this.getSnappedHexColor(e):e},getHitColorKey(e,t,n){return this.isCanvasFarblingActive()&&(e=Math.round(e/5)*5,t=Math.round(t/5)*5,n=Math.round(n/5)*5),pe+this._rgbToHex(e,t,n)},getSnappedHexColor(e){let t=this._hexToRgb(e);return pe+this._rgbToHex(Math.round(t.r/5)*5,Math.round(t.g/5)*5,Math.round(t.b/5)*5)},getRGB(e){let t;return e in ye?(t=ye[e],{r:t[0],g:t[1],b:t[2]}):e[0]===pe?this._hexToRgb(e.substring(1)):e.substr(0,4)===ve?(t=be.exec(e.replace(/ /g,``)),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA(e){return e||=`black`,I._namedColorToRBA(e)||I._hex3ColorToRGBA(e)||I._hex4ColorToRGBA(e)||I._hex6ColorToRGBA(e)||I._hex8ColorToRGBA(e)||I._rgbColorToRGBA(e)||I._rgbaColorToRGBA(e)||I._hslColorToRGBA(e)},_namedColorToRBA(e){let t=ye[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(e.indexOf(`rgb(`)===0){e=e.match(/rgb\(([^)]+)\)/)[1];let t=e.split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(e.indexOf(`rgba(`)===0){e=e.match(/rgba\(([^)]+)\)/)[1];let t=e.split(/ *, */).map((e,t)=>e.slice(-1)===`%`?t===3?parseInt(e)/100:parseInt(e)/100*255:Number(e));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex8ColorToRGBA(e){if(e[0]===`#`&&e.length===9)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:parseInt(e.slice(7,9),16)/255}},_hex6ColorToRGBA(e){if(e[0]===`#`&&e.length===7)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex4ColorToRGBA(e){if(e[0]===`#`&&e.length===5)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:parseInt(e[4]+e[4],16)/255}},_hex3ColorToRGBA(e){if(e[0]===`#`&&e.length===4)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){let[t,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),r=Number(n[0])/360,i=Number(n[1])/100,a=Number(n[2])/100,o,s,c;if(i===0)return c=a*255,{r:Math.round(c),g:Math.round(c),b:Math.round(c),a:1};o=a<.5?a*(1+i):a+i-a*i;let l=2*a-o,u=[0,0,0];for(let e=0;e<3;e++)s=r+1/3*-(e-1),s<0&&s++,s>1&&s--,c=6*s<1?l+(o-l)*6*s:2*s<1?o:3*s<2?l+(o-l)*(2/3-s)*6:l,u[e]=c*255;return{r:Math.round(u[0]),g:Math.round(u[1]),b:Math.round(u[2]),a:1}}},haveIntersection(e,t){return!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.height1?(o=n,s=r,c=(n-i)*(n-i)+(r-a)*(r-a)):(o=e+u*(n-e),s=t+u*(r-t),c=(o-i)*(o-i)+(s-a)*(s-a))}return[o,s,c]},_getProjectionToLine(e,t,n){let r=I.cloneObject(e),i=Number.MAX_VALUE;return t.forEach(function(a,o){if(!n&&o===t.length-1)return;let s=t[(o+1)%t.length],c=I._getProjectionToSegment(a.x,a.y,s.x,s.y,e.x,e.y),l=c[0],u=c[1],d=c[2];dt.length){let n=t;t=e,e=n}for(let t=0;t{e.width=0,e.height=0})},drawRoundedRectPath(e,t,n,r){let i=t<0?t:0,a=n<0?n:0;t=Math.abs(t),n=Math.abs(n);let o=0,s=0,c=0,l=0;typeof r==`number`?o=s=c=l=Math.min(r,t/2,n/2):(o=Math.min(r[0]||0,t/2,n/2),s=Math.min(r[1]||0,t/2,n/2),l=Math.min(r[2]||0,t/2,n/2),c=Math.min(r[3]||0,t/2,n/2)),e.moveTo(i+o,a),e.lineTo(i+t-s,a),e.arc(i+t-s,a+s,s,Math.PI*3/2,0,!1),e.lineTo(i+t,a+n-l),e.arc(i+t-l,a+n-l,l,0,Math.PI/2,!1),e.lineTo(i+c,a+n),e.arc(i+c,a+n-c,c,Math.PI/2,Math.PI,!1),e.lineTo(i,a+o),e.arc(i+o,a+o,o,Math.PI,Math.PI*3/2,!1)},drawRoundedPolygonPath(e,t,n,r,i){r=Math.abs(r);for(let a=0;atypeof e==`number`?Math.floor(e):e)),i+=Ee+c.join(Te)+De)):(i+=o.property,e||(i+=Me+o.val)),i+=Ae;return i}clearTrace(){this.traceArr=[]}_trace(e){let t=this.traceArr,n;t.push(e),n=t.length,n>=Fe&&t.shift()}reset(){let e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){let t=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,t.getWidth()/t.pixelRatio,t.getHeight()/t.pixelRatio)}_applyLineCap(e){let t=e.attrs.lineCap;t&&this.setAttr(`lineCap`,t)}_applyOpacity(e){let t=e.getAbsoluteOpacity();t!==1&&this.setAttr(`globalAlpha`,t)}_applyLineJoin(e){let t=e.attrs.lineJoin;t&&this.setAttr(`lineJoin`,t)}_applyMiterLimit(e){let t=e.attrs.miterLimit;t!=null&&this.setAttr(`miterLimit`,t)}setAttr(e,t){this._context[e]=t}arc(e,t,n,r,i,a){this._context.arc(e,t,n,r,i,a)}arcTo(e,t,n,r,i){this._context.arcTo(e,t,n,r,i)}beginPath(){this._context.beginPath()}bezierCurveTo(e,t,n,r,i,a){this._context.bezierCurveTo(e,t,n,r,i,a)}clearRect(e,t,n,r){this._context.clearRect(e,t,n,r)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,t){let n=arguments;if(n.length===2)return this._context.createImageData(e,t);if(n.length===1)return this._context.createImageData(e)}createLinearGradient(e,t,n,r){return this._context.createLinearGradient(e,t,n,r)}createPattern(e,t){return this._context.createPattern(e,t)}createRadialGradient(e,t,n,r,i,a){return this._context.createRadialGradient(e,t,n,r,i,a)}drawImage(e,t,n,r,i,a,o,s,c){let l=arguments,u=this._context;l.length===3?u.drawImage(e,t,n):l.length===5?u.drawImage(e,t,n,r,i):l.length===9&&u.drawImage(e,t,n,r,i,a,o,s,c)}ellipse(e,t,n,r,i,a,o,s){this._context.ellipse(e,t,n,r,i,a,o,s)}isPointInPath(e,t,n,r){return n?this._context.isPointInPath(n,e,t,r):this._context.isPointInPath(e,t,r)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,t,n,r){this._context.fillRect(e,t,n,r)}strokeRect(e,t,n,r){this._context.strokeRect(e,t,n,r)}fillText(e,t,n,r){r?this._context.fillText(e,t,n,r):this._context.fillText(e,t,n)}measureText(e){return this._context.measureText(e)}getImageData(e,t,n,r){return this._context.getImageData(e,t,n,r)}lineTo(e,t){this._context.lineTo(e,t)}moveTo(e,t){this._context.moveTo(e,t)}rect(e,t,n,r){this._context.rect(e,t,n,r)}roundRect(e,t,n,r,i){this._context.roundRect(e,t,n,r,i)}putImageData(e,t,n){this._context.putImageData(e,t,n)}quadraticCurveTo(e,t,n,r){this._context.quadraticCurveTo(e,t,n,r)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,t){this._context.scale(e,t)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):`mozDash`in this._context?this._context.mozDash=e:`webkitLineDash`in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,t,n,r,i,a){this._context.setTransform(e,t,n,r,i,a)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,t,n,r){this._context.strokeText(e,t,n,r)}transform(e,t,n,r,i,a){this._context.transform(e,t,n,r,i,a)}translate(e,t){this._context.translate(e,t)}_enableTrace(){let e=this,t=Ne.length,n=this.setAttr,r,i,a=function(t){let n=e[t],r;e[t]=function(){return i=we(Array.prototype.slice.call(arguments,0)),r=n.apply(e,arguments),e._trace({method:t,args:i}),r}};for(r=0;r{t.dragStatus===`dragging`&&(e=!0)}),e},justDragged:!1,get node(){let e;return L._dragElements.forEach(t=>{e=t.node}),e},_dragElements:new Map,_drag(e){let t=[];L._dragElements.forEach((n,r)=>{let{node:i}=n,a=i.getStage();a.setPointersPositions(e),n.pointerId===void 0&&(n.pointerId=I._getFirstPointerId(e));let o=a._changedPointerPositions.find(e=>e.id===n.pointerId);if(o){if(n.dragStatus!==`dragging`){let t=i.dragDistance();if(Math.max(Math.abs(o.x-n.startPointerPos.x),Math.abs(o.y-n.startPointerPos.y)){t.getStage()&&t.fire(`dragmove`,{type:`dragmove`,target:t,evt:e},!0)})},_endDragBefore(e){let t=[];L._dragElements.forEach(n=>{let{node:r}=n,i=r.getStage();if(e&&i.setPointersPositions(e),!i._changedPointerPositions.find(e=>e.id===n.pointerId))return;(n.dragStatus===`dragging`||n.dragStatus===`stopped`)&&(L.justDragged=!0,N._mouseListenClick=!1,N._touchListenClick=!1,N._pointerListenClick=!1,n.dragStatus=`stopped`);let a=n.node.getLayer()||n.node instanceof N.Stage&&n.node;a&&t.indexOf(a)===-1&&t.push(a)}),t.forEach(e=>{e.draw()})},_endDragAfter(e){L._dragElements.forEach((t,n)=>{t.dragStatus===`stopped`&&t.node.fire(`dragend`,{type:`dragend`,target:t.node,evt:e},!0),t.dragStatus!==`dragging`&&L._dragElements.delete(n)})}};N.isBrowser&&(window.addEventListener(`mouseup`,L._endDragBefore,!0),window.addEventListener(`touchend`,L._endDragBefore,!0),window.addEventListener(`touchcancel`,L._endDragBefore,!0),window.addEventListener(`mousemove`,L._drag),window.addEventListener(`touchmove`,L._drag),window.addEventListener(`mouseup`,L._endDragAfter,!1),window.addEventListener(`touchend`,L._endDragAfter,!1),window.addEventListener(`touchcancel`,L._endDragAfter,!1));function Ke(e){return I._isString(e)?`"`+e+`"`:Object.prototype.toString.call(e)===`[object Number]`||I._isBoolean(e)?e:Object.prototype.toString.call(e)}function qe(e){return e>255?255:e<0?0:Math.round(e)}function R(){if(N.isUnminified)return function(e,t){return I._isNumber(e)||I.warn(Ke(e)+` is a not valid value for "`+t+`" attribute. The value should be a number.`),e}}function Je(e){if(N.isUnminified)return function(t,n){let r=I._isNumber(t),i=I._isArray(t)&&t.length==e;return!r&&!i&&I.warn(Ke(t)+` is a not valid value for "`+n+`" attribute. The value should be a number or Array(`+e+`)`),t}}function Ye(){if(N.isUnminified)return function(e,t){return I._isNumber(e)||e===`auto`||I.warn(Ke(e)+` is a not valid value for "`+t+`" attribute. The value should be a number or "auto".`),e}}function Xe(){if(N.isUnminified)return function(e,t){return I._isString(e)||I.warn(Ke(e)+` is a not valid value for "`+t+`" attribute. The value should be a string.`),e}}function Ze(){if(N.isUnminified)return function(e,t){let n=I._isString(e),r=Object.prototype.toString.call(e)===`[object CanvasGradient]`||e&&e.addColorStop;return n||r||I.warn(Ke(e)+` is a not valid value for "`+t+`" attribute. The value should be a string or a native gradient.`),e}}function Qe(){if(N.isUnminified)return function(e,t){let n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(I._isArray(e)?e.forEach(function(e){I._isNumber(e)||I.warn(`"`+t+`" attribute has non numeric element `+e+`. Make sure that all elements are numbers.`)}):I.warn(Ke(e)+` is a not valid value for "`+t+`" attribute. The value should be a array of numbers.`)),e}}function $e(){if(N.isUnminified)return function(e,t){return e===!0||e===!1||I.warn(Ke(e)+` is a not valid value for "`+t+`" attribute. The value should be a boolean.`),e}}function et(e){if(N.isUnminified)return function(t,n){return t==null||I.isObject(t)||I.warn(Ke(t)+` is a not valid value for "`+n+`" attribute. The value should be an object with properties `+e),t}}var tt=`get`,nt=`set`,z={addGetterSetter(e,t,n,r,i){z.addGetter(e,t,n),z.addSetter(e,t,r,i),z.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){let r=tt+I._capitalize(t);e.prototype[r]=e.prototype[r]||function(){let e=this.attrs[t];return e===void 0?n:e}},addSetter(e,t,n,r){let i=nt+I._capitalize(t);e.prototype[i]||z.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){let i=nt+I._capitalize(t);e.prototype[i]=function(e){return n&&e!=null&&(e=n.call(this,e,t)),this._setAttr(t,e),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,i){let a=n.length,o=I._capitalize,s=tt+o(t),c=nt+o(t);e.prototype[s]=function(){let e={};for(let r=0;r{this._setAttr(t+o(e),void 0)}),this._fireChangeEvent(t,a,e),i&&i.call(this),this},z.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){let n=I._capitalize(t),r=nt+n,i=tt+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(e,t,n,r){I.error(`Adding deprecated `+t);let i=tt+I._capitalize(t),a=t+` property is deprecated and will be removed soon. Look at Konva change log for more information.`;e.prototype[i]=function(){I.error(a);let e=this.attrs[t];return e===void 0?n:e},z.addSetter(e,t,r,function(){I.error(a)}),z.addOverloadedGetterSetter(e,t)},backCompat(e,t){I.each(t,function(t,n){let r=e.prototype[n],i=tt+I._capitalize(t),a=nt+I._capitalize(t);function o(){r.apply(this,arguments),I.error(`"`+t+`" method is deprecated and will be removed soon. Use ""`+n+`" instead.`)}e.prototype[t]=o,e.prototype[i]=o,e.prototype[a]=o})},afterSetFilter(){this._filterUpToDate=!1}};function rt(e){let t=/(\w+)\(([^)]+)\)/g,n;for(;(n=t.exec(e))!==null;){let[,e,t]=n;switch(e){case`blur`:{let e=parseFloat(t.replace(`px`,``));return function(t){this.blurRadius(e*.5);let n=N.Filters;n&&n.Blur&&n.Blur.call(this,t)}}case`brightness`:{let e=t.includes(`%`)?parseFloat(t)/100:parseFloat(t);return function(t){this.brightness(e);let n=N.Filters;n&&n.Brightness&&n.Brightness.call(this,t)}}case`contrast`:{let e=parseFloat(t);return function(t){let n=100*(Math.sqrt(e)-1);this.contrast(n);let r=N.Filters;r&&r.Contrast&&r.Contrast.call(this,t)}}case`grayscale`:return function(e){let t=N.Filters;t&&t.Grayscale&&t.Grayscale.call(this,e)};case`sepia`:return function(e){let t=N.Filters;t&&t.Sepia&&t.Sepia.call(this,e)};case`invert`:return function(e){let t=N.Filters;t&&t.Invert&&t.Invert.call(this,e)};default:I.warn(`CSS filter "${e}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}var it=`absoluteOpacity`,at=`allEventListeners`,ot=`absoluteTransform`,st=`absoluteScale`,ct=`canvas`,lt=`Change`,ut=`children`,dt=`konva`,ft=`listening`,pt=`mouseenter`,mt=`mouseleave`,ht=`pointerenter`,gt=`pointerleave`,_t=`touchenter`,vt=`touchleave`,yt=`set`,bt=`Shape`,xt=` `,St=`stage`,Ct=`transform`,wt=`Stage`,Tt=`visible`,Et=[`xChange.konva`,`yChange.konva`,`scaleXChange.konva`,`scaleYChange.konva`,`skewXChange.konva`,`skewYChange.konva`,`rotationChange.konva`,`offsetXChange.konva`,`offsetYChange.konva`,`transformsEnabledChange.konva`].join(xt),Dt=1,B=class e{constructor(e){this._id=Dt++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===Ct||e===ot)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,t){let n=this._cache.get(e);return(n===void 0||(e===Ct||e===ot)&&n.dirty===!0)&&(n=t.call(this),this._cache.set(e,n)),n}_calculate(e,t,n){if(!this._attachedDepsListeners.get(e)){let n=t.map(e=>e+`Change.konva`).join(xt);this.on(n,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,n)}_getCanvasCache(){return this._cache.get(ct)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===ot&&this.fire(`absoluteTransformChange`)}clearCache(){if(this._cache.has(ct)){let{scene:e,filter:t,hit:n}=this._cache.get(ct);I.releaseCanvas(e._canvas,t._canvas,n._canvas),this._cache.delete(ct)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){let t=e||{},n={};(t.x===void 0||t.y===void 0||t.width===void 0||t.height===void 0)&&(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let r=Math.ceil(t.width||n.width),i=Math.ceil(t.height||n.height),a=t.pixelRatio,o=t.x===void 0?Math.floor(n.x):t.x,s=t.y===void 0?Math.floor(n.y):t.y,c=t.offset||0,l=t.drawBorder||!1,u=t.hitCanvasPixelRatio||1;if(!r||!i){I.error(`Can not cache the node. Width or height of the node equals 0. Caching is skipped.`);return}let d=+(Math.abs(Math.round(n.x)-o)>.5),f=+(Math.abs(Math.round(n.y)-s)>.5);r+=c*2+d,i+=c*2+f,o-=c,s-=c;let p=new We({pixelRatio:a,width:r,height:i}),m=new We({pixelRatio:a,width:0,height:0,willReadFrequently:!0}),h=new Ge({pixelRatio:u,width:r,height:i}),g=p.getContext(),_=h.getContext(),v=new We({width:p.width/p.pixelRatio+Math.abs(o),height:p.height/p.pixelRatio+Math.abs(s),pixelRatio:p.pixelRatio}),y=v.getContext();return h.isCache=!0,p.isCache=!0,this._cache.delete(ct),this._filterUpToDate=!1,t.imageSmoothingEnabled===!1&&(p.getContext()._context.imageSmoothingEnabled=!1,m.getContext()._context.imageSmoothingEnabled=!1),g.save(),_.save(),y.save(),g.translate(-o,-s),_.translate(-o,-s),y.translate(-o,-s),v.x=o,v.y=s,this._isUnderCache=!0,this._clearSelfAndDescendantCache(it),this._clearSelfAndDescendantCache(st),this.drawScene(p,this,v),this.drawHit(h,this),this._isUnderCache=!1,g.restore(),_.restore(),l&&(g.save(),g.beginPath(),g.rect(0,0,r,i),g.closePath(),g.setAttr(`strokeStyle`,`red`),g.setAttr(`lineWidth`,5),g.stroke(),g.restore()),I.releaseCanvas(v._canvas),this._cache.set(ct,{scene:p,filter:m,hit:h,x:o,y:s}),this._requestDraw(),this}isCached(){return this._cache.has(ct)}getClientRect(e){throw Error(`abstract "getClientRect" method call`)}_transformedRect(e,t){let n=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],r=1/0,i=1/0,a=-1/0,o=-1/0,s=this.getAbsoluteTransform(t);return n.forEach(function(e){let t=s.point(e);r===void 0&&(r=a=t.x,i=o=t.y),r=Math.min(r,t.x),i=Math.min(i,t.y),a=Math.max(a,t.x),o=Math.max(o,t.y)}),{x:r,y:i,width:a-r,height:o-i}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);let t=this._getCanvasCache();e.translate(t.x,t.y);let n=this._getCachedSceneCanvas(),r=n.pixelRatio;e.drawImage(n._canvas,0,0,n.width/r,n.height/r),e.restore()}_drawCachedHitCanvas(e){let t=this._getCanvasCache(),n=t.hit;e.save(),e.translate(t.x,t.y),e.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),e.restore()}_getCachedSceneCanvas(){let e=this.filters(),t=this._getCanvasCache(),n=t.scene,r=t.filter,i=r.getContext(),a,o,s,c;if(!e||e.length===0)return n;if(this._filterUpToDate)return r;let l=!0;for(let t=0;t{this.isAncestorOf(e.node)&&L._dragElements.delete(t)}),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(ot),this._clearSelfAndDescendantCache(it),this._clearSelfAndDescendantCache(st),this._clearSelfAndDescendantCache(St),this._clearSelfAndDescendantCache(Tt),this._clearSelfAndDescendantCache(ft)}_remove(){this._clearCaches();let e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(e){let t=`get`+I._capitalize(e);return I._isFunction(this[t])?this[t]():this.attrs[e]}getAncestors(){let e=this.getParent(),t=[];for(;e;)t.push(e),e=e.getParent();return t}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{let t,n;if(!e)return this;for(t in e)t!==ut&&(n=yt+I._capitalize(t),I._isFunction(this[n])?this[n](e[t]):this._setAttr(t,e[t]))}),this}isListening(){return this._getCache(ft,this._isListening)}_isListening(e){if(!this.listening())return!1;let t=this.getParent();return t&&t!==e&&this!==e?t._isListening(e):!0}isVisible(){return this._getCache(Tt,this._isVisible)}_isVisible(e){if(!this.visible())return!1;let t=this.getParent();return t&&t!==e&&this!==e?t._isVisible(e):!0}shouldDrawHit(e,t=!1){if(e)return this._isVisible(e)&&this._isListening(e);let n=this.getLayer(),r=!1;L._dragElements.forEach(e=>{e.dragStatus===`dragging`&&(e.node.nodeType===`Stage`||e.node.getLayer()===n)&&(r=!0)});let i=!t&&!N.hitOnDragEnabled&&(r||N.isTransforming());return this.isListening()&&this.isVisible()&&!i}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let e=this.getDepth(),t=this,n=0,r,i,a,o;function s(c){for(r=[],i=c.length,a=0;a0&&r[0].getDepth()<=e&&s(r)}let c=this.getStage();return t.nodeType!==wt&&c&&s(c.getChildren()),n}getDepth(){let e=0,t=this.parent;for(;t;)e++,t=t.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(Ct),this._clearSelfAndDescendantCache(ot)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){let e=this.getStage();if(!e)return null;let t=e.getPointerPosition();if(!t)return null;let n=this.getAbsoluteTransform().copy();return n.invert(),n.point(t)}getAbsolutePosition(e){let t=!1,n=this.parent;for(;n;){if(n.isCached()){t=!0;break}n=n.parent}t&&!e&&(e=!0);let r=this.getAbsoluteTransform(e).getMatrix(),i=new F,a=this.offset();return i.m=r.slice(),i.translate(a.x,a.y),i.getTranslation()}setAbsolutePosition(e){let{x:t,y:n,...r}=this._clearTransform();this.attrs.x=t,this.attrs.y=n,this._clearCache(Ct);let i=this._getAbsoluteTransform().copy();return i.invert(),i.translate(e.x,e.y),e={x:this.attrs.x+i.getTranslation().x,y:this.attrs.y+i.getTranslation().y},this._setTransform(r),this.setPosition({x:e.x,y:e.y}),this._clearCache(Ct),this._clearSelfAndDescendantCache(ot),this}_setTransform(e){let t;for(t in e)this.attrs[t]=e[t]}_clearTransform(){let e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){let t=e.x,n=e.y,r=this.x(),i=this.y();return t!==void 0&&(r+=t),n!==void 0&&(i+=n),this.setPosition({x:r,y:i}),this}_eachAncestorReverse(e,t){let n=[],r=this.getParent(),i,a;if(!(t&&t._id===this._id)){for(n.unshift(this);r&&(!t||r._id!==t._id);)n.unshift(r),r=r.parent;for(i=n.length,a=0;a0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return I.warn(`Node has no parent. moveToBottom function is ignored.`),!1;let e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(e){if(!this.parent)return I.warn(`Node has no parent. zIndex parameter is ignored.`),this;(e<0||e>=this.parent.children.length)&&I.warn(`Unexpected value `+e+` for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to `+(this.parent.children.length-1)+`.`);let t=this.index;return this.parent.children.splice(t,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(it,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let e=this.opacity(),t=this.getParent();return t&&!t._isUnderCache&&(e*=t.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){let e=this.getAttrs(),t,n,r,i,a,o={attrs:{},className:this.getClassName()};for(t in e)n=e[t],a=I.isObject(n)&&!I._isPlainObject(n)&&!I._isArray(n),!a&&(r=typeof this[t]==`function`&&this[t],delete e[t],i=r?r.call(this):null,e[t]=n,i!==n&&(o.attrs[t]=n));return I._prepareToStringify(o)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,t,n){let r=[];t&&this._isMatch(e)&&r.push(this);let i=this.parent;for(;i;){if(i===n)return r;i._isMatch(e)&&r.push(i),i=i.parent}return r}isAncestorOf(e){return!1}findAncestor(e,t,n){return this.findAncestors(e,t,n)[0]}_isMatch(e){if(!e)return!1;if(typeof e==`function`)return e(this);let t=e.replace(/ /g,``).split(`,`),n=t.length,r,i;for(r=0;r{try{let n=e?.callback;n&&delete e.callback,I._urlToImage(this.toDataURL(e),function(e){t(e),n?.(e)})}catch(e){n(e)}})}toBlob(e){return new Promise((t,n)=>{try{let n=e?.callback;n&&delete e.callback,this.toCanvas(e).toBlob(e=>{t(e),n?.(e)},e?.mimeType,e?.quality)}catch(e){n(e)}})}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance===void 0?this.parent?this.parent.getDragDistance():N.dragDistance:this.attrs.dragDistance}_off(e,t,n){let r=this.eventListeners[e],i,a,o;for(i=0;i=0)||this.isDragging())return;let t=!1;L._dragElements.forEach(e=>{this.isAncestorOf(e.node)&&(t=!0)}),t||this._createDragElement(e)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;let e=L._dragElements.get(this._id),t=e&&e.dragStatus===`dragging`,n=e&&e.dragStatus===`ready`;t?this.stopDrag():n&&L._dragElements.delete(this._id)}}_dragCleanup(){this.off(`mousedown.konva`),this.off(`touchstart.konva`)}isClientRectOnScreen(e={x:0,y:0}){let t=this.getStage();if(!t)return!1;let n={x:-e.x,y:-e.y,width:t.width()+2*e.x,height:t.height()+2*e.y};return I.haveIntersection(n,this.getClientRect())}static create(e,t){return I._isString(e)&&(e=JSON.parse(e)),this._createNode(e,t)}static _createNode(t,n){let r=e.prototype.getClassName.call(t),i=t.children,a,o,s;n&&(t.attrs.container=n),N[r]||(I.warn(`Can not find a node with class name "`+r+`". Fallback to "Shape".`),r=`Shape`);let c=N[r];if(a=new c(t.attrs),i)for(o=i.length,s=0;s0}removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(e.length===0)return this;if(e.length>1){for(let t=0;t0?t[0]:void 0}_generalFind(e,t){let n=[];return this._descendants(r=>{let i=r._isMatch(e);return i&&n.push(r),!!(i&&t)}),n}_descendants(e){let t=!1,n=this.getChildren();for(let r of n)if(t=e(r),t||r.hasChildren()&&(t=r._descendants(e),t))return!0;return!1}toObject(){let e=B.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach(t=>{e.children.push(t.toObject())}),e}isAncestorOf(e){let t=e.getParent();for(;t;){if(t._id===this._id)return!0;t=t.getParent()}return!1}clone(e){let t=B.prototype.clone.call(this,e);return this.getChildren().forEach(function(e){t.add(e.clone())}),t}getAllIntersections(e){let t=[];return this.find(`Shape`).forEach(n=>{n.isVisible()&&n.intersects(e)&&t.push(n)}),t}_clearSelfAndDescendantCache(e){var t;super._clearSelfAndDescendantCache(e),!this.isCached()&&((t=this.children)==null||t.forEach(function(t){t._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)==null||e.forEach(function(e,t){e.index=t}),this._requestDraw()}drawScene(e,t,n){let r=this.getLayer(),i=e||r&&r.getCanvas(),a=i&&i.getContext(),o=this._getCanvasCache(),s=o&&o.scene,c=i&&i.isCache;if(!this.isVisible()&&!c)return this;if(s){a.save();let e=this.getAbsoluteTransform(t).getMatrix();a.transform(e[0],e[1],e[2],e[3],e[4],e[5]),this._drawCachedSceneCanvas(a),a.restore()}else this._drawChildren(`drawScene`,i,t,n);return this}drawHit(e,t){if(!this.shouldDrawHit(t))return this;let n=this.getLayer(),r=e||n&&n.hitCanvas,i=r&&r.getContext(),a=this._getCanvasCache();if(a&&a.hit){i.save();let e=this.getAbsoluteTransform(t).getMatrix();i.transform(e[0],e[1],e[2],e[3],e[4],e[5]),this._drawCachedHitCanvas(i),i.restore()}else this._drawChildren(`drawHit`,r,t);return this}_drawChildren(e,t,n,r){var i;let a=t&&t.getContext(),o=this.clipWidth(),s=this.clipHeight(),c=this.clipFunc(),l=typeof o==`number`&&typeof s==`number`||c,u=n===this;if(l){a.save();let e=this.getAbsoluteTransform(n),t=e.getMatrix();a.transform(t[0],t[1],t[2],t[3],t[4],t[5]),a.beginPath();let r;if(c)r=c.call(this,a,this);else{let e=this.clipX(),t=this.clipY();a.rect(e||0,t||0,o,s)}a.clip.apply(a,r),t=e.copy().invert().getMatrix(),a.transform(t[0],t[1],t[2],t[3],t[4],t[5])}let d=!u&&this.globalCompositeOperation()!==`source-over`&&e===`drawScene`;d&&(a.save(),a._applyGlobalCompositeOperation(this)),(i=this.children)==null||i.forEach(function(i){i[e](t,n,r)}),d&&a.restore(),l&&a.restore()}getClientRect(e={}){var t;let n=e.skipTransform,r=e.relativeTo,i,a,o,s,c={x:1/0,y:1/0,width:0,height:0},l=this;(t=this.children)==null||t.forEach(function(t){if(!t.visible())return;let n=t.getClientRect({relativeTo:l,skipShadow:e.skipShadow,skipStroke:e.skipStroke});n.width===0&&n.height===0||(i===void 0?(i=n.x,a=n.y,o=n.x+n.width,s=n.y+n.height):(i=Math.min(i,n.x),a=Math.min(a,n.y),o=Math.max(o,n.x+n.width),s=Math.max(s,n.y+n.height)))});let u=this.find(`Shape`),d=!1;for(let e=0;ee.indexOf(`pointer`)>=0?`pointer`:e.indexOf(`touch`)>=0?`touch`:`mouse`,dn=e=>{let t=un(e);if(t===`pointer`)return N.pointerEventsEnabled&&ln.pointer;if(t===`touch`)return ln.touch;if(t===`mouse`)return ln.mouse};function fn(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&I.warn(`Stage does not support clipping. Please use clip for Layers or Groups.`),e}var pn=`Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);`,mn=[],hn=class extends H{constructor(e){super(fn(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),mn.push(this),this.on(`widthChange.konva heightChange.konva`,this._resizeDOM),this.on(`visibleChange.konva`,this._checkVisibility),this.on(`clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva`,()=>{fn(this.attrs)}),this._checkVisibility()}_validateAdd(e){let t=e.getType()===`Layer`,n=e.getType()===`FastLayer`;t||n||I.throw(`You may only add layers to the stage.`)}_checkVisibility(){if(!this.content)return;let e=this.visible()?``:`none`;this.content.style.display=e}setContainer(e){if(typeof e===It){let t;if(e.charAt(0)===`.`){let t=e.slice(1);e=document.getElementsByClassName(t)[0]}else t=e.charAt(0)===`#`?e.slice(1):e,e=document.getElementById(t);if(!e)throw`Can not find container in document with id `+t}return this._setAttr(`container`,e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){let e=this.children,t=e.length;for(let n=0;n-1&&mn.splice(t,1),I.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){let e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(I.warn(pn),null)}_getPointerById(e){return this._pointerPositions.find(t=>t.id===e)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){e={...e},e.x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();let t=new We({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),n=t.getContext()._context,r=this.children;return(e.x||e.y)&&n.translate(-1*e.x,-1*e.y),r.forEach(function(t){if(!t.isVisible())return;let r=t._toKonvaCanvas(e);n.drawImage(r._canvas,e.x,e.y,r.getWidth()/r.getPixelRatio(),r.getHeight()/r.getPixelRatio())}),t}getIntersection(e){if(!e)return null;let t=this.children,n=t.length-1;for(let r=n;r>=0;r--){let n=t[r].getIntersection(e);if(n)return n}return null}_resizeDOM(){let e=this.width(),t=this.height();this.content&&(this.content.style.width=e+Lt,this.content.style.height=t+Lt),this.bufferCanvas.setSize(e,t),this.bufferHitCanvas.setSize(e,t),this.children.forEach(n=>{n.setSize({width:e,height:t}),n.draw()})}add(e,...t){if(arguments.length>1){for(let e=0;esn&&I.warn(`The stage has `+n+` layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group.`),e.setSize({width:this.width(),height:this.height()}),e.draw(),N.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return Mt(e,this)}setPointerCapture(e){Nt(e,this)}releaseCapture(e){Pt(e,this)}getLayers(){return this.children}_bindContentEvents(){N.isBrowser&&cn.forEach(([e,t])=>{this.content.addEventListener(e,e=>{this[t](e)},{passive:!1})})}_pointerenter(e){this.setPointersPositions(e);let t=dn(e.type);t&&this._fire(t.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);let t=dn(e.type);t&&this._fire(t.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let t=this[e+`targetShape`];return t&&!t.getStage()&&(t=null),t}_pointerleave(e){let t=dn(e.type),n=un(e.type);if(!t)return;this.setPointersPositions(e);let r=this._getTargetShape(n),i=!(N.isDragging()||N.isTransforming())||N.hitOnDragEnabled;r&&i?(r._fireAndBubble(t.pointerout,{evt:e}),r._fireAndBubble(t.pointerleave,{evt:e}),this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this[n+`targetShape`]=null):i&&(this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(t.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(e){let t=dn(e.type),n=un(e.type);if(!t)return;this.setPointersPositions(e);let r=!1;this._changedPointerPositions.forEach(i=>{let a=this.getIntersection(i);if(L.justDragged=!1,N[`_`+n+`ListenClick`]=!0,!a||!a.isListening()){this[n+`ClickStartShape`]=void 0;return}N.capturePointerEventsEnabled&&a.setPointerCapture(i.id),this[n+`ClickStartShape`]=a,a._fireAndBubble(t.pointerdown,{evt:e,pointerId:i.id}),r=!0;let o=e.type.indexOf(`touch`)>=0;a.preventDefault()&&e.cancelable&&o&&e.preventDefault()}),r||this._fire(t.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(e){let t=dn(e.type),n=un(e.type);if(!t)return;let r=e.type.indexOf(`touch`)>=0||e.pointerType===`touch`;if(N.isDragging()&&L.node.preventDefault()&&e.cancelable&&r&&e.preventDefault(),this.setPointersPositions(e),!(!(N.isDragging()||N.isTransforming())||N.hitOnDragEnabled))return;let i={},a=!1,o=this._getTargetShape(n);this._changedPointerPositions.forEach(r=>{let s=At(r.id)||this.getIntersection(r),c=r.id,l={evt:e,pointerId:c},u=o!==s;if(u&&o&&(o._fireAndBubble(t.pointerout,{...l},s),o._fireAndBubble(t.pointerleave,{...l},s)),s){if(i[s._id])return;i[s._id]=!0}s&&s.isListening()?(a=!0,u&&(s._fireAndBubble(t.pointerover,{...l},o),s._fireAndBubble(t.pointerenter,{...l},o),this[n+`targetShape`]=s),s._fireAndBubble(t.pointermove,{...l})):o&&(this._fire(t.pointerover,{evt:e,target:this,currentTarget:this,pointerId:c}),this[n+`targetShape`]=null)}),a||this._fire(t.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){let t=dn(e.type),n=un(e.type);if(!t)return;this.setPointersPositions(e);let r=this[n+`ClickStartShape`],i=this[n+`ClickEndShape`],a={},o=!1;this._changedPointerPositions.forEach(s=>{let c=At(s.id)||this.getIntersection(s);if(c){if(c.releaseCapture(s.id),a[c._id])return;a[c._id]=!0}let l=s.id,u={evt:e,pointerId:l},d=!1;N[`_`+n+`InDblClickWindow`]?(d=!0,clearTimeout(this[n+`DblTimeout`])):L.justDragged||(N[`_`+n+`InDblClickWindow`]=!0,clearTimeout(this[n+`DblTimeout`])),this[n+`DblTimeout`]=setTimeout(function(){N[`_`+n+`InDblClickWindow`]=!1},N.dblClickWindow),c&&c.isListening()?(o=!0,this[n+`ClickEndShape`]=c,c._fireAndBubble(t.pointerup,{...u}),N[`_`+n+`ListenClick`]&&r&&r===c&&(c._fireAndBubble(t.pointerclick,{...u}),d&&i&&i===c&&c._fireAndBubble(t.pointerdblclick,{...u}))):(this[n+`ClickEndShape`]=null,o||=(this._fire(t.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),!0),N[`_`+n+`ListenClick`]&&this._fire(t.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:l}),d&&this._fire(t.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:l}))}),o||this._fire(t.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),N[`_`+n+`ListenClick`]=!1,e.cancelable&&n!==`touch`&&n!==`pointer`&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);let t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(en,{evt:e}):this._fire(en,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);let t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(on,{evt:e}):this._fire(on,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);let t=At(e.pointerId)||this.getIntersection(this.getPointerPosition());t&&t._fireAndBubble(qt,jt(e)),Pt(e.pointerId)}_lostpointercapture(e){Pt(e.pointerId)}setPointersPositions(e){let t=this._getContentPosition(),n=null,r=null;e||=window.event,e.touches===void 0?(n=(e.clientX-t.left)/t.scaleX,r=(e.clientY-t.top)/t.scaleY,this.pointerPos={x:n,y:r},this._pointerPositions=[{x:n,y:r,id:I._getFirstPointerId(e)}],this._changedPointerPositions=[{x:n,y:r,id:I._getFirstPointerId(e)}]):(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,e=>{this._pointerPositions.push({id:e.identifier,x:(e.clientX-t.left)/t.scaleX,y:(e.clientY-t.top)/t.scaleY})}),Array.prototype.forEach.call(e.changedTouches||e.touches,e=>{this._changedPointerPositions.push({id:e.identifier,x:(e.clientX-t.left)/t.scaleX,y:(e.clientY-t.top)/t.scaleY})}))}_setPointerPosition(e){I.warn(`Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.`),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};let e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new We({width:this.width(),height:this.height()}),this.bufferHitCanvas=new Ge({pixelRatio:1,width:this.width(),height:this.height()}),!N.isBrowser)return;let e=this.container();if(!e)throw`Stage has no container. A container is required.`;e.innerHTML=``,this.content=document.createElement(`div`),this.content.style.position=`relative`,this.content.style.userSelect=`none`,this.content.className=`konvajs-content`,this.content.setAttribute(`role`,`presentation`),e.appendChild(this.content),this._resizeDOM()}cache(){return I.warn(`Cache function is not allowed for stage. You may use cache only for layers, groups and shapes.`),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(e){e.batchDraw()}),this}};hn.prototype.nodeType=Ft,P(hn),z.addGetterSetter(hn,`container`),N.isBrowser&&document.addEventListener(`visibilitychange`,()=>{mn.forEach(e=>{e.batchDraw()})});var gn=`hasShadow`,_n=`shadowRGBA`,vn=`patternImage`,yn=`linearGradient`,bn=`radialGradient`,xn;function Sn(){return xn||(xn=I.createCanvasElement().getContext(`2d`),xn)}var Cn={};function wn(e){let t=this.attrs.fillRule;t?e.fill(t):e.fill()}function Tn(e){e.stroke()}function En(e){let t=this.attrs.fillRule;t?e.fill(t):e.fill()}function Dn(e){e.stroke()}function On(){this._clearCache(gn)}function kn(){this._clearCache(_n)}function An(){this._clearCache(vn)}function jn(){this._clearCache(yn)}function Mn(){this._clearCache(bn)}var U=class extends B{constructor(e){super(e);let t,n=0;for(;t=I.getHitColor(),!(t&&!(t in Cn));)if(n++,n>=1e4){I.warn(`Failed to find a unique color key for a shape. Konva may work incorrectly. Most likely your browser is using canvas farbling. Consider disabling it.`),t=I.getRandomColor();break}this.colorKey=t,Cn[t]=this}getContext(){return I.warn(`shape.getContext() method is deprecated. Please do not use it.`),this.getLayer().getContext()}getCanvas(){return I.warn(`shape.getCanvas() method is deprecated. Please do not use it.`),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(gn,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(vn,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){let e=Sn().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||`repeat`);if(e&&e.setTransform){let t=new F;t.translate(this.fillPatternX(),this.fillPatternY()),t.rotate(N.getAngle(this.fillPatternRotation())),t.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),t.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());let n=t.getMatrix(),r=typeof DOMMatrix>`u`?{a:n[0],b:n[1],c:n[2],d:n[3],e:n[4],f:n[5]}:new DOMMatrix(n);e.setTransform(r)}return e}}_getLinearGradient(){return this._getCache(yn,this.__getLinearGradient)}__getLinearGradient(){let e=this.fillLinearGradientColorStops();if(e){let t=Sn(),n=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),i=t.createLinearGradient(n.x,n.y,r.x,r.y);for(let t=0;tthis.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate(`hasStroke`,[`strokeEnabled`,`strokeWidth`,`stroke`,`strokeLinearGradientColorStops`],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){let e=this.hitStrokeWidth();return e===`auto`?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){let t=this.getStage();if(!t)return!1;let n=t.bufferHitCanvas;return n.getContext().clear(),this.drawHit(n,void 0,!0),n.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data[3]>0}destroy(){return B.prototype.destroy.call(this),delete Cn[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){if(!(this.attrs.perfectDrawEnabled??!0))return!1;let t=e||this.hasFill(),n=this.hasStroke(),r=this.getAbsoluteOpacity()!==1;if(t&&n&&r)return!0;let i=this.hasShadow(),a=this.shadowForStrokeEnabled();return!!(t&&n&&i&&a)}setStrokeHitEnabled(e){I.warn(`strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead.`),e?this.hitStrokeWidth(`auto`):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){let e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){let t=!1,n=this.getParent();for(;n;){if(n.isCached()){t=!0;break}n=n.getParent()}let r=e.skipTransform,i=e.relativeTo||t&&this.getStage()||void 0,a=this.getSelfRect(),o=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,s=a.width+o,c=a.height+o,l=!e.skipShadow&&this.hasShadow(),u=l?this.shadowOffsetX():0,d=l?this.shadowOffsetY():0,f=s+Math.abs(u),p=c+Math.abs(d),m=l&&this.shadowBlur()||0,h={width:f+m*2,height:p+m*2,x:-(o/2+m)+Math.min(u,0)+a.x,y:-(o/2+m)+Math.min(d,0)+a.y};return r?h:this._transformedRect(h,i)}drawScene(e,t,n){let r=this.getLayer(),i=(e||r.getCanvas()).getContext(),a=this._getCanvasCache(),o=this.getSceneFunc(),s=this.hasShadow(),c,l=t===this;if(!this.isVisible()&&!l)return this;if(a){i.save();let e=this.getAbsoluteTransform(t).getMatrix();return i.transform(e[0],e[1],e[2],e[3],e[4],e[5]),this._drawCachedSceneCanvas(i),i.restore(),this}if(!o)return this;if(i.save(),this._useBufferCanvas()){c=this.getStage();let e=n||c.bufferCanvas,r=e.getContext();n?(r.save(),r.setTransform(1,0,0,1,0,0),r.clearRect(0,0,e.width,e.height),r.restore()):r.clear(),r.save(),r._applyLineJoin(this),r._applyMiterLimit(this);let a=this.getAbsoluteTransform(t).getMatrix();r.transform(a[0],a[1],a[2],a[3],a[4],a[5]),o.call(this,r,this),r.restore();let u=e.pixelRatio;s&&i._applyShadow(this),l||(i._applyOpacity(this),i._applyGlobalCompositeOperation(this)),i.drawImage(e._canvas,e.x||0,e.y||0,e.width/u,e.height/u)}else{if(i._applyLineJoin(this),i._applyMiterLimit(this),!l){let e=this.getAbsoluteTransform(t).getMatrix();i.transform(e[0],e[1],e[2],e[3],e[4],e[5]),i._applyOpacity(this),i._applyGlobalCompositeOperation(this)}s&&i._applyShadow(this),o.call(this,i,this)}return i.restore(),this}drawHit(e,t,n=!1){if(!this.shouldDrawHit(t,n))return this;let r=this.getLayer(),i=e||r.hitCanvas,a=i&&i.getContext(),o=this.hitFunc()||this.sceneFunc(),s=this._getCanvasCache(),c=s&&s.hit;if(this.colorKey||I.warn(`Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()`),c){a.save();let e=this.getAbsoluteTransform(t).getMatrix();return a.transform(e[0],e[1],e[2],e[3],e[4],e[5]),this._drawCachedHitCanvas(a),a.restore(),this}if(!o)return this;if(a.save(),a._applyLineJoin(this),a._applyMiterLimit(this),this!==t){let e=this.getAbsoluteTransform(t).getMatrix();a.transform(e[0],e[1],e[2],e[3],e[4],e[5])}return o.call(this,a,this),a.restore(),this}drawHitFromCache(e=0){let t=this._getCanvasCache(),n=this._getCachedSceneCanvas(),r=t.hit,i=r.getContext(),a=r.getWidth(),o=r.getHeight();i.clear(),i.drawImage(n._canvas,0,0,a,o);try{let t=i.getImageData(0,0,a,o),n=t.data,r=n.length,s=I._hexToRgb(this.colorKey);for(let t=0;te?(n[t]=s.r,n[t+1]=s.g,n[t+2]=s.b,n[t+3]=255):n[t+3]=0;i.putImageData(t,0,0)}catch(e){I.error(`Unable to draw hit graph from cached scene canvas. `+e.message)}return this}hasPointerCapture(e){return Mt(e,this)}setPointerCapture(e){Nt(e,this)}releaseCapture(e){Pt(e,this)}};U.prototype._fillFunc=wn,U.prototype._strokeFunc=Tn,U.prototype._fillFuncHit=En,U.prototype._strokeFuncHit=Dn,U.prototype._centroid=!1,U.prototype.nodeType=`Shape`,P(U),U.prototype.eventListeners={},U.prototype.on(`shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva`,On),U.prototype.on(`shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva`,kn),U.prototype.on(`fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva`,An),U.prototype.on(`fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva`,jn),U.prototype.on(`fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva`,Mn),z.addGetterSetter(U,`stroke`,void 0,Ze()),z.addGetterSetter(U,`strokeWidth`,2,R()),z.addGetterSetter(U,`fillAfterStrokeEnabled`,!1),z.addGetterSetter(U,`hitStrokeWidth`,`auto`,Ye()),z.addGetterSetter(U,`strokeHitEnabled`,!0,$e()),z.addGetterSetter(U,`perfectDrawEnabled`,!0,$e()),z.addGetterSetter(U,`shadowForStrokeEnabled`,!0,$e()),z.addGetterSetter(U,`lineJoin`),z.addGetterSetter(U,`lineCap`),z.addGetterSetter(U,`miterLimit`),z.addGetterSetter(U,`sceneFunc`),z.addGetterSetter(U,`hitFunc`),z.addGetterSetter(U,`dash`),z.addGetterSetter(U,`dashOffset`,0,R()),z.addGetterSetter(U,`shadowColor`,void 0,Xe()),z.addGetterSetter(U,`shadowBlur`,0,R()),z.addGetterSetter(U,`shadowOpacity`,1,R()),z.addComponentsGetterSetter(U,`shadowOffset`,[`x`,`y`]),z.addGetterSetter(U,`shadowOffsetX`,0,R()),z.addGetterSetter(U,`shadowOffsetY`,0,R()),z.addGetterSetter(U,`fillPatternImage`),z.addGetterSetter(U,`fill`,void 0,Ze()),z.addGetterSetter(U,`fillPatternX`,0,R()),z.addGetterSetter(U,`fillPatternY`,0,R()),z.addGetterSetter(U,`fillLinearGradientColorStops`),z.addGetterSetter(U,`strokeLinearGradientColorStops`),z.addGetterSetter(U,`fillRadialGradientStartRadius`,0),z.addGetterSetter(U,`fillRadialGradientEndRadius`,0),z.addGetterSetter(U,`fillRadialGradientColorStops`),z.addGetterSetter(U,`fillPatternRepeat`,`repeat`),z.addGetterSetter(U,`fillEnabled`,!0),z.addGetterSetter(U,`strokeEnabled`,!0),z.addGetterSetter(U,`shadowEnabled`,!0),z.addGetterSetter(U,`dashEnabled`,!0),z.addGetterSetter(U,`strokeScaleEnabled`,!0),z.addGetterSetter(U,`fillPriority`,`color`),z.addComponentsGetterSetter(U,`fillPatternOffset`,[`x`,`y`]),z.addGetterSetter(U,`fillPatternOffsetX`,0,R()),z.addGetterSetter(U,`fillPatternOffsetY`,0,R()),z.addComponentsGetterSetter(U,`fillPatternScale`,[`x`,`y`]),z.addGetterSetter(U,`fillPatternScaleX`,1,R()),z.addGetterSetter(U,`fillPatternScaleY`,1,R()),z.addComponentsGetterSetter(U,`fillLinearGradientStartPoint`,[`x`,`y`]),z.addComponentsGetterSetter(U,`strokeLinearGradientStartPoint`,[`x`,`y`]),z.addGetterSetter(U,`fillLinearGradientStartPointX`,0),z.addGetterSetter(U,`strokeLinearGradientStartPointX`,0),z.addGetterSetter(U,`fillLinearGradientStartPointY`,0),z.addGetterSetter(U,`strokeLinearGradientStartPointY`,0),z.addComponentsGetterSetter(U,`fillLinearGradientEndPoint`,[`x`,`y`]),z.addComponentsGetterSetter(U,`strokeLinearGradientEndPoint`,[`x`,`y`]),z.addGetterSetter(U,`fillLinearGradientEndPointX`,0),z.addGetterSetter(U,`strokeLinearGradientEndPointX`,0),z.addGetterSetter(U,`fillLinearGradientEndPointY`,0),z.addGetterSetter(U,`strokeLinearGradientEndPointY`,0),z.addComponentsGetterSetter(U,`fillRadialGradientStartPoint`,[`x`,`y`]),z.addGetterSetter(U,`fillRadialGradientStartPointX`,0),z.addGetterSetter(U,`fillRadialGradientStartPointY`,0),z.addComponentsGetterSetter(U,`fillRadialGradientEndPoint`,[`x`,`y`]),z.addGetterSetter(U,`fillRadialGradientEndPointX`,0),z.addGetterSetter(U,`fillRadialGradientEndPointY`,0),z.addGetterSetter(U,`fillPatternRotation`,0),z.addGetterSetter(U,`fillRule`,void 0,Xe()),z.backCompat(U,{dashArray:`dash`,getDashArray:`getDash`,setDashArray:`getDash`,drawFunc:`sceneFunc`,getDrawFunc:`getSceneFunc`,setDrawFunc:`setSceneFunc`,drawHitFunc:`hitFunc`,getDrawHitFunc:`getHitFunc`,setDrawHitFunc:`setHitFunc`});var Nn=`beforeDraw`,Pn=`draw`,Fn=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],In=Fn.length,Ln=class extends H{constructor(e){super(e),this.canvas=new We,this.hitCanvas=new Ge({pixelRatio:1}),this._waitingForDraw=!1,this.on(`visibleChange.konva`,this._checkVisibility),this._checkVisibility(),this.on(`imageSmoothingEnabledChange.konva`,this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);let t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),e{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;let t=1,n=!1;for(;;){for(let r=0;r0)return{antialiased:!0};return{}}drawScene(e,t,n){let r=this.getLayer(),i=e||r&&r.getCanvas();return this._fire(Nn,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),H.prototype.drawScene.call(this,i,t,n),this._fire(Pn,{node:this}),this}drawHit(e,t){let n=this.getLayer(),r=e||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),H.prototype.drawHit.call(this,r,t),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){I.warn(`hitGraphEnabled method is deprecated. Please use layer.listening() instead.`),this.listening(e)}getHitGraphEnabled(e){return I.warn(`hitGraphEnabled method is deprecated. Please use layer.listening() instead.`),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;let e=this.parent;this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}destroy(){return I.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};Ln.prototype.nodeType=`Layer`,P(Ln),z.addGetterSetter(Ln,`imageSmoothingEnabled`,!0),z.addGetterSetter(Ln,`clearBeforeDraw`,!0),z.addGetterSetter(Ln,`hitGraphEnabled`,!0,$e());var Rn=class extends Ln{constructor(e){super(e),this.listening(!1),I.warn(`Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.`)}};Rn.prototype.nodeType=`FastLayer`,P(Rn);var zn=class extends H{_validateAdd(e){let t=e.getType();t!==`Group`&&t!==`Shape`&&I.throw(`You may only add groups and shapes to groups.`)}};zn.prototype.nodeType=`Group`,P(zn);var Bn=(function(){return ie.performance&&ie.performance.now?function(){return ie.performance.now()}:function(){return new Date().getTime()}})(),Vn=class e{constructor(t,n){this.id=e.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Bn(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(e){let t=[];return e&&(t=Array.isArray(e)?e:[e]),this.layers=t,this}getLayers(){return this.layers}addLayer(e){let t=this.layers,n=t.length;for(let r=0;rthis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return e===void 0&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=Wn,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire(`onPlay`)}reverse(){this.state=Gn,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire(`onReverse`)}seek(e){this.pause(),this._time=e,this.update(),this.fire(`onSeek`)}reset(){this.pause(),this._time=0,this.update(),this.fire(`onReset`)}finish(){this.pause(),this._time=this.duration,this.update(),this.fire(`onFinish`)}update(){this.setPosition(this.getPosition(this._time)),this.fire(`onUpdate`)}onEnterFrame(){let e=this.getTimer()-this._startTime;this.state===Wn?this.setTime(e):this.state===Gn&&this.setTime(this.duration-e)}pause(){this.state=Un,this.fire(`onPause`)}getTimer(){return new Date().getTime()}},Yn=class e{constructor(t){let n=this,r=t.node,i=r._id,a=t.easing||Xn.Linear,o=!!t.yoyo,s,c;s=t.duration===void 0?.3:t.duration===0?.001:t.duration,this.node=r,this._id=qn++;let l=r.getLayer()||(r instanceof N.Stage?r.getLayers():null);for(c in l||I.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new Vn(function(){n.tween.onEnterFrame()},l),this.tween=new Jn(c,function(e){n._tweenFunc(e)},a,0,1,s*1e3,o),this._addListeners(),e.attrs[i]||(e.attrs[i]={}),e.attrs[i][this._id]||(e.attrs[i][this._id]={}),e.tweens[i]||(e.tweens[i]={}),t)Hn[c]===void 0&&this._addAttr(c,t[c]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,n){let r=this.node,i=r._id,a,o,s,c,l,u=e.tweens[i][t];u&&delete e.attrs[i][u][t];let d=r.getAttr(t);if(I._isArray(n))if(a=[],o=Math.max(n.length,d.length),t===`points`&&n.length!==d.length&&(n.length>d.length?(c=d,d=I._prepareArrayForTween(d,n,r.closed())):(s=n,n=I._prepareArrayForTween(n,d,r.closed()))),t.indexOf(`fill`)===0)for(let e=0;e{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{let t=this.node,n=e.attrs[t._id][this._id];n.points&&n.points.trueEnd&&t.setAttr(`points`,n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{let t=this.node,n=e.attrs[t._id][this._id];n.points&&n.points.trueStart&&t.points(n.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(e){return this.tween.seek(e*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){let t=this.node._id,n=this._id,r=e.tweens[t];this.pause(),this.anim&&this.anim.stop();for(let n in r)delete e.tweens[t][n];delete e.attrs[t][n],e.tweens[t]&&(Object.keys(e.tweens[t]).length===0&&delete e.tweens[t],Object.keys(e.attrs[t]).length===0&&delete e.attrs[t])}};Yn.attrs={},Yn.tweens={},B.prototype.to=function(e){let t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()},new Yn(e).play()};var Xn={BackEaseIn(e,t,n,r){let i=1.70158;return n*(e/=r)*e*((i+1)*e-i)+t},BackEaseOut(e,t,n,r){let i=1.70158;return n*((e=e/r-1)*e*((i+1)*e+i)+1)+t},BackEaseInOut(e,t,n,r){let i=1.70158;return(e/=r/2)<1?n/2*(e*e*(((i*=1.525)+1)*e-i))+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t},ElasticEaseIn(e,t,n,r,i,a){let o=0;return e===0?t:(e/=r)===1?t+n:(a||=r*.3,!i||i0?e:t),c=1*t,l=a*(a>0?e:t),u=o*(o>0?t:e);return{x:s,y:n?-1*u:l,width:c-s,height:u-l}}};Qn.prototype._centroid=!0,Qn.prototype.className=`Arc`,Qn.prototype._attrsAffectingSize=[`innerRadius`,`outerRadius`,`angle`,`clockwise`],P(Qn),z.addGetterSetter(Qn,`innerRadius`,0,R()),z.addGetterSetter(Qn,`outerRadius`,0,R()),z.addGetterSetter(Qn,`angle`,0,R()),z.addGetterSetter(Qn,`clockwise`,!1,$e());function $n(e,t,n,r,i,a,o){let s=Math.sqrt((n-e)**2+(r-t)**2),c=Math.sqrt((i-n)**2+(a-r)**2),l=o*s/(s+c),u=o*c/(s+c);return[n-l*(i-e),r-l*(a-t),n+u*(i-e),r+u*(a-t)]}function er(e,t){let n=e.length,r=[];for(let i=2;i=0){let e=Math.sqrt(a);n.push((-r+e)/(2*t)),n.push((-r-e)/(2*t))}}}return n.filter(e=>e>0&&e<1).flatMap(e=>t.map(t=>{let n=1-e;return n*n*n*t[0]+3*n*n*e*t[1]+3*n*e*e*t[2]+e*e*e*t[3]}))}var nr=class extends U{constructor(e){super(e),this.on(`pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva`,function(){this._clearCache(`tensionPoints`)})}_sceneFunc(e){let t=this.points(),n=t.length,r=this.tension(),i=this.closed(),a=this.bezier();if(!n)return;let o=0;if(e.beginPath(),e.moveTo(t[0],t[1]),r!==0&&n>4){let r=this.getTensionPoints(),a=r.length;for(o=i?0:4,i||e.quadraticCurveTo(r[0],r[1],r[2],r[3]);o{let r,i,a=n/2;r=0;for(let n=0;n<20;n++)i=a*rr[20][n]+a,r+=ir[20][n]*cr(e,t,i);return a*r},sr=(e,t,n)=>{n===void 0&&(n=1);let r=e[0]-2*e[1]+e[2],i=t[0]-2*t[1]+t[2],a=2*e[1]-2*e[0],o=2*t[1]-2*t[0],s=4*(r*r+i*i),c=4*(r*a+i*o),l=a*a+o*o;if(s===0)return n*Math.sqrt((e[2]-e[0])**2+(t[2]-t[0])**2);let u=c/(2*s),d=l/s,f=n+u,p=d-u*u,m=f*f+p>0?Math.sqrt(f*f+p):0,h=u*u+p>0?Math.sqrt(u*u+p):0,g=u+Math.sqrt(u*u+p)===0?0:p*Math.log(Math.abs((f+m)/(u+h)));return Math.sqrt(s)/2*(f*m-u*h+g)};function cr(e,t,n){let r=lr(1,n,e),i=lr(1,n,t),a=r*r+i*i;return Math.sqrt(a)}var lr=(e,t,n)=>{let r=n.length-1,i,a;if(r===0)return 0;if(e===0){a=0;for(let e=0;e<=r;e++)a+=ar[r][e]*(1-t)**(r-e)*t**+e*n[e];return a}else{i=Array(r);for(let e=0;e{let r=1,i=e/t,a=(e-n(i))/t,o=0;for(;r>.001;){let s=n(i+a),c=Math.abs(e-s)/t;if(c500)break}return i},W=class e extends U{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on(`dataChange.konva`,function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=e.parsePathData(this.data()),this.pathLength=e.getPathLength(this.dataArray)}_sceneFunc(e){let t=this.dataArray;e.beginPath();let n=!1;for(let r=0;ro?i:o,f=i>o?1:i/o,p=i>o?o/i:1;e.translate(t,r),e.rotate(l),e.scale(f,p),e.arc(0,0,d,s,s+c,1-u),e.scale(1/f,1/p),e.rotate(-l),e.translate(-t,-r);break;case`z`:n=!0,e.closePath();break}}!n&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){let t=[];this.dataArray.forEach(function(n){if(n.command===`A`){let r=n.points[4],i=n.points[5],a=n.points[4]+i,o=Math.PI/180;if(Math.abs(r-a)a;i-=o){let r=e.getPointOnEllipticalArc(n.points[0],n.points[1],n.points[2],n.points[3],i,0);t.push(r.x,r.y)}else for(let i=r+o;in[i].pathLength;)t-=n[i].pathLength,++i;if(i===a)return r=n[i-1].points.slice(-2),{x:r[0],y:r[1]};if(t<.01)return n[i].command===`M`?(r=n[i].points.slice(0,2),{x:r[0],y:r[1]}):{x:n[i].start.x,y:n[i].start.y};let o=n[i],s=o.points;switch(o.command){case`L`:return e.getPointOnLine(t,o.start.x,o.start.y,s[0],s[1]);case`C`:return e.getPointOnCubicBezier(ur(t,e.getPathLength(n),e=>or([o.start.x,s[0],s[2],s[4]],[o.start.y,s[1],s[3],s[5]],e)),o.start.x,o.start.y,s[0],s[1],s[2],s[3],s[4],s[5]);case`Q`:return e.getPointOnQuadraticBezier(ur(t,e.getPathLength(n),e=>sr([o.start.x,s[0],s[2]],[o.start.y,s[1],s[3]],e)),o.start.x,o.start.y,s[0],s[1],s[2],s[3]);case`A`:let r=s[0],i=s[1],a=s[2],c=s[3],l=s[5],u=s[6],d=s[4];return d+=l*t/o.pathLength,e.getPointOnEllipticalArc(r,i,a,c,d,u)}return null}static getPointOnLine(e,t,n,r,i,a,o){a??=t,o??=n;let s=this.getLineLength(t,n,r,i);if(s<1e-10)return{x:t,y:n};if(r===t)return{x:a,y:o+(i>n?e:-e)};let c=(i-n)/(r-t),l=Math.sqrt(e*e/(1+c*c))*(r=0&&(d+=2,d>=7&&(d-=7));continue}if(d>=0){if(d===3){if(/^[01]{2}\d+(?:\.\d+)?$/.test(t)){u.push(parseInt(t[0],10)),u.push(parseInt(t[1],10)),u.push(parseFloat(t.slice(2))),d+=3,d>=7&&(d-=7);continue}if(t===`11`||t===`10`||t===`01`){u.push(parseInt(t[0],10)),u.push(parseInt(t[1],10)),d+=2,d>=7&&(d-=7);continue}if(t===`0`||t===`1`){u.push(parseInt(t,10)),d+=1,d>=7&&(d-=7);continue}}else if(d===4){if(/^[01]\d+(?:\.\d+)?$/.test(t)){u.push(parseInt(t[0],10)),u.push(parseFloat(t.slice(1))),d+=2,d>=7&&(d-=7);continue}if(t===`0`||t===`1`){u.push(parseInt(t,10)),d+=1,d>=7&&(d-=7);continue}}let e=parseFloat(t);isNaN(e)?u.push(0):u.push(e),d+=1,d>=7&&(d-=7)}else{let e=parseFloat(t);isNaN(e)?u.push(0):u.push(e)}}for(;u.length>0&&!isNaN(u[0]);){let e=``,t=[],r=o,a=s,c,l,d,f,p,m,h,g,_,v;switch(n){case`l`:o+=u.shift(),s+=u.shift(),e=`L`,t.push(o,s);break;case`L`:o=u.shift(),s=u.shift(),t.push(o,s);break;case`m`:let r=u.shift(),a=u.shift();if(o+=r,s+=a,e=`M`,i.length>2&&i[i.length-1].command===`z`){for(let e=i.length-2;e>=0;e--)if(i[e].command===`M`){o=i[e].points[0]+r,s=i[e].points[1]+a;break}}t.push(o,s),n=`l`;break;case`M`:o=u.shift(),s=u.shift(),e=`M`,t.push(o,s),n=`L`;break;case`h`:o+=u.shift(),e=`L`,t.push(o,s);break;case`H`:o=u.shift(),e=`L`,t.push(o,s);break;case`v`:s+=u.shift(),e=`L`,t.push(o,s);break;case`V`:s=u.shift(),e=`L`,t.push(o,s);break;case`C`:t.push(u.shift(),u.shift(),u.shift(),u.shift()),o=u.shift(),s=u.shift(),t.push(o,s);break;case`c`:t.push(o+u.shift(),s+u.shift(),o+u.shift(),s+u.shift()),o+=u.shift(),s+=u.shift(),e=`C`,t.push(o,s);break;case`S`:l=o,d=s,c=i[i.length-1],c.command===`C`&&(l=o+(o-c.points[2]),d=s+(s-c.points[3])),t.push(l,d,u.shift(),u.shift()),o=u.shift(),s=u.shift(),e=`C`,t.push(o,s);break;case`s`:l=o,d=s,c=i[i.length-1],c.command===`C`&&(l=o+(o-c.points[2]),d=s+(s-c.points[3])),t.push(l,d,o+u.shift(),s+u.shift()),o+=u.shift(),s+=u.shift(),e=`C`,t.push(o,s);break;case`Q`:t.push(u.shift(),u.shift()),o=u.shift(),s=u.shift(),t.push(o,s);break;case`q`:t.push(o+u.shift(),s+u.shift()),o+=u.shift(),s+=u.shift(),e=`Q`,t.push(o,s);break;case`T`:l=o,d=s,c=i[i.length-1],c.command===`Q`&&(l=o+(o-c.points[0]),d=s+(s-c.points[1])),o=u.shift(),s=u.shift(),e=`Q`,t.push(l,d,o,s);break;case`t`:l=o,d=s,c=i[i.length-1],c.command===`Q`&&(l=o+(o-c.points[0]),d=s+(s-c.points[1])),o+=u.shift(),s+=u.shift(),e=`Q`,t.push(l,d,o,s);break;case`A`:f=u.shift(),p=u.shift(),m=u.shift(),h=u.shift(),g=u.shift(),_=o,v=s,o=u.shift(),s=u.shift(),e=`A`,t=this.convertEndpointToCenterParameterization(_,v,o,s,h,g,f,p,m);break;case`a`:f=u.shift(),p=u.shift(),m=u.shift(),h=u.shift(),g=u.shift(),_=o,v=s,o+=u.shift(),s+=u.shift(),e=`A`,t=this.convertEndpointToCenterParameterization(_,v,o,s,h,g,f,p,m);break}i.push({command:e||n,points:t,start:{x:r,y:a},pathLength:this.calcLength(r,a,e||n,t)})}(n===`z`||n===`Z`)&&i.push({command:`z`,points:[],start:void 0,pathLength:0})}return i}static calcLength(t,n,r,i){let a,o,s,c,l=e;switch(r){case`L`:return l.getLineLength(t,n,i[0],i[1]);case`C`:return or([t,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case`Q`:return sr([t,i[0],i[2]],[n,i[1],i[3]],1);case`A`:a=0;let e=i[4],r=i[5],u=i[4]+r,d=Math.PI/180;if(Math.abs(e-u)u;c-=d)s=l.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],c,0),a+=l.getLineLength(o.x,o.y,s.x,s.y),o=s;else for(c=e+d;c1&&(o*=Math.sqrt(f),s*=Math.sqrt(f));let p=Math.sqrt((o*o*(s*s)-o*o*(d*d)-s*s*(u*u))/(o*o*(d*d)+s*s*(u*u)));i===a&&(p*=-1),isNaN(p)&&(p=0);let m=p*o*d/s,h=p*-s*u/o,g=(e+n)/2+Math.cos(l)*m-Math.sin(l)*h,_=(t+r)/2+Math.sin(l)*m+Math.cos(l)*h,v=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},y=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(v(e)*v(t))},b=function(e,t){return(e[0]*t[1]=1&&(w=0),a===0&&w>0&&(w-=2*Math.PI),a===1&&w<0&&(w+=2*Math.PI),[g,_,o,s,x,w,l,a]}};W.prototype.className=`Path`,W.prototype._attrsAffectingSize=[`data`],P(W),z.addGetterSetter(W,`data`);var dr=class extends nr{_sceneFunc(e){super._sceneFunc(e);let t=Math.PI*2,n=this.points(),r=n,i=this.tension()!==0&&n.length>4;i&&(r=this.getTensionPoints());let a=this.pointerLength(),o=n.length,s,c;if(i){let e=[r[r.length-4],r[r.length-3],r[r.length-2],r[r.length-1],n[o-2],n[o-1]],t=W.calcLength(r[r.length-4],r[r.length-3],`C`,e),i=W.getPointOnQuadraticBezier(Math.min(1,1-a/t),e[0],e[1],e[2],e[3],e[4],e[5]);s=n[o-2]-i.x,c=n[o-1]-i.y}else s=n[o-2]-n[o-4],c=n[o-1]-n[o-3];let l=(Math.atan2(c,s)+t)%t,u=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(n[o-2],n[o-1]),e.rotate(l),e.moveTo(0,0),e.lineTo(-a,u/2),e.lineTo(-a,-u/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(n[0],n[1]),i?(s=(r[0]+r[2])/2-n[0],c=(r[1]+r[3])/2-n[1]):(s=n[2]-n[0],c=n[3]-n[1]),e.rotate((Math.atan2(-c,-s)+t)%t),e.moveTo(0,0),e.lineTo(-a,u/2),e.lineTo(-a,-u/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){let t=this.dashEnabled();t&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),t&&(this.attrs.dashEnabled=!0)}getSelfRect(){let e=super.getSelfRect(),t=this.pointerWidth()/2;return{x:e.x,y:e.y-t,width:e.width,height:e.height+t*2}}};dr.prototype.className=`Arrow`,P(dr),z.addGetterSetter(dr,`pointerLength`,10,R()),z.addGetterSetter(dr,`pointerWidth`,10,R()),z.addGetterSetter(dr,`pointerAtBeginning`,!1),z.addGetterSetter(dr,`pointerAtEnding`,!0);var fr=class extends U{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}};fr.prototype._centroid=!0,fr.prototype.className=`Circle`,fr.prototype._attrsAffectingSize=[`radius`],P(fr),z.addGetterSetter(fr,`radius`,0,R());var pr=class extends U{_sceneFunc(e){let t=this.radiusX(),n=this.radiusY();e.beginPath(),e.save(),t!==n&&e.scale(1,n/t),e.arc(0,0,t,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}};pr.prototype.className=`Ellipse`,pr.prototype._centroid=!0,pr.prototype._attrsAffectingSize=[`radiusX`,`radiusY`],P(pr),z.addComponentsGetterSetter(pr,`radius`,[`x`,`y`]),z.addGetterSetter(pr,`radiusX`,0,R()),z.addGetterSetter(pr,`radiusY`,0,R());var mr=class e extends U{constructor(e){super(e),this._loadListener=()=>{this._requestDraw()},this.on(`imageChange.konva`,e=>{this._removeImageLoad(e.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){let e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener(`load`,this._loadListener)}_removeImageLoad(e){e&&e.removeEventListener&&e.removeEventListener(`load`,this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){let e=!!this.cornerRadius(),t=this.hasShadow();return e&&t?!0:super._useBufferCanvas(!0)}_sceneFunc(e){let t=this.getWidth(),n=this.getHeight(),r=this.cornerRadius(),i=this.attrs.image,a;if(i){let e=this.attrs.cropWidth,r=this.attrs.cropHeight;a=e&&r?[i,this.cropX(),this.cropY(),e,r,0,0,t,n]:[i,0,0,t,n]}(this.hasFill()||this.hasStroke()||r)&&(e.beginPath(),r?I.drawRoundedRectPath(e,t,n,r):e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)),i&&(r&&e.clip(),e.drawImage.apply(e,a))}_hitFunc(e){let t=this.width(),n=this.height(),r=this.cornerRadius();e.beginPath(),r?I.drawRoundedRectPath(e,t,n,r):e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.attrs.width??this.image()?.width??0}getHeight(){return this.attrs.height??this.image()?.height??0}static fromURL(t,n,r=null){let i=I.createImageElement();i.onload=function(){n(new e({image:i}))},i.onerror=r,i.crossOrigin=`Anonymous`,i.src=t}};mr.prototype.className=`Image`,mr.prototype._attrsAffectingSize=[`image`],P(mr),z.addGetterSetter(mr,`cornerRadius`,0,Je(4)),z.addGetterSetter(mr,`image`),z.addComponentsGetterSetter(mr,`crop`,[`x`,`y`,`width`,`height`]),z.addGetterSetter(mr,`cropX`,0,R()),z.addGetterSetter(mr,`cropY`,0,R()),z.addGetterSetter(mr,`cropWidth`,0,R()),z.addGetterSetter(mr,`cropHeight`,0,R());var hr=[`fontFamily`,`fontSize`,`fontStyle`,`padding`,`lineHeight`,`text`,`width`,`height`,`pointerDirection`,`pointerWidth`,`pointerHeight`],gr=`Change.konva`,_r=`none`,vr=`up`,yr=`right`,br=`down`,xr=`left`,Sr=hr.length,Cr=class extends zn{constructor(e){super(e),this.on(`add.konva`,function(e){this._addListeners(e.child),this._sync()})}getText(){return this.find(`Text`)[0]}getTag(){return this.find(`Tag`)[0]}_addListeners(e){let t=this,n,r=function(){t._sync()};for(n=0;n{t=Math.min(t,e.x),n=Math.max(n,e.x),r=Math.min(r,e.y),i=Math.max(i,e.y)}),{x:t,y:r,width:n-t,height:i-r}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}};Er.prototype.className=`RegularPolygon`,Er.prototype._centroid=!0,Er.prototype._attrsAffectingSize=[`radius`],P(Er),z.addGetterSetter(Er,`radius`,0,R()),z.addGetterSetter(Er,`sides`,0,R()),z.addGetterSetter(Er,`cornerRadius`,0,Je(4));var Dr=Math.PI*2,Or=class extends U{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,Dr,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),Dr,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}};Or.prototype.className=`Ring`,Or.prototype._centroid=!0,Or.prototype._attrsAffectingSize=[`innerRadius`,`outerRadius`],P(Or),z.addGetterSetter(Or,`innerRadius`,0,R()),z.addGetterSetter(Or,`outerRadius`,0,R());var kr=class extends U{constructor(e){super(e),this._updated=!0,this.anim=new Vn(()=>{let e=this._updated;return this._updated=!1,e}),this.on(`animationChange.konva`,function(){this.frameIndex(0)}),this.on(`frameIndexChange.konva`,function(){this._updated=!0}),this.on(`frameRateChange.konva`,function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(e){let t=this.animation(),n=this.frameIndex(),r=n*4,i=this.animations()[t],a=this.frameOffsets(),o=i[r+0],s=i[r+1],c=i[r+2],l=i[r+3],u=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,c,l),e.closePath(),e.fillStrokeShape(this)),u)if(a){let r=a[t],i=n*2;e.drawImage(u,o,s,c,l,r[i+0],r[i+1],c,l)}else e.drawImage(u,o,s,c,l,0,0,c,l)}_hitFunc(e){let t=this.animation(),n=this.frameIndex(),r=n*4,i=this.animations()[t],a=this.frameOffsets(),o=i[r+2],s=i[r+3];if(e.beginPath(),a){let r=a[t],i=n*2;e.rect(r[i+0],r[i+1],o,s)}else e.rect(0,0,o,s);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){let e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;let e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){let e=this.frameIndex(),t=this.animation();e{if(/\p{Emoji}/u.test(t)){let i=r[n+1];i&&/\p{Emoji_Modifier}|\u200D/u.test(i)?(e.push(t+i),r[n+1]=``):e.push(t)}else /\p{Regional_Indicator}{2}/u.test(t+(r[n+1]||``))?e.push(t+r[n+1]):n>0&&/\p{Mn}|\p{Me}|\p{Mc}/u.test(t)?e[e.length-1]+=t:t&&e.push(t);return e},[])}var Mr=`auto`,Nr=`center`,Pr=`inherit`,Fr=`justify`,Ir=`Change.konva`,Lr=`2d`,Rr=`-`,zr=`left`,Br=`text`,Vr=`Text`,Hr=`top`,Ur=`bottom`,Wr=`middle`,Gr=`normal`,Kr=`px `,qr=` `,Jr=`right`,Yr=`rtl`,Xr=`word`,Zr=`char`,Qr=`none`,$r=`…`,ei=[`direction`,`fontFamily`,`fontSize`,`fontStyle`,`fontVariant`,`padding`,`align`,`verticalAlign`,`lineHeight`,`text`,`width`,`height`,`wrap`,`ellipsis`,`letterSpacing`],ti=ei.length,ni=null;function ri(){if(ni!==null)return ni;ni=!1;try{let e=document.createElement(`canvas`);e.width=10,e.height=10;let t=e.getContext(Lr);if(t){t.globalAlpha=0,t.shadowColor=`black`,t.shadowBlur=5,t.shadowOffsetX=5,t.shadowOffsetY=5,t.fillStyle=`black`,t.font=`10px Arial`,t.fillText(`X`,0,10);let e=t.getImageData(0,0,10,10).data;for(let t=3;t0){ni=!0;break}}}catch{}return ni}function ii(e){return e.split(`,`).map(e=>{e=e.trim();let t=e.indexOf(` `)>=0,n=e.indexOf(`"`)>=0||e.indexOf(`'`)>=0;return t&&!n&&(e=`"${e}"`),e}).join(`, `)}var ai;function oi(){return ai||(ai=I.createCanvasElement().getContext(Lr),ai)}function si(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function ci(e){e.setAttr(`miterLimit`,2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function li(e){return e||={},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||`black`),e}var G=class extends U{constructor(e){super(li(e)),this._partialTextX=0,this._partialTextY=0;for(let e=0;ee+jr(t.text).length,0);f({char:s,index:a+n,x:o,y:y+0,lineIndex:v,column:a,isLastInLine:x,width:this.measureSize(s).width,context:e})}e.fillStrokeShape(this),f&&e.restore(),o+=this.measureSize(s).width+d}}else d!==0&&e.setAttr(`letterSpacing`,`${d}px`),this._partialTextX=o,this._partialTextY=y+0,this._partialText=m,e.fillStrokeShape(this);if(_){e.save(),e.beginPath();let t=N.legacyTextRendering?0:-Math.round(i/4),n=S;e.moveTo(n,y+0+t);let a=l===Fr&&!x?u-r*2:b;e.lineTo(n+Math.round(a),y+0+t),e.lineWidth=i/15,e.strokeStyle=this._getLinearGradient()||p,e.stroke(),e.restore()}e.restore(),n>1&&(y+=a)}}_hitFunc(e){let t=this.getWidth(),n=this.getHeight();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}setText(e){let t=I._isString(e)?e:e==null?``:e+``;return this._setAttr(Br,t),this}getWidth(){return this.attrs.width===Mr||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===Mr||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return I.warn(`text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height.`),this.textHeight}measureSize(e){let t=oi(),n=this.fontSize(),r;t.save(),t.font=this._getContextFont(),r=t.measureText(e),t.restore();let i=n/100;return{actualBoundingBoxAscent:r.actualBoundingBoxAscent??71.58203125*i,actualBoundingBoxDescent:r.actualBoundingBoxDescent??0,actualBoundingBoxLeft:r.actualBoundingBoxLeft??-7.421875*i,actualBoundingBoxRight:r.actualBoundingBoxRight??75.732421875*i,alphabeticBaseline:r.alphabeticBaseline??0,emHeightAscent:r.emHeightAscent??100*i,emHeightDescent:r.emHeightDescent??-20*i,fontBoundingBoxAscent:r.fontBoundingBoxAscent??91*i,fontBoundingBoxDescent:r.fontBoundingBoxDescent??21*i,hangingBaseline:r.hangingBaseline??72.80000305175781*i,ideographicBaseline:r.ideographicBaseline??-21*i,width:r.width,height:n}}_getContextFont(){return this.fontStyle()+qr+this.fontVariant()+qr+(this.fontSize()+Kr)+ii(this.fontFamily())}_addTextLine(e){this.align()===Fr&&(e=e.trim());let t=this._getTextWidth(e);return this.textArr.push({text:e,width:t,lastInParagraph:!1})}_getTextWidth(e){let t=this.letterSpacing(),n=e.length;return oi().measureText(e).width+t*n}_setTextData(){let e=this.text().split(` -`),t=+this.fontSize(),n=0,r=this.lineHeight()*t,i=this.attrs.width,a=this.attrs.height,o=i!==Mr&&i!==void 0,s=a!==Mr&&a!==void 0,c=this.padding(),l=i-c*2,u=a-c*2,d=0,f=this.wrap(),p=f!==Zr&&f!==Qr,m=this.ellipsis();this.textArr=[],oi().font=this._getContextFont();let h=m?this._getTextWidth($r):0;for(let t=0,i=e.length;tl)for(;a.length>0;){let e=0,t=jr(a).length,i=``,o=0;for(;e>>1,c=jr(a).slice(0,n+1).join(``),f=this._getTextWidth(c);(m&&s&&d+r>u?f+h:f)<=l?(e=n+1,i=c,o=f):t=n}if(i){if(p){let t=jr(a),n=jr(i),r=t[n.length],s=r===qr||r===Rr,c;if(s&&o<=l)c=n.length;else{let e=n.lastIndexOf(qr),t=n.lastIndexOf(Rr);c=Math.max(e,t)+1}c>0&&(e=c,i=t.slice(0,e).join(``),o=this._getTextWidth(i))}if(i=i.trimRight(),this._addTextLine(i),n=Math.max(n,o),d+=r,this._shouldHandleEllipsis(d)){this._tryToAddEllipsisToLastLine();break}if(a=jr(a).slice(e).join(``).trimLeft(),a.length>0&&(c=this._getTextWidth(a),c<=l)){this._addTextLine(a),d+=r,n=Math.max(n,c);break}}else break}else this._addTextLine(a),d+=r,n=Math.max(n,c),this._shouldHandleEllipsis(d)&&tu)break}this.textHeight=t,this.textWidth=n}_shouldHandleEllipsis(e){let t=+this.fontSize(),n=this.lineHeight()*t,r=this.attrs.height,i=r!==Mr&&r!==void 0,a=r-this.padding()*2;return this.wrap()===Qr||i&&e+n>a}_tryToAddEllipsisToLastLine(){let e=this.attrs.width,t=e!==Mr&&e!==void 0,n=e-this.padding()*2,r=this.ellipsis(),i=this.textArr[this.textArr.length-1];!i||!r||(t&&(this._getTextWidth(i.text+$r)this.pathLength?null:W.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=W.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr(`font`,this._getContextFont()),e.setAttr(`textBaseline`,this.textBaseline()),e.setAttr(`textAlign`,`left`),e.save();let t=this.textDecoration(),n=this.fill(),r=this.fontSize(),i=this.glyphInfo,a=t.indexOf(`underline`)!==-1,o=t.indexOf(`line-through`)!==-1;a&&e.beginPath();for(let t=0;t=1){let n=t[0].p0;e.moveTo(n.x,n.y)}for(let n=0;nthis.pathLength&&f-this.pathLength<=c?this.pathLength:f);if(!p)return;let m=W.getLineLength(r.x,r.y,p.x,p.y),h=0;if(s)try{h=s(t[n-1].char,i)*this.fontSize()}catch{h=0}r.x+=h,p.x+=h,this.textWidth+=h;let g=W.getPointOnLine(h+m/2,r.x,r.y,p.x,p.y),_=Math.atan2(p.y-r.y,p.x-r.x);this.glyphInfo.push({transposeX:g.x,transposeY:g.y,text:e[n],rotation:_,p0:r,p1:p,width:m}),d+=u}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};let e=[];this.glyphInfo.forEach(function(t){e.push(t.p0.x),e.push(t.p0.y),e.push(t.p1.x),e.push(t.p1.y)});let t=e[0]||0,n=e[0]||0,r=e[1]||0,i=e[1]||0,a,o;for(let s=0;se+`.${mi}`).join(` `),gi=`nodesRect`,_i=[`widthChange`,`heightChange`,`scaleXChange`,`scaleYChange`,`skewXChange`,`skewYChange`,`rotationChange`,`offsetXChange`,`offsetYChange`,`transformsEnabledChange`,`strokeWidthChange`,`draggableChange`],vi={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},yi=`ontouchstart`in N._global;function bi(e,t,n){if(e===`rotater`)return n;t+=I.degToRad(vi[e]||0);let r=(I.radToDeg(t)%360+360)%360;return I._inRange(r,337.5,360)||I._inRange(r,0,22.5)?`ns-resize`:I._inRange(r,22.5,67.5)?`nesw-resize`:I._inRange(r,67.5,112.5)?`ew-resize`:I._inRange(r,112.5,157.5)?`nwse-resize`:I._inRange(r,157.5,202.5)?`ns-resize`:I._inRange(r,202.5,247.5)?`nesw-resize`:I._inRange(r,247.5,292.5)?`ew-resize`:I._inRange(r,292.5,337.5)?`nwse-resize`:(I.error(`Transformer has unknown angle for cursor detection: `+r),`pointer`)}var xi=[`top-left`,`top-center`,`top-right`,`middle-right`,`middle-left`,`bottom-left`,`bottom-center`,`bottom-right`],Si=1e8;function Ci(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function wi(e,t,n){let r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return{...e,rotation:e.rotation+t,x:r,y:i}}function Ti(e,t){return wi(e,t,Ci(e))}function Ei(e,t,n){let r=t;for(let i=0;ie.isAncestorOf(this)?(I.error(`Konva.Transformer cannot be an a child of the node you are trying to attach`),!1):!0);return this._nodes=e=t,e.length===1&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(e=>{let t=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(e._attrsAffectingSize.length){let n=e._attrsAffectingSize.map(e=>e+`Change.`+this._getEventNamespace()).join(` `);e.on(n,t)}e.on(_i.map(e=>e+`.${this._getEventNamespace()}`).join(` `),t),e.on(`absoluteTransformChange.${this._getEventNamespace()}`,t),this._proxyDrag(e)}),this._resetTransformCache(),this.findOne(`.top-left`)&&this.update(),this}_proxyDrag(e){let t;e.on(`dragstart.${this._getEventNamespace()}`,n=>{t=e.getAbsolutePosition(),!this.isDragging()&&e!==this.findOne(`.back`)&&this.startDrag(n,!1)}),e.on(`dragmove.${this._getEventNamespace()}`,n=>{if(!t)return;let r=e.getAbsolutePosition(),i=r.x-t.x,a=r.y-t.y;this.nodes().forEach(t=>{if(t===e||t.isDragging())return;let r=t.getAbsolutePosition();t.setAbsolutePosition({x:r.x+i,y:r.y+a}),t.startDrag(n)}),t=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(e=>{e.off(`.`+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(gi),this._clearCache(`transform`),this._clearSelfAndDescendantCache(`absoluteTransform`)}_getNodeRect(){return this._getCache(gi,this.__getNodeRect)}__getNodeShape(e,t=this.rotation(),n){let r=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),i=e.getAbsoluteScale(n),a=e.getAbsolutePosition(n),o=r.x*i.x-e.offsetX()*i.x,s=r.y*i.y-e.offsetY()*i.y,c=(N.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2);return wi({x:a.x+o*Math.cos(c)+s*Math.sin(-c),y:a.y+s*Math.cos(c)+o*Math.sin(c),width:r.width*i.x,height:r.height*i.y,rotation:c},-N.getAngle(t),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-Si,y:-Si,width:0,height:0,rotation:0};let e=[];this.nodes().map(t=>{let n=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),r=[{x:n.x,y:n.y},{x:n.x+n.width,y:n.y},{x:n.x+n.width,y:n.y+n.height},{x:n.x,y:n.y+n.height}],i=t.getAbsoluteTransform();r.forEach(function(t){let n=i.point(t);e.push(n)})});let t=new F;t.rotate(-N.getAngle(this.rotation()));let n=1/0,r=1/0,i=-1/0,a=-1/0;e.forEach(function(e){let o=t.point(e);n===void 0&&(n=i=o.x,r=a=o.y),n=Math.min(n,o.x),r=Math.min(r,o.y),i=Math.max(i,o.x),a=Math.max(a,o.y)}),t.invert();let o=t.point({x:n,y:r});return{x:o.x,y:o.y,width:i-n,height:a-r,rotation:N.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),xi.forEach(e=>{this._createAnchor(e)}),this._createAnchor(`rotater`),this._elementsCreated=!0}_createAnchor(e){let t=new Tr({stroke:`rgb(0, 161, 255)`,fill:`white`,strokeWidth:1,name:e+` _anchor`,dragDistance:0,draggable:!0,hitStrokeWidth:yi?10:`auto`}),n=this;t.on(`mousedown touchstart`,function(e){n._handleMouseDown(e)}),t.on(`dragstart`,e=>{t.stopDrag(),e.cancelBubble=!0}),t.on(`dragend`,e=>{e.cancelBubble=!0}),t.on(`mouseenter`,()=>{let n=bi(e,N.getAngle(this.rotation()),this.rotateAnchorCursor());t.getStage().content&&(t.getStage().content.style.cursor=n),this._cursorChange=!0}),t.on(`mouseout`,()=>{t.getStage().content&&(t.getStage().content.style.cursor=``),this._cursorChange=!1}),this.add(t)}_createBack(){let e=new U({name:`back`,width:0,height:0,sceneFunc(e,t){let n=t.getParent(),r=n.padding(),i=t.width(),a=t.height();if(e.beginPath(),e.rect(-r,-r,i+r*2,a+r*2),n.rotateEnabled()&&n.rotateLineVisible()){let t=n.rotateAnchorAngle(),r=n.rotateAnchorOffset(),o=I.degToRad(t),s=Math.sin(o),c=-Math.cos(o),l=i/2,u=a/2,d=1/0;c<0?d=Math.min(d,-u/c):c>0&&(d=Math.min(d,(a-u)/c)),s<0?d=Math.min(d,-l/s):s>0&&(d=Math.min(d,(i-l)/s));let f=l+s*d,p=u+c*d,m=I._sign(a),h=f+s*r*m,g=p+c*r*m;e.moveTo(f,p),e.lineTo(h,g)}e.fillStrokeShape(t)},hitFunc:(e,t)=>{if(!this.shouldOverdrawWholeArea())return;let n=this.padding();e.beginPath(),e.rect(-n,-n,t.width()+n*2,t.height()+n*2),e.fillStrokeShape(t)}});this.add(e),this._proxyDrag(e),e.on(`dragstart`,e=>{e.cancelBubble=!0}),e.on(`dragmove`,e=>{e.cancelBubble=!0}),e.on(`dragend`,e=>{e.cancelBubble=!0}),this.on(`dragmove`,e=>{this.update()})}_handleMouseDown(e){if(this._transforming)return;this._movingAnchorName=e.target.name().split(` `)[0];let t=this._getNodeRect(),n=t.width,r=t.height,i=Math.sqrt(n**2+r**2);this.sin=Math.abs(r/i),this.cos=Math.abs(n/i),typeof window<`u`&&(window.addEventListener(`mousemove`,this._handleMouseMove),window.addEventListener(`touchmove`,this._handleMouseMove),window.addEventListener(`mouseup`,this._handleMouseUp,!0),window.addEventListener(`touchend`,this._handleMouseUp,!0)),this._transforming=!0;let a=e.target.getAbsolutePosition(),o=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:o.x-a.x,y:o.y-a.y},Di++,this._fire(`transformstart`,{evt:e.evt,target:this.getNode()}),this._nodes.forEach(t=>{t._fire(`transformstart`,{evt:e.evt,target:t})})}_handleMouseMove(e){let t,n,r,i=this.findOne(`.`+this._movingAnchorName),a=i.getStage();a.setPointersPositions(e);let o=a.getPointerPosition(),s={x:o.x-this._anchorDragOffset.x,y:o.y-this._anchorDragOffset.y},c=i.getAbsolutePosition();this.anchorDragBoundFunc()&&(s=this.anchorDragBoundFunc()(c,s,e)),i.setAbsolutePosition(s);let l=i.getAbsolutePosition();if(c.x===l.x&&c.y===l.y)return;if(this._movingAnchorName===`rotater`){let r=this._getNodeRect();t=i.x()-r.width/2,n=-i.y()+r.height/2;let a=N.getAngle(this.rotateAnchorAngle()),o=Math.atan2(-n,t)+Math.PI/2-a;r.height<0&&(o-=Math.PI);let s=N.getAngle(this.rotation())+o,c=N.getAngle(this.rotationSnapTolerance()),l=Ti(r,Ei(this.rotationSnaps(),s,c)-r.rotation);this._fitNodesInto(l,e);return}let u=this.shiftBehavior(),d;d=u===`inverted`?this.keepRatio()&&!e.shiftKey:u===`none`?this.keepRatio():this.keepRatio()||e.shiftKey;let f=this.centeredScaling()||e.altKey;if(this._movingAnchorName===`top-left`){if(d){let e=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(`.bottom-right`).x(),y:this.findOne(`.bottom-right`).y()};r=Math.sqrt((e.x-i.x())**2+(e.y-i.y())**2);let a=this.findOne(`.top-left`).x()>e.x?-1:1,o=this.findOne(`.top-left`).y()>e.y?-1:1;t=r*this.cos*a,n=r*this.sin*o,this.findOne(`.top-left`).x(e.x-t),this.findOne(`.top-left`).y(e.y-n)}}else if(this._movingAnchorName===`top-center`)this.findOne(`.top-left`).y(i.y());else if(this._movingAnchorName===`top-right`){if(d){let e=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(`.bottom-left`).x(),y:this.findOne(`.bottom-left`).y()};r=Math.sqrt((i.x()-e.x)**2+(e.y-i.y())**2);let a=this.findOne(`.top-right`).x()e.y?-1:1;t=r*this.cos*a,n=r*this.sin*o,this.findOne(`.top-right`).x(e.x+t),this.findOne(`.top-right`).y(e.y-n)}var p=i.position();this.findOne(`.top-left`).y(p.y),this.findOne(`.bottom-right`).x(p.x)}else if(this._movingAnchorName===`middle-left`)this.findOne(`.top-left`).x(i.x());else if(this._movingAnchorName===`middle-right`)this.findOne(`.bottom-right`).x(i.x());else if(this._movingAnchorName===`bottom-left`){if(d){let e=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(`.top-right`).x(),y:this.findOne(`.top-right`).y()};r=Math.sqrt((e.x-i.x())**2+(i.y()-e.y)**2);let a=e.x{var n;t._fire(`transformend`,{evt:e,target:t}),(n=t.getLayer())==null||n.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(e,t){let n=this._getNodeRect();if(I._inRange(e.width,-this.padding()*2-1,1)){this.update();return}if(I._inRange(e.height,-this.padding()*2-1,1)){this.update();return}let r=new F;if(r.rotate(N.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf(`left`)>=0){let t=r.point({x:-this.padding()*2,y:0});e.x+=t.x,e.y+=t.y,e.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace(`left`,`right`),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf(`right`)>=0){let t=r.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace(`right`,`left`),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.width+=this.padding()*2}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf(`top`)>=0){let t=r.point({x:0,y:-this.padding()*2});e.x+=t.x,e.y+=t.y,this._movingAnchorName=this._movingAnchorName.replace(`top`,`bottom`),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.height+=this.padding()*2}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf(`bottom`)>=0){let t=r.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace(`bottom`,`top`),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.height+=this.padding()*2}if(this.boundBoxFunc()){let t=this.boundBoxFunc()(n,e);t?e=t:I.warn(`boundBoxFunc returned falsy. You should return new bound rect from it!`)}let i=1e7,a=new F;a.translate(n.x,n.y),a.rotate(n.rotation),a.scale(n.width/i,n.height/i);let o=new F,s=e.width/i,c=e.height/i;this.flipEnabled()===!1?(o.translate(e.x,e.y),o.rotate(e.rotation),o.translate(e.width<0?e.width:0,e.height<0?e.height:0),o.scale(Math.abs(s),Math.abs(c))):(o.translate(e.x,e.y),o.rotate(e.rotation),o.scale(s,c));let l=o.multiply(a.invert());this._nodes.forEach(e=>{var t;if(!e.getStage())return;let n=e.getParent().getAbsoluteTransform(),r=e.getTransform().copy();r.translate(e.offsetX(),e.offsetY());let i=new F;i.multiply(n.copy().invert()).multiply(l).multiply(n).multiply(r);let a=i.decompose();e.setAttrs(a),(t=e.getLayer())==null||t.batchDraw()}),this.rotation(I._getRotation(e.rotation)),this._nodes.forEach(e=>{this._fire(`transform`,{evt:t,target:e}),e._fire(`transform`,{evt:t,target:e})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,t){this.findOne(e).setAttrs(t)}update(){var e;let t=this._getNodeRect();this.rotation(I._getRotation(t.rotation));let n=t.width,r=t.height,i=this.enabledAnchors(),a=this.resizeEnabled(),o=this.padding(),s=this.anchorSize(),c=this.find(`._anchor`);c.forEach(e=>{e.setAttrs({width:s,height:s,offsetX:s/2,offsetY:s/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(`.top-left`,{x:0,y:0,offsetX:s/2+o,offsetY:s/2+o,visible:a&&i.indexOf(`top-left`)>=0}),this._batchChangeChild(`.top-center`,{x:n/2,y:0,offsetY:s/2+o,visible:a&&i.indexOf(`top-center`)>=0}),this._batchChangeChild(`.top-right`,{x:n,y:0,offsetX:s/2-o,offsetY:s/2+o,visible:a&&i.indexOf(`top-right`)>=0}),this._batchChangeChild(`.middle-left`,{x:0,y:r/2,offsetX:s/2+o,visible:a&&i.indexOf(`middle-left`)>=0}),this._batchChangeChild(`.middle-right`,{x:n,y:r/2,offsetX:s/2-o,visible:a&&i.indexOf(`middle-right`)>=0}),this._batchChangeChild(`.bottom-left`,{x:0,y:r,offsetX:s/2+o,offsetY:s/2-o,visible:a&&i.indexOf(`bottom-left`)>=0}),this._batchChangeChild(`.bottom-center`,{x:n/2,y:r,offsetY:s/2-o,visible:a&&i.indexOf(`bottom-center`)>=0}),this._batchChangeChild(`.bottom-right`,{x:n,y:r,offsetX:s/2-o,offsetY:s/2-o,visible:a&&i.indexOf(`bottom-right`)>=0});let l=this.rotateAnchorAngle(),u=this.rotateAnchorOffset(),d=I.degToRad(l),f=Math.sin(d),p=-Math.cos(d),m=n/2,h=r/2,g=1/0;p<0?g=Math.min(g,-h/p):p>0&&(g=Math.min(g,(r-h)/p)),f<0?g=Math.min(g,-m/f):f>0&&(g=Math.min(g,(n-m)/f));let _=m+f*g,v=h+p*g,y=I._sign(r);this._batchChangeChild(`.rotater`,{x:_+f*u*y,y:v+p*u*y-o*p,visible:this.rotateEnabled()}),this._batchChangeChild(`.back`,{width:n,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),draggable:this.nodes().some(e=>e.draggable()),x:0,y:0});let b=this.anchorStyleFunc();b&&c.forEach(e=>{b(e)}),(e=this.getLayer())==null||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();let e=this.findOne(`.`+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=``),zn.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}add(...e){return this._elementsCreated?(I.error(`You cannot add external nodes to the Transformer. Use tr.nodes([node]) instead.`),this):super.add(...e)}toObject(){return B.prototype.toObject.call(this)}clone(e){return B.prototype.clone.call(this,e)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};q.isTransforming=()=>Di>0;function Oi(e){return e instanceof Array||I.warn(`enabledAnchors value should be an array`),e instanceof Array&&e.forEach(function(e){xi.indexOf(e)===-1&&I.warn(`Unknown anchor name: `+e+`. Available names are: `+xi.join(`, `))}),e||[]}q.prototype.className=`Transformer`,P(q),z.addGetterSetter(q,`enabledAnchors`,xi,Oi),z.addGetterSetter(q,`flipEnabled`,!0,$e()),z.addGetterSetter(q,`resizeEnabled`,!0),z.addGetterSetter(q,`anchorSize`,10,R()),z.addGetterSetter(q,`rotateEnabled`,!0),z.addGetterSetter(q,`rotateLineVisible`,!0),z.addGetterSetter(q,`rotationSnaps`,[]),z.addGetterSetter(q,`rotateAnchorOffset`,50,R()),z.addGetterSetter(q,`rotateAnchorAngle`,0,R()),z.addGetterSetter(q,`rotateAnchorCursor`,`crosshair`),z.addGetterSetter(q,`rotationSnapTolerance`,5,R()),z.addGetterSetter(q,`borderEnabled`,!0),z.addGetterSetter(q,`anchorStroke`,`rgb(0, 161, 255)`),z.addGetterSetter(q,`anchorStrokeWidth`,1,R()),z.addGetterSetter(q,`anchorFill`,`white`),z.addGetterSetter(q,`anchorCornerRadius`,0,R()),z.addGetterSetter(q,`borderStroke`,`rgb(0, 161, 255)`),z.addGetterSetter(q,`borderStrokeWidth`,1,R()),z.addGetterSetter(q,`borderDash`),z.addGetterSetter(q,`keepRatio`,!0),z.addGetterSetter(q,`shiftBehavior`,`default`),z.addGetterSetter(q,`centeredScaling`,!1),z.addGetterSetter(q,`ignoreStroke`,!1),z.addGetterSetter(q,`padding`,0,R()),z.addGetterSetter(q,`nodes`),z.addGetterSetter(q,`node`),z.addGetterSetter(q,`boundBoxFunc`),z.addGetterSetter(q,`anchorDragBoundFunc`),z.addGetterSetter(q,`anchorStyleFunc`),z.addGetterSetter(q,`shouldOverdrawWholeArea`,!1),z.addGetterSetter(q,`useSingleNodeRotation`,!0),z.backCompat(q,{lineEnabled:`borderEnabled`,rotateHandlerOffset:`rotateAnchorOffset`,enabledHandlers:`enabledAnchors`});var ki=class extends U{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,N.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}};ki.prototype.className=`Wedge`,ki.prototype._centroid=!0,ki.prototype._attrsAffectingSize=[`radius`],P(ki),z.addGetterSetter(ki,`radius`,0,R()),z.addGetterSetter(ki,`angle`,0,R()),z.addGetterSetter(ki,`clockwise`,!1),z.backCompat(ki,{angleDeg:`angle`,getAngleDeg:`getAngle`,setAngleDeg:`setAngle`});function Ai(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var ji=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],Mi=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function Ni(e,t){let n=e.data,r=e.width,i=e.height,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,ee=t+t+1,te=r-1,ne=i-1,T=t+1,E=T*(T+1)/2,re=new Ai,D=ji[t],O=Mi[t],k=null,A=re,j=null,M=null;for(let e=1;e>O,C===0?n[o]=n[o+1]=n[o+2]=0:(C=255/C,n[o]=(c*D>>O)*C,n[o+1]=(l*D>>O)*C,n[o+2]=(u*D>>O)*C),c-=f,l-=p,u-=m,d-=h,f-=j.r,p-=j.g,m-=j.b,h-=j.a,a=s+((a=e+t+1)>O,C>0?(C=255/C,n[a]=(c*D>>O)*C,n[a+1]=(l*D>>O)*C,n[a+2]=(u*D>>O)*C):n[a]=n[a+1]=n[a+2]=0,c-=f,l-=p,u-=m,d-=h,f-=j.r,p-=j.g,m-=j.b,h-=j.a,a=e+((a=t+T)0&&Ni(e,t)};z.addGetterSetter(B,`blurRadius`,0,R(),z.afterSetFilter);var Fi=function(e){let t=this.brightness()*255,n=e.data,r=n.length;for(let e=0;e255?255:i,a=a<0?0:a>255?255:a,o=o<0?0:o>255?255:o,n[e]=i,n[e+1]=a,n[e+2]=o};z.addGetterSetter(B,`contrast`,0,R(),z.afterSetFilter);var Ri=function(e){let t=e.data,n=e.width,r=e.height,i=Math.min(1,Math.max(0,this.embossStrength?.call(this)??.5)),a=Math.min(1,Math.max(0,this.embossWhiteLevel?.call(this)??.5)),o={"top-left":315,top:270,"top-right":225,right:180,"bottom-right":135,bottom:90,"bottom-left":45,left:0}[this.embossDirection?.call(this)??`top-left`]??315,s=!!(this.embossBlend?.call(this)??!1),c=i*10,l=a*255,u=o*Math.PI/180,d=Math.cos(u),f=Math.sin(u),p=128/1020*c,m=new Uint8ClampedArray(t),h=new Float32Array(n*r);for(let e=0,n=0;ne<0?0:e>255?255:e;for(let e=1;ei&&(i=a),c=t[e+1],cs&&(s=c),d=t[e+2],du&&(u=d);i===r&&(i=255,r=0),s===o&&(s=255,o=0),u===l&&(u=255,l=0);let p,m,h,g,_,v;if(f>0)p=i+f*(255-i),m=r-f*(r-0),h=s+f*(255-s),g=o-f*(o-0),_=u+f*(255-u),v=l-f*(l-0);else{let e=(i+r)*.5;p=i+f*(i-e),m=r+f*(r-e);let t=(s+o)*.5;h=s+f*(s-t),g=o+f*(o-t);let n=(u+l)*.5;_=u+f*(u-n),v=l+f*(l-n)}for(let e=0;el?f:l;let p=o,m=a,h=360/m*Math.PI/180;for(let e=0;el?f:l;let p=o,m=a,h=n.polarRotation||0,g,_;for(u=0;ut&&(b=y,x=0,S=-1),i=0;i=0&&d=0&&f=0&&d=0&&f=1020?255:0}return o}function ta(e,t,n){let r=[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),o=[];for(let s=0;s=0&&d=0&&f=n))for(let t=f;t=r)continue;let i=(n*t+e)*4;a+=o[i+0],s+=o[i+1],c+=o[i+2],l+=o[i+3],m+=1}a/=m,s/=m,c/=m,l/=m;for(let e=u;e=n))for(let t=f;t=r)continue;let i=(n*t+e)*4;o[i+0]=a,o[i+1]=s,o[i+2]=c,o[i+3]=l}}};z.addGetterSetter(B,`pixelSize`,8,R(),z.afterSetFilter);var aa=function(e){let t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,i=255/t;for(let e=0;e255?255:e<0?0:Math.round(e)}),z.addGetterSetter(B,`green`,0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)}),z.addGetterSetter(B,`blue`,0,qe,z.afterSetFilter);var sa=function(e){let t=e.data,n=t.length,r=this.red(),i=this.green(),a=this.blue(),o=this.alpha();for(let e=0;e255?255:e<0?0:Math.round(e)}),z.addGetterSetter(B,`green`,0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)}),z.addGetterSetter(B,`blue`,0,qe,z.afterSetFilter),z.addGetterSetter(B,`alpha`,1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});var ca=function(e){let t=e.data,n=t.length;for(let e=0;e=128&&(t[e]=255-n,t[e+1]=255-r,t[e+2]=255-i)}return e},ua=function(e){let t=this.threshold()*255,n=e.data,r=n.length;for(let e=0;e{i(e.getAttr(r))})}}var ya=`V`;function ba(e){function t(e){return e?.__konvaNode?e:e?.parent?t(e.parent):(console.error(`vue-konva error: Can not find parent node`),null)}return t(e.parent)}function xa(e){return e.component?e.component.__konvaNode||xa(e.component.subTree):null}function Sa(e){let{el:t,component:n}=e,r=xa(e);if(t?.tagName&&n&&!r){let e=t.tagName.toLowerCase();return console.error(`vue-konva error: You are trying to render "${e}" inside your component tree. Looks like it is not a Konva node. You can render only Konva components inside the Stage.`),null}return r}function Ca(e){let t=e=>!!e&&typeof e==`object`&&`component`in e,n=e=>Array.isArray(e),r=e=>t(e)?[e,...r(e.children)]:n(e)?e.flatMap(r):[];return r(e.children)}function wa(e,t){let n=Ca(e),r=[];n.forEach(e=>{let t=Sa(e);t&&r.push(t)});let i=!1;r.forEach((e,t)=>{e.getZIndex()!==t&&(e.setZIndex(t),i=!0)}),i&&fa(t)}var Ta=da.default?.Stage||da.Stage,Ea=p({name:`Stage`,props:{config:{type:Object,default:function(){return{}}},__useStrictMode:{type:Boolean}},inheritAttrs:!1,setup(e,{attrs:n,slots:r,expose:a}){let o=t();if(!o)return;let s=g({}),c=i(null),l=new Ta({width:e.config.width,height:e.config.height,container:document.createElement(`div`)});o.__konvaNode=l,m();function d(){return o?.__konvaNode}function p(){return o?.__konvaNode}function m(){if(!o)return;let t=s||{},r={...n,...e.config};ha(o,r,t,e.__useStrictMode),Object.assign(s,r)}return C(()=>{c.value&&l.container(c.value),m(),va(l,o)}),S(()=>{m(),wa(o.subTree,l),va(l,o)}),u(()=>{l.destroy()}),f(()=>e.config,m,{deep:!0}),a({getStage:p,getNode:d}),()=>D(`div`,{ref:c,id:n?.id,accesskey:n?.accesskey,class:n?.class,role:n?.role,style:n?.style,tabindex:n?.tabindex,title:n?.title},r.default?.())}}),Da=`.vue-konva-event`,Oa={Group:!0,Layer:!0,FastLayer:!0,Label:!0};function J(n,r){return p({name:n,props:{config:{type:Object,default:function(){return{}}},__useStrictMode:{type:Boolean}},setup(i,{attrs:a,slots:o,expose:s}){let c=t();if(!c)return;let l=g({}),u=new r;c.__konvaNode=u,c.vnode.__konvaNode=u,m();function d(){return c?.__konvaNode}function p(){return c?.__konvaNode}function m(){if(!c)return;let e={};for(let t in c?.vnode.props)t.slice(0,2)===`on`&&(e[t]=c.vnode.props[t]);let t=l||{},n={...a,...i.config,...e};ha(c,n,t,i.__useStrictMode),Object.assign(l,n)}C(()=>{let e=ba(c)?.__konvaNode;e&&`add`in e&&e.add(u),fa(u),va(u,c)}),e(()=>{fa(u),u.destroy(),u.off(Da),u.off(ga)}),S(()=>{m(),wa(c.subTree,u),va(u,c)}),f(()=>i.config,m,{deep:!0}),s({getStage:p,getNode:d});let h=Oa.hasOwnProperty(n);return()=>h?o.default?.():null}})}var Y=da.default||da,ka=J(`Arc`,Y.Arc),Aa=J(`Arrow`,Y.Arrow),ja=J(`Circle`,Y.Circle),Ma=J(`Ellipse`,Y.Ellipse),Na=J(`FastLayer`,Y.FastLayer),Pa=J(`Group`,Y.Group),Fa=J(`Image`,Y.Image),Ia=J(`Label`,Y.Label),La=J(`Layer`,Y.Layer),Ra=J(`Line`,Y.Line),za=J(`Path`,Y.Path),Ba=J(`Rect`,Y.Rect),Va=J(`RegularPolygon`,Y.RegularPolygon),Ha=J(`Ring`,Y.Ring),Ua=J(`Shape`,Y.Shape),Wa=J(`Sprite`,Y.Sprite),Ga=J(`Star`,Y.Star),Ka=J(`Tag`,Y.Tag),qa=J(`Text`,Y.Text),Ja=J(`TextPath`,Y.TextPath),Ya=J(`Transformer`,Y.Transformer),Xa=J(`Wedge`,Y.Wedge),Za=Object.freeze(Object.defineProperty({__proto__:null,Arc:ka,Arrow:Aa,Circle:ja,Ellipse:Ma,FastLayer:Na,Group:Pa,Image:Fa,Label:Ia,Layer:La,Line:Ra,Path:za,Rect:Ba,RegularPolygon:Va,Ring:Ha,Shape:Ua,Sprite:Wa,Star:Ga,Tag:Ka,Text:qa,TextPath:Ja,Transformer:Ya,Wedge:Xa},Symbol.toStringTag,{value:`Module`})),Qa={install:(e,t)=>{let n=t?.prefix||ya,r=t?.customNodes?Object.entries(t.customNodes).map(([e,t])=>J(e,t)):[];[Ea,...Object.values(Za),...r].forEach(t=>{e.component(`${n}${t.name}`,t)})}},$a=typeof document<`u`;function eo(e){return typeof e==`object`||`displayName`in e||`props`in e||`__vccOpts`in e}function to(e){return e.__esModule||e[Symbol.toStringTag]===`Module`||e.default&&eo(e.default)}var X=Object.assign;function no(e,t){let n={};for(let r in t){let i=t[r];n[r]=io(i)?i.map(e):e(i)}return n}var ro=()=>{},io=Array.isArray;function ao(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}var oo=/#/g,so=/&/g,co=/\//g,lo=/=/g,uo=/\?/g,fo=/\+/g,po=/%5B/g,mo=/%5D/g,ho=/%5E/g,go=/%60/g,_o=/%7B/g,vo=/%7C/g,yo=/%7D/g,bo=/%20/g;function xo(e){return e==null?``:encodeURI(``+e).replace(vo,`|`).replace(po,`[`).replace(mo,`]`)}function So(e){return xo(e).replace(_o,`{`).replace(yo,`}`).replace(ho,`^`)}function Co(e){return xo(e).replace(fo,`%2B`).replace(bo,`+`).replace(oo,`%23`).replace(so,`%26`).replace(go,"`").replace(_o,`{`).replace(yo,`}`).replace(ho,`^`)}function wo(e){return Co(e).replace(lo,`%3D`)}function To(e){return xo(e).replace(oo,`%23`).replace(uo,`%3F`)}function Eo(e){return To(e).replace(co,`%2F`)}function Do(e){if(e==null)return null;try{return decodeURIComponent(``+e)}catch{}return``+e}var Oo=/\/$/,ko=e=>e.replace(Oo,``);function Ao(e,t,n=`/`){let r,i={},a=``,o=``,s=t.indexOf(`#`),c=t.indexOf(`?`);return c=s>=0&&c>s?-1:c,c>=0&&(r=t.slice(0,c),a=t.slice(c,s>0?s:t.length),i=e(a.slice(1))),s>=0&&(r||=t.slice(0,s),o=t.slice(s,t.length)),r=Ro(r??t,n),{fullPath:r+a+o,path:r,query:i,hash:Do(o)}}function jo(e,t){let n=t.query?e(t.query):``;return t.path+(n&&`?`)+n+(t.hash||``)}function Mo(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||`/`}function No(e,t,n){let r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&Po(t.matched[r],n.matched[i])&&Fo(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Po(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Fo(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Io(e[n],t[n]))return!1;return!0}function Io(e,t){return io(e)?Lo(e,t):io(t)?Lo(t,e):e?.valueOf()===t?.valueOf()}function Lo(e,t){return io(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e.length===1&&e[0]===t}function Ro(e,t){if(e.startsWith(`/`))return e;if(!e)return t;let n=t.split(`/`),r=e.split(`/`),i=r[r.length-1];(i===`..`||i===`.`)&&r.push(``);let a=n.length-1,o,s;for(o=0;o1&&a--;else break;return n.slice(0,a).join(`/`)+`/`+r.slice(o).join(`/`)}var zo={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0},Bo=function(e){return e.pop=`pop`,e.push=`push`,e}({}),Vo=function(e){return e.back=`back`,e.forward=`forward`,e.unknown=``,e}({});function Ho(e){if(!e)if($a){let t=document.querySelector(`base`);e=t&&t.getAttribute(`href`)||`/`,e=e.replace(/^\w+:\/\/[^\/]+/,``)}else e=`/`;return e[0]!==`/`&&e[0]!==`#`&&(e=`/`+e),ko(e)}var Uo=/^[^#]+#/;function Wo(e,t){return e.replace(Uo,`#`)+t}function Go(e,t){let n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}var Ko=()=>({left:window.scrollX,top:window.scrollY});function qo(e){let t;if(`el`in e){let n=e.el,r=typeof n==`string`&&n.startsWith(`#`),i=typeof n==`string`?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=Go(i,e)}else t=e;`scrollBehavior`in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left==null?window.scrollX:t.left,t.top==null?window.scrollY:t.top)}function Jo(e,t){return(history.state?history.state.position-t:-1)+e}var Yo=new Map;function Xo(e,t){Yo.set(e,t)}function Zo(e){let t=Yo.get(e);return Yo.delete(e),t}function Qo(e){return typeof e==`string`||e&&typeof e==`object`}function $o(e){return typeof e==`string`||typeof e==`symbol`}var Z=function(e){return e[e.MATCHER_NOT_FOUND=1]=`MATCHER_NOT_FOUND`,e[e.NAVIGATION_GUARD_REDIRECT=2]=`NAVIGATION_GUARD_REDIRECT`,e[e.NAVIGATION_ABORTED=4]=`NAVIGATION_ABORTED`,e[e.NAVIGATION_CANCELLED=8]=`NAVIGATION_CANCELLED`,e[e.NAVIGATION_DUPLICATED=16]=`NAVIGATION_DUPLICATED`,e}({}),es=Symbol(``);Z.MATCHER_NOT_FOUND,Z.NAVIGATION_GUARD_REDIRECT,Z.NAVIGATION_ABORTED,Z.NAVIGATION_CANCELLED,Z.NAVIGATION_DUPLICATED;function ts(e,t){return X(Error(),{type:e,[es]:!0},t)}function ns(e,t){return e instanceof Error&&es in e&&(t==null||!!(e.type&t))}function rs(e){let t={};if(e===``||e===`?`)return t;let n=(e[0]===`?`?e.slice(1):e).split(`&`);for(let e=0;ee&&Co(e)):[r&&Co(r)]).forEach(e=>{e!==void 0&&(t+=(t.length?`&`:``)+n,e!=null&&(t+=`=`+e))})}return t}function as(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=io(r)?r.map(e=>e==null?null:``+e):r==null?r:``+r)}return t}var os=Symbol(``),ss=Symbol(``),cs=Symbol(``),ls=Symbol(``),us=Symbol(``);function ds(){let e=[];function t(t){return e.push(t),()=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function fs(e,t,n,r,i,a=e=>e()){let o=r&&(r.enterCallbacks[i]=r.enterCallbacks[i]||[]);return()=>new Promise((s,c)=>{let l=e=>{e===!1?c(ts(Z.NAVIGATION_ABORTED,{from:n,to:t})):e instanceof Error?c(e):Qo(e)?c(ts(Z.NAVIGATION_GUARD_REDIRECT,{from:t,to:e})):(o&&r.enterCallbacks[i]===o&&typeof e==`function`&&o.push(e),s())},u=a(()=>e.call(r&&r.instances[i],t,n,l)),d=Promise.resolve(u);e.length<3&&(d=d.then(l)),d.catch(e=>c(e))})}function ps(e,t,n,r,i=e=>e()){let a=[];for(let o of e)for(let e in o.components){let s=o.components[e];if(!(t!==`beforeRouteEnter`&&!o.instances[e]))if(eo(s)){let c=(s.__vccOpts||s)[t];c&&a.push(fs(c,n,r,o,e,i))}else{let c=s();a.push(()=>c.then(a=>{if(!a)throw Error(`Couldn't resolve component "${e}" at "${o.path}"`);let s=to(a)?a.default:a;o.mods[e]=a,o.components[e]=s;let c=(s.__vccOpts||s)[t];return c&&fs(c,n,r,o,e,i)()}))}}return a}function ms(e,t){let n=[],r=[],i=[],a=Math.max(t.matched.length,e.matched.length);for(let o=0;oPo(e,a))?r.push(a):n.push(a));let s=e.matched[o];s&&(t.matched.find(e=>Po(e,s))||i.push(s))}return[n,r,i]}var hs=()=>location.protocol+`//`+location.host;function gs(e,t){let{pathname:n,search:r,hash:i}=t,a=e.indexOf(`#`);if(a>-1){let t=i.includes(e.slice(a))?e.slice(a).length:1,n=i.slice(t);return n[0]!==`/`&&(n=`/`+n),Mo(n,``)}return Mo(n,e)+r+i}function _s(e,t,n,r){let i=[],a=[],o=null,s=({state:a})=>{let s=gs(e,location),c=n.value,l=t.value,u=0;if(a){if(n.value=s,t.value=a,o&&o===c){o=null;return}u=l?a.position-l.position:0}else r(s);i.forEach(e=>{e(n.value,c,{delta:u,type:Bo.pop,direction:u?u>0?Vo.forward:Vo.back:Vo.unknown})})};function c(){o=n.value}function l(e){i.push(e);let t=()=>{let t=i.indexOf(e);t>-1&&i.splice(t,1)};return a.push(t),t}function u(){if(document.visibilityState===`hidden`){let{history:e}=window;if(!e.state)return;e.replaceState(X({},e.state,{scroll:Ko()}),``)}}function d(){for(let e of a)e();a=[],window.removeEventListener(`popstate`,s),window.removeEventListener(`pagehide`,u),document.removeEventListener(`visibilitychange`,u)}return window.addEventListener(`popstate`,s),window.addEventListener(`pagehide`,u),document.addEventListener(`visibilitychange`,u),{pauseListeners:c,listen:l,destroy:d}}function vs(e,t,n,r=!1,i=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:i?Ko():null}}function ys(e){let{history:t,location:n}=window,r={value:gs(e,n)},i={value:t.state};i.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(r,a,o){let s=e.indexOf(`#`),c=s>-1?(n.host&&document.querySelector(`base`)?e:e.slice(s))+r:hs()+e+r;try{t[o?`replaceState`:`pushState`](a,``,c),i.value=a}catch(e){console.error(e),n[o?`replace`:`assign`](c)}}function o(e,n){a(e,X({},t.state,vs(i.value.back,e,i.value.forward,!0),n,{position:i.value.position}),!0),r.value=e}function s(e,n){let o=X({},i.value,t.state,{forward:e,scroll:Ko()});a(o.current,o,!0),a(e,X({},vs(r.value,e,null),{position:o.position+1},n),!1),r.value=e}return{location:r,state:i,push:s,replace:o}}function bs(e){e=Ho(e);let t=ys(e),n=_s(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=X({location:``,base:e,go:r,createHref:Wo.bind(null,e)},t,n);return Object.defineProperty(i,`location`,{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,`state`,{enumerable:!0,get:()=>t.state.value}),i}var xs=function(e){return e[e.Static=0]=`Static`,e[e.Param=1]=`Param`,e[e.Group=2]=`Group`,e}({}),Q=function(e){return e[e.Static=0]=`Static`,e[e.Param=1]=`Param`,e[e.ParamRegExp=2]=`ParamRegExp`,e[e.ParamRegExpEnd=3]=`ParamRegExpEnd`,e[e.EscapeNext=4]=`EscapeNext`,e}(Q||{}),Ss={type:xs.Static,value:``},Cs=/[a-zA-Z0-9_]/;function ws(e){if(!e)return[[]];if(e===`/`)return[[Ss]];if(!e.startsWith(`/`))throw Error(`Invalid path "${e}"`);function t(e){throw Error(`ERR (${n})/"${l}": ${e}`)}let n=Q.Static,r=n,i=[],a;function o(){a&&i.push(a),a=[]}let s=0,c,l=``,u=``;function d(){l&&=(n===Q.Static?a.push({type:xs.Static,value:l}):n===Q.Param||n===Q.ParamRegExp||n===Q.ParamRegExpEnd?(a.length>1&&(c===`*`||c===`+`)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:xs.Param,value:l,regexp:u,repeatable:c===`*`||c===`+`,optional:c===`*`||c===`?`})):t(`Invalid state to consume buffer`),``)}function f(){l+=c}for(;st.length?t.length===1&&t[0]===$.Static+$.Segment?1:-1:0}function As(e,t){let n=0,r=e.score,i=t.score;for(;n0&&t[t.length-1]<0}var Ms={strict:!1,end:!0,sensitive:!1};function Ns(e,t,n){let r=X(Os(ws(e.path),n),{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function Ps(e,t){let n=[],r=new Map;t=ao(Ms,t);function i(e){return r.get(e)}function a(e,n,r){let i=!r,s=Is(e);s.aliasOf=r&&r.record;let l=ao(t,e),u=[s];if(`alias`in e){let t=typeof e.alias==`string`?[e.alias]:e.alias;for(let e of t)u.push(Is(X({},s,{components:r?r.record.components:s.components,path:e,aliasOf:r?r.record:s})))}let d,f;for(let t of u){let{path:u}=t;if(n&&u[0]!==`/`){let e=n.record.path,r=e[e.length-1]===`/`?``:`/`;t.path=n.record.path+(u&&r+u)}if(d=Ns(t,n,l),r?r.alias.push(d):(f||=d,f!==d&&f.alias.push(d),i&&e.name&&!Rs(d)&&o(e.name)),Hs(d)&&c(d),s.children){let e=s.children;for(let t=0;t{o(f)}:ro}function o(e){if($o(e)){let t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(o),t.alias.forEach(o))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(o),e.alias.forEach(o))}}function s(){return n}function c(e){let t=Bs(e,n);n.splice(t,0,e),e.record.name&&!Rs(e)&&r.set(e.record.name,e)}function l(e,t){let i,a={},o,s;if(`name`in e&&e.name){if(i=r.get(e.name),!i)throw ts(Z.MATCHER_NOT_FOUND,{location:e});s=i.record.name,a=X(Fs(t.params,i.keys.filter(e=>!e.optional).concat(i.parent?i.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&Fs(e.params,i.keys.map(e=>e.name))),o=i.stringify(a)}else if(e.path!=null)o=e.path,i=n.find(e=>e.re.test(o)),i&&(a=i.parse(o),s=i.record.name);else{if(i=t.name?r.get(t.name):n.find(e=>e.re.test(t.path)),!i)throw ts(Z.MATCHER_NOT_FOUND,{location:e,currentLocation:t});s=i.record.name,a=X({},t.params,e.params),o=i.stringify(a)}let c=[],l=i;for(;l;)c.unshift(l.record),l=l.parent;return{name:s,path:o,params:a,matched:c,meta:zs(c)}}e.forEach(e=>a(e));function u(){n.length=0,r.clear()}return{addRoute:a,resolve:l,removeRoute:o,clearRoutes:u,getRoutes:s,getRecordMatcher:i}}function Fs(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function Is(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Ls(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,`mods`,{value:{}}),t}function Ls(e){let t={},n=e.props||!1;if(`component`in e)t.default=n;else for(let r in e.components)t[r]=typeof n==`object`?n[r]:n;return t}function Rs(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function zs(e){return e.reduce((e,t)=>X(e,t.meta),{})}function Bs(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1;As(e,t[i])<0?r=i:n=i+1}let i=Vs(e);return i&&(r=t.lastIndexOf(i,r-1)),r}function Vs(e){let t=e;for(;t=t.parent;)if(Hs(t)&&As(e,t)===0)return t}function Hs({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Us(e){let t=m(cs),n=m(ls),i=x(()=>{let n=r(e.to);return t.resolve(n)}),a=x(()=>{let{matched:e}=i.value,{length:t}=e,r=e[t-1],a=n.matched;if(!r||!a.length)return-1;let o=a.findIndex(Po.bind(null,r));if(o>-1)return o;let s=Js(e[t-2]);return t>1&&Js(r)===s&&a[a.length-1].path!==s?a.findIndex(Po.bind(null,e[t-2])):o}),o=x(()=>a.value>-1&&qs(n.params,i.value.params)),s=x(()=>a.value>-1&&a.value===n.matched.length-1&&Fo(n.params,i.value.params));function c(n={}){if(Ks(n)){let n=t[r(e.replace)?`replace`:`push`](r(e.to)).catch(ro);return e.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>n),n}return Promise.resolve()}return{route:i,href:x(()=>i.value.href),isActive:o,isExactActive:s,navigate:c}}function Ws(e){return e.length===1?e[0]:e}var Gs=p({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink:Us,setup(e,{slots:t}){let n=g(Us(e)),{options:r}=m(cs),i=x(()=>({[Ys(e.activeClass,r.linkActiveClass,`router-link-active`)]:n.isActive,[Ys(e.exactActiveClass,r.linkExactActiveClass,`router-link-exact-active`)]:n.isExactActive}));return()=>{let r=t.default&&Ws(t.default(n));return e.custom?r:D(`a`,{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},r)}}});function Ks(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){let t=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function qs(e,t){for(let n in t){let r=t[n],i=e[n];if(typeof r==`string`){if(r!==i)return!1}else if(!io(i)||i.length!==r.length||r.some((e,t)=>e.valueOf()!==i[t].valueOf()))return!1}return!0}function Js(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}var Ys=(e,t,n)=>e??t??n,Xs=p({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){let a=m(us),o=x(()=>e.route||a.value),s=m(ss,0),c=x(()=>{let e=r(s),{matched:t}=o.value,n;for(;(n=t[e])&&!n.components;)e++;return e}),u=x(()=>o.value.matched[c.value]);l(ss,x(()=>c.value+1)),l(os,u),l(us,o);let d=i();return f(()=>[d.value,u.value,e.name],([e,t,n],[r,i,a])=>{t&&(t.instances[n]=e,i&&i!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=i.leaveGuards),t.updateGuards.size||(t.updateGuards=i.updateGuards))),e&&t&&(!i||!Po(t,i)||!r)&&(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:`post`}),()=>{let r=o.value,i=e.name,a=u.value,s=a&&a.components[i];if(!s)return Zs(n.default,{Component:s,route:r});let c=a.props[i],l=D(s,X({},c?c===!0?r.params:typeof c==`function`?c(r):c:null,t,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(a.instances[i]=null)},ref:d}));return Zs(n.default,{Component:l,route:r})||l}}});function Zs(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}var Qs=Xs;function $s(e){let t=Ps(e.routes,e),i=e.parseQuery||rs,a=e.stringifyQuery||is,o=e.history,s=ds(),c=ds(),l=ds(),u=_(zo),d=zo;$a&&e.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let f=no.bind(null,e=>``+e),p=no.bind(null,Eo),m=no.bind(null,Do);function g(e,n){let r,i;return $o(e)?(r=t.getRecordMatcher(e),i=n):i=e,t.addRoute(i,r)}function v(e){let n=t.getRecordMatcher(e);n&&t.removeRoute(n)}function y(){return t.getRoutes().map(e=>e.record)}function b(e){return!!t.getRecordMatcher(e)}function x(e,n){if(n=X({},n||u.value),typeof e==`string`){let r=Ao(i,e,n.path),a=t.resolve({path:r.path},n),s=o.createHref(r.fullPath);return X(r,a,{params:m(a.params),hash:Do(r.hash),redirectedFrom:void 0,href:s})}let r;if(e.path!=null)r=X({},e,{path:Ao(i,e.path,n.path).path});else{let t=X({},e.params);for(let e in t)t[e]??delete t[e];r=X({},e,{params:p(t)}),n.params=p(n.params)}let s=t.resolve(r,n),c=e.hash||``;s.params=f(m(s.params));let l=jo(a,X({},e,{hash:So(c),path:s.path})),d=o.createHref(l);return X({fullPath:l,hash:c,query:a===is?as(e.query):e.query||{}},s,{redirectedFrom:void 0,href:d})}function S(e){return typeof e==`string`?Ao(i,e,u.value.path):X({},e)}function C(e,t){if(d!==e)return ts(Z.NAVIGATION_CANCELLED,{from:t,to:e})}function w(e){return ne(e)}function ee(e){return w(X(S(e),{replace:!0}))}function te(e,t){let n=e.matched[e.matched.length-1];if(n&&n.redirect){let{redirect:r}=n,i=typeof r==`function`?r(e,t):r;return typeof i==`string`&&(i=i.includes(`?`)||i.includes(`#`)?i=S(i):{path:i},i.params={}),X({query:e.query,hash:e.hash,params:i.path==null?e.params:{}},i)}}function ne(e,t){let n=d=x(e),r=u.value,i=e.state,o=e.force,s=e.replace===!0,c=te(n,r);if(c)return ne(X(S(c),{state:typeof c==`object`?X({},i,c.state):i,force:o,replace:s}),t||n);let l=n;l.redirectedFrom=t;let f;return!o&&No(a,r,n)&&(f=ts(Z.NAVIGATION_DUPLICATED,{to:l,from:r}),oe(r,r,!0,!1)),(f?Promise.resolve(f):re(l,r)).catch(e=>ns(e)?ns(e,Z.NAVIGATION_GUARD_REDIRECT)?e:ae(e):N(e,l,r)).then(e=>{if(e){if(ns(e,Z.NAVIGATION_GUARD_REDIRECT))return ne(X({replace:s},S(e.to),{state:typeof e.to==`object`?X({},i,e.to.state):i,force:o}),t||l)}else e=O(l,r,!0,s,i);return D(l,r,e),e})}function T(e,t){let n=C(e,t);return n?Promise.reject(n):Promise.resolve()}function E(e){let t=ce.values().next().value;return t&&typeof t.runWithContext==`function`?t.runWithContext(e):e()}function re(e,t){let n,[r,i,a]=ms(e,t);n=ps(r.reverse(),`beforeRouteLeave`,e,t);for(let i of r)i.leaveGuards.forEach(r=>{n.push(fs(r,e,t))});let o=T.bind(null,e,t);return n.push(o),ue(n).then(()=>{n=[];for(let r of s.list())n.push(fs(r,e,t));return n.push(o),ue(n)}).then(()=>{n=ps(i,`beforeRouteUpdate`,e,t);for(let r of i)r.updateGuards.forEach(r=>{n.push(fs(r,e,t))});return n.push(o),ue(n)}).then(()=>{n=[];for(let r of a)if(r.beforeEnter)if(io(r.beforeEnter))for(let i of r.beforeEnter)n.push(fs(i,e,t));else n.push(fs(r.beforeEnter,e,t));return n.push(o),ue(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=ps(a,`beforeRouteEnter`,e,t,E),n.push(o),ue(n))).then(()=>{n=[];for(let r of c.list())n.push(fs(r,e,t));return n.push(o),ue(n)}).catch(e=>ns(e,Z.NAVIGATION_CANCELLED)?e:Promise.reject(e))}function D(e,t,n){l.list().forEach(r=>E(()=>r(e,t,n)))}function O(e,t,n,r,i){let a=C(e,t);if(a)return a;let s=t===zo,c=$a?history.state:{};n&&(r||s?o.replace(e.fullPath,X({scroll:s&&c&&c.scroll},i)):o.push(e.fullPath,i)),u.value=e,oe(e,t,n,s),ae()}let k;function A(){k||=o.listen((e,t,n)=>{if(!le.listening)return;let r=x(e),i=te(r,le.currentRoute.value);if(i){ne(X(i,{replace:!0,force:!0}),r).catch(ro);return}d=r;let a=u.value;$a&&Xo(Jo(a.fullPath,n.delta),Ko()),re(r,a).catch(e=>ns(e,Z.NAVIGATION_ABORTED|Z.NAVIGATION_CANCELLED)?e:ns(e,Z.NAVIGATION_GUARD_REDIRECT)?(ne(X(S(e.to),{force:!0}),r).then(e=>{ns(e,Z.NAVIGATION_ABORTED|Z.NAVIGATION_DUPLICATED)&&!n.delta&&n.type===Bo.pop&&o.go(-1,!1)}).catch(ro),Promise.reject()):(n.delta&&o.go(-n.delta,!1),N(e,r,a))).then(e=>{e||=O(r,a,!1),e&&(n.delta&&!ns(e,Z.NAVIGATION_CANCELLED)?o.go(-n.delta,!1):n.type===Bo.pop&&ns(e,Z.NAVIGATION_ABORTED|Z.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),D(r,a,e)}).catch(ro)})}let j=ds(),M=ds(),ie;function N(e,t,n){ae(e);let r=M.list();return r.length?r.forEach(r=>r(e,t,n)):console.error(e),Promise.reject(e)}function P(){return ie&&u.value!==zo?Promise.resolve():new Promise((e,t)=>{j.add([e,t])})}function ae(e){return ie||(ie=!e,A(),j.list().forEach(([t,n])=>e?n(e):t()),j.reset()),e}function oe(t,r,i,a){let{scrollBehavior:o}=e;if(!$a||!o)return Promise.resolve();let s=!i&&Zo(Jo(t.fullPath,0))||(a||!i)&&history.state&&history.state.scroll||null;return n().then(()=>o(t,r,s)).then(e=>e&&qo(e)).catch(e=>N(e,t,r))}let F=e=>o.go(e),se,ce=new Set,le={currentRoute:u,listening:!0,addRoute:g,removeRoute:v,clearRoutes:t.clearRoutes,hasRoute:b,getRoutes:y,resolve:x,options:e,push:w,replace:ee,go:F,back:()=>F(-1),forward:()=>F(1),beforeEach:s.add,beforeResolve:c.add,afterEach:l.add,onError:M.add,isReady:P,install(e){e.component(`RouterLink`,Gs),e.component(`RouterView`,Qs),e.config.globalProperties.$router=le,Object.defineProperty(e.config.globalProperties,`$route`,{enumerable:!0,get:()=>r(u)}),$a&&!se&&u.value===zo&&(se=!0,w(o.location).catch(e=>{}));let t={};for(let e in zo)Object.defineProperty(t,e,{get:()=>u.value[e],enumerable:!0});e.provide(cs,le),e.provide(ls,h(t)),e.provide(us,u);let n=e.unmount;ce.add(e),e.unmount=function(){ce.delete(e),ce.size<1&&(d=zo,k&&k(),k=null,u.value=zo,se=!1,ie=!1),n()}}};function ue(e){return e.reduce((e,t)=>e.then(()=>E(t)),Promise.resolve())}return le}function ec(){return m(cs)}function tc(e){return m(ls)}var nc=ne(`images`,()=>{let e=i([]),t=i(!1),n=i(null),r=i(0);async function a(r={}){r.silent||(t.value=!0),n.value=null;try{let t=await fetch(`/api/images`);if(!t.ok)throw Error(`Failed to load images`);e.value=await t.json()}catch(e){n.value=e instanceof Error?e.message:`Unknown error`}finally{t.value=!1}}async function o(t,n){let r=new FormData;r.append(`file`,t),n?.original&&r.append(`original`,n.original),n?.cropParams&&r.append(`cropParams`,JSON.stringify(n.cropParams)),n?.stickerState&&r.append(`stickerState`,JSON.stringify(n.stickerState)),n?.cropOrientation&&r.append(`cropOrientation`,n.cropOrientation);let i=await fetch(`/api/images`,{method:`POST`,body:r});if(!i.ok){let e=await i.json().catch(()=>({}));throw Error(e.error??`Upload failed`)}let a=await i.json();return e.value.unshift(a),a}async function s(t,n,r){let i=new FormData;i.append(`file`,n),r?.cropParams&&i.append(`cropParams`,JSON.stringify(r.cropParams)),r?.stickerState&&i.append(`stickerState`,JSON.stringify(r.stickerState)),r?.cropOrientation&&i.append(`cropOrientation`,r.cropOrientation);let a=await fetch(`/api/images/${t}/reprocess`,{method:`POST`,body:i});if(!a.ok){let e=await a.json().catch(()=>({}));throw Error(e.error??`Reprocess failed`)}let o=await a.json(),s=e.value.findIndex(e=>e.id===t);return s!==-1&&(e.value[s]=o),o}async function c(t){if(!(await fetch(`/api/images/${t}`,{method:`DELETE`})).ok)throw Error(`Delete failed`);e.value=e.value.filter(e=>e.id!==t)}async function l(t,n,r){let i=r?`POST`:`DELETE`,a=await fetch(`/api/images/${t}/approve/${n}`,{method:i});if(!a.ok)throw Error(`Failed to update approval`);let o=await a.json(),s=e.value.findIndex(e=>e.id===t);s!==-1&&(e.value[s]=o)}async function u(e,t=1,n=20){let r=new URLSearchParams({page:String(t),limit:String(n)});e&&r.set(`status`,e);let i=await fetch(`/api/shared-images?${r}`);if(!i.ok)throw Error(`Failed to load shared images`);return i.json()}async function d(){let e=await fetch(`/api/shared-images/pending-count`);e.ok&&(r.value=(await e.json()).count)}async function f(e,t){let n=await fetch(`/api/shared-images/${e}/approve`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({deviceIds:t})});if(!n.ok)throw Error(`Failed to approve`);return r.value>0&&r.value--,n.json()}async function p(e){let t=await fetch(`/api/shared-images/${e}/decline`,{method:`POST`});if(!t.ok)throw Error(`Failed to decline`);return r.value>0&&r.value--,t.json()}async function m(e,t){let n=await fetch(`/api/images/${e}/share`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({recipientEmail:t})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`Failed to share`)}}return{images:e,loading:t,error:n,pendingCount:r,fetchImages:a,uploadImage:o,reprocessImage:s,deleteImage:c,setApproval:l,fetchSharedImages:u,fetchPendingCount:d,approveShared:f,declineShared:p,shareImage:m}}),rc={class:`bottom-nav`,"aria-label":`Main navigation`},ic={class:`bottom-nav__icon-wrap`,"aria-hidden":`true`},ac=[`innerHTML`],oc={key:0,class:`bottom-nav__badge`},sc={class:`bottom-nav__label`},cc=E(p({__name:`BottomNav`,setup(e){let t=tc(),n=nc(),i=[{name:`home`,label:`Home`,to:`/`,icon:``,isActive:e=>e.path===`/`},{name:`library`,label:`Library`,to:`/library`,icon:``,isActive:e=>e.path.startsWith(`/library`)},{name:`settings`,label:`Settings`,to:`/settings`,icon:``,isActive:e=>e.path.startsWith(`/settings`)}];return(e,l)=>{let u=a(`RouterLink`);return c(),k(`nav`,rc,[(c(),k(te,null,d(i,e=>O(u,{key:e.name,to:e.to,class:s([`bottom-nav__tab`,{"bottom-nav__tab--active":e.isActive(r(t))}]),"aria-label":e.label,"aria-current":e.isActive(r(t))?`page`:void 0},{default:A(()=>[b(`span`,ic,[b(`span`,{class:`bottom-nav__icon`,innerHTML:e.icon},null,8,ac),e.name===`library`&&r(n).pendingCount>0?(c(),k(`span`,oc,o(r(n).pendingCount>9?`9+`:r(n).pendingCount),1)):re(``,!0)]),b(`span`,sc,o(e.label),1)]),_:2},1032,[`to`,`class`,`aria-label`,`aria-current`])),64))])}}}),[[`__scopeId`,`data-v-e670448a`]]),lc=0,uc=ne(`toast`,()=>{let e=i([]);function t(t,r=`info`){let i=++lc;e.value.push({id:i,message:t,type:r}),setTimeout(()=>n(i),2500)}function n(t){let n=e.value.findIndex(e=>e.id===t);n!==-1&&e.value.splice(n,1)}return{toasts:e,show:t,dismiss:n}}),dc={class:`toast-region`,"aria-live":`polite`,"aria-atomic":`false`},fc=[`onClick`],pc=E(p({__name:`BaseToast`,setup(e){let t=uc();return(e,n)=>(c(),k(`div`,dc,[O(ee,{name:`toast`,tag:`ul`,class:`toast-list`},{default:A(()=>[(c(!0),k(te,null,d(r(t).toasts,e=>(c(),k(`li`,{key:e.id,class:s([`toast`,`toast--${e.type}`]),role:`status`},[y(o(e.message)+` `,1),b(`button`,{class:`toast__close`,"aria-label":`Dismiss`,onClick:n=>r(t).dismiss(e.id)},` × `,8,fc)],2))),128))]),_:1})]))}}),[[`__scopeId`,`data-v-546af507`]]),mc=ne(`auth`,()=>{let e=i(window.__PF_USER__??null),t=x(()=>e.value!==null);function n(t){e.value=t}return{user:e,isAuthenticated:t,setUser:n}}),hc=[{id:`warm-craft`,label:`Warm Craft`,primary:`#c97c3a`,bg:`#fdf6ee`,text:`#3a2e22`},{id:`playful-pop`,label:`Playful Pop`,primary:`#d63aab`,bg:`#fff0fb`,text:`#2d0a28`},{id:`sage-cream`,label:`Sage & Cream`,primary:`#4e7c3a`,bg:`#f6f8f3`,text:`#1e2b1a`},{id:`dusty-mauve`,label:`Dusty Mauve`,primary:`#8e4a84`,bg:`#f6f0f4`,text:`#2a1828`},{id:`ocean-dusk`,label:`Ocean Dusk`,primary:`#1a6ea8`,bg:`#eef3f8`,text:`#0e2030`},{id:`honey-slate`,label:`Honey & Slate`,primary:`#c49a20`,bg:`#f2f2ee`,text:`#1c1c18`}];function gc(){let e=mc(),t=uc();function n(t){document.documentElement.dataset.theme=t,e.user&&(e.user.theme=t);let n=hc.find(e=>e.id===t);if(n){let e=document.querySelector(`meta[name="theme-color"]`);e&&e.setAttribute(`content`,n.bg)}}async function r(e){n(e);try{if(!(await fetch(`/api/user/theme`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({theme:e})})).ok)throw Error(`Failed to save theme`)}catch{t.show(`Could not save theme — try again`,`error`)}}return{THEMES:hc,applyTheme:n,saveTheme:r}}var _c=p({__name:`App`,setup(e){let t=tc(),n=mc(),{applyTheme:i}=gc();return C(()=>{let e=document.documentElement.dataset.theme||n.user?.theme;e&&i(e)}),(e,n)=>{let i=a(`RouterView`);return c(),k(te,null,[O(i),r(t).meta.hideNav?re(``,!0):(c(),v(cc,{key:0})),O(pc)],64)}}}),vc=`modulepreload`,yc=function(e){return`/build/`+e},bc={},xc=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=yc(t,n),t in bc)return;bc[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:vc,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Sc=$s({history:bs(),routes:[{path:`/`,name:`home`,component:()=>xc(()=>import(`./HomeView-BDJhYpJV.js`),__vite__mapDeps([0,1,2,3,4,5,6])),meta:{requiresAuth:!0}},{path:`/library`,name:`library`,component:()=>xc(()=>import(`./LibraryView-E5I_Q1_A.js`),__vite__mapDeps([7,1,2,3,8,9,4,5,10])),meta:{requiresAuth:!0}},{path:`/upload`,name:`upload`,component:()=>xc(()=>import(`./UploadView-CiBmd_8U.js`),__vite__mapDeps([11,1,2,3,8,9,12])),meta:{requiresAuth:!0,hideNav:!0}},{path:`/settings`,name:`settings`,component:()=>xc(()=>import(`./SettingsView-BuwptVaB.js`),__vite__mapDeps([13,1,14])),meta:{requiresAuth:!0}},{path:`/shared`,redirect:`/library?tab=shared`},{path:`/:pathMatch(.*)*`,redirect:`/`}]});Sc.beforeEach(e=>{let t=mc();if(e.meta.requiresAuth&&!t.isAuthenticated)return window.location.href=`/login`,!1});var Cc=T(_c);Cc.use(w()),Cc.use(Sc),Cc.use(Qa),Cc.mount(`#app`),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`).catch(()=>{})});export{nc as a,uc as i,gc as n,tc as o,mc as r,ec as s,hc as t}; \ No newline at end of file +`,se=()=>{if(typeof document>`u`)throw Error(oe)},P=class e{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new e(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){let t=this.m;return{x:t[0]*e.x+t[2]*e.y+t[4],y:t[1]*e.x+t[3]*e.y+t[5]}}translate(e,t){return this.m[4]+=this.m[0]*e+this.m[2]*t,this.m[5]+=this.m[1]*e+this.m[3]*t,this}scale(e,t){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=t,this.m[3]*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),r=this.m[0]*t+this.m[2]*n,i=this.m[1]*t+this.m[3]*n,a=this.m[0]*-n+this.m[2]*t,o=this.m[1]*-n+this.m[3]*t;return this.m[0]=r,this.m[1]=i,this.m[2]=a,this.m[3]=o,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,t){let n=this.m[0]+this.m[2]*t,r=this.m[1]+this.m[3]*t,i=this.m[2]+this.m[0]*e,a=this.m[3]+this.m[1]*e;return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=a,this}multiply(e){let t=this.m[0]*e.m[0]+this.m[2]*e.m[1],n=this.m[1]*e.m[0]+this.m[3]*e.m[1],r=this.m[0]*e.m[2]+this.m[2]*e.m[3],i=this.m[1]*e.m[2]+this.m[3]*e.m[3],a=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],o=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=i,this.m[4]=a,this.m[5]=o,this}invert(){let e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),t=this.m[3]*e,n=-this.m[1]*e,r=-this.m[2]*e,i=this.m[0]*e,a=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),o=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=i,this.m[4]=a,this.m[5]=o,this}getMatrix(){return this.m}decompose(){let e=this.m[0],t=this.m[1],n=this.m[2],r=this.m[3],i=this.m[4],a=this.m[5],o=e*r-t*n,s={x:i,y:a,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(e!=0||t!=0){let i=Math.sqrt(e*e+t*t);s.rotation=t>0?Math.acos(e/i):-Math.acos(e/i),s.scaleX=i,s.scaleY=o/i,s.skewX=(e*n+t*r)/o,s.skewY=0}else if(n!=0||r!=0){let i=Math.sqrt(n*n+r*r);s.rotation=Math.PI/2-(r>0?Math.acos(-n/i):-Math.acos(n/i)),s.scaleX=o/i,s.scaleY=i,s.skewX=0,s.skewY=(e*n+t*r)/o}return s.rotation=F._getRotation(s.rotation),s}},ce=`[object Array]`,le=`[object Number]`,ue=`[object String]`,de=`[object Boolean]`,fe=Math.PI/180,pe=180/Math.PI,me=`#`,he=``,ge=`0`,_e=`Konva warning: `,ve=`Konva error: `,ye=`rgb(`,be={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},xe=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,Se=[],Ce=null,we=typeof requestAnimationFrame<`u`&&requestAnimationFrame||function(e){setTimeout(e,16)},F={_isElement(e){return!!(e&&e.nodeType==1)},_isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject(e){return!!e&&e.constructor===Object},_isArray(e){return Object.prototype.toString.call(e)===ce},_isNumber(e){return Object.prototype.toString.call(e)===le&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===ue},_isBoolean(e){return Object.prototype.toString.call(e)===de},isObject(e){return e instanceof Object},isValidSelector(e){if(typeof e!=`string`)return!1;let t=e[0];return t===`#`||t===`.`||t===t.toUpperCase()},_sign(e){return e===0||e>0?1:-1},requestAnimFrame(e){Se.push(e),Se.length===1&&we(function(){let e=Se;Se=[],e.forEach(function(e){e()})})},createCanvasElement(){se();let e=document.createElement(`canvas`);try{e.style=e.style||{}}catch{}return e},createImageElement(){return se(),document.createElement(`img`)},_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){let n=F.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex(e,t,n){return((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)},_hexToRgb(e){e=e.replace(me,he);let t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){let e=(Math.random()*16777215<<0).toString(16);for(;e.length<6;)e=ge+e;return me+e},isCanvasFarblingActive(){if(Ce!==null)return Ce;if(typeof document>`u`)return Ce=!1,!1;let e=this.createCanvasElement();e.width=10,e.height=10;let t=e.getContext(`2d`,{willReadFrequently:!0});t.clearRect(0,0,10,10),t.fillStyle=`#282828`,t.fillRect(0,0,10,10);let n=t.getImageData(0,0,10,10).data,r=!1;for(let e=0;e<100;e++)if(n[e*4]!==40||n[e*4+1]!==40||n[e*4+2]!==40||n[e*4+3]!==255){r=!0;break}return Ce=r,this.releaseCanvas(e),Ce},getHitColor(){let e=this.getRandomColor();return this.isCanvasFarblingActive()?this.getSnappedHexColor(e):e},getHitColorKey(e,t,n){return this.isCanvasFarblingActive()&&(e=Math.round(e/5)*5,t=Math.round(t/5)*5,n=Math.round(n/5)*5),me+this._rgbToHex(e,t,n)},getSnappedHexColor(e){let t=this._hexToRgb(e);return me+this._rgbToHex(Math.round(t.r/5)*5,Math.round(t.g/5)*5,Math.round(t.b/5)*5)},getRGB(e){let t;return e in be?(t=be[e],{r:t[0],g:t[1],b:t[2]}):e[0]===me?this._hexToRgb(e.substring(1)):e.substr(0,4)===ye?(t=xe.exec(e.replace(/ /g,``)),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA(e){return e||=`black`,F._namedColorToRBA(e)||F._hex3ColorToRGBA(e)||F._hex4ColorToRGBA(e)||F._hex6ColorToRGBA(e)||F._hex8ColorToRGBA(e)||F._rgbColorToRGBA(e)||F._rgbaColorToRGBA(e)||F._hslColorToRGBA(e)},_namedColorToRBA(e){let t=be[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(e.indexOf(`rgb(`)===0){e=e.match(/rgb\(([^)]+)\)/)[1];let t=e.split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(e.indexOf(`rgba(`)===0){e=e.match(/rgba\(([^)]+)\)/)[1];let t=e.split(/ *, */).map((e,t)=>e.slice(-1)===`%`?t===3?parseInt(e)/100:parseInt(e)/100*255:Number(e));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex8ColorToRGBA(e){if(e[0]===`#`&&e.length===9)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:parseInt(e.slice(7,9),16)/255}},_hex6ColorToRGBA(e){if(e[0]===`#`&&e.length===7)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex4ColorToRGBA(e){if(e[0]===`#`&&e.length===5)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:parseInt(e[4]+e[4],16)/255}},_hex3ColorToRGBA(e){if(e[0]===`#`&&e.length===4)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){let[t,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),r=Number(n[0])/360,i=Number(n[1])/100,a=Number(n[2])/100,o,s,c;if(i===0)return c=a*255,{r:Math.round(c),g:Math.round(c),b:Math.round(c),a:1};o=a<.5?a*(1+i):a+i-a*i;let l=2*a-o,u=[0,0,0];for(let e=0;e<3;e++)s=r+1/3*-(e-1),s<0&&s++,s>1&&s--,c=6*s<1?l+(o-l)*6*s:2*s<1?o:3*s<2?l+(o-l)*(2/3-s)*6:l,u[e]=c*255;return{r:Math.round(u[0]),g:Math.round(u[1]),b:Math.round(u[2]),a:1}}},haveIntersection(e,t){return!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.height1?(o=n,s=r,c=(n-i)*(n-i)+(r-a)*(r-a)):(o=e+u*(n-e),s=t+u*(r-t),c=(o-i)*(o-i)+(s-a)*(s-a))}return[o,s,c]},_getProjectionToLine(e,t,n){let r=F.cloneObject(e),i=Number.MAX_VALUE;return t.forEach(function(a,o){if(!n&&o===t.length-1)return;let s=t[(o+1)%t.length],c=F._getProjectionToSegment(a.x,a.y,s.x,s.y,e.x,e.y),l=c[0],u=c[1],d=c[2];dt.length){let n=t;t=e,e=n}for(let t=0;t{e.width=0,e.height=0})},drawRoundedRectPath(e,t,n,r){let i=t<0?t:0,a=n<0?n:0;t=Math.abs(t),n=Math.abs(n);let o=0,s=0,c=0,l=0;typeof r==`number`?o=s=c=l=Math.min(r,t/2,n/2):(o=Math.min(r[0]||0,t/2,n/2),s=Math.min(r[1]||0,t/2,n/2),l=Math.min(r[2]||0,t/2,n/2),c=Math.min(r[3]||0,t/2,n/2)),e.moveTo(i+o,a),e.lineTo(i+t-s,a),e.arc(i+t-s,a+s,s,Math.PI*3/2,0,!1),e.lineTo(i+t,a+n-l),e.arc(i+t-l,a+n-l,l,0,Math.PI/2,!1),e.lineTo(i+c,a+n),e.arc(i+c,a+n-c,c,Math.PI/2,Math.PI,!1),e.lineTo(i,a+o),e.arc(i+o,a+o,o,Math.PI,Math.PI*3/2,!1)},drawRoundedPolygonPath(e,t,n,r,i){r=Math.abs(r);for(let a=0;atypeof e==`number`?Math.floor(e):e)),i+=De+c.join(Ee)+Oe)):(i+=o.property,e||(i+=Ne+o.val)),i+=je;return i}clearTrace(){this.traceArr=[]}_trace(e){let t=this.traceArr,n;t.push(e),n=t.length,n>=Ie&&t.shift()}reset(){let e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){let t=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,t.getWidth()/t.pixelRatio,t.getHeight()/t.pixelRatio)}_applyLineCap(e){let t=e.attrs.lineCap;t&&this.setAttr(`lineCap`,t)}_applyOpacity(e){let t=e.getAbsoluteOpacity();t!==1&&this.setAttr(`globalAlpha`,t)}_applyLineJoin(e){let t=e.attrs.lineJoin;t&&this.setAttr(`lineJoin`,t)}_applyMiterLimit(e){let t=e.attrs.miterLimit;t!=null&&this.setAttr(`miterLimit`,t)}setAttr(e,t){this._context[e]=t}arc(e,t,n,r,i,a){this._context.arc(e,t,n,r,i,a)}arcTo(e,t,n,r,i){this._context.arcTo(e,t,n,r,i)}beginPath(){this._context.beginPath()}bezierCurveTo(e,t,n,r,i,a){this._context.bezierCurveTo(e,t,n,r,i,a)}clearRect(e,t,n,r){this._context.clearRect(e,t,n,r)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,t){let n=arguments;if(n.length===2)return this._context.createImageData(e,t);if(n.length===1)return this._context.createImageData(e)}createLinearGradient(e,t,n,r){return this._context.createLinearGradient(e,t,n,r)}createPattern(e,t){return this._context.createPattern(e,t)}createRadialGradient(e,t,n,r,i,a){return this._context.createRadialGradient(e,t,n,r,i,a)}drawImage(e,t,n,r,i,a,o,s,c){let l=arguments,u=this._context;l.length===3?u.drawImage(e,t,n):l.length===5?u.drawImage(e,t,n,r,i):l.length===9&&u.drawImage(e,t,n,r,i,a,o,s,c)}ellipse(e,t,n,r,i,a,o,s){this._context.ellipse(e,t,n,r,i,a,o,s)}isPointInPath(e,t,n,r){return n?this._context.isPointInPath(n,e,t,r):this._context.isPointInPath(e,t,r)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,t,n,r){this._context.fillRect(e,t,n,r)}strokeRect(e,t,n,r){this._context.strokeRect(e,t,n,r)}fillText(e,t,n,r){r?this._context.fillText(e,t,n,r):this._context.fillText(e,t,n)}measureText(e){return this._context.measureText(e)}getImageData(e,t,n,r){return this._context.getImageData(e,t,n,r)}lineTo(e,t){this._context.lineTo(e,t)}moveTo(e,t){this._context.moveTo(e,t)}rect(e,t,n,r){this._context.rect(e,t,n,r)}roundRect(e,t,n,r,i){this._context.roundRect(e,t,n,r,i)}putImageData(e,t,n){this._context.putImageData(e,t,n)}quadraticCurveTo(e,t,n,r){this._context.quadraticCurveTo(e,t,n,r)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,t){this._context.scale(e,t)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):`mozDash`in this._context?this._context.mozDash=e:`webkitLineDash`in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,t,n,r,i,a){this._context.setTransform(e,t,n,r,i,a)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,t,n,r){this._context.strokeText(e,t,n,r)}transform(e,t,n,r,i,a){this._context.transform(e,t,n,r,i,a)}translate(e,t){this._context.translate(e,t)}_enableTrace(){let e=this,t=Pe.length,n=this.setAttr,r,i,a=function(t){let n=e[t],r;e[t]=function(){return i=Te(Array.prototype.slice.call(arguments,0)),r=n.apply(e,arguments),e._trace({method:t,args:i}),r}};for(r=0;r{t.dragStatus===`dragging`&&(e=!0)}),e},justDragged:!1,get node(){let e;return I._dragElements.forEach(t=>{e=t.node}),e},_dragElements:new Map,_drag(e){let t=[];I._dragElements.forEach((n,r)=>{let{node:i}=n,a=i.getStage();a.setPointersPositions(e),n.pointerId===void 0&&(n.pointerId=F._getFirstPointerId(e));let o=a._changedPointerPositions.find(e=>e.id===n.pointerId);if(o){if(n.dragStatus!==`dragging`){let t=i.dragDistance();if(Math.max(Math.abs(o.x-n.startPointerPos.x),Math.abs(o.y-n.startPointerPos.y)){t.getStage()&&t.fire(`dragmove`,{type:`dragmove`,target:t,evt:e},!0)})},_endDragBefore(e){let t=[];I._dragElements.forEach(n=>{let{node:r}=n,i=r.getStage();if(e&&i.setPointersPositions(e),!i._changedPointerPositions.find(e=>e.id===n.pointerId))return;(n.dragStatus===`dragging`||n.dragStatus===`stopped`)&&(I.justDragged=!0,M._mouseListenClick=!1,M._touchListenClick=!1,M._pointerListenClick=!1,n.dragStatus=`stopped`);let a=n.node.getLayer()||n.node instanceof M.Stage&&n.node;a&&t.indexOf(a)===-1&&t.push(a)}),t.forEach(e=>{e.draw()})},_endDragAfter(e){I._dragElements.forEach((t,n)=>{t.dragStatus===`stopped`&&t.node.fire(`dragend`,{type:`dragend`,target:t.node,evt:e},!0),t.dragStatus!==`dragging`&&I._dragElements.delete(n)})}};M.isBrowser&&(window.addEventListener(`mouseup`,I._endDragBefore,!0),window.addEventListener(`touchend`,I._endDragBefore,!0),window.addEventListener(`touchcancel`,I._endDragBefore,!0),window.addEventListener(`mousemove`,I._drag),window.addEventListener(`touchmove`,I._drag),window.addEventListener(`mouseup`,I._endDragAfter,!1),window.addEventListener(`touchend`,I._endDragAfter,!1),window.addEventListener(`touchcancel`,I._endDragAfter,!1));function qe(e){return F._isString(e)?`"`+e+`"`:Object.prototype.toString.call(e)===`[object Number]`||F._isBoolean(e)?e:Object.prototype.toString.call(e)}function Je(e){return e>255?255:e<0?0:Math.round(e)}function L(){if(M.isUnminified)return function(e,t){return F._isNumber(e)||F.warn(qe(e)+` is a not valid value for "`+t+`" attribute. The value should be a number.`),e}}function Ye(e){if(M.isUnminified)return function(t,n){let r=F._isNumber(t),i=F._isArray(t)&&t.length==e;return!r&&!i&&F.warn(qe(t)+` is a not valid value for "`+n+`" attribute. The value should be a number or Array(`+e+`)`),t}}function Xe(){if(M.isUnminified)return function(e,t){return F._isNumber(e)||e===`auto`||F.warn(qe(e)+` is a not valid value for "`+t+`" attribute. The value should be a number or "auto".`),e}}function Ze(){if(M.isUnminified)return function(e,t){return F._isString(e)||F.warn(qe(e)+` is a not valid value for "`+t+`" attribute. The value should be a string.`),e}}function Qe(){if(M.isUnminified)return function(e,t){let n=F._isString(e),r=Object.prototype.toString.call(e)===`[object CanvasGradient]`||e&&e.addColorStop;return n||r||F.warn(qe(e)+` is a not valid value for "`+t+`" attribute. The value should be a string or a native gradient.`),e}}function $e(){if(M.isUnminified)return function(e,t){let n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(F._isArray(e)?e.forEach(function(e){F._isNumber(e)||F.warn(`"`+t+`" attribute has non numeric element `+e+`. Make sure that all elements are numbers.`)}):F.warn(qe(e)+` is a not valid value for "`+t+`" attribute. The value should be a array of numbers.`)),e}}function et(){if(M.isUnminified)return function(e,t){return e===!0||e===!1||F.warn(qe(e)+` is a not valid value for "`+t+`" attribute. The value should be a boolean.`),e}}function tt(e){if(M.isUnminified)return function(t,n){return t==null||F.isObject(t)||F.warn(qe(t)+` is a not valid value for "`+n+`" attribute. The value should be an object with properties `+e),t}}var nt=`get`,rt=`set`,R={addGetterSetter(e,t,n,r,i){R.addGetter(e,t,n),R.addSetter(e,t,r,i),R.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){let r=nt+F._capitalize(t);e.prototype[r]=e.prototype[r]||function(){let e=this.attrs[t];return e===void 0?n:e}},addSetter(e,t,n,r){let i=rt+F._capitalize(t);e.prototype[i]||R.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){let i=rt+F._capitalize(t);e.prototype[i]=function(e){return n&&e!=null&&(e=n.call(this,e,t)),this._setAttr(t,e),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,i){let a=n.length,o=F._capitalize,s=nt+o(t),c=rt+o(t);e.prototype[s]=function(){let e={};for(let r=0;r{this._setAttr(t+o(e),void 0)}),this._fireChangeEvent(t,a,e),i&&i.call(this),this},R.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){let n=F._capitalize(t),r=rt+n,i=nt+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(e,t,n,r){F.error(`Adding deprecated `+t);let i=nt+F._capitalize(t),a=t+` property is deprecated and will be removed soon. Look at Konva change log for more information.`;e.prototype[i]=function(){F.error(a);let e=this.attrs[t];return e===void 0?n:e},R.addSetter(e,t,r,function(){F.error(a)}),R.addOverloadedGetterSetter(e,t)},backCompat(e,t){F.each(t,function(t,n){let r=e.prototype[n],i=nt+F._capitalize(t),a=rt+F._capitalize(t);function o(){r.apply(this,arguments),F.error(`"`+t+`" method is deprecated and will be removed soon. Use ""`+n+`" instead.`)}e.prototype[t]=o,e.prototype[i]=o,e.prototype[a]=o})},afterSetFilter(){this._filterUpToDate=!1}};function it(e){let t=/(\w+)\(([^)]+)\)/g,n;for(;(n=t.exec(e))!==null;){let[,e,t]=n;switch(e){case`blur`:{let e=parseFloat(t.replace(`px`,``));return function(t){this.blurRadius(e*.5);let n=M.Filters;n&&n.Blur&&n.Blur.call(this,t)}}case`brightness`:{let e=t.includes(`%`)?parseFloat(t)/100:parseFloat(t);return function(t){this.brightness(e);let n=M.Filters;n&&n.Brightness&&n.Brightness.call(this,t)}}case`contrast`:{let e=parseFloat(t);return function(t){let n=100*(Math.sqrt(e)-1);this.contrast(n);let r=M.Filters;r&&r.Contrast&&r.Contrast.call(this,t)}}case`grayscale`:return function(e){let t=M.Filters;t&&t.Grayscale&&t.Grayscale.call(this,e)};case`sepia`:return function(e){let t=M.Filters;t&&t.Sepia&&t.Sepia.call(this,e)};case`invert`:return function(e){let t=M.Filters;t&&t.Invert&&t.Invert.call(this,e)};default:F.warn(`CSS filter "${e}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}var at=`absoluteOpacity`,ot=`allEventListeners`,st=`absoluteTransform`,ct=`absoluteScale`,lt=`canvas`,ut=`Change`,dt=`children`,ft=`konva`,pt=`listening`,mt=`mouseenter`,ht=`mouseleave`,gt=`pointerenter`,_t=`pointerleave`,vt=`touchenter`,yt=`touchleave`,bt=`set`,xt=`Shape`,St=` `,Ct=`stage`,wt=`transform`,Tt=`Stage`,Et=`visible`,Dt=[`xChange.konva`,`yChange.konva`,`scaleXChange.konva`,`scaleYChange.konva`,`skewXChange.konva`,`skewYChange.konva`,`rotationChange.konva`,`offsetXChange.konva`,`offsetYChange.konva`,`transformsEnabledChange.konva`].join(St),Ot=1,z=class e{constructor(e){this._id=Ot++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===wt||e===st)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,t){let n=this._cache.get(e);return(n===void 0||(e===wt||e===st)&&n.dirty===!0)&&(n=t.call(this),this._cache.set(e,n)),n}_calculate(e,t,n){if(!this._attachedDepsListeners.get(e)){let n=t.map(e=>e+`Change.konva`).join(St);this.on(n,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,n)}_getCanvasCache(){return this._cache.get(lt)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===st&&this.fire(`absoluteTransformChange`)}clearCache(){if(this._cache.has(lt)){let{scene:e,filter:t,hit:n}=this._cache.get(lt);F.releaseCanvas(e._canvas,t._canvas,n._canvas),this._cache.delete(lt)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){let t=e||{},n={};(t.x===void 0||t.y===void 0||t.width===void 0||t.height===void 0)&&(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let r=Math.ceil(t.width||n.width),i=Math.ceil(t.height||n.height),a=t.pixelRatio,o=t.x===void 0?Math.floor(n.x):t.x,s=t.y===void 0?Math.floor(n.y):t.y,c=t.offset||0,l=t.drawBorder||!1,u=t.hitCanvasPixelRatio||1;if(!r||!i){F.error(`Can not cache the node. Width or height of the node equals 0. Caching is skipped.`);return}let d=+(Math.abs(Math.round(n.x)-o)>.5),f=+(Math.abs(Math.round(n.y)-s)>.5);r+=c*2+d,i+=c*2+f,o-=c,s-=c;let p=new Ge({pixelRatio:a,width:r,height:i}),m=new Ge({pixelRatio:a,width:0,height:0,willReadFrequently:!0}),h=new Ke({pixelRatio:u,width:r,height:i}),g=p.getContext(),_=h.getContext(),v=new Ge({width:p.width/p.pixelRatio+Math.abs(o),height:p.height/p.pixelRatio+Math.abs(s),pixelRatio:p.pixelRatio}),y=v.getContext();return h.isCache=!0,p.isCache=!0,this._cache.delete(lt),this._filterUpToDate=!1,t.imageSmoothingEnabled===!1&&(p.getContext()._context.imageSmoothingEnabled=!1,m.getContext()._context.imageSmoothingEnabled=!1),g.save(),_.save(),y.save(),g.translate(-o,-s),_.translate(-o,-s),y.translate(-o,-s),v.x=o,v.y=s,this._isUnderCache=!0,this._clearSelfAndDescendantCache(at),this._clearSelfAndDescendantCache(ct),this.drawScene(p,this,v),this.drawHit(h,this),this._isUnderCache=!1,g.restore(),_.restore(),l&&(g.save(),g.beginPath(),g.rect(0,0,r,i),g.closePath(),g.setAttr(`strokeStyle`,`red`),g.setAttr(`lineWidth`,5),g.stroke(),g.restore()),F.releaseCanvas(v._canvas),this._cache.set(lt,{scene:p,filter:m,hit:h,x:o,y:s}),this._requestDraw(),this}isCached(){return this._cache.has(lt)}getClientRect(e){throw Error(`abstract "getClientRect" method call`)}_transformedRect(e,t){let n=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],r=1/0,i=1/0,a=-1/0,o=-1/0,s=this.getAbsoluteTransform(t);return n.forEach(function(e){let t=s.point(e);r===void 0&&(r=a=t.x,i=o=t.y),r=Math.min(r,t.x),i=Math.min(i,t.y),a=Math.max(a,t.x),o=Math.max(o,t.y)}),{x:r,y:i,width:a-r,height:o-i}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);let t=this._getCanvasCache();e.translate(t.x,t.y);let n=this._getCachedSceneCanvas(),r=n.pixelRatio;e.drawImage(n._canvas,0,0,n.width/r,n.height/r),e.restore()}_drawCachedHitCanvas(e){let t=this._getCanvasCache(),n=t.hit;e.save(),e.translate(t.x,t.y),e.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),e.restore()}_getCachedSceneCanvas(){let e=this.filters(),t=this._getCanvasCache(),n=t.scene,r=t.filter,i=r.getContext(),a,o,s,c;if(!e||e.length===0)return n;if(this._filterUpToDate)return r;let l=!0;for(let t=0;t{this.isAncestorOf(e.node)&&I._dragElements.delete(t)}),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(st),this._clearSelfAndDescendantCache(at),this._clearSelfAndDescendantCache(ct),this._clearSelfAndDescendantCache(Ct),this._clearSelfAndDescendantCache(Et),this._clearSelfAndDescendantCache(pt)}_remove(){this._clearCaches();let e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(e){let t=`get`+F._capitalize(e);return F._isFunction(this[t])?this[t]():this.attrs[e]}getAncestors(){let e=this.getParent(),t=[];for(;e;)t.push(e),e=e.getParent();return t}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{let t,n;if(!e)return this;for(t in e)t!==dt&&(n=bt+F._capitalize(t),F._isFunction(this[n])?this[n](e[t]):this._setAttr(t,e[t]))}),this}isListening(){return this._getCache(pt,this._isListening)}_isListening(e){if(!this.listening())return!1;let t=this.getParent();return t&&t!==e&&this!==e?t._isListening(e):!0}isVisible(){return this._getCache(Et,this._isVisible)}_isVisible(e){if(!this.visible())return!1;let t=this.getParent();return t&&t!==e&&this!==e?t._isVisible(e):!0}shouldDrawHit(e,t=!1){if(e)return this._isVisible(e)&&this._isListening(e);let n=this.getLayer(),r=!1;I._dragElements.forEach(e=>{e.dragStatus===`dragging`&&(e.node.nodeType===`Stage`||e.node.getLayer()===n)&&(r=!0)});let i=!t&&!M.hitOnDragEnabled&&(r||M.isTransforming());return this.isListening()&&this.isVisible()&&!i}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let e=this.getDepth(),t=this,n=0,r,i,a,o;function s(c){for(r=[],i=c.length,a=0;a0&&r[0].getDepth()<=e&&s(r)}let c=this.getStage();return t.nodeType!==Tt&&c&&s(c.getChildren()),n}getDepth(){let e=0,t=this.parent;for(;t;)e++,t=t.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(wt),this._clearSelfAndDescendantCache(st)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){let e=this.getStage();if(!e)return null;let t=e.getPointerPosition();if(!t)return null;let n=this.getAbsoluteTransform().copy();return n.invert(),n.point(t)}getAbsolutePosition(e){let t=!1,n=this.parent;for(;n;){if(n.isCached()){t=!0;break}n=n.parent}t&&!e&&(e=!0);let r=this.getAbsoluteTransform(e).getMatrix(),i=new P,a=this.offset();return i.m=r.slice(),i.translate(a.x,a.y),i.getTranslation()}setAbsolutePosition(e){let{x:t,y:n,...r}=this._clearTransform();this.attrs.x=t,this.attrs.y=n,this._clearCache(wt);let i=this._getAbsoluteTransform().copy();return i.invert(),i.translate(e.x,e.y),e={x:this.attrs.x+i.getTranslation().x,y:this.attrs.y+i.getTranslation().y},this._setTransform(r),this.setPosition({x:e.x,y:e.y}),this._clearCache(wt),this._clearSelfAndDescendantCache(st),this}_setTransform(e){let t;for(t in e)this.attrs[t]=e[t]}_clearTransform(){let e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){let t=e.x,n=e.y,r=this.x(),i=this.y();return t!==void 0&&(r+=t),n!==void 0&&(i+=n),this.setPosition({x:r,y:i}),this}_eachAncestorReverse(e,t){let n=[],r=this.getParent(),i,a;if(!(t&&t._id===this._id)){for(n.unshift(this);r&&(!t||r._id!==t._id);)n.unshift(r),r=r.parent;for(i=n.length,a=0;a0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return F.warn(`Node has no parent. moveToBottom function is ignored.`),!1;let e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(e){if(!this.parent)return F.warn(`Node has no parent. zIndex parameter is ignored.`),this;(e<0||e>=this.parent.children.length)&&F.warn(`Unexpected value `+e+` for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to `+(this.parent.children.length-1)+`.`);let t=this.index;return this.parent.children.splice(t,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(at,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let e=this.opacity(),t=this.getParent();return t&&!t._isUnderCache&&(e*=t.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){let e=this.getAttrs(),t,n,r,i,a,o={attrs:{},className:this.getClassName()};for(t in e)n=e[t],a=F.isObject(n)&&!F._isPlainObject(n)&&!F._isArray(n),!a&&(r=typeof this[t]==`function`&&this[t],delete e[t],i=r?r.call(this):null,e[t]=n,i!==n&&(o.attrs[t]=n));return F._prepareToStringify(o)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,t,n){let r=[];t&&this._isMatch(e)&&r.push(this);let i=this.parent;for(;i;){if(i===n)return r;i._isMatch(e)&&r.push(i),i=i.parent}return r}isAncestorOf(e){return!1}findAncestor(e,t,n){return this.findAncestors(e,t,n)[0]}_isMatch(e){if(!e)return!1;if(typeof e==`function`)return e(this);let t=e.replace(/ /g,``).split(`,`),n=t.length,r,i;for(r=0;r{try{let n=e?.callback;n&&delete e.callback,F._urlToImage(this.toDataURL(e),function(e){t(e),n?.(e)})}catch(e){n(e)}})}toBlob(e){return new Promise((t,n)=>{try{let n=e?.callback;n&&delete e.callback,this.toCanvas(e).toBlob(e=>{t(e),n?.(e)},e?.mimeType,e?.quality)}catch(e){n(e)}})}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance===void 0?this.parent?this.parent.getDragDistance():M.dragDistance:this.attrs.dragDistance}_off(e,t,n){let r=this.eventListeners[e],i,a,o;for(i=0;i=0)||this.isDragging())return;let t=!1;I._dragElements.forEach(e=>{this.isAncestorOf(e.node)&&(t=!0)}),t||this._createDragElement(e)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;let e=I._dragElements.get(this._id),t=e&&e.dragStatus===`dragging`,n=e&&e.dragStatus===`ready`;t?this.stopDrag():n&&I._dragElements.delete(this._id)}}_dragCleanup(){this.off(`mousedown.konva`),this.off(`touchstart.konva`)}isClientRectOnScreen(e={x:0,y:0}){let t=this.getStage();if(!t)return!1;let n={x:-e.x,y:-e.y,width:t.width()+2*e.x,height:t.height()+2*e.y};return F.haveIntersection(n,this.getClientRect())}static create(e,t){return F._isString(e)&&(e=JSON.parse(e)),this._createNode(e,t)}static _createNode(t,n){let r=e.prototype.getClassName.call(t),i=t.children,a,o,s;n&&(t.attrs.container=n),M[r]||(F.warn(`Can not find a node with class name "`+r+`". Fallback to "Shape".`),r=`Shape`);let c=M[r];if(a=new c(t.attrs),i)for(o=i.length,s=0;s0}removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(e.length===0)return this;if(e.length>1){for(let t=0;t0?t[0]:void 0}_generalFind(e,t){let n=[];return this._descendants(r=>{let i=r._isMatch(e);return i&&n.push(r),!!(i&&t)}),n}_descendants(e){let t=!1,n=this.getChildren();for(let r of n)if(t=e(r),t||r.hasChildren()&&(t=r._descendants(e),t))return!0;return!1}toObject(){let e=z.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach(t=>{e.children.push(t.toObject())}),e}isAncestorOf(e){let t=e.getParent();for(;t;){if(t._id===this._id)return!0;t=t.getParent()}return!1}clone(e){let t=z.prototype.clone.call(this,e);return this.getChildren().forEach(function(e){t.add(e.clone())}),t}getAllIntersections(e){let t=[];return this.find(`Shape`).forEach(n=>{n.isVisible()&&n.intersects(e)&&t.push(n)}),t}_clearSelfAndDescendantCache(e){var t;super._clearSelfAndDescendantCache(e),!this.isCached()&&((t=this.children)==null||t.forEach(function(t){t._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)==null||e.forEach(function(e,t){e.index=t}),this._requestDraw()}drawScene(e,t,n){let r=this.getLayer(),i=e||r&&r.getCanvas(),a=i&&i.getContext(),o=this._getCanvasCache(),s=o&&o.scene,c=i&&i.isCache;if(!this.isVisible()&&!c)return this;if(s){a.save();let e=this.getAbsoluteTransform(t).getMatrix();a.transform(e[0],e[1],e[2],e[3],e[4],e[5]),this._drawCachedSceneCanvas(a),a.restore()}else this._drawChildren(`drawScene`,i,t,n);return this}drawHit(e,t){if(!this.shouldDrawHit(t))return this;let n=this.getLayer(),r=e||n&&n.hitCanvas,i=r&&r.getContext(),a=this._getCanvasCache();if(a&&a.hit){i.save();let e=this.getAbsoluteTransform(t).getMatrix();i.transform(e[0],e[1],e[2],e[3],e[4],e[5]),this._drawCachedHitCanvas(i),i.restore()}else this._drawChildren(`drawHit`,r,t);return this}_drawChildren(e,t,n,r){var i;let a=t&&t.getContext(),o=this.clipWidth(),s=this.clipHeight(),c=this.clipFunc(),l=typeof o==`number`&&typeof s==`number`||c,u=n===this;if(l){a.save();let e=this.getAbsoluteTransform(n),t=e.getMatrix();a.transform(t[0],t[1],t[2],t[3],t[4],t[5]),a.beginPath();let r;if(c)r=c.call(this,a,this);else{let e=this.clipX(),t=this.clipY();a.rect(e||0,t||0,o,s)}a.clip.apply(a,r),t=e.copy().invert().getMatrix(),a.transform(t[0],t[1],t[2],t[3],t[4],t[5])}let d=!u&&this.globalCompositeOperation()!==`source-over`&&e===`drawScene`;d&&(a.save(),a._applyGlobalCompositeOperation(this)),(i=this.children)==null||i.forEach(function(i){i[e](t,n,r)}),d&&a.restore(),l&&a.restore()}getClientRect(e={}){var t;let n=e.skipTransform,r=e.relativeTo,i,a,o,s,c={x:1/0,y:1/0,width:0,height:0},l=this;(t=this.children)==null||t.forEach(function(t){if(!t.visible())return;let n=t.getClientRect({relativeTo:l,skipShadow:e.skipShadow,skipStroke:e.skipStroke});n.width===0&&n.height===0||(i===void 0?(i=n.x,a=n.y,o=n.x+n.width,s=n.y+n.height):(i=Math.min(i,n.x),a=Math.min(a,n.y),o=Math.max(o,n.x+n.width),s=Math.max(s,n.y+n.height)))});let u=this.find(`Shape`),d=!1;for(let e=0;ee.indexOf(`pointer`)>=0?`pointer`:e.indexOf(`touch`)>=0?`touch`:`mouse`,fn=e=>{let t=dn(e);if(t===`pointer`)return M.pointerEventsEnabled&&un.pointer;if(t===`touch`)return un.touch;if(t===`mouse`)return un.mouse};function pn(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&F.warn(`Stage does not support clipping. Please use clip for Layers or Groups.`),e}var mn=`Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);`,hn=[],gn=class extends V{constructor(e){super(pn(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),hn.push(this),this.on(`widthChange.konva heightChange.konva`,this._resizeDOM),this.on(`visibleChange.konva`,this._checkVisibility),this.on(`clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva`,()=>{pn(this.attrs)}),this._checkVisibility()}_validateAdd(e){let t=e.getType()===`Layer`,n=e.getType()===`FastLayer`;t||n||F.throw(`You may only add layers to the stage.`)}_checkVisibility(){if(!this.content)return;let e=this.visible()?``:`none`;this.content.style.display=e}setContainer(e){if(typeof e===Lt){let t;if(e.charAt(0)===`.`){let t=e.slice(1);e=document.getElementsByClassName(t)[0]}else t=e.charAt(0)===`#`?e.slice(1):e,e=document.getElementById(t);if(!e)throw`Can not find container in document with id `+t}return this._setAttr(`container`,e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){let e=this.children,t=e.length;for(let n=0;n-1&&hn.splice(t,1),F.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){let e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(F.warn(mn),null)}_getPointerById(e){return this._pointerPositions.find(t=>t.id===e)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){e={...e},e.x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();let t=new Ge({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),n=t.getContext()._context,r=this.children;return(e.x||e.y)&&n.translate(-1*e.x,-1*e.y),r.forEach(function(t){if(!t.isVisible())return;let r=t._toKonvaCanvas(e);n.drawImage(r._canvas,e.x,e.y,r.getWidth()/r.getPixelRatio(),r.getHeight()/r.getPixelRatio())}),t}getIntersection(e){if(!e)return null;let t=this.children,n=t.length-1;for(let r=n;r>=0;r--){let n=t[r].getIntersection(e);if(n)return n}return null}_resizeDOM(){let e=this.width(),t=this.height();this.content&&(this.content.style.width=e+Rt,this.content.style.height=t+Rt),this.bufferCanvas.setSize(e,t),this.bufferHitCanvas.setSize(e,t),this.children.forEach(n=>{n.setSize({width:e,height:t}),n.draw()})}add(e,...t){if(arguments.length>1){for(let e=0;ecn&&F.warn(`The stage has `+n+` layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group.`),e.setSize({width:this.width(),height:this.height()}),e.draw(),M.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return Nt(e,this)}setPointerCapture(e){Pt(e,this)}releaseCapture(e){Ft(e,this)}getLayers(){return this.children}_bindContentEvents(){M.isBrowser&&ln.forEach(([e,t])=>{this.content.addEventListener(e,e=>{this[t](e)},{passive:!1})})}_pointerenter(e){this.setPointersPositions(e);let t=fn(e.type);t&&this._fire(t.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);let t=fn(e.type);t&&this._fire(t.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let t=this[e+`targetShape`];return t&&!t.getStage()&&(t=null),t}_pointerleave(e){let t=fn(e.type),n=dn(e.type);if(!t)return;this.setPointersPositions(e);let r=this._getTargetShape(n),i=!(M.isDragging()||M.isTransforming())||M.hitOnDragEnabled;r&&i?(r._fireAndBubble(t.pointerout,{evt:e}),r._fireAndBubble(t.pointerleave,{evt:e}),this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this[n+`targetShape`]=null):i&&(this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(t.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(e){let t=fn(e.type),n=dn(e.type);if(!t)return;this.setPointersPositions(e);let r=!1;this._changedPointerPositions.forEach(i=>{let a=this.getIntersection(i);if(I.justDragged=!1,M[`_`+n+`ListenClick`]=!0,!a||!a.isListening()){this[n+`ClickStartShape`]=void 0;return}M.capturePointerEventsEnabled&&a.setPointerCapture(i.id),this[n+`ClickStartShape`]=a,a._fireAndBubble(t.pointerdown,{evt:e,pointerId:i.id}),r=!0;let o=e.type.indexOf(`touch`)>=0;a.preventDefault()&&e.cancelable&&o&&e.preventDefault()}),r||this._fire(t.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(e){let t=fn(e.type),n=dn(e.type);if(!t)return;let r=e.type.indexOf(`touch`)>=0||e.pointerType===`touch`;if(M.isDragging()&&I.node.preventDefault()&&e.cancelable&&r&&e.preventDefault(),this.setPointersPositions(e),!(!(M.isDragging()||M.isTransforming())||M.hitOnDragEnabled))return;let i={},a=!1,o=this._getTargetShape(n);this._changedPointerPositions.forEach(r=>{let s=jt(r.id)||this.getIntersection(r),c=r.id,l={evt:e,pointerId:c},u=o!==s;if(u&&o&&(o._fireAndBubble(t.pointerout,{...l},s),o._fireAndBubble(t.pointerleave,{...l},s)),s){if(i[s._id])return;i[s._id]=!0}s&&s.isListening()?(a=!0,u&&(s._fireAndBubble(t.pointerover,{...l},o),s._fireAndBubble(t.pointerenter,{...l},o),this[n+`targetShape`]=s),s._fireAndBubble(t.pointermove,{...l})):o&&(this._fire(t.pointerover,{evt:e,target:this,currentTarget:this,pointerId:c}),this[n+`targetShape`]=null)}),a||this._fire(t.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){let t=fn(e.type),n=dn(e.type);if(!t)return;this.setPointersPositions(e);let r=this[n+`ClickStartShape`],i=this[n+`ClickEndShape`],a={},o=!1;this._changedPointerPositions.forEach(s=>{let c=jt(s.id)||this.getIntersection(s);if(c){if(c.releaseCapture(s.id),a[c._id])return;a[c._id]=!0}let l=s.id,u={evt:e,pointerId:l},d=!1;M[`_`+n+`InDblClickWindow`]?(d=!0,clearTimeout(this[n+`DblTimeout`])):I.justDragged||(M[`_`+n+`InDblClickWindow`]=!0,clearTimeout(this[n+`DblTimeout`])),this[n+`DblTimeout`]=setTimeout(function(){M[`_`+n+`InDblClickWindow`]=!1},M.dblClickWindow),c&&c.isListening()?(o=!0,this[n+`ClickEndShape`]=c,c._fireAndBubble(t.pointerup,{...u}),M[`_`+n+`ListenClick`]&&r&&r===c&&(c._fireAndBubble(t.pointerclick,{...u}),d&&i&&i===c&&c._fireAndBubble(t.pointerdblclick,{...u}))):(this[n+`ClickEndShape`]=null,o||=(this._fire(t.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),!0),M[`_`+n+`ListenClick`]&&this._fire(t.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:l}),d&&this._fire(t.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:l}))}),o||this._fire(t.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),M[`_`+n+`ListenClick`]=!1,e.cancelable&&n!==`touch`&&n!==`pointer`&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);let t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(tn,{evt:e}):this._fire(tn,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);let t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(sn,{evt:e}):this._fire(sn,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);let t=jt(e.pointerId)||this.getIntersection(this.getPointerPosition());t&&t._fireAndBubble(Jt,Mt(e)),Ft(e.pointerId)}_lostpointercapture(e){Ft(e.pointerId)}setPointersPositions(e){let t=this._getContentPosition(),n=null,r=null;e||=window.event,e.touches===void 0?(n=(e.clientX-t.left)/t.scaleX,r=(e.clientY-t.top)/t.scaleY,this.pointerPos={x:n,y:r},this._pointerPositions=[{x:n,y:r,id:F._getFirstPointerId(e)}],this._changedPointerPositions=[{x:n,y:r,id:F._getFirstPointerId(e)}]):(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,e=>{this._pointerPositions.push({id:e.identifier,x:(e.clientX-t.left)/t.scaleX,y:(e.clientY-t.top)/t.scaleY})}),Array.prototype.forEach.call(e.changedTouches||e.touches,e=>{this._changedPointerPositions.push({id:e.identifier,x:(e.clientX-t.left)/t.scaleX,y:(e.clientY-t.top)/t.scaleY})}))}_setPointerPosition(e){F.warn(`Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.`),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};let e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new Ge({width:this.width(),height:this.height()}),this.bufferHitCanvas=new Ke({pixelRatio:1,width:this.width(),height:this.height()}),!M.isBrowser)return;let e=this.container();if(!e)throw`Stage has no container. A container is required.`;e.innerHTML=``,this.content=document.createElement(`div`),this.content.style.position=`relative`,this.content.style.userSelect=`none`,this.content.className=`konvajs-content`,this.content.setAttribute(`role`,`presentation`),e.appendChild(this.content),this._resizeDOM()}cache(){return F.warn(`Cache function is not allowed for stage. You may use cache only for layers, groups and shapes.`),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(e){e.batchDraw()}),this}};gn.prototype.nodeType=It,N(gn),R.addGetterSetter(gn,`container`),M.isBrowser&&document.addEventListener(`visibilitychange`,()=>{hn.forEach(e=>{e.batchDraw()})});var _n=`hasShadow`,vn=`shadowRGBA`,yn=`patternImage`,bn=`linearGradient`,xn=`radialGradient`,Sn;function Cn(){return Sn||(Sn=F.createCanvasElement().getContext(`2d`),Sn)}var wn={};function Tn(e){let t=this.attrs.fillRule;t?e.fill(t):e.fill()}function En(e){e.stroke()}function Dn(e){let t=this.attrs.fillRule;t?e.fill(t):e.fill()}function On(e){e.stroke()}function kn(){this._clearCache(_n)}function An(){this._clearCache(vn)}function jn(){this._clearCache(yn)}function Mn(){this._clearCache(bn)}function Nn(){this._clearCache(xn)}var H=class extends z{constructor(e){super(e);let t,n=0;for(;t=F.getHitColor(),!(t&&!(t in wn));)if(n++,n>=1e4){F.warn(`Failed to find a unique color key for a shape. Konva may work incorrectly. Most likely your browser is using canvas farbling. Consider disabling it.`),t=F.getRandomColor();break}this.colorKey=t,wn[t]=this}getContext(){return F.warn(`shape.getContext() method is deprecated. Please do not use it.`),this.getLayer().getContext()}getCanvas(){return F.warn(`shape.getCanvas() method is deprecated. Please do not use it.`),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(_n,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(yn,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){let e=Cn().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||`repeat`);if(e&&e.setTransform){let t=new P;t.translate(this.fillPatternX(),this.fillPatternY()),t.rotate(M.getAngle(this.fillPatternRotation())),t.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),t.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());let n=t.getMatrix(),r=typeof DOMMatrix>`u`?{a:n[0],b:n[1],c:n[2],d:n[3],e:n[4],f:n[5]}:new DOMMatrix(n);e.setTransform(r)}return e}}_getLinearGradient(){return this._getCache(bn,this.__getLinearGradient)}__getLinearGradient(){let e=this.fillLinearGradientColorStops();if(e){let t=Cn(),n=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),i=t.createLinearGradient(n.x,n.y,r.x,r.y);for(let t=0;tthis.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate(`hasStroke`,[`strokeEnabled`,`strokeWidth`,`stroke`,`strokeLinearGradientColorStops`],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){let e=this.hitStrokeWidth();return e===`auto`?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){let t=this.getStage();if(!t)return!1;let n=t.bufferHitCanvas;return n.getContext().clear(),this.drawHit(n,void 0,!0),n.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data[3]>0}destroy(){return z.prototype.destroy.call(this),delete wn[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){if(!(this.attrs.perfectDrawEnabled??!0))return!1;let t=e||this.hasFill(),n=this.hasStroke(),r=this.getAbsoluteOpacity()!==1;if(t&&n&&r)return!0;let i=this.hasShadow(),a=this.shadowForStrokeEnabled();return!!(t&&n&&i&&a)}setStrokeHitEnabled(e){F.warn(`strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead.`),e?this.hitStrokeWidth(`auto`):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){let e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){let t=!1,n=this.getParent();for(;n;){if(n.isCached()){t=!0;break}n=n.getParent()}let r=e.skipTransform,i=e.relativeTo||t&&this.getStage()||void 0,a=this.getSelfRect(),o=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,s=a.width+o,c=a.height+o,l=!e.skipShadow&&this.hasShadow(),u=l?this.shadowOffsetX():0,d=l?this.shadowOffsetY():0,f=s+Math.abs(u),p=c+Math.abs(d),m=l&&this.shadowBlur()||0,h={width:f+m*2,height:p+m*2,x:-(o/2+m)+Math.min(u,0)+a.x,y:-(o/2+m)+Math.min(d,0)+a.y};return r?h:this._transformedRect(h,i)}drawScene(e,t,n){let r=this.getLayer(),i=(e||r.getCanvas()).getContext(),a=this._getCanvasCache(),o=this.getSceneFunc(),s=this.hasShadow(),c,l=t===this;if(!this.isVisible()&&!l)return this;if(a){i.save();let e=this.getAbsoluteTransform(t).getMatrix();return i.transform(e[0],e[1],e[2],e[3],e[4],e[5]),this._drawCachedSceneCanvas(i),i.restore(),this}if(!o)return this;if(i.save(),this._useBufferCanvas()){c=this.getStage();let e=n||c.bufferCanvas,r=e.getContext();n?(r.save(),r.setTransform(1,0,0,1,0,0),r.clearRect(0,0,e.width,e.height),r.restore()):r.clear(),r.save(),r._applyLineJoin(this),r._applyMiterLimit(this);let a=this.getAbsoluteTransform(t).getMatrix();r.transform(a[0],a[1],a[2],a[3],a[4],a[5]),o.call(this,r,this),r.restore();let u=e.pixelRatio;s&&i._applyShadow(this),l||(i._applyOpacity(this),i._applyGlobalCompositeOperation(this)),i.drawImage(e._canvas,e.x||0,e.y||0,e.width/u,e.height/u)}else{if(i._applyLineJoin(this),i._applyMiterLimit(this),!l){let e=this.getAbsoluteTransform(t).getMatrix();i.transform(e[0],e[1],e[2],e[3],e[4],e[5]),i._applyOpacity(this),i._applyGlobalCompositeOperation(this)}s&&i._applyShadow(this),o.call(this,i,this)}return i.restore(),this}drawHit(e,t,n=!1){if(!this.shouldDrawHit(t,n))return this;let r=this.getLayer(),i=e||r.hitCanvas,a=i&&i.getContext(),o=this.hitFunc()||this.sceneFunc(),s=this._getCanvasCache(),c=s&&s.hit;if(this.colorKey||F.warn(`Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()`),c){a.save();let e=this.getAbsoluteTransform(t).getMatrix();return a.transform(e[0],e[1],e[2],e[3],e[4],e[5]),this._drawCachedHitCanvas(a),a.restore(),this}if(!o)return this;if(a.save(),a._applyLineJoin(this),a._applyMiterLimit(this),this!==t){let e=this.getAbsoluteTransform(t).getMatrix();a.transform(e[0],e[1],e[2],e[3],e[4],e[5])}return o.call(this,a,this),a.restore(),this}drawHitFromCache(e=0){let t=this._getCanvasCache(),n=this._getCachedSceneCanvas(),r=t.hit,i=r.getContext(),a=r.getWidth(),o=r.getHeight();i.clear(),i.drawImage(n._canvas,0,0,a,o);try{let t=i.getImageData(0,0,a,o),n=t.data,r=n.length,s=F._hexToRgb(this.colorKey);for(let t=0;te?(n[t]=s.r,n[t+1]=s.g,n[t+2]=s.b,n[t+3]=255):n[t+3]=0;i.putImageData(t,0,0)}catch(e){F.error(`Unable to draw hit graph from cached scene canvas. `+e.message)}return this}hasPointerCapture(e){return Nt(e,this)}setPointerCapture(e){Pt(e,this)}releaseCapture(e){Ft(e,this)}};H.prototype._fillFunc=Tn,H.prototype._strokeFunc=En,H.prototype._fillFuncHit=Dn,H.prototype._strokeFuncHit=On,H.prototype._centroid=!1,H.prototype.nodeType=`Shape`,N(H),H.prototype.eventListeners={},H.prototype.on(`shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva`,kn),H.prototype.on(`shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva`,An),H.prototype.on(`fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva`,jn),H.prototype.on(`fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva`,Mn),H.prototype.on(`fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva`,Nn),R.addGetterSetter(H,`stroke`,void 0,Qe()),R.addGetterSetter(H,`strokeWidth`,2,L()),R.addGetterSetter(H,`fillAfterStrokeEnabled`,!1),R.addGetterSetter(H,`hitStrokeWidth`,`auto`,Xe()),R.addGetterSetter(H,`strokeHitEnabled`,!0,et()),R.addGetterSetter(H,`perfectDrawEnabled`,!0,et()),R.addGetterSetter(H,`shadowForStrokeEnabled`,!0,et()),R.addGetterSetter(H,`lineJoin`),R.addGetterSetter(H,`lineCap`),R.addGetterSetter(H,`miterLimit`),R.addGetterSetter(H,`sceneFunc`),R.addGetterSetter(H,`hitFunc`),R.addGetterSetter(H,`dash`),R.addGetterSetter(H,`dashOffset`,0,L()),R.addGetterSetter(H,`shadowColor`,void 0,Ze()),R.addGetterSetter(H,`shadowBlur`,0,L()),R.addGetterSetter(H,`shadowOpacity`,1,L()),R.addComponentsGetterSetter(H,`shadowOffset`,[`x`,`y`]),R.addGetterSetter(H,`shadowOffsetX`,0,L()),R.addGetterSetter(H,`shadowOffsetY`,0,L()),R.addGetterSetter(H,`fillPatternImage`),R.addGetterSetter(H,`fill`,void 0,Qe()),R.addGetterSetter(H,`fillPatternX`,0,L()),R.addGetterSetter(H,`fillPatternY`,0,L()),R.addGetterSetter(H,`fillLinearGradientColorStops`),R.addGetterSetter(H,`strokeLinearGradientColorStops`),R.addGetterSetter(H,`fillRadialGradientStartRadius`,0),R.addGetterSetter(H,`fillRadialGradientEndRadius`,0),R.addGetterSetter(H,`fillRadialGradientColorStops`),R.addGetterSetter(H,`fillPatternRepeat`,`repeat`),R.addGetterSetter(H,`fillEnabled`,!0),R.addGetterSetter(H,`strokeEnabled`,!0),R.addGetterSetter(H,`shadowEnabled`,!0),R.addGetterSetter(H,`dashEnabled`,!0),R.addGetterSetter(H,`strokeScaleEnabled`,!0),R.addGetterSetter(H,`fillPriority`,`color`),R.addComponentsGetterSetter(H,`fillPatternOffset`,[`x`,`y`]),R.addGetterSetter(H,`fillPatternOffsetX`,0,L()),R.addGetterSetter(H,`fillPatternOffsetY`,0,L()),R.addComponentsGetterSetter(H,`fillPatternScale`,[`x`,`y`]),R.addGetterSetter(H,`fillPatternScaleX`,1,L()),R.addGetterSetter(H,`fillPatternScaleY`,1,L()),R.addComponentsGetterSetter(H,`fillLinearGradientStartPoint`,[`x`,`y`]),R.addComponentsGetterSetter(H,`strokeLinearGradientStartPoint`,[`x`,`y`]),R.addGetterSetter(H,`fillLinearGradientStartPointX`,0),R.addGetterSetter(H,`strokeLinearGradientStartPointX`,0),R.addGetterSetter(H,`fillLinearGradientStartPointY`,0),R.addGetterSetter(H,`strokeLinearGradientStartPointY`,0),R.addComponentsGetterSetter(H,`fillLinearGradientEndPoint`,[`x`,`y`]),R.addComponentsGetterSetter(H,`strokeLinearGradientEndPoint`,[`x`,`y`]),R.addGetterSetter(H,`fillLinearGradientEndPointX`,0),R.addGetterSetter(H,`strokeLinearGradientEndPointX`,0),R.addGetterSetter(H,`fillLinearGradientEndPointY`,0),R.addGetterSetter(H,`strokeLinearGradientEndPointY`,0),R.addComponentsGetterSetter(H,`fillRadialGradientStartPoint`,[`x`,`y`]),R.addGetterSetter(H,`fillRadialGradientStartPointX`,0),R.addGetterSetter(H,`fillRadialGradientStartPointY`,0),R.addComponentsGetterSetter(H,`fillRadialGradientEndPoint`,[`x`,`y`]),R.addGetterSetter(H,`fillRadialGradientEndPointX`,0),R.addGetterSetter(H,`fillRadialGradientEndPointY`,0),R.addGetterSetter(H,`fillPatternRotation`,0),R.addGetterSetter(H,`fillRule`,void 0,Ze()),R.backCompat(H,{dashArray:`dash`,getDashArray:`getDash`,setDashArray:`getDash`,drawFunc:`sceneFunc`,getDrawFunc:`getSceneFunc`,setDrawFunc:`setSceneFunc`,drawHitFunc:`hitFunc`,getDrawHitFunc:`getHitFunc`,setDrawHitFunc:`setHitFunc`});var Pn=`beforeDraw`,Fn=`draw`,In=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],Ln=In.length,Rn=class extends V{constructor(e){super(e),this.canvas=new Ge,this.hitCanvas=new Ke({pixelRatio:1}),this._waitingForDraw=!1,this.on(`visibleChange.konva`,this._checkVisibility),this._checkVisibility(),this.on(`imageSmoothingEnabledChange.konva`,this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);let t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),e{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;let t=1,n=!1;for(;;){for(let r=0;r0)return{antialiased:!0};return{}}drawScene(e,t,n){let r=this.getLayer(),i=e||r&&r.getCanvas();return this._fire(Pn,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),V.prototype.drawScene.call(this,i,t,n),this._fire(Fn,{node:this}),this}drawHit(e,t){let n=this.getLayer(),r=e||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),V.prototype.drawHit.call(this,r,t),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){F.warn(`hitGraphEnabled method is deprecated. Please use layer.listening() instead.`),this.listening(e)}getHitGraphEnabled(e){return F.warn(`hitGraphEnabled method is deprecated. Please use layer.listening() instead.`),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;let e=this.parent;this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}destroy(){return F.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};Rn.prototype.nodeType=`Layer`,N(Rn),R.addGetterSetter(Rn,`imageSmoothingEnabled`,!0),R.addGetterSetter(Rn,`clearBeforeDraw`,!0),R.addGetterSetter(Rn,`hitGraphEnabled`,!0,et());var zn=class extends Rn{constructor(e){super(e),this.listening(!1),F.warn(`Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.`)}};zn.prototype.nodeType=`FastLayer`,N(zn);var Bn=class extends V{_validateAdd(e){let t=e.getType();t!==`Group`&&t!==`Shape`&&F.throw(`You may only add groups and shapes to groups.`)}};Bn.prototype.nodeType=`Group`,N(Bn);var Vn=(function(){return ae.performance&&ae.performance.now?function(){return ae.performance.now()}:function(){return new Date().getTime()}})(),Hn=class e{constructor(t,n){this.id=e.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Vn(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(e){let t=[];return e&&(t=Array.isArray(e)?e:[e]),this.layers=t,this}getLayers(){return this.layers}addLayer(e){let t=this.layers,n=t.length;for(let r=0;rthis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return e===void 0&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=Gn,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire(`onPlay`)}reverse(){this.state=Kn,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire(`onReverse`)}seek(e){this.pause(),this._time=e,this.update(),this.fire(`onSeek`)}reset(){this.pause(),this._time=0,this.update(),this.fire(`onReset`)}finish(){this.pause(),this._time=this.duration,this.update(),this.fire(`onFinish`)}update(){this.setPosition(this.getPosition(this._time)),this.fire(`onUpdate`)}onEnterFrame(){let e=this.getTimer()-this._startTime;this.state===Gn?this.setTime(e):this.state===Kn&&this.setTime(this.duration-e)}pause(){this.state=Wn,this.fire(`onPause`)}getTimer(){return new Date().getTime()}},Xn=class e{constructor(t){let n=this,r=t.node,i=r._id,a=t.easing||Zn.Linear,o=!!t.yoyo,s,c;s=t.duration===void 0?.3:t.duration===0?.001:t.duration,this.node=r,this._id=Jn++;let l=r.getLayer()||(r instanceof M.Stage?r.getLayers():null);for(c in l||F.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new Hn(function(){n.tween.onEnterFrame()},l),this.tween=new Yn(c,function(e){n._tweenFunc(e)},a,0,1,s*1e3,o),this._addListeners(),e.attrs[i]||(e.attrs[i]={}),e.attrs[i][this._id]||(e.attrs[i][this._id]={}),e.tweens[i]||(e.tweens[i]={}),t)Un[c]===void 0&&this._addAttr(c,t[c]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,n){let r=this.node,i=r._id,a,o,s,c,l,u=e.tweens[i][t];u&&delete e.attrs[i][u][t];let d=r.getAttr(t);if(F._isArray(n))if(a=[],o=Math.max(n.length,d.length),t===`points`&&n.length!==d.length&&(n.length>d.length?(c=d,d=F._prepareArrayForTween(d,n,r.closed())):(s=n,n=F._prepareArrayForTween(n,d,r.closed()))),t.indexOf(`fill`)===0)for(let e=0;e{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{let t=this.node,n=e.attrs[t._id][this._id];n.points&&n.points.trueEnd&&t.setAttr(`points`,n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{let t=this.node,n=e.attrs[t._id][this._id];n.points&&n.points.trueStart&&t.points(n.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(e){return this.tween.seek(e*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){let t=this.node._id,n=this._id,r=e.tweens[t];this.pause(),this.anim&&this.anim.stop();for(let n in r)delete e.tweens[t][n];delete e.attrs[t][n],e.tweens[t]&&(Object.keys(e.tweens[t]).length===0&&delete e.tweens[t],Object.keys(e.attrs[t]).length===0&&delete e.attrs[t])}};Xn.attrs={},Xn.tweens={},z.prototype.to=function(e){let t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()},new Xn(e).play()};var Zn={BackEaseIn(e,t,n,r){let i=1.70158;return n*(e/=r)*e*((i+1)*e-i)+t},BackEaseOut(e,t,n,r){let i=1.70158;return n*((e=e/r-1)*e*((i+1)*e+i)+1)+t},BackEaseInOut(e,t,n,r){let i=1.70158;return(e/=r/2)<1?n/2*(e*e*(((i*=1.525)+1)*e-i))+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t},ElasticEaseIn(e,t,n,r,i,a){let o=0;return e===0?t:(e/=r)===1?t+n:(a||=r*.3,!i||i0?e:t),c=1*t,l=a*(a>0?e:t),u=o*(o>0?t:e);return{x:s,y:n?-1*u:l,width:c-s,height:u-l}}};$n.prototype._centroid=!0,$n.prototype.className=`Arc`,$n.prototype._attrsAffectingSize=[`innerRadius`,`outerRadius`,`angle`,`clockwise`],N($n),R.addGetterSetter($n,`innerRadius`,0,L()),R.addGetterSetter($n,`outerRadius`,0,L()),R.addGetterSetter($n,`angle`,0,L()),R.addGetterSetter($n,`clockwise`,!1,et());function er(e,t,n,r,i,a,o){let s=Math.sqrt((n-e)**2+(r-t)**2),c=Math.sqrt((i-n)**2+(a-r)**2),l=o*s/(s+c),u=o*c/(s+c);return[n-l*(i-e),r-l*(a-t),n+u*(i-e),r+u*(a-t)]}function tr(e,t){let n=e.length,r=[];for(let i=2;i=0){let e=Math.sqrt(a);n.push((-r+e)/(2*t)),n.push((-r-e)/(2*t))}}}return n.filter(e=>e>0&&e<1).flatMap(e=>t.map(t=>{let n=1-e;return n*n*n*t[0]+3*n*n*e*t[1]+3*n*e*e*t[2]+e*e*e*t[3]}))}var rr=class extends H{constructor(e){super(e),this.on(`pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva`,function(){this._clearCache(`tensionPoints`)})}_sceneFunc(e){let t=this.points(),n=t.length,r=this.tension(),i=this.closed(),a=this.bezier();if(!n)return;let o=0;if(e.beginPath(),e.moveTo(t[0],t[1]),r!==0&&n>4){let r=this.getTensionPoints(),a=r.length;for(o=i?0:4,i||e.quadraticCurveTo(r[0],r[1],r[2],r[3]);o{let r,i,a=n/2;r=0;for(let n=0;n<20;n++)i=a*ir[20][n]+a,r+=ar[20][n]*lr(e,t,i);return a*r},cr=(e,t,n)=>{n===void 0&&(n=1);let r=e[0]-2*e[1]+e[2],i=t[0]-2*t[1]+t[2],a=2*e[1]-2*e[0],o=2*t[1]-2*t[0],s=4*(r*r+i*i),c=4*(r*a+i*o),l=a*a+o*o;if(s===0)return n*Math.sqrt((e[2]-e[0])**2+(t[2]-t[0])**2);let u=c/(2*s),d=l/s,f=n+u,p=d-u*u,m=f*f+p>0?Math.sqrt(f*f+p):0,h=u*u+p>0?Math.sqrt(u*u+p):0,g=u+Math.sqrt(u*u+p)===0?0:p*Math.log(Math.abs((f+m)/(u+h)));return Math.sqrt(s)/2*(f*m-u*h+g)};function lr(e,t,n){let r=ur(1,n,e),i=ur(1,n,t),a=r*r+i*i;return Math.sqrt(a)}var ur=(e,t,n)=>{let r=n.length-1,i,a;if(r===0)return 0;if(e===0){a=0;for(let e=0;e<=r;e++)a+=or[r][e]*(1-t)**(r-e)*t**+e*n[e];return a}else{i=Array(r);for(let e=0;e{let r=1,i=e/t,a=(e-n(i))/t,o=0;for(;r>.001;){let s=n(i+a),c=Math.abs(e-s)/t;if(c500)break}return i},U=class e extends H{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on(`dataChange.konva`,function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=e.parsePathData(this.data()),this.pathLength=e.getPathLength(this.dataArray)}_sceneFunc(e){let t=this.dataArray;e.beginPath();let n=!1;for(let r=0;ro?i:o,f=i>o?1:i/o,p=i>o?o/i:1;e.translate(t,r),e.rotate(l),e.scale(f,p),e.arc(0,0,d,s,s+c,1-u),e.scale(1/f,1/p),e.rotate(-l),e.translate(-t,-r);break;case`z`:n=!0,e.closePath();break}}!n&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){let t=[];this.dataArray.forEach(function(n){if(n.command===`A`){let r=n.points[4],i=n.points[5],a=n.points[4]+i,o=Math.PI/180;if(Math.abs(r-a)a;i-=o){let r=e.getPointOnEllipticalArc(n.points[0],n.points[1],n.points[2],n.points[3],i,0);t.push(r.x,r.y)}else for(let i=r+o;in[i].pathLength;)t-=n[i].pathLength,++i;if(i===a)return r=n[i-1].points.slice(-2),{x:r[0],y:r[1]};if(t<.01)return n[i].command===`M`?(r=n[i].points.slice(0,2),{x:r[0],y:r[1]}):{x:n[i].start.x,y:n[i].start.y};let o=n[i],s=o.points;switch(o.command){case`L`:return e.getPointOnLine(t,o.start.x,o.start.y,s[0],s[1]);case`C`:return e.getPointOnCubicBezier(dr(t,e.getPathLength(n),e=>sr([o.start.x,s[0],s[2],s[4]],[o.start.y,s[1],s[3],s[5]],e)),o.start.x,o.start.y,s[0],s[1],s[2],s[3],s[4],s[5]);case`Q`:return e.getPointOnQuadraticBezier(dr(t,e.getPathLength(n),e=>cr([o.start.x,s[0],s[2]],[o.start.y,s[1],s[3]],e)),o.start.x,o.start.y,s[0],s[1],s[2],s[3]);case`A`:let r=s[0],i=s[1],a=s[2],c=s[3],l=s[5],u=s[6],d=s[4];return d+=l*t/o.pathLength,e.getPointOnEllipticalArc(r,i,a,c,d,u)}return null}static getPointOnLine(e,t,n,r,i,a,o){a??=t,o??=n;let s=this.getLineLength(t,n,r,i);if(s<1e-10)return{x:t,y:n};if(r===t)return{x:a,y:o+(i>n?e:-e)};let c=(i-n)/(r-t),l=Math.sqrt(e*e/(1+c*c))*(r=0&&(d+=2,d>=7&&(d-=7));continue}if(d>=0){if(d===3){if(/^[01]{2}\d+(?:\.\d+)?$/.test(t)){u.push(parseInt(t[0],10)),u.push(parseInt(t[1],10)),u.push(parseFloat(t.slice(2))),d+=3,d>=7&&(d-=7);continue}if(t===`11`||t===`10`||t===`01`){u.push(parseInt(t[0],10)),u.push(parseInt(t[1],10)),d+=2,d>=7&&(d-=7);continue}if(t===`0`||t===`1`){u.push(parseInt(t,10)),d+=1,d>=7&&(d-=7);continue}}else if(d===4){if(/^[01]\d+(?:\.\d+)?$/.test(t)){u.push(parseInt(t[0],10)),u.push(parseFloat(t.slice(1))),d+=2,d>=7&&(d-=7);continue}if(t===`0`||t===`1`){u.push(parseInt(t,10)),d+=1,d>=7&&(d-=7);continue}}let e=parseFloat(t);isNaN(e)?u.push(0):u.push(e),d+=1,d>=7&&(d-=7)}else{let e=parseFloat(t);isNaN(e)?u.push(0):u.push(e)}}for(;u.length>0&&!isNaN(u[0]);){let e=``,t=[],r=o,a=s,c,l,d,f,p,m,h,g,_,v;switch(n){case`l`:o+=u.shift(),s+=u.shift(),e=`L`,t.push(o,s);break;case`L`:o=u.shift(),s=u.shift(),t.push(o,s);break;case`m`:let r=u.shift(),a=u.shift();if(o+=r,s+=a,e=`M`,i.length>2&&i[i.length-1].command===`z`){for(let e=i.length-2;e>=0;e--)if(i[e].command===`M`){o=i[e].points[0]+r,s=i[e].points[1]+a;break}}t.push(o,s),n=`l`;break;case`M`:o=u.shift(),s=u.shift(),e=`M`,t.push(o,s),n=`L`;break;case`h`:o+=u.shift(),e=`L`,t.push(o,s);break;case`H`:o=u.shift(),e=`L`,t.push(o,s);break;case`v`:s+=u.shift(),e=`L`,t.push(o,s);break;case`V`:s=u.shift(),e=`L`,t.push(o,s);break;case`C`:t.push(u.shift(),u.shift(),u.shift(),u.shift()),o=u.shift(),s=u.shift(),t.push(o,s);break;case`c`:t.push(o+u.shift(),s+u.shift(),o+u.shift(),s+u.shift()),o+=u.shift(),s+=u.shift(),e=`C`,t.push(o,s);break;case`S`:l=o,d=s,c=i[i.length-1],c.command===`C`&&(l=o+(o-c.points[2]),d=s+(s-c.points[3])),t.push(l,d,u.shift(),u.shift()),o=u.shift(),s=u.shift(),e=`C`,t.push(o,s);break;case`s`:l=o,d=s,c=i[i.length-1],c.command===`C`&&(l=o+(o-c.points[2]),d=s+(s-c.points[3])),t.push(l,d,o+u.shift(),s+u.shift()),o+=u.shift(),s+=u.shift(),e=`C`,t.push(o,s);break;case`Q`:t.push(u.shift(),u.shift()),o=u.shift(),s=u.shift(),t.push(o,s);break;case`q`:t.push(o+u.shift(),s+u.shift()),o+=u.shift(),s+=u.shift(),e=`Q`,t.push(o,s);break;case`T`:l=o,d=s,c=i[i.length-1],c.command===`Q`&&(l=o+(o-c.points[0]),d=s+(s-c.points[1])),o=u.shift(),s=u.shift(),e=`Q`,t.push(l,d,o,s);break;case`t`:l=o,d=s,c=i[i.length-1],c.command===`Q`&&(l=o+(o-c.points[0]),d=s+(s-c.points[1])),o+=u.shift(),s+=u.shift(),e=`Q`,t.push(l,d,o,s);break;case`A`:f=u.shift(),p=u.shift(),m=u.shift(),h=u.shift(),g=u.shift(),_=o,v=s,o=u.shift(),s=u.shift(),e=`A`,t=this.convertEndpointToCenterParameterization(_,v,o,s,h,g,f,p,m);break;case`a`:f=u.shift(),p=u.shift(),m=u.shift(),h=u.shift(),g=u.shift(),_=o,v=s,o+=u.shift(),s+=u.shift(),e=`A`,t=this.convertEndpointToCenterParameterization(_,v,o,s,h,g,f,p,m);break}i.push({command:e||n,points:t,start:{x:r,y:a},pathLength:this.calcLength(r,a,e||n,t)})}(n===`z`||n===`Z`)&&i.push({command:`z`,points:[],start:void 0,pathLength:0})}return i}static calcLength(t,n,r,i){let a,o,s,c,l=e;switch(r){case`L`:return l.getLineLength(t,n,i[0],i[1]);case`C`:return sr([t,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case`Q`:return cr([t,i[0],i[2]],[n,i[1],i[3]],1);case`A`:a=0;let e=i[4],r=i[5],u=i[4]+r,d=Math.PI/180;if(Math.abs(e-u)u;c-=d)s=l.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],c,0),a+=l.getLineLength(o.x,o.y,s.x,s.y),o=s;else for(c=e+d;c1&&(o*=Math.sqrt(f),s*=Math.sqrt(f));let p=Math.sqrt((o*o*(s*s)-o*o*(d*d)-s*s*(u*u))/(o*o*(d*d)+s*s*(u*u)));i===a&&(p*=-1),isNaN(p)&&(p=0);let m=p*o*d/s,h=p*-s*u/o,g=(e+n)/2+Math.cos(l)*m-Math.sin(l)*h,_=(t+r)/2+Math.sin(l)*m+Math.cos(l)*h,v=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},y=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(v(e)*v(t))},b=function(e,t){return(e[0]*t[1]=1&&(w=0),a===0&&w>0&&(w-=2*Math.PI),a===1&&w<0&&(w+=2*Math.PI),[g,_,o,s,x,w,l,a]}};U.prototype.className=`Path`,U.prototype._attrsAffectingSize=[`data`],N(U),R.addGetterSetter(U,`data`);var fr=class extends rr{_sceneFunc(e){super._sceneFunc(e);let t=Math.PI*2,n=this.points(),r=n,i=this.tension()!==0&&n.length>4;i&&(r=this.getTensionPoints());let a=this.pointerLength(),o=n.length,s,c;if(i){let e=[r[r.length-4],r[r.length-3],r[r.length-2],r[r.length-1],n[o-2],n[o-1]],t=U.calcLength(r[r.length-4],r[r.length-3],`C`,e),i=U.getPointOnQuadraticBezier(Math.min(1,1-a/t),e[0],e[1],e[2],e[3],e[4],e[5]);s=n[o-2]-i.x,c=n[o-1]-i.y}else s=n[o-2]-n[o-4],c=n[o-1]-n[o-3];let l=(Math.atan2(c,s)+t)%t,u=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(n[o-2],n[o-1]),e.rotate(l),e.moveTo(0,0),e.lineTo(-a,u/2),e.lineTo(-a,-u/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(n[0],n[1]),i?(s=(r[0]+r[2])/2-n[0],c=(r[1]+r[3])/2-n[1]):(s=n[2]-n[0],c=n[3]-n[1]),e.rotate((Math.atan2(-c,-s)+t)%t),e.moveTo(0,0),e.lineTo(-a,u/2),e.lineTo(-a,-u/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){let t=this.dashEnabled();t&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),t&&(this.attrs.dashEnabled=!0)}getSelfRect(){let e=super.getSelfRect(),t=this.pointerWidth()/2;return{x:e.x,y:e.y-t,width:e.width,height:e.height+t*2}}};fr.prototype.className=`Arrow`,N(fr),R.addGetterSetter(fr,`pointerLength`,10,L()),R.addGetterSetter(fr,`pointerWidth`,10,L()),R.addGetterSetter(fr,`pointerAtBeginning`,!1),R.addGetterSetter(fr,`pointerAtEnding`,!0);var pr=class extends H{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}};pr.prototype._centroid=!0,pr.prototype.className=`Circle`,pr.prototype._attrsAffectingSize=[`radius`],N(pr),R.addGetterSetter(pr,`radius`,0,L());var mr=class extends H{_sceneFunc(e){let t=this.radiusX(),n=this.radiusY();e.beginPath(),e.save(),t!==n&&e.scale(1,n/t),e.arc(0,0,t,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}};mr.prototype.className=`Ellipse`,mr.prototype._centroid=!0,mr.prototype._attrsAffectingSize=[`radiusX`,`radiusY`],N(mr),R.addComponentsGetterSetter(mr,`radius`,[`x`,`y`]),R.addGetterSetter(mr,`radiusX`,0,L()),R.addGetterSetter(mr,`radiusY`,0,L());var W=class e extends H{constructor(e){super(e),this._loadListener=()=>{this._requestDraw()},this.on(`imageChange.konva`,e=>{this._removeImageLoad(e.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){let e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener(`load`,this._loadListener)}_removeImageLoad(e){e&&e.removeEventListener&&e.removeEventListener(`load`,this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){let e=!!this.cornerRadius(),t=this.hasShadow();return e&&t?!0:super._useBufferCanvas(!0)}_sceneFunc(e){let t=this.getWidth(),n=this.getHeight(),r=this.cornerRadius(),i=this.attrs.image,a;if(i){let e=this.attrs.cropWidth,r=this.attrs.cropHeight;a=e&&r?[i,this.cropX(),this.cropY(),e,r,0,0,t,n]:[i,0,0,t,n]}(this.hasFill()||this.hasStroke()||r)&&(e.beginPath(),r?F.drawRoundedRectPath(e,t,n,r):e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)),i&&(r&&e.clip(),e.drawImage.apply(e,a))}_hitFunc(e){let t=this.width(),n=this.height(),r=this.cornerRadius();e.beginPath(),r?F.drawRoundedRectPath(e,t,n,r):e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.attrs.width??this.image()?.width??0}getHeight(){return this.attrs.height??this.image()?.height??0}static fromURL(t,n,r=null){let i=F.createImageElement();i.onload=function(){n(new e({image:i}))},i.onerror=r,i.crossOrigin=`Anonymous`,i.src=t}};W.prototype.className=`Image`,W.prototype._attrsAffectingSize=[`image`],N(W),R.addGetterSetter(W,`cornerRadius`,0,Ye(4)),R.addGetterSetter(W,`image`),R.addComponentsGetterSetter(W,`crop`,[`x`,`y`,`width`,`height`]),R.addGetterSetter(W,`cropX`,0,L()),R.addGetterSetter(W,`cropY`,0,L()),R.addGetterSetter(W,`cropWidth`,0,L()),R.addGetterSetter(W,`cropHeight`,0,L());var hr=[`fontFamily`,`fontSize`,`fontStyle`,`padding`,`lineHeight`,`text`,`width`,`height`,`pointerDirection`,`pointerWidth`,`pointerHeight`],gr=`Change.konva`,_r=`none`,vr=`up`,yr=`right`,br=`down`,xr=`left`,Sr=hr.length,Cr=class extends Bn{constructor(e){super(e),this.on(`add.konva`,function(e){this._addListeners(e.child),this._sync()})}getText(){return this.find(`Text`)[0]}getTag(){return this.find(`Tag`)[0]}_addListeners(e){let t=this,n,r=function(){t._sync()};for(n=0;n{t=Math.min(t,e.x),n=Math.max(n,e.x),r=Math.min(r,e.y),i=Math.max(i,e.y)}),{x:t,y:r,width:n-t,height:i-r}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}};Er.prototype.className=`RegularPolygon`,Er.prototype._centroid=!0,Er.prototype._attrsAffectingSize=[`radius`],N(Er),R.addGetterSetter(Er,`radius`,0,L()),R.addGetterSetter(Er,`sides`,0,L()),R.addGetterSetter(Er,`cornerRadius`,0,Ye(4));var Dr=Math.PI*2,Or=class extends H{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,Dr,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),Dr,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}};Or.prototype.className=`Ring`,Or.prototype._centroid=!0,Or.prototype._attrsAffectingSize=[`innerRadius`,`outerRadius`],N(Or),R.addGetterSetter(Or,`innerRadius`,0,L()),R.addGetterSetter(Or,`outerRadius`,0,L());var kr=class extends H{constructor(e){super(e),this._updated=!0,this.anim=new Hn(()=>{let e=this._updated;return this._updated=!1,e}),this.on(`animationChange.konva`,function(){this.frameIndex(0)}),this.on(`frameIndexChange.konva`,function(){this._updated=!0}),this.on(`frameRateChange.konva`,function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(e){let t=this.animation(),n=this.frameIndex(),r=n*4,i=this.animations()[t],a=this.frameOffsets(),o=i[r+0],s=i[r+1],c=i[r+2],l=i[r+3],u=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,c,l),e.closePath(),e.fillStrokeShape(this)),u)if(a){let r=a[t],i=n*2;e.drawImage(u,o,s,c,l,r[i+0],r[i+1],c,l)}else e.drawImage(u,o,s,c,l,0,0,c,l)}_hitFunc(e){let t=this.animation(),n=this.frameIndex(),r=n*4,i=this.animations()[t],a=this.frameOffsets(),o=i[r+2],s=i[r+3];if(e.beginPath(),a){let r=a[t],i=n*2;e.rect(r[i+0],r[i+1],o,s)}else e.rect(0,0,o,s);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){let e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;let e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){let e=this.frameIndex(),t=this.animation();e{if(/\p{Emoji}/u.test(t)){let i=r[n+1];i&&/\p{Emoji_Modifier}|\u200D/u.test(i)?(e.push(t+i),r[n+1]=``):e.push(t)}else /\p{Regional_Indicator}{2}/u.test(t+(r[n+1]||``))?e.push(t+r[n+1]):n>0&&/\p{Mn}|\p{Me}|\p{Mc}/u.test(t)?e[e.length-1]+=t:t&&e.push(t);return e},[])}var Mr=`auto`,Nr=`center`,Pr=`inherit`,Fr=`justify`,Ir=`Change.konva`,Lr=`2d`,Rr=`-`,zr=`left`,Br=`text`,Vr=`Text`,Hr=`top`,Ur=`bottom`,Wr=`middle`,Gr=`normal`,Kr=`px `,qr=` `,Jr=`right`,Yr=`rtl`,Xr=`word`,Zr=`char`,Qr=`none`,$r=`…`,ei=[`direction`,`fontFamily`,`fontSize`,`fontStyle`,`fontVariant`,`padding`,`align`,`verticalAlign`,`lineHeight`,`text`,`width`,`height`,`wrap`,`ellipsis`,`letterSpacing`],ti=ei.length,ni=null;function ri(){if(ni!==null)return ni;ni=!1;try{let e=document.createElement(`canvas`);e.width=10,e.height=10;let t=e.getContext(Lr);if(t){t.globalAlpha=0,t.shadowColor=`black`,t.shadowBlur=5,t.shadowOffsetX=5,t.shadowOffsetY=5,t.fillStyle=`black`,t.font=`10px Arial`,t.fillText(`X`,0,10);let e=t.getImageData(0,0,10,10).data;for(let t=3;t0){ni=!0;break}}}catch{}return ni}function ii(e){return e.split(`,`).map(e=>{e=e.trim();let t=e.indexOf(` `)>=0,n=e.indexOf(`"`)>=0||e.indexOf(`'`)>=0;return t&&!n&&(e=`"${e}"`),e}).join(`, `)}var ai;function oi(){return ai||(ai=F.createCanvasElement().getContext(Lr),ai)}function si(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function ci(e){e.setAttr(`miterLimit`,2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function li(e){return e||={},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||`black`),e}var G=class extends H{constructor(e){super(li(e)),this._partialTextX=0,this._partialTextY=0;for(let e=0;ee+jr(t.text).length,0);f({char:s,index:a+n,x:o,y:y+0,lineIndex:v,column:a,isLastInLine:x,width:this.measureSize(s).width,context:e})}e.fillStrokeShape(this),f&&e.restore(),o+=this.measureSize(s).width+d}}else d!==0&&e.setAttr(`letterSpacing`,`${d}px`),this._partialTextX=o,this._partialTextY=y+0,this._partialText=m,e.fillStrokeShape(this);if(_){e.save(),e.beginPath();let t=M.legacyTextRendering?0:-Math.round(i/4),n=S;e.moveTo(n,y+0+t);let a=l===Fr&&!x?u-r*2:b;e.lineTo(n+Math.round(a),y+0+t),e.lineWidth=i/15,e.strokeStyle=this._getLinearGradient()||p,e.stroke(),e.restore()}e.restore(),n>1&&(y+=a)}}_hitFunc(e){let t=this.getWidth(),n=this.getHeight();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}setText(e){let t=F._isString(e)?e:e==null?``:e+``;return this._setAttr(Br,t),this}getWidth(){return this.attrs.width===Mr||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===Mr||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return F.warn(`text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height.`),this.textHeight}measureSize(e){let t=oi(),n=this.fontSize(),r;t.save(),t.font=this._getContextFont(),r=t.measureText(e),t.restore();let i=n/100;return{actualBoundingBoxAscent:r.actualBoundingBoxAscent??71.58203125*i,actualBoundingBoxDescent:r.actualBoundingBoxDescent??0,actualBoundingBoxLeft:r.actualBoundingBoxLeft??-7.421875*i,actualBoundingBoxRight:r.actualBoundingBoxRight??75.732421875*i,alphabeticBaseline:r.alphabeticBaseline??0,emHeightAscent:r.emHeightAscent??100*i,emHeightDescent:r.emHeightDescent??-20*i,fontBoundingBoxAscent:r.fontBoundingBoxAscent??91*i,fontBoundingBoxDescent:r.fontBoundingBoxDescent??21*i,hangingBaseline:r.hangingBaseline??72.80000305175781*i,ideographicBaseline:r.ideographicBaseline??-21*i,width:r.width,height:n}}_getContextFont(){return this.fontStyle()+qr+this.fontVariant()+qr+(this.fontSize()+Kr)+ii(this.fontFamily())}_addTextLine(e){this.align()===Fr&&(e=e.trim());let t=this._getTextWidth(e);return this.textArr.push({text:e,width:t,lastInParagraph:!1})}_getTextWidth(e){let t=this.letterSpacing(),n=e.length;return oi().measureText(e).width+t*n}_setTextData(){let e=this.text().split(` +`),t=+this.fontSize(),n=0,r=this.lineHeight()*t,i=this.attrs.width,a=this.attrs.height,o=i!==Mr&&i!==void 0,s=a!==Mr&&a!==void 0,c=this.padding(),l=i-c*2,u=a-c*2,d=0,f=this.wrap(),p=f!==Zr&&f!==Qr,m=this.ellipsis();this.textArr=[],oi().font=this._getContextFont();let h=m?this._getTextWidth($r):0;for(let t=0,i=e.length;tl)for(;a.length>0;){let e=0,t=jr(a).length,i=``,o=0;for(;e>>1,c=jr(a).slice(0,n+1).join(``),f=this._getTextWidth(c);(m&&s&&d+r>u?f+h:f)<=l?(e=n+1,i=c,o=f):t=n}if(i){if(p){let t=jr(a),n=jr(i),r=t[n.length],s=r===qr||r===Rr,c;if(s&&o<=l)c=n.length;else{let e=n.lastIndexOf(qr),t=n.lastIndexOf(Rr);c=Math.max(e,t)+1}c>0&&(e=c,i=t.slice(0,e).join(``),o=this._getTextWidth(i))}if(i=i.trimRight(),this._addTextLine(i),n=Math.max(n,o),d+=r,this._shouldHandleEllipsis(d)){this._tryToAddEllipsisToLastLine();break}if(a=jr(a).slice(e).join(``).trimLeft(),a.length>0&&(c=this._getTextWidth(a),c<=l)){this._addTextLine(a),d+=r,n=Math.max(n,c);break}}else break}else this._addTextLine(a),d+=r,n=Math.max(n,c),this._shouldHandleEllipsis(d)&&tu)break}this.textHeight=t,this.textWidth=n}_shouldHandleEllipsis(e){let t=+this.fontSize(),n=this.lineHeight()*t,r=this.attrs.height,i=r!==Mr&&r!==void 0,a=r-this.padding()*2;return this.wrap()===Qr||i&&e+n>a}_tryToAddEllipsisToLastLine(){let e=this.attrs.width,t=e!==Mr&&e!==void 0,n=e-this.padding()*2,r=this.ellipsis(),i=this.textArr[this.textArr.length-1];!i||!r||(t&&(this._getTextWidth(i.text+$r)this.pathLength?null:U.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=U.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr(`font`,this._getContextFont()),e.setAttr(`textBaseline`,this.textBaseline()),e.setAttr(`textAlign`,`left`),e.save();let t=this.textDecoration(),n=this.fill(),r=this.fontSize(),i=this.glyphInfo,a=t.indexOf(`underline`)!==-1,o=t.indexOf(`line-through`)!==-1;a&&e.beginPath();for(let t=0;t=1){let n=t[0].p0;e.moveTo(n.x,n.y)}for(let n=0;nthis.pathLength&&f-this.pathLength<=c?this.pathLength:f);if(!p)return;let m=U.getLineLength(r.x,r.y,p.x,p.y),h=0;if(s)try{h=s(t[n-1].char,i)*this.fontSize()}catch{h=0}r.x+=h,p.x+=h,this.textWidth+=h;let g=U.getPointOnLine(h+m/2,r.x,r.y,p.x,p.y),_=Math.atan2(p.y-r.y,p.x-r.x);this.glyphInfo.push({transposeX:g.x,transposeY:g.y,text:e[n],rotation:_,p0:r,p1:p,width:m}),d+=u}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};let e=[];this.glyphInfo.forEach(function(t){e.push(t.p0.x),e.push(t.p0.y),e.push(t.p1.x),e.push(t.p1.y)});let t=e[0]||0,n=e[0]||0,r=e[1]||0,i=e[1]||0,a,o;for(let s=0;se+`.${mi}`).join(` `),gi=`nodesRect`,_i=[`widthChange`,`heightChange`,`scaleXChange`,`scaleYChange`,`skewXChange`,`skewYChange`,`rotationChange`,`offsetXChange`,`offsetYChange`,`transformsEnabledChange`,`strokeWidthChange`,`draggableChange`],vi={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},yi=`ontouchstart`in M._global;function bi(e,t,n){if(e===`rotater`)return n;t+=F.degToRad(vi[e]||0);let r=(F.radToDeg(t)%360+360)%360;return F._inRange(r,337.5,360)||F._inRange(r,0,22.5)?`ns-resize`:F._inRange(r,22.5,67.5)?`nesw-resize`:F._inRange(r,67.5,112.5)?`ew-resize`:F._inRange(r,112.5,157.5)?`nwse-resize`:F._inRange(r,157.5,202.5)?`ns-resize`:F._inRange(r,202.5,247.5)?`nesw-resize`:F._inRange(r,247.5,292.5)?`ew-resize`:F._inRange(r,292.5,337.5)?`nwse-resize`:(F.error(`Transformer has unknown angle for cursor detection: `+r),`pointer`)}var xi=[`top-left`,`top-center`,`top-right`,`middle-right`,`middle-left`,`bottom-left`,`bottom-center`,`bottom-right`],Si=1e8;function Ci(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function wi(e,t,n){let r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return{...e,rotation:e.rotation+t,x:r,y:i}}function Ti(e,t){return wi(e,t,Ci(e))}function Ei(e,t,n){let r=t;for(let i=0;ie.isAncestorOf(this)?(F.error(`Konva.Transformer cannot be an a child of the node you are trying to attach`),!1):!0);return this._nodes=e=t,e.length===1&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(e=>{let t=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(e._attrsAffectingSize.length){let n=e._attrsAffectingSize.map(e=>e+`Change.`+this._getEventNamespace()).join(` `);e.on(n,t)}e.on(_i.map(e=>e+`.${this._getEventNamespace()}`).join(` `),t),e.on(`absoluteTransformChange.${this._getEventNamespace()}`,t),this._proxyDrag(e)}),this._resetTransformCache(),this.findOne(`.top-left`)&&this.update(),this}_proxyDrag(e){let t;e.on(`dragstart.${this._getEventNamespace()}`,n=>{t=e.getAbsolutePosition(),!this.isDragging()&&e!==this.findOne(`.back`)&&this.startDrag(n,!1)}),e.on(`dragmove.${this._getEventNamespace()}`,n=>{if(!t)return;let r=e.getAbsolutePosition(),i=r.x-t.x,a=r.y-t.y;this.nodes().forEach(t=>{if(t===e||t.isDragging())return;let r=t.getAbsolutePosition();t.setAbsolutePosition({x:r.x+i,y:r.y+a}),t.startDrag(n)}),t=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(e=>{e.off(`.`+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(gi),this._clearCache(`transform`),this._clearSelfAndDescendantCache(`absoluteTransform`)}_getNodeRect(){return this._getCache(gi,this.__getNodeRect)}__getNodeShape(e,t=this.rotation(),n){let r=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),i=e.getAbsoluteScale(n),a=e.getAbsolutePosition(n),o=r.x*i.x-e.offsetX()*i.x,s=r.y*i.y-e.offsetY()*i.y,c=(M.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2);return wi({x:a.x+o*Math.cos(c)+s*Math.sin(-c),y:a.y+s*Math.cos(c)+o*Math.sin(c),width:r.width*i.x,height:r.height*i.y,rotation:c},-M.getAngle(t),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-Si,y:-Si,width:0,height:0,rotation:0};let e=[];this.nodes().map(t=>{let n=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),r=[{x:n.x,y:n.y},{x:n.x+n.width,y:n.y},{x:n.x+n.width,y:n.y+n.height},{x:n.x,y:n.y+n.height}],i=t.getAbsoluteTransform();r.forEach(function(t){let n=i.point(t);e.push(n)})});let t=new P;t.rotate(-M.getAngle(this.rotation()));let n=1/0,r=1/0,i=-1/0,a=-1/0;e.forEach(function(e){let o=t.point(e);n===void 0&&(n=i=o.x,r=a=o.y),n=Math.min(n,o.x),r=Math.min(r,o.y),i=Math.max(i,o.x),a=Math.max(a,o.y)}),t.invert();let o=t.point({x:n,y:r});return{x:o.x,y:o.y,width:i-n,height:a-r,rotation:M.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),xi.forEach(e=>{this._createAnchor(e)}),this._createAnchor(`rotater`),this._elementsCreated=!0}_createAnchor(e){let t=new Tr({stroke:`rgb(0, 161, 255)`,fill:`white`,strokeWidth:1,name:e+` _anchor`,dragDistance:0,draggable:!0,hitStrokeWidth:yi?10:`auto`}),n=this;t.on(`mousedown touchstart`,function(e){n._handleMouseDown(e)}),t.on(`dragstart`,e=>{t.stopDrag(),e.cancelBubble=!0}),t.on(`dragend`,e=>{e.cancelBubble=!0}),t.on(`mouseenter`,()=>{let n=bi(e,M.getAngle(this.rotation()),this.rotateAnchorCursor());t.getStage().content&&(t.getStage().content.style.cursor=n),this._cursorChange=!0}),t.on(`mouseout`,()=>{t.getStage().content&&(t.getStage().content.style.cursor=``),this._cursorChange=!1}),this.add(t)}_createBack(){let e=new H({name:`back`,width:0,height:0,sceneFunc(e,t){let n=t.getParent(),r=n.padding(),i=t.width(),a=t.height();if(e.beginPath(),e.rect(-r,-r,i+r*2,a+r*2),n.rotateEnabled()&&n.rotateLineVisible()){let t=n.rotateAnchorAngle(),r=n.rotateAnchorOffset(),o=F.degToRad(t),s=Math.sin(o),c=-Math.cos(o),l=i/2,u=a/2,d=1/0;c<0?d=Math.min(d,-u/c):c>0&&(d=Math.min(d,(a-u)/c)),s<0?d=Math.min(d,-l/s):s>0&&(d=Math.min(d,(i-l)/s));let f=l+s*d,p=u+c*d,m=F._sign(a),h=f+s*r*m,g=p+c*r*m;e.moveTo(f,p),e.lineTo(h,g)}e.fillStrokeShape(t)},hitFunc:(e,t)=>{if(!this.shouldOverdrawWholeArea())return;let n=this.padding();e.beginPath(),e.rect(-n,-n,t.width()+n*2,t.height()+n*2),e.fillStrokeShape(t)}});this.add(e),this._proxyDrag(e),e.on(`dragstart`,e=>{e.cancelBubble=!0}),e.on(`dragmove`,e=>{e.cancelBubble=!0}),e.on(`dragend`,e=>{e.cancelBubble=!0}),this.on(`dragmove`,e=>{this.update()})}_handleMouseDown(e){if(this._transforming)return;this._movingAnchorName=e.target.name().split(` `)[0];let t=this._getNodeRect(),n=t.width,r=t.height,i=Math.sqrt(n**2+r**2);this.sin=Math.abs(r/i),this.cos=Math.abs(n/i),typeof window<`u`&&(window.addEventListener(`mousemove`,this._handleMouseMove),window.addEventListener(`touchmove`,this._handleMouseMove),window.addEventListener(`mouseup`,this._handleMouseUp,!0),window.addEventListener(`touchend`,this._handleMouseUp,!0)),this._transforming=!0;let a=e.target.getAbsolutePosition(),o=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:o.x-a.x,y:o.y-a.y},Di++,this._fire(`transformstart`,{evt:e.evt,target:this.getNode()}),this._nodes.forEach(t=>{t._fire(`transformstart`,{evt:e.evt,target:t})})}_handleMouseMove(e){let t,n,r,i=this.findOne(`.`+this._movingAnchorName),a=i.getStage();a.setPointersPositions(e);let o=a.getPointerPosition(),s={x:o.x-this._anchorDragOffset.x,y:o.y-this._anchorDragOffset.y},c=i.getAbsolutePosition();this.anchorDragBoundFunc()&&(s=this.anchorDragBoundFunc()(c,s,e)),i.setAbsolutePosition(s);let l=i.getAbsolutePosition();if(c.x===l.x&&c.y===l.y)return;if(this._movingAnchorName===`rotater`){let r=this._getNodeRect();t=i.x()-r.width/2,n=-i.y()+r.height/2;let a=M.getAngle(this.rotateAnchorAngle()),o=Math.atan2(-n,t)+Math.PI/2-a;r.height<0&&(o-=Math.PI);let s=M.getAngle(this.rotation())+o,c=M.getAngle(this.rotationSnapTolerance()),l=Ti(r,Ei(this.rotationSnaps(),s,c)-r.rotation);this._fitNodesInto(l,e);return}let u=this.shiftBehavior(),d;d=u===`inverted`?this.keepRatio()&&!e.shiftKey:u===`none`?this.keepRatio():this.keepRatio()||e.shiftKey;let f=this.centeredScaling()||e.altKey;if(this._movingAnchorName===`top-left`){if(d){let e=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(`.bottom-right`).x(),y:this.findOne(`.bottom-right`).y()};r=Math.sqrt((e.x-i.x())**2+(e.y-i.y())**2);let a=this.findOne(`.top-left`).x()>e.x?-1:1,o=this.findOne(`.top-left`).y()>e.y?-1:1;t=r*this.cos*a,n=r*this.sin*o,this.findOne(`.top-left`).x(e.x-t),this.findOne(`.top-left`).y(e.y-n)}}else if(this._movingAnchorName===`top-center`)this.findOne(`.top-left`).y(i.y());else if(this._movingAnchorName===`top-right`){if(d){let e=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(`.bottom-left`).x(),y:this.findOne(`.bottom-left`).y()};r=Math.sqrt((i.x()-e.x)**2+(e.y-i.y())**2);let a=this.findOne(`.top-right`).x()e.y?-1:1;t=r*this.cos*a,n=r*this.sin*o,this.findOne(`.top-right`).x(e.x+t),this.findOne(`.top-right`).y(e.y-n)}var p=i.position();this.findOne(`.top-left`).y(p.y),this.findOne(`.bottom-right`).x(p.x)}else if(this._movingAnchorName===`middle-left`)this.findOne(`.top-left`).x(i.x());else if(this._movingAnchorName===`middle-right`)this.findOne(`.bottom-right`).x(i.x());else if(this._movingAnchorName===`bottom-left`){if(d){let e=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(`.top-right`).x(),y:this.findOne(`.top-right`).y()};r=Math.sqrt((e.x-i.x())**2+(i.y()-e.y)**2);let a=e.x{var n;t._fire(`transformend`,{evt:e,target:t}),(n=t.getLayer())==null||n.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(e,t){let n=this._getNodeRect();if(F._inRange(e.width,-this.padding()*2-1,1)){this.update();return}if(F._inRange(e.height,-this.padding()*2-1,1)){this.update();return}let r=new P;if(r.rotate(M.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf(`left`)>=0){let t=r.point({x:-this.padding()*2,y:0});e.x+=t.x,e.y+=t.y,e.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace(`left`,`right`),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf(`right`)>=0){let t=r.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace(`right`,`left`),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.width+=this.padding()*2}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf(`top`)>=0){let t=r.point({x:0,y:-this.padding()*2});e.x+=t.x,e.y+=t.y,this._movingAnchorName=this._movingAnchorName.replace(`top`,`bottom`),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.height+=this.padding()*2}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf(`bottom`)>=0){let t=r.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace(`bottom`,`top`),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.height+=this.padding()*2}if(this.boundBoxFunc()){let t=this.boundBoxFunc()(n,e);t?e=t:F.warn(`boundBoxFunc returned falsy. You should return new bound rect from it!`)}let i=1e7,a=new P;a.translate(n.x,n.y),a.rotate(n.rotation),a.scale(n.width/i,n.height/i);let o=new P,s=e.width/i,c=e.height/i;this.flipEnabled()===!1?(o.translate(e.x,e.y),o.rotate(e.rotation),o.translate(e.width<0?e.width:0,e.height<0?e.height:0),o.scale(Math.abs(s),Math.abs(c))):(o.translate(e.x,e.y),o.rotate(e.rotation),o.scale(s,c));let l=o.multiply(a.invert());this._nodes.forEach(e=>{var t;if(!e.getStage())return;let n=e.getParent().getAbsoluteTransform(),r=e.getTransform().copy();r.translate(e.offsetX(),e.offsetY());let i=new P;i.multiply(n.copy().invert()).multiply(l).multiply(n).multiply(r);let a=i.decompose();e.setAttrs(a),(t=e.getLayer())==null||t.batchDraw()}),this.rotation(F._getRotation(e.rotation)),this._nodes.forEach(e=>{this._fire(`transform`,{evt:t,target:e}),e._fire(`transform`,{evt:t,target:e})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,t){this.findOne(e).setAttrs(t)}update(){var e;let t=this._getNodeRect();this.rotation(F._getRotation(t.rotation));let n=t.width,r=t.height,i=this.enabledAnchors(),a=this.resizeEnabled(),o=this.padding(),s=this.anchorSize(),c=this.find(`._anchor`);c.forEach(e=>{e.setAttrs({width:s,height:s,offsetX:s/2,offsetY:s/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(`.top-left`,{x:0,y:0,offsetX:s/2+o,offsetY:s/2+o,visible:a&&i.indexOf(`top-left`)>=0}),this._batchChangeChild(`.top-center`,{x:n/2,y:0,offsetY:s/2+o,visible:a&&i.indexOf(`top-center`)>=0}),this._batchChangeChild(`.top-right`,{x:n,y:0,offsetX:s/2-o,offsetY:s/2+o,visible:a&&i.indexOf(`top-right`)>=0}),this._batchChangeChild(`.middle-left`,{x:0,y:r/2,offsetX:s/2+o,visible:a&&i.indexOf(`middle-left`)>=0}),this._batchChangeChild(`.middle-right`,{x:n,y:r/2,offsetX:s/2-o,visible:a&&i.indexOf(`middle-right`)>=0}),this._batchChangeChild(`.bottom-left`,{x:0,y:r,offsetX:s/2+o,offsetY:s/2-o,visible:a&&i.indexOf(`bottom-left`)>=0}),this._batchChangeChild(`.bottom-center`,{x:n/2,y:r,offsetY:s/2-o,visible:a&&i.indexOf(`bottom-center`)>=0}),this._batchChangeChild(`.bottom-right`,{x:n,y:r,offsetX:s/2-o,offsetY:s/2-o,visible:a&&i.indexOf(`bottom-right`)>=0});let l=this.rotateAnchorAngle(),u=this.rotateAnchorOffset(),d=F.degToRad(l),f=Math.sin(d),p=-Math.cos(d),m=n/2,h=r/2,g=1/0;p<0?g=Math.min(g,-h/p):p>0&&(g=Math.min(g,(r-h)/p)),f<0?g=Math.min(g,-m/f):f>0&&(g=Math.min(g,(n-m)/f));let _=m+f*g,v=h+p*g,y=F._sign(r);this._batchChangeChild(`.rotater`,{x:_+f*u*y,y:v+p*u*y-o*p,visible:this.rotateEnabled()}),this._batchChangeChild(`.back`,{width:n,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),draggable:this.nodes().some(e=>e.draggable()),x:0,y:0});let b=this.anchorStyleFunc();b&&c.forEach(e=>{b(e)}),(e=this.getLayer())==null||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();let e=this.findOne(`.`+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=``),Bn.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}add(...e){return this._elementsCreated?(F.error(`You cannot add external nodes to the Transformer. Use tr.nodes([node]) instead.`),this):super.add(...e)}toObject(){return z.prototype.toObject.call(this)}clone(e){return z.prototype.clone.call(this,e)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};q.isTransforming=()=>Di>0;function Oi(e){return e instanceof Array||F.warn(`enabledAnchors value should be an array`),e instanceof Array&&e.forEach(function(e){xi.indexOf(e)===-1&&F.warn(`Unknown anchor name: `+e+`. Available names are: `+xi.join(`, `))}),e||[]}q.prototype.className=`Transformer`,N(q),R.addGetterSetter(q,`enabledAnchors`,xi,Oi),R.addGetterSetter(q,`flipEnabled`,!0,et()),R.addGetterSetter(q,`resizeEnabled`,!0),R.addGetterSetter(q,`anchorSize`,10,L()),R.addGetterSetter(q,`rotateEnabled`,!0),R.addGetterSetter(q,`rotateLineVisible`,!0),R.addGetterSetter(q,`rotationSnaps`,[]),R.addGetterSetter(q,`rotateAnchorOffset`,50,L()),R.addGetterSetter(q,`rotateAnchorAngle`,0,L()),R.addGetterSetter(q,`rotateAnchorCursor`,`crosshair`),R.addGetterSetter(q,`rotationSnapTolerance`,5,L()),R.addGetterSetter(q,`borderEnabled`,!0),R.addGetterSetter(q,`anchorStroke`,`rgb(0, 161, 255)`),R.addGetterSetter(q,`anchorStrokeWidth`,1,L()),R.addGetterSetter(q,`anchorFill`,`white`),R.addGetterSetter(q,`anchorCornerRadius`,0,L()),R.addGetterSetter(q,`borderStroke`,`rgb(0, 161, 255)`),R.addGetterSetter(q,`borderStrokeWidth`,1,L()),R.addGetterSetter(q,`borderDash`),R.addGetterSetter(q,`keepRatio`,!0),R.addGetterSetter(q,`shiftBehavior`,`default`),R.addGetterSetter(q,`centeredScaling`,!1),R.addGetterSetter(q,`ignoreStroke`,!1),R.addGetterSetter(q,`padding`,0,L()),R.addGetterSetter(q,`nodes`),R.addGetterSetter(q,`node`),R.addGetterSetter(q,`boundBoxFunc`),R.addGetterSetter(q,`anchorDragBoundFunc`),R.addGetterSetter(q,`anchorStyleFunc`),R.addGetterSetter(q,`shouldOverdrawWholeArea`,!1),R.addGetterSetter(q,`useSingleNodeRotation`,!0),R.backCompat(q,{lineEnabled:`borderEnabled`,rotateHandlerOffset:`rotateAnchorOffset`,enabledHandlers:`enabledAnchors`});var ki=class extends H{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,M.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}};ki.prototype.className=`Wedge`,ki.prototype._centroid=!0,ki.prototype._attrsAffectingSize=[`radius`],N(ki),R.addGetterSetter(ki,`radius`,0,L()),R.addGetterSetter(ki,`angle`,0,L()),R.addGetterSetter(ki,`clockwise`,!1),R.backCompat(ki,{angleDeg:`angle`,getAngleDeg:`getAngle`,setAngleDeg:`setAngle`});function Ai(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var ji=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],Mi=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function Ni(e,t){let n=e.data,r=e.width,i=e.height,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,ee=t+t+1,te=r-1,ne=i-1,T=t+1,E=T*(T+1)/2,re=new Ai,D=ji[t],ie=Mi[t],O=null,k=re,A=null,j=null;for(let e=1;e>ie,C===0?n[o]=n[o+1]=n[o+2]=0:(C=255/C,n[o]=(c*D>>ie)*C,n[o+1]=(l*D>>ie)*C,n[o+2]=(u*D>>ie)*C),c-=f,l-=p,u-=m,d-=h,f-=A.r,p-=A.g,m-=A.b,h-=A.a,a=s+((a=e+t+1)>ie,C>0?(C=255/C,n[a]=(c*D>>ie)*C,n[a+1]=(l*D>>ie)*C,n[a+2]=(u*D>>ie)*C):n[a]=n[a+1]=n[a+2]=0,c-=f,l-=p,u-=m,d-=h,f-=A.r,p-=A.g,m-=A.b,h-=A.a,a=e+((a=t+T)0&&Ni(e,t)};R.addGetterSetter(z,`blurRadius`,0,L(),R.afterSetFilter);var Fi=function(e){let t=this.brightness()*255,n=e.data,r=n.length;for(let e=0;e255?255:i,a=a<0?0:a>255?255:a,o=o<0?0:o>255?255:o,n[e]=i,n[e+1]=a,n[e+2]=o};R.addGetterSetter(z,`contrast`,0,L(),R.afterSetFilter);var Ri=function(e){let t=e.data,n=e.width,r=e.height,i=Math.min(1,Math.max(0,this.embossStrength?.call(this)??.5)),a=Math.min(1,Math.max(0,this.embossWhiteLevel?.call(this)??.5)),o={"top-left":315,top:270,"top-right":225,right:180,"bottom-right":135,bottom:90,"bottom-left":45,left:0}[this.embossDirection?.call(this)??`top-left`]??315,s=!!(this.embossBlend?.call(this)??!1),c=i*10,l=a*255,u=o*Math.PI/180,d=Math.cos(u),f=Math.sin(u),p=128/1020*c,m=new Uint8ClampedArray(t),h=new Float32Array(n*r);for(let e=0,n=0;ne<0?0:e>255?255:e;for(let e=1;ei&&(i=a),c=t[e+1],cs&&(s=c),d=t[e+2],du&&(u=d);i===r&&(i=255,r=0),s===o&&(s=255,o=0),u===l&&(u=255,l=0);let p,m,h,g,_,v;if(f>0)p=i+f*(255-i),m=r-f*(r-0),h=s+f*(255-s),g=o-f*(o-0),_=u+f*(255-u),v=l-f*(l-0);else{let e=(i+r)*.5;p=i+f*(i-e),m=r+f*(r-e);let t=(s+o)*.5;h=s+f*(s-t),g=o+f*(o-t);let n=(u+l)*.5;_=u+f*(u-n),v=l+f*(l-n)}for(let e=0;el?f:l;let p=o,m=a,h=360/m*Math.PI/180;for(let e=0;el?f:l;let p=o,m=a,h=n.polarRotation||0,g,_;for(u=0;ut&&(b=y,x=0,S=-1),i=0;i=0&&d=0&&f=0&&d=0&&f=1020?255:0}return o}function ta(e,t,n){let r=[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),o=[];for(let s=0;s=0&&d=0&&f=n))for(let t=f;t=r)continue;let i=(n*t+e)*4;a+=o[i+0],s+=o[i+1],c+=o[i+2],l+=o[i+3],m+=1}a/=m,s/=m,c/=m,l/=m;for(let e=u;e=n))for(let t=f;t=r)continue;let i=(n*t+e)*4;o[i+0]=a,o[i+1]=s,o[i+2]=c,o[i+3]=l}}};R.addGetterSetter(z,`pixelSize`,8,L(),R.afterSetFilter);var aa=function(e){let t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,i=255/t;for(let e=0;e255?255:e<0?0:Math.round(e)}),R.addGetterSetter(z,`green`,0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)}),R.addGetterSetter(z,`blue`,0,Je,R.afterSetFilter);var sa=function(e){let t=e.data,n=t.length,r=this.red(),i=this.green(),a=this.blue(),o=this.alpha();for(let e=0;e255?255:e<0?0:Math.round(e)}),R.addGetterSetter(z,`green`,0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)}),R.addGetterSetter(z,`blue`,0,Je,R.afterSetFilter),R.addGetterSetter(z,`alpha`,1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});var ca=function(e){let t=e.data,n=t.length;for(let e=0;e=128&&(t[e]=255-n,t[e+1]=255-r,t[e+2]=255-i)}return e},ua=function(e){let t=this.threshold()*255,n=e.data,r=n.length;for(let e=0;e{i(e.getAttr(r))})}}var ya=`V`;function ba(e){function t(e){return e?.__konvaNode?e:e?.parent?t(e.parent):(console.error(`vue-konva error: Can not find parent node`),null)}return t(e.parent)}function xa(e){return e.component?e.component.__konvaNode||xa(e.component.subTree):null}function Sa(e){let{el:t,component:n}=e,r=xa(e);if(t?.tagName&&n&&!r){let e=t.tagName.toLowerCase();return console.error(`vue-konva error: You are trying to render "${e}" inside your component tree. Looks like it is not a Konva node. You can render only Konva components inside the Stage.`),null}return r}function Ca(e){let t=e=>!!e&&typeof e==`object`&&`component`in e,n=e=>Array.isArray(e),r=e=>t(e)?[e,...r(e.children)]:n(e)?e.flatMap(r):[];return r(e.children)}function wa(e,t){let n=Ca(e),r=[];n.forEach(e=>{let t=Sa(e);t&&r.push(t)});let i=!1;r.forEach((e,t)=>{e.getZIndex()!==t&&(e.setZIndex(t),i=!0)}),i&&fa(t)}var Ta=da.default?.Stage||da.Stage,Ea=n({name:`Stage`,props:{config:{type:Object,default:function(){return{}}},__useStrictMode:{type:Boolean}},inheritAttrs:!1,setup(t,{attrs:n,slots:r,expose:i}){let a=D();if(!a)return;let s=o({}),c=h(null),u=new Ta({width:t.config.width,height:t.config.height,container:document.createElement(`div`)});a.__konvaNode=u,p();function d(){return a?.__konvaNode}function f(){return a?.__konvaNode}function p(){if(!a)return;let e=s||{},r={...n,...t.config};ha(a,r,e,t.__useStrictMode),Object.assign(s,r)}return e(()=>{c.value&&u.container(c.value),p(),va(u,a)}),l(()=>{p(),wa(a.subTree,u),va(u,a)}),S(()=>{u.destroy()}),k(()=>t.config,p,{deep:!0}),i({getStage:f,getNode:d}),()=>m(`div`,{ref:c,id:n?.id,accesskey:n?.accesskey,class:n?.class,role:n?.role,style:n?.style,tabindex:n?.tabindex,title:n?.title},r.default?.())}}),Da=`.vue-konva-event`,Oa={Group:!0,Layer:!0,FastLayer:!0,Label:!0};function J(t,r){return n({name:t,props:{config:{type:Object,default:function(){return{}}},__useStrictMode:{type:Boolean}},setup(n,{attrs:i,slots:a,expose:s}){let c=D();if(!c)return;let u=o({}),d=new r;c.__konvaNode=d,c.vnode.__konvaNode=d,m();function f(){return c?.__konvaNode}function p(){return c?.__konvaNode}function m(){if(!c)return;let e={};for(let t in c?.vnode.props)t.slice(0,2)===`on`&&(e[t]=c.vnode.props[t]);let t=u||{},r={...i,...n.config,...e};ha(c,r,t,n.__useStrictMode),Object.assign(u,r)}e(()=>{let e=ba(c)?.__konvaNode;e&&`add`in e&&e.add(d),fa(d),va(d,c)}),x(()=>{fa(d),d.destroy(),d.off(Da),d.off(ga)}),l(()=>{m(),wa(c.subTree,d),va(d,c)}),k(()=>n.config,m,{deep:!0}),s({getStage:p,getNode:f});let h=Oa.hasOwnProperty(t);return()=>h?a.default?.():null}})}var Y=da.default||da,ka=J(`Arc`,Y.Arc),Aa=J(`Arrow`,Y.Arrow),ja=J(`Circle`,Y.Circle),Ma=J(`Ellipse`,Y.Ellipse),Na=J(`FastLayer`,Y.FastLayer),Pa=J(`Group`,Y.Group),Fa=J(`Image`,Y.Image),Ia=J(`Label`,Y.Label),La=J(`Layer`,Y.Layer),Ra=J(`Line`,Y.Line),za=J(`Path`,Y.Path),Ba=J(`Rect`,Y.Rect),Va=J(`RegularPolygon`,Y.RegularPolygon),Ha=J(`Ring`,Y.Ring),Ua=J(`Shape`,Y.Shape),Wa=J(`Sprite`,Y.Sprite),Ga=J(`Star`,Y.Star),Ka=J(`Tag`,Y.Tag),qa=J(`Text`,Y.Text),Ja=J(`TextPath`,Y.TextPath),Ya=J(`Transformer`,Y.Transformer),Xa=J(`Wedge`,Y.Wedge),Za=Object.freeze(Object.defineProperty({__proto__:null,Arc:ka,Arrow:Aa,Circle:ja,Ellipse:Ma,FastLayer:Na,Group:Pa,Image:Fa,Label:Ia,Layer:La,Line:Ra,Path:za,Rect:Ba,RegularPolygon:Va,Ring:Ha,Shape:Ua,Sprite:Wa,Star:Ga,Tag:Ka,Text:qa,TextPath:Ja,Transformer:Ya,Wedge:Xa},Symbol.toStringTag,{value:`Module`})),Qa={install:(e,t)=>{let n=t?.prefix||ya,r=t?.customNodes?Object.entries(t.customNodes).map(([e,t])=>J(e,t)):[];[Ea,...Object.values(Za),...r].forEach(t=>{e.component(`${n}${t.name}`,t)})}},$a=typeof document<`u`;function eo(e){return typeof e==`object`||`displayName`in e||`props`in e||`__vccOpts`in e}function to(e){return e.__esModule||e[Symbol.toStringTag]===`Module`||e.default&&eo(e.default)}var X=Object.assign;function no(e,t){let n={};for(let r in t){let i=t[r];n[r]=io(i)?i.map(e):e(i)}return n}var ro=()=>{},io=Array.isArray;function ao(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}var oo=/#/g,so=/&/g,co=/\//g,lo=/=/g,uo=/\?/g,fo=/\+/g,po=/%5B/g,mo=/%5D/g,ho=/%5E/g,go=/%60/g,_o=/%7B/g,vo=/%7C/g,yo=/%7D/g,bo=/%20/g;function xo(e){return e==null?``:encodeURI(``+e).replace(vo,`|`).replace(po,`[`).replace(mo,`]`)}function So(e){return xo(e).replace(_o,`{`).replace(yo,`}`).replace(ho,`^`)}function Co(e){return xo(e).replace(fo,`%2B`).replace(bo,`+`).replace(oo,`%23`).replace(so,`%26`).replace(go,"`").replace(_o,`{`).replace(yo,`}`).replace(ho,`^`)}function wo(e){return Co(e).replace(lo,`%3D`)}function To(e){return xo(e).replace(oo,`%23`).replace(uo,`%3F`)}function Eo(e){return To(e).replace(co,`%2F`)}function Do(e){if(e==null)return null;try{return decodeURIComponent(``+e)}catch{}return``+e}var Oo=/\/$/,ko=e=>e.replace(Oo,``);function Ao(e,t,n=`/`){let r,i={},a=``,o=``,s=t.indexOf(`#`),c=t.indexOf(`?`);return c=s>=0&&c>s?-1:c,c>=0&&(r=t.slice(0,c),a=t.slice(c,s>0?s:t.length),i=e(a.slice(1))),s>=0&&(r||=t.slice(0,s),o=t.slice(s,t.length)),r=Ro(r??t,n),{fullPath:r+a+o,path:r,query:i,hash:Do(o)}}function jo(e,t){let n=t.query?e(t.query):``;return t.path+(n&&`?`)+n+(t.hash||``)}function Mo(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||`/`}function No(e,t,n){let r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&Po(t.matched[r],n.matched[i])&&Fo(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Po(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Fo(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Io(e[n],t[n]))return!1;return!0}function Io(e,t){return io(e)?Lo(e,t):io(t)?Lo(t,e):e?.valueOf()===t?.valueOf()}function Lo(e,t){return io(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e.length===1&&e[0]===t}function Ro(e,t){if(e.startsWith(`/`))return e;if(!e)return t;let n=t.split(`/`),r=e.split(`/`),i=r[r.length-1];(i===`..`||i===`.`)&&r.push(``);let a=n.length-1,o,s;for(o=0;o1&&a--;else break;return n.slice(0,a).join(`/`)+`/`+r.slice(o).join(`/`)}var zo={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0},Bo=function(e){return e.pop=`pop`,e.push=`push`,e}({}),Vo=function(e){return e.back=`back`,e.forward=`forward`,e.unknown=``,e}({});function Ho(e){if(!e)if($a){let t=document.querySelector(`base`);e=t&&t.getAttribute(`href`)||`/`,e=e.replace(/^\w+:\/\/[^\/]+/,``)}else e=`/`;return e[0]!==`/`&&e[0]!==`#`&&(e=`/`+e),ko(e)}var Uo=/^[^#]+#/;function Wo(e,t){return e.replace(Uo,`#`)+t}function Go(e,t){let n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}var Ko=()=>({left:window.scrollX,top:window.scrollY});function qo(e){let t;if(`el`in e){let n=e.el,r=typeof n==`string`&&n.startsWith(`#`),i=typeof n==`string`?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=Go(i,e)}else t=e;`scrollBehavior`in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left==null?window.scrollX:t.left,t.top==null?window.scrollY:t.top)}function Jo(e,t){return(history.state?history.state.position-t:-1)+e}var Yo=new Map;function Xo(e,t){Yo.set(e,t)}function Zo(e){let t=Yo.get(e);return Yo.delete(e),t}function Qo(e){return typeof e==`string`||e&&typeof e==`object`}function $o(e){return typeof e==`string`||typeof e==`symbol`}var Z=function(e){return e[e.MATCHER_NOT_FOUND=1]=`MATCHER_NOT_FOUND`,e[e.NAVIGATION_GUARD_REDIRECT=2]=`NAVIGATION_GUARD_REDIRECT`,e[e.NAVIGATION_ABORTED=4]=`NAVIGATION_ABORTED`,e[e.NAVIGATION_CANCELLED=8]=`NAVIGATION_CANCELLED`,e[e.NAVIGATION_DUPLICATED=16]=`NAVIGATION_DUPLICATED`,e}({}),es=Symbol(``);Z.MATCHER_NOT_FOUND,Z.NAVIGATION_GUARD_REDIRECT,Z.NAVIGATION_ABORTED,Z.NAVIGATION_CANCELLED,Z.NAVIGATION_DUPLICATED;function ts(e,t){return X(Error(),{type:e,[es]:!0},t)}function ns(e,t){return e instanceof Error&&es in e&&(t==null||!!(e.type&t))}function rs(e){let t={};if(e===``||e===`?`)return t;let n=(e[0]===`?`?e.slice(1):e).split(`&`);for(let e=0;ee&&Co(e)):[r&&Co(r)]).forEach(e=>{e!==void 0&&(t+=(t.length?`&`:``)+n,e!=null&&(t+=`=`+e))})}return t}function as(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=io(r)?r.map(e=>e==null?null:``+e):r==null?r:``+r)}return t}var os=Symbol(``),ss=Symbol(``),cs=Symbol(``),ls=Symbol(``),us=Symbol(``);function ds(){let e=[];function t(t){return e.push(t),()=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function fs(e,t,n,r,i,a=e=>e()){let o=r&&(r.enterCallbacks[i]=r.enterCallbacks[i]||[]);return()=>new Promise((s,c)=>{let l=e=>{e===!1?c(ts(Z.NAVIGATION_ABORTED,{from:n,to:t})):e instanceof Error?c(e):Qo(e)?c(ts(Z.NAVIGATION_GUARD_REDIRECT,{from:t,to:e})):(o&&r.enterCallbacks[i]===o&&typeof e==`function`&&o.push(e),s())},u=a(()=>e.call(r&&r.instances[i],t,n,l)),d=Promise.resolve(u);e.length<3&&(d=d.then(l)),d.catch(e=>c(e))})}function ps(e,t,n,r,i=e=>e()){let a=[];for(let o of e)for(let e in o.components){let s=o.components[e];if(!(t!==`beforeRouteEnter`&&!o.instances[e]))if(eo(s)){let c=(s.__vccOpts||s)[t];c&&a.push(fs(c,n,r,o,e,i))}else{let c=s();a.push(()=>c.then(a=>{if(!a)throw Error(`Couldn't resolve component "${e}" at "${o.path}"`);let s=to(a)?a.default:a;o.mods[e]=a,o.components[e]=s;let c=(s.__vccOpts||s)[t];return c&&fs(c,n,r,o,e,i)()}))}}return a}function ms(e,t){let n=[],r=[],i=[],a=Math.max(t.matched.length,e.matched.length);for(let o=0;oPo(e,a))?r.push(a):n.push(a));let s=e.matched[o];s&&(t.matched.find(e=>Po(e,s))||i.push(s))}return[n,r,i]}var hs=()=>location.protocol+`//`+location.host;function gs(e,t){let{pathname:n,search:r,hash:i}=t,a=e.indexOf(`#`);if(a>-1){let t=i.includes(e.slice(a))?e.slice(a).length:1,n=i.slice(t);return n[0]!==`/`&&(n=`/`+n),Mo(n,``)}return Mo(n,e)+r+i}function _s(e,t,n,r){let i=[],a=[],o=null,s=({state:a})=>{let s=gs(e,location),c=n.value,l=t.value,u=0;if(a){if(n.value=s,t.value=a,o&&o===c){o=null;return}u=l?a.position-l.position:0}else r(s);i.forEach(e=>{e(n.value,c,{delta:u,type:Bo.pop,direction:u?u>0?Vo.forward:Vo.back:Vo.unknown})})};function c(){o=n.value}function l(e){i.push(e);let t=()=>{let t=i.indexOf(e);t>-1&&i.splice(t,1)};return a.push(t),t}function u(){if(document.visibilityState===`hidden`){let{history:e}=window;if(!e.state)return;e.replaceState(X({},e.state,{scroll:Ko()}),``)}}function d(){for(let e of a)e();a=[],window.removeEventListener(`popstate`,s),window.removeEventListener(`pagehide`,u),document.removeEventListener(`visibilitychange`,u)}return window.addEventListener(`popstate`,s),window.addEventListener(`pagehide`,u),document.addEventListener(`visibilitychange`,u),{pauseListeners:c,listen:l,destroy:d}}function vs(e,t,n,r=!1,i=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:i?Ko():null}}function ys(e){let{history:t,location:n}=window,r={value:gs(e,n)},i={value:t.state};i.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(r,a,o){let s=e.indexOf(`#`),c=s>-1?(n.host&&document.querySelector(`base`)?e:e.slice(s))+r:hs()+e+r;try{t[o?`replaceState`:`pushState`](a,``,c),i.value=a}catch(e){console.error(e),n[o?`replace`:`assign`](c)}}function o(e,n){a(e,X({},t.state,vs(i.value.back,e,i.value.forward,!0),n,{position:i.value.position}),!0),r.value=e}function s(e,n){let o=X({},i.value,t.state,{forward:e,scroll:Ko()});a(o.current,o,!0),a(e,X({},vs(r.value,e,null),{position:o.position+1},n),!1),r.value=e}return{location:r,state:i,push:s,replace:o}}function bs(e){e=Ho(e);let t=ys(e),n=_s(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=X({location:``,base:e,go:r,createHref:Wo.bind(null,e)},t,n);return Object.defineProperty(i,`location`,{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,`state`,{enumerable:!0,get:()=>t.state.value}),i}var xs=function(e){return e[e.Static=0]=`Static`,e[e.Param=1]=`Param`,e[e.Group=2]=`Group`,e}({}),Q=function(e){return e[e.Static=0]=`Static`,e[e.Param=1]=`Param`,e[e.ParamRegExp=2]=`ParamRegExp`,e[e.ParamRegExpEnd=3]=`ParamRegExpEnd`,e[e.EscapeNext=4]=`EscapeNext`,e}(Q||{}),Ss={type:xs.Static,value:``},Cs=/[a-zA-Z0-9_]/;function ws(e){if(!e)return[[]];if(e===`/`)return[[Ss]];if(!e.startsWith(`/`))throw Error(`Invalid path "${e}"`);function t(e){throw Error(`ERR (${n})/"${l}": ${e}`)}let n=Q.Static,r=n,i=[],a;function o(){a&&i.push(a),a=[]}let s=0,c,l=``,u=``;function d(){l&&=(n===Q.Static?a.push({type:xs.Static,value:l}):n===Q.Param||n===Q.ParamRegExp||n===Q.ParamRegExpEnd?(a.length>1&&(c===`*`||c===`+`)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:xs.Param,value:l,regexp:u,repeatable:c===`*`||c===`+`,optional:c===`*`||c===`?`})):t(`Invalid state to consume buffer`),``)}function f(){l+=c}for(;st.length?t.length===1&&t[0]===$.Static+$.Segment?1:-1:0}function As(e,t){let n=0,r=e.score,i=t.score;for(;n0&&t[t.length-1]<0}var Ms={strict:!1,end:!0,sensitive:!1};function Ns(e,t,n){let r=X(Os(ws(e.path),n),{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function Ps(e,t){let n=[],r=new Map;t=ao(Ms,t);function i(e){return r.get(e)}function a(e,n,r){let i=!r,s=Is(e);s.aliasOf=r&&r.record;let l=ao(t,e),u=[s];if(`alias`in e){let t=typeof e.alias==`string`?[e.alias]:e.alias;for(let e of t)u.push(Is(X({},s,{components:r?r.record.components:s.components,path:e,aliasOf:r?r.record:s})))}let d,f;for(let t of u){let{path:u}=t;if(n&&u[0]!==`/`){let e=n.record.path,r=e[e.length-1]===`/`?``:`/`;t.path=n.record.path+(u&&r+u)}if(d=Ns(t,n,l),r?r.alias.push(d):(f||=d,f!==d&&f.alias.push(d),i&&e.name&&!Rs(d)&&o(e.name)),Hs(d)&&c(d),s.children){let e=s.children;for(let t=0;t{o(f)}:ro}function o(e){if($o(e)){let t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(o),t.alias.forEach(o))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(o),e.alias.forEach(o))}}function s(){return n}function c(e){let t=Bs(e,n);n.splice(t,0,e),e.record.name&&!Rs(e)&&r.set(e.record.name,e)}function l(e,t){let i,a={},o,s;if(`name`in e&&e.name){if(i=r.get(e.name),!i)throw ts(Z.MATCHER_NOT_FOUND,{location:e});s=i.record.name,a=X(Fs(t.params,i.keys.filter(e=>!e.optional).concat(i.parent?i.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&Fs(e.params,i.keys.map(e=>e.name))),o=i.stringify(a)}else if(e.path!=null)o=e.path,i=n.find(e=>e.re.test(o)),i&&(a=i.parse(o),s=i.record.name);else{if(i=t.name?r.get(t.name):n.find(e=>e.re.test(t.path)),!i)throw ts(Z.MATCHER_NOT_FOUND,{location:e,currentLocation:t});s=i.record.name,a=X({},t.params,e.params),o=i.stringify(a)}let c=[],l=i;for(;l;)c.unshift(l.record),l=l.parent;return{name:s,path:o,params:a,matched:c,meta:zs(c)}}e.forEach(e=>a(e));function u(){n.length=0,r.clear()}return{addRoute:a,resolve:l,removeRoute:o,clearRoutes:u,getRoutes:s,getRecordMatcher:i}}function Fs(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function Is(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Ls(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,`mods`,{value:{}}),t}function Ls(e){let t={},n=e.props||!1;if(`component`in e)t.default=n;else for(let r in e.components)t[r]=typeof n==`object`?n[r]:n;return t}function Rs(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function zs(e){return e.reduce((e,t)=>X(e,t.meta),{})}function Bs(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1;As(e,t[i])<0?r=i:n=i+1}let i=Vs(e);return i&&(r=t.lastIndexOf(i,r-1)),r}function Vs(e){let t=e;for(;t=t.parent;)if(Hs(t)&&As(e,t)===0)return t}function Hs({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Us(e){let t=r(cs),n=r(ls),i=b(()=>{let n=s(e.to);return t.resolve(n)}),a=b(()=>{let{matched:e}=i.value,{length:t}=e,r=e[t-1],a=n.matched;if(!r||!a.length)return-1;let o=a.findIndex(Po.bind(null,r));if(o>-1)return o;let s=Js(e[t-2]);return t>1&&Js(r)===s&&a[a.length-1].path!==s?a.findIndex(Po.bind(null,e[t-2])):o}),o=b(()=>a.value>-1&&qs(n.params,i.value.params)),c=b(()=>a.value>-1&&a.value===n.matched.length-1&&Fo(n.params,i.value.params));function l(n={}){if(Ks(n)){let n=t[s(e.replace)?`replace`:`push`](s(e.to)).catch(ro);return e.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>n),n}return Promise.resolve()}return{route:i,href:b(()=>i.value.href),isActive:o,isExactActive:c,navigate:l}}function Ws(e){return e.length===1?e[0]:e}var Gs=n({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink:Us,setup(e,{slots:t}){let n=o(Us(e)),{options:i}=r(cs),a=b(()=>({[Ys(e.activeClass,i.linkActiveClass,`router-link-active`)]:n.isActive,[Ys(e.exactActiveClass,i.linkExactActiveClass,`router-link-exact-active`)]:n.isExactActive}));return()=>{let r=t.default&&Ws(t.default(n));return e.custom?r:m(`a`,{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:a.value},r)}}});function Ks(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){let t=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function qs(e,t){for(let n in t){let r=t[n],i=e[n];if(typeof r==`string`){if(r!==i)return!1}else if(!io(i)||i.length!==r.length||r.some((e,t)=>e.valueOf()!==i[t].valueOf()))return!1}return!0}function Js(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}var Ys=(e,t,n)=>e??t??n,Xs=n({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){let i=r(us),a=b(()=>e.route||i.value),o=r(ss,0),c=b(()=>{let e=s(o),{matched:t}=a.value,n;for(;(n=t[e])&&!n.components;)e++;return e}),l=b(()=>a.value.matched[c.value]);f(ss,b(()=>c.value+1)),f(os,l),f(us,a);let u=h();return k(()=>[u.value,l.value,e.name],([e,t,n],[r,i,a])=>{t&&(t.instances[n]=e,i&&i!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=i.leaveGuards),t.updateGuards.size||(t.updateGuards=i.updateGuards))),e&&t&&(!i||!Po(t,i)||!r)&&(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:`post`}),()=>{let r=a.value,i=e.name,o=l.value,s=o&&o.components[i];if(!s)return Zs(n.default,{Component:s,route:r});let c=o.props[i],d=m(s,X({},c?c===!0?r.params:typeof c==`function`?c(r):c:null,t,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(o.instances[i]=null)},ref:u}));return Zs(n.default,{Component:d,route:r})||d}}});function Zs(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}var Qs=Xs;function $s(e){let t=Ps(e.routes,e),n=e.parseQuery||rs,r=e.stringifyQuery||is,i=e.history,o=ds(),c=ds(),l=ds(),u=a(zo),f=zo;$a&&e.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let p=no.bind(null,e=>``+e),m=no.bind(null,Eo),h=no.bind(null,Do);function _(e,n){let r,i;return $o(e)?(r=t.getRecordMatcher(e),i=n):i=e,t.addRoute(i,r)}function v(e){let n=t.getRecordMatcher(e);n&&t.removeRoute(n)}function y(){return t.getRoutes().map(e=>e.record)}function b(e){return!!t.getRecordMatcher(e)}function x(e,a){if(a=X({},a||u.value),typeof e==`string`){let r=Ao(n,e,a.path),o=t.resolve({path:r.path},a),s=i.createHref(r.fullPath);return X(r,o,{params:h(o.params),hash:Do(r.hash),redirectedFrom:void 0,href:s})}let o;if(e.path!=null)o=X({},e,{path:Ao(n,e.path,a.path).path});else{let t=X({},e.params);for(let e in t)t[e]??delete t[e];o=X({},e,{params:m(t)}),a.params=m(a.params)}let s=t.resolve(o,a),c=e.hash||``;s.params=p(h(s.params));let l=jo(r,X({},e,{hash:So(c),path:s.path})),d=i.createHref(l);return X({fullPath:l,hash:c,query:r===is?as(e.query):e.query||{}},s,{redirectedFrom:void 0,href:d})}function S(e){return typeof e==`string`?Ao(n,e,u.value.path):X({},e)}function C(e,t){if(f!==e)return ts(Z.NAVIGATION_CANCELLED,{from:t,to:e})}function w(e){return ne(e)}function ee(e){return w(X(S(e),{replace:!0}))}function te(e,t){let n=e.matched[e.matched.length-1];if(n&&n.redirect){let{redirect:r}=n,i=typeof r==`function`?r(e,t):r;return typeof i==`string`&&(i=i.includes(`?`)||i.includes(`#`)?i=S(i):{path:i},i.params={}),X({query:e.query,hash:e.hash,params:i.path==null?e.params:{}},i)}}function ne(e,t){let n=f=x(e),i=u.value,a=e.state,o=e.force,s=e.replace===!0,c=te(n,i);if(c)return ne(X(S(c),{state:typeof c==`object`?X({},a,c.state):a,force:o,replace:s}),t||n);let l=n;l.redirectedFrom=t;let d;return!o&&No(r,i,n)&&(d=ts(Z.NAVIGATION_DUPLICATED,{to:l,from:i}),se(i,i,!0,!1)),(d?Promise.resolve(d):re(l,i)).catch(e=>ns(e)?ns(e,Z.NAVIGATION_GUARD_REDIRECT)?e:oe(e):M(e,l,i)).then(e=>{if(e){if(ns(e,Z.NAVIGATION_GUARD_REDIRECT))return ne(X({replace:s},S(e.to),{state:typeof e.to==`object`?X({},a,e.to.state):a,force:o}),t||l)}else e=ie(l,i,!0,s,a);return D(l,i,e),e})}function T(e,t){let n=C(e,t);return n?Promise.reject(n):Promise.resolve()}function E(e){let t=le.values().next().value;return t&&typeof t.runWithContext==`function`?t.runWithContext(e):e()}function re(e,t){let n,[r,i,a]=ms(e,t);n=ps(r.reverse(),`beforeRouteLeave`,e,t);for(let i of r)i.leaveGuards.forEach(r=>{n.push(fs(r,e,t))});let s=T.bind(null,e,t);return n.push(s),de(n).then(()=>{n=[];for(let r of o.list())n.push(fs(r,e,t));return n.push(s),de(n)}).then(()=>{n=ps(i,`beforeRouteUpdate`,e,t);for(let r of i)r.updateGuards.forEach(r=>{n.push(fs(r,e,t))});return n.push(s),de(n)}).then(()=>{n=[];for(let r of a)if(r.beforeEnter)if(io(r.beforeEnter))for(let i of r.beforeEnter)n.push(fs(i,e,t));else n.push(fs(r.beforeEnter,e,t));return n.push(s),de(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=ps(a,`beforeRouteEnter`,e,t,E),n.push(s),de(n))).then(()=>{n=[];for(let r of c.list())n.push(fs(r,e,t));return n.push(s),de(n)}).catch(e=>ns(e,Z.NAVIGATION_CANCELLED)?e:Promise.reject(e))}function D(e,t,n){l.list().forEach(r=>E(()=>r(e,t,n)))}function ie(e,t,n,r,a){let o=C(e,t);if(o)return o;let s=t===zo,c=$a?history.state:{};n&&(r||s?i.replace(e.fullPath,X({scroll:s&&c&&c.scroll},a)):i.push(e.fullPath,a)),u.value=e,se(e,t,n,s),oe()}let O;function k(){O||=i.listen((e,t,n)=>{if(!ue.listening)return;let r=x(e),a=te(r,ue.currentRoute.value);if(a){ne(X(a,{replace:!0,force:!0}),r).catch(ro);return}f=r;let o=u.value;$a&&Xo(Jo(o.fullPath,n.delta),Ko()),re(r,o).catch(e=>ns(e,Z.NAVIGATION_ABORTED|Z.NAVIGATION_CANCELLED)?e:ns(e,Z.NAVIGATION_GUARD_REDIRECT)?(ne(X(S(e.to),{force:!0}),r).then(e=>{ns(e,Z.NAVIGATION_ABORTED|Z.NAVIGATION_DUPLICATED)&&!n.delta&&n.type===Bo.pop&&i.go(-1,!1)}).catch(ro),Promise.reject()):(n.delta&&i.go(-n.delta,!1),M(e,r,o))).then(e=>{e||=ie(r,o,!1),e&&(n.delta&&!ns(e,Z.NAVIGATION_CANCELLED)?i.go(-n.delta,!1):n.type===Bo.pop&&ns(e,Z.NAVIGATION_ABORTED|Z.NAVIGATION_DUPLICATED)&&i.go(-1,!1)),D(r,o,e)}).catch(ro)})}let A=ds(),j=ds(),ae;function M(e,t,n){oe(e);let r=j.list();return r.length?r.forEach(r=>r(e,t,n)):console.error(e),Promise.reject(e)}function N(){return ae&&u.value!==zo?Promise.resolve():new Promise((e,t)=>{A.add([e,t])})}function oe(e){return ae||(ae=!e,k(),A.list().forEach(([t,n])=>e?n(e):t()),A.reset()),e}function se(t,n,r,i){let{scrollBehavior:a}=e;if(!$a||!a)return Promise.resolve();let o=!r&&Zo(Jo(t.fullPath,0))||(i||!r)&&history.state&&history.state.scroll||null;return d().then(()=>a(t,n,o)).then(e=>e&&qo(e)).catch(e=>M(e,t,n))}let P=e=>i.go(e),ce,le=new Set,ue={currentRoute:u,listening:!0,addRoute:_,removeRoute:v,clearRoutes:t.clearRoutes,hasRoute:b,getRoutes:y,resolve:x,options:e,push:w,replace:ee,go:P,back:()=>P(-1),forward:()=>P(1),beforeEach:o.add,beforeResolve:c.add,afterEach:l.add,onError:j.add,isReady:N,install(e){e.component(`RouterLink`,Gs),e.component(`RouterView`,Qs),e.config.globalProperties.$router=ue,Object.defineProperty(e.config.globalProperties,`$route`,{enumerable:!0,get:()=>s(u)}),$a&&!ce&&u.value===zo&&(ce=!0,w(i.location).catch(e=>{}));let t={};for(let e in zo)Object.defineProperty(t,e,{get:()=>u.value[e],enumerable:!0});e.provide(cs,ue),e.provide(ls,g(t)),e.provide(us,u);let n=e.unmount;le.add(e),e.unmount=function(){le.delete(e),le.size<1&&(f=zo,O&&O(),O=null,u.value=zo,ce=!1,ae=!1),n()}}};function de(e){return e.reduce((e,t)=>e.then(()=>E(t)),Promise.resolve())}return ue}function ec(){return r(cs)}function tc(e){return r(ls)}var nc=ne(`images`,()=>{let e=h([]),t=h(!1),n=h(null),r=h(0);async function i(r={}){r.silent||(t.value=!0),n.value=null;try{let t=await fetch(`/api/images`);if(!t.ok)throw Error(`Failed to load images`);e.value=await t.json()}catch(e){n.value=e instanceof Error?e.message:`Unknown error`}finally{t.value=!1}}async function a(t,n){let r=new FormData;r.append(`file`,t),n?.original&&r.append(`original`,n.original),n?.cropParams&&r.append(`cropParams`,JSON.stringify(n.cropParams)),n?.stickerState&&r.append(`stickerState`,JSON.stringify(n.stickerState)),n?.cropOrientation&&r.append(`cropOrientation`,n.cropOrientation);let i=await fetch(`/api/images`,{method:`POST`,body:r});if(!i.ok){let e=await i.json().catch(()=>({}));throw Error(e.error??`Upload failed`)}let a=await i.json();return e.value.unshift(a),a}async function o(t,n,r){let i=new FormData;i.append(`file`,n),r?.cropParams&&i.append(`cropParams`,JSON.stringify(r.cropParams)),r?.stickerState&&i.append(`stickerState`,JSON.stringify(r.stickerState)),r?.cropOrientation&&i.append(`cropOrientation`,r.cropOrientation);let a=await fetch(`/api/images/${t}/reprocess`,{method:`POST`,body:i});if(!a.ok){let e=await a.json().catch(()=>({}));throw Error(e.error??`Reprocess failed`)}let o=await a.json(),s=e.value.findIndex(e=>e.id===t);return s!==-1&&(e.value[s]=o),o}async function s(t){if(!(await fetch(`/api/images/${t}`,{method:`DELETE`})).ok)throw Error(`Delete failed`);e.value=e.value.filter(e=>e.id!==t)}async function c(t,n,r){let i=r?`POST`:`DELETE`,a=await fetch(`/api/images/${t}/approve/${n}`,{method:i});if(!a.ok)throw Error(`Failed to update approval`);let o=await a.json(),s=e.value.findIndex(e=>e.id===t);s!==-1&&(e.value[s]=o)}async function l(e,t=1,n=20){let r=new URLSearchParams({page:String(t),limit:String(n)});e&&r.set(`status`,e);let i=await fetch(`/api/shared-images?${r}`);if(!i.ok)throw Error(`Failed to load shared images`);return i.json()}async function u(){let e=await fetch(`/api/shared-images/pending-count`);e.ok&&(r.value=(await e.json()).count)}async function d(e,t){let n=await fetch(`/api/shared-images/${e}/approve`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({deviceIds:t})});if(!n.ok)throw Error(`Failed to approve`);return r.value>0&&r.value--,n.json()}async function f(e){let t=await fetch(`/api/shared-images/${e}/decline`,{method:`POST`});if(!t.ok)throw Error(`Failed to decline`);return r.value>0&&r.value--,t.json()}async function p(e,t){let n=await fetch(`/api/images/${e}/share`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({recipientEmail:t})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`Failed to share`)}}return{images:e,loading:t,error:n,pendingCount:r,fetchImages:i,uploadImage:a,reprocessImage:o,deleteImage:s,setApproval:c,fetchSharedImages:l,fetchPendingCount:u,approveShared:d,declineShared:f,shareImage:p}}),rc={class:`bottom-nav`,"aria-label":`Main navigation`},ic={class:`bottom-nav__icon-wrap`,"aria-hidden":`true`},ac=[`innerHTML`],oc={key:0,class:`bottom-nav__badge`},sc={class:`bottom-nav__label`},cc=E(n({__name:`BottomNav`,setup(e){let n=tc(),r=nc(),a=[{name:`home`,label:`Home`,to:`/`,icon:``,isActive:e=>e.path===`/`},{name:`library`,label:`Library`,to:`/library`,icon:``,isActive:e=>e.path.startsWith(`/library`)},{name:`settings`,label:`Settings`,to:`/settings`,icon:``,isActive:e=>e.path.startsWith(`/settings`)}];return(e,o)=>{let l=c(`RouterLink`);return u(),O(`nav`,rc,[(u(),O(ee,null,i(a,e=>p(l,{key:e.name,to:e.to,class:te([`bottom-nav__tab`,{"bottom-nav__tab--active":e.isActive(s(n))}]),"aria-label":e.label,"aria-current":e.isActive(s(n))?`page`:void 0},{default:t(()=>[y(`span`,ic,[y(`span`,{class:`bottom-nav__icon`,innerHTML:e.icon},null,8,ac),e.name===`library`&&s(r).pendingCount>0?(u(),O(`span`,oc,_(s(r).pendingCount>9?`9+`:s(r).pendingCount),1)):re(``,!0)]),y(`span`,sc,_(e.label),1)]),_:2},1032,[`to`,`class`,`aria-label`,`aria-current`])),64))])}}}),[[`__scopeId`,`data-v-e670448a`]]),lc=0,uc=ne(`toast`,()=>{let e=h([]);function t(t,r=`info`){let i=++lc;e.value.push({id:i,message:t,type:r}),setTimeout(()=>n(i),2500)}function n(t){let n=e.value.findIndex(e=>e.id===t);n!==-1&&e.value.splice(n,1)}return{toasts:e,show:t,dismiss:n}}),dc={class:`toast-region`,"aria-live":`polite`,"aria-atomic":`false`},fc=[`onClick`],pc=E(n({__name:`BaseToast`,setup(e){let n=uc();return(e,r)=>(u(),O(`div`,dc,[p(w,{name:`toast`,tag:`ul`,class:`toast-list`},{default:t(()=>[(u(!0),O(ee,null,i(s(n).toasts,e=>(u(),O(`li`,{key:e.id,class:te([`toast`,`toast--${e.type}`]),role:`status`},[ie(_(e.message)+` `,1),y(`button`,{class:`toast__close`,"aria-label":`Dismiss`,onClick:t=>s(n).dismiss(e.id)},` × `,8,fc)],2))),128))]),_:1})]))}}),[[`__scopeId`,`data-v-546af507`]]),mc=ne(`auth`,()=>{let e=h(window.__PF_USER__??null),t=b(()=>e.value!==null);function n(t){e.value=t}return{user:e,isAuthenticated:t,setUser:n}}),hc=[{id:`warm-craft`,label:`Warm Craft`,primary:`#c97c3a`,bg:`#fdf6ee`,text:`#3a2e22`},{id:`playful-pop`,label:`Playful Pop`,primary:`#d63aab`,bg:`#fff0fb`,text:`#2d0a28`},{id:`sage-cream`,label:`Sage & Cream`,primary:`#4e7c3a`,bg:`#f6f8f3`,text:`#1e2b1a`},{id:`dusty-mauve`,label:`Dusty Mauve`,primary:`#8e4a84`,bg:`#f6f0f4`,text:`#2a1828`},{id:`ocean-dusk`,label:`Ocean Dusk`,primary:`#1a6ea8`,bg:`#eef3f8`,text:`#0e2030`},{id:`honey-slate`,label:`Honey & Slate`,primary:`#c49a20`,bg:`#f2f2ee`,text:`#1c1c18`}];function gc(){let e=mc(),t=uc();function n(t){document.documentElement.dataset.theme=t,e.user&&(e.user.theme=t);let n=hc.find(e=>e.id===t);if(n){let e=document.querySelector(`meta[name="theme-color"]`);e&&e.setAttribute(`content`,n.bg)}}async function r(e){n(e);try{if(!(await fetch(`/api/user/theme`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({theme:e})})).ok)throw Error(`Failed to save theme`)}catch{t.show(`Could not save theme — try again`,`error`)}}return{THEMES:hc,applyTheme:n,saveTheme:r}}var _c=n({__name:`App`,setup(t){let n=tc(),r=mc(),{applyTheme:i}=gc();return e(()=>{let e=document.documentElement.dataset.theme||r.user?.theme;e&&i(e)}),(e,t)=>{let r=c(`RouterView`);return u(),O(ee,null,[p(r),s(n).meta.hideNav?re(``,!0):(u(),v(cc,{key:0})),p(pc)],64)}}}),vc=`modulepreload`,yc=function(e){return`/build/`+e},bc={},xc=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=yc(t,n),t in bc)return;bc[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:vc,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Sc=$s({history:bs(),routes:[{path:`/`,name:`home`,component:()=>xc(()=>import(`./HomeView-BVevNXVc.js`),__vite__mapDeps([0,1,2,3,4,5,6])),meta:{requiresAuth:!0}},{path:`/library`,name:`library`,component:()=>xc(()=>import(`./LibraryView-BmJwebDM.js`),__vite__mapDeps([7,1,2,3,8,9,4,5,10])),meta:{requiresAuth:!0}},{path:`/upload`,name:`upload`,component:()=>xc(()=>import(`./UploadView-C0dEQPr3.js`),__vite__mapDeps([11,1,2,3,8,9,12])),meta:{requiresAuth:!0,hideNav:!0}},{path:`/settings`,name:`settings`,component:()=>xc(()=>import(`./SettingsView-DWXOcfNX.js`),__vite__mapDeps([13,1,14])),meta:{requiresAuth:!0}},{path:`/shared`,redirect:`/library?tab=shared`},{path:`/:pathMatch(.*)*`,redirect:`/`}]});Sc.beforeEach(e=>{let t=mc();if(e.meta.requiresAuth&&!t.isAuthenticated)return window.location.href=`/login`,!1});var Cc=T(_c);Cc.use(C()),Cc.use(Sc),Cc.use(Qa),Cc.mount(`#app`),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`).catch(()=>{})});export{nc as a,uc as i,gc as n,tc as o,mc as r,ec as s,hc as t}; \ No newline at end of file diff --git a/public/build/index.html b/public/build/index.html index 66817bd..7d09d68 100644 --- a/public/build/index.html +++ b/public/build/index.html @@ -14,8 +14,8 @@ - - + +