@pie-players/pie-section-player 0.3.73 → 0.3.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/README.md +173 -42
  2. package/dist/browser/assets/evaluation-worker-DkU_wGh3.js +155241 -0
  3. package/dist/browser/chunks/ItemToolBar-wr2myaah-2ce4b643.js +1 -0
  4. package/dist/browser/chunks/PUA-tLuTiQ7--f2b27953.js +1 -0
  5. package/dist/browser/chunks/ToolCoordinator-cc2dc319.js +1 -0
  6. package/dist/browser/chunks/accents-BTUYmhn9-cafeb96e.js +1 -0
  7. package/dist/browser/chunks/accents-b-i-CngHZsLL-e0eb98fd.js +1 -0
  8. package/dist/browser/chunks/arabic-BzEHMVZD-30ac1ade.js +1 -0
  9. package/dist/browser/chunks/arrows-VjxlU-jv-2e17c192.js +1 -0
  10. package/dist/browser/chunks/base-dfd67c41.js +1 -0
  11. package/dist/browser/chunks/braille-BeWC_Ruq-a3bb8ef9.js +1 -0
  12. package/dist/browser/chunks/braille-d-Dk6J96GO-d832bfbf.js +1 -0
  13. package/dist/browser/chunks/browser-a3c32178.js +36 -0
  14. package/dist/browser/chunks/calculator-element-271c142f.js +9 -0
  15. package/dist/browser/chunks/calligraphic-Cew9cU3x-04cf0735.js +1 -0
  16. package/dist/browser/chunks/cherokee-Cny3FYho-4da7d2f3.js +1 -0
  17. package/dist/browser/chunks/classPrivateFieldGet2-338e0179.js +1 -0
  18. package/dist/browser/chunks/custom-element-define-2a92deb0.js +1 -0
  19. package/dist/browser/chunks/cyrillic-CfCDulXU-5550df0b.js +1 -0
  20. package/dist/browser/chunks/cyrillic-ss-lU7bNGG9-12eb0188.js +1 -0
  21. package/dist/browser/chunks/defineProperty-a20a667d.js +1 -0
  22. package/dist/browser/chunks/devanagari-CDIz2h-r-18c38725.js +1 -0
  23. package/dist/browser/chunks/dist-41b39e7f.js +1 -0
  24. package/dist/browser/chunks/dist-59132a53.js +1 -0
  25. package/dist/browser/chunks/dist-60d7afef.js +1 -0
  26. package/dist/browser/chunks/dist-ca9b9622.js +1 -0
  27. package/dist/browser/chunks/double-struck-BpJEQk8y-500ce8dd.js +1 -0
  28. package/dist/browser/chunks/en-5ff22e17.js +1 -0
  29. package/dist/browser/chunks/es-a0ba6cb6.js +1 -0
  30. package/dist/browser/chunks/focus-trap-44913bf3.js +1 -0
  31. package/dist/browser/chunks/fraktur-rLEq9DEH-44cc14d8.js +1 -0
  32. package/dist/browser/chunks/greek-BlraJTyL-90ce8924.js +1 -0
  33. package/dist/browser/chunks/greek-ss-D-EN2PK0-91610739.js +1 -0
  34. package/dist/browser/chunks/hebrew-GiQZeybp-b583f555.js +1 -0
  35. package/dist/browser/chunks/latin-b-BhEnC7R2-d13e06ff.js +1 -0
  36. package/dist/browser/chunks/latin-bi-DqiIKv3U-1dec8705.js +1 -0
  37. package/dist/browser/chunks/latin-i-B1xtwaE1-21637466.js +1 -0
  38. package/dist/browser/chunks/latin-xfWFlLkD-5bcea5cf.js +1 -0
  39. package/dist/browser/chunks/logger-8b07fb72.js +1 -0
  40. package/dist/browser/chunks/marrows-DD1NgMQi-15b63755.js +1 -0
  41. package/dist/browser/chunks/math-DpWn1mbG-38eeb914.js +1 -0
  42. package/dist/browser/chunks/math-rendering-ready-9a0fd90a.js +1 -0
  43. package/dist/browser/chunks/mathjax-D2JHb_R_-64780dc5.js +232 -0
  44. package/dist/browser/chunks/module-0191e321.js +74 -0
  45. package/dist/browser/chunks/module-shim-58659a86.js +0 -0
  46. package/dist/browser/chunks/module-shim-b4470740.js +12 -0
  47. package/dist/browser/chunks/monospace-D116QD2a-98d484fd.js +1 -0
  48. package/dist/browser/chunks/monospace-ex-DcXpouKS-456b403c.js +1 -0
  49. package/dist/browser/chunks/monospace-l-Ct5wkMDs-f34a4a9e.js +1 -0
  50. package/dist/browser/chunks/mshapes-DCp86WSX-c0055952.js +1 -0
  51. package/dist/browser/chunks/nds-icon-button-d602f784.js +194 -0
  52. package/dist/browser/chunks/nl-NL-364d61b9.js +1 -0
  53. package/dist/browser/chunks/nl-NL-8b7e6d4b.js +1 -0
  54. package/dist/browser/chunks/overlay-containment-edaaff13.js +1 -0
  55. package/dist/browser/chunks/overlay-placement-e8058232.js +1 -0
  56. package/dist/browser/chunks/phonetics-BwOCw2Y9-d2e3af59.js +1 -0
  57. package/dist/browser/chunks/phonetics-ss-CRtMn02f-579b6135.js +1 -0
  58. package/dist/browser/chunks/pie-api-client-687c319a.js +1 -0
  59. package/dist/browser/chunks/pie-tool-calculator-cortex-0626bc24.js +9 -0
  60. package/dist/browser/chunks/pie-tool-calculator-geogebra-561236cb.js +9 -0
  61. package/dist/browser/chunks/pointer-gesture-ce75f0a7.js +1 -0
  62. package/dist/browser/chunks/preload-helper-6ad28da3.js +1 -0
  63. package/dist/browser/chunks/provider-4c704118.js +1 -0
  64. package/dist/browser/chunks/rolldown-runtime-1287ba31.js +1 -0
  65. package/dist/browser/chunks/runtime-C7H1jS4E-64772f5e.js +8413 -0
  66. package/dist/browser/chunks/sanitize-svg-icon-b9082bba.js +3 -0
  67. package/dist/browser/chunks/sans-serif-BYPZKlE9-2efdbcd9.js +1 -0
  68. package/dist/browser/chunks/sans-serif-b-B0kRKiC--b5530dce.js +1 -0
  69. package/dist/browser/chunks/sans-serif-bi-DXWul6mu-5370dba4.js +1 -0
  70. package/dist/browser/chunks/sans-serif-ex-Boux1kMP-aa178f31.js +1 -0
  71. package/dist/browser/chunks/sans-serif-i-676RFaSO-2db54474.js +1 -0
  72. package/dist/browser/chunks/sans-serif-r-DrN9xdZt-0fc72eea.js +1 -0
  73. package/dist/browser/chunks/script-0ohehnXc-526904f4.js +1 -0
  74. package/dist/browser/chunks/shapes-BG47NodJ-d59b0eca.js +1 -0
  75. package/dist/browser/chunks/src-BcptuNS5-ed25d7fd.js +191 -0
  76. package/dist/browser/chunks/sre-engine-wf9s43gg-f09289c5.js +53 -0
  77. package/dist/browser/chunks/symbols-BqnUxf_t-83087e87.js +1 -0
  78. package/dist/browser/chunks/symbols-b-i-eg9k5hmF-9c461ac2.js +1 -0
  79. package/dist/browser/chunks/tool-annotation-toolbar-997438b4.js +248 -0
  80. package/dist/browser/chunks/tool-answer-eliminator-35483abd.js +13 -0
  81. package/dist/browser/chunks/tool-color-scheme-b7de5cdf.js +26 -0
  82. package/dist/browser/chunks/tool-dictionary-cecff3b4.js +7 -0
  83. package/dist/browser/chunks/tool-graph-cb0338e8.js +11 -0
  84. package/dist/browser/chunks/tool-host-contract-b93b482c.js +1 -0
  85. package/dist/browser/chunks/tool-line-reader-f8ef3c6a.js +62 -0
  86. package/dist/browser/chunks/tool-periodic-table-43b133b8.js +153 -0
  87. package/dist/browser/chunks/tool-picture-dictionary-33721e91.js +4 -0
  88. package/dist/browser/chunks/tool-protractor-23f77028.js +17 -0
  89. package/dist/browser/chunks/tool-ruler-1d9a03a6.js +15 -0
  90. package/dist/browser/chunks/tool-tts-inline-98c2ce7a.js +179 -0
  91. package/dist/browser/chunks/variants-2LRNhOUP-966fc49d.js +1 -0
  92. package/dist/browser/chunks/versioned-tag-54a76be9.js +1 -0
  93. package/dist/browser/pie-section-player.js +1613 -0
  94. package/dist/browser.d.ts +10 -0
  95. package/dist/chunks/ItemToolBar-wr2myaah-1287ba31.js +28 -0
  96. package/dist/chunks/module-shim-58659a86.js +2129 -0
  97. package/dist/chunks/{nl-NL-9312c316.js → nl-NL-364d61b9.js} +8 -2
  98. package/dist/chunks/sre-engine-wf9s43gg-f09289c5.js +8 -0
  99. package/dist/components/shared/composition.d.ts +0 -1
  100. package/dist/components/shared/layout-host-methods.d.ts +400 -0
  101. package/dist/components/shared/missing-tool-providers.d.ts +16 -0
  102. package/dist/components/shared/player-preload.d.ts +14 -10
  103. package/dist/contracts/host-hooks.d.ts +4 -5
  104. package/dist/contracts/host-hooks.js +0 -0
  105. package/dist/contracts/layout-contract.js +0 -0
  106. package/dist/contracts/layout-parity-metadata.js +87 -0
  107. package/dist/contracts/public-events.d.ts +14 -15
  108. package/dist/contracts/public-events.js +12 -0
  109. package/dist/contracts/runtime-host-contract.js +0 -0
  110. package/dist/controllers/SectionController.d.ts +13 -0
  111. package/dist/controllers/toolkit-section-contracts.d.ts +1 -17
  112. package/dist/controllers/types.d.ts +17 -10
  113. package/dist/pie-section-player.js +19298 -37928
  114. package/dist/policies/index.d.ts +9 -2
  115. package/dist/policies/index.js +25 -0
  116. package/package.json +34 -29
  117. package/dist/chunks/module-a516757f.js +0 -73997
  118. package/dist/chunks/nl-NL-ef6dd604.js +0 -505
  119. package/dist/chunks/pie-api-client-22de9d9c.js +0 -168
  120. package/dist/chunks/rolldown-runtime-1287ba31.js +0 -20
  121. package/dist/chunks/sre-0162a7a9.js +0 -17637
  122. package/dist/contracts/stages.d.ts +0 -10
  123. package/dist/utils/z-index.d.ts +0 -5
@@ -0,0 +1 @@
1
+ import{a as i,i as c,n as a}from"./mathjax-D2JHb_R_-64780dc5.js";a.dynamicSetup("","symbols",c({SY:{normal:{161:[.5,.216,.278],162:[.476,.045,.444],164:[.491,-.01,.778],166:[.75,.25,.278],169:[.683,0,.683],170:[.705,-.333,.449],171:[.483,0,.556],173:[.245,-.187,.333],174:[.683,0,.683],178:[.705,-.306,.359],179:[.705,-.293,.359],185:[.705,-.306,.366],186:[.705,-.333,.419],187:[.483,0,.556],188:[.705,0,.825],189:[.705,0,.825],190:[.705,0,.825],191:[.5,.205,.472],3647:[.728,.045,.708],8215:[-.103,.293,.504],8218:[.104,.195,.278],8219:[.693,-.394,.262],8222:[.104,.195,.472],8223:[.693,-.394,.472],8226:[.445,-.055,.5],8227:[.45,-.052,.5],8228:[.106,0,.277],8229:[.106,0,.557],8233:[.694,.195,.472],8240:[.75,.056,1.14],8241:[.75,.056,1.457],8248:[.116,.063,.523],8249:[.483,0,.389],8250:[.483,0,.389],8251:[.492,-.009,.778],8252:[.716,0,.478],8253:[.756,0,.472],8254:[.802,-.762,.68],8255:[-.079,.272,.6],8256:[.74,-.547,.6],8257:[.402,.189,.562],8258:[.549,.028,.665],8259:[.266,-.16,.5],8261:[.75,.25,.278],8262:[.75,.25,.278],8263:[.705,0,.891],8264:[.716,0,.648],8265:[.716,0,.648],8266:[.529,.153,.442],8267:[.694,.194,.611],8268:[.428,-.066,.572],8269:[.428,-.066,.572],8270:[.269,.028,.335],8271:[.431,.193,.278],8272:[.725,-.023,.717],8273:[.589,.028,.335],8274:[.751,-.001,.5],8275:[.309,-.191,.556,{ic:.001}],8276:[-.08,.273,.6],8277:[.394,-.096,.335],8278:[.474,-.012,.345],8280:[.474,-.012,.516],8281:[.474,-.012,.516],8282:[.554,-.012,.175],8283:[.594,.028,.476],8284:[.483,-.017,.588],8285:[.554,-.012,.175],8286:[.554,-.012,.175],8319:[.553,-.287,.333],8320:[.347,.055,.389],8353:[.728,.045,.722],8358:[.683,0,.75],8361:[.683,.022,1.028],8362:[.682,.005,1.042],8363:[.694,.03,.556],8369:[.683,0,.681],8370:[.75,.055,.785],8448:[.683,.082,1.141],8449:[.683,.098,1.109],8451:[.705,.022,1.03],8452:[.683,0,.711],8453:[.683,.05,1.141],8454:[.683,.049,1.227],8456:[.706,.022,.72],8457:[.683,0,.98],8468:[.705,.012,.978],8470:[.695,.01,.916],8471:[.683,0,.683],8478:[.683,.022,.736],8479:[.833,.153,.736],8480:[.683,-.247,.883],8481:[.677,0,1.582],8482:[.687,-.277,.983],8483:[.833,.153,.75],8485:[.671,.365,.444],8489:[.441,.013,.25],8494:[.701,.01,.676],8505:[.685,0,.319],8506:[.671,0,.985],8507:[.68,0,1.399],8522:[.694,0,.632],8523:[.716,.022,.778],8524:[.7,.006,.806,{ic:.001}],8525:[.774,.12,1.019],8526:[.519,0,.46],8527:[.512,.01,1.258],8960:[.597,.097,.778],8961:[.389,0,.902],8962:[.725,-.001,.652],8963:[.802,-.524,.778],8964:[.192,.085,.778],8965:[.27,.163,.778],8966:[.367,.26,.778],8977:[.432,-.071,.572],8978:[.619,-.448,.778],8979:[.604,-.36,.667],8980:[.468,.057,.778],8981:[.599,-.094,.587],8982:[.703,.203,.986],8983:[.58,.086,.778],8984:[.575,.061,.738],8986:[.693,.191,.778],8987:[.698,0,.658],8996:[.266,.037,.778],8997:[.267,0,.759],8998:[.505,.005,.984],8999:[.483,-.017,.726],9e3:[.483,-.007,1.046],9003:[.505,.005,.984],9004:[.755,.131,.93],9005:[.597,.097,.81],9006:[.599,-.049,.655],9007:[.384,-.116,.68],9008:[.766,.011,1.137],9009:[.731,.231,1.15],9010:[.547,.047,.738],9011:[.547,-.23,.738],9012:[.131,0,.5],9013:[.202,.09,.529],9014:[.664,.024,.578],9015:[.666,0,.386],9016:[.773,.083,.618],9017:[.773,.083,.618],9018:[.773,.083,.618],9019:[.773,.083,.618],9020:[.773,.083,.618],9021:[.731,.231,.778],9022:[.592,.092,.796],9023:[.603,.103,.568],9024:[.603,.103,.568],9025:[.773,.083,.618],9026:[.773,.083,.618],9027:[.773,.083,.618],9028:[.773,.083,.618],9029:[.75,.25,.72],9030:[.75,.25,.72],9031:[.773,.083,.618],9032:[.773,.083,.618],9033:[.673,.173,.778],9034:[.684,0,.778],9035:[.81,.19,.778,{ic:.007}],9036:[.773,.083,.618],9037:[.773,.083,.618],9038:[.684,0,.778],9039:[.552,.052,.72],9040:[.773,.083,.618],9041:[.684,0,.778],9042:[.81,.19,.778,{ic:.007}],9043:[.773,.083,.618],9044:[.773,.083,.618],9045:[.684,0,.778],9046:[.552,.052,.72],9047:[.773,.083,.618],9048:[.705,0,.278],9049:[.615,0,.618],9050:[.668,0,.568],9051:[.575,0,.588],9052:[.63,0,.551],9053:[.604,.02,.667],9054:[.773,.083,.618],9055:[.445,-.055,.5],9056:[.773,.083,.618],9057:[.802,.02,.778],9058:[.802,.033,1],9059:[.572,.07,.827],9060:[.552,-.108,.618],9061:[.592,-.055,.5],9062:[.75,.25,.667],9063:[.75,.25,.778],9064:[.592,-.191,.556,{ic:.001}],9065:[.592,.058,.778],9066:[.46,-.007,.278],9067:[.683,.033,1],9068:[.666,.022,.6],9069:[.75,.25,.6],9070:[.431,.193,.33],9071:[.773,.083,.618],9072:[.773,.083,.618],9073:[.583,.023,.642],9074:[.574,.032,.642],9075:[.442,.011,.308,{ic:.004}],9076:[.442,.216,.488],9077:[.442,.011,.641],9078:[.442,.19,.641,{ic:.018}],9079:[.453,.19,.471],9080:[.442,.19,.331],9081:[.442,.19,.641],9082:[.442,.011,.641,{ic:.018}],9083:[.699,.027,.833],9084:[.679,.262,.957],9085:[.174,0,.52],9086:[.454,0,.667],9087:[.75,.25,.278],9088:[.632,.02,.623],9089:[.462,0,.965],9090:[.462,0,1.076],9091:[.54,-.007,1.31],9092:[.483,-.017,.786],9093:[.75,.25,.566],9094:[.574,.073,.756],9095:[.343,0,.767],9096:[.59,.09,.788],9097:[.445,-.055,.5],9098:[.445,-.055,.5],9099:[.47,-.055,.5],9100:[.637,-.108,1.028],9101:[.703,0,.613],9102:[.703,-.001,.589],9103:[.605,.073,.756],9104:[.607,.071,.756],9105:[.605,.073,.756],9106:[.607,.071,.756],9107:[.367,-.133,.778],9108:[.755,.131,.93],9109:[.773,.083,.618],9110:[.452,.004,.738],9111:[.626,0,.748],9112:[.626,0,.748],9113:[.723,.011,.777],9114:[.494,.011,.777],9142:[.469,-.031,1.066],9146:[.472,-.432,.396],9147:[.328,-.288,.396],9148:[.184,-.144,.396],9149:[.04,0,.396],9150:[.75,.05,.444],9151:[.75,.05,.444],9152:[.65,.1,.551],9153:[.65,.1,.551],9154:[.65,.1,.551],9155:[.75,.19,.734],9156:[.75,.19,.734],9157:[.75,.19,.734],9158:[.75,.19,.6],9159:[.75,.19,.65],9160:[.75,.19,.65],9161:[.75,.19,.734],9162:[.75,.19,.734],9163:[.75,.05,.444],9164:[.75,.05,.444],9165:[.617,-.017,.566],9167:[.442,0,.668],9169:[.38,-.208,.5],9170:[.473,-.208,.5],9171:[.47,-.206,.5],9172:[.473,-.208,.848],9173:[.47,-.206,.848],9174:[.38,-.208,.848],9175:[.471,-.229,.636],9176:[.471,-.229,.636],9177:[.471,-.229,.636],9178:[.75,.03,.734],9179:[.388,-.022,.967],9186:[.583,.083,1.184],9187:[.755,.131,.93],9188:[.27,-.23,.856],9189:[.423,.083,1.07],9190:[.442,.011,1],9191:[.859,.083,.948],9192:[.209,.204,.746],9193:[.422,-.078,.591],9194:[.422,-.082,.591],9195:[.52,0,.591],9196:[.52,0,.591],9197:[.422,-.078,.499],9198:[.422,-.082,.645],9199:[.422,-.078,.645],9200:[.693,.146,.778],9201:[.693,.092,.778],9202:[.592,.092,.778],9203:[.698,0,.658],9208:[.415,-.085,.239],9209:[.415,-.085,.428],9210:[.413,-.087,.428],9211:[.481,-.036,.5],9212:[.445,-.055,.5],9213:[.367,-.135,.5],9214:[.582,.031,.667],9215:[.52,.02,.778],9250:[.694,.011,.556],9251:[.25,.105,.5],11159:[.562,.064,.766],11193:[.508,-.002,.978],11209:[.679,.162,.778],11216:[.583,.083,.778],11217:[.573,.073,.778],11218:[.673,.173,.744],11219:[.463,.313,.778],11220:[.713,0,.674],11221:[.582,0,.712],11222:[.563,.063,.712],11223:[.706,-.004,.485,{ic:.016}],11224:[.75,0,.614],11225:[.799,.049,.558],11226:[.742,.144,.346],11227:[.778,0,.626],11228:[.752,0,.57],11229:[.668,.25,.712],11230:[.631,.25,.6],11231:[.38,.25,.712],11232:[.77,.135,.801],11233:[.684,.097,.553],11234:[.737,-.009,.841],11235:[.725,-.081,.717],11236:[.77,.082,.801],11237:[.685,.084,.485],11238:[.706,0,.893],11239:[.625,-.023,.717],11240:[.568,.07,.826],11241:[.568,.07,.826],11248:[.7,.02,.585],11249:[.725,-.023,.485],11250:[.712,-.112,.713],11251:[.497,.015,.778],11252:[.557,0,.496],11253:[.575,.008,.504],11254:[.497,0,.778],11255:[.565,.007,.325],11256:[.377,.015,.456],11257:[.747,.011,1],11258:[.445,-.055,.952],11259:[.445,-.055,1.212],11260:[.67,.17,.486],11261:[.706,-.004,.485,{ic:.016}],11262:[.679,-.013,.778],11263:[.683,-.001,.377],11800:[.5,.256,.472],12306:[.622,.018,.793],12310:[.77,.27,.458],12311:[.77,.27,.458],12336:[.319,-.151,1.216],64256:[.705,0,.583,{ic:.045}],64257:[.705,0,.556],64258:[.705,0,.556],64259:[.705,0,.833],64260:[.705,0,.833],64261:[.705,.011,.669],64262:[.708,.011,.783],65126:[.34,-.086,.333],65279:[0,0,0],127:[.66,0,1.418]}}},"NCM"),{8215:{dir:i,stretch:[0,8215],HDW:[-.103,.293,.504],ext:.112,hd:[-.103,.293]}},["MJX-NCM-SY"]);
@@ -0,0 +1 @@
1
+ import{i,n as c}from"./mathjax-D2JHb_R_-64780dc5.js";c.dynamicSetup("","symbols-b-i",i({SYB:{bold:{161:[.5,.205,.35],162:[.516,.072,.511],164:[.543,.042,.894],166:[.75,.25,.319],169:[.686,0,.686],170:[.697,-.292,.496],171:[.472,0,.639],173:[.271,-.174,.383],174:[.686,0,.686],186:[.697,-.292,.482],187:[.472,0,.639],188:[.697,.01,.983],189:[.697,.01,.983],190:[.697,.01,.983],191:[.5,.2,.543],3647:[.758,.072,.818],8218:[.154,.196,.319],8219:[.694,-.346,.319],8222:[.154,.196,.571],8223:[.694,-.346,.411,{ic:.024}],8226:[.381,-.077,.894],8233:[.694,.195,.543],8240:[.75,.056,1.288],8241:[.75,.056,1.667],8249:[.472,0,.445],8250:[.472,0,.445],8251:[.543,.042,.894],8253:[.769,0,.543],8255:[-.068,.194,.732],8256:[.668,-.542,.732],8261:[.751,.257,.415],8262:[.751,.25,.415],8274:[.751,-.001,.575],8276:[-.068,.194,.732],8319:[.568,-.297,.383],8320:[.347,.055,.447],8353:[.758,.072,.831],8358:[.686,0,.9],8361:[.686,.008,1.189],8362:[.696,.005,1.042],8363:[.694,.048,.639],8369:[.686,0,.786],8370:[.75,.055,.904],8451:[.699,.01,1.086],8470:[.693,.005,1.103],8471:[.686,0,.686],8478:[.686,.011,.863],8480:[.686,-.261,1.038],8482:[.693,-.281,1.135],8494:[.696,.005,.795],8960:[.633,.132,.894],9250:[.694,.006,.639],9251:[.253,.11,.575],11800:[.499,.205,.543],64256:[.7,0,.671,{ic:.075}],64257:[.7,0,.639],64258:[.7,0,.639],64259:[.7,0,.958],64260:[.7,0,.958],64261:[.7,.006,.797],64262:[.708,.006,.867],65126:[.404,-.084,.383]}},SYI:{italic:{161:[.5,.216,.307,{ic:.013}],162:[.476,.045,.46,{ic:.01}],164:[.48,-.018,.767],166:[.75,.25,.278,{ic:.066}],169:[.683,0,.683],170:[.705,-.337,.473,{ic:.07}],171:[.483,0,.562],173:[.243,-.187,.358],174:[.683,0,.683],186:[.705,-.337,.429,{ic:.091}],187:[.483,0,.562],188:[.705,.116,.807,{ic:.031}],189:[.705,.013,.807],190:[.705,.116,.807,{ic:.031}],191:[.5,.216,.511],3647:[.728,.045,.704,{ic:.03}],8218:[.104,.195,.307],8219:[.694,-.396,.307,{ic:.08}],8222:[.104,.195,.49],8223:[.694,-.396,.361,{ic:.151}],8226:[.379,-.081,.767],8233:[.694,.194,.485,{ic:.116}],8240:[.75,.056,1.083],8241:[.75,.056,1.379,{ic:.007}],8249:[.483,0,.358,{ic:.016}],8250:[.483,0,.358],8251:[.471,-.018,.767],8253:[.756,0,.511,{ic:.04}],8255:[.327,-.077,.358,{ic:.001}],8256:[.666,-.538,.691,{ic:.001}],8261:[.751,.252,.383,{ic:.093}],8262:[.751,.249,.383,{ic:.063}],8274:[.751,-.001,.511,{ic:.105}],8276:[-.066,.194,.691],8320:[.347,.055,.409],8353:[.728,.045,.716,{ic:.096}],8358:[.683,0,.743,{ic:.109}],8361:[.683,.022,.999,{ic:.125}],8363:[.694,.03,.511,{ic:.056}],8369:[.683,0,.678,{ic:.052}],8370:[.749,.055,.773,{ic:.037}],8451:[.706,.021,.92,{ic:.096}],8470:[.695,.01,.894,{ic:.009}],8471:[.683,0,.683],8478:[.683,.022,.729],8480:[.683,-.247,.875,{ic:.083}],8482:[.687,-.277,.967,{ic:.098}],8494:[.701,.01,.673,{ic:.056}],8960:[.557,.057,.767,{ic:.063}],9250:[.694,.011,.46],9251:[.251,.105,.511],11800:[.499,.216,.511],64256:[.705,.205,.613,{ic:.145}],64257:[.705,.205,.562,{ic:.034}],64258:[.705,.205,.588,{ic:.049}],64259:[.705,.205,.882,{ic:.034}],64260:[.705,.205,.894,{ic:.049}],64261:[.705,.205,.612,{ic:.041}],64262:[.708,.011,.741,{ic:.041}],65126:[.325,-.075,.358],163:[.706,.011,.769],165:[.683,0,.743,{ic:.131}],167:[.713,.213,.49,{ic:.047}],172:[.367,-.133,.767,{ic:.014}],177:[.614,0,.767],181:[.441,.216,.511,{ic:.024}],182:[.694,.194,.611,{ic:.144}],183:[.346,-.24,.278],215:[.471,-.018,.767],240:[.695,.011,.511,{ic:.024}],247:[.46,-.04,.767],8224:[.705,.216,.444,{ic:.052}],8225:[.705,.205,.444,{ic:.064}]}},SYBI:{"bold-italic":{161:[.5,.211,.386],162:[.516,.072,.532,{ic:.004}],164:[.516,.015,.886],166:[.75,.25,.319,{ic:.059}],169:[.686,0,.686],170:[.703,-.318,.544,{ic:.073}],171:[.472,0,.65],173:[.269,-.175,.414],174:[.686,0,.686],186:[.703,-.318,.496,{ic:.095}],187:[.472,0,.65],188:[.703,.116,.966,{ic:.002}],189:[.703,.01,.966],190:[.703,.116,.966,{ic:.002}],191:[.5,.211,.591],3647:[.758,.072,.817,{ic:.014}],8218:[.144,.197,.356],8219:[.695,-.354,.355,{ic:.081}],8222:[.144,.197,.59],8223:[.695,-.354,.444,{ic:.163}],8226:[.386,-.072,.886],8233:[.694,.194,.562,{ic:.103}],8240:[.75,.056,1.222],8241:[.75,.056,1.578],8249:[.472,0,.409],8250:[.472,0,.409],8251:[.516,.015,.886],8253:[.775,0,.591,{ic:.023}],8255:[-.068,.194,.798],8256:[.668,-.542,.798],8261:[.751,.257,.444,{ic:.084}],8262:[.751,.249,.444,{ic:.062}],8274:[.75,-.001,.591,{ic:.089}],8276:[-.068,.194,.798],8320:[.347,.055,.473],8353:[.758,.072,.827,{ic:.082}],8358:[.686,0,.896,{ic:.107}],8361:[.686,.017,1.16,{ic:.114}],8362:[.696,.005,1.042,{ic:.046}],8363:[.695,.048,.591,{ic:.031}],8369:[.686,0,.787,{ic:.038}],8370:[.75,.055,.895,{ic:.013}],8451:[.709,.021,1.062,{ic:.083}],8470:[.698,.01,1.087],8471:[.686,0,.686],8478:[.686,.017,.859],8480:[.686,-.254,1.034,{ic:.076}],8482:[.693,-.281,1.121,{ic:.094}],8494:[.704,.01,.796,{ic:.047}],8960:[.603,.102,.886,{ic:.059}],9250:[.695,.008,.532,{ic:.005}],9251:[.253,.11,.591],11800:[.5,.216,.591],64256:[.702,.202,.756,{ic:.138}],64257:[.702,.202,.674,{ic:.034}],64258:[.702,.202,.704,{ic:.045}],64259:[.702,.202,1.045,{ic:.034}],64260:[.702,.202,1.059,{ic:.045}],64261:[.702,.202,.735,{ic:.034}],64262:[.708,.008,.85,{ic:.034}],65126:[.382,-.066,.414],163:[.706,.008,.869],165:[.686,0,.866,{ic:.119}],167:[.714,.214,.685,{ic:.026}],172:[.393,-.108,.886,{ic:.006}],177:[.693,0,.886],181:[.455,.216,.591,{ic:.034}],182:[.694,.194,.703,{ic:.141}],183:[.387,-.24,.278,{ic:.025}],215:[.516,.015,.886],240:[.695,.011,.591,{ic:.022}],247:[.558,.057,.886],8224:[.702,.211,.511,{ic:.054}],8225:[.702,.202,.511,{ic:.062}]}}},"NCM"),{},["MJX-NCM-SYB","MJX-NCM-SYI","MJX-NCM-SYBI"]);
@@ -0,0 +1,248 @@
1
+ import{t as it}from"./defineProperty-a20a667d.js";import{c as zo,g as Vo,n as Bo,o as Fo}from"./tool-host-contract-b93b482c.js";import{i as Uo}from"./provider-4c704118.js";import{t as Ko}from"./sanitize-svg-icon-b9082bba.js";var Xo=class{serialize(t,e){return{startContainer:this.getNodePath(t.startContainer,e),startOffset:t.startOffset,endContainer:this.getNodePath(t.endContainer,e),endOffset:t.endOffset,text:t.toString()}}deserialize(t,e){const n=this.findNodeByPath(t.startContainer,e),r=this.findNodeByPath(t.endContainer,e);if(!n||!r)return null;try{const i=new Range;return i.setStart(n,t.startOffset),i.setEnd(r,t.endOffset),i.toString()===t.text?i:null}catch(i){return console.warn("Failed to deserialize range:",i),null}}getNodePath(t,e){if(t===e)return"";if(t.nodeType===Node.TEXT_NODE){const n=t.parentElement;if(!n)throw new Error("Text node has no parent");const r=Array.from(n.childNodes).filter(i=>i.nodeType===Node.TEXT_NODE).indexOf(t);return`${this.getElementPath(n,e)}::text[${r}]`}if(t.nodeType===Node.ELEMENT_NODE)return this.getElementPath(t,e);throw new Error(`Unsupported node type: ${t.nodeType}`)}getElementPath(t,e){if(t===e)return"";const n=[];let r=t;for(;r&&r!==e;){if(r.id){n.unshift(`#${r.id}`);break}const i=r.parentElement;if(!i)break;const o=Array.from(i.children).filter(c=>c.tagName===r.tagName),a=o.indexOf(r),l=o.length>1?`${r.tagName.toLowerCase()}:nth-of-type(${a+1})`:r.tagName.toLowerCase();n.unshift(l),r=i}return n.join(" > ")}findNodeByPath(t,e){if(t==="")return e;if(t.includes("::text[")){const[n,r]=t.split("::text["),i=Number.parseInt(r.replace("]",""),10),o=n?e.querySelector(n):e;return o&&Array.from(o.childNodes).filter(a=>a.nodeType===Node.TEXT_NODE)[i]||null}try{return e.querySelector(t)}catch(n){return console.warn("Invalid selector path:",t,n),null}}serializeMany(t,e){return t.map(n=>this.serialize(n,e))}deserializeMany(t,e){return t.map(n=>this.deserialize(n,e))}},bt;(function(t){t.TTS_WORD="tts-word",t.TTS_SENTENCE="tts-sentence",t.ANNOTATION="annotation"})(bt||(bt={}));var wt;(function(t){t.YELLOW="yellow",t.GREEN="green",t.BLUE="blue",t.PINK="pink",t.ORANGE="orange",t.UNDERLINE="underline"})(wt||(wt={}));var Ti=class cr{constructor(){if(it(this,"ttsWordHighlight",null),it(this,"ttsSentenceHighlight",null),it(this,"ttsWordElementHighlights",new Set),it(this,"ttsSentenceElementHighlights",new Set),it(this,"annotations",new Map),it(this,"colorHighlights",new Map),it(this,"nextAnnotationId",1),it(this,"supported",!1),it(this,"rangeSerializer",void 0),it(this,"themeObserver",null),it(this,"explicitTTSColorOverride",null),this.rangeSerializer=new Xo,typeof CSS>"u"||!("highlights"in CSS)){console.warn("CSS Custom Highlight API not supported (SSR or unsupported browser)");return}this.supported=!0,this.initializeHighlights(),this.registerStyles(),this.applyAdaptiveTTSStyle(),this.setupThemeObservation()}setupThemeObservation(){if(typeof document>"u"||typeof MutationObserver>"u")return;const e=()=>this.applyAdaptiveTTSStyle();this.themeObserver=new MutationObserver(e),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["style","data-theme","data-color-scheme","class"]});for(const n of document.querySelectorAll("pie-theme"))this.themeObserver.observe(n,{attributes:!0,attributeFilter:["theme","scheme","provider","variables","style","data-theme","data-color-scheme"]})}parseColor(e){if(!e)return null;const n=e.trim();if(!n)return null;const r=/^#([a-f\d]{3}|[a-f\d]{6})$/i.exec(n);if(r){const o=r[1];return o.length===3?[parseInt(o[0]+o[0],16),parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16)]:[parseInt(o.slice(0,2),16),parseInt(o.slice(2,4),16),parseInt(o.slice(4,6),16)]}const i=/^rgba?\((.+)\)$/i.exec(n);if(i){const o=i[1].replace(/\//g,",").split(/[,\s]+/).map(h=>h.trim()).filter(Boolean),a=Number(o[0]),l=Number(o[1]),c=Number(o[2]);if(Number.isFinite(a)&&Number.isFinite(l)&&Number.isFinite(c))return[a,l,c]}if(typeof document<"u"){const o=document.createElement("span");if(o.style.color=n,typeof o.style.color=="string"&&o.style.color){document.body?.appendChild(o);const a=typeof getComputedStyle=="function"?getComputedStyle(o).color:"";o.remove();const l=a.trim();if(l&&l!==n)return this.parseColor(a)}}return null}relativeLuminance([e,n,r]){const i=c=>{const h=c/255;return h<=.03928?h/12.92:((h+.055)/1.055)**2.4},o=i(e),a=i(n),l=i(r);return .2126*o+.7152*a+.0722*l}contrastRatio(e,n){const r=this.relativeLuminance(e),i=this.relativeLuminance(n),o=Math.max(r,i),a=Math.min(r,i);return(o+.05)/(a+.05)}blend(e,n,r){return[Math.round(e[0]*r+n[0]*(1-r)),Math.round(e[1]*r+n[1]*(1-r)),Math.round(e[2]*r+n[2]*(1-r))]}resolveAdaptiveTTSStyle(e){const n=[255,235,59],r=[17,24,39],i=[255,255,255],o=e||(typeof document<"u"?document.documentElement:null),a=o&&typeof getComputedStyle=="function"?getComputedStyle(o):null,l=this.parseColor(a?.getPropertyValue("--pie-background")||a?.backgroundColor)||i,c=this.parseColor(a?.getPropertyValue("--pie-text"))||r,h=this.explicitTTSColorOverride?this.parseColor(this.explicitTTSColorOverride.color)||n:this.parseColor(a?.getPropertyValue("--pie-missing"))||n,d=this.explicitTTSColorOverride?[Math.max(.3,Math.min(.95,this.explicitTTSColorOverride.opacity))]:[.8,.72,.68,.62,.56,.5];let f=d[d.length-1],m=-1/0;for(const P of d){const I=this.blend(h,l,P),D=this.contrastRatio(I,l),K=this.contrastRatio(I,c),X=D*1.2+K*.8;if(D>=1.25&&K>=2.4){f=P;break}X>m&&(m=X,f=P)}const g=Math.max(.24,Math.min(.85,f*.55)),w=Math.max(.55,Math.min(.95,f+.2)),x=Math.max(.22,Math.min(.6,f*.45)),p=c,y=this.blend(p,l,w),R=this.contrastRatio(y,l),W=this.relativeLuminance(l)>.45?[0,0,0]:[255,255,255],k=R>=1.35?p:W;return{wordHighlight:`rgba(${h[0]}, ${h[1]}, ${h[2]}, ${f})`,sentenceHighlight:`rgba(${h[0]}, ${h[1]}, ${h[2]}, ${g})`,wordUnderline:`rgba(${k[0]}, ${k[1]}, ${k[2]}, ${w})`,wordShadow:`rgba(${k[0]}, ${k[1]}, ${k[2]}, ${x})`}}applyAdaptiveTTSStyle(e){if(typeof document>"u")return;const n=this.resolveAdaptiveTTSStyle(e);document.documentElement.style.setProperty("--pie-tts-word-highlight",n.wordHighlight),document.documentElement.style.setProperty("--pie-tts-sentence-highlight",n.sentenceHighlight),document.documentElement.style.setProperty("--pie-tts-line-highlight",n.sentenceHighlight),document.documentElement.style.setProperty("--pie-tts-word-underline",n.wordUnderline),document.documentElement.style.setProperty("--pie-tts-word-shadow",n.wordShadow)}initializeHighlights(){if(this.supported){this.ttsWordHighlight=new Highlight,this.ttsSentenceHighlight=new Highlight,CSS.highlights.set("tts-word",this.ttsWordHighlight),CSS.highlights.set("tts-sentence",this.ttsSentenceHighlight);for(const e of Object.values(wt)){const n=new Highlight;this.colorHighlights.set(e,n),CSS.highlights.set(`annotation-${e}`,n)}}}registerStyles(){if(!this.supported||typeof document>"u"||document.getElementById("pie-highlight-styles"))return;const e=document.createElement("style");e.id="pie-highlight-styles",e.textContent=`
2
+ /* TTS highlights - temporary */
3
+ ::highlight(tts-word) {
4
+ background-color: var(--pie-tts-word-highlight, color-mix(in srgb, var(--pie-missing, #ffeb3b) 68%, transparent));
5
+ text-decoration: underline 2px solid var(--pie-tts-word-underline, color-mix(in srgb, var(--pie-text, #111827) 70%, transparent));
6
+ text-underline-offset: 2px;
7
+ text-shadow: 0 0 1px var(--pie-tts-word-shadow, color-mix(in srgb, var(--pie-text, #111827) 35%, transparent));
8
+ color: inherit;
9
+ }
10
+
11
+ /* tts-sentence registry id: coarse read-along band (visual line boxes in layout) */
12
+ ::highlight(tts-sentence) {
13
+ background-color: var(--pie-tts-line-highlight, var(--pie-tts-sentence-highlight, color-mix(in srgb, var(--pie-missing, #ffeb3b) 38%, transparent)));
14
+ color: inherit;
15
+ }
16
+
17
+ [data-pie-tts-sentence-element="true"] {
18
+ background-color: var(--pie-tts-line-highlight, var(--pie-tts-sentence-highlight, color-mix(in srgb, var(--pie-missing, #ffeb3b) 38%, transparent)));
19
+ border-radius: 0.12em;
20
+ box-decoration-break: clone;
21
+ -webkit-box-decoration-break: clone;
22
+ }
23
+
24
+ [data-pie-tts-word-element="true"] {
25
+ background-color: var(--pie-tts-word-highlight, color-mix(in srgb, var(--pie-missing, #ffeb3b) 68%, transparent));
26
+ text-decoration: underline 2px solid var(--pie-tts-word-underline, color-mix(in srgb, var(--pie-text, #111827) 70%, transparent));
27
+ text-underline-offset: 2px;
28
+ text-shadow: 0 0 1px var(--pie-tts-word-shadow, color-mix(in srgb, var(--pie-text, #111827) 35%, transparent));
29
+ border-bottom: 2px solid var(--pie-tts-word-underline, color-mix(in srgb, var(--pie-text, #111827) 70%, transparent));
30
+ padding-bottom: 1px;
31
+ border-radius: 0.12em;
32
+ box-decoration-break: clone;
33
+ -webkit-box-decoration-break: clone;
34
+ }
35
+
36
+ /* Annotation highlights - persistent */
37
+ ::highlight(annotation-yellow) {
38
+ background-color: var(--pie-annotation-yellow-highlight, rgba(253, 233, 149, 0.5));
39
+ color: inherit;
40
+ }
41
+
42
+ ::highlight(annotation-green) {
43
+ background-color: var(--pie-annotation-green-highlight, rgba(166, 225, 197, 0.5));
44
+ color: inherit;
45
+ }
46
+
47
+ ::highlight(annotation-blue) {
48
+ background-color: var(--pie-annotation-blue-highlight, rgba(167, 224, 246, 0.5));
49
+ color: inherit;
50
+ }
51
+
52
+ ::highlight(annotation-pink) {
53
+ background-color: var(--pie-annotation-pink-highlight, rgba(255, 159, 174, 0.5));
54
+ color: inherit;
55
+ }
56
+
57
+ ::highlight(annotation-orange) {
58
+ background-color: var(--pie-annotation-orange-highlight, rgba(255, 165, 0, 0.5));
59
+ color: inherit;
60
+ }
61
+
62
+ /* The base light/dark pair is fixed: #4221d5 on light, #9c89ec on dark.
63
+ One value cannot serve both -- #4221d5 is 2.41:1 on black and #9c89ec is
64
+ 2.85:1 on white -- so neither of those two consults the theme accent,
65
+ which is chosen against one background and illegible on the other.
66
+
67
+ Each state has its own token so overriding one never silently moves the
68
+ other, and so either can beat a host-set pie-primary: a var() fallback
69
+ can never override a value the host actually set. */
70
+ ::highlight(annotation-underline) {
71
+ background-color: transparent;
72
+ text-decoration: underline 2px solid var(--pie-annotation-underline, #4221d5);
73
+ text-underline-offset: 2px;
74
+ color: inherit;
75
+ }
76
+
77
+ /* The blocks below cover annotation swatches, print, and reduced motion.
78
+ They deliberately do NOT retune the TTS layers: applyAdaptiveTTSStyle()
79
+ writes the pie-tts custom properties inline on documentElement on every
80
+ paint and on theme change, so a media query that only varies a var()
81
+ fallback for those can never take effect. Annotation colours have no such
82
+ adaptive path -- they are fixed swatches a student chose -- so a media
83
+ query is the only way to adjust them, and each keeps its var() so a host
84
+ override still wins.
85
+
86
+ The names above are spelled without their leading dashes on purpose.
87
+ check-theme-tokens scans comments, and its token pattern stops at the
88
+ first non-alphanumeric character, so writing the wildcard form reads as
89
+ consumption of a shorter token that is not in the registry and fails the
90
+ check. Spell property names in full, or omit the dashes. */
91
+
92
+ @media (prefers-color-scheme: dark) {
93
+ ::highlight(annotation-yellow) {
94
+ background-color: var(--pie-annotation-yellow-highlight, rgba(139, 117, 0, 0.6));
95
+ }
96
+ ::highlight(annotation-green) {
97
+ background-color: var(--pie-annotation-green-highlight, rgba(45, 92, 63, 0.6));
98
+ }
99
+ ::highlight(annotation-blue) {
100
+ background-color: var(--pie-annotation-blue-highlight, rgba(0, 102, 170, 0.6));
101
+ }
102
+ ::highlight(annotation-pink) {
103
+ background-color: var(--pie-annotation-pink-highlight, rgba(139, 51, 74, 0.6));
104
+ }
105
+ ::highlight(annotation-orange) {
106
+ background-color: var(--pie-annotation-orange-highlight, rgba(154, 99, 0, 0.6));
107
+ }
108
+ ::highlight(annotation-underline) {
109
+ text-decoration-color: var(--pie-annotation-underline-dark, #9c89ec);
110
+ }
111
+ }
112
+
113
+ /* The media query above reports the OS preference, which is only a guess
114
+ at what the page is actually showing. An app that declares a theme has
115
+ the final say, so the rules below override it. pie-theme always stamps
116
+ data-theme on documentElement (scope="document") or on its own host, and
117
+ resolves to a dark palette only for the literal value "dark" -- every
118
+ other value, including DaisyUI theme ids, maps to a light base.
119
+
120
+ The three cases are mutually exclusive, so they never fight each other.
121
+ All carry attribute selectors, which outrank the bare ::highlight() rules
122
+ above -- including the one inside the media query, since a media query
123
+ adds no specificity -- whatever the source order. */
124
+ [data-theme="light"] ::highlight(annotation-underline) {
125
+ text-decoration-color: var(--pie-annotation-underline, #4221d5);
126
+ }
127
+
128
+ [data-theme="dark"] ::highlight(annotation-underline) {
129
+ text-decoration-color: var(--pie-annotation-underline-dark, #9c89ec);
130
+ }
131
+
132
+ /* A host or DaisyUI palette: follow its accent so the mark belongs to that
133
+ theme, falling back to the light default when it declares none. */
134
+ [data-theme]:not([data-theme="light"]):not([data-theme="dark"]) ::highlight(annotation-underline) {
135
+ text-decoration-color: var(--pie-annotation-underline, var(--pie-primary, #4221d5));
136
+ }
137
+
138
+ /* WCAG 2.2 SC 1.4.11 non-text contrast: a highlight is the only indication
139
+ that text is annotated, so the swatches saturate and the underline
140
+ thickens when the user asks for more contrast.
141
+
142
+ The value is "more", not "high". The stylesheet this was recovered from
143
+ used prefers-contrast: high, which is not a valid value for the feature
144
+ -- the keywords are no-preference, more, less, custom. An invalid query
145
+ evaluates to "not all", so that block could never have matched in any
146
+ browser even had the file been loaded. Verified with matchMedia under
147
+ emulation: "high" stays false where "more" flips true. */
148
+ @media (prefers-contrast: more) {
149
+ ::highlight(annotation-yellow) {
150
+ background-color: var(--pie-annotation-yellow-highlight, rgba(255, 255, 0, 0.7));
151
+ }
152
+ ::highlight(annotation-green) {
153
+ background-color: var(--pie-annotation-green-highlight, rgba(0, 255, 127, 0.7));
154
+ }
155
+ ::highlight(annotation-blue) {
156
+ background-color: var(--pie-annotation-blue-highlight, rgba(0, 191, 255, 0.7));
157
+ }
158
+ ::highlight(annotation-pink) {
159
+ background-color: var(--pie-annotation-pink-highlight, rgba(255, 105, 180, 0.7));
160
+ }
161
+ ::highlight(annotation-orange) {
162
+ background-color: var(--pie-annotation-orange-highlight, rgba(255, 165, 0, 0.85));
163
+ }
164
+ ::highlight(annotation-underline) {
165
+ text-decoration-thickness: 3px;
166
+ }
167
+ }
168
+
169
+ @media print {
170
+ /* TTS highlighting is a transient read-along cue, not content. */
171
+ ::highlight(tts-word),
172
+ ::highlight(tts-sentence),
173
+ [data-pie-tts-word-element="true"],
174
+ [data-pie-tts-sentence-element="true"] {
175
+ background-color: transparent;
176
+ text-decoration: none;
177
+ text-shadow: none;
178
+ border-bottom: none;
179
+ }
180
+
181
+ /* Annotations are student work and must survive printing, but a fill
182
+ that reads fine on screen can print as an illegible wash, so each
183
+ becomes an underline that keeps its colour coding. */
184
+ ::highlight(annotation-yellow),
185
+ ::highlight(annotation-green),
186
+ ::highlight(annotation-blue),
187
+ ::highlight(annotation-pink),
188
+ ::highlight(annotation-orange) {
189
+ background-color: transparent;
190
+ border-bottom: 2px solid currentColor;
191
+ }
192
+ ::highlight(annotation-yellow) { border-bottom-color: #ffeb3b; }
193
+ ::highlight(annotation-green) { border-bottom-color: #a6e1c5; }
194
+ ::highlight(annotation-blue) { border-bottom-color: #a7e0f6; }
195
+ ::highlight(annotation-pink) { border-bottom-color: #ff9fae; }
196
+ ::highlight(annotation-orange) { border-bottom-color: #ffa500; }
197
+ ::highlight(annotation-underline) {
198
+ text-decoration-color: #000;
199
+ border-bottom: none;
200
+ }
201
+ }
202
+
203
+ /* text-shadow is a direct property rather than a var(), so unlike the
204
+ other TTS rules this one is not overridden by the adaptive path. */
205
+ @media (prefers-reduced-motion: reduce) {
206
+ ::highlight(tts-word),
207
+ [data-pie-tts-word-element="true"] {
208
+ text-shadow: none;
209
+ }
210
+ }
211
+ `,document.head.appendChild(e)}highlightTTSWord(e,n,r){if(!this.ttsWordHighlight)return;this.applyAdaptiveTTSStyle(e.parentElement),this.clearTTSWord();const i=document.createRange();i.setStart(e,n),i.setEnd(e,r),this.ttsWordHighlight.add(i)}highlightTTSWordElement(e){this.ttsWordHighlight&&(this.applyAdaptiveTTSStyle(e),this.clearTTSWord(),e.setAttribute("data-pie-tts-word-element","true"),this.ttsWordElementHighlights.add(e))}highlightTTSSentence(e){if(!this.ttsSentenceHighlight)return;const n=e[0]?.startContainer,r=n?.nodeType===Node.ELEMENT_NODE?n:n?.parentElement;this.applyAdaptiveTTSStyle(r),this.clearTTSSentence();for(const i of e)this.ttsSentenceHighlight.add(i);this.highlightTTSElementFallbacks(e)}highlightTTSSentenceElements(e){if(this.ttsSentenceHighlight){this.applyAdaptiveTTSStyle(e[0]||null),this.clearTTSSentence();for(const n of e)n.setAttribute("data-pie-tts-sentence-element","true"),this.ttsSentenceElementHighlights.add(n)}}highlightTTSElementFallbacks(e){typeof Element>"u"||this.highlightElementFallbacks(e,"data-pie-tts-sentence-element",this.ttsSentenceElementHighlights,cr.SENTENCE_FALLBACK_SELECTOR)}highlightTTSWordElementFallbacks(e){typeof Element>"u"||this.highlightElementFallbacks(e,"data-pie-tts-word-element",this.ttsWordElementHighlights,cr.WORD_FALLBACK_SELECTOR)}highlightElementFallbacks(e,n,r,i){for(const o of e){const a=o.commonAncestorContainer.nodeType===Node.ELEMENT_NODE?o.commonAncestorContainer:o.commonAncestorContainer.parentElement;if(!a)continue;const l=[],c=o.startContainer.nodeType===Node.ELEMENT_NODE?o.startContainer:o.startContainer.parentElement,h=o.endContainer.nodeType===Node.ELEMENT_NODE?o.endContainer:o.endContainer.parentElement;for(const d of[c,h]){let f=d;for(;f;)f.matches?.(i)&&l.push(f),f=f.parentElement}a.matches?.(i)&&l.push(a),l.push(...Array.from(a.querySelectorAll(i)));for(const d of new Set(l)){try{if(!o.intersectsNode(d)&&!d.contains(c)&&!d.contains(h))continue}catch{continue}d.setAttribute(n,"true"),r.add(d)}}}clearTTSWord(){if(this.ttsWordHighlight){this.ttsWordHighlight.clear();for(const e of this.ttsWordElementHighlights)e.removeAttribute("data-pie-tts-word-element");this.ttsWordElementHighlights.clear()}}clearTTSSentence(){if(this.ttsSentenceHighlight){this.ttsSentenceHighlight.clear();for(const e of this.ttsSentenceElementHighlights)e.removeAttribute("data-pie-tts-sentence-element");this.ttsSentenceElementHighlights.clear()}}clearTTS(){this.clearTTSWord(),this.clearTTSSentence()}addAnnotation(e,n=wt.YELLOW){const r=`annotation-${this.nextAnnotationId++}`,i=e.cloneRange(),o={id:r,range:i,type:bt.ANNOTATION,color:n,timestamp:Date.now()};this.annotations.set(r,o);const a=this.colorHighlights.get(n);return a&&a.add(i),r}removeAnnotation(e){const n=this.annotations.get(e);if(!n){console.warn(`[HighlightCoordinator] Annotation ${e} not found`);return}console.log(`[HighlightCoordinator] Removing annotation ${e} (color: ${n.color})`);const r=this.colorHighlights.get(n.color);if(r){const i=r.delete(n.range);console.log("[HighlightCoordinator] Highlight.delete() returned:",i)}this.annotations.delete(e),console.log(`[HighlightCoordinator] Annotation ${e} removed from map. Remaining:`,this.annotations.size)}clearAnnotations(){for(const e of this.colorHighlights.values())e.clear();this.annotations.clear()}getAnnotations(){return Array.from(this.annotations.values())}getAnnotation(e){return this.annotations.get(e)??null}changeAnnotationColor(e,n){const r=this.annotations.get(e);if(!r)return;const i=r.color;if(i===n)return;const o=this.colorHighlights.get(i);o&&o.delete(r.range),r.color=n;const a=this.colorHighlights.get(n);a&&a.add(r.range)}exportAnnotations(e=document.body){return this.getAnnotations().map(n=>({...this.rangeSerializer.serialize(n.range,e),id:n.id,color:n.color,timestamp:n.timestamp}))}importAnnotations(e,n=document.body){let r=0;for(const i of e){const o=this.rangeSerializer.deserialize(i,n);o&&(this.addAnnotation(o,i.color),r++)}return r}highlightRange(e,n,r=wt.YELLOW){if(this.supported)switch(n){case bt.TTS_WORD:case bt.TTS_SENTENCE:{const i=n===bt.TTS_WORD?this.ttsWordHighlight:this.ttsSentenceHighlight;if(i&&(i.clear(),i.add(e),n===bt.TTS_WORD)){for(const o of this.ttsWordElementHighlights)o.removeAttribute("data-pie-tts-word-element");this.ttsWordElementHighlights.clear(),this.highlightTTSWordElementFallbacks([e])}break}case bt.ANNOTATION:this.addAnnotation(e,r)}}clearHighlights(e){if(this.supported)switch(e){case bt.TTS_WORD:this.clearTTSWord();break;case bt.TTS_SENTENCE:this.clearTTSSentence();break;case bt.ANNOTATION:this.clearAnnotations()}}clearAll(){this.supported&&(this.clearTTS(),this.clearAnnotations())}isSupported(){return this.supported}updateTTSHighlightStyle(e,n){if(!this.supported||typeof document>"u"||!document.getElementById("pie-highlight-styles"))return;const i=(o=>{const a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(o);return a?{r:parseInt(a[1],16),g:parseInt(a[2],16),b:parseInt(a[3],16)}:null})(e);i&&(this.explicitTTSColorOverride={color:`rgb(${i.r}, ${i.g}, ${i.b})`,opacity:Math.max(.2,Math.min(.95,n))},this.applyAdaptiveTTSStyle())}destroy(){this.supported&&(this.clearTTS(),this.clearAnnotations(),this.themeObserver?.disconnect(),this.themeObserver=null)}};it(Ti,"SENTENCE_FALLBACK_SELECTOR","math, mjx-container, svg, img, canvas, [role='img']");it(Ti,"WORD_FALLBACK_SELECTOR","svg, img, canvas, [role='img']");if(typeof window<"u"){var Zr,Gr;((Zr=(Gr=window).__svelte??(Gr.__svelte={})).v??(Zr.v=new Set)).add("5")}var pe={},F=Symbol("uninitialized"),Jo="http://www.w3.org/2000/svg",Yo="http://www.w3.org/1998/Math/MathML",ki=Array.isArray,Zo=Array.prototype.indexOf,ur=Array.prototype.includes,zn=Array.from,Nn=Object.keys,Ue=Object.defineProperty,ue=Object.getOwnPropertyDescriptor,Go=Object.getOwnPropertyDescriptors,Qo=Object.prototype,ta=Array.prototype,$i=Object.getPrototypeOf,Qr=Object.isExtensible,ea=()=>{};function na(t){for(var e=0;e<t.length;e++)t[e]()}function xi(){var t,e;return{promise:new Promise((n,r)=>{t=n,e=r}),resolve:t,reject:e}}function Ke(t){"@babel/helpers - typeof";return Ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ke(t)}function ra(t,e){if(Ke(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Ke(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ia(t){var e=ra(t,"string");return Ke(e)=="symbol"?e:e+""}function H(t,e,n){return(e=ia(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var vt=1024,St=2048,me=4096,Ar=8192,oa=16384,Mr=32768,ti=1<<25,Nr=65536,Oe=1<<19,aa=1<<20,ze=1<<25,ei=1<<21,sa=1<<22,Cn=1<<23,Ve=Symbol("$state"),Si=Symbol("component"),_i=Symbol("legacy props"),la=Symbol(""),fr=Symbol("attributes"),dr=Symbol("class"),vr=Symbol("style"),_n=Symbol("text"),Qe=new class extends Error{constructor(...t){super(...t),H(this,"name","StaleReactionError"),H(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},ha=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function ca(){console.warn("https://svelte.dev/e/derived_inert")}function tn(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function ua(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var M=!1;function zt(t){M=t}var C;function Z(t){if(t===null)throw tn(),pe;return C=t}function Ee(){return Z(_t(C))}function qe(t){if(M){if(_t(C)!==null)throw tn(),pe;C=t}}function fa(t=1){if(M){for(var e=t,n=C;e--;)n=_t(n);C=n}}function On(t=!0){for(var e=0,n=C;;){if(n.nodeType===8){var r=n.data;if(r==="]"){if(e===0)return n;e-=1}else(r==="["||r==="[!"||r[0]==="["&&!isNaN(Number(r.slice(1))))&&(e+=1)}var i=_t(n);t&&n.remove(),n=i}}function Ei(t){if(!t||t.nodeType!==8)throw tn(),pe;return t.data}function Ai(t){return t===this.v}function da(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Mi(t){return!da(t,this.v)}function va(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function pa(t,e,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function ga(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function ma(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function ba(t){throw new Error("https://svelte.dev/e/effect_orphan")}function wa(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function ya(){throw new Error("https://svelte.dev/e/hydration_failed")}function Ta(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function ka(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function $a(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function xa(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Sa(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var en=!1,Vn=!1,z=null;function Ae(t){z=t}function Ni(t,e=!1,n){z={p:z,i:!1,c:null,e:null,s:t,x:null,r:E,l:Vn&&!e?{s:null,u:null,$:[]}:null}}function Ci(t){var e=z,n=e.e;if(n!==null){e.e=null;for(var r of n)Gi(r)}return t!==void 0&&(e.x=t),e.i=!0,z=e.p,Cr(t)}function Cr(t={}){return Ue(t,Si,{value:!0}),t}function nn(){return!Vn||z!==null&&z.l===null}var le=[];function Oi(){var t=le;le=[],na(t)}function Qt(t){if(le.length===0&&!Be){var e=le;queueMicrotask(()=>{e===le&&Oi()})}le.push(t)}function _a(){for(;le.length>0;)Oi()}var Ea=~(St|me|vt);function V(t,e){t.f=t.f&Ea|e}function Or(t){(t.f&512)!==0||t.deps===null?V(t,vt):V(t,me)}function Li(t,e,n){(t.f&2048)!==0?e.add(t):t.f&4096&&n.add(t),V(t,vt)}function Bn(t){var e=N,n=E;gt(null),Ht(null);try{return t()}finally{gt(e),Ht(n)}}function Aa(t,e,n,r){const i=nn()?Xe:Lr;var o=t.filter(g=>!g.settled),a=e.map(i);if(n.length===0&&o.length===0){r(a);return}var l=E,c=Ma(),h=o.length===1?o[0].promise:o.length>1?Promise.all(o.map(g=>g.promise)):null;function d(g){if((l.f&16384)===0){c();try{r([...a,...g])}catch(w){Rt(w,l)}Ln()}}var f=Wi();if(n.length===0){h.then(()=>d([])).finally(f);return}function m(){Promise.all(n.map(g=>Na(g))).then(d).catch(g=>Rt(g,l)).finally(f)}h?h.then(()=>{c(),m(),Ln()}):m()}function Ma(){var t=E,e=N,n=z,r=A;return function(i=!0){Ht(t),gt(e),Ae(n),i&&!(t.f&16384)&&(r?.activate(),r?.apply())}}function Ln(t=!0){Ht(null),gt(null),Ae(null),t&&A?.deactivate()}function Wi(){var t=E,e=t.b,n=A,r=!!e?.is_rendered();return e?.update_pending_count(1,n),n.increment(r,t),()=>{e?.update_pending_count(-1,n),n.decrement(r,t)}}function Xe(t){var e=2|St;return E!==null&&(E.f|=Oe),{ctx:z,deps:null,effects:null,equals:Ai,f:e,fn:t,reactions:null,rv:0,v:F,wv:0,parent:E,ac:null}}var Ie=Symbol("obsolete");function Na(t,e,n){let r=E;r===null&&va();var i=void 0,o=ge(F),a=!N,l=new Set;return Ua(()=>{var c=E,h=xi();i=h.promise;try{Promise.resolve(t()).then(h.resolve,g=>{g!==Qe&&h.reject(g)}).finally(Ln)}catch(g){h.reject(g),Ln()}var d=A;if(a){if((c.f&32768)!==0)var f=Wi();if(r.b?.is_rendered())d.async_deriveds.get(c)?.reject(Ie);else for(const g of l.values())g.reject(Ie);l.add(h),d.async_deriveds.set(c,h)}const m=(g,w=void 0)=>{f?.(),l.delete(h),w!==Ie&&(d.activate(),w?(o.f|=Cn,Ne(o,w)):(o.f&8388608&&(o.f^=Cn),Ne(o,g)),d.deactivate())};h.promise.then(m,g=>m(null,g||"unknown"))}),Va(()=>{for(const c of l)c.reject(Ie)}),new Promise(c=>{function h(d){function f(){d===i?c(o):h(i)}d.then(f,f)}h(i)})}function ne(t){const e=Xe(t);return oo(e),e}function Lr(t){const e=Xe(t);return e.equals=Mi,e}function Ca(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)et(e[n])}}function Wr(t){var e,n=E,r=t.parent;if(!Ft&&r!==null&&t.v!==F&&(r.f&24576)!==0)return ca(),t.v;Ht(r);try{Ca(t),e=ho(t)}finally{Ht(n)}return e}function Ri(t){var e=Wr(t);if(!t.equals(e)&&(t.wv=so(),(!A?.is_fork||t.deps===null)&&(A!==null?(A.capture(t,e,!0),gr?.capture(t,e,!0)):t.v=e,t.deps===null))){V(t,vt);return}Ft||(tt!==null?(Hr()||A?.is_fork)&&tt.set(t,e):Or(t))}function Oa(t){if(t.effects!==null)for(const e of t.effects)(e.teardown||e.ac)&&(e.teardown?.(),e.ac!==null&&Bn(()=>{e.ac.abort(Qe),e.ac=null}),e.fn!==null&&(e.teardown=ea),Ye(e,0),Ir(e))}function Hi(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&e.fn!==null&&Ce(e)}function Pi(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Rr(t,e){Pi(t,e),e.add(t)}function $(t,e,n){Pi(t,e),e.set(t,n)}function _(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function T(t,e,n){return t.set(_(t,e),n),n}function s(t,e){return t.get(_(t,e))}var qi,pr=null,ye=null,A=null,gr=null,tt=null,mr=null,Be=!1,Qn=!1,Je=null,Wn=null,Ii=0,La=1,br=new WeakMap,fe=new WeakMap,xe=new WeakMap,Rn=new WeakMap,pn=new WeakMap,Te=new WeakMap,ae=new WeakMap,De=new WeakMap,Ot=new WeakMap,ni=new WeakMap,Me=new WeakMap,Vt=new WeakMap,Zt=new WeakMap,tr=new WeakMap,gn=new WeakMap,B=new WeakSet,be=class Di{constructor(){Rr(this,B),H(this,"id",La++),$(this,br,!1),H(this,"linked",!0),$(this,fe,null),$(this,xe,null),H(this,"async_deriveds",new Map),H(this,"current",new Map),H(this,"previous",new Map),$(this,Rn,new Set),$(this,pn,new Set),$(this,Te,0),$(this,ae,new Map),$(this,De,null),$(this,Ot,[]),$(this,ni,[]),$(this,Me,new Set),$(this,Vt,new Set),$(this,Zt,new Map),$(this,tr,new Set),H(this,"is_fork",!1),$(this,gn,!1),ye===null?pr=ye=this:(T(xe,ye,this),T(fe,this,ye)),ye=this}skip_effect(e){s(Zt,this).has(e)||s(Zt,this).set(e,{d:[],m:[]}),s(tr,this).delete(e)}unskip_effect(e,n=r=>this.schedule(r)){var r=s(Zt,this).get(e);if(r){s(Zt,this).delete(e);for(var i of r.d)V(i,St),n(i);for(i of r.m)V(i,me),n(i)}s(tr,this).add(e)}capture(e,n,r=!1){e.v!==F&&!this.previous.has(e)&&this.previous.set(e,e.v),!(e.f&8388608)&&(this.current.set(e,[n,r]),tt?.set(e,n)),this.is_fork||(e.v=n)}activate(){A=this}deactivate(){A=null,tt=null}flush(){try{Qn=!0,A=this,_(B,this,Hn).call(this)}finally{Ii=0,mr=null,Je=null,Wn=null,Qn=!1,A=null,tt=null,Wt.clear()}}discard(){for(const e of s(pn,this))e(this);s(pn,this).clear();for(const e of this.async_deriveds.values())e.reject(Ie);_(B,this,Pn).call(this),s(De,this)?.resolve()}register_created_effect(e){s(ni,this).push(e)}increment(e,n){if(T(Te,this,s(Te,this)+1),e){let r=s(ae,this).get(n)??0;s(ae,this).set(n,r+1)}}decrement(e,n){if(T(Te,this,s(Te,this)-1),e){let r=s(ae,this).get(n)??0;r===1?s(ae,this).delete(n):s(ae,this).set(n,r-1)}s(gn,this)||(T(gn,this,!0),Qt(()=>{T(gn,this,!1),this.linked&&this.flush()}))}transfer_effects(e,n){for(const r of e)s(Me,this).add(r);for(const r of n)s(Vt,this).add(r);e.clear(),n.clear()}oncommit(e){s(Rn,this).add(e)}ondiscard(e){s(pn,this).add(e)}settled(){return(s(De,this)??T(De,this,xi())).promise}static ensure(){if(A===null){const e=A=new Di;!Qn&&!Be&&Qt(()=>{s(br,e)||e.flush()})}return A}apply(){if(!en||!this.is_fork&&s(fe,this)===null&&s(xe,this)===null){tt=null;return}tt=new Map;for(const[n,[r]]of this.current)tt.set(n,r);for(let n=pr;n!==null;n=s(xe,n))if(!(n===this||n.is_fork)){var e=!1;if(n.id<this.id){for(const[r,[,i]]of n.current)if(!i&&this.current.has(r)){e=!0;break}}if(!e)for(const[r,i]of n.previous)tt.has(r)||tt.set(r,i)}}schedule(e){if(mr=e,e.b?.is_pending&&(e.f&16777228)!==0&&(e.f&32768)===0){e.b.defer_effect(e);return}s(Ot,this).push(e)}};qi=be;function ri(){if(this.is_fork)return!0;for(const n of s(ae,this).keys()){for(var t=n,e=!1;t.parent!==null;){if(s(Zt,this).has(t)){e=!0;break}t=t.parent}if(!e)return!0}return!1}function Wa(){var t=[];for(const i of s(Ot,this))if(!((i.f&16384)!==0||(i.f&6144)===0)){for(var e=i,n=!1;e.parent!==null;){e=e.parent;var r=e.f;if((r&96)!==0){if((r&1024)===0){n=!0;break}e.f^=vt}}n||t.push(e)}return T(Ot,this,[]),t}function Hn(){T(br,this,!0);for(const a of s(Me,this))s(Vt,this).delete(a),V(a,St),this.schedule(a);for(const a of s(Vt,this))V(a,me),this.schedule(a);this.apply();for(var t=Je=[],e=[],n=Wn=[];s(Ot,this).length>0;){Ii++>1e3&&(_(B,this,Pn).call(this),qa());for(const a of _(B,this,Wa).call(this))try{_(B,this,Ra).call(this,a,t,e)}catch(l){throw Vi(a),_(B,this,ri).call(this)||this.discard(),l}}if(A=null,n.length>0){var r=qi.ensure();for(const a of n)r.schedule(a)}if(Je=null,Wn=null,_(B,this,ri).call(this)){_(B,this,mn).call(this,e),_(B,this,mn).call(this,t);for(const[a,l]of s(Zt,this))zi(a,l);n.length>0&&_(B,A,Hn).call(A);return}const i=_(B,this,Ha).call(this);if(i){_(B,this,mn).call(this,e),_(B,this,mn).call(this,t),_(B,i,Pa).call(i,this);return}s(Me,this).clear(),s(Vt,this).clear();for(const a of s(Rn,this))a(this);s(Rn,this).clear(),gr=this,ii(e),ii(t),gr=null,s(De,this)?.resolve();var o=A;if(s(Te,this)===0&&(s(Ot,this).length===0||o!==null)&&_(B,this,Pn).call(this),s(Ot,this).length>0)if(o!==null){for(const a of s(Ot,this))s(Ot,o).push(a);T(Ot,this,[])}else o=this;o!==null&&(Wt.clear(),_(B,o,Hn).call(o))}function Ra(t,e,n){t.f^=vt;for(var r=t.first;r!==null;){var i=r.f,o=(i&96)!==0;if(!(o&&(i&1024)!==0||(i&8192)!==0||s(Zt,this).has(r))&&r.fn!==null){o?r.f^=vt:(i&4)!==0?e.push(r):en&&(i&16777224)!==0?n.push(r):rn(r)&&(i&16&&s(Vt,this).add(r),Ce(r));var a=r.first;if(a!==null){r=a;continue}}for(;r!==null;){var l=r.next;if(l!==null){r=l;break}r=r.parent}}}function Ha(){for(var t=s(fe,this);t!==null;){if(!t.is_fork){for(const[e,[,n]]of this.current)if(t.current.has(e)&&!n)return t}t=s(fe,t)}return null}function Pa(t){for(const[n,r]of t.current)!this.previous.has(n)&&t.previous.has(n)&&this.previous.set(n,t.previous.get(n)),this.current.set(n,r);for(const[n,r]of t.async_deriveds){const i=this.async_deriveds.get(n);i&&r.promise.then(i.resolve).catch(i.reject)}t.async_deriveds.clear(),this.transfer_effects(s(Me,t),s(Vt,t));const e=n=>{var r=n.reactions;if(r!==null&&!((n.f&2)!==0&&(n.f&6144)===0))for(const a of r){var i=a.f;if((i&2)!==0)e(a);else{var o=a;i&4194320&&!this.async_deriveds.has(o)&&(s(Vt,this).delete(o),V(o,St),this.schedule(o))}}};for(const n of this.current.keys())e(n);this.oncommit(()=>t.discard()),_(B,t,Pn).call(t),A=this,_(B,this,Hn).call(this)}function mn(t){for(var e=0;e<t.length;e+=1)Li(t[e],s(Me,this),s(Vt,this))}function Pn(){if(this.linked){var t=s(fe,this),e=s(xe,this);t===null?pr=e:T(xe,t,e),e===null?ye=t:T(fe,e,t),this.linked=!1}}function Se(t){var e=Be;Be=!0;try{var n;for(t&&(A!==null&&!A.is_fork&&A.flush(),n=t());;){if(_a(),A===null)return n;A.flush()}}finally{Be=e}}function qa(){try{wa()}catch(t){Rt(t,mr)}}var Ct=null;function ii(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var r=t[n++];if((r.f&24576)===0&&rn(r)&&(Ct=new Set,Ce(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&no(r),Ct?.size>0)){Wt.clear();for(const i of Ct){if((i.f&24576)!==0)continue;const o=[i];let a=i.parent;for(;a!==null;)Ct.has(a)&&(Ct.delete(a),o.push(a)),a=a.parent;for(let l=o.length-1;l>=0;l--){const c=o[l];!(c.f&24576)&&Ce(c)}}Ct.clear()}}Ct=null}}function ji(t){A.schedule(t)}function zi(t,e){if(!((t.f&32)!==0&&(t.f&1024)!==0)){(t.f&2048)!==0?e.d.push(t):t.f&4096&&e.m.push(t),V(t,vt);for(var n=t.first;n!==null;)zi(n,e),n=n.next}}function Vi(t){V(t,vt);for(var e=t.first;e!==null;)Vi(e),e=e.next}var qn=new Set,Wt=new Map,Bi=!1;function ge(t,e){return{f:0,v:t,reactions:null,equals:Ai,rv:0,wv:0}}function j(t,e){const n=ge(t,e);return oo(n),n}function Fi(t,e=!1,n=!0){const r=ge(t);if(e||(r.equals=Mi),Vn&&n&&z!==null&&z.l!==null){var i;((i=z.l).s??(i.s=[])).push(r)}return r}function O(t,e,n=!1){return N!==null&&(!yt||N.f&131072)&&nn()&&N.f&4325394&&(kt===null||!kt.has(t))&&xa(),Ne(t,n?he(e):e,Wn)}var se=null,wr=0;function Ne(t,e,n=null){if(!t.equals(e)){Ft?Wt.set(t,e):Wt.has(t)||Wt.set(t,t.v);var r=be.ensure();if(r.capture(t,e),(t.f&2)!==0){const i=t;t.f&2048&&Wr(i),tt===null&&Or(i)}t.wv=so(),se=null,wr=0,Ui(t,St,n),se=null,nn()&&E!==null&&E.f&1024&&!(E.f&96)&&(dt===null?Ja([t]):dt.push(t)),!r.is_fork&&qn.size>0&&!Bi&&Ia()}return e}function Ia(){Bi=!1;for(const t of qn){t.f&1024&&V(t,me);let e;try{e=rn(t)}catch{e=!0}e&&Ce(t)}qn.clear()}function Fe(t){O(t,t.v+1)}function Ui(t,e,n){var r=t.reactions;if(r!==null){var i=nn(),o=r.length;if(wr+=o,wr>1e5&&se===null&&(se=new Set),se!==null){if(se.has(t))return;se.add(t)}for(var a=0;a<o;a++){var l=r[a],c=l.f;if(!(!i&&l===E)){var h=(c&St)===0;if(h&&V(l,e),(c&131072)!==0)qn.add(l);else if((c&2)!==0){var d=l;tt?.delete(d),Ui(d,me,n)}else if(h){var f=l;c&16&&Ct!==null&&Ct.add(f),n!==null?n.push(f):ji(f)}}}}}function he(t){if(typeof t!="object"||t===null||Ve in t||Si in t)return t;const e=$i(t);if(e!==Qo&&e!==ta)return t;var n=new Map,r=ki(t),i=j(0),o=null,a=de,l=c=>{if(de===a)return c();var h=N,d=de;gt(null),si(a);var f=c();return gt(h),si(d),f};return r&&n.set("length",j(t.length,o)),new Proxy(t,{defineProperty(c,h,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&ka();var f=n.get(h);return f===void 0?l(()=>{var m=j(d.value,o);return n.set(h,m),m}):O(f,d.value,!0),!0},deleteProperty(c,h){var d=n.get(h);if(d===void 0){if(h in c){const f=l(()=>j(F,o));n.set(h,f),Fe(i)}}else O(d,F),Fe(i);return!0},get(c,h,d){if(h===Ve)return t;var f=n.get(h),m=h in c;if(f===void 0&&(!m||ue(c,h)?.writable)&&(f=l(()=>j(he(m?c[h]:F),o)),n.set(h,f)),f!==void 0){var g=u(f);return g===F?void 0:g}return Reflect.get(c,h,d)},getOwnPropertyDescriptor(c,h){this.has?.(c,h);var d=Reflect.getOwnPropertyDescriptor(c,h),f=n.get(h);if(f!==void 0){var m=u(f);if(m===F)return;if(d&&"value"in d)d.value=m;else return{enumerable:!0,configurable:!0,value:m,writable:!0}}return d},has(c,h){if(h===Ve)return!0;var d=n.get(h),f=d!==void 0&&d.v!==F||Reflect.has(c,h);return(d!==void 0||E!==null&&(!f||ue(c,h)?.writable))&&(d===void 0&&(d=l(()=>j(f?he(c[h]):F,o)),n.set(h,d)),u(d)===F)?!1:f},set(c,h,d,f){var m=n.get(h),g=h in c;if(r&&h==="length")for(var w=d;w<m.v;w+=1){var x=n.get(w+"");x!==void 0?O(x,F):w in c&&(x=l(()=>j(F,o)),n.set(w+"",x))}if(m===void 0)(!g||ue(c,h)?.writable)&&(m=l(()=>j(void 0,o)),O(m,he(d)),n.set(h,m));else{g=m.v!==F;var p=l(()=>he(d));O(m,p)}var y=Reflect.getOwnPropertyDescriptor(c,h);if(y?.set&&y.set.call(f,d),!g){if(r&&typeof h=="string"){var R=n.get("length"),W=Number(h);Number.isInteger(W)&&W>=R.v&&O(R,W+1)}Fe(i)}return!0},ownKeys(c){u(i);var h=Reflect.ownKeys(c).filter(m=>{var g=n.get(m);return g===void 0||g.v!==F});for(var[d,f]of n)f.v!==F&&!(d in c)&&h.push(d);return h},setPrototypeOf(){$a()}})}var oi,Ki,Xi,Ji;function yr(){if(oi===void 0){oi=window,Ki=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;Xi=ue(e,"firstChild").get,Ji=ue(e,"nextSibling").get,Qr(t)&&(t[dr]=void 0,t[fr]=null,t[vr]=void 0,t.__e=void 0),Qr(n)&&(n[_n]=void 0)}}function lt(t=""){return document.createTextNode(t)}function at(t){return Xi.call(t)}function _t(t){return Ji.call(t)}function En(t,e){if(!M)return at(t);var n=at(C);if(n===null)n=C.appendChild(lt());else if(e&&n.nodeType!==3){var r=lt();return n?.before(r),Z(r),r}return e&&Un(n),Z(n),n}function bn(t,e=!1){if(!M){var n=at(t);return n instanceof Comment&&n.data===""?_t(n):n}if(e){if(C?.nodeType!==3){var r=lt();return C?.before(r),Z(r),r}Un(C)}return C}function er(t,e=!1){if(!M)return at(t);var n=En(t,e);return qe(t),n}function Mt(t,e=1,n=!1){let r=M?C:t;for(var i;e--;)i=r,r=_t(r);if(!M)return r;if(n){if(r?.nodeType!==3){var o=lt();return r===null?i?.after(o):r.before(o),Z(o),o}Un(r)}return Z(r),r}function Yi(t){t.textContent=""}function Zi(){return!en||Ct!==null?!1:(E.f&Mr)!==0}function Fn(t,e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?n?document.createElement(t,{is:n}):document.createElement(t):n?document.createElementNS(e,t,{is:n}):document.createElementNS(e,t)}function Un(t){if(t.nodeValue.length<65536)return;let e=t.nextSibling;for(;e!==null&&e.nodeType===3;)e.remove(),t.nodeValue+=e.nodeValue,e=t.nextSibling}function Da(t){var e=E;if(e===null)return N.f|=Cn,t;if((e.f&32768)===0&&(e.f&4)===0)throw t;Rt(t,e)}function Rt(t,e){if(!(e!==null&&(e.f&16384)!==0)){for(;e!==null;){if((e.f&128)!==0&&(e.f&33570816)===0){if((e.f&32768)===0)throw t;try{e.b.error(t);return}catch(n){t=n}}e=e.parent}throw t}}function ja(t){E===null&&(N===null&&ba(t),ma()),Ft&&ga(t)}function za(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function Pt(t,e){var n=E;n!==null&&n.f&8192&&(t|=Ar);var r={ctx:z,deps:null,nodes:null,f:t|St|512,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};A?.register_created_effect(r);var i=r;if((t&4)!==0)Je!==null?Je.push(r):be.ensure().schedule(r);else if(e!==null){try{Ce(r)}catch(a){throw et(r),a}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,t&16&&t&65536&&i!==null&&(i.f|=Nr))}if(i!==null&&(i.parent=n,n!==null&&za(i,n),N!==null&&(N.f&2)!==0&&(t&64)===0)){var o=N;(o.effects??(o.effects=[])).push(i)}return r}function Hr(){return N!==null&&!yt}function Va(t){const e=Pt(8,null);return V(e,vt),e.teardown=t,e}function wn(t){ja("$effect");var e=E.f;if(!N&&(e&32)!==0&&z!==null&&!z.i){var n=z;(n.e??(n.e=[])).push(t)}else return Gi(t)}function Gi(t){return Pt(4|aa,t)}function Ba(t){be.ensure();const e=Pt(64|Oe,t);return()=>{et(e)}}function Fa(t){be.ensure();const e=Pt(64|Oe,t);return(n={})=>new Promise(r=>{n.outro?we(e,()=>{et(e),r(void 0)}):(et(e),r(void 0))})}function Qi(t){return Pt(4,t)}function Ua(t){return Pt(sa|Oe,t)}function Pr(t,e=0){return Pt(8|e,t)}function jt(t,e=[],n=[],r=[]){Aa(r,e,n,i=>{Pt(8,()=>{t(...i.map(u))})})}function qr(t,e=0){return Pt(16|e,t)}function pt(t){return Pt(32|Oe,t)}function to(t){var e=t.teardown;if(e!==null){const n=Ft,r=N;ai(!0),gt(null);try{e.call(null)}catch(i){Rt(i,t.parent)}finally{ai(n),gt(r)}}}function Ir(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const i=n.ac;i!==null&&Bn(()=>{i.abort(Qe)});var r=n.next;(n.f&64)!==0?n.parent=null:et(n,e),n=r}}function Ka(t){for(var e=t.first;e!==null;){var n=e.next;!(e.f&32)&&et(e),e=n}}function et(t,e=!0){var n=!1;(e||t.f&262144)&&t.nodes!==null&&t.nodes.end!==null&&(eo(t.nodes.start,t.nodes.end),n=!0),t.f|=ti,Ir(t,e&&!n),Ye(t,0);var r=t.nodes&&t.nodes.t;if(r!==null)for(const o of r)o.stop();to(t),t.f^=ti,t.f|=oa;var i=t.parent;i!==null&&i.first!==null&&no(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function eo(t,e){for(;t!==null;){var n=t===e?null:_t(t);t.remove(),t=n}}function no(t){var e=t.parent,n=t.prev,r=t.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),e!==null&&(e.first===t&&(e.first=r),e.last===t&&(e.last=n))}function we(t,e,n=!0){var r=[];t.f|=256,ro(t,r,!0);var i=()=>{n&&et(t),e&&e()},o=r.length;if(o>0){var a=()=>--o||i();for(var l of r)l.out(a)}else i()}function ro(t,e,n){if((t.f&8192)===0){t.f^=Ar;var r=t.nodes&&t.nodes.t;if(r!==null)for(const l of r)(l.is_global||n)&&e.push(l);for(var i=t.first;i!==null;){var o=i.next;if((i.f&64)===0){var a=(i.f&65536)!==0||(i.f&32)!==0&&(t.f&16)!==0;ro(i,e,a?n:!1)}i=o}}}function In(t){t.f&=-257,io(t,!0)}function io(t,e){if((t.f&256)===0&&(t.f&8192)!==0){t.f^=Ar,!(t.f&1024)&&(V(t,St),be.ensure().schedule(t));for(var n=t.first;n!==null;){var r=n.next,i=(n.f&65536)!==0||(n.f&32)!==0;io(n,i?e:!1),n=r}var o=t.nodes&&t.nodes.t;if(o!==null)for(const a of o)(a.is_global||e)&&a.in()}}function Dr(t,e){if(t.nodes)for(var n=t.nodes.start,r=t.nodes.end;n!==null;){var i=n===r?null:_t(n);e.append(n),n=i}}var Xa=null,An=!1,Ft=!1;function ai(t){Ft=t}var N=null,yt=!1;function gt(t){N=t}var E=null;function Ht(t){E=t}var kt=null;function oo(t){N!==null&&(N.f&2097152||N.f&2)&&(kt??(kt=new Set)).add(t)}var rt=null,ot=0,dt=null;function Ja(t){dt=t}var ao=1,ce=0,de=ce;function si(t){de=t}function so(){return++ao}function rn(t){var e=t.f;if((e&2048)!==0)return!0;if((e&4096)!==0){for(var n=t.deps,r=n.length,i=0;i<r;i++){var o=n[i];if(rn(o)&&Ri(o),o.wv>t.wv)return!0}e&512&&tt===null&&V(t,vt)}return!1}function lo(t,e,n=!0){var r=t.reactions;if(r!==null&&!(!en&&kt!==null&&kt.has(t)))for(var i=0;i<r.length;i++){var o=r[i];(o.f&2)!==0?lo(o,e,!1):e===o&&(n?V(o,St):o.f&1024&&V(o,me),ji(o))}}function ho(t){var e=rt,n=ot,r=dt,i=N,o=kt,a=z,l=yt,c=de,h=t.f;rt=null,ot=0,dt=null,N=(h&96)===0?t:null,kt=null,Ae(t.ctx),yt=!1,de=++ce,t.ac!==null&&(Bn(()=>{t.ac.abort(Qe)}),t.ac=null);try{t.f|=ei;var d=t.fn,f=d();t.f|=Mr;var m=li(t);if(nn()&&dt!==null&&!yt&&m!==null&&(t.f&6146)===0)for(var g=0;g<dt.length;g++)lo(dt[g],t);if(i!==null&&i!==t){if(ce++,i.deps!==null)for(let w=0;w<n;w+=1)i.deps[w].rv=ce;if(e!==null)for(const w of e)w.rv=ce;dt!==null&&(r===null?r=dt:r.push(...dt))}return t.f&8388608&&(t.f^=Cn),f}catch(w){return li(t),Da(w)}finally{t.f^=ei,rt=e,ot=n,dt=r,N=i,kt=o,Ae(a),yt=l,de=c}}function li(t){var e=t.deps,n=A?.is_fork;if(rt!==null){var r;if(n||Ye(t,ot),e!==null&&ot>0)for(e.length=ot+rt.length,r=0;r<rt.length;r++)e[ot+r]=rt[r];else t.deps=e=rt;if(Hr()&&(t.f&512)!==0)for(r=ot;r<e.length;r++){var i;((i=e[r]).reactions??(i.reactions=[])).push(t)}}else!n&&e!==null&&ot<e.length&&(Ye(t,ot),e.length=ot);return e}function Ya(t,e){let n=e.reactions;if(n!==null){var r=Zo.call(n,t);if(r!==-1){var i=n.length-1;i===0?n=e.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&(e.f&2)!==0&&(rt===null||!ur.call(rt,e))){var o=e;o.f&512&&(o.f^=512),o.v!==F&&Or(o),o.ac!==null&&Bn(()=>{o.ac.abort(Qe),o.ac=null,V(o,St)}),Oa(o),Ye(o,0)}}function Ye(t,e){var n=t.deps;if(n!==null)for(var r=e;r<n.length;r++)Ya(t,n[r])}function Ce(t){var e=t.f;if((e&16384)===0){V(t,vt);var n=E,r=An;E=t,An=(e&96)===0;try{(e&16777232)!==0?Ka(t):Ir(t),to(t);var i=ho(t);t.teardown=typeof i=="function"?i:null,t.wv=ao}finally{An=r,E=n}}}async function Za(){if(en)return new Promise(t=>{requestAnimationFrame(()=>t()),setTimeout(()=>t())});await Promise.resolve(),Se()}function u(t){var e=(t.f&2)!==0;if(Xa?.add(t),N!==null&&!yt&&!(E!==null&&(E.f&16384)!==0)&&(kt===null||!kt.has(t))){var n=N.deps;if((N.f&2097152)!==0)t.rv<ce&&(t.rv=ce,rt===null&&n!==null&&n[ot]===t?ot++:rt===null?rt=[t]:rt.push(t));else{var r;(r=N).deps??(r.deps=[]),ur.call(N.deps,t)||N.deps.push(t);var i=t.reactions;i===null?t.reactions=[N]:ur.call(i,N)||i.push(N)}}if(Ft&&Wt.has(t))return Wt.get(t);if(e){var o=t;if(Ft){var a=o.v;return(!(o.f&1024)&&o.reactions!==null||uo(o))&&(a=Wr(o)),Wt.set(o,a),a}var l=(o.f&512)===0&&!yt&&N!==null&&(An||(N.f&512)!==0),c=(o.f&Mr)===0;rn(o)&&(l&&(o.f|=512),Ri(o)),l&&!c&&(Hi(o),co(o))}if(tt?.has(t))return tt.get(t);if((t.f&8388608)!==0)throw t.v;return t.v}function co(t){if(t.f|=512,t.deps!==null)for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),e.f&2&&!(e.f&512)&&(Hi(e),co(e))}function uo(t){if(t.v===F)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(Wt.has(e)||(e.f&2)!==0&&uo(e))return!0;return!1}function Ze(t){var e=yt;try{return yt=!0,t()}finally{yt=e}}var _e=Symbol("events"),fo=new Set,Tr=new Set;function Xt(t,e,n){(e[_e]??(e[_e]={}))[t]=n}function Ga(t){for(var e=0;e<t.length;e++)fo.add(t[e]);for(var n of Tr)n(t)}var nr=null,rr=!1;function hi(t){var e=this,n=e.ownerDocument,r=t.type,i=t.composedPath?.()||[],o=i[0]||t.target;nr=t,rr||(rr=!0,setTimeout(()=>{rr=!1,nr=null}));var a=0,l=nr===t&&t[_e];if(l){var c=i.indexOf(l);if(c!==-1&&(e===document||e===window)){t[_e]=e;return}var h=i.indexOf(e);if(h===-1)return;c<=h&&(a=c)}if(o=i[a]||t.target,o!==e){Ue(t,"currentTarget",{configurable:!0,get(){return o||n}});var d=N,f=E;gt(null),Ht(null);try{for(var m,g=[];o!==null&&o!==e;){try{var w=o[_e]?.[r];w!=null&&(!o.disabled||t.target===o)&&w.call(o,t)}catch(x){m?g.push(x):m=x}if(t.cancelBubble)break;a++,o=a<i.length?i[a]:null}if(m){for(let x of g)queueMicrotask(()=>{throw x});throw m}}finally{t[_e]=e,delete t.currentTarget,gt(d),Ht(f)}}}var Qa=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function ts(t){return Qa?.createHTML(t)??t}function es(t){var e=Fn("template");return e.innerHTML=ts(t.replaceAll("<!>","<!---->")),e.content}function Bt(t,e){var n=E;n.nodes===null&&(n.nodes={start:t,end:e,a:null,t:null})}function qt(t,e){var n=(e&1)!==0,r=(e&2)!==0,i,o=!t.startsWith("<!>");return()=>{if(M)return Bt(C,null),C;i===void 0&&(i=es(o?t:"<!>"+t),n||(i=at(i)));var a=r||Ki?document.importNode(i,!0):i.cloneNode(!0);if(n){var l=at(a),c=a.lastChild;Bt(l,c)}else Bt(a,a);return a}}function ns(t=""){if(!M){var e=lt(t+"");return Bt(e,e),e}var n=C;return n.nodeType!==3?(n.before(n=lt()),Z(n)):Un(n),Bt(n,n),n}function ft(t,e){if(M){var n=E;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=C),Ee();return}t!==null&&t.before(e)}var rs=["touchstart","touchmove"];function is(t){return rs.includes(t)}function os(t){let e=0,n=ge(0),r;return()=>{Hr()&&(u(n),Pr(()=>(e===0&&(r=Ze(()=>t(()=>Fe(n)))),e+=1,()=>{Qt(()=>{e-=1,e===0&&(r?.(),r=void 0,Fe(n))})})))}}var as=Nr|Oe;function ss(t,e,n,r){new ls(t,e,n,r)}var $t=new WeakMap,kr=new WeakMap,Lt=new WeakMap,Ge=new WeakMap,st=new WeakMap,xt=new WeakMap,ht=new WeakMap,Tt=new WeakMap,Gt=new WeakMap,ke=new WeakMap,ve=new WeakMap,yn=new WeakMap,$r=new WeakMap,xr=new WeakMap,re=new WeakMap,ci=new WeakMap,U=new WeakSet,ls=class{constructor(t,e,n,r){Rr(this,U),H(this,"parent",void 0),H(this,"is_pending",!1),H(this,"transform_error",void 0),$(this,$t,void 0),$(this,kr,M?C:null),$(this,Lt,void 0),$(this,Ge,void 0),$(this,st,void 0),$(this,xt,null),$(this,ht,null),$(this,Tt,null),$(this,Gt,null),$(this,ke,0),$(this,ve,0),$(this,yn,!1),$(this,$r,new Set),$(this,xr,new Set),$(this,re,null),$(this,ci,os(()=>(T(re,this,ge(s(ke,this))),()=>{T(re,this,null)}))),T($t,this,t),T(Lt,this,e),T(Ge,this,i=>{var o=E;o.b=this,o.f|=128,n(i)}),this.parent=E.b,this.transform_error=r??this.parent?.transform_error??(i=>i),T(st,this,qr(()=>{if(M){const i=s(kr,this);Ee();const o=i.data==="[!";if(i.data.startsWith("[?")){const a=JSON.parse(i.data.slice(2));_(U,this,cs).call(this,a)}else o?_(U,this,us).call(this):_(U,this,hs).call(this)}else _(U,this,po).call(this)},as)),M&&T($t,this,C)}defer_effect(t){Li(t,s($r,this),s(xr,this))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!s(Lt,this).pending}update_pending_count(t,e){_(U,this,go).call(this,t,e),T(ke,this,s(ke,this)+t),s(re,this)&&!s(yn,this)&&(T(yn,this,!0),Qt(()=>{T(yn,this,!1),s(re,this)&&Ne(s(re,this),s(ke,this))}))}get_effect_pending(){return s(ci,this).call(this),u(s(re,this))}error(t){if(!s(Lt,this).onerror&&!s(Lt,this).failed)throw t;A?.is_fork?(s(xt,this)&&A.skip_effect(s(xt,this)),s(ht,this)&&A.skip_effect(s(ht,this)),s(Tt,this)&&A.skip_effect(s(Tt,this)),A.oncommit(()=>{_(U,this,ui).call(this,t)})):_(U,this,ui).call(this,t)}};function hs(){try{T(xt,this,pt(()=>s(Ge,this).call(this,s($t,this))))}catch(t){this.error(t)}}function cs(t){const e=s(Lt,this).failed,{reset:n,invoke_onerror:r}=_(U,this,vo).call(this,t);Qt(r),e&&T(Tt,this,pt(()=>{e(s($t,this),()=>t,()=>n)}))}function vo(t){var e=!1,n=!1;const r=()=>{if(e){ua();return}e=!0,n&&Sa(),s(Tt,this)!==null&&we(s(Tt,this),()=>{T(Tt,this,null)}),_(U,this,jr).call(this,()=>{_(U,this,po).call(this)})};return{reset:r,invoke_onerror:()=>{try{n=!0,s(Lt,this).onerror?.(t,r),n=!1}catch(i){Rt(i,s(st,this)&&s(st,this).parent)}}}}function us(){const t=s(Lt,this).pending;t&&(this.is_pending=!0,T(ht,this,pt(()=>t(s($t,this)))),Qt(()=>{var e=T(Gt,this,document.createDocumentFragment()),n=lt(),r=!1;if(e.append(n),T(xt,this,_(U,this,jr).call(this,()=>{try{return pt(()=>s(Ge,this).call(this,n))}catch(i){try{this.error(i),r=!0}catch(o){Rt(o,s(st,this).parent)}return null}})),s(xt,this)===null){T(Gt,this,null),r&&_(U,this,Dn).call(this,A);return}s(ve,this)===0&&(s($t,this).before(e),T(Gt,this,null),we(s(ht,this),()=>{T(ht,this,null)}),_(U,this,Dn).call(this,A))}))}function po(){try{if(this.is_pending=this.has_pending_snippet(),T(ve,this,0),T(ke,this,0),T(xt,this,pt(()=>{s(Ge,this).call(this,s($t,this))})),s(ve,this)>0){var t=T(Gt,this,document.createDocumentFragment());Dr(s(xt,this),t);const e=s(Lt,this).pending;T(ht,this,pt(()=>e(s($t,this))))}else _(U,this,Dn).call(this,A)}catch(e){this.error(e)}}function Dn(t){this.is_pending=!1,t.transfer_effects(s($r,this),s(xr,this))}function jr(t){var e=E,n=N,r=z;Ht(s(st,this)),gt(s(st,this)),Ae(s(st,this).ctx);try{return be.ensure(),t()}finally{Ht(e),gt(n),Ae(r)}}function go(t,e){if(!this.has_pending_snippet()){if(this.parent){var n;_(U,n=this.parent,go).call(n,t,e)}return}T(ve,this,s(ve,this)+t),s(ve,this)===0&&(_(U,this,Dn).call(this,e),s(ht,this)&&we(s(ht,this),()=>{T(ht,this,null)}),s(Gt,this)&&(s($t,this).before(s(Gt,this)),T(Gt,this,null)))}function ui(t){s(xt,this)&&(et(s(xt,this)),T(xt,this,null)),s(ht,this)&&(et(s(ht,this)),T(ht,this,null)),s(Tt,this)&&(et(s(Tt,this)),T(Tt,this,null)),M&&(Z(s(kr,this)),fa(),Z(On()));let e=s(Lt,this).failed;const n=r=>{const{reset:i,invoke_onerror:o}=_(U,this,vo).call(this,r);o(),e&&T(Tt,this,_(U,this,jr).call(this,()=>{try{return pt(()=>{var a=E;a.b=this,a.f|=128,e(s($t,this),()=>r,()=>i)})}catch(a){return Rt(a,s(st,this).parent),null}}))};Qt(()=>{var r;try{r=this.transform_error(t)}catch(i){Rt(i,s(st,this)&&s(st,this).parent);return}r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(n,i=>Rt(i,s(st,this)&&s(st,this).parent)):n(r)})}function Tn(t,e){var n=e==null?"":typeof e=="object"?`${e}`:e;n!==(t[_n]??(t[_n]=t.nodeValue))&&(t[_n]=n,t.nodeValue=`${n}`)}function mo(t,e){return bo(t,e)}function fs(t,e){yr(),e.intro=e.intro??!1;const n=e.target,r=M,i=C;try{for(var o=at(n);o&&(o.nodeType!==8||o.data!=="[");)o=_t(o);if(!o)throw pe;zt(!0),Z(o);const a=bo(t,{...e,anchor:o});return zt(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
212
+ `).some(l=>l.startsWith("https://svelte.dev/e/")))throw a;return a!==pe&&console.warn("Failed to hydrate: ",a),e.recover===!1&&ya(),yr(),Yi(n),zt(!1),mo(t,e)}finally{zt(r),Z(i)}}var kn=new Map;function bo(t,{target:e,anchor:n,props:r={},events:i,context:o,intro:a=!0,transformError:l}){yr();var c=void 0,h=Fa(()=>{var d=n??e.appendChild(lt());ss(d,{pending:()=>{}},g=>{Ni({});var w=z;if(o&&(w.c=o),i&&(r.$$events=i),M&&Bt(g,null),c=t(g,r)||Cr(),M&&(E.nodes.end=C,C===null||C.nodeType!==8||C.data!=="]"))throw tn(),pe;Ci()},l);var f=new Set,m=g=>{for(var w=0;w<g.length;w++){var x=g[w];if(!f.has(x)){f.add(x);var p=is(x);for(const W of[e,document]){var y=kn.get(W);y===void 0&&(y=new Map,kn.set(W,y));var R=y.get(x);R===void 0?(W.addEventListener(x,hi,{passive:p}),y.set(x,1)):y.set(x,R+1)}}}};return m(zn(fo)),Tr.add(m),()=>{for(var g of f)for(const p of[e,document]){var w=kn.get(p),x=w.get(g);--x==0?(p.removeEventListener(g,hi),w.delete(g),w.size===0&&kn.delete(p)):w.set(g,x)}Tr.delete(m),d!==n&&d.parentNode?.removeChild(d)}});return Sr.set(c,h),c}var Sr=new WeakMap;function ds(t,e){const n=Sr.get(t);return n?(Sr.delete(t),n(e)):Promise.resolve()}var Dt=new WeakMap,Jt=new WeakMap,mt=new WeakMap,He=new WeakMap,ir=new WeakMap,or=new WeakMap,fi=new WeakMap,vs=class{constructor(t,e=!0){H(this,"anchor",void 0),$(this,Dt,new Map),$(this,Jt,new Map),$(this,mt,new Map),$(this,He,new Set),$(this,ir,!0),$(this,or,n=>{if(s(Dt,this).has(n)){var r=s(Dt,this).get(n),i=s(Jt,this).get(r);if(i)In(i),s(He,this).delete(r);else{var o=s(mt,this).get(r);o&&(In(o.effect),s(Jt,this).set(r,o.effect),s(mt,this).delete(r),o.fragment.lastChild.remove(),this.anchor.before(o.fragment),i=o.effect)}for(const[a,l]of s(Dt,this)){if(s(Dt,this).delete(a),a===n)break;const c=s(mt,this).get(l);c&&(et(c.effect),s(mt,this).delete(l))}for(const[a,l]of s(Jt,this)){if(a===r||s(He,this).has(a))continue;const c=()=>{if(Array.from(s(Dt,this).values()).includes(a)){var h=document.createDocumentFragment();Dr(l,h),h.append(lt()),s(mt,this).set(a,{effect:l,fragment:h})}else et(l);s(He,this).delete(a),s(Jt,this).delete(a)};s(ir,this)||!i?(s(He,this).add(a),we(l,c,!1)):c()}}}),$(this,fi,n=>{s(Dt,this).delete(n);const r=Array.from(s(Dt,this).values());for(const[i,o]of s(mt,this))r.includes(i)||(et(o.effect),s(mt,this).delete(i))}),this.anchor=t,T(ir,this,e)}ensure(t,e){var n=A,r=Zi();if(e&&!s(Jt,this).has(t)&&!s(mt,this).has(t))if(r){var i=document.createDocumentFragment(),o=lt();i.append(o),s(mt,this).set(t,{effect:pt(()=>e(o)),fragment:i})}else s(Jt,this).set(t,pt(()=>e(this.anchor)));if(s(Dt,this).set(n,t),r){for(const[a,l]of s(Jt,this))a===t?n.unskip_effect(l):n.skip_effect(l);for(const[a,l]of s(mt,this))a===t?n.unskip_effect(l.effect):n.skip_effect(l.effect);n.oncommit(s(or,this)),n.ondiscard(s(fi,this))}else M&&(this.anchor=C),s(or,this).call(this,n)}};function ie(t,e,n=!1){var r;M&&(r=C,Ee());var i=new vs(t),o=n?Nr:0;function a(l,c){if(M){var h=Ei(r);if(l!==parseInt(h.substring(1))){var d=On();Z(d),i.anchor=d,zt(!1),i.ensure(l,c),zt(!0);return}}i.ensure(l,c)}qr(()=>{var l=!1;e((c,h=0)=>{l=!0,a(h,c)}),l||a(-1,null)},o)}function ps(t,e){return e}function gs(t,e,n){for(var r=[],i=e.length,o,a=e.length,l=0;l<i;l++){let f=e[l];we(f,()=>{if(o){if(o.pending.delete(f),o.done.add(f),o.pending.size===0){var m=t.outrogroups;_r(t,zn(o.done)),m.delete(o),m.size===0&&(t.outrogroups=null)}}else a-=1},!1)}if(a===0){var c=r.length===0&&n!==null&&t.pending.size===0;if(c){var h=n,d=h.parentNode;Yi(d),d.append(h),t.items.clear()}_r(t,e,!c)}else o={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(o)}function _r(t,e,n=!0){var r;if(t.pending.size>0){r=new Set;for(const a of t.pending.values())for(const l of a)r.add(t.items.get(l).e)}for(var i=0;i<e.length;i++){var o=e[i];r?.has(o)?(o.f|=ze,Dr(o,document.createDocumentFragment())):et(e[i],n)}}var $n;function di(t,e,n,r,i,o=null){var a=t,l=new Map;if((e&4)!==0){var c=t;a=M?Z(at(c)):c.appendChild(lt())}M&&Ee();var h=null,d=Lr(()=>{var y=n();return ki(y)?y:y==null?[]:zn(y)}),f,m=new Map,g=!0;function w(y){!(p.effect.f&16384)&&(p.pending.delete(y),p.fallback=h,ms(p,f,a,e,r),h!==null&&(f.length===0?(h.f&33554432)===0?In(h):(h.f^=ze,je(h,null,a)):we(h,()=>{h=null})))}function x(y){p.pending.delete(y)}var p={effect:qr(()=>{f=u(d);var y=f.length;let R=!1;M&&Ei(a)==="[!"!=(y===0)&&(a=On(),Z(a),zt(!1),R=!0);for(var W=new Set,k=A,P=Zi(),I=0;I<y;I+=1){M&&C.nodeType===8&&C.data==="]"&&(a=C,R=!0,zt(!1));var D=f[I],K=r(D,I),X=g?null:l.get(K);X?(X.v&&Ne(X.v,D),X.i&&Ne(X.i,I),P&&k.unskip_effect(X.e)):(X=bs(l,g?a:$n??($n=lt()),D,K,I,i,e,n),g||(X.e.f|=ze),l.set(K,X)),W.add(K)}if(y===0&&o&&!h&&(g?h=pt(()=>o(a)):(h=pt(()=>o($n??($n=lt()))),h.f|=ze)),y>W.size&&pa("","",""),M&&y>0&&Z(On()),!g)if(m.set(k,W),P){for(const[nt,ct]of l)W.has(nt)||k.skip_effect(ct.e);k.oncommit(w),k.ondiscard(x)}else w(k);R&&zt(!0),u(d)}),flags:e,items:l,pending:m,outrogroups:null,fallback:h};g=!1,M&&(a=C)}function Pe(t){for(;t!==null&&(t.f&32)===0;)t=t.next;return t}function ms(t,e,n,r,i){var o=(r&8)!==0,a=e.length,l=t.items,c=Pe(t.effect.first),h,d=null,f,m=[],g=[],w,x,p,y;if(o)for(y=0;y<a;y+=1)w=e[y],x=i(w,y),p=l.get(x).e,!(p.f&33554432)&&(p.nodes?.a?.measure(),(f??(f=new Set)).add(p));for(y=0;y<a;y+=1){if(w=e[y],x=i(w,y),p=l.get(x).e,t.outrogroups!==null)for(const nt of t.outrogroups)nt.pending.delete(p),nt.done.delete(p);if(p.f&8192&&(In(p),o&&(p.nodes?.a?.unfix(),(f??(f=new Set)).delete(p))),(p.f&33554432)!==0)if(p.f^=ze,p===c)je(p,null,n);else{var R=d?d.next:c;p===t.effect.last&&(t.effect.last=p.prev),p.prev&&(p.prev.next=p.next),p.next&&(p.next.prev=p.prev),Yt(t,d,p),Yt(t,p,R),je(p,R,n),d=p,m=[],g=[],c=Pe(d.next);continue}if(p!==c){if(h!==void 0&&h.has(p)){if(m.length<g.length){var W=g[0],k;d=W.prev;var P=m[0],I=m[m.length-1];for(k=0;k<m.length;k+=1)je(m[k],W,n);for(k=0;k<g.length;k+=1)h.delete(g[k]);Yt(t,P.prev,I.next),Yt(t,d,P),Yt(t,I,W),c=W,d=I,y-=1,m=[],g=[]}else h.delete(p),je(p,c,n),Yt(t,p.prev,p.next),Yt(t,p,d===null?t.effect.first:d.next),Yt(t,d,p),d=p;continue}for(m=[],g=[];c!==null&&c!==p;)(h??(h=new Set)).add(c),g.push(c),c=Pe(c.next);if(c===null)continue}!(p.f&33554432)&&m.push(p),d=p,c=Pe(p.next)}if(t.outrogroups!==null){for(const nt of t.outrogroups)nt.pending.size===0&&(_r(t,zn(nt.done)),t.outrogroups?.delete(nt));t.outrogroups.size===0&&(t.outrogroups=null)}if(c!==null||h!==void 0){var D=[];if(h!==void 0)for(p of h)!(p.f&8192)&&D.push(p);for(;c!==null;)!(c.f&8192)&&c!==t.fallback&&D.push(c),c=Pe(c.next);var K=D.length;if(K>0){var X=(r&4)!==0&&a===0?n:null;if(o){for(y=0;y<K;y+=1)D[y].nodes?.a?.measure();for(y=0;y<K;y+=1)D[y].nodes?.a?.fix()}gs(t,D,X)}}o&&Qt(()=>{if(f!==void 0)for(p of f)p.nodes?.a?.apply()})}function bs(t,e,n,r,i,o,a,l){var c=(a&1)!==0?(a&16)===0?Fi(n,!1,!1):ge(n):null,h=(a&2)!==0?ge(i):null;return{v:c,i:h,e:pt(()=>(o(e,c??n,h??i,l),()=>{t.delete(r)}))}}function je(t,e,n){if(t.nodes)for(var r=t.nodes.start,i=t.nodes.end,o=e&&(e.f&33554432)===0?e.nodes.start:n;r!==null;){var a=_t(r);if(o.before(r),r===i)return;r=a}}function Yt(t,e,n){e===null?t.effect.first=n:e.next=n,n===null?t.effect.last=e:n.prev=e}function ws(t,e,n=!1,r=!1,i=!1,o=!1){var a=t,l="";if(n){var c=t;M&&(a=Z(at(c)))}jt(()=>{var h=E;if(l===(l=e()??"")){M&&Ee();return}if(n&&!M){h.nodes=null,c.innerHTML=l,l!==""&&Bt(at(c),c.lastChild);return}if(h.nodes!==null&&(eo(h.nodes.start,h.nodes.end),h.nodes=null),l!==""){if(M){for(var d=C.data,f=Ee(),m=f;f!==null&&(f.nodeType!==8||f.data!=="");)m=f,f=_t(f);if(f===null)throw tn(),pe;Bt(C,m),a=Z(f);return}var g=Fn(r?"svg":i?"math":"template",r?Jo:i?Yo:void 0);g.innerHTML=l;var w=r||i?g:g.content;if(Bt(at(w),w.lastChild),r||i)for(;at(w);)a.before(at(w));else a.before(w)}})}function ys(t,e){Qi(()=>{t=E?.parent?.nodes?.start??t;var n=t.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector("#"+e.hash)){const i=Fn("style");i.id=e.hash,i.textContent=e.code,r.appendChild(i)}})}var vi=[...`
213
+ \r\f \v\uFEFF`];function Ts(t,e,n){var r=t==null?"":""+t;if(e&&(r=r?r+" "+e:e),n){for(var i of Object.keys(n))if(n[i])r=r?r+" "+i:i;else if(r.length)for(var o=i.length,a=0;(a=r.indexOf(i,a))>=0;){var l=a+o;(a===0||vi.includes(r[a-1]))&&(l===r.length||vi.includes(r[l]))?r=(a===0?"":r.substring(0,a))+r.substring(l+1):a=l}}return r===""?null:r}function pi(t,e=!1){var n=e?" !important;":";",r="";for(var i of Object.keys(t)){var o=t[i];o!=null&&o!==""&&(r+=" "+i+": "+o+n)}return r}function ar(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function ks(t,e){if(e){var n="",r,i;if(Array.isArray(e)?(r=e[0],i=e[1]):r=e,t){t=String(t).replaceAll(/\/\*.*?\*\//g,"").trim();var o=!1,a=0,l=!1,c=[];r&&c.push(...Object.keys(r).map(ar)),i&&c.push(...Object.keys(i).map(ar));var h=0,d=-1;const x=t.length;for(var f=0;f<x;f++){var m=t[f];if(l?m==="/"&&t[f-1]==="*"&&(l=!1):o?o===m&&(o=!1):m==="/"&&t[f+1]==="*"?l=!0:m==='"'||m==="'"?o=m:m==="("?a++:m===")"&&a--,!l&&o===!1&&a===0){if(m===":"&&d===-1)d=f;else if(m===";"||f===x-1){if(d!==-1){var g=ar(t.substring(h,d).trim());if(!c.includes(g)){m!==";"&&f++;var w=t.substring(h,f).trim();n+=" "+w+";"}}h=f+1,d=-1}}}}return r&&(n+=pi(r)),i&&(n+=pi(i,!0)),n=n.trim(),n===""?null:n}return t==null?null:String(t)}function $s(t,e,n,r,i,o){var a=t[dr];if(M||a!==n||a===void 0){var l=Ts(n,r,o);(!M||l!==t.getAttribute("class"))&&(l==null?t.removeAttribute("class"):e?t.className=l:t.setAttribute("class",l)),t[dr]=n}else if(o&&i!==o)for(var c in o){var h=!!o[c];(i==null||h!==!!i[c])&&t.classList.toggle(c,h)}return o}function sr(t,e={},n,r){for(var i in n){var o=n[i];e[i]!==o&&(n[i]==null?t.style.removeProperty(i):t.style.setProperty(i,o,r))}}function gi(t,e,n,r){var i=t[vr];if(M||i!==e){var o=ks(e,r);(!M||o!==t.getAttribute("style"))&&(o==null?t.removeAttribute("style"):t.style.cssText=o),t[vr]=e}else r&&(Array.isArray(r)?(sr(t,n?.[0],r[0]),sr(t,n?.[1],r[1],"important")):sr(t,n,r));return r}var xs=Symbol("is custom element"),Ss=Symbol("is html"),_s=ha?"link":"LINK";function Y(t,e,n,r){var i=Es(t);M&&(i[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName===_s)||i[e]!==(i[e]=n)&&(e==="loading"&&(t[la]=n),n==null?t.removeAttribute(e):typeof n!="string"&&As(t).has(e)?t[e]=n:t.setAttribute(e,n))}function Es(t){return t[fr]??(t[fr]={[xs]:t.nodeName.includes("-"),[Ss]:t.namespaceURI==="http://www.w3.org/1999/xhtml"})}var mi=new Map;function As(t){var e=t.getAttribute("is")||t.nodeName,n=mi.get(e);if(n)return n;mi.set(e,n=new Set);for(var r,i=t,o=Element.prototype;o!==i;){r=Go(i);for(var a in r)r[a].set&&a!=="innerHTML"&&a!=="textContent"&&a!=="innerText"&&n.add(a);i=$i(i)}return n}var wo,$e=new WeakMap,jn=new WeakMap,lr=new WeakMap,bi=new WeakSet,yo=class{constructor(t){Rr(this,bi),$(this,$e,new WeakMap),$(this,jn,void 0),$(this,lr,void 0),T(lr,this,t)}observe(t,e){var n=s($e,this).get(t)||new Set;return n.add(e),s($e,this).set(t,n),_(bi,this,Ms).call(this).observe(t,s(lr,this)),()=>{var r=s($e,this).get(t);r.delete(e),r.size===0&&(s($e,this).delete(t),s(jn,this).unobserve(t))}}};wo=yo;function Ms(){return s(jn,this)??T(jn,this,new ResizeObserver(t=>{for(var e of t){wo.entries.set(e.target,e);for(var n of s($e,this).get(e.target)||[])n(e)}}))}H(yo,"entries",new WeakMap);function hr(t,e){return t===e||t?.[Ve]===e}function wi(t=Cr(),e,n,r){var i=z.r,o=E;return Qi(()=>{var a,l;return Pr(()=>{a=l,l=r?.()||[],Ze(()=>{hr(n(...l),t)||(e(t,...l),a&&hr(n(...a),t)&&e(null,...a))})}),()=>{let c=o;for(;c!==i&&c.parent!==null&&c.parent.f&33554432;)c=c.parent;const h=()=>{l&&hr(n(...l),t)&&e(null,...l)},d=c.teardown;c.teardown=()=>{h(),d?.()}}}),t}var xn=!1;function Ns(t){var e=xn;try{return xn=!1,[t(),xn]}finally{xn=e}}function Sn(t,e,n,r){var i=!Vn||(n&2)!==0,o=(n&8)!==0,a=(n&16)!==0,l=r,c=!0,h=void 0,d=()=>a&&i?(h??(h=Xe(r)),u(h)):(c&&(c=!1,l=a?Ze(r):r),l);let f;if(o){var m=Ve in t||_i in t;f=ue(t,e)?.set??(m&&e in t?k=>t[e]=k:void 0)}var g,w=!1;o?[g,w]=Ns(()=>t[e]):g=t[e],g===void 0&&r!==void 0&&(g=d(),f&&(i&&Ta(e),f(g)));var x;if(i?x=()=>{var k=t[e];return k===void 0?d():(c=!0,k)}:x=()=>{var k=t[e];return k!==void 0&&(l=void 0),k===void 0?l:k},i&&(n&4)===0)return x;if(f){var p=t.$$legacy;return(function(k,P){return arguments.length>0?((!i||!P||p||w)&&f(P?x():k),k):x()})}var y=!1,R=((n&1)!==0?Xe:Lr)(()=>(y=!1,x()));o&&u(R);var W=E;return(function(k,P){if(arguments.length>0){const I=P?u(R):i&&o?he(k):k;return O(R,I),y=!0,l!==void 0&&(l=I),k}return Ft&&y||(W.f&16384)!==0?R.v:u(R)})}function Cs(t){return new Os(t)}var oe=new WeakMap,Nt=new WeakMap,Os=class{constructor(t){$(this,oe,void 0),$(this,Nt,void 0);var e=new Map,n=(i,o)=>{var a=Fi(o,!1,!1);return e.set(i,a),a};const r=new Proxy({...t.props||{},$$events:{}},{get(i,o){return u(e.get(o)??n(o,Reflect.get(i,o)))},has(i,o){return o===_i?!0:(u(e.get(o)??n(o,Reflect.get(i,o))),Reflect.has(i,o))},set(i,o,a){return O(e.get(o)??n(o,a),a),Reflect.set(i,o,a)}});T(Nt,this,(t.hydrate?fs:mo)(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||t.sync===!1)&&Se(),T(oe,this,r.$$events);for(const i of Object.keys(s(Nt,this)))i==="$set"||i==="$destroy"||i==="$on"||Ue(this,i,{get(){return s(Nt,this)[i]},set(o){s(Nt,this)[i]=o},enumerable:!0});s(Nt,this).$set=i=>{Object.assign(r,i)},s(Nt,this).$destroy=()=>{ds(s(Nt,this))}}$set(t){s(Nt,this).$set(t)}$on(t,e){s(oe,this)[t]=s(oe,this)[t]||[];const n=(...r)=>e.call(this,...r);return s(oe,this)[t].push(n),()=>{s(oe,this)[t]=s(oe,this)[t].filter(r=>r!==n)}}$destroy(){s(Nt,this).$destroy()}},To;typeof HTMLElement=="function"&&(To=class extends HTMLElement{constructor(t,e,n){super(),H(this,"$$ctor",void 0),H(this,"$$s",void 0),H(this,"$$c",void 0),H(this,"$$cn",!1),H(this,"$$d",{}),H(this,"$$r",!1),H(this,"$$p_d",{}),H(this,"$$l",{}),H(this,"$$l_u",new Map),H(this,"$$me",void 0),H(this,"$$shadowRoot",null),this.$$ctor=t,this.$$s=e,n&&(this.$$shadowRoot=this.attachShadow(n))}addEventListener(t,e,n){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const r=this.$$c.$on(t,e);this.$$l_u.set(e,r)}super.addEventListener(t,e,n)}removeEventListener(t,e,n){if(super.removeEventListener(t,e,n),this.$$c){const r=this.$$l_u.get(e);r&&(r(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(r){return i=>{const o=Fn("slot");r!=="default"&&(o.name=r),ft(i,o)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const e={},n=Ls(this);for(const r of this.$$s)r in n&&(r==="default"&&!this.$$d.children?(this.$$d.children=t(r),e.default=!0):e[r]=t(r));for(const r of this.attributes){const i=this.$$g_p(r.name);i in this.$$d||(this.$$d[i]=Mn(i,r.value,this.$$p_d,"toProp"))}for(const r in this.$$p_d)!(r in this.$$d)&&this[r]!==void 0&&(this.$$d[r]=this[r],delete this[r]);this.$$c=Cs({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:e,$$host:this}}),this.$$me=Ba(()=>{Pr(()=>{this.$$r=!0;for(const r of Nn(this.$$c)){if(!this.$$p_d[r]?.reflect)continue;this.$$d[r]=this.$$c[r];const i=Mn(r,this.$$d[r],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[r].attribute||r):this.setAttribute(this.$$p_d[r].attribute||r,i)}this.$$r=!1})});for(const r in this.$$l)for(const i of this.$$l[r]){const o=this.$$c.$on(r,i);this.$$l_u.set(i,o)}this.$$l={}}}attributeChangedCallback(t,e,n){this.$$r||(t=this.$$g_p(t),this.$$d[t]=Mn(t,n,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return Nn(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function Mn(t,e,n,r){const i=n[t]?.type;if(e=i==="Boolean"&&typeof e!="boolean"?e!=null:e,!r||!n[t])return e;if(r==="toAttribute")switch(i){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(i){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function Ls(t){const e={};return t.childNodes.forEach(n=>{e[n.slot||"default"]=!0}),e}function Ws(t,e,n,r,i,o){let a=class extends To{constructor(){super(t,n,i),this.$$p_d=e}static get observedAttributes(){return Nn(e).map(l=>(e[l].attribute||l).toLowerCase())}};return Nn(e).forEach(l=>{Ue(a.prototype,l,{get(){return this.$$c&&l in this.$$c?this.$$c[l]:this.$$d[l]},set(c){c=Mn(l,c,e),this.$$d[l]=c;var h=this.$$c;h&&(ue(h,l)?.get?h[l]=c:h.$set({[l]:c}))}})}),r.forEach(l=>{Ue(a.prototype,l,{get(){return this.$$c?.[l]}})}),o&&(a=o(a)),t.element=a,a}function Rs(t){return t.key==="ContextMenu"?!0:t.key==="F10"&&t.shiftKey===!0}function Hs({key:t,activeIndex:e,count:n,direction:r}){if(n<=0)return null;const i=Er(e,n);return t===(r==="rtl"?"ArrowLeft":"ArrowRight")?(i+1)%n:t===(r==="rtl"?"ArrowRight":"ArrowLeft")?(i-1+n)%n:t==="Home"?0:t==="End"?n-1:null}function Er(t,e){return e<=0||!Number.isFinite(t)||t<0?0:Math.min(Math.trunc(t),e-1)}function Ps(t,e){return t.bottom<0||t.top>e.height||t.right<0||t.left>e.width}var qs=2e3;function Is(t,e,n=qs){if(t===null)return!1;const r=e-t;return r<0?!0:r<n}function Ds(t,e,n={width:0,height:0},r=8){const i=t.left+(t.right-t.left)/2-n.width/2,o=t.top-r-n.height,a=o<4&&t.bottom+r+n.height<=e.height,l=a?t.bottom+r:o;return{x:yi(i,n.width,e.width,4),y:yi(l,n.height,e.height,4),below:a}}function yi(t,e,n,r){const i=n-e-r;return i<=r?r:Math.min(Math.max(t,r),i)}function js(t){if(!t||typeof t!="object")return!1;const e=t;return!(typeof e.id!="string"||e.id.trim().length===0||typeof e.label!="string"||e.label.trim().length===0||e.label.length>40||typeof e.run!="function"||e.iconSvg!==void 0&&typeof e.iconSvg!="string"||e.tooltip!==void 0&&typeof e.tooltip!="string"||e.isAvailable!==void 0&&typeof e.isAvailable!="function")}function zs(t){if(typeof t.isAvailable!="function")return!0;try{return t.isAvailable()!==!1}catch(e){return console.warn(`[AnnotationToolbar] Selection action "${t.id}" failed its availability check:`,e),!1}}function Vs(t){if(!Array.isArray(t))return[];const e=new Set,n=[];return t.forEach((r,i)=>{if(!js(r)){console.warn(`[AnnotationToolbar] Ignoring invalid selection action at index ${i}. Expected { id, label, run } with valid types.`);return}if(e.has(r.id)){console.warn(`[AnnotationToolbar] Ignoring duplicate selection action id "${r.id}".`);return}zs(r)&&(e.add(r.id),n.push(r))}),n}var Bs=qt('<button class="pie-tool-annotation-toolbar__highlight-swatch svelte-1qnnvrt"><span class="pie-sr-only svelte-1qnnvrt"> </span></button>'),Fs=qt('<div class="divider divider-horizontal mx-0 w-px svelte-1qnnvrt"></div> <button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--icon svelte-1qnnvrt"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-1qnnvrt"><path d="M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z"></path></svg></button>',1),Us=qt('<span class="pie-tool-annotation-toolbar__action-icon svelte-1qnnvrt" aria-hidden="true"></span>'),Ks=qt("<button><!></button>"),Xs=qt('<div class="divider divider-horizontal mx-0 w-px svelte-1qnnvrt"></div> <!>',1),Js=qt('<button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--warning svelte-1qnnvrt"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-1qnnvrt"><path d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"></path></svg></button>'),Ys=qt('<button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--danger svelte-1qnnvrt"> </button>'),Zs=qt('<div class="divider divider-horizontal mx-0 w-px svelte-1qnnvrt"></div> <!> <!>',1),Gs=qt('<div class="pie-tool-annotation-toolbar notranslate svelte-1qnnvrt" role="toolbar" translate="no" tabindex="-1"><!> <button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--icon svelte-1qnnvrt"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-1qnnvrt"><path d="M5,21H19V19H5V21M12,17A6,6 0 0,0 18,11V3H15.5V11A3.5,3.5 0 0,1 12,14.5A3.5,3.5 0 0,1 8.5,11V3H6V11A6,6 0 0,0 12,17Z"></path></svg></button> <!> <!> <!></div>'),Qs=qt('<div style="display: none;" aria-hidden="true"></div> <!> <div role="status" aria-live="polite" aria-atomic="true" class="pie-sr-only svelte-1qnnvrt"> </div>',1),tl={hash:"svelte-1qnnvrt",code:`.pie-tool-annotation-toolbar.svelte-1qnnvrt {position:fixed;z-index:4200;display:flex;gap:0.25rem;padding:0.5rem;border-radius:0.5rem;background:var(--pie-background, #fff);color:var(--pie-text, #111827);
214
+ /* WCAG 2.2 SC 1.4.11: this stroke is the only boundary between a floating
215
+ toolbar and the content behind it, so it has to clear 3:1 against both.
216
+ It cannot come from --pie-border, because the DaisyUI bridge maps that
217
+ token to --color-base-300 -- a surface tint rather than a boundary
218
+ colour: #eeeeee at 1.16:1 on the light base, #15191e at 1.12:1 on the
219
+ dark one.
220
+
221
+ A boundary on a light surface has to be dark and one on a dark surface
222
+ has to be light, so the light-dark() arms below are the dark grey first
223
+ and the light grey second. Both are measured against the surfaces the
224
+ toolbar is actually drawn on rather than against pure white and pure
225
+ black: real theme bases are off-white and off-black, and a grey chosen
226
+ at the edge of passing against an extreme drops under threshold on
227
+ everything else. Across DaisyUI's 21 light and 14 dark themes plus the
228
+ PIE light and dark palettes, every light surface needs a grey no
229
+ lighter than #828282 and every dark surface one no darker than
230
+ #878787 -- disjoint ranges, which is why one value cannot serve both
231
+ and light-dark() is the mechanism. #5c5c5c holds 5.22:1 as the worst
232
+ case on the light surfaces, #949494 holds 3.56:1 on the dark ones.
233
+
234
+ light-dark() keys off the declared color-scheme, so every dark DaisyUI
235
+ theme takes the dark value, not only the one named "dark". Palettes
236
+ that pick their own boundary colour -- the data-color-scheme
237
+ accessibility schemes -- set the token themselves in
238
+ @pie-players/pie-theme, which is why this is a token and not a literal;
239
+ several of their backgrounds are mid-tone and defeat both greys. */border:1px solid
240
+ var(--pie-tool-annotation-toolbar-border, light-dark(#5c5c5c, #949494));box-shadow:0 10px 25px -8px rgb(0 0 0 / 0.3);user-select:none;}.pie-tool-annotation-toolbar__highlight-swatch.svelte-1qnnvrt {width:2.5rem;height:2rem;border:2px solid color-mix(in srgb, var(--pie-border-dark, #111827) 20%, transparent);border-radius:0.375rem;cursor:pointer;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;padding:0;}.pie-tool-annotation-toolbar__highlight-swatch.svelte-1qnnvrt:hover {transform:scale(1.1);border-color:color-mix(in srgb, var(--pie-border-dark, #111827) 45%, transparent);box-shadow:0 2px 8px rgb(0 0 0 / 0.15);}.pie-tool-annotation-toolbar__highlight-swatch.svelte-1qnnvrt:focus-visible {outline:2px solid var(--pie-button-focus-outline, var(--pie-primary, #3f51b5));outline-offset:2px;}.pie-tool-annotation-toolbar.svelte-1qnnvrt .divider-horizontal:where(.svelte-1qnnvrt) {height:auto;width:1px;background-color:color-mix(in srgb, var(--pie-border, #d1d5db) 70%, transparent);}
241
+
242
+ /* Screen reader only content */.pie-sr-only.svelte-1qnnvrt {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0;}
243
+
244
+ /* Button styling */.pie-tool-annotation-toolbar__button.svelte-1qnnvrt {display:inline-flex;align-items:center;justify-content:center;gap:0.35rem;padding:0.4rem 0.55rem;border:1px solid var(--pie-button-border, #d1d5db);border-radius:0.4rem;background:var(--pie-button-bg, #fff);color:var(--pie-button-color, var(--pie-text, #111827));cursor:pointer;}.pie-tool-annotation-toolbar__button--icon.svelte-1qnnvrt {min-width:2rem;min-height:2rem;padding:0.45rem;}.pie-tool-annotation-toolbar__button.svelte-1qnnvrt:hover {background:var(--pie-button-hover-bg, #f9fafb);color:var(--pie-button-hover-color, var(--pie-text, #111827));border-color:var(--pie-button-hover-border, #9ca3af);}.pie-tool-annotation-toolbar__button.svelte-1qnnvrt:focus-visible {outline:2px solid var(--pie-button-focus-outline, var(--pie-primary, #3f51b5));outline-offset:2px;}.pie-tool-annotation-toolbar__button.svelte-1qnnvrt:disabled {opacity:0.6;cursor:not-allowed;}.pie-tool-annotation-toolbar__button--warning.svelte-1qnnvrt {color:var(--pie-missing-icon, #92400e);}.pie-tool-annotation-toolbar__button--danger.svelte-1qnnvrt {color:var(--pie-incorrect-icon, #b91c1c);}.pie-tool-annotation-toolbar__button.svelte-1qnnvrt svg:where(.svelte-1qnnvrt) {width:18px;height:18px;}
245
+
246
+ /* Composer-supplied icons carry their own viewBox but rarely their own size, so
247
+ the box is set here to keep an action button the same height as the built-in
248
+ ones — a strip of mismatched buttons reads as broken. */.pie-tool-annotation-toolbar__action-icon.svelte-1qnnvrt {display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;}.pie-tool-annotation-toolbar__action-icon.svelte-1qnnvrt svg {width:100%;height:100%;}`};function el(t,e){Ni(e,!0),ys(t,tl);let n=Sn(e,"enabled",7,!0),r=Sn(e,"highlightCoordinator",7,null),i=Sn(e,"ttsService",7,null),o=Sn(e,"selectionActions",7,null);const a=typeof window<"u",l="pie-annotations",c=["button","input","select","textarea",'[contenteditable="true"]',".pie-tool-annotation-toolbar",".pie-tool-toolbar",'[role="button"]','[role="textbox"]'];let h=j(null),d=j(null);const f=ne(()=>Uo(u(d))),m=ne(()=>[{name:wt.YELLOW,hex:"#fde995",label:u(f).t("tools.annotationToolbar.highlightYellowA11y")},{name:wt.PINK,hex:"#ff9fae",label:u(f).t("tools.annotationToolbar.highlightPinkA11y")},{name:wt.BLUE,hex:"#a7e0f6",label:u(f).t("tools.annotationToolbar.highlightBlueA11y")},{name:wt.GREEN,hex:"#a6e1c5",label:u(f).t("tools.annotationToolbar.highlightGreenA11y")}]);let g=j(null),w=j(null),x=j(null),p=j(he({isVisible:!1,selectedText:"",selectedRange:null,toolbarPosition:{x:0,y:0,below:!1}})),y=j(!1),R=j(!1),W=j(""),k=j(0),P=j(null),I=null,D=null,K=null,X=null,nt=null,ct=j(0),Le=null;function on(v,b){K!==null&&clearTimeout(K),O(W,v,!0),K=setTimeout(()=>{O(W,""),K=null},b)}let an=ne(()=>(u(p).isVisible,Vs(o()))),sn=ne(()=>u(k)>0),ln=ne(()=>u(P)!==null),hn=ne(()=>u(x)?.scopeElement||u(w)?.scopeElement||null);function Kn(){const v=u(h)?.ownerDocument;return u(hn)||v?.documentElement||document.documentElement}function Xn(){const v=u(w)?.canonicalItemId||u(w)?.itemId||"global";return`${l}:${v}`}function ko(v){if(!r())return null;const b=r().getAnnotations();for(const S of b){const L=v.compareBoundaryPoints(Range.START_TO_START,S.range),ee=v.compareBoundaryPoints(Range.END_TO_END,S.range),Gn=v.compareBoundaryPoints(Range.START_TO_END,S.range),vn=v.compareBoundaryPoints(Range.END_TO_START,S.range);if(L>=0&&ee<=0||L<=0&&ee>=0||Gn>0&&vn<0)return S.id}return null}function $o(v){if(v.nodeType!==Node.ELEMENT_NODE&&v.nodeType!==Node.TEXT_NODE)return!1;const b=v.nodeType===Node.TEXT_NODE?v.parentElement:v;return b?!c.some(S=>{try{return b.closest(S)!==null}catch{return!1}}):!1}function xo(v){if(!u(hn))return!0;const b=v.commonAncestorContainer,S=b.nodeType===Node.TEXT_NODE?b.parentElement:b;return!!S&&u(hn).contains(S)}function zr(){if(!(!a||!r()))try{const v=Kn(),b=r().exportAnnotations(v);sessionStorage.setItem(Xn(),JSON.stringify(b))}catch(v){console.error("[AnnotationToolbar] Failed to save annotations:",v)}}function So(){if(!(!a||!r()))try{const v=sessionStorage.getItem(Xn());if(!v)return;const b=JSON.parse(v),S=Kn(),L=r().importAnnotations(b,S);console.log(`[AnnotationToolbar] Restored ${L} annotations`),O(k,r().getAnnotations().length,!0)}catch(v){console.error("[AnnotationToolbar] Failed to load annotations:",v)}}function Jn(){!a||D!==null||(D=(typeof requestAnimationFrame=="function"?requestAnimationFrame:v=>setTimeout(v,16))(()=>{D=null,Vr()}))}function Vr(v={}){if(!n()||!a||Is(I,Date.now()))return;const b=window.getSelection();if(!b||b.rangeCount===0)return te();const S=b.getRangeAt(0),L=b.toString().trim();if(!L||!xo(S)||!$o(S.commonAncestorContainer))return te();if(nt!==null&&(v.force||nt!==L)&&(nt=null),nt===L)return;O(P,ko(S),!0);const ee=u(p).isVisible;u(p).isVisible=!0,u(p).selectedText=L,u(p).selectedRange=S.cloneRange(),Yn(S),X!==L&&(X=L,on(`Annotation toolbar available for "${L.length>30?L.substring(0,30)+"...":L}". Press Shift+F10 for annotation tools.`,4e3)),ee||(O(R,!0),setTimeout(()=>{O(R,!1)},100))}function Yn(v=u(p).selectedRange){if(!v)return;const b=v.getBoundingClientRect(),S={width:window.innerWidth||0,height:window.innerHeight||0};if(Ps(b,S)){u(p).isVisible=!1;return}u(p).isVisible=!0,u(p).toolbarPosition=Ds(b,S,_o())}function _o(){return u(g)?{width:u(g).offsetWidth,height:u(g).offsetHeight}:{width:0,height:0}}function cn(){!u(p).isVisible&&!u(p).selectedRange||Yn()}function Br(){I=Date.now()}function un(){I=null,Jn()}function fn(){nt=u(p).selectedText||null,te()}function te(){u(y)&&i()&&(i().stop(),O(y,!1)),Eo(),u(p).isVisible=!1,u(p).selectedText="",u(p).selectedRange=null,X=null,O(ct,0)}function Eo(){const v=Le;Le=null,v&&Fr()&&typeof v.focus=="function"&&v.isConnected&&v.focus({preventScroll:!0})}function Fr(){if(!u(g)||!a)return!1;const v=u(g).getRootNode().activeElement;return!!v&&u(g).contains(v)}function Zn(){return u(g)?Array.from(u(g).querySelectorAll("button:not([disabled])")):[]}function Ao(){const v=Zn();if(v.length){if(!Fr()&&a){const b=u(g)?.getRootNode()?.activeElement;Le=b instanceof HTMLElement?b:null}O(ct,Er(u(ct),v.length),!0),v[u(ct)]?.focus()}}function Ur(v){if(!u(p).selectedRange||!r())return;const b=u(p).selectedText;r().addAnnotation(u(p).selectedRange,v),O(k,r().getAnnotations().length,!0),zr();const S=v===wt.UNDERLINE?"underlined":`highlighted in ${v}`;on(`"${b.length>30?b.substring(0,30)+"...":b}" ${S}`,3e3),fn()}function Mo(){if(!u(P)||!r()){console.warn("[AnnotationToolbar] No overlapping annotation to remove");return}console.log("[AnnotationToolbar] Removing annotation:",u(P));const v=r().getAnnotation(u(P));if(!v){console.warn("[AnnotationToolbar] Annotation not found:",u(P));return}const b=v.range.toString();r().removeAnnotation(u(P));const S=r().getAnnotations().length;O(k,S,!0),console.log("[AnnotationToolbar] Annotations remaining:",S),zr(),on(`Removed annotation from "${b.length>30?b.substring(0,30)+"...":b}"`,3e3),fn()}function No(){const v=u(k);r()?.clearAnnotations(),O(k,0),sessionStorage.removeItem(Xn()),on(`${v} annotation${v===1?"":"s"} cleared`,3e3),fn()}function Co(v){return v.iconSvg?Ko(v.iconSvg):""}function Oo(v){const b=u(p).selectedText,S=u(p).selectedRange;try{v.run({text:b,range:S})}catch(L){console.error(`[AnnotationToolbar] Selection action "${v.id}" threw:`,L)}fn()}async function Lo(){if(!(!u(p).selectedRange||!i())){O(y,!0);try{console.log("[AnnotationToolbar] Speaking range:",u(p).selectedRange.toString().substring(0,50)),await i().speakRange(u(p).selectedRange,{contentRoot:Kn()}),console.log("[AnnotationToolbar] TTS completed successfully")}catch(v){console.error("[AnnotationToolbar] TTS error:",v),alert(`TTS failed: ${v instanceof Error?v.message:String(v)}`)}finally{O(y,!1)}}}function Kr(v){if(v.key==="Escape"&&u(p).isVisible){v.preventDefault(),te();return}Rs(v)&&(u(p).isVisible||Vr({force:!0}),u(p).isVisible&&(v.preventDefault(),Za().then(()=>Ao())))}function Wo(v){if(v.key==="Escape"){v.preventDefault(),te();return}const b=Zn(),S=Hs({key:v.key,activeIndex:u(ct),count:b.length,direction:a&&u(g)&&getComputedStyle(u(g)).direction==="rtl"?"rtl":"ltr"});S!==null&&(v.preventDefault(),O(ct,S,!0),b[S]?.focus())}function Ro(v){const b=v.relatedTarget;b instanceof Node&&u(g)?.contains(b)||(Le=null,te())}function dn(v){if(!u(p).isVisible||u(R)||!u(g))return;const b=(typeof v.composedPath=="function"?v.composedPath():[]).filter(S=>!!S);b.includes(u(g))||b.length===0&&u(g).contains(v.target)||(Le=null,te())}wn(()=>{if(!a)return;const v=setTimeout(()=>{So()},2e3),b=u(hn)||document;return b.addEventListener("click",dn),b.addEventListener("touchstart",dn),document.addEventListener("selectionchange",Jn),b.addEventListener("pointerdown",Br),document.addEventListener("pointerup",un),document.addEventListener("pointercancel",un),document.addEventListener("keydown",Kr),window.addEventListener("scroll",cn,!0),window.addEventListener("resize",cn),()=>{clearTimeout(v),K!==null&&clearTimeout(K),D!==null&&typeof cancelAnimationFrame=="function"&&(cancelAnimationFrame(D),D=null),b.removeEventListener("click",dn),b.removeEventListener("touchstart",dn),document.removeEventListener("selectionchange",Jn),b.removeEventListener("pointerdown",Br),document.removeEventListener("pointerup",un),document.removeEventListener("pointercancel",un),document.removeEventListener("keydown",Kr),window.removeEventListener("scroll",cn,!0),window.removeEventListener("resize",cn)}}),wn(()=>{u(p).isVisible,u(g),u(an),u(ln),u(sn),i(),Ze(()=>{!u(p).isVisible||!u(g)||Yn()})}),wn(()=>{u(p).isVisible,u(ct),u(ln),u(sn),u(y),u(an),Ze(()=>{const v=Zn();if(v.length===0)return;const b=Er(u(ct),v.length);b!==u(ct)&&O(ct,b,!0),v.forEach((S,L)=>{S.tabIndex=L===b?0:-1})})}),wn(()=>{if(!u(h))return;const v=zo(u(h),L=>{O(w,L,!0)}),b=Fo(u(h),L=>{O(x,L,!0)}),S=Bo(u(h),L=>{O(d,L,!0)});return()=>{S(),b(),v()}});var Ho={get enabled(){return n()},set enabled(v=!0){n(v),Se()},get highlightCoordinator(){return r()},set highlightCoordinator(v=null){r(v),Se()},get ttsService(){return i()},set ttsService(v=null){i(v),Se()},get selectionActions(){return o()},set selectionActions(v=null){o(v),Se()}},Xr=Qs(),Jr=bn(Xr);wi(Jr,v=>O(h,v),()=>u(h));var Yr=Mt(Jr,2),Po=v=>{var b=Gs(),S=En(b);di(S,17,()=>u(m),ps,(J,G)=>{var q=Bs(),Q=er(En(q),!0);qe(q),jt(()=>{gi(q,`background-color: ${u(G).hex??""};`),Y(q,"aria-label",u(G).label),Y(q,"title",u(G).label),Tn(Q,u(G).label)}),Xt("click",q,()=>Ur(u(G).name)),ft(J,q)});var L=Mt(S,2),ee=Mt(L,2),Gn=J=>{var G=Fs(),q=Mt(bn(G),2);jt((Q,It)=>{q.disabled=u(y),Y(q,"aria-label",Q),Y(q,"title",It)},[()=>u(f).t("tools.annotationToolbar.readAloudA11y"),()=>u(f).t("tools.annotationToolbar.readAloud")]),Xt("click",q,Lo),ft(J,G)};ie(ee,J=>{i()&&J(Gn)});var vn=Mt(ee,2),Io=J=>{var G=Xs();di(Mt(bn(G),2),17,()=>u(an),q=>q.id,(q,Q)=>{const It=ne(()=>Co(u(Q)));var Et=Ks();let At;var ut=En(Et),We=Ut=>{var Kt=Us();ws(Kt,()=>u(It),!0),qe(Kt),ft(Ut,Kt)},Re=Ut=>{var Kt=ns();jt(()=>Tn(Kt,u(Q).label)),ft(Ut,Kt)};ie(ut,Ut=>{u(It)?Ut(We):Ut(Re,-1)}),qe(Et),jt(()=>{At=$s(Et,1,"pie-tool-annotation-toolbar__button svelte-1qnnvrt",null,At,{"pie-tool-annotation-toolbar__button--icon":!!u(It)}),Y(Et,"data-pie-selection-action",u(Q).id),Y(Et,"aria-label",u(Q).label),Y(Et,"title",u(Q).tooltip||u(Q).label)}),Xt("click",Et,()=>Oo(u(Q))),ft(q,Et)}),ft(J,G)};ie(vn,J=>{u(an).length>0&&J(Io)});var Do=Mt(vn,2),jo=J=>{var G=Zs(),q=Mt(bn(G),2),Q=At=>{var ut=Js();jt((We,Re)=>{Y(ut,"aria-label",We),Y(ut,"title",Re)},[()=>u(f).t("tools.annotationToolbar.removeA11y"),()=>u(f).t("tools.annotationToolbar.remove")]),Xt("click",ut,Mo),ft(At,ut)};ie(q,At=>{u(ln)&&At(Q)});var It=Mt(q,2),Et=At=>{var ut=Ys(),We=er(ut,!0);jt((Re,Ut,Kt)=>{Y(ut,"aria-label",Re),Y(ut,"title",Ut),Tn(We,Kt)},[()=>u(f).t("tools.annotationToolbar.clearAllA11y"),()=>u(f).t("tools.annotationToolbar.clearAll"),()=>u(f).t("tools.annotationToolbar.clearAll")]),Xt("click",ut,No),ft(At,ut)};ie(It,At=>{u(sn)&&At(Et)}),ft(J,G)};ie(Do,J=>{(u(ln)||u(sn))&&J(jo)}),qe(b),wi(b,J=>O(g,J),()=>u(g)),jt((J,G,q,Q,It)=>{Y(b,"data-pie-placement",u(p).toolbarPosition.below?"below":"above"),gi(b,`left:${u(p).toolbarPosition.x}px; top:${u(p).toolbarPosition.y}px;`),Y(b,"lang",J),Y(b,"dir",G),Y(b,"aria-label",q),Y(L,"aria-label",Q),Y(L,"title",It),b.dir=b.dir},[()=>u(f).getLocale(),()=>u(f).getDirection?.()??"ltr",()=>u(f).t("tools.annotationToolbar.toolbarA11y"),()=>u(f).t("tools.annotationToolbar.underlineA11y"),()=>u(f).t("tools.annotationToolbar.underline")]),Xt("keydown",b,Wo),Xt("focusout",b,Ro),Xt("click",L,()=>Ur(wt.UNDERLINE)),ft(v,b)};ie(Yr,v=>{u(p).isVisible&&v(Po)});var qo=er(Mt(Yr,2),!0);return jt(()=>Tn(qo,u(W))),ft(t,Xr),Ci(Ho)}Ga(["keydown","focusout","click"]);nl("pie-tool-annotation-toolbar",Ws(el,{enabled:{attribute:"enabled",type:"Boolean"},highlightCoordinator:{type:"Object"},ttsService:{type:"Object"},selectionActions:{type:"Object"}},[],[],{mode:"open"},Vo));function nl(t,e){customElements.get(t)||customElements.define(t,e)}export{el as default};