@micrio/client 5.5.5 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/micrio.min.d.ts +1049 -83
- package/micrio.min.js +6 -7
- package/package.json +1 -1
package/micrio.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Micrio Client
|
|
1
|
+
/* Micrio Client 6.0.0
|
|
2
2
|
* Copyright (C) 2015 - 2026 Q42 Internet B.V., Micrio <https://micr.io>
|
|
3
3
|
*
|
|
4
4
|
* GitHub: https://github.com/Q42/Micrio.Client
|
|
@@ -23,9 +23,8 @@
|
|
|
23
23
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
(
|
|
27
|
-
if(!(typeof window !== undefined && typeof window !== 'undefined')) return;M='H4sIAAAAAAACA+29e3xc1XUovPd5zJyZPdJsGy#EZWDNsZsM2AIRE1d2AM0RMshgwIBJnLSNJUsylvySJeEYIiMl#MRNk4aQpBdcGmZGdqA3SUuaNHBDiJ02aaFJb2mb9KZNHzRJW$L4GufRW3JL8WWttc85+8gCnNzv+$74fp$885z9WPv9WmvttdYWg5#7pRBCfsPrHZAzYkD#yJkBZ4Zd0+gi$7QY8Gemp6enxYCcltMD7gyCCDkz4M1QqD#Dwd4MhTvT6MlRghkx4M5MT8sZ$MyIgQKFTs8QPGY$PaA5aHpmxjjkDJVGZec5F5PrDJXMn2kx4E5PYwbyLg45KAZaTRaY2QxFFmZirxgI0D0znTjRFxdmMp+WBwdyM6at$gyno3bJGYwwLSRwZ+Yg9sC06YEZeRB7Zwa77uBAMMNVwHTGje0vs8Nua1scYAK5EEx39oIxVJG47jmq#2aj4qZzriXL#xMPlPkm7afG4PgIzhI7Nd#FM8lIkst0II2vGZkk2LjdmYMzYiA$c5D+5MyAEM4PZas7sme$P7ht78SUKHm7B0f3FCdHpt44#jm6bdeIcCgkP7hntG$vnhEhyBsM7hmNKAH71f7RkbeN752YumVkSuQ4KM3jdSaT1smRqc2ju0ZuHB8cGp26Q1QsQE4uqhRUmByZun5wamL0QFze8MTg2266fXBYXMQ53ZbNaWUKhcFiFVcaa4U1EtjC3#6R3Xsn7nCEdL8rn5NCem3nqHzBKxSkDJyi7$i+7zh#4EhPSkdK6bbkW2S7bHVLgXDzQpy7NF8UTr4lny+LfN73ix3SEUJLKcSyRfI8KQJVzEnpmj95vgoE5nSBEMITeQllTzmLS44TestX$IIIXiNeG8gLc1gqAuBfp5SFQkFenDvLuaRLLpFLLn2ds$qy1+f#PjtXdIRc7#bW$#IixxVCep7r+66b6$Z9IcVakVv3hsuvuFLkMDusfWur7gmcs2qR58tx6bq54UUzMhLq5$0RkeafadknzF$GfZfsFSr$xcJN$uTIbZNb3BJ93+y2eC#DkyPiLDW0d8$k1MTtQ1N7J8Q55dtGpt44MjE1cqD39u3bRyZE++J5IavXdIlz85MjU9HEyKBYir#kd3BipBcnYceiyZGp1Wu6bpwYHdkzNTg1unePWHbu5MjUNR#jw5snBvdMjmJY3+0THHfeBafFbR7dPbrntqtv3zNEE#cvmRyZumpi7+Tk9sHhkSThBRi8fve2keGr7WDA8vsmBm9bv2twcmqUJz#G3bJzdLx3cHJk48j+kV2TImyZHJm6Ye+m0T1D#zYN7hHLcWFtmLzlbaPjI2IFRvYPTkYTQztG94+IX2gl4Fv3DI9M3Ll3727xGnXbyNQNt+$GGT0pXluc3LH39l3DfR#DbxMfkB7#dfER6U+MTI5MiYckrtBbpva#i4bMTYxMjt45IpqytNXu9d+RwdbbeLGJ35V5dF+1d6$4PZlD55Y3i0$LIrrM0nuMfTfu3j#65c3icRlsjUfjCdmC7g27B28boYDPyUVJwM17zYg8Kc9#At84#jyyd9#uwTtG99wmPk$J9wwnq$64VFjSJlPwCa7bmwffJr4gCxQz#jW0Q$yB1JghVuiWkamp0T23TYo$5Kr0jU6M8Eh+ketJjfySzKMbG$lHUqFz4+ju0amRYfHHchHmu3lwAltodpGnZH4rDv+GPeJpGZDzxtunxJ9ItXV08i179+4eGd6wR3xZlhIvRv+pLFGnje65ZWhw14j477KEJSX+P+#S0Y+D8oxs5Y7fPzLBAH$#bWTPX8hCUk$xl9ytq9d03Ty457YRDvyqLGwd3D#6afD2yRHxNVlEz80jk7fvHhF$JY#t8TT4H7K4dXTyutE9I1#jQ+LrsrB1fHDPLV#DE1Pir6WHHvE3MuDAvePiG9yPBEB997cyt3X7rjs27xV$J$2tNCH$Uaqt4ziX#Ztvyhx7xbdlMY7Y#y7+WbZyr+8fmeAq$4vVZg55ThYR5i0b9gyPHBDfka1bBydGBqM9o7sHcVzFd+ViTBENTY3uH6EZtGH4gPged87Ve4dunxT$lxmtzXvFv8oiDxwCih$IMs3UNK04aQdtHLxjZEL8ELtxeJjjf8Seq3aM7hoWP5aB8xNZKEoRSeX8qnxQluTi4ge$5jwnN0pnpkeEMtJTUXksGt8X#iA2eDWQIMDZGZ065Y5Fs7PT+yK9P3RAgnNtR01Eot+rgWMcQikFYoVQV0hnBkT0wqlTp9zrvFpUD6Jng6gSnaeFUMvFchF5Y5h$dBaWFHk7QzGmW0CscQQ46jp#$f1s6r8S0fmYHESkx3Rr6GIyJxJrHA$oE4ADco1TAgcz0uBGekz9UEo5E10aeboc#smWvtYVYPuCjE9nf#0ZH2R8VSx5nejCkk3wyZ5BEAnI4D6MlSAaJiioNZPooNYMRaMiscJUI5B2VU72gGiAbLx8hYJapkInqEJqlwCx3qtFpcjV5Qp1GHWs4L4S3FeSRwec$djFJwtRvRidFa2lHpbgTIUykthnkQD5ghI4CSgT$HggsKcDE#rj0nGn5QyITtHlTYP0QVYctwZ+dErui$wNXs2hKbTSFfwJ+K#b9Zf+gd#ouHZk3BTspZWutjpNYoLQS3u2Bd#44M1hD$qRHKv4JQcnI#XUzh$gT5VKUyoQyyUIvVh9mKbF0yIq6HIoMjNBZGaCyHS8yMwEkZkJtq8r8Z3sWet2Z3w1HIF1oh9EVIqKuhx5kaMXUd+qHqyVwI6v#CBxZYGMxAtFIVSkQWBds8PAY0mfEgj1tIMZHJZRgKA4CUQkzCTQS3gSlCKly9FiLtRLAmZXcAjmtjR6tqjPpiwjWkr0WQLiKmxEt9P#TVg2vz9MdDVxrUognumxe+VZ7pXlco1TywT2Z3ybMh23hUsd4M8giMhbJ7axb4g$w$wZ4c$2TP12ZHzjGd8BEH2L6#8DPWvdWQlCeUK3qbwAUXU88w1U#30FyMdoxNHpPLbW7VIFHBK5Tgyrc8hFxYFD5YC71j1gINa63aqLXLih7ovcq72Z5Z6$3F3uLJcmMBSRvLoDR#Rc3aHW#LUkaVfi2pS4tiRFDyWu7YlrRGnjGsDqrB#DqhXngIw8kB3rxDbTMk1wVccDGTlTY1VHqGUC13S$NxMJH5dQLRmJIUWRVWcVT7FZFc2Wos5I8e6sylSkllzwFgMc2MDtCTBHLrEjz58Xqe3IZUnkUqrg56Q3DUJ3rnTBB6EvXukKpU46Mn8XyAfSLdmrgQDxWw0QHy0rkE+Gud7LDveeKt9dyU#uV94TeptAPBm6JjQMek+Vb5oACXLbBKWVzVCAmCsrcBHcAW8LhTvg3fx4k4J7Dk#wybsLASAAt7d0zx0Hw+DgPT64vaf4L3937yz$BYdUxYE8wud6JWAtCD6P8LmF4V23BnkIbqF9wX2Ldxd+bvJq1lTGmjjgHvTBUb3ynooDQa88WAlKUil#VHv5RBVHQQB#r7rnjtA7WHF7e+7B9t0T#kktDoLbe9k9h8DpleAePAxur7i149BxtUJYS1V3Jc66Fah6BQh9aQUnx6UgGsm+e$J43Updt2o23FGhaQTiAZAPjHSYGSHsGXFWMiMWJ3PYnRrDxSdUD8NHgo4TfRn7+ISIfQ4dFLGPjq#q8ak7pZwGH3trpQtJFY8ST#qdC3PG83xPk86kIW8GKCcY8i#hvBq4kJureIgf4bLVvDu08+4AIMCjHUW$fikuz3XCU1dK#WNhAniW0TKSK91HZBNk1Vm20g3mqCogV7qPJoF67tic+h3PyU0jHoVpirgwdMUDoX+xkgNnfUWBly5obwZyQDABVRfUPi9d7+DNhR5V4GjFB3JVj2Je1k6tMz5slj+vWbjsv#mkHCiudJ+RUKQK1+a#zSXFHfMTp6rkaesJA25$vknlrnT7wwK3G0N8kN4M5JNUw95MJH1w5rdKmZGgSgFXsaqgkPYDBKmblz0VGxxleCqxcJRS#RjNzcp#jaQbmlzVmhXg02jQpmUy1$rSta72wV0fh3SB3wCvTpHGXwevcfTYWlcrNW$izS+sP1NYmml3mmm78ceZtitqhxqmXXulq3lyypVu#w+kX#kCt$+lmVclFJPzfWn#ddGhjq5u#tDRVSMUB139a91+ZaYzF$JuKZ1prMC4VVHG0Pra#$s2$0elUGumUXaThBj2KGm$NT+aFYcb#JCBohU9ALJ+FGTDB+eI8Te#gayrte6AWi8y6KYY9KaTXH0b9Vwgiiajnl#Kdz2u97k13ZU461ag+oyU7vw24zw4iYtVv4GakE6TpJk1q5lp3zC2vKUi3RrIJHi7l$r#PVGvSNzubYgTQzZEzUDQ8eUeA6cB7hFwjhwFpw7y2FF9#eIV35Iig379n2PGJzM4IMZ1Z3y1jK8$4zsNFbTiBn4mPC$NZVaqj7m#M4PD82QvHH44dCM6dfdFjzzyG6fcG0PPq5l#+04PuEjjToM8gjP2iA9CNfryv7xk9Ws++o7LQTbqlbSkisT#Fc3QB79ZydER5i#C0gzzkIv$9U3eMvCNL9$+4883+z563y$WD9+1pKfe7JMjP$rR1$uuQmfVfePT4e7d6PzFv8od+snwb6Dzzhf1okWLvtBTB9$K66t3Hp8av+g$rmz2fefhk68rP74YQXfo9y3999d0ofPsu5998alvvAmdHzy05zvfes070fli9Km#zzY+1kPEmKw365DvG7oV$77W06yHso47vn0WuNH5t0f#vsca4DwWYs#whViR+hzIRi#l3xqEVUTyaq8GflklRz34c2HuSUIoxu8+Tt2RBz8N8JsWJpCnfh#NBtJv6nc8t3gXXhCBiBGkU6fE3YizfTg4GMrenrsrHsje3Lsfjtyp6NHSWKgudEXFBXWhG1Qc$#iKBK9X3EwnsncP#L0nBHgHQ$$woYpL2A4WefgQ0l$oURe67eTHEV0ILQs9Ci3fXfHBMc4wB14vHA7zd4GDXwf8u7CP7gr9Xjg8HeYM3HQFeRZ5RAHh8DQE+LtCY6t74fBdoQTfAGLUPdPTyHfZ$InlGqt+1$R06PY62IIrD2Mtet4dYg2ce95VccADv1e++12hvK#SAwk509Dcwc#HwnxcYQl5rF3Q++lDc7$m3AWyt$n7x58qoYNDwgJVt5hUV0IQwxSpyjKu8mf7DnWM3$SV+7t7muBA7p7PmnWztqdZfyEf#lCImyKxKaF84yeW6zDfqw5Pf3ZFK+R7X38PyF51+BA405+NZ8AbmivKy1vjvv765ZDrveyeg3iAvys#nJ2dufvQ8bDUXNG6vAyl5ooyuL1Xvhv8gw+r7zmu#+3MyLsQtc$RAvejC$ZXP#R#0DoP$eg$$vDoKfd6nKTR7#zsj1xkeQk81ZPFHEndU1YUf+JU$kY+Uxtl5czQuD1s5$XtX$U2UF5L9iP#BKLv7qee3t219ds9zY+Ebp8Qtc3$UflpT7MRCnD7Lh3atnTw089c0QydRihpC4qW7I9#lfftjPR1#EX7Jsfdi99z7twbmpgZYA4DJolshMQeatBwCzg9i0s5iy9sgF84cvfb16ZZCM4ykwVmUMFDQa5oxf2qAU4D#$MFpyRVJCCna6G$E3zw#lTFW966vBxJ8CK5L5JT#3WPeh8eF$pKa4NNWGLP9jR1NBdKc#boGCFalqrSedWy731zzVKLTEiCwG3MhbJp7$Unj9NeDy649QQ##UP2xo7b$KxUn$HleYwuhIRfjIc#oR#bQjpBd4Res4GYI3o#hDmK2xLmAYMNi2pWhgUKHwiLFE7YVxCWCC0LW5hFFbYS+hKWm41wCeSh0IQi5JqN8#wmEGR3qAmyPVwECNQGLgM5zUZ4TrPBULVwMUFBeBZBtSPB0IQ8QZ3brEMr6CYsgpZmI1wKigIWN+EsCuiAoNmARRygm41w2Uubcj0878leeU+vc7D3Rd629r7Rq+HMhhY4uwkasPDFcG4z7X04by48r8mDtAj#aUIrnN1swFlwbrMBGEF0CyxrQg46mg0owNJmnSIQU8xDB1I$y5oNKMJSkwIRR$1ShaFMWS2mqmJEFQSUsCKLQFEZgckKp0Y#2pvgUVYFaDMpCMHEwvPQTmW0mRS4IstY3RbKajG2niL6QUArFl6ixp710mnMWW3CTQSr61BWBVhiUmyh+dX+0mFIDSzCEpNigPotwHZgZ+gkqx3Ujn#xr3gU4sLHqa$asB3YGbkkqwPUjqXYV9i0fFL4rFRflUglSaL2VroCZy3i1Dzz3GYdfQM88Tz2zcp6m#KKeJRmB31LB9IdCBkA51YFk1E$mDx21MGfQxY0kwAGriuG2xTDjTNcYAgEA9cdw22J4Q4wnGYiq119znNcIkYRdXrS3jQ93FXrntlVt$Hma86#n$aARHYNwpx8kXZmL7NJRzMV3wfxQEVQxFd#uRu8aXLez86XGlRfgMkgavU5P5LYLwuzI#aUT9n8+qy3wZu#HAvyeQvy+R4LWZnzI7fip3i#mF#KGK+I9bngMq2C#Ib517fob8JvrfvEvT3Nvu+17F9x3dt$GzGym654pr695ZPo3AMbv$Sn6x9D56m7xX0rNvwB#lsMeobc8ySrS3aNrer7dPN4s+$If$79zZ1$$4nj9Wbf7iNTv$ujRz+Fzn1ty1$8o32fQ+cXv3f$Aw888PRxRPkqzkvHGl3h4PZfVk4t$Qd+qyek43qq78YnBv3bPv53PeD0fXPkknBm5Z2fqyNWVhElT6UIsh#jw0msq$p+83++4y$U5A8w9skvn7zzcH48iXWsgY7TfiCJlYo6T35UfcF1vBnnLpogCUt#gqjjZmZ#dtzLnwzzdMjTnDrl7oT8w6E7QcSqXk$z6Pz9kbMPEAmYoKbHJzfkHkY403BnPSGulNKJnKtbJDiRe3WLU3KVNT0LtdR5oqyUg9MzntbgTqxv4Wl54lT+aoNfkH#67y8qq2em$9qxaAsncvZ1h#IIjkMk93X4SRnJsXYajEqRkqt5YcAY+BsmWgTjMjAG3obIpEuIWCFoN5h7QK9XFWENtxMPN6M$R6x2gjCj0$hcvUG4UeJN#qBeViIZz+PWwFJVCTtI$$UV$v0$W$7xCqen2Xf49+Ttz$5gA87sN7x$x+9X33kUJ+mtfYdbb$3C0xh6c#$33MV$9VUKpb8v4dSPM3rnfRd$8kuPf6qn2fdm+b6#Xbl$Rrin3vPmB$$pIlGrN$uu63zPsteuc0$U7ZWqnnQcZ8ZJyD4nHjbJM4d2oycfBuPdyXMoaV#c1Xh3PSFsBFWngQxiTDV7ivYoyuBH7gZ2iBv3xcgl$2vqa5ppFs$2gHggRZkaoXgIyX19DRI10af++XNYsem0Z10kA5LDW9Sa6RJq+BbZCm4dvCTyctyEUnILa9FAVmV9zqLdGmly3EIbjYaKJ57o71A$9CRzFp+VuA4NLyN0X0J2muAiV9KqVLLB0vlCaRxIQPWCoEfojEFYi1zXp4W04w1ACfsUmZwus4a9lW6AyV3wDDeLXMTNIhdxs8hF3CxyES#LXMTIIhcxssiFjCx2bULUgVxbEFcg1wAiB+TagdgAucbx+CfXATzvyTUr+Wqp6gT6Kr6hKinTIxTYxx7sR4F9I7gz6adZp96iHyTMLXaRRZ3Lh+aQUHUpNSHGgj0BeQL2aPJQd35bcpkr47FZ6eoj+upk5c+l8zFx1c3gfFtaE5fTBro$TUp48VzDKon6vj0td4kpdslLdaqvZQY3w20hXL1ubtm+LdUH4nvmdLp5KQPv2Z4mXsmkbDsMcPWGlW6AGIfFRrdu1+tMC7GbYMM0Ml3WEpzhjjrIxhwXjez3ubUuqD$xXT8hLwPaSPJIXuYgH+8n+ZS8zJutwN4BmkibIKopQfYdfPGTb$rWeX98ZbPva4Nf#LcuL8Kd7KPPI6$nHT11Bmo2QfZNf+3P3rLur$$pimbf9x5c+Z5$$qe3fB6P8r4NvDniuV5WXNw8ajWwEa98Sq3mkVrN$b9Hreb+n6dWA10L8zvxWq1DVXLLWyti#V6p5yK5j9FC7HrZrLgLUquh18ig1A3wGjwAIPvuPfvL59bl$7qy2fe2m77QtusLb8Rx2kidfwxPJkT1CPCr3Yc$$53$9ciTzb4vfvLTT37kXytX1pt9n7j5wdkb77qPhgxb0WzU6346F3DDxxlnsYrd$ztmR6NJXN5kkjSTHT2H2IF6X+5nm8sf+cIRmstJJ5WV1av#wr3qNkLPulVqgHvmveoQrXFmvZpebDbq$$9a#H0tSHstSL7axrXAol6ZqYf98CpTj3cy7PYznnp+XKrIrEDxKiswxvn#aAUi4KvPFckrMFkLcoyWwxelLEyD1NchG1hvrNBtY1elSPwcvrCq8VXMJr5421Khq6EB4vUTP4g4QcR$QrKbTzIoYqDHfro4Q7$P$m6iDgvIWiE$TtYA$cQDYl6Gl3C#mIXho1+yfwuxTQrYfPIPLNwKza1o51bAK7YimNeKBpP+SSsa5q4wbkXD3GjHrWgw+wcbQE2pcyuwAdSU#rcCG0BNqcf8F6dJTaljK+5n0mElMloYkeGLWKdJ95n9yHyoMxsG+Xx8ccpAXTHQJgM0zkAHjIRYk+9CDdAWA3SAgWZjATKCqsVQAwZqVlryBg7KG3Q7Qj0vbYGD4DN6kyVxoBMvXfm1J16WFEi8fMWeeGlMuhJvjiqdePmGPPHS5WR$4qUh35R4aei3JF5iaA4kXmJE7ki8LdSfiZf4nAcSb5n7KParD+BNGl7NII4U#lVnGW4o6xk5N0Pj6jeYNX1ZfHK8uQY#Xoh36F5zVVziAJ#Q5D$ogjcmLY8lFNBRRLypZwf09ezYom+A+ahlEK#Y+kaqBs51lCqS+kpLaj#RhzDcam8tiSp6uFBTbDtFC2NsvNtCkfWNpjpH7PqkS#18tHp2e0z0z#6v6a61btUHR6+uSCNlZuGzx+tHwLnI2fQEcdza02Bi6CXepr6RSAqhb1qq$k06DuHM#CTYp+uZ$0sXyKZbQ0dvxC3iJergMG3$+rq17r3swoiNzbXu$SbiiAGsm+i17iNWDEI+StI6GP#4zHDkT3DEdUfWuk$JjFTL+Jxen5KAXC+LoAyYSFzrfp1ysMcIU39dNu3ka91npPoj6cgZL56J8xqe3IGnw1bXl1aMxABRLAsQP3XeJsfnEzehF8vhvIy4AN$xP5RWWzVBXuRsQvnIng89MYdsK70aCWK8WYmEXoN+FgD6JMqocisYLcT9C6VaXGySH0kVi3ccSPer8WNH17rjCmGeliwIkxWioER6nZovdIChVyh7sVLVF1ivrlmvIPS1uGT1zSD0LSD0ZrVEsDAv7m5zn3mpkbM9A0Zmq2TLbC1NZLbuEEwJ115BguCVZA2ycrcCXl6Wd57kgXoTyQ$WeJ8Z166aD42jEHHtrkoqiR9TZc2fvqzUgvpyyfFmWqahxS#p6L5Y6qiKQtc00jz#GBBJEtDtxhty6qTTI#YHjIdlvbpCFHVQaaXzp7IIMYV1Aj9qIbFSDgwDEisNjFjpKihXnbpEjkmw0u1KmoAseM8SDg#MxR8915gLF9fBg8UNWGyL6HkQ2D2nELqayRBZVRiIP8FcE7NxT8vGzWRTVbAINN5zt#GnPTwbP3g9phG9WkIdUjYnRSu0QRtI$bp6aPWXggLGIW8oMLsAt#pfXAoBCoXV+NP$Uq#gFQ$6VlzRQ5Qb+RfP0YZMviosxrssBa0oxgSt#Gw4cIrnwCb+3Myfm$hzS9KHlcU4ExZ5Na4w1QMxsXPw015ph0VY3iLaUc49rTLnQHsSBnDuHDbNT8#rVuomBVDbFeVNfgutPrceLkVQKtK#6KiH5wyHAdWLCrLiltVDgtdUkhVxXj08fzg0JZ3bCM$lrDsaYcdQqDmvZXgbSYnPa4TnDYWL9u3btx4CUKBh0cTEBLFEIxmhosEy#G+4AxZ1cIdyWDucP9QBqoN7l8P#hY7hDtAd3NUcdg4sHe6AoCPt9+d7Kouxn+wZoaAF+zSSUFjP41dGfg7$NvHzq#TfZv2h+byvjX9aMxJ3h$+wdqxyDoi+Iw$g33d6cPY1Hgito002joLk8e6As8FpPFCHs8BtxBzeEz2JZDx4sGQIXDhrKAwg6#gIZbM#S8BrPIBaD4k#xJyVfXLkmRKajaSyxxiJlqZuT$cYx3$rMbCNvj$9Cv59v+eoifptTIQXnH6yAIeINDyHuuRZ#QeLU$45iRvFcCMdcz74isiXqjNedQB3MXb+R#6uBHyev+SbWuPsYEWCXVCMxLXeDBQxasc1iVwm+3cihKg6u5B23Rk5u$l+CkMgGFvj7FLGHTm7r7WidnIU4$QYFAbRBbeHBSQ9xiYfs+r3mDnZxx+rEeVFh2G3dYTXoJyshHTxVVE1g9b9r$CZ4YDQb6a0uH2jE88MczxE7LsqPixaeKKvE32KbowJce9GGsmcNTW7Fid7IN9oqr9xzUVFp7hifZzBlVh6NysLkcsxPNZuFCZuB6F$eWnSGD5YNocFHPuwuB734m37EtanEIN4m1bQl1RcBcX1L#ocgHsM$QX9Jr0FR4tSdXjTUNCrUdTeEggjVKjWVBV1#mD1NMD+pqqUoLgeLE2efXSdp2x#Ud2S5rWlz5DRMR+2YU3aGrgI4UDpzHJzTo#dn5ujsBtW0S6ioISSValkEP6bQZn8S#i3VCQCRhJyFsEw2IEzgTJIzzqcFVK96DrujBH2TK4+BlFnx4wZYqVVZ7NejZJpneIpuT4knSC9qlNE1Ex09bGKhkH2K#gqDnIQB1SKpM+tA4vFTTxErCH0eVTCHHqrYX7uKGJRknGXywnJZA0Q$UblzZjskwUr6F5FWDVBfLNTXE6wWLyNpopUerZ5jJLhtE7q+icpZJVi3YTIaqfKsuy5mA#$QbchVciZgHyjzgjSAvlhD67CTcmNhF6b7TTuoYX6xx6sK8Alufx#caVnUMAredfpNtRl90qzAFPSzKIVMefEo39pKQ5wJNUR1+D3jIUVbCxseD4WhrH4g1hYnQT5V$EmU8iiXgUb9Ro2qFeBBNcJ9SJKZqG0VcV6DiY#97PVGeTTjyQEHXybvjoiDgf#SeyyHIdSL1Mk9rPAIzVLYMR0ve4Mc5CnEya30n1#1n2QKiVpTxMFJ8puC7KUFgLCPKokoZND5wHw5scdBV$fCjl9C+T05vkNI7Uh$ctcr0jom5WKFZw8m2ZpS2iW$xkTmLyzSiK1aB1XidoCRbwDHNh#MWKWZ9WZ4uUhec7NUFAkrsUVglNQ6rcSu4kwEeLYvTXV7GACkLU7c#n#xXQnynz#Ie04hy2aG+5Y6wZmDge2RgTm8wzrWLJGCtU3MALtHCmJnjY51+a#KaMAgBVeJzap+yXtC1XnQWJQxCf9T+TuXZUc3ZWa0H5edwCurlY8lGTbCXJniPPLW+CGzQH$BpRDuWFfB9L5vgUU0$1rnCmaWUQYg4vani6Ls#uL9Vb1Dt$JTbtUt1XELXs5cpwiG3TQJhfP4liqUKFCXy+uuHy8X4IbsCER#4XgRnmVgImvArNKJRdKHbkl1WI5qhcznwmjZMPGC62C9eJKjmgrWtrkaoCH29oqsSksIorko$tmheq0YZEo#BeKHc06yuLixljAH3QlCW+yEt6yQEIqETAhkKuBHE0k4swuQVRalUPz1BNm3SYV1a$j0jVq4GJV6Lwax+UMHuSzaNIu7rcd5H7MdMkCAlRH9eLmC84Yd+$4gtikweUgwA#3vyMMNnozGLLTh0BFQg8o#lJ0TNN30gFlH$gsY0nyaqJTVPWtysJltnM6LpC3MQvPI30Jmg4zZnqAQ0tpnegFX30G#b8XujBf+i7mP#kMeklqX1rRPQjdbdUfsutKWiB937$p8fPf9bGuGmuStTfmbM2XhDEzHGdXVfExS3#yD$cfFGqVTRa94KXuAPkDTt#uvixJloMZ4EaYI8wh980nGQ0$VjIbb4Kv3xDz6Ild5kACo2MY1rZmcoIYoJfT1v1zsqPcTK$l9Juwx+rYY3Xw9DYivy3+UyjsrmbNtgTxYCWw82nXnnXsrf2LMnLM3r4JFf7omkTaylpSX2pmeWB0TqWt94Xi#vpS$$RARfrAeHZnVcEaP39B9YUKqr9cQXUT3m5rjlEFzokppYzaW#Nl4#svA19XL8Zsys0x53oz4gXm2NPbQerbeP+bPXRx1HzBeSzxpDvhEEi9A6QefVXI4WvMMarHQ#qdZ5TzLpB69xnkrJIZyn3w6kmUUn$m#h7KtubwkkcPWzhwB7GdUUw+6ZW#SomRhpZ#8QKepi16xIcWRUdud6UALXo1CrbgztpCkiYGwy0065WA5JjAwZhHMzFFkmtCpc6Xdm48mTrF5V4NM4MAiqCgQChcS+yDksF3f8WHPFIsMZK$R3VQulX6zfPWXn49RbwpoWN0rZngY+j2cTn#L7HEqRhfbInxxXn1gLz+FQLC093H0pN4d2Fs#pqJUMhR6LcsVQsm#LGthlJu8yWhXyk3KK3H7JT6l1g4s#r06U4mwvr0xYgVmN0$s5szhZMRhEiXZrzby0SD1#iUYh6NhAPUDP25+bq+eAZzWG1vzUIsGqFnh#RpP$fnAP3dvlEf7Vvy#9f8451L$rUnBeq2w5jZQdtEVzNZ0d3N+k#Mr$SZjchJwLotWSg95PNpNC8GrYSQ4Yq9yr5RezsVfKhnhJT0t1giqJ5qqK85Mj$DZ04Q+hFZIiEbCKd#CW#U5N7W6Kyoi$dmvA3MRcgRl1FwfUfkTKHpFK9mDJn4kZwKHXDYe2MHGamR4GzoIJ7BfHMy34rNyeQijXZkvJ1hHkvwlpNS$9jVlQLISI+FbmKkpkJChVjJApGM88zbXBZVKEMHAjRmk4dgjSN8CFBLZiokFviGDjRcg$mjTQ$iLviUGaZZIUwaVNWPvJ2I9Wq8V8da#GMRKRHuRFssDuSuYZnt1BaIMjZZlFpEDKhI6H3GMIihZqr2kbdynpGFLjvykiSySigPyq+ekvu4TLl#bAChR+iIHsE1e21CMF1m53JpksvvShGbfvGbg2YFIfbQHCRaZIZPHNfyAXiWrxt8y1eDX#LrFP2RuAZxzmuuZrYEs0+oKEZzHHJpEizwjaqKRy6jBI6SFzkWuMivE$2RVBtkLGq4bCULLDKNjso#cyaYSLXEF2R8mn3aUw$ECqZEKSJa5RjgR+RcxQPHAD8qzV1gp$BTmxvgDZo298c9UGN6DBst#sWmSFxDw6K3Kmq2x+3wY3kR3+iue+Afw9syiWy5Gn$65$CKHjfndXRUr85Y+YiP2dXpeY+2P4gx4ePNpzucsGvibL05vj#xQ1HJBE#JWNsKzoVucBq#PIPBen5wPMbEwQkd3nydTiEwArfd9YQwrQZJrIdI6rUQX$diGHLJkI423A5ki6IP7aBESuH9Kksxr6g6pZiPnIxzYG63WSX+UUmUxQss0GDxMSThyzjqeFDoi$Udu#cY3f1HZXqFTDYjnpFzdF$ftDgUDs0bB3moJB9MdPh4JPWtvskw5Ut8Mefkp4#UaVRp4VqFrbTBjuhLLIZrC2asKi6YSJxyPoYGquKngY9yoFaVHLTyotarKyWyVdAdltL1vJrXM3GGUIhIX4SYhp5EvTg9VSmD0BeG#p4TFp9VMCXCq6N#KktzKUv2KM1YbhAxn2t6ccWBAijsxTL+KKKLUQBH4XIs448ikteEAYYBuZKwKoZVyUVhzCC0KzbIY7mBlZRxx7xdgYKy4V8l7Iai3k7$S3o7FPT2BpH#c2jBApr1YxUHinoHAljc#r2D$pf0jqMGvGHgyYJFPElTRgcGp0a+jiFjuqjH0gD0QUmPQUGPUY5VqkC1WT9mpcpDUe+yzJSkWVCldtH$kt511GTRMHkcteoRgND78YiqW5KAeQhsr4cifQHkG9SprRkeC047xQIVJ1gaZshsaFVnGXMd3CYqjRdYEw3VHAvcuw0MdtFLbW1glIv08Wkl1BS0cq4vIZX9Sr+NNkZmQx5Ixw6EvnPeIgKt$sUlWfLTJui4dWfNWDyHH0jDFcuVYGi$H8$aEm0+Vyd1fKYnSdqllD3rY7GbEzZjdMbqqu24tYUec+fQgkU6MH5sxCIdb0Vk9nIjArWYh#B+hqbUspYzBm0doeVZKZ2Bhl48n3N38jh4HU2FbdKdjDxSESBj5gTUkJHpVdF0mKlXJjKUR+KIHQsxfZPq1E#XJI8EZ+bgwU4uCS4JHmn0noxFZ4ixe7NSv$9zqPk4pA9nq3ilN2mvqusz+y2Uj04E1GxNRmEr4Bjdn0ajQUYSrBJ$mhGDTQWQQvFQSMpA4Fp6PnXL4EJGj8hWI3IfCj1b4cfV14BnhHubyDUU9bm6pUak$hb523zp+JDh+B6lc5Wn6g4#QJtbh1k4cjwNuVeym#SBN#h+aWkYJzvN8WP6YCq2dFgesyzCuGniZyS4deLcrPdN6GpjMQaZCyMJxd6#HITtKQXfhRyCkdQPyAfYrpT6oET#ywI3CScM8wpF4thUz7NofSI1rNIMUf6NyK1Ek0lfR$4gBdcbGWQhdSXXyE#yxo$QfUb$x5b1YslJYxDx#WR2sTBpu55Z#k9l5zQzWyS0jdpCLJk4X1HnZKqo08im0EmKl1XWwWTtRxItHTUpMpaPjg8laCskIguG$xZYd6rxeBA#HAynA5SS1ENWI#Ffw4TtqfXqPs$xZvx4ZhrDkgMs2JfM32NNnigk2MFYWJ#p8n4bEm97ZYMtTPWDrP#sGqjQBeWmpdYvojmYoRkZnpq84R011zAVYnxDIRFh8mpzYdDQsxLxfbB3e7qlzfSJyihn5ij2qKoU8UZHv0#uXx+ieUu85EFRa6BsKQY1u18ue8gN42GVm1fYMQXFRqUISY5U6fqZ5PiqFc5Dtp5prkg9rvdqtlDCz17vfA#Kx7JoNd7YdBr+NYoY#pFEgl0i6Vslu7AomS2ZSnaRFNa2jTg0FviDmAr4kIzkThboREVBWXVW7BoDZyzE9vgb#kJveW5n6C$3q06wwZsBcnljhhwhNn8cWaMo8MdIHERFJwrg6buRD+glJV0dT9IBnWNBScacL5EPyki#vUE+yGzEL8rkAMdN+P74Ql52iiUYvySS#7F7N6iYhNEUh6oMp+Q+jSZq5X68Mtuv34XSAJ9rcfzpvNnVQzTAhlfPQYWuiXXFi8SKYiRWqGhJVIIi78HJ4TTcUSmQFcLCRq+GsZB$DAqPzYU+nkvJHfeGilqeX15E5DvQly0P2Kn1ZcuLkRxbUcSUtnYHih80wTujdCwq2$xZyhCoGXEmSfJ4sZjHi8VIVvLY0MjdSBRv$rFmyq2roPEA7IcCR3#tCjYI+K9eWgFLK9A1JueQKSQlDo7X9YZKgfIqpHkVXqbmcaqZVLXmVMWPBLdnebHfqy0PIK8PSaThUcjFQ1Efj9atP4w7QJqZxYA91vfCb$$wL67ftul43aI4bFmgVJzM#u8rPk+i52TFQ5lLrkAeAvyvD0nwGvpSfRkEWCbZqaTJJypBBlofkjg1K4WkIaofFfaXF6gpKCzXt+69Xd$89TvWXznk1XB8SlLFLSG7wIX1Xm15YbkCT1+2XGG3KWUXK62MTbYVvM2U#7kukbjBm1leMLUe5lWP$ki#mWBux07#0ERhcVaPLldhIXL6rc3QUoHCcVqhlhdseZHLlhei9ADXl$nRTCUf9w$#oZ39STX0IWlq0gg9cJBBE1Ty4JFlz6SlSWZYkD6UZl5fXqAMwzSHs#hNcx5oUrRRyUHRmzbpKo6B14ekjz2GrS3sjWPymawV7SzUNsj1fUdV$uU$T$2gZ7tF2FU861BxFDcce09FzgqcifHsGgK$bzv9$WvP8ARCUbupTo0064mKwl28ig3KI2b20ulS73viyf$x1$8w$Y0nSXEimHswncsvuGGAh#6GDpxl4KbzfQFQcPt+u#Nbh3$$+W9f#dRRCegY9fv#e9u1+e+d+gFukyVMJLAjqHqpLEalSANXQkVKYlfytKMDZwNzWLEW+l3SmjU+FHHu8XCl9XKSSp20V+UL7pnkiSUTBHZQIa6nyRy1IsCZ+80X3LAFCtCyocP$mYp$hYyz2ar4QLn+5eppT131g5yjpv0ZEPouvlmn845P#paHPypD4jtqkLzvoH6Hy7zIdjSlQBKMiVBsvWKYnFUriLWoKjnWlclDKuG#WG#xwZakAtagsYURS41jYQE8KNZxi#tHw+J2qqY0LMN0u2QlR30p2ukEj+uYS6yYxrFhCU+uur409FBC2B9GWUkfSsdCSnY0dIYqLej0h8CD0jBqdHrgbwcXStsn0FNxIllpgVIqtYi2baAUZzcP3jXwfgY+zn8I4bHcGApKxyxApSo+Q9t6+Y3T2sW1d+rUNm6DghZW0snCug0cMdN5#chKclpHT906vWwNf7S#4w11VBy0vphLyelM6uN1NCPkWKaAMJkN3VGhE8RHLdT83GnELPLnWtFakzv34AtupQULfVlAd+5B1EnAxfH40RfcioYiisPbFLvTAPWypQShyaEa57AICvDySbh#ZRdlmhfhImth66GgecWhgHwZVxyincYwaBmdZVpwP5W#T8yABRYcao6IioLArHXJEprtFouKLaCV5kBhNUIyRogbLAtMwTzIGsqjoo5I6FGti3wNmckwzquSMxaW7Ui8DaVI3v+K2MSg6lQhj9d2#dNys9fgfVQ+23Jl7ztlF#4VIDfgz3Ud6k5kgEhwx8gStwPuDXQNKHeSgS3XWE4nUTgJ$kaasXhN7UyN0d1iSEwrscgzz2bQbR8aI8QcGEcx4JDDiFTMTZ0kKkWCg5xqyRdcpjxyyrHQi$1uXMa1Xo3q6aGsPdoiwoowZWLDXbDfXCx5WJ5HE8CjRxwk#Cx7T2WFmIC2K8GEFQUgbcX9h+ueHvDA9jh0ap1evCTiK1PNG04rXoGnnpHSnaG8kDgYQzvtGG9Vi+KwItivYzieY1wfY$3Whdy1jLtDbif1Klk7wE7ysJ6UXy42lQsG0TcQAm0BcjN55Hx75EyPQN7ks7#S85PAwHTCGGJd1tQ6Vywnzh89d1J1xBjd#qwQSj3t#iW0vSCjro3ESZQbea3RtbrciUac9HtkWUUVkLftDLG#YT6SU7o1LEJ+rIIt8CGHR32RZ1A0g7Uwz2KQcYDImdKtlVKSaVgAR$+aJN5CKCPo5zuQ6AJAp#6CGzpCFDPCcjn3AjecwHNgEkvsWjkW5k16VNuGXHTBGBqCgMK1HSEe6JQJjsfYJ3rPv4fonk+E5VncC8bQjYHl2Xc9fBstW48XK86XsAWKY2ErjUA0c41ZtQpaxkipGnkNJXD0eyW0coMDImVwQHge5zETD4pjSP3jLaga40maQ5QASR0GxGLjMiUUaczduEQ0jKDiEgumxEwxJf0+CUX9Pqm+6xsu6TMpi38kvpS#BJL1CfeK30l4p7St+YTe#vERCd56Tu#zeMRRSWbMaY8MmkZA7EMU9RQyLYjvcB29+ZLTZWJ$L1rhm+WX8CNQhmCdi#cmLzTKYUU#xEX#vZJe7fglr4YMi5hPoe+WnDo#MIW#GVUXE2qTKLmlftzGnyWnD#+DJTkXYn4Q08#PmW91uUoMRXJMsazu6QnW0yaIacDBUwt7Cd+3eTy9iTjZs505$9QtuA8rtrG2E0fjbINU+no1ywJ93Mi2+YiWWFwXjw9FfY$0rSH29LulgWU$#Ho7#HoMHL0DHL1LH8Z4vV9vp98dyDNFxxj97hpKrdYbKEdvP2YgHD3GTsxpx1F#gZke1Yd5eN#plunc6IsFnM9fod8TrfrX8WB02Y8L2a86G3HsXF1FxlV6EkUnCnqCM1#$Gjg+yTboCxPer3WzZQQ9BmxRKRGzdvVFWSGpNDRVXxhk3RXRKbaY+9mVJ#SA$ri8gXQMFetH6ZV4$7eKL5Yuctqf0IPzhRqEfpMVPW5LN3C+nWJcsSzjRj1BgjdY+ts71lekuf038nL77VbElxEYmrZiRDFzU#h#lFLtF##mX7i7tsXjq6cjWWExg4UeNTGSJbUm4Re+JWrvoPgaidv7uoo687N#5naRQvC45V1EE#eiRSxFGrdTfMmsGBcntmJwa++KBW1c1A3IhmIWEtM9Ijn3qjN1NXeMa90YUcbMv28RS8HVd61XZA6RVADdTnzpz8hyuLgTfISmm$ZVJCM8REwd8VuXWG6HQ3vAyVSeeMAawQpel1Btw4DbMtgilloy4PG+EdKVLJk3bc5V8kiQIKsDBbYoGdrhN07I14$6qadxTKmFlAfW0m0VwQTbFD5dku3LYc8I#sSTbxWeifr9$#zPp+7rdlYh9YQ9wipJpj#E9pH4SM$yTCZkIW1j1Sn93n3d7LHizI6eecEgLjuG+fATim519Gr9+qV0$hqZGKPGsQI8XdX3Shs$lHFTcMSWKfUuvr8y8orvp5uZi5z2D14lhNf7G0$MseU7kPR2VPo4VPpgFL0nReeV4Av1$lgY3+HC00MLB39Zeq9nv0v0TYMmi6rTjuQI1n6cDRtVnRV7UMbC2P4geTNaNbseN$JXJLPFsvE#W+D1LIDHGYAURjUDtBsll0i#JZlYwhdxdu1xdgTtJdCPz4emvIFfsU#xNTy01jhVpDRQX98Bb43TddoT#M+2Ri1RwUjaZZ5xusgR6qjvFJBf4vDd5mlXy88cp+varjoLJp+ULNIQoMo68ktSEdxHe5ooYPwy+WAsMrbKkd5ATC3t1kCTB7En0I$zvTCxYxIjHM0jNDgKdCTHXg4Cb8E2QoEeU9hm8019Ba6+DmM88DIxniLzJQUyvJuJcRXd2RbQXqCTiXFQu7MI5cebdevGN683VgK#4CpacTm9sdICeco#6RN25GAxlCNvCvRYtHhXuAgFQJtoJmcxLEIEMh+7HVRk8Z#owljYCi0WrDsGi6FVf0gaP2LCkItjvXmxip#n+fnzAMoIgFacYoDcPACNAEnt8vNiF3FyN0kezAMojUGLlXvLWFrXVozilDjQFT2fyXDmlqq62FJVN1uqqp1uqaoa29sK5tnb0vPsbbXPs7cF8+xtVefZ2+qaZ2+re569rZoaS5RspBE9FZaxzdjmFJdsTEtZDwtJYx#dZRcs6W3ydBup#vLU1PG8uQiPTzNUTLPEJtrTBYRdhIS7w9prXvoIkKXFwdfgMF95hJWxMEvIp5k$JxvIkjVwS2p6Bl8J0VcihooC7j7JpbPBpTRIW2ZFk4V+g81atZU60aaQQNMDDX09bzon5RH9G4bD9LxtC#i$SDZunkd5MZTaJlW6RmoTCY#Lc#avf3pQgGJ6AXMj7ry6D4#PQPGIHeEiZb7SFTiz3YgEPwN2#yQEiu6fpdy0HWGBz4x57QjPtF4Fq14u+nmhulHRqiSymIpxhEpq7EY++jniZ6x+u119$XNXv2xVP4f+uJbaqn4e$XHEIqv6Afr$j6qfX7j3cwtVP38Ecv#qX7Kq32LVuDWupDqByv$yIGEqhqkVa8widXwjY8#JlmusT#syq4rITYRcdm#WbxfHGBxI3ycTaWVHf1AS8cp#cPT9RKx0stgFySw7pF+E4kEkn0GBDf1hqRJZRy+UPLcCN#8kjt+HeN6m0P+Q3oQyFSDjmSaJzeTGHk0Wr7j5H6SQPIbG0ciDzceelgQWDGwRQ+NoxG6KsYcmSntcF1#NEkbEEDkMiD2LC#MkZyt643Dkj7XGHnwcV8UeHwNiDz7H6p#H9e3mWTgjCeL3sUAJIsbjLJ0dE4sX2dgqC$bbB#$JHiPhH88Gki1FU3qED#PJWAVxjZdIS5cwRB+RGS5j5oWrE1ItjzU4#sWG6whrJnWnJGxDh1I$9dz8jJyWB8+MgmdqdlXosUS+Z0RgWCIqozBhzCKQ1nrQiBUnGon#RKDz#A#rDknDBVirH8q0AzK65FJXUSW1SoRKLPjnU2l6dSr655Nukl6dCv$5Kw11s2u74pfr$Jgj9YDE2K9LXVg6rxNxWeZjemRjXA$yIEUS+pg2TzcL+o#yU5xtxHCuDm#bh6j8P8xDb8NdrSoSdQJ9CoiFgULUHvR1MSyQLNAvgezowEcNCeQRgqY8UHk6X3W6oPAEiWI2CQSpTMRzFqqPpmcPKxJyuCBRuw8BEvZHt3MvbRHjLDv9m$R#aIbUutZQgQnrvhTVy$rXJdNs16pY8T9DMSLf6LdkVlF$dafwqJASC2gLFK6$SMqZeLgzZJ$kHKxBGZb#y4KGDlmqcUhx0eGZQxcg5IkEQhhi816Z2fifyS6fLqJjMZu4qEy7sFb1TK1esQFZ0#uNjGf8+u$jyJGkr$sYeI$Rc255$balJB8wP7tAV$Wd9k34I$SE9TMiatFlJHXpUe$Mk5wy8ySnLYkKGV81A9mV8XVnIGsZXz$urFGenrB2+QlrSaPKH7xXf$1Sk#oBepX6JyJqjWs6zhAEv4bIVfMm#b1jLdlgEn0WWXZz7FawlUACqYLEh6RXZeK6Mr5uhqSrFVQFIl8vf67iT18mQT8HbuLPTfy5mT+3ZCC3ZHwDLw3tDBq6kmzoCmXj5yQ10biCxFUCqYawZ7qiRdYr5M9m3lrMPq5qHj14pbcWzYj48YgIdUqaR8HPskr5$+qLjsl75jp9Vb0P2w$RknlPvb+SscjTulz9pUeTWEaL40l8UoLUHyVeDX898w14mpWMFwVRHpb4fno8U1bUFpjKCy7I7FQ+mVmQ3MHzZm2mg19xniYyndjBtm884zuQ8SHD1MrmcNZ7b+rFt9ruz8bWZaYhj2RjH83GPp6NPZH1PpX1PpNN+3VpehyfJ9HH5BqUYLfhnyMt#37M4Tl5hLqKGMGpdVgGig3nEhPLJHg0cT1iUaFz9qihmZdUfRuF#ck2E5dBQ0FWK6T6cU46M9FhJ2rT5bCMk+qohDLy$9AmIer1fhy$LnVPGZU7H8evv8Y5gd$c#vFF$#bXiS$hN1jjPCWhn#2ZMhSoS8pQX#s+i19FjStDaa17Er8ta93n8du6Fi8KytR1AspmTpczi6QctUcnyvpsnNZl3A2X8#fsDFx7xgeJjyd3#bN7lD#Tu5w5bcrWLtif8W3KQG7J+AYype$I+MZTy#M4ucuZZwMz3sMSyin#UMYN$UNp0P0URPe5Zc#pp+9D5ltHeQi0feQNd7zgVrB$y9atSBlJsUhcwwZkKJGzTiyhqx0Zo4$bdm0gU4RllufGzkYtd$sWoFMMMJZbzt77qDShG0M#7ty5TixR80GtIkw8+UKyWt7BldIURLVBChN$qk6p4uCkQ5UiDDmBZJye2hX6j5#AH6pEGGd+11gYYPdFq6JzaP8s076IqrioxCXW##0gcf4uQ9GZNYjuowzMCpTQQRa4z#zbMjMlJfiPs81#esIu9j4uSf9F4v2lzXVUn+Z37pgP5zAHzjX8vvhhyoWegXH5GRi2f4MakGzkRs5TKjFG7h2bcuLgTZYmldGS7cf3v$uN4Z4tCZtvgLW4SdfhM$h5XH7mwzTnBNLb9xuhgIucTW$1pk$TdmGDDn4c$qjkHGJDjUYrKK0IbnwLs#CY79pvRaWKean6csIV3FSntyikRgLp#vMwokRz4uNJ8MZmYl5$y0K5mWsiy947BeJd9rtlYi0vJi+XhDiueLDiE5#xRTLCopGTG4NpMg1SghZohbL+bYnMHTb$pv+r4brkcZJw3nkkyXBymvwS5WCyLwV5MiCE#$SDxlT5FEak2sKfUognHHKiki6HbTiz6xKtw9KB14bz7VH8umucx$HrrR#fw6+$TjyJ39w68Xn85unMa0#7zk$ht7B#PI3f4jrxJ$hVtLe34R7+dfy20N7ehnv4c$gtrxMn8avXiR$id9E68SP8Ll4nfozfs9Y4P8HvkjX#8$g9e514QUJbRPJcbYyVtzFW3sZY#X00f5ZEl0Vn63IYZBZikEGggsx5EGT#gwAzqfJnFX+6+C#wzbgbt#kluBu0RedGz9J5A9AWLY1mNbpXcDWq$FnFny7+XMafbmjLHCVtuCn382cDf66FtsiP6pTjRmgzG$smTr+ZYbYk2TDa1JY5WQhkHNoQ55$KxB3I+GZlxns4671Xckb3mwF40HxnHWiL6UCs0NnrY2KwTd8tFc6qz4CDG8MmtH9NRIVIXB65jiI+Gj0lojI#F7StcfoyYyHg5x7DDEWQsQCe8XXjwCLtRQNbik6KSMd12QyBNUgi4wsyPp3xtWd8kPFVISCcr8t8LzNfU4$L+XMFf65Mkx7HWWL7+pHaRhrQDtyS8Q1kfDugLbaUhwmvUNxkTQPxCFEA8eBUE9eqxNWVuC5LXN0kltamVycHyXzHyTSEbZ7TLGmjB9LMRbF5EI9uTjSzuoV5EM8zep7Gtio9fkcuevy#LBX007LB#iA3jz7t$AH+VNmWFNn7a9N3sh3RNtpM28xGbbZpe0XuyPgGoI0ZpkuYa9MGS$THke3cdrrJptP00HvMfo4crvzLwp+eUAj9MblUQZu6VPAzNISypQeIdW6gtXJYDGdhBfUnpAoEC0yob0lHTjsziZWvMN8pnjSiKXk0eKU68BUt1B31MICsfuX1SNVZhlaQ+CrT9aaB3q+DBj88jzLPaBQ1NnjbhDxbA8sj8xN1VZ1M1KMmaqz#93yXQQ5Nx$kUeBv9joI8eiw+$Dne4fid9LsbHIrXHI+5G$3fy9T1mVdt9GX2ozaxjyW1Yx+LZsc+lhowPmNUiNXJdScJmW4g#afkXH5UKv1JqR71nLx5U2Yz2SSsFCBH7#JKwI5nJV68m17NmV4tUK+iBSaJm0qe7QXkyeRiMkHMNqKvBGNvJ3ehe2C+BRrEogM2KpvDx1eSRzDwtZrche5hebq5R2vzs9QPUcUd32bJXejeu2AiBLl3gYdmMFFaw1n5slWclfp6BTnGWsIiutBkJgU9KHdVSiiIwJbXpzFsCoURSjsfA$VYYtDuhIWLWXodeE+Lajn0QGUXzreUPVWHHE7JBlbhETYHIJrQMgc+GgFf6bbb+ZjZR1kE87IYoyweXSALyGahkyzaj3DHNoxWepd6pyNZ#iwzu2bRpix4dJ2Bs8x6PceyA2CZJAdUF$G3dYCrP0WXZBejAP9mtv#Ti2910FQ#TbgcTTiP#f#SLygabACZVqdoon1eX#S5BTqEUjl8Z9FgFP70VKf1QT4eCfDmcCajX9Gq+RtfsnFietGS7pTNU$UuGx+q83P0d#HZzz4IST9uRyw4Qck0PT6IduLqfDu6qVlnPbrxWKCC5aAMXHcMtyWG#xALWrAElIGrxXADMdysjCUwSILDqnRXptLdmUrXrEpXz7DSXWdY6e4zrXRMyNmV3pSp9JZMpQesSvefYaU3nWGlt5xppY1x1h12pcczlT6QqfSstGq94wxrPX6GtT5wprWelWrWcySeCCzwxeJBHrFCWP6Eb#hu3PBrH3viq5fUmk3LqNKzL#hWTTe4ZljSG$m4pDeJ5xv6SK18lJCKDVJAY3JGGGF2emvMa$KrR$GjY0fSENITbMee5HfIkhh8kMzkwU$wes3EQIflxgSngcZxGamaXJ3fG$PSbPy6vp6D8ig+Q1bNFemkQ4GklBQb2ipQkxRb2CqQlJJi01oFklJSbF#rSFJK5#kiTxd7usnTzZ4aeWrsoceTyUWPJ5#LHk8mFz2eTNVzs49rtc+hYE$cFq1$nz1qjZRGmvXwX9Z4j51D2UXe6lGPsZnF4fRnpL5JnSdSBM#yWqk$JXHLvIrxP9eyoxLvb14mjIXGzIFjmEB4I$36pep28+5Hv7GjP5lgM$8Nj4SLLK9P0UJfxCamsxcmnWKDeekDzZHZ9vinMjlCTr99qTprHuaqPytV2QrT$1WqpYbf9axkhtdzkjleJ6UqCrboWJcqJ8h2VkmkN$LEl0LezhaQ2QfkieGj6qpgAAZUxRRy2BRygMsgfo6HNK7ax0uX5S5NMpS6Z#tRbizyvsM66SpsSwQf3m6wIWkP8x6wTkN+rwptwd7qG7tP4#lbwN#bVdtpaD0SKapd2MhmPFf0LyW9cT$j9ygLofKCr8Xpe0SSiekUvSDbR$iZlSNsru+NimZT8tqFeRlA27a7X9Wu8IhasXAxB7YbRFl$RSrufVQMUso0aW3GrR#IKg$vJeqjzEZDuq0LJGNEZLoxNb6J$m5wMv7+2Bwny36sxuMA176Pw9ENPg41sq49X#w+G+GiT2rD8#JXoMwsewdo#l7vVdtExswiTa0azyy8RrTvp7Ks7PRBvAPgNFM780fXugcMn5WMKyp1sWApnX4SZsmaJV8fP$RhjPf2K$Uryfo+DXwwtTplKa+sj2vTxTzi$kZ9$m1pv3n5R6kWHB4UYRC6LnkRvqlT1CJxjVqbRNmaJxfTDKPR3854rd7DWhb8FgcarL8404lmwvtowzcz$4l236vUdeJnLgJrFrJ9ZD2cPFBUU+pSI0fB+qZxUWz4MKTnRKzH7QAZF7c5kh6r1BcTpq1XkUXJtN01nok6bEWVZf06enagzKY9ywsQ70y6F$VbEiB6jkn9d5bPotea0sf8ruKa457voUgBv1oV5nRnmF$pjidCu3hNkcdTkcidm#ghwsWQL$WHUtv8c3#E1no8FfI4J$PJy7L4UiMoNtaaPgFlTeftTKLH8roQvx1We3+tCe4cPbrlqE+70o2fibQlQJB$72S2ycA8Y0T9pP9eola8eeQ2oNYE3JqAWhMs0JpKenZWpMVrGbZeBBveFxaI$kBhlg1hEW0LSbQzqbMbe$zMJBryv5WMIMskkYciiGHaFlzY0lLXR5mdBK8bsiN7KNLHI0M3yI4aP2ywkHlB+ykD177SWPAJg+DnfVHTvFBwbfJKgQJH$avHunMpxT$EUnmXp+8tdWQtZtGTUHkSHUvNyRdhninJS#ivyNRWcvoWwvbUZPLlyIKKX2fibd0uiJhVaCJoNUpTkz6+iR7oaSacKGI$hSWWSscemZurtPSd$$Bz$Ref+sFxKNlNC$3kka2Tx4f2dVRkCtgCLWkU+Ps66H0weiyG+GfrUc+DfGzR11f222FIp5PJonmctcDwgBx+GwWVSPixE3r$aLii+MWVdIqBWm+fJPuII0fPVUJLM7VnoRpNZLEhY6PSimncbBqXn8rMpmHbWsBG5sjsaal#mi#r8N4nIocDrdZDZPhUSR3fALDaahtbL1rPDKwngc4c+PotmBPeD+TN6yWYcXE9oo+$RM9NkHic2VRZnbAS2AqH#NpzyS7qoMeFYE7$g0yPDBNGr83k9bMoikanB#5fl6vPmwfrJLhHE74dG1X2yWKvj08L0RWcewysIMjbC57eqXLAIxCIQRzwjtoBodMglS7PTufET5l4x0KvQXo51F5bjnXY2D6lB+XYpqXTQJ5ibGmEFB7y9VfAVCwucsqr+we5lNLKhZiAd#5Wnc18Gb89UWFlRJG3kUzK07Eiekw9X6fWk+KJZZGUtoQfy$Vpec9SbValUTQTkEjgoxuRtgHGqXYwlr6FjMdbjNhvSXUvGlFlVRN+2MNYAdnM+tDxWxnDoWvesmPqje0IqhizN8YXTXhVhZaJmApZELQeFUGL#5YRGBJ#t9RS6Fxc6Xbha3e3QVA3sut6FILG0WMKxxHyBqgbgXZCrm5k2$VuyBFQztgVR+Zp+qjfiW21V3gjQkYSn4i4jvoo5A5hQ854wf1P0hK+Pm6LtPFVkchcFRHWcTkp7CHJ8bQ0T1kp#gXIwDs9p0wCpFT2KbmvQ9$#iPyFRI9UnSn1ERwevj6wKFV6qkA2KgWiUfGUyBC3ISJub0XMRiMJkKc3pGKEn9CbguWrQtFC$umu0yXbJvMktH#6GhK4NNLZlK8bS2bnERN2RlIfgEdK23kLI8bnv$Lzn$$KrXGmlGWvAysPisl7NuuNXQc+46UXo533xGb6ogwNqL8vDVVI9+t#$DjHAJrniL1PsFQwu74eE8ng6AGip0Di1dQvv#qVkf6YVL9lSS34T0DuCXQ$LiP7TcCTPfRgllzgXos0oLLzkKbHj2XEz218AqUZ+Ko4j+f25lhieQwvV$MgnwDnCXCfA#8JLEJ$lkWaWeAhr45IEX1crxB9$3gnvtTxNz197$+Df6v+8vu$2aP1CpmGJqYd9Ip0y7Fh3dMv2bRe4bE9CqIvFq3wjWjqU6gWsmhFPusNst6CUqeCxSJ6b6Bql4v0zxFCVKkvdoldYq8YEoNiSoyKvWKPADEl9oq9AsQuMSgmxG1ixHTcVxbI5XwhxF1ilxgV28QlYkJMiUvEpJgSt4tt4mIxJSbFvL$ovQUFy6wAKRb4iz5eUF2rrAAft2K0Ye3x$wX$or+dlwpriGVtEHvEfjFI9Rymlo2IPeI2MSV2YI2Kp7frNZl2YT9MiEFxh9gmbhfbxXYxIiay7Yu+UjyTdn2$qGbl9LzC3iqEuFXsESPigBgXI2JITIkRquhrxR5x#w3Sa3GnEnvEXjElQAyKSTEpRsVtlAoh94oJAWK7GBSj1DwMGyK4KXHh6dVQpzd5hRBiUkyIIXGJeBul3C0uoTy48ybnD2j0aEmdkHvu$mkTfX$+pte+c#HZfTc88#Ft3zjxd5f928eGbnoxuveqy9ftWfHY4Jee+PvvXrwh9+xfXN+77Hvnvbjsvj8v$Nvr3$nclQ9f+MnXjD$4nUN9T1y89q8+sDa6a+unf23roQd$svaWu0$9l+cveEP1p0$+2qJLflC+3$$7P7trze4Ldhffsr3n6hsfK3z5tX$82dfe3vndrR$597X5K97+w3$63ie3$sf#795383uu7nLfGPzK+y6Az$3ZyY$tfPsLgx$41m+ft+YnR7a+64GRo##f3zr79VPvq+2oL3nT2bncpa+dvF5EL7ScPmuWvsz4J10Qfbw1#97oDuaPe$SV1jPt6Emxg8rBoZvf0e8tZ8s6z5TlZNdM+Uxm4Ff#C#r7ZwT1Xv3qUP8b$5hkdqe4AAA=',I=window.DecompressionStream,C=(b,t,d,a)=>(a=atob(b.replace(/\$/g,'/').replace(/#/g,'O')).split('').map(x=>x.charCodeAt(0)),d=I?new Response(new Blob([new Uint8Array(a)]).stream().pipeThrough(new I('gzip'))):(new Zlib.Gunzip(a)).decompress())&&(I?t?d.arrayBuffer():d.text():t?d:new self.TextDecoder('utf-8').decode(d));(I?new Promise(a=>a()):fetch('https://r2.micr.io/gunzip.min.js').then(r=>r.text()).then(js=>Function(js)())).then(()=>(function(){const [_c,_u,_b]=arguments,_css=document.createElement('style');
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
!function(){"undefined"!=typeof window&&((window.__svelte??={}).v??=new Set).add("5");var t={},e=Symbol(),i=(Symbol("filename"),"http://www.w3.org/2000/svg"),r=Array.isArray,s=Array.prototype.indexOf,n=Array.prototype.includes,a=Array.from,o=Object.keys,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,h=Object.getOwnPropertyDescriptors,d=Object.prototype,u=Array.prototype,m=Object.getPrototypeOf,f=Object.isExtensible;function p(t){return"function"==typeof t}var g=()=>{};function v(){var t,e;return{promise:new Promise((i,r)=>{t=i,e=r}),resolve:t,reject:e}}function w(t,e){if(Array.isArray(t))return t;if(void 0===e||!(Symbol.iterator in t))return Array.from(t);const i=[];for(const r of t)if(i.push(r),i.length===e)break;return i}var b=1024,y=2048,k=4096,T=8192,_=32768,x=1<<25,E=65536,S=1<<19,A=1<<25,M=65536,I=1<<21,$=1<<23,P=Symbol("$state"),L=Symbol("legacy props"),C=Symbol(""),R=(Symbol("proxy path"),Symbol("hmr anchor"),new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"}),D=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function F(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function O(t,e,i){throw new Error("https://svelte.dev/e/each_key_duplicate")}function z(t){console.warn("https://svelte.dev/e/hydration_mismatch")}var N,V=!1;function U(t){V=t}function B(e){if(null===e)throw z(),t;return N=e}function W(){return B(Te(N))}function q(e){if(V){if(null!==Te(N))throw z(),t;N=e}}function X(t=1){if(V){for(var e=t,i=N;e--;)i=Te(i);N=i}}function Y(t=!0){for(var e=0,i=N;;){if(8===i.nodeType){var r=i.data;if("]"===r){if(0===e)return i;e-=1}else("["===r||"[!"===r||"["===r[0]&&!isNaN(Number(r.slice(1))))&&(e+=1)}var s=Te(i);t&&i.remove(),i=s}}function G(e){if(!e||8!==e.nodeType)throw z(),t;return e.data}function j(t){return t===this.v}function H(t,e){return t!=t?e==e:t!==e||null!==t&&"object"==typeof t||"function"==typeof t}function Z(t){return!H(t,this.v)}var J=null;function K(t){J=t}function Q(t){return rt("getContext").get(t)}function tt(t,e){return rt("setContext").set(t,e),e}function et(t,e=!1,i){J={p:J,i:!1,c:null,e:null,s:t,x:null,r:ci,l:null}}function it(t){var e=J,i=e.e;if(null!==i)for(var r of(e.e=null,i))ze(r);return void 0!==t&&(e.x=t),e.i=!0,J=e.p,t??{}}function rt(t){return null===J&&F(),J.c??=new Map(function(t){let e=t.p;for(;null!==e;){const t=e.c;if(null!==t)return t;e=e.p}return null}(J)||void 0)}var st=[];function nt(){var t=st;st=[],function(t){for(var e=0;e<t.length;e++)t[e]()}(t)}function at(t){if(0===st.length&&!Mt){var e=st;queueMicrotask(()=>{e===st&&nt()})}st.push(t)}function ot(){for(;st.length>0;)nt()}function ct(t){var e=ci;if(null===e)return ni.f|=$,t;if(!(32768&e.f||4&e.f))throw t;lt(t,e)}function lt(t,e){for(;null!==e;){if(128&e.f){if(!(32768&e.f))throw t;try{return void e.b.error(t)}catch(i){t=i}}e=e.parent}throw t}var ht=-7169;function dt(t,e){t.f=t.f&ht|e}function ut(t){512&t.f||null===t.deps?dt(t,b):dt(t,k)}function mt(t){if(null!==t)for(const e of t)2&e.f&&65536&e.f&&(e.f^=M,mt(e.deps))}function ft(t,e,i){2048&t.f?e.add(t):4096&t.f&&i.add(t),mt(t.deps),dt(t,b)}function pt(t,e,i){if(null==t)return e(void 0),i&&i(void 0),g;const r=$i(()=>t.subscribe(e,i));return r.unsubscribe?()=>r.unsubscribe():r}var gt=[];function vt(t,e=g){let i=null;const r=new Set;function s(e){if(H(t,e)&&(t=e,i)){const e=!gt.length;for(const i of r)i[1](),gt.push(i,t);if(e){for(let t=0;t<gt.length;t+=2)gt[t][0](gt[t+1]);gt.length=0}}}function n(e){s(e(t))}return{set:s,update:n,subscribe:function(a,o=g){const c=[a,o];return r.add(c),1===r.size&&(i=e(s,n)||g),a(t),()=>{r.delete(c),0===r.size&&i&&(i(),i=null)}}}}function wt(t){let e;return pt(t,t=>e=t)(),e}var bt=!1,yt=Symbol();function kt(t,e,i){const r=i[e]??={store:null,source:ae(void 0),unsubscribe:g};if(r.store!==t&&!(yt in i))if(r.unsubscribe(),r.store=t??null,null==t)r.source.v=void 0,r.unsubscribe=g;else{var s=!0;r.unsubscribe=pt(t,t=>{s?r.source.v=t:oe(r.source,t)}),s=!1}return t&&yt in i?wt(t):Ai(r.source)}function Tt(t,e,i){let r=i[e];return r&&r.store!==t&&(r.unsubscribe(),r.unsubscribe=g),t}function _t(){const t={};return[t,function(){Fe(()=>{for(var e in t)t[e].unsubscribe();c(t,yt,{enumerable:!1,value:!0})})}]}var xt=new Set,Et=null,St=null,At=null,Mt=!1,It=!1,$t=null,Pt=null,Lt=0,Ct=1,Rt=class t{id=Ct++;current=new Map;previous=new Map;#t=new Set;#e=new Set;#i=new Set;#r=new Map;#s=new Map;#n=null;#a=[];#o=[];#c=new Set;#l=new Set;#h=new Map;#d=new Set;is_fork=!1;#u=!1;#m=new Set;#f(){return this.is_fork||this.#s.size>0}#p(){for(const i of this.#m)for(const r of i.#s.keys()){for(var t=!1,e=r;null!==e.parent;){if(this.#h.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(t){this.#h.has(t)||this.#h.set(t,{d:[],m:[]}),this.#d.delete(t)}unskip_effect(t,e=t=>this.schedule(t)){var i=this.#h.get(t);if(i){for(var r of(this.#h.delete(t),i.d))dt(r,y),e(r);for(r of i.m)dt(r,k),e(r)}this.#d.add(t)}#g(){if(Lt++>1e3&&(xt.delete(this),function(){try{!function(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}()}catch(t){0,lt(t,At)}}()),!this.#f()){for(const t of this.#c)this.#l.delete(t),dt(t,y),this.schedule(t);for(const t of this.#l)dt(t,k),this.schedule(t)}const e=this.#a;this.#a=[],this.apply();var i=$t=[],r=[],s=Pt=[];for(const t of e)try{this.#v(t,i,r)}catch(o){throw Bt(t),o}if(Et=null,s.length>0){var n=t.ensure();for(const t of s)n.schedule(t)}if($t=null,Pt=null,this.#f()||this.#p()){this.#w(r),this.#w(i);for(const[t,e]of this.#h)Ut(t,e)}else{0===this.#r.size&&xt.delete(this),this.#c.clear(),this.#l.clear();for(const t of this.#t)t(this);this.#t.clear(),Ot(r),Ot(i),this.#n?.resolve()}var a=Et;if(this.#a.length>0){const t=a??=this;t.#a.push(...this.#a.filter(e=>!t.#a.includes(e)))}null!==a&&(xt.add(a),a.#g())}#v(t,e,i){t.f^=b;for(var r=t.first;null!==r;){var s=r.f,n=!!(96&s);if(!(n&&1024&s||8192&s||this.#h.has(r))&&null!==r.fn){n?r.f^=b:4&s?e.push(r):yi(r)&&(16&s&&this.#l.add(r),Ei(r));var a=r.first;if(null!==a){r=a;continue}}for(;null!==r;){var o=r.next;if(null!==o){r=o;break}r=r.parent}}}#w(t){for(var e=0;e<t.length;e+=1)ft(t[e],this.#c,this.#l)}capture(t,i,r=!1){t.v===e||this.previous.has(t)||this.previous.set(t,t.v),8388608&t.f||(this.current.set(t,[i,r]),St?.set(t,i)),this.is_fork||(t.v=i)}activate(){Et=this}deactivate(){Et=null,St=null}flush(){try{It=!0,Et=this,this.#g()}finally{Lt=0,At=null,$t=null,Pt=null,It=!1,Et=null,St=null,ie.clear()}}discard(){for(const t of this.#e)t(this);this.#e.clear(),this.#i.clear(),xt.delete(this)}register_created_effect(t){this.#o.push(t)}#b(){for(const l of xt){var t=l.id<this.id,e=[];for(const[r,[s,n]]of this.current){if(l.current.has(r)){var i=l.current.get(r)[0];if(!t||s===i)continue;l.current.set(r,[s,n])}e.push(r)}var r=[...l.current.keys()].filter(t=>!this.current.has(t));if(0===r.length)t&&l.discard();else if(e.length>0){if(t)for(const t of this.#d)l.unskip_effect(t,t=>{4194320&t.f?l.schedule(t):l.#w([t])});l.activate();var s=new Set,n=new Map;for(var a of e)zt(a,r,s,n);n=new Map;var o=[...l.current.keys()].filter(t=>!this.current.has(t)||this.current.get(t)[0]!==t);for(const t of this.#o)155648&t.f||!Nt(t,o,n)||(4194320&t.f?(dt(t,y),l.schedule(t)):l.#c.add(t));if(l.#a.length>0){for(var c of(l.apply(),l.#a))l.#v(c,[],[]);l.#a=[]}l.deactivate()}}for(const l of xt)l.#m.has(this)&&(l.#m.delete(this),0!==l.#m.size||l.#f()||(l.activate(),l.#g()))}increment(t,e){let i=this.#r.get(e)??0;if(this.#r.set(e,i+1),t){let t=this.#s.get(e)??0;this.#s.set(e,t+1)}}decrement(t,e,i){let r=this.#r.get(e)??0;if(1===r?this.#r.delete(e):this.#r.set(e,r-1),t){let t=this.#s.get(e)??0;1===t?this.#s.delete(e):this.#s.set(e,t-1)}this.#u||i||(this.#u=!0,at(()=>{this.#u=!1,this.flush()}))}transfer_effects(t,e){for(const i of t)this.#c.add(i);for(const i of e)this.#l.add(i);t.clear(),e.clear()}oncommit(t){this.#t.add(t)}ondiscard(t){this.#e.add(t)}on_fork_commit(t){this.#i.add(t)}run_fork_commit_callbacks(){for(const t of this.#i)t(this);this.#i.clear()}settled(){return(this.#n??=v()).promise}static ensure(){if(null===Et){const e=Et=new t;It||(xt.add(Et),Mt||at(()=>{Et===e&&e.flush()}))}return Et}apply(){St=null}schedule(t){if(At=t,!(t.b?.is_pending&&16777228&t.f)||32768&t.f){for(var e=t;null!==e.parent;){var i=(e=e.parent).f;if(!(null===$t||e!==ci||null!==ni&&2&ni.f))return;if(96&i){if(!(1024&i))return;e.f^=b}}this.#a.push(e)}else t.b.defer_effect(t)}};function Dt(t){var e=Mt;Mt=!0;try{var i;for(t&&(null===Et||Et.is_fork||Et.flush(),i=t());;){if(ot(),null===Et)return i;Et.flush()}}finally{Mt=e}}var Ft=null;function Ot(t){var e=t.length;if(0!==e){for(var i=0;i<e;){var r=t[i++];if(!(24576&r.f)&&yi(r)&&(Ft=new Set,Ei(r),null===r.deps&&null===r.first&&null===r.nodes&&null===r.teardown&&null===r.ac&&He(r),Ft?.size>0)){ie.clear();for(const t of Ft){if(24576&t.f)continue;const e=[t];let i=t.parent;for(;null!==i;)Ft.has(i)&&(Ft.delete(i),e.push(i)),i=i.parent;for(let t=e.length-1;t>=0;t--){const i=e[t];24576&i.f||Ei(i)}}Ft.clear()}}Ft=null}}function zt(t,e,i,r){if(!i.has(t)&&(i.add(t),null!==t.reactions))for(const s of t.reactions){const t=s.f;2&t?zt(s,e,i,r):4194320&t&&!(2048&t)&&Nt(s,e,r)&&(dt(s,y),Vt(s))}}function Nt(t,e,i){const r=i.get(t);if(void 0!==r)return r;if(null!==t.deps)for(const s of t.deps){if(n.call(e,s))return!0;if(2&s.f&&Nt(s,e,i))return i.set(s,!0),!0}return i.set(t,!1),!1}function Vt(t){Et.schedule(t)}function Ut(t,e){if(!(32&t.f&&1024&t.f)){2048&t.f?e.d.push(t):4096&t.f&&e.m.push(t),dt(t,b);for(var i=t.first;null!==i;)Ut(i,e),i=i.next}}function Bt(t){dt(t,b);for(var e=t.first;null!==e;)Bt(e),e=e.next}var Wt=class{parent;is_pending=!1;transform_error;#y;#k=V?N:null;#T;#_;#x;#E=null;#S=null;#A=null;#M=null;#I=0;#$=0;#P=!1;#c=new Set;#l=new Set;#L=null;#C=function(t){let e,i=0,r=se(0);return()=>{De()&&(Ai(r),Ve(()=>(0===i&&(e=$i(()=>t(()=>he(r)))),i+=1,()=>{at(()=>{i-=1,0===i&&(e?.(),e=void 0,he(r))})})))}}(()=>(this.#L=se(this.#I),()=>{this.#L=null}));constructor(t,e,i,r){this.#y=t,this.#T=e,this.#_=t=>{var e=ci;e.b=this,e.f|=128,i(t)},this.parent=ci.b,this.transform_error=r??this.parent?.transform_error??(t=>t),this.#x=Be(()=>{if(V){const t=this.#k;W();const e="[!"===t.data;if(t.data.startsWith("[?")){const e=JSON.parse(t.data.slice(2));this.#R(e)}else e?this.#D():this.#F()}else this.#O()},589824),V&&(this.#y=N)}#F(){try{this.#E=qe(()=>this.#_(this.#y))}catch(t){this.error(t)}}#R(t){const e=this.#T.failed;e&&(this.#A=qe(()=>{e(this.#y,()=>t,()=>()=>{})}))}#D(){const t=this.#T.pending;t&&(this.is_pending=!0,this.#S=qe(()=>t(this.#y)),at(()=>{var t=this.#M=document.createDocumentFragment(),e=ye();t.append(e),this.#E=this.#z(()=>qe(()=>this.#_(e))),0===this.#$&&(this.#y.before(t),this.#M=null,Ze(this.#S,()=>{this.#S=null}),this.#N(Et))}))}#O(){try{if(this.is_pending=this.has_pending_snippet(),this.#$=0,this.#I=0,this.#E=qe(()=>{this.#_(this.#y)}),this.#$>0){var t=this.#M=document.createDocumentFragment();ti(this.#E,t);const e=this.#T.pending;this.#S=qe(()=>e(this.#y))}else this.#N(Et)}catch(e){this.error(e)}}#N(t){this.is_pending=!1,t.transfer_effects(this.#c,this.#l)}defer_effect(t){ft(t,this.#c,this.#l)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#T.pending}#z(t){var e=ci,i=ni,r=J;li(this.#x),oi(this.#x),K(this.#x.ctx);try{return Rt.ensure(),t()}catch(s){return ct(s),null}finally{li(e),oi(i),K(r)}}#V(t,e){this.has_pending_snippet()?(this.#$+=t,0===this.#$&&(this.#N(e),this.#S&&Ze(this.#S,()=>{this.#S=null}),this.#M&&(this.#y.before(this.#M),this.#M=null))):this.parent&&this.parent.#V(t,e)}update_pending_count(t,e){this.#V(t,e),this.#I+=t,this.#L&&!this.#P&&(this.#P=!0,at(()=>{this.#P=!1,this.#L&&ce(this.#L,this.#I)}))}get_effect_pending(){return this.#C(),Ai(this.#L)}error(t){if(!this.#T.onerror&&!this.#T.failed)throw t;Et?.is_fork?(this.#E&&Et.skip_effect(this.#E),this.#S&&Et.skip_effect(this.#S),this.#A&&Et.skip_effect(this.#A),Et.on_fork_commit(()=>{this.#U(t)})):this.#U(t)}#U(t){this.#E&&(Ge(this.#E),this.#E=null),this.#S&&(Ge(this.#S),this.#S=null),this.#A&&(Ge(this.#A),this.#A=null),V&&(B(this.#k),X(),B(Y()));var e=this.#T.onerror;let i=this.#T.failed;var r=!1,s=!1;const n=()=>{r?console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"):(r=!0,s&&function(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}(),null!==this.#A&&Ze(this.#A,()=>{this.#A=null}),this.#z(()=>{this.#O()}))},a=r=>{try{s=!0,e?.(r,n),s=!1}catch(t){lt(t,this.#x&&this.#x.parent)}i&&(this.#A=this.#z(()=>{try{return qe(()=>{var t=ci;t.b=this,t.f|=128,i(this.#y,()=>r,()=>n)})}catch(t){return lt(t,this.#x.parent),null}}))};at(()=>{var e;try{e=this.transform_error(t)}catch(i){return void lt(i,this.#x&&this.#x.parent)}null!==e&&"object"==typeof e&&"function"==typeof e.then?e.then(a,t=>lt(t,this.#x&&this.#x.parent)):a(e)})}};function qt(t,e,i,r){const s=Gt;var n=t.filter(t=>!t.settled);if(0!==i.length||0!==n.length){var a=ci,o=function(){var t=ci,e=ni,i=J,r=Et;return function(s=!0){li(t),oi(e),K(i),!s||16384&t.f||(r?.activate(),r?.apply())}}(),c=1===n.length?n[0].promise:n.length>1?Promise.all(n.map(t=>t.promise)):null;if(0!==i.length){var l=Yt();c?c.then(()=>{o(),d(),Xt()}):d()}else c.then(()=>h(e.map(s)))}else r(e.map(s));function h(t){o();try{r(t)}catch(e){16384&a.f||lt(e,a)}Xt()}function d(){Promise.all(i.map(t=>jt(t))).then(t=>h([...e.map(s),...t])).catch(t=>lt(t,a)).finally(()=>l())}}function Xt(t=!0){li(null),oi(null),K(null),t&&Et?.deactivate()}function Yt(){var t=ci,e=t.b,i=Et,r=e.is_rendered();return e.update_pending_count(1,i),i.increment(r,t),(s=!1)=>{e.update_pending_count(-1,i),i.decrement(r,t,s)}}function Gt(t){null!==ci&&(ci.f|=S);const i={ctx:J,deps:null,effects:null,equals:j,f:2050,fn:t,reactions:null,rv:0,v:e,wv:0,parent:ci,ac:null};return i}function jt(t,i,r){let s=ci;null===s&&function(){throw new Error("https://svelte.dev/e/async_derived_orphan")}();var n=void 0,a=se(e);var o=!ni,c=new Map;return function(t){Re(4718592,t)}(()=>{var e=ci;var i=v();n=i.promise;try{Promise.resolve(t()).then(i.resolve,i.reject).finally(Xt)}catch(d){i.reject(d),Xt()}var r=Et;if(o){if(32768&e.f)var l=Yt();if(s.b.is_rendered())c.get(r)?.reject(R),c.delete(r);else{for(const t of c.values())t.reject(R);c.clear()}c.set(r,i)}const h=(t,i=void 0)=>{if(l&&l(i===R),!(i===R||16384&e.f)){if(r.activate(),i)a.f|=$,ce(a,i);else{8388608&a.f&&(a.f^=$),ce(a,t);for(const[t,e]of c){if(c.delete(t),t===r)break;e.reject(R)}0}r.deactivate()}};i.promise.then(h,t=>h(null,t||"unknown"))}),Fe(()=>{for(const t of c.values())t.reject(R)}),new Promise(t=>{!function e(i){function r(){i===n?t(a):e(n)}i.then(r,r)}(n)})}function Ht(t){const e=Gt(t);return di(e),e}function Zt(t){const e=Gt(t);return e.equals=Z,e}function Jt(t){var e=t.effects;if(null!==e){t.effects=null;for(var i=0;i<e.length;i+=1)Ge(e[i])}}function Kt(t){var e,i=ci,r=t.parent;if(!ri&&null!==r&&24576&r.f)return console.warn("https://svelte.dev/e/derived_inert"),t.v;li(r);try{t.f&=-65537,Jt(t),e=Ti(t)}finally{li(i)}return e}function Qt(t){var e=Kt(t);t.equals(e)||(t.wv=bi(),Et?.is_fork&&null!==t.deps||(null!==Et?Et.capture(t,e,!0):t.v=e,null!==t.deps))?ri||(null!==St?(De()||Et?.is_fork)&&St.set(t,e):ut(t)):dt(t,b)}function te(t){if(null!==t.effects)for(const e of t.effects)e.teardown&&Ei(e)}var ee=new Set,ie=new Map;var re=!1;function se(t,e){var i={f:0,v:t,reactions:null,equals:j,rv:0,wv:0};return i}function ne(t,e){const i=se(t);return di(i),i}function ae(t,e=!1,i=!0){const r=se(t);return e||(r.equals=Z),r}function oe(t,e,i=!1){null!==ni&&(!ai||131072&ni.f)&&4325394&ni.f&&(null===hi||!n.call(hi,t))&&function(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}();let r=i?ue(e):e;return ce(t,r,Pt)}function ce(t,e,i=null){if(!t.equals(e)){ie.set(t,ri?e:t.v);var r=Rt.ensure();if(r.capture(t,e),2&t.f){const e=t;2048&t.f&&Kt(e),null===St&&ut(e)}t.wv=bi(),de(t,y,i),null!==ci&&1024&ci.f&&!(96&ci.f)&&(null===fi?function(t){fi=t}([t]):fi.push(t)),!r.is_fork&&ee.size>0&&!re&&le()}return e}function le(){re=!1;for(const t of ee)1024&t.f&&dt(t,k),yi(t)&&Ei(t);ee.clear()}function he(t){oe(t,t.v+1)}function de(t,e,i){var r=t.reactions;if(null!==r)for(var s=r.length,n=0;n<s;n++){var a=r[n],o=a.f;0;var c=0===(o&y);if(c&&dt(a,e),2&o){var l=a;St?.delete(l),65536&o||(512&o&&(a.f|=M),de(l,k,i))}else if(c){var h=a;16&o&&null!==Ft&&Ft.add(h),null!==i?i.push(h):Vt(h)}}}function ue(t){if("object"!=typeof t||null===t||P in t)return t;const i=m(t);if(i!==d&&i!==u)return t;var s=new Map,n=r(t),a=ne(0),o=vi,c=t=>{if(vi===o)return t();var e=ni,i=vi;oi(null),wi(o);var r=t();return oi(e),wi(i),r};n&&s.set("length",ne(t.length));return new Proxy(t,{defineProperty(t,e,i){"value"in i&&!1!==i.configurable&&!1!==i.enumerable&&!1!==i.writable||function(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}();var r=s.get(e);return void 0===r?c(()=>{var t=ne(i.value);return s.set(e,t),t}):oe(r,i.value,!0),!0},deleteProperty(t,i){var r=s.get(i);if(void 0===r){if(i in t){const t=c(()=>ne(e));s.set(i,t),he(a)}}else oe(r,e),he(a);return!0},get(i,r,n){if(r===P)return t;var a=s.get(r),o=r in i;if(void 0!==a||o&&!l(i,r)?.writable||(a=c(()=>{var t=ne(ue(o?i[r]:e));return t}),s.set(r,a)),void 0!==a){var h=Ai(a);return h===e?void 0:h}return Reflect.get(i,r,n)},getOwnPropertyDescriptor(t,i){var r=Reflect.getOwnPropertyDescriptor(t,i);if(r&&"value"in r){var n=s.get(i);n&&(r.value=Ai(n))}else if(void 0===r){var a=s.get(i),o=a?.v;if(void 0!==a&&o!==e)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return r},has(t,i){if(i===P)return!0;var r=s.get(i),n=void 0!==r&&r.v!==e||Reflect.has(t,i);return!((void 0!==r||null!==ci&&(!n||l(t,i)?.writable))&&(void 0===r&&(r=c(()=>{var r=ne(n?ue(t[i]):e);return r}),s.set(i,r)),Ai(r)===e))&&n},set(t,i,r,o){var h=s.get(i),d=i in t;if(n&&"length"===i)for(var u=r;u<h.v;u+=1){var m=s.get(u+"");void 0!==m?oe(m,e):u in t&&(m=c(()=>ne(e)),s.set(u+"",m))}void 0===h?d&&!l(t,i)?.writable||(oe(h=c(()=>ne(void 0)),ue(r)),s.set(i,h)):(d=h.v!==e,oe(h,c(()=>ue(r))));var f=Reflect.getOwnPropertyDescriptor(t,i);if(f?.set&&f.set.call(o,r),!d){if(n&&"string"==typeof i){var p=s.get("length"),g=Number(i);Number.isInteger(g)&&g>=p.v&&oe(p,g+1)}he(a)}return!0},ownKeys(t){Ai(a);var i=Reflect.ownKeys(t).filter(t=>{var i=s.get(t);return void 0===i||i.v!==e});for(var[r,n]of s)n.v===e||r in t||i.push(r);return i},setPrototypeOf(){!function(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}()}})}function me(t){try{if(null!==t&&"object"==typeof t&&P in t)return t[P]}catch{}return t}function fe(t,e){return Object.is(me(t),me(e))}var pe,ge,ve,we;new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function be(){if(void 0===pe){pe=window,document,ge=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,i=Text.prototype;ve=l(e,"firstChild").get,we=l(e,"nextSibling").get,f(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),f(i)&&(i.__t=void 0)}}function ye(t=""){return document.createTextNode(t)}function ke(t){return ve.call(t)}function Te(t){return we.call(t)}function _e(t,e){if(!V)return ke(t);var i=ke(N);if(null===i)i=N.appendChild(ye());else if(e&&3!==i.nodeType){var r=ye();return i?.before(r),B(r),r}return e&&Me(i),B(i),i}function xe(t,e=!1){if(!V){var i=ke(t);return i instanceof Comment&&""===i.data?Te(i):i}if(e){if(3!==N?.nodeType){var r=ye();return N?.before(r),B(r),r}Me(N)}return N}function Ee(t,e=1,i=!1){let r=V?N:t;for(var s;e--;)s=r,r=Te(r);if(!V)return r;if(i){if(3!==r?.nodeType){var n=ye();return null===r?s?.after(n):r.before(n),B(n),n}Me(r)}return B(r),r}function Se(t){t.textContent=""}function Ae(t,e,i){let r=i?{is:i}:void 0;return document.createElementNS(e??"http://www.w3.org/1999/xhtml",t,r)}function Me(t){if(t.nodeValue.length<65536)return;let e=t.nextSibling;for(;null!==e&&3===e.nodeType;)e.remove(),t.nodeValue+=e.nodeValue,e=t.nextSibling}function Ie(t,e){if(e){const e=document.body;t.autofocus=!0,at(()=>{document.activeElement===e&&t.focus()})}}var $e=!1;function Pe(t,e,i,r=!0){for(var s of(r&&i(),e))t.addEventListener(s,i);Fe(()=>{for(var r of e)t.removeEventListener(r,i)})}function Le(t){var e=ni,i=ci;oi(null),li(null);try{return t()}finally{oi(e),li(i)}}function Ce(t){null===ci&&(null===ni&&function(){throw new Error("https://svelte.dev/e/effect_orphan")}(),function(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}()),ri&&function(){throw new Error("https://svelte.dev/e/effect_in_teardown")}()}function Re(t,e){var i=ci;null!==i&&8192&i.f&&(t|=T);var r={ctx:J,deps:null,nodes:null,f:t|y|512,first:null,fn:e,last:null,next:null,parent:i,b:i&&i.b,prev:null,teardown:null,wv:0,ac:null};Et?.register_created_effect(r);var s=r;if(4&t)null!==$t?$t.push(r):Rt.ensure().schedule(r);else if(null!==e){try{Ei(r)}catch(s){throw Ge(r),s}null!==s.deps||null!==s.teardown||null!==s.nodes||s.first!==s.last||524288&s.f||(s=s.first,16&t&&65536&t&&null!==s&&(s.f|=E))}if(null!==s&&(s.parent=i,null!==i&&function(t,e){var i=e.last;null===i?e.last=e.first=t:(i.next=t,t.prev=i,e.last=t)}(s,i),null!==ni&&2&ni.f&&!(64&t))){var n=ni;(n.effects??=[]).push(s)}return r}function De(){return null!==ni&&!ai}function Fe(t){const e=Re(8,null);return dt(e,b),e.teardown=t,e}function Oe(t){Ce();var e=ci.f;if(ni||!(32&e)||32768&e)return ze(t);var i=J;(i.e??=[]).push(t)}function ze(t){return Re(1048580,t)}function Ne(t){return Re(4,t)}function Ve(t,e=0){return Re(8|e,t)}function Ue(t,e=[],i=[],r=[]){qt(r,e,i,e=>{Re(8,()=>t(...e.map(Ai)))})}function Be(t,e=0){var i=Re(16|e,t);return i}function We(t,e=0){var i=Re(16777216|e,t);return i}function qe(t){return Re(524320,t)}function Xe(t){var e=t.teardown;if(null!==e){const t=ri,i=ni;si(!0),oi(null);try{e.call(null)}finally{si(t),oi(i)}}}function Ye(t,e=!1){var i=t.first;for(t.first=t.last=null;null!==i;){const t=i.ac;null!==t&&Le(()=>{t.abort(R)});var r=i.next;64&i.f?i.parent=null:Ge(i,e),i=r}}function Ge(t,e=!0){var i=!1;(e||262144&t.f)&&null!==t.nodes&&null!==t.nodes.end&&(je(t.nodes.start,t.nodes.end),i=!0),dt(t,x),Ye(t,e&&!i),xi(t,0);var r=t.nodes&&t.nodes.t;if(null!==r)for(const n of r)n.stop();Xe(t),t.f^=x,t.f|=16384;var s=t.parent;null!==s&&null!==s.first&&He(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function je(t,e){for(;null!==t;){var i=t===e?null:Te(t);t.remove(),t=i}}function He(t){var e=t.parent,i=t.prev,r=t.next;null!==i&&(i.next=r),null!==r&&(r.prev=i),null!==e&&(e.first===t&&(e.first=r),e.last===t&&(e.last=i))}function Ze(t,e,i=!0){var r=[];Je(t,r,!0);var s=()=>{i&&Ge(t),e&&e()},n=r.length;if(n>0){var a=()=>--n||s();for(var o of r)o.out(a)}else s()}function Je(t,e,i){if(!(8192&t.f)){t.f^=T;var r=t.nodes&&t.nodes.t;if(null!==r)for(const t of r)(t.is_global||i)&&e.push(t);for(var s=t.first;null!==s;){var n=s.next;if(!(64&s.f))Je(s,e,!!(!!(65536&s.f)||!!(32&s.f)&&!!(16&t.f))&&i);s=n}}}function Ke(t){Qe(t,!0)}function Qe(t,e){if(8192&t.f){t.f^=T,1024&t.f||(dt(t,y),Rt.ensure().schedule(t));for(var i=t.first;null!==i;){var r=i.next;Qe(i,!!(!!(65536&i.f)||!!(32&i.f))&&e),i=r}var s=t.nodes&&t.nodes.t;if(null!==s)for(const t of s)(t.is_global||e)&&t.in()}}function ti(t,e){if(t.nodes)for(var i=t.nodes.start,r=t.nodes.end;null!==i;){var s=i===r?null:Te(i);e.append(i),i=s}}var ei=null,ii=!1,ri=!1;function si(t){ri=t}var ni=null,ai=!1;function oi(t){ni=t}var ci=null;function li(t){ci=t}var hi=null;function di(t){null!==ni&&(null===hi?hi=[t]:hi.push(t))}var ui=null,mi=0,fi=null;var pi=1,gi=0,vi=gi;function wi(t){vi=t}function bi(){return++pi}function yi(t){var e=t.f;if(2048&e)return!0;if(2&e&&(t.f&=-65537),4096&e){for(var i=t.deps,r=i.length,s=0;s<r;s++){var n=i[s];if(yi(n)&&Qt(n),n.wv>t.wv)return!0}512&e&&null===St&&dt(t,b)}return!1}function ki(t,e,i=!0){var r=t.reactions;if(null!==r&&(null===hi||!n.call(hi,t)))for(var s=0;s<r.length;s++){var a=r[s];2&a.f?ki(a,e,!1):e===a&&(i?dt(a,y):1024&a.f&&dt(a,k),Vt(a))}}function Ti(t){var e=ui,i=mi,r=fi,s=ni,n=hi,a=J,o=ai,c=vi,l=t.f;ui=null,mi=0,fi=null,ni=96&l?null:t,hi=null,K(t.ctx),ai=!1,vi=++gi,null!==t.ac&&(Le(()=>{t.ac.abort(R)}),t.ac=null);try{t.f|=I;var h=(0,t.fn)();t.f|=_;var d=t.deps,u=Et?.is_fork;if(null!==ui){var m;if(u||xi(t,mi),null!==d&&mi>0)for(d.length=mi+ui.length,m=0;m<ui.length;m++)d[mi+m]=ui[m];else t.deps=d=ui;if(De()&&512&t.f)for(m=mi;m<d.length;m++)(d[m].reactions??=[]).push(t)}else!u&&null!==d&&mi<d.length&&(xi(t,mi),d.length=mi);if(!(null===fi||ai||null===d||6146&t.f))for(m=0;m<fi.length;m++)ki(fi[m],t);if(null!==s&&s!==t){if(gi++,null!==s.deps)for(let t=0;t<i;t+=1)s.deps[t].rv=gi;if(null!==e)for(const t of e)t.rv=gi;null!==fi&&(null===r?r=fi:r.push(...fi))}return 8388608&t.f&&(t.f^=$),h}catch(f){return ct(f)}finally{t.f^=I,ui=e,mi=i,fi=r,ni=s,hi=n,K(a),ai=o,vi=c}}function _i(t,i){let r=i.reactions;if(null!==r){var a=s.call(r,t);if(-1!==a){var o=r.length-1;0===o?r=i.reactions=null:(r[a]=r[o],r.pop())}}if(null===r&&2&i.f&&(null===ui||!n.call(ui,i))){var c=i;512&c.f&&(c.f^=512,c.f&=-65537),c.v!==e&&ut(c),function(t){if(null!==t.effects)for(const e of t.effects)(e.teardown||e.ac)&&(e.teardown?.(),e.ac?.abort(R),e.teardown=g,e.ac=null,xi(e,0),Ye(e))}(c),xi(c,0)}}function xi(t,e){var i=t.deps;if(null!==i)for(var r=e;r<i.length;r++)_i(t,i[r])}function Ei(t){var e=t.f;if(!(16384&e)){dt(t,b);var i=ci,r=ii;ci=t,ii=!0;try{16777232&e?function(t){for(var e=t.first;null!==e;){var i=e.next;32&e.f||Ge(e),e=i}}(t):Ye(t),Xe(t);var s=Ti(t);t.teardown="function"==typeof s?s:null,t.wv=pi}finally{ii=r,ci=i}}}async function Si(){await Promise.resolve(),Dt()}function Ai(t){var e=!!(2&t.f);if(ei?.add(t),null!==ni&&!ai&&!(null!==ci&&16384&ci.f||null!==hi&&n.call(hi,t))){var i=ni.deps;if(2097152&ni.f)t.rv<gi&&(t.rv=gi,null===ui&&null!==i&&i[mi]===t?mi++:null===ui?ui=[t]:ui.push(t));else{(ni.deps??=[]).push(t);var r=t.reactions;null===r?t.reactions=[ni]:n.call(r,ni)||r.push(ni)}}if(ri&&ie.has(t))return ie.get(t);if(e){var s=t;if(ri){var a=s.v;return(1024&s.f||null===s.reactions)&&!Ii(s)||(a=Kt(s)),ie.set(s,a),a}var o=!(512&s.f)&&!ai&&null!==ni&&(ii||!!(512&ni.f)),c=0===(s.f&_);yi(s)&&(o&&(s.f|=512),Qt(s)),o&&!c&&(te(s),Mi(s))}if(St?.has(t))return St.get(t);if(8388608&t.f)throw t.v;return t.v}function Mi(t){if(t.f|=512,null!==t.deps)for(const e of t.deps)(e.reactions??=[]).push(t),2&e.f&&!(512&e.f)&&(te(e),Mi(e))}function Ii(t){if(t.v===e)return!0;if(null===t.deps)return!1;for(const e of t.deps){if(ie.has(e))return!0;if(2&e.f&&Ii(e))return!0}return!1}function $i(t){var e=ai;try{return ai=!0,t()}finally{ai=e}}function Pi(t,e=new Set){if(!("object"!=typeof t||null===t||t instanceof EventTarget||e.has(t))){e.add(t),t instanceof Date&&t.getTime();for(let s in t)try{Pi(t[s],e)}catch(i){}const r=m(t);if(r!==Object.prototype&&r!==Array.prototype&&r!==Map.prototype&&r!==Set.prototype&&r!==Date.prototype){const e=h(r);for(let r in e){const s=e[r].get;if(s)try{s.call(t)}catch(i){}}}}}var Li=Symbol("events"),Ci=new Set,Ri=new Set;function Di(t,e,i,r={}){function s(t){if(r.capture||Ni.call(e,t),!t.cancelBubble)return Le(()=>i?.call(this,t))}return t.startsWith("pointer")||t.startsWith("touch")||"wheel"===t?at(()=>{e.addEventListener(t,s,r)}):e.addEventListener(t,s,r),s}function Fi(t,e,i,r,s){var n={capture:r,passive:s},a=Di(t,e,i,n);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Fe(()=>{e.removeEventListener(t,a,n)})}function Oi(t,e,i){(e[Li]??={})[t]=i}function zi(t){for(var e=0;e<t.length;e++)Ci.add(t[e]);for(var i of Ri)i(t)}function Ni(t){var e=this,i=e.ownerDocument,r=t.type,s=t.composedPath?.()||[],n=s[0]||t.target,a=0,o=t===t&&t[Li];if(o){var l=s.indexOf(o);if(-1!==l&&(e===document||e===window))return void(t[Li]=e);var h=s.indexOf(e);if(-1===h)return;l<=h&&(a=l)}if((n=s[a]||t.target)!==e){c(t,"currentTarget",{configurable:!0,get:()=>n||i});var d=ni,u=ci;oi(null),li(null);try{for(var m,f=[];null!==n;){var p=n.assignedSlot||n.parentNode||n.host||null;try{var g=n[Li]?.[r];null==g||n.disabled&&t.target!==n||g.call(n,t)}catch(v){m?f.push(v):m=v}if(t.cancelBubble||p===e||null===p)break;n=p}if(m){for(let t of f)queueMicrotask(()=>{throw t});throw m}}finally{t[Li]=e,delete t.currentTarget,oi(d),li(u)}}}var Vi=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function Ui(t){var e=Ae("template");return e.innerHTML=function(t){return Vi?.createHTML(t)??t}(t.replaceAll("<!>","\x3c!----\x3e")),e.content}function Bi(t,e){var i=ci;null===i.nodes&&(i.nodes={start:t,end:e,a:null,t:null})}function Wi(t,e){var i,r=!!(1&e),s=!!(2&e),n=!t.startsWith("<!>");return()=>{if(V)return Bi(N,null),N;void 0===i&&(i=Ui(n?t:"<!>"+t),r||(i=ke(i)));var e=s||ge?document.importNode(i,!0):i.cloneNode(!0);r?Bi(ke(e),e.lastChild):Bi(e,e);return e}}function qi(t,e,i="svg"){var r,s=!t.startsWith("<!>"),n=!!(1&e),a=`<${i}>${s?t:"<!>"+t}</${i}>`;return()=>{if(V)return Bi(N,null),N;if(!r){var t=ke(Ui(a));if(n)for(r=document.createDocumentFragment();ke(t);)r.appendChild(ke(t));else r=ke(t)}var e=r.cloneNode(!0);n?Bi(ke(e),e.lastChild):Bi(e,e);return e}}function Xi(t,e){return qi(t,e,"svg")}function Yi(t=""){if(!V){var e=ye(t+"");return Bi(e,e),e}var i=N;return 3!==i.nodeType?(i.before(i=ye()),B(i)):Me(i),Bi(i,i),i}function Gi(){if(V)return Bi(N,null),N;var t=document.createDocumentFragment(),e=document.createComment(""),i=ye();return t.append(e,i),Bi(e,i),t}function ji(t,e){if(V){var i=ci;return 32768&i.f&&null!==i.nodes.end||(i.nodes.end=N),void W()}null!==t&&t.before(e)}function Hi(t){return t.endsWith("capture")&&"gotpointercapture"!==t&&"lostpointercapture"!==t}var Zi=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Ji(t){return Zi.includes(t)}var Ki={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Qi(t){return t=t.toLowerCase(),Ki[t]??t}var tr=["touchstart","touchmove"];function er(t){return tr.includes(t)}var ir=["textarea","script","style","title"];var rr=!0;function sr(t){rr=t}function nr(t,e){var i=null==e?"":"object"==typeof e?`${e}`:e;i!==(t.__t??=t.nodeValue)&&(t.__t=i,t.nodeValue=`${i}`)}function ar(t,e){return lr(t,e)}function or(e,i){be(),i.intro=i.intro??!1;const r=i.target,s=V,n=N;try{for(var a=ke(r);a&&(8!==a.nodeType||"["!==a.data);)a=Te(a);if(!a)throw t;U(!0),B(a);const s=lr(e,{...i,anchor:a});return U(!1),s}catch(o){if(o instanceof Error&&o.message.split("\n").some(t=>t.startsWith("https://svelte.dev/e/")))throw o;return o!==t&&console.warn("Failed to hydrate: ",o),!1===i.recover&&function(){throw new Error("https://svelte.dev/e/hydration_failed")}(),be(),Se(r),U(!1),ar(e,i)}finally{U(s),B(n)}}var cr=new Map;function lr(e,{target:i,anchor:r,props:s={},events:n,context:o,intro:c=!0,transformError:l}){be();var h=void 0,d=function(t){Rt.ensure();const e=Re(524352,t);return(t={})=>new Promise(i=>{t.outro?Ze(e,()=>{Ge(e),i(void 0)}):(Ge(e),i(void 0))})}(()=>{var d=r??i.appendChild(ye());!function(t,e,i,r){new Wt(t,e,i,r)}(d,{pending:()=>{}},i=>{if(et({}),o&&(J.c=o),n&&(s.$$events=n),V&&Bi(i,null),rr=c,h=e(i,s)||{},rr=!0,V&&(ci.nodes.end=N,null===N||8!==N.nodeType||"]"!==N.data))throw z(),t;it()},l);var u=new Set,m=t=>{for(var e=0;e<t.length;e++){var r=t[e];if(!u.has(r)){u.add(r);var s=er(r);for(const t of[i,document]){var n=cr.get(t);void 0===n&&(n=new Map,cr.set(t,n));var a=n.get(r);void 0===a?(t.addEventListener(r,Ni,{passive:s}),n.set(r,1)):n.set(r,a+1)}}}};return m(a(Ci)),Ri.add(m),()=>{for(var t of u)for(const r of[i,document]){var e=cr.get(r),s=e.get(t);0==--s?(r.removeEventListener(t,Ni),e.delete(t),0===e.size&&cr.delete(r)):e.set(t,s)}Ri.delete(m),d!==r&&d.parentNode?.removeChild(d)}});return hr.set(h,d),h}var hr=new WeakMap;function dr(t,e){const i=hr.get(t);return i?(hr.delete(t),i(e)):Promise.resolve()}var ur,mr=class{anchor;#B=new Map;#W=new Map;#q=new Map;#X=new Set;#Y=!0;constructor(t,e=!0){this.anchor=t,this.#Y=e}#b=t=>{if(this.#B.has(t)){var e=this.#B.get(t),i=this.#W.get(e);if(i)Ke(i),this.#X.delete(e);else{var r=this.#q.get(e);r&&(this.#W.set(e,r.effect),this.#q.delete(e),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),i=r.effect)}for(const[e,i]of this.#B){if(this.#B.delete(e),e===t)break;const r=this.#q.get(i);r&&(Ge(r.effect),this.#q.delete(i))}for(const[t,r]of this.#W){if(t===e||this.#X.has(t))continue;const s=()=>{if(Array.from(this.#B.values()).includes(t)){var e=document.createDocumentFragment();ti(r,e),e.append(ye()),this.#q.set(t,{effect:r,fragment:e})}else Ge(r);this.#X.delete(t),this.#W.delete(t)};this.#Y||!i?(this.#X.add(t),Ze(r,s,!1)):s()}}};#G=t=>{this.#B.delete(t);const e=Array.from(this.#B.values());for(const[i,r]of this.#q)e.includes(i)||(Ge(r.effect),this.#q.delete(i))};ensure(t,e){var i=Et;!e||this.#W.has(t)||this.#q.has(t)||this.#W.set(t,qe(()=>e(this.anchor)));this.#B.set(i,t),V&&(this.anchor=N),this.#b(i)}};function fr(t,e,...i){var r=new mr(t);Be(()=>{const t=e()??null;r.ensure(t,t&&(e=>t(e,...i)))},E)}function pr(t){null===J&&F(),Oe(()=>{const e=$i(t);if("function"==typeof e)return e})}function gr(t){null===J&&F(),pr(()=>()=>$i(t))}function vr(t,e,i=!1){var r;V&&(r=N,W());var s=new mr(t);function n(t,e){if(V){var i=G(r);if(t!==parseInt(i.substring(1))){var n=Y();return B(n),s.anchor=n,U(!1),s.ensure(t,e),void U(!0)}}s.ensure(t,e)}Be(()=>{var t=!1;e((e,i=0)=>{t=!0,n(i,e)}),t||n(-1,null)},i?E:0)}function wr(t,e){return e}function br(t,e,i=!0){var r;if(t.pending.size>0){r=new Set;for(const e of t.pending.values())for(const i of e)r.add(t.items.get(i).e)}for(var s=0;s<e.length;s++){var n=e[s];r?.has(n)?(n.f|=A,ti(n,document.createDocumentFragment())):Ge(e[s],i)}}function yr(t,e,i,s,n,o=null){var c=t,l=new Map;if(4&e){var h=t;c=V?B(ke(h)):h.appendChild(ye())}V&&W();var d,u=null,m=Zt(()=>{var t=i();return r(t)?t:null==t?[]:a(t)});var f=new Map,p=!0;function g(t){16384&v.effect.f||(v.pending.delete(t),v.fallback=u,function(t,e,i,r,s){var n,o,c,l,h,d=!!(8&r),u=e.length,m=t.items,f=kr(t.effect.first),p=null,g=[],v=[];if(d)for(h=0;h<u;h+=1)c=s(e[h],h),33554432&(l=m.get(c).e).f||(l.nodes?.a?.measure(),(o??=new Set).add(l));for(h=0;h<u;h+=1){if(c=s(e[h],h),l=m.get(c).e,null!==t.outrogroups)for(const e of t.outrogroups)e.pending.delete(l),e.done.delete(l);if(8192&l.f&&(Ke(l),d&&(l.nodes?.a?.unfix(),(o??=new Set).delete(l))),33554432&l.f){if(l.f^=A,l!==f){var w=p?p.next:f;l===t.effect.last&&(t.effect.last=l.prev),l.prev&&(l.prev.next=l.next),l.next&&(l.next.prev=l.prev),xr(t,p,l),xr(t,l,w),_r(l,w,i),g=[],v=[],f=kr((p=l).next);continue}_r(l,null,i)}if(l!==f){if(void 0!==n&&n.has(l)){if(g.length<v.length){var b,y=v[0];p=y.prev;var k=g[0],T=g[g.length-1];for(b=0;b<g.length;b+=1)_r(g[b],y,i);for(b=0;b<v.length;b+=1)n.delete(v[b]);xr(t,k.prev,T.next),xr(t,p,k),xr(t,T,y),f=y,p=T,h-=1,g=[],v=[]}else n.delete(l),_r(l,f,i),xr(t,l.prev,l.next),xr(t,l,null===p?t.effect.first:p.next),xr(t,p,l),p=l;continue}for(g=[],v=[];null!==f&&f!==l;)(n??=new Set).add(f),v.push(f),f=kr(f.next);if(null===f)continue}33554432&l.f||g.push(l),p=l,f=kr(l.next)}if(null!==t.outrogroups){for(const e of t.outrogroups)0===e.pending.size&&(br(t,a(e.done)),t.outrogroups?.delete(e));0===t.outrogroups.size&&(t.outrogroups=null)}if(null!==f||void 0!==n){var _=[];if(void 0!==n)for(l of n)8192&l.f||_.push(l);for(;null!==f;)8192&f.f||f===t.fallback||_.push(f),f=kr(f.next);var x=_.length;if(x>0){var E=4&r&&0===u?i:null;if(d){for(h=0;h<x;h+=1)_[h].nodes?.a?.measure();for(h=0;h<x;h+=1)_[h].nodes?.a?.fix()}!function(t,e,i){for(var r,s=e.length,n=e.length,o=0;o<s;o++){let i=e[o];Ze(i,()=>{if(r){if(r.pending.delete(i),r.done.add(i),0===r.pending.size){var e=t.outrogroups;br(t,a(r.done)),e.delete(r),0===e.size&&(t.outrogroups=null)}}else n-=1},!1)}if(0===n){var c=null!==i;if(c){var l=i,h=l.parentNode;Se(h),h.append(l),t.items.clear()}br(t,e,!c)}else r={pending:new Set(e),done:new Set},(t.outrogroups??=new Set).add(r)}(t,_,E)}}d&&at(()=>{if(void 0!==o)for(l of o)l.nodes?.a?.apply()})}(v,d,c,e,s),null!==u&&(0===d.length?33554432&u.f?(u.f^=A,_r(u,null,c)):Ke(u):Ze(u,()=>{u=null})))}var v={effect:Be(()=>{var t=(d=Ai(m)).length;let r=!1;V&&"[!"===G(c)!=(0===t)&&(B(c=Y()),U(!1),r=!0);for(var a=new Set,h=Et,v=0;v<t;v+=1){V&&8===N.nodeType&&"]"===N.data&&(c=N,r=!0,U(!1));var w=d[v],b=s(w,v),y=p?null:l.get(b);y?(y.v&&ce(y.v,w),y.i&&ce(y.i,v)):(y=Tr(l,p?c:ur??=ye(),w,b,v,n,e,i),p||(y.e.f|=A),l.set(b,y)),a.add(b)}0===t&&o&&!u&&(p?u=qe(()=>o(c)):(u=qe(()=>o(ur??=ye()))).f|=A),t>a.size&&O(),V&&t>0&&B(Y()),p||(f.set(h,a),g(h)),r&&U(!0),Ai(m)}),flags:e,items:l,pending:f,outrogroups:null,fallback:u};p=!1,V&&(c=N)}function kr(t){for(;null!==t&&!(32&t.f);)t=t.next;return t}function Tr(t,e,i,r,s,n,a,o){var c=1&a?16&a?se(i):ae(i,!1,!1):null,l=2&a?se(s):null;return{v:c,i:l,e:qe(()=>(n(e,c??i,l??s,o),()=>{t.delete(r)}))}}function _r(t,e,i){if(t.nodes)for(var r=t.nodes.start,s=t.nodes.end,n=!e||33554432&e.f?i:e.nodes.start;null!==r;){var a=Te(r);if(n.before(r),r===s)return;r=a}}function xr(t,e,i){null===e?t.effect.first=i:e.next=i,null===i?t.effect.last=e:i.prev=e}function Er(e,r,s=!1,n=!1,a=!1,o=!1){var c=e,l="";if(s){var h=e;V&&(c=B(ke(h)))}Ue(()=>{var e=ci;if(l!==(l=r()??"")){if(s&&!V)return e.nodes=null,h.innerHTML=l,void(""!==l&&Bi(ke(h),h.lastChild));if(null!==e.nodes&&(je(e.nodes.start,e.nodes.end),e.nodes=null),""!==l){if(V){N.data;for(var o=W(),d=o;null!==o&&(8!==o.nodeType||""!==o.data);)d=o,o=Te(o);if(null===o)throw z(),t;return Bi(N,d),void(c=B(o))}var u=Ae(n?"svg":a?"math":"template",n?i:a?"http://www.w3.org/1998/Math/MathML":void 0);u.innerHTML=l;var m=n||a?u:u.content;if(Bi(ke(m),m.lastChild),n||a)for(;ke(m);)c.before(ke(m));else c.before(m)}}else V&&W()})}var Sr=()=>performance.now(),Ar={tick:t=>requestAnimationFrame(t),now:()=>Sr(),tasks:new Set};function Mr(){const t=Ar.now();Ar.tasks.forEach(e=>{e.c(t)||(Ar.tasks.delete(e),e.f())}),0!==Ar.tasks.size&&Ar.tick(Mr)}function Ir(t,e){Le(()=>{t.dispatchEvent(new CustomEvent(e))})}function $r(t){if("float"===t)return"cssFloat";if("offset"===t)return"cssOffset";if(t.startsWith("--"))return t;const e=t.split("-");return 1===e.length?e[0]:e[0]+e.slice(1).map(t=>t[0].toUpperCase()+t.slice(1)).join("")}function Pr(t){const e={},i=t.split(";");for(const r of i){const[t,i]=r.split(":");if(!t||void 0===i)break;e[$r(t.trim())]=i.trim()}return e}var Lr=t=>t;function Cr(t){0}function Rr(t,e,i,r){var s,n,a,o=!!(1&t),c=!!(2&t),l=!!(4&t),h=o&&c?"both":o?"in":"out",d=e.inert,u=e.style.overflow;function m(){return Le(()=>s??=i()(e,r?.()??{},{direction:h}))}var f={is_global:l,in(){if(e.inert=d,!o)return a?.abort(),void a?.reset?.();c||n?.abort(),n=Dr(e,m(),a,1,()=>{Ir(e,"introend"),n?.abort(),n=s=void 0,e.style.overflow=u})},out(t){if(!c)return t?.(),void(s=void 0);e.inert=!0,a=Dr(e,m(),n,0,()=>{Ir(e,"outroend"),t?.()})},stop:()=>{n?.abort(),a?.abort()}},p=ci;if((p.nodes.t??=[]).push(f),o&&rr){var g=l;if(!g){for(var v=p.parent;v&&65536&v.f;)for(;(v=v.parent)&&!(16&v.f););g=!v||!!(32768&v.f)}g&&Ne(()=>{$i(()=>f.in())})}}function Dr(t,e,i,r,s){var n=1===r;if(p(e)){var a,o=!1;return at(()=>{o||(a=Dr(t,e({direction:n?"in":"out"}),i,r,s))}),{abort:()=>{o=!0,a?.abort()},deactivate:()=>a.deactivate(),reset:()=>a.reset(),t:()=>a.t()}}if(i?.deactivate(),!e?.duration&&!e?.delay)return Ir(t,n?"introstart":"outrostart"),s(),{abort:g,deactivate:g,reset:g,t:()=>r};const{delay:c=0,css:l,tick:h,easing:d=Lr}=e;var u=[];if(n&&void 0===i&&(h&&h(0,1),l)){var m=Pr(l(0,1));u.push(m,m)}var f=()=>1-r,v=t.animate(u,{duration:c,fill:"forwards"});return v.onfinish=()=>{v.cancel(),Ir(t,n?"introstart":"outrostart");var a=i?.t()??1-r;i?.abort();var o=r-a,c=e.duration*Math.abs(o),u=[];if(c>0){var m=!1;if(l)for(var p=Math.ceil(c/(1e3/60)),g=0;g<=p;g+=1){var w=a+o*d(g/p),b=Pr(l(w,1-w));u.push(b),m||="hidden"===b.overflow}m&&(t.style.overflow="hidden"),f=()=>{var t=v.currentTime;return a+o*d(t/c)},h&&function(t){let e;0===Ar.tasks.size&&Ar.tick(Mr),new Promise(i=>{Ar.tasks.add(e={c:t,f:i})})}(()=>{if("running"!==v.playState)return!1;var t=f();return h(t,1-t),!0})}(v=t.animate(u,{duration:c,fill:"forwards"})).onfinish=()=>{f=()=>r,h?.(r,1-r),s()}},{abort:()=>{v&&(v.cancel(),v.effect=null,v.onfinish=g)},deactivate:()=>{s=g},reset:()=>{0===r&&h?.(1,0)},t:()=>f()}}function Fr(t,e,r,s,n,a){let o=V;V&&W();var c=null;V&&1===N.nodeType&&(c=N,W());var l=V?N:t,h=ci,d=new mr(l,!1);Be(()=>{const t=e()||null;var a=n?n():r||"svg"===t?i:void 0;return null===t?(d.ensure(null,null),void sr(!0)):(d.ensure(t,e=>{if(t){if(Bi(c=V?c:Ae(t,a),c),s){V&&(r=t,ir.includes(r))&&c.append(document.createComment(""));var i=V?ke(c):c.appendChild(ye());V&&(null===i?U(!1):B(i)),Cr(h),s(c,i),Cr(null)}ci.nodes.end=c,e.before(c)}var r;V&&B(e)}),sr(!0),()=>{t&&sr(!1)})},E),Fe(()=>{sr(!0)}),o&&(U(!0),B(l))}function Or(t,e,i){Ne(()=>{var r=$i(()=>e(t,i?.())||{});if(i&&r?.update){var s=!1,n={};Ve(()=>{var t=i();!function(t){if("object"==typeof t&&t&&!(t instanceof EventTarget))if(P in t)Pi(t);else if(!Array.isArray(t))for(let e in t){const i=t[e];"object"==typeof i&&i&&P in i&&Pi(i)}}(t),s&&H(n,t)&&(n=t,r.update(t))}),s=!0}if(r?.destroy)return()=>r.destroy()})}function zr(t,e){var i,r=void 0;We(()=>{r!==(r=e())&&(i&&(Ge(i),i=null),r&&(i=qe(()=>{Ne(()=>r(t))})))})}function Nr(t){var e,i,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(i=Nr(t[e]))&&(r&&(r+=" "),r+=i)}else for(i in t)t[i]&&(r&&(r+=" "),r+=i);return r}function Vr(t){return"object"==typeof t?function(){for(var t,e,i=0,r="",s=arguments.length;i<s;i++)(t=arguments[i])&&(e=Nr(t))&&(r&&(r+=" "),r+=e);return r}(t):t??""}var Ur=[..." \t\n\r\f \v\ufeff"];function Br(t,e=!1){var i=e?" !important;":";",r="";for(var s of Object.keys(t)){var n=t[s];null!=n&&""!==n&&(r+=" "+s+": "+n+i)}return r}function Wr(t){return"-"!==t[0]||"-"!==t[1]?t.toLowerCase():t}function qr(t,e,i,r,s,n){var a=t.__className;if(V||a!==i||void 0===a){var o=function(t,e,i){var r=null==t?"":""+t;if(e&&(r=r?r+" "+e:e),i)for(var s of Object.keys(i))if(i[s])r=r?r+" "+s:s;else if(r.length)for(var n=s.length,a=0;(a=r.indexOf(s,a))>=0;){var o=a+n;0!==a&&!Ur.includes(r[a-1])||o!==r.length&&!Ur.includes(r[o])?a=o:r=(0===a?"":r.substring(0,a))+r.substring(o+1)}return""===r?null:r}(i,r,n);V&&o===t.getAttribute("class")||(null==o?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o)),t.__className=i}else if(n&&s!==n)for(var c in n){var l=!!n[c];null!=s&&l===!!s[c]||t.classList.toggle(c,l)}return n}function Xr(t,e={},i,r){for(var s in i){var n=i[s];e[s]!==n&&(null==i[s]?t.style.removeProperty(s):t.style.setProperty(s,n,r))}}function Yr(t,e,i,r){var s=t.__style;if(V||s!==e){var n=function(t,e){if(e){var i,r,s="";if(Array.isArray(e)?(i=e[0],r=e[1]):i=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var n=!1,a=0,o=!1,c=[];i&&c.push(...Object.keys(i).map(Wr)),r&&c.push(...Object.keys(r).map(Wr));var l=0,h=-1;const e=t.length;for(var d=0;d<e;d++){var u=t[d];if(o?"/"===u&&"*"===t[d-1]&&(o=!1):n?n===u&&(n=!1):"/"===u&&"*"===t[d+1]?o=!0:'"'===u||"'"===u?n=u:"("===u?a++:")"===u&&a--,!o&&!1===n&&0===a)if(":"===u&&-1===h)h=d;else if(";"===u||d===e-1){if(-1!==h){var m=Wr(t.substring(l,h).trim());c.includes(m)||(";"!==u&&d++,s+=" "+t.substring(l,d).trim()+";")}l=d+1,h=-1}}}return i&&(s+=Br(i)),r&&(s+=Br(r,!0)),""===(s=s.trim())?null:s}return null==t?null:String(t)}(e,r);V&&n===t.getAttribute("style")||(null==n?t.removeAttribute("style"):t.style.cssText=n),t.__style=e}else r&&(Array.isArray(r)?(Xr(t,i?.[0],r[0]),Xr(t,i?.[1],r[1],"important")):Xr(t,i,r));return r}function Gr(t,e,i=!1){if(t.multiple){if(null==e)return;if(!r(e))return void console.warn("https://svelte.dev/e/select_multiple_invalid_value");for(var s of t.options)s.selected=e.includes(jr(s))}else{for(s of t.options)if(fe(jr(s),e))return void(s.selected=!0);i&&void 0===e||(t.selectedIndex=-1)}}function jr(t){return"__value"in t?t.__value:t.value}var Hr=Symbol("class"),Zr=Symbol("style"),Jr=Symbol("is custom element"),Kr=Symbol("is html"),Qr=D?"link":"LINK",ts=D?"input":"INPUT",es=D?"option":"OPTION",is=D?"select":"SELECT",rs=D?"progress":"PROGRESS";function ss(t){if(V){var e=!1,i=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var i=t.value;as(t,"value",null),t.value=i}if(t.hasAttribute("checked")){var r=t.checked;as(t,"checked",null),t.checked=r}}};t.__on_r=i,at(i),$e||($e=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{if(!t.defaultPrevented)for(const e of t.target.elements)e.__on_r?.()})},{capture:!0}))}}function ns(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function as(t,e,i,r){var s=ls(t);V&&(s[e]=t.getAttribute(e),"src"===e||"srcset"===e||"href"===e&&t.nodeName===Qr)||s[e]!==(s[e]=i)&&("loading"===e&&(t[C]=i),null==i?t.removeAttribute(e):"string"!=typeof i&&ds(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function os(t,e,i){var r=ni,s=ci;let n=V;V&&U(!1),oi(null),li(null);try{"style"!==e&&(hs.has(t.getAttribute("is")||t.nodeName)||!customElements||customElements.get(t.getAttribute("is")||t.nodeName.toLowerCase())?ds(t).includes(e):i&&"object"==typeof i)?t[e]=i:as(t,e,null==i?i:String(i))}finally{oi(r),li(s),n&&U(!0)}}function cs(t,i,r=[],s=[],n=[],a,o=!1,c=!1){qt(n,r,s,r=>{var s=void 0,n={},l=t.nodeName===is,h=!1;if(We(()=>{var d=i(...r.map(Ai)),u=function(t,i,r,s,n=!1){if(V&&n&&t.nodeName===ts){var a=t;("checkbox"===a.type?"defaultChecked":"defaultValue")in r||ss(a)}var o=ls(t),c=o[Jr],l=!o[Kr];let h=V&&c;h&&U(!1);var d=i||{},u=t.nodeName===es;for(var m in i)m in r||(r[m]=null);r.class?r.class=Vr(r.class):(s||r[Hr])&&(r.class=null),r[Zr]&&(r.style??=null);var f=ds(t);for(const k in r){let T=r[k];if(u&&"value"===k&&null==T)t.value=t.__value="",d[k]=T;else if("class"!==k)if("style"!==k){var p=d[k];if(T!==p||void 0===T&&t.hasAttribute(k)){d[k]=T;var g=k[0]+k[1];if("$$"!==g)if("on"===g){const _={},x="$$"+k;let E=k.slice(2);var v=Ji(E);if(Hi(E)&&(E=E.slice(0,-7),_.capture=!0),!v&&p){if(null!=T)continue;t.removeEventListener(E,d[x],_),d[x]=null}if(v)Oi(E,t,T),zi([E]);else if(null!=T){function w(t){d[k].call(this,t)}d[x]=Di(E,t,w,_)}}else if("style"===k)as(t,k,T);else if("autofocus"===k)Ie(t,Boolean(T));else if(c||"__value"!==k&&("value"!==k||null==T))if("selected"===k&&u)ns(t,T);else{var b=k;l||(b=Qi(b));var y="defaultValue"===b||"defaultChecked"===b;if(null!=T||c||y)y||f.includes(b)&&(c||"string"!=typeof T)?(t[b]=T,b in o&&(o[b]=e)):"function"!=typeof T&&as(t,b,T);else if(o[k]=null,"value"===b||"checked"===b){let S=t;const A=void 0===i;if("value"===b){let M=S.defaultValue;S.removeAttribute(b),S.defaultValue=M,S.value=S.__value=A?M:null}else{let I=S.defaultChecked;S.removeAttribute(b),S.defaultChecked=I,S.checked=!!A&&I}}else t.removeAttribute(k)}else t.value=t.__value=T}}else Yr(t,T,i?.[Zr],r[Zr]),d[k]=T,d[Zr]=r[Zr];else qr(t,"http://www.w3.org/1999/xhtml"===t.namespaceURI,T,s,i?.[Hr],r[Hr]),d[k]=T,d[Hr]=r[Hr]}return h&&U(!0),d}(t,s,d,a,o,c);h&&l&&"value"in d&&Gr(t,d.value);for(let t of Object.getOwnPropertySymbols(n))d[t]||Ge(n[t]);for(let e of Object.getOwnPropertySymbols(d)){var m=d[e];"@attach"!==e.description||s&&m===s[e]||(n[e]&&Ge(n[e]),n[e]=qe(()=>zr(t,()=>m))),u[e]=m}s=u}),l){var d=t;Ne(()=>{Gr(d,s.value,!0),function(t){var e=new MutationObserver(()=>{Gr(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Fe(()=>{e.disconnect()})}(d)})}h=!0})}function ls(t){return t.__attributes??={[Jr]:t.nodeName.includes("-"),[Kr]:"http://www.w3.org/1999/xhtml"===t.namespaceURI}}var hs=new Map;function ds(t){var e,i=t.getAttribute("is")||t.nodeName,r=hs.get(i);if(r)return r;hs.set(i,r=[]);for(var s=t,n=Element.prototype;n!==s;){for(var a in e=h(s))e[a].set&&r.push(a);s=m(s)}return r}function us(t,e,i=e){var r,s,n=()=>{cancelAnimationFrame(r),t.paused||(r=requestAnimationFrame(n));var e=t.currentTime;s!==e&&i(s=e)};r=requestAnimationFrame(n),t.addEventListener("timeupdate",n),Ve(()=>{var i=Number(e());s===i||isNaN(i)||(t.currentTime=s=i)}),Fe(()=>{cancelAnimationFrame(r),t.removeEventListener("timeupdate",n)})}function ms(t,e){Pe(t,["seeking","seeked"],()=>e(t.seeking))}function fs(t,e,i=e){var r=e();Pe(t,["play","pause","canplay"],()=>{r!==t.paused&&i(r=t.paused)},null==r),Ne(()=>{(r=!!e())!==t.paused&&(r?t.pause():t.play().catch(t=>{throw i(r=!0),t}))})}function ps(t,e){return t===e||t?.[P]===e}function gs(t={},e,i,r){var s=J.r,n=ci;return Ne(()=>{var a,o;return Ve(()=>{a=o,o=r?.()||[],$i(()=>{t!==i(...o)&&(e(t,...o),a&&ps(i(...a),t)&&e(null,...a))})}),()=>{let r=n;for(;r!==s&&null!==r.parent&&33554432&r.parent.f;)r=r.parent;const a=r.teardown;r.teardown=()=>{o&&ps(i(...o),t)&&e(null,...o),a?.()}}}),t}function vs(t,e,i,r,s){var n=()=>{r(i[t])};i.addEventListener(e,n),s?Ve(()=>{i[t]=s()}):n(),i!==document.body&&i!==window&&i!==document||Fe(()=>{i.removeEventListener(e,n)})}var ws={get(t,e){let i=t.props.length;for(;i--;){let r=t.props[i];if(p(r)&&(r=r()),"object"==typeof r&&null!==r&&e in r)return r[e]}},set(t,e,i){let r=t.props.length;for(;r--;){let s=t.props[r];p(s)&&(s=s());const n=l(s,e);if(n&&n.set)return n.set(i),!0}return!1},getOwnPropertyDescriptor(t,e){let i=t.props.length;for(;i--;){let r=t.props[i];if(p(r)&&(r=r()),"object"==typeof r&&null!==r&&e in r){const t=l(r,e);return t&&!t.configurable&&(t.configurable=!0),t}}},has(t,e){if(e===P||e===L)return!1;for(let i of t.props)if(p(i)&&(i=i()),null!=i&&e in i)return!0;return!1},ownKeys(t){const e=[];for(let i of t.props)if(p(i)&&(i=i()),i){for(const t in i)e.includes(t)||e.push(t);for(const t of Object.getOwnPropertySymbols(i))e.includes(t)||e.push(t)}return e}};function bs(...t){return new Proxy({props:t},ws)}function ys(t,e,i,r){var s=!!(8&i),n=!!(16&i),a=r,o=!0,c=()=>(o&&(o=!1,a=n?$i(r):r),a);let h;if(s){var d=P in t||L in t;h=l(t,e)?.set??(d&&e in t?i=>t[e]=i:void 0)}var u,m,f=!1;if(s?[u,f]=function(t){var e=bt;try{return bt=!1,[t(),bt]}finally{bt=e}}(()=>t[e]):u=t[e],void 0===u&&void 0!==r&&(u=c(),h&&(function(){throw new Error("https://svelte.dev/e/props_invalid_value")}(),h(u))),m=()=>{var i=t[e];return void 0===i?c():(o=!0,i)},!(4&i))return m;if(h){var p=t.$$legacy;return function(t,e){return arguments.length>0?((!e||p||f)&&h(e?m():t),t):m()}}var g=!1,v=(1&i?Gt:Zt)(()=>(g=!1,m()));s&&Ai(v);var w=ci;return function(t,e){if(arguments.length>0){const i=e?Ai(v):s?ue(t):t;return oe(v,i),g=!0,void 0!==a&&(a=i),t}return ri&&g||16384&w.f?v.v:Ai(v)}}var ks=class{#j;#H;constructor(t){var e=new Map,i=(t,i)=>{var r=ae(i,!1,!1);return e.set(t,r),r};const r=new Proxy({...t.props||{},$$events:{}},{get:(t,r)=>Ai(e.get(r)??i(r,Reflect.get(t,r))),has:(t,r)=>r===L||(Ai(e.get(r)??i(r,Reflect.get(t,r))),Reflect.has(t,r)),set:(t,r,s)=>(oe(e.get(r)??i(r,s),s),Reflect.set(t,r,s))});this.#H=(t.hydrate?or:ar)(t.component,{target:t.target,anchor:t.anchor,props:r,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),t?.props?.$$host&&!1!==t.sync||Dt(),this.#j=r.$$events;for(const s of Object.keys(this.#H))"$set"!==s&&"$destroy"!==s&&"$on"!==s&&c(this,s,{get(){return this.#H[s]},set(t){this.#H[s]=t},enumerable:!0});this.#H.$set=t=>{Object.assign(r,t)},this.#H.$destroy=()=>{dr(this.#H)}}$set(t){this.#H.$set(t)}$on(t,e){this.#j[t]=this.#j[t]||[];const i=(...t)=>e.call(this,...t);return this.#j[t].push(i),()=>{this.#j[t]=this.#j[t].filter(t=>t!==i)}}$destroy(){this.#H.$destroy()}};function Ts(t,e,i,r){const s=i[t]?.type;if(e="Boolean"===s&&"boolean"!=typeof e?null!=e:e,!r||!i[t])return e;if("toAttribute"===r)switch(s){case"Object":case"Array":return null==e?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return null==e?null:e;default:return e}else switch(s){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return null!=e?+e:e}}"function"==typeof HTMLElement&&HTMLElement;var _s="E001",xs="E002",Es="E003",Ss="E004",As="E005",Ms="E100",Is="E101",$s="E102",Ps="E103",Ls="E200",Cs="E201",Rs="E202",Ds="E203",Fs="E300",Os="E301",zs="E302",Ns="E303",Vs="E999",Us={[_s]:"You appear to be offline. Please check your internet connection and try again.",[xs]:"The connection timed out. Please try again.",[Es]:"Unable to load content due to security restrictions.",[Ss]:"The requested image or content could not be found.",[As]:"The server encountered an error. Please try again later.",[Ms]:"Your browser does not support WebGL, which is required to view this content. Please try a different browser.",[Is]:"The graphics context was lost. The page will attempt to recover.",[$s]:"There was a problem initializing the graphics. Please try refreshing the page.",[Ps]:"Your device is low on memory. Try closing other browser tabs or applications.",[Ls]:"The image data appears to be invalid or corrupted.",[Cs]:"The requested content could not be loaded.",[Rs]:"There was a problem processing the image information.",[Ds]:"This image uses an unsupported format version.",[Fs]:"Failed to load the image viewer engine. Please try refreshing the page.",[Os]:"An error occurred in the image viewer. Please try refreshing the page.",[zs]:"Failed to load the image. Please try again.",[Ns]:"Failed to load the tour. Some features may be unavailable.",[Vs]:"An unexpected error occurred. Please try refreshing the page."},Bs=class t extends Error{constructor(e,i){super(e),this.name="MicrioError",this.code=i?.code??Vs,this.displayMessage=i?.displayMessage??Us[this.code],this.cause=i?.cause,this.statusCode=i?.statusCode,"captureStackTrace"in Error&&"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t)}static fromResponse(e,i){const r=e.status;let s=Vs;return 404===r?s=Ss:r>=500&&r<600?s=As:0===r?s=_s:408!==r&&504!==r||(s=xs),new t(`${i?i+": ":""}HTTP ${r}`,{code:s,statusCode:r})}static fromError(e,i){const r=e.message.toLowerCase();let s=Vs;return r.includes("network")||r.includes("internet")||r.includes("offline")?s=_s:r.includes("timeout")?s=xs:r.includes("cors")||r.includes("cross-origin")?s=Es:r.includes("webgl")||r.includes("webglcontext")?s=Ms:r.includes("memory")||r.includes("out of memory")?s=Ps:(r.includes("wasm")||r.includes("webassembly"))&&(s=Fs),new t(`${i?i+": ":""}${e.message}`,{code:s,cause:e})}},Ws=(t,e=1)=>(t%e+e)%e,qs=t=>JSON.parse(JSON.stringify(t));function Xs(t,e,i={}){if(!t||"object"!=typeof t)return e;for(const r in t){const s=t[r];if(s&&"object"==typeof s&&Object.getPrototypeOf(s)===Object.prototype){const t=e;t[r]&&"object"==typeof t[r]||(t[r]={}),Xs(s,t[r],i)}else{const t=e;i.mergeArrays&&t[r]instanceof Array&&s instanceof Array?t[r].push(...s):i.noOverwrite&&r in e||(t[r]=s)}}return e}var Ys=()=>Math.floor(65536*(1+Math.random())).toString(16).substring(1),Gs=()=>Ys()+Ys()+"-"+Ys()+"-"+Ys()+"-"+Ys()+"-"+Ys()+Ys()+Ys(),js=t=>{if(void 0===t)return t;t=(t=t.replace(/^\s+|\s+$/g,"")).toLowerCase();for(let e=0,i=28;e<i;e++)t=t.replace(new RegExp("àáäâèéëêìíïîòóöôùúüûñç·/_,:;".charAt(e),"g"),"aaaaeeeeiiiioooouuuunc------".charAt(e));return t=t.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")};function Hs(t){const e=t<0;e&&(t=-t);const i=Math.ceil(t),r=Math.floor(i/3600),s=Math.floor(i%3600/60),n=i%60,a=t=>t<10?"0"+t:""+t;return(e?"-":"")+(r?r+":"+a(s):""+s)+":"+a(n)}var Zs=navigator.userAgent,Js={iOS:/ipad|iphone|ipod/i.test(Zs),firefox:/firefox/i.test(Zs),OSX:/macintosh/i.test(Zs)&&/os\ x/i.test(Zs),hasTouch:"TouchEvent"in self,safari:!1};Js.safari=(Js.OSX||Js.iOS)&&(/safari/i.test(Zs)||/instagram/i.test(Zs))&&!/chrome/i.test(Zs),Js.OSX&&Js.safari&&"TouchEvent"in self&&(Js.iOS=!0,Js.OSX=!1);var Ks=t=>new Promise(e=>t?setTimeout(e,t):e()),Qs=[],tn=(t,e,i)=>new Promise((r,s)=>{if(i||Qs.includes(t))return r();const n=document.createElement("script"),a=()=>{Qs.push(t),r()};e?self[e]=a:n.onload=a,n.onerror=()=>s&&s(),n.async=!0,n.defer=!0,self.crossOriginIsolated&&(n.crossOrigin="anonymous"),n.src=t,document.head.appendChild(n)}),en=(t,e={})=>new Promise(i=>{let r,s=!0;r=t.subscribe(t=>{s&&e.allowUndefined&&void 0===t||(s=!1,(void 0!==e.targetValue?t===e.targetValue:e.allowUndefined||void 0!==t)&&(r?r():Si().then(()=>r()),i(t)))})}),rn=new WeakSet,sn={fromLegacy:t=>{if(!t)return;if(rn.has(t))return t;const e=[t[0],t[1],t[2]-t[0],t[3]-t[1]];return rn.add(t),e},toCenterJSON:t=>({centerX:t[0]+t[2]/2,centerY:t[1]+t[3]/2,width:t[2],height:t[3]}),rectToCenterJSON:t=>sn.toCenterJSON([t[0],t[1],t[2]-t[0],t[3]-t[1]])},nn={"micrio-cdn.azureedge.net":"micrio.vangoghmuseum.nl/micrio","micrio-cdn.vangoghmuseum.nl":"micrio.vangoghmuseum.nl/micrio","rijks-micrio.azureedge.net":"micrio.rijksmuseum.nl"},an=t=>{if(t instanceof Object&&"fileUrl"in t&&!t.src&&(t.src=t.fileUrl),t?.src)for(let e in nn)t.src.includes(e)&&(t.src=t.src.replace(e,nn[e]))},on=t=>!t.viewsWH,cn=new WeakMap,ln=t=>{an(t.image),t.children?.forEach(ln)},hn=new WeakSet,dn=(t,e,i,r)=>{if(hn.has(t))return;hn.add(t),t.data||(t.data={}),t.id||(t.id=Gs()),t.tags||(t.tags=[]),"type"in t||(t.type="default"),t.popupType||(t.popupType="popup"),"string"==typeof t.data.icon&&(t.data.icon={title:"",size:0,uploaded:0,width:-1,height:-1,src:t.data.icon}),t.images?.forEach(an),an(t.positionalAudio),an(t.data?.icon),Object.values(t.i18n??{}).forEach(t=>an(t.audio));const s="embedImages"in t?t.embedImages:void 0;s&&s.forEach(t=>an(t));const n=t.data?._meta?.secondary;n&&(t.data.micrioSplitLink=n),i&&"class"in t&&(t.tags??=[]).push(...t.class.split(" ").map(t=>t.trim()).filter(e=>!!e&&!t.tags.includes(e))),t.tags?.includes("default")&&(t.type="default"),r&&(t.view=sn.fromLegacy(t.view),un(t.videoTour))};function un(t){if(!t||!("i18n"in t)&&!("timeline"in t))return;const e="i18n"in t?t.i18n:{en:t};for(const i in e)e[i]?.timeline.forEach(t=>t.rect=sn.fromLegacy(t.rect))}var mn=new Map,fn=new Map,pn=new Map,gn=async(t,e)=>{if(!e&&mn.has(t))return qs(mn.get(t));if(fn.has(t))return fn.get(t);if(pn.has(t))throw pn.get(t)[1];const i=fetch(t+(e?(t.includes("?")?"&":"?")+Math.random():"")).then(async e=>{if(200==e.status)return e.json();{const i=Bs.fromResponse(e,`fetchJson(${t})`);throw pn.set(t,[e.status,i.message]),i}}).then(i=>(e||mn.set(t,i),fn.delete(t),qs(i))).catch(e=>{throw fn.delete(t),e});return fn.set(t,i),i},vn=t=>"MICRIO_DATA"in self?(self?.MICRIO_DATA).find(e=>e[0]==t):void 0,wn=(t,e,i)=>{const r=vn(t)?.[1];return r?Promise.resolve(r):gn(`${e??"https://i.micr.io/"}${t}/info.json`,i).then(t=>{var e;return t&&("Height"in t&&(t.height=t.Height,t.version=1,t.tileSize=512),"Width"in t&&(t.width=t.Width)),(e=t)&&(cn.has(e)||(an(e.organisation?.logo),an(e.settings?._markers?.markerIcon),e.settings?._markers?.customIcons?.forEach(an),an(e.settings?._360?.video),e?.settings&&on(e)&&(e.settings.view=sn.fromLegacy(e.settings.view),e.settings.restrict=sn.fromLegacy(e.settings.restrict)),cn.set(e,!0))),t})};async function bn(t,e,i,r){if(!("steps"in e)||e.stepInfo)return;const s=[...new Set(e.steps.map(t=>t.split(",")[1]).filter(e=>!!e&&e!=t.id))],[n,a]=await Promise.all([Promise.all(s.map(e=>gn((e=>t.dataPath+(t.isV5?e+"/data/pub.json":e+"/data."+i+".json"))(e)))),Promise.all(s.map(t=>wn(t)))]);n.forEach((e,r)=>{const s=on(a[r]);e?.markers?.forEach(e=>dn(e,i,!t.isV5,s))}),an(e.image);let o=-1;const c=[];e.stepInfo=e.steps.map((e,a)=>{const[l,h]=e.split(","),d=n[s.indexOf(h)]??r,u=d?.markers?.find(t=>t.id==l),m=u?.i18n?.[i]??u;m?.title&&(o=a);const f=u?.videoTour?"timeline"in u.videoTour?u.videoTour:u.videoTour.i18n?.[i]??void 0:void 0;return an(f?.audio),an(f?.subtitle),u?(an(m?.audio),u.videoTour&&m?.audio&&(u.videoTour.audio=m.audio),{markerId:l,marker:u,micrioId:h||t.id,duration:Number(f?.duration||m?.audio?.duration||0),startView:f?.timeline?.length?f.timeline[0].rect:u?.view,imageHasOtherMarkers:!!h&&!!d?.markers?.find(t=>t.id!=l&&!t.noMarker),gridView:!(!u.data?._meta?.gridView&&!u.data?._meta?.gridAction),chapter:o,hasSubtitle:!!f?.subtitle}):(console.warn(`[Micrio] Warning: tour step ${a+1} with id [${l}] not found! Removing it from the tour`),void c.push(a))}).filter(t=>void 0!==t),c.reverse().forEach(t=>e.steps.splice(t,1)),e.initialStep=0,e.duration=e.stepInfo.reduce((t,e)=>t+(e.duration||0),0)}var yn=t=>{let e=t.charCodeAt(0),i=e<91;return(e-=i?65:97)-(e>7?1:0)+(i?24:e>10?-1:0)},kn=t=>6==t.length||7==t.length;function Tn(t,e){const i=t.$current;if(!i)return;const r=t.spaceData?.images.find(t=>t.id==i.id),s=t.spaceData?.images.find(t=>t.id==e);if(!r||!s)return;const n=[(s.x??.5)-(r.x??.5),(r.y??.5)-(s.y??.5),(s.z??.5)-(r.z??.5)];let a=n[0]*n[0]+n[1]*n[1]+n[2]*n[2];a>0&&(a=1/Math.sqrt(a));const o=[n[0]*a,n[1]*a,n[2]*a],c=Ws(Math.atan2(-o[0],o[2])/Math.PI/2);return{v:n,vN:o,directionX:c,vector:{direction:c%1,distanceX:Math.max(0,Math.min(.4,Math.sqrt(o[0]*o[0]+o[2]*o[2]))),distanceY:-n[1]}}}function _n([t,e,i=0,r=0],[s,n,a=0,o=0],c){const l=Math.max(r/2,c),h=Math.max(o/2,c);return!(t+i+c<s-c||t-c>s+a+c||e+l<n-h||e-l>n+h)}var xn,En=function(t){return t[t.None=0]="None",t[t.IFrame=1]="IFrame",t[t.Video=2]="Video",t[t.Audio=3]="Audio",t[t.VideoTour=4]="VideoTour",t[t.Micrio=5]="Micrio",t}({}),Sn=function(t){return t[t.YouTube=1]="YouTube",t[t.Vimeo=2]="Vimeo",t}({}),An=/((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube\.com|youtu.be|youtube-nocookie\.com))(\/(?:[\w\-]+\?v=|embed\/|v\/)?)([\w\-]+)(\S+)?/,Mn=/vimeo\.com/,In=/^.*t=(\d+).*$/,$n="https://www.youtube-nocookie.com";function Pn(t){if(t)return"fileUrl"in t?t.fileUrl:t.src}function Ln(t,e){return t.i18n?.[e]??t}var Cn=t=>t;function Rn(t){const e=t-1;return e*e*e+1}function Dn(t){const e="string"==typeof t&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}function Fn(t,{delay:e=0,duration:i=400,easing:r=Cn}={}){const s=+getComputedStyle(t).opacity;return{delay:e,duration:i,easing:r,css:t=>"opacity: "+t*s}}function On(t,{delay:e=0,duration:i=400,easing:r=Rn,x:s=0,y:n=0,opacity:a=0}={}){const o=getComputedStyle(t),c=+o.opacity,l="none"===o.transform?"":o.transform,h=c*(1-a),[d,u]=Dn(s),[m,f]=Dn(n);return{delay:e,duration:i,easing:r,css:(t,e)=>`\n\t\t\ttransform: ${l} translate(${(1-t)*d}${u}, ${(1-t)*m}${f});\n\t\t\topacity: ${c-h*e}`}}var zn=Wi('<a rel="noopener" href="https://micr.io/" title="Powered by Micrio" aria-label="Micrio homepage"></a>');function Nn(t,e){et(e,!0);const[i,r]=_t(),s=Q("micrio"),{tour:n,marker:a}=s.state,o=/micr\.io/.test(location.origin)&&self.parent==self?void 0:"_blank";let c,l=ne(!1);pr(()=>s.loading.subscribe(t=>{clearTimeout(c),t?Ai(l)||(c=setTimeout(()=>oe(l,!0),750)):oe(l,!1)}));const h=Ht(()=>!!kt(n,"$tour",i)||!!kt(a,"$marker",i));var d=Gi(),u=xe(d),m=t=>{var e=zn();let i;Ue(()=>{as(e,"target",o),i=qr(e,1,"micrio-logo",null,i,{loading:Ai(l)})}),Rr(3,e,()=>Fn,()=>({duration:200})),ji(t,e)};vr(u,t=>{Ai(h)||t(m)}),ji(t,d),it(),r()}var Vn=Wi('<a rel="noopener" target="_blank" class="micrio-logo-org"><img alt="Logo" class="micrio-logo-org"/></a>');function Un(t,e){et(e,!0);const[i,r]=_t(),{tour:s,marker:n,popover:a}=Q("micrio").state;const o=Ht(()=>!!kt(s,"$tour",i)||!!kt(n,"$marker",i)||!!kt(a,"$popover",i));var c=Gi(),l=xe(c),h=t=>{var i=Vn(),r=_e(i);q(i),Ue(t=>{as(i,"href",e.organisation.href??"#"),as(i,"title",e.organisation.name),as(i,"aria-label",`${e.organisation.name??""} homepage`),as(r,"src",t)},[()=>function(t){if("string"==typeof t)return t;let e=0,i=Math.max(t.width,t.height);for(;i>1024;)e++,i/=2;return t.micrioId&&t.width>1024?"https://r2.micr.io/"+t.micrioId+"/"+e+"/0-0."+(t.isPng?"png":t.isWebP?"webp":"jpg"):t.src}(e.organisation.logo)]),Rr(3,i,()=>Fn,()=>({duration:200})),ji(t,i)};vr(l,t=>{!Ai(o)&&e.organisation.logo&&t(h)}),ji(t,c),it(),r()}var Bn={en:{close:"Close",zoomIn:"Zoom in",zoomOut:"Zoom out",fullscreenToggle:"Toggle fullscreen",switchLanguage:"Switch language",share:"Share",audioMute:"Mute audio",audioUnmute:"Unmute audio",closeMarker:"Close this marker",tourStepNext:"Next step",tourStepPrev:"Previous step",tourStop:"Stop this tour",minimize:"Minimize",play:"Play",pause:"Pause",stop:"Stop",subtitlesToggle:"Toggle subtitles",galleryPrev:"Previous image",galleryNext:"Next image",menuToggle:"Toggle menu",waypointFollow:"Go this way"},nl:{close:"Sluit",zoomIn:"Zoom in",zoomOut:"Zoom uit",fullscreenToggle:"Volledig scherm aan / uit",switchLanguage:"Kies taal",share:"Deel",audioMute:"Geluid uit",audioUnmute:"Geluid aan",closeMarker:"Sluit deze marker",tourStepNext:"Volgende stap",tourStepPrev:"Vorige stap",tourStop:"Stop deze tour",minimize:"Minimaliseer",play:"Start",pause:"Pauzeer",stop:"Stop",subtitlesToggle:"Ondertitels aan / uit",galleryPrev:"Vorige afbeelding",galleryNext:"Volgende afbeelding",menuToggle:"Menu openen / sluiten",waypointFollow:"Ga deze richting"}},Wn=vt(Bn.en),qn=navigator?.language??"en-EN",Xn="Intl"in self&&Intl.DisplayNames?new Intl.DisplayNames([qn],{type:"language"}):void 0,Yn=["ar","ar-AE","ar-BH","ar-DJ","ar-DZ","ar-EG","ar-IQ","ar-JO","ar-KW","ar-LB","ar-LY","ar-MA","ar-OM","ar-QA","ar-SA","ar-SD","ar-SY","ar-TN","ar-YE","dv","dv-MV","fa","fa-AF","fa-IR","he","he-IL","iw","iw-PS","kd","ku","ku-IQ","ku-IR","ku-SY","ku-TR","pk-PK","ps","ps-AF","sd","sd-PK","syr-SY","ug","ug-CN","ur","ur-IN","ur-PK","yi","yi-IL","yi-US"],Gn={arrowDown:[384,512,"M169.4 502.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 402.7 224 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 370.7-105.4-105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"],arrowLeft:[512,512,"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 288 480 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-370.7 0 105.4-105.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"],arrowRight:[512,512,"M502.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l370.7 0-105.4 105.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"],arrowUp:[384,512,"M214.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 109.3 160 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-370.7 105.4 105.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z"],bars:[448,512,"M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"],chevronDown:[448,512,"M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"],circleExclamation:[512,512,"M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zm0-192a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.6 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z"],closedCaptioning:[512,512,"M0 128C0 92.7 28.7 64 64 64l384 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zm152 80l32 0c4.4 0 8 3.6 8 8 0 13.3 10.7 24 24 24s24-10.7 24-24c0-30.9-25.1-56-56-56l-32 0c-30.9 0-56 25.1-56 56l0 80c0 30.9 25.1 56 56 56l32 0c30.9 0 56-25.1 56-56 0-13.3-10.7-24-24-24s-24 10.7-24 24c0 4.4-3.6 8-8 8l-32 0c-4.4 0-8-3.6-8-8l0-80c0-4.4 3.6-8 8-8zm168 8c0-4.4 3.6-8 8-8l32 0c4.4 0 8 3.6 8 8 0 13.3 10.7 24 24 24s24-10.7 24-24c0-30.9-25.1-56-56-56l-32 0c-30.9 0-56 25.1-56 56l0 80c0 30.9 25.1 56 56 56l32 0c30.9 0 56-25.1 56-56 0-13.3-10.7-24-24-24s-24 10.7-24 24c0 4.4-3.6 8-8 8l-32 0c-4.4 0-8-3.6-8-8l0-80z"],compress:[448,512,"M160 64c0-17.7-14.3-32-32-32S96 46.3 96 64l0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96zM32 320c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0zM352 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64zM320 320c-17.7 0-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0z"],ellipsisVertical:[128,512,"M64 144a56 56 0 1 1 0-112 56 56 0 1 1 0 112zm0 224c30.9 0 56 25.1 56 56s-25.1 56-56 56-56-25.1-56-56 25.1-56 56-56zm56-112c0 30.9-25.1 56-56 56s-56-25.1-56-56 25.1-56 56-56 56 25.1 56 56z"],expand:[448,512,"M32 32C14.3 32 0 46.3 0 64l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zM64 352c0-17.7-14.3-32-32-32S0 334.3 0 352l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96z"],externalLink:[512,512,"M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l82.7 0-201.4 201.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3 448 192c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-17.7-14.3-32-32-32L320 0zM80 96C35.8 96 0 131.8 0 176L0 432c0 44.2 35.8 80 80 80l256 0c44.2 0 80-35.8 80-80l0-80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 80c0 8.8-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l80 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 96z"],globe:[512,512,"M351.9 280l-190.9 0c2.9 64.5 17.2 123.9 37.5 167.4 11.4 24.5 23.7 41.8 35.1 52.4 11.2 10.5 18.9 12.2 22.9 12.2s11.7-1.7 22.9-12.2c11.4-10.6 23.7-28 35.1-52.4 20.3-43.5 34.6-102.9 37.5-167.4zM160.9 232l190.9 0C349 167.5 334.7 108.1 314.4 64.6 303 40.2 290.7 22.8 279.3 12.2 268.1 1.7 260.4 0 256.4 0s-11.7 1.7-22.9 12.2c-11.4 10.6-23.7 28-35.1 52.4-20.3 43.5-34.6 102.9-37.5 167.4zm-48 0C116.4 146.4 138.5 66.9 170.8 14.7 78.7 47.3 10.9 131.2 1.5 232l111.4 0zM1.5 280c9.4 100.8 77.2 184.7 169.3 217.3-32.3-52.2-54.4-131.7-57.9-217.3L1.5 280zm398.4 0c-3.5 85.6-25.6 165.1-57.9 217.3 92.1-32.7 159.9-116.5 169.3-217.3l-111.4 0zm111.4-48C501.9 131.2 434.1 47.3 342 14.7 374.3 66.9 396.4 146.4 399.9 232l111.4 0z"],image:[448,512,"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm64 80a48 48 0 1 1 0 96 48 48 0 1 1 0-96zM272 224c8.4 0 16.1 4.4 20.5 11.5l88 144c4.5 7.4 4.7 16.7 .5 24.3S368.7 416 360 416L88 416c-8.9 0-17.2-5-21.3-12.9s-3.5-17.5 1.6-24.8l56-80c4.5-6.4 11.8-10.2 19.7-10.2s15.2 3.8 19.7 10.2l26.4 37.8 61.4-100.5c4.4-7.1 12.1-11.5 20.5-11.5z"],layerGroup:[512,512,"M232.5 5.2c14.9-6.9 32.1-6.9 47 0l218.6 101c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L13.9 149.8C5.4 145.8 0 137.3 0 128s5.4-17.9 13.9-21.8L232.5 5.2zM48.1 218.4l164.3 75.9c27.7 12.8 59.6 12.8 87.3 0l164.3-75.9 34.1 15.8c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L13.9 277.8C5.4 273.8 0 265.3 0 256s5.4-17.9 13.9-21.8l34.1-15.8zM13.9 362.2l34.1-15.8 164.3 75.9c27.7 12.8 59.6 12.8 87.3 0l164.3-75.9 34.1 15.8c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L13.9 405.8C5.4 401.8 0 393.3 0 384s5.4-17.9 13.9-21.8z"],link:[576,512,"M419.5 96c-16.6 0-32.7 4.5-46.8 12.7-15.8-16-34.2-29.4-54.5-39.5 28.2-24 64.1-37.2 101.3-37.2 86.4 0 156.5 70 156.5 156.5 0 41.5-16.5 81.3-45.8 110.6l-71.1 71.1c-29.3 29.3-69.1 45.8-110.6 45.8-86.4 0-156.5-70-156.5-156.5 0-1.5 0-3 .1-4.5 .5-17.7 15.2-31.6 32.9-31.1s31.6 15.2 31.1 32.9c0 .9 0 1.8 0 2.6 0 51.1 41.4 92.5 92.5 92.5 24.5 0 48-9.7 65.4-27.1l71.1-71.1c17.3-17.3 27.1-40.9 27.1-65.4 0-51.1-41.4-92.5-92.5-92.5zM275.2 173.3c-1.9-.8-3.8-1.9-5.5-3.1-12.6-6.5-27-10.2-42.1-10.2-24.5 0-48 9.7-65.4 27.1L91.1 258.2c-17.3 17.3-27.1 40.9-27.1 65.4 0 51.1 41.4 92.5 92.5 92.5 16.5 0 32.6-4.4 46.7-12.6 15.8 16 34.2 29.4 54.6 39.5-28.2 23.9-64 37.2-101.3 37.2-86.4 0-156.5-70-156.5-156.5 0-41.5 16.5-81.3 45.8-110.6l71.1-71.1c29.3-29.3 69.1-45.8 110.6-45.8 86.6 0 156.5 70.6 156.5 156.9 0 1.3 0 2.6 0 3.9-.4 17.7-15.1 31.6-32.8 31.2s-31.6-15.1-31.2-32.8c0-.8 0-1.5 0-2.3 0-33.7-18-63.3-44.8-79.6z"],minus:[448,512,"M0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32z"],pause:[384,512,"M48 32C21.5 32 0 53.5 0 80L0 432c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-352c0-26.5-21.5-48-48-48L48 32zm224 0c-26.5 0-48 21.5-48 48l0 352c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-352c0-26.5-21.5-48-48-48l-64 0z"],play:[448,512,"M91.2 36.9c-12.4-6.8-27.4-6.5-39.6 .7S32 57.9 32 72l0 368c0 14.1 7.5 27.2 19.6 34.4s27.2 7.5 39.6 .7l336-184c12.8-7 20.8-20.5 20.8-35.1s-8-28.1-20.8-35.1l-336-184z"],playCircle:[512,512,"M0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zM188.3 147.1c-7.6 4.2-12.3 12.3-12.3 20.9l0 176c0 8.7 4.7 16.7 12.3 20.9s16.8 4.1 24.3-.5l144-88c7.1-4.4 11.5-12.1 11.5-20.5s-4.4-16.1-11.5-20.5l-144-88c-7.4-4.5-16.7-4.7-24.3-.5z"],plus:[448,512,"M256 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 160-160 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0 0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160 160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0 0-160z"],share:[512,512,"M307.8 18.4c-12 5-19.8 16.6-19.8 29.6l0 80-112 0c-97.2 0-176 78.8-176 176 0 113.3 81.5 163.9 100.2 174.1 2.5 1.4 5.3 1.9 8.1 1.9 10.9 0 19.7-8.9 19.7-19.7 0-7.5-4.3-14.4-9.8-19.5-9.4-8.8-22.2-26.4-22.2-56.7 0-53 43-96 96-96l96 0 0 80c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-9.2-9.2-22.9-11.9-34.9-6.9z"],video:[576,512,"M96 64c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L96 64zM464 336l73.5 58.8c4.2 3.4 9.4 5.2 14.8 5.2 13.1 0 23.7-10.6 23.7-23.7l0-240.6c0-13.1-10.6-23.7-23.7-23.7-5.4 0-10.6 1.8-14.8 5.2L464 176 464 336z"],volumeHigh:[640,512,"M533.6 32.5c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C557.5 113.8 592 180.8 592 256s-34.5 142.2-88.7 186.3c-10.3 8.4-11.8 23.5-3.5 33.8s23.5 11.8 33.8 3.5C598.5 426.7 640 346.2 640 256S598.5 85.2 533.6 32.5zM473.1 107c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C475.3 170.7 496 210.9 496 256s-20.7 85.3-53.2 111.8c-10.3 8.4-11.8 23.5-3.5 33.8s23.5 11.8 33.8 3.5c43.2-35.2 70.9-88.9 70.9-149s-27.7-113.8-70.9-149zm-60.5 74.5c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C393.1 227.6 400 241 400 256s-6.9 28.4-17.7 37.3c-10.3 8.4-11.8 23.5-3.5 33.8s23.5 11.8 33.8 3.5C434.1 312.9 448 286.1 448 256s-13.9-56.9-35.4-74.5zM80 352l48 0 134.1 119.2c6.4 5.7 14.6 8.8 23.1 8.8 19.2 0 34.8-15.6 34.8-34.8l0-378.4c0-19.2-15.6-34.8-34.8-34.8-8.5 0-16.7 3.1-23.1 8.8L128 160 80 160c-26.5 0-48 21.5-48 48l0 96c0 26.5 21.5 48 48 48z"],volumeXmark:[576,512,"M48 352l48 0 134.1 119.2c6.4 5.7 14.6 8.8 23.1 8.8 19.2 0 34.8-15.6 34.8-34.8l0-378.4c0-19.2-15.6-34.8-34.8-34.8-8.5 0-16.7 3.1-23.1 8.8L96 160 48 160c-26.5 0-48 21.5-48 48l0 96c0 26.5 21.5 48 48 48zM367 175c-9.4 9.4-9.4 24.6 0 33.9l47 47-47 47c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l47-47 47 47c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-47-47 47-47c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-47 47-47-47c-9.4-9.4-24.6-9.4-33.9 0z"],xmark:[384,512,"M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]},jn=Xi('<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path></path></svg>');function Hn(t,e){et(e,!0);let i=ys(e,"style",3,void 0);const r=Q("micrio"),s=Ht(()=>"chevron-down"==e.name||"link-ext"==e.name),n=r.defaultSettings?.ui?.icons,a=Ht(()=>n&&("zoom-in"==e.name?n.zoomIn:"zoom-out"==e.name?n.zoomOut:"maximize"==e.name?n.fullscreenEnter:"minimize"==e.name?n.fullscreenLeave:"close"==e.name?n.close:"arrow-right"==e.name?n.next:"arrow-left"==e.name?n.prev:"arrow-up"==e.name?n.up:"arrow-down"==e.name?n.down:"play"==e.name?n.play:"pause"==e.name?n.pause:"subtitles"==e.name?n.subtitles:"subtitles-off"==e.name?n.subtitlesOff:"volume-off"==e.name?n.muted:"volume-up"==e.name?n.unmuted:null)),o={play:Gn.play,pause:Gn.pause,close:Gn.xmark,"play-filled":Gn.playCircle,a11y:Gn.globe,menu:Gn.bars,"zoom-in":Gn.plus,"zoom-out":Gn.minus,maximize:Gn.expand,minimize:Gn.compress,"volume-off":Gn.volumeXmark,"volume-up":Gn.volumeHigh,subtitles:Gn.closedCaptioning,"subtitles-off":Gn.closedCaptioning,"arrow-left":Gn.arrowLeft,"arrow-up":Gn.arrowUp,"arrow-right":Gn.arrowRight,"arrow-down":Gn.arrowDown,video:Gn.video,audio:Gn.volumeHigh,image:Gn.image,share:Gn.share,error:Gn.circleExclamation,"chevron-down":Gn.chevronDown,link:Gn.link,"link-ext":Gn.externalLink,"ellipsis-vertical":Gn.ellipsisVertical},c=Ht(()=>o[e.name]);var l=Gi(),h=xe(l),d=t=>{var e=Gi();Er(xe(e),()=>Ai(a),void 0,!0),ji(t,e)},u=t=>{var e=jn();let r;var n=_e(e);q(e),Ue(()=>{as(e,"viewBox",`0 0 ${Ai(c)[0]??""} ${Ai(c)[1]??""}`),r=qr(e,0,"svelte-fa micrio-icon",null,r,{small:Ai(s)}),Yr(e,i()),as(n,"d",Ai(c)[2])}),ji(t,e)};vr(h,t=>{Ai(a)?t(d):Ai(c)&&t(u,1)}),ji(t,l),it()}var Zn=vt(void 0),Jn=()=>Zn.set(void 0),Kn=!1;Zn.subscribe(t=>{t?Kn||window.addEventListener("click",Jn):Kn&&window.removeEventListener("click",Jn),Kn=!!t});var Qn=Wi('<a class="micrio-menu-action micrio-menu"><strong class="micrio-menu"> <!></strong></a>'),ta=Xi('<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="svelte-fa" style="height:1em;vertical-align:-.125em;margin-right:10px;"><path></path></svg>'),ea=Wi('<button class="micrio-menu-action micrio-menu" type="button"><!> <strong class="micrio-menu"> <!></strong></button>'),ia=Wi('<div class="items micrio-menu"></div>'),ra=Wi("<menu><!> <!></menu>");function sa(t,e){et(e,!0);const i=()=>kt(Zn,"$opened",r),[r,s]=_t();let n=ys(e,"menu",15),a=ys(e,"originalId",3,null);const o=Q("micrio"),{events:c,state:l,_lang:h}=o;let d=ne(void 0);const u=Ht(()=>{return t=n(),e=kt(h,"$_lang",r),t.i18n?.[e]??t;var t,e});function m(t){n().link||t.preventDefault(),n().action&&n().action();const i=!!(Ai(p)||n().action||n().link);Zn.set(i?void 0:n()),i&&e.onclose?.()}pr(()=>{Ai(u)?.title||1!=n().children?.length||n(n().children[0]),n().action||(n().markerId?n(n().action=()=>{a()&&o.$current?.id!=a()&&o.open(a()),o.$current?.state.marker.set(n().markerId)},!0):(Ai(u)?.content||Ai(u)?.embed||n().image)&&n(n().action=()=>{c.dispatch("page-open",n()),l.popover.set({contentPage:n()})},!0)),n(n()._button=Ai(d),!0)});const f=t=>t==i()||!!t.children?.some(f),p=Ht(()=>i()&&f(n()));var g=ra();let v;var w=_e(g),b=t=>{var e=Qn(),i=_e(e),r=_e(i),s=Ee(r);{let t=Ht(()=>n().linkTargetBlank?"link-ext":"link");Hn(s,{style:"opacity:.75",get name(){return Ai(t)}})}q(i),q(e),Ue(()=>{as(e,"href",n().link),as(e,"target",n().linkTargetBlank?"_blank":void 0),nr(r,`${Ai(u)?.title??"(Unknown)"??""} `)}),Oi("click",e,m),ji(t,e)},y=t=>{var e=ea(),i=_e(e),r=t=>{var e=ta(),i=_e(e);q(e),Ue(()=>{as(e,"viewBox",`0 0 ${n().icon[0]??""} ${n().icon[1]??""}`),as(i,"d",n().icon[2])}),ji(t,e)};vr(i,t=>{n().icon&&t(r)});var s=Ee(i,2),a=_e(s),o=Ee(a),c=t=>{Hn(t,{name:"chevron-down"})};vr(o,t=>{n().children&&n().children.length&&t(c)}),q(s),q(e),gs(e,t=>oe(d,t),()=>Ai(d)),Ue(()=>nr(a,`${Ai(u)?.title??"(Unknown)"??""} `)),Oi("click",e,m),ji(t,e)};vr(w,t=>{n().link?t(b):t(y,-1)});var k=Ee(w,2),T=t=>{var e=ia();yr(e,23,()=>n().children,(t,e)=>e+t.id,(t,e)=>{sa(t,{get menu(){return Ai(e)},get originalId(){return a()},onclose:Jn})}),q(e),ji(t,e)};vr(k,t=>{n().children&&n().children.length&&t(T)}),q(g),Ue(t=>{as(g,"data-title",t),v=qr(g,1,"micrio-menu",null,v,{opened:Ai(p)})},[()=>Ai(u)?.title?.toLowerCase()]),ji(t,g),it(),s()}zi(["click"]);var na=Wi('<img alt="Icon" class="micrio-button"/>'),aa=Wi("<!><!>",1);function oa(t,e){et(e,!0);let i=ys(e,"type",3,void 0),r=ys(e,"icon",3,void 0),s=ys(e,"title",3,null),n=ys(e,"disabled",3,!1),a=ys(e,"active",3,!1),o=ys(e,"className",3,""),c=ys(e,"href",3,void 0),l=ys(e,"blankTarget",3,!1),h=ys(e,"noClick",3,!1);var d=Gi();Fr(xe(d),()=>c()?"a":"button",!1,(t,d)=>{var u=t=>e.onclick?.(t),m=t=>e.onfocus?.(t),f=t=>e.onpointerdown?.(t);cs(t,()=>({href:c(),target:l()?"_blank":void 0,disabled:!!n()||void 0,title:s(),"aria-label":s(),role:c()?void 0:"button",tabindex:c()?void 0:0,class:`micrio-button ${i()??""??""} ${o()??""}`,onclick:u,onfocus:m,onpointerdown:f,[Hr]:{active:a(),"no-click":h()}}),void 0,void 0,void 0,"micrio-button");var p=aa(),v=xe(p),w=t=>{Hn(t,{get name(){return i()}})},b=t=>{var e=na();Ue(()=>as(e,"src",r().src)),ji(t,e)};vr(v,t=>{i()?t(w):r()&&t(b,1)}),fr(Ee(v),()=>e.children??g),ji(d,p)}),ji(t,d),it()}var ca=Wi("<menu><!> <!> <!></menu> <!>",1);function la(t,e){et(e,!0);const i=()=>kt(l,"$current",s),r=()=>kt(h,"$_lang",s),[s,n]=_t();let a=ne(void 0);const o=Q("micrio"),{state:c,current:l,_lang:h,spaceData:d}=o,{tour:u,marker:m,popover:f}=c;let p=ne(!1),g=ne(!1);const v=i().id;let w=ne(void 0),b=ne(window.innerWidth<=500);const y=()=>oe(b,window.innerWidth<=500),k=()=>{Ai(b)&&oe(p,!1)},T=Ht(()=>!!kt(u,"$tour",s)||!!kt(m,"$marker",s)||!!kt(f,"$popover",s)),_=Ht(()=>(Ai(a)?.markerTours??[]).concat(d?.markerTours??[])),x=Ht(()=>Ai(_)?.length>0),E=Ht(()=>Ai(a)?.tours&&Ai(a)?.tours?.length>0),S=Ht(()=>Ai(x)&&Ai(E)),A=Ht(()=>!(Ai(w)?.length||Ai(x)||Ai(E))),M=[],I=(t,e)=>("title"in t?t.title:t.i18n?.[e]?.title)??"(Untitled)";pr(()=>{const t=o.current.subscribe(t=>{if(t){for(;M.length;)M.shift()?.();en(t.info).then(()=>oe(g,!t.$settings.noLogo)),M.push(t.data.subscribe(t=>{oe(a,t,!0),Si().then(()=>{if(!t?.pages)return;Ai(w)||oe(w,t.pages?.filter(t=>!t.id?.startsWith("_")),!0);const e=t.pages?.filter(t=>t.id?.startsWith("_"));e.length&&oe(w,[...Ai(w)?.filter(t=>!t.id?.startsWith("_"))??[],...e],!0)})}))}});return window.addEventListener("resize",y),()=>{for(window.removeEventListener("resize",y);M.length;)M.shift()?.();t()}});var $=Gi(),P=xe($),L=t=>{var e=ca(),n=xe(e);let c;var l=_e(n),h=t=>{var e=Gi();yr(xe(e),17,()=>Ai(w),t=>t.id,(t,e)=>{sa(t,{get menu(){return Ai(e)},get originalId(){return v},onclose:k})}),ji(t,e)};vr(l,t=>{Ai(w)&&t(h)});var d=Ee(l,2),m=t=>{{let e=Ht(()=>({id:Gs(),i18n:{[r()]:{title:Ai(S)?"Marker tours":"Tours"}},children:Ai(_).map(t=>({id:Gs(),i18n:{[r()]:{title:I(t,r())}},action:()=>{t.initialStep=0,u.set(t)}}))}));sa(t,{onclose:k,get menu(){return Ai(e)}})}};vr(d,t=>{Ai(x)&&t(m)});var f=Ee(d,2),y=t=>{{let e=Ht(()=>({id:Gs(),i18n:{[r()]:{title:Ai(S)?"Video tours":"Tours"}},children:Ai(a)&&Ai(a).tours?Ai(a).tours.map(t=>({id:Gs(),i18n:{[r()]:{title:I(t,r())}},action:()=>{i()&&i().id!=v&&o.open(v),u.set(t)}})):[]}));sa(t,{onclose:k,get menu(){return Ai(e)}})}};vr(f,t=>{Ai(E)&&t(y)}),q(n);var A=Ee(n,2),M=t=>{{let e=Ht(()=>Ai(p)?"close":"ellipsis-vertical"),i=Ht(()=>"toggle transparent"+(Ai(g)?" indent":""));oa(t,{get title(){return kt(Wn,"$i18n",s).menuToggle},get type(){return Ai(e)},get className(){return Ai(i)},onclick:()=>oe(p,!Ai(p))})}};vr(A,t=>{Ai(b)&&t(M)}),Ue(()=>c=qr(n,1,"micrio-toolbar micrio-toolbar",null,c,{shown:!Ai(T)&&Ai(p),indent:Ai(g)})),Rr(3,n,()=>Fn,()=>({duration:200})),ji(t,e)};vr(P,t=>{Ai(A)||Ai(T)||t(L)}),ji(t,$),it(),n()}var ha=Wi("<canvas></canvas>");function da(t,e){et(e,!0);const[i,r]=_t(),s=Q("micrio"),{current:n}=s,a=$i(()=>e.image).$info,o=$i(()=>e.image).camera,c=$i(()=>e.image).$settings,l=c.minimapWidth??200,h=c.minimapHeight??160,d=!c.alwaysShowMinimap,u=!!c.noControls,m=a.width/a.height,f=l/m>h?Math.round(h*m):l,p=l/m<=h?Math.round(l/m):h;let g,v=ne(void 0),w=ne(!1),b=ne(ue(!a.is360&&o.isZoomedOut()));function y(t){if(!t||!g)return;M();const i=sn.toCenterJSON(t);if(g.clearRect(0,0,f,p),e.image.thumbSrc?(g.globalCompositeOperation="source-over",g.fillStyle="rgba(0,0,0,.5)",g.fillRect(0,0,f,p),g.globalAlpha=1,g.globalCompositeOperation="destination-out"):(g.fillStyle="rgba(0,0,0,.5)",g.fillRect(0,0,f,p)),g.beginPath(),g.fillStyle="white",a.is360){const e=function(t){const e=[];let{centerX:i,centerY:r,width:s,height:n}=sn.toCenterJSON(t);i=(i%1+1)%1;let a=i-s/2,o=i+s/2;const c=Math.max(0,r-n/2),l=Math.min(1,r+n/2);return a<0?(e.push({x:a+1,y:c,width:1-(a+1),height:l-c}),e.push({x:0,y:c,width:o,height:l-c})):o>1?(e.push({x:a,y:c,width:1-a,height:l-c}),e.push({x:0,y:c,width:o-1,height:l-c})):e.push({x:a,y:c,width:o-a,height:l-c}),e}(t);for(const t of e)g.rect(Math.floor(t.x*f),Math.floor(t.y*p),Math.ceil(t.width*f),Math.ceil(t.height*p))}else oe(b,o.isZoomedOut(),!0),g.rect(Math.floor((i.centerX-i.width/2)*f),Math.floor((i.centerY-i.height/2)*p),Math.ceil(i.width*f),Math.ceil(i.height*p));e.image.thumbSrc&&(g.fill(),g.globalCompositeOperation="source-over"),g.stroke()}const k=-1!=navigator.userAgent.indexOf("Firefox");let T,_=ne(!1);let x,E=ne(void 0);function S(t){if(T){const e=Math.max(0,Math.min(1,(t.clientX-T.left)/T.width)),i=Math.max(0,Math.min(1,(t.clientY-T.top)/T.height));if(Ai(E)){const t=[e-Ai(E).width/2,i-Ai(E).height/2,Ai(E).width,Ai(E).height];o.setView(t)}else o.setCoo(e,i)}}function A(){window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",A),oe(_,!1),oe(E,void 0)}function M(){oe(w,!1),clearTimeout(x),x=setTimeout(()=>oe(w,!0),2500)}const I=-$i(()=>e.image).camera.rotationY/(2*Math.PI),$=self.crossOriginIsolated;let P=ne(ue($?void 0:$i(()=>e.image).thumbSrc));const L={passive:!0};let C=ne(!1);pr(()=>{let t;g=Ai(v).getContext("2d"),g&&(g.lineWidth=1,g.strokeStyle="white"),$&&e.image.thumbSrc&&fetch(e.image.thumbSrc).then(t=>t.blob()).then(e=>oe(P,t=URL.createObjectURL(e),!0)),s.canvas.element.addEventListener("mousemove",M,L);const i=e.image.state.view.subscribe(y);return setTimeout(()=>oe(C,!0),10),()=>{t&&URL.revokeObjectURL(t),s.canvas.element.removeEventListener("mousemove",M,L),A(),i()}});const R=Ht(()=>Ai(P)?`background-image: url('${Ai(P)}')`+(0!=I?`;background-position-x:${f*I}px`:""):null);var D=ha();let F;gs(D,t=>oe(v,t),()=>Ai(v)),Ue(()=>{as(D,"width",f),as(D,"height",p),Yr(D,Ai(R)),F=qr(D,1,"micrio-minimap",null,F,{hidden:!Ai(C)||kt(n,"$current",i)!=e.image||d&&(Ai(b)||Ai(w)),dragging:Ai(_),controls:!u})}),Fi("wheel",D,function(t){o.zoom(t.deltaY*(k?50:1))}),Oi("mousedown",D,function(t){if(0!=t.button)return;window.addEventListener("mousemove",S),window.addEventListener("mouseup",A),T=Ai(v).getClientRects()[0];const e=o.getView();e&&oe(E,{width:e[2],height:e[3]},!0),S(t),oe(_,!0)}),ji(t,D),it(),r()}zi(["mousedown"]);var ua=Wi("<div><!></div>");function ma(t,e){let i=ys(e,"className",3,"");var r=ua();fr(_e(r),()=>e.children??g),q(r),Ue(()=>qr(r,1,Vr(i()),"micrio-button-group")),ji(t,r)}function fa(t,e){et(e,!0);const[i,r]=_t(),s="requestFullscreen"in $i(()=>e.el),n="webkitRequestFullscreen"in $i(()=>e.el),a=Q("micrio"),o=()=>s?document.fullscreenElement:document.webkitFullscreenElement??null;let c=ne(o()===$i(()=>e.el));const l=s||n&&!o(),h=()=>new Promise(t=>setTimeout(t,500));let d;function u(){Ai(c)?async function(){s?(await document.exitFullscreen().then(h),d&&d instanceof HTMLElement&&d.requestFullscreen(),d=void 0):"webkitExitFullscreen"in document&&document.webkitExitFullscreen()}():async function(){s?(d=o(),Js.safari&&d&&await document.exitFullscreen().then(h),e.el.requestFullscreen()):"webkitRequestFullscreen"in e.el&&e.el.webkitRequestFullscreen()}()}const m=$i(()=>e.el)==a&&!a.events.scrollHooked,f=()=>{oe(c,o()===e.el),m&&(Ai(c)?a.events.hookScroll():a.events.unhookScroll())};l&&pr(()=>{const t=s?"fullscreenchange":"webkitfullscreenchange";return document.addEventListener(t,f),()=>document.removeEventListener(t,f)});var p=Gi(),g=xe(p),v=t=>{{let e=Ht(()=>Ai(c)?"minimize":"maximize");oa(t,{get type(){return Ai(e)},get title(){return kt(Wn,"$i18n",i).fullscreenToggle},onclick:u})}};vr(g,t=>{l&&t(v)}),ji(t,p),it(),r()}var pa=Wi("<!> <!>",1);function ga(t,e){et(e,!0);const i=()=>kt(Wn,"$i18n",r),[r,s]=_t();let n=ys(e,"image",15,void 0);const a=Q("micrio");let o=ne(!1),c=ne(!1),l=ne(!1),h=ne(!1);const d=()=>{a.events.clicked=!0},u=()=>{d(),n()?.camera.zoomIn().then(()=>a.events.clicked=!1)},m=()=>{d(),n()?.camera.zoomOut().then(()=>a.events.clicked=!1)};function f(){oe(o,n()?.camera.isZoomedIn()??!0,!0),oe(c,n()?.camera.isZoomedOut(!0)??!0,!0);const t=n()?.camera.getMinScale()??0;oe(l,t>1&&t>(n()?.$settings.zoomLimit??1),!0)}let p,g,v;const w=t=>{p&&(p(),p=void 0),n(t),t?p=t.state.view.subscribe(f):f()};pr(()=>(n()?p=n().state.view.subscribe(f):g=a.current.subscribe(t=>{if(v&&(v(),v=void 0),p&&(p(),p=void 0),oe(h,!0),!t)return n(void 0),void oe(h,!1);en(t.info).then(()=>Si()).then(()=>{t.album?.currentImage?v=t.album.currentImage.subscribe(w):w(t),oe(h,!1)})}),()=>{g&&g(),v&&v(),p&&p()}));var b=Gi(),y=xe(b),k=t=>{var e=pa(),r=xe(e);{let t=Ht(()=>Ai(h)||Ai(o));oa(r,{type:"zoom-in",get title(){return i().zoomIn},get disabled(){return Ai(t)},onclick:u})}var s=Ee(r,2);{let t=Ht(()=>Ai(h)||Ai(c));oa(s,{type:"zoom-out",get title(){return i().zoomOut},get disabled(){return Ai(t)},onclick:m})}ji(t,e)};vr(y,t=>{Ai(l)||Ai(o)&&Ai(c)||t(k)}),ji(t,b),it(),s()}var va=Wi('<menu class="popout micrio-controls"><!> <!></menu>'),wa=Wi("<!> <!> <!>",1),ba=Wi("<!> <!>",1),ya=Wi("<aside><!></aside>"),ka=Wi("<aside><!> <!></aside> <!>",1);function Ta(t,e){et(e,!0);const i=()=>kt(m,"$current",l),r=()=>kt(Ai(_),"$info",l),s=()=>kt(g,"$_lang",l),n=()=>kt(v,"$tour",l),a=()=>kt(y,"$zoom",l),o=()=>kt(p,"$isMuted",l),c=()=>kt(Wn,"$i18n",l),[l,h]=_t();let d=ys(e,"hasAudio",3,!1);const u=ue(Q("micrio")),{current:m,state:f,isMuted:p,_lang:g}=u,{tour:v,popup:w}=f,{controls:b,zoom:y,hidden:k,hover:T}=u.state.ui,_=Ht(()=>i()?.info),x=Ht(()=>r()&&i()?i().isV5?Object.keys(r().revision??{[s()]:0}):("cultures"in r()?r().cultures:"")?.split(",")??[]:[]),E=Ht(()=>n()&&"steps"in n()&&n().isSerialTour);function S(){if(navigator.share&&i()?.$info){const t=i().$data?i().$data?.i18n?i().$data.i18n[s()]:i().$data:void 0;navigator.share({title:i().$info?.title,text:t?.description||`${i().$info.width} x ${i().$info.height} | Micrio`,url:location.href})}}let A=ne(null),M=ne(!1);function I(t){const e=t.detail;oe(M,u.canvas.viewport.portrait,!0),e.opts.isPassive||oe(A,e,!0)}function $(){oe(A,null)}let P=ne(!1),L=ne(!1),C=ne(!1);function R(t){y.set(!t.noZoom),b.set(!t.noControls),oe(P,!!t.ui?.controls?.cultureSwitch),oe(L,!!t.social),oe(C,!!t.fullscreen)}i()&&R(i().$settings),pr(()=>{let t;u.addEventListener("splitscreen-start",I),u.addEventListener("splitscreen-stop",$);const e=u.current.subscribe(e=>{e&&en(e.info).then(i=>{!i||n()&&"steps"in n()||(t?.(),t=e.settings.subscribe(R))})});return()=>{u.removeEventListener("splitscreen-start",I),u.removeEventListener("splitscreen-stop",$),t?.(),e()}});const D=Ht(()=>"micrioAudioContext"in window||d()),F=Ht(()=>Ai(P)&&Ai(x).length>1),O=Ht(()=>Ai(L)&&"share"in navigator),z=Ht(()=>Ai(C)&&!Ai(E)),N=Ht(()=>kt(b,"$controls",l)&&(Ai(D)||Ai(F)||Ai(O)||a()||Ai(z))),V=Ht(()=>kt(w,"$popup",l)&&u.canvas.$isMobile);var U=Gi(),B=xe(U),W=t=>{var e=ka(),i=xe(e);let r;var n=_e(i),h=t=>{var e=wa(),i=xe(e),r=t=>{{let e=Ht(()=>o()?"volume-off":"volume-up"),i=Ht(()=>o()?c().audioUnmute:c().audioMute);oa(t,{get type(){return Ai(e)},get title(){return Ai(i)},onclick:()=>p.set(!o())})}};vr(i,t=>{Ai(D)&&t(r)});var n=Ee(i,2),a=t=>{var e=va(),i=_e(e);oa(i,{get title(){return c().switchLanguage},type:"a11y"}),yr(Ee(i,2),17,()=>Ai(x),wr,(t,e)=>{{let i=Ht(()=>Xn?.of(Ai(e))??Ai(e)),r=Ht(()=>Ai(e)==s());oa(t,{onclick:()=>u.lang=Ai(e),get title(){return Ai(i)},get active(){return Ai(r)},children:(t,i)=>{X();var r=Yi();Ue(t=>nr(r,t),[()=>Ai(e).toUpperCase()]),ji(t,r)},$$slots:{default:!0}})}}),q(e),ji(t,e)};vr(n,t=>{Ai(F)&&t(a)});var l=Ee(n,2),h=t=>{oa(t,{type:"share",get title(){return c().share},onclick:S})};vr(l,t=>{Ai(O)&&t(h)}),ji(t,e)};vr(n,t=>{Ai(V)||t(h)}),ma(Ee(n,2),{children:(t,e)=>{var i=ba(),r=xe(i),s=t=>{var e=Gi(),i=xe(e),r=t=>{ga(t,{get image(){return Ai(A)}})},s=t=>{ga(t,{})};vr(i,t=>{Ai(A)?t(r):t(s,-1)}),ji(t,e)};vr(r,t=>{a()&&!Ai(V)&&t(s)});var n=Ee(r,2),o=t=>{fa(t,{get el(){return u}})};vr(n,t=>{Ai(z)&&t(o)}),ji(t,i)},$$slots:{default:!0}}),q(i);var d=Ee(i,2),m=t=>{var e=ya();let i;ma(_e(e),{children:(t,e)=>{ga(t,{})},$$slots:{default:!0}}),q(e),Ue(()=>i=qr(e,1,"primary micrio-controls",null,i,{portrait:Ai(M)})),Rr(3,e,()=>Fn),ji(t,e)};vr(d,t=>{a()&&Ai(A)&&t(m)}),Ue(()=>r=qr(i,1,"micrio-controls",null,r,{hidden:kt(k,"$hidden",l)&&!kt(T,"$hover",l)})),Oi("pointerover",i,()=>T.set(!0)),Oi("pointerout",i,t=>{t.currentTarget.contains(t.relatedTarget)||T.set(!1)}),Oi("focusin",i,()=>T.set(!0)),Oi("focusout",i,t=>{t.currentTarget.contains(t.relatedTarget)||T.set(!1)}),ji(t,e)};vr(B,t=>{Ai(N)&&t(W)}),ji(t,U),it(),h()}zi(["pointerover","pointerout","focusin","focusout"]);var _a=class{constructor(t,e){this.image=t,this.data=e,this.timeline=[],this._paused=!0,this.playing=!1,this.wasPaused=!1,this.unhookEvents=!1,this.micrio=t.wasm.micrio;const i="timeline"in e?e:e.i18n?.[wt(this.micrio._lang)]??void 0;if(!i)throw new Error("No valid content for video tour!");this.content=i,this.unhookEvents=!e.keepInteraction&&this.micrio.events.$enabled,e.instance=this,this.read(),this.micrio.events.dispatch("videotour-start",this.data)}destroy(){this.unhookEvents&&this.micrio.events.enabled.set(!0),this.playing&&(this.image.camera.stop(),this.micrio.removeAttribute("data-videotour-playing"),this.micrio.events.dispatch("videotour-stop",this.data),this.playing=!1,delete this.startedAt,delete this.data.instance,this.startAt=void 0,clearTimeout(this._to))}read(){const t=this.data.i18n?1:this.content.duration,e=this.content.timeline;this.timeline.length=0;for(let i=0;i<e.length;i++){const r=e[i],s=e[i-1],n=s?s.end*t:0;this.timeline.push({view:this.data.isLegacy?sn.fromLegacy(r.rect):r.rect,start:1e3*n,duration:1e3*(r.start*t-n),pauseDuration:(r.end-r.start)*t*1e3})}this.startedAt&&!this.playing&&(this.progress=this.currentTime)}get duration(){return Number(this.content.duration)}set duration(t){this.content.duration=t}get paused(){return this._paused}get ended(){return this.currentTime>=this.duration}get currentTime(){return(this.pausedAt?this.pausedAt:this.startedAt?Date.now()-this.startedAt:0)/1e3}set currentTime(t){this.setProgress(t/this.content.duration)}get progress(){return this.currentTime/this.content.duration}set progress(t){this.setProgress(t)}play(){this.startedPlaying(),this.wasPaused=!1,this.pausedAt?(this.startedAt=Date.now()-this.pausedAt,this._paused=!1,this.gotoTime(this.pausedAt),this.pausedAt=void 0):this.playing||(this.startedAt=Date.now(),void 0===this.startAt?this.gotoStep(0,0):this.gotoTime(this.duration*this.startAt*1e3),this.startAt=void 0),this._paused=!1,this.playing=!0}pause(){this._paused||null==this.currentIndex||null==this.startedAt||(this._paused=!0,this.stoppedPlaying(),clearTimeout(this._to),this.currentIndex>=0&&this.image.camera.stop(),this.ended?this.reset():this.pausedAt=Date.now()-this.startedAt)}reset(){this.stoppedPlaying(),this.pausedAt=void 0,this.playing=!1,this.read()}gotoStep(t,e){if(null==this.startedAt)return;if(clearTimeout(this._to),!this.timeline[t]){if(!this.paused||!this.wasPaused){const t=Math.max(0,Math.round(1e3*this.duration-(Date.now()-this.startedAt)));this._to=setTimeout(()=>this.pause(),t)}return}const i=this.timeline[t],r=Math.round(i.start-(Date.now()-this.startedAt));this.currentIndex=t,this.image.camera.stop(),r>0?this._paused||(this._to=setTimeout(()=>this.startAni(e),r)):this.startAni(e)}nextStep(){null!=this.currentIndex&&this.gotoStep(this.currentIndex+1)}getView(t){return this.timeline[t]?.view}startAni(t=0){if(null==this.currentIndex||isNaN(t))return;const e=this.timeline[this.currentIndex];if(null==e)return;const i=sn.toCenterJSON(e.view),r=this.getView(this.currentIndex-1),s=r?sn.toCenterJSON(r):void 0,n=this.image.opts?.area;if(this.wasPaused&&s){const e=this.micrio.wasm.ease(t),r={centerX:s.centerX*(1-e)+i.centerX*e,centerY:s.centerY*(1-e)+i.centerY*e,width:s.width*(1-e)+i.width*e,height:s.height*(1-e)+i.height*e};this.image.camera.setView([r.centerX-r.width/2,r.centerY-r.height/2,r.width,r.height],{noLimit:!0,area:n}),this.nextStep()}else this.image.camera.flyToView(e.view,{duration:e.duration,progress:t,prevView:s?[s.centerX-s.width/2,s.centerY-s.height/2,s.width,s.height]:void 0,area:n}).then(()=>{null!=this.currentIndex&&e==this.timeline[this.currentIndex]&&this.nextStep()}).catch(()=>{})}startedPlaying(){this.micrio.setAttribute("data-videotour-playing",""),this.micrio.events.dispatch("videotour-play"),this.unhookEvents&&this.micrio.events.enabled.set(!1)}stoppedPlaying(){this.micrio.removeAttribute("data-videotour-playing"),this.micrio.events.dispatch("videotour-pause"),this.unhookEvents&&this.micrio.events.enabled.set(!0)}setProgress(t){t=Math.max(0,Math.min(1,t)),this.wasPaused=!!this.paused||!this.playing,this.pause(),this.wasPaused||(this._paused=!1,this.startedPlaying());const e=this.duration*t*1e3;this.pausedAt=e,this.gotoTime(e),this.wasPaused?this.pause():(this.pausedAt=void 0,this._paused=!1)}gotoTime(t){let e=null,i=0;for(;i<this.timeline.length&&!(this.timeline[i].start>t);i++)e=this.timeline[i];if(i--,e||!(i>0))if(e){this.image.camera.stop();const r=e.duration>0?(t-e.start)/e.duration:0;this.startedAt=Date.now()-e.start-e.duration*r,isNaN(this.startedAt)&&(this.startedAt=Date.now()-t),r>1?(this.gotoStep(i+1),null!=e.view&&this.image.camera.setView(e.view,{noLimit:!0})):(i>0&&this.image.camera.setView(this.timeline[i-1].view,{noLimit:!0}),this.gotoStep(i,r))}else this.timeline.length&&this.image.camera.stop(),this.paused||this.gotoStep(0)}};window.MicrioVideoTour=_a;var xa={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},Ea=class{constructor(t,e,i={}){this.frame=t,this.config=e,this.callbacks=i,this.requiresTimeTick=!0,this.destroyed=!1}async initialize(){if("YT"in window||await tn("https://i.micr.io/youtube.js","onYouTubeIframeAPIReady"),!("YT"in window))throw new Error("Failed to load YouTube API");return new Promise((t,e)=>{this.player=new window.YT.Player(this.frame,{host:$n,width:this.config.width.toString(),height:this.config.height.toString(),playerVars:{controls:0},events:{onError:()=>{this.callbacks.onError?.(new Error("YouTube player error")),e(new Error("YouTube player error"))},onReady:()=>{this.destroyed?e(new Error("Player destroyed during initialization")):(this.callbacks.onReady?.(),this.callbacks.onDurationChange?.(this.player.getDuration()),t())},onStateChange:t=>this.handleStateChange(t.data)}})})}handleStateChange(t){switch(t){case xa.UNSTARTED:this.callbacks.onBlocked?.(),this.callbacks.onPause?.();break;case xa.ENDED:this.callbacks.onEnded?.();break;case xa.PLAYING:this.callbacks.onPlay?.(),this.callbacks.onSeeked?.();break;case xa.PAUSED:this.callbacks.onPause?.();break;case xa.BUFFERING:this.callbacks.onBuffering?.(),this.callbacks.onSeeking?.()}}async play(){this.player?.playVideo()}pause(){this.destroyed||this.player?.pauseVideo?.()}async getCurrentTime(){return this.player?.getCurrentTime?.()??0}setCurrentTime(t){this.callbacks.onSeeking?.(),this.player?.seekTo?.(t)}async getDuration(){return this.player?.getDuration?.()??0}async isPaused(){if(!this.player)return!0;const t=this.player.getPlayerState?.();return void 0===t||[xa.UNSTARTED,xa.ENDED,xa.PAUSED].includes(t)}setMuted(t){t?this.player?.mute?.():this.player?.unMute?.()}setVolume(t){}destroy(){this.destroyed=!0,this.player?.destroy?.(),this.player=void 0}},Sa=class{constructor(t,e,i={}){this.frame=t,this.config=e,this.callbacks=i,this.requiresTimeTick=!1,this.destroyed=!1}async initialize(){if("Vimeo"in window||await tn("https://i.micr.io/vimeo.min.js"),!("Vimeo"in window))throw new Error("Failed to load Vimeo API");return new Promise((t,e)=>{this.player=new window.Vimeo.Player(this.frame,{width:this.config.width.toString(),height:this.config.height.toString(),title:!1,autoplay:!1});const i=this.player;i.on("error",()=>{this.callbacks.onError?.(new Error("Vimeo player error")),e(new Error("Vimeo player error"))}),i.on("loaded",()=>{this.destroyed?e(new Error("Player destroyed during initialization")):i.getVolume().then(()=>{this.callbacks.onReady?.(),t()})}),i.on("play",()=>{this.callbacks.onPlay?.(),this.callbacks.onSeeked?.()}),i.on("bufferstart",()=>{this.callbacks.onBuffering?.(),this.callbacks.onSeeking?.()}),i.on("seeked",()=>{this.callbacks.onSeeked?.()}),i.on("pause",()=>{this.callbacks.onPause?.()}),i.on("timeupdate",t=>{t&&(this.callbacks.onDurationChange?.(t.duration),this.callbacks.onTimeUpdate?.(t.seconds))}),i.on("ended",()=>{this.callbacks.onEnded?.()})})}async play(){this.player?.play()}pause(){this.player?.pause()}async getCurrentTime(){return await(this.player?.getCurrentTime?.())??0}setCurrentTime(t){this.player?.setCurrentTime?.(t)}async getDuration(){return await(this.player?.getDuration?.())??0}async isPaused(){return await(this.player?.getPaused?.())??!0}setMuted(t){this.player?.setVolume?.(t?0:1)}setVolume(t){this.player?.setVolume?.(Math.max(0,Math.min(1,t)))}destroy(){if(this.destroyed=!0,this.player){for(const t of["error","loaded","play","bufferstart","seeked","pause","volumechange","timeupdate","ended"])this.player.off(t);this.player.destroy(),this.player=void 0}}},Aa=class{constructor(t,e={}){this.element=t,this.callbacks=e,this.requiresTimeTick=!1,this.attachEventListeners()}attachEventListeners(){const t=this.element,e=this.callbacks;e.onPlay&&t.addEventListener("play",e.onPlay),e.onPause&&t.addEventListener("pause",e.onPause),e.onEnded&&t.addEventListener("ended",e.onEnded),e.onSeeking&&t.addEventListener("seeking",e.onSeeking),e.onSeeked&&t.addEventListener("seeked",e.onSeeked),e.onTimeUpdate&&t.addEventListener("timeupdate",()=>e.onTimeUpdate?.(t.currentTime)),e.onDurationChange&&t.addEventListener("durationchange",()=>e.onDurationChange?.(t.duration)),e.onError&&t.addEventListener("error",()=>e.onError?.(new Error("Media playback error"))),e.onReady&&t.addEventListener("canplay",e.onReady)}async play(){try{await this.element.play()}catch(t){throw t instanceof Error&&!/pause\(\)/.test(t.message)&&this.callbacks.onBlocked?.(),t}}pause(){this.element.pause()}async getCurrentTime(){return this.element.currentTime}setCurrentTime(t){this.element.currentTime=t}async getDuration(){return this.element.duration}async isPaused(){return this.element.paused}setMuted(t){this.element.muted=t}setVolume(t){this.element.volume=Math.max(0,Math.min(1,t))}destroy(){const t=this.element,e=this.callbacks;e.onPlay&&t.removeEventListener("play",e.onPlay),e.onPause&&t.removeEventListener("pause",e.onPause),e.onEnded&&t.removeEventListener("ended",e.onEnded),e.onSeeking&&t.removeEventListener("seeking",e.onSeeking),e.onSeeked&&t.removeEventListener("seeked",e.onSeeked)}},Ma=class{constructor(t,e,i={}){this.element=t,this.hlsSrc=e,this.callbacks=i,this.requiresTimeTick=!1,this.destroyed=!1}async initialize(){if("Hls"in window||await tn("https://r2.micr.io/hls-1.6.15.min.js",void 0,"Hls"in window?{}:void 0),!("Hls"in window))throw new Error("Failed to load HLS.js");if(this.destroyed)throw new Error("Adapter destroyed during initialization");const t=new window.Hls({abrEwmaDefaultEstimate:1e7,abrEwmaDefaultEstimateMax:5e7});this.hls=t,t.loadSource(this.hlsSrc),t.attachMedia(this.element),this.html5Adapter=new Aa(this.element,this.callbacks),this.callbacks.onReady?.()}async play(){return this.html5Adapter?.play()}pause(){this.html5Adapter?.pause()}async getCurrentTime(){return this.html5Adapter?.getCurrentTime()??Promise.resolve(0)}setCurrentTime(t){this.html5Adapter?.setCurrentTime(t)}async getDuration(){return this.html5Adapter?.getDuration()??Promise.resolve(0)}async isPaused(){return this.html5Adapter?.isPaused()??Promise.resolve(!0)}setMuted(t){this.html5Adapter?.setMuted(t)}setVolume(t){this.html5Adapter?.setVolume(t)}destroy(){this.destroyed=!0,this.html5Adapter?.destroy(),this.hls?.destroy(),this.hls=void 0,this.html5Adapter=void 0}},Ia="micrio-captions-disable",$a=vt("1"!=localStorage.getItem(Ia));$a.subscribe(t=>{t?localStorage.removeItem(Ia):localStorage.setItem(Ia,"1")});var Pa=Wi('<div><p class="micrio-subtitles"> </p></div>');function La(t,e){et(e,!0);const[i,r]=_t();let s=ys(e,"raised",3,!1);const n=ue([]);fetch($i(()=>e.src)).then(t=>t.text()).then(t=>{const e=t.split("\n");for(let i=0;i<e.length;i++)if(/-->/.test(e[i])){let t=i+1;const r=[];for(;!e[t]&&t<e.length;)t++;for(;e[t]&&e[t].trim();)r.push(e[t++]);const[s,a]=e[i].split(" --\x3e ").map(t=>t.trim().replace(",",".").split(":").map(Number)).map(t=>3===t.length?3600*t[0]+60*t[1]+t[2]:2===t.length?60*t[0]+t[1]:0);n.push({start:s,end:a,data:r.join("\n")}),i+=r.length+1}}).catch(t=>console.error("Subtitles: fetch error:",t));const a=Q("micrio");let o=ne(0);const c=t=>oe(o,t.detail,!0);pr(()=>(a.addEventListener("timeupdate",c),()=>a.removeEventListener("timeupdate",c)));const l=Ht(()=>n.filter(t=>t.start<=Ai(o)&&t.end>=Ai(o)));var h=Gi(),d=xe(h),u=t=>{var e=Gi();yr(xe(e),16,()=>Ai(l),t=>t,(t,e)=>{var i=Pa();let r;var n=_e(i),a=_e(n,!0);q(n),q(i),Ue(()=>{r=qr(i,1,"micrio-subtitles",null,r,{raised:s()}),nr(a,e.data)}),Rr(3,i,()=>Fn),ji(t,i)}),ji(t,e)};vr(d,t=>{kt($a,"$captionsEnabled",i)&&t(u)}),ji(t,h),it(),r()}var Ca=Wi('<div class="container micrio-progress-bar"><div class="bars micrio-progress-bar"><!></div> <div class="time micrio-progress-bar"> </div></div>');function Ra(t,e){et(e,!0);let i=ys(e,"ended",11,!1);var r=Ca(),s=_e(r);fr(_e(s),()=>e.children??g),q(s);var n=Ee(s,2),a=_e(n,!0);q(n),q(r),Ue((t,e)=>{Yr(r,t),nr(a,e)},[()=>`--progress: ${Math.round((e.currentTime??0)/e.duration*1e4)/100}%;--time: '${Hs(e.currentTime??0)}';`,()=>Hs(i()||!e.currentTime||e.currentTime<=0?e.duration:(e.currentTime??0)-e.duration)]),Oi("click",r,t=>t.stopPropagation()),Oi("keydown",r,t=>t.stopPropagation()),ji(t,r),it()}zi(["click","keydown"]);var Da=Xi('<svg height="42" width="42" class="micrio-media-controls"><circle r="19" cx="21" cy="21" class="micrio-media-controls"></circle></svg>'),Fa=Wi("<!> <!> <!>",1),Oa=Wi('<div class="bar active"></div>'),za=Wi('<aside class="micrio-media-controls"><!> <!></aside> <!>',1);zi(["click","keydown","mousedown"]);var Na=Wi("<iframe></iframe>"),Va=Wi('<source type="video/mp4;codecs=hvc1"/>'),Ua=Wi("<!> <source/>",1),Ba=Wi('<video playsinline="" class="micrio-media"><!></video>',2),Wa=Wi("<audio></audio>"),qa=Wi("<micr-io></micr-io>",2),Xa=Wi("<aside><!></aside>"),Ya=Wi('<figcaption class="micrio-media"></figcaption>'),Ga=Wi('<div class="show-play micrio-media" role="button"><!></div>'),ja=Wi('<figure><div role="button"><!> <!> <!></div> <!></figure> <!>',1);function Ha(t,e){et(e,!0);const i=()=>kt(O,"$_lang",r),[r,s]=_t(),n=Q("micrio");let a=ys(e,"src",11,void 0),o=ys(e,"volume",15,1),c=ys(e,"width",3,640),l=ys(e,"height",3,380),h=ys(e,"frameScale",3,1),d=ys(e,"autoplay",15,!1),u=ys(e,"loop",3,!1),m=ys(e,"loopDelay",3,void 0),f=ys(e,"controls",15,!1),p=ys(e,"title",3,void 0),g=ys(e,"figcaption",3,null),v=ys(e,"paused",15,!0),w=ys(e,"forcePause",3,void 0),b=ys(e,"seeking",15,!0),y=ys(e,"duration",31,()=>-1),k=ys(e,"currentTime",15),T=ys(e,"is360",3,!1),_=ys(e,"tour",3,null),x=ys(e,"secondary",3,!1),E=ys(e,"fullscreen",3,void 0),S=ys(e,"className",3,null),A=ys(e,"hasTransparentH265",3,!1),M=ys(e,"noPlayOverlay",3,!1),I=ys(e,"uuid",15,""),$=ys(e,"image",19,()=>wt(n.current)),P=ys(e,"destroying",3,void 0),L=ys(e,"_media",15,void 0),C=ne(!1);I(I()+(a()??$i(()=>_())?.id));const R=$i(()=>$()).$info,{events:D,state:F,_lang:O}=n,z=Q("volume"),N=0==kt(z,"$mainVolume",r),U=Q("srt"),B=Q("mediaPaused"),W=n.hasAttribute("data-native-frame"),X=function(t,e,i=!1,r=0){t=function(t){if(t)return/<iframe /.test(t)&&(t=t.replace(/^.* src="([^"]+)".*$/,"$1")),t.startsWith("video://")&&(t=t.replace("video:","https:")),t}(t);const s=t?.toLowerCase(),n={type:En.None,originalSrc:t,isCloudflare:!1};if(!t&&e)return n.type=En.VideoTour,n;if(!t||!s)return n;if(t.startsWith("cfvid://"))return n.isCloudflare=!0,n.cloudflareId=t.slice(8),n.hlsSrc=`https://videodelivery.net/${n.cloudflareId}/manifest/video.m3u8`,n.type=En.Video,n;if(s.endsWith(".mp3"))return n.type=En.Audio,n.src=t,n;if(s.endsWith(".mp4")||s.endsWith(".webm"))return n.type=En.Video,n.src=t,n;if(s.startsWith("micrio://"))return n.type=En.Micrio,n.micrioEmbed=t.slice(9).split(","),n;if(!i){const e=An.exec(t);if(e?.[5]){if("playlist"!==e[5]){n.type=En.IFrame,n.frameType=Sn.YouTube,n.youtubeId=e[5];const i=In.test(t)?Number(t.replace(In,"$1")):r;return n.startTime=Math.round(i),n.src=`${$n}/embed/${e[5]}?autoplay=0&enablejsapi=1&controls=0&start=${n.startTime}`,n}{const e=/list=([^&]+)/.exec(t);if(e?.[1])return n.type=En.IFrame,n.src=`${$n}/embed/videoseries?list=${e[1]}`,n}}if(Mn.test(t)){const e=t.match(/\/(\d+)/);if(e?.[1]){n.type=En.IFrame,n.frameType=Sn.Vimeo,n.vimeoId=e[1],n.vimeoToken=t.slice(t.indexOf(e[1])+e[1].length+1).replace(/\?.*$/,"")||void 0;const i=Math.round(r);return n.src=`https://player.vimeo.com/video/${e[1]}?${n.vimeoToken?`h=${n.vimeoToken}&`:""}title=0&portrait=0&sidedock=0&byline=0&controls=0#t=${i}s`,n}}}return s.startsWith("http")?(n.type=En.IFrame,n.src=t,n):n}(a(),$i(()=>_()),W,k()??0),{type:Y,frameType:G,isCloudflare:j,micrioEmbed:H,hlsSrc:Z}=X;let J,K=ne(ue(X.src??a()));Y==En.Micrio&&v(!1),(Y==En.Micrio||Y==En.IFrame&&!G)&&f(!1);let tt=-1,rt=ne(ue(G==Sn.YouTube||G==Sn.Vimeo));const st=Y==En.Audio&&Js.iOS;let nt,at=ne(void 0);const ot=F.mediaState.get(I());ot&&(k(ot.currentTime),d(!v(ot.paused))),F.mediaState.set(I(),{get currentTime(){return k()??0},set currentTime(t){At(t)},get paused(){return v()},set paused(t){t?bt():vt()}});let ct=ne(void 0);{const t=$i(()=>_());if(t){const e=new _a($i(()=>$()),t);null!=k()&&k()>0&&(e.currentTime=k()),Y==En.VideoTour&&(y("duration"in t?Number(t.duration):t.i18n?.[i()]?.duration??0),o(NaN)),oe(ct,e,!0)}}const lt=$i(()=>_()&&!("steps"in _())?"subtitle"in _()?_().subtitle:_().i18n?.[n.lang]?.subtitle:void 0),ht=lt&&("fileUrl"in lt?lt.fileUrl:lt.src);let dt,ut=ne(!1),mt=ne(!1),ft=!1,pt=ne(!1);function gt(t){t&&"button"in t&&0!=t.button||(v()?vt():bt())}async function vt(t){if(!(t instanceof PointerEvent&&0!=t.button)&&(!ft||await async function(){return L()?L().paused:Ai(ct)?v():!!J&&J.isPaused()}())){switch(oe(mt,!1),y()>0&&null!=k()&&k()>=y()&&k(0),!x()&&ht&&U.set(ht),Y){case En.VideoTour:v(b(!1)),Ai(ct)?.play(),$t();break;case En.Audio:case En.Video:L()?.addEventListener("play",()=>{L()&&(isNaN(L().duration)?L().addEventListener("durationchange",yt,{once:!0}):yt())},{once:!0}),L()?.play().catch(t=>{M()?v(!0):/pause\(\)/.test(t.toString())||(oe(ut,!0),n.events.dispatch("media-blocked"),e.onblocked?.())});break;case En.IFrame:J?.play();break;default:return}ft=!0,D.dispatch("media-play"),B.set(!1),e.onplay?.(),T()||N||Ai(ct)&&!L()||z.set($().$settings.mutedVolume||0)}}function bt(){D.dispatch("media-pause"),B.set(!0),L()?(L().pause(),st&&v(!0)):Ai(ct)?(Ai(ct).pause(),v(!0),Pt()):J&&!Ai(Ft)&&J.pause()}function yt(){oe(ut,!1),v(!1),Ai(ct)&&L()&&(L().duration>Ai(ct).duration&&(Ai(ct).duration=L().duration),Ai(ct).currentTime=L().currentTime,Ai(ct).play())}function Tt(){b(!1),T()&&$()&&!$()._video&&$().video.set(L())}function xt(){Ai(mt)||(Ai(ct)?bt():(v(!0),Pt()),oe(mt,!0),D.dispatch("media-ended"),e.onended?.(),Dt())}function Et(t){L()?L(L().muted=t,!0):J&&J.setMuted(t)}function St(){oe(C,!Ai(C)),Et(Ai(C)),N||z.set(Ai(C)?1:$().$settings.mutedVolume||0)}function At(t){b(!0),L()?L(L().currentTime=t,!0):Ai(ct)?(k(Ai(ct).currentTime=t),b(!1)):J&&J.setCurrentTime(t)}function Mt(){Ai(ct)?(k(Ai(ct).currentTime),Ai(ct).ended&&xt()):J&&J.getCurrentTime().then(t=>{k(t)}),It()}function It(){x()||D.dispatch("timeupdate",k())}function $t(){tt>=0||(tt=setInterval(Mt,250),Mt())}function Pt(){clearInterval(tt),tt=-1}async function Lt(){if(j&&Z&&("MediaSource"in window||"ManagedMediaSource"in window)){const t=new Ma(L(),Z,{onReady:()=>b(!1),onEnded:xt});return await t.initialize(),void(J=t)}if(Y==En.IFrame&&Ai(at)){if(G==Sn.YouTube){const t=new Ea(Ai(at),{width:Ai(qt),height:Ai(Xt)},{onReady:()=>b(!1),onDurationChange:t=>y(t),onPlay:()=>{$t(),oe(pt,v(b(!1)),!0)},onPause:()=>{v(!0),Pt()},onEnded:xt,onBlocked:()=>{oe(pt,v(!0),!0),Pt()},onSeeking:()=>{Mt(),b(!0),Pt()}});return b(!0),await t.initialize(),void(J=t)}if(G==Sn.Vimeo){const t=new Sa(Ai(at),{width:Ai(qt),height:Ai(Xt)},{onReady:()=>b(!1),onPlay:()=>v(b(!1)),onPause:()=>v(!0),onSeeking:()=>b(!0),onSeeked:()=>b(!1),onTimeUpdate:t=>k(t),onDurationChange:t=>y(t),onEnded:xt});return b(!0),await t.initialize(),void(J=t)}}L()&&(j&&Z&&oe(K,Z,!0),function(){if(!L())return;L(L().ontimeupdate=It,!0),Ai(ct)&&(L(L().onpause=()=>{Rt=!!L()?.ended,L()?.ended||Ai(ct).pause()},!0),L(L().onseeked=()=>{!L()||L().ended||Rt||(Ai(ct).currentTime=L().currentTime,Ct&&(L().pause(),Ct=!1))},!0));null!=k()&&k()>0&&(L().duration>0?L(L().currentTime=k(),!0):L(L().oncanplay=()=>{L()&&(L(L().oncanplay=null,!0),d()||(L().play(),Ct=!0),L(L().currentTime=nt,!0))},!0));const t=u()&&void 0!==m()?m():-1;L(L().onended=t>=0?()=>{clearTimeout(dt),dt=setTimeout(()=>{w()||L()?.play()},1e3*t)}:xt,!0)}())}let Ct=!1,Rt=!1;function Dt(){N||z.set(1)}let Ft=ne(!1);const Ot=$i(()=>P()&&P().subscribe(t=>{t&&Nt()})),zt=()=>k(L()?.currentTime??0);function Nt(){Ai(Ft)||(oe(Ft,!0),Ot&&Ot(),T()&&$()&&$().video.set(void 0),F.mediaState.delete(I()),Pt(),bt(),Dt(),ht&&U.set(void 0),L()&&(L(L().onended=null,!0),st&&(L(L().onloadedmetadata=L(L().onplay=L(L().onseeking=L(L().onseeked=null,!0),!0),!0),!0),L().removeEventListener("timeupdate",zt)),L(L().ontimeupdate=L(L().onpause=L(L().onseeked=L(L().oncanplay=null,!0),!0),!0),!0)),Ai(ct)&&Ai(ct).destroy(),J&&(J.destroy(),J=void 0))}const Vt=Y==En.Video;let Ut=ne(ue($i(()=>Vt&&j&&1!=h()&&Js.iOS)));const Bt=R.is360?Math.PI/2:1,Wt=Ht(()=>Vt?h()*Bt:Y==En.IFrame?Math.max(h(),Math.min(c()/512,l()/512)):1),qt=Ht(()=>Vt?c():Math.round(c()/Ai(Wt)*Bt)),Xt=Ht(()=>Vt?l():Math.round(l()/Ai(Wt)*Bt));let Yt=ne(void 0),Gt=ne(void 0);const jt=Ht(()=>Ai(ct)&&_()?"events"in _()?_().events:_().i18n?.[i()]?.events??void 0:void 0);pr(()=>{e.onid?.(I()),a()&&st&&(L((xn||(xn=new Audio),xn)),L(L().controls=!1,!0),L(L().onloadedmetadata=()=>y(L()?.duration??0),!0),L(L().src=a(),!0),L(L().oncanplay=Tt,!0),L(L().onended=xt,!0),L().addEventListener("timeupdate",zt),L(L().onseeking=()=>b(!0),!0),L(L().onseeked=()=>b(!1),!0)),nt=k()||0,oe(rt,G==Sn.YouTube||G==Sn.Vimeo,!0),Lt().then(()=>{d()&&vt()}).catch(()=>{}),Ai(Ut)&&L()?.addEventListener("playing",()=>oe(Ut,!1),{once:!0});let t=!1;const i=n.isMuted.subscribe(e=>{t?(oe(C,e,!0),Et(e)):t=!0});return()=>{Nt(),i(),st&&L(void 0),J?.destroy()}}),Oe(()=>{void 0!==w()&&v(w())}),Oe(()=>{u()&&void 0!==m()&&clearTimeout(dt)});var Zt=Gi(),Jt=xe(Zt),Kt=t=>{var e=ja(),i=xe(e);let s;Yr(i,null);var n=_e(i);let a;as(n,"tabindex",-1);var h=_e(n),w=t=>{var e=Na();cs(e,t=>({...t,title:p(),src:Ai(K),width:Ai(qt),height:Ai(Xt),frameborder:"0",allow:"fullscreen *;autoplay *;encrypted-media *",[Hr]:{hooked:Ai(rt)&&!Ai(pt)}}),[()=>({credentialless:!0})],void 0,void 0,"micrio-media"),gs(e,t=>oe(at,t),()=>Ai(at)),function(t){if(!V)return;t.removeAttribute("onload"),t.removeAttribute("onerror");const e=t.__e;void 0!==e&&(t.__e=void 0,queueMicrotask(()=>{t.isConnected&&t.dispatchEvent(e)}))}(e),ji(t,e)},_=t=>{var e=Ba();e.controls=!1;var i=_e(e),r=t=>{var e=Ua(),i=xe(e),r=t=>{var e=Va();Ue(t=>as(e,"src",t),[()=>Ai(K).replace(".webm",".mp4")]),ji(t,e)},s=Ht(()=>A()&&Ai(K).endsWith(".webm"));vr(i,t=>{Ai(s)&&t(r)});var n=Ee(i,2);Ue(()=>{as(n,"src",Ai(K)),as(n,"type",j?"application/x-mpegURL":void 0)}),ji(t,e)};vr(i,t=>{Ai(K)&&t(r)}),q(e),gs(e,t=>L(t),()=>L()),Ue(()=>{e.loop=u()&&(null==m()||m()<=0),as(e,"width",c()),as(e,"height",l()),Yr(e,Ai(Ut)?"opacity: 0":void 0),e.muted=Ai(C),e.autoplay=!!d()}),Fi("canplay",e,Tt),Fi("ended",e,xt),vs("duration","durationchange",e,y),us(e,k),ms(e,b),fs(e,v),ji(t,e)},x=t=>{var e=Wa();e.controls=!1,gs(e,t=>L(t),()=>L()),Ue(()=>{as(e,"src",Ai(K)),e.muted=Ai(C)}),Fi("canplay",e,()=>b(!1)),Fi("ended",e,xt),vs("duration","durationchange",e,y),us(e,k),ms(e,b),fs(e,v),ji(t,e)},M=t=>{var e=qa();os(e,"data-logo","false"),Ue(()=>os(e,"id",H[0])),Ue(()=>os(e,"width",H[1])),Ue(()=>os(e,"height",H[2])),Ue(()=>os(e,"lang",H[3])),Ue(()=>os(e,"data-path",R.path)),ji(t,e)};vr(h,t=>{Y==En.IFrame?t(w):Y==En.Video?t(_,1):Y!=En.Audio||st?Y==En.Micrio&&H&&t(M,3):t(x,2)});var I=Ee(h,2),$=t=>{!function(t,e){et(e,!0);let i=ys(e,"currentTime",11,0);const r=Q("micrio");e.events.forEach(t=>{t.start=Number(t.start||0),t.end=Math.min(Number(t.end||0),e.duration)});const s=t=>e.events.forEach(e=>{const i=e.start<=t&&e.end>=t;i!=!!e.active&&(e.active=i,r.events.dispatch("tour-event",{...e}))});Oe(()=>{s(i())}),gr(()=>s(1/0)),it()}(0,{get events(){return Ai(jt)},get currentTime(){return k()},set currentTime(t){k(t)},get duration(){return y()},set duration(t){y(t)}})};vr(I,t=>{Ai(jt)?.length&&y()>0&&!Ai(Ft)&&t($)});var P=Ee(I,2),D=t=>{var e=Xa();let i;var r=_e(e);{let t=Ht(()=>!!ht),e=Ht(()=>!isNaN(o())),i=Ht(()=>T()||Y!=En.IFrame&&Y!=En.Video?E():Ai(Yt));!function(t,e){et(e,!0);const i=()=>kt(Wn,"$i18n",s),r=()=>kt($a,"$captionsEnabled",s),[s,n]=_t();let a=ys(e,"currentTime",15),o=ys(e,"duration",11,0),c=ys(e,"seeking",11,!0),l=ys(e,"minimal",3,!1),h=ys(e,"ended",15),d=ys(e,"fullscreen",3,void 0),u=ys(e,"subtitles",3,!1),m=ys(e,"hasAudio",3,!0),f=ys(e,"muted",3,!1),p=ne(void 0);function g(t){0==t.button&&(window.addEventListener("mousemove",v),window.addEventListener("mouseup",w),v(t))}function v(t){const i=Ai(p).getClientRects()[0],r=Math.min(1,Math.max(0,(t.clientX-i.left)/i.width));e.onseek?.(r*o())}function w(){window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",w)}var b=za(),y=xe(b),k=_e(y);{let t=Ht(()=>e.paused?"play":"pause"),r=Ht(()=>e.paused?i().play:i().pause);oa(k,{get type(){return Ai(t)},get title(){return Ai(r)},get onclick(){return e.onplaypause},children:(t,e)=>{var i=Gi(),r=xe(i),s=t=>{var e=Da(),i=_e(e);q(e),Ue(()=>as(i,"stroke-dashoffset",119.4*(1-a()/o()))),ji(t,e)};vr(r,t=>{l()&&void 0!==a()&&a()>0&&t(s)}),ji(t,i)},$$slots:{default:!0}})}var T=Ee(k,2),_=t=>{var s=Fa(),n=xe(s),a=t=>{{let r=Ht(()=>f()?"volume-off":"volume-up"),s=Ht(()=>f()?i().audioUnmute:i().audioMute);oa(t,{get disabled(){return c()},get type(){return Ai(r)},get title(){return Ai(s)},get onclick(){return e.onmute}})}};vr(n,t=>{m()&&t(a)});var o=Ee(n,2),l=t=>{{let e=Ht(()=>r()?"subtitles":"subtitles-off");oa(t,{get type(){return Ai(e)},get active(){return r()},get title(){return i().subtitlesToggle},onclick:()=>$a.set(!r())})}};vr(o,t=>{u()&&t(l)});var h=Ee(o,2),p=t=>{fa(t,{get el(){return d()}})};vr(h,t=>{d()&&t(p)}),ji(t,s)};vr(T,t=>{l()||t(_)}),q(y);var x=Ee(y,2),E=t=>{Ra(t,{get duration(){return o()},get currentTime(){return a()},set currentTime(t){a(t)},get ended(){return h()},set ended(t){h(t)},children:(t,e)=>{var i=Oa();gs(i,t=>oe(p,t),()=>Ai(p)),Ue(()=>Yr(i,`--progress:${(a()??0)/o()*100}%;`)),Oi("mousedown",i,g),ji(t,i)},$$slots:{default:!0}})};vr(x,t=>{l()||t(E)}),Oi("click",y,t=>t.stopPropagation()),Oi("keydown",y,t=>t.stopPropagation()),ji(t,b),it(),n()}(r,{get subtitles(){return Ai(t)},get hasAudio(){return Ai(e)},get muted(){return Ai(C)},get fullscreen(){return Ai(i)},onplaypause:gt,onmute:St,onseek:t=>At(t),get paused(){return v()},set paused(t){v(t)},get seeking(){return b()},set seeking(t){b(t)},get duration(){return y()},set duration(t){y(t)},get currentTime(){return k()},set currentTime(t){k(t)},get ended(){return Ai(mt)},set ended(t){oe(mt,t,!0)}})}q(e),Ue(()=>i=qr(e,1,"micrio-media",null,i,{inside:"inside"==f()})),ji(t,e)};vr(P,t=>{f()&&t(D)}),q(n),gs(n,t=>oe(Gt,t),()=>Ai(Gt));var F=Ee(n,2),O=t=>{var e=Ya();Er(e,g,!0),q(e),ji(t,e)};vr(F,t=>{g()&&t(O)}),q(i),gs(i,t=>oe(Yt,t),()=>Ai(Yt));var z=Ee(i,2),N=t=>{var e=Ga();as(e,"tabindex",-1),oa(_e(e),{get title(){return kt(Wn,"$i18n",r).play},type:"play"}),q(e),Oi("pointerup",e,vt),ji(t,e)};vr(z,t=>{Ai(ut)&&t(N)}),Ue(()=>{s=qr(i,1,Vr(S()),"micrio-media",s,{paused:v(),is360:T(),"media-video":Y==En.IFrame||Y==En.Video,"media-micrio":Y==En.Micrio}),Yr(n,1==Ai(Wt)||Y!=En.Video&&R.is360?"":`transform:scale(${Ai(Wt)})`),a=qr(n,1,"micrio-media",null,a,{videotour:!!Ai(ct)})}),Oi("pointerup",n,t=>{t.target==Ai(Gt)&>(t)}),ji(t,e)};vr(Jt,t=>{$().$settings.noUI||t(Kt)}),ji(t,Zt),it(),s()}zi(["pointerup"]);var Za=Wi("<article><!></article>");function Ja(t,e){et(e,!0);let i=ys(e,"cn",3,null);function r(t){t.target&&t.target instanceof HTMLAnchorElement&&!t.target.getAttribute("href")?.startsWith("#")&&(t.target.target="_blank")}var s=Za();fr(_e(s),()=>e.children??g),q(s),Ue(()=>qr(s,1,Vr(i()),"micrio-article")),Oi("click",s,t=>t.stopPropagation()),Oi("keydown",s,r),Oi("pointerdown",s,r),ji(t,s),it()}zi(["click","keydown","pointerdown"]);var Ka=Wi('<h1 class="micrio-marker-content"> </h1>'),Qa=Wi('<figcaption class="micrio-marker-content"> </figcaption>'),to=Wi('<button class="micrio-marker-content"><figure class="micrio-marker-content"><img class="micrio-marker-content"/> <!></figure></button>'),eo=Wi('<section class="micrio-marker-content"></section>'),io=Wi("<!> <!>",1),ro=Wi("<main><!> <!> <!> <!> <!> <!> <!></main>");function so(t,e){et(e,!0);const i=()=>kt(m,"$tour",s),r=()=>kt(u,"$lang",s),[s,n]=_t();let a=ys(e,"noEmbed",3,!1),o=ys(e,"noImages",3,!1),c=ys(e,"noGallery",3,!1),l=ys(e,"_content",15),h=ys(e,"_title",15);const d=Q("micrio"),u=d._lang,m=d.state.tour,f=i()&&"steps"in i()&&i().isSerialTour,p=Q("markerImages").get($i(()=>e.marker).id),g=p.$settings._markers??{},v=!g.preventAutoPlay,w=$i(()=>!e.marker.data?.preventImageOpen&&!c()),b=$i(()=>1==e.marker.images?.length),y=Ht(()=>Ln(e.marker,r())),k=Ht(()=>!(Ai(y)?.title||Ai(y)?.audio||e.marker.images&&e.marker.images.length||Ai(y)?.embedUrl||e.marker.videoTour||Ai(y)?.body||Ai(y)?.bodySecondary)),T=()=>{i()&&"steps"in i()&&(i().isSerialTour||g.tourAutoProgress)&&e.onclose?.()};const _=Ht(()=>!v||!e.marker?.audioAutoPlay),x=Ht(()=>!1===e.marker?.embedAutoPlay||!v||!(!Ai(y)?.audio||!e.marker?.audioAutoPlay)),E=p.tileBase?.includes("micrio.dev"),S=t=>t.i18n?.[r()]?.title,A=Ht(()=>e.marker.videoTour?.i18n?.[r()]?.audio??Ai(y)?.audio),M=Ht(()=>Pn(Ai(A))),I=Ht(()=>b&&e.marker.images?.[0]?.i18n?.[r()]?.description);var $=Gi(),P=xe($),L=t=>{var i=ro();let r;var s=_e(i),n=t=>{var e=Ka(),i=_e(e,!0);q(e),gs(e,t=>h(t),()=>h()),Ue(()=>nr(i,Ai(y).title)),ji(t,e)};vr(s,t=>{Ai(y).title&&t(n)});var c=Ee(s,2),u=t=>{Ja(t,{children:(t,e)=>{var i=Gi();Er(xe(i),()=>Ai(y).body),ji(t,i)},$$slots:{default:!0}})};vr(c,t=>{Ai(y).body&&g.primaryBodyFirst&&t(u)});var m=Ee(c,2),A=t=>{{let i=Ht(()=>e.marker.audioAutoPlay||!Ai(y).audio&&!!e.marker.videoTour),r=Ht(()=>!e.marker.videoTour||!Ai(y)||!Ai(y).embedUrl);Ha(t,{get src(){return Ai(M)},noPlayOverlay:!0,get image(){return p},get uuid(){return e.marker.id},get tour(){return e.marker.videoTour},get autoplay(){return Ai(i)},get controls(){return Ai(r)},onended:T,get paused(){return Ai(_)}})}};vr(m,t=>{!f&&((!Ai(y)||!Ai(y).embedUrl)&&e.marker.videoTour||Ai(y)&&Ai(y).audio)&&t(A)});var $=Ee(m,2),P=t=>{var i=eo();yr(i,21,()=>e.marker.images,t=>t.id??t.src,(t,i)=>{var r=to(),s=_e(r),n=_e(s),a=Ee(n,2),o=t=>{var e=Qa(),i=_e(e,!0);q(e),Ue(()=>nr(i,Ai(I))),ji(t,e)};vr(a,t=>{Ai(I)&&t(o)}),q(s),q(r),Ue((t,e,i)=>{as(r,"title",t),r.disabled=!w,as(n,"alt",e),as(n,"src",i)},[()=>S(Ai(i)),()=>S(Ai(i)),()=>Ai(i).micrioId?`https://iiif.${E?"micrio.dev":"micr.io"}/${Ai(i).micrioId}/full/${b?"^"+Math.min(Ai(i).width,640)+",":"^,320"}/0/default.webp`:Ai(i).src]),Oi("click",r,function(...t){(w?()=>{return t=Ai(i).micrioId,void(w&&d.state.popover.set({gallery:e.marker.images,galleryStart:t,image:p}));var t}:void 0)?.apply(this,t)}),ji(t,r)}),q(i),ji(t,i)};vr($,t=>{!o()&&e.marker.images?.length&&t(P)});var L=Ee($,2),C=t=>{var i=io(),r=xe(i),s=t=>{Ha(t,{get image(){return p},className:"hidden",get uuid(){return e.marker.id},get tour(){return e.marker.videoTour},get autoplay(){return v},secondary:!0})};vr(r,t=>{!Ai(y).audio&&e.marker.videoTour&&t(s)});var n=Ee(r,2);{let t=Ht(()=>!Ai(x));Ha(n,{get image(){return p},get src(){return Ai(y).embedUrl},get uuid(){return e.marker.id},width:400,height:240,controls:!0,get title(){return Ai(y).embedTitle},get figcaption(){return Ai(y).embedDescription},get autoplay(){return Ai(t)},onended:T,get paused(){return Ai(x)}})}ji(t,i)};vr(L,t=>{Ai(y).embedUrl&&!a()&&t(C)});var R=Ee(L,2),D=t=>{Ja(t,{children:(t,e)=>{var i=Gi();Er(xe(i),()=>Ai(y).body),ji(t,i)},$$slots:{default:!0}})};vr(R,t=>{Ai(y).body&&!g.primaryBodyFirst&&t(D)});var F=Ee(R,2),O=t=>{Ja(t,{cn:"secondary",children:(t,e)=>{var i=Gi();Er(xe(i),()=>Ai(y).bodySecondary),ji(t,i)},$$slots:{default:!0}})};vr(F,t=>{Ai(y).bodySecondary&&t(O)}),q(i),gs(i,t=>l(t),()=>l()),Ue(()=>r=qr(i,1,"micrio-marker-content",null,r,{empty:Ai(k)})),ji(t,i)};vr(P,t=>{Ai(y)&&t(L)}),ji(t,$),it(),n()}zi(["click"]);var no=Wi('<button class="micrio-button tour-step micrio-marker-popup" disabled=""> </button>'),ao=Wi("<!> <!> <!>",1),oo=Wi('<progress class="progress micrio-marker-popup"></progress> <!>',1),co=Wi('<div><aside class="micrio-marker-popup"><!> <!> <!></aside> <!></div>');function lo(t,e){et(e,!0);const i=()=>kt(l,"$tour",n),r=()=>kt(c,"$current",n),s=()=>kt(Wn,"$i18n",n),[n,a]=_t(),o=Q("micrio"),{current:c}=o,l=o.state.tour,h=Q("markerImages").get($i(()=>e.marker).id),d=h.$settings._markers??{},u=Ht(()=>i()&&"steps"in i()?o.canvases.find(t=>t.$data?.markerTours?.find(t=>t.id===i().id)):void 0),m=$i(()=>e.marker.data||{}),f=d.canMinimizePopup;let p=ne(void 0);function g(t){i()&&Ai(w)&&"steps"in i()?t instanceof Event&&Ai(T)?l.set(void 0):i().next?.():r()&&!h.opts.secondaryTo&&r().id!=h.id&&m.micrioLink?.id==r().id?(o.open(h.id),h.state.marker.set(void 0),o.state.popup.set(void 0)):h.state.marker.set(void 0)}const v=Ht(()=>i()&&"steps"in i()?i():void 0),w=Ht(()=>Ai(v)&&Ai(v)?.steps.findIndex(t=>t.startsWith(e.marker.id))>=0),b=Ht(()=>Ai(w)&&!Ai(v)?.isSerialTour&&(Ai(u)?.$settings._markers?.tourControlsInPopup??d.tourControlsInPopup)),y=Ht(()=>Ai(w)&&!Ai(v)?.isSerialTour&&(Ai(u)?.$settings._markers?.tourStepCounterInPopup??d.tourStepCounterInPopup)),k=Ht(()=>Ai(v)?.currentStep??-1),T=Ht(()=>Ai(b)||(Ai(v)?Ai(v).currentStep==Ai(v).steps.length-1:void 0));let _=ne(!1);const x=(t=!1)=>{Ai(v)&&(t?Ai(v).prev?.():Ai(v).next?.(),oe(_,!0),setTimeout(()=>oe(_,!1),200))};let E=ne(!1),S=ne(void 0),A=ne(void 0);const M=new WeakMap,I=()=>{if(oe(E,!Ai(E)),Ai(S))for(let t=0;t<Ai(S).children.length;t++){const e=Ai(S).children[t];e instanceof HTMLElement&&e!=Ai(A)&&(M.has(e)||(M.set(e,e.offsetHeight),e.style.height=e.offsetHeight+"px"),setTimeout(()=>{e.style.height=Ai(E)?"0px":M.get(e)+"px"},100))}};let $=ne(!1);pr(()=>{e.marker.tags?.forEach(t=>Ai(p)?.classList.add(t)),setTimeout(()=>Ai(p)?.querySelector("button")?.focus(),500);const t="embedImages"in e.marker?e.marker.embedImages:void 0;t&&o.$current?.data.update(e=>(e||(e={embeds:[]}),e.embeds=[...e.embeds??[],...t],e));const i=o.state.popup.subscribe(t=>oe($,!t||t!=e.marker,!0));return()=>{i(),t&&o.$current?.data.update(e=>e?.embeds?(e.embeds=e.embeds.filter(e=>!t.find(t=>t.id==e.id)),e):e)}});var P=co();let L;var C=_e(P),R=_e(C),D=t=>{{let e=Ht(()=>!Ai(w)||Ai(T)?"close":"arrow-right"),i=Ht(()=>!Ai(w)||Ai(T)?s().closeMarker:s().tourStepNext);oa(t,{get type(){return Ai(e)},get title(){return Ai(i)},get disabled(){return Ai(_)},onclick:g})}};vr(R,t=>{m.alwaysOpen||t(D)});var F=Ee(R,2),O=t=>{{let e=Ht(()=>Ai(E)?"arrow-up":"arrow-down");oa(t,{get type(){return Ai(e)},get title(){return s().minimize},onclick:I})}};vr(F,t=>{f&&t(O)});var z=Ee(F,2),N=t=>{var e=oo(),r=xe(e);as(r,"aria-hidden",!0),ma(Ee(r,2),{className:"micrio-tour-controls",children:(t,e)=>{var r=ao(),n=xe(r);{let t=Ht(()=>Ai(_)||0==Ai(k));oa(n,{type:"arrow-left",get disabled(){return Ai(t)},get title(){return s().tourStepPrev},onclick:()=>x(!0)})}var a=Ee(n,2),o=t=>{var e=no(),r=_e(e);q(e),Ue(()=>nr(r,`${Ai(k)+1} / ${i().steps.length??""}`)),ji(t,e)};vr(a,t=>{Ai(y)&&t(o)});var c=Ee(a,2);{let t=Ht(()=>Ai(_)||Ai(k)+1==i().steps.length);oa(c,{type:"arrow-right",get disabled(){return Ai(t)},get title(){return s().tourStepNext},onclick:()=>x()})}ji(t,r)},$$slots:{default:!0}}),Ue(()=>function(t,e){var i=ls(t);i.value!==(i.value=e??void 0)&&(t.value!==e||0===e&&t.nodeName===rs)&&(t.value=e??"")}(r,(Ai(k)+1)/i().steps.length)),ji(t,e)};vr(z,t=>{Ai(b)&&i()&&"steps"in i()&&t(N)}),q(C),so(Ee(C,2),{get marker(){return e.marker},onclose:g,get _content(){return Ai(S)},set _content(t){oe(S,t,!0)},get _title(){return Ai(A)},set _title(t){oe(A,t,!0)}}),q(P),gs(P,t=>oe(p,t),()=>Ai(p)),Ue(()=>L=qr(P,1,"micrio-marker-popup",null,L,{destroying:Ai($),minimized:Ai(E)})),Rr(3,P,()=>On,()=>d.popupAnimation),ji(t,P),it(),a()}var ho=Wi('<li><button class="micrio-serial-tour"> </button></li>'),uo=Wi('<ol class="micrio-serial-tour"></ol>'),mo=Wi("<!> <!> <!> <!>",1),fo=Wi('<div role="progressbar"></div>'),po=Wi('<!> <aside class="micrio-media-controls micrio-serial-tour"><!> <!></aside> <!>',1);function go(t,e){et(e,!0);const i=()=>kt(l,"$lang",n),r=()=>kt(Wn,"$i18n",n),s=()=>kt($a,"$captionsEnabled",n),[n,a]=_t(),o=$i(()=>e.tour).stepInfo,c=Q("micrio"),l=c._lang,h=c.$current,d=c.state.marker,u=!!h.$settings?.ui?.controls?.serialTourNoTimeScrub,m=o.reduce((t,e)=>t+e.duration,0)??0,f=$i(()=>"controls"in e.tour?!1!==e.tour.controls:!e.tour.noControls);let p=ne(!1),g=ne(!1),v=ne(!1);Oe(()=>c.isMuted.subscribe(t=>{oe(v,t,!0)}));let w=ne(void 0),b=ne(void 0),y=ne(0),k=ne("");function T(){const t=c.state.mediaState.get(Ai(k));t&&(t.paused=oe(p,!t.paused)),Ai(p)?(c.events.dispatch("serialtour-pause",e.tour),c.events.enabled.set(!0)):(c.events.dispatch("serialtour-play",e.tour),c.events.enabled.set(!1))}function _(t,i){if(!e.tour.goto)return;const r=t==e.tour.currentStep;if(u&&r)return;r||e.tour.goto(t);const s=!u&&i?i.offsetX/i.target.offsetWidth:0;o.forEach((e,r)=>e.ended=!i&&r<t),S();const n=o[t];n.currentTime=s*n.duration,r&&Ai(w)?.instance&&(Ai(w).instance.currentTime=n.currentTime),M(t)}function x(){c.isMuted.update(t=>!t)}function E(){const t=Ai(b);t&&(t.ended=!0),null!=e.tour.currentStep&&e.tour.currentStep<e.tour.steps.length-1&&e.tour.next?e.tour.next():(oe(p,oe(g,!0),!0),e.onended?.()),Si().then(()=>{S(),t&&(t.ended=!1)})}function S(){e.tour.stepInfo?.forEach(t=>t.currentTime=0)}const A=vt([]);function M(t=e.tour.currentStep??0){const i=o.map((e,i)=>i<t||e.ended||Ai(g)?100:i==t?Math.round((e.currentTime||0)/e.duration*1e4)/100:0);oe(y,i.reduce((t,e,i)=>t+e/100*o[i].duration,0),!0),A.set(i)}function I(t){const i=t&&!!e.tour.steps.find(e=>e.startsWith(t.id));oe(w,void 0),i&&t.videoTour&&setTimeout(()=>{const i=o[e.tour.currentStep??0];i.markerId==t.id&&(i.ended=!1,oe(b,i,!0),oe(w,t.videoTour,!0),M())},10)}const $=t=>t.i18n?t.i18n[i()]?.title:t.title;pr(()=>{const t=()=>M();c.addEventListener("timeupdate",t);const e=d.subscribe(I);return()=>{e(),c.removeEventListener("timeupdate",t),S()}});const P=Ht(()=>Ai(w)?"audio"in Ai(w)?Ai(w).audio:Ai(w).i18n?.[i()]?.audio:void 0),L=Ht(()=>Pn(Ai(P))),C=Ht(()=>!!Ai(b)?.hasSubtitle),R=Ht(()=>o.some(t=>t.hasSubtitle));var D=po(),F=xe(D),O=t=>{var e=uo();yr(e,21,()=>o,wr,(t,e,i)=>{var r=Gi(),s=xe(r),n=t=>{var r=ho();let s;var n=_e(r),a=_e(n,!0);q(n),q(r),Ue(t=>{s=qr(r,1,"micrio-serial-tour",null,s,{active:Ai(b)&&Ai(b).chapter==i,enriched:Ai(e).imageHasOtherMarkers}),nr(a,t)},[()=>$(Ai(e).marker)]),Oi("click",n,()=>_(i)),ji(t,r)},a=Ht(()=>$(Ai(e).marker));vr(s,t=>{Ai(a)&&t(n)}),ji(t,r)}),q(e),ji(t,e)};vr(F,t=>{e.tour.printChapters&&t(O)});var z=Ee(F,2),N=_e(z),V=t=>{{let e=Ht(()=>!Ai(p));Ha(t,{get tour(){return Ai(w)},get src(){return Ai(L)},get autoplay(){return Ai(e)},onid:t=>oe(k,t,!0),onended:E,onplay:()=>oe(p,!1),onblocked:()=>oe(p,!0),get currentTime(){return Ai(b).currentTime},set currentTime(t){Ai(b).currentTime=t}})}};vr(N,t=>{Ai(w)&&Ai(b)&&t(V)});var U=Ee(N,2),B=t=>{var e=mo(),i=xe(e);{let t=Ht(()=>Ai(p)?"play":"pause"),e=Ht(()=>Ai(p)?r().play:r().pause);oa(i,{get type(){return Ai(t)},get title(){return Ai(e)},onclick:T})}var n=Ee(i,2);{let t=Ht(()=>Ai(v)?"volume-off":"volume-up"),e=Ht(()=>Ai(v)?r().audioUnmute:r().audioMute);oa(n,{get type(){return Ai(t)},get title(){return Ai(e)},onclick:x})}var a=Ee(n,2),o=t=>{{let e=Ht(()=>!Ai(C)),i=Ht(()=>s()?"subtitles":"subtitles-off");oa(t,{get disabled(){return Ai(e)},get type(){return Ai(i)},get active(){return s()},get title(){return r().subtitlesToggle},onclick:()=>$a.set(!s())})}};vr(a,t=>{Ai(R)&&t(o)}),fa(Ee(a,2),{get el(){return c}}),ji(t,e)};vr(U,t=>{f&&t(B)}),q(z);var W=Ee(z,2),X=t=>{Ra(t,{get duration(){return m},get currentTime(){return Ai(y)},set currentTime(t){oe(y,t,!0)},get ended(){return Ai(g)},set ended(t){oe(g,t,!0)},children:(t,i)=>{var r=Gi();yr(xe(r),17,()=>o,wr,(t,i,r)=>{var s=Gi(),a=xe(s),o=t=>{var s=fo();let a;Ue(t=>{a=qr(s,1,"bar",null,a,{active:r==e.tour.currentStep}),as(s,"title",t),Yr(s,`width:${Ai(i).duration/m*100}%; --progress: ${kt(A,"$times",n)[r]||0}%`)},[()=>$(Ai(i).marker)]),Oi("click",s,t=>_(r,t)),Fi("keypress",s,t=>{"Enter"===t.key&&_(r)}),ji(t,s)};vr(a,t=>{Ai(i).duration>0&&t(o)}),ji(t,s)}),ji(t,r)},$$slots:{default:!0}})};vr(W,t=>{f&&t(X)}),ji(t,D),it(),a()}zi(["click"]);var vo=Wi('<article class="scroll-tour micrio-tour"></article> <!>',1),wo=Wi("<!> <!> <!>",1),bo=Wi("<div><!> <!></div>");function yo(t,e){et(e,!0);const i=()=>kt(h,"$_lang",s),r=()=>kt(Wn,"$i18n",s),[s,n]=_t();let a=ys(e,"noHTML",3,!1);const o=Q("micrio"),{events:c,state:l,_lang:h}=o,d=l.$tour,u=o.$current,m=u.$data,f=u.$settings,p=o.canvases[0].grid,g=u.state.marker,v="steps"in e.tour&&e.tour.isSerialTour,w=!("steps"in e.tour),b="scrollable"in e.tour&&e.tour.scrollable,y="steps"in e.tour&&("controls"in e.tour?!1!==e.tour.controls:!!e.tour.noControls),k=!(!v&&"steps"in e.tour&&f._markers?.tourControlsInPopup),T=k&&(w||v),_=!!f._markers?.keepPopupsDuringTourTransitions,x=()=>M(Ai(C)-1),E=()=>M(Ai(C)+1),S=()=>c.enabled.set(!0);let A;function M(t){if(!("steps"in e.tour)||!e.tour.stepInfo)return;const i=e.tour.stepInfo[t];if(i&&i.markerId==o.state.$marker?.id)return I(i);const r=e.tour.stepInfo[Ai(C)]?.micrioImage?.state;r&&r.marker.set(void 0),o.$current?.state.marker.set(void 0),_||o.state.popup.set(void 0),o.removeEventListener("marker-opened",S),g.set(void 0),i&&(A=setTimeout($,200,i))}async function I(t){let i=u,r=!1;if(p&&!t.gridView&&p.images.find(e=>e.id==t.micrioId)){const s=!!("steps"in e.tour&&e.tour.stepInfo&&t)&&e.tour.stepInfo?.indexOf(t)<Ai(C),n=t.marker.data?.gridTourTransition??t.marker.data?._meta?.gridTourTransition,a=n?.startsWith("slide")?"slide":"swipe";await Si().then(()=>{const e=p.focus(i=p.images.find(e=>e.id==t.micrioId),{view:t.startView,transition:n==a||n==`${a}-horiz`?s?`${a}-left`:`${a}-right`:n==`${a}-vert`?s?`${a}-up`:`${a}-down`:"behind"==n?s?"behind-left":"behind-right":n}).catch(()=>r=!0);return o.events.enabled.set(!1),e})}else if(o.$current?.id!=t.micrioId){if(t.gridView&&t.marker.data?._meta?.gridAction&&p){t.micrioImage||(t.micrioImage=p.images.find(e=>e.id==t.micrioId)),i=t.micrioImage;const e=t.marker.data._meta.gridAction.split("|");p.action(e.shift(),e.join("|"))}else"steps"in e.tour&&e.tour.stepInfo&&oe(C,e.tour.stepInfo.indexOf(t),!0),i=o.open(t.micrioId,{gridView:t.gridView,startView:t.startView});await Si()}else i=o.$current;return[i,r]}async function $(t){let i=u,r=!1;t.micrioId&&([i,r]=await I(t)),r||(t.micrioImage||(t.micrioImage=i),c.enabled.set(!1),i.state.marker.set(t.markerId),o.addEventListener("marker-opened",S,{once:!0}),await Si(),c.dispatch("tour-step",e.tour))}function P(){l.tour.set(void 0)}function L(){c.dispatch("tour-ended",e.tour),(e.tour.closeOnFinish||!e.tour.cannotClose&&y)&&P()}let C=ne(-1),R=ne(!1);const D=u.camera.getView(),F=f._markers;if("steps"in e.tour){const t=d;t.prev=x,t.next=E,t.goto=M,Oe(()=>{t.currentStep=Ai(C)})}const O=vt(!1);let z;function N(){O.set(!1),clearTimeout(z),z=setTimeout(()=>O.set(!0),5e3)}O.subscribe(t=>c.dispatch("tour-minimize",t));let V,U=ne(void 0);function B(t){if(!("steps"in e.tour)||!Ai(U))return;const i=e.tour.steps,r=t.filter(t=>t.isIntersecting).map(t=>t.target)[0];if(r)for(let e=0;e<Ai(U).children.length;e++)if(Ai(U).children[e]==r){const t=m.markers?.find(t=>t.id==i[e].split(",")[0]);return void(t&&o.$current?.camera.flyToView(t.view).catch(()=>{}))}}let W=[];pr(()=>("steps"in e.tour&&bn(u,e.tour,i(),u.$data).then(()=>function(t){if(b||o.$current?.state.$marker||void 0!==t.initialStep&&M(t.initialStep),b&&Ai(U)){V=new IntersectionObserver(B,{root:Ai(U),threshold:1});for(let t=0;t<Ai(U).children.length;t++)V.observe(Ai(U).children[t])}W.push(o.state.marker.subscribe(e=>{if(!e)return void oe(R,!1);const i="string"==typeof e?e:e.id,r=t.steps.findIndex(t=>t.startsWith(i));if(r>=0&&t.stepInfo){const e=t.stepInfo[oe(C,r,!0)];e&&!e.micrioImage&&(e.micrioImage=o.canvases.find(t=>t.id==e.micrioId)??p?.images.find(t=>t.id==e.micrioId)??o.$current)}oe(R,r<0)}))}(e.tour)),y||W.push(O.subscribe(t=>e.onminimize?.(t))),a()||"steps"in e.tour&&!v||!1===e.tour.minimize||(o.addEventListener("pointermove",N),o.addEventListener("touchstart",N),N()),T&&o.setAttribute("data-tour-active",""),()=>{for(clearTimeout(z),clearTimeout(A);W.length;)W.shift()?.();o.removeEventListener("pointermove",N),o.removeEventListener("touchstart",N),o.removeEventListener("marker-opened",S),T&&o.removeAttribute("data-tour-active"),S(),V&&V.disconnect();const t=o.state.$marker;if("steps"in d&&d.stepInfo&&null!=d.currentStep){const e=d.stepInfo[d.currentStep];delete d.goto,delete d.next,delete d.prev,t&&e?.markerId==t.id&&(e.micrioImage?.state.marker.set(void 0),o.state.marker.set(void 0))}u.camera.aniDone=void 0,p||"steps"in d&&d.keepLastStep||o.$current==u||o.open(u.id),Si().then(()=>{c.dispatch("tour-stop",d),"steps"in d&&delete d.currentStep,!("steps"in d)&&F?.zoomOutAfterClose&&!t&&D&&u.camera.flyToView(D,{speed:F?.zoomOutAfterCloseSpeed})})})),c.dispatch("tour-start",e.tour);let Y=ne(0),G=ne(!1);const j=Ht(()=>"steps"in e.tour?void 0:e.tour),H=Ht(()=>Ai(j)?"audio"in e.tour?e.tour.audio:Ai(j).i18n?.[i()]?.audio:void 0),Z=Ht(()=>Pn(Ai(H)));var J=Gi(),K=xe(J),tt=t=>{var i=Gi(),n=xe(i),a=t=>{var i=vo(),s=xe(i);yr(s,21,()=>e.tour.steps.map(t=>m.markers&&m.markers.find(e=>e.id==t.split(",")[0])),wr,(t,e)=>{var i=Gi(),r=xe(i),s=t=>{lo(t,{get marker(){return Ai(e)}})};vr(r,t=>{Ai(e)&&t(s)}),ji(t,i)}),q(s),gs(s,t=>oe(U,t),()=>Ai(U));var n=Ee(s,2),a=t=>{oa(t,{type:"close",get title(){return r().tourStop},className:"scroll-tour-end",onclick:P})};vr(n,t=>{e.tour.cannotClose||t(a)}),ji(t,i)},c=t=>{var i=bo();let n;var a=_e(i),c=t=>{var i=Gi(),s=xe(i),n=t=>{go(t,{get tour(){return e.tour},onended:L})},a=t=>{var i=wo(),s=xe(i);{let t=Ht(()=>0==Ai(C));oa(s,{type:"arrow-left",get title(){return r().tourStepPrev},get disabled(){return Ai(t)},onclick:x})}var n=Ee(s,2);oa(n,{noClick:!0,children:(t,i)=>{X();var r=Yi();Ue(()=>nr(r,`${Ai(C)+1} / ${e.tour.steps.length??""}`)),ji(t,r)},$$slots:{default:!0}});var a=Ee(n,2);{let t=Ht(()=>Ai(C)==e.tour.steps.length-1);oa(a,{type:"arrow-right",get title(){return r().tourStepNext},get disabled(){return Ai(t)},onclick:E})}ji(t,i)};vr(s,t=>{v?t(n):t(a,-1)}),ji(t,i)},l=t=>{Ha(t,{get tour(){return e.tour},get src(){return Ai(Z)},get fullscreen(){return o},controls:!0,autoplay:!0,onended:L,get paused(){return Ai(G)},set paused(t){oe(G,t,!0)},get currentTime(){return Ai(Y)},set currentTime(t){oe(Y,t,!0)}})};vr(a,t=>{"steps"in e.tour?t(c):t(l,-1)});var h=Ee(a,2),d=t=>{oa(t,{type:"close",get title(){return r().close},onclick:P})};vr(h,t=>{e.tour.cannotClose||t(d)}),q(i),Ue(()=>n=qr(i,1,"micrio-tour",null,n,{left:v,"serial-tour":v,"video-tour":w,"no-controls":y,minimized:!Ai(G)&&(kt(O,"$minimized",s)||Ai(R))})),Rr(1,i,()=>Fn,()=>({duration:200})),ji(t,i)},l=t=>{Ha(t,{get tour(){return Ai(j)},get src(){return Ai(Z)},autoplay:!0,onended:L,get currentTime(){return Ai(Y)},set currentTime(t){oe(Y,t,!0)}})};vr(n,t=>{b&&"steps"in e.tour?t(a):k?t(c,1):Ai(j)&&t(l,2)}),ji(t,i)},rt=t=>{Ha(t,{get tour(){return Ai(j)},get src(){return Ai(Z)},autoplay:!0,onended:L,get currentTime(){return Ai(Y)},set currentTime(t){oe(Y,t,!0)}})};vr(K,t=>{a()?Ai(j)&&t(rt,1):t(tt)}),ji(t,J),it(),n()}var ko,To=class{get currentIndex(){return this.micrio.wasm.getActiveImageIdx(this.image.ptr)}constructor(t,e,i,r={}){this.micrio=t,this.length=e,this.goto=i,this.opts=r,this.hitTresh=!1,this.snapTo=[],this.pointers=new Map,this.isFullWidth=!1,this.startedWithShift=!1,this.isDragging=()=>2==this.pointers.size||(this.isFullWidth||this.startedWithShift)&&1==this.pointers.size,r.sensitivity||(r.sensitivity=Number(t.getAttribute("data-swipe-sensitivity")??1));const s=t.getAttribute("data-swipe-snap");s&&(this.snapTo=s.split(",").map(Number)),this.micrio.setAttribute("data-hooked",""),this.dStart=this.dStart.bind(this),this.dMove=this.dMove.bind(this),this.dStop=this.dStop.bind(this),this.mouseleave=this.mouseleave.bind(this),this.image=t.$current,this.image.state.view.subscribe(t=>this.isFullWidth=r.coverLimit?this.image.camera.isZoomedOut():!t||Math.round(1e3*t[3])/1e3>=1),t.wasm.setNoPinchPan(!0),t.wasm.setIsSwipe(!0),this.micrio.canvas.element.addEventListener("pointerdown",this.dStart)}destroy(){this.micrio.canvas.element.removeEventListener("pointerdown",this.dStart),this.mouseleave()}dStart(t){this.startedWithShift=t.shiftKey;const e=!this.isDragging();this.pointers.set(t.pointerId,!0),this.pointers.size>2&&this.mouseleave(),e&&(this.hitTresh=!1,this.micrio.setAttribute("data-panning",""),this.startIndex=this.currentIndex,this.startX=t.clientX,this.firstTouchId=t.pointerId,this.micrio.addEventListener("pointermove",this.dMove),this.micrio.addEventListener("pointerup",this.dStop),this.micrio.setPointerCapture(t.pointerId))}dMove(t){if(!this.isDragging()||t.pointerId!=this.firstTouchId||void 0===this.startX||void 0===this.startIndex)return;if(!this.hitTresh&&void 0!==this.startX&&(this.hitTresh=2!=this.pointers.size||Math.abs(t.clientX-this.startX)>(this.micrio.events.pinchFactor&&this.micrio.events.pinchFactor>1.25?.3:.15)*this.micrio.offsetWidth)&&(this.startX=t.clientX),!this.hitTresh)return;const e=this.micrio.$current.camera,i=this.opts.continuous?Math.max(.1,(e.getXY(1,.5)[0]-e.getXY(0,.5)[0])/this.micrio.offsetWidth):1,r=Math.round((t.clientX-this.startX)/(this.micrio.offsetWidth*i)*this.length*(this.opts.sensitivity??1));let s=this.startIndex-r;if(this.opts.continuous){for(;s<0;)s+=this.length;for(;s>this.length-1;)s-=this.length}s=Math.max(0,Math.min(this.length-1,s)),s!=this.currentIndex&&this.goto(s)}dStop(t){this.pointers.delete(t.pointerId),t.pointerId==this.firstTouchId&&(this.micrio.releasePointerCapture(this.firstTouchId),this.firstTouchId=void 0),this.pointers.size||this.swipeEnd()}mouseleave(){this.pointers.clear(),this.swipeEnd()}swipeEnd(){if(this.micrio.removeAttribute("data-panning"),this.micrio.removeEventListener("pointermove",this.dMove),this.micrio.removeEventListener("pointerup",this.dStop),this.hitTresh=!1,this.snapTo.length){const t=this.snapTo[this.snapTo.map((t,e)=>[e,Math.abs(t-this.currentIndex)]).sort((t,e)=>t[1]>e[1]?1:t[1]<e[1]?-1:0)[0][0]];t!=this.currentIndex&&this.animateTo(t)}}animateTo(t){this.raf&&cancelAnimationFrame(this.raf);const e=performance.now(),i=this.currentIndex,r=i-t,s=t=>{const n=Math.min(1,(t-e)/250);n<1&&(this.raf=requestAnimationFrame(s));const a=i-Math.round(this.micrio.wasm.ease(n)*r);a!=this.currentIndex&&this.goto(a)};this.raf=requestAnimationFrame(s)}},_o={0:[0,-.5,1,0],90:[1,0,1.5,1],180:[0,1,1,1.5],270:[-.5,0,0,1]},xo={0:[0,-1,1,0],90:[1,0,2,1],180:[0,1,1,2],270:[-1,0,0,1]},Eo={0:[0,1,1,2],90:[-1,0,0,1],180:[0,-1,1,0],270:[1,0,2,1]},So=t=>[t,0,t+1,1];!function(t){let e;let i;(e||(e=t.Grid||(t.Grid={}))).GridActionType=function(t){return t[t.focus=0]="focus",t[t.flyTo=1]="flyTo",t[t.focusWithTagged=2]="focusWithTagged",t[t.focusTagged=3]="focusTagged",t[t.reset=4]="reset",t[t.back=5]="back",t[t.switchToGrid=6]="switchToGrid",t[t.filterTourImages=7]="filterTourImages",t[t.nextFadeDuration=8]="nextFadeDuration",t}({}),(i||(i=t.Camera||(t.Camera={}))).TimingFunction=function(t){return t[t.ease=0]="ease",t[t["ease-in"]=1]="ease-in",t[t["ease-out"]=2]="ease-out",t[t.linear=3]="linear",t}({})}(ko||(ko={}));var Ao=Wi('<span class="micrio-dial"> </span>'),Mo=Wi('<div data-scroll-through="" class="micrio-dial"><!></div>');var Io,$o=Wi("<button>✥</button>"),Po=Wi("<span></span>"),Lo=Wi('<span class="hover-label micrio-gallery"> </span>'),Co=Wi('<div><!> <ul><span class="track micrio-gallery"><span class="track-fill micrio-gallery"></span></span> <span class="ticks micrio-gallery"></span> <!> <button aria-label="Gallery position" role="slider" tabindex="0"></button> <span> </span></ul> <!></div>');function Ro(t,e){et(e,!0);const i=()=>kt(b,"$settings",n),r=()=>kt(w,"$layer",n),s=()=>kt(Wn,"$i18n",n),[n,a]=_t();let o=ys(e,"images",19,()=>[]),c=ys(e,"omni",3,null);const l=$i(()=>o()),h=$i(()=>c()),d=Q("micrio"),{wasm:u,current:m,events:f,_lang:p}=d,g=kt(m,"$current",n),v=g.$info,w=g.state.layer,b=g.settings,y=g.camera;if(h)for(let q=0;q<h.frames;q++)l.push({id:v.id+"/"+q,image:g,visible:vt(!1),frame:q,opts:{area:[0,0,1,1]},ptr:-1,baseTileIdx:-1,thumbSrc:g.getTileSrc(g.levels,0,0,q)});const k=i().gallery,T="omni"==k.type,_=T||"swipe-full"==k.type,x=_||"switch"==k.type,E=!x&&l.length>1&&!("frame"in(l[0]??{})),S=T,A=!!k.isSpreads,M=k.coverPages??0,I=i().omni,$=T&&!!I?.twoAxes,P=k.startId||d.getAttribute("data-gallery-start-id"),L=k.archive,C=!!i().limitToCoverScale,R=!!i().noUI,D=I?.frontIndex??0,F=I?.layers?.length??1,O=d.hasAttribute("data-gallery-start")?Number(d.getAttribute("data-gallery-start")):i()?.omni?.startIndex;let z=null==O||isNaN(O)?P?l.findIndex(t=>t.id==P):0:O;z<0&&(z=0);const N=[],V=[];if(E)for(let q=0;q<l.length;q++)N.push([0,0,1,1]),V.push([q]);else if(l)for(let q=0;q<l.length;q++){let t=l[q].opts?.area;if(!t)continue;const e=t.slice(0);if(V.push([q]),A&&q-M>=0&&(q-M)%2==0&&l[q+1]){if(t=l[++q].opts?.area,!t)continue;V[V.length-1].push(q),e[2]=t[2],e[3]=t[3]}N.push(e)}const U=N.length/F,B=I?.layers?.map(t=>({i18n:Object.fromEntries(Object.entries(t.i18n).map(([t,e],i)=>[t,{title:e??"Layer "+(i+1)}]))}))??[];Object.keys(v.revision??{[(()=>kt(p,"$_lang",n))()]:0}).forEach(t=>B.forEach((e,i)=>{e.i18n[t]||(e.i18n[t]={title:"Layer "+(i+1)})}));let W=ne(-1),X=x,Y=ne(!0),G=ne(!1),j=ne(!0),H=!1,Z=ne(0);function J(t,e=!1,i=150,r=!1){if(S){for(;t<0;)t+=U;t%=U}const s=t=Math.round(Math.max(0,Math.min(U-1,t))),n=r||s!=Ai(W);if(oe(W,s,!0),n&&tt(),E)!function(t,e,i,r){if(!l[t])return;const s=0===i?0:e?K/2:K,n=l[Ai(W)>-1&&Ai(W)!=t?Ai(W):-1],a=r&&s>0&&n?.camera&&!n.camera.isZoomedOut(),o=()=>{u.setGridTransitionDuration(s);for(let e=0;e<l.length;e++){const i=l[e];if(!i?.camera)continue;const r=i.opts.area??[0,0,1,1],n=r[0],a=n>=-1&&n<=1,o=e-t,c=So(o),h=Math.abs(o)<=1,d=Math.abs(r[0]-c[0])>1e-4||Math.abs(r[2]-c[2])>1e-4,u=s>0&&d&&(a||h);i.camera.setArea(c,{direct:!u,noDispatch:!0})}u.render()};a?n.camera.flyToCoverView({duration:1e3*s*.6,speed:2}).then(o).catch(o):o()}(Ai(W),e,i,n);else if(x){if(n)if(u.setActiveImage(g.ptr,V[Ai(W)][0],V[Ai(W)].length-1),T)u.render();else{const t=N[Ai(W)];y.flyToView([t[0],t[1],t[2]-t[0],t[3]-t[1]],{duration:i,speed:2}).then(()=>ot(N[Ai(W)],!0)).catch(()=>{}),ee()}}else{const r=y.getViewLegacy(),s=N[t],a=sn.fromLegacy(s),o=H&&(X&&!Ai(G)||n||r[0]<s[0]!=r[2]>s[2]);oe(G,!1),o?y.flyToView(a,{duration:i,speed:1,progress:e?.5:0}).then(()=>ot(s,!0)).catch(()=>{}):(a&&0==i&&y.setView(a),ot(s,!0))}g.album.hooked=H=!0}const K=.35;function tt(t){if(Kt&&t){if(Kt.currentIndex==Ai(W))return;oe(W,Kt.currentIndex,!0)}at(Ai(W)),f.dispatch("gallery-show",Ai(W)),T&&oe(Z,(Ai(W)-D)/U*360),E&&g.album?.currentImage?.set(l[Ai(W)])}const rt="requestIdleCallback"in self?T?Math.max(36,2*Math.floor(l.length/8)):100:50,st=new Map,nt=self.requestIdleCallback??self.requestAnimationFrame;function at(t){const e=[];B.length&&(t+=r()*Math.floor(o().length/B.length)),A&&t>=M&&(t=2*t-M);const i=Math.floor(t/qt);for(let r=-rt;r<=rt;r++)if(r){let s=t+r;if($){const t=Math.floor(s/qt);t<i&&(s+=qt),t>i&&(s-=qt)}if(S){for(;s<0;)s+=o().length;for(;s>=o().length;)s-=o().length}e.push(s)}if($)for(let r=-rt;r<=rt;r++)r&&e.push(t+r*qt);e.filter((t,i)=>t>=0&&t<o().length&&e.indexOf(t)==i).map(t=>o()[t]).filter(t=>!!t&&!st.has(t.id)).forEach(t=>st.set(t.id,nt(()=>u.getTexture(t.baseTileIdx,t.thumbSrc,!1,{force:!!L}))))}function ot(t,e){X=y.isZoomedOut(),y.setLimit(!e&&X?[-1,t[1],2,t[3]]:t)}const ct=16;function lt(t){if(!Ai(ut))return 0;const e=Ai(ut).clientWidth;return ct+t/Math.max(1,U-1)*(e-32)}function ht(t){const e=V[t];return e?.length?1===e.length?String(e[0]+1):`${e[0]+1}–${e[e.length-1]+1}`:String(t+1)}let dt,ut=ne(void 0),mt=ne(0);const ft=Ht(()=>!Ai(ut)||Ai(Y)?Ai(mt):lt(Ai(W)));let pt=!1;function gt(t){t.preventDefault(),t.stopPropagation(),Ai(Y)||(pt="button"in t)&&0!=t.button||!Ai(ut)||(dt=Ai(ut).getClientRects()[0],d.keepRendering=oe(Y,!0),oe(Et,-1),window.addEventListener(pt?"pointermove":"touchmove",bt),window.addEventListener(pt?"pointerup":"touchend",At),bt(t))}function wt(t){const e=dt??Ai(ut).getClientRects()[0],i="button"in t?t.clientX:t.touches[0].clientX,r=Math.min(1,Math.max(0,(i-e.left-ct)/(e.width-32)));return[r,Math.max(0,Math.min(U-1,Math.round(r*Math.max(1,U-1))))]}function bt(t){const[e,i]=wt(t);oe(mt,ct+e*(dt.width-32)),i!=Ai(W)&&J(i,!0)}let yt,Tt,xt,Et=ne(-1);function St(t){Ai(Y)||oe(Et,wt(t)[1],!0)}function At(){window.removeEventListener(pt?"pointermove":"touchmove",bt),window.removeEventListener(pt?"pointerup":"touchend",At),oe(Y,d.keepRendering=!1,!0),J(Ai(W))}function Mt(){X&&(Tt=yt=Ai(W),oe(G,X,!0),ot(N[Ai(W)],!1))}function It(t){const e=t.detail;"panend"!=t.type||e?J(Tt!=Ai(W)?Tt:Ai(W)+(yt==Ai(W)&&Ai(G)&&e?Math.round(Math.min(1,Math.max(-1,-e.movedX/e.duration))):0)):oe(G,!1)}function $t(t){if(!t)return;const e=sn.toCenterJSON(t),i=e.centerX,r=N.map((t,r)=>(1-Math.min(Math.abs(i-t[0]),Math.abs(i-t[2])))*Math.max(0,(Math.min(i+e.width/2,t[2])-Math.max(i-e.width/2,t[0]))/(t[2]-t[0]))*(1-.1*Math.abs(Ai(W)-r)));u.setFocus(g.ptr,N[Tt=r.every(t=>!t)?Ai(W):r.indexOf(Math.max(...r))],Ai(G)),X=y.isZoomedOut()}let Pt=0,Lt=0,Ct=0,Rt=0,Dt=!1,Ft=!1,Ot=0;function zt(t){l[Ai(W)]?.camera?.isZoomedOut()&&0==t.button&&void 0===xt&&(xt=t.pointerId,Pt=Lt=t.clientX,Ot=t.clientY,Ct=t.timeStamp,Rt=0,Dt=!1,Ft=!1,window.addEventListener("pointermove",Nt),window.addEventListener("pointerup",Vt),window.addEventListener("pointercancel",Vt))}function Nt(t){if(t.pointerId!==xt)return;const e=t.clientX-Pt,i=t.clientY-Ot;if(!Dt){if(Math.abs(e)<6&&Math.abs(i)<6)return;if(Ft=Math.abs(e)>Math.abs(i),!Ft)return void Vt(t);Dt=!0,d.setAttribute("data-panning",""),d.keepRendering=!0,d.canvas.element.setPointerCapture(t.pointerId)}const r=Math.max(1,t.timeStamp-Ct);Rt=(t.clientX-Lt)/r,Lt=t.clientX,Ct=t.timeStamp,function(t){const e=0==Ai(W)&&t>0,i=Ai(W)==l.length-1&&t<0,r=e||i?Math.sign(t)*Math.sqrt(Math.abs(t))*.3:t;l[Ai(W)]?.camera?.setArea(So(r),{direct:!0,noDispatch:!0}),r<0&&Ai(W)<l.length-1?l[Ai(W)+1]?.camera?.setArea(So(1+r),{direct:!0,noDispatch:!0}):r>0&&Ai(W)>0&&l[Ai(W)-1]?.camera?.setArea(So(-1+r),{direct:!0,noDispatch:!0});u.render()}(e/(d.offsetWidth||1))}function Vt(t){if(t.pointerId!==xt)return;window.removeEventListener("pointermove",Nt),window.removeEventListener("pointerup",Vt),window.removeEventListener("pointercancel",Vt);const e=Dt;if(xt=void 0,Dt=!1,d.removeAttribute("data-panning"),d.keepRendering=!1,!e)return;try{d.canvas.element.releasePointerCapture(t.pointerId)}catch(n){}const i=d.offsetWidth||1,r=(t.clientX-Pt)/i;let s=Ai(W);r<-.3||Rt<-.5?s=Math.min(l.length-1,Ai(W)+1):(r>.3||Rt>.5)&&(s=Math.max(0,Ai(W)-1)),J(s)}let Ut=0,Bt=[0,0,0,0];function Wt(t){t.stopPropagation(),t.preventDefault(),0==t.button&&(oe(Y,!0),Bt=[t.clientX,t.clientY,Ai(W),Ut],window.addEventListener("pointermove",Yt),window.addEventListener("pointerup",Gt))}const qt=l.length,Xt=1;function Yt(t){Ut=Math.max(0,Math.min(Xt-1,Bt[3]+Math.round((Bt[1]-t.clientY)/360*Xt)));let e=(Bt[2]+Math.round((Bt[0]-t.clientX)/360*qt))%qt;for(;e<0;)e+=qt;J(Ut*qt+e)}function Gt(){removeEventListener("pointermove",Yt),removeEventListener("pointerup",Gt),oe(Y,!1)}let jt=-1;const Zt=()=>{B.length&&g.data.update(t=>{t||(t={}),t.pages||(t.pages=[]);const e={id:"_omni-layers",i18n:B[r()].i18n,icon:Gn.layerGroup,children:B.map((t,e)=>({id:"omni-layer-"+e,i18n:t.i18n,action:()=>{w.set(e),at(Ai(W))}})).filter(t=>t.id!="omni-layer-"+r())};return jt>=0&&jt<t.pages.length?t.pages.splice(jt,1,e):t.pages.push(e),jt=t.pages.length-1,t})};let Jt,Kt,Qt=d.state.ui.hidden,te=d.state.ui.hover;function ee(){Qt.set(!1),clearTimeout(Jt),Jt=setTimeout(()=>Qt.set(!0),2e3)}g.album={numPages:N.length,get currentIndex(){return Ai(W)},info:g.$settings.album,prev:()=>J(Ai(W)-1),next:()=>J(Ai(W)+1),goto:J,...E?{currentImage:vt(l[z])}:{}},pr(()=>{(E?Promise.all(l.map(t=>u.addChild(t,g))):Promise.all(o().map(t=>("state"in t&&!("image"in t)&&(t.camera=g.camera),u.addEmbed(t,g,{opacity:0,asImage:"camera"in t}))))).then(()=>{if(E){u.setGridTransitionTimingFunction(ko.Camera.TimingFunction["ease-out"]);for(let t=0;t<l.length;t++){const e=l[t];e.camera&&(e.camera.setCoverLimit(!1),e.camera.setArea(So(t-z),{direct:!0,noDispatch:!0}),e.camera.setView([0,0,1,1],{noRender:!0}))}oe(W,z,!0),tt(),g.album.hooked=H=!0,u.render()}else u.setActiveImage(g.ptr,z),J(z,!1,0);oe(Y,!1)}),T&&F>1&&Zt(),oe(j,!1),d.goto=J;const t=[],e=[];if(T&&t.push(g.state.layer.subscribe(Zt)),_&&(Kt=g.swiper=new To(d,U,J,{continuous:S,coverLimit:C})),e.push(()=>{d.canvas.element.removeEventListener("pointermove",ee),d.canvas.element.removeEventListener("pointerdown",ee)}),T||$||_||(d.canvas.element.addEventListener("pointermove",ee),d.canvas.element.addEventListener("pointerdown",ee),ee()),x&&t.push(g.state.view.subscribe(()=>{X=y.isZoomedOut()})),!(x||_||o().length<=1))if($||oe(mt,lt(z),!0),E){const t=zt;d.canvas.element.addEventListener("pointerdown",t),e.push(()=>d.canvas.element.removeEventListener("pointerdown",t))}else t.push(g.state.view.subscribe($t)),d.addEventListener("panstart",Mt),d.addEventListener("panend",It),d.addEventListener("pinchend",It),e.push(()=>{d.removeEventListener("panstart",Mt),d.removeEventListener("panend",It),d.removeEventListener("pinchend",It)});return T&&d.addEventListener("move",tt),()=>{for(Kt&&Kt.destroy();t.length;)t.shift()?.();for(;e.length;)e.shift()?.();T&&d.removeEventListener("move",tt),te.set(!1)}});var ie=Gi();Fi("keydown",pe,function(t){if(!i().omni?.noKeys){switch(t.key){case"PageUp":case"ArrowLeft":J(Ai(W)-(T?-1:1),!0);break;case"PageDown":case"ArrowRight":J(Ai(W)+(T?-1:1),!0);break;case"ArrowUp":$&&J(Ai(W)+qt);break;case"ArrowDown":$&&J(Ai(W)-qt);break;case"Home":J(0);break;case"End":J(U);break;default:return}ee()}});var re=xe(ie),se=t=>{var e=Gi(),r=xe(e),a=t=>{var e=$o();let i;Ue(()=>i=qr(e,1,"angular micrio-gallery",null,i,{dragging:Ai(Y)})),Fi("pointerdown",e,Wt,!0),ji(t,e)},c=t=>{{let e=Ht(()=>i().omni?.showDegrees);!function(t,e){et(e,!0);const i=Q("micrio"),r=i.$current.camera;let s,n=ne(void 0),a=0,o=0;function c(t){const s=Math.max(1,(r.getXY(1,.5)[0]-r.getXY(0,.5)[0])/i.offsetWidth),c=(o/360+(a-t.clientX)/(Ai(n).offsetWidth*s))*e.frames;e.onturn?.(c)}function l(){s&&i.releasePointerCapture(s),i.removeAttribute("data-panning"),i.removeEventListener("pointermove",c),i.removeEventListener("pointerup",l)}const h=Ht(()=>-e.currentRotation/360*(Ai(n)?.offsetWidth??0));var d=Mo(),u=_e(d),m=t=>{var i=Ao(),r=_e(i);q(i),Ue(t=>nr(r,`${t??""}º`),[()=>Math.round(10*e.currentRotation)/10]),ji(t,i)};vr(u,t=>{e.degrees&&t(m)}),q(d),gs(d,t=>oe(n,t),()=>Ai(n)),Ue(()=>Yr(d,`--micrio-dial-offset:${Ai(h)??""}px;`)),Fi("pointerdown",d,function(t){t.stopPropagation(),t.preventDefault(),0==t.button&&(i.addEventListener("pointermove",c),i.addEventListener("pointerup",l),i.setAttribute("data-panning",""),i.setPointerCapture(s=t.pointerId),o=e.currentRotation,a=t.clientX)},!0),ji(t,d),it()}(t,{get currentRotation(){return Ai(Z)},get frames(){return U},get degrees(){return Ai(e)},onturn:t=>J(t)})}},h=t=>{const e=Ht(()=>U),i=Ht(()=>l.length),r=Ht(()=>Ai(e)>24),a=Ht(()=>Ai(r)?Math.max(1,Math.ceil(Ai(e)/24)):1),c=Ht(()=>Ai(e)>1?Ai(W)/(Ai(e)-1)*100:0);var h=Co();let d;var u=_e(h);{let t=Ht(()=>0==Ai(W));oa(u,{type:"arrow-left",get title(){return s().galleryPrev},className:"gallery-btn",onpointerdown:t=>0===t.button&&J(Ai(W)-1),get disabled(){return Ai(t)}})}var m=Ee(u,2);let f;var p=_e(m),g=_e(p);q(p);var v=Ee(p,2);yr(v,21,()=>N,wr,(t,i,s)=>{var n=Gi(),o=xe(n),c=t=>{var i=Po();let n;Ue(()=>{n=qr(i,1,"tick micrio-gallery",null,n,{major:Ai(r)&&s%(5*Ai(a))==0,active:s===Ai(W),hover:s===Ai(Et)}),Yr(i,`left:${Ai(e)>1?s/(Ai(e)-1)*100:50}%`)}),ji(t,i)};vr(o,t=>{Ai(r)&&s%Ai(a)!==0&&s!==Ai(e)-1&&s!==Ai(W)||t(c)}),ji(t,n)}),q(v);var w=Ee(v,2),b=t=>{var i=Lo(),r=_e(i,!0);q(i),Ue(t=>{Yr(i,`left:${Ai(e)>1?Ai(Et)/(Ai(e)-1)*100:50}%`),nr(r,t)},[()=>ht(Ai(Et))]),ji(t,i)};vr(w,t=>{Ai(Et)>=0&&Ai(Et)!==Ai(W)&&!Ai(Y)&&t(b)});var y=Ee(w,2);let k;as(y,"aria-valuemin",1);var T=Ee(y,2);let _;var x=_e(T);q(T),q(m),gs(m,t=>oe(ut,t),()=>Ai(ut));var E=Ee(m,2);{let t=Ht(()=>Ai(W)==o().length-1);oa(E,{type:"arrow-right",get title(){return s().galleryNext},className:"gallery-btn",onpointerdown:t=>0===t.button&&J(Ai(W)+1),get disabled(){return Ai(t)}})}q(h),Ue(t=>{d=qr(h,1,"micrio-gallery",null,d,{hidden:Ai(j)||kt(Qt,"$hidden",n)&&!kt(te,"$hover",n)&&!Ai(Y)&&!Ai(G)}),f=qr(m,1,"micrio-gallery",null,f,{dense:Ai(r)}),Yr(g,`width:${Ai(c)}%`),k=qr(y,1,"handle micrio-gallery",null,k,{dragging:Ai(Y)}),Yr(y,`left: ${Ai(ft)}px`),as(y,"aria-valuemax",Ai(i)),as(y,"aria-valuenow",(V[Ai(W)]?.[0]??Ai(W))+1),_=qr(T,1,"handle-label micrio-gallery",null,_,{dragging:Ai(Y)}),Yr(T,`left: ${Ai(ft)}px`),nr(x,`${t??""}${Ai(r)?` / ${Ai(i)}`:""}`)},[()=>ht(Ai(W))]),Oi("pointerover",h,()=>te.set(!0)),Oi("pointerout",h,t=>{t.currentTarget.contains(t.relatedTarget)||te.set(!1)}),Oi("focusin",h,()=>te.set(!0)),Oi("focusout",h,t=>{t.currentTarget.contains(t.relatedTarget)||te.set(!1)}),Fi("pointerdown",m,gt,!0),Fi("touchstart",m,gt,!0,!0),Oi("pointermove",m,St),Fi("pointerleave",m,()=>oe(Et,-1)),ji(t,h)};vr(r,t=>{$?t(a):I&&!I.noDial&&T?t(c,1):!_&&o().length>1&&t(h,2)}),ji(t,e)};vr(re,t=>{R||t(se)}),ji(t,ie),it(),a()}zi(["pointerover","pointerout","focusin","focusout","pointermove"]);var Do,Fo,Oo={},zo=vt(),No=vt(!1);function Vo(t,e,i){Fo&&(Fo.setPosition?Fo.setPosition(t,e,i):"positionX"in Fo&&(Fo.positionX.value=t,Fo.positionY.value=e,Fo.positionZ.value=i))}function Uo(t,e,i){Fo&&(Fo.setOrientation?Fo.setOrientation(t,e,i,0,1,0):"forwardX"in Fo&&(Fo.forwardX.value=t,Fo.forwardY.value=e,Fo.forwardZ.value=i))}function Bo(t,e){et(e,!0);const[i,r]=_t();let s=ys(e,"volume",3,1);const{events:n,current:a}=Q("micrio"),o=kt(a,"$current",i),c=o.$info,l=c.height/c.width,h="AudioContext"in window||"webkitAudioContext"in window;const d=()=>No.set(!0),u=new Audio("data:audio/mpeg;base64,/+MYxAAAAANIAUAAAASEEB/jwOFM/0MM/90b/+RhST//w4NFwOjf///PZu////9lns5GFDv//l9GlUIEEIAAAgIg8Ir/JGq3/+MYxDsLIj5QMYcoAP0dv9HIjUcH//yYSg+CIbkGP//8w0bLVjUP///3Z0x5QCAv/yLjwtGKTEFNRTMuOTeqqqqqqqqqqqqq/+MYxEkNmdJkUYc4AKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq");u.volume=Js.iOS?0:1e-4,h&&pr(()=>{let t,i;return i=No.subscribe(r=>{r&&(Do||(!function(t){if(!Io){if(Do||(Do="micrioAudioContext"in window?window.micrioAudioContext:"AudioContext"in window?new window.AudioContext:"webkitAudioContext"in window?new window.webkitAudioContext:null),!Do)return console.warn("[Micrio] Your browser does not support the Web Audio API");(Io=Do.createGain()).connect(Do.destination),Io.gain.value=t,zo.set(Do),"upX"in(Fo=Do.listener)&&(Fo.upX.value=0,Fo.upY.value=1,Fo.upZ.value=0)}}(s()),n.dispatch("audio-init")),Do&&e.data.markers?.filter(t=>!!t.positionalAudio).length&&(t=o.state.view.subscribe(t=>{if(!t)return;const i=Math.max(0,1.05-o.camera.getScale());!function(t,i,r){if(e.is360){t*=2*-Math.PI,i-=.5,i*=-Math.PI;const e=10*(1-r),s=Math.cos(i)*Math.sin(t)*e,n=Math.sin(i)*e,a=Math.cos(i)*Math.cos(t)*e;Vo(s,n,a);let o=s*s+n*n+a*a;o>0&&(o=1/Math.sqrt(o)),Uo(s*o,n*o,a*o)}else Vo(2*(t-.5),2*(.5-i)*l,r),Uo(0,0,-1)}(t[0]+t[2]/2,t[1]+t[3]/2,i*(e.is360?1:1.5))})),i&&(i(),i=null))}),Do||u.play().then(d).catch(()=>{n.dispatch("autoplay-blocked"),addEventListener("pointerup",d,{once:!0})}),()=>{t&&t(),i&&i(),removeEventListener("pointerup",d)}}),Oe(()=>{Io&&(Io.gain.value=s())});var m=Gi(),f=xe(m),p=t=>{{let t=Ht(()=>s()*(e.data.music.volume??1));!function(t,e){et(e,!0);let i=ys(e,"loop",3,!0),r=ys(e,"volume",3,1);const s=ue(new Audio);s.preload="none",s.loop=!1,s.onended=a;let n=-1;function a(){if(!i()&&n+1==e.list.length)return;const t=e.list[++n%e.list.length];s.src=Pn(t)??"",s.play()}pr(()=>(a(),()=>s.pause())),Oe(()=>{s.volume=r()}),it()}(0,{get list(){return e.data.music.items},get loop(){return e.data.music.loop},get volume(){return Ai(t)}})}};vr(f,t=>{kt(No,"$interacted",i)&&kt(zo,"$ctx",i)&&e.data.music?.items.length&&t(p)}),ji(t,m),it(),r()}var Wo=Wi('<cite class="micrio-details"> </cite>'),qo=Wi('<small class="micrio-details"> </small>'),Xo=Wi('<summary class="micrio-details"><!> <!></summary>'),Yo=Wi('<p class="micrio-details"><a rel="noopener noreferrer" target="_blank"> </a></p>'),Go=Wi("<details><!> <!> <!> <!></details>");function jo(t,e){et(e,!0);const i=()=>kt(o,"$current",s),r=()=>kt(e.data,"$data",s),[s,n]=_t(),{_lang:a,current:o}=Q("micrio");let c=ne(!1);function l(t){let e="cm";return t>=1e5?(e="km",t/=1e5):t>=100?(e="m",t/=100):t<1e-6?(e="nm",t*=1e7):t<.001?(e="µm",t*=1e4):t<1&&(e="mm",t*=10),t.toFixed(2)+" "+e}const h=Ht(()=>i()?.$settings.cmWidth),d=Ht(()=>i()?.$settings.cmHeight),u=Ht(()=>r()?r()?.i18n?r().i18n[kt(a,"$_lang",s)]:r():void 0),m=Ht(()=>Ai(u)?.title??kt(e.info,"$info",s)?.title??""),f=Ht(()=>Ai(u)?.description),p=Ht(()=>Ai(u)?.sourceUrl),g=Ht(()=>Ai(u)?.copyright),v=Ht(()=>Ai(h)&&Ai(d)?l(Ai(h))+" x "+l(Ai(d)):null);let w=ne(void 0);pr(()=>{Ai(w).ontoggle=()=>{oe(c,Ai(w).open,!0)}});var b=Gi(),y=xe(b),k=t=>{var e=Go();let i;var r=_e(e),n=t=>{var e=Xo(),i=_e(e),r=t=>{var e=Wo(),i=_e(e,!0);q(e),Ue(()=>nr(i,Ai(m))),ji(t,e)};vr(i,t=>{Ai(m)&&t(r)});var s=Ee(i,2),n=t=>{var e=qo(),i=_e(e,!0);q(e),Ue(()=>nr(i,Ai(v))),ji(t,e)};vr(s,t=>{Ai(v)&&t(n)}),q(e),ji(t,e)};vr(r,t=>{(Ai(m)||Ai(v))&&t(n)});var a=Ee(r,2),o=t=>{var e=Gi();Er(xe(e),()=>Ai(f)),ji(t,e)};vr(a,t=>{Ai(f)&&t(o)});var l=Ee(a,2),h=t=>{var e=Yo(),i=_e(e),r=_e(i,!0);q(i),q(e),Ue(()=>{as(i,"href",Ai(p)),nr(r,Ai(g)||Ai(p))}),ji(t,e)};vr(l,t=>{Ai(p)&&t(h)});var d=Ee(l,2),u=t=>{oa(t,{type:"close",get title(){return kt(Wn,"$i18n",s).close},onclick:()=>Ai(w).open=!1})};vr(d,t=>{Ai(c)&&t(u)}),q(e),gs(e,t=>oe(w,t),()=>Ai(w)),Ue(()=>i=qr(e,1,"micrio-details",null,i,{opened:Ai(c)})),Rr(3,e,()=>Fn,()=>({duration:200})),ji(t,e)};vr(y,t=>{(Ai(m)||Ai(f)||Ai(p))&&t(k)}),ji(t,b),it(),n()}var Ho=Wi('<div class="micrio-error"><!> </div>');var Zo=Wi('<figcaption class="micrio-micrio-gallery"></figcaption>'),Jo=Wi('<figure class="micrio-micrio-gallery"><micr-io></micr-io> <!></figure>',2);function Ko(t,e){et(e,!0);const i=()=>kt(o,"$current",r),[r,s]=_t();let n=ys(e,"startId",3,void 0);const{_lang:a,current:o}=Q("micrio");let c=ne(void 0),l=ne(0);const h=Ht(()=>e.gallery[Ai(l)]),d=Ht(()=>Ai(h)?.i18n?.[kt(a,"$_lang",r)]?.description??void 0);gr(()=>Ai(c)?.destroy());var u=Jo(),m=_e(u);Ue(()=>os(m,"data-gallery",e.gallery.map(t=>`${t.micrioId},${t.width},${t.height},${t.isDeepZoom?"d":""}${t.isWebP?",w":t.isPng||!i()?.isV5&&t.src?.endsWith(".png")?",p":""}`).join(";"))),Ue(()=>os(m,"data-start",n())),Ue(()=>os(m,"data-path",i()&&i().$info&&i().$info.path)),os(m,"data-logo","false"),qr(m,1,"micrio-micrio-gallery"),gs(m,t=>oe(c,t),()=>Ai(c));var f=Ee(m,2),p=t=>{var e=Zo();Er(e,()=>Ai(d),!0),q(e),ji(t,e)};vr(f,t=>{Ai(d)&&t(p)}),q(u),Fi("gallery-show",m,t=>{oe(l,t.detail,!0)}),ji(t,u),it(),s()}var Qo=Wi("<!> <!>",1),tc=Wi("<aside><!> <!></aside>"),ec=Wi("<!> <!>",1),ic=Wi('<menu class="micrio-popover"></menu>'),rc=Wi('<h2 class="micrio-popover"> </h2>'),sc=Wi('<img alt=""/>'),nc=Wi("<!> <!> <!> <!>",1),ac=Wi('<menu class="right micrio-popover"></menu>'),oc=Wi("<!> <!> <!>",1),cc=Wi("<dialog><!> <!></dialog>");function lc(t,e){et(e,!0);const i=()=>kt(h,"$current",n),r=()=>kt(d,"$_lang",n),s=()=>kt(Wn,"$i18n",n),[n,a]=_t(),o=ue(Q("micrio")),{events:c,state:l,current:h,_lang:d}=o,u=i()?.$data,m=Object.keys(u?.revision??{[r()]:0});function f(){Ai(w)?.close()}const p=vt(!1);let g=ne(!0),v=r(),w=ne(void 0);pr(()=>{Ai(w).showModal(),Si().then(()=>{(Ai(w).querySelector("button.active")??Ai(w).querySelector("button"))?.focus()});const t=d.subscribe(t=>{t&&t!=v&&(oe(g,!1),v=t,setTimeout(()=>oe(g,!0),200))});return()=>{t()}});const b=Ht(()=>e.popover.marker),y=Ht(()=>Ai(b)?Ln(Ai(b),r()):void 0),k=Ht(()=>e.popover.markerTour),T=Ht(()=>e.popover.contentPage),_=Ht(()=>{return Ai(T)?(t=Ai(T),e=r(),t.i18n?.[e]??t):void 0;var t,e}),x=Ht(()=>Ai(T)&&Ai(_)&&!Ai(T)?.buttons?.length?!(!Ai(_).embed||Ai(_).content&&!(Ai(_).content.length<250)||Ai(T).image):void 0),E=Ht(()=>Ai(T)?.image?"string"==typeof Ai(T).image?Ai(T).image:Ai(T).image.src:void 0),S=Ht(()=>!!Ai(_)?.embed||!!Ai(E)),A=Ht(()=>!!Ai(T)?.buttons?.find(t=>"close"==t.type)),M=Ht(()=>!!e.popover.marker?.images&&e.popover.marker.images.length>0),I=Ht(()=>!(!Ai(y)||!Ai(y).body)||Ai(M)),$=Ht(()=>Ai(y)&&Ai(y).body||Ai(M)&&Ai(_)?.embed),P=Ht(()=>!Ai(A)||Ai(k)&&null!=Ai(k).currentStep);var L=cc();let C;var R=_e(L),D=t=>{var e=tc();let i;var r=_e(e),n=t=>{oa(t,{type:"close",get title(){return s().close},className:"close-popover",onclick:f})};vr(r,t=>{Ai(A)||t(n)});var a=Ee(r,2),o=t=>{var e=Qo(),i=xe(e),r=t=>{oa(t,{type:"arrow-left",get title(){return s().tourStepPrev},className:"prev-tour-step",onclick:()=>Ai(k)&&Ai(k).prev&&Ai(k).prev()})};vr(i,t=>{Ai(k).currentStep>0&&t(r)});var n=Ee(i,2),a=t=>{oa(t,{type:"arrow-right",get title(){return s().tourStepNext},className:"next-tour-step",onclick:()=>Ai(k)&&Ai(k).next&&Ai(k).next()})};vr(n,t=>{Ai(k).currentStep<Ai(k).steps.length-1&&t(a)}),ji(t,e)};vr(a,t=>{Ai(k)&&null!=Ai(k).currentStep&&t(o)}),q(e),Ue(()=>i=qr(e,1,"micrio-popover",null,i,{inside:Ai(T)?!Ai(x):!Ai(I)&&!Ai(y)?.embedUrl})),ji(t,e)};vr(R,t=>{Ai(P)&&t(D)});var F=Ee(R,2),O=t=>{var e=ec(),i=xe(e),r=t=>{Ha(t,{get src(){return Ai(y).embedUrl},get uuid(){return Ai(b).id},get figcaption(){return Ai(y).embedDescription},controls:!0,get autoplay(){return Ai(b).embedAutoPlay}})},s=t=>{Ko(t,{get gallery(){return Ai(b).images}})};vr(i,t=>{Ai(y)&&Ai(y).embedUrl?t(r):Ai(b).images&&Ai(b).images.length&&t(s,1)});var n=Ee(i,2),a=t=>{{let e=Ht(()=>!Ai(y)||!Ai(y).embedUrl);so(t,{get marker(){return Ai(b)},noEmbed:!0,noGallery:!0,get noImages(){return Ai(e)},onclose:f})}};vr(n,t=>{Ai($)&&t(a)}),ji(t,e)},z=t=>{Ko(t,{get gallery(){return e.popover.gallery},get startId(){return e.popover.galleryStart}})},N=t=>{var e=oc(),s=xe(e),n=t=>{var e=ic();yr(e,21,()=>m,wr,(t,e)=>{{let i=Ht(()=>Xn?.of(Ai(e))??Ai(e)),s=Ht(()=>Ai(e)==r());oa(t,{onclick:()=>o.lang=Ai(e),get title(){return Ai(i)},get active(){return Ai(s)},children:(t,i)=>{X();var r=Yi();Ue(t=>nr(r,t),[()=>Ai(e).toUpperCase()]),ji(t,r)},$$slots:{default:!0}})}}),q(e),ji(t,e)};vr(s,t=>{m.length>1&&t(n)});var a=Ee(s,2),c=t=>{var e=Gi(),i=xe(e),r=t=>{Ha(t,{get src(){return Ai(_).embed},get figcaption(){return Ai(_).content},controls:!0,autoplay:!0})};vr(i,t=>{Ai(g)&&t(r)}),ji(t,e)},l=t=>{Ja(t,{children:(t,e)=>{var i=nc(),r=xe(i),s=t=>{var e=rc(),i=_e(e,!0);q(e),Ue(()=>nr(i,Ai(_).title)),ji(t,e)};vr(r,t=>{Ai(_).title&&t(s)});var n=Ee(r,2),a=t=>{Ha(t,{get src(){return Ai(_).embed},controls:!0})};vr(n,t=>{Ai(_).embed&&Ai(g)&&t(a)});var o=Ee(n,2),c=t=>{var e=sc();Ue(()=>as(e,"src",Ai(E))),ji(t,e)};vr(o,t=>{Ai(E)&&t(c)});var l=Ee(o,2),h=t=>{var e=Gi();Er(xe(e),()=>Ai(_).content),ji(t,e)};vr(l,t=>{Ai(_).content&&t(h)}),ji(t,i)},$$slots:{default:!0}})};vr(a,t=>{Ai(x)?t(c):t(l,-1)});var h=Ee(a,2),d=t=>{var e=ac();yr(e,21,()=>Ai(T).buttons,wr,(t,e)=>{{let s=Ht(()=>"link"==Ai(e).type?Ai(e).action:void 0);oa(t,{get href(){return Ai(s)},get blankTarget(){return Ai(e).blankTarget},onclick:()=>function(t){f(),"close"!=t.type&&setTimeout(()=>{switch(t.type){case"marker":i()?.state.marker.set(t.action);break;case"mtour":o.state.tour.set(u?.markerTours?.find(e=>e.id==t.action));break;case"vtour":o.state.tour.set(u?.tours?.find(e=>e.id==t.action))}},200)}(Ai(e)),children:(t,i)=>{X();var s=Yi();Ue(()=>nr(s,Ai(e).i18nTitle[r()])),ji(t,s)},$$slots:{default:!0}})}}),q(e),ji(t,e)};vr(h,t=>{Ai(T).buttons&&Ai(T).buttons.length&&t(d)}),ji(t,e)};vr(F,t=>{Ai(b)?t(O):e.popover.gallery?t(z,1):Ai(T)&&Ai(_)&&t(N,2)}),q(L),gs(L,t=>oe(w,t),()=>Ai(w)),Ue(()=>C=qr(L,1,"micrio-popover",null,C,{page:!!Ai(T),article:!!Ai(T)&&!Ai(x),"has-media":Ai(S),gallery:!!e.popover.gallery})),Fi("close",L,function(){e.popover.contentPage?c.dispatch("page-closed"):Ai(k)?l.tour.set(void 0):e.popover.marker&&e.popover.image?.state.marker.set(void 0),l.popover.set(void 0)}),Fi("outrostart",L,()=>p.set(!0)),ji(t,L),it(),a()}function hc(t,e){et(e,!0);const i=Ht(()=>e.marker.positionalAudio),r=$i(()=>e.ctx).createGain();r.connect(Io);const s=Q("micrio"),n=s.$current.$info,a=n.width,o=n.height,c=$i(()=>e.ctx).createPanner();c.panningModel="equalpower",c.rolloffFactor=1,c.coneOuterGain=0;function l(){if(r.gain.value=Ai(i).volume??1,e.is360){c.refDistance=2.75*Ai(i).radius,c.maxDistance=Ai(i).radius*(11/3);const t=e.marker.x*-Math.PI*2,r=(e.marker.y-.5)*-Math.PI,s=Math.cos(r)*Math.sin(t)*11,n=11*Math.sin(r),a=Math.cos(r)*Math.cos(t)*11;c.positionX.value=s,c.positionY.value=n,c.positionZ.value=a;let o=s*s+n*n+a*a;o>0&&(o=1/Math.sqrt(o)),c.orientationX.value=s*o,c.orientationY.value=n*o,c.orientationZ.value=a*o}else c.distanceModel="linear",c.positionX.value=2*(e.marker.x-.5),c.positionY.value=2*(.5-e.marker.y)*(o/a),c.positionZ.value=-.2,c.rolloffFactor=2,c.refDistance=Ai(i).radius*Ai(i).radius*10,c.maxDistance=5*Ai(i).radius}let h,d;function u(){h&&h.disconnect(),h=e.ctx.createBufferSource(),Ai(i).loop&&(Ai(i).repeatAfter>0?h.onended=()=>{d=setTimeout(u,1e3*Ai(i).repeatAfter)}:h.loop=!0),r.gain.value=Ai(i).volume??1,h.buffer=Oo[Ai(i).src],h.connect(c),h.start()}let m=ne(ue(JSON.stringify($i(()=>e.marker.positionalAudio))));Oe(()=>{const t=JSON.stringify(Ai(i));Ai(m)!=t&&oe(m,t,!0)&&l()}),pr(()=>(l(),c.connect(r),async function(){Ai(i).src&&(Oo[Ai(i).src]||(Oo[Ai(i).src]=await fetch(Ai(i).src).then(t=>t.arrayBuffer()).then(t=>e.ctx.decodeAudioData(t))),Ai(i).alwaysPlay&&Ai(i).repeatAfter>0?d=setTimeout(u,1e3*Ai(i).repeatAfter):u())}(),s.addEventListener("audio-update",l),()=>{s.removeEventListener("audio-update",l),h&&h.disconnect(),clearTimeout(d),c.disconnect(),r.disconnect()})),it()}var dc=Wi('<img alt="" class="micrio-marker"/>'),uc=Wi('<label data-scroll-through=""> </label>'),mc=Wi('<button data-scroll-through="" class="micrio-marker"><!> <!></button>'),fc=Wi("<div><!></div>"),pc=Wi("<!> <!>",1);function gc(t,e){et(e,!0);const i=()=>kt(d,"$current",c),r=()=>kt(T,"$tour",c),s=()=>kt(k,"$currentPopup",c),n=()=>kt(f,"$_lang",c),a=()=>kt(g,"$isMobile",c),o=()=>kt(zo,"$ctx",c),[c,l]=_t(),h=Q("micrio"),{current:d,events:u,state:m,_lang:f,spaceData:p}=h,g=h.canvas.isMobile,v=m.markerHoverId,b=Q("inView"),y=Q("markerImages"),k=h.state.popup,T=m.tour;let _=ys(e,"marker",15),x=ys(e,"image",31,()=>ue(i())),E=ys(e,"forceHidden",3,!1),S=ys(e,"coords",3,void 0),A=ys(e,"overlapped",3,!1);_().tags||_(_().tags=[],!0);const M=y.has(_().id);!M&&x()&&y.set(_().id,x());const I=!(!x().isOmni||!x().$settings.omni?.sideLabels||x().$settings._markers?.noTitles),$=t=>t.steps.findIndex(t=>t.startsWith(_().id))>=0,P=_().data??{},L=P._meta||{},C=x().$settings.omni;_().imageLayer&&_().imageLayer>(C?.layers?.length??1)-1&&delete _().imageLayer,i()?.$data?.markers?.find(t=>t.data?._micrioSplitLink?.markerId==_().id&&"none"!=t.popupType)&&(_(_().popupType="none",!0),_(_().noMarker=!0,!0)),"embedUrl"in _()&&_().embedUrl&&"embedInPopover"in _()&&_().embedInPopover&&_(_().popupType="popover",!0);const R=x().$settings._markers??{},D=!!x().$settings.doTourJumps,F=_().tags.join(" "),O="cluster"==_().type,z=!1===_().data?.showTitle||!!R.noTitles||!!C?.sideLabels,N=!!P.scales||!!x().$settings.markersScale,V=N&&!!R.titlesNoScale,U=P._micrioSplitLink,B=!!R.keepPopupsDuringTourTransitions,W=/[?&]micrioNoTooltips/.test(location.search)||!!C?.sideLabels,X=L.gridAction,Y=x().$settings?._markers?.autoStartTour?h.wasm.images.map(t=>"camera"in t?t.$data?.markerTours?.find($):void 0).filter(t=>!!t)[0]??p?.markerTours?.find($):void 0,G=Y?.steps.findIndex(t=>t.startsWith(_().id)),j=!!x().$settings?._markers?.autoStartTourAtBeginning;let H=!M&&(!!P.alwaysOpen||m.$marker==_())||m.$tour?.id==Y?.id&&Y?.currentStep==(G??0);let Z,J,K,tt=ne(ue(M&&x().state.$marker==_())),rt=ne(!1),st=ne(""),nt=ne(0),at=ne(0),ot=ne(1),ct=!1;function lt(){if(dt(),_().onclick)return _().onclick(_());if(!R.noMarkerActions)if("cluster"==_().type){if(_().view&&i()?.$info){const t=i().camera.getScale();x().camera.flyToView(_().view,{area:x().opts?.area,limitZoom:!0,margin:[20/i().$info.width*t,20/i().$info.height*t]})}}else x().state.marker.set(_())}function ht(){R.noMarkerActions||(Ai(Et)?.parentNode?.scrollTo(0,0),dt(),K=setTimeout(()=>{const t=x().camera.getXY(_().x,_().y);!Ai(tt)&&(t[0]<0||t[0]>=h.offsetWidth||t[1]<0||t[1]>=h.offsetHeight||x().is360&&t[3]>4)&&x().camera.flyToCoo([_().x,_().y],{speed:2,limit:!0}).catch(()=>{})},150))}function dt(){clearTimeout(K)}const ut=()=>v.set(_().id),mt=()=>v.set(void 0);let ft;async function pt(){if(O)return;if(x().state.$marker!=_())return x().state.marker.set(_());if(R.noMarkerActions)return;if(Y&&Y.id!=r()?.id&&!r()){Y.initialStep=j?0:G;const t=Y.stepInfo?.[0];if(j&&t&&t.micrioId!=x().id){const e=h.canvases[0]?.grid;e?.images.find(e=>e.id==t.micrioId)?h.current.set(e.image):h.open(t.micrioId)}if(T.set(Y),setTimeout(()=>L.gridAction=X,100),j&&null!=G&&G>0)return void x().state.marker.set(void 0);await Si()}var t;H=!1,u.dispatch("marker-opened",_()),r()&&"steps"in r()&&r().isSerialTour&&r().printChapters&&r().steps.findIndex(t=>t.startsWith(_().id))>=0&&_().videoTour||(Ai(Pt)?"popover"==_().popupType?(await Si(),h.state.popover.set({marker:_(),image:x(),markerTour:r()&&"steps"in r()?r():void 0})):_().videoTour&&!r()&&(T.set(_().videoTour),(t=T,new Promise(e=>{let i;i=t.subscribe(t=>{null==t&&(i?i():Si().then(()=>i()),e(t))})})).then(()=>x().state.marker.set(void 0))):Si().then(()=>k.set(_())));const e=P.micrioLink?.id;if(e&&Si().then(()=>{x().camera.stop();const t=Tn(h,e);t&&(x(x().openedView=void 0,!0),x().state.marker.set(void 0)),h.open(e,{vector:t?.vector})}),U&&!ct&&!x().opts.secondaryTo){const t=h.canvases[0]?.grid;t?.lastPromise&&await t.lastPromise,ft=setTimeout(()=>{U&&(J=h.open(U.micrioId,{splitScreen:!0,splitTo:x(),isPassive:!(!U.follows||h.state.$tour),startView:U.view}),ct=!0)},200)}}let gt,vt,bt=ne(!1);function yt(){if(x().is360&&N)oe(st,x().camera.getMatrix(_().x,_().y,1,1,0,0,0).join(","),!0);else{let i=Ai(nt),r=Ai(at);if(t=x().camera.getXYDirect(_().x,_().y,{radius:_().radius,rotation:_().rotation}),e=w(t,4),oe(nt,e[0],!0),oe(at,e[1],!0),oe(ot,e[2],!0),Z=e[3],x().is360)oe(rt,Z>0);else if(x().isOmni&&C){if(null!=Ai(Ct)[0]&&null!=Ai(Ct)[1]&&null!=_().rotation){const t=C.frames/(C.layers?.length??1);let e=(x().swiper?.currentIndex??0)-(Ai(Lt)??0);e>t/2&&(e-=t),e<-t/2&&(e+=t),oe(rt,e<=Ai(Ct)[0]||e>=Ai(Ct)[1],!0)}else C.distance&&oe(rt,Z<0);C.sideLabels&&!R.noTitles&&Ai(Mt)?.title&&b&&(i!=Ai(nt)||r!=Ai(at))&&function(t,e){const i=h.canvas.element.offsetWidth,r=h.canvas.element.offsetHeight,s=!(t<0||t>i||e<0||e>r||Ai(rt));(s||Ai(bt))&&b.update(r=>{const n=r.findIndex(([t])=>t==_());return s?n>=0?r[n]=[_(),t/i,e]:r.push([_(),t/i,e]):n>=0&&r.splice(n,1),oe(bt,s,!0),r})}(Ai(nt),Ai(at))}x().$settings.clusterMarkers&&S()&&S().set(_().id,[Ai(nt),Ai(at),A()?gt:gt=Ai(St)?.offsetWidth,A()?vt:vt=Ai(St)?.offsetHeight])}var t,e}function Tt(t){const e=t.detail;_(_().x=e.x,!0),_(_().y=e.y,!0),yt()}let xt=ne(void 0),Et=ne(void 0),St=ne(void 0);const At=Q("mediaPaused");pr(()=>{if(_().videoTour){const t="timeline"in _().videoTour?_().videoTour.timeline:_().videoTour.i18n?.[n()]?.timeline;t?.length&&_(_().view=t[0].rect,!0)}const t=[x().state.marker.subscribe(t=>{"string"==typeof t&&t==_().id?x().state.marker.set(_()):t==_()?async function(){if(Ai(tt))return;if(oe(tt,!0),dt(),R.noMarkerActions)return;u.dispatch("marker-open",_()),!r()||"steps"in r()&&($(r())||r().cannotClose)||(T.set(void 0),await Si());const t=r()&&"steps"in r();Ai(Pt)||t&&B||(k.set(void 0),h.state.popover.set(void 0)),mt(),U?.markerId&&(J||(J=h.canvases.find(t=>t.id==U.micrioId)),J&&(ct=wt(J.visible),ct&&U?.view&&J.camera.flyToView(U.view,{isJump:!0}).catch(()=>{}))),void 0!==_().imageLayer&&x().state.layer.set(_().imageLayer);const e=Y&&j&&Y!=r()&&null!=G&&G>0;e&&delete L.gridAction;const i=_().view;e||!i||P.noAnimate||_().videoTour||L.gridView?pt():H?(x().camera.setView(_().view,{area:x().opts?.area}),pt()):x().camera.flyToView(_().view,{omniIndex:Ai(Lt),area:x().opts?.area,isJump:!!P.doJump||D&&!!m.$tour}).then(pt).catch(()=>{r()||x().state.marker.set(void 0)})}():P.alwaysOpen||(Ai(tt)&&function(){clearTimeout(ft),u.dispatch("marker-closed",_());const t=r()&&"steps"in r();if(r()||x().state.$marker||(_().videoTour||x().openedView?setTimeout(()=>x().camera.aniDoneAdd.push(()=>{wt(T)||x().state.$marker||Ai(xt)?.focus()}),10):Ai(xt)?.focus()),h.state.popover.set(void 0),!Ai(Pt)){s()!=_()||t&&B||k.set(void 0);const e=h.canvases.find(t=>t!=x()&&t.state.$marker);e&&Si().then(()=>{const t=e.state.$marker;t&&"popup"==t.popupType&&k.set(t)})}U&&J&&setTimeout(()=>{const t=wt(h.state.marker);J&&U.micrioId!=t?.data?._micrioSplitLink?.micrioId&&h.close(J)},210)}(),oe(tt,!1))})];return Ai($t)||(t.push(x().camera.image.state.view.subscribe(yt)),yt()),E()||Si().then(()=>{Ai(tt)&&!_().noMarker&&s()&&s()!=_()&&!r()?x().state.marker.set(void 0):(H||P.alwaysOpen)&&pt()}),_().htmlElement&&Ai(Et)&&Ai(Et).appendChild(_().htmlElement),()=>{for(clearTimeout(ft);t.length;)t.shift()?.()}});const Mt=Ht(()=>Ln(_(),n())),It=Ht(()=>!(Ai(Mt)?.title||Ai(Mt)?.body||Ai(Mt)?.bodySecondary||Ai(Mt)?.embedUrl||_().images&&_().images.length)),$t=Ht(()=>E()||_().noMarker),Pt=Ht(()=>"popup"!=_().popupType||Ai(It)),Lt=Ht(()=>x().camera.getOmniFrame((_().rotation??0)+(_().backside?Math.PI:0))),Ct=Ht(()=>_().visibleArc?[x().camera.getOmniFrame(_().visibleArc[0]),x().camera.getOmniFrame(_().visibleArc[1])]:[]),Rt=Ht(()=>r()&&(!("steps"in r())&&!r().keepMarkers||R.hideMarkersDuringTour&&!kt(At,"$tourPaused",c))&&!Ai(tt));Oe(()=>{Ai(Rt)&&Ai(bt)&&b.update(t=>{const e=t.findIndex(t=>t[0]==_());return e>=0&&t.splice(e,1),t})});const Dt=Ht(()=>"default"==_().type?void 0:"link"==_().type?"link":"media"==_().type?"play":"cluster"==_().type?void 0:_().type??void 0),Ft=Ht(()=>(null!=_().data?.customIconIdx?x().$settings._markers?.customIcons?.[_().data?.customIconIdx]:void 0)??_().data?.icon??R.markerIcon??void 0),Ot=Ht(()=>!!Ai(Dt)||!!Ai(Ft)),zt=Ht(()=>!("class"in _()&&""===_().class||!Ai(Ot)&&"default"!=_().type)),Nt=Ht(()=>Ai(Mt)&&(!z||a()&&I)&&(Ai(Mt).label||Ai(Mt).title));var Vt=pc(),Ut=xe(Vt),Bt=t=>{var e=fc();let i;var r=_e(e),s=t=>{var e=mc(),i=_e(e),r=t=>{var e=dc();Ue(()=>as(e,"src","string"==typeof Ai(Ft)?Ai(Ft):Ai(Ft).src)),ji(t,e)},s=t=>{Hn(t,{get name(){return Ai(Dt)}})};vr(i,t=>{Ai(Ft)?t(r):Ai(Dt)&&t(s,1)});var n=Ee(i,2),a=t=>{var e=uc();let i;var r=_e(e,!0);q(e),gs(e,t=>oe(St,t),()=>Ai(St)),Ue(()=>{as(e,"for",_().id),i=qr(e,1,"micrio-marker",null,i,{static:V}),nr(r,Ai(Mt)?.label||Ai(Mt)?.title)}),ji(t,e)};vr(n,t=>{Ai(Nt)&&t(a)}),q(e),gs(e,t=>oe(xt,t),()=>Ai(xt)),Ue(()=>{as(e,"title",W||O?null:Ai(Mt)?Ai(Mt).label||Ai(Mt).title:null),as(e,"id",_().id)}),Oi("click",e,lt),Fi("focus",e,ht),Fi("blur",e,dt),Fi("mouseenter",e,ut),Fi("mouseleave",e,mt),ji(t,e)};vr(r,t=>{_().htmlElement||t(s)}),q(e),gs(e,t=>oe(Et,t),()=>Ai(Et)),Or(e,(t,e)=>{return r=e,(i=t).addEventListener("change",r),{destroy:()=>i.removeEventListener("change",r)};var i,r},()=>Tt),Ue(()=>{as(e,"id",`m-${_().id}`),i=qr(e,1,Vr(F),"micrio-marker",i,{overlapped:A()&&!Ai(tt),cluster:O,behind:Ai(rt),hovered:kt(v,"$hovered",c)==_().id,default:Ai(zt),mat3d:!!Ai(st),opened:Ai(tt),"micrio-link":!!P.micrioLink,"has-icon":Ai(Ot),"has-custom-icon":!!Ai(Ft)}),Yr(e,Ai(st)?`--mat:matrix3d(${Ai(st)})`:Ai(nt)?`--x:${Ai(nt)}px;--y:${Ai(at)}px${N?`;--scale:${Ai(ot)}`:""}`:null)}),ji(t,e)};vr(Ut,t=>{Ai($t)||!x()||Ai(Rt)||t(Bt)});var Wt=Ee(Ut,2),qt=t=>{hc(0,{get marker(){return _()},get ctx(){return o()},get is360(){return x().is360}})};vr(Wt,t=>{_().positionalAudio&&o()&&(!_().positionalAudio.noMobile||a())&&(_().positionalAudio.alwaysPlay||Ai(tt))&&t(qt)}),ji(t,Vt),it(),l()}zi(["click"]);var vc=Wi("<div><!></div>");function wc(t,e){et(e,!0);const i=()=>kt(c,"$_lang",r),[r,s]=_t();let n=ys(e,"settings",31,()=>ue({i18n:{}})),a=ys(e,"image",15);const o=Q("micrio"),{_lang:c,spaceData:l}=o,h=a().$info,d=a().$settings,u=vn($i(()=>e.targetId))?.[2],m=Tn(o,$i(()=>e.targetId));m||console.error(`[Micrio Waypoint] Could not calculate vector for target ${$i(()=>e.targetId)}`);const{directionX:f,v:p,vN:g,vector:v}=m;let w=ne(void 0);const b=Math.abs(g[1])<.3,y=b?.65:.5+g[1]/10,k={x:f,y:y,baseScale:h.width/1024,scale:1,rotX:(1+(b?-(1-y):g[1]))*Math.PI/2,rotY:0,rotZ:0},T=n()?.coords??qs(k);let _,x=T.custom,E=x?T:k;function S(){d._markers?.noMarkerActions||(Ai(w).parentNode.scrollTo(0,0),clearTimeout(_),_=setTimeout(()=>{const t=a().camera.getXY(E.x,E.y);!Ai($)&&(t[0]<0||t[0]>=o.offsetWidth||t[1]<0||t[1]>=o.offsetHeight||a().is360&&t[3]>4)&&a().camera.flyToCoo([E.x,E.y],{speed:2,limit:!0}).catch(()=>{})},150))}let A=ne(""),M=n().customIconIdx;const I=()=>{C.deleted?oe(L,!0):(M!=C.settings.customIconIdx&&(n(n().customIconIdx=C.settings.customIconIdx,!0),M=n().customIconIdx),T.custom!=x&&(x=T.custom,E=x?T:k),oe(A,a().camera.getMatrix(E.x,E.y,E.baseScale*E.scale,1,E.rotX,E.rotY,E.rotZ,0,1,1,!0).join(","),!0))};let $=ne(!1);function P(){d._markers?.noMarkerActions||(oe($,!0),a(a().openedView=void 0,!0),a().state.marker.set(void 0),o.open(e.targetId,{vector:v}))}let L=ne(!1);const C={coords:T,settings:n()};I(),pr(()=>{C.el=Ai(w),Ai(w)._iface=C,o.dispatchEvent(new CustomEvent("wp-print",{detail:C}));const t=a().state.view.subscribe(I);return()=>t()});const R=Ht(()=>n().i18n?.[i()]?.title||u?.i18n?.[i()]?.title),D=Ht(()=>l?.icons?.[n().customIconIdx??-1]);var F=Gi(),O=xe(F),z=t=>{var i=vc();let s;var n=_e(i);{let t=Ht(()=>Ai(D)?void 0:"arrow-up"),e=Ht(()=>Ai(R)??kt(Wn,"$i18n",r).waypointFollow);oa(n,{get type(){return Ai(t)},get icon(){return Ai(D)},onclick:P,onfocus:S,get title(){return Ai(e)}})}q(i),gs(i,t=>oe(w,t),()=>Ai(w)),Ue(()=>{Yr(i,`--matrix: matrix3d(${Ai(A)??""})`),as(i,"id",`w-${e.targetId}`),s=qr(i,1,"micrio-waypoint",null,s,{clicked:Ai($),active:Ai($),"direction-up":p[1]<0,"direction-down":p[1]>0})}),Rr(3,i,()=>Fn),ji(t,i)};vr(O,t=>{Ai(L)||t(z)}),ji(t,F),it(),s()}var bc,yc="5.5.5",kc="https://b.micr.io/",Tc=["ttBWO","IicaE","KLTce","xjQrB","pfhXT","rNIPa","rdFIY","mvRXc"],_c={b64:_b,ugz:_u},xc="micrio-muted",Ec={id:"",version:yc,path:kc,width:0,height:0,tileSize:1024,lang:"en",settings:{camspeed:1,view:[0,0,1,1],restrict:[0,0,1,1],focus:[.5,.5],zoomLimit:1,fullscreen:!0,hookEvents:!0,hookScroll:!0,hookPinch:!0,hookDrag:!0,minimap:!0,doTourJumps:!0,audio:!0,startVolume:1,mutedVolume:0,_markers:{showTitles:!1,popupAnimation:{duration:200,x:-50},zoomOutAfterClose:!0},ui:{controls:{cultureSwitch:!0}},_360:{},_meta:{}}},Sc={STRINGS:{id:{r:!0},lang:{r:!0},"data-thumb":{f:"thumbSrc"},"data-title":{r:!0},"data-format":{r:!0},"data-extension":{r:!0,f:"tileExtension"},"data-tiles":{r:!0,f:"tilesId"},"data-path":{r:!0},"data-inittype":{f:"initType"},"data-start":{f:"gallery.startId"},"data-gallery":{f:"gallery.archive"},"data-gallery-sort":{f:"gallery.sort"},"data-iiif":{r:!0,f:"iiifManifest"},"data-grid":{r:!0},"data-gallery-type":{f:"gallery.type"}},BOOLEANS:{"data-static":{},muted:{f:"audio",n:!0},"data-png":{r:!0,f:"isPng"},"data-webp":{r:!0,f:"isWebP"},"data-dz":{r:!0,f:"isDeepZoom"},"data-is360":{r:!0},"data-no-externals":{f:"noExternals"},"data-skipmeta":{f:"skipMeta"},"data-force-data-refresh":{f:"forceDataRefresh"},"data-keeprendering":{f:"keepRendering"},"data-coverlimit":{f:"limitToCoverScale"},"data-events":{f:"hookEvents"},"data-keys":{f:"hookKeys"},"data-zooming":{f:"noZoom",n:!0},"data-scroll-zoom":{f:"hookScroll"},"data-pinch-zoom":{f:"hookPinch"},"data-dragging":{f:"hookDrag"},"data-two-finger-pan":{f:"twoFingerPan"},"data-control-zoom":{f:"controlZoom"},"data-ui":{f:"noUI",n:!0},"data-gtag":{f:"noGTag",n:!0},"data-controls":{f:"noControls",n:!0},"data-logo":{f:"noLogo",n:!0},"data-logo-org":{f:"noOrgLogo",n:!0},"data-toolbar":{f:"noToolbar",n:!0},"data-show-info":{f:"showInfo"},"data-social":{},"data-fullscreen":{},"data-minimap":{},"data-minimap-hide":{f:"alwaysShowMinimap",n:!0},"data-normalize-dpr":{f:"zoomLimitDPRFix"},"data-grid-clickable":{f:"gridClickable"},"data-gallery-spreads":{f:"gallery.isSpreads"},"data-freemove":{f:"freeMove"},"data-force-path":{f:"forceInfoPath",r:!0}},NUMBERS:{"data-version":{r:!0},height:{r:!0},width:{r:!0},volume:{f:"startVolume"},"data-tilesize":{r:!0,f:"tileSize"},"data-camspeed":{},"data-zoomlimit":{f:"zoomLimit"},"data-minimap-height":{f:"minimapHeight"},"data-minimap-width":{f:"minimapWidth"},"data-mutedvolume":{f:"mutedVolume"},"data-width-cm":{f:"cmWidth"},"data-height-cm":{f:"cmHeight"},"data-gallery-cover-pages":{f:"gallery.coverPages"},lazyload:{dN:0},"data-elasticity":{f:"dragElasticity"},"data-skip-base-levels":{f:"skipBaseLevels"},"data-watermark-opacity":{f:"watermarkOpacity"}},ARRAYS:{"data-focus":{},"data-view":{}}},Ac=class{get e(){return this.image.wasm.e}constructor(t){if(this.image=t,this.center=[0,0,1],this.view=[0,0,1,1],this.rotationY=0,this.aniDoneAdd=[],this.cooToArea=(t,e,i)=>({x:i[0]+t*(i[2]-i[0]),y:i[1]+e*(i[3]-i[1])}),this.getView=()=>this.view,this.getViewRaw=()=>this._view,this.getViewLegacy=()=>{if(this.e)return[this._view[0]-this._view[2]/2,this._view[1]-this._view[3]/2,this._view[0]+this._view[2]/2,this._view[1]+this._view[3]/2]},this.getCoo=(t,e,i=!1,r=!1)=>this.getCooDirect(t,e,i,r).slice(0).map(t=>Math.round(1e6*t)/1e6),this.getXY=(t,e,i=!1,r,s,n)=>this.getXYDirect(t,e,{abs:i,radius:r,rotation:s,noTrueNorth:n}).slice(0),this.getScale=()=>this.center[2]??1,this.setScale=t=>this.setCoo(this.center[0],this.center[1],t),this.getCoverScale=()=>this.e?._getCoverScale(this.image.ptr)??1,this.getMinScale=()=>this.e?._getMinScale(this.image.ptr)??.1,this.isZoomedIn=()=>1==this.e?._isZoomedIn(this.image.ptr),this.isZoomedOut=(t=!1)=>1==this.e?._isZoomedOut(this.image.ptr,t),this.getCoverLimit=()=>!!this.e?._getCoverLimit(this.image.ptr),this.flyToView=(t,e={})=>new Promise((i,r)=>{if(!this.e)return r(new Error("Wasm not ready"));let{centerX:s,centerY:n,width:a,height:o}=sn.toCenterJSON(t);if(2==e.margin?.length&&(s+=e.margin[0],n+=e.margin[1],a-=2*e.margin[0],o-=2*e.margin[1]),e.area){const t=this.cooToArea(s,n,e.area);s=t.x,n=t.y,a*=e.area[2]-e.area[0],o*=e.area[3]-e.area[1]}if(e.prevView){const t=sn.toCenterJSON(e.prevView);this.e._setStartView(this.image.ptr,t.centerX,t.centerY,t.width,t.height)}if(this.image.$settings.omni?.frames){const i=this.image.$settings.omni.layers?.length??1,r=this.image.$settings.omni.frames/i;if(null==e.omniIndex){const i=t[4]?t[4]:Array.isArray(t)&&void 0!==t[5]?t[5]:void 0;void 0!==i&&(e.omniIndex=Math.round(Ws(i/(2*Math.PI))*r))}null!=e.omniIndex&&(e.omniIndex=Ws(e.omniIndex,r))}const c=this.e._flyTo(this.image.ptr,s,n,a,o,e.duration??-1,e.speed??-1,e.progress??0,!!e.isJump,!!e.limit,!!e.limitZoom,e.omniIndex??0,ko.Camera.TimingFunction[e.timingFunction??"ease"],performance.now());this.image.wasm.render(),0==c?i():this.setAniPromises(i,r)}),this.flyToFullView=(t={})=>this.flyToCoo([.5,.5,this.getMinScale()],t),this.flyToCoverView=(t={})=>{const e=this.image.$settings.focus??[.5,.5];return e[2]=this.getCoverScale(),this.flyToCoo(e,t)},this.flyToCoo=(t,e={})=>new Promise((i,r)=>{if(!this.e)return r(new Error("Wasm not ready"));e.duration=this.e._setCoo(this.image.ptr,t[0],t[1],t[2]||this.center[2],e.duration??-1,e.speed??-1,e.limit??!1,ko.Camera.TimingFunction[e.timingFunction??"ease"],performance.now()),this.image.wasm.render(),0==e.duration?i():this.setAniPromises(i,r)}),this.zoom=(t,e=0,i=void 0,r=void 0,s=1,n=!1)=>new Promise((a,o)=>{if(!this.e)return o(new Error("Wasm not ready"));const c=this.getXY(this.center[0],this.center[1]);if(null==i&&(i=c[0]),null==r&&(r=c[1]),this.image.album&&!this.image.album.hooked)return a();e=this.e._zoom(this.image.ptr,t,i,r,e,s,n,performance.now()),this.image.wasm.render(),0==e?a():this.setAniPromises(a,o)}),this.zoomIn=(t=1,e=250,i=1)=>this.zoom(200*-t,e,void 0,void 0,i).catch(()=>{}),this.zoomOut=(t=1,e=250,i=1)=>{const r=this.image.wasm.micrio.canvas.viewport,s=r.width/r.height,n=this.image.$info.width/this.image.$info.height;return this.zoom(t*(400/Math.max(1,s/n/2)),e,void 0,void 0,i).catch(()=>{})},this.getDirection=()=>this.e?._getYaw(this.image.ptr)??0,this.getPitch=()=>this.e?._getPitch(this.image.ptr)??0,!t.is360){const e=t.state.$view;e&&t.$info?.width&&Si().then(()=>this.setView(e))}}assign(t,e,i,r){this._view=t,this._xy=e,this._coo=i,this._mat=r}viewChanged(){const t=this._view,e=this.center.join(","),i=this.getCoo(0,0);this.view[0]=t[0]-t[2]/2,this.view[1]=t[1]-t[3]/2,this.view[2]=t[2],this.view[3]=t[3],this.center[0]=t[0],this.center[1]=t[1],this.center[2]=i[2],this.image.is360&&(this.center[3]=i[3],this.center[4]=i[4]),this.image.isOmni&&(this.center[5]=this.image.swiper?.currentIndex),(this.center.join(",")!=e||this.image.wasm.micrio.canvas.resizing||this.image.wasm.areaAnimating(this.image.ptr))&&this.image.state.view.set(this.view)}getXYDirect(t,e,i={}){const r=this.image.is360&&!i.noTrueNorth?-this.rotationY/(2*Math.PI):0;return this.e._getXY(this.image.ptr,t-r,e,!0===i.abs,i.radius,i.rotation),this._xy}getCooDirect(t,e,i=!1,r=!1){if(i){const i=this.image.wasm.micrio.getBoundingClientRect();t-=i.left,e-=i.top}return this.e._getCoo(this.image.ptr,t,e,!0===i,!0===r),this._coo}setView(t,e={}){if(!this.e)return;let{centerX:i,centerY:r,width:s,height:n}=sn.toCenterJSON(t);if(e.area){const t=this.cooToArea(i,r,e.area);i=t.x,r=t.y,s*=e.area[2]-e.area[0],n*=e.area[3]-e.area[1]}this.e._setView(this.image.ptr,i,r,s,n,!!e.noLimit,!1,e.correctNorth),e.noRender||this.image.wasm.render()}setCoo(t,e,i=this.center[2]??1){this.e&&(this.e._setCoo(this.image.ptr,t,e,i,0,0),this.image.wasm.render())}getMatrix(t,e,i,r,s,n,a,o,c,l,h){return this.e?(this.e._getMatrix(this.image.ptr,t,e,i,r,s||0,n||0,a||0,o||0,c??1,l??1,h),this._mat):new Float32Array(16)}setMinScale(t){this.e?._setMinScale(this.image.ptr,t)}setMinScreenSize(t){this.image.album||this.e?._setMinSize(this.image.ptr,Math.max(0,Math.min(1,t??1)))}setLimit(t){if(!this.e)return;const e=sn.rectToCenterJSON(t);this.e._setLimit(this.image.ptr,e.centerX,e.centerY,e.width,e.height),this.image.wasm.render()}setCoverLimit(t){this.e&&this.e._setCoverLimit(this.image.ptr,!!t)}set360RangeLimit(t=0,e=0){this.e&&(this.e._set360RangeLimit(this.image.ptr,t,e),this.image.wasm.render())}setAniPromises(t,e){this.aniDone=t,this.aniAbort=e}pan(t,e,i=0,r={}){this.e&&(this.e._pan(this.image.ptr,t,e,i,!!r.noLimit,performance.now()),(i>0||r.render)&&this.image.wasm.render())}stop(){this.e&&this.e._aniStop(this.image.ptr)}pause(){this.e&&this.e._aniPause(this.image.ptr,performance.now())}resume(){this.e&&(this.e._aniResume(this.image.ptr,performance.now()),this.image.wasm.render())}aniIsKinetic(){return!!this.e?._isKinetic(this.image.ptr)}setDirection(t,e){this.e&&(this.e._setDirection(this.image.ptr,t,e),this.image.wasm.render())}setArea(t,e={}){this.e&&(this.image.opts.isEmbed?this.image.ptr>0&&(this.image.opts.area=t,this.e._setImageArea(this.image.ptr,t[0],t[1],t[2],t[3])):(this.image.opts.area=t,this.e._setArea(this.image.ptr,t[0],t[1],t[2],t[3],!!e.direct,!!e.noDispatch)),e.noRender||this.image.wasm.render())}setRotation(t=0,e=0,i=0){!this.image.opts.isEmbed||this.image.ptr<=0||!this.image.wasm.ready||(this.image.wasm.setImageRotation(this.image.ptr,t,e,i),this.image.wasm.render())}getOmniRotation(){const t=this.image.$settings.omni;return t&&this.e?(this.image.swiper?.currentIndex??0)/((t?.frames??1)/(t?.layers?.length??1))*Math.PI*2:0}getOmniFrame(t){const e=this.image.$settings.omni;if(!e||null==t)return;const i=e.frames/(e.layers?.length??1);return Math.floor(t/(2*Math.PI)*i)}getOmniXY(t,e,i){return this.e?(this.e._getOmniXY(this.image.ptr,t,e,i),this._xy):new Float64Array(5)}setOmniSettings(){const t=this.image,e=t.$settings.omni;e&&this.e&&(t.wasm.setOmniSettings(t.ptr,-e.distance||0,e.fieldOfView??0,e.verticalAngle??0,e.offsetX??0),this.image.state.view.set(this.view))}};!function(t){t.Main=class{get $tour(){return this._tour}get $marker(){return this._marker}constructor(t){this.micrio=t,this.tour=vt(),this.marker=vt(),this.markerHoverId=vt(),this.popup=vt(),this.popover=vt(),this.ui={controls:vt(!0),zoom:vt(!0),hidden:vt(!1),hover:vt(!1)},this.mediaState=new Map,this.tour.subscribe(t=>{"string"!=typeof t&&(this._tour=t)}),this.marker.subscribe(t=>{"string"!=typeof t&&(this._marker=t)})}get(){if(this.micrio.$current)return this.value={id:this.micrio.$current.id,c:this.micrio.canvases.map(t=>t.state.get())},this._tour&&(this.value.t=[this._tour.id],"instance"in this._tour&&this._tour.instance?this.value.t.push(this._tour.instance.currentTime,this._tour.instance.paused?"p":void 0):"steps"in this._tour&&void 0!==this._tour.currentStep&&this.value.t.push(this._tour.currentStep)),this.value}async set(t){if(this.value=t){if(void 0!==t.t?.[1]){const e=t.t[0],i=this.mediaState.get(e);i?(i.currentTime=t.t[1],i.paused="p"==t.t[2]):this.mediaState.set(e,{currentTime:t.t[1],paused:"p"==t.t[2]})}if(t.c?.forEach(t=>{if(void 0!==t[6]&&void 0!==t[7]){const e=t[6],i=this.mediaState.get(e);i?(i.currentTime=t[7],i.paused="p"==t[8]):this.mediaState.set(e,{currentTime:t[7],paused:"p"==t[8]})}}),t.t&&await this.setTour(t.t[0]),this.micrio.$current?.id!=t.id&&(this.micrio.open(t.id),this.micrio.$current&&await en(this.micrio.$current.data,{allowUndefined:!0})),this.micrio.canvases.forEach(e=>{e.state.set(t.c.find(t=>t[0]==e.id))}),t.t)return this.setTour(t.t[0],t.t[1]);{const e=t.c.find(e=>e[0]==t.id);e&&!e[5]&&this.micrio.$current&&this.micrio.$current.camera.flyToView(e.slice(1,5),{speed:2}).catch(()=>{})}}}async setTour(t,e){if(!this.micrio.$current)return;const i=await en(this.micrio.$current.data,{allowUndefined:!0});if(i){const r=i.markerTours?.find(e=>e.id==t)||i.tours?.find(e=>e.id==t);r&&"steps"in r&&void 0!==e&&(r.initialStep=e),this._tour?.id!=t&&this.tour.set(r)}}};t.Image=class{get $view(){return this._view}get $marker(){return this._marker}constructor(t){this.image=t,this.view=vt(void 0),this.marker=vt(void 0),this.layer=vt(0);const e=t.wasm.micrio;let i,r,s;this.view.subscribe(n=>{this._view=n;const a=n?.toString();if(n&&a&&i!=a){const o={image:t,view:n};i=a;const c=n[2],l=n[3];(!r||!s||Math.abs(c-r+(l-s))>1e-5)&&(e.events.dispatch("zoom",o),r=c,s=l),e.events.dispatch("move",o)}}),this.marker.subscribe(t=>{const i=this._marker;this._marker=t&&"string"!=typeof t?t:void 0,this._marker?e.state.marker.set(this._marker):t||e.state.$marker!=i||e.state.marker.set(void 0)})}hookOmni(){const t=this.image;this.layer.subscribe(e=>{t.ptr<0||!t.wasm.ready||(t.wasm.setActiveLayer(t.ptr,e),t.wasm.render())})}get(){const t=this._marker,e=t?Array.from(this.image.wasm.micrio.state.mediaState).reverse().find(e=>e[0].startsWith(t.id)):null;return[this.image.id,...this._view?this._view.slice(0,4):[0,0,1,1],...t?[t.id,...e?[e[0],e[1].currentTime,e[1].paused?"p":void 0]:[]]:[void 0]].filter(t=>void 0!==t)}set(t){t?.length&&(this.view.set(t.slice(1,4)),t[5]?this._marker?.id!=t[5]&&this.marker.set(t[5]):this._marker&&this.marker.set(void 0))}}}(bc||(bc={}));var Mc=new class{constructor(){this.data=new Map,this.db=new Map,this.images=[],this.get=t=>new Promise((e,i)=>{const r=this.db.get(t);if(!r||!this.data.has(r[0]))return i(new Error("Could not get blob: "+t));const s=new FileReader;s.onload=()=>e(JSON.parse(s.result)),s.readAsText(new Blob([new Uint8Array(this.data.get(r[0]),r[1],r[2])]))}),this.getImage=async t=>new Promise((e,i)=>{const r=this.db.get(t);if(!r||!this.data.has(r[0]))return i(new Error("Could not get blob: "+t));const s=new Blob([new Uint8Array(this.data.get(r[0]),r[1],r[2])]);if("createImageBitmap"in self)e(self.createImageBitmap(s));else{let t=this.images.find(t=>!t.src);t||this.images.push(t=new Image),t.onload=()=>{t&&(e(t),requestAnimationFrame(()=>{t&&(URL.revokeObjectURL(t.src),t.src="")}))},t.src=URL.createObjectURL(s)}})}async load(t,e,i){if(this.data.has(e))return;const r=e.replace(/^.*\//,"").split(".")[0],s=/\/base$/.test(e),n=s||kn(r),a=new XMLHttpRequest,o=await new Promise((r,s)=>{let o=0;a.responseType="arraybuffer",a.onprogress=t=>{o||(o=Number(a.getResponseHeader("Content-Length"))),i?.(Math.min(1,t.loaded/o))},a.onload=()=>{4===a.readyState&&200===a.status?(i?.(1),r(a.response)):s()},a.onerror=s,a.open("GET",t+e+(n?".bin":".mdp")),a.send()});if(!o)return;this.data.set(e,o);const c=s?e.split("/")[0]+"/":"";let l=0;for(;l<o.byteLength&&!(l+32>o.byteLength);){const i=this.parseHeader(new Uint8Array(o,l,32));if(i.name&&i.size>0)this.db.set(t+c+i.name.replace("./",""),[e,l+32,i.size]);else if(0===i.size&&!i.name)break;l+=32+i.size}}parseHeader(t){const e=(new TextDecoder).decode(t),i=t=>e.slice(r,r+=t).replace(/\x00/g,"").trim();let r=0;return{name:i(20),size:parseInt(i(12),8)}}},Ic=[],$c=class t{get $info(){return this.__info}get $settings(){return wt(this.settings)}get $data(){return wt(this.data)}constructor(t,e,i={}){if(this.wasm=t,this.attr=e,this.opts=i,this.uuid=Gs(),this.__info=qs(Ec),this.settings=vt({}),this.data=vt(void 0),this.video=vt(void 0),this.visible=vt(!1),this.ptr=-1,this.baseTileIdx=-1,this.is360=!1,this.isVideo=!1,this.isOmni=!1,this.levels=1,this.dzLevels=0,this.noImage=!1,this.opacity=1,this.viewport=vt(),this.embeds=[],this.isV5=!1,this._loadedData=!1,this.embedElements=new Map,this.state=new bc.Image(this),i.useParentCamera||(this.camera=new Ac(this)),this.id=(e.id??"").replace("https://i.micr.io/",""),this.id.startsWith("external/")){const t=this.id.indexOf("/",this.id.indexOf("/")+1);-1!==t&&(this.id=this.id.substring(0,t+1)+encodeURIComponent(this.id.substring(t+1)))}this.isV5=kn(this.id.split("/")[0]),this.infoBasePath=e.path&&e.forceInfoPath?e.path:void 0,this.dataPath=e.path||this.__info.path,this.isV5&&!e.path&&(this.dataPath="https://r2.micr.io/"),i.secondaryTo?(this.opacity=0,i.area=this.wasm.micrio.canvas.viewport.portrait?[0,1,1,1]:[1,0,1,1],void 0===i.isPassive&&(i.isPassive=!0)):i.area||(i.area=[0,0,1,1]),this.preset=vn(this.id);let r=!1;var s;this.info=(s=t=>{r?t(this.__info):this.load().then(t),r=!0},{subscribe:vt(void 0,s).subscribe});const n=this.wasm.micrio,a=!!this.attr.revision;let o,c=wt(this.visible);i.isEmbed&&!a||this.visible.subscribe(t=>{t!=c&&(c=t,t&&!this._loadedData&&(!a&&this.isV5?(this._loadedData=!0,this.data.set(void 0)):this.loadData()),i.secondaryTo&&(i.isPassive&&(o?(o(),o=null):t&&(o=i.secondaryTo.state.view.subscribe(t=>{t&&!this.camera.aniDone&&this.camera.setView(t,{noLimit:!0})}))),t?n.events.dispatch("splitscreen-start",this):n.events.dispatch("splitscreen-stop",this)),n.visible.update(e=>(t?e.push(this):e.splice(e.indexOf(this),1),e)),t&&n.$current==this&&n.switching.set(!1))}),this.video.subscribe(t=>this._video=t),this.data.subscribe(t=>{t&&((t,e,i,r)=>{t&&(t.revision&&(t.revision=Object.fromEntries(Object.entries(t.revision??{}).filter(t=>Number(t[1])>0))),t.embeds?.forEach(t=>{t.uuid||(t.uuid=t.id??t.micrioId),an(t.video),an(t),r&&(t.area=sn.fromLegacy(t.area))}),t.markers?.forEach(t=>dn(t,e,i,r)),r&&t.tours?.forEach(un),t.music?.items?.forEach(an),t.pages?.forEach(ln))})(t,n.lang,this.isV5,on(this.__info))})}setError(t,e){const i=t instanceof Bs?t.displayMessage:e??(t instanceof Error?t.message:t)??"An unknown error has occurred";throw this.error=i,this.wasm.micrio.printError(t instanceof Bs?t:i),this.wasm.micrio.loading.set(!1),t instanceof Error?t:new Error(i)}async load(){let t=this.__info;const e=this.attr,i=this.wasm.micrio;e.id&&e.width&&(e.settings&&Xs(Ec.settings,e.settings,{noOverwrite:!0}),this.__info=t=e);let r=t.iiifManifest||e.iiifManifest;t.isIIIF=this.id.startsWith("http")||"iiif"==t.format;const s=!!e.settings?.forceDataRefresh;let n;if(!this.id||e.width&&e.height&&!r)this.preset?.[1]&&Xs(this.preset[1],t);else{const e=t=>this.setError(t,"string"==typeof t?t:'Image with id "'+this.id+'" not found, published, or embeddable.');Xs(this.preset?.[1]||await(t.isIIIF?gn(this.id):wn(this.id,this.infoBasePath,s).then(e=>(e?.id&&!t.isIIIF&&this.id.split("/").length>=3&&this.id.startsWith("external/")&&(n=e.id.split("/").reverse()[0],(this.isV5=kn(n))&&(this.dataPath=e.path||"https://r2.micr.io/")),e))).catch(e),t),!r&&t.iiifManifest&&(r=t.iiifManifest),t.isIIIF||(t.isIIIF=!!r),r&&Xs(await gn(r).catch(e),t),t.settings?._meta?.noLogo&&(t.settings.noLogo=!0),t.settings?._meta?.noSmoothing&&(t.settings.noSmoothing=!0)}if(t.id.startsWith("https://iiif.micr.io/")&&(t.id=t.id.slice(21)),7==this.id?.length){const e=yn(this.id[1+yn(this.id)%6]);t.is360=!!(e>>4&1)||t.is360,t.isWebP=!(3&e),t.isPng=2==(3&e),e>>3&1&&kn(t.tilesId??this.id)&&(t.format="dz"),t.path||(t.path=`https://${e>>2&1?"eu":"r2"}.micr.io/`)}const a=this.isV5&&this.id.startsWith("i")&&!this.id.includes("/");a&&!t.tilesId&&(t.tilesId=this.id.slice(1));const o=Tc.includes(t.id)||t.tilesId&&Tc.includes(t.tilesId);if(Xs(e,t),n&&(this.id=t.id=n),this.tileBase=a&&!t.tileBasePath?.includes("micr.io")?t.tileBasePath??"https://b.micr.io/":o||a?kc:t.tileBasePath??t.path??(this.isV5?"https://r2.micr.io/":"https://b.micr.io/"),t.organisation?.baseUrl&&!e.path?(this.dataPath=t.path=t.organisation.baseUrl,a&&!o||(this.tileBase=this.dataPath)):"https://eu.micr.io/"==t.path&&(this.dataPath=t.path),t.settings?.omni&&(this.isOmni=!0,parseFloat(t.version)>=5&&(await Mc.load(this.tileBase??this.dataPath,(t.tilesId??t.id)+"/base",t=>i._ui?.setProps?.({loadingProgress:t})).catch(t=>this.setError(t,"Could not find object base package.")),t.settings.gallery||(t.settings.gallery={}),t.settings.gallery.type="omni",t.settings.gallery.archive=t.id)),!t.organisation?.branding||t.settings&&t.settings.noUI||this.loadStyle(this.dataPath+"style/"+t.organisation.slug+".css").then(()=>{const t=getComputedStyle(this.wasm.micrio).getPropertyValue("--micrio-font-family")?.replace(/^'([^']+)'.*$/,"$1");t&&document.fonts.ready.then(()=>{document.fonts.check("16px "+t)||this.loadStyle(`https://fonts.googleapis.com/css2?family=${t}:ital,wght@0,300;0,400;0,500;0,600;0,800;1,300;1,400;1,500;1,600;1,800&display=swap`)})}),t.isIIIF)if(t.sequences&&t.sequences.length)this.parseIIIFSequenceV2(t,!!r);else if("Manifest"==t.type)this.parseIIIFSequenceV3(t);else{const e=(r||("@id"in t?t["@id"]:t.id)).replace("/info.json","");t.path=e.replace(/\/[^/]*$/,""),t.id=e.replace(/^.*\/([^/]*)$/,"$1")}if(t.spacesId&&!i.spaceData&&(i.spaceData="MICRIO_SPACE_DATA"in self?self.MICRIO_SPACE_DATA:await gn((this.infoBasePath??"https://i.micr.io/")+"spaces/"+t.spacesId+".json"),1==i.spaceData?.images.length&&delete i.spaceData),t.is360&&this.camera){const e=i.spaceData?.images.find(t=>t.id==this.id)?.rotationY;null!=e?this.camera.rotationY=e:null!=t.settings?._360?.trueNorth&&(this.camera.rotationY=(t.settings._360.trueNorth-.5)*Math.PI*2)}this.noImage=this.noImage||this.isOmni||!t.id&&!t.tilesId,this.extension=t.tileExtension||t.isPng&&"png"||t.isWebP&&"webp"||"jpg","dz"==t.format&&(t.isDeepZoom=!0),this.is360=!!t.is360,this.isVideo=!!t.isVideo;let c=this.isV5?wt(i._lang):("cultures"in t?void 0:e.lang)??void 0;if(this.isV5){if(t.revision){const e=Object.keys(t.revision);e.length&&!e.includes(c)&&(i.lang=e[0])}}else if(!t.settings?.skipMeta&&"cultures"in t){const e=(t.cultures||"").split(","),r=this.opts.isEmbed||!!this.opts.area,s=t.settings?.onlyPreferredLang||r;c=t.lang&&e.includes(t.lang)?t.lang:s?void 0:e[0],c&&!r&&(i.lang=c)}const l=t.settings;l&&!l?.noExternals&&await Promise.all([l.css?this.loadStyle(l.css.href):null,l.js?this.loadScript(l.js.href,c):null].filter(t=>!!t));for(let d=t.tileSize;d<Math.max(t.width,t.height);d*=2,this.levels++);let h=Math.max(t.width,t.height);do{this.dzLevels++}while((h/=2)>1);return l?.gallery?.archive&&(this.levels-=1-(l.gallery.archiveLayerOffset??0)),this.noImage||(this.thumbSrc=this.getTileSrc(this.levels,0,0)),i.events.dispatch("pre-info",t),this.isV5&&null!=t.revision&&!this.opts.isEmbed?await this.loadData():t.settings?.skipMeta||this.opts.isEmbed||this.isV5||i._lang.subscribe(t=>{!t||!this.id||"cultures"in this.__info&&(this.__info.cultures||"").split(",").includes(t)||(t=void 0),this.data.set(void 0),!t&&this.preset?.[2]&&(t="preset"),t&&this.id&&(this.isV5||(i.state.tour.set(void 0),this.state.marker.set(void 0)),this.preset?.[2]?this.enrichData(this.preset[2]).then(t=>{this.data.set(t),this.preset?.[2]&&(this.preset[2]=void 0)}):gn(this.dataPath+this.id+"/data."+t+".json").catch(()=>{}).then(t=>t&&this.enrichData(t).then(t=>this.data.update(e=>(Xs(t,e||(e={}),{mergeArrays:!0}),e)))))}),t.settings?.micrioSplitLink&&!this.opts.secondaryTo&&i.open({id:t.settings.micrioSplitLink,settings:{hookEvents:!1!==t.settings.secondaryInteractive}},{splitScreen:!0,isPassive:!t.settings.noFollow}),t.settings&&this.settings.set(t.settings),t.watermark&&this.wasm.micrio.webgl.loadWatermark(t.watermark,t.settings?.watermarkOpacity),delete t.settings,this.isOmni&&this.state.hookOmni(),t}async loadData(){const t=this.$settings?.skipMeta||this.__info.settings?.skipMeta;if(this._loadedData||t)return Promise.resolve();this._loadedData=!0;const e=this.preset?.[2]??(this.isV5&&await gn(this.dataPath+this.id+"/data/pub.json",this.__info.settings?.forceDataRefresh).catch(()=>{}));e&&this.enrichData(e).then(t=>this.data.set(t))}getTileSrc(t,e,i,r){const s=this.__info;if(s){if(s.isDeepZoom&&(t=this.dzLevels-t),s.isIIIF){const r=s.tileSize,n=Math.pow(2,t)*r,a=Math.min(s.width,e*n),o=Math.min(s.height,i*n),c=Math.min(s.width-a,n),l=Math.min(s.height-o,n),h=Math.round(Math.min(r,c/n*r)),d=Math.round(Math.min(r,l/n*r));return`${s.path}/${s.id}/${[a,o,c,l].join(",")}/${[h,d].join(",")}/0/default.jpg`}if(s.settings?._360?.video?.src)throw"Video thumb";return`${this.tileBase}${s.tilesId||s.id}/${void 0!==r?r+"/":""}${t}/${e}${s.isDeepZoom?"_":"-"}${i}.${this.extension}`}}loadScript(t,e=""){return new Promise(i=>{if(Ic.includes(t)||document.querySelector('script[src="'+t+'"]'))i();else{Ic.push(t);const r=document.createElement("script");r.type="text/javascript",r.async=!0,r.defer=!0,r.micrioElement=this.wasm.micrio,r.src=t.replace("$lang",e),r.onload=i,document.head.appendChild(r)}})}loadStyle(t){return new Promise(e=>{if(Ic.includes(t)||document.head.querySelector('link[href="'+t+'"]'))e();else{Ic.push(t);const i=document.createElement("link");i.setAttribute("type","text/css"),i.setAttribute("rel","stylesheet"),i.setAttribute("href",t),i.onload=e,document.head.appendChild(i)}})}async enrichData(e){if(!e)return e;"error"in e&&(this.__info.error="403"==e.status?"Could not load image data. Are you logged in and do you have the right credentials?":e.error);const i=this.wasm.micrio.lang,r=[];e.markers?.forEach(t=>{if(dn(t,i,!this.isV5,on(this.__info)),t.data?.micrioSplitLink){const e=t.data.micrioSplitLink.split(",").map(t=>t.trim()),i=t.data._micrioSplitLink={micrioId:e[0],markerId:e[1],follows:!!e[2]&&"false"!=e[2]};i.markerId&&r.push(i.micrioId)}}),e.markerTours?.length&&r.push(...e.markerTours.flatMap(t=>t.steps).map(t=>t.split(",")[1]).filter(t=>!!t&&t!=this.id));const s=t=>"autostart"in t&&t.autostart,n=e.markerTours?.find(s)||e.tours?.find(s);n&&(this.$settings.start={type:"steps"in n?"markerTour":"tour",id:n.id});const a=r.filter((t,e)=>r.indexOf(t)==e),o=t=>this.dataPath+(this.isV5?t+"/data/pub.json":t+"/data."+i+".json"),[c,l]=await Promise.all([Promise.all(a.map(t=>gn(o(t)))),Promise.all(a.map(t=>wn(t,this.infoBasePath)))]);c.forEach((t,e)=>{const r=on(l[e]);t?.markers?.forEach(t=>dn(t,i,5==a[e].length,r))});const h=this.wasm.micrio.spaceData;return e.markerTours&&(await Promise.all(e.markerTours.map(t=>bn(this,t,i,e))),h&&(e.markerTours=e.markerTours.filter(t=>!t.steps.find(t=>t.includes(","))))),h?.markerTours&&await Promise.all(h.markerTours.filter(t=>!t.stepInfo).map(t=>bn(this,t,i,e))),e.markers?.forEach(t=>{if(!t.data?._micrioSplitLink)return;const e=t.data?._micrioSplitLink?.markerId;if(e)for(let i=0;i<c.length;i++){const r=c[i]?.markers?.find(t=>t.id==e);if(r)return void(t.data._micrioSplitLink.view=r.view)}}),this.wasm.micrio.events.dispatch("pre-data",{[this.id]:e,...Object.fromEntries(a.map((t,e)=>[t,c[e]]))}),c.forEach((e,i)=>{if(e){const s=this.wasm.images.find(t=>t.id==a[i]);s&&s instanceof t&&!s.$data&&(r=o(s.id),!mn.has(r)&&!fn.has(r))&&s.data.set(e)}var r}),e}setupIIIFGalleryContainer(t,e){this.noImage=!0;const i=this.wasm.micrio,r=i.canvas.getRatio();t.width=Math.max(1,i.offsetWidth*r),t.height=Math.max(1,i.offsetHeight*r),t.settings||(t.settings={}),t.settings.gallery||(t.settings.gallery={}),t.settings.view=[0,0,1,1],t.gallery=[];const s=t.settings.gallery.startId,n=s?e.findIndex(t=>t==s):-1;return n<0?0:n}parseIIIFSequenceV2(e,i=!1){const r=e.sequences?.[0];if(!r)return;const s=r.canvases.map(t=>t.images[0]).map(t=>t.resource);if(i&&s.length>10){const i=this.setupIIIFGalleryContainer(e,s.map(t=>t.service["@id"]));return void s.forEach((r,s)=>e.gallery.push(new t(this.wasm,{id:r.service["@id"],width:r.width,height:r.height,isPng:"image/png"==r.format,settings:{}},{area:[s-i,0,s-i+1,1]})))}const n="top-to-bottom"==r.viewingDirection;this.noImage=!0,e.width=n?Math.max(...s.map(t=>t.width)):s.reduce((t,e)=>t+e.width,0),e.height=n?s.reduce((t,e)=>t+e.height,0):Math.max(...s.map(t=>t.height)),e.settings||(e.settings={});let a=0;s.forEach(i=>{const r=[(1-i.width/e.width)/2,(1-i.height/e.height)/2];this.embeds.push(new t(this.wasm,{id:i.service["@id"],width:i.width,height:i.height,isPng:"image/png"==i.format,settings:{}},{area:n?[r[0],a/e.height,1-r[0],(a+i.height)/e.height]:[a/e.width,r[1],(a+i.width)/e.width,1-r[1]]})),a+=n?i.height:i.width})}parseIIIFSequenceV3(e){const i=e.items?.flatMap(t=>t.items?.[0]?.items?.[0]?.body).filter(t=>!!t?.service?.[0]?.id).filter(t=>!!t);if(!i?.length)return;const r=this.setupIIIFGalleryContainer(e,i.map(t=>t.service[0].id));i.forEach((i,s)=>e.gallery.push(new t(this.wasm,{id:i.service[0].id,width:i.width,height:i.height,isPng:"image/png"==i.format,tileSize:e.tileSize,settings:{}},{area:[s-r,0,s-r+1,1]})))}addEmbed(e,i,r={}){const s=i.slice(0),n=new t(this.wasm,e,{area:s,isEmbed:!0,useParentCamera:r.asImage});return n.camera||(n.camera=this.camera),this.embeds.push(n),void 0===r.opacity&&(r.opacity=1),en(n.info).then(t=>{if(t){if("cover"==r.fit||"contain"==r.fit){const e=this.is360?2:1,i="cover"==r.fit,n=s[2]-s[0],a=s[3]-s[1],o=s[0]+n/2,c=s[1]+a/2,l=n/a*e,h=t.width/t.height;if(i&&h<l||!i&&h>=l){const t=n/h*e;s[1]=c-t/2,s[3]=c+t/2}else{const t=a*h/e;s[0]=o-t/2,s[2]=o+t/2}}this.wasm.addEmbed(n,this,r),this.wasm.render()}}),n}setEmbedMediaElement(t,e){e?this.embedElements.set(t,e):this.embedElements.delete(t)}getEmbedMediaElement(t){return this.embedElements.get(t)}splitStart(){const t=this.wasm.micrio.canvas.viewport.portrait;this.opts.secondaryTo?.camera.setArea(t?[0,0,1,.5]:[0,0,.5,1],{noRender:!0}),this.camera.setArea(t?[0,.5,1,1]:[.5,0,1,1],{noRender:!0}),this.camera.setView(this.__info?.settings?.view??[0,0,1,1]),this.wasm.render()}splitEnd(){const t=this.opts.area;if(!t)return;const e=t[2]-t[0],i=t[3]-t[1];if(Math.round(1e3*e)/1e3==0||Math.round(1e3*i)/1e3==0)return;const r=e>i;this.camera.setArea(r?[0,1,1,1]:[1,0,1,1],{noRender:!0}),this.opts.secondaryTo?.grid&&this.opts.secondaryTo.camera.aniDone||this.opts.secondaryTo?.camera.setArea([0,0,1,1],{noRender:!0}),this.wasm.render()}fadeIn(t=!1){this.wasm.fadeImage(this.ptr,1,t),this.wasm.render()}fadeOut(t=!1){this.wasm.fadeImage(this.ptr,0,t),this.wasm.render()}},Pc=class{constructor(t,e,i,r,s){this.wasm=t,this.image=e,this.embed=i,this.paused=r,this.moved=s,this.ism3u=!1,this.hlsPlayer=void 0,this.usVid=void 0,this.vidRepeatTo=void 0,this.placeTo=void 0,this.autoplay=!0,this._vid=void 0,this.isMounted=!0,this.events={play:()=>this.setPlaying(!0),pause:()=>this.setPlaying(!1),playing:()=>{!this.image._video&&this._vid&&("requestVideoFrameCallback"in this._vid?this._vid.requestVideoFrameCallback(()=>{this._vid&&this.isMounted&&(this.image.video.set(this._vid),this.wasm.render())}):this.image.video.set(this._vid))},canplayEvt:Js.iOS?"loadedmetadata":"canplay",canplay:()=>{this._vid&&this.isMounted&&(this.autoplay&&!this.paused?(this._vid.play().catch(t=>console.warn("WebGL Embed video play() failed on canplay:",t)),this.moved()):this.embed.hideWhenPaused||(this.setPlaying(!0),Si().then(()=>{this.setPlaying(!1),setTimeout(()=>this._vid?.remove(),50)})))}},this.ism3u=!!i.video?.streamId&&!i.video?.transparent,this._vid=e._video,this.autoplay=i.video?.autoplay??!0;let n=!0;this.usVid=this.image.visible.subscribe(t=>{clearTimeout(this.placeTo),this.placeTo=t?setTimeout(()=>{this.isMounted&&(this._vid?(this.hook(),this.autoplay&&!this.paused&&this._vid.play().catch(t=>console.warn("WebGL Embed video play() failed",t))):this.load())},n?0:100):setTimeout(()=>this._vid?.pause(),0),n=!1})}unmount(){this.isMounted=!1,clearTimeout(this.placeTo),clearTimeout(this.vidRepeatTo),this._vid?.pause(),this.unhook(),this.usVid?.()}setPlaying(t){this._vid&&(this.paused=!t,t?this._vid.dataset.playing="1":delete this._vid.dataset.playing,this.wasm.setImageVideoPlaying(this.image.ptr,t),this.embed.hideWhenPaused&&this.wasm.fadeImage(this.image.ptr,t?1:0),t&&this.wasm.render())}load(){if(!this.embed.video||this._vid)return;const t=this.ism3u?`https://videodelivery.net/${this.embed.video.streamId}/manifest/video.m3u8`:this.embed.video.src;t?(this._vid=document.createElement("video"),this._vid.crossOrigin="anonymous",this._vid.playsInline=!0,this._vid.width=this.embed.width,this._vid.height=this.embed.height,this._vid.muted=this.embed.video.muted,this.hook(),this.ism3u&&("MediaSource"in window||"ManagedMediaSource"in window)?tn("https://r2.micr.io/hls-1.6.15.min.js",void 0,"Hls"in window?{}:void 0).then(()=>{this.hlsPlayer=new window.Hls({abrEwmaDefaultEstimate:1e7,abrEwmaDefaultEstimateMax:5e7}),this.hlsPlayer.loadSource(t),this._vid&&this.hlsPlayer.attachMedia(this._vid)}).catch(t=>console.error("[Micrio GL Embed] Failed to load HLS.js:",t)):this._vid.src=t):console.error("[Micrio GL Embed] No video source found for embed:",this.embed.id)}hook(){if(!this.embed.video||!this._vid)return;const t=this.embed.video.loopAfter;this.embed.video.loop&&t?(this._vid.loop=!1,this._vid.onended=()=>{this.setPlaying(!1),this.vidRepeatTo=setTimeout(()=>this._vid?.play().catch(t=>console.warn("WebGL Embed video loop play() failed:",t)),1e3*t)},this._vid.onplay=()=>this.setPlaying(!0)):(this._vid.loop=this.embed.video.loop,this._vid.onended=null,this._vid.onplay=null),this._vid.parentNode||this.autoplay||this.ism3u||(this._vid.setAttribute("style","opacity:0;position:absolute;top:0;left:0;transform-origin:left top;transform:scale(0.1);pointer-events:none;"),document.body.appendChild(this._vid)),this._vid.addEventListener("play",this.events.play),this._vid.addEventListener("pause",this.events.pause),this._vid.addEventListener("playing",this.events.playing,{once:!0}),this._vid.addEventListener(this.events.canplayEvt,this.events.canplay,{once:!0})}unhook(){this._vid&&(this._vid.removeEventListener("play",this.events.play),this._vid.removeEventListener("pause",this.events.pause),this._vid.removeEventListener("playing",this.events.playing),this._vid.removeEventListener(this.events.canplayEvt,this.events.canplay),this._vid.onended=null,this._vid.onplay=null)}},Lc=Wi('<img alt="Embed" data-scroll-through="" class="micrio-embed"/>'),Cc=Wi('<button data-scroll-through="" aria-label="embed-button" class="micrio-embed"></button>');function Rc(t,e){et(e,!0);const i=()=>kt(a,"$current",r),[r,s]=_t(),n=Q("micrio"),{current:a,wasm:o,canvas:c,_lang:l}=n;let h=ys(e,"embed",15);h().src?.startsWith("/r2")&&h(h().src="http://localhost:6100"+h().src,!0);const d=i(),u=d.$info;h().uuid||h(h().uuid=Gs(),!0);const m=h().uuid,f=d.is360,p=h().video?.autoplay??!0;let g=d.embeds.find(t=>t.uuid==m||t.$info?.title==m);const v=window.matchMedia("(dynamic-range: high)").matches||Js.OSX,b=h().area,y=h().src?.toLowerCase().endsWith(".svg"),k=!(!h().width||!h().height)&&h().width*h().height<Math.pow(1024,2),T=/iPhone OS 14_/i.test(navigator.userAgent),_="data-embeds-inside-gl",x=n.getAttribute(_),E=!(y||T||!v&&!n.hasAttribute(_)&&h().video||"false"==x||(!h().micrioId||k&&h().src)&&(!h().video||h().video.controls||h().video.transparent)),S=!h().clickAction&&!h().frameSrc&&!$i(()=>e.marker),A="href"==h().clickAction?h().clickTarget:void 0,M=A&&h().clickTargetBlank;let I=ne(ue(b[2])),$=ne(ue(b[3])),P=ne(b[0]+b[2]/2),L=ne(b[1]+b[3]/2),C=ne(ue(h().scale||1)),R=ne(ue(h().rotX??0)),D=ne(ue(h().rotY??0)),F=ne(ue(h().rotZ??0)),O=ne(ue(h().scaleX??1)),z=ne(ue(h().scaleY??1)),N=ne(""),V=ne(0);function U(){const t=h().area;oe(I,t[2],!0),oe($,t[3],!0),oe(P,t[0]+Ai(I)/2),oe(L,t[1]+Ai($)/2),oe(C,h().scale||1,!0),oe(R,h().rotX??0,!0),oe(D,h().rotY??0,!0),oe(F,h().rotZ??0,!0),oe(O,h().scaleX??1,!0),oe(z,h().scaleY??1,!0);const e=E&&h().micrioId&&h().width,i=e?10:1;let r=Ai(I)*u.width/(h().width??100)/(E?h().width?Ai(I):1:Ai(C))*(f?Math.PI/2:1);const s=[];e&&h().width&&(r=Ai(I)/(h().width/u.width)*i*(f?Math.PI/2:1),s.push(`width:${h().width/i}px`)),s.push(`--ratio:${Ai(I)/Ai($)*u.width/u.height};--scale:${r}`),y&&oe(N,Ai(N)+`height:${h().height}px`),oe(N,s.join(";"),!0),h().video&&(h().video.width>h().video.height?oe(V,Math.min(h().video.width,Ai(I)*u.width,2048),!0):oe(V,Math.min(h().video.height,Ai($)*u.height,2048)/(h().video.height/h().video.width)))}U();const B=Ht(()=>Math.round(Ai(I)*u.width)),W=Ht(()=>Math.round(Ai($)*u.height));let q,X=ne(!1),Y=ne(0),G=ne(0),j=ne(""),H=ne(!1),Z=ne("");function J(){if(!d.wasm.ready)return;const t=d.camera.getXYDirect(Ai(P),Ai(L));if((t=>{var e=w(t,3);oe(Y,e[0],!0),oe(G,e[1],!0),q=e[2]})(t),f&&(oe(j,d.camera.getMatrix(Ai(P),Ai(L),Ai(C),1,Ai(R),Ai(D),Ai(F),void 0,Ai(O),Ai(z)).join(","),!0),oe(H,t[3]>2)),oe(Z,(f?`transform:matrix3d(${Ai(j)});`:`--x:${Ai(Y)}px;--y:${Ai(G)}px;--s:${q};`)+(void 0!==h().opacity&&1!==h().opacity?`--opacity:${h().opacity};`:"")),(h().video?.pauseWhenSmallerThan||h().video?.pauseWhenLargerThan)&&Ai(B)){const t=Ai(X);oe(X,function(){if(!h().video?.pauseWhenSmallerThan&&!h().video?.pauseWhenLargerThan)return!p;const t=q?Math.max(Ai(B)*q/c.viewport.width,Ai(W)*q/c.viewport.height):0;return!!(h().video.pauseWhenSmallerThan&&t<h().video.pauseWhenSmallerThan||h().video.pauseWhenLargerThan&&t>h().video.pauseWhenLargerThan)}(),!0),Ai(nt)?._vid&&Ai(X)!=t&&(Ai(X)?Ai(nt)._vid.pause():(d?.$settings?.embedRestartWhenShown&&(Ai(nt)._vid.currentTime=0),Ai(nt)._vid.play()))}}function K(){const t="markerId"==h().clickAction?h().clickTarget:e.marker?.id;t&&i()&&!A&&i().state.marker.set(t)}function tt(t){if(t&&"detail"in t){const e=t.detail;for(const t in e)h(h()[t]=e[t],!0)}U(),J()}const rt=vt(!1);h().video&&(h().video.controls||h(h().video.muted=!0,!0));const st=E&&!!h().video;let nt=ne(void 0);const at=!E||!!h().clickAction;let ot=ne(void 0);Oe(()=>{h().video&&h().id&&i()&&i().setEmbedMediaElement(h().id,Ai(ot)??Ai(nt)?._vid)});const ct=Ht(()=>h().video||E?Ai(V):Ai(B)),lt=Ht(()=>h().video?Ai(V)/(h().video.width/h().video.height):Ai(W)),ht=Ht(()=>Ai(B)/Ai(ct));pr(()=>{const t=[];return E&&function(){const t=h().hideWhenPaused?.01:h().opacity??1,e=[h().area[0],h().area[1],h().area[0]+h().area[2],h().area[1]+h().area[3]];g&&g.ptr>=0?(g.camera.setArea(e),g.camera.setRotation(h().rotX,h().rotY,h().rotZ),o.fadeImage(g.ptr,t)):g=d.addEmbed({id:h().video?h().id:h().micrioId,title:m,width:h().width,height:h().height,isPng:h().isPng,isWebP:h().isWebP,isDeepZoom:h().isDeepZoom,path:u.tileBasePath??u.path,isSingle:!!h().video,isVideo:!!h().video,settings:{_360:{rotX:Ai(R),rotY:Ai(D),rotZ:Ai(F)}}},e,{opacity:t,asImage:!1}),st&&en(g.visible,{targetValue:!0}).then(()=>{oe(nt,new Pc(o,g,h(),Ai(X),J),!0)}),o.render()}(),(at||h().video?.pauseWhenSmallerThan||h().video?.pauseWhenLargerThan)&&t.push(d.state.view.subscribe(J)),()=>{for(Ai(nt)?.unmount(),g&&g.ptr>=0&&(o.fadeImage(g.ptr,0),o.render()),h().video&&h().id&&i()&&i().setEmbedMediaElement(h().id);t.length;)t.shift()?.()}});var dt=Gi(),ut=xe(dt),mt=t=>{var i=Gi();Fr(xe(i),()=>A?"a":"div",!1,(t,i)=>{Or(t,(t,e)=>{return r=e,(i=t).addEventListener("change",r),{destroy:()=>i.removeEventListener("change",r)};var i,r},()=>tt),cs(t,()=>({id:h().id?"e-"+h().id:void 0,style:Ai(Z),role:A?void 0:"figure",onclick:K,onkeypress:K,href:A,target:A&&M?"_blank":null,class:"",[Hr]:{"embed-container":!0,embed3d:f,"no-events":S,behind:f&&Ai(H)}}),void 0,void 0,void 0,"micrio-embed");var s=Gi(),n=xe(s),a=t=>{{let e=Ht(()=>h().video.streamId&&!h().video.transparent?"cfvid://"+h().video.streamId:h().video.src),i=Ht(()=>h().video.muted?0:1),r=Ht(()=>!Ai(X)&&h().video.autoplay),s=Ht(()=>h().video.transparent&&h().video.hasH265);Ha(t,{get forcePause(){return Ai(X)},get src(){return Ai(e)},get width(){return Ai(ct)},get height(){return Ai(lt)},get frameScale(){return Ai(ht)},get controls(){return h().video.controls},get destroying(){return rt},get loop(){return h().video.loop},get loopDelay(){return h().video.loopAfter},get volume(){return Ai(i)},get autoplay(){return Ai(r)},get hasTransparentH265(){return Ai(s)},get _media(){return Ai(ot)},set _media(t){oe(ot,t,!0)}})}},o=t=>{Ha(t,{get src(){return h().frameSrc},get width(){return Ai(B)},get height(){return Ai(W)},get frameScale(){return h().scale},get autoplay(){return h().autoplayFrame},get destroying(){return rt}})},c=t=>{var e=Lc();Ue(()=>{as(e,"src",h().src),Yr(e,Ai(N)),as(e,"width",y?h().width:void 0),as(e,"height",y?h().height:void 0)}),ji(t,e)},d=t=>{var i=Cc();Ue(()=>{Yr(i,Ai(N)),as(i,"title",h().title||e.marker?.i18n?.[kt(l,"$_lang",r)]?.title)}),ji(t,i)};vr(n,t=>{h().video&&!E?t(a):h().frameSrc?t(o,1):!E&&h().src?t(c,2):t(d,-1)}),ji(i,s)}),ji(t,i)};vr(ut,t=>{at&&(Ai(j)||Ai(Y)||Ai(G))&&t(mt)}),ji(t,dt),it(),s()}var Dc=Xi("<line></line>"),Fc=Wi('<article class="micrio-markers"><label> </label></article>'),Oc=Wi('<article class="micrio-markers"><label> </label></article>'),zc=Wi('<svg class="micrio-markers"></svg> <aside class="micrio-markers"><section class="micrio-markers"></section> <section class="micrio-markers"></section></aside>',1),Nc=Wi("<!> <!>",1),Vc=Wi("<div><!> <!></div>"),Uc=Wi("<!> <!> <!> <!>",1);function Bc(t,e){et(e,!0);const i=()=>kt(m,"$settings",c),r=()=>kt(E,"$inView",c),s=()=>kt(x,"$hoveredId",c),n=()=>kt(g,"$switching",c),a=()=>kt(d,"$data",c),o=()=>kt(v,"$_lang",c),[c,l]=_t();let h=ys(e,"image",15);const{data:d,info:u,settings:m}=h(),f=h().state.marker,p=h().wasm.micrio,{switching:g,_lang:v,state:w}=p,b=p.canvas.isMobile,y=p.canvases[0]?.grid,k=y?.focussed,T=y?.markersShown,_=i().clusterMarkerRadius??16,x=w.markerHoverId,E=vt([]);tt("inView",E);const S=i()._markers??{},A=i().omni,M=!(S.noTitles||A?.sideLabels||!S.showTitles&&5!=h().id.length);let I=!1;function $(t){t?"string"==typeof t||h().openedView||t.noMarker||!t.view||(h(h().openedView=p.state.$tour&&!("steps"in p.state.$tour)?void 0:qs(h().state.$view),!0),I=!!t.videoTour):h().openedView&&!p.state.$tour&&setTimeout(()=>{Ai(H)||h().camera.aniDone||!h().openedView||h().camera.flyToView((t=>{const e=Math.min(1,t[2]),i=Math.min(1,t[3]),r=e/2,s=i/2;return[Math.max(r,Math.min(1-r,t[0]+t[2]/2))-r,Math.max(s,Math.min(1-s,t[1]+t[3]/2))-s,e,i]})(h().openedView),{speed:i()._markers?.zoomOutAfterCloseSpeed}).catch(()=>{}),h(h().openedView=void 0,!0),I=!1},I?250:10)}let P=!1;w.tour.subscribe(t=>{t&&"steps"in t?(P=!0,t.keepLastStep&&h(h().openedView=void 0,!0)):(t||h().openedView||!P||h().camera.stop(),P=!1)});const L=[];let C=ne(""),R=ne(!1),D=ne(!1);const F=t=>(t=t?.map(t=>Math.round(100*t)/100))&&oe(C,[...L,t[0]?`left: ${t[0]}px`:null,t[1]?`top: ${t[1]}px`:null,`width: ${t[2]}px`,`height: ${t[3]}px`].filter(t=>!!t).join(";")+";");let O=ne(ue([])),z=_,N=ne(ue([]));const V=new Map,U=()=>{const t=function(t,e,i,r){if(!t)return{overlapped:[],clusterMarkers:[]};const s=t,n=[],a=s.length,o=[];for(let c=0;c<a;c++)for(let t=c+1;t<a;t++){if(s[t].tags?.includes("no-cluster"))continue;const r=e.get(s[c].id),a=e.get(s[t].id);if(r&&a&&_n(r,a,i)){o.push(c,t);const e=n.find(e=>e.findIndex(e=>e==c||e==t)>-1);e?e.push(c,t):n.push([c,t])}}return{overlapped:o,clusterMarkers:n.map(t=>t.filter((e,i)=>t.indexOf(e)===i)).map(t=>{let e,i,n,a,o,c;if(r){o=t.reduce((t,e)=>t+s[e].x,0)/t.length,c=t.reduce((t,e)=>t+s[e].y,0)/t.length;const r=.3;e=Math.max(0,o-r/2),n=Math.max(0,c-r/2),i=Math.min(1,o+r/2),a=Math.min(1,c+r/2)}else e=Math.min(...t.map(t=>s[t].view?s[t].view[0]:s[t].x)),i=Math.max(...t.map(t=>s[t].view?s[t].view[0]+s[t].view[2]:s[t].x)),n=Math.min(...t.map(t=>s[t].view?s[t].view[1]:s[t].y)),a=Math.max(...t.map(t=>s[t].view?s[t].view[1]+s[t].view[3]:s[t].y)),o=(e+i)/2,c=(n+a)/2;const l=r?t.reduce((t,e)=>t+(s[e].rotation??0),0)/t.length:void 0,h=r?t.reduce((t,e)=>t+(s[e].radius??1),0)/t.length:void 0;return{title:t.length+"",type:"cluster",view:[e,n,Math.max(.1,i-e),Math.max(.1,a-n)],x:o,y:c,rotation:l,radius:h,id:t.sort((t,e)=>t-e).join(","),data:{},popupType:"none",tags:[]}})}}(Ai(J),V,z,h().isOmni);oe(O,t.overlapped,!0),oe(N,t.clusterMarkers,!0)},B=[];pr(()=>{const t=[];return en(u).then(e=>{if(!e)return;oe(R,!!e.is360);const r=i()._markers;if(!r)return;const s=parseFloat(e.version)>=4.2;r.markerIcon&&L.push(`--micrio-marker-icon: url("${r.markerIcon}")`),r.markerColor&&r.markerColor!=(s?"#ffffff":"#ffbb00")&&L.push("--micrio-marker-color: "+r.markerColor),r.markerSize&&r.markerSize!=(s?"16":"25")&&L.push("--micrio-marker-size: "+(z=Number(r.markerSize))+"px"),t.push(h().viewport.subscribe(F)),i().clusterMarkers&&(t.push(h().state.view.subscribe(U)),t.push(h().data.subscribe(()=>Si().then(U)))),!h().grid&&i()._markers?.zoomOutAfterClose&&t.push(h().state.marker.subscribe($)),h().isOmni&&i().omni?.sideLabels&&!i()._markers?.noTitles&&t.push(b.subscribe(t=>{t&&Ai(D)?function(){for(;B.length;)B.shift()?.()}():t||Ai(D)||(B.push(h().state.view.subscribe(G)),B.push(x.subscribe(G)),B.push(f.subscribe(G))),oe(D,!t)}))}),()=>{for(;t.length;)t.shift()?.()}});const W=t=>!t.noMarker;let X=ne(void 0),Y=ne(ue([]));function G(){Si().then(()=>{if(!Ai(X))return;const t=p.canvas,e=t.element.offsetWidth,i=[];r().forEach(([r,n,a])=>{const o=Ai(X).querySelector('label[for="'+r.id+'"]')?.getBoundingClientRect();o?.width&&o.width>0&&i.push([n*e,a,(n>=.5?o.left:o.right)-t.viewport.left,o.top+o.height/2-t.viewport.top,s()==r.id])}),oe(Y,i,!0)})}const j=(t,e)=>t.i18n?t.i18n[e]?.title:t.title,H=Ht(()=>y&&kt(k,"$focussed",c)!=h()&&T&&wt(T).indexOf(h())<0),Z=Ht(()=>!n()&&p.spaceData?p.spaceData.links.filter(t=>t[0]==h().id||t[1]==h().id).map(t=>({targetId:t[0]==h().id?t[1]:t[0],settings:t[2]?.[h().id]})):void 0),J=Ht(()=>Ai(H)?[]:a()?.markers?.filter(W)),K=Ht(()=>Ai(H)?a()?.markers:a()?.markers?.filter(t=>!W(t))),Q=Ht(()=>Ai(H)?[]:a()?.markers?.filter(t=>t.clickableArea)),rt=Ht(()=>!(!Ai(J)?.length&&!Ai(Z)?.length)),st=Ht(()=>[...r()].sort(([,,t],[,,e])=>t>e?1:t<e?-1:0));var nt=Uc(),at=xe(nt),ot=t=>{var e=zc(),i=xe(e);yr(i,21,()=>Ai(Y),wr,(t,e)=>{var i=Dc();let r;Ue(()=>{as(i,"x1",Ai(e)[0]),as(i,"y1",Ai(e)[1]),as(i,"x2",Ai(e)[2]),as(i,"y2",Ai(e)[3]),r=qr(i,0,"micrio-markers",null,r,{hovered:Ai(e)[4]})}),ji(t,i)}),q(i);var r=Ee(i,2),n=_e(r);yr(n,21,()=>Ai(st).filter(([,t])=>t<.5),t=>t[0].id,(t,e)=>{var i=Fc(),r=_e(i);let n;var a=_e(r,!0);q(r),q(i),Ue(t=>{as(r,"for",Ai(e)[0].id),n=qr(r,1,"micrio-markers",null,n,{hover:s()==Ai(e)[0].id}),nr(a,t)},[()=>j(Ai(e)[0],o())]),Fi("mouseenter",r,()=>x.set(Ai(e)[0].id)),Fi("mouseleave",r,()=>x.set(void 0)),ji(t,i)}),q(n);var a=Ee(n,2);yr(a,21,()=>Ai(st).filter(([,t])=>t>=.5),t=>t[0].id,(t,e)=>{var i=Oc(),r=_e(i);let n;var a=_e(r,!0);q(r),q(i),Ue(t=>{as(r,"for",Ai(e)[0].id),n=qr(r,1,"micrio-markers",null,n,{hover:s()==Ai(e)[0].id}),nr(a,t)},[()=>j(Ai(e)[0],o())]),Fi("mouseenter",r,()=>x.set(Ai(e)[0].id)),Fi("mouseleave",r,()=>x.set(void 0)),ji(t,i)}),q(a),q(r),gs(r,t=>oe(X,t),()=>Ai(X)),ji(t,e)};vr(at,t=>{Ai(D)&&Ai(st).length&&!kt(f,"$currentMarker",c)&&t(ot)});var ct=Ee(at,2),lt=t=>{var e=Gi();yr(xe(e),17,()=>Ai(Q),t=>t.id,(t,e)=>{var i=Gi(),r=xe(i),s=t=>{Rc(t,{get embed(){return Ai(e).clickableArea},get marker(){return Ai(e)}})};vr(r,t=>{Ai(e).clickableArea&&t(s)}),ji(t,i)}),ji(t,e)};vr(ct,t=>{Ai(Q)&&t(lt)});var ht=Ee(ct,2),dt=t=>{var e=Vc();let i;var r=_e(e),s=t=>{var e=Gi();yr(xe(e),17,()=>Ai(Z),t=>t.targetId,(t,e)=>{wc(t,bs({get image(){return h()}},()=>Ai(e)))}),ji(t,e)};vr(r,t=>{Ai(Z)&&Ai(Z).length&&t(s)});var a=Ee(r,2),o=t=>{var e=Nc(),i=xe(e);yr(i,19,()=>Ai(J),t=>t.id,(t,e,i)=>{{let r=Ht(()=>Ai(O).includes(Ai(i)));gc(t,{get marker(){return Ai(e)},get image(){return h()},get coords(){return V},get overlapped(){return Ai(r)}})}}),yr(Ee(i,2),17,()=>Ai(N),t=>t.id,(t,e)=>{gc(t,{get marker(){return Ai(e)},get image(){return h()}})}),ji(t,e)};vr(a,t=>{Ai(J)&&t(o)}),q(e),Ue(()=>{Yr(e,Ai(rt)?Ai(C):null),i=qr(e,1,"micrio-markers",null,i,{"show-titles":M,is360:Ai(R),inactive:Ai(H)||Ai(R)&&n()})}),ji(t,e)};vr(ht,t=>{Ai(rt)&&t(dt)});var ut=Ee(ht,2),mt=t=>{var e=Gi();yr(xe(e),17,()=>Ai(K),t=>t.id,(t,e)=>{gc(t,{get marker(){return Ai(e)},get image(){return h()},forceHidden:!0})}),ji(t,e)};vr(ut,t=>{Ai(K)&&t(mt)}),ji(t,nt),it(),l()}var Wc=Xi('<svg width="100" height="100" class="micrio-progress-circle"><circle fill="transparent" stroke="#e0e0e0" stroke-width="8px" class="micrio-progress-circle"></circle><circle fill="transparent" stroke="#00d4ee" stroke-width="8px" class="micrio-progress-circle"></circle></svg>');var qc=Wi("<!> <!> <!>",1),Xc=Wi("<!> <!> <!>",1),Yc=Wi("<!> <!>",1),Gc=Wi("<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>",1);var jc=!self.createImageBitmap,Hc=URL.createObjectURL(new Blob(["let controller = null, prevUri = null;\nself.addEventListener('message', e => {\n\t// Handle abort message\n\tif(e.data == 'abort') return controller && controller.abort();\n\t// Create new AbortController for this fetch\n\tcontroller = new AbortController();\n\t// Fetch the image blob\n\tfetch(e.data.src, { signal: controller.signal })\n\t\t.then(r => r.blob())"+(jc?"\n\t\t// Fallback for older Safari: create Object URL\n\t\t.then(blob => {\n\t\t\t// Revoke previous Object URL to free memory\n\t\t\tURL.revokeObjectURL(prevUri);\n\t\t\t// Post Object URL back\n\t\t\tself.postMessage({src: (prevUri = URL.createObjectURL(blob, {type: e.data.type}))})\n\t\t})":"\n\t\t// If createImageBitmap is supported, use it (preferred)\n\t\t.then(blob => self.createImageBitmap(blob))\n\t\t// Post ImageBitmap back, transferring ownership\n\t\t.then(data => self.postMessage({data:data, src:e.data.src}, [data]))")+"\n\t\t// Handle fetch errors (including abort)\n\t\t.catch(err => self.postMessage({error: e.data.src+': '+err.message, type: err.name}))\n})"],{type:"text/javascript"})),Zc=Math.max(2,Math.min(6,(navigator.hardwareConcurrency||2)-1)),Jc=[],Kc=new Map,Qc=new Map,tl=[],el=new Map;for(let Fl=0;Fl<Zc;Fl++){const t=new Worker(Hc);t.onmessage=t=>rl(Fl,t.data.src,t.data.data,t.data.error,t.data.type),Kc.set(Fl,t),jc&&Qc.set(Fl,new Image)}var il=t=>new Promise((e,i)=>{tl.push([t,e,i]),function(){if(!tl.length)return;let t=0;for(;t<Zc&&Jc.includes(t);t++);if(t>=Zc)return;Jc.push(t);const e=tl.shift();if(!e)return void Jc.splice(Jc.indexOf(t),1);el.set(t,e);const i=Kc.get(t);if(!i)return console.error(`[Micrio Texture] Worker ${t} not found!`),e[2]("Internal error: Worker not found"),void Jc.splice(Jc.indexOf(t),1);i.postMessage({src:e[0],type:"image/"+e[0].split(".").pop()})}()});function rl(t,e,i,r,s){const n=el.get(t);if(null!=n)if(el.delete(t),setTimeout(()=>{Jc.splice(Jc.indexOf(t),1)},50),r)n[2](r),"AbortError"!=s&&console.error(`[Micrio Texture] Error loading ${n[0]}: ${s} - ${r}`);else if(i)n[1](i);else if(e&&jc){const i=Qc.get(t);if(!i)return void n[2]("Internal error: Image element fallback not found");i.onload=()=>{n[1](i)},i.onerror=()=>{n[2](`Failed to load image from Object URL: ${e}`)},i.src=e}else n[2](`Worker ${t} sent invalid message.`),console.error(`[Micrio Texture] Worker ${t} sent invalid message for ${n[0]}`);else console.warn(`[Micrio Texture] Received message from worker ${t} but no matching promise found.`)}function sl(){return Jc.length}function nl(t){const e=[...el.entries()].find(e=>e[1][0]==t);if(null==e)return;const i=Kc.get(e[0]);i&&i.postMessage("abort")}var al=document.currentScript?.getAttribute("src")?.toString(),ol=al?.includes(".safe-wasm.js")?al.replace(".safe-wasm.js",".wasm"):"/build/optimized.wasm",cl=_c.ugz?_c.ugz(_c.b64,!0):fetch(ol).then(t=>t.arrayBuffer()),ll=class t{static{this._textureBuffer=t.getTextureBuffer(1,1)}setVisibleCb(t,e){this.ptrToImage.get(t)?.visible.set(1===e)}static getTextureBuffer(t,e){const i=new Float32Array(12*t*e),r=1/t,s=1/e;for(let n=0,a=0;a<e;a++)for(let e=0;e<t;e++,n+=12)i[n+3]=i[n+7]=i[n+9]=(i[n+1]=i[n+5]=i[n+11]=a*s)+s,i[n+4]=i[n+8]=i[n+10]=(i[n+0]=i[n+2]=i[n+6]=e*r)+r;return i}constructor(t){this.micrio=t,this.ready=!1,this.memory=new self.WebAssembly.Memory({initial:100,maximum:100}),this.b=this.memory.buffer,this.i=-1,this.c=-1,this.now=-1,this.raf=-1,this.drawing=!1,this.images=[],this.bareBone=!1,this.baseTiles=[],this.drawnSet=new Set,this.prevDrawnSet=new Set,this.tiles=new Map,this.requests=new Map,this.unsubscribe=[],this.cameras=new Map,this.ptrToImage=new Map,this.preventDirectionSet=!1,this._pMatrices=new Map,this.isGallery=!1,this.imports={env:{memory:this.memory,abort:console.error},main:{"console.log":console.log,"console.log2":console.log,"console.log3":console.log,"console.log4":console.log,drawTile:this.drawTile.bind(this),drawQuad:t=>this.micrio.webgl.drawTile(void 0,t),aniAbort:t=>{const e=this.cameras.get(t);e&&(e.aniAbort&&e.aniAbort(),e.aniDoneAdd.length=0,e.aniAbort=e.aniDone=void 0)},aniDone:t=>{const e=this.cameras.get(t);if(e){for(e.aniDone&&e.aniDone();e.aniDoneAdd.length;)e.aniDoneAdd.shift()?.();e.aniAbort=e.aniDone=void 0}},getTileOpacity:t=>this.tiles.get(t)?.opacity||0,setTileOpacity:(t,e=!1,i=1)=>{const r=this.tiles.get(t);return r?(r.opacity<1&&(r.opacity=e?1:r.loadedAt&&r.loadedAt>0?Math.min(1,(this.now-r.loadedAt)/250)*i:0),r.opacity):0},setMatrix:t=>this.micrio.webgl.gl.uniformMatrix4fv(this.micrio.webgl.pmLoc,!1,this._pMatrices.get(t)),setViewport:(t,e,i,r)=>this.micrio.webgl.gl.viewport(Math.floor(t),Math.floor(e),Math.ceil(i),Math.ceil(r)),viewSet:t=>this.cameras.get(t)?.viewChanged(),viewportSet:(t,e,i,r,s)=>{const n=this.ptrToImage.get(t);n&&"camera"in n&&n.viewport.set([e,i,r,s])},setVisible:this.setVisibleCb.bind(this),setVisible2:this.setVisibleCb.bind(this)}},this.addImage=async(t,e,i=!1,r=1)=>en(t.info).then(s=>{if(!s)return;this.images.push(t);const n=t.opts.area??[0,0,1,1],a=t.$settings._360??{};if(t.ptr=i?this.e._addImage(e.ptr,n[0],n[1],n[2],n[3],s.width,s.height,s.tileSize||1024,s.isSingle??!1,s.isVideo??!1,r,a.rotX??0,a.rotY??0,a.rotZ??0,a.scale??1,0):this.e._addChild(e.ptr,n[0],n[1],n[2],n[3],s.width,s.height),this.ptrToImage.set(t.ptr,t),!i){this.bindCamera(t),t.$settings.focus&&this.e._setCoo(t.ptr,t.$settings.focus[0],t.$settings.focus[1],0,0,performance.now());const e=this.e._getPMatrix(t.ptr);this._pMatrices.set(e,new Float32Array(this.b,e+32,16));const i=t.$info.view;i&&"0,0,1,1"!=i.toString()&&this.e._setView(t.ptr,i[0],i[1],i[2],i[3]),this.e._sendViewport(t.ptr)}t.baseTileIdx=this.e.getNumTiles(this.i)-1,this.getTileEntry(t.baseTileIdx).opacity=1,this.baseTiles.push(t.baseTileIdx)}),this.addChild=(t,e)=>this.addImage(t,e),this.deleteAfterSeconds=Js.iOS?5:wt(this.micrio.canvas.isMobile)?30:90,this.render=this.render.bind(this),this.draw=this.draw.bind(this),this.unsubscribe.push(t.current.subscribe(this.setCanvas.bind(this)))}async load(){if(this.i>=0)return;this.i=0;const e=await cl;if(!(e instanceof Uint8Array||e instanceof ArrayBuffer))throw new Bs("Invalid WebAssembly binary data",{code:Fs,displayMessage:"Failed to load the image viewer engine. Please try refreshing the page."});this.e=(await self.WebAssembly.instantiate(e,this.imports)).instance.exports,this.i=this.e.constructor(),t.segsX=this.e.segsX.value,t.segsY=this.e.segsY.value,t._textureBuffer360=t.getTextureBuffer(t.segsX,t.segsY),this._vertexBuffer=new Float32Array(this.b,this.e.getVertexBuffer(this.i)+32,18),this._vertexBuffer360=new Float32Array(this.b,this.e.getVertexBuffer360(this.i)+32,18*t.segsX*t.segsY),this.unsubscribe.push(this.micrio.barebone.subscribe(t=>this.e.setBareBone(this.i,this.bareBone=t)))}unbind(){for(this.stop();this.unsubscribe.length;)this.unsubscribe.shift()?.();this.requests.forEach(t=>nl(t)),this.requests.clear();for(const[t,e]of this.tiles.entries())e.timeoutId&&clearTimeout(e.timeoutId),this.deleteTile(t);this.tiles.clear(),this.i>0&&this.e.reset(this.i)}getPtr(){return this.i}addCanvas(t){const e=t.$info;if(!e)return;if(t.error)return void this.micrio.loading.set(!1);if(!(t.noImage||e.width&&e.height))throw"Invalid Micrio image size";const i=t.$settings;this.isGallery=!!e.gallery||t.isOmni,i.gallery?.archive&&this.e.setHasArchive(this.i,!0,i.gallery.archiveLayerOffset??0),e.version&&parseFloat(e.version)<=3.1&&this.e.setNoUnderzoom(this.i,!0),e.is360&&(i.limitToCoverScale=!1);const r=!!i.limitToCoverScale,s=r||"cover"==i.initType;t.noImage&&this.micrio.loading.set(!1);const n=[.5,.5],a=i.focus,o=!!e.spacesId;a&&(isNaN(a[0])||null===a[0]||(n[0]=a[0]),isNaN(a[1])||null===a[1]||(n[1]=a[1]));const c=i._360?.video,l=e.is360&&c&&(c.src||"video"in c&&c.video),h=!!this.isGallery&&("switch"==i.gallery?.type||"omni"==i.gallery?.type||"swipe-full"==i.gallery?.type),d=i.omni?.layers?.length??1;i.omni&&(i.omni.layerStartIndex=Math.min(d-1,i.omni?.layerStartIndex??0)),t.ptr=this.e._constructor(this.i,e.width,e.height,e.tileSize??1024,e.is360??!1,t.noImage,!(!e.isSingle&&!l),t.opacity,i.freeMove??!1,r,s,i.zoomLimit||1,!1!==i.zoomLimitDPRFix?this.micrio.canvas.getRatio(t.$settings):1,i.camspeed??1,t.camera.rotationY,h,!!i.gallery?.isSpreads&&"swipe"==i.gallery.type,t.isOmni,i.pinchZoomOutLimit??!1,d,i.omni?.layerStartIndex??0),this.bindCamera(t),t.opts.area&&t.camera.setArea(t.opts.area,{direct:!0,noDispatch:!0,noRender:!0}),i?.restrict&&t.camera.setLimit(i.restrict),i?.crossfadeDuration&&this.setCrossfadeDuration(i.crossfadeDuration),i?.embedFadeDuration&&this.e.setEmbedFadeDuration(this.i,i.embedFadeDuration),void 0!==i?.dragElasticity&&this.e.setDragElasticity(this.i,i.dragElasticity),i?.skipBaseLevels&&this.e.setSkipBaseLevels(this.i,i.skipBaseLevels),i?.omni&&t.camera.setOmniSettings(),this.micrio.hasAttribute("data-limited")&&this.setLimited(t.ptr,!0),this.images.push(t),this.ptrToImage.set(t.ptr,t),this.e._sendViewport(t.ptr);const u=this.e.getNumTiles(this.i);if(u>0){const t=u-1;this.getTileEntry(t).opacity=1,this.baseTiles.push(t)}const m=this.e._getPMatrix(t.ptr);this._pMatrices.set(m,new Float32Array(this.b,m+32,16));const f=wt(t.state.view)||i.view;!f||0==f[0]&&0==f[1]&&1==f[2]&&1==f[3]?!o&&e.is360||!n||"0.5,0.5"==n.toString()||(this.e._setCoo(t.ptr,n[0],n[1],0,0,performance.now()),i.focus=void 0):this.e._setView(t.ptr,f[0]+f[2]/2,f[1]+f[3]/2,f[2],f[3],!1,!1,!1),t.video.subscribe(t=>t&&t.addEventListener("play",this.render)),t.noImage&&t.visible.set(!0),this.setCanvas(t)}bindCamera(t){this.cameras.set(t.ptr,t.camera),t.camera.assign(new Float64Array(this.b,this.e._getView(t.ptr)+32,4),new Float64Array(this.b,this.e._getXY(t.ptr,0,0)+32,5),new Float64Array(this.b,this.e._getCoo(t.ptr,0,0)+32,5),new Float32Array(this.b,this.e._getMatrix(t.ptr)+32,16))}setCanvas(t){if(t&&!(t.ptr>0&&t.ptr==this.c))if(t.ptr<0)en(t.info).then(e=>{e&&this.micrio.$current&&(e.isIIIF||t.opts.secondaryTo||e.id==this.micrio.$current.id)&&(this.addCanvas(t),t.embeds.length&&t.embeds.forEach(e=>this.addEmbed(e,t)))});else if(this.c!=t.ptr){const e=t.is360&&this.c>=0?this.e._getYaw(this.c,!0):0,i=t.is360&&this.c>=0?this.e._getPitch(this.c):0;this.c=t.ptr,t.is360&&!this.preventDirectionSet&&e&&i&&this.e._setDirection(this.c,e-t.camera.rotationY,i,!0),0==this.e._getTargetOpacity(t.ptr)&&this.e._fadeIn(t.ptr),t.$settings.omni?.layerStartIndex&&t.state.layer.set(t.$settings.omni.layerStartIndex),this.preventDirectionSet=!1,this.ready=!0,this.render()}}removeCanvas(t){if(t.ptr<0)throw"Canvas is not placed yet";this.e._remove(t.ptr),this.render()}render(){this.raf<0&&(this.raf=this.micrio.webgl.display.requestAnimationFrame(this.draw))}draw(t=performance.now()){this.micrio.isConnected&&this.micrio.$current&&(this.raf=-1,this.drawing=!1,this.now=t,(1==this.e.shouldDraw(this.i,t)||this.micrio.keepRendering||this.micrio.events.isNavigating||!1===this.micrio._current?._video?.paused)&&this.render(),this.isGallery&&this.drawStart(),this.drawnSet.clear(),this.e.draw(this.i),this.micrio.events.dispatch("draw"),this.cleanup(),this.micrio.webgl.drawEnd())}stop(){this.raf<0||(this.micrio.webgl.display.cancelAnimationFrame(this.raf),this.raf=-1)}getTileEntry(t){let e=this.tiles.get(t);return e||(e={loadState:0,opacity:0},this.tiles.set(t,e)),e}drawTile(t,e,i,r,s,n,a,o){this.drawnSet.add(e);const c=this.getTileEntry(e);c.deleteAt=void 0;const l=sl(),h=this.images[t],d="camera"in h&&h.isVideo,u="camera"in h&&h.is360,m="camera"in h?h:h.image,f="frame"in h?h.frame:void 0;if(0===c.loadState&&l<Zc){if(this.bareBone?l>2&&a:o&&a&&l>0)return!1;if(d&&!u)c.loadState=2,c.texture=this.micrio.webgl.getTexture();else{c.loadState=1;const t=m.getTileSrc(i,r,s,f);if(!t)return c.loadState=0,!1;this.getTexture(e,t,a,{noSmoothing:"$info"in h&&h.$settings.noSmoothing})}}else if(c.loadState>=2){if(this.drawing||this.drawStart(),c.texture){if(d){if(!m._video||!m._video.dataset.playing)return!1;this.micrio.webgl.updateTexture(c.texture,m._video)}this.micrio.webgl.drawTile(c.texture,n,u)}return 2===c.loadState&&(c.loadState=3,c.loadedAt=this.now),!0}return!1}drawStart(){this.drawing||(this.micrio.webgl.drawStart(),this.drawing=!0)}getTexture(t,e,i,r={}){if(this.tiles.get(t)?.texture||this.requests.has(t)||!r.force&&sl()>=Zc)return;const s=Mc.db.has(e);s||this.micrio.loading.set(!0),this.requests.set(t,e),(s?Mc.getImage(e):il(e)).then(e=>this.gotTexture(t,e,i,r.noSmoothing)).catch(()=>this.deleteRequest(t))}gotTexture(t,e,i,r){const s=this.getTileEntry(t);s.texture=this.micrio.webgl.getTexture(e,s.texture,r),null!=self.ImageBitmap&&e instanceof ImageBitmap&&e.close instanceof Function&&e.close(),s.loadState=2,s.timeoutId=setTimeout(()=>{this.deleteRequest(t)},i?150:50)}deleteRequest(t){this.requests.delete(t);const e=this.tiles.get(t);e?.timeoutId&&(clearTimeout(e.timeoutId),e.timeoutId=void 0),this.requests.size||this.micrio.loading.set(!1)}deleteTile(t){const e=this.tiles.get(t);e&&(e.texture&&this.micrio.webgl.gl.deleteTexture(e.texture),e.timeoutId&&clearTimeout(e.timeoutId),this.tiles.delete(t))}cleanup(){const t=performance.now();for(const e of this.prevDrawnSet){if(this.drawnSet.has(e))continue;if(this.baseTiles.includes(e))continue;const i=this.tiles.get(e);if(i&&0!==i.loadState)switch(i.opacity=0,i.loadState){case 1:const r=this.requests.get(e);r&&nl(r),i.loadState=0;break;case 2:this.requests.has(e)&&this.deleteRequest(e),this.deleteTile(e);break;case 3:i.deleteAt||(i.deleteAt=t)}}this.prevDrawnSet=new Set(this.drawnSet);for(const[e,i]of this.tiles.entries())i.deleteAt&&(t-i.deleteAt)/1e3>this.deleteAfterSeconds&&this.deleteTile(e)}resize(t){this.e.resize(this.i,t.width,t.height,t.left,t.top,t.ratio,t.scale,t.portrait),this.ready&&(this.stop(),this.draw())}addEmbed(t,e,i={}){if("camera"in t&&i.asImage)return this.addImage(t,e,!0,i.opacity??1);{const r="$info"in t?t.$info:e.$info;if(!r)return;this.images.push(t);const s=t.opts.area??[0,0,1,1],n=t instanceof $c?t.$settings._360??{}:{};t.ptr=this.e._addImage(e.ptr,s[0],s[1],s[2],s[3],r.width,r.height,r.tileSize||1024,r.isSingle??!1,r.isVideo??!1,i.opacity??1,n.rotX??0,n.rotY??0,n.rotZ??0,n.scale??1,i.fromScale??0),this.ptrToImage.set(t.ptr,t),t.baseTileIdx=this.e.getNumTiles(this.i)-1,this.getTileEntry(t.baseTileIdx).opacity=1,this.baseTiles.push(t.baseTileIdx)}}setActiveImage(t,e,i){this.e._setActiveImage(t,e,i??0)}setActiveLayer(t,e){this.e._setActiveLayer(t,e)}fadeImage(t,e,i=!1){this.cameras.has(t)?this.e._fadeTo(t,e,i):this.e._fadeImage(t,e,i),this.render()}setFocus(t,e,i=!1){this.e._setFocus(t,e[0],e[1],e[2],e[3],i)}setZIndex(t,e){this.e._setZIndex(t,e)}setGridTransitionDuration(t){this.e.setGridTransitionDuration(this.i,t)}setGridTransitionTimingFunction(t){this.e.setGridTransitionTimingFunction(this.i,t)}setCrossfadeDuration(t){this.e.setCrossfadeDuration(this.i,t)}fadeTo(t,e,i){this.e._fadeTo(t,e,i)}fadeIn(t){this.e._fadeIn(t)}fadeOut(t){this.e._fadeOut(t)}areaAnimating(t){return!!this.e._areaAnimating(t)}getActiveImageIdx(t){return this.e._getActiveImageIdx(t)}setNoPinchPan(t){this.e.setNoPinchPan(this.i,t)}setIsSwipe(t){this.e.setIsSwipe(this.i,t)}ease(t){return this.e.ease(t)}panStart(t){this.e._panStart(t)}panStop(t){this.e._panStop(t)}pinchStart(t){this.e._pinchStart(t)}pinch(t,e,i,r,s){this.e._pinch(t,e,i,r,s)}pinchStop(t,e){this.e._pinchStop(t,e)}setLimited(t,e){this.e._setLimited(t,e)}set360Orientation(t,e,i){this.e.set360Orientation(this.i,t,e,i)}setCanvasArea(t,e){this.e.setArea(this.i,t,e)}setImageVideoPlaying(t,e){this.e._setImageVideoPlaying(t,e)}setImageRotation(t,e,i,r){this.e._setImageRotation(t,e,i,r)}setOmniSettings(t,e,i,r,s){this.e._setOmniSettings(t,e,i,r,s)}},hl=new Float32Array([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]),dl=class{constructor(t,e,i){if(this.gl=t,this.program=t.createProgram(),e.webgl.getShader(this.program,t.VERTEX_SHADER,"\nattribute vec2 a_position; // Vertex position (-1 to 1)\nattribute vec2 a_texCoord; // Texture coordinate (0 to 1)\n\nvarying vec2 v_texCoord; // Pass texCoord to fragment shader\n\nvoid main() {\n\tv_texCoord = a_texCoord; // Pass through texture coordinate\n\tgl_Position = vec4(a_position, 0.0, 1.0); // Set clip space position\n}"),e.webgl.getShader(this.program,t.FRAGMENT_SHADER,i),t.linkProgram(this.program),t.getProgramParameter(this.program,t.LINK_STATUS)||console.error("Postprocess shader link error:",t.getProgramInfoLog(this.program)),t.useProgram(this.program),this.ppPositionLoc=t.getAttribLocation(this.program,"a_position"),this.ppTexCoordLoc=t.getAttribLocation(this.program,"a_texCoord"),this.ppTimeLoc=t.getUniformLocation(this.program,"u_time"),this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.frameBuffer=t.createFramebuffer(),t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture,0),t.checkFramebufferStatus(t.FRAMEBUFFER)!==t.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer not complete");t.bindFramebuffer(t.FRAMEBUFFER,null),this.quad=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.quad),t.bufferData(t.ARRAY_BUFFER,hl,t.STATIC_DRAW)}render(){const t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,null),t.useProgram(this.program),t.bindBuffer(t.ARRAY_BUFFER,this.quad),t.enableVertexAttribArray(this.ppPositionLoc),t.vertexAttribPointer(this.ppPositionLoc,2,t.FLOAT,!1,4*Float32Array.BYTES_PER_ELEMENT,0),t.enableVertexAttribArray(this.ppTexCoordLoc),t.vertexAttribPointer(this.ppTexCoordLoc,2,t.FLOAT,!1,4*Float32Array.BYTES_PER_ELEMENT,2*Float32Array.BYTES_PER_ELEMENT),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,this.texture),t.uniform1f(this.ppTimeLoc,performance.now()/1e3),t.drawArrays(t.TRIANGLE_STRIP,0,4)}resize(){const t=this.gl;t.bindTexture(t.TEXTURE_2D,this.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,0,t.RGBA,t.UNSIGNED_BYTE,null),t.bindTexture(t.TEXTURE_2D,null)}dispose(){const t=this.gl;t.deleteFramebuffer(this.frameBuffer),t.deleteTexture(this.texture),t.deleteBuffer(this.quad),t.deleteProgram(this.program)}},ul=Js.firefox,ml=`\nprecision mediump float; // Use medium precision for fragment calculations\n\nvarying highp vec2 vTextureCoord; // Received texture coordinate from vertex shader\n\nuniform sampler2D uSampler; // The tile texture\nuniform float opacity; // Tile opacity (for fading)\nuniform int noTexture; // Flag indicating if texture is missing/not loaded\n\nvoid main() {\n\tif(noTexture==1) { // If texture is missing\n\t\tgl_FragColor = vec4(.1,.1,.1,.1); // Draw a placeholder color (dark semi-transparent gray)\n\t} else {\n\t${ul?"\n\t\t// Firefox premultiplied alpha workaround\n\t\tvec4 textureColor = texture2D(uSampler, vTextureCoord);\n\t\t// Manually apply opacity to RGB based on new alpha\n\t\tfloat newAlpha = min(1., textureColor.a * opacity);\n\t\tgl_FragColor = vec4(textureColor.rgb * newAlpha, newAlpha);":"\n\t\t// Standard alpha blending (premultiplied alpha assumed in blendFunc)\n\t\tgl_FragColor = texture2D(uSampler, vTextureCoord) * opacity;"}\n\t\t// Debug: Draw red instead of texture\n\t\t//gl_FragColor = vec4(1.,0.,0.,1.);\n\t}\n}`,fl=256,pl=class{constructor(t){this.micrio=t,this.display=self,this.txtAttr=-1,this.wmTexture=null,this.wmUrl=null,this.wmVerts=new Float32Array([-1,-1,0,1,-1,0,-1,1,0,-1,1,0,1,-1,0,1,1,0]),this.wmUvs=new Float32Array([0,0,0,0,0,0,0,0,0,0,0,0]),this.wmMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.wmOpacity=.075,this.posAttr=-1,this.was360=!1}init(){const t="WebGL2RenderingContext"in window,e=this.micrio.canvas.element.getContext(t?"webgl2":"webgl",{alpha:!0,preserveDrawingBuffer:this.micrio.hasAttribute("data-preserve-drawing-buffer"),stencil:!1,antialias:!1,depth:!1,desynchronized:!1});if(t?!(e instanceof window.WebGL2RenderingContext):!(e instanceof window.WebGLRenderingContext))throw new Bs("WebGL context creation failed",{code:Ms,displayMessage:"Your browser does not support WebGL, which is required to view this content. Please try a different browser."});this.gl=e;const i=this.micrio.$current?.$settings.postProcessingFragmentShader;i&&(this.postpocessor=new dl(e,this.micrio,i),this.micrio.keepRendering=!0);const r=e.createProgram();if(!(r instanceof WebGLProgram))throw new Bs("Failed to create WebGL program",{code:$s,displayMessage:"There was a problem initializing the graphics. Please try refreshing the page."});this.program=r,this.getShader(this.program,e.VERTEX_SHADER,"\nuniform mat4 GLMatrix; // Combined ModelViewProjection matrix from Wasm\n\nattribute vec3 pos; // Vertex position (from Wasm buffer)\nattribute vec2 aTextureCoord; // Texture coordinate (from static buffer)\n\nvarying highp vec2 vTextureCoord; // Pass texture coordinate to fragment shader\n\nvoid main()\n{\n\tgl_Position = GLMatrix * vec4(pos, 1.0); // Calculate clip space position\n\tvTextureCoord = aTextureCoord; // Pass through texture coordinate\n}"),this.getShader(this.program,e.FRAGMENT_SHADER,ml),e.linkProgram(this.program),e.getProgramParameter(this.program,e.LINK_STATUS)||console.error("Main shader link error:",e.getProgramInfoLog(this.program)),e.useProgram(this.program),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.enable(e.BLEND),e.disable(e.DEPTH_TEST),e.clearColor(0,0,0,0);const s=e.getUniformLocation(this.program,"opacity");if(!s)throw new Bs("Failed to bind WebGL opacity uniform",{code:$s});this.opaLoc=s;const n=e.getUniformLocation(this.program,"GLMatrix");if(!n)throw new Bs("Failed to bind WebGL matrix uniform",{code:$s});this.pmLoc=n;const a=e.getUniformLocation(this.program,"noTexture");if(!a)throw new Bs("Failed to bind WebGL texture uniform",{code:$s});this.noTxtLoc=a,this.txtAttr=e.getAttribLocation(this.program,"aTextureCoord");const o=e.createBuffer();if(!o)throw new Bs("Failed to create WebGL texture buffer",{code:Ps,displayMessage:"Your device is low on memory. Try closing other browser tabs or applications."});this.txtBuffer=o,e.bindBuffer(e.ARRAY_BUFFER,this.txtBuffer),e.bufferData(e.ARRAY_BUFFER,ll._textureBuffer,e.STATIC_DRAW);const c=e.createBuffer();if(!c)throw new Bs("Failed to create WebGL watermark buffer",{code:Ps,displayMessage:"Your device is low on memory. Try closing other browser tabs or applications."});this.wmTxtBuffer=c;const l=e.createBuffer();if(!l)throw new Bs("Failed to create WebGL geometry buffer",{code:Ps,displayMessage:"Your device is low on memory. Try closing other browser tabs or applications."});this.geomBuffer=l,this.posAttr=e.getAttribLocation(this.program,"pos"),this.linkBuffers(),e.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}linkBuffers(){const t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,this.geomBuffer),t.bufferData(t.ARRAY_BUFFER,this.micrio.wasm._vertexBuffer,t.DYNAMIC_DRAW),t.enableVertexAttribArray(this.txtAttr),t.bindBuffer(t.ARRAY_BUFFER,this.txtBuffer),t.vertexAttribPointer(this.txtAttr,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(this.posAttr),t.bindBuffer(t.ARRAY_BUFFER,this.geomBuffer),t.vertexAttribPointer(this.posAttr,3,t.FLOAT,!1,0,0)}dispose(t=!1){const e=this.gl;if(e){if(e.bindBuffer(e.ARRAY_BUFFER,null),e.bindTexture(e.TEXTURE_2D,null),e.deleteBuffer(this.txtBuffer),e.deleteBuffer(this.geomBuffer),e.deleteBuffer(this.wmTxtBuffer),e.deleteProgram(this.program),this.postpocessor?.dispose(),this.wmTexture&&e.deleteTexture(this.wmTexture),t){const t=e.getExtension("WEBGL_lose_context");t instanceof Object&&t.loseContext instanceof Function&&t.loseContext()}this.gl=null}}getShader(t,e,i){const r=this.gl.createShader(e);if(!r)throw new Error(`Could not create WebGL shader (type: ${e})`);if(this.gl.shaderSource(r,i),this.gl.compileShader(r),!this.gl.getShaderParameter(r,this.gl.COMPILE_STATUS))throw console.error("Error compiling shader",this.gl.getShaderInfoLog(r)),this.gl.deleteProgram(t),new Error(`Shader compilation failed: ${this.gl.getShaderInfoLog(r)}`);this.gl.attachShader(t,r),this.gl.deleteShader(r)}getTexture(t,e,i){const r=this.gl,s=e??r.createTexture();if(!s)throw new Error("Could not create WebGL texture");return r.bindTexture(r.TEXTURE_2D,s),t&&r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,i?r.NEAREST:r.LINEAR),s}updateTexture(t,e){const i=this.gl;i.bindTexture(i.TEXTURE_2D,t),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e),i.bindTexture(i.TEXTURE_2D,null)}drawStart(){const t=this.gl;this.postpocessor&&t.bindFramebuffer(t.FRAMEBUFFER,this.postpocessor.frameBuffer),this.gl.clear(this.gl.COLOR_BUFFER_BIT)}drawEnd(){this.postpocessor&&(this.postpocessor.render(),this.gl.useProgram(this.program),this.linkBuffers()),this.wmTexture&&this.drawWatermark()}drawTile(t,e=1,i=!1){this.gl.uniform1i(this.noTxtLoc,t?0:1),this.gl.uniform1f(this.opaLoc,e),t&&(this.gl.activeTexture(this.gl.TEXTURE0),this.gl.bindTexture(this.gl.TEXTURE_2D,t));const r=i?6*ll.segsX*ll.segsY:6;i!=this.was360&&(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.txtBuffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,i?ll._textureBuffer360:ll._textureBuffer,this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.geomBuffer),this.was360=i),this.gl.bufferData(this.gl.ARRAY_BUFFER,i?this.micrio.wasm._vertexBuffer360:this.micrio.wasm._vertexBuffer,this.gl.STATIC_DRAW),this.gl.drawArrays(this.gl.TRIANGLES,0,r)}loadWatermark(t,e){if(t===this.wmUrl)return;this.wmUrl=t;const i=new Image;e&&(this.wmOpacity=e),i.crossOrigin="anonymous",i.src=t,i.onload=()=>{const t=document.createElement("canvas");t.width=fl,t.height=fl;const e=t.getContext("2d");if(!e)return;const r=Math.min(96/i.width,64/i.height),s=i.width*r,n=i.height*r;e.drawImage(i,(fl-s)/2,(fl-n)/2,s,n),this.wmTexture&&this.gl.deleteTexture(this.wmTexture),this.wmTexture=this.getTexture(t);const a=this.gl;a.bindTexture(a.TEXTURE_2D,this.wmTexture),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.REPEAT),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.REPEAT),a.bindTexture(a.TEXTURE_2D,null),this.micrio.wasm.render()}}drawWatermark(){const t=this.gl;if(!this.wmTexture)return;t.useProgram(this.program),t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA),t.uniformMatrix4fv(this.pmLoc,!1,this.wmMatrix),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,this.wmTexture),t.uniform1i(this.noTxtLoc,0),t.uniform1f(this.opaLoc,this.wmOpacity);const e=t.drawingBufferWidth/fl,i=t.drawingBufferHeight/fl,r=this.wmUvs;r[1]=i,r[2]=e,r[3]=i,r[8]=e,r[9]=i,r[10]=e,t.bindBuffer(t.ARRAY_BUFFER,this.geomBuffer),t.bufferData(t.ARRAY_BUFFER,this.wmVerts,t.DYNAMIC_DRAW),t.vertexAttribPointer(this.posAttr,3,t.FLOAT,!1,0,0),t.bindBuffer(t.ARRAY_BUFFER,this.wmTxtBuffer),t.bufferData(t.ARRAY_BUFFER,this.wmUvs,t.DYNAMIC_DRAW),t.vertexAttribPointer(this.txtAttr,2,t.FLOAT,!1,0,0),t.drawArrays(t.TRIANGLES,0,6),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),this.linkBuffers(),this.was360=!1}},gl=class{get $isMobile(){return wt(this.isMobile)}constructor(t){this.micrio=t,this.element=document.createElement("canvas"),this.resizing=!1,this.hasPerspective=!1,this.viewport={width:0,height:0,left:0,top:0,ratio:0,scale:0,portrait:!1},this.isMobile=vt(!1),this.getRatio=(t=this.micrio.$current?.$settings??{})=>!Js.iOS&&!t?.noRetina&&self.devicePixelRatio&&Math.max(1,Math.min(2,self.devicePixelRatio))||1,this.onresize=this.onresize.bind(this),self.ResizeObserver&&(this.resizeObserver=new self.ResizeObserver(this.onresize)),this.element.className="micrio"}place(){if(this.element.parentNode)return;const t=this.micrio.querySelector("img.preview");this.micrio.insertBefore(this.element,t?t.nextSibling:this.micrio.firstChild)}hook(){this.onresize(),this.resizeObserver?this.resizeObserver.observe(this.element):window.addEventListener("resize",this.onresize)}unhook(){this.resizeObserver?this.resizeObserver.unobserve(this.element):window.removeEventListener("resize",this.onresize)}onresize(){const t=this.element.getBoundingClientRect();this.micrio.$current?.is360&&(this.hasPerspective=!0);let e=t.width,i=t.height;if(!e||!i)return;const r=self.getComputedStyle(this.element),s=parseFloat(r.width);isNaN(s)||(i=parseFloat(r.height)*e/Math.max(1,s));const n=this.micrio.hasAttribute("data-static")?1:Math.floor(e)/this.micrio.offsetWidth;e/=n,i/=n;const a=1!=n?1:this.getRatio(),o=this.viewport;o.width==e&&o.height==i&&o.ratio==a&&o.scale==n||(this.hasPerspective&&(this.micrio.style.perspective=i/2+"px"),o.width=e,o.height=i,o.ratio=a,o.scale=n,o.top=t.top,o.left=t.left,o.portrait=window.matchMedia("(orientation: portrait)")?.matches??i>e,this.resizing=!0,this.element.width=e*a,this.element.height=i*a,this.micrio.webgl.gl.viewport(0,0,o.width*o.ratio,o.height*o.ratio),this.micrio.webgl.postpocessor?.resize(),this.micrio.wasm.resize(o),this.resizing=!1,this.micrio.events.dispatch("resize",t),this.isMobile.set(/mobile/i.test(navigator.userAgent)))}setMargins(t,e){this.micrio.wasm.ready&&this.micrio.wasm.setCanvasArea(t,e)}},vl=["move","marker-open","marker-opened","marker-closed","tour-start","tour-step","tour-stop","tour-event","media-play","media-pause","splitscreen-start","splitscreen-stop"],wl=class{constructor(t){this.ctx=t,this.handleEvent=this.handleEvent.bind(this),this.dispatch=this.dispatch.bind(this)}hook(){vl.forEach(t=>this.ctx.micrio.addEventListener(t,this.handleEvent))}unhook(){vl.forEach(t=>this.ctx.micrio.removeEventListener(t,this.handleEvent))}handleEvent(t){if("move"==t.type&&!this.ctx.isPanning()&&!this.ctx.isPinching()&&!this.ctx.isWheeling())return;const e=this.ctx.vars.updates.stack;e[e.length-1]!=t.type&&e.push(t.type),clearTimeout(this.ctx.vars.updates.to),this.ctx.vars.updates.to<0&&(this.ctx.vars.updates.to=setTimeout(this.dispatch))}dispatch(){const t=this.ctx.vars.updates;clearTimeout(t.to),t.to=-1,t.stack.length&&(this.ctx.dispatch("update",t.stack),t.stack.length=0,t.to=setTimeout(this.dispatch,500))}},bl=class{get $enabled(){return wt(this.enabled)}constructor(t){this.micrio=t,this.enabled=vt(!1),this.hooked=!1,this.panning=!1,this.pinching=!1,this.clicked=!1,this.wheeling=!1,this.controlZoom=!1,this.twoFingerPan=!1,this.pScale=1,this.hasTouch=Js.hasTouch&&"ontouchstart"in self,this.hasUsedCtrl=!1,this.vars={drag:{prev:void 0,start:[0,0,0]},dbltap:{lastTapped:0},pinch:{image:void 0,sDst:0,wasPanning:!1},updates:{to:-1,stack:[]}},this.activePointers=new Map,this.el=t.canvas.element,this.dragHandler=new xl(this),this.pinchHandler=new El(this,this.dragHandler),this.pointerPinchHandler=new Sl(this,this.dragHandler),this.gestureHandler=new Al(this),this.wheelHandler=new Ml(this),this.keyboardHandler=new Il(this),this.doubleTapHandler=new $l(this),this.updateHandler=new wl(this),this.enabled.subscribe(t=>{t?this.hook():this.unhook()}),t.visible.subscribe(t=>this.visible=t),t.current.subscribe(t=>{t&&!this.settings&&en(t.info).then(e=>{e&&(this.settings=t.$settings,!t.error&&this.settings.hookEvents&&this.enabled.set(!0))})})}isEnabled(){return this.$enabled}isPanning(){return this.panning}isPinching(){return this.pinching}setPanning(t){this.panning=t}setPinching(t){this.pinching=t}isWheeling(){return this.wheeling}setWheeling(t){this.wheeling=t}isControlZoom(){return this.controlZoom}isTwoFingerPan(){return this.twoFingerPan}getVisible(){return this.visible}setCapturedPointerId(t){this.capturedPointerId=t}setPinchFactor(t){this.pinchFactor=t}setPScale(t){this.pScale=t}setHasUsedCtrl(t){this.hasUsedCtrl=t}get isNavigating(){return this.panning||this.pinching||this.wheeling||this.clicked}dispatch(t,e){this.micrio.dispatchEvent(new CustomEvent(t,void 0!==e?{detail:e}:void 0))}getImage(t){if(!this.visible)return;const e=this.micrio.offsetWidth,i=this.micrio.offsetHeight,r=Math.max(0,Math.min(1,t.x/e)),s=Math.max(0,Math.min(1,t.y/i)),n=this.visible?.find(t=>!!t.opts.secondaryTo),a=this.visible.filter(t=>!t.noImage),o=1==a.length?a[0]:a.find(({grid:t,opts:{area:e}})=>(!n||!t)&&(!!e&&(r>=e[0]&&r<=e[2]&&s>=e[1]&&s<=e[3])));return o&&o.opts.secondaryTo&&o.opts.isPassive&&o.opts.area&&(t.x-=o.opts.area[0]*e,t.y-=o.opts.area[1]*i),!o||o.grid||o.opts.secondaryTo&&o.opts.isPassive?this.micrio.$current:o}hook(){if(this.hooked)return;this.hooked=!0;const t=this.settings;t&&(this.twoFingerPan=!!t.twoFingerPan,this.twoFingerPan?this.micrio.setAttribute("data-can-pan",""):this.micrio.removeAttribute("data-can-pan"),t?.hookKeys&&this.hookKeys(),t.hookDrag&&this.hookDrag(),t.noZoom||this.hookZoom(),this.hookUpdate())}unhook(){this.hooked&&(this.hooked=!1,this.activePointers.clear(),this.unhookDrag(),this.unhookZoom(),this.unhookKeys(),this.unhookUpdate())}hookKeys(){this.keyboardHandler.hook()}unhookKeys(){this.keyboardHandler.unhook()}hookZoom(){const t=this.settings;this.controlZoom=!!t?.controlZoom,t&&!t.hookPinch||this.hookPinch(),(!t||t.hookScroll||this.controlZoom)&&this.hookScroll(),this.micrio.canvas.$isMobile?this.doubleTapHandler.hookTap():this.doubleTapHandler.hookClick()}unhookZoom(){this.unhookPinch(),this.unhookScroll(),this.micrio.canvas.$isMobile?this.doubleTapHandler.unhookTap():this.doubleTapHandler.unhookClick()}get scrollHooked(){return this.wheelHandler.hooked}hookScroll(){this.wheelHandler.hook()}unhookScroll(){this.wheelHandler.unhook()}hookPinch(){Js.iOS&&this.hasTouch?this.pinchHandler.hook():this.pointerPinchHandler.hook(),this.gestureHandler.hook()}unhookPinch(){Js.iOS&&this.hasTouch?this.pinchHandler.unhook():this.pointerPinchHandler.unhook(),this.gestureHandler.unhook()}hookDrag(){this.dragHandler.hook()}unhookDrag(){this.dragHandler.unhook()}hookUpdate(){this.updateHandler.hook()}unhookUpdate(){this.updateHandler.unhook()}},yl={passive:!0},kl={passive:!0,capture:!0},Tl={passive:!1};function _l(t){t.stopPropagation(),t.preventDefault()}var xl=class{constructor(t){this.ctx=t,this.hooked=!1,this.start=this.start.bind(this),this.move=this.move.bind(this),this.stop=this.stop.bind(this),this.cancel=this.cancel.bind(this)}hook(){this.hooked||(this.hooked=!0,this.ctx.micrio.addEventListener("dragstart",_l),this.ctx.micrio.addEventListener("pointerdown",this.start,yl),self.addEventListener("pointercancel",this.cancel,yl),this.ctx.micrio.setAttribute("data-hooked",""))}unhook(){this.hooked&&(this.hooked=!1,this.ctx.micrio.removeEventListener("pointerdown",this.start,yl),this.ctx.micrio.removeEventListener("dragstart",_l),self.removeEventListener("pointercancel",this.cancel,yl),this.ctx.micrio.removeAttribute("data-hooked"))}start(t,e=!1){if(0!=t.button||"touch"==t.pointerType&&this.ctx.isTwoFingerPan())return;if(!(e||t.target==this.ctx.el||t.target instanceof Element&&t.target.closest("[data-scroll-through]")))return;if(this.ctx.micrio.$current?.isOmni&&t.shiftKey)return;if(this.ctx.isPinching())return;if(this.ctx.isPanning())return void(t instanceof TouchEvent&&t.touches.length>1&&this.stop());const i=this.ctx.getImage({x:t.clientX,y:t.clientY});i&&(this.ctx.setPanning(!0),this.ctx.vars.drag.start=[t.clientX,t.clientY,performance.now()],this.ctx.micrio.addEventListener("pointermove",this.move,yl),this.ctx.micrio.addEventListener("pointerup",this.stop,yl),this.ctx.micrio.setAttribute("data-panning",""),this.ctx.micrio.wasm.panStart(i.ptr),this.ctx.micrio.wasm.render(),this.ctx.dispatch("panstart"))}move(t){const e=t.clientX,i=t.clientY,r=Math.hypot(this.ctx.vars.drag.start[0]-t.clientX,this.ctx.vars.drag.start[1]-t.clientY);!this.ctx.capturedPointerId&&r>10&&(this.ctx.setCapturedPointerId(t.pointerId),this.ctx.micrio.setPointerCapture(t.pointerId)),this.ctx.vars.drag.prev&&this.ctx.getImage({x:e,y:i})?.camera.pan(this.ctx.vars.drag.prev[0]-e,this.ctx.vars.drag.prev[1]-i),this.ctx.vars.drag.prev=[e,i]}stop(t,e=!1,i=!1){if(this.ctx.isPanning()){if(this.ctx.setPanning(!1),this.ctx.vars.drag.prev=void 0,this.ctx.micrio.removeEventListener("pointermove",this.move,yl),this.ctx.micrio.removeEventListener("pointerup",this.stop,yl),this.ctx.capturedPointerId&&this.ctx.micrio.releasePointerCapture(this.ctx.capturedPointerId),this.ctx.setCapturedPointerId(void 0),this.ctx.micrio.removeAttribute("data-panning"),t&&0==e){const e=this.ctx.getImage({x:t.clientX,y:t.clientY});e&&(this.ctx.micrio.wasm.panStop(e.ptr),this.ctx.micrio.wasm.render())}i||this.ctx.dispatch("panend",t?{duration:performance.now()-this.ctx.vars.drag.start[2],movedX:t.clientX-this.ctx.vars.drag.start[0],movedY:t.clientY-this.ctx.vars.drag.start[1]}:void 0)}}cancel(t){this.ctx.isPanning()&&(void 0!==this.ctx.capturedPointerId&&t.pointerId!==this.ctx.capturedPointerId||this.stop(void 0,!0,!0))}},El=class{constructor(t,e){this.ctx=t,this.dragHandler=e,this.start=this.start.bind(this),this.move=this.move.bind(this),this.stop=this.stop.bind(this)}hook(){Js.iOS&&this.ctx.hasTouch&&this.ctx.micrio.addEventListener("touchstart",this.start,yl)}unhook(){Js.iOS&&this.ctx.hasTouch&&this.ctx.micrio.removeEventListener("touchstart",this.start,yl),self.removeEventListener("touchmove",this.move,kl),self.removeEventListener("touchend",this.stop,kl)}start(t){if(!(Js.hasTouch&&t instanceof TouchEvent))return;if(this.ctx.isTwoFingerPan()&&t.touches.length<2)return;if(this.ctx.isPinching()||2!=t.touches.length)return void this.stop(t);t.stopPropagation(),this.ctx.vars.pinch.wasPanning=this.ctx.isPanning(),this.dragHandler.stop(void 0,!1,!0);const e=t.touches;this.ctx.setPinching(!0),self.addEventListener("touchmove",this.move,kl),self.addEventListener("touchend",this.stop,kl),this.ctx.micrio.setAttribute("data-pinching",""),this.ctx.vars.pinch.image=this.ctx.getImage({x:e[0].clientX,y:e[0].clientY}),this.ctx.vars.pinch.sDst=Math.hypot(e[0].clientX-e[1].clientX,e[0].clientY-e[1].clientY),this.ctx.setPinchFactor(void 0),this.ctx.vars.pinch.image&&this.ctx.micrio.wasm.pinchStart(this.ctx.vars.pinch.image.ptr),this.ctx.micrio.wasm.render(),this.ctx.dispatch("pinchstart"),this.ctx.isTwoFingerPan()&&this.ctx.dispatch("panstart")}move(t){if(!(Js.hasTouch&&t instanceof TouchEvent))return;const e=t.touches;if(e?.length<2)return;const i={x:e[0].clientX,y:e[0].clientY},r={x:e[1].clientX,y:e[1].clientY},s=this.ctx.vars.pinch,n=s.image;if(n){if(n?.opts.secondaryTo&&n.opts.isPassive&&n.opts.area){const t=n.opts.area[0]*this.ctx.micrio.offsetWidth,e=n.opts.area[1]*this.ctx.micrio.offsetHeight;i.x-=t,r.x-=t,i.y-=e,r.y-=e}this.ctx.setPinchFactor(Math.hypot(e[0].clientX-e[1].clientX,e[0].clientY-e[1].clientY)/s.sDst),this.ctx.micrio.wasm.pinch(n.ptr,i.x,i.y,r.x,r.y)}}stop(t){if(!this.ctx.isPinching())return;this.ctx.setPinching(!1),self.removeEventListener("touchmove",this.move,kl),self.removeEventListener("touchend",this.stop,kl),this.ctx.micrio.removeAttribute("data-pinching");const e=this.ctx.vars.pinch.image;e&&(this.ctx.micrio.wasm.pinchStop(e.ptr,performance.now()),this.ctx.micrio.wasm.render()),this.ctx.vars.pinch.image=void 0,this.ctx.setPinchFactor(void 0),this.ctx.dispatch("pinchend"),this.ctx.isTwoFingerPan()&&!this.ctx.vars.pinch.wasPanning&&this.ctx.dispatch("panend"),t instanceof TouchEvent&&1==t.touches.length&&this.dragHandler.start(t,!0)}},Sl=class{constructor(t,e){this.ctx=t,this.dragHandler=e,this.start=this.start.bind(this),this.move=this.move.bind(this),this.end=this.end.bind(this)}hook(){this.ctx.micrio.addEventListener("pointerdown",this.start,yl),self.addEventListener("pointerup",this.end,yl),self.addEventListener("pointercancel",this.end,yl)}unhook(){this.ctx.micrio.removeEventListener("pointerdown",this.start,yl),self.removeEventListener("pointerup",this.end,yl),self.removeEventListener("pointercancel",this.end,yl),self.removeEventListener("pointermove",this.move,kl),this.ctx.activePointers.clear()}start(t){if("touch"===t.pointerType&&(this.ctx.activePointers.set(t.pointerId,{x:t.clientX,y:t.clientY}),2===this.ctx.activePointers.size&&!this.ctx.isPinching())){this.ctx.vars.pinch.wasPanning=this.ctx.isPanning(),this.dragHandler.stop(void 0,!1,!0),this.ctx.setPinching(!0),self.addEventListener("pointermove",this.move,kl),this.ctx.micrio.setAttribute("data-pinching","");const t=Array.from(this.ctx.activePointers.values()),e=t[0],i=t[1];this.ctx.vars.pinch.image=this.ctx.getImage({x:e.x,y:e.y}),this.ctx.vars.pinch.sDst=Math.hypot(e.x-i.x,e.y-i.y),this.ctx.setPinchFactor(void 0),this.ctx.vars.pinch.image&&this.ctx.micrio.wasm.pinchStart(this.ctx.vars.pinch.image.ptr),this.ctx.micrio.wasm.render(),this.ctx.dispatch("pinchstart"),this.ctx.isTwoFingerPan()&&this.ctx.dispatch("panstart")}}move(t){if("touch"!==t.pointerType)return;if(!this.ctx.activePointers.has(t.pointerId))return;if(this.ctx.activePointers.set(t.pointerId,{x:t.clientX,y:t.clientY}),!this.ctx.isPinching()||2!==this.ctx.activePointers.size)return;const e=Array.from(this.ctx.activePointers.values()),i=e[0],r=e[1],s=this.ctx.vars.pinch,n=s.image;if(!n)return;const a={x:i.x,y:i.y},o={x:r.x,y:r.y};if(n?.opts.secondaryTo&&n.opts.isPassive&&n.opts.area){const t=n.opts.area[0]*this.ctx.micrio.offsetWidth,e=n.opts.area[1]*this.ctx.micrio.offsetHeight;a.x-=t,o.x-=t,a.y-=e,o.y-=e}this.ctx.setPinchFactor(Math.hypot(i.x-r.x,i.y-r.y)/s.sDst),this.ctx.micrio.wasm.pinch(n.ptr,a.x,a.y,o.x,o.y)}end(t){if("touch"===t.pointerType&&(this.ctx.activePointers.delete(t.pointerId),this.ctx.isPinching()&&this.ctx.activePointers.size<2)){this.ctx.setPinching(!1),self.removeEventListener("pointermove",this.move,kl),this.ctx.micrio.removeAttribute("data-pinching");const t=this.ctx.vars.pinch.image;if(t&&(this.ctx.micrio.wasm.pinchStop(t.ptr,performance.now()),this.ctx.micrio.wasm.render()),this.ctx.vars.pinch.image=void 0,this.ctx.setPinchFactor(void 0),this.ctx.dispatch("pinchend"),this.ctx.isTwoFingerPan()&&!this.ctx.vars.pinch.wasPanning&&this.ctx.dispatch("panend"),1===this.ctx.activePointers.size){const t=Array.from(this.ctx.activePointers.entries())[0],e={button:0,pointerType:"touch",target:this.ctx.el,clientX:t[1].x,clientY:t[1].y,pointerId:t[0]};this.dragHandler.start(e,!0)}}}},Al=class{constructor(t){this.ctx=t,this.handle=this.handle.bind(this)}hook(){Js.OSX&&(this.ctx.micrio.addEventListener("gesturestart",this.handle,Tl),this.ctx.micrio.addEventListener("gesturechange",this.handle,Tl),this.ctx.micrio.addEventListener("gestureend",this.handle,Tl))}unhook(){Js.OSX&&(this.ctx.micrio.removeEventListener("gesturestart",this.handle,Tl),this.ctx.micrio.removeEventListener("gesturechange",this.handle,Tl),this.ctx.micrio.removeEventListener("gestureend",this.handle,Tl))}getGestureEvent(t){if("scale"in t&&"number"==typeof t.scale){const e=t;return{scale:e.scale,clientX:e.clientX,clientY:e.clientY}}return null}handle(t){const e=this.getGestureEvent(t);if(!e||1===e.scale)return;const i=this.ctx.pScale-e.scale;this.ctx.setPScale(e.scale),t.stopPropagation(),t.preventDefault(),"gesturechange"==t.type&&this.ctx.getImage({x:e.clientX,y:e.clientY})?.camera.zoom(i*this.ctx.micrio.canvas.viewport.height,0,e.clientX,e.clientY)}},Ml=class{constructor(t){this.ctx=t,this.hooked=!1,this.wheelEndTo=-1,this.handle=this.handle.bind(this),this.end=this.end.bind(this)}hook(){this.hooked||(this.ctx.micrio.addEventListener("wheel",this.handle,Tl),this.hooked=!0)}unhook(){this.ctx.micrio.removeEventListener("wheel",this.handle,Tl),this.hooked=!1}handle(t,e=!1,i=0){if(!(t instanceof WheelEvent))return;if(this.ctx.isControlZoom()&&!t.ctrlKey)return;if(!e&&t.target instanceof Element&&t.target!=this.ctx.el&&!t.target.classList.contains("marker")&&!t.target.closest("[data-scroll-through]"))return;let r=t.deltaY;t.ctrlKey&&this.ctx.setHasUsedCtrl(!0);const s=this.ctx.isControlZoom()&&10*r%1==0,n=this.ctx.hasUsedCtrl&&!s,a=Js.firefox||t.ctrlKey||!n;if(this.ctx.isTwoFingerPan()&&this.ctx.micrio.$current?.camera.isZoomedOut())return;t.stopPropagation(),t.preventDefault(),(Js.OSX||n)&&t.ctrlKey&&(r*=10);const o={x:t.clientX,y:t.clientY},c=this.ctx.getImage(o);if(c){if(a){const t=this.ctx.micrio.canvas.viewport;let e=0;const s=this.ctx.micrio.getBoundingClientRect();c.camera.zoom(1*r/Math.sqrt(t.scale),0,o.x-i-s.left,o.y-s.top-e)}else c.camera.pan(t.deltaX,t.deltaY);this.ctx.setWheeling(!0),clearTimeout(this.wheelEndTo),this.wheelEndTo=setTimeout(this.end,50)}}end(){this.ctx.setWheeling(!1)}},Il=class{constructor(t){this.ctx=t,this.handle=this.handle.bind(this)}hook(){document.addEventListener("keydown",this.handle)}unhook(){document.removeEventListener("keydown",this.handle)}handle(t){if(this.ctx.isPanning()||this.ctx.isPinching()||!this.ctx.micrio.$current?.camera)return;const e=this.ctx.micrio.$current.camera,i=this.ctx.micrio.offsetWidth/2,r=this.ctx.micrio.offsetHeight/2;let s=0,n=0;switch(t.key){case"ArrowUp":n-=r;break;case"ArrowDown":n+=r;break;case"ArrowLeft":s-=i;break;case"ArrowRight":s+=i;break;case"+":case"=":e.zoom(-200,150).catch(()=>{});break;case"-":case"_":e.zoom(200,150).catch(()=>{});break;default:return}t.preventDefault(),t.stopPropagation(),0==s&&0==n||e.pan(s,n,150)}},$l=class{constructor(t){this.ctx=t,this.tap=this.tap.bind(this),this.click=this.click.bind(this)}hookTap(){this.ctx.el.addEventListener("touchstart",this.tap)}unhookTap(){this.ctx.el.removeEventListener("touchstart",this.tap)}hookClick(){this.ctx.el.addEventListener("dblclick",this.click)}unhookClick(){this.ctx.el.removeEventListener("dblclick",this.click)}tap(t){if(!(Js.hasTouch&&t instanceof TouchEvent))return;const e=performance.now();1==t.touches.length&&e-this.ctx.vars.dbltap.lastTapped<250&&(t.stopPropagation(),t.preventDefault(),this.click(t)),this.ctx.vars.dbltap.lastTapped=e}click(t){const e=t instanceof TouchEvent?t.touches[0]:t;this.ctx.getImage({x:e.clientX,y:e.clientY})?.camera.zoom(-300,500,e.clientX,e.clientY,1,!this.ctx.micrio.$current?.album).catch(()=>{})}},Pl=class t{static{this.events=["load","tour-start","tour-stop","marker-open","marker-closed","page-open","page-closed","lang-switch"]}constructor(t){this.micrio=t,this.isStatic=!1,this.loaded=!1,this.inited=!1,this.setting=!1,this.writeTitle=!1}hook(){this.isStatic="static"==this.micrio.getAttribute("data-router"),this.read=this.read.bind(this),this.write=this.write.bind(this),this.writeDeferred=this.writeDeferred.bind(this),en(this.micrio.current).then(()=>{this.loaded=!0,this.read()}),t.events.forEach(t=>this.micrio.addEventListener(t,this.write)),"i.micr.io"==location.hostname&&(this.writeTitle=!0),window.addEventListener(this.isStatic?"popstate":"hashchange",this.read)}unhook(){t.events.forEach(t=>this.micrio.removeEventListener(t,this.write)),window.removeEventListener(this.isStatic?"popstate":"hashchange",this.read)}findPage(t,e,i){if(e)for(let r=0;r<e.length;r++){let s=js((e[r]?.i18n?.[i]??e[r]).title)==t?e[r]:this.findPage(t,e[r].children,i);if(s)return s}}read(){if(!this.loaded||this.setting)return;this.route=(this.isStatic?location.pathname:location.hash).slice(1);const[t,e,i,r,s]=this.route.split("/"),n=this.micrio.$current,a=t&&n?.id!=t?this.micrio.open(t):void 0;n&&Promise.all([en(n.data,{allowUndefined:!0}),a?en(a.data,{allowUndefined:!0}):void 0]).then(t=>{if(!t[0])return this.inited=!0;if(void 0===this.prevLang&&(this.prevLang=this.micrio.lang),!1===a?.$settings.routerMarkerTours)return;if(t[0].pages?.length&&r){const i=this.findPage(r.toLowerCase(),t[0].pages,e);if(i)return void this.micrio.state.popover.set({contentPage:i})}const i=r?s?t.map(t=>t?.markerTours?.find(t=>js(t.i18n?.[e]?.slug)==r))[0]:t.map(t=>t?.tours?.find(t=>js(t.i18n?.[e]?.slug)==r))[0]:void 0,o=s||!i&&r,c=o?(t[1]??t[0]).markers?.find(t=>(t.i18n?.[e]?.slug??js(t.title))==o||i&&"steps"in i&&i.stepInfo?.map(t=>t.marker).find(t=>t.i18n?.[e]?.slug==o)):void 0;c&&i&&"steps"in i?i.initialStep=Math.max(0,i.steps.findIndex(t=>t.startsWith(c.id))):(c||this.micrio.state.popup.set(void 0),(a??n).state.marker.set(c)),this.micrio.state.tour.set(i),this.writeTitle&&this.setTitle(),this.inited=!0})}setTitle(){const t=wt(this.micrio._lang),e=this.micrio.$current;if(!e)return;const i=[e.$data?.i18n?.[t]?.title??e?.$info?.title,this.micrio.state.$tour?.i18n?.[t]?.title,this.micrio.state.$marker?.i18n?.[t]?.title].filter(t=>!!t).reverse();document.title=i.join(" - ")+" | Micrio"}write(t){if(this.micrio.$current&&this.loaded&&this.inited){if("marker-open"===t.type){const t=this.micrio.state.$marker;if(t&&t.data&&t.data.micrioLink)return}clearTimeout(this._to),this._to=setTimeout(()=>this.writeDeferred("load"==t.type),50)}}writeDeferred(t){const e=this.micrio.state.$tour;let i=this.micrio.$current,r=i?.state.$marker;const s=this.micrio.lang;s!=this.prevLang&&(t=!0,this.prevLang=s);const n=i?.$data?.i18n?.[s]?.title??i?.$info?.title??"",a=!1===i?.$settings.routerMarkerTours,o=r&&"string"!=typeof r?r.i18n?.[s]??r:void 0,c=wt(this.micrio.state.popover)?.contentPage,l=c?c.i18n?.[s]??c:void 0;let h=i?.id;if(e&&"steps"in e&&e.steps.length&&e.stepInfo){const t=e.stepInfo.find(t=>t.markerId==e.steps.find(t=>!t.includes(",")));t&&(h=t.micrioId,i=this.micrio.wasm.images.find(t=>t.id==h),r||void 0===e.initialStep||(r=e.stepInfo[Math.max(0,e.initialStep)].marker))}const d=[h,s,js(n)??"",...a?[]:l?[js(l.title)]:[e?.i18n?.[s]?.slug??null,o?.slug??js(o?.title)??null]].filter(t=>!!t).join("/");d!=this.route&&(this.setting=!0,this.isStatic?t?history.replaceState(null,"","/"+d+location.search):history.pushState(null,"","/"+d+location.search):location.hash=d,this.route=d,this.writeTitle&&this.setTitle(),setTimeout(()=>this.setting=!1,250))}},Ll=class t{static{this.events=["load","show","hide","marker-open","marker-opened","marker-closed","tour-start","tour-stop","tour-step","tour-ended"]}constructor(t){this.micrio=t,this.gtag="gtag"in window?window.gtag:void 0,this.hooked=!1,this.tag=this.tag.bind(this)}hook(){!this.hooked&&this.gtag&&(this.hooked=!0,this.tag(new CustomEvent("init")),t.events.forEach(t=>this.micrio.addEventListener(t,this.tag)))}unhook(){this.hooked&&(this.hooked=!1,this.tag(new CustomEvent("hide")),t.events.forEach(t=>this.micrio.removeEventListener(t,this.tag)))}tag(t){if(!this.gtag)return;const e=t.detail,i=this.micrio.$current,r={event_category:"Micrio",event_action:t.type};this.micrio.lang&&(r.culture=this.micrio.lang),"init"==t.type&&(r.micrio_version=yc),"load"==t.type&&i?.$info&&(r.image_version=i.$info.version);const s=null!==e&&"object"==typeof e&&"currentStep"in e?e.currentStep:null;null!=s&&(r.event_value=s);const n=e&&e.title?e.title:i&&i.$info&&i.$info.title;r.event_label=this.micrio.id+(n?" - "+n:""),this.gtag("event",t.type,r)}},Cl=t=>Math.round(1e5*t)/1e5,Rl=class t{static{this.getString=(t,e)=>[t.id,t.width,t.height,t.isDeepZoom?"d":"",t.isPng?"p":t.isWebP?"w":"",e.view?.map(Cl).join("/"),e.area?.map(Cl).join("/"),t.settings?.focus?.map(Cl).join("-"),e.cultures].join(",").replace(/,+$/,"")+(e.size?`|${e.size.join(",")}`:"")}get $focussed(){return wt(this.focussed)}constructor(e,i){this.micrio=e,this.image=i,this.images=[],this.imageMap=new Map,this.current=[],this._grid=document.createElement("div"),this._buttons=new Map,this.clickable=!1,this.focussed=vt(),this.markersShown=vt([]),this.history=[],this.depth=vt(0),this.aniDurationIn=1.5,this.aniDurationOut=.5,this.transitionDelay=.5,this.isHorizontal=!1,this.cellSizes=new Map,this.nextSize=new Map,this.timingFunction="ease",this.getString=(e,i={})=>t.getString(e,{view:i.view,area:i.area,size:i.size??this.nextSize.get(e.id),cultures:("cultures"in e&&e.cultures?e.cultures:"")?.replace(/,/g,"-")}),this.actionHandlers={[ko.Grid.GridActionType.focus]:(t,e)=>{const i=t?.split("|").map(t=>t.trim()),r=(i?.[0]??"").split(",").map(t=>this.imageMap.get(t.trim())).filter(t=>void 0!==t);1==r.length?this.focus(r[0],{duration:e}):r.length>0&&this.set(r.map(t=>this.getString(t.$info)).join(";"),{duration:e,horizontal:"h"==i?.[1]})},[ko.Grid.GridActionType.flyTo]:(t,e)=>{const i=t?.split(",").map(t=>this.current.find(e=>e.id==t?.trim()));i?.length?this.image.camera.flyToView([Math.min(...i.map(t=>t?.opts.area?.[0]??0)),Math.min(...i.map(t=>t?.opts.area?.[1]??0)),Math.max(...i.map(t=>t?.opts.area?.[2]??1)),Math.max(...i.map(t=>t?.opts.area?.[3]??1))],{duration:e?1e3*e:void 0}).catch(()=>{}):console.warn("Given image IDs gave no current displayed images")},[ko.Grid.GridActionType.focusTagged]:(t,e)=>{this.flyToMarkers(t,e)},[ko.Grid.GridActionType.focusWithTagged]:(t,e)=>{this.flyToMarkers(t,e,!0)},[ko.Grid.GridActionType.reset]:(t,e)=>{this.reset(e)},[ko.Grid.GridActionType.back]:(t,e)=>{this.back(e)},[ko.Grid.GridActionType.switchToGrid]:()=>{this.switchToGrid()},[ko.Grid.GridActionType.nextFadeDuration]:t=>{this.nextCrossFadeDuration=Number(t)},[ko.Grid.GridActionType.filterTourImages]:(t,e)=>{en(this.micrio.state.tour).then(i=>{if(!i)return;if(!("steps"in i)||!i.stepInfo)return;const r=i.stepInfo.map(t=>t.micrioId),s=r.filter((t,e)=>r.indexOf(t)==e).map(t=>this.imageMap.get(t)).filter(t=>!!t).map(t=>this.getString(t.$info)).join(";");s&&this.set(s,{duration:e,horizontal:"h"==t})})}},this.tourEvent=this.tourEvent.bind(this),this.updateGrid=this.updateGrid.bind(this);const r=i.$settings;this.clickable=!!r.gridClickable,void 0!==r.gridTransitionDuration&&(this.aniDurationIn=this.aniDurationOut=r.gridTransitionDuration),void 0!==r.gridTransitionDurationOut&&(this.aniDurationOut=r.gridTransitionDurationOut),this._grid.className="micrio-grid",this.set(i.$info?.grid);const s=()=>Si().then(()=>{this.hook(),e.events.dispatch("grid-load")});i.isV5?s():e._lang.subscribe(t=>{t?Promise.all(this.images.filter(e=>(e.$info&&"cultures"in e.$info&&e.$info?.cultures||"").indexOf(t)>=0).map(t=>en(t.data))).then(s):s()}),e.events.dispatch("grid-init",this)}hook(){if(this.micrio.state.marker.subscribe(t=>{if(t&&"string"!=typeof t){const e=t.data?._meta;if(e?.gridSize){const i="number"==typeof e.gridSize?[e.gridSize,e.gridSize]:e.gridSize.split(",").map(Number),r=this.images.find(e=>e.$data?.markers?.find(e=>e==t))?.id;r&&this.nextSize.set(r,i)}Si().then(()=>{const t=e?.gridAction?.split("|");t?.length&&"string"==typeof t[0]&&this.action(t.shift(),t.join("|"))})}}),this.clickable){this._grid.addEventListener("click",t=>{const e=t.target.dataset.id;e&&this.focus(this.imageMap.get(e))});const t=t=>{t?this.removeGrid():this.placeGrid()};this.micrio.state.tour.subscribe(t),this.micrio.state.marker.subscribe(t),this.focussed.subscribe(t)}this.micrio.addEventListener("tour-event",this.tourEvent),this.micrio.addEventListener("serialtour-pause",()=>this.images.forEach(t=>t.camera.pause())),this.micrio.addEventListener("serialtour-play",()=>this.images.forEach(t=>t.camera.resume()))}clearTimeouts(){clearTimeout(this._to),clearTimeout(this._fadeTo)}trackImage(t){this.images.push(t),this.imageMap.set(t.id,t)}parseInput(t){return"string"!=typeof t&&(t=t.map(t=>t instanceof $c?{image:t}:t).filter(t=>!!t.image.$info).map(t=>this.getString(t.image.$info,t)).join(";")),t.split(";").filter(t=>!!t).map(t=>this.getImage(t))}setupBehindTransition(t,e,i){const r="behind-delayed"==e.transition,s=!0===e.coverLimit,{wasm:n}=this.micrio;e.forceAni=!0,e.coverLimit=s,e.forceAreaAni=!0;const a=r?1/t.length:1;let o=0;this.images.forEach(e=>{e.camera.setCoverLimit(s),t.find(t=>t.id==e.id)&&(e.camera.setArea([0,0,i?.id==e.id?1:a,1],{noDispatch:!0,direct:!0}),e!=i&&e.camera.setView([0,0,1,1]),r&&n.setZIndex(e.ptr,t.length-o++))}),t.forEach(t=>t.view=[0,0,1,1])}savePreviousLayout(){this.depth.set(this.history.push({layout:this.current.map(t=>this.getString(t.$info,{view:t.state.$view,size:this.cellSizes.get(t.id)})).join(";"),horizontal:this.isHorizontal,view:this.image.camera.getView()}))}set(t="",e={}){return this.lastPromise=new Promise((i,r)=>{delete this.image.$info?.settings?.focus,this.lastAction=void 0,!1===e.cover&&e.coverLimit&&(e.coverLimit=!1),e.coverLimit&&null==e.cover&&(e.cover=e.coverLimit);const s=this.parseInput(t),n=this.$focussed,a=e.transition?.endsWith("-delayed"),o="behind-delayed"==e.transition,{wasm:c}=this.micrio;"crossfade"==e.transition?e.duration=0:"behind"!=e.transition&&"behind-delayed"!=e.transition||this.setupBehindTransition(s,e,n);const l=this.image.ptr>=0,h=e.duration??(e.noHistory?this.aniDurationOut:this.aniDurationIn),d=this.nextCrossFadeDuration??this.image.$settings.crossfadeDuration??1,u=(h||this.aniDurationIn)/(o?2:1);this.nextCrossFadeDuration=void 0,l&&(c.setGridTransitionDuration(h),c.setCrossfadeDuration(u));const m=!e.noBlur&&n;m&&this.blur(),!e.noHistory&&this.current.length&&this.savePreviousLayout(),this.isHorizontal=!!e.horizontal,this.removeImages(this.images.filter(t=>!s.find(e=>e.id==t.id))),this.printGrid(s,{horizontal:e.horizontal,keepGrid:e.keepGrid,scale:e.scale,columns:e.columns}),this.clearTimeouts();let f=!1;const p=()=>{this.clearTimeouts(),f||r()};l&&!e.noCamAni&&(e.view?this.image.camera.flyToView(e.view,{duration:1e3*h}).catch(p):this.image.camera.flyToFullView({duration:1e3*h}).catch(p)),this.nextSize.clear(),null==e.coverLimit&&(e.coverLimit=!0),e.coverLimit||s.forEach(t=>this.imageMap.get(t.id)?.camera.setCoverLimit(!1));const g="appear-delayed"==e.transition,v=t=>t*this.transitionDelay+(t>0&&g?h:0);this.current=s.map((t,i)=>this.placeImage(t,{duration:!e.forceAni&&m&&t.id!=n?.id?0:h,delay:a?v(i):0,noCamAni:!!(g&&i>0)||!!e.noCamAni,forceAreaAni:!(g&&i>0)&&e.forceAreaAni,cover:e.cover})),g&&this.current.slice(1).forEach(t=>c.fadeTo(t.ptr,.9999,!0));const w=()=>this.current.forEach((t,e)=>Ks(a?1e3*(v(e)+(o?h/2:0)):0).then(()=>c.fadeIn(t.ptr))),b=()=>{this.clearTimeouts(),requestAnimationFrame(()=>c.setCrossfadeDuration(d)),a&&this.images.forEach(t=>c.setZIndex(t.ptr,0)),e.coverLimit&&s.forEach(t=>this.imageMap.get(t.id)?.camera.setCoverLimit(!0)),this.clickable&&this.placeGrid(),this.lastAction=void 0,f=!0,i(this.current)};h||u?(e.noFade||(this._fadeTo=setTimeout(w,Math.max(0,h/2*1e3))),this._to=setTimeout(b,1e3*(Math.max(u,h)+(a?(s.length-1)*this.transitionDelay:0)))):(e.noFade||w(),b())})}hasChanged(){return this.current.length!==this.images.length||this.current.some((t,e)=>t.id!==this.images[e].id)}getImage(t){const e=t.split("|"),i=e[0].split(","),r=e[1]?e[1].split(",").map(Number):[1];let s=0,n=0;return{path:this.image.$info?.path,id:i[0],width:s=Number(i[1])||s,height:n=Number(i[2])||n,isDeepZoom:"d"==i[3],isPng:"p"==i[4],isWebP:"w"==i[4],size:r,view:i[5]?i[5].split("/").map(Number):void 0,area:i[6]?i[6].split("/").map(Number):void 0,settings:Xs(this.image.$settings||{},{focus:i[7]?i[7].split("-").map(Number):void 0}),cultures:i[8]?.replace(/-/g,",")||void 0}}getCols(t,e){let i=Math.ceil(e/Math.ceil(Math.sqrt(e)));if(t==e){const e=Math.floor(Math.sqrt(t)),r=[];for(let s=e;s<i+e;s++)t%s||r.push(s);r.length&&(i=r[Math.floor(r.length/2)])}return i}printGrid(t,e){e.keepGrid||this.removeGrid();const i=t.reduce((t,e)=>t+e.size[0]*(e.size[1]??1),0),r=e.columns??(e.horizontal?t.length:this.getCols(t.length,i));this._grid.style.gridTemplateColumns=`repeat(${r}, auto)`,this._grid.textContent="",this._grid.style.removeProperty("--translate"),this._grid.style.removeProperty("--scale"),t.forEach(t=>{if(!t.id)return;this._buttons.has(t.id)||this._buttons.set(t.id,document.createElement("button"));const e=this._buttons.get(t.id);"1"!=t.size.toString()?(e.style.gridArea=`auto / auto / span ${t.size[1]} / span ${t.size[0]||t.size[1]}`,this.cellSizes.set(t.id,t.size)):(e.style.removeProperty("grid-area"),this.cellSizes.delete(t.id)),e.dataset.id=t.id,this._grid.appendChild(e)}),e.keepGrid&&this._grid.parentNode||this.micrio.insertBefore(this._grid,this.micrio.firstChild?.nextSibling??null),this.micrio.events.dispatch("grid-layout-set",this);const s=this.micrio.offsetWidth,n=this.micrio.offsetHeight,a=Math.max(0,Math.min(1,1-(e.scale??1)));this._grid.style.transform="",this._grid.childNodes.forEach(e=>{if(!e)return;const i=e,r=i.dataset.id,o=i.getBoundingClientRect(),c=t.find(t=>t.id==r),l=[a/2*o.width,a/2*o.height];c&&!c.area&&(c.area=[(o.x+l[0])/s,(o.y+l[1])/n,(o.x+o.width-l[0])/s,(o.y+o.height-l[1])/n])}),e.keepGrid||this._grid.remove()}placeGrid(){!this.clickable||this.micrio.state.$tour||this.micrio.state.$marker||this._grid.parentNode||(this.micrio.insertBefore(this._grid,this.micrio.firstChild?.nextSibling??null),this.viewUnsub=this.image.state.view.subscribe(this.updateGrid))}removeGrid(){this._grid.parentNode&&(this.viewUnsub&&this.viewUnsub(),this._grid.remove())}updateGrid(){const t=this.image.camera.getXY(0,0,!0);this._grid.style.setProperty("--translate",`translate3d(${t[0]}px, ${t[1]}px, 0)`),this._grid.style.setProperty("--scale",this.image.camera.getScale().toString()),this._grid.dispatchEvent(new CustomEvent("update"))}placeImage(t,e){const{wasm:i}=this.micrio;let r=this.imageMap.get(t.id);r&&t.area?Ks(1e3*e.delay).then(()=>{r.camera.setArea(t.area,{direct:0==e.duration||!e.forceAreaAni&&!wt(r.visible)}),e.delay&&i.render()}):(t.lang=this.micrio.lang,i.addChild(r=new $c(i,t,{area:t.area}),this.image),this.trackImage(r));const s={duration:1e3*e.duration,timingFunction:this.timingFunction,limit:!1};if(!e.noCamAni&&!r.camera.aniDone&&r.ptr>0){const i=!!e.cover||r.camera.getCoverLimit();if(t.view||!i)r.camera.flyToView(t.view??[0,0,1,1],s).catch(()=>{});else if(t.area&&t.width&&t.height){const e=(t.area[2]-t.area[0])*this.micrio.offsetWidth/((t.area[3]-t.area[1])*this.micrio.offsetHeight);r.camera.flyToView(e<t.width/t.height?[.5,0,.5,1]:[0,.5,1,.5],s).catch(()=>{})}else r.camera.flyToCoverView(s).catch(()=>{})}return r}removeImages(t){const{wasm:e}=this.micrio;t.forEach(t=>{t.ptr>=0&&e.fadeOut(t.ptr),this._buttons.delete(t.id)}),e.render()}insideGrid(){const t=this.micrio.$current;return t==this.image||!!t&&this.imageMap.has(t.id)}async reset(t,e,i){const r=this.history[0];return this.images.forEach(t=>t.camera.stop()),this.image.camera.stop(),this.markersShown.set([]),await Si(),i||e||!this.micrio.camera?.isZoomedOut()||this.micrio.state.$tour||this.$focussed||this.hasChanged()||(t=0),this.set(r?.layout||this.image.$info?.grid,{noHistory:!0,duration:t,noCamAni:e,forceAni:i,horizontal:!!r&&r.horizontal}).then(t=>(this.depth.set(this.history.length=0),this.micrio.current.set(this.image),t))}switchToGrid(){const t=this.$focussed;if(!t)return;const e=t.camera.getView();e&&this.reset(0,!0).then(()=>{t.opts.area&&this.image.camera.setView(t.opts.area,{noLimit:!0}),t.camera.setView(e,{noLimit:!0}),this.micrio.current.set(this.image)})}async flyToMarkers(t,e,i){const r=t?.split("|").map(t=>t.trim()),s=r?.[0]??"",n=s?this.images.filter(t=>!!t.$data?.markers?.find(t=>t.tags?.includes(s))):this.images;return this.set(n.map(t=>{const e=t.$data?.markers?.find(t=>t.tags?.includes(s));return this.getString(t.$info,{view:i?void 0:e?.view})}).join(";"),{duration:e,horizontal:"h"==r?.[1]})}async back(t){const e=this.history.pop();e&&(this.depth.set(this.history.length),this.micrio.current.set(this.image),this.$focussed&&this.blur(),await this.set(e.layout,{duration:t,noHistory:!0,horizontal:e.horizontal,view:e.view}))}setTimingFunction(t){this.micrio.wasm.setGridTransitionTimingFunction(ko.Camera.TimingFunction[this.timingFunction=t])}async focus(t,e={}){if(!t)return this.back();e.coverLimit&&(e.cover=!0);const i=!e.view&&!e.cover,r=this.micrio;wt(r.visible).find(t=>t==this.image)||r.current.set(this.image);const s=this.$focussed;if(s==t)return;e.transition?.startsWith("slide-")||0!=e.duration&&(!s||r.wasm.areaAnimating(s.ptr)||this.current.includes(t))||t.camera.setArea([0,0,1,1],{noDispatch:!0,direct:!0}),s&&this.blur(),t.camera.setCoverLimit(!!e.cover),this.setTimingFunction("ease");const n=await this.transition(t,s,this.getString(t.$info,{view:e.view}),e);return r.wasm.setZIndex(t.ptr,3),this.focussed.set(t),wt(t.visible)||"crossfade"!=e.transition&&e.transition||(e.duration=0),this.set(n,{noBlur:!0,duration:e.duration,forceAreaAni:"crossfade"!=e.transition,cover:!!e.cover,coverLimit:!!e.coverLimit}).then(()=>{r.events.dispatch("grid-focus",t);const e=t.$info;this.removeGrid(),r.$current!=t&&r.current.set(t);const s=r.offsetWidth/r.offsetHeight,n=(1-e.width/e.height/s)/2;!t.camera.aniDone&&i&&t.camera.flyToFullView({duration:1e3*this.aniDurationIn}).catch(()=>{}),this.image.camera.setLimit([n,0,1-n,1])}).catch(()=>{})}async transition(t,e,i,{duration:r,view:s,transition:n,noViewAni:a,exitView:o,blur:c,cover:l}){if(!n)return i;const{wasm:h}=this.micrio;if("crossfade"==n&&(t.camera.setArea([0,0,1,1]),a=!0),s&&a&&t.camera.setView(s,{noRender:!0,noLimit:!0}),!e||"crossfade"==n)return i;const d=n.startsWith("slide")||n.startsWith("swipe"),u=n.startsWith("behind"),m=d?n.endsWith("-up")?0:n.endsWith("-down")?180:n.endsWith("-left")?270:90:void 0;if((d||u)&&h.fadeTo(t.ptr,.9999,!0),n.startsWith("slide"))t.camera.setArea(_o[m],{noDispatch:!0,direct:!0});else if(n.startsWith("swipe"))t.camera.setArea(xo[m],{noDispatch:!0,direct:!0}),i=[this.getString(e.$info,{view:o??e.camera.getView(),area:Eo[m]}),this.getString(t.$info,{view:s,area:[0,0,1,1]})].join(";");else if(u){t.camera.setArea([0,0,1,1]),t.camera.setView([0,0,1,1]);const i=[this.getString(e.$info,{view:[0,0,1,1]}),this.getString(t.$info,{view:[0,0,1,1]})];"behind-left"==n&&i.reverse(),await this.set(i.join(";"),{noBlur:!0,horizontal:!0,coverLimit:l}).then(()=>Ks(200))}if(c&&!isNaN(c)&&c>0){const t=(r=r??this.nextCrossFadeDuration??this.aniDurationIn)/2,e=this.micrio.canvas.element.style;e.transition=`filter ${t}s ease`,e.filter=`blur(${c}px)`,setTimeout(()=>{e.filter="",setTimeout(()=>e.transform="",1e3*t)},1e3*t)}return i}blur(){const t=this.$focussed;t&&(this.micrio.wasm.setZIndex(t.ptr,2),this.micrio.events.dispatch("grid-blur"),this.focussed.set(void 0),this.image.camera.setLimit([0,0,1,1]),this.micrio.current.set(this.image))}tourEvent(t){const e=t.detail;e&&e.action?.startsWith("grid:")&&e.active&&this.action(e.action.slice(5),e.data,e.end-e.start)}action(t,e,i){"string"==typeof t&&(t=ko.Grid.GridActionType[t]);const r=t+(e??"");if(this.lastAction==r)return;const s=this.actionHandlers[t];s?s(e,i):console.warn("Warning: unknown grid tour event",t),this.lastAction=r}async enlarge(t,e,i=e){return this.set((this.history[this.history.length-1]?.layout||this.image.$info.grid).split(";").map((r,s)=>`${r}|${s==t?`${e},${i}`:1}`).join(";"),{noHistory:!0,keepGrid:!0,duration:500})}getRelativeView(t,e){const i=t.opts.area??[0,0,1,1],r=i[2]-i[0],s=i[3]-i[1];return[i[0]+r*e[0],i[1]+s*e[1],i[0]+r*e[2],i[1]+s*e[3]]}},Dl=class t extends HTMLElement{static get observedAttributes(){return["id","muted","data-grid","data-limited","lang"]}static{this.jsonCache=mn}get $current(){return this._current}get camera(){return this._current?.camera}constructor(){super(),this.printed=!1,this.canvases=[],this.current=vt(),this.visible=vt([]),this.canvas=new gl(this),this.events=new bl(this),this.state=new bc.Main(this),this.analytics=new Ll(this),this._router=new Pl(this),this.barebone=vt(!1),this.webgl=new pl(this),this.wasm=new ll(this),this.defaultSettings=this.defaultSettings,this.loading=vt(!0),this.switching=vt(!1),this.isMuted=vt("1"==localStorage.getItem(xc)),this._lang=vt(),this.keepRendering=!1,this.initedFirst=!1,this.loadV5Album=(t,e)=>(t=>"MICRIO_ALBUM"in self?Promise.resolve(self.MICRIO_ALBUM):gn(`https://i.micr.io/album/${t}.json`))(t).then(t=>{if(!t)return;const i=t.id+"."+t.revision,r=e.path=t.organisation?.baseUrl??"https://r2.micr.io/";return e.organisation=t.organisation,e.settings.album=t,e.settings.gallery={archive:i,sort:t.sort,type:t.type,startId:e.id,isSpreads:t.isSpreads,coverPages:t.coverPages,revisions:t.published},delete e.id,this.loadArchiveBin(r,i).then(()=>this.loadGallery(e,r,!0))},t=>this.printError(t?.message||t)),this.getArchiveIndex=async(t,e=kc)=>Mc.get(`${e}${t}.json`).then(t=>(t.images.forEach(t=>mn.set(`${e}${t.id}/info.json`,t)),t)),this.current.subscribe(t=>this._current=t);let t=!1;en(this.loading,{targetValue:!1}).then(()=>{this.setAttribute("data-loaded",""),this.switching.subscribe(e=>{e?this.setAttribute("data-switching",""):(t||Si().then(()=>this.events.dispatch("show",this)),t=!0,this.removeAttribute("data-switching"))});const e=this.querySelector("img.preview");e&&setTimeout(()=>e.remove(),500)})}attributeChangedCallback(t,e,i){switch(t){case"id":if(!this.isConnected||!i)return;this.printed?this.open(i):this.print();break;case"muted":this.isMuted.set(this.hasAttribute("muted"));break;case"data-grid":this.printed?this.$current?.grid?.set(i):this.print();break;case"data-limited":this.wasm?._vertexBuffer&&this.$current?.ptr&&this.wasm.setLimited(this.$current.ptr,!!i);break;case"lang":{let t=wt(this._lang);t!=i&&(this._lang.set(i),Wn.set(Bn[i]??Bn.en),i&&(Yn.includes(i)?this.setAttribute("dir","rtl"):this.removeAttribute("dir")),t&&this.events.dispatch("lang-switch",i));break}}}connectedCallback(){this.canvas.place(),(this.hasAttribute("data-router")||this.hasAttribute("data-space"))&&"false"!=this.getAttribute("data-router")&&this._router.hook(),!this.id&&!this.hasAttribute("data-gallery")||this.printed||this.print(),"muted"in this||(Object.defineProperty(this,"muted",{get(){return wt(this.isMuted)},set(t){t?this.setAttribute("muted",""):this.removeAttribute("muted")}}),this.isMuted.subscribe(t=>{this.muted=t,t?(localStorage.setItem(xc,"1"),this.events.dispatch("audio-mute")):(localStorage.removeItem(xc),this.events.dispatch("audio-unmute"))}))}addEventListener(t,e,i){super.addEventListener(t,e,i)}removeEventListener(t,e,i){super.removeEventListener(t,e,i)}destroy(){this.current.set(void 0),this._router.unhook(),this.events.enabled.set(!1),this.canvas.unhook(),this.analytics.unhook(),this.wasm.unbind(),this._ui&&dr(this._ui),delete this._ui,this.webgl.dispose(!0),this.printed=!1}loadArchiveBin(t,e){return this.printUI(!0,!0),Mc.load(t,"g/"+e,t=>this._ui?.setProps?.({loadingProgress:t}))}async print(){if(this.printed)return;this.printed=!0,await Si();const t=this.getOptions();if(t.settings||(t.settings={}),t.settings.noControls&&this.state.ui.controls.set(!1),t.settings.gallery?.archive){const e=t.settings.gallery?.archive,i=/\.\d+$/.test(e),r=t.path||(kn(e.replace(/\.\d+$/,""))?"https://r2.micr.io/":"https://b.micr.io/");i&&await this.loadArchiveBin(r,e),t.settings.gallery.startId=t.id,t.grid?await this.setGrid(t,r):await this.loadGallery(t,r,i),i||delete t.settings.gallery.archive,t.path||(t.path=r),delete t.id}else t.id?.startsWith("album/")?await this.loadV5Album(t.id.replace("album/",""),t):t.id&&kn(t.id)&&!this.hasAttribute("width")&&!this.hasAttribute("height")&&await wn(t.id,t.forceInfoPath?t.path:void 0,t.settings?.forceDataRefresh).then(e=>e?.albumId?this.loadV5Album(e.albumId,t):void 0).catch(()=>{});this.keepRendering=!!t.settings.keepRendering;const e=t.id||t.gallery||t.grid;if(this.events.dispatch("print",t),void 0!==t.settings.lazyload&&"IntersectionObserver"in window){const i=new IntersectionObserver(r=>{r[0]&&r[0].isIntersecting&&(i.unobserve(this),e&&this.open(t))},{rootMargin:100*t.settings.lazyload+"% 0px"});i.observe(this)}else e&&requestAnimationFrame(()=>this.open(t))}printUI(e,i){this._ui?this._ui.setProps?.({noHTML:e,noLogo:i}):this._ui=ar(t.Svelte,{target:this,props:{micrio:this,noHTML:e,noLogo:i}})}printError(t){const e=t instanceof Bs?t.displayMessage:(t instanceof Error?t.message:t)??"An unknown error has occurred";console.error("Error:",e+(t instanceof Bs?` (${t.code}: ${t.message})`:"")),this._ui?.setProps?.({error:e})}open(t,e={}){this.printed||this.print();const i="string"==typeof t,r=this.getOptions();let s=i?{...r,id:t}:t;if(s.settings||(s.settings={}),r.settings?.gallery?.archive&&(/\.\d+$/.test(r.settings.gallery.archive)||delete r.settings.gallery.archive),i||Xs(r.settings,s.settings),this.defaultSettings&&Xs(this.defaultSettings,s.settings),this.$current&&s.id==this.$current?.id)return this.$current;e.splitScreen||e.gridView||!this.$current||this.switching.set(!0),s.settings.noGTag||this.analytics.hook(),this.printed=!0,this.printUI(!!s.settings.noUI,!!s.settings.noLogo);let n=this.canvases.find(t=>s.id&&t.id==s.id),a=!1;const o=this.canvases[0]?.grid;if(!n&&o){const t=s.id?o.images.find(t=>t.id==s.id):void 0;a=!!t,n=s.id?t:this.canvases[0],a&&!o.insideGrid()&&this.current.set(this.canvases[0])}if(!n){this.canvases.length&&(s.path=this.canvases[0].dataPath,s.lang=this.lang),this.canvases.push(n=new $c(this.wasm,s,e.splitScreen?{secondaryTo:e.splitTo??this._current,isPassive:e.isPassive}:void 0));const t=this.state.value&&this.state.value.c.find(t=>t[0]==s.id);t&&n.state.set(t)}e.startView&&(n.state.view.set(s.settings.view=e.startView),n.ptr>0&&n.wasm.ready&&n.camera.setView(s.settings.view,{noRender:!0})),this.lang||(this.lang="en");const c=()=>{if(n){if(!this.webgl.gl)try{this.webgl.init()}catch(t){return void this.printError(t)}en(n.info).then(t=>{if(t&&n){if(!this.initedFirst){switch(this.canvas.hook(),this._current?.$settings?.theme){case"light":this.setAttribute("data-light-mode","");break;case"os":this.setAttribute("data-auto-scheme","")}this.initedFirst=!0}t.grid&&!n.grid&&(n.grid=new Rl(this,n)),Si().then(()=>this.dispatchEvent(new CustomEvent("load",{detail:n}))),e.splitScreen&&Si().then(()=>{n&&(o?.image.camera.aniDoneAdd&&o.image.camera.aniDoneAdd.length>0?o.image.camera.aniDoneAdd.push(()=>n?.splitStart()):n.splitStart())})}}),this.wasm.set360Orientation(e.vector?.direction??0,e.vector?.distanceX??0,e.vector?.distanceY??0),this.wasm.preventDirectionSet=!e.vector,!a||e.gridView&&o?.current.find(t=>t.id==s.id)?e.splitScreen?this.wasm.setCanvas(n):this.current.set(n):o?.focus(n,{view:s.settings?.view}).then(()=>this.current.set(n))}};return this.wasm.ready?c():this.wasm.load().then(c).catch(t=>this.printError(t)),n.noImage&&this.loading.set(!1),n}close(t){t.opts.secondaryTo?t.splitEnd():this.wasm.removeCanvas(t)}getOptions(){const t={gallery:{}},e={settings:t,id:this.id},i=(t,e,i)=>{const r=e.split(".");for(let s=0;s<r.length-1;s++)t=t[r[s]];t[r[r.length-1]]=i};for(const r in Sc.STRINGS){const s=Sc.STRINGS[r],n=this.getAttribute(r),a=s.f||r.replace("data-","");n&&i(s.r?e:t,a,n)}for(const r in Sc.BOOLEANS){const s=Sc.BOOLEANS[r],n=this.getAttribute(r),a=s.f||r.replace("data-",""),o=null!=n&&""==n||"true"==n;(o||"false"==n)&&i(s.r?e:t,a,s.n?!o:!!o)}for(const r in Sc.NUMBERS){const s=Sc.NUMBERS[r],n=s.f||r.replace("data-","");let a=this.getAttribute(r);void 0!==s.dN&&null==a&&(a=s.dN),null==a||isNaN(Number(a))||i(s.r?e:t,n,Number(a))}for(const r in Sc.ARRAYS){const s=Sc.ARRAYS[r],n=this.getAttribute(r),a=s.f||r.replace("data-","");null!=n&&i(s.r?e:t,a,n.split(",").map(t=>Number(t)))}return t.static&&(t.noUI=t.skipMeta=!0,t.hookEvents=!1),e.settings&&e.grid&&e.grid.indexOf(".")>0&&(e.settings.gallery.archive=e.grid),e}async loadGallery(t,e,i){let r=t.settings?.gallery,s=r?.archive;if(!r||!s)return;const n=t.settings;if(i){const t=await this.getArchiveIndex(s.split(".")[0],e);r.archiveLayerOffset=t.delta,s=t.images.sort("name"==r.sort?(t,e)=>t.title&&e.title?t.title<e.title?-1:t.title>e.title?1:0:0:"-name"==r.sort?(t,e)=>t.title&&e.title?t.title<e.title?1:t.title>e.title?-1:0:0:"-created"==r.sort?(t,e)=>t.created&&e.created?t.created<e.created?1:t.created>e.created?-1:0:0:(t,e)=>t.created&&e.created?t.created<e.created?-1:t.created>e.created?1:0:0).map(t=>`${t.id},${t.width},${t.height},${t.isDeepZoom?"d":""},${t.isPng?"p":t.isWebP?"w":""},${t.tileSize||""}`.replace(/\,+$/,"")).join(";")}const a=s.split(";").map(t=>t.trim());if(!i){const t=a.filter(t=>t.startsWith("http")).map(t=>gn(t));t.length&&await Promise.all(t).then(t=>t.forEach((t,e)=>{t&&(a[e]=`${t["@id"]},${t.width},${t.height}`)}))}const o=a.map(t=>t.split(",").map(t=>isNaN(t)?t:Number(t)));o.forEach((t,e)=>{e>0&&!t[2]&&t.push(...o[e-1].slice(1))}),r.type||(r.type="swipe");const c="switch"==r.type||"swipe-full"==r.type||"omni"==r.type,l=r.isSpreads;if(!c){t.width=this.offsetWidth*this.canvas.getRatio(),t.height=this.offsetHeight*this.canvas.getRatio();const i=Math.max(0,o.findIndex(t=>t[0]==r.startId));return t.gallery=o.map((t,s)=>new $c(this.wasm,{id:t[0],path:e,width:t[1],height:t[2],isDeepZoom:"d"==t[3],isPng:"p"==t[4],isWebP:"w"==t[4],tileSize:t[5]||1024,revision:r?.revisions?.[t[0]],settings:{skipMeta:!0,gallery:r}},{area:[s-i,0,s-i+1,1]})),void(n.view=[0,0,1,1])}t.height=Math.max(...o.map(t=>t[2]));const h=l?r.coverPages??0:0;t.width=Math.max(...o.map(t=>t[1]*(l?2:1))),t.gallery=o.map((t,i)=>new $c(this.wasm,{id:t[0],path:e,width:t[1],height:t[2],isDeepZoom:"d"==t[3],isPng:"p"==t[4],isWebP:"w"==t[4],tileSize:t[5]||1024,revision:r?.revisions?.[t[0]],settings:{skipMeta:!0,gallery:r}},{isEmbed:!0,useParentCamera:!0,area:l?i-h<0||i==o.length-1&&(i-h)%2==0?[.25,0,.75,1]:(i-h)%2==0?[0,0,.5,1]:[.5,0,1,1]:[0,0,1,1]})),n.pinchZoomOutLimit=!0,t.gallery.length&&(n.view=sn.fromLegacy(t.gallery[Math.max(0,t.gallery.findIndex(t=>t.id==r.startId))].opts.area))}async setGrid(t,e){t.settings&&t.grid&&(t.settings.gallery?.archive==t.grid&&(this.gridInfoData=await this.getArchiveIndex(t.grid.split(".")[0],e),t.grid=this.gridInfoData.images.map(t=>Rl.getString(t,{cultures:"cultures"in t?t.cultures.join("-"):void 0})).join(";")),t.width=this.offsetWidth*this.canvas.getRatio(),t.height=this.offsetHeight*this.canvas.getRatio(),t.settings.zoomLimit=15,t.settings.minimap=!1,t.settings.initType="cover",this.removeAttribute("data-grid"))}get lang(){return wt(this._lang)}set lang(t){this.setAttribute("lang",t)}};Dl.Svelte=function(t,e){et(e,!0);const i=()=>kt(Ai(A),"$settings",h),r=()=>kt(Ai(E),"$info",h),s=()=>kt(Ai(S),"$data",h),n=()=>kt(k,"$tour",h),a=()=>kt(L,"$volume",h),o=()=>kt(w,"$visible",h),c=()=>kt(_,"$markerPopup",h),l=()=>kt(x,"$popover",h),[h,d]=_t();let u=ys(e,"noHTML",15),m=ys(e,"noLogo",23,u),f=ys(e,"loadingProgress",7,1),p=ys(e,"error",7,void 0);tt("micrio",$i(()=>e.micrio)),tt("markerImages",new Map);const g=$i(()=>"markers"==e.micrio.getAttribute("data-ui"));g&&u(!0);const v=$i(()=>"false"!=e.micrio.getAttribute("data-embeds")),{visible:w,state:b,isMuted:y}=$i(()=>e.micrio),{tour:k,marker:T,popup:_,popover:x}=b;let E=ne(void 0),S=ne(void 0),A=ne(void 0);function M(t,e){if(e)for(let i,r=0;r<e.length;r++)if(e[r].id==t||(i=M(t,e[r].children)))return i??e[r]}let I=ne(!1),$=ne(void 0);const P=[];$i(()=>e.micrio).current.subscribe(t=>{t&&(Tt(oe(E,t.info,!0),"$info",h),Tt(oe(A,void 0),"$settings",h),Ai(E)&&en(Ai(E)).then(e=>{e&&(oe(I,!0),Tt(oe(A,t.settings,!0),"$settings",h),!Ai($)&&e.organisation?.logo&&oe($,e.organisation,!0))}),Tt(oe(S,t.data,!0),"$data",h)&&P.indexOf(t.id)<0&&en(Ai(S)).then(async i=>{if(!i)return;if(P.push(t.id),await Si().then(Si),wt(e.micrio.state.popover)||wt(e.micrio.state.marker)||wt(e.micrio.state.tour))return;const r=t.$settings.start;if(r)switch(r.type){case"marker":t.state.marker.set(r.id);break;case"markerTour":const s=i.markerTours?.find(t=>t.id==r.id);s&&e.micrio.state.tour.set(s);break;case"tour":const n=i.tours?.find(t=>t.id==r.id);n&&e.micrio.state.tour.set(n);break;case"page":const a=M(r.id,i.pages);a&&e.micrio.state.popover.set({contentPage:a,showLangSelect:!0})}}))});const L=vt(kt(y,"$isMuted",h)?0:1);tt("volume",L),y.subscribe(t=>L.set(t?0:1)),tt("mediaPaused",vt(!1));let C=ne(!1),R=ne(ue([]));tt("srt",vt()).subscribe(t=>setTimeout(()=>{oe(R,t?[t]:[],!0)},20));const D=Ht(()=>i()?._360?.video),F=Ht(()=>Ai(D)?.src),O=Ht(()=>i()?.omni),z=Ht(()=>r()?.gallery),N=Ht(()=>s()?.markers?.filter(t=>!!t.positionalAudio)),V=Ht(()=>!!s()?.music?.items.length||!!Ai(N)?.length),U=Ht(()=>n()||kt(T,"$marker",h)),B=Ht(()=>!u()||g),W=Ht(()=>!(m()||r()&&u()||i()?.noLogo)),X=Ht(()=>u()||!Ai(W)||i()?.noOrgLogo?void 0:Ai($)),Y=Ht(()=>!(u()||Ai(O)||e.micrio.spaceData||n()||r()?.gallery)),G=Ht(()=>!!Ai(z)||!!Ai(O)),j=Ht(()=>!u()&&!!r()),H=Ht(()=>!u()&&!Ai(U)&&i()?.showInfo),Z=Ht(()=>!u()&&Ai(I)&&!i()?.noToolbar);var J={setProps:function(t){"error"in t&&p(t.error),void 0!==t.noHTML&&u(t.noHTML),void 0!==t.noLogo&&m(t.noLogo),void 0!==t.loadingProgress&&f(t.loadingProgress)}},K=Gc(),Q=xe(K),rt=t=>{{let e=Ht(()=>!!r().is360);Bo(t,{get volume(){return a()},get data(){return s()},get is360(){return Ai(e)}})}};vr(Q,t=>{Ai(V)&&s()&&r()&&t(rt)});var st=Ee(Q,2),nt=t=>{Ha(t,bs({get src(){return Ai(F)},get volume(){return a()},is360:!0,get width(){return r().width},get height(){return r().height}},()=>Ai(D)))};vr(st,t=>{Ai(F)&&r()&&t(nt)});var at=Ee(st,2),ot=t=>{var e=Gi();yr(xe(e),1,()=>s().embeds,t=>t.uuid,(t,e)=>{Rc(t,{get embed(){return Ai(e)}})}),ji(t,e)};vr(at,t=>{v&&s()&&s().embeds&&t(ot)});var ct=Ee(at,2),lt=t=>{Nn(t,{})};vr(ct,t=>{Ai(W)&&t(lt)});var ht=Ee(ct,2),dt=t=>{la(t,{})};vr(ht,t=>{Ai(Z)&&t(dt)});var ut=Ee(ht,2),mt=t=>{var e=Gi();yr(xe(e),1,o,t=>t.uuid,(t,e)=>{Bc(t,{get image(){return Ai(e)}})}),ji(t,e)};vr(ut,t=>{Ai(B)&&t(mt)});var ft=Ee(ut,2),pt=t=>{var e=Gi();yr(xe(e),1,()=>o().filter(t=>t.$settings.minimap),t=>t.uuid,(t,e)=>{da(t,{get image(){return Ai(e)}})}),ji(t,e)};vr(ft,t=>{Ai(Y)&&t(pt)});var gt=Ee(ft,2),bt=t=>{{let e=Ht(()=>Ai(V)||!(!Ai(F)||!Ai(D)||Ai(D).muted));Ta(t,{get hasAudio(){return Ai(e)}})}};vr(gt,t=>{Ai(j)&&t(bt)});var yt=Ee(gt,2),xt=t=>{var e=qc(),i=xe(e),r=t=>{Ro(t,{get images(){return Ai(z)},get omni(){return Ai(O)}})};vr(i,t=>{Ai(G)&&t(r)});var s=Ee(i,2),n=t=>{Un(t,{get organisation(){return Ai(X)}})};vr(s,t=>{Ai(X)&&t(n)});var a=Ee(s,2),o=t=>{jo(t,{get info(){return Ai(E)},get data(){return Ai(S)}})};vr(a,t=>{Ai(H)&&Ai(E)&&Ai(S)&&t(o)}),ji(t,e)};vr(yt,t=>{(Ai(G)||Ai(X)||Ai(H)&&Ai(E)&&Ai(S))&&t(xt)});var Et=Ee(yt,2),St=t=>{var e=Xc(),i=xe(e),r=t=>{lo(t,{get marker(){return c()}})};vr(i,t=>{c()&&t(r)});var s=Ee(i,2),a=t=>{yo(t,{get tour(){return n()},get noHTML(){return u()},onminimize:t=>oe(C,!t)})};vr(s,t=>{n()&&t(a)});var o=Ee(s,2),h=t=>{lc(t,{get popover(){return l()}})};vr(o,t=>{l()&&t(h)}),ji(t,e)};vr(Et,t=>{(c()||n()||l())&&t(St)});var At=Ee(Et,2);yr(At,16,()=>Ai(R),t=>t,(t,e)=>{La(t,{get src(){return e},get raised(){return Ai(C)}})});var Mt=Ee(At,2),It=t=>{var e=Yc(),i=xe(e),r=t=>{!function(t,e){var i=Ho(),r=_e(i);Hn(r,{name:"error"});var s=Ee(r);q(i),Ue(()=>nr(s,` ${e.message??""}`)),ji(t,i)}(t,{get message(){return p()}})};vr(i,t=>{p()&&t(r)});var s=Ee(i,2),n=t=>{!function(t,e){const i=2*Math.PI*40,r=Ht(()=>i*(1-e.progress));var s=Wc();as(s,"viewBox","0 0 100 100");var n=_e(s);as(n,"r",40),as(n,"cx",50),as(n,"cy",50);var a=Ee(n);as(a,"r",40),as(a,"cx",50),as(a,"cy",50),as(a,"stroke-dasharray","251.32741228718345px"),q(s),Ue(()=>as(a,"stroke-dashoffset",`${Ai(r)??""}px`)),Rr(1,s,()=>Fn,()=>({delay:500})),Rr(2,s,()=>Fn),ji(t,s)}(t,{get progress(){return f()}})};vr(s,t=>{f()<1&&t(n)}),ji(t,e)};vr(Mt,t=>{(p()||f()<1)&&t(It)}),ji(t,K);var $t=it(J);return d(),$t},Dl.VERSION=yc,customElements.define("micr-io",Dl),console.info("%c◈%c Micrio %cv5.5.5 - https://micr.io/","color: #00d4ee","color: #c5ff5b","color: inherit")}();})(`html{--micrio-color:#fff;--micrio-color-hover:#45a4e4;--micrio-border-radius:4px;--micrio-background:#292929bf;--micrio-background-filter:blur(8px);--micrio-popover-background:#292929bf;--micrio-scrubber-background:#ffffff40;--micrio-icon-size:18px;--micrio-text-align:left;--micrio-line-height:1.5em;--micrio-border-margin:16px;--micrio-button-size:48px;--micrio-button-shadow:0 4px 8px #00000054;--micrio-marker-size:16px;--micrio-marker-text-color:#fff;--micrio-marker-text-shadow:0px 2px 4px #0009;--micrio-marker-highlight:#00d4ee;--micrio-marker-color:#fff;--micrio-marker-border-radius:100%;--micrio-marker-border-color:#fff3;--micrio-marker-border-size:8px;--micrio-marker-icon:none;--micrio-marker-transition:background-color .25s ease, opacity .15s ease, border-width .15s ease, width .15s ease, height .15s ease;--micrio-popup-shadow:0 8px 16px #00000054;--micrio-popup-padding:16px;--micrio-progress-bar-background:#ffffff40;--micrio-progress-bar-height:4px;--micrio-waypoint-size:120px}micr-io[data-light-mode]{--micrio-color:#000;--micrio-color-hover:#196da6;--micrio-background:#ffffffa8;--micrio-progress-bar-background:#00000040;--micrio-popover-background:#d3d3d3bf;--micrio-scrubber-background:#ffffff80}@media (prefers-color-scheme:light){micr-io[data-auto-scheme]{--micrio-color:#000;--micrio-color-hover:#196da6;--micrio-background:#ffffffa8;--micrio-progress-bar-background:#00000040;--micrio-popover-background:#d3d3d3bf}}@media (width<=500px){html{--micrio-border-margin:5px;--micrio-button-size:48px}}micr-io{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;backface-visibility:hidden;background-position:50%;background-repeat:no-repeat;background-size:contain;width:100%;height:100%;min-height:200px;display:block;position:relative;overflow:hidden;container-type:size}micr-io,micr-io button{font-family:var(--micrio-font-family,inherit);font-size:var(--micrio-font-size,inherit);background-color:var(--micrio-background-color,transparent)}micr-io h3{font-weight:600}micr-io[dir=rtl]{--micrio-text-align:right}canvas.micrio{backface-visibility:hidden;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;display:block;position:absolute;top:0;left:0;width:100%!important;height:100%!important}micr-io:not([static]){overscroll-behavior:none}micr-io[data-hooked]:not([data-panning])>canvas.micrio{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:-ms-grab;cursor:grab;-ms-content-zooming:none;-ms-touch-action:none;touch-action:none}micr-io[data-panning]{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:-ms-grabbing;cursor:grabbing}micr-io[data-hooked][data-can-pan]>canvas.micrio{-ms-touch-action:pan-y;touch-action:pan-y;overscroll-behavior:initial}micr-io>.micrio-grid{grid-gap:0;will-change:transform;transform-origin:0 0;--translate:none;--scale:1;width:100%;height:100%;transform:var(--translate) scale3d(var(--scale), var(--scale), 1);grid-auto-flow:dense;display:grid;position:absolute;top:0;left:0}micr-io>.micrio-grid>button{cursor:pointer;background:0 0;border:none;grid-area:auto/auto/span 1/span 1;margin:0;padding:0}a.micrio-logo{top:calc(var(--micrio-border-margin) * 2);left:calc(var(--micrio-border-margin) * 2);z-index:2;cursor:pointer;width:22px;height:22px;transition:transform .25s;display:block;position:absolute}a.micrio-logo:hover{transform:rotate(-90deg)}a.micrio-logo:before,a.micrio-logo:after{content:"";will-change:transform;box-sizing:unset;display:block;position:absolute;transform:rotate(45deg)}a.micrio-logo:before{border:3px solid #00d4ee;width:16px;height:16px}a.loading.micrio-logo:before{animation:1s ease-out infinite micrio-logo-spin}a.micrio-logo:after{background:#c5ff5b;outline:1px solid #c5ff5b;width:6px;height:6px;top:8px;left:8px}a.loading.micrio-logo:after{animation:.5s ease-out infinite micrio-logo-spin}@keyframes micrio-logo-spin{0%{transform:rotate(45deg)}to{transform:rotate(135deg)}}a.micrio-logo-org{top:calc(var(--micrio-border-margin) * 2);right:calc(var(--micrio-border-margin) * 2);z-index:1;display:block;position:absolute}img.micrio-logo-org{max-height:64px;display:block}svg.micrio-icon{vertical-align:-.125em;height:1em;display:inline-block;overflow:visible}svg.small.micrio-icon{height:.75em}menu.micrio-menu{margin:0;padding:0;transition:background .2s,box-shadow .2s}.micrio-menu-action.micrio-menu{cursor:pointer;color:inherit;text-shadow:inherit;box-sizing:border-box;text-align:center;background:0 0;border:none;border-radius:0;padding:0 24px;font-family:inherit;font-size:.9em;text-decoration:none;display:block}@media (width<=500px){menu.micrio-menu{font-size:1em}.micrio-menu-action.micrio-menu{width:100%;margin-bottom:10px;padding:6px 0}strong.micrio-menu>svg{display:none}.items>menu.micrio-menu>.micrio-menu-action:where(.micrio-menu){font-size:1em}menu.micrio-toolbar>menu.micrio-menu>.micrio-menu-action:where(.micrio-menu){border-bottom:1px solid #ffffff80;margin-top:24px;font-size:1.5em}}@media (width>=501px){div.items.micrio-menu{max-height:calc(100vh - 160px);overflow:hidden auto}menu.micrio-toolbar>menu.micrio-menu{color:#fff;margin-right:var(--micrio-border-margin);border-radius:var(--micrio-border-radius);overflow:hidden}menu.micrio-toolbar>menu.micrio-menu:hover,menu.micrio-toolbar>menu.micrio-menu:focus-within{-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);background:var(--micrio-background);box-shadow:var(--micrio-button-shadow)}menu.micrio-toolbar>menu.micrio-menu>.micrio-menu-action:where(.micrio-menu){position:relative}menu.micrio-toolbar>menu.micrio-menu>.micrio-menu-action:where(.micrio-menu)>strong:where(.micrio-menu){margin:0 -5px;padding:5px}menu.micrio-toolbar>menu.micrio-menu:hover .micrio-menu-action:where(.micrio-menu),menu.micrio-toolbar>menu.micrio-menu:focus-within .micrio-menu-action:where(.micrio-menu){text-shadow:none;color:var(--micrio-color)}strong.micrio-menu>svg{margin-left:10px;line-height:2px}menu.micrio-menu{float:left;position:relative}menu.micrio-menu:not(:focus-within):not(:hover) .items:where(.micrio-menu){display:none}.micrio-menu-action.micrio-menu{height:var(--micrio-button-size);line-height:var(--micrio-button-size);width:100%;text-align:var(--micrio-text-align);white-space:pre;font-weight:600}.items menu.micrio-menu{float:none}.items .micrio-menu-action.micrio-menu{width:100%}.micrio-menu-action.micrio-menu:hover,.micrio-menu-action.micrio-menu:focus{text-shadow:none!important;color:var(--micrio-color-hover)!important}}.micrio-button{cursor:pointer;box-sizing:border-box;vertical-align:bottom;font:inherit;touch-action:none;color:var(--micrio-color);background:var(--micrio-button-background,var(--micrio-background,none)) var(--background,none) center center no-repeat;min-width:var(--micrio-button-size);height:var(--micrio-button-size);font-size:90%;line-height:var(--micrio-button-size);border-radius:var(--micrio-border-radius);box-shadow:var(--micrio-button-shadow);-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);background-size:24px;border:none;margin:0;padding:0 8px;text-decoration:none;transition:opacity .25s;display:inline-block;position:relative}.micrio-button:hover{outline:none}.micrio-button.transparent.micrio-button,.micrio-button.transparent.micrio-button:hover{-webkit-backdrop-filter:none;backdrop-filter:none;background-color:#0000}.micrio-button>*{transition:opacity .25s}.micrio-button:disabled{pointer-events:none;cursor:default}.micrio-button:disabled>*{opacity:.4}.micrio-button.no-click.micrio-button{pointer-events:none}img.micrio-button{pointer-events:none;max-width:100%;max-height:100%;margin:0 auto;display:block}.micrio-button>*{width:var(--micrio-icon-size);font-size:var(--micrio-icon-size);fill:var(--micrio-color);margin:0 auto;display:block;height:var(--micrio-icon-size)!important}.micrio-button.active.micrio-button{color:var(--micrio-color-hover)}.micrio-button.active.micrio-button svg{fill:var(--micrio-color-hover)}@media (hover:hover){.micrio-button:hover{background-color:var(--micrio-button-background-hover,var(--micrio-button-background,var(--micrio-background)));color:var(--micrio-color-hover)}.micrio-button:hover svg{fill:var(--micrio-color-hover);stroke:var(--micrio-color-hover)}.micrio-button:focus{outline:1px solid var(--micrio-color-hover)}}menu.micrio-toolbar{top:calc(var(--micrio-border-margin) - (var(--micrio-button-size) / 2 - 27px));left:var(--micrio-border-margin);color:#fff;text-shadow:1px 1px 2px #000;z-index:1;margin:0;padding:0;transition:transform .25s;position:absolute}@media (width<=500px){.micrio-button.toggle{top:var(--micrio-border-margin);width:34px;height:34px;box-shadow:none;z-index:2;position:absolute;left:0}.micrio-button.toggle.indent{left:35px}menu.micrio-toolbar{box-sizing:border-box;width:100%;height:100%;-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);z-index:1;background:#000000bf;padding:32px 0;top:0;left:0;overflow:hidden auto;transform:translate(0,0)}menu.micrio-toolbar:not(.shown){transform:translate3d(calc(-100% - var(--micrio-border-margin) * 2), 0, 0)}}@media (width>=501px){menu.indent.micrio-toolbar{margin-left:calc(var(--micrio-border-margin) * 2 + 25px)}menu.micrio-toolbar>.micrio-menu:not(:hover)>button.micrio-menu{margin-bottom:-15px}}canvas.micrio-minimap{bottom:var(--micrio-border-margin);transform-origin:100% 100%;cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:-ms-grab;cursor:grab;-ms-content-zooming:none;-ms-touch-action:none;touch-action:none;border-radius:var(--micrio-border-radius);background-size:100%;transition:opacity .2s;display:block;position:absolute;right:5px}canvas:not(:hover).hidden.micrio-minimap{opacity:0;pointer-events:none}canvas.dragging.micrio-minimap{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:-ms-grabbing;cursor:grabbing}canvas.controls.micrio-minimap{right:calc(var(--micrio-border-margin) + var(--micrio-button-size) + 8px)}@media (width<=800px){canvas.micrio-minimap{pointer-events:none;right:65px;transform:scale(.5)}}div.micrio-button-group{box-shadow:var(--micrio-button-shadow);border-radius:var(--micrio-border-radius);-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);background:var(--micrio-button-background,var(--micrio-background,none))}div.micrio-button-group:empty{display:none}div.micrio-button-group>.micrio-button{box-shadow:none;--micrio-background-filter:none;--micrio-button-background:none;display:block}div.micrio-button-group .micrio-button{border-radius:0}div.micrio-button-group .micrio-button:first-child{border-radius:var(--micrio-border-radius) var(--micrio-border-radius) 0 0}div.micrio-button-group .micrio-button:last-child{border-radius:0 0 var(--micrio-border-radius) var(--micrio-border-radius)}@media (width<=500px){div.micrio-button-group>*{height:calc(var(--micrio-button-size) - 4px)}div.micrio-button-group .micrio-button:first-child{padding-top:0}div.micrio-button-group .micrio-button:last-child{padding-bottom:0}}aside.micrio-controls{right:var(--micrio-border-margin);bottom:var(--micrio-border-margin);direction:rtl;margin:0;padding:0;transition:transform .25s,opacity .25s;position:absolute}aside.primary.micrio-controls:not(.portrait){right:calc(50% + var(--micrio-border-margin))}aside.primary.portrait.micrio-controls{bottom:calc(50% + var(--micrio-border-margin))}aside.hidden.micrio-controls{transform:translateX(calc(100% + var(--micrio-border-margin)));opacity:0;pointer-events:none}micr-io[data-switching]>aside.micrio-controls,micr-io[data-tour-active]>aside.micrio-controls{opacity:0;pointer-events:none}aside.micrio-controls>menu,aside.micrio-controls>button{width:var(--micrio-button-size);margin:8px 0;padding:0;display:block}menu.popout.micrio-controls{width:var(--micrio-button-size);height:var(--micrio-button-size);white-space:pre;pointer-events:none;box-shadow:var(--micrio-button-shadow);border-radius:var(--micrio-border-radius);-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);direction:rtl;padding:0}menu.popout.micrio-controls:focus-within{pointer-events:all}menu.popout.micrio-controls button{pointer-events:all;--micrio-button-shadow:none;--micrio-background-filter:none;transition:border-radius .2s,opacity .2s}menu.popout.micrio-controls:hover>button:first-child{border-radius:0 var(--micrio-border-radius) var(--micrio-border-radius) 0}menu.popout.micrio-controls>:not(:first-child){border-radius:0;padding:0;transition:opacity .2s;display:inline-block}menu.popout.micrio-controls>button:last-child{border-radius:var(--micrio-border-radius) 0 0 var(--micrio-border-radius)}menu.popout.micrio-controls:not(:focus-within)>:not(:first-child){pointer-events:none;opacity:0}div.micrio-subtitles{text-align:center;color:#fff;pointer-events:none;width:100cqw;transition:transform .2s;position:absolute;bottom:50px;left:50cqw;transform:translate(-50%)}div.raised.micrio-subtitles{transform:translate3d(-50%, calc(-1 * var(--micrio-button-size)), 0)}div.micrio-subtitles p:where(.micrio-subtitles){-webkit-box-decoration-break:clone;box-decoration-break:clone;white-space:pre-wrap;text-shadow:2px 2px 1px #0005;font-size:2.5em;line-height:inherit;background-color:#0009;margin:.5em 0;padding:0 14px;display:inline}@media (width<=640px){div.micrio-subtitles{width:95cqw;font-size:.7em}}div.container.micrio-progress-bar{width:auto;color:var(--micrio-color);background:var(--micrio-background);cursor:default;flex:1;align-items:center;line-height:8px;display:flex}div.bars.micrio-progress-bar{height:var(--micrio-progress-bar-height);background:var(--micrio-progress-bar-background);flex:1;display:flex;position:relative}div.bars.micrio-progress-bar>*{box-sizing:border-box;cursor:pointer;width:100%;height:100%;display:block;position:relative;overflow:hidden}div.bars.micrio-progress-bar>:before{content:" ";background:var(--micrio-color);pointer-events:none;height:100%;width:var(--progress,0%);will-change:width;display:block;position:absolute}div.bars.micrio-progress-bar:after{content:"";width:16px;height:16px;left:var(--progress);background-color:var(--micrio-color);pointer-events:none;border-radius:8px;display:block;position:absolute;top:50%;transform:translate(-50%,-50%)}div.time.micrio-progress-bar{text-align:center;font-variant-numeric:tabular-nums;min-width:50px;padding:0 10px;font-size:90%;display:block}aside.micrio-media-controls{cursor:default;background:var(--micrio-background);align-items:center;margin:0;display:flex;position:relative}aside.micrio-media-controls>button{border:none;border-radius:0;margin:0}aside.micrio-media-controls>button:last-child{margin-right:16px}aside.micrio-media-controls>*{--micrio-button-background:none;--micrio-background-filter:none;--micrio-button-shadow:none}:fullscreen>aside.micrio-media-controls{border-radius:var(--micrio-border-radius);width:430px;max-width:90cqw;position:absolute;bottom:5px;left:50%;transform:translate(-50%)}svg.micrio-media-controls{pointer-events:none;width:42px;height:42px;position:absolute;top:-1px;left:-1px;transform:rotate(-90deg)}circle.micrio-media-controls{stroke-width:2px;stroke:#fff;fill:#0000;stroke-dasharray:119.4 119.4;transform-origin:50%;transition:stroke-dashoffset .25s linear}figure.micrio-media{width:100%;margin:0;display:block;position:relative}figure.micrio-media div:where(.micrio-media){cursor:pointer}figure.micrio-media div.videotour:where(.micrio-media){display:flex}figure.micrio-media:fullscreen div:where(.micrio-media){flex-direction:column;width:100vw;height:100vh;display:flex}figure.micrio-media:fullscreen div:where(.micrio-media)>:first-child{flex:1}.marker-popup>figure.micrio-media>div:where(.micrio-media){width:100%}iframe.micrio-media,video.micrio-media{max-width:unset;display:block}figure.is360.micrio-media{width:360px;position:absolute;bottom:5px;left:50%;transform:translate(-50%)}figure.is360.micrio-media video:where(.micrio-media){width:200px;height:200px;display:none}iframe.hooked.micrio-media{pointer-events:none}figcaption.micrio-media{text-align:center;color:var(--micrio-color);margin:.5em 1em;font-size:90%;font-style:italic}:not(.micrio-popover)>figure.micrio-media>figcaption:where(.micrio-media)>*,.micrio-popover figure.micrio-media{margin:0}aside.micrio-media{width:100%;display:flex}aside.inside.micrio-media{position:absolute;transform:translateY(-100%)}div.show-play.micrio-media{cursor:pointer;background:#0008;justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:fixed;top:0;left:0}div.show-play.micrio-media>button.micrio-button{transform:scale(2)}figure.micrio-media:not(.media-micrio) button.micrio-button{white-space:pre;--micrio-background-filter:none;--micrio-button-shadow:none;border:none;border-radius:0;margin:0}figure.media-micrio.micrio-media{text-align:var(--micrio-text-align)}article.micrio-article{text-align:var(--micrio-text-align);line-height:var(--micrio-line-height,1.5em)}article.micrio-article>:first-child{margin-top:0}article.micrio-article>:last-child{margin-bottom:0}article.micrio-article p a{color:var(--micrio-color-hover,inherit);word-wrap:break-word}main.micrio-marker-content{padding:var(--micrio-popup-padding);-webkit-user-select:text;user-select:text;color:var(--micrio-color);background:var(--micrio-background);-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);box-shadow:var(--micrio-popup-shadow);border-radius:var(--micrio-border-radius);box-sizing:border-box;text-align:var(--micrio-text-align);padding-bottom:0;position:relative;overflow-y:auto}main.micrio-marker-content>*{--micrio-button-background:none;--micrio-background-filter:none;--micrio-button-shadow:none}main.micrio-marker-content .micrio-progress-bar.container{-webkit-backdrop-filter:none;backdrop-filter:none;background:0 0}main.micrio-marker-content::-webkit-scrollbar{background-color:#0000;width:10px}main.micrio-marker-content::-webkit-scrollbar-thumb{background:var(--micrio-color);border-radius:var(--micrio-border-radius);margin-top:10px}main.empty.micrio-marker-content{width:auto}main.micrio-marker-content h1:where(.micrio-marker-content){margin:0 0 1.25em;font-size:1.5em;font-weight:600}main.micrio-marker-content>figure.micrio-media{margin:calc(-1 * var(--micrio-popup-padding));--micrio-background:transparent;width:auto;margin-bottom:0}main.micrio-marker-content>figure.micrio-media:not(.media-video):not(:last-child)>:last-child:not(figcaption){margin-bottom:var(--micrio-popup-padding);background:var(--micrio-background);padding:0 var(--micrio-popup-padding)}main.micrio-marker-content>figure.micrio-media.media-video{margin-bottom:var(--micrio-popup-padding)}main.micrio-marker-content>figure.micrio-media>div>aside.micrio-media{--micrio-background:transparent}main.micrio-marker-content>article:last-child{margin-bottom:var(--micrio-popup-padding)}main.micrio-marker-content p{white-space:pre-line}main.micrio-marker-content figure.hidden{display:none}main.micrio-marker-content figure>div.micrio-media>:first-child{width:100%}button.micrio-marker-content{margin:0 calc(-1 * var(--micrio-popup-padding)) var(--micrio-popup-padding) calc(-1 * var(--micrio-popup-padding));padding:0}button.micrio-marker-content:disabled{cursor:default}figcaption.micrio-marker-content{margin-bottom:var(--micrio-popup-padding);text-align:center;padding:10px;font-size:.9em;font-style:italic}section.micrio-marker-content{margin-bottom:var(--micrio-popup-padding);grid-template-columns:repeat(auto-fit,minmax(100px,1fr));justify-items:center;gap:5px;display:grid}section.micrio-marker-content button:where(.micrio-marker-content){color:inherit;cursor:pointer;border:none;width:100%;margin:0;display:block}section.micrio-marker-content figure:where(.micrio-marker-content){margin:0;padding:0}section.micrio-marker-content img:where(.micrio-marker-content){object-fit:cover;width:100%;display:block}@media (width<=500px){section.micrio-marker-content{float:right;width:100px;margin-left:var(--micrio-border-margin);display:block}section.micrio-marker-content>button:where(.micrio-marker-content):not(:first-child),section.micrio-marker-content figcaption:where(.micrio-marker-content){display:none}}div.micrio-marker-popup{cursor:auto;pointer-events:all;top:var(--micrio-border-margin);left:var(--micrio-border-margin);display:block;position:absolute}div.destroying.micrio-marker-popup{pointer-events:none}div.micrio-marker-popup>main{max-height:80cqh}aside.micrio-marker-popup{padding:var(--micrio-border-margin)}aside.micrio-marker-popup progress:where(.micrio-marker-popup){display:none}@media (width>=501px){div.micrio-marker-popup{width:440px;min-width:20%}aside.micrio-marker-popup{padding-top:0;position:absolute;top:0;left:100%}aside.micrio-marker-popup>.micrio-button{margin:0 0 8px;padding:0;display:block}}div.micrio-marker-popup>main>:not(h3){transition-property:margin-top,margin-bottom,height,opacity;transition-duration:.5s;transition-timing-function:ease;overflow:hidden}div.minimized.micrio-marker-popup>main>:not(h3){opacity:0;margin-top:0;margin-bottom:0}@media (width<=500px){aside.micrio-marker-popup{margin-bottom:var(--micrio-border-margin);flex-direction:row-reverse;align-items:center;padding:0;display:flex;position:relative}aside.micrio-marker-popup progress:where(.micrio-marker-popup){opacity:0;pointer-events:none;flex:1;display:block}aside.micrio-marker-popup .micrio-tour-controls{display:flex;margin-bottom:0!important}aside.micrio-marker-popup .micrio-button{height:var(--micrio-button-size);margin:0 0 0 8px;padding:0!important;display:block!important}div.micrio-marker-popup{width:auto;right:var(--micrio-border-margin);bottom:calc(var(--micrio-button-size) + 2 * var(--micrio-border-margin));flex-direction:column;justify-content:space-between;display:flex}div.micrio-marker-popup>main{max-height:40vh}div.micrio-marker-popup>main>:not(h3){overflow:visible}}button.tour-step.micrio-marker-popup{vertical-align:middle;cursor:default;height:auto;line-height:normal}ol.micrio-serial-tour{color:var(--micrio-color);text-shadow:var(--micrio-marker-text-shadow);margin:0;list-style-type:decimal-leading-zero;position:absolute;bottom:75px;left:0}ol.micrio-serial-tour>li:where(.micrio-serial-tour){white-space:pre;height:1.5em;transition:height .25s,opacity .25s .25s}ol.micrio-serial-tour li.active:where(.micrio-serial-tour){font-weight:700}.minimized>ol.micrio-serial-tour>li:where(.micrio-serial-tour):not(.active){opacity:0;height:0;transition:height .25s .25s,opacity .25s}ol.micrio-serial-tour li:where(.micrio-serial-tour) button:where(.micrio-serial-tour){font:inherit;color:inherit;text-shadow:inherit;cursor:pointer;background:0 0;border:none;display:inline}ol.micrio-serial-tour li:where(.micrio-serial-tour) button:where(.micrio-serial-tour):hover{text-decoration:underline}aside.micrio-media-controls.micrio-serial-tour>figure.micrio-media{display:none}div.micrio-tour{bottom:var(--micrio-border-margin);max-width:calc(100% - var(--micrio-border-margin) * 2);box-sizing:border-box;border-radius:var(--micrio-border-radius);box-shadow:var(--micrio-button-shadow);-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);background-color:var(--micrio-button-background,var(--micrio-background,none));padding:0;transition:transform .2s;display:flex;position:absolute;left:50%;transform:translate(-50%)}div:not(:hover).minimized.micrio-tour{transform:translate3d(-50%, calc(100% + var(--micrio-border-margin)), 0);pointer-events:none}.serial-tour.micrio-tour>*{--micrio-background:none}.serial-tour.minimized.micrio-tour{transform:translate3d(0, calc(100% + var(--micrio-border-margin)), 0)}.serial-tour.micrio-tour,.video-tour.micrio-tour{width:500px}div.micrio-tour>*{--micrio-button-background:none}div.micrio-tour button{white-space:pre;--micrio-background-filter:none;--micrio-button-shadow:none;border:none;border-radius:0;margin:0}article.scroll-tour.micrio-tour{scroll-snap-type:y mandatory;width:100%;height:100%;position:absolute;top:0;left:0;overflow:hidden scroll}button.micrio-button.scroll-tour-end{position:absolute;top:5px;right:5px}article.micrio-tour>div.micrio-marker-popup{scroll-snap-align:center;margin:20cqh 50px 50cqh;position:relative!important}article.micrio-tour>div.micrio-marker-popup:nth-child(2n){margin-left:auto}article.micrio-tour>div.micrio-marker-popup>aside{display:none}div.micrio-dial{bottom:var(--micrio-border-margin);width:320px;max-width:calc(100vw - calc(2 * (var(--micrio-button-size) + 4 * var(--micrio-border-margin))));max-width:calc(100cqw - calc(2 * (var(--micrio-button-size) + 4 * var(--micrio-border-margin))));height:calc(var(--micrio-button-size) * .6);touch-action:none;cursor:w-resize;background-color:#0000;position:absolute;left:50%;overflow:hidden;transform:translate(-50%)}div.micrio-dial:before,div.micrio-dial:after{content:"";background-position:var(--micrio-dial-offset,0px);width:100%;display:block;position:absolute}div.micrio-dial:before{background-image:repeating-linear-gradient(90deg,#8888 0% .5%,#0000 1% 2.5%);height:50%;top:25%}div.micrio-dial:after{background-image:repeating-linear-gradient(90deg,#fff8 0% .5%,#0000 1% 20%);height:100%}span.micrio-dial{line-height:calc(var(--micrio-button-size) * .6);color:var(--micrio-color);opacity:.85;pointer-events:none;text-shadow:1px 1px 3px #000,-1px -1px 3px #000;font-size:smaller;display:block;position:absolute;bottom:0;left:50%;transform:translate(calc(5px - 50%))}ul.micrio-gallery{bottom:var(--micrio-border-margin);background:var(--micrio-button-background,var(--micrio-background,none));box-shadow:var(--micrio-button-shadow);-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);border-radius:var(--micrio-border-radius);height:var(--micrio-button-size);color:var(--micrio-color);touch-action:none;cursor:pointer;width:520px;max-width:calc(100cqw - 50px);margin:0;padding:0 16px;list-style-type:none;transition:transform .25s,opacity .25s;display:block;position:absolute;left:50%;transform:translate(-50%)}@media (width<=500px){ul.micrio-gallery{left:var(--micrio-border-margin);right:calc(var(--micrio-button-size) + var(--micrio-border-margin) * 2);width:auto;transform:none}}.track.micrio-gallery{background:var(--micrio-scrubber-background);pointer-events:none;border-radius:2px;height:2px;position:absolute;top:50%;left:16px;right:16px;overflow:hidden;transform:translateY(-50%)}.track-fill.micrio-gallery{background:var(--micrio-color);opacity:.85;border-radius:2px;height:100%;transition:width .15s;display:block;position:absolute;top:0;left:0}.ticks.micrio-gallery{pointer-events:none;position:absolute;inset:0 16px}.tick.micrio-gallery{background:var(--micrio-color);opacity:.55;border-radius:50%;width:6px;height:6px;transition:opacity .2s,transform .2s,background-color .2s;position:absolute;top:50%;transform:translate(-50%,-50%)}.tick.active.micrio-gallery{opacity:1;background:var(--micrio-color-hover,var(--micrio-color));transform:translate(-50%,-50%)scale(1.6)}@media (hover:hover){.tick.hover.micrio-gallery{opacity:1;transform:translate(-50%,-50%)scale(1.4)}}ul.dense.micrio-gallery .tick:where(.micrio-gallery){opacity:.35;border-radius:1px;width:1.5px;height:8px;transform:translate(-50%,-50%)}ul.dense.micrio-gallery .tick.major:where(.micrio-gallery){opacity:.6;height:12px}ul.dense.micrio-gallery .tick.active:where(.micrio-gallery){opacity:1;background:var(--micrio-color-hover,var(--micrio-color));width:2px;height:14px;transform:translate(-50%,-50%)}@media (hover:hover){ul.dense.micrio-gallery .tick.hover:where(.micrio-gallery){opacity:.9;transform:translate(-50%,-50%)}}.hover-label.micrio-gallery{font-variant-numeric:tabular-nums;color:var(--micrio-color);background:var(--micrio-popover-background);-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);box-shadow:var(--micrio-button-shadow);pointer-events:none;white-space:nowrap;border-radius:999px;padding:2px 8px;font-size:11px;font-weight:600;line-height:1.4;position:absolute;bottom:calc(100% + 6px);transform:translate(-50%)}.handle.micrio-gallery{box-sizing:border-box;background:var(--micrio-color);border:2px solid var(--micrio-color);cursor:ew-resize;touch-action:none;min-width:28px;height:28px;box-shadow:0 2px 8px #00000059, 0 0 0 0 var(--micrio-color-hover);border-radius:999px;padding:0;transition:left .15s,height .15s,min-width .15s,background-color .2s,box-shadow .2s;position:absolute;top:50%;left:0;transform:translate(-50%,-50%)}.handle.micrio-gallery:hover{box-shadow:0 2px 8px #0006,0 0 0 4px #ffffff1f}.handle.dragging.micrio-gallery{cursor:grabbing;transition:none;box-shadow:0 2px 12px #00000080,0 0 0 6px #ffffff26}.handle-label.micrio-gallery{font-variant-numeric:tabular-nums;color:var(--micrio-color);background:var(--micrio-popover-background);-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);box-shadow:var(--micrio-button-shadow);pointer-events:none;white-space:nowrap;border-radius:999px;padding:3px 9px;font-size:12px;font-weight:600;line-height:1.4;transition:left .15s,transform .15s;position:absolute;bottom:calc(100% + 8px);left:0;transform:translate(-50%)}.handle-label.dragging.micrio-gallery{transition:none;transform:translate(-50%)scale(1.05)}button.angular.micrio-gallery{width:var(--micrio-button-size);height:var(--micrio-button-size);background:var(--micrio-scrubber-background);border-radius:var(--micrio-border-radius);color:#444;cursor:move;border:none;padding:0;font-size:32px;line-height:42px;transition:background-color .2s;position:absolute;bottom:42px;left:50%;transform:translate(-50%)}button.angular.micrio-gallery:hover{background:#eee8}button.angular.dragging.micrio-gallery{transition:none}div.micrio-gallery{pointer-events:none;position:absolute;inset:0}div.micrio-gallery>*{pointer-events:auto}div.micrio-gallery>button.gallery-btn{transition:transform .25s,opacity .25s;position:absolute;top:50%;transform:translateY(-50%)}div.micrio-gallery>button.gallery-btn.arrow-left{left:var(--micrio-border-margin)}div.micrio-gallery>button.gallery-btn.arrow-right{right:var(--micrio-border-margin)}div.hidden.micrio-gallery:not(:hover)>ul{transform:translate(-50%, calc(100% + var(--micrio-border-margin)));opacity:0;pointer-events:none}@media (width<=500px){div.hidden.micrio-gallery:not(:hover)>ul{transform:translateY(calc(100% + var(--micrio-border-margin)))}}div.hidden.micrio-gallery:not(:hover)>button.gallery-btn.arrow-left{transform:translate(calc(-100% - var(--micrio-border-margin)), -50%);opacity:0;pointer-events:none}div.hidden.micrio-gallery:not(:hover)>button.gallery-btn.arrow-right{transform:translate(calc(100% + var(--micrio-border-margin)), -50%);opacity:0;pointer-events:none}div.micrio-gallery>button.gallery-btn:disabled{opacity:0;pointer-events:none}details.micrio-details{bottom:var(--micrio-border-margin);left:var(--micrio-border-margin);padding:var(--micrio-popup-padding);-webkit-user-select:text;user-select:text;white-space:normal;box-sizing:border-box;max-width:410px;color:var(--micrio-color);background:var(--micrio-background);-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);box-shadow:var(--micrio-popup-shadow);border-radius:var(--micrio-border-radius);font-size:.9em;transition:all .5s;position:absolute}details.micrio-details summary:where(.micrio-details){cursor:pointer;list-style:none}details.micrio-details summary:where(.micrio-details)::-webkit-details-marker{display:none}details.micrio-details small:where(.micrio-details){font-style:italic;font-weight:400;display:block}details.micrio-details>:where(.micrio-details){text-overflow:ellipsis;margin:0;overflow:hidden}details.micrio-details a{color:var(--micrio-color-hover,inherit)}details.micrio-details button{position:absolute;top:0;left:calc(100% + 8px)}@media (width<=600px){details.micrio-details{max-width:calc(100% - 10px)}details.micrio-details:not([open]) cite:where(.micrio-details){display:none}details.micrio-details:not([open]) summary:where(.micrio-details)::marker{content:"?";margin-right:5px;font-size:20px;font-weight:700;line-height:20px;display:inline-block}details.micrio-details:not([open]) summary:where(.micrio-details)::-webkit-details-marker{content:"?";margin-right:5px;font-size:20px;font-weight:700;line-height:20px;display:inline-block}details.micrio-details button{position:absolute;inset:auto 0 calc(100% + 8px) auto}}div.micrio-error{color:#fff;text-align:center;white-space:pre-wrap;-webkit-user-select:text;user-select:text;z-index:10;background:#000000bf;border:1px solid #fff;border-radius:5px;padding:10px;line-height:24px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}div.micrio-error svg{vertical-align:middle;width:24px;height:24px;fill:var(--micrio-color);margin-right:10px}@media screen and (width<=520px){div.micrio-error{box-sizing:border-box;width:90%}}figure.micrio-micrio-gallery{position:relative}micr-io.micrio-micrio-gallery{background:0 0;width:100%;height:100%;display:block}micr-io.micrio-micrio-gallery ul.micrio-gallery{--micrio-border-margin:16px}figcaption.micrio-micrio-gallery{top:var(--micrio-border-margin);left:var(--micrio-border-margin);padding:var(--micrio-popup-padding);box-sizing:border-box;max-width:410px;color:var(--micrio-color);background:var(--micrio-background);-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);box-shadow:var(--micrio-popup-shadow);border-radius:var(--micrio-border-radius);position:absolute}@media (width>=501px){micr-io.micrio-micrio-gallery:not(:fullscreen)>aside{position:fixed}}@media (width<=501px){figcaption.micrio-micrio-gallery{max-width:calc(100% - 3 * var(--micrio-border-margin) - var(--micrio-button-size))}}dialog.micrio-popover::backdrop{color:#fff;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);animation:.2s forwards micrio-popover-fadeInBg}@keyframes micrio-popover-fadeInBg{0%{background:0 0}to{background:var(--micrio-popover-background)}}@keyframes micrio-popover-fadeIn{0%{opacity:0}to{opacity:1}}dialog.micrio-popover{pointer-events:all;background:0 0;border:none;max-width:90cqw;max-height:90cqh;padding:0;animation:.5s forwards micrio-popover-fadeIn;overflow:visible}dialog.micrio-popover div.micrio-media>:first-child{border-radius:var(--micrio-border-radius);overflow:hidden}dialog.micrio-popover div.micrio-media>aside{--micrio-background:none;--micrio-button-background:none}dialog.page.article.micrio-popover figure.media-video iframe{width:100%}aside.micrio-popover{--micrio-background-filter:none;z-index:1;position:absolute}dialog.micrio-popover:not(.article){display:flex}dialog.micrio-popover:not(.article) figure>div.micrio-media{height:100%}@media (width>=640px){aside.micrio-popover{margin-left:var(--micrio-border-margin);display:block;top:0;left:100%}aside.inside.micrio-popover{margin-left:0;margin-top:var(--micrio-border-margin);margin-right:var(--micrio-border-margin);top:0;left:auto;right:0}aside.micrio-popover:not(.inside){z-index:2;position:absolute;top:0;left:100%}aside.micrio-popover>.micrio-button{margin:0 0 8px;padding:0;display:block}dialog.micrio-popover:not(.article){width:calc(85cqw - 56px);height:47.8125cqw}dialog.micrio-popover>main{width:25cqw;min-width:unset;max-width:320px}dialog.micrio-popover>main>h1{margin-right:55px}}@media (width<=639px){aside.micrio-popover{top:var(--micrio-border-margin);right:var(--micrio-border-margin);position:fixed}aside.micrio-popover .micrio-button{height:var(--micrio-button-size);box-shadow:var(--micrio-button-shadow);margin-left:8px;border-radius:var(--micrio-border-radius)!important;padding:0!important;display:inline-block!important}dialog.micrio-popover:not(.article){flex-direction:column;width:100%;height:100%}dialog.micrio-popover:not(.article) figure.micrio-media{flex:1}}dialog.micrio-popover>figure{flex:1;margin:0;position:relative}dialog.micrio-popover>figure>div.micrio-media>:first-child{width:100%;height:calc(100% - var(--micrio-button-size))}dialog.micrio-popover>figure>div.micrio-media>micr-io{height:100%!important}@media (aspect-ratio>=16/9){dialog.micrio-popover:not(.article){width:133.333cqh;height:75cqh}}@media (width<=639px){dialog.micrio-popover div.micrio-media>:first-child{border-radius:0}dialog.micrio-popover:not(.article)>:first-child{flex-direction:column;justify-content:center;height:50cqh}dialog.micrio-popover:not(.article)>figure:first-child{flex-direction:column;flex:none;display:flex}}dialog.article.micrio-popover>article{text-shadow:none;color:var(--micrio-color);background:var(--micrio-background);box-sizing:border-box;border-radius:var(--micrio-border-radius);max-height:calc(90vh - 48px);padding:20px;overflow:hidden auto}@media (width>=640px){dialog.article.micrio-popover{width:540px}}dialog.article.micrio-popover h2:where(.micrio-popover){text-align:center}dialog.article.micrio-popover article img{width:100%;height:auto}menu.micrio-popover{margin:10px 0;padding:0;list-style:none}menu.micrio-popover>.micrio-button{margin-right:10px}menu.right.micrio-popover{text-align:right}menu.right.micrio-popover>.micrio-button{margin:0 0 0 10px}dialog.gallery.micrio-popover{width:100%;height:100%;max-width:unset;max-height:unset}div.micrio-marker{transform:translate3d(calc(var(--x,0) - 50%), calc(var(--y,0) - 50%), 0) scale3d(var(--scale,1), var(--scale,1), 1);will-change:transform;display:block;position:absolute;top:0;left:0}div.micrio-marker:not(.cluster):not(.no-fade){animation:.25s forwards micrio-marker-fadeIn}div.overlapped.micrio-marker{display:none}@keyframes micrio-marker-fadeIn{0%{opacity:0}to{opacity:1}}div.behind.micrio-marker{pointer-events:none;opacity:0!important}div.mat3d.micrio-marker{transform:var(--mat);transform-style:preserve-3d;top:50%;left:50%}div.mat3d.micrio-marker>button:where(.micrio-marker){position:absolute;transform:translate(-50%,-50%)}button.micrio-marker{width:var(--micrio-marker-size);height:var(--micrio-marker-size);color:var(--micrio-marker-text-color);cursor:pointer;font:inherit;background:50% no-repeat;background-image:var(--micrio-marker-icon);background-size:contain;border:none;margin:0;padding:0;display:block;position:relative}div.micrio-marker:not(.cluster) label:where(.micrio-marker){text-align:var(--micrio-text-align);cursor:pointer;white-space:pre-wrap;width:max-content;max-width:170px;text-shadow:var(--micrio-marker-text-shadow);opacity:0;pointer-events:none;padding-left:10px;font-size:90%;font-weight:600;line-height:1em;transition:opacity .1s;position:absolute;top:50%;left:100%;transform:translateY(-50%)}div.micrio-marker:hover{z-index:2}.show-titles>div.micrio-marker label:where(.micrio-marker),div.micrio-marker:hover label:where(.micrio-marker){opacity:1}@media (width<=640px){div.micrio-marker:not(.cluster) label:where(.micrio-marker){font-size:12px}}.show-titles>div.micrio-marker label:where(.micrio-marker){pointer-events:all}label.static.micrio-marker{transform:translate(-50%, 4px) scale3d(calc(1 / var(--scale,1)), calc(1 / var(--scale,1)), 1)}div.default.micrio-marker button:where(.micrio-marker){box-sizing:content-box;border-radius:var(--micrio-marker-border-radius);border:var(--micrio-marker-border-size) solid var(--micrio-marker-border-color);transition:var(--micrio-marker-transition);background-clip:content-box;background-color:var(--micrio-marker-color)}div.default.micrio-marker:hover,div.default.hovered.micrio-marker,div.default.opened.micrio-marker{z-index:1}div.default.micrio-marker:hover button:where(.micrio-marker),div.default.hovered.micrio-marker button:where(.micrio-marker),div.default.opened.micrio-marker button:where(.micrio-marker){background-color:var(--micrio-marker-highlight);width:calc(var(--micrio-marker-size) + var(--micrio-marker-border-size) * 2);height:calc(var(--micrio-marker-size) + var(--micrio-marker-border-size) * 2);border-width:0}div.has-icon.micrio-marker button:where(.micrio-marker){--micrio-marker-icon:none}div.has-custom-icon.micrio-marker{--micrio-marker-size:32px}div.default.has-icon.micrio-marker button:where(.micrio-marker){color:#fff;width:calc(var(--micrio-marker-size) + 24px);height:calc(var(--micrio-marker-size) + 24px);background-color:var(--micrio-marker-border-color);border:none}div.default.has-icon.micrio-marker button:where(.micrio-marker)>svg{margin:0 auto}div.default.has-icon.opened.micrio-marker button:where(.micrio-marker)>svg,div.default.has-icon.hovered.micrio-marker button:where(.micrio-marker)>svg,div.default.has-icon.micrio-marker:hover button:where(.micrio-marker)>svg{color:var(--micrio-marker-highlight)}div.default.has-custom-icon.micrio-marker button:where(.micrio-marker){background-color:var(--micrio-marker-color)}div.default.has-custom-icon.opened.micrio-marker button:where(.micrio-marker),div.default.has-custom-icon.hovered.micrio-marker button:where(.micrio-marker),div.default.has-custom-icon.micrio-marker:hover button:where(.micrio-marker){background-color:var(--micrio-marker-highlight,var(--micrio-marker-color))}div.cluster.micrio-marker button:where(.micrio-marker){border:2px solid var(--micrio-marker-color);background:var(--micrio-cluster-marker-background,#fff);color:var(--micrio-cluster-marker-color,#000);width:calc(var(--micrio-marker-size) + 12px);height:calc(var(--micrio-marker-size) + 12px);box-sizing:content-box;border-radius:100%}div.cluster.micrio-marker:hover button:where(.micrio-marker){background:var(--micrio-marker-highlight,#fff);border-color:var(--micrio-marker-highlight,#fff)}div.cluster.micrio-marker label:where(.micrio-marker){pointer-events:none;display:none}div.micrio-marker img:where(.micrio-marker){max-width:100%;max-height:100%;margin:auto;display:block}div.micrio-waypoint{transform-style:preserve-3d;transform:var(--matrix);--micrio-bb:var(--micrio-button-background);--micrio-bbh:var(--micrio-button-background-hover);width:0;height:0;display:block;position:absolute;top:50%;left:50%}div.micrio-waypoint>button{--micrio-button-background:var(--micrio-waypoint-background,var(--micrio-bb));--micrio-button-background-hover:var(--micrio-waypoint-background-hover,var(--micrio-bbh));--micrio-button-size:var(--micrio-waypoint-size);--micrio-border-radius:var(--micrio-waypoint-border-radius,100%);--micrio-icon-size:var(--micrio-waypoint-icon-size,calc(var(--micrio-button-size) - 50px));pointer-events:all;border:var(--micrio-waypoint-border-size,var(--micrio-marker-border-size)) solid var(--micrio-waypoint-border-color,var(--micrio-marker-border-color));margin:0;transition:background-color .25s,opacity .25s,border-color .25s,transform .25s;transform:translate(-50%,-50%)scale(.5)}div.micrio-waypoint>button>svg{pointer-events:none;margin:0 auto}div.micrio-waypoint:hover>button,div.active.micrio-waypoint>button{transition:background-color .25s,opacity .25s,transform .25s;transform:translate(-50%,-50%)scale(.6)}div.clicked.micrio-waypoint>button{animation:.75s infinite alternate micrio-waypoint-pulse}@keyframes micrio-waypoint-pulse{0%{transform:translate(-50%,-50%)scale(.5)}to{transform:translate(-50%,-50%)scale(.75)}}.embed-container.micrio-embed{transform:translate3d(calc(var(--x,0) - 50%), calc(var(--y,0) - 50%), 0) scale3d(var(--s),var(--s),1);opacity:var(--opacity,1);will-change:transform, opacity;direction:ltr;display:block;position:absolute;top:0;left:0}.embed3d.micrio-embed{top:50%;left:50%}.embed-container.no-events.micrio-embed{pointer-events:none}.embed-container.micrio-embed>:where(.micrio-embed){cursor:pointer}.embed-container.micrio-embed>*{transform:translate3d(-50%,-50%,0) scale3d(var(--scale,1), var(--scale,1), 1);position:absolute}.embed-container.micrio-embed>:not(button){width:auto!important}.embed-container.micrio-embed:not(.no-events)>*{pointer-events:all}.embed-container.behind.micrio-embed>*{pointer-events:none}.embed-container.micrio-embed>img:where(.micrio-embed){max-width:none}.embed-container.micrio-embed>button{--scale:1;--ratio:1;width:100px;aspect-ratio:var(--ratio);background:0 0;border:none;margin:0;padding:0}.embed-container.micrio-embed>button,.embed-container.micrio-embed>img:where(.micrio-embed){touch-action:none}div.micrio-markers{pointer-events:none;will-change:width, height, top, left, opacity;width:100%;height:100%;perspective:inherit;position:absolute;top:0;left:0;overflow:hidden}div.micrio-markers:empty{display:none}div.micrio-markers>*{pointer-events:all}div.inactive.micrio-markers>*{pointer-events:none}div.is360.micrio-markers{transition:opacity .25s}div.is360.inactive.micrio-markers{opacity:0}aside.micrio-markers{pointer-events:none}aside.micrio-markers section:where(.micrio-markers){width:10cqw;min-width:200px;color:var(--micrio-marker-color);flex-direction:column;font-size:1em;font-weight:500;line-height:1em;display:flex;position:absolute;top:0;bottom:0}aside.micrio-markers section:where(.micrio-markers):first-child{align-items:flex-end;left:10px}aside.micrio-markers section:where(.micrio-markers):nth-child(2){align-items:flex-start;right:10px}aside.micrio-markers section:where(.micrio-markers) article:where(.micrio-markers){flex:1;align-items:center;max-height:30cqh;padding:10px;display:flex}aside.micrio-markers section:where(.micrio-markers) label:where(.micrio-markers){pointer-events:all;cursor:pointer;opacity:.75;max-width:160px;text-shadow:var(--micrio-marker-text-shadow);padding:10px;transition:opacity .25s,color .25s}label.hover.micrio-markers{color:var(--micrio-marker-highlight);opacity:1}aside.micrio-markers section:where(.micrio-markers):first-child article:where(.micrio-markers){justify-content:right}aside.micrio-markers section:where(.micrio-markers):first-child label:where(.micrio-markers){text-align:right}svg.micrio-markers{pointer-events:none;width:100%;height:100%;position:absolute}svg.micrio-markers line:where(.micrio-markers){stroke:var(--micrio-marker-highlight);stroke-width:2px}svg.micrio-markers line:where(.micrio-markers):not(.hovered){stroke:var(--micrio-marker-color);stroke-dasharray:10;stroke-width:1px;opacity:.75}svg.micrio-progress-circle{pointer-events:none;z-index:10;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)rotate(-90deg)}circle.micrio-progress-circle{transition:stroke-dashoffset .25s}
|
|
31
|
-
/*$vite$:1*/`,C,M))})();
|
|
26
|
+
const _css=document.createElement('style');
|
|
27
|
+
_css.className='micrio-interface';_css.textContent=`html{--micrio-color:#fff;--micrio-color-hover:#45a4e4;--micrio-border-radius:4px;--micrio-background:#292929bf;--micrio-background-filter:blur(8px);--micrio-popover-background:#292929bf;--micrio-scrubber-background:#ffffff40;--micrio-icon-size:18px;--micrio-text-align:left;--micrio-line-height:1.5em;--micrio-border-margin:16px;--micrio-button-size:48px;--micrio-button-shadow:0 4px 8px #00000054;--micrio-marker-size:16px;--micrio-marker-text-color:#fff;--micrio-marker-text-shadow:0px 2px 4px #0009;--micrio-marker-highlight:#00d4ee;--micrio-marker-color:#fff;--micrio-marker-border-radius:100%;--micrio-marker-border-color:#fff3;--micrio-marker-border-size:8px;--micrio-marker-icon:none;--micrio-marker-transition:background-color .25s ease, opacity .15s ease, border-width .15s ease, width .15s ease, height .15s ease;--micrio-popup-shadow:0 8px 16px #00000054;--micrio-popup-padding:16px;--micrio-progress-bar-background:#ffffff40;--micrio-progress-bar-height:4px;--micrio-waypoint-size:120px}micr-io[data-light-mode]{--micrio-color:#000;--micrio-color-hover:#196da6;--micrio-background:#ffffffa8;--micrio-progress-bar-background:#00000040;--micrio-popover-background:#d3d3d3bf;--micrio-scrubber-background:#ffffff80}@media (prefers-color-scheme:light){micr-io[data-auto-scheme]{--micrio-color:#000;--micrio-color-hover:#196da6;--micrio-background:#ffffffa8;--micrio-progress-bar-background:#00000040;--micrio-popover-background:#d3d3d3bf}}@media (width<=500px){html{--micrio-border-margin:5px;--micrio-button-size:48px}}micr-io{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;backface-visibility:hidden;background-position:50%;background-repeat:no-repeat;background-size:contain;width:100%;height:100%;min-height:200px;display:block;position:relative;overflow:hidden;container-type:size}micr-io,micr-io button{font-family:var(--micrio-font-family,inherit);font-size:var(--micrio-font-size,inherit);background-color:var(--micrio-background-color,transparent)}micr-io h3{font-weight:600}micr-io[dir=rtl]{--micrio-text-align:right}canvas.micrio{backface-visibility:hidden;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;display:block;position:absolute;top:0;left:0;width:100%!important;height:100%!important}micr-io:not([static]){overscroll-behavior:none}micr-io[data-hooked]:not([data-panning])>canvas.micrio{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:-ms-grab;cursor:grab;-ms-content-zooming:none;-ms-touch-action:none;touch-action:none}micr-io[data-panning]{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:-ms-grabbing;cursor:grabbing}micr-io[data-hooked][data-can-pan]>canvas.micrio{-ms-touch-action:pan-y;touch-action:pan-y;overscroll-behavior:initial}micr-io>.micrio-grid{grid-gap:0;will-change:transform;transform-origin:0 0;--translate:none;--scale:1;width:100%;height:100%;transform:var(--translate) scale3d(var(--scale), var(--scale), 1);grid-auto-flow:dense;display:grid;position:absolute;top:0;left:0}micr-io>.micrio-grid>button{cursor:pointer;background:0 0;border:none;grid-area:auto/auto/span 1/span 1;margin:0;padding:0}a.micrio-logo{top:calc(var(--micrio-border-margin) * 2);left:calc(var(--micrio-border-margin) * 2);z-index:2;cursor:pointer;width:22px;height:22px;transition:transform .25s;display:block;position:absolute}a.micrio-logo:hover{transform:rotate(-90deg)}a.micrio-logo:before,a.micrio-logo:after{content:"";will-change:transform;box-sizing:unset;display:block;position:absolute;transform:rotate(45deg)}a.micrio-logo:before{border:3px solid #00d4ee;width:16px;height:16px}a.loading.micrio-logo:before{animation:1s ease-out infinite micrio-logo-spin}a.micrio-logo:after{background:#c5ff5b;outline:1px solid #c5ff5b;width:6px;height:6px;top:8px;left:8px}a.loading.micrio-logo:after{animation:.5s ease-out infinite micrio-logo-spin}@keyframes micrio-logo-spin{0%{transform:rotate(45deg)}to{transform:rotate(135deg)}}a.micrio-logo-org{top:calc(var(--micrio-border-margin) * 2);right:calc(var(--micrio-border-margin) * 2);z-index:1;display:block;position:absolute}img.micrio-logo-org{max-height:64px;display:block}svg.micrio-icon{vertical-align:-.125em;height:1em;display:inline-block;overflow:visible}svg.small.micrio-icon{height:.75em}menu.micrio-menu{margin:0;padding:0;transition:background .2s,box-shadow .2s}.micrio-menu-action.micrio-menu{cursor:pointer;color:inherit;text-shadow:inherit;box-sizing:border-box;text-align:center;background:0 0;border:none;border-radius:0;padding:0 24px;font-family:inherit;font-size:.9em;text-decoration:none;display:block}@media (width<=500px){menu.micrio-menu{font-size:1em}.micrio-menu-action.micrio-menu{width:100%;margin-bottom:10px;padding:6px 0}strong.micrio-menu>svg{display:none}.items>menu.micrio-menu>.micrio-menu-action:where(.micrio-menu){font-size:1em}menu.micrio-toolbar>menu.micrio-menu>.micrio-menu-action:where(.micrio-menu){border-bottom:1px solid #ffffff80;margin-top:24px;font-size:1.5em}}@media (width>=501px){div.items.micrio-menu{max-height:calc(100vh - 160px);overflow:hidden auto}menu.micrio-toolbar>menu.micrio-menu{color:#fff;margin-right:var(--micrio-border-margin);border-radius:var(--micrio-border-radius);overflow:hidden}menu.micrio-toolbar>menu.micrio-menu:hover,menu.micrio-toolbar>menu.micrio-menu:focus-within{-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);background:var(--micrio-background);box-shadow:var(--micrio-button-shadow)}menu.micrio-toolbar>menu.micrio-menu>.micrio-menu-action:where(.micrio-menu){position:relative}menu.micrio-toolbar>menu.micrio-menu>.micrio-menu-action:where(.micrio-menu)>strong:where(.micrio-menu){margin:0 -5px;padding:5px}menu.micrio-toolbar>menu.micrio-menu:hover .micrio-menu-action:where(.micrio-menu),menu.micrio-toolbar>menu.micrio-menu:focus-within .micrio-menu-action:where(.micrio-menu){text-shadow:none;color:var(--micrio-color)}strong.micrio-menu>svg{margin-left:10px;line-height:2px}menu.micrio-menu{float:left;position:relative}menu.micrio-menu:not(:focus-within):not(:hover) .items:where(.micrio-menu){display:none}.micrio-menu-action.micrio-menu{height:var(--micrio-button-size);line-height:var(--micrio-button-size);width:100%;text-align:var(--micrio-text-align);white-space:pre;font-weight:600}.items menu.micrio-menu{float:none}.items .micrio-menu-action.micrio-menu{width:100%}.micrio-menu-action.micrio-menu:hover,.micrio-menu-action.micrio-menu:focus{text-shadow:none!important;color:var(--micrio-color-hover)!important}}.micrio-button{cursor:pointer;box-sizing:border-box;vertical-align:bottom;font:inherit;touch-action:none;color:var(--micrio-color);background:var(--micrio-button-background,var(--micrio-background,none)) var(--background,none) center center no-repeat;min-width:var(--micrio-button-size);height:var(--micrio-button-size);font-size:90%;line-height:var(--micrio-button-size);border-radius:var(--micrio-border-radius);box-shadow:var(--micrio-button-shadow);-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);background-size:24px;border:none;margin:0;padding:0 8px;text-decoration:none;transition:opacity .25s;display:inline-block;position:relative}.micrio-button:hover{outline:none}.micrio-button.transparent.micrio-button,.micrio-button.transparent.micrio-button:hover{-webkit-backdrop-filter:none;backdrop-filter:none;background-color:#0000}.micrio-button>*{transition:opacity .25s}.micrio-button:disabled{pointer-events:none;cursor:default}.micrio-button:disabled>*{opacity:.4}.micrio-button.no-click.micrio-button{pointer-events:none}img.micrio-button{pointer-events:none;max-width:100%;max-height:100%;margin:0 auto;display:block}.micrio-button>*{width:var(--micrio-icon-size);font-size:var(--micrio-icon-size);fill:var(--micrio-color);margin:0 auto;display:block;height:var(--micrio-icon-size)!important}.micrio-button.active.micrio-button{color:var(--micrio-color-hover)}.micrio-button.active.micrio-button svg{fill:var(--micrio-color-hover)}@media (hover:hover){.micrio-button:hover{background-color:var(--micrio-button-background-hover,var(--micrio-button-background,var(--micrio-background)));color:var(--micrio-color-hover)}.micrio-button:hover svg{fill:var(--micrio-color-hover);stroke:var(--micrio-color-hover)}.micrio-button:focus{outline:1px solid var(--micrio-color-hover)}}menu.micrio-toolbar{top:calc(var(--micrio-border-margin) - (var(--micrio-button-size) / 2 - 27px));left:var(--micrio-border-margin);color:#fff;text-shadow:1px 1px 2px #000;z-index:1;margin:0;padding:0;transition:transform .25s;position:absolute}@media (width<=500px){.micrio-button.toggle{top:var(--micrio-border-margin);width:34px;height:34px;box-shadow:none;z-index:2;position:absolute;left:0}.micrio-button.toggle.indent{left:35px}menu.micrio-toolbar{box-sizing:border-box;width:100%;height:100%;-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);z-index:1;background:#000000bf;padding:32px 0;top:0;left:0;overflow:hidden auto;transform:translate(0,0)}menu.micrio-toolbar:not(.shown){transform:translate3d(calc(-100% - var(--micrio-border-margin) * 2), 0, 0)}}@media (width>=501px){menu.indent.micrio-toolbar{margin-left:calc(var(--micrio-border-margin) * 2 + 25px)}menu.micrio-toolbar>.micrio-menu:not(:hover)>button.micrio-menu{margin-bottom:-15px}}canvas.micrio-minimap{bottom:var(--micrio-border-margin);transform-origin:100% 100%;cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:-ms-grab;cursor:grab;-ms-content-zooming:none;-ms-touch-action:none;touch-action:none;border-radius:var(--micrio-border-radius);background-size:100%;transition:opacity .2s;display:block;position:absolute;right:5px}canvas:not(:hover).hidden.micrio-minimap{opacity:0;pointer-events:none}canvas.dragging.micrio-minimap{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:-ms-grabbing;cursor:grabbing}canvas.controls.micrio-minimap{right:calc(var(--micrio-border-margin) + var(--micrio-button-size) + 8px)}@media (width<=800px){canvas.micrio-minimap{pointer-events:none;right:65px;transform:scale(.5)}}div.micrio-button-group{box-shadow:var(--micrio-button-shadow);border-radius:var(--micrio-border-radius);-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);background:var(--micrio-button-background,var(--micrio-background,none))}div.micrio-button-group:empty{display:none}div.micrio-button-group>.micrio-button{box-shadow:none;--micrio-background-filter:none;--micrio-button-background:none;display:block}div.micrio-button-group .micrio-button{border-radius:0}div.micrio-button-group .micrio-button:first-child{border-radius:var(--micrio-border-radius) var(--micrio-border-radius) 0 0}div.micrio-button-group .micrio-button:last-child{border-radius:0 0 var(--micrio-border-radius) var(--micrio-border-radius)}@media (width<=500px){div.micrio-button-group>*{height:calc(var(--micrio-button-size) - 4px)}div.micrio-button-group .micrio-button:first-child{padding-top:0}div.micrio-button-group .micrio-button:last-child{padding-bottom:0}}aside.micrio-controls{right:var(--micrio-border-margin);bottom:var(--micrio-border-margin);direction:rtl;margin:0;padding:0;transition:transform .25s,opacity .25s;position:absolute}aside.primary.micrio-controls:not(.portrait){right:calc(50% + var(--micrio-border-margin))}aside.primary.portrait.micrio-controls{bottom:calc(50% + var(--micrio-border-margin))}aside.hidden.micrio-controls{transform:translateX(calc(100% + var(--micrio-border-margin)));opacity:0;pointer-events:none}micr-io[data-switching]>aside.micrio-controls,micr-io[data-tour-active]>aside.micrio-controls{opacity:0;pointer-events:none}aside.micrio-controls>menu,aside.micrio-controls>button{width:var(--micrio-button-size);margin:8px 0;padding:0;display:block}menu.popout.micrio-controls{width:var(--micrio-button-size);height:var(--micrio-button-size);white-space:pre;pointer-events:none;box-shadow:var(--micrio-button-shadow);border-radius:var(--micrio-border-radius);-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);direction:rtl;padding:0}menu.popout.micrio-controls:focus-within{pointer-events:all}menu.popout.micrio-controls button{pointer-events:all;--micrio-button-shadow:none;--micrio-background-filter:none;transition:border-radius .2s,opacity .2s}menu.popout.micrio-controls:hover>button:first-child{border-radius:0 var(--micrio-border-radius) var(--micrio-border-radius) 0}menu.popout.micrio-controls>:not(:first-child){border-radius:0;padding:0;transition:opacity .2s;display:inline-block}menu.popout.micrio-controls>button:last-child{border-radius:var(--micrio-border-radius) 0 0 var(--micrio-border-radius)}menu.popout.micrio-controls:not(:focus-within)>:not(:first-child){pointer-events:none;opacity:0}div.micrio-subtitles{text-align:center;color:#fff;pointer-events:none;width:100cqw;transition:transform .2s;position:absolute;bottom:50px;left:50cqw;transform:translate(-50%)}div.raised.micrio-subtitles{transform:translate3d(-50%, calc(-1 * var(--micrio-button-size)), 0)}div.micrio-subtitles p:where(.micrio-subtitles){-webkit-box-decoration-break:clone;box-decoration-break:clone;white-space:pre-wrap;text-shadow:2px 2px 1px #0005;font-size:2.5em;line-height:inherit;background-color:#0009;margin:.5em 0;padding:0 14px;display:inline}@media (width<=640px){div.micrio-subtitles{width:95cqw;font-size:.7em}}div.container.micrio-progress-bar{width:auto;color:var(--micrio-color);background:var(--micrio-background);cursor:default;flex:1;align-items:center;line-height:8px;display:flex}div.bars.micrio-progress-bar{height:var(--micrio-progress-bar-height);background:var(--micrio-progress-bar-background);flex:1;display:flex;position:relative}div.bars.micrio-progress-bar>*{box-sizing:border-box;cursor:pointer;width:100%;height:100%;display:block;position:relative;overflow:hidden}div.bars.micrio-progress-bar>:before{content:" ";background:var(--micrio-color);pointer-events:none;height:100%;width:var(--progress,0%);will-change:width;display:block;position:absolute}div.bars.micrio-progress-bar:after{content:"";width:16px;height:16px;left:var(--progress);background-color:var(--micrio-color);pointer-events:none;border-radius:8px;display:block;position:absolute;top:50%;transform:translate(-50%,-50%)}div.time.micrio-progress-bar{text-align:center;font-variant-numeric:tabular-nums;min-width:50px;padding:0 10px;font-size:90%;display:block}aside.micrio-media-controls{cursor:default;background:var(--micrio-background);align-items:center;margin:0;display:flex;position:relative}aside.micrio-media-controls>button{border:none;border-radius:0;margin:0}aside.micrio-media-controls>button:last-child{margin-right:16px}aside.micrio-media-controls>*{--micrio-button-background:none;--micrio-background-filter:none;--micrio-button-shadow:none}:fullscreen>aside.micrio-media-controls{border-radius:var(--micrio-border-radius);width:430px;max-width:90cqw;position:absolute;bottom:5px;left:50%;transform:translate(-50%)}svg.micrio-media-controls{pointer-events:none;width:42px;height:42px;position:absolute;top:-1px;left:-1px;transform:rotate(-90deg)}circle.micrio-media-controls{stroke-width:2px;stroke:#fff;fill:#0000;stroke-dasharray:119.4 119.4;transform-origin:50%;transition:stroke-dashoffset .25s linear}figure.micrio-media{width:100%;margin:0;display:block;position:relative}figure.micrio-media div:where(.micrio-media){cursor:pointer}figure.micrio-media div.videotour:where(.micrio-media){display:flex}figure.micrio-media:fullscreen div:where(.micrio-media){flex-direction:column;width:100vw;height:100vh;display:flex}figure.micrio-media:fullscreen div:where(.micrio-media)>:first-child{flex:1}.marker-popup>figure.micrio-media>div:where(.micrio-media){width:100%}iframe.micrio-media,video.micrio-media{max-width:unset;display:block}figure.is360.micrio-media{width:360px;position:absolute;bottom:5px;left:50%;transform:translate(-50%)}figure.is360.micrio-media video:where(.micrio-media){width:200px;height:200px;display:none}iframe.hooked.micrio-media{pointer-events:none}figcaption.micrio-media{text-align:center;color:var(--micrio-color);margin:.5em 1em;font-size:90%;font-style:italic}:not(.micrio-popover)>figure.micrio-media>figcaption:where(.micrio-media)>*,.micrio-popover figure.micrio-media{margin:0}aside.micrio-media{width:100%;display:flex}aside.inside.micrio-media{position:absolute;transform:translateY(-100%)}div.show-play.micrio-media{cursor:pointer;background:#0008;justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:fixed;top:0;left:0}div.show-play.micrio-media>button.micrio-button{transform:scale(2)}figure.micrio-media:not(.media-micrio) button.micrio-button{white-space:pre;--micrio-background-filter:none;--micrio-button-shadow:none;border:none;border-radius:0;margin:0}figure.media-micrio.micrio-media{text-align:var(--micrio-text-align)}article.micrio-article{text-align:var(--micrio-text-align);line-height:var(--micrio-line-height,1.5em)}article.micrio-article>:first-child{margin-top:0}article.micrio-article>:last-child{margin-bottom:0}article.micrio-article p a{color:var(--micrio-color-hover,inherit);word-wrap:break-word}main.micrio-marker-content{padding:var(--micrio-popup-padding);-webkit-user-select:text;user-select:text;color:var(--micrio-color);background:var(--micrio-background);-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);box-shadow:var(--micrio-popup-shadow);border-radius:var(--micrio-border-radius);box-sizing:border-box;text-align:var(--micrio-text-align);padding-bottom:0;position:relative;overflow-y:auto}main.micrio-marker-content>*{--micrio-button-background:none;--micrio-background-filter:none;--micrio-button-shadow:none}main.micrio-marker-content .micrio-progress-bar.container{-webkit-backdrop-filter:none;backdrop-filter:none;background:0 0}main.micrio-marker-content::-webkit-scrollbar{background-color:#0000;width:10px}main.micrio-marker-content::-webkit-scrollbar-thumb{background:var(--micrio-color);border-radius:var(--micrio-border-radius);margin-top:10px}main.empty.micrio-marker-content{width:auto}main.micrio-marker-content h1:where(.micrio-marker-content){margin:0 0 1.25em;font-size:1.5em;font-weight:600}main.micrio-marker-content>figure.micrio-media{margin:calc(-1 * var(--micrio-popup-padding));--micrio-background:transparent;width:auto;margin-bottom:0}main.micrio-marker-content>figure.micrio-media:not(.media-video):not(:last-child)>:last-child:not(figcaption){margin-bottom:var(--micrio-popup-padding);background:var(--micrio-background);padding:0 var(--micrio-popup-padding)}main.micrio-marker-content>figure.micrio-media.media-video{margin-bottom:var(--micrio-popup-padding)}main.micrio-marker-content>figure.micrio-media>div>aside.micrio-media{--micrio-background:transparent}main.micrio-marker-content>article:last-child{margin-bottom:var(--micrio-popup-padding)}main.micrio-marker-content p{white-space:pre-line}main.micrio-marker-content figure.hidden{display:none}main.micrio-marker-content figure>div.micrio-media>:first-child{width:100%}button.micrio-marker-content{margin:0 calc(-1 * var(--micrio-popup-padding)) var(--micrio-popup-padding) calc(-1 * var(--micrio-popup-padding));padding:0}button.micrio-marker-content:disabled{cursor:default}figcaption.micrio-marker-content{margin-bottom:var(--micrio-popup-padding);text-align:center;padding:10px;font-size:.9em;font-style:italic}section.micrio-marker-content{margin-bottom:var(--micrio-popup-padding);grid-template-columns:repeat(auto-fit,minmax(100px,1fr));justify-items:center;gap:5px;display:grid}section.micrio-marker-content button:where(.micrio-marker-content){color:inherit;cursor:pointer;border:none;width:100%;margin:0;display:block}section.micrio-marker-content figure:where(.micrio-marker-content){margin:0;padding:0}section.micrio-marker-content img:where(.micrio-marker-content){object-fit:cover;width:100%;display:block}@media (width<=500px){section.micrio-marker-content{float:right;width:100px;margin-left:var(--micrio-border-margin);display:block}section.micrio-marker-content>button:where(.micrio-marker-content):not(:first-child),section.micrio-marker-content figcaption:where(.micrio-marker-content){display:none}}div.micrio-marker-popup{cursor:auto;pointer-events:all;top:var(--micrio-border-margin);left:var(--micrio-border-margin);display:block;position:absolute}div.destroying.micrio-marker-popup{pointer-events:none}div.micrio-marker-popup>main{max-height:80cqh}aside.micrio-marker-popup{padding:var(--micrio-border-margin)}aside.micrio-marker-popup progress:where(.micrio-marker-popup){display:none}@media (width>=501px){div.micrio-marker-popup{width:440px;min-width:20%}aside.micrio-marker-popup{padding-top:0;position:absolute;top:0;left:100%}aside.micrio-marker-popup>.micrio-button{margin:0 0 8px;padding:0;display:block}}div.micrio-marker-popup>main>:not(h3){transition-property:margin-top,margin-bottom,height,opacity;transition-duration:.5s;transition-timing-function:ease;overflow:hidden}div.minimized.micrio-marker-popup>main>:not(h3){opacity:0;margin-top:0;margin-bottom:0}@media (width<=500px){aside.micrio-marker-popup{margin-bottom:var(--micrio-border-margin);flex-direction:row-reverse;align-items:center;padding:0;display:flex;position:relative}aside.micrio-marker-popup progress:where(.micrio-marker-popup){opacity:0;pointer-events:none;flex:1;display:block}aside.micrio-marker-popup .micrio-tour-controls{display:flex;margin-bottom:0!important}aside.micrio-marker-popup .micrio-button{height:var(--micrio-button-size);margin:0 0 0 8px;padding:0!important;display:block!important}div.micrio-marker-popup{width:auto;right:var(--micrio-border-margin);bottom:calc(var(--micrio-button-size) + 2 * var(--micrio-border-margin));flex-direction:column;justify-content:space-between;display:flex}div.micrio-marker-popup>main{max-height:40vh}div.micrio-marker-popup>main>:not(h3){overflow:visible}}button.tour-step.micrio-marker-popup{vertical-align:middle;cursor:default;height:auto;line-height:normal}ol.micrio-serial-tour{color:var(--micrio-color);text-shadow:var(--micrio-marker-text-shadow);margin:0;list-style-type:decimal-leading-zero;position:absolute;bottom:75px;left:0}ol.micrio-serial-tour>li:where(.micrio-serial-tour){white-space:pre;height:1.5em;transition:height .25s,opacity .25s .25s}ol.micrio-serial-tour li.active:where(.micrio-serial-tour){font-weight:700}.minimized>ol.micrio-serial-tour>li:where(.micrio-serial-tour):not(.active){opacity:0;height:0;transition:height .25s .25s,opacity .25s}ol.micrio-serial-tour li:where(.micrio-serial-tour) button:where(.micrio-serial-tour){font:inherit;color:inherit;text-shadow:inherit;cursor:pointer;background:0 0;border:none;display:inline}ol.micrio-serial-tour li:where(.micrio-serial-tour) button:where(.micrio-serial-tour):hover{text-decoration:underline}aside.micrio-media-controls.micrio-serial-tour>figure.micrio-media{display:none}div.micrio-tour{bottom:var(--micrio-border-margin);max-width:calc(100% - var(--micrio-border-margin) * 2);box-sizing:border-box;border-radius:var(--micrio-border-radius);box-shadow:var(--micrio-button-shadow);-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);background-color:var(--micrio-button-background,var(--micrio-background,none));padding:0;transition:transform .2s;display:flex;position:absolute;left:50%;transform:translate(-50%)}div:not(:hover).minimized.micrio-tour{transform:translate3d(-50%, calc(100% + var(--micrio-border-margin)), 0);pointer-events:none}.serial-tour.micrio-tour>*{--micrio-background:none}.serial-tour.minimized.micrio-tour{transform:translate3d(0, calc(100% + var(--micrio-border-margin)), 0)}.serial-tour.micrio-tour,.video-tour.micrio-tour{width:500px}div.micrio-tour>*{--micrio-button-background:none}div.micrio-tour button{white-space:pre;--micrio-background-filter:none;--micrio-button-shadow:none;border:none;border-radius:0;margin:0}article.scroll-tour.micrio-tour{scroll-snap-type:y mandatory;width:100%;height:100%;position:absolute;top:0;left:0;overflow:hidden scroll}button.micrio-button.scroll-tour-end{position:absolute;top:5px;right:5px}article.micrio-tour>div.micrio-marker-popup{scroll-snap-align:center;margin:20cqh 50px 50cqh;position:relative!important}article.micrio-tour>div.micrio-marker-popup:nth-child(2n){margin-left:auto}article.micrio-tour>div.micrio-marker-popup>aside{display:none}div.micrio-dial{bottom:var(--micrio-border-margin);width:320px;max-width:calc(100vw - calc(2 * (var(--micrio-button-size) + 4 * var(--micrio-border-margin))));max-width:calc(100cqw - calc(2 * (var(--micrio-button-size) + 4 * var(--micrio-border-margin))));height:calc(var(--micrio-button-size) * .6);touch-action:none;cursor:w-resize;background-color:#0000;position:absolute;left:50%;overflow:hidden;transform:translate(-50%)}div.micrio-dial:before,div.micrio-dial:after{content:"";background-position:var(--micrio-dial-offset,0px);width:100%;display:block;position:absolute}div.micrio-dial:before{background-image:repeating-linear-gradient(90deg,#8888 0% .5%,#0000 1% 2.5%);height:50%;top:25%}div.micrio-dial:after{background-image:repeating-linear-gradient(90deg,#fff8 0% .5%,#0000 1% 20%);height:100%}span.micrio-dial{line-height:calc(var(--micrio-button-size) * .6);color:var(--micrio-color);opacity:.85;pointer-events:none;text-shadow:1px 1px 3px #000,-1px -1px 3px #000;font-size:smaller;display:block;position:absolute;bottom:0;left:50%;transform:translate(calc(5px - 50%))}ul.micrio-gallery{bottom:var(--micrio-border-margin);background:var(--micrio-button-background,var(--micrio-background,none));box-shadow:var(--micrio-button-shadow);-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);border-radius:var(--micrio-border-radius);height:var(--micrio-button-size);color:var(--micrio-color);touch-action:none;cursor:pointer;width:520px;max-width:calc(100cqw - 50px);margin:0;padding:0 16px;list-style-type:none;transition:transform .25s,opacity .25s;display:block;position:absolute;left:50%;transform:translate(-50%)}@media (width<=500px){ul.micrio-gallery{left:var(--micrio-border-margin);right:calc(var(--micrio-button-size) + var(--micrio-border-margin) * 2);width:auto;transform:none}}.track.micrio-gallery{background:var(--micrio-scrubber-background);pointer-events:none;border-radius:2px;height:2px;position:absolute;top:50%;left:16px;right:16px;overflow:hidden;transform:translateY(-50%)}.track-fill.micrio-gallery{background:var(--micrio-color);opacity:.85;border-radius:2px;height:100%;transition:width .15s;display:block;position:absolute;top:0;left:0}.ticks.micrio-gallery{pointer-events:none;position:absolute;inset:0 16px}.tick.micrio-gallery{background:var(--micrio-color);opacity:.55;border-radius:50%;width:6px;height:6px;transition:opacity .2s,transform .2s,background-color .2s;position:absolute;top:50%;transform:translate(-50%,-50%)}.tick.active.micrio-gallery{opacity:1;background:var(--micrio-color-hover,var(--micrio-color));transform:translate(-50%,-50%)scale(1.6)}@media (hover:hover){.tick.hover.micrio-gallery{opacity:1;transform:translate(-50%,-50%)scale(1.4)}}ul.dense.micrio-gallery .tick:where(.micrio-gallery){opacity:.35;border-radius:1px;width:1.5px;height:8px;transform:translate(-50%,-50%)}ul.dense.micrio-gallery .tick.major:where(.micrio-gallery){opacity:.6;height:12px}ul.dense.micrio-gallery .tick.active:where(.micrio-gallery){opacity:1;background:var(--micrio-color-hover,var(--micrio-color));width:2px;height:14px;transform:translate(-50%,-50%)}@media (hover:hover){ul.dense.micrio-gallery .tick.hover:where(.micrio-gallery){opacity:.9;transform:translate(-50%,-50%)}}.hover-label.micrio-gallery{font-variant-numeric:tabular-nums;color:var(--micrio-color);background:var(--micrio-popover-background);-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);box-shadow:var(--micrio-button-shadow);pointer-events:none;white-space:nowrap;border-radius:999px;padding:2px 8px;font-size:11px;font-weight:600;line-height:1.4;position:absolute;bottom:calc(100% + 6px);transform:translate(-50%)}.handle.micrio-gallery{box-sizing:border-box;background:var(--micrio-color);border:2px solid var(--micrio-color);cursor:ew-resize;touch-action:none;min-width:28px;height:28px;box-shadow:0 2px 8px #00000059, 0 0 0 0 var(--micrio-color-hover);border-radius:999px;padding:0;transition:left .15s,height .15s,min-width .15s,background-color .2s,box-shadow .2s;position:absolute;top:50%;left:0;transform:translate(-50%,-50%)}.handle.micrio-gallery:hover{box-shadow:0 2px 8px #0006,0 0 0 4px #ffffff1f}.handle.dragging.micrio-gallery{cursor:grabbing;transition:none;box-shadow:0 2px 12px #00000080,0 0 0 6px #ffffff26}.handle-label.micrio-gallery{font-variant-numeric:tabular-nums;color:var(--micrio-color);background:var(--micrio-popover-background);-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);box-shadow:var(--micrio-button-shadow);pointer-events:none;white-space:nowrap;border-radius:999px;padding:3px 9px;font-size:12px;font-weight:600;line-height:1.4;transition:left .15s,transform .15s;position:absolute;bottom:calc(100% + 8px);left:0;transform:translate(-50%)}.handle-label.dragging.micrio-gallery{transition:none;transform:translate(-50%)scale(1.05)}button.angular.micrio-gallery{width:var(--micrio-button-size);height:var(--micrio-button-size);background:var(--micrio-scrubber-background);border-radius:var(--micrio-border-radius);color:#444;cursor:move;border:none;padding:0;font-size:32px;line-height:42px;transition:background-color .2s;position:absolute;bottom:42px;left:50%;transform:translate(-50%)}button.angular.micrio-gallery:hover{background:#eee8}button.angular.dragging.micrio-gallery{transition:none}div.micrio-gallery{pointer-events:none;position:absolute;inset:0}div.micrio-gallery>*{pointer-events:auto}div.micrio-gallery>button.gallery-btn{transition:transform .25s,opacity .25s;position:absolute;top:50%;transform:translateY(-50%)}div.micrio-gallery>button.gallery-btn.arrow-left{left:var(--micrio-border-margin)}div.micrio-gallery>button.gallery-btn.arrow-right{right:var(--micrio-border-margin)}div.hidden.micrio-gallery:not(:hover)>ul{transform:translate(-50%, calc(100% + var(--micrio-border-margin)));opacity:0;pointer-events:none}@media (width<=500px){div.hidden.micrio-gallery:not(:hover)>ul{transform:translateY(calc(100% + var(--micrio-border-margin)))}}div.hidden.micrio-gallery:not(:hover)>button.gallery-btn.arrow-left{transform:translate(calc(-100% - var(--micrio-border-margin)), -50%);opacity:0;pointer-events:none}div.hidden.micrio-gallery:not(:hover)>button.gallery-btn.arrow-right{transform:translate(calc(100% + var(--micrio-border-margin)), -50%);opacity:0;pointer-events:none}div.micrio-gallery>button.gallery-btn:disabled{opacity:0;pointer-events:none}details.micrio-details{bottom:var(--micrio-border-margin);left:var(--micrio-border-margin);padding:var(--micrio-popup-padding);-webkit-user-select:text;user-select:text;white-space:normal;box-sizing:border-box;max-width:410px;color:var(--micrio-color);background:var(--micrio-background);-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);box-shadow:var(--micrio-popup-shadow);border-radius:var(--micrio-border-radius);font-size:.9em;transition:all .5s;position:absolute}details.micrio-details summary:where(.micrio-details){cursor:pointer;list-style:none}details.micrio-details summary:where(.micrio-details)::-webkit-details-marker{display:none}details.micrio-details small:where(.micrio-details){font-style:italic;font-weight:400;display:block}details.micrio-details>:where(.micrio-details){text-overflow:ellipsis;margin:0;overflow:hidden}details.micrio-details a{color:var(--micrio-color-hover,inherit)}details.micrio-details button{position:absolute;top:0;left:calc(100% + 8px)}@media (width<=600px){details.micrio-details{max-width:calc(100% - 10px)}details.micrio-details:not([open]) cite:where(.micrio-details){display:none}details.micrio-details:not([open]) summary:where(.micrio-details)::marker{content:"?";margin-right:5px;font-size:20px;font-weight:700;line-height:20px;display:inline-block}details.micrio-details:not([open]) summary:where(.micrio-details)::-webkit-details-marker{content:"?";margin-right:5px;font-size:20px;font-weight:700;line-height:20px;display:inline-block}details.micrio-details button{position:absolute;inset:auto 0 calc(100% + 8px) auto}}div.micrio-error{color:#fff;text-align:center;white-space:pre-wrap;-webkit-user-select:text;user-select:text;z-index:10;background:#000000bf;border:1px solid #fff;border-radius:5px;padding:10px;line-height:24px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}div.micrio-error svg{vertical-align:middle;width:24px;height:24px;fill:var(--micrio-color);margin-right:10px}@media screen and (width<=520px){div.micrio-error{box-sizing:border-box;width:90%}}figure.micrio-micrio-gallery{position:relative}micr-io.micrio-micrio-gallery{background:0 0;width:100%;height:100%;display:block}micr-io.micrio-micrio-gallery ul.micrio-gallery{--micrio-border-margin:16px}figcaption.micrio-micrio-gallery{top:var(--micrio-border-margin);left:var(--micrio-border-margin);padding:var(--micrio-popup-padding);box-sizing:border-box;max-width:410px;color:var(--micrio-color);background:var(--micrio-background);-webkit-backdrop-filter:var(--micrio-background-filter);backdrop-filter:var(--micrio-background-filter);box-shadow:var(--micrio-popup-shadow);border-radius:var(--micrio-border-radius);position:absolute}@media (width>=501px){micr-io.micrio-micrio-gallery:not(:fullscreen)>aside{position:fixed}}@media (width<=501px){figcaption.micrio-micrio-gallery{max-width:calc(100% - 3 * var(--micrio-border-margin) - var(--micrio-button-size))}}dialog.micrio-popover::backdrop{color:#fff;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);animation:.2s forwards micrio-popover-fadeInBg}@keyframes micrio-popover-fadeInBg{0%{background:0 0}to{background:var(--micrio-popover-background)}}@keyframes micrio-popover-fadeIn{0%{opacity:0}to{opacity:1}}dialog.micrio-popover{pointer-events:all;background:0 0;border:none;max-width:90cqw;max-height:90cqh;padding:0;animation:.5s forwards micrio-popover-fadeIn;overflow:visible}dialog.micrio-popover div.micrio-media>:first-child{border-radius:var(--micrio-border-radius);overflow:hidden}dialog.micrio-popover div.micrio-media>aside{--micrio-background:none;--micrio-button-background:none}dialog.page.article.micrio-popover figure.media-video iframe{width:100%}aside.micrio-popover{--micrio-background-filter:none;z-index:1;position:absolute}dialog.micrio-popover:not(.article){display:flex}dialog.micrio-popover:not(.article) figure>div.micrio-media{height:100%}@media (width>=640px){aside.micrio-popover{margin-left:var(--micrio-border-margin);display:block;top:0;left:100%}aside.inside.micrio-popover{margin-left:0;margin-top:var(--micrio-border-margin);margin-right:var(--micrio-border-margin);top:0;left:auto;right:0}aside.micrio-popover:not(.inside){z-index:2;position:absolute;top:0;left:100%}aside.micrio-popover>.micrio-button{margin:0 0 8px;padding:0;display:block}dialog.micrio-popover:not(.article){width:calc(85cqw - 56px);height:47.8125cqw}dialog.micrio-popover>main{width:25cqw;min-width:unset;max-width:320px}dialog.micrio-popover>main>h1{margin-right:55px}}@media (width<=639px){aside.micrio-popover{top:var(--micrio-border-margin);right:var(--micrio-border-margin);position:fixed}aside.micrio-popover .micrio-button{height:var(--micrio-button-size);box-shadow:var(--micrio-button-shadow);margin-left:8px;border-radius:var(--micrio-border-radius)!important;padding:0!important;display:inline-block!important}dialog.micrio-popover:not(.article){flex-direction:column;width:100%;height:100%}dialog.micrio-popover:not(.article) figure.micrio-media{flex:1}}dialog.micrio-popover>figure{flex:1;margin:0;position:relative}dialog.micrio-popover>figure>div.micrio-media>:first-child{width:100%;height:calc(100% - var(--micrio-button-size))}dialog.micrio-popover>figure>div.micrio-media>micr-io{height:100%!important}@media (aspect-ratio>=16/9){dialog.micrio-popover:not(.article){width:133.333cqh;height:75cqh}}@media (width<=639px){dialog.micrio-popover div.micrio-media>:first-child{border-radius:0}dialog.micrio-popover:not(.article)>:first-child{flex-direction:column;justify-content:center;height:50cqh}dialog.micrio-popover:not(.article)>figure:first-child{flex-direction:column;flex:none;display:flex}}dialog.article.micrio-popover>article{text-shadow:none;color:var(--micrio-color);background:var(--micrio-background);box-sizing:border-box;border-radius:var(--micrio-border-radius);max-height:calc(90vh - 48px);padding:20px;overflow:hidden auto}@media (width>=640px){dialog.article.micrio-popover{width:540px}}dialog.article.micrio-popover h2:where(.micrio-popover){text-align:center}dialog.article.micrio-popover article img{width:100%;height:auto}menu.micrio-popover{margin:10px 0;padding:0;list-style:none}menu.micrio-popover>.micrio-button{margin-right:10px}menu.right.micrio-popover{text-align:right}menu.right.micrio-popover>.micrio-button{margin:0 0 0 10px}dialog.gallery.micrio-popover{width:100%;height:100%;max-width:unset;max-height:unset}div.micrio-marker{transform:translate3d(calc(var(--x,0) - 50%), calc(var(--y,0) - 50%), 0) scale3d(var(--scale,1), var(--scale,1), 1);will-change:transform;display:block;position:absolute;top:0;left:0}div.micrio-marker:not(.cluster):not(.no-fade){animation:.25s forwards micrio-marker-fadeIn}div.overlapped.micrio-marker{display:none}@keyframes micrio-marker-fadeIn{0%{opacity:0}to{opacity:1}}div.behind.micrio-marker{pointer-events:none;opacity:0!important}div.mat3d.micrio-marker{transform:var(--mat);transform-style:preserve-3d;top:50%;left:50%}div.mat3d.micrio-marker>button:where(.micrio-marker){position:absolute;transform:translate(-50%,-50%)}button.micrio-marker{width:var(--micrio-marker-size);height:var(--micrio-marker-size);color:var(--micrio-marker-text-color);cursor:pointer;font:inherit;background:50% no-repeat;background-image:var(--micrio-marker-icon);background-size:contain;border:none;margin:0;padding:0;display:block;position:relative}div.micrio-marker:not(.cluster) label:where(.micrio-marker){text-align:var(--micrio-text-align);cursor:pointer;white-space:pre-wrap;width:max-content;max-width:170px;text-shadow:var(--micrio-marker-text-shadow);opacity:0;pointer-events:none;padding-left:10px;font-size:90%;font-weight:600;line-height:1em;transition:opacity .1s;position:absolute;top:50%;left:100%;transform:translateY(-50%)}div.micrio-marker:hover{z-index:2}.show-titles>div.micrio-marker label:where(.micrio-marker),div.micrio-marker:hover label:where(.micrio-marker){opacity:1}@media (width<=640px){div.micrio-marker:not(.cluster) label:where(.micrio-marker){font-size:12px}}.show-titles>div.micrio-marker label:where(.micrio-marker){pointer-events:all}label.static.micrio-marker{transform:translate(-50%, 4px) scale3d(calc(1 / var(--scale,1)), calc(1 / var(--scale,1)), 1)}div.default.micrio-marker button:where(.micrio-marker){box-sizing:content-box;border-radius:var(--micrio-marker-border-radius);border:var(--micrio-marker-border-size) solid var(--micrio-marker-border-color);transition:var(--micrio-marker-transition);background-clip:content-box;background-color:var(--micrio-marker-color)}div.default.micrio-marker:hover,div.default.hovered.micrio-marker,div.default.opened.micrio-marker{z-index:1}div.default.micrio-marker:hover button:where(.micrio-marker),div.default.hovered.micrio-marker button:where(.micrio-marker),div.default.opened.micrio-marker button:where(.micrio-marker){background-color:var(--micrio-marker-highlight);width:calc(var(--micrio-marker-size) + var(--micrio-marker-border-size) * 2);height:calc(var(--micrio-marker-size) + var(--micrio-marker-border-size) * 2);border-width:0}div.has-icon.micrio-marker button:where(.micrio-marker){--micrio-marker-icon:none}div.has-custom-icon.micrio-marker{--micrio-marker-size:32px}div.default.has-icon.micrio-marker button:where(.micrio-marker){color:#fff;width:calc(var(--micrio-marker-size) + 24px);height:calc(var(--micrio-marker-size) + 24px);background-color:var(--micrio-marker-border-color);border:none}div.default.has-icon.micrio-marker button:where(.micrio-marker)>svg{margin:0 auto}div.default.has-icon.opened.micrio-marker button:where(.micrio-marker)>svg,div.default.has-icon.hovered.micrio-marker button:where(.micrio-marker)>svg,div.default.has-icon.micrio-marker:hover button:where(.micrio-marker)>svg{color:var(--micrio-marker-highlight)}div.default.has-custom-icon.micrio-marker button:where(.micrio-marker){background-color:var(--micrio-marker-color)}div.default.has-custom-icon.opened.micrio-marker button:where(.micrio-marker),div.default.has-custom-icon.hovered.micrio-marker button:where(.micrio-marker),div.default.has-custom-icon.micrio-marker:hover button:where(.micrio-marker){background-color:var(--micrio-marker-highlight,var(--micrio-marker-color))}div.cluster.micrio-marker button:where(.micrio-marker){border:2px solid var(--micrio-marker-color);background:var(--micrio-cluster-marker-background,#fff);color:var(--micrio-cluster-marker-color,#000);width:calc(var(--micrio-marker-size) + 12px);height:calc(var(--micrio-marker-size) + 12px);box-sizing:content-box;border-radius:100%}div.cluster.micrio-marker:hover button:where(.micrio-marker){background:var(--micrio-marker-highlight,#fff);border-color:var(--micrio-marker-highlight,#fff)}div.cluster.micrio-marker label:where(.micrio-marker){pointer-events:none;display:none}div.micrio-marker img:where(.micrio-marker){max-width:100%;max-height:100%;margin:auto;display:block}div.micrio-waypoint{transform-style:preserve-3d;transform:var(--matrix);--micrio-bb:var(--micrio-button-background);--micrio-bbh:var(--micrio-button-background-hover);width:0;height:0;display:block;position:absolute;top:50%;left:50%}div.micrio-waypoint>button{--micrio-button-background:var(--micrio-waypoint-background,var(--micrio-bb));--micrio-button-background-hover:var(--micrio-waypoint-background-hover,var(--micrio-bbh));--micrio-button-size:var(--micrio-waypoint-size);--micrio-border-radius:var(--micrio-waypoint-border-radius,100%);--micrio-icon-size:var(--micrio-waypoint-icon-size,calc(var(--micrio-button-size) - 50px));pointer-events:all;border:var(--micrio-waypoint-border-size,var(--micrio-marker-border-size)) solid var(--micrio-waypoint-border-color,var(--micrio-marker-border-color));margin:0;transition:background-color .25s,opacity .25s,border-color .25s,transform .25s;transform:translate(-50%,-50%)scale(.5)}div.micrio-waypoint>button>svg{pointer-events:none;margin:0 auto}div.micrio-waypoint:hover>button,div.active.micrio-waypoint>button{transition:background-color .25s,opacity .25s,transform .25s;transform:translate(-50%,-50%)scale(.6)}div.clicked.micrio-waypoint>button{animation:.75s infinite alternate micrio-waypoint-pulse}@keyframes micrio-waypoint-pulse{0%{transform:translate(-50%,-50%)scale(.5)}to{transform:translate(-50%,-50%)scale(.75)}}.embed-container.micrio-embed{transform:translate3d(calc(var(--x,0) - 50%), calc(var(--y,0) - 50%), 0) scale3d(var(--s),var(--s),1);opacity:var(--opacity,1);will-change:transform, opacity;direction:ltr;display:block;position:absolute;top:0;left:0}.embed3d.micrio-embed{top:50%;left:50%}.embed-container.no-events.micrio-embed{pointer-events:none}.embed-container.micrio-embed>:where(.micrio-embed){cursor:pointer}.embed-container.micrio-embed>*{transform:translate3d(-50%,-50%,0) scale3d(var(--scale,1), var(--scale,1), 1);position:absolute}.embed-container.micrio-embed>:not(button){width:auto!important}.embed-container.micrio-embed:not(.no-events)>*{pointer-events:all}.embed-container.behind.micrio-embed>*{pointer-events:none}.embed-container.micrio-embed>img:where(.micrio-embed){max-width:none}.embed-container.micrio-embed>button{--scale:1;--ratio:1;width:100px;aspect-ratio:var(--ratio);background:0 0;border:none;margin:0;padding:0}.embed-container.micrio-embed>button,.embed-container.micrio-embed>img:where(.micrio-embed){touch-action:none}div.micrio-markers{pointer-events:none;will-change:width, height, top, left, opacity;width:100%;height:100%;perspective:inherit;position:absolute;top:0;left:0;overflow:hidden}div.micrio-markers:empty{display:none}div.micrio-markers>*{pointer-events:all}div.inactive.micrio-markers>*{pointer-events:none}div.is360.micrio-markers{transition:opacity .25s}div.is360.inactive.micrio-markers{opacity:0}aside.micrio-markers{pointer-events:none}aside.micrio-markers section:where(.micrio-markers){width:10cqw;min-width:200px;color:var(--micrio-marker-color);flex-direction:column;font-size:1em;font-weight:500;line-height:1em;display:flex;position:absolute;top:0;bottom:0}aside.micrio-markers section:where(.micrio-markers):first-child{align-items:flex-end;left:10px}aside.micrio-markers section:where(.micrio-markers):nth-child(2){align-items:flex-start;right:10px}aside.micrio-markers section:where(.micrio-markers) article:where(.micrio-markers){flex:1;align-items:center;max-height:30cqh;padding:10px;display:flex}aside.micrio-markers section:where(.micrio-markers) label:where(.micrio-markers){pointer-events:all;cursor:pointer;opacity:.75;max-width:160px;text-shadow:var(--micrio-marker-text-shadow);padding:10px;transition:opacity .25s,color .25s}label.hover.micrio-markers{color:var(--micrio-marker-highlight);opacity:1}aside.micrio-markers section:where(.micrio-markers):first-child article:where(.micrio-markers){justify-content:right}aside.micrio-markers section:where(.micrio-markers):first-child label:where(.micrio-markers){text-align:right}svg.micrio-markers{pointer-events:none;width:100%;height:100%;position:absolute}svg.micrio-markers line:where(.micrio-markers){stroke:var(--micrio-marker-highlight);stroke-width:2px}svg.micrio-markers line:where(.micrio-markers):not(.hovered){stroke:var(--micrio-marker-color);stroke-dasharray:10;stroke-width:1px;opacity:.75}svg.micrio-progress-circle{pointer-events:none;z-index:10;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)rotate(-90deg)}circle.micrio-progress-circle{transition:stroke-dashoffset .25s}
|
|
28
|
+
/*$vite$:1*/`;
|
|
29
|
+
document.head.insertBefore(_css,document.head.firstChild);
|
|
30
|
+
!function(){"undefined"!=typeof window&&((window.__svelte??={}).v??=new Set).add("5");var t={},e=Symbol(),i=(Symbol("filename"),"http://www.w3.org/2000/svg"),s=Array.isArray,r=Array.prototype.indexOf,n=Array.prototype.includes,a=Array.from,o=Object.keys,h=Object.defineProperty,c=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyDescriptors,d=Object.prototype,u=Array.prototype,m=Object.getPrototypeOf,g=Object.isExtensible;function p(t){return"function"==typeof t}var f=()=>{};function v(){var t,e;return{promise:new Promise((i,s)=>{t=i,e=s}),resolve:t,reject:e}}function w(t,e){if(Array.isArray(t))return t;if(void 0===e||!(Symbol.iterator in t))return Array.from(t);const i=[];for(const s of t)if(i.push(s),i.length===e)break;return i}var y=1024,b=2048,x=4096,T=8192,k=32768,_=1<<25,M=65536,S=1<<19,E=1<<25,I=65536,A=1<<21,L=1<<23,P=Symbol("$state"),$=Symbol("legacy props"),C=Symbol(""),D=(Symbol("proxy path"),Symbol("hmr anchor"),new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"}),z=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function O(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function R(t,e,i){throw new Error("https://svelte.dev/e/each_key_duplicate")}function X(t){console.warn("https://svelte.dev/e/hydration_mismatch")}var F,V=!1;function Y(t){V=t}function N(e){if(null===e)throw X(),t;return F=e}function B(){return N(Te(F))}function q(e){if(V){if(null!==Te(F))throw X(),t;F=e}}function W(t=1){if(V){for(var e=t,i=F;e--;)i=Te(i);F=i}}function U(t=!0){for(var e=0,i=F;;){if(8===i.nodeType){var s=i.data;if("]"===s){if(0===e)return i;e-=1}else("["===s||"[!"===s||"["===s[0]&&!isNaN(Number(s.slice(1))))&&(e+=1)}var r=Te(i);t&&i.remove(),i=r}}function H(e){if(!e||8!==e.nodeType)throw X(),t;return e.data}function G(t){return t===this.v}function j(t,e){return t!=t?e==e:t!==e||null!==t&&"object"==typeof t||"function"==typeof t}function Z(t){return!j(t,this.v)}var J=null;function K(t){J=t}function Q(t){return st("getContext").get(t)}function tt(t,e){return st("setContext").set(t,e),e}function et(t,e=!1,i){J={p:J,i:!1,c:null,e:null,s:t,x:null,r:hi,l:null}}function it(t){var e=J,i=e.e;if(null!==i)for(var s of(e.e=null,i))Xe(s);return void 0!==t&&(e.x=t),e.i=!0,J=e.p,t??{}}function st(t){return null===J&&O(),J.c??=new Map(function(t){let e=t.p;for(;null!==e;){const t=e.c;if(null!==t)return t;e=e.p}return null}(J)||void 0)}var rt=[];function nt(){var t=rt;rt=[],function(t){for(var e=0;e<t.length;e++)t[e]()}(t)}function at(t){if(0===rt.length&&!It){var e=rt;queueMicrotask(()=>{e===rt&&nt()})}rt.push(t)}function ot(){for(;rt.length>0;)nt()}function ht(t){var e=hi;if(null===e)return ni.f|=L,t;if(!(32768&e.f||4&e.f))throw t;ct(t,e)}function ct(t,e){for(;null!==e;){if(128&e.f){if(!(32768&e.f))throw t;try{return void e.b.error(t)}catch(i){t=i}}e=e.parent}throw t}var lt=-7169;function dt(t,e){t.f=t.f<|e}function ut(t){512&t.f||null===t.deps?dt(t,y):dt(t,x)}function mt(t){if(null!==t)for(const e of t)2&e.f&&65536&e.f&&(e.f^=I,mt(e.deps))}function gt(t,e,i){2048&t.f?e.add(t):4096&t.f&&i.add(t),mt(t.deps),dt(t,y)}function pt(t,e,i){if(null==t)return e(void 0),i&&i(void 0),f;const s=Li(()=>t.subscribe(e,i));return s.unsubscribe?()=>s.unsubscribe():s}var ft=[];function vt(t,e=f){let i=null;const s=new Set;function r(e){if(j(t,e)&&(t=e,i)){const e=!ft.length;for(const i of s)i[1](),ft.push(i,t);if(e){for(let t=0;t<ft.length;t+=2)ft[t][0](ft[t+1]);ft.length=0}}}function n(e){r(e(t))}return{set:r,update:n,subscribe:function(a,o=f){const h=[a,o];return s.add(h),1===s.size&&(i=e(r,n)||f),a(t),()=>{s.delete(h),0===s.size&&i&&(i(),i=null)}}}}function wt(t){let e;return pt(t,t=>e=t)(),e}var yt=!1,bt=Symbol();function xt(t,e,i){const s=i[e]??={store:null,source:ae(void 0),unsubscribe:f};if(s.store!==t&&!(bt in i))if(s.unsubscribe(),s.store=t??null,null==t)s.source.v=void 0,s.unsubscribe=f;else{var r=!0;s.unsubscribe=pt(t,t=>{r?s.source.v=t:oe(s.source,t)}),r=!1}return t&&bt in i?wt(t):Ei(s.source)}function Tt(t,e,i){let s=i[e];return s&&s.store!==t&&(s.unsubscribe(),s.unsubscribe=f),t}function kt(){const t={};return[t,function(){Oe(()=>{for(var e in t)t[e].unsubscribe();h(t,bt,{enumerable:!1,value:!0})})}]}var _t=new Set,Mt=null,St=null,Et=null,It=!1,At=!1,Lt=null,Pt=null,$t=0,Ct=1,Dt=class t{id=Ct++;current=new Map;previous=new Map;#t=new Set;#e=new Set;#i=new Set;#s=new Map;#r=new Map;#n=null;#a=[];#o=[];#h=new Set;#c=new Set;#l=new Map;#d=new Set;is_fork=!1;#u=!1;#m=new Set;#g(){return this.is_fork||this.#r.size>0}#p(){for(const i of this.#m)for(const s of i.#r.keys()){for(var t=!1,e=s;null!==e.parent;){if(this.#l.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(t){this.#l.has(t)||this.#l.set(t,{d:[],m:[]}),this.#d.delete(t)}unskip_effect(t,e=t=>this.schedule(t)){var i=this.#l.get(t);if(i){for(var s of(this.#l.delete(t),i.d))dt(s,b),e(s);for(s of i.m)dt(s,x),e(s)}this.#d.add(t)}#f(){if($t++>1e3&&(_t.delete(this),function(){try{!function(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}()}catch(t){0,ct(t,Et)}}()),!this.#g()){for(const t of this.#h)this.#c.delete(t),dt(t,b),this.schedule(t);for(const t of this.#c)dt(t,x),this.schedule(t)}const e=this.#a;this.#a=[],this.apply();var i=Lt=[],s=[],r=Pt=[];for(const t of e)try{this.#v(t,i,s)}catch(o){throw Nt(t),o}if(Mt=null,r.length>0){var n=t.ensure();for(const t of r)n.schedule(t)}if(Lt=null,Pt=null,this.#g()||this.#p()){this.#w(s),this.#w(i);for(const[t,e]of this.#l)Yt(t,e)}else{0===this.#s.size&&_t.delete(this),this.#h.clear(),this.#c.clear();for(const t of this.#t)t(this);this.#t.clear(),Rt(s),Rt(i),this.#n?.resolve()}var a=Mt;if(this.#a.length>0){const t=a??=this;t.#a.push(...this.#a.filter(e=>!t.#a.includes(e)))}null!==a&&(_t.add(a),a.#f())}#v(t,e,i){t.f^=y;for(var s=t.first;null!==s;){var r=s.f,n=!!(96&r);if(!(n&&1024&r||8192&r||this.#l.has(s))&&null!==s.fn){n?s.f^=y:4&r?e.push(s):bi(s)&&(16&r&&this.#c.add(s),Mi(s));var a=s.first;if(null!==a){s=a;continue}}for(;null!==s;){var o=s.next;if(null!==o){s=o;break}s=s.parent}}}#w(t){for(var e=0;e<t.length;e+=1)gt(t[e],this.#h,this.#c)}capture(t,i,s=!1){t.v===e||this.previous.has(t)||this.previous.set(t,t.v),8388608&t.f||(this.current.set(t,[i,s]),St?.set(t,i)),this.is_fork||(t.v=i)}activate(){Mt=this}deactivate(){Mt=null,St=null}flush(){try{At=!0,Mt=this,this.#f()}finally{$t=0,Et=null,Lt=null,Pt=null,At=!1,Mt=null,St=null,ie.clear()}}discard(){for(const t of this.#e)t(this);this.#e.clear(),this.#i.clear(),_t.delete(this)}register_created_effect(t){this.#o.push(t)}#y(){for(const c of _t){var t=c.id<this.id,e=[];for(const[s,[r,n]]of this.current){if(c.current.has(s)){var i=c.current.get(s)[0];if(!t||r===i)continue;c.current.set(s,[r,n])}e.push(s)}var s=[...c.current.keys()].filter(t=>!this.current.has(t));if(0===s.length)t&&c.discard();else if(e.length>0){if(t)for(const t of this.#d)c.unskip_effect(t,t=>{4194320&t.f?c.schedule(t):c.#w([t])});c.activate();var r=new Set,n=new Map;for(var a of e)Xt(a,s,r,n);n=new Map;var o=[...c.current.keys()].filter(t=>!this.current.has(t)||this.current.get(t)[0]!==t);for(const t of this.#o)155648&t.f||!Ft(t,o,n)||(4194320&t.f?(dt(t,b),c.schedule(t)):c.#h.add(t));if(c.#a.length>0){for(var h of(c.apply(),c.#a))c.#v(h,[],[]);c.#a=[]}c.deactivate()}}for(const c of _t)c.#m.has(this)&&(c.#m.delete(this),0!==c.#m.size||c.#g()||(c.activate(),c.#f()))}increment(t,e){let i=this.#s.get(e)??0;if(this.#s.set(e,i+1),t){let t=this.#r.get(e)??0;this.#r.set(e,t+1)}}decrement(t,e,i){let s=this.#s.get(e)??0;if(1===s?this.#s.delete(e):this.#s.set(e,s-1),t){let t=this.#r.get(e)??0;1===t?this.#r.delete(e):this.#r.set(e,t-1)}this.#u||i||(this.#u=!0,at(()=>{this.#u=!1,this.flush()}))}transfer_effects(t,e){for(const i of t)this.#h.add(i);for(const i of e)this.#c.add(i);t.clear(),e.clear()}oncommit(t){this.#t.add(t)}ondiscard(t){this.#e.add(t)}on_fork_commit(t){this.#i.add(t)}run_fork_commit_callbacks(){for(const t of this.#i)t(this);this.#i.clear()}settled(){return(this.#n??=v()).promise}static ensure(){if(null===Mt){const e=Mt=new t;At||(_t.add(Mt),It||at(()=>{Mt===e&&e.flush()}))}return Mt}apply(){St=null}schedule(t){if(Et=t,!(t.b?.is_pending&&16777228&t.f)||32768&t.f){for(var e=t;null!==e.parent;){var i=(e=e.parent).f;if(!(null===Lt||e!==hi||null!==ni&&2&ni.f))return;if(96&i){if(!(1024&i))return;e.f^=y}}this.#a.push(e)}else t.b.defer_effect(t)}};function zt(t){var e=It;It=!0;try{var i;for(t&&(null===Mt||Mt.is_fork||Mt.flush(),i=t());;){if(ot(),null===Mt)return i;Mt.flush()}}finally{It=e}}var Ot=null;function Rt(t){var e=t.length;if(0!==e){for(var i=0;i<e;){var s=t[i++];if(!(24576&s.f)&&bi(s)&&(Ot=new Set,Mi(s),null===s.deps&&null===s.first&&null===s.nodes&&null===s.teardown&&null===s.ac&&je(s),Ot?.size>0)){ie.clear();for(const t of Ot){if(24576&t.f)continue;const e=[t];let i=t.parent;for(;null!==i;)Ot.has(i)&&(Ot.delete(i),e.push(i)),i=i.parent;for(let t=e.length-1;t>=0;t--){const i=e[t];24576&i.f||Mi(i)}}Ot.clear()}}Ot=null}}function Xt(t,e,i,s){if(!i.has(t)&&(i.add(t),null!==t.reactions))for(const r of t.reactions){const t=r.f;2&t?Xt(r,e,i,s):4194320&t&&!(2048&t)&&Ft(r,e,s)&&(dt(r,b),Vt(r))}}function Ft(t,e,i){const s=i.get(t);if(void 0!==s)return s;if(null!==t.deps)for(const r of t.deps){if(n.call(e,r))return!0;if(2&r.f&&Ft(r,e,i))return i.set(r,!0),!0}return i.set(t,!1),!1}function Vt(t){Mt.schedule(t)}function Yt(t,e){if(!(32&t.f&&1024&t.f)){2048&t.f?e.d.push(t):4096&t.f&&e.m.push(t),dt(t,y);for(var i=t.first;null!==i;)Yt(i,e),i=i.next}}function Nt(t){dt(t,y);for(var e=t.first;null!==e;)Nt(e),e=e.next}var Bt=class{parent;is_pending=!1;transform_error;#b;#x=V?F:null;#T;#k;#_;#M=null;#S=null;#E=null;#I=null;#A=0;#L=0;#P=!1;#h=new Set;#c=new Set;#$=null;#C=function(t){let e,i=0,s=re(0);return()=>{ze()&&(Ei(s),Ve(()=>(0===i&&(e=Li(()=>t(()=>le(s)))),i+=1,()=>{at(()=>{i-=1,0===i&&(e?.(),e=void 0,le(s))})})))}}(()=>(this.#$=re(this.#A),()=>{this.#$=null}));constructor(t,e,i,s){this.#b=t,this.#T=e,this.#k=t=>{var e=hi;e.b=this,e.f|=128,i(t)},this.parent=hi.b,this.transform_error=s??this.parent?.transform_error??(t=>t),this.#_=Ne(()=>{if(V){const t=this.#x;B();const e="[!"===t.data;if(t.data.startsWith("[?")){const e=JSON.parse(t.data.slice(2));this.#D(e)}else e?this.#z():this.#O()}else this.#R()},589824),V&&(this.#b=F)}#O(){try{this.#M=qe(()=>this.#k(this.#b))}catch(t){this.error(t)}}#D(t){const e=this.#T.failed;e&&(this.#E=qe(()=>{e(this.#b,()=>t,()=>()=>{})}))}#z(){const t=this.#T.pending;t&&(this.is_pending=!0,this.#S=qe(()=>t(this.#b)),at(()=>{var t=this.#I=document.createDocumentFragment(),e=be();t.append(e),this.#M=this.#X(()=>qe(()=>this.#k(e))),0===this.#L&&(this.#b.before(t),this.#I=null,Ze(this.#S,()=>{this.#S=null}),this.#F(Mt))}))}#R(){try{if(this.is_pending=this.has_pending_snippet(),this.#L=0,this.#A=0,this.#M=qe(()=>{this.#k(this.#b)}),this.#L>0){var t=this.#I=document.createDocumentFragment();ti(this.#M,t);const e=this.#T.pending;this.#S=qe(()=>e(this.#b))}else this.#F(Mt)}catch(e){this.error(e)}}#F(t){this.is_pending=!1,t.transfer_effects(this.#h,this.#c)}defer_effect(t){gt(t,this.#h,this.#c)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#T.pending}#X(t){var e=hi,i=ni,s=J;ci(this.#_),oi(this.#_),K(this.#_.ctx);try{return Dt.ensure(),t()}catch(r){return ht(r),null}finally{ci(e),oi(i),K(s)}}#V(t,e){this.has_pending_snippet()?(this.#L+=t,0===this.#L&&(this.#F(e),this.#S&&Ze(this.#S,()=>{this.#S=null}),this.#I&&(this.#b.before(this.#I),this.#I=null))):this.parent&&this.parent.#V(t,e)}update_pending_count(t,e){this.#V(t,e),this.#A+=t,this.#$&&!this.#P&&(this.#P=!0,at(()=>{this.#P=!1,this.#$&&he(this.#$,this.#A)}))}get_effect_pending(){return this.#C(),Ei(this.#$)}error(t){if(!this.#T.onerror&&!this.#T.failed)throw t;Mt?.is_fork?(this.#M&&Mt.skip_effect(this.#M),this.#S&&Mt.skip_effect(this.#S),this.#E&&Mt.skip_effect(this.#E),Mt.on_fork_commit(()=>{this.#Y(t)})):this.#Y(t)}#Y(t){this.#M&&(He(this.#M),this.#M=null),this.#S&&(He(this.#S),this.#S=null),this.#E&&(He(this.#E),this.#E=null),V&&(N(this.#x),W(),N(U()));var e=this.#T.onerror;let i=this.#T.failed;var s=!1,r=!1;const n=()=>{s?console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"):(s=!0,r&&function(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}(),null!==this.#E&&Ze(this.#E,()=>{this.#E=null}),this.#X(()=>{this.#R()}))},a=s=>{try{r=!0,e?.(s,n),r=!1}catch(t){ct(t,this.#_&&this.#_.parent)}i&&(this.#E=this.#X(()=>{try{return qe(()=>{var t=hi;t.b=this,t.f|=128,i(this.#b,()=>s,()=>n)})}catch(t){return ct(t,this.#_.parent),null}}))};at(()=>{var e;try{e=this.transform_error(t)}catch(i){return void ct(i,this.#_&&this.#_.parent)}null!==e&&"object"==typeof e&&"function"==typeof e.then?e.then(a,t=>ct(t,this.#_&&this.#_.parent)):a(e)})}};function qt(t,e,i,s){const r=Ht;var n=t.filter(t=>!t.settled);if(0!==i.length||0!==n.length){var a=hi,o=function(){var t=hi,e=ni,i=J,s=Mt;return function(r=!0){ci(t),oi(e),K(i),!r||16384&t.f||(s?.activate(),s?.apply())}}(),h=1===n.length?n[0].promise:n.length>1?Promise.all(n.map(t=>t.promise)):null;if(0!==i.length){var c=Ut();h?h.then(()=>{o(),d(),Wt()}):d()}else h.then(()=>l(e.map(r)))}else s(e.map(r));function l(t){o();try{s(t)}catch(e){16384&a.f||ct(e,a)}Wt()}function d(){Promise.all(i.map(t=>Gt(t))).then(t=>l([...e.map(r),...t])).catch(t=>ct(t,a)).finally(()=>c())}}function Wt(t=!0){ci(null),oi(null),K(null),t&&Mt?.deactivate()}function Ut(){var t=hi,e=t.b,i=Mt,s=e.is_rendered();return e.update_pending_count(1,i),i.increment(s,t),(r=!1)=>{e.update_pending_count(-1,i),i.decrement(s,t,r)}}function Ht(t){null!==hi&&(hi.f|=S);const i={ctx:J,deps:null,effects:null,equals:G,f:2050,fn:t,reactions:null,rv:0,v:e,wv:0,parent:hi,ac:null};return i}function Gt(t,i,s){let r=hi;null===r&&function(){throw new Error("https://svelte.dev/e/async_derived_orphan")}();var n=void 0,a=re(e);var o=!ni,h=new Map;return function(t){De(4718592,t)}(()=>{var e=hi;var i=v();n=i.promise;try{Promise.resolve(t()).then(i.resolve,i.reject).finally(Wt)}catch(d){i.reject(d),Wt()}var s=Mt;if(o){if(32768&e.f)var c=Ut();if(r.b.is_rendered())h.get(s)?.reject(D),h.delete(s);else{for(const t of h.values())t.reject(D);h.clear()}h.set(s,i)}const l=(t,i=void 0)=>{if(c&&c(i===D),!(i===D||16384&e.f)){if(s.activate(),i)a.f|=L,he(a,i);else{8388608&a.f&&(a.f^=L),he(a,t);for(const[t,e]of h){if(h.delete(t),t===s)break;e.reject(D)}0}s.deactivate()}};i.promise.then(l,t=>l(null,t||"unknown"))}),Oe(()=>{for(const t of h.values())t.reject(D)}),new Promise(t=>{!function e(i){function s(){i===n?t(a):e(n)}i.then(s,s)}(n)})}function jt(t){const e=Ht(t);return di(e),e}function Zt(t){const e=Ht(t);return e.equals=Z,e}function Jt(t){var e=t.effects;if(null!==e){t.effects=null;for(var i=0;i<e.length;i+=1)He(e[i])}}function Kt(t){var e,i=hi,s=t.parent;if(!si&&null!==s&&24576&s.f)return console.warn("https://svelte.dev/e/derived_inert"),t.v;ci(s);try{t.f&=-65537,Jt(t),e=Ti(t)}finally{ci(i)}return e}function Qt(t){var e=Kt(t);t.equals(e)||(t.wv=yi(),Mt?.is_fork&&null!==t.deps||(null!==Mt?Mt.capture(t,e,!0):t.v=e,null!==t.deps))?si||(null!==St?(ze()||Mt?.is_fork)&&St.set(t,e):ut(t)):dt(t,y)}function te(t){if(null!==t.effects)for(const e of t.effects)e.teardown&&Mi(e)}var ee=new Set,ie=new Map;var se=!1;function re(t,e){var i={f:0,v:t,reactions:null,equals:G,rv:0,wv:0};return i}function ne(t,e){const i=re(t);return di(i),i}function ae(t,e=!1,i=!0){const s=re(t);return e||(s.equals=Z),s}function oe(t,e,i=!1){null!==ni&&(!ai||131072&ni.f)&&4325394&ni.f&&(null===li||!n.call(li,t))&&function(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}();let s=i?ue(e):e;return he(t,s,Pt)}function he(t,e,i=null){if(!t.equals(e)){ie.set(t,si?e:t.v);var s=Dt.ensure();if(s.capture(t,e),2&t.f){const e=t;2048&t.f&&Kt(e),null===St&&ut(e)}t.wv=yi(),de(t,b,i),null!==hi&&1024&hi.f&&!(96&hi.f)&&(null===gi?function(t){gi=t}([t]):gi.push(t)),!s.is_fork&&ee.size>0&&!se&&ce()}return e}function ce(){se=!1;for(const t of ee)1024&t.f&&dt(t,x),bi(t)&&Mi(t);ee.clear()}function le(t){oe(t,t.v+1)}function de(t,e,i){var s=t.reactions;if(null!==s)for(var r=s.length,n=0;n<r;n++){var a=s[n],o=a.f;0;var h=0===(o&b);if(h&&dt(a,e),2&o){var c=a;St?.delete(c),65536&o||(512&o&&(a.f|=I),de(c,x,i))}else if(h){var l=a;16&o&&null!==Ot&&Ot.add(l),null!==i?i.push(l):Vt(l)}}}function ue(t){if("object"!=typeof t||null===t||P in t)return t;const i=m(t);if(i!==d&&i!==u)return t;var r=new Map,n=s(t),a=ne(0),o=vi,h=t=>{if(vi===o)return t();var e=ni,i=vi;oi(null),wi(o);var s=t();return oi(e),wi(i),s};n&&r.set("length",ne(t.length));return new Proxy(t,{defineProperty(t,e,i){"value"in i&&!1!==i.configurable&&!1!==i.enumerable&&!1!==i.writable||function(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}();var s=r.get(e);return void 0===s?h(()=>{var t=ne(i.value);return r.set(e,t),t}):oe(s,i.value,!0),!0},deleteProperty(t,i){var s=r.get(i);if(void 0===s){if(i in t){const t=h(()=>ne(e));r.set(i,t),le(a)}}else oe(s,e),le(a);return!0},get(i,s,n){if(s===P)return t;var a=r.get(s),o=s in i;if(void 0!==a||o&&!c(i,s)?.writable||(a=h(()=>{var t=ne(ue(o?i[s]:e));return t}),r.set(s,a)),void 0!==a){var l=Ei(a);return l===e?void 0:l}return Reflect.get(i,s,n)},getOwnPropertyDescriptor(t,i){var s=Reflect.getOwnPropertyDescriptor(t,i);if(s&&"value"in s){var n=r.get(i);n&&(s.value=Ei(n))}else if(void 0===s){var a=r.get(i),o=a?.v;if(void 0!==a&&o!==e)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return s},has(t,i){if(i===P)return!0;var s=r.get(i),n=void 0!==s&&s.v!==e||Reflect.has(t,i);return!((void 0!==s||null!==hi&&(!n||c(t,i)?.writable))&&(void 0===s&&(s=h(()=>{var s=ne(n?ue(t[i]):e);return s}),r.set(i,s)),Ei(s)===e))&&n},set(t,i,s,o){var l=r.get(i),d=i in t;if(n&&"length"===i)for(var u=s;u<l.v;u+=1){var m=r.get(u+"");void 0!==m?oe(m,e):u in t&&(m=h(()=>ne(e)),r.set(u+"",m))}void 0===l?d&&!c(t,i)?.writable||(oe(l=h(()=>ne(void 0)),ue(s)),r.set(i,l)):(d=l.v!==e,oe(l,h(()=>ue(s))));var g=Reflect.getOwnPropertyDescriptor(t,i);if(g?.set&&g.set.call(o,s),!d){if(n&&"string"==typeof i){var p=r.get("length"),f=Number(i);Number.isInteger(f)&&f>=p.v&&oe(p,f+1)}le(a)}return!0},ownKeys(t){Ei(a);var i=Reflect.ownKeys(t).filter(t=>{var i=r.get(t);return void 0===i||i.v!==e});for(var[s,n]of r)n.v===e||s in t||i.push(s);return i},setPrototypeOf(){!function(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}()}})}function me(t){try{if(null!==t&&"object"==typeof t&&P in t)return t[P]}catch{}return t}function ge(t,e){return Object.is(me(t),me(e))}var pe,fe,ve,we;new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function ye(){if(void 0===pe){pe=window,document,fe=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,i=Text.prototype;ve=c(e,"firstChild").get,we=c(e,"nextSibling").get,g(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),g(i)&&(i.__t=void 0)}}function be(t=""){return document.createTextNode(t)}function xe(t){return ve.call(t)}function Te(t){return we.call(t)}function ke(t,e){if(!V)return xe(t);var i=xe(F);if(null===i)i=F.appendChild(be());else if(e&&3!==i.nodeType){var s=be();return i?.before(s),N(s),s}return e&&Ie(i),N(i),i}function _e(t,e=!1){if(!V){var i=xe(t);return i instanceof Comment&&""===i.data?Te(i):i}if(e){if(3!==F?.nodeType){var s=be();return F?.before(s),N(s),s}Ie(F)}return F}function Me(t,e=1,i=!1){let s=V?F:t;for(var r;e--;)r=s,s=Te(s);if(!V)return s;if(i){if(3!==s?.nodeType){var n=be();return null===s?r?.after(n):s.before(n),N(n),n}Ie(s)}return N(s),s}function Se(t){t.textContent=""}function Ee(t,e,i){let s=i?{is:i}:void 0;return document.createElementNS(e??"http://www.w3.org/1999/xhtml",t,s)}function Ie(t){if(t.nodeValue.length<65536)return;let e=t.nextSibling;for(;null!==e&&3===e.nodeType;)e.remove(),t.nodeValue+=e.nodeValue,e=t.nextSibling}function Ae(t,e){if(e){const e=document.body;t.autofocus=!0,at(()=>{document.activeElement===e&&t.focus()})}}var Le=!1;function Pe(t,e,i,s=!0){for(var r of(s&&i(),e))t.addEventListener(r,i);Oe(()=>{for(var s of e)t.removeEventListener(s,i)})}function $e(t){var e=ni,i=hi;oi(null),ci(null);try{return t()}finally{oi(e),ci(i)}}function Ce(t){null===hi&&(null===ni&&function(){throw new Error("https://svelte.dev/e/effect_orphan")}(),function(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}()),si&&function(){throw new Error("https://svelte.dev/e/effect_in_teardown")}()}function De(t,e){var i=hi;null!==i&&8192&i.f&&(t|=T);var s={ctx:J,deps:null,nodes:null,f:t|b|512,first:null,fn:e,last:null,next:null,parent:i,b:i&&i.b,prev:null,teardown:null,wv:0,ac:null};Mt?.register_created_effect(s);var r=s;if(4&t)null!==Lt?Lt.push(s):Dt.ensure().schedule(s);else if(null!==e){try{Mi(s)}catch(r){throw He(s),r}null!==r.deps||null!==r.teardown||null!==r.nodes||r.first!==r.last||524288&r.f||(r=r.first,16&t&&65536&t&&null!==r&&(r.f|=M))}if(null!==r&&(r.parent=i,null!==i&&function(t,e){var i=e.last;null===i?e.last=e.first=t:(i.next=t,t.prev=i,e.last=t)}(r,i),null!==ni&&2&ni.f&&!(64&t))){var n=ni;(n.effects??=[]).push(r)}return s}function ze(){return null!==ni&&!ai}function Oe(t){const e=De(8,null);return dt(e,y),e.teardown=t,e}function Re(t){Ce();var e=hi.f;if(ni||!(32&e)||32768&e)return Xe(t);var i=J;(i.e??=[]).push(t)}function Xe(t){return De(1048580,t)}function Fe(t){return De(4,t)}function Ve(t,e=0){return De(8|e,t)}function Ye(t,e=[],i=[],s=[]){qt(s,e,i,e=>{De(8,()=>t(...e.map(Ei)))})}function Ne(t,e=0){var i=De(16|e,t);return i}function Be(t,e=0){var i=De(16777216|e,t);return i}function qe(t){return De(524320,t)}function We(t){var e=t.teardown;if(null!==e){const t=si,i=ni;ri(!0),oi(null);try{e.call(null)}finally{ri(t),oi(i)}}}function Ue(t,e=!1){var i=t.first;for(t.first=t.last=null;null!==i;){const t=i.ac;null!==t&&$e(()=>{t.abort(D)});var s=i.next;64&i.f?i.parent=null:He(i,e),i=s}}function He(t,e=!0){var i=!1;(e||262144&t.f)&&null!==t.nodes&&null!==t.nodes.end&&(Ge(t.nodes.start,t.nodes.end),i=!0),dt(t,_),Ue(t,e&&!i),_i(t,0);var s=t.nodes&&t.nodes.t;if(null!==s)for(const n of s)n.stop();We(t),t.f^=_,t.f|=16384;var r=t.parent;null!==r&&null!==r.first&&je(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function Ge(t,e){for(;null!==t;){var i=t===e?null:Te(t);t.remove(),t=i}}function je(t){var e=t.parent,i=t.prev,s=t.next;null!==i&&(i.next=s),null!==s&&(s.prev=i),null!==e&&(e.first===t&&(e.first=s),e.last===t&&(e.last=i))}function Ze(t,e,i=!0){var s=[];Je(t,s,!0);var r=()=>{i&&He(t),e&&e()},n=s.length;if(n>0){var a=()=>--n||r();for(var o of s)o.out(a)}else r()}function Je(t,e,i){if(!(8192&t.f)){t.f^=T;var s=t.nodes&&t.nodes.t;if(null!==s)for(const t of s)(t.is_global||i)&&e.push(t);for(var r=t.first;null!==r;){var n=r.next;if(!(64&r.f))Je(r,e,!!(!!(65536&r.f)||!!(32&r.f)&&!!(16&t.f))&&i);r=n}}}function Ke(t){Qe(t,!0)}function Qe(t,e){if(8192&t.f){t.f^=T,1024&t.f||(dt(t,b),Dt.ensure().schedule(t));for(var i=t.first;null!==i;){var s=i.next;Qe(i,!!(!!(65536&i.f)||!!(32&i.f))&&e),i=s}var r=t.nodes&&t.nodes.t;if(null!==r)for(const t of r)(t.is_global||e)&&t.in()}}function ti(t,e){if(t.nodes)for(var i=t.nodes.start,s=t.nodes.end;null!==i;){var r=i===s?null:Te(i);e.append(i),i=r}}var ei=null,ii=!1,si=!1;function ri(t){si=t}var ni=null,ai=!1;function oi(t){ni=t}var hi=null;function ci(t){hi=t}var li=null;function di(t){null!==ni&&(null===li?li=[t]:li.push(t))}var ui=null,mi=0,gi=null;var pi=1,fi=0,vi=fi;function wi(t){vi=t}function yi(){return++pi}function bi(t){var e=t.f;if(2048&e)return!0;if(2&e&&(t.f&=-65537),4096&e){for(var i=t.deps,s=i.length,r=0;r<s;r++){var n=i[r];if(bi(n)&&Qt(n),n.wv>t.wv)return!0}512&e&&null===St&&dt(t,y)}return!1}function xi(t,e,i=!0){var s=t.reactions;if(null!==s&&(null===li||!n.call(li,t)))for(var r=0;r<s.length;r++){var a=s[r];2&a.f?xi(a,e,!1):e===a&&(i?dt(a,b):1024&a.f&&dt(a,x),Vt(a))}}function Ti(t){var e=ui,i=mi,s=gi,r=ni,n=li,a=J,o=ai,h=vi,c=t.f;ui=null,mi=0,gi=null,ni=96&c?null:t,li=null,K(t.ctx),ai=!1,vi=++fi,null!==t.ac&&($e(()=>{t.ac.abort(D)}),t.ac=null);try{t.f|=A;var l=(0,t.fn)();t.f|=k;var d=t.deps,u=Mt?.is_fork;if(null!==ui){var m;if(u||_i(t,mi),null!==d&&mi>0)for(d.length=mi+ui.length,m=0;m<ui.length;m++)d[mi+m]=ui[m];else t.deps=d=ui;if(ze()&&512&t.f)for(m=mi;m<d.length;m++)(d[m].reactions??=[]).push(t)}else!u&&null!==d&&mi<d.length&&(_i(t,mi),d.length=mi);if(!(null===gi||ai||null===d||6146&t.f))for(m=0;m<gi.length;m++)xi(gi[m],t);if(null!==r&&r!==t){if(fi++,null!==r.deps)for(let t=0;t<i;t+=1)r.deps[t].rv=fi;if(null!==e)for(const t of e)t.rv=fi;null!==gi&&(null===s?s=gi:s.push(...gi))}return 8388608&t.f&&(t.f^=L),l}catch(g){return ht(g)}finally{t.f^=A,ui=e,mi=i,gi=s,ni=r,li=n,K(a),ai=o,vi=h}}function ki(t,i){let s=i.reactions;if(null!==s){var a=r.call(s,t);if(-1!==a){var o=s.length-1;0===o?s=i.reactions=null:(s[a]=s[o],s.pop())}}if(null===s&&2&i.f&&(null===ui||!n.call(ui,i))){var h=i;512&h.f&&(h.f^=512,h.f&=-65537),h.v!==e&&ut(h),function(t){if(null!==t.effects)for(const e of t.effects)(e.teardown||e.ac)&&(e.teardown?.(),e.ac?.abort(D),e.teardown=f,e.ac=null,_i(e,0),Ue(e))}(h),_i(h,0)}}function _i(t,e){var i=t.deps;if(null!==i)for(var s=e;s<i.length;s++)ki(t,i[s])}function Mi(t){var e=t.f;if(!(16384&e)){dt(t,y);var i=hi,s=ii;hi=t,ii=!0;try{16777232&e?function(t){for(var e=t.first;null!==e;){var i=e.next;32&e.f||He(e),e=i}}(t):Ue(t),We(t);var r=Ti(t);t.teardown="function"==typeof r?r:null,t.wv=pi}finally{ii=s,hi=i}}}async function Si(){await Promise.resolve(),zt()}function Ei(t){var e=!!(2&t.f);if(ei?.add(t),null!==ni&&!ai&&!(null!==hi&&16384&hi.f||null!==li&&n.call(li,t))){var i=ni.deps;if(2097152&ni.f)t.rv<fi&&(t.rv=fi,null===ui&&null!==i&&i[mi]===t?mi++:null===ui?ui=[t]:ui.push(t));else{(ni.deps??=[]).push(t);var s=t.reactions;null===s?t.reactions=[ni]:n.call(s,ni)||s.push(ni)}}if(si&&ie.has(t))return ie.get(t);if(e){var r=t;if(si){var a=r.v;return(1024&r.f||null===r.reactions)&&!Ai(r)||(a=Kt(r)),ie.set(r,a),a}var o=!(512&r.f)&&!ai&&null!==ni&&(ii||!!(512&ni.f)),h=0===(r.f&k);bi(r)&&(o&&(r.f|=512),Qt(r)),o&&!h&&(te(r),Ii(r))}if(St?.has(t))return St.get(t);if(8388608&t.f)throw t.v;return t.v}function Ii(t){if(t.f|=512,null!==t.deps)for(const e of t.deps)(e.reactions??=[]).push(t),2&e.f&&!(512&e.f)&&(te(e),Ii(e))}function Ai(t){if(t.v===e)return!0;if(null===t.deps)return!1;for(const e of t.deps){if(ie.has(e))return!0;if(2&e.f&&Ai(e))return!0}return!1}function Li(t){var e=ai;try{return ai=!0,t()}finally{ai=e}}function Pi(t,e=new Set){if(!("object"!=typeof t||null===t||t instanceof EventTarget||e.has(t))){e.add(t),t instanceof Date&&t.getTime();for(let r in t)try{Pi(t[r],e)}catch(i){}const s=m(t);if(s!==Object.prototype&&s!==Array.prototype&&s!==Map.prototype&&s!==Set.prototype&&s!==Date.prototype){const e=l(s);for(let s in e){const r=e[s].get;if(r)try{r.call(t)}catch(i){}}}}}var $i=Symbol("events"),Ci=new Set,Di=new Set;function zi(t,e,i,s={}){function r(t){if(s.capture||Fi.call(e,t),!t.cancelBubble)return $e(()=>i?.call(this,t))}return t.startsWith("pointer")||t.startsWith("touch")||"wheel"===t?at(()=>{e.addEventListener(t,r,s)}):e.addEventListener(t,r,s),r}function Oi(t,e,i,s,r){var n={capture:s,passive:r},a=zi(t,e,i,n);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Oe(()=>{e.removeEventListener(t,a,n)})}function Ri(t,e,i){(e[$i]??={})[t]=i}function Xi(t){for(var e=0;e<t.length;e++)Ci.add(t[e]);for(var i of Di)i(t)}function Fi(t){var e=this,i=e.ownerDocument,s=t.type,r=t.composedPath?.()||[],n=r[0]||t.target,a=0,o=t===t&&t[$i];if(o){var c=r.indexOf(o);if(-1!==c&&(e===document||e===window))return void(t[$i]=e);var l=r.indexOf(e);if(-1===l)return;c<=l&&(a=c)}if((n=r[a]||t.target)!==e){h(t,"currentTarget",{configurable:!0,get:()=>n||i});var d=ni,u=hi;oi(null),ci(null);try{for(var m,g=[];null!==n;){var p=n.assignedSlot||n.parentNode||n.host||null;try{var f=n[$i]?.[s];null==f||n.disabled&&t.target!==n||f.call(n,t)}catch(v){m?g.push(v):m=v}if(t.cancelBubble||p===e||null===p)break;n=p}if(m){for(let t of g)queueMicrotask(()=>{throw t});throw m}}finally{t[$i]=e,delete t.currentTarget,oi(d),ci(u)}}}var Vi=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function Yi(t){var e=Ee("template");return e.innerHTML=function(t){return Vi?.createHTML(t)??t}(t.replaceAll("<!>","\x3c!----\x3e")),e.content}function Ni(t,e){var i=hi;null===i.nodes&&(i.nodes={start:t,end:e,a:null,t:null})}function Bi(t,e){var i,s=!!(1&e),r=!!(2&e),n=!t.startsWith("<!>");return()=>{if(V)return Ni(F,null),F;void 0===i&&(i=Yi(n?t:"<!>"+t),s||(i=xe(i)));var e=r||fe?document.importNode(i,!0):i.cloneNode(!0);s?Ni(xe(e),e.lastChild):Ni(e,e);return e}}function qi(t,e,i="svg"){var s,r=!t.startsWith("<!>"),n=!!(1&e),a=`<${i}>${r?t:"<!>"+t}</${i}>`;return()=>{if(V)return Ni(F,null),F;if(!s){var t=xe(Yi(a));if(n)for(s=document.createDocumentFragment();xe(t);)s.appendChild(xe(t));else s=xe(t)}var e=s.cloneNode(!0);n?Ni(xe(e),e.lastChild):Ni(e,e);return e}}function Wi(t,e){return qi(t,e,"svg")}function Ui(t=""){if(!V){var e=be(t+"");return Ni(e,e),e}var i=F;return 3!==i.nodeType?(i.before(i=be()),N(i)):Ie(i),Ni(i,i),i}function Hi(){if(V)return Ni(F,null),F;var t=document.createDocumentFragment(),e=document.createComment(""),i=be();return t.append(e,i),Ni(e,i),t}function Gi(t,e){if(V){var i=hi;return 32768&i.f&&null!==i.nodes.end||(i.nodes.end=F),void B()}null!==t&&t.before(e)}function ji(t){return t.endsWith("capture")&&"gotpointercapture"!==t&&"lostpointercapture"!==t}var Zi=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Ji(t){return Zi.includes(t)}var Ki={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Qi(t){return t=t.toLowerCase(),Ki[t]??t}var ts=["touchstart","touchmove"];function es(t){return ts.includes(t)}var is=["textarea","script","style","title"];var ss=!0;function rs(t){ss=t}function ns(t,e){var i=null==e?"":"object"==typeof e?`${e}`:e;i!==(t.__t??=t.nodeValue)&&(t.__t=i,t.nodeValue=`${i}`)}function as(t,e){return cs(t,e)}function os(e,i){ye(),i.intro=i.intro??!1;const s=i.target,r=V,n=F;try{for(var a=xe(s);a&&(8!==a.nodeType||"["!==a.data);)a=Te(a);if(!a)throw t;Y(!0),N(a);const r=cs(e,{...i,anchor:a});return Y(!1),r}catch(o){if(o instanceof Error&&o.message.split("\n").some(t=>t.startsWith("https://svelte.dev/e/")))throw o;return o!==t&&console.warn("Failed to hydrate: ",o),!1===i.recover&&function(){throw new Error("https://svelte.dev/e/hydration_failed")}(),ye(),Se(s),Y(!1),as(e,i)}finally{Y(r),N(n)}}var hs=new Map;function cs(e,{target:i,anchor:s,props:r={},events:n,context:o,intro:h=!0,transformError:c}){ye();var l=void 0,d=function(t){Dt.ensure();const e=De(524352,t);return(t={})=>new Promise(i=>{t.outro?Ze(e,()=>{He(e),i(void 0)}):(He(e),i(void 0))})}(()=>{var d=s??i.appendChild(be());!function(t,e,i,s){new Bt(t,e,i,s)}(d,{pending:()=>{}},i=>{if(et({}),o&&(J.c=o),n&&(r.$$events=n),V&&Ni(i,null),ss=h,l=e(i,r)||{},ss=!0,V&&(hi.nodes.end=F,null===F||8!==F.nodeType||"]"!==F.data))throw X(),t;it()},c);var u=new Set,m=t=>{for(var e=0;e<t.length;e++){var s=t[e];if(!u.has(s)){u.add(s);var r=es(s);for(const t of[i,document]){var n=hs.get(t);void 0===n&&(n=new Map,hs.set(t,n));var a=n.get(s);void 0===a?(t.addEventListener(s,Fi,{passive:r}),n.set(s,1)):n.set(s,a+1)}}}};return m(a(Ci)),Di.add(m),()=>{for(var t of u)for(const s of[i,document]){var e=hs.get(s),r=e.get(t);0==--r?(s.removeEventListener(t,Fi),e.delete(t),0===e.size&&hs.delete(s)):e.set(t,r)}Di.delete(m),d!==s&&d.parentNode?.removeChild(d)}});return ls.set(l,d),l}var ls=new WeakMap;function ds(t,e){const i=ls.get(t);return i?(ls.delete(t),i(e)):Promise.resolve()}var us,ms=class{anchor;#N=new Map;#B=new Map;#q=new Map;#W=new Set;#U=!0;constructor(t,e=!0){this.anchor=t,this.#U=e}#y=t=>{if(this.#N.has(t)){var e=this.#N.get(t),i=this.#B.get(e);if(i)Ke(i),this.#W.delete(e);else{var s=this.#q.get(e);s&&(this.#B.set(e,s.effect),this.#q.delete(e),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),i=s.effect)}for(const[e,i]of this.#N){if(this.#N.delete(e),e===t)break;const s=this.#q.get(i);s&&(He(s.effect),this.#q.delete(i))}for(const[t,s]of this.#B){if(t===e||this.#W.has(t))continue;const r=()=>{if(Array.from(this.#N.values()).includes(t)){var e=document.createDocumentFragment();ti(s,e),e.append(be()),this.#q.set(t,{effect:s,fragment:e})}else He(s);this.#W.delete(t),this.#B.delete(t)};this.#U||!i?(this.#W.add(t),Ze(s,r,!1)):r()}}};#H=t=>{this.#N.delete(t);const e=Array.from(this.#N.values());for(const[i,s]of this.#q)e.includes(i)||(He(s.effect),this.#q.delete(i))};ensure(t,e){var i=Mt;!e||this.#B.has(t)||this.#q.has(t)||this.#B.set(t,qe(()=>e(this.anchor)));this.#N.set(i,t),V&&(this.anchor=F),this.#y(i)}};function gs(t,e,...i){var s=new ms(t);Ne(()=>{const t=e()??null;s.ensure(t,t&&(e=>t(e,...i)))},M)}function ps(t){null===J&&O(),Re(()=>{const e=Li(t);if("function"==typeof e)return e})}function fs(t){null===J&&O(),ps(()=>()=>Li(t))}function vs(t,e,i=!1){var s;V&&(s=F,B());var r=new ms(t);function n(t,e){if(V){var i=H(s);if(t!==parseInt(i.substring(1))){var n=U();return N(n),r.anchor=n,Y(!1),r.ensure(t,e),void Y(!0)}}r.ensure(t,e)}Ne(()=>{var t=!1;e((e,i=0)=>{t=!0,n(i,e)}),t||n(-1,null)},i?M:0)}function ws(t,e){return e}function ys(t,e,i=!0){var s;if(t.pending.size>0){s=new Set;for(const e of t.pending.values())for(const i of e)s.add(t.items.get(i).e)}for(var r=0;r<e.length;r++){var n=e[r];s?.has(n)?(n.f|=E,ti(n,document.createDocumentFragment())):He(e[r],i)}}function bs(t,e,i,r,n,o=null){var h=t,c=new Map;if(4&e){var l=t;h=V?N(xe(l)):l.appendChild(be())}V&&B();var d,u=null,m=Zt(()=>{var t=i();return s(t)?t:null==t?[]:a(t)});var g=new Map,p=!0;function f(t){16384&v.effect.f||(v.pending.delete(t),v.fallback=u,function(t,e,i,s,r){var n,o,h,c,l,d=!!(8&s),u=e.length,m=t.items,g=xs(t.effect.first),p=null,f=[],v=[];if(d)for(l=0;l<u;l+=1)h=r(e[l],l),33554432&(c=m.get(h).e).f||(c.nodes?.a?.measure(),(o??=new Set).add(c));for(l=0;l<u;l+=1){if(h=r(e[l],l),c=m.get(h).e,null!==t.outrogroups)for(const e of t.outrogroups)e.pending.delete(c),e.done.delete(c);if(8192&c.f&&(Ke(c),d&&(c.nodes?.a?.unfix(),(o??=new Set).delete(c))),33554432&c.f){if(c.f^=E,c!==g){var w=p?p.next:g;c===t.effect.last&&(t.effect.last=c.prev),c.prev&&(c.prev.next=c.next),c.next&&(c.next.prev=c.prev),_s(t,p,c),_s(t,c,w),ks(c,w,i),f=[],v=[],g=xs((p=c).next);continue}ks(c,null,i)}if(c!==g){if(void 0!==n&&n.has(c)){if(f.length<v.length){var y,b=v[0];p=b.prev;var x=f[0],T=f[f.length-1];for(y=0;y<f.length;y+=1)ks(f[y],b,i);for(y=0;y<v.length;y+=1)n.delete(v[y]);_s(t,x.prev,T.next),_s(t,p,x),_s(t,T,b),g=b,p=T,l-=1,f=[],v=[]}else n.delete(c),ks(c,g,i),_s(t,c.prev,c.next),_s(t,c,null===p?t.effect.first:p.next),_s(t,p,c),p=c;continue}for(f=[],v=[];null!==g&&g!==c;)(n??=new Set).add(g),v.push(g),g=xs(g.next);if(null===g)continue}33554432&c.f||f.push(c),p=c,g=xs(c.next)}if(null!==t.outrogroups){for(const e of t.outrogroups)0===e.pending.size&&(ys(t,a(e.done)),t.outrogroups?.delete(e));0===t.outrogroups.size&&(t.outrogroups=null)}if(null!==g||void 0!==n){var k=[];if(void 0!==n)for(c of n)8192&c.f||k.push(c);for(;null!==g;)8192&g.f||g===t.fallback||k.push(g),g=xs(g.next);var _=k.length;if(_>0){var M=4&s&&0===u?i:null;if(d){for(l=0;l<_;l+=1)k[l].nodes?.a?.measure();for(l=0;l<_;l+=1)k[l].nodes?.a?.fix()}!function(t,e,i){for(var s,r=e.length,n=e.length,o=0;o<r;o++){let i=e[o];Ze(i,()=>{if(s){if(s.pending.delete(i),s.done.add(i),0===s.pending.size){var e=t.outrogroups;ys(t,a(s.done)),e.delete(s),0===e.size&&(t.outrogroups=null)}}else n-=1},!1)}if(0===n){var h=null!==i;if(h){var c=i,l=c.parentNode;Se(l),l.append(c),t.items.clear()}ys(t,e,!h)}else s={pending:new Set(e),done:new Set},(t.outrogroups??=new Set).add(s)}(t,k,M)}}d&&at(()=>{if(void 0!==o)for(c of o)c.nodes?.a?.apply()})}(v,d,h,e,r),null!==u&&(0===d.length?33554432&u.f?(u.f^=E,ks(u,null,h)):Ke(u):Ze(u,()=>{u=null})))}var v={effect:Ne(()=>{var t=(d=Ei(m)).length;let s=!1;V&&"[!"===H(h)!=(0===t)&&(N(h=U()),Y(!1),s=!0);for(var a=new Set,l=Mt,v=0;v<t;v+=1){V&&8===F.nodeType&&"]"===F.data&&(h=F,s=!0,Y(!1));var w=d[v],y=r(w,v),b=p?null:c.get(y);b?(b.v&&he(b.v,w),b.i&&he(b.i,v)):(b=Ts(c,p?h:us??=be(),w,y,v,n,e,i),p||(b.e.f|=E),c.set(y,b)),a.add(y)}0===t&&o&&!u&&(p?u=qe(()=>o(h)):(u=qe(()=>o(us??=be()))).f|=E),t>a.size&&R(),V&&t>0&&N(U()),p||(g.set(l,a),f(l)),s&&Y(!0),Ei(m)}),flags:e,items:c,pending:g,outrogroups:null,fallback:u};p=!1,V&&(h=F)}function xs(t){for(;null!==t&&!(32&t.f);)t=t.next;return t}function Ts(t,e,i,s,r,n,a,o){var h=1&a?16&a?re(i):ae(i,!1,!1):null,c=2&a?re(r):null;return{v:h,i:c,e:qe(()=>(n(e,h??i,c??r,o),()=>{t.delete(s)}))}}function ks(t,e,i){if(t.nodes)for(var s=t.nodes.start,r=t.nodes.end,n=!e||33554432&e.f?i:e.nodes.start;null!==s;){var a=Te(s);if(n.before(s),s===r)return;s=a}}function _s(t,e,i){null===e?t.effect.first=i:e.next=i,null===i?t.effect.last=e:i.prev=e}function Ms(e,s,r=!1,n=!1,a=!1,o=!1){var h=e,c="";if(r){var l=e;V&&(h=N(xe(l)))}Ye(()=>{var e=hi;if(c!==(c=s()??"")){if(r&&!V)return e.nodes=null,l.innerHTML=c,void(""!==c&&Ni(xe(l),l.lastChild));if(null!==e.nodes&&(Ge(e.nodes.start,e.nodes.end),e.nodes=null),""!==c){if(V){F.data;for(var o=B(),d=o;null!==o&&(8!==o.nodeType||""!==o.data);)d=o,o=Te(o);if(null===o)throw X(),t;return Ni(F,d),void(h=N(o))}var u=Ee(n?"svg":a?"math":"template",n?i:a?"http://www.w3.org/1998/Math/MathML":void 0);u.innerHTML=c;var m=n||a?u:u.content;if(Ni(xe(m),m.lastChild),n||a)for(;xe(m);)h.before(xe(m));else h.before(m)}}else V&&B()})}var Ss=()=>performance.now(),Es={tick:t=>requestAnimationFrame(t),now:()=>Ss(),tasks:new Set};function Is(){const t=Es.now();Es.tasks.forEach(e=>{e.c(t)||(Es.tasks.delete(e),e.f())}),0!==Es.tasks.size&&Es.tick(Is)}function As(t,e){$e(()=>{t.dispatchEvent(new CustomEvent(e))})}function Ls(t){if("float"===t)return"cssFloat";if("offset"===t)return"cssOffset";if(t.startsWith("--"))return t;const e=t.split("-");return 1===e.length?e[0]:e[0]+e.slice(1).map(t=>t[0].toUpperCase()+t.slice(1)).join("")}function Ps(t){const e={},i=t.split(";");for(const s of i){const[t,i]=s.split(":");if(!t||void 0===i)break;e[Ls(t.trim())]=i.trim()}return e}var $s=t=>t;function Cs(t){0}function Ds(t,e,i,s){var r,n,a,o=!!(1&t),h=!!(2&t),c=!!(4&t),l=o&&h?"both":o?"in":"out",d=e.inert,u=e.style.overflow;function m(){return $e(()=>r??=i()(e,s?.()??{},{direction:l}))}var g={is_global:c,in(){if(e.inert=d,!o)return a?.abort(),void a?.reset?.();h||n?.abort(),n=zs(e,m(),a,1,()=>{As(e,"introend"),n?.abort(),n=r=void 0,e.style.overflow=u})},out(t){if(!h)return t?.(),void(r=void 0);e.inert=!0,a=zs(e,m(),n,0,()=>{As(e,"outroend"),t?.()})},stop:()=>{n?.abort(),a?.abort()}},p=hi;if((p.nodes.t??=[]).push(g),o&&ss){var f=c;if(!f){for(var v=p.parent;v&&65536&v.f;)for(;(v=v.parent)&&!(16&v.f););f=!v||!!(32768&v.f)}f&&Fe(()=>{Li(()=>g.in())})}}function zs(t,e,i,s,r){var n=1===s;if(p(e)){var a,o=!1;return at(()=>{o||(a=zs(t,e({direction:n?"in":"out"}),i,s,r))}),{abort:()=>{o=!0,a?.abort()},deactivate:()=>a.deactivate(),reset:()=>a.reset(),t:()=>a.t()}}if(i?.deactivate(),!e?.duration&&!e?.delay)return As(t,n?"introstart":"outrostart"),r(),{abort:f,deactivate:f,reset:f,t:()=>s};const{delay:h=0,css:c,tick:l,easing:d=$s}=e;var u=[];if(n&&void 0===i&&(l&&l(0,1),c)){var m=Ps(c(0,1));u.push(m,m)}var g=()=>1-s,v=t.animate(u,{duration:h,fill:"forwards"});return v.onfinish=()=>{v.cancel(),As(t,n?"introstart":"outrostart");var a=i?.t()??1-s;i?.abort();var o=s-a,h=e.duration*Math.abs(o),u=[];if(h>0){var m=!1;if(c)for(var p=Math.ceil(h/(1e3/60)),f=0;f<=p;f+=1){var w=a+o*d(f/p),y=Ps(c(w,1-w));u.push(y),m||="hidden"===y.overflow}m&&(t.style.overflow="hidden"),g=()=>{var t=v.currentTime;return a+o*d(t/h)},l&&function(t){let e;0===Es.tasks.size&&Es.tick(Is),new Promise(i=>{Es.tasks.add(e={c:t,f:i})})}(()=>{if("running"!==v.playState)return!1;var t=g();return l(t,1-t),!0})}(v=t.animate(u,{duration:h,fill:"forwards"})).onfinish=()=>{g=()=>s,l?.(s,1-s),r()}},{abort:()=>{v&&(v.cancel(),v.effect=null,v.onfinish=f)},deactivate:()=>{r=f},reset:()=>{0===s&&l?.(1,0)},t:()=>g()}}function Os(t,e,s,r,n,a){let o=V;V&&B();var h=null;V&&1===F.nodeType&&(h=F,B());var c=V?F:t,l=hi,d=new ms(c,!1);Ne(()=>{const t=e()||null;var a=n?n():s||"svg"===t?i:void 0;return null===t?(d.ensure(null,null),void rs(!0)):(d.ensure(t,e=>{if(t){if(Ni(h=V?h:Ee(t,a),h),r){V&&(s=t,is.includes(s))&&h.append(document.createComment(""));var i=V?xe(h):h.appendChild(be());V&&(null===i?Y(!1):N(i)),Cs(l),r(h,i),Cs(null)}hi.nodes.end=h,e.before(h)}var s;V&&N(e)}),rs(!0),()=>{t&&rs(!1)})},M),Oe(()=>{rs(!0)}),o&&(Y(!0),N(c))}function Rs(t,e,i){Fe(()=>{var s=Li(()=>e(t,i?.())||{});if(i&&s?.update){var r=!1,n={};Ve(()=>{var t=i();!function(t){if("object"==typeof t&&t&&!(t instanceof EventTarget))if(P in t)Pi(t);else if(!Array.isArray(t))for(let e in t){const i=t[e];"object"==typeof i&&i&&P in i&&Pi(i)}}(t),r&&j(n,t)&&(n=t,s.update(t))}),r=!0}if(s?.destroy)return()=>s.destroy()})}function Xs(t,e){var i,s=void 0;Be(()=>{s!==(s=e())&&(i&&(He(i),i=null),s&&(i=qe(()=>{Fe(()=>s(t))})))})}function Fs(t){var e,i,s="";if("string"==typeof t||"number"==typeof t)s+=t;else if("object"==typeof t)if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(i=Fs(t[e]))&&(s&&(s+=" "),s+=i)}else for(i in t)t[i]&&(s&&(s+=" "),s+=i);return s}function Vs(t){return"object"==typeof t?function(){for(var t,e,i=0,s="",r=arguments.length;i<r;i++)(t=arguments[i])&&(e=Fs(t))&&(s&&(s+=" "),s+=e);return s}(t):t??""}var Ys=[..." \t\n\r\f \v\ufeff"];function Ns(t,e=!1){var i=e?" !important;":";",s="";for(var r of Object.keys(t)){var n=t[r];null!=n&&""!==n&&(s+=" "+r+": "+n+i)}return s}function Bs(t){return"-"!==t[0]||"-"!==t[1]?t.toLowerCase():t}function qs(t,e,i,s,r,n){var a=t.__className;if(V||a!==i||void 0===a){var o=function(t,e,i){var s=null==t?"":""+t;if(e&&(s=s?s+" "+e:e),i)for(var r of Object.keys(i))if(i[r])s=s?s+" "+r:r;else if(s.length)for(var n=r.length,a=0;(a=s.indexOf(r,a))>=0;){var o=a+n;0!==a&&!Ys.includes(s[a-1])||o!==s.length&&!Ys.includes(s[o])?a=o:s=(0===a?"":s.substring(0,a))+s.substring(o+1)}return""===s?null:s}(i,s,n);V&&o===t.getAttribute("class")||(null==o?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o)),t.__className=i}else if(n&&r!==n)for(var h in n){var c=!!n[h];null!=r&&c===!!r[h]||t.classList.toggle(h,c)}return n}function Ws(t,e={},i,s){for(var r in i){var n=i[r];e[r]!==n&&(null==i[r]?t.style.removeProperty(r):t.style.setProperty(r,n,s))}}function Us(t,e,i,s){var r=t.__style;if(V||r!==e){var n=function(t,e){if(e){var i,s,r="";if(Array.isArray(e)?(i=e[0],s=e[1]):i=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var n=!1,a=0,o=!1,h=[];i&&h.push(...Object.keys(i).map(Bs)),s&&h.push(...Object.keys(s).map(Bs));var c=0,l=-1;const e=t.length;for(var d=0;d<e;d++){var u=t[d];if(o?"/"===u&&"*"===t[d-1]&&(o=!1):n?n===u&&(n=!1):"/"===u&&"*"===t[d+1]?o=!0:'"'===u||"'"===u?n=u:"("===u?a++:")"===u&&a--,!o&&!1===n&&0===a)if(":"===u&&-1===l)l=d;else if(";"===u||d===e-1){if(-1!==l){var m=Bs(t.substring(c,l).trim());h.includes(m)||(";"!==u&&d++,r+=" "+t.substring(c,d).trim()+";")}c=d+1,l=-1}}}return i&&(r+=Ns(i)),s&&(r+=Ns(s,!0)),""===(r=r.trim())?null:r}return null==t?null:String(t)}(e,s);V&&n===t.getAttribute("style")||(null==n?t.removeAttribute("style"):t.style.cssText=n),t.__style=e}else s&&(Array.isArray(s)?(Ws(t,i?.[0],s[0]),Ws(t,i?.[1],s[1],"important")):Ws(t,i,s));return s}function Hs(t,e,i=!1){if(t.multiple){if(null==e)return;if(!s(e))return void console.warn("https://svelte.dev/e/select_multiple_invalid_value");for(var r of t.options)r.selected=e.includes(Gs(r))}else{for(r of t.options)if(ge(Gs(r),e))return void(r.selected=!0);i&&void 0===e||(t.selectedIndex=-1)}}function Gs(t){return"__value"in t?t.__value:t.value}var js=Symbol("class"),Zs=Symbol("style"),Js=Symbol("is custom element"),Ks=Symbol("is html"),Qs=z?"link":"LINK",tr=z?"input":"INPUT",er=z?"option":"OPTION",ir=z?"select":"SELECT",sr=z?"progress":"PROGRESS";function rr(t){if(V){var e=!1,i=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var i=t.value;ar(t,"value",null),t.value=i}if(t.hasAttribute("checked")){var s=t.checked;ar(t,"checked",null),t.checked=s}}};t.__on_r=i,at(i),Le||(Le=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{if(!t.defaultPrevented)for(const e of t.target.elements)e.__on_r?.()})},{capture:!0}))}}function nr(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function ar(t,e,i,s){var r=cr(t);V&&(r[e]=t.getAttribute(e),"src"===e||"srcset"===e||"href"===e&&t.nodeName===Qs)||r[e]!==(r[e]=i)&&("loading"===e&&(t[C]=i),null==i?t.removeAttribute(e):"string"!=typeof i&&dr(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function or(t,e,i){var s=ni,r=hi;let n=V;V&&Y(!1),oi(null),ci(null);try{"style"!==e&&(lr.has(t.getAttribute("is")||t.nodeName)||!customElements||customElements.get(t.getAttribute("is")||t.nodeName.toLowerCase())?dr(t).includes(e):i&&"object"==typeof i)?t[e]=i:ar(t,e,null==i?i:String(i))}finally{oi(s),ci(r),n&&Y(!0)}}function hr(t,i,s=[],r=[],n=[],a,o=!1,h=!1){qt(n,s,r,s=>{var r=void 0,n={},c=t.nodeName===ir,l=!1;if(Be(()=>{var d=i(...s.map(Ei)),u=function(t,i,s,r,n=!1){if(V&&n&&t.nodeName===tr){var a=t;("checkbox"===a.type?"defaultChecked":"defaultValue")in s||rr(a)}var o=cr(t),h=o[Js],c=!o[Ks];let l=V&&h;l&&Y(!1);var d=i||{},u=t.nodeName===er;for(var m in i)m in s||(s[m]=null);s.class?s.class=Vs(s.class):(r||s[js])&&(s.class=null),s[Zs]&&(s.style??=null);var g=dr(t);for(const x in s){let T=s[x];if(u&&"value"===x&&null==T)t.value=t.__value="",d[x]=T;else if("class"!==x)if("style"!==x){var p=d[x];if(T!==p||void 0===T&&t.hasAttribute(x)){d[x]=T;var f=x[0]+x[1];if("$$"!==f)if("on"===f){const k={},_="$$"+x;let M=x.slice(2);var v=Ji(M);if(ji(M)&&(M=M.slice(0,-7),k.capture=!0),!v&&p){if(null!=T)continue;t.removeEventListener(M,d[_],k),d[_]=null}if(v)Ri(M,t,T),Xi([M]);else if(null!=T){function w(t){d[x].call(this,t)}d[_]=zi(M,t,w,k)}}else if("style"===x)ar(t,x,T);else if("autofocus"===x)Ae(t,Boolean(T));else if(h||"__value"!==x&&("value"!==x||null==T))if("selected"===x&&u)nr(t,T);else{var y=x;c||(y=Qi(y));var b="defaultValue"===y||"defaultChecked"===y;if(null!=T||h||b)b||g.includes(y)&&(h||"string"!=typeof T)?(t[y]=T,y in o&&(o[y]=e)):"function"!=typeof T&&ar(t,y,T);else if(o[x]=null,"value"===y||"checked"===y){let S=t;const E=void 0===i;if("value"===y){let I=S.defaultValue;S.removeAttribute(y),S.defaultValue=I,S.value=S.__value=E?I:null}else{let A=S.defaultChecked;S.removeAttribute(y),S.defaultChecked=A,S.checked=!!E&&A}}else t.removeAttribute(x)}else t.value=t.__value=T}}else Us(t,T,i?.[Zs],s[Zs]),d[x]=T,d[Zs]=s[Zs];else qs(t,"http://www.w3.org/1999/xhtml"===t.namespaceURI,T,r,i?.[js],s[js]),d[x]=T,d[js]=s[js]}return l&&Y(!0),d}(t,r,d,a,o,h);l&&c&&"value"in d&&Hs(t,d.value);for(let t of Object.getOwnPropertySymbols(n))d[t]||He(n[t]);for(let e of Object.getOwnPropertySymbols(d)){var m=d[e];"@attach"!==e.description||r&&m===r[e]||(n[e]&&He(n[e]),n[e]=qe(()=>Xs(t,()=>m))),u[e]=m}r=u}),c){var d=t;Fe(()=>{Hs(d,r.value,!0),function(t){var e=new MutationObserver(()=>{Hs(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Oe(()=>{e.disconnect()})}(d)})}l=!0})}function cr(t){return t.__attributes??={[Js]:t.nodeName.includes("-"),[Ks]:"http://www.w3.org/1999/xhtml"===t.namespaceURI}}var lr=new Map;function dr(t){var e,i=t.getAttribute("is")||t.nodeName,s=lr.get(i);if(s)return s;lr.set(i,s=[]);for(var r=t,n=Element.prototype;n!==r;){for(var a in e=l(r))e[a].set&&s.push(a);r=m(r)}return s}function ur(t,e,i=e){var s,r,n=()=>{cancelAnimationFrame(s),t.paused||(s=requestAnimationFrame(n));var e=t.currentTime;r!==e&&i(r=e)};s=requestAnimationFrame(n),t.addEventListener("timeupdate",n),Ve(()=>{var i=Number(e());r===i||isNaN(i)||(t.currentTime=r=i)}),Oe(()=>{cancelAnimationFrame(s),t.removeEventListener("timeupdate",n)})}function mr(t,e){Pe(t,["seeking","seeked"],()=>e(t.seeking))}function gr(t,e,i=e){var s=e();Pe(t,["play","pause","canplay"],()=>{s!==t.paused&&i(s=t.paused)},null==s),Fe(()=>{(s=!!e())!==t.paused&&(s?t.pause():t.play().catch(t=>{throw i(s=!0),t}))})}function pr(t,e){return t===e||t?.[P]===e}function fr(t={},e,i,s){var r=J.r,n=hi;return Fe(()=>{var a,o;return Ve(()=>{a=o,o=s?.()||[],Li(()=>{t!==i(...o)&&(e(t,...o),a&&pr(i(...a),t)&&e(null,...a))})}),()=>{let s=n;for(;s!==r&&null!==s.parent&&33554432&s.parent.f;)s=s.parent;const a=s.teardown;s.teardown=()=>{o&&pr(i(...o),t)&&e(null,...o),a?.()}}}),t}function vr(t,e,i,s,r){var n=()=>{s(i[t])};i.addEventListener(e,n),r?Ve(()=>{i[t]=r()}):n(),i!==document.body&&i!==window&&i!==document||Oe(()=>{i.removeEventListener(e,n)})}var wr={get(t,e){let i=t.props.length;for(;i--;){let s=t.props[i];if(p(s)&&(s=s()),"object"==typeof s&&null!==s&&e in s)return s[e]}},set(t,e,i){let s=t.props.length;for(;s--;){let r=t.props[s];p(r)&&(r=r());const n=c(r,e);if(n&&n.set)return n.set(i),!0}return!1},getOwnPropertyDescriptor(t,e){let i=t.props.length;for(;i--;){let s=t.props[i];if(p(s)&&(s=s()),"object"==typeof s&&null!==s&&e in s){const t=c(s,e);return t&&!t.configurable&&(t.configurable=!0),t}}},has(t,e){if(e===P||e===$)return!1;for(let i of t.props)if(p(i)&&(i=i()),null!=i&&e in i)return!0;return!1},ownKeys(t){const e=[];for(let i of t.props)if(p(i)&&(i=i()),i){for(const t in i)e.includes(t)||e.push(t);for(const t of Object.getOwnPropertySymbols(i))e.includes(t)||e.push(t)}return e}};function yr(...t){return new Proxy({props:t},wr)}function br(t,e,i,s){var r=!!(8&i),n=!!(16&i),a=s,o=!0,h=()=>(o&&(o=!1,a=n?Li(s):s),a);let l;if(r){var d=P in t||$ in t;l=c(t,e)?.set??(d&&e in t?i=>t[e]=i:void 0)}var u,m,g=!1;if(r?[u,g]=function(t){var e=yt;try{return yt=!1,[t(),yt]}finally{yt=e}}(()=>t[e]):u=t[e],void 0===u&&void 0!==s&&(u=h(),l&&(function(){throw new Error("https://svelte.dev/e/props_invalid_value")}(),l(u))),m=()=>{var i=t[e];return void 0===i?h():(o=!0,i)},!(4&i))return m;if(l){var p=t.$$legacy;return function(t,e){return arguments.length>0?((!e||p||g)&&l(e?m():t),t):m()}}var f=!1,v=(1&i?Ht:Zt)(()=>(f=!1,m()));r&&Ei(v);var w=hi;return function(t,e){if(arguments.length>0){const i=e?Ei(v):r?ue(t):t;return oe(v,i),f=!0,void 0!==a&&(a=i),t}return si&&f||16384&w.f?v.v:Ei(v)}}var xr=class{#G;#j;constructor(t){var e=new Map,i=(t,i)=>{var s=ae(i,!1,!1);return e.set(t,s),s};const s=new Proxy({...t.props||{},$$events:{}},{get:(t,s)=>Ei(e.get(s)??i(s,Reflect.get(t,s))),has:(t,s)=>s===$||(Ei(e.get(s)??i(s,Reflect.get(t,s))),Reflect.has(t,s)),set:(t,s,r)=>(oe(e.get(s)??i(s,r),r),Reflect.set(t,s,r))});this.#j=(t.hydrate?os:as)(t.component,{target:t.target,anchor:t.anchor,props:s,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),t?.props?.$$host&&!1!==t.sync||zt(),this.#G=s.$$events;for(const r of Object.keys(this.#j))"$set"!==r&&"$destroy"!==r&&"$on"!==r&&h(this,r,{get(){return this.#j[r]},set(t){this.#j[r]=t},enumerable:!0});this.#j.$set=t=>{Object.assign(s,t)},this.#j.$destroy=()=>{ds(this.#j)}}$set(t){this.#j.$set(t)}$on(t,e){this.#G[t]=this.#G[t]||[];const i=(...t)=>e.call(this,...t);return this.#G[t].push(i),()=>{this.#G[t]=this.#G[t].filter(t=>t!==i)}}$destroy(){this.#j.$destroy()}};function Tr(t,e,i,s){const r=i[t]?.type;if(e="Boolean"===r&&"boolean"!=typeof e?null!=e:e,!s||!i[t])return e;if("toAttribute"===s)switch(r){case"Object":case"Array":return null==e?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return null==e?null:e;default:return e}else switch(r){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return null!=e?+e:e}}"function"==typeof HTMLElement&&HTMLElement;var kr="E001",_r="E002",Mr="E003",Sr="E004",Er="E005",Ir="E100",Ar="E101",Lr="E102",Pr="E103",$r="E200",Cr="E201",Dr="E202",zr="E203",Or="E300",Rr="E301",Xr="E302",Fr="E303",Vr="E999",Yr={[kr]:"You appear to be offline. Please check your internet connection and try again.",[_r]:"The connection timed out. Please try again.",[Mr]:"Unable to load content due to security restrictions.",[Sr]:"The requested image or content could not be found.",[Er]:"The server encountered an error. Please try again later.",[Ir]:"Your browser does not support WebGL, which is required to view this content. Please try a different browser.",[Ar]:"The graphics context was lost. The page will attempt to recover.",[Lr]:"There was a problem initializing the graphics. Please try refreshing the page.",[Pr]:"Your device is low on memory. Try closing other browser tabs or applications.",[$r]:"The image data appears to be invalid or corrupted.",[Cr]:"The requested content could not be loaded.",[Dr]:"There was a problem processing the image information.",[zr]:"This image uses an unsupported format version.",[Or]:"Failed to load the image viewer engine. Please try refreshing the page.",[Rr]:"An error occurred in the image viewer. Please try refreshing the page.",[Xr]:"Failed to load the image. Please try again.",[Fr]:"Failed to load the tour. Some features may be unavailable.",[Vr]:"An unexpected error occurred. Please try refreshing the page."},Nr=class t extends Error{constructor(e,i){super(e),this.name="MicrioError",this.code=i?.code??Vr,this.displayMessage=i?.displayMessage??Yr[this.code],this.cause=i?.cause,this.statusCode=i?.statusCode,"captureStackTrace"in Error&&"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t)}static fromResponse(e,i){const s=e.status;let r=Vr;return 404===s?r=Sr:s>=500&&s<600?r=Er:0===s?r=kr:408!==s&&504!==s||(r=_r),new t(`${i?i+": ":""}HTTP ${s}`,{code:r,statusCode:s})}static fromError(e,i){const s=e.message.toLowerCase();let r=Vr;return s.includes("network")||s.includes("internet")||s.includes("offline")?r=kr:s.includes("timeout")?r=_r:s.includes("cors")||s.includes("cross-origin")?r=Mr:s.includes("webgl")||s.includes("webglcontext")?r=Ir:s.includes("memory")||s.includes("out of memory")?r=Pr:(s.includes("wasm")||s.includes("webassembly"))&&(r=Or),new t(`${i?i+": ":""}${e.message}`,{code:r,cause:e})}},Br=Math.PI,qr=Br/2,Wr=2*Br;function Ur(t){return 1<<t}function Hr(t,e=1){return(t%e+e)%e}var Gr=t=>Hr(t,1);function jr(t){return(t%Wr+Wr)%Wr}function Zr(t,e){const i=Gr(t),s=Gr(e)-i,r=s>0?s-1:s+1;return Math.abs(s)<=Math.abs(r)?s:r}var Jr=class{constructor(t,e,i,s){this.isLinear=t===e&&i===s&&0===t&&1===i;const r=3*t,n=3*(i-t)-r;this.Cx=r,this.Bx=n,this.Ax=1-r-n;const a=3*e,o=3*(s-e)-a;this.Cy=a,this.By=o,this.Ay=1-a-o}bezier_x(t){return t*(this.Cx+t*(this.Bx+t*this.Ax))}bezier_y(t){return t*(this.Cy+t*(this.By+t*this.Ay))}bezier_x_der(t){return this.Cx+t*(2*this.Bx+3*this.Ax*t)}find_x_for(t){let e=t,i=0,s=0,r=0;for(;i<5&&(s=this.bezier_x(e)-t,r=this.bezier_x_der(e),0!==r);)e-=s/r,i++;return e}get(t){return this.isLinear?t:this.bezier_y(this.find_x_for(t))}},Kr=new Jr(.42,0,.58,1),Qr=new Jr(.42,0,1,1),tn=new Jr(0,0,.58,1),en=new Jr(0,0,1,1),sn=t=>JSON.parse(JSON.stringify(t));function rn(t,e,i={}){if(!t||"object"!=typeof t)return e;for(const s in t){const r=t[s];if(r&&"object"==typeof r&&Object.getPrototypeOf(r)===Object.prototype){const t=e;t[s]&&"object"==typeof t[s]||(t[s]={}),rn(r,t[s],i)}else{const t=e;i.mergeArrays&&t[s]instanceof Array&&r instanceof Array?t[s].push(...r):i.noOverwrite&&s in e||(t[s]=r)}}return e}var nn=()=>Math.floor(65536*(1+Math.random())).toString(16).substring(1),an=()=>nn()+nn()+"-"+nn()+"-"+nn()+"-"+nn()+"-"+nn()+nn()+nn(),on=t=>{if(void 0===t)return t;t=(t=t.replace(/^\s+|\s+$/g,"")).toLowerCase();for(let e=0,i=28;e<i;e++)t=t.replace(new RegExp("àáäâèéëêìíïîòóöôùúüûñç·/_,:;".charAt(e),"g"),"aaaaeeeeiiiioooouuuunc------".charAt(e));return t=t.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")};function hn(t){const e=t<0;e&&(t=-t);const i=Math.ceil(t),s=Math.floor(i/3600),r=Math.floor(i%3600/60),n=i%60,a=t=>t<10?"0"+t:""+t;return(e?"-":"")+(s?s+":"+a(r):""+r)+":"+a(n)}var cn=navigator.userAgent,ln={iOS:/ipad|iphone|ipod/i.test(cn),firefox:/firefox/i.test(cn),OSX:/macintosh/i.test(cn)&&/os\ x/i.test(cn),hasTouch:"TouchEvent"in self,safari:!1};ln.safari=(ln.OSX||ln.iOS)&&(/safari/i.test(cn)||/instagram/i.test(cn))&&!/chrome/i.test(cn),ln.OSX&&ln.safari&&"TouchEvent"in self&&(ln.iOS=!0,ln.OSX=!1);var dn=t=>new Promise(e=>t?setTimeout(e,t):e()),un=[],mn=(t,e,i)=>new Promise((s,r)=>{if(i||un.includes(t))return s();const n=document.createElement("script"),a=()=>{un.push(t),s()};e?self[e]=a:n.onload=a,n.onerror=()=>r&&r(),n.async=!0,n.defer=!0,self.crossOriginIsolated&&(n.crossOrigin="anonymous"),n.src=t,document.head.appendChild(n)}),gn=(t,e={})=>new Promise(i=>{let s,r=!0;s=t.subscribe(t=>{r&&e.allowUndefined&&void 0===t||(r=!1,(void 0!==e.targetValue?t===e.targetValue:e.allowUndefined||void 0!==t)&&(s?s():Si().then(()=>s()),i(t)))})}),pn=new WeakSet,fn={fromLegacy:t=>{if(!t)return;if(pn.has(t))return t;const e=[t[0],t[1],t[2]-t[0],t[3]-t[1]];return pn.add(t),e},toCenterJSON:t=>({centerX:t[0]+t[2]/2,centerY:t[1]+t[3]/2,width:t[2],height:t[3]}),rectToCenterJSON:t=>fn.toCenterJSON([t[0],t[1],t[2]-t[0],t[3]-t[1]])},vn={"micrio-cdn.azureedge.net":"micrio.vangoghmuseum.nl/micrio","micrio-cdn.vangoghmuseum.nl":"micrio.vangoghmuseum.nl/micrio","rijks-micrio.azureedge.net":"micrio.rijksmuseum.nl"},wn=t=>{if(t instanceof Object&&"fileUrl"in t&&!t.src&&(t.src=t.fileUrl),t?.src)for(let e in vn)t.src.includes(e)&&(t.src=t.src.replace(e,vn[e]))},yn=t=>!t.viewsWH,bn=new WeakMap,xn=t=>{wn(t.image),t.children?.forEach(xn)},Tn=new WeakSet,kn=(t,e,i,s)=>{if(Tn.has(t))return;Tn.add(t),t.data||(t.data={}),t.id||(t.id=an()),t.tags||(t.tags=[]),"type"in t||(t.type="default"),t.popupType||(t.popupType="popup"),"string"==typeof t.data.icon&&(t.data.icon={title:"",size:0,uploaded:0,width:-1,height:-1,src:t.data.icon}),t.images?.forEach(wn),wn(t.positionalAudio),wn(t.data?.icon),Object.values(t.i18n??{}).forEach(t=>wn(t.audio));const r="embedImages"in t?t.embedImages:void 0;r&&r.forEach(t=>wn(t));const n=t.data?._meta?.secondary;n&&(t.data.micrioSplitLink=n),i&&"class"in t&&(t.tags??=[]).push(...t.class.split(" ").map(t=>t.trim()).filter(e=>!!e&&!t.tags.includes(e))),t.tags?.includes("default")&&(t.type="default"),s&&(t.view=fn.fromLegacy(t.view),_n(t.videoTour))};function _n(t){if(!t||!("i18n"in t)&&!("timeline"in t))return;const e="i18n"in t?t.i18n:{en:t};for(const i in e)e[i]?.timeline.forEach(t=>t.rect=fn.fromLegacy(t.rect))}var Mn="6.0.0",Sn="https://b.micr.io/";var En=function(){try{const t=location.hostname;if(t.endsWith("micrio.dev"))return"micrio.dev";if(t.endsWith("micrio.net"))return"micrio.net"}catch{}return"micr.io"}(),In=`https://viewer.${En}/`,An=["ttBWO","IicaE","KLTce","xjQrB","pfhXT","rNIPa","rdFIY","mvRXc"],Ln="micrio-muted",Pn={id:"",version:Mn,path:Sn,width:0,height:0,tileSize:1024,lang:"en",settings:{camspeed:1,view:[0,0,1,1],restrict:[0,0,1,1],focus:[.5,.5],zoomLimit:1,fullscreen:!0,hookEvents:!0,hookScroll:!0,hookPinch:!0,hookDrag:!0,minimap:!0,doTourJumps:!0,audio:!0,startVolume:1,mutedVolume:0,_markers:{showTitles:!1,popupAnimation:{duration:200,x:-50},zoomOutAfterClose:!0},ui:{controls:{cultureSwitch:!0}},_360:{},_meta:{}}},$n={STRINGS:{id:{r:!0},lang:{r:!0},"data-thumb":{f:"thumbSrc"},"data-title":{r:!0},"data-format":{r:!0},"data-extension":{r:!0,f:"tileExtension"},"data-tiles":{r:!0,f:"tilesId"},"data-path":{r:!0},"data-inittype":{f:"initType"},"data-start":{f:"gallery.startId"},"data-gallery":{f:"gallery.archive"},"data-gallery-sort":{f:"gallery.sort"},"data-iiif":{r:!0,f:"iiifManifest"},"data-grid":{r:!0},"data-gallery-type":{f:"gallery.type"}},BOOLEANS:{"data-static":{},muted:{f:"audio",n:!0},"data-png":{r:!0,f:"isPng"},"data-webp":{r:!0,f:"isWebP"},"data-dz":{r:!0,f:"isDeepZoom"},"data-is360":{r:!0},"data-no-externals":{f:"noExternals"},"data-skipmeta":{f:"skipMeta"},"data-force-data-refresh":{f:"forceDataRefresh"},"data-keeprendering":{f:"keepRendering"},"data-coverlimit":{f:"limitToCoverScale"},"data-events":{f:"hookEvents"},"data-keys":{f:"hookKeys"},"data-zooming":{f:"noZoom",n:!0},"data-scroll-zoom":{f:"hookScroll"},"data-pinch-zoom":{f:"hookPinch"},"data-dragging":{f:"hookDrag"},"data-two-finger-pan":{f:"twoFingerPan"},"data-control-zoom":{f:"controlZoom"},"data-ui":{f:"noUI",n:!0},"data-gtag":{f:"noGTag",n:!0},"data-controls":{f:"noControls",n:!0},"data-logo":{f:"noLogo",n:!0},"data-logo-org":{f:"noOrgLogo",n:!0},"data-toolbar":{f:"noToolbar",n:!0},"data-show-info":{f:"showInfo"},"data-social":{},"data-fullscreen":{},"data-minimap":{},"data-minimap-hide":{f:"alwaysShowMinimap",n:!0},"data-normalize-dpr":{f:"zoomLimitDPRFix"},"data-grid-clickable":{f:"gridClickable"},"data-gallery-spreads":{f:"gallery.isSpreads"},"data-freemove":{f:"freeMove"},"data-force-path":{f:"forceInfoPath",r:!0}},NUMBERS:{"data-version":{r:!0},height:{r:!0},width:{r:!0},volume:{f:"startVolume"},"data-tilesize":{r:!0,f:"tileSize"},"data-camspeed":{},"data-zoomlimit":{f:"zoomLimit"},"data-minimap-height":{f:"minimapHeight"},"data-minimap-width":{f:"minimapWidth"},"data-mutedvolume":{f:"mutedVolume"},"data-width-cm":{f:"cmWidth"},"data-height-cm":{f:"cmHeight"},"data-gallery-cover-pages":{f:"gallery.coverPages"},lazyload:{dN:0},"data-elasticity":{f:"dragElasticity"},"data-skip-base-levels":{f:"skipBaseLevels"},"data-watermark-opacity":{f:"watermarkOpacity"}},ARRAYS:{"data-focus":{},"data-view":{}}},Cn=new Map,Dn=new Map,zn=new Map,On=async(t,e)=>{if(!e&&Cn.has(t))return sn(Cn.get(t));if(Dn.has(t))return Dn.get(t);if(zn.has(t))throw zn.get(t)[1];const i=fetch(t+(e?(t.includes("?")?"&":"?")+Math.random():"")).then(async e=>{if(200==e.status)return e.json();{const i=Nr.fromResponse(e,`fetchJson(${t})`);throw zn.set(t,[e.status,i.message]),i}}).then(i=>(e||Cn.set(t,i),Dn.delete(t),sn(i))).catch(e=>{throw Dn.delete(t),e});return Dn.set(t,i),i},Rn=t=>"MICRIO_DATA"in self?(self?.MICRIO_DATA).find(e=>e[0]==t):void 0,Xn=(t,e,i)=>{const s=Rn(t)?.[1];return s?Promise.resolve(s):On(`${e??In}${t}/info.json`,i).then(t=>{var e;return t&&("Height"in t&&(t.height=t.Height,t.version=1,t.tileSize=512),"Width"in t&&(t.width=t.Width)),(e=t)&&(bn.has(e)||(wn(e.organisation?.logo),wn(e.settings?._markers?.markerIcon),e.settings?._markers?.customIcons?.forEach(wn),wn(e.settings?._360?.video),e?.settings&&yn(e)&&(e.settings.view=fn.fromLegacy(e.settings.view),e.settings.restrict=fn.fromLegacy(e.settings.restrict)),bn.set(e,!0))),t})};async function Fn(t,e,i,s){if(!("steps"in e)||e.stepInfo)return;const r=[...new Set(e.steps.map(t=>t.split(",")[1]).filter(e=>!!e&&e!=t.id))],[n,a]=await Promise.all([Promise.all(r.map(e=>On((e=>t.dataPath+(t.isV5?e+"/data/pub.json":e+"/data."+i+".json"))(e)))),Promise.all(r.map(t=>Xn(t)))]);n.forEach((e,s)=>{const r=yn(a[s]);e?.markers?.forEach(e=>kn(e,i,!t.isV5,r))}),wn(e.image);let o=-1;const h=[];e.stepInfo=e.steps.map((e,a)=>{const[c,l]=e.split(","),d=n[r.indexOf(l)]??s,u=d?.markers?.find(t=>t.id==c),m=u?.i18n?.[i]??u;m?.title&&(o=a);const g=u?.videoTour?"timeline"in u.videoTour?u.videoTour:u.videoTour.i18n?.[i]??void 0:void 0;return wn(g?.audio),wn(g?.subtitle),u?(wn(m?.audio),u.videoTour&&m?.audio&&(u.videoTour.audio=m.audio),{markerId:c,marker:u,micrioId:l||t.id,duration:Number(g?.duration||m?.audio?.duration||0),startView:g?.timeline?.length?g.timeline[0].rect:u?.view,imageHasOtherMarkers:!!l&&!!d?.markers?.find(t=>t.id!=c&&!t.noMarker),gridView:!(!u.data?._meta?.gridView&&!u.data?._meta?.gridAction),chapter:o,hasSubtitle:!!g?.subtitle}):(console.warn(`[Micrio] Warning: tour step ${a+1} with id [${c}] not found! Removing it from the tour`),void h.push(a))}).filter(t=>void 0!==t),h.reverse().forEach(t=>e.steps.splice(t,1)),e.initialStep=0,e.duration=e.stepInfo.reduce((t,e)=>t+(e.duration||0),0)}var Vn=t=>{let e=t.charCodeAt(0),i=e<91;return(e-=i?65:97)-(e>7?1:0)+(i?24:e>10?-1:0)},Yn=t=>6==t.length||7==t.length;function Nn(t,e){const i=t.$current;if(!i)return;const s=t.spaceData?.images.find(t=>t.id==i.id),r=t.spaceData?.images.find(t=>t.id==e);if(!s||!r)return;const n=[(r.x??.5)-(s.x??.5),(s.y??.5)-(r.y??.5),(r.z??.5)-(s.z??.5)];let a=n[0]*n[0]+n[1]*n[1]+n[2]*n[2];a>0&&(a=1/Math.sqrt(a));const o=[n[0]*a,n[1]*a,n[2]*a],h=Hr(Math.atan2(-o[0],o[2])/Math.PI/2);return{v:n,vN:o,directionX:h,vector:{direction:h%1,distanceX:Math.max(0,Math.min(.4,Math.sqrt(o[0]*o[0]+o[2]*o[2]))),distanceY:-n[1]}}}function Bn([t,e,i=0,s=0],[r,n,a=0,o=0],h){const c=Math.max(s/2,h),l=Math.max(o/2,h);return!(t+i+h<r-h||t-h>r+a+h||e+c<n-l||e-c>n+l)}var qn,Wn=function(t){return t[t.None=0]="None",t[t.IFrame=1]="IFrame",t[t.Video=2]="Video",t[t.Audio=3]="Audio",t[t.VideoTour=4]="VideoTour",t[t.Micrio=5]="Micrio",t}({}),Un=function(t){return t[t.YouTube=1]="YouTube",t[t.Vimeo=2]="Vimeo",t}({}),Hn=/((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube\.com|youtu.be|youtube-nocookie\.com))(\/(?:[\w\-]+\?v=|embed\/|v\/)?)([\w\-]+)(\S+)?/,Gn=/vimeo\.com/,jn=/^.*t=(\d+).*$/,Zn="https://www.youtube-nocookie.com";function Jn(t){if(t)return"fileUrl"in t?t.fileUrl:t.src}function Kn(t,e){return t.i18n?.[e]??t}var Qn=t=>t;function ta(t){const e=t-1;return e*e*e+1}function ea(t){const e="string"==typeof t&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}function ia(t,{delay:e=0,duration:i=400,easing:s=Qn}={}){const r=+getComputedStyle(t).opacity;return{delay:e,duration:i,easing:s,css:t=>"opacity: "+t*r}}function sa(t,{delay:e=0,duration:i=400,easing:s=ta,x:r=0,y:n=0,opacity:a=0}={}){const o=getComputedStyle(t),h=+o.opacity,c="none"===o.transform?"":o.transform,l=h*(1-a),[d,u]=ea(r),[m,g]=ea(n);return{delay:e,duration:i,easing:s,css:(t,e)=>`\n\t\t\ttransform: ${c} translate(${(1-t)*d}${u}, ${(1-t)*m}${g});\n\t\t\topacity: ${h-l*e}`}}var ra=Bi('<a rel="noopener" href="https://micr.io/" title="Powered by Micrio" aria-label="Micrio homepage"></a>');function na(t,e){et(e,!0);const[i,s]=kt(),r=Q("micrio"),{tour:n,marker:a}=r.state,o=/micr\.io/.test(location.origin)&&self.parent==self?void 0:"_blank";let h,c=ne(!1);ps(()=>r.loading.subscribe(t=>{clearTimeout(h),t?Ei(c)||(h=setTimeout(()=>oe(c,!0),750)):oe(c,!1)}));const l=jt(()=>!!xt(n,"$tour",i)||!!xt(a,"$marker",i));var d=Hi(),u=_e(d),m=t=>{var e=ra();let i;Ye(()=>{ar(e,"target",o),i=qs(e,1,"micrio-logo",null,i,{loading:Ei(c)})}),Ds(3,e,()=>ia,()=>({duration:200})),Gi(t,e)};vs(u,t=>{Ei(l)||t(m)}),Gi(t,d),it(),s()}var aa=Bi('<a rel="noopener" target="_blank" class="micrio-logo-org"><img alt="Logo" class="micrio-logo-org"/></a>');function oa(t,e){et(e,!0);const[i,s]=kt(),{tour:r,marker:n,popover:a}=Q("micrio").state;const o=jt(()=>!!xt(r,"$tour",i)||!!xt(n,"$marker",i)||!!xt(a,"$popover",i));var h=Hi(),c=_e(h),l=t=>{var i=aa(),s=ke(i);q(i),Ye(t=>{ar(i,"href",e.organisation.href??"#"),ar(i,"title",e.organisation.name),ar(i,"aria-label",`${e.organisation.name??""} homepage`),ar(s,"src",t)},[()=>function(t){if("string"==typeof t)return t;let e=0,i=Math.max(t.width,t.height);for(;i>1024;)e++,i/=2;return t.micrioId&&t.width>1024?"https://r2.micr.io/"+t.micrioId+"/"+e+"/0-0."+(t.isPng?"png":t.isWebP?"webp":"jpg"):t.src}(e.organisation.logo)]),Ds(3,i,()=>ia,()=>({duration:200})),Gi(t,i)};vs(c,t=>{!Ei(o)&&e.organisation.logo&&t(l)}),Gi(t,h),it(),s()}var ha={en:{close:"Close",zoomIn:"Zoom in",zoomOut:"Zoom out",fullscreenToggle:"Toggle fullscreen",switchLanguage:"Switch language",share:"Share",audioMute:"Mute audio",audioUnmute:"Unmute audio",closeMarker:"Close this marker",tourStepNext:"Next step",tourStepPrev:"Previous step",tourStop:"Stop this tour",minimize:"Minimize",play:"Play",pause:"Pause",stop:"Stop",subtitlesToggle:"Toggle subtitles",galleryPrev:"Previous image",galleryNext:"Next image",menuToggle:"Toggle menu",waypointFollow:"Go this way"},nl:{close:"Sluit",zoomIn:"Zoom in",zoomOut:"Zoom uit",fullscreenToggle:"Volledig scherm aan / uit",switchLanguage:"Kies taal",share:"Deel",audioMute:"Geluid uit",audioUnmute:"Geluid aan",closeMarker:"Sluit deze marker",tourStepNext:"Volgende stap",tourStepPrev:"Vorige stap",tourStop:"Stop deze tour",minimize:"Minimaliseer",play:"Start",pause:"Pauzeer",stop:"Stop",subtitlesToggle:"Ondertitels aan / uit",galleryPrev:"Vorige afbeelding",galleryNext:"Volgende afbeelding",menuToggle:"Menu openen / sluiten",waypointFollow:"Ga deze richting"}},ca=vt(ha.en),la=navigator?.language??"en-EN",da="Intl"in self&&Intl.DisplayNames?new Intl.DisplayNames([la],{type:"language"}):void 0,ua=["ar","ar-AE","ar-BH","ar-DJ","ar-DZ","ar-EG","ar-IQ","ar-JO","ar-KW","ar-LB","ar-LY","ar-MA","ar-OM","ar-QA","ar-SA","ar-SD","ar-SY","ar-TN","ar-YE","dv","dv-MV","fa","fa-AF","fa-IR","he","he-IL","iw","iw-PS","kd","ku","ku-IQ","ku-IR","ku-SY","ku-TR","pk-PK","ps","ps-AF","sd","sd-PK","syr-SY","ug","ug-CN","ur","ur-IN","ur-PK","yi","yi-IL","yi-US"],ma={arrowDown:[384,512,"M169.4 502.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 402.7 224 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 370.7-105.4-105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"],arrowLeft:[512,512,"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 288 480 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-370.7 0 105.4-105.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"],arrowRight:[512,512,"M502.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l370.7 0-105.4 105.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"],arrowUp:[384,512,"M214.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 109.3 160 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-370.7 105.4 105.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z"],bars:[448,512,"M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"],chevronDown:[448,512,"M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"],circleExclamation:[512,512,"M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zm0-192a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.6 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z"],closedCaptioning:[512,512,"M0 128C0 92.7 28.7 64 64 64l384 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zm152 80l32 0c4.4 0 8 3.6 8 8 0 13.3 10.7 24 24 24s24-10.7 24-24c0-30.9-25.1-56-56-56l-32 0c-30.9 0-56 25.1-56 56l0 80c0 30.9 25.1 56 56 56l32 0c30.9 0 56-25.1 56-56 0-13.3-10.7-24-24-24s-24 10.7-24 24c0 4.4-3.6 8-8 8l-32 0c-4.4 0-8-3.6-8-8l0-80c0-4.4 3.6-8 8-8zm168 8c0-4.4 3.6-8 8-8l32 0c4.4 0 8 3.6 8 8 0 13.3 10.7 24 24 24s24-10.7 24-24c0-30.9-25.1-56-56-56l-32 0c-30.9 0-56 25.1-56 56l0 80c0 30.9 25.1 56 56 56l32 0c30.9 0 56-25.1 56-56 0-13.3-10.7-24-24-24s-24 10.7-24 24c0 4.4-3.6 8-8 8l-32 0c-4.4 0-8-3.6-8-8l0-80z"],compress:[448,512,"M160 64c0-17.7-14.3-32-32-32S96 46.3 96 64l0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96zM32 320c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0zM352 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64zM320 320c-17.7 0-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0z"],ellipsisVertical:[128,512,"M64 144a56 56 0 1 1 0-112 56 56 0 1 1 0 112zm0 224c30.9 0 56 25.1 56 56s-25.1 56-56 56-56-25.1-56-56 25.1-56 56-56zm56-112c0 30.9-25.1 56-56 56s-56-25.1-56-56 25.1-56 56-56 56 25.1 56 56z"],expand:[448,512,"M32 32C14.3 32 0 46.3 0 64l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zM64 352c0-17.7-14.3-32-32-32S0 334.3 0 352l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96z"],externalLink:[512,512,"M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l82.7 0-201.4 201.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3 448 192c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-17.7-14.3-32-32-32L320 0zM80 96C35.8 96 0 131.8 0 176L0 432c0 44.2 35.8 80 80 80l256 0c44.2 0 80-35.8 80-80l0-80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 80c0 8.8-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l80 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 96z"],globe:[512,512,"M351.9 280l-190.9 0c2.9 64.5 17.2 123.9 37.5 167.4 11.4 24.5 23.7 41.8 35.1 52.4 11.2 10.5 18.9 12.2 22.9 12.2s11.7-1.7 22.9-12.2c11.4-10.6 23.7-28 35.1-52.4 20.3-43.5 34.6-102.9 37.5-167.4zM160.9 232l190.9 0C349 167.5 334.7 108.1 314.4 64.6 303 40.2 290.7 22.8 279.3 12.2 268.1 1.7 260.4 0 256.4 0s-11.7 1.7-22.9 12.2c-11.4 10.6-23.7 28-35.1 52.4-20.3 43.5-34.6 102.9-37.5 167.4zm-48 0C116.4 146.4 138.5 66.9 170.8 14.7 78.7 47.3 10.9 131.2 1.5 232l111.4 0zM1.5 280c9.4 100.8 77.2 184.7 169.3 217.3-32.3-52.2-54.4-131.7-57.9-217.3L1.5 280zm398.4 0c-3.5 85.6-25.6 165.1-57.9 217.3 92.1-32.7 159.9-116.5 169.3-217.3l-111.4 0zm111.4-48C501.9 131.2 434.1 47.3 342 14.7 374.3 66.9 396.4 146.4 399.9 232l111.4 0z"],image:[448,512,"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm64 80a48 48 0 1 1 0 96 48 48 0 1 1 0-96zM272 224c8.4 0 16.1 4.4 20.5 11.5l88 144c4.5 7.4 4.7 16.7 .5 24.3S368.7 416 360 416L88 416c-8.9 0-17.2-5-21.3-12.9s-3.5-17.5 1.6-24.8l56-80c4.5-6.4 11.8-10.2 19.7-10.2s15.2 3.8 19.7 10.2l26.4 37.8 61.4-100.5c4.4-7.1 12.1-11.5 20.5-11.5z"],layerGroup:[512,512,"M232.5 5.2c14.9-6.9 32.1-6.9 47 0l218.6 101c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L13.9 149.8C5.4 145.8 0 137.3 0 128s5.4-17.9 13.9-21.8L232.5 5.2zM48.1 218.4l164.3 75.9c27.7 12.8 59.6 12.8 87.3 0l164.3-75.9 34.1 15.8c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L13.9 277.8C5.4 273.8 0 265.3 0 256s5.4-17.9 13.9-21.8l34.1-15.8zM13.9 362.2l34.1-15.8 164.3 75.9c27.7 12.8 59.6 12.8 87.3 0l164.3-75.9 34.1 15.8c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L13.9 405.8C5.4 401.8 0 393.3 0 384s5.4-17.9 13.9-21.8z"],link:[576,512,"M419.5 96c-16.6 0-32.7 4.5-46.8 12.7-15.8-16-34.2-29.4-54.5-39.5 28.2-24 64.1-37.2 101.3-37.2 86.4 0 156.5 70 156.5 156.5 0 41.5-16.5 81.3-45.8 110.6l-71.1 71.1c-29.3 29.3-69.1 45.8-110.6 45.8-86.4 0-156.5-70-156.5-156.5 0-1.5 0-3 .1-4.5 .5-17.7 15.2-31.6 32.9-31.1s31.6 15.2 31.1 32.9c0 .9 0 1.8 0 2.6 0 51.1 41.4 92.5 92.5 92.5 24.5 0 48-9.7 65.4-27.1l71.1-71.1c17.3-17.3 27.1-40.9 27.1-65.4 0-51.1-41.4-92.5-92.5-92.5zM275.2 173.3c-1.9-.8-3.8-1.9-5.5-3.1-12.6-6.5-27-10.2-42.1-10.2-24.5 0-48 9.7-65.4 27.1L91.1 258.2c-17.3 17.3-27.1 40.9-27.1 65.4 0 51.1 41.4 92.5 92.5 92.5 16.5 0 32.6-4.4 46.7-12.6 15.8 16 34.2 29.4 54.6 39.5-28.2 23.9-64 37.2-101.3 37.2-86.4 0-156.5-70-156.5-156.5 0-41.5 16.5-81.3 45.8-110.6l71.1-71.1c29.3-29.3 69.1-45.8 110.6-45.8 86.6 0 156.5 70.6 156.5 156.9 0 1.3 0 2.6 0 3.9-.4 17.7-15.1 31.6-32.8 31.2s-31.6-15.1-31.2-32.8c0-.8 0-1.5 0-2.3 0-33.7-18-63.3-44.8-79.6z"],minus:[448,512,"M0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32z"],pause:[384,512,"M48 32C21.5 32 0 53.5 0 80L0 432c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-352c0-26.5-21.5-48-48-48L48 32zm224 0c-26.5 0-48 21.5-48 48l0 352c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-352c0-26.5-21.5-48-48-48l-64 0z"],play:[448,512,"M91.2 36.9c-12.4-6.8-27.4-6.5-39.6 .7S32 57.9 32 72l0 368c0 14.1 7.5 27.2 19.6 34.4s27.2 7.5 39.6 .7l336-184c12.8-7 20.8-20.5 20.8-35.1s-8-28.1-20.8-35.1l-336-184z"],playCircle:[512,512,"M0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zM188.3 147.1c-7.6 4.2-12.3 12.3-12.3 20.9l0 176c0 8.7 4.7 16.7 12.3 20.9s16.8 4.1 24.3-.5l144-88c7.1-4.4 11.5-12.1 11.5-20.5s-4.4-16.1-11.5-20.5l-144-88c-7.4-4.5-16.7-4.7-24.3-.5z"],plus:[448,512,"M256 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 160-160 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0 0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160 160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0 0-160z"],share:[512,512,"M307.8 18.4c-12 5-19.8 16.6-19.8 29.6l0 80-112 0c-97.2 0-176 78.8-176 176 0 113.3 81.5 163.9 100.2 174.1 2.5 1.4 5.3 1.9 8.1 1.9 10.9 0 19.7-8.9 19.7-19.7 0-7.5-4.3-14.4-9.8-19.5-9.4-8.8-22.2-26.4-22.2-56.7 0-53 43-96 96-96l96 0 0 80c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-9.2-9.2-22.9-11.9-34.9-6.9z"],video:[576,512,"M96 64c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L96 64zM464 336l73.5 58.8c4.2 3.4 9.4 5.2 14.8 5.2 13.1 0 23.7-10.6 23.7-23.7l0-240.6c0-13.1-10.6-23.7-23.7-23.7-5.4 0-10.6 1.8-14.8 5.2L464 176 464 336z"],volumeHigh:[640,512,"M533.6 32.5c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C557.5 113.8 592 180.8 592 256s-34.5 142.2-88.7 186.3c-10.3 8.4-11.8 23.5-3.5 33.8s23.5 11.8 33.8 3.5C598.5 426.7 640 346.2 640 256S598.5 85.2 533.6 32.5zM473.1 107c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C475.3 170.7 496 210.9 496 256s-20.7 85.3-53.2 111.8c-10.3 8.4-11.8 23.5-3.5 33.8s23.5 11.8 33.8 3.5c43.2-35.2 70.9-88.9 70.9-149s-27.7-113.8-70.9-149zm-60.5 74.5c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C393.1 227.6 400 241 400 256s-6.9 28.4-17.7 37.3c-10.3 8.4-11.8 23.5-3.5 33.8s23.5 11.8 33.8 3.5C434.1 312.9 448 286.1 448 256s-13.9-56.9-35.4-74.5zM80 352l48 0 134.1 119.2c6.4 5.7 14.6 8.8 23.1 8.8 19.2 0 34.8-15.6 34.8-34.8l0-378.4c0-19.2-15.6-34.8-34.8-34.8-8.5 0-16.7 3.1-23.1 8.8L128 160 80 160c-26.5 0-48 21.5-48 48l0 96c0 26.5 21.5 48 48 48z"],volumeXmark:[576,512,"M48 352l48 0 134.1 119.2c6.4 5.7 14.6 8.8 23.1 8.8 19.2 0 34.8-15.6 34.8-34.8l0-378.4c0-19.2-15.6-34.8-34.8-34.8-8.5 0-16.7 3.1-23.1 8.8L96 160 48 160c-26.5 0-48 21.5-48 48l0 96c0 26.5 21.5 48 48 48zM367 175c-9.4 9.4-9.4 24.6 0 33.9l47 47-47 47c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l47-47 47 47c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-47-47 47-47c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-47 47-47-47c-9.4-9.4-24.6-9.4-33.9 0z"],xmark:[384,512,"M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]},ga=Wi('<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path></path></svg>');function pa(t,e){et(e,!0);let i=br(e,"style",3,void 0);const s=Q("micrio"),r=jt(()=>"chevron-down"==e.name||"link-ext"==e.name),n=s.defaultSettings?.ui?.icons,a=jt(()=>n&&("zoom-in"==e.name?n.zoomIn:"zoom-out"==e.name?n.zoomOut:"maximize"==e.name?n.fullscreenEnter:"minimize"==e.name?n.fullscreenLeave:"close"==e.name?n.close:"arrow-right"==e.name?n.next:"arrow-left"==e.name?n.prev:"arrow-up"==e.name?n.up:"arrow-down"==e.name?n.down:"play"==e.name?n.play:"pause"==e.name?n.pause:"subtitles"==e.name?n.subtitles:"subtitles-off"==e.name?n.subtitlesOff:"volume-off"==e.name?n.muted:"volume-up"==e.name?n.unmuted:null)),o={play:ma.play,pause:ma.pause,close:ma.xmark,"play-filled":ma.playCircle,a11y:ma.globe,menu:ma.bars,"zoom-in":ma.plus,"zoom-out":ma.minus,maximize:ma.expand,minimize:ma.compress,"volume-off":ma.volumeXmark,"volume-up":ma.volumeHigh,subtitles:ma.closedCaptioning,"subtitles-off":ma.closedCaptioning,"arrow-left":ma.arrowLeft,"arrow-up":ma.arrowUp,"arrow-right":ma.arrowRight,"arrow-down":ma.arrowDown,video:ma.video,audio:ma.volumeHigh,image:ma.image,share:ma.share,error:ma.circleExclamation,"chevron-down":ma.chevronDown,link:ma.link,"link-ext":ma.externalLink,"ellipsis-vertical":ma.ellipsisVertical},h=jt(()=>o[e.name]);var c=Hi(),l=_e(c),d=t=>{var e=Hi();Ms(_e(e),()=>Ei(a),void 0,!0),Gi(t,e)},u=t=>{var e=ga();let s;var n=ke(e);q(e),Ye(()=>{ar(e,"viewBox",`0 0 ${Ei(h)[0]??""} ${Ei(h)[1]??""}`),s=qs(e,0,"svelte-fa micrio-icon",null,s,{small:Ei(r)}),Us(e,i()),ar(n,"d",Ei(h)[2])}),Gi(t,e)};vs(l,t=>{Ei(a)?t(d):Ei(h)&&t(u,1)}),Gi(t,c),it()}var fa=vt(void 0),va=()=>fa.set(void 0),wa=!1;fa.subscribe(t=>{t?wa||window.addEventListener("click",va):wa&&window.removeEventListener("click",va),wa=!!t});var ya=Bi('<a class="micrio-menu-action micrio-menu"><strong class="micrio-menu"> <!></strong></a>'),ba=Wi('<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="svelte-fa" style="height:1em;vertical-align:-.125em;margin-right:10px;"><path></path></svg>'),xa=Bi('<button class="micrio-menu-action micrio-menu" type="button"><!> <strong class="micrio-menu"> <!></strong></button>'),Ta=Bi('<div class="items micrio-menu"></div>'),ka=Bi("<menu><!> <!></menu>");function _a(t,e){et(e,!0);const i=()=>xt(fa,"$opened",s),[s,r]=kt();let n=br(e,"menu",15),a=br(e,"originalId",3,null);const o=Q("micrio"),{events:h,state:c,_lang:l}=o;let d=ne(void 0);const u=jt(()=>{return t=n(),e=xt(l,"$_lang",s),t.i18n?.[e]??t;var t,e});function m(t){n().link||t.preventDefault(),n().action&&n().action();const i=!!(Ei(p)||n().action||n().link);fa.set(i?void 0:n()),i&&e.onclose?.()}ps(()=>{Ei(u)?.title||1!=n().children?.length||n(n().children[0]),n().action||(n().markerId?n(n().action=()=>{a()&&o.$current?.id!=a()&&o.open(a()),o.$current?.state.marker.set(n().markerId)},!0):(Ei(u)?.content||Ei(u)?.embed||n().image)&&n(n().action=()=>{h.dispatch("page-open",n()),c.popover.set({contentPage:n()})},!0)),n(n()._button=Ei(d),!0)});const g=t=>t==i()||!!t.children?.some(g),p=jt(()=>i()&&g(n()));var f=ka();let v;var w=ke(f),y=t=>{var e=ya(),i=ke(e),s=ke(i),r=Me(s);{let t=jt(()=>n().linkTargetBlank?"link-ext":"link");pa(r,{style:"opacity:.75",get name(){return Ei(t)}})}q(i),q(e),Ye(()=>{ar(e,"href",n().link),ar(e,"target",n().linkTargetBlank?"_blank":void 0),ns(s,`${Ei(u)?.title??"(Unknown)"??""} `)}),Ri("click",e,m),Gi(t,e)},b=t=>{var e=xa(),i=ke(e),s=t=>{var e=ba(),i=ke(e);q(e),Ye(()=>{ar(e,"viewBox",`0 0 ${n().icon[0]??""} ${n().icon[1]??""}`),ar(i,"d",n().icon[2])}),Gi(t,e)};vs(i,t=>{n().icon&&t(s)});var r=Me(i,2),a=ke(r),o=Me(a),h=t=>{pa(t,{name:"chevron-down"})};vs(o,t=>{n().children&&n().children.length&&t(h)}),q(r),q(e),fr(e,t=>oe(d,t),()=>Ei(d)),Ye(()=>ns(a,`${Ei(u)?.title??"(Unknown)"??""} `)),Ri("click",e,m),Gi(t,e)};vs(w,t=>{n().link?t(y):t(b,-1)});var x=Me(w,2),T=t=>{var e=Ta();bs(e,23,()=>n().children,(t,e)=>e+t.id,(t,e)=>{_a(t,{get menu(){return Ei(e)},get originalId(){return a()},onclose:va})}),q(e),Gi(t,e)};vs(x,t=>{n().children&&n().children.length&&t(T)}),q(f),Ye(t=>{ar(f,"data-title",t),v=qs(f,1,"micrio-menu",null,v,{opened:Ei(p)})},[()=>Ei(u)?.title?.toLowerCase()]),Gi(t,f),it(),r()}Xi(["click"]);var Ma=Bi('<img alt="Icon" class="micrio-button"/>'),Sa=Bi("<!><!>",1);function Ea(t,e){et(e,!0);let i=br(e,"type",3,void 0),s=br(e,"icon",3,void 0),r=br(e,"title",3,null),n=br(e,"disabled",3,!1),a=br(e,"active",3,!1),o=br(e,"className",3,""),h=br(e,"href",3,void 0),c=br(e,"blankTarget",3,!1),l=br(e,"noClick",3,!1);var d=Hi();Os(_e(d),()=>h()?"a":"button",!1,(t,d)=>{var u=t=>e.onclick?.(t),m=t=>e.onfocus?.(t),g=t=>e.onpointerdown?.(t);hr(t,()=>({href:h(),target:c()?"_blank":void 0,disabled:!!n()||void 0,title:r(),"aria-label":r(),role:h()?void 0:"button",tabindex:h()?void 0:0,class:`micrio-button ${i()??""??""} ${o()??""}`,onclick:u,onfocus:m,onpointerdown:g,[js]:{active:a(),"no-click":l()}}),void 0,void 0,void 0,"micrio-button");var p=Sa(),v=_e(p),w=t=>{pa(t,{get name(){return i()}})},y=t=>{var e=Ma();Ye(()=>ar(e,"src",s().src)),Gi(t,e)};vs(v,t=>{i()?t(w):s()&&t(y,1)}),gs(Me(v),()=>e.children??f),Gi(d,p)}),Gi(t,d),it()}var Ia=Bi("<menu><!> <!> <!></menu> <!>",1);function Aa(t,e){et(e,!0);const i=()=>xt(c,"$current",r),s=()=>xt(l,"$_lang",r),[r,n]=kt();let a=ne(void 0);const o=Q("micrio"),{state:h,current:c,_lang:l,spaceData:d}=o,{tour:u,marker:m,popover:g}=h;let p=ne(!1),f=ne(!1);const v=i().id;let w=ne(void 0),y=ne(window.innerWidth<=500);const b=()=>oe(y,window.innerWidth<=500),x=()=>{Ei(y)&&oe(p,!1)},T=jt(()=>!!xt(u,"$tour",r)||!!xt(m,"$marker",r)||!!xt(g,"$popover",r)),k=jt(()=>(Ei(a)?.markerTours??[]).concat(d?.markerTours??[])),_=jt(()=>Ei(k)?.length>0),M=jt(()=>Ei(a)?.tours&&Ei(a)?.tours?.length>0),S=jt(()=>Ei(_)&&Ei(M)),E=jt(()=>!(Ei(w)?.length||Ei(_)||Ei(M))),I=[],A=(t,e)=>("title"in t?t.title:t.i18n?.[e]?.title)??"(Untitled)";ps(()=>{const t=o.current.subscribe(t=>{if(t){for(;I.length;)I.shift()?.();gn(t.info).then(()=>oe(f,!t.$settings.noLogo)),I.push(t.data.subscribe(t=>{oe(a,t,!0),Si().then(()=>{if(!t?.pages)return;Ei(w)||oe(w,t.pages?.filter(t=>!t.id?.startsWith("_")),!0);const e=t.pages?.filter(t=>t.id?.startsWith("_"));e.length&&oe(w,[...Ei(w)?.filter(t=>!t.id?.startsWith("_"))??[],...e],!0)})}))}});return window.addEventListener("resize",b),()=>{for(window.removeEventListener("resize",b);I.length;)I.shift()?.();t()}});var L=Hi(),P=_e(L),$=t=>{var e=Ia(),n=_e(e);let h;var c=ke(n),l=t=>{var e=Hi();bs(_e(e),17,()=>Ei(w),t=>t.id,(t,e)=>{_a(t,{get menu(){return Ei(e)},get originalId(){return v},onclose:x})}),Gi(t,e)};vs(c,t=>{Ei(w)&&t(l)});var d=Me(c,2),m=t=>{{let e=jt(()=>({id:an(),i18n:{[s()]:{title:Ei(S)?"Marker tours":"Tours"}},children:Ei(k).map(t=>({id:an(),i18n:{[s()]:{title:A(t,s())}},action:()=>{t.initialStep=0,u.set(t)}}))}));_a(t,{onclose:x,get menu(){return Ei(e)}})}};vs(d,t=>{Ei(_)&&t(m)});var g=Me(d,2),b=t=>{{let e=jt(()=>({id:an(),i18n:{[s()]:{title:Ei(S)?"Video tours":"Tours"}},children:Ei(a)&&Ei(a).tours?Ei(a).tours.map(t=>({id:an(),i18n:{[s()]:{title:A(t,s())}},action:()=>{i()&&i().id!=v&&o.open(v),u.set(t)}})):[]}));_a(t,{onclose:x,get menu(){return Ei(e)}})}};vs(g,t=>{Ei(M)&&t(b)}),q(n);var E=Me(n,2),I=t=>{{let e=jt(()=>Ei(p)?"close":"ellipsis-vertical"),i=jt(()=>"toggle transparent"+(Ei(f)?" indent":""));Ea(t,{get title(){return xt(ca,"$i18n",r).menuToggle},get type(){return Ei(e)},get className(){return Ei(i)},onclick:()=>oe(p,!Ei(p))})}};vs(E,t=>{Ei(y)&&t(I)}),Ye(()=>h=qs(n,1,"micrio-toolbar micrio-toolbar",null,h,{shown:!Ei(T)&&Ei(p),indent:Ei(f)})),Ds(3,n,()=>ia,()=>({duration:200})),Gi(t,e)};vs(P,t=>{Ei(E)||Ei(T)||t($)}),Gi(t,L),it(),n()}var La=Bi("<canvas></canvas>");function Pa(t,e){et(e,!0);const[i,s]=kt(),r=Q("micrio"),{current:n}=r,a=Li(()=>e.image).$info,o=Li(()=>e.image).camera,h=Li(()=>e.image).$settings,c=h.minimapWidth??200,l=h.minimapHeight??160,d=!h.alwaysShowMinimap,u=!!h.noControls,m=a.width/a.height,g=c/m>l?Math.round(l*m):c,p=c/m<=l?Math.round(c/m):l;let f,v=ne(void 0),w=ne(!1),y=ne(ue(!a.is360&&o.isZoomedOut()));function b(t){if(!t||!f)return;I();const i=fn.toCenterJSON(t);if(f.clearRect(0,0,g,p),e.image.thumbSrc?(f.globalCompositeOperation="source-over",f.fillStyle="rgba(0,0,0,.5)",f.fillRect(0,0,g,p),f.globalAlpha=1,f.globalCompositeOperation="destination-out"):(f.fillStyle="rgba(0,0,0,.5)",f.fillRect(0,0,g,p)),f.beginPath(),f.fillStyle="white",a.is360){const e=function(t){const e=[];let{centerX:i,centerY:s,width:r,height:n}=fn.toCenterJSON(t);i=(i%1+1)%1;let a=i-r/2,o=i+r/2;const h=Math.max(0,s-n/2),c=Math.min(1,s+n/2);return a<0?(e.push({x:a+1,y:h,width:1-(a+1),height:c-h}),e.push({x:0,y:h,width:o,height:c-h})):o>1?(e.push({x:a,y:h,width:1-a,height:c-h}),e.push({x:0,y:h,width:o-1,height:c-h})):e.push({x:a,y:h,width:o-a,height:c-h}),e}(t);for(const t of e)f.rect(Math.floor(t.x*g),Math.floor(t.y*p),Math.ceil(t.width*g),Math.ceil(t.height*p))}else oe(y,o.isZoomedOut(),!0),f.rect(Math.floor((i.centerX-i.width/2)*g),Math.floor((i.centerY-i.height/2)*p),Math.ceil(i.width*g),Math.ceil(i.height*p));e.image.thumbSrc&&(f.fill(),f.globalCompositeOperation="source-over"),f.stroke()}const x=-1!=navigator.userAgent.indexOf("Firefox");let T,k=ne(!1);let _,M=ne(void 0);function S(t){if(T){const e=Math.max(0,Math.min(1,(t.clientX-T.left)/T.width)),i=Math.max(0,Math.min(1,(t.clientY-T.top)/T.height));if(Ei(M)){const t=[e-Ei(M).width/2,i-Ei(M).height/2,Ei(M).width,Ei(M).height];o.setView(t)}else o.setCoo(e,i)}}function E(){window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",E),oe(k,!1),oe(M,void 0)}function I(){oe(w,!1),clearTimeout(_),_=setTimeout(()=>oe(w,!0),2500)}const A=-Li(()=>e.image).camera.rotationY/(2*Math.PI),L=self.crossOriginIsolated;let P=ne(ue(L?void 0:Li(()=>e.image).thumbSrc));const $={passive:!0};let C=ne(!1);ps(()=>{let t;f=Ei(v).getContext("2d"),f&&(f.lineWidth=1,f.strokeStyle="white"),L&&e.image.thumbSrc&&fetch(e.image.thumbSrc).then(t=>t.blob()).then(e=>oe(P,t=URL.createObjectURL(e),!0)),r.canvas.element.addEventListener("mousemove",I,$);const i=e.image.state.view.subscribe(b);return setTimeout(()=>oe(C,!0),10),()=>{t&&URL.revokeObjectURL(t),r.canvas.element.removeEventListener("mousemove",I,$),E(),i()}});const D=jt(()=>Ei(P)?`background-image: url('${Ei(P)}')`+(0!=A?`;background-position-x:${g*A}px`:""):null);var z=La();let O;fr(z,t=>oe(v,t),()=>Ei(v)),Ye(()=>{ar(z,"width",g),ar(z,"height",p),Us(z,Ei(D)),O=qs(z,1,"micrio-minimap",null,O,{hidden:!Ei(C)||xt(n,"$current",i)!=e.image||d&&(Ei(y)||Ei(w)),dragging:Ei(k),controls:!u})}),Oi("wheel",z,function(t){o.zoom(t.deltaY*(x?50:1))}),Ri("mousedown",z,function(t){if(0!=t.button)return;window.addEventListener("mousemove",S),window.addEventListener("mouseup",E),T=Ei(v).getClientRects()[0];const e=o.getView();e&&oe(M,{width:e[2],height:e[3]},!0),S(t),oe(k,!0)}),Gi(t,z),it(),s()}Xi(["mousedown"]);var $a=Bi("<div><!></div>");function Ca(t,e){let i=br(e,"className",3,"");var s=$a();gs(ke(s),()=>e.children??f),q(s),Ye(()=>qs(s,1,Vs(i()),"micrio-button-group")),Gi(t,s)}function Da(t,e){et(e,!0);const[i,s]=kt(),r="requestFullscreen"in Li(()=>e.el),n="webkitRequestFullscreen"in Li(()=>e.el),a=Q("micrio"),o=()=>r?document.fullscreenElement:document.webkitFullscreenElement??null;let h=ne(o()===Li(()=>e.el));const c=r||n&&!o(),l=()=>new Promise(t=>setTimeout(t,500));let d;function u(){Ei(h)?async function(){r?(await document.exitFullscreen().then(l),d&&d instanceof HTMLElement&&d.requestFullscreen(),d=void 0):"webkitExitFullscreen"in document&&document.webkitExitFullscreen()}():async function(){r?(d=o(),ln.safari&&d&&await document.exitFullscreen().then(l),e.el.requestFullscreen()):"webkitRequestFullscreen"in e.el&&e.el.webkitRequestFullscreen()}()}const m=Li(()=>e.el)==a&&!a.events.scrollHooked,g=()=>{oe(h,o()===e.el),m&&(Ei(h)?a.events.hookScroll():a.events.unhookScroll())};c&&ps(()=>{const t=r?"fullscreenchange":"webkitfullscreenchange";return document.addEventListener(t,g),()=>document.removeEventListener(t,g)});var p=Hi(),f=_e(p),v=t=>{{let e=jt(()=>Ei(h)?"minimize":"maximize");Ea(t,{get type(){return Ei(e)},get title(){return xt(ca,"$i18n",i).fullscreenToggle},onclick:u})}};vs(f,t=>{c&&t(v)}),Gi(t,p),it(),s()}var za=Bi("<!> <!>",1);function Oa(t,e){et(e,!0);const i=()=>xt(ca,"$i18n",s),[s,r]=kt();let n=br(e,"image",15,void 0);const a=Q("micrio");let o=ne(!1),h=ne(!1),c=ne(!1),l=ne(!1);const d=()=>{a.events.clicked=!0},u=()=>{d(),n()?.camera.zoomIn().then(()=>a.events.clicked=!1)},m=()=>{d(),n()?.camera.zoomOut().then(()=>a.events.clicked=!1)};function g(){oe(o,n()?.camera.isZoomedIn()??!0,!0),oe(h,n()?.camera.isZoomedOut(!0)??!0,!0);const t=n()?.camera.getMinScale()??0;oe(c,t>1&&t>(n()?.$settings.zoomLimit??1),!0)}let p,f,v;const w=t=>{p&&(p(),p=void 0),n(t),t?p=t.state.view.subscribe(g):g()};ps(()=>(n()?p=n().state.view.subscribe(g):f=a.current.subscribe(t=>{if(v&&(v(),v=void 0),p&&(p(),p=void 0),oe(l,!0),!t)return n(void 0),void oe(l,!1);gn(t.info).then(()=>Si()).then(()=>{t.album?.currentImage?v=t.album.currentImage.subscribe(w):w(t),oe(l,!1)})}),()=>{f&&f(),v&&v(),p&&p()}));var y=Hi(),b=_e(y),x=t=>{var e=za(),s=_e(e);{let t=jt(()=>Ei(l)||Ei(o));Ea(s,{type:"zoom-in",get title(){return i().zoomIn},get disabled(){return Ei(t)},onclick:u})}var r=Me(s,2);{let t=jt(()=>Ei(l)||Ei(h));Ea(r,{type:"zoom-out",get title(){return i().zoomOut},get disabled(){return Ei(t)},onclick:m})}Gi(t,e)};vs(b,t=>{Ei(c)||Ei(o)&&Ei(h)||t(x)}),Gi(t,y),it(),r()}var Ra=Bi('<menu class="popout micrio-controls"><!> <!></menu>'),Xa=Bi("<!> <!> <!>",1),Fa=Bi("<!> <!>",1),Va=Bi("<aside><!></aside>"),Ya=Bi("<aside><!> <!></aside> <!>",1);function Na(t,e){et(e,!0);const i=()=>xt(m,"$current",c),s=()=>xt(Ei(k),"$info",c),r=()=>xt(f,"$_lang",c),n=()=>xt(v,"$tour",c),a=()=>xt(b,"$zoom",c),o=()=>xt(p,"$isMuted",c),h=()=>xt(ca,"$i18n",c),[c,l]=kt();let d=br(e,"hasAudio",3,!1);const u=ue(Q("micrio")),{current:m,state:g,isMuted:p,_lang:f}=u,{tour:v,popup:w}=g,{controls:y,zoom:b,hidden:x,hover:T}=u.state.ui,k=jt(()=>i()?.info),_=jt(()=>s()&&i()?i().isV5?Object.keys(s().revision??{[r()]:0}):("cultures"in s()?s().cultures:"")?.split(",")??[]:[]),M=jt(()=>n()&&"steps"in n()&&n().isSerialTour);function S(){if(navigator.share&&i()?.$info){const t=i().$data?i().$data?.i18n?i().$data.i18n[r()]:i().$data:void 0;navigator.share({title:i().$info?.title,text:t?.description||`${i().$info.width} x ${i().$info.height} | Micrio`,url:location.href})}}let E=ne(null),I=ne(!1);function A(t){const e=t.detail;oe(I,u.canvas.viewport.portrait,!0),e.opts.isPassive||oe(E,e,!0)}function L(){oe(E,null)}let P=ne(!1),$=ne(!1),C=ne(!1);function D(t){b.set(!t.noZoom),y.set(!t.noControls),oe(P,!!t.ui?.controls?.cultureSwitch),oe($,!!t.social),oe(C,!!t.fullscreen)}i()&&D(i().$settings),ps(()=>{let t;u.addEventListener("splitscreen-start",A),u.addEventListener("splitscreen-stop",L);const e=u.current.subscribe(e=>{e&&gn(e.info).then(i=>{!i||n()&&"steps"in n()||(t?.(),t=e.settings.subscribe(D))})});return()=>{u.removeEventListener("splitscreen-start",A),u.removeEventListener("splitscreen-stop",L),t?.(),e()}});const z=jt(()=>"micrioAudioContext"in window||d()),O=jt(()=>Ei(P)&&Ei(_).length>1),R=jt(()=>Ei($)&&"share"in navigator),X=jt(()=>Ei(C)&&!Ei(M)),F=jt(()=>xt(y,"$controls",c)&&(Ei(z)||Ei(O)||Ei(R)||a()||Ei(X))),V=jt(()=>xt(w,"$popup",c)&&u.canvas.$isMobile);var Y=Hi(),N=_e(Y),B=t=>{var e=Ya(),i=_e(e);let s;var n=ke(i),l=t=>{var e=Xa(),i=_e(e),s=t=>{{let e=jt(()=>o()?"volume-off":"volume-up"),i=jt(()=>o()?h().audioUnmute:h().audioMute);Ea(t,{get type(){return Ei(e)},get title(){return Ei(i)},onclick:()=>p.set(!o())})}};vs(i,t=>{Ei(z)&&t(s)});var n=Me(i,2),a=t=>{var e=Ra(),i=ke(e);Ea(i,{get title(){return h().switchLanguage},type:"a11y"}),bs(Me(i,2),17,()=>Ei(_),ws,(t,e)=>{{let i=jt(()=>da?.of(Ei(e))??Ei(e)),s=jt(()=>Ei(e)==r());Ea(t,{onclick:()=>u.lang=Ei(e),get title(){return Ei(i)},get active(){return Ei(s)},children:(t,i)=>{W();var s=Ui();Ye(t=>ns(s,t),[()=>Ei(e).toUpperCase()]),Gi(t,s)},$$slots:{default:!0}})}}),q(e),Gi(t,e)};vs(n,t=>{Ei(O)&&t(a)});var c=Me(n,2),l=t=>{Ea(t,{type:"share",get title(){return h().share},onclick:S})};vs(c,t=>{Ei(R)&&t(l)}),Gi(t,e)};vs(n,t=>{Ei(V)||t(l)}),Ca(Me(n,2),{children:(t,e)=>{var i=Fa(),s=_e(i),r=t=>{var e=Hi(),i=_e(e),s=t=>{Oa(t,{get image(){return Ei(E)}})},r=t=>{Oa(t,{})};vs(i,t=>{Ei(E)?t(s):t(r,-1)}),Gi(t,e)};vs(s,t=>{a()&&!Ei(V)&&t(r)});var n=Me(s,2),o=t=>{Da(t,{get el(){return u}})};vs(n,t=>{Ei(X)&&t(o)}),Gi(t,i)},$$slots:{default:!0}}),q(i);var d=Me(i,2),m=t=>{var e=Va();let i;Ca(ke(e),{children:(t,e)=>{Oa(t,{})},$$slots:{default:!0}}),q(e),Ye(()=>i=qs(e,1,"primary micrio-controls",null,i,{portrait:Ei(I)})),Ds(3,e,()=>ia),Gi(t,e)};vs(d,t=>{a()&&Ei(E)&&t(m)}),Ye(()=>s=qs(i,1,"micrio-controls",null,s,{hidden:xt(x,"$hidden",c)&&!xt(T,"$hover",c)})),Ri("pointerover",i,()=>T.set(!0)),Ri("pointerout",i,t=>{t.currentTarget.contains(t.relatedTarget)||T.set(!1)}),Ri("focusin",i,()=>T.set(!0)),Ri("focusout",i,t=>{t.currentTarget.contains(t.relatedTarget)||T.set(!1)}),Gi(t,e)};vs(N,t=>{Ei(F)&&t(B)}),Gi(t,Y),it(),l()}Xi(["pointerover","pointerout","focusin","focusout"]);var Ba=class{constructor(t,e){this.image=t,this.data=e,this.timeline=[],this._paused=!0,this.playing=!1,this.wasPaused=!1,this.unhookEvents=!1,this.micrio=t.engine.micrio;const i="timeline"in e?e:e.i18n?.[wt(this.micrio._lang)]??void 0;if(!i)throw new Error("No valid content for video tour!");this.content=i,this.unhookEvents=!e.keepInteraction&&this.micrio.events.$enabled,e.instance=this,this.read(),this.micrio.events.dispatch("videotour-start",this.data)}destroy(){this.unhookEvents&&this.micrio.events.enabled.set(!0),this.playing&&(this.image.camera.stop(),this.micrio.removeAttribute("data-videotour-playing"),this.micrio.events.dispatch("videotour-stop",this.data),this.playing=!1,delete this.startedAt,delete this.data.instance,this.startAt=void 0,clearTimeout(this._to))}read(){const t=this.data.i18n?1:this.content.duration,e=this.content.timeline;this.timeline.length=0;for(let i=0;i<e.length;i++){const s=e[i],r=e[i-1],n=r?r.end*t:0;this.timeline.push({view:this.data.isLegacy?fn.fromLegacy(s.rect):s.rect,start:1e3*n,duration:1e3*(s.start*t-n),pauseDuration:(s.end-s.start)*t*1e3})}this.startedAt&&!this.playing&&(this.progress=this.currentTime)}get duration(){return Number(this.content.duration)}set duration(t){this.content.duration=t}get paused(){return this._paused}get ended(){return this.currentTime>=this.duration}get currentTime(){return(this.pausedAt?this.pausedAt:this.startedAt?Date.now()-this.startedAt:0)/1e3}set currentTime(t){this.setProgress(t/this.content.duration)}get progress(){return this.currentTime/this.content.duration}set progress(t){this.setProgress(t)}play(){this.startedPlaying(),this.wasPaused=!1,this.pausedAt?(this.startedAt=Date.now()-this.pausedAt,this._paused=!1,this.gotoTime(this.pausedAt),this.pausedAt=void 0):this.playing||(this.startedAt=Date.now(),void 0===this.startAt?this.gotoStep(0,0):this.gotoTime(this.duration*this.startAt*1e3),this.startAt=void 0),this._paused=!1,this.playing=!0}pause(){this._paused||null==this.currentIndex||null==this.startedAt||(this._paused=!0,this.stoppedPlaying(),clearTimeout(this._to),this.currentIndex>=0&&this.image.camera.stop(),this.ended?this.reset():this.pausedAt=Date.now()-this.startedAt)}reset(){this.stoppedPlaying(),this.pausedAt=void 0,this.playing=!1,this.read()}gotoStep(t,e){if(null==this.startedAt)return;if(clearTimeout(this._to),!this.timeline[t]){if(!this.paused||!this.wasPaused){const t=Math.max(0,Math.round(1e3*this.duration-(Date.now()-this.startedAt)));this._to=setTimeout(()=>this.pause(),t)}return}const i=this.timeline[t],s=Math.round(i.start-(Date.now()-this.startedAt));this.currentIndex=t,this.image.camera.stop(),s>0?this._paused||(this._to=setTimeout(()=>this.startAni(e),s)):this.startAni(e)}nextStep(){null!=this.currentIndex&&this.gotoStep(this.currentIndex+1)}getView(t){return this.timeline[t]?.view}startAni(t=0){if(null==this.currentIndex||isNaN(t))return;const e=this.timeline[this.currentIndex];if(null==e)return;const i=fn.toCenterJSON(e.view),s=this.getView(this.currentIndex-1),r=s?fn.toCenterJSON(s):void 0,n=this.image.opts?.area;if(this.wasPaused&&r){const e=this.micrio.engine.ease(t),s={centerX:r.centerX*(1-e)+i.centerX*e,centerY:r.centerY*(1-e)+i.centerY*e,width:r.width*(1-e)+i.width*e,height:r.height*(1-e)+i.height*e};this.image.camera.setView([s.centerX-s.width/2,s.centerY-s.height/2,s.width,s.height],{noLimit:!0,area:n}),this.nextStep()}else this.image.camera.flyToView(e.view,{duration:e.duration,progress:t,prevView:r?[r.centerX-r.width/2,r.centerY-r.height/2,r.width,r.height]:void 0,area:n}).then(()=>{null!=this.currentIndex&&e==this.timeline[this.currentIndex]&&this.nextStep()}).catch(()=>{})}startedPlaying(){this.micrio.setAttribute("data-videotour-playing",""),this.micrio.events.dispatch("videotour-play"),this.unhookEvents&&this.micrio.events.enabled.set(!1)}stoppedPlaying(){this.micrio.removeAttribute("data-videotour-playing"),this.micrio.events.dispatch("videotour-pause"),this.unhookEvents&&this.micrio.events.enabled.set(!0)}setProgress(t){t=Math.max(0,Math.min(1,t)),this.wasPaused=!!this.paused||!this.playing,this.pause(),this.wasPaused||(this._paused=!1,this.startedPlaying());const e=this.duration*t*1e3;this.pausedAt=e,this.gotoTime(e),this.wasPaused?this.pause():(this.pausedAt=void 0,this._paused=!1)}gotoTime(t){let e=null,i=0;for(;i<this.timeline.length&&!(this.timeline[i].start>t);i++)e=this.timeline[i];if(i--,e||!(i>0))if(e){this.image.camera.stop();const s=e.duration>0?(t-e.start)/e.duration:0;this.startedAt=Date.now()-e.start-e.duration*s,isNaN(this.startedAt)&&(this.startedAt=Date.now()-t),s>1?(this.gotoStep(i+1),null!=e.view&&this.image.camera.setView(e.view,{noLimit:!0})):(i>0&&this.image.camera.setView(this.timeline[i-1].view,{noLimit:!0}),this.gotoStep(i,s))}else this.timeline.length&&this.image.camera.stop(),this.paused||this.gotoStep(0)}};window.MicrioVideoTour=Ba;var qa={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},Wa=class{constructor(t,e,i={}){this.frame=t,this.config=e,this.callbacks=i,this.requiresTimeTick=!0,this.destroyed=!1}async initialize(){if("YT"in window||await mn("https://r2.micr.io/youtube.js","onYouTubeIframeAPIReady"),!("YT"in window))throw new Error("Failed to load YouTube API");return new Promise((t,e)=>{this.player=new window.YT.Player(this.frame,{host:Zn,width:this.config.width.toString(),height:this.config.height.toString(),playerVars:{controls:0},events:{onError:()=>{this.callbacks.onError?.(new Error("YouTube player error")),e(new Error("YouTube player error"))},onReady:()=>{this.destroyed?e(new Error("Player destroyed during initialization")):(this.callbacks.onReady?.(),this.callbacks.onDurationChange?.(this.player.getDuration()),t())},onStateChange:t=>this.handleStateChange(t.data)}})})}handleStateChange(t){switch(t){case qa.UNSTARTED:this.callbacks.onBlocked?.(),this.callbacks.onPause?.();break;case qa.ENDED:this.callbacks.onEnded?.();break;case qa.PLAYING:this.callbacks.onPlay?.(),this.callbacks.onSeeked?.();break;case qa.PAUSED:this.callbacks.onPause?.();break;case qa.BUFFERING:this.callbacks.onBuffering?.(),this.callbacks.onSeeking?.()}}async play(){this.player?.playVideo()}pause(){this.destroyed||this.player?.pauseVideo?.()}async getCurrentTime(){return this.player?.getCurrentTime?.()??0}setCurrentTime(t){this.callbacks.onSeeking?.(),this.player?.seekTo?.(t)}async getDuration(){return this.player?.getDuration?.()??0}async isPaused(){if(!this.player)return!0;const t=this.player.getPlayerState?.();return void 0===t||[qa.UNSTARTED,qa.ENDED,qa.PAUSED].includes(t)}setMuted(t){t?this.player?.mute?.():this.player?.unMute?.()}setVolume(t){}destroy(){this.destroyed=!0,this.player?.destroy?.(),this.player=void 0}},Ua=class{constructor(t,e,i={}){this.frame=t,this.config=e,this.callbacks=i,this.requiresTimeTick=!1,this.destroyed=!1}async initialize(){if("Vimeo"in window||await mn("https://r2.micr.io/vimeo.min.js"),!("Vimeo"in window))throw new Error("Failed to load Vimeo API");return new Promise((t,e)=>{this.player=new window.Vimeo.Player(this.frame,{width:this.config.width.toString(),height:this.config.height.toString(),title:!1,autoplay:!1});const i=this.player;i.on("error",()=>{this.callbacks.onError?.(new Error("Vimeo player error")),e(new Error("Vimeo player error"))}),i.on("loaded",()=>{this.destroyed?e(new Error("Player destroyed during initialization")):i.getVolume().then(()=>{this.callbacks.onReady?.(),t()})}),i.on("play",()=>{this.callbacks.onPlay?.(),this.callbacks.onSeeked?.()}),i.on("bufferstart",()=>{this.callbacks.onBuffering?.(),this.callbacks.onSeeking?.()}),i.on("seeked",()=>{this.callbacks.onSeeked?.()}),i.on("pause",()=>{this.callbacks.onPause?.()}),i.on("timeupdate",t=>{t&&(this.callbacks.onDurationChange?.(t.duration),this.callbacks.onTimeUpdate?.(t.seconds))}),i.on("ended",()=>{this.callbacks.onEnded?.()})})}async play(){this.player?.play()}pause(){this.player?.pause()}async getCurrentTime(){return await(this.player?.getCurrentTime?.())??0}setCurrentTime(t){this.player?.setCurrentTime?.(t)}async getDuration(){return await(this.player?.getDuration?.())??0}async isPaused(){return await(this.player?.getPaused?.())??!0}setMuted(t){this.player?.setVolume?.(t?0:1)}setVolume(t){this.player?.setVolume?.(Math.max(0,Math.min(1,t)))}destroy(){if(this.destroyed=!0,this.player){for(const t of["error","loaded","play","bufferstart","seeked","pause","volumechange","timeupdate","ended"])this.player.off(t);this.player.destroy(),this.player=void 0}}},Ha=class{constructor(t,e={}){this.element=t,this.callbacks=e,this.requiresTimeTick=!1,this.attachEventListeners()}attachEventListeners(){const t=this.element,e=this.callbacks;e.onPlay&&t.addEventListener("play",e.onPlay),e.onPause&&t.addEventListener("pause",e.onPause),e.onEnded&&t.addEventListener("ended",e.onEnded),e.onSeeking&&t.addEventListener("seeking",e.onSeeking),e.onSeeked&&t.addEventListener("seeked",e.onSeeked),e.onTimeUpdate&&t.addEventListener("timeupdate",()=>e.onTimeUpdate?.(t.currentTime)),e.onDurationChange&&t.addEventListener("durationchange",()=>e.onDurationChange?.(t.duration)),e.onError&&t.addEventListener("error",()=>e.onError?.(new Error("Media playback error"))),e.onReady&&t.addEventListener("canplay",e.onReady)}async play(){try{await this.element.play()}catch(t){throw t instanceof Error&&!/pause\(\)/.test(t.message)&&this.callbacks.onBlocked?.(),t}}pause(){this.element.pause()}async getCurrentTime(){return this.element.currentTime}setCurrentTime(t){this.element.currentTime=t}async getDuration(){return this.element.duration}async isPaused(){return this.element.paused}setMuted(t){this.element.muted=t}setVolume(t){this.element.volume=Math.max(0,Math.min(1,t))}destroy(){const t=this.element,e=this.callbacks;e.onPlay&&t.removeEventListener("play",e.onPlay),e.onPause&&t.removeEventListener("pause",e.onPause),e.onEnded&&t.removeEventListener("ended",e.onEnded),e.onSeeking&&t.removeEventListener("seeking",e.onSeeking),e.onSeeked&&t.removeEventListener("seeked",e.onSeeked)}},Ga=class{constructor(t,e,i={}){this.element=t,this.hlsSrc=e,this.callbacks=i,this.requiresTimeTick=!1,this.destroyed=!1}async initialize(){if("Hls"in window||await mn("https://r2.micr.io/hls-1.6.15.min.js",void 0,"Hls"in window?{}:void 0),!("Hls"in window))throw new Error("Failed to load HLS.js");if(this.destroyed)throw new Error("Adapter destroyed during initialization");const t=new window.Hls({abrEwmaDefaultEstimate:1e7,abrEwmaDefaultEstimateMax:5e7});this.hls=t,t.loadSource(this.hlsSrc),t.attachMedia(this.element),this.html5Adapter=new Ha(this.element,this.callbacks),this.callbacks.onReady?.()}async play(){return this.html5Adapter?.play()}pause(){this.html5Adapter?.pause()}async getCurrentTime(){return this.html5Adapter?.getCurrentTime()??Promise.resolve(0)}setCurrentTime(t){this.html5Adapter?.setCurrentTime(t)}async getDuration(){return this.html5Adapter?.getDuration()??Promise.resolve(0)}async isPaused(){return this.html5Adapter?.isPaused()??Promise.resolve(!0)}setMuted(t){this.html5Adapter?.setMuted(t)}setVolume(t){this.html5Adapter?.setVolume(t)}destroy(){this.destroyed=!0,this.html5Adapter?.destroy(),this.hls?.destroy(),this.hls=void 0,this.html5Adapter=void 0}},ja="micrio-captions-disable",Za=vt("1"!=localStorage.getItem(ja));Za.subscribe(t=>{t?localStorage.removeItem(ja):localStorage.setItem(ja,"1")});var Ja=Bi('<div><p class="micrio-subtitles"> </p></div>');function Ka(t,e){et(e,!0);const[i,s]=kt();let r=br(e,"raised",3,!1);const n=ue([]);fetch(Li(()=>e.src)).then(t=>t.text()).then(t=>{const e=t.split("\n");for(let i=0;i<e.length;i++)if(/-->/.test(e[i])){let t=i+1;const s=[];for(;!e[t]&&t<e.length;)t++;for(;e[t]&&e[t].trim();)s.push(e[t++]);const[r,a]=e[i].split(" --\x3e ").map(t=>t.trim().replace(",",".").split(":").map(Number)).map(t=>3===t.length?3600*t[0]+60*t[1]+t[2]:2===t.length?60*t[0]+t[1]:0);n.push({start:r,end:a,data:s.join("\n")}),i+=s.length+1}}).catch(t=>console.error("Subtitles: fetch error:",t));const a=Q("micrio");let o=ne(0);const h=t=>oe(o,t.detail,!0);ps(()=>(a.addEventListener("timeupdate",h),()=>a.removeEventListener("timeupdate",h)));const c=jt(()=>n.filter(t=>t.start<=Ei(o)&&t.end>=Ei(o)));var l=Hi(),d=_e(l),u=t=>{var e=Hi();bs(_e(e),16,()=>Ei(c),t=>t,(t,e)=>{var i=Ja();let s;var n=ke(i),a=ke(n,!0);q(n),q(i),Ye(()=>{s=qs(i,1,"micrio-subtitles",null,s,{raised:r()}),ns(a,e.data)}),Ds(3,i,()=>ia),Gi(t,i)}),Gi(t,e)};vs(d,t=>{xt(Za,"$captionsEnabled",i)&&t(u)}),Gi(t,l),it(),s()}var Qa=Bi('<div class="container micrio-progress-bar"><div class="bars micrio-progress-bar"><!></div> <div class="time micrio-progress-bar"> </div></div>');function to(t,e){et(e,!0);let i=br(e,"ended",11,!1);var s=Qa(),r=ke(s);gs(ke(r),()=>e.children??f),q(r);var n=Me(r,2),a=ke(n,!0);q(n),q(s),Ye((t,e)=>{Us(s,t),ns(a,e)},[()=>`--progress: ${Math.round((e.currentTime??0)/e.duration*1e4)/100}%;--time: '${hn(e.currentTime??0)}';`,()=>hn(i()||!e.currentTime||e.currentTime<=0?e.duration:(e.currentTime??0)-e.duration)]),Ri("click",s,t=>t.stopPropagation()),Ri("keydown",s,t=>t.stopPropagation()),Gi(t,s),it()}Xi(["click","keydown"]);var eo=Wi('<svg height="42" width="42" class="micrio-media-controls"><circle r="19" cx="21" cy="21" class="micrio-media-controls"></circle></svg>'),io=Bi("<!> <!> <!>",1),so=Bi('<div class="bar active"></div>'),ro=Bi('<aside class="micrio-media-controls"><!> <!></aside> <!>',1);Xi(["click","keydown","mousedown"]);var no=Bi("<iframe></iframe>"),ao=Bi('<source type="video/mp4;codecs=hvc1"/>'),oo=Bi("<!> <source/>",1),ho=Bi('<video playsinline="" class="micrio-media"><!></video>',2),co=Bi("<audio></audio>"),lo=Bi("<micr-io></micr-io>",2),uo=Bi("<aside><!></aside>"),mo=Bi('<figcaption class="micrio-media"></figcaption>'),go=Bi('<div class="show-play micrio-media" role="button"><!></div>'),po=Bi('<figure><div role="button"><!> <!> <!></div> <!></figure> <!>',1);function fo(t,e){et(e,!0);const i=()=>xt(R,"$_lang",s),[s,r]=kt(),n=Q("micrio");let a=br(e,"src",11,void 0),o=br(e,"volume",15,1),h=br(e,"width",3,640),c=br(e,"height",3,380),l=br(e,"frameScale",3,1),d=br(e,"autoplay",15,!1),u=br(e,"loop",3,!1),m=br(e,"loopDelay",3,void 0),g=br(e,"controls",15,!1),p=br(e,"title",3,void 0),f=br(e,"figcaption",3,null),v=br(e,"paused",15,!0),w=br(e,"forcePause",3,void 0),y=br(e,"seeking",15,!0),b=br(e,"duration",31,()=>-1),x=br(e,"currentTime",15),T=br(e,"is360",3,!1),k=br(e,"tour",3,null),_=br(e,"secondary",3,!1),M=br(e,"fullscreen",3,void 0),S=br(e,"className",3,null),E=br(e,"hasTransparentH265",3,!1),I=br(e,"noPlayOverlay",3,!1),A=br(e,"uuid",15,""),L=br(e,"image",19,()=>wt(n.current)),P=br(e,"destroying",3,void 0),$=br(e,"_media",15,void 0),C=ne(!1);A(A()+(a()??Li(()=>k())?.id));const D=Li(()=>L()).$info,{events:z,state:O,_lang:R}=n,X=Q("volume"),F=0==xt(X,"$mainVolume",s),Y=Q("srt"),N=Q("mediaPaused"),B=n.hasAttribute("data-native-frame"),W=function(t,e,i=!1,s=0){t=function(t){if(t)return/<iframe /.test(t)&&(t=t.replace(/^.* src="([^"]+)".*$/,"$1")),t.startsWith("video://")&&(t=t.replace("video:","https:")),t}(t);const r=t?.toLowerCase(),n={type:Wn.None,originalSrc:t,isCloudflare:!1};if(!t&&e)return n.type=Wn.VideoTour,n;if(!t||!r)return n;if(t.startsWith("cfvid://"))return n.isCloudflare=!0,n.cloudflareId=t.slice(8),n.hlsSrc=`https://videodelivery.net/${n.cloudflareId}/manifest/video.m3u8`,n.type=Wn.Video,n;if(r.endsWith(".mp3"))return n.type=Wn.Audio,n.src=t,n;if(r.endsWith(".mp4")||r.endsWith(".webm"))return n.type=Wn.Video,n.src=t,n;if(r.startsWith("micrio://"))return n.type=Wn.Micrio,n.micrioEmbed=t.slice(9).split(","),n;if(!i){const e=Hn.exec(t);if(e?.[5]){if("playlist"!==e[5]){n.type=Wn.IFrame,n.frameType=Un.YouTube,n.youtubeId=e[5];const i=jn.test(t)?Number(t.replace(jn,"$1")):s;return n.startTime=Math.round(i),n.src=`${Zn}/embed/${e[5]}?autoplay=0&enablejsapi=1&controls=0&start=${n.startTime}`,n}{const e=/list=([^&]+)/.exec(t);if(e?.[1])return n.type=Wn.IFrame,n.src=`${Zn}/embed/videoseries?list=${e[1]}`,n}}if(Gn.test(t)){const e=t.match(/\/(\d+)/);if(e?.[1]){n.type=Wn.IFrame,n.frameType=Un.Vimeo,n.vimeoId=e[1],n.vimeoToken=t.slice(t.indexOf(e[1])+e[1].length+1).replace(/\?.*$/,"")||void 0;const i=Math.round(s);return n.src=`https://player.vimeo.com/video/${e[1]}?${n.vimeoToken?`h=${n.vimeoToken}&`:""}title=0&portrait=0&sidedock=0&byline=0&controls=0#t=${i}s`,n}}}return r.startsWith("http")?(n.type=Wn.IFrame,n.src=t,n):n}(a(),Li(()=>k()),B,x()??0),{type:U,frameType:H,isCloudflare:G,micrioEmbed:j,hlsSrc:Z}=W;let J,K=ne(ue(W.src??a()));U==Wn.Micrio&&v(!1),(U==Wn.Micrio||U==Wn.IFrame&&!H)&&g(!1);let tt=-1,st=ne(ue(H==Un.YouTube||H==Un.Vimeo));const rt=U==Wn.Audio&&ln.iOS;let nt,at=ne(void 0);const ot=O.mediaState.get(A());ot&&(x(ot.currentTime),d(!v(ot.paused))),O.mediaState.set(A(),{get currentTime(){return x()??0},set currentTime(t){Et(t)},get paused(){return v()},set paused(t){t?yt():vt()}});let ht=ne(void 0);{const t=Li(()=>k());if(t){const e=new Ba(Li(()=>L()),t);null!=x()&&x()>0&&(e.currentTime=x()),U==Wn.VideoTour&&(b("duration"in t?Number(t.duration):t.i18n?.[i()]?.duration??0),o(NaN)),oe(ht,e,!0)}}const ct=Li(()=>k()&&!("steps"in k())?"subtitle"in k()?k().subtitle:k().i18n?.[n.lang]?.subtitle:void 0),lt=ct&&("fileUrl"in ct?ct.fileUrl:ct.src);let dt,ut=ne(!1),mt=ne(!1),gt=!1,pt=ne(!1);function ft(t){t&&"button"in t&&0!=t.button||(v()?vt():yt())}async function vt(t){if(!(t instanceof PointerEvent&&0!=t.button)&&(!gt||await async function(){return $()?$().paused:Ei(ht)?v():!!J&&J.isPaused()}())){switch(oe(mt,!1),b()>0&&null!=x()&&x()>=b()&&x(0),!_()&<&&Y.set(lt),U){case Wn.VideoTour:v(y(!1)),Ei(ht)?.play(),Lt();break;case Wn.Audio:case Wn.Video:$()?.addEventListener("play",()=>{$()&&(isNaN($().duration)?$().addEventListener("durationchange",bt,{once:!0}):bt())},{once:!0}),$()?.play().catch(t=>{I()?v(!0):/pause\(\)/.test(t.toString())||(oe(ut,!0),n.events.dispatch("media-blocked"),e.onblocked?.())});break;case Wn.IFrame:J?.play();break;default:return}gt=!0,z.dispatch("media-play"),N.set(!1),e.onplay?.(),T()||F||Ei(ht)&&!$()||X.set(L().$settings.mutedVolume||0)}}function yt(){z.dispatch("media-pause"),N.set(!0),$()?($().pause(),rt&&v(!0)):Ei(ht)?(Ei(ht).pause(),v(!0),Pt()):J&&!Ei(Ot)&&J.pause()}function bt(){oe(ut,!1),v(!1),Ei(ht)&&$()&&($().duration>Ei(ht).duration&&(Ei(ht).duration=$().duration),Ei(ht).currentTime=$().currentTime,Ei(ht).play())}function Tt(){y(!1),T()&&L()&&!L()._video&&L().video.set($())}function _t(){Ei(mt)||(Ei(ht)?yt():(v(!0),Pt()),oe(mt,!0),z.dispatch("media-ended"),e.onended?.(),zt())}function Mt(t){$()?$($().muted=t,!0):J&&J.setMuted(t)}function St(){oe(C,!Ei(C)),Mt(Ei(C)),F||X.set(Ei(C)?1:L().$settings.mutedVolume||0)}function Et(t){y(!0),$()?$($().currentTime=t,!0):Ei(ht)?(x(Ei(ht).currentTime=t),y(!1)):J&&J.setCurrentTime(t)}function It(){Ei(ht)?(x(Ei(ht).currentTime),Ei(ht).ended&&_t()):J&&J.getCurrentTime().then(t=>{x(t)}),At()}function At(){_()||z.dispatch("timeupdate",x())}function Lt(){tt>=0||(tt=setInterval(It,250),It())}function Pt(){clearInterval(tt),tt=-1}async function $t(){if(G&&Z&&("MediaSource"in window||"ManagedMediaSource"in window)){const t=new Ga($(),Z,{onReady:()=>y(!1),onEnded:_t});return await t.initialize(),void(J=t)}if(U==Wn.IFrame&&Ei(at)){if(H==Un.YouTube){const t=new Wa(Ei(at),{width:Ei(qt),height:Ei(Wt)},{onReady:()=>y(!1),onDurationChange:t=>b(t),onPlay:()=>{Lt(),oe(pt,v(y(!1)),!0)},onPause:()=>{v(!0),Pt()},onEnded:_t,onBlocked:()=>{oe(pt,v(!0),!0),Pt()},onSeeking:()=>{It(),y(!0),Pt()}});return y(!0),await t.initialize(),void(J=t)}if(H==Un.Vimeo){const t=new Ua(Ei(at),{width:Ei(qt),height:Ei(Wt)},{onReady:()=>y(!1),onPlay:()=>v(y(!1)),onPause:()=>v(!0),onSeeking:()=>y(!0),onSeeked:()=>y(!1),onTimeUpdate:t=>x(t),onDurationChange:t=>b(t),onEnded:_t});return y(!0),await t.initialize(),void(J=t)}}$()&&(G&&Z&&oe(K,Z,!0),function(){if(!$())return;$($().ontimeupdate=At,!0),Ei(ht)&&($($().onpause=()=>{Dt=!!$()?.ended,$()?.ended||Ei(ht).pause()},!0),$($().onseeked=()=>{!$()||$().ended||Dt||(Ei(ht).currentTime=$().currentTime,Ct&&($().pause(),Ct=!1))},!0));null!=x()&&x()>0&&($().duration>0?$($().currentTime=x(),!0):$($().oncanplay=()=>{$()&&($($().oncanplay=null,!0),d()||($().play(),Ct=!0),$($().currentTime=nt,!0))},!0));const t=u()&&void 0!==m()?m():-1;$($().onended=t>=0?()=>{clearTimeout(dt),dt=setTimeout(()=>{w()||$()?.play()},1e3*t)}:_t,!0)}())}let Ct=!1,Dt=!1;function zt(){F||X.set(1)}let Ot=ne(!1);const Rt=Li(()=>P()&&P().subscribe(t=>{t&&Ft()})),Xt=()=>x($()?.currentTime??0);function Ft(){Ei(Ot)||(oe(Ot,!0),Rt&&Rt(),T()&&L()&&L().video.set(void 0),O.mediaState.delete(A()),Pt(),yt(),zt(),lt&&Y.set(void 0),$()&&($($().onended=null,!0),rt&&($($().onloadedmetadata=$($().onplay=$($().onseeking=$($().onseeked=null,!0),!0),!0),!0),$().removeEventListener("timeupdate",Xt)),$($().ontimeupdate=$($().onpause=$($().onseeked=$($().oncanplay=null,!0),!0),!0),!0)),Ei(ht)&&Ei(ht).destroy(),J&&(J.destroy(),J=void 0))}const Vt=U==Wn.Video;let Yt=ne(ue(Li(()=>Vt&&G&&1!=l()&&ln.iOS)));const Nt=D.is360?Math.PI/2:1,Bt=jt(()=>Vt?l()*Nt:U==Wn.IFrame?Math.max(l(),Math.min(h()/512,c()/512)):1),qt=jt(()=>Vt?h():Math.round(h()/Ei(Bt)*Nt)),Wt=jt(()=>Vt?c():Math.round(c()/Ei(Bt)*Nt));let Ut=ne(void 0),Ht=ne(void 0);const Gt=jt(()=>Ei(ht)&&k()?"events"in k()?k().events:k().i18n?.[i()]?.events??void 0:void 0);ps(()=>{e.onid?.(A()),a()&&rt&&($((qn||(qn=new Audio),qn)),$($().controls=!1,!0),$($().onloadedmetadata=()=>b($()?.duration??0),!0),$($().src=a(),!0),$($().oncanplay=Tt,!0),$($().onended=_t,!0),$().addEventListener("timeupdate",Xt),$($().onseeking=()=>y(!0),!0),$($().onseeked=()=>y(!1),!0)),nt=x()||0,oe(st,H==Un.YouTube||H==Un.Vimeo,!0),$t().then(()=>{d()&&vt()}).catch(()=>{}),Ei(Yt)&&$()?.addEventListener("playing",()=>oe(Yt,!1),{once:!0});let t=!1;const i=n.isMuted.subscribe(e=>{t?(oe(C,e,!0),Mt(e)):t=!0});return()=>{Ft(),i(),rt&&$(void 0),J?.destroy()}}),Re(()=>{void 0!==w()&&v(w())}),Re(()=>{u()&&void 0!==m()&&clearTimeout(dt)});var Zt=Hi(),Jt=_e(Zt),Kt=t=>{var e=po(),i=_e(e);let r;Us(i,null);var n=ke(i);let a;ar(n,"tabindex",-1);var l=ke(n),w=t=>{var e=no();hr(e,t=>({...t,title:p(),src:Ei(K),width:Ei(qt),height:Ei(Wt),frameborder:"0",allow:"fullscreen *;autoplay *;encrypted-media *",[js]:{hooked:Ei(st)&&!Ei(pt)}}),[()=>({credentialless:!0})],void 0,void 0,"micrio-media"),fr(e,t=>oe(at,t),()=>Ei(at)),function(t){if(!V)return;t.removeAttribute("onload"),t.removeAttribute("onerror");const e=t.__e;void 0!==e&&(t.__e=void 0,queueMicrotask(()=>{t.isConnected&&t.dispatchEvent(e)}))}(e),Gi(t,e)},k=t=>{var e=ho();e.controls=!1;var i=ke(e),s=t=>{var e=oo(),i=_e(e),s=t=>{var e=ao();Ye(t=>ar(e,"src",t),[()=>Ei(K).replace(".webm",".mp4")]),Gi(t,e)},r=jt(()=>E()&&Ei(K).endsWith(".webm"));vs(i,t=>{Ei(r)&&t(s)});var n=Me(i,2);Ye(()=>{ar(n,"src",Ei(K)),ar(n,"type",G?"application/x-mpegURL":void 0)}),Gi(t,e)};vs(i,t=>{Ei(K)&&t(s)}),q(e),fr(e,t=>$(t),()=>$()),Ye(()=>{e.loop=u()&&(null==m()||m()<=0),ar(e,"width",h()),ar(e,"height",c()),Us(e,Ei(Yt)?"opacity: 0":void 0),e.muted=Ei(C),e.autoplay=!!d()}),Oi("canplay",e,Tt),Oi("ended",e,_t),vr("duration","durationchange",e,b),ur(e,x),mr(e,y),gr(e,v),Gi(t,e)},_=t=>{var e=co();e.controls=!1,fr(e,t=>$(t),()=>$()),Ye(()=>{ar(e,"src",Ei(K)),e.muted=Ei(C)}),Oi("canplay",e,()=>y(!1)),Oi("ended",e,_t),vr("duration","durationchange",e,b),ur(e,x),mr(e,y),gr(e,v),Gi(t,e)},I=t=>{var e=lo();or(e,"data-logo","false"),Ye(()=>or(e,"id",j[0])),Ye(()=>or(e,"width",j[1])),Ye(()=>or(e,"height",j[2])),Ye(()=>or(e,"lang",j[3])),Ye(()=>or(e,"data-path",D.path)),Gi(t,e)};vs(l,t=>{U==Wn.IFrame?t(w):U==Wn.Video?t(k,1):U!=Wn.Audio||rt?U==Wn.Micrio&&j&&t(I,3):t(_,2)});var A=Me(l,2),L=t=>{!function(t,e){et(e,!0);let i=br(e,"currentTime",11,0);const s=Q("micrio");e.events.forEach(t=>{t.start=Number(t.start||0),t.end=Math.min(Number(t.end||0),e.duration)});const r=t=>e.events.forEach(e=>{const i=e.start<=t&&e.end>=t;i!=!!e.active&&(e.active=i,s.events.dispatch("tour-event",{...e}))});Re(()=>{r(i())}),fs(()=>r(1/0)),it()}(0,{get events(){return Ei(Gt)},get currentTime(){return x()},set currentTime(t){x(t)},get duration(){return b()},set duration(t){b(t)}})};vs(A,t=>{Ei(Gt)?.length&&b()>0&&!Ei(Ot)&&t(L)});var P=Me(A,2),z=t=>{var e=uo();let i;var s=ke(e);{let t=jt(()=>!!lt),e=jt(()=>!isNaN(o())),i=jt(()=>T()||U!=Wn.IFrame&&U!=Wn.Video?M():Ei(Ut));!function(t,e){et(e,!0);const i=()=>xt(ca,"$i18n",r),s=()=>xt(Za,"$captionsEnabled",r),[r,n]=kt();let a=br(e,"currentTime",15),o=br(e,"duration",11,0),h=br(e,"seeking",11,!0),c=br(e,"minimal",3,!1),l=br(e,"ended",15),d=br(e,"fullscreen",3,void 0),u=br(e,"subtitles",3,!1),m=br(e,"hasAudio",3,!0),g=br(e,"muted",3,!1),p=ne(void 0);function f(t){0==t.button&&(window.addEventListener("mousemove",v),window.addEventListener("mouseup",w),v(t))}function v(t){const i=Ei(p).getClientRects()[0],s=Math.min(1,Math.max(0,(t.clientX-i.left)/i.width));e.onseek?.(s*o())}function w(){window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",w)}var y=ro(),b=_e(y),x=ke(b);{let t=jt(()=>e.paused?"play":"pause"),s=jt(()=>e.paused?i().play:i().pause);Ea(x,{get type(){return Ei(t)},get title(){return Ei(s)},get onclick(){return e.onplaypause},children:(t,e)=>{var i=Hi(),s=_e(i),r=t=>{var e=eo(),i=ke(e);q(e),Ye(()=>ar(i,"stroke-dashoffset",119.4*(1-a()/o()))),Gi(t,e)};vs(s,t=>{c()&&void 0!==a()&&a()>0&&t(r)}),Gi(t,i)},$$slots:{default:!0}})}var T=Me(x,2),k=t=>{var r=io(),n=_e(r),a=t=>{{let s=jt(()=>g()?"volume-off":"volume-up"),r=jt(()=>g()?i().audioUnmute:i().audioMute);Ea(t,{get disabled(){return h()},get type(){return Ei(s)},get title(){return Ei(r)},get onclick(){return e.onmute}})}};vs(n,t=>{m()&&t(a)});var o=Me(n,2),c=t=>{{let e=jt(()=>s()?"subtitles":"subtitles-off");Ea(t,{get type(){return Ei(e)},get active(){return s()},get title(){return i().subtitlesToggle},onclick:()=>Za.set(!s())})}};vs(o,t=>{u()&&t(c)});var l=Me(o,2),p=t=>{Da(t,{get el(){return d()}})};vs(l,t=>{d()&&t(p)}),Gi(t,r)};vs(T,t=>{c()||t(k)}),q(b);var _=Me(b,2),M=t=>{to(t,{get duration(){return o()},get currentTime(){return a()},set currentTime(t){a(t)},get ended(){return l()},set ended(t){l(t)},children:(t,e)=>{var i=so();fr(i,t=>oe(p,t),()=>Ei(p)),Ye(()=>Us(i,`--progress:${(a()??0)/o()*100}%;`)),Ri("mousedown",i,f),Gi(t,i)},$$slots:{default:!0}})};vs(_,t=>{c()||t(M)}),Ri("click",b,t=>t.stopPropagation()),Ri("keydown",b,t=>t.stopPropagation()),Gi(t,y),it(),n()}(s,{get subtitles(){return Ei(t)},get hasAudio(){return Ei(e)},get muted(){return Ei(C)},get fullscreen(){return Ei(i)},onplaypause:ft,onmute:St,onseek:t=>Et(t),get paused(){return v()},set paused(t){v(t)},get seeking(){return y()},set seeking(t){y(t)},get duration(){return b()},set duration(t){b(t)},get currentTime(){return x()},set currentTime(t){x(t)},get ended(){return Ei(mt)},set ended(t){oe(mt,t,!0)}})}q(e),Ye(()=>i=qs(e,1,"micrio-media",null,i,{inside:"inside"==g()})),Gi(t,e)};vs(P,t=>{g()&&t(z)}),q(n),fr(n,t=>oe(Ht,t),()=>Ei(Ht));var O=Me(n,2),R=t=>{var e=mo();Ms(e,f,!0),q(e),Gi(t,e)};vs(O,t=>{f()&&t(R)}),q(i),fr(i,t=>oe(Ut,t),()=>Ei(Ut));var X=Me(i,2),F=t=>{var e=go();ar(e,"tabindex",-1),Ea(ke(e),{get title(){return xt(ca,"$i18n",s).play},type:"play"}),q(e),Ri("pointerup",e,vt),Gi(t,e)};vs(X,t=>{Ei(ut)&&t(F)}),Ye(()=>{r=qs(i,1,Vs(S()),"micrio-media",r,{paused:v(),is360:T(),"media-video":U==Wn.IFrame||U==Wn.Video,"media-micrio":U==Wn.Micrio}),Us(n,1==Ei(Bt)||U!=Wn.Video&&D.is360?"":`transform:scale(${Ei(Bt)})`),a=qs(n,1,"micrio-media",null,a,{videotour:!!Ei(ht)})}),Ri("pointerup",n,t=>{t.target==Ei(Ht)&&ft(t)}),Gi(t,e)};vs(Jt,t=>{L().$settings.noUI||t(Kt)}),Gi(t,Zt),it(),r()}Xi(["pointerup"]);var vo=Bi("<article><!></article>");function wo(t,e){et(e,!0);let i=br(e,"cn",3,null);function s(t){t.target&&t.target instanceof HTMLAnchorElement&&!t.target.getAttribute("href")?.startsWith("#")&&(t.target.target="_blank")}var r=vo();gs(ke(r),()=>e.children??f),q(r),Ye(()=>qs(r,1,Vs(i()),"micrio-article")),Ri("click",r,t=>t.stopPropagation()),Ri("keydown",r,s),Ri("pointerdown",r,s),Gi(t,r),it()}Xi(["click","keydown","pointerdown"]);var yo=Bi('<h1 class="micrio-marker-content"> </h1>'),bo=Bi('<figcaption class="micrio-marker-content"> </figcaption>'),xo=Bi('<button class="micrio-marker-content"><figure class="micrio-marker-content"><img class="micrio-marker-content"/> <!></figure></button>'),To=Bi('<section class="micrio-marker-content"></section>'),ko=Bi("<!> <!>",1),_o=Bi("<main><!> <!> <!> <!> <!> <!> <!></main>");function Mo(t,e){et(e,!0);const i=()=>xt(m,"$tour",r),s=()=>xt(u,"$lang",r),[r,n]=kt();let a=br(e,"noEmbed",3,!1),o=br(e,"noImages",3,!1),h=br(e,"noGallery",3,!1),c=br(e,"_content",15),l=br(e,"_title",15);const d=Q("micrio"),u=d._lang,m=d.state.tour,g=i()&&"steps"in i()&&i().isSerialTour,p=Q("markerImages").get(Li(()=>e.marker).id),f=p.$settings._markers??{},v=!f.preventAutoPlay,w=Li(()=>!e.marker.data?.preventImageOpen&&!h()),y=Li(()=>1==e.marker.images?.length),b=jt(()=>Kn(e.marker,s())),x=jt(()=>!(Ei(b)?.title||Ei(b)?.audio||e.marker.images&&e.marker.images.length||Ei(b)?.embedUrl||e.marker.videoTour||Ei(b)?.body||Ei(b)?.bodySecondary)),T=()=>{i()&&"steps"in i()&&(i().isSerialTour||f.tourAutoProgress)&&e.onclose?.()};const k=jt(()=>!v||!e.marker?.audioAutoPlay),_=jt(()=>!1===e.marker?.embedAutoPlay||!v||!(!Ei(b)?.audio||!e.marker?.audioAutoPlay)),M=p.tileBase?.includes("micrio.dev"),S=t=>t.i18n?.[s()]?.title,E=jt(()=>e.marker.videoTour?.i18n?.[s()]?.audio??Ei(b)?.audio),I=jt(()=>Jn(Ei(E))),A=jt(()=>y&&e.marker.images?.[0]?.i18n?.[s()]?.description);var L=Hi(),P=_e(L),$=t=>{var i=_o();let s;var r=ke(i),n=t=>{var e=yo(),i=ke(e,!0);q(e),fr(e,t=>l(t),()=>l()),Ye(()=>ns(i,Ei(b).title)),Gi(t,e)};vs(r,t=>{Ei(b).title&&t(n)});var h=Me(r,2),u=t=>{wo(t,{children:(t,e)=>{var i=Hi();Ms(_e(i),()=>Ei(b).body),Gi(t,i)},$$slots:{default:!0}})};vs(h,t=>{Ei(b).body&&f.primaryBodyFirst&&t(u)});var m=Me(h,2),E=t=>{{let i=jt(()=>e.marker.audioAutoPlay||!Ei(b).audio&&!!e.marker.videoTour),s=jt(()=>!e.marker.videoTour||!Ei(b)||!Ei(b).embedUrl);fo(t,{get src(){return Ei(I)},noPlayOverlay:!0,get image(){return p},get uuid(){return e.marker.id},get tour(){return e.marker.videoTour},get autoplay(){return Ei(i)},get controls(){return Ei(s)},onended:T,get paused(){return Ei(k)}})}};vs(m,t=>{!g&&((!Ei(b)||!Ei(b).embedUrl)&&e.marker.videoTour||Ei(b)&&Ei(b).audio)&&t(E)});var L=Me(m,2),P=t=>{var i=To();bs(i,21,()=>e.marker.images,t=>t.id??t.src,(t,i)=>{var s=xo(),r=ke(s),n=ke(r),a=Me(n,2),o=t=>{var e=bo(),i=ke(e,!0);q(e),Ye(()=>ns(i,Ei(A))),Gi(t,e)};vs(a,t=>{Ei(A)&&t(o)}),q(r),q(s),Ye((t,e,i)=>{ar(s,"title",t),s.disabled=!w,ar(n,"alt",e),ar(n,"src",i)},[()=>S(Ei(i)),()=>S(Ei(i)),()=>Ei(i).micrioId?`https://iiif.${M?"micrio.dev":"micr.io"}/${Ei(i).micrioId}/full/${y?"^"+Math.min(Ei(i).width,640)+",":"^,320"}/0/default.webp`:Ei(i).src]),Ri("click",s,function(...t){(w?()=>{return t=Ei(i).micrioId,void(w&&d.state.popover.set({gallery:e.marker.images,galleryStart:t,image:p}));var t}:void 0)?.apply(this,t)}),Gi(t,s)}),q(i),Gi(t,i)};vs(L,t=>{!o()&&e.marker.images?.length&&t(P)});var $=Me(L,2),C=t=>{var i=ko(),s=_e(i),r=t=>{fo(t,{get image(){return p},className:"hidden",get uuid(){return e.marker.id},get tour(){return e.marker.videoTour},get autoplay(){return v},secondary:!0})};vs(s,t=>{!Ei(b).audio&&e.marker.videoTour&&t(r)});var n=Me(s,2);{let t=jt(()=>!Ei(_));fo(n,{get image(){return p},get src(){return Ei(b).embedUrl},get uuid(){return e.marker.id},width:400,height:240,controls:!0,get title(){return Ei(b).embedTitle},get figcaption(){return Ei(b).embedDescription},get autoplay(){return Ei(t)},onended:T,get paused(){return Ei(_)}})}Gi(t,i)};vs($,t=>{Ei(b).embedUrl&&!a()&&t(C)});var D=Me($,2),z=t=>{wo(t,{children:(t,e)=>{var i=Hi();Ms(_e(i),()=>Ei(b).body),Gi(t,i)},$$slots:{default:!0}})};vs(D,t=>{Ei(b).body&&!f.primaryBodyFirst&&t(z)});var O=Me(D,2),R=t=>{wo(t,{cn:"secondary",children:(t,e)=>{var i=Hi();Ms(_e(i),()=>Ei(b).bodySecondary),Gi(t,i)},$$slots:{default:!0}})};vs(O,t=>{Ei(b).bodySecondary&&t(R)}),q(i),fr(i,t=>c(t),()=>c()),Ye(()=>s=qs(i,1,"micrio-marker-content",null,s,{empty:Ei(x)})),Gi(t,i)};vs(P,t=>{Ei(b)&&t($)}),Gi(t,L),it(),n()}Xi(["click"]);var So=Bi('<button class="micrio-button tour-step micrio-marker-popup" disabled=""> </button>'),Eo=Bi("<!> <!> <!>",1),Io=Bi('<progress class="progress micrio-marker-popup"></progress> <!>',1),Ao=Bi('<div><aside class="micrio-marker-popup"><!> <!> <!></aside> <!></div>');function Lo(t,e){et(e,!0);const i=()=>xt(c,"$tour",n),s=()=>xt(h,"$current",n),r=()=>xt(ca,"$i18n",n),[n,a]=kt(),o=Q("micrio"),{current:h}=o,c=o.state.tour,l=Q("markerImages").get(Li(()=>e.marker).id),d=l.$settings._markers??{},u=jt(()=>i()&&"steps"in i()?o.canvases.find(t=>t.$data?.markerTours?.find(t=>t.id===i().id)):void 0),m=Li(()=>e.marker.data||{}),g=d.canMinimizePopup;let p=ne(void 0);function f(t){i()&&Ei(w)&&"steps"in i()?t instanceof Event&&Ei(T)?c.set(void 0):i().next?.():s()&&!l.opts.secondaryTo&&s().id!=l.id&&m.micrioLink?.id==s().id?(o.open(l.id),l.state.marker.set(void 0),o.state.popup.set(void 0)):l.state.marker.set(void 0)}const v=jt(()=>i()&&"steps"in i()?i():void 0),w=jt(()=>Ei(v)&&Ei(v)?.steps.findIndex(t=>t.startsWith(e.marker.id))>=0),y=jt(()=>Ei(w)&&!Ei(v)?.isSerialTour&&(Ei(u)?.$settings._markers?.tourControlsInPopup??d.tourControlsInPopup)),b=jt(()=>Ei(w)&&!Ei(v)?.isSerialTour&&(Ei(u)?.$settings._markers?.tourStepCounterInPopup??d.tourStepCounterInPopup)),x=jt(()=>Ei(v)?.currentStep??-1),T=jt(()=>Ei(y)||(Ei(v)?Ei(v).currentStep==Ei(v).steps.length-1:void 0));let k=ne(!1);const _=(t=!1)=>{Ei(v)&&(t?Ei(v).prev?.():Ei(v).next?.(),oe(k,!0),setTimeout(()=>oe(k,!1),200))};let M=ne(!1),S=ne(void 0),E=ne(void 0);const I=new WeakMap,A=()=>{if(oe(M,!Ei(M)),Ei(S))for(let t=0;t<Ei(S).children.length;t++){const e=Ei(S).children[t];e instanceof HTMLElement&&e!=Ei(E)&&(I.has(e)||(I.set(e,e.offsetHeight),e.style.height=e.offsetHeight+"px"),setTimeout(()=>{e.style.height=Ei(M)?"0px":I.get(e)+"px"},100))}};let L=ne(!1);ps(()=>{e.marker.tags?.forEach(t=>Ei(p)?.classList.add(t)),setTimeout(()=>Ei(p)?.querySelector("button")?.focus(),500);const t="embedImages"in e.marker?e.marker.embedImages:void 0;t&&o.$current?.data.update(e=>(e||(e={embeds:[]}),e.embeds=[...e.embeds??[],...t],e));const i=o.state.popup.subscribe(t=>oe(L,!t||t!=e.marker,!0));return()=>{i(),t&&o.$current?.data.update(e=>e?.embeds?(e.embeds=e.embeds.filter(e=>!t.find(t=>t.id==e.id)),e):e)}});var P=Ao();let $;var C=ke(P),D=ke(C),z=t=>{{let e=jt(()=>!Ei(w)||Ei(T)?"close":"arrow-right"),i=jt(()=>!Ei(w)||Ei(T)?r().closeMarker:r().tourStepNext);Ea(t,{get type(){return Ei(e)},get title(){return Ei(i)},get disabled(){return Ei(k)},onclick:f})}};vs(D,t=>{m.alwaysOpen||t(z)});var O=Me(D,2),R=t=>{{let e=jt(()=>Ei(M)?"arrow-up":"arrow-down");Ea(t,{get type(){return Ei(e)},get title(){return r().minimize},onclick:A})}};vs(O,t=>{g&&t(R)});var X=Me(O,2),F=t=>{var e=Io(),s=_e(e);ar(s,"aria-hidden",!0),Ca(Me(s,2),{className:"micrio-tour-controls",children:(t,e)=>{var s=Eo(),n=_e(s);{let t=jt(()=>Ei(k)||0==Ei(x));Ea(n,{type:"arrow-left",get disabled(){return Ei(t)},get title(){return r().tourStepPrev},onclick:()=>_(!0)})}var a=Me(n,2),o=t=>{var e=So(),s=ke(e);q(e),Ye(()=>ns(s,`${Ei(x)+1} / ${i().steps.length??""}`)),Gi(t,e)};vs(a,t=>{Ei(b)&&t(o)});var h=Me(a,2);{let t=jt(()=>Ei(k)||Ei(x)+1==i().steps.length);Ea(h,{type:"arrow-right",get disabled(){return Ei(t)},get title(){return r().tourStepNext},onclick:()=>_()})}Gi(t,s)},$$slots:{default:!0}}),Ye(()=>function(t,e){var i=cr(t);i.value!==(i.value=e??void 0)&&(t.value!==e||0===e&&t.nodeName===sr)&&(t.value=e??"")}(s,(Ei(x)+1)/i().steps.length)),Gi(t,e)};vs(X,t=>{Ei(y)&&i()&&"steps"in i()&&t(F)}),q(C),Mo(Me(C,2),{get marker(){return e.marker},onclose:f,get _content(){return Ei(S)},set _content(t){oe(S,t,!0)},get _title(){return Ei(E)},set _title(t){oe(E,t,!0)}}),q(P),fr(P,t=>oe(p,t),()=>Ei(p)),Ye(()=>$=qs(P,1,"micrio-marker-popup",null,$,{destroying:Ei(L),minimized:Ei(M)})),Ds(3,P,()=>sa,()=>d.popupAnimation),Gi(t,P),it(),a()}var Po=Bi('<li><button class="micrio-serial-tour"> </button></li>'),$o=Bi('<ol class="micrio-serial-tour"></ol>'),Co=Bi("<!> <!> <!> <!>",1),Do=Bi('<div role="progressbar"></div>'),zo=Bi('<!> <aside class="micrio-media-controls micrio-serial-tour"><!> <!></aside> <!>',1);function Oo(t,e){et(e,!0);const i=()=>xt(c,"$lang",n),s=()=>xt(ca,"$i18n",n),r=()=>xt(Za,"$captionsEnabled",n),[n,a]=kt(),o=Li(()=>e.tour).stepInfo,h=Q("micrio"),c=h._lang,l=h.$current,d=h.state.marker,u=!!l.$settings?.ui?.controls?.serialTourNoTimeScrub,m=o.reduce((t,e)=>t+e.duration,0)??0,g=Li(()=>"controls"in e.tour?!1!==e.tour.controls:!e.tour.noControls);let p=ne(!1),f=ne(!1),v=ne(!1);Re(()=>h.isMuted.subscribe(t=>{oe(v,t,!0)}));let w=ne(void 0),y=ne(void 0),b=ne(0),x=ne("");function T(){const t=h.state.mediaState.get(Ei(x));t&&(t.paused=oe(p,!t.paused)),Ei(p)?(h.events.dispatch("serialtour-pause",e.tour),h.events.enabled.set(!0)):(h.events.dispatch("serialtour-play",e.tour),h.events.enabled.set(!1))}function k(t,i){if(!e.tour.goto)return;const s=t==e.tour.currentStep;if(u&&s)return;s||e.tour.goto(t);const r=!u&&i?i.offsetX/i.target.offsetWidth:0;o.forEach((e,s)=>e.ended=!i&&s<t),S();const n=o[t];n.currentTime=r*n.duration,s&&Ei(w)?.instance&&(Ei(w).instance.currentTime=n.currentTime),I(t)}function _(){h.isMuted.update(t=>!t)}function M(){const t=Ei(y);t&&(t.ended=!0),null!=e.tour.currentStep&&e.tour.currentStep<e.tour.steps.length-1&&e.tour.next?e.tour.next():(oe(p,oe(f,!0),!0),e.onended?.()),Si().then(()=>{S(),t&&(t.ended=!1)})}function S(){e.tour.stepInfo?.forEach(t=>t.currentTime=0)}const E=vt([]);function I(t=e.tour.currentStep??0){const i=o.map((e,i)=>i<t||e.ended||Ei(f)?100:i==t?Math.round((e.currentTime||0)/e.duration*1e4)/100:0);oe(b,i.reduce((t,e,i)=>t+e/100*o[i].duration,0),!0),E.set(i)}function A(t){const i=t&&!!e.tour.steps.find(e=>e.startsWith(t.id));oe(w,void 0),i&&t.videoTour&&setTimeout(()=>{const i=o[e.tour.currentStep??0];i.markerId==t.id&&(i.ended=!1,oe(y,i,!0),oe(w,t.videoTour,!0),I())},10)}const L=t=>t.i18n?t.i18n[i()]?.title:t.title;ps(()=>{const t=()=>I();h.addEventListener("timeupdate",t);const e=d.subscribe(A);return()=>{e(),h.removeEventListener("timeupdate",t),S()}});const P=jt(()=>Ei(w)?"audio"in Ei(w)?Ei(w).audio:Ei(w).i18n?.[i()]?.audio:void 0),$=jt(()=>Jn(Ei(P))),C=jt(()=>!!Ei(y)?.hasSubtitle),D=jt(()=>o.some(t=>t.hasSubtitle));var z=zo(),O=_e(z),R=t=>{var e=$o();bs(e,21,()=>o,ws,(t,e,i)=>{var s=Hi(),r=_e(s),n=t=>{var s=Po();let r;var n=ke(s),a=ke(n,!0);q(n),q(s),Ye(t=>{r=qs(s,1,"micrio-serial-tour",null,r,{active:Ei(y)&&Ei(y).chapter==i,enriched:Ei(e).imageHasOtherMarkers}),ns(a,t)},[()=>L(Ei(e).marker)]),Ri("click",n,()=>k(i)),Gi(t,s)},a=jt(()=>L(Ei(e).marker));vs(r,t=>{Ei(a)&&t(n)}),Gi(t,s)}),q(e),Gi(t,e)};vs(O,t=>{e.tour.printChapters&&t(R)});var X=Me(O,2),F=ke(X),V=t=>{{let e=jt(()=>!Ei(p));fo(t,{get tour(){return Ei(w)},get src(){return Ei($)},get autoplay(){return Ei(e)},onid:t=>oe(x,t,!0),onended:M,onplay:()=>oe(p,!1),onblocked:()=>oe(p,!0),get currentTime(){return Ei(y).currentTime},set currentTime(t){Ei(y).currentTime=t}})}};vs(F,t=>{Ei(w)&&Ei(y)&&t(V)});var Y=Me(F,2),N=t=>{var e=Co(),i=_e(e);{let t=jt(()=>Ei(p)?"play":"pause"),e=jt(()=>Ei(p)?s().play:s().pause);Ea(i,{get type(){return Ei(t)},get title(){return Ei(e)},onclick:T})}var n=Me(i,2);{let t=jt(()=>Ei(v)?"volume-off":"volume-up"),e=jt(()=>Ei(v)?s().audioUnmute:s().audioMute);Ea(n,{get type(){return Ei(t)},get title(){return Ei(e)},onclick:_})}var a=Me(n,2),o=t=>{{let e=jt(()=>!Ei(C)),i=jt(()=>r()?"subtitles":"subtitles-off");Ea(t,{get disabled(){return Ei(e)},get type(){return Ei(i)},get active(){return r()},get title(){return s().subtitlesToggle},onclick:()=>Za.set(!r())})}};vs(a,t=>{Ei(D)&&t(o)}),Da(Me(a,2),{get el(){return h}}),Gi(t,e)};vs(Y,t=>{g&&t(N)}),q(X);var B=Me(X,2),W=t=>{to(t,{get duration(){return m},get currentTime(){return Ei(b)},set currentTime(t){oe(b,t,!0)},get ended(){return Ei(f)},set ended(t){oe(f,t,!0)},children:(t,i)=>{var s=Hi();bs(_e(s),17,()=>o,ws,(t,i,s)=>{var r=Hi(),a=_e(r),o=t=>{var r=Do();let a;Ye(t=>{a=qs(r,1,"bar",null,a,{active:s==e.tour.currentStep}),ar(r,"title",t),Us(r,`width:${Ei(i).duration/m*100}%; --progress: ${xt(E,"$times",n)[s]||0}%`)},[()=>L(Ei(i).marker)]),Ri("click",r,t=>k(s,t)),Oi("keypress",r,t=>{"Enter"===t.key&&k(s)}),Gi(t,r)};vs(a,t=>{Ei(i).duration>0&&t(o)}),Gi(t,r)}),Gi(t,s)},$$slots:{default:!0}})};vs(B,t=>{g&&t(W)}),Gi(t,z),it(),a()}Xi(["click"]);var Ro=Bi('<article class="scroll-tour micrio-tour"></article> <!>',1),Xo=Bi("<!> <!> <!>",1),Fo=Bi("<div><!> <!></div>");function Vo(t,e){et(e,!0);const i=()=>xt(l,"$_lang",r),s=()=>xt(ca,"$i18n",r),[r,n]=kt();let a=br(e,"noHTML",3,!1);const o=Q("micrio"),{events:h,state:c,_lang:l}=o,d=c.$tour,u=o.$current,m=u.$data,g=u.$settings,p=o.canvases[0].grid,f=u.state.marker,v="steps"in e.tour&&e.tour.isSerialTour,w=!("steps"in e.tour),y="scrollable"in e.tour&&e.tour.scrollable,b="steps"in e.tour&&("controls"in e.tour?!1!==e.tour.controls:!!e.tour.noControls),x=!(!v&&"steps"in e.tour&&g._markers?.tourControlsInPopup),T=x&&(w||v),k=!!g._markers?.keepPopupsDuringTourTransitions,_=()=>I(Ei(C)-1),M=()=>I(Ei(C)+1),S=()=>h.enabled.set(!0);let E;function I(t){if(!("steps"in e.tour)||!e.tour.stepInfo)return;const i=e.tour.stepInfo[t];if(i&&i.markerId==o.state.$marker?.id)return A(i);const s=e.tour.stepInfo[Ei(C)]?.micrioImage?.state;s&&s.marker.set(void 0),o.$current?.state.marker.set(void 0),k||o.state.popup.set(void 0),o.removeEventListener("marker-opened",S),f.set(void 0),i&&(E=setTimeout(L,200,i))}async function A(t){let i=u,s=!1;if(p&&!t.gridView&&p.images.find(e=>e.id==t.micrioId)){const r=!!("steps"in e.tour&&e.tour.stepInfo&&t)&&e.tour.stepInfo?.indexOf(t)<Ei(C),n=t.marker.data?.gridTourTransition??t.marker.data?._meta?.gridTourTransition,a=n?.startsWith("slide")?"slide":"swipe";await Si().then(()=>{const e=p.focus(i=p.images.find(e=>e.id==t.micrioId),{view:t.startView,transition:n==a||n==`${a}-horiz`?r?`${a}-left`:`${a}-right`:n==`${a}-vert`?r?`${a}-up`:`${a}-down`:"behind"==n?r?"behind-left":"behind-right":n}).catch(()=>s=!0);return o.events.enabled.set(!1),e})}else if(o.$current?.id!=t.micrioId){if(t.gridView&&t.marker.data?._meta?.gridAction&&p){t.micrioImage||(t.micrioImage=p.images.find(e=>e.id==t.micrioId)),i=t.micrioImage;const e=t.marker.data._meta.gridAction.split("|");p.action(e.shift(),e.join("|"))}else"steps"in e.tour&&e.tour.stepInfo&&oe(C,e.tour.stepInfo.indexOf(t),!0),i=o.open(t.micrioId,{gridView:t.gridView,startView:t.startView});await Si()}else i=o.$current;return[i,s]}async function L(t){let i=u,s=!1;t.micrioId&&([i,s]=await A(t)),s||(t.micrioImage||(t.micrioImage=i),h.enabled.set(!1),i.state.marker.set(t.markerId),o.addEventListener("marker-opened",S,{once:!0}),await Si(),h.dispatch("tour-step",e.tour))}function P(){c.tour.set(void 0)}function $(){h.dispatch("tour-ended",e.tour),(e.tour.closeOnFinish||!e.tour.cannotClose&&b)&&P()}let C=ne(-1),D=ne(!1);const z=u.camera.getView(),O=g._markers;if("steps"in e.tour){const t=d;t.prev=_,t.next=M,t.goto=I,Re(()=>{t.currentStep=Ei(C)})}const R=vt(!1);let X;function F(){R.set(!1),clearTimeout(X),X=setTimeout(()=>R.set(!0),5e3)}R.subscribe(t=>h.dispatch("tour-minimize",t));let V,Y=ne(void 0);function N(t){if(!("steps"in e.tour)||!Ei(Y))return;const i=e.tour.steps,s=t.filter(t=>t.isIntersecting).map(t=>t.target)[0];if(s)for(let e=0;e<Ei(Y).children.length;e++)if(Ei(Y).children[e]==s){const t=m.markers?.find(t=>t.id==i[e].split(",")[0]);return void(t&&o.$current?.camera.flyToView(t.view).catch(()=>{}))}}let B=[];ps(()=>("steps"in e.tour&&Fn(u,e.tour,i(),u.$data).then(()=>function(t){if(y||o.$current?.state.$marker||void 0!==t.initialStep&&I(t.initialStep),y&&Ei(Y)){V=new IntersectionObserver(N,{root:Ei(Y),threshold:1});for(let t=0;t<Ei(Y).children.length;t++)V.observe(Ei(Y).children[t])}B.push(o.state.marker.subscribe(e=>{if(!e)return void oe(D,!1);const i="string"==typeof e?e:e.id,s=t.steps.findIndex(t=>t.startsWith(i));if(s>=0&&t.stepInfo){const e=t.stepInfo[oe(C,s,!0)];e&&!e.micrioImage&&(e.micrioImage=o.canvases.find(t=>t.id==e.micrioId)??p?.images.find(t=>t.id==e.micrioId)??o.$current)}oe(D,s<0)}))}(e.tour)),b||B.push(R.subscribe(t=>e.onminimize?.(t))),a()||"steps"in e.tour&&!v||!1===e.tour.minimize||(o.addEventListener("pointermove",F),o.addEventListener("touchstart",F),F()),T&&o.setAttribute("data-tour-active",""),()=>{for(clearTimeout(X),clearTimeout(E);B.length;)B.shift()?.();o.removeEventListener("pointermove",F),o.removeEventListener("touchstart",F),o.removeEventListener("marker-opened",S),T&&o.removeAttribute("data-tour-active"),S(),V&&V.disconnect();const t=o.state.$marker;if("steps"in d&&d.stepInfo&&null!=d.currentStep){const e=d.stepInfo[d.currentStep];delete d.goto,delete d.next,delete d.prev,t&&e?.markerId==t.id&&(e.micrioImage?.state.marker.set(void 0),o.state.marker.set(void 0))}u.camera.aniDone=void 0,p||"steps"in d&&d.keepLastStep||o.$current==u||o.open(u.id),Si().then(()=>{h.dispatch("tour-stop",d),"steps"in d&&delete d.currentStep,!("steps"in d)&&O?.zoomOutAfterClose&&!t&&z&&u.camera.flyToView(z,{speed:O?.zoomOutAfterCloseSpeed})})})),h.dispatch("tour-start",e.tour);let U=ne(0),H=ne(!1);const G=jt(()=>"steps"in e.tour?void 0:e.tour),j=jt(()=>Ei(G)?"audio"in e.tour?e.tour.audio:Ei(G).i18n?.[i()]?.audio:void 0),Z=jt(()=>Jn(Ei(j)));var J=Hi(),K=_e(J),tt=t=>{var i=Hi(),n=_e(i),a=t=>{var i=Ro(),r=_e(i);bs(r,21,()=>e.tour.steps.map(t=>m.markers&&m.markers.find(e=>e.id==t.split(",")[0])),ws,(t,e)=>{var i=Hi(),s=_e(i),r=t=>{Lo(t,{get marker(){return Ei(e)}})};vs(s,t=>{Ei(e)&&t(r)}),Gi(t,i)}),q(r),fr(r,t=>oe(Y,t),()=>Ei(Y));var n=Me(r,2),a=t=>{Ea(t,{type:"close",get title(){return s().tourStop},className:"scroll-tour-end",onclick:P})};vs(n,t=>{e.tour.cannotClose||t(a)}),Gi(t,i)},h=t=>{var i=Fo();let n;var a=ke(i),h=t=>{var i=Hi(),r=_e(i),n=t=>{Oo(t,{get tour(){return e.tour},onended:$})},a=t=>{var i=Xo(),r=_e(i);{let t=jt(()=>0==Ei(C));Ea(r,{type:"arrow-left",get title(){return s().tourStepPrev},get disabled(){return Ei(t)},onclick:_})}var n=Me(r,2);Ea(n,{noClick:!0,children:(t,i)=>{W();var s=Ui();Ye(()=>ns(s,`${Ei(C)+1} / ${e.tour.steps.length??""}`)),Gi(t,s)},$$slots:{default:!0}});var a=Me(n,2);{let t=jt(()=>Ei(C)==e.tour.steps.length-1);Ea(a,{type:"arrow-right",get title(){return s().tourStepNext},get disabled(){return Ei(t)},onclick:M})}Gi(t,i)};vs(r,t=>{v?t(n):t(a,-1)}),Gi(t,i)},c=t=>{fo(t,{get tour(){return e.tour},get src(){return Ei(Z)},get fullscreen(){return o},controls:!0,autoplay:!0,onended:$,get paused(){return Ei(H)},set paused(t){oe(H,t,!0)},get currentTime(){return Ei(U)},set currentTime(t){oe(U,t,!0)}})};vs(a,t=>{"steps"in e.tour?t(h):t(c,-1)});var l=Me(a,2),d=t=>{Ea(t,{type:"close",get title(){return s().close},onclick:P})};vs(l,t=>{e.tour.cannotClose||t(d)}),q(i),Ye(()=>n=qs(i,1,"micrio-tour",null,n,{left:v,"serial-tour":v,"video-tour":w,"no-controls":b,minimized:!Ei(H)&&(xt(R,"$minimized",r)||Ei(D))})),Ds(1,i,()=>ia,()=>({duration:200})),Gi(t,i)},c=t=>{fo(t,{get tour(){return Ei(G)},get src(){return Ei(Z)},autoplay:!0,onended:$,get currentTime(){return Ei(U)},set currentTime(t){oe(U,t,!0)}})};vs(n,t=>{y&&"steps"in e.tour?t(a):x?t(h,1):Ei(G)&&t(c,2)}),Gi(t,i)},st=t=>{fo(t,{get tour(){return Ei(G)},get src(){return Ei(Z)},autoplay:!0,onended:$,get currentTime(){return Ei(U)},set currentTime(t){oe(U,t,!0)}})};vs(K,t=>{a()?Ei(G)&&t(st,1):t(tt)}),Gi(t,J),it(),n()}var Yo,No=class{get currentIndex(){return this.micrio.engine.getActiveImageIdx(this.image.ptr)}constructor(t,e,i,s={}){this.micrio=t,this.length=e,this.goto=i,this.opts=s,this.hitTresh=!1,this.snapTo=[],this.pointers=new Map,this.isFullWidth=!1,this.startedWithShift=!1,this.isDragging=()=>2==this.pointers.size||(this.isFullWidth||this.startedWithShift)&&1==this.pointers.size,s.sensitivity||(s.sensitivity=Number(t.getAttribute("data-swipe-sensitivity")??1));const r=t.getAttribute("data-swipe-snap");r&&(this.snapTo=r.split(",").map(Number)),this.micrio.setAttribute("data-hooked",""),this.dStart=this.dStart.bind(this),this.dMove=this.dMove.bind(this),this.dStop=this.dStop.bind(this),this.mouseleave=this.mouseleave.bind(this),this.image=t.$current,this.image.state.view.subscribe(t=>this.isFullWidth=s.coverLimit?this.image.camera.isZoomedOut():!t||Math.round(1e3*t[3])/1e3>=1),t.engine.setNoPinchPan(!0),t.engine.setIsSwipe(!0),this.micrio.canvas.element.addEventListener("pointerdown",this.dStart)}destroy(){this.micrio.canvas.element.removeEventListener("pointerdown",this.dStart),this.mouseleave()}dStart(t){this.startedWithShift=t.shiftKey;const e=!this.isDragging();this.pointers.set(t.pointerId,!0),this.pointers.size>2&&this.mouseleave(),e&&(this.hitTresh=!1,this.micrio.setAttribute("data-panning",""),this.startIndex=this.currentIndex,this.startX=t.clientX,this.firstTouchId=t.pointerId,this.micrio.addEventListener("pointermove",this.dMove),this.micrio.addEventListener("pointerup",this.dStop),this.micrio.setPointerCapture(t.pointerId))}dMove(t){if(!this.isDragging()||t.pointerId!=this.firstTouchId||void 0===this.startX||void 0===this.startIndex)return;if(!this.hitTresh&&void 0!==this.startX&&(this.hitTresh=2!=this.pointers.size||Math.abs(t.clientX-this.startX)>(this.micrio.events.pinchFactor&&this.micrio.events.pinchFactor>1.25?.3:.15)*this.micrio.offsetWidth)&&(this.startX=t.clientX),!this.hitTresh)return;const e=this.micrio.$current.camera,i=this.opts.continuous?Math.max(.1,(e.getXY(1,.5)[0]-e.getXY(0,.5)[0])/this.micrio.offsetWidth):1,s=Math.round((t.clientX-this.startX)/(this.micrio.offsetWidth*i)*this.length*(this.opts.sensitivity??1));let r=this.startIndex-s;if(this.opts.continuous){for(;r<0;)r+=this.length;for(;r>this.length-1;)r-=this.length}r=Math.max(0,Math.min(this.length-1,r)),r!=this.currentIndex&&this.goto(r)}dStop(t){this.pointers.delete(t.pointerId),t.pointerId==this.firstTouchId&&(this.micrio.releasePointerCapture(this.firstTouchId),this.firstTouchId=void 0),this.pointers.size||this.swipeEnd()}mouseleave(){this.pointers.clear(),this.swipeEnd()}swipeEnd(){if(this.micrio.removeAttribute("data-panning"),this.micrio.removeEventListener("pointermove",this.dMove),this.micrio.removeEventListener("pointerup",this.dStop),this.hitTresh=!1,this.snapTo.length){const t=this.snapTo[this.snapTo.map((t,e)=>[e,Math.abs(t-this.currentIndex)]).sort((t,e)=>t[1]>e[1]?1:t[1]<e[1]?-1:0)[0][0]];t!=this.currentIndex&&this.animateTo(t)}}animateTo(t){this.raf&&cancelAnimationFrame(this.raf);const e=performance.now(),i=this.currentIndex,s=i-t,r=t=>{const n=Math.min(1,(t-e)/250);n<1&&(this.raf=requestAnimationFrame(r));const a=i-Math.round(this.micrio.engine.ease(n)*s);a!=this.currentIndex&&this.goto(a)};this.raf=requestAnimationFrame(r)}},Bo={0:[0,-.5,1,0],90:[1,0,1.5,1],180:[0,1,1,1.5],270:[-.5,0,0,1]},qo={0:[0,-1,1,0],90:[1,0,2,1],180:[0,1,1,2],270:[-1,0,0,1]},Wo={0:[0,1,1,2],90:[-1,0,0,1],180:[0,-1,1,0],270:[1,0,2,1]},Uo=t=>[t,0,t+1,1];!function(t){let e;let i;(e||(e=t.Grid||(t.Grid={}))).GridActionType=function(t){return t[t.focus=0]="focus",t[t.flyTo=1]="flyTo",t[t.focusWithTagged=2]="focusWithTagged",t[t.focusTagged=3]="focusTagged",t[t.reset=4]="reset",t[t.back=5]="back",t[t.switchToGrid=6]="switchToGrid",t[t.filterTourImages=7]="filterTourImages",t[t.nextFadeDuration=8]="nextFadeDuration",t}({}),(i||(i=t.Camera||(t.Camera={}))).TimingFunction=function(t){return t[t.ease=0]="ease",t[t["ease-in"]=1]="ease-in",t[t["ease-out"]=2]="ease-out",t[t.linear=3]="linear",t}({})}(Yo||(Yo={}));var Ho=Bi('<span class="micrio-dial"> </span>'),Go=Bi('<div data-scroll-through="" class="micrio-dial"><!></div>');var jo,Zo=Bi("<button>✥</button>"),Jo=Bi("<span></span>"),Ko=Bi('<span class="hover-label micrio-gallery"> </span>'),Qo=Bi('<div><!> <ul><span class="track micrio-gallery"><span class="track-fill micrio-gallery"></span></span> <span class="ticks micrio-gallery"></span> <!> <button aria-label="Gallery position" role="slider" tabindex="0"></button> <span> </span></ul> <!></div>');function th(t,e){et(e,!0);const i=()=>xt(y,"$settings",n),s=()=>xt(w,"$layer",n),r=()=>xt(ca,"$i18n",n),[n,a]=kt();let o=br(e,"images",19,()=>[]),h=br(e,"omni",3,null);const c=Li(()=>o()),l=Li(()=>h()),d=Q("micrio"),{engine:u,current:m,events:g,_lang:p}=d,f=xt(m,"$current",n),v=f.$info,w=f.state.layer,y=f.settings,b=f.camera;if(l)for(let q=0;q<l.frames;q++)c.push({id:v.id+"/"+q,image:f,visible:vt(!1),frame:q,opts:{area:[0,0,1,1]},ptr:-1,baseTileIdx:-1,thumbSrc:f.getTileSrc(f.levels,0,0,q)});const x=i().gallery,T="omni"==x.type,k=T||"swipe-full"==x.type,_=k||"switch"==x.type,M=!_&&c.length>1&&!("frame"in(c[0]??{})),S=T,E=!!x.isSpreads,I=x.coverPages??0,A=i().omni,L=T&&!!A?.twoAxes,P=x.startId||d.getAttribute("data-gallery-start-id"),$=x.archive,C=!!i().limitToCoverScale,D=!!i().noUI,z=A?.frontIndex??0,O=A?.layers?.length??1,R=d.hasAttribute("data-gallery-start")?Number(d.getAttribute("data-gallery-start")):i()?.omni?.startIndex;let X=null==R||isNaN(R)?P?c.findIndex(t=>t.id==P):0:R;X<0&&(X=0);const F=[],V=[];if(M)for(let q=0;q<c.length;q++)F.push([0,0,1,1]),V.push([q]);else if(c)for(let q=0;q<c.length;q++){let t=c[q].opts?.area;if(!t)continue;const e=t.slice(0);if(V.push([q]),E&&q-I>=0&&(q-I)%2==0&&c[q+1]){if(t=c[++q].opts?.area,!t)continue;V[V.length-1].push(q),e[2]=t[2],e[3]=t[3]}F.push(e)}const Y=F.length/O,N=A?.layers?.map(t=>({i18n:Object.fromEntries(Object.entries(t.i18n).map(([t,e],i)=>[t,{title:e??"Layer "+(i+1)}]))}))??[];Object.keys(v.revision??{[(()=>xt(p,"$_lang",n))()]:0}).forEach(t=>N.forEach((e,i)=>{e.i18n[t]||(e.i18n[t]={title:"Layer "+(i+1)})}));let B=ne(-1),W=_,U=ne(!0),H=ne(!1),G=ne(!0),j=!1,Z=ne(0);function J(t,e=!1,i=150,s=!1){if(S){for(;t<0;)t+=Y;t%=Y}const r=t=Math.round(Math.max(0,Math.min(Y-1,t))),n=s||r!=Ei(B);if(oe(B,r,!0),n&&tt(),M)!function(t,e,i,s){if(!c[t])return;const r=0===i?0:e?K/2:K,n=c[Ei(B)>-1&&Ei(B)!=t?Ei(B):-1],a=s&&r>0&&n?.camera&&!n.camera.isZoomedOut(),o=()=>{u.setGridTransitionDuration(r);for(let e=0;e<c.length;e++){const i=c[e];if(!i?.camera)continue;const s=i.opts.area??[0,0,1,1],n=s[0],a=n>=-1&&n<=1,o=e-t,h=Uo(o),l=Math.abs(o)<=1,d=Math.abs(s[0]-h[0])>1e-4||Math.abs(s[2]-h[2])>1e-4,u=r>0&&d&&(a||l);i.camera.setArea(h,{direct:!u,noDispatch:!0})}u.render()};a?n.camera.flyToCoverView({duration:1e3*r*.6,speed:2}).then(o).catch(o):o()}(Ei(B),e,i,n);else if(_){if(n)if(u.setActiveImage(f.ptr,V[Ei(B)][0],V[Ei(B)].length-1),T)u.render();else{const t=F[Ei(B)];b.flyToView([t[0],t[1],t[2]-t[0],t[3]-t[1]],{duration:i,speed:2}).then(()=>ot(F[Ei(B)],!0)).catch(()=>{}),ee()}}else{const s=b.getViewLegacy(),r=F[t],a=fn.fromLegacy(r),o=j&&(W&&!Ei(H)||n||s[0]<r[0]!=s[2]>r[2]);oe(H,!1),o?b.flyToView(a,{duration:i,speed:1,progress:e?.5:0}).then(()=>ot(r,!0)).catch(()=>{}):(a&&0==i&&b.setView(a),ot(r,!0))}f.album.hooked=j=!0}const K=.35;function tt(t){if(Kt&&t){if(Kt.currentIndex==Ei(B))return;oe(B,Kt.currentIndex,!0)}at(Ei(B)),g.dispatch("gallery-show",Ei(B)),T&&oe(Z,(Ei(B)-z)/Y*360),M&&f.album?.currentImage?.set(c[Ei(B)])}const st="requestIdleCallback"in self?T?Math.max(36,2*Math.floor(c.length/8)):100:50,rt=new Map,nt=self.requestIdleCallback??self.requestAnimationFrame;function at(t){const e=[];N.length&&(t+=s()*Math.floor(o().length/N.length)),E&&t>=I&&(t=2*t-I);const i=Math.floor(t/qt);for(let s=-st;s<=st;s++)if(s){let r=t+s;if(L){const t=Math.floor(r/qt);t<i&&(r+=qt),t>i&&(r-=qt)}if(S){for(;r<0;)r+=o().length;for(;r>=o().length;)r-=o().length}e.push(r)}if(L)for(let s=-st;s<=st;s++)s&&e.push(t+s*qt);e.filter((t,i)=>t>=0&&t<o().length&&e.indexOf(t)==i).map(t=>o()[t]).filter(t=>!!t&&!rt.has(t.id)).forEach(t=>rt.set(t.id,nt(()=>u.getTexture(t.baseTileIdx,t.thumbSrc,!1,{force:!!$}))))}function ot(t,e){W=b.isZoomedOut(),b.setLimit(!e&&W?[-1,t[1],2,t[3]]:t)}const ht=16;function ct(t){if(!Ei(ut))return 0;const e=Ei(ut).clientWidth;return ht+t/Math.max(1,Y-1)*(e-32)}function lt(t){const e=V[t];return e?.length?1===e.length?String(e[0]+1):`${e[0]+1}–${e[e.length-1]+1}`:String(t+1)}let dt,ut=ne(void 0),mt=ne(0);const gt=jt(()=>!Ei(ut)||Ei(U)?Ei(mt):ct(Ei(B)));let pt=!1;function ft(t){t.preventDefault(),t.stopPropagation(),Ei(U)||(pt="button"in t)&&0!=t.button||!Ei(ut)||(dt=Ei(ut).getClientRects()[0],d.keepRendering=oe(U,!0),oe(Mt,-1),window.addEventListener(pt?"pointermove":"touchmove",yt),window.addEventListener(pt?"pointerup":"touchend",Et),yt(t))}function wt(t){const e=dt??Ei(ut).getClientRects()[0],i="button"in t?t.clientX:t.touches[0].clientX,s=Math.min(1,Math.max(0,(i-e.left-ht)/(e.width-32)));return[s,Math.max(0,Math.min(Y-1,Math.round(s*Math.max(1,Y-1))))]}function yt(t){const[e,i]=wt(t);oe(mt,ht+e*(dt.width-32)),i!=Ei(B)&&J(i,!0)}let bt,Tt,_t,Mt=ne(-1);function St(t){Ei(U)||oe(Mt,wt(t)[1],!0)}function Et(){window.removeEventListener(pt?"pointermove":"touchmove",yt),window.removeEventListener(pt?"pointerup":"touchend",Et),oe(U,d.keepRendering=!1,!0),J(Ei(B))}function It(){W&&(Tt=bt=Ei(B),oe(H,W,!0),ot(F[Ei(B)],!1))}function At(t){const e=t.detail;"panend"!=t.type||e?J(Tt!=Ei(B)?Tt:Ei(B)+(bt==Ei(B)&&Ei(H)&&e?Math.round(Math.min(1,Math.max(-1,-e.movedX/e.duration))):0)):oe(H,!1)}function Lt(t){if(!t)return;const e=fn.toCenterJSON(t),i=e.centerX,s=F.map((t,s)=>(1-Math.min(Math.abs(i-t[0]),Math.abs(i-t[2])))*Math.max(0,(Math.min(i+e.width/2,t[2])-Math.max(i-e.width/2,t[0]))/(t[2]-t[0]))*(1-.1*Math.abs(Ei(B)-s)));u.setFocus(f.ptr,F[Tt=s.every(t=>!t)?Ei(B):s.indexOf(Math.max(...s))],Ei(H)),W=b.isZoomedOut()}let Pt=0,$t=0,Ct=0,Dt=0,zt=!1,Ot=!1,Rt=0;function Xt(t){c[Ei(B)]?.camera?.isZoomedOut()&&0==t.button&&void 0===_t&&(_t=t.pointerId,Pt=$t=t.clientX,Rt=t.clientY,Ct=t.timeStamp,Dt=0,zt=!1,Ot=!1,window.addEventListener("pointermove",Ft),window.addEventListener("pointerup",Vt),window.addEventListener("pointercancel",Vt))}function Ft(t){if(t.pointerId!==_t)return;const e=t.clientX-Pt,i=t.clientY-Rt;if(!zt){if(Math.abs(e)<6&&Math.abs(i)<6)return;if(Ot=Math.abs(e)>Math.abs(i),!Ot)return void Vt(t);zt=!0,d.setAttribute("data-panning",""),d.keepRendering=!0,d.canvas.element.setPointerCapture(t.pointerId)}const s=Math.max(1,t.timeStamp-Ct);Dt=(t.clientX-$t)/s,$t=t.clientX,Ct=t.timeStamp,function(t){const e=0==Ei(B)&&t>0,i=Ei(B)==c.length-1&&t<0,s=e||i?Math.sign(t)*Math.sqrt(Math.abs(t))*.3:t;c[Ei(B)]?.camera?.setArea(Uo(s),{direct:!0,noDispatch:!0}),s<0&&Ei(B)<c.length-1?c[Ei(B)+1]?.camera?.setArea(Uo(1+s),{direct:!0,noDispatch:!0}):s>0&&Ei(B)>0&&c[Ei(B)-1]?.camera?.setArea(Uo(-1+s),{direct:!0,noDispatch:!0});u.render()}(e/(d.offsetWidth||1))}function Vt(t){if(t.pointerId!==_t)return;window.removeEventListener("pointermove",Ft),window.removeEventListener("pointerup",Vt),window.removeEventListener("pointercancel",Vt);const e=zt;if(_t=void 0,zt=!1,d.removeAttribute("data-panning"),d.keepRendering=!1,!e)return;try{d.canvas.element.releasePointerCapture(t.pointerId)}catch(n){}const i=d.offsetWidth||1,s=(t.clientX-Pt)/i;let r=Ei(B);s<-.3||Dt<-.5?r=Math.min(c.length-1,Ei(B)+1):(s>.3||Dt>.5)&&(r=Math.max(0,Ei(B)-1)),J(r)}let Yt=0,Nt=[0,0,0,0];function Bt(t){t.stopPropagation(),t.preventDefault(),0==t.button&&(oe(U,!0),Nt=[t.clientX,t.clientY,Ei(B),Yt],window.addEventListener("pointermove",Ut),window.addEventListener("pointerup",Ht))}const qt=c.length,Wt=1;function Ut(t){Yt=Math.max(0,Math.min(Wt-1,Nt[3]+Math.round((Nt[1]-t.clientY)/360*Wt)));let e=(Nt[2]+Math.round((Nt[0]-t.clientX)/360*qt))%qt;for(;e<0;)e+=qt;J(Yt*qt+e)}function Ht(){removeEventListener("pointermove",Ut),removeEventListener("pointerup",Ht),oe(U,!1)}let Gt=-1;const Zt=()=>{N.length&&f.data.update(t=>{t||(t={}),t.pages||(t.pages=[]);const e={id:"_omni-layers",i18n:N[s()].i18n,icon:ma.layerGroup,children:N.map((t,e)=>({id:"omni-layer-"+e,i18n:t.i18n,action:()=>{w.set(e),at(Ei(B))}})).filter(t=>t.id!="omni-layer-"+s())};return Gt>=0&&Gt<t.pages.length?t.pages.splice(Gt,1,e):t.pages.push(e),Gt=t.pages.length-1,t})};let Jt,Kt,Qt=d.state.ui.hidden,te=d.state.ui.hover;function ee(){Qt.set(!1),clearTimeout(Jt),Jt=setTimeout(()=>Qt.set(!0),2e3)}f.album={numPages:F.length,get currentIndex(){return Ei(B)},info:f.$settings.album,prev:()=>J(Ei(B)-1),next:()=>J(Ei(B)+1),goto:J,...M?{currentImage:vt(c[X])}:{}},ps(()=>{(M?Promise.all(c.map(t=>u.addChild(t,f))):Promise.all(o().map(t=>("state"in t&&!("image"in t)&&(t.camera=f.camera),u.addEmbed(t,f,{opacity:0,asImage:"camera"in t}))))).then(()=>{if(M){u.setGridTransitionTimingFunction(Yo.Camera.TimingFunction["ease-out"]);for(let t=0;t<c.length;t++){const e=c[t];e.camera&&(e.camera.setCoverLimit(!1),e.camera.setArea(Uo(t-X),{direct:!0,noDispatch:!0}),e.camera.setView([0,0,1,1],{noRender:!0}))}oe(B,X,!0),tt(),f.album.hooked=j=!0,u.render()}else u.setActiveImage(f.ptr,X),J(X,!1,0);oe(U,!1)}),T&&O>1&&Zt(),oe(G,!1),d.goto=J;const t=[],e=[];if(T&&t.push(f.state.layer.subscribe(Zt)),k&&(Kt=f.swiper=new No(d,Y,J,{continuous:S,coverLimit:C})),e.push(()=>{d.canvas.element.removeEventListener("pointermove",ee),d.canvas.element.removeEventListener("pointerdown",ee)}),T||L||k||(d.canvas.element.addEventListener("pointermove",ee),d.canvas.element.addEventListener("pointerdown",ee),ee()),_&&t.push(f.state.view.subscribe(()=>{W=b.isZoomedOut()})),!(_||k||o().length<=1))if(L||oe(mt,ct(X),!0),M){const t=Xt;d.canvas.element.addEventListener("pointerdown",t),e.push(()=>d.canvas.element.removeEventListener("pointerdown",t))}else t.push(f.state.view.subscribe(Lt)),d.addEventListener("panstart",It),d.addEventListener("panend",At),d.addEventListener("pinchend",At),e.push(()=>{d.removeEventListener("panstart",It),d.removeEventListener("panend",At),d.removeEventListener("pinchend",At)});return T&&d.addEventListener("move",tt),()=>{for(Kt&&Kt.destroy();t.length;)t.shift()?.();for(;e.length;)e.shift()?.();T&&d.removeEventListener("move",tt),te.set(!1)}});var ie=Hi();Oi("keydown",pe,function(t){if(!i().omni?.noKeys){switch(t.key){case"PageUp":case"ArrowLeft":J(Ei(B)-(T?-1:1),!0);break;case"PageDown":case"ArrowRight":J(Ei(B)+(T?-1:1),!0);break;case"ArrowUp":L&&J(Ei(B)+qt);break;case"ArrowDown":L&&J(Ei(B)-qt);break;case"Home":J(0);break;case"End":J(Y);break;default:return}ee()}});var se=_e(ie),re=t=>{var e=Hi(),s=_e(e),a=t=>{var e=Zo();let i;Ye(()=>i=qs(e,1,"angular micrio-gallery",null,i,{dragging:Ei(U)})),Oi("pointerdown",e,Bt,!0),Gi(t,e)},h=t=>{{let e=jt(()=>i().omni?.showDegrees);!function(t,e){et(e,!0);const i=Q("micrio"),s=i.$current.camera;let r,n=ne(void 0),a=0,o=0;function h(t){const r=Math.max(1,(s.getXY(1,.5)[0]-s.getXY(0,.5)[0])/i.offsetWidth),h=(o/360+(a-t.clientX)/(Ei(n).offsetWidth*r))*e.frames;e.onturn?.(h)}function c(){r&&i.releasePointerCapture(r),i.removeAttribute("data-panning"),i.removeEventListener("pointermove",h),i.removeEventListener("pointerup",c)}const l=jt(()=>-e.currentRotation/360*(Ei(n)?.offsetWidth??0));var d=Go(),u=ke(d),m=t=>{var i=Ho(),s=ke(i);q(i),Ye(t=>ns(s,`${t??""}º`),[()=>Math.round(10*e.currentRotation)/10]),Gi(t,i)};vs(u,t=>{e.degrees&&t(m)}),q(d),fr(d,t=>oe(n,t),()=>Ei(n)),Ye(()=>Us(d,`--micrio-dial-offset:${Ei(l)??""}px;`)),Oi("pointerdown",d,function(t){t.stopPropagation(),t.preventDefault(),0==t.button&&(i.addEventListener("pointermove",h),i.addEventListener("pointerup",c),i.setAttribute("data-panning",""),i.setPointerCapture(r=t.pointerId),o=e.currentRotation,a=t.clientX)},!0),Gi(t,d),it()}(t,{get currentRotation(){return Ei(Z)},get frames(){return Y},get degrees(){return Ei(e)},onturn:t=>J(t)})}},l=t=>{const e=jt(()=>Y),i=jt(()=>c.length),s=jt(()=>Ei(e)>24),a=jt(()=>Ei(s)?Math.max(1,Math.ceil(Ei(e)/24)):1),o=jt(()=>Ei(e)>1?Ei(B)/(Ei(e)-1)*100:0);var h=Qo();let l;var d=ke(h);{let t=jt(()=>0==Ei(B));Ea(d,{type:"arrow-left",get title(){return r().galleryPrev},className:"gallery-btn",onpointerdown:t=>0===t.button&&J(Ei(B)-1),get disabled(){return Ei(t)}})}var u=Me(d,2);let m;var g=ke(u),p=ke(g);q(g);var f=Me(g,2);bs(f,21,()=>F,ws,(t,i,r)=>{var n=Hi(),o=_e(n),h=t=>{var i=Jo();let n;Ye(()=>{n=qs(i,1,"tick micrio-gallery",null,n,{major:Ei(s)&&r%(5*Ei(a))==0,active:r===Ei(B),hover:r===Ei(Mt)}),Us(i,`left:${Ei(e)>1?r/(Ei(e)-1)*100:50}%`)}),Gi(t,i)};vs(o,t=>{Ei(s)&&r%Ei(a)!==0&&r!==Ei(e)-1&&r!==Ei(B)||t(h)}),Gi(t,n)}),q(f);var v=Me(f,2),w=t=>{var i=Ko(),s=ke(i,!0);q(i),Ye(t=>{Us(i,`left:${Ei(e)>1?Ei(Mt)/(Ei(e)-1)*100:50}%`),ns(s,t)},[()=>lt(Ei(Mt))]),Gi(t,i)};vs(v,t=>{Ei(Mt)>=0&&Ei(Mt)!==Ei(B)&&!Ei(U)&&t(w)});var y=Me(v,2);let b;ar(y,"aria-valuemin",1);var x=Me(y,2);let T;var k=ke(x);q(x),q(u),fr(u,t=>oe(ut,t),()=>Ei(ut));var _=Me(u,2);{let t=jt(()=>Ei(B)>=Ei(e)-1);Ea(_,{type:"arrow-right",get title(){return r().galleryNext},className:"gallery-btn",onpointerdown:t=>0===t.button&&J(Ei(B)+1),get disabled(){return Ei(t)}})}q(h),Ye(t=>{l=qs(h,1,"micrio-gallery",null,l,{hidden:Ei(G)||xt(Qt,"$hidden",n)&&!xt(te,"$hover",n)&&!Ei(U)&&!Ei(H)}),m=qs(u,1,"micrio-gallery",null,m,{dense:Ei(s)}),Us(p,`width:${Ei(o)}%`),b=qs(y,1,"handle micrio-gallery",null,b,{dragging:Ei(U)}),Us(y,`left: ${Ei(gt)}px`),ar(y,"aria-valuemax",Ei(i)),ar(y,"aria-valuenow",(V[Ei(B)]?.[0]??Ei(B))+1),T=qs(x,1,"handle-label micrio-gallery",null,T,{dragging:Ei(U)}),Us(x,`left: ${Ei(gt)}px`),ns(k,`${t??""}${Ei(s)?` / ${Ei(i)}`:""}`)},[()=>lt(Ei(B))]),Ri("pointerover",h,()=>te.set(!0)),Ri("pointerout",h,t=>{t.currentTarget.contains(t.relatedTarget)||te.set(!1)}),Ri("focusin",h,()=>te.set(!0)),Ri("focusout",h,t=>{t.currentTarget.contains(t.relatedTarget)||te.set(!1)}),Oi("pointerdown",u,ft,!0),Oi("touchstart",u,ft,!0,!0),Ri("pointermove",u,St),Oi("pointerleave",u,()=>oe(Mt,-1)),Gi(t,h)};vs(s,t=>{L?t(a):A&&!A.noDial&&T?t(h,1):!k&&o().length>1&&t(l,2)}),Gi(t,e)};vs(se,t=>{D||t(re)}),Gi(t,ie),it(),a()}Xi(["pointerover","pointerout","focusin","focusout","pointermove"]);var eh,ih,sh={},rh=vt(),nh=vt(!1);function ah(t,e,i){ih&&(ih.setPosition?ih.setPosition(t,e,i):"positionX"in ih&&(ih.positionX.value=t,ih.positionY.value=e,ih.positionZ.value=i))}function oh(t,e,i){ih&&(ih.setOrientation?ih.setOrientation(t,e,i,0,1,0):"forwardX"in ih&&(ih.forwardX.value=t,ih.forwardY.value=e,ih.forwardZ.value=i))}function hh(t,e){et(e,!0);const[i,s]=kt();let r=br(e,"volume",3,1);const{events:n,current:a}=Q("micrio"),o=xt(a,"$current",i),h=o.$info,c=h.height/h.width,l="AudioContext"in window||"webkitAudioContext"in window;const d=()=>nh.set(!0),u=new Audio("data:audio/mpeg;base64,/+MYxAAAAANIAUAAAASEEB/jwOFM/0MM/90b/+RhST//w4NFwOjf///PZu////9lns5GFDv//l9GlUIEEIAAAgIg8Ir/JGq3/+MYxDsLIj5QMYcoAP0dv9HIjUcH//yYSg+CIbkGP//8w0bLVjUP///3Z0x5QCAv/yLjwtGKTEFNRTMuOTeqqqqqqqqqqqqq/+MYxEkNmdJkUYc4AKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq");u.volume=ln.iOS?0:1e-4,l&&ps(()=>{let t,i;return i=nh.subscribe(s=>{s&&(eh||(!function(t){if(!jo){if(eh||(eh="micrioAudioContext"in window?window.micrioAudioContext:"AudioContext"in window?new window.AudioContext:"webkitAudioContext"in window?new window.webkitAudioContext:null),!eh)return console.warn("[Micrio] Your browser does not support the Web Audio API");(jo=eh.createGain()).connect(eh.destination),jo.gain.value=t,rh.set(eh),"upX"in(ih=eh.listener)&&(ih.upX.value=0,ih.upY.value=1,ih.upZ.value=0)}}(r()),n.dispatch("audio-init")),eh&&e.data.markers?.filter(t=>!!t.positionalAudio).length&&(t=o.state.view.subscribe(t=>{if(!t)return;const i=Math.max(0,1.05-o.camera.getScale());!function(t,i,s){if(e.is360){t*=2*-Math.PI,i-=.5,i*=-Math.PI;const e=10*(1-s),r=Math.cos(i)*Math.sin(t)*e,n=Math.sin(i)*e,a=Math.cos(i)*Math.cos(t)*e;ah(r,n,a);let o=r*r+n*n+a*a;o>0&&(o=1/Math.sqrt(o)),oh(r*o,n*o,a*o)}else ah(2*(t-.5),2*(.5-i)*c,s),oh(0,0,-1)}(t[0]+t[2]/2,t[1]+t[3]/2,i*(e.is360?1:1.5))})),i&&(i(),i=null))}),eh||u.play().then(d).catch(()=>{n.dispatch("autoplay-blocked"),addEventListener("pointerup",d,{once:!0})}),()=>{t&&t(),i&&i(),removeEventListener("pointerup",d)}}),Re(()=>{jo&&(jo.gain.value=r())});var m=Hi(),g=_e(m),p=t=>{{let t=jt(()=>r()*(e.data.music.volume??1));!function(t,e){et(e,!0);let i=br(e,"loop",3,!0),s=br(e,"volume",3,1);const r=ue(new Audio);r.preload="none",r.loop=!1,r.onended=a;let n=-1;function a(){if(!i()&&n+1==e.list.length)return;const t=e.list[++n%e.list.length];r.src=Jn(t)??"",r.play()}ps(()=>(a(),()=>r.pause())),Re(()=>{r.volume=s()}),it()}(0,{get list(){return e.data.music.items},get loop(){return e.data.music.loop},get volume(){return Ei(t)}})}};vs(g,t=>{xt(nh,"$interacted",i)&&xt(rh,"$ctx",i)&&e.data.music?.items.length&&t(p)}),Gi(t,m),it(),s()}var ch=Bi('<cite class="micrio-details"> </cite>'),lh=Bi('<small class="micrio-details"> </small>'),dh=Bi('<summary class="micrio-details"><!> <!></summary>'),uh=Bi('<p class="micrio-details"><a rel="noopener noreferrer" target="_blank"> </a></p>'),mh=Bi("<details><!> <!> <!> <!></details>");function gh(t,e){et(e,!0);const i=()=>xt(o,"$current",r),s=()=>xt(e.data,"$data",r),[r,n]=kt(),{_lang:a,current:o}=Q("micrio");let h=ne(!1);function c(t){let e="cm";return t>=1e5?(e="km",t/=1e5):t>=100?(e="m",t/=100):t<1e-6?(e="nm",t*=1e7):t<.001?(e="µm",t*=1e4):t<1&&(e="mm",t*=10),t.toFixed(2)+" "+e}const l=jt(()=>i()?.$settings.cmWidth),d=jt(()=>i()?.$settings.cmHeight),u=jt(()=>s()?s()?.i18n?s().i18n[xt(a,"$_lang",r)]:s():void 0),m=jt(()=>Ei(u)?.title??xt(e.info,"$info",r)?.title??""),g=jt(()=>Ei(u)?.description),p=jt(()=>Ei(u)?.sourceUrl),f=jt(()=>Ei(u)?.copyright),v=jt(()=>Ei(l)&&Ei(d)?c(Ei(l))+" x "+c(Ei(d)):null);let w=ne(void 0);ps(()=>{Ei(w).ontoggle=()=>{oe(h,Ei(w).open,!0)}});var y=Hi(),b=_e(y),x=t=>{var e=mh();let i;var s=ke(e),n=t=>{var e=dh(),i=ke(e),s=t=>{var e=ch(),i=ke(e,!0);q(e),Ye(()=>ns(i,Ei(m))),Gi(t,e)};vs(i,t=>{Ei(m)&&t(s)});var r=Me(i,2),n=t=>{var e=lh(),i=ke(e,!0);q(e),Ye(()=>ns(i,Ei(v))),Gi(t,e)};vs(r,t=>{Ei(v)&&t(n)}),q(e),Gi(t,e)};vs(s,t=>{(Ei(m)||Ei(v))&&t(n)});var a=Me(s,2),o=t=>{var e=Hi();Ms(_e(e),()=>Ei(g)),Gi(t,e)};vs(a,t=>{Ei(g)&&t(o)});var c=Me(a,2),l=t=>{var e=uh(),i=ke(e),s=ke(i,!0);q(i),q(e),Ye(()=>{ar(i,"href",Ei(p)),ns(s,Ei(f)||Ei(p))}),Gi(t,e)};vs(c,t=>{Ei(p)&&t(l)});var d=Me(c,2),u=t=>{Ea(t,{type:"close",get title(){return xt(ca,"$i18n",r).close},onclick:()=>Ei(w).open=!1})};vs(d,t=>{Ei(h)&&t(u)}),q(e),fr(e,t=>oe(w,t),()=>Ei(w)),Ye(()=>i=qs(e,1,"micrio-details",null,i,{opened:Ei(h)})),Ds(3,e,()=>ia,()=>({duration:200})),Gi(t,e)};vs(b,t=>{(Ei(m)||Ei(g)||Ei(p))&&t(x)}),Gi(t,y),it(),n()}var ph=Bi('<div class="micrio-error"><!> </div>');var fh=Bi('<figcaption class="micrio-micrio-gallery"></figcaption>'),vh=Bi('<figure class="micrio-micrio-gallery"><micr-io></micr-io> <!></figure>',2);function wh(t,e){et(e,!0);const i=()=>xt(o,"$current",s),[s,r]=kt();let n=br(e,"startId",3,void 0);const{_lang:a,current:o}=Q("micrio");let h=ne(void 0),c=ne(0);const l=jt(()=>e.gallery[Ei(c)]),d=jt(()=>Ei(l)?.i18n?.[xt(a,"$_lang",s)]?.description??void 0);fs(()=>Ei(h)?.destroy());var u=vh(),m=ke(u);Ye(()=>or(m,"data-gallery",e.gallery.map(t=>`${t.micrioId},${t.width},${t.height},${t.isDeepZoom?"d":""}${t.isWebP?",w":t.isPng||!i()?.isV5&&t.src?.endsWith(".png")?",p":""}`).join(";"))),Ye(()=>or(m,"data-start",n())),Ye(()=>or(m,"data-path",i()&&i().$info&&i().$info.path)),or(m,"data-logo","false"),qs(m,1,"micrio-micrio-gallery"),fr(m,t=>oe(h,t),()=>Ei(h));var g=Me(m,2),p=t=>{var e=fh();Ms(e,()=>Ei(d),!0),q(e),Gi(t,e)};vs(g,t=>{Ei(d)&&t(p)}),q(u),Oi("gallery-show",m,t=>{oe(c,t.detail,!0)}),Gi(t,u),it(),r()}var yh=Bi("<!> <!>",1),bh=Bi("<aside><!> <!></aside>"),xh=Bi("<!> <!>",1),Th=Bi('<menu class="micrio-popover"></menu>'),kh=Bi('<h2 class="micrio-popover"> </h2>'),_h=Bi('<img alt=""/>'),Mh=Bi("<!> <!> <!> <!>",1),Sh=Bi('<menu class="right micrio-popover"></menu>'),Eh=Bi("<!> <!> <!>",1),Ih=Bi("<dialog><!> <!></dialog>");function Ah(t,e){et(e,!0);const i=()=>xt(l,"$current",n),s=()=>xt(d,"$_lang",n),r=()=>xt(ca,"$i18n",n),[n,a]=kt(),o=ue(Q("micrio")),{events:h,state:c,current:l,_lang:d}=o,u=i()?.$data,m=Object.keys(u?.revision??{[s()]:0});function g(){Ei(w)?.close()}const p=vt(!1);let f=ne(!0),v=s(),w=ne(void 0);ps(()=>{Ei(w).showModal(),Si().then(()=>{(Ei(w).querySelector("button.active")??Ei(w).querySelector("button"))?.focus()});const t=d.subscribe(t=>{t&&t!=v&&(oe(f,!1),v=t,setTimeout(()=>oe(f,!0),200))});return()=>{t()}});const y=jt(()=>e.popover.marker),b=jt(()=>Ei(y)?Kn(Ei(y),s()):void 0),x=jt(()=>e.popover.markerTour),T=jt(()=>e.popover.contentPage),k=jt(()=>{return Ei(T)?(t=Ei(T),e=s(),t.i18n?.[e]??t):void 0;var t,e}),_=jt(()=>Ei(T)&&Ei(k)&&!Ei(T)?.buttons?.length?!(!Ei(k).embed||Ei(k).content&&!(Ei(k).content.length<250)||Ei(T).image):void 0),M=jt(()=>Ei(T)?.image?"string"==typeof Ei(T).image?Ei(T).image:Ei(T).image.src:void 0),S=jt(()=>!!Ei(k)?.embed||!!Ei(M)),E=jt(()=>!!Ei(T)?.buttons?.find(t=>"close"==t.type)),I=jt(()=>!!e.popover.marker?.images&&e.popover.marker.images.length>0),A=jt(()=>!(!Ei(b)||!Ei(b).body)||Ei(I)),L=jt(()=>Ei(b)&&Ei(b).body||Ei(I)&&Ei(k)?.embed),P=jt(()=>!Ei(E)||Ei(x)&&null!=Ei(x).currentStep);var $=Ih();let C;var D=ke($),z=t=>{var e=bh();let i;var s=ke(e),n=t=>{Ea(t,{type:"close",get title(){return r().close},className:"close-popover",onclick:g})};vs(s,t=>{Ei(E)||t(n)});var a=Me(s,2),o=t=>{var e=yh(),i=_e(e),s=t=>{Ea(t,{type:"arrow-left",get title(){return r().tourStepPrev},className:"prev-tour-step",onclick:()=>Ei(x)&&Ei(x).prev&&Ei(x).prev()})};vs(i,t=>{Ei(x).currentStep>0&&t(s)});var n=Me(i,2),a=t=>{Ea(t,{type:"arrow-right",get title(){return r().tourStepNext},className:"next-tour-step",onclick:()=>Ei(x)&&Ei(x).next&&Ei(x).next()})};vs(n,t=>{Ei(x).currentStep<Ei(x).steps.length-1&&t(a)}),Gi(t,e)};vs(a,t=>{Ei(x)&&null!=Ei(x).currentStep&&t(o)}),q(e),Ye(()=>i=qs(e,1,"micrio-popover",null,i,{inside:Ei(T)?!Ei(_):!Ei(A)&&!Ei(b)?.embedUrl})),Gi(t,e)};vs(D,t=>{Ei(P)&&t(z)});var O=Me(D,2),R=t=>{var e=xh(),i=_e(e),s=t=>{fo(t,{get src(){return Ei(b).embedUrl},get uuid(){return Ei(y).id},get figcaption(){return Ei(b).embedDescription},controls:!0,get autoplay(){return Ei(y).embedAutoPlay}})},r=t=>{wh(t,{get gallery(){return Ei(y).images}})};vs(i,t=>{Ei(b)&&Ei(b).embedUrl?t(s):Ei(y).images&&Ei(y).images.length&&t(r,1)});var n=Me(i,2),a=t=>{{let e=jt(()=>!Ei(b)||!Ei(b).embedUrl);Mo(t,{get marker(){return Ei(y)},noEmbed:!0,noGallery:!0,get noImages(){return Ei(e)},onclose:g})}};vs(n,t=>{Ei(L)&&t(a)}),Gi(t,e)},X=t=>{wh(t,{get gallery(){return e.popover.gallery},get startId(){return e.popover.galleryStart}})},F=t=>{var e=Eh(),r=_e(e),n=t=>{var e=Th();bs(e,21,()=>m,ws,(t,e)=>{{let i=jt(()=>da?.of(Ei(e))??Ei(e)),r=jt(()=>Ei(e)==s());Ea(t,{onclick:()=>o.lang=Ei(e),get title(){return Ei(i)},get active(){return Ei(r)},children:(t,i)=>{W();var s=Ui();Ye(t=>ns(s,t),[()=>Ei(e).toUpperCase()]),Gi(t,s)},$$slots:{default:!0}})}}),q(e),Gi(t,e)};vs(r,t=>{m.length>1&&t(n)});var a=Me(r,2),h=t=>{var e=Hi(),i=_e(e),s=t=>{fo(t,{get src(){return Ei(k).embed},get figcaption(){return Ei(k).content},controls:!0,autoplay:!0})};vs(i,t=>{Ei(f)&&t(s)}),Gi(t,e)},c=t=>{wo(t,{children:(t,e)=>{var i=Mh(),s=_e(i),r=t=>{var e=kh(),i=ke(e,!0);q(e),Ye(()=>ns(i,Ei(k).title)),Gi(t,e)};vs(s,t=>{Ei(k).title&&t(r)});var n=Me(s,2),a=t=>{fo(t,{get src(){return Ei(k).embed},controls:!0})};vs(n,t=>{Ei(k).embed&&Ei(f)&&t(a)});var o=Me(n,2),h=t=>{var e=_h();Ye(()=>ar(e,"src",Ei(M))),Gi(t,e)};vs(o,t=>{Ei(M)&&t(h)});var c=Me(o,2),l=t=>{var e=Hi();Ms(_e(e),()=>Ei(k).content),Gi(t,e)};vs(c,t=>{Ei(k).content&&t(l)}),Gi(t,i)},$$slots:{default:!0}})};vs(a,t=>{Ei(_)?t(h):t(c,-1)});var l=Me(a,2),d=t=>{var e=Sh();bs(e,21,()=>Ei(T).buttons,ws,(t,e)=>{{let r=jt(()=>"link"==Ei(e).type?Ei(e).action:void 0);Ea(t,{get href(){return Ei(r)},get blankTarget(){return Ei(e).blankTarget},onclick:()=>function(t){g(),"close"!=t.type&&setTimeout(()=>{switch(t.type){case"marker":i()?.state.marker.set(t.action);break;case"mtour":o.state.tour.set(u?.markerTours?.find(e=>e.id==t.action));break;case"vtour":o.state.tour.set(u?.tours?.find(e=>e.id==t.action))}},200)}(Ei(e)),children:(t,i)=>{W();var r=Ui();Ye(()=>ns(r,Ei(e).i18nTitle[s()])),Gi(t,r)},$$slots:{default:!0}})}}),q(e),Gi(t,e)};vs(l,t=>{Ei(T).buttons&&Ei(T).buttons.length&&t(d)}),Gi(t,e)};vs(O,t=>{Ei(y)?t(R):e.popover.gallery?t(X,1):Ei(T)&&Ei(k)&&t(F,2)}),q($),fr($,t=>oe(w,t),()=>Ei(w)),Ye(()=>C=qs($,1,"micrio-popover",null,C,{page:!!Ei(T),article:!!Ei(T)&&!Ei(_),"has-media":Ei(S),gallery:!!e.popover.gallery})),Oi("close",$,function(){e.popover.contentPage?h.dispatch("page-closed"):Ei(x)?c.tour.set(void 0):e.popover.marker&&e.popover.image?.state.marker.set(void 0),c.popover.set(void 0)}),Oi("outrostart",$,()=>p.set(!0)),Gi(t,$),it(),a()}function Lh(t,e){et(e,!0);const i=jt(()=>e.marker.positionalAudio),s=Li(()=>e.ctx).createGain();s.connect(jo);const r=Q("micrio"),n=r.$current.$info,a=n.width,o=n.height,h=Li(()=>e.ctx).createPanner();h.panningModel="equalpower",h.rolloffFactor=1,h.coneOuterGain=0;function c(){if(s.gain.value=Ei(i).volume??1,e.is360){h.refDistance=2.75*Ei(i).radius,h.maxDistance=Ei(i).radius*(11/3);const t=e.marker.x*-Math.PI*2,s=(e.marker.y-.5)*-Math.PI,r=Math.cos(s)*Math.sin(t)*11,n=11*Math.sin(s),a=Math.cos(s)*Math.cos(t)*11;h.positionX.value=r,h.positionY.value=n,h.positionZ.value=a;let o=r*r+n*n+a*a;o>0&&(o=1/Math.sqrt(o)),h.orientationX.value=r*o,h.orientationY.value=n*o,h.orientationZ.value=a*o}else h.distanceModel="linear",h.positionX.value=2*(e.marker.x-.5),h.positionY.value=2*(.5-e.marker.y)*(o/a),h.positionZ.value=-.2,h.rolloffFactor=2,h.refDistance=Ei(i).radius*Ei(i).radius*10,h.maxDistance=5*Ei(i).radius}let l,d;function u(){l&&l.disconnect(),l=e.ctx.createBufferSource(),Ei(i).loop&&(Ei(i).repeatAfter>0?l.onended=()=>{d=setTimeout(u,1e3*Ei(i).repeatAfter)}:l.loop=!0),s.gain.value=Ei(i).volume??1,l.buffer=sh[Ei(i).src],l.connect(h),l.start()}let m=ne(ue(JSON.stringify(Li(()=>e.marker.positionalAudio))));Re(()=>{const t=JSON.stringify(Ei(i));Ei(m)!=t&&oe(m,t,!0)&&c()}),ps(()=>(c(),h.connect(s),async function(){Ei(i).src&&(sh[Ei(i).src]||(sh[Ei(i).src]=await fetch(Ei(i).src).then(t=>t.arrayBuffer()).then(t=>e.ctx.decodeAudioData(t))),Ei(i).alwaysPlay&&Ei(i).repeatAfter>0?d=setTimeout(u,1e3*Ei(i).repeatAfter):u())}(),r.addEventListener("audio-update",c),()=>{r.removeEventListener("audio-update",c),l&&l.disconnect(),clearTimeout(d),h.disconnect(),s.disconnect()})),it()}var Ph=Bi('<img alt="" class="micrio-marker"/>'),$h=Bi('<label data-scroll-through=""> </label>'),Ch=Bi('<button data-scroll-through="" class="micrio-marker"><!> <!></button>'),Dh=Bi("<div><!></div>"),zh=Bi("<!> <!>",1);function Oh(t,e){et(e,!0);const i=()=>xt(d,"$current",h),s=()=>xt(T,"$tour",h),r=()=>xt(x,"$currentPopup",h),n=()=>xt(g,"$_lang",h),a=()=>xt(f,"$isMobile",h),o=()=>xt(rh,"$ctx",h),[h,c]=kt(),l=Q("micrio"),{current:d,events:u,state:m,_lang:g,spaceData:p}=l,f=l.canvas.isMobile,v=m.markerHoverId,y=Q("inView"),b=Q("markerImages"),x=l.state.popup,T=m.tour;let k=br(e,"marker",15),_=br(e,"image",31,()=>ue(i())),M=br(e,"forceHidden",3,!1),S=br(e,"coords",3,void 0),E=br(e,"overlapped",3,!1);k().tags||k(k().tags=[],!0);const I=b.has(k().id);!I&&_()&&b.set(k().id,_());const A=!(!_().isOmni||!_().$settings.omni?.sideLabels||_().$settings._markers?.noTitles),L=t=>t.steps.findIndex(t=>t.startsWith(k().id))>=0,P=k().data??{},$=P._meta||{},C=_().$settings.omni;k().imageLayer&&k().imageLayer>(C?.layers?.length??1)-1&&delete k().imageLayer,i()?.$data?.markers?.find(t=>t.data?._micrioSplitLink?.markerId==k().id&&"none"!=t.popupType)&&(k(k().popupType="none",!0),k(k().noMarker=!0,!0)),"embedUrl"in k()&&k().embedUrl&&"embedInPopover"in k()&&k().embedInPopover&&k(k().popupType="popover",!0);const D=_().$settings._markers??{},z=!!_().$settings.doTourJumps,O=k().tags.join(" "),R="cluster"==k().type,X=!1===k().data?.showTitle||!!D.noTitles||!!C?.sideLabels,F=!!P.scales||!!_().$settings.markersScale,V=F&&!!D.titlesNoScale,Y=P._micrioSplitLink,N=!!D.keepPopupsDuringTourTransitions,B=/[?&]micrioNoTooltips/.test(location.search)||!!C?.sideLabels,W=$.gridAction,U=_().$settings?._markers?.autoStartTour?l.engine.images.map(t=>"camera"in t?t.$data?.markerTours?.find(L):void 0).filter(t=>!!t)[0]??p?.markerTours?.find(L):void 0,H=U?.steps.findIndex(t=>t.startsWith(k().id)),G=!!_().$settings?._markers?.autoStartTourAtBeginning;let j=!I&&(!!P.alwaysOpen||m.$marker==k())||m.$tour?.id==U?.id&&U?.currentStep==(H??0);let Z,J,K,tt=ne(ue(I&&_().state.$marker==k())),st=ne(!1),rt=ne(""),nt=ne(0),at=ne(0),ot=ne(1),ht=!1;function ct(){if(dt(),k().onclick)return k().onclick(k());if(!D.noMarkerActions)if("cluster"==k().type){if(k().view&&i()?.$info){const t=i().camera.getScale();_().camera.flyToView(k().view,{area:_().opts?.area,limitZoom:!0,margin:[20/i().$info.width*t,20/i().$info.height*t]})}}else _().state.marker.set(k())}function lt(){D.noMarkerActions||(Ei(Mt)?.parentNode?.scrollTo(0,0),dt(),K=setTimeout(()=>{const t=_().camera.getXY(k().x,k().y);!Ei(tt)&&(t[0]<0||t[0]>=l.offsetWidth||t[1]<0||t[1]>=l.offsetHeight||_().is360&&t[3]>4)&&_().camera.flyToCoo([k().x,k().y],{speed:2,limit:!0}).catch(()=>{})},150))}function dt(){clearTimeout(K)}const ut=()=>v.set(k().id),mt=()=>v.set(void 0);let gt;async function pt(){if(R)return;if(_().state.$marker!=k())return _().state.marker.set(k());if(D.noMarkerActions)return;if(U&&U.id!=s()?.id&&!s()){U.initialStep=G?0:H;const t=U.stepInfo?.[0];if(G&&t&&t.micrioId!=_().id){const e=l.canvases[0]?.grid;e?.images.find(e=>e.id==t.micrioId)?l.current.set(e.image):l.open(t.micrioId)}if(T.set(U),setTimeout(()=>$.gridAction=W,100),G&&null!=H&&H>0)return void _().state.marker.set(void 0);await Si()}var t;j=!1,u.dispatch("marker-opened",k()),s()&&"steps"in s()&&s().isSerialTour&&s().printChapters&&s().steps.findIndex(t=>t.startsWith(k().id))>=0&&k().videoTour||(Ei(Pt)?"popover"==k().popupType?(await Si(),l.state.popover.set({marker:k(),image:_(),markerTour:s()&&"steps"in s()?s():void 0})):k().videoTour&&!s()&&(T.set(k().videoTour),(t=T,new Promise(e=>{let i;i=t.subscribe(t=>{null==t&&(i?i():Si().then(()=>i()),e(t))})})).then(()=>_().state.marker.set(void 0))):Si().then(()=>x.set(k())));const e=P.micrioLink?.id;if(e&&Si().then(()=>{_().camera.stop();const t=Nn(l,e);t&&(_(_().openedView=void 0,!0),_().state.marker.set(void 0)),l.open(e,{vector:t?.vector})}),Y&&!ht&&!_().opts.secondaryTo){const t=l.canvases[0]?.grid;t?.lastPromise&&await t.lastPromise,gt=setTimeout(()=>{Y&&(J=l.open(Y.micrioId,{splitScreen:!0,splitTo:_(),isPassive:!(!Y.follows||l.state.$tour),startView:Y.view}),ht=!0)},200)}}let ft,vt,yt=ne(!1);function bt(){if(_().is360&&F)oe(rt,_().camera.getMatrix(k().x,k().y,1,1,0,0,0).join(","),!0);else{let i=Ei(nt),s=Ei(at);if(t=_().camera.getXYDirect(k().x,k().y,{radius:k().radius,rotation:k().rotation}),e=w(t,4),oe(nt,e[0],!0),oe(at,e[1],!0),oe(ot,e[2],!0),Z=e[3],_().is360)oe(st,Z>0);else if(_().isOmni&&C){if(null!=Ei(Ct)[0]&&null!=Ei(Ct)[1]&&null!=k().rotation){const t=C.frames/(C.layers?.length??1);let e=(_().swiper?.currentIndex??0)-(Ei($t)??0);e>t/2&&(e-=t),e<-t/2&&(e+=t),oe(st,e<=Ei(Ct)[0]||e>=Ei(Ct)[1],!0)}else C.distance&&oe(st,Z<0);C.sideLabels&&!D.noTitles&&Ei(It)?.title&&y&&(i!=Ei(nt)||s!=Ei(at))&&function(t,e){const i=l.canvas.element.offsetWidth,s=l.canvas.element.offsetHeight,r=!(t<0||t>i||e<0||e>s||Ei(st));(r||Ei(yt))&&y.update(s=>{const n=s.findIndex(([t])=>t==k());return r?n>=0?s[n]=[k(),t/i,e]:s.push([k(),t/i,e]):n>=0&&s.splice(n,1),oe(yt,r,!0),s})}(Ei(nt),Ei(at))}_().$settings.clusterMarkers&&S()&&S().set(k().id,[Ei(nt),Ei(at),E()?ft:ft=Ei(St)?.offsetWidth,E()?vt:vt=Ei(St)?.offsetHeight])}var t,e}function Tt(t){const e=t.detail;k(k().x=e.x,!0),k(k().y=e.y,!0),bt()}let _t=ne(void 0),Mt=ne(void 0),St=ne(void 0);const Et=Q("mediaPaused");ps(()=>{if(k().videoTour){const t="timeline"in k().videoTour?k().videoTour.timeline:k().videoTour.i18n?.[n()]?.timeline;t?.length&&k(k().view=t[0].rect,!0)}const t=[_().state.marker.subscribe(t=>{"string"==typeof t&&t==k().id?_().state.marker.set(k()):t==k()?async function(){if(Ei(tt))return;if(oe(tt,!0),dt(),D.noMarkerActions)return;u.dispatch("marker-open",k()),!s()||"steps"in s()&&(L(s())||s().cannotClose)||(T.set(void 0),await Si());const t=s()&&"steps"in s();Ei(Pt)||t&&N||(x.set(void 0),l.state.popover.set(void 0)),mt(),Y?.markerId&&(J||(J=l.canvases.find(t=>t.id==Y.micrioId)),J&&(ht=wt(J.visible),ht&&Y?.view&&J.camera.flyToView(Y.view,{isJump:!0}).catch(()=>{}))),void 0!==k().imageLayer&&_().state.layer.set(k().imageLayer);const e=U&&G&&U!=s()&&null!=H&&H>0;e&&delete $.gridAction;const i=k().view;e||!i||P.noAnimate||k().videoTour||$.gridView?pt():j?(_().camera.setView(k().view,{area:_().opts?.area}),pt()):_().camera.flyToView(k().view,{omniIndex:Ei($t),area:_().opts?.area,isJump:!!P.doJump||z&&!!m.$tour}).then(pt).catch(()=>{s()||_().state.marker.set(void 0)})}():P.alwaysOpen||(Ei(tt)&&function(){clearTimeout(gt),u.dispatch("marker-closed",k());const t=s()&&"steps"in s();if(s()||_().state.$marker||(k().videoTour||_().openedView?setTimeout(()=>_().camera.aniDoneAdd.push(()=>{wt(T)||_().state.$marker||Ei(_t)?.focus()}),10):Ei(_t)?.focus()),l.state.popover.set(void 0),!Ei(Pt)){r()!=k()||t&&N||x.set(void 0);const e=l.canvases.find(t=>t!=_()&&t.state.$marker);e&&Si().then(()=>{const t=e.state.$marker;t&&"popup"==t.popupType&&x.set(t)})}Y&&J&&setTimeout(()=>{const t=wt(l.state.marker);J&&Y.micrioId!=t?.data?._micrioSplitLink?.micrioId&&l.close(J)},210)}(),oe(tt,!1))})];return Ei(Lt)||(t.push(_().camera.image.state.view.subscribe(bt)),bt()),M()||Si().then(()=>{Ei(tt)&&!k().noMarker&&r()&&r()!=k()&&!s()?_().state.marker.set(void 0):(j||P.alwaysOpen)&&pt()}),k().htmlElement&&Ei(Mt)&&Ei(Mt).appendChild(k().htmlElement),()=>{for(clearTimeout(gt);t.length;)t.shift()?.()}});const It=jt(()=>Kn(k(),n())),At=jt(()=>!(Ei(It)?.title||Ei(It)?.body||Ei(It)?.bodySecondary||Ei(It)?.embedUrl||k().images&&k().images.length)),Lt=jt(()=>M()||k().noMarker),Pt=jt(()=>"popup"!=k().popupType||Ei(At)),$t=jt(()=>_().camera.getOmniFrame((k().rotation??0)+(k().backside?Math.PI:0))),Ct=jt(()=>k().visibleArc?[_().camera.getOmniFrame(k().visibleArc[0]),_().camera.getOmniFrame(k().visibleArc[1])]:[]),Dt=jt(()=>s()&&(!("steps"in s())&&!s().keepMarkers||D.hideMarkersDuringTour&&!xt(Et,"$tourPaused",h))&&!Ei(tt));Re(()=>{Ei(Dt)&&Ei(yt)&&y.update(t=>{const e=t.findIndex(t=>t[0]==k());return e>=0&&t.splice(e,1),t})});const zt=jt(()=>"default"==k().type?void 0:"link"==k().type?"link":"media"==k().type?"play":"cluster"==k().type?void 0:k().type??void 0),Ot=jt(()=>(null!=k().data?.customIconIdx?_().$settings._markers?.customIcons?.[k().data?.customIconIdx]:void 0)??k().data?.icon??D.markerIcon??void 0),Rt=jt(()=>!!Ei(zt)||!!Ei(Ot)),Xt=jt(()=>!("class"in k()&&""===k().class||!Ei(Rt)&&"default"!=k().type)),Ft=jt(()=>Ei(It)&&(!X||a()&&A)&&(Ei(It).label||Ei(It).title));var Vt=zh(),Yt=_e(Vt),Nt=t=>{var e=Dh();let i;var s=ke(e),r=t=>{var e=Ch(),i=ke(e),s=t=>{var e=Ph();Ye(()=>ar(e,"src","string"==typeof Ei(Ot)?Ei(Ot):Ei(Ot).src)),Gi(t,e)},r=t=>{pa(t,{get name(){return Ei(zt)}})};vs(i,t=>{Ei(Ot)?t(s):Ei(zt)&&t(r,1)});var n=Me(i,2),a=t=>{var e=$h();let i;var s=ke(e,!0);q(e),fr(e,t=>oe(St,t),()=>Ei(St)),Ye(()=>{ar(e,"for",k().id),i=qs(e,1,"micrio-marker",null,i,{static:V}),ns(s,Ei(It)?.label||Ei(It)?.title)}),Gi(t,e)};vs(n,t=>{Ei(Ft)&&t(a)}),q(e),fr(e,t=>oe(_t,t),()=>Ei(_t)),Ye(()=>{ar(e,"title",B||R?null:Ei(It)?Ei(It).label||Ei(It).title:null),ar(e,"id",k().id)}),Ri("click",e,ct),Oi("focus",e,lt),Oi("blur",e,dt),Oi("mouseenter",e,ut),Oi("mouseleave",e,mt),Gi(t,e)};vs(s,t=>{k().htmlElement||t(r)}),q(e),fr(e,t=>oe(Mt,t),()=>Ei(Mt)),Rs(e,(t,e)=>{return s=e,(i=t).addEventListener("change",s),{destroy:()=>i.removeEventListener("change",s)};var i,s},()=>Tt),Ye(()=>{ar(e,"id",`m-${k().id}`),i=qs(e,1,Vs(O),"micrio-marker",i,{overlapped:E()&&!Ei(tt),cluster:R,behind:Ei(st),hovered:xt(v,"$hovered",h)==k().id,default:Ei(Xt),mat3d:!!Ei(rt),opened:Ei(tt),"micrio-link":!!P.micrioLink,"has-icon":Ei(Rt),"has-custom-icon":!!Ei(Ot)}),Us(e,Ei(rt)?`--mat:matrix3d(${Ei(rt)})`:Ei(nt)?`--x:${Ei(nt)}px;--y:${Ei(at)}px${F?`;--scale:${Ei(ot)}`:""}`:null)}),Gi(t,e)};vs(Yt,t=>{Ei(Lt)||!_()||Ei(Dt)||t(Nt)});var Bt=Me(Yt,2),qt=t=>{Lh(0,{get marker(){return k()},get ctx(){return o()},get is360(){return _().is360}})};vs(Bt,t=>{k().positionalAudio&&o()&&(!k().positionalAudio.noMobile||a())&&(k().positionalAudio.alwaysPlay||Ei(tt))&&t(qt)}),Gi(t,Vt),it(),c()}Xi(["click"]);var Rh=Bi("<div><!></div>");function Xh(t,e){et(e,!0);const i=()=>xt(h,"$_lang",s),[s,r]=kt();let n=br(e,"settings",31,()=>ue({i18n:{}})),a=br(e,"image",15);const o=Q("micrio"),{_lang:h,spaceData:c}=o,l=a().$info,d=a().$settings,u=Rn(Li(()=>e.targetId))?.[2],m=Nn(o,Li(()=>e.targetId));m||console.error(`[Micrio Waypoint] Could not calculate vector for target ${Li(()=>e.targetId)}`);const{directionX:g,v:p,vN:f,vector:v}=m;let w=ne(void 0);const y=Math.abs(f[1])<.3,b=y?.65:.5+f[1]/10,x={x:g,y:b,baseScale:l.width/1024,scale:1,rotX:(1+(y?-(1-b):f[1]))*Math.PI/2,rotY:0,rotZ:0},T=n()?.coords??sn(x);let k,_=T.custom,M=_?T:x;function S(){d._markers?.noMarkerActions||(Ei(w).parentNode.scrollTo(0,0),clearTimeout(k),k=setTimeout(()=>{const t=a().camera.getXY(M.x,M.y);!Ei(L)&&(t[0]<0||t[0]>=o.offsetWidth||t[1]<0||t[1]>=o.offsetHeight||a().is360&&t[3]>4)&&a().camera.flyToCoo([M.x,M.y],{speed:2,limit:!0}).catch(()=>{})},150))}let E=ne(""),I=n().customIconIdx;const A=()=>{C.deleted?oe($,!0):(I!=C.settings.customIconIdx&&(n(n().customIconIdx=C.settings.customIconIdx,!0),I=n().customIconIdx),T.custom!=_&&(_=T.custom,M=_?T:x),oe(E,a().camera.getMatrix(M.x,M.y,M.baseScale*M.scale,1,M.rotX,M.rotY,M.rotZ,0,1,1,!0).join(","),!0))};let L=ne(!1);function P(){d._markers?.noMarkerActions||(oe(L,!0),a(a().openedView=void 0,!0),a().state.marker.set(void 0),o.open(e.targetId,{vector:v}))}let $=ne(!1);const C={coords:T,settings:n()};A(),ps(()=>{C.el=Ei(w),Ei(w)._iface=C,o.dispatchEvent(new CustomEvent("wp-print",{detail:C}));const t=a().state.view.subscribe(A);return()=>t()});const D=jt(()=>n().i18n?.[i()]?.title||u?.i18n?.[i()]?.title),z=jt(()=>c?.icons?.[n().customIconIdx??-1]);var O=Hi(),R=_e(O),X=t=>{var i=Rh();let r;var n=ke(i);{let t=jt(()=>Ei(z)?void 0:"arrow-up"),e=jt(()=>Ei(D)??xt(ca,"$i18n",s).waypointFollow);Ea(n,{get type(){return Ei(t)},get icon(){return Ei(z)},onclick:P,onfocus:S,get title(){return Ei(e)}})}q(i),fr(i,t=>oe(w,t),()=>Ei(w)),Ye(()=>{Us(i,`--matrix: matrix3d(${Ei(E)??""})`),ar(i,"id",`w-${e.targetId}`),r=qs(i,1,"micrio-waypoint",null,r,{clicked:Ei(L),active:Ei(L),"direction-up":p[1]<0,"direction-down":p[1]>0})}),Ds(3,i,()=>ia),Gi(t,i)};vs(R,t=>{Ei($)||t(X)}),Gi(t,O),it(),r()}var Fh,Vh=class{constructor(t){if(this.image=t,this.center=[0,0,1],this.view=[0,0,1,1],this.rotationY=0,this.aniDoneAdd=[],this.cooToArea=(t,e,i)=>({x:i[0]+t*(i[2]-i[0]),y:i[1]+e*(i[3]-i[1])}),this.getView=()=>this.view,this.getViewRaw=()=>this._view,this.getViewLegacy=()=>{if(this._engineCanvas)return[this._view[0]-this._view[2]/2,this._view[1]-this._view[3]/2,this._view[0]+this._view[2]/2,this._view[1]+this._view[3]/2]},this.getCoo=(t,e,i=!1,s=!1)=>this.getCooDirect(t,e,i,s).slice(0).map(t=>Math.round(1e6*t)/1e6),this.getXY=(t,e,i=!1,s,r,n)=>this.getXYDirect(t,e,{abs:i,radius:s,rotation:r,noTrueNorth:n}).slice(0),this.getScale=()=>this.center[2]??1,this.setScale=t=>this.setCoo(this.center[0],this.center[1],t),this.getCoverScale=()=>this._engineCanvas?.camera.coverScale??1,this.getMinScale=()=>this._engineCanvas?.camera.minScale??.1,this.isZoomedIn=()=>!!this._engineCanvas?.isZoomedIn(),this.isZoomedOut=(t=!1)=>!!this._engineCanvas?.isZoomedOut(t),this.getCoverLimit=()=>!!this._engineCanvas?.coverLimit,this.flyToView=(t,e={})=>new Promise((i,s)=>{if(!this._engineCanvas)return s(new Error("engine not ready"));let{centerX:r,centerY:n,width:a,height:o}=fn.toCenterJSON(t);if(2==e.margin?.length&&(r+=e.margin[0],n+=e.margin[1],a-=2*e.margin[0],o-=2*e.margin[1]),e.area){const t=this.cooToArea(r,n,e.area);r=t.x,n=t.y,a*=e.area[2]-e.area[0],o*=e.area[3]-e.area[1]}if(e.prevView){const t=fn.toCenterJSON(e.prevView);this._c.ani.setStartView(t.centerX,t.centerY,t.width,t.height,!1)}if(this.image.$settings.omni?.frames){const i=this.image.$settings.omni.layers?.length??1,s=this.image.$settings.omni.frames/i;if(null==e.omniIndex){const i=t[4]?t[4]:Array.isArray(t)&&void 0!==t[5]?t[5]:void 0;void 0!==i&&(e.omniIndex=Math.round(Hr(i/(2*Math.PI))*s))}null!=e.omniIndex&&(e.omniIndex=Hr(e.omniIndex,s))}const h=this._c.camera.flyTo(r,n,a,o,e.duration??-1,e.speed??-1,e.progress??0,!!e.isJump,!!e.limit,!!e.limitZoom,e.omniIndex??0,Yo.Camera.TimingFunction[e.timingFunction??"ease"],performance.now());this.image.engine.render(),0==h?i():this.setAniPromises(i,s)}),this.flyToFullView=(t={})=>this.flyToCoo([.5,.5,this.getMinScale()],t),this.flyToCoverView=(t={})=>{const e=this.image.$settings.focus??[.5,.5];return e[2]=this.getCoverScale(),this.flyToCoo(e,t)},this.flyToCoo=(t,e={})=>new Promise((i,s)=>{if(!this._engineCanvas)return s(new Error("engine not ready"));const r=Yo.Camera.TimingFunction[e.timingFunction??"ease"];e.duration=this._c.camera.setCoo(t[0],t[1],t[2]||this.center[2],e.duration??-1,e.speed??-1,e.limit??!1,r,performance.now()),this.image.engine.render(),0==e.duration?i():this.setAniPromises(i,s)}),this.zoom=(t,e=0,i=void 0,s=void 0,r=1,n=!1)=>new Promise((r,a)=>{if(!this._engineCanvas)return a(new Error("engine not ready"));const o=this.getXY(this.center[0],this.center[1]);if(null==i&&(i=o[0]),null==s&&(s=o[1]),this.image.album&&!this.image.album.hooked)return r();e=this._c.camera.zoom(t,i,s,e,n,performance.now()),this.image.engine.render(),0==e?r():this.setAniPromises(r,a)}),this.zoomIn=(t=1,e=250,i=1)=>this.zoom(200*-t,e,void 0,void 0,i).catch(()=>{}),this.zoomOut=(t=1,e=250,i=1)=>{const s=this.image.engine.micrio.canvas.viewport,r=s.width/s.height,n=this.image.$info.width/this.image.$info.height;return this.zoom(t*(400/Math.max(1,r/n/2)),e,void 0,void 0,i).catch(()=>{})},this.getDirection=()=>this._engineCanvas?this._c.webgl.yaw:0,this.getPitch=()=>this._engineCanvas?this._c.webgl.pitch:0,!t.is360){const e=t.state.$view;e&&t.$info?.width&&Si().then(()=>this.setView(e))}}bindEngineCanvas(t){this._engineCanvas=t}assign(t,e,i,s){this._view=t,this._xy=e,this._coo=i,this._mat=s}get _c(){return this._engineCanvas}_getXY(t,e,i,s,r){const n=this._c;n.is360?n.webgl.getXYZ(t,e):void 0===r||isNaN(r)?n.camera.getXY(t,e,!!i):n.camera.getXYOmni(t,e,s??0,r,!!i)}_getCoo(t,e,i,s){const r=this._c;r.is360?r.webgl.getCoo(t,e):r.camera.getCoo(t,e,!!i,!!s)}_setMinScale(t){const e=this._c;e.camera.minScale=t,e.camera.correctMinMax(),e.camera.setView(),e.webgl.update()}viewChanged(){const t=this._view,e=this.center.join(","),i=this.getCoo(0,0);this.view[0]=t[0]-t[2]/2,this.view[1]=t[1]-t[3]/2,this.view[2]=t[2],this.view[3]=t[3],this.center[0]=t[0],this.center[1]=t[1],this.center[2]=i[2],this.image.is360&&(this.center[3]=i[3],this.center[4]=i[4]),this.image.isOmni&&(this.center[5]=this.image.swiper?.currentIndex),(this.center.join(",")!=e||this.image.engine.micrio.canvas.resizing||this._engineCanvas?.areaAnimating())&&this.image.state.view.set(this.view)}getXYDirect(t,e,i={}){const s=this.image.is360&&!i.noTrueNorth?-this.rotationY/(2*Math.PI):0;return this._getXY(t-s,e,!0===i.abs,i.radius,i.rotation),this._xy}getCooDirect(t,e,i=!1,s=!1){if(i){const i=this.image.engine.micrio.getBoundingClientRect();t-=i.left,e-=i.top}return this._getCoo(t,e,!0===i,!0===s),this._coo}setView(t,e={}){if(!this._engineCanvas)return;let{centerX:i,centerY:s,width:r,height:n}=fn.toCenterJSON(t);if(e.area){const t=this.cooToArea(i,s,e.area);i=t.x,s=t.y,r*=e.area[2]-e.area[0],n*=e.area[3]-e.area[1]}this._c.setView(i,s,r,n,!!e.noLimit,!1,e.correctNorth),e.noRender||this.image.engine.render()}setCoo(t,e,i=this.center[2]??1){this._engineCanvas&&(this._c.camera.setCoo(t,e,i,0,0,!1,0,performance.now()),this.image.engine.render())}getMatrix(t,e,i,s,r,n,a,o,h,c,l){return this._engineCanvas?(this._c.getMatrix(t,e,i??1,s??10,r||0,n||0,a||0,o||0,h??1,c??1,!!l),this._mat):new Float32Array(16)}setMinScale(t){this._engineCanvas&&this._setMinScale(t)}setMinScreenSize(t){!this.image.album&&this._engineCanvas&&(this._c.camera.minSize=Math.max(0,Math.min(1,t??1)))}setLimit(t){if(!this._engineCanvas)return;const e=fn.rectToCenterJSON(t);this._c.view.setLimit(e.centerX,e.centerY,e.width,e.height),this.image.engine.render()}setCoverLimit(t){this._engineCanvas&&(this._c.coverLimit=!!t,this._c.camera.correctMinMax())}stop(){this._engineCanvas?.aniStop()}pause(){this._engineCanvas?.aniPause(performance.now())}resume(){this._engineCanvas?.aniResume(performance.now()),this.image.engine.render()}set360RangeLimit(t=0,e=0){this._engineCanvas&&(this._c.webgl.setLimits(t,e),this.image.engine.render())}aniIsKinetic(){return!!this._engineCanvas?.kinetic.started}setAniPromises(t,e){this.aniDone=t,this.aniAbort=e}pan(t,e,i=0,s={}){this._engineCanvas&&(this._c.camera.pan(t,e,i,!!s.noLimit,performance.now()),(i>0||s.render)&&this.image.engine.render())}setDirection(t,e){this._engineCanvas&&(this._c.setDirection(t,e??this._c.webgl.pitch,!1),this.image.engine.render())}setArea(t,e={}){if(this._engineCanvas){if(this.image.opts.isEmbed){if(this.image.ptr>0){this.image.opts.area=t;for(const e of this._c.images)if(e.localIdx>0)return void e.setArea(t[0],t[1],t[2],t[3])}}else this.image.opts.area=t,this._c.setArea(t[0],t[1],t[2],t[3],!!e.direct,!!e.noDispatch);e.noRender||this.image.engine.render()}}setRotation(t=0,e=0,i=0){if(this.image.opts.isEmbed&&this._engineCanvas&&this.image.engine.ready){for(const s of this._c.images)if(s.localIdx>0){s.rotX=t,s.rotY=e,s.rotZ=i;break}this.image.engine.render()}}getOmniRotation(){const t=this.image.$settings.omni;return t&&this._engineCanvas?(this.image.swiper?.currentIndex??0)/((t?.frames??1)/(t?.layers?.length??1))*Math.PI*2:0}getOmniFrame(t){const e=this.image.$settings.omni;if(!e||null==t)return;const i=e.frames/(e.layers?.length??1);return Math.floor(t/(2*Math.PI)*i)}getOmniXY(t,e,i){return this._engineCanvas?(this._c.camera.getXYOmniCoo(t,e,i,0,!1),this._xy):new Float64Array(5)}setOmniSettings(){const t=this.image.$settings.omni;if(!t||!this._engineCanvas)return;const e=this._c;e.omniDistance=-t.distance||0,e.omniFieldOfView=t.fieldOfView??0,e.omniVerticalAngle=t.verticalAngle??0,e.omniOffsetX=t.offsetX??0,this.image.state.view.set(this.view)}};!function(t){t.Main=class{get $tour(){return this._tour}get $marker(){return this._marker}constructor(t){this.micrio=t,this.tour=vt(),this.marker=vt(),this.markerHoverId=vt(),this.popup=vt(),this.popover=vt(),this.ui={controls:vt(!0),zoom:vt(!0),hidden:vt(!1),hover:vt(!1)},this.mediaState=new Map,this.tour.subscribe(t=>{"string"!=typeof t&&(this._tour=t)}),this.marker.subscribe(t=>{"string"!=typeof t&&(this._marker=t)})}get(){if(this.micrio.$current)return this.value={id:this.micrio.$current.id,c:this.micrio.canvases.map(t=>t.state.get())},this._tour&&(this.value.t=[this._tour.id],"instance"in this._tour&&this._tour.instance?this.value.t.push(this._tour.instance.currentTime,this._tour.instance.paused?"p":void 0):"steps"in this._tour&&void 0!==this._tour.currentStep&&this.value.t.push(this._tour.currentStep)),this.value}async set(t){if(this.value=t){if(void 0!==t.t?.[1]){const e=t.t[0],i=this.mediaState.get(e);i?(i.currentTime=t.t[1],i.paused="p"==t.t[2]):this.mediaState.set(e,{currentTime:t.t[1],paused:"p"==t.t[2]})}if(t.c?.forEach(t=>{if(void 0!==t[6]&&void 0!==t[7]){const e=t[6],i=this.mediaState.get(e);i?(i.currentTime=t[7],i.paused="p"==t[8]):this.mediaState.set(e,{currentTime:t[7],paused:"p"==t[8]})}}),t.t&&await this.setTour(t.t[0]),this.micrio.$current?.id!=t.id&&(this.micrio.open(t.id),this.micrio.$current&&await gn(this.micrio.$current.data,{allowUndefined:!0})),this.micrio.canvases.forEach(e=>{e.state.set(t.c.find(t=>t[0]==e.id))}),t.t)return this.setTour(t.t[0],t.t[1]);{const e=t.c.find(e=>e[0]==t.id);e&&!e[5]&&this.micrio.$current&&this.micrio.$current.camera.flyToView(e.slice(1,5),{speed:2}).catch(()=>{})}}}async setTour(t,e){if(!this.micrio.$current)return;const i=await gn(this.micrio.$current.data,{allowUndefined:!0});if(i){const s=i.markerTours?.find(e=>e.id==t)||i.tours?.find(e=>e.id==t);s&&"steps"in s&&void 0!==e&&(s.initialStep=e),this._tour?.id!=t&&this.tour.set(s)}}};t.Image=class{get $view(){return this._view}get $marker(){return this._marker}constructor(t){this.image=t,this.view=vt(void 0),this.marker=vt(void 0),this.layer=vt(0);const e=t.engine.micrio;let i,s,r;this.view.subscribe(n=>{this._view=n;const a=n?.toString();if(n&&a&&i!=a){const o={image:t,view:n};i=a;const h=n[2],c=n[3];(!s||!r||Math.abs(h-s+(c-r))>1e-5)&&(e.events.dispatch("zoom",o),s=h,r=c),e.events.dispatch("move",o)}}),this.marker.subscribe(t=>{const i=this._marker;this._marker=t&&"string"!=typeof t?t:void 0,this._marker?e.state.marker.set(this._marker):t||e.state.$marker!=i||e.state.marker.set(void 0)})}hookOmni(){const t=this.image;this.layer.subscribe(e=>{t.ptr<0||!t.engine.ready||(t.engine.setActiveLayer(t.ptr,e),t.engine.render())})}get(){const t=this._marker,e=t?Array.from(this.image.engine.micrio.state.mediaState).reverse().find(e=>e[0].startsWith(t.id)):null;return[this.image.id,...this._view?this._view.slice(0,4):[0,0,1,1],...t?[t.id,...e?[e[0],e[1].currentTime,e[1].paused?"p":void 0]:[]]:[void 0]].filter(t=>void 0!==t)}set(t){t?.length&&(this.view.set(t.slice(1,4)),t[5]?this._marker?.id!=t[5]&&this.marker.set(t[5]):this._marker&&this.marker.set(void 0))}}}(Fh||(Fh={}));var Yh=new class{constructor(){this.data=new Map,this.db=new Map,this.images=[],this.get=t=>new Promise((e,i)=>{const s=this.db.get(t);if(!s||!this.data.has(s[0]))return i(new Error("Could not get blob: "+t));const r=new FileReader;r.onload=()=>e(JSON.parse(r.result)),r.readAsText(new Blob([new Uint8Array(this.data.get(s[0]),s[1],s[2])]))}),this.getImage=async t=>new Promise((e,i)=>{const s=this.db.get(t);if(!s||!this.data.has(s[0]))return i(new Error("Could not get blob: "+t));const r=new Blob([new Uint8Array(this.data.get(s[0]),s[1],s[2])]);if("createImageBitmap"in self)e(self.createImageBitmap(r));else{let t=this.images.find(t=>!t.src);t||this.images.push(t=new Image),t.onload=()=>{t&&(e(t),requestAnimationFrame(()=>{t&&(URL.revokeObjectURL(t.src),t.src="")}))},t.src=URL.createObjectURL(r)}})}async load(t,e,i){if(this.data.has(e))return;const s=e.replace(/^.*\//,"").split(".")[0],r=/\/base$/.test(e),n=r||Yn(s),a=new XMLHttpRequest,o=await new Promise((s,r)=>{let o=0;a.responseType="arraybuffer",a.onprogress=t=>{o||(o=Number(a.getResponseHeader("Content-Length"))),i?.(Math.min(1,t.loaded/o))},a.onload=()=>{4===a.readyState&&200===a.status?(i?.(1),s(a.response)):r()},a.onerror=r,a.open("GET",t+e+(n?".bin":".mdp")),a.send()});if(!o)return;this.data.set(e,o);const h=r?e.split("/")[0]+"/":"";let c=0;for(;c<o.byteLength&&!(c+32>o.byteLength);){const i=this.parseHeader(new Uint8Array(o,c,32));if(i.name&&i.size>0)this.db.set(t+h+i.name.replace("./",""),[e,c+32,i.size]);else if(0===i.size&&!i.name)break;c+=32+i.size}}parseHeader(t){const e=(new TextDecoder).decode(t),i=t=>e.slice(s,s+=t).replace(/\x00/g,"").trim();let s=0;return{name:i(20),size:parseInt(i(12),8)}}},Nh=[],Bh=class t{get $info(){return this.__info}get $settings(){return wt(this.settings)}get $data(){return wt(this.data)}constructor(t,e,i={}){if(this.engine=t,this.attr=e,this.opts=i,this.uuid=an(),this.__info=sn(Pn),this.settings=vt({}),this.data=vt(void 0),this.video=vt(void 0),this.visible=vt(!1),this.ptr=-1,this.baseTileIdx=-1,this.is360=!1,this.isVideo=!1,this.isOmni=!1,this.levels=1,this.dzLevels=0,this.noImage=!1,this.opacity=1,this.viewport=vt(),this.embeds=[],this.isV5=!1,this._loadedData=!1,this.embedElements=new Map,this.state=new Fh.Image(this),i.useParentCamera||(this.camera=new Vh(this)),this.id=(e.id??"").replace(In,""),this.id.startsWith("external/")){const t=this.id.indexOf("/",this.id.indexOf("/")+1);-1!==t&&(this.id=this.id.substring(0,t+1)+encodeURIComponent(this.id.substring(t+1)))}this.isV5=Yn(this.id.split("/")[0]),this.infoBasePath=e.path&&e.forceInfoPath?e.path:void 0,this.dataPath=e.path||this.__info.path,this.isV5&&!e.path&&(this.dataPath="https://r2.micr.io/"),i.secondaryTo?(this.opacity=0,i.area=this.engine.micrio.canvas.viewport.portrait?[0,1,1,1]:[1,0,1,1],void 0===i.isPassive&&(i.isPassive=!0)):i.area||(i.area=[0,0,1,1]),this.preset=Rn(this.id);let s=!1;var r;this.info=(r=t=>{s?t(this.__info):this.load().then(t),s=!0},{subscribe:vt(void 0,r).subscribe});const n=this.engine.micrio,a=!!this.attr.revision;let o,h=wt(this.visible);i.isEmbed&&!a||this.visible.subscribe(t=>{t!=h&&(h=t,t&&!this._loadedData&&(!a&&this.isV5?(this._loadedData=!0,this.data.set(void 0)):this.loadData()),i.secondaryTo&&(i.isPassive&&(o?(o(),o=null):t&&(o=i.secondaryTo.state.view.subscribe(t=>{t&&!this.camera.aniDone&&this.camera.setView(t,{noLimit:!0})}))),t?n.events.dispatch("splitscreen-start",this):n.events.dispatch("splitscreen-stop",this)),n.visible.update(e=>(t?e.push(this):e.splice(e.indexOf(this),1),e)),t&&n.$current==this&&n.switching.set(!1))}),this.video.subscribe(t=>this._video=t),this.data.subscribe(t=>{t&&((t,e,i,s)=>{t&&(t.revision&&(t.revision=Object.fromEntries(Object.entries(t.revision??{}).filter(t=>Number(t[1])>0))),t.embeds?.forEach(t=>{t.uuid||(t.uuid=t.id??t.micrioId),wn(t.video),wn(t),s&&(t.area=fn.fromLegacy(t.area))}),t.markers?.forEach(t=>kn(t,e,i,s)),s&&t.tours?.forEach(_n),t.music?.items?.forEach(wn),t.pages?.forEach(xn))})(t,n.lang,this.isV5,yn(this.__info))})}setError(t,e){const i=t instanceof Nr?t.displayMessage:e??(t instanceof Error?t.message:t)??"An unknown error has occurred";throw this.error=i,this.engine.micrio.printError(t instanceof Nr?t:i),this.engine.micrio.loading.set(!1),t instanceof Error?t:new Error(i)}async load(){let t=this.__info;const e=this.attr,i=this.engine.micrio;e.id&&e.width&&(e.settings&&rn(Pn.settings,e.settings,{noOverwrite:!0}),this.__info=t=e);let s=t.iiifManifest||e.iiifManifest;t.isIIIF=this.id.startsWith("http")||"iiif"==t.format;const r=!!e.settings?.forceDataRefresh;let n;if(!this.id||e.width&&e.height&&!s)this.preset?.[1]&&rn(this.preset[1],t);else{const e=t=>this.setError(t,"string"==typeof t?t:'Image with id "'+this.id+'" not found, published, or embeddable.');rn(this.preset?.[1]||await(t.isIIIF?On(this.id):Xn(this.id,this.infoBasePath,r).then(e=>(e?.id&&!t.isIIIF&&this.id.split("/").length>=3&&this.id.startsWith("external/")&&(n=e.id.split("/").reverse()[0],(this.isV5=Yn(n))&&(this.dataPath=e.path||"https://r2.micr.io/")),e))).catch(e),t),!s&&t.iiifManifest&&(s=t.iiifManifest),t.isIIIF||(t.isIIIF=!!s),s&&rn(await On(s).catch(e),t),t.settings?._meta?.noLogo&&(t.settings.noLogo=!0),t.settings?._meta?.noSmoothing&&(t.settings.noSmoothing=!0)}if(t.id.startsWith("https://iiif.micr.io/")&&(t.id=t.id.slice(21)),7==this.id?.length){const e=Vn(this.id[1+Vn(this.id)%6]);t.is360=!!(e>>4&1)||t.is360,t.isWebP=!(3&e),t.isPng=2==(3&e),e>>3&1&&Yn(t.tilesId??this.id)&&(t.format="dz"),t.path||(t.path=`https://${e>>2&1?"eu":"r2"}.micr.io/`)}const a=this.isV5&&this.id.startsWith("i")&&!this.id.includes("/");a&&!t.tilesId&&(t.tilesId=this.id.slice(1));const o=An.includes(t.id)||t.tilesId&&An.includes(t.tilesId);if(rn(e,t),n&&(this.id=t.id=n),this.tileBase=a&&!t.tileBasePath?.includes("micr.io")?t.tileBasePath??"https://b.micr.io/":o||a?Sn:t.tileBasePath??t.path??(this.isV5?"https://r2.micr.io/":"https://b.micr.io/"),t.organisation?.baseUrl&&!e.path?(this.dataPath=t.path=t.organisation.baseUrl,a&&!o||(this.tileBase=this.dataPath)):"https://eu.micr.io/"==t.path&&(this.dataPath=t.path),t.settings?.omni&&(this.isOmni=!0,parseFloat(t.version)>=5&&(await Yh.load(this.tileBase??this.dataPath,(t.tilesId??t.id)+"/base",t=>i._ui?.setProps?.({loadingProgress:t})).catch(t=>this.setError(t,"Could not find object base package.")),t.settings.gallery||(t.settings.gallery={}),t.settings.gallery.type="omni",t.settings.gallery.archive=t.id)),!t.organisation?.branding||t.settings&&t.settings.noUI||this.loadStyle(this.dataPath+"style/"+t.organisation.slug+".css").then(()=>{const t=getComputedStyle(this.engine.micrio).getPropertyValue("--micrio-font-family")?.replace(/^'([^']+)'.*$/,"$1");t&&document.fonts.ready.then(()=>{document.fonts.check("16px "+t)||this.loadStyle(`https://fonts.googleapis.com/css2?family=${t}:ital,wght@0,300;0,400;0,500;0,600;0,800;1,300;1,400;1,500;1,600;1,800&display=swap`)})}),t.isIIIF)if(t.sequences&&t.sequences.length)this.parseIIIFSequenceV2(t,!!s);else if("Manifest"==t.type)this.parseIIIFSequenceV3(t);else{const e=(s||("@id"in t?t["@id"]:t.id)).replace("/info.json","");t.path=e.replace(/\/[^/]*$/,""),t.id=e.replace(/^.*\/([^/]*)$/,"$1")}if(t.spacesId&&!i.spaceData&&(i.spaceData="MICRIO_SPACE_DATA"in self?self.MICRIO_SPACE_DATA:await On((this.infoBasePath??In)+"spaces/"+t.spacesId+".json"),1==i.spaceData?.images.length&&delete i.spaceData),t.is360&&this.camera){const e=i.spaceData?.images.find(t=>t.id==this.id)?.rotationY;null!=e?this.camera.rotationY=e:null!=t.settings?._360?.trueNorth&&(this.camera.rotationY=(t.settings._360.trueNorth-.5)*Math.PI*2)}this.noImage=this.noImage||this.isOmni||!t.id&&!t.tilesId,this.extension=t.tileExtension||t.isPng&&"png"||t.isWebP&&"webp"||"jpg","dz"==t.format&&(t.isDeepZoom=!0),this.is360=!!t.is360,this.isVideo=!!t.isVideo;let h=this.isV5?wt(i._lang):("cultures"in t?void 0:e.lang)??void 0;if(this.isV5){if(t.revision){const e=Object.keys(t.revision);e.length&&!e.includes(h)&&(i.lang=e[0])}}else if(!t.settings?.skipMeta&&"cultures"in t){const e=(t.cultures||"").split(","),s=this.opts.isEmbed||!!this.opts.area,r=t.settings?.onlyPreferredLang||s;h=t.lang&&e.includes(t.lang)?t.lang:r?void 0:e[0],h&&!s&&(i.lang=h)}const c=t.settings;c&&!c?.noExternals&&await Promise.all([c.css?this.loadStyle(c.css.href):null,c.js?this.loadScript(c.js.href,h):null].filter(t=>!!t));for(let d=t.tileSize;d<Math.max(t.width,t.height);d*=2,this.levels++);let l=Math.max(t.width,t.height);do{this.dzLevels++}while((l/=2)>1);return c?.gallery?.archive&&(this.levels-=1-(c.gallery.archiveLayerOffset??0)),this.noImage||(this.thumbSrc=this.getTileSrc(this.levels,0,0)),i.events.dispatch("pre-info",t),this.isV5&&null!=t.revision&&!this.opts.isEmbed?await this.loadData():t.settings?.skipMeta||this.opts.isEmbed||this.isV5||i._lang.subscribe(t=>{!t||!this.id||"cultures"in this.__info&&(this.__info.cultures||"").split(",").includes(t)||(t=void 0),this.data.set(void 0),!t&&this.preset?.[2]&&(t="preset"),t&&this.id&&(this.isV5||(i.state.tour.set(void 0),this.state.marker.set(void 0)),this.preset?.[2]?this.enrichData(this.preset[2]).then(t=>{this.data.set(t),this.preset?.[2]&&(this.preset[2]=void 0)}):On(this.dataPath+this.id+"/data."+t+".json").catch(()=>{}).then(t=>t&&this.enrichData(t).then(t=>this.data.update(e=>(rn(t,e||(e={}),{mergeArrays:!0}),e)))))}),t.settings?.micrioSplitLink&&!this.opts.secondaryTo&&i.open({id:t.settings.micrioSplitLink,settings:{hookEvents:!1!==t.settings.secondaryInteractive}},{splitScreen:!0,isPassive:!t.settings.noFollow}),t.settings&&this.settings.set(t.settings),t.watermark&&this.engine.micrio.webgl.loadWatermark(t.watermark,t.settings?.watermarkOpacity),delete t.settings,this.isOmni&&this.state.hookOmni(),t}async loadData(){const t=this.$settings?.skipMeta||this.__info.settings?.skipMeta;if(this._loadedData||t)return Promise.resolve();this._loadedData=!0;const e=this.preset?.[2]??(this.isV5&&await On(this.dataPath+this.id+"/data/pub.json",this.__info.settings?.forceDataRefresh).catch(()=>{}));e&&this.enrichData(e).then(t=>this.data.set(t))}getTileSrc(t,e,i,s){const r=this.__info;if(r){if(r.isDeepZoom&&(t=this.dzLevels-t),r.isIIIF){const s=r.tileSize,n=Math.pow(2,t)*s,a=Math.min(r.width,e*n),o=Math.min(r.height,i*n),h=Math.min(r.width-a,n),c=Math.min(r.height-o,n),l=Math.round(Math.min(s,h/n*s)),d=Math.round(Math.min(s,c/n*s));return`${r.path}/${r.id}/${[a,o,h,c].join(",")}/${[l,d].join(",")}/0/default.jpg`}if(r.settings?._360?.video?.src)throw"Video thumb";return`${this.tileBase}${r.tilesId||r.id}/${void 0!==s?s+"/":""}${t}/${e}${r.isDeepZoom?"_":"-"}${i}.${this.extension}`}}loadScript(t,e=""){return new Promise(i=>{if(Nh.includes(t)||document.querySelector('script[src="'+t+'"]'))i();else{Nh.push(t);const s=document.createElement("script");s.type="text/javascript",s.async=!0,s.defer=!0,s.micrioElement=this.engine.micrio,s.src=t.replace("$lang",e),s.onload=i,document.head.appendChild(s)}})}loadStyle(t){return new Promise(e=>{if(Nh.includes(t)||document.head.querySelector('link[href="'+t+'"]'))e();else{Nh.push(t);const i=document.createElement("link");i.setAttribute("type","text/css"),i.setAttribute("rel","stylesheet"),i.setAttribute("href",t),i.onload=e,document.head.appendChild(i)}})}async enrichData(e){if(!e)return e;"error"in e&&(this.__info.error="403"==e.status?"Could not load image data. Are you logged in and do you have the right credentials?":e.error);const i=this.engine.micrio.lang,s=[];e.markers?.forEach(t=>{if(kn(t,i,!this.isV5,yn(this.__info)),t.data?.micrioSplitLink){const e=t.data.micrioSplitLink.split(",").map(t=>t.trim()),i=t.data._micrioSplitLink={micrioId:e[0],markerId:e[1],follows:!!e[2]&&"false"!=e[2]};i.markerId&&s.push(i.micrioId)}}),e.markerTours?.length&&s.push(...e.markerTours.flatMap(t=>t.steps).map(t=>t.split(",")[1]).filter(t=>!!t&&t!=this.id));const r=t=>"autostart"in t&&t.autostart,n=e.markerTours?.find(r)||e.tours?.find(r);n&&(this.$settings.start={type:"steps"in n?"markerTour":"tour",id:n.id});const a=s.filter((t,e)=>s.indexOf(t)==e),o=t=>this.dataPath+(this.isV5?t+"/data/pub.json":t+"/data."+i+".json"),[h,c]=await Promise.all([Promise.all(a.map(t=>On(o(t)))),Promise.all(a.map(t=>Xn(t,this.infoBasePath)))]);h.forEach((t,e)=>{const s=yn(c[e]);t?.markers?.forEach(t=>kn(t,i,5==a[e].length,s))});const l=this.engine.micrio.spaceData;return e.markerTours&&(await Promise.all(e.markerTours.map(t=>Fn(this,t,i,e))),l&&(e.markerTours=e.markerTours.filter(t=>!t.steps.find(t=>t.includes(","))))),l?.markerTours&&await Promise.all(l.markerTours.filter(t=>!t.stepInfo).map(t=>Fn(this,t,i,e))),e.markers?.forEach(t=>{if(!t.data?._micrioSplitLink)return;const e=t.data?._micrioSplitLink?.markerId;if(e)for(let i=0;i<h.length;i++){const s=h[i]?.markers?.find(t=>t.id==e);if(s)return void(t.data._micrioSplitLink.view=s.view)}}),this.engine.micrio.events.dispatch("pre-data",{[this.id]:e,...Object.fromEntries(a.map((t,e)=>[t,h[e]]))}),h.forEach((e,i)=>{if(e){const r=this.engine.images.find(t=>t.id==a[i]);r&&r instanceof t&&!r.$data&&(s=o(r.id),!Cn.has(s)&&!Dn.has(s))&&r.data.set(e)}var s}),e}setupIIIFGalleryContainer(t,e){this.noImage=!0;const i=this.engine.micrio,s=i.canvas.getRatio();t.width=Math.max(1,i.offsetWidth*s),t.height=Math.max(1,i.offsetHeight*s),t.settings||(t.settings={}),t.settings.gallery||(t.settings.gallery={}),t.settings.view=[0,0,1,1],t.gallery=[];const r=t.settings.gallery.startId,n=r?e.findIndex(t=>t==r):-1;return n<0?0:n}parseIIIFSequenceV2(e,i=!1){const s=e.sequences?.[0];if(!s)return;const r=s.canvases.map(t=>t.images[0]).map(t=>t.resource);if(i&&r.length>10){const i=this.setupIIIFGalleryContainer(e,r.map(t=>t.service["@id"]));return void r.forEach((s,r)=>e.gallery.push(new t(this.engine,{id:s.service["@id"],width:s.width,height:s.height,isPng:"image/png"==s.format,settings:{}},{area:[r-i,0,r-i+1,1]})))}const n="top-to-bottom"==s.viewingDirection;this.noImage=!0,e.width=n?Math.max(...r.map(t=>t.width)):r.reduce((t,e)=>t+e.width,0),e.height=n?r.reduce((t,e)=>t+e.height,0):Math.max(...r.map(t=>t.height)),e.settings||(e.settings={});let a=0;r.forEach(i=>{const s=[(1-i.width/e.width)/2,(1-i.height/e.height)/2];this.embeds.push(new t(this.engine,{id:i.service["@id"],width:i.width,height:i.height,isPng:"image/png"==i.format,settings:{}},{area:n?[s[0],a/e.height,1-s[0],(a+i.height)/e.height]:[a/e.width,s[1],(a+i.width)/e.width,1-s[1]]})),a+=n?i.height:i.width})}parseIIIFSequenceV3(e){const i=e.items?.flatMap(t=>t.items?.[0]?.items?.[0]?.body).filter(t=>!!t?.service?.[0]?.id).filter(t=>!!t);if(!i?.length)return;const s=this.setupIIIFGalleryContainer(e,i.map(t=>t.service[0].id));i.forEach((i,r)=>e.gallery.push(new t(this.engine,{id:i.service[0].id,width:i.width,height:i.height,isPng:"image/png"==i.format,tileSize:e.tileSize,settings:{}},{area:[r-s,0,r-s+1,1]})))}addEmbed(e,i,s={}){const r=i.slice(0),n=new t(this.engine,e,{area:r,isEmbed:!0,useParentCamera:s.asImage});return n.camera||(n.camera=this.camera),this.embeds.push(n),void 0===s.opacity&&(s.opacity=1),gn(n.info).then(t=>{if(t){if("cover"==s.fit||"contain"==s.fit){const e=this.is360?2:1,i="cover"==s.fit,n=r[2]-r[0],a=r[3]-r[1],o=r[0]+n/2,h=r[1]+a/2,c=n/a*e,l=t.width/t.height;if(i&&l<c||!i&&l>=c){const t=n/l*e;r[1]=h-t/2,r[3]=h+t/2}else{const t=a*l/e;r[0]=o-t/2,r[2]=o+t/2}}this.engine.addEmbed(n,this,s),this.engine.render()}}),n}setEmbedMediaElement(t,e){e?this.embedElements.set(t,e):this.embedElements.delete(t)}getEmbedMediaElement(t){return this.embedElements.get(t)}splitStart(){const t=this.engine.micrio.canvas.viewport.portrait;this.opts.secondaryTo?.camera.setArea(t?[0,0,1,.5]:[0,0,.5,1],{noRender:!0}),this.camera.setArea(t?[0,.5,1,1]:[.5,0,1,1],{noRender:!0}),this.camera.setView(this.__info?.settings?.view??[0,0,1,1]),this.engine.render()}splitEnd(){const t=this.opts.area;if(!t)return;const e=t[2]-t[0],i=t[3]-t[1];if(Math.round(1e3*e)/1e3==0||Math.round(1e3*i)/1e3==0)return;const s=e>i;this.camera.setArea(s?[0,1,1,1]:[1,0,1,1],{noRender:!0}),this.opts.secondaryTo?.grid&&this.opts.secondaryTo.camera.aniDone||this.opts.secondaryTo?.camera.setArea([0,0,1,1],{noRender:!0}),this.engine.render()}fadeIn(t=!1){this.engine.fadeImage(this.ptr,1,t),this.engine.render()}fadeOut(t=!1){this.engine.fadeImage(this.ptr,0,t),this.engine.render()}},qh=class{constructor(t,e,i,s,r){this.engine=t,this.image=e,this.embed=i,this.paused=s,this.moved=r,this.ism3u=!1,this.hlsPlayer=void 0,this.usVid=void 0,this.vidRepeatTo=void 0,this.placeTo=void 0,this.autoplay=!0,this._vid=void 0,this.isMounted=!0,this.events={play:()=>this.setPlaying(!0),pause:()=>this.setPlaying(!1),playing:()=>{!this.image._video&&this._vid&&("requestVideoFrameCallback"in this._vid?this._vid.requestVideoFrameCallback(()=>{this._vid&&this.isMounted&&(this.image.video.set(this._vid),this.engine.render())}):this.image.video.set(this._vid))},canplayEvt:ln.iOS?"loadedmetadata":"canplay",canplay:()=>{this._vid&&this.isMounted&&(this.autoplay&&!this.paused?(this._vid.play().catch(t=>console.warn("WebGL Embed video play() failed on canplay:",t)),this.moved()):this.embed.hideWhenPaused||(this.setPlaying(!0),Si().then(()=>{this.setPlaying(!1),setTimeout(()=>this._vid?.remove(),50)})))}},this.ism3u=!!i.video?.streamId&&!i.video?.transparent,this._vid=e._video,this.autoplay=i.video?.autoplay??!0;let n=!0;this.usVid=this.image.visible.subscribe(t=>{clearTimeout(this.placeTo),this.placeTo=t?setTimeout(()=>{this.isMounted&&(this._vid?(this.hook(),this.autoplay&&!this.paused&&this._vid.play().catch(t=>console.warn("WebGL Embed video play() failed",t))):this.load())},n?0:100):setTimeout(()=>this._vid?.pause(),0),n=!1})}unmount(){this.isMounted=!1,clearTimeout(this.placeTo),clearTimeout(this.vidRepeatTo),this._vid?.pause(),this.unhook(),this.usVid?.()}setPlaying(t){this._vid&&(this.paused=!t,t?this._vid.dataset.playing="1":delete this._vid.dataset.playing,this.engine.setImageVideoPlaying(this.image.ptr,t),this.embed.hideWhenPaused&&this.engine.fadeImage(this.image.ptr,t?1:0),t&&this.engine.render())}load(){if(!this.embed.video||this._vid)return;const t=this.ism3u?`https://videodelivery.net/${this.embed.video.streamId}/manifest/video.m3u8`:this.embed.video.src;t?(this._vid=document.createElement("video"),this._vid.crossOrigin="anonymous",this._vid.playsInline=!0,this._vid.width=this.embed.width,this._vid.height=this.embed.height,this._vid.muted=this.embed.video.muted,this.hook(),this.ism3u&&("MediaSource"in window||"ManagedMediaSource"in window)?mn("https://r2.micr.io/hls-1.6.15.min.js",void 0,"Hls"in window?{}:void 0).then(()=>{this.hlsPlayer=new window.Hls({abrEwmaDefaultEstimate:1e7,abrEwmaDefaultEstimateMax:5e7}),this.hlsPlayer.loadSource(t),this._vid&&this.hlsPlayer.attachMedia(this._vid)}).catch(t=>console.error("[Micrio GL Embed] Failed to load HLS.js:",t)):this._vid.src=t):console.error("[Micrio GL Embed] No video source found for embed:",this.embed.id)}hook(){if(!this.embed.video||!this._vid)return;const t=this.embed.video.loopAfter;this.embed.video.loop&&t?(this._vid.loop=!1,this._vid.onended=()=>{this.setPlaying(!1),this.vidRepeatTo=setTimeout(()=>this._vid?.play().catch(t=>console.warn("WebGL Embed video loop play() failed:",t)),1e3*t)},this._vid.onplay=()=>this.setPlaying(!0)):(this._vid.loop=this.embed.video.loop,this._vid.onended=null,this._vid.onplay=null),this._vid.parentNode||this.autoplay||this.ism3u||(this._vid.setAttribute("style","opacity:0;position:absolute;top:0;left:0;transform-origin:left top;transform:scale(0.1);pointer-events:none;"),document.body.appendChild(this._vid)),this._vid.addEventListener("play",this.events.play),this._vid.addEventListener("pause",this.events.pause),this._vid.addEventListener("playing",this.events.playing,{once:!0}),this._vid.addEventListener(this.events.canplayEvt,this.events.canplay,{once:!0})}unhook(){this._vid&&(this._vid.removeEventListener("play",this.events.play),this._vid.removeEventListener("pause",this.events.pause),this._vid.removeEventListener("playing",this.events.playing),this._vid.removeEventListener(this.events.canplayEvt,this.events.canplay),this._vid.onended=null,this._vid.onplay=null)}},Wh=Bi('<img alt="Embed" data-scroll-through="" class="micrio-embed"/>'),Uh=Bi('<button data-scroll-through="" aria-label="embed-button" class="micrio-embed"></button>');function Hh(t,e){et(e,!0);const i=()=>xt(a,"$current",s),[s,r]=kt(),n=Q("micrio"),{current:a,engine:o,canvas:h,_lang:c}=n;let l=br(e,"embed",15);l().src?.startsWith("/r2")&&l(l().src="http://localhost:6100"+l().src,!0);const d=i(),u=d.$info;l().uuid||l(l().uuid=an(),!0);const m=l().uuid,g=d.is360,p=l().video?.autoplay??!0;let f=d.embeds.find(t=>t.uuid==m||t.$info?.title==m);const v=window.matchMedia("(dynamic-range: high)").matches||ln.OSX,y=l().area,b=l().src?.toLowerCase().endsWith(".svg"),x=!(!l().width||!l().height)&&l().width*l().height<Math.pow(1024,2),T=/iPhone OS 14_/i.test(navigator.userAgent),k="data-embeds-inside-gl",_=n.getAttribute(k),M=!(b||T||!v&&!n.hasAttribute(k)&&l().video||"false"==_||(!l().micrioId||x&&l().src)&&(!l().video||l().video.controls||l().video.transparent)),S=!l().clickAction&&!l().frameSrc&&!Li(()=>e.marker),E="href"==l().clickAction?l().clickTarget:void 0,I=E&&l().clickTargetBlank;let A=ne(ue(y[2])),L=ne(ue(y[3])),P=ne(y[0]+y[2]/2),$=ne(y[1]+y[3]/2),C=ne(ue(l().scale||1)),D=ne(ue(l().rotX??0)),z=ne(ue(l().rotY??0)),O=ne(ue(l().rotZ??0)),R=ne(ue(l().scaleX??1)),X=ne(ue(l().scaleY??1)),F=ne(""),V=ne(0);function Y(){const t=l().area;oe(A,t[2],!0),oe(L,t[3],!0),oe(P,t[0]+Ei(A)/2),oe($,t[1]+Ei(L)/2),oe(C,l().scale||1,!0),oe(D,l().rotX??0,!0),oe(z,l().rotY??0,!0),oe(O,l().rotZ??0,!0),oe(R,l().scaleX??1,!0),oe(X,l().scaleY??1,!0);const e=M&&l().micrioId&&l().width,i=e?10:1;let s=Ei(A)*u.width/(l().width??100)/(M?l().width?Ei(A):1:Ei(C))*(g?Math.PI/2:1);const r=[];e&&l().width&&(s=Ei(A)/(l().width/u.width)*i*(g?Math.PI/2:1),r.push(`width:${l().width/i}px`)),r.push(`--ratio:${Ei(A)/Ei(L)*u.width/u.height};--scale:${s}`),b&&oe(F,Ei(F)+`height:${l().height}px`),oe(F,r.join(";"),!0),l().video&&(l().video.width>l().video.height?oe(V,Math.min(l().video.width,Ei(A)*u.width,2048),!0):oe(V,Math.min(l().video.height,Ei(L)*u.height,2048)/(l().video.height/l().video.width)))}Y();const N=jt(()=>Math.round(Ei(A)*u.width)),B=jt(()=>Math.round(Ei(L)*u.height));let q,W=ne(!1),U=ne(0),H=ne(0),G=ne(""),j=ne(!1),Z=ne("");function J(){if(!d.engine.ready)return;const t=d.camera.getXYDirect(Ei(P),Ei($));if((t=>{var e=w(t,3);oe(U,e[0],!0),oe(H,e[1],!0),q=e[2]})(t),g&&(oe(G,d.camera.getMatrix(Ei(P),Ei($),Ei(C),1,Ei(D),Ei(z),Ei(O),void 0,Ei(R),Ei(X)).join(","),!0),oe(j,t[3]>2)),oe(Z,(g?`transform:matrix3d(${Ei(G)});`:`--x:${Ei(U)}px;--y:${Ei(H)}px;--s:${q};`)+(void 0!==l().opacity&&1!==l().opacity?`--opacity:${l().opacity};`:"")),(l().video?.pauseWhenSmallerThan||l().video?.pauseWhenLargerThan)&&Ei(N)){const t=Ei(W);oe(W,function(){if(!l().video?.pauseWhenSmallerThan&&!l().video?.pauseWhenLargerThan)return!p;const t=q?Math.max(Ei(N)*q/h.viewport.width,Ei(B)*q/h.viewport.height):0;return!!(l().video.pauseWhenSmallerThan&&t<l().video.pauseWhenSmallerThan||l().video.pauseWhenLargerThan&&t>l().video.pauseWhenLargerThan)}(),!0),Ei(nt)?._vid&&Ei(W)!=t&&(Ei(W)?Ei(nt)._vid.pause():(d?.$settings?.embedRestartWhenShown&&(Ei(nt)._vid.currentTime=0),Ei(nt)._vid.play()))}}function K(){const t="markerId"==l().clickAction?l().clickTarget:e.marker?.id;t&&i()&&!E&&i().state.marker.set(t)}function tt(t){if(t&&"detail"in t){const e=t.detail;for(const t in e)l(l()[t]=e[t],!0)}Y(),J()}const st=vt(!1);l().video&&(l().video.controls||l(l().video.muted=!0,!0));const rt=M&&!!l().video;let nt=ne(void 0);const at=!M||!!l().clickAction;let ot=ne(void 0);Re(()=>{l().video&&l().id&&i()&&i().setEmbedMediaElement(l().id,Ei(ot)??Ei(nt)?._vid)});const ht=jt(()=>l().video||M?Ei(V):Ei(N)),ct=jt(()=>l().video?Ei(V)/(l().video.width/l().video.height):Ei(B)),lt=jt(()=>Ei(N)/Ei(ht));ps(()=>{const t=[];return M&&function(){const t=l().hideWhenPaused?.01:l().opacity??1,e=[l().area[0],l().area[1],l().area[0]+l().area[2],l().area[1]+l().area[3]];f&&f.ptr>=0?(f.camera.setArea(e),f.camera.setRotation(l().rotX,l().rotY,l().rotZ),o.fadeImage(f.ptr,t)):f=d.addEmbed({id:l().video?l().id:l().micrioId,title:m,width:l().width,height:l().height,isPng:l().isPng,isWebP:l().isWebP,isDeepZoom:l().isDeepZoom,path:u.tileBasePath??u.path,isSingle:!!l().video,isVideo:!!l().video,settings:{_360:{rotX:Ei(D),rotY:Ei(z),rotZ:Ei(O)}}},e,{opacity:t,asImage:!1}),rt&&gn(f.visible,{targetValue:!0}).then(()=>{oe(nt,new qh(o,f,l(),Ei(W),J),!0)}),o.render()}(),(at||l().video?.pauseWhenSmallerThan||l().video?.pauseWhenLargerThan)&&t.push(d.state.view.subscribe(J)),()=>{for(Ei(nt)?.unmount(),f&&f.ptr>=0&&(o.fadeImage(f.ptr,0),o.render()),l().video&&l().id&&i()&&i().setEmbedMediaElement(l().id);t.length;)t.shift()?.()}});var dt=Hi(),ut=_e(dt),mt=t=>{var i=Hi();Os(_e(i),()=>E?"a":"div",!1,(t,i)=>{Rs(t,(t,e)=>{return s=e,(i=t).addEventListener("change",s),{destroy:()=>i.removeEventListener("change",s)};var i,s},()=>tt),hr(t,()=>({id:l().id?"e-"+l().id:void 0,style:Ei(Z),role:E?void 0:"figure",onclick:K,onkeypress:K,href:E,target:E&&I?"_blank":null,class:"",[js]:{"embed-container":!0,embed3d:g,"no-events":S,behind:g&&Ei(j)}}),void 0,void 0,void 0,"micrio-embed");var r=Hi(),n=_e(r),a=t=>{{let e=jt(()=>l().video.streamId&&!l().video.transparent?"cfvid://"+l().video.streamId:l().video.src),i=jt(()=>l().video.muted?0:1),s=jt(()=>!Ei(W)&&l().video.autoplay),r=jt(()=>l().video.transparent&&l().video.hasH265);fo(t,{get forcePause(){return Ei(W)},get src(){return Ei(e)},get width(){return Ei(ht)},get height(){return Ei(ct)},get frameScale(){return Ei(lt)},get controls(){return l().video.controls},get destroying(){return st},get loop(){return l().video.loop},get loopDelay(){return l().video.loopAfter},get volume(){return Ei(i)},get autoplay(){return Ei(s)},get hasTransparentH265(){return Ei(r)},get _media(){return Ei(ot)},set _media(t){oe(ot,t,!0)}})}},o=t=>{fo(t,{get src(){return l().frameSrc},get width(){return Ei(N)},get height(){return Ei(B)},get frameScale(){return l().scale},get autoplay(){return l().autoplayFrame},get destroying(){return st}})},h=t=>{var e=Wh();Ye(()=>{ar(e,"src",l().src),Us(e,Ei(F)),ar(e,"width",b?l().width:void 0),ar(e,"height",b?l().height:void 0)}),Gi(t,e)},d=t=>{var i=Uh();Ye(()=>{Us(i,Ei(F)),ar(i,"title",l().title||e.marker?.i18n?.[xt(c,"$_lang",s)]?.title)}),Gi(t,i)};vs(n,t=>{l().video&&!M?t(a):l().frameSrc?t(o,1):!M&&l().src?t(h,2):t(d,-1)}),Gi(i,r)}),Gi(t,i)};vs(ut,t=>{at&&(Ei(G)||Ei(U)||Ei(H))&&t(mt)}),Gi(t,dt),it(),r()}var Gh=Wi("<line></line>"),jh=Bi('<article class="micrio-markers"><label> </label></article>'),Zh=Bi('<article class="micrio-markers"><label> </label></article>'),Jh=Bi('<svg class="micrio-markers"></svg> <aside class="micrio-markers"><section class="micrio-markers"></section> <section class="micrio-markers"></section></aside>',1),Kh=Bi("<!> <!>",1),Qh=Bi("<div><!> <!></div>"),tc=Bi("<!> <!> <!> <!>",1);function ec(t,e){et(e,!0);const i=()=>xt(m,"$settings",h),s=()=>xt(M,"$inView",h),r=()=>xt(_,"$hoveredId",h),n=()=>xt(f,"$switching",h),a=()=>xt(d,"$data",h),o=()=>xt(v,"$_lang",h),[h,c]=kt();let l=br(e,"image",15);const{data:d,info:u,settings:m}=l(),g=l().state.marker,p=l().engine.micrio,{switching:f,_lang:v,state:w}=p,y=p.canvas.isMobile,b=p.canvases[0]?.grid,x=b?.focussed,T=b?.markersShown,k=i().clusterMarkerRadius??16,_=w.markerHoverId,M=vt([]);tt("inView",M);const S=i()._markers??{},E=i().omni,I=!(S.noTitles||E?.sideLabels||!S.showTitles&&5!=l().id.length);let A=!1;function L(t){t?"string"==typeof t||l().openedView||t.noMarker||!t.view||(l(l().openedView=p.state.$tour&&!("steps"in p.state.$tour)?void 0:sn(l().state.$view),!0),A=!!t.videoTour):l().openedView&&!p.state.$tour&&setTimeout(()=>{Ei(j)||l().camera.aniDone||!l().openedView||l().camera.flyToView((t=>{const e=Math.min(1,t[2]),i=Math.min(1,t[3]),s=e/2,r=i/2;return[Math.max(s,Math.min(1-s,t[0]+t[2]/2))-s,Math.max(r,Math.min(1-r,t[1]+t[3]/2))-r,e,i]})(l().openedView),{speed:i()._markers?.zoomOutAfterCloseSpeed}).catch(()=>{}),l(l().openedView=void 0,!0),A=!1},A?250:10)}let P=!1;w.tour.subscribe(t=>{t&&"steps"in t?(P=!0,t.keepLastStep&&l(l().openedView=void 0,!0)):(t||l().openedView||!P||l().camera.stop(),P=!1)});const $=[];let C=ne(""),D=ne(!1),z=ne(!1);const O=t=>(t=t?.map(t=>Math.round(100*t)/100))&&oe(C,[...$,t[0]?`left: ${t[0]}px`:null,t[1]?`top: ${t[1]}px`:null,`width: ${t[2]}px`,`height: ${t[3]}px`].filter(t=>!!t).join(";")+";");let R=ne(ue([])),X=k,F=ne(ue([]));const V=new Map,Y=()=>{const t=function(t,e,i,s){if(!t)return{overlapped:[],clusterMarkers:[]};const r=t,n=[],a=r.length,o=[];for(let h=0;h<a;h++)for(let t=h+1;t<a;t++){if(r[t].tags?.includes("no-cluster"))continue;const s=e.get(r[h].id),a=e.get(r[t].id);if(s&&a&&Bn(s,a,i)){o.push(h,t);const e=n.find(e=>e.findIndex(e=>e==h||e==t)>-1);e?e.push(h,t):n.push([h,t])}}return{overlapped:o,clusterMarkers:n.map(t=>t.filter((e,i)=>t.indexOf(e)===i)).map(t=>{let e,i,n,a,o,h;if(s){o=t.reduce((t,e)=>t+r[e].x,0)/t.length,h=t.reduce((t,e)=>t+r[e].y,0)/t.length;const s=.3;e=Math.max(0,o-s/2),n=Math.max(0,h-s/2),i=Math.min(1,o+s/2),a=Math.min(1,h+s/2)}else e=Math.min(...t.map(t=>r[t].view?r[t].view[0]:r[t].x)),i=Math.max(...t.map(t=>r[t].view?r[t].view[0]+r[t].view[2]:r[t].x)),n=Math.min(...t.map(t=>r[t].view?r[t].view[1]:r[t].y)),a=Math.max(...t.map(t=>r[t].view?r[t].view[1]+r[t].view[3]:r[t].y)),o=(e+i)/2,h=(n+a)/2;const c=s?t.reduce((t,e)=>t+(r[e].rotation??0),0)/t.length:void 0,l=s?t.reduce((t,e)=>t+(r[e].radius??1),0)/t.length:void 0;return{title:t.length+"",type:"cluster",view:[e,n,Math.max(.1,i-e),Math.max(.1,a-n)],x:o,y:h,rotation:c,radius:l,id:t.sort((t,e)=>t-e).join(","),data:{},popupType:"none",tags:[]}})}}(Ei(J),V,X,l().isOmni);oe(R,t.overlapped,!0),oe(F,t.clusterMarkers,!0)},N=[];ps(()=>{const t=[];return gn(u).then(e=>{if(!e)return;oe(D,!!e.is360);const s=i()._markers;if(!s)return;const r=parseFloat(e.version)>=4.2;s.markerIcon&&$.push(`--micrio-marker-icon: url("${s.markerIcon}")`),s.markerColor&&s.markerColor!=(r?"#ffffff":"#ffbb00")&&$.push("--micrio-marker-color: "+s.markerColor),s.markerSize&&s.markerSize!=(r?"16":"25")&&$.push("--micrio-marker-size: "+(X=Number(s.markerSize))+"px"),t.push(l().viewport.subscribe(O)),i().clusterMarkers&&(t.push(l().state.view.subscribe(Y)),t.push(l().data.subscribe(()=>Si().then(Y)))),!l().grid&&i()._markers?.zoomOutAfterClose&&t.push(l().state.marker.subscribe(L)),l().isOmni&&i().omni?.sideLabels&&!i()._markers?.noTitles&&t.push(y.subscribe(t=>{t&&Ei(z)?function(){for(;N.length;)N.shift()?.()}():t||Ei(z)||(N.push(l().state.view.subscribe(H)),N.push(_.subscribe(H)),N.push(g.subscribe(H))),oe(z,!t)}))}),()=>{for(;t.length;)t.shift()?.()}});const B=t=>!t.noMarker;let W=ne(void 0),U=ne(ue([]));function H(){Si().then(()=>{if(!Ei(W))return;const t=p.canvas,e=t.element.offsetWidth,i=[];s().forEach(([s,n,a])=>{const o=Ei(W).querySelector('label[for="'+s.id+'"]')?.getBoundingClientRect();o?.width&&o.width>0&&i.push([n*e,a,(n>=.5?o.left:o.right)-t.viewport.left,o.top+o.height/2-t.viewport.top,r()==s.id])}),oe(U,i,!0)})}const G=(t,e)=>t.i18n?t.i18n[e]?.title:t.title,j=jt(()=>b&&xt(x,"$focussed",h)!=l()&&T&&wt(T).indexOf(l())<0),Z=jt(()=>!n()&&p.spaceData?p.spaceData.links.filter(t=>t[0]==l().id||t[1]==l().id).map(t=>({targetId:t[0]==l().id?t[1]:t[0],settings:t[2]?.[l().id]})):void 0),J=jt(()=>Ei(j)?[]:a()?.markers?.filter(B)),K=jt(()=>Ei(j)?a()?.markers:a()?.markers?.filter(t=>!B(t))),Q=jt(()=>Ei(j)?[]:a()?.markers?.filter(t=>t.clickableArea)),st=jt(()=>!(!Ei(J)?.length&&!Ei(Z)?.length)),rt=jt(()=>[...s()].sort(([,,t],[,,e])=>t>e?1:t<e?-1:0));var nt=tc(),at=_e(nt),ot=t=>{var e=Jh(),i=_e(e);bs(i,21,()=>Ei(U),ws,(t,e)=>{var i=Gh();let s;Ye(()=>{ar(i,"x1",Ei(e)[0]),ar(i,"y1",Ei(e)[1]),ar(i,"x2",Ei(e)[2]),ar(i,"y2",Ei(e)[3]),s=qs(i,0,"micrio-markers",null,s,{hovered:Ei(e)[4]})}),Gi(t,i)}),q(i);var s=Me(i,2),n=ke(s);bs(n,21,()=>Ei(rt).filter(([,t])=>t<.5),t=>t[0].id,(t,e)=>{var i=jh(),s=ke(i);let n;var a=ke(s,!0);q(s),q(i),Ye(t=>{ar(s,"for",Ei(e)[0].id),n=qs(s,1,"micrio-markers",null,n,{hover:r()==Ei(e)[0].id}),ns(a,t)},[()=>G(Ei(e)[0],o())]),Oi("mouseenter",s,()=>_.set(Ei(e)[0].id)),Oi("mouseleave",s,()=>_.set(void 0)),Gi(t,i)}),q(n);var a=Me(n,2);bs(a,21,()=>Ei(rt).filter(([,t])=>t>=.5),t=>t[0].id,(t,e)=>{var i=Zh(),s=ke(i);let n;var a=ke(s,!0);q(s),q(i),Ye(t=>{ar(s,"for",Ei(e)[0].id),n=qs(s,1,"micrio-markers",null,n,{hover:r()==Ei(e)[0].id}),ns(a,t)},[()=>G(Ei(e)[0],o())]),Oi("mouseenter",s,()=>_.set(Ei(e)[0].id)),Oi("mouseleave",s,()=>_.set(void 0)),Gi(t,i)}),q(a),q(s),fr(s,t=>oe(W,t),()=>Ei(W)),Gi(t,e)};vs(at,t=>{Ei(z)&&Ei(rt).length&&!xt(g,"$currentMarker",h)&&t(ot)});var ht=Me(at,2),ct=t=>{var e=Hi();bs(_e(e),17,()=>Ei(Q),t=>t.id,(t,e)=>{var i=Hi(),s=_e(i),r=t=>{Hh(t,{get embed(){return Ei(e).clickableArea},get marker(){return Ei(e)}})};vs(s,t=>{Ei(e).clickableArea&&t(r)}),Gi(t,i)}),Gi(t,e)};vs(ht,t=>{Ei(Q)&&t(ct)});var lt=Me(ht,2),dt=t=>{var e=Qh();let i;var s=ke(e),r=t=>{var e=Hi();bs(_e(e),17,()=>Ei(Z),t=>t.targetId,(t,e)=>{Xh(t,yr({get image(){return l()}},()=>Ei(e)))}),Gi(t,e)};vs(s,t=>{Ei(Z)&&Ei(Z).length&&t(r)});var a=Me(s,2),o=t=>{var e=Kh(),i=_e(e);bs(i,19,()=>Ei(J),t=>t.id,(t,e,i)=>{{let s=jt(()=>Ei(R).includes(Ei(i)));Oh(t,{get marker(){return Ei(e)},get image(){return l()},get coords(){return V},get overlapped(){return Ei(s)}})}}),bs(Me(i,2),17,()=>Ei(F),t=>t.id,(t,e)=>{Oh(t,{get marker(){return Ei(e)},get image(){return l()}})}),Gi(t,e)};vs(a,t=>{Ei(J)&&t(o)}),q(e),Ye(()=>{Us(e,Ei(st)?Ei(C):null),i=qs(e,1,"micrio-markers",null,i,{"show-titles":I,is360:Ei(D),inactive:Ei(j)||Ei(D)&&n()})}),Gi(t,e)};vs(lt,t=>{Ei(st)&&t(dt)});var ut=Me(lt,2),mt=t=>{var e=Hi();bs(_e(e),17,()=>Ei(K),t=>t.id,(t,e)=>{Oh(t,{get marker(){return Ei(e)},get image(){return l()},forceHidden:!0})}),Gi(t,e)};vs(ut,t=>{Ei(K)&&t(mt)}),Gi(t,nt),it(),c()}var ic=Wi('<svg width="100" height="100" class="micrio-progress-circle"><circle fill="transparent" stroke="#e0e0e0" stroke-width="8px" class="micrio-progress-circle"></circle><circle fill="transparent" stroke="#00d4ee" stroke-width="8px" class="micrio-progress-circle"></circle></svg>');var sc=Bi("<!> <!> <!>",1),rc=Bi("<!> <!> <!>",1),nc=Bi("<!> <!>",1),ac=Bi("<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>",1);var oc=!self.createImageBitmap,hc=URL.createObjectURL(new Blob(["let controller = null, prevUri = null;\nself.addEventListener('message', e => {\n\t// Handle abort message\n\tif(e.data == 'abort') return controller && controller.abort();\n\t// Create new AbortController for this fetch\n\tcontroller = new AbortController();\n\t// Fetch the image blob\n\tfetch(e.data.src, { signal: controller.signal })\n\t\t.then(r => r.blob())"+(oc?"\n\t\t// Fallback for older Safari: create Object URL\n\t\t.then(blob => {\n\t\t\t// Revoke previous Object URL to free memory\n\t\t\tURL.revokeObjectURL(prevUri);\n\t\t\t// Post Object URL back\n\t\t\tself.postMessage({src: (prevUri = URL.createObjectURL(blob, {type: e.data.type}))})\n\t\t})":"\n\t\t// If createImageBitmap is supported, use it (preferred)\n\t\t.then(blob => self.createImageBitmap(blob))\n\t\t// Post ImageBitmap back, transferring ownership\n\t\t.then(data => self.postMessage({data:data, src:e.data.src}, [data]))")+"\n\t\t// Handle fetch errors (including abort)\n\t\t.catch(err => self.postMessage({error: e.data.src+': '+err.message, type: err.name}))\n})"],{type:"text/javascript"})),cc=Math.max(2,Math.min(6,(navigator.hardwareConcurrency||2)-1)),lc=[],dc=new Map,uc=new Map,mc=[],gc=new Map;for(let al=0;al<cc;al++){const t=new Worker(hc);t.onmessage=t=>fc(al,t.data.src,t.data.data,t.data.error,t.data.type),dc.set(al,t),oc&&uc.set(al,new Image)}var pc=t=>new Promise((e,i)=>{mc.push([t,e,i]),function(){if(!mc.length)return;let t=0;for(;t<cc&&lc.includes(t);t++);if(t>=cc)return;lc.push(t);const e=mc.shift();if(!e)return void lc.splice(lc.indexOf(t),1);gc.set(t,e);const i=dc.get(t);if(!i)return console.error(`[Micrio Texture] Worker ${t} not found!`),e[2]("Internal error: Worker not found"),void lc.splice(lc.indexOf(t),1);i.postMessage({src:e[0],type:"image/"+e[0].split(".").pop()})}()});function fc(t,e,i,s,r){const n=gc.get(t);if(null!=n)if(gc.delete(t),setTimeout(()=>{lc.splice(lc.indexOf(t),1)},50),s)n[2](s),"AbortError"!=r&&console.error(`[Micrio Texture] Error loading ${n[0]}: ${r} - ${s}`);else if(i)n[1](i);else if(e&&oc){const i=uc.get(t);if(!i)return void n[2]("Internal error: Image element fallback not found");i.onload=()=>{n[1](i)},i.onerror=()=>{n[2](`Failed to load image from Object URL: ${e}`)},i.src=e}else n[2](`Worker ${t} sent invalid message.`),console.error(`[Micrio Texture] Worker ${t} sent invalid message for ${n[0]}`);else console.warn(`[Micrio Texture] Received message from worker ${t} but no matching promise found.`)}function vc(){return lc.length}function wc(t){const e=[...gc.entries()].find(e=>e[1][0]==t);if(null==e)return;const i=dc.get(e[0]);i&&i.postMessage("abort")}var yc=class{constructor(t=0,e=0,i=0,s=0,r=0,n=0,a=0){this.x0=t,this.y0=e,this.x1=i,this.y1=s,this.layer=r,this.x=n,this.y=a}},bc=class{constructor(t,e=.5,i=.5,s=1,r=1,n=.5,a=.5,o=1,h=1){this.canvas=t,this.centerX=e,this.centerY=i,this.width=s,this.height=r,this.lCenterX=n,this.lCenterY=a,this.lWidth=o,this.lHeight=h,this.arr=new Float64Array(4),this.changed=!1,this.limitChanged=!1,this.toArray()}get x0(){let t=this.centerX;return this.canvas.is360&&(t=Gr(t)),this.canvas.is360?Gr(t-this.width/2):t-this.width/2}get y0(){return this.centerY-this.height/2}get x1(){let t=this.centerX;return this.canvas.is360&&(t=Gr(t)),this.canvas.is360?Gr(t+this.width/2):t+this.width/2}get y1(){return this.centerY+this.height/2}get lX0(){return this.lCenterX-this.lWidth/2}get lY0(){return this.lCenterY-this.lHeight/2}get lX1(){return this.lCenterX+this.lWidth/2}get lY1(){return this.lCenterY+this.lHeight/2}get yaw(){return(this.centerX-.5)*Br*2}get pitch(){return(this.centerY-.5)*Br}get aspect(){return this.width/this.height}get size(){return Math.sqrt(this.width*this.width+this.height*this.height)*(1/Math.sqrt(2))}set(t,e,i,s,r=!1){if(r){const t=Math.min(1,this.width)/Math.min(1,this.height);i/s>1.5*t&&i<this.width&&(s=i/t)}this.centerX=t,this.centerY=e,this.width=i,this.height=s,this.toArray(),this.changed=!0}setArea(t,e,i,s){this.centerX=(t+i)/2,this.centerY=(e+s)/2,this.width=i-t,this.height=s-e,this.toArray()}setLimit(t,e,i,s){this.lCenterX=t,this.lCenterY=e,this.lWidth=i,this.lHeight=s,this.changed=!0,this.limitChanged=!0}copy(t,e=!1){this.centerX=t.centerX,this.centerY=t.centerY,this.width=t.width,this.height=t.height,e||(this.lCenterX=t.lCenterX,this.lCenterY=t.lCenterY,this.lWidth=t.lWidth,this.lHeight=t.lHeight),this.changed=!0,this.toArray()}getPerspective(){const t=this.canvas,e=t.webgl;return e.maxPerspective-.5/(this.height*t.height/t.el.height)*Br/e.scaleY}getScale(){const t=this.canvas;return 1/Math.max(this.width*t.width/t.el.width,this.height*t.height/t.el.height)}getDistance(t,e){e&&this.canvas.currentArea.isFull()&&(t.correctAspectRatio(),this.correctAspectRatio());return(Math.abs(this.centerX-t.centerX)+Math.abs(this.centerY-t.centerY)+Math.abs(this.width-t.width)+Math.abs(this.height-t.height))/4}limit(t,e=!1,i=!1){const s=this.canvas,r=s.camera.minSize,n=this.getScale();if(r<1&&n<s.camera.minScale&&!e){const t=1/r,e=Math.min(t,this.width),i=Math.min(t,this.height);return this.centerX=.5,this.centerY=.5,this.width=e,this.height=i,void this.toArray()}const a=t?Math.max(1,n/Math.max(s.camera.minScale,s.maxScale/s.el.scale)):1,o=this.lWidth,h=this.lHeight,c=Math.min(o,this.width*a),l=Math.min(h,this.height*a);if(t&&(a>1||e&&n<s.camera.minScale)&&(this.width=c,this.height=l),(o<1||h<1)&&(this.width=Math.min(this.width,o),this.height=Math.min(this.height,h)),e)return void this.toArray();const d=Math.min(1,this.width)/2,u=this.lWidth/2;this.canvas.is360?this.centerX=Gr(this.centerX):i||(this.centerX=Math.max(this.lCenterX-u+d,Math.min(this.centerX,this.lCenterX+u-d)));const m=Math.min(1,this.height)/2,g=this.lHeight/2;i||(this.centerY=Math.max(this.lCenterY-g+m,Math.min(this.centerY,this.lCenterY+g-m))),this.toArray()}correctAspectRatio(){const t=this.canvas;if(t.is360)return;const e=t.camera.cpw/t.camera.cph;this.width/this.height>e?this.height=this.width/e:this.width=this.height*e,this.toArray()}toArray(){return this.arr[0]=this.centerX,this.arr[1]=this.centerY,this.arr[2]=this.width,this.arr[3]=this.height,this.arr}equals(t,e,i,s){return this.centerX===t&&this.centerY===e&&this.width===i&&this.height===s}isFull(){return 1===this.width&&1===this.height&&.5===this.centerX&&.5===this.centerY}},xc=class{constructor(t=.5,e=.5,i=1,s=0,r=0){this.x=t,this.y=e,this.scale=i,this.w=s,this.direction=r,this.arr=new Float64Array(5)}inView(t){return this.w<-1||this.w<3&&!(this.x<0||this.x>t.width||this.y<0||this.y>t.height)}toArray(){return this.arr[0]=this.x,this.arr[1]=this.y,this.arr[2]=this.scale,this.arr[3]=this.w,this.arr[4]=this.direction,this.arr}},Tc=class{constructor(t=0,e=0,i=0,s=0,r=0,n=0,a=1,o=1,h=!1){this.width=t,this.height=e,this.left=i,this.top=s,this.areaWidth=r,this.areaHeight=n,this.ratio=a,this.scale=o,this.isPortrait=h,this.arr=new Int32Array(4)}get centerX(){return this.left+this.width/2}get centerY(){return this.top+this.height/2}get aspect(){return 0===this.width||0===this.height?1:this.width/this.height}toArray(){return this.arr[0]=this.width,this.arr[1]=this.height,this.arr[2]=this.left,this.arr[3]=this.top,this.arr}set(t,e,i,s,r,n,a){return(this.width!==t*r||this.height!==e*r||this.left!==i||this.top!==s||this.ratio!==r||this.scale!==n||this.isPortrait!==a)&&(this.width=t*r,this.height=e*r,this.left=i*r,this.top=s*r,this.ratio=r,this.scale=n,this.isPortrait=a,!0)}copy(t){this.width=t.width,this.height=t.height,this.left=t.left,this.top=t.top,this.ratio=t.ratio,this.scale=t.scale,this.isPortrait=t.isPortrait}},kc=class{constructor(t){this.canvas=t,this.dX=0,this.dY=0,this.startTime=0,this.prevTime=0,this.endTime=0,this.lastInteraction=0,this.velocityX=0,this.velocityY=0,this.started=!1}addStep(t,e,i){if(this.endTime)return;0===this.startTime&&(this.startTime=i);const s=this.prevTime>0?16.67/(i-this.prevTime):1;Math.sqrt(t*t+e*e)*s>20&&(this.lastInteraction=i);const r=this.canvas.main.dragElasticity;this.dX+=t*r,this.dY+=e*r,this.prevTime=i}start(){this.canvas.camera.isUnderZoom()||(this.started=!0)}stop(){this.started=!1,this.endTime=0,this.startTime=0,this.prevTime=0,this.lastInteraction=0,this.dX=0,this.dY=0,this.velocityX=0,this.velocityY=0}step(t){const e=this.canvas.webgl,i=this.canvas.camera;if(!this.started||0===this.startTime)return 1;if(0===this.endTime){this.endTime=t;const e=1-Math.min(1,(this.endTime-this.lastInteraction)/250),i=this.endTime-this.startTime;this.velocityX=this.dX/(i/4)*e,this.velocityY=this.dY/(i/4)*e}else this.velocityX*=.94,this.velocityY*=.94;let s=Math.sqrt(this.velocityX*this.velocityX+this.velocityY*this.velocityY);return this.canvas.is360?e.rotate(this.velocityX,this.velocityY,0,t):i.pan(this.velocityX,this.velocityY,0,!1,t,!1,!0),s<=.01&&(s=0,this.stop()),1-s}},_c=class{constructor(t){this.canvas=t,this.isView=!1,this.isZoom=!1,this.isJump=!1,this.zFrom=0,this.zTo=0,this.zNoLimit=!1,this.fn=Kr,this.started=0,this.duration=0,this.isRunning=!1,this.limit=!0,this.zoomingOut=!1,this.flying=!1,this.correcting=!1,this.pausedAt=0,this.fL=0,this.fT=0,this.fR=0,this.fB=0,this.mI=0,this.mO=0,this.omniStartIdx=-1,this.omniDelta=0,this.vFrom=new bc(t),this.vTo=new bc(t),this.lastView=new bc(t)}pause(t){this.pausedAt>0||(this.isRunning=!1,this.pausedAt=t)}resume(t){0!==this.pausedAt&&0!==this.started&&(this.started+=t-this.pausedAt,this.pausedAt=0,this.isRunning=!0)}stop(){this.isRunning&&this.canvas.aniAbort(),this.started=0,this.limit=!0,this.flying=!1,this.isRunning=!1,this.isView=!1,this.isZoom=!1,this.correcting=!1,this.pausedAt=0}isStarted(){return this.isRunning&&this.isView}toView(t,e,i,s,r,n,a,o,h,c,l,d,u=!1){if(u&&this.correcting)return this.updateTarget(t,e,i,s,!0),r;this.lastView.set(t,e,i,s),this.vTo.set(t,e,i,s);const m=this.canvas,g=m.view,p=this.vTo,f=this.vFrom;this.isJump=o,this.fn=3===l?en:2===l?tn:1===l?Qr:Kr;const v=m.main.el;if(0!==v.areaHeight){const t=s/(1-v.areaHeight/v.height);t>0?s+=t:s-=t,v.areaHeight=0}if(0!==v.areaWidth){const t=i*(v.areaWidth/v.width);t>0?i+=t:i-=t,v.areaWidth=0}const w=g.centerX,y=g.centerY,b=g.width,x=g.height;f.set(w,y,b,x),m.is360&&(t=w+Zr(w,t),p.set(t,e,i,s)),h&&(p.correctAspectRatio(),p.limit(!1)),this.fL=0,this.fR=0,this.fT=0,this.fB=0;let T=1;if(this.isJump){if(!m.is360){const t=p.centerX,e=p.centerY;if(p.aspect>f.aspect){const i=p.width/f.aspect;p.set(t,e,p.width,i)}else{const i=p.height*f.aspect;p.set(t,e,i,p.height)}}const r=f.centerX-f.width/2,n=f.centerX+f.width/2,a=f.centerY-f.height/2,o=f.centerY+f.height/2,h=p.centerX-p.width/2,c=p.centerX+p.width/2,l=p.centerY-p.height/2,d=p.centerY+p.height/2,u=h<r,g=l<a,v=c>n,w=d>o;!(u||g||v||w)||u&&g&&v&&w?p.set(t,e,i,s):(this.fL=u?1:h>r?2:0,this.fR=v?1:c<n?2:0,this.fT=g?1:l>a?2:0,this.fB=w?1:d<o?2:0,T=1.5)}u&&p.limit(!0,!h);const k=Math.max(1e4,Math.min(15e3,Math.sqrt(m.width*m.width+m.height*m.height)/2));let _=Math.abs(w-t);m.is360&&(_=Math.min(_,1-_));const M=i<b&&s<x?.125:.25,S=(_+Math.abs(y-e)+Math.abs(b-i)*M+Math.abs(x-s)*M)/3;this.mI=Math.max(.5,.8-S*(m.is360?1:2)),this.mO=Math.max(.05,Math.min(.9,S-(m.is360?.2:.1))),this.duration=r<0?S*k/m.camSpeed*T/(n<=0?1:n):r;const E=this.canvas.images.length/this.canvas.omniNumLayers;return this.omniStartIdx=this.canvas.activeImageIdx,this.omniDelta=0,!isNaN(c)&&c>0&&c!==this.omniStartIdx&&(this.omniDelta=c-this.omniStartIdx,this.omniDelta<-E/2&&(this.omniDelta+=E),this.omniDelta>E/2&&(this.omniDelta-=E),this.duration+=Math.abs(this.omniDelta)/this.canvas.images.length*6e3),0===this.duration?(m.setView(p.centerX,p.centerY,p.width,p.height,!1,!0),this.canvas.aniDone(),this.stop(),this.duration):(this.stop(),this.isView=!0,this.limit=!1,this.flying=!0,this.isZoom=!1,u&&(this.correcting=!0),this.started=d-a*this.duration,this.isRunning=!0,this.duration*(1-a))}updateTarget(t,e,i,s,r=!1){this.vTo.set(t,e,i,s),r&&this.vTo.limit(!0)}zoom(t,e,i,s,r){this.stop(),this.isView=!1,this.flying=!1,this.isZoom=!0,this.zNoLimit=s;const n=this.canvas,a=n.webgl;return this.zFrom=a.perspective,this.zTo=this.zFrom+t/(a.scale*Math.sqrt(n.width*n.width+n.height*n.height)/20),s||(this.zTo=Math.min(a.maxPerspective,Math.max(a.minPerspective,this.zTo))),this.started=r,this.isRunning=!0,this.duration=e>=0?e:1e3*Math.abs(this.zFrom-this.zTo)/i,e}setStartView(t,e,i,s,r){this.vFrom.set(t,e,i,s,r),this.vTo.set(t,e,i,s,r)}step(t){const e=0===this.started?1:Math.min(1,Math.max(0,(t-this.started)/this.duration)),i=this.fn.get(e),s=this.canvas.getScale();if(this.isRunning){if(this.isView){const t=this.vFrom,s=this.vTo,r=this.mO,n=this.fn.get(Math.min(1,e/this.mI)),a=this.fn.get(Math.max(0,(e-r)/(1-r)));let o=0,h=t.centerX+(s.centerX-t.centerX)*((o=this.fL||this.fR)?1===o?n:a:i),c=t.centerY+(s.centerY-t.centerY)*((o=this.fT||this.fB)?1===o?n:a:i);const l=t.width+(s.width-t.width)*i,d=t.height+(s.height-t.height)*i;if(this.canvas.is360){const e=Zr(t.centerX,s.centerX);h=t.centerX+e*i}if(this.canvas.setView(h,c,l,d,!1,!0),this.omniDelta){let t=this.omniStartIdx+Math.trunc(this.omniDelta*this.fn.get(Math.min(1,1.5*e)));const i=this.canvas.images.length/this.canvas.omniNumLayers;t<0&&(t+=i),t>=i&&(t-=i),this.canvas.setActiveImage(t,0)}}this.isZoom&&this.canvas.webgl.setPerspective(this.zFrom*(1-i)+this.zTo*i,this.zNoLimit),e>=1&&(this.lastView.copy(this.canvas.view),this.canvas.aniDone(),this.stop())}return this.zoomingOut=this.isRunning&&this.canvas.getScale()<s,e}},Mc=class{constructor(t){this.canvas=t,this.scale=1,this.minScale=1,this.minSize=1,this.maxScale=1,this.fullScale=1,this.coverScale=1,this.xy=new xc,this.coo=new xc,this.startCoo=new xc,this.pinching=!1,this.inited=!1,this.hasStartCoo=!1,this.cpw=-1,this.cph=-1,this.wasCoverLimit=!0,this.prevSize=-1,this.prevCenterX=-1,this.prevCenterY=-1,t.is360&&(this.inited=!0)}getCoo(t,e,i,s){const r=this.canvas;(r.noImage||r.freeMove)&&(s=!0);const n=r.el,a=r.hasParent?r.parent.el.ratio:n.ratio;i&&(t-=n.left,e-=n.top);const o=t/this.scale*a/r.width+r.view.x0,h=e/this.scale*a/r.height+r.view.y0;return this.coo.x=s?o:Math.max(r.view.lX0,Math.min(r.view.lX1,o)),this.coo.y=s?h:Math.max(r.view.lY0,Math.min(r.view.lY1,h)),this.coo.scale=this.scale,this.coo.toArray(),this.coo}getXY(t,e,i){const s=this.canvas,r=s.el,n=s.hasParent?s.parent.el.ratio:r.ratio;return this.xy.x=(t-s.view.x0)*s.width*this.scale/n+(i?r.left:0),this.xy.y=(e-s.view.y0)*s.height*this.scale/n+(i?r.top:0),this.xy.scale=this.scale/n,this.xy.toArray(),this.xy}getXYOmni(t,e,i,s,r){return this.getXYOmniCoo(t-.5,e-.5,i,s,r)}getXYOmniCoo(t,e,i,s,r){const n=this.canvas,a=n.el,o=n.webgl.pMatrix,h=n.webgl.vec4,c=n.hasParent?n.parent.el.ratio:a.ratio;h.x=t,h.y=e,h.z=i,h.w=1,o.identity(),!r&&n.omniFieldOfView&&o.perspective(n.omniFieldOfView,n.aspect,1e-4,100),n.omniDistance&&o.translate(0,0,n.omniDistance),n.omniOffsetX&&o.translate(n.omniOffsetX,0,0),!r&&n.omniVerticalAngle&&o.rotateX(n.omniVerticalAngle);const l=n.images.length/n.omniNumLayers,d=n.layer*l,u=n.images.length>0?-(n.activeImageIdx+1-d)/l*2*Br:0;return o.rotateY(s+u),h.transformMat4(o),this.xy.x=(.5+h.x-n.view.x0)*n.width*this.scale/c+(r?a.left:0),this.xy.y=(.5+h.y-n.view.y0)*n.height*this.scale/c+(r?a.top:0),this.xy.w=-h.w-n.omniDistance,this.xy.toArray(),this.xy}setCanvas(){const t=this.canvas,e=t.el,i=e.width/t.width,s=e.height/t.height;if(!t.view.limitChanged&&this.cpw===i&&this.cph===s)return void(t.coverLimit!==this.wasCoverLimit&&this.correctMinMax());this.cpw=i,this.cph=s,this.fullScale=Math.min(i,s),this.coverScale=Math.max(i,s);const r=t.view.lWidth/t.view.lHeight;if(t.view.limitChanged=!1,t.view.lWidth<1||t.view.lHeight<1){const e=i/s;this.coverScale/=r<e?t.view.lWidth/e:t.view.lHeight*e}if(this.correctMinMax(),e.width&&e.height&&!this.canvas.ani.isStarted()&&(t.view.copy(t.ani.lastView,!0),!t.is360)){const e=t.ani.limit;t.ani.limit=!1,this.setView(),t.ani.limit=e}}correctMinMax(t=!1){const e=this.canvas;if(this.minScale=e.coverLimit?this.coverScale:this.fullScale,!t&&!e.main.isSwipe&&(0===e.activeImageIdx&&!e.coverLimit||e.activeImageIdx>0)){const t=e.focus.width*e.width,i=e.focus.height*e.height,s=e.el.width,r=e.el.height;this.minScale=s/r>t/i?r/i:s/t}this.maxScale=this.minScale>1&&e.maxScale<this.minScale?this.minScale:Math.max(this.minScale,e.maxScale*e.scaleMultiplier/e.el.scale),this.wasCoverLimit=e.coverLimit}isUnderZoom(){return this.minSize<1&&this.scale<this.minScale}isZoomedOut(t=!1){return Math.trunc(1e6*(this.scale-this.minScale*(t?this.minSize:1)))/1e6<=0}isZoomedIn(){return this.scale/this.maxScale>=1}setView(){if(-1===this.cpw)return!1;const t=this.canvas,e=this.canvas.view,i=!t.freeMove&&t.ani.limit;!t.ani.correcting&&(i||!t.ani.flying&&t.coverLimit)&&e.limit(!1);const s=e.width,r=e.height,n=this.cpw,a=this.cph;this.scale=Math.min(n/s,a/r),i&&!this.pinching&&this.isZoomedIn()&&t.ani.flying&&(this.scale=this.maxScale),(!t.ani.correcting&&!this.pinching||t.coverLimit)&&(this.scale=Math.max(this.minScale*this.minSize,this.scale)),!this.inited&&t.coverStart&&(this.scale=this.coverScale);const o=n/this.scale-s,h=a/this.scale-r;return e.set(e.centerX,e.centerY,e.width+o,e.height+h),!this.inited&&t.coverStart&&this.canvas.ani.lastView.copy(e),!t.ani.correcting&&t.coverLimit&&e.limit(!1),this.inited=this.cpw>0,e.toArray(),!this.hasStartCoo||(this.hasStartCoo=!1,this.setCoo(this.startCoo.x,this.startCoo.y,this.startCoo.scale,0,0,!1,0,0),!1)}isOutsideLimit(){const t=this.canvas.view;return!this.canvas.freeMove&&(Math.trunc(1e6*(t.x0-t.lX0))/1e6<0!=Math.trunc(1e6*(t.x1-t.lX1))/1e6>0||Math.trunc(1e6*(t.y0-t.lY0))/1e6<0!=Math.trunc(1e6*(t.y1-t.lY1))/1e6>0||Math.trunc(1e6*(this.scale-this.maxScale))/1e6>0)}pan(t,e,i,s,r,n=!1,a=!1){const o=this.canvas;if(o.is360)return void o.webgl.rotate(t,e,i,r);if((this.isUnderZoom()||this.pinching)&&!n)return;this.canvas.freeMove&&(s=!0);const h=o.hasParent?o.parent.el.ratio:o.el.ratio,c=o.view,l=t/o.width/this.scale*h,d=e/o.height/this.scale*h,u=c.centerX+l,m=c.centerY+d,g=c.width,p=c.height;this.pinching?(o.view.set(u,m,g,p),o.setView(u,m,g,p,s,!1,!1,!1)):n||!this.isOutsideLimit()||a?(o.ani.stop(),0===i?(a||o.kinetic.addStep(4*t,4*e,r),o.view.set(u,m,g,p),s||o.view.limit(!1,!1,o.freeMove),o.setView(u,m,g,p,s,!1,!1,a),o.view.changed=!0):o.ani.toView(u,m,g,p,i,0,0,!1,!1,-1,0,r)):o.ani.toView(u,m,g,p,i||150,0,0,!1,!1,-1,0,r,!s)}zoom(t,e,i,s,r,n){const a=this.canvas;if(a.is360)return a.webgl.zoom(t,s,0,r,n,e,i);if(!this.pinching&&this.isZoomedIn()&&t<0)return 0;if(this.canvas.freeMove&&(r=!0),t>0&&this.isZoomedOut()&&this.minSize>=1&&(!this.pinching||a.coverLimit))return 0;const o=a.el,h=a.view,c=this.cpw/this.cph;let l=t*(o.width/512)/a.width/this.scale,d=l/c;t<0&&l<-1&&(l=-.9999),t<0&&d<-1&&(d=-.9999);const u=!r&&!a.freeMove&&a.ani.limit&&0===s,m=a.hasParent?a.parent.el.ratio:o.ratio;e-=o.left,i-=o.top;const g=this.isUnderZoom(),p=e>0&&!g?e/o.width*m:.5,f=i>0&&!g?i/o.height*m:.5,v=h.centerX+l*(.5-p),w=h.centerY+d*(.5-f),y=h.width+l,b=h.height+d;return a.ani.limit=u,s=a.ani.toView(v,w,y,b,s,0,0,!1,!r&&!this.pinching,-1,0,n,u),a.ani.lastView.copy(a.view),a.ani.limit=!r,s}pinch(t,e,i,s){const r=this.canvas,n=r.main.el,a=(Math.min(t,i)-n.left)/n.scale,o=(Math.min(e,s)-n.top)/n.scale,h=(Math.max(t,i)-n.left)/n.scale,c=(Math.max(e,s)-n.top)/n.scale,l=a+(h-a)/2,d=o+(c-o)/2,u=Math.max(h-a,c-o),m=this.prevSize-u;if(r.kinetic.stop(),this.prevCenterX>0){const t=this.prevCenterX-l,e=this.prevCenterY-d;r.is360?(r.webgl.zoom(2*m,0,0,!1,1),r.webgl.rotate(t,e,0,0)):(!this.canvas.main.noPinchPan&&this.scale>this.minScale&&this.pan(t,e,0,!1,0,!0),this.zoom(2*m*n.scale,l,d,0,!this.canvas.pinchZoomOutLimit,0),r.ani.limit=!!this.canvas.pinchZoomOutLimit)}else r.ani.stop();this.prevCenterX=l,this.prevCenterY=d,this.prevSize=u}pinchStart(){this.pinching=!0}pinchStop(t){this.canvas.is360||this.snapToBounds(t),this.prevSize=-1,this.prevCenterX=-1,this.prevCenterY=-1,this.pinching=!1}snapToBounds(t){if(this.canvas.freeMove)return;const e=this.canvas.view,i=this.scale>this.maxScale,s=i?this.cpw/this.maxScale:e.width,r=i?this.cph/this.maxScale:e.height,n=s/2,a=r/2,o=e.lWidth/2,h=e.lHeight/2,c=n>=o?e.lCenterX:Math.max(e.lX0+n,Math.min(e.centerX,e.lX1-n)),l=a>=h?e.lCenterY:Math.max(e.lY0+a,Math.min(e.centerY,e.lY1-a));this.canvas.ani.toView(c,l,s,r,150,0,0,!1,!1,-1,0,t,!0)}flyTo(t,e,i,s,r,n,a,o,h,c,l,d,u){const m=this.canvas,g=m.ani;m.kinetic.stop();let p=t;if(m.is360){const e=m.view.centerX;p=e+Zr(e,t)}return g.limit=!1,r=g.toView(p,e,i,s,r,n,a,o,h,l,d,u,c),g.limit=!1,g.flying=!0,r}setCoo(t,e,i,s,r,n,a,o){if(!this.inited)return this.hasStartCoo=!0,this.startCoo.x=t,this.startCoo.y=e,this.startCoo.scale=i,this.setView(),0;const h=this.canvas,c=h.is360;(0===i||!c&&isNaN(i))&&(i=h.getScale()),c||(i=Math.max(this.minScale,i)),h.kinetic.stop();const l=isNaN(i)&&c?h.view.width:1/i*this.cpw,d=isNaN(i)&&c?h.view.height:1/i*this.cph;return 0!==s||c||(t+l/2>1&&(t=1-l/2),t-l/2<0&&(t=l/2),e+d/2>1&&(e=1-d/2),e-d/2<0&&(e=d/2)),s=h.ani.toView(t,e,l,d,s,r,0,!1,!1,-1,a,o),h.ani.limit=0===s||n,h.ani.flying=s>0,s}},Sc=class{constructor(t=1,e=0,i=0,s=0,r=0,n=1,a=0,o=0,h=0,c=0,l=1,d=0,u=0,m=0,g=0,p=1){this.a0=t,this.a1=e,this.a2=i,this.a3=s,this.a4=r,this.a5=n,this.a6=a,this.a7=o,this.a8=h,this.a9=c,this.a10=l,this.a11=d,this.a12=u,this.a13=m,this.a14=g,this.a15=p,this.arr=new Float32Array(16)}toArray(){return this.arr[0]=this.a0,this.arr[1]=this.a1,this.arr[2]=this.a2,this.arr[3]=this.a3,this.arr[4]=this.a4,this.arr[5]=this.a5,this.arr[6]=this.a6,this.arr[7]=this.a7,this.arr[8]=this.a8,this.arr[9]=this.a9,this.arr[10]=this.a10,this.arr[11]=this.a11,this.arr[12]=this.a12,this.arr[13]=this.a13,this.arr[14]=this.a14,this.arr[15]=this.a15,this.arr}identity(){this.a0=1,this.a1=0,this.a2=0,this.a3=0,this.a4=0,this.a5=1,this.a6=0,this.a7=0,this.a8=0,this.a9=0,this.a10=1,this.a11=0,this.a12=0,this.a13=0,this.a14=0,this.a15=1}copy(t){this.a0=t.a0,this.a1=t.a1,this.a2=t.a2,this.a3=t.a3,this.a4=t.a4,this.a5=t.a5,this.a6=t.a6,this.a7=t.a7,this.a8=t.a8,this.a9=t.a9,this.a10=t.a10,this.a11=t.a11,this.a12=t.a12,this.a13=t.a13,this.a14=t.a14,this.a15=t.a15}rotateX(t){const e=Math.sin(t),i=Math.cos(t),s=this.a4,r=this.a5,n=this.a6,a=this.a7,o=this.a8,h=this.a9,c=this.a10,l=this.a11;this.a4=s*i+o*e,this.a5=r*i+h*e,this.a6=n*i+c*e,this.a7=a*i+l*e,this.a8=o*i-s*e,this.a9=h*i-r*e,this.a10=c*i-n*e,this.a11=l*i-a*e}rotateY(t){const e=Math.sin(t),i=Math.cos(t),s=this.a0,r=this.a1,n=this.a2,a=this.a3,o=this.a8,h=this.a9,c=this.a10,l=this.a11;this.a0=s*i-o*e,this.a1=r*i-h*e,this.a2=n*i-c*e,this.a3=a*i-l*e,this.a8=s*e+o*i,this.a9=r*e+h*i,this.a10=n*e+c*i,this.a11=a*e+l*i}rotateZ(t){const e=Math.sin(t),i=Math.cos(t),s=this.a0,r=this.a1,n=this.a2,a=this.a3,o=this.a4,h=this.a5,c=this.a6,l=this.a7;this.a0=s*i+o*e,this.a1=r*i+h*e,this.a2=n*i+c*e,this.a3=a*i+l*e,this.a4=o*i-s*e,this.a5=h*i-r*e,this.a6=c*i-n*e,this.a7=l*i-a*e}scaleFlat(t){this.a0*=t,this.a1*=t,this.a2*=t,this.a3*=t,this.a4*=t,this.a5*=t,this.a6*=t,this.a7*=t}translate(t,e,i){this.a12+=this.a0*t+this.a4*e+this.a8*i,this.a13+=this.a1*t+this.a5*e+this.a9*i,this.a14+=this.a2*t+this.a6*e+this.a10*i,this.a15+=this.a3*t+this.a7*e+this.a11*i}perspective(t,e,i,s){this.identity();const r=1/Math.tan(t/2),n=1/(i-s);this.a0=r/e,this.a5=r,this.a10=(s+i)*n,this.a11=-1,this.a14=2*s*i*n,this.a15=0}perspectiveCss(t){this.identity();const e=1/Math.tan(t/2);this.a0=e,this.a5=e}invert(){const t=this.a0,e=this.a1,i=this.a2,s=this.a3,r=this.a4,n=this.a5,a=this.a6,o=this.a7,h=this.a8,c=this.a9,l=this.a10,d=this.a11,u=this.a12,m=this.a13,g=this.a14,p=this.a15,f=t*n-e*r,v=t*a-i*r,w=t*o-s*r,y=e*a-i*n,b=e*o-s*n,x=i*o-s*a,T=h*m-c*u,k=h*g-l*u,_=h*p-d*u,M=c*g-l*m,S=c*p-d*m,E=l*p-d*g;let I=f*E-v*S+w*M+y*_-b*k+x*T;I&&(I=1/I,this.a0=(n*E-a*S+o*M)*I,this.a1=(i*S-e*E-s*M)*I,this.a2=(m*x-g*b+p*y)*I,this.a3=(l*b-c*x-d*y)*I,this.a4=(a*_-r*E-o*k)*I,this.a5=(t*E-i*_+s*k)*I,this.a6=(g*w-u*x-p*v)*I,this.a7=(h*x-l*w+d*v)*I,this.a8=(r*S-n*_+o*T)*I,this.a9=(e*_-t*S-s*T)*I,this.a10=(u*b-m*w+p*f)*I,this.a11=(c*w-h*b-d*f)*I,this.a12=(n*k-r*M-a*T)*I,this.a13=(t*M-e*k+i*T)*I,this.a14=(m*v-u*y-g*f)*I,this.a15=(h*y-c*v+l*f)*I)}multiply(t){let e=this.a0,i=this.a1,s=this.a2,r=this.a3;this.a0=e*t.a0+i*t.a4+s*t.a8+r*t.a12,this.a1=e*t.a1+i*t.a5+s*t.a9+r*t.a13,this.a2=e*t.a2+i*t.a6+s*t.a10+r*t.a14,this.a3=e*t.a3+i*t.a7+s*t.a11+r*t.a15,e=this.a4,i=this.a5,s=this.a6,r=this.a7,this.a4=e*t.a0+i*t.a4+s*t.a8+r*t.a12,this.a5=e*t.a1+i*t.a5+s*t.a9+r*t.a13,this.a6=e*t.a2+i*t.a6+s*t.a10+r*t.a14,this.a7=e*t.a3+i*t.a7+s*t.a11+r*t.a15,e=this.a8,i=this.a9,s=this.a10,r=this.a11,this.a8=e*t.a0+i*t.a4+s*t.a8+r*t.a12,this.a9=e*t.a1+i*t.a5+s*t.a9+r*t.a13,this.a10=e*t.a2+i*t.a6+s*t.a10+r*t.a14,this.a11=e*t.a3+i*t.a7+s*t.a11+r*t.a15,e=this.a12,i=this.a13,s=this.a14,r=this.a15,this.a12=e*t.a0+i*t.a4+s*t.a8+r*t.a12,this.a13=e*t.a1+i*t.a5+s*t.a9+r*t.a13,this.a14=e*t.a2+i*t.a6+s*t.a10+r*t.a14,this.a15=e*t.a3+i*t.a7+s*t.a11+r*t.a15}scaleXY(t,e,i=1){this.a0*=t,this.a1*=t,this.a2*=t,this.a3*=t,this.a4*=e,this.a5*=e,this.a6*=e,this.a7*=e,this.a8*=i,this.a9*=i,this.a10*=i,this.a11*=i}},Ec=class{constructor(t=0,e=0,i=0,s=1){this.x=t,this.y=e,this.z=i,this.w=s}copy(t){this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w}transformMat4(t){const e=this.x,i=this.y,s=this.z,r=t.a3*e+t.a7*i+t.a11*s+t.a15||1;this.x=(t.a0*e+t.a4*i+t.a8*s+t.a12)/r,this.y=(t.a1*e+t.a5*i+t.a9*s+t.a13)/r,this.z=(t.a2*e+t.a6*i+t.a10*s+t.a14)/r,this.w=r}normalize(){let t=this.x*this.x+this.y*this.y+this.z*this.z;t>0&&(t=1/Math.sqrt(t)),this.x*=t,this.y*=t,this.z*=t}},Ic=class{constructor(t,e,i,s,r,n,a){this.image=t,this.index=e,this.start=i,this.end=s,this.tileSize=r,this.cols=n,this.rows=a,this.tileWidth=r/t.width,this.tileHeight=r/t.height}getTileRect(t,e){const i=t-this.start,s=i%this.cols,r=Math.floor(i/this.cols),n=this.image;return e.x0=n.x0+s*this.tileSize/n.width*n.rWidth,e.y0=n.y0+r*this.tileSize/n.height*n.rHeight,e.x1=n.x0+Math.min((s+1)*this.tileSize/n.width,1)*n.rWidth,e.y1=n.y0+Math.min((r+1)*this.tileSize/n.height,1)*n.rHeight,e.image=n,e.layer=this.index,e.x=s,e.y=r,e}},Ac=class t{static{this.toDraw=[]}static{this.toDrawSeen=new Uint8Array(0)}static{this.toDrawSeenBase=0}static{this.sampledXs=new Float64Array(200)}static{this.sampledYs=new Float64Array(200)}static{this.uniqueXs=new Float64Array(200)}static{this.sampledLength=0}static{this.uniqueLength=0}constructor(t,e,i,s,r,n,a,o,h,c,l,d,u,m,g,p){this.canvas=t,this.index=e,this.localIdx=i,this.width=s,this.height=r,this.tileSize=n,this.isSingle=a,this.isVideo=o,this.startOffset=h,this.opacity=c,this.tOpacity=l,this.rotX=d,this.rotY=u,this.rotZ=m,this.scale=g,this.fromScale=p,this.vec=new Ec,this.mat=new Sc,this.rScale=0,this.layers=[],this.numLayers=0,this.targetLayer=0,this.x0=0,this.y0=0,this.x1=1,this.y1=1,this.rWidth=1,this.rHeight=1,this.areaCenterX=.5,this.areaCenterY=.5,this.areaWidth=1,this.areaHeight=1,this.sphere3DX=0,this.sphere3DY=0,this.sphere3DZ=-1,this.angularWidth=0,this.angularHeight=0,this.gotBase=0,this.aspect=0,this.doneTotal=0,this.doRender=!1,this.is360Embed=!1,this.isVideoPlaying=!1;const f=s>r?s:r;this.is360Embed=this.canvas.is360&&this.localIdx>0,this.numLayers=2;for(let w=n;w<f*t.main.underzoomLevels;w*=2)this.numLayers++;(t.main.hasArchive||this.fromScale>0)&&(this.numLayers-=3-t.main.archiveLayerOffset),this.fromScale>0&&this.numLayers--,this.numLayers=Math.max(1,this.numLayers);let v=h;for(let w=0;w<this.numLayers;w++){const t=Ur(w)*this.tileSize,e=Math.ceil(s/t),i=Math.ceil(r/t);this.layers.push(new Ic(this,this.layers.length,v,this.endOffset=v+=e*i,t,e,i))}}setArea(t,e,i,s){this.x0=t,this.y0=e,this.x1=i,this.y1=s,this.areaWidth=i+(i<t?1:0)-t,this.areaHeight=s-e,this.areaCenterX=t+this.areaWidth/2,this.areaCenterY=e+this.areaHeight/2,this.canvas.is360&&(this.areaCenterX=Gr(this.areaCenterX)),this.rWidth=this.areaWidth,this.rHeight=this.areaHeight,this.aspect=this.width/this.height,this.rScale=this.aspect>this.canvas.aspect?this.canvas.width/this.width*this.rWidth:this.canvas.height/this.height*this.rHeight,this.canvas.is360&&this.calculate3DSpherePosition()}calculate3DSpherePosition(){let t=2*(this.areaCenterX-.5)*Br;const e=(this.areaCenterY-.5)*Br;t+=this.canvas.webgl.baseYaw,this.sphere3DX=Math.cos(e)*Math.sin(t),this.sphere3DY=Math.sin(e),this.sphere3DZ=Math.cos(e)*Math.cos(t),this.angularWidth=2*this.areaWidth*Br,this.angularHeight=this.areaHeight*Br}sphere3DOverlap(){if(!this.canvas.is360)return!1;const t=this.sphere3DX*this.canvas.webgl.cameraForwardX+this.sphere3DY*this.canvas.webgl.cameraForwardY+this.sphere3DZ*this.canvas.webgl.cameraForwardZ,e=Math.acos(Math.max(-1,Math.min(1,t))),i=Math.max(this.angularWidth,this.angularHeight)/2;return e<this.canvas.webgl.fieldOfView+i}outsideView(){if(this.is360Embed)return!this.sphere3DOverlap();{const t=this.canvas.view;return this.x1<=t.x0||this.x0>=t.x1||this.y1<=t.y0||this.y0>=t.y1}}shouldRender(){return!(this.fromScale>0&&this.fromScale>this.canvas.camera.scale)&&((!(this.isVideo||this.localIdx>0)||0!==this.opacity||0!==this.tOpacity)&&(!!(this.index===this.canvas.activeImageIdx||this.canvas.is360&&0===this.localIdx)||!this.outsideView()))}opacityTick(t){const e=this.tOpacity;if(this.opacity===e)return!1;const i=1/(this.canvas.main.frameTime*this.canvas.main.embedFadeDuration);return this.opacity=Math.min(1,Math.max(0,t?e:e>this.opacity?Math.min(e,this.opacity+i):Math.max(e,this.opacity-i))),this.opacity!==e}getTiles(e){if(this.opacity<=0)return 0;if(this.doneTotal=0,this.is360Embed){if(e=this.getEmbeddedScale(e),!(this.doRender=e>0))return 0}else{const t=this.canvas.camera;e=Math.max(e,t.minScale)*this.rScale}const i=this.endOffset-this.startOffset;if(t.toDrawSeen.length<i)t.toDrawSeen=new Uint8Array(i);else for(let a=0;a<i;a++)t.toDrawSeen[a]=0;t.toDrawSeenBase=this.startOffset,0===this.gotBase?(t.toDraw.push(this.endOffset-1),t.toDrawSeen[this.endOffset-1-this.startOffset]=1,this.canvas.main.setTileOpacity(this.endOffset-1,!0,1)):this.is360Embed&&(t.toDraw.push(this.endOffset-1),t.toDrawSeen[this.endOffset-1-this.startOffset]=1,this.doneTotal++);const s=this.getTargetLayer(e),r=this.canvas,n=r.view;0===this.localIdx&&r.is360?this.get360Tiles(this.layers[s]):(this.is360Embed?this.getTilesViewport(s):r.is360?this.getTilesRect(s,n.x0,n.y0,n.x1,n.y1):r.visible.x0<r.visible.x1&&r.visible.y0<r.visible.y1&&this.getTilesRect(s,Math.max(r.visible.x0,n.x0),Math.max(r.visible.y0,n.y0),Math.min(r.visible.x1,n.x1),Math.min(r.visible.y1,n.y1)),this.is360Embed&&this.doneTotal++),t.toDraw.sort((t,e)=>t>e?-1:t<e?1:0);for(let a=0;a<t.toDraw.length;a++)r.toDraw.push(t.toDraw[a]);return t.toDraw.length=0,this.doneTotal}getTargetLayer(t){let e=this.isSingle||this.canvas.limited?this.numLayers:1+this.canvas.main.skipBaseLevels;if(!this.isSingle&&!this.canvas.limited)for(;e<this.numLayers&&!(Ur(e)*t>=1);e++);return this.targetLayer=e-1}getTilesRect(t,e,i,s,r){if(this.outsideView())return;const n=this.layers[t],a=n.tileWidth,o=n.tileHeight,h=this.rWidth,c=this.rHeight,l=Math.min(n.cols-1,Math.floor(Math.max(0,s-this.x0)/h/a)),d=Math.floor(Math.max(0,r-this.y0)/c/o),u=Math.floor(Math.max(0,e-this.x0)/h/a);let m=Math.floor(Math.max(0,i-this.y0)/c/o);for(;m<=d;m++)if(!(m>=n.rows))for(let t=u;t<=l;t++)this.setToDraw(n,t,m)}getTilesViewport(t){if(this.outsideView())return;const e=this.layers[t],i=this.canvas,s=Gr(i.view.centerX+i.webgl.offX),r=i.view.centerY,n=i.view.width+.1,a=i.view.height+.1,o=this.areaCenterX,h=this.areaCenterY,c=this.areaWidth,l=this.areaHeight,d=r-a/2,u=r+a/2,m=h-l/2,g=h+l/2,p=Math.max(d,m),f=Math.min(u,g);if(p>=f)return;let v=0,w=0,y=!1;if(i.is360){const t=Gr(s-n/2),e=Gr(s+n/2),i=Gr(o-c/2),r=Gr(o+c/2);e>t&&r>i?(v=Math.max(t,i),w=Math.min(e,r),y=v<w):e<t&&r>i?(i<=e||r>=t)&&(v=i,w=r,y=!0):e>t&&r<i?(t<=r||e>=i)&&(v=t,w=e,y=!0):e<t&&r<i&&(v=Math.max(t,i),w=Math.min(e,r),y=!0)}else{const t=s-n/2,e=s+n/2,i=o-c/2,r=o+c/2;v=Math.max(t,i),w=Math.min(e,r),y=v<w}if(!y)return;let b=o-c/2,x=o+c/2;i.is360&&(x>1?(v<b&&(v+=1),w<b&&(w+=1)):v>o+.5?v-=1:w>o+.5&&(w-=1));const T=(v-b)/c,k=(w-b)/c,_=(p-(h-l/2))/l,M=(f-(h-l/2))/l,S=e.tileWidth,E=e.tileHeight,I=Math.floor(Math.max(0,Math.min(1,T))/S),A=Math.min(e.cols-1,Math.floor(Math.max(0,Math.min(1,k))/S)),L=Math.floor(Math.max(0,Math.min(1,_))/E),P=Math.min(e.rows-1,Math.floor(Math.max(0,Math.min(1,M))/E));for(let $=L;$<=P;$++)for(let t=I;t<=A;t++)this.setToDraw(e,t,$)}setToDraw(e,i,s){const r=Math.min(this.endOffset-1,e.start+s*e.cols+i),n=r-t.toDrawSeenBase;if(!(n<t.toDrawSeen.length&&t.toDrawSeen[n]))if(n<t.toDrawSeen.length&&(t.toDrawSeen[n]=1),t.toDraw.push(r),this.canvas.main.setTileOpacity(r,r===this.endOffset-1,this.canvas.opacity)>=1)this.doneTotal++;else if(!this.isSingle&&!this.canvas.limited&&e.index<this.numLayers-1){const t=this.layers[e.index+1],r=i>>1,n=s>>1;this.setToDraw(t,r,n)}}setDrawRect(t){const e=this.canvas.main.vertexBuffer,i=this.canvas.webgl.radius,s=2*Br*i,r=this.vec,n=this.mat,a=this.x0+this.rWidth/2,o=this.y0+this.rHeight/2,h=this.canvas.webgl.getVec3(a-this.canvas.webgl.offX,o,!0,5);n.identity(),n.translate(h.x,h.y,h.z),n.rotateY(Math.atan2(h.x,h.z)+Br+this.rotY),n.rotateX(-Math.sin((o-.5)*Br)-this.rotX),n.rotateZ(-this.rotZ),n.scaleFlat(.5*this.scale);let c=(t.x0-a)*s,l=.5*-(t.y0-o)*s;r.x=0,r.y=0,r.z=0,n.translate(c,l,0),r.transformMat4(n),n.translate(-c,-l,0),e[0]=r.x,e[1]=r.y,e[2]=r.z,r.x=0,r.y=0,r.z=0,n.translate(c=(t.x0-a)*s,l=.5*-(t.y1-o)*s,0),r.transformMat4(n),n.translate(-c,-l,0),e[3]=e[9]=r.x,e[4]=e[10]=r.y,e[5]=e[11]=r.z,r.x=0,r.y=0,r.z=0,n.translate(c=(t.x1-a)*s,l=.5*-(t.y0-o)*s,0),r.transformMat4(n),n.translate(-c,-l,0),e[6]=e[15]=r.x,e[7]=e[16]=r.y,e[8]=e[17]=r.z,r.x=0,r.y=0,r.z=0,n.translate(c=(t.x1-a)*s,l=.5*-(t.y1-o)*s,0),r.transformMat4(n),n.translate(-c,-l,0),e[12]=r.x,e[13]=r.y,e[14]=r.z}getEmbeddedScale(t){if(this.is360Embed){return t*Math.max(2*this.areaWidth,this.areaHeight)*(this.canvas.width/this.width)}const e=this.areaWidth,i=this.areaHeight,s=this.areaCenterX-e/2,r=this.areaCenterX+e/2,n=this.areaCenterY,a=i/2.5,o=this.canvas.el,h=this.canvas.webgl,c=this.canvas.el.width;let l=h.getXYZ(s,n-a),d=l.w>0||l.x<0?0:Math.min(c,l.x),u=0;l.inView(o)&&u++,h.getXYZ(r,n-a).inView(o)&&u++;const m=(l.w>0||l.x>c?c:Math.max(0,l.x))-d;if(h.getXYZ(s,n+a).inView(o)&&u++,d=l.w>0||l.x<0?0:Math.min(c,l.x),h.getXYZ(r,n+a).inView(o)&&u++,0===u)return 0;const g=(l.w>0||l.x>c?c:Math.max(0,l.x))-d;return Math.min(1,Math.max(g,m)/this.width)}get360Tiles(e){const i=this.canvas,s=i.el,r=s.width,n=s.height;t.sampledLength=0,t.uniqueLength=0;const a=i.webgl.fieldOfView>Br/2?20:12;for(let v=0;v<=a;v++){const e=v/a;let s=i.webgl.getCoo(e*r,0);t.sampledXs[t.sampledLength]=s.x,t.sampledYs[t.sampledLength]=s.y,t.sampledLength++,s=i.webgl.getCoo((1-e)*r,n),t.sampledXs[t.sampledLength]=s.x,t.sampledYs[t.sampledLength]=s.y,t.sampledLength++,s=i.webgl.getCoo(r,e*n),t.sampledXs[t.sampledLength]=s.x,t.sampledYs[t.sampledLength]=s.y,t.sampledLength++,s=i.webgl.getCoo(0,(1-e)*n),t.sampledXs[t.sampledLength]=s.x,t.sampledYs[t.sampledLength]=s.y,t.sampledLength++}let o;for(let v=1;v<=3;v++){const e=n*v/4;for(let s=1;s<=3;s++)o=i.webgl.getCoo(r*s/4,e),t.sampledXs[t.sampledLength]=o.x,t.sampledYs[t.sampledLength]=o.y,t.sampledLength++;o=i.webgl.getCoo(r*v/4,n-1),t.sampledXs[t.sampledLength]=o.x,t.sampledYs[t.sampledLength]=o.y,t.sampledLength++}let h=1/0,c=-1/0;for(let v=0;v<t.sampledLength;v++){const e=t.sampledYs[v];e<h&&(h=e),e>c&&(c=e)}h=Math.max(0,h),c=Math.min(1,c),h-=.001,c+=.05,h=Math.max(0,h),c=Math.min(1,c);const l=i.webgl.offX;for(let v=0;v<t.sampledLength;v++)t.sampledXs[v]=Gr(t.sampledXs[v]-l);t.uniqueLength=0;for(let v=0;v<t.sampledLength;v++){const e=t.sampledXs[v];let i=!1;for(let s=0;s<t.uniqueLength;s++)if(Math.abs(t.uniqueXs[s]-e)<1e-8){i=!0;break}i||(t.uniqueXs[t.uniqueLength]=e,t.uniqueLength++)}for(let v=1;v<t.uniqueLength;v++){const e=t.uniqueXs[v];let i=v-1;for(;i>=0&&t.uniqueXs[i]>e;)t.uniqueXs[i+1]=t.uniqueXs[i],i--;t.uniqueXs[i+1]=e}const d=t.uniqueLength;if(d<2)h=0,c=1,t.uniqueLength=0,t.uniqueXs[0]=0,t.uniqueXs[1]=1,t.uniqueLength=2;else{let e=0,i=-1;for(let h=0;h<d-1;h++){const s=t.uniqueXs[h+1]-t.uniqueXs[h];s>e&&(e=s,i=h)}const s=t.uniqueXs[0]+1-t.uniqueXs[d-1];let r=s>e;r&&(e=s,i=d-1);const n=1-e;let a=0,o=0;r?(a=t.uniqueXs[0],o=t.uniqueXs[d-1]):(a=t.uniqueXs[(i+1)%d],o=t.uniqueXs[i]+1),n>=.999999&&(a=0,o=1),t.uniqueLength=0,t.uniqueXs[0]=a,t.uniqueXs[1]=o,t.uniqueLength=2}let u=t.uniqueXs[1]-t.uniqueXs[0]>=.999999;(h<.05||c>.95)&&(u=!0);let m=Math.max(0,Math.max(0,Math.floor((h-.001)/e.tileHeight))),g=Math.min(e.rows-1,Math.max(0,Math.floor((c+e.tileHeight-1e-10)/e.tileHeight)));h<1e-5&&(m=0),c>.99999&&(g=e.rows-1);const p=e.tileWidth,f=t.uniqueXs[1]>1;for(let v=m;v<=g;v++)if(u)for(let t=0;t<e.cols;t++)this.setToDraw(e,t,v);else if(f){for(let s=Math.max(0,Math.max(0,Math.floor((t.uniqueXs[0]-.001)/p)-1));s<e.cols;s++)this.setToDraw(e,s,v);const i=Math.min(e.cols-1,Math.ceil(Gr(t.uniqueXs[1]+.001)/p));for(let t=0;t<=i;t++)this.setToDraw(e,t,v)}else{const i=Math.max(0,Math.max(0,Math.floor((t.uniqueXs[0]-.001)/p)-1)),s=Math.min(e.cols-1,Math.ceil((t.uniqueXs[1]+.001)/p));for(let t=i;t<=s;t++)this.setToDraw(e,t,v)}}},Lc=class{constructor(t){this.canvas=t,this.pMatrix=new Sc,this.iMatrix=new Sc,this.cachedInverse=new Sc,this.inverseDirty=!0,this.rMatrix=new Sc,this.position=new Ec,this.radius=10,this.scale=0,this.scaleY=1,this.offY=0,this.dofY=1,this.limitX=0,this.limitY=0,this.baseYaw=0,this.yaw=0,this.pitch=0,this.defaultPerspective=qr,this.perspective=qr,this.maxPerspective=qr,this.minPerspective=qr,this.cameraForwardX=0,this.cameraForwardY=0,this.cameraForwardZ=-1,this.cameraUpX=0,this.cameraUpY=1,this.cameraUpZ=0,this.cameraRightX=1,this.cameraRightY=0,this.cameraRightZ=0,this.fieldOfView=0,this.aspectRatio=1,this.vec4=new Ec,this.coo=new xc,this.offX=0,this.baseYaw=-this.canvas.rotationY,this.offX=this.baseYaw/Wr,this.canvas.is360&&(this.scaleY=this.canvas.height/(this.canvas.width/2),this.offY=(1-this.scaleY)/4),this.yaw=this.baseYaw,this.update()}setLimits(t,e){this.limitX=t,this.limitY=e,this.maxPerspective=qr,e>0&&(this.maxPerspective=Math.min(this.maxPerspective,this.maxPerspective*e*1.5)),this.setPerspective(this.perspective,!0)}update(t=!1){const e=this.canvas,i=e.el;if(t||this.pMatrix.perspective(this.perspective,i.aspect,1e-4,e.is360?20:100),this.inverseDirty=!0,e.is360){const t=this.pMatrix;this.pitch=Math.min(Br/2,Math.max(-Br/2,this.pitch)),t.rotateX(this.pitch),t.rotateY(this.yaw),t.translate(this.position.x,this.position.y,this.position.z);const e=this.rMatrix;e.perspectiveCss(this.perspective),e.translate(0,0,i.height/i.ratio/2),e.rotateX(-this.pitch),e.rotateY(this.yaw),this.coo.direction=this.yaw/Br*180%360}else{const t=e.view;this.pMatrix.translate(-(t.centerX-.5)*e.aspect,t.centerY-.5,-t.height/2)}this.pMatrix.toArray()}rotate(t,e,i,s){const r=this.canvas,n=r.el;this.yaw+=t*n.ratio/n.width*this.perspective*n.aspect,this.pitch+=e*n.ratio/n.height*this.perspective*this.scaleY,this.yaw=jr(this.yaw),(r.coverLimit||this.limitY>0)&&this.limitPitch(),this.limitX>0&&this.limitYaw(),0===i&&r.kinetic.addStep(2*t,2*e,s),this.update(),this.calculate3DFrustum(),this.syncLogicalView()}limitPitch(){const t=this.perspective/2,e=Br*this.scaleY/2*(this.limitY>0?this.limitY:1);this.pitch=this.pitch>0?Math.min(e,this.pitch+t)-t:Math.max(-e,this.pitch-t)+t}limitYaw(){const t=this.perspective/2*this.canvas.el.aspect,e=Br*(this.limitX>0?this.limitX:1);let i=this.yaw;for(;i>=Br;)i-=2*Br;for(;i<-Br;)i+=2*Br;this.yaw=jr(Math.min(Math.max(e,t)-t,Math.max(Math.min(-e,-t)+t,i)))}zoom(t,e,i,s,r,n=0,a=0){const o=this.canvas;if(t/=2,0!==e)e=o.ani.zoom(t,e,i,s,r);else{t/=this.scale*Math.sqrt(o.width*o.width+o.height*o.height)/20;const e=n>0&&a>0;let i=0,r=0;if(e){const t=this.getCoo(n,a);i=t.x,r=t.y}if(this.setPerspective(this.perspective+t,s),e){const t=this.getCoo(n,a);let e=i-t.x;e>.5&&(e-=1),e<-.5&&(e+=1);const s=r-t.y;this.yaw+=e*Br*2,this.pitch+=s*Br*this.scaleY,this.yaw=jr(this.yaw),(o.coverLimit||this.limitY>0)&&this.limitPitch(),this.limitX>0&&this.limitYaw(),this.update(),this.readScale(),this.calculate3DFrustum(),this.syncLogicalView()}}return e}setPerspective(t,e){const i=this.canvas;this.perspective=t,e&&!i.is360||(this.perspective=Math.min(this.maxPerspective,Math.max(this.minPerspective,this.perspective))),(i.coverLimit||this.limitY>0)&&this.limitPitch(),this.limitX>0&&this.limitYaw(),this.pMatrix.perspective(this.perspective,i.el.aspect,1e-4,i.is360?20:100),this.readScale(),this.update(!0),this.calculate3DFrustum(),this.syncLogicalView()}readScale(){const t=this.canvas.el,e=t.width/2,i=t.height/2,s=this.getCoo(e,i).x,r=this.getCoo(e+1,i+1).x;this.scale=1/(r+(r<s?1:0)-s)/this.canvas.width}setDirection(t,e,i){this.yaw=jr(t-this.baseYaw),this.pitch=e,0!==i?this.setPerspective(i,!1):this.update(),this.calculate3DFrustum(),this.syncLogicalView()}setView(t,e,i,s,r=!1,n=!1){this.yaw=((n?t+this.offX:t)-.5)*Br*2,this.pitch=(e-.5)*Br*this.scaleY,this.setPerspective(Math.min(this.maxPerspective,s*Br*this.scaleY),r),this.calculate3DFrustum(),this.syncLogicalView()}syncLogicalView(){const t=this.canvas;if(!t.is360)return;const e=Gr(this.yaw/(2*Br)+.5),i=this.pitch/this.scaleY/Br+.5,s=this.perspective/Br/this.scaleY,r=s*(0===t.el.width?1:.5*Math.sqrt(t.el.aspect))/(t.aspect/2);t.view.set(e,i,r,s),t.view.changed=!0}calculate3DFrustum(){if(!this.canvas.is360)return;const t=this.yaw,e=this.pitch;this.cameraForwardX=Math.cos(e)*Math.sin(t),this.cameraForwardY=Math.sin(e),this.cameraForwardZ=Math.cos(e)*Math.cos(t),this.cameraUpX=-Math.sin(e)*Math.sin(t),this.cameraUpY=Math.cos(e),this.cameraUpZ=-Math.sin(e)*Math.cos(t),this.cameraRightX=Math.cos(t),this.cameraRightY=0,this.cameraRightZ=-Math.sin(t);const i=2*Math.atan(1/this.perspective);this.aspectRatio=this.canvas.el.width/this.canvas.el.height;const s=i/2;this.fieldOfView=2*Math.atan(Math.tan(s)*this.aspectRatio)}moveTo(t,e,i,s){const r=i*Br*2+s;this.position.x=-t*Math.sin(r),this.position.y=e,this.position.z=t*Math.cos(r),this.canvas.view.changed=!0,this.update()}resize(){const t=this.canvas,e=t.el;t.camera.setCanvas(),this.minPerspective=Math.min(.5,e.height/t.height)/t.maxScale*this.scaleY*Br/e.ratio*e.scale,this.setPerspective(this.perspective,!0)}ensureInverse(){this.inverseDirty&&(this.cachedInverse.copy(this.pMatrix),this.cachedInverse.invert(),this.inverseDirty=!1)}getCoo(t,e){const i=this.canvas.el;return this.vec4.x=t*i.ratio/i.width*2-1,this.vec4.y=-(e*i.ratio/i.height*2-1),this.vec4.z=1,this.vec4.w=1,this.ensureInverse(),this.vec4.transformMat4(this.cachedInverse),this.vec4.normalize(),this.coo.x=Math.atan2(this.vec4.x,-this.vec4.z)/Br/2+.5,this.coo.y=.5-Math.asin(this.vec4.y)/Br/this.scaleY,this.coo.scale=this.scale,this.coo.w=this.position.x+this.position.z,this.coo.direction=this.yaw+this.baseYaw,this.coo.toArray(),this.coo}getXYZ(t,e){const i=this.canvas.el;return this.getVec3(t+this.offX,e),this.coo.x=(this.vec4.x+1)/2*i.width/i.ratio,this.coo.y=(1-this.vec4.y)/2*i.height/i.ratio,this.coo.scale=this.scale,this.coo.w=-this.vec4.w,this.coo.toArray(),this.coo}getVec3(t,e,i=!1,s=this.radius){t*=2*-Br,e-=.5,e*=-Br,e*=this.scaleY;const r=Math.cos(e);return this.vec4.x=r*Math.sin(t)*s,this.vec4.y=Math.sin(e)*s,this.vec4.z=r*Math.cos(t)*s,this.vec4.w=1,i||this.vec4.transformMat4(this.pMatrix),this.vec4}getMatrix(t,e,i,s,r,n,a,o,h=1,c=1,l=!1){isNaN(s)&&(s=this.radius),this.iMatrix.identity(),s*=this.radius*(100/Wr),t*=2*-Br,e-=.5,e*=Br*this.scaleY;const d=Math.cos(e);return this.vec4.x=d*Math.sin(t),this.vec4.y=Math.sin(e),this.vec4.z=d*Math.cos(t),this.iMatrix.translate(this.position.x*s/this.radius,-this.position.y*s/this.radius+o*this.radius,this.position.z*s/this.radius),this.iMatrix.translate(this.vec4.x*s,this.vec4.y*s,this.vec4.z*s),this.iMatrix.rotateY(Math.atan2(this.vec4.x,this.vec4.z)+Br+n),this.iMatrix.rotateX(this.vec4.y+r),this.iMatrix.rotateZ(a),this.iMatrix.scaleXY(h,c),this.iMatrix.scaleFlat(i/Br/this.radius),this.iMatrix.multiply(this.rMatrix),this.iMatrix}setTile360(t,e,i,s){e*=this.scaleY,e/=2,e-=.25,e+=this.offY,s*=this.scaleY,s/=2;const r=this.canvas.main.vertexBuffer360,n=this.radius,a=i/16,o=s/16,h=2*Br;for(let c=0;c<16;c++)for(let i=0;i<16;i++){const s=6*(16*c+i)*3,l=-Gr(t+a*i+this.offX)*h,d=-(e+o*c)*h,u=-Gr(t+a*(i+1)+this.offX)*h,m=-(e+o*(c+1))*h;let g=Math.cos(l)*n;isNaN(g)&&(g=0);let p=Math.sin(l)*n;isNaN(p)&&(p=0);let f=Math.cos(u)*n;isNaN(f)&&(f=0);let v=Math.sin(u)*n;isNaN(v)&&(v=0);const w=Math.cos(d),y=Math.cos(m),b=Math.sin(d)*n,x=Math.sin(m)*n;r[s+0]=w*p,r[s+1]=b,r[s+2]=w*g,r[s+3]=r[s+9]=y*p,r[s+4]=r[s+10]=x,r[s+5]=r[s+11]=y*g,r[s+6]=r[s+15]=w*v,r[s+7]=r[s+16]=b,r[s+8]=r[s+17]=w*f,r[s+12]=y*v,r[s+13]=x,r[s+14]=y*f}}},Pc=class t{get zIndex(){return this._zIndex}set zIndex(t){this._zIndex!==t&&(this._zIndex=t,this.parent&&(this.parent.childrenDirty=!0))}constructor(t,e,i,s,r,n,a=!1){this.main=t,this.width=e,this.height=i,this.targetOpacity=s,this.coverLimit=r,this.hasParent=a,this.rect=new yc,this.el=new Tc,this.images=[],this.children=[],this.areaAniPerc=1,this.areaAniPaused=!1,this._zIndex=0,this.childrenDirty=!1,this.toDraw=[],this.index=0,this.isVisible=!1,this.opacity=0,this.bOpacity=0,this.isReady=!1,this.activeImageIdx=-1,this.omniFieldOfView=0,this.omniVerticalAngle=0,this.omniDistance=0,this.omniOffsetX=0,this.limited=!1,this.layer=0,this.tileSize=n.tileSize,this.is360=n.is360,this.noImage=n.noImage,this.isSingle=n.isSingle,this.freeMove=n.freeMove,this.coverStart=!!r||n.coverStart,this.maxScale=n.maxScale,this.scaleMultiplier=n.scaleMultiplier,this.camSpeed=n.camSpeed,this.rotationY=n.rotationY,this.isGallerySwitch=n.isGallerySwitch,this.pagesHaveBackground=n.pagesHaveBackground,this.isOmni=n.isOmni,this.pinchZoomOutLimit=n.pinchZoomOutLimit,this.omniNumLayers=n.omniNumLayers,this.omniStartLayer=n.omniStartLayer,this.index=t.canvases.length,a||t.canvases.push(this),this.aspect=e/i,this.view=new bc(this),this.focus=new bc(this),this.ani=new _c(this),this.kinetic=new kc(this),this.camera=new Mc(this),this.webgl=new Lc(this),this.area=new bc(this),this.currentArea=new bc(this),this.targetArea=new bc(this),this.visible=new bc(this),this.full=new bc(this),n.is360&&this.view.set(.5,.5,1,.5),a||(this.el.copy(t.el),this.setView(this.view.centerX,this.view.centerY,this.view.width,this.view.height,!1,!1),this.resize()),n.noImage?(this.main.numImages++,this.bOpacity=1,this.opacity=1,this.isReady=!0,n.omniStartLayer>0&&this.setActiveLayer(n.omniStartLayer)):this.addImage(0,0,1,1,e,i,n.tileSize,n.isSingle,!1,s,0,0,0,1,0)}setParent(t){this.parent=t,this.index+=t.children.length}addImage(t,e,i,s,r,n,a,o,h,c,l,d,u,m,g){const p=new Ac(this,this.main.numImages++,this.images.length,r,n,a,o,h,this.main.numTiles,c,c,l,d,u,m,g);return p.setArea(t,e,i,s),this.images.push(p),this.main.numTiles=p.endOffset,1===this.images.length&&this.setActiveImage(0,0),p}addChild(e,i,s,r,n,a){const o=new t(this.main,n,a,1,!0,{tileSize:this.tileSize,is360:!1,noImage:!1,isSingle:!1,freeMove:!1,coverStart:!0,maxScale:1,scaleMultiplier:1,camSpeed:this.camSpeed,rotationY:0,isGallerySwitch:!1,pagesHaveBackground:!1,isOmni:!1,pinchZoomOutLimit:this.pinchZoomOutLimit,omniNumLayers:1,omniStartLayer:0},!0);return o.setParent(this),o.setArea(e,i,s,r,!0,!0),this.children.push(o),o}stepOpacity(){const t=1/(0!==this.main.distanceX||0!==this.main.distanceY?this.main.spacesTransitionDuration:1===this.main.canvases.length?.25:this.main.crossfadeDuration)/this.main.frameTime,e=this.targetOpacity>0&&this.targetOpacity>=this.opacity;if(this.opacity=e?Math.min(1,this.opacity+t):Math.max(0,this.opacity-t),this.bOpacity=Kr.get(this.opacity),0!==this.main.distanceX||0!==this.main.distanceY){const t=0===this.opacity?0:Kr.get(1-this.opacity)*(e?1:-1);this.webgl.moveTo(this.main.distanceX*t*8,this.main.distanceY*t*8,this.main.direction,0)}}setCanvasVisible(t){this.main.setCanvasVisible(this,t),this.isVisible=t}fadeOut(){this.targetOpacity=0,this.zIndex=0}fadeIn(){if(this.isReady=!0,!this.hasParent&&1===this.currentArea.width&&1===this.currentArea.height)for(let t=0;t<this.main.canvases.length;t++)this.main.canvases[t]!==this&&this.main.canvases[t].fadeOut();this.targetOpacity=1}areaAnimating(){return!this.areaAniPaused&&this.areaAniPerc<1}isHidden(){return 0===this.targetOpacity&&0===this.opacity||0===this.currentArea.width||0===this.currentArea.height}shouldDraw(){if(!this.areaAnimating()&&this.isHidden())return void(this.isVisible&&this.setCanvasVisible(!1));!this.isVisible&&this.opacity>=1&&this.setCanvasVisible(!0);let t=this.ani.step(this.main.now)<1||this.kinetic.step(this.main.now)<1||!this.isReady;if(this.toDraw.length=0,this.partialView(!1)&&(t=!0),!this.is360&&(this.visible.width<=0||this.visible.height<=0))return;this.webgl.calculate3DFrustum(),this.isReady&&this.opacity!==this.targetOpacity&&(this.stepOpacity(),t=!0);const e=(this.is360?this.webgl.scale:this.camera.scale)*this.el.scale;for(let i=0;i<this.images.length;i++){const s=this.images[i];s.shouldRender()?(i>0&&!s.doRender&&this.main.setImageVisible(s,s.doRender=!0),s.isVideo&&s.isVideoPlaying&&(t=!0),s.opacityTick(this.isGallerySwitch||this.opacity<1)&&(t=!0),s.opacity>0&&(this.main.doneTotal+=s.getTiles(e))):s.doRender&&this.main.setImageVisible(s,s.doRender=!1)}this.main.toDrawTotal+=this.toDraw.length,this.main.progress=0===this.main.toDrawTotal?1:this.main.doneTotal/this.main.toDrawTotal,this.view.toArray();for(let i=0;i<this.children.length;i++)this.children[i].shouldDraw();t&&(this.main.animating=!0)}draw(){if(0===this.targetOpacity&&0===this.opacity)return;const t=this.ani.isStarted();if(this.main.setViewport(this.el.left,this.main.el.height-this.el.height-this.el.top,this.el.width,this.el.height),this.main.setMatrix(this.webgl.pMatrix.arr),this.pagesHaveBackground)for(let i=0;i<this.images.length;i++){const t=this.images[i];t.x1<=this.view.x0||t.x0>=this.view.x1||t.y1<=this.view.y0||t.y0>=this.view.y1||(this.setTile(t.endOffset-1),this.main.drawQuad(t.tOpacity))}const e=this.rect;for(let i=0;i<this.toDraw.length;i++){const s=this.toDraw[i];this.setTile(s);const r=e.layer===e.image.targetLayer-1||!this.main.bareBone&&e.layer===e.image.targetLayer,n=s===e.image.endOffset-1,a=this.main.getTileOpacity(s);(r||1===a||n)&&this.main.drawTile(e.image.index,s,e.layer,e.x,e.y,a*this.bOpacity*e.image.opacity,t,e.layer===e.image.targetLayer-1)&&n&&(e.image.gotBase=this.main.now,this.isReady||this.fadeIn())}this.childrenDirty&&(this.children.sort((t,e)=>t.zIndex>e.zIndex?1:t.zIndex<e.zIndex?-1:0),this.childrenDirty=!1);for(let i=0;i<this.children.length;i++)this.children[i].draw();this.view.changed&&this.main.viewSet(this),this.view.changed=!1}partialView(t){const e=this.main.el,i=this.hasParent,s=i?this.parent.getScale():1/e.ratio,r=i?this.parent.width:e.width,n=i?this.parent.height:e.height,a=i?this.parent.view:this.full,o=this.view,h=this.currentArea,c=this.area,l=this.targetArea,d=this.areaAnimating();if(d){const t=1/this.main.gridTransitionDuration/this.main.frameTime;this.areaAniPerc=Math.min(1,this.areaAniPerc+t);const e=this.main.gridTransitionTimingFunction.get(this.areaAniPerc),i=c.centerX+(l.centerX-c.centerX)*e,s=c.centerY+(l.centerY-c.centerY)*e,r=c.width+(l.width-c.width)*e,n=c.height+(l.height-c.height)*e;h.set(i,s,r,n),1===this.areaAniPerc&&(1===this.zIndex&&(this.zIndex=0),c.copy(l)),this.view.changed=!0}let u=Math.max(o.x0,o.x0+(a.x0-h.x0)/h.width*o.width),m=Math.min(o.x1,o.x0+(1-(h.x1-Math.min(h.x1,a.x1))/h.width)*o.width);this.is360||(u=Math.max(0,u),m=Math.min(1,m));let g=Math.max(Math.max(0,o.y0),o.y0+(a.y0-h.y0)/h.height*o.height),p=Math.min(Math.min(1,o.y1),o.y0+(1-(h.y1-Math.min(h.y1,a.y1))/h.height)*o.height);g=Math.max(g,0),p=Math.min(p,1);const f=(u+m)/2,v=(g+p)/2,w=m-u,y=p-g;this.visible.set(f,v,w,y);const b=i?1:e.ratio;return this.targetOpacity<this.opacity||!this.el.set(h.width*s*r,h.height*s*n,(h.x0-a.x0)*r*s,(h.y0-a.y0)*n*s,b,i?1:e.scale,!i&&e.isPortrait)||(t||this.sendViewport(),this.view.changed=!0,this.resize(),this.camera.setCanvas(),this.webgl.update()),d}setArea(t,e,i,s,r,n){this.areaAniPaused=!1,r?(this.area.setArea(t,e,i,s),this.currentArea.setArea(t,e,i,s)):(this.area.copy(this.currentArea),this.areaAniPerc=0,0===this.zIndex&&(this.zIndex=1),this.ani.limit=!1),this.targetArea.setArea(t,e,i,s),this.partialView(n)}setTile(t){const e=this.rect;if(this.findTileRect(t),this.is360)0===e.image.localIdx?this.webgl.setTile360(e.x0,e.y0,e.x1-e.x0,e.y1-e.y0):e.image.setDrawRect(e);else{const t=this.main.vertexBuffer,i=this.aspect;t[0]=t[3]=t[9]=(e.x0-.5)*i,t[1]=t[7]=t[16]=.5-e.y0,t[4]=t[10]=t[13]=.5-e.y1,t[6]=t[12]=t[15]=(e.x1-.5)*i,t[2]=t[5]=t[8]=t[11]=t[14]=t[17]=0}}sendViewport(){const t=this.main.el;this.main.viewportSet(this,this.el.left/t.ratio,this.el.top/t.ratio,this.el.width/t.ratio,this.el.height/t.ratio)}findTileRect(t){let e=0;for(;t>=this.images[e].endOffset;)e++;const i=this.images[e];let s=0;for(;t>=i.layers[s].end;)s++;i.layers[s].getTileRect(t,this.rect)}resize(){if(this.children.length){const t=this.main.el;this.width=t.width,this.height=t.height}this.hasParent||(this.is360?this.webgl.resize():(this.camera.setCanvas(),this.webgl.update()))}reset(){if(this.kinetic.stop(),this.ani.stop(),this.images.length>0){const t=this.images[0];t.gotBase=0,t.opacity=0}}remove(){this.setCanvasVisible(!1),this.main.remove(this)}replace(){this.main.canvases.push(this)}setActiveLayer(t){this.layer=t,this.setActiveImage(this.activeImageIdx,0),this.view.changed=!0}setActiveImage(t,e){const i=this.layer*(this.images.length/this.omniNumLayers);for(let s=0;s<this.images.length;s++){const r=this.images[s],n=s-i-t;0!==n?r.tOpacity=n>=0&&n<=e?1:0:(r.tOpacity=1,this.activeImageIdx=t,this.view.changed=!0)}this.camera.correctMinMax()}setFocus(t,e,i,s,r){const n=(t+i)/2,a=(e+s)/2,o=i-t,h=s-e;if(!this.focus.equals(n,a,o,h)){this.activeImageIdx=-1;for(let r=0;r<this.images.length;r++){const n=this.images[r];n.x1<=t||n.x0>=i||n.y1<=e||n.y0>=s?n.tOpacity=0:(n.tOpacity=1,this.activeImageIdx=r)}this.focus.set(n,a,o,h),this.camera.correctMinMax(),r||(this.camera.setView(),this.webgl.update())}}getCoo(t,e,i,s){return(this.is360?this.webgl.getCoo(t,e):this.camera.getCoo(t,e,i,s)).toArray()}getXY(t,e,i,s,r){return(this.is360?this.webgl.getXYZ(t,e):isNaN(s)?this.camera.getXY(t,e,i):this.camera.getXYOmni(t,e,s,isNaN(r)?0:r,i)).toArray()}getView(){return this.view.arr}setView(t,e,i,s,r,n,a=!1,o=!1){const h=this.main.el;h.areaHeight>0&&(s+=s/(1-h.areaHeight/h.height),this.ani.limit=!1,h.areaHeight=0),h.areaWidth>0&&(i+=i*(h.areaWidth/h.width),this.ani.limit=!1,h.areaWidth=0),r&&(this.ani.limit=!1),this.view.set(t,e,i,s),o&&!r&&this.view.limit(!1,!1,this.freeMove),n||this.ani.lastView.copy(this.view),this.width>0&&(this.is360?(this.webgl.setView(t,e,i,s,r,a),this.view.set(t,e,i,s)):this.camera.setView()&&this.webgl.update())}getScale(){return this.is360?this.webgl.scale:this.camera.scale}isZoomedIn(){return this.is360?this.webgl.perspective<=this.webgl.minPerspective:this.camera.isZoomedIn()}isZoomedOut(t=!1){return this.is360?this.webgl.perspective>=this.webgl.maxPerspective:this.camera.isZoomedOut(t)}setDirection(t,e,i){isNaN(e)&&(e=this.webgl.pitch),this.webgl.setDirection(t,e,i?this.webgl.defaultPerspective:0)}getMatrix(t,e,i,s,r,n,a,o,h=1,c=1,l=!1){const d=2e4/this.width;return this.webgl.getMatrix(t,e,i*d,s,r,n,a,o,h,c,l).toArray()}aniPause(t){this.areaAniPaused=!0,this.ani.pause(t)}aniResume(t){this.areaAniPaused=!1,this.ani.resume(t)}aniStop(){this.ani.stop();for(let t=0;t<this.children.length;t++)this.children[t].aniStop()}aniDone(){this.main.aniDone(this)}aniAbort(){this.main.aniAbort(this)}},$c=class{constructor(t){this.el=new Tc,this.vertexBuffer=new Float32Array(18),this.vertexBuffer360=new Float32Array(4608),this.canvases=[],this.numTiles=0,this.numImages=0,this.now=0,this.animating=!1,this.progress=0,this.toDrawTotal=0,this.doneTotal=0,this.crossfadeDuration=.25,this.gridTransitionDuration=.5,this.gridTransitionTimingFunction=Kr,this.spacesTransitionDuration=.5,this.embedFadeDuration=.5,this.dragElasticity=1,this.hasArchive=!1,this.archiveLayerOffset=0,this.underzoomLevels=4,this.skipBaseLevels=0,this.bareBone=!1,this.isSwipe=!1,this.noPinchPan=!1,this.direction=0,this.distanceX=0,this.distanceY=0,this.frameTime=1/60,this._host=t}get drawTile(){return this._host.drawTile}get drawQuad(){return this._host.drawQuad}get getTileOpacity(){return this._host.getTileOpacity}get setTileOpacity(){return this._host.setTileOpacity}get setMatrix(){return this._host.setMatrix}get setViewport(){return this._host.setViewport}get aniDone(){return this._host.aniDone}get aniAbort(){return this._host.aniAbort}get viewSet(){return this._host.viewSet}get viewportSet(){return this._host.viewportSet}get setCanvasVisible(){return this._host.setCanvasVisible}get setImageVisible(){return this._host.setImageVisible}shouldDraw(t){this.frameTime=1e3/Math.min(33,t-this.now),this.now=t,this.doneTotal=0,this.toDrawTotal=0,this.animating=!1;for(let e=0;e<this.canvases.length;e++)this.canvases[e].shouldDraw();return this.animating||this.progress<1}draw(){for(let t=0;t<this.canvases.length;t++)this.canvases[t].draw()}reset(){for(let t=0;t<this.canvases.length;t++)this.canvases[t].reset()}aniStop(){for(let t=0;t<this.canvases.length;t++)this.canvases[t].aniStop()}resize(t,e,i,s,r,n,a){this.el.set(t,e,i,s,r,n,a);for(let o=0;o<this.canvases.length;o++)this.canvases[o].resize()}remove(t){for(let e=0;e<this.canvases.length;e++)if(this.canvases[e]===t)return void this.canvases.splice(e,1)}},Cc=class t{static{this._textureBuffer=t.getTextureBuffer(1,1)}getCanvas(t){return this.canvasById.get(t.ptr)?.canvas}setEntry(t,e){this.canvasById.set(t,e),this.canvasToEntry.has(e.canvas)||this.canvasToEntry.set(e.canvas,e)}constructor(t){this.micrio=t,this.ready=!1,this.images=[],this.bareBone=!1,this.baseTiles=[],this.drawnSet=new Set,this.prevDrawnSet=new Set,this.tiles=new Map,this.requests=new Map,this.unsubscribe=[],this.cameras=new Map,this.ptrToImage=new Map,this.engImageToMicrio=new Map,this.preventDirectionSet=!1,this.isGallery=!1,this.now=-1,this.raf=-1,this.drawing=!1,this.activeCanvasEntry=null,this.canvasById=new Map,this.canvasToEntry=new Map,this.nextPtr=1,this.addImage=async(t,e,i=!1,s=1)=>gn(t.info).then(r=>{if(!r)return;this.images.push(t);const n=t.opts.area??[0,0,1,1],a=t.$settings._360??{},o=this.canvasById.get(e.ptr);if(!o)return;let h;if(i){const e=o.canvas.addImage(n[0],n[1],n[2],n[3],r.width,r.height,r.tileSize||1024,r.isSingle??!1,r.isVideo??!1,s,a.rotX??0,a.rotY??0,a.rotZ??0,a.scale??1,0);this.engImageToMicrio.set(e,t);const i=this.nextPtr++;return t.ptr=i,this.setEntry(i,{canvas:o.canvas,micrioImage:t}),this.ptrToImage.set(i,t),t.baseTileIdx=this.engine.numTiles-1,this.getTileEntry(t.baseTileIdx).opacity=1,void this.baseTiles.push(t.baseTileIdx)}h=o.canvas.addChild(n[0],n[1],n[2],n[3],r.width,r.height);const c=this.nextPtr++;if(t.ptr=c,this.setEntry(c,{canvas:h,micrioImage:t}),this.ptrToImage.set(c,t),!i){this.bindCamera(t),t.$settings.focus&&h.camera.setCoo(t.$settings.focus[0],t.$settings.focus[1],0,0,0,!1,0,performance.now());const e=t.$info.view;e&&"0,0,1,1"!=e.toString()&&h.setView(e[0],e[1],e[2],e[3],!1,!1,!1,!1),h.sendViewport()}t.baseTileIdx=this.engine.numTiles-1,this.getTileEntry(t.baseTileIdx).opacity=1,this.baseTiles.push(t.baseTileIdx)}),this.addChild=(t,e)=>this.addImage(t,e),this.deleteAfterSeconds=ln.iOS?5:wt(this.micrio.canvas.isMobile)?30:90,this.render=this.render.bind(this),this.draw=this.draw.bind(this),this.unsubscribe.push(t.current.subscribe(this.setCanvas.bind(this)))}static getTextureBuffer(t,e){const i=new Float32Array(12*t*e),s=1/t,r=1/e;for(let n=0,a=0;a<e;a++)for(let e=0;e<t;e++,n+=12)i[n+3]=i[n+7]=i[n+9]=(i[n+1]=i[n+5]=i[n+11]=a*r)+r,i[n+4]=i[n+8]=i[n+10]=(i[n+0]=i[n+2]=i[n+6]=e*s)+s;return i}async load(){if(this.engine)return;const e=new $c({drawTile:this.drawTile.bind(this),drawQuad:this._hostDrawQuad.bind(this),getTileOpacity:this._hostGetTileOpacity.bind(this),setTileOpacity:this._hostSetTileOpacity.bind(this),setMatrix:this._hostSetMatrix.bind(this),setViewport:this._hostSetViewport.bind(this),aniDone:this._hostAniDone.bind(this),aniAbort:this._hostAniAbort.bind(this),viewSet:this._hostViewSet.bind(this),viewportSet:this._hostViewportSet.bind(this),setCanvasVisible:this._hostSetCanvasVisible.bind(this),setImageVisible:this._hostSetImageVisible.bind(this)});this._vertexBuffer=e.vertexBuffer,this._vertexBuffer360=e.vertexBuffer360,t._textureBuffer360=t.getTextureBuffer(16,16),this.engine=e,this.unsubscribe.push(this.micrio.barebone.subscribe(t=>{this.bareBone=t,this.engine.bareBone=t}))}findCamera(t){const e=this.canvasToEntry.get(t);return e?this.cameras.get(e.micrioImage.ptr):void 0}findEntry(t){if(t instanceof Pc)return this.canvasToEntry.get(t)}_hostDrawQuad(t){this.micrio.webgl.drawTile(void 0,t)}_hostGetTileOpacity(t){return this.tiles.get(t)?.opacity||0}_hostSetTileOpacity(t,e=!1,i=1){const s=this.tiles.get(t);return s?(s.opacity<1&&(s.opacity=e?1:s.loadedAt&&s.loadedAt>0?Math.min(1,(this.now-s.loadedAt)/250)*i:0),s.opacity):0}_hostSetMatrix(t){this.micrio.webgl.gl.uniformMatrix4fv(this.micrio.webgl.pmLoc,!1,t)}_hostSetViewport(t,e,i,s){this.micrio.webgl.gl.viewport(Math.floor(t),Math.floor(e),Math.ceil(i),Math.ceil(s))}_hostAniDone(t){const e=this.findCamera(t);if(e){for(e.aniDone&&e.aniDone();e.aniDoneAdd.length;)e.aniDoneAdd.shift()?.();e.aniAbort=e.aniDone=void 0}}_hostAniAbort(t){const e=this.findCamera(t);e&&(e.aniAbort&&e.aniAbort(),e.aniDoneAdd.length=0,e.aniAbort=e.aniDone=void 0)}_hostViewSet(t){this.findCamera(t)?.viewChanged()}_hostViewportSet(t,e,i,s,r){const n=this.findEntry(t);n&&"viewport"in n.micrioImage&&n.micrioImage.viewport.set([e,i,s,r])}_hostSetCanvasVisible(t,e){this.findEntry(t)?.micrioImage?.visible?.set(e)}_hostSetImageVisible(t,e){const i=this.engImageToMicrio.get(t);i&&"visible"in i&&i.visible.set(e)}unbind(){for(this.stop();this.unsubscribe.length;)this.unsubscribe.shift()?.();this.requests.forEach(t=>wc(t)),this.requests.clear();for(const[t,e]of this.tiles.entries())e.timeoutId&&clearTimeout(e.timeoutId),this.deleteTile(t);this.tiles.clear(),this.engine&&this.engine.reset()}addCanvas(t){const e=t.$info;if(!e)return;if(t.error)return void this.micrio.loading.set(!1);if(!(t.noImage||e.width&&e.height))throw"Invalid Micrio image size";const i=t.$settings;this.isGallery=!!e.gallery||t.isOmni,i.gallery?.archive&&(this.engine.hasArchive=!0,this.engine.archiveLayerOffset=i.gallery.archiveLayerOffset??0),e.version&&parseFloat(e.version)<=3.1&&(this.engine.underzoomLevels=8),e.is360&&(i.limitToCoverScale=!1);const s=!!i.limitToCoverScale,r=s||"cover"==i.initType;t.noImage&&this.micrio.loading.set(!1);const n=[.5,.5],a=i.focus,o=!!e.spacesId;a&&(isNaN(a[0])||null===a[0]||(n[0]=a[0]),isNaN(a[1])||null===a[1]||(n[1]=a[1]));const h=i._360?.video,c=e.is360&&h&&(h.src||"video"in h&&h.video),l=!!this.isGallery&&("switch"==i.gallery?.type||"omni"==i.gallery?.type||"swipe-full"==i.gallery?.type),d=i.omni?.layers?.length??1;i.omni&&(i.omni.layerStartIndex=Math.min(d-1,i.omni?.layerStartIndex??0));const u=new Pc(this.engine,e.width,e.height,t.opacity,s,{tileSize:e.tileSize??1024,is360:e.is360??!1,noImage:t.noImage,isSingle:!(!e.isSingle&&!c),freeMove:i.freeMove??!1,coverStart:r,maxScale:i.zoomLimit||1,scaleMultiplier:!1!==i.zoomLimitDPRFix?this.micrio.canvas.getRatio(t.$settings):1,camSpeed:i.camspeed??1,rotationY:t.camera.rotationY,isGallerySwitch:l,pagesHaveBackground:!!i.gallery?.isSpreads&&"swipe"==i.gallery.type,isOmni:t.isOmni,pinchZoomOutLimit:i.pinchZoomOutLimit??!1,omniNumLayers:d,omniStartLayer:i.omni?.layerStartIndex??0},!1),m=this.nextPtr++;t.ptr=m,this.setEntry(m,{canvas:u,micrioImage:t}),this.images.push(t),this.ptrToImage.set(t.ptr,t),this.cameras.set(t.ptr,t.camera),this.bindCamera(t),t.opts.area&&t.camera.setArea(t.opts.area,{direct:!0,noDispatch:!0,noRender:!0}),i?.restrict&&t.camera.setLimit(i.restrict),i?.crossfadeDuration&&this.setCrossfadeDuration(i.crossfadeDuration),i?.embedFadeDuration&&(this.engine.embedFadeDuration=i.embedFadeDuration),void 0!==i?.dragElasticity&&(this.engine.dragElasticity=i.dragElasticity),i?.skipBaseLevels&&(this.engine.skipBaseLevels=i.skipBaseLevels),i?.omni&&t.camera.setOmniSettings(),this.micrio.hasAttribute("data-limited")&&this.setLimited(t.ptr,!0),u.sendViewport();const g=this.engine.numTiles;if(g>0){const t=g-1;this.getTileEntry(t).opacity=1,this.baseTiles.push(t)}const p=wt(t.state.view)||i.view;!p||0==p[0]&&0==p[1]&&1==p[2]&&1==p[3]?!o&&e.is360||!n||"0.5,0.5"==n.toString()||(u.camera.setCoo(n[0],n[1],0,0,0,!1,0,performance.now()),i.focus=void 0):u.setView(p[0]+p[2]/2,p[1]+p[3]/2,p[2],p[3],!1,!1,!1,!1),t.video.subscribe(t=>t&&t.addEventListener("play",this.render)),t.noImage&&t.visible.set(!0),this.setCanvas(t)}bindCamera(t){const e=this.canvasById.get(t.ptr).canvas;this.cameras.set(t.ptr,t.camera),t.camera.bindEngineCanvas(e),e.is360?t.camera.assign(e.view.arr,e.webgl.coo.arr,e.webgl.coo.arr,e.webgl.iMatrix.arr):t.camera.assign(e.view.arr,e.camera.xy.arr,e.camera.coo.arr,e.webgl.pMatrix.arr)}setCanvas(t){if(t&&!(t.ptr>0&&t.ptr===this.activeCanvasEntry?.micrioImage.ptr))if(t.ptr<0)gn(t.info).then(e=>{e&&this.micrio.$current&&(e.isIIIF||t.opts.secondaryTo||e.id==this.micrio.$current.id)&&(this.addCanvas(t),t.embeds.length&&t.embeds.forEach(e=>this.addEmbed(e,t)))});else if(t.ptr!==this.activeCanvasEntry?.micrioImage.ptr){const e=this.canvasById.get(t.ptr);if(!e)return;const i=t.is360&&this.activeCanvasEntry?this.activeCanvasEntry.canvas.webgl.pitch:0;if(this.activeCanvasEntry=e,t.is360&&!this.preventDirectionSet){const s=(this.engine.direction+.5)%1*Math.PI*2;e.canvas.setDirection(s-t.camera.rotationY,i,!0)}0===e.canvas.targetOpacity&&e.canvas.fadeIn(),t.$settings.omni?.layerStartIndex&&t.state.layer.set(t.$settings.omni.layerStartIndex),this.preventDirectionSet=!1,this.ready=!0,this.render()}}removeCanvas(t){if(t.ptr<0)throw"Canvas is not placed yet";const e=this.canvasById.get(t.ptr);e&&(e.canvas.remove(),this.canvasById.delete(t.ptr),this.render())}render(){this.raf<0&&(this.raf=this.micrio.webgl.display.requestAnimationFrame(this.draw))}draw(t=performance.now()){this.micrio.isConnected&&this.micrio.$current&&(this.raf=-1,this.drawing=!1,this.now=t,(this.engine.shouldDraw(t)||this.micrio.keepRendering||this.micrio.events.isNavigating||!1===this.micrio._current?._video?.paused)&&this.render(),this.isGallery&&this.drawStart(),this.drawnSet.clear(),this.engine.draw(),this.micrio.events.dispatch("draw"),this.cleanup(),this.micrio.webgl.drawEnd())}stop(){this.raf<0||(this.micrio.webgl.display.cancelAnimationFrame(this.raf),this.raf=-1)}getTileEntry(t){let e=this.tiles.get(t);return e||(e={loadState:0,opacity:0},this.tiles.set(t,e)),e}drawTile(t,e,i,s,r,n,a,o){this.drawnSet.add(e);const h=this.getTileEntry(e);h.deleteAt=void 0;const c=vc(),l=this.images[t],d="camera"in l&&l.isVideo,u="camera"in l&&l.is360,m="camera"in l?l:l.image,g="frame"in l?l.frame:void 0;if(0===h.loadState&&c<cc){if(this.bareBone?c>2&&a:o&&a&&c>0)return!1;if(d&&!u)h.loadState=2,h.texture=this.micrio.webgl.getTexture();else{h.loadState=1;const t=m.getTileSrc(i,s,r,g);if(!t)return h.loadState=0,!1;this.getTexture(e,t,a,{noSmoothing:"$info"in l&&l.$settings.noSmoothing})}}else if(h.loadState>=2){if(this.drawing||this.drawStart(),h.texture){if(d){if(!m._video||!m._video.dataset.playing)return!1;this.micrio.webgl.updateTexture(h.texture,m._video)}this.micrio.webgl.drawTile(h.texture,n,u)}return 2===h.loadState&&(h.loadState=3,h.loadedAt=this.now),!0}return!1}drawStart(){this.drawing||(this.micrio.webgl.drawStart(),this.drawing=!0)}getTexture(t,e,i,s={}){if(this.tiles.get(t)?.texture||this.requests.has(t)||!s.force&&vc()>=cc)return;const r=Yh.db.has(e);r||this.micrio.loading.set(!0),this.requests.set(t,e),(r?Yh.getImage(e):pc(e)).then(e=>this.gotTexture(t,e,i,s.noSmoothing)).catch(()=>this.deleteRequest(t))}gotTexture(t,e,i,s){const r=this.getTileEntry(t);r.texture=this.micrio.webgl.getTexture(e,r.texture,s),void 0!==self.ImageBitmap&&e instanceof ImageBitmap&&e.close instanceof Function&&e.close(),r.loadState=2,r.timeoutId=setTimeout(()=>{this.deleteRequest(t)},i?150:50)}deleteRequest(t){this.requests.delete(t);const e=this.tiles.get(t);e?.timeoutId&&(clearTimeout(e.timeoutId),e.timeoutId=void 0),this.requests.size||this.micrio.loading.set(!1)}deleteTile(t){const e=this.tiles.get(t);e&&(e.texture&&this.micrio.webgl.gl.deleteTexture(e.texture),e.timeoutId&&clearTimeout(e.timeoutId),this.tiles.delete(t))}cleanup(){const t=performance.now();for(const e of this.prevDrawnSet){if(this.drawnSet.has(e))continue;if(this.baseTiles.includes(e))continue;const i=this.tiles.get(e);if(i&&0!==i.loadState)switch(i.opacity=0,i.loadState){case 1:const s=this.requests.get(e);s&&wc(s),i.loadState=0;break;case 2:this.requests.has(e)&&this.deleteRequest(e),this.deleteTile(e);break;case 3:i.deleteAt||(i.deleteAt=t)}}this.prevDrawnSet=new Set(this.drawnSet);for(const[e,i]of this.tiles.entries())i.deleteAt&&(t-i.deleteAt)/1e3>this.deleteAfterSeconds&&this.deleteTile(e)}resize(t){this.engine.resize(t.width,t.height,t.left,t.top,t.ratio,t.scale,t.portrait),this.ready&&(this.stop(),this.draw())}addEmbed(t,e,i={}){if("camera"in t&&i.asImage)return this.addImage(t,e,!0,i.opacity??1);{const s="$info"in t?t.$info:e.$info;if(!s)return;this.images.push(t);const r=t.opts.area??[0,0,1,1],n=t instanceof Bh?t.$settings._360??{}:{},a=this.canvasById.get(e.ptr);if(!a)return;const o=a.canvas.addImage(r[0],r[1],r[2],r[3],s.width,s.height,s.tileSize||1024,s.isSingle??!1,s.isVideo??!1,i.opacity??1,n.rotX??0,n.rotY??0,n.rotZ??0,n.scale??1,i.fromScale??0);this.engImageToMicrio.set(o,t);const h=this.nextPtr++;t.ptr=h,this.setEntry(h,{canvas:a.canvas,micrioImage:t}),this.ptrToImage.set(h,t),t.baseTileIdx=this.engine.numTiles-1,this.getTileEntry(t.baseTileIdx).opacity=1,this.baseTiles.push(t.baseTileIdx)}}setActiveImage(t,e,i){this.getCanvas(this.ptrToImage.get(t))?.setActiveImage(e,i??0)}setActiveLayer(t,e){this.getCanvas(this.ptrToImage.get(t))?.setActiveLayer(e)}fadeImage(t,e,i=!1){const s=this.getCanvas(this.ptrToImage.get(t));if(s){if(this.cameras.has(t))s.targetOpacity=e;else{const t=s.images;for(let s=0;s<t.length;s++){const r=t[s];r.localIdx>0&&(r.tOpacity=e,i&&(r.opacity=e))}}this.render()}}setFocus(t,e,i=!1){this.getCanvas(this.ptrToImage.get(t))?.setFocus(e[0],e[1],e[2],e[3],i)}setZIndex(t,e){const i=this.getCanvas(this.ptrToImage.get(t));i&&(i.zIndex=e)}setGridTransitionDuration(t){this.engine.gridTransitionDuration=t}setGridTransitionTimingFunction(t){this.engine.gridTransitionTimingFunction=0===t?Kr:1===t?Qr:2===t?tn:3===t?en:Kr}setCrossfadeDuration(t){this.engine.crossfadeDuration=t}fadeTo(t,e,i){const s=this.getCanvas(this.ptrToImage.get(t));s&&(s.targetOpacity=e,i&&(s.opacity=e))}fadeIn(t){this.getCanvas(this.ptrToImage.get(t))?.fadeIn()}fadeOut(t){this.getCanvas(this.ptrToImage.get(t))?.fadeOut()}areaAnimating(t){return this.getCanvas(this.ptrToImage.get(t))?.areaAnimating()??!1}getActiveImageIdx(t){return this.getCanvas(this.ptrToImage.get(t))?.activeImageIdx??-1}setNoPinchPan(t){this.engine.noPinchPan=t}setIsSwipe(t){this.engine.isSwipe=t}ease(t){return Kr.get(t)}panStart(t){this.getCanvas(this.ptrToImage.get(t))?.kinetic.stop()}panStop(t){this.getCanvas(this.ptrToImage.get(t))?.kinetic.start()}pinchStart(t){this.getCanvas(this.ptrToImage.get(t))?.camera.pinchStart()}pinch(t,e,i,s,r){this.getCanvas(this.ptrToImage.get(t))?.camera.pinch(e,i,s,r)}pinchStop(t,e){this.getCanvas(this.ptrToImage.get(t))?.camera.pinchStop(e)}setLimited(t,e){const i=this.getCanvas(this.ptrToImage.get(t));i&&(i.limited=e)}set360Orientation(t,e,i){this.engine.direction=t,this.engine.distanceX=e,this.engine.distanceY=i}setCanvasArea(t,e){this.engine.el.areaWidth=t,this.engine.el.areaHeight=e}setImageVideoPlaying(t,e){const i=this.getCanvas(this.ptrToImage.get(t));if(!i)return;const s=i.images;for(let r=0;r<s.length;r++)if(s[r].isVideo){s[r].isVideoPlaying=e;break}}},Dc=new Float32Array([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]),zc=class{constructor(t,e,i){if(this.gl=t,this.program=t.createProgram(),e.webgl.getShader(this.program,t.VERTEX_SHADER,"\nattribute vec2 a_position; // Vertex position (-1 to 1)\nattribute vec2 a_texCoord; // Texture coordinate (0 to 1)\n\nvarying vec2 v_texCoord; // Pass texCoord to fragment shader\n\nvoid main() {\n\tv_texCoord = a_texCoord; // Pass through texture coordinate\n\tgl_Position = vec4(a_position, 0.0, 1.0); // Set clip space position\n}"),e.webgl.getShader(this.program,t.FRAGMENT_SHADER,i),t.linkProgram(this.program),t.getProgramParameter(this.program,t.LINK_STATUS)||console.error("Postprocess shader link error:",t.getProgramInfoLog(this.program)),t.useProgram(this.program),this.ppPositionLoc=t.getAttribLocation(this.program,"a_position"),this.ppTexCoordLoc=t.getAttribLocation(this.program,"a_texCoord"),this.ppTimeLoc=t.getUniformLocation(this.program,"u_time"),this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.frameBuffer=t.createFramebuffer(),t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture,0),t.checkFramebufferStatus(t.FRAMEBUFFER)!==t.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer not complete");t.bindFramebuffer(t.FRAMEBUFFER,null),this.quad=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.quad),t.bufferData(t.ARRAY_BUFFER,Dc,t.STATIC_DRAW)}render(){const t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,null),t.useProgram(this.program),t.bindBuffer(t.ARRAY_BUFFER,this.quad),t.enableVertexAttribArray(this.ppPositionLoc),t.vertexAttribPointer(this.ppPositionLoc,2,t.FLOAT,!1,4*Float32Array.BYTES_PER_ELEMENT,0),t.enableVertexAttribArray(this.ppTexCoordLoc),t.vertexAttribPointer(this.ppTexCoordLoc,2,t.FLOAT,!1,4*Float32Array.BYTES_PER_ELEMENT,2*Float32Array.BYTES_PER_ELEMENT),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,this.texture),t.uniform1f(this.ppTimeLoc,performance.now()/1e3),t.drawArrays(t.TRIANGLE_STRIP,0,4)}resize(){const t=this.gl;t.bindTexture(t.TEXTURE_2D,this.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,0,t.RGBA,t.UNSIGNED_BYTE,null),t.bindTexture(t.TEXTURE_2D,null)}dispose(){const t=this.gl;t.deleteFramebuffer(this.frameBuffer),t.deleteTexture(this.texture),t.deleteBuffer(this.quad),t.deleteProgram(this.program)}},Oc=ln.firefox,Rc=`\nprecision mediump float; // Use medium precision for fragment calculations\n\nvarying highp vec2 vTextureCoord; // Received texture coordinate from vertex shader\n\nuniform sampler2D uSampler; // The tile texture\nuniform float opacity; // Tile opacity (for fading)\nuniform int noTexture; // Flag indicating if texture is missing/not loaded\n\nvoid main() {\n\tif(noTexture==1) { // If texture is missing\n\t\tgl_FragColor = vec4(.1,.1,.1,.1); // Draw a placeholder color (dark semi-transparent gray)\n\t} else {\n\t${Oc?"\n\t\t// Firefox premultiplied alpha workaround\n\t\tvec4 textureColor = texture2D(uSampler, vTextureCoord);\n\t\t// Manually apply opacity to RGB based on new alpha\n\t\tfloat newAlpha = min(1., textureColor.a * opacity);\n\t\tgl_FragColor = vec4(textureColor.rgb * newAlpha, newAlpha);":"\n\t\t// Standard alpha blending (premultiplied alpha assumed in blendFunc)\n\t\tgl_FragColor = texture2D(uSampler, vTextureCoord) * opacity;"}\n\t\t// Debug: Draw red instead of texture\n\t\t//gl_FragColor = vec4(1.,0.,0.,1.);\n\t}\n}`,Xc=256,Fc=class{constructor(t){this.micrio=t,this.display=self,this.txtAttr=-1,this.wmTexture=null,this.wmUrl=null,this.wmVerts=new Float32Array([-1,-1,0,1,-1,0,-1,1,0,-1,1,0,1,-1,0,1,1,0]),this.wmUvs=new Float32Array([0,0,0,0,0,0,0,0,0,0,0,0]),this.wmMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.wmOpacity=.075,this.posAttr=-1,this.was360=!1}init(){const t="WebGL2RenderingContext"in window,e=this.micrio.canvas.element.getContext(t?"webgl2":"webgl",{alpha:!0,preserveDrawingBuffer:this.micrio.hasAttribute("data-preserve-drawing-buffer"),stencil:!1,antialias:!1,depth:!1,desynchronized:!1});if(t?!(e instanceof window.WebGL2RenderingContext):!(e instanceof window.WebGLRenderingContext))throw new Nr("WebGL context creation failed",{code:Ir,displayMessage:"Your browser does not support WebGL, which is required to view this content. Please try a different browser."});this.gl=e;const i=this.micrio.$current?.$settings.postProcessingFragmentShader;i&&(this.postpocessor=new zc(e,this.micrio,i),this.micrio.keepRendering=!0);const s=e.createProgram();if(!(s instanceof WebGLProgram))throw new Nr("Failed to create WebGL program",{code:Lr,displayMessage:"There was a problem initializing the graphics. Please try refreshing the page."});this.program=s,this.getShader(this.program,e.VERTEX_SHADER,"\nuniform mat4 GLMatrix; // Combined ModelViewProjection matrix from Engine\n\nattribute vec3 pos; // Vertex position (from Engine buffer)\nattribute vec2 aTextureCoord; // Texture coordinate (from static buffer)\n\nvarying highp vec2 vTextureCoord; // Pass texture coordinate to fragment shader\n\nvoid main()\n{\n\tgl_Position = GLMatrix * vec4(pos, 1.0); // Calculate clip space position\n\tvTextureCoord = aTextureCoord; // Pass through texture coordinate\n}"),this.getShader(this.program,e.FRAGMENT_SHADER,Rc),e.linkProgram(this.program),e.getProgramParameter(this.program,e.LINK_STATUS)||console.error("Main shader link error:",e.getProgramInfoLog(this.program)),e.useProgram(this.program),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.enable(e.BLEND),e.disable(e.DEPTH_TEST),e.clearColor(0,0,0,0);const r=e.getUniformLocation(this.program,"opacity");if(!r)throw new Nr("Failed to bind WebGL opacity uniform",{code:Lr});this.opaLoc=r;const n=e.getUniformLocation(this.program,"GLMatrix");if(!n)throw new Nr("Failed to bind WebGL matrix uniform",{code:Lr});this.pmLoc=n;const a=e.getUniformLocation(this.program,"noTexture");if(!a)throw new Nr("Failed to bind WebGL texture uniform",{code:Lr});this.noTxtLoc=a,this.txtAttr=e.getAttribLocation(this.program,"aTextureCoord");const o=e.createBuffer();if(!o)throw new Nr("Failed to create WebGL texture buffer",{code:Pr,displayMessage:"Your device is low on memory. Try closing other browser tabs or applications."});this.txtBuffer=o,e.bindBuffer(e.ARRAY_BUFFER,this.txtBuffer),e.bufferData(e.ARRAY_BUFFER,Cc._textureBuffer,e.STATIC_DRAW);const h=e.createBuffer();if(!h)throw new Nr("Failed to create WebGL watermark buffer",{code:Pr,displayMessage:"Your device is low on memory. Try closing other browser tabs or applications."});this.wmTxtBuffer=h;const c=e.createBuffer();if(!c)throw new Nr("Failed to create WebGL geometry buffer",{code:Pr,displayMessage:"Your device is low on memory. Try closing other browser tabs or applications."});this.geomBuffer=c,this.posAttr=e.getAttribLocation(this.program,"pos"),this.linkBuffers(),e.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}linkBuffers(){const t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,this.geomBuffer),t.bufferData(t.ARRAY_BUFFER,this.micrio.engine._vertexBuffer,t.DYNAMIC_DRAW),t.enableVertexAttribArray(this.txtAttr),t.bindBuffer(t.ARRAY_BUFFER,this.txtBuffer),t.vertexAttribPointer(this.txtAttr,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(this.posAttr),t.bindBuffer(t.ARRAY_BUFFER,this.geomBuffer),t.vertexAttribPointer(this.posAttr,3,t.FLOAT,!1,0,0)}dispose(t=!1){const e=this.gl;if(e){if(e.bindBuffer(e.ARRAY_BUFFER,null),e.bindTexture(e.TEXTURE_2D,null),e.deleteBuffer(this.txtBuffer),e.deleteBuffer(this.geomBuffer),e.deleteBuffer(this.wmTxtBuffer),e.deleteProgram(this.program),this.postpocessor?.dispose(),this.wmTexture&&e.deleteTexture(this.wmTexture),t){const t=e.getExtension("WEBGL_lose_context");t instanceof Object&&t.loseContext instanceof Function&&t.loseContext()}this.gl=null}}getShader(t,e,i){const s=this.gl.createShader(e);if(!s)throw new Error(`Could not create WebGL shader (type: ${e})`);if(this.gl.shaderSource(s,i),this.gl.compileShader(s),!this.gl.getShaderParameter(s,this.gl.COMPILE_STATUS))throw console.error("Error compiling shader",this.gl.getShaderInfoLog(s)),this.gl.deleteProgram(t),new Error(`Shader compilation failed: ${this.gl.getShaderInfoLog(s)}`);this.gl.attachShader(t,s),this.gl.deleteShader(s)}getTexture(t,e,i){const s=this.gl,r=e??s.createTexture();if(!r)throw new Error("Could not create WebGL texture");return s.bindTexture(s.TEXTURE_2D,r),t&&s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,t),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,i?s.NEAREST:s.LINEAR),r}updateTexture(t,e){const i=this.gl;i.bindTexture(i.TEXTURE_2D,t),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e),i.bindTexture(i.TEXTURE_2D,null)}drawStart(){const t=this.gl;this.postpocessor&&t.bindFramebuffer(t.FRAMEBUFFER,this.postpocessor.frameBuffer),this.gl.clear(this.gl.COLOR_BUFFER_BIT)}drawEnd(){this.postpocessor&&(this.postpocessor.render(),this.gl.useProgram(this.program),this.linkBuffers()),this.wmTexture&&this.drawWatermark()}drawTile(t,e=1,i=!1){this.gl.uniform1i(this.noTxtLoc,t?0:1),this.gl.uniform1f(this.opaLoc,e),t&&(this.gl.activeTexture(this.gl.TEXTURE0),this.gl.bindTexture(this.gl.TEXTURE_2D,t));const s=i?1536:6;i!=this.was360&&(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.txtBuffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,i?Cc._textureBuffer360:Cc._textureBuffer,this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.geomBuffer),this.was360=i),this.gl.bufferData(this.gl.ARRAY_BUFFER,i?this.micrio.engine._vertexBuffer360:this.micrio.engine._vertexBuffer,this.gl.STATIC_DRAW),this.gl.drawArrays(this.gl.TRIANGLES,0,s)}loadWatermark(t,e){if(t===this.wmUrl)return;this.wmUrl=t;const i=new Image;e&&(this.wmOpacity=e),i.crossOrigin="anonymous",i.src=t,i.onload=()=>{const t=document.createElement("canvas");t.width=Xc,t.height=Xc;const e=t.getContext("2d");if(!e)return;const s=Math.min(96/i.width,64/i.height),r=i.width*s,n=i.height*s;e.drawImage(i,(Xc-r)/2,(Xc-n)/2,r,n),this.wmTexture&&this.gl.deleteTexture(this.wmTexture),this.wmTexture=this.getTexture(t);const a=this.gl;a.bindTexture(a.TEXTURE_2D,this.wmTexture),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.REPEAT),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.REPEAT),a.bindTexture(a.TEXTURE_2D,null),this.micrio.engine.render()}}drawWatermark(){const t=this.gl;if(!this.wmTexture)return;t.useProgram(this.program),t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA),t.uniformMatrix4fv(this.pmLoc,!1,this.wmMatrix),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,this.wmTexture),t.uniform1i(this.noTxtLoc,0),t.uniform1f(this.opaLoc,this.wmOpacity);const e=t.drawingBufferWidth/Xc,i=t.drawingBufferHeight/Xc,s=this.wmUvs;s[1]=i,s[2]=e,s[3]=i,s[8]=e,s[9]=i,s[10]=e,t.bindBuffer(t.ARRAY_BUFFER,this.geomBuffer),t.bufferData(t.ARRAY_BUFFER,this.wmVerts,t.DYNAMIC_DRAW),t.vertexAttribPointer(this.posAttr,3,t.FLOAT,!1,0,0),t.bindBuffer(t.ARRAY_BUFFER,this.wmTxtBuffer),t.bufferData(t.ARRAY_BUFFER,this.wmUvs,t.DYNAMIC_DRAW),t.vertexAttribPointer(this.txtAttr,2,t.FLOAT,!1,0,0),t.drawArrays(t.TRIANGLES,0,6),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),this.linkBuffers(),this.was360=!1}},Vc=class{get $isMobile(){return wt(this.isMobile)}constructor(t){this.micrio=t,this.element=document.createElement("canvas"),this.resizing=!1,this.hasPerspective=!1,this.viewport={width:0,height:0,left:0,top:0,ratio:0,scale:0,portrait:!1},this.isMobile=vt(!1),this.getRatio=(t=this.micrio.$current?.$settings??{})=>!ln.iOS&&!t?.noRetina&&self.devicePixelRatio&&Math.max(1,Math.min(2,self.devicePixelRatio))||1,this.onresize=this.onresize.bind(this),self.ResizeObserver&&(this.resizeObserver=new self.ResizeObserver(this.onresize)),this.element.className="micrio"}place(){if(this.element.parentNode)return;const t=this.micrio.querySelector("img.preview");this.micrio.insertBefore(this.element,t?t.nextSibling:this.micrio.firstChild)}hook(){this.onresize(),this.resizeObserver?this.resizeObserver.observe(this.element):window.addEventListener("resize",this.onresize)}unhook(){this.resizeObserver?this.resizeObserver.unobserve(this.element):window.removeEventListener("resize",this.onresize)}onresize(){const t=this.element.getBoundingClientRect();this.micrio.$current?.is360&&(this.hasPerspective=!0);let e=t.width,i=t.height;if(!e||!i)return;const s=self.getComputedStyle(this.element),r=parseFloat(s.width);isNaN(r)||(i=parseFloat(s.height)*e/Math.max(1,r));const n=this.micrio.hasAttribute("data-static")?1:Math.floor(e)/this.micrio.offsetWidth;e/=n,i/=n;const a=1!=n?1:this.getRatio(),o=this.viewport;o.width==e&&o.height==i&&o.ratio==a&&o.scale==n||(this.hasPerspective&&(this.micrio.style.perspective=i/2+"px"),o.width=e,o.height=i,o.ratio=a,o.scale=n,o.top=t.top,o.left=t.left,o.portrait=window.matchMedia("(orientation: portrait)")?.matches??i>e,this.resizing=!0,this.element.width=e*a,this.element.height=i*a,this.micrio.webgl.gl.viewport(0,0,o.width*o.ratio,o.height*o.ratio),this.micrio.webgl.postpocessor?.resize(),this.micrio.engine.resize(o),this.resizing=!1,this.micrio.events.dispatch("resize",t),this.isMobile.set(/mobile/i.test(navigator.userAgent)))}setMargins(t,e){this.micrio.engine.ready&&this.micrio.engine.setCanvasArea(t,e)}},Yc=["move","marker-open","marker-opened","marker-closed","tour-start","tour-step","tour-stop","tour-event","media-play","media-pause","splitscreen-start","splitscreen-stop"],Nc=class{constructor(t){this.ctx=t,this.handleEvent=this.handleEvent.bind(this),this.dispatch=this.dispatch.bind(this)}hook(){Yc.forEach(t=>this.ctx.micrio.addEventListener(t,this.handleEvent))}unhook(){Yc.forEach(t=>this.ctx.micrio.removeEventListener(t,this.handleEvent))}handleEvent(t){if("move"==t.type&&!this.ctx.isPanning()&&!this.ctx.isPinching()&&!this.ctx.isWheeling())return;const e=this.ctx.vars.updates.stack;e[e.length-1]!=t.type&&e.push(t.type),clearTimeout(this.ctx.vars.updates.to),this.ctx.vars.updates.to<0&&(this.ctx.vars.updates.to=setTimeout(this.dispatch))}dispatch(){const t=this.ctx.vars.updates;clearTimeout(t.to),t.to=-1,t.stack.length&&(this.ctx.dispatch("update",t.stack),t.stack.length=0,t.to=setTimeout(this.dispatch,500))}},Bc=class{get $enabled(){return wt(this.enabled)}constructor(t){this.micrio=t,this.enabled=vt(!1),this.hooked=!1,this.panning=!1,this.pinching=!1,this.clicked=!1,this.wheeling=!1,this.controlZoom=!1,this.twoFingerPan=!1,this.pScale=1,this.hasTouch=ln.hasTouch&&"ontouchstart"in self,this.hasUsedCtrl=!1,this.vars={drag:{prev:void 0,start:[0,0,0]},dbltap:{lastTapped:0},pinch:{image:void 0,sDst:0,wasPanning:!1},updates:{to:-1,stack:[]}},this.activePointers=new Map,this.el=t.canvas.element,this.dragHandler=new Gc(this),this.pinchHandler=new jc(this,this.dragHandler),this.pointerPinchHandler=new Zc(this,this.dragHandler),this.gestureHandler=new Jc(this),this.wheelHandler=new Kc(this),this.keyboardHandler=new Qc(this),this.doubleTapHandler=new tl(this),this.updateHandler=new Nc(this),this.enabled.subscribe(t=>{t?this.hook():this.unhook()}),t.visible.subscribe(t=>this.visible=t),t.current.subscribe(t=>{t&&!this.settings&&gn(t.info).then(e=>{e&&(this.settings=t.$settings,!t.error&&this.settings.hookEvents&&this.enabled.set(!0))})})}isEnabled(){return this.$enabled}isPanning(){return this.panning}isPinching(){return this.pinching}setPanning(t){this.panning=t}setPinching(t){this.pinching=t}isWheeling(){return this.wheeling}setWheeling(t){this.wheeling=t}isControlZoom(){return this.controlZoom}isTwoFingerPan(){return this.twoFingerPan}getVisible(){return this.visible}setCapturedPointerId(t){this.capturedPointerId=t}setPinchFactor(t){this.pinchFactor=t}setPScale(t){this.pScale=t}setHasUsedCtrl(t){this.hasUsedCtrl=t}get isNavigating(){return this.panning||this.pinching||this.wheeling||this.clicked}dispatch(t,e){this.micrio.dispatchEvent(new CustomEvent(t,void 0!==e?{detail:e}:void 0))}getImage(t){if(!this.visible)return;const e=this.micrio.offsetWidth,i=this.micrio.offsetHeight,s=Math.max(0,Math.min(1,t.x/e)),r=Math.max(0,Math.min(1,t.y/i)),n=this.visible?.find(t=>!!t.opts.secondaryTo),a=this.visible.filter(t=>!t.noImage),o=1==a.length?a[0]:a.find(({grid:t,opts:{area:e}})=>(!n||!t)&&(!!e&&(s>=e[0]&&s<=e[2]&&r>=e[1]&&r<=e[3])));return o&&o.opts.secondaryTo&&o.opts.isPassive&&o.opts.area&&(t.x-=o.opts.area[0]*e,t.y-=o.opts.area[1]*i),!o||o.grid||o.opts.secondaryTo&&o.opts.isPassive?this.micrio.$current:o}hook(){if(this.hooked)return;this.hooked=!0;const t=this.settings;t&&(this.twoFingerPan=!!t.twoFingerPan,this.twoFingerPan?this.micrio.setAttribute("data-can-pan",""):this.micrio.removeAttribute("data-can-pan"),t?.hookKeys&&this.hookKeys(),t.hookDrag&&this.hookDrag(),t.noZoom||this.hookZoom(),this.hookUpdate())}unhook(){this.hooked&&(this.hooked=!1,this.activePointers.clear(),this.unhookDrag(),this.unhookZoom(),this.unhookKeys(),this.unhookUpdate())}hookKeys(){this.keyboardHandler.hook()}unhookKeys(){this.keyboardHandler.unhook()}hookZoom(){const t=this.settings;this.controlZoom=!!t?.controlZoom,t&&!t.hookPinch||this.hookPinch(),(!t||t.hookScroll||this.controlZoom)&&this.hookScroll(),this.micrio.canvas.$isMobile?this.doubleTapHandler.hookTap():this.doubleTapHandler.hookClick()}unhookZoom(){this.unhookPinch(),this.unhookScroll(),this.micrio.canvas.$isMobile?this.doubleTapHandler.unhookTap():this.doubleTapHandler.unhookClick()}get scrollHooked(){return this.wheelHandler.hooked}hookScroll(){this.wheelHandler.hook()}unhookScroll(){this.wheelHandler.unhook()}hookPinch(){ln.iOS&&this.hasTouch?this.pinchHandler.hook():this.pointerPinchHandler.hook(),this.gestureHandler.hook()}unhookPinch(){ln.iOS&&this.hasTouch?this.pinchHandler.unhook():this.pointerPinchHandler.unhook(),this.gestureHandler.unhook()}hookDrag(){this.dragHandler.hook()}unhookDrag(){this.dragHandler.unhook()}hookUpdate(){this.updateHandler.hook()}unhookUpdate(){this.updateHandler.unhook()}},qc={passive:!0},Wc={passive:!0,capture:!0},Uc={passive:!1};function Hc(t){t.stopPropagation(),t.preventDefault()}var Gc=class{constructor(t){this.ctx=t,this.hooked=!1,this.start=this.start.bind(this),this.move=this.move.bind(this),this.stop=this.stop.bind(this),this.cancel=this.cancel.bind(this)}hook(){this.hooked||(this.hooked=!0,this.ctx.micrio.addEventListener("dragstart",Hc),this.ctx.micrio.addEventListener("pointerdown",this.start,qc),self.addEventListener("pointercancel",this.cancel,qc),this.ctx.micrio.setAttribute("data-hooked",""))}unhook(){this.hooked&&(this.hooked=!1,this.ctx.micrio.removeEventListener("pointerdown",this.start,qc),this.ctx.micrio.removeEventListener("dragstart",Hc),self.removeEventListener("pointercancel",this.cancel,qc),this.ctx.micrio.removeAttribute("data-hooked"))}start(t,e=!1){if(0!=t.button||"touch"==t.pointerType&&this.ctx.isTwoFingerPan())return;if(!(e||t.target==this.ctx.el||t.target instanceof Element&&t.target.closest("[data-scroll-through]")))return;if(this.ctx.micrio.$current?.isOmni&&t.shiftKey)return;if(this.ctx.isPinching())return;if(this.ctx.isPanning())return void(t instanceof TouchEvent&&t.touches.length>1&&this.stop());const i=this.ctx.getImage({x:t.clientX,y:t.clientY});i&&(this.ctx.setPanning(!0),this.ctx.vars.drag.start=[t.clientX,t.clientY,performance.now()],this.ctx.micrio.addEventListener("pointermove",this.move,qc),this.ctx.micrio.addEventListener("pointerup",this.stop,qc),this.ctx.micrio.setAttribute("data-panning",""),this.ctx.micrio.engine.panStart(i.ptr),this.ctx.micrio.engine.render(),this.ctx.dispatch("panstart"))}move(t){const e=t.clientX,i=t.clientY,s=Math.hypot(this.ctx.vars.drag.start[0]-t.clientX,this.ctx.vars.drag.start[1]-t.clientY);!this.ctx.capturedPointerId&&s>10&&(this.ctx.setCapturedPointerId(t.pointerId),this.ctx.micrio.setPointerCapture(t.pointerId)),this.ctx.vars.drag.prev&&this.ctx.getImage({x:e,y:i})?.camera.pan(this.ctx.vars.drag.prev[0]-e,this.ctx.vars.drag.prev[1]-i),this.ctx.vars.drag.prev=[e,i]}stop(t,e=!1,i=!1){if(this.ctx.isPanning()){if(this.ctx.setPanning(!1),this.ctx.vars.drag.prev=void 0,this.ctx.micrio.removeEventListener("pointermove",this.move,qc),this.ctx.micrio.removeEventListener("pointerup",this.stop,qc),this.ctx.capturedPointerId&&this.ctx.micrio.releasePointerCapture(this.ctx.capturedPointerId),this.ctx.setCapturedPointerId(void 0),this.ctx.micrio.removeAttribute("data-panning"),t&&0==e){const e=this.ctx.getImage({x:t.clientX,y:t.clientY});e&&(this.ctx.micrio.engine.panStop(e.ptr),this.ctx.micrio.engine.render())}i||this.ctx.dispatch("panend",t?{duration:performance.now()-this.ctx.vars.drag.start[2],movedX:t.clientX-this.ctx.vars.drag.start[0],movedY:t.clientY-this.ctx.vars.drag.start[1]}:void 0)}}cancel(t){this.ctx.isPanning()&&(void 0!==this.ctx.capturedPointerId&&t.pointerId!==this.ctx.capturedPointerId||this.stop(void 0,!0,!0))}},jc=class{constructor(t,e){this.ctx=t,this.dragHandler=e,this.start=this.start.bind(this),this.move=this.move.bind(this),this.stop=this.stop.bind(this)}hook(){ln.iOS&&this.ctx.hasTouch&&this.ctx.micrio.addEventListener("touchstart",this.start,qc)}unhook(){ln.iOS&&this.ctx.hasTouch&&this.ctx.micrio.removeEventListener("touchstart",this.start,qc),self.removeEventListener("touchmove",this.move,Wc),self.removeEventListener("touchend",this.stop,Wc)}start(t){if(!(ln.hasTouch&&t instanceof TouchEvent))return;if(this.ctx.isTwoFingerPan()&&t.touches.length<2)return;if(this.ctx.isPinching()||2!=t.touches.length)return void this.stop(t);t.stopPropagation(),this.ctx.vars.pinch.wasPanning=this.ctx.isPanning(),this.dragHandler.stop(void 0,!1,!0);const e=t.touches;this.ctx.setPinching(!0),self.addEventListener("touchmove",this.move,Wc),self.addEventListener("touchend",this.stop,Wc),this.ctx.micrio.setAttribute("data-pinching",""),this.ctx.vars.pinch.image=this.ctx.getImage({x:e[0].clientX,y:e[0].clientY}),this.ctx.vars.pinch.sDst=Math.hypot(e[0].clientX-e[1].clientX,e[0].clientY-e[1].clientY),this.ctx.setPinchFactor(void 0),this.ctx.vars.pinch.image&&this.ctx.micrio.engine.pinchStart(this.ctx.vars.pinch.image.ptr),this.ctx.micrio.engine.render(),this.ctx.dispatch("pinchstart"),this.ctx.isTwoFingerPan()&&this.ctx.dispatch("panstart")}move(t){if(!(ln.hasTouch&&t instanceof TouchEvent))return;const e=t.touches;if(e?.length<2)return;const i={x:e[0].clientX,y:e[0].clientY},s={x:e[1].clientX,y:e[1].clientY},r=this.ctx.vars.pinch,n=r.image;if(n){if(n?.opts.secondaryTo&&n.opts.isPassive&&n.opts.area){const t=n.opts.area[0]*this.ctx.micrio.offsetWidth,e=n.opts.area[1]*this.ctx.micrio.offsetHeight;i.x-=t,s.x-=t,i.y-=e,s.y-=e}this.ctx.setPinchFactor(Math.hypot(e[0].clientX-e[1].clientX,e[0].clientY-e[1].clientY)/r.sDst),this.ctx.micrio.engine.pinch(n.ptr,i.x,i.y,s.x,s.y)}}stop(t){if(!this.ctx.isPinching())return;this.ctx.setPinching(!1),self.removeEventListener("touchmove",this.move,Wc),self.removeEventListener("touchend",this.stop,Wc),this.ctx.micrio.removeAttribute("data-pinching");const e=this.ctx.vars.pinch.image;e&&(this.ctx.micrio.engine.pinchStop(e.ptr,performance.now()),this.ctx.micrio.engine.render()),this.ctx.vars.pinch.image=void 0,this.ctx.setPinchFactor(void 0),this.ctx.dispatch("pinchend"),this.ctx.isTwoFingerPan()&&!this.ctx.vars.pinch.wasPanning&&this.ctx.dispatch("panend"),t instanceof TouchEvent&&1==t.touches.length&&this.dragHandler.start(t,!0)}},Zc=class{constructor(t,e){this.ctx=t,this.dragHandler=e,this.start=this.start.bind(this),this.move=this.move.bind(this),this.end=this.end.bind(this)}hook(){this.ctx.micrio.addEventListener("pointerdown",this.start,qc),self.addEventListener("pointerup",this.end,qc),self.addEventListener("pointercancel",this.end,qc)}unhook(){this.ctx.micrio.removeEventListener("pointerdown",this.start,qc),self.removeEventListener("pointerup",this.end,qc),self.removeEventListener("pointercancel",this.end,qc),self.removeEventListener("pointermove",this.move,Wc),this.ctx.activePointers.clear()}start(t){if("touch"===t.pointerType&&(this.ctx.activePointers.set(t.pointerId,{x:t.clientX,y:t.clientY}),2===this.ctx.activePointers.size&&!this.ctx.isPinching())){this.ctx.vars.pinch.wasPanning=this.ctx.isPanning(),this.dragHandler.stop(void 0,!1,!0),this.ctx.setPinching(!0),self.addEventListener("pointermove",this.move,Wc),this.ctx.micrio.setAttribute("data-pinching","");const t=Array.from(this.ctx.activePointers.values()),e=t[0],i=t[1];this.ctx.vars.pinch.image=this.ctx.getImage({x:e.x,y:e.y}),this.ctx.vars.pinch.sDst=Math.hypot(e.x-i.x,e.y-i.y),this.ctx.setPinchFactor(void 0),this.ctx.vars.pinch.image&&this.ctx.micrio.engine.pinchStart(this.ctx.vars.pinch.image.ptr),this.ctx.micrio.engine.render(),this.ctx.dispatch("pinchstart"),this.ctx.isTwoFingerPan()&&this.ctx.dispatch("panstart")}}move(t){if("touch"!==t.pointerType)return;if(!this.ctx.activePointers.has(t.pointerId))return;if(this.ctx.activePointers.set(t.pointerId,{x:t.clientX,y:t.clientY}),!this.ctx.isPinching()||2!==this.ctx.activePointers.size)return;const e=Array.from(this.ctx.activePointers.values()),i=e[0],s=e[1],r=this.ctx.vars.pinch,n=r.image;if(!n)return;const a={x:i.x,y:i.y},o={x:s.x,y:s.y};if(n?.opts.secondaryTo&&n.opts.isPassive&&n.opts.area){const t=n.opts.area[0]*this.ctx.micrio.offsetWidth,e=n.opts.area[1]*this.ctx.micrio.offsetHeight;a.x-=t,o.x-=t,a.y-=e,o.y-=e}this.ctx.setPinchFactor(Math.hypot(i.x-s.x,i.y-s.y)/r.sDst),this.ctx.micrio.engine.pinch(n.ptr,a.x,a.y,o.x,o.y)}end(t){if("touch"===t.pointerType&&(this.ctx.activePointers.delete(t.pointerId),this.ctx.isPinching()&&this.ctx.activePointers.size<2)){this.ctx.setPinching(!1),self.removeEventListener("pointermove",this.move,Wc),this.ctx.micrio.removeAttribute("data-pinching");const t=this.ctx.vars.pinch.image;if(t&&(this.ctx.micrio.engine.pinchStop(t.ptr,performance.now()),this.ctx.micrio.engine.render()),this.ctx.vars.pinch.image=void 0,this.ctx.setPinchFactor(void 0),this.ctx.dispatch("pinchend"),this.ctx.isTwoFingerPan()&&!this.ctx.vars.pinch.wasPanning&&this.ctx.dispatch("panend"),1===this.ctx.activePointers.size){const t=Array.from(this.ctx.activePointers.entries())[0],e={button:0,pointerType:"touch",target:this.ctx.el,clientX:t[1].x,clientY:t[1].y,pointerId:t[0]};this.dragHandler.start(e,!0)}}}},Jc=class{constructor(t){this.ctx=t,this.handle=this.handle.bind(this)}hook(){ln.OSX&&(this.ctx.micrio.addEventListener("gesturestart",this.handle,Uc),this.ctx.micrio.addEventListener("gesturechange",this.handle,Uc),this.ctx.micrio.addEventListener("gestureend",this.handle,Uc))}unhook(){ln.OSX&&(this.ctx.micrio.removeEventListener("gesturestart",this.handle,Uc),this.ctx.micrio.removeEventListener("gesturechange",this.handle,Uc),this.ctx.micrio.removeEventListener("gestureend",this.handle,Uc))}getGestureEvent(t){if("scale"in t&&"number"==typeof t.scale){const e=t;return{scale:e.scale,clientX:e.clientX,clientY:e.clientY}}return null}handle(t){const e=this.getGestureEvent(t);if(!e||1===e.scale)return;const i=this.ctx.pScale-e.scale;this.ctx.setPScale(e.scale),t.stopPropagation(),t.preventDefault(),"gesturechange"==t.type&&this.ctx.getImage({x:e.clientX,y:e.clientY})?.camera.zoom(i*this.ctx.micrio.canvas.viewport.height,0,e.clientX,e.clientY)}},Kc=class{constructor(t){this.ctx=t,this.hooked=!1,this.wheelEndTo=-1,this.handle=this.handle.bind(this),this.end=this.end.bind(this)}hook(){this.hooked||(this.ctx.micrio.addEventListener("wheel",this.handle,Uc),this.hooked=!0)}unhook(){this.ctx.micrio.removeEventListener("wheel",this.handle,Uc),this.hooked=!1}handle(t,e=!1,i=0){if(!(t instanceof WheelEvent))return;if(this.ctx.isControlZoom()&&!t.ctrlKey)return;if(!e&&t.target instanceof Element&&t.target!=this.ctx.el&&!t.target.classList.contains("marker")&&!t.target.closest("[data-scroll-through]"))return;let s=t.deltaY;t.ctrlKey&&this.ctx.setHasUsedCtrl(!0);const r=this.ctx.isControlZoom()&&10*s%1==0,n=this.ctx.hasUsedCtrl&&!r,a=ln.firefox||t.ctrlKey||!n;if(this.ctx.isTwoFingerPan()&&this.ctx.micrio.$current?.camera.isZoomedOut())return;t.stopPropagation(),t.preventDefault(),(ln.OSX||n)&&t.ctrlKey&&(s*=10);const o={x:t.clientX,y:t.clientY},h=this.ctx.getImage(o);if(h){if(a){const t=this.ctx.micrio.canvas.viewport;let e=0;const r=this.ctx.micrio.getBoundingClientRect();h.camera.zoom(1*s/Math.sqrt(t.scale),0,o.x-i-r.left,o.y-r.top-e)}else h.camera.pan(t.deltaX,t.deltaY);this.ctx.setWheeling(!0),clearTimeout(this.wheelEndTo),this.wheelEndTo=setTimeout(this.end,50)}}end(){this.ctx.setWheeling(!1)}},Qc=class{constructor(t){this.ctx=t,this.handle=this.handle.bind(this)}hook(){document.addEventListener("keydown",this.handle)}unhook(){document.removeEventListener("keydown",this.handle)}handle(t){if(this.ctx.isPanning()||this.ctx.isPinching()||!this.ctx.micrio.$current?.camera)return;const e=this.ctx.micrio.$current.camera,i=this.ctx.micrio.offsetWidth/2,s=this.ctx.micrio.offsetHeight/2;let r=0,n=0;switch(t.key){case"ArrowUp":n-=s;break;case"ArrowDown":n+=s;break;case"ArrowLeft":r-=i;break;case"ArrowRight":r+=i;break;case"+":case"=":e.zoom(-200,150).catch(()=>{});break;case"-":case"_":e.zoom(200,150).catch(()=>{});break;default:return}t.preventDefault(),t.stopPropagation(),0==r&&0==n||e.pan(r,n,150)}},tl=class{constructor(t){this.ctx=t,this.tap=this.tap.bind(this),this.click=this.click.bind(this)}hookTap(){this.ctx.el.addEventListener("touchstart",this.tap)}unhookTap(){this.ctx.el.removeEventListener("touchstart",this.tap)}hookClick(){this.ctx.el.addEventListener("dblclick",this.click)}unhookClick(){this.ctx.el.removeEventListener("dblclick",this.click)}tap(t){if(!(ln.hasTouch&&t instanceof TouchEvent))return;const e=performance.now();1==t.touches.length&&e-this.ctx.vars.dbltap.lastTapped<250&&(t.stopPropagation(),t.preventDefault(),this.click(t)),this.ctx.vars.dbltap.lastTapped=e}click(t){const e=t instanceof TouchEvent?t.touches[0]:t;this.ctx.getImage({x:e.clientX,y:e.clientY})?.camera.zoom(-300,500,e.clientX,e.clientY,1,!this.ctx.micrio.$current?.album).catch(()=>{})}},el=class t{static{this.events=["load","tour-start","tour-stop","marker-open","marker-closed","page-open","page-closed","lang-switch"]}constructor(t){this.micrio=t,this.isStatic=!1,this.loaded=!1,this.inited=!1,this.setting=!1,this.writeTitle=!1}hook(){this.isStatic="static"==this.micrio.getAttribute("data-router"),this.read=this.read.bind(this),this.write=this.write.bind(this),this.writeDeferred=this.writeDeferred.bind(this),gn(this.micrio.current).then(()=>{this.loaded=!0,this.read()}),t.events.forEach(t=>this.micrio.addEventListener(t,this.write)),location.hostname==`viewer.${En}`&&(this.writeTitle=!0),window.addEventListener(this.isStatic?"popstate":"hashchange",this.read)}unhook(){t.events.forEach(t=>this.micrio.removeEventListener(t,this.write)),window.removeEventListener(this.isStatic?"popstate":"hashchange",this.read)}findPage(t,e,i){if(e)for(let s=0;s<e.length;s++){let r=on((e[s]?.i18n?.[i]??e[s]).title)==t?e[s]:this.findPage(t,e[s].children,i);if(r)return r}}read(){if(!this.loaded||this.setting)return;this.route=(this.isStatic?location.pathname:location.hash).slice(1);const[t,e,i,s,r]=this.route.split("/"),n=this.micrio.$current,a=t&&n?.id!=t?this.micrio.open(t):void 0;n&&Promise.all([gn(n.data,{allowUndefined:!0}),a?gn(a.data,{allowUndefined:!0}):void 0]).then(t=>{if(!t[0])return this.inited=!0;if(void 0===this.prevLang&&(this.prevLang=this.micrio.lang),!1===a?.$settings.routerMarkerTours)return;if(t[0].pages?.length&&s){const i=this.findPage(s.toLowerCase(),t[0].pages,e);if(i)return void this.micrio.state.popover.set({contentPage:i})}const i=s?r?t.map(t=>t?.markerTours?.find(t=>on(t.i18n?.[e]?.slug)==s))[0]:t.map(t=>t?.tours?.find(t=>on(t.i18n?.[e]?.slug)==s))[0]:void 0,o=r||!i&&s,h=o?(t[1]??t[0]).markers?.find(t=>(t.i18n?.[e]?.slug??on(t.title))==o||i&&"steps"in i&&i.stepInfo?.map(t=>t.marker).find(t=>t.i18n?.[e]?.slug==o)):void 0;h&&i&&"steps"in i?i.initialStep=Math.max(0,i.steps.findIndex(t=>t.startsWith(h.id))):(h||this.micrio.state.popup.set(void 0),(a??n).state.marker.set(h)),this.micrio.state.tour.set(i),this.writeTitle&&this.setTitle(),this.inited=!0})}setTitle(){const t=wt(this.micrio._lang),e=this.micrio.$current;if(!e)return;const i=[e.$data?.i18n?.[t]?.title??e?.$info?.title,this.micrio.state.$tour?.i18n?.[t]?.title,this.micrio.state.$marker?.i18n?.[t]?.title].filter(t=>!!t).reverse();document.title=i.join(" - ")+" | Micrio"}write(t){if(this.micrio.$current&&this.loaded&&this.inited){if("marker-open"===t.type){const t=this.micrio.state.$marker;if(t&&t.data&&t.data.micrioLink)return}clearTimeout(this._to),this._to=setTimeout(()=>this.writeDeferred("load"==t.type),50)}}writeDeferred(t){const e=this.micrio.state.$tour;let i=this.micrio.$current,s=i?.state.$marker;const r=this.micrio.lang;r!=this.prevLang&&(t=!0,this.prevLang=r);const n=i?.$data?.i18n?.[r]?.title??i?.$info?.title??"",a=!1===i?.$settings.routerMarkerTours,o=s&&"string"!=typeof s?s.i18n?.[r]??s:void 0,h=wt(this.micrio.state.popover)?.contentPage,c=h?h.i18n?.[r]??h:void 0;let l=i?.id;if(e&&"steps"in e&&e.steps.length&&e.stepInfo){const t=e.stepInfo.find(t=>t.markerId==e.steps.find(t=>!t.includes(",")));t&&(l=t.micrioId,i=this.micrio.engine.images.find(t=>t.id==l),s||void 0===e.initialStep||(s=e.stepInfo[Math.max(0,e.initialStep)].marker))}const d=[l,r,on(n)??"",...a?[]:c?[on(c.title)]:[e?.i18n?.[r]?.slug??null,o?.slug??on(o?.title)??null]].filter(t=>!!t).join("/");d!=this.route&&(this.setting=!0,this.isStatic?t?history.replaceState(null,"","/"+d+location.search):history.pushState(null,"","/"+d+location.search):location.hash=d,this.route=d,this.writeTitle&&this.setTitle(),setTimeout(()=>this.setting=!1,250))}},il=class t{static{this.events=["load","show","hide","marker-open","marker-opened","marker-closed","tour-start","tour-stop","tour-step","tour-ended"]}constructor(t){this.micrio=t,this.gtag="gtag"in window?window.gtag:void 0,this.hooked=!1,this.tag=this.tag.bind(this)}hook(){!this.hooked&&this.gtag&&(this.hooked=!0,this.tag(new CustomEvent("init")),t.events.forEach(t=>this.micrio.addEventListener(t,this.tag)))}unhook(){this.hooked&&(this.hooked=!1,this.tag(new CustomEvent("hide")),t.events.forEach(t=>this.micrio.removeEventListener(t,this.tag)))}tag(t){if(!this.gtag)return;const e=t.detail,i=this.micrio.$current,s={event_category:"Micrio",event_action:t.type};this.micrio.lang&&(s.culture=this.micrio.lang),"init"==t.type&&(s.micrio_version=Mn),"load"==t.type&&i?.$info&&(s.image_version=i.$info.version);const r=null!==e&&"object"==typeof e&&"currentStep"in e?e.currentStep:null;null!=r&&(s.event_value=r);const n=e&&e.title?e.title:i&&i.$info&&i.$info.title;s.event_label=this.micrio.id+(n?" - "+n:""),this.gtag("event",t.type,s)}},sl=t=>Math.round(1e5*t)/1e5,rl=class t{static{this.getString=(t,e)=>[t.id,t.width,t.height,t.isDeepZoom?"d":"",t.isPng?"p":t.isWebP?"w":"",e.view?.map(sl).join("/"),e.area?.map(sl).join("/"),t.settings?.focus?.map(sl).join("-"),e.cultures].join(",").replace(/,+$/,"")+(e.size?`|${e.size.join(",")}`:"")}get $focussed(){return wt(this.focussed)}constructor(e,i){this.micrio=e,this.image=i,this.images=[],this.imageMap=new Map,this.current=[],this._grid=document.createElement("div"),this._buttons=new Map,this.clickable=!1,this.focussed=vt(),this.markersShown=vt([]),this.history=[],this.depth=vt(0),this.aniDurationIn=1.5,this.aniDurationOut=.5,this.transitionDelay=.5,this.isHorizontal=!1,this.cellSizes=new Map,this.nextSize=new Map,this.timingFunction="ease",this.getString=(e,i={})=>t.getString(e,{view:i.view,area:i.area,size:i.size??this.nextSize.get(e.id),cultures:("cultures"in e&&e.cultures?e.cultures:"")?.replace(/,/g,"-")}),this.actionHandlers={[Yo.Grid.GridActionType.focus]:(t,e)=>{const i=t?.split("|").map(t=>t.trim()),s=(i?.[0]??"").split(",").map(t=>this.imageMap.get(t.trim())).filter(t=>void 0!==t);1==s.length?this.focus(s[0],{duration:e}):s.length>0&&this.set(s.map(t=>this.getString(t.$info)).join(";"),{duration:e,horizontal:"h"==i?.[1]})},[Yo.Grid.GridActionType.flyTo]:(t,e)=>{const i=t?.split(",").map(t=>this.current.find(e=>e.id==t?.trim()));i?.length?this.image.camera.flyToView([Math.min(...i.map(t=>t?.opts.area?.[0]??0)),Math.min(...i.map(t=>t?.opts.area?.[1]??0)),Math.max(...i.map(t=>t?.opts.area?.[2]??1)),Math.max(...i.map(t=>t?.opts.area?.[3]??1))],{duration:e?1e3*e:void 0}).catch(()=>{}):console.warn("Given image IDs gave no current displayed images")},[Yo.Grid.GridActionType.focusTagged]:(t,e)=>{this.flyToMarkers(t,e)},[Yo.Grid.GridActionType.focusWithTagged]:(t,e)=>{this.flyToMarkers(t,e,!0)},[Yo.Grid.GridActionType.reset]:(t,e)=>{this.reset(e)},[Yo.Grid.GridActionType.back]:(t,e)=>{this.back(e)},[Yo.Grid.GridActionType.switchToGrid]:()=>{this.switchToGrid()},[Yo.Grid.GridActionType.nextFadeDuration]:t=>{this.nextCrossFadeDuration=Number(t)},[Yo.Grid.GridActionType.filterTourImages]:(t,e)=>{gn(this.micrio.state.tour).then(i=>{if(!i)return;if(!("steps"in i)||!i.stepInfo)return;const s=i.stepInfo.map(t=>t.micrioId),r=s.filter((t,e)=>s.indexOf(t)==e).map(t=>this.imageMap.get(t)).filter(t=>!!t).map(t=>this.getString(t.$info)).join(";");r&&this.set(r,{duration:e,horizontal:"h"==t})})}},this.tourEvent=this.tourEvent.bind(this),this.updateGrid=this.updateGrid.bind(this);const s=i.$settings;this.clickable=!!s.gridClickable,void 0!==s.gridTransitionDuration&&(this.aniDurationIn=this.aniDurationOut=s.gridTransitionDuration),void 0!==s.gridTransitionDurationOut&&(this.aniDurationOut=s.gridTransitionDurationOut),this._grid.className="micrio-grid",this.set(i.$info?.grid);const r=()=>Si().then(()=>{this.hook(),e.events.dispatch("grid-load")});i.isV5?r():e._lang.subscribe(t=>{t?Promise.all(this.images.filter(e=>(e.$info&&"cultures"in e.$info&&e.$info?.cultures||"").indexOf(t)>=0).map(t=>gn(t.data))).then(r):r()}),e.events.dispatch("grid-init",this)}hook(){if(this.micrio.state.marker.subscribe(t=>{if(t&&"string"!=typeof t){const e=t.data?._meta;if(e?.gridSize){const i="number"==typeof e.gridSize?[e.gridSize,e.gridSize]:e.gridSize.split(",").map(Number),s=this.images.find(e=>e.$data?.markers?.find(e=>e==t))?.id;s&&this.nextSize.set(s,i)}Si().then(()=>{const t=e?.gridAction?.split("|");t?.length&&"string"==typeof t[0]&&this.action(t.shift(),t.join("|"))})}}),this.clickable){this._grid.addEventListener("click",t=>{const e=t.target.dataset.id;e&&this.focus(this.imageMap.get(e))});const t=t=>{t?this.removeGrid():this.placeGrid()};this.micrio.state.tour.subscribe(t),this.micrio.state.marker.subscribe(t),this.focussed.subscribe(t)}this.micrio.addEventListener("tour-event",this.tourEvent),this.micrio.addEventListener("serialtour-pause",()=>this.images.forEach(t=>t.camera.pause())),this.micrio.addEventListener("serialtour-play",()=>this.images.forEach(t=>t.camera.resume()))}clearTimeouts(){clearTimeout(this._to),clearTimeout(this._fadeTo)}trackImage(t){this.images.push(t),this.imageMap.set(t.id,t)}parseInput(t){return"string"!=typeof t&&(t=t.map(t=>t instanceof Bh?{image:t}:t).filter(t=>!!t.image.$info).map(t=>this.getString(t.image.$info,t)).join(";")),t.split(";").filter(t=>!!t).map(t=>this.getImage(t))}setupBehindTransition(t,e,i){const s="behind-delayed"==e.transition,r=!0===e.coverLimit,{engine:n}=this.micrio;e.forceAni=!0,e.coverLimit=r,e.forceAreaAni=!0;const a=s?1/t.length:1;let o=0;this.images.forEach(e=>{e.camera.setCoverLimit(r),t.find(t=>t.id==e.id)&&(e.camera.setArea([0,0,i?.id==e.id?1:a,1],{noDispatch:!0,direct:!0}),e!=i&&e.camera.setView([0,0,1,1]),s&&n.setZIndex(e.ptr,t.length-o++))}),t.forEach(t=>t.view=[0,0,1,1])}savePreviousLayout(){this.depth.set(this.history.push({layout:this.current.map(t=>this.getString(t.$info,{view:t.state.$view,size:this.cellSizes.get(t.id)})).join(";"),horizontal:this.isHorizontal,view:this.image.camera.getView()}))}set(t="",e={}){return this.lastPromise=new Promise((i,s)=>{delete this.image.$info?.settings?.focus,this.lastAction=void 0,!1===e.cover&&e.coverLimit&&(e.coverLimit=!1),e.coverLimit&&null==e.cover&&(e.cover=e.coverLimit);const r=this.parseInput(t),n=this.$focussed,a=e.transition?.endsWith("-delayed"),o="behind-delayed"==e.transition,{engine:h}=this.micrio;"crossfade"==e.transition?e.duration=0:"behind"!=e.transition&&"behind-delayed"!=e.transition||this.setupBehindTransition(r,e,n);const c=this.image.ptr>=0,l=e.duration??(e.noHistory?this.aniDurationOut:this.aniDurationIn),d=this.nextCrossFadeDuration??this.image.$settings.crossfadeDuration??1,u=(l||this.aniDurationIn)/(o?2:1);this.nextCrossFadeDuration=void 0,c&&(h.setGridTransitionDuration(l),h.setCrossfadeDuration(u));const m=!e.noBlur&&n;m&&this.blur(),!e.noHistory&&this.current.length&&this.savePreviousLayout(),this.isHorizontal=!!e.horizontal,this.removeImages(this.images.filter(t=>!r.find(e=>e.id==t.id))),this.printGrid(r,{horizontal:e.horizontal,keepGrid:e.keepGrid,scale:e.scale,columns:e.columns}),this.clearTimeouts();let g=!1;const p=()=>{this.clearTimeouts(),g||s()};c&&!e.noCamAni&&(e.view?this.image.camera.flyToView(e.view,{duration:1e3*l}).catch(p):this.image.camera.flyToFullView({duration:1e3*l}).catch(p)),this.nextSize.clear(),null==e.coverLimit&&(e.coverLimit=!0),e.coverLimit||r.forEach(t=>this.imageMap.get(t.id)?.camera.setCoverLimit(!1));const f="appear-delayed"==e.transition,v=t=>t*this.transitionDelay+(t>0&&f?l:0);this.current=r.map((t,i)=>this.placeImage(t,{duration:!e.forceAni&&m&&t.id!=n?.id?0:l,delay:a?v(i):0,noCamAni:!!(f&&i>0)||!!e.noCamAni,forceAreaAni:!(f&&i>0)&&e.forceAreaAni,cover:e.cover})),f&&this.current.slice(1).forEach(t=>h.fadeTo(t.ptr,.9999,!0));const w=()=>this.current.forEach((t,e)=>dn(a?1e3*(v(e)+(o?l/2:0)):0).then(()=>h.fadeIn(t.ptr))),y=()=>{this.clearTimeouts(),requestAnimationFrame(()=>h.setCrossfadeDuration(d)),a&&this.images.forEach(t=>h.setZIndex(t.ptr,0)),e.coverLimit&&r.forEach(t=>this.imageMap.get(t.id)?.camera.setCoverLimit(!0)),this.clickable&&this.placeGrid(),this.lastAction=void 0,g=!0,i(this.current)};l||u?(e.noFade||(this._fadeTo=setTimeout(w,Math.max(0,l/2*1e3))),this._to=setTimeout(y,1e3*(Math.max(u,l)+(a?(r.length-1)*this.transitionDelay:0)))):(e.noFade||w(),y())})}hasChanged(){return this.current.length!==this.images.length||this.current.some((t,e)=>t.id!==this.images[e].id)}getImage(t){const e=t.split("|"),i=e[0].split(","),s=e[1]?e[1].split(",").map(Number):[1];let r=0,n=0;return{path:this.image.$info?.path,id:i[0],width:r=Number(i[1])||r,height:n=Number(i[2])||n,isDeepZoom:"d"==i[3],isPng:"p"==i[4],isWebP:"w"==i[4],size:s,view:i[5]?i[5].split("/").map(Number):void 0,area:i[6]?i[6].split("/").map(Number):void 0,settings:rn(this.image.$settings||{},{focus:i[7]?i[7].split("-").map(Number):void 0}),cultures:i[8]?.replace(/-/g,",")||void 0}}getCols(t,e){let i=Math.ceil(e/Math.ceil(Math.sqrt(e)));if(t==e){const e=Math.floor(Math.sqrt(t)),s=[];for(let r=e;r<i+e;r++)t%r||s.push(r);s.length&&(i=s[Math.floor(s.length/2)])}return i}printGrid(t,e){e.keepGrid||this.removeGrid();const i=t.reduce((t,e)=>t+e.size[0]*(e.size[1]??1),0),s=e.columns??(e.horizontal?t.length:this.getCols(t.length,i));this._grid.style.gridTemplateColumns=`repeat(${s}, auto)`,this._grid.textContent="",this._grid.style.removeProperty("--translate"),this._grid.style.removeProperty("--scale"),t.forEach(t=>{if(!t.id)return;this._buttons.has(t.id)||this._buttons.set(t.id,document.createElement("button"));const e=this._buttons.get(t.id);"1"!=t.size.toString()?(e.style.gridArea=`auto / auto / span ${t.size[1]} / span ${t.size[0]||t.size[1]}`,this.cellSizes.set(t.id,t.size)):(e.style.removeProperty("grid-area"),this.cellSizes.delete(t.id)),e.dataset.id=t.id,this._grid.appendChild(e)}),e.keepGrid&&this._grid.parentNode||this.micrio.insertBefore(this._grid,this.micrio.firstChild?.nextSibling??null),this.micrio.events.dispatch("grid-layout-set",this);const r=this.micrio.offsetWidth,n=this.micrio.offsetHeight,a=Math.max(0,Math.min(1,1-(e.scale??1)));this._grid.style.transform="",this._grid.childNodes.forEach(e=>{if(!e)return;const i=e,s=i.dataset.id,o=i.getBoundingClientRect(),h=t.find(t=>t.id==s),c=[a/2*o.width,a/2*o.height];h&&!h.area&&(h.area=[(o.x+c[0])/r,(o.y+c[1])/n,(o.x+o.width-c[0])/r,(o.y+o.height-c[1])/n])}),e.keepGrid||this._grid.remove()}placeGrid(){!this.clickable||this.micrio.state.$tour||this.micrio.state.$marker||this._grid.parentNode||(this.micrio.insertBefore(this._grid,this.micrio.firstChild?.nextSibling??null),this.viewUnsub=this.image.state.view.subscribe(this.updateGrid))}removeGrid(){this._grid.parentNode&&(this.viewUnsub&&this.viewUnsub(),this._grid.remove())}updateGrid(){const t=this.image.camera.getXY(0,0,!0);this._grid.style.setProperty("--translate",`translate3d(${t[0]}px, ${t[1]}px, 0)`),this._grid.style.setProperty("--scale",this.image.camera.getScale().toString()),this._grid.dispatchEvent(new CustomEvent("update"))}placeImage(t,e){const{engine:i}=this.micrio;let s=this.imageMap.get(t.id);s&&t.area?dn(1e3*e.delay).then(()=>{s.camera.setArea(t.area,{direct:0==e.duration||!e.forceAreaAni&&!wt(s.visible)}),e.delay&&i.render()}):(t.lang=this.micrio.lang,i.addChild(s=new Bh(i,t,{area:t.area}),this.image),this.trackImage(s));const r={duration:1e3*e.duration,timingFunction:this.timingFunction,limit:!1};if(!e.noCamAni&&!s.camera.aniDone&&s.ptr>0){const i=!!e.cover||s.camera.getCoverLimit();if(t.view||!i)s.camera.flyToView(t.view??[0,0,1,1],r).catch(()=>{});else if(t.area&&t.width&&t.height){const e=(t.area[2]-t.area[0])*this.micrio.offsetWidth/((t.area[3]-t.area[1])*this.micrio.offsetHeight);s.camera.flyToView(e<t.width/t.height?[.5,0,.5,1]:[0,.5,1,.5],r).catch(()=>{})}else s.camera.flyToCoverView(r).catch(()=>{})}return s}removeImages(t){const{engine:e}=this.micrio;t.forEach(t=>{t.ptr>=0&&e.fadeOut(t.ptr),this._buttons.delete(t.id)}),e.render()}insideGrid(){const t=this.micrio.$current;return t==this.image||!!t&&this.imageMap.has(t.id)}async reset(t,e,i){const s=this.history[0];return this.images.forEach(t=>t.camera.stop()),this.image.camera.stop(),this.markersShown.set([]),await Si(),i||e||!this.micrio.camera?.isZoomedOut()||this.micrio.state.$tour||this.$focussed||this.hasChanged()||(t=0),this.set(s?.layout||this.image.$info?.grid,{noHistory:!0,duration:t,noCamAni:e,forceAni:i,horizontal:!!s&&s.horizontal}).then(t=>(this.depth.set(this.history.length=0),this.micrio.current.set(this.image),t))}switchToGrid(){const t=this.$focussed;if(!t)return;const e=t.camera.getView();e&&this.reset(0,!0).then(()=>{t.opts.area&&this.image.camera.setView(t.opts.area,{noLimit:!0}),t.camera.setView(e,{noLimit:!0}),this.micrio.current.set(this.image)})}async flyToMarkers(t,e,i){const s=t?.split("|").map(t=>t.trim()),r=s?.[0]??"",n=r?this.images.filter(t=>!!t.$data?.markers?.find(t=>t.tags?.includes(r))):this.images;return this.set(n.map(t=>{const e=t.$data?.markers?.find(t=>t.tags?.includes(r));return this.getString(t.$info,{view:i?void 0:e?.view})}).join(";"),{duration:e,horizontal:"h"==s?.[1]})}async back(t){const e=this.history.pop();e&&(this.depth.set(this.history.length),this.micrio.current.set(this.image),this.$focussed&&this.blur(),await this.set(e.layout,{duration:t,noHistory:!0,horizontal:e.horizontal,view:e.view}))}setTimingFunction(t){this.micrio.engine.setGridTransitionTimingFunction(Yo.Camera.TimingFunction[this.timingFunction=t])}async focus(t,e={}){if(!t)return this.back();e.coverLimit&&(e.cover=!0);const i=!e.view&&!e.cover,s=this.micrio;wt(s.visible).find(t=>t==this.image)||s.current.set(this.image);const r=this.$focussed;if(r==t)return;e.transition?.startsWith("slide-")||0!=e.duration&&(!r||s.engine.areaAnimating(r.ptr)||this.current.includes(t))||t.camera.setArea([0,0,1,1],{noDispatch:!0,direct:!0}),r&&this.blur(),t.camera.setCoverLimit(!!e.cover),this.setTimingFunction("ease");const n=await this.transition(t,r,this.getString(t.$info,{view:e.view}),e);return s.engine.setZIndex(t.ptr,3),this.focussed.set(t),wt(t.visible)||"crossfade"!=e.transition&&e.transition||(e.duration=0),this.set(n,{noBlur:!0,duration:e.duration,forceAreaAni:"crossfade"!=e.transition,cover:!!e.cover,coverLimit:!!e.coverLimit}).then(()=>{s.events.dispatch("grid-focus",t);const e=t.$info;this.removeGrid(),s.$current!=t&&s.current.set(t);const r=s.offsetWidth/s.offsetHeight,n=(1-e.width/e.height/r)/2;!t.camera.aniDone&&i&&t.camera.flyToFullView({duration:1e3*this.aniDurationIn}).catch(()=>{}),this.image.camera.setLimit([n,0,1-n,1])}).catch(()=>{})}async transition(t,e,i,{duration:s,view:r,transition:n,noViewAni:a,exitView:o,blur:h,cover:c}){if(!n)return i;const{engine:l}=this.micrio;if("crossfade"==n&&(t.camera.setArea([0,0,1,1]),a=!0),r&&a&&t.camera.setView(r,{noRender:!0,noLimit:!0}),!e||"crossfade"==n)return i;const d=n.startsWith("slide")||n.startsWith("swipe"),u=n.startsWith("behind"),m=d?n.endsWith("-up")?0:n.endsWith("-down")?180:n.endsWith("-left")?270:90:void 0;if((d||u)&&l.fadeTo(t.ptr,.9999,!0),n.startsWith("slide"))t.camera.setArea(Bo[m],{noDispatch:!0,direct:!0});else if(n.startsWith("swipe"))t.camera.setArea(qo[m],{noDispatch:!0,direct:!0}),i=[this.getString(e.$info,{view:o??e.camera.getView(),area:Wo[m]}),this.getString(t.$info,{view:r,area:[0,0,1,1]})].join(";");else if(u){t.camera.setArea([0,0,1,1]),t.camera.setView([0,0,1,1]);const i=[this.getString(e.$info,{view:[0,0,1,1]}),this.getString(t.$info,{view:[0,0,1,1]})];"behind-left"==n&&i.reverse(),await this.set(i.join(";"),{noBlur:!0,horizontal:!0,coverLimit:c}).then(()=>dn(200))}if(h&&!isNaN(h)&&h>0){const t=(s=s??this.nextCrossFadeDuration??this.aniDurationIn)/2,e=this.micrio.canvas.element.style;e.transition=`filter ${t}s ease`,e.filter=`blur(${h}px)`,setTimeout(()=>{e.filter="",setTimeout(()=>e.transform="",1e3*t)},1e3*t)}return i}blur(){const t=this.$focussed;t&&(this.micrio.engine.setZIndex(t.ptr,2),this.micrio.events.dispatch("grid-blur"),this.focussed.set(void 0),this.image.camera.setLimit([0,0,1,1]),this.micrio.current.set(this.image))}tourEvent(t){const e=t.detail;e&&e.action?.startsWith("grid:")&&e.active&&this.action(e.action.slice(5),e.data,e.end-e.start)}action(t,e,i){"string"==typeof t&&(t=Yo.Grid.GridActionType[t]);const s=t+(e??"");if(this.lastAction==s)return;const r=this.actionHandlers[t];r?r(e,i):console.warn("Warning: unknown grid tour event",t),this.lastAction=s}async enlarge(t,e,i=e){return this.set((this.history[this.history.length-1]?.layout||this.image.$info.grid).split(";").map((s,r)=>`${s}|${r==t?`${e},${i}`:1}`).join(";"),{noHistory:!0,keepGrid:!0,duration:500})}getRelativeView(t,e){const i=t.opts.area??[0,0,1,1],s=i[2]-i[0],r=i[3]-i[1];return[i[0]+s*e[0],i[1]+r*e[1],i[0]+s*e[2],i[1]+r*e[3]]}},nl=class t extends HTMLElement{static get observedAttributes(){return["id","muted","data-grid","data-limited","lang"]}static{this.jsonCache=Cn}get $current(){return this._current}get camera(){return this._current?.camera}constructor(){super(),this.printed=!1,this.canvases=[],this.current=vt(),this.visible=vt([]),this.canvas=new Vc(this),this.events=new Bc(this),this.state=new Fh.Main(this),this.analytics=new il(this),this._router=new el(this),this.barebone=vt(!1),this.webgl=new Fc(this),this.engine=new Cc(this),this.defaultSettings=this.defaultSettings,this.loading=vt(!0),this.switching=vt(!1),this.isMuted=vt("1"==localStorage.getItem(Ln)),this._lang=vt(),this.keepRendering=!1,this.initedFirst=!1,this.loadV5Album=(t,e)=>(t=>"MICRIO_ALBUM"in self?Promise.resolve(self.MICRIO_ALBUM):On(`${In}album/${t}.json`))(t).then(t=>{if(!t)return;const i=t.id+"."+t.revision,s=e.path=t.organisation?.baseUrl??"https://r2.micr.io/";return e.organisation=t.organisation,e.settings.album=t,e.settings.gallery={archive:i,sort:t.sort,type:t.type,startId:e.id,isSpreads:t.isSpreads,coverPages:t.coverPages,revisions:t.published},delete e.id,this.loadArchiveBin(s,i).then(()=>this.loadGallery(e,s,!0))},t=>this.printError(t?.message||t)),this.getArchiveIndex=async(t,e=Sn)=>Yh.get(`${e}${t}.json`).then(t=>(t.images.forEach(t=>Cn.set(`${e}${t.id}/info.json`,t)),t)),this.current.subscribe(t=>this._current=t);let t=!1;gn(this.loading,{targetValue:!1}).then(()=>{this.setAttribute("data-loaded",""),this.switching.subscribe(e=>{e?this.setAttribute("data-switching",""):(t||Si().then(()=>this.events.dispatch("show",this)),t=!0,this.removeAttribute("data-switching"))});const e=this.querySelector("img.preview");e&&setTimeout(()=>e.remove(),500)})}attributeChangedCallback(t,e,i){switch(t){case"id":if(!this.isConnected||!i)return;this.printed?this.open(i):this.print();break;case"muted":this.isMuted.set(this.hasAttribute("muted"));break;case"data-grid":this.printed?this.$current?.grid?.set(i):this.print();break;case"data-limited":this.engine?._vertexBuffer&&this.$current?.ptr&&this.engine.setLimited(this.$current.ptr,!!i);break;case"lang":{let t=wt(this._lang);t!=i&&(this._lang.set(i),ca.set(ha[i]??ha.en),i&&(ua.includes(i)?this.setAttribute("dir","rtl"):this.removeAttribute("dir")),t&&this.events.dispatch("lang-switch",i));break}}}connectedCallback(){this.canvas.place(),(this.hasAttribute("data-router")||this.hasAttribute("data-space"))&&"false"!=this.getAttribute("data-router")&&this._router.hook(),!this.id&&!this.hasAttribute("data-gallery")||this.printed||this.print(),"muted"in this||(Object.defineProperty(this,"muted",{get(){return wt(this.isMuted)},set(t){t?this.setAttribute("muted",""):this.removeAttribute("muted")}}),this.isMuted.subscribe(t=>{this.muted=t,t?(localStorage.setItem(Ln,"1"),this.events.dispatch("audio-mute")):(localStorage.removeItem(Ln),this.events.dispatch("audio-unmute"))}))}addEventListener(t,e,i){super.addEventListener(t,e,i)}removeEventListener(t,e,i){super.removeEventListener(t,e,i)}destroy(){this.current.set(void 0),this._router.unhook(),this.events.enabled.set(!1),this.canvas.unhook(),this.analytics.unhook(),this.engine.unbind(),this._ui&&ds(this._ui),delete this._ui,this.webgl.dispose(!0),this.printed=!1}loadArchiveBin(t,e){return this.printUI(!0,!0),Yh.load(t,"g/"+e,t=>this._ui?.setProps?.({loadingProgress:t}))}async print(){if(this.printed)return;this.printed=!0,await Si();const t=this.getOptions();if(t.settings||(t.settings={}),t.settings.noControls&&this.state.ui.controls.set(!1),t.settings.gallery?.archive){const e=t.settings.gallery?.archive,i=/\.\d+$/.test(e),s=t.path||(Yn(e.replace(/\.\d+$/,""))?"https://r2.micr.io/":"https://b.micr.io/");i&&await this.loadArchiveBin(s,e),t.settings.gallery.startId=t.id,t.grid?await this.setGrid(t,s):await this.loadGallery(t,s,i),i||delete t.settings.gallery.archive,t.path||(t.path=s),delete t.id}else t.id?.startsWith("album/")?await this.loadV5Album(t.id.replace("album/",""),t):t.id&&Yn(t.id)&&!this.hasAttribute("width")&&!this.hasAttribute("height")&&await Xn(t.id,t.forceInfoPath?t.path:void 0,t.settings?.forceDataRefresh).then(e=>e?.albumId?this.loadV5Album(e.albumId,t):void 0).catch(()=>{});this.keepRendering=!!t.settings.keepRendering;const e=t.id||t.gallery||t.grid;if(this.events.dispatch("print",t),void 0!==t.settings.lazyload&&"IntersectionObserver"in window){const i=new IntersectionObserver(s=>{s[0]&&s[0].isIntersecting&&(i.unobserve(this),e&&this.open(t))},{rootMargin:100*t.settings.lazyload+"% 0px"});i.observe(this)}else e&&requestAnimationFrame(()=>this.open(t))}printUI(e,i){this._ui?this._ui.setProps?.({noHTML:e,noLogo:i}):this._ui=as(t.Svelte,{target:this,props:{micrio:this,noHTML:e,noLogo:i}})}printError(t){const e=t instanceof Nr?t.displayMessage:(t instanceof Error?t.message:t)??"An unknown error has occurred";console.error("Error:",e+(t instanceof Nr?` (${t.code}: ${t.message})`:"")),this._ui?.setProps?.({error:e})}open(t,e={}){this.printed||this.print();const i="string"==typeof t,s=this.getOptions();let r=i?{...s,id:t}:t;if(r.settings||(r.settings={}),s.settings?.gallery?.archive&&(/\.\d+$/.test(s.settings.gallery.archive)||delete s.settings.gallery.archive),i||rn(s.settings,r.settings),this.defaultSettings&&rn(this.defaultSettings,r.settings),this.$current&&r.id==this.$current?.id)return this.$current;e.splitScreen||e.gridView||!this.$current||this.switching.set(!0),r.settings.noGTag||this.analytics.hook(),this.printed=!0,this.printUI(!!r.settings.noUI,!!r.settings.noLogo);let n=this.canvases.find(t=>r.id&&t.id==r.id),a=!1;const o=this.canvases[0]?.grid;if(!n&&o){const t=r.id?o.images.find(t=>t.id==r.id):void 0;a=!!t,n=r.id?t:this.canvases[0],a&&!o.insideGrid()&&this.current.set(this.canvases[0])}if(!n){this.canvases.length&&(r.path=this.canvases[0].dataPath,r.lang=this.lang),this.canvases.push(n=new Bh(this.engine,r,e.splitScreen?{secondaryTo:e.splitTo??this._current,isPassive:e.isPassive}:void 0));const t=this.state.value&&this.state.value.c.find(t=>t[0]==r.id);t&&n.state.set(t)}e.startView&&(n.state.view.set(r.settings.view=e.startView),n.ptr>0&&n.engine.ready&&n.camera.setView(r.settings.view,{noRender:!0})),this.lang||(this.lang="en");const h=()=>{if(n){if(!this.webgl.gl)try{this.webgl.init()}catch(t){return void this.printError(t)}gn(n.info).then(t=>{if(t&&n){if(!this.initedFirst){switch(this.canvas.hook(),this._current?.$settings?.theme){case"light":this.setAttribute("data-light-mode","");break;case"os":this.setAttribute("data-auto-scheme","")}this.initedFirst=!0}t.grid&&!n.grid&&(n.grid=new rl(this,n)),Si().then(()=>this.dispatchEvent(new CustomEvent("load",{detail:n}))),e.splitScreen&&Si().then(()=>{n&&(o?.image.camera.aniDoneAdd&&o.image.camera.aniDoneAdd.length>0?o.image.camera.aniDoneAdd.push(()=>n?.splitStart()):n.splitStart())})}}),this.engine.set360Orientation(e.vector?.direction??0,e.vector?.distanceX??0,e.vector?.distanceY??0),this.engine.preventDirectionSet=!e.vector,!a||e.gridView&&o?.current.find(t=>t.id==r.id)?e.splitScreen?this.engine.setCanvas(n):this.current.set(n):o?.focus(n,{view:r.settings?.view}).then(()=>this.current.set(n))}};return this.engine.ready?h():this.engine.load().then(h).catch(t=>this.printError(t)),n.noImage&&this.loading.set(!1),n}close(t){t.opts.secondaryTo?t.splitEnd():this.engine.removeCanvas(t)}getOptions(){const t={gallery:{}},e={settings:t,id:this.id},i=(t,e,i)=>{const s=e.split(".");for(let r=0;r<s.length-1;r++)t=t[s[r]];t[s[s.length-1]]=i};for(const s in $n.STRINGS){const r=$n.STRINGS[s],n=this.getAttribute(s),a=r.f||s.replace("data-","");n&&i(r.r?e:t,a,n)}for(const s in $n.BOOLEANS){const r=$n.BOOLEANS[s],n=this.getAttribute(s),a=r.f||s.replace("data-",""),o=null!=n&&""==n||"true"==n;(o||"false"==n)&&i(r.r?e:t,a,r.n?!o:!!o)}for(const s in $n.NUMBERS){const r=$n.NUMBERS[s],n=r.f||s.replace("data-","");let a=this.getAttribute(s);void 0!==r.dN&&null==a&&(a=r.dN),null==a||isNaN(Number(a))||i(r.r?e:t,n,Number(a))}for(const s in $n.ARRAYS){const r=$n.ARRAYS[s],n=this.getAttribute(s),a=r.f||s.replace("data-","");null!=n&&i(r.r?e:t,a,n.split(",").map(t=>Number(t)))}return t.static&&(t.noUI=t.skipMeta=!0,t.hookEvents=!1),e.settings&&e.grid&&e.grid.indexOf(".")>0&&(e.settings.gallery.archive=e.grid),e}async loadGallery(t,e,i){let s=t.settings?.gallery,r=s?.archive;if(!s||!r)return;const n=t.settings;if(i){const t=await this.getArchiveIndex(r.split(".")[0],e);s.archiveLayerOffset=t.delta,r=t.images.sort("name"==s.sort?(t,e)=>t.title&&e.title?t.title<e.title?-1:t.title>e.title?1:0:0:"-name"==s.sort?(t,e)=>t.title&&e.title?t.title<e.title?1:t.title>e.title?-1:0:0:"-created"==s.sort?(t,e)=>t.created&&e.created?t.created<e.created?1:t.created>e.created?-1:0:0:(t,e)=>t.created&&e.created?t.created<e.created?-1:t.created>e.created?1:0:0).map(t=>`${t.id},${t.width},${t.height},${t.isDeepZoom?"d":""},${t.isPng?"p":t.isWebP?"w":""},${t.tileSize||""}`.replace(/\,+$/,"")).join(";")}const a=r.split(";").map(t=>t.trim());if(!i){const t=a.filter(t=>t.startsWith("http")).map(t=>On(t));t.length&&await Promise.all(t).then(t=>t.forEach((t,e)=>{t&&(a[e]=`${t["@id"]},${t.width},${t.height}`)}))}const o=a.map(t=>t.split(",").map(t=>isNaN(t)?t:Number(t)));o.forEach((t,e)=>{e>0&&!t[2]&&t.push(...o[e-1].slice(1))}),s.type||(s.type="swipe");const h="switch"==s.type||"swipe-full"==s.type||"omni"==s.type,c=s.isSpreads;if(!h){t.width=this.offsetWidth*this.canvas.getRatio(),t.height=this.offsetHeight*this.canvas.getRatio();const i=Math.max(0,o.findIndex(t=>t[0]==s.startId));return t.gallery=o.map((t,r)=>new Bh(this.engine,{id:t[0],path:e,width:t[1],height:t[2],isDeepZoom:"d"==t[3],isPng:"p"==t[4],isWebP:"w"==t[4],tileSize:t[5]||1024,revision:s?.revisions?.[t[0]],settings:{skipMeta:!0,gallery:s}},{area:[r-i,0,r-i+1,1]})),void(n.view=[0,0,1,1])}t.height=Math.max(...o.map(t=>t[2]));const l=c?s.coverPages??0:0;t.width=Math.max(...o.map(t=>t[1]*(c?2:1))),t.gallery=o.map((t,i)=>new Bh(this.engine,{id:t[0],path:e,width:t[1],height:t[2],isDeepZoom:"d"==t[3],isPng:"p"==t[4],isWebP:"w"==t[4],tileSize:t[5]||1024,revision:s?.revisions?.[t[0]],settings:{skipMeta:!0,gallery:s}},{isEmbed:!0,useParentCamera:!0,area:c?i-l<0||i==o.length-1&&(i-l)%2==0?[.25,0,.75,1]:(i-l)%2==0?[0,0,.5,1]:[.5,0,1,1]:[0,0,1,1]})),n.pinchZoomOutLimit=!0,t.gallery.length&&(n.view=fn.fromLegacy(t.gallery[Math.max(0,t.gallery.findIndex(t=>t.id==s.startId))].opts.area))}async setGrid(t,e){t.settings&&t.grid&&(t.settings.gallery?.archive==t.grid&&(this.gridInfoData=await this.getArchiveIndex(t.grid.split(".")[0],e),t.grid=this.gridInfoData.images.map(t=>rl.getString(t,{cultures:"cultures"in t?t.cultures.join("-"):void 0})).join(";")),t.width=this.offsetWidth*this.canvas.getRatio(),t.height=this.offsetHeight*this.canvas.getRatio(),t.settings.zoomLimit=15,t.settings.minimap=!1,t.settings.initType="cover",this.removeAttribute("data-grid"))}get lang(){return wt(this._lang)}set lang(t){this.setAttribute("lang",t)}};nl.Svelte=function(t,e){et(e,!0);const i=()=>xt(Ei(E),"$settings",l),s=()=>xt(Ei(M),"$info",l),r=()=>xt(Ei(S),"$data",l),n=()=>xt(x,"$tour",l),a=()=>xt($,"$volume",l),o=()=>xt(w,"$visible",l),h=()=>xt(k,"$markerPopup",l),c=()=>xt(_,"$popover",l),[l,d]=kt();let u=br(e,"noHTML",15),m=br(e,"noLogo",23,u),g=br(e,"loadingProgress",7,1),p=br(e,"error",7,void 0);tt("micrio",Li(()=>e.micrio)),tt("markerImages",new Map);const f=Li(()=>"markers"==e.micrio.getAttribute("data-ui"));f&&u(!0);const v=Li(()=>"false"!=e.micrio.getAttribute("data-embeds")),{visible:w,state:y,isMuted:b}=Li(()=>e.micrio),{tour:x,marker:T,popup:k,popover:_}=y;let M=ne(void 0),S=ne(void 0),E=ne(void 0);function I(t,e){if(e)for(let i,s=0;s<e.length;s++)if(e[s].id==t||(i=I(t,e[s].children)))return i??e[s]}let A=ne(!1),L=ne(void 0);const P=[];Li(()=>e.micrio).current.subscribe(t=>{t&&(Tt(oe(M,t.info,!0),"$info",l),Tt(oe(E,void 0),"$settings",l),Ei(M)&&gn(Ei(M)).then(e=>{e&&(oe(A,!0),Tt(oe(E,t.settings,!0),"$settings",l),!Ei(L)&&e.organisation?.logo&&oe(L,e.organisation,!0))}),Tt(oe(S,t.data,!0),"$data",l)&&P.indexOf(t.id)<0&&gn(Ei(S)).then(async i=>{if(!i)return;if(P.push(t.id),await Si().then(Si),wt(e.micrio.state.popover)||wt(e.micrio.state.marker)||wt(e.micrio.state.tour))return;const s=t.$settings.start;if(s)switch(s.type){case"marker":t.state.marker.set(s.id);break;case"markerTour":const r=i.markerTours?.find(t=>t.id==s.id);r&&e.micrio.state.tour.set(r);break;case"tour":const n=i.tours?.find(t=>t.id==s.id);n&&e.micrio.state.tour.set(n);break;case"page":const a=I(s.id,i.pages);a&&e.micrio.state.popover.set({contentPage:a,showLangSelect:!0})}}))});const $=vt(xt(b,"$isMuted",l)?0:1);tt("volume",$),b.subscribe(t=>$.set(t?0:1)),tt("mediaPaused",vt(!1));let C=ne(!1),D=ne(ue([]));tt("srt",vt()).subscribe(t=>setTimeout(()=>{oe(D,t?[t]:[],!0)},20));const z=jt(()=>i()?._360?.video),O=jt(()=>Ei(z)?.src),R=jt(()=>i()?.omni),X=jt(()=>s()?.gallery),F=jt(()=>r()?.markers?.filter(t=>!!t.positionalAudio)),V=jt(()=>!!r()?.music?.items.length||!!Ei(F)?.length),Y=jt(()=>n()||xt(T,"$marker",l)),N=jt(()=>!u()||f),B=jt(()=>!(m()||s()&&u()||i()?.noLogo)),W=jt(()=>u()||!Ei(B)||i()?.noOrgLogo?void 0:Ei(L)),U=jt(()=>!(u()||Ei(R)||e.micrio.spaceData||n()||s()?.gallery)),H=jt(()=>!!Ei(X)||!!Ei(R)),G=jt(()=>!u()&&!!s()),j=jt(()=>!u()&&!Ei(Y)&&i()?.showInfo),Z=jt(()=>!u()&&Ei(A)&&!i()?.noToolbar);var J={setProps:function(t){"error"in t&&p(t.error),void 0!==t.noHTML&&u(t.noHTML),void 0!==t.noLogo&&m(t.noLogo),void 0!==t.loadingProgress&&g(t.loadingProgress)}},K=ac(),Q=_e(K),st=t=>{{let e=jt(()=>!!s().is360);hh(t,{get volume(){return a()},get data(){return r()},get is360(){return Ei(e)}})}};vs(Q,t=>{Ei(V)&&r()&&s()&&t(st)});var rt=Me(Q,2),nt=t=>{fo(t,yr({get src(){return Ei(O)},get volume(){return a()},is360:!0,get width(){return s().width},get height(){return s().height}},()=>Ei(z)))};vs(rt,t=>{Ei(O)&&s()&&t(nt)});var at=Me(rt,2),ot=t=>{var e=Hi();bs(_e(e),1,()=>r().embeds,t=>t.uuid,(t,e)=>{Hh(t,{get embed(){return Ei(e)}})}),Gi(t,e)};vs(at,t=>{v&&r()&&r().embeds&&t(ot)});var ht=Me(at,2),ct=t=>{na(t,{})};vs(ht,t=>{Ei(B)&&t(ct)});var lt=Me(ht,2),dt=t=>{Aa(t,{})};vs(lt,t=>{Ei(Z)&&t(dt)});var ut=Me(lt,2),mt=t=>{var e=Hi();bs(_e(e),1,o,t=>t.uuid,(t,e)=>{ec(t,{get image(){return Ei(e)}})}),Gi(t,e)};vs(ut,t=>{Ei(N)&&t(mt)});var gt=Me(ut,2),pt=t=>{var e=Hi();bs(_e(e),1,()=>o().filter(t=>t.$settings.minimap),t=>t.uuid,(t,e)=>{Pa(t,{get image(){return Ei(e)}})}),Gi(t,e)};vs(gt,t=>{Ei(U)&&t(pt)});var ft=Me(gt,2),yt=t=>{{let e=jt(()=>Ei(V)||!(!Ei(O)||!Ei(z)||Ei(z).muted));Na(t,{get hasAudio(){return Ei(e)}})}};vs(ft,t=>{Ei(G)&&t(yt)});var bt=Me(ft,2),_t=t=>{var e=sc(),i=_e(e),s=t=>{th(t,{get images(){return Ei(X)},get omni(){return Ei(R)}})};vs(i,t=>{Ei(H)&&t(s)});var r=Me(i,2),n=t=>{oa(t,{get organisation(){return Ei(W)}})};vs(r,t=>{Ei(W)&&t(n)});var a=Me(r,2),o=t=>{gh(t,{get info(){return Ei(M)},get data(){return Ei(S)}})};vs(a,t=>{Ei(j)&&Ei(M)&&Ei(S)&&t(o)}),Gi(t,e)};vs(bt,t=>{(Ei(H)||Ei(W)||Ei(j)&&Ei(M)&&Ei(S))&&t(_t)});var Mt=Me(bt,2),St=t=>{var e=rc(),i=_e(e),s=t=>{Lo(t,{get marker(){return h()}})};vs(i,t=>{h()&&t(s)});var r=Me(i,2),a=t=>{Vo(t,{get tour(){return n()},get noHTML(){return u()},onminimize:t=>oe(C,!t)})};vs(r,t=>{n()&&t(a)});var o=Me(r,2),l=t=>{Ah(t,{get popover(){return c()}})};vs(o,t=>{c()&&t(l)}),Gi(t,e)};vs(Mt,t=>{(h()||n()||c())&&t(St)});var Et=Me(Mt,2);bs(Et,16,()=>Ei(D),t=>t,(t,e)=>{Ka(t,{get src(){return e},get raised(){return Ei(C)}})});var It=Me(Et,2),At=t=>{var e=nc(),i=_e(e),s=t=>{!function(t,e){var i=ph(),s=ke(i);pa(s,{name:"error"});var r=Me(s);q(i),Ye(()=>ns(r,` ${e.message??""}`)),Gi(t,i)}(t,{get message(){return p()}})};vs(i,t=>{p()&&t(s)});var r=Me(i,2),n=t=>{!function(t,e){const i=2*Math.PI*40,s=jt(()=>i*(1-e.progress));var r=ic();ar(r,"viewBox","0 0 100 100");var n=ke(r);ar(n,"r",40),ar(n,"cx",50),ar(n,"cy",50);var a=Me(n);ar(a,"r",40),ar(a,"cx",50),ar(a,"cy",50),ar(a,"stroke-dasharray","251.32741228718345px"),q(r),Ye(()=>ar(a,"stroke-dashoffset",`${Ei(s)??""}px`)),Ds(1,r,()=>ia,()=>({delay:500})),Ds(2,r,()=>ia),Gi(t,r)}(t,{get progress(){return g()}})};vs(r,t=>{g()<1&&t(n)}),Gi(t,e)};vs(It,t=>{(p()||g()<1)&&t(At)}),Gi(t,K);var Lt=it(J);return d(),Lt},nl.VERSION=Mn,customElements.define("micr-io",nl),console.info("%c◈%c Micrio %cv6.0.0 - https://micr.io/","color: #00d4ee","color: #c5ff5b","color: inherit")}();
|