@squadx_dev/brix-client-library 1.0.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk/{DiSJkrZf.es.js → CGLF2cgi.es.js} +25252 -27291
- package/dist/chunk/CGLF2cgi.es.js.map +1 -0
- package/dist/chunk/CPmhQymA.cjs.js +86 -0
- package/dist/chunk/CPmhQymA.cjs.js.map +1 -0
- package/dist/chunk/CcFwM_wb.cjs.js +4 -0
- package/dist/chunk/CcFwM_wb.cjs.js.map +1 -0
- package/dist/chunk/{B-tN7nvh.es.js → CcS3vBvQ.es.js} +18 -16
- package/dist/chunk/CcS3vBvQ.es.js.map +1 -0
- package/dist/component/PlayerUser/PlayerUser.d.ts +24 -0
- package/dist/component/index.cjs.js +2 -2
- package/dist/component/index.d.ts +1 -1
- package/dist/component/index.es.js +2 -2
- package/dist/lib/api.d.ts +38 -0
- package/dist/umd/index.d.ts +1 -0
- package/dist/umd/index.umd.js +311 -0
- package/package.json +31 -38
- package/dist/chunk/B-tN7nvh.es.js.map +0 -1
- package/dist/chunk/BVABk0Tw.cjs.js +0 -4
- package/dist/chunk/BVABk0Tw.cjs.js.map +0 -1
- package/dist/chunk/Ch7W_T2h.cjs.js +0 -145
- package/dist/chunk/Ch7W_T2h.cjs.js.map +0 -1
- package/dist/chunk/DiSJkrZf.es.js.map +0 -1
- package/dist/client-library/src/component/PlayerUser/PlayerUser.d.ts +0 -12
- package/dist/client-library/src/component/PlayerUser/PlayerUser.stories.d.ts +0 -7
- package/dist/client-library/src/component/index.d.ts +0 -1
- package/dist/client-library/src/lib/api.d.ts +0 -14
- package/dist/component/index.umd.js +0 -148
- package/dist/component/index.umd.js.map +0 -1
- /package/dist/{client-library/src/component → component}/PlayerUser/index.d.ts +0 -0
- /package/dist/{client-library/src/lib → lib}/useFetch.d.ts +0 -0
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`@charset "UTF-8";._root_1e6x7_1{position:relative;overflow:hidden;--inject-progress-background-color: #ea5a73;--inject-progress-height: 22px}._progress_1e6x7_8{position:absolute;bottom:0;left:0;right:0;transform:translateY(calc(22px - var(--inject-progress-height) / 2 + var(--inject-progress-height) - 4px))}._progress_1e6x7_8:hover{animation:_pop_1e6x7_1 .45s ease forwards}@keyframes _pop_1e6x7_1{to{transform:translateY(calc(22px - var(--inject-progress-height) / 2))}}._play_button_1e6x7_25,._pause_button_1e6x7_26{position:absolute;top:0;right:0;bottom:0;left:0;font-size:70px;display:flex;align-items:center;justify-content:center;background-color:#0003;color:#fff;cursor:pointer}._play_icon_1e6x7_38{opacity:.8}._pause_button_1e6x7_26{opacity:0}._mute_button_1e6x7_46{position:absolute;top:17px;right:17px;height:32px;width:32px;display:flex;font-size:24px;align-items:center;justify-content:center;color:#fff;cursor:pointer}._root_1det3_1{position:relative;-webkit-user-select:none;user-select:none;width:100%;height:100%;overflow:hidden;background-color:#000}._video_1det3_10{display:block;width:100%;height:100%;object-fit:cover;pointer-events:none}._poster_1det3_18{position:absolute;top:0;right:0;bottom:0;left:0;background-size:cover;background-position:50% 50%;background-repeat:no-repeat;pointer-events:none}._origin_ratio_1det3_27{object-fit:contain;background-size:contain}._layer_1det3_34{position:absolute;top:0;right:0;bottom:0;left:0;cursor:pointer}._shadow_1det3_40:after{content:"";position:absolute;left:0;right:0;top:0;min-height:125px;height:13%;background-image:linear-gradient(rgba(0,0,0,.25),transparent)}._shadow_1det3_40:before{content:"";position:absolute;left:0;right:0;bottom:0;min-height:315px;height:40%;background-image:linear-gradient(transparent,#0000008c)}._forward_animation_1det3_62 ._forward_1det3_62,._backward_animation_1det3_66 ._backward_1det3_66{opacity:1}._indicator_1det3_70{position:absolute;display:flex;top:0;right:0;bottom:0;left:0;pointer-events:none}._indicator_right_1det3_77{left:50%;background:linear-gradient(to right,transparent,rgba(0,0,0,.3764705882))}._indicator_left_1det3_82{transform:rotate(180deg);right:50%;background:linear-gradient(to right,transparent,rgba(0,0,0,.3764705882))}._progress_1det3_88{position:absolute;bottom:65px;left:16px;right:16px;z-index:0}._time_1det3_96{position:absolute;bottom:65px;left:16px;right:16px}._button_1det3_109{border:0px;background-color:transparent;color:#fff;font-weight:500;font-size:13px;outline:transparent;cursor:pointer}._backward_1det3_66{position:absolute;bottom:24px;left:calc(40% - 40px)}._forward_1det3_62{position:absolute;bottom:24px;right:calc(40% - 40px)}._playbackrate_1det3_131{position:absolute;left:16px;bottom:24px;border-radius:20px;min-width:60px;padding:4px 15px;background-color:#00000030;letter-spacing:1.2px}._play_toggle_1det3_142{position:absolute;bottom:24px;left:50%;transform:translate(-50%)}._chapter_toggle_1det3_149{position:absolute;right:16px;bottom:24px;border-radius:20px;padding:4px 15px;background-color:#00000030}._chapter_wrap_1det3_158{position:absolute;bottom:115px;left:0;right:0;overflow-x:auto;padding:8px;display:flex;gap:8px}._chapter_wrap_1det3_158::-webkit-scrollbar{display:none}._root_ob44w_2{--progress-background-color: var( --inject-progress-background-color, var(--primary-color) );--progress-handle-color: var( --inject-progress-handle-color, var(--primary-color) );--progress-height: var(--inject-progress-height, 4px)}._progress_wrap_ob44w_14{position:relative;min-height:44px;display:flex;align-items:center;cursor:pointer}._rail_ob44w_22{position:relative;width:100%;height:var(--progress-height);background-color:#ffffff4c}._progress_ob44w_14{position:absolute;height:var(--progress-height);width:40px;background-color:var(--progress-background-color);pointer-events:none}._handle_ob44w_38:after{content:"";position:absolute;right:-7.5px;top:-5px;border-radius:10px;width:15px;height:15px;background-color:var(--progress-handle-color)}._root_pwcz5_1{display:flex;color:#fff;font-size:12px;justify-content:space-between}._root_1iegb_2{background-image:var(--icon-url, url("data:image/svg+xml,%3csvg%20width='500'%20height='500'%20viewBox='0%200%20500%20500'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M254%2011L236%2029'%20stroke='white'%20stroke-width='1.5'%20stroke-miterlimit='10'/%3e%3cpath%20d='M236%2011L254%2029'%20stroke='white'%20stroke-width='1.5'%20stroke-miterlimit='10'/%3e%3cpath%20d='M202.154%2026.9231C202.154%2027.4739%20201.935%2028.0022%20201.546%2028.3917C201.156%2028.7812%20200.628%2029%20200.077%2029C199.526%2029%20198.998%2028.7812%20198.608%2028.3917C198.219%2028.0022%20198%2027.4739%20198%2026.9231C198%2026.3722%20198.219%2025.844%20198.608%2025.4545C198.998%2025.065%20199.526%2024.8462%20200.077%2024.8462C200.628%2024.8462%20201.156%2025.065%20201.546%2025.4545C201.935%2025.844%20202.154%2026.3722%20202.154%2026.9231ZM202.154%2020C202.154%2020.5508%20201.935%2021.0791%20201.546%2021.4686C201.156%2021.8581%20200.628%2022.0769%20200.077%2022.0769C199.526%2022.0769%20198.998%2021.8581%20198.608%2021.4686C198.219%2021.0791%20198%2020.5508%20198%2020C198%2019.4492%20198.219%2018.9209%20198.608%2018.5314C198.998%2018.1419%20199.526%2017.9231%20200.077%2017.9231C200.628%2017.9231%20201.156%2018.1419%20201.546%2018.5314C201.935%2018.9209%20202.154%2019.4492%20202.154%2020ZM202.154%2013.0769C202.154%2013.6278%20201.935%2014.156%20201.546%2014.5455C201.156%2014.935%20200.628%2015.1538%20200.077%2015.1538C199.526%2015.1538%20198.998%2014.935%20198.608%2014.5455C198.219%2014.156%20198%2013.6278%20198%2013.0769C198%2012.5261%20198.219%2011.9978%20198.608%2011.6083C198.998%2011.2188%20199.526%2011%20200.077%2011C200.628%2011%20201.156%2011.2188%20201.546%2011.6083C201.935%2011.9978%20202.154%2012.5261%20202.154%2013.0769Z'%20fill='white'/%3e%3cpath%20d='M28.8718%2012H10.8205C10.3674%2012%2010%2012.398%2010%2012.8889V27.1111C10%2027.602%2010.3674%2028%2010.8205%2028H28.8718C29.3249%2028%2029.6923%2027.602%2029.6923%2027.1111V12.8889C29.6923%2012.398%2029.3249%2012%2028.8718%2012Z'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M21.0771%2028V21.4359C21.0771%2021.2182%2021.1597%2021.0095%2021.3065%2020.8557C21.4534%2020.7018%2021.6526%2020.6154%2021.8604%2020.6154H29.6925'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M196%20110L204%20118'%20stroke='black'%20stroke-width='1.5'/%3e%3cpath%20d='M204%20102L196%20110.5'%20stroke='black'%20stroke-width='1.5'/%3e%3cpath%20d='M149%20107L155%20113L161%20107'%20stroke='white'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M29.22%20101L11%20119.22'%20stroke='%23060405'%20stroke-width='1.5'%20stroke-miterlimit='10'/%3e%3cpath%20d='M11%20101L29.22%20119.22'%20stroke='%23060405'%20stroke-width='1.5'%20stroke-miterlimit='10'/%3e%3cg%20clip-path='url(%23clip0_410_133)'%3e%3cpath%20d='M300.153%2065.6432H279.847C279.378%2065.6432%20279%2065.2649%20279%2064.7959V60.3701C279%2059.9011%20279.378%2059.5228%20279.847%2059.5228H300.153C300.622%2059.5228%20301%2059.9011%20301%2060.3701V64.7883C301%2065.2649%20300.622%2065.6432%20300.153%2065.6432Z'%20fill='white'/%3e%3cpath%20d='M298.602%2076.4162H281.406C280.702%2076.4162%20280.127%2075.8488%20280.127%2075.1376V67.7085C280.127%2067.0049%20280.695%2066.4299%20281.406%2066.4299H298.602C299.306%2066.4299%20299.881%2066.9973%20299.881%2067.7085V75.1376C299.873%2075.8412%20299.306%2076.4162%20298.602%2076.4162Z'%20fill='white'/%3e%3cpath%20d='M287.367%2060.1432C287.367%2060.1432%20283.115%2057.7601%20285.211%2055.324C287.307%2052.888%20290.991%2055.1576%20289.743%2060.1432H287.367Z'%20stroke='white'%20stroke-width='2'%20stroke-miterlimit='10'/%3e%3cpath%20d='M292.633%2060.1432C292.633%2060.1432%20296.884%2057.7601%20294.789%2055.324C292.693%2052.888%20289.009%2055.1576%20290.257%2060.1432H292.633Z'%20stroke='white'%20stroke-width='2'%20stroke-miterlimit='10'/%3e%3c/g%3e%3cpath%20d='M202.962%2055.3081H197.04C194.823%2055.3081%20192.699%2056.2303%20191.176%2057.8463C188.139%2061.0868%20188.3%2066.1717%20191.54%2069.2092V73.8457V73.8541C191.54%2074.3195%20191.921%2074.7002%20192.395%2074.6917C192.589%2074.6917%20192.784%2074.6241%20192.936%2074.4971L196.684%2071.3751C196.794%2071.3836%20196.921%2071.3836%20197.04%2071.3836H202.962C205.179%2071.3836%20207.193%2070.4867%20208.648%2069.0315C210.103%2067.5762%20211%2065.5626%20211%2063.3458C211%2058.9039%20207.404%2055.3081%20202.962%2055.3081ZM204.231%2062.2882H195.771C195.424%2062.2882%20195.136%2062.0006%20195.136%2061.6537C195.136%2061.3068%20195.424%2061.0191%20195.771%2061.0191H204.231C204.578%2061.0191%20204.866%2061.3068%20204.866%2061.6537C204.866%2062.0006%20204.587%2062.2882%20204.231%2062.2882ZM204.866%2065.461C204.866%2065.8079%20204.578%2066.0956%20204.231%2066.0956H195.771C195.424%2066.0956%20195.136%2065.8079%20195.136%2065.461C195.136%2065.1141%20195.424%2064.8265%20195.771%2064.8265H204.231C204.587%2064.8265%20204.866%2065.1141%20204.866%2065.461Z'%20fill='white'/%3e%3cpath%20d='M157.962%2055.3081H152.04C149.823%2055.3081%20147.699%2056.2303%20146.176%2057.8463C143.139%2061.0868%20143.3%2066.1717%20146.54%2069.2092V73.8457V73.8541C146.54%2074.3195%20146.921%2074.7002%20147.395%2074.6917C147.589%2074.6917%20147.784%2074.6241%20147.936%2074.4971L151.684%2071.3751C151.794%2071.3836%20151.921%2071.3836%20152.04%2071.3836H157.962C160.179%2071.3836%20162.193%2070.4867%20163.648%2069.0315C165.103%2067.5762%20166%2065.5626%20166%2063.3458C166%2058.9039%20162.404%2055.3081%20157.962%2055.3081ZM159.231%2062.2882H150.771C150.424%2062.2882%20150.136%2062.0006%20150.136%2061.6537C150.136%2061.3068%20150.424%2061.0191%20150.771%2061.0191H159.231C159.578%2061.0191%20159.866%2061.3068%20159.866%2061.6537C159.866%2062.0006%20159.587%2062.2882%20159.231%2062.2882ZM159.866%2065.461C159.866%2065.8079%20159.578%2066.0956%20159.231%2066.0956H150.771C150.424%2066.0956%20150.136%2065.8079%20150.136%2065.461C150.136%2065.1141%20150.424%2064.8265%20150.771%2064.8265H159.231C159.587%2064.8265%20159.866%2065.1141%20159.866%2065.461Z'%20fill='white'/%3e%3cg%20clip-path='url(%23clip1_410_133)'%3e%3cpath%20d='M103.348%2068.488H100.287C99.2988%2068.488%2098.5%2067.6892%2098.5%2066.7005V61.5675C98.5%2060.5788%2099.2988%2059.78%20100.287%2059.78H103.348C103.728%2059.78%20104.036%2060.0884%20104.036%2060.4681V67.7999C104.036%2068.1796%20103.728%2068.488%20103.348%2068.488Z'%20fill='white'/%3e%3cpath%20d='M105.183%2060.128V68.1163C105.183%2068.314%20105.349%2068.4722%20105.547%2068.4643C106.615%2068.401%20109.802%2068.4168%20112.167%2070.4891C114.35%2072.4031%20116.359%2073.3364%20117.205%2073.6765C117.403%2073.7556%20117.624%2073.6053%20117.624%2073.3917V54.7814C117.624%2054.5599%20117.403%2054.4096%20117.197%2054.4966C116.414%2054.8288%20114.603%2055.6909%20112.048%2057.3756C108.774%2059.5427%20107.548%2059.7642%20105.531%2059.78C105.341%2059.78%20105.183%2059.9382%20105.183%2060.128Z'%20fill='white'/%3e%3cpath%20d='M100.074%2070.2913L101.205%2075.2425C101.244%2075.4086%20101.395%2075.5272%20101.569%2075.5272H103.957C104.179%2075.5272%20104.353%2075.3374%20104.329%2075.1159L103.767%2070.1648C103.744%2069.9749%20103.586%2069.8326%20103.396%2069.8326H100.43C100.192%2069.8405%20100.018%2070.0619%20100.074%2070.2913Z'%20fill='white'/%3e%3cpath%20d='M118.779%2061.3539V66.8113C120.282%2066.8113%20121.508%2065.5933%20121.508%2064.0826C121.5%2062.5799%20120.282%2061.3539%20118.779%2061.3539Z'%20fill='white'/%3e%3c/g%3e%3cpath%20d='M54%2060.7516V60.5495C54%2057.4842%2056.4565%2055%2059.4979%2055H59.9157C61.9962%2055%2063.9263%2056.0947%2064.9958%2057.8968C66.0653%2056.1032%2067.9954%2055%2070.076%2055H70.4937C73.5351%2055%2076%2057.4842%2076%2060.5495V60.9705C76%2062.4947%2075.4235%2063.9516%2074.3957%2065.0632L74.3122%2065.1642L65.0376%2075L65.0125%2074.9747L64.9875%2075L55.6962%2065.1558L55.6126%2065.0547C54.5765%2063.9516%2054%2062.4863%2054.0084%2060.9621V60.7516H54Z'%20fill='white'/%3e%3cg%20clip-path='url(%23clip2_410_133)'%3e%3cpath%20d='M30.255%2055H12.8265C11.5486%2055%2010.5059%2056.0427%2010.5059%2057.3207V61.5386H11.6662V57.3207C11.6662%2056.6778%2012.1836%2056.1603%2012.8265%2056.1603H30.255C30.8979%2056.1603%2031.4153%2056.6778%2031.4153%2057.3207V68.5241C31.4153%2069.167%2030.8979%2069.6844%2030.255%2069.6844H25.9116V70.8448H30.255C31.5329%2070.8448%2032.5756%2069.802%2032.5756%2068.5241V57.3207C32.5756%2056.0427%2031.5329%2055%2030.255%2055Z'%20fill='white'/%3e%3cpath%20d='M27.221%2060.4959H24.5005V75H27.221C28.1932%2075%2028.985%2074.2082%2028.985%2073.236V62.2599C28.985%2061.2878%2028.1932%2060.4959%2027.221%2060.4959Z'%20fill='white'/%3e%3cpath%20d='M15.9707%2066.7209C16.347%2066.7209%2016.6606%2066.4152%2016.6606%2066.031C16.6606%2065.6547%2016.3548%2065.3411%2015.9707%2065.3411C15.5944%2065.3411%2015.2808%2065.6468%2015.2808%2066.031C15.2808%2066.4152%2015.5944%2066.7209%2015.9707%2066.7209Z'%20fill='white'/%3e%3cpath%20d='M19.4121%2070.1548C19.7931%2070.1548%2020.102%2069.8459%2020.102%2069.4649C20.102%2069.0839%2019.7931%2068.775%2019.4121%2068.775C19.0311%2068.775%2018.7222%2069.0839%2018.7222%2069.4649C18.7222%2069.8459%2019.0311%2070.1548%2019.4121%2070.1548Z'%20fill='white'/%3e%3cpath%20d='M9.18882%2060.4959C8.21665%2060.4959%207.4248%2061.2878%207.4248%2062.2599V65.1764H8.01281C9.29074%2065.1764%2010.3335%2066.1721%2010.3335%2067.3952C10.3335%2068.6182%209.29074%2069.6139%208.01281%2069.6139H7.4248V73.236C7.4248%2074.2082%208.21665%2075%209.18882%2075H23.4029V60.4959H9.18882ZM15.9705%2064.6511C16.731%2064.6511%2017.3425%2065.2705%2017.3425%2066.0232C17.3425%2066.7836%2016.7231%2067.3952%2015.9705%2067.3952C15.21%2067.3952%2014.5985%2066.7758%2014.5985%2066.0232C14.5985%2065.2705%2015.21%2064.6511%2015.9705%2064.6511ZM15.5314%2070.3979C15.3981%2070.5312%2015.1786%2070.5312%2015.0453%2070.3979C14.9121%2070.2646%2014.9121%2070.0451%2015.0453%2069.9118L19.8591%2065.098C19.9924%2064.9647%2020.2119%2064.9647%2020.3452%2065.098C20.4785%2065.2313%2020.4785%2065.4508%2020.3452%2065.5841L15.5314%2070.3979ZM19.4123%2070.8448C18.6518%2070.8448%2018.0402%2070.2254%2018.0402%2069.4728C18.0402%2068.7123%2018.6596%2068.1008%2019.4123%2068.1008C20.1649%2068.1008%2020.7843%2068.7201%2020.7843%2069.4728C20.7843%2070.2254%2020.1649%2070.8448%2019.4123%2070.8448Z'%20fill='white'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip3_410_133)'%3e%3cpath%20d='M326.4%207.93331L318.6%203.59998V12.2666L326.4%207.93331Z'%20stroke='white'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip4_410_133)'%3e%3cpath%20d='M341.767%2012.6667C341.767%2012.6667%20337%209.95154%20337%206.69335C337%203.43516%20340.707%203.16365%20341.767%205.71286C342.826%203.16365%20346.533%203.43516%20346.533%206.69335C346.533%209.95154%20341.767%2012.6667%20341.767%2012.6667Z'%20stroke='white'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cpath%20d='M18.5%20202H61.4289C61.9234%20202%2062.4067%20202.147%2062.8179%20202.421C63.229%20202.696%2063.5494%20203.086%2063.7386%20203.543C63.9279%20204%2063.9774%20204.503%2063.8809%20204.988C63.7844%20205.473%2063.5463%20205.918%2063.1967%20206.268L39.9645%20229.5L16.7322%20206.268C16.3826%20205.918%2016.1445%20205.473%2016.048%20204.988C15.9516%20204.503%2016.0011%20204%2016.1903%20203.543C16.3795%20203.086%2016.7%20202.696%2017.1111%20202.421C17.5222%20202.147%2018.0055%20202%2018.5%20202Z'%20stroke='%23AAAAAA'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M18.5%20257H61.4289C61.9234%20257%2062.4067%20256.853%2062.8179%20256.579C63.229%20256.304%2063.5494%20255.914%2063.7386%20255.457C63.9279%20255%2063.9774%20254.497%2063.8809%20254.012C63.7844%20253.527%2063.5463%20253.082%2063.1967%20252.732L39.9645%20229.5L16.7322%20252.732C16.3826%20253.082%2016.1445%20253.527%2016.048%20254.012C15.9516%20254.497%2016.0011%20255%2016.1903%20255.457C16.3795%20255.914%2016.7%20256.304%2017.1111%20256.579C17.5222%20256.853%2018.0055%20257%2018.5%20257Z'%20stroke='%23AAAAAA'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M54.9639%20244.5H24.9639'%20stroke='%23AAAAAA'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M103.787%20208.787L146.214%20251.213'%20stroke='%23AAAAAA'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M125%20260C141.569%20260%20155%20246.569%20155%20230C155%20213.431%20141.569%20200%20125%20200C108.431%20200%2095%20213.431%2095%20230C95%20246.569%20108.431%20260%20125%20260Z'%20stroke='%23AAAAAA'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20clip-path='url(%23clip5_410_133)'%3e%3cpath%20d='M348.441%2092.8H336.824C336.423%2092.8%20336.098%2093.112%20336.098%2093.497V102.502C336.098%20103.086%20336.802%20103.411%20337.278%20103.046L339.529%20101.317C339.658%20101.218%20339.818%20101.164%20339.983%20101.164H348.441C348.842%20101.164%20349.167%20100.852%20349.167%20100.467V93.497C349.167%2093.112%20348.842%2092.8%20348.441%2092.8Z'%20stroke='%23666666'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M345.537%2096.9821H345.539V96.9841H345.537V96.9821Z'%20stroke='%23666666'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M342.633%2096.9821H342.635V96.9841H342.633V96.9821Z'%20stroke='%23666666'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M339.729%2096.9821H339.731V96.9841H339.729V96.9821Z'%20stroke='%23666666'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cpath%20d='M358.036%2099C357.752%2099%20357.508%2098.9018%20357.305%2098.7056C357.102%2098.5093%20357%2098.2741%20357%2098C357%2097.7259%20357.102%2097.4907%20357.305%2097.2944C357.508%2097.0981%20357.752%2097%20358.036%2097C358.32%2097%20358.564%2097.0981%20358.767%2097.2944C358.971%2097.4907%20359.072%2097.7259%20359.072%2098C359.072%2098.1815%20359.024%2098.3481%20358.928%2098.5C358.836%2098.6518%20358.711%2098.7741%20358.554%2098.8667C358.401%2098.9556%20358.228%2099%20358.036%2099ZM362.5%2099C362.216%2099%20361.972%2098.9018%20361.769%2098.7056C361.566%2098.5093%20361.464%2098.2741%20361.464%2098C361.464%2097.7259%20361.566%2097.4907%20361.769%2097.2944C361.972%2097.0981%20362.216%2097%20362.5%2097C362.784%2097%20363.028%2097.0981%20363.231%2097.2944C363.434%2097.4907%20363.536%2097.7259%20363.536%2098C363.536%2098.1815%20363.488%2098.3481%20363.392%2098.5C363.3%2098.6518%20363.175%2098.7741%20363.018%2098.8667C362.865%2098.9556%20362.692%2099%20362.5%2099ZM366.964%2099C366.68%2099%20366.436%2098.9018%20366.233%2098.7056C366.029%2098.5093%20365.928%2098.2741%20365.928%2098C365.928%2097.7259%20366.029%2097.4907%20366.233%2097.2944C366.436%2097.0981%20366.68%2097%20366.964%2097C367.248%2097%20367.492%2097.0981%20367.695%2097.2944C367.898%2097.4907%20368%2097.7259%20368%2098C368%2098.1815%20367.952%2098.3481%20367.856%2098.5C367.764%2098.6518%20367.639%2098.7741%20367.482%2098.8667C367.328%2098.9556%20367.156%2099%20366.964%2099Z'%20fill='%23666666'/%3e%3cg%20clip-path='url(%23clip6_410_133)'%3e%3cpath%20d='M380.156%2099.8438L377.812%20102.188'%20stroke='%23666666'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M384.045%2091.7378L380.392%2095.3907C380.392%2095.3907%20378.766%2094.5779%20377.029%2095.9796C376.977%2096.0209%20376.935%2096.0726%20376.905%2096.1312C376.875%2096.1898%20376.858%2096.2541%20376.854%2096.3199C376.851%2096.3856%20376.861%2096.4514%20376.884%2096.513C376.908%2096.5745%20376.944%2096.6304%20376.991%2096.677L383.313%20102.999C383.36%20103.047%20383.417%20103.083%20383.48%20103.107C383.543%20103.13%20383.61%20103.14%20383.677%20103.136C383.743%20103.131%20383.809%20103.112%20383.867%20103.08C383.926%20103.048%20383.978%20103.004%20384.018%20102.95C384.51%20102.297%20385.282%20100.953%20384.611%2099.6095L388.263%2095.9566C388.351%2095.8687%20388.401%2095.7494%20388.401%2095.6251C388.401%2095.5008%20388.351%2095.3816%20388.263%2095.2937L384.708%2091.7378C384.62%2091.6499%20384.501%2091.6005%20384.376%2091.6005C384.252%2091.6005%20384.133%2091.6499%20384.045%2091.7378Z'%20stroke='%23666666'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M384.045%2091.7379L380.392%2095.3908C380.392%2095.3908%20378.766%2094.578%20377.029%2095.9797C376.977%2096.021%20376.935%2096.0726%20376.905%2096.1313C376.875%2096.1899%20376.858%2096.2542%20376.854%2096.3199C376.851%2096.3857%20376.861%2096.4515%20376.884%2096.513C376.908%2096.5746%20376.944%2096.6305%20376.991%2096.6771L383.313%20102.999C383.36%20103.047%20383.417%20103.083%20383.48%20103.107C383.543%20103.13%20383.61%20103.14%20383.677%20103.136C383.743%20103.131%20383.809%20103.112%20383.867%20103.08C383.926%20103.048%20383.978%20103.004%20384.018%20102.95C384.51%20102.297%20385.282%20100.953%20384.611%2099.6095L388.263%2095.9566C388.351%2095.8687%20388.401%2095.7495%20388.401%2095.6252C388.401%2095.5009%20388.351%2095.3816%20388.263%2095.2937L384.708%2091.7379C384.62%2091.65%20384.501%2091.6006%20384.376%2091.6006C384.252%2091.6006%20384.133%2091.65%20384.045%2091.7379Z'%20stroke='%23666666'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cpath%20d='M322.18%20101.756C325.564%20101.756%20327.878%2099.6132%20327.878%2096.0765C327.878%2092.5545%20325.564%2090.5%20322.18%2090.5C318.779%2090.5%20316.465%2092.5398%20316.465%2096.0765C316.465%2099.6132%20318.779%20101.756%20322.18%20101.756ZM322.18%2099.9801C320.263%2099.9801%20319.072%2098.5273%20319.072%2096.0765C319.072%2093.7579%20320.263%2092.3637%20322.18%2092.3637C324.079%2092.3637%20325.288%2093.7579%20325.288%2096.0765C325.288%2098.5273%20324.079%2099.9801%20322.18%2099.9801ZM326.307%20104.5C327.239%20104.5%20327.999%20104.368%20328.465%20104.177L327.999%20102.578C327.619%20102.695%20327.153%20102.768%20326.583%20102.768C325.305%20102.768%20323.993%20102.328%20323.509%20101.271L320.92%20101.492C321.731%20103.223%20323.596%20104.5%20326.307%20104.5Z'%20fill='%23666666'/%3e%3cpath%20d='M102.85%20284.034L118.815%20293.61C119.861%20294.24%20119.861%20295.756%20118.815%20296.386L102.85%20305.967C101.772%20306.616%20100.4%20305.838%20100.4%20304.581V285.424C100.4%20284.163%20101.772%20283.385%20102.85%20284.034Z'%20fill='white'/%3e%3cpath%20d='M61.3931%20306.989H57.8786C57.3939%20306.989%2057%20306.588%2057%20306.088V284.907C57%20284.406%2057.3939%20284%2057.8786%20284H61.3931C61.8779%20284%2062.2718%20284.406%2062.2718%20284.907V306.088C62.2667%20306.588%2061.8779%20306.989%2061.3931%20306.989Z'%20fill='white'/%3e%3cpath%20d='M72.9264%20306.989H69.4118C68.9271%20306.989%2068.5332%20306.583%2068.5332%20306.083V284.907C68.5332%20284.406%2068.9271%20284%2069.4118%20284H72.9264C73.4111%20284%2073.805%20284.406%2073.805%20284.907V306.088C73.7999%20306.588%2073.4111%20306.989%2072.9264%20306.989Z'%20fill='white'/%3e%3cg%20clip-path='url(%23clip7_410_133)'%3e%3cpath%20d='M19.9873%20286.25V283.25L13.7373%20287.5L19.9873%20291.75V288.75C24.1248%20288.75%2027.4873%20292.113%2027.4873%20296.25C27.4873%20300.388%2024.1248%20303.75%2019.9873%20303.75C15.8498%20303.75%2012.4873%20300.388%2012.4873%20296.25H9.9873C9.9873%20301.775%2014.4623%20306.25%2019.9873%20306.25C25.5123%20306.25%2029.9873%20301.775%2029.9873%20296.25C29.9873%20290.725%2025.5123%20286.25%2019.9873%20286.25Z'%20fill='white'/%3e%3cpath%20d='M18.6121%20300H17.5496V295.925L16.2871%20296.312V295.45L18.4996%20294.662H18.6121V300Z'%20fill='white'/%3e%3cpath%20d='M23.9621%20297.8C23.9621%20298.2%2023.9246%20298.55%2023.8371%20298.825C23.7496%20299.1%2023.6246%20299.35%2023.4746%20299.537C23.3246%20299.725%2023.1246%20299.862%2022.9121%20299.95C22.6996%20300.037%2022.4496%20300.075%2022.1746%20300.075C21.8996%20300.075%2021.6621%20300.037%2021.4371%20299.95C21.2121%20299.862%2021.0246%20299.725%2020.8621%20299.537C20.6996%20299.35%2020.5746%20299.112%2020.4871%20298.825C20.3996%20298.537%2020.3496%20298.2%2020.3496%20297.8V296.875C20.3496%20296.475%2020.3871%20296.125%2020.4746%20295.85C20.5621%20295.575%2020.6871%20295.325%2020.8371%20295.137C20.9871%20294.95%2021.1871%20294.812%2021.3996%20294.725C21.6121%20294.637%2021.8621%20294.6%2022.1371%20294.6C22.4121%20294.6%2022.6496%20294.637%2022.8746%20294.725C23.0996%20294.812%2023.2871%20294.95%2023.4496%20295.137C23.6121%20295.325%2023.7371%20295.562%2023.8246%20295.85C23.9121%20296.137%2023.9621%20296.475%2023.9621%20296.875V297.8ZM22.8996%20296.725C22.8996%20296.487%2022.8871%20296.287%2022.8496%20296.125C22.8121%20295.962%2022.7621%20295.837%2022.6996%20295.737C22.6371%20295.637%2022.5621%20295.562%2022.4621%20295.525C22.3621%20295.487%2022.2621%20295.462%2022.1496%20295.462C22.0371%20295.462%2021.9246%20295.487%2021.8371%20295.525C21.7496%20295.562%2021.6621%20295.637%2021.5996%20295.737C21.5371%20295.837%2021.4871%20295.962%2021.4496%20296.125C21.4121%20296.287%2021.3996%20296.487%2021.3996%20296.725V297.937C21.3996%20298.175%2021.4121%20298.375%2021.4496%20298.537C21.4871%20298.7%2021.5371%20298.837%2021.5996%20298.937C21.6621%20299.037%2021.7371%20299.112%2021.8371%20299.15C21.9371%20299.187%2022.0371%20299.212%2022.1496%20299.212C22.2621%20299.212%2022.3746%20299.187%2022.4621%20299.15C22.5496%20299.112%2022.6371%20299.037%2022.6996%20298.937C22.7621%20298.837%2022.8121%20298.7%2022.8371%20298.537C22.8621%20298.375%2022.8871%20298.175%2022.8871%20297.937V296.725H22.8996Z'%20fill='white'/%3e%3c/g%3e%3cpath%20d='M239%20281L251%20295L239%20309'%20stroke='%23E3E3E3'%20stroke-width='3'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M241%20340L249%20348'%20stroke='white'/%3e%3cpath%20d='M249%20332L241%20340.5'%20stroke='white'/%3e%3cg%20clip-path='url(%23clip8_410_133)'%3e%3cpath%20d='M163.5%20296.25C163.5%20300.388%20160.137%20303.75%20156%20303.75C151.863%20303.75%20148.5%20300.388%20148.5%20296.25C148.5%20292.113%20151.863%20288.75%20156%20288.75V291.75L162.25%20287.5L156%20283.25V286.25C150.475%20286.25%20146%20290.725%20146%20296.25C146%20301.775%20150.475%20306.25%20156%20306.25C161.525%20306.25%20166%20301.775%20166%20296.25H163.5Z'%20fill='white'/%3e%3cpath%20d='M154.575%20299.925V294.588H154.463L152.25%20295.375V296.238L153.513%20295.85V299.925H154.575Z'%20fill='white'/%3e%3cpath%20d='M156.312%20296.8V297.725C156.312%20300.1%20157.95%20300%20158.112%20300C158.287%20300%20159.912%20300.113%20159.912%20297.725V296.8C159.912%20294.425%20158.275%20294.525%20158.112%20294.525C157.937%20294.525%20156.312%20294.413%20156.312%20296.8ZM158.862%20296.65V297.863C158.862%20298.825%20158.6%20299.15%20158.125%20299.15C157.65%20299.15%20157.375%20298.825%20157.375%20297.863V296.65C157.375%20295.713%20157.65%20295.388%20158.112%20295.388C158.587%20295.375%20158.862%20295.713%20158.862%20296.65Z'%20fill='white'/%3e%3c/g%3e%3cpath%20d='M206%20309L194%20295L206%20281'%20stroke='%23E3E3E3'%20stroke-width='3'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M362%204.9375V8H365.062'%20stroke='white'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M362%2012.8125C364.658%2012.8125%20366.812%2010.6579%20366.812%208C366.812%205.34213%20364.658%203.1875%20362%203.1875C359.342%203.1875%20357.188%205.34213%20357.188%208C357.188%2010.6579%20359.342%2012.8125%20362%2012.8125Z'%20stroke='white'%20stroke-miterlimit='10'/%3e%3cpath%20d='M365.712%202.43152L367.569%204.28767'%20stroke='white'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M356.432%204.28767L358.288%202.43152'%20stroke='white'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M112.962%20339.308H107.04C104.823%20339.308%20102.699%20340.23%20101.176%20341.846C98.139%20345.087%2098.2997%20350.172%20101.54%20353.209V357.846V357.854C101.54%20358.319%20101.921%20358.7%20102.395%20358.692C102.589%20358.692%20102.784%20358.624%20102.936%20358.497L106.684%20355.375C106.794%20355.384%20106.921%20355.384%20107.04%20355.384H112.962C115.179%20355.384%20117.193%20354.487%20118.648%20353.031C120.103%20351.576%20121%20349.563%20121%20347.346C121%20342.904%20117.404%20339.308%20112.962%20339.308ZM114.231%20346.288H105.771C105.424%20346.288%20105.136%20346.001%20105.136%20345.654C105.136%20345.307%20105.424%20345.019%20105.771%20345.019H114.231C114.578%20345.019%20114.866%20345.307%20114.866%20345.654C114.866%20346.001%20114.587%20346.288%20114.231%20346.288ZM114.866%20349.461C114.866%20349.808%20114.578%20350.096%20114.231%20350.096H105.771C105.424%20350.096%20105.136%20349.808%20105.136%20349.461C105.136%20349.114%20105.424%20348.826%20105.771%20348.826H114.231C114.587%20348.826%20114.866%20349.114%20114.866%20349.461Z'%20fill='white'/%3e%3cpath%20d='M161.98%20342.984V345.947C162.011%20347.049%20161.141%20347.97%20160.028%20348H145.353C144.241%20347.98%20143.371%20347.059%20143.401%20345.947V334.053C143.371%20332.951%20144.241%20332.03%20145.353%20332H154.648'%20stroke='white'%20stroke-width='1.5'%20stroke-miterlimit='10'/%3e%3cpath%20d='M152.725%20342.731C152.725%20342.731%20152.31%20336.399%20157.296%20336.298C161.079%20336.217%20165.589%20336.319%20165.589%20336.319'%20stroke='white'%20stroke-width='1.5'%20stroke-miterlimit='10'/%3e%3cpath%20d='M162.163%20332.03L165.804%20335.671L162.163%20339.312'%20stroke='white'%20stroke-width='1.5'/%3e%3cpath%20d='M204%20340L196%20332'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M196%20348L204%20339.5'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M54%20344.752V344.549C54%20341.484%2056.4565%20339%2059.4979%20339H59.9157C61.9962%20339%2063.9263%20340.095%2064.9958%20341.897C66.0653%20340.103%2067.9954%20339%2070.076%20339H70.4937C73.5351%20339%2076%20341.484%2076%20344.549V344.971C76%20346.495%2075.4235%20347.952%2074.3957%20349.063L74.3122%20349.164L65.0376%20359L65.0125%20358.975L64.9875%20359L55.6962%20349.156L55.6126%20349.055C54.5765%20347.952%2054%20346.486%2054.0084%20344.962V344.752H54Z'%20fill='white'/%3e%3cg%20clip-path='url(%23clip9_410_133)'%3e%3cpath%20d='M72.4966%2017.5V22.5'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M75.8301%2015.8333V24.1666'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M57.5%2010.8333L74.1667%2029.1666'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M64.1831%2013.2285L68.3341%2010V17.7947'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M68.3333%2022.75V30L60.8333%2024.1666H55.8333C55.6123%2024.1666%2055.4004%2024.0788%2055.2441%2023.9226C55.0878%2023.7663%2055%2023.5543%2055%2023.3333V16.6666C55%2016.4456%2055.0878%2016.2337%2055.2441%2016.0774C55.4004%2015.9211%2055.6123%2015.8333%2055.8333%2015.8333H62.0455'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip10_410_133)'%3e%3cpath%20d='M105.833%2024.1667H100.833C100.612%2024.1667%20100.4%2024.0789%20100.244%2023.9226C100.088%2023.7663%20100%2023.5543%20100%2023.3333V16.6667C100%2016.4457%20100.088%2016.2337%20100.244%2016.0774C100.4%2015.9211%20100.612%2015.8333%20100.833%2015.8333H105.833L113.333%2010V30L105.833%2024.1667Z'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M117.499%2017.5001V22.5001'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M120.831%2015.8333V24.1666'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip11_410_133)'%3e%3cpath%20d='M161.98%2022.9836V25.9469C162.011%2027.0493%20161.141%2027.9697%20160.028%2028H145.353C144.241%2027.9798%20143.371%2027.0594%20143.401%2025.9469V14.0531C143.371%2012.9507%20144.241%2012.0303%20145.353%2012H154.648'%20stroke='white'%20stroke-width='1.5'%20stroke-miterlimit='10'/%3e%3cpath%20d='M152.725%2022.7306C152.725%2022.7306%20152.31%2016.3994%20157.296%2016.2983C161.079%2016.2174%20165.589%2016.3185%20165.589%2016.3185'%20stroke='white'%20stroke-width='1.5'%20stroke-miterlimit='10'/%3e%3cpath%20d='M162.163%2012.0304L165.804%2015.6714L162.163%2019.3123'%20stroke='white'%20stroke-width='1.5'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip12_410_133)'%3e%3cpath%20d='M24.4142%20341.397C24.4343%20341.397%2024.4544%20341.398%2024.4745%20341.4V340.619C24.4745%20340.276%2024.1931%20340%2023.8448%20340H15.7552C15.4068%20340%2015.1255%20340.276%2015.1255%20340.619V341.401C15.1456%20341.4%2015.1657%20341.398%2015.1858%20341.398H24.4142V341.397Z'%20fill='white'/%3e%3cpath%20d='M26.9035%20342.159C26.8726%20342.158%2026.8432%20342.155%2026.811%20342.155H12.7888C12.758%20342.155%2012.7272%20342.158%2012.6964%20342.159C11.9582%20342.207%2011.374%20342.807%2011.374%20343.544V344.4H12.6964H26.9035H28.2258V343.544C28.2258%20342.807%2027.6417%20342.207%2026.9035%20342.159Z'%20fill='white'/%3e%3cpath%20d='M28.2259%20346.374C28.944%20346.374%2029.5282%20346.948%2029.5282%20347.653V356.867C29.5282%20357.573%2028.944%20358.147%2028.2259%20358.147H11.3741C10.656%20358.147%2010.0718%20357.573%2010.0718%20356.867V347.653C10.0718%20346.948%2010.656%20346.374%2011.3741%20346.374H12.6965H26.9035H28.2259ZM28.2259%20345.32H26.9035H12.6965H11.3741C10.0624%20345.32%209%20346.364%209%20347.653V356.867C9%20358.156%2010.0624%20359.2%2011.3741%20359.2H28.2259C29.5375%20359.2%2030.6%20358.156%2030.6%20356.867V347.653C30.6%20346.364%2029.5375%20345.32%2028.2259%20345.32Z'%20fill='white'/%3e%3cpath%20d='M17.1484%20355.874L23.0582%20352.43L17.1484%20348.646V355.874Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_410_133'%3e%3crect%20width='22'%20height='22.8322'%20fill='white'%20transform='translate(279%2053.584)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_410_133'%3e%3crect%20width='23'%20height='21.0543'%20fill='white'%20transform='translate(98.5%2054.4729)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_410_133'%3e%3crect%20width='25.1509'%20height='20'%20fill='white'%20transform='translate(7.4248%2055)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip3_410_133'%3e%3crect%20width='13'%20height='13'%20fill='white'%20transform='translate(316%201)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip4_410_133'%3e%3crect%20width='13'%20height='13'%20fill='white'%20transform='translate(335%201.5)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip5_410_133'%3e%3crect%20width='15'%20height='12'%20fill='white'%20transform='translate(335%2092)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip6_410_133'%3e%3crect%20width='15'%20height='15'%20fill='white'%20transform='translate(375%2090)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip7_410_133'%3e%3crect%20width='30'%20height='30'%20fill='white'%20transform='translate(5%20280)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip8_410_133'%3e%3crect%20width='30'%20height='30'%20fill='white'%20transform='translate(141%20280)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip9_410_133'%3e%3crect%20width='40'%20height='40'%20fill='white'%20transform='translate(45)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip10_410_133'%3e%3crect%20width='40'%20height='40'%20fill='white'%20transform='translate(90)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip11_410_133'%3e%3crect%20width='40'%20height='40'%20fill='white'%20transform='translate(135)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip12_410_133'%3e%3crect%20width='21.6'%20height='19.2'%20fill='white'%20transform='translate(9%20340)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e"));background-size:500px 500px;background-repeat:no-repeat;display:inline-block}._pip_1iegb_10{width:40px;height:40px;background-position:0px 0px}._mute_1iegb_16{width:40px;height:40px;background-position:-45px 0px}._unmute_1iegb_22{width:40px;height:40px;background-position:-90px 0px}._share_1iegb_28{width:40px;height:40px;background-position:-135px 0px}._setting_1iegb_34{width:40px;height:40px;background-position:-180px 0px}._close_1iegb_40{width:40px;height:40px;background-position:-225px 0px}._coupon_1iegb_47{width:40px;height:40px;background-position:0px -45px}._like_1iegb_53{width:40px;height:40px;background-position:-45px -45px}._notice_1iegb_59{width:40px;height:40px;background-position:-90px -45px}._chat_1iegb_65{width:40px;height:40px;background-position:-135px -45px}._comment_1iegb_71{width:40px;height:40px;background-position:-180px -45px}._product_1iegb_77{width:40px;height:40px;background-position:-225px -45px}._event_1iegb_83{width:40px;height:40px;background-position:-270px -45px}._purchase_1iegb_90{width:85px;height:40px;background-position:-45px -90px}._close_pane_1iegb_96{width:40px;height:40px;background-position:0px -90px}._close_pane_B_1iegb_102{width:40px;height:40px;background-position:-135px -90px}._back_1iegb_108{width:40px;height:40px;background-position:-180px -90px}._backward_1iegb_115{width:40px;height:40px;background-position:0px -275px}._pause_1iegb_121{width:40px;height:40px;background-position:-45px -275px}._play_1iegb_127{width:40px;height:40px;background-position:-90px -275px}._forward_1iegb_133{width:40px;height:40px;background-position:-135px -275px}._left_1iegb_140{width:40px;height:40px;background-position:-180px -275px}._right_1iegb_146{width:40px;height:40px;background-position:-225px -275px}._converting_1iegb_153{width:80px;height:80px;background-position:0px -190px}._cancel_1iegb_159{width:80px;height:80px;background-position:-85px -190px}._sm_view_1iegb_166{width:15px;height:15px;background-position:-315px 0px}._sm_like_1iegb_172{width:15px;height:15px;background-position:-335px 0px}._sm_countdown_1iegb_178{width:15px;height:15px;background-position:-355px 0px}._sm_question_1iegb_184{width:15px;height:15px;background-position:-315px -90px}._sm_comment_1iegb_190{width:15px;height:15px;background-position:-335px -90px}._sm_more_1iegb_196{width:15px;height:15px;background-position:-355px -90px}._sm_fix_1iegb_202{width:15px;height:15px;background-position:-375px -90px}._chapter_shorts_1iegb_208{width:40px;height:40px;background-position:0px -320px}._like_shorts_1iegb_214{width:40px;height:40px;background-position:-45px -320px}._comment_shorts_1iegb_220{width:40px;height:40px;background-position:-90px -320px}._share_shorts_1iegb_226{width:40px;height:40px;background-position:-135px -320px}._more_product_shorts_1iegb_232{width:40px;height:40px;background-position:-180px -320px}._close_drawer_shorts_1iegb_238{width:40px;height:40px;background-position:-225px -320px}._root_1v1it_1{position:relative;display:inline-block;height:130px;width:90px;border-radius:5px;overflow:hidden;border:1px solid rgba(255,255,255,.2980392157);flex-shrink:0;cursor:pointer}._root_1v1it_1:active:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background-color:#0000001a}._chapter_img_1v1it_20{display:block;width:100%;height:100%}._name_1v1it_26{position:absolute;left:5px;right:5px;top:10px;text-align:center;color:#fff;font-weight:500;font-size:14px}._time_1v1it_37{position:absolute;left:5px;bottom:5px;color:#fff;font-size:12px}`)),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
(function(ni,de){typeof exports=="object"&&typeof module<"u"?de(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],de):(ni=typeof globalThis<"u"?globalThis:ni||self,de(ni.SquadxClient={},ni.React))})(this,function(ni,de){"use strict";var FR=Object.defineProperty;var NR=(ni,de,Vr)=>de in ni?FR(ni,de,{enumerable:!0,configurable:!0,writable:!0,value:Vr}):ni[de]=Vr;var ta=(ni,de,Vr)=>(NR(ni,typeof de!="symbol"?de+"":de,Vr),Vr);var Vr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function K0(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function jr(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var s=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return r[i]}})}),t}var Ro={exports:{}},fs={};/*
|
|
3
|
-
object-assign
|
|
4
|
-
(c) Sindre Sorhus
|
|
5
|
-
@license MIT
|
|
6
|
-
*/var Po,Vu;function ju(){if(Vu)return Po;Vu=1;var r=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function i(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function s(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;for(var a={},o=0;o<10;o++)a["_"+String.fromCharCode(o)]=o;var l=Object.getOwnPropertyNames(a).map(function(h){return a[h]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(h){u[h]=h}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Po=s()?Object.assign:function(n,a){for(var o,l=i(n),u,h=1;h<arguments.length;h++){o=Object(arguments[h]);for(var f in o)e.call(o,f)&&(l[f]=o[f]);if(r){u=r(o);for(var g=0;g<u.length;g++)t.call(o,u[g])&&(l[u[g]]=o[u[g]])}}return l},Po}/** @license React v17.0.2
|
|
7
|
-
* react-jsx-runtime.production.min.js
|
|
8
|
-
*
|
|
9
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
10
|
-
*
|
|
11
|
-
* This source code is licensed under the MIT license found in the
|
|
12
|
-
* LICENSE file in the root directory of this source tree.
|
|
13
|
-
*/var Hu;function z0(){if(Hu)return fs;Hu=1,ju();var r=de,e=60103;if(fs.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var t=Symbol.for;e=t("react.element"),fs.Fragment=t("react.fragment")}var i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,n={key:!0,ref:!0,__self:!0,__source:!0};function a(o,l,u){var h,f={},g=null,v=null;u!==void 0&&(g=""+u),l.key!==void 0&&(g=""+l.key),l.ref!==void 0&&(v=l.ref);for(h in l)s.call(l,h)&&!n.hasOwnProperty(h)&&(f[h]=l[h]);if(o&&o.defaultProps)for(h in l=o.defaultProps,l)f[h]===void 0&&(f[h]=l[h]);return{$$typeof:e,type:o,key:g,ref:v,props:f,_owner:i.current}}return fs.jsx=a,fs.jsxs=a,fs}var ko={},Ku;function W0(){return Ku||(Ku=1,function(r){var e={};/** @license React v17.0.2
|
|
14
|
-
* react-jsx-runtime.development.js
|
|
15
|
-
*
|
|
16
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
17
|
-
*
|
|
18
|
-
* This source code is licensed under the MIT license found in the
|
|
19
|
-
* LICENSE file in the root directory of this source tree.
|
|
20
|
-
*/e.NODE_ENV!=="production"&&function(){var t=de,i=ju(),s=60103,n=60106;r.Fragment=60107;var a=60108,o=60114,l=60109,u=60110,h=60112,f=60113,g=60120,v=60115,y=60116,b=60121,E=60122,A=60117,M=60129,D=60131;if(typeof Symbol=="function"&&Symbol.for){var B=Symbol.for;s=B("react.element"),n=B("react.portal"),r.Fragment=B("react.fragment"),a=B("react.strict_mode"),o=B("react.profiler"),l=B("react.provider"),u=B("react.context"),h=B("react.forward_ref"),f=B("react.suspense"),g=B("react.suspense_list"),v=B("react.memo"),y=B("react.lazy"),b=B("react.block"),E=B("react.server.block"),A=B("react.fundamental"),B("react.scope"),B("react.opaque.id"),M=B("react.debug_trace_mode"),B("react.offscreen"),D=B("react.legacy_hidden")}var N=typeof Symbol=="function"&&Symbol.iterator,J="@@iterator";function Z(z){if(z===null||typeof z!="object")return null;var be=N&&z[N]||z[J];return typeof be=="function"?be:null}var se=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Q(z){{for(var be=arguments.length,Te=new Array(be>1?be-1:0),Ge=1;Ge<be;Ge++)Te[Ge-1]=arguments[Ge];q("error",z,Te)}}function q(z,be,Te){{var Ge=se.ReactDebugCurrentFrame,Fe=Ge.getStackAddendum();Fe!==""&&(be+="%s",Te=Te.concat([Fe]));var dt=Te.map(function(tt){return""+tt});dt.unshift("Warning: "+be),Function.prototype.apply.call(console[z],console,dt)}}var oe=!1;function me(z){return!!(typeof z=="string"||typeof z=="function"||z===r.Fragment||z===o||z===M||z===a||z===f||z===g||z===D||oe||typeof z=="object"&&z!==null&&(z.$$typeof===y||z.$$typeof===v||z.$$typeof===l||z.$$typeof===u||z.$$typeof===h||z.$$typeof===A||z.$$typeof===b||z[0]===E))}function he(z,be,Te){var Ge=be.displayName||be.name||"";return z.displayName||(Ge!==""?Te+"("+Ge+")":Te)}function Ee(z){return z.displayName||"Context"}function we(z){if(z==null)return null;if(typeof z.tag=="number"&&Q("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),typeof z=="function")return z.displayName||z.name||null;if(typeof z=="string")return z;switch(z){case r.Fragment:return"Fragment";case n:return"Portal";case o:return"Profiler";case a:return"StrictMode";case f:return"Suspense";case g:return"SuspenseList"}if(typeof z=="object")switch(z.$$typeof){case u:var be=z;return Ee(be)+".Consumer";case l:var Te=z;return Ee(Te._context)+".Provider";case h:return he(z,z.render,"ForwardRef");case v:return we(z.type);case b:return we(z._render);case y:{var Ge=z,Fe=Ge._payload,dt=Ge._init;try{return we(dt(Fe))}catch{return null}}}return null}var ue=0,ge,Ce,ve,Se,qe,Ue,Xe;function it(){}it.__reactDisabledLog=!0;function et(){{if(ue===0){ge=console.log,Ce=console.info,ve=console.warn,Se=console.error,qe=console.group,Ue=console.groupCollapsed,Xe=console.groupEnd;var z={configurable:!0,enumerable:!0,value:it,writable:!0};Object.defineProperties(console,{info:z,log:z,warn:z,error:z,group:z,groupCollapsed:z,groupEnd:z})}ue++}}function lt(){{if(ue--,ue===0){var z={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:i({},z,{value:ge}),info:i({},z,{value:Ce}),warn:i({},z,{value:ve}),error:i({},z,{value:Se}),group:i({},z,{value:qe}),groupCollapsed:i({},z,{value:Ue}),groupEnd:i({},z,{value:Xe})})}ue<0&&Q("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Je=se.ReactCurrentDispatcher,xt;function kt(z,be,Te){{if(xt===void 0)try{throw Error()}catch(Fe){var Ge=Fe.stack.trim().match(/\n( *(at )?)/);xt=Ge&&Ge[1]||""}return`
|
|
21
|
-
`+xt+z}}var Ci=!1,ke;{var yi=typeof WeakMap=="function"?WeakMap:Map;ke=new yi}function di(z,be){if(!z||Ci)return"";{var Te=ke.get(z);if(Te!==void 0)return Te}var Ge;Ci=!0;var Fe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var dt;dt=Je.current,Je.current=null,et();try{if(be){var tt=function(){throw Error()};if(Object.defineProperty(tt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(tt,[])}catch(ki){Ge=ki}Reflect.construct(z,[],tt)}else{try{tt.call()}catch(ki){Ge=ki}z.call(tt.prototype)}}else{try{throw Error()}catch(ki){Ge=ki}z()}}catch(ki){if(ki&&Ge&&typeof ki.stack=="string"){for(var Ze=ki.stack.split(`
|
|
22
|
-
`),jt=Ge.stack.split(`
|
|
23
|
-
`),wt=Ze.length-1,At=jt.length-1;wt>=1&&At>=0&&Ze[wt]!==jt[At];)At--;for(;wt>=1&&At>=0;wt--,At--)if(Ze[wt]!==jt[At]){if(wt!==1||At!==1)do if(wt--,At--,At<0||Ze[wt]!==jt[At]){var Pi=`
|
|
24
|
-
`+Ze[wt].replace(" at new "," at ");return typeof z=="function"&&ke.set(z,Pi),Pi}while(wt>=1&&At>=0);break}}}finally{Ci=!1,Je.current=dt,lt(),Error.prepareStackTrace=Fe}var Pr=z?z.displayName||z.name:"",bo=Pr?kt(Pr):"";return typeof z=="function"&&ke.set(z,bo),bo}function ss(z,be,Te){return di(z,!1)}function ns(z){var be=z.prototype;return!!(be&&be.isReactComponent)}function cr(z,be,Te){if(z==null)return"";if(typeof z=="function")return di(z,ns(z));if(typeof z=="string")return kt(z);switch(z){case f:return kt("Suspense");case g:return kt("SuspenseList")}if(typeof z=="object")switch(z.$$typeof){case h:return ss(z.render);case v:return cr(z.type,be,Te);case b:return ss(z._render);case y:{var Ge=z,Fe=Ge._payload,dt=Ge._init;try{return cr(dt(Fe),be,Te)}catch{}}}return""}var as={},Li=se.ReactDebugCurrentFrame;function ur(z){if(z){var be=z._owner,Te=cr(z.type,z._source,be?be.type:null);Li.setExtraStackFrame(Te)}else Li.setExtraStackFrame(null)}function Ir(z,be,Te,Ge,Fe){{var dt=Function.call.bind(Object.prototype.hasOwnProperty);for(var tt in z)if(dt(z,tt)){var Ze=void 0;try{if(typeof z[tt]!="function"){var jt=Error((Ge||"React class")+": "+Te+" type `"+tt+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof z[tt]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw jt.name="Invariant Violation",jt}Ze=z[tt](be,tt,Ge,Te,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(wt){Ze=wt}Ze&&!(Ze instanceof Error)&&(ur(Fe),Q("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Ge||"React class",Te,tt,typeof Ze),ur(null)),Ze instanceof Error&&!(Ze.message in as)&&(as[Ze.message]=!0,ur(Fe),Q("Failed %s type: %s",Te,Ze.message),ur(null))}}}var Qi=se.ReactCurrentOwner,Ii=Object.prototype.hasOwnProperty,Me={key:!0,ref:!0,__self:!0,__source:!0},Et,Ji,Bs;Bs={};function $s(z){if(Ii.call(z,"ref")){var be=Object.getOwnPropertyDescriptor(z,"ref").get;if(be&&be.isReactWarning)return!1}return z.ref!==void 0}function go(z){if(Ii.call(z,"key")){var be=Object.getOwnPropertyDescriptor(z,"key").get;if(be&&be.isReactWarning)return!1}return z.key!==void 0}function mo(z,be){if(typeof z.ref=="string"&&Qi.current&&be&&Qi.current.stateNode!==be){var Te=we(Qi.current.type);Bs[Te]||(Q('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',we(Qi.current.type),z.ref),Bs[Te]=!0)}}function Lu(z,be){{var Te=function(){Et||(Et=!0,Q("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",be))};Te.isReactWarning=!0,Object.defineProperty(z,"key",{get:Te,configurable:!0})}}function Si(z,be){{var Te=function(){Ji||(Ji=!0,Q("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",be))};Te.isReactWarning=!0,Object.defineProperty(z,"ref",{get:Te,configurable:!0})}}var hr=function(z,be,Te,Ge,Fe,dt,tt){var Ze={$$typeof:s,type:z,key:be,ref:Te,props:tt,_owner:dt};return Ze._store={},Object.defineProperty(Ze._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Ze,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Ge}),Object.defineProperty(Ze,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Fe}),Object.freeze&&(Object.freeze(Ze.props),Object.freeze(Ze)),Ze};function vo(z,be,Te,Ge,Fe){{var dt,tt={},Ze=null,jt=null;Te!==void 0&&(Ze=""+Te),go(be)&&(Ze=""+be.key),$s(be)&&(jt=be.ref,mo(be,Fe));for(dt in be)Ii.call(be,dt)&&!Me.hasOwnProperty(dt)&&(tt[dt]=be[dt]);if(z&&z.defaultProps){var wt=z.defaultProps;for(dt in wt)tt[dt]===void 0&&(tt[dt]=wt[dt])}if(Ze||jt){var At=typeof z=="function"?z.displayName||z.name||"Unknown":z;Ze&&Lu(tt,At),jt&&Si(tt,At)}return hr(z,Ze,jt,Fe,Ge,Qi.current,tt)}}var Us=se.ReactCurrentOwner,yo=se.ReactDebugCurrentFrame;function Rr(z){if(z){var be=z._owner,Te=cr(z.type,z._source,be?be.type:null);yo.setExtraStackFrame(Te)}else yo.setExtraStackFrame(null)}var Gs;Gs=!1;function Vs(z){return typeof z=="object"&&z!==null&&z.$$typeof===s}function os(){{if(Us.current){var z=we(Us.current.type);if(z)return`
|
|
25
|
-
|
|
26
|
-
Check the render method of \``+z+"`."}return""}}function js(z){return""}var ls={};function Iu(z){{var be=os();if(!be){var Te=typeof z=="string"?z:z.displayName||z.name;Te&&(be=`
|
|
27
|
-
|
|
28
|
-
Check the top-level render call using <`+Te+">.")}return be}}function So(z,be){{if(!z._store||z._store.validated||z.key!=null)return;z._store.validated=!0;var Te=Iu(be);if(ls[Te])return;ls[Te]=!0;var Ge="";z&&z._owner&&z._owner!==Us.current&&(Ge=" It was passed a child from "+we(z._owner.type)+"."),Rr(z),Q('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Te,Ge),Rr(null)}}function xo(z,be){{if(typeof z!="object")return;if(Array.isArray(z))for(var Te=0;Te<z.length;Te++){var Ge=z[Te];Vs(Ge)&&So(Ge,be)}else if(Vs(z))z._store&&(z._store.validated=!0);else if(z){var Fe=Z(z);if(typeof Fe=="function"&&Fe!==z.entries)for(var dt=Fe.call(z),tt;!(tt=dt.next()).done;)Vs(tt.value)&&So(tt.value,be)}}}function Ru(z){{var be=z.type;if(be==null||typeof be=="string")return;var Te;if(typeof be=="function")Te=be.propTypes;else if(typeof be=="object"&&(be.$$typeof===h||be.$$typeof===v))Te=be.propTypes;else return;if(Te){var Ge=we(be);Ir(Te,z.props,"prop",Ge,z)}else if(be.PropTypes!==void 0&&!Gs){Gs=!0;var Fe=we(be);Q("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Fe||"Unknown")}typeof be.getDefaultProps=="function"&&!be.getDefaultProps.isReactClassApproved&&Q("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function _e(z){{for(var be=Object.keys(z.props),Te=0;Te<be.length;Te++){var Ge=be[Te];if(Ge!=="children"&&Ge!=="key"){Rr(z),Q("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Ge),Rr(null);break}}z.ref!==null&&(Rr(z),Q("Invalid attribute `ref` supplied to `React.Fragment`."),Rr(null))}}function It(z,be,Te,Ge,Fe,dt){{var tt=me(z);if(!tt){var Ze="";(z===void 0||typeof z=="object"&&z!==null&&Object.keys(z).length===0)&&(Ze+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var jt=js();jt?Ze+=jt:Ze+=os();var wt;z===null?wt="null":Array.isArray(z)?wt="array":z!==void 0&&z.$$typeof===s?(wt="<"+(we(z.type)||"Unknown")+" />",Ze=" Did you accidentally export a JSX literal instead of a component?"):wt=typeof z,Q("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",wt,Ze)}var At=vo(z,be,Te,Fe,dt);if(At==null)return At;if(tt){var Pi=be.children;if(Pi!==void 0)if(Ge)if(Array.isArray(Pi)){for(var Pr=0;Pr<Pi.length;Pr++)xo(Pi[Pr],z);Object.freeze&&Object.freeze(Pi)}else Q("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else xo(Pi,z)}return z===r.Fragment?_e(At):Ru(At),At}}function dr(z,be,Te){return It(z,be,Te,!0)}function Ri(z,be,Te){return It(z,be,Te,!1)}var Bt=Ri,Vn=dr;r.jsx=Bt,r.jsxs=Vn}()}(ko)),ko}var q0={};q0.NODE_ENV==="production"?Ro.exports=z0():Ro.exports=W0();var We=Ro.exports;const Hr={root:"_root_1e6x7_1",progress:"_progress_1e6x7_8",pop:"_pop_1e6x7_1",play_button:"_play_button_1e6x7_25",pause_button:"_pause_button_1e6x7_26",play_icon:"_play_icon_1e6x7_38",mute_button:"_mute_button_1e6x7_46"},zu=r=>{let e=r.httpHandler;return{setHttpHandler(t){e=t},httpHandler(){return e},updateHttpClientConfig(t,i){e.updateHttpClientConfig(t,i)},httpHandlerConfigs(){return e.httpHandlerConfigs()}}},Wu=r=>({httpHandler:r.httpHandler()});var qu;(function(r){r.HEADER="header",r.QUERY="query"})(qu||(qu={}));var Yu;(function(r){r.HEADER="header",r.QUERY="query"})(Yu||(Yu={}));var Xs;(function(r){r.HTTP="http",r.HTTPS="https"})(Xs||(Xs={}));var ia;(function(r){r.MD5="md5",r.CRC32="crc32",r.CRC32C="crc32c",r.SHA1="sha1",r.SHA256="sha256"})(ia||(ia={}));var Xu;(function(r){r[r.HEADER=0]="HEADER",r[r.TRAILER=1]="TRAILER"})(Xu||(Xu={}));const Do="__smithy_context";var Qu;(function(r){r.PROFILE="profile",r.SSO_SESSION="sso-session",r.SERVICES="services"})(Qu||(Qu={}));var Ju;(function(r){r.HTTP_0_9="http/0.9",r.HTTP_1_0="http/1.0",r.TDS_8_0="tds/8.0"})(Ju||(Ju={}));class Ei{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static isInstance(e){if(!e)return!1;const t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&typeof t.query=="object"&&typeof t.headers=="object"}clone(){const e=new Ei({...this,headers:{...this.headers}});return e.query&&(e.query=Y0(e.query)),e}}function Y0(r){return Object.keys(r).reduce((e,t)=>{const i=r[t];return{...e,[t]:Array.isArray(i)?[...i]:i}},{})}class ra{constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const t=e;return typeof t.statusCode=="number"&&typeof t.headers=="object"}}function KR(r){return r}const X0=r=>e=>async t=>{if(!Ei.isInstance(t.request))return e(t);const{request:i}=t,{handlerProtocol:s=""}=r.requestHandler.metadata||{};if(s.indexOf("h2")>=0&&!i.headers[":authority"])delete i.headers.host,i.headers[":authority"]=i.hostname+(i.port?":"+i.port:"");else if(!i.headers.host){let n=i.hostname;i.port!=null&&(n+=`:${i.port}`),i.headers.host=n}return e(t)},Q0={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},Zu=r=>({applyToStack:e=>{e.add(X0(r),Q0)}}),J0=()=>(r,e)=>async t=>{var i,s;try{const n=await r(t),{clientName:a,commandName:o,logger:l,dynamoDbDocumentClientOptions:u={}}=e,{overrideInputFilterSensitiveLog:h,overrideOutputFilterSensitiveLog:f}=u,g=h??e.inputFilterSensitiveLog,v=f??e.outputFilterSensitiveLog,{$metadata:y,...b}=n.output;return(i=l==null?void 0:l.info)==null||i.call(l,{clientName:a,commandName:o,input:g(t.input),output:v(b),metadata:y}),n}catch(n){const{clientName:a,commandName:o,logger:l,dynamoDbDocumentClientOptions:u={}}=e,{overrideInputFilterSensitiveLog:h}=u,f=h??e.inputFilterSensitiveLog;throw(s=l==null?void 0:l.error)==null||s.call(l,{clientName:a,commandName:o,input:f(t.input),error:n,metadata:n.$metadata}),n}},Z0={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},eh=r=>({applyToStack:e=>{e.add(J0(),Z0)}});var th={};const ih="X-Amzn-Trace-Id",ev="AWS_LAMBDA_FUNCTION_NAME",tv="_X_AMZN_TRACE_ID",iv=r=>e=>async t=>{const{request:i}=t;if(!Ei.isInstance(i)||r.runtime!=="node"||i.headers.hasOwnProperty(ih))return e(t);const s=th[ev],n=th[tv],a=o=>typeof o=="string"&&o.length>0;return a(s)&&a(n)&&(i.headers[ih]=n),e({...t,request:i})},rv={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},rh=r=>({applyToStack:e=>{e.add(iv(r),rv)}});function sh(r){return{...r,customUserAgent:typeof r.customUserAgent=="string"?[[r.customUserAgent]]:r.customUserAgent}}const sv=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),nh=r=>sv.test(r)||r.startsWith("[")&&r.endsWith("]"),nv=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),Oo=(r,e=!1)=>{if(!e)return nv.test(r);const t=r.split(".");for(const i of t)if(!Oo(i))return!1;return!0},Qs={},Js="endpoints";function xr(r){return typeof r!="object"||r==null?r:"ref"in r?`$${xr(r.ref)}`:"fn"in r?`${r.fn}(${(r.argv||[]).map(xr).join(", ")})`:JSON.stringify(r,null,2)}class ai extends Error{constructor(e){super(e),this.name="EndpointError"}}const av=(r,e)=>r===e,ov=r=>{const e=r.split("."),t=[];for(const i of e){const s=i.indexOf("[");if(s!==-1){if(i.indexOf("]")!==i.length-1)throw new ai(`Path: '${r}' does not end with ']'`);const n=i.slice(s+1,-1);if(Number.isNaN(parseInt(n)))throw new ai(`Invalid array index: '${n}' in path: '${r}'`);s!==0&&t.push(i.slice(0,s)),t.push(n)}else t.push(i)}return t},ah=(r,e)=>ov(e).reduce((t,i)=>{if(typeof t!="object")throw new ai(`Index '${i}' in '${e}' not found in '${JSON.stringify(r)}'`);return Array.isArray(t)?t[parseInt(i)]:t[i]},r),lv=r=>r!=null,cv=r=>!r,Mo={[Xs.HTTP]:80,[Xs.HTTPS]:443},uv={booleanEquals:av,getAttr:ah,isSet:lv,isValidHostLabel:Oo,not:cv,parseURL:r=>{const e=(()=>{try{if(r instanceof URL)return r;if(typeof r=="object"&&"hostname"in r){const{hostname:g,port:v,protocol:y="",path:b="",query:E={}}=r,A=new URL(`${y}//${g}${v?`:${v}`:""}${b}`);return A.search=Object.entries(E).map(([M,D])=>`${M}=${D}`).join("&"),A}return new URL(r)}catch{return null}})();if(!e)return console.error(`Unable to parse ${JSON.stringify(r)} as a whatwg URL.`),null;const t=e.href,{host:i,hostname:s,pathname:n,protocol:a,search:o}=e;if(o)return null;const l=a.slice(0,-1);if(!Object.values(Xs).includes(l))return null;const u=nh(s),h=t.includes(`${i}:${Mo[l]}`)||typeof r=="string"&&r.includes(`${i}:${Mo[l]}`),f=`${i}${h?`:${Mo[l]}`:""}`;return{scheme:l,authority:f,path:n,normalizedPath:n.endsWith("/")?n:`${n}/`,isIp:u}},stringEquals:(r,e)=>r===e,substring:(r,e,t,i)=>e>=t||r.length<t?null:i?r.substring(r.length-t,r.length-e):r.substring(e,t),uriEncode:r=>encodeURIComponent(r).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)},oh=(r,e)=>{const t=[],i={...e.endpointParams,...e.referenceRecord};let s=0;for(;s<r.length;){const n=r.indexOf("{",s);if(n===-1){t.push(r.slice(s));break}t.push(r.slice(s,n));const a=r.indexOf("}",n);if(a===-1){t.push(r.slice(n));break}r[n+1]==="{"&&r[a+1]==="}"&&(t.push(r.slice(n+1,a)),s=a+2);const o=r.substring(n+1,a);if(o.includes("#")){const[l,u]=o.split("#");t.push(ah(i[l],u))}else t.push(i[o]);s=a+1}return t.join("")},hv=({ref:r},e)=>({...e.endpointParams,...e.referenceRecord})[r],sa=(r,e,t)=>{if(typeof r=="string")return oh(r,t);if(r.fn)return lh(r,t);if(r.ref)return hv(r,t);throw new ai(`'${e}': ${String(r)} is not a string, function or reference.`)},lh=({fn:r,argv:e},t)=>{const i=e.map(n=>["boolean","number"].includes(typeof n)?n:sa(n,"arg",t)),s=r.split(".");return s[0]in Qs&&s[1]!=null?Qs[s[0]][s[1]](...i):uv[r](...i)},dv=({assign:r,...e},t)=>{var s,n;if(r&&r in t.referenceRecord)throw new ai(`'${r}' is already defined in Reference Record.`);const i=lh(e,t);return(n=(s=t.logger)==null?void 0:s.debug)==null||n.call(s,`${Js} evaluateCondition: ${xr(e)} = ${xr(i)}`),{result:i===""?!0:!!i,...r!=null&&{toAssign:{name:r,value:i}}}},Fo=(r=[],e)=>{var i,s;const t={};for(const n of r){const{result:a,toAssign:o}=dv(n,{...e,referenceRecord:{...e.referenceRecord,...t}});if(!a)return{result:a};o&&(t[o.name]=o.value,(s=(i=e.logger)==null?void 0:i.debug)==null||s.call(i,`${Js} assign: ${o.name} := ${xr(o.value)}`))}return{result:!0,referenceRecord:t}},fv=(r,e)=>Object.entries(r).reduce((t,[i,s])=>({...t,[i]:s.map(n=>{const a=sa(n,"Header value entry",e);if(typeof a!="string")throw new ai(`Header '${i}' value '${a}' is not a string`);return a})}),{}),ch=(r,e)=>{if(Array.isArray(r))return r.map(t=>ch(t,e));switch(typeof r){case"string":return oh(r,e);case"object":if(r===null)throw new ai(`Unexpected endpoint property: ${r}`);return uh(r,e);case"boolean":return r;default:throw new ai(`Unexpected endpoint property type: ${typeof r}`)}},uh=(r,e)=>Object.entries(r).reduce((t,[i,s])=>({...t,[i]:ch(s,e)}),{}),pv=(r,e)=>{const t=sa(r,"Endpoint URL",e);if(typeof t=="string")try{return new URL(t)}catch(i){throw console.error(`Failed to construct URL with ${t}`,i),i}throw new ai(`Endpoint URL must be a string, got ${typeof t}`)},gv=(r,e)=>{var h,f;const{conditions:t,endpoint:i}=r,{result:s,referenceRecord:n}=Fo(t,e);if(!s)return;const a={...e,referenceRecord:{...e.referenceRecord,...n}},{url:o,properties:l,headers:u}=i;return(f=(h=e.logger)==null?void 0:h.debug)==null||f.call(h,`${Js} Resolving endpoint from template: ${xr(i)}`),{...u!=null&&{headers:fv(u,a)},...l!=null&&{properties:uh(l,a)},url:pv(o,a)}},mv=(r,e)=>{const{conditions:t,error:i}=r,{result:s,referenceRecord:n}=Fo(t,e);if(s)throw new ai(sa(i,"Error",{...e,referenceRecord:{...e.referenceRecord,...n}}))},vv=(r,e)=>{const{conditions:t,rules:i}=r,{result:s,referenceRecord:n}=Fo(t,e);if(s)return hh(i,{...e,referenceRecord:{...e.referenceRecord,...n}})},hh=(r,e)=>{for(const t of r)if(t.type==="endpoint"){const i=gv(t,e);if(i)return i}else if(t.type==="error")mv(t,e);else if(t.type==="tree"){const i=vv(t,e);if(i)return i}else throw new ai(`Unknown endpoint rule: ${t}`);throw new ai("Rules evaluation failed")},dh=(r,e)=>{var u,h,f,g,v;const{endpointParams:t,logger:i}=e,{parameters:s,rules:n}=r;(h=(u=e.logger)==null?void 0:u.debug)==null||h.call(u,`${Js} Initial EndpointParams: ${xr(t)}`);const a=Object.entries(s).filter(([,y])=>y.default!=null).map(([y,b])=>[y,b.default]);if(a.length>0)for(const[y,b]of a)t[y]=t[y]??b;const o=Object.entries(s).filter(([,y])=>y.required).map(([y])=>y);for(const y of o)if(t[y]==null)throw new ai(`Missing required parameter: '${y}'`);const l=hh(n,{endpointParams:t,logger:i,referenceRecord:{}});if((f=e.endpointParams)!=null&&f.Endpoint)try{const y=new URL(e.endpointParams.Endpoint),{protocol:b,port:E}=y;l.url.protocol=b,l.url.port=E}catch{}return(v=(g=e.logger)==null?void 0:g.debug)==null||v.call(g,`${Js} Resolved endpoint: ${xr(l)}`),l},fh=(r,e=!1)=>{if(e){for(const t of r.split("."))if(!fh(t))return!1;return!0}return!(!Oo(r)||r.length<3||r.length>63||r!==r.toLowerCase()||nh(r))},yv=r=>{const e=r.split(":");if(e.length<6)return null;const[t,i,s,n,a,...o]=e;return t!=="arn"||i===""||s===""||o[0]===""?null:{partition:i,service:s,region:n,accountId:a,resourceId:o[0].includes("/")?o[0].split("/"):o}};let Sv={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"aws-global":{description:"AWS Standard global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"AWS China global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"AWS GovCloud (US) global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"c2s.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"AWS ISO (US) global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"sc2s.sgov.gov",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"AWS ISOB (US) global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"cloud.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"csp.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{}}],version:"1.1"};const No={isVirtualHostableS3Bucket:fh,parseArn:yv,partition:r=>{const{partitions:e}=Sv;for(const i of e){const{regions:s,outputs:n}=i;for(const[a,o]of Object.entries(s))if(a===r)return{...n,...o}}for(const i of e){const{regionRegex:s,outputs:n}=i;if(new RegExp(s).test(r))return{...n}}const t=e.find(i=>i.id==="aws");if(!t)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...t.outputs}}};Qs.aws=No;const ph="user-agent",Bo="x-amz-user-agent",gh=" ",$o="/",xv=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,bv=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g,mh="-",Ev=r=>(e,t)=>async i=>{var f,g;const{request:s}=i;if(!Ei.isInstance(s))return e(i);const{headers:n}=s,a=((f=t==null?void 0:t.userAgent)==null?void 0:f.map(Uo))||[],o=(await r.defaultUserAgentProvider()).map(Uo),l=((g=r==null?void 0:r.customUserAgent)==null?void 0:g.map(Uo))||[],u=[].concat([...o,...a,...l]).join(gh),h=[...o.filter(v=>v.startsWith("aws-sdk-")),...l].join(gh);return r.runtime!=="browser"?(h&&(n[Bo]=n[Bo]?`${n[ph]} ${h}`:h),n[ph]=u):n[Bo]=u,e({...i,request:s})},Uo=r=>{var a;const e=r[0].split($o).map(o=>o.replace(xv,mh)).join($o),t=(a=r[1])==null?void 0:a.replace(bv,mh),i=e.indexOf($o),s=e.substring(0,i);let n=e.substring(i+1);return s==="api"&&(n=n.toLowerCase()),[s,n,t].filter(o=>o&&o.length>0).reduce((o,l,u)=>{switch(u){case 0:return l;case 1:return`${o}/${l}`;default:return`${o}#${l}`}},"")},wv={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},vh=r=>({applyToStack:e=>{e.add(Ev(r),wv)}});var yh;(function(r){r.ENV="env",r.CONFIG="shared config entry"})(yh||(yh={}));const Sh=!1,xh=!1,Zs=r=>r[Do]||(r[Do]={}),ir=r=>{if(typeof r=="function")return r;const e=Promise.resolve(r);return()=>e},bh=r=>typeof r=="string"&&(r.startsWith("fips-")||r.endsWith("-fips")),Eh=r=>bh(r)?["fips-aws-global","aws-fips"].includes(r)?"us-east-1":r.replace(/fips-(dkr-|prod-)?|-fips/,""):r,wh=r=>{const{region:e,useFipsEndpoint:t}=r;if(!e)throw new Error("Region is missing");return{...r,region:async()=>{if(typeof e=="string")return Eh(e);const i=await e();return Eh(i)},useFipsEndpoint:async()=>{const i=typeof e=="string"?e:await e();return bh(i)?!0:typeof t!="function"?Promise.resolve(!!t):t()}}};function Tv(r){const e=new Map;for(const t of r)e.set(t.schemeId,t);return e}const Av=(r,e)=>(t,i)=>async s=>{var u;const n=r.httpAuthSchemeProvider(await e.httpAuthSchemeParametersProvider(r,i,s.input)),a=Tv(r.httpAuthSchemes),o=Zs(i),l=[];for(const h of n){const f=a.get(h.schemeId);if(!f){l.push(`HttpAuthScheme \`${h.schemeId}\` was not enabled for this service.`);continue}const g=f.identityProvider(await e.identityProviderConfigProvider(r));if(!g){l.push(`HttpAuthScheme \`${h.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:v={},signingProperties:y={}}=((u=h.propertiesExtractor)==null?void 0:u.call(h,r,i))||{};h.identityProperties=Object.assign(h.identityProperties||{},v),h.signingProperties=Object.assign(h.signingProperties||{},y),o.selectedHttpAuthScheme={httpAuthOption:h,identity:await g(h.identityProperties),signer:f.signer};break}if(!o.selectedHttpAuthScheme)throw new Error(l.join(`
|
|
29
|
-
`));return t(s)},_v=async r=>{const e=(r==null?void 0:r.Bucket)||"";if(typeof r.Bucket=="string"&&(r.Bucket=e.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),Pv(e)){if(r.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!Rv(e)||e.indexOf(".")!==-1&&!String(r.Endpoint).startsWith("http:")||e.toLowerCase()!==e||e.length<3)&&(r.ForcePathStyle=!0);return r.DisableMultiRegionAccessPoints&&(r.disableMultiRegionAccessPoints=!0,r.DisableMRAP=!0),r},Cv=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,Lv=/(\d+\.){3}\d+/,Iv=/\.\./,Rv=r=>Cv.test(r)&&!Lv.test(r)&&!Iv.test(r),Pv=r=>{const[e,t,i,,,s]=r.split(":"),n=e==="arn"&&r.split(":").length>=6,a=!!(n&&t&&i&&s);if(n&&!a)throw new Error(`Invalid ARN: ${r} was an invalid ARN.`);return a},kv=(r,e,t)=>{const i=async()=>{const s=t[r]??t[e];return typeof s=="function"?s():s};return r==="credentialScope"||e==="CredentialScope"?async()=>{const s=typeof t.credentials=="function"?await t.credentials():t.credentials;return(s==null?void 0:s.credentialScope)??(s==null?void 0:s.CredentialScope)}:r==="endpoint"||e==="endpoint"?async()=>{const s=await i();if(s&&typeof s=="object"){if("url"in s)return s.url.href;if("hostname"in s){const{protocol:n,hostname:a,port:o,path:l}=s;return`${n}//${a}${o?":"+o:""}${l}`}}return s}:i},Dv=async r=>{};function Ov(r){const e={};if(r=r.replace(/^\?/,""),r)for(const t of r.split("&")){let[i,s=null]=t.split("=");i=decodeURIComponent(i),s&&(s=decodeURIComponent(s)),i in e?Array.isArray(e[i])?e[i].push(s):e[i]=[e[i],s]:e[i]=s}return e}const en=r=>{if(typeof r=="string")return en(new URL(r));const{hostname:e,pathname:t,port:i,protocol:s,search:n}=r;let a;return n&&(a=Ov(n)),{hostname:e,port:i?parseInt(i):void 0,protocol:s,path:t,query:a}},Th=r=>typeof r=="object"?"url"in r?en(r.url):r:en(r),Mv=async(r,e,t,i)=>{if(!t.endpoint){const a=await Dv(t.serviceId||"");a&&(t.endpoint=()=>Promise.resolve(Th(a)))}const s=await Fv(r,e,t);if(typeof t.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");return t.endpointProvider(s,i)},Fv=async(r,e,t)=>{var n;const i={},s=((n=e==null?void 0:e.getEndpointParameterInstructions)==null?void 0:n.call(e))||{};for(const[a,o]of Object.entries(s))switch(o.type){case"staticContextParams":i[a]=o.value;break;case"contextParams":i[a]=r[o.name];break;case"clientContextParams":case"builtInParams":i[a]=await kv(o.name,a,t)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(o))}return Object.keys(s).length===0&&Object.assign(i,t),String(t.serviceId).toLowerCase()==="s3"&&await _v(i),i},Nv=({config:r,instructions:e})=>(t,i)=>async s=>{var o,l,u;const n=await Mv(s.input,{getEndpointParameterInstructions(){return e}},{...r},i);i.endpointV2=n,i.authSchemes=(o=n.properties)==null?void 0:o.authSchemes;const a=(l=i.authSchemes)==null?void 0:l[0];if(a){i.signing_region=a.signingRegion,i.signing_service=a.signingName;const h=Zs(i),f=(u=h==null?void 0:h.selectedHttpAuthScheme)==null?void 0:u.httpAuthOption;f&&(f.signingProperties=Object.assign(f.signingProperties||{},{signing_region:a.signingRegion,signingRegion:a.signingRegion,signing_service:a.signingName,signingName:a.signingName,signingRegionSet:a.signingRegionSet},a.properties))}return t({...s})},Bv=(r,e)=>t=>async i=>{const{response:s}=await t(i);try{const n=await e(s,r);return{response:s,output:n}}catch(n){if(Object.defineProperty(n,"$response",{value:s}),!("$metadata"in n)){const a="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";n.message+=`
|
|
30
|
-
`+a,typeof n.$responseBodyText<"u"&&n.$response&&(n.$response.body=n.$responseBodyText)}throw n}},$v=(r,e)=>(t,i)=>async s=>{var o;const n=(o=i.endpointV2)!=null&&o.url&&r.urlParser?async()=>r.urlParser(i.endpointV2.url):r.endpoint;if(!n)throw new Error("No valid endpoint provider available.");const a=await e(s.input,{...r,endpoint:n});return t({...s,request:a})},Uv={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},Go={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function Vo(r,e,t){return{applyToStack:i=>{i.add(Bv(r,t),Uv),i.add($v(r,e),Go)}}}const Ah={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:Go.name},jo=(r,e)=>({applyToStack:t=>{t.addRelativeTo(Nv({config:r,instructions:e}),Ah)}}),_h=r=>{const e=r.tls??!0,{endpoint:t}=r,i=t!=null?async()=>Th(await ir(t)()):void 0;return{...r,endpoint:i,tls:e,isCustomEndpoint:!!t,useDualstackEndpoint:ir(r.useDualstackEndpoint??!1),useFipsEndpoint:ir(r.useFipsEndpoint??!1)}},Gv={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:Ah.name},Ch=(r,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:t})=>({applyToStack:i=>{i.addRelativeTo(Av(r,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:t}),Gv)}});Go.name;const Vv=r=>e=>{throw e},jv=(r,e)=>{},Hv=r=>(e,t)=>async i=>{if(!Ei.isInstance(i.request))return e(i);const n=Zs(t).selectedHttpAuthScheme;if(!n)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:a={}},identity:o,signer:l}=n,u=await e({...i,request:await l.sign(i.request,o,a)}).catch((l.errorHandler||Vv)(a));return(l.successHandler||jv)(u.response,a),u};var ps;(function(r){r.STANDARD="standard",r.ADAPTIVE="adaptive"})(ps||(ps={}));const tn=3,Lh=ps.STANDARD,Kv=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],zv=["TimeoutError","RequestTimeout","RequestTimeoutException"],Wv=[500,502,503,504],qv=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],Yv=r=>{var e;return(e=r.$metadata)==null?void 0:e.clockSkewCorrected},Ih=r=>{var e,t;return((e=r.$metadata)==null?void 0:e.httpStatusCode)===429||Kv.includes(r.name)||((t=r.$retryable)==null?void 0:t.throttling)==!0},Rh=r=>{var e;return Yv(r)||zv.includes(r.name)||qv.includes((r==null?void 0:r.code)||"")||Wv.includes(((e=r.$metadata)==null?void 0:e.httpStatusCode)||0)},Xv=r=>{var e;if(((e=r.$metadata)==null?void 0:e.httpStatusCode)!==void 0){const t=r.$metadata.httpStatusCode;return 500<=t&&t<=599&&!Rh(r)}return!1};class Qv{constructor(e){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=(e==null?void 0:e.beta)??.7,this.minCapacity=(e==null?void 0:e.minCapacity)??1,this.minFillRate=(e==null?void 0:e.minFillRate)??.5,this.scaleConstant=(e==null?void 0:e.scaleConstant)??.4,this.smooth=(e==null?void 0:e.smooth)??.8;const t=this.getCurrentTimeInSeconds();this.lastThrottleTime=t,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(e){if(this.enabled){if(this.refillTokenBucket(),e>this.currentCapacity){const t=(e-this.currentCapacity)/this.fillRate*1e3;await new Promise(i=>setTimeout(i,t))}this.currentCapacity=this.currentCapacity-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}const t=(e-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+t),this.lastTimestamp=e}updateClientSendingRate(e){let t;if(this.updateMeasuredRate(),Ih(e)){const s=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=s,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(s),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());const i=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(i)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),t=Math.floor(e*2)/2;if(this.requestCount++,t>this.lastTxRateBucket){const i=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(i*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}}const Ho=100,Ph=20*1e3,Jv=500,kh=500,Zv=5,ey=10,ty=1,iy="amz-sdk-invocation-id",ry="amz-sdk-request",sy=()=>{let r=Ho;return{computeNextBackoffDelay:i=>Math.floor(Math.min(Ph,Math.random()*2**i*r)),setDelayBase:i=>{r=i}}},Dh=({retryDelay:r,retryCount:e,retryCost:t})=>({getRetryCount:()=>e,getRetryDelay:()=>Math.min(Ph,r),getRetryCost:()=>t});class Oh{constructor(e){this.maxAttempts=e,this.mode=ps.STANDARD,this.capacity=kh,this.retryBackoffStrategy=sy(),this.maxAttemptsProvider=typeof e=="function"?e:async()=>e}async acquireInitialRetryToken(e){return Dh({retryDelay:Ho,retryCount:0})}async refreshRetryTokenForRetry(e,t){const i=await this.getMaxAttempts();if(this.shouldRetry(e,t,i)){const s=t.errorType;this.retryBackoffStrategy.setDelayBase(s==="THROTTLING"?Jv:Ho);const n=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()),a=t.retryAfterHint?Math.max(t.retryAfterHint.getTime()-Date.now()||0,n):n,o=this.getCapacityCost(s);return this.capacity-=o,Dh({retryDelay:a,retryCount:e.getRetryCount()+1,retryCost:o})}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.max(kh,this.capacity+(e.getRetryCost()??ty))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${tn}`),tn}}shouldRetry(e,t,i){return e.getRetryCount()+1<i&&this.capacity>=this.getCapacityCost(t.errorType)&&this.isRetryableError(t.errorType)}getCapacityCost(e){return e==="TRANSIENT"?ey:Zv}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}}class ny{constructor(e,t){this.maxAttemptsProvider=e,this.mode=ps.ADAPTIVE;const{rateLimiter:i}=t??{};this.rateLimiter=i??new Qv,this.standardRetryStrategy=new Oh(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,t){return this.rateLimiter.updateClientSendingRate(t),this.standardRetryStrategy.refreshRetryTokenForRetry(e,t)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}}let na;const ay=new Uint8Array(16);function oy(){if(!na&&(na=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!na))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return na(ay)}const Ut=[];for(let r=0;r<256;++r)Ut.push((r+256).toString(16).slice(1));function ly(r,e=0){return Ut[r[e+0]]+Ut[r[e+1]]+Ut[r[e+2]]+Ut[r[e+3]]+"-"+Ut[r[e+4]]+Ut[r[e+5]]+"-"+Ut[r[e+6]]+Ut[r[e+7]]+"-"+Ut[r[e+8]]+Ut[r[e+9]]+"-"+Ut[r[e+10]]+Ut[r[e+11]]+Ut[r[e+12]]+Ut[r[e+13]]+Ut[r[e+14]]+Ut[r[e+15]]}const Mh={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function cy(r,e,t){if(Mh.randomUUID&&!e&&!r)return Mh.randomUUID();r=r||{};const i=r.random||(r.rng||oy)();return i[6]=i[6]&15|64,i[8]=i[8]&63|128,ly(i)}const uy=r=>r instanceof Error?r:r instanceof Object?Object.assign(new Error,r):typeof r=="string"?new Error(r):new Error(`AWS SDK error wrapper for ${r}`),Fh=r=>{const{retryStrategy:e}=r,t=ir(r.maxAttempts??tn);return{...r,maxAttempts:t,retryStrategy:async()=>e||(await ir(r.retryMode)()===ps.ADAPTIVE?new ny(t):new Oh(t))}};class Ko{trace(){}debug(){}info(){}warn(){}error(){}}const Kr=(r,e)=>{const t=[];if(r&&t.push(r),e)for(const i of e)t.push(i);return t},br=(r,e)=>`${r||"anonymous"}${e&&e.length>0?` (a.k.a. ${e.join(",")})`:""}`,aa=()=>{let r=[],e=[],t=!1;const i=new Set,s=f=>f.sort((g,v)=>Nh[v.step]-Nh[g.step]||Bh[v.priority||"normal"]-Bh[g.priority||"normal"]),n=f=>{let g=!1;const v=y=>{const b=Kr(y.name,y.aliases);if(b.includes(f)){g=!0;for(const E of b)i.delete(E);return!1}return!0};return r=r.filter(v),e=e.filter(v),g},a=f=>{let g=!1;const v=y=>{if(y.middleware===f){g=!0;for(const b of Kr(y.name,y.aliases))i.delete(b);return!1}return!0};return r=r.filter(v),e=e.filter(v),g},o=f=>{var g;return r.forEach(v=>{f.add(v.middleware,{...v})}),e.forEach(v=>{f.addRelativeTo(v.middleware,{...v})}),(g=f.identifyOnResolve)==null||g.call(f,h.identifyOnResolve()),f},l=f=>{const g=[];return f.before.forEach(v=>{v.before.length===0&&v.after.length===0?g.push(v):g.push(...l(v))}),g.push(f),f.after.reverse().forEach(v=>{v.before.length===0&&v.after.length===0?g.push(v):g.push(...l(v))}),g},u=(f=!1)=>{const g=[],v=[],y={};return r.forEach(E=>{const A={...E,before:[],after:[]};for(const M of Kr(A.name,A.aliases))y[M]=A;g.push(A)}),e.forEach(E=>{const A={...E,before:[],after:[]};for(const M of Kr(A.name,A.aliases))y[M]=A;v.push(A)}),v.forEach(E=>{if(E.toMiddleware){const A=y[E.toMiddleware];if(A===void 0){if(f)return;throw new Error(`${E.toMiddleware} is not found when adding ${br(E.name,E.aliases)} middleware ${E.relation} ${E.toMiddleware}`)}E.relation==="after"&&A.after.push(E),E.relation==="before"&&A.before.push(E)}}),s(g).map(l).reduce((E,A)=>(E.push(...A),E),[])},h={add:(f,g={})=>{const{name:v,override:y,aliases:b}=g,E={step:"initialize",priority:"normal",middleware:f,...g},A=Kr(v,b);if(A.length>0){if(A.some(M=>i.has(M))){if(!y)throw new Error(`Duplicate middleware name '${br(v,b)}'`);for(const M of A){const D=r.findIndex(N=>{var J;return N.name===M||((J=N.aliases)==null?void 0:J.some(Z=>Z===M))});if(D===-1)continue;const B=r[D];if(B.step!==E.step||E.priority!==B.priority)throw new Error(`"${br(B.name,B.aliases)}" middleware with ${B.priority} priority in ${B.step} step cannot be overridden by "${br(v,b)}" middleware with ${E.priority} priority in ${E.step} step.`);r.splice(D,1)}}for(const M of A)i.add(M)}r.push(E)},addRelativeTo:(f,g)=>{const{name:v,override:y,aliases:b}=g,E={middleware:f,...g},A=Kr(v,b);if(A.length>0){if(A.some(M=>i.has(M))){if(!y)throw new Error(`Duplicate middleware name '${br(v,b)}'`);for(const M of A){const D=e.findIndex(N=>{var J;return N.name===M||((J=N.aliases)==null?void 0:J.some(Z=>Z===M))});if(D===-1)continue;const B=e[D];if(B.toMiddleware!==E.toMiddleware||B.relation!==E.relation)throw new Error(`"${br(B.name,B.aliases)}" middleware ${B.relation} "${B.toMiddleware}" middleware cannot be overridden by "${br(v,b)}" middleware ${E.relation} "${E.toMiddleware}" middleware.`);e.splice(D,1)}}for(const M of A)i.add(M)}e.push(E)},clone:()=>o(aa()),use:f=>{f.applyToStack(h)},remove:f=>typeof f=="string"?n(f):a(f),removeByTag:f=>{let g=!1;const v=y=>{const{tags:b,name:E,aliases:A}=y;if(b&&b.includes(f)){const M=Kr(E,A);for(const D of M)i.delete(D);return g=!0,!1}return!0};return r=r.filter(v),e=e.filter(v),g},concat:f=>{var v;const g=o(aa());return g.use(f),g.identifyOnResolve(t||g.identifyOnResolve()||(((v=f.identifyOnResolve)==null?void 0:v.call(f))??!1)),g},applyToStack:o,identify:()=>u(!0).map(f=>{const g=f.step??f.relation+" "+f.toMiddleware;return br(f.name,f.aliases)+" - "+g}),identifyOnResolve(f){return typeof f=="boolean"&&(t=f),t},resolve:(f,g)=>{for(const v of u().map(y=>y.middleware).reverse())f=v(f,g);return t&&console.log(h.identify()),f}};return h},Nh={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Bh={high:3,normal:2,low:1};class $h{constructor(e){this.middlewareStack=aa(),this.config=e}send(e,t,i){const s=typeof t!="function"?t:void 0,n=typeof t=="function"?t:i,a=e.resolveMiddleware(this.middlewareStack,this.config,s);if(n)a(e).then(o=>n(null,o.output),o=>n(o)).catch(()=>{});else return a(e).then(o=>o.output)}destroy(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()}}const Er={},gs=new Array(64);for(let r=0,e=65,t=90;r+e<=t;r++){const i=String.fromCharCode(r+e);Er[i]=r,gs[r]=i}for(let r=0,e=97,t=122;r+e<=t;r++){const i=String.fromCharCode(r+e),s=r+26;Er[i]=s,gs[s]=i}for(let r=0;r<10;r++){Er[r.toString(10)]=r+52;const e=r.toString(10),t=r+52;Er[e]=t,gs[t]=e}Er["+"]=62,gs[62]="+",Er["/"]=63,gs[63]="/";const ms=6,rn=8,hy=63,oa=r=>{let e=r.length/4*3;r.slice(-2)==="=="?e-=2:r.slice(-1)==="="&&e--;const t=new ArrayBuffer(e),i=new DataView(t);for(let s=0;s<r.length;s+=4){let n=0,a=0;for(let u=s,h=s+3;u<=h;u++)if(r[u]!=="="){if(!(r[u]in Er))throw new TypeError(`Invalid character ${r[u]} in base64 string.`);n|=Er[r[u]]<<(h-u)*ms,a+=ms}else n>>=ms;const o=s/4*3;n>>=a%rn;const l=Math.floor(a/rn);for(let u=0;u<l;u++){const h=(l-u-1)*rn;i.setUint8(o+u,(n&255<<h)>>h)}}return new Uint8Array(t)},zr=r=>new TextEncoder().encode(r),sn=r=>typeof r=="string"?zr(r):ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(r),zo=r=>{if(typeof r=="string")return r;if(typeof r!="object"||typeof r.byteOffset!="number"||typeof r.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(r)};function Wo(r){let e;typeof r=="string"?e=zr(r):e=r;const t=typeof e=="object"&&typeof e.length=="number",i=typeof e=="object"&&typeof e.byteOffset=="number"&&typeof e.byteLength=="number";if(!t&&!i)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let s="";for(let n=0;n<e.length;n+=3){let a=0,o=0;for(let u=n,h=Math.min(n+3,e.length);u<h;u++)a|=e[u]<<(h-u-1)*rn,o+=rn;const l=Math.ceil(o/ms);a<<=l*ms-o;for(let u=1;u<=l;u++){const h=(l-u)*ms;s+=gs[(a&hy<<h)>>h]}s+="==".slice(0,4-l)}return s}function dy(r,e="utf-8"){return e==="base64"?Wo(r):zo(r)}function fy(r,e){return e==="base64"?Wr.mutate(oa(r)):Wr.mutate(zr(r))}class Wr extends Uint8Array{static fromString(e,t="utf-8"){switch(typeof e){case"string":return fy(e,t);default:throw new Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`)}}static mutate(e){return Object.setPrototypeOf(e,Wr.prototype),e}transformToString(e="utf-8"){return dy(this,e)}}const wr=r=>encodeURIComponent(r).replace(/[!'()*]/g,py),py=r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`;function gy(r){const e=[];for(let t of Object.keys(r).sort()){const i=r[t];if(t=wr(t),Array.isArray(i))for(let s=0,n=i.length;s<n;s++)e.push(`${t}=${wr(i[s])}`);else{let s=t;(i||typeof i=="string")&&(s+=`=${wr(i)}`),e.push(s)}}return e.join("&")}function my(r=0){return new Promise((e,t)=>{r&&setTimeout(()=>{const i=new Error(`Request did not complete within ${r} ms`);i.name="TimeoutError",t(i)},r)})}const vy={supported:typeof Request<"u"&&"keepalive"in new Request("https://[::1]")};class la{static create(e){return typeof(e==null?void 0:e.handle)=="function"?e:new la(e)}constructor(e){typeof e=="function"?this.configProvider=e().then(t=>t||{}):(this.config=e??{},this.configProvider=Promise.resolve(this.config))}destroy(){}async handle(e,{abortSignal:t}={}){this.config||(this.config=await this.configProvider);const i=this.config.requestTimeout,s=this.config.keepAlive===!0;if(t!=null&&t.aborted){const b=new Error("Request aborted");return b.name="AbortError",Promise.reject(b)}let n=e.path;const a=gy(e.query||{});a&&(n+=`?${a}`),e.fragment&&(n+=`#${e.fragment}`);let o="";if(e.username!=null||e.password!=null){const b=e.username??"",E=e.password??"";o=`${b}:${E}@`}const{port:l,method:u}=e,h=`${e.protocol}//${o}${e.hostname}${l?`:${l}`:""}${n}`,f=u==="GET"||u==="HEAD"?void 0:e.body,g={body:f,headers:new Headers(e.headers),method:u};f&&(g.duplex="half"),typeof AbortController<"u"&&(g.signal=t),vy.supported&&(g.keepalive=s);const v=new Request(h,g),y=[fetch(v).then(b=>{const E=b.headers,A={};for(const D of E.entries())A[D[0]]=D[1];return b.body!=null?{response:new ra({headers:A,reason:b.statusText,statusCode:b.status,body:b.body})}:b.blob().then(D=>({response:new ra({headers:A,reason:b.statusText,statusCode:b.status,body:D})}))}),my(i)];return t&&y.push(new Promise((b,E)=>{t.onabort=()=>{const A=new Error("Request aborted");A.name="AbortError",E(A)}})),Promise.race(y)}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then(i=>(i[e]=t,i))}httpHandlerConfigs(){return this.config??{}}}const Uh=r=>typeof Blob=="function"&&r instanceof Blob?yy(r):Sy(r);async function yy(r){const e=await xy(r),t=oa(e);return new Uint8Array(t)}async function Sy(r){const e=[],t=r.getReader();let i=!1,s=0;for(;!i;){const{done:o,value:l}=await t.read();l&&(e.push(l),s+=l.length),i=o}const n=new Uint8Array(s);let a=0;for(const o of e)n.set(o,a),a+=o.length;return n}function xy(r){return new Promise((e,t)=>{const i=new FileReader;i.onloadend=()=>{if(i.readyState!==2)return t(new Error("Reader aborted too early"));const s=i.result??"",n=s.indexOf(","),a=n>-1?n+1:s.length;e(s.substring(a))},i.onabort=()=>t(new Error("Read aborted")),i.onerror=()=>t(i.error),i.readAsDataURL(r)})}const Gh={},qo={};for(let r=0;r<256;r++){let e=r.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),Gh[r]=e,qo[e]=r}function Vh(r){if(r.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const e=new Uint8Array(r.length/2);for(let t=0;t<r.length;t+=2){const i=r.slice(t,t+2).toLowerCase();if(i in qo)e[t/2]=qo[i];else throw new Error(`Cannot decode unrecognized sequence ${i} as hexadecimal`)}return e}function oi(r){let e="";for(let t=0;t<r.byteLength;t++)e+=Gh[r[t]];return e}const by=async(r=new Uint8Array,e)=>{if(r instanceof Uint8Array)return Wr.mutate(r);if(!r)return Wr.mutate(new Uint8Array);const t=e.streamCollector(r);return Wr.mutate(await t)};class ca{constructor(){this.middlewareStack=aa()}static classBuilder(){return new Ey}resolveMiddlewareWithContext(e,t,i,{middlewareFn:s,clientName:n,commandName:a,inputFilterSensitiveLog:o,outputFilterSensitiveLog:l,smithyContext:u,additionalContext:h,CommandCtor:f}){for(const E of s.bind(this)(f,e,t,i))this.middlewareStack.use(E);const g=e.concat(this.middlewareStack),{logger:v}=t,y={logger:v,clientName:n,commandName:a,inputFilterSensitiveLog:o,outputFilterSensitiveLog:l,[Do]:{...u},...h},{requestHandler:b}=t;return g.resolve(E=>b.handle(E.request,i||{}),y)}}class Ey{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=e=>e,this._outputFilterSensitiveLog=e=>e,this._serializer=null,this._deserializer=null}init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,t,i={}){return this._smithyContext={service:e,operation:t,...i},this}c(e={}){return this._additionalContext=e,this}n(e,t){return this._clientName=e,this._commandName=t,this}f(e=i=>i,t=i=>i){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=t,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}build(){const e=this;let t;return t=class extends ca{static getEndpointParameterInstructions(){return e._ep}constructor(...[i]){super(),this.serialize=e._serializer,this.deserialize=e._deserializer,this.input=i??{},e._init(this)}resolveMiddleware(i,s,n){return this.resolveMiddlewareWithContext(i,s,n,{CommandCtor:t,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog,outputFilterSensitiveLog:e._outputFilterSensitiveLog,smithyContext:e._smithyContext,additionalContext:e._additionalContext})}}}}const Yo=r=>{if(r!=null){if(typeof r=="string"){const e=parseFloat(r);if(!Number.isNaN(e))return String(e)!==String(r)&&Hh.warn(jh(`Expected number but observed string: ${r}`)),e}if(typeof r=="number")return r;throw new TypeError(`Expected number, got ${typeof r}: ${r}`)}},wy=(r,e)=>{if(r==null)throw new TypeError("Expected a non-null value");return r},ua=r=>{if(r!=null){if(typeof r=="string")return r;if(["boolean","number","bigint"].includes(typeof r))return Hh.warn(jh(`Expected string, got ${typeof r}: ${r}`)),String(r);throw new TypeError(`Expected string, got ${typeof r}: ${r}`)}},Ty=r=>Yo(typeof r=="string"?_y(r):r),Ay=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,_y=r=>{const e=r.match(Ay);if(e===null||e[0].length!==r.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(r)},jh=r=>String(new TypeError(r).stack||r).split(`
|
|
31
|
-
`).slice(0,5).filter(e=>!e.includes("stackTraceWarning")).join(`
|
|
32
|
-
`),Hh={warn:console.warn},Cy=r=>{if(r==null)return;let e;if(typeof r=="number")e=r;else if(typeof r=="string")e=Ty(r);else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(e)||e===1/0||e===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(e*1e3))};class ha extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,ha.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}}const mt=(r,e={})=>{Object.entries(e).filter(([,i])=>i!==void 0).forEach(([i,s])=>{(r[i]==null||r[i]==="")&&(r[i]=s)});const t=r.message||r.Message||"UnknownError";return r.message=t,delete r.Message,r},Ly=({output:r,parsedBody:e,exceptionCtor:t,errorCode:i})=>{const s=Iy(r),n=s.httpStatusCode?s.httpStatusCode+"":void 0,a=new t({name:(e==null?void 0:e.code)||(e==null?void 0:e.Code)||i||n||"UnknownError",$fault:"client",$metadata:s});throw mt(a,e)},Kh=r=>({output:e,parsedBody:t,errorCode:i})=>{Ly({output:e,parsedBody:t,exceptionCtor:r,errorCode:i})},Iy=r=>({httpStatusCode:r.statusCode,requestId:r.headers["x-amzn-requestid"]??r.headers["x-amzn-request-id"]??r.headers["x-amz-request-id"],extendedRequestId:r.headers["x-amz-id-2"],cfId:r.headers["x-amz-cf-id"]}),zh=r=>{switch(r){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}},Ry=r=>{const e=[];for(const t in ia){const i=ia[t];r[i]!==void 0&&e.push({algorithmId:()=>i,checksumConstructor:()=>r[i]})}return{_checksumAlgorithms:e,addChecksumAlgorithm(t){this._checksumAlgorithms.push(t)},checksumAlgorithms(){return this._checksumAlgorithms}}},Py=r=>{const e={};return r.checksumAlgorithms().forEach(t=>{e[t.algorithmId()]=t.checksumConstructor()}),e},ky=r=>{let e=r.retryStrategy;return{setRetryStrategy(t){e=t},retryStrategy(){return e}}},Dy=r=>{const e={};return e.retryStrategy=r.retryStrategy(),e},Wh=r=>({...Ry(r),...ky(r)}),qh=r=>({...Py(r),...Dy(r)}),Xo=function(){const r=Object.getPrototypeOf(this).constructor,e=Function.bind.apply(String,[null,...arguments]),t=new e;return Object.setPrototypeOf(t,r.prototype),t};Xo.prototype=Object.create(String.prototype,{constructor:{value:Xo,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(Xo,String);const Qo=(r,e)=>{const t={};for(const i in e)Oy(t,r,e,i);return t},Oy=(r,e,t,i)=>{if(e!==null){let a=t[i];typeof a=="function"&&(a=[,a]);const[o=My,l=Fy,u=i]=a;(typeof o=="function"&&o(e[u])||typeof o!="function"&&o)&&(r[i]=l(e[u]));return}let[s,n]=t[i];if(typeof n=="function"){let a;const o=s===void 0&&(a=n())!=null,l=typeof s=="function"&&!!s(void 0)||typeof s!="function"&&!!s;o?r[i]=a:l&&(r[i]=n())}else{const a=s===void 0&&n!=null,o=typeof s=="function"&&!!s(n)||typeof s!="function"&&!!s;(a||o)&&(r[i]=n)}},My=r=>r!=null,Fy=r=>r,st=r=>{if(r==null)return{};if(Array.isArray(r))return r.filter(e=>e!=null).map(st);if(typeof r=="object"){const e={};for(const t of Object.keys(r))r[t]!=null&&(e[t]=st(r[t]));return e}return r},Ny=r=>(r==null?void 0:r.body)instanceof ReadableStream,By=r=>(e,t)=>async i=>{var a;let s=await r.retryStrategy();const n=await r.maxAttempts();if($y(s)){s=s;let o=await s.acquireInitialRetryToken(t.partition_id),l=new Error,u=0,h=0;const{request:f}=i,g=Ei.isInstance(f);for(g&&(f.headers[iy]=cy());;)try{g&&(f.headers[ry]=`attempt=${u+1}; max=${n}`);const{response:v,output:y}=await e(i);return s.recordSuccess(o),y.$metadata.attempts=u+1,y.$metadata.totalRetryDelay=h,{response:v,output:y}}catch(v){const y=Uy(v);if(l=uy(v),g&&Ny(f))throw(a=t.logger instanceof Ko?console:t.logger)==null||a.warn("An error was encountered in a non-retryable streaming request."),l;try{o=await s.refreshRetryTokenForRetry(o,y)}catch{throw l.$metadata||(l.$metadata={}),l.$metadata.attempts=u+1,l.$metadata.totalRetryDelay=h,l}u=o.getRetryCount();const b=o.getRetryDelay();h+=b,await new Promise(E=>setTimeout(E,b))}}else return s=s,s!=null&&s.mode&&(t.userAgent=[...t.userAgent||[],["cfg/retry-mode",s.mode]]),s.retry(e,i)},$y=r=>typeof r.acquireInitialRetryToken<"u"&&typeof r.refreshRetryTokenForRetry<"u"&&typeof r.recordSuccess<"u",Uy=r=>{const e={error:r,errorType:Gy(r)},t=Vy(r.$response);return t&&(e.retryAfterHint=t),e},Gy=r=>Ih(r)?"THROTTLING":Rh(r)?"TRANSIENT":Xv(r)?"SERVER_ERROR":"CLIENT_ERROR",Yh={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},Xh=r=>({applyToStack:e=>{e.add(By(r),Yh)}}),Vy=r=>{if(!ra.isInstance(r))return;const e=Object.keys(r.headers).find(n=>n.toLowerCase()==="retry-after");if(!e)return;const t=r.headers[e],i=Number(t);return Number.isNaN(i)?new Date(t):new Date(i*1e3)},jy={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:Yh.name},Qh=r=>({applyToStack:e=>{e.addRelativeTo(Hv(),jy)}});class Jh{constructor(e){this.authSchemes=new Map;for(const[t,i]of Object.entries(e))i!==void 0&&this.authSchemes.set(t,i)}getIdentityProvider(e){return this.authSchemes.get(e)}}class Hy{async sign(e,t,i){return e}}const Ky=(r=>e=>Zh(e)&&e.expiration.getTime()-Date.now()<r)(3e5),Zh=r=>r.expiration!==void 0,zy=(r,e,t)=>{if(r===void 0)return;const i=typeof r!="function"?async()=>Promise.resolve(r):r;let s,n,a,o=!1;const l=async u=>{n||(n=i(u));try{s=await n,a=!0,o=!1}finally{n=void 0}return s};return e===void 0?async u=>((!a||u!=null&&u.forceRefresh)&&(s=await l(u)),s):async u=>((!a||u!=null&&u.forceRefresh)&&(s=await l(u)),o?s:t(s)?(e(s)&&await l(u),s):(o=!0,s))},da=r=>{if(typeof r=="function")return r;const e=Promise.resolve(r);return()=>e},Wy=r=>({...r,eventStreamMarshaller:r.eventStreamSerdeProvider(r)}),ed="content-length";function qy(r){return e=>async t=>{const i=t.request;if(Ei.isInstance(i)){const{body:s,headers:n}=i;if(s&&Object.keys(n).map(a=>a.toLowerCase()).indexOf(ed)===-1)try{const a=r(s);i.headers={...i.headers,[ed]:String(a)}}catch{}}return e({...t,request:i})}}const Yy={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},td=r=>({applyToStack:e=>{e.add(qy(r.bodyLengthChecker),Yy)}}),id=r=>{var e,t;return ra.isInstance(r)?((e=r.headers)==null?void 0:e.date)??((t=r.headers)==null?void 0:t.Date):void 0},rd=r=>new Date(Date.now()+r),Xy=(r,e)=>Math.abs(rd(e).getTime()-r)>=3e5,sd=(r,e)=>{const t=Date.parse(r);return Xy(t,e)?t-Date.now():e},nn=(r,e)=>{if(!e)throw new Error(`Property \`${r}\` is not resolved for AWS SDK SigV4Auth`);return e},Qy=async r=>{var l,u,h;const e=nn("context",r.context),t=nn("config",r.config),i=(h=(u=(l=e.endpointV2)==null?void 0:l.properties)==null?void 0:u.authSchemes)==null?void 0:h[0],n=await nn("signer",t.signer)(i),a=r==null?void 0:r.signingRegion,o=r==null?void 0:r.signingName;return{config:t,signer:n,signingRegion:a,signingName:o}};class nd{async sign(e,t,i){if(!Ei.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const{config:s,signer:n,signingRegion:a,signingName:o}=await Qy(i);return await n.sign(e,{signingDate:rd(s.systemClockOffset),signingRegion:a,signingService:o})}errorHandler(e){return t=>{const i=t.ServerTime??id(t.$response);if(i){const s=nn("config",e.config),n=s.systemClockOffset;s.systemClockOffset=sd(i,s.systemClockOffset),s.systemClockOffset!==n&&t.$metadata&&(t.$metadata.clockSkewCorrected=!0)}throw t}}successHandler(e,t){const i=id(e);if(i){const s=nn("config",t.config);s.systemClockOffset=sd(i,s.systemClockOffset)}}}const Jy="X-Amz-Algorithm",Zy="X-Amz-Credential",ad="X-Amz-Date",eS="X-Amz-SignedHeaders",tS="X-Amz-Expires",od="X-Amz-Signature",ld="X-Amz-Security-Token",cd="authorization",ud=ad.toLowerCase(),iS=[cd,ud,"date"],rS=od.toLowerCase(),Jo="x-amz-content-sha256",sS=ld.toLowerCase(),nS={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},aS=/^proxy-/,oS=/^sec-/,Zo="AWS4-HMAC-SHA256",lS="AWS4-HMAC-SHA256-PAYLOAD",cS="UNSIGNED-PAYLOAD",uS=50,hd="aws4_request",hS=60*60*24*7,fa={},el=[],tl=(r,e,t)=>`${r}/${e}/${t}/${hd}`,dS=async(r,e,t,i,s)=>{const n=await dd(r,e.secretAccessKey,e.accessKeyId),a=`${t}:${i}:${s}:${oi(n)}:${e.sessionToken}`;if(a in fa)return fa[a];for(el.push(a);el.length>uS;)delete fa[el.shift()];let o=`AWS4${e.secretAccessKey}`;for(const l of[t,i,s,hd])o=await dd(r,o,l);return fa[a]=o},dd=(r,e,t)=>{const i=new r(e);return i.update(sn(t)),i.digest()},fd=({headers:r},e,t)=>{const i={};for(const s of Object.keys(r).sort()){if(r[s]==null)continue;const n=s.toLowerCase();(n in nS||e!=null&&e.has(n)||aS.test(n)||oS.test(n))&&(!t||t&&!t.has(n))||(i[n]=r[s].trim().replace(/\s+/g," "))}return i},fS=({query:r={}})=>{const e=[],t={};for(const i of Object.keys(r).sort()){if(i.toLowerCase()===rS)continue;e.push(i);const s=r[i];typeof s=="string"?t[i]=`${wr(i)}=${wr(s)}`:Array.isArray(s)&&(t[i]=s.slice(0).reduce((n,a)=>n.concat([`${wr(i)}=${wr(a)}`]),[]).sort().join("&"))}return e.map(i=>t[i]).filter(i=>i).join("&")},pS=r=>typeof ArrayBuffer=="function"&&r instanceof ArrayBuffer||Object.prototype.toString.call(r)==="[object ArrayBuffer]",il=async({headers:r,body:e},t)=>{for(const i of Object.keys(r))if(i.toLowerCase()===Jo)return r[i];if(e==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof e=="string"||ArrayBuffer.isView(e)||pS(e)){const i=new t;return i.update(sn(e)),oi(await i.digest())}return cS};class gS{format(e){const t=[];for(const n of Object.keys(e)){const a=zr(n);t.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(e[n]))}const i=new Uint8Array(t.reduce((n,a)=>n+a.byteLength,0));let s=0;for(const n of t)i.set(n,s),s+=n.byteLength;return i}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":const i=new DataView(new ArrayBuffer(5));return i.setUint8(0,4),i.setInt32(1,e.value,!1),new Uint8Array(i.buffer);case"long":const s=new Uint8Array(9);return s[0]=5,s.set(e.value.bytes,1),s;case"binary":const n=new DataView(new ArrayBuffer(3+e.value.byteLength));n.setUint8(0,6),n.setUint16(1,e.value.byteLength,!1);const a=new Uint8Array(n.buffer);return a.set(e.value,3),a;case"string":const o=zr(e.value),l=new DataView(new ArrayBuffer(3+o.byteLength));l.setUint8(0,7),l.setUint16(1,o.byteLength,!1);const u=new Uint8Array(l.buffer);return u.set(o,3),u;case"timestamp":const h=new Uint8Array(9);return h[0]=8,h.set(vS.fromNumber(e.value.valueOf()).bytes,1),h;case"uuid":if(!mS.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const f=new Uint8Array(17);return f[0]=9,f.set(Vh(e.value.replace(/\-/g,"")),1),f}}}var pd;(function(r){r[r.boolTrue=0]="boolTrue",r[r.boolFalse=1]="boolFalse",r[r.byte=2]="byte",r[r.short=3]="short",r[r.integer=4]="integer",r[r.long=5]="long",r[r.byteArray=6]="byteArray",r[r.string=7]="string",r[r.timestamp=8]="timestamp",r[r.uuid=9]="uuid"})(pd||(pd={}));const mS=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;let vS=class V0{constructor(e){if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const t=new Uint8Array(8);for(let i=7,s=Math.abs(Math.round(e));i>-1&&s>0;i--,s/=256)t[i]=s;return e<0&&gd(t),new V0(t)}valueOf(){const e=this.bytes.slice(0),t=e[0]&128;return t&&gd(e),parseInt(oi(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}};function gd(r){for(let e=0;e<8;e++)r[e]^=255;for(let e=7;e>-1&&(r[e]++,r[e]===0);e--);}const yS=(r,e)=>{r=r.toLowerCase();for(const t of Object.keys(e))if(r===t.toLowerCase())return!0;return!1},md=({headers:r,query:e,...t})=>({...t,headers:{...r},query:e?SS(e):void 0}),SS=r=>Object.keys(r).reduce((e,t)=>{const i=r[t];return{...e,[t]:Array.isArray(i)?[...i]:i}},{}),xS=(r,e={})=>{var s;const{headers:t,query:i={}}=typeof r.clone=="function"?r.clone():md(r);for(const n of Object.keys(t)){const a=n.toLowerCase();a.slice(0,6)==="x-amz-"&&!((s=e.unhoistableHeaders)!=null&&s.has(a))&&(i[n]=t[n],delete t[n])}return{...r,headers:t,query:i}},vd=r=>{r=typeof r.clone=="function"?r.clone():md(r);for(const e of Object.keys(r.headers))iS.indexOf(e.toLowerCase())>-1&&delete r.headers[e];return r},bS=r=>ES(r).toISOString().replace(/\.\d{3}Z$/,"Z"),ES=r=>typeof r=="number"?new Date(r*1e3):typeof r=="string"?Number(r)?new Date(Number(r)*1e3):new Date(r):r;class yd{constructor({applyChecksum:e,credentials:t,region:i,service:s,sha256:n,uriEscapePath:a=!0}){this.headerFormatter=new gS,this.service=s,this.sha256=n,this.uriEscapePath=a,this.applyChecksum=typeof e=="boolean"?e:!0,this.regionProvider=ir(i),this.credentialProvider=ir(t)}async presign(e,t={}){const{signingDate:i=new Date,expiresIn:s=3600,unsignableHeaders:n,unhoistableHeaders:a,signableHeaders:o,signingRegion:l,signingService:u}=t,h=await this.credentialProvider();this.validateResolvedCredentials(h);const f=l??await this.regionProvider(),{longDate:g,shortDate:v}=pa(i);if(s>hS)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const y=tl(v,f,u??this.service),b=xS(vd(e),{unhoistableHeaders:a});h.sessionToken&&(b.query[ld]=h.sessionToken),b.query[Jy]=Zo,b.query[Zy]=`${h.accessKeyId}/${y}`,b.query[ad]=g,b.query[tS]=s.toString(10);const E=fd(b,n,o);return b.query[eS]=Sd(E),b.query[od]=await this.getSignature(g,y,this.getSigningKey(h,f,v,u),this.createCanonicalRequest(b,E,await il(e,this.sha256))),b}async sign(e,t){return typeof e=="string"?this.signString(e,t):e.headers&&e.payload?this.signEvent(e,t):e.message?this.signMessage(e,t):this.signRequest(e,t)}async signEvent({headers:e,payload:t},{signingDate:i=new Date,priorSignature:s,signingRegion:n,signingService:a}){const o=n??await this.regionProvider(),{shortDate:l,longDate:u}=pa(i),h=tl(l,o,a??this.service),f=await il({headers:{},body:t},this.sha256),g=new this.sha256;g.update(e);const v=oi(await g.digest()),y=[lS,u,h,s,v,f].join(`
|
|
33
|
-
`);return this.signString(y,{signingDate:i,signingRegion:o,signingService:a})}async signMessage(e,{signingDate:t=new Date,signingRegion:i,signingService:s}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:t,signingRegion:i,signingService:s,priorSignature:e.priorSignature}).then(a=>({message:e.message,signature:a}))}async signString(e,{signingDate:t=new Date,signingRegion:i,signingService:s}={}){const n=await this.credentialProvider();this.validateResolvedCredentials(n);const a=i??await this.regionProvider(),{shortDate:o}=pa(t),l=new this.sha256(await this.getSigningKey(n,a,o,s));return l.update(sn(e)),oi(await l.digest())}async signRequest(e,{signingDate:t=new Date,signableHeaders:i,unsignableHeaders:s,signingRegion:n,signingService:a}={}){const o=await this.credentialProvider();this.validateResolvedCredentials(o);const l=n??await this.regionProvider(),u=vd(e),{longDate:h,shortDate:f}=pa(t),g=tl(f,l,a??this.service);u.headers[ud]=h,o.sessionToken&&(u.headers[sS]=o.sessionToken);const v=await il(u,this.sha256);!yS(Jo,u.headers)&&this.applyChecksum&&(u.headers[Jo]=v);const y=fd(u,s,i),b=await this.getSignature(h,g,this.getSigningKey(o,l,f,a),this.createCanonicalRequest(u,y,v));return u.headers[cd]=`${Zo} Credential=${o.accessKeyId}/${g}, SignedHeaders=${Sd(y)}, Signature=${b}`,u}createCanonicalRequest(e,t,i){const s=Object.keys(t).sort();return`${e.method}
|
|
34
|
-
${this.getCanonicalPath(e)}
|
|
35
|
-
${fS(e)}
|
|
36
|
-
${s.map(n=>`${n}:${t[n]}`).join(`
|
|
37
|
-
`)}
|
|
38
|
-
|
|
39
|
-
${s.join(";")}
|
|
40
|
-
${i}`}async createStringToSign(e,t,i){const s=new this.sha256;s.update(sn(i));const n=await s.digest();return`${Zo}
|
|
41
|
-
${e}
|
|
42
|
-
${t}
|
|
43
|
-
${oi(n)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const t=[];for(const n of e.split("/"))(n==null?void 0:n.length)!==0&&n!=="."&&(n===".."?t.pop():t.push(n));const i=`${e!=null&&e.startsWith("/")?"/":""}${t.join("/")}${t.length>0&&(e!=null&&e.endsWith("/"))?"/":""}`;return wr(i).replace(/%2F/g,"/")}return e}async getSignature(e,t,i,s){const n=await this.createStringToSign(e,t,s),a=new this.sha256(await i);return a.update(sn(n)),oi(await a.digest())}getSigningKey(e,t,i,s){return dS(this.sha256,e,i,t,s||this.service)}validateResolvedCredentials(e){if(typeof e!="object"||typeof e.accessKeyId!="string"||typeof e.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}}const pa=r=>{const e=bS(r).replace(/[\-:]/g,"");return{longDate:e,shortDate:e.slice(0,8)}},Sd=r=>Object.keys(r).sort().join(";"),xd=r=>{let e;r.credentials&&(e=zy(r.credentials,Ky,Zh)),e||(r.credentialDefaultProvider?e=da(r.credentialDefaultProvider(Object.assign({},r,{parentClientConfig:r}))):e=async()=>{throw new Error("`credentials` is missing")});const{signingEscapePath:t=!0,systemClockOffset:i=r.systemClockOffset||0,sha256:s}=r;let n;return r.signer?n=da(r.signer):r.regionInfoProvider?n=()=>da(r.region)().then(async a=>[await r.regionInfoProvider(a,{useFipsEndpoint:await r.useFipsEndpoint(),useDualstackEndpoint:await r.useDualstackEndpoint()})||{},a]).then(([a,o])=>{const{signingRegion:l,signingService:u}=a;r.signingRegion=r.signingRegion||l||o,r.signingName=r.signingName||u||r.serviceId;const h={...r,credentials:e,region:r.signingRegion,service:r.signingName,sha256:s,uriEscapePath:t},f=r.signerConstructor||yd;return new f(h)}):n=async a=>{a=Object.assign({},{name:"sigv4",signingName:r.signingName||r.defaultSigningName,signingRegion:await da(r.region)(),properties:{}},a);const o=a.signingRegion,l=a.signingName;r.signingRegion=r.signingRegion||o,r.signingName=r.signingName||l||r.serviceId;const u={...r,credentials:e,region:r.signingRegion,service:r.signingName,sha256:s,uriEscapePath:t},h=r.signerConstructor||yd;return new h(u)},{...r,systemClockOffset:i,signingEscapePath:t,credentials:e,signer:n}},wS=(r,e)=>by(r,e).then(t=>e.utf8Encoder(t)),ga=(r,e)=>wS(r,e).then(t=>{if(t.length)try{return JSON.parse(t)}catch(i){throw(i==null?void 0:i.name)==="SyntaxError"&&Object.defineProperty(i,"$responseBodyText",{value:t}),i}return{}}),bd=async(r,e)=>{const t=await ga(r,e);return t.message=t.message??t.Message,t},Ed=(r,e)=>{const t=(n,a)=>Object.keys(n).find(o=>o.toLowerCase()===a.toLowerCase()),i=n=>{let a=n;return typeof a=="number"&&(a=a.toString()),a.indexOf(",")>=0&&(a=a.split(",")[0]),a.indexOf(":")>=0&&(a=a.split(":")[0]),a.indexOf("#")>=0&&(a=a.split("#")[1]),a},s=t(r.headers,"x-amzn-errortype");if(s!==void 0)return i(r.headers[s]);if(e.code!==void 0)return i(e.code);if(e.__type!==void 0)return i(e.__type)},TS=async(r,e,t)=>({operation:Zs(e).operation,region:await ir(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function AS(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"kinesis",region:r.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}const _S=r=>{const e=[];switch(r.operation){default:e.push(AS(r))}return e},CS=r=>({...xd(r)}),LS=r=>({...r,useDualstackEndpoint:r.useDualstackEndpoint??!1,useFipsEndpoint:r.useFipsEndpoint??!1,defaultSigningName:"kinesis"}),IS={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},RS={name:"@aws-sdk/client-kinesis",description:"AWS SDK for JavaScript Kinesis Client for Node.js, Browser and React Native",version:"3.582.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-kinesis","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo kinesis","test:e2e":"jest --config jest.config.e2e.js"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"3.0.0","@aws-crypto/sha256-js":"3.0.0","@aws-sdk/client-sso-oidc":"3.582.0","@aws-sdk/client-sts":"3.582.0","@aws-sdk/core":"3.582.0","@aws-sdk/credential-provider-node":"3.582.0","@aws-sdk/middleware-host-header":"3.577.0","@aws-sdk/middleware-logger":"3.577.0","@aws-sdk/middleware-recursion-detection":"3.577.0","@aws-sdk/middleware-user-agent":"3.577.0","@aws-sdk/region-config-resolver":"3.577.0","@aws-sdk/types":"3.577.0","@aws-sdk/util-endpoints":"3.577.0","@aws-sdk/util-user-agent-browser":"3.577.0","@aws-sdk/util-user-agent-node":"3.577.0","@smithy/config-resolver":"^3.0.0","@smithy/core":"^2.0.1","@smithy/eventstream-serde-browser":"^3.0.0","@smithy/eventstream-serde-config-resolver":"^3.0.0","@smithy/eventstream-serde-node":"^3.0.0","@smithy/fetch-http-handler":"^3.0.1","@smithy/hash-node":"^3.0.0","@smithy/invalid-dependency":"^3.0.0","@smithy/middleware-content-length":"^3.0.0","@smithy/middleware-endpoint":"^3.0.0","@smithy/middleware-retry":"^3.0.1","@smithy/middleware-serde":"^3.0.0","@smithy/middleware-stack":"^3.0.0","@smithy/node-config-provider":"^3.0.0","@smithy/node-http-handler":"^3.0.0","@smithy/protocol-http":"^4.0.0","@smithy/smithy-client":"^3.0.1","@smithy/types":"^3.0.0","@smithy/url-parser":"^3.0.0","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.1","@smithy/util-defaults-mode-node":"^3.0.1","@smithy/util-endpoints":"^2.0.0","@smithy/util-middleware":"^3.0.0","@smithy/util-retry":"^3.0.0","@smithy/util-utf8":"^3.0.0","@smithy/util-waiter":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-kinesis",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-kinesis"}};var rl={};/*! *****************************************************************************
|
|
44
|
-
Copyright (c) Microsoft Corporation.
|
|
45
|
-
|
|
46
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
47
|
-
purpose with or without fee is hereby granted.
|
|
48
|
-
|
|
49
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
50
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
51
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
52
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
53
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
54
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
55
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
56
|
-
***************************************************************************** */var sl=function(r,e){return sl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)i.hasOwnProperty(s)&&(t[s]=i[s])},sl(r,e)};function PS(r,e){sl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var nl=function(){return nl=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},nl.apply(this,arguments)};function kS(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(r);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(r,i[s])&&(t[i[s]]=r[i[s]]);return t}function DS(r,e,t,i){var s=arguments.length,n=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var o=r.length-1;o>=0;o--)(a=r[o])&&(n=(s<3?a(n):s>3?a(e,t,n):a(e,t))||n);return s>3&&n&&Object.defineProperty(e,t,n),n}function OS(r,e){return function(t,i){e(t,i,r)}}function MS(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function FS(r,e,t,i){function s(n){return n instanceof t?n:new t(function(a){a(n)})}return new(t||(t=Promise))(function(n,a){function o(h){try{u(i.next(h))}catch(f){a(f)}}function l(h){try{u(i.throw(h))}catch(f){a(f)}}function u(h){h.done?n(h.value):s(h.value).then(o,l)}u((i=i.apply(r,e||[])).next())})}function NS(r,e){var t={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},i,s,n,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(u){return function(h){return l([u,h])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,s&&(n=u[0]&2?s.return:u[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,u[1])).done)return n;switch(s=0,n&&(u=[u[0]&2,n.value]),u[0]){case 0:case 1:n=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,s=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(n=t.trys,!(n=n.length>0&&n[n.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!n||u[1]>n[0]&&u[1]<n[3])){t.label=u[1];break}if(u[0]===6&&t.label<n[1]){t.label=n[1],n=u;break}if(n&&t.label<n[2]){t.label=n[2],t.ops.push(u);break}n[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(h){u=[6,h],s=0}finally{i=n=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function BS(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}function $S(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function al(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function wd(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),s,n=[],a;try{for(;(e===void 0||e-- >0)&&!(s=i.next()).done;)n.push(s.value)}catch(o){a={error:o}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(a)throw a.error}}return n}function US(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(wd(arguments[e]));return r}function GS(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),s=0,e=0;e<t;e++)for(var n=arguments[e],a=0,o=n.length;a<o;a++,s++)i[s]=n[a];return i}function an(r){return this instanceof an?(this.v=r,this):new an(r)}function VS(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(r,e||[]),s,n=[];return s={},a("next"),a("throw"),a("return"),s[Symbol.asyncIterator]=function(){return this},s;function a(g){i[g]&&(s[g]=function(v){return new Promise(function(y,b){n.push([g,v,y,b])>1||o(g,v)})})}function o(g,v){try{l(i[g](v))}catch(y){f(n[0][3],y)}}function l(g){g.value instanceof an?Promise.resolve(g.value.v).then(u,h):f(n[0][2],g)}function u(g){o("next",g)}function h(g){o("throw",g)}function f(g,v){g(v),n.shift(),n.length&&o(n[0][0],n[0][1])}}function jS(r){var e,t;return e={},i("next"),i("throw",function(s){throw s}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(s,n){e[s]=r[s]?function(a){return(t=!t)?{value:an(r[s](a)),done:s==="return"}:n?n(a):a}:n}}function HS(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof al=="function"?al(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=r[n]&&function(a){return new Promise(function(o,l){a=r[n](a),s(o,l,a.done,a.value)})}}function s(n,a,o,l){Promise.resolve(l).then(function(u){n({value:u,done:o})},a)}}function KS(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function zS(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function WS(r){return r&&r.__esModule?r:{default:r}}function qS(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function YS(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}const XS=jr(Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return nl},__asyncDelegator:jS,__asyncGenerator:VS,__asyncValues:HS,__await:an,__awaiter:FS,__classPrivateFieldGet:qS,__classPrivateFieldSet:YS,__createBinding:BS,__decorate:DS,__exportStar:$S,__extends:PS,__generator:NS,__importDefault:WS,__importStar:zS,__makeTemplateObject:KS,__metadata:MS,__param:OS,__read:wd,__rest:kS,__spread:US,__spreadArrays:GS,__values:al},Symbol.toStringTag,{value:"Module"})));var on={},ln={},cn={},Td;function QS(){if(Td)return cn;Td=1,Object.defineProperty(cn,"__esModule",{value:!0}),cn.isEmptyData=void 0;function r(e){return typeof e=="string"?e.length===0:e.byteLength===0}return cn.isEmptyData=r,cn}var ol={},Ad;function _d(){return Ad||(Ad=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.EMPTY_DATA_SHA_256=r.SHA_256_HMAC_ALGO=r.SHA_256_HASH=void 0,r.SHA_256_HASH={name:"SHA-256"},r.SHA_256_HMAC_ALGO={name:"HMAC",hash:r.SHA_256_HASH},r.EMPTY_DATA_SHA_256=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85])}(ol)),ol}const JS=r=>{const e=[];for(let t=0,i=r.length;t<i;t++){const s=r.charCodeAt(t);if(s<128)e.push(s);else if(s<2048)e.push(s>>6|192,s&63|128);else if(t+1<r.length&&(s&64512)===55296&&(r.charCodeAt(t+1)&64512)===56320){const n=65536+((s&1023)<<10)+(r.charCodeAt(++t)&1023);e.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else e.push(s>>12|224,s>>6&63|128,s&63|128)}return Uint8Array.from(e)},ZS=r=>{let e="";for(let t=0,i=r.length;t<i;t++){const s=r[t];if(s<128)e+=String.fromCharCode(s);else if(192<=s&&s<224){const n=r[++t];e+=String.fromCharCode((s&31)<<6|n&63)}else if(240<=s&&s<365){const a="%"+[s,r[++t],r[++t],r[++t]].map(o=>o.toString(16)).join("%");e+=decodeURIComponent(a)}else e+=String.fromCharCode((s&15)<<12|(r[++t]&63)<<6|r[++t]&63)}return e};function e1(r){return new TextEncoder().encode(r)}function t1(r){return new TextDecoder("utf-8").decode(r)}const Cd=jr(Object.freeze(Object.defineProperty({__proto__:null,fromUtf8:r=>typeof TextEncoder=="function"?e1(r):JS(r),toUtf8:r=>typeof TextDecoder=="function"?t1(r):ZS(r)},Symbol.toStringTag,{value:"Module"}))),i1={};function r1(){return typeof window<"u"?window:typeof self<"u"?self:i1}const ll=jr(Object.freeze(Object.defineProperty({__proto__:null,locateWindow:r1},Symbol.toStringTag,{value:"Module"})));var Ld;function Id(){if(Ld)return ln;Ld=1,Object.defineProperty(ln,"__esModule",{value:!0}),ln.Sha256=void 0;var r=QS(),e=_d(),t=Cd,i=ll,s=function(){function o(l){this.secret=l,this.reset()}return o.prototype.update=function(l){var u=this;(0,r.isEmptyData)(l)||(this.operation=this.operation.then(function(h){return h.onerror=function(){u.operation=Promise.reject(new Error("Error encountered updating hash"))},h.process(a(l)),h}),this.operation.catch(function(){}))},o.prototype.digest=function(){return this.operation.then(function(l){return new Promise(function(u,h){l.onerror=function(){h(new Error("Error encountered finalizing hash"))},l.oncomplete=function(){l.result&&u(new Uint8Array(l.result)),h(new Error("Error encountered finalizing hash"))},l.finish()})})},o.prototype.reset=function(){this.secret?(this.operation=n(this.secret).then(function(l){return(0,i.locateWindow)().msCrypto.subtle.sign(e.SHA_256_HMAC_ALGO,l)}),this.operation.catch(function(){})):this.operation=Promise.resolve((0,i.locateWindow)().msCrypto.subtle.digest("SHA-256"))},o}();ln.Sha256=s;function n(o){return new Promise(function(l,u){var h=(0,i.locateWindow)().msCrypto.subtle.importKey("raw",a(o),e.SHA_256_HMAC_ALGO,!1,["sign"]);h.oncomplete=function(){h.result&&l(h.result),u(new Error("ImportKey completed without importing key."))},h.onerror=function(){u(new Error("ImportKey failed to import key."))}})}function a(o){return typeof o=="string"?(0,t.fromUtf8)(o):ArrayBuffer.isView(o)?new Uint8Array(o.buffer,o.byteOffset,o.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(o)}return ln}var un={},cl={},hn={},Rd;function s1(){if(Rd)return hn;Rd=1,Object.defineProperty(hn,"__esModule",{value:!0}),hn.convertToBuffer=void 0;var r=Cd,e=typeof Buffer<"u"&&Buffer.from?function(i){return Buffer.from(i,"utf8")}:r.fromUtf8;function t(i){return i instanceof Uint8Array?i:typeof i=="string"?e(i):ArrayBuffer.isView(i)?new Uint8Array(i.buffer,i.byteOffset,i.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(i)}return hn.convertToBuffer=t,hn}var dn={},Pd;function n1(){if(Pd)return dn;Pd=1,Object.defineProperty(dn,"__esModule",{value:!0}),dn.isEmptyData=void 0;function r(e){return typeof e=="string"?e.length===0:e.byteLength===0}return dn.isEmptyData=r,dn}var fn={},kd;function a1(){if(kd)return fn;kd=1,Object.defineProperty(fn,"__esModule",{value:!0}),fn.numToUint8=void 0;function r(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}return fn.numToUint8=r,fn}var pn={},Dd;function o1(){if(Dd)return pn;Dd=1,Object.defineProperty(pn,"__esModule",{value:!0}),pn.uint32ArrayFrom=void 0;function r(e){if(!Uint32Array.from){for(var t=new Uint32Array(e.length),i=0;i<e.length;)t[i]=e[i],i+=1;return t}return Uint32Array.from(e)}return pn.uint32ArrayFrom=r,pn}var Od;function gn(){return Od||(Od=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.uint32ArrayFrom=r.numToUint8=r.isEmptyData=r.convertToBuffer=void 0;var e=s1();Object.defineProperty(r,"convertToBuffer",{enumerable:!0,get:function(){return e.convertToBuffer}});var t=n1();Object.defineProperty(r,"isEmptyData",{enumerable:!0,get:function(){return t.isEmptyData}});var i=a1();Object.defineProperty(r,"numToUint8",{enumerable:!0,get:function(){return i.numToUint8}});var s=o1();Object.defineProperty(r,"uint32ArrayFrom",{enumerable:!0,get:function(){return s.uint32ArrayFrom}})}(cl)),cl}var Md;function Fd(){if(Md)return un;Md=1,Object.defineProperty(un,"__esModule",{value:!0}),un.Sha256=void 0;var r=gn(),e=_d(),t=ll,i=function(){function s(n){this.toHash=new Uint8Array(0),this.secret=n,this.reset()}return s.prototype.update=function(n){if(!(0,r.isEmptyData)(n)){var a=(0,r.convertToBuffer)(n),o=new Uint8Array(this.toHash.byteLength+a.byteLength);o.set(this.toHash,0),o.set(a,this.toHash.byteLength),this.toHash=o}},s.prototype.digest=function(){var n=this;return this.key?this.key.then(function(a){return(0,t.locateWindow)().crypto.subtle.sign(e.SHA_256_HMAC_ALGO,a,n.toHash).then(function(o){return new Uint8Array(o)})}):(0,r.isEmptyData)(this.toHash)?Promise.resolve(e.EMPTY_DATA_SHA_256):Promise.resolve().then(function(){return(0,t.locateWindow)().crypto.subtle.digest(e.SHA_256_HASH,n.toHash)}).then(function(a){return Promise.resolve(new Uint8Array(a))})},s.prototype.reset=function(){var n=this;this.toHash=new Uint8Array(0),this.secret&&this.secret!==void 0&&(this.key=new Promise(function(a,o){(0,t.locateWindow)().crypto.subtle.importKey("raw",(0,r.convertToBuffer)(n.secret),e.SHA_256_HMAC_ALGO,!1,["sign"]).then(a,o)}),this.key.catch(function(){}))},s}();return un.Sha256=i,un}var ul={};/*! *****************************************************************************
|
|
57
|
-
Copyright (c) Microsoft Corporation.
|
|
58
|
-
|
|
59
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
60
|
-
purpose with or without fee is hereby granted.
|
|
61
|
-
|
|
62
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
63
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
64
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
65
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
66
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
67
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
68
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
69
|
-
***************************************************************************** */var hl=function(r,e){return hl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)i.hasOwnProperty(s)&&(t[s]=i[s])},hl(r,e)};function l1(r,e){hl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var dl=function(){return dl=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},dl.apply(this,arguments)};function c1(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(r);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(r,i[s])&&(t[i[s]]=r[i[s]]);return t}function u1(r,e,t,i){var s=arguments.length,n=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var o=r.length-1;o>=0;o--)(a=r[o])&&(n=(s<3?a(n):s>3?a(e,t,n):a(e,t))||n);return s>3&&n&&Object.defineProperty(e,t,n),n}function h1(r,e){return function(t,i){e(t,i,r)}}function d1(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function f1(r,e,t,i){function s(n){return n instanceof t?n:new t(function(a){a(n)})}return new(t||(t=Promise))(function(n,a){function o(h){try{u(i.next(h))}catch(f){a(f)}}function l(h){try{u(i.throw(h))}catch(f){a(f)}}function u(h){h.done?n(h.value):s(h.value).then(o,l)}u((i=i.apply(r,e||[])).next())})}function p1(r,e){var t={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},i,s,n,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(u){return function(h){return l([u,h])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,s&&(n=u[0]&2?s.return:u[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,u[1])).done)return n;switch(s=0,n&&(u=[u[0]&2,n.value]),u[0]){case 0:case 1:n=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,s=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(n=t.trys,!(n=n.length>0&&n[n.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!n||u[1]>n[0]&&u[1]<n[3])){t.label=u[1];break}if(u[0]===6&&t.label<n[1]){t.label=n[1],n=u;break}if(n&&t.label<n[2]){t.label=n[2],t.ops.push(u);break}n[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(h){u=[6,h],s=0}finally{i=n=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function g1(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}function m1(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function fl(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Nd(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),s,n=[],a;try{for(;(e===void 0||e-- >0)&&!(s=i.next()).done;)n.push(s.value)}catch(o){a={error:o}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(a)throw a.error}}return n}function v1(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(Nd(arguments[e]));return r}function y1(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),s=0,e=0;e<t;e++)for(var n=arguments[e],a=0,o=n.length;a<o;a++,s++)i[s]=n[a];return i}function mn(r){return this instanceof mn?(this.v=r,this):new mn(r)}function S1(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(r,e||[]),s,n=[];return s={},a("next"),a("throw"),a("return"),s[Symbol.asyncIterator]=function(){return this},s;function a(g){i[g]&&(s[g]=function(v){return new Promise(function(y,b){n.push([g,v,y,b])>1||o(g,v)})})}function o(g,v){try{l(i[g](v))}catch(y){f(n[0][3],y)}}function l(g){g.value instanceof mn?Promise.resolve(g.value.v).then(u,h):f(n[0][2],g)}function u(g){o("next",g)}function h(g){o("throw",g)}function f(g,v){g(v),n.shift(),n.length&&o(n[0][0],n[0][1])}}function x1(r){var e,t;return e={},i("next"),i("throw",function(s){throw s}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(s,n){e[s]=r[s]?function(a){return(t=!t)?{value:mn(r[s](a)),done:s==="return"}:n?n(a):a}:n}}function b1(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof fl=="function"?fl(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=r[n]&&function(a){return new Promise(function(o,l){a=r[n](a),s(o,l,a.done,a.value)})}}function s(n,a,o,l){Promise.resolve(l).then(function(u){n({value:u,done:o})},a)}}function E1(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function w1(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function T1(r){return r&&r.__esModule?r:{default:r}}function A1(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function _1(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}const Bd=jr(Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return dl},__asyncDelegator:x1,__asyncGenerator:S1,__asyncValues:b1,__await:mn,__awaiter:f1,__classPrivateFieldGet:A1,__classPrivateFieldSet:_1,__createBinding:g1,__decorate:u1,__exportStar:m1,__extends:l1,__generator:p1,__importDefault:T1,__importStar:w1,__makeTemplateObject:E1,__metadata:d1,__param:h1,__read:Nd,__rest:c1,__spread:v1,__spreadArrays:y1,__values:fl},Symbol.toStringTag,{value:"Module"})));var vn={},li={},$d;function Ud(){return $d||($d=1,Object.defineProperty(li,"__esModule",{value:!0}),li.MAX_HASHABLE_LENGTH=li.INIT=li.KEY=li.DIGEST_LENGTH=li.BLOCK_SIZE=void 0,li.BLOCK_SIZE=64,li.DIGEST_LENGTH=32,li.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),li.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],li.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1),li}var yn={},Gd;function C1(){if(Gd)return yn;Gd=1,Object.defineProperty(yn,"__esModule",{value:!0}),yn.RawSha256=void 0;var r=Ud(),e=function(){function t(){this.state=Int32Array.from(r.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return t.prototype.update=function(i){if(this.finished)throw new Error("Attempted to update an already finished hash.");var s=0,n=i.byteLength;if(this.bytesHashed+=n,this.bytesHashed*8>r.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=i[s++],n--,this.bufferLength===r.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},t.prototype.digest=function(){if(!this.finished){var i=this.bytesHashed*8,s=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(s.setUint8(this.bufferLength++,128),n%r.BLOCK_SIZE>=r.BLOCK_SIZE-8){for(var a=this.bufferLength;a<r.BLOCK_SIZE;a++)s.setUint8(a,0);this.hashBuffer(),this.bufferLength=0}for(var a=this.bufferLength;a<r.BLOCK_SIZE-8;a++)s.setUint8(a,0);s.setUint32(r.BLOCK_SIZE-8,Math.floor(i/4294967296),!0),s.setUint32(r.BLOCK_SIZE-4,i),this.hashBuffer(),this.finished=!0}for(var o=new Uint8Array(r.DIGEST_LENGTH),a=0;a<8;a++)o[a*4]=this.state[a]>>>24&255,o[a*4+1]=this.state[a]>>>16&255,o[a*4+2]=this.state[a]>>>8&255,o[a*4+3]=this.state[a]>>>0&255;return o},t.prototype.hashBuffer=function(){for(var i=this,s=i.buffer,n=i.state,a=n[0],o=n[1],l=n[2],u=n[3],h=n[4],f=n[5],g=n[6],v=n[7],y=0;y<r.BLOCK_SIZE;y++){if(y<16)this.temp[y]=(s[y*4]&255)<<24|(s[y*4+1]&255)<<16|(s[y*4+2]&255)<<8|s[y*4+3]&255;else{var b=this.temp[y-2],E=(b>>>17|b<<15)^(b>>>19|b<<13)^b>>>10;b=this.temp[y-15];var A=(b>>>7|b<<25)^(b>>>18|b<<14)^b>>>3;this.temp[y]=(E+this.temp[y-7]|0)+(A+this.temp[y-16]|0)}var M=(((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&f^~h&g)|0)+(v+(r.KEY[y]+this.temp[y]|0)|0)|0,D=((a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+(a&o^a&l^o&l)|0;v=g,g=f,f=h,h=u+M|0,u=l,l=o,o=a,a=M+D|0}n[0]+=a,n[1]+=o,n[2]+=l,n[3]+=u,n[4]+=h,n[5]+=f,n[6]+=g,n[7]+=v},t}();return yn.RawSha256=e,yn}var Vd;function L1(){if(Vd)return vn;Vd=1,Object.defineProperty(vn,"__esModule",{value:!0}),vn.Sha256=void 0;var r=Bd,e=Ud(),t=C1(),i=gn(),s=function(){function a(o){this.secret=o,this.hash=new t.RawSha256,this.reset()}return a.prototype.update=function(o){if(!((0,i.isEmptyData)(o)||this.error))try{this.hash.update((0,i.convertToBuffer)(o))}catch(l){this.error=l}},a.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},a.prototype.digest=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(o){return[2,this.digestSync()]})})},a.prototype.reset=function(){if(this.hash=new t.RawSha256,this.secret){this.outer=new t.RawSha256;var o=n(this.secret),l=new Uint8Array(e.BLOCK_SIZE);l.set(o);for(var u=0;u<e.BLOCK_SIZE;u++)o[u]^=54,l[u]^=92;this.hash.update(o),this.outer.update(l);for(var u=0;u<o.byteLength;u++)o[u]=0}},a}();vn.Sha256=s;function n(a){var o=(0,i.convertToBuffer)(a);if(o.byteLength>e.BLOCK_SIZE){var l=new t.RawSha256;l.update(o),o=l.digest()}var u=new Uint8Array(e.BLOCK_SIZE);return u.set(o),u}return vn}var jd;function I1(){return jd||(jd=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Bd;e.__exportStar(L1(),r)}(ul)),ul}var pl={};/*! *****************************************************************************
|
|
70
|
-
Copyright (c) Microsoft Corporation.
|
|
71
|
-
|
|
72
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
73
|
-
purpose with or without fee is hereby granted.
|
|
74
|
-
|
|
75
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
76
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
77
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
78
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
79
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
80
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
81
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
82
|
-
***************************************************************************** */var gl=function(r,e){return gl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)i.hasOwnProperty(s)&&(t[s]=i[s])},gl(r,e)};function R1(r,e){gl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var ml=function(){return ml=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},ml.apply(this,arguments)};function P1(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(r);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(r,i[s])&&(t[i[s]]=r[i[s]]);return t}function k1(r,e,t,i){var s=arguments.length,n=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var o=r.length-1;o>=0;o--)(a=r[o])&&(n=(s<3?a(n):s>3?a(e,t,n):a(e,t))||n);return s>3&&n&&Object.defineProperty(e,t,n),n}function D1(r,e){return function(t,i){e(t,i,r)}}function O1(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function M1(r,e,t,i){function s(n){return n instanceof t?n:new t(function(a){a(n)})}return new(t||(t=Promise))(function(n,a){function o(h){try{u(i.next(h))}catch(f){a(f)}}function l(h){try{u(i.throw(h))}catch(f){a(f)}}function u(h){h.done?n(h.value):s(h.value).then(o,l)}u((i=i.apply(r,e||[])).next())})}function F1(r,e){var t={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},i,s,n,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(u){return function(h){return l([u,h])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,s&&(n=u[0]&2?s.return:u[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,u[1])).done)return n;switch(s=0,n&&(u=[u[0]&2,n.value]),u[0]){case 0:case 1:n=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,s=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(n=t.trys,!(n=n.length>0&&n[n.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!n||u[1]>n[0]&&u[1]<n[3])){t.label=u[1];break}if(u[0]===6&&t.label<n[1]){t.label=n[1],n=u;break}if(n&&t.label<n[2]){t.label=n[2],t.ops.push(u);break}n[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(h){u=[6,h],s=0}finally{i=n=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function N1(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}function B1(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function vl(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Hd(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),s,n=[],a;try{for(;(e===void 0||e-- >0)&&!(s=i.next()).done;)n.push(s.value)}catch(o){a={error:o}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(a)throw a.error}}return n}function $1(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(Hd(arguments[e]));return r}function U1(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),s=0,e=0;e<t;e++)for(var n=arguments[e],a=0,o=n.length;a<o;a++,s++)i[s]=n[a];return i}function Sn(r){return this instanceof Sn?(this.v=r,this):new Sn(r)}function G1(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(r,e||[]),s,n=[];return s={},a("next"),a("throw"),a("return"),s[Symbol.asyncIterator]=function(){return this},s;function a(g){i[g]&&(s[g]=function(v){return new Promise(function(y,b){n.push([g,v,y,b])>1||o(g,v)})})}function o(g,v){try{l(i[g](v))}catch(y){f(n[0][3],y)}}function l(g){g.value instanceof Sn?Promise.resolve(g.value.v).then(u,h):f(n[0][2],g)}function u(g){o("next",g)}function h(g){o("throw",g)}function f(g,v){g(v),n.shift(),n.length&&o(n[0][0],n[0][1])}}function V1(r){var e,t;return e={},i("next"),i("throw",function(s){throw s}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(s,n){e[s]=r[s]?function(a){return(t=!t)?{value:Sn(r[s](a)),done:s==="return"}:n?n(a):a}:n}}function j1(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof vl=="function"?vl(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=r[n]&&function(a){return new Promise(function(o,l){a=r[n](a),s(o,l,a.done,a.value)})}}function s(n,a,o,l){Promise.resolve(l).then(function(u){n({value:u,done:o})},a)}}function H1(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function K1(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function z1(r){return r&&r.__esModule?r:{default:r}}function W1(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function q1(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}const Kd=jr(Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return ml},__asyncDelegator:V1,__asyncGenerator:G1,__asyncValues:j1,__await:Sn,__awaiter:M1,__classPrivateFieldGet:W1,__classPrivateFieldSet:q1,__createBinding:N1,__decorate:k1,__exportStar:B1,__extends:R1,__generator:F1,__importDefault:z1,__importStar:K1,__makeTemplateObject:H1,__metadata:O1,__param:D1,__read:Hd,__rest:P1,__spread:$1,__spreadArrays:U1,__values:vl},Symbol.toStringTag,{value:"Module"})));var wi={},zd;function Y1(){if(zd)return wi;zd=1,Object.defineProperty(wi,"__esModule",{value:!0}),wi.supportsZeroByteGCM=wi.supportsSubtleCrypto=wi.supportsSecureRandom=wi.supportsWebCrypto=void 0;var r=Kd,e=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function t(a){if(i(a)&&typeof a.crypto.subtle=="object"){var o=a.crypto.subtle;return s(o)}return!1}wi.supportsWebCrypto=t;function i(a){if(typeof a=="object"&&typeof a.crypto=="object"){var o=a.crypto.getRandomValues;return typeof o=="function"}return!1}wi.supportsSecureRandom=i;function s(a){return a&&e.every(function(o){return typeof a[o]=="function"})}wi.supportsSubtleCrypto=s;function n(a){return r.__awaiter(this,void 0,void 0,function(){var o,l;return r.__generator(this,function(u){switch(u.label){case 0:if(!s(a))return[2,!1];u.label=1;case 1:return u.trys.push([1,4,,5]),[4,a.generateKey({name:"AES-GCM",length:128},!1,["encrypt"])];case 2:return o=u.sent(),[4,a.encrypt({name:"AES-GCM",iv:new Uint8Array(Array(12)),additionalData:new Uint8Array(Array(16)),tagLength:128},o,new Uint8Array(0))];case 3:return l=u.sent(),[2,l.byteLength===16];case 4:return u.sent(),[2,!1];case 5:return[2]}})})}return wi.supportsZeroByteGCM=n,wi}var Wd;function X1(){return Wd||(Wd=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Kd;e.__exportStar(Y1(),r)}(pl)),pl}var yl={};/*! *****************************************************************************
|
|
83
|
-
Copyright (c) Microsoft Corporation.
|
|
84
|
-
|
|
85
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
86
|
-
purpose with or without fee is hereby granted.
|
|
87
|
-
|
|
88
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
89
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
90
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
91
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
92
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
93
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
94
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
95
|
-
***************************************************************************** */var Sl=function(r,e){return Sl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)i.hasOwnProperty(s)&&(t[s]=i[s])},Sl(r,e)};function Q1(r,e){Sl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var xl=function(){return xl=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},xl.apply(this,arguments)};function J1(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(r);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(r,i[s])&&(t[i[s]]=r[i[s]]);return t}function Z1(r,e,t,i){var s=arguments.length,n=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var o=r.length-1;o>=0;o--)(a=r[o])&&(n=(s<3?a(n):s>3?a(e,t,n):a(e,t))||n);return s>3&&n&&Object.defineProperty(e,t,n),n}function ex(r,e){return function(t,i){e(t,i,r)}}function tx(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function ix(r,e,t,i){function s(n){return n instanceof t?n:new t(function(a){a(n)})}return new(t||(t=Promise))(function(n,a){function o(h){try{u(i.next(h))}catch(f){a(f)}}function l(h){try{u(i.throw(h))}catch(f){a(f)}}function u(h){h.done?n(h.value):s(h.value).then(o,l)}u((i=i.apply(r,e||[])).next())})}function rx(r,e){var t={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},i,s,n,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(u){return function(h){return l([u,h])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,s&&(n=u[0]&2?s.return:u[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,u[1])).done)return n;switch(s=0,n&&(u=[u[0]&2,n.value]),u[0]){case 0:case 1:n=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,s=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(n=t.trys,!(n=n.length>0&&n[n.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!n||u[1]>n[0]&&u[1]<n[3])){t.label=u[1];break}if(u[0]===6&&t.label<n[1]){t.label=n[1],n=u;break}if(n&&t.label<n[2]){t.label=n[2],t.ops.push(u);break}n[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(h){u=[6,h],s=0}finally{i=n=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function sx(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}function nx(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function bl(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function qd(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),s,n=[],a;try{for(;(e===void 0||e-- >0)&&!(s=i.next()).done;)n.push(s.value)}catch(o){a={error:o}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(a)throw a.error}}return n}function ax(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(qd(arguments[e]));return r}function ox(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),s=0,e=0;e<t;e++)for(var n=arguments[e],a=0,o=n.length;a<o;a++,s++)i[s]=n[a];return i}function xn(r){return this instanceof xn?(this.v=r,this):new xn(r)}function lx(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(r,e||[]),s,n=[];return s={},a("next"),a("throw"),a("return"),s[Symbol.asyncIterator]=function(){return this},s;function a(g){i[g]&&(s[g]=function(v){return new Promise(function(y,b){n.push([g,v,y,b])>1||o(g,v)})})}function o(g,v){try{l(i[g](v))}catch(y){f(n[0][3],y)}}function l(g){g.value instanceof xn?Promise.resolve(g.value.v).then(u,h):f(n[0][2],g)}function u(g){o("next",g)}function h(g){o("throw",g)}function f(g,v){g(v),n.shift(),n.length&&o(n[0][0],n[0][1])}}function cx(r){var e,t;return e={},i("next"),i("throw",function(s){throw s}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(s,n){e[s]=r[s]?function(a){return(t=!t)?{value:xn(r[s](a)),done:s==="return"}:n?n(a):a}:n}}function ux(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof bl=="function"?bl(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=r[n]&&function(a){return new Promise(function(o,l){a=r[n](a),s(o,l,a.done,a.value)})}}function s(n,a,o,l){Promise.resolve(l).then(function(u){n({value:u,done:o})},a)}}function hx(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function dx(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function fx(r){return r&&r.__esModule?r:{default:r}}function px(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function gx(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}const mx=jr(Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return xl},__asyncDelegator:cx,__asyncGenerator:lx,__asyncValues:ux,__await:xn,__awaiter:ix,__classPrivateFieldGet:px,__classPrivateFieldSet:gx,__createBinding:sx,__decorate:Z1,__exportStar:nx,__extends:Q1,__generator:rx,__importDefault:fx,__importStar:dx,__makeTemplateObject:hx,__metadata:tx,__param:ex,__read:qd,__rest:J1,__spread:ax,__spreadArrays:ox,__values:bl},Symbol.toStringTag,{value:"Module"})));var El={},Yd;function vx(){return Yd||(Yd=1,Object.defineProperty(El,"__esModule",{value:!0})),El}var wl={},Xd;function yx(){return Xd||(Xd=1,Object.defineProperty(wl,"__esModule",{value:!0})),wl}var Tl={},Qd;function Sx(){return Qd||(Qd=1,Object.defineProperty(Tl,"__esModule",{value:!0})),Tl}var Al={},Jd;function xx(){return Jd||(Jd=1,Object.defineProperty(Al,"__esModule",{value:!0})),Al}var bn={},Zd;function bx(){if(Zd)return bn;Zd=1,Object.defineProperty(bn,"__esModule",{value:!0}),bn.isMsWindow=void 0;var r=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function e(i){return"MSInputMethodContext"in i&&"msCrypto"in i}function t(i){if(e(i)&&i.msCrypto.subtle!==void 0){var s=i.msCrypto,n=s.getRandomValues,a=s.subtle;return r.map(function(o){return a[o]}).concat(n).every(function(o){return typeof o=="function"})}return!1}return bn.isMsWindow=t,bn}var ef;function Ex(){return ef||(ef=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=mx;e.__exportStar(vx(),r),e.__exportStar(yx(),r),e.__exportStar(Sx(),r),e.__exportStar(xx(),r),e.__exportStar(bx(),r)}(yl)),yl}var tf;function wx(){if(tf)return on;tf=1,Object.defineProperty(on,"__esModule",{value:!0}),on.Sha256=void 0;var r=Id(),e=Fd(),t=I1(),i=X1(),s=Ex(),n=ll,a=gn(),o=function(){function l(u){(0,i.supportsWebCrypto)((0,n.locateWindow)())?this.hash=new e.Sha256(u):(0,s.isMsWindow)((0,n.locateWindow)())?this.hash=new r.Sha256(u):this.hash=new t.Sha256(u)}return l.prototype.update=function(u,h){this.hash.update((0,a.convertToBuffer)(u))},l.prototype.digest=function(){return this.hash.digest()},l.prototype.reset=function(){this.hash.reset()},l}();return on.Sha256=o,on}(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.WebCryptoSha256=r.Ie11Sha256=void 0;var e=XS;e.__exportStar(wx(),r);var t=Id();Object.defineProperty(r,"Ie11Sha256",{enumerable:!0,get:function(){return t.Sha256}});var i=Fd();Object.defineProperty(r,"WebCryptoSha256",{enumerable:!0,get:function(){return i.Sha256}})})(rl);const Tx={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},rf={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},_t={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},qt={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},Tr={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class fe{static getFirstMatch(e,t){const i=t.match(e);return i&&i.length>0&&i[1]||""}static getSecondMatch(e,t){const i=t.match(e);return i&&i.length>1&&i[2]||""}static matchAndReturnConst(e,t,i){if(e.test(t))return i}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map(i=>parseInt(i,10)||0);if(t.push(0),t[0]===10)switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map(i=>parseInt(i,10)||0);if(t.push(0),!(t[0]===1&&t[1]<5)){if(t[0]===1&&t[1]<6)return"Cupcake";if(t[0]===1&&t[1]>=6)return"Donut";if(t[0]===2&&t[1]<2)return"Eclair";if(t[0]===2&&t[1]===2)return"Froyo";if(t[0]===2&&t[1]>2)return"Gingerbread";if(t[0]===3)return"Honeycomb";if(t[0]===4&&t[1]<1)return"Ice Cream Sandwich";if(t[0]===4&&t[1]<4)return"Jelly Bean";if(t[0]===4&&t[1]>=4)return"KitKat";if(t[0]===5)return"Lollipop";if(t[0]===6)return"Marshmallow";if(t[0]===7)return"Nougat";if(t[0]===8)return"Oreo";if(t[0]===9)return"Pie"}}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,i=!1){const s=fe.getVersionPrecision(e),n=fe.getVersionPrecision(t);let a=Math.max(s,n),o=0;const l=fe.map([e,t],u=>{const h=a-fe.getVersionPrecision(u),f=u+new Array(h+1).join(".0");return fe.map(f.split("."),g=>new Array(20-g.length).join("0")+g).reverse()});for(i&&(o=a-Math.min(s,n)),a-=1;a>=o;){if(l[0][a]>l[1][a])return 1;if(l[0][a]===l[1][a]){if(a===o)return 0;a-=1}else if(l[0][a]<l[1][a])return-1}}static map(e,t){const i=[];let s;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(s=0;s<e.length;s+=1)i.push(t(e[s]));return i}static find(e,t){let i,s;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(i=0,s=e.length;i<s;i+=1){const n=e[i];if(t(n,i))return n}}static assign(e,...t){const i=e;let s,n;if(Object.assign)return Object.assign(e,...t);for(s=0,n=t.length;s<n;s+=1){const a=t[s];typeof a=="object"&&a!==null&&Object.keys(a).forEach(l=>{i[l]=a[l]})}return e}static getBrowserAlias(e){return Tx[e]}static getBrowserTypeByAlias(e){return rf[e]||""}}const vt=/version\/(\d+(\.?_?\d+)+)/i,Ax=[{test:[/googlebot/i],describe(r){const e={name:"Googlebot"},t=fe.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,r)||fe.getFirstMatch(vt,r);return t&&(e.version=t),e}},{test:[/opera/i],describe(r){const e={name:"Opera"},t=fe.getFirstMatch(vt,r)||fe.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/opr\/|opios/i],describe(r){const e={name:"Opera"},t=fe.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,r)||fe.getFirstMatch(vt,r);return t&&(e.version=t),e}},{test:[/SamsungBrowser/i],describe(r){const e={name:"Samsung Internet for Android"},t=fe.getFirstMatch(vt,r)||fe.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/Whale/i],describe(r){const e={name:"NAVER Whale Browser"},t=fe.getFirstMatch(vt,r)||fe.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/MZBrowser/i],describe(r){const e={name:"MZ Browser"},t=fe.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,r)||fe.getFirstMatch(vt,r);return t&&(e.version=t),e}},{test:[/focus/i],describe(r){const e={name:"Focus"},t=fe.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,r)||fe.getFirstMatch(vt,r);return t&&(e.version=t),e}},{test:[/swing/i],describe(r){const e={name:"Swing"},t=fe.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,r)||fe.getFirstMatch(vt,r);return t&&(e.version=t),e}},{test:[/coast/i],describe(r){const e={name:"Opera Coast"},t=fe.getFirstMatch(vt,r)||fe.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(r){const e={name:"Opera Touch"},t=fe.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,r)||fe.getFirstMatch(vt,r);return t&&(e.version=t),e}},{test:[/yabrowser/i],describe(r){const e={name:"Yandex Browser"},t=fe.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,r)||fe.getFirstMatch(vt,r);return t&&(e.version=t),e}},{test:[/ucbrowser/i],describe(r){const e={name:"UC Browser"},t=fe.getFirstMatch(vt,r)||fe.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/Maxthon|mxios/i],describe(r){const e={name:"Maxthon"},t=fe.getFirstMatch(vt,r)||fe.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/epiphany/i],describe(r){const e={name:"Epiphany"},t=fe.getFirstMatch(vt,r)||fe.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/puffin/i],describe(r){const e={name:"Puffin"},t=fe.getFirstMatch(vt,r)||fe.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/sleipnir/i],describe(r){const e={name:"Sleipnir"},t=fe.getFirstMatch(vt,r)||fe.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/k-meleon/i],describe(r){const e={name:"K-Meleon"},t=fe.getFirstMatch(vt,r)||fe.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/micromessenger/i],describe(r){const e={name:"WeChat"},t=fe.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,r)||fe.getFirstMatch(vt,r);return t&&(e.version=t),e}},{test:[/qqbrowser/i],describe(r){const e={name:/qqbrowserlite/i.test(r)?"QQ Browser Lite":"QQ Browser"},t=fe.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,r)||fe.getFirstMatch(vt,r);return t&&(e.version=t),e}},{test:[/msie|trident/i],describe(r){const e={name:"Internet Explorer"},t=fe.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/\sedg\//i],describe(r){const e={name:"Microsoft Edge"},t=fe.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/edg([ea]|ios)/i],describe(r){const e={name:"Microsoft Edge"},t=fe.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/vivaldi/i],describe(r){const e={name:"Vivaldi"},t=fe.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/seamonkey/i],describe(r){const e={name:"SeaMonkey"},t=fe.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/sailfish/i],describe(r){const e={name:"Sailfish"},t=fe.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,r);return t&&(e.version=t),e}},{test:[/silk/i],describe(r){const e={name:"Amazon Silk"},t=fe.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/phantom/i],describe(r){const e={name:"PhantomJS"},t=fe.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/slimerjs/i],describe(r){const e={name:"SlimerJS"},t=fe.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(r){const e={name:"BlackBerry"},t=fe.getFirstMatch(vt,r)||fe.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/(web|hpw)[o0]s/i],describe(r){const e={name:"WebOS Browser"},t=fe.getFirstMatch(vt,r)||fe.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/bada/i],describe(r){const e={name:"Bada"},t=fe.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/tizen/i],describe(r){const e={name:"Tizen"},t=fe.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,r)||fe.getFirstMatch(vt,r);return t&&(e.version=t),e}},{test:[/qupzilla/i],describe(r){const e={name:"QupZilla"},t=fe.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,r)||fe.getFirstMatch(vt,r);return t&&(e.version=t),e}},{test:[/firefox|iceweasel|fxios/i],describe(r){const e={name:"Firefox"},t=fe.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/electron/i],describe(r){const e={name:"Electron"},t=fe.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/MiuiBrowser/i],describe(r){const e={name:"Miui"},t=fe.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/chromium/i],describe(r){const e={name:"Chromium"},t=fe.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,r)||fe.getFirstMatch(vt,r);return t&&(e.version=t),e}},{test:[/chrome|crios|crmo/i],describe(r){const e={name:"Chrome"},t=fe.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/GSA/i],describe(r){const e={name:"Google Search"},t=fe.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test(r){const e=!r.test(/like android/i),t=r.test(/android/i);return e&&t},describe(r){const e={name:"Android Browser"},t=fe.getFirstMatch(vt,r);return t&&(e.version=t),e}},{test:[/playstation 4/i],describe(r){const e={name:"PlayStation 4"},t=fe.getFirstMatch(vt,r);return t&&(e.version=t),e}},{test:[/safari|applewebkit/i],describe(r){const e={name:"Safari"},t=fe.getFirstMatch(vt,r);return t&&(e.version=t),e}},{test:[/.*/i],describe(r){const e=/^(.*)\/(.*) /,t=/^(.*)\/(.*)[ \t]\((.*)/,s=r.search("\\(")!==-1?t:e;return{name:fe.getFirstMatch(s,r),version:fe.getSecondMatch(s,r)}}}],_x=[{test:[/Roku\/DVP/],describe(r){const e=fe.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,r);return{name:qt.Roku,version:e}}},{test:[/windows phone/i],describe(r){const e=fe.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,r);return{name:qt.WindowsPhone,version:e}}},{test:[/windows /i],describe(r){const e=fe.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,r),t=fe.getWindowsVersionName(e);return{name:qt.Windows,version:e,versionName:t}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(r){const e={name:qt.iOS},t=fe.getSecondMatch(/(Version\/)(\d[\d.]+)/,r);return t&&(e.version=t),e}},{test:[/macintosh/i],describe(r){const e=fe.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,r).replace(/[_\s]/g,"."),t=fe.getMacOSVersionName(e),i={name:qt.MacOS,version:e};return t&&(i.versionName=t),i}},{test:[/(ipod|iphone|ipad)/i],describe(r){const e=fe.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,r).replace(/[_\s]/g,".");return{name:qt.iOS,version:e}}},{test(r){const e=!r.test(/like android/i),t=r.test(/android/i);return e&&t},describe(r){const e=fe.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,r),t=fe.getAndroidVersionName(e),i={name:qt.Android,version:e};return t&&(i.versionName=t),i}},{test:[/(web|hpw)[o0]s/i],describe(r){const e=fe.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,r),t={name:qt.WebOS};return e&&e.length&&(t.version=e),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(r){const e=fe.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,r)||fe.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,r)||fe.getFirstMatch(/\bbb(\d+)/i,r);return{name:qt.BlackBerry,version:e}}},{test:[/bada/i],describe(r){const e=fe.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,r);return{name:qt.Bada,version:e}}},{test:[/tizen/i],describe(r){const e=fe.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,r);return{name:qt.Tizen,version:e}}},{test:[/linux/i],describe(){return{name:qt.Linux}}},{test:[/CrOS/],describe(){return{name:qt.ChromeOS}}},{test:[/PlayStation 4/],describe(r){const e=fe.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,r);return{name:qt.PlayStation4,version:e}}}],Cx=[{test:[/googlebot/i],describe(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe(r){const e=fe.getFirstMatch(/(can-l01)/i,r)&&"Nova",t={type:_t.mobile,vendor:"Huawei"};return e&&(t.model=e),t}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe(){return{type:_t.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe(){return{type:_t.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(){return{type:_t.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe(){return{type:_t.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe(){return{type:_t.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe(){return{type:_t.tablet}}},{test(r){const e=r.test(/ipod|iphone/i),t=r.test(/like (ipod|iphone)/i);return e&&!t},describe(r){const e=fe.getFirstMatch(/(ipod|iphone)/i,r);return{type:_t.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe(){return{type:_t.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe(){return{type:_t.mobile}}},{test(r){return r.getBrowserName(!0)==="blackberry"},describe(){return{type:_t.mobile,vendor:"BlackBerry"}}},{test(r){return r.getBrowserName(!0)==="bada"},describe(){return{type:_t.mobile}}},{test(r){return r.getBrowserName()==="windows phone"},describe(){return{type:_t.mobile,vendor:"Microsoft"}}},{test(r){const e=Number(String(r.getOSVersion()).split(".")[0]);return r.getOSName(!0)==="android"&&e>=3},describe(){return{type:_t.tablet}}},{test(r){return r.getOSName(!0)==="android"},describe(){return{type:_t.mobile}}},{test(r){return r.getOSName(!0)==="macos"},describe(){return{type:_t.desktop,vendor:"Apple"}}},{test(r){return r.getOSName(!0)==="windows"},describe(){return{type:_t.desktop}}},{test(r){return r.getOSName(!0)==="linux"},describe(){return{type:_t.desktop}}},{test(r){return r.getOSName(!0)==="playstation 4"},describe(){return{type:_t.tv}}},{test(r){return r.getOSName(!0)==="roku"},describe(){return{type:_t.tv}}}],Lx=[{test(r){return r.getBrowserName(!0)==="microsoft edge"},describe(r){if(/\sedg\//i.test(r))return{name:Tr.Blink};const t=fe.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,r);return{name:Tr.EdgeHTML,version:t}}},{test:[/trident/i],describe(r){const e={name:Tr.Trident},t=fe.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test(r){return r.test(/presto/i)},describe(r){const e={name:Tr.Presto},t=fe.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test(r){const e=r.test(/gecko/i),t=r.test(/like gecko/i);return e&&!t},describe(r){const e={name:Tr.Gecko},t=fe.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/(apple)?webkit\/537\.36/i],describe(){return{name:Tr.Blink}}},{test:[/(apple)?webkit/i],describe(r){const e={name:Tr.WebKit},t=fe.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}}];class sf{constructor(e,t=!1){if(e==null||e==="")throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},t!==!0&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=fe.find(Ax,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(i=>this.test(i));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=fe.find(_x,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(i=>this.test(i));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=fe.find(Cx,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(i=>this.test(i));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=fe.find(Lx,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(i=>this.test(i));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return fe.assign({},this.parsedResult)}satisfies(e){const t={};let i=0;const s={};let n=0;if(Object.keys(e).forEach(o=>{const l=e[o];typeof l=="string"?(s[o]=l,n+=1):typeof l=="object"&&(t[o]=l,i+=1)}),i>0){const o=Object.keys(t),l=fe.find(o,h=>this.isOS(h));if(l){const h=this.satisfies(t[l]);if(h!==void 0)return h}const u=fe.find(o,h=>this.isPlatform(h));if(u){const h=this.satisfies(t[u]);if(h!==void 0)return h}}if(n>0){const o=Object.keys(s),l=fe.find(o,u=>this.isBrowser(u,!0));if(l!==void 0)return this.compareVersion(s[l])}}isBrowser(e,t=!1){const i=this.getBrowserName().toLowerCase();let s=e.toLowerCase();const n=fe.getBrowserTypeByAlias(s);return t&&n&&(s=n.toLowerCase()),s===i}compareVersion(e){let t=[0],i=e,s=!1;const n=this.getBrowserVersion();if(typeof n=="string")return e[0]===">"||e[0]==="<"?(i=e.substr(1),e[1]==="="?(s=!0,i=e.substr(2)):t=[],e[0]===">"?t.push(1):t.push(-1)):e[0]==="="?i=e.substr(1):e[0]==="~"&&(s=!0,i=e.substr(1)),t.indexOf(fe.compareVersions(n,i,s))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,t=!1){return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(t=>this.is(t))}}/*!
|
|
96
|
-
* Bowser - a browser detector
|
|
97
|
-
* https://github.com/lancedikson/bowser
|
|
98
|
-
* MIT License | (c) Dustin Diaz 2012-2015
|
|
99
|
-
* MIT License | (c) Denis Demchenko 2015-2019
|
|
100
|
-
*/class nf{static getParser(e,t=!1){if(typeof e!="string")throw new Error("UserAgent should be a string");return new sf(e,t)}static parse(e){return new sf(e).getResult()}static get BROWSER_MAP(){return rf}static get ENGINE_MAP(){return Tr}static get OS_MAP(){return qt}static get PLATFORMS_MAP(){return _t}}const af=({serviceId:r,clientVersion:e})=>async()=>{var s,n,a,o,l;const t=typeof window<"u"&&((s=window==null?void 0:window.navigator)!=null&&s.userAgent)?nf.parse(window.navigator.userAgent):void 0,i=[["aws-sdk-js",e],["ua","2.0"],[`os/${((n=t==null?void 0:t.os)==null?void 0:n.name)||"other"}`,(a=t==null?void 0:t.os)==null?void 0:a.version],["lang/js"],["md/browser",`${((o=t==null?void 0:t.browser)==null?void 0:o.name)??"unknown"}_${((l=t==null?void 0:t.browser)==null?void 0:l.version)??"unknown"}`]];return r&&i.push([`api/${r}`,e]),i};var _l={};/*! *****************************************************************************
|
|
101
|
-
Copyright (c) Microsoft Corporation.
|
|
102
|
-
|
|
103
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
104
|
-
purpose with or without fee is hereby granted.
|
|
105
|
-
|
|
106
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
107
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
108
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
109
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
110
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
111
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
112
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
113
|
-
***************************************************************************** */var Cl=function(r,e){return Cl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)i.hasOwnProperty(s)&&(t[s]=i[s])},Cl(r,e)};function Ix(r,e){Cl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Ll=function(){return Ll=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},Ll.apply(this,arguments)};function Rx(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(r);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(r,i[s])&&(t[i[s]]=r[i[s]]);return t}function Px(r,e,t,i){var s=arguments.length,n=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var o=r.length-1;o>=0;o--)(a=r[o])&&(n=(s<3?a(n):s>3?a(e,t,n):a(e,t))||n);return s>3&&n&&Object.defineProperty(e,t,n),n}function kx(r,e){return function(t,i){e(t,i,r)}}function Dx(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function Ox(r,e,t,i){function s(n){return n instanceof t?n:new t(function(a){a(n)})}return new(t||(t=Promise))(function(n,a){function o(h){try{u(i.next(h))}catch(f){a(f)}}function l(h){try{u(i.throw(h))}catch(f){a(f)}}function u(h){h.done?n(h.value):s(h.value).then(o,l)}u((i=i.apply(r,e||[])).next())})}function Mx(r,e){var t={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},i,s,n,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(u){return function(h){return l([u,h])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,s&&(n=u[0]&2?s.return:u[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,u[1])).done)return n;switch(s=0,n&&(u=[u[0]&2,n.value]),u[0]){case 0:case 1:n=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,s=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(n=t.trys,!(n=n.length>0&&n[n.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!n||u[1]>n[0]&&u[1]<n[3])){t.label=u[1];break}if(u[0]===6&&t.label<n[1]){t.label=n[1],n=u;break}if(n&&t.label<n[2]){t.label=n[2],t.ops.push(u);break}n[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(h){u=[6,h],s=0}finally{i=n=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Fx(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}function Nx(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function Il(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function of(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),s,n=[],a;try{for(;(e===void 0||e-- >0)&&!(s=i.next()).done;)n.push(s.value)}catch(o){a={error:o}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(a)throw a.error}}return n}function Bx(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(of(arguments[e]));return r}function $x(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),s=0,e=0;e<t;e++)for(var n=arguments[e],a=0,o=n.length;a<o;a++,s++)i[s]=n[a];return i}function En(r){return this instanceof En?(this.v=r,this):new En(r)}function Ux(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(r,e||[]),s,n=[];return s={},a("next"),a("throw"),a("return"),s[Symbol.asyncIterator]=function(){return this},s;function a(g){i[g]&&(s[g]=function(v){return new Promise(function(y,b){n.push([g,v,y,b])>1||o(g,v)})})}function o(g,v){try{l(i[g](v))}catch(y){f(n[0][3],y)}}function l(g){g.value instanceof En?Promise.resolve(g.value.v).then(u,h):f(n[0][2],g)}function u(g){o("next",g)}function h(g){o("throw",g)}function f(g,v){g(v),n.shift(),n.length&&o(n[0][0],n[0][1])}}function Gx(r){var e,t;return e={},i("next"),i("throw",function(s){throw s}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(s,n){e[s]=r[s]?function(a){return(t=!t)?{value:En(r[s](a)),done:s==="return"}:n?n(a):a}:n}}function Vx(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Il=="function"?Il(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=r[n]&&function(a){return new Promise(function(o,l){a=r[n](a),s(o,l,a.done,a.value)})}}function s(n,a,o,l){Promise.resolve(l).then(function(u){n({value:u,done:o})},a)}}function jx(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function Hx(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function Kx(r){return r&&r.__esModule?r:{default:r}}function zx(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function Wx(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}const lf=jr(Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Ll},__asyncDelegator:Gx,__asyncGenerator:Ux,__asyncValues:Vx,__await:En,__awaiter:Ox,__classPrivateFieldGet:zx,__classPrivateFieldSet:Wx,__createBinding:Fx,__decorate:Px,__exportStar:Nx,__extends:Ix,__generator:Mx,__importDefault:Kx,__importStar:Hx,__makeTemplateObject:jx,__metadata:Dx,__param:kx,__read:of,__rest:Rx,__spread:Bx,__spreadArrays:$x,__values:Il},Symbol.toStringTag,{value:"Module"})));var wn={},cf;function qx(){if(cf)return wn;cf=1,Object.defineProperty(wn,"__esModule",{value:!0}),wn.AwsCrc32=void 0;var r=lf,e=gn(),t=hf(),i=function(){function s(){this.crc32=new t.Crc32}return s.prototype.update=function(n){(0,e.isEmptyData)(n)||this.crc32.update((0,e.convertToBuffer)(n))},s.prototype.digest=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){return[2,(0,e.numToUint8)(this.crc32.digest())]})})},s.prototype.reset=function(){this.crc32=new t.Crc32},s}();return wn.AwsCrc32=i,wn}var uf;function hf(){return uf||(uf=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.AwsCrc32=r.Crc32=r.crc32=void 0;var e=lf,t=gn();function i(l){return new s().update(l).digest()}r.crc32=i;var s=function(){function l(){this.checksum=4294967295}return l.prototype.update=function(u){var h,f;try{for(var g=e.__values(u),v=g.next();!v.done;v=g.next()){var y=v.value;this.checksum=this.checksum>>>8^a[(this.checksum^y)&255]}}catch(b){h={error:b}}finally{try{v&&!v.done&&(f=g.return)&&f.call(g)}finally{if(h)throw h.error}}return this},l.prototype.digest=function(){return(this.checksum^4294967295)>>>0},l}();r.Crc32=s;var n=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],a=(0,t.uint32ArrayFrom)(n),o=qx();Object.defineProperty(r,"AwsCrc32",{enumerable:!0,get:function(){return o.AwsCrc32}})}(_l)),_l}var df=hf();class Tn{constructor(e){if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const t=new Uint8Array(8);for(let i=7,s=Math.abs(Math.round(e));i>-1&&s>0;i--,s/=256)t[i]=s;return e<0&&ff(t),new Tn(t)}valueOf(){const e=this.bytes.slice(0),t=e[0]&128;return t&&ff(e),parseInt(oi(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}}function ff(r){for(let e=0;e<8;e++)r[e]^=255;for(let e=7;e>-1&&(r[e]++,r[e]===0);e--);}class Yx{constructor(e,t){this.toUtf8=e,this.fromUtf8=t}format(e){const t=[];for(const n of Object.keys(e)){const a=this.fromUtf8(n);t.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(e[n]))}const i=new Uint8Array(t.reduce((n,a)=>n+a.byteLength,0));let s=0;for(const n of t)i.set(n,s),s+=n.byteLength;return i}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":const i=new DataView(new ArrayBuffer(5));return i.setUint8(0,4),i.setInt32(1,e.value,!1),new Uint8Array(i.buffer);case"long":const s=new Uint8Array(9);return s[0]=5,s.set(e.value.bytes,1),s;case"binary":const n=new DataView(new ArrayBuffer(3+e.value.byteLength));n.setUint8(0,6),n.setUint16(1,e.value.byteLength,!1);const a=new Uint8Array(n.buffer);return a.set(e.value,3),a;case"string":const o=this.fromUtf8(e.value),l=new DataView(new ArrayBuffer(3+o.byteLength));l.setUint8(0,7),l.setUint16(1,o.byteLength,!1);const u=new Uint8Array(l.buffer);return u.set(o,3),u;case"timestamp":const h=new Uint8Array(9);return h[0]=8,h.set(Tn.fromNumber(e.value.valueOf()).bytes,1),h;case"uuid":if(!sb.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const f=new Uint8Array(17);return f[0]=9,f.set(Vh(e.value.replace(/\-/g,"")),1),f}}parse(e){const t={};let i=0;for(;i<e.byteLength;){const s=e.getUint8(i++),n=this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+i,s));switch(i+=s,e.getUint8(i++)){case 0:t[n]={type:gf,value:!0};break;case 1:t[n]={type:gf,value:!1};break;case 2:t[n]={type:Xx,value:e.getInt8(i++)};break;case 3:t[n]={type:Qx,value:e.getInt16(i,!1)},i+=2;break;case 4:t[n]={type:Jx,value:e.getInt32(i,!1)},i+=4;break;case 5:t[n]={type:Zx,value:new Tn(new Uint8Array(e.buffer,e.byteOffset+i,8))},i+=8;break;case 6:const a=e.getUint16(i,!1);i+=2,t[n]={type:eb,value:new Uint8Array(e.buffer,e.byteOffset+i,a)},i+=a;break;case 7:const o=e.getUint16(i,!1);i+=2,t[n]={type:tb,value:this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+i,o))},i+=o;break;case 8:t[n]={type:ib,value:new Date(new Tn(new Uint8Array(e.buffer,e.byteOffset+i,8)).valueOf())},i+=8;break;case 9:const l=new Uint8Array(e.buffer,e.byteOffset+i,16);i+=16,t[n]={type:rb,value:`${oi(l.subarray(0,4))}-${oi(l.subarray(4,6))}-${oi(l.subarray(6,8))}-${oi(l.subarray(8,10))}-${oi(l.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return t}}var pf;(function(r){r[r.boolTrue=0]="boolTrue",r[r.boolFalse=1]="boolFalse",r[r.byte=2]="byte",r[r.short=3]="short",r[r.integer=4]="integer",r[r.long=5]="long",r[r.byteArray=6]="byteArray",r[r.string=7]="string",r[r.timestamp=8]="timestamp",r[r.uuid=9]="uuid"})(pf||(pf={}));const gf="boolean",Xx="byte",Qx="short",Jx="integer",Zx="long",eb="binary",tb="string",ib="timestamp",rb="uuid",sb=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,mf=4,Ar=mf*2,qr=4,nb=Ar+qr*2;function ab({byteLength:r,byteOffset:e,buffer:t}){if(r<nb)throw new Error("Provided message too short to accommodate event stream message overhead");const i=new DataView(t,e,r),s=i.getUint32(0,!1);if(r!==s)throw new Error("Reported message length does not match received message length");const n=i.getUint32(mf,!1),a=i.getUint32(Ar,!1),o=i.getUint32(r-qr,!1),l=new df.Crc32().update(new Uint8Array(t,e,Ar));if(a!==l.digest())throw new Error(`The prelude checksum specified in the message (${a}) does not match the calculated CRC32 checksum (${l.digest()})`);if(l.update(new Uint8Array(t,e+Ar,r-(Ar+qr))),o!==l.digest())throw new Error(`The message checksum (${l.digest()}) did not match the expected value of ${o}`);return{headers:new DataView(t,e+Ar+qr,n),body:new Uint8Array(t,e+Ar+qr+n,s-n-(Ar+qr+qr))}}class ob{constructor(e,t){this.headerMarshaller=new Yx(e,t),this.messageBuffer=[],this.isEndOfStream=!1}feed(e){this.messageBuffer.push(this.decode(e))}endOfStream(){this.isEndOfStream=!0}getMessage(){const e=this.messageBuffer.pop(),t=this.isEndOfStream;return{getMessage(){return e},isEndOfStream(){return t}}}getAvailableMessages(){const e=this.messageBuffer;this.messageBuffer=[];const t=this.isEndOfStream;return{getMessages(){return e},isEndOfStream(){return t}}}encode({headers:e,body:t}){const i=this.headerMarshaller.format(e),s=i.byteLength+t.byteLength+16,n=new Uint8Array(s),a=new DataView(n.buffer,n.byteOffset,n.byteLength),o=new df.Crc32;return a.setUint32(0,s,!1),a.setUint32(4,i.byteLength,!1),a.setUint32(8,o.update(n.subarray(0,8)).digest(),!1),n.set(i,12),n.set(t,i.byteLength+12),a.setUint32(s-4,o.update(n.subarray(8,s-4)).digest(),!1),n}decode(e){const{headers:t,body:i}=ab(e);return{headers:this.headerMarshaller.parse(t),body:i}}formatHeaders(e){return this.headerMarshaller.format(e)}}class lb{constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.inputStream)yield this.options.decoder.decode(e)}}class cb{constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.messageStream)yield this.options.encoder.encode(e);this.options.includeEndFrame&&(yield new Uint8Array(0))}}class ub{constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.messageStream){const t=await this.options.deserializer(e);t!==void 0&&(yield t)}}}class hb{constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.inputStream)yield this.options.serializer(e)}}function db(r){let e=0,t=0,i=null,s=null;const n=o=>{if(typeof o!="number")throw new Error("Attempted to allocate an event message where size was not a number: "+o);e=o,t=4,i=new Uint8Array(o),new DataView(i.buffer).setUint32(0,o,!1)},a=async function*(){const o=r[Symbol.asyncIterator]();for(;;){const{value:l,done:u}=await o.next();if(u){if(e)if(e===t)yield i;else throw new Error("Truncated event message received.");else return;return}const h=l.length;let f=0;for(;f<h;){if(!i){const v=h-f;s||(s=new Uint8Array(4));const y=Math.min(4-t,v);if(s.set(l.slice(f,f+y),t),t+=y,f+=y,t<4)break;n(new DataView(s.buffer).getUint32(0,!1)),s=null}const g=Math.min(e-t,h-f);i.set(l.slice(f,f+g),t),t+=g,f+=g,e&&e===t&&(yield i,i=null,e=0,t=0)}}};return{[Symbol.asyncIterator]:a}}function fb(r,e){return async function(t){const{value:i}=t.headers[":message-type"];if(i==="error"){const s=new Error(t.headers[":error-message"].value||"UnknownError");throw s.name=t.headers[":error-code"].value,s}else if(i==="exception"){const s=t.headers[":exception-type"].value,n={[s]:t},a=await r(n);if(a.$unknown){const o=new Error(e(t.body));throw o.name=s,o}throw a[s]}else if(i==="event"){const s={[t.headers[":event-type"].value]:t},n=await r(s);return n.$unknown?void 0:n}else throw Error(`Unrecognizable event type: ${t.headers[":event-type"].value}`)}}let pb=class{constructor({utf8Encoder:e,utf8Decoder:t}){this.eventStreamCodec=new ob(e,t),this.utfEncoder=e}deserialize(e,t){const i=db(e);return new ub({messageStream:new lb({inputStream:i,decoder:this.eventStreamCodec}),deserializer:fb(t,this.utfEncoder)})}serialize(e,t){return new cb({messageStream:new hb({inputStream:e,serializer:t}),encoder:this.eventStreamCodec,includeEndFrame:!0})}};const gb=r=>({[Symbol.asyncIterator]:async function*(){const e=r.getReader();try{for(;;){const{done:t,value:i}=await e.read();if(t)return;yield i}}finally{e.releaseLock()}}}),mb=r=>{const e=r[Symbol.asyncIterator]();return new ReadableStream({async pull(t){const{done:i,value:s}=await e.next();if(i)return t.close();t.enqueue(s)}})};class vb{constructor({utf8Encoder:e,utf8Decoder:t}){this.universalMarshaller=new pb({utf8Decoder:t,utf8Encoder:e})}deserialize(e,t){const i=yb(e)?gb(e):e;return this.universalMarshaller.deserialize(i,t)}serialize(e,t){const i=this.universalMarshaller.serialize(e,t);return typeof ReadableStream=="function"?mb(i):i}}const yb=r=>typeof ReadableStream=="function"&&r instanceof ReadableStream,Sb=r=>new vb(r),vf=r=>()=>Promise.reject(r),yf=typeof TextEncoder=="function"?new TextEncoder:null,Sf=r=>{if(typeof r=="string"){if(yf)return yf.encode(r).byteLength;let e=r.length;for(let t=e-1;t>=0;t--){const i=r.charCodeAt(t);i>127&&i<=2047?e++:i>2047&&i<=65535&&(e+=2),i>=56320&&i<=57343&&t--}return e}else{if(typeof r.byteLength=="number")return r.byteLength;if(typeof r.size=="number")return r.size}throw new Error(`Body Length computation failed for ${r}`)},xf="required",Oe="type",ct="rules",nt="conditions",je="fn",He="argv",ft="ref",An="assign",Fi="url",Ni="properties",Bi="headers",xb=!0,Yr="isSet",Xr="stringEquals",Rl="aws.parseArn",Qr="arn",Yt="booleanEquals",Qt="endpoint",ut="tree",pt="error",vs={[xf]:!1,[Oe]:"String"},bf={[xf]:!0,default:!1,[Oe]:"Boolean"},Pl={[je]:"not",[He]:[{[je]:Yr,[He]:[{[ft]:"Endpoint"}]}]},Ef={[ft]:"Endpoint"},ma={[je]:Yr,[He]:[{[ft]:"Region"}]},va={[je]:"aws.partition",[He]:[{[ft]:"Region"}],[An]:"PartitionResult"},kl={[je]:"not",[He]:[{[je]:Xr,[He]:[{[je]:"getAttr",[He]:[{[ft]:"PartitionResult"},"name"]},"aws-iso"]}]},Dl={[je]:"getAttr",[He]:[{[ft]:"PartitionResult"},"name"]},Ol={[je]:"not",[He]:[{[je]:Xr,[He]:[Dl,"aws-iso-b"]}]},ya={[je]:"getAttr",[He]:[{[ft]:"PartitionResult"},"supportsFIPS"]},pi={},wf={[pt]:"FIPS is enabled but this partition does not support FIPS",[Oe]:pt},Tf={[pt]:"DualStack is enabled but this partition does not support DualStack",[Oe]:pt},Ml={[pt]:"Invalid ARN: Failed to parse ARN.",[Oe]:pt},Af={[je]:Yt,[He]:[!0,{[je]:"getAttr",[He]:[{[ft]:"PartitionResult"},"supportsDualStack"]}]},_f=[{[ft]:"StreamARN"}],bb=[{[je]:Yr,[He]:[Ef]}],Fl=[{[nt]:[{[je]:"isValidHostLabel",[He]:[{[je]:"getAttr",[He]:[{[ft]:Qr},"accountId"]},!1]}],[ct]:[{[nt]:[{[je]:"isValidHostLabel",[He]:[{[je]:"getAttr",[He]:[{[ft]:Qr},"region"]},!1]}],[ct]:[{[nt]:[{[je]:Xr,[He]:[{[je]:"getAttr",[He]:[{[ft]:Qr},"service"]},"kinesis"]}],[ct]:[{[nt]:[{[je]:"getAttr",[He]:[{[ft]:Qr},"resourceId[0]"],[An]:"arnType"},{[je]:"not",[He]:[{[je]:Xr,[He]:[{[ft]:"arnType"},""]}]}],[ct]:[{[nt]:[{[je]:Xr,[He]:[{[ft]:"arnType"},"stream"]}],[ct]:[{[nt]:[{[je]:Xr,[He]:[Dl,"{arn#partition}"]}],[ct]:[{[nt]:[{[je]:Yr,[He]:[{[ft]:"OperationType"}]}],[ct]:[{[nt]:[{[je]:Yt,[He]:[{[ft]:"UseFIPS"},!0]},{[je]:Yt,[He]:[{[ft]:"UseDualStack"},!0]}],[ct]:[{[nt]:[{[je]:Yt,[He]:[ya,!0]}],[ct]:[{[nt]:[{[je]:Yt,[He]:[{[je]:"getAttr",[He]:[{[ft]:"PartitionResult"},"supportsDualStack"]},!0]}],[ct]:[{[Qt]:{[Fi]:"https://{arn#accountId}.{OperationType}-kinesis-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",[Ni]:{},[Bi]:{}},[Oe]:Qt}],[Oe]:ut},{[pt]:"DualStack is enabled, but this partition does not support DualStack.",[Oe]:pt}],[Oe]:ut},{[pt]:"FIPS is enabled, but this partition does not support FIPS.",[Oe]:pt}],[Oe]:ut},{[nt]:[{[je]:Yt,[He]:[{[ft]:"UseFIPS"},!0]}],[ct]:[{[nt]:[{[je]:Yt,[He]:[ya,!0]}],[ct]:[{[Qt]:{[Fi]:"https://{arn#accountId}.{OperationType}-kinesis-fips.{Region}.{PartitionResult#dnsSuffix}",[Ni]:{},[Bi]:{}},[Oe]:Qt}],[Oe]:ut},wf],[Oe]:ut},{[nt]:[{[je]:Yt,[He]:[{[ft]:"UseDualStack"},!0]}],[ct]:[{[nt]:[{[je]:Yt,[He]:[{[je]:"getAttr",[He]:[{[ft]:"PartitionResult"},"supportsDualStack"]},!0]}],[ct]:[{[Qt]:{[Fi]:"https://{arn#accountId}.{OperationType}-kinesis.{Region}.{PartitionResult#dualStackDnsSuffix}",[Ni]:{},[Bi]:{}},[Oe]:Qt}],[Oe]:ut},Tf],[Oe]:ut},{[Qt]:{[Fi]:"https://{arn#accountId}.{OperationType}-kinesis.{Region}.{PartitionResult#dnsSuffix}",[Ni]:{},[Bi]:{}},[Oe]:Qt}],[Oe]:ut},{[pt]:"Operation Type is not set. Please contact service team for resolution.",[Oe]:pt}],[Oe]:ut},{[pt]:"Partition: {arn#partition} from ARN doesn't match with partition name: {PartitionResult#name}.",[Oe]:pt}],[Oe]:ut},{[pt]:"Invalid ARN: Kinesis ARNs don't support `{arnType}` arn types.",[Oe]:pt}],[Oe]:ut},{[pt]:"Invalid ARN: No ARN type specified",[Oe]:pt}],[Oe]:ut},{[pt]:"Invalid ARN: The ARN was not for the Kinesis service, found: {arn#service}.",[Oe]:pt}],[Oe]:ut},{[pt]:"Invalid ARN: Invalid region.",[Oe]:pt}],[Oe]:ut},{[pt]:"Invalid ARN: Invalid account id.",[Oe]:pt}],Eb=[{[je]:Yt,[He]:[{[ft]:"UseFIPS"},!0]},{[je]:Yt,[He]:[{[ft]:"UseDualStack"},!0]}],wb=[{[je]:Yt,[He]:[ya,!0]}],Cf=[{[je]:Yt,[He]:[{[ft]:"UseFIPS"},!0]}],Lf=[{[je]:Yt,[He]:[{[ft]:"UseDualStack"},!0]}],If=[{[ft]:"ConsumerARN"}],Rf=[{[ft]:"ResourceARN"}],Tb={version:"1.0",parameters:{Region:vs,UseDualStack:bf,UseFIPS:bf,Endpoint:vs,StreamARN:vs,OperationType:vs,ConsumerARN:vs,ResourceARN:vs},[ct]:[{[nt]:[{[je]:Yr,[He]:_f},Pl,ma,va,kl,Ol],[ct]:[{[nt]:[{[je]:Rl,[He]:_f,[An]:Qr}],[ct]:Fl,[Oe]:ut},Ml],[Oe]:ut},{[nt]:[{[je]:Yr,[He]:If},Pl,ma,va,kl,Ol],[ct]:[{[nt]:[{[je]:Rl,[He]:If,[An]:Qr}],[ct]:Fl,[Oe]:ut},Ml],[Oe]:ut},{[nt]:[{[je]:Yr,[He]:Rf},Pl,ma,va,kl,Ol],[ct]:[{[nt]:[{[je]:Rl,[He]:Rf,[An]:Qr}],[ct]:Fl,[Oe]:ut},Ml],[Oe]:ut},{[nt]:bb,[ct]:[{[nt]:Cf,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[Oe]:pt},{[nt]:Lf,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[Oe]:pt},{endpoint:{[Fi]:Ef,[Ni]:pi,[Bi]:pi},[Oe]:Qt}],[Oe]:ut},{[nt]:[ma],[ct]:[{[nt]:[va],[ct]:[{[nt]:Eb,[ct]:[{[nt]:[{[je]:Yt,[He]:[xb,ya]},Af],[ct]:[{endpoint:{[Fi]:"https://kinesis-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",[Ni]:pi,[Bi]:pi},[Oe]:Qt}],[Oe]:ut},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",[Oe]:pt}],[Oe]:ut},{[nt]:Cf,[ct]:[{[nt]:wb,[ct]:[{[nt]:[{[je]:Xr,[He]:[Dl,"aws-us-gov"]}],endpoint:{[Fi]:"https://kinesis.{Region}.amazonaws.com",[Ni]:pi,[Bi]:pi},[Oe]:Qt},{endpoint:{[Fi]:"https://kinesis-fips.{Region}.{PartitionResult#dnsSuffix}",[Ni]:pi,[Bi]:pi},[Oe]:Qt}],[Oe]:ut},wf],[Oe]:ut},{[nt]:Lf,[ct]:[{[nt]:[Af],[ct]:[{endpoint:{[Fi]:"https://kinesis.{Region}.{PartitionResult#dualStackDnsSuffix}",[Ni]:pi,[Bi]:pi},[Oe]:Qt}],[Oe]:ut},Tf],[Oe]:ut},{endpoint:{[Fi]:"https://kinesis.{Region}.{PartitionResult#dnsSuffix}",[Ni]:pi,[Bi]:pi},[Oe]:Qt}],[Oe]:ut}],[Oe]:ut},{error:"Invalid Configuration: Missing Region",[Oe]:pt}]},Ab=(r,e={})=>dh(Tb,{endpointParams:r,logger:e.logger});Qs.aws=No;const _b=r=>({apiVersion:"2013-12-02",base64Decoder:(r==null?void 0:r.base64Decoder)??oa,base64Encoder:(r==null?void 0:r.base64Encoder)??Wo,disableHostPrefix:(r==null?void 0:r.disableHostPrefix)??!1,endpointProvider:(r==null?void 0:r.endpointProvider)??Ab,extensions:(r==null?void 0:r.extensions)??[],httpAuthSchemeProvider:(r==null?void 0:r.httpAuthSchemeProvider)??_S,httpAuthSchemes:(r==null?void 0:r.httpAuthSchemes)??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new nd}],logger:(r==null?void 0:r.logger)??new Ko,serviceId:(r==null?void 0:r.serviceId)??"Kinesis",urlParser:(r==null?void 0:r.urlParser)??en,utf8Decoder:(r==null?void 0:r.utf8Decoder)??zr,utf8Encoder:(r==null?void 0:r.utf8Encoder)??zo});class Nl extends Error{constructor(e,t=!0){super(e),this.tryNextLink=t,this.name="ProviderError",Object.setPrototypeOf(this,Nl.prototype)}static from(e,t=!0){return Object.assign(new this(e.message,t),e)}}class ys extends Nl{constructor(e,t=!0){super(e,t),this.tryNextLink=t,this.name="CredentialsProviderError",Object.setPrototypeOf(this,ys.prototype)}}const Cb=(r,e,t)=>{let i,s,n,a=!1;const o=async()=>{s||(s=r());try{i=await s,n=!0,a=!1}finally{s=void 0}return i};return async l=>((!n||l!=null&&l.forceRefresh)&&(i=await o()),i)},Lb=["in-region","cross-region","mobile","standard","legacy"],Pf=({defaultsMode:r}={})=>Cb(async()=>{const e=typeof r=="function"?await r():r;switch(e==null?void 0:e.toLowerCase()){case"auto":return Promise.resolve(Ib()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(e==null?void 0:e.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${Lb.join(", ")}, got ${e}`)}}),Ib=()=>{var t,i;const r=typeof window<"u"&&((t=window==null?void 0:window.navigator)!=null&&t.userAgent)?nf.parse(window.navigator.userAgent):void 0,e=(i=r==null?void 0:r.platform)==null?void 0:i.type;return e==="tablet"||e==="mobile"},Rb=r=>{const e=Pf(r),t=()=>e().then(zh),i=_b(r);return{...i,...r,runtime:"browser",defaultsMode:e,bodyLengthChecker:(r==null?void 0:r.bodyLengthChecker)??Sf,credentialDefaultProvider:(r==null?void 0:r.credentialDefaultProvider)??(s=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:(r==null?void 0:r.defaultUserAgentProvider)??af({serviceId:i.serviceId,clientVersion:RS.version}),eventStreamSerdeProvider:(r==null?void 0:r.eventStreamSerdeProvider)??Sb,maxAttempts:(r==null?void 0:r.maxAttempts)??tn,region:(r==null?void 0:r.region)??vf("Region is missing"),requestHandler:la.create((r==null?void 0:r.requestHandler)??t),retryMode:(r==null?void 0:r.retryMode)??(async()=>(await t()).retryMode||Lh),sha256:(r==null?void 0:r.sha256)??rl.Sha256,streamCollector:(r==null?void 0:r.streamCollector)??Uh,useDualstackEndpoint:(r==null?void 0:r.useDualstackEndpoint)??(()=>Promise.resolve(Sh)),useFipsEndpoint:(r==null?void 0:r.useFipsEndpoint)??(()=>Promise.resolve(xh))}},kf=r=>{let e=async()=>{if(r.region===void 0)throw new Error("Region is missing from runtimeConfig");const t=r.region;return typeof t=="string"?t:t()};return{setRegion(t){e=t},region(){return e}}},Df=r=>({region:r.region()}),Pb=r=>{const e=r.httpAuthSchemes;let t=r.httpAuthSchemeProvider,i=r.credentials;return{setHttpAuthScheme(s){const n=e.findIndex(a=>a.schemeId===s.schemeId);n===-1?e.push(s):e.splice(n,1,s)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(s){t=s},httpAuthSchemeProvider(){return t},setCredentials(s){i=s},credentials(){return i}}},kb=r=>({httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}),Sa=r=>r,Db=(r,e)=>{const t={...Sa(kf(r)),...Sa(Wh(r)),...Sa(zu(r)),...Sa(Pb(r))};return e.forEach(i=>i.configure(t)),{...r,...Df(t),...qh(t),...Wu(t),...kb(t)}};class Ob extends $h{constructor(...[e]){const t=Rb(e||{}),i=LS(t),s=wh(i),n=_h(s),a=Fh(n),o=a,l=sh(o),u=Wy(l),h=CS(u),f=Db(h,(e==null?void 0:e.extensions)||[]);super(f),this.config=f,this.middlewareStack.use(Xh(this.config)),this.middlewareStack.use(td(this.config)),this.middlewareStack.use(Zu(this.config)),this.middlewareStack.use(eh(this.config)),this.middlewareStack.use(rh(this.config)),this.middlewareStack.use(vh(this.config)),this.middlewareStack.use(Ch(this.config,{httpAuthSchemeParametersProvider:this.getDefaultHttpAuthSchemeParametersProvider(),identityProviderConfigProvider:this.getIdentityProviderConfigProvider()})),this.middlewareStack.use(Qh(this.config))}destroy(){super.destroy()}getDefaultHttpAuthSchemeParametersProvider(){return TS}getIdentityProviderConfigProvider(){return async e=>new Jh({"aws.auth#sigv4":e.credentials})}}class Ot extends ha{constructor(e){super(e),Object.setPrototypeOf(this,Ot.prototype)}}class Bl extends Ot{constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,Bl.prototype)}}class $l extends Ot{constructor(e){super({name:"InvalidArgumentException",$fault:"client",...e}),this.name="InvalidArgumentException",this.$fault="client",Object.setPrototypeOf(this,$l.prototype)}}let Mb=class j0 extends Ot{constructor(e){super({name:"LimitExceededException",$fault:"client",...e}),this.name="LimitExceededException",this.$fault="client",Object.setPrototypeOf(this,j0.prototype)}};class Ul extends Ot{constructor(e){super({name:"ResourceInUseException",$fault:"client",...e}),this.name="ResourceInUseException",this.$fault="client",Object.setPrototypeOf(this,Ul.prototype)}}let Fb=class H0 extends Ot{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,H0.prototype)}};class Gl extends Ot{constructor(e){super({name:"ExpiredIteratorException",$fault:"client",...e}),this.name="ExpiredIteratorException",this.$fault="client",Object.setPrototypeOf(this,Gl.prototype)}}class Vl extends Ot{constructor(e){super({name:"ExpiredNextTokenException",$fault:"client",...e}),this.name="ExpiredNextTokenException",this.$fault="client",Object.setPrototypeOf(this,Vl.prototype)}}class jl extends Ot{constructor(e){super({name:"KMSAccessDeniedException",$fault:"client",...e}),this.name="KMSAccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,jl.prototype)}}class Hl extends Ot{constructor(e){super({name:"KMSDisabledException",$fault:"client",...e}),this.name="KMSDisabledException",this.$fault="client",Object.setPrototypeOf(this,Hl.prototype)}}class Kl extends Ot{constructor(e){super({name:"KMSInvalidStateException",$fault:"client",...e}),this.name="KMSInvalidStateException",this.$fault="client",Object.setPrototypeOf(this,Kl.prototype)}}class zl extends Ot{constructor(e){super({name:"KMSNotFoundException",$fault:"client",...e}),this.name="KMSNotFoundException",this.$fault="client",Object.setPrototypeOf(this,zl.prototype)}}class Wl extends Ot{constructor(e){super({name:"KMSOptInRequired",$fault:"client",...e}),this.name="KMSOptInRequired",this.$fault="client",Object.setPrototypeOf(this,Wl.prototype)}}class ql extends Ot{constructor(e){super({name:"KMSThrottlingException",$fault:"client",...e}),this.name="KMSThrottlingException",this.$fault="client",Object.setPrototypeOf(this,ql.prototype)}}class Yl extends Ot{constructor(e){super({name:"ProvisionedThroughputExceededException",$fault:"client",...e}),this.name="ProvisionedThroughputExceededException",this.$fault="client",Object.setPrototypeOf(this,Yl.prototype)}}class Xl extends Ot{constructor(e){super({name:"ValidationException",$fault:"client",...e}),this.name="ValidationException",this.$fault="client",Object.setPrototypeOf(this,Xl.prototype)}}var Of;(function(r){r.visit=(e,t)=>e.SubscribeToShardEvent!==void 0?t.SubscribeToShardEvent(e.SubscribeToShardEvent):e.ResourceNotFoundException!==void 0?t.ResourceNotFoundException(e.ResourceNotFoundException):e.ResourceInUseException!==void 0?t.ResourceInUseException(e.ResourceInUseException):e.KMSDisabledException!==void 0?t.KMSDisabledException(e.KMSDisabledException):e.KMSInvalidStateException!==void 0?t.KMSInvalidStateException(e.KMSInvalidStateException):e.KMSAccessDeniedException!==void 0?t.KMSAccessDeniedException(e.KMSAccessDeniedException):e.KMSNotFoundException!==void 0?t.KMSNotFoundException(e.KMSNotFoundException):e.KMSOptInRequired!==void 0?t.KMSOptInRequired(e.KMSOptInRequired):e.KMSThrottlingException!==void 0?t.KMSThrottlingException(e.KMSThrottlingException):e.InternalFailureException!==void 0?t.InternalFailureException(e.InternalFailureException):t._(e.$unknown[0],e.$unknown[1])})(Of||(Of={}));const Nb=async(r,e)=>{const t=sE("PutRecord");let i;return i=JSON.stringify(tE(r,e)),rE(e,t,"/",void 0,i)},Bb=async(r,e)=>{if(r.statusCode>=300)return $b(r,e);const t=await ga(r.body,e);let i={};return i=st(t),{$metadata:Kt(r),...i}},$b=async(r,e)=>{const t={...r,body:await bd(r.body,e)},i=Ed(r,t.body);switch(i){case"AccessDeniedException":case"com.amazonaws.kinesis#AccessDeniedException":throw await Ub(t);case"InvalidArgumentException":case"com.amazonaws.kinesis#InvalidArgumentException":throw await jb(t);case"LimitExceededException":case"com.amazonaws.kinesis#LimitExceededException":throw await Xb(t);case"ResourceInUseException":case"com.amazonaws.kinesis#ResourceInUseException":throw await Jb(t);case"ResourceNotFoundException":case"com.amazonaws.kinesis#ResourceNotFoundException":throw await Zb(t);case"ExpiredIteratorException":case"com.amazonaws.kinesis#ExpiredIteratorException":throw await Gb(t);case"KMSAccessDeniedException":case"com.amazonaws.kinesis#KMSAccessDeniedException":throw await Hb(t);case"KMSDisabledException":case"com.amazonaws.kinesis#KMSDisabledException":throw await Kb(t);case"KMSInvalidStateException":case"com.amazonaws.kinesis#KMSInvalidStateException":throw await zb(t);case"KMSNotFoundException":case"com.amazonaws.kinesis#KMSNotFoundException":throw await Wb(t);case"KMSOptInRequired":case"com.amazonaws.kinesis#KMSOptInRequired":throw await qb(t);case"KMSThrottlingException":case"com.amazonaws.kinesis#KMSThrottlingException":throw await Yb(t);case"ProvisionedThroughputExceededException":case"com.amazonaws.kinesis#ProvisionedThroughputExceededException":throw await Qb(t);case"ExpiredNextTokenException":case"com.amazonaws.kinesis#ExpiredNextTokenException":throw await Vb(t);case"ValidationException":case"com.amazonaws.kinesis#ValidationException":throw await eE(t);default:const s=t.body;return iE({output:r,parsedBody:s,errorCode:i})}},Ub=async(r,e)=>{const t=r.body,i=st(t),s=new Bl({$metadata:Kt(r),...i});return mt(s,t)},Gb=async(r,e)=>{const t=r.body,i=st(t),s=new Gl({$metadata:Kt(r),...i});return mt(s,t)},Vb=async(r,e)=>{const t=r.body,i=st(t),s=new Vl({$metadata:Kt(r),...i});return mt(s,t)},jb=async(r,e)=>{const t=r.body,i=st(t),s=new $l({$metadata:Kt(r),...i});return mt(s,t)},Hb=async(r,e)=>{const t=r.body,i=st(t),s=new jl({$metadata:Kt(r),...i});return mt(s,t)},Kb=async(r,e)=>{const t=r.body,i=st(t),s=new Hl({$metadata:Kt(r),...i});return mt(s,t)},zb=async(r,e)=>{const t=r.body,i=st(t),s=new Kl({$metadata:Kt(r),...i});return mt(s,t)},Wb=async(r,e)=>{const t=r.body,i=st(t),s=new zl({$metadata:Kt(r),...i});return mt(s,t)},qb=async(r,e)=>{const t=r.body,i=st(t),s=new Wl({$metadata:Kt(r),...i});return mt(s,t)},Yb=async(r,e)=>{const t=r.body,i=st(t),s=new ql({$metadata:Kt(r),...i});return mt(s,t)},Xb=async(r,e)=>{const t=r.body,i=st(t),s=new Mb({$metadata:Kt(r),...i});return mt(s,t)},Qb=async(r,e)=>{const t=r.body,i=st(t),s=new Yl({$metadata:Kt(r),...i});return mt(s,t)},Jb=async(r,e)=>{const t=r.body,i=st(t),s=new Ul({$metadata:Kt(r),...i});return mt(s,t)},Zb=async(r,e)=>{const t=r.body,i=st(t),s=new Fb({$metadata:Kt(r),...i});return mt(s,t)},eE=async(r,e)=>{const t=r.body,i=st(t),s=new Xl({$metadata:Kt(r),...i});return mt(s,t)},tE=(r,e)=>Qo(r,{Data:e.base64Encoder,ExplicitHashKey:[],PartitionKey:[],SequenceNumberForOrdering:[],StreamARN:[],StreamName:[]}),Kt=r=>({httpStatusCode:r.statusCode,requestId:r.headers["x-amzn-requestid"]??r.headers["x-amzn-request-id"]??r.headers["x-amz-request-id"],extendedRequestId:r.headers["x-amz-id-2"],cfId:r.headers["x-amz-cf-id"]}),iE=Kh(Ot),rE=async(r,e,t,i,s)=>{const{hostname:n,protocol:a="https",port:o,path:l}=await r.endpoint(),u={protocol:a,hostname:n,port:o,method:"POST",path:l.endsWith("/")?l.slice(0,-1)+t:l+t,headers:e};return s!==void 0&&(u.body=s),new Ei(u)};function sE(r){return{"content-type":"application/x-amz-json-1.1","x-amz-target":`Kinesis_20131202.${r}`}}class nE extends ca.classBuilder().ep({...IS,OperationType:{type:"staticContextParams",value:"data"},StreamARN:{type:"contextParams",name:"StreamARN"}}).m(function(e,t,i,s){return[Vo(i,this.serialize,this.deserialize),jo(i,e.getEndpointParameterInstructions())]}).s("Kinesis_20131202","PutRecord",{}).n("KinesisClient","PutRecordCommand").f(void 0,void 0).ser(Nb).de(Bb).build(){}function Mf(r){return Promise.all(Object.keys(r).reduce((e,t)=>{const i=r[t];return typeof i=="string"?e.push([t,i]):e.push(i().then(s=>[t,s])),e},[])).then(e=>e.reduce((t,[i,s])=>(t[i]=s,t),{}))}function aE(r){return async()=>{var o,l,u;(o=r.logger)==null||o.debug("@aws-sdk/credential-provider-cognito-identity","fromCognitoIdentity");const{GetCredentialsForIdentityCommand:e,CognitoIdentityClient:t}=await Promise.resolve().then(()=>d0),{Credentials:{AccessKeyId:i=oE(),Expiration:s,SecretKey:n=cE(),SessionToken:a}=lE()}=await(r.client??new t(Object.assign({},r.clientConfig??{},{region:((l=r.clientConfig)==null?void 0:l.region)??((u=r.parentClientConfig)==null?void 0:u.region)}))).send(new e({CustomRoleArn:r.customRoleArn,IdentityId:r.identityId,Logins:r.logins?await Mf(r.logins):void 0}));return{identityId:r.identityId,accessKeyId:i,secretAccessKey:n,sessionToken:a,expiration:s}}}function oE(){throw new ys("Response from Amazon Cognito contained no access key ID")}function lE(){throw new ys("Response from Amazon Cognito contained no credentials")}function cE(){throw new ys("Response from Amazon Cognito contained no secret key")}const Ql="IdentityIds";class uE{constructor(e="aws:cognito-identity-ids"){this.dbName=e}getItem(e){return this.withObjectStore("readonly",t=>{const i=t.get(e);return new Promise(s=>{i.onerror=()=>s(null),i.onsuccess=()=>s(i.result?i.result.value:null)})}).catch(()=>null)}removeItem(e){return this.withObjectStore("readwrite",t=>{const i=t.delete(e);return new Promise((s,n)=>{i.onerror=()=>n(i.error),i.onsuccess=()=>s()})})}setItem(e,t){return this.withObjectStore("readwrite",i=>{const s=i.put({id:e,value:t});return new Promise((n,a)=>{s.onerror=()=>a(s.error),s.onsuccess=()=>n()})})}getDb(){const e=self.indexedDB.open(this.dbName,1);return new Promise((t,i)=>{e.onsuccess=()=>{t(e.result)},e.onerror=()=>{i(e.error)},e.onblocked=()=>{i(new Error("Unable to access DB"))},e.onupgradeneeded=()=>{const s=e.result;s.onerror=()=>{i(new Error("Failed to create object store"))},s.createObjectStore(Ql,{keyPath:"id"})}})}withObjectStore(e,t){return this.getDb().then(i=>{const s=i.transaction(Ql,e);return s.oncomplete=()=>i.close(),new Promise((n,a)=>{s.onerror=()=>a(s.error),n(t(s.objectStore(Ql)))}).catch(n=>{throw i.close(),n})})}}class hE{constructor(e={}){this.store=e}getItem(e){return e in this.store?this.store[e]:null}removeItem(e){delete this.store[e]}setItem(e,t){this.store[e]=t}}const dE=new hE;function fE(){return typeof self=="object"&&self.indexedDB?new uE:typeof window=="object"&&window.localStorage?window.localStorage:dE}function pE({accountId:r,cache:e=fE(),client:t,clientConfig:i,customRoleArn:s,identityPoolId:n,logins:a,userIdentifier:o=!a||Object.keys(a).length===0?"ANONYMOUS":void 0,logger:l,parentClientConfig:u}){l==null||l.debug("@aws-sdk/credential-provider-cognito-identity","fromCognitoIdentity");const h=o?`aws:cognito-identity-credentials:${n}:${o}`:void 0;let f=async()=>{const{GetIdCommand:g,CognitoIdentityClient:v}=await Promise.resolve().then(()=>d0),y=t??new v(Object.assign({},i??{},{region:(i==null?void 0:i.region)??(u==null?void 0:u.region)}));let b=h&&await e.getItem(h);if(!b){const{IdentityId:E=gE()}=await y.send(new g({AccountId:r,IdentityPoolId:n,Logins:a?await Mf(a):void 0}));b=E,h&&Promise.resolve(e.setItem(h,b)).catch(()=>{})}return f=aE({client:y,customRoleArn:s,logins:a,identityId:b}),f()};return()=>f().catch(async g=>{throw h&&Promise.resolve(e.removeItem(h)).catch(()=>{}),g})}function gE(){throw new ys("Response from Amazon Cognito contained no identity ID")}const mE=async(r,e,t)=>({operation:Zs(e).operation,region:await ir(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function vE(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"cognito-identity",region:r.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}function xa(r){return{schemeId:"smithy.api#noAuth"}}const yE=r=>{const e=[];switch(r.operation){case"GetCredentialsForIdentity":{e.push(xa());break}case"GetId":{e.push(xa());break}case"GetOpenIdToken":{e.push(xa());break}case"UnlinkIdentity":{e.push(xa());break}default:e.push(vE(r))}return e},SE=r=>({...xd(r)}),xE=r=>({...r,useDualstackEndpoint:r.useDualstackEndpoint??!1,useFipsEndpoint:r.useFipsEndpoint??!1,defaultSigningName:"cognito-identity"}),Ff={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},bE={name:"@aws-sdk/client-cognito-identity",description:"AWS SDK for JavaScript Cognito Identity Client for Node.js, Browser and React Native",version:"3.582.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-cognito-identity","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo cognito-identity","test:e2e":"ts-mocha test/**/*.ispec.ts && karma start karma.conf.js"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"3.0.0","@aws-crypto/sha256-js":"3.0.0","@aws-sdk/client-sso-oidc":"3.582.0","@aws-sdk/client-sts":"3.582.0","@aws-sdk/core":"3.582.0","@aws-sdk/credential-provider-node":"3.582.0","@aws-sdk/middleware-host-header":"3.577.0","@aws-sdk/middleware-logger":"3.577.0","@aws-sdk/middleware-recursion-detection":"3.577.0","@aws-sdk/middleware-user-agent":"3.577.0","@aws-sdk/region-config-resolver":"3.577.0","@aws-sdk/types":"3.577.0","@aws-sdk/util-endpoints":"3.577.0","@aws-sdk/util-user-agent-browser":"3.577.0","@aws-sdk/util-user-agent-node":"3.577.0","@smithy/config-resolver":"^3.0.0","@smithy/core":"^2.0.1","@smithy/fetch-http-handler":"^3.0.1","@smithy/hash-node":"^3.0.0","@smithy/invalid-dependency":"^3.0.0","@smithy/middleware-content-length":"^3.0.0","@smithy/middleware-endpoint":"^3.0.0","@smithy/middleware-retry":"^3.0.1","@smithy/middleware-serde":"^3.0.0","@smithy/middleware-stack":"^3.0.0","@smithy/node-config-provider":"^3.0.0","@smithy/node-http-handler":"^3.0.0","@smithy/protocol-http":"^4.0.0","@smithy/smithy-client":"^3.0.1","@smithy/types":"^3.0.0","@smithy/url-parser":"^3.0.0","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.1","@smithy/util-defaults-mode-node":"^3.0.1","@smithy/util-endpoints":"^2.0.0","@smithy/util-middleware":"^3.0.0","@smithy/util-retry":"^3.0.0","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@aws-sdk/client-iam":"3.582.0","@tsconfig/node16":"16.1.3","@types/chai":"^4.2.11","@types/mocha":"^8.0.4","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cognito-identity",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-cognito-identity"}},Nf="required",$i="fn",Ui="argv",Ss="ref",Bf=!0,$f="isSet",_n="booleanEquals",xs="error",Cn="endpoint",rr="tree",Jl="PartitionResult",Uf={[Nf]:!1,type:"String"},Gf={[Nf]:!0,default:!1,type:"Boolean"},Vf={[Ss]:"Endpoint"},jf={[$i]:_n,[Ui]:[{[Ss]:"UseFIPS"},!0]},Hf={[$i]:_n,[Ui]:[{[Ss]:"UseDualStack"},!0]},Gi={},Kf={[$i]:"getAttr",[Ui]:[{[Ss]:Jl},"supportsFIPS"]},zf={[$i]:_n,[Ui]:[!0,{[$i]:"getAttr",[Ui]:[{[Ss]:Jl},"supportsDualStack"]}]},Wf=[jf],qf=[Hf],Yf=[{[Ss]:"Region"}],EE={version:"1.0",parameters:{Region:Uf,UseDualStack:Gf,UseFIPS:Gf,Endpoint:Uf},rules:[{conditions:[{[$i]:$f,[Ui]:[Vf]}],rules:[{conditions:Wf,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:xs},{conditions:qf,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:xs},{endpoint:{url:Vf,properties:Gi,headers:Gi},type:Cn}],type:rr},{conditions:[{[$i]:$f,[Ui]:Yf}],rules:[{conditions:[{[$i]:"aws.partition",[Ui]:Yf,assign:Jl}],rules:[{conditions:[jf,Hf],rules:[{conditions:[{[$i]:_n,[Ui]:[Bf,Kf]},zf],rules:[{endpoint:{url:"https://cognito-identity-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Gi,headers:Gi},type:Cn}],type:rr},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:xs}],type:rr},{conditions:Wf,rules:[{conditions:[{[$i]:_n,[Ui]:[Kf,Bf]}],rules:[{endpoint:{url:"https://cognito-identity-fips.{Region}.{PartitionResult#dnsSuffix}",properties:Gi,headers:Gi},type:Cn}],type:rr},{error:"FIPS is enabled but this partition does not support FIPS",type:xs}],type:rr},{conditions:qf,rules:[{conditions:[zf],rules:[{endpoint:{url:"https://cognito-identity.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Gi,headers:Gi},type:Cn}],type:rr},{error:"DualStack is enabled but this partition does not support DualStack",type:xs}],type:rr},{endpoint:{url:"https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}",properties:Gi,headers:Gi},type:Cn}],type:rr}],type:rr},{error:"Invalid Configuration: Missing Region",type:xs}]},wE=(r,e={})=>dh(EE,{endpointParams:r,logger:e.logger});Qs.aws=No;const TE=r=>({apiVersion:"2014-06-30",base64Decoder:(r==null?void 0:r.base64Decoder)??oa,base64Encoder:(r==null?void 0:r.base64Encoder)??Wo,disableHostPrefix:(r==null?void 0:r.disableHostPrefix)??!1,endpointProvider:(r==null?void 0:r.endpointProvider)??wE,extensions:(r==null?void 0:r.extensions)??[],httpAuthSchemeProvider:(r==null?void 0:r.httpAuthSchemeProvider)??yE,httpAuthSchemes:(r==null?void 0:r.httpAuthSchemes)??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new nd},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Hy}],logger:(r==null?void 0:r.logger)??new Ko,serviceId:(r==null?void 0:r.serviceId)??"Cognito Identity",urlParser:(r==null?void 0:r.urlParser)??en,utf8Decoder:(r==null?void 0:r.utf8Decoder)??zr,utf8Encoder:(r==null?void 0:r.utf8Encoder)??zo}),AE=r=>{const e=Pf(r),t=()=>e().then(zh),i=TE(r);return{...i,...r,runtime:"browser",defaultsMode:e,bodyLengthChecker:(r==null?void 0:r.bodyLengthChecker)??Sf,credentialDefaultProvider:(r==null?void 0:r.credentialDefaultProvider)??(s=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:(r==null?void 0:r.defaultUserAgentProvider)??af({serviceId:i.serviceId,clientVersion:bE.version}),maxAttempts:(r==null?void 0:r.maxAttempts)??tn,region:(r==null?void 0:r.region)??vf("Region is missing"),requestHandler:la.create((r==null?void 0:r.requestHandler)??t),retryMode:(r==null?void 0:r.retryMode)??(async()=>(await t()).retryMode||Lh),sha256:(r==null?void 0:r.sha256)??rl.Sha256,streamCollector:(r==null?void 0:r.streamCollector)??Uh,useDualstackEndpoint:(r==null?void 0:r.useDualstackEndpoint)??(()=>Promise.resolve(Sh)),useFipsEndpoint:(r==null?void 0:r.useFipsEndpoint)??(()=>Promise.resolve(xh))}},_E=r=>{const e=r.httpAuthSchemes;let t=r.httpAuthSchemeProvider,i=r.credentials;return{setHttpAuthScheme(s){const n=e.findIndex(a=>a.schemeId===s.schemeId);n===-1?e.push(s):e.splice(n,1,s)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(s){t=s},httpAuthSchemeProvider(){return t},setCredentials(s){i=s},credentials(){return i}}},CE=r=>({httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}),ba=r=>r,LE=(r,e)=>{const t={...ba(kf(r)),...ba(Wh(r)),...ba(zu(r)),...ba(_E(r))};return e.forEach(i=>i.configure(t)),{...r,...Df(t),...qh(t),...Wu(t),...CE(t)}};class Xf extends $h{constructor(...[e]){const t=AE(e||{}),i=xE(t),s=wh(i),n=_h(s),a=Fh(n),o=a,l=sh(o),u=SE(l),h=LE(u,(e==null?void 0:e.extensions)||[]);super(h),this.config=h,this.middlewareStack.use(Xh(this.config)),this.middlewareStack.use(td(this.config)),this.middlewareStack.use(Zu(this.config)),this.middlewareStack.use(eh(this.config)),this.middlewareStack.use(rh(this.config)),this.middlewareStack.use(vh(this.config)),this.middlewareStack.use(Ch(this.config,{httpAuthSchemeParametersProvider:this.getDefaultHttpAuthSchemeParametersProvider(),identityProviderConfigProvider:this.getIdentityProviderConfigProvider()})),this.middlewareStack.use(Qh(this.config))}destroy(){super.destroy()}getDefaultHttpAuthSchemeParametersProvider(){return mE}getIdentityProviderConfigProvider(){return async e=>new Jh({"aws.auth#sigv4":e.credentials})}}class Jt extends ha{constructor(e){super(e),Object.setPrototypeOf(this,Jt.prototype)}}class Zl extends Jt{constructor(e){super({name:"InternalErrorException",$fault:"server",...e}),this.name="InternalErrorException",this.$fault="server",Object.setPrototypeOf(this,Zl.prototype)}}class ec extends Jt{constructor(e){super({name:"InvalidParameterException",$fault:"client",...e}),this.name="InvalidParameterException",this.$fault="client",Object.setPrototypeOf(this,ec.prototype)}}class tc extends Jt{constructor(e){super({name:"LimitExceededException",$fault:"client",...e}),this.name="LimitExceededException",this.$fault="client",Object.setPrototypeOf(this,tc.prototype)}}class ic extends Jt{constructor(e){super({name:"NotAuthorizedException",$fault:"client",...e}),this.name="NotAuthorizedException",this.$fault="client",Object.setPrototypeOf(this,ic.prototype)}}class rc extends Jt{constructor(e){super({name:"ResourceConflictException",$fault:"client",...e}),this.name="ResourceConflictException",this.$fault="client",Object.setPrototypeOf(this,rc.prototype)}}class sc extends Jt{constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),this.name="TooManyRequestsException",this.$fault="client",Object.setPrototypeOf(this,sc.prototype)}}class nc extends Jt{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,nc.prototype)}}class ac extends Jt{constructor(e){super({name:"ExternalServiceException",$fault:"client",...e}),this.name="ExternalServiceException",this.$fault="client",Object.setPrototypeOf(this,ac.prototype)}}class oc extends Jt{constructor(e){super({name:"InvalidIdentityPoolConfigurationException",$fault:"client",...e}),this.name="InvalidIdentityPoolConfigurationException",this.$fault="client",Object.setPrototypeOf(this,oc.prototype)}}class lc extends Jt{constructor(e){super({name:"DeveloperUserAlreadyRegisteredException",$fault:"client",...e}),this.name="DeveloperUserAlreadyRegisteredException",this.$fault="client",Object.setPrototypeOf(this,lc.prototype)}}class cc extends Jt{constructor(e){super({name:"ConcurrentModificationException",$fault:"client",...e}),this.name="ConcurrentModificationException",this.$fault="client",Object.setPrototypeOf(this,cc.prototype)}}const IE=async(r,e)=>{const t=Zf("GetCredentialsForIdentity");let i;return i=JSON.stringify(st(r)),Jf(e,t,"/",void 0,i)},RE=async(r,e)=>{const t=Zf("GetId");let i;return i=JSON.stringify(st(r)),Jf(e,t,"/",void 0,i)},PE=async(r,e)=>{if(r.statusCode>=300)return Qf(r,e);const t=await ga(r.body,e);let i={};return i=KE(t),{$metadata:ci(r),...i}},kE=async(r,e)=>{if(r.statusCode>=300)return Qf(r,e);const t=await ga(r.body,e);let i={};return i=st(t),{$metadata:ci(r),...i}},Qf=async(r,e)=>{const t={...r,body:await bd(r.body,e)},i=Ed(r,t.body);switch(i){case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":throw await FE(t);case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":throw await BE(t);case"LimitExceededException":case"com.amazonaws.cognitoidentity#LimitExceededException":throw await $E(t);case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":throw await UE(t);case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":throw await GE(t);case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":throw await jE(t);case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":throw await VE(t);case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":throw await ME(t);case"InvalidIdentityPoolConfigurationException":case"com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException":throw await NE(t);case"DeveloperUserAlreadyRegisteredException":case"com.amazonaws.cognitoidentity#DeveloperUserAlreadyRegisteredException":throw await OE(t);case"ConcurrentModificationException":case"com.amazonaws.cognitoidentity#ConcurrentModificationException":throw await DE(t);default:const s=t.body;return zE({output:r,parsedBody:s,errorCode:i})}},DE=async(r,e)=>{const t=r.body,i=st(t),s=new cc({$metadata:ci(r),...i});return mt(s,t)},OE=async(r,e)=>{const t=r.body,i=st(t),s=new lc({$metadata:ci(r),...i});return mt(s,t)},ME=async(r,e)=>{const t=r.body,i=st(t),s=new ac({$metadata:ci(r),...i});return mt(s,t)},FE=async(r,e)=>{const t=r.body,i=st(t),s=new Zl({$metadata:ci(r),...i});return mt(s,t)},NE=async(r,e)=>{const t=r.body,i=st(t),s=new oc({$metadata:ci(r),...i});return mt(s,t)},BE=async(r,e)=>{const t=r.body,i=st(t),s=new ec({$metadata:ci(r),...i});return mt(s,t)},$E=async(r,e)=>{const t=r.body,i=st(t),s=new tc({$metadata:ci(r),...i});return mt(s,t)},UE=async(r,e)=>{const t=r.body,i=st(t),s=new ic({$metadata:ci(r),...i});return mt(s,t)},GE=async(r,e)=>{const t=r.body,i=st(t),s=new rc({$metadata:ci(r),...i});return mt(s,t)},VE=async(r,e)=>{const t=r.body,i=st(t),s=new nc({$metadata:ci(r),...i});return mt(s,t)},jE=async(r,e)=>{const t=r.body,i=st(t),s=new sc({$metadata:ci(r),...i});return mt(s,t)},HE=(r,e)=>Qo(r,{AccessKeyId:ua,Expiration:t=>wy(Cy(Yo(t))),SecretKey:ua,SessionToken:ua}),KE=(r,e)=>Qo(r,{Credentials:t=>HE(t),IdentityId:ua}),ci=r=>({httpStatusCode:r.statusCode,requestId:r.headers["x-amzn-requestid"]??r.headers["x-amzn-request-id"]??r.headers["x-amz-request-id"],extendedRequestId:r.headers["x-amz-id-2"],cfId:r.headers["x-amz-cf-id"]}),zE=Kh(Jt),Jf=async(r,e,t,i,s)=>{const{hostname:n,protocol:a="https",port:o,path:l}=await r.endpoint(),u={protocol:a,hostname:n,port:o,method:"POST",path:l.endsWith("/")?l.slice(0,-1)+t:l+t,headers:e};return s!==void 0&&(u.body=s),new Ei(u)};function Zf(r){return{"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityService.${r}`}}class WE extends ca.classBuilder().ep({...Ff}).m(function(e,t,i,s){return[Vo(i,this.serialize,this.deserialize),jo(i,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","GetCredentialsForIdentity",{}).n("CognitoIdentityClient","GetCredentialsForIdentityCommand").f(void 0,void 0).ser(IE).de(PE).build(){}class qE extends ca.classBuilder().ep({...Ff}).m(function(e,t,i,s){return[Vo(i,this.serialize,this.deserialize),jo(i,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","GetId",{}).n("CognitoIdentityClient","GetIdCommand").f(void 0,void 0).ser(RE).de(kE).build(){}const ep={prod:{identityPoolId:"ap-northeast-2:719e14e9-badd-4b73-9496-39303c66cd62",streamName:"brixCloud_analysis_prod"},stage:{identityPoolId:"ap-northeast-2:1df47bbd-2ed8-4edd-9e1d-0474bc52f0af",streamName:"brixCloud_analysis_stage"},dev:{identityPoolId:"ap-northeast-2:1df47bbd-2ed8-4edd-9e1d-0474bc52f0af",streamName:"brixCloud_analysis_dev"}};class YE{constructor({identityPoolId:e,streamName:t}){ta(this,"client");ta(this,"streamName");ta(this,"data",{ua:{s:17,a:6,g:2,o:this.getOS(),b:this.getBrowser()},ts:{tt:0,wt:0,ws:0},di:{},ii:{p:1}});ta(this,"loopId",null);const i=new URLSearchParams(window.location.search);this.client=new Ob({region:"ap-northeast-2",credentials:pE({client:new Xf({region:"ap-northeast-2"}),identityPoolId:e})}),this.streamName=t,this.data.um={s:i.get("utm_source")??void 0}}send(e){var s;const t=JSON.stringify(e??this.data),i=new nE({Data:new TextEncoder().encode(t),PartitionKey:"partitionKey-"+Math.random(),StreamName:this.streamName});(s=window==null?void 0:window.__brix_console)==null||s.call(window,"kinesis send",JSON.parse(t)),this.client.send(i)}sleep(e){return new Promise(t=>setTimeout(t,e))}interval(e,t){return new Promise(i=>{this.loopId=setInterval(()=>{t(e),i()},e)})}timeout(e,t){return new Promise(i=>{this.loopId=setTimeout(()=>{t(e),i()},e)})}getOS(){const e=window.navigator.userAgent.toLowerCase();let t="기타";return e.indexOf("windows")>=0?t="Windows":e.indexOf("iphone")>=0||e.indexOf("ipad")>=0||e.indexOf("ipod")>=0?t="iOS":e.indexOf("mac")>=0?t="macOS":e.indexOf("android")>=0?t="Android":e.indexOf("linux")>=0&&(t="Linux"),["Windows","macOS","iOS","Android","Linux","기타"].indexOf(t)}getBrowser(){const e=window.navigator.userAgent.toLowerCase();let t="기타";return e.indexOf("edg")>=0?t="Edge":e.indexOf("chrome")>=0?t="Chrome":e.indexOf("safari")>=0?t="Safari":e.indexOf("firefox")>=0?t="Firefox":e.indexOf("trident")>=0&&(t="Internet Explorer"),["Chrome","Safari","Firefox","Internet Explorer","Edge","기타"].indexOf(t)}init(){var e;(e=window==null?void 0:window.__brix_console)==null||e.call(window,"kinesis init"),this.data.ii.p=1}async start(){var t,i,s;if(this.loopId&&((t=window==null?void 0:window.__brix_console)==null||t.call(window,"kinesis remove exist start"),clearTimeout(this.loopId),clearInterval(this.loopId)),(i=window==null?void 0:window.__brix_console)==null||i.call(window,"kinesis start"),this.data.ts.wt=new Date().getTime(),this.data.ty==="c"&&!this.data.di.iv){await this.sleep(500),(s=window==null?void 0:window.__brix_console)==null||s.call(window,"require setVodId"),this.stop(),this.init(),this.start();return}const e=n=>{n>1e3&&(this.data.ii.p=0),this.data.ii.i=n;const a=new Date().getTime();this.data.ts.tt=a,this.data.ts.ws=+((a-this.data.ts.wt)/1e3).toFixed(0),this.send()};await this.timeout(1e3,e),await this.timeout(3e3,e),await this.timeout(6e3,e),await this.interval(1e4,e)}stop(){var e;(e=window==null?void 0:window.__brix_console)==null||e.call(window,"kinesis stop"),this.loopId&&(clearTimeout(this.loopId),clearInterval(this.loopId))}sendAnalyze({like:e,comment:t,product:i,share:s,banner:n}){var o;(o=window==null?void 0:window.__brix_console)==null||o.call(window,"kinesis analyze",{like:e,comment:t,product:i,share:s,banner:n});const a={...this.data};e&&(a.cc={lk:e}),t&&(a.cc={c:1}),s&&(a.cc={s:1}),i&&(a.pc={ip:i,tp:this.data.ts.wt}),n&&(a.bc={ib:n,tb:this.data.ts.wt}),this.send(a)}setUser(e,t){var i;(i=window==null?void 0:window.__brix_console)==null||i.call(window,"kinesis setUser",{userId:e,role:t}),this.data.di.iu=e,this.data.di.tu=t===0?"g":"m",this.stop(),this.init(),this.start()}setId(e){var t,i;if((t=window==null?void 0:window.__brix_console)==null||t.call(window,"kinesis setId",{id:e}),!this.data.ty){(i=window==null?void 0:window.__brix_console)==null||i.call(window,"require setType");return}this.data.ty==="b"?(this.data.di.ib=e,delete this.data.di.is,delete this.data.di.icc,delete this.data.di.iugc):this.data.ty==="s"?(this.data.di.is=e,this.data.ii.s="vod",delete this.data.di.ib,delete this.data.di.icc,delete this.data.di.iugc):this.data.ty==="c"?(this.data.di.icc=e,this.data.ii.s="vod",delete this.data.di.ib,delete this.data.di.is,delete this.data.di.iugc):this.data.ty==="u"?(this.data.di.iugc=e,this.data.ii.s="vod",delete this.data.di.ib,delete this.data.di.is,delete this.data.di.icc):this.data.ty==="l"&&(this.data.di.il=e,this.data.ii.s="vod"),this.stop(),this.init(),this.start()}setClientId(e){var t;(t=window==null?void 0:window.__brix_console)==null||t.call(window,"kinesis setClientId",{id:e}),this.data.di.ic=e}setStatus(e){var t;(t=window==null?void 0:window.__brix_console)==null||t.call(window,"kinesis setStatus",{status:e}),this.data.ii.s=e,e==="cancel"&&this.stop()}setType(e){var t;(t=window==null?void 0:window.__brix_console)==null||t.call(window,"kinesis setType",{type:e}),e==="broadcast"?this.data.ty="b":e==="shorts"?this.data.ty="s":e==="channel"?this.data.ty="c":e==="library"?this.data.ty="l":e==="ugc"&&(this.data.ty="u")}setChannelVodId(e){var t;(t=window==null?void 0:window.__brix_console)==null||t.call(window,"kinesis setChannelVodId",{vodId:e}),this.data.di.iv=e,this.init()}setChannelScheduleId(e){var t;(t=window==null?void 0:window.__brix_console)==null||t.call(window,"kinesis setChannelScheduleId",{scheduleId:e}),this.data.di.ics=e}getAPIQuery(){var s;const e=new Date().getTime(),t=+((e-this.data.ts.wt)/1e3).toFixed(0),i={tt:e,ws:t,wt:this.data.ts.wt,p:this.data.ii.p,s:this.data.ii.s};return this.data.ty==="c"?{...i,vodId:this.data.di.iv,ics:this.data.di.ics}:((s=window==null?void 0:window.__brix_console)==null||s.call(window,"kinesis getAPIQuery",{query:i}),i)}}const XE=de.createContext(null);function QE({kinesis:r,children:e}){return We.jsx(XE.Provider,{value:r,children:e})}function JE({element:r,eventName:e,handler:t}){const i=de.useRef();de.useEffect(()=>{i.current=t},[t]),de.useEffect(()=>{if(!(r&&r.addEventListener))return;const s=n=>{i.current&&i.current(n)};return r.addEventListener(e,s),()=>{r.removeEventListener(e,s)}},[e,r])}function tp(r=!1){const[e,t]=de.useState(r);return[e,()=>t(s=>!s)]}function ZE({onClick:r,onDoubleClick:e,time:t=250}){const i=de.useRef(),s=()=>{i.current&&(clearTimeout(i.current),i.current=void 0)};return de.useCallback(a=>{s(),a.detail===1&&(i.current=setTimeout(()=>{r==null||r(a)},t)),a.detail===2&&(e==null||e(a))},[r,e,t])}function ew(r,e=500){const[t,i]=de.useState(r);return de.useEffect(()=>{let s;const n=()=>{i(r)};return(()=>{clearTimeout(s),s=setTimeout(n,e)})(),()=>clearTimeout(s)},[t,r,e]),[t,i]}function tw({ref:r,...e}){const[t,i]=de.useState(!1);return de.useEffect(()=>{const s=r==null?void 0:r.current;if(!s||!window.IntersectionObserver)return;const n=new IntersectionObserver(a=>{if(a.length>0){const o=a[0];i(o.isIntersecting)}},e);return n.observe(s),()=>{n.unobserve(s),n.disconnect()}},[]),t}de.createContext(null),de.forwardRef(function({overlayElement:e,onExit:t},i){const[s,n]=de.useState(!1),a=de.useCallback(()=>n(!1),[]);return de.useImperativeHandle(i,()=>({close:a}),[a]),de.useEffect(()=>{requestAnimationFrame(()=>{n(!0)})},[]),We.jsx(e,{isOpen:s,close:a,exit:t})});const Tt={root:"_root_1det3_1",video:"_video_1det3_10",poster:"_poster_1det3_18",origin_ratio:"_origin_ratio_1det3_27",layer:"_layer_1det3_34",shadow:"_shadow_1det3_40",forward_animation:"_forward_animation_1det3_62",forward:"_forward_1det3_62",backward_animation:"_backward_animation_1det3_66",backward:"_backward_1det3_66",indicator:"_indicator_1det3_70",indicator_right:"_indicator_right_1det3_77",indicator_left:"_indicator_left_1det3_82",progress:"_progress_1det3_88",time:"_time_1det3_96",button:"_button_1det3_109",playbackrate:"_playbackrate_1det3_131",play_toggle:"_play_toggle_1det3_142",chapter_toggle:"_chapter_toggle_1det3_149",chapter_wrap:"_chapter_wrap_1det3_158"};function iw(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ip={exports:{}};(function(r,e){(function(t){var i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,s=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(l,u,h){if(h=h||{},l=l.trim(),u=u.trim(),!u){if(!h.alwaysNormalize)return l;var f=o.parseURL(l);if(!f)throw new Error("Error trying to parse base URL.");return f.path=o.normalizePath(f.path),o.buildURLFromParts(f)}var g=o.parseURL(u);if(!g)throw new Error("Error trying to parse relative URL.");if(g.scheme)return h.alwaysNormalize?(g.path=o.normalizePath(g.path),o.buildURLFromParts(g)):u;var v=o.parseURL(l);if(!v)throw new Error("Error trying to parse base URL.");if(!v.netLoc&&v.path&&v.path[0]!=="/"){var y=s.exec(v.path);v.netLoc=y[1],v.path=y[2]}v.netLoc&&!v.path&&(v.path="/");var b={scheme:v.scheme,netLoc:g.netLoc,path:null,params:g.params,query:g.query,fragment:g.fragment};if(!g.netLoc&&(b.netLoc=v.netLoc,g.path[0]!=="/"))if(!g.path)b.path=v.path,g.params||(b.params=v.params,g.query||(b.query=v.query));else{var E=v.path,A=E.substring(0,E.lastIndexOf("/")+1)+g.path;b.path=o.normalizePath(A)}return b.path===null&&(b.path=h.alwaysNormalize?o.normalizePath(g.path):g.path),o.buildURLFromParts(b)},parseURL:function(l){var u=i.exec(l);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(l){for(l=l.split("").reverse().join("").replace(n,"");l.length!==(l=l.replace(a,"")).length;);return l.split("").reverse().join("")},buildURLFromParts:function(l){return l.scheme+l.netLoc+l.path+l.params+l.query+l.fragment}};r.exports=o})()})(ip);var uc=ip.exports;function rp(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),t.push.apply(t,i)}return t}function Mt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?rp(Object(t),!0).forEach(function(i){nw(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):rp(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function rw(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function sw(r){var e=rw(r,"string");return typeof e=="symbol"?e:String(e)}function nw(r,e,t){return e=sw(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Lt(){return Lt=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},Lt.apply(this,arguments)}const Ie=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},aw=Number.isSafeInteger||function(r){return typeof r=="number"&&Math.abs(r)<=ow},ow=Number.MAX_SAFE_INTEGER||9007199254740991;let C=function(r){return r.MEDIA_ATTACHING="hlsMediaAttaching",r.MEDIA_ATTACHED="hlsMediaAttached",r.MEDIA_DETACHING="hlsMediaDetaching",r.MEDIA_DETACHED="hlsMediaDetached",r.BUFFER_RESET="hlsBufferReset",r.BUFFER_CODECS="hlsBufferCodecs",r.BUFFER_CREATED="hlsBufferCreated",r.BUFFER_APPENDING="hlsBufferAppending",r.BUFFER_APPENDED="hlsBufferAppended",r.BUFFER_EOS="hlsBufferEos",r.BUFFER_FLUSHING="hlsBufferFlushing",r.BUFFER_FLUSHED="hlsBufferFlushed",r.MANIFEST_LOADING="hlsManifestLoading",r.MANIFEST_LOADED="hlsManifestLoaded",r.MANIFEST_PARSED="hlsManifestParsed",r.LEVEL_SWITCHING="hlsLevelSwitching",r.LEVEL_SWITCHED="hlsLevelSwitched",r.LEVEL_LOADING="hlsLevelLoading",r.LEVEL_LOADED="hlsLevelLoaded",r.LEVEL_UPDATED="hlsLevelUpdated",r.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",r.LEVELS_UPDATED="hlsLevelsUpdated",r.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",r.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",r.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",r.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",r.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",r.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",r.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",r.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",r.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",r.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",r.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",r.CUES_PARSED="hlsCuesParsed",r.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",r.INIT_PTS_FOUND="hlsInitPtsFound",r.FRAG_LOADING="hlsFragLoading",r.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",r.FRAG_LOADED="hlsFragLoaded",r.FRAG_DECRYPTED="hlsFragDecrypted",r.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",r.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",r.FRAG_PARSING_METADATA="hlsFragParsingMetadata",r.FRAG_PARSED="hlsFragParsed",r.FRAG_BUFFERED="hlsFragBuffered",r.FRAG_CHANGED="hlsFragChanged",r.FPS_DROP="hlsFpsDrop",r.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",r.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",r.ERROR="hlsError",r.DESTROYING="hlsDestroying",r.KEY_LOADING="hlsKeyLoading",r.KEY_LOADED="hlsKeyLoaded",r.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",r.BACK_BUFFER_REACHED="hlsBackBufferReached",r.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",r}({}),Ve=function(r){return r.NETWORK_ERROR="networkError",r.MEDIA_ERROR="mediaError",r.KEY_SYSTEM_ERROR="keySystemError",r.MUX_ERROR="muxError",r.OTHER_ERROR="otherError",r}({}),ce=function(r){return r.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",r.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",r.KEY_SYSTEM_NO_SESSION="keySystemNoSession",r.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",r.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",r.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",r.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",r.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",r.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",r.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",r.MANIFEST_LOAD_ERROR="manifestLoadError",r.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",r.MANIFEST_PARSING_ERROR="manifestParsingError",r.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",r.LEVEL_EMPTY_ERROR="levelEmptyError",r.LEVEL_LOAD_ERROR="levelLoadError",r.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",r.LEVEL_PARSING_ERROR="levelParsingError",r.LEVEL_SWITCH_ERROR="levelSwitchError",r.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",r.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",r.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",r.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",r.FRAG_LOAD_ERROR="fragLoadError",r.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",r.FRAG_DECRYPT_ERROR="fragDecryptError",r.FRAG_PARSING_ERROR="fragParsingError",r.FRAG_GAP="fragGap",r.REMUX_ALLOC_ERROR="remuxAllocError",r.KEY_LOAD_ERROR="keyLoadError",r.KEY_LOAD_TIMEOUT="keyLoadTimeOut",r.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",r.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",r.BUFFER_APPEND_ERROR="bufferAppendError",r.BUFFER_APPENDING_ERROR="bufferAppendingError",r.BUFFER_STALLED_ERROR="bufferStalledError",r.BUFFER_FULL_ERROR="bufferFullError",r.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",r.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",r.INTERNAL_EXCEPTION="internalException",r.INTERNAL_ABORTED="aborted",r.UNKNOWN="unknown",r}({});const Jr=function(){},hc={trace:Jr,debug:Jr,log:Jr,warn:Jr,info:Jr,error:Jr};let Ln=hc;function lw(r){const e=self.console[r];return e?e.bind(self.console,`[${r}] >`):Jr}function cw(r,...e){e.forEach(function(t){Ln[t]=r[t]?r[t].bind(r):lw(t)})}function uw(r,e){if(typeof console=="object"&&r===!0||typeof r=="object"){cw(r,"debug","log","info","warn","error");try{Ln.log(`Debug logs enabled for "${e}" in hls.js version 1.5.8`)}catch{Ln=hc}}else Ln=hc}const re=Ln,hw=/^(\d+)x(\d+)$/,sp=/(.+?)=(".*?"|.*?)(?:,|$)/g;class bt{constructor(e){typeof e=="string"&&(e=bt.parseAttrList(e)),Lt(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const i=new Uint8Array(t.length/2);for(let s=0;s<t.length/2;s++)i[s]=parseInt(t.slice(s*2,s*2+2),16);return i}else return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const i=this[e];return i?parseFloat(i):t}enumeratedString(e){return this[e]}bool(e){return this[e]==="YES"}decimalResolution(e){const t=hw.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const i={},s='"';for(sp.lastIndex=0;(t=sp.exec(e))!==null;){let n=t[2];n.indexOf(s)===0&&n.lastIndexOf(s)===n.length-1&&(n=n.slice(1,-1));const a=t[1].trim();i[a]=n}return i}}function dw(r){return r!=="ID"&&r!=="CLASS"&&r!=="START-DATE"&&r!=="DURATION"&&r!=="END-DATE"&&r!=="END-ON-NEXT"}function fw(r){return r==="SCTE35-OUT"||r==="SCTE35-IN"}class np{constructor(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){const i=t.attr;for(const s in i)if(Object.prototype.hasOwnProperty.call(e,s)&&e[s]!==i[s]){re.warn(`DATERANGE tag attribute: "${s}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=s;break}e=Lt(new bt({}),i,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const i=new Date(this.attr["END-DATE"]);Ie(i.getTime())&&(this._endDate=i)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return e!==null?new Date(this._startDate.getTime()+e*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(Ie(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&Ie(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class Ea{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var ht={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class ap{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[ht.AUDIO]:null,[ht.VIDEO]:null,[ht.AUDIOVIDEO]:null},this.baseurl=e}setByteRange(e,t){const i=e.split("@",2);let s;i.length===1?s=(t==null?void 0:t.byteRangeEndOffset)||0:s=parseInt(i[1]),this._byteRange=[s,parseInt(i[0])+s]}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=uc.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class dc extends ap{constructor(e,t){super(t),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new Ea,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const i=Object.keys(this.levelkeys);if(i.length===1)return this._decryptdata=this.levelkeys[i[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null||!Ie(this.programDateTime))return null;const e=Ie(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const t=Object.keys(this.levelkeys),i=t.length;if(i>1||i===1&&this.levelkeys[t[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,i,s,n,a=!1){const{elementaryStreams:o}=this,l=o[e];if(!l){o[e]={startPTS:t,endPTS:i,startDTS:s,endDTS:n,partial:a};return}l.startPTS=Math.min(l.startPTS,t),l.endPTS=Math.max(l.endPTS,i),l.startDTS=Math.min(l.startDTS,s),l.endDTS=Math.max(l.endDTS,n)}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[ht.AUDIO]=null,e[ht.VIDEO]=null,e[ht.AUDIOVIDEO]=null}}class pw extends ap{constructor(e,t,i,s,n){super(i),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new Ea,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=s;const a=e.enumeratedString("BYTERANGE");a&&this.setByteRange(a,n),n&&(this.fragOffset=n.fragOffset+n.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}const gw=10;class mw{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,i=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!i||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&i>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return this.fragments.length?Ie(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||gw}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function fc(r){return Uint8Array.from(atob(r),e=>e.charCodeAt(0))}function vw(r){const e=pc(r).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function yw(r){const e=function(i,s,n){const a=i[s];i[s]=i[n],i[n]=a};e(r,0,3),e(r,1,2),e(r,4,5),e(r,6,7)}function Sw(r){const e=r.split(":");let t=null;if(e[0]==="data"&&e.length===2){const i=e[1].split(";"),s=i[i.length-1].split(",");if(s.length===2){const n=s[0]==="base64",a=s[1];n?(i.splice(-1,1),t=fc(a)):t=vw(a)}}return t}function pc(r){return Uint8Array.from(unescape(encodeURIComponent(r)),e=>e.charCodeAt(0))}const bs=typeof self<"u"?self:void 0;var St={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Zt={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function op(r){switch(r){case Zt.FAIRPLAY:return St.FAIRPLAY;case Zt.PLAYREADY:return St.PLAYREADY;case Zt.WIDEVINE:return St.WIDEVINE;case Zt.CLEARKEY:return St.CLEARKEY}}var lp={WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function xw(r){if(r===lp.WIDEVINE)return St.WIDEVINE}function cp(r){switch(r){case St.FAIRPLAY:return Zt.FAIRPLAY;case St.PLAYREADY:return Zt.PLAYREADY;case St.WIDEVINE:return Zt.WIDEVINE;case St.CLEARKEY:return Zt.CLEARKEY}}function gc(r){const{drmSystems:e,widevineLicenseUrl:t}=r,i=e?[St.FAIRPLAY,St.WIDEVINE,St.PLAYREADY,St.CLEARKEY].filter(s=>!!e[s]):[];return!i[St.WIDEVINE]&&t&&i.push(St.WIDEVINE),i}const up=function(r){return bs!=null&&(r=bs.navigator)!=null&&r.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function bw(r,e,t,i){let s;switch(r){case St.FAIRPLAY:s=["cenc","sinf"];break;case St.WIDEVINE:case St.PLAYREADY:s=["cenc"];break;case St.CLEARKEY:s=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${r}`)}return Ew(s,e,t,i)}function Ew(r,e,t,i){return[{initDataTypes:r,persistentState:i.persistentState||"optional",distinctiveIdentifier:i.distinctiveIdentifier||"optional",sessionTypes:i.sessionTypes||[i.sessionType||"temporary"],audioCapabilities:e.map(n=>({contentType:`audio/mp4; codecs="${n}"`,robustness:i.audioRobustness||"",encryptionScheme:i.audioEncryptionScheme||null})),videoCapabilities:t.map(n=>({contentType:`video/mp4; codecs="${n}"`,robustness:i.videoRobustness||"",encryptionScheme:i.videoEncryptionScheme||null}))}]}function Zr(r,e,t){return Uint8Array.prototype.slice?r.slice(e,t):new Uint8Array(Array.prototype.slice.call(r,e,t))}const mc=(r,e)=>e+10<=r.length&&r[e]===73&&r[e+1]===68&&r[e+2]===51&&r[e+3]<255&&r[e+4]<255&&r[e+6]<128&&r[e+7]<128&&r[e+8]<128&&r[e+9]<128,hp=(r,e)=>e+10<=r.length&&r[e]===51&&r[e+1]===68&&r[e+2]===73&&r[e+3]<255&&r[e+4]<255&&r[e+6]<128&&r[e+7]<128&&r[e+8]<128&&r[e+9]<128,In=(r,e)=>{const t=e;let i=0;for(;mc(r,e);){i+=10;const s=wa(r,e+6);i+=s,hp(r,e+10)&&(i+=10),e+=i}if(i>0)return r.subarray(t,t+i)},wa=(r,e)=>{let t=0;return t=(r[e]&127)<<21,t|=(r[e+1]&127)<<14,t|=(r[e+2]&127)<<7,t|=r[e+3]&127,t},ww=(r,e)=>mc(r,e)&&wa(r,e+6)+10<=r.length-e,vc=r=>{const e=fp(r);for(let t=0;t<e.length;t++){const i=e[t];if(dp(i))return Iw(i)}},dp=r=>r&&r.key==="PRIV"&&r.info==="com.apple.streaming.transportStreamTimestamp",Tw=r=>{const e=String.fromCharCode(r[0],r[1],r[2],r[3]),t=wa(r,4),i=10;return{type:e,size:t,data:r.subarray(i,i+t)}},fp=r=>{let e=0;const t=[];for(;mc(r,e);){const i=wa(r,e+6);e+=10;const s=e+i;for(;e+8<s;){const n=Tw(r.subarray(e)),a=Aw(n);a&&t.push(a),e+=n.size+10}hp(r,e)&&(e+=10)}return t},Aw=r=>r.type==="PRIV"?_w(r):r.type[0]==="W"?Lw(r):Cw(r),_w=r=>{if(r.size<2)return;const e=Vi(r.data,!0),t=new Uint8Array(r.data.subarray(e.length+1));return{key:r.type,info:e,data:t.buffer}},Cw=r=>{if(r.size<2)return;if(r.type==="TXXX"){let t=1;const i=Vi(r.data.subarray(t),!0);t+=i.length+1;const s=Vi(r.data.subarray(t));return{key:r.type,info:i,data:s}}const e=Vi(r.data.subarray(1));return{key:r.type,data:e}},Lw=r=>{if(r.type==="WXXX"){if(r.size<2)return;let t=1;const i=Vi(r.data.subarray(t),!0);t+=i.length+1;const s=Vi(r.data.subarray(t));return{key:r.type,info:i,data:s}}const e=Vi(r.data);return{key:r.type,data:e}},Iw=r=>{if(r.data.byteLength===8){const e=new Uint8Array(r.data),t=e[3]&1;let i=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return i/=45,t&&(i+=4772185884e-2),Math.round(i)}},Vi=(r,e=!1)=>{const t=Rw();if(t){const u=t.decode(r);if(e){const h=u.indexOf("\0");return h!==-1?u.substring(0,h):u}return u.replace(/\0/g,"")}const i=r.length;let s,n,a,o="",l=0;for(;l<i;){if(s=r[l++],s===0&&e)return o;if(s===0||s===3)continue;switch(s>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(s);break;case 12:case 13:n=r[l++],o+=String.fromCharCode((s&31)<<6|n&63);break;case 14:n=r[l++],a=r[l++],o+=String.fromCharCode((s&15)<<12|(n&63)<<6|(a&63)<<0);break}}return o};let yc;function Rw(){if(!navigator.userAgent.includes("PlayStation 4"))return!yc&&typeof self.TextDecoder<"u"&&(yc=new self.TextDecoder("utf-8")),yc}const ji={hexDump:function(r){let e="";for(let t=0;t<r.length;t++){let i=r[t].toString(16);i.length<2&&(i="0"+i),e+=i}return e}},Ta=Math.pow(2,32)-1,Pw=[].push,pp={video:1,audio:2,id3:3,text:4};function Pt(r){return String.fromCharCode.apply(null,r)}function gp(r,e){const t=r[e]<<8|r[e+1];return t<0?65536+t:t}function Ne(r,e){const t=vp(r,e);return t<0?4294967296+t:t}function mp(r,e){let t=Ne(r,e);return t*=Math.pow(2,32),t+=Ne(r,e+4),t}function vp(r,e){return r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}function Sc(r,e,t){r[e]=t>>24,r[e+1]=t>>16&255,r[e+2]=t>>8&255,r[e+3]=t&255}function kw(r){const e=r.byteLength;for(let t=0;t<e;){const i=Ne(r,t);if(i>8&&r[t+4]===109&&r[t+5]===111&&r[t+6]===111&&r[t+7]===102)return!0;t=i>1?t+i:e}return!1}function Qe(r,e){const t=[];if(!e.length)return t;const i=r.byteLength;for(let s=0;s<i;){const n=Ne(r,s),a=Pt(r.subarray(s+4,s+8)),o=n>1?s+n:i;if(a===e[0])if(e.length===1)t.push(r.subarray(s+8,o));else{const l=Qe(r.subarray(s+8,o),e.slice(1));l.length&&Pw.apply(t,l)}s=o}return t}function Dw(r){const e=[],t=r[0];let i=8;const s=Ne(r,i);i+=4;let n=0,a=0;t===0?(n=Ne(r,i),a=Ne(r,i+4),i+=8):(n=mp(r,i),a=mp(r,i+8),i+=16),i+=2;let o=r.length+a;const l=gp(r,i);i+=2;for(let u=0;u<l;u++){let h=i;const f=Ne(r,h);h+=4;const g=f&2147483647;if((f&2147483648)>>>31===1)return re.warn("SIDX has hierarchical references (not supported)"),null;const y=Ne(r,h);h+=4,e.push({referenceSize:g,subsegmentDuration:y,info:{duration:y/s,start:o,end:o+g-1}}),o+=g,h+=4,i=h}return{earliestPresentationTime:n,timescale:s,version:t,referencesCount:l,references:e}}function yp(r){const e=[],t=Qe(r,["moov","trak"]);for(let s=0;s<t.length;s++){const n=t[s],a=Qe(n,["tkhd"])[0];if(a){let o=a[0];const l=Ne(a,o===0?12:20),u=Qe(n,["mdia","mdhd"])[0];if(u){o=u[0];const h=Ne(u,o===0?12:20),f=Qe(n,["mdia","hdlr"])[0];if(f){const g=Pt(f.subarray(8,12)),v={soun:ht.AUDIO,vide:ht.VIDEO}[g];if(v){const y=Qe(n,["mdia","minf","stbl","stsd"])[0],b=Ow(y);e[l]={timescale:h,type:v},e[v]=Mt({timescale:h,id:l},b)}}}}}return Qe(r,["moov","mvex","trex"]).forEach(s=>{const n=Ne(s,4),a=e[n];a&&(a.default={duration:Ne(s,12),flags:Ne(s,20)})}),e}function Ow(r){const e=r.subarray(8),t=e.subarray(86),i=Pt(e.subarray(4,8));let s=i;const n=i==="enca"||i==="encv";if(n){const o=Qe(e,[i])[0].subarray(i==="enca"?28:78);Qe(o,["sinf"]).forEach(u=>{const h=Qe(u,["schm"])[0];if(h){const f=Pt(h.subarray(4,8));if(f==="cbcs"||f==="cenc"){const g=Qe(u,["frma"])[0];g&&(s=Pt(g))}}})}switch(s){case"avc1":case"avc2":case"avc3":case"avc4":{const a=Qe(t,["avcC"])[0];s+="."+Aa(a[1])+Aa(a[2])+Aa(a[3]);break}case"mp4a":{const a=Qe(e,[i])[0],o=Qe(a.subarray(28),["esds"])[0];if(o&&o.length>12){let l=4;if(o[l++]!==3)break;l=xc(o,l),l+=2;const u=o[l++];if(u&128&&(l+=2),u&64&&(l+=o[l++]),o[l++]!==4)break;l=xc(o,l);const h=o[l++];if(h===64)s+="."+Aa(h);else break;if(l+=12,o[l++]!==5)break;l=xc(o,l);const f=o[l++];let g=(f&248)>>3;g===31&&(g+=1+((f&7)<<3)+((o[l]&224)>>5)),s+="."+g}break}case"hvc1":case"hev1":{const a=Qe(t,["hvcC"])[0],o=a[1],l=["","A","B","C"][o>>6],u=o&31,h=Ne(a,2),f=(o&32)>>5?"H":"L",g=a[12],v=a.subarray(6,12);s+="."+l+u,s+="."+h.toString(16).toUpperCase(),s+="."+f+g;let y="";for(let b=v.length;b--;){const E=v[b];(E||y)&&(y="."+E.toString(16).toUpperCase()+y)}s+=y;break}case"dvh1":case"dvhe":{const a=Qe(t,["dvcC"])[0],o=a[2]>>1&127,l=a[2]<<5&32|a[3]>>3&31;s+="."+Hi(o)+"."+Hi(l);break}case"vp09":{const a=Qe(t,["vpcC"])[0],o=a[4],l=a[5],u=a[6]>>4&15;s+="."+Hi(o)+"."+Hi(l)+"."+Hi(u);break}case"av01":{const a=Qe(t,["av1C"])[0],o=a[1]>>>5,l=a[1]&31,u=a[2]>>>7?"H":"M",h=(a[2]&64)>>6,f=(a[2]&32)>>5,g=o===2&&h?f?12:10:h?10:8,v=(a[2]&16)>>4,y=(a[2]&8)>>3,b=(a[2]&4)>>2,E=a[2]&3;s+="."+o+"."+Hi(l)+u+"."+Hi(g)+"."+v+"."+y+b+E+"."+Hi(1)+"."+Hi(1)+"."+Hi(1)+"."+0;break}}return{codec:s,encrypted:n}}function xc(r,e){const t=e+5;for(;r[e++]&128&&e<t;);return e}function Aa(r){return("0"+r.toString(16).toUpperCase()).slice(-2)}function Hi(r){return(r<10?"0":"")+r}function Mw(r,e){if(!r||!e)return r;const t=e.keyId;return t&&e.isCommonEncryption&&Qe(r,["moov","trak"]).forEach(s=>{const a=Qe(s,["mdia","minf","stbl","stsd"])[0].subarray(8);let o=Qe(a,["enca"]);const l=o.length>0;l||(o=Qe(a,["encv"])),o.forEach(u=>{const h=l?u.subarray(28):u.subarray(78);Qe(h,["sinf"]).forEach(g=>{const v=Sp(g);if(v){const y=v.subarray(8,24);y.some(b=>b!==0)||(re.log(`[eme] Patching keyId in 'enc${l?"a":"v"}>sinf>>tenc' box: ${ji.hexDump(y)} -> ${ji.hexDump(t)}`),v.set(t,8))}})})}),r}function Sp(r){const e=Qe(r,["schm"])[0];if(e){const t=Pt(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return Qe(r,["schi","tenc"])[0]}return re.error("[eme] missing 'schm' box"),null}function Fw(r,e){return Qe(e,["moof","traf"]).reduce((t,i)=>{const s=Qe(i,["tfdt"])[0],n=s[0],a=Qe(i,["tfhd"]).reduce((o,l)=>{const u=Ne(l,4),h=r[u];if(h){let f=Ne(s,4);if(n===1){if(f===Ta)return re.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),o;f*=Ta+1,f+=Ne(s,8)}const g=h.timescale||9e4,v=f/g;if(Ie(v)&&(o===null||v<o))return v}return o},null);return a!==null&&Ie(a)&&(t===null||a<t)?a:t},null)}function Nw(r,e){let t=0,i=0,s=0;const n=Qe(r,["moof","traf"]);for(let a=0;a<n.length;a++){const o=n[a],l=Qe(o,["tfhd"])[0],u=Ne(l,4),h=e[u];if(!h)continue;const f=h.default,g=Ne(l,0)|(f==null?void 0:f.flags);let v=f==null?void 0:f.duration;g&8&&(g&2?v=Ne(l,12):v=Ne(l,8));const y=h.timescale||9e4,b=Qe(o,["trun"]);for(let E=0;E<b.length;E++){if(t=Bw(b[E]),!t&&v){const A=Ne(b[E],4);t=v*A}h.type===ht.VIDEO?i+=t/y:h.type===ht.AUDIO&&(s+=t/y)}}if(i===0&&s===0){let a=1/0,o=0,l=0;const u=Qe(r,["sidx"]);for(let h=0;h<u.length;h++){const f=Dw(u[h]);if(f!=null&&f.references){a=Math.min(a,f.earliestPresentationTime/f.timescale);const g=f.references.reduce((v,y)=>v+y.info.duration||0,0);o=Math.max(o,g+f.earliestPresentationTime/f.timescale),l=o-a}}if(l&&Ie(l))return l}return i||s}function Bw(r){const e=Ne(r,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let i=0;const s=Ne(r,4);for(let n=0;n<s;n++){if(e&256){const a=Ne(r,t);i+=a,t+=4}e&512&&(t+=4),e&1024&&(t+=4),e&2048&&(t+=4)}return i}function $w(r,e,t){Qe(e,["moof","traf"]).forEach(i=>{Qe(i,["tfhd"]).forEach(s=>{const n=Ne(s,4),a=r[n];if(!a)return;const o=a.timescale||9e4;Qe(i,["tfdt"]).forEach(l=>{const u=l[0],h=t*o;if(h){let f=Ne(l,4);if(u===0)f-=h,f=Math.max(f,0),Sc(l,4,f);else{f*=Math.pow(2,32),f+=Ne(l,8),f-=h,f=Math.max(f,0);const g=Math.floor(f/(Ta+1)),v=Math.floor(f%(Ta+1));Sc(l,4,g),Sc(l,8,v)}}})})})}function Uw(r){const e={valid:null,remainder:null},t=Qe(r,["moof"]);if(t.length<2)return e.remainder=r,e;const i=t[t.length-1];return e.valid=Zr(r,0,i.byteOffset-8),e.remainder=Zr(r,i.byteOffset-8),e}function gi(r,e){const t=new Uint8Array(r.length+e.length);return t.set(r),t.set(e,r.length),t}function xp(r,e){const t=[],i=e.samples,s=e.timescale,n=e.id;let a=!1;return Qe(i,["moof"]).map(l=>{const u=l.byteOffset-8;Qe(l,["traf"]).map(f=>{const g=Qe(f,["tfdt"]).map(v=>{const y=v[0];let b=Ne(v,4);return y===1&&(b*=Math.pow(2,32),b+=Ne(v,8)),b/s})[0];return g!==void 0&&(r=g),Qe(f,["tfhd"]).map(v=>{const y=Ne(v,4),b=Ne(v,0)&16777215,E=(b&1)!==0,A=(b&2)!==0,M=(b&8)!==0;let D=0;const B=(b&16)!==0;let N=0;const J=(b&32)!==0;let Z=8;y===n&&(E&&(Z+=8),A&&(Z+=4),M&&(D=Ne(v,Z),Z+=4),B&&(N=Ne(v,Z),Z+=4),J&&(Z+=4),e.type==="video"&&(a=Gw(e.codec)),Qe(f,["trun"]).map(se=>{const Q=se[0],q=Ne(se,0)&16777215,oe=(q&1)!==0;let me=0;const he=(q&4)!==0,Ee=(q&256)!==0;let we=0;const ue=(q&512)!==0;let ge=0;const Ce=(q&1024)!==0,ve=(q&2048)!==0;let Se=0;const qe=Ne(se,4);let Ue=8;oe&&(me=Ne(se,Ue),Ue+=4),he&&(Ue+=4);let Xe=me+u;for(let it=0;it<qe;it++){if(Ee?(we=Ne(se,Ue),Ue+=4):we=D,ue?(ge=Ne(se,Ue),Ue+=4):ge=N,Ce&&(Ue+=4),ve&&(Q===0?Se=Ne(se,Ue):Se=vp(se,Ue),Ue+=4),e.type===ht.VIDEO){let et=0;for(;et<ge;){const lt=Ne(i,Xe);if(Xe+=4,Vw(a,i[Xe])){const Je=i.subarray(Xe,Xe+lt);bp(Je,a?2:1,r+Se/s,t)}Xe+=lt,et+=lt+4}}r+=we/s}}))})})}),t}function Gw(r){if(!r)return!1;const e=r.indexOf("."),t=e<0?r:r.substring(0,e);return t==="hvc1"||t==="hev1"||t==="dvh1"||t==="dvhe"}function Vw(r,e){if(r){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function bp(r,e,t,i){const s=Ep(r);let n=0;n+=e;let a=0,o=0,l=0;for(;n<s.length;){a=0;do{if(n>=s.length)break;l=s[n++],a+=l}while(l===255);o=0;do{if(n>=s.length)break;l=s[n++],o+=l}while(l===255);const u=s.length-n;let h=n;if(o<u)n+=o;else if(o>u){re.error(`Malformed SEI payload. ${o} is too small, only ${u} bytes left to parse.`);break}if(a===4){if(s[h++]===181){const g=gp(s,h);if(h+=2,g===49){const v=Ne(s,h);if(h+=4,v===1195456820){const y=s[h++];if(y===3){const b=s[h++],E=31&b,A=64&b,M=A?2+E*3:0,D=new Uint8Array(M);if(A){D[0]=b;for(let B=1;B<M;B++)D[B]=s[h++]}i.push({type:y,payloadType:a,pts:t,bytes:D})}}}}}else if(a===5&&o>16){const f=[];for(let y=0;y<16;y++){const b=s[h++].toString(16);f.push(b.length==1?"0"+b:b),(y===3||y===5||y===7||y===9)&&f.push("-")}const g=o-16,v=new Uint8Array(g);for(let y=0;y<g;y++)v[y]=s[h++];i.push({payloadType:a,pts:t,uuid:f.join(""),userData:Vi(v),userDataBytes:v})}}}function Ep(r){const e=r.byteLength,t=[];let i=1;for(;i<e-2;)r[i]===0&&r[i+1]===0&&r[i+2]===3?(t.push(i+2),i+=2):i++;if(t.length===0)return r;const s=e-t.length,n=new Uint8Array(s);let a=0;for(i=0;i<s;a++,i++)a===t[0]&&(a++,t.shift()),n[i]=r[a];return n}function jw(r){const e=r[0];let t="",i="",s=0,n=0,a=0,o=0,l=0,u=0;if(e===0){for(;Pt(r.subarray(u,u+1))!=="\0";)t+=Pt(r.subarray(u,u+1)),u+=1;for(t+=Pt(r.subarray(u,u+1)),u+=1;Pt(r.subarray(u,u+1))!=="\0";)i+=Pt(r.subarray(u,u+1)),u+=1;i+=Pt(r.subarray(u,u+1)),u+=1,s=Ne(r,12),n=Ne(r,16),o=Ne(r,20),l=Ne(r,24),u=28}else if(e===1){u+=4,s=Ne(r,u),u+=4;const f=Ne(r,u);u+=4;const g=Ne(r,u);for(u+=4,a=2**32*f+g,aw(a)||(a=Number.MAX_SAFE_INTEGER,re.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=Ne(r,u),u+=4,l=Ne(r,u),u+=4;Pt(r.subarray(u,u+1))!=="\0";)t+=Pt(r.subarray(u,u+1)),u+=1;for(t+=Pt(r.subarray(u,u+1)),u+=1;Pt(r.subarray(u,u+1))!=="\0";)i+=Pt(r.subarray(u,u+1)),u+=1;i+=Pt(r.subarray(u,u+1)),u+=1}const h=r.subarray(u,r.byteLength);return{schemeIdUri:t,value:i,timeScale:s,presentationTime:a,presentationTimeDelta:n,eventDuration:o,id:l,payload:h}}function Hw(r,...e){const t=e.length;let i=8,s=t;for(;s--;)i+=e[s].byteLength;const n=new Uint8Array(i);for(n[0]=i>>24&255,n[1]=i>>16&255,n[2]=i>>8&255,n[3]=i&255,n.set(r,4),s=0,i=8;s<t;s++)n.set(e[s],i),i+=e[s].byteLength;return n}function Kw(r,e,t){if(r.byteLength!==16)throw new RangeError("Invalid system id");let i,s;i=0,s=new Uint8Array;let n;i>0?(n=new Uint8Array(4),e.length>0&&new DataView(n.buffer).setUint32(0,e.length,!1)):n=new Uint8Array;const a=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(a.buffer).setUint32(0,t.byteLength,!1),Hw([112,115,115,104],new Uint8Array([i,0,0,0]),r,n,s,a,t||new Uint8Array)}function zw(r){if(!(r instanceof ArrayBuffer)||r.byteLength<32)return null;const e={version:0,systemId:"",kids:null,data:null},t=new DataView(r),i=t.getUint32(0);if(r.byteLength!==i&&i>44||t.getUint32(4)!==1886614376||(e.version=t.getUint32(8)>>>24,e.version>1))return null;e.systemId=ji.hexDump(new Uint8Array(r,12,16));const n=t.getUint32(28);if(e.version===0){if(i-32<n)return null;e.data=new Uint8Array(r,32,n)}else if(e.version===1){e.kids=[];for(let a=0;a<n;a++)e.kids.push(new Uint8Array(r,32+a*16,16))}return e}let _a={};class Rn{static clearKeyUriToKeyIdMap(){_a={}}constructor(e,t,i,s=[1],n=null){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=i,this.keyFormatVersions=s,this.iv=n,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&e!=="AES-128"}isSupported(){if(this.method){if(this.method==="AES-128"||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case Zt.FAIRPLAY:case Zt.WIDEVINE:case Zt.PLAYREADY:case Zt.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if(this.method==="AES-128"&&this.uri&&!this.iv){typeof e!="number"&&(this.method==="AES-128"&&!this.iv&&re.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const i=Ww(e);return new Rn(this.method,this.uri,"identity",this.keyFormatVersions,i)}const t=Sw(this.uri);if(t)switch(this.keyFormat){case Zt.WIDEVINE:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case Zt.PLAYREADY:{const i=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=Kw(i,null,t);const s=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),n=String.fromCharCode.apply(null,Array.from(s)),a=n.substring(n.indexOf("<"),n.length),u=new DOMParser().parseFromString(a,"text/xml").getElementsByTagName("KID")[0];if(u){const h=u.childNodes[0]?u.childNodes[0].nodeValue:u.getAttribute("VALUE");if(h){const f=fc(h).subarray(0,16);yw(f),this.keyId=f}}break}default:{let i=t.subarray(0,16);if(i.length!==16){const s=new Uint8Array(16);s.set(i,16-i.length),i=s}this.keyId=i;break}}if(!this.keyId||this.keyId.byteLength!==16){let i=_a[this.uri];if(!i){const s=Object.keys(_a).length%Number.MAX_SAFE_INTEGER;i=new Uint8Array(16),new DataView(i.buffer,12,4).setUint32(0,s),_a[this.uri]=i}this.keyId=i}return this}}function Ww(r){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=r>>8*(15-t)&255;return e}const wp=/\{\$([a-zA-Z0-9-_]+)\}/g;function Tp(r){return wp.test(r)}function ei(r,e,t){if(r.variableList!==null||r.hasVariableRefs)for(let i=t.length;i--;){const s=t[i],n=e[s];n&&(e[s]=bc(r,n))}}function bc(r,e){if(r.variableList!==null||r.hasVariableRefs){const t=r.variableList;return e.replace(wp,i=>{const s=i.substring(2,i.length-1),n=t==null?void 0:t[s];return n===void 0?(r.playlistParsingError||(r.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${s}"`)),i):n})}return e}function Ap(r,e,t){let i=r.variableList;i||(r.variableList=i={});let s,n;if("QUERYPARAM"in e){s=e.QUERYPARAM;try{const a=new self.URL(t).searchParams;if(a.has(s))n=a.get(s);else throw new Error(`"${s}" does not match any query parameter in URI: "${t}"`)}catch(a){r.playlistParsingError||(r.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${a.message}`))}}else s=e.NAME,n=e.VALUE;s in i?r.playlistParsingError||(r.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${s}"`)):i[s]=n||""}function qw(r,e,t){const i=e.IMPORT;if(t&&i in t){let s=r.variableList;s||(r.variableList=s={}),s[i]=t[i]}else r.playlistParsingError||(r.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${i}"`))}function es(r=!0){return typeof self>"u"?void 0:(r||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Yw(r){return typeof self<"u"&&r===self.ManagedMediaSource}const Ca={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function Xw(r,e){const t=Ca[e];return!!t&&!!t[r.slice(0,4)]}function Ec(r,e,t=!0){return!r.split(",").some(i=>!_p(i,e,t))}function _p(r,e,t=!0){var i;const s=es(t);return(i=s==null?void 0:s.isTypeSupported(Pn(r,e)))!=null?i:!1}function Pn(r,e){return`${e}/mp4;codecs="${r}"`}function Cp(r){if(r){const e=r.substring(0,4);return Ca.video[e]}return 2}function La(r){return r.split(",").reduce((e,t)=>{const i=Ca.video[t];return i?(i*2+e)/(e?3:2):(Ca.audio[t]+e)/(e?2:1)},0)}const wc={};function Qw(r,e=!0){if(wc[r])return wc[r];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[r];for(let i=0;i<t.length;i++)if(_p(t[i],"audio",e))return wc[r]=t[i],t[i];return r}const Jw=/flac|opus/i;function Ia(r,e=!0){return r.replace(Jw,t=>Qw(t.toLowerCase(),e))}function Lp(r,e){return r&&r!=="mp4a"?r:e&&e.split(",")[0]}function Zw(r){const e=r.split(".");if(e.length>2){let t=e.shift()+".";return t+=parseInt(e.shift()).toString(16),t+=("000"+parseInt(e.shift()).toString(16)).slice(-4),t}return r}const Ip=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,Rp=/#EXT-X-MEDIA:(.*)/g,eT=/^#EXT(?:INF|-X-TARGETDURATION):/m,Pp=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),tT=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class Ki{static findGroup(e,t){for(let i=0;i<e.length;i++){const s=e[i];if(s.id===t)return s}}static resolve(e,t){return uc.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return eT.test(e)}static parseMasterPlaylist(e,t){const i=Tp(e),s={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:i},n=[];Ip.lastIndex=0;let a;for(;(a=Ip.exec(e))!=null;)if(a[1]){var o;const u=new bt(a[1]);ei(s,u,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);const h=bc(s,a[2]),f={attrs:u,bitrate:u.decimalInteger("BANDWIDTH")||u.decimalInteger("AVERAGE-BANDWIDTH"),name:u.NAME,url:Ki.resolve(h,t)},g=u.decimalResolution("RESOLUTION");g&&(f.width=g.width,f.height=g.height),iT(u.CODECS,f),(o=f.unknownCodecs)!=null&&o.length||n.push(f),s.levels.push(f)}else if(a[3]){const u=a[3],h=a[4];switch(u){case"SESSION-DATA":{const f=new bt(h);ei(s,f,["DATA-ID","LANGUAGE","VALUE","URI"]);const g=f["DATA-ID"];g&&(s.sessionData===null&&(s.sessionData={}),s.sessionData[g]=f);break}case"SESSION-KEY":{const f=kp(h,t,s);f.encrypted&&f.isSupported()?(s.sessionKeys===null&&(s.sessionKeys=[]),s.sessionKeys.push(f)):re.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${h}"`);break}case"DEFINE":{{const f=new bt(h);ei(s,f,["NAME","VALUE","QUERYPARAM"]),Ap(s,f,t)}break}case"CONTENT-STEERING":{const f=new bt(h);ei(s,f,["SERVER-URI","PATHWAY-ID"]),s.contentSteering={uri:Ki.resolve(f["SERVER-URI"],t),pathwayId:f["PATHWAY-ID"]||"."};break}case"START":{s.startTimeOffset=Dp(h);break}}}const l=n.length>0&&n.length<s.levels.length;return s.levels=l?n:s.levels,s.levels.length===0&&(s.playlistParsingError=new Error("no levels found in manifest")),s}static parseMasterPlaylistMedia(e,t,i){let s;const n={},a=i.levels,o={AUDIO:a.map(u=>({id:u.attrs.AUDIO,audioCodec:u.audioCodec})),SUBTITLES:a.map(u=>({id:u.attrs.SUBTITLES,textCodec:u.textCodec})),"CLOSED-CAPTIONS":[]};let l=0;for(Rp.lastIndex=0;(s=Rp.exec(e))!==null;){const u=new bt(s[1]),h=u.TYPE;if(h){const f=o[h],g=n[h]||[];n[h]=g,ei(i,u,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const v=u.LANGUAGE,y=u["ASSOC-LANGUAGE"],b=u.CHANNELS,E=u.CHARACTERISTICS,A=u["INSTREAM-ID"],M={attrs:u,bitrate:0,id:l++,groupId:u["GROUP-ID"]||"",name:u.NAME||v||"",type:h,default:u.bool("DEFAULT"),autoselect:u.bool("AUTOSELECT"),forced:u.bool("FORCED"),lang:v,url:u.URI?Ki.resolve(u.URI,t):""};if(y&&(M.assocLang=y),b&&(M.channels=b),E&&(M.characteristics=E),A&&(M.instreamId=A),f!=null&&f.length){const D=Ki.findGroup(f,M.groupId)||f[0];Op(M,D,"audioCodec"),Op(M,D,"textCodec")}g.push(M)}}return n}static parseLevelPlaylist(e,t,i,s,n,a){const o=new mw(t),l=o.fragments;let u=null,h=0,f=0,g=0,v=0,y=null,b=new dc(s,t),E,A,M,D=-1,B=!1,N=null;for(Pp.lastIndex=0,o.m3u8=e,o.hasVariableRefs=Tp(e);(E=Pp.exec(e))!==null;){B&&(B=!1,b=new dc(s,t),b.start=g,b.sn=h,b.cc=v,b.level=i,u&&(b.initSegment=u,b.rawProgramDateTime=u.rawProgramDateTime,u.rawProgramDateTime=null,N&&(b.setByteRange(N),N=null)));const Q=E[1];if(Q){b.duration=parseFloat(Q);const q=(" "+E[2]).slice(1);b.title=q||null,b.tagList.push(q?["INF",Q,q]:["INF",Q])}else if(E[3]){if(Ie(b.duration)){b.start=g,M&&Np(b,M,o),b.sn=h,b.level=i,b.cc=v,l.push(b);const q=(" "+E[3]).slice(1);b.relurl=bc(o,q),Mp(b,y),y=b,g+=b.duration,h++,f=0,B=!0}}else if(E[4]){const q=(" "+E[4]).slice(1);y?b.setByteRange(q,y):b.setByteRange(q)}else if(E[5])b.rawProgramDateTime=(" "+E[5]).slice(1),b.tagList.push(["PROGRAM-DATE-TIME",b.rawProgramDateTime]),D===-1&&(D=l.length);else{if(E=E[0].match(tT),!E){re.warn("No matches on slow regex match for level playlist!");continue}for(A=1;A<E.length&&!(typeof E[A]<"u");A++);const q=(" "+E[A]).slice(1),oe=(" "+E[A+1]).slice(1),me=E[A+2]?(" "+E[A+2]).slice(1):"";switch(q){case"PLAYLIST-TYPE":o.type=oe.toUpperCase();break;case"MEDIA-SEQUENCE":h=o.startSN=parseInt(oe);break;case"SKIP":{const he=new bt(oe);ei(o,he,["RECENTLY-REMOVED-DATERANGES"]);const Ee=he.decimalInteger("SKIPPED-SEGMENTS");if(Ie(Ee)){o.skippedSegments=Ee;for(let ue=Ee;ue--;)l.unshift(null);h+=Ee}const we=he.enumeratedString("RECENTLY-REMOVED-DATERANGES");we&&(o.recentlyRemovedDateranges=we.split(" "));break}case"TARGETDURATION":o.targetduration=Math.max(parseInt(oe),1);break;case"VERSION":o.version=parseInt(oe);break;case"INDEPENDENT-SEGMENTS":case"EXTM3U":break;case"ENDLIST":o.live=!1;break;case"#":(oe||me)&&b.tagList.push(me?[oe,me]:[oe]);break;case"DISCONTINUITY":v++,b.tagList.push(["DIS"]);break;case"GAP":b.gap=!0,b.tagList.push([q]);break;case"BITRATE":b.tagList.push([q,oe]);break;case"DATERANGE":{const he=new bt(oe);ei(o,he,["ID","CLASS","START-DATE","END-DATE","SCTE35-CMD","SCTE35-OUT","SCTE35-IN"]),ei(o,he,he.clientAttrs);const Ee=new np(he,o.dateRanges[he.ID]);Ee.isValid||o.skippedSegments?o.dateRanges[Ee.id]=Ee:re.warn(`Ignoring invalid DATERANGE tag: "${oe}"`),b.tagList.push(["EXT-X-DATERANGE",oe]);break}case"DEFINE":{{const he=new bt(oe);ei(o,he,["NAME","VALUE","IMPORT","QUERYPARAM"]),"IMPORT"in he?qw(o,he,a):Ap(o,he,t)}break}case"DISCONTINUITY-SEQUENCE":v=parseInt(oe);break;case"KEY":{const he=kp(oe,t,o);if(he.isSupported()){if(he.method==="NONE"){M=void 0;break}M||(M={}),M[he.keyFormat]&&(M=Lt({},M)),M[he.keyFormat]=he}else re.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${oe}"`);break}case"START":o.startTimeOffset=Dp(oe);break;case"MAP":{const he=new bt(oe);if(ei(o,he,["BYTERANGE","URI"]),b.duration){const Ee=new dc(s,t);Fp(Ee,he,i,M),u=Ee,b.initSegment=u,u.rawProgramDateTime&&!b.rawProgramDateTime&&(b.rawProgramDateTime=u.rawProgramDateTime)}else{const Ee=b.byteRangeEndOffset;if(Ee){const we=b.byteRangeStartOffset;N=`${Ee-we}@${we}`}else N=null;Fp(b,he,i,M),u=b,B=!0}break}case"SERVER-CONTROL":{const he=new bt(oe);o.canBlockReload=he.bool("CAN-BLOCK-RELOAD"),o.canSkipUntil=he.optionalFloat("CAN-SKIP-UNTIL",0),o.canSkipDateRanges=o.canSkipUntil>0&&he.bool("CAN-SKIP-DATERANGES"),o.partHoldBack=he.optionalFloat("PART-HOLD-BACK",0),o.holdBack=he.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const he=new bt(oe);o.partTarget=he.decimalFloatingPoint("PART-TARGET");break}case"PART":{let he=o.partList;he||(he=o.partList=[]);const Ee=f>0?he[he.length-1]:void 0,we=f++,ue=new bt(oe);ei(o,ue,["BYTERANGE","URI"]);const ge=new pw(ue,b,t,we,Ee);he.push(ge),b.duration+=ge.duration;break}case"PRELOAD-HINT":{const he=new bt(oe);ei(o,he,["URI"]),o.preloadHint=he;break}case"RENDITION-REPORT":{const he=new bt(oe);ei(o,he,["URI"]),o.renditionReports=o.renditionReports||[],o.renditionReports.push(he);break}default:re.warn(`line parsed but not handled: ${E}`);break}}}y&&!y.relurl?(l.pop(),g-=y.duration,o.partList&&(o.fragmentHint=y)):o.partList&&(Mp(b,y),b.cc=v,o.fragmentHint=b,M&&Np(b,M,o));const J=l.length,Z=l[0],se=l[J-1];if(g+=o.skippedSegments*o.targetduration,g>0&&J&&se){o.averagetargetduration=g/J;const Q=se.sn;o.endSN=Q!=="initSegment"?Q:0,o.live||(se.endList=!0),Z&&(o.startCC=Z.cc)}else o.endSN=0,o.startCC=0;return o.fragmentHint&&(g+=o.fragmentHint.duration),o.totalduration=g,o.endCC=v,D>0&&rT(l,D),o}}function kp(r,e,t){var i,s;const n=new bt(r);ei(t,n,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const a=(i=n.METHOD)!=null?i:"",o=n.URI,l=n.hexadecimalInteger("IV"),u=n.KEYFORMATVERSIONS,h=(s=n.KEYFORMAT)!=null?s:"identity";o&&n.IV&&!l&&re.error(`Invalid IV: ${n.IV}`);const f=o?Ki.resolve(o,e):"",g=(u||"1").split("/").map(Number).filter(Number.isFinite);return new Rn(a,f,h,g,l)}function Dp(r){const t=new bt(r).decimalFloatingPoint("TIME-OFFSET");return Ie(t)?t:null}function iT(r,e){let t=(r||"").split(/[ ,]+/).filter(i=>i);["video","audio","text"].forEach(i=>{const s=t.filter(n=>Xw(n,i));s.length&&(e[`${i}Codec`]=s.join(","),t=t.filter(n=>s.indexOf(n)===-1))}),e.unknownCodecs=t}function Op(r,e,t){const i=e[t];i&&(r[t]=i)}function rT(r,e){let t=r[e];for(let i=e;i--;){const s=r[i];if(!s)return;s.programDateTime=t.programDateTime-s.duration*1e3,t=s}}function Mp(r,e){r.rawProgramDateTime?r.programDateTime=Date.parse(r.rawProgramDateTime):e!=null&&e.programDateTime&&(r.programDateTime=e.endProgramDateTime),Ie(r.programDateTime)||(r.programDateTime=null,r.rawProgramDateTime=null)}function Fp(r,e,t,i){r.relurl=e.URI,e.BYTERANGE&&r.setByteRange(e.BYTERANGE),r.level=t,r.sn="initSegment",i&&(r.levelkeys=i),r.initSegment=null}function Np(r,e,t){r.levelkeys=e;const{encryptedFragments:i}=t;(!i.length||i[i.length-1].levelkeys!==e)&&Object.keys(e).some(s=>e[s].isCommonEncryption)&&i.push(r)}var rt={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},$e={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function Bp(r){const{type:e}=r;switch(e){case rt.AUDIO_TRACK:return $e.AUDIO;case rt.SUBTITLE_TRACK:return $e.SUBTITLE;default:return $e.MAIN}}function Tc(r,e){let t=r.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class sT{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(C.MANIFEST_LOADING,this.onManifestLoading,this),e.on(C.LEVEL_LOADING,this.onLevelLoading,this),e.on(C.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(C.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(C.MANIFEST_LOADING,this.onManifestLoading,this),e.off(C.LEVEL_LOADING,this.onLevelLoading,this),e.off(C.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(C.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const t=this.hls.config,i=t.pLoader,s=t.loader,n=i||s,a=new n(t);return this.loaders[e.type]=a,a}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:i}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:rt.MANIFEST,url:i,deliveryDirectives:null})}onLevelLoading(e,t){const{id:i,level:s,pathwayId:n,url:a,deliveryDirectives:o}=t;this.load({id:i,level:s,pathwayId:n,responseType:"text",type:rt.LEVEL,url:a,deliveryDirectives:o})}onAudioTrackLoading(e,t){const{id:i,groupId:s,url:n,deliveryDirectives:a}=t;this.load({id:i,groupId:s,level:null,responseType:"text",type:rt.AUDIO_TRACK,url:n,deliveryDirectives:a})}onSubtitleTrackLoading(e,t){const{id:i,groupId:s,url:n,deliveryDirectives:a}=t;this.load({id:i,groupId:s,level:null,responseType:"text",type:rt.SUBTITLE_TRACK,url:n,deliveryDirectives:a})}load(e){var t;const i=this.hls.config;let s=this.getInternalLoader(e);if(s){const u=s.context;if(u&&u.url===e.url&&u.level===e.level){re.trace("[playlist-loader]: playlist request ongoing");return}re.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),s.abort()}let n;if(e.type===rt.MANIFEST?n=i.manifestLoadPolicy.default:n=Lt({},i.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),s=this.createInternalLoader(e),Ie((t=e.deliveryDirectives)==null?void 0:t.part)){let u;if(e.type===rt.LEVEL&&e.level!==null?u=this.hls.levels[e.level].details:e.type===rt.AUDIO_TRACK&&e.id!==null?u=this.hls.audioTracks[e.id].details:e.type===rt.SUBTITLE_TRACK&&e.id!==null&&(u=this.hls.subtitleTracks[e.id].details),u){const h=u.partTarget,f=u.targetduration;if(h&&f){const g=Math.max(h*3,f*.8)*1e3;n=Lt({},n,{maxTimeToFirstByteMs:Math.min(g,n.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(g,n.maxTimeToFirstByteMs)})}}}const a=n.errorRetry||n.timeoutRetry||{},o={loadPolicy:n,timeout:n.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},l={onSuccess:(u,h,f,g)=>{const v=this.getInternalLoader(f);this.resetInternalLoader(f.type);const y=u.data;if(y.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,f,new Error("no EXTM3U delimiter"),g||null,h);return}h.parsing.start=performance.now(),Ki.isMediaPlaylist(y)?this.handleTrackOrLevelPlaylist(u,h,f,g||null,v):this.handleMasterPlaylist(u,h,f,g)},onError:(u,h,f,g)=>{this.handleNetworkError(h,f,!1,u,g)},onTimeout:(u,h,f)=>{this.handleNetworkError(h,f,!0,void 0,u)}};s.load(e,o,l)}handleMasterPlaylist(e,t,i,s){const n=this.hls,a=e.data,o=Tc(e,i),l=Ki.parseMasterPlaylist(a,o);if(l.playlistParsingError){this.handleManifestParsingError(e,i,l.playlistParsingError,s,t);return}const{contentSteering:u,levels:h,sessionData:f,sessionKeys:g,startTimeOffset:v,variableList:y}=l;this.variableList=y;const{AUDIO:b=[],SUBTITLES:E,"CLOSED-CAPTIONS":A}=Ki.parseMasterPlaylistMedia(a,o,l);b.length&&!b.some(D=>!D.url)&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(re.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),b.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new bt({}),bitrate:0,url:""})),n.trigger(C.MANIFEST_LOADED,{levels:h,audioTracks:b,subtitles:E,captions:A,contentSteering:u,url:o,stats:t,networkDetails:s,sessionData:f,sessionKeys:g,startTimeOffset:v,variableList:y})}handleTrackOrLevelPlaylist(e,t,i,s,n){const a=this.hls,{id:o,level:l,type:u}=i,h=Tc(e,i),f=0,g=Ie(l)?l:Ie(o)?o:0,v=Bp(i),y=Ki.parseLevelPlaylist(e.data,h,g,v,f,this.variableList);if(u===rt.MANIFEST){const b={attrs:new bt({}),bitrate:0,details:y,name:"",url:h};a.trigger(C.MANIFEST_LOADED,{levels:[b],audioTracks:[],url:h,stats:t,networkDetails:s,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),i.levelDetails=y,this.handlePlaylistLoaded(y,e,t,i,s,n)}handleManifestParsingError(e,t,i,s,n){this.hls.trigger(C.ERROR,{type:Ve.NETWORK_ERROR,details:ce.MANIFEST_PARSING_ERROR,fatal:t.type===rt.MANIFEST,url:e.url,err:i,error:i,reason:i.message,response:e,context:t,networkDetails:s,stats:n})}handleNetworkError(e,t,i=!1,s,n){let a=`A network ${i?"timeout":"error"+(s?" (status "+s.code+")":"")} occurred while loading ${e.type}`;e.type===rt.LEVEL?a+=`: ${e.level} id: ${e.id}`:(e.type===rt.AUDIO_TRACK||e.type===rt.SUBTITLE_TRACK)&&(a+=` id: ${e.id} group-id: "${e.groupId}"`);const o=new Error(a);re.warn(`[playlist-loader]: ${a}`);let l=ce.UNKNOWN,u=!1;const h=this.getInternalLoader(e);switch(e.type){case rt.MANIFEST:l=i?ce.MANIFEST_LOAD_TIMEOUT:ce.MANIFEST_LOAD_ERROR,u=!0;break;case rt.LEVEL:l=i?ce.LEVEL_LOAD_TIMEOUT:ce.LEVEL_LOAD_ERROR,u=!1;break;case rt.AUDIO_TRACK:l=i?ce.AUDIO_TRACK_LOAD_TIMEOUT:ce.AUDIO_TRACK_LOAD_ERROR,u=!1;break;case rt.SUBTITLE_TRACK:l=i?ce.SUBTITLE_TRACK_LOAD_TIMEOUT:ce.SUBTITLE_LOAD_ERROR,u=!1;break}h&&this.resetInternalLoader(e.type);const f={type:Ve.NETWORK_ERROR,details:l,fatal:u,url:e.url,loader:h,context:e,error:o,networkDetails:t,stats:n};if(s){const g=(t==null?void 0:t.url)||e.url;f.response=Mt({url:g,data:void 0},s)}this.hls.trigger(C.ERROR,f)}handlePlaylistLoaded(e,t,i,s,n,a){const o=this.hls,{type:l,level:u,id:h,groupId:f,deliveryDirectives:g}=s,v=Tc(t,s),y=Bp(s),b=typeof s.level=="number"&&y===$e.MAIN?u:void 0;if(!e.fragments.length){const A=new Error("No Segments found in Playlist");o.trigger(C.ERROR,{type:Ve.NETWORK_ERROR,details:ce.LEVEL_EMPTY_ERROR,fatal:!1,url:v,error:A,reason:A.message,response:t,context:s,level:b,parent:y,networkDetails:n,stats:i});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const E=e.playlistParsingError;if(E){o.trigger(C.ERROR,{type:Ve.NETWORK_ERROR,details:ce.LEVEL_PARSING_ERROR,fatal:!1,url:v,error:E,reason:E.message,response:t,context:s,level:b,parent:y,networkDetails:n,stats:i});return}switch(e.live&&a&&(a.getCacheAge&&(e.ageHeader=a.getCacheAge()||0),(!a.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),l){case rt.MANIFEST:case rt.LEVEL:o.trigger(C.LEVEL_LOADED,{details:e,level:b||0,id:h||0,stats:i,networkDetails:n,deliveryDirectives:g});break;case rt.AUDIO_TRACK:o.trigger(C.AUDIO_TRACK_LOADED,{details:e,id:h||0,groupId:f||"",stats:i,networkDetails:n,deliveryDirectives:g});break;case rt.SUBTITLE_TRACK:o.trigger(C.SUBTITLE_TRACK_LOADED,{details:e,id:h||0,groupId:f||"",stats:i,networkDetails:n,deliveryDirectives:g});break}}}function $p(r,e){let t;try{t=new Event("addtrack")}catch{t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=r,e.dispatchEvent(t)}function Up(r,e){const t=r.mode;if(t==="disabled"&&(r.mode="hidden"),r.cues&&!r.cues.getCueById(e.id))try{if(r.addCue(e),!r.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(i){re.debug(`[texttrack-utils]: ${i}`);try{const s=new self.TextTrackCue(e.startTime,e.endTime,e.text);s.id=e.id,r.addCue(s)}catch(s){re.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${s}`)}}t==="disabled"&&(r.mode=t)}function Es(r){const e=r.mode;if(e==="disabled"&&(r.mode="hidden"),r.cues)for(let t=r.cues.length;t--;)r.removeCue(r.cues[t]);e==="disabled"&&(r.mode=e)}function Ac(r,e,t,i){const s=r.mode;if(s==="disabled"&&(r.mode="hidden"),r.cues&&r.cues.length>0){const n=aT(r.cues,e,t);for(let a=0;a<n.length;a++)(!i||i(n[a]))&&r.removeCue(n[a])}s==="disabled"&&(r.mode=s)}function nT(r,e){if(e<r[0].startTime)return 0;const t=r.length-1;if(e>r[t].endTime)return-1;let i=0,s=t;for(;i<=s;){const n=Math.floor((s+i)/2);if(e<r[n].startTime)s=n-1;else if(e>r[n].startTime&&i<t)i=n+1;else return n}return r[i].startTime-e<e-r[s].startTime?i:s}function aT(r,e,t){const i=[],s=nT(r,e);if(s>-1)for(let n=s,a=r.length;n<a;n++){const o=r[n];if(o.startTime>=e&&o.endTime<=t)i.push(o);else if(o.startTime>t)return i}return i}function Ra(r){const e=[];for(let t=0;t<r.length;t++){const i=r[t];(i.kind==="subtitles"||i.kind==="captions")&&i.label&&e.push(r[t])}return e}var Ti={audioId3:"org.id3",dateRange:"com.apple.quicktime.HLS",emsg:"https://aomedia.org/emsg/ID3"};const oT=.25;function _c(){if(!(typeof self>"u"))return self.VTTCue||self.TextTrackCue}function Gp(r,e,t,i,s){let n=new r(e,t,"");try{n.value=i,s&&(n.type=s)}catch{n=new r(e,t,JSON.stringify(s?Mt({type:s},i):i))}return n}const Pa=(()=>{const r=_c();try{r&&new r(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Cc(r,e){return r.getTime()/1e3-e}function lT(r){return Uint8Array.from(r.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class cT{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;e.on(C.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(C.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(C.MANIFEST_LOADING,this.onManifestLoading,this),e.on(C.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(C.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(C.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(C.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(C.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(C.MANIFEST_LOADING,this.onManifestLoading,this),e.off(C.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(C.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(C.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&(Es(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const i=e[t];if(i.kind==="metadata"&&i.label==="id3")return $p(i,this.media),i}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:i,enableID3MetadataCues:s}}}=this;if(!i&&!s)return;const{samples:n}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const a=_c();if(a)for(let o=0;o<n.length;o++){const l=n[o].type;if(l===Ti.emsg&&!i||!s)continue;const u=fp(n[o].data);if(u){const h=n[o].pts;let f=h+n[o].duration;f>Pa&&(f=Pa),f-h<=0&&(f=h+oT);for(let v=0;v<u.length;v++){const y=u[v];if(!dp(y)){this.updateId3CueEnds(h,l);const b=Gp(a,h,f,y,l);b&&this.id3Track.addCue(b)}}}}}updateId3CueEnds(e,t){var i;const s=(i=this.id3Track)==null?void 0:i.cues;if(s)for(let n=s.length;n--;){const a=s[n];a.type===t&&a.startTime<e&&a.endTime===Pa&&(a.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:i,type:s}){const{id3Track:n,hls:a}=this;if(!a)return;const{config:{enableEmsgMetadataCues:o,enableID3MetadataCues:l}}=a;if(n&&(o||l)){let u;s==="audio"?u=h=>h.type===Ti.audioId3&&l:s==="video"?u=h=>h.type===Ti.emsg&&o:u=h=>h.type===Ti.audioId3&&l||h.type===Ti.emsg&&o,Ac(n,t,i,u)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:i,id3Track:s}=this,{dateRanges:n}=t,a=Object.keys(n);if(s){const h=Object.keys(i).filter(f=>!a.includes(f));for(let f=h.length;f--;){const g=h[f];Object.keys(i[g].cues).forEach(v=>{s.removeCue(i[g].cues[v])}),delete i[g]}}const o=t.fragments[t.fragments.length-1];if(a.length===0||!Ie(o==null?void 0:o.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const l=o.programDateTime/1e3-o.start,u=_c();for(let h=0;h<a.length;h++){const f=a[h],g=n[f],v=Cc(g.startDate,l),y=i[f],b=(y==null?void 0:y.cues)||{};let E=(y==null?void 0:y.durationKnown)||!1,A=Pa;const M=g.endDate;if(M)A=Cc(M,l),E=!0;else if(g.endOnNext&&!E){const B=a.reduce((N,J)=>{if(J!==g.id){const Z=n[J];if(Z.class===g.class&&Z.startDate>g.startDate&&(!N||g.startDate<N.startDate))return Z}return N},null);B&&(A=Cc(B.startDate,l),E=!0)}const D=Object.keys(g.attr);for(let B=0;B<D.length;B++){const N=D[B];if(!dw(N))continue;const J=b[N];if(J)E&&!y.durationKnown&&(J.endTime=A);else if(u){let Z=g.attr[N];fw(N)&&(Z=lT(Z));const se=Gp(u,v,A,{key:N,data:Z},Ti.dateRange);se&&(se.id=f,this.id3Track.addCue(se),b[N]=se)}}i[f]={cues:b,dateRange:g,durationKnown:E}}}}class uT{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=()=>this.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:t}=this;return e.liveMaxLatencyDuration!==void 0?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(e===null)return null;const{holdBack:t,partHoldBack:i,targetduration:s}=e,{liveSyncDuration:n,liveSyncDurationCount:a,lowLatencyMode:o}=this.config,l=this.hls.userConfig;let u=o&&i||t;(l.liveSyncDuration||l.liveSyncDurationCount||u===0)&&(u=n!==void 0?n:a*s);const h=s;return u+Math.min(this.stallCount*1,h)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,i=this.levelDetails;if(e===null||t===null||i===null)return null;const s=i.edge,n=e-t-this.edgeStalled,a=s-i.totalduration,o=s-(this.config.lowLatencyMode&&i.partTarget||i.targetduration);return Math.min(Math.max(a,n),o)}get drift(){const{levelDetails:e}=this;return e===null?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e,levelDetails:t}=this;if(!e||!t)return 0;const i=e.buffered.length;return(i?e.buffered.end(i-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(C.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(C.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(C.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(C.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(C.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(C.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(C.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(C.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(C.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(C.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,t){var i;t.details===ce.BUFFER_STALLED_ERROR&&(this.stallCount++,(i=this.levelDetails)!=null&&i.live&&re.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:t}=this;if(!e||!t)return;this.currentTime=e.currentTime;const i=this.computeLatency();if(i===null)return;this._latency=i;const{lowLatencyMode:s,maxLiveSyncPlaybackRate:n}=this.config;if(!s||n===1||!t.live)return;const a=this.targetLatency;if(a===null)return;const o=i-a,l=Math.min(this.maxLatency,a+t.targetduration);if(o<l&&o>.05&&this.forwardBufferLength>1){const h=Math.min(2,Math.max(1,n)),f=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;e.playbackRate=Math.min(h,Math.max(1,f))}else e.playbackRate!==1&&e.playbackRate!==0&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}const Lc=["NONE","TYPE-0","TYPE-1",null];function hT(r){return Lc.indexOf(r)>-1}const ka=["SDR","PQ","HLG"];function dT(r){return!!r&&ka.indexOf(r)>-1}var Da={No:"",Yes:"YES",v2:"v2"};function Vp(r){const{canSkipUntil:e,canSkipDateRanges:t,age:i}=r,s=i<e/2;return e&&s?t?Da.v2:Da.Yes:Da.No}class jp{constructor(e,t,i){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=i}addDirectives(e){const t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class ws{constructor(e){this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(t=>!!t).map(t=>t.substring(0,4)).join(","),this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return Hp(this._audioGroups,e)}hasSubtitleGroup(e){return Hp(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let i=this._audioGroups;i||(i=this._audioGroups=[]),i.indexOf(t)===-1&&i.push(t)}else if(e==="text"){let i=this._subtitleGroups;i||(i=this._subtitleGroups=[]),i.indexOf(t)===-1&&i.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function Hp(r,e){return!e||!r?!1:r.indexOf(e)!==-1}function Ic(r,e){const t=e.startPTS;if(Ie(t)){let i=0,s;e.sn>r.sn?(i=t-r.start,s=r):(i=r.start-t,s=e),s.duration!==i&&(s.duration=i)}else e.sn>r.sn?r.cc===e.cc&&r.minEndPTS?e.start=r.start+(r.minEndPTS-r.start):e.start=r.start+r.duration:e.start=Math.max(r.start-e.duration,0)}function Kp(r,e,t,i,s,n){i-t<=0&&(re.warn("Fragment should have a positive duration",e),i=t+e.duration,n=s+e.duration);let o=t,l=i;const u=e.startPTS,h=e.endPTS;if(Ie(u)){const E=Math.abs(u-t);Ie(e.deltaPTS)?e.deltaPTS=Math.max(E,e.deltaPTS):e.deltaPTS=E,o=Math.max(t,u),t=Math.min(t,u),s=Math.min(s,e.startDTS),l=Math.min(i,h),i=Math.max(i,h),n=Math.max(n,e.endDTS)}const f=t-e.start;e.start!==0&&(e.start=t),e.duration=i-e.start,e.startPTS=t,e.maxStartPTS=o,e.startDTS=s,e.endPTS=i,e.minEndPTS=l,e.endDTS=n;const g=e.sn;if(!r||g<r.startSN||g>r.endSN)return 0;let v;const y=g-r.startSN,b=r.fragments;for(b[y]=e,v=y;v>0;v--)Ic(b[v],b[v-1]);for(v=y;v<b.length-1;v++)Ic(b[v],b[v+1]);return r.fragmentHint&&Ic(b[b.length-1],r.fragmentHint),r.PTSKnown=r.alignedSliding=!0,f}function fT(r,e){let t=null;const i=r.fragments;for(let l=i.length-1;l>=0;l--){const u=i[l].initSegment;if(u){t=u;break}}r.fragmentHint&&delete r.fragmentHint.endPTS;let s=0,n;if(mT(r,e,(l,u)=>{l.relurl&&(s=l.cc-u.cc),Ie(l.startPTS)&&Ie(l.endPTS)&&(u.start=u.startPTS=l.startPTS,u.startDTS=l.startDTS,u.maxStartPTS=l.maxStartPTS,u.endPTS=l.endPTS,u.endDTS=l.endDTS,u.minEndPTS=l.minEndPTS,u.duration=l.endPTS-l.startPTS,u.duration&&(n=u),e.PTSKnown=e.alignedSliding=!0),u.elementaryStreams=l.elementaryStreams,u.loader=l.loader,u.stats=l.stats,l.initSegment&&(u.initSegment=l.initSegment,t=l.initSegment)}),t&&(e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments).forEach(u=>{var h;u&&(!u.initSegment||u.initSegment.relurl===((h=t)==null?void 0:h.relurl))&&(u.initSegment=t)}),e.skippedSegments)if(e.deltaUpdateFailed=e.fragments.some(l=>!l),e.deltaUpdateFailed){re.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let l=e.skippedSegments;l--;)e.fragments.shift();e.startSN=e.fragments[0].sn,e.startCC=e.fragments[0].cc}else e.canSkipDateRanges&&(e.dateRanges=pT(r.dateRanges,e.dateRanges,e.recentlyRemovedDateranges));const a=e.fragments;if(s){re.warn("discontinuity sliding from playlist, take drift into account");for(let l=0;l<a.length;l++)a[l].cc+=s}e.skippedSegments&&(e.startCC=e.fragments[0].cc),gT(r.partList,e.partList,(l,u)=>{u.elementaryStreams=l.elementaryStreams,u.stats=l.stats}),n?Kp(e,n,n.startPTS,n.endPTS,n.startDTS,n.endDTS):zp(r,e),a.length&&(e.totalduration=e.edge-a[0].start),e.driftStartTime=r.driftStartTime,e.driftStart=r.driftStart;const o=e.advancedDateTime;if(e.advanced&&o){const l=e.edge;e.driftStart||(e.driftStartTime=o,e.driftStart=l),e.driftEndTime=o,e.driftEnd=l}else e.driftEndTime=r.driftEndTime,e.driftEnd=r.driftEnd,e.advancedDateTime=r.advancedDateTime}function pT(r,e,t){const i=Lt({},r);return t&&t.forEach(s=>{delete i[s]}),Object.keys(e).forEach(s=>{const n=new np(e[s].attr,i[s]);n.isValid?i[s]=n:re.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(e[s].attr)}"`)}),i}function gT(r,e,t){if(r&&e){let i=0;for(let s=0,n=r.length;s<=n;s++){const a=r[s],o=e[s+i];a&&o&&a.index===o.index&&a.fragment.sn===o.fragment.sn?t(a,o):i--}}}function mT(r,e,t){const i=e.skippedSegments,s=Math.max(r.startSN,e.startSN)-e.startSN,n=(r.fragmentHint?1:0)+(i?e.endSN:Math.min(r.endSN,e.endSN))-e.startSN,a=e.startSN-r.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,l=r.fragmentHint?r.fragments.concat(r.fragmentHint):r.fragments;for(let u=s;u<=n;u++){const h=l[a+u];let f=o[u];i&&!f&&u<i&&(f=e.fragments[u]=h),h&&f&&t(h,f)}}function zp(r,e){const t=e.startSN+e.skippedSegments-r.startSN,i=r.fragments;t<0||t>=i.length||Rc(e,i[t].start)}function Rc(r,e){if(e){const t=r.fragments;for(let i=r.skippedSegments;i<t.length;i++)t[i].start+=e;r.fragmentHint&&(r.fragmentHint.start+=e)}}function vT(r,e=1/0){let t=1e3*r.targetduration;if(r.updated){const i=r.fragments;if(i.length&&t*4>e){const n=i[i.length-1].duration*1e3;n<t&&(t=n)}}else t/=2;return Math.round(t)}function yT(r,e,t){if(!(r!=null&&r.details))return null;const i=r.details;let s=i.fragments[e-i.startSN];return s||(s=i.fragmentHint,s&&s.sn===e)?s:e<i.startSN&&t&&t.sn===e?t:null}function Wp(r,e,t){var i;return r!=null&&r.details?qp((i=r.details)==null?void 0:i.partList,e,t):null}function qp(r,e,t){if(r)for(let i=r.length;i--;){const s=r[i];if(s.index===t&&s.fragment.sn===e)return s}return null}function Yp(r){r.forEach((e,t)=>{const{details:i}=e;i!=null&&i.fragments&&i.fragments.forEach(s=>{s.level=t})})}function Oa(r){switch(r.details){case ce.FRAG_LOAD_TIMEOUT:case ce.KEY_LOAD_TIMEOUT:case ce.LEVEL_LOAD_TIMEOUT:case ce.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Xp(r,e){const t=Oa(e);return r.default[`${t?"timeout":"error"}Retry`]}function Pc(r,e){const t=r.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*r.retryDelayMs,r.maxRetryDelayMs)}function Qp(r){return Mt(Mt({},r),{errorRetry:null,timeoutRetry:null})}function Ma(r,e,t,i){if(!r)return!1;const s=i==null?void 0:i.code,n=e<r.maxNumRetry&&(ST(s)||!!t);return r.shouldRetry?r.shouldRetry(r,e,t,i,n):n}function ST(r){return r===0&&navigator.onLine===!1||!!r&&(r<400||r>499)}const Jp={search:function(r,e){let t=0,i=r.length-1,s=null,n=null;for(;t<=i;){s=(t+i)/2|0,n=r[s];const a=e(n);if(a>0)t=s+1;else if(a<0)i=s-1;else return n}return null}};function xT(r,e,t){if(e===null||!Array.isArray(r)||!r.length||!Ie(e))return null;const i=r[0].programDateTime;if(e<(i||0))return null;const s=r[r.length-1].endProgramDateTime;if(e>=(s||0))return null;t=t||0;for(let n=0;n<r.length;++n){const a=r[n];if(bT(e,t,a))return a}return null}function Fa(r,e,t=0,i=0){let s=null;if(r){s=e[r.sn-e[0].sn+1]||null;const a=r.endDTS-t;a>0&&a<15e-7&&(t+=15e-7)}else t===0&&e[0].start===0&&(s=e[0]);if(s&&(!r||r.level===s.level)&&kc(t,i,s)===0)return s;const n=Jp.search(e,kc.bind(null,t,i));return n&&(n!==r||!s)?n:s}function kc(r=0,e=0,t){if(t.start<=r&&t.start+t.duration>r)return 0;const i=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-i<=r?1:t.start-i>r&&t.start?-1:0}function bT(r,e,t){const i=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-i>r}function ET(r,e){return Jp.search(r,t=>t.cc<e?1:t.cc>e?-1:0)}var Gt={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Ai={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class wT{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=re.log.bind(re,"[info]:"),this.warn=re.warn.bind(re,"[warning]:"),this.error=re.error.bind(re,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(C.ERROR,this.onError,this),e.on(C.MANIFEST_LOADING,this.onManifestLoading,this),e.on(C.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(C.ERROR,this.onError,this),e.off(C.ERROR,this.onErrorOut,this),e.off(C.MANIFEST_LOADING,this.onManifestLoading,this),e.off(C.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===$e.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var i,s;if(t.fatal)return;const n=this.hls,a=t.context;switch(t.details){case ce.FRAG_LOAD_ERROR:case ce.FRAG_LOAD_TIMEOUT:case ce.KEY_LOAD_ERROR:case ce.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case ce.FRAG_PARSING_ERROR:if((i=t.frag)!=null&&i.gap){t.errorAction={action:Gt.DoNothing,flags:Ai.None};return}case ce.FRAG_GAP:case ce.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=Gt.SendAlternateToPenaltyBox;return}case ce.LEVEL_EMPTY_ERROR:case ce.LEVEL_PARSING_ERROR:{var o,l;const u=t.parent===$e.MAIN?t.level:n.loadLevel;t.details===ce.LEVEL_EMPTY_ERROR&&((o=t.context)!=null&&(l=o.levelDetails)!=null&&l.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,u):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,u))}return;case ce.LEVEL_LOAD_ERROR:case ce.LEVEL_LOAD_TIMEOUT:typeof(a==null?void 0:a.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,a.level));return;case ce.AUDIO_TRACK_LOAD_ERROR:case ce.AUDIO_TRACK_LOAD_TIMEOUT:case ce.SUBTITLE_LOAD_ERROR:case ce.SUBTITLE_TRACK_LOAD_TIMEOUT:if(a){const u=n.levels[n.loadLevel];if(u&&(a.type===rt.AUDIO_TRACK&&u.hasAudioGroup(a.groupId)||a.type===rt.SUBTITLE_TRACK&&u.hasSubtitleGroup(a.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,n.loadLevel),t.errorAction.action=Gt.SendAlternateToPenaltyBox,t.errorAction.flags=Ai.MoveAllAlternatesMatchingHost;return}}return;case ce.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const u=n.levels[n.loadLevel],h=u==null?void 0:u.attrs["HDCP-LEVEL"];h?t.errorAction={action:Gt.SendAlternateToPenaltyBox,flags:Ai.MoveAllAlternatesMatchingHDCP,hdcpLevel:h}:this.keySystemError(t)}return;case ce.BUFFER_ADD_CODEC_ERROR:case ce.REMUX_ALLOC_ERROR:case ce.BUFFER_APPEND_ERROR:t.errorAction=this.getLevelSwitchAction(t,(s=t.level)!=null?s:n.loadLevel);return;case ce.INTERNAL_EXCEPTION:case ce.BUFFER_APPENDING_ERROR:case ce.BUFFER_FULL_ERROR:case ce.LEVEL_SWITCH_ERROR:case ce.BUFFER_STALLED_ERROR:case ce.BUFFER_SEEK_OVER_HOLE:case ce.BUFFER_NUDGE_ON_STALL:t.errorAction={action:Gt.DoNothing,flags:Ai.None};return}t.type===Ve.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const i=this.hls,s=Xp(i.config.playlistLoadPolicy,e),n=this.playlistError++;if(Ma(s,n,Oa(e),e.response))return{action:Gt.RetryRequest,flags:Ai.None,retryConfig:s,retryCount:n};const o=this.getLevelSwitchAction(e,t);return s&&(o.retryConfig=s,o.retryCount=n),o}getFragRetryOrSwitchAction(e){const t=this.hls,i=this.getVariantLevelIndex(e.frag),s=t.levels[i],{fragLoadPolicy:n,keyLoadPolicy:a}=t.config,o=Xp(e.details.startsWith("key")?a:n,e),l=t.levels.reduce((h,f)=>h+f.fragmentError,0);if(s&&(e.details!==ce.FRAG_GAP&&s.fragmentError++,Ma(o,l,Oa(e),e.response)))return{action:Gt.RetryRequest,flags:Ai.None,retryConfig:o,retryCount:l};const u=this.getLevelSwitchAction(e,i);return o&&(u.retryConfig=o,u.retryCount=l),u}getLevelSwitchAction(e,t){const i=this.hls;t==null&&(t=i.loadLevel);const s=this.hls.levels[t];if(s){var n,a;const u=e.details;s.loadError++,u===ce.BUFFER_APPEND_ERROR&&s.fragmentError++;let h=-1;const{levels:f,loadLevel:g,minAutoLevel:v,maxAutoLevel:y}=i;i.autoLevelEnabled||(i.loadLevel=-1);const b=(n=e.frag)==null?void 0:n.type,A=(b===$e.AUDIO&&u===ce.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(u===ce.BUFFER_ADD_CODEC_ERROR||u===ce.BUFFER_APPEND_ERROR))&&f.some(({audioCodec:J})=>s.audioCodec!==J),D=e.sourceBufferName==="video"&&(u===ce.BUFFER_ADD_CODEC_ERROR||u===ce.BUFFER_APPEND_ERROR)&&f.some(({codecSet:J,audioCodec:Z})=>s.codecSet!==J&&s.audioCodec===Z),{type:B,groupId:N}=(a=e.context)!=null?a:{};for(let J=f.length;J--;){const Z=(J+g)%f.length;if(Z!==g&&Z>=v&&Z<=y&&f[Z].loadError===0){var o,l;const se=f[Z];if(u===ce.FRAG_GAP&&e.frag){const Q=f[Z].details;if(Q){const q=Fa(e.frag,Q.fragments,e.frag.start);if(q!=null&&q.gap)continue}}else{if(B===rt.AUDIO_TRACK&&se.hasAudioGroup(N)||B===rt.SUBTITLE_TRACK&&se.hasSubtitleGroup(N))continue;if(b===$e.AUDIO&&(o=s.audioGroups)!=null&&o.some(Q=>se.hasAudioGroup(Q))||b===$e.SUBTITLE&&(l=s.subtitleGroups)!=null&&l.some(Q=>se.hasSubtitleGroup(Q))||A&&s.audioCodec===se.audioCodec||!A&&s.audioCodec!==se.audioCodec||D&&s.codecSet===se.codecSet)continue}h=Z;break}}if(h>-1&&i.loadLevel!==h)return e.levelRetry=!0,this.playlistError=0,{action:Gt.SendAlternateToPenaltyBox,flags:Ai.None,nextAutoLevel:h}}return{action:Gt.SendAlternateToPenaltyBox,flags:Ai.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var i;switch((i=t.errorAction)==null?void 0:i.action){case Gt.DoNothing:break;case Gt.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==ce.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,i=e.errorAction;if(!i)return;const{flags:s,hdcpLevel:n,nextAutoLevel:a}=i;switch(s){case Ai.None:this.switchLevel(e,a);break;case Ai.MoveAllAlternatesMatchingHDCP:n&&(t.maxHdcpLevel=Lc[Lc.indexOf(n)-1],i.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}i.resolved||this.switchLevel(e,a)}switchLevel(e,t){t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}}class Dc{constructor(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=re.log.bind(re,`${t}:`),this.warn=re.warn.bind(re,`${t}:`),this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,i){const s=t==null?void 0:t.renditionReports;if(s){let n=-1;for(let a=0;a<s.length;a++){const o=s[a];let l;try{l=new self.URL(o.URI,t.url).href}catch(u){re.warn(`Could not construct new URL for Rendition Report: ${u}`),l=o.URI||""}if(l===e){n=a;break}else l===e.substring(0,l.length)&&(n=a)}if(n!==-1){const a=s[n],o=parseInt(a["LAST-MSN"])||(t==null?void 0:t.lastPartSn);let l=parseInt(a["LAST-PART"])||(t==null?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const h=Math.min(t.age-t.partTarget,t.targetduration);l>=0&&h>t.partTarget&&(l+=1)}const u=i&&Vp(i);return new jp(o,l>=0?l:void 0,u)}}}loadPlaylist(e){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return this.timer===-1&&this.requestScheduled===-1&&this.shouldLoadPlaylist(e)}playlistLoaded(e,t,i){const{details:s,stats:n}=t,a=self.performance.now(),o=n.loading.first?Math.max(0,a-n.loading.first):0;if(s.advancedDateTime=Date.now()-o,s.live||i!=null&&i.live){if(s.reloaded(i),i&&this.log(`live playlist ${e} ${s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:s.updated?"UPDATED":"MISSED"}`),i&&s.fragments.length>0&&fT(i,s),!this.canLoad||!s.live)return;let l,u,h;if(s.canBlockReload&&s.endSN&&s.advanced){const E=this.hls.config.lowLatencyMode,A=s.lastPartSn,M=s.endSN,D=s.lastPartIndex,B=D!==-1,N=A===M,J=E?0:D;B?(u=N?M+1:A,h=N?J:D+1):u=M+1;const Z=s.age,se=Z+s.ageHeader;let Q=Math.min(se-s.partTarget,s.targetduration*1.5);if(Q>0){if(i&&Q>i.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${i.tuneInGoal} to: ${Q} with playlist age: ${s.age}`),Q=0;else{const q=Math.floor(Q/s.targetduration);if(u+=q,h!==void 0){const oe=Math.round(Q%s.targetduration/s.partTarget);h+=oe}this.log(`CDN Tune-in age: ${s.ageHeader}s last advanced ${Z.toFixed(2)}s goal: ${Q} skip sn ${q} to part ${h}`)}s.tuneInGoal=Q}if(l=this.getDeliveryDirectives(s,t.deliveryDirectives,u,h),E||!N){this.loadPlaylist(l);return}}else(s.canBlockReload||s.canSkipUntil)&&(l=this.getDeliveryDirectives(s,t.deliveryDirectives,u,h));const f=this.hls.mainForwardBufferInfo,g=f?f.end-f.len:0,v=(s.edge-g)*1e3,y=vT(s,v);s.updated&&a>this.requestScheduled+y&&(this.requestScheduled=n.loading.start),u!==void 0&&s.canBlockReload?this.requestScheduled=n.loading.first+y-(s.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+y<a?this.requestScheduled=a:this.requestScheduled-a<=0&&(this.requestScheduled+=y);let b=this.requestScheduled-a;b=Math.max(0,b),this.log(`reload live playlist ${e} in ${Math.round(b)} ms`),this.timer=self.setTimeout(()=>this.loadPlaylist(l),b)}else this.clearTimer()}getDeliveryDirectives(e,t,i,s){let n=Vp(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(i=t.msn,s=t.part,n=Da.No),new jp(i,s,n)}checkRetry(e){const t=e.details,i=Oa(e),s=e.errorAction,{action:n,retryCount:a=0,retryConfig:o}=s||{},l=!!s&&!!o&&(n===Gt.RetryRequest||!s.resolved&&n===Gt.SendAlternateToPenaltyBox);if(l){var u;if(this.requestScheduled=-1,a>=o.maxNumRetry)return!1;if(i&&(u=e.context)!=null&&u.deliveryDirectives)this.warn(`Retrying playlist loading ${a+1}/${o.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const h=Pc(o,a);this.timer=self.setTimeout(()=>this.loadPlaylist(),h),this.warn(`Retrying playlist loading ${a+1}/${o.maxNumRetry} after "${t}" in ${h}ms`)}e.levelRetry=!0,s.resolved=!0}return l}}class Ts{constructor(e,t=0,i=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=i}sample(e,t){const i=Math.pow(this.alpha_,e);this.estimate_=t*(1-i)+i*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class TT{constructor(e,t,i,s=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=i,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Ts(e),this.fast_=new Ts(t),this.defaultTTFB_=s,this.ttfb_=new Ts(e)}update(e,t){const{slow_:i,fast_:s,ttfb_:n}=this;i.halfLife!==e&&(this.slow_=new Ts(e,i.getEstimate(),i.getTotalWeight())),s.halfLife!==t&&(this.fast_=new Ts(t,s.getEstimate(),s.getTotalWeight())),n.halfLife!==e&&(this.ttfb_=new Ts(e,n.getEstimate(),n.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const i=8*t,s=e/1e3,n=i/s;this.fast_.sample(s,n),this.slow_.sample(s,n)}sampleTTFB(e){const t=e/1e3,i=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(i,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}const Zp={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},eg={};function AT(r,e,t,i,s,n){const a=r.audioCodec?r.audioGroups:null,o=n==null?void 0:n.audioCodec,l=n==null?void 0:n.channels,u=l?parseInt(l):o?1/0:2;let h=null;if(a!=null&&a.length)try{a.length===1&&a[0]?h=e.groups[a[0]].channels:h=a.reduce((f,g)=>{if(g){const v=e.groups[g];if(!v)throw new Error(`Audio track group ${g} not found`);Object.keys(v.channels).forEach(y=>{f[y]=(f[y]||0)+v.channels[y]})}return f},{2:0})}catch{return!0}return r.videoCodec!==void 0&&(r.width>1920&&r.height>1088||r.height>1920&&r.width>1088||r.frameRate>Math.max(i,30)||r.videoRange!=="SDR"&&r.videoRange!==t||r.bitrate>Math.max(s,8e6))||!!h&&Ie(u)&&Object.keys(h).some(f=>parseInt(f)>u)}function _T(r,e,t){const i=r.videoCodec,s=r.audioCodec;if(!i||!s||!t)return Promise.resolve(Zp);const n={width:r.width,height:r.height,bitrate:Math.ceil(Math.max(r.bitrate*.9,r.averageBitrate)),framerate:r.frameRate||30},a=r.videoRange;a!=="SDR"&&(n.transferFunction=a.toLowerCase());const o=i.split(",").map(l=>({type:"media-source",video:Mt(Mt({},n),{},{contentType:Pn(l,"video")})}));return s&&r.audioGroups&&r.audioGroups.forEach(l=>{var u;l&&((u=e.groups[l])==null||u.tracks.forEach(h=>{if(h.groupId===l){const f=h.channels||"",g=parseFloat(f);Ie(g)&&g>2&&o.push.apply(o,s.split(",").map(v=>({type:"media-source",audio:{contentType:Pn(v,"audio"),channels:""+g}})))}}))}),Promise.all(o.map(l=>{const u=CT(l);return eg[u]||(eg[u]=t.decodingInfo(l))})).then(l=>({supported:!l.some(u=>!u.supported),configurations:o,decodingInfoResults:l})).catch(l=>({supported:!1,configurations:o,decodingInfoResults:[],error:l}))}function CT(r){const{audio:e,video:t}=r,i=t||e;if(i){const s=i.contentType.split('"')[1];if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${s}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${s}`}return""}function LT(){if(typeof matchMedia=="function"){const r=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(r.media!==e.media)return r.matches===!0}return!1}function IT(r,e){let t=!1,i=[];return r&&(t=r!=="SDR",i=[r]),e&&(i=e.allowedVideoRanges||ka.slice(0),t=e.preferHDR!==void 0?e.preferHDR:LT(),t?i=i.filter(s=>s!=="SDR"):i=["SDR"]),{preferHDR:t,allowedVideoRanges:i}}function RT(r,e,t,i,s){const n=Object.keys(r),a=i==null?void 0:i.channels,o=i==null?void 0:i.audioCodec,l=a&&parseInt(a)===2;let u=!0,h=!1,f=1/0,g=1/0,v=1/0,y=0,b=[];const{preferHDR:E,allowedVideoRanges:A}=IT(e,s);for(let N=n.length;N--;){const J=r[n[N]];u=J.channels[2]>0,f=Math.min(f,J.minHeight),g=Math.min(g,J.minFramerate),v=Math.min(v,J.minBitrate);const Z=A.filter(se=>J.videoRanges[se]>0);Z.length>0&&(h=!0,b=Z)}f=Ie(f)?f:0,g=Ie(g)?g:0;const M=Math.max(1080,f),D=Math.max(30,g);return v=Ie(v)?v:t,t=Math.max(v,t),h||(e=void 0,b=[]),{codecSet:n.reduce((N,J)=>{const Z=r[J];if(J===N)return N;if(Z.minBitrate>t)return sr(J,`min bitrate of ${Z.minBitrate} > current estimate of ${t}`),N;if(!Z.hasDefaultAudio)return sr(J,"no renditions with default or auto-select sound found"),N;if(o&&J.indexOf(o.substring(0,4))%5!==0)return sr(J,`audio codec preference "${o}" not found`),N;if(a&&!l){if(!Z.channels[a])return sr(J,`no renditions with ${a} channel sound found (channels options: ${Object.keys(Z.channels)})`),N}else if((!o||l)&&u&&Z.channels[2]===0)return sr(J,"no renditions with stereo sound found"),N;return Z.minHeight>M?(sr(J,`min resolution of ${Z.minHeight} > maximum of ${M}`),N):Z.minFramerate>D?(sr(J,`min framerate of ${Z.minFramerate} > maximum of ${D}`),N):b.some(se=>Z.videoRanges[se]>0)?Z.maxScore<y?(sr(J,`max score of ${Z.maxScore} < selected max of ${y}`),N):N&&(La(J)>=La(N)||Z.fragmentError>r[N].fragmentError)?N:(y=Z.maxScore,J):(sr(J,`no variants with VIDEO-RANGE of ${JSON.stringify(b)} found`),N)},void 0),videoRanges:b,preferHDR:E,minFramerate:g,minBitrate:v}}function sr(r,e){re.log(`[abr] start candidates with "${r}" ignored because ${e}`)}function PT(r){return r.reduce((e,t)=>{let i=e.groups[t.groupId];i||(i=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),i.tracks.push(t);const s=t.channels||"2";return i.channels[s]=(i.channels[s]||0)+1,i.hasDefault=i.hasDefault||t.default,i.hasAutoSelect=i.hasAutoSelect||t.autoselect,i.hasDefault&&(e.hasDefaultAudio=!0),i.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function kT(r,e,t,i){return r.slice(t,i+1).reduce((s,n)=>{if(!n.codecSet)return s;const a=n.audioGroups;let o=s[n.codecSet];o||(s[n.codecSet]=o={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!a,fragmentError:0}),o.minBitrate=Math.min(o.minBitrate,n.bitrate);const l=Math.min(n.height,n.width);return o.minHeight=Math.min(o.minHeight,l),o.minFramerate=Math.min(o.minFramerate,n.frameRate),o.maxScore=Math.max(o.maxScore,n.score),o.fragmentError+=n.fragmentError,o.videoRanges[n.videoRange]=(o.videoRanges[n.videoRange]||0)+1,a&&a.forEach(u=>{if(!u)return;const h=e.groups[u];h&&(o.hasDefaultAudio=o.hasDefaultAudio||e.hasDefaultAudio?h.hasDefault:h.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(h.channels).forEach(f=>{o.channels[f]=(o.channels[f]||0)+h.channels[f]}))}),s},{})}function zi(r,e,t){if("attrs"in r){const i=e.indexOf(r);if(i!==-1)return i}for(let i=0;i<e.length;i++){const s=e[i];if(As(r,s,t))return i}return-1}function As(r,e,t){const{groupId:i,name:s,lang:n,assocLang:a,characteristics:o,default:l}=r,u=r.forced;return(i===void 0||e.groupId===i)&&(s===void 0||e.name===s)&&(n===void 0||e.lang===n)&&(n===void 0||e.assocLang===a)&&(l===void 0||e.default===l)&&(u===void 0||e.forced===u)&&(o===void 0||DT(o,e.characteristics))&&(t===void 0||t(r,e))}function DT(r,e=""){const t=r.split(","),i=e.split(",");return t.length===i.length&&!t.some(s=>i.indexOf(s)===-1)}function _s(r,e){const{audioCodec:t,channels:i}=r;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(i===void 0||i===(e.channels||"2"))}function OT(r,e,t,i,s){const n=e[i],o=e.reduce((g,v,y)=>{const b=v.uri;return(g[b]||(g[b]=[])).push(y),g},{})[n.uri];o.length>1&&(i=Math.max.apply(Math,o));const l=n.videoRange,u=n.frameRate,h=n.codecSet.substring(0,4),f=tg(e,i,g=>{if(g.videoRange!==l||g.frameRate!==u||g.codecSet.substring(0,4)!==h)return!1;const v=g.audioGroups,y=t.filter(b=>!v||v.indexOf(b.groupId)!==-1);return zi(r,y,s)>-1});return f>-1?f:tg(e,i,g=>{const v=g.audioGroups,y=t.filter(b=>!v||v.indexOf(b.groupId)!==-1);return zi(r,y,s)>-1})}function tg(r,e,t){for(let i=e;i;i--)if(t(r[i]))return i;for(let i=e+1;i<r.length;i++)if(t(r[i]))return i;return-1}class MT{constructor(e){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this._abandonRulesCheck=()=>{const{fragCurrent:t,partCurrent:i,hls:s}=this,{autoLevelEnabled:n,media:a}=s;if(!t||!a)return;const o=performance.now(),l=i?i.stats:t.stats,u=i?i.duration:t.duration,h=o-l.loading.start,f=s.minAutoLevel;if(l.aborted||l.loaded&&l.loaded===l.total||t.level<=f){this.clearTimer(),this._nextAutoLevel=-1;return}if(!n||a.paused||!a.playbackRate||!a.readyState)return;const g=s.mainForwardBufferInfo;if(g===null)return;const v=this.bwEstimator.getEstimateTTFB(),y=Math.abs(a.playbackRate);if(h<=Math.max(v,1e3*(u/(y*2))))return;const b=g.len/y,E=l.loading.first?l.loading.first-l.loading.start:-1,A=l.loaded&&E>-1,M=this.getBwEstimate(),D=s.levels,B=D[t.level],N=l.total||Math.max(l.loaded,Math.round(u*B.averageBitrate/8));let J=A?h-E:h;J<1&&A&&(J=Math.min(h,l.loaded*8/M));const Z=A?l.loaded*1e3/J:0,se=Z?(N-l.loaded)/Z:N*8/M+v/1e3;if(se<=b)return;const Q=Z?Z*8:M;let q=Number.POSITIVE_INFINITY,oe;for(oe=t.level-1;oe>f;oe--){const he=D[oe].maxBitrate;if(q=this.getTimeToLoadFrag(v/1e3,Q,u*he,!D[oe].details),q<b)break}if(q>=se||q>u*10)return;s.nextLoadLevel=s.nextAutoLevel=oe,A?this.bwEstimator.sample(h-Math.min(v,E),l.loaded):this.bwEstimator.sampleTTFB(h);const me=D[oe].maxBitrate;this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>me&&this.resetEstimator(me),this.clearTimer(),re.warn(`[abr] Fragment ${t.sn}${i?" part "+i.index:""} of level ${t.level} is loading too slowly;
|
|
114
|
-
Time to underbuffer: ${b.toFixed(3)} s
|
|
115
|
-
Estimated load time for current fragment: ${se.toFixed(3)} s
|
|
116
|
-
Estimated load time for down switch fragment: ${q.toFixed(3)} s
|
|
117
|
-
TTFB estimate: ${E|0} ms
|
|
118
|
-
Current BW estimate: ${Ie(M)?M|0:"Unknown"} bps
|
|
119
|
-
New BW estimate: ${this.getBwEstimate()|0} bps
|
|
120
|
-
Switching to level ${oe} @ ${me|0} bps`),s.trigger(C.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:i,stats:l})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(re.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new TT(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(C.MANIFEST_LOADING,this.onManifestLoading,this),e.on(C.FRAG_LOADING,this.onFragLoading,this),e.on(C.FRAG_LOADED,this.onFragLoaded,this),e.on(C.FRAG_BUFFERED,this.onFragBuffered,this),e.on(C.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(C.LEVEL_LOADED,this.onLevelLoaded,this),e.on(C.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(C.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(C.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(C.MANIFEST_LOADING,this.onManifestLoading,this),e.off(C.FRAG_LOADING,this.onFragLoading,this),e.off(C.FRAG_LOADED,this.onFragLoaded,this),e.off(C.FRAG_BUFFERED,this.onFragBuffered,this),e.off(C.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(C.LEVEL_LOADED,this.onLevelLoaded,this),e.off(C.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(C.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(C.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const i=t.frag;if(!this.ignoreFragment(i)){if(!i.bitrateTest){var s;this.fragCurrent=i,this.partCurrent=(s=t.part)!=null?s:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case ce.BUFFER_ADD_CODEC_ERROR:case ce.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case ce.FRAG_LOAD_TIMEOUT:{const i=t.frag,{fragCurrent:s,partCurrent:n}=this;if(i&&s&&i.sn===s.sn&&i.level===s.level){const a=performance.now(),o=n?n.stats:i.stats,l=a-o.loading.start,u=o.loading.first?o.loading.first-o.loading.start:-1;if(o.loaded&&u>-1){const f=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(l-Math.min(f,u),o.loaded)}else this.bwEstimator.sampleTTFB(l)}break}}}getTimeToLoadFrag(e,t,i,s){const n=e+i/t,a=s?this.lastLevelLoadSec:0;return n+a}onLevelLoaded(e,t){const i=this.hls.config,{loading:s}=t.stats,n=s.end-s.start;Ie(n)&&(this.lastLevelLoadSec=n/1e3),t.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)}onFragLoaded(e,{frag:t,part:i}){const s=i?i.stats:t.stats;if(t.type===$e.MAIN&&this.bwEstimator.sampleTTFB(s.loading.first-s.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const n=i?i.duration:t.duration,a=this.hls.levels[t.level],o=(a.loaded?a.loaded.bytes:0)+s.loaded,l=(a.loaded?a.loaded.duration:0)+n;a.loaded={bytes:o,duration:l},a.realBitrate=Math.round(8*o/l)}if(t.bitrateTest){const n={stats:s,frag:t,part:i,id:t.type};this.onFragBuffered(C.FRAG_BUFFERED,n),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:i,part:s}=t,n=s!=null&&s.stats.loaded?s.stats:i.stats;if(n.aborted||this.ignoreFragment(i))return;const a=n.parsing.end-n.loading.start-Math.min(n.loading.first-n.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(a,n.loaded),n.bwEstimate=this.getBwEstimate(),i.bitrateTest?this.bitrateTestDelay=a/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==$e.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,i=this.getBwEstimate(),s=this.hls.config.maxStarvationDelay,n=this.findBestLevel(i,t,e,0,s,1,1);if(n>-1)return n;const a=this.hls.firstLevel,o=Math.min(Math.max(a,t),e);return re.warn(`[abr] Could not find best starting auto level. Defaulting to first in playlist ${a} clamped to ${o}`),o}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,i=this.bwEstimator.canEstimate(),s=this.lastLoadedFragLevel>-1;if(e!==-1&&(!i||!s||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const n=i&&s?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const a=this.hls.levels;if(a.length>Math.max(e,n)&&a[e].loadError<=a[n].loadError)return e}return this._nextAutoLevel=n,this.nextAutoLevelKey=this.getAutoLevelKey(),n}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:i}=this,{maxAutoLevel:s,config:n,minAutoLevel:a}=i,o=t?t.duration:e?e.duration:0,l=this.getBwEstimate(),u=this.getStarvationDelay();let h=n.abrBandWidthFactor,f=n.abrBandWidthUpFactor;if(u){const E=this.findBestLevel(l,a,s,u,0,h,f);if(E>=0)return E}let g=o?Math.min(o,n.maxStarvationDelay):n.maxStarvationDelay;if(!u){const E=this.bitrateTestDelay;E&&(g=(o?Math.min(o,n.maxLoadingDelay):n.maxLoadingDelay)-E,re.info(`[abr] bitrate test took ${Math.round(1e3*E)}ms, set first fragment max fetchDuration to ${Math.round(1e3*g)} ms`),h=f=1)}const v=this.findBestLevel(l,a,s,u,g,h,f);if(re.info(`[abr] ${u?"rebuffering expected":"buffer is empty"}, optimal quality level ${v}`),v>-1)return v;const y=i.levels[a],b=i.levels[i.loadLevel];return(y==null?void 0:y.bitrate)<(b==null?void 0:b.bitrate)?a:i.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const i=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,s=e.mainForwardBufferInfo;return(s?s.len:0)/i}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,i,s,n,a,o){var l;const u=s+n,h=this.lastLoadedFragLevel,f=h===-1?this.hls.firstLevel:h,{fragCurrent:g,partCurrent:v}=this,{levels:y,allAudioTracks:b,loadLevel:E,config:A}=this.hls;if(y.length===1)return 0;const M=y[f],D=!!(M!=null&&(l=M.details)!=null&&l.live),B=E===-1||h===-1;let N,J="SDR",Z=(M==null?void 0:M.frameRate)||0;const{audioPreference:se,videoPreference:Q}=A,q=this.audioTracksByGroup||(this.audioTracksByGroup=PT(b));if(B){if(this.firstSelection!==-1)return this.firstSelection;const we=this.codecTiers||(this.codecTiers=kT(y,q,t,i)),ue=RT(we,J,e,se,Q),{codecSet:ge,videoRanges:Ce,minFramerate:ve,minBitrate:Se,preferHDR:qe}=ue;N=ge,J=qe?Ce[Ce.length-1]:Ce[0],Z=ve,e=Math.max(e,Se),re.log(`[abr] picked start tier ${JSON.stringify(ue)}`)}else N=M==null?void 0:M.codecSet,J=M==null?void 0:M.videoRange;const oe=v?v.duration:g?g.duration:0,me=this.bwEstimator.getEstimateTTFB()/1e3,he=[];for(let we=i;we>=t;we--){var Ee;const ue=y[we],ge=we>f;if(!ue)continue;if(A.useMediaCapabilities&&!ue.supportedResult&&!ue.supportedPromise){const it=navigator.mediaCapabilities;typeof(it==null?void 0:it.decodingInfo)=="function"&&AT(ue,q,J,Z,e,se)?(ue.supportedPromise=_T(ue,q,it),ue.supportedPromise.then(et=>{if(!this.hls)return;ue.supportedResult=et;const lt=this.hls.levels,Je=lt.indexOf(ue);et.error?re.warn(`[abr] MediaCapabilities decodingInfo error: "${et.error}" for level ${Je} ${JSON.stringify(et)}`):et.supported||(re.warn(`[abr] Unsupported MediaCapabilities decodingInfo result for level ${Je} ${JSON.stringify(et)}`),Je>-1&<.length>1&&(re.log(`[abr] Removing unsupported level ${Je}`),this.hls.removeLevel(Je)))})):ue.supportedResult=Zp}if(N&&ue.codecSet!==N||J&&ue.videoRange!==J||ge&&Z>ue.frameRate||!ge&&Z>0&&Z<ue.frameRate||ue.supportedResult&&!((Ee=ue.supportedResult.decodingInfoResults)!=null&&Ee[0].smooth)){he.push(we);continue}const Ce=ue.details,ve=(v?Ce==null?void 0:Ce.partTarget:Ce==null?void 0:Ce.averagetargetduration)||oe;let Se;ge?Se=o*e:Se=a*e;const qe=oe&&s>=oe*2&&n===0?y[we].averageBitrate:y[we].maxBitrate,Ue=this.getTimeToLoadFrag(me,Se,qe*ve,Ce===void 0);if(Se>=qe&&(we===h||ue.loadError===0&&ue.fragmentError===0)&&(Ue<=me||!Ie(Ue)||D&&!this.bitrateTestDelay||Ue<u)){const it=this.forcedAutoLevel;return we!==E&&(it===-1||it!==E)&&(he.length&&re.trace(`[abr] Skipped level(s) ${he.join(",")} of ${i} max with CODECS and VIDEO-RANGE:"${y[he[0]].codecs}" ${y[he[0]].videoRange}; not compatible with "${M.codecs}" ${J}`),re.info(`[abr] switch candidate:${f}->${we} adjustedbw(${Math.round(Se)})-bitrate=${Math.round(Se-qe)} ttfb:${me.toFixed(1)} avgDuration:${ve.toFixed(1)} maxFetchDuration:${u.toFixed(1)} fetchDuration:${Ue.toFixed(1)} firstSelection:${B} codecSet:${N} videoRange:${J} hls.loadLevel:${E}`)),B&&(this.firstSelection=we),we}}return-1}set nextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:i}=this.hls,s=Math.min(Math.max(e,i),t);this._nextAutoLevel!==s&&(this.nextAutoLevelKey="",this._nextAutoLevel=s)}}class FT{constructor(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}var Ft={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class NT{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(C.BUFFER_APPENDED,this.onBufferAppended,this),e.on(C.FRAG_BUFFERED,this.onFragBuffered,this),e.on(C.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(C.BUFFER_APPENDED,this.onBufferAppended,this),e.off(C.FRAG_BUFFERED,this.onFragBuffered,this),e.off(C.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const i=this.activePartLists[t];if(i)for(let s=i.length;s--;){const n=i[s];if(!n)break;const a=n.end;if(n.start<=e&&a!==null&&e<=a)return n}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){const{fragments:i}=this,s=Object.keys(i);for(let n=s.length;n--;){const a=i[s[n]];if((a==null?void 0:a.body.type)===t&&a.buffered){const o=a.body;if(o.start<=e&&e<=o.end)return o}}return null}detectEvictedFragments(e,t,i,s){this.timeRanges&&(this.timeRanges[e]=t);const n=(s==null?void 0:s.fragment.sn)||-1;Object.keys(this.fragments).forEach(a=>{const o=this.fragments[a];if(!o||n>=o.body.sn)return;if(!o.buffered&&!o.loaded){o.body.type===i&&this.removeFragment(o.body);return}const l=o.range[e];l&&l.time.some(u=>{const h=!this.isTimeBuffered(u.startPTS,u.endPTS,t);return h&&this.removeFragment(o.body),h})})}detectPartialFragments(e){const t=this.timeRanges,{frag:i,part:s}=e;if(!t||i.sn==="initSegment")return;const n=Cs(i),a=this.fragments[n];if(!a||a.buffered&&i.gap)return;const o=!i.relurl;Object.keys(t).forEach(l=>{const u=i.elementaryStreams[l];if(!u)return;const h=t[l],f=o||u.partial===!0;a.range[l]=this.getBufferedTimes(i,s,f,h)}),a.loaded=null,Object.keys(a.range).length?(a.buffered=!0,(a.body.endList=i.endList||a.body.endList)&&(this.endListFragments[a.body.type]=a),Na(a)||this.removeParts(i.sn-1,i.type)):this.removeFragment(a.body)}removeParts(e,t){const i=this.activePartLists[t];i&&(this.activePartLists[t]=i.filter(s=>s.fragment.sn>=e))}fragBuffered(e,t){const i=Cs(e);let s=this.fragments[i];!s&&t&&(s=this.fragments[i]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),s&&(s.loaded=null,s.buffered=!0)}getBufferedTimes(e,t,i,s){const n={time:[],partial:i},a=e.start,o=e.end,l=e.minEndPTS||o,u=e.maxStartPTS||a;for(let h=0;h<s.length;h++){const f=s.start(h)-this.bufferPadding,g=s.end(h)+this.bufferPadding;if(u>=f&&l<=g){n.time.push({startPTS:Math.max(a,s.start(h)),endPTS:Math.min(o,s.end(h))});break}else if(a<g&&o>f){const v=Math.max(a,s.start(h)),y=Math.min(o,s.end(h));y>v&&(n.partial=!0,n.time.push({startPTS:v,endPTS:y}))}else if(o<=f)break}return n}getPartialFragment(e){let t=null,i,s,n,a=0;const{bufferPadding:o,fragments:l}=this;return Object.keys(l).forEach(u=>{const h=l[u];h&&Na(h)&&(s=h.body.start-o,n=h.body.end+o,e>=s&&e<=n&&(i=Math.min(e-s,n-e),a<=i&&(t=h.body,a=i)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||Na(t))}getState(e){const t=Cs(e),i=this.fragments[t];return i?i.buffered?Na(i)?Ft.PARTIAL:Ft.OK:Ft.APPENDING:Ft.NOT_LOADED}isTimeBuffered(e,t,i){let s,n;for(let a=0;a<i.length;a++){if(s=i.start(a)-this.bufferPadding,n=i.end(a)+this.bufferPadding,e>=s&&t<=n)return!0;if(t<=s)return!1}return!1}onFragLoaded(e,t){const{frag:i,part:s}=t;if(i.sn==="initSegment"||i.bitrateTest)return;const n=s?null:t,a=Cs(i);this.fragments[a]={body:i,appendedPTS:null,loaded:n,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:i,part:s,timeRanges:n}=t;if(i.sn==="initSegment")return;const a=i.type;if(s){let o=this.activePartLists[a];o||(this.activePartLists[a]=o=[]),o.push(s)}this.timeRanges=n,Object.keys(n).forEach(o=>{const l=n[o];this.detectEvictedFragments(o,l,a,s)})}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=Cs(e);return!!this.fragments[t]}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,i,s,n){s&&!this.hasGaps||Object.keys(this.fragments).forEach(a=>{const o=this.fragments[a];if(!o)return;const l=o.body;l.type!==i||s&&!l.gap||l.start<t&&l.end>e&&(o.buffered||n)&&this.removeFragment(l)})}removeFragment(e){const t=Cs(e);e.stats.loaded=0,e.clearElementaryStreamInfo();const i=this.activePartLists[e.type];if(i){const s=e.sn;this.activePartLists[e.type]=i.filter(n=>n.fragment.sn!==s)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function Na(r){var e,t,i;return r.buffered&&(r.body.gap||((e=r.range.video)==null?void 0:e.partial)||((t=r.range.audio)==null?void 0:t.partial)||((i=r.range.audiovideo)==null?void 0:i.partial))}function Cs(r){return`${r.type}_${r.level}_${r.sn}`}const BT={length:0,start:()=>0,end:()=>0};class yt{static isBuffered(e,t){try{if(e){const i=yt.getBuffered(e);for(let s=0;s<i.length;s++)if(t>=i.start(s)&&t<=i.end(s))return!0}}catch{}return!1}static bufferInfo(e,t,i){try{if(e){const s=yt.getBuffered(e),n=[];let a;for(a=0;a<s.length;a++)n.push({start:s.start(a),end:s.end(a)});return this.bufferedInfo(n,t,i)}}catch{}return{len:0,start:t,end:t,nextStart:void 0}}static bufferedInfo(e,t,i){t=Math.max(0,t),e.sort(function(u,h){const f=u.start-h.start;return f||h.end-u.end});let s=[];if(i)for(let u=0;u<e.length;u++){const h=s.length;if(h){const f=s[h-1].end;e[u].start-f<i?e[u].end>f&&(s[h-1].end=e[u].end):s.push(e[u])}else s.push(e[u])}else s=e;let n=0,a,o=t,l=t;for(let u=0;u<s.length;u++){const h=s[u].start,f=s[u].end;if(t+i>=h&&t<f)o=h,l=f,n=l-t;else if(t+i<h){a=h;break}}return{len:n,start:o||0,end:l||0,nextStart:a}}static getBuffered(e){try{return e.buffered}catch(t){return re.log("failed to get media.buffered",t),BT}}}class Oc{constructor(e,t,i,s=0,n=-1,a=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=Ba(),this.buffering={audio:Ba(),video:Ba(),audiovideo:Ba()},this.level=e,this.sn=t,this.id=i,this.size=s,this.part=n,this.partial=a}}function Ba(){return{start:0,executeStart:0,executeEnd:0,end:0}}function $a(r,e){for(let i=0,s=r.length;i<s;i++){var t;if(((t=r[i])==null?void 0:t.cc)===e)return r[i]}return null}function $T(r,e,t){return!!(e&&(t.endCC>t.startCC||r&&r.cc<t.startCC))}function UT(r,e){const t=r.fragments,i=e.fragments;if(!i.length||!t.length){re.log("No fragments to align");return}const s=$a(t,i[0].cc);if(!s||s&&!s.startPTS){re.log("No frag in previous level to align on");return}return s}function ig(r,e){if(r){const t=r.start+e;r.start=r.startPTS=t,r.endPTS=t+r.duration}}function rg(r,e){const t=e.fragments;for(let i=0,s=t.length;i<s;i++)ig(t[i],r);e.fragmentHint&&ig(e.fragmentHint,r),e.alignedSliding=!0}function GT(r,e,t){e&&(VT(r,t,e),!t.alignedSliding&&e&&Ua(t,e),!t.alignedSliding&&e&&!t.skippedSegments&&zp(e,t))}function VT(r,e,t){if($T(r,t,e)){const i=UT(t,e);i&&Ie(i.start)&&(re.log(`Adjusting PTS using last level due to CC increase within current level ${e.url}`),rg(i.start,e))}}function Ua(r,e){if(!r.hasProgramDateTime||!e.hasProgramDateTime)return;const t=r.fragments,i=e.fragments;if(!t.length||!i.length)return;let s,n;const a=Math.min(e.endCC,r.endCC);e.startCC<a&&r.startCC<a&&(s=$a(i,a),n=$a(t,a)),(!s||!n)&&(s=i[Math.floor(i.length/2)],n=$a(t,s.cc)||t[Math.floor(t.length/2)]);const o=s.programDateTime,l=n.programDateTime;if(!o||!l)return;const u=(l-o)/1e3-(n.start-s.start);rg(u,r)}const sg=Math.pow(2,17);class jT{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const i=e.url;if(!i)return Promise.reject(new nr({type:Ve.NETWORK_ERROR,details:ce.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${i?"part list":"url"}`),networkDetails:null}));this.abort();const s=this.config,n=s.fLoader,a=s.loader;return new Promise((o,l)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(v=>v[0]==="GAP")){l(ag(e));return}else e.gap=!1;const u=this.loader=e.loader=n?new n(s):new a(s),h=ng(e),f=Qp(s.fragLoadPolicy.default),g={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:sg};e.stats=u.stats,u.load(h,g,{onSuccess:(v,y,b,E)=>{this.resetLoader(e,u);let A=v.data;b.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(A.slice(0,16)),A=A.slice(16)),o({frag:e,part:null,payload:A,networkDetails:E})},onError:(v,y,b,E)=>{this.resetLoader(e,u),l(new nr({type:Ve.NETWORK_ERROR,details:ce.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:Mt({url:i,data:void 0},v),error:new Error(`HTTP Error ${v.code} ${v.text}`),networkDetails:b,stats:E}))},onAbort:(v,y,b)=>{this.resetLoader(e,u),l(new nr({type:Ve.NETWORK_ERROR,details:ce.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:b,stats:v}))},onTimeout:(v,y,b)=>{this.resetLoader(e,u),l(new nr({type:Ve.NETWORK_ERROR,details:ce.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${g.timeout}ms`),networkDetails:b,stats:v}))},onProgress:(v,y,b,E)=>{t&&t({frag:e,part:null,payload:b,networkDetails:E})}})})}loadPart(e,t,i){this.abort();const s=this.config,n=s.fLoader,a=s.loader;return new Promise((o,l)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){l(ag(e,t));return}const u=this.loader=e.loader=n?new n(s):new a(s),h=ng(e,t),f=Qp(s.fragLoadPolicy.default),g={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:sg};t.stats=u.stats,u.load(h,g,{onSuccess:(v,y,b,E)=>{this.resetLoader(e,u),this.updateStatsFromPart(e,t);const A={frag:e,part:t,payload:v.data,networkDetails:E};i(A),o(A)},onError:(v,y,b,E)=>{this.resetLoader(e,u),l(new nr({type:Ve.NETWORK_ERROR,details:ce.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:Mt({url:h.url,data:void 0},v),error:new Error(`HTTP Error ${v.code} ${v.text}`),networkDetails:b,stats:E}))},onAbort:(v,y,b)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,u),l(new nr({type:Ve.NETWORK_ERROR,details:ce.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:b,stats:v}))},onTimeout:(v,y,b)=>{this.resetLoader(e,u),l(new nr({type:Ve.NETWORK_ERROR,details:ce.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${g.timeout}ms`),networkDetails:b,stats:v}))}})})}updateStatsFromPart(e,t){const i=e.stats,s=t.stats,n=s.total;if(i.loaded+=s.loaded,n){const l=Math.round(e.duration/t.duration),u=Math.min(Math.round(i.loaded/n),l),f=(l-u)*Math.round(i.loaded/u);i.total=i.loaded+f}else i.total=Math.max(i.loaded,i.total);const a=i.loading,o=s.loading;a.start?a.first+=o.first-o.start:(a.start=o.start,a.first=o.first),a.end=o.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function ng(r,e=null){const t=e||r,i={frag:r,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},s=t.byteRangeStartOffset,n=t.byteRangeEndOffset;if(Ie(s)&&Ie(n)){var a;let o=s,l=n;if(r.sn==="initSegment"&&((a=r.decryptdata)==null?void 0:a.method)==="AES-128"){const u=n-s;u%16&&(l=n+(16-u%16)),s!==0&&(i.resetIV=!0,o=s-16)}i.rangeStart=o,i.rangeEnd=l}return i}function ag(r,e){const t=new Error(`GAP ${r.gap?"tag":"attribute"} found`),i={type:Ve.MEDIA_ERROR,details:ce.FRAG_GAP,fatal:!1,frag:r,error:t,networkDetails:null};return e&&(i.part=e),(e||r).stats.aborted=!0,new nr(i)}class nr extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class HT{constructor(e,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=t}decrypt(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}class KT{constructor(e,t){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=t}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}function zT(r){const e=r.byteLength,t=e&&new DataView(r.buffer).getUint8(e-1);return t?Zr(r,0,e-t):r}class WT{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),i=new Uint32Array(4);for(let s=0;s<4;s++)i[s]=t.getUint32(s*4);return i}initTable(){const e=this.sBox,t=this.invSBox,i=this.subMix,s=i[0],n=i[1],a=i[2],o=i[3],l=this.invSubMix,u=l[0],h=l[1],f=l[2],g=l[3],v=new Uint32Array(256);let y=0,b=0,E=0;for(E=0;E<256;E++)E<128?v[E]=E<<1:v[E]=E<<1^283;for(E=0;E<256;E++){let A=b^b<<1^b<<2^b<<3^b<<4;A=A>>>8^A&255^99,e[y]=A,t[A]=y;const M=v[y],D=v[M],B=v[D];let N=v[A]*257^A*16843008;s[y]=N<<24|N>>>8,n[y]=N<<16|N>>>16,a[y]=N<<8|N>>>24,o[y]=N,N=B*16843009^D*65537^M*257^y*16843008,u[A]=N<<24|N>>>8,h[A]=N<<16|N>>>16,f[A]=N<<8|N>>>24,g[A]=N,y?(y=M^v[v[v[B^M]]],b^=v[v[b]]):y=b=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let i=!0,s=0;for(;s<t.length&&i;)i=t[s]===this.key[s],s++;if(i)return;this.key=t;const n=this.keySize=t.length;if(n!==4&&n!==6&&n!==8)throw new Error("Invalid aes key size="+n);const a=this.ksRows=(n+6+1)*4;let o,l;const u=this.keySchedule=new Uint32Array(a),h=this.invKeySchedule=new Uint32Array(a),f=this.sBox,g=this.rcon,v=this.invSubMix,y=v[0],b=v[1],E=v[2],A=v[3];let M,D;for(o=0;o<a;o++){if(o<n){M=u[o]=t[o];continue}D=M,o%n===0?(D=D<<8|D>>>24,D=f[D>>>24]<<24|f[D>>>16&255]<<16|f[D>>>8&255]<<8|f[D&255],D^=g[o/n|0]<<24):n>6&&o%n===4&&(D=f[D>>>24]<<24|f[D>>>16&255]<<16|f[D>>>8&255]<<8|f[D&255]),u[o]=M=(u[o-n]^D)>>>0}for(l=0;l<a;l++)o=a-l,l&3?D=u[o]:D=u[o-4],l<4||o<=4?h[l]=D:h[l]=y[f[D>>>24]]^b[f[D>>>16&255]]^E[f[D>>>8&255]]^A[f[D&255]],h[l]=h[l]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,i){const s=this.keySize+6,n=this.invKeySchedule,a=this.invSBox,o=this.invSubMix,l=o[0],u=o[1],h=o[2],f=o[3],g=this.uint8ArrayToUint32Array_(i);let v=g[0],y=g[1],b=g[2],E=g[3];const A=new Int32Array(e),M=new Int32Array(A.length);let D,B,N,J,Z,se,Q,q,oe,me,he,Ee,we,ue;const ge=this.networkToHostOrderSwap;for(;t<A.length;){for(oe=ge(A[t]),me=ge(A[t+1]),he=ge(A[t+2]),Ee=ge(A[t+3]),Z=oe^n[0],se=Ee^n[1],Q=he^n[2],q=me^n[3],we=4,ue=1;ue<s;ue++)D=l[Z>>>24]^u[se>>16&255]^h[Q>>8&255]^f[q&255]^n[we],B=l[se>>>24]^u[Q>>16&255]^h[q>>8&255]^f[Z&255]^n[we+1],N=l[Q>>>24]^u[q>>16&255]^h[Z>>8&255]^f[se&255]^n[we+2],J=l[q>>>24]^u[Z>>16&255]^h[se>>8&255]^f[Q&255]^n[we+3],Z=D,se=B,Q=N,q=J,we=we+4;D=a[Z>>>24]<<24^a[se>>16&255]<<16^a[Q>>8&255]<<8^a[q&255]^n[we],B=a[se>>>24]<<24^a[Q>>16&255]<<16^a[q>>8&255]<<8^a[Z&255]^n[we+1],N=a[Q>>>24]<<24^a[q>>16&255]<<16^a[Z>>8&255]<<8^a[se&255]^n[we+2],J=a[q>>>24]<<24^a[Z>>16&255]<<16^a[se>>8&255]<<8^a[Q&255]^n[we+3],M[t]=ge(D^v),M[t+1]=ge(J^y),M[t+2]=ge(N^b),M[t+3]=ge(B^E),v=oe,y=me,b=he,E=Ee,t=t+4}return M.buffer}}const qT=16;class Mc{constructor(e,{removePKCS7Padding:t=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.useSoftware=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{const i=self.crypto;i&&(this.subtle=i.subtle||i.webkitSubtle)}catch{}this.subtle===null&&(this.useSoftware=!0)}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:e,remainderData:t}=this;if(!e||t)return this.reset(),null;const i=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?zT(i):i}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,i){return this.useSoftware?new Promise((s,n)=>{this.softwareDecrypt(new Uint8Array(e),t,i);const a=this.flush();a?s(a.buffer):n(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,i)}softwareDecrypt(e,t,i){const{currentIV:s,currentResult:n,remainderData:a}=this;this.logOnce("JS AES decrypt"),a&&(e=gi(a,e),this.remainderData=null);const o=this.getValidChunk(e);if(!o.length)return null;s&&(i=s);let l=this.softwareDecrypter;l||(l=this.softwareDecrypter=new WT),l.expandKey(t);const u=n;return this.currentResult=l.decrypt(o.buffer,0,i),this.currentIV=Zr(o,-16).buffer,u||null}webCryptoDecrypt(e,t,i){const s=this.subtle;return(this.key!==t||!this.fastAesKey)&&(this.key=t,this.fastAesKey=new KT(s,t)),this.fastAesKey.expandKey().then(n=>s?(this.logOnce("WebCrypto AES decrypt"),new HT(s,new Uint8Array(i)).decrypt(e.buffer,n)):Promise.reject(new Error("web crypto not initialized"))).catch(n=>(re.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${n.name}: ${n.message}`),this.onWebCryptoError(e,t,i)))}onWebCryptoError(e,t,i){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,i);const s=this.flush();if(s)return s.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let t=e;const i=e.length-e.length%qT;return i!==e.length&&(t=Zr(e,0,i),this.remainderData=Zr(e,i)),t}logOnce(e){this.logEnabled&&(re.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const YT={toString:function(r){let e="";const t=r.length;for(let i=0;i<t;i++)e+=`[${r.start(i).toFixed(3)}-${r.end(i).toFixed(3)}]`;return e}},pe={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"};class Fc extends FT{constructor(e,t,i,s,n){super(),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=pe.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.loadedmetadata=!1,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.onvseeking=null,this.onvended=null,this.logPrefix="",this.log=void 0,this.warn=void 0,this.playlistType=n,this.logPrefix=s,this.log=re.log.bind(re,`${s}:`),this.warn=re.warn.bind(re,`${s}:`),this.hls=e,this.fragmentLoader=new jT(e.config),this.keyLoader=i,this.fragmentTracker=t,this.config=e.config,this.decrypter=new Mc(e.config),e.on(C.MANIFEST_LOADED,this.onManifestLoaded,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;e!=null&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=pe.STOPPED}_streamEnded(e,t){if(t.live||e.nextStart||!e.end||!this.media)return!1;const i=t.partList;if(i!=null&&i.length){const n=i[i.length-1];return yt.isBuffered(this.media,n.start+n.duration/2)}const s=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(s)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null){var e;return(e=this.levelLastLoaded)==null?void 0:e.details}}onMediaAttached(e,t){const i=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),i.addEventListener("seeking",this.onvseeking),i.addEventListener("ended",this.onvended);const s=this.config;this.levels&&s.autoStartLoad&&this.state===pe.STOPPED&&this.startLoad(s.startPosition)}onMediaDetaching(){const e=this.media;e!=null&&e.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&this.onvseeking&&this.onvended&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.keyLoader&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}onMediaSeeking(){const{config:e,fragCurrent:t,media:i,mediaBuffer:s,state:n}=this,a=i?i.currentTime:0,o=yt.bufferInfo(s||i,a,e.maxBufferHole);if(this.log(`media seeking to ${Ie(a)?a.toFixed(3):a}, state: ${n}`),this.state===pe.ENDED)this.resetLoadingState();else if(t){const l=e.maxFragLookUpTolerance,u=t.start-l,h=t.start+t.duration+l;if(!o.len||h<o.start||u>o.end){const f=a>h;(a<u||f)&&(f&&t.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),t.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}i&&(this.fragmentTracker.removeFragmentsInRange(a,1/0,this.playlistType,!0),this.lastCurrentTime=a),!this.loadedmetadata&&!o.len&&(this.nextLoadPosition=this.startPosition=a),this.tickImmediate()}onMediaEnded(){this.startPosition=this.lastCurrentTime=0}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset,this.initPTS=[]}onHandlerDestroying(){this.hls.off(C.MANIFEST_LOADED,this.onManifestLoaded,this),this.stopLoad(),super.onHandlerDestroying(),this.hls=null}onHandlerDestroyed(){this.state=pe.STOPPED,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,i){this._loadFragForPlayback(e,t,i)}_loadFragForPlayback(e,t,i){const s=n=>{if(this.fragContextChanged(e)){this.warn(`Fragment ${e.sn}${n.part?" p: "+n.part.index:""} of level ${e.level} was dropped during download.`),this.fragmentTracker.removeFragment(e);return}e.stats.chunkCount++,this._handleFragmentLoadProgress(n)};this._doFragLoad(e,t,i,s).then(n=>{if(!n)return;const a=this.state;if(this.fragContextChanged(e)){(a===pe.FRAG_LOADING||!this.fragCurrent&&a===pe.PARSING)&&(this.fragmentTracker.removeFragment(e),this.state=pe.IDLE);return}"payload"in n&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(C.FRAG_LOADED,n)),this._handleFragmentLoadComplete(n)}).catch(n=>{this.state===pe.STOPPED||this.state===pe.ERROR||(this.warn(n),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:i}=this;if(i.getState(e)===Ft.APPENDING){const n=e.type,a=this.getFwdBufferInfo(this.mediaBuffer,n),o=Math.max(e.duration,a?a.len:this.config.maxBufferLength);this.reduceMaxBufferLength(o)&&i.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?i.removeAllFragments():i.hasParts(e.type)&&(i.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),i.getState(e)===Ft.PARTIAL&&i.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}flushMainBuffer(e,t,i=null){if(!(e-t))return;const s={startOffset:e,endOffset:t,type:i};this.hls.trigger(C.BUFFER_FLUSHING,s)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(i=>{if(!i||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return i}).then(i=>{const{hls:s}=this,{payload:n}=i,a=e.decryptdata;if(n&&n.byteLength>0&&a!=null&&a.key&&a.iv&&a.method==="AES-128"){const o=self.performance.now();return this.decrypter.decrypt(new Uint8Array(n),a.key.buffer,a.iv.buffer).catch(l=>{throw s.trigger(C.ERROR,{type:Ve.MEDIA_ERROR,details:ce.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:e}),l}).then(l=>{const u=self.performance.now();return s.trigger(C.FRAG_DECRYPTED,{frag:e,payload:l,stats:{tstart:o,tdecrypt:u}}),i.payload=l,this.completeInitSegmentLoad(i)})}return this.completeInitSegmentLoad(i)}).catch(i=>{this.state===pe.STOPPED||this.state===pe.ERROR||(this.warn(i),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const i=e.frag.stats;this.state=pe.IDLE,e.frag.data=new Uint8Array(e.payload),i.parsing.start=i.buffering.start=self.performance.now(),i.parsing.end=i.buffering.end=self.performance.now(),this.tick()}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){var i,s,n,a;const o=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.playlistType===$e.MAIN?"level":"track"} ${e.level} (frag:[${((i=e.startPTS)!=null?i:NaN).toFixed(3)}-${((s=e.endPTS)!=null?s:NaN).toFixed(3)}] > buffer:${o?YT.toString(yt.getBuffered(o)):"(detached)"})`),e.sn!=="initSegment"){var l;if(e.type!==$e.SUBTITLE){const h=e.elementaryStreams;if(!Object.keys(h).some(f=>!!h[f])){this.state=pe.IDLE;return}}const u=(l=this.levels)==null?void 0:l[e.level];u!=null&&u.fragmentError&&(this.log(`Resetting level fragment error count of ${u.fragmentError} on frag buffered`),u.fragmentError=0)}this.state=pe.IDLE,o&&(!this.loadedmetadata&&e.type==$e.MAIN&&o.buffered.length&&((n=this.fragCurrent)==null?void 0:n.sn)===((a=this.fragPrevious)==null?void 0:a.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:i,part:s,partsLoaded:n}=e,a=!n||n.length===0||n.some(l=>!l),o=new Oc(i.level,i.sn,i.stats.chunkCount+1,0,s?s.index:-1,!a);t.flush(o)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,i=null,s){var n;const a=t==null?void 0:t.details;if(!this.levels||!a)throw new Error(`frag load aborted, missing level${a?"":" detail"}s`);let o=null;if(e.encrypted&&!((n=e.decryptdata)!=null&&n.key)?(this.log(`Loading key for ${e.sn} of [${a.startSN}-${a.endSN}], ${this.logPrefix==="[stream-controller]"?"level":"track"} ${e.level}`),this.state=pe.KEY_LOADING,this.fragCurrent=e,o=this.keyLoader.load(e).then(h=>{if(!this.fragContextChanged(h.frag))return this.hls.trigger(C.KEY_LOADED,h),this.state===pe.KEY_LOADING&&(this.state=pe.IDLE),h}),this.hls.trigger(C.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(o=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!e.encrypted&&a.encryptedFragments.length&&this.keyLoader.loadClear(e,a.encryptedFragments),i=Math.max(e.start,i||0),this.config.lowLatencyMode&&e.sn!=="initSegment"){const h=a.partList;if(h&&s){i>e.end&&a.fragmentHint&&(e=a.fragmentHint);const f=this.getNextPart(h,e,i);if(f>-1){const g=h[f];this.log(`Loading part sn: ${e.sn} p: ${g.index} cc: ${e.cc} of playlist [${a.startSN}-${a.endSN}] parts [0-${f}-${h.length-1}] ${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(i.toFixed(3))}`),this.nextLoadPosition=g.start+g.duration,this.state=pe.FRAG_LOADING;let v;return o?v=o.then(y=>!y||this.fragContextChanged(y.frag)?null:this.doFragPartsLoad(e,g,t,s)).catch(y=>this.handleFragLoadError(y)):v=this.doFragPartsLoad(e,g,t,s).catch(y=>this.handleFragLoadError(y)),this.hls.trigger(C.FRAG_LOADING,{frag:e,part:g,targetBufferTime:i}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):v}else if(!e.url||this.loadedEndOfParts(h,i))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${a?"of ["+a.startSN+"-"+a.endSN+"] ":""}${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(i.toFixed(3))}`),Ie(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=pe.FRAG_LOADING;const l=this.config.progressive;let u;return l&&o?u=o.then(h=>!h||this.fragContextChanged(h==null?void 0:h.frag)?null:this.fragmentLoader.load(e,s)).catch(h=>this.handleFragLoadError(h)):u=Promise.all([this.fragmentLoader.load(e,l?s:void 0),o]).then(([h])=>(!l&&h&&s&&s(h),h)).catch(h=>this.handleFragLoadError(h)),this.hls.trigger(C.FRAG_LOADING,{frag:e,targetBufferTime:i}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):u}doFragPartsLoad(e,t,i,s){return new Promise((n,a)=>{var o;const l=[],u=(o=i.details)==null?void 0:o.partList,h=f=>{this.fragmentLoader.loadPart(e,f,s).then(g=>{l[f.index]=g;const v=g.part;this.hls.trigger(C.FRAG_LOADED,g);const y=Wp(i,e.sn,f.index+1)||qp(u,e.sn,f.index+1);if(y)h(y);else return n({frag:e,part:v,partsLoaded:l})}).catch(a)};h(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===ce.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(C.ERROR,t)}else this.hls.trigger(C.ERROR,{type:Ve.OTHER_ERROR,details:ce.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==pe.PARSING){!this.fragCurrent&&this.state!==pe.STOPPED&&this.state!==pe.ERROR&&(this.state=pe.IDLE);return}const{frag:i,part:s,level:n}=t,a=self.performance.now();i.stats.parsing.end=a,s&&(s.stats.parsing.end=a),this.updateLevelTiming(i,s,n,e.partial)}getCurrentContext(e){const{levels:t,fragCurrent:i}=this,{level:s,sn:n,part:a}=e;if(!(t!=null&&t[s]))return this.warn(`Levels object was unset while buffering fragment ${n} of level ${s}. The current chunk will not be buffered.`),null;const o=t[s],l=a>-1?Wp(o,n,a):null,u=l?l.fragment:yT(o,n,i);return u?(i&&i!==u&&(u.stats=i.stats),{frag:u,part:l,level:o}):null}bufferFragmentData(e,t,i,s,n){var a;if(!e||this.state!==pe.PARSING)return;const{data1:o,data2:l}=e;let u=o;if(o&&l&&(u=gi(o,l)),!((a=u)!=null&&a.length))return;const h={type:e.type,frag:t,part:i,chunkMeta:s,parent:t.type,data:u};if(this.hls.trigger(C.BUFFER_APPENDING,h),e.dropped&&e.independent&&!i){if(n)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!yt.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const i=t.currentTime,s=yt.bufferInfo(t,i,0),n=e.duration,a=Math.min(this.config.maxFragLookUpTolerance*2,n*.25),o=Math.max(Math.min(e.start-a,s.end-a),i+a);e.start-o>a&&this.flushMainBuffer(o,e.start)}getFwdBufferInfo(e,t){const i=this.getLoadPosition();return Ie(i)?this.getFwdBufferInfoAtPos(e,i,t):null}getFwdBufferInfoAtPos(e,t,i){const{config:{maxBufferHole:s}}=this,n=yt.bufferInfo(e,t,s);if(n.len===0&&n.nextStart!==void 0){const a=this.fragmentTracker.getBufferedFrag(t,i);if(a&&n.nextStart<a.end)return yt.bufferInfo(e,t,Math.max(n.nextStart,s))}return n}getMaxBufferLength(e){const{config:t}=this;let i;return e?i=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):i=t.maxBufferLength,Math.min(i,t.maxMaxBufferLength)}reduceMaxBufferLength(e){const t=this.config,i=e||t.maxBufferLength;return t.maxMaxBufferLength>=i?(t.maxMaxBufferLength/=2,this.warn(`Reduce max buffer length to ${t.maxMaxBufferLength}s`),!0):!1}getAppendedFrag(e,t=$e.MAIN){const i=this.fragmentTracker.getAppendedFrag(e,$e.MAIN);return i&&"fragment"in i?i.fragment:i}getNextFragment(e,t){const i=t.fragments,s=i.length;if(!s)return null;const{config:n}=this,a=i[0].start;let o;if(t.live){const l=n.initialLiveManifestSize;if(s<l)return this.warn(`Not enough fragments to start playback (have: ${s}, need: ${l})`),null;(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<a)&&(o=this.getInitialLiveFragment(t,i),this.startPosition=this.nextLoadPosition=o?this.hls.liveSyncPosition||o.start:e)}else e<=a&&(o=i[0]);if(!o){const l=n.lowLatencyMode?t.partEnd:t.fragmentEnd;o=this.getFragmentAtPosition(e,l,t)}return this.mapToInitFragWhenRequired(o)}isLoopLoading(e,t){const i=this.fragmentTracker.getState(e);return(i===Ft.OK||i===Ft.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,i,s,n){const a=e.gap,o=this.getNextFragment(this.nextLoadPosition,t);if(o===null)return o;if(e=o,a&&e&&!e.gap&&i.nextStart){const l=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,i.nextStart,s);if(l!==null&&i.len+l.len>=n)return this.log(`buffer full after gaps in "${s}" playlist starting at sn: ${e.sn}`),null}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!(e!=null&&e.initSegment.data)&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,i){let s=-1,n=!1,a=!0;for(let o=0,l=e.length;o<l;o++){const u=e[o];if(a=a&&!u.independent,s>-1&&i<u.start)break;const h=u.loaded;h?s=-1:(n||u.independent||a)&&u.fragment===t&&(s=o),n=h}return s}loadedEndOfParts(e,t){const i=e[e.length-1];return i&&t>i.start&&i.loaded}getInitialLiveFragment(e,t){const i=this.fragPrevious;let s=null;if(i){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${i.programDateTime}`),s=xT(t,i.endProgramDateTime,this.config.maxFragLookUpTolerance)),!s){const n=i.sn+1;if(n>=e.startSN&&n<=e.endSN){const a=t[n-e.startSN];i.cc===a.cc&&(s=a,this.log(`Live playlist, switching playlist, load frag with next SN: ${s.sn}`))}s||(s=ET(t,i.cc),s&&this.log(`Live playlist, switching playlist, load frag with same CC: ${s.sn}`))}}else{const n=this.hls.liveSyncPosition;n!==null&&(s=this.getFragmentAtPosition(n,this.bitrateTest?e.fragmentEnd:e.edge,e))}return s}getFragmentAtPosition(e,t,i){const{config:s}=this;let{fragPrevious:n}=this,{fragments:a,endSN:o}=i;const{fragmentHint:l}=i,u=s.maxFragLookUpTolerance,h=i.partList,f=!!(s.lowLatencyMode&&h!=null&&h.length&&l);f&&l&&!this.bitrateTest&&(a=a.concat(l),o=l.sn);let g;if(e<t){const v=e>t-u?0:u;g=Fa(n,a,e,v)}else g=a[a.length-1];if(g){const v=g.sn-i.startSN,y=this.fragmentTracker.getState(g);if((y===Ft.OK||y===Ft.PARTIAL&&g.gap)&&(n=g),n&&g.sn===n.sn&&(!f||h[0].fragment.sn>g.sn)&&n&&g.level===n.level){const E=a[v+1];g.sn<o&&this.fragmentTracker.getState(E)!==Ft.OK?g=E:g=null}}return g}synchronizeToLiveEdge(e){const{config:t,media:i}=this;if(!i)return;const s=this.hls.liveSyncPosition,n=i.currentTime,a=e.fragments[0].start,o=e.edge,l=n>=a-t.maxFragLookUpTolerance&&n<=o;if(s!==null&&i.duration>s&&(n<s||!l)){const u=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!l&&i.readyState<4||n<o-u)&&(this.loadedmetadata||(this.nextLoadPosition=s),i.readyState&&(this.warn(`Playback: ${n.toFixed(3)} is located too far from the end of live sliding playlist: ${o}, reset currentTime to : ${s.toFixed(3)}`),i.currentTime=s))}}alignPlaylists(e,t,i){const s=e.fragments.length;if(!s)return this.warn("No fragments in live playlist"),0;const n=e.fragments[0].start,a=!t,o=e.alignedSliding&&Ie(n);if(a||!o&&!n){const{fragPrevious:l}=this;GT(l,i,e);const u=e.fragments[0].start;return this.log(`Live playlist sliding: ${u.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} prev-sn: ${l?l.sn:"na"} fragments: ${s}`),u}return n}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let i=this.startPosition;if(i<t&&(i=-1),i===-1||this.lastCurrentTime===-1){const s=this.startTimeOffset!==null,n=s?this.startTimeOffset:e.startTimeOffset;n!==null&&Ie(n)?(i=t+n,n<0&&(i+=e.totalduration),i=Math.min(Math.max(t,i),t+e.totalduration),this.log(`Start time offset ${n} found in ${s?"multivariant":"media"} playlist, adjust startPosition to ${i}`),this.startPosition=i):e.live?i=this.hls.liveSyncPosition||t:this.startPosition=i=0,this.lastCurrentTime=i}this.nextLoadPosition=i}getLoadPosition(){const{media:e}=this;let t=0;return this.loadedmetadata&&e?t=e.currentTime:this.nextLoadPosition&&(t=this.nextLoadPosition),t}handleFragLoadAborted(e,t){this.transmuxer&&e.sn!=="initSegment"&&e.stats.aborted&&(this.warn(`Fragment ${e.sn}${t?" part "+t.index:""} of level ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==pe.FRAG_LOADING_WAITING_RETRY)&&(this.state=pe.IDLE)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const h=this.getCurrentContext(t.chunkMeta);h&&(t.frag=h.frag)}const i=t.frag;if(!i||i.type!==e||!this.levels)return;if(this.fragContextChanged(i)){var s;this.warn(`Frag load error must match current frag to retry ${i.url} > ${(s=this.fragCurrent)==null?void 0:s.url}`);return}const n=t.details===ce.FRAG_GAP;n&&this.fragmentTracker.fragBuffered(i,!0);const a=t.errorAction,{action:o,retryCount:l=0,retryConfig:u}=a||{};if(a&&o===Gt.RetryRequest&&u){this.resetStartWhenNotLoaded(this.levelLastLoaded);const h=Pc(u,l);this.warn(`Fragment ${i.sn} of ${e} ${i.level} errored with ${t.details}, retrying loading ${l+1}/${u.maxNumRetry} in ${h}ms`),a.resolved=!0,this.retryDate=self.performance.now()+h,this.state=pe.FRAG_LOADING_WAITING_RETRY}else if(u&&a)if(this.resetFragmentErrors(e),l<u.maxNumRetry)!n&&o!==Gt.RemoveAlternatePermanently&&(a.resolved=!0);else{re.warn(`${t.details} reached or exceeded max retry (${l})`);return}else(a==null?void 0:a.action)===Gt.SendAlternateToPenaltyBox?this.state=pe.WAITING_LEVEL:this.state=pe.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===pe.PARSING||this.state===pe.PARSED){const t=e.parent,i=this.getFwdBufferInfo(this.mediaBuffer,t),s=i&&i.len>.5;s&&this.reduceMaxBufferLength(i.len);const n=!s;return n&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${t} buffer`),e.frag&&(this.fragmentTracker.removeFragment(e.frag),this.nextLoadPosition=e.frag.start),this.resetLoadingState(),n}return!1}resetFragmentErrors(e){e===$e.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==pe.STOPPED&&(this.state=pe.IDLE)}afterBufferFlushed(e,t,i){if(!e)return;const s=yt.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,s,i),this.state===pe.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=pe.IDLE}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const t=e?e.details:null;t!=null&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of level ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,i,s){var n;const a=i.details;if(!a){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((l,u)=>{const h=e.elementaryStreams[u];if(h){const f=h.endPTS-h.startPTS;if(f<=0)return this.warn(`Could not parse fragment ${e.sn} ${u} duration reliably (${f})`),l||!1;const g=s?0:Kp(a,e,h.startPTS,h.endPTS,h.startDTS,h.endDTS);return this.hls.trigger(C.LEVEL_PTS_UPDATED,{details:a,level:i,drift:g,type:u,frag:e,start:h.startPTS,end:h.endPTS}),!0}return l},!1)&&((n=this.transmuxer)==null?void 0:n.error)===null){const l=new Error(`Found no media in fragment ${e.sn} of level ${e.level} resetting transmuxer to fallback to playlist timing`);if(i.fragmentError===0&&(i.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(l.message),this.hls.trigger(C.ERROR,{type:Ve.MEDIA_ERROR,details:ce.FRAG_PARSING_ERROR,fatal:!1,error:l,frag:e,reason:`Found no media in msn ${e.sn} of level "${i.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=pe.PARSED,this.hls.trigger(C.FRAG_PARSED,{frag:e,part:t})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}class og{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let i;if(e.length)e.length===1?i=e[0]:i=XT(e,t);else return new Uint8Array(0);return this.reset(),i}reset(){this.chunks.length=0,this.dataLength=0}}function XT(r,e){const t=new Uint8Array(e);let i=0;for(let s=0;s<r.length;s++){const n=r[s];t.set(n,i),i+=n.length}return t}function QT(){return typeof __HLS_WORKER_BUNDLE__=="function"}function JT(){const r=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),e=self.URL.createObjectURL(r);return{worker:new self.Worker(e),objectURL:e}}function ZT(r){const e=new self.URL(r,self.location.href).href;return{worker:new self.Worker(e),scriptURL:e}}function Wi(r="",e=9e4){return{type:r,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class Nc{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,i,s){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,i){}demux(e,t){this.cachedData&&(e=gi(this.cachedData,e),this.cachedData=null);let i=In(e,0),s=i?i.length:0,n;const a=this._audioTrack,o=this._id3Track,l=i?vc(i):void 0,u=e.length;for((this.basePTS===null||this.frameIndex===0&&Ie(l))&&(this.basePTS=eA(l,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),i&&i.length>0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:i,type:Ti.audioId3,duration:Number.POSITIVE_INFINITY});s<u;){if(this.canParse(e,s)){const h=this.appendFrame(a,e,s);h?(this.frameIndex++,this.lastPTS=h.sample.pts,s+=h.length,n=s):s=u}else ww(e,s)?(i=In(e,s),o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:i,type:Ti.audioId3,duration:Number.POSITIVE_INFINITY}),s+=i.length,n=s):s++;if(s===u&&n!==u){const h=Zr(e,n);this.cachedData?this.cachedData=gi(this.cachedData,h):this.cachedData=h}}return{audioTrack:a,videoTrack:Wi(),id3Track:o,textTrack:Wi()}}demuxSampleAes(e,t,i){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:Wi(),id3Track:this._id3Track,textTrack:Wi()}}destroy(){}}const eA=(r,e,t)=>{if(Ie(r))return r*90;const i=t?t.baseTime*9e4/t.timescale:0;return e*9e4+i};function tA(r,e,t,i){let s,n,a,o;const l=navigator.userAgent.toLowerCase(),u=i,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];s=((e[t+2]&192)>>>6)+1;const f=(e[t+2]&60)>>>2;if(f>h.length-1){const g=new Error(`invalid ADTS sampling index:${f}`);r.emit(C.ERROR,C.ERROR,{type:Ve.MEDIA_ERROR,details:ce.FRAG_PARSING_ERROR,fatal:!0,error:g,reason:g.message});return}return a=(e[t+2]&1)<<2,a|=(e[t+3]&192)>>>6,re.log(`manifest codec:${i}, ADTS type:${s}, samplingIndex:${f}`),/firefox/i.test(l)?f>=6?(s=5,o=new Array(4),n=f-3):(s=2,o=new Array(2),n=f):l.indexOf("android")!==-1?(s=2,o=new Array(2),n=f):(s=5,o=new Array(4),i&&(i.indexOf("mp4a.40.29")!==-1||i.indexOf("mp4a.40.5")!==-1)||!i&&f>=6?n=f-3:((i&&i.indexOf("mp4a.40.2")!==-1&&(f>=6&&a===1||/vivaldi/i.test(l))||!i&&a===1)&&(s=2,o=new Array(2)),n=f)),o[0]=s<<3,o[0]|=(f&14)>>1,o[1]|=(f&1)<<7,o[1]|=a<<3,s===5&&(o[1]|=(n&14)>>1,o[2]=(n&1)<<7,o[2]|=8,o[3]=0),{config:o,samplerate:h[f],channelCount:a,codec:"mp4a.40."+s,manifestCodec:u}}function lg(r,e){return r[e]===255&&(r[e+1]&246)===240}function cg(r,e){return r[e+1]&1?7:9}function Bc(r,e){return(r[e+3]&3)<<11|r[e+4]<<3|(r[e+5]&224)>>>5}function iA(r,e){return e+5<r.length}function Ga(r,e){return e+1<r.length&&lg(r,e)}function rA(r,e){return iA(r,e)&&lg(r,e)&&Bc(r,e)<=r.length-e}function sA(r,e){if(Ga(r,e)){const t=cg(r,e);if(e+t>=r.length)return!1;const i=Bc(r,e);if(i<=t)return!1;const s=e+i;return s===r.length||Ga(r,s)}return!1}function ug(r,e,t,i,s){if(!r.samplerate){const n=tA(e,t,i,s);if(!n)return;r.config=n.config,r.samplerate=n.samplerate,r.channelCount=n.channelCount,r.codec=n.codec,r.manifestCodec=n.manifestCodec,re.log(`parsed codec:${r.codec}, rate:${n.samplerate}, channels:${n.channelCount}`)}}function hg(r){return 1024*9e4/r}function nA(r,e){const t=cg(r,e);if(e+t<=r.length){const i=Bc(r,e)-t;if(i>0)return{headerLength:t,frameLength:i}}}function dg(r,e,t,i,s){const n=hg(r.samplerate),a=i+s*n,o=nA(e,t);let l;if(o){const{frameLength:f,headerLength:g}=o,v=g+f,y=Math.max(0,t+v-e.length);y?(l=new Uint8Array(v-g),l.set(e.subarray(t+g,e.length),0)):l=e.subarray(t+g,t+v);const b={unit:l,pts:a};return y||r.samples.push(b),{sample:b,length:v,missing:y}}const u=e.length-t;return l=new Uint8Array(u),l.set(e.subarray(t,e.length),0),{sample:{unit:l,pts:a},length:u,missing:-1}}let Va=null;const aA=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],oA=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],lA=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],cA=[0,1,1,4];function fg(r,e,t,i,s){if(t+24>e.length)return;const n=pg(e,t);if(n&&t+n.frameLength<=e.length){const a=n.samplesPerFrame*9e4/n.sampleRate,o=i+s*a,l={unit:e.subarray(t,t+n.frameLength),pts:o,dts:o};return r.config=[],r.channelCount=n.channelCount,r.samplerate=n.sampleRate,r.samples.push(l),{sample:l,length:n.frameLength,missing:0}}}function pg(r,e){const t=r[e+1]>>3&3,i=r[e+1]>>1&3,s=r[e+2]>>4&15,n=r[e+2]>>2&3;if(t!==1&&s!==0&&s!==15&&n!==3){const a=r[e+2]>>1&1,o=r[e+3]>>6,l=t===3?3-i:i===3?3:4,u=aA[l*14+s-1]*1e3,f=oA[(t===3?0:t===2?1:2)*3+n],g=o===3?1:2,v=lA[t][i],y=cA[i],b=v*8*y,E=Math.floor(v*u/f+a)*y;if(Va===null){const D=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Va=D?parseInt(D[1]):0}return!!Va&&Va<=87&&i===2&&u>=224e3&&o===0&&(r[e+3]=r[e+3]|128),{sampleRate:f,channelCount:g,frameLength:E,samplesPerFrame:b}}}function $c(r,e){return r[e]===255&&(r[e+1]&224)===224&&(r[e+1]&6)!==0}function gg(r,e){return e+1<r.length&&$c(r,e)}function uA(r,e){return $c(r,e)&&4<=r.length-e}function mg(r,e){if(e+1<r.length&&$c(r,e)){const i=pg(r,e);let s=4;i!=null&&i.frameLength&&(s=i.frameLength);const n=e+s;return n===r.length||gg(r,n)}return!1}class hA extends Nc{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,i,s){super.resetInitSegment(e,t,i,s),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:s,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=In(e,0);let i=(t==null?void 0:t.length)||0;if(mg(e,i))return!1;for(let s=e.length;i<s;i++)if(sA(e,i))return re.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return rA(e,t)}appendFrame(e,t,i){ug(e,this.observer,t,i,e.manifestCodec);const s=dg(e,t,i,this.basePTS,this.frameIndex);if(s&&s.missing===0)return s}}const dA=/\/emsg[-/]ID3/i;class fA{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,i,s){const n=this.videoTrack=Wi("video",1),a=this.audioTrack=Wi("audio",1),o=this.txtTrack=Wi("text",1);if(this.id3Track=Wi("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const l=yp(e);if(l.video){const{id:u,timescale:h,codec:f}=l.video;n.id=u,n.timescale=o.timescale=h,n.codec=f}if(l.audio){const{id:u,timescale:h,codec:f}=l.audio;a.id=u,a.timescale=h,a.codec=f}o.id=pp.text,n.sampleDuration=0,n.duration=a.duration=s}resetContiguity(){this.remainderData=null}static probe(e){return kw(e)}demux(e,t){this.timeOffset=t;let i=e;const s=this.videoTrack,n=this.txtTrack;if(this.config.progressive){this.remainderData&&(i=gi(this.remainderData,e));const o=Uw(i);this.remainderData=o.remainder,s.samples=o.valid||new Uint8Array}else s.samples=i;const a=this.extractID3Track(s,t);return n.samples=xp(t,s),{videoTrack:s,audioTrack:this.audioTrack,id3Track:a,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,i=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const s=this.extractID3Track(t,this.timeOffset);return i.samples=xp(e,t),{videoTrack:t,audioTrack:Wi(),id3Track:s,textTrack:Wi()}}extractID3Track(e,t){const i=this.id3Track;if(e.samples.length){const s=Qe(e.samples,["emsg"]);s&&s.forEach(n=>{const a=jw(n);if(dA.test(a.schemeIdUri)){const o=Ie(a.presentationTime)?a.presentationTime/a.timeScale:t+a.presentationTimeDelta/a.timeScale;let l=a.eventDuration===4294967295?Number.POSITIVE_INFINITY:a.eventDuration/a.timeScale;l<=.001&&(l=Number.POSITIVE_INFINITY);const u=a.payload;i.samples.push({data:u,len:u.byteLength,dts:o,pts:o,type:Ti.emsg,duration:l})}})}return i}demuxSampleAes(e,t,i){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}const vg=(r,e)=>{let t=0,i=5;e+=i;const s=new Uint32Array(1),n=new Uint32Array(1),a=new Uint8Array(1);for(;i>0;){a[0]=r[e];const o=Math.min(i,8),l=8-o;n[0]=4278190080>>>24+l<<l,s[0]=(a[0]&n[0])>>l,t=t?t<<o|s[0]:s[0],e+=1,i-=o}return t};class pA extends Nc{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,i,s){super.resetInitSegment(e,t,i,s),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:s,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,i){const s=yg(e,t,i,this.basePTS,this.frameIndex);if(s!==-1)return{sample:e.samples[e.samples.length-1],length:s,missing:0}}static probe(e){if(!e)return!1;const t=In(e,0);if(!t)return!1;const i=t.length;return e[i]===11&&e[i+1]===119&&vc(t)!==void 0&&vg(e,i)<16}}function yg(r,e,t,i,s){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return-1;const n=e[t+4]>>6;if(n>=3)return-1;const o=[48e3,44100,32e3][n],l=e[t+4]&63,h=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][l*3+n]*2;if(t+h>e.length)return-1;const f=e[t+6]>>5;let g=0;f===2?g+=2:(f&1&&f!==1&&(g+=2),f&4&&(g+=2));const v=(e[t+6]<<8|e[t+7])>>12-g&1,b=[2,1,2,3,3,4,4,5][f]+v,E=e[t+5]>>3,A=e[t+5]&7,M=new Uint8Array([n<<6|E<<1|A>>2,(A&3)<<6|f<<3|v<<2|l>>4,l<<4&224]),D=1536/o*9e4,B=i+s*D,N=e.subarray(t,t+h);return r.config=M,r.channelCount=b,r.samplerate=o,r.samples.push({unit:N,pts:B}),h}class gA{constructor(){this.VideoSample=null}createVideoSample(e,t,i,s){return{key:e,frame:!1,pts:t,dts:i,units:[],debug:s,length:0}}getLastNalUnit(e){var t;let i=this.VideoSample,s;if((!i||i.units.length===0)&&(i=e[e.length-1]),(t=i)!=null&&t.units){const n=i.units;s=n[n.length-1]}return s}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const i=t.samples,s=i.length;if(s){const n=i[s-1];e.pts=n.pts,e.dts=n.dts}else{t.dropped++;return}}t.samples.push(e)}e.debug.length&&re.log(e.pts+"/"+e.dts+":"+e.debug)}}class Sg{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,i=e.byteLength-t,s=new Uint8Array(4),n=Math.min(4,t);if(n===0)throw new Error("no bytes available");s.set(e.subarray(i,i+n)),this.word=new DataView(s.buffer).getUint32(0),this.bitsAvailable=n*8,this.bytesAvailable-=n}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const i=this.word>>>32-t;if(e>32&&re.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?i<<t|this.readBits(t):i}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(this.word&2147483648>>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}skipScalingList(e){let t=8,i=8,s;for(let n=0;n<e;n++)i!==0&&(s=this.readEG(),i=(t+s+256)%256),t=i===0?t:i}readSPS(){let e=0,t=0,i=0,s=0,n,a,o;const l=this.readUByte.bind(this),u=this.readBits.bind(this),h=this.readUEG.bind(this),f=this.readBoolean.bind(this),g=this.skipBits.bind(this),v=this.skipEG.bind(this),y=this.skipUEG.bind(this),b=this.skipScalingList.bind(this);l();const E=l();if(u(5),g(3),l(),y(),E===100||E===110||E===122||E===244||E===44||E===83||E===86||E===118||E===128){const J=h();if(J===3&&g(1),y(),y(),g(1),f())for(a=J!==3?8:12,o=0;o<a;o++)f()&&(o<6?b(16):b(64))}y();const A=h();if(A===0)h();else if(A===1)for(g(1),v(),v(),n=h(),o=0;o<n;o++)v();y(),g(1);const M=h(),D=h(),B=u(1);B===0&&g(1),g(1),f()&&(e=h(),t=h(),i=h(),s=h());let N=[1,1];if(f()&&f())switch(l()){case 1:N=[1,1];break;case 2:N=[12,11];break;case 3:N=[10,11];break;case 4:N=[16,11];break;case 5:N=[40,33];break;case 6:N=[24,11];break;case 7:N=[20,11];break;case 8:N=[32,11];break;case 9:N=[80,33];break;case 10:N=[18,11];break;case 11:N=[15,11];break;case 12:N=[64,33];break;case 13:N=[160,99];break;case 14:N=[4,3];break;case 15:N=[3,2];break;case 16:N=[2,1];break;case 255:{N=[l()<<8|l(),l()<<8|l()];break}}return{width:Math.ceil((M+1)*16-e*2-t*2),height:(2-B)*(D+1)*16-(B?2:4)*(i+s),pixelRatio:N}}readSliceType(){return this.readUByte(),this.readUEG(),this.readUEG()}}class mA extends gA{parseAVCPES(e,t,i,s,n){const a=this.parseAVCNALu(e,i.data);let o=this.VideoSample,l,u=!1;i.data=null,o&&a.length&&!e.audFound&&(this.pushAccessUnit(o,e),o=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts,"")),a.forEach(h=>{var f;switch(h.type){case 1:{let b=!1;l=!0;const E=h.data;if(u&&E.length>4){const A=new Sg(E).readSliceType();(A===2||A===4||A===7||A===9)&&(b=!0)}if(b){var g;(g=o)!=null&&g.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null)}o||(o=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts,"")),o.frame=!0,o.key=b;break}case 5:l=!0,(f=o)!=null&&f.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null),o||(o=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts,"")),o.key=!0,o.frame=!0;break;case 6:{l=!0,bp(h.data,1,i.pts,t.samples);break}case 7:{var v,y;l=!0,u=!0;const b=h.data,A=new Sg(b).readSPS();if(!e.sps||e.width!==A.width||e.height!==A.height||((v=e.pixelRatio)==null?void 0:v[0])!==A.pixelRatio[0]||((y=e.pixelRatio)==null?void 0:y[1])!==A.pixelRatio[1]){e.width=A.width,e.height=A.height,e.pixelRatio=A.pixelRatio,e.sps=[b],e.duration=n;const M=b.subarray(1,4);let D="avc1.";for(let B=0;B<3;B++){let N=M[B].toString(16);N.length<2&&(N="0"+N),D+=N}e.codec=D}break}case 8:l=!0,e.pps=[h.data];break;case 9:l=!0,e.audFound=!0,o&&this.pushAccessUnit(o,e),o=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts,"");break;case 12:l=!0;break;default:l=!1,o&&(o.debug+="unknown NAL "+h.type+" ");break}o&&l&&o.units.push(h)}),s&&o&&(this.pushAccessUnit(o,e),this.VideoSample=null)}parseAVCNALu(e,t){const i=t.byteLength;let s=e.naluState||0;const n=s,a=[];let o=0,l,u,h,f=-1,g=0;for(s===-1&&(f=0,g=t[0]&31,s=0,o=1);o<i;){if(l=t[o++],!s){s=l?0:1;continue}if(s===1){s=l?0:2;continue}if(!l)s=3;else if(l===1){if(u=o-s-1,f>=0){const v={data:t.subarray(f,u),type:g};a.push(v)}else{const v=this.getLastNalUnit(e.samples);v&&(n&&o<=4-n&&v.state&&(v.data=v.data.subarray(0,v.data.byteLength-n)),u>0&&(v.data=gi(v.data,t.subarray(0,u)),v.state=0))}o<i?(h=t[o]&31,f=o,g=h,s=0):s=-1}else s=0}if(f>=0&&s>=0){const v={data:t.subarray(f,i),type:g,state:s};a.push(v)}if(a.length===0){const v=this.getLastNalUnit(e.samples);v&&(v.data=gi(v.data,t))}return e.naluState=s,a}}class vA{constructor(e,t,i){this.keyData=void 0,this.decrypter=void 0,this.keyData=i,this.decrypter=new Mc(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}decryptAacSample(e,t,i){const s=e[t].unit;if(s.length<=16)return;const n=s.subarray(16,s.length-s.length%16),a=n.buffer.slice(n.byteOffset,n.byteOffset+n.length);this.decryptBuffer(a).then(o=>{const l=new Uint8Array(o);s.set(l,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,i)})}decryptAacSamples(e,t,i){for(;;t++){if(t>=e.length){i();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,i),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,i=new Int8Array(t);let s=0;for(let n=32;n<e.length-16;n+=160,s+=16)i.set(e.subarray(n,n+16),s);return i}getAvcDecryptedUnit(e,t){const i=new Uint8Array(t);let s=0;for(let n=32;n<e.length-16;n+=160,s+=16)e.set(i.subarray(s,s+16),n);return e}decryptAvcSample(e,t,i,s,n){const a=Ep(n.data),o=this.getAvcEncryptedData(a);this.decryptBuffer(o.buffer).then(l=>{n.data=this.getAvcDecryptedUnit(a,l),this.decrypter.isSync()||this.decryptAvcSamples(e,t,i+1,s)})}decryptAvcSamples(e,t,i,s){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,i=0){if(t>=e.length){s();return}const n=e[t].units;for(;!(i>=n.length);i++){const a=n[i];if(!(a.data.length<=48||a.type!==1&&a.type!==5)&&(this.decryptAvcSample(e,t,i,s,a),!this.decrypter.isSync()))return}}}}const Nt=188;class _r{constructor(e,t,i){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=i,this.videoParser=new mA}static probe(e){const t=_r.syncOffset(e);return t>0&&re.warn(`MPEG2-TS detected but first sync word found @ offset ${t}`),t!==-1}static syncOffset(e){const t=e.length;let i=Math.min(Nt*5,t-Nt)+1,s=0;for(;s<i;){let n=!1,a=-1,o=0;for(let l=s;l<t;l+=Nt)if(e[l]===71&&(t-l===Nt||e[l+Nt]===71)){if(o++,a===-1&&(a=l,a!==0&&(i=Math.min(a+Nt*99,e.length-Nt)+1)),n||(n=Uc(e,l)===0),n&&o>1&&(a===0&&o>2||l+Nt>i))return a}else{if(o)return-1;break}s++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:pp[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,i,s){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=_r.createTrack("video"),this._audioTrack=_r.createTrack("audio",s),this._id3Track=_r.createTrack("id3"),this._txtTrack=_r.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=i,this._duration=s}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:i}=this;e&&(e.pesData=null),t&&(t.pesData=null),i&&(i.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,i=!1,s=!1){i||(this.sampleAes=null);let n;const a=this._videoTrack,o=this._audioTrack,l=this._id3Track,u=this._txtTrack;let h=a.pid,f=a.pesData,g=o.pid,v=l.pid,y=o.pesData,b=l.pesData,E=null,A=this.pmtParsed,M=this._pmtId,D=e.length;if(this.remainderData&&(e=gi(this.remainderData,e),D=e.length,this.remainderData=null),D<Nt&&!s)return this.remainderData=e,{audioTrack:o,videoTrack:a,id3Track:l,textTrack:u};const B=Math.max(0,_r.syncOffset(e));D-=(D-B)%Nt,D<e.byteLength&&!s&&(this.remainderData=new Uint8Array(e.buffer,D,e.buffer.byteLength-D));let N=0;for(let Z=B;Z<D;Z+=Nt)if(e[Z]===71){const se=!!(e[Z+1]&64),Q=Uc(e,Z),q=(e[Z+3]&48)>>4;let oe;if(q>1){if(oe=Z+5+e[Z+4],oe===Z+Nt)continue}else oe=Z+4;switch(Q){case h:se&&(f&&(n=Ls(f))&&this.videoParser.parseAVCPES(a,u,n,!1,this._duration),f={data:[],size:0}),f&&(f.data.push(e.subarray(oe,Z+Nt)),f.size+=Z+Nt-oe);break;case g:if(se){if(y&&(n=Ls(y)))switch(o.segmentCodec){case"aac":this.parseAACPES(o,n);break;case"mp3":this.parseMPEGPES(o,n);break;case"ac3":this.parseAC3PES(o,n);break}y={data:[],size:0}}y&&(y.data.push(e.subarray(oe,Z+Nt)),y.size+=Z+Nt-oe);break;case v:se&&(b&&(n=Ls(b))&&this.parseID3PES(l,n),b={data:[],size:0}),b&&(b.data.push(e.subarray(oe,Z+Nt)),b.size+=Z+Nt-oe);break;case 0:se&&(oe+=e[oe]+1),M=this._pmtId=yA(e,oe);break;case M:{se&&(oe+=e[oe]+1);const me=SA(e,oe,this.typeSupported,i);h=me.videoPid,h>0&&(a.pid=h,a.segmentCodec=me.segmentVideoCodec),g=me.audioPid,g>0&&(o.pid=g,o.segmentCodec=me.segmentAudioCodec),v=me.id3Pid,v>0&&(l.pid=v),E!==null&&!A&&(re.warn(`MPEG-TS PMT found at ${Z} after unknown PID '${E}'. Backtracking to sync byte @${B} to parse all TS packets.`),E=null,Z=B-188),A=this.pmtParsed=!0;break}case 17:case 8191:break;default:E=Q;break}}else N++;if(N>0){const Z=new Error(`Found ${N} TS packet/s that do not start with 0x47`);this.observer.emit(C.ERROR,C.ERROR,{type:Ve.MEDIA_ERROR,details:ce.FRAG_PARSING_ERROR,fatal:!1,error:Z,reason:Z.message})}a.pesData=f,o.pesData=y,l.pesData=b;const J={audioTrack:o,videoTrack:a,id3Track:l,textTrack:u};return s&&this.extractRemainingSamples(J),J}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:i,id3Track:s,textTrack:n}=e,a=i.pesData,o=t.pesData,l=s.pesData;let u;if(a&&(u=Ls(a))?(this.videoParser.parseAVCPES(i,n,u,!0,this._duration),i.pesData=null):i.pesData=a,o&&(u=Ls(o))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,u);break;case"mp3":this.parseMPEGPES(t,u);break;case"ac3":this.parseAC3PES(t,u);break}t.pesData=null}else o!=null&&o.size&&re.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=o;l&&(u=Ls(l))?(this.parseID3PES(s,u),s.pesData=null):s.pesData=l}demuxSampleAes(e,t,i){const s=this.demux(e,i,!0,!this.config.progressive),n=this.sampleAes=new vA(this.observer,this.config,t);return this.decrypt(s,n)}decrypt(e,t){return new Promise(i=>{const{audioTrack:s,videoTrack:n}=e;s.samples&&s.segmentCodec==="aac"?t.decryptAacSamples(s.samples,0,()=>{n.samples?t.decryptAvcSamples(n.samples,0,0,()=>{i(e)}):i(e)}):n.samples&&t.decryptAvcSamples(n.samples,0,0,()=>{i(e)})})}destroy(){this._duration=0}parseAACPES(e,t){let i=0;const s=this.aacOverFlow;let n=t.data;if(s){this.aacOverFlow=null;const f=s.missing,g=s.sample.unit.byteLength;if(f===-1)n=gi(s.sample.unit,n);else{const v=g-f;s.sample.unit.set(n.subarray(0,f),v),e.samples.push(s.sample),i=s.missing}}let a,o;for(a=i,o=n.length;a<o-1&&!Ga(n,a);a++);if(a!==i){let f;const g=a<o-1;g?f=`AAC PES did not start with ADTS header,offset:${a}`:f="No ADTS header found in AAC PES";const v=new Error(f);if(re.warn(`parsing error: ${f}`),this.observer.emit(C.ERROR,C.ERROR,{type:Ve.MEDIA_ERROR,details:ce.FRAG_PARSING_ERROR,fatal:!1,levelRetry:g,error:v,reason:f}),!g)return}ug(e,this.observer,n,a,this.audioCodec);let l;if(t.pts!==void 0)l=t.pts;else if(s){const f=hg(e.samplerate);l=s.sample.pts+f}else{re.warn("[tsdemuxer]: AAC PES unknown PTS");return}let u=0,h;for(;a<o;)if(h=dg(e,n,a,l,u),a+=h.length,h.missing){this.aacOverFlow=h;break}else for(u++;a<o-1&&!Ga(n,a);a++);}parseMPEGPES(e,t){const i=t.data,s=i.length;let n=0,a=0;const o=t.pts;if(o===void 0){re.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;a<s;)if(gg(i,a)){const l=fg(e,i,a,o,n);if(l)a+=l.length,n++;else break}else a++}parseAC3PES(e,t){{const i=t.data,s=t.pts;if(s===void 0){re.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const n=i.length;let a=0,o=0,l;for(;o<n&&(l=yg(e,i,o,s,a++))>0;)o+=l}}parseID3PES(e,t){if(t.pts===void 0){re.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const i=Lt({},t,{type:this._videoTrack?Ti.emsg:Ti.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(i)}}function Uc(r,e){return((r[e+1]&31)<<8)+r[e+2]}function yA(r,e){return(r[e+10]&31)<<8|r[e+11]}function SA(r,e,t,i){const s={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},n=(r[e+1]&15)<<8|r[e+2],a=e+3+n-4,o=(r[e+10]&15)<<8|r[e+11];for(e+=12+o;e<a;){const l=Uc(r,e),u=(r[e+3]&15)<<8|r[e+4];switch(r[e]){case 207:if(!i){Gc("ADTS AAC");break}case 15:s.audioPid===-1&&(s.audioPid=l);break;case 21:s.id3Pid===-1&&(s.id3Pid=l);break;case 219:if(!i){Gc("H.264");break}case 27:s.videoPid===-1&&(s.videoPid=l,s.segmentVideoCodec="avc");break;case 3:case 4:!t.mpeg&&!t.mp3?re.log("MPEG audio found, not supported in this browser"):s.audioPid===-1&&(s.audioPid=l,s.segmentAudioCodec="mp3");break;case 193:if(!i){Gc("AC-3");break}case 129:t.ac3?s.audioPid===-1&&(s.audioPid=l,s.segmentAudioCodec="ac3"):re.log("AC-3 audio found, not supported in this browser");break;case 6:if(s.audioPid===-1&&u>0){let h=e+5,f=u;for(;f>2;){switch(r[h]){case 106:t.ac3!==!0?re.log("AC-3 audio found, not supported in this browser for now"):(s.audioPid=l,s.segmentAudioCodec="ac3");break}const v=r[h+1]+2;h+=v,f-=v}}break;case 194:case 135:re.warn("Unsupported EC-3 in M2TS found");break;case 36:re.warn("Unsupported HEVC in M2TS found");break}e+=u+5}return s}function Gc(r){re.log(`${r} with AES-128-CBC encryption found in unencrypted stream`)}function Ls(r){let e=0,t,i,s,n,a;const o=r.data;if(!r||r.size===0)return null;for(;o[0].length<19&&o.length>1;)o[0]=gi(o[0],o[1]),o.splice(1,1);if(t=o[0],(t[0]<<16)+(t[1]<<8)+t[2]===1){if(i=(t[4]<<8)+t[5],i&&i>r.size-6)return null;const u=t[7];u&192&&(n=(t[9]&14)*536870912+(t[10]&255)*4194304+(t[11]&254)*16384+(t[12]&255)*128+(t[13]&254)/2,u&64?(a=(t[14]&14)*536870912+(t[15]&255)*4194304+(t[16]&254)*16384+(t[17]&255)*128+(t[18]&254)/2,n-a>60*9e4&&(re.warn(`${Math.round((n-a)/9e4)}s delta between PTS and DTS, align them`),n=a)):a=n),s=t[8];let h=s+9;if(r.size<=h)return null;r.size-=h;const f=new Uint8Array(r.size);for(let g=0,v=o.length;g<v;g++){t=o[g];let y=t.byteLength;if(h)if(h>y){h-=y;continue}else t=t.subarray(h),y-=h,h=0;f.set(t,e),e+=y}return i&&(i-=s+3),{data:f,pts:n,dts:a,len:i}}return null}class xA extends Nc{resetInitSegment(e,t,i,s){super.resetInitSegment(e,t,i,s),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:s,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=In(e,0);let i=(t==null?void 0:t.length)||0;if(t&&e[i]===11&&e[i+1]===119&&vc(t)!==void 0&&vg(e,i)<=16)return!1;for(let s=e.length;i<s;i++)if(mg(e,i))return re.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return uA(e,t)}appendFrame(e,t,i){if(this.basePTS!==null)return fg(e,t,i,this.basePTS,this.frameIndex)}}class xg{static getSilentFrame(e,t){switch(e){case"mp4a.40.2":if(t===1)return new Uint8Array([0,200,0,128,35,128]);if(t===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(t===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(t===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(t===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(t===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(t===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}}}const Cr=Math.pow(2,32)-1;class le{static init(){le.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};let e;for(e in le.types)le.types.hasOwnProperty(e)&&(le.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),i=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);le.HDLR_TYPES={video:t,audio:i};const s=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),n=new Uint8Array([0,0,0,0,0,0,0,0]);le.STTS=le.STSC=le.STCO=n,le.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),le.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),le.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),le.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const a=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);le.FTYP=le.box(le.types.ftyp,a,l,a,o),le.DINF=le.box(le.types.dinf,le.box(le.types.dref,s))}static box(e,...t){let i=8,s=t.length;const n=s;for(;s--;)i+=t[s].byteLength;const a=new Uint8Array(i);for(a[0]=i>>24&255,a[1]=i>>16&255,a[2]=i>>8&255,a[3]=i&255,a.set(e,4),s=0,i=8;s<n;s++)a.set(t[s],i),i+=t[s].byteLength;return a}static hdlr(e){return le.box(le.types.hdlr,le.HDLR_TYPES[e])}static mdat(e){return le.box(le.types.mdat,e)}static mdhd(e,t){t*=e;const i=Math.floor(t/(Cr+1)),s=Math.floor(t%(Cr+1));return le.box(le.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,i>>24,i>>16&255,i>>8&255,i&255,s>>24,s>>16&255,s>>8&255,s&255,85,196,0,0]))}static mdia(e){return le.box(le.types.mdia,le.mdhd(e.timescale,e.duration),le.hdlr(e.type),le.minf(e))}static mfhd(e){return le.box(le.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255]))}static minf(e){return e.type==="audio"?le.box(le.types.minf,le.box(le.types.smhd,le.SMHD),le.DINF,le.stbl(e)):le.box(le.types.minf,le.box(le.types.vmhd,le.VMHD),le.DINF,le.stbl(e))}static moof(e,t,i){return le.box(le.types.moof,le.mfhd(e),le.traf(i,t))}static moov(e){let t=e.length;const i=[];for(;t--;)i[t]=le.trak(e[t]);return le.box.apply(null,[le.types.moov,le.mvhd(e[0].timescale,e[0].duration)].concat(i).concat(le.mvex(e)))}static mvex(e){let t=e.length;const i=[];for(;t--;)i[t]=le.trex(e[t]);return le.box.apply(null,[le.types.mvex,...i])}static mvhd(e,t){t*=e;const i=Math.floor(t/(Cr+1)),s=Math.floor(t%(Cr+1)),n=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,i>>24,i>>16&255,i>>8&255,i&255,s>>24,s>>16&255,s>>8&255,s&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return le.box(le.types.mvhd,n)}static sdtp(e){const t=e.samples||[],i=new Uint8Array(4+t.length);let s,n;for(s=0;s<t.length;s++)n=t[s].flags,i[s+4]=n.dependsOn<<4|n.isDependedOn<<2|n.hasRedundancy;return le.box(le.types.sdtp,i)}static stbl(e){return le.box(le.types.stbl,le.stsd(e),le.box(le.types.stts,le.STTS),le.box(le.types.stsc,le.STSC),le.box(le.types.stsz,le.STSZ),le.box(le.types.stco,le.STCO))}static avc1(e){let t=[],i=[],s,n,a;for(s=0;s<e.sps.length;s++)n=e.sps[s],a=n.byteLength,t.push(a>>>8&255),t.push(a&255),t=t.concat(Array.prototype.slice.call(n));for(s=0;s<e.pps.length;s++)n=e.pps[s],a=n.byteLength,i.push(a>>>8&255),i.push(a&255),i=i.concat(Array.prototype.slice.call(n));const o=le.box(le.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(i))),l=e.width,u=e.height,h=e.pixelRatio[0],f=e.pixelRatio[1];return le.box(le.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,l&255,u>>8&255,u&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,le.box(le.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),le.box(le.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,h&255,f>>24,f>>16&255,f>>8&255,f&255])))}static esds(e){const t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}static audioStsd(e){const t=e.samplerate;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,t&255,0,0])}static mp4a(e){return le.box(le.types.mp4a,le.audioStsd(e),le.box(le.types.esds,le.esds(e)))}static mp3(e){return le.box(le.types[".mp3"],le.audioStsd(e))}static ac3(e){return le.box(le.types["ac-3"],le.audioStsd(e),le.box(le.types.dac3,e.config))}static stsd(e){return e.type==="audio"?e.segmentCodec==="mp3"&&e.codec==="mp3"?le.box(le.types.stsd,le.STSD,le.mp3(e)):e.segmentCodec==="ac3"?le.box(le.types.stsd,le.STSD,le.ac3(e)):le.box(le.types.stsd,le.STSD,le.mp4a(e)):le.box(le.types.stsd,le.STSD,le.avc1(e))}static tkhd(e){const t=e.id,i=e.duration*e.timescale,s=e.width,n=e.height,a=Math.floor(i/(Cr+1)),o=Math.floor(i%(Cr+1));return le.box(le.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,a>>24,a>>16&255,a>>8&255,a&255,o>>24,o>>16&255,o>>8&255,o&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,s>>8&255,s&255,0,0,n>>8&255,n&255,0,0]))}static traf(e,t){const i=le.sdtp(e),s=e.id,n=Math.floor(t/(Cr+1)),a=Math.floor(t%(Cr+1));return le.box(le.types.traf,le.box(le.types.tfhd,new Uint8Array([0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255])),le.box(le.types.tfdt,new Uint8Array([1,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,a>>24,a>>16&255,a>>8&255,a&255])),le.trun(e,i.length+16+20+8+16+8+8),i)}static trak(e){return e.duration=e.duration||4294967295,le.box(le.types.trak,le.tkhd(e),le.mdia(e))}static trex(e){const t=e.id;return le.box(le.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const i=e.samples||[],s=i.length,n=12+16*s,a=new Uint8Array(n);let o,l,u,h,f,g;for(t+=8+n,a.set([e.type==="video"?1:0,0,15,1,s>>>24&255,s>>>16&255,s>>>8&255,s&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),o=0;o<s;o++)l=i[o],u=l.duration,h=l.size,f=l.flags,g=l.cts,a.set([u>>>24&255,u>>>16&255,u>>>8&255,u&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255,f.isLeading<<2|f.dependsOn,f.isDependedOn<<6|f.hasRedundancy<<4|f.paddingValue<<1|f.isNonSync,f.degradPrio&61440,f.degradPrio&15,g>>>24&255,g>>>16&255,g>>>8&255,g&255],12+16*o);return le.box(le.types.trun,a)}static initSegment(e){le.types||le.init();const t=le.moov(e);return gi(le.FTYP,t)}}le.types=void 0,le.HDLR_TYPES=void 0,le.STTS=void 0,le.STSC=void 0,le.STCO=void 0,le.STSZ=void 0,le.VMHD=void 0,le.SMHD=void 0,le.STSD=void 0,le.FTYP=void 0,le.DINF=void 0;const bg=9e4;function Vc(r,e,t=1,i=!1){const s=r*e*t;return i?Math.round(s):s}function bA(r,e,t=1,i=!1){return Vc(r,e,1/t,i)}function kn(r,e=!1){return Vc(r,1e3,1/bg,e)}function EA(r,e=1){return Vc(r,bg,1/e)}const wA=10*1e3,Eg=1024,TA=1152,AA=1536;let Is=null,jc=null;class ja{constructor(e,t,i,s=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=i,this.ISGenerated=!1,Is===null){const a=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Is=a?parseInt(a[1]):0}if(jc===null){const n=navigator.userAgent.match(/Safari\/(\d+)/i);jc=n?parseInt(n[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){re.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){re.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){re.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const i=e.reduce((s,n)=>{const a=n.pts-s;return a<-4294967296?(t=!0,mi(s,n.pts)):a>0?s:n.pts},e[0].pts);return t&&re.debug("PTS rollover detected"),i}remux(e,t,i,s,n,a,o,l){let u,h,f,g,v,y,b=n,E=n;const A=e.pid>-1,M=t.pid>-1,D=t.samples.length,B=e.samples.length>0,N=o&&D>0||D>1;if((!A||B)&&(!M||N)||this.ISGenerated||o){if(this.ISGenerated){var Z,se,Q,q;const Ee=this.videoTrackConfig;Ee&&(t.width!==Ee.width||t.height!==Ee.height||((Z=t.pixelRatio)==null?void 0:Z[0])!==((se=Ee.pixelRatio)==null?void 0:se[0])||((Q=t.pixelRatio)==null?void 0:Q[1])!==((q=Ee.pixelRatio)==null?void 0:q[1]))&&this.resetInitSegment()}else f=this.generateIS(e,t,n,a);const oe=this.isVideoContiguous;let me=-1,he;if(N&&(me=_A(t.samples),!oe&&this.config.forceKeyFrameOnDiscontinuity))if(y=!0,me>0){re.warn(`[mp4-remuxer]: Dropped ${me} out of ${D} video samples due to a missing keyframe`);const Ee=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(me),t.dropped+=me,E+=(t.samples[0].pts-Ee)/t.inputTimeScale,he=E}else me===-1&&(re.warn(`[mp4-remuxer]: No keyframe found out of ${D} video samples`),y=!1);if(this.ISGenerated){if(B&&N){const Ee=this.getVideoStartPts(t.samples),ue=(mi(e.samples[0].pts,Ee)-Ee)/t.inputTimeScale;b+=Math.max(0,ue),E+=Math.max(0,-ue)}if(B){if(e.samplerate||(re.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),f=this.generateIS(e,t,n,a)),h=this.remuxAudio(e,b,this.isAudioContiguous,a,M||N||l===$e.AUDIO?E:void 0),N){const Ee=h?h.endPTS-h.startPTS:0;t.inputTimeScale||(re.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),f=this.generateIS(e,t,n,a)),u=this.remuxVideo(t,E,oe,Ee)}}else N&&(u=this.remuxVideo(t,E,oe,0));u&&(u.firstKeyFrame=me,u.independent=me!==-1,u.firstKeyFramePTS=he)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(i.samples.length&&(v=wg(i,n,this._initPTS,this._initDTS)),s.samples.length&&(g=Tg(s,n,this._initPTS))),{audio:h,video:u,initSegment:f,independent:y,text:g,id3:v}}generateIS(e,t,i,s){const n=e.samples,a=t.samples,o=this.typeSupported,l={},u=this._initPTS;let h=!u||s,f="audio/mp4",g,v,y;if(h&&(g=v=1/0),e.config&&n.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":o.mpeg?(f="audio/mpeg",e.codec=""):o.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}l.audio={id:"audio",container:f,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&o.mpeg?new Uint8Array(0):le.initSegment([e]),metadata:{channelCount:e.channelCount}},h&&(y=e.inputTimeScale,!u||y!==u.timescale?g=v=n[0].pts-Math.round(y*i):h=!1)}if(t.sps&&t.pps&&a.length){if(t.timescale=t.inputTimeScale,l.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:le.initSegment([t]),metadata:{width:t.width,height:t.height}},h)if(y=t.inputTimeScale,!u||y!==u.timescale){const b=this.getVideoStartPts(a),E=Math.round(y*i);v=Math.min(v,mi(a[0].dts,b)-E),g=Math.min(g,b-E)}else h=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(l).length)return this.ISGenerated=!0,h?(this._initPTS={baseTime:g,timescale:y},this._initDTS={baseTime:v,timescale:y}):g=y=void 0,{tracks:l,initPTS:g,timescale:y}}remuxVideo(e,t,i,s){const n=e.inputTimeScale,a=e.samples,o=[],l=a.length,u=this._initPTS;let h=this.nextAvcDts,f=8,g=this.videoSampleDuration,v,y,b=Number.POSITIVE_INFINITY,E=Number.NEGATIVE_INFINITY,A=!1;if(!i||h===null){const ve=t*n,Se=a[0].pts-mi(a[0].dts,a[0].pts);Is&&h!==null&&Math.abs(ve-Se-h)<15e3?i=!0:h=ve-Se}const M=u.baseTime*n/u.timescale;for(let ve=0;ve<l;ve++){const Se=a[ve];Se.pts=mi(Se.pts-M,h),Se.dts=mi(Se.dts-M,h),Se.dts<a[ve>0?ve-1:ve].dts&&(A=!0)}A&&a.sort(function(ve,Se){const qe=ve.dts-Se.dts,Ue=ve.pts-Se.pts;return qe||Ue}),v=a[0].dts,y=a[a.length-1].dts;const D=y-v,B=D?Math.round(D/(l-1)):g||e.inputTimeScale/30;if(i){const ve=v-h,Se=ve>B,qe=ve<-1;if((Se||qe)&&(Se?re.warn(`AVC: ${kn(ve,!0)} ms (${ve}dts) hole between fragments detected at ${t.toFixed(3)}`):re.warn(`AVC: ${kn(-ve,!0)} ms (${ve}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!qe||h>=a[0].pts||Is)){v=h;const Ue=a[0].pts-ve;if(Se)a[0].dts=v,a[0].pts=Ue;else for(let Xe=0;Xe<a.length&&!(a[Xe].dts>Ue);Xe++)a[Xe].dts-=ve,a[Xe].pts-=ve;re.log(`Video: Initial PTS/DTS adjusted: ${kn(Ue,!0)}/${kn(v,!0)}, delta: ${kn(ve,!0)} ms`)}}v=Math.max(0,v);let N=0,J=0,Z=v;for(let ve=0;ve<l;ve++){const Se=a[ve],qe=Se.units,Ue=qe.length;let Xe=0;for(let it=0;it<Ue;it++)Xe+=qe[it].data.length;J+=Xe,N+=Ue,Se.length=Xe,Se.dts<Z?(Se.dts=Z,Z+=B/4|0||1):Z=Se.dts,b=Math.min(Se.pts,b),E=Math.max(Se.pts,E)}y=a[l-1].dts;const se=J+4*N+8;let Q;try{Q=new Uint8Array(se)}catch(ve){this.observer.emit(C.ERROR,C.ERROR,{type:Ve.MUX_ERROR,details:ce.REMUX_ALLOC_ERROR,fatal:!1,error:ve,bytes:se,reason:`fail allocating video mdat ${se}`});return}const q=new DataView(Q.buffer);q.setUint32(0,se),Q.set(le.types.mdat,4);let oe=!1,me=Number.POSITIVE_INFINITY,he=Number.POSITIVE_INFINITY,Ee=Number.NEGATIVE_INFINITY,we=Number.NEGATIVE_INFINITY;for(let ve=0;ve<l;ve++){const Se=a[ve],qe=Se.units;let Ue=0;for(let et=0,lt=qe.length;et<lt;et++){const Je=qe[et],xt=Je.data,kt=Je.data.byteLength;q.setUint32(f,kt),f+=4,Q.set(xt,f),f+=kt,Ue+=4+kt}let Xe;if(ve<l-1)g=a[ve+1].dts-Se.dts,Xe=a[ve+1].pts-Se.pts;else{const et=this.config,lt=ve>0?Se.dts-a[ve-1].dts:B;if(Xe=ve>0?Se.pts-a[ve-1].pts:B,et.stretchShortVideoTrack&&this.nextAudioPts!==null){const Je=Math.floor(et.maxBufferHole*n),xt=(s?b+s*n:this.nextAudioPts)-Se.pts;xt>Je?(g=xt-lt,g<0?g=lt:oe=!0,re.log(`[mp4-remuxer]: It is approximately ${xt/90} ms to the next segment; using duration ${g/90} ms for the last video frame.`)):g=lt}else g=lt}const it=Math.round(Se.pts-Se.dts);me=Math.min(me,g),Ee=Math.max(Ee,g),he=Math.min(he,Xe),we=Math.max(we,Xe),o.push(new Ag(Se.key,g,Ue,it))}if(o.length){if(Is){if(Is<70){const ve=o[0].flags;ve.dependsOn=2,ve.isNonSync=0}}else if(jc&&we-he<Ee-me&&B/Ee<.025&&o[0].cts===0){re.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let ve=v;for(let Se=0,qe=o.length;Se<qe;Se++){const Ue=ve+o[Se].duration,Xe=ve+o[Se].cts;if(Se<qe-1){const it=Ue+o[Se+1].cts;o[Se].duration=it-Xe}else o[Se].duration=Se?o[Se-1].duration:B;o[Se].cts=0,ve=Ue}}}g=oe||!g?B:g,this.nextAvcDts=h=y+g,this.videoSampleDuration=g,this.isVideoContiguous=!0;const Ce={data1:le.moof(e.sequenceNumber++,v,Lt({},e,{samples:o})),data2:Q,startPTS:b/n,endPTS:(E+g)/n,startDTS:v/n,endDTS:h/n,type:"video",hasAudio:!1,hasVideo:!0,nb:o.length,dropped:e.dropped};return e.samples=[],e.dropped=0,Ce}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return TA;case"ac3":return AA;default:return Eg}}remuxAudio(e,t,i,s,n){const a=e.inputTimeScale,o=e.samplerate?e.samplerate:a,l=a/o,u=this.getSamplesPerFrame(e),h=u*l,f=this._initPTS,g=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,v=[],y=n!==void 0;let b=e.samples,E=g?0:8,A=this.nextAudioPts||-1;const M=t*a,D=f.baseTime*a/f.timescale;if(this.isAudioContiguous=i=i||b.length&&A>0&&(s&&Math.abs(M-A)<9e3||Math.abs(mi(b[0].pts-D,M)-A)<20*h),b.forEach(function(ue){ue.pts=mi(ue.pts-D,M)}),!i||A<0){if(b=b.filter(ue=>ue.pts>=0),!b.length)return;n===0?A=0:s&&!y?A=Math.max(0,M):A=b[0].pts}if(e.segmentCodec==="aac"){const ue=this.config.maxAudioFramesDrift;for(let ge=0,Ce=A;ge<b.length;ge++){const ve=b[ge],Se=ve.pts,qe=Se-Ce,Ue=Math.abs(1e3*qe/a);if(qe<=-ue*h&&y)ge===0&&(re.warn(`Audio frame @ ${(Se/a).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*qe/a)} ms.`),this.nextAudioPts=A=Ce=Se);else if(qe>=ue*h&&Ue<wA&&y){let Xe=Math.round(qe/h);Ce=Se-Xe*h,Ce<0&&(Xe--,Ce+=h),ge===0&&(this.nextAudioPts=A=Ce),re.warn(`[mp4-remuxer]: Injecting ${Xe} audio frame @ ${(Ce/a).toFixed(3)}s due to ${Math.round(1e3*qe/a)} ms gap.`);for(let it=0;it<Xe;it++){const et=Math.max(Ce,0);let lt=xg.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);lt||(re.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),lt=ve.unit.subarray()),b.splice(ge,0,{unit:lt,pts:et}),Ce+=h,ge++}}ve.pts=Ce,Ce+=h}}let B=null,N=null,J,Z=0,se=b.length;for(;se--;)Z+=b[se].unit.byteLength;for(let ue=0,ge=b.length;ue<ge;ue++){const Ce=b[ue],ve=Ce.unit;let Se=Ce.pts;if(N!==null){const Ue=v[ue-1];Ue.duration=Math.round((Se-N)/l)}else if(i&&e.segmentCodec==="aac"&&(Se=A),B=Se,Z>0){Z+=E;try{J=new Uint8Array(Z)}catch(Ue){this.observer.emit(C.ERROR,C.ERROR,{type:Ve.MUX_ERROR,details:ce.REMUX_ALLOC_ERROR,fatal:!1,error:Ue,bytes:Z,reason:`fail allocating audio mdat ${Z}`});return}g||(new DataView(J.buffer).setUint32(0,Z),J.set(le.types.mdat,4))}else return;J.set(ve,E);const qe=ve.byteLength;E+=qe,v.push(new Ag(!0,u,qe,0)),N=Se}const Q=v.length;if(!Q)return;const q=v[v.length-1];this.nextAudioPts=A=N+l*q.duration;const oe=g?new Uint8Array(0):le.moof(e.sequenceNumber++,B/l,Lt({},e,{samples:v}));e.samples=[];const me=B/a,he=A/a,we={data1:oe,data2:J,startPTS:me,endPTS:he,startDTS:me,endDTS:he,type:"audio",hasAudio:!0,hasVideo:!1,nb:Q};return this.isAudioContiguous=!0,we}remuxEmptyAudio(e,t,i,s){const n=e.inputTimeScale,a=e.samplerate?e.samplerate:n,o=n/a,l=this.nextAudioPts,u=this._initDTS,h=u.baseTime*9e4/u.timescale,f=(l!==null?l:s.startDTS*n)+h,g=s.endDTS*n+h,v=o*Eg,y=Math.ceil((g-f)/v),b=xg.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(re.warn("[mp4-remuxer]: remux empty Audio"),!b){re.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}const E=[];for(let A=0;A<y;A++){const M=f+A*v;E.push({unit:b,pts:M,dts:M})}return e.samples=E,this.remuxAudio(e,t,i,!1)}}function mi(r,e){let t;if(e===null)return r;for(e<r?t=-8589934592:t=8589934592;Math.abs(r-e)>4294967296;)r+=t;return r}function _A(r){for(let e=0;e<r.length;e++)if(r[e].key)return e;return-1}function wg(r,e,t,i){const s=r.samples.length;if(!s)return;const n=r.inputTimeScale;for(let o=0;o<s;o++){const l=r.samples[o];l.pts=mi(l.pts-t.baseTime*n/t.timescale,e*n)/n,l.dts=mi(l.dts-i.baseTime*n/i.timescale,e*n)/n}const a=r.samples;return r.samples=[],{samples:a}}function Tg(r,e,t){const i=r.samples.length;if(!i)return;const s=r.inputTimeScale;for(let a=0;a<i;a++){const o=r.samples[a];o.pts=mi(o.pts-t.baseTime*s/t.timescale,e*s)/s}r.samples.sort((a,o)=>a.pts-o.pts);const n=r.samples;return r.samples=[],{samples:n}}class Ag{constructor(e,t,i,s){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=i,this.cts=s,this.flags={isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:e?0:1}}}class CA{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,i,s){this.audioCodec=t,this.videoCodec=i,this.generateInitSegment(Mw(e,s)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:i}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const s=this.initData=yp(e);s.audio&&(t=_g(s.audio,ht.AUDIO)),s.video&&(i=_g(s.video,ht.VIDEO));const n={};s.audio&&s.video?n.audiovideo={container:"video/mp4",codec:t+","+i,initSegment:e,id:"main"}:s.audio?n.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:s.video?n.video={container:"video/mp4",codec:i,initSegment:e,id:"main"}:re.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n}remux(e,t,i,s,n,a){var o,l;let{initPTS:u,lastEndTime:h}=this;const f={audio:void 0,video:void 0,text:s,id3:i,initSegment:void 0};Ie(h)||(h=this.lastEndTime=n||0);const g=t.samples;if(!(g!=null&&g.length))return f;const v={initPTS:void 0,timescale:1};let y=this.initData;if((o=y)!=null&&o.length||(this.generateInitSegment(g),y=this.initData),!((l=y)!=null&&l.length))return re.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),f;this.emitInitSegment&&(v.tracks=this.initTracks,this.emitInitSegment=!1);const b=Nw(g,y),E=Fw(y,g),A=E===null?n:E;(LA(u,A,n,b)||v.timescale!==u.timescale&&a)&&(v.initPTS=A-n,u&&u.timescale===1&&re.warn(`Adjusting initPTS by ${v.initPTS-u.baseTime}`),this.initPTS=u={baseTime:v.initPTS,timescale:1});const M=e?A-u.baseTime/u.timescale:h,D=M+b;$w(y,g,u.baseTime/u.timescale),b>0?this.lastEndTime=D:(re.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const B=!!y.audio,N=!!y.video;let J="";B&&(J+="audio"),N&&(J+="video");const Z={data1:g,startPTS:M,startDTS:M,endPTS:D,endDTS:D,type:J,hasAudio:B,hasVideo:N,nb:1,dropped:0};return f.audio=Z.type==="audio"?Z:void 0,f.video=Z.type!=="audio"?Z:void 0,f.initSegment=v,f.id3=wg(i,n,u,u),s.samples.length&&(f.text=Tg(s,n,u)),f}}function LA(r,e,t,i){if(r===null)return!0;const s=Math.max(i,1),n=e-r.baseTime/r.timescale;return Math.abs(n-t)>s}function _g(r,e){const t=r==null?void 0:r.codec;if(t&&t.length>4)return t;if(e===ht.AUDIO){if(t==="ec-3"||t==="ac-3"||t==="alac")return t;if(t==="fLaC"||t==="Opus")return Ia(t,!1);const i="mp4a.40.5";return re.info(`Parsed audio codec "${t}" or audio object type not handled. Using "${i}"`),i}return re.warn(`Unhandled video codec "${t}"`),t==="hvc1"||t==="hev1"?"hvc1.1.6.L120.90":t==="av01"?"av01.0.04M.08":"avc1.42e01e"}let ar;try{ar=self.performance.now.bind(self.performance)}catch{re.debug("Unable to use Performance API on this environment"),ar=bs==null?void 0:bs.Date.now}const Ha=[{demux:fA,remux:CA},{demux:_r,remux:ja},{demux:hA,remux:ja},{demux:xA,remux:ja}];Ha.splice(2,0,{demux:pA,remux:ja});class Cg{constructor(e,t,i,s,n){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=i,this.vendor=s,this.id=n}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,i,s){const n=i.transmuxing;n.executeStart=ar();let a=new Uint8Array(e);const{currentTransmuxState:o,transmuxConfig:l}=this;s&&(this.currentTransmuxState=s);const{contiguous:u,discontinuity:h,trackSwitch:f,accurateTimeOffset:g,timeOffset:v,initSegmentChange:y}=s||o,{audioCodec:b,videoCodec:E,defaultInitPts:A,duration:M,initSegmentData:D}=l,B=IA(a,t);if(B&&B.method==="AES-128"){const se=this.getDecrypter();if(se.isSync()){let Q=se.softwareDecrypt(a,B.key.buffer,B.iv.buffer);if(i.part>-1&&(Q=se.flush()),!Q)return n.executeEnd=ar(),Hc(i);a=new Uint8Array(Q)}else return this.decryptionPromise=se.webCryptoDecrypt(a,B.key.buffer,B.iv.buffer).then(Q=>{const q=this.push(Q,null,i);return this.decryptionPromise=null,q}),this.decryptionPromise}const N=this.needsProbing(h,f);if(N){const se=this.configureTransmuxer(a);if(se)return re.warn(`[transmuxer] ${se.message}`),this.observer.emit(C.ERROR,C.ERROR,{type:Ve.MEDIA_ERROR,details:ce.FRAG_PARSING_ERROR,fatal:!1,error:se,reason:se.message}),n.executeEnd=ar(),Hc(i)}(h||f||y||N)&&this.resetInitSegment(D,b,E,M,t),(h||y||N)&&this.resetInitialTimestamp(A),u||this.resetContiguity();const J=this.transmux(a,B,v,g,i),Z=this.currentTransmuxState;return Z.contiguous=!0,Z.discontinuity=!1,Z.trackSwitch=!1,n.executeEnd=ar(),J}flush(e){const t=e.transmuxing;t.executeStart=ar();const{decrypter:i,currentTransmuxState:s,decryptionPromise:n}=this;if(n)return n.then(()=>this.flush(e));const a=[],{timeOffset:o}=s;if(i){const f=i.flush();f&&a.push(this.push(f,null,e))}const{demuxer:l,remuxer:u}=this;if(!l||!u)return t.executeEnd=ar(),[Hc(e)];const h=l.flush(o);return Ka(h)?h.then(f=>(this.flushRemux(a,f,e),a)):(this.flushRemux(a,h,e),a)}flushRemux(e,t,i){const{audioTrack:s,videoTrack:n,id3Track:a,textTrack:o}=t,{accurateTimeOffset:l,timeOffset:u}=this.currentTransmuxState;re.log(`[transmuxer.ts]: Flushed fragment ${i.sn}${i.part>-1?" p: "+i.part:""} of level ${i.level}`);const h=this.remuxer.remux(s,n,a,o,u,l,!0,this.id);e.push({remuxResult:h,chunkMeta:i}),i.transmuxing.executeEnd=ar()}resetInitialTimestamp(e){const{demuxer:t,remuxer:i}=this;!t||!i||(t.resetTimeStamp(e),i.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,i,s,n){const{demuxer:a,remuxer:o}=this;!a||!o||(a.resetInitSegment(e,t,i,s),o.resetInitSegment(e,t,i,n))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,i,s,n){let a;return t&&t.method==="SAMPLE-AES"?a=this.transmuxSampleAes(e,t,i,s,n):a=this.transmuxUnencrypted(e,i,s,n),a}transmuxUnencrypted(e,t,i,s){const{audioTrack:n,videoTrack:a,id3Track:o,textTrack:l}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(n,a,o,l,t,i,!1,this.id),chunkMeta:s}}transmuxSampleAes(e,t,i,s,n){return this.demuxer.demuxSampleAes(e,t,i).then(a=>({remuxResult:this.remuxer.remux(a.audioTrack,a.videoTrack,a.id3Track,a.textTrack,i,s,!1,this.id),chunkMeta:n}))}configureTransmuxer(e){const{config:t,observer:i,typeSupported:s,vendor:n}=this;let a;for(let g=0,v=Ha.length;g<v;g++){var o;if((o=Ha[g].demux)!=null&&o.probe(e)){a=Ha[g];break}}if(!a)return new Error("Failed to find demuxer by probing fragment data");const l=this.demuxer,u=this.remuxer,h=a.remux,f=a.demux;(!u||!(u instanceof h))&&(this.remuxer=new h(i,t,s,n)),(!l||!(l instanceof f))&&(this.demuxer=new f(i,t,s),this.probe=f.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new Mc(this.config)),e}}function IA(r,e){let t=null;return r.byteLength>0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const Hc=r=>({remuxResult:{},chunkMeta:r});function Ka(r){return"then"in r&&r.then instanceof Function}class RA{constructor(e,t,i,s,n){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=i,this.duration=s,this.defaultInitPts=n||null}}class PA{constructor(e,t,i,s,n,a){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=i,this.trackSwitch=s,this.timeOffset=n,this.initSegmentChange=a}}var Lg={exports:{}};(function(r){var e=Object.prototype.hasOwnProperty,t="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(t=!1));function s(l,u,h){this.fn=l,this.context=u,this.once=h||!1}function n(l,u,h,f,g){if(typeof h!="function")throw new TypeError("The listener must be a function");var v=new s(h,f||l,g),y=t?t+u:u;return l._events[y]?l._events[y].fn?l._events[y]=[l._events[y],v]:l._events[y].push(v):(l._events[y]=v,l._eventsCount++),l}function a(l,u){--l._eventsCount===0?l._events=new i:delete l._events[u]}function o(){this._events=new i,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],h,f;if(this._eventsCount===0)return u;for(f in h=this._events)e.call(h,f)&&u.push(t?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(h)):u},o.prototype.listeners=function(u){var h=t?t+u:u,f=this._events[h];if(!f)return[];if(f.fn)return[f.fn];for(var g=0,v=f.length,y=new Array(v);g<v;g++)y[g]=f[g].fn;return y},o.prototype.listenerCount=function(u){var h=t?t+u:u,f=this._events[h];return f?f.fn?1:f.length:0},o.prototype.emit=function(u,h,f,g,v,y){var b=t?t+u:u;if(!this._events[b])return!1;var E=this._events[b],A=arguments.length,M,D;if(E.fn){switch(E.once&&this.removeListener(u,E.fn,void 0,!0),A){case 1:return E.fn.call(E.context),!0;case 2:return E.fn.call(E.context,h),!0;case 3:return E.fn.call(E.context,h,f),!0;case 4:return E.fn.call(E.context,h,f,g),!0;case 5:return E.fn.call(E.context,h,f,g,v),!0;case 6:return E.fn.call(E.context,h,f,g,v,y),!0}for(D=1,M=new Array(A-1);D<A;D++)M[D-1]=arguments[D];E.fn.apply(E.context,M)}else{var B=E.length,N;for(D=0;D<B;D++)switch(E[D].once&&this.removeListener(u,E[D].fn,void 0,!0),A){case 1:E[D].fn.call(E[D].context);break;case 2:E[D].fn.call(E[D].context,h);break;case 3:E[D].fn.call(E[D].context,h,f);break;case 4:E[D].fn.call(E[D].context,h,f,g);break;default:if(!M)for(N=1,M=new Array(A-1);N<A;N++)M[N-1]=arguments[N];E[D].fn.apply(E[D].context,M)}}return!0},o.prototype.on=function(u,h,f){return n(this,u,h,f,!1)},o.prototype.once=function(u,h,f){return n(this,u,h,f,!0)},o.prototype.removeListener=function(u,h,f,g){var v=t?t+u:u;if(!this._events[v])return this;if(!h)return a(this,v),this;var y=this._events[v];if(y.fn)y.fn===h&&(!g||y.once)&&(!f||y.context===f)&&a(this,v);else{for(var b=0,E=[],A=y.length;b<A;b++)(y[b].fn!==h||g&&!y[b].once||f&&y[b].context!==f)&&E.push(y[b]);E.length?this._events[v]=E.length===1?E[0]:E:a(this,v)}return this},o.prototype.removeAllListeners=function(u){var h;return u?(h=t?t+u:u,this._events[h]&&a(this,h)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,r.exports=o})(Lg);var kA=Lg.exports,Kc=iw(kA);class Ig{constructor(e,t,i,s){this.error=null,this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;const n=e.config;this.hls=e,this.id=t,this.useWorker=!!n.enableWorker,this.onTransmuxComplete=i,this.onFlush=s;const a=(h,f)=>{f=f||{},f.frag=this.frag,f.id=this.id,h===C.ERROR&&(this.error=f.error),this.hls.trigger(h,f)};this.observer=new Kc,this.observer.on(C.FRAG_DECRYPTED,a),this.observer.on(C.ERROR,a);const o=es(n.preferManagedMediaSource)||{isTypeSupported:()=>!1},l={mpeg:o.isTypeSupported("audio/mpeg"),mp3:o.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:o.isTypeSupported('audio/mp4; codecs="ac-3"')},u=navigator.vendor;if(this.useWorker&&typeof Worker<"u"&&(n.workerPath||QT())){try{n.workerPath?(re.log(`loading Web Worker ${n.workerPath} for "${t}"`),this.workerContext=ZT(n.workerPath)):(re.log(`injecting Web Worker for "${t}"`),this.workerContext=JT()),this.onwmsg=g=>this.onWorkerMessage(g);const{worker:f}=this.workerContext;f.addEventListener("message",this.onwmsg),f.onerror=g=>{const v=new Error(`${g.message} (${g.filename}:${g.lineno})`);n.enableWorker=!1,re.warn(`Error in "${t}" Web Worker, fallback to inline`),this.hls.trigger(C.ERROR,{type:Ve.OTHER_ERROR,details:ce.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:v})},f.postMessage({cmd:"init",typeSupported:l,vendor:u,id:t,config:JSON.stringify(n)})}catch(f){re.warn(`Error setting up "${t}" Web Worker, fallback to inline`,f),this.resetWorker(),this.error=null,this.transmuxer=new Cg(this.observer,l,n,u,t)}return}this.transmuxer=new Cg(this.observer,l,n,u,t)}resetWorker(){if(this.workerContext){const{worker:e,objectURL:t}=this.workerContext;t&&self.URL.revokeObjectURL(t),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,t,i,s,n,a,o,l,u,h){var f,g;u.transmuxing.start=self.performance.now();const{transmuxer:v}=this,y=a?a.start:n.start,b=n.decryptdata,E=this.frag,A=!(E&&n.cc===E.cc),M=!(E&&u.level===E.level),D=E?u.sn-E.sn:-1,B=this.part?u.part-this.part.index:-1,N=D===0&&u.id>1&&u.id===(E==null?void 0:E.stats.chunkCount),J=!M&&(D===1||D===0&&(B===1||N&&B<=0)),Z=self.performance.now();(M||D||n.stats.parsing.start===0)&&(n.stats.parsing.start=Z),a&&(B||!J)&&(a.stats.parsing.start=Z);const se=!(E&&((f=n.initSegment)==null?void 0:f.url)===((g=E.initSegment)==null?void 0:g.url)),Q=new PA(A,J,l,M,y,se);if(!J||A||se){re.log(`[transmuxer-interface, ${n.type}]: Starting new transmux session for sn: ${u.sn} p: ${u.part} level: ${u.level} id: ${u.id}
|
|
121
|
-
discontinuity: ${A}
|
|
122
|
-
trackSwitch: ${M}
|
|
123
|
-
contiguous: ${J}
|
|
124
|
-
accurateTimeOffset: ${l}
|
|
125
|
-
timeOffset: ${y}
|
|
126
|
-
initSegmentChange: ${se}`);const q=new RA(i,s,t,o,h);this.configureTransmuxer(q)}if(this.frag=n,this.part=a,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:b,chunkMeta:u,state:Q},e instanceof ArrayBuffer?[e]:[]);else if(v){const q=v.push(e,b,u,Q);Ka(q)?(v.async=!0,q.then(oe=>{this.handleTransmuxComplete(oe)}).catch(oe=>{this.transmuxerError(oe,u,"transmuxer-interface push error")})):(v.async=!1,this.handleTransmuxComplete(q))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:t}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(t){let i=t.flush(e);Ka(i)||t.async?(Ka(i)||(i=Promise.resolve(i)),i.then(n=>{this.handleFlushResult(n,e)}).catch(n=>{this.transmuxerError(n,e,"transmuxer-interface flush error")})):this.handleFlushResult(i,e)}}transmuxerError(e,t,i){this.hls&&(this.error=e,this.hls.trigger(C.ERROR,{type:Ve.MEDIA_ERROR,details:ce.FRAG_PARSING_ERROR,chunkMeta:t,fatal:!1,error:e,err:e,reason:i}))}handleFlushResult(e,t){e.forEach(i=>{this.handleTransmuxComplete(i)}),this.onFlush(t)}onWorkerMessage(e){const t=e.data,i=this.hls;switch(t.event){case"init":{var s;const n=(s=this.workerContext)==null?void 0:s.objectURL;n&&self.URL.revokeObjectURL(n);break}case"transmuxComplete":{this.handleTransmuxComplete(t.data);break}case"flush":{this.onFlush(t.data);break}case"workerLog":re[t.data.logType]&&re[t.data.logType](t.data.message);break;default:{t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,i.trigger(t.event,t.data);break}}}configureTransmuxer(e){const{transmuxer:t}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}function Rg(r,e){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(!Rs(r[t].attrs,e[t].attrs))return!1;return!0}function Rs(r,e,t){const i=r["STABLE-RENDITION-ID"];return i&&!t?i===e["STABLE-RENDITION-ID"]:!(t||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(s=>r[s]!==e[s])}function zc(r,e){return e.label.toLowerCase()===r.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(r.lang||"").toLowerCase())}const Pg=100;class DA extends Fc{constructor(e,t,i){super(e,t,i,"[audio-stream-controller]",$e.AUDIO),this.videoBuffer=null,this.videoTrackCC=-1,this.waitingVideoCC=-1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null}_registerListeners(){const{hls:e}=this;e.on(C.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(C.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(C.MANIFEST_LOADING,this.onManifestLoading,this),e.on(C.LEVEL_LOADED,this.onLevelLoaded,this),e.on(C.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(C.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(C.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(C.ERROR,this.onError,this),e.on(C.BUFFER_RESET,this.onBufferReset,this),e.on(C.BUFFER_CREATED,this.onBufferCreated,this),e.on(C.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(C.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(C.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(C.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(C.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(C.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(C.MANIFEST_LOADING,this.onManifestLoading,this),e.off(C.LEVEL_LOADED,this.onLevelLoaded,this),e.off(C.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(C.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(C.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(C.ERROR,this.onError,this),e.off(C.BUFFER_RESET,this.onBufferReset,this),e.off(C.BUFFER_CREATED,this.onBufferCreated,this),e.off(C.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(C.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(C.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(C.FRAG_BUFFERED,this.onFragBuffered,this)}onInitPtsFound(e,{frag:t,id:i,initPTS:s,timescale:n}){if(i==="main"){const a=t.cc;this.initPTS[t.cc]={baseTime:s,timescale:n},this.log(`InitPTS for cc: ${a} found from main: ${s}`),this.videoTrackCC=a,this.state===pe.WAITING_INIT_PTS&&this.tick()}}startLoad(e){if(!this.levels){this.startPosition=e,this.state=pe.STOPPED;return}const t=this.lastCurrentTime;this.stopLoad(),this.setInterval(Pg),t>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t,this.state=pe.IDLE):(this.loadedmetadata=!1,this.state=pe.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case pe.IDLE:this.doTickIdle();break;case pe.WAITING_TRACK:{var e;const{levels:i,trackId:s}=this,n=i==null||(e=i[s])==null?void 0:e.details;if(n){if(this.waitForCdnTuneIn(n))break;this.state=pe.WAITING_INIT_PTS}break}case pe.FRAG_LOADING_WAITING_RETRY:{var t;const i=performance.now(),s=this.retryDate;if(!s||i>=s||(t=this.media)!=null&&t.seeking){const{levels:n,trackId:a}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((n==null?void 0:n[a])||null),this.state=pe.IDLE}break}case pe.WAITING_INIT_PTS:{const i=this.waitingData;if(i){const{frag:s,part:n,cache:a,complete:o}=i;if(this.initPTS[s.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=pe.FRAG_LOADING;const l=a.flush(),u={frag:s,part:n,payload:l,networkDetails:null};this._handleFragmentLoadProgress(u),o&&super._handleFragmentLoadComplete(u)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${s.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const l=this.getLoadPosition(),u=yt.bufferInfo(this.mediaBuffer,l,this.config.maxBufferHole);kc(u.end,this.config.maxFragLookUpTolerance,s)<0&&(this.log(`Waiting fragment cc (${s.cc}) @ ${s.start} cancelled because another fragment at ${u.end} is needed`),this.clearWaitingFragment())}}else this.state=pe.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=pe.IDLE)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:t,media:i,trackId:s}=this,n=e.config;if(!i&&(this.startFragRequested||!n.startFragPrefetch)||!(t!=null&&t[s]))return;const a=t[s],o=a.details;if(!o||o.live&&this.levelLastLoaded!==a||this.waitForCdnTuneIn(o)){this.state=pe.WAITING_TRACK;return}const l=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&l&&(this.bufferFlushed=!1,this.afterBufferFlushed(l,ht.AUDIO,$e.AUDIO));const u=this.getFwdBufferInfo(l,$e.AUDIO);if(u===null)return;const{bufferedTrack:h,switchingTrack:f}=this;if(!f&&this._streamEnded(u,o)){e.trigger(C.BUFFER_EOS,{type:"audio"}),this.state=pe.ENDED;return}const g=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,$e.MAIN),v=u.len,y=this.getMaxBufferLength(g==null?void 0:g.len),b=o.fragments,E=b[0].start;let A=this.flushing?this.getLoadPosition():u.end;if(f&&i){const N=this.getLoadPosition();h&&!Rs(f.attrs,h.attrs)&&(A=N),o.PTSKnown&&N<E&&(u.end>E||u.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),i.currentTime=E+.05)}if(v>=y&&!f&&A<b[b.length-1].start)return;let M=this.getNextFragment(A,o),D=!1;if(M&&this.isLoopLoading(M,A)&&(D=!!M.gap,M=this.getNextFragmentLoopLoading(M,o,u,$e.MAIN,y)),!M){this.bufferFlushed=!0;return}const B=g&&M.start>g.end+o.targetduration;if(B||!(g!=null&&g.len)&&u.len){const N=this.getAppendedFrag(M.start,$e.MAIN);if(N===null||(D||(D=!!N.gap||!!B&&g.len===0),B&&!D||D&&u.nextStart&&u.nextStart<N.end))return}this.loadFragment(M,a,A)}getMaxBufferLength(e){const t=super.getMaxBufferLength();return e?Math.min(Math.max(t,e),this.config.maxMaxBufferLength):t}onMediaDetaching(){this.videoBuffer=null,this.bufferFlushed=this.flushing=!1,super.onMediaDetaching()}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(i=>new ws(i))}onAudioTrackSwitching(e,t){const i=!!t.url;this.trackId=t.id;const{fragCurrent:s}=this;s&&(s.abortRequests(),this.removeUnbufferedFrags(s.start)),this.resetLoadingState(),i?this.setInterval(Pg):this.resetTransmuxer(),i?(this.switchingTrack=t,this.state=pe.IDLE,this.flushAudioIfNeeded(t)):(this.switchingTrack=null,this.bufferedTrack=t,this.state=pe.STOPPED),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=this.flushing=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(e,t){this.mainDetails=t.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(C.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,t){var i;if(this.mainDetails==null){this.cachedTrackLoadedData=t;return}const{levels:s}=this,{details:n,id:a}=t;if(!s){this.warn(`Audio tracks were reset while loading level ${a}`);return}this.log(`Audio track ${a} loaded [${n.startSN},${n.endSN}]${n.lastPartSn?`[part-${n.lastPartSn}-${n.lastPartIndex}]`:""},duration:${n.totalduration}`);const o=s[a];let l=0;if(n.live||(i=o.details)!=null&&i.live){this.checkLiveUpdate(n);const h=this.mainDetails;if(n.deltaUpdateFailed||!h)return;if(!o.details&&n.hasProgramDateTime&&h.hasProgramDateTime)Ua(n,h),l=n.fragments[0].start;else{var u;l=this.alignPlaylists(n,o.details,(u=this.levelLastLoaded)==null?void 0:u.details)}}o.details=n,this.levelLastLoaded=o,!this.startFragRequested&&(this.mainDetails||!n.live)&&this.setStartPosition(this.mainDetails||n,l),this.state===pe.WAITING_TRACK&&!this.waitForCdnTuneIn(n)&&(this.state=pe.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:i,part:s,payload:n}=e,{config:a,trackId:o,levels:l}=this;if(!l){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${i.sn} of level ${i.level} will not be buffered`);return}const u=l[o];if(!u){this.warn("Audio track is undefined on fragment load progress");return}const h=u.details;if(!h){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(i.start);return}const f=a.defaultAudioCodec||u.audioCodec||"mp4a.40.2";let g=this.transmuxer;g||(g=this.transmuxer=new Ig(this.hls,$e.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const v=this.initPTS[i.cc],y=(t=i.initSegment)==null?void 0:t.data;if(v!==void 0){const E=s?s.index:-1,A=E!==-1,M=new Oc(i.level,i.sn,i.stats.chunkCount,n.byteLength,E,A);g.push(n,y,f,"",i,s,h.totalduration,!1,M,v)}else{this.log(`Unknown video PTS for cc ${i.cc}, waiting for video PTS before demuxing audio frag ${i.sn} of [${h.startSN} ,${h.endSN}],track ${o}`);const{cache:b}=this.waitingData=this.waitingData||{frag:i,part:s,cache:new og,complete:!1};b.push(new Uint8Array(n)),this.waitingVideoCC=this.videoTrackCC,this.state=pe.WAITING_INIT_PTS}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(e,t){const i=t.tracks.audio;i&&(this.mediaBuffer=i.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)}onFragBuffered(e,t){const{frag:i,part:s}=t;if(i.type!==$e.AUDIO){if(!this.loadedmetadata&&i.type===$e.MAIN){const n=this.videoBuffer||this.media;n&&yt.getBuffered(n).length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(i)){this.warn(`Fragment ${i.sn}${s?" p: "+s.index:""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(i.sn!=="initSegment"){this.fragPrevious=i;const n=this.switchingTrack;n&&(this.bufferedTrack=n,this.switchingTrack=null,this.hls.trigger(C.AUDIO_TRACK_SWITCHED,Mt({},n)))}this.fragBufferedComplete(i,s)}onError(e,t){var i;if(t.fatal){this.state=pe.ERROR;return}switch(t.details){case ce.FRAG_GAP:case ce.FRAG_PARSING_ERROR:case ce.FRAG_DECRYPT_ERROR:case ce.FRAG_LOAD_ERROR:case ce.FRAG_LOAD_TIMEOUT:case ce.KEY_LOAD_ERROR:case ce.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError($e.AUDIO,t);break;case ce.AUDIO_TRACK_LOAD_ERROR:case ce.AUDIO_TRACK_LOAD_TIMEOUT:case ce.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===pe.WAITING_TRACK&&((i=t.context)==null?void 0:i.type)===rt.AUDIO_TRACK&&(this.state=pe.IDLE);break;case ce.BUFFER_APPEND_ERROR:case ce.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="audio")return;if(t.details===ce.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case ce.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==ht.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==ht.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===pe.ENDED&&(this.state=pe.IDLE);const i=this.mediaBuffer||this.media;i&&(this.afterBufferFlushed(i,t,$e.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const i="audio",{hls:s}=this,{remuxResult:n,chunkMeta:a}=e,o=this.getCurrentContext(a);if(!o){this.resetWhenMissingContext(a);return}const{frag:l,part:u,level:h}=o,{details:f}=h,{audio:g,text:v,id3:y,initSegment:b}=n;if(this.fragContextChanged(l)||!f){this.fragmentTracker.removeFragment(l);return}if(this.state=pe.PARSING,this.switchingTrack&&g&&this.completeAudioSwitch(this.switchingTrack),b!=null&&b.tracks){const E=l.initSegment||l;this._bufferInitSegment(h,b.tracks,E,a),s.trigger(C.FRAG_PARSING_INIT_SEGMENT,{frag:E,id:i,tracks:b.tracks})}if(g){const{startPTS:E,endPTS:A,startDTS:M,endDTS:D}=g;u&&(u.elementaryStreams[ht.AUDIO]={startPTS:E,endPTS:A,startDTS:M,endDTS:D}),l.setElementaryStreamInfo(ht.AUDIO,E,A,M,D),this.bufferFragmentData(g,l,u,a)}if(y!=null&&(t=y.samples)!=null&&t.length){const E=Lt({id:i,frag:l,details:f},y);s.trigger(C.FRAG_PARSING_METADATA,E)}if(v){const E=Lt({id:i,frag:l,details:f},v);s.trigger(C.FRAG_PARSING_USERDATA,E)}}_bufferInitSegment(e,t,i,s){if(this.state!==pe.PARSING)return;t.video&&delete t.video;const n=t.audio;if(!n)return;n.id="audio";const a=e.audioCodec;this.log(`Init audio buffer, container:${n.container}, codecs[level/parsed]=[${a}/${n.codec}]`),a&&a.split(",").length===1&&(n.levelCodec=a),this.hls.trigger(C.BUFFER_CODECS,t);const o=n.initSegment;if(o!=null&&o.byteLength){const l={type:"audio",frag:i,part:null,chunkMeta:s,parent:i.type,data:o};this.hls.trigger(C.BUFFER_APPENDING,l)}this.tickImmediate()}loadFragment(e,t,i){const s=this.fragmentTracker.getState(e);if(this.fragCurrent=e,this.switchingTrack||s===Ft.NOT_LOADED||s===Ft.PARTIAL){var n;if(e.sn==="initSegment")this._loadInitSegment(e,t);else if((n=t.details)!=null&&n.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=pe.WAITING_INIT_PTS;const a=this.mainDetails;a&&a.fragments[0].start!==t.details.fragments[0].start&&Ua(t.details,a)}else this.startFragRequested=!0,super.loadFragment(e,t,i)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){const{media:t,bufferedTrack:i}=this,s=i==null?void 0:i.attrs,n=e.attrs;t&&s&&(s.CHANNELS!==n.CHANNELS||i.name!==e.name||i.lang!==e.lang)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null)}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(C.AUDIO_TRACK_SWITCHED,Mt({},e))}}class OA extends Dc{constructor(e){super(e,"[audio-track-controller]"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(C.MANIFEST_LOADING,this.onManifestLoading,this),e.on(C.MANIFEST_PARSED,this.onManifestParsed,this),e.on(C.LEVEL_LOADING,this.onLevelLoading,this),e.on(C.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(C.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(C.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(C.MANIFEST_LOADING,this.onManifestLoading,this),e.off(C.MANIFEST_PARSED,this.onManifestParsed,this),e.off(C.LEVEL_LOADING,this.onLevelLoading,this),e.off(C.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(C.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(C.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:i,groupId:s,details:n}=t,a=this.tracksInGroup[i];if(!a||a.groupId!==s){this.warn(`Audio track with id:${i} and group:${s} not found in active group ${a==null?void 0:a.groupId}`);return}const o=a.details;a.details=t.details,this.log(`Audio track ${i} "${a.name}" lang:${a.lang} group:${s} loaded [${n.startSN}-${n.endSN}]`),i===this.trackId&&this.playlistLoaded(i,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const i=t.audioGroups||null,s=this.groupIds;let n=this.currentTrack;if(!i||(s==null?void 0:s.length)!==(i==null?void 0:i.length)||i!=null&&i.some(o=>(s==null?void 0:s.indexOf(o))===-1)){this.groupIds=i,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(g=>!i||i.indexOf(g.groupId)!==-1);if(o.length)this.selectDefaultTrack&&!o.some(g=>g.default)&&(this.selectDefaultTrack=!1),o.forEach((g,v)=>{g.id=v});else if(!n&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const l=this.hls.config.audioPreference;if(!n&&l){const g=zi(l,o,_s);if(g>-1)n=o[g];else{const v=zi(l,this.tracks);n=this.tracks[v]}}let u=this.findTrackId(n);u===-1&&n&&(u=this.findTrackId(null));const h={audioTracks:o};this.log(`Updating audio tracks, ${o.length} track(s) found in group(s): ${i==null?void 0:i.join(",")}`),this.hls.trigger(C.AUDIO_TRACKS_UPDATED,h);const f=this.trackId;if(u!==-1&&f===-1)this.setAudioTrack(u);else if(o.length&&f===-1){var a;const g=new Error(`No audio track selected for current audio group-ID(s): ${(a=this.groupIds)==null?void 0:a.join(",")} track count: ${o.length}`);this.warn(g.message),this.hls.trigger(C.ERROR,{type:Ve.MEDIA_ERROR,details:ce.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:g})}}else this.shouldReloadPlaylist(n)&&this.setAudioTrack(this.trackId)}onError(e,t){t.fatal||!t.context||t.context.type===rt.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&(this.requestScheduled=-1,this.checkRetry(t))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const i=this.allAudioTracks;if(this.selectDefaultTrack=!1,i.length){const s=this.currentTrack;if(s&&As(e,s,_s))return s;const n=zi(e,this.tracksInGroup,_s);if(n>-1){const a=this.tracksInGroup[n];return this.setAudioTrack(n),a}else if(s){let a=t.loadLevel;a===-1&&(a=t.firstAutoLevel);const o=OT(e,t.levels,i,a,_s);if(o===-1)return null;t.nextLoadLevel=o}if(e.channels||e.audioCodec){const a=zi(e,i);if(a>-1)return i[a]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length){this.warn(`Invalid audio track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const i=this.currentTrack,s=t[e],n=s.details&&!s.details.live;if(e===this.trackId&&s===i&&n||(this.log(`Switching to audio-track ${e} "${s.name}" lang:${s.lang} group:${s.groupId} channels:${s.channels}`),this.trackId=e,this.currentTrack=s,this.hls.trigger(C.AUDIO_TRACK_SWITCHING,Mt({},s)),n))return;const a=this.switchParams(s.url,i==null?void 0:i.details,s.details);this.loadPlaylist(a)}findTrackId(e){const t=this.tracksInGroup;for(let i=0;i<t.length;i++){const s=t[i];if(!(this.selectDefaultTrack&&!s.default)&&(!e||As(e,s,_s)))return i}if(e){const{name:i,lang:s,assocLang:n,characteristics:a,audioCodec:o,channels:l}=e;for(let u=0;u<t.length;u++){const h=t[u];if(As({name:i,lang:s,assocLang:n,characteristics:a,audioCodec:o,channels:l},h,_s))return u}for(let u=0;u<t.length;u++){const h=t[u];if(Rs(e.attrs,h.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return u}for(let u=0;u<t.length;u++){const h=t[u];if(Rs(e.attrs,h.attrs,["LANGUAGE"]))return u}}return-1}loadPlaylist(e){const t=this.currentTrack;if(this.shouldLoadPlaylist(t)&&t){super.loadPlaylist();const i=t.id,s=t.groupId;let n=t.url;if(e)try{n=e.addDirectives(n)}catch(a){this.warn(`Could not construct new URL with HLS Delivery Directives: ${a}`)}this.log(`loading audio-track playlist ${i} "${t.name}" lang:${t.lang} group:${s}`),this.clearTimer(),this.hls.trigger(C.AUDIO_TRACK_LOADING,{url:n,id:i,groupId:s,deliveryDirectives:e||null})}}}const kg=500;class MA extends Fc{constructor(e,t,i){super(e,t,i,"[subtitle-stream-controller]",$e.SUBTITLE),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}_registerListeners(){const{hls:e}=this;e.on(C.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(C.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(C.MANIFEST_LOADING,this.onManifestLoading,this),e.on(C.LEVEL_LOADED,this.onLevelLoaded,this),e.on(C.ERROR,this.onError,this),e.on(C.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(C.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(C.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(C.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(C.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(C.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(C.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(C.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(C.MANIFEST_LOADING,this.onManifestLoading,this),e.off(C.LEVEL_LOADED,this.onLevelLoaded,this),e.off(C.ERROR,this.onError,this),e.off(C.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(C.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(C.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(C.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(C.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(C.FRAG_BUFFERED,this.onFragBuffered,this)}startLoad(e){this.stopLoad(),this.state=pe.IDLE,this.setInterval(kg),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()}onMediaDetaching(){this.tracksBuffered=[],super.onMediaDetaching()}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:i,success:s}=t;if(this.fragPrevious=i,this.state=pe.IDLE,!s)return;const n=this.tracksBuffered[this.currentTrackId];if(!n)return;let a;const o=i.start;for(let u=0;u<n.length;u++)if(o>=n[u].start&&o<=n[u].end){a=n[u];break}const l=i.start+i.duration;a?a.end=l:(a={start:o,end:l},n.push(a)),this.fragmentTracker.fragBuffered(i),this.fragBufferedComplete(i,null)}onBufferFlushing(e,t){const{startOffset:i,endOffset:s}=t;if(i===0&&s!==Number.POSITIVE_INFINITY){const n=s-1;if(n<=0)return;t.endOffsetSubtitles=Math.max(0,n),this.tracksBuffered.forEach(a=>{for(let o=0;o<a.length;){if(a[o].end<=n){a.shift();continue}else if(a[o].start<n)a[o].start=n;else break;o++}}),this.fragmentTracker.removeFragmentsInRange(i,n,$e.SUBTITLE)}}onFragBuffered(e,t){if(!this.loadedmetadata&&t.frag.type===$e.MAIN){var i;(i=this.media)!=null&&i.buffered.length&&(this.loadedmetadata=!0)}}onError(e,t){const i=t.frag;(i==null?void 0:i.type)===$e.SUBTITLE&&(this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==pe.STOPPED&&(this.state=pe.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&Rg(this.levels,t)){this.levels=t.map(i=>new ws(i));return}this.tracksBuffered=[],this.levels=t.map(i=>{const s=new ws(i);return this.tracksBuffered[s.id]=[],s}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,$e.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var i;if(this.currentTrackId=t.id,!((i=this.levels)!=null&&i.length)||this.currentTrackId===-1){this.clearInterval();return}const s=this.levels[this.currentTrackId];s!=null&&s.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,s&&this.setInterval(kg)}onSubtitleTrackLoaded(e,t){var i;const{currentTrackId:s,levels:n}=this,{details:a,id:o}=t;if(!n){this.warn(`Subtitle tracks were reset while loading level ${o}`);return}const l=n[s];if(o>=n.length||o!==s||!l)return;this.log(`Subtitle track ${o} loaded [${a.startSN},${a.endSN}]${a.lastPartSn?`[part-${a.lastPartSn}-${a.lastPartIndex}]`:""},duration:${a.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let u=0;if(a.live||(i=l.details)!=null&&i.live){const f=this.mainDetails;if(a.deltaUpdateFailed||!f)return;const g=f.fragments[0];if(!l.details)a.hasProgramDateTime&&f.hasProgramDateTime?(Ua(a,f),u=a.fragments[0].start):g&&(u=g.start,Rc(a,u));else{var h;u=this.alignPlaylists(a,l.details,(h=this.levelLastLoaded)==null?void 0:h.details),u===0&&g&&(u=g.start,Rc(a,u))}}l.details=a,this.levelLastLoaded=l,!this.startFragRequested&&(this.mainDetails||!a.live)&&this.setStartPosition(this.mainDetails||a,u),this.tick(),a.live&&!this.fragCurrent&&this.media&&this.state===pe.IDLE&&(Fa(null,a.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),l.details=void 0))}_handleFragmentLoadComplete(e){const{frag:t,payload:i}=e,s=t.decryptdata,n=this.hls;if(!this.fragContextChanged(t)&&i&&i.byteLength>0&&s!=null&&s.key&&s.iv&&s.method==="AES-128"){const a=performance.now();this.decrypter.decrypt(new Uint8Array(i),s.key.buffer,s.iv.buffer).catch(o=>{throw n.trigger(C.ERROR,{type:Ve.MEDIA_ERROR,details:ce.FRAG_DECRYPT_ERROR,fatal:!1,error:o,reason:o.message,frag:t}),o}).then(o=>{const l=performance.now();n.trigger(C.FRAG_DECRYPTED,{frag:t,payload:o,stats:{tstart:a,tdecrypt:l}})}).catch(o=>{this.warn(`${o.name}: ${o.message}`),this.state=pe.IDLE})}}doTick(){if(!this.media){this.state=pe.IDLE;return}if(this.state===pe.IDLE){const{currentTrackId:e,levels:t}=this,i=t==null?void 0:t[e];if(!i||!t.length||!i.details)return;const{config:s}=this,n=this.getLoadPosition(),a=yt.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],n,s.maxBufferHole),{end:o,len:l}=a,u=this.getFwdBufferInfo(this.media,$e.MAIN),h=i.details,f=this.getMaxBufferLength(u==null?void 0:u.len)+h.levelTargetDuration;if(l>f)return;const g=h.fragments,v=g.length,y=h.edge;let b=null;const E=this.fragPrevious;if(o<y){const A=s.maxFragLookUpTolerance,M=o>y-A?0:A;b=Fa(E,g,Math.max(g[0].start,o),M),!b&&E&&E.start<g[0].start&&(b=g[0])}else b=g[v-1];if(!b)return;if(b=this.mapToInitFragWhenRequired(b),b.sn!=="initSegment"){const A=b.sn-h.startSN,M=g[A-1];M&&M.cc===b.cc&&this.fragmentTracker.getState(M)===Ft.NOT_LOADED&&(b=M)}this.fragmentTracker.getState(b)===Ft.NOT_LOADED&&this.loadFragment(b,i,o)}}getMaxBufferLength(e){const t=super.getMaxBufferLength();return e?Math.max(t,e):t}loadFragment(e,t,i){this.fragCurrent=e,e.sn==="initSegment"?this._loadInitSegment(e,t):(this.startFragRequested=!0,super.loadFragment(e,t,i))}get mediaBufferTimeRanges(){return new FA(this.tracksBuffered[this.currentTrackId]||[])}}class FA{constructor(e){this.buffered=void 0;const t=(i,s,n)=>{if(s=s>>>0,s>n-1)throw new DOMException(`Failed to execute '${i}' on 'TimeRanges': The index provided (${s}) is greater than the maximum bound (${n})`);return e[s][i]};this.buffered={get length(){return e.length},end(i){return t("end",i,e.length)},start(i){return t("start",i,e.length)}}}}class NA extends Dc{constructor(e){super(e,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const i=Ra(this.media.textTracks);for(let n=0;n<i.length;n++)if(i[n].mode==="hidden")t=i[n];else if(i[n].mode==="showing"){t=i[n];break}const s=this.findTrackForTextTrack(t);this.subtitleTrack!==s&&this.setSubtitleTrack(s)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(C.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(C.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(C.MANIFEST_LOADING,this.onManifestLoading,this),e.on(C.MANIFEST_PARSED,this.onManifestParsed,this),e.on(C.LEVEL_LOADING,this.onLevelLoading,this),e.on(C.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(C.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(C.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(C.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(C.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(C.MANIFEST_LOADING,this.onManifestLoading,this),e.off(C.MANIFEST_PARSED,this.onManifestParsed,this),e.off(C.LEVEL_LOADING,this.onLevelLoading,this),e.off(C.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(C.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(C.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),Ra(this.media.textTracks).forEach(t=>{Es(t)}),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:i,groupId:s,details:n}=t,a=this.tracksInGroup[i];if(!a||a.groupId!==s){this.warn(`Subtitle track with id:${i} and group:${s} not found in active group ${a==null?void 0:a.groupId}`);return}const o=a.details;a.details=t.details,this.log(`Subtitle track ${i} "${a.name}" lang:${a.lang} group:${s} loaded [${n.startSN}-${n.endSN}]`),i===this.trackId&&this.playlistLoaded(i,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const i=t.subtitleGroups||null,s=this.groupIds;let n=this.currentTrack;if(!i||(s==null?void 0:s.length)!==(i==null?void 0:i.length)||i!=null&&i.some(a=>(s==null?void 0:s.indexOf(a))===-1)){this.groupIds=i,this.trackId=-1,this.currentTrack=null;const a=this.tracks.filter(h=>!i||i.indexOf(h.groupId)!==-1);if(a.length)this.selectDefaultTrack&&!a.some(h=>h.default)&&(this.selectDefaultTrack=!1),a.forEach((h,f)=>{h.id=f});else if(!n&&!this.tracksInGroup.length)return;this.tracksInGroup=a;const o=this.hls.config.subtitlePreference;if(!n&&o){this.selectDefaultTrack=!1;const h=zi(o,a);if(h>-1)n=a[h];else{const f=zi(o,this.tracks);n=this.tracks[f]}}let l=this.findTrackId(n);l===-1&&n&&(l=this.findTrackId(null));const u={subtitleTracks:a};this.log(`Updating subtitle tracks, ${a.length} track(s) found in "${i==null?void 0:i.join(",")}" group-id`),this.hls.trigger(C.SUBTITLE_TRACKS_UPDATED,u),l!==-1&&this.trackId===-1&&this.setSubtitleTrack(l)}else this.shouldReloadPlaylist(n)&&this.setSubtitleTrack(this.trackId)}findTrackId(e){const t=this.tracksInGroup,i=this.selectDefaultTrack;for(let s=0;s<t.length;s++){const n=t[s];if(!(i&&!n.default||!i&&!e)&&(!e||As(n,e)))return s}if(e){for(let s=0;s<t.length;s++){const n=t[s];if(Rs(e.attrs,n.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return s}for(let s=0;s<t.length;s++){const n=t[s];if(Rs(e.attrs,n.attrs,["LANGUAGE"]))return s}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let i=0;i<t.length;i++){const s=t[i];if(zc(s,e))return i}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===rt.SUBTITLE_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1,this.setSubtitleTrack(e)}setSubtitleOption(e){if(this.hls.config.subtitlePreference=e,e){const t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){const i=this.currentTrack;if(i&&As(e,i))return i;const s=zi(e,this.tracksInGroup);if(s>-1){const n=this.tracksInGroup[s];return this.setSubtitleTrack(s),n}else{if(i)return null;{const n=zi(e,t);if(n>-1)return t[n]}}}}return null}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;if(this.shouldLoadPlaylist(t)&&t){const i=t.id,s=t.groupId;let n=t.url;if(e)try{n=e.addDirectives(n)}catch(a){this.warn(`Could not construct new URL with HLS Delivery Directives: ${a}`)}this.log(`Loading subtitle playlist for id ${i}`),this.hls.trigger(C.SUBTITLE_TRACK_LOADING,{url:n,id:i,groupId:s,deliveryDirectives:e||null})}}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=Ra(e.textTracks),i=this.currentTrack;let s;if(i&&(s=t.filter(n=>zc(i,n))[0],s||this.warn(`Unable to find subtitle TextTrack with name "${i.name}" and language "${i.lang}"`)),[].slice.call(t).forEach(n=>{n.mode!=="disabled"&&n!==s&&(n.mode="disabled")}),s){const n=this.subtitleDisplay?"showing":"hidden";s.mode!==n&&(s.mode=n)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!Ie(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const i=this.currentTrack,s=t[e]||null;if(this.trackId=e,this.currentTrack=s,this.toggleTrackModes(),!s){this.hls.trigger(C.SUBTITLE_TRACK_SWITCH,{id:e});return}const n=!!s.details&&!s.details.live;if(e===this.trackId&&s===i&&n)return;this.log(`Switching to subtitle-track ${e}`+(s?` "${s.name}" lang:${s.lang} group:${s.groupId}`:""));const{id:a,groupId:o="",name:l,type:u,url:h}=s;this.hls.trigger(C.SUBTITLE_TRACK_SWITCH,{id:a,groupId:o,name:l,type:u,url:h});const f=this.switchParams(s.url,i==null?void 0:i.details,s.details);this.loadPlaylist(f)}}class BA{constructor(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}append(e,t,i){const s=this.queues[t];s.push(e),s.length===1&&!i&&this.executeNext(t)}insertAbort(e,t){this.queues[t].unshift(e),this.executeNext(t)}appendBlocker(e){let t;const i=new Promise(n=>{t=n}),s={execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(s,e),i}executeNext(e){const t=this.queues[e];if(t.length){const i=t[0];try{i.execute()}catch(s){re.warn(`[buffer-operation-queue]: Exception executing "${e}" SourceBuffer operation: ${s}`),i.onError(s);const n=this.buffers[e];n!=null&&n.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const Dg=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/;class $A{constructor(e){this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendSource=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this.log=void 0,this.warn=void 0,this.error=void 0,this._onEndStreaming=i=>{this.hls&&this.hls.pauseBuffering()},this._onStartStreaming=i=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=()=>{const{media:i,mediaSource:s}=this;this.log("Media source opened"),i&&(i.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(C.MEDIA_ATTACHED,{media:i,mediaSource:s})),s&&s.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:i,_objectUrl:s}=this;i!==s&&re.error(`Media element src was set while attaching MediaSource (${s} > ${i})`)},this.hls=e;const t="[buffer-controller]";this.appendSource=Yw(es(e.config.preferManagedMediaSource)),this.log=re.log.bind(re,t),this.warn=re.warn.bind(re,t),this.error=re.error.bind(re,t),this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null,this.hls=null}registerListeners(){const{hls:e}=this;e.on(C.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(C.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(C.MANIFEST_LOADING,this.onManifestLoading,this),e.on(C.MANIFEST_PARSED,this.onManifestParsed,this),e.on(C.BUFFER_RESET,this.onBufferReset,this),e.on(C.BUFFER_APPENDING,this.onBufferAppending,this),e.on(C.BUFFER_CODECS,this.onBufferCodecs,this),e.on(C.BUFFER_EOS,this.onBufferEos,this),e.on(C.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(C.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(C.FRAG_PARSED,this.onFragParsed,this),e.on(C.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off(C.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(C.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(C.MANIFEST_LOADING,this.onManifestLoading,this),e.off(C.MANIFEST_PARSED,this.onManifestParsed,this),e.off(C.BUFFER_RESET,this.onBufferReset,this),e.off(C.BUFFER_APPENDING,this.onBufferAppending,this),e.off(C.BUFFER_CODECS,this.onBufferCodecs,this),e.off(C.BUFFER_EOS,this.onBufferEos,this),e.off(C.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(C.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(C.FRAG_PARSED,this.onFragParsed,this),e.off(C.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new BA(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.appendErrors={audio:0,video:0,audiovideo:0},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){let i=2;(t.audio&&!t.video||!t.altAudio)&&(i=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=i,this.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(e,t){const i=this.media=t.media,s=es(this.appendSource);if(i&&s){var n;const a=this.mediaSource=new s;this.log(`created media source: ${(n=a.constructor)==null?void 0:n.name}`),a.addEventListener("sourceopen",this._onMediaSourceOpen),a.addEventListener("sourceended",this._onMediaSourceEnded),a.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(a.addEventListener("startstreaming",this._onStartStreaming),a.addEventListener("endstreaming",this._onEndStreaming));const o=this._objectUrl=self.URL.createObjectURL(a);if(this.appendSource)try{i.removeAttribute("src");const l=self.ManagedMediaSource;i.disableRemotePlayback=i.disableRemotePlayback||l&&a instanceof l,Og(i),UA(i,o),i.load()}catch{i.src=o}else i.src=o;i.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:t,_objectUrl:i}=this;if(t){if(this.log("media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(s){this.warn(`onMediaDetaching: ${s.message} while calling endOfStream`)}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(t.removeEventListener("startstreaming",this._onStartStreaming),t.removeEventListener("endstreaming",this._onEndStreaming)),e&&(e.removeEventListener("emptied",this._onMediaEmptied),i&&self.URL.revokeObjectURL(i),this.mediaSrc===i?(e.removeAttribute("src"),this.appendSource&&Og(e),e.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(C.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach(e=>{this.resetBuffer(e)}),this._initSourceBuffer()}resetBuffer(e){const t=this.sourceBuffer[e];try{if(t){var i;this.removeBufferListeners(e),this.sourceBuffer[e]=void 0,(i=this.mediaSource)!=null&&i.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(t)}}catch(s){this.warn(`onBufferReset ${e}`,s)}}onBufferCodecs(e,t){const i=this.getSourceBufferTypes().length,s=Object.keys(t);if(s.forEach(a=>{if(i){const l=this.tracks[a];if(l&&typeof l.buffer.changeType=="function"){var o;const{id:u,codec:h,levelCodec:f,container:g,metadata:v}=t[a],y=Lp(l.codec,l.levelCodec),b=y==null?void 0:y.replace(Dg,"$1");let E=Lp(h,f);const A=(o=E)==null?void 0:o.replace(Dg,"$1");if(E&&b!==A){a.slice(0,5)==="audio"&&(E=Ia(E,this.appendSource));const M=`${g};codecs=${E}`;this.appendChangeType(a,M),this.log(`switching codec ${y} to ${E}`),this.tracks[a]={buffer:l.buffer,codec:h,container:g,levelCodec:f,metadata:v,id:u}}}}else this.pendingTracks[a]=t[a]}),i)return;const n=Math.max(this.bufferCodecEventsExpected-1,0);this.bufferCodecEventsExpected!==n&&(this.log(`${n} bufferCodec event(s) expected ${s.join(",")}`),this.bufferCodecEventsExpected=n),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()}appendChangeType(e,t){const{operationQueue:i}=this,s={execute:()=>{const n=this.sourceBuffer[e];n&&(this.log(`changing ${e} sourceBuffer type to ${t}`),n.changeType(t)),i.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:n=>{this.warn(`Failed to change ${e} SourceBuffer type`,n)}};i.append(s,e,!!this.pendingTracks[e])}onBufferAppending(e,t){const{hls:i,operationQueue:s,tracks:n}=this,{data:a,type:o,frag:l,part:u,chunkMeta:h}=t,f=h.buffering[o],g=self.performance.now();f.start=g;const v=l.stats.buffering,y=u?u.stats.buffering:null;v.start===0&&(v.start=g),y&&y.start===0&&(y.start=g);const b=n.audio;let E=!1;o==="audio"&&(b==null?void 0:b.container)==="audio/mpeg"&&(E=!this.lastMpegAudioChunk||h.id===1||this.lastMpegAudioChunk.sn!==h.sn,this.lastMpegAudioChunk=h);const A=l.start,M={execute:()=>{if(f.executeStart=self.performance.now(),E){const D=this.sourceBuffer[o];if(D){const B=A-D.timestampOffset;Math.abs(B)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${A} (delta: ${B}) sn: ${l.sn})`),D.timestampOffset=A)}}this.appendExecutor(a,o)},onStart:()=>{},onComplete:()=>{const D=self.performance.now();f.executeEnd=f.end=D,v.first===0&&(v.first=D),y&&y.first===0&&(y.first=D);const{sourceBuffer:B}=this,N={};for(const J in B)N[J]=yt.getBuffered(B[J]);this.appendErrors[o]=0,o==="audio"||o==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(C.BUFFER_APPENDED,{type:o,frag:l,part:u,chunkMeta:h,parent:l.type,timeRanges:N})},onError:D=>{const B={type:Ve.MEDIA_ERROR,parent:l.type,details:ce.BUFFER_APPEND_ERROR,sourceBufferName:o,frag:l,part:u,chunkMeta:h,error:D,err:D,fatal:!1};if(D.code===DOMException.QUOTA_EXCEEDED_ERR)B.details=ce.BUFFER_FULL_ERROR;else{const N=++this.appendErrors[o];B.details=ce.BUFFER_APPEND_ERROR,this.warn(`Failed ${N}/${i.config.appendErrorMaxRetry} times to append segment in "${o}" sourceBuffer`),N>=i.config.appendErrorMaxRetry&&(B.fatal=!0)}i.trigger(C.ERROR,B)}};s.append(M,o,!!this.pendingTracks[o])}onBufferFlushing(e,t){const{operationQueue:i}=this,s=n=>({execute:this.removeExecutor.bind(this,n,t.startOffset,t.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(C.BUFFER_FLUSHED,{type:n})},onError:a=>{this.warn(`Failed to remove from ${n} SourceBuffer`,a)}});t.type?i.append(s(t.type),t.type):this.getSourceBufferTypes().forEach(n=>{i.append(s(n),n)})}onFragParsed(e,t){const{frag:i,part:s}=t,n=[],a=s?s.elementaryStreams:i.elementaryStreams;a[ht.AUDIOVIDEO]?n.push("audiovideo"):(a[ht.AUDIO]&&n.push("audio"),a[ht.VIDEO]&&n.push("video"));const o=()=>{const l=self.performance.now();i.stats.buffering.end=l,s&&(s.stats.buffering.end=l);const u=s?s.stats:i.stats;this.hls.trigger(C.FRAG_BUFFERED,{frag:i,part:s,stats:u,id:i.type})};n.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${i.type} level: ${i.level} sn: ${i.sn}`),this.blockBuffers(o,n)}onFragChanged(e,t){this.trimBuffers()}onBufferEos(e,t){this.getSourceBufferTypes().reduce((s,n)=>{const a=this.sourceBuffer[n];return a&&(!t.type||t.type===n)&&(a.ending=!0,a.ended||(a.ended=!0,this.log(`${n} sourceBuffer now EOS`))),s&&!!(!a||a.ended)},!0)&&(this.log("Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(n=>{const a=this.sourceBuffer[n];a&&(a.ending=!1)});const{mediaSource:s}=this;if(!s||s.readyState!=="open"){s&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${s.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),s.endOfStream()}))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}trimBuffers(){const{hls:e,details:t,media:i}=this;if(!i||t===null||!this.getSourceBufferTypes().length)return;const n=e.config,a=i.currentTime,o=t.levelTargetDuration,l=t.live&&n.liveBackBufferLength!==null?n.liveBackBufferLength:n.backBufferLength;if(Ie(l)&&l>0){const u=Math.max(l,o),h=Math.floor(a/o)*o-u;this.flushBackBuffer(a,o,h)}if(Ie(n.frontBufferFlushThreshold)&&n.frontBufferFlushThreshold>0){const u=Math.max(n.maxBufferLength,n.frontBufferFlushThreshold),h=Math.max(u,o),f=Math.floor(a/o)*o+h;this.flushFrontBuffer(a,o,f)}}flushBackBuffer(e,t,i){const{details:s,sourceBuffer:n}=this;this.getSourceBufferTypes().forEach(o=>{const l=n[o];if(l){const u=yt.getBuffered(l);if(u.length>0&&i>u.start(0)){if(this.hls.trigger(C.BACK_BUFFER_REACHED,{bufferEnd:i}),s!=null&&s.live)this.hls.trigger(C.LIVE_BACK_BUFFER_REACHED,{bufferEnd:i});else if(l.ended&&u.end(u.length-1)-e<t*2){this.log(`Cannot flush ${o} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(C.BUFFER_FLUSHING,{startOffset:0,endOffset:i,type:o})}}})}flushFrontBuffer(e,t,i){const{sourceBuffer:s}=this;this.getSourceBufferTypes().forEach(a=>{const o=s[a];if(o){const l=yt.getBuffered(o),u=l.length;if(u<2)return;const h=l.start(u-1),f=l.end(u-1);if(i>h||e>=h&&e<=f)return;if(o.ended&&e-f<2*t){this.log(`Cannot flush ${a} front buffer while SourceBuffer is in ended state`);return}this.hls.trigger(C.BUFFER_FLUSHING,{startOffset:h,endOffset:1/0,type:a})}})}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;const{details:e,hls:t,media:i,mediaSource:s}=this,n=e.fragments[0].start+e.totalduration,a=i.duration,o=Ie(s.duration)?s.duration:0;e.live&&t.config.liveDurationInfinity?(s.duration=1/0,this.updateSeekableRange(e)):(n>o&&n>a||!Ie(a))&&(this.log(`Updating Media Source duration to ${n.toFixed(3)}`),s.duration=n)}updateSeekableRange(e){const t=this.mediaSource,i=e.fragments;if(i.length&&e.live&&t!=null&&t.setLiveSeekableRange){const n=Math.max(0,i[0].start),a=Math.max(n,n+e.totalduration);this.log(`Media Source duration is set to ${t.duration}. Setting seekable range to ${n}-${a}.`),t.setLiveSeekableRange(n,a)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:t,pendingTracks:i}=this,s=Object.keys(i).length;if(s&&(!e||s===2||"audiovideo"in i)){this.createSourceBuffers(i),this.pendingTracks={};const n=this.getSourceBufferTypes();if(n.length)this.hls.trigger(C.BUFFER_CREATED,{tracks:this.tracks}),n.forEach(a=>{t.executeNext(a)});else{const a=new Error("could not create source buffer for media codec(s)");this.hls.trigger(C.ERROR,{type:Ve.MEDIA_ERROR,details:ce.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:a,reason:a.message})}}}createSourceBuffers(e){const{sourceBuffer:t,mediaSource:i}=this;if(!i)throw Error("createSourceBuffers called when mediaSource was null");for(const n in e)if(!t[n]){var s;const a=e[n];if(!a)throw Error(`source buffer exists for track ${n}, however track does not`);let o=((s=a.levelCodec)==null?void 0:s.indexOf(","))===-1?a.levelCodec:a.codec;o&&n.slice(0,5)==="audio"&&(o=Ia(o,this.appendSource));const l=`${a.container};codecs=${o}`;this.log(`creating sourceBuffer(${l})`);try{const u=t[n]=i.addSourceBuffer(l),h=n;this.addBufferListener(h,"updatestart",this._onSBUpdateStart),this.addBufferListener(h,"updateend",this._onSBUpdateEnd),this.addBufferListener(h,"error",this._onSBUpdateError),this.appendSource&&this.addBufferListener(h,"bufferedchange",(f,g)=>{const v=g.removedRanges;v!=null&&v.length&&this.hls.trigger(C.BUFFER_FLUSHED,{type:n})}),this.tracks[n]={buffer:u,codec:o,container:a.container,levelCodec:a.levelCodec,metadata:a.metadata,id:a.id}}catch(u){this.error(`error while trying to add sourceBuffer: ${u.message}`),this.hls.trigger(C.ERROR,{type:Ve.MEDIA_ERROR,details:ce.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:u,sourceBufferName:n,mimeType:l})}}}get mediaSrc(){var e;const t=((e=this.media)==null?void 0:e.firstChild)||this.media;return t==null?void 0:t.src}_onSBUpdateStart(e){const{operationQueue:t}=this;t.current(e).onStart()}_onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const{operationQueue:i}=this;i.current(e).onComplete(),i.shiftAndExecuteNext(e)}_onSBUpdateError(e,t){var i;const s=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(i=this.mediaSource)==null?void 0:i.readyState}`);this.error(`${s}`,t),this.hls.trigger(C.ERROR,{type:Ve.MEDIA_ERROR,details:ce.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:s,fatal:!1});const n=this.operationQueue.current(e);n&&n.onError(s)}removeExecutor(e,t,i){const{media:s,mediaSource:n,operationQueue:a,sourceBuffer:o}=this,l=o[e];if(!s||!n||!l){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),a.shiftAndExecuteNext(e);return}const u=Ie(s.duration)?s.duration:1/0,h=Ie(n.duration)?n.duration:1/0,f=Math.max(0,t),g=Math.min(i,u,h);g>f&&(!l.ending||l.ended)?(l.ended=!1,this.log(`Removing [${f},${g}] from the ${e} SourceBuffer`),l.remove(f,g)):a.shiftAndExecuteNext(e)}appendExecutor(e,t){const i=this.sourceBuffer[t];if(!i){if(!this.pendingTracks[t])throw new Error(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);return}i.ended=!1,i.appendBuffer(e)}blockBuffers(e,t=this.getSourceBufferTypes()){if(!t.length){this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);return}const{operationQueue:i}=this,s=t.map(n=>i.appendBlocker(n));Promise.all(s).then(()=>{e(),t.forEach(n=>{const a=this.sourceBuffer[n];a!=null&&a.updating||i.shiftAndExecuteNext(n)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,t,i){const s=this.sourceBuffer[e];if(!s)return;const n=i.bind(this,e);this.listeners[e].push({event:t,listener:n}),s.addEventListener(t,n)}removeBufferListeners(e){const t=this.sourceBuffer[e];t&&this.listeners[e].forEach(i=>{t.removeEventListener(i.event,i.listener)})}}function Og(r){const e=r.querySelectorAll("source");[].slice.call(e).forEach(t=>{r.removeChild(t)})}function UA(r,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,r.appendChild(t)}const Mg={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},Fg=function(e){let t=e;return Mg.hasOwnProperty(e)&&(t=Mg[e]),String.fromCharCode(t)},_i=15,or=100,GA={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},VA={17:2,18:4,21:6,22:8,23:10,19:13,20:15},jA={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},HA={25:2,26:4,29:6,30:8,31:10,27:13,28:15},KA=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class zA{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const i=typeof t=="function"?t():t;re.log(`${this.time} [${e}] ${i}`)}}}const ts=function(e){const t=[];for(let i=0;i<e.length;i++)t.push(e[i].toString(16));return t};class Ng{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let i=0;i<t.length;i++){const s=t[i];e.hasOwnProperty(s)&&(this[s]=e[s])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class WA{constructor(){this.uchar=" ",this.penState=new Ng}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}}class qA{constructor(e){this.chars=[],this.pos=0,this.currPenState=new Ng,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<or;t++)this.chars.push(new WA);this.logger=e}equals(e){for(let t=0;t<or;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<or;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<or;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>or&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=or)}moveCursor(e){const t=this.pos+e;if(e>1)for(let i=this.pos+1;i<t+1;i++)this.chars[i].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const t=Fg(e);if(this.pos>=or){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}clearFromPos(e){let t;for(t=e;t<or;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let i=0;i<or;i++){const s=this.chars[i].uchar;s!==" "&&(t=!1),e.push(s)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class Wc{constructor(e){this.rows=[],this.currRow=_i-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<_i;t++)this.rows.push(new qA(e));this.logger=e}reset(){for(let e=0;e<_i;e++)this.rows[e].clear();this.currRow=_i-1}equals(e){let t=!0;for(let i=0;i<_i;i++)if(!this.rows[i].equals(e.rows[i])){t=!1;break}return t}copy(e){for(let t=0;t<_i;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<_i;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,"setCursor: "+e),this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,()=>"pacData = "+JSON.stringify(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let o=0;o<_i;o++)this.rows[o].clear();const n=this.currRow+1-this.nrRollUpRows,a=this.lastOutputScreen;if(a){const o=a.rows[n].cueStartTime,l=this.logger.time;if(o!==null&&l!==null&&o<l)for(let u=0;u<this.nrRollUpRows;u++)this.rows[t-this.nrRollUpRows+u+1].copy(a.rows[n+u])}}this.currRow=t;const i=this.rows[this.currRow];if(e.indent!==null){const n=e.indent,a=Math.max(n-1,0);i.setCursor(e.indent),e.color=i.chars[a].penState.foreground}const s={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(s)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let i="",s=-1;for(let n=0;n<_i;n++){const a=this.rows[n].getTextString();a&&(s=n+1,e?t.push("Row "+s+": '"+a+"'"):t.push(a.trim()))}return t.length>0&&(e?i="["+t.join(" | ")+"]":i=t.join(`
|
|
127
|
-
`)),i}getTextAndFormat(){return this.rows}}class Bg{constructor(e,t,i){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new Wc(i),this.nonDisplayedMemory=new Wc(i),this.lastOutputScreen=new Wc(i),this.currRollUpRow=this.displayedMemory.rows[_i-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=i}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[_i-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let i=0;i<e.length;i++)this.writeScreen.insertChar(e[i]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>t+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const i=Math.floor(e/2)-16,s=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=s[i]}this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;t!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class $g{constructor(e,t,i){this.channels=void 0,this.currentChannel=0,this.cmdHistory=Gg(),this.logger=void 0;const s=this.logger=new zA;this.channels=[null,new Bg(e,t,s),new Bg(e+1,i,s)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){let i,s,n,a=!1;this.logger.time=e;for(let o=0;o<t.length;o+=2)if(s=t[o]&127,n=t[o+1]&127,!(s===0&&n===0)){if(this.logger.log(3,"["+ts([t[o],t[o+1]])+"] -> ("+ts([s,n])+")"),i=this.parseCmd(s,n),i||(i=this.parseMidrow(s,n)),i||(i=this.parsePAC(s,n)),i||(i=this.parseBackgroundAttributes(s,n)),!i&&(a=this.parseChars(s,n),a)){const l=this.currentChannel;l&&l>0?this.channels[l].insertChars(a):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!i&&!a&&this.logger.log(2,"Couldn't parse cleaned data "+ts([s,n])+" orig: "+ts([t[o],t[o+1]]))}}parseCmd(e,t){const{cmdHistory:i}=this,s=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,n=(e===23||e===31)&&t>=33&&t<=35;if(!(s||n))return!1;if(Ug(e,t,i))return Ps(null,null,i),this.logger.log(3,"Repeated command ("+ts([e,t])+") is dropped"),!0;const a=e===20||e===21||e===23?1:2,o=this.channels[a];return e===20||e===21||e===28||e===29?t===32?o.ccRCL():t===33?o.ccBS():t===34?o.ccAOF():t===35?o.ccAON():t===36?o.ccDER():t===37?o.ccRU(2):t===38?o.ccRU(3):t===39?o.ccRU(4):t===40?o.ccFON():t===41?o.ccRDC():t===42?o.ccTR():t===43?o.ccRTD():t===44?o.ccEDM():t===45?o.ccCR():t===46?o.ccENM():t===47&&o.ccEOC():o.ccTO(t-32),Ps(e,t,i),this.currentChannel=a,!0}parseMidrow(e,t){let i=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?i=1:i=2,i!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const s=this.channels[i];return s?(s.ccMIDROW(t),this.logger.log(3,"MIDROW ("+ts([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let i;const s=this.cmdHistory,n=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,a=(e===16||e===24)&&t>=64&&t<=95;if(!(n||a))return!1;if(Ug(e,t,s))return Ps(null,null,s),!0;const o=e<=23?1:2;t>=64&&t<=95?i=o===1?GA[e]:jA[e]:i=o===1?VA[e]:HA[e];const l=this.channels[o];return l?(l.setPAC(this.interpretPAC(i,t)),Ps(e,t,s),this.currentChannel=o,!0):!1}interpretPAC(e,t){let i;const s={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?i=t-96:i=t-64,s.underline=(i&1)===1,i<=13?s.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(i/2)]:i<=15?(s.italics=!0,s.color="white"):s.indent=Math.floor((i-16)/2)*4,s}parseChars(e,t){let i,s=null,n=null;if(e>=25?(i=2,n=e-8):(i=1,n=e),n>=17&&n<=19){let a;n===17?a=t+80:n===18?a=t+112:a=t+144,this.logger.log(2,"Special char '"+Fg(a)+"' in channel "+i),s=[a]}else e>=32&&e<=127&&(s=t===0?[e]:[e,t]);if(s){const a=ts(s);this.logger.log(3,"Char codes = "+a.join(",")),Ps(e,t,this.cmdHistory)}return s}parseBackgroundAttributes(e,t){const i=(e===16||e===24)&&t>=32&&t<=47,s=(e===23||e===31)&&t>=45&&t<=47;if(!(i||s))return!1;let n;const a={};e===16||e===24?(n=Math.floor((t-32)/2),a.background=KA[n],t%2===1&&(a.background=a.background+"_semi")):t===45?a.background="transparent":(a.foreground="black",t===47&&(a.underline=!0));const o=e<=23?1:2;return this.channels[o].setBkgData(a),Ps(e,t,this.cmdHistory),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}this.cmdHistory=Gg()}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const i=this.channels[t];i&&i.cueSplitAtTime(e)}}}function Ps(r,e,t){t.a=r,t.b=e}function Ug(r,e,t){return t.a===r&&t.b===e}function Gg(){return{a:null,b:null}}class za{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,i){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=i,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var qc=function(){if(bs!=null&&bs.VTTCue)return self.VTTCue;const r=["","lr","rl"],e=["start","middle","end","left","right"];function t(o,l){if(typeof l!="string"||!Array.isArray(o))return!1;const u=l.toLowerCase();return~o.indexOf(u)?u:!1}function i(o){return t(r,o)}function s(o){return t(e,o)}function n(o,...l){let u=1;for(;u<arguments.length;u++){const h=arguments[u];for(const f in h)o[f]=h[f]}return o}function a(o,l,u){const h=this,f={enumerable:!0};h.hasBeenReset=!1;let g="",v=!1,y=o,b=l,E=u,A=null,M="",D=!0,B="auto",N="start",J=50,Z="middle",se=50,Q="middle";Object.defineProperty(h,"id",n({},f,{get:function(){return g},set:function(q){g=""+q}})),Object.defineProperty(h,"pauseOnExit",n({},f,{get:function(){return v},set:function(q){v=!!q}})),Object.defineProperty(h,"startTime",n({},f,{get:function(){return y},set:function(q){if(typeof q!="number")throw new TypeError("Start time must be set to a number.");y=q,this.hasBeenReset=!0}})),Object.defineProperty(h,"endTime",n({},f,{get:function(){return b},set:function(q){if(typeof q!="number")throw new TypeError("End time must be set to a number.");b=q,this.hasBeenReset=!0}})),Object.defineProperty(h,"text",n({},f,{get:function(){return E},set:function(q){E=""+q,this.hasBeenReset=!0}})),Object.defineProperty(h,"region",n({},f,{get:function(){return A},set:function(q){A=q,this.hasBeenReset=!0}})),Object.defineProperty(h,"vertical",n({},f,{get:function(){return M},set:function(q){const oe=i(q);if(oe===!1)throw new SyntaxError("An invalid or illegal string was specified.");M=oe,this.hasBeenReset=!0}})),Object.defineProperty(h,"snapToLines",n({},f,{get:function(){return D},set:function(q){D=!!q,this.hasBeenReset=!0}})),Object.defineProperty(h,"line",n({},f,{get:function(){return B},set:function(q){if(typeof q!="number"&&q!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");B=q,this.hasBeenReset=!0}})),Object.defineProperty(h,"lineAlign",n({},f,{get:function(){return N},set:function(q){const oe=s(q);if(!oe)throw new SyntaxError("An invalid or illegal string was specified.");N=oe,this.hasBeenReset=!0}})),Object.defineProperty(h,"position",n({},f,{get:function(){return J},set:function(q){if(q<0||q>100)throw new Error("Position must be between 0 and 100.");J=q,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",n({},f,{get:function(){return Z},set:function(q){const oe=s(q);if(!oe)throw new SyntaxError("An invalid or illegal string was specified.");Z=oe,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",n({},f,{get:function(){return se},set:function(q){if(q<0||q>100)throw new Error("Size must be between 0 and 100.");se=q,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",n({},f,{get:function(){return Q},set:function(q){const oe=s(q);if(!oe)throw new SyntaxError("An invalid or illegal string was specified.");Q=oe,this.hasBeenReset=!0}})),h.displayState=void 0}return a.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},a}();class YA{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function Vg(r){function e(i,s,n,a){return(i|0)*3600+(s|0)*60+(n|0)+parseFloat(a||0)}const t=r.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}class XA{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,i){for(let s=0;s<i.length;++s)if(t===i[s]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const i=parseFloat(t);if(i>=0&&i<=100)return this.set(e,i),!0}return!1}}function jg(r,e,t,i){const s=i?r.split(i):[r];for(const n in s){if(typeof s[n]!="string")continue;const a=s[n].split(t);if(a.length!==2)continue;const o=a[0],l=a[1];e(o,l)}}const Yc=new qc(0,0,""),Wa=Yc.align==="middle"?"middle":"center";function QA(r,e,t){const i=r;function s(){const o=Vg(r);if(o===null)throw new Error("Malformed timestamp: "+i);return r=r.replace(/^[^\sa-zA-Z-]+/,""),o}function n(o,l){const u=new XA;jg(o,function(g,v){let y;switch(g){case"region":for(let b=t.length-1;b>=0;b--)if(t[b].id===v){u.set(g,t[b].region);break}break;case"vertical":u.alt(g,v,["rl","lr"]);break;case"line":y=v.split(","),u.integer(g,y[0]),u.percent(g,y[0])&&u.set("snapToLines",!1),u.alt(g,y[0],["auto"]),y.length===2&&u.alt("lineAlign",y[1],["start",Wa,"end"]);break;case"position":y=v.split(","),u.percent(g,y[0]),y.length===2&&u.alt("positionAlign",y[1],["start",Wa,"end","line-left","line-right","auto"]);break;case"size":u.percent(g,v);break;case"align":u.alt(g,v,["start",Wa,"end","left","right"]);break}},/:/,/\s/),l.region=u.get("region",null),l.vertical=u.get("vertical","");let h=u.get("line","auto");h==="auto"&&Yc.line===-1&&(h=-1),l.line=h,l.lineAlign=u.get("lineAlign","start"),l.snapToLines=u.get("snapToLines",!0),l.size=u.get("size",100),l.align=u.get("align",Wa);let f=u.get("position","auto");f==="auto"&&Yc.position===50&&(f=l.align==="start"||l.align==="left"?0:l.align==="end"||l.align==="right"?100:50),l.position=f}function a(){r=r.replace(/^\s+/,"")}if(a(),e.startTime=s(),a(),r.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);r=r.slice(3),a(),e.endTime=s(),a(),n(r,e)}function Hg(r){return r.replace(/<br(?: \/)?>/gi,`
|
|
128
|
-
`)}class JA{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new YA,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function i(){let n=t.buffer,a=0;for(n=Hg(n);a<n.length&&n[a]!=="\r"&&n[a]!==`
|
|
129
|
-
`;)++a;const o=n.slice(0,a);return n[a]==="\r"&&++a,n[a]===`
|
|
130
|
-
`&&++a,t.buffer=n.slice(a),o}function s(n){jg(n,function(a,o){},/:/)}try{let n="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;n=i();const o=n.match(/^()?WEBVTT([ \t].*)?$/);if(!(o!=null&&o[0]))throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let a=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(a?a=!1:n=i(),t.state){case"HEADER":/:/.test(n)?s(n):n||(t.state="ID");continue;case"NOTE":n||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(n)){t.state="NOTE";break}if(!n)continue;if(t.cue=new qc(0,0,""),t.state="CUE",n.indexOf("-->")===-1){t.cue.id=n;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{QA(n,t.cue,t.regionList)}catch{t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const o=n.indexOf("-->")!==-1;if(!n||o&&(a=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
|
|
131
|
-
`),t.cue.text+=n}continue;case"BADCUE":n||(t.state="ID")}}}catch{t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=`
|
|
132
|
-
|
|
133
|
-
`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const ZA=/\r\n|\n\r|\n|\r/g,Xc=function(e,t,i=0){return e.slice(i,i+t.length)===t},e_=function(e){let t=parseInt(e.slice(-3));const i=parseInt(e.slice(-6,-4)),s=parseInt(e.slice(-9,-7)),n=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!Ie(t)||!Ie(i)||!Ie(s)||!Ie(n))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*i,t+=60*1e3*s,t+=60*60*1e3*n,t},Qc=function(e){let t=5381,i=e.length;for(;i;)t=t*33^e.charCodeAt(--i);return(t>>>0).toString()};function Jc(r,e,t){return Qc(r.toString())+Qc(e.toString())+Qc(t)}const t_=function(e,t,i){let s=e[t],n=e[s.prevCC];if(!n||!n.new&&s.new){e.ccOffset=e.presentationOffset=s.start,s.new=!1;return}for(;(a=n)!=null&&a.new;){var a;e.ccOffset+=s.start-n.start,s.new=!1,s=n,n=e[s.prevCC]}e.presentationOffset=i};function i_(r,e,t,i,s,n,a){const o=new JA,l=Vi(new Uint8Array(r)).trim().replace(ZA,`
|
|
134
|
-
`).split(`
|
|
135
|
-
`),u=[],h=e?EA(e.baseTime,e.timescale):0;let f="00:00.000",g=0,v=0,y,b=!0;o.oncue=function(E){const A=t[i];let M=t.ccOffset;const D=(g-h)/9e4;if(A!=null&&A.new&&(v!==void 0?M=t.ccOffset=A.start:t_(t,i,D)),D){if(!e){y=new Error("Missing initPTS for VTT MPEGTS");return}M=D-t.presentationOffset}const B=E.endTime-E.startTime,N=mi((E.startTime+M-v)*9e4,s*9e4)/9e4;E.startTime=Math.max(N,0),E.endTime=Math.max(N+B,0);const J=E.text.trim();E.text=decodeURIComponent(encodeURIComponent(J)),E.id||(E.id=Jc(E.startTime,E.endTime,J)),E.endTime>0&&u.push(E)},o.onparsingerror=function(E){y=E},o.onflush=function(){if(y){a(y);return}n(u)},l.forEach(E=>{if(b)if(Xc(E,"X-TIMESTAMP-MAP=")){b=!1,E.slice(16).split(",").forEach(A=>{Xc(A,"LOCAL:")?f=A.slice(6):Xc(A,"MPEGTS:")&&(g=parseInt(A.slice(7)))});try{v=e_(f)/1e3}catch(A){y=A}return}else E===""&&(b=!1);o.parse(E+`
|
|
136
|
-
`)}),o.flush()}const Zc="stpp.ttml.im1t",Kg=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,zg=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,r_={left:"start",center:"center",right:"end",start:"start",end:"end"};function Wg(r,e,t,i){const s=Qe(new Uint8Array(r),["mdat"]);if(s.length===0){i(new Error("Could not parse IMSC1 mdat"));return}const n=s.map(o=>Vi(o)),a=bA(e.baseTime,1,e.timescale);try{n.forEach(o=>t(s_(o,a)))}catch(o){i(o)}}function s_(r,e){const s=new DOMParser().parseFromString(r,"text/xml").getElementsByTagName("tt")[0];if(!s)throw new Error("Invalid ttml");const n={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},a=Object.keys(n).reduce((f,g)=>(f[g]=s.getAttribute(`ttp:${g}`)||n[g],f),{}),o=s.getAttribute("xml:space")!=="preserve",l=qg(eu(s,"styling","style")),u=qg(eu(s,"layout","region")),h=eu(s,"body","[begin]");return[].map.call(h,f=>{const g=Yg(f,o);if(!g||!f.hasAttribute("begin"))return null;const v=iu(f.getAttribute("begin"),a),y=iu(f.getAttribute("dur"),a);let b=iu(f.getAttribute("end"),a);if(v===null)throw Xg(f);if(b===null){if(y===null)throw Xg(f);b=v+y}const E=new qc(v-e,b-e,g);E.id=Jc(E.startTime,E.endTime,E.text);const A=u[f.getAttribute("region")],M=l[f.getAttribute("style")],D=n_(A,M,l),{textAlign:B}=D;if(B){const N=r_[B];N&&(E.lineAlign=N),E.align=B}return Lt(E,D),E}).filter(f=>f!==null)}function eu(r,e,t){const i=r.getElementsByTagName(e)[0];return i?[].slice.call(i.querySelectorAll(t)):[]}function qg(r){return r.reduce((e,t)=>{const i=t.getAttribute("xml:id");return i&&(e[i]=t),e},{})}function Yg(r,e){return[].slice.call(r.childNodes).reduce((t,i,s)=>{var n;return i.nodeName==="br"&&s?t+`
|
|
137
|
-
`:(n=i.childNodes)!=null&&n.length?Yg(i,e):e?t+i.textContent.trim().replace(/\s+/g," "):t+i.textContent},"")}function n_(r,e,t){const i="http://www.w3.org/ns/ttml#styling";let s=null;const n=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],a=r!=null&&r.hasAttribute("style")?r.getAttribute("style"):null;return a&&t.hasOwnProperty(a)&&(s=t[a]),n.reduce((o,l)=>{const u=tu(e,i,l)||tu(r,i,l)||tu(s,i,l);return u&&(o[l]=u),o},{})}function tu(r,e,t){return r&&r.hasAttributeNS(e,t)?r.getAttributeNS(e,t):null}function Xg(r){return new Error(`Could not parse ttml timestamp ${r}`)}function iu(r,e){if(!r)return null;let t=Vg(r);return t===null&&(Kg.test(r)?t=a_(r,e):zg.test(r)&&(t=o_(r,e))),t}function a_(r,e){const t=Kg.exec(r),i=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+i/e.frameRate}function o_(r,e){const t=zg.exec(r),i=Number(t[1]);switch(t[2]){case"h":return i*3600;case"m":return i*60;case"ms":return i*1e3;case"f":return i/e.frameRate;case"t":return i/e.tickRate}return i}class l_{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Zg(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(C.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(C.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(C.MANIFEST_LOADING,this.onManifestLoading,this),e.on(C.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(C.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(C.FRAG_LOADING,this.onFragLoading,this),e.on(C.FRAG_LOADED,this.onFragLoaded,this),e.on(C.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(C.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(C.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(C.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(C.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(C.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(C.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(C.MANIFEST_LOADING,this.onManifestLoading,this),e.off(C.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(C.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(C.FRAG_LOADING,this.onFragLoading,this),e.off(C.FRAG_LOADED,this.onFragLoaded,this),e.off(C.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(C.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(C.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(C.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(C.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){if(this.config.enableCEA708Captions&&(!this.cea608Parser1||!this.cea608Parser2)){const e=new za(this,"textTrack1"),t=new za(this,"textTrack2"),i=new za(this,"textTrack3"),s=new za(this,"textTrack4");this.cea608Parser1=new $g(1,e,t),this.cea608Parser2=new $g(3,i,s)}}addCues(e,t,i,s,n){let a=!1;for(let o=n.length;o--;){const l=n[o],u=c_(l[0],l[1],t,i);if(u>=0&&(l[0]=Math.min(l[0],t),l[1]=Math.max(l[1],i),a=!0,u/(i-t)>.5))return}if(a||n.push([t,i]),this.config.renderTextTracksNatively){const o=this.captionsTracks[e];this.Cues.newCue(o,t,i,s)}else{const o=this.Cues.newCue(null,t,i,s);this.hls.trigger(C.CUES_PARSED,{type:"captions",cues:o,track:e})}}onInitPtsFound(e,{frag:t,id:i,initPTS:s,timescale:n}){const{unparsedVttFrags:a}=this;i==="main"&&(this.initPTS[t.cc]={baseTime:s,timescale:n}),a.length&&(this.unparsedVttFrags=[],a.forEach(o=>{this.onFragLoaded(C.FRAG_LOADED,o)}))}getExistingTrack(e,t){const{media:i}=this;if(i)for(let s=0;s<i.textTracks.length;s++){const n=i.textTracks[s];if(Jg(n,{name:e,lang:t,attrs:{}}))return n}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:i,media:s}=this,{label:n,languageCode:a}=t[e],o=this.getExistingTrack(n,a);if(o)i[e]=o,Es(i[e]),$p(i[e],s);else{const l=this.createTextTrack("captions",n,a);l&&(l[e]=!0,i[e]=l)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const i=t.label,s={_id:e,label:i,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=s,this.hls.trigger(C.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[s]})}createTextTrack(e,t,i){const s=this.media;if(s)return s.addTextTrack(e,t,i)}onMediaAttaching(e,t){this.media=t.media,this._cleanTracks()}onMediaDetaching(){const{captionsTracks:e}=this;Object.keys(e).forEach(t=>{Es(e[t]),delete e[t]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Zg(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let i=0;i<t.length;i++)Es(t[i])}onSubtitleTracksUpdated(e,t){const i=t.subtitleTracks||[],s=i.some(n=>n.textCodec===Zc);if(this.config.enableWebVTT||s&&this.config.enableIMSC1){if(Rg(this.tracks,i)){this.tracks=i;return}if(this.textTracks=[],this.tracks=i,this.config.renderTextTracksNatively){const a=this.media,o=a?Ra(a.textTracks):null;if(this.tracks.forEach((l,u)=>{let h;if(o){let f=null;for(let g=0;g<o.length;g++)if(o[g]&&Jg(o[g],l)){f=o[g],o[g]=null;break}f&&(h=f)}if(h)Es(h);else{const f=Qg(l);h=this.createTextTrack(f,l.name,l.lang),h&&(h.mode="disabled")}h&&this.textTracks.push(h)}),o!=null&&o.length){const l=o.filter(u=>u!==null).map(u=>u.label);l.length&&re.warn(`Media element contains unused subtitle tracks: ${l.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const a=this.tracks.map(o=>({label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}));this.hls.trigger(C.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:a})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(i=>{const s=/(?:CC|SERVICE)([1-4])/.exec(i.instreamId);if(!s)return;const n=`textTrack${s[1]}`,a=this.captionsProperties[n];a&&(a.label=i.name,i.lang&&(a.languageCode=i.lang),a.media=i)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t==null?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){this.initCea608Parsers();const{cea608Parser1:i,cea608Parser2:s,lastCc:n,lastSn:a,lastPartIndex:o}=this;if(!(!this.enabled||!i||!s)&&t.frag.type===$e.MAIN){var l,u;const{cc:h,sn:f}=t.frag,g=(l=t==null||(u=t.part)==null?void 0:u.index)!=null?l:-1;f===a+1||f===a&&g===o+1||h===n||(i.reset(),s.reset()),this.lastCc=h,this.lastSn=f,this.lastPartIndex=g}}onFragLoaded(e,t){const{frag:i,payload:s}=t;if(i.type===$e.SUBTITLE)if(s.byteLength){const n=i.decryptdata,a="stats"in t;if(n==null||!n.encrypted||a){const o=this.tracks[i.level],l=this.vttCCs;l[i.cc]||(l[i.cc]={start:i.start,prevCC:this.prevCC,new:!0},this.prevCC=i.cc),o&&o.textCodec===Zc?this._parseIMSC1(i,s):this._parseVTTs(t)}}else this.hls.trigger(C.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const i=this.hls;Wg(t,this.initPTS[e.cc],s=>{this._appendCues(s,e.level),i.trigger(C.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},s=>{re.log(`Failed to parse IMSC1: ${s}`),i.trigger(C.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:s})})}_parseVTTs(e){var t;const{frag:i,payload:s}=e,{initPTS:n,unparsedVttFrags:a}=this,o=n.length-1;if(!n[i.cc]&&o===-1){a.push(e);return}const l=this.hls,u=(t=i.initSegment)!=null&&t.data?gi(i.initSegment.data,new Uint8Array(s)):s;i_(u,this.initPTS[i.cc],this.vttCCs,i.cc,i.start,h=>{this._appendCues(h,i.level),l.trigger(C.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},h=>{const f=h.message==="Missing initPTS for VTT MPEGTS";f?a.push(e):this._fallbackToIMSC1(i,s),re.log(`Failed to parse VTT cue: ${h}`),!(f&&o>i.cc)&&l.trigger(C.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:h})})}_fallbackToIMSC1(e,t){const i=this.tracks[e.level];i.textCodec||Wg(t,this.initPTS[e.cc],()=>{i.textCodec=Zc,this._parseIMSC1(e,t)},()=>{i.textCodec="wvtt"})}_appendCues(e,t){const i=this.hls;if(this.config.renderTextTracksNatively){const s=this.textTracks[t];if(!s||s.mode==="disabled")return;e.forEach(n=>Up(s,n))}else{const s=this.tracks[t];if(!s)return;const n=s.default?"default":"subtitles"+t;i.trigger(C.CUES_PARSED,{type:"subtitles",cues:e,track:n})}}onFragDecrypted(e,t){const{frag:i}=t;i.type===$e.SUBTITLE&&this.onFragLoaded(C.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){this.initCea608Parsers();const{cea608Parser1:i,cea608Parser2:s}=this;if(!this.enabled||!i||!s)return;const{frag:n,samples:a}=t;if(!(n.type===$e.MAIN&&this.closedCaptionsForLevel(n)==="NONE"))for(let o=0;o<a.length;o++){const l=a[o].bytes;if(l){const u=this.extractCea608Data(l);i.addData(a[o].pts,u[0]),s.addData(a[o].pts,u[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:i,endOffsetSubtitles:s,type:n}){const{media:a}=this;if(!(!a||a.currentTime<i)){if(!n||n==="video"){const{captionsTracks:o}=this;Object.keys(o).forEach(l=>Ac(o[l],t,i))}if(this.config.renderTextTracksNatively&&t===0&&s!==void 0){const{textTracks:o}=this;Object.keys(o).forEach(l=>Ac(o[l],t,s))}}}extractCea608Data(e){const t=[[],[]],i=e[0]&31;let s=2;for(let n=0;n<i;n++){const a=e[s++],o=127&e[s++],l=127&e[s++];if(o===0&&l===0)continue;if((4&a)!==0){const h=3&a;(h===0||h===1)&&(t[h].push(o),t[h].push(l))}}return t}}function Qg(r){return r.characteristics&&/transcribes-spoken-dialog/gi.test(r.characteristics)&&/describes-music-and-sound/gi.test(r.characteristics)?"captions":"subtitles"}function Jg(r,e){return!!r&&r.kind===Qg(e)&&zc(e,r)}function c_(r,e,t,i){return Math.min(e,i)-Math.max(r,t)}function Zg(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}class ru{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(C.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(C.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(C.MANIFEST_PARSED,this.onManifestParsed,this),e.on(C.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(C.BUFFER_CODECS,this.onBufferCodecs,this),e.on(C.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(C.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(C.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(C.MANIFEST_PARSED,this.onManifestParsed,this),e.off(C.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(C.BUFFER_CODECS,this.onBufferCodecs,this),e.off(C.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const i=this.hls.levels[t.droppedLevel];this.isLevelAllowed(i)&&this.restrictedLevels.push({bitrate:i.bitrate,height:i.height,width:i.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){const i=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,i.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&Ie(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping()}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0){this.clientRect=null;return}const e=this.hls.levels;if(e.length){const t=this.hls,i=this.getMaxLevel(e.length-1);i!==this.autoLevelCapping&&re.log(`Setting autoLevelCapping to ${i}: ${e[i].height}p@${e[i].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=i,t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const i=t.filter((s,n)=>this.isLevelAllowed(s)&&n<=e);return this.clientRect=null,ru.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const i=e.getBoundingClientRect();t.width=i.width,t.height=i.height,!t.width&&!t.height&&(t.width=i.right-i.left||e.width||0,t.height=i.bottom-i.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch{}return e}isLevelAllowed(e){return!this.restrictedLevels.some(i=>e.bitrate===i.bitrate&&e.width===i.width&&e.height===i.height)}static getMaxLevelByMediaSize(e,t,i){if(!(e!=null&&e.length))return-1;const s=(o,l)=>l?o.width!==l.width||o.height!==l.height:!0;let n=e.length-1;const a=Math.max(t,i);for(let o=0;o<e.length;o+=1){const l=e[o];if((l.width>=a||l.height>=a)&&s(l,e[o+1])){n=o;break}}return n}}class u_{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(C.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(C.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const i=this.hls.config;if(i.capLevelOnFPSDrop){const s=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=s,s&&typeof s.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),i.fpsDroppedMonitoringPeriod)}}checkFPS(e,t,i){const s=performance.now();if(t){if(this.lastTime){const n=s-this.lastTime,a=i-this.lastDroppedFrames,o=t-this.lastDecodedFrames,l=1e3*a/n,u=this.hls;if(u.trigger(C.FPS_DROP,{currentDropped:a,currentDecoded:o,totalDroppedFrames:i}),l>0&&a>u.config.fpsDroppedMonitoringThreshold*o){let h=u.currentLevel;re.warn("drop FPS ratio greater than max allowed value for currentLevel: "+h),h>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=h)&&(h=h-1,u.trigger(C.FPS_DROP_LEVEL_CAPPING,{level:h,droppedLevel:u.currentLevel}),u.autoLevelCapping=h,this.streamController.nextLevelSwitch())}}this.lastTime=s,this.lastDroppedFrames=i,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}const qa="[eme]";class ks{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=ks.CDMCleanupPromise?[ks.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=re.debug.bind(re,qa),this.log=re.log.bind(re,qa),this.warn=re.warn.bind(re,qa),this.error=re.error.bind(re,qa),this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}registerListeners(){this.hls.on(C.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(C.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(C.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(C.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(C.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(C.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(C.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(C.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:i}=this.config,s=t[e];if(s)return s.licenseUrl;if(e===St.WIDEVINE&&i)return i;throw new Error(`no license server URL configured for key-system "${e}"`)}getServerCertificateUrl(e){const{drmSystems:t}=this.config,i=t[e];if(i)return i.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,i=(a,o,l)=>!!a&&l.indexOf(a)===o,s=t.map(a=>a.audioCodec).filter(i),n=t.map(a=>a.videoCodec).filter(i);return s.length+n.length===0&&n.push("avc1.42e01e"),new Promise((a,o)=>{const l=u=>{const h=u.shift();this.getMediaKeysPromise(h,s,n).then(f=>a({keySystem:h,mediaKeys:f})).catch(f=>{u.length?l(u):f instanceof vi?o(f):o(new vi({type:Ve.KEY_SYSTEM_ERROR,details:ce.KEY_SYSTEM_NO_ACCESS,error:f,fatal:!0},f.message))})};l(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:i}=this.config;if(typeof i!="function"){let s=`Configured requestMediaKeySystemAccess is not a function ${i}`;return up===null&&self.location.protocol==="http:"&&(s=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(s))}return i(e,t)}getMediaKeysPromise(e,t,i){const s=bw(e,t,i,this.config.drmSystemOptions),n=this.keySystemAccessPromises[e];let a=n==null?void 0:n.keySystemAccess;if(!a){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(s)}`),a=this.requestMediaKeySystemAccess(e,s);const o=this.keySystemAccessPromises[e]={keySystemAccess:a};return a.catch(l=>{this.log(`Failed to obtain access to key-system "${e}": ${l}`)}),a.then(l=>{this.log(`Access for key-system "${l.keySystem}" obtained`);const u=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),o.mediaKeys=l.createMediaKeys().then(h=>(this.log(`Media-keys created for "${e}"`),u.then(f=>f?this.setMediaKeysServerCertificate(h,e,f):h))),o.mediaKeys.catch(h=>{this.error(`Failed to create media-keys for "${e}"}: ${h}`)}),o.mediaKeys})}return a.then(()=>n.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:i}){this.log(`Creating key-system session "${t}" keyId: ${ji.hexDump(e.keyId||[])}`);const s=i.createSession(),n={decryptdata:e,keySystem:t,mediaKeys:i,mediaKeysSession:s,keyStatus:"status-pending"};return this.mediaKeySessions.push(n),n}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const i=this.createMediaKeySessionContext(e),s=this.getKeyIdString(t),n="cenc";this.keyIdToKeySessionPromise[s]=this.generateRequestWithPreferredKeySession(i,n,t.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(e.keyId===null)throw new Error("keyId is null");return ji.hexDump(e.keyId)}updateKeySession(e,t){var i;const s=e.mediaKeysSession;return this.log(`Updating key-session "${s.sessionId}" for keyID ${ji.hexDump(((i=e.decryptdata)==null?void 0:i.keyId)||[])}
|
|
138
|
-
} (data length: ${t&&t.byteLength})`),s.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((t,i)=>{const s=gc(this.config),n=e.map(op).filter(a=>!!a&&s.indexOf(a)!==-1);return this.getKeySystemSelectionPromise(n).then(({keySystem:a})=>{const o=cp(a);o?t(o):i(new Error(`Unable to find format for key-system "${a}"`))}).catch(i)})}loadKey(e){const t=e.keyInfo.decryptdata,i=this.getKeyIdString(t),s=`(keyId: ${i} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${s}`);let n=this.keyIdToKeySessionPromise[i];return n||(n=this.keyIdToKeySessionPromise[i]=this.getKeySystemForKeyPromise(t).then(({keySystem:a,mediaKeys:o})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${s}`),this.attemptSetMediaKeys(a,o).then(()=>{this.throwIfDestroyed();const l=this.createMediaKeySessionContext({keySystem:a,mediaKeys:o,decryptdata:t});return this.generateRequestWithPreferredKeySession(l,"cenc",t.pssh,"playlist-key")}))),n.catch(a=>this.handleError(a))),n}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof vi?this.hls.trigger(C.ERROR,e.data):this.hls.trigger(C.ERROR,{type:Ve.KEY_SYSTEM_ERROR,details:ce.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),i=this.keyIdToKeySessionPromise[t];if(!i){const s=op(e.keyFormat),n=s?[s]:gc(this.config);return this.attemptKeySystemAccess(n)}return i}getKeySystemSelectionPromise(e){if(e.length||(e=gc(this.config)),e.length===0)throw new vi({type:Ve.KEY_SYSTEM_ERROR,details:ce.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}_onMediaEncrypted(e){const{initDataType:t,initData:i}=e;if(this.debug(`"${e.type}" event: init data type: "${t}"`),i===null)return;let s,n;if(t==="sinf"&&this.config.drmSystems[St.FAIRPLAY]){const h=Pt(new Uint8Array(i));try{const f=fc(JSON.parse(h).sinf),g=Sp(new Uint8Array(f));if(!g)return;s=g.subarray(8,24),n=St.FAIRPLAY}catch{this.warn('Failed to parse sinf "encrypted" event message initData');return}}else{const h=zw(i);if(h===null)return;h.version===0&&h.systemId===lp.WIDEVINE&&h.data&&(s=h.data.subarray(8,24)),n=xw(h.systemId)}if(!n||!s)return;const a=ji.hexDump(s),{keyIdToKeySessionPromise:o,mediaKeySessions:l}=this;let u=o[a];for(let h=0;h<l.length;h++){const f=l[h],g=f.decryptdata;if(g.pssh||!g.keyId)continue;const v=ji.hexDump(g.keyId);if(a===v||g.uri.replace(/-/g,"").indexOf(a)!==-1){u=o[v],delete o[v],g.pssh=new Uint8Array(i),g.keyId=s,u=o[a]=u.then(()=>this.generateRequestWithPreferredKeySession(f,t,i,"encrypted-event-key-match"));break}}u||(u=o[a]=this.getKeySystemSelectionPromise([n]).then(({keySystem:h,mediaKeys:f})=>{var g;this.throwIfDestroyed();const v=new Rn("ISO-23001-7",a,(g=cp(h))!=null?g:"");return v.pssh=new Uint8Array(i),v.keyId=s,this.attemptSetMediaKeys(h,f).then(()=>{this.throwIfDestroyed();const y=this.createMediaKeySessionContext({decryptdata:v,keySystem:h,mediaKeys:f});return this.generateRequestWithPreferredKeySession(y,t,i,"encrypted-event-no-match")})})),u.catch(h=>this.handleError(h))}_onWaitingForKey(e){this.log(`"${e.type}" event`)}attemptSetMediaKeys(e,t){const i=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const s=Promise.all(i).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.setMediaKeysQueue.push(s),s.then(()=>{this.log(`Media-keys set for "${e}"`),i.push(s),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(n=>i.indexOf(n)===-1)})}generateRequestWithPreferredKeySession(e,t,i,s){var n,a;const o=(n=this.config.drmSystems)==null||(a=n[e.keySystem])==null?void 0:a.generateRequest;if(o)try{const y=o.call(this.hls,t,i,e);if(!y)throw new Error("Invalid response from configured generateRequest filter");t=y.initDataType,i=e.decryptdata.pssh=y.initData?new Uint8Array(y.initData):null}catch(y){var l;if(this.warn(y.message),(l=this.hls)!=null&&l.config.debug)throw y}if(i===null)return this.log(`Skipping key-session request for "${s}" (no initData)`),Promise.resolve(e);const u=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${s}": ${u} (init data type: ${t} length: ${i?i.byteLength:null})`);const h=new Kc,f=e._onmessage=y=>{const b=e.mediaKeysSession;if(!b){h.emit("error",new Error("invalid state"));return}const{messageType:E,message:A}=y;this.log(`"${E}" message event for session "${b.sessionId}" message size: ${A.byteLength}`),E==="license-request"||E==="license-renewal"?this.renewLicense(e,A).catch(M=>{this.handleError(M),h.emit("error",M)}):E==="license-release"?e.keySystem===St.FAIRPLAY&&(this.updateKeySession(e,pc("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${E}"`)},g=e._onkeystatuseschange=y=>{if(!e.mediaKeysSession){h.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const E=e.keyStatus;h.emit("keyStatus",E),E==="expired"&&(this.warn(`${e.keySystem} expired for key ${u}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",f),e.mediaKeysSession.addEventListener("keystatuseschange",g);const v=new Promise((y,b)=>{h.on("error",b),h.on("keyStatus",E=>{E.startsWith("usable")?y():E==="output-restricted"?b(new vi({type:Ve.KEY_SYSTEM_ERROR,details:ce.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):E==="internal-error"?b(new vi({type:Ve.KEY_SYSTEM_ERROR,details:ce.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${E}"`)):E==="expired"?b(new Error("key expired while generating request")):this.warn(`unhandled key status change "${E}"`)})});return e.mediaKeysSession.generateRequest(t,i).then(()=>{var y;this.log(`Request generated for key-session "${(y=e.mediaKeysSession)==null?void 0:y.sessionId}" keyId: ${u}`)}).catch(y=>{throw new vi({type:Ve.KEY_SYSTEM_ERROR,details:ce.KEY_SYSTEM_NO_SESSION,error:y,fatal:!1},`Error generating key-session request: ${y}`)}).then(()=>v).catch(y=>{throw h.removeAllListeners(),this.removeSession(e),y}).then(()=>(h.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,i)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${ji.hexDump("buffer"in i?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):new Uint8Array(i))} session keyId: ${ji.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,i=t.loader,s=new i(t),n=this.getServerCertificateUrl(e);return n?(this.log(`Fetching server certificate for "${e}"`),new Promise((a,o)=>{const l={responseType:"arraybuffer",url:n},u=t.certLoadPolicy.default,h={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},f={onSuccess:(g,v,y,b)=>{a(g.data)},onError:(g,v,y,b)=>{o(new vi({type:Ve.KEY_SYSTEM_ERROR,details:ce.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:y,response:Mt({url:l.url,data:void 0},g)},`"${e}" certificate request failed (${n}). Status: ${g.code} (${g.text})`))},onTimeout:(g,v,y)=>{o(new vi({type:Ve.KEY_SYSTEM_ERROR,details:ce.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:y,response:{url:l.url,data:void 0}},`"${e}" certificate request timed out (${n})`))},onAbort:(g,v,y)=>{o(new Error("aborted"))}};s.load(l,h,f)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,i){return new Promise((s,n)=>{e.setServerCertificate(i).then(a=>{this.log(`setServerCertificate ${a?"success":"not supported by CDM"} (${i==null?void 0:i.byteLength}) on "${t}"`),s(e)}).catch(a=>{n(new vi({type:Ve.KEY_SYSTEM_ERROR,details:ce.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:a,fatal:!0},a.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(i=>this.updateKeySession(e,new Uint8Array(i)).catch(s=>{throw new vi({type:Ve.KEY_SYSTEM_ERROR,details:ce.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:s,fatal:!0},s.message)}))}unpackPlayReadyKeyMessage(e,t){const i=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!i.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const s=new DOMParser().parseFromString(i,"application/xml"),n=s.querySelectorAll("HttpHeader");if(n.length>0){let h;for(let f=0,g=n.length;f<g;f++){var a,o;h=n[f];const v=(a=h.querySelector("name"))==null?void 0:a.textContent,y=(o=h.querySelector("value"))==null?void 0:o.textContent;v&&y&&e.setRequestHeader(v,y)}}const l=s.querySelector("Challenge"),u=l==null?void 0:l.textContent;if(!u)throw new Error("Cannot find <Challenge> in key message");return pc(atob(u))}setupLicenseXHR(e,t,i,s){const n=this.config.licenseXhrSetup;return n?Promise.resolve().then(()=>{if(!i.decryptdata)throw new Error("Key removed");return n.call(this.hls,e,t,i,s)}).catch(a=>{if(!i.decryptdata)throw a;return e.open("POST",t,!0),n.call(this.hls,e,t,i,s)}).then(a=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:a||s})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:s}))}requestLicense(e,t){const i=this.config.keyLoadPolicy.default;return new Promise((s,n)=>{const a=this.getLicenseServerUrl(e.keySystem);this.log(`Sending license request to URL: ${a}`);const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return n(new Error("invalid state"));if(o.readyState===4)if(o.status===200){this._requestLicenseFailureCount=0;let l=o.response;this.log(`License received ${l instanceof ArrayBuffer?l.byteLength:l}`);const u=this.config.licenseResponseCallback;if(u)try{l=u.call(this.hls,o,a,e)}catch(h){this.error(h)}s(l)}else{const l=i.errorRetry,u=l?l.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>u||o.status>=400&&o.status<500)n(new vi({type:Ve.KEY_SYSTEM_ERROR,details:ce.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:o,response:{url:a,data:void 0,code:o.status,text:o.statusText}},`License Request XHR failed (${a}). Status: ${o.status} (${o.statusText})`));else{const h=u-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${h} attempts left`),this.requestLicense(e,t).then(s,n)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=o,this.setupLicenseXHR(o,a,e,t).then(({xhr:l,licenseChallenge:u})=>{e.keySystem==St.PLAYREADY&&(u=this.unpackPlayReadyKeyMessage(l,u)),l.send(u)})})}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const i=t.media;this.media=i,i.addEventListener("encrypted",this.onMediaEncrypted),i.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,t=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},Rn.clearKeyUriToKeyIdMap();const i=t.length;ks.CDMCleanupPromise=Promise.all(t.map(s=>this.removeSession(s)).concat(e==null?void 0:e.setMediaKeys(null).catch(s=>{this.log(`Could not clear media keys: ${s}`)}))).then(()=>{i&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)}).catch(s=>{this.log(`Could not close sessions and clear media keys: ${s}`)})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const i=t.reduce((s,n)=>(s.indexOf(n.keyFormat)===-1&&s.push(n.keyFormat),s),[]);this.log(`Selecting key-system from session-keys ${i.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(i)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:i}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),i&&i.readyState!==XMLHttpRequest.DONE&&i.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const s=this.mediaKeySessions.indexOf(e);return s>-1&&this.mediaKeySessions.splice(s,1),t.remove().catch(n=>{this.log(`Could not remove session: ${n}`)}).then(()=>t.close()).catch(n=>{this.log(`Could not close session: ${n}`)})}}}ks.CDMCleanupPromise=void 0;class vi extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}var zt;(function(r){r.MANIFEST="m",r.AUDIO="a",r.VIDEO="v",r.MUXED="av",r.INIT="i",r.CAPTION="c",r.TIMED_TEXT="tt",r.KEY="k",r.OTHER="o"})(zt||(zt={}));var su;(function(r){r.DASH="d",r.HLS="h",r.SMOOTH="s",r.OTHER="o"})(su||(su={}));var is;(function(r){r.OBJECT="CMCD-Object",r.REQUEST="CMCD-Request",r.SESSION="CMCD-Session",r.STATUS="CMCD-Status"})(is||(is={}));const h_={[is.OBJECT]:["br","d","ot","tb"],[is.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[is.SESSION]:["cid","pr","sf","sid","st","v"],[is.STATUS]:["bs","rtp"]};class Ds{constructor(e,t){this.value=void 0,this.params=void 0,Array.isArray(e)&&(e=e.map(i=>i instanceof Ds?i:new Ds(i))),this.value=e,this.params=t}}class em{constructor(e){this.description=void 0,this.description=e}}const d_="Dict";function f_(r){return Array.isArray(r)?JSON.stringify(r):r instanceof Map?"Map{}":r instanceof Set?"Set{}":typeof r=="object"?JSON.stringify(r):String(r)}function p_(r,e,t,i){return new Error(`failed to ${r} "${f_(e)}" as ${t}`,{cause:i})}const tm="Bare Item",g_="Boolean",m_="Byte Sequence",v_="Decimal",y_="Integer";function S_(r){return r<-999999999999999||999999999999999<r}const x_=/[\x00-\x1f\x7f]+/,b_="Token",E_="Key";function qi(r,e,t){return p_("serialize",r,e,t)}function w_(r){if(typeof r!="boolean")throw qi(r,g_);return r?"?1":"?0"}function T_(r){return btoa(String.fromCharCode(...r))}function A_(r){if(ArrayBuffer.isView(r)===!1)throw qi(r,m_);return`:${T_(r)}:`}function im(r){if(S_(r))throw qi(r,y_);return r.toString()}function __(r){return`@${im(r.getTime()/1e3)}`}function rm(r,e){if(r<0)return-rm(-r,e);const t=Math.pow(10,e);if(Math.abs(r*t%1-.5)<Number.EPSILON){const s=Math.floor(r*t);return(s%2===0?s:s+1)/t}else return Math.round(r*t)/t}function C_(r){const e=rm(r,3);if(Math.floor(Math.abs(e)).toString().length>12)throw qi(r,v_);const t=e.toString();return t.includes(".")?t:`${t}.0`}const L_="String";function I_(r){if(x_.test(r))throw qi(r,L_);return`"${r.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function R_(r){return r.description||r.toString().slice(7,-1)}function sm(r){const e=R_(r);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw qi(e,b_);return e}function nu(r){switch(typeof r){case"number":if(!Ie(r))throw qi(r,tm);return Number.isInteger(r)?im(r):C_(r);case"string":return I_(r);case"symbol":return sm(r);case"boolean":return w_(r);case"object":if(r instanceof Date)return __(r);if(r instanceof Uint8Array)return A_(r);if(r instanceof em)return sm(r);default:throw qi(r,tm)}}function au(r){if(/^[a-z*][a-z0-9\-_.*]*$/.test(r)===!1)throw qi(r,E_);return r}function ou(r){return r==null?"":Object.entries(r).map(([e,t])=>t===!0?`;${au(e)}`:`;${au(e)}=${nu(t)}`).join("")}function nm(r){return r instanceof Ds?`${nu(r.value)}${ou(r.params)}`:nu(r)}function P_(r){return`(${r.value.map(nm).join(" ")})${ou(r.params)}`}function k_(r,e={whitespace:!0}){if(typeof r!="object")throw qi(r,d_);const t=r instanceof Map?r.entries():Object.entries(r),i=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([s,n])=>{n instanceof Ds||(n=new Ds(n));let a=au(s);return n.value===!0?a+=ou(n.params):(a+="=",Array.isArray(n.value)?a+=P_(n):a+=nm(n)),a}).join(`,${i}`)}function D_(r,e){return k_(r,e)}const O_=r=>r==="ot"||r==="sf"||r==="st",M_=r=>typeof r=="number"?Ie(r):r!=null&&r!==""&&r!==!1;function F_(r,e){const t=new URL(r),i=new URL(e);if(t.origin!==i.origin)return r;const s=t.pathname.split("/").slice(1),n=i.pathname.split("/").slice(1,-1);for(;s[0]===n[0];)s.shift(),n.shift();for(;n.length;)n.shift(),s.unshift("..");return s.join("/")}function N_(){try{return crypto.randomUUID()}catch{try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch{let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,s=>{const n=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(s=="x"?n:n&3|8).toString(16)})}}}const Ya=r=>Math.round(r),B_=(r,e)=>(e!=null&&e.baseUrl&&(r=F_(r,e.baseUrl)),encodeURIComponent(r)),Xa=r=>Ya(r/100)*100,$_={br:Ya,d:Ya,bl:Xa,dl:Xa,mtp:Xa,nor:B_,rtp:Xa,tb:Ya};function U_(r,e){const t={};if(r==null||typeof r!="object")return t;const i=Object.keys(r).sort(),s=Lt({},$_,e==null?void 0:e.formatters),n=e==null?void 0:e.filter;return i.forEach(a=>{if(n!=null&&n(a))return;let o=r[a];const l=s[a];l&&(o=l(o,e)),!(a==="v"&&o===1)&&(a=="pr"&&o===1||M_(o)&&(O_(a)&&typeof o=="string"&&(o=new em(o)),t[a]=o))}),t}function am(r,e={}){return r?D_(U_(r,e),Lt({whitespace:!1},e)):""}function G_(r,e={}){if(!r)return{};const t=Object.entries(r),i=Object.entries(h_).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),s=t.reduce((n,a)=>{var o,l;const[u,h]=a,f=((o=i.find(g=>g[1].includes(u)))==null?void 0:o[0])||is.REQUEST;return(l=n[f])!=null||(n[f]={}),n[f][u]=h,n},{});return Object.entries(s).reduce((n,[a,o])=>(n[a]=am(o,e),n),{})}function V_(r,e,t){return Lt(r,G_(e,t))}const j_="CMCD";function H_(r,e={}){if(!r)return"";const t=am(r,e);return`${j_}=${encodeURIComponent(t)}`}const om=/CMCD=[^&#]+/;function K_(r,e,t){const i=H_(e,t);if(!i)return r;if(om.test(r))return r.replace(om,i);const s=r.includes("?")?"&":"?";return`${r}${s}${i}`}class z_{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=s=>{try{this.apply(s,{ot:zt.MANIFEST,su:!this.initialized})}catch(n){re.warn("Could not generate manifest CMCD data.",n)}},this.applyFragmentData=s=>{try{const n=s.frag,a=this.hls.levels[n.level],o=this.getObjectType(n),l={d:n.duration*1e3,ot:o};(o===zt.VIDEO||o===zt.AUDIO||o==zt.MUXED)&&(l.br=a.bitrate/1e3,l.tb=this.getTopBandwidth(o)/1e3,l.bl=this.getBufferLength(o)),this.apply(s,l)}catch(n){re.warn("Could not generate segment CMCD data.",n)}},this.hls=e;const t=this.config=e.config,{cmcd:i}=t;i!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=i.sessionId||N_(),this.cid=i.contentId,this.useHeaders=i.useHeaders===!0,this.includeKeys=i.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(C.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(C.MEDIA_DETACHED,this.onMediaDetached,this),e.on(C.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(C.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(C.MEDIA_DETACHED,this.onMediaDetached,this),e.off(C.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var i,s;this.audioBuffer=(i=t.tracks.audio)==null?void 0:i.buffer,this.videoBuffer=(s=t.tracks.video)==null?void 0:s.buffer}createData(){var e;return{v:1,sf:su.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){Lt(t,this.createData());const i=t.ot===zt.INIT||t.ot===zt.VIDEO||t.ot===zt.MUXED;this.starved&&i&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:s}=this;s&&(t=Object.keys(t).reduce((n,a)=>(s.includes(a)&&(n[a]=t[a]),n),{})),this.useHeaders?(e.headers||(e.headers={}),V_(e.headers,t)):e.url=K_(e.url,t)}getObjectType(e){const{type:t}=e;if(t==="subtitle")return zt.TIMED_TEXT;if(e.sn==="initSegment")return zt.INIT;if(t==="audio")return zt.AUDIO;if(t==="main")return this.hls.audioTracks.length?zt.VIDEO:zt.MUXED}getTopBandwidth(e){let t=0,i;const s=this.hls;if(e===zt.AUDIO)i=s.audioTracks;else{const n=s.maxAutoLevel,a=n>-1?n+1:s.levels.length;i=s.levels.slice(0,a)}for(const n of i)n.bitrate>t&&(t=n.bitrate);return t>0?t:NaN}getBufferLength(e){const t=this.hls.media,i=e===zt.AUDIO?this.audioBuffer:this.videoBuffer;return!i||!t?NaN:yt.bufferInfo(i,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,i=e||this.config.loader;return class{constructor(n){this.loader=void 0,this.loader=new i(n)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(n,a,o){t(n),this.loader.load(n,a,o)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,i=e||this.config.loader;return class{constructor(n){this.loader=void 0,this.loader=new i(n)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(n,a,o){t(n),this.loader.load(n,a,o)}}}}const W_=3e5;class q_{constructor(e){this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.log=re.log.bind(re,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(C.MANIFEST_LOADING,this.onManifestLoading,this),e.on(C.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(C.MANIFEST_PARSED,this.onManifestParsed,this),e.on(C.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(C.MANIFEST_LOADING,this.onManifestLoading,this),e.off(C.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(C.MANIFEST_PARSED,this.onManifestParsed,this),e.off(C.ERROR,this.onError,this))}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(i=>i!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:i}=t;i!==null&&(this.pathwayId=i.pathwayId,this.uri=i.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:i}=t;if((i==null?void 0:i.action)===Gt.SendAlternateToPenaltyBox&&i.flags===Ai.MoveAllAlternatesMatchingHost){const s=this.levels;let n=this.pathwayPriority,a=this.pathwayId;if(t.context){const{groupId:o,pathwayId:l,type:u}=t.context;o&&s?a=this.getPathwayForGroupId(o,u,a):l&&(a=l)}a in this.penalizedPathways||(this.penalizedPathways[a]=performance.now()),!n&&s&&(n=s.reduce((o,l)=>(o.indexOf(l.pathwayId)===-1&&o.push(l.pathwayId),o),[])),n&&n.length>1&&(this.updatePathwayPriority(n),i.resolved=this.pathwayId!==a),i.resolved||re.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${a} levels: ${s&&s.length} priorities: ${JSON.stringify(n)} penalized: ${JSON.stringify(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const i=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${i}"`),t=this.getLevelsForPathway(i),this.pathwayId=i}return t.length!==e.length?(this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t):e}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this.pathwayPriority=e;let t;const i=this.penalizedPathways,s=performance.now();Object.keys(i).forEach(n=>{s-i[n]>W_&&delete i[n]});for(let n=0;n<e.length;n++){const a=e[n];if(a in i)continue;if(a===this.pathwayId)return;const o=this.hls.nextLoadLevel,l=this.hls.levels[o];if(t=this.getLevelsForPathway(a),t.length>0){this.log(`Setting Pathway to "${a}"`),this.pathwayId=a,Yp(t),this.hls.trigger(C.LEVELS_UPDATED,{levels:t});const u=this.hls.levels[o];l&&u&&this.levels&&(u.attrs["STABLE-VARIANT-ID"]!==l.attrs["STABLE-VARIANT-ID"]&&u.bitrate!==l.bitrate&&this.log(`Unstable Pathways change from bitrate ${l.bitrate} to ${u.bitrate}`),this.hls.nextLoadLevel=o);break}}}getPathwayForGroupId(e,t,i){const s=this.getLevelsForPathway(i).concat(this.levels||[]);for(let n=0;n<s.length;n++)if(t===rt.AUDIO_TRACK&&s[n].hasAudioGroup(e)||t===rt.SUBTITLE_TRACK&&s[n].hasSubtitleGroup(e))return s[n].pathwayId;return i}clonePathways(e){const t=this.levels;if(!t)return;const i={},s={};e.forEach(n=>{const{ID:a,"BASE-ID":o,"URI-REPLACEMENT":l}=n;if(t.some(h=>h.pathwayId===a))return;const u=this.getLevelsForPathway(o).map(h=>{const f=new bt(h.attrs);f["PATHWAY-ID"]=a;const g=f.AUDIO&&`${f.AUDIO}_clone_${a}`,v=f.SUBTITLES&&`${f.SUBTITLES}_clone_${a}`;g&&(i[f.AUDIO]=g,f.AUDIO=g),v&&(s[f.SUBTITLES]=v,f.SUBTITLES=v);const y=cm(h.uri,f["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",l),b=new ws({attrs:f,audioCodec:h.audioCodec,bitrate:h.bitrate,height:h.height,name:h.name,url:y,videoCodec:h.videoCodec,width:h.width});if(h.audioGroups)for(let E=1;E<h.audioGroups.length;E++)b.addGroupId("audio",`${h.audioGroups[E]}_clone_${a}`);if(h.subtitleGroups)for(let E=1;E<h.subtitleGroups.length;E++)b.addGroupId("text",`${h.subtitleGroups[E]}_clone_${a}`);return b});t.push(...u),lm(this.audioTracks,i,l,a),lm(this.subtitleTracks,s,l,a)})}loadSteeringManifest(e){const t=this.hls.config,i=t.loader;this.loader&&this.loader.destroy(),this.loader=new i(t);let s;try{s=new self.URL(e)}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(s.protocol!=="data:"){const h=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;s.searchParams.set("_HLS_pathway",this.pathwayId),s.searchParams.set("_HLS_throughput",""+h)}const n={responseType:"json",url:s.href},a=t.steeringManifestLoadPolicy.default,o=a.errorRetry||a.timeoutRetry||{},l={loadPolicy:a,timeout:a.maxLoadTimeMs,maxRetry:o.maxNumRetry||0,retryDelay:o.retryDelayMs||0,maxRetryDelay:o.maxRetryDelayMs||0},u={onSuccess:(h,f,g,v)=>{this.log(`Loaded steering manifest: "${s}"`);const y=h.data;if(y.VERSION!==1){this.log(`Steering VERSION ${y.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=y.TTL;const{"RELOAD-URI":b,"PATHWAY-CLONES":E,"PATHWAY-PRIORITY":A}=y;if(b)try{this.uri=new self.URL(b,s).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${b}`);return}this.scheduleRefresh(this.uri||g.url),E&&this.clonePathways(E);const M={steeringManifest:y,url:s.toString()};this.hls.trigger(C.STEERING_MANIFEST_LOADED,M),A&&this.updatePathwayPriority(A)},onError:(h,f,g,v)=>{if(this.log(`Error loading steering manifest: ${h.code} ${h.text} (${f.url})`),this.stopLoad(),h.code===410){this.enabled=!1,this.log(`Steering manifest ${f.url} no longer available`);return}let y=this.timeToLoad*1e3;if(h.code===429){const b=this.loader;if(typeof(b==null?void 0:b.getResponseHeader)=="function"){const E=b.getResponseHeader("Retry-After");E&&(y=parseFloat(E)*1e3)}this.log(`Steering manifest ${f.url} rate limited`);return}this.scheduleRefresh(this.uri||f.url,y)},onTimeout:(h,f,g)=>{this.log(`Timeout loading steering manifest (${f.url})`),this.scheduleRefresh(this.uri||f.url)}};this.log(`Requesting steering manifest: ${s}`),this.loader.load(n,l,u)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var i;const s=(i=this.hls)==null?void 0:i.media;if(s&&!s.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function lm(r,e,t,i){r&&Object.keys(e).forEach(s=>{const n=r.filter(a=>a.groupId===s).map(a=>{const o=Lt({},a);return o.details=void 0,o.attrs=new bt(o.attrs),o.url=o.attrs.URI=cm(a.url,a.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),o.groupId=o.attrs["GROUP-ID"]=e[s],o.attrs["PATHWAY-ID"]=i,o});r.push(...n)})}function cm(r,e,t,i){const{HOST:s,PARAMS:n,[t]:a}=i;let o;e&&(o=a==null?void 0:a[e],o&&(r=o));const l=new self.URL(r);return s&&!o&&(l.host=s),n&&Object.keys(n).sort().forEach(u=>{u&&l.searchParams.set(u,n[u])}),l.href}const Y_=/^age:\s*[\d.]+\s*$/im;class um{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new Ea,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null,this.stats=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,i){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=i,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const i=this.loader=new self.XMLHttpRequest,s=this.stats;s.loading.first=0,s.loaded=0,s.aborted=!1;const n=this.xhrSetup;n?Promise.resolve().then(()=>{if(!this.stats.aborted)return n(i,t.url)}).catch(a=>(i.open("GET",t.url,!0),n(i,t.url))).then(()=>{this.stats.aborted||this.openAndSendXhr(i,t,e)}).catch(a=>{this.callbacks.onError({code:i.status,text:a.message},t,i,s)}):this.openAndSendXhr(i,t,e)}openAndSendXhr(e,t,i){e.readyState||e.open("GET",t.url,!0);const s=t.headers,{maxTimeToFirstByteMs:n,maxLoadTimeMs:a}=i.loadPolicy;if(s)for(const o in s)e.setRequestHeader(o,s[o]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),i.timeout=n&&Ie(n)?n:a,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:i}=this;if(!e||!t)return;const s=t.readyState,n=this.config;if(!i.aborted&&s>=2&&(i.loading.first===0&&(i.loading.first=Math.max(self.performance.now(),i.loading.start),n.timeout!==n.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),n.timeout=n.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.loadPolicy.maxLoadTimeMs-(i.loading.first-i.loading.start)))),s===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const a=t.status,o=t.responseType!=="text";if(a>=200&&a<300&&(o&&t.response||t.responseText!==null)){i.loading.end=Math.max(self.performance.now(),i.loading.first);const l=o?t.response:t.responseText,u=t.responseType==="arraybuffer"?l.byteLength:l.length;if(i.loaded=i.total=u,i.bwEstimate=i.total*8e3/(i.loading.end-i.loading.first),!this.callbacks)return;const h=this.callbacks.onProgress;if(h&&h(i,e,l,t),!this.callbacks)return;const f={url:t.responseURL,data:l,code:a};this.callbacks.onSuccess(f,i,e,t)}else{const l=n.loadPolicy.errorRetry,u=i.retry,h={url:e.url,data:void 0,code:a};Ma(l,u,!1,h)?this.retry(l):(re.error(`${a} while loading ${e.url}`),this.callbacks.onError({code:a,text:t.statusText},e,t,i))}}}loadtimeout(){var e;const t=(e=this.config)==null?void 0:e.loadPolicy.timeoutRetry,i=this.stats.retry;if(Ma(t,i,!0))this.retry(t);else{var s;re.warn(`timeout while loading ${(s=this.context)==null?void 0:s.url}`);const n=this.callbacks;n&&(this.abortInternal(),n.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:i}=this;this.retryDelay=Pc(e,i.retry),i.retry++,re.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.url}, retrying ${i.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&Y_.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}function X_(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const Q_=/(\d+)-(\d+)\/(\d+)/;class hm{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||tC,this.controller=new self.AbortController,this.stats=new Ea}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,i){const s=this.stats;if(s.loading.start)throw new Error("Loader can only be used once.");s.loading.start=self.performance.now();const n=J_(e,this.controller.signal),a=i.onProgress,o=e.responseType==="arraybuffer",l=o?"byteLength":"length",{maxTimeToFirstByteMs:u,maxLoadTimeMs:h}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=i,this.request=this.fetchSetup(e,n),self.clearTimeout(this.requestTimeout),t.timeout=u&&Ie(u)?u:h,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),i.onTimeout(s,e,this.response)},t.timeout),self.fetch(this.request).then(f=>{this.response=this.loader=f;const g=Math.max(self.performance.now(),s.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=h,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),i.onTimeout(s,e,this.response)},h-(g-s.loading.start)),!f.ok){const{status:v,statusText:y}=f;throw new iC(y||"fetch, bad network response",v,f)}return s.loading.first=g,s.total=eC(f.headers)||s.total,a&&Ie(t.highWaterMark)?this.loadProgressively(f,s,e,t.highWaterMark,a):o?f.arrayBuffer():e.responseType==="json"?f.json():f.text()}).then(f=>{const g=this.response;if(!g)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),s.loading.end=Math.max(self.performance.now(),s.loading.first);const v=f[l];v&&(s.loaded=s.total=v);const y={url:g.url,data:f,code:g.status};a&&!Ie(t.highWaterMark)&&a(s,e,f,g),i.onSuccess(y,s,e,g)}).catch(f=>{if(self.clearTimeout(this.requestTimeout),s.aborted)return;const g=f&&f.code||0,v=f?f.message:null;i.onError({code:g,text:v},e,f?f.details:null,s)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,i,s=0,n){const a=new og,o=e.body.getReader(),l=()=>o.read().then(u=>{if(u.done)return a.dataLength&&n(t,i,a.flush(),e),Promise.resolve(new ArrayBuffer(0));const h=u.value,f=h.length;return t.loaded+=f,f<s||a.dataLength?(a.push(h),a.dataLength>=s&&n(t,i,a.flush(),e)):n(t,i,h,e),l()}).catch(()=>Promise.reject());return l()}}function J_(r,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(Lt({},r.headers))};return r.rangeEnd&&t.headers.set("Range","bytes="+r.rangeStart+"-"+String(r.rangeEnd-1)),t}function Z_(r){const e=Q_.exec(r);if(e)return parseInt(e[2])-parseInt(e[1])+1}function eC(r){const e=r.get("Content-Range");if(e){const i=Z_(e);if(Ie(i))return i}const t=r.get("Content-Length");if(t)return parseInt(t)}function tC(r,e){return new self.Request(r.url,e)}class iC extends Error{constructor(e,t,i){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=i}}const rC=/\s/,sC={newCue(r,e,t,i){const s=[];let n,a,o,l,u;const h=self.VTTCue||self.TextTrackCue;for(let g=0;g<i.rows.length;g++)if(n=i.rows[g],o=!0,l=0,u="",!n.isEmpty()){var f;for(let b=0;b<n.chars.length;b++)rC.test(n.chars[b].uchar)&&o?l++:(u+=n.chars[b].uchar,o=!1);n.cueStartTime=e,e===t&&(t+=1e-4),l>=16?l--:l++;const v=Hg(u.trim()),y=Jc(e,t,v);r!=null&&(f=r.cues)!=null&&f.getCueById(y)||(a=new h(e,t,v),a.id=y,a.line=g+1,a.align="left",a.position=10+Math.min(80,Math.floor(l*8/32)*10),s.push(a))}return r&&s.length&&(s.sort((g,v)=>g.line==="auto"||v.line==="auto"?0:g.line>8&&v.line>8?v.line-g.line:g.line-v.line),s.forEach(g=>Up(r,g))),s}},nC={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},dm=Mt(Mt({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:um,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:MT,bufferController:$A,capLevelController:ru,errorController:wT,fpsController:u_,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:up,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:nC},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},aC()),{},{subtitleStreamController:MA,subtitleTrackController:NA,timelineController:l_,audioStreamController:DA,audioTrackController:OA,emeController:ks,cmcdController:z_,contentSteeringController:q_});function aC(){return{cueHandler:sC,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function oC(r,e){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const t=lu(r),i=["manifest","level","frag"],s=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return i.forEach(n=>{const a=`${n==="level"?"playlist":n}LoadPolicy`,o=e[a]===void 0,l=[];s.forEach(u=>{const h=`${n}Loading${u}`,f=e[h];if(f!==void 0&&o){l.push(h);const g=t[a].default;switch(e[a]={default:g},u){case"TimeOut":g.maxLoadTimeMs=f,g.maxTimeToFirstByteMs=f;break;case"MaxRetry":g.errorRetry.maxNumRetry=f,g.timeoutRetry.maxNumRetry=f;break;case"RetryDelay":g.errorRetry.retryDelayMs=f,g.timeoutRetry.retryDelayMs=f;break;case"MaxRetryTimeout":g.errorRetry.maxRetryDelayMs=f,g.timeoutRetry.maxRetryDelayMs=f;break}}}),l.length&&re.warn(`hls.js config: "${l.join('", "')}" setting(s) are deprecated, use "${a}": ${JSON.stringify(e[a])}`)}),Mt(Mt({},t),e)}function lu(r){return r&&typeof r=="object"?Array.isArray(r)?r.map(lu):Object.keys(r).reduce((e,t)=>(e[t]=lu(r[t]),e),{}):r}function lC(r){const e=r.loader;e!==hm&&e!==um?(re.log("[config]: Custom loader detected, cannot enable progressive streaming"),r.progressive=!1):X_()&&(r.loader=hm,r.progressive=!0,r.enableSoftwareAES=!0,re.log("[config]: Progressive streaming enabled, using FetchLoader"))}let cu;class cC extends Dc{constructor(e,t){super(e,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(C.MANIFEST_LOADING,this.onManifestLoading,this),e.on(C.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(C.LEVEL_LOADED,this.onLevelLoaded,this),e.on(C.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(C.FRAG_BUFFERED,this.onFragBuffered,this),e.on(C.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(C.MANIFEST_LOADING,this.onManifestLoading,this),e.off(C.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(C.LEVEL_LOADED,this.onLevelLoaded,this),e.off(C.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(C.FRAG_BUFFERED,this.onFragBuffered,this),e.off(C.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const i=this.hls.config.preferManagedMediaSource,s=[],n={},a={};let o=!1,l=!1,u=!1;t.levels.forEach(h=>{var f,g;const v=h.attrs;let{audioCodec:y,videoCodec:b}=h;((f=y)==null?void 0:f.indexOf("mp4a.40.34"))!==-1&&(cu||(cu=/chrome|firefox/i.test(navigator.userAgent)),cu&&(h.audioCodec=y=void 0)),y&&(h.audioCodec=y=Ia(y,i)),((g=b)==null?void 0:g.indexOf("avc1"))===0&&(b=h.videoCodec=Zw(b));const{width:E,height:A,unknownCodecs:M}=h;if(o||(o=!!(E&&A)),l||(l=!!b),u||(u=!!y),M!=null&&M.length||y&&!Ec(y,"audio",i)||b&&!Ec(b,"video",i))return;const{CODECS:D,"FRAME-RATE":B,"HDCP-LEVEL":N,"PATHWAY-ID":J,RESOLUTION:Z,"VIDEO-RANGE":se}=v,q=`${`${J||"."}-`}${h.bitrate}-${Z}-${B}-${D}-${se}-${N}`;if(n[q])if(n[q].uri!==h.url&&!h.attrs["PATHWAY-ID"]){const oe=a[q]+=1;h.attrs["PATHWAY-ID"]=new Array(oe+1).join(".");const me=new ws(h);n[q]=me,s.push(me)}else n[q].addGroupId("audio",v.AUDIO),n[q].addGroupId("text",v.SUBTITLES);else{const oe=new ws(h);n[q]=oe,a[q]=1,s.push(oe)}}),this.filterAndSortMediaOptions(s,t,o,l,u)}filterAndSortMediaOptions(e,t,i,s,n){let a=[],o=[],l=e;if((i||s)&&n&&(l=l.filter(({videoCodec:y,videoRange:b,width:E,height:A})=>(!!y||!!(E&&A))&&dT(b))),l.length===0){Promise.resolve().then(()=>{if(this.hls){t.levels.length&&this.warn(`One or more CODECS in variant not supported: ${JSON.stringify(t.levels[0].attrs)}`);const y=new Error("no level with compatible codecs found in manifest");this.hls.trigger(C.ERROR,{type:Ve.MEDIA_ERROR,details:ce.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:y,reason:y.message})}});return}if(t.audioTracks){const{preferManagedMediaSource:y}=this.hls.config;a=t.audioTracks.filter(b=>!b.audioCodec||Ec(b.audioCodec,"audio",y)),fm(a)}t.subtitles&&(o=t.subtitles,fm(o));const u=l.slice(0);l.sort((y,b)=>{if(y.attrs["HDCP-LEVEL"]!==b.attrs["HDCP-LEVEL"])return(y.attrs["HDCP-LEVEL"]||"")>(b.attrs["HDCP-LEVEL"]||"")?1:-1;if(i&&y.height!==b.height)return y.height-b.height;if(y.frameRate!==b.frameRate)return y.frameRate-b.frameRate;if(y.videoRange!==b.videoRange)return ka.indexOf(y.videoRange)-ka.indexOf(b.videoRange);if(y.videoCodec!==b.videoCodec){const E=Cp(y.videoCodec),A=Cp(b.videoCodec);if(E!==A)return A-E}if(y.uri===b.uri&&y.codecSet!==b.codecSet){const E=La(y.codecSet),A=La(b.codecSet);if(E!==A)return A-E}return y.averageBitrate!==b.averageBitrate?y.averageBitrate-b.averageBitrate:0});let h=u[0];if(this.steering&&(l=this.steering.filterParsedLevels(l),l.length!==u.length)){for(let y=0;y<u.length;y++)if(u[y].pathwayId===l[0].pathwayId){h=u[y];break}}this._levels=l;for(let y=0;y<l.length;y++)if(l[y]===h){var f;this._firstLevel=y;const b=h.bitrate,E=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${l.length} level(s) found, first bitrate: ${b}`),((f=this.hls.userConfig)==null?void 0:f.abrEwmaDefaultEstimate)===void 0){const A=Math.min(b,this.hls.config.abrEwmaDefaultEstimateMax);A>E&&E===dm.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=A)}break}const g=n&&!s,v={levels:l,audioTracks:a,subtitleTracks:o,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:n,video:s,altAudio:!g&&a.some(y=>!!y.url)};this.hls.trigger(C.MANIFEST_PARSED,v),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return this._levels.length===0?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const h=new Error("invalid level idx"),f=e<0;if(this.hls.trigger(C.ERROR,{type:Ve.OTHER_ERROR,details:ce.LEVEL_SWITCH_ERROR,level:e,fatal:f,error:h,reason:h.message}),f)return;e=Math.min(e,t.length-1)}const i=this.currentLevelIndex,s=this.currentLevel,n=s?s.attrs["PATHWAY-ID"]:void 0,a=t[e],o=a.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=a,i===e&&a.details&&s&&n===o)return;this.log(`Switching to level ${e} (${a.height?a.height+"p ":""}${a.videoRange?a.videoRange+" ":""}${a.codecSet?a.codecSet+" ":""}@${a.bitrate})${o?" with Pathway "+o:""} from level ${i}${n?" with Pathway "+n:""}`);const l={level:e,attrs:a.attrs,details:a.details,bitrate:a.bitrate,averageBitrate:a.averageBitrate,maxBitrate:a.maxBitrate,realBitrate:a.realBitrate,width:a.width,height:a.height,codecSet:a.codecSet,audioCodec:a.audioCodec,videoCodec:a.videoCodec,audioGroups:a.audioGroups,subtitleGroups:a.subtitleGroups,loaded:a.loaded,loadError:a.loadError,fragmentError:a.fragmentError,name:a.name,id:a.id,uri:a.uri,url:a.url,urlId:0,audioGroupIds:a.audioGroupIds,textGroupIds:a.textGroupIds};this.hls.trigger(C.LEVEL_SWITCHING,l);const u=a.details;if(!u||u.live){const h=this.switchParams(a.uri,s==null?void 0:s.details,u);this.loadPlaylist(h)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,t){t.fatal||!t.context||t.context.type===rt.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===$e.MAIN){const i=t.elementaryStreams;if(!Object.keys(i).some(n=>!!i[n]))return;const s=this._levels[t.level];s!=null&&s.loadError&&(this.log(`Resetting level error count of ${s.loadError} on frag buffered`),s.loadError=0)}}onLevelLoaded(e,t){var i;const{level:s,details:n}=t,a=this._levels[s];if(!a){var o;this.warn(`Invalid level index ${s}`),(o=t.deliveryDirectives)!=null&&o.skip&&(n.deltaUpdateFailed=!0);return}s===this.currentLevelIndex?(a.fragmentError===0&&(a.loadError=0),this.playlistLoaded(s,t,a.details)):(i=t.deliveryDirectives)!=null&&i.skip&&(n.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist();const t=this.currentLevelIndex,i=this.currentLevel;if(i&&this.shouldLoadPlaylist(i)){let s=i.uri;if(e)try{s=e.addDirectives(s)}catch(a){this.warn(`Could not construct new URL with HLS Delivery Directives: ${a}`)}const n=i.attrs["PATHWAY-ID"];this.log(`Loading level index ${t}${(e==null?void 0:e.msn)!==void 0?" at sn "+e.msn+" part "+e.part:""} with${n?" Pathway "+n:""} ${s}`),this.clearTimer(),this.hls.trigger(C.LEVEL_LOADING,{url:s,level:t,pathwayId:i.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||null})}}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;const i=this._levels.filter((s,n)=>n!==e?!0:(this.steering&&this.steering.removeLevel(s),s===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,s.details&&s.details.fragments.forEach(a=>a.level=-1)),!1));Yp(i),this._levels=i,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(C.LEVELS_UPDATED,{levels:i})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:i}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(C.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:i}))}}function fm(r){const e={};r.forEach(t=>{const i=t.groupId||"";t.id=e[i]=e[i]||0,e[i]++})}class uC{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const i in this.keyUriToKeyInfo){const s=this.keyUriToKeyInfo[i].loader;if(s){var t;if(e&&e!==((t=s.context)==null?void 0:t.frag.type))return;s.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=ce.KEY_LOAD_ERROR,i,s,n){return new nr({type:Ve.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:n,error:i,networkDetails:s})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:i,cc:s}=e;for(let n=0;n<t.length;n++){const a=t[n];if(s<=a.cc&&(i==="initSegment"||a.sn==="initSegment"||i<a.sn)){this.emeController.selectKeySystemFormat(a).then(o=>{a.setKeyFormat(o)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var i,s;t&&e.setKeyFormat(t);const n=e.decryptdata;if(!n){const u=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,ce.KEY_LOAD_ERROR,u))}const a=n.uri;if(!a)return Promise.reject(this.createKeyLoadError(e,ce.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${a}"`)));let o=this.keyUriToKeyInfo[a];if((i=o)!=null&&i.decryptdata.key)return n.key=o.decryptdata.key,Promise.resolve({frag:e,keyInfo:o});if((s=o)!=null&&s.keyLoadPromise){var l;switch((l=o.mediaKeySessionContext)==null?void 0:l.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return o.keyLoadPromise.then(u=>(n.key=u.keyInfo.decryptdata.key,{frag:e,keyInfo:o}))}}switch(o=this.keyUriToKeyInfo[a]={decryptdata:n,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},n.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return n.keyFormat==="identity"?this.loadKeyHTTP(o,e):this.loadKeyEME(o,e);case"AES-128":return this.loadKeyHTTP(o,e);default:return Promise.reject(this.createKeyLoadError(e,ce.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${n.method}"`)))}}loadKeyEME(e,t){const i={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const s=this.emeController.loadKey(i);if(s)return(e.keyLoadPromise=s.then(n=>(e.mediaKeySessionContext=n,i))).catch(n=>{throw e.keyLoadPromise=null,n})}return Promise.resolve(i)}loadKeyHTTP(e,t){const i=this.config,s=i.loader,n=new s(i);return t.keyLoader=e.loader=n,e.keyLoadPromise=new Promise((a,o)=>{const l={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},u=i.keyLoadPolicy.default,h={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},f={onSuccess:(g,v,y,b)=>{const{frag:E,keyInfo:A,url:M}=y;if(!E.decryptdata||A!==this.keyUriToKeyInfo[M])return o(this.createKeyLoadError(E,ce.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),b));A.decryptdata.key=E.decryptdata.key=new Uint8Array(g.data),E.keyLoader=null,A.loader=null,a({frag:E,keyInfo:A})},onError:(g,v,y,b)=>{this.resetLoader(v),o(this.createKeyLoadError(t,ce.KEY_LOAD_ERROR,new Error(`HTTP Error ${g.code} loading key ${g.text}`),y,Mt({url:l.url,data:void 0},g)))},onTimeout:(g,v,y)=>{this.resetLoader(v),o(this.createKeyLoadError(t,ce.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),y))},onAbort:(g,v,y)=>{this.resetLoader(v),o(this.createKeyLoadError(t,ce.INTERNAL_ABORTED,new Error("key loading aborted"),y))}};n.load(l,h,f)})}resetLoader(e){const{frag:t,keyInfo:i,url:s}=e,n=i.loader;t.keyLoader===n&&(t.keyLoader=null,i.loader=null),delete this.keyUriToKeyInfo[s],n&&n.destroy()}}function pm(){return self.SourceBuffer||self.WebKitSourceBuffer}function gm(){if(!es())return!1;const e=pm();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function hC(){if(!gm())return!1;const r=es();return typeof(r==null?void 0:r.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>r.isTypeSupported(Pn(e,"video")))||["mp4a.40.2","fLaC"].some(e=>r.isTypeSupported(Pn(e,"audio"))))}function dC(){var r;const e=pm();return typeof(e==null||(r=e.prototype)==null?void 0:r.changeType)=="function"}const fC=250,Qa=2,pC=.1,gC=.05;class mC{constructor(e,t,i,s){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=i,this.hls=s}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:i,media:s,stalled:n}=this;if(s===null)return;const{currentTime:a,seeking:o}=s,l=this.seeking&&!o,u=!this.seeking&&o;if(this.seeking=o,a!==e){if(this.moved=!0,o||(this.nudgeRetry=0),n!==null){if(this.stallReported){const E=self.performance.now()-n;re.warn(`playback not stuck anymore @${a}, after ${Math.round(E)}ms`),this.stallReported=!1}this.stalled=null}return}if(u||l){this.stalled=null;return}if(s.paused&&!o||s.ended||s.playbackRate===0||!yt.getBuffered(s).length){this.nudgeRetry=0;return}const h=yt.bufferInfo(s,a,0),f=h.nextStart||0;if(o){const E=h.len>Qa,A=!f||t&&t.start<=a||f-a>Qa&&!this.fragmentTracker.getPartialFragment(a);if(E||A)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var g;if(!(h.len>0)&&!f)return;const A=Math.max(f,h.start||0)-a,M=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,B=(M==null||(g=M.details)==null?void 0:g.live)?M.details.targetduration*2:Qa,N=this.fragmentTracker.getPartialFragment(a);if(A>0&&(A<=B||N)){s.paused||this._trySkipBufferHole(N);return}}const v=self.performance.now();if(n===null){this.stalled=v;return}const y=v-n;if(!o&&y>=fC&&(this._reportStall(h),!this.media))return;const b=yt.bufferInfo(s,a,i.maxBufferHole);this._tryFixBufferStall(b,y)}_tryFixBufferStall(e,t){const{config:i,fragmentTracker:s,media:n}=this;if(n===null)return;const a=n.currentTime,o=s.getPartialFragment(a);o&&(this._trySkipBufferHole(o)||!this.media)||(e.len>i.maxBufferHole||e.nextStart&&e.nextStart-a<i.maxBufferHole)&&t>i.highBufferWatchdogPeriod*1e3&&(re.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:i,stallReported:s}=this;if(!s&&i){this.stallReported=!0;const n=new Error(`Playback stalling at @${i.currentTime} due to low buffer (${JSON.stringify(e)})`);re.warn(n.message),t.trigger(C.ERROR,{type:Ve.MEDIA_ERROR,details:ce.BUFFER_STALLED_ERROR,fatal:!1,error:n,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:i,media:s}=this;if(s===null)return 0;const n=s.currentTime,a=yt.bufferInfo(s,n,0),o=n<a.start?a.start:a.nextStart;if(o){const l=a.len<=t.maxBufferHole,u=a.len>0&&a.len<1&&s.readyState<3,h=o-n;if(h>0&&(l||u)){if(h>t.maxBufferHole){const{fragmentTracker:g}=this;let v=!1;if(n===0){const y=g.getAppendedFrag(0,$e.MAIN);y&&o<y.end&&(v=!0)}if(!v){const y=e||g.getAppendedFrag(n,$e.MAIN);if(y){let b=!1,E=y.end;for(;E<o;){const A=g.getPartialFragment(E);if(A)E+=A.duration;else{b=!0;break}}if(b)return 0}}}const f=Math.max(o+gC,n+pC);if(re.warn(`skipping hole, adjusting currentTime from ${n} to ${f}`),this.moved=!0,this.stalled=null,s.currentTime=f,e&&!e.gap){const g=new Error(`fragment loaded with buffer holes, seeking from ${n} to ${f}`);i.trigger(C.ERROR,{type:Ve.MEDIA_ERROR,details:ce.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:g,reason:g.message,frag:e})}return f}}return 0}_tryNudgeBuffer(){const{config:e,hls:t,media:i,nudgeRetry:s}=this;if(i===null)return;const n=i.currentTime;if(this.nudgeRetry++,s<e.nudgeMaxRetry){const a=n+(s+1)*e.nudgeOffset,o=new Error(`Nudging 'currentTime' from ${n} to ${a}`);re.warn(o.message),i.currentTime=a,t.trigger(C.ERROR,{type:Ve.MEDIA_ERROR,details:ce.BUFFER_NUDGE_ON_STALL,error:o,fatal:!1})}else{const a=new Error(`Playhead still not moving while enough data buffered @${n} after ${e.nudgeMaxRetry} nudges`);re.error(a.message),t.trigger(C.ERROR,{type:Ve.MEDIA_ERROR,details:ce.BUFFER_STALLED_ERROR,error:a,fatal:!0})}}}const vC=100;class yC extends Fc{constructor(e,t,i){super(e,t,i,"[stream-controller]",$e.MAIN),this.audioCodecSwap=!1,this.gapController=null,this.level=-1,this._forceStartLoad=!1,this.altAudio=!1,this.audioOnly=!1,this.fragPlaying=null,this.onvplaying=null,this.onvseeked=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(C.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(C.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(C.MANIFEST_LOADING,this.onManifestLoading,this),e.on(C.MANIFEST_PARSED,this.onManifestParsed,this),e.on(C.LEVEL_LOADING,this.onLevelLoading,this),e.on(C.LEVEL_LOADED,this.onLevelLoaded,this),e.on(C.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(C.ERROR,this.onError,this),e.on(C.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(C.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(C.BUFFER_CREATED,this.onBufferCreated,this),e.on(C.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(C.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(C.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(C.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(C.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(C.MANIFEST_LOADING,this.onManifestLoading,this),e.off(C.MANIFEST_PARSED,this.onManifestParsed,this),e.off(C.LEVEL_LOADED,this.onLevelLoaded,this),e.off(C.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(C.ERROR,this.onError,this),e.off(C.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(C.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(C.BUFFER_CREATED,this.onBufferCreated,this),e.off(C.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(C.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(C.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying()}startLoad(e){if(this.levels){const{lastCurrentTime:t,hls:i}=this;if(this.stopLoad(),this.setInterval(vC),this.level=-1,!this.startFragRequested){let s=i.startLevel;s===-1&&(i.config.testBandwidth&&this.levels.length>1?(s=0,this.bitrateTest=!0):s=i.firstAutoLevel),i.nextLoadLevel=s,this.level=i.loadLevel,this.loadedmetadata=!1}t>0&&e===-1&&(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t),this.state=pe.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=pe.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case pe.WAITING_LEVEL:{const{levels:t,level:i}=this,s=t==null?void 0:t[i],n=s==null?void 0:s.details;if(n&&(!n.live||this.levelLastLoaded===s)){if(this.waitForCdnTuneIn(n))break;this.state=pe.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=pe.IDLE;break}break}case pe.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),i=this.retryDate;if(!i||t>=i||(e=this.media)!=null&&e.seeking){const{levels:s,level:n}=this,a=s==null?void 0:s[n];this.resetStartWhenNotLoaded(a||null),this.state=pe.IDLE}}break}this.state===pe.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:i,media:s}=this;if(t===null||!s&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const n=e.nextLoadLevel;if(!(i!=null&&i[n]))return;const a=i[n],o=this.getMainFwdBufferInfo();if(o===null)return;const l=this.getLevelDetails();if(l&&this._streamEnded(o,l)){const b={};this.altAudio&&(b.type="video"),this.hls.trigger(C.BUFFER_EOS,b),this.state=pe.ENDED;return}e.loadLevel!==n&&e.manualLevel===-1&&this.log(`Adapting to level ${n} from level ${this.level}`),this.level=e.nextLoadLevel=n;const u=a.details;if(!u||this.state===pe.WAITING_LEVEL||u.live&&this.levelLastLoaded!==a){this.level=n,this.state=pe.WAITING_LEVEL;return}const h=o.len,f=this.getMaxBufferLength(a.maxBitrate);if(h>=f)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const g=this.backtrackFragment?this.backtrackFragment.start:o.end;let v=this.getNextFragment(g,u);if(this.couldBacktrack&&!this.fragPrevious&&v&&v.sn!=="initSegment"&&this.fragmentTracker.getState(v)!==Ft.OK){var y;const E=((y=this.backtrackFragment)!=null?y:v).sn-u.startSN,A=u.fragments[E-1];A&&v.cc===A.cc&&(v=A,this.fragmentTracker.removeFragment(A))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(v&&this.isLoopLoading(v,g)){if(!v.gap){const E=this.audioOnly&&!this.altAudio?ht.AUDIO:ht.VIDEO,A=(E===ht.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;A&&this.afterBufferFlushed(A,E,$e.MAIN)}v=this.getNextFragmentLoopLoading(v,u,o,$e.MAIN,f)}v&&(v.initSegment&&!v.initSegment.data&&!this.bitrateTest&&(v=v.initSegment),this.loadFragment(v,a,g))}loadFragment(e,t,i){const s=this.fragmentTracker.getState(e);this.fragCurrent=e,s===Ft.NOT_LOADED||s===Ft.PARTIAL?e.sn==="initSegment"?this._loadInitSegment(e,t):this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):(this.startFragRequested=!0,super.loadFragment(e,t,i)):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,$e.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let i;const s=this.getAppendedFrag(t.currentTime);s&&s.start>1&&this.flushMainBuffer(0,s.start-1);const n=this.getLevelDetails();if(n!=null&&n.live){const o=this.getMainFwdBufferInfo();if(!o||o.len<n.targetduration*2)return}if(!t.paused&&e){const o=this.hls.nextLoadLevel,l=e[o],u=this.fragLastKbps;u&&this.fragCurrent?i=this.fragCurrent.duration*l.maxBitrate/(1e3*u)+1:i=0}else i=0;const a=this.getBufferedFrag(t.currentTime+i);if(a){const o=this.followingBufferedFrag(a);if(o){this.abortCurrentFrag();const l=o.maxStartPTS?o.maxStartPTS:o.start,u=o.duration,h=Math.max(a.end,l+Math.min(Math.max(u-this.config.maxFragLookUpTolerance,u*(this.couldBacktrack?.5:.125)),u*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(h,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case pe.KEY_LOADING:case pe.FRAG_LOADING:case pe.FRAG_LOADING_WAITING_RETRY:case pe.PARSING:case pe.PARSED:this.state=pe.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const i=t.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),i.addEventListener("playing",this.onvplaying),i.addEventListener("seeked",this.onvseeked),this.gapController=new mC(this.config,i,this.fragmentTracker,this.hls)}onMediaDetaching(){const{media:e}=this;e&&this.onvplaying&&this.onvseeked&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),super.onMediaDetaching()}onMediaPlaying(){this.tick()}onMediaSeeked(){const e=this.media,t=e?e.currentTime:null;Ie(t)&&this.log(`Media seeked to ${t.toFixed(3)}`);const i=this.getMainFwdBufferInfo();if(i===null||i.len===0){this.warn(`Main forward buffer length on "seeked" event ${i?i.len:"empty"})`);return}this.tick()}onManifestLoading(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(C.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=this.fragLastKbps=0,this.levels=this.fragPlaying=this.backtrackFragment=this.levelLastLoaded=null,this.altAudio=this.audioOnly=this.startFragRequested=!1}onManifestParsed(e,t){let i=!1,s=!1;t.levels.forEach(n=>{const a=n.audioCodec;a&&(i=i||a.indexOf("mp4a.40.2")!==-1,s=s||a.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=i&&s&&!dC(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:i}=this;if(!i||this.state!==pe.IDLE)return;const s=i[t.level];(!s.details||s.details.live&&this.levelLastLoaded!==s||this.waitForCdnTuneIn(s.details))&&(this.state=pe.WAITING_LEVEL)}onLevelLoaded(e,t){var i;const{levels:s}=this,n=t.level,a=t.details,o=a.totalduration;if(!s){this.warn(`Levels were reset while loading level ${n}`);return}this.log(`Level ${n} loaded [${a.startSN},${a.endSN}]${a.lastPartSn?`[part-${a.lastPartSn}-${a.lastPartIndex}]`:""}, cc [${a.startCC}, ${a.endCC}] duration:${o}`);const l=s[n],u=this.fragCurrent;u&&(this.state===pe.FRAG_LOADING||this.state===pe.FRAG_LOADING_WAITING_RETRY)&&u.level!==t.level&&u.loader&&this.abortCurrentFrag();let h=0;if(a.live||(i=l.details)!=null&&i.live){var f;if(this.checkLiveUpdate(a),a.deltaUpdateFailed)return;h=this.alignPlaylists(a,l.details,(f=this.levelLastLoaded)==null?void 0:f.details)}if(l.details=a,this.levelLastLoaded=l,this.hls.trigger(C.LEVEL_UPDATED,{details:a,level:n}),this.state===pe.WAITING_LEVEL){if(this.waitForCdnTuneIn(a))return;this.state=pe.IDLE}this.startFragRequested?a.live&&this.synchronizeToLiveEdge(a):this.setStartPosition(a,h),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:i,part:s,payload:n}=e,{levels:a}=this;if(!a){this.warn(`Levels were reset while fragment load was in progress. Fragment ${i.sn} of level ${i.level} will not be buffered`);return}const o=a[i.level],l=o.details;if(!l){this.warn(`Dropping fragment ${i.sn} of level ${i.level} after level details were reset`),this.fragmentTracker.removeFragment(i);return}const u=o.videoCodec,h=l.PTSKnown||!l.live,f=(t=i.initSegment)==null?void 0:t.data,g=this._getAudioCodec(o),v=this.transmuxer=this.transmuxer||new Ig(this.hls,$e.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),y=s?s.index:-1,b=y!==-1,E=new Oc(i.level,i.sn,i.stats.chunkCount,n.byteLength,y,b),A=this.initPTS[i.cc];v.push(n,f,g,u,i,s,l.totalduration,h,E,A)}onAudioTrackSwitching(e,t){const i=this.altAudio;if(!!!t.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const a=this.fragCurrent;a&&(this.log("Switching to main audio track, cancel main fragment load"),a.abortRequests(),this.fragmentTracker.removeFragment(a)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const n=this.hls;i&&(n.trigger(C.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),n.trigger(C.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const i=t.id,s=!!this.hls.audioTracks[i].url;if(s){const n=this.videoBuffer;n&&this.mediaBuffer!==n&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=n)}this.altAudio=s,this.tick()}onBufferCreated(e,t){const i=t.tracks;let s,n,a=!1;for(const o in i){const l=i[o];if(l.id==="main"){if(n=o,s=l,o==="video"){const u=i[o];u&&(this.videoBuffer=u.buffer)}}else a=!0}a&&s?(this.log(`Alternate track found, use ${n}.buffered to schedule main fragment loading`),this.mediaBuffer=s.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:i,part:s}=t;if(i&&i.type!==$e.MAIN)return;if(this.fragContextChanged(i)){this.warn(`Fragment ${i.sn}${s?" p: "+s.index:""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}`),this.state===pe.PARSED&&(this.state=pe.IDLE);return}const n=s?s.stats:i.stats;this.fragLastKbps=Math.round(8*n.total/(n.buffering.end-n.loading.first)),i.sn!=="initSegment"&&(this.fragPrevious=i),this.fragBufferedComplete(i,s)}onError(e,t){var i;if(t.fatal){this.state=pe.ERROR;return}switch(t.details){case ce.FRAG_GAP:case ce.FRAG_PARSING_ERROR:case ce.FRAG_DECRYPT_ERROR:case ce.FRAG_LOAD_ERROR:case ce.FRAG_LOAD_TIMEOUT:case ce.KEY_LOAD_ERROR:case ce.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError($e.MAIN,t);break;case ce.LEVEL_LOAD_ERROR:case ce.LEVEL_LOAD_TIMEOUT:case ce.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===pe.WAITING_LEVEL&&((i=t.context)==null?void 0:i.type)===rt.LEVEL&&(this.state=pe.IDLE);break;case ce.BUFFER_APPEND_ERROR:case ce.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="main")return;if(t.details===ce.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case ce.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}checkBuffer(){const{media:e,gapController:t}=this;if(!(!e||!t||!e.readyState)){if(this.loadedmetadata||!yt.getBuffered(e).length){const i=this.state!==pe.IDLE?this.fragCurrent:null;t.poll(this.lastCurrentTime,i)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=pe.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==ht.AUDIO||this.audioOnly&&!this.altAudio){const i=(t===ht.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(i,t,$e.MAIN),this.tick()}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let i=this.startPosition;if(i>=0&&t<i){if(e.seeking){this.log(`could not seek to ${i}, already seeking at ${t}`);return}const s=yt.getBuffered(e),a=(s.length?s.start(0):0)-i;a>0&&(a<this.config.maxBufferHole||a<this.config.maxFragLookUpTolerance)&&(this.log(`adjusting start position by ${a} to match buffer start`),i+=a,this.startPosition=i),this.log(`seek to target start position ${i} from current time ${t}`),e.currentTime=i}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(i=>{const{hls:s}=this;if(!i||this.fragContextChanged(e))return;t.fragmentError=0,this.state=pe.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const n=e.stats;n.parsing.start=n.parsing.end=n.buffering.start=n.buffering.end=self.performance.now(),s.trigger(C.FRAG_LOADED,i),e.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const i="main",{hls:s}=this,{remuxResult:n,chunkMeta:a}=e,o=this.getCurrentContext(a);if(!o){this.resetWhenMissingContext(a);return}const{frag:l,part:u,level:h}=o,{video:f,text:g,id3:v,initSegment:y}=n,{details:b}=h,E=this.altAudio?void 0:n.audio;if(this.fragContextChanged(l)){this.fragmentTracker.removeFragment(l);return}if(this.state=pe.PARSING,y){if(y!=null&&y.tracks){const D=l.initSegment||l;this._bufferInitSegment(h,y.tracks,D,a),s.trigger(C.FRAG_PARSING_INIT_SEGMENT,{frag:D,id:i,tracks:y.tracks})}const A=y.initPTS,M=y.timescale;Ie(A)&&(this.initPTS[l.cc]={baseTime:A,timescale:M},s.trigger(C.INIT_PTS_FOUND,{frag:l,id:i,initPTS:A,timescale:M}))}if(f&&b&&l.sn!=="initSegment"){const A=b.fragments[l.sn-1-b.startSN],M=l.sn===b.startSN,D=!A||l.cc>A.cc;if(n.independent!==!1){const{startPTS:B,endPTS:N,startDTS:J,endDTS:Z}=f;if(u)u.elementaryStreams[f.type]={startPTS:B,endPTS:N,startDTS:J,endDTS:Z};else if(f.firstKeyFrame&&f.independent&&a.id===1&&!D&&(this.couldBacktrack=!0),f.dropped&&f.independent){const se=this.getMainFwdBufferInfo(),Q=(se?se.end:this.getLoadPosition())+this.config.maxBufferHole,q=f.firstKeyFramePTS?f.firstKeyFramePTS:B;if(!M&&Q<q-this.config.maxBufferHole&&!D){this.backtrack(l);return}else D&&(l.gap=!0);l.setElementaryStreamInfo(f.type,l.start,N,l.start,Z,!0)}else M&&B>Qa&&(l.gap=!0);l.setElementaryStreamInfo(f.type,B,N,J,Z),this.backtrackFragment&&(this.backtrackFragment=l),this.bufferFragmentData(f,l,u,a,M||D)}else if(M||D)l.gap=!0;else{this.backtrack(l);return}}if(E){const{startPTS:A,endPTS:M,startDTS:D,endDTS:B}=E;u&&(u.elementaryStreams[ht.AUDIO]={startPTS:A,endPTS:M,startDTS:D,endDTS:B}),l.setElementaryStreamInfo(ht.AUDIO,A,M,D,B),this.bufferFragmentData(E,l,u,a)}if(b&&v!=null&&(t=v.samples)!=null&&t.length){const A={id:i,frag:l,details:b,samples:v.samples};s.trigger(C.FRAG_PARSING_METADATA,A)}if(b&&g){const A={id:i,frag:l,details:b,samples:g.samples};s.trigger(C.FRAG_PARSING_USERDATA,A)}}_bufferInitSegment(e,t,i,s){if(this.state!==pe.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:n,video:a,audiovideo:o}=t;if(n){let l=e.audioCodec;const u=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(l&&(l.indexOf("mp4a.40.5")!==-1?l="mp4a.40.2":l="mp4a.40.5"),n.metadata.channelCount!==1&&u.indexOf("firefox")===-1&&(l="mp4a.40.5")),l&&l.indexOf("mp4a.40.5")!==-1&&u.indexOf("android")!==-1&&n.container!=="audio/mpeg"&&(l="mp4a.40.2",this.log(`Android: force audio codec to ${l}`)),e.audioCodec&&e.audioCodec!==l&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${l}"`),n.levelCodec=l,n.id="main",this.log(`Init audio buffer, container:${n.container}, codecs[selected/level/parsed]=[${l||""}/${e.audioCodec||""}/${n.codec}]`)}a&&(a.levelCodec=e.videoCodec,a.id="main",this.log(`Init video buffer, container:${a.container}, codecs[level/parsed]=[${e.videoCodec||""}/${a.codec}]`)),o&&this.log(`Init audiovideo buffer, container:${o.container}, codecs[level/parsed]=[${e.codecs}/${o.codec}]`),this.hls.trigger(C.BUFFER_CODECS,t),Object.keys(t).forEach(l=>{const h=t[l].initSegment;h!=null&&h.byteLength&&this.hls.trigger(C.BUFFER_APPENDING,{type:l,data:h,frag:i,part:null,chunkMeta:s,parent:i.type})}),this.tickImmediate()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,$e.MAIN)}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=pe.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const i=e.currentTime;if(yt.isBuffered(e,i)?t=this.getAppendedFrag(i):yt.isBuffered(e,i+.1)&&(t=this.getAppendedFrag(i+.1)),t){this.backtrackFragment=null;const s=this.fragPlaying,n=t.level;(!s||t.sn!==s.sn||s.level!==n)&&(this.fragPlaying=t,this.hls.trigger(C.FRAG_CHANGED,{frag:t}),(!s||s.level!==n)&&this.hls.trigger(C.LEVEL_SWITCHED,{level:n}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const t=e.currentTime,i=this.currentFrag;if(i&&Ie(t)&&Ie(i.programDateTime)){const s=i.programDateTime+(t-i.start)*1e3;return new Date(s)}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class Yi{static get version(){return"1.5.8"}static isMSESupported(){return gm()}static isSupported(){return hC()}static getMediaSource(){return es()}static get Events(){return C}static get ErrorTypes(){return Ve}static get ErrorDetails(){return ce}static get DefaultConfig(){return Yi.defaultConfig?Yi.defaultConfig:dm}static set DefaultConfig(e){Yi.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this.started=!1,this._emitter=new Kc,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,this.triggeringException=void 0,uw(e.debug||!1,"Hls instance");const t=this.config=oC(Yi.DefaultConfig,e);this.userConfig=e,t.progressive&&lC(t);const{abrController:i,bufferController:s,capLevelController:n,errorController:a,fpsController:o}=t,l=new a(this),u=this.abrController=new i(this),h=this.bufferController=new s(this),f=this.capLevelController=new n(this),g=new o(this),v=new sT(this),y=new cT(this),b=t.contentSteeringController,E=b?new b(this):null,A=this.levelController=new cC(this,E),M=new NT(this),D=new uC(this.config),B=this.streamController=new yC(this,M,D);f.setStreamController(B),g.setStreamController(B);const N=[v,A,B];E&&N.splice(1,0,E),this.networkControllers=N;const J=[u,h,f,g,y,M];this.audioTrackController=this.createController(t.audioTrackController,N);const Z=t.audioStreamController;Z&&N.push(new Z(this,M,D)),this.subtitleTrackController=this.createController(t.subtitleTrackController,N);const se=t.subtitleStreamController;se&&N.push(new se(this,M,D)),this.createController(t.timelineController,J),D.emeController=this.emeController=this.createController(t.emeController,J),this.cmcdController=this.createController(t.cmcdController,J),this.latencyController=this.createController(uT,J),this.coreComponents=J,N.push(l);const Q=l.onErrorOut;typeof Q=="function"&&this.on(C.ERROR,Q,l)}createController(e,t){if(e){const i=new e(this);return t&&t.push(i),i}return null}on(e,t,i=this){this._emitter.on(e,t,i)}once(e,t,i=this){this._emitter.once(e,t,i)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,i=this,s){this._emitter.off(e,t,i,s)}listeners(e){return this._emitter.listeners(e)}emit(e,t,i){return this._emitter.emit(e,t,i)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(i){if(re.error("An internal error happened while handling event "+e+'. Error message: "'+i.message+'". Here is a stacktrace:',i),!this.triggeringException){this.triggeringException=!0;const s=e===C.ERROR;this.trigger(C.ERROR,{type:Ve.OTHER_ERROR,details:ce.INTERNAL_EXCEPTION,fatal:s,event:e,error:i}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){re.log("destroy"),this.trigger(C.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){re.log("attachMedia"),this._media=e,this.trigger(C.MEDIA_ATTACHING,{media:e})}detachMedia(){re.log("detachMedia"),this.trigger(C.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,i=this.url,s=this.url=uc.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,re.log(`loadSource:${s}`),t&&i&&(i!==s||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(C.MANIFEST_LOADING,{url:e})}startLoad(e=-1){re.log(`startLoad(${e})`),this.started=!0,this.networkControllers.forEach(t=>{t.startLoad(e)})}stopLoad(){re.log("stopLoad"),this.started=!1,this.networkControllers.forEach(e=>{e.stopLoad()})}resumeBuffering(){this.started&&this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.startLoad(-1)})}pauseBuffering(){this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.stopLoad()})}swapAudioCodec(){re.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){re.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e){this.levelController.removeLevel(e)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){re.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){re.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){re.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){re.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){re.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(re.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){hT(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const i=e.length;for(let s=0;s<i;s++)if(e[s].maxBitrate>=t)return s;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:i}=this;let s;if(t===-1&&e!=null&&e.length?s=e.length-1:s=t,i)for(let n=s;n--;){const a=e[n].attrs["HDCP-LEVEL"];if(a&&a<=i)return n}return s}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}setAudioOption(e){var t;return(t=this.audioTrackController)==null?void 0:t.setAudioOption(e)}setSubtitleOption(e){var t;return(t=this.subtitleTrackController)==null||t.setSubtitleOption(e),null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}Yi.defaultConfig=void 0;function SC({src:r,quality:e,initialTime:t,timeOffsetStart:i,timeOffsetEnd:s,timeUpdateEvent:n=!1,debug:a,onSync:o,onInit:l,onDestroy:u}){const[h,f]=de.useState(),[g,v]=de.useState(!1),[y,b]=de.useState(1),[E,A]=de.useState(!1),[M,D]=de.useState(!1),[B,N]=de.useState(),[J,Z]=de.useState({originDurationTime:0,originCurrentTime:0,progress:0,currentTime:0,durationTime:0}),se=de.useRef(null),Q=de.useRef();JE({element:se.current,eventName:"timeupdate",handler:n&&E?()=>{if(!se.current)return;const ue=se.current,ge=Math.floor(ue.currentTime),Ce=Math.floor(ue.duration===1/0?ue.buffered.end(0):ue.duration),ve=ge-(i??0),Se=(s??Ce)-(i??0);Z({originCurrentTime:ge,originDurationTime:Ce,currentTime:ve,durationTime:Se,progress:ve/Se*100})}:void 0});const q=()=>{if(!se.current)return;const ue=se.current;ue.paused?ue.play().catch(()=>{N(!0)}):ue.pause()},oe=()=>{if(!se.current)return;const ue=se.current,ge=ue.currentTime+10;typeof s=="number"&&s<ge?ue.currentTime=s:ue.currentTime=ge},me=()=>{if(!se.current)return;const ue=se.current,ge=ue.currentTime-10;typeof i=="number"&&i>ge?ue.currentTime=i:ue.currentTime=ge},he=()=>{if(!se.current)return;const ue=se.current;ue.playbackRate===2?ue.playbackRate=1:ue.playbackRate+=.5},Ee=ue=>{if(!se.current)return;const ge=se.current;ge.currentTime=(i??0)+ue},we=de.useCallback(ue=>{const ge=se.current;ge&&(A(!1),Yi.isSupported()?(h==null||h.stopLoad(),h==null||h.loadSource(ue)):ge.canPlayType("application/vnd.apple.mpegurl")&&(ge.src=ue))},[h]);return de.useEffect(()=>{Q.current=o},[o]),de.useEffect(()=>{if(!se.current||!r)return;const ue=se.current;let ge;if(Yi.isSupported()){const Je={debug:!1,enableWorker:!0,lowLatencyMode:!0,backBufferLength:90,highBufferWatchdogPeriod:1,maxMaxBufferLength:8};ge=new Yi(Je),ge.attachMedia(ue),ge.loadSource(r),f(ge)}else ue.canPlayType("application/vnd.apple.mpegurl")&&(ue.src=r);const Ce=()=>{var kt,Ci,ke,yi;const Je=ue.duration,xt=((ke=(Ci=(kt=ge==null?void 0:ge.levels)==null?void 0:kt[0])==null?void 0:Ci.details)==null?void 0:ke.live)||Je===1/0;v(xt),(yi=Q.current)==null||yi.call(Q,!0),Je!==1/0&&Z(di=>({...di,durationTime:Math.floor(Je)})),t&&(ue.currentTime=t),i&&!xt&&(ue.currentTime=i),ue.play().catch(()=>{N(!0)})},ve=()=>{D(!1)},Se=()=>{typeof s=="number"&&ue.currentTime>=s&&typeof i=="number"&&(ue.currentTime=i),D(!0),N(!1)},qe=()=>{ue.pause()},Ue=()=>{A(!0)},Xe=()=>{b(ue.playbackRate)},it=({detail:Je})=>{ge&&(ge.currentLevel=Je.quality)},et=()=>{var kt,Ci,ke,yi,di,ss,ns,cr,as,Li,ur;const Je=ue.currentTime,xt=ue.duration;if((Ci=(kt=ge==null?void 0:ge.levels[ge.currentLevel])==null?void 0:kt.details)!=null&&Ci.live)(ke=Q==null?void 0:Q.current)==null||ke.call(Q,xt-Je<5);else if(xt===1/0){const Ir=ue.buffered.end(0);(yi=Q==null?void 0:Q.current)==null||yi.call(Q,Ir-Je<5)}if(typeof s=="number"&&Je>=s&&(ue.currentTime=s,ue.pause()),a){const Ir=ue.buffered.end(0),Qi=((ss=(di=ge==null?void 0:ge.levels[ge.currentLevel])==null?void 0:di.details)==null?void 0:ss.live)||xt===1/0,Ii={hls:Yi.isSupported(),live:Qi,currentLevel:((ns=ge==null?void 0:ge.levels[ge.currentLevel])==null?void 0:ns.width)||"auto",firstLevel:((cr=ge==null?void 0:ge.levels[ge.firstLevel])==null?void 0:cr.width)||"auto",latency:(as=ge==null?void 0:ge.latency)==null?void 0:as.toFixed(2),targetLatency:ge==null?void 0:ge.targetLatency,currentTime:Je,durationTime:xt,bufferedEnd:Ir,sync:Qi?(ur=(Li=ge==null?void 0:ge.levels[ge.currentLevel])==null?void 0:Li.details)!=null&&ur.live?Ir-Je<5:xt-Je<5:"not live"},Me=Object.entries(Ii).map(([Et,Ji])=>`
|
|
139
|
-
${Et}: ${Ji}`).join("");window==null||window.__brix_console(Me)}},lt=Je=>{console.log(Je)};return document.addEventListener("__BP_VIDEO_QUALITY",it),ue.addEventListener("progress",et),ue.addEventListener("loadedmetadata",Ce),ue.addEventListener("pause",ve),ue.addEventListener("play",Se),ue.addEventListener("ratechange",Xe),ue.addEventListener("canplay",Ue),ue.addEventListener("ended",qe),ue.addEventListener("error",lt),l==null||l(ue,ge),()=>{document.removeEventListener("__BP_VIDEO_QUALITY",it),ue.removeEventListener("progress",et),ue.removeEventListener("loadedmetadata",Ce),ue.removeEventListener("pause",ve),ue.removeEventListener("play",Se),ue.removeEventListener("ratechange",Xe),ue.removeEventListener("canplay",Ue),ue.removeEventListener("ended",qe),ue.removeEventListener("error",lt),ge==null||ge.stopLoad(),ge==null||ge.destroy(),u==null||u()}},[r,a,i,t,s,l,u]),de.useEffect(()=>{!E||typeof e>"u"||document.dispatchEvent(new CustomEvent("__BP_VIDEO_QUALITY",{detail:{quality:e}}))},[E,e]),{ref:se,play:M,live:g,error:B,time:J,hls:h,playbackRate:y,canPlay:E,handlePlayToggle:q,handleBackward:me,handleForward:oe,handlePlaybackRate:he,handleSeektime:Ee,handleChangeSource:we}}const Dn={root:"_root_ob44w_2",progress_wrap:"_progress_wrap_ob44w_14",rail:"_rail_ob44w_22",progress:"_progress_ob44w_14",handle:"_handle_ob44w_38"};function mm({handle:r,progress:e,className:t,onChangeProgress:i}){const s=de.useRef(null),n=l=>{const u=l.target,h=l.nativeEvent.offsetX/u.offsetWidth;i==null||i(l,h*100)},a=l=>{if(l.buttons!==1||!s.current)return;const u=l.target,h=l.nativeEvent.offsetX/u.offsetWidth;s.current.style.width=h*100+"%",i==null||i(l,h*100)},o=l=>{if(!s.current)return;const u=l.target,h=(l.targetTouches[0].clientX-u.getBoundingClientRect().x)/u.offsetWidth;s.current.style.width=h*100+"%",i==null||i(l,h*100)};return We.jsx("div",{className:`${Dn.root} ${t||""}`,children:We.jsxs("div",{className:Dn.progress_wrap,onClick:n,onMouseMove:a,onTouchMove:o,children:[We.jsx("div",{className:Dn.rail}),We.jsx("div",{className:`${Dn.progress} ${r?Dn.handle:""}`,ref:s,style:{width:`${e}%`}})]})})}const xC={root:"_root_pwcz5_1"};function vm(r){const e=Math.floor(+r/3600),t=Math.floor((+r-e*3600)/60),i=(+r-e*3600-t*60).toFixed(0);return e>0?`${e.toString().padStart(2,"0")}:${t.toString().padStart(2,"0")}:${i.padStart(2,"0")}`:`${t.toString().padStart(2,"0")}:${i.padStart(2,"0")}`}function bC(r){const e=r.split(":").map(Number);let t=0;if(e.length===3){const[i,s,n]=e;t=i*3600+s*60+n}else if(e.length===2){const[i,s]=e;t=i*60+s}else t=+r;return t}function ym(r,e){let t="",i="",s="";if(e){const[n,...a]=e.split("?");i=a.join("&"),s=n}for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&r[n]!==void 0&&(t+=`${n}=${encodeURIComponent(r[n])}&`);return t+=i?`&${i}`:"",t.length>0&&t.endsWith("&")&&(t=t.slice(0,-1)),s?`${s}?${t}`:t}const EC={type:"logger",log(r){this.output("log",r)},warn(r){this.output("warn",r)},error(r){this.output("error",r)},output(r,e){console&&console[r]&&console[r].apply(console,e)}};class Ja{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||EC,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,i,s){return s&&!this.debug?null:(typeof e[0]=="string"&&(e[0]=`${i}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Ja(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Ja(this.logger,e)}}var Xi=new Ja;class Za{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const s=this.observers[i].get(t)||0;this.observers[i].set(t,s+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(a=>{let[o,l]=a;for(let u=0;u<l;u++)o(...i)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(a=>{let[o,l]=a;for(let u=0;u<l;u++)o.apply(o,[e,...i])})}}function On(){let r,e;const t=new Promise((i,s)=>{r=i,e=s});return t.resolve=r,t.reject=e,t}function Sm(r){return r==null?"":""+r}function wC(r,e,t){r.forEach(i=>{e[i]&&(t[i]=e[i])})}const TC=/###/g;function Mn(r,e,t){function i(o){return o&&o.indexOf("###")>-1?o.replace(TC,"."):o}function s(){return!r||typeof r=="string"}const n=typeof e!="string"?e:e.split(".");let a=0;for(;a<n.length-1;){if(s())return{};const o=i(n[a]);!r[o]&&t&&(r[o]=new t),Object.prototype.hasOwnProperty.call(r,o)?r=r[o]:r={},++a}return s()?{}:{obj:r,k:i(n[a])}}function xm(r,e,t){const{obj:i,k:s}=Mn(r,e,Object);if(i!==void 0||e.length===1){i[s]=t;return}let n=e[e.length-1],a=e.slice(0,e.length-1),o=Mn(r,a,Object);for(;o.obj===void 0&&a.length;)n=`${a[a.length-1]}.${n}`,a=a.slice(0,a.length-1),o=Mn(r,a,Object),o&&o.obj&&typeof o.obj[`${o.k}.${n}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${n}`]=t}function AC(r,e,t,i){const{obj:s,k:n}=Mn(r,e,Object);s[n]=s[n]||[],s[n].push(t)}function eo(r,e){const{obj:t,k:i}=Mn(r,e);if(t)return t[i]}function _C(r,e,t){const i=eo(r,t);return i!==void 0?i:eo(e,t)}function bm(r,e,t){for(const i in e)i!=="__proto__"&&i!=="constructor"&&(i in r?typeof r[i]=="string"||r[i]instanceof String||typeof e[i]=="string"||e[i]instanceof String?t&&(r[i]=e[i]):bm(r[i],e[i],t):r[i]=e[i]);return r}function Os(r){return r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var CC={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function LC(r){return typeof r=="string"?r.replace(/[&<>"'\/]/g,e=>CC[e]):r}class IC{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const i=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,i),this.regExpQueue.push(e),i}}const RC=[" ",",","?","!",";"],PC=new IC(20);function kC(r,e,t){e=e||"",t=t||"";const i=RC.filter(a=>e.indexOf(a)<0&&t.indexOf(a)<0);if(i.length===0)return!0;const s=PC.getRegExp(`(${i.map(a=>a==="?"?"\\?":a).join("|")})`);let n=!s.test(r);if(!n){const a=r.indexOf(t);a>0&&!s.test(r.substring(0,a))&&(n=!0)}return n}function uu(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!r)return;if(r[e])return r[e];const i=e.split(t);let s=r;for(let n=0;n<i.length;){if(!s||typeof s!="object")return;let a,o="";for(let l=n;l<i.length;++l)if(l!==n&&(o+=t),o+=i[l],a=s[o],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&l<i.length-1)continue;n+=l-n+1;break}s=a}return s}function to(r){return r&&r.indexOf("_")>0?r.replace("_","-"):r}class Em extends Za{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,i){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const n=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,a=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],i&&(Array.isArray(i)?o.push(...i):typeof i=="string"&&n?o.push(...i.split(n)):o.push(i)));const l=eo(this.data,o);return!l&&!t&&!i&&e.indexOf(".")>-1&&(e=o[0],t=o[1],i=o.slice(2).join(".")),l||!a||typeof i!="string"?l:uu(this.data&&this.data[e]&&this.data[e][t],i,n)}addResource(e,t,i,s){let n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=[e,t];i&&(o=o.concat(a?i.split(a):i)),e.indexOf(".")>-1&&(o=e.split("."),s=t,t=o[1]),this.addNamespaces(t),xm(this.data,o,s),n.silent||this.emit("added",e,t,i,s)}addResources(e,t,i){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const n in i)(typeof i[n]=="string"||Array.isArray(i[n]))&&this.addResource(e,t,n,i[n],{silent:!0});s.silent||this.emit("added",e,t,i)}addResourceBundle(e,t,i,s,n){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),s=i,i=t,t=o[1]),this.addNamespaces(t);let l=eo(this.data,o)||{};a.skipCopy||(i=JSON.parse(JSON.stringify(i))),s?bm(l,i,n):l={...l,...i},xm(this.data,o,l),a.silent||this.emit("added",e,t,i)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(s=>t[s]&&Object.keys(t[s]).length>0)}toJSON(){return this.data}}var wm={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,t,i,s){return r.forEach(n=>{this.processors[n]&&(e=this.processors[n].process(e,t,i,s))}),e}};const Tm={};class io extends Za{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),wC(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Xi.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const i=this.resolve(e,t);return i&&i.res!==void 0}extractFromKey(e,t){let i=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const s=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let n=t.ns||this.options.defaultNS||[];const a=i&&e.indexOf(i)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!kC(e,i,s);if(a&&!o){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:n};const u=e.split(i);(i!==s||i===s&&this.options.ns.indexOf(u[0])>-1)&&(n=u.shift()),e=u.join(s)}return typeof n=="string"&&(n=[n]),{key:e,namespaces:n}}translate(e,t,i){if(typeof t!="object"&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),typeof t=="object"&&(t={...t}),t||(t={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const s=t.returnDetails!==void 0?t.returnDetails:this.options.returnDetails,n=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator,{key:a,namespaces:o}=this.extractFromKey(e[e.length-1],t),l=o[o.length-1],u=t.lng||this.language,h=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(h){const B=t.nsSeparator||this.options.nsSeparator;return s?{res:`${l}${B}${a}`,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(t)}:`${l}${B}${a}`}return s?{res:a,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(t)}:a}const f=this.resolve(e,t);let g=f&&f.res;const v=f&&f.usedKey||a,y=f&&f.exactUsedKey||a,b=Object.prototype.toString.apply(g),E=["[object Number]","[object Function]","[object RegExp]"],A=t.joinArrays!==void 0?t.joinArrays:this.options.joinArrays,M=!this.i18nFormat||this.i18nFormat.handleAsObject;if(M&&g&&(typeof g!="string"&&typeof g!="boolean"&&typeof g!="number")&&E.indexOf(b)<0&&!(typeof A=="string"&&Array.isArray(g))){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const B=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,g,{...t,ns:o}):`key '${a} (${this.language})' returned an object instead of string.`;return s?(f.res=B,f.usedParams=this.getUsedParamsDetails(t),f):B}if(n){const B=Array.isArray(g),N=B?[]:{},J=B?y:v;for(const Z in g)if(Object.prototype.hasOwnProperty.call(g,Z)){const se=`${J}${n}${Z}`;N[Z]=this.translate(se,{...t,joinArrays:!1,ns:o}),N[Z]===se&&(N[Z]=g[Z])}g=N}}else if(M&&typeof A=="string"&&Array.isArray(g))g=g.join(A),g&&(g=this.extendTranslation(g,e,t,i));else{let B=!1,N=!1;const J=t.count!==void 0&&typeof t.count!="string",Z=io.hasDefaultValue(t),se=J?this.pluralResolver.getSuffix(u,t.count,t):"",Q=t.ordinal&&J?this.pluralResolver.getSuffix(u,t.count,{ordinal:!1}):"",q=J&&!t.ordinal&&t.count===0&&this.pluralResolver.shouldUseIntlApi(),oe=q&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${se}`]||t[`defaultValue${Q}`]||t.defaultValue;!this.isValidLookup(g)&&Z&&(B=!0,g=oe),this.isValidLookup(g)||(N=!0,g=a);const he=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&N?void 0:g,Ee=Z&&oe!==g&&this.options.updateMissing;if(N||B||Ee){if(this.logger.log(Ee?"updateKey":"missingKey",u,l,a,Ee?oe:g),n){const Ce=this.resolve(a,{...t,keySeparator:!1});Ce&&Ce.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let we=[];const ue=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ue&&ue[0])for(let Ce=0;Ce<ue.length;Ce++)we.push(ue[Ce]);else this.options.saveMissingTo==="all"?we=this.languageUtils.toResolveHierarchy(t.lng||this.language):we.push(t.lng||this.language);const ge=(Ce,ve,Se)=>{const qe=Z&&Se!==g?Se:he;this.options.missingKeyHandler?this.options.missingKeyHandler(Ce,l,ve,qe,Ee,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(Ce,l,ve,qe,Ee,t),this.emit("missingKey",Ce,l,ve,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&J?we.forEach(Ce=>{const ve=this.pluralResolver.getSuffixes(Ce,t);q&&t[`defaultValue${this.options.pluralSeparator}zero`]&&ve.indexOf(`${this.options.pluralSeparator}zero`)<0&&ve.push(`${this.options.pluralSeparator}zero`),ve.forEach(Se=>{ge([Ce],a+Se,t[`defaultValue${Se}`]||oe)})}):ge(we,a,oe))}g=this.extendTranslation(g,e,t,f,i),N&&g===a&&this.options.appendNamespaceToMissingKey&&(g=`${l}:${a}`),(N||B)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${a}`:a,B?g:void 0):g=this.options.parseMissingKeyHandler(g))}return s?(f.res=g,f.usedParams=this.getUsedParamsDetails(t),f):g}extendTranslation(e,t,i,s,n){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const u=typeof e=="string"&&(i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(u){const g=e.match(this.interpolator.nestingRegexp);h=g&&g.length}let f=i.replace&&typeof i.replace!="string"?i.replace:i;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),e=this.interpolator.interpolate(e,f,i.lng||this.language,i),u){const g=e.match(this.interpolator.nestingRegexp),v=g&&g.length;h<v&&(i.nest=!1)}!i.lng&&this.options.compatibilityAPI!=="v1"&&s&&s.res&&(i.lng=s.usedLng),i.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var g=arguments.length,v=new Array(g),y=0;y<g;y++)v[y]=arguments[y];return n&&n[0]===v[0]&&!i.context?(a.logger.warn(`It seems you are nesting recursively key: ${v[0]} in key: ${t[0]}`),null):a.translate(...v,t)},i)),i.interpolation&&this.interpolator.reset()}const o=i.postProcess||this.options.postProcess,l=typeof o=="string"?[o]:o;return e!=null&&l&&l.length&&i.applyPostProcessor!==!1&&(e=wm.handle(l,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),e}resolve(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i,s,n,a,o;return typeof e=="string"&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(i))return;const u=this.extractFromKey(l,t),h=u.key;s=h;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const g=t.count!==void 0&&typeof t.count!="string",v=g&&!t.ordinal&&t.count===0&&this.pluralResolver.shouldUseIntlApi(),y=t.context!==void 0&&(typeof t.context=="string"||typeof t.context=="number")&&t.context!=="",b=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);f.forEach(E=>{this.isValidLookup(i)||(o=E,!Tm[`${b[0]}-${E}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(o)&&(Tm[`${b[0]}-${E}`]=!0,this.logger.warn(`key "${s}" for languages "${b.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),b.forEach(A=>{if(this.isValidLookup(i))return;a=A;const M=[h];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(M,h,A,E,t);else{let B;g&&(B=this.pluralResolver.getSuffix(A,t.count,t));const N=`${this.options.pluralSeparator}zero`,J=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(g&&(M.push(h+B),t.ordinal&&B.indexOf(J)===0&&M.push(h+B.replace(J,this.options.pluralSeparator)),v&&M.push(h+N)),y){const Z=`${h}${this.options.contextSeparator}${t.context}`;M.push(Z),g&&(M.push(Z+B),t.ordinal&&B.indexOf(J)===0&&M.push(Z+B.replace(J,this.options.pluralSeparator)),v&&M.push(Z+N))}}let D;for(;D=M.pop();)this.isValidLookup(i)||(n=D,i=this.getResource(A,E,D,t))}))})}),{res:i,usedKey:s,exactUsedKey:n,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,i){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,i,s):this.resourceStore.getResource(e,t,i,s)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=e.replace&&typeof e.replace!="string";let s=i?e.replace:e;if(i&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!i){s={...s};for(const n of t)delete s[n]}return s}static hasDefaultValue(e){const t="defaultValue";for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t===i.substring(0,t.length)&&e[i]!==void 0)return!0;return!1}}function hu(r){return r.charAt(0).toUpperCase()+r.slice(1)}class Am{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Xi.create("languageUtils")}getScriptPartFromCode(e){if(e=to(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=to(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(typeof e=="string"&&e.indexOf("-")>-1){const t=["hans","hant","latn","cyrl","cans","mong","arab"];let i=e.split("-");return this.options.lowerCaseLng?i=i.map(s=>s.toLowerCase()):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),t.indexOf(i[1].toLowerCase())>-1&&(i[1]=hu(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),t.indexOf(i[1].toLowerCase())>-1&&(i[1]=hu(i[1].toLowerCase())),t.indexOf(i[2].toLowerCase())>-1&&(i[2]=hu(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(i=>{if(t)return;const s=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(s))&&(t=s)}),!t&&this.options.supportedLngs&&e.forEach(i=>{if(t)return;const s=this.getLanguagePartFromCode(i);if(this.isSupportedCode(s))return t=s;t=this.options.supportedLngs.find(n=>{if(n===s)return n;if(!(n.indexOf("-")<0&&s.indexOf("-")<0)&&(n.indexOf("-")>0&&s.indexOf("-")<0&&n.substring(0,n.indexOf("-"))===s||n.indexOf(s)===0&&s.length>1))return n})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),typeof e=="string"&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let i=e[t];return i||(i=e[this.getScriptPartFromCode(t)]),i||(i=e[this.formatLanguageCode(t)]),i||(i=e[this.getLanguagePartFromCode(t)]),i||(i=e.default),i||[]}toResolveHierarchy(e,t){const i=this.getFallbackCodes(t||this.options.fallbackLng||[],e),s=[],n=a=>{a&&(this.isSupportedCode(a)?s.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return typeof e=="string"&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&n(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&n(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&n(this.getLanguagePartFromCode(e))):typeof e=="string"&&n(this.formatLanguageCode(e)),i.forEach(a=>{s.indexOf(a)<0&&n(this.formatLanguageCode(a))}),s}}let DC=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],OC={1:function(r){return+(r>1)},2:function(r){return+(r!=1)},3:function(r){return 0},4:function(r){return r%10==1&&r%100!=11?0:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?1:2},5:function(r){return r==0?0:r==1?1:r==2?2:r%100>=3&&r%100<=10?3:r%100>=11?4:5},6:function(r){return r==1?0:r>=2&&r<=4?1:2},7:function(r){return r==1?0:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?1:2},8:function(r){return r==1?0:r==2?1:r!=8&&r!=11?2:3},9:function(r){return+(r>=2)},10:function(r){return r==1?0:r==2?1:r<7?2:r<11?3:4},11:function(r){return r==1||r==11?0:r==2||r==12?1:r>2&&r<20?2:3},12:function(r){return+(r%10!=1||r%100==11)},13:function(r){return+(r!==0)},14:function(r){return r==1?0:r==2?1:r==3?2:3},15:function(r){return r%10==1&&r%100!=11?0:r%10>=2&&(r%100<10||r%100>=20)?1:2},16:function(r){return r%10==1&&r%100!=11?0:r!==0?1:2},17:function(r){return r==1||r%10==1&&r%100!=11?0:1},18:function(r){return r==0?0:r==1?1:2},19:function(r){return r==1?0:r==0||r%100>1&&r%100<11?1:r%100>10&&r%100<20?2:3},20:function(r){return r==1?0:r==0||r%100>0&&r%100<20?1:2},21:function(r){return r%100==1?1:r%100==2?2:r%100==3||r%100==4?3:0},22:function(r){return r==1?0:r==2?1:(r<0||r>10)&&r%10==0?2:3}};const MC=["v1","v2","v3"],FC=["v4"],_m={zero:0,one:1,two:2,few:3,many:4,other:5};function NC(){const r={};return DC.forEach(e=>{e.lngs.forEach(t=>{r[t]={numbers:e.nr,plurals:OC[e.fc]}})}),r}class BC{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=Xi.create("pluralResolver"),(!this.options.compatibilityJSON||FC.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=NC()}addRule(e,t){this.rules[e]=t}getRule(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(to(e==="dev"?"en":e),{type:t.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const i=this.getRule(e,t);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}getPluralFormsOfKey(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,i).map(s=>`${t}${s}`)}getSuffixes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const i=this.getRule(e,t);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort((s,n)=>_m[s]-_m[n]).map(s=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${s}`):i.numbers.map(s=>this.getSuffix(e,s,t)):[]}getSuffix(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(e,i);return s?this.shouldUseIntlApi()?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:this.getSuffixRetroCompatible(s,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const i=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let s=e.numbers[i];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));const n=()=>this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString();return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?`_plural_${s.toString()}`:n():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?n():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}shouldUseIntlApi(){return!MC.includes(this.options.compatibilityJSON)}}function Cm(r,e,t){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,n=_C(r,e,t);return!n&&s&&typeof t=="string"&&(n=uu(r,t,i),n===void 0&&(n=uu(e,t,i))),n}class $C{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Xi.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(t=>t),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:i,useRawValueToEscape:s,prefix:n,prefixEscaped:a,suffix:o,suffixEscaped:l,formatSeparator:u,unescapeSuffix:h,unescapePrefix:f,nestingPrefix:g,nestingPrefixEscaped:v,nestingSuffix:y,nestingSuffixEscaped:b,nestingOptionsSeparator:E,maxReplaces:A,alwaysFormat:M}=e.interpolation;this.escape=t!==void 0?t:LC,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=n?Os(n):a||"{{",this.suffix=o?Os(o):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=h?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=g?Os(g):v||Os("$t("),this.nestingSuffix=y?Os(y):b||Os(")"),this.nestingOptionsSeparator=E||",",this.maxReplaces=A||1e3,this.alwaysFormat=M!==void 0?M:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,i)=>t&&t.source===i?(t.lastIndex=0,t):new RegExp(i,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,i,s){let n,a,o;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(y){return y.replace(/\$/g,"$$$$")}const h=y=>{if(y.indexOf(this.formatSeparator)<0){const M=Cm(t,l,y,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(M,void 0,i,{...s,...t,interpolationkey:y}):M}const b=y.split(this.formatSeparator),E=b.shift().trim(),A=b.join(this.formatSeparator).trim();return this.format(Cm(t,l,E,this.options.keySeparator,this.options.ignoreJSONStructure),A,i,{...s,...t,interpolationkey:E})};this.resetRegExp();const f=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,g=s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:y=>u(y)},{regex:this.regexp,safeValue:y=>this.escapeValue?u(this.escape(y)):u(y)}].forEach(y=>{for(o=0;n=y.regex.exec(e);){const b=n[1].trim();if(a=h(b),a===void 0)if(typeof f=="function"){const A=f(e,n,s);a=typeof A=="string"?A:""}else if(s&&Object.prototype.hasOwnProperty.call(s,b))a="";else if(g){a=n[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${e}`),a="";else typeof a!="string"&&!this.useRawValueToEscape&&(a=Sm(a));const E=y.safeValue(a);if(e=e.replace(n[0],E),g?(y.regex.lastIndex+=a.length,y.regex.lastIndex-=n[0].length):y.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,n,a;function o(l,u){const h=this.nestingOptionsSeparator;if(l.indexOf(h)<0)return l;const f=l.split(new RegExp(`${h}[ ]*{`));let g=`{${f[1]}`;l=f[0],g=this.interpolate(g,a);const v=g.match(/'/g),y=g.match(/"/g);(v&&v.length%2===0&&!y||y.length%2!==0)&&(g=g.replace(/'/g,'"'));try{a=JSON.parse(g),u&&(a={...u,...a})}catch(b){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,b),`${l}${h}${g}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,l}for(;s=this.nestingRegexp.exec(e);){let l=[];a={...i},a=a.replace&&typeof a.replace!="string"?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let u=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const h=s[1].split(this.formatSeparator).map(f=>f.trim());s[1]=h.shift(),l=h,u=!0}if(n=t(o.call(this,s[1].trim(),a),a),n&&s[0]===e&&typeof n!="string")return n;typeof n!="string"&&(n=Sm(n)),n||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),n=""),u&&(n=l.reduce((h,f)=>this.format(h,f,i.lng,{...i,interpolationkey:s[1].trim()}),n.trim())),e=e.replace(s[0],n),this.regexp.lastIndex=0}return e}}function UC(r){let e=r.toLowerCase().trim();const t={};if(r.indexOf("(")>-1){const i=r.split("(");e=i[0].toLowerCase().trim();const s=i[1].substring(0,i[1].length-1);e==="currency"&&s.indexOf(":")<0?t.currency||(t.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?t.range||(t.range=s.trim()):s.split(";").forEach(a=>{if(a){const[o,...l]=a.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),h=o.trim();t[h]||(t[h]=u),u==="false"&&(t[h]=!1),u==="true"&&(t[h]=!0),isNaN(u)||(t[h]=parseInt(u,10))}})}return{formatName:e,formatOptions:t}}function Ms(r){const e={};return function(i,s,n){const a=s+JSON.stringify(n);let o=e[a];return o||(o=r(to(s),n),e[a]=o),o(i)}}class GC{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Xi.create("formatter"),this.options=e,this.formats={number:Ms((t,i)=>{const s=new Intl.NumberFormat(t,{...i});return n=>s.format(n)}),currency:Ms((t,i)=>{const s=new Intl.NumberFormat(t,{...i,style:"currency"});return n=>s.format(n)}),datetime:Ms((t,i)=>{const s=new Intl.DateTimeFormat(t,{...i});return n=>s.format(n)}),relativetime:Ms((t,i)=>{const s=new Intl.RelativeTimeFormat(t,{...i});return n=>s.format(n,i.range||"day")}),list:Ms((t,i)=>{const s=new Intl.ListFormat(t,{...i});return n=>s.format(n)})},this.init(e)}init(e){const i=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Ms(t)}format(e,t,i){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return t.split(this.formatSeparator).reduce((o,l)=>{const{formatName:u,formatOptions:h}=UC(l);if(this.formats[u]){let f=o;try{const g=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},v=g.locale||g.lng||s.locale||s.lng||i;f=this.formats[u](o,v,{...h,...s,...g})}catch(g){this.logger.warn(g)}return f}else this.logger.warn(`there was no format function for ${u}`);return o},e)}}function VC(r,e){r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)}class jC extends Za{constructor(e,t,i){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=i,this.languageUtils=i.languageUtils,this.options=s,this.logger=Xi.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(i,s.backend,s)}queueLoad(e,t,i,s){const n={},a={},o={},l={};return e.forEach(u=>{let h=!0;t.forEach(f=>{const g=`${u}|${f}`;!i.reload&&this.store.hasResourceBundle(u,f)?this.state[g]=2:this.state[g]<0||(this.state[g]===1?a[g]===void 0&&(a[g]=!0):(this.state[g]=1,h=!1,a[g]===void 0&&(a[g]=!0),n[g]===void 0&&(n[g]=!0),l[f]===void 0&&(l[f]=!0)))}),h||(o[u]=!0)}),(Object.keys(n).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(n),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(l)}}loaded(e,t,i){const s=e.split("|"),n=s[0],a=s[1];t&&this.emit("failedLoading",n,a,t),i&&this.store.addResourceBundle(n,a,i,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2;const o={};this.queue.forEach(l=>{AC(l.loaded,[n],a),VC(l,e),t&&l.errors.push(t),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{o[u]||(o[u]={});const h=l.loaded[u];h.length&&h.forEach(f=>{o[u][f]===void 0&&(o[u][f]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(l=>!l.done)}read(e,t,i){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:i,tried:s,wait:n,callback:a});return}this.readingCalls++;const o=(u,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&h&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,i,s+1,n*2,a)},n);return}a(u,h)},l=this.backend[i].bind(this.backend);if(l.length===2){try{const u=l(e,t);u&&typeof u.then=="function"?u.then(h=>o(null,h)).catch(o):o(null,u)}catch(u){o(u)}return}return l(e,t,o)}prepareLoading(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();typeof e=="string"&&(e=this.languageUtils.toResolveHierarchy(e)),typeof t=="string"&&(t=[t]);const n=this.queueLoad(e,t,i,s);if(!n.toLoad.length)return n.pending.length||s(),null;n.toLoad.forEach(a=>{this.loadOne(a)})}load(e,t,i){this.prepareLoading(e,t,{},i)}reload(e,t,i){this.prepareLoading(e,t,{reload:!0},i)}loadOne(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const i=e.split("|"),s=i[0],n=i[1];this.read(s,n,"read",void 0,void 0,(a,o)=>{a&&this.logger.warn(`${t}loading namespace ${n} for language ${s} failed`,a),!a&&o&&this.logger.log(`${t}loaded namespace ${n} for language ${s}`,o),this.loaded(e,a,o)})}saveMissing(e,t,i,s,n){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${i}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if(this.backend&&this.backend.create){const l={...a,isUpdate:n},u=this.backend.create.bind(this.backend);if(u.length<6)try{let h;u.length===5?h=u(e,t,i,s,l):h=u(e,t,i,s),h&&typeof h.then=="function"?h.then(f=>o(null,f)).catch(o):o(null,h)}catch(h){o(h)}else u(e,t,i,s,o,l)}!e||!e[0]||this.store.addResource(e[0],t,i,s)}}}function Lm(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let t={};if(typeof e[1]=="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const i=e[3]||e[2];Object.keys(i).forEach(s=>{t[s]=i[s]})}return t},interpolation:{escapeValue:!0,format:r=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Im(r){return typeof r.ns=="string"&&(r.ns=[r.ns]),typeof r.fallbackLng=="string"&&(r.fallbackLng=[r.fallbackLng]),typeof r.fallbackNS=="string"&&(r.fallbackNS=[r.fallbackNS]),r.supportedLngs&&r.supportedLngs.indexOf("cimode")<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),r}function ro(){}function HC(r){Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})}class Fn extends Za{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Im(e),this.services={},this.logger=Xi,this.modules={external:[]},HC(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof t=="function"&&(i=t,t={}),!t.defaultNS&&t.defaultNS!==!1&&t.ns&&(typeof t.ns=="string"?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const s=Lm();this.options={...s,...this.options,...Im(t)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...s.interpolation,...this.options.interpolation}),t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);function n(h){return h?typeof h=="function"?new h:h:null}if(!this.options.isClone){this.modules.logger?Xi.init(n(this.modules.logger),this.options):Xi.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:typeof Intl<"u"&&(h=GC);const f=new Am(this.options);this.store=new Em(this.options.resources,this.options);const g=this.services;g.logger=Xi,g.resourceStore=this.store,g.languageUtils=f,g.pluralResolver=new BC(f,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),h&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(g.formatter=n(h),g.formatter.init(g,this.options),this.options.interpolation.format=g.formatter.format.bind(g.formatter)),g.interpolator=new $C(this.options),g.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},g.backendConnector=new jC(n(this.modules.backend),g.resourceStore,g,this.options),g.backendConnector.on("*",function(v){for(var y=arguments.length,b=new Array(y>1?y-1:0),E=1;E<y;E++)b[E-1]=arguments[E];e.emit(v,...b)}),this.modules.languageDetector&&(g.languageDetector=n(this.modules.languageDetector),g.languageDetector.init&&g.languageDetector.init(g,this.options.detection,this.options)),this.modules.i18nFormat&&(g.i18nFormat=n(this.modules.i18nFormat),g.i18nFormat.init&&g.i18nFormat.init(this)),this.translator=new io(this.services,this.options),this.translator.on("*",function(v){for(var y=arguments.length,b=new Array(y>1?y-1:0),E=1;E<y;E++)b[E-1]=arguments[E];e.emit(v,...b)}),this.modules.external.forEach(v=>{v.init&&v.init(this)})}if(this.format=this.options.interpolation.format,i||(i=ro),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(h=>{this[h]=function(){return e.store[h](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=function(){return e.store[h](...arguments),e}});const l=On(),u=()=>{const h=(f,g)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(g),i(f,g)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),l}loadResources(e){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ro;const s=typeof e=="string"?e:this.language;if(typeof e=="function"&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const n=[],a=o=>{if(!o||o==="cimode")return;this.services.languageUtils.toResolveHierarchy(o).forEach(u=>{u!=="cimode"&&n.indexOf(u)<0&&n.push(u)})};s?a(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>a(l)),this.options.preload&&this.options.preload.forEach(o=>a(o)),this.services.backendConnector.load(n,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(o)})}else i(null)}reloadResources(e,t,i){const s=On();return e||(e=this.languages),t||(t=this.options.ns),i||(i=ro),this.services.backendConnector.reload(e,t,n=>{s.resolve(),i(n)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&wm.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let t=0;t<this.languages.length;t++){const i=this.languages[t];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}}changeLanguage(e,t){var i=this;this.isLanguageChangingTo=e;const s=On();this.emit("languageChanging",e);const n=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},a=(l,u)=>{u?(n(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,s.resolve(function(){return i.t(...arguments)}),t&&t(l,function(){return i.t(...arguments)})},o=l=>{!e&&!l&&this.services.languageDetector&&(l=[]);const u=typeof l=="string"?l:this.services.languageUtils.getBestMatchFromCodes(l);u&&(this.language||n(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,h=>{a(h,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),s}getFixedT(e,t,i){var s=this;const n=function(a,o){let l;if(typeof o!="object"){for(var u=arguments.length,h=new Array(u>2?u-2:0),f=2;f<u;f++)h[f-2]=arguments[f];l=s.options.overloadTranslationOptionHandler([a,o].concat(h))}else l={...o};l.lng=l.lng||n.lng,l.lngs=l.lngs||n.lngs,l.ns=l.ns||n.ns,l.keyPrefix=l.keyPrefix||i||n.keyPrefix;const g=s.options.keySeparator||".";let v;return l.keyPrefix&&Array.isArray(a)?v=a.map(y=>`${l.keyPrefix}${g}${y}`):v=l.keyPrefix?`${l.keyPrefix}${g}${a}`:a,s.t(v,l)};return typeof e=="string"?n.lng=e:n.lngs=e,n.ns=t,n.keyPrefix=i,n}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=t.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,n=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const a=(o,l)=>{const u=this.services.backendConnector.state[`${o}|${l}`];return u===-1||u===2};if(t.precheck){const o=t.precheck(this,a);if(o!==void 0)return o}return!!(this.hasResourceBundle(i,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(i,e)&&(!s||a(n,e)))}loadNamespaces(e,t){const i=On();return this.options.ns?(typeof e=="string"&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{i.resolve(),t&&t(s)}),i):(t&&t(),Promise.resolve())}loadLanguages(e,t){const i=On();typeof e=="string"&&(e=[e]);const s=this.options.preload||[],n=e.filter(a=>s.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return n.length?(this.options.preload=s.concat(n),this.loadResources(a=>{i.resolve(),t&&t(a)}),i):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=this.services&&this.services.languageUtils||new Am(Lm());return t.indexOf(i.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new Fn(e,t)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ro;const i=e.forkResourceStore;i&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},n=new Fn(s);return(e.debug!==void 0||e.prefix!==void 0)&&(n.logger=n.logger.clone(e)),["store","services","language"].forEach(o=>{n[o]=this[o]}),n.services={...this.services},n.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},i&&(n.store=new Em(this.store.data,s),n.services.resourceStore=n.store),n.translator=new io(n.services,s),n.translator.on("*",function(o){for(var l=arguments.length,u=new Array(l>1?l-1:0),h=1;h<l;h++)u[h-1]=arguments[h];n.emit(o,...u)}),n.init(s,t),n.translator.options=s,n.translator.backendConnector.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},n}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Vt=Fn.createInstance();Vt.createInstance=Fn.createInstance,Vt.createInstance,Vt.dir,Vt.init,Vt.loadResources,Vt.reloadResources,Vt.use,Vt.changeLanguage,Vt.getFixedT,Vt.t,Vt.exists,Vt.setDefaultNamespace,Vt.hasLoadedNamespace,Vt.loadNamespaces,Vt.loadLanguages;function KC(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Nn(r){"@babel/helpers - typeof";return Nn=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},Nn(r)}function zC(r,e){if(Nn(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e);if(Nn(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function WC(r){var e=zC(r,"string");return Nn(e)=="symbol"?e:e+""}function qC(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,WC(i.key),i)}}function YC(r,e,t){return e&&qC(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}var Rm=[],XC=Rm.forEach,QC=Rm.slice;function JC(r){return XC.call(QC.call(arguments,1),function(e){if(e)for(var t in e)r[t]===void 0&&(r[t]=e[t])}),r}var Pm=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,ZC=function(e,t,i){var s=i||{};s.path=s.path||"/";var n=encodeURIComponent(t),a="".concat(e,"=").concat(n);if(s.maxAge>0){var o=s.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");a+="; Max-Age=".concat(Math.floor(o))}if(s.domain){if(!Pm.test(s.domain))throw new TypeError("option domain is invalid");a+="; Domain=".concat(s.domain)}if(s.path){if(!Pm.test(s.path))throw new TypeError("option path is invalid");a+="; Path=".concat(s.path)}if(s.expires){if(typeof s.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires=".concat(s.expires.toUTCString())}if(s.httpOnly&&(a+="; HttpOnly"),s.secure&&(a+="; Secure"),s.sameSite){var l=typeof s.sameSite=="string"?s.sameSite.toLowerCase():s.sameSite;switch(l){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},km={create:function(e,t,i,s){var n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};i&&(n.expires=new Date,n.expires.setTime(n.expires.getTime()+i*60*1e3)),s&&(n.domain=s),document.cookie=ZC(e,encodeURIComponent(t),n)},read:function(e){for(var t="".concat(e,"="),i=document.cookie.split(";"),s=0;s<i.length;s++){for(var n=i[s];n.charAt(0)===" ";)n=n.substring(1,n.length);if(n.indexOf(t)===0)return n.substring(t.length,n.length)}return null},remove:function(e){this.create(e,"",-1)}},eL={name:"cookie",lookup:function(e){var t;if(e.lookupCookie&&typeof document<"u"){var i=km.read(e.lookupCookie);i&&(t=i)}return t},cacheUserLanguage:function(e,t){t.lookupCookie&&typeof document<"u"&&km.create(t.lookupCookie,e,t.cookieMinutes,t.cookieDomain,t.cookieOptions)}},tL={name:"querystring",lookup:function(e){var t;if(typeof window<"u"){var i=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));for(var s=i.substring(1),n=s.split("&"),a=0;a<n.length;a++){var o=n[a].indexOf("=");if(o>0){var l=n[a].substring(0,o);l===e.lookupQuerystring&&(t=n[a].substring(o+1))}}}return t}},Bn=null,Dm=function(){if(Bn!==null)return Bn;try{Bn=window!=="undefined"&&window.localStorage!==null;var e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{Bn=!1}return Bn},iL={name:"localStorage",lookup:function(e){var t;if(e.lookupLocalStorage&&Dm()){var i=window.localStorage.getItem(e.lookupLocalStorage);i&&(t=i)}return t},cacheUserLanguage:function(e,t){t.lookupLocalStorage&&Dm()&&window.localStorage.setItem(t.lookupLocalStorage,e)}},$n=null,Om=function(){if($n!==null)return $n;try{$n=window!=="undefined"&&window.sessionStorage!==null;var e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{$n=!1}return $n},rL={name:"sessionStorage",lookup:function(e){var t;if(e.lookupSessionStorage&&Om()){var i=window.sessionStorage.getItem(e.lookupSessionStorage);i&&(t=i)}return t},cacheUserLanguage:function(e,t){t.lookupSessionStorage&&Om()&&window.sessionStorage.setItem(t.lookupSessionStorage,e)}},sL={name:"navigator",lookup:function(e){var t=[];if(typeof navigator<"u"){if(navigator.languages)for(var i=0;i<navigator.languages.length;i++)t.push(navigator.languages[i]);navigator.userLanguage&&t.push(navigator.userLanguage),navigator.language&&t.push(navigator.language)}return t.length>0?t:void 0}},nL={name:"htmlTag",lookup:function(e){var t,i=e.htmlTag||(typeof document<"u"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(t=i.getAttribute("lang")),t}},aL={name:"path",lookup:function(e){var t;if(typeof window<"u"){var i=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(i instanceof Array)if(typeof e.lookupFromPathIndex=="number"){if(typeof i[e.lookupFromPathIndex]!="string")return;t=i[e.lookupFromPathIndex].replace("/","")}else t=i[0].replace("/","")}return t}},oL={name:"subdomain",lookup:function(e){var t=typeof e.lookupFromSubdomainIndex=="number"?e.lookupFromSubdomainIndex+1:1,i=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(i)return i[t]}};function lL(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:function(e){return e}}}var Mm=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};KC(this,r),this.type="languageDetector",this.detectors={},this.init(e,t)}return YC(r,[{key:"init",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t||{languageUtils:{}},this.options=JC(i,this.options||{},lL()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=function(n){return n.replace("-","_")}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=s,this.addDetector(eL),this.addDetector(tL),this.addDetector(iL),this.addDetector(rL),this.addDetector(sL),this.addDetector(nL),this.addDetector(aL),this.addDetector(oL)}},{key:"addDetector",value:function(t){return this.detectors[t.name]=t,this}},{key:"detect",value:function(t){var i=this;t||(t=this.options.order);var s=[];return t.forEach(function(n){if(i.detectors[n]){var a=i.detectors[n].lookup(i.options);a&&typeof a=="string"&&(a=[a]),a&&(s=s.concat(a))}}),s=s.map(function(n){return i.options.convertDetectedLanguage(n)}),this.services.languageUtils.getBestMatchFromCodes?s:s.length>0?s[0]:null}},{key:"cacheUserLanguage",value:function(t,i){var s=this;i||(i=this.options.caches),i&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||i.forEach(function(n){s.detectors[n]&&s.detectors[n].cacheUserLanguage(t,s.options)}))}}]),r}();Mm.type="languageDetector";const cL={en:{translation:{chapter:"chapter",close:"close",soldout:"soldeout",currency:"USD",more:"more",entrace:"entrance",rehearsal:"rehearsal",live:"live",relive:"relive",converting:"converting",cancel:"cancel",ready:"ready",change_view_mode:"change view mode",enter_broadcast:"enter broadcast",sentence:{"Enter your four-digit entry code":"Enter your four-digit entry code","The entry code does not match":"The entry code does not match"}}},ko:{translation:{chapter:"챕터",close:"닫기",soldout:"품절",currency:"원",more:"더보기",entrace:"입장",rehearsal:"리허설",live:"live",relive:"relive",converting:"변환중",cancel:"방송취소",ready:"방송예정",change_view_mode:"시청모드 변경",enter_broadcast:"방송 입장",sentence:{"Enter your four-digit entry code":"입장코드 네 자리를 입력하세요.","The entry code does not match":"입장코드가 일치하지 않습니다."}}}};Vt.use(Mm).init({resources:cL,detection:{order:["navigator","localStorage"]},fallbackLng:"ko",debug:!1,interpolation:{escapeValue:!1}});function uL({currentTime:r=0,durationTime:e=0,className:t}){return We.jsxs("div",{className:`${xC.root} ${t||""}`,children:[We.jsx("div",{children:vm(r)}),We.jsx("div",{children:vm(e)})]})}const Fm={root:"_root_1iegb_2",pip:"_pip_1iegb_10",mute:"_mute_1iegb_16",unmute:"_unmute_1iegb_22",share:"_share_1iegb_28",setting:"_setting_1iegb_34",close:"_close_1iegb_40",coupon:"_coupon_1iegb_47",like:"_like_1iegb_53",notice:"_notice_1iegb_59",chat:"_chat_1iegb_65",comment:"_comment_1iegb_71",product:"_product_1iegb_77",event:"_event_1iegb_83",purchase:"_purchase_1iegb_90",close_pane:"_close_pane_1iegb_96",close_pane_B:"_close_pane_B_1iegb_102",back:"_back_1iegb_108",backward:"_backward_1iegb_115",pause:"_pause_1iegb_121",play:"_play_1iegb_127",forward:"_forward_1iegb_133",left:"_left_1iegb_140",right:"_right_1iegb_146",converting:"_converting_1iegb_153",cancel:"_cancel_1iegb_159",sm_view:"_sm_view_1iegb_166",sm_like:"_sm_like_1iegb_172",sm_countdown:"_sm_countdown_1iegb_178",sm_question:"_sm_question_1iegb_184",sm_comment:"_sm_comment_1iegb_190",sm_more:"_sm_more_1iegb_196",sm_fix:"_sm_fix_1iegb_202",chapter_shorts:"_chapter_shorts_1iegb_208",like_shorts:"_like_shorts_1iegb_214",comment_shorts:"_comment_shorts_1iegb_220",share_shorts:"_share_shorts_1iegb_226",more_product_shorts:"_more_product_shorts_1iegb_232",close_drawer_shorts:"_close_drawer_shorts_1iegb_238"};var Nm={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Bm=de.createContext&&de.createContext(Nm),hL=["attr","size","title"];function dL(r,e){if(r==null)return{};var t=fL(r,e),i,s;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);for(s=0;s<n.length;s++)i=n[s],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(r,i)&&(t[i]=r[i])}return t}function fL(r,e){if(r==null)return{};var t={};for(var i in r)if(Object.prototype.hasOwnProperty.call(r,i)){if(e.indexOf(i)>=0)continue;t[i]=r[i]}return t}function so(){return so=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},so.apply(this,arguments)}function $m(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),t.push.apply(t,i)}return t}function no(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$m(Object(t),!0).forEach(function(i){pL(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):$m(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function pL(r,e,t){return e=gL(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function gL(r){var e=mL(r,"string");return typeof e=="symbol"?e:e+""}function mL(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Um(r){return r&&r.map((e,t)=>de.createElement(e.tag,no({key:t},e.attr),Um(e.child)))}function du(r){return e=>de.createElement(vL,so({attr:no({},r.attr)},e),Um(r.child))}function vL(r){var e=t=>{var{attr:i,size:s,title:n}=r,a=dL(r,hL),o=s||t.size||"1em",l;return t.className&&(l=t.className),r.className&&(l=(l?l+" ":"")+r.className),de.createElement("svg",so({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,i,a,{className:l,style:no(no({color:r.color||t.color},t.style),r.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),n&&de.createElement("title",null,n),r.children)};return Bm!==void 0?de.createElement(Bm.Consumer,null,t=>e(t)):e(Nm)}function yL(r){return du({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M133 440a35.37 35.37 0 0 1-17.5-4.67c-12-6.8-19.46-20-19.46-34.33V111c0-14.37 7.46-27.53 19.46-34.33a35.13 35.13 0 0 1 35.77.45l247.85 148.36a36 36 0 0 1 0 61l-247.89 148.4A35.5 35.5 0 0 1 133 440z"},child:[]}]})(r)}function SL(r){return du({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M232 416a23.88 23.88 0 0 1-14.2-4.68 8.27 8.27 0 0 1-.66-.51L125.76 336H56a24 24 0 0 1-24-24V200a24 24 0 0 1 24-24h69.75l91.37-74.81a8.27 8.27 0 0 1 .66-.51A24 24 0 0 1 256 120v272a24 24 0 0 1-24 24zm-106.18-80zm-.27-159.86zM320 336a16 16 0 0 1-14.29-23.19c9.49-18.87 14.3-38 14.3-56.81 0-19.38-4.66-37.94-14.25-56.73a16 16 0 0 1 28.5-14.54C346.19 208.12 352 231.44 352 256c0 23.86-6 47.81-17.7 71.19A16 16 0 0 1 320 336z"},child:[]},{tag:"path",attr:{d:"M368 384a16 16 0 0 1-13.86-24C373.05 327.09 384 299.51 384 256c0-44.17-10.93-71.56-29.82-103.94a16 16 0 0 1 27.64-16.12C402.92 172.11 416 204.81 416 256c0 50.43-13.06 83.29-34.13 120a16 16 0 0 1-13.87 8z"},child:[]},{tag:"path",attr:{d:"M416 432a16 16 0 0 1-13.39-24.74C429.85 365.47 448 323.76 448 256c0-66.5-18.18-108.62-45.49-151.39a16 16 0 1 1 27-17.22C459.81 134.89 480 181.74 480 256c0 64.75-14.66 113.63-50.6 168.74A16 16 0 0 1 416 432z"},child:[]}]})(r)}function xL(r){return du({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"32",d:"M416 432 64 80"},child:[]},{tag:"path",attr:{d:"M243.33 98.86a23.89 23.89 0 0 0-25.55 1.82l-.66.51-28.52 23.35a8 8 0 0 0-.59 11.85l54.33 54.33a8 8 0 0 0 13.66-5.66v-64.49a24.51 24.51 0 0 0-12.67-21.71zm8 236.43L96.69 180.69A16 16 0 0 0 85.38 176H56a24 24 0 0 0-24 24v112a24 24 0 0 0 24 24h69.76l92 75.31a23.9 23.9 0 0 0 25.87 1.69A24.51 24.51 0 0 0 256 391.45v-44.86a16 16 0 0 0-4.67-11.3zM352 256c0-24.56-5.81-47.87-17.75-71.27a16 16 0 1 0-28.5 14.55C315.34 218.06 320 236.62 320 256q0 4-.31 8.13a8 8 0 0 0 2.32 6.25l14.36 14.36a8 8 0 0 0 13.55-4.31A146 146 0 0 0 352 256zm64 0c0-51.18-13.08-83.89-34.18-120.06a16 16 0 0 0-27.64 16.12C373.07 184.44 384 211.83 384 256c0 23.83-3.29 42.88-9.37 60.65a8 8 0 0 0 1.9 8.26L389 337.4a8 8 0 0 0 13.13-2.79C411 311.76 416 287.26 416 256z"},child:[]},{tag:"path",attr:{d:"M480 256c0-74.25-20.19-121.11-50.51-168.61a16 16 0 1 0-27 17.22C429.82 147.38 448 189.5 448 256c0 46.19-8.43 80.27-22.43 110.53a8 8 0 0 0 1.59 9l11.92 11.92a8 8 0 0 0 12.92-2.16C471.6 344.9 480 305 480 256z"},child:[]}]})(r)}const Gm={IoVolumeHigh:SL,IoVolumeMute:xL,IoPlay:yL};function Un({className:r,name:e,...t}){if(e in Gm){const i=Gm[e];return We.jsx(i,{className:r})}else return We.jsx("i",{className:[Fm.root,Fm[e],r].join(" "),...t})}var fu={exports:{}};(function(r,e){typeof navigator<"u"&&function(t,i){r.exports=i()}(Vr,function(){var t="http://www.w3.org/2000/svg",i="",s=!1,n=-999999,a=function(d){s=!!d},o=function(){return s},l=function(d){i=d},u=function(){return i};function h(c){return document.createElement(c)}function f(c,d){var p,m=c.length,x;for(p=0;p<m;p+=1){x=c[p].prototype;for(var S in x)Object.prototype.hasOwnProperty.call(x,S)&&(d.prototype[S]=x[S])}}function g(c){function d(){}return d.prototype=c,d}var v=function(){function c(d){this.audios=[],this.audioFactory=d,this._volume=1,this._isMuted=!1}return c.prototype={addAudio:function(p){this.audios.push(p)},pause:function(){var p,m=this.audios.length;for(p=0;p<m;p+=1)this.audios[p].pause()},resume:function(){var p,m=this.audios.length;for(p=0;p<m;p+=1)this.audios[p].resume()},setRate:function(p){var m,x=this.audios.length;for(m=0;m<x;m+=1)this.audios[m].setRate(p)},createAudio:function(p){return this.audioFactory?this.audioFactory(p):window.Howl?new window.Howl({src:[p]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(p){this.audioFactory=p},setVolume:function(p){this._volume=p,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var p,m=this.audios.length;for(p=0;p<m;p+=1)this.audios[p].volume(this._volume*(this._isMuted?0:1))}},function(){return new c}}(),y=function(){function c(p,m){var x=0,S=[],T;switch(p){case"int16":case"uint8c":T=1;break;default:T=1.1;break}for(x=0;x<m;x+=1)S.push(T);return S}function d(p,m){return p==="float32"?new Float32Array(m):p==="int16"?new Int16Array(m):p==="uint8c"?new Uint8ClampedArray(m):c(p,m)}return typeof Uint8ClampedArray=="function"&&typeof Float32Array=="function"?d:c}();function b(c){return Array.apply(null,{length:c})}var E=!0,A=null,M="",D=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),B=Math.pow,N=Math.sqrt,J=Math.floor,Z=Math.min,se=150,Q=Math.PI/180,q=.5519;function oe(c,d,p,m){this.type=c,this.currentTime=d,this.totalTime=p,this.direction=m<0?-1:1}function me(c,d){this.type=c,this.direction=d<0?-1:1}function he(c,d,p,m){this.type=c,this.currentLoop=p,this.totalLoops=d,this.direction=m<0?-1:1}function Ee(c,d,p){this.type=c,this.firstFrame=d,this.totalFrames=p}function we(c,d){this.type=c,this.target=d}function ue(c,d){this.type="renderFrameError",this.nativeError=c,this.currentTime=d}function ge(c){this.type="configError",this.nativeError=c}var Ce=function(){var c=0;return function(){return c+=1,M+"__lottie_element_"+c}}();function ve(c,d,p){var m,x,S,T,k,_,$,V;switch(T=Math.floor(c*6),k=c*6-T,_=p*(1-d),$=p*(1-k*d),V=p*(1-(1-k)*d),T%6){case 0:m=p,x=V,S=_;break;case 1:m=$,x=p,S=_;break;case 2:m=_,x=p,S=V;break;case 3:m=_,x=$,S=p;break;case 4:m=V,x=_,S=p;break;case 5:m=p,x=_,S=$;break}return[m,x,S]}function Se(c,d,p){var m=Math.max(c,d,p),x=Math.min(c,d,p),S=m-x,T,k=m===0?0:S/m,_=m/255;switch(m){case x:T=0;break;case c:T=d-p+S*(d<p?6:0),T/=6*S;break;case d:T=p-c+S*2,T/=6*S;break;case p:T=c-d+S*4,T/=6*S;break}return[T,k,_]}function qe(c,d){var p=Se(c[0]*255,c[1]*255,c[2]*255);return p[1]+=d,p[1]>1?p[1]=1:p[1]<=0&&(p[1]=0),ve(p[0],p[1],p[2])}function Ue(c,d){var p=Se(c[0]*255,c[1]*255,c[2]*255);return p[2]+=d,p[2]>1?p[2]=1:p[2]<0&&(p[2]=0),ve(p[0],p[1],p[2])}function Xe(c,d){var p=Se(c[0]*255,c[1]*255,c[2]*255);return p[0]+=d/360,p[0]>1?p[0]-=1:p[0]<0&&(p[0]+=1),ve(p[0],p[1],p[2])}(function(){var c=[],d,p;for(d=0;d<256;d+=1)p=d.toString(16),c[d]=p.length===1?"0"+p:p;return function(m,x,S){return m<0&&(m=0),x<0&&(x=0),S<0&&(S=0),"#"+c[m]+c[x]+c[S]}})();var it=function(d){E=!!d},et=function(){return E},lt=function(d){A=d},Je=function(){return A},xt=function(d){se=d},kt=function(){return se},Ci=function(d){M=d};function ke(c){return document.createElementNS(t,c)}function yi(c){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?yi=function(p){return typeof p}:yi=function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},yi(c)}var di=function(){var c=1,d=[],p,m,x={onmessage:function(){},postMessage:function(j){p({data:j})}},S={postMessage:function(j){x.onmessage({data:j})}};function T(R){if(window.Worker&&window.Blob&&o()){var j=new Blob(["var _workerSelf = self; self.onmessage = ",R.toString()],{type:"text/javascript"}),W=URL.createObjectURL(j);return new Worker(W)}return p=R,x}function k(){m||(m=T(function(j){function W(){function ee(ye,O){var K,w,L=ye.length,ne,X,Le,Be;for(w=0;w<L;w+=1)if(K=ye[w],"ks"in K&&!K.completed){if(K.completed=!0,K.hasMask){var ze=K.masksProperties;for(X=ze.length,ne=0;ne<X;ne+=1)if(ze[ne].pt.k.i)U(ze[ne].pt.k);else for(Be=ze[ne].pt.k.length,Le=0;Le<Be;Le+=1)ze[ne].pt.k[Le].s&&U(ze[ne].pt.k[Le].s[0]),ze[ne].pt.k[Le].e&&U(ze[ne].pt.k[Le].e[0])}K.ty===0?(K.layers=I(K.refId,O),ee(K.layers,O)):K.ty===4?P(K.shapes):K.ty===5&&Ye(K)}}function G(ye,O){if(ye){var K=0,w=ye.length;for(K=0;K<w;K+=1)ye[K].t===1&&(ye[K].data.layers=I(ye[K].data.refId,O),ee(ye[K].data.layers,O))}}function F(ye,O){for(var K=0,w=O.length;K<w;){if(O[K].id===ye)return O[K];K+=1}return null}function I(ye,O){var K=F(ye,O);return K?K.layers.__used?JSON.parse(JSON.stringify(K.layers)):(K.layers.__used=!0,K.layers):null}function P(ye){var O,K=ye.length,w,L;for(O=K-1;O>=0;O-=1)if(ye[O].ty==="sh")if(ye[O].ks.k.i)U(ye[O].ks.k);else for(L=ye[O].ks.k.length,w=0;w<L;w+=1)ye[O].ks.k[w].s&&U(ye[O].ks.k[w].s[0]),ye[O].ks.k[w].e&&U(ye[O].ks.k[w].e[0]);else ye[O].ty==="gr"&&P(ye[O].it)}function U(ye){var O,K=ye.i.length;for(O=0;O<K;O+=1)ye.i[O][0]+=ye.v[O][0],ye.i[O][1]+=ye.v[O][1],ye.o[O][0]+=ye.v[O][0],ye.o[O][1]+=ye.v[O][1]}function Y(ye,O){var K=O?O.split("."):[100,100,100];return ye[0]>K[0]?!0:K[0]>ye[0]?!1:ye[1]>K[1]?!0:K[1]>ye[1]?!1:ye[2]>K[2]?!0:K[2]>ye[2]?!1:null}var te=function(){var ye=[4,4,14];function O(w){var L=w.t.d;w.t.d={k:[{s:L,t:0}]}}function K(w){var L,ne=w.length;for(L=0;L<ne;L+=1)w[L].ty===5&&O(w[L])}return function(w){if(Y(ye,w.v)&&(K(w.layers),w.assets)){var L,ne=w.assets.length;for(L=0;L<ne;L+=1)w.assets[L].layers&&K(w.assets[L].layers)}}}(),ae=function(){var ye=[4,7,99];return function(O){if(O.chars&&!Y(ye,O.v)){var K,w=O.chars.length;for(K=0;K<w;K+=1){var L=O.chars[K];L.data&&L.data.shapes&&(P(L.data.shapes),L.data.ip=0,L.data.op=99999,L.data.st=0,L.data.sr=1,L.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},O.chars[K].t||(L.data.shapes.push({ty:"no"}),L.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}}(),xe=function(){var ye=[5,7,15];function O(w){var L=w.t.p;typeof L.a=="number"&&(L.a={a:0,k:L.a}),typeof L.p=="number"&&(L.p={a:0,k:L.p}),typeof L.r=="number"&&(L.r={a:0,k:L.r})}function K(w){var L,ne=w.length;for(L=0;L<ne;L+=1)w[L].ty===5&&O(w[L])}return function(w){if(Y(ye,w.v)&&(K(w.layers),w.assets)){var L,ne=w.assets.length;for(L=0;L<ne;L+=1)w.assets[L].layers&&K(w.assets[L].layers)}}}(),Ke=function(){var ye=[4,1,9];function O(w){var L,ne=w.length,X,Le;for(L=0;L<ne;L+=1)if(w[L].ty==="gr")O(w[L].it);else if(w[L].ty==="fl"||w[L].ty==="st")if(w[L].c.k&&w[L].c.k[0].i)for(Le=w[L].c.k.length,X=0;X<Le;X+=1)w[L].c.k[X].s&&(w[L].c.k[X].s[0]/=255,w[L].c.k[X].s[1]/=255,w[L].c.k[X].s[2]/=255,w[L].c.k[X].s[3]/=255),w[L].c.k[X].e&&(w[L].c.k[X].e[0]/=255,w[L].c.k[X].e[1]/=255,w[L].c.k[X].e[2]/=255,w[L].c.k[X].e[3]/=255);else w[L].c.k[0]/=255,w[L].c.k[1]/=255,w[L].c.k[2]/=255,w[L].c.k[3]/=255}function K(w){var L,ne=w.length;for(L=0;L<ne;L+=1)w[L].ty===4&&O(w[L].shapes)}return function(w){if(Y(ye,w.v)&&(K(w.layers),w.assets)){var L,ne=w.assets.length;for(L=0;L<ne;L+=1)w.assets[L].layers&&K(w.assets[L].layers)}}}(),De=function(){var ye=[4,4,18];function O(w){var L,ne=w.length,X,Le;for(L=ne-1;L>=0;L-=1)if(w[L].ty==="sh")if(w[L].ks.k.i)w[L].ks.k.c=w[L].closed;else for(Le=w[L].ks.k.length,X=0;X<Le;X+=1)w[L].ks.k[X].s&&(w[L].ks.k[X].s[0].c=w[L].closed),w[L].ks.k[X].e&&(w[L].ks.k[X].e[0].c=w[L].closed);else w[L].ty==="gr"&&O(w[L].it)}function K(w){var L,ne,X=w.length,Le,Be,ze,at;for(ne=0;ne<X;ne+=1){if(L=w[ne],L.hasMask){var ot=L.masksProperties;for(Be=ot.length,Le=0;Le<Be;Le+=1)if(ot[Le].pt.k.i)ot[Le].pt.k.c=ot[Le].cl;else for(at=ot[Le].pt.k.length,ze=0;ze<at;ze+=1)ot[Le].pt.k[ze].s&&(ot[Le].pt.k[ze].s[0].c=ot[Le].cl),ot[Le].pt.k[ze].e&&(ot[Le].pt.k[ze].e[0].c=ot[Le].cl)}L.ty===4&&O(L.shapes)}}return function(w){if(Y(ye,w.v)&&(K(w.layers),w.assets)){var L,ne=w.assets.length;for(L=0;L<ne;L+=1)w.assets[L].layers&&K(w.assets[L].layers)}}}();function Ae(ye){ye.__complete||(Ke(ye),te(ye),ae(ye),xe(ye),De(ye),ee(ye.layers,ye.assets),G(ye.chars,ye.assets),ye.__complete=!0)}function Ye(ye){ye.t.a.length===0&&"m"in ye.t.p}var Re={};return Re.completeData=Ae,Re.checkColors=Ke,Re.checkChars=ae,Re.checkPathProperties=xe,Re.checkShapes=De,Re.completeLayers=ee,Re}if(S.dataManager||(S.dataManager=W()),S.assetLoader||(S.assetLoader=function(){function ee(F){var I=F.getResponseHeader("content-type");return I&&F.responseType==="json"&&I.indexOf("json")!==-1||F.response&&yi(F.response)==="object"?F.response:F.response&&typeof F.response=="string"?JSON.parse(F.response):F.responseText?JSON.parse(F.responseText):null}function G(F,I,P,U){var Y,te=new XMLHttpRequest;try{te.responseType="json"}catch{}te.onreadystatechange=function(){if(te.readyState===4)if(te.status===200)Y=ee(te),P(Y);else try{Y=ee(te),P(Y)}catch(ae){U&&U(ae)}};try{te.open(["G","E","T"].join(""),F,!0)}catch{te.open(["G","E","T"].join(""),I+"/"+F,!0)}te.send()}return{load:G}}()),j.data.type==="loadAnimation")S.assetLoader.load(j.data.path,j.data.fullPath,function(ee){S.dataManager.completeData(ee),S.postMessage({id:j.data.id,payload:ee,status:"success"})},function(){S.postMessage({id:j.data.id,status:"error"})});else if(j.data.type==="complete"){var H=j.data.animation;S.dataManager.completeData(H),S.postMessage({id:j.data.id,payload:H,status:"success"})}else j.data.type==="loadData"&&S.assetLoader.load(j.data.path,j.data.fullPath,function(ee){S.postMessage({id:j.data.id,payload:ee,status:"success"})},function(){S.postMessage({id:j.data.id,status:"error"})})}),m.onmessage=function(R){var j=R.data,W=j.id,H=d[W];d[W]=null,j.status==="success"?H.onComplete(j.payload):H.onError&&H.onError()})}function _(R,j){c+=1;var W="processId_"+c;return d[W]={onComplete:R,onError:j},W}function $(R,j,W){k();var H=_(j,W);m.postMessage({type:"loadAnimation",path:R,fullPath:window.location.origin+window.location.pathname,id:H})}function V(R,j,W){k();var H=_(j,W);m.postMessage({type:"loadData",path:R,fullPath:window.location.origin+window.location.pathname,id:H})}function ie(R,j,W){k();var H=_(j,W);m.postMessage({type:"complete",animation:R,id:H})}return{loadAnimation:$,loadData:V,completeAnimation:ie}}(),ss=function(){var c=function(){var G=h("canvas");G.width=1,G.height=1;var F=G.getContext("2d");return F.fillStyle="rgba(0,0,0,0)",F.fillRect(0,0,1,1),G}();function d(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function p(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function m(G,F,I){var P="";if(G.e)P=G.p;else if(F){var U=G.p;U.indexOf("images/")!==-1&&(U=U.split("/")[1]),P=F+U}else P=I,P+=G.u?G.u:"",P+=G.p;return P}function x(G){var F=0,I=setInterval((function(){var P=G.getBBox();(P.width||F>500)&&(this._imageLoaded(),clearInterval(I)),F+=1}).bind(this),50)}function S(G){var F=m(G,this.assetsPath,this.path),I=ke("image");D?this.testImageLoaded(I):I.addEventListener("load",this._imageLoaded,!1),I.addEventListener("error",(function(){P.img=c,this._imageLoaded()}).bind(this),!1),I.setAttributeNS("http://www.w3.org/1999/xlink","href",F),this._elementHelper.append?this._elementHelper.append(I):this._elementHelper.appendChild(I);var P={img:I,assetData:G};return P}function T(G){var F=m(G,this.assetsPath,this.path),I=h("img");I.crossOrigin="anonymous",I.addEventListener("load",this._imageLoaded,!1),I.addEventListener("error",(function(){P.img=c,this._imageLoaded()}).bind(this),!1),I.src=F;var P={img:I,assetData:G};return P}function k(G){var F={assetData:G},I=m(G,this.assetsPath,this.path);return di.loadData(I,(function(P){F.img=P,this._footageLoaded()}).bind(this),(function(){F.img={},this._footageLoaded()}).bind(this)),F}function _(G,F){this.imagesLoadedCb=F;var I,P=G.length;for(I=0;I<P;I+=1)G[I].layers||(!G[I].t||G[I].t==="seq"?(this.totalImages+=1,this.images.push(this._createImageData(G[I]))):G[I].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(G[I]))))}function $(G){this.path=G||""}function V(G){this.assetsPath=G||""}function ie(G){for(var F=0,I=this.images.length;F<I;){if(this.images[F].assetData===G)return this.images[F].img;F+=1}return null}function R(){this.imagesLoadedCb=null,this.images.length=0}function j(){return this.totalImages===this.loadedAssets}function W(){return this.totalFootages===this.loadedFootagesCount}function H(G,F){G==="svg"?(this._elementHelper=F,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}function ee(){this._imageLoaded=d.bind(this),this._footageLoaded=p.bind(this),this.testImageLoaded=x.bind(this),this.createFootageData=k.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return ee.prototype={loadAssets:_,setAssetsPath:V,setPath:$,loadedImages:j,loadedFootages:W,destroy:R,getAsset:ie,createImgData:T,createImageData:S,imageLoaded:d,footageLoaded:p,setCacheType:H},ee}();function ns(){}ns.prototype={triggerEvent:function(d,p){if(this._cbs[d])for(var m=this._cbs[d],x=0;x<m.length;x+=1)m[x](p)},addEventListener:function(d,p){return this._cbs[d]||(this._cbs[d]=[]),this._cbs[d].push(p),(function(){this.removeEventListener(d,p)}).bind(this)},removeEventListener:function(d,p){if(!p)this._cbs[d]=null;else if(this._cbs[d]){for(var m=0,x=this._cbs[d].length;m<x;)this._cbs[d][m]===p&&(this._cbs[d].splice(m,1),m-=1,x-=1),m+=1;this._cbs[d].length||(this._cbs[d]=null)}}};var cr=function(){function c(d){for(var p=d.split(`\r
|
|
140
|
-
`),m={},x,S=0,T=0;T<p.length;T+=1)x=p[T].split(":"),x.length===2&&(m[x[0]]=x[1].trim(),S+=1);if(S===0)throw new Error;return m}return function(d){for(var p=[],m=0;m<d.length;m+=1){var x=d[m],S={time:x.tm,duration:x.dr};try{S.payload=JSON.parse(d[m].cm)}catch{try{S.payload=c(d[m].cm)}catch{S.payload={name:d[m].cm}}}p.push(S)}return p}}(),as=function(){function c(d){this.compositions.push(d)}return function(){function d(p){for(var m=0,x=this.compositions.length;m<x;){if(this.compositions[m].data&&this.compositions[m].data.nm===p)return this.compositions[m].prepareFrame&&this.compositions[m].data.xt&&this.compositions[m].prepareFrame(this.currentFrame),this.compositions[m].compInterface;m+=1}return null}return d.compositions=[],d.currentFrame=0,d.registerComposition=c,d}}(),Li={},ur=function(d,p){Li[d]=p};function Ir(c){return Li[c]}function Qi(){if(Li.canvas)return"canvas";for(var c in Li)if(Li[c])return c;return""}function Ii(c){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ii=function(p){return typeof p}:Ii=function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},Ii(c)}var Me=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=Ce(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=et(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=as(),this.imagePreloader=new ss,this.audioController=v(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new oe("drawnFrame",0,0,0),this.expressionsPlugin=Je()};f([ns],Me),Me.prototype.setParams=function(c){(c.wrapper||c.container)&&(this.wrapper=c.wrapper||c.container);var d="svg";c.animType?d=c.animType:c.renderer&&(d=c.renderer);var p=Ir(d);this.renderer=new p(this,c.rendererSettings),this.imagePreloader.setCacheType(d,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=d,c.loop===""||c.loop===null||c.loop===void 0||c.loop===!0?this.loop=!0:c.loop===!1?this.loop=!1:this.loop=parseInt(c.loop,10),this.autoplay="autoplay"in c?c.autoplay:!0,this.name=c.name?c.name:"",this.autoloadSegments=Object.prototype.hasOwnProperty.call(c,"autoloadSegments")?c.autoloadSegments:!0,this.assetsPath=c.assetsPath,this.initialSegment=c.initialSegment,c.audioFactory&&this.audioController.setAudioFactory(c.audioFactory),c.animationData?this.setupAnimation(c.animationData):c.path&&(c.path.lastIndexOf("\\")!==-1?this.path=c.path.substr(0,c.path.lastIndexOf("\\")+1):this.path=c.path.substr(0,c.path.lastIndexOf("/")+1),this.fileName=c.path.substr(c.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),di.loadAnimation(c.path,this.configAnimation,this.onSetupError))},Me.prototype.onSetupError=function(){this.trigger("data_failed")},Me.prototype.setupAnimation=function(c){di.completeAnimation(c,this.configAnimation)},Me.prototype.setData=function(c,d){d&&Ii(d)!=="object"&&(d=JSON.parse(d));var p={wrapper:c,animationData:d},m=c.attributes;p.path=m.getNamedItem("data-animation-path")?m.getNamedItem("data-animation-path").value:m.getNamedItem("data-bm-path")?m.getNamedItem("data-bm-path").value:m.getNamedItem("bm-path")?m.getNamedItem("bm-path").value:"",p.animType=m.getNamedItem("data-anim-type")?m.getNamedItem("data-anim-type").value:m.getNamedItem("data-bm-type")?m.getNamedItem("data-bm-type").value:m.getNamedItem("bm-type")?m.getNamedItem("bm-type").value:m.getNamedItem("data-bm-renderer")?m.getNamedItem("data-bm-renderer").value:m.getNamedItem("bm-renderer")?m.getNamedItem("bm-renderer").value:Qi()||"canvas";var x=m.getNamedItem("data-anim-loop")?m.getNamedItem("data-anim-loop").value:m.getNamedItem("data-bm-loop")?m.getNamedItem("data-bm-loop").value:m.getNamedItem("bm-loop")?m.getNamedItem("bm-loop").value:"";x==="false"?p.loop=!1:x==="true"?p.loop=!0:x!==""&&(p.loop=parseInt(x,10));var S=m.getNamedItem("data-anim-autoplay")?m.getNamedItem("data-anim-autoplay").value:m.getNamedItem("data-bm-autoplay")?m.getNamedItem("data-bm-autoplay").value:m.getNamedItem("bm-autoplay")?m.getNamedItem("bm-autoplay").value:!0;p.autoplay=S!=="false",p.name=m.getNamedItem("data-name")?m.getNamedItem("data-name").value:m.getNamedItem("data-bm-name")?m.getNamedItem("data-bm-name").value:m.getNamedItem("bm-name")?m.getNamedItem("bm-name").value:"";var T=m.getNamedItem("data-anim-prerender")?m.getNamedItem("data-anim-prerender").value:m.getNamedItem("data-bm-prerender")?m.getNamedItem("data-bm-prerender").value:m.getNamedItem("bm-prerender")?m.getNamedItem("bm-prerender").value:"";T==="false"&&(p.prerender=!1),p.path?this.setParams(p):this.trigger("destroy")},Me.prototype.includeLayers=function(c){c.op>this.animationData.op&&(this.animationData.op=c.op,this.totalFrames=Math.floor(c.op-this.animationData.ip));var d=this.animationData.layers,p,m=d.length,x=c.layers,S,T=x.length;for(S=0;S<T;S+=1)for(p=0;p<m;){if(d[p].id===x[S].id){d[p]=x[S];break}p+=1}if((c.chars||c.fonts)&&(this.renderer.globalData.fontManager.addChars(c.chars),this.renderer.globalData.fontManager.addFonts(c.fonts,this.renderer.globalData.defs)),c.assets)for(m=c.assets.length,p=0;p<m;p+=1)this.animationData.assets.push(c.assets[p]);this.animationData.__complete=!1,di.completeAnimation(this.animationData,this.onSegmentComplete)},Me.prototype.onSegmentComplete=function(c){this.animationData=c;var d=Je();d&&d.initExpressions(this),this.loadNextSegment()},Me.prototype.loadNextSegment=function(){var c=this.animationData.segments;if(!c||c.length===0||!this.autoloadSegments){this.trigger("data_ready"),this.timeCompleted=this.totalFrames;return}var d=c.shift();this.timeCompleted=d.time*this.frameRate;var p=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,di.loadData(p,this.includeLayers.bind(this),(function(){this.trigger("data_failed")}).bind(this))},Me.prototype.loadSegments=function(){var c=this.animationData.segments;c||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},Me.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},Me.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},Me.prototype.configAnimation=function(c){if(this.renderer)try{this.animationData=c,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(c),c.assets||(c.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(c.assets),this.markers=cr(c.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(d){this.triggerConfigError(d)}},Me.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},Me.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||this.renderer.rendererType!=="canvas")&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var c=Je();c&&c.initExpressions(this),this.renderer.initItems(),setTimeout((function(){this.trigger("DOMLoaded")}).bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},Me.prototype.resize=function(c,d){var p=typeof c=="number"?c:void 0,m=typeof d=="number"?d:void 0;this.renderer.updateContainerSize(p,m)},Me.prototype.setSubframe=function(c){this.isSubframeEnabled=!!c},Me.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},Me.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(c){this.triggerRenderFrameError(c)}},Me.prototype.play=function(c){c&&this.name!==c||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},Me.prototype.pause=function(c){c&&this.name!==c||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},Me.prototype.togglePause=function(c){c&&this.name!==c||(this.isPaused===!0?this.play():this.pause())},Me.prototype.stop=function(c){c&&this.name!==c||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},Me.prototype.getMarkerData=function(c){for(var d,p=0;p<this.markers.length;p+=1)if(d=this.markers[p],d.payload&&d.payload.name===c)return d;return null},Me.prototype.goToAndStop=function(c,d,p){if(!(p&&this.name!==p)){var m=Number(c);if(isNaN(m)){var x=this.getMarkerData(c);x&&this.goToAndStop(x.time,!0)}else d?this.setCurrentRawFrameValue(c):this.setCurrentRawFrameValue(c*this.frameModifier);this.pause()}},Me.prototype.goToAndPlay=function(c,d,p){if(!(p&&this.name!==p)){var m=Number(c);if(isNaN(m)){var x=this.getMarkerData(c);x&&(x.duration?this.playSegments([x.time,x.time+x.duration],!0):this.goToAndStop(x.time,!0))}else this.goToAndStop(m,d,p);this.play()}},Me.prototype.advanceTime=function(c){if(!(this.isPaused===!0||this.isLoaded===!1)){var d=this.currentRawFrame+c*this.frameModifier,p=!1;d>=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(d>this.totalFrames?d%this.totalFrames:0)||(p=!0,d=this.totalFrames-1):d>=this.totalFrames?(this.playCount+=1,this.checkSegments(d%this.totalFrames)||(this.setCurrentRawFrameValue(d%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(d):d<0?this.checkSegments(d%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+d%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(p=!0,d=0)):this.setCurrentRawFrameValue(d),p&&(this.setCurrentRawFrameValue(d),this.pause(),this.trigger("complete"))}},Me.prototype.adjustSegment=function(c,d){this.playCount=0,c[1]<c[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=c[0]-c[1],this.timeCompleted=this.totalFrames,this.firstFrame=c[1],this.setCurrentRawFrameValue(this.totalFrames-.001-d)):c[1]>c[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=c[1]-c[0],this.timeCompleted=this.totalFrames,this.firstFrame=c[0],this.setCurrentRawFrameValue(.001+d)),this.trigger("segmentStart")},Me.prototype.setSegment=function(c,d){var p=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<c?p=c:this.currentRawFrame+this.firstFrame>d&&(p=d-c)),this.firstFrame=c,this.totalFrames=d-c,this.timeCompleted=this.totalFrames,p!==-1&&this.goToAndStop(p,!0)},Me.prototype.playSegments=function(c,d){if(d&&(this.segments.length=0),Ii(c[0])==="object"){var p,m=c.length;for(p=0;p<m;p+=1)this.segments.push(c[p])}else this.segments.push(c);this.segments.length&&d&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},Me.prototype.resetSegments=function(c){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),c&&this.checkSegments(0)},Me.prototype.checkSegments=function(c){return this.segments.length?(this.adjustSegment(this.segments.shift(),c),!0):!1},Me.prototype.destroy=function(c){c&&this.name!==c||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.expressionsPlugin=null,this.imagePreloader=null,this.projectInterface=null)},Me.prototype.setCurrentRawFrameValue=function(c){this.currentRawFrame=c,this.gotoFrame()},Me.prototype.setSpeed=function(c){this.playSpeed=c,this.updaFrameModifier()},Me.prototype.setDirection=function(c){this.playDirection=c<0?-1:1,this.updaFrameModifier()},Me.prototype.setLoop=function(c){this.loop=c},Me.prototype.setVolume=function(c,d){d&&this.name!==d||this.audioController.setVolume(c)},Me.prototype.getVolume=function(){return this.audioController.getVolume()},Me.prototype.mute=function(c){c&&this.name!==c||this.audioController.mute()},Me.prototype.unmute=function(c){c&&this.name!==c||this.audioController.unmute()},Me.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},Me.prototype.getPath=function(){return this.path},Me.prototype.getAssetsPath=function(c){var d="";if(c.e)d=c.p;else if(this.assetsPath){var p=c.p;p.indexOf("images/")!==-1&&(p=p.split("/")[1]),d=this.assetsPath+p}else d=this.path,d+=c.u?c.u:"",d+=c.p;return d},Me.prototype.getAssetData=function(c){for(var d=0,p=this.assets.length;d<p;){if(c===this.assets[d].id)return this.assets[d];d+=1}return null},Me.prototype.hide=function(){this.renderer.hide()},Me.prototype.show=function(){this.renderer.show()},Me.prototype.getDuration=function(c){return c?this.totalFrames:this.totalFrames/this.frameRate},Me.prototype.updateDocumentData=function(c,d,p){try{var m=this.renderer.getElementByPath(c);m.updateDocumentData(d,p)}catch{}},Me.prototype.trigger=function(c){if(this._cbs&&this._cbs[c])switch(c){case"enterFrame":this.triggerEvent(c,new oe(c,this.currentFrame,this.totalFrames,this.frameModifier));break;case"drawnFrame":this.drawnFrameEvent.currentTime=this.currentFrame,this.drawnFrameEvent.totalTime=this.totalFrames,this.drawnFrameEvent.direction=this.frameModifier,this.triggerEvent(c,this.drawnFrameEvent);break;case"loopComplete":this.triggerEvent(c,new he(c,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(c,new me(c,this.frameMult));break;case"segmentStart":this.triggerEvent(c,new Ee(c,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(c,new we(c,this));break;default:this.triggerEvent(c)}c==="enterFrame"&&this.onEnterFrame&&this.onEnterFrame.call(this,new oe(c,this.currentFrame,this.totalFrames,this.frameMult)),c==="loopComplete"&&this.onLoopComplete&&this.onLoopComplete.call(this,new he(c,this.loop,this.playCount,this.frameMult)),c==="complete"&&this.onComplete&&this.onComplete.call(this,new me(c,this.frameMult)),c==="segmentStart"&&this.onSegmentStart&&this.onSegmentStart.call(this,new Ee(c,this.firstFrame,this.totalFrames)),c==="destroy"&&this.onDestroy&&this.onDestroy.call(this,new we(c,this))},Me.prototype.triggerRenderFrameError=function(c){var d=new ue(c,this.currentFrame);this.triggerEvent("error",d),this.onError&&this.onError.call(this,d)},Me.prototype.triggerConfigError=function(c){var d=new ge(c,this.currentFrame);this.triggerEvent("error",d),this.onError&&this.onError.call(this,d)};var Et=function(){var c={},d=[],p=0,m=0,x=0,S=!0,T=!1;function k(O){for(var K=0,w=O.target;K<m;)d[K].animation===w&&(d.splice(K,1),K-=1,m-=1,w.isPaused||ie()),K+=1}function _(O,K){if(!O)return null;for(var w=0;w<m;){if(d[w].elem===O&&d[w].elem!==null)return d[w].animation;w+=1}var L=new Me;return R(L,O),L.setData(O,K),L}function $(){var O,K=d.length,w=[];for(O=0;O<K;O+=1)w.push(d[O].animation);return w}function V(){x+=1,Ke()}function ie(){x-=1}function R(O,K){O.addEventListener("destroy",k),O.addEventListener("_active",V),O.addEventListener("_idle",ie),d.push({elem:K,animation:O}),m+=1}function j(O){var K=new Me;return R(K,null),K.setParams(O),K}function W(O,K){var w;for(w=0;w<m;w+=1)d[w].animation.setSpeed(O,K)}function H(O,K){var w;for(w=0;w<m;w+=1)d[w].animation.setDirection(O,K)}function ee(O){var K;for(K=0;K<m;K+=1)d[K].animation.play(O)}function G(O){var K=O-p,w;for(w=0;w<m;w+=1)d[w].animation.advanceTime(K);p=O,x&&!T?window.requestAnimationFrame(G):S=!0}function F(O){p=O,window.requestAnimationFrame(G)}function I(O){var K;for(K=0;K<m;K+=1)d[K].animation.pause(O)}function P(O,K,w){var L;for(L=0;L<m;L+=1)d[L].animation.goToAndStop(O,K,w)}function U(O){var K;for(K=0;K<m;K+=1)d[K].animation.stop(O)}function Y(O){var K;for(K=0;K<m;K+=1)d[K].animation.togglePause(O)}function te(O){var K;for(K=m-1;K>=0;K-=1)d[K].animation.destroy(O)}function ae(O,K,w){var L=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),ne,X=L.length;for(ne=0;ne<X;ne+=1)w&&L[ne].setAttribute("data-bm-type",w),_(L[ne],O);if(K&&X===0){w||(w="svg");var Le=document.getElementsByTagName("body")[0];Le.innerText="";var Be=h("div");Be.style.width="100%",Be.style.height="100%",Be.setAttribute("data-bm-type",w),Le.appendChild(Be),_(Be,O)}}function xe(){var O;for(O=0;O<m;O+=1)d[O].animation.resize()}function Ke(){!T&&x&&S&&(window.requestAnimationFrame(F),S=!1)}function De(){T=!0}function Ae(){T=!1,Ke()}function Ye(O,K){var w;for(w=0;w<m;w+=1)d[w].animation.setVolume(O,K)}function Re(O){var K;for(K=0;K<m;K+=1)d[K].animation.mute(O)}function ye(O){var K;for(K=0;K<m;K+=1)d[K].animation.unmute(O)}return c.registerAnimation=_,c.loadAnimation=j,c.setSpeed=W,c.setDirection=H,c.play=ee,c.pause=I,c.stop=U,c.togglePause=Y,c.searchAnimations=ae,c.resize=xe,c.goToAndStop=P,c.destroy=te,c.freeze=De,c.unfreeze=Ae,c.setVolume=Ye,c.mute=Re,c.unmute=ye,c.getRegisteredAnimations=$,c}(),Ji=function(){var c={};c.getBezierEasing=p;var d={};function p(F,I,P,U,Y){var te=Y||("bez_"+F+"_"+I+"_"+P+"_"+U).replace(/\./g,"p");if(d[te])return d[te];var ae=new G([F,I,P,U]);return d[te]=ae,ae}var m=4,x=.001,S=1e-7,T=10,k=11,_=1/(k-1),$=typeof Float32Array=="function";function V(F,I){return 1-3*I+3*F}function ie(F,I){return 3*I-6*F}function R(F){return 3*F}function j(F,I,P){return((V(I,P)*F+ie(I,P))*F+R(I))*F}function W(F,I,P){return 3*V(I,P)*F*F+2*ie(I,P)*F+R(I)}function H(F,I,P,U,Y){var te,ae,xe=0;do ae=I+(P-I)/2,te=j(ae,U,Y)-F,te>0?P=ae:I=ae;while(Math.abs(te)>S&&++xe<T);return ae}function ee(F,I,P,U){for(var Y=0;Y<m;++Y){var te=W(I,P,U);if(te===0)return I;var ae=j(I,P,U)-F;I-=ae/te}return I}function G(F){this._p=F,this._mSampleValues=$?new Float32Array(k):new Array(k),this._precomputed=!1,this.get=this.get.bind(this)}return G.prototype={get:function(I){var P=this._p[0],U=this._p[1],Y=this._p[2],te=this._p[3];return this._precomputed||this._precompute(),P===U&&Y===te?I:I===0?0:I===1?1:j(this._getTForX(I),U,te)},_precompute:function(){var I=this._p[0],P=this._p[1],U=this._p[2],Y=this._p[3];this._precomputed=!0,(I!==P||U!==Y)&&this._calcSampleValues()},_calcSampleValues:function(){for(var I=this._p[0],P=this._p[2],U=0;U<k;++U)this._mSampleValues[U]=j(U*_,I,P)},_getTForX:function(I){for(var P=this._p[0],U=this._p[2],Y=this._mSampleValues,te=0,ae=1,xe=k-1;ae!==xe&&Y[ae]<=I;++ae)te+=_;--ae;var Ke=(I-Y[ae])/(Y[ae+1]-Y[ae]),De=te+Ke*_,Ae=W(De,P,U);return Ae>=x?ee(I,De,P,U):Ae===0?De:H(I,te,te+_,P,U)}},c}(),Bs=function(){function c(d){return d.concat(b(d.length))}return{double:c}}(),$s=function(){return function(c,d,p){var m=0,x=c,S=b(x),T={newElement:k,release:_};function k(){var $;return m?(m-=1,$=S[m]):$=d(),$}function _($){m===x&&(S=Bs.double(S),x*=2),p&&p($),S[m]=$,m+=1}return T}}(),go=function(){function c(){return{addedLength:0,percents:y("float32",kt()),lengths:y("float32",kt())}}return $s(8,c)}(),mo=function(){function c(){return{lengths:[],totalLength:0}}function d(p){var m,x=p.lengths.length;for(m=0;m<x;m+=1)go.release(p.lengths[m]);p.lengths.length=0}return $s(8,c,d)}();function Lu(){var c=Math;function d(R,j,W,H,ee,G){var F=R*H+j*ee+W*G-ee*H-G*R-W*j;return F>-.001&&F<.001}function p(R,j,W,H,ee,G,F,I,P){if(W===0&&G===0&&P===0)return d(R,j,H,ee,F,I);var U=c.sqrt(c.pow(H-R,2)+c.pow(ee-j,2)+c.pow(G-W,2)),Y=c.sqrt(c.pow(F-R,2)+c.pow(I-j,2)+c.pow(P-W,2)),te=c.sqrt(c.pow(F-H,2)+c.pow(I-ee,2)+c.pow(P-G,2)),ae;return U>Y?U>te?ae=U-Y-te:ae=te-Y-U:te>Y?ae=te-Y-U:ae=Y-U-te,ae>-1e-4&&ae<1e-4}var m=function(){return function(R,j,W,H){var ee=kt(),G,F,I,P,U,Y=0,te,ae=[],xe=[],Ke=go.newElement();for(I=W.length,G=0;G<ee;G+=1){for(U=G/(ee-1),te=0,F=0;F<I;F+=1)P=B(1-U,3)*R[F]+3*B(1-U,2)*U*W[F]+3*(1-U)*B(U,2)*H[F]+B(U,3)*j[F],ae[F]=P,xe[F]!==null&&(te+=B(ae[F]-xe[F],2)),xe[F]=ae[F];te&&(te=N(te),Y+=te),Ke.percents[G]=U,Ke.lengths[G]=Y}return Ke.addedLength=Y,Ke}}();function x(R){var j=mo.newElement(),W=R.c,H=R.v,ee=R.o,G=R.i,F,I=R._length,P=j.lengths,U=0;for(F=0;F<I-1;F+=1)P[F]=m(H[F],H[F+1],ee[F],G[F+1]),U+=P[F].addedLength;return W&&I&&(P[F]=m(H[F],H[0],ee[F],G[0]),U+=P[F].addedLength),j.totalLength=U,j}function S(R){this.segmentLength=0,this.points=new Array(R)}function T(R,j){this.partialLength=R,this.point=j}var k=function(){var R={};return function(j,W,H,ee){var G=(j[0]+"_"+j[1]+"_"+W[0]+"_"+W[1]+"_"+H[0]+"_"+H[1]+"_"+ee[0]+"_"+ee[1]).replace(/\./g,"p");if(!R[G]){var F=kt(),I,P,U,Y,te,ae=0,xe,Ke,De=null;j.length===2&&(j[0]!==W[0]||j[1]!==W[1])&&d(j[0],j[1],W[0],W[1],j[0]+H[0],j[1]+H[1])&&d(j[0],j[1],W[0],W[1],W[0]+ee[0],W[1]+ee[1])&&(F=2);var Ae=new S(F);for(U=H.length,I=0;I<F;I+=1){for(Ke=b(U),te=I/(F-1),xe=0,P=0;P<U;P+=1)Y=B(1-te,3)*j[P]+3*B(1-te,2)*te*(j[P]+H[P])+3*(1-te)*B(te,2)*(W[P]+ee[P])+B(te,3)*W[P],Ke[P]=Y,De!==null&&(xe+=B(Ke[P]-De[P],2));xe=N(xe),ae+=xe,Ae.points[I]=new T(xe,Ke),De=Ke}Ae.segmentLength=ae,R[G]=Ae}return R[G]}}();function _(R,j){var W=j.percents,H=j.lengths,ee=W.length,G=J((ee-1)*R),F=R*j.addedLength,I=0;if(G===ee-1||G===0||F===H[G])return W[G];for(var P=H[G]>F?-1:1,U=!0;U;)if(H[G]<=F&&H[G+1]>F?(I=(F-H[G])/(H[G+1]-H[G]),U=!1):G+=P,G<0||G>=ee-1){if(G===ee-1)return W[G];U=!1}return W[G]+(W[G+1]-W[G])*I}function $(R,j,W,H,ee,G){var F=_(ee,G),I=1-F,P=c.round((I*I*I*R[0]+(F*I*I+I*F*I+I*I*F)*W[0]+(F*F*I+I*F*F+F*I*F)*H[0]+F*F*F*j[0])*1e3)/1e3,U=c.round((I*I*I*R[1]+(F*I*I+I*F*I+I*I*F)*W[1]+(F*F*I+I*F*F+F*I*F)*H[1]+F*F*F*j[1])*1e3)/1e3;return[P,U]}var V=y("float32",8);function ie(R,j,W,H,ee,G,F){ee<0?ee=0:ee>1&&(ee=1);var I=_(ee,F);G=G>1?1:G;var P=_(G,F),U,Y=R.length,te=1-I,ae=1-P,xe=te*te*te,Ke=I*te*te*3,De=I*I*te*3,Ae=I*I*I,Ye=te*te*ae,Re=I*te*ae+te*I*ae+te*te*P,ye=I*I*ae+te*I*P+I*te*P,O=I*I*P,K=te*ae*ae,w=I*ae*ae+te*P*ae+te*ae*P,L=I*P*ae+te*P*P+I*ae*P,ne=I*P*P,X=ae*ae*ae,Le=P*ae*ae+ae*P*ae+ae*ae*P,Be=P*P*ae+ae*P*P+P*ae*P,ze=P*P*P;for(U=0;U<Y;U+=1)V[U*4]=c.round((xe*R[U]+Ke*W[U]+De*H[U]+Ae*j[U])*1e3)/1e3,V[U*4+1]=c.round((Ye*R[U]+Re*W[U]+ye*H[U]+O*j[U])*1e3)/1e3,V[U*4+2]=c.round((K*R[U]+w*W[U]+L*H[U]+ne*j[U])*1e3)/1e3,V[U*4+3]=c.round((X*R[U]+Le*W[U]+Be*H[U]+ze*j[U])*1e3)/1e3;return V}return{getSegmentsLength:x,getNewSegment:ie,getPointInSegment:$,buildBezierData:k,pointOnLine2D:d,pointOnLine3D:p}}var Si=Lu(),hr=n,vo=Math.abs;function Us(c,d){var p=this.offsetTime,m;this.propType==="multidimensional"&&(m=y("float32",this.pv.length));for(var x=d.lastIndex,S=x,T=this.keyframes.length-1,k=!0,_,$,V;k;){if(_=this.keyframes[S],$=this.keyframes[S+1],S===T-1&&c>=$.t-p){_.h&&(_=$),x=0;break}if($.t-p>c){x=S;break}S<T-1?S+=1:(x=0,k=!1)}V=this.keyframesMetadata[S]||{};var ie,R,j,W,H,ee,G=$.t-p,F=_.t-p,I;if(_.to){V.bezierData||(V.bezierData=Si.buildBezierData(_.s,$.s||_.e,_.to,_.ti));var P=V.bezierData;if(c>=G||c<F){var U=c>=G?P.points.length-1:0;for(R=P.points[U].point.length,ie=0;ie<R;ie+=1)m[ie]=P.points[U].point[ie]}else{V.__fnct?ee=V.__fnct:(ee=Ji.getBezierEasing(_.o.x,_.o.y,_.i.x,_.i.y,_.n).get,V.__fnct=ee),j=ee((c-F)/(G-F));var Y=P.segmentLength*j,te,ae=d.lastFrame<c&&d._lastKeyframeIndex===S?d._lastAddedLength:0;for(H=d.lastFrame<c&&d._lastKeyframeIndex===S?d._lastPoint:0,k=!0,W=P.points.length;k;){if(ae+=P.points[H].partialLength,Y===0||j===0||H===P.points.length-1){for(R=P.points[H].point.length,ie=0;ie<R;ie+=1)m[ie]=P.points[H].point[ie];break}else if(Y>=ae&&Y<ae+P.points[H+1].partialLength){for(te=(Y-ae)/P.points[H+1].partialLength,R=P.points[H].point.length,ie=0;ie<R;ie+=1)m[ie]=P.points[H].point[ie]+(P.points[H+1].point[ie]-P.points[H].point[ie])*te;break}H<W-1?H+=1:k=!1}d._lastPoint=H,d._lastAddedLength=ae-P.points[H].partialLength,d._lastKeyframeIndex=S}}else{var xe,Ke,De,Ae,Ye;if(T=_.s.length,I=$.s||_.e,this.sh&&_.h!==1)if(c>=G)m[0]=I[0],m[1]=I[1],m[2]=I[2];else if(c<=F)m[0]=_.s[0],m[1]=_.s[1],m[2]=_.s[2];else{var Re=Gs(_.s),ye=Gs(I),O=(c-F)/(G-F);Rr(m,yo(Re,ye,O))}else for(S=0;S<T;S+=1)_.h!==1&&(c>=G?j=1:c<F?j=0:(_.o.x.constructor===Array?(V.__fnct||(V.__fnct=[]),V.__fnct[S]?ee=V.__fnct[S]:(xe=_.o.x[S]===void 0?_.o.x[0]:_.o.x[S],Ke=_.o.y[S]===void 0?_.o.y[0]:_.o.y[S],De=_.i.x[S]===void 0?_.i.x[0]:_.i.x[S],Ae=_.i.y[S]===void 0?_.i.y[0]:_.i.y[S],ee=Ji.getBezierEasing(xe,Ke,De,Ae).get,V.__fnct[S]=ee)):V.__fnct?ee=V.__fnct:(xe=_.o.x,Ke=_.o.y,De=_.i.x,Ae=_.i.y,ee=Ji.getBezierEasing(xe,Ke,De,Ae).get,_.keyframeMetadata=ee),j=ee((c-F)/(G-F)))),I=$.s||_.e,Ye=_.h===1?_.s[S]:_.s[S]+(I[S]-_.s[S])*j,this.propType==="multidimensional"?m[S]=Ye:m=Ye}return d.lastIndex=x,m}function yo(c,d,p){var m=[],x=c[0],S=c[1],T=c[2],k=c[3],_=d[0],$=d[1],V=d[2],ie=d[3],R,j,W,H,ee;return j=x*_+S*$+T*V+k*ie,j<0&&(j=-j,_=-_,$=-$,V=-V,ie=-ie),1-j>1e-6?(R=Math.acos(j),W=Math.sin(R),H=Math.sin((1-p)*R)/W,ee=Math.sin(p*R)/W):(H=1-p,ee=p),m[0]=H*x+ee*_,m[1]=H*S+ee*$,m[2]=H*T+ee*V,m[3]=H*k+ee*ie,m}function Rr(c,d){var p=d[0],m=d[1],x=d[2],S=d[3],T=Math.atan2(2*m*S-2*p*x,1-2*m*m-2*x*x),k=Math.asin(2*p*m+2*x*S),_=Math.atan2(2*p*S-2*m*x,1-2*p*p-2*x*x);c[0]=T/Q,c[1]=k/Q,c[2]=_/Q}function Gs(c){var d=c[0]*Q,p=c[1]*Q,m=c[2]*Q,x=Math.cos(d/2),S=Math.cos(p/2),T=Math.cos(m/2),k=Math.sin(d/2),_=Math.sin(p/2),$=Math.sin(m/2),V=x*S*T-k*_*$,ie=k*_*T+x*S*$,R=k*S*T+x*_*$,j=x*_*T-k*S*$;return[ie,R,j,V]}function Vs(){var c=this.comp.renderedFrame-this.offsetTime,d=this.keyframes[0].t-this.offsetTime,p=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(c===this._caching.lastFrame||this._caching.lastFrame!==hr&&(this._caching.lastFrame>=p&&c>=p||this._caching.lastFrame<d&&c<d))){this._caching.lastFrame>=c&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var m=this.interpolateValue(c,this._caching);this.pv=m}return this._caching.lastFrame=c,this.pv}function os(c){var d;if(this.propType==="unidimensional")d=c*this.mult,vo(this.v-d)>1e-5&&(this.v=d,this._mdf=!0);else for(var p=0,m=this.v.length;p<m;)d=c[p]*this.mult,vo(this.v[p]-d)>1e-5&&(this.v[p]=d,this._mdf=!0),p+=1}function js(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var c,d=this.effectsSequence.length,p=this.kf?this.pv:this.data.k;for(c=0;c<d;c+=1)p=this.effectsSequence[c](p);this.setVValue(p),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function ls(c){this.effectsSequence.push(c),this.container.addDynamicProperty(this)}function Iu(c,d,p,m){this.propType="unidimensional",this.mult=p||1,this.data=d,this.v=p?d.k*p:d.k,this.pv=d.k,this._mdf=!1,this.elem=c,this.container=m,this.comp=c.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=js,this.setVValue=os,this.addEffect=ls}function So(c,d,p,m){this.propType="multidimensional",this.mult=p||1,this.data=d,this._mdf=!1,this.elem=c,this.container=m,this.comp=c.comp,this.k=!1,this.kf=!1,this.frameId=-1;var x,S=d.k.length;for(this.v=y("float32",S),this.pv=y("float32",S),this.vel=y("float32",S),x=0;x<S;x+=1)this.v[x]=d.k[x]*this.mult,this.pv[x]=d.k[x];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=js,this.setVValue=os,this.addEffect=ls}function xo(c,d,p,m){this.propType="unidimensional",this.keyframes=d.k,this.keyframesMetadata=[],this.offsetTime=c.data.st,this.frameId=-1,this._caching={lastFrame:hr,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=d,this.mult=p||1,this.elem=c,this.container=m,this.comp=c.comp,this.v=hr,this.pv=hr,this._isFirstFrame=!0,this.getValue=js,this.setVValue=os,this.interpolateValue=Us,this.effectsSequence=[Vs.bind(this)],this.addEffect=ls}function Ru(c,d,p,m){this.propType="multidimensional";var x,S=d.k.length,T,k,_,$;for(x=0;x<S-1;x+=1)d.k[x].to&&d.k[x].s&&d.k[x+1]&&d.k[x+1].s&&(T=d.k[x].s,k=d.k[x+1].s,_=d.k[x].to,$=d.k[x].ti,(T.length===2&&!(T[0]===k[0]&&T[1]===k[1])&&Si.pointOnLine2D(T[0],T[1],k[0],k[1],T[0]+_[0],T[1]+_[1])&&Si.pointOnLine2D(T[0],T[1],k[0],k[1],k[0]+$[0],k[1]+$[1])||T.length===3&&!(T[0]===k[0]&&T[1]===k[1]&&T[2]===k[2])&&Si.pointOnLine3D(T[0],T[1],T[2],k[0],k[1],k[2],T[0]+_[0],T[1]+_[1],T[2]+_[2])&&Si.pointOnLine3D(T[0],T[1],T[2],k[0],k[1],k[2],k[0]+$[0],k[1]+$[1],k[2]+$[2]))&&(d.k[x].to=null,d.k[x].ti=null),T[0]===k[0]&&T[1]===k[1]&&_[0]===0&&_[1]===0&&$[0]===0&&$[1]===0&&(T.length===2||T[2]===k[2]&&_[2]===0&&$[2]===0)&&(d.k[x].to=null,d.k[x].ti=null));this.effectsSequence=[Vs.bind(this)],this.data=d,this.keyframes=d.k,this.keyframesMetadata=[],this.offsetTime=c.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=p||1,this.elem=c,this.container=m,this.comp=c.comp,this.getValue=js,this.setVValue=os,this.interpolateValue=Us,this.frameId=-1;var V=d.k[0].s.length;for(this.v=y("float32",V),this.pv=y("float32",V),x=0;x<V;x+=1)this.v[x]=hr,this.pv[x]=hr;this._caching={lastFrame:hr,lastIndex:0,value:y("float32",V)},this.addEffect=ls}var _e=function(){function c(p,m,x,S,T){m.sid&&(m=p.globalData.slotManager.getProp(m));var k;if(!m.k.length)k=new Iu(p,m,S,T);else if(typeof m.k[0]=="number")k=new So(p,m,S,T);else switch(x){case 0:k=new xo(p,m,S,T);break;case 1:k=new Ru(p,m,S,T);break}return k.effectsSequence.length&&T.addDynamicProperty(k),k}var d={getProp:c};return d}();function It(){}It.prototype={addDynamicProperty:function(d){this.dynamicProperties.indexOf(d)===-1&&(this.dynamicProperties.push(d),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){this._mdf=!1;var d,p=this.dynamicProperties.length;for(d=0;d<p;d+=1)this.dynamicProperties[d].getValue(),this.dynamicProperties[d]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(d){this.container=d,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var dr=function(){function c(){return y("float32",2)}return $s(8,c)}();function Ri(){this.c=!1,this._length=0,this._maxLength=8,this.v=b(this._maxLength),this.o=b(this._maxLength),this.i=b(this._maxLength)}Ri.prototype.setPathData=function(c,d){this.c=c,this.setLength(d);for(var p=0;p<d;)this.v[p]=dr.newElement(),this.o[p]=dr.newElement(),this.i[p]=dr.newElement(),p+=1},Ri.prototype.setLength=function(c){for(;this._maxLength<c;)this.doubleArrayLength();this._length=c},Ri.prototype.doubleArrayLength=function(){this.v=this.v.concat(b(this._maxLength)),this.i=this.i.concat(b(this._maxLength)),this.o=this.o.concat(b(this._maxLength)),this._maxLength*=2},Ri.prototype.setXYAt=function(c,d,p,m,x){var S;switch(this._length=Math.max(this._length,m+1),this._length>=this._maxLength&&this.doubleArrayLength(),p){case"v":S=this.v;break;case"i":S=this.i;break;case"o":S=this.o;break;default:S=[];break}(!S[m]||S[m]&&!x)&&(S[m]=dr.newElement()),S[m][0]=c,S[m][1]=d},Ri.prototype.setTripleAt=function(c,d,p,m,x,S,T,k){this.setXYAt(c,d,"v",T,k),this.setXYAt(p,m,"o",T,k),this.setXYAt(x,S,"i",T,k)},Ri.prototype.reverse=function(){var c=new Ri;c.setPathData(this.c,this._length);var d=this.v,p=this.o,m=this.i,x=0;this.c&&(c.setTripleAt(d[0][0],d[0][1],m[0][0],m[0][1],p[0][0],p[0][1],0,!1),x=1);var S=this._length-1,T=this._length,k;for(k=x;k<T;k+=1)c.setTripleAt(d[S][0],d[S][1],m[S][0],m[S][1],p[S][0],p[S][1],k,!1),S-=1;return c},Ri.prototype.length=function(){return this._length};var Bt=function(){function c(){return new Ri}function d(x){var S=x._length,T;for(T=0;T<S;T+=1)dr.release(x.v[T]),dr.release(x.i[T]),dr.release(x.o[T]),x.v[T]=null,x.i[T]=null,x.o[T]=null;x._length=0,x.c=!1}function p(x){var S=m.newElement(),T,k=x._length===void 0?x.v.length:x._length;for(S.setLength(k),S.c=x.c,T=0;T<k;T+=1)S.setTripleAt(x.v[T][0],x.v[T][1],x.o[T][0],x.o[T][1],x.i[T][0],x.i[T][1],T);return S}var m=$s(4,c,d);return m.clone=p,m}();function Vn(){this._length=0,this._maxLength=4,this.shapes=b(this._maxLength)}Vn.prototype.addShape=function(c){this._length===this._maxLength&&(this.shapes=this.shapes.concat(b(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=c,this._length+=1},Vn.prototype.releaseShapes=function(){var c;for(c=0;c<this._length;c+=1)Bt.release(this.shapes[c]);this._length=0};var z=function(){var c={newShapeCollection:x,release:S},d=0,p=4,m=b(p);function x(){var T;return d?(d-=1,T=m[d]):T=new Vn,T}function S(T){var k,_=T._length;for(k=0;k<_;k+=1)Bt.release(T.shapes[k]);T._length=0,d===p&&(m=Bs.double(m),p*=2),m[d]=T,d+=1}return c}(),be=function(){var c=-999999;function d(G,F,I){var P=I.lastIndex,U,Y,te,ae,xe,Ke,De,Ae,Ye,Re=this.keyframes;if(G<Re[0].t-this.offsetTime)U=Re[0].s[0],te=!0,P=0;else if(G>=Re[Re.length-1].t-this.offsetTime)U=Re[Re.length-1].s?Re[Re.length-1].s[0]:Re[Re.length-2].e[0],te=!0;else{for(var ye=P,O=Re.length-1,K=!0,w,L,ne;K&&(w=Re[ye],L=Re[ye+1],!(L.t-this.offsetTime>G));)ye<O-1?ye+=1:K=!1;if(ne=this.keyframesMetadata[ye]||{},te=w.h===1,P=ye,!te){if(G>=L.t-this.offsetTime)Ae=1;else if(G<w.t-this.offsetTime)Ae=0;else{var X;ne.__fnct?X=ne.__fnct:(X=Ji.getBezierEasing(w.o.x,w.o.y,w.i.x,w.i.y).get,ne.__fnct=X),Ae=X((G-(w.t-this.offsetTime))/(L.t-this.offsetTime-(w.t-this.offsetTime)))}Y=L.s?L.s[0]:w.e[0]}U=w.s[0]}for(Ke=F._length,De=U.i[0].length,I.lastIndex=P,ae=0;ae<Ke;ae+=1)for(xe=0;xe<De;xe+=1)Ye=te?U.i[ae][xe]:U.i[ae][xe]+(Y.i[ae][xe]-U.i[ae][xe])*Ae,F.i[ae][xe]=Ye,Ye=te?U.o[ae][xe]:U.o[ae][xe]+(Y.o[ae][xe]-U.o[ae][xe])*Ae,F.o[ae][xe]=Ye,Ye=te?U.v[ae][xe]:U.v[ae][xe]+(Y.v[ae][xe]-U.v[ae][xe])*Ae,F.v[ae][xe]=Ye}function p(){var G=this.comp.renderedFrame-this.offsetTime,F=this.keyframes[0].t-this.offsetTime,I=this.keyframes[this.keyframes.length-1].t-this.offsetTime,P=this._caching.lastFrame;return P!==c&&(P<F&&G<F||P>I&&G>I)||(this._caching.lastIndex=P<G?this._caching.lastIndex:0,this.interpolateShape(G,this.pv,this._caching)),this._caching.lastFrame=G,this.pv}function m(){this.paths=this.localShapeCollection}function x(G,F){if(G._length!==F._length||G.c!==F.c)return!1;var I,P=G._length;for(I=0;I<P;I+=1)if(G.v[I][0]!==F.v[I][0]||G.v[I][1]!==F.v[I][1]||G.o[I][0]!==F.o[I][0]||G.o[I][1]!==F.o[I][1]||G.i[I][0]!==F.i[I][0]||G.i[I][1]!==F.i[I][1])return!1;return!0}function S(G){x(this.v,G)||(this.v=Bt.clone(G),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function T(){if(this.elem.globalData.frameId!==this.frameId){if(!this.effectsSequence.length){this._mdf=!1;return}if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=!1;var G;this.kf?G=this.pv:this.data.ks?G=this.data.ks.k:G=this.data.pt.k;var F,I=this.effectsSequence.length;for(F=0;F<I;F+=1)G=this.effectsSequence[F](G);this.setVValue(G),this.lock=!1,this.frameId=this.elem.globalData.frameId}}function k(G,F,I){this.propType="shape",this.comp=G.comp,this.container=G,this.elem=G,this.data=F,this.k=!1,this.kf=!1,this._mdf=!1;var P=I===3?F.pt.k:F.ks.k;this.v=Bt.clone(P),this.pv=Bt.clone(this.v),this.localShapeCollection=z.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=m,this.effectsSequence=[]}function _(G){this.effectsSequence.push(G),this.container.addDynamicProperty(this)}k.prototype.interpolateShape=d,k.prototype.getValue=T,k.prototype.setVValue=S,k.prototype.addEffect=_;function $(G,F,I){this.propType="shape",this.comp=G.comp,this.elem=G,this.container=G,this.offsetTime=G.data.st,this.keyframes=I===3?F.pt.k:F.ks.k,this.keyframesMetadata=[],this.k=!0,this.kf=!0;var P=this.keyframes[0].s[0].i.length;this.v=Bt.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,P),this.pv=Bt.clone(this.v),this.localShapeCollection=z.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=c,this.reset=m,this._caching={lastFrame:c,lastIndex:0},this.effectsSequence=[p.bind(this)]}$.prototype.getValue=T,$.prototype.interpolateShape=d,$.prototype.setVValue=S,$.prototype.addEffect=_;var V=function(){var G=q;function F(I,P){this.v=Bt.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=z.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=P.d,this.elem=I,this.comp=I.comp,this.frameId=-1,this.initDynamicPropertyContainer(I),this.p=_e.getProp(I,P.p,1,0,this),this.s=_e.getProp(I,P.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return F.prototype={reset:m,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var P=this.p.v[0],U=this.p.v[1],Y=this.s.v[0]/2,te=this.s.v[1]/2,ae=this.d!==3,xe=this.v;xe.v[0][0]=P,xe.v[0][1]=U-te,xe.v[1][0]=ae?P+Y:P-Y,xe.v[1][1]=U,xe.v[2][0]=P,xe.v[2][1]=U+te,xe.v[3][0]=ae?P-Y:P+Y,xe.v[3][1]=U,xe.i[0][0]=ae?P-Y*G:P+Y*G,xe.i[0][1]=U-te,xe.i[1][0]=ae?P+Y:P-Y,xe.i[1][1]=U-te*G,xe.i[2][0]=ae?P+Y*G:P-Y*G,xe.i[2][1]=U+te,xe.i[3][0]=ae?P-Y:P+Y,xe.i[3][1]=U+te*G,xe.o[0][0]=ae?P+Y*G:P-Y*G,xe.o[0][1]=U-te,xe.o[1][0]=ae?P+Y:P-Y,xe.o[1][1]=U+te*G,xe.o[2][0]=ae?P-Y*G:P+Y*G,xe.o[2][1]=U+te,xe.o[3][0]=ae?P-Y:P+Y,xe.o[3][1]=U-te*G}},f([It],F),F}(),ie=function(){function G(F,I){this.v=Bt.newElement(),this.v.setPathData(!0,0),this.elem=F,this.comp=F.comp,this.data=I,this.frameId=-1,this.d=I.d,this.initDynamicPropertyContainer(F),I.sy===1?(this.ir=_e.getProp(F,I.ir,0,0,this),this.is=_e.getProp(F,I.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=_e.getProp(F,I.pt,0,0,this),this.p=_e.getProp(F,I.p,1,0,this),this.r=_e.getProp(F,I.r,0,Q,this),this.or=_e.getProp(F,I.or,0,0,this),this.os=_e.getProp(F,I.os,0,.01,this),this.localShapeCollection=z.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return G.prototype={reset:m,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var I=Math.floor(this.pt.v)*2,P=Math.PI*2/I,U=!0,Y=this.or.v,te=this.ir.v,ae=this.os.v,xe=this.is.v,Ke=2*Math.PI*Y/(I*2),De=2*Math.PI*te/(I*2),Ae,Ye,Re,ye,O=-Math.PI/2;O+=this.r.v;var K=this.data.d===3?-1:1;for(this.v._length=0,Ae=0;Ae<I;Ae+=1){Ye=U?Y:te,Re=U?ae:xe,ye=U?Ke:De;var w=Ye*Math.cos(O),L=Ye*Math.sin(O),ne=w===0&&L===0?0:L/Math.sqrt(w*w+L*L),X=w===0&&L===0?0:-w/Math.sqrt(w*w+L*L);w+=+this.p.v[0],L+=+this.p.v[1],this.v.setTripleAt(w,L,w-ne*ye*Re*K,L-X*ye*Re*K,w+ne*ye*Re*K,L+X*ye*Re*K,Ae,!0),U=!U,O+=P*K}},convertPolygonToPath:function(){var I=Math.floor(this.pt.v),P=Math.PI*2/I,U=this.or.v,Y=this.os.v,te=2*Math.PI*U/(I*4),ae,xe=-Math.PI*.5,Ke=this.data.d===3?-1:1;for(xe+=this.r.v,this.v._length=0,ae=0;ae<I;ae+=1){var De=U*Math.cos(xe),Ae=U*Math.sin(xe),Ye=De===0&&Ae===0?0:Ae/Math.sqrt(De*De+Ae*Ae),Re=De===0&&Ae===0?0:-De/Math.sqrt(De*De+Ae*Ae);De+=+this.p.v[0],Ae+=+this.p.v[1],this.v.setTripleAt(De,Ae,De-Ye*te*Y*Ke,Ae-Re*te*Y*Ke,De+Ye*te*Y*Ke,Ae+Re*te*Y*Ke,ae,!0),xe+=P*Ke}this.paths.length=0,this.paths[0]=this.v}},f([It],G),G}(),R=function(){function G(F,I){this.v=Bt.newElement(),this.v.c=!0,this.localShapeCollection=z.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=F,this.comp=F.comp,this.frameId=-1,this.d=I.d,this.initDynamicPropertyContainer(F),this.p=_e.getProp(F,I.p,1,0,this),this.s=_e.getProp(F,I.s,1,0,this),this.r=_e.getProp(F,I.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return G.prototype={convertRectToPath:function(){var I=this.p.v[0],P=this.p.v[1],U=this.s.v[0]/2,Y=this.s.v[1]/2,te=Z(U,Y,this.r.v),ae=te*(1-q);this.v._length=0,this.d===2||this.d===1?(this.v.setTripleAt(I+U,P-Y+te,I+U,P-Y+te,I+U,P-Y+ae,0,!0),this.v.setTripleAt(I+U,P+Y-te,I+U,P+Y-ae,I+U,P+Y-te,1,!0),te!==0?(this.v.setTripleAt(I+U-te,P+Y,I+U-te,P+Y,I+U-ae,P+Y,2,!0),this.v.setTripleAt(I-U+te,P+Y,I-U+ae,P+Y,I-U+te,P+Y,3,!0),this.v.setTripleAt(I-U,P+Y-te,I-U,P+Y-te,I-U,P+Y-ae,4,!0),this.v.setTripleAt(I-U,P-Y+te,I-U,P-Y+ae,I-U,P-Y+te,5,!0),this.v.setTripleAt(I-U+te,P-Y,I-U+te,P-Y,I-U+ae,P-Y,6,!0),this.v.setTripleAt(I+U-te,P-Y,I+U-ae,P-Y,I+U-te,P-Y,7,!0)):(this.v.setTripleAt(I-U,P+Y,I-U+ae,P+Y,I-U,P+Y,2),this.v.setTripleAt(I-U,P-Y,I-U,P-Y+ae,I-U,P-Y,3))):(this.v.setTripleAt(I+U,P-Y+te,I+U,P-Y+ae,I+U,P-Y+te,0,!0),te!==0?(this.v.setTripleAt(I+U-te,P-Y,I+U-te,P-Y,I+U-ae,P-Y,1,!0),this.v.setTripleAt(I-U+te,P-Y,I-U+ae,P-Y,I-U+te,P-Y,2,!0),this.v.setTripleAt(I-U,P-Y+te,I-U,P-Y+te,I-U,P-Y+ae,3,!0),this.v.setTripleAt(I-U,P+Y-te,I-U,P+Y-ae,I-U,P+Y-te,4,!0),this.v.setTripleAt(I-U+te,P+Y,I-U+te,P+Y,I-U+ae,P+Y,5,!0),this.v.setTripleAt(I+U-te,P+Y,I+U-ae,P+Y,I+U-te,P+Y,6,!0),this.v.setTripleAt(I+U,P+Y-te,I+U,P+Y-te,I+U,P+Y-ae,7,!0)):(this.v.setTripleAt(I-U,P-Y,I-U+ae,P-Y,I-U,P-Y,1,!0),this.v.setTripleAt(I-U,P+Y,I-U,P+Y-ae,I-U,P+Y,2,!0),this.v.setTripleAt(I+U,P+Y,I+U-ae,P+Y,I+U,P+Y,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:m},f([It],G),G}();function j(G,F,I){var P;if(I===3||I===4){var U=I===3?F.pt:F.ks,Y=U.k;Y.length?P=new $(G,F,I):P=new k(G,F,I)}else I===5?P=new R(G,F):I===6?P=new V(G,F):I===7&&(P=new ie(G,F));return P.k&&G.addDynamicProperty(P),P}function W(){return k}function H(){return $}var ee={};return ee.getShapeProp=j,ee.getConstructorFunction=W,ee.getKeyframedConstructorFunction=H,ee}();/*!
|
|
141
|
-
Transformation Matrix v2.0
|
|
142
|
-
(c) Epistemex 2014-2015
|
|
143
|
-
www.epistemex.com
|
|
144
|
-
By Ken Fyrstenberg
|
|
145
|
-
Contributions by leeoniya.
|
|
146
|
-
License: MIT, header required.
|
|
147
|
-
*/var Te=function(){var c=Math.cos,d=Math.sin,p=Math.tan,m=Math.round;function x(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}function S(w){if(w===0)return this;var L=c(w),ne=d(w);return this._t(L,-ne,0,0,ne,L,0,0,0,0,1,0,0,0,0,1)}function T(w){if(w===0)return this;var L=c(w),ne=d(w);return this._t(1,0,0,0,0,L,-ne,0,0,ne,L,0,0,0,0,1)}function k(w){if(w===0)return this;var L=c(w),ne=d(w);return this._t(L,0,ne,0,0,1,0,0,-ne,0,L,0,0,0,0,1)}function _(w){if(w===0)return this;var L=c(w),ne=d(w);return this._t(L,-ne,0,0,ne,L,0,0,0,0,1,0,0,0,0,1)}function $(w,L){return this._t(1,L,w,1,0,0)}function V(w,L){return this.shear(p(w),p(L))}function ie(w,L){var ne=c(L),X=d(L);return this._t(ne,X,0,0,-X,ne,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,p(w),1,0,0,0,0,1,0,0,0,0,1)._t(ne,-X,0,0,X,ne,0,0,0,0,1,0,0,0,0,1)}function R(w,L,ne){return!ne&&ne!==0&&(ne=1),w===1&&L===1&&ne===1?this:this._t(w,0,0,0,0,L,0,0,0,0,ne,0,0,0,0,1)}function j(w,L,ne,X,Le,Be,ze,at,ot,Dt,ii,er,ri,Ht,fi,gt){return this.props[0]=w,this.props[1]=L,this.props[2]=ne,this.props[3]=X,this.props[4]=Le,this.props[5]=Be,this.props[6]=ze,this.props[7]=at,this.props[8]=ot,this.props[9]=Dt,this.props[10]=ii,this.props[11]=er,this.props[12]=ri,this.props[13]=Ht,this.props[14]=fi,this.props[15]=gt,this}function W(w,L,ne){return ne=ne||0,w!==0||L!==0||ne!==0?this._t(1,0,0,0,0,1,0,0,0,0,1,0,w,L,ne,1):this}function H(w,L,ne,X,Le,Be,ze,at,ot,Dt,ii,er,ri,Ht,fi,gt){var Pe=this.props;if(w===1&&L===0&&ne===0&&X===0&&Le===0&&Be===1&&ze===0&&at===0&&ot===0&&Dt===0&&ii===1&&er===0)return Pe[12]=Pe[12]*w+Pe[15]*ri,Pe[13]=Pe[13]*Be+Pe[15]*Ht,Pe[14]=Pe[14]*ii+Pe[15]*fi,Pe[15]*=gt,this._identityCalculated=!1,this;var gr=Pe[0],Br=Pe[1],mr=Pe[2],tr=Pe[3],vr=Pe[4],yr=Pe[5],si=Pe[6],$r=Pe[7],Ur=Pe[8],Oi=Pe[9],Gr=Pe[10],Mi=Pe[11],ds=Pe[12],Co=Pe[13],Lo=Pe[14],Io=Pe[15];return Pe[0]=gr*w+Br*Le+mr*ot+tr*ri,Pe[1]=gr*L+Br*Be+mr*Dt+tr*Ht,Pe[2]=gr*ne+Br*ze+mr*ii+tr*fi,Pe[3]=gr*X+Br*at+mr*er+tr*gt,Pe[4]=vr*w+yr*Le+si*ot+$r*ri,Pe[5]=vr*L+yr*Be+si*Dt+$r*Ht,Pe[6]=vr*ne+yr*ze+si*ii+$r*fi,Pe[7]=vr*X+yr*at+si*er+$r*gt,Pe[8]=Ur*w+Oi*Le+Gr*ot+Mi*ri,Pe[9]=Ur*L+Oi*Be+Gr*Dt+Mi*Ht,Pe[10]=Ur*ne+Oi*ze+Gr*ii+Mi*fi,Pe[11]=Ur*X+Oi*at+Gr*er+Mi*gt,Pe[12]=ds*w+Co*Le+Lo*ot+Io*ri,Pe[13]=ds*L+Co*Be+Lo*Dt+Io*Ht,Pe[14]=ds*ne+Co*ze+Lo*ii+Io*fi,Pe[15]=ds*X+Co*at+Lo*er+Io*gt,this._identityCalculated=!1,this}function ee(w){var L=w.props;return this.transform(L[0],L[1],L[2],L[3],L[4],L[5],L[6],L[7],L[8],L[9],L[10],L[11],L[12],L[13],L[14],L[15])}function G(){return this._identityCalculated||(this._identity=!(this.props[0]!==1||this.props[1]!==0||this.props[2]!==0||this.props[3]!==0||this.props[4]!==0||this.props[5]!==1||this.props[6]!==0||this.props[7]!==0||this.props[8]!==0||this.props[9]!==0||this.props[10]!==1||this.props[11]!==0||this.props[12]!==0||this.props[13]!==0||this.props[14]!==0||this.props[15]!==1),this._identityCalculated=!0),this._identity}function F(w){for(var L=0;L<16;){if(w.props[L]!==this.props[L])return!1;L+=1}return!0}function I(w){var L;for(L=0;L<16;L+=1)w.props[L]=this.props[L];return w}function P(w){var L;for(L=0;L<16;L+=1)this.props[L]=w[L]}function U(w,L,ne){return{x:w*this.props[0]+L*this.props[4]+ne*this.props[8]+this.props[12],y:w*this.props[1]+L*this.props[5]+ne*this.props[9]+this.props[13],z:w*this.props[2]+L*this.props[6]+ne*this.props[10]+this.props[14]}}function Y(w,L,ne){return w*this.props[0]+L*this.props[4]+ne*this.props[8]+this.props[12]}function te(w,L,ne){return w*this.props[1]+L*this.props[5]+ne*this.props[9]+this.props[13]}function ae(w,L,ne){return w*this.props[2]+L*this.props[6]+ne*this.props[10]+this.props[14]}function xe(){var w=this.props[0]*this.props[5]-this.props[1]*this.props[4],L=this.props[5]/w,ne=-this.props[1]/w,X=-this.props[4]/w,Le=this.props[0]/w,Be=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/w,ze=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/w,at=new Te;return at.props[0]=L,at.props[1]=ne,at.props[4]=X,at.props[5]=Le,at.props[12]=Be,at.props[13]=ze,at}function Ke(w){var L=this.getInverseMatrix();return L.applyToPointArray(w[0],w[1],w[2]||0)}function De(w){var L,ne=w.length,X=[];for(L=0;L<ne;L+=1)X[L]=Ke(w[L]);return X}function Ae(w,L,ne){var X=y("float32",6);if(this.isIdentity())X[0]=w[0],X[1]=w[1],X[2]=L[0],X[3]=L[1],X[4]=ne[0],X[5]=ne[1];else{var Le=this.props[0],Be=this.props[1],ze=this.props[4],at=this.props[5],ot=this.props[12],Dt=this.props[13];X[0]=w[0]*Le+w[1]*ze+ot,X[1]=w[0]*Be+w[1]*at+Dt,X[2]=L[0]*Le+L[1]*ze+ot,X[3]=L[0]*Be+L[1]*at+Dt,X[4]=ne[0]*Le+ne[1]*ze+ot,X[5]=ne[0]*Be+ne[1]*at+Dt}return X}function Ye(w,L,ne){var X;return this.isIdentity()?X=[w,L,ne]:X=[w*this.props[0]+L*this.props[4]+ne*this.props[8]+this.props[12],w*this.props[1]+L*this.props[5]+ne*this.props[9]+this.props[13],w*this.props[2]+L*this.props[6]+ne*this.props[10]+this.props[14]],X}function Re(w,L){if(this.isIdentity())return w+","+L;var ne=this.props;return Math.round((w*ne[0]+L*ne[4]+ne[12])*100)/100+","+Math.round((w*ne[1]+L*ne[5]+ne[13])*100)/100}function ye(){for(var w=0,L=this.props,ne="matrix3d(",X=1e4;w<16;)ne+=m(L[w]*X)/X,ne+=w===15?")":",",w+=1;return ne}function O(w){var L=1e4;return w<1e-6&&w>0||w>-1e-6&&w<0?m(w*L)/L:w}function K(){var w=this.props,L=O(w[0]),ne=O(w[1]),X=O(w[4]),Le=O(w[5]),Be=O(w[12]),ze=O(w[13]);return"matrix("+L+","+ne+","+X+","+Le+","+Be+","+ze+")"}return function(){this.reset=x,this.rotate=S,this.rotateX=T,this.rotateY=k,this.rotateZ=_,this.skew=V,this.skewFromAxis=ie,this.shear=$,this.scale=R,this.setTransform=j,this.translate=W,this.transform=H,this.multiply=ee,this.applyToPoint=U,this.applyToX=Y,this.applyToY=te,this.applyToZ=ae,this.applyToPointArray=Ye,this.applyToTriplePoints=Ae,this.applyToPointStringified=Re,this.toCSS=ye,this.to2dCSS=K,this.clone=I,this.cloneFromProps=P,this.equals=F,this.inversePoints=De,this.inversePoint=Ke,this.getInverseMatrix=xe,this._t=this.transform,this.isIdentity=G,this._identity=!0,this._identityCalculated=!1,this.props=y("float32",16),this.reset()}}();function Ge(c){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ge=function(p){return typeof p}:Ge=function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},Ge(c)}var Fe={};function dt(c){l(c)}function tt(){Et.searchAnimations()}function Ze(c){it(c)}function jt(c){Ci(c)}function wt(c){return Et.loadAnimation(c)}function At(c){if(typeof c=="string")switch(c){case"high":xt(200);break;default:case"medium":xt(50);break;case"low":xt(10);break}else!isNaN(c)&&c>1&&xt(c)}function Pi(){return typeof navigator<"u"}function Pr(c,d){c==="expressions"&<(d)}function bo(c){switch(c){case"propertyFactory":return _e;case"shapePropertyFactory":return be;case"matrix":return Te;default:return null}}Fe.play=Et.play,Fe.pause=Et.pause,Fe.setLocationHref=dt,Fe.togglePause=Et.togglePause,Fe.setSpeed=Et.setSpeed,Fe.setDirection=Et.setDirection,Fe.stop=Et.stop,Fe.searchAnimations=tt,Fe.registerAnimation=Et.registerAnimation,Fe.loadAnimation=wt,Fe.setSubframeRendering=Ze,Fe.resize=Et.resize,Fe.goToAndStop=Et.goToAndStop,Fe.destroy=Et.destroy,Fe.setQuality=At,Fe.inBrowser=Pi,Fe.installPlugin=Pr,Fe.freeze=Et.freeze,Fe.unfreeze=Et.unfreeze,Fe.setVolume=Et.setVolume,Fe.mute=Et.mute,Fe.unmute=Et.unmute,Fe.getRegisteredAnimations=Et.getRegisteredAnimations,Fe.useWebWorker=a,Fe.setIDPrefix=jt,Fe.__getFactory=bo,Fe.version="5.12.2";function ki(){document.readyState==="complete"&&(clearInterval(dR),tt())}function uR(c){for(var d=f0.split("&"),p=0;p<d.length;p+=1){var m=d[p].split("=");if(decodeURIComponent(m[0])==c)return decodeURIComponent(m[1])}return null}var f0="";{var p0=document.getElementsByTagName("script"),hR=p0.length-1,g0=p0[hR]||{src:""};f0=g0.src?g0.src.replace(/^[^\?]+\??/,""):"",uR("renderer")}var dR=setInterval(ki,100);try{Ge(e)!=="object"&&(window.bodymovin=Fe)}catch{}var kr=function(){var c={},d={};c.registerModifier=p,c.getModifier=m;function p(x,S){d[x]||(d[x]=S)}function m(x,S,T){return new d[x](S,T)}return c}();function xi(){}xi.prototype.initModifierProperties=function(){},xi.prototype.addShapeToModifier=function(){},xi.prototype.addShape=function(c){if(!this.closed){c.sh.container.addDynamicProperty(c.sh);var d={shape:c.sh,data:c,localShapeCollection:z.newShapeCollection()};this.shapes.push(d),this.addShapeToModifier(d),this._isAnimated&&c.setAsAnimated()}},xi.prototype.init=function(c,d){this.shapes=[],this.elem=c,this.initDynamicPropertyContainer(c),this.initModifierProperties(c,d),this.frameId=n,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},xi.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},f([It],xi);function Di(){}f([xi],Di),Di.prototype.initModifierProperties=function(c,d){this.s=_e.getProp(c,d.s,0,.01,this),this.e=_e.getProp(c,d.e,0,.01,this),this.o=_e.getProp(c,d.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=d.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},Di.prototype.addShapeToModifier=function(c){c.pathsData=[]},Di.prototype.calculateShapeEdges=function(c,d,p,m,x){var S=[];d<=1?S.push({s:c,e:d}):c>=1?S.push({s:c-1,e:d-1}):(S.push({s:c,e:1}),S.push({s:0,e:d-1}));var T=[],k,_=S.length,$;for(k=0;k<_;k+=1)if($=S[k],!($.e*x<m||$.s*x>m+p)){var V,ie;$.s*x<=m?V=0:V=($.s*x-m)/p,$.e*x>=m+p?ie=1:ie=($.e*x-m)/p,T.push([V,ie])}return T.length||T.push([0,0]),T},Di.prototype.releasePathsData=function(c){var d,p=c.length;for(d=0;d<p;d+=1)mo.release(c[d]);return c.length=0,c},Di.prototype.processShapes=function(c){var d,p;if(this._mdf||c){var m=this.o.v%360/360;if(m<0&&(m+=1),this.s.v>1?d=1+m:this.s.v<0?d=0+m:d=this.s.v+m,this.e.v>1?p=1+m:this.e.v<0?p=0+m:p=this.e.v+m,d>p){var x=d;d=p,p=x}d=Math.round(d*1e4)*1e-4,p=Math.round(p*1e4)*1e-4,this.sValue=d,this.eValue=p}else d=this.sValue,p=this.eValue;var S,T,k=this.shapes.length,_,$,V,ie,R,j=0;if(p===d)for(T=0;T<k;T+=1)this.shapes[T].localShapeCollection.releaseShapes(),this.shapes[T].shape._mdf=!0,this.shapes[T].shape.paths=this.shapes[T].localShapeCollection,this._mdf&&(this.shapes[T].pathsData.length=0);else if(p===1&&d===0||p===0&&d===1){if(this._mdf)for(T=0;T<k;T+=1)this.shapes[T].pathsData.length=0,this.shapes[T].shape._mdf=!0}else{var W=[],H,ee;for(T=0;T<k;T+=1)if(H=this.shapes[T],!H.shape._mdf&&!this._mdf&&!c&&this.m!==2)H.shape.paths=H.localShapeCollection;else{if(S=H.shape.paths,$=S._length,R=0,!H.shape._mdf&&H.pathsData.length)R=H.totalShapeLength;else{for(V=this.releasePathsData(H.pathsData),_=0;_<$;_+=1)ie=Si.getSegmentsLength(S.shapes[_]),V.push(ie),R+=ie.totalLength;H.totalShapeLength=R,H.pathsData=V}j+=R,H.shape._mdf=!0}var G=d,F=p,I=0,P;for(T=k-1;T>=0;T-=1)if(H=this.shapes[T],H.shape._mdf){for(ee=H.localShapeCollection,ee.releaseShapes(),this.m===2&&k>1?(P=this.calculateShapeEdges(d,p,H.totalShapeLength,I,j),I+=H.totalShapeLength):P=[[G,F]],$=P.length,_=0;_<$;_+=1){G=P[_][0],F=P[_][1],W.length=0,F<=1?W.push({s:H.totalShapeLength*G,e:H.totalShapeLength*F}):G>=1?W.push({s:H.totalShapeLength*(G-1),e:H.totalShapeLength*(F-1)}):(W.push({s:H.totalShapeLength*G,e:H.totalShapeLength}),W.push({s:0,e:H.totalShapeLength*(F-1)}));var U=this.addShapes(H,W[0]);if(W[0].s!==W[0].e){if(W.length>1){var Y=H.shape.paths.shapes[H.shape.paths._length-1];if(Y.c){var te=U.pop();this.addPaths(U,ee),U=this.addShapes(H,W[1],te)}else this.addPaths(U,ee),U=this.addShapes(H,W[1])}this.addPaths(U,ee)}}H.shape.paths=ee}}},Di.prototype.addPaths=function(c,d){var p,m=c.length;for(p=0;p<m;p+=1)d.addShape(c[p])},Di.prototype.addSegment=function(c,d,p,m,x,S,T){x.setXYAt(d[0],d[1],"o",S),x.setXYAt(p[0],p[1],"i",S+1),T&&x.setXYAt(c[0],c[1],"v",S),x.setXYAt(m[0],m[1],"v",S+1)},Di.prototype.addSegmentFromArray=function(c,d,p,m){d.setXYAt(c[1],c[5],"o",p),d.setXYAt(c[2],c[6],"i",p+1),m&&d.setXYAt(c[0],c[4],"v",p),d.setXYAt(c[3],c[7],"v",p+1)},Di.prototype.addShapes=function(c,d,p){var m=c.pathsData,x=c.shape.paths.shapes,S,T=c.shape.paths._length,k,_,$=0,V,ie,R,j,W=[],H,ee=!0;for(p?(ie=p._length,H=p._length):(p=Bt.newElement(),ie=0,H=0),W.push(p),S=0;S<T;S+=1){for(R=m[S].lengths,p.c=x[S].c,_=x[S].c?R.length:R.length+1,k=1;k<_;k+=1)if(V=R[k-1],$+V.addedLength<d.s)$+=V.addedLength,p.c=!1;else if($>d.e){p.c=!1;break}else d.s<=$&&d.e>=$+V.addedLength?(this.addSegment(x[S].v[k-1],x[S].o[k-1],x[S].i[k],x[S].v[k],p,ie,ee),ee=!1):(j=Si.getNewSegment(x[S].v[k-1],x[S].v[k],x[S].o[k-1],x[S].i[k],(d.s-$)/V.addedLength,(d.e-$)/V.addedLength,R[k-1]),this.addSegmentFromArray(j,p,ie,ee),ee=!1,p.c=!1),$+=V.addedLength,ie+=1;if(x[S].c&&R.length){if(V=R[k-1],$<=d.e){var G=R[k-1].addedLength;d.s<=$&&d.e>=$+G?(this.addSegment(x[S].v[k-1],x[S].o[k-1],x[S].i[0],x[S].v[0],p,ie,ee),ee=!1):(j=Si.getNewSegment(x[S].v[k-1],x[S].v[0],x[S].o[k-1],x[S].i[0],(d.s-$)/G,(d.e-$)/G,R[k-1]),this.addSegmentFromArray(j,p,ie,ee),ee=!1,p.c=!1)}else p.c=!1;$+=V.addedLength,ie+=1}if(p._length&&(p.setXYAt(p.v[H][0],p.v[H][1],"i",H),p.setXYAt(p.v[p._length-1][0],p.v[p._length-1][1],"o",p._length-1)),$>d.e)break;S<T-1&&(p=Bt.newElement(),ee=!0,W.push(p),ie=0)}return W};function jn(){}f([xi],jn),jn.prototype.initModifierProperties=function(c,d){this.getValue=this.processKeys,this.amount=_e.getProp(c,d.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},jn.prototype.processPath=function(c,d){var p=d/100,m=[0,0],x=c._length,S=0;for(S=0;S<x;S+=1)m[0]+=c.v[S][0],m[1]+=c.v[S][1];m[0]/=x,m[1]/=x;var T=Bt.newElement();T.c=c.c;var k,_,$,V,ie,R;for(S=0;S<x;S+=1)k=c.v[S][0]+(m[0]-c.v[S][0])*p,_=c.v[S][1]+(m[1]-c.v[S][1])*p,$=c.o[S][0]+(m[0]-c.o[S][0])*-p,V=c.o[S][1]+(m[1]-c.o[S][1])*-p,ie=c.i[S][0]+(m[0]-c.i[S][0])*-p,R=c.i[S][1]+(m[1]-c.i[S][1])*-p,T.setTripleAt(k,_,$,V,ie,R,S);return T},jn.prototype.processShapes=function(c){var d,p,m=this.shapes.length,x,S,T=this.amount.v;if(T!==0){var k,_;for(p=0;p<m;p+=1){if(k=this.shapes[p],_=k.localShapeCollection,!(!k.shape._mdf&&!this._mdf&&!c))for(_.releaseShapes(),k.shape._mdf=!0,d=k.shape.paths.shapes,S=k.shape.paths._length,x=0;x<S;x+=1)_.addShape(this.processPath(d[x],T));k.shape.paths=k.localShapeCollection}}this.dynamicProperties.length||(this._mdf=!1)};var Pu=function(){var c=[0,0];function d(_){var $=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||$,this.a&&_.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&_.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&_.skewFromAxis(-this.sk.v,this.sa.v),this.r?_.rotate(-this.r.v):_.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.data.p.s?this.data.p.z?_.translate(this.px.v,this.py.v,-this.pz.v):_.translate(this.px.v,this.py.v,0):_.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}function p(_){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||_){var $;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.autoOriented){var V,ie;if($=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(V=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/$,0),ie=this.p.getValueAtTime(this.p.keyframes[0].t/$,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(V=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/$,0),ie=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/$,0)):(V=this.p.pv,ie=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/$,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){V=[],ie=[];var R=this.px,j=this.py;R._caching.lastFrame+R.offsetTime<=R.keyframes[0].t?(V[0]=R.getValueAtTime((R.keyframes[0].t+.01)/$,0),V[1]=j.getValueAtTime((j.keyframes[0].t+.01)/$,0),ie[0]=R.getValueAtTime(R.keyframes[0].t/$,0),ie[1]=j.getValueAtTime(j.keyframes[0].t/$,0)):R._caching.lastFrame+R.offsetTime>=R.keyframes[R.keyframes.length-1].t?(V[0]=R.getValueAtTime(R.keyframes[R.keyframes.length-1].t/$,0),V[1]=j.getValueAtTime(j.keyframes[j.keyframes.length-1].t/$,0),ie[0]=R.getValueAtTime((R.keyframes[R.keyframes.length-1].t-.01)/$,0),ie[1]=j.getValueAtTime((j.keyframes[j.keyframes.length-1].t-.01)/$,0)):(V=[R.pv,j.pv],ie[0]=R.getValueAtTime((R._caching.lastFrame+R.offsetTime-.01)/$,R.offsetTime),ie[1]=j.getValueAtTime((j._caching.lastFrame+j.offsetTime-.01)/$,j.offsetTime))}else ie=c,V=ie;this.v.rotate(-Math.atan2(V[1]-ie[1],V[0]-ie[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}}function m(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}function x(){}function S(_){this._addDynamicProperty(_),this.elem.addDynamicProperty(_),this._isDirty=!0}function T(_,$,V){if(this.elem=_,this.frameId=-1,this.propType="transform",this.data=$,this.v=new Te,this.pre=new Te,this.appliedTransformations=0,this.initDynamicPropertyContainer(V||_),$.p&&$.p.s?(this.px=_e.getProp(_,$.p.x,0,0,this),this.py=_e.getProp(_,$.p.y,0,0,this),$.p.z&&(this.pz=_e.getProp(_,$.p.z,0,0,this))):this.p=_e.getProp(_,$.p||{k:[0,0,0]},1,0,this),$.rx){if(this.rx=_e.getProp(_,$.rx,0,Q,this),this.ry=_e.getProp(_,$.ry,0,Q,this),this.rz=_e.getProp(_,$.rz,0,Q,this),$.or.k[0].ti){var ie,R=$.or.k.length;for(ie=0;ie<R;ie+=1)$.or.k[ie].to=null,$.or.k[ie].ti=null}this.or=_e.getProp(_,$.or,1,Q,this),this.or.sh=!0}else this.r=_e.getProp(_,$.r||{k:0},0,Q,this);$.sk&&(this.sk=_e.getProp(_,$.sk,0,Q,this),this.sa=_e.getProp(_,$.sa,0,Q,this)),this.a=_e.getProp(_,$.a||{k:[0,0,0]},1,0,this),this.s=_e.getProp(_,$.s||{k:[100,100,100]},1,.01,this),$.o?this.o=_e.getProp(_,$.o,0,.01,_):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}T.prototype={applyToMatrix:d,getValue:p,precalculateMatrix:m,autoOrient:x},f([It],T),T.prototype.addDynamicProperty=S,T.prototype._addDynamicProperty=It.prototype.addDynamicProperty;function k(_,$,V){return new T(_,$,V)}return{getTransformProperty:k}}();function Zi(){}f([xi],Zi),Zi.prototype.initModifierProperties=function(c,d){this.getValue=this.processKeys,this.c=_e.getProp(c,d.c,0,null,this),this.o=_e.getProp(c,d.o,0,null,this),this.tr=Pu.getTransformProperty(c,d.tr,this),this.so=_e.getProp(c,d.tr.so,0,.01,this),this.eo=_e.getProp(c,d.tr.eo,0,.01,this),this.data=d,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Te,this.rMatrix=new Te,this.sMatrix=new Te,this.tMatrix=new Te,this.matrix=new Te},Zi.prototype.applyTransforms=function(c,d,p,m,x,S){var T=S?-1:1,k=m.s.v[0]+(1-m.s.v[0])*(1-x),_=m.s.v[1]+(1-m.s.v[1])*(1-x);c.translate(m.p.v[0]*T*x,m.p.v[1]*T*x,m.p.v[2]),d.translate(-m.a.v[0],-m.a.v[1],m.a.v[2]),d.rotate(-m.r.v*T*x),d.translate(m.a.v[0],m.a.v[1],m.a.v[2]),p.translate(-m.a.v[0],-m.a.v[1],m.a.v[2]),p.scale(S?1/k:k,S?1/_:_),p.translate(m.a.v[0],m.a.v[1],m.a.v[2])},Zi.prototype.init=function(c,d,p,m){for(this.elem=c,this.arr=d,this.pos=p,this.elemsData=m,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(c),this.initModifierProperties(c,d[p]);p>0;)p-=1,this._elements.unshift(d[p]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},Zi.prototype.resetElements=function(c){var d,p=c.length;for(d=0;d<p;d+=1)c[d]._processed=!1,c[d].ty==="gr"&&this.resetElements(c[d].it)},Zi.prototype.cloneElements=function(c){var d=JSON.parse(JSON.stringify(c));return this.resetElements(d),d},Zi.prototype.changeGroupRender=function(c,d){var p,m=c.length;for(p=0;p<m;p+=1)c[p]._render=d,c[p].ty==="gr"&&this.changeGroupRender(c[p].it,d)},Zi.prototype.processShapes=function(c){var d,p,m,x,S,T=!1;if(this._mdf||c){var k=Math.ceil(this.c.v);if(this._groups.length<k){for(;this._groups.length<k;){var _={it:this.cloneElements(this._elements),ty:"gr"};_.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,_),this._groups.splice(0,0,_),this._currentCopies+=1}this.elem.reloadShapes(),T=!0}S=0;var $;for(m=0;m<=this._groups.length-1;m+=1){if($=S<k,this._groups[m]._render=$,this.changeGroupRender(this._groups[m].it,$),!$){var V=this.elemsData[m].it,ie=V[V.length-1];ie.transform.op.v!==0?(ie.transform.op._mdf=!0,ie.transform.op.v=0):ie.transform.op._mdf=!1}S+=1}this._currentCopies=k;var R=this.o.v,j=R%1,W=R>0?Math.floor(R):Math.ceil(R),H=this.pMatrix.props,ee=this.rMatrix.props,G=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var F=0;if(R>0){for(;F<W;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),F+=1;j&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,j,!1),F+=j)}else if(R<0){for(;F>W;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),F-=1;j&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-j,!0),F-=j)}m=this.data.m===1?0:this._currentCopies-1,x=this.data.m===1?1:-1,S=this._currentCopies;for(var I,P;S;){if(d=this.elemsData[m].it,p=d[d.length-1].transform.mProps.v.props,P=p.length,d[d.length-1].transform.mProps._mdf=!0,d[d.length-1].transform.op._mdf=!0,d[d.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(m/(this._currentCopies-1)),F!==0){for((m!==0&&x===1||m!==this._currentCopies-1&&x===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(ee[0],ee[1],ee[2],ee[3],ee[4],ee[5],ee[6],ee[7],ee[8],ee[9],ee[10],ee[11],ee[12],ee[13],ee[14],ee[15]),this.matrix.transform(G[0],G[1],G[2],G[3],G[4],G[5],G[6],G[7],G[8],G[9],G[10],G[11],G[12],G[13],G[14],G[15]),this.matrix.transform(H[0],H[1],H[2],H[3],H[4],H[5],H[6],H[7],H[8],H[9],H[10],H[11],H[12],H[13],H[14],H[15]),I=0;I<P;I+=1)p[I]=this.matrix.props[I];this.matrix.reset()}else for(this.matrix.reset(),I=0;I<P;I+=1)p[I]=this.matrix.props[I];F+=1,S-=1,m+=x}}else for(S=this._currentCopies,m=0,x=1;S;)d=this.elemsData[m].it,p=d[d.length-1].transform.mProps.v.props,d[d.length-1].transform.mProps._mdf=!1,d[d.length-1].transform.op._mdf=!1,S-=1,m+=x;return T},Zi.prototype.addShape=function(){};function Hn(){}f([xi],Hn),Hn.prototype.initModifierProperties=function(c,d){this.getValue=this.processKeys,this.rd=_e.getProp(c,d.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},Hn.prototype.processPath=function(c,d){var p=Bt.newElement();p.c=c.c;var m,x=c._length,S,T,k,_,$,V,ie=0,R,j,W,H,ee,G;for(m=0;m<x;m+=1)S=c.v[m],k=c.o[m],T=c.i[m],S[0]===k[0]&&S[1]===k[1]&&S[0]===T[0]&&S[1]===T[1]?(m===0||m===x-1)&&!c.c?(p.setTripleAt(S[0],S[1],k[0],k[1],T[0],T[1],ie),ie+=1):(m===0?_=c.v[x-1]:_=c.v[m-1],$=Math.sqrt(Math.pow(S[0]-_[0],2)+Math.pow(S[1]-_[1],2)),V=$?Math.min($/2,d)/$:0,ee=S[0]+(_[0]-S[0])*V,R=ee,G=S[1]-(S[1]-_[1])*V,j=G,W=R-(R-S[0])*q,H=j-(j-S[1])*q,p.setTripleAt(R,j,W,H,ee,G,ie),ie+=1,m===x-1?_=c.v[0]:_=c.v[m+1],$=Math.sqrt(Math.pow(S[0]-_[0],2)+Math.pow(S[1]-_[1],2)),V=$?Math.min($/2,d)/$:0,W=S[0]+(_[0]-S[0])*V,R=W,H=S[1]+(_[1]-S[1])*V,j=H,ee=R-(R-S[0])*q,G=j-(j-S[1])*q,p.setTripleAt(R,j,W,H,ee,G,ie),ie+=1):(p.setTripleAt(c.v[m][0],c.v[m][1],c.o[m][0],c.o[m][1],c.i[m][0],c.i[m][1],ie),ie+=1);return p},Hn.prototype.processShapes=function(c){var d,p,m=this.shapes.length,x,S,T=this.rd.v;if(T!==0){var k,_;for(p=0;p<m;p+=1){if(k=this.shapes[p],_=k.localShapeCollection,!(!k.shape._mdf&&!this._mdf&&!c))for(_.releaseShapes(),k.shape._mdf=!0,d=k.shape.paths.shapes,S=k.shape.paths._length,x=0;x<S;x+=1)_.addShape(this.processPath(d[x],T));k.shape.paths=k.localShapeCollection}}this.dynamicProperties.length||(this._mdf=!1)};function Eo(c,d){return Math.abs(c-d)*1e5<=Math.min(Math.abs(c),Math.abs(d))}function ku(c){return Math.abs(c)<=1e-5}function m0(c,d,p){return c*(1-p)+d*p}function Dr(c,d,p){return[m0(c[0],d[0],p),m0(c[1],d[1],p)]}function fR(c,d,p){if(c===0)return[];var m=d*d-4*c*p;if(m<0)return[];var x=-d/(2*c);if(m===0)return[x];var S=Math.sqrt(m)/(2*c);return[x-S,x+S]}function v0(c,d,p,m){return[-c+3*d-3*p+m,3*c-6*d+3*p,-3*c+3*d,c]}function y0(c){return new Ct(c,c,c,c,!1)}function Ct(c,d,p,m,x){x&&Ks(c,d)&&(d=Dr(c,m,1/3)),x&&Ks(p,m)&&(p=Dr(c,m,2/3));var S=v0(c[0],d[0],p[0],m[0]),T=v0(c[1],d[1],p[1],m[1]);this.a=[S[0],T[0]],this.b=[S[1],T[1]],this.c=[S[2],T[2]],this.d=[S[3],T[3]],this.points=[c,d,p,m]}Ct.prototype.point=function(c){return[((this.a[0]*c+this.b[0])*c+this.c[0])*c+this.d[0],((this.a[1]*c+this.b[1])*c+this.c[1])*c+this.d[1]]},Ct.prototype.derivative=function(c){return[(3*c*this.a[0]+2*this.b[0])*c+this.c[0],(3*c*this.a[1]+2*this.b[1])*c+this.c[1]]},Ct.prototype.tangentAngle=function(c){var d=this.derivative(c);return Math.atan2(d[1],d[0])},Ct.prototype.normalAngle=function(c){var d=this.derivative(c);return Math.atan2(d[0],d[1])},Ct.prototype.inflectionPoints=function(){var c=this.a[1]*this.b[0]-this.a[0]*this.b[1];if(ku(c))return[];var d=-.5*(this.a[1]*this.c[0]-this.a[0]*this.c[1])/c,p=d*d-1/3*(this.b[1]*this.c[0]-this.b[0]*this.c[1])/c;if(p<0)return[];var m=Math.sqrt(p);return ku(m)?m>0&&m<1?[d]:[]:[d-m,d+m].filter(function(x){return x>0&&x<1})},Ct.prototype.split=function(c){if(c<=0)return[y0(this.points[0]),this];if(c>=1)return[this,y0(this.points[this.points.length-1])];var d=Dr(this.points[0],this.points[1],c),p=Dr(this.points[1],this.points[2],c),m=Dr(this.points[2],this.points[3],c),x=Dr(d,p,c),S=Dr(p,m,c),T=Dr(x,S,c);return[new Ct(this.points[0],d,x,T,!0),new Ct(T,S,m,this.points[3],!0)]};function S0(c,d){var p=c.points[0][d],m=c.points[c.points.length-1][d];if(p>m){var x=m;m=p,p=x}for(var S=fR(3*c.a[d],2*c.b[d],c.c[d]),T=0;T<S.length;T+=1)if(S[T]>0&&S[T]<1){var k=c.point(S[T])[d];k<p?p=k:k>m&&(m=k)}return{min:p,max:m}}Ct.prototype.bounds=function(){return{x:S0(this,0),y:S0(this,1)}},Ct.prototype.boundingBox=function(){var c=this.bounds();return{left:c.x.min,right:c.x.max,top:c.y.min,bottom:c.y.max,width:c.x.max-c.x.min,height:c.y.max-c.y.min,cx:(c.x.max+c.x.min)/2,cy:(c.y.max+c.y.min)/2}};function wo(c,d,p){var m=c.boundingBox();return{cx:m.cx,cy:m.cy,width:m.width,height:m.height,bez:c,t:(d+p)/2,t1:d,t2:p}}function x0(c){var d=c.bez.split(.5);return[wo(d[0],c.t1,c.t),wo(d[1],c.t,c.t2)]}function pR(c,d){return Math.abs(c.cx-d.cx)*2<c.width+d.width&&Math.abs(c.cy-d.cy)*2<c.height+d.height}function Kn(c,d,p,m,x,S){if(pR(c,d)){if(p>=S||c.width<=m&&c.height<=m&&d.width<=m&&d.height<=m){x.push([c.t,d.t]);return}var T=x0(c),k=x0(d);Kn(T[0],k[0],p+1,m,x,S),Kn(T[0],k[1],p+1,m,x,S),Kn(T[1],k[0],p+1,m,x,S),Kn(T[1],k[1],p+1,m,x,S)}}Ct.prototype.intersections=function(c,d,p){d===void 0&&(d=2),p===void 0&&(p=7);var m=[];return Kn(wo(this,0,1),wo(c,0,1),0,d,m,p),m},Ct.shapeSegment=function(c,d){var p=(d+1)%c.length();return new Ct(c.v[d],c.o[d],c.i[p],c.v[p],!0)},Ct.shapeSegmentInverted=function(c,d){var p=(d+1)%c.length();return new Ct(c.v[p],c.i[p],c.o[d],c.v[d],!0)};function Du(c,d){return[c[1]*d[2]-c[2]*d[1],c[2]*d[0]-c[0]*d[2],c[0]*d[1]-c[1]*d[0]]}function To(c,d,p,m){var x=[c[0],c[1],1],S=[d[0],d[1],1],T=[p[0],p[1],1],k=[m[0],m[1],1],_=Du(Du(x,S),Du(T,k));return ku(_[2])?null:[_[0]/_[2],_[1]/_[2]]}function Hs(c,d,p){return[c[0]+Math.cos(d)*p,c[1]-Math.sin(d)*p]}function Ou(c,d){return Math.hypot(c[0]-d[0],c[1]-d[1])}function Ks(c,d){return Eo(c[0],d[0])&&Eo(c[1],d[1])}function zn(){}f([xi],zn),zn.prototype.initModifierProperties=function(c,d){this.getValue=this.processKeys,this.amplitude=_e.getProp(c,d.s,0,null,this),this.frequency=_e.getProp(c,d.r,0,null,this),this.pointsType=_e.getProp(c,d.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0};function b0(c,d,p,m,x,S,T){var k=p-Math.PI/2,_=p+Math.PI/2,$=d[0]+Math.cos(p)*m*x,V=d[1]-Math.sin(p)*m*x;c.setTripleAt($,V,$+Math.cos(k)*S,V-Math.sin(k)*S,$+Math.cos(_)*T,V-Math.sin(_)*T,c.length())}function gR(c,d){var p=[d[0]-c[0],d[1]-c[1]],m=-Math.PI*.5,x=[Math.cos(m)*p[0]-Math.sin(m)*p[1],Math.sin(m)*p[0]+Math.cos(m)*p[1]];return x}function mR(c,d){var p=d===0?c.length()-1:d-1,m=(d+1)%c.length(),x=c.v[p],S=c.v[m],T=gR(x,S);return Math.atan2(0,1)-Math.atan2(T[1],T[0])}function E0(c,d,p,m,x,S,T){var k=mR(d,p),_=d.v[p%d._length],$=d.v[p===0?d._length-1:p-1],V=d.v[(p+1)%d._length],ie=S===2?Math.sqrt(Math.pow(_[0]-$[0],2)+Math.pow(_[1]-$[1],2)):0,R=S===2?Math.sqrt(Math.pow(_[0]-V[0],2)+Math.pow(_[1]-V[1],2)):0;b0(c,d.v[p%d._length],k,T,m,R/((x+1)*2),ie/((x+1)*2))}function vR(c,d,p,m,x,S){for(var T=0;T<m;T+=1){var k=(T+1)/(m+1),_=x===2?Math.sqrt(Math.pow(d.points[3][0]-d.points[0][0],2)+Math.pow(d.points[3][1]-d.points[0][1],2)):0,$=d.normalAngle(k),V=d.point(k);b0(c,V,$,S,p,_/((m+1)*2),_/((m+1)*2)),S=-S}return S}zn.prototype.processPath=function(c,d,p,m){var x=c._length,S=Bt.newElement();if(S.c=c.c,c.c||(x-=1),x===0)return S;var T=-1,k=Ct.shapeSegment(c,0);E0(S,c,0,d,p,m,T);for(var _=0;_<x;_+=1)T=vR(S,k,d,p,m,-T),_===x-1&&!c.c?k=null:k=Ct.shapeSegment(c,(_+1)%x),E0(S,c,_+1,d,p,m,T);return S},zn.prototype.processShapes=function(c){var d,p,m=this.shapes.length,x,S,T=this.amplitude.v,k=Math.max(0,Math.round(this.frequency.v)),_=this.pointsType.v;if(T!==0){var $,V;for(p=0;p<m;p+=1){if($=this.shapes[p],V=$.localShapeCollection,!(!$.shape._mdf&&!this._mdf&&!c))for(V.releaseShapes(),$.shape._mdf=!0,d=$.shape.paths.shapes,S=$.shape.paths._length,x=0;x<S;x+=1)V.addShape(this.processPath(d[x],T,k,_));$.shape.paths=$.localShapeCollection}}this.dynamicProperties.length||(this._mdf=!1)};function Mu(c,d,p){var m=Math.atan2(d[0]-c[0],d[1]-c[1]);return[Hs(c,m,p),Hs(d,m,p)]}function zs(c,d){var p,m,x,S,T,k,_;_=Mu(c.points[0],c.points[1],d),p=_[0],m=_[1],_=Mu(c.points[1],c.points[2],d),x=_[0],S=_[1],_=Mu(c.points[2],c.points[3],d),T=_[0],k=_[1];var $=To(p,m,x,S);$===null&&($=m);var V=To(T,k,x,S);return V===null&&(V=T),new Ct(p,$,V,k)}function w0(c,d,p,m,x){var S=d.points[3],T=p.points[0];if(m===3||Ks(S,T))return S;if(m===2){var k=-d.tangentAngle(1),_=-p.tangentAngle(0)+Math.PI,$=To(S,Hs(S,k+Math.PI/2,100),T,Hs(T,k+Math.PI/2,100)),V=$?Ou($,S):Ou(S,T)/2,ie=Hs(S,k,2*V*q);return c.setXYAt(ie[0],ie[1],"o",c.length()-1),ie=Hs(T,_,2*V*q),c.setTripleAt(T[0],T[1],T[0],T[1],ie[0],ie[1],c.length()),T}var R=Ks(S,d.points[2])?d.points[0]:d.points[2],j=Ks(T,p.points[1])?p.points[3]:p.points[1],W=To(R,S,T,j);return W&&Ou(W,S)<x?(c.setTripleAt(W[0],W[1],W[0],W[1],W[0],W[1],c.length()),W):S}function T0(c,d){var p=c.intersections(d);return p.length&&Eo(p[0][0],1)&&p.shift(),p.length?p[0]:null}function A0(c,d){var p=c.slice(),m=d.slice(),x=T0(c[c.length-1],d[0]);return x&&(p[c.length-1]=c[c.length-1].split(x[0])[0],m[0]=d[0].split(x[1])[1]),c.length>1&&d.length>1&&(x=T0(c[0],d[d.length-1]),x)?[[c[0].split(x[0])[0]],[d[d.length-1].split(x[1])[1]]]:[p,m]}function yR(c){for(var d,p=1;p<c.length;p+=1)d=A0(c[p-1],c[p]),c[p-1]=d[0],c[p]=d[1];return c.length>1&&(d=A0(c[c.length-1],c[0]),c[c.length-1]=d[0],c[0]=d[1]),c}function _0(c,d){var p=c.inflectionPoints(),m,x,S,T;if(p.length===0)return[zs(c,d)];if(p.length===1||Eo(p[1],1))return S=c.split(p[0]),m=S[0],x=S[1],[zs(m,d),zs(x,d)];S=c.split(p[0]),m=S[0];var k=(p[1]-p[0])/(1-p[0]);return S=S[1].split(k),T=S[0],x=S[1],[zs(m,d),zs(T,d),zs(x,d)]}function Wn(){}f([xi],Wn),Wn.prototype.initModifierProperties=function(c,d){this.getValue=this.processKeys,this.amount=_e.getProp(c,d.a,0,null,this),this.miterLimit=_e.getProp(c,d.ml,0,null,this),this.lineJoin=d.lj,this._isAnimated=this.amount.effectsSequence.length!==0},Wn.prototype.processPath=function(c,d,p,m){var x=Bt.newElement();x.c=c.c;var S=c.length();c.c||(S-=1);var T,k,_,$=[];for(T=0;T<S;T+=1)_=Ct.shapeSegment(c,T),$.push(_0(_,d));if(!c.c)for(T=S-1;T>=0;T-=1)_=Ct.shapeSegmentInverted(c,T),$.push(_0(_,d));$=yR($);var V=null,ie=null;for(T=0;T<$.length;T+=1){var R=$[T];for(ie&&(V=w0(x,ie,R[0],p,m)),ie=R[R.length-1],k=0;k<R.length;k+=1)_=R[k],V&&Ks(_.points[0],V)?x.setXYAt(_.points[1][0],_.points[1][1],"o",x.length()-1):x.setTripleAt(_.points[0][0],_.points[0][1],_.points[1][0],_.points[1][1],_.points[0][0],_.points[0][1],x.length()),x.setTripleAt(_.points[3][0],_.points[3][1],_.points[3][0],_.points[3][1],_.points[2][0],_.points[2][1],x.length()),V=_.points[3]}return $.length&&w0(x,ie,$[0][0],p,m),x},Wn.prototype.processShapes=function(c){var d,p,m=this.shapes.length,x,S,T=this.amount.v,k=this.miterLimit.v,_=this.lineJoin;if(T!==0){var $,V;for(p=0;p<m;p+=1){if($=this.shapes[p],V=$.localShapeCollection,!(!$.shape._mdf&&!this._mdf&&!c))for(V.releaseShapes(),$.shape._mdf=!0,d=$.shape.paths.shapes,S=$.shape.paths._length,x=0;x<S;x+=1)V.addShape(this.processPath(d[x],T,_,k));$.shape.paths=$.localShapeCollection}}this.dynamicProperties.length||(this._mdf=!1)};function C0(c){for(var d=c.fStyle?c.fStyle.split(" "):[],p="normal",m="normal",x=d.length,S,T=0;T<x;T+=1)switch(S=d[T].toLowerCase(),S){case"italic":m="italic";break;case"bold":p="700";break;case"black":p="900";break;case"medium":p="500";break;case"regular":case"normal":p="400";break;case"light":case"thin":p="200";break}return{style:m,weight:c.fWeight||p}}var cs=function(){var c=5e3,d={w:0,size:0,shapes:[],data:{shapes:[]}},p=[];p=p.concat([2304,2305,2306,2307,2362,2363,2364,2364,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2387,2388,2389,2390,2391,2402,2403]);var m=127988,x=917631,S=917601,T=917626,k=65039,_=8205,$=127462,V=127487,ie=["d83cdffb","d83cdffc","d83cdffd","d83cdffe","d83cdfff"];function R(O){var K=O.split(","),w,L=K.length,ne=[];for(w=0;w<L;w+=1)K[w]!=="sans-serif"&&K[w]!=="monospace"&&ne.push(K[w]);return ne.join(",")}function j(O,K){var w=h("span");w.setAttribute("aria-hidden",!0),w.style.fontFamily=K;var L=h("span");L.innerText="giItT1WQy@!-/#",w.style.position="absolute",w.style.left="-10000px",w.style.top="-10000px",w.style.fontSize="300px",w.style.fontVariant="normal",w.style.fontStyle="normal",w.style.fontWeight="normal",w.style.letterSpacing="0",w.appendChild(L),document.body.appendChild(w);var ne=L.offsetWidth;return L.style.fontFamily=R(O)+", "+K,{node:L,w:ne,parent:w}}function W(){var O,K=this.fonts.length,w,L,ne=K;for(O=0;O<K;O+=1)this.fonts[O].loaded?ne-=1:this.fonts[O].fOrigin==="n"||this.fonts[O].origin===0?this.fonts[O].loaded=!0:(w=this.fonts[O].monoCase.node,L=this.fonts[O].monoCase.w,w.offsetWidth!==L?(ne-=1,this.fonts[O].loaded=!0):(w=this.fonts[O].sansCase.node,L=this.fonts[O].sansCase.w,w.offsetWidth!==L&&(ne-=1,this.fonts[O].loaded=!0)),this.fonts[O].loaded&&(this.fonts[O].sansCase.parent.parentNode.removeChild(this.fonts[O].sansCase.parent),this.fonts[O].monoCase.parent.parentNode.removeChild(this.fonts[O].monoCase.parent)));ne!==0&&Date.now()-this.initTime<c?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)}function H(O,K){var w=document.body&&K?"svg":"canvas",L,ne=C0(O);if(w==="svg"){var X=ke("text");X.style.fontSize="100px",X.setAttribute("font-family",O.fFamily),X.setAttribute("font-style",ne.style),X.setAttribute("font-weight",ne.weight),X.textContent="1",O.fClass?(X.style.fontFamily="inherit",X.setAttribute("class",O.fClass)):X.style.fontFamily=O.fFamily,K.appendChild(X),L=X}else{var Le=new OffscreenCanvas(500,500).getContext("2d");Le.font=ne.style+" "+ne.weight+" 100px "+O.fFamily,L=Le}function Be(ze){return w==="svg"?(L.textContent=ze,L.getComputedTextLength()):L.measureText(ze).width}return{measureText:Be}}function ee(O,K){if(!O){this.isLoaded=!0;return}if(this.chars){this.isLoaded=!0,this.fonts=O.list;return}if(!document.body){this.isLoaded=!0,O.list.forEach(function(ii){ii.helper=H(ii),ii.cache={}}),this.fonts=O.list;return}var w=O.list,L,ne=w.length,X=ne;for(L=0;L<ne;L+=1){var Le=!0,Be,ze;if(w[L].loaded=!1,w[L].monoCase=j(w[L].fFamily,"monospace"),w[L].sansCase=j(w[L].fFamily,"sans-serif"),!w[L].fPath)w[L].loaded=!0,X-=1;else if(w[L].fOrigin==="p"||w[L].origin===3){if(Be=document.querySelectorAll('style[f-forigin="p"][f-family="'+w[L].fFamily+'"], style[f-origin="3"][f-family="'+w[L].fFamily+'"]'),Be.length>0&&(Le=!1),Le){var at=h("style");at.setAttribute("f-forigin",w[L].fOrigin),at.setAttribute("f-origin",w[L].origin),at.setAttribute("f-family",w[L].fFamily),at.type="text/css",at.innerText="@font-face {font-family: "+w[L].fFamily+"; font-style: normal; src: url('"+w[L].fPath+"');}",K.appendChild(at)}}else if(w[L].fOrigin==="g"||w[L].origin===1){for(Be=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),ze=0;ze<Be.length;ze+=1)Be[ze].href.indexOf(w[L].fPath)!==-1&&(Le=!1);if(Le){var ot=h("link");ot.setAttribute("f-forigin",w[L].fOrigin),ot.setAttribute("f-origin",w[L].origin),ot.type="text/css",ot.rel="stylesheet",ot.href=w[L].fPath,document.body.appendChild(ot)}}else if(w[L].fOrigin==="t"||w[L].origin===2){for(Be=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),ze=0;ze<Be.length;ze+=1)w[L].fPath===Be[ze].src&&(Le=!1);if(Le){var Dt=h("link");Dt.setAttribute("f-forigin",w[L].fOrigin),Dt.setAttribute("f-origin",w[L].origin),Dt.setAttribute("rel","stylesheet"),Dt.setAttribute("href",w[L].fPath),K.appendChild(Dt)}}w[L].helper=H(w[L],K),w[L].cache={},this.fonts.push(w[L])}X===0?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}function G(O){if(O){this.chars||(this.chars=[]);var K,w=O.length,L,ne=this.chars.length,X;for(K=0;K<w;K+=1){for(L=0,X=!1;L<ne;)this.chars[L].style===O[K].style&&this.chars[L].fFamily===O[K].fFamily&&this.chars[L].ch===O[K].ch&&(X=!0),L+=1;X||(this.chars.push(O[K]),ne+=1)}}}function F(O,K,w){for(var L=0,ne=this.chars.length;L<ne;){if(this.chars[L].ch===O&&this.chars[L].style===K&&this.chars[L].fFamily===w)return this.chars[L];L+=1}return(typeof O=="string"&&O.charCodeAt(0)!==13||!O)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",O,K,w)),d}function I(O,K,w){var L=this.getFontByName(K),ne=O;if(!L.cache[ne]){var X=L.helper;if(O===" "){var Le=X.measureText("|"+O+"|"),Be=X.measureText("||");L.cache[ne]=(Le-Be)/100}else L.cache[ne]=X.measureText(O)/100}return L.cache[ne]*w}function P(O){for(var K=0,w=this.fonts.length;K<w;){if(this.fonts[K].fName===O)return this.fonts[K];K+=1}return this.fonts[0]}function U(O){var K=0,w=O.charCodeAt(0);if(w>=55296&&w<=56319){var L=O.charCodeAt(1);L>=56320&&L<=57343&&(K=(w-55296)*1024+L-56320+65536)}return K}function Y(O,K){var w=O.toString(16)+K.toString(16);return ie.indexOf(w)!==-1}function te(O){return O===_}function ae(O){return O===k}function xe(O){var K=U(O);return K>=$&&K<=V}function Ke(O){return xe(O.substr(0,2))&&xe(O.substr(2,2))}function De(O){return p.indexOf(O)!==-1}function Ae(O,K){var w=U(O.substr(K,2));if(w!==m)return!1;var L=0;for(K+=2;L<5;){if(w=U(O.substr(K,2)),w<S||w>T)return!1;L+=1,K+=2}return U(O.substr(K,2))===x}function Ye(){this.isLoaded=!0}var Re=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};Re.isModifier=Y,Re.isZeroWidthJoiner=te,Re.isFlagEmoji=Ke,Re.isRegionalCode=xe,Re.isCombinedCharacter=De,Re.isRegionalFlag=Ae,Re.isVariationSelector=ae,Re.BLACK_FLAG_CODE_POINT=m;var ye={addChars:G,addFonts:ee,getCharData:F,getFontByName:P,measureText:I,checkLoadedFonts:W,setIsLoaded:Ye};return Re.prototype=ye,Re}();function L0(c){this.animationData=c}L0.prototype.getProp=function(c){return this.animationData.slots&&this.animationData.slots[c.sid]?Object.assign(c,this.animationData.slots[c.sid].p):c};function SR(c){return new L0(c)}function Ao(){}Ao.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(d){this.renderableComponents.indexOf(d)===-1&&this.renderableComponents.push(d)},removeRenderableComponent:function(d){this.renderableComponents.indexOf(d)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(d),1)},prepareRenderableFrame:function(d){this.checkLayerLimits(d)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(d){this.data.ip-this.data.st<=d&&this.data.op-this.data.st>d?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var d,p=this.renderableComponents.length;for(d=0;d<p;d+=1)this.renderableComponents[d].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return this.data.ty===5?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}};var Fu=function(){var c={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"};return function(d){return c[d]||""}}();function xR(c,d,p){this.p=_e.getProp(d,c.v,0,0,p)}function bR(c,d,p){this.p=_e.getProp(d,c.v,0,0,p)}function ER(c,d,p){this.p=_e.getProp(d,c.v,1,0,p)}function wR(c,d,p){this.p=_e.getProp(d,c.v,1,0,p)}function TR(c,d,p){this.p=_e.getProp(d,c.v,0,0,p)}function AR(c,d,p){this.p=_e.getProp(d,c.v,0,0,p)}function _R(c,d,p){this.p=_e.getProp(d,c.v,0,0,p)}function CR(){this.p={}}function I0(c,d){var p=c.ef||[];this.effectElements=[];var m,x=p.length,S;for(m=0;m<x;m+=1)S=new qn(p[m],d),this.effectElements.push(S)}function qn(c,d){this.init(c,d)}f([It],qn),qn.prototype.getValue=qn.prototype.iterateDynamicProperties,qn.prototype.init=function(c,d){this.data=c,this.effectElements=[],this.initDynamicPropertyContainer(d);var p,m=this.data.ef.length,x,S=this.data.ef;for(p=0;p<m;p+=1){switch(x=null,S[p].ty){case 0:x=new xR(S[p],d,this);break;case 1:x=new bR(S[p],d,this);break;case 2:x=new ER(S[p],d,this);break;case 3:x=new wR(S[p],d,this);break;case 4:case 7:x=new _R(S[p],d,this);break;case 10:x=new TR(S[p],d,this);break;case 11:x=new AR(S[p],d,this);break;case 5:x=new I0(S[p],d);break;default:x=new CR(S[p]);break}x&&this.effectElements.push(x)}};function Or(){}Or.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var d=0,p=this.data.masksProperties.length;d<p;){if(this.data.masksProperties[d].mode!=="n"&&this.data.masksProperties[d].cl!==!1)return!0;d+=1}return!1},initExpressions:function(){},setBlendMode:function(){var d=Fu(this.data.bm),p=this.baseElement||this.layerElement;p.style["mix-blend-mode"]=d},initBaseData:function(d,p,m){this.globalData=p,this.comp=m,this.data=d,this.layerId=Ce(),this.data.sr||(this.data.sr=1),this.effectsManager=new I0(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}};function Mr(){}Mr.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(d,p){var m,x=this.dynamicProperties.length;for(m=0;m<x;m+=1)(p||this._isParent&&this.dynamicProperties[m].propType==="transform")&&(this.dynamicProperties[m].getValue(),this.dynamicProperties[m]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(d){this.dynamicProperties.indexOf(d)===-1&&this.dynamicProperties.push(d)}};function Fr(c,d,p){this.initFrame(),this.initRenderable(),this.assetData=d.getAssetData(c.refId),this.footageData=d.imageLoader.getAsset(this.assetData),this.initBaseData(c,d,p)}Fr.prototype.prepareFrame=function(){},f([Ao,Or,Mr],Fr),Fr.prototype.getBaseElement=function(){return null},Fr.prototype.renderFrame=function(){},Fr.prototype.destroy=function(){},Fr.prototype.initExpressions=function(){},Fr.prototype.getFootageData=function(){return this.footageData};function ti(c,d,p){this.initFrame(),this.initRenderable(),this.assetData=d.getAssetData(c.refId),this.initBaseData(c,d,p),this._isPlaying=!1,this._canPlay=!1;var m=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(m),this._currentTime=0,this.globalData.audioController.addAudio(this),this._volumeMultiplier=1,this._volume=1,this._previousVolume=null,this.tm=c.tm?_e.getProp(this,c.tm,0,d.frameRate,this):{_placeholder:!0},this.lv=_e.getProp(this,c.au&&c.au.lv?c.au.lv:{k:[100]},1,.01,this)}ti.prototype.prepareFrame=function(c){if(this.prepareRenderableFrame(c,!0),this.prepareProperties(c,!0),this.tm._placeholder)this._currentTime=c/this.data.sr;else{var d=this.tm.v;this._currentTime=d}this._volume=this.lv.v[0];var p=this._volume*this._volumeMultiplier;this._previousVolume!==p&&(this._previousVolume=p,this.audio.volume(p))},f([Ao,Or,Mr],ti),ti.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek())>.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},ti.prototype.show=function(){},ti.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},ti.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},ti.prototype.resume=function(){this._canPlay=!0},ti.prototype.setRate=function(c){this.audio.rate(c)},ti.prototype.volume=function(c){this._volumeMultiplier=c,this._previousVolume=c*this._volume,this.audio.volume(this._previousVolume)},ti.prototype.getBaseElement=function(){return null},ti.prototype.destroy=function(){},ti.prototype.sourceRectAtTime=function(){},ti.prototype.initExpressions=function(){};function Wt(){}Wt.prototype.checkLayers=function(c){var d,p=this.layers.length,m;for(this.completeLayers=!0,d=p-1;d>=0;d-=1)this.elements[d]||(m=this.layers[d],m.ip-m.st<=c-this.layers[d].st&&m.op-m.st>c-this.layers[d].st&&this.buildItem(d)),this.completeLayers=this.elements[d]?this.completeLayers:!1;this.checkPendingElements()},Wt.prototype.createItem=function(c){switch(c.ty){case 2:return this.createImage(c);case 0:return this.createComp(c);case 1:return this.createSolid(c);case 3:return this.createNull(c);case 4:return this.createShape(c);case 5:return this.createText(c);case 6:return this.createAudio(c);case 13:return this.createCamera(c);case 15:return this.createFootage(c);default:return this.createNull(c)}},Wt.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},Wt.prototype.createAudio=function(c){return new ti(c,this.globalData,this)},Wt.prototype.createFootage=function(c){return new Fr(c,this.globalData,this)},Wt.prototype.buildAllItems=function(){var c,d=this.layers.length;for(c=0;c<d;c+=1)this.buildItem(c);this.checkPendingElements()},Wt.prototype.includeLayers=function(c){this.completeLayers=!1;var d,p=c.length,m,x=this.layers.length;for(d=0;d<p;d+=1)for(m=0;m<x;){if(this.layers[m].id===c[d].id){this.layers[m]=c[d];break}m+=1}},Wt.prototype.setProjectInterface=function(c){this.globalData.projectInterface=c},Wt.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},Wt.prototype.buildElementParenting=function(c,d,p){for(var m=this.elements,x=this.layers,S=0,T=x.length;S<T;)x[S].ind==d&&(!m[S]||m[S]===!0?(this.buildItem(S),this.addPendingElement(c)):(p.push(m[S]),m[S].setAsParent(),x[S].parent!==void 0?this.buildElementParenting(c,x[S].parent,p):c.setHierarchy(p))),S+=1},Wt.prototype.addPendingElement=function(c){this.pendingElements.push(c)},Wt.prototype.searchExtraCompositions=function(c){var d,p=c.length;for(d=0;d<p;d+=1)if(c[d].xt){var m=this.createComp(c[d]);m.initExpressions(),this.globalData.projectInterface.registerComposition(m)}},Wt.prototype.getElementById=function(c){var d,p=this.elements.length;for(d=0;d<p;d+=1)if(this.elements[d].data.ind===c)return this.elements[d];return null},Wt.prototype.getElementByPath=function(c){var d=c.shift(),p;if(typeof d=="number")p=this.elements[d];else{var m,x=this.elements.length;for(m=0;m<x;m+=1)if(this.elements[m].data.nm===d){p=this.elements[m];break}}return c.length===0?p:p.getElementByPath(c)},Wt.prototype.setupGlobalData=function(c,d){this.globalData.fontManager=new cs,this.globalData.slotManager=SR(c),this.globalData.fontManager.addChars(c.chars),this.globalData.fontManager.addFonts(c.fonts,d),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=c.fr,this.globalData.nm=c.nm,this.globalData.compSize={w:c.w,h:c.h}};var LR={TRANSFORM_EFFECT:"transformEFfect"};function Ws(){}Ws.prototype={initTransform:function(){var d=new Te;this.finalTransform={mProp:this.data.ks?Pu.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_localMatMdf:!1,_opMdf:!1,mat:d,localMat:d,localOpacity:1},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var d,p=this.finalTransform.mat,m=0,x=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;m<x;){if(this.hierarchy[m].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}m+=1}if(this.finalTransform._matMdf)for(d=this.finalTransform.mProp.v.props,p.cloneFromProps(d),m=0;m<x;m+=1)p.multiply(this.hierarchy[m].finalTransform.mProp.v)}this.finalTransform._matMdf&&(this.finalTransform._localMatMdf=this.finalTransform._matMdf),this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v)},renderLocalTransform:function(){if(this.localTransforms){var d=0,p=this.localTransforms.length;if(this.finalTransform._localMatMdf=this.finalTransform._matMdf,!this.finalTransform._localMatMdf||!this.finalTransform._opMdf)for(;d<p;)this.localTransforms[d]._mdf&&(this.finalTransform._localMatMdf=!0),this.localTransforms[d]._opMdf&&!this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v,this.finalTransform._opMdf=!0),d+=1;if(this.finalTransform._localMatMdf){var m=this.finalTransform.localMat;for(this.localTransforms[0].matrix.clone(m),d=1;d<p;d+=1){var x=this.localTransforms[d].matrix;m.multiply(x)}m.multiply(this.finalTransform.mat)}if(this.finalTransform._opMdf){var S=this.finalTransform.localOpacity;for(d=0;d<p;d+=1)S*=this.localTransforms[d].opacity*.01;this.finalTransform.localOpacity=S}}},searchEffectTransforms:function(){if(this.renderableEffectsManager){var d=this.renderableEffectsManager.getEffects(LR.TRANSFORM_EFFECT);if(d.length){this.localTransforms=[],this.finalTransform.localMat=new Te;var p=0,m=d.length;for(p=0;p<m;p+=1)this.localTransforms.push(d[p])}}},globalToLocal:function(d){var p=[];p.push(this.finalTransform);for(var m=!0,x=this.comp;m;)x.finalTransform?(x.data.hasMask&&p.splice(0,0,x.finalTransform),x=x.comp):m=!1;var S,T=p.length,k;for(S=0;S<T;S+=1)k=p[S].mat.applyToPointArray(0,0,0),d=[d[0]-k[0],d[1]-k[1],0];return d},mHelper:new Te};function us(c,d,p){this.data=c,this.element=d,this.globalData=p,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var m=this.globalData.defs,x,S=this.masksProperties?this.masksProperties.length:0;this.viewData=b(S),this.solidPath="";var T,k=this.masksProperties,_=0,$=[],V,ie,R=Ce(),j,W,H,ee,G="clipPath",F="clip-path";for(x=0;x<S;x+=1)if((k[x].mode!=="a"&&k[x].mode!=="n"||k[x].inv||k[x].o.k!==100||k[x].o.x)&&(G="mask",F="mask"),(k[x].mode==="s"||k[x].mode==="i")&&_===0?(j=ke("rect"),j.setAttribute("fill","#ffffff"),j.setAttribute("width",this.element.comp.data.w||0),j.setAttribute("height",this.element.comp.data.h||0),$.push(j)):j=null,T=ke("path"),k[x].mode==="n")this.viewData[x]={op:_e.getProp(this.element,k[x].o,0,.01,this.element),prop:be.getShapeProp(this.element,k[x],3),elem:T,lastPath:""},m.appendChild(T);else{_+=1,T.setAttribute("fill",k[x].mode==="s"?"#000000":"#ffffff"),T.setAttribute("clip-rule","nonzero");var I;if(k[x].x.k!==0?(G="mask",F="mask",ee=_e.getProp(this.element,k[x].x,0,null,this.element),I=Ce(),W=ke("filter"),W.setAttribute("id",I),H=ke("feMorphology"),H.setAttribute("operator","erode"),H.setAttribute("in","SourceGraphic"),H.setAttribute("radius","0"),W.appendChild(H),m.appendChild(W),T.setAttribute("stroke",k[x].mode==="s"?"#000000":"#ffffff")):(H=null,ee=null),this.storedData[x]={elem:T,x:ee,expan:H,lastPath:"",lastOperator:"",filterId:I,lastRadius:0},k[x].mode==="i"){ie=$.length;var P=ke("g");for(V=0;V<ie;V+=1)P.appendChild($[V]);var U=ke("mask");U.setAttribute("mask-type","alpha"),U.setAttribute("id",R+"_"+_),U.appendChild(T),m.appendChild(U),P.setAttribute("mask","url("+u()+"#"+R+"_"+_+")"),$.length=0,$.push(P)}else $.push(T);k[x].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[x]={elem:T,lastPath:"",op:_e.getProp(this.element,k[x].o,0,.01,this.element),prop:be.getShapeProp(this.element,k[x],3),invRect:j},this.viewData[x].prop.k||this.drawPath(k[x],this.viewData[x].prop.v,this.viewData[x])}for(this.maskElement=ke(G),S=$.length,x=0;x<S;x+=1)this.maskElement.appendChild($[x]);_>0&&(this.maskElement.setAttribute("id",R),this.element.maskedElement.setAttribute(F,"url("+u()+"#"+R+")"),m.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}us.prototype.getMaskProperty=function(c){return this.viewData[c].prop},us.prototype.renderFrame=function(c){var d=this.element.finalTransform.mat,p,m=this.masksProperties.length;for(p=0;p<m;p+=1)if((this.viewData[p].prop._mdf||c)&&this.drawPath(this.masksProperties[p],this.viewData[p].prop.v,this.viewData[p]),(this.viewData[p].op._mdf||c)&&this.viewData[p].elem.setAttribute("fill-opacity",this.viewData[p].op.v),this.masksProperties[p].mode!=="n"&&(this.viewData[p].invRect&&(this.element.finalTransform.mProp._mdf||c)&&this.viewData[p].invRect.setAttribute("transform",d.getInverseMatrix().to2dCSS()),this.storedData[p].x&&(this.storedData[p].x._mdf||c))){var x=this.storedData[p].expan;this.storedData[p].x.v<0?(this.storedData[p].lastOperator!=="erode"&&(this.storedData[p].lastOperator="erode",this.storedData[p].elem.setAttribute("filter","url("+u()+"#"+this.storedData[p].filterId+")")),x.setAttribute("radius",-this.storedData[p].x.v)):(this.storedData[p].lastOperator!=="dilate"&&(this.storedData[p].lastOperator="dilate",this.storedData[p].elem.setAttribute("filter",null)),this.storedData[p].elem.setAttribute("stroke-width",this.storedData[p].x.v*2))}},us.prototype.getMaskelement=function(){return this.maskElement},us.prototype.createLayerSolidPath=function(){var c="M0,0 ";return c+=" h"+this.globalData.compSize.w,c+=" v"+this.globalData.compSize.h,c+=" h-"+this.globalData.compSize.w,c+=" v-"+this.globalData.compSize.h+" ",c},us.prototype.drawPath=function(c,d,p){var m=" M"+d.v[0][0]+","+d.v[0][1],x,S;for(S=d._length,x=1;x<S;x+=1)m+=" C"+d.o[x-1][0]+","+d.o[x-1][1]+" "+d.i[x][0]+","+d.i[x][1]+" "+d.v[x][0]+","+d.v[x][1];if(d.c&&S>1&&(m+=" C"+d.o[x-1][0]+","+d.o[x-1][1]+" "+d.i[0][0]+","+d.i[0][1]+" "+d.v[0][0]+","+d.v[0][1]),p.lastPath!==m){var T="";p.elem&&(d.c&&(T=c.inv?this.solidPath+m:m),p.elem.setAttribute("d",T)),p.lastPath=m}},us.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var Yn=function(){var c={};c.createFilter=d,c.createAlphaToLuminanceFilter=p;function d(m,x){var S=ke("filter");return S.setAttribute("id",m),x!==!0&&(S.setAttribute("filterUnits","objectBoundingBox"),S.setAttribute("x","0%"),S.setAttribute("y","0%"),S.setAttribute("width","100%"),S.setAttribute("height","100%")),S}function p(){var m=ke("feColorMatrix");return m.setAttribute("type","matrix"),m.setAttribute("color-interpolation-filters","sRGB"),m.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),m}return c}(),R0=function(){var c={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<"u"};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(c.maskType=!1),/firefox/i.test(navigator.userAgent)&&(c.svgLumaHidden=!1),c}(),Nu={},P0="filter_result_";function Bu(c){var d,p="SourceGraphic",m=c.data.ef?c.data.ef.length:0,x=Ce(),S=Yn.createFilter(x,!0),T=0;this.filters=[];var k;for(d=0;d<m;d+=1){k=null;var _=c.data.ef[d].ty;if(Nu[_]){var $=Nu[_].effect;k=new $(S,c.effectsManager.effectElements[d],c,P0+T,p),p=P0+T,Nu[_].countsAsEffect&&(T+=1)}k&&this.filters.push(k)}T&&(c.globalData.defs.appendChild(S),c.layerElement.setAttribute("filter","url("+u()+"#"+x+")")),this.filters.length&&c.addRenderableComponent(this)}Bu.prototype.renderFrame=function(c){var d,p=this.filters.length;for(d=0;d<p;d+=1)this.filters[d].renderFrame(c)},Bu.prototype.getEffects=function(c){var d,p=this.filters.length,m=[];for(d=0;d<p;d+=1)this.filters[d].type===c&&m.push(this.filters[d]);return m};function Xn(){}Xn.prototype={initRendererElement:function(){this.layerElement=ke("g")},createContainerElements:function(){this.matteElement=ke("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var d=null;if(this.data.td){this.matteMasks={};var p=ke("g");p.setAttribute("id",this.layerId),p.appendChild(this.layerElement),d=p,this.globalData.defs.appendChild(p)}else this.data.tt?(this.matteElement.appendChild(this.layerElement),d=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),this.data.ty===0&&!this.data.hd){var m=ke("clipPath"),x=ke("path");x.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var S=Ce();if(m.setAttribute("id",S),m.appendChild(x),this.globalData.defs.appendChild(m),this.checkMasks()){var T=ke("g");T.setAttribute("clip-path","url("+u()+"#"+S+")"),T.appendChild(this.layerElement),this.transformedElement=T,d?d.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+u()+"#"+S+")")}this.data.bm!==0&&this.setBlendMode()},renderElement:function(){this.finalTransform._localMatMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.localMat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.localOpacity)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new us(this.data,this,this.globalData),this.renderableEffectsManager=new Bu(this),this.searchEffectTransforms()},getMatte:function(d){if(this.matteMasks||(this.matteMasks={}),!this.matteMasks[d]){var p=this.layerId+"_"+d,m,x,S,T;if(d===1||d===3){var k=ke("mask");k.setAttribute("id",p),k.setAttribute("mask-type",d===3?"luminance":"alpha"),S=ke("use"),S.setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),k.appendChild(S),this.globalData.defs.appendChild(k),!R0.maskType&&d===1&&(k.setAttribute("mask-type","luminance"),m=Ce(),x=Yn.createFilter(m),this.globalData.defs.appendChild(x),x.appendChild(Yn.createAlphaToLuminanceFilter()),T=ke("g"),T.appendChild(S),k.appendChild(T),T.setAttribute("filter","url("+u()+"#"+m+")"))}else if(d===2){var _=ke("mask");_.setAttribute("id",p),_.setAttribute("mask-type","alpha");var $=ke("g");_.appendChild($),m=Ce(),x=Yn.createFilter(m);var V=ke("feComponentTransfer");V.setAttribute("in","SourceGraphic"),x.appendChild(V);var ie=ke("feFuncA");ie.setAttribute("type","table"),ie.setAttribute("tableValues","1.0 0.0"),V.appendChild(ie),this.globalData.defs.appendChild(x);var R=ke("rect");R.setAttribute("width",this.comp.data.w),R.setAttribute("height",this.comp.data.h),R.setAttribute("x","0"),R.setAttribute("y","0"),R.setAttribute("fill","#ffffff"),R.setAttribute("opacity","0"),$.setAttribute("filter","url("+u()+"#"+m+")"),$.appendChild(R),S=ke("use"),S.setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),$.appendChild(S),R0.maskType||(_.setAttribute("mask-type","luminance"),x.appendChild(Yn.createAlphaToLuminanceFilter()),T=ke("g"),$.appendChild(R),T.appendChild(this.layerElement),$.appendChild(T)),this.globalData.defs.appendChild(_)}this.matteMasks[d]=p}return this.matteMasks[d]},setMatte:function(d){this.matteElement&&this.matteElement.setAttribute("mask","url("+u()+"#"+d+")")}};function qs(){}qs.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(d){this.hierarchy=d},setAsParent:function(){this._isParent=!0},checkParenting:function(){this.data.parent!==void 0&&this.comp.buildElementParenting(this,this.data.parent,[])}};function Qn(){}(function(){var c={initElement:function(p,m,x){this.initFrame(),this.initBaseData(p,m,x),this.initTransform(p,m,x),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){if(!this.hidden&&(!this.isInRange||this.isTransparent)){var p=this.baseElement||this.layerElement;p.style.display="none",this.hidden=!0}},show:function(){if(this.isInRange&&!this.isTransparent){if(!this.data.hd){var p=this.baseElement||this.layerElement;p.style.display="block"}this.hidden=!1,this._isFirstFrame=!0}},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(p){this._mdf=!1,this.prepareRenderableFrame(p),this.prepareProperties(p,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}};f([Ao,g(c)],Qn)})();function Jn(c,d,p){this.assetData=d.getAssetData(c.refId),this.assetData&&this.assetData.sid&&(this.assetData=d.slotManager.getProp(this.assetData)),this.initElement(c,d,p),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}f([Or,Ws,Xn,qs,Mr,Qn],Jn),Jn.prototype.createContent=function(){var c=this.globalData.getAssetsPath(this.assetData);this.innerElem=ke("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",c),this.layerElement.appendChild(this.innerElem)},Jn.prototype.sourceRectAtTime=function(){return this.sourceRect};function IR(c,d){this.elem=c,this.pos=d}function k0(){}k0.prototype={addShapeToModifiers:function(d){var p,m=this.shapeModifiers.length;for(p=0;p<m;p+=1)this.shapeModifiers[p].addShape(d)},isShapeInAnimatedModifiers:function(d){for(var p=0,m=this.shapeModifiers.length;p<m;)if(this.shapeModifiers[p].isAnimatedWithShape(d))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var d,p=this.shapes.length;for(d=0;d<p;d+=1)this.shapes[d].sh.reset();p=this.shapeModifiers.length;var m;for(d=p-1;d>=0&&(m=this.shapeModifiers[d].processShapes(this._isFirstFrame),!m);d-=1);}},searchProcessedElement:function(d){for(var p=this.processedElements,m=0,x=p.length;m<x;){if(p[m].elem===d)return p[m].pos;m+=1}return 0},addProcessedElement:function(d,p){for(var m=this.processedElements,x=m.length;x;)if(x-=1,m[x].elem===d){m[x].pos=p;return}m.push(new IR(d,p))},prepareFrame:function(d){this.prepareRenderableFrame(d),this.prepareProperties(d,this.isInRange)}};var D0={1:"butt",2:"round",3:"square"},O0={1:"miter",2:"round",3:"bevel"};function M0(c,d,p){this.caches=[],this.styles=[],this.transformers=c,this.lStr="",this.sh=p,this.lvl=d,this._isAnimated=!!p.k;for(var m=0,x=c.length;m<x;){if(c[m].mProps.dynamicProperties.length){this._isAnimated=!0;break}m+=1}}M0.prototype.setAsAnimated=function(){this._isAnimated=!0};function F0(c,d){this.data=c,this.type=c.ty,this.d="",this.lvl=d,this._mdf=!1,this.closed=c.hd===!0,this.pElem=ke("path"),this.msElem=null}F0.prototype.reset=function(){this.d="",this._mdf=!1};function _o(c,d,p,m){this.elem=c,this.frameId=-1,this.dataProps=b(d.length),this.renderer=p,this.k=!1,this.dashStr="",this.dashArray=y("float32",d.length?d.length-1:0),this.dashoffset=y("float32",1),this.initDynamicPropertyContainer(m);var x,S=d.length||0,T;for(x=0;x<S;x+=1)T=_e.getProp(c,d[x].v,0,0,this),this.k=T.k||this.k,this.dataProps[x]={n:d[x].n,p:T};this.k||this.getValue(!0),this._isAnimated=this.k}_o.prototype.getValue=function(c){if(!(this.elem.globalData.frameId===this.frameId&&!c)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||c,this._mdf)){var d=0,p=this.dataProps.length;for(this.renderer==="svg"&&(this.dashStr=""),d=0;d<p;d+=1)this.dataProps[d].n!=="o"?this.renderer==="svg"?this.dashStr+=" "+this.dataProps[d].p.v:this.dashArray[d]=this.dataProps[d].p.v:this.dashoffset[0]=this.dataProps[d].p.v}},f([It],_o);function N0(c,d,p){this.initDynamicPropertyContainer(c),this.getValue=this.iterateDynamicProperties,this.o=_e.getProp(c,d.o,0,.01,this),this.w=_e.getProp(c,d.w,0,null,this),this.d=new _o(c,d.d||{},"svg",this),this.c=_e.getProp(c,d.c,1,255,this),this.style=p,this._isAnimated=!!this._isAnimated}f([It],N0);function B0(c,d,p){this.initDynamicPropertyContainer(c),this.getValue=this.iterateDynamicProperties,this.o=_e.getProp(c,d.o,0,.01,this),this.c=_e.getProp(c,d.c,1,255,this),this.style=p}f([It],B0);function $0(c,d,p){this.initDynamicPropertyContainer(c),this.getValue=this.iterateDynamicProperties,this.style=p}f([It],$0);function Zn(c,d,p){this.data=d,this.c=y("uint8c",d.p*4);var m=d.k.k[0].s?d.k.k[0].s.length-d.p*4:d.k.k.length-d.p*4;this.o=y("float32",m),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=m,this.initDynamicPropertyContainer(p),this.prop=_e.getProp(c,d.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}Zn.prototype.comparePoints=function(c,d){for(var p=0,m=this.o.length/2,x;p<m;){if(x=Math.abs(c[p*4]-c[d*4+p*2]),x>.01)return!1;p+=1}return!0},Zn.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return!1;if(this.data.k.k[0].s)for(var c=0,d=this.data.k.k.length;c<d;){if(!this.comparePoints(this.data.k.k[c].s,this.data.p))return!1;c+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},Zn.prototype.getValue=function(c){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||c){var d,p=this.data.p*4,m,x;for(d=0;d<p;d+=1)m=d%4===0?100:255,x=Math.round(this.prop.v[d]*m),this.c[d]!==x&&(this.c[d]=x,this._cmdf=!c);if(this.o.length)for(p=this.prop.v.length,d=this.data.p*4;d<p;d+=1)m=d%2===0?100:1,x=d%2===0?Math.round(this.prop.v[d]*100):this.prop.v[d],this.o[d-this.data.p*4]!==x&&(this.o[d-this.data.p*4]=x,this._omdf=!c);this._mdf=!c}},f([It],Zn);function Ys(c,d,p){this.initDynamicPropertyContainer(c),this.getValue=this.iterateDynamicProperties,this.initGradientData(c,d,p)}Ys.prototype.initGradientData=function(c,d,p){this.o=_e.getProp(c,d.o,0,.01,this),this.s=_e.getProp(c,d.s,1,null,this),this.e=_e.getProp(c,d.e,1,null,this),this.h=_e.getProp(c,d.h||{k:0},0,.01,this),this.a=_e.getProp(c,d.a||{k:0},0,Q,this),this.g=new Zn(c,d.g,this),this.style=p,this.stops=[],this.setGradientData(p.pElem,d),this.setGradientOpacity(d,p),this._isAnimated=!!this._isAnimated},Ys.prototype.setGradientData=function(c,d){var p=Ce(),m=ke(d.t===1?"linearGradient":"radialGradient");m.setAttribute("id",p),m.setAttribute("spreadMethod","pad"),m.setAttribute("gradientUnits","userSpaceOnUse");var x=[],S,T,k;for(k=d.g.p*4,T=0;T<k;T+=4)S=ke("stop"),m.appendChild(S),x.push(S);c.setAttribute(d.ty==="gf"?"fill":"stroke","url("+u()+"#"+p+")"),this.gf=m,this.cst=x},Ys.prototype.setGradientOpacity=function(c,d){if(this.g._hasOpacity&&!this.g._collapsable){var p,m,x,S=ke("mask"),T=ke("path");S.appendChild(T);var k=Ce(),_=Ce();S.setAttribute("id",_);var $=ke(c.t===1?"linearGradient":"radialGradient");$.setAttribute("id",k),$.setAttribute("spreadMethod","pad"),$.setAttribute("gradientUnits","userSpaceOnUse"),x=c.g.k.k[0].s?c.g.k.k[0].s.length:c.g.k.k.length;var V=this.stops;for(m=c.g.p*4;m<x;m+=2)p=ke("stop"),p.setAttribute("stop-color","rgb(255,255,255)"),$.appendChild(p),V.push(p);T.setAttribute(c.ty==="gf"?"fill":"stroke","url("+u()+"#"+k+")"),c.ty==="gs"&&(T.setAttribute("stroke-linecap",D0[c.lc||2]),T.setAttribute("stroke-linejoin",O0[c.lj||2]),c.lj===1&&T.setAttribute("stroke-miterlimit",c.ml)),this.of=$,this.ms=S,this.ost=V,this.maskId=_,d.msElem=T}},f([It],Ys);function U0(c,d,p){this.initDynamicPropertyContainer(c),this.getValue=this.iterateDynamicProperties,this.w=_e.getProp(c,d.w,0,null,this),this.d=new _o(c,d.d||{},"svg",this),this.initGradientData(c,d,p),this._isAnimated=!!this._isAnimated}f([Ys,It],U0);function RR(){this.it=[],this.prevViewData=[],this.gr=ke("g")}function PR(c,d,p){this.transform={mProps:c,op:d,container:p},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}var G0=function(d,p,m,x){if(p===0)return"";var S=d.o,T=d.i,k=d.v,_,$=" M"+x.applyToPointStringified(k[0][0],k[0][1]);for(_=1;_<p;_+=1)$+=" C"+x.applyToPointStringified(S[_-1][0],S[_-1][1])+" "+x.applyToPointStringified(T[_][0],T[_][1])+" "+x.applyToPointStringified(k[_][0],k[_][1]);return m&&p&&($+=" C"+x.applyToPointStringified(S[_-1][0],S[_-1][1])+" "+x.applyToPointStringified(T[0][0],T[0][1])+" "+x.applyToPointStringified(k[0][0],k[0][1]),$+="z"),$},kR=function(){var c=new Te,d=new Te,p={createRenderFunction:m};function m(ie){switch(ie.ty){case"fl":return k;case"gf":return $;case"gs":return _;case"st":return V;case"sh":case"el":case"rc":case"sr":return T;case"tr":return x;case"no":return S;default:return null}}function x(ie,R,j){(j||R.transform.op._mdf)&&R.transform.container.setAttribute("opacity",R.transform.op.v),(j||R.transform.mProps._mdf)&&R.transform.container.setAttribute("transform",R.transform.mProps.v.to2dCSS())}function S(){}function T(ie,R,j){var W,H,ee,G,F,I,P=R.styles.length,U=R.lvl,Y,te,ae,xe;for(I=0;I<P;I+=1){if(G=R.sh._mdf||j,R.styles[I].lvl<U){for(te=d.reset(),ae=U-R.styles[I].lvl,xe=R.transformers.length-1;!G&&ae>0;)G=R.transformers[xe].mProps._mdf||G,ae-=1,xe-=1;if(G)for(ae=U-R.styles[I].lvl,xe=R.transformers.length-1;ae>0;)te.multiply(R.transformers[xe].mProps.v),ae-=1,xe-=1}else te=c;if(Y=R.sh.paths,H=Y._length,G){for(ee="",W=0;W<H;W+=1)F=Y.shapes[W],F&&F._length&&(ee+=G0(F,F._length,F.c,te));R.caches[I]=ee}else ee=R.caches[I];R.styles[I].d+=ie.hd===!0?"":ee,R.styles[I]._mdf=G||R.styles[I]._mdf}}function k(ie,R,j){var W=R.style;(R.c._mdf||j)&&W.pElem.setAttribute("fill","rgb("+J(R.c.v[0])+","+J(R.c.v[1])+","+J(R.c.v[2])+")"),(R.o._mdf||j)&&W.pElem.setAttribute("fill-opacity",R.o.v)}function _(ie,R,j){$(ie,R,j),V(ie,R,j)}function $(ie,R,j){var W=R.gf,H=R.g._hasOpacity,ee=R.s.v,G=R.e.v;if(R.o._mdf||j){var F=ie.ty==="gf"?"fill-opacity":"stroke-opacity";R.style.pElem.setAttribute(F,R.o.v)}if(R.s._mdf||j){var I=ie.t===1?"x1":"cx",P=I==="x1"?"y1":"cy";W.setAttribute(I,ee[0]),W.setAttribute(P,ee[1]),H&&!R.g._collapsable&&(R.of.setAttribute(I,ee[0]),R.of.setAttribute(P,ee[1]))}var U,Y,te,ae;if(R.g._cmdf||j){U=R.cst;var xe=R.g.c;for(te=U.length,Y=0;Y<te;Y+=1)ae=U[Y],ae.setAttribute("offset",xe[Y*4]+"%"),ae.setAttribute("stop-color","rgb("+xe[Y*4+1]+","+xe[Y*4+2]+","+xe[Y*4+3]+")")}if(H&&(R.g._omdf||j)){var Ke=R.g.o;for(R.g._collapsable?U=R.cst:U=R.ost,te=U.length,Y=0;Y<te;Y+=1)ae=U[Y],R.g._collapsable||ae.setAttribute("offset",Ke[Y*2]+"%"),ae.setAttribute("stop-opacity",Ke[Y*2+1])}if(ie.t===1)(R.e._mdf||j)&&(W.setAttribute("x2",G[0]),W.setAttribute("y2",G[1]),H&&!R.g._collapsable&&(R.of.setAttribute("x2",G[0]),R.of.setAttribute("y2",G[1])));else{var De;if((R.s._mdf||R.e._mdf||j)&&(De=Math.sqrt(Math.pow(ee[0]-G[0],2)+Math.pow(ee[1]-G[1],2)),W.setAttribute("r",De),H&&!R.g._collapsable&&R.of.setAttribute("r",De)),R.e._mdf||R.h._mdf||R.a._mdf||j){De||(De=Math.sqrt(Math.pow(ee[0]-G[0],2)+Math.pow(ee[1]-G[1],2)));var Ae=Math.atan2(G[1]-ee[1],G[0]-ee[0]),Ye=R.h.v;Ye>=1?Ye=.99:Ye<=-1&&(Ye=-.99);var Re=De*Ye,ye=Math.cos(Ae+R.a.v)*Re+ee[0],O=Math.sin(Ae+R.a.v)*Re+ee[1];W.setAttribute("fx",ye),W.setAttribute("fy",O),H&&!R.g._collapsable&&(R.of.setAttribute("fx",ye),R.of.setAttribute("fy",O))}}}function V(ie,R,j){var W=R.style,H=R.d;H&&(H._mdf||j)&&H.dashStr&&(W.pElem.setAttribute("stroke-dasharray",H.dashStr),W.pElem.setAttribute("stroke-dashoffset",H.dashoffset[0])),R.c&&(R.c._mdf||j)&&W.pElem.setAttribute("stroke","rgb("+J(R.c.v[0])+","+J(R.c.v[1])+","+J(R.c.v[2])+")"),(R.o._mdf||j)&&W.pElem.setAttribute("stroke-opacity",R.o.v),(R.w._mdf||j)&&(W.pElem.setAttribute("stroke-width",R.w.v),W.msElem&&W.msElem.setAttribute("stroke-width",R.w.v))}return p}();function Rt(c,d,p){this.shapes=[],this.shapesData=c.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(c,d,p),this.prevViewData=[]}f([Or,Ws,Xn,k0,qs,Mr,Qn],Rt),Rt.prototype.initSecondaryElement=function(){},Rt.prototype.identityMatrix=new Te,Rt.prototype.buildExpressionInterface=function(){},Rt.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},Rt.prototype.filterUniqueShapes=function(){var c,d=this.shapes.length,p,m,x=this.stylesList.length,S,T=[],k=!1;for(m=0;m<x;m+=1){for(S=this.stylesList[m],k=!1,T.length=0,c=0;c<d;c+=1)p=this.shapes[c],p.styles.indexOf(S)!==-1&&(T.push(p),k=p._isAnimated||k);T.length>1&&k&&this.setShapesAsAnimated(T)}},Rt.prototype.setShapesAsAnimated=function(c){var d,p=c.length;for(d=0;d<p;d+=1)c[d].setAsAnimated()},Rt.prototype.createStyleElement=function(c,d){var p,m=new F0(c,d),x=m.pElem;if(c.ty==="st")p=new N0(this,c,m);else if(c.ty==="fl")p=new B0(this,c,m);else if(c.ty==="gf"||c.ty==="gs"){var S=c.ty==="gf"?Ys:U0;p=new S(this,c,m),this.globalData.defs.appendChild(p.gf),p.maskId&&(this.globalData.defs.appendChild(p.ms),this.globalData.defs.appendChild(p.of),x.setAttribute("mask","url("+u()+"#"+p.maskId+")"))}else c.ty==="no"&&(p=new $0(this,c,m));return(c.ty==="st"||c.ty==="gs")&&(x.setAttribute("stroke-linecap",D0[c.lc||2]),x.setAttribute("stroke-linejoin",O0[c.lj||2]),x.setAttribute("fill-opacity","0"),c.lj===1&&x.setAttribute("stroke-miterlimit",c.ml)),c.r===2&&x.setAttribute("fill-rule","evenodd"),c.ln&&x.setAttribute("id",c.ln),c.cl&&x.setAttribute("class",c.cl),c.bm&&(x.style["mix-blend-mode"]=Fu(c.bm)),this.stylesList.push(m),this.addToAnimatedContents(c,p),p},Rt.prototype.createGroupElement=function(c){var d=new RR;return c.ln&&d.gr.setAttribute("id",c.ln),c.cl&&d.gr.setAttribute("class",c.cl),c.bm&&(d.gr.style["mix-blend-mode"]=Fu(c.bm)),d},Rt.prototype.createTransformElement=function(c,d){var p=Pu.getTransformProperty(this,c,this),m=new PR(p,p.o,d);return this.addToAnimatedContents(c,m),m},Rt.prototype.createShapeElement=function(c,d,p){var m=4;c.ty==="rc"?m=5:c.ty==="el"?m=6:c.ty==="sr"&&(m=7);var x=be.getShapeProp(this,c,m,this),S=new M0(d,p,x);return this.shapes.push(S),this.addShapeToModifiers(S),this.addToAnimatedContents(c,S),S},Rt.prototype.addToAnimatedContents=function(c,d){for(var p=0,m=this.animatedContents.length;p<m;){if(this.animatedContents[p].element===d)return;p+=1}this.animatedContents.push({fn:kR.createRenderFunction(c),element:d,data:c})},Rt.prototype.setElementStyles=function(c){var d=c.styles,p,m=this.stylesList.length;for(p=0;p<m;p+=1)this.stylesList[p].closed||d.push(this.stylesList[p])},Rt.prototype.reloadShapes=function(){this._isFirstFrame=!0;var c,d=this.itemsData.length;for(c=0;c<d;c+=1)this.prevViewData[c]=this.itemsData[c];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),d=this.dynamicProperties.length,c=0;c<d;c+=1)this.dynamicProperties[c].getValue();this.renderModifiers()},Rt.prototype.searchShapes=function(c,d,p,m,x,S,T){var k=[].concat(S),_,$=c.length-1,V,ie,R=[],j=[],W,H,ee;for(_=$;_>=0;_-=1){if(ee=this.searchProcessedElement(c[_]),ee?d[_]=p[ee-1]:c[_]._render=T,c[_].ty==="fl"||c[_].ty==="st"||c[_].ty==="gf"||c[_].ty==="gs"||c[_].ty==="no")ee?d[_].style.closed=!1:d[_]=this.createStyleElement(c[_],x),c[_]._render&&d[_].style.pElem.parentNode!==m&&m.appendChild(d[_].style.pElem),R.push(d[_].style);else if(c[_].ty==="gr"){if(!ee)d[_]=this.createGroupElement(c[_]);else for(ie=d[_].it.length,V=0;V<ie;V+=1)d[_].prevViewData[V]=d[_].it[V];this.searchShapes(c[_].it,d[_].it,d[_].prevViewData,d[_].gr,x+1,k,T),c[_]._render&&d[_].gr.parentNode!==m&&m.appendChild(d[_].gr)}else c[_].ty==="tr"?(ee||(d[_]=this.createTransformElement(c[_],m)),W=d[_].transform,k.push(W)):c[_].ty==="sh"||c[_].ty==="rc"||c[_].ty==="el"||c[_].ty==="sr"?(ee||(d[_]=this.createShapeElement(c[_],k,x)),this.setElementStyles(d[_])):c[_].ty==="tm"||c[_].ty==="rd"||c[_].ty==="ms"||c[_].ty==="pb"||c[_].ty==="zz"||c[_].ty==="op"?(ee?(H=d[_],H.closed=!1):(H=kr.getModifier(c[_].ty),H.init(this,c[_]),d[_]=H,this.shapeModifiers.push(H)),j.push(H)):c[_].ty==="rp"&&(ee?(H=d[_],H.closed=!0):(H=kr.getModifier(c[_].ty),d[_]=H,H.init(this,c,_,d),this.shapeModifiers.push(H),T=!1),j.push(H));this.addProcessedElement(c[_],_+1)}for($=R.length,_=0;_<$;_+=1)R[_].closed=!0;for($=j.length,_=0;_<$;_+=1)j[_].closed=!0},Rt.prototype.renderInnerContent=function(){this.renderModifiers();var c,d=this.stylesList.length;for(c=0;c<d;c+=1)this.stylesList[c].reset();for(this.renderShape(),c=0;c<d;c+=1)(this.stylesList[c]._mdf||this._isFirstFrame)&&(this.stylesList[c].msElem&&(this.stylesList[c].msElem.setAttribute("d",this.stylesList[c].d),this.stylesList[c].d="M0 0"+this.stylesList[c].d),this.stylesList[c].pElem.setAttribute("d",this.stylesList[c].d||"M0 0"))},Rt.prototype.renderShape=function(){var c,d=this.animatedContents.length,p;for(c=0;c<d;c+=1)p=this.animatedContents[c],(this._isFirstFrame||p.element._isAnimated)&&p.data!==!0&&p.fn(p.data,p.element,this._isFirstFrame)},Rt.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null};function $u(c,d,p,m,x,S){this.o=c,this.sw=d,this.sc=p,this.fc=m,this.m=x,this.p=S,this._mdf={o:!0,sw:!!d,sc:!!p,fc:!!m,m:!0,p:!0}}$u.prototype.update=function(c,d,p,m,x,S){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1,this._mdf.p=!1;var T=!1;return this.o!==c&&(this.o=c,this._mdf.o=!0,T=!0),this.sw!==d&&(this.sw=d,this._mdf.sw=!0,T=!0),this.sc!==p&&(this.sc=p,this._mdf.sc=!0,T=!0),this.fc!==m&&(this.fc=m,this._mdf.fc=!0,T=!0),this.m!==x&&(this.m=x,this._mdf.m=!0,T=!0),S.length&&(this.p[0]!==S[0]||this.p[1]!==S[1]||this.p[4]!==S[4]||this.p[5]!==S[5]||this.p[12]!==S[12]||this.p[13]!==S[13])&&(this.p=S,this._mdf.p=!0,T=!0),T};function Xt(c,d){this._frameId=n,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,d.d&&d.d.sid&&(d.d=c.globalData.slotManager.getProp(d.d)),this.data=d,this.elem=c,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}Xt.prototype.defaultBoxWidth=[0,0],Xt.prototype.copyData=function(c,d){for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p]);return c},Xt.prototype.setCurrentData=function(c){c.__complete||this.completeTextData(c),this.currentData=c,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},Xt.prototype.searchProperty=function(){return this.searchKeyframes()},Xt.prototype.searchKeyframes=function(){return this.kf=this.data.d.k.length>1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},Xt.prototype.addEffect=function(c){this.effectsSequence.push(c),this.elem.addDynamicProperty(this)},Xt.prototype.getValue=function(c){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!c)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var d=this.currentData,p=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var m,x=this.effectsSequence.length,S=c||this.data.d.k[this.keysIndex].s;for(m=0;m<x;m+=1)p!==this.keysIndex?S=this.effectsSequence[m](S,S.t):S=this.effectsSequence[m](this.currentData,S.t);d!==S&&this.setCurrentData(S),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}},Xt.prototype.getKeyframeValue=function(){for(var c=this.data.d.k,d=this.elem.comp.renderedFrame,p=0,m=c.length;p<=m-1&&!(p===m-1||c[p+1].t>d);)p+=1;return this.keysIndex!==p&&(this.keysIndex=p),this.data.d.k[this.keysIndex].s},Xt.prototype.buildFinalText=function(c){for(var d=[],p=0,m=c.length,x,S,T=!1,k=!1,_="";p<m;)T=k,k=!1,x=c.charCodeAt(p),_=c.charAt(p),cs.isCombinedCharacter(x)?T=!0:x>=55296&&x<=56319?cs.isRegionalFlag(c,p)?_=c.substr(p,14):(S=c.charCodeAt(p+1),S>=56320&&S<=57343&&(cs.isModifier(x,S)?(_=c.substr(p,2),T=!0):cs.isFlagEmoji(c.substr(p,4))?_=c.substr(p,4):_=c.substr(p,2))):x>56319?(S=c.charCodeAt(p+1),cs.isVariationSelector(x)&&(T=!0)):cs.isZeroWidthJoiner(x)&&(T=!0,k=!0),T?(d[d.length-1]+=_,T=!1):d.push(_),p+=_.length;return d},Xt.prototype.completeTextData=function(c){c.__complete=!0;var d=this.elem.globalData.fontManager,p=this.data,m=[],x,S,T,k=0,_,$=p.m.g,V=0,ie=0,R=0,j=[],W=0,H=0,ee,G,F=d.getFontByName(c.f),I,P=0,U=C0(F);c.fWeight=U.weight,c.fStyle=U.style,c.finalSize=c.s,c.finalText=this.buildFinalText(c.t),S=c.finalText.length,c.finalLineHeight=c.lh;var Y=c.tr/1e3*c.finalSize,te;if(c.sz)for(var ae=!0,xe=c.sz[0],Ke=c.sz[1],De,Ae;ae;){Ae=this.buildFinalText(c.t),De=0,W=0,S=Ae.length,Y=c.tr/1e3*c.finalSize;var Ye=-1;for(x=0;x<S;x+=1)te=Ae[x].charCodeAt(0),T=!1,Ae[x]===" "?Ye=x:(te===13||te===3)&&(W=0,T=!0,De+=c.finalLineHeight||c.finalSize*1.2),d.chars?(I=d.getCharData(Ae[x],F.fStyle,F.fFamily),P=T?0:I.w*c.finalSize/100):P=d.measureText(Ae[x],c.f,c.finalSize),W+P>xe&&Ae[x]!==" "?(Ye===-1?S+=1:x=Ye,De+=c.finalLineHeight||c.finalSize*1.2,Ae.splice(x,Ye===x?1:0,"\r"),Ye=-1,W=0):(W+=P,W+=Y);De+=F.ascent*c.finalSize/100,this.canResize&&c.finalSize>this.minimumFontSize&&Ke<De?(c.finalSize-=1,c.finalLineHeight=c.finalSize*c.lh/c.s):(c.finalText=Ae,S=c.finalText.length,ae=!1)}W=-Y,P=0;var Re=0,ye;for(x=0;x<S;x+=1)if(T=!1,ye=c.finalText[x],te=ye.charCodeAt(0),te===13||te===3?(Re=0,j.push(W),H=W>H?W:H,W=-2*Y,_="",T=!0,R+=1):_=ye,d.chars?(I=d.getCharData(ye,F.fStyle,d.getFontByName(c.f).fFamily),P=T?0:I.w*c.finalSize/100):P=d.measureText(_,c.f,c.finalSize),ye===" "?Re+=P+Y:(W+=P+Y+Re,Re=0),m.push({l:P,an:P,add:V,n:T,anIndexes:[],val:_,line:R,animatorJustifyOffset:0}),$==2){if(V+=P,_===""||_===" "||x===S-1){for((_===""||_===" ")&&(V-=P);ie<=x;)m[ie].an=V,m[ie].ind=k,m[ie].extra=P,ie+=1;k+=1,V=0}}else if($==3){if(V+=P,_===""||x===S-1){for(_===""&&(V-=P);ie<=x;)m[ie].an=V,m[ie].ind=k,m[ie].extra=P,ie+=1;V=0,k+=1}}else m[k].ind=k,m[k].extra=0,k+=1;if(c.l=m,H=W>H?W:H,j.push(W),c.sz)c.boxWidth=c.sz[0],c.justifyOffset=0;else switch(c.boxWidth=H,c.j){case 1:c.justifyOffset=-c.boxWidth;break;case 2:c.justifyOffset=-c.boxWidth/2;break;default:c.justifyOffset=0}c.lineWidths=j;var O=p.a,K,w;G=O.length;var L,ne,X=[];for(ee=0;ee<G;ee+=1){for(K=O[ee],K.a.sc&&(c.strokeColorAnim=!0),K.a.sw&&(c.strokeWidthAnim=!0),(K.a.fc||K.a.fh||K.a.fs||K.a.fb)&&(c.fillColorAnim=!0),ne=0,L=K.s.b,x=0;x<S;x+=1)w=m[x],w.anIndexes[ee]=ne,(L==1&&w.val!==""||L==2&&w.val!==""&&w.val!==" "||L==3&&(w.n||w.val==" "||x==S-1)||L==4&&(w.n||x==S-1))&&(K.s.rn===1&&X.push(ne),ne+=1);p.a[ee].s.totalChars=ne;var Le=-1,Be;if(K.s.rn===1)for(x=0;x<S;x+=1)w=m[x],Le!=w.anIndexes[ee]&&(Le=w.anIndexes[ee],Be=X.splice(Math.floor(Math.random()*X.length),1)[0]),w.anIndexes[ee]=Be}c.yOffset=c.finalLineHeight||c.finalSize*1.2,c.ls=c.ls||0,c.ascent=F.ascent*c.finalSize/100},Xt.prototype.updateDocumentData=function(c,d){d=d===void 0?this.keysIndex:d;var p=this.copyData({},this.data.d.k[d].s);p=this.copyData(p,c),this.data.d.k[d].s=p,this.recalculate(d),this.setCurrentData(p),this.elem.addDynamicProperty(this)},Xt.prototype.recalculate=function(c){var d=this.data.d.k[c].s;d.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(d)},Xt.prototype.canResizeFont=function(c){this.canResize=c,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},Xt.prototype.setMinimumFontSize=function(c){this.minimumFontSize=Math.floor(c)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var DR=function(){var c=Math.max,d=Math.min,p=Math.floor;function m(S,T){this._currentTextLength=-1,this.k=!1,this.data=T,this.elem=S,this.comp=S.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(S),this.s=_e.getProp(S,T.s||{k:0},0,0,this),"e"in T?this.e=_e.getProp(S,T.e,0,0,this):this.e={v:100},this.o=_e.getProp(S,T.o||{k:0},0,0,this),this.xe=_e.getProp(S,T.xe||{k:0},0,0,this),this.ne=_e.getProp(S,T.ne||{k:0},0,0,this),this.sm=_e.getProp(S,T.sm||{k:100},0,0,this),this.a=_e.getProp(S,T.a,0,.01,this),this.dynamicProperties.length||this.getValue()}m.prototype={getMult:function(T){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var k=0,_=0,$=1,V=1;this.ne.v>0?k=this.ne.v/100:_=-this.ne.v/100,this.xe.v>0?$=1-this.xe.v/100:V=1+this.xe.v/100;var ie=Ji.getBezierEasing(k,_,$,V).get,R=0,j=this.finalS,W=this.finalE,H=this.data.sh;if(H===2)W===j?R=T>=W?1:0:R=c(0,d(.5/(W-j)+(T-j)/(W-j),1)),R=ie(R);else if(H===3)W===j?R=T>=W?0:1:R=1-c(0,d(.5/(W-j)+(T-j)/(W-j),1)),R=ie(R);else if(H===4)W===j?R=0:(R=c(0,d(.5/(W-j)+(T-j)/(W-j),1)),R<.5?R*=2:R=1-2*(R-.5)),R=ie(R);else if(H===5){if(W===j)R=0;else{var ee=W-j;T=d(c(0,T+.5-j),W-j);var G=-ee/2+T,F=ee/2;R=Math.sqrt(1-G*G/(F*F))}R=ie(R)}else H===6?(W===j?R=0:(T=d(c(0,T+.5-j),W-j),R=(1+Math.cos(Math.PI+Math.PI*2*T/(W-j)))/2),R=ie(R)):(T>=p(j)&&(T-j<0?R=c(0,d(d(W,1)-(j-T),1)):R=c(0,d(W-T,1))),R=ie(R));if(this.sm.v!==100){var I=this.sm.v*.01;I===0&&(I=1e-8);var P=.5-I*.5;R<P?R=0:(R=(R-P)/I,R>1&&(R=1))}return R*this.a.v},getValue:function(T){this.iterateDynamicProperties(),this._mdf=T||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,T&&this.data.r===2&&(this.e.v=this._currentTextLength);var k=this.data.r===2?1:100/this.data.totalChars,_=this.o.v/k,$=this.s.v/k+_,V=this.e.v/k+_;if($>V){var ie=$;$=V,V=ie}this.finalS=$,this.finalE=V}},f([It],m);function x(S,T,k){return new m(S,T)}return{getTextSelectorProp:x}}();function OR(c,d,p){var m={propType:!1},x=_e.getProp,S=d.a;this.a={r:S.r?x(c,S.r,0,Q,p):m,rx:S.rx?x(c,S.rx,0,Q,p):m,ry:S.ry?x(c,S.ry,0,Q,p):m,sk:S.sk?x(c,S.sk,0,Q,p):m,sa:S.sa?x(c,S.sa,0,Q,p):m,s:S.s?x(c,S.s,1,.01,p):m,a:S.a?x(c,S.a,1,0,p):m,o:S.o?x(c,S.o,0,.01,p):m,p:S.p?x(c,S.p,1,0,p):m,sw:S.sw?x(c,S.sw,0,0,p):m,sc:S.sc?x(c,S.sc,1,0,p):m,fc:S.fc?x(c,S.fc,1,0,p):m,fh:S.fh?x(c,S.fh,0,0,p):m,fs:S.fs?x(c,S.fs,0,.01,p):m,fb:S.fb?x(c,S.fb,0,.01,p):m,t:S.t?x(c,S.t,0,0,p):m},this.s=DR.getTextSelectorProp(c,d.s,p),this.s.t=d.s.t}function hs(c,d,p){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=c,this._renderType=d,this._elem=p,this._animatorsData=b(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(p)}hs.prototype.searchProperties=function(){var c,d=this._textData.a.length,p,m=_e.getProp;for(c=0;c<d;c+=1)p=this._textData.a[c],this._animatorsData[c]=new OR(this._elem,p,this);this._textData.p&&"m"in this._textData.p?(this._pathData={a:m(this._elem,this._textData.p.a,0,0,this),f:m(this._elem,this._textData.p.f,0,0,this),l:m(this._elem,this._textData.p.l,0,0,this),r:m(this._elem,this._textData.p.r,0,0,this),p:m(this._elem,this._textData.p.p,0,0,this),m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=m(this._elem,this._textData.m.a,1,0,this)},hs.prototype.getMeasures=function(c,d){if(this.lettersChangedFlag=d,!(!this._mdf&&!this._isFirstFrame&&!d&&(!this._hasMaskedPath||!this._pathData.m._mdf))){this._isFirstFrame=!1;var p=this._moreOptions.alignment.v,m=this._animatorsData,x=this._textData,S=this.mHelper,T=this._renderType,k=this.renderedLetters.length,_,$,V,ie,R=c.l,j,W,H,ee,G,F,I,P,U,Y,te,ae,xe,Ke,De;if(this._hasMaskedPath){if(De=this._pathData.m,!this._pathData.n||this._pathData._mdf){var Ae=De.v;this._pathData.r.v&&(Ae=Ae.reverse()),j={tLength:0,segments:[]},ie=Ae._length-1;var Ye;for(ae=0,V=0;V<ie;V+=1)Ye=Si.buildBezierData(Ae.v[V],Ae.v[V+1],[Ae.o[V][0]-Ae.v[V][0],Ae.o[V][1]-Ae.v[V][1]],[Ae.i[V+1][0]-Ae.v[V+1][0],Ae.i[V+1][1]-Ae.v[V+1][1]]),j.tLength+=Ye.segmentLength,j.segments.push(Ye),ae+=Ye.segmentLength;V=ie,De.v.c&&(Ye=Si.buildBezierData(Ae.v[V],Ae.v[0],[Ae.o[V][0]-Ae.v[V][0],Ae.o[V][1]-Ae.v[V][1]],[Ae.i[0][0]-Ae.v[0][0],Ae.i[0][1]-Ae.v[0][1]]),j.tLength+=Ye.segmentLength,j.segments.push(Ye),ae+=Ye.segmentLength),this._pathData.pi=j}if(j=this._pathData.pi,W=this._pathData.f.v,I=0,F=1,ee=0,G=!0,Y=j.segments,W<0&&De.v.c)for(j.tLength<Math.abs(W)&&(W=-Math.abs(W)%j.tLength),I=Y.length-1,U=Y[I].points,F=U.length-1;W<0;)W+=U[F].partialLength,F-=1,F<0&&(I-=1,U=Y[I].points,F=U.length-1);U=Y[I].points,P=U[F-1],H=U[F],te=H.partialLength}ie=R.length,_=0,$=0;var Re=c.finalSize*1.2*.714,ye=!0,O,K,w,L,ne;L=m.length;var X,Le=-1,Be,ze,at,ot=W,Dt=I,ii=F,er=-1,ri,Ht,fi,gt,Pe,gr,Br,mr,tr="",vr=this.defaultPropsArray,yr;if(c.j===2||c.j===1){var si=0,$r=0,Ur=c.j===2?-.5:-1,Oi=0,Gr=!0;for(V=0;V<ie;V+=1)if(R[V].n){for(si&&(si+=$r);Oi<V;)R[Oi].animatorJustifyOffset=si,Oi+=1;si=0,Gr=!0}else{for(w=0;w<L;w+=1)O=m[w].a,O.t.propType&&(Gr&&c.j===2&&($r+=O.t.v*Ur),K=m[w].s,X=K.getMult(R[V].anIndexes[w],x.a[w].s.totalChars),X.length?si+=O.t.v*X[0]*Ur:si+=O.t.v*X*Ur);Gr=!1}for(si&&(si+=$r);Oi<V;)R[Oi].animatorJustifyOffset=si,Oi+=1}for(V=0;V<ie;V+=1){if(S.reset(),ri=1,R[V].n)_=0,$+=c.yOffset,$+=ye?1:0,W=ot,ye=!1,this._hasMaskedPath&&(I=Dt,F=ii,U=Y[I].points,P=U[F-1],H=U[F],te=H.partialLength,ee=0),tr="",mr="",gr="",yr="",vr=this.defaultPropsArray;else{if(this._hasMaskedPath){if(er!==R[V].line){switch(c.j){case 1:W+=ae-c.lineWidths[R[V].line];break;case 2:W+=(ae-c.lineWidths[R[V].line])/2;break}er=R[V].line}Le!==R[V].ind&&(R[Le]&&(W+=R[Le].extra),W+=R[V].an/2,Le=R[V].ind),W+=p[0]*R[V].an*.005;var Mi=0;for(w=0;w<L;w+=1)O=m[w].a,O.p.propType&&(K=m[w].s,X=K.getMult(R[V].anIndexes[w],x.a[w].s.totalChars),X.length?Mi+=O.p.v[0]*X[0]:Mi+=O.p.v[0]*X),O.a.propType&&(K=m[w].s,X=K.getMult(R[V].anIndexes[w],x.a[w].s.totalChars),X.length?Mi+=O.a.v[0]*X[0]:Mi+=O.a.v[0]*X);for(G=!0,this._pathData.a.v&&(W=R[0].an*.5+(ae-this._pathData.f.v-R[0].an*.5-R[R.length-1].an*.5)*Le/(ie-1),W+=this._pathData.f.v);G;)ee+te>=W+Mi||!U?(xe=(W+Mi-ee)/H.partialLength,ze=P.point[0]+(H.point[0]-P.point[0])*xe,at=P.point[1]+(H.point[1]-P.point[1])*xe,S.translate(-p[0]*R[V].an*.005,-(p[1]*Re)*.01),G=!1):U&&(ee+=H.partialLength,F+=1,F>=U.length&&(F=0,I+=1,Y[I]?U=Y[I].points:De.v.c?(F=0,I=0,U=Y[I].points):(ee-=H.partialLength,U=null)),U&&(P=H,H=U[F],te=H.partialLength));Be=R[V].an/2-R[V].add,S.translate(-Be,0,0)}else Be=R[V].an/2-R[V].add,S.translate(-Be,0,0),S.translate(-p[0]*R[V].an*.005,-p[1]*Re*.01,0);for(w=0;w<L;w+=1)O=m[w].a,O.t.propType&&(K=m[w].s,X=K.getMult(R[V].anIndexes[w],x.a[w].s.totalChars),(_!==0||c.j!==0)&&(this._hasMaskedPath?X.length?W+=O.t.v*X[0]:W+=O.t.v*X:X.length?_+=O.t.v*X[0]:_+=O.t.v*X));for(c.strokeWidthAnim&&(fi=c.sw||0),c.strokeColorAnim&&(c.sc?Ht=[c.sc[0],c.sc[1],c.sc[2]]:Ht=[0,0,0]),c.fillColorAnim&&c.fc&&(gt=[c.fc[0],c.fc[1],c.fc[2]]),w=0;w<L;w+=1)O=m[w].a,O.a.propType&&(K=m[w].s,X=K.getMult(R[V].anIndexes[w],x.a[w].s.totalChars),X.length?S.translate(-O.a.v[0]*X[0],-O.a.v[1]*X[1],O.a.v[2]*X[2]):S.translate(-O.a.v[0]*X,-O.a.v[1]*X,O.a.v[2]*X));for(w=0;w<L;w+=1)O=m[w].a,O.s.propType&&(K=m[w].s,X=K.getMult(R[V].anIndexes[w],x.a[w].s.totalChars),X.length?S.scale(1+(O.s.v[0]-1)*X[0],1+(O.s.v[1]-1)*X[1],1):S.scale(1+(O.s.v[0]-1)*X,1+(O.s.v[1]-1)*X,1));for(w=0;w<L;w+=1){if(O=m[w].a,K=m[w].s,X=K.getMult(R[V].anIndexes[w],x.a[w].s.totalChars),O.sk.propType&&(X.length?S.skewFromAxis(-O.sk.v*X[0],O.sa.v*X[1]):S.skewFromAxis(-O.sk.v*X,O.sa.v*X)),O.r.propType&&(X.length?S.rotateZ(-O.r.v*X[2]):S.rotateZ(-O.r.v*X)),O.ry.propType&&(X.length?S.rotateY(O.ry.v*X[1]):S.rotateY(O.ry.v*X)),O.rx.propType&&(X.length?S.rotateX(O.rx.v*X[0]):S.rotateX(O.rx.v*X)),O.o.propType&&(X.length?ri+=(O.o.v*X[0]-ri)*X[0]:ri+=(O.o.v*X-ri)*X),c.strokeWidthAnim&&O.sw.propType&&(X.length?fi+=O.sw.v*X[0]:fi+=O.sw.v*X),c.strokeColorAnim&&O.sc.propType)for(Pe=0;Pe<3;Pe+=1)X.length?Ht[Pe]+=(O.sc.v[Pe]-Ht[Pe])*X[0]:Ht[Pe]+=(O.sc.v[Pe]-Ht[Pe])*X;if(c.fillColorAnim&&c.fc){if(O.fc.propType)for(Pe=0;Pe<3;Pe+=1)X.length?gt[Pe]+=(O.fc.v[Pe]-gt[Pe])*X[0]:gt[Pe]+=(O.fc.v[Pe]-gt[Pe])*X;O.fh.propType&&(X.length?gt=Xe(gt,O.fh.v*X[0]):gt=Xe(gt,O.fh.v*X)),O.fs.propType&&(X.length?gt=qe(gt,O.fs.v*X[0]):gt=qe(gt,O.fs.v*X)),O.fb.propType&&(X.length?gt=Ue(gt,O.fb.v*X[0]):gt=Ue(gt,O.fb.v*X))}}for(w=0;w<L;w+=1)O=m[w].a,O.p.propType&&(K=m[w].s,X=K.getMult(R[V].anIndexes[w],x.a[w].s.totalChars),this._hasMaskedPath?X.length?S.translate(0,O.p.v[1]*X[0],-O.p.v[2]*X[1]):S.translate(0,O.p.v[1]*X,-O.p.v[2]*X):X.length?S.translate(O.p.v[0]*X[0],O.p.v[1]*X[1],-O.p.v[2]*X[2]):S.translate(O.p.v[0]*X,O.p.v[1]*X,-O.p.v[2]*X));if(c.strokeWidthAnim&&(gr=fi<0?0:fi),c.strokeColorAnim&&(Br="rgb("+Math.round(Ht[0]*255)+","+Math.round(Ht[1]*255)+","+Math.round(Ht[2]*255)+")"),c.fillColorAnim&&c.fc&&(mr="rgb("+Math.round(gt[0]*255)+","+Math.round(gt[1]*255)+","+Math.round(gt[2]*255)+")"),this._hasMaskedPath){if(S.translate(0,-c.ls),S.translate(0,p[1]*Re*.01+$,0),this._pathData.p.v){Ke=(H.point[1]-P.point[1])/(H.point[0]-P.point[0]);var ds=Math.atan(Ke)*180/Math.PI;H.point[0]<P.point[0]&&(ds+=180),S.rotate(-ds*Math.PI/180)}S.translate(ze,at,0),W-=p[0]*R[V].an*.005,R[V+1]&&Le!==R[V+1].ind&&(W+=R[V].an/2,W+=c.tr*.001*c.finalSize)}else{switch(S.translate(_,$,0),c.ps&&S.translate(c.ps[0],c.ps[1]+c.ascent,0),c.j){case 1:S.translate(R[V].animatorJustifyOffset+c.justifyOffset+(c.boxWidth-c.lineWidths[R[V].line]),0,0);break;case 2:S.translate(R[V].animatorJustifyOffset+c.justifyOffset+(c.boxWidth-c.lineWidths[R[V].line])/2,0,0);break}S.translate(0,-c.ls),S.translate(Be,0,0),S.translate(p[0]*R[V].an*.005,p[1]*Re*.01,0),_+=R[V].l+c.tr*.001*c.finalSize}T==="html"?tr=S.toCSS():T==="svg"?tr=S.to2dCSS():vr=[S.props[0],S.props[1],S.props[2],S.props[3],S.props[4],S.props[5],S.props[6],S.props[7],S.props[8],S.props[9],S.props[10],S.props[11],S.props[12],S.props[13],S.props[14],S.props[15]],yr=ri}k<=V?(ne=new $u(yr,gr,Br,mr,tr,vr),this.renderedLetters.push(ne),k+=1,this.lettersChangedFlag=!0):(ne=this.renderedLetters[V],this.lettersChangedFlag=ne.update(yr,gr,Br,mr,tr,vr)||this.lettersChangedFlag)}}},hs.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},hs.prototype.mHelper=new Te,hs.prototype.defaultPropsArray=[],f([It],hs);function bi(){}bi.prototype.initElement=function(c,d,p){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(c,d,p),this.textProperty=new Xt(this,c.t,this.dynamicProperties),this.textAnimator=new hs(c.t,this.renderType,this),this.initTransform(c,d,p),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},bi.prototype.prepareFrame=function(c){this._mdf=!1,this.prepareRenderableFrame(c),this.prepareProperties(c,this.isInRange)},bi.prototype.createPathShape=function(c,d){var p,m=d.length,x,S="";for(p=0;p<m;p+=1)d[p].ty==="sh"&&(x=d[p].ks.k,S+=G0(x,x.i.length,!0,c));return S},bi.prototype.updateDocumentData=function(c,d){this.textProperty.updateDocumentData(c,d)},bi.prototype.canResizeFont=function(c){this.textProperty.canResizeFont(c)},bi.prototype.setMinimumFontSize=function(c){this.textProperty.setMinimumFontSize(c)},bi.prototype.applyTextPropertiesToMatrix=function(c,d,p,m,x){switch(c.ps&&d.translate(c.ps[0],c.ps[1]+c.ascent,0),d.translate(0,-c.ls,0),c.j){case 1:d.translate(c.justifyOffset+(c.boxWidth-c.lineWidths[p]),0,0);break;case 2:d.translate(c.justifyOffset+(c.boxWidth-c.lineWidths[p])/2,0,0);break}d.translate(m,x,0)},bi.prototype.buildColor=function(c){return"rgb("+Math.round(c[0]*255)+","+Math.round(c[1]*255)+","+Math.round(c[2]*255)+")"},bi.prototype.emptyProp=new $u,bi.prototype.destroy=function(){},bi.prototype.validateText=function(){(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)};var MR={shapes:[]};function fr(c,d,p){this.textSpans=[],this.renderType="svg",this.initElement(c,d,p)}f([Or,Ws,Xn,qs,Mr,Qn,bi],fr),fr.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=ke("text"))},fr.prototype.buildTextContents=function(c){for(var d=0,p=c.length,m=[],x="";d<p;)c[d]==="\r"||c[d]===""?(m.push(x),x=""):x+=c[d],d+=1;return m.push(x),m},fr.prototype.buildShapeData=function(c,d){if(c.shapes&&c.shapes.length){var p=c.shapes[0];if(p.it){var m=p.it[p.it.length-1];m.s&&(m.s.k[0]=d,m.s.k[1]=d)}}return c},fr.prototype.buildNewText=function(){this.addDynamicProperty(this);var c,d,p=this.textProperty.currentData;this.renderedLetters=b(p?p.l.length:0),p.fc?this.layerElement.setAttribute("fill",this.buildColor(p.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),p.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(p.sc)),this.layerElement.setAttribute("stroke-width",p.sw)),this.layerElement.setAttribute("font-size",p.finalSize);var m=this.globalData.fontManager.getFontByName(p.f);if(m.fClass)this.layerElement.setAttribute("class",m.fClass);else{this.layerElement.setAttribute("font-family",m.fFamily);var x=p.fWeight,S=p.fStyle;this.layerElement.setAttribute("font-style",S),this.layerElement.setAttribute("font-weight",x)}this.layerElement.setAttribute("aria-label",p.t);var T=p.l||[],k=!!this.globalData.fontManager.chars;d=T.length;var _,$=this.mHelper,V="",ie=this.data.singleShape,R=0,j=0,W=!0,H=p.tr*.001*p.finalSize;if(ie&&!k&&!p.sz){var ee=this.textContainer,G="start";switch(p.j){case 1:G="end";break;case 2:G="middle";break;default:G="start";break}ee.setAttribute("text-anchor",G),ee.setAttribute("letter-spacing",H);var F=this.buildTextContents(p.finalText);for(d=F.length,j=p.ps?p.ps[1]+p.ascent:0,c=0;c<d;c+=1)_=this.textSpans[c].span||ke("tspan"),_.textContent=F[c],_.setAttribute("x",0),_.setAttribute("y",j),_.style.display="inherit",ee.appendChild(_),this.textSpans[c]||(this.textSpans[c]={span:null,glyph:null}),this.textSpans[c].span=_,j+=p.finalLineHeight;this.layerElement.appendChild(ee)}else{var I=this.textSpans.length,P;for(c=0;c<d;c+=1){if(this.textSpans[c]||(this.textSpans[c]={span:null,childSpan:null,glyph:null}),!k||!ie||c===0){if(_=I>c?this.textSpans[c].span:ke(k?"g":"text"),I<=c){if(_.setAttribute("stroke-linecap","butt"),_.setAttribute("stroke-linejoin","round"),_.setAttribute("stroke-miterlimit","4"),this.textSpans[c].span=_,k){var U=ke("g");_.appendChild(U),this.textSpans[c].childSpan=U}this.textSpans[c].span=_,this.layerElement.appendChild(_)}_.style.display="inherit"}if($.reset(),ie&&(T[c].n&&(R=-H,j+=p.yOffset,j+=W?1:0,W=!1),this.applyTextPropertiesToMatrix(p,$,T[c].line,R,j),R+=T[c].l||0,R+=H),k){P=this.globalData.fontManager.getCharData(p.finalText[c],m.fStyle,this.globalData.fontManager.getFontByName(p.f).fFamily);var Y;if(P.t===1)Y=new ea(P.data,this.globalData,this);else{var te=MR;P.data&&P.data.shapes&&(te=this.buildShapeData(P.data,p.finalSize)),Y=new Rt(te,this.globalData,this)}if(this.textSpans[c].glyph){var ae=this.textSpans[c].glyph;this.textSpans[c].childSpan.removeChild(ae.layerElement),ae.destroy()}this.textSpans[c].glyph=Y,Y._debug=!0,Y.prepareFrame(0),Y.renderFrame(),this.textSpans[c].childSpan.appendChild(Y.layerElement),P.t===1&&this.textSpans[c].childSpan.setAttribute("transform","scale("+p.finalSize/100+","+p.finalSize/100+")")}else ie&&_.setAttribute("transform","translate("+$.props[12]+","+$.props[13]+")"),_.textContent=T[c].val,_.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}ie&&_&&_.setAttribute("d",V)}for(;c<this.textSpans.length;)this.textSpans[c].span.style.display="none",c+=1;this._sizeChanged=!0},fr.prototype.sourceRectAtTime=function(){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var c=this.layerElement.getBBox();this.bbox={top:c.y,left:c.x,width:c.width,height:c.height}}return this.bbox},fr.prototype.getValue=function(){var c,d=this.textSpans.length,p;for(this.renderedFrame=this.comp.renderedFrame,c=0;c<d;c+=1)p=this.textSpans[c].glyph,p&&(p.prepareFrame(this.comp.renderedFrame-this.data.st),p._mdf&&(this._mdf=!0))},fr.prototype.renderInnerContent=function(){if(this.validateText(),(!this.data.singleShape||this._mdf)&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){this._sizeChanged=!0;var c,d,p=this.textAnimator.renderedLetters,m=this.textProperty.currentData.l;d=m.length;var x,S,T;for(c=0;c<d;c+=1)m[c].n||(x=p[c],S=this.textSpans[c].span,T=this.textSpans[c].glyph,T&&T.renderFrame(),x._mdf.m&&S.setAttribute("transform",x.m),x._mdf.o&&S.setAttribute("opacity",x.o),x._mdf.sw&&S.setAttribute("stroke-width",x.sw),x._mdf.sc&&S.setAttribute("stroke",x.sc),x._mdf.fc&&S.setAttribute("fill",x.fc))}};function Uu(c,d,p){this.initElement(c,d,p)}f([Jn],Uu),Uu.prototype.createContent=function(){var c=ke("rect");c.setAttribute("width",this.data.sw),c.setAttribute("height",this.data.sh),c.setAttribute("fill",this.data.sc),this.layerElement.appendChild(c)};function Nr(c,d,p){this.initFrame(),this.initBaseData(c,d,p),this.initFrame(),this.initTransform(c,d,p),this.initHierarchy()}Nr.prototype.prepareFrame=function(c){this.prepareProperties(c,!0)},Nr.prototype.renderFrame=function(){},Nr.prototype.getBaseElement=function(){return null},Nr.prototype.destroy=function(){},Nr.prototype.sourceRectAtTime=function(){},Nr.prototype.hide=function(){},f([Or,Ws,qs,Mr],Nr);function $t(){}f([Wt],$t),$t.prototype.createNull=function(c){return new Nr(c,this.globalData,this)},$t.prototype.createShape=function(c){return new Rt(c,this.globalData,this)},$t.prototype.createText=function(c){return new fr(c,this.globalData,this)},$t.prototype.createImage=function(c){return new Jn(c,this.globalData,this)},$t.prototype.createSolid=function(c){return new Uu(c,this.globalData,this)},$t.prototype.configAnimation=function(c){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.svgElement.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+c.w+" "+c.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",c.w),this.svgElement.setAttribute("height",c.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)",this.svgElement.style.contentVisibility=this.renderConfig.contentVisibility),this.renderConfig.width&&this.svgElement.setAttribute("width",this.renderConfig.width),this.renderConfig.height&&this.svgElement.setAttribute("height",this.renderConfig.height),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),this.renderConfig.focusable!==void 0&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var d=this.globalData.defs;this.setupGlobalData(c,d),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=c;var p=ke("clipPath"),m=ke("rect");m.setAttribute("width",c.w),m.setAttribute("height",c.h),m.setAttribute("x",0),m.setAttribute("y",0);var x=Ce();p.setAttribute("id",x),p.appendChild(m),this.layerElement.setAttribute("clip-path","url("+u()+"#"+x+")"),d.appendChild(p),this.layers=c.layers,this.elements=b(c.layers.length)},$t.prototype.destroy=function(){this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var c,d=this.layers?this.layers.length:0;for(c=0;c<d;c+=1)this.elements[c]&&this.elements[c].destroy&&this.elements[c].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},$t.prototype.updateContainerSize=function(){},$t.prototype.findIndexByInd=function(c){var d=0,p=this.layers.length;for(d=0;d<p;d+=1)if(this.layers[d].ind===c)return d;return-1},$t.prototype.buildItem=function(c){var d=this.elements;if(!(d[c]||this.layers[c].ty===99)){d[c]=!0;var p=this.createItem(this.layers[c]);if(d[c]=p,Je()&&(this.layers[c].ty===0&&this.globalData.projectInterface.registerComposition(p),p.initExpressions()),this.appendElementInPos(p,c),this.layers[c].tt){var m="tp"in this.layers[c]?this.findIndexByInd(this.layers[c].tp):c-1;if(m===-1)return;if(!this.elements[m]||this.elements[m]===!0)this.buildItem(m),this.addPendingElement(p);else{var x=d[m],S=x.getMatte(this.layers[c].tt);p.setMatte(S)}}}},$t.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var c=this.pendingElements.pop();if(c.checkParenting(),c.data.tt)for(var d=0,p=this.elements.length;d<p;){if(this.elements[d]===c){var m="tp"in c.data?this.findIndexByInd(c.data.tp):d-1,x=this.elements[m],S=x.getMatte(this.layers[d].tt);c.setMatte(S);break}d+=1}}},$t.prototype.renderFrame=function(c){if(!(this.renderedFrame===c||this.destroyed)){c===null?c=this.renderedFrame:this.renderedFrame=c,this.globalData.frameNum=c,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=c,this.globalData._mdf=!1;var d,p=this.layers.length;for(this.completeLayers||this.checkLayers(c),d=p-1;d>=0;d-=1)(this.completeLayers||this.elements[d])&&this.elements[d].prepareFrame(c-this.layers[d].st);if(this.globalData._mdf)for(d=0;d<p;d+=1)(this.completeLayers||this.elements[d])&&this.elements[d].renderFrame()}},$t.prototype.appendElementInPos=function(c,d){var p=c.getBaseElement();if(p){for(var m=0,x;m<d;)this.elements[m]&&this.elements[m]!==!0&&this.elements[m].getBaseElement()&&(x=this.elements[m].getBaseElement()),m+=1;x?this.layerElement.insertBefore(p,x):this.layerElement.appendChild(p)}},$t.prototype.hide=function(){this.layerElement.style.display="none"},$t.prototype.show=function(){this.layerElement.style.display="block"};function pr(){}f([Or,Ws,qs,Mr,Qn],pr),pr.prototype.initElement=function(c,d,p){this.initFrame(),this.initBaseData(c,d,p),this.initTransform(c,d,p),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),(this.data.xt||!d.progressiveLoad)&&this.buildAllItems(),this.hide()},pr.prototype.prepareFrame=function(c){if(this._mdf=!1,this.prepareRenderableFrame(c),this.prepareProperties(c,this.isInRange),!(!this.isInRange&&!this.data.xt)){if(this.tm._placeholder)this.renderedFrame=c/this.data.sr;else{var d=this.tm.v;d===this.data.op&&(d=this.data.op-1),this.renderedFrame=d}var p,m=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),p=m-1;p>=0;p-=1)(this.completeLayers||this.elements[p])&&(this.elements[p].prepareFrame(this.renderedFrame-this.layers[p].st),this.elements[p]._mdf&&(this._mdf=!0))}},pr.prototype.renderInnerContent=function(){var c,d=this.layers.length;for(c=0;c<d;c+=1)(this.completeLayers||this.elements[c])&&this.elements[c].renderFrame()},pr.prototype.setElements=function(c){this.elements=c},pr.prototype.getElements=function(){return this.elements},pr.prototype.destroyElements=function(){var c,d=this.layers.length;for(c=0;c<d;c+=1)this.elements[c]&&this.elements[c].destroy()},pr.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()};function ea(c,d,p){this.layers=c.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?b(this.layers.length):[],this.initElement(c,d,p),this.tm=c.tm?_e.getProp(this,c.tm,0,d.frameRate,this):{_placeholder:!0}}f([$t,pr,Xn],ea),ea.prototype.createComp=function(c){return new ea(c,this.globalData,this)};function Gu(c,d){this.animationItem=c,this.layers=null,this.renderedFrame=-1,this.svgElement=ke("svg");var p="";if(d&&d.title){var m=ke("title"),x=Ce();m.setAttribute("id",x),m.textContent=d.title,this.svgElement.appendChild(m),p+=x}if(d&&d.description){var S=ke("desc"),T=Ce();S.setAttribute("id",T),S.textContent=d.description,this.svgElement.appendChild(S),p+=" "+T}p&&this.svgElement.setAttribute("aria-labelledby",p);var k=ke("defs");this.svgElement.appendChild(k);var _=ke("g");this.svgElement.appendChild(_),this.layerElement=_,this.renderConfig={preserveAspectRatio:d&&d.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:d&&d.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:d&&d.contentVisibility||"visible",progressiveLoad:d&&d.progressiveLoad||!1,hideOnTransparent:!(d&&d.hideOnTransparent===!1),viewBoxOnly:d&&d.viewBoxOnly||!1,viewBoxSize:d&&d.viewBoxSize||!1,className:d&&d.className||"",id:d&&d.id||"",focusable:d&&d.focusable,filterSize:{width:d&&d.filterSize&&d.filterSize.width||"100%",height:d&&d.filterSize&&d.filterSize.height||"100%",x:d&&d.filterSize&&d.filterSize.x||"0%",y:d&&d.filterSize&&d.filterSize.y||"0%"},width:d&&d.width,height:d&&d.height,runExpressions:!d||d.runExpressions===void 0||d.runExpressions},this.globalData={_mdf:!1,frameNum:-1,defs:k,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}return f([$t],Gu),Gu.prototype.createComp=function(c){return new ea(c,this.globalData,this)},ur("svg",Gu),kr.registerModifier("tm",Di),kr.registerModifier("pb",jn),kr.registerModifier("rp",Zi),kr.registerModifier("rd",Hn),kr.registerModifier("zz",zn),kr.registerModifier("op",Wn),Fe})})(fu,fu.exports);var bL=fu.exports;const EL=K0(bL);function wL({loop:r=!1,path:e,animationData:t,className:i,onComplete:s}){const n=de.useRef(null);return de.useEffect(()=>{if(!n.current)return;const a=EL.loadAnimation({container:n.current,renderer:"svg",autoplay:!0,loop:r,path:e,animationData:t});return s&&a.addEventListener("complete",s),()=>{s&&a.removeEventListener("complete",s),a.destroy()}},[r,e,s,t]),We.jsx("div",{ref:n,className:i})}const TL={v:"5.5.7",fr:30,ip:0,op:31,w:360,h:360,nm:"forward right",ddd:0,assets:[],layers:[{ddd:0,ind:1,ty:4,nm:"Layer 2",sr:1,ks:{o:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:0,s:[0]},{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:10,s:[100]},{t:20,s:[0]}],ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[161.086,180,0],ix:2},a:{a:0,k:[-18.914,0,0],ix:1},s:{a:0,k:[100,100,100],ix:6}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,.923],[0,0],[-.777,-.499],[0,0],[.714,-.459],[0,0]],o:[[0,0],[0,-.923],[0,0],[.714,.459],[0,0],[-.777,.499]],v:[[-26.586,8.363],[-26.586,-8.363],[-24.788,-9.344],[-11.779,-.981],[-11.779,.981],[-24.788,9.344]],c:!0},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"fl",c:{a:0,k:[1,1,1,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Fill 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Group 1",np:2,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:0,op:300,st:0,bm:0},{ddd:0,ind:2,ty:4,nm:"Layer 1",sr:1,ks:{o:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:5,s:[0]},{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:15,s:[100]},{t:25,s:[0]}],ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[179.914,180,0],ix:2},a:{a:0,k:[-.086,0,0],ix:1},s:{a:0,k:[100,100,100],ix:6}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,.923],[0,0],[-.777,-.499],[0,0],[.714,-.459],[0,0]],o:[[0,0],[0,-.923],[0,0],[.714,.459],[0,0],[-.777,.499]],v:[[-7.757,8.363],[-7.757,-8.363],[-5.959,-9.344],[7.05,-.981],[7.05,.981],[-5.959,9.344]],c:!0},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"fl",c:{a:0,k:[1,1,1,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Fill 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Group 1",np:2,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:0,op:300,st:0,bm:0},{ddd:0,ind:3,ty:4,nm:"Layer 3",sr:1,ks:{o:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:10,s:[0]},{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:20,s:[100]},{t:30,s:[0]}],ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[198.914,180,0],ix:2},a:{a:0,k:[18.914,0,0],ix:1},s:{a:0,k:[100,100,100],ix:6}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,.923],[0,0],[-.777,-.499],[0,0],[.714,-.459],[0,0]],o:[[0,0],[0,-.923],[0,0],[.714,.459],[0,0],[-.777,.499]],v:[[11.243,8.363],[11.243,-8.363],[13.041,-9.344],[26.05,-.981],[26.05,.981],[13.041,9.344]],c:!0},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"fl",c:{a:0,k:[1,1,1,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Fill 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Group 1",np:2,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:0,op:300,st:0,bm:0}],markers:[]},ao={root:"_root_1v1it_1",chapter_img:"_chapter_img_1v1it_20",name:"_name_1v1it_26",time:"_time_1v1it_37"};function AL({width:r,height:e,src:t,alt:i,draggable:s=!1,className:n}){return We.jsxs("picture",{children:[We.jsx("source",{type:"image/webp",srcSet:`${ym({f:"webp",h:e,w:r},t)}`,height:e}),We.jsx("img",{src:`${ym({h:e,w:r},t)}`,alt:i,draggable:s,width:r,height:e,className:n})]})}function _L({name:r,time:e,imageUrl:t,className:i,onClick:s}){return We.jsxs("div",{className:`${ao.root} ${i||""}`,onClick:s,children:[We.jsx(AL,{className:ao.chapter_img,src:t,width:90,height:130,alt:"챕터 이미지"}),We.jsx("div",{className:ao.name,children:r}),We.jsx("div",{className:ao.time,children:e})]})}const CL=de.forwardRef(({src:r,ratio:e=!1,shadow:t=!0,controls:i=!0,posterSrc:s,initialTime:n,timeOffsetStart:a,timeOffsetEnd:o,quality:l,chapter:u,debug:h,loop:f,live:g,renderControls:v,onClick:y,onInit:b,onDestroy:E,onSync:A,className:M},D)=>{const[B,N]=tp(!1),[J,Z]=tp(!1),[se,Q]=ew("",650),{ref:q,live:oe,time:me,play:he,playbackRate:Ee,handleSeektime:we,handleBackward:ue,handleForward:ge,handlePlayToggle:Ce,handlePlaybackRate:ve}=SC({src:r,timeUpdateEvent:B,initialTime:n,timeOffsetStart:a,timeOffsetEnd:o,quality:l,debug:h,onSync:A,onInit:b,onDestroy:E}),Se=ZE({onClick:N,onDoubleClick:et=>{if(!i)return;const lt=et.target.getBoundingClientRect(),Je=lt.left+lt.width/2;et.clientX<Je?(ue(),Q("left")):(ge(),Q("right"))}}),qe=(et,lt)=>{if(et.stopPropagation(),!q.current)return;const Je=lt*((o??q.current.duration)-(a??0))/100;we(Je)},Ue=()=>{Z()},Xe=et=>lt=>{lt.stopPropagation(),et()};de.useEffect(()=>{y==null||y(B)},[B,y]);const it=!(g||oe);return We.jsxs("div",{ref:D,className:`${Tt.root} ${M||""}`,children:[We.jsx("video",{className:`${Tt.video} ${e?Tt.origin_ratio:""}`,ref:q,muted:!0,playsInline:!0,loop:f}),s&&We.jsx("div",{className:`${Tt.poster} ${e?Tt.origin_ratio:""}`,style:{backgroundImage:`url("${s}?h=1600&f=webp")`}}),We.jsxs("div",{className:`${Tt.layer} ${t?Tt.shadow:""}`,onClick:Se,children:[se&&We.jsx("div",{className:`${Tt.indicator} ${Tt[`indicator_${se}`]}`,children:We.jsx(wL,{animationData:TL,loop:!0})}),i&&B&&We.jsxs(We.Fragment,{children:[it&&We.jsx(mm,{handle:!0,className:Tt.progress,progress:me.progress,onChangeProgress:qe}),it&&We.jsx(uL,{className:Tt.time,currentTime:me.currentTime,durationTime:me.durationTime}),it&&We.jsxs("button",{className:`${Tt.button} ${Tt.playbackrate}`,onClick:Xe(ve),"aria-label":"비디오 배속",children:[Ee,"x"]}),We.jsx("button",{className:`${Tt.button} ${Tt.play_toggle}`,onClick:Xe(Ce),"aria-label":"비디오 재생",children:We.jsx(Un,{name:he?"pause":"play"})}),it&&We.jsx("button",{className:`${Tt.button} ${Tt.backward}`,onClick:Xe(ue),"aria-label":"비디오 10초 뒤로",children:We.jsx(Un,{name:"backward"})}),it&&We.jsx("button",{className:`${Tt.button} ${Tt.forward}`,onClick:Xe(ge),"aria-label":"비디오 10초 앞으로",children:We.jsx(Un,{name:"forward"})}),!!u&&it&&We.jsx("button",{className:`${Tt.button} ${Tt.chapter_toggle}`,"aria-label":"비디오 챕터",onClick:Xe(Ue),children:Vt.t("chapter")}),!!u&&J&&We.jsx("div",{className:Tt.chapter_wrap,children:u==null?void 0:u.map(et=>We.jsx(_L,{...et,onClick:Xe(()=>we(bC(et.time)))},et.id))})]}),B&&(v==null?void 0:v({time:me,play:he,handlePlayToggle:Ce,handleChangeProgress:qe}))]})]})});function Vm(r){return r!==null&&typeof r=="object"&&"constructor"in r&&r.constructor===Object}function pu(r,e){r===void 0&&(r={}),e===void 0&&(e={}),Object.keys(e).forEach(t=>{typeof r[t]>"u"?r[t]=e[t]:Vm(e[t])&&Vm(r[t])&&Object.keys(e[t]).length>0&&pu(r[t],e[t])})}const jm={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function Fs(){const r=typeof document<"u"?document:{};return pu(r,jm),r}const LL={document:jm,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(r){return typeof setTimeout>"u"?(r(),null):setTimeout(r,0)},cancelAnimationFrame(r){typeof setTimeout>"u"||clearTimeout(r)}};function ui(){const r=typeof window<"u"?window:{};return pu(r,LL),r}function IL(r){return r===void 0&&(r=""),r.trim().split(" ").filter(e=>!!e.trim())}function RL(r){const e=r;Object.keys(e).forEach(t=>{try{e[t]=null}catch{}try{delete e[t]}catch{}})}function gu(r,e){return e===void 0&&(e=0),setTimeout(r,e)}function oo(){return Date.now()}function PL(r){const e=ui();let t;return e.getComputedStyle&&(t=e.getComputedStyle(r,null)),!t&&r.currentStyle&&(t=r.currentStyle),t||(t=r.style),t}function kL(r,e){e===void 0&&(e="x");const t=ui();let i,s,n;const a=PL(r);return t.WebKitCSSMatrix?(s=a.transform||a.webkitTransform,s.split(",").length>6&&(s=s.split(", ").map(o=>o.replace(",",".")).join(", ")),n=new t.WebKitCSSMatrix(s==="none"?"":s)):(n=a.MozTransform||a.OTransform||a.MsTransform||a.msTransform||a.transform||a.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),i=n.toString().split(",")),e==="x"&&(t.WebKitCSSMatrix?s=n.m41:i.length===16?s=parseFloat(i[12]):s=parseFloat(i[4])),e==="y"&&(t.WebKitCSSMatrix?s=n.m42:i.length===16?s=parseFloat(i[13]):s=parseFloat(i[5])),s||0}function lo(r){return typeof r=="object"&&r!==null&&r.constructor&&Object.prototype.toString.call(r).slice(8,-1)==="Object"}function DL(r){return typeof window<"u"&&typeof window.HTMLElement<"u"?r instanceof HTMLElement:r&&(r.nodeType===1||r.nodeType===11)}function hi(){const r=Object(arguments.length<=0?void 0:arguments[0]),e=["__proto__","constructor","prototype"];for(let t=1;t<arguments.length;t+=1){const i=t<0||arguments.length<=t?void 0:arguments[t];if(i!=null&&!DL(i)){const s=Object.keys(Object(i)).filter(n=>e.indexOf(n)<0);for(let n=0,a=s.length;n<a;n+=1){const o=s[n],l=Object.getOwnPropertyDescriptor(i,o);l!==void 0&&l.enumerable&&(lo(r[o])&&lo(i[o])?i[o].__swiper__?r[o]=i[o]:hi(r[o],i[o]):!lo(r[o])&&lo(i[o])?(r[o]={},i[o].__swiper__?r[o]=i[o]:hi(r[o],i[o])):r[o]=i[o])}}}return r}function co(r,e,t){r.style.setProperty(e,t)}function Hm(r){let{swiper:e,targetPosition:t,side:i}=r;const s=ui(),n=-e.translate;let a=null,o;const l=e.params.speed;e.wrapperEl.style.scrollSnapType="none",s.cancelAnimationFrame(e.cssModeFrameID);const u=t>n?"next":"prev",h=(g,v)=>u==="next"&&g>=v||u==="prev"&&g<=v,f=()=>{o=new Date().getTime(),a===null&&(a=o);const g=Math.max(Math.min((o-a)/l,1),0),v=.5-Math.cos(g*Math.PI)/2;let y=n+v*(t-n);if(h(y,t)&&(y=t),e.wrapperEl.scrollTo({[i]:y}),h(y,t)){e.wrapperEl.style.overflow="hidden",e.wrapperEl.style.scrollSnapType="",setTimeout(()=>{e.wrapperEl.style.overflow="",e.wrapperEl.scrollTo({[i]:y})}),s.cancelAnimationFrame(e.cssModeFrameID);return}e.cssModeFrameID=s.requestAnimationFrame(f)};f()}function lr(r,e){return e===void 0&&(e=""),[...r.children].filter(t=>t.matches(e))}function uo(r){try{console.warn(r);return}catch{}}function mu(r,e){e===void 0&&(e=[]);const t=document.createElement(r);return t.classList.add(...Array.isArray(e)?e:IL(e)),t}function OL(r,e){const t=[];for(;r.previousElementSibling;){const i=r.previousElementSibling;e?i.matches(e)&&t.push(i):t.push(i),r=i}return t}function ML(r,e){const t=[];for(;r.nextElementSibling;){const i=r.nextElementSibling;e?i.matches(e)&&t.push(i):t.push(i),r=i}return t}function Lr(r,e){return ui().getComputedStyle(r,null).getPropertyValue(e)}function Km(r){let e=r,t;if(e){for(t=0;(e=e.previousSibling)!==null;)e.nodeType===1&&(t+=1);return t}}function FL(r,e){const t=[];let i=r.parentElement;for(;i;)t.push(i),i=i.parentElement;return t}function zm(r,e,t){const i=ui();return r[e==="width"?"offsetWidth":"offsetHeight"]+parseFloat(i.getComputedStyle(r,null).getPropertyValue(e==="width"?"margin-right":"margin-top"))+parseFloat(i.getComputedStyle(r,null).getPropertyValue(e==="width"?"margin-left":"margin-bottom"))}let vu;function NL(){const r=ui(),e=Fs();return{smoothScroll:e.documentElement&&e.documentElement.style&&"scrollBehavior"in e.documentElement.style,touch:!!("ontouchstart"in r||r.DocumentTouch&&e instanceof r.DocumentTouch)}}function Wm(){return vu||(vu=NL()),vu}let yu;function BL(r){let{userAgent:e}=r===void 0?{}:r;const t=Wm(),i=ui(),s=i.navigator.platform,n=e||i.navigator.userAgent,a={ios:!1,android:!1},o=i.screen.width,l=i.screen.height,u=n.match(/(Android);?[\s\/]+([\d.]+)?/);let h=n.match(/(iPad).*OS\s([\d_]+)/);const f=n.match(/(iPod)(.*OS\s([\d_]+))?/),g=!h&&n.match(/(iPhone\sOS|iOS)\s([\d_]+)/),v=s==="Win32";let y=s==="MacIntel";const b=["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"];return!h&&y&&t.touch&&b.indexOf(`${o}x${l}`)>=0&&(h=n.match(/(Version)\/([\d.]+)/),h||(h=[0,1,"13_0_0"]),y=!1),u&&!v&&(a.os="android",a.android=!0),(h||g||f)&&(a.os="ios",a.ios=!0),a}function qm(r){return r===void 0&&(r={}),yu||(yu=BL(r)),yu}let Su;function $L(){const r=ui(),e=qm();let t=!1;function i(){const o=r.navigator.userAgent.toLowerCase();return o.indexOf("safari")>=0&&o.indexOf("chrome")<0&&o.indexOf("android")<0}if(i()){const o=String(r.navigator.userAgent);if(o.includes("Version/")){const[l,u]=o.split("Version/")[1].split(" ")[0].split(".").map(h=>Number(h));t=l<16||l===16&&u<2}}const s=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(r.navigator.userAgent),n=i(),a=n||s&&e.ios;return{isSafari:t||n,needPerspectiveFix:t,need3dFix:a,isWebView:s}}function UL(){return Su||(Su=$L()),Su}function GL(r){let{swiper:e,on:t,emit:i}=r;const s=ui();let n=null,a=null;const o=()=>{!e||e.destroyed||!e.initialized||(i("beforeResize"),i("resize"))},l=()=>{!e||e.destroyed||!e.initialized||(n=new ResizeObserver(f=>{a=s.requestAnimationFrame(()=>{const{width:g,height:v}=e;let y=g,b=v;f.forEach(E=>{let{contentBoxSize:A,contentRect:M,target:D}=E;D&&D!==e.el||(y=M?M.width:(A[0]||A).inlineSize,b=M?M.height:(A[0]||A).blockSize)}),(y!==g||b!==v)&&o()})}),n.observe(e.el))},u=()=>{a&&s.cancelAnimationFrame(a),n&&n.unobserve&&e.el&&(n.unobserve(e.el),n=null)},h=()=>{!e||e.destroyed||!e.initialized||i("orientationchange")};t("init",()=>{if(e.params.resizeObserver&&typeof s.ResizeObserver<"u"){l();return}s.addEventListener("resize",o),s.addEventListener("orientationchange",h)}),t("destroy",()=>{u(),s.removeEventListener("resize",o),s.removeEventListener("orientationchange",h)})}function VL(r){let{swiper:e,extendParams:t,on:i,emit:s}=r;const n=[],a=ui(),o=function(h,f){f===void 0&&(f={});const g=a.MutationObserver||a.WebkitMutationObserver,v=new g(y=>{if(e.__preventObserver__)return;if(y.length===1){s("observerUpdate",y[0]);return}const b=function(){s("observerUpdate",y[0])};a.requestAnimationFrame?a.requestAnimationFrame(b):a.setTimeout(b,0)});v.observe(h,{attributes:typeof f.attributes>"u"?!0:f.attributes,childList:typeof f.childList>"u"?!0:f.childList,characterData:typeof f.characterData>"u"?!0:f.characterData}),n.push(v)},l=()=>{if(e.params.observer){if(e.params.observeParents){const h=FL(e.hostEl);for(let f=0;f<h.length;f+=1)o(h[f])}o(e.hostEl,{childList:e.params.observeSlideChildren}),o(e.wrapperEl,{attributes:!1})}},u=()=>{n.forEach(h=>{h.disconnect()}),n.splice(0,n.length)};t({observer:!1,observeParents:!1,observeSlideChildren:!1}),i("init",l),i("destroy",u)}var jL={on(r,e,t){const i=this;if(!i.eventsListeners||i.destroyed||typeof e!="function")return i;const s=t?"unshift":"push";return r.split(" ").forEach(n=>{i.eventsListeners[n]||(i.eventsListeners[n]=[]),i.eventsListeners[n][s](e)}),i},once(r,e,t){const i=this;if(!i.eventsListeners||i.destroyed||typeof e!="function")return i;function s(){i.off(r,s),s.__emitterProxy&&delete s.__emitterProxy;for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];e.apply(i,a)}return s.__emitterProxy=e,i.on(r,s,t)},onAny(r,e){const t=this;if(!t.eventsListeners||t.destroyed||typeof r!="function")return t;const i=e?"unshift":"push";return t.eventsAnyListeners.indexOf(r)<0&&t.eventsAnyListeners[i](r),t},offAny(r){const e=this;if(!e.eventsListeners||e.destroyed||!e.eventsAnyListeners)return e;const t=e.eventsAnyListeners.indexOf(r);return t>=0&&e.eventsAnyListeners.splice(t,1),e},off(r,e){const t=this;return!t.eventsListeners||t.destroyed||!t.eventsListeners||r.split(" ").forEach(i=>{typeof e>"u"?t.eventsListeners[i]=[]:t.eventsListeners[i]&&t.eventsListeners[i].forEach((s,n)=>{(s===e||s.__emitterProxy&&s.__emitterProxy===e)&&t.eventsListeners[i].splice(n,1)})}),t},emit(){const r=this;if(!r.eventsListeners||r.destroyed||!r.eventsListeners)return r;let e,t,i;for(var s=arguments.length,n=new Array(s),a=0;a<s;a++)n[a]=arguments[a];return typeof n[0]=="string"||Array.isArray(n[0])?(e=n[0],t=n.slice(1,n.length),i=r):(e=n[0].events,t=n[0].data,i=n[0].context||r),t.unshift(i),(Array.isArray(e)?e:e.split(" ")).forEach(l=>{r.eventsAnyListeners&&r.eventsAnyListeners.length&&r.eventsAnyListeners.forEach(u=>{u.apply(i,[l,...t])}),r.eventsListeners&&r.eventsListeners[l]&&r.eventsListeners[l].forEach(u=>{u.apply(i,t)})}),r}};function HL(){const r=this;let e,t;const i=r.el;typeof r.params.width<"u"&&r.params.width!==null?e=r.params.width:e=i.clientWidth,typeof r.params.height<"u"&&r.params.height!==null?t=r.params.height:t=i.clientHeight,!(e===0&&r.isHorizontal()||t===0&&r.isVertical())&&(e=e-parseInt(Lr(i,"padding-left")||0,10)-parseInt(Lr(i,"padding-right")||0,10),t=t-parseInt(Lr(i,"padding-top")||0,10)-parseInt(Lr(i,"padding-bottom")||0,10),Number.isNaN(e)&&(e=0),Number.isNaN(t)&&(t=0),Object.assign(r,{width:e,height:t,size:r.isHorizontal()?e:t}))}function KL(){const r=this;function e(q,oe){return parseFloat(q.getPropertyValue(r.getDirectionLabel(oe))||0)}const t=r.params,{wrapperEl:i,slidesEl:s,size:n,rtlTranslate:a,wrongRTL:o}=r,l=r.virtual&&t.virtual.enabled,u=l?r.virtual.slides.length:r.slides.length,h=lr(s,`.${r.params.slideClass}, swiper-slide`),f=l?r.virtual.slides.length:h.length;let g=[];const v=[],y=[];let b=t.slidesOffsetBefore;typeof b=="function"&&(b=t.slidesOffsetBefore.call(r));let E=t.slidesOffsetAfter;typeof E=="function"&&(E=t.slidesOffsetAfter.call(r));const A=r.snapGrid.length,M=r.slidesGrid.length;let D=t.spaceBetween,B=-b,N=0,J=0;if(typeof n>"u")return;typeof D=="string"&&D.indexOf("%")>=0?D=parseFloat(D.replace("%",""))/100*n:typeof D=="string"&&(D=parseFloat(D)),r.virtualSize=-D,h.forEach(q=>{a?q.style.marginLeft="":q.style.marginRight="",q.style.marginBottom="",q.style.marginTop=""}),t.centeredSlides&&t.cssMode&&(co(i,"--swiper-centered-offset-before",""),co(i,"--swiper-centered-offset-after",""));const Z=t.grid&&t.grid.rows>1&&r.grid;Z?r.grid.initSlides(h):r.grid&&r.grid.unsetSlides();let se;const Q=t.slidesPerView==="auto"&&t.breakpoints&&Object.keys(t.breakpoints).filter(q=>typeof t.breakpoints[q].slidesPerView<"u").length>0;for(let q=0;q<f;q+=1){se=0;let oe;if(h[q]&&(oe=h[q]),Z&&r.grid.updateSlide(q,oe,h),!(h[q]&&Lr(oe,"display")==="none")){if(t.slidesPerView==="auto"){Q&&(h[q].style[r.getDirectionLabel("width")]="");const me=getComputedStyle(oe),he=oe.style.transform,Ee=oe.style.webkitTransform;if(he&&(oe.style.transform="none"),Ee&&(oe.style.webkitTransform="none"),t.roundLengths)se=r.isHorizontal()?zm(oe,"width"):zm(oe,"height");else{const we=e(me,"width"),ue=e(me,"padding-left"),ge=e(me,"padding-right"),Ce=e(me,"margin-left"),ve=e(me,"margin-right"),Se=me.getPropertyValue("box-sizing");if(Se&&Se==="border-box")se=we+Ce+ve;else{const{clientWidth:qe,offsetWidth:Ue}=oe;se=we+ue+ge+Ce+ve+(Ue-qe)}}he&&(oe.style.transform=he),Ee&&(oe.style.webkitTransform=Ee),t.roundLengths&&(se=Math.floor(se))}else se=(n-(t.slidesPerView-1)*D)/t.slidesPerView,t.roundLengths&&(se=Math.floor(se)),h[q]&&(h[q].style[r.getDirectionLabel("width")]=`${se}px`);h[q]&&(h[q].swiperSlideSize=se),y.push(se),t.centeredSlides?(B=B+se/2+N/2+D,N===0&&q!==0&&(B=B-n/2-D),q===0&&(B=B-n/2-D),Math.abs(B)<1/1e3&&(B=0),t.roundLengths&&(B=Math.floor(B)),J%t.slidesPerGroup===0&&g.push(B),v.push(B)):(t.roundLengths&&(B=Math.floor(B)),(J-Math.min(r.params.slidesPerGroupSkip,J))%r.params.slidesPerGroup===0&&g.push(B),v.push(B),B=B+se+D),r.virtualSize+=se+D,N=se,J+=1}}if(r.virtualSize=Math.max(r.virtualSize,n)+E,a&&o&&(t.effect==="slide"||t.effect==="coverflow")&&(i.style.width=`${r.virtualSize+D}px`),t.setWrapperSize&&(i.style[r.getDirectionLabel("width")]=`${r.virtualSize+D}px`),Z&&r.grid.updateWrapperSize(se,g),!t.centeredSlides){const q=[];for(let oe=0;oe<g.length;oe+=1){let me=g[oe];t.roundLengths&&(me=Math.floor(me)),g[oe]<=r.virtualSize-n&&q.push(me)}g=q,Math.floor(r.virtualSize-n)-Math.floor(g[g.length-1])>1&&g.push(r.virtualSize-n)}if(l&&t.loop){const q=y[0]+D;if(t.slidesPerGroup>1){const oe=Math.ceil((r.virtual.slidesBefore+r.virtual.slidesAfter)/t.slidesPerGroup),me=q*t.slidesPerGroup;for(let he=0;he<oe;he+=1)g.push(g[g.length-1]+me)}for(let oe=0;oe<r.virtual.slidesBefore+r.virtual.slidesAfter;oe+=1)t.slidesPerGroup===1&&g.push(g[g.length-1]+q),v.push(v[v.length-1]+q),r.virtualSize+=q}if(g.length===0&&(g=[0]),D!==0){const q=r.isHorizontal()&&a?"marginLeft":r.getDirectionLabel("marginRight");h.filter((oe,me)=>!t.cssMode||t.loop?!0:me!==h.length-1).forEach(oe=>{oe.style[q]=`${D}px`})}if(t.centeredSlides&&t.centeredSlidesBounds){let q=0;y.forEach(me=>{q+=me+(D||0)}),q-=D;const oe=q-n;g=g.map(me=>me<=0?-b:me>oe?oe+E:me)}if(t.centerInsufficientSlides){let q=0;y.forEach(me=>{q+=me+(D||0)}),q-=D;const oe=(t.slidesOffsetBefore||0)+(t.slidesOffsetAfter||0);if(q+oe<n){const me=(n-q-oe)/2;g.forEach((he,Ee)=>{g[Ee]=he-me}),v.forEach((he,Ee)=>{v[Ee]=he+me})}}if(Object.assign(r,{slides:h,snapGrid:g,slidesGrid:v,slidesSizesGrid:y}),t.centeredSlides&&t.cssMode&&!t.centeredSlidesBounds){co(i,"--swiper-centered-offset-before",`${-g[0]}px`),co(i,"--swiper-centered-offset-after",`${r.size/2-y[y.length-1]/2}px`);const q=-r.snapGrid[0],oe=-r.slidesGrid[0];r.snapGrid=r.snapGrid.map(me=>me+q),r.slidesGrid=r.slidesGrid.map(me=>me+oe)}if(f!==u&&r.emit("slidesLengthChange"),g.length!==A&&(r.params.watchOverflow&&r.checkOverflow(),r.emit("snapGridLengthChange")),v.length!==M&&r.emit("slidesGridLengthChange"),t.watchSlidesProgress&&r.updateSlidesOffset(),r.emit("slidesUpdated"),!l&&!t.cssMode&&(t.effect==="slide"||t.effect==="fade")){const q=`${t.containerModifierClass}backface-hidden`,oe=r.el.classList.contains(q);f<=t.maxBackfaceHiddenSlides?oe||r.el.classList.add(q):oe&&r.el.classList.remove(q)}}function zL(r){const e=this,t=[],i=e.virtual&&e.params.virtual.enabled;let s=0,n;typeof r=="number"?e.setTransition(r):r===!0&&e.setTransition(e.params.speed);const a=o=>i?e.slides[e.getSlideIndexByData(o)]:e.slides[o];if(e.params.slidesPerView!=="auto"&&e.params.slidesPerView>1)if(e.params.centeredSlides)(e.visibleSlides||[]).forEach(o=>{t.push(o)});else for(n=0;n<Math.ceil(e.params.slidesPerView);n+=1){const o=e.activeIndex+n;if(o>e.slides.length&&!i)break;t.push(a(o))}else t.push(a(e.activeIndex));for(n=0;n<t.length;n+=1)if(typeof t[n]<"u"){const o=t[n].offsetHeight;s=o>s?o:s}(s||s===0)&&(e.wrapperEl.style.height=`${s}px`)}function WL(){const r=this,e=r.slides,t=r.isElement?r.isHorizontal()?r.wrapperEl.offsetLeft:r.wrapperEl.offsetTop:0;for(let i=0;i<e.length;i+=1)e[i].swiperSlideOffset=(r.isHorizontal()?e[i].offsetLeft:e[i].offsetTop)-t-r.cssOverflowAdjustment()}const Ym=(r,e,t)=>{e&&!r.classList.contains(t)?r.classList.add(t):!e&&r.classList.contains(t)&&r.classList.remove(t)};function qL(r){r===void 0&&(r=this&&this.translate||0);const e=this,t=e.params,{slides:i,rtlTranslate:s,snapGrid:n}=e;if(i.length===0)return;typeof i[0].swiperSlideOffset>"u"&&e.updateSlidesOffset();let a=-r;s&&(a=r),e.visibleSlidesIndexes=[],e.visibleSlides=[];let o=t.spaceBetween;typeof o=="string"&&o.indexOf("%")>=0?o=parseFloat(o.replace("%",""))/100*e.size:typeof o=="string"&&(o=parseFloat(o));for(let l=0;l<i.length;l+=1){const u=i[l];let h=u.swiperSlideOffset;t.cssMode&&t.centeredSlides&&(h-=i[0].swiperSlideOffset);const f=(a+(t.centeredSlides?e.minTranslate():0)-h)/(u.swiperSlideSize+o),g=(a-n[0]+(t.centeredSlides?e.minTranslate():0)-h)/(u.swiperSlideSize+o),v=-(a-h),y=v+e.slidesSizesGrid[l],b=v>=0&&v<=e.size-e.slidesSizesGrid[l],E=v>=0&&v<e.size-1||y>1&&y<=e.size||v<=0&&y>=e.size;E&&(e.visibleSlides.push(u),e.visibleSlidesIndexes.push(l)),Ym(u,E,t.slideVisibleClass),Ym(u,b,t.slideFullyVisibleClass),u.progress=s?-f:f,u.originalProgress=s?-g:g}}function YL(r){const e=this;if(typeof r>"u"){const h=e.rtlTranslate?-1:1;r=e&&e.translate&&e.translate*h||0}const t=e.params,i=e.maxTranslate()-e.minTranslate();let{progress:s,isBeginning:n,isEnd:a,progressLoop:o}=e;const l=n,u=a;if(i===0)s=0,n=!0,a=!0;else{s=(r-e.minTranslate())/i;const h=Math.abs(r-e.minTranslate())<1,f=Math.abs(r-e.maxTranslate())<1;n=h||s<=0,a=f||s>=1,h&&(s=0),f&&(s=1)}if(t.loop){const h=e.getSlideIndexByData(0),f=e.getSlideIndexByData(e.slides.length-1),g=e.slidesGrid[h],v=e.slidesGrid[f],y=e.slidesGrid[e.slidesGrid.length-1],b=Math.abs(r);b>=g?o=(b-g)/y:o=(b+y-v)/y,o>1&&(o-=1)}Object.assign(e,{progress:s,progressLoop:o,isBeginning:n,isEnd:a}),(t.watchSlidesProgress||t.centeredSlides&&t.autoHeight)&&e.updateSlidesProgress(r),n&&!l&&e.emit("reachBeginning toEdge"),a&&!u&&e.emit("reachEnd toEdge"),(l&&!n||u&&!a)&&e.emit("fromEdge"),e.emit("progress",s)}const xu=(r,e,t)=>{e&&!r.classList.contains(t)?r.classList.add(t):!e&&r.classList.contains(t)&&r.classList.remove(t)};function XL(){const r=this,{slides:e,params:t,slidesEl:i,activeIndex:s}=r,n=r.virtual&&t.virtual.enabled,a=r.grid&&t.grid&&t.grid.rows>1,o=f=>lr(i,`.${t.slideClass}${f}, swiper-slide${f}`)[0];let l,u,h;if(n)if(t.loop){let f=s-r.virtual.slidesBefore;f<0&&(f=r.virtual.slides.length+f),f>=r.virtual.slides.length&&(f-=r.virtual.slides.length),l=o(`[data-swiper-slide-index="${f}"]`)}else l=o(`[data-swiper-slide-index="${s}"]`);else a?(l=e.filter(f=>f.column===s)[0],h=e.filter(f=>f.column===s+1)[0],u=e.filter(f=>f.column===s-1)[0]):l=e[s];l&&(a||(h=ML(l,`.${t.slideClass}, swiper-slide`)[0],t.loop&&!h&&(h=e[0]),u=OL(l,`.${t.slideClass}, swiper-slide`)[0],t.loop&&!u===0&&(u=e[e.length-1]))),e.forEach(f=>{xu(f,f===l,t.slideActiveClass),xu(f,f===h,t.slideNextClass),xu(f,f===u,t.slidePrevClass)}),r.emitSlidesClasses()}const ho=(r,e)=>{if(!r||r.destroyed||!r.params)return;const t=()=>r.isElement?"swiper-slide":`.${r.params.slideClass}`,i=e.closest(t());if(i){let s=i.querySelector(`.${r.params.lazyPreloaderClass}`);!s&&r.isElement&&(i.shadowRoot?s=i.shadowRoot.querySelector(`.${r.params.lazyPreloaderClass}`):requestAnimationFrame(()=>{i.shadowRoot&&(s=i.shadowRoot.querySelector(`.${r.params.lazyPreloaderClass}`),s&&s.remove())})),s&&s.remove()}},bu=(r,e)=>{if(!r.slides[e])return;const t=r.slides[e].querySelector('[loading="lazy"]');t&&t.removeAttribute("loading")},Eu=r=>{if(!r||r.destroyed||!r.params)return;let e=r.params.lazyPreloadPrevNext;const t=r.slides.length;if(!t||!e||e<0)return;e=Math.min(e,t);const i=r.params.slidesPerView==="auto"?r.slidesPerViewDynamic():Math.ceil(r.params.slidesPerView),s=r.activeIndex;if(r.params.grid&&r.params.grid.rows>1){const a=s,o=[a-e];o.push(...Array.from({length:e}).map((l,u)=>a+i+u)),r.slides.forEach((l,u)=>{o.includes(l.column)&&bu(r,u)});return}const n=s+i-1;if(r.params.rewind||r.params.loop)for(let a=s-e;a<=n+e;a+=1){const o=(a%t+t)%t;(o<s||o>n)&&bu(r,o)}else for(let a=Math.max(s-e,0);a<=Math.min(n+e,t-1);a+=1)a!==s&&(a>n||a<s)&&bu(r,a)};function QL(r){const{slidesGrid:e,params:t}=r,i=r.rtlTranslate?r.translate:-r.translate;let s;for(let n=0;n<e.length;n+=1)typeof e[n+1]<"u"?i>=e[n]&&i<e[n+1]-(e[n+1]-e[n])/2?s=n:i>=e[n]&&i<e[n+1]&&(s=n+1):i>=e[n]&&(s=n);return t.normalizeSlideIndex&&(s<0||typeof s>"u")&&(s=0),s}function JL(r){const e=this,t=e.rtlTranslate?e.translate:-e.translate,{snapGrid:i,params:s,activeIndex:n,realIndex:a,snapIndex:o}=e;let l=r,u;const h=v=>{let y=v-e.virtual.slidesBefore;return y<0&&(y=e.virtual.slides.length+y),y>=e.virtual.slides.length&&(y-=e.virtual.slides.length),y};if(typeof l>"u"&&(l=QL(e)),i.indexOf(t)>=0)u=i.indexOf(t);else{const v=Math.min(s.slidesPerGroupSkip,l);u=v+Math.floor((l-v)/s.slidesPerGroup)}if(u>=i.length&&(u=i.length-1),l===n&&!e.params.loop){u!==o&&(e.snapIndex=u,e.emit("snapIndexChange"));return}if(l===n&&e.params.loop&&e.virtual&&e.params.virtual.enabled){e.realIndex=h(l);return}const f=e.grid&&s.grid&&s.grid.rows>1;let g;if(e.virtual&&s.virtual.enabled&&s.loop)g=h(l);else if(f){const v=e.slides.filter(b=>b.column===l)[0];let y=parseInt(v.getAttribute("data-swiper-slide-index"),10);Number.isNaN(y)&&(y=Math.max(e.slides.indexOf(v),0)),g=Math.floor(y/s.grid.rows)}else if(e.slides[l]){const v=e.slides[l].getAttribute("data-swiper-slide-index");v?g=parseInt(v,10):g=l}else g=l;Object.assign(e,{previousSnapIndex:o,snapIndex:u,previousRealIndex:a,realIndex:g,previousIndex:n,activeIndex:l}),e.initialized&&Eu(e),e.emit("activeIndexChange"),e.emit("snapIndexChange"),(e.initialized||e.params.runCallbacksOnInit)&&(a!==g&&e.emit("realIndexChange"),e.emit("slideChange"))}function ZL(r,e){const t=this,i=t.params;let s=r.closest(`.${i.slideClass}, swiper-slide`);!s&&t.isElement&&e&&e.length>1&&e.includes(r)&&[...e.slice(e.indexOf(r)+1,e.length)].forEach(o=>{!s&&o.matches&&o.matches(`.${i.slideClass}, swiper-slide`)&&(s=o)});let n=!1,a;if(s){for(let o=0;o<t.slides.length;o+=1)if(t.slides[o]===s){n=!0,a=o;break}}if(s&&n)t.clickedSlide=s,t.virtual&&t.params.virtual.enabled?t.clickedIndex=parseInt(s.getAttribute("data-swiper-slide-index"),10):t.clickedIndex=a;else{t.clickedSlide=void 0,t.clickedIndex=void 0;return}i.slideToClickedSlide&&t.clickedIndex!==void 0&&t.clickedIndex!==t.activeIndex&&t.slideToClickedSlide()}var eI={updateSize:HL,updateSlides:KL,updateAutoHeight:zL,updateSlidesOffset:WL,updateSlidesProgress:qL,updateProgress:YL,updateSlidesClasses:XL,updateActiveIndex:JL,updateClickedSlide:ZL};function tI(r){r===void 0&&(r=this.isHorizontal()?"x":"y");const e=this,{params:t,rtlTranslate:i,translate:s,wrapperEl:n}=e;if(t.virtualTranslate)return i?-s:s;if(t.cssMode)return s;let a=kL(n,r);return a+=e.cssOverflowAdjustment(),i&&(a=-a),a||0}function iI(r,e){const t=this,{rtlTranslate:i,params:s,wrapperEl:n,progress:a}=t;let o=0,l=0;const u=0;t.isHorizontal()?o=i?-r:r:l=r,s.roundLengths&&(o=Math.floor(o),l=Math.floor(l)),t.previousTranslate=t.translate,t.translate=t.isHorizontal()?o:l,s.cssMode?n[t.isHorizontal()?"scrollLeft":"scrollTop"]=t.isHorizontal()?-o:-l:s.virtualTranslate||(t.isHorizontal()?o-=t.cssOverflowAdjustment():l-=t.cssOverflowAdjustment(),n.style.transform=`translate3d(${o}px, ${l}px, ${u}px)`);let h;const f=t.maxTranslate()-t.minTranslate();f===0?h=0:h=(r-t.minTranslate())/f,h!==a&&t.updateProgress(r),t.emit("setTranslate",t.translate,e)}function rI(){return-this.snapGrid[0]}function sI(){return-this.snapGrid[this.snapGrid.length-1]}function nI(r,e,t,i,s){r===void 0&&(r=0),e===void 0&&(e=this.params.speed),t===void 0&&(t=!0),i===void 0&&(i=!0);const n=this,{params:a,wrapperEl:o}=n;if(n.animating&&a.preventInteractionOnTransition)return!1;const l=n.minTranslate(),u=n.maxTranslate();let h;if(i&&r>l?h=l:i&&r<u?h=u:h=r,n.updateProgress(h),a.cssMode){const f=n.isHorizontal();if(e===0)o[f?"scrollLeft":"scrollTop"]=-h;else{if(!n.support.smoothScroll)return Hm({swiper:n,targetPosition:-h,side:f?"left":"top"}),!0;o.scrollTo({[f?"left":"top"]:-h,behavior:"smooth"})}return!0}return e===0?(n.setTransition(0),n.setTranslate(h),t&&(n.emit("beforeTransitionStart",e,s),n.emit("transitionEnd"))):(n.setTransition(e),n.setTranslate(h),t&&(n.emit("beforeTransitionStart",e,s),n.emit("transitionStart")),n.animating||(n.animating=!0,n.onTranslateToWrapperTransitionEnd||(n.onTranslateToWrapperTransitionEnd=function(g){!n||n.destroyed||g.target===this&&(n.wrapperEl.removeEventListener("transitionend",n.onTranslateToWrapperTransitionEnd),n.onTranslateToWrapperTransitionEnd=null,delete n.onTranslateToWrapperTransitionEnd,n.animating=!1,t&&n.emit("transitionEnd"))}),n.wrapperEl.addEventListener("transitionend",n.onTranslateToWrapperTransitionEnd))),!0}var aI={getTranslate:tI,setTranslate:iI,minTranslate:rI,maxTranslate:sI,translateTo:nI};function oI(r,e){const t=this;t.params.cssMode||(t.wrapperEl.style.transitionDuration=`${r}ms`,t.wrapperEl.style.transitionDelay=r===0?"0ms":""),t.emit("setTransition",r,e)}function Xm(r){let{swiper:e,runCallbacks:t,direction:i,step:s}=r;const{activeIndex:n,previousIndex:a}=e;let o=i;if(o||(n>a?o="next":n<a?o="prev":o="reset"),e.emit(`transition${s}`),t&&n!==a){if(o==="reset"){e.emit(`slideResetTransition${s}`);return}e.emit(`slideChangeTransition${s}`),o==="next"?e.emit(`slideNextTransition${s}`):e.emit(`slidePrevTransition${s}`)}}function lI(r,e){r===void 0&&(r=!0);const t=this,{params:i}=t;i.cssMode||(i.autoHeight&&t.updateAutoHeight(),Xm({swiper:t,runCallbacks:r,direction:e,step:"Start"}))}function cI(r,e){r===void 0&&(r=!0);const t=this,{params:i}=t;t.animating=!1,!i.cssMode&&(t.setTransition(0),Xm({swiper:t,runCallbacks:r,direction:e,step:"End"}))}var uI={setTransition:oI,transitionStart:lI,transitionEnd:cI};function hI(r,e,t,i,s){r===void 0&&(r=0),t===void 0&&(t=!0),typeof r=="string"&&(r=parseInt(r,10));const n=this;let a=r;a<0&&(a=0);const{params:o,snapGrid:l,slidesGrid:u,previousIndex:h,activeIndex:f,rtlTranslate:g,wrapperEl:v,enabled:y}=n;if(!y&&!i&&!s||n.destroyed||n.animating&&o.preventInteractionOnTransition)return!1;typeof e>"u"&&(e=n.params.speed);const b=Math.min(n.params.slidesPerGroupSkip,a);let E=b+Math.floor((a-b)/n.params.slidesPerGroup);E>=l.length&&(E=l.length-1);const A=-l[E];if(o.normalizeSlideIndex)for(let D=0;D<u.length;D+=1){const B=-Math.floor(A*100),N=Math.floor(u[D]*100),J=Math.floor(u[D+1]*100);typeof u[D+1]<"u"?B>=N&&B<J-(J-N)/2?a=D:B>=N&&B<J&&(a=D+1):B>=N&&(a=D)}if(n.initialized&&a!==f&&(!n.allowSlideNext&&(g?A>n.translate&&A>n.minTranslate():A<n.translate&&A<n.minTranslate())||!n.allowSlidePrev&&A>n.translate&&A>n.maxTranslate()&&(f||0)!==a))return!1;a!==(h||0)&&t&&n.emit("beforeSlideChangeStart"),n.updateProgress(A);let M;if(a>f?M="next":a<f?M="prev":M="reset",g&&-A===n.translate||!g&&A===n.translate)return n.updateActiveIndex(a),o.autoHeight&&n.updateAutoHeight(),n.updateSlidesClasses(),o.effect!=="slide"&&n.setTranslate(A),M!=="reset"&&(n.transitionStart(t,M),n.transitionEnd(t,M)),!1;if(o.cssMode){const D=n.isHorizontal(),B=g?A:-A;if(e===0){const N=n.virtual&&n.params.virtual.enabled;N&&(n.wrapperEl.style.scrollSnapType="none",n._immediateVirtual=!0),N&&!n._cssModeVirtualInitialSet&&n.params.initialSlide>0?(n._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{v[D?"scrollLeft":"scrollTop"]=B})):v[D?"scrollLeft":"scrollTop"]=B,N&&requestAnimationFrame(()=>{n.wrapperEl.style.scrollSnapType="",n._immediateVirtual=!1})}else{if(!n.support.smoothScroll)return Hm({swiper:n,targetPosition:B,side:D?"left":"top"}),!0;v.scrollTo({[D?"left":"top"]:B,behavior:"smooth"})}return!0}return n.setTransition(e),n.setTranslate(A),n.updateActiveIndex(a),n.updateSlidesClasses(),n.emit("beforeTransitionStart",e,i),n.transitionStart(t,M),e===0?n.transitionEnd(t,M):n.animating||(n.animating=!0,n.onSlideToWrapperTransitionEnd||(n.onSlideToWrapperTransitionEnd=function(B){!n||n.destroyed||B.target===this&&(n.wrapperEl.removeEventListener("transitionend",n.onSlideToWrapperTransitionEnd),n.onSlideToWrapperTransitionEnd=null,delete n.onSlideToWrapperTransitionEnd,n.transitionEnd(t,M))}),n.wrapperEl.addEventListener("transitionend",n.onSlideToWrapperTransitionEnd)),!0}function dI(r,e,t,i){r===void 0&&(r=0),t===void 0&&(t=!0),typeof r=="string"&&(r=parseInt(r,10));const s=this;if(s.destroyed)return;typeof e>"u"&&(e=s.params.speed);const n=s.grid&&s.params.grid&&s.params.grid.rows>1;let a=r;if(s.params.loop)if(s.virtual&&s.params.virtual.enabled)a=a+s.virtual.slidesBefore;else{let o;if(n){const g=a*s.params.grid.rows;o=s.slides.filter(v=>v.getAttribute("data-swiper-slide-index")*1===g)[0].column}else o=s.getSlideIndexByData(a);const l=n?Math.ceil(s.slides.length/s.params.grid.rows):s.slides.length,{centeredSlides:u}=s.params;let h=s.params.slidesPerView;h==="auto"?h=s.slidesPerViewDynamic():(h=Math.ceil(parseFloat(s.params.slidesPerView,10)),u&&h%2===0&&(h=h+1));let f=l-o<h;if(u&&(f=f||o<Math.ceil(h/2)),i&&u&&s.params.slidesPerView!=="auto"&&!n&&(f=!1),f){const g=u?o<s.activeIndex?"prev":"next":o-s.activeIndex-1<s.params.slidesPerView?"next":"prev";s.loopFix({direction:g,slideTo:!0,activeSlideIndex:g==="next"?o+1:o-l+1,slideRealIndex:g==="next"?s.realIndex:void 0})}if(n){const g=a*s.params.grid.rows;a=s.slides.filter(v=>v.getAttribute("data-swiper-slide-index")*1===g)[0].column}else a=s.getSlideIndexByData(a)}return requestAnimationFrame(()=>{s.slideTo(a,e,t,i)}),s}function fI(r,e,t){e===void 0&&(e=!0);const i=this,{enabled:s,params:n,animating:a}=i;if(!s||i.destroyed)return i;typeof r>"u"&&(r=i.params.speed);let o=n.slidesPerGroup;n.slidesPerView==="auto"&&n.slidesPerGroup===1&&n.slidesPerGroupAuto&&(o=Math.max(i.slidesPerViewDynamic("current",!0),1));const l=i.activeIndex<n.slidesPerGroupSkip?1:o,u=i.virtual&&n.virtual.enabled;if(n.loop){if(a&&!u&&n.loopPreventsSliding)return!1;if(i.loopFix({direction:"next"}),i._clientLeft=i.wrapperEl.clientLeft,i.activeIndex===i.slides.length-1&&n.cssMode)return requestAnimationFrame(()=>{i.slideTo(i.activeIndex+l,r,e,t)}),!0}return n.rewind&&i.isEnd?i.slideTo(0,r,e,t):i.slideTo(i.activeIndex+l,r,e,t)}function pI(r,e,t){e===void 0&&(e=!0);const i=this,{params:s,snapGrid:n,slidesGrid:a,rtlTranslate:o,enabled:l,animating:u}=i;if(!l||i.destroyed)return i;typeof r>"u"&&(r=i.params.speed);const h=i.virtual&&s.virtual.enabled;if(s.loop){if(u&&!h&&s.loopPreventsSliding)return!1;i.loopFix({direction:"prev"}),i._clientLeft=i.wrapperEl.clientLeft}const f=o?i.translate:-i.translate;function g(A){return A<0?-Math.floor(Math.abs(A)):Math.floor(A)}const v=g(f),y=n.map(A=>g(A));let b=n[y.indexOf(v)-1];if(typeof b>"u"&&s.cssMode){let A;n.forEach((M,D)=>{v>=M&&(A=D)}),typeof A<"u"&&(b=n[A>0?A-1:A])}let E=0;if(typeof b<"u"&&(E=a.indexOf(b),E<0&&(E=i.activeIndex-1),s.slidesPerView==="auto"&&s.slidesPerGroup===1&&s.slidesPerGroupAuto&&(E=E-i.slidesPerViewDynamic("previous",!0)+1,E=Math.max(E,0))),s.rewind&&i.isBeginning){const A=i.params.virtual&&i.params.virtual.enabled&&i.virtual?i.virtual.slides.length-1:i.slides.length-1;return i.slideTo(A,r,e,t)}else if(s.loop&&i.activeIndex===0&&s.cssMode)return requestAnimationFrame(()=>{i.slideTo(E,r,e,t)}),!0;return i.slideTo(E,r,e,t)}function gI(r,e,t){e===void 0&&(e=!0);const i=this;if(!i.destroyed)return typeof r>"u"&&(r=i.params.speed),i.slideTo(i.activeIndex,r,e,t)}function mI(r,e,t,i){e===void 0&&(e=!0),i===void 0&&(i=.5);const s=this;if(s.destroyed)return;typeof r>"u"&&(r=s.params.speed);let n=s.activeIndex;const a=Math.min(s.params.slidesPerGroupSkip,n),o=a+Math.floor((n-a)/s.params.slidesPerGroup),l=s.rtlTranslate?s.translate:-s.translate;if(l>=s.snapGrid[o]){const u=s.snapGrid[o],h=s.snapGrid[o+1];l-u>(h-u)*i&&(n+=s.params.slidesPerGroup)}else{const u=s.snapGrid[o-1],h=s.snapGrid[o];l-u<=(h-u)*i&&(n-=s.params.slidesPerGroup)}return n=Math.max(n,0),n=Math.min(n,s.slidesGrid.length-1),s.slideTo(n,r,e,t)}function vI(){const r=this;if(r.destroyed)return;const{params:e,slidesEl:t}=r,i=e.slidesPerView==="auto"?r.slidesPerViewDynamic():e.slidesPerView;let s=r.clickedIndex,n;const a=r.isElement?"swiper-slide":`.${e.slideClass}`;if(e.loop){if(r.animating)return;n=parseInt(r.clickedSlide.getAttribute("data-swiper-slide-index"),10),e.centeredSlides?s<r.loopedSlides-i/2||s>r.slides.length-r.loopedSlides+i/2?(r.loopFix(),s=r.getSlideIndex(lr(t,`${a}[data-swiper-slide-index="${n}"]`)[0]),gu(()=>{r.slideTo(s)})):r.slideTo(s):s>r.slides.length-i?(r.loopFix(),s=r.getSlideIndex(lr(t,`${a}[data-swiper-slide-index="${n}"]`)[0]),gu(()=>{r.slideTo(s)})):r.slideTo(s)}else r.slideTo(s)}var yI={slideTo:hI,slideToLoop:dI,slideNext:fI,slidePrev:pI,slideReset:gI,slideToClosest:mI,slideToClickedSlide:vI};function SI(r){const e=this,{params:t,slidesEl:i}=e;if(!t.loop||e.virtual&&e.params.virtual.enabled)return;const s=()=>{lr(i,`.${t.slideClass}, swiper-slide`).forEach((f,g)=>{f.setAttribute("data-swiper-slide-index",g)})},n=e.grid&&t.grid&&t.grid.rows>1,a=t.slidesPerGroup*(n?t.grid.rows:1),o=e.slides.length%a!==0,l=n&&e.slides.length%t.grid.rows!==0,u=h=>{for(let f=0;f<h;f+=1){const g=e.isElement?mu("swiper-slide",[t.slideBlankClass]):mu("div",[t.slideClass,t.slideBlankClass]);e.slidesEl.append(g)}};if(o){if(t.loopAddBlankSlides){const h=a-e.slides.length%a;u(h),e.recalcSlides(),e.updateSlides()}else uo("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");s()}else if(l){if(t.loopAddBlankSlides){const h=t.grid.rows-e.slides.length%t.grid.rows;u(h),e.recalcSlides(),e.updateSlides()}else uo("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");s()}else s();e.loopFix({slideRealIndex:r,direction:t.centeredSlides?void 0:"next"})}function xI(r){let{slideRealIndex:e,slideTo:t=!0,direction:i,setTranslate:s,activeSlideIndex:n,byController:a,byMousewheel:o}=r===void 0?{}:r;const l=this;if(!l.params.loop)return;l.emit("beforeLoopFix");const{slides:u,allowSlidePrev:h,allowSlideNext:f,slidesEl:g,params:v}=l,{centeredSlides:y}=v;if(l.allowSlidePrev=!0,l.allowSlideNext=!0,l.virtual&&v.virtual.enabled){t&&(!v.centeredSlides&&l.snapIndex===0?l.slideTo(l.virtual.slides.length,0,!1,!0):v.centeredSlides&&l.snapIndex<v.slidesPerView?l.slideTo(l.virtual.slides.length+l.snapIndex,0,!1,!0):l.snapIndex===l.snapGrid.length-1&&l.slideTo(l.virtual.slidesBefore,0,!1,!0)),l.allowSlidePrev=h,l.allowSlideNext=f,l.emit("loopFix");return}let b=v.slidesPerView;b==="auto"?b=l.slidesPerViewDynamic():(b=Math.ceil(parseFloat(v.slidesPerView,10)),y&&b%2===0&&(b=b+1));const E=v.slidesPerGroupAuto?b:v.slidesPerGroup;let A=E;A%E!==0&&(A+=E-A%E),A+=v.loopAdditionalSlides,l.loopedSlides=A;const M=l.grid&&v.grid&&v.grid.rows>1;u.length<b+A?uo("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled and not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters"):M&&v.grid.fill==="row"&&uo("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");const D=[],B=[];let N=l.activeIndex;typeof n>"u"?n=l.getSlideIndex(u.filter(he=>he.classList.contains(v.slideActiveClass))[0]):N=n;const J=i==="next"||!i,Z=i==="prev"||!i;let se=0,Q=0;const q=M?Math.ceil(u.length/v.grid.rows):u.length,me=(M?u[n].column:n)+(y&&typeof s>"u"?-b/2+.5:0);if(me<A){se=Math.max(A-me,E);for(let he=0;he<A-me;he+=1){const Ee=he-Math.floor(he/q)*q;if(M){const we=q-Ee-1;for(let ue=u.length-1;ue>=0;ue-=1)u[ue].column===we&&D.push(ue)}else D.push(q-Ee-1)}}else if(me+b>q-A){Q=Math.max(me-(q-A*2),E);for(let he=0;he<Q;he+=1){const Ee=he-Math.floor(he/q)*q;M?u.forEach((we,ue)=>{we.column===Ee&&B.push(ue)}):B.push(Ee)}}if(l.__preventObserver__=!0,requestAnimationFrame(()=>{l.__preventObserver__=!1}),Z&&D.forEach(he=>{u[he].swiperLoopMoveDOM=!0,g.prepend(u[he]),u[he].swiperLoopMoveDOM=!1}),J&&B.forEach(he=>{u[he].swiperLoopMoveDOM=!0,g.append(u[he]),u[he].swiperLoopMoveDOM=!1}),l.recalcSlides(),v.slidesPerView==="auto"?l.updateSlides():M&&(D.length>0&&Z||B.length>0&&J)&&l.slides.forEach((he,Ee)=>{l.grid.updateSlide(Ee,he,l.slides)}),v.watchSlidesProgress&&l.updateSlidesOffset(),t){if(D.length>0&&Z){if(typeof e>"u"){const he=l.slidesGrid[N],we=l.slidesGrid[N+se]-he;o?l.setTranslate(l.translate-we):(l.slideTo(N+Math.ceil(se),0,!1,!0),s&&(l.touchEventsData.startTranslate=l.touchEventsData.startTranslate-we,l.touchEventsData.currentTranslate=l.touchEventsData.currentTranslate-we))}else if(s){const he=M?D.length/v.grid.rows:D.length;l.slideTo(l.activeIndex+he,0,!1,!0),l.touchEventsData.currentTranslate=l.translate}}else if(B.length>0&&J)if(typeof e>"u"){const he=l.slidesGrid[N],we=l.slidesGrid[N-Q]-he;o?l.setTranslate(l.translate-we):(l.slideTo(N-Q,0,!1,!0),s&&(l.touchEventsData.startTranslate=l.touchEventsData.startTranslate-we,l.touchEventsData.currentTranslate=l.touchEventsData.currentTranslate-we))}else{const he=M?B.length/v.grid.rows:B.length;l.slideTo(l.activeIndex-he,0,!1,!0)}}if(l.allowSlidePrev=h,l.allowSlideNext=f,l.controller&&l.controller.control&&!a){const he={slideRealIndex:e,direction:i,setTranslate:s,activeSlideIndex:n,byController:!0};Array.isArray(l.controller.control)?l.controller.control.forEach(Ee=>{!Ee.destroyed&&Ee.params.loop&&Ee.loopFix({...he,slideTo:Ee.params.slidesPerView===v.slidesPerView?t:!1})}):l.controller.control instanceof l.constructor&&l.controller.control.params.loop&&l.controller.control.loopFix({...he,slideTo:l.controller.control.params.slidesPerView===v.slidesPerView?t:!1})}l.emit("loopFix")}function bI(){const r=this,{params:e,slidesEl:t}=r;if(!e.loop||r.virtual&&r.params.virtual.enabled)return;r.recalcSlides();const i=[];r.slides.forEach(s=>{const n=typeof s.swiperSlideIndex>"u"?s.getAttribute("data-swiper-slide-index")*1:s.swiperSlideIndex;i[n]=s}),r.slides.forEach(s=>{s.removeAttribute("data-swiper-slide-index")}),i.forEach(s=>{t.append(s)}),r.recalcSlides(),r.slideTo(r.realIndex,0)}var EI={loopCreate:SI,loopFix:xI,loopDestroy:bI};function wI(r){const e=this;if(!e.params.simulateTouch||e.params.watchOverflow&&e.isLocked||e.params.cssMode)return;const t=e.params.touchEventsTarget==="container"?e.el:e.wrapperEl;e.isElement&&(e.__preventObserver__=!0),t.style.cursor="move",t.style.cursor=r?"grabbing":"grab",e.isElement&&requestAnimationFrame(()=>{e.__preventObserver__=!1})}function TI(){const r=this;r.params.watchOverflow&&r.isLocked||r.params.cssMode||(r.isElement&&(r.__preventObserver__=!0),r[r.params.touchEventsTarget==="container"?"el":"wrapperEl"].style.cursor="",r.isElement&&requestAnimationFrame(()=>{r.__preventObserver__=!1}))}var AI={setGrabCursor:wI,unsetGrabCursor:TI};function _I(r,e){e===void 0&&(e=this);function t(i){if(!i||i===Fs()||i===ui())return null;i.assignedSlot&&(i=i.assignedSlot);const s=i.closest(r);return!s&&!i.getRootNode?null:s||t(i.getRootNode().host)}return t(e)}function Qm(r,e,t){const i=ui(),{params:s}=r,n=s.edgeSwipeDetection,a=s.edgeSwipeThreshold;return n&&(t<=a||t>=i.innerWidth-a)?n==="prevent"?(e.preventDefault(),!0):!1:!0}function CI(r){const e=this,t=Fs();let i=r;i.originalEvent&&(i=i.originalEvent);const s=e.touchEventsData;if(i.type==="pointerdown"){if(s.pointerId!==null&&s.pointerId!==i.pointerId)return;s.pointerId=i.pointerId}else i.type==="touchstart"&&i.targetTouches.length===1&&(s.touchId=i.targetTouches[0].identifier);if(i.type==="touchstart"){Qm(e,i,i.targetTouches[0].pageX);return}const{params:n,touches:a,enabled:o}=e;if(!o||!n.simulateTouch&&i.pointerType==="mouse"||e.animating&&n.preventInteractionOnTransition)return;!e.animating&&n.cssMode&&n.loop&&e.loopFix();let l=i.target;if(n.touchEventsTarget==="wrapper"&&!e.wrapperEl.contains(l)||"which"in i&&i.which===3||"button"in i&&i.button>0||s.isTouched&&s.isMoved)return;const u=!!n.noSwipingClass&&n.noSwipingClass!=="",h=i.composedPath?i.composedPath():i.path;u&&i.target&&i.target.shadowRoot&&h&&(l=h[0]);const f=n.noSwipingSelector?n.noSwipingSelector:`.${n.noSwipingClass}`,g=!!(i.target&&i.target.shadowRoot);if(n.noSwiping&&(g?_I(f,l):l.closest(f))){e.allowClick=!0;return}if(n.swipeHandler&&!l.closest(n.swipeHandler))return;a.currentX=i.pageX,a.currentY=i.pageY;const v=a.currentX,y=a.currentY;if(!Qm(e,i,v))return;Object.assign(s,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),a.startX=v,a.startY=y,s.touchStartTime=oo(),e.allowClick=!0,e.updateSize(),e.swipeDirection=void 0,n.threshold>0&&(s.allowThresholdMove=!1);let b=!0;l.matches(s.focusableElements)&&(b=!1,l.nodeName==="SELECT"&&(s.isTouched=!1)),t.activeElement&&t.activeElement.matches(s.focusableElements)&&t.activeElement!==l&&t.activeElement.blur();const E=b&&e.allowTouchMove&&n.touchStartPreventDefault;(n.touchStartForcePreventDefault||E)&&!l.isContentEditable&&i.preventDefault(),n.freeMode&&n.freeMode.enabled&&e.freeMode&&e.animating&&!n.cssMode&&e.freeMode.onTouchStart(),e.emit("touchStart",i)}function LI(r){const e=Fs(),t=this,i=t.touchEventsData,{params:s,touches:n,rtlTranslate:a,enabled:o}=t;if(!o||!s.simulateTouch&&r.pointerType==="mouse")return;let l=r;if(l.originalEvent&&(l=l.originalEvent),l.type==="pointermove"&&(i.touchId!==null||l.pointerId!==i.pointerId))return;let u;if(l.type==="touchmove"){if(u=[...l.changedTouches].filter(J=>J.identifier===i.touchId)[0],!u||u.identifier!==i.touchId)return}else u=l;if(!i.isTouched){i.startMoving&&i.isScrolling&&t.emit("touchMoveOpposite",l);return}const h=u.pageX,f=u.pageY;if(l.preventedByNestedSwiper){n.startX=h,n.startY=f;return}if(!t.allowTouchMove){l.target.matches(i.focusableElements)||(t.allowClick=!1),i.isTouched&&(Object.assign(n,{startX:h,startY:f,currentX:h,currentY:f}),i.touchStartTime=oo());return}if(s.touchReleaseOnEdges&&!s.loop){if(t.isVertical()){if(f<n.startY&&t.translate<=t.maxTranslate()||f>n.startY&&t.translate>=t.minTranslate()){i.isTouched=!1,i.isMoved=!1;return}}else if(h<n.startX&&t.translate<=t.maxTranslate()||h>n.startX&&t.translate>=t.minTranslate())return}if(e.activeElement&&l.target===e.activeElement&&l.target.matches(i.focusableElements)){i.isMoved=!0,t.allowClick=!1;return}i.allowTouchCallbacks&&t.emit("touchMove",l),n.previousX=n.currentX,n.previousY=n.currentY,n.currentX=h,n.currentY=f;const g=n.currentX-n.startX,v=n.currentY-n.startY;if(t.params.threshold&&Math.sqrt(g**2+v**2)<t.params.threshold)return;if(typeof i.isScrolling>"u"){let J;t.isHorizontal()&&n.currentY===n.startY||t.isVertical()&&n.currentX===n.startX?i.isScrolling=!1:g*g+v*v>=25&&(J=Math.atan2(Math.abs(v),Math.abs(g))*180/Math.PI,i.isScrolling=t.isHorizontal()?J>s.touchAngle:90-J>s.touchAngle)}if(i.isScrolling&&t.emit("touchMoveOpposite",l),typeof i.startMoving>"u"&&(n.currentX!==n.startX||n.currentY!==n.startY)&&(i.startMoving=!0),i.isScrolling||l.type==="touchmove"&&i.preventTouchMoveFromPointerMove){i.isTouched=!1;return}if(!i.startMoving)return;t.allowClick=!1,!s.cssMode&&l.cancelable&&l.preventDefault(),s.touchMoveStopPropagation&&!s.nested&&l.stopPropagation();let y=t.isHorizontal()?g:v,b=t.isHorizontal()?n.currentX-n.previousX:n.currentY-n.previousY;s.oneWayMovement&&(y=Math.abs(y)*(a?1:-1),b=Math.abs(b)*(a?1:-1)),n.diff=y,y*=s.touchRatio,a&&(y=-y,b=-b);const E=t.touchesDirection;t.swipeDirection=y>0?"prev":"next",t.touchesDirection=b>0?"prev":"next";const A=t.params.loop&&!s.cssMode,M=t.touchesDirection==="next"&&t.allowSlideNext||t.touchesDirection==="prev"&&t.allowSlidePrev;if(!i.isMoved){if(A&&M&&t.loopFix({direction:t.swipeDirection}),i.startTranslate=t.getTranslate(),t.setTransition(0),t.animating){const J=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0,detail:{bySwiperTouchMove:!0}});t.wrapperEl.dispatchEvent(J)}i.allowMomentumBounce=!1,s.grabCursor&&(t.allowSlideNext===!0||t.allowSlidePrev===!0)&&t.setGrabCursor(!0),t.emit("sliderFirstMove",l)}let D;if(new Date().getTime(),i.isMoved&&i.allowThresholdMove&&E!==t.touchesDirection&&A&&M&&Math.abs(y)>=1){Object.assign(n,{startX:h,startY:f,currentX:h,currentY:f,startTranslate:i.currentTranslate}),i.loopSwapReset=!0,i.startTranslate=i.currentTranslate;return}t.emit("sliderMove",l),i.isMoved=!0,i.currentTranslate=y+i.startTranslate;let B=!0,N=s.resistanceRatio;if(s.touchReleaseOnEdges&&(N=0),y>0?(A&&M&&!D&&i.allowThresholdMove&&i.currentTranslate>(s.centeredSlides?t.minTranslate()-t.slidesSizesGrid[t.activeIndex+1]:t.minTranslate())&&t.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),i.currentTranslate>t.minTranslate()&&(B=!1,s.resistance&&(i.currentTranslate=t.minTranslate()-1+(-t.minTranslate()+i.startTranslate+y)**N))):y<0&&(A&&M&&!D&&i.allowThresholdMove&&i.currentTranslate<(s.centeredSlides?t.maxTranslate()+t.slidesSizesGrid[t.slidesSizesGrid.length-1]:t.maxTranslate())&&t.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:t.slides.length-(s.slidesPerView==="auto"?t.slidesPerViewDynamic():Math.ceil(parseFloat(s.slidesPerView,10)))}),i.currentTranslate<t.maxTranslate()&&(B=!1,s.resistance&&(i.currentTranslate=t.maxTranslate()+1-(t.maxTranslate()-i.startTranslate-y)**N))),B&&(l.preventedByNestedSwiper=!0),!t.allowSlideNext&&t.swipeDirection==="next"&&i.currentTranslate<i.startTranslate&&(i.currentTranslate=i.startTranslate),!t.allowSlidePrev&&t.swipeDirection==="prev"&&i.currentTranslate>i.startTranslate&&(i.currentTranslate=i.startTranslate),!t.allowSlidePrev&&!t.allowSlideNext&&(i.currentTranslate=i.startTranslate),s.threshold>0)if(Math.abs(y)>s.threshold||i.allowThresholdMove){if(!i.allowThresholdMove){i.allowThresholdMove=!0,n.startX=n.currentX,n.startY=n.currentY,i.currentTranslate=i.startTranslate,n.diff=t.isHorizontal()?n.currentX-n.startX:n.currentY-n.startY;return}}else{i.currentTranslate=i.startTranslate;return}!s.followFinger||s.cssMode||((s.freeMode&&s.freeMode.enabled&&t.freeMode||s.watchSlidesProgress)&&(t.updateActiveIndex(),t.updateSlidesClasses()),s.freeMode&&s.freeMode.enabled&&t.freeMode&&t.freeMode.onTouchMove(),t.updateProgress(i.currentTranslate),t.setTranslate(i.currentTranslate))}function II(r){const e=this,t=e.touchEventsData;let i=r;i.originalEvent&&(i=i.originalEvent);let s;if(i.type==="touchend"||i.type==="touchcancel"){if(s=[...i.changedTouches].filter(N=>N.identifier===t.touchId)[0],!s||s.identifier!==t.touchId)return}else{if(t.touchId!==null||i.pointerId!==t.pointerId)return;s=i}if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(i.type)&&!(["pointercancel","contextmenu"].includes(i.type)&&(e.browser.isSafari||e.browser.isWebView)))return;t.pointerId=null,t.touchId=null;const{params:a,touches:o,rtlTranslate:l,slidesGrid:u,enabled:h}=e;if(!h||!a.simulateTouch&&i.pointerType==="mouse")return;if(t.allowTouchCallbacks&&e.emit("touchEnd",i),t.allowTouchCallbacks=!1,!t.isTouched){t.isMoved&&a.grabCursor&&e.setGrabCursor(!1),t.isMoved=!1,t.startMoving=!1;return}a.grabCursor&&t.isMoved&&t.isTouched&&(e.allowSlideNext===!0||e.allowSlidePrev===!0)&&e.setGrabCursor(!1);const f=oo(),g=f-t.touchStartTime;if(e.allowClick){const N=i.path||i.composedPath&&i.composedPath();e.updateClickedSlide(N&&N[0]||i.target,N),e.emit("tap click",i),g<300&&f-t.lastClickTime<300&&e.emit("doubleTap doubleClick",i)}if(t.lastClickTime=oo(),gu(()=>{e.destroyed||(e.allowClick=!0)}),!t.isTouched||!t.isMoved||!e.swipeDirection||o.diff===0&&!t.loopSwapReset||t.currentTranslate===t.startTranslate&&!t.loopSwapReset){t.isTouched=!1,t.isMoved=!1,t.startMoving=!1;return}t.isTouched=!1,t.isMoved=!1,t.startMoving=!1;let v;if(a.followFinger?v=l?e.translate:-e.translate:v=-t.currentTranslate,a.cssMode)return;if(a.freeMode&&a.freeMode.enabled){e.freeMode.onTouchEnd({currentPos:v});return}const y=v>=-e.maxTranslate()&&!e.params.loop;let b=0,E=e.slidesSizesGrid[0];for(let N=0;N<u.length;N+=N<a.slidesPerGroupSkip?1:a.slidesPerGroup){const J=N<a.slidesPerGroupSkip-1?1:a.slidesPerGroup;typeof u[N+J]<"u"?(y||v>=u[N]&&v<u[N+J])&&(b=N,E=u[N+J]-u[N]):(y||v>=u[N])&&(b=N,E=u[u.length-1]-u[u.length-2])}let A=null,M=null;a.rewind&&(e.isBeginning?M=a.virtual&&a.virtual.enabled&&e.virtual?e.virtual.slides.length-1:e.slides.length-1:e.isEnd&&(A=0));const D=(v-u[b])/E,B=b<a.slidesPerGroupSkip-1?1:a.slidesPerGroup;if(g>a.longSwipesMs){if(!a.longSwipes){e.slideTo(e.activeIndex);return}e.swipeDirection==="next"&&(D>=a.longSwipesRatio?e.slideTo(a.rewind&&e.isEnd?A:b+B):e.slideTo(b)),e.swipeDirection==="prev"&&(D>1-a.longSwipesRatio?e.slideTo(b+B):M!==null&&D<0&&Math.abs(D)>a.longSwipesRatio?e.slideTo(M):e.slideTo(b))}else{if(!a.shortSwipes){e.slideTo(e.activeIndex);return}e.navigation&&(i.target===e.navigation.nextEl||i.target===e.navigation.prevEl)?i.target===e.navigation.nextEl?e.slideTo(b+B):e.slideTo(b):(e.swipeDirection==="next"&&e.slideTo(A!==null?A:b+B),e.swipeDirection==="prev"&&e.slideTo(M!==null?M:b))}}function Jm(){const r=this,{params:e,el:t}=r;if(t&&t.offsetWidth===0)return;e.breakpoints&&r.setBreakpoint();const{allowSlideNext:i,allowSlidePrev:s,snapGrid:n}=r,a=r.virtual&&r.params.virtual.enabled;r.allowSlideNext=!0,r.allowSlidePrev=!0,r.updateSize(),r.updateSlides(),r.updateSlidesClasses();const o=a&&e.loop;(e.slidesPerView==="auto"||e.slidesPerView>1)&&r.isEnd&&!r.isBeginning&&!r.params.centeredSlides&&!o?r.slideTo(r.slides.length-1,0,!1,!0):r.params.loop&&!a?r.slideToLoop(r.realIndex,0,!1,!0):r.slideTo(r.activeIndex,0,!1,!0),r.autoplay&&r.autoplay.running&&r.autoplay.paused&&(clearTimeout(r.autoplay.resizeTimeout),r.autoplay.resizeTimeout=setTimeout(()=>{r.autoplay&&r.autoplay.running&&r.autoplay.paused&&r.autoplay.resume()},500)),r.allowSlidePrev=s,r.allowSlideNext=i,r.params.watchOverflow&&n!==r.snapGrid&&r.checkOverflow()}function RI(r){const e=this;e.enabled&&(e.allowClick||(e.params.preventClicks&&r.preventDefault(),e.params.preventClicksPropagation&&e.animating&&(r.stopPropagation(),r.stopImmediatePropagation())))}function PI(){const r=this,{wrapperEl:e,rtlTranslate:t,enabled:i}=r;if(!i)return;r.previousTranslate=r.translate,r.isHorizontal()?r.translate=-e.scrollLeft:r.translate=-e.scrollTop,r.translate===0&&(r.translate=0),r.updateActiveIndex(),r.updateSlidesClasses();let s;const n=r.maxTranslate()-r.minTranslate();n===0?s=0:s=(r.translate-r.minTranslate())/n,s!==r.progress&&r.updateProgress(t?-r.translate:r.translate),r.emit("setTranslate",r.translate,!1)}function kI(r){const e=this;ho(e,r.target),!(e.params.cssMode||e.params.slidesPerView!=="auto"&&!e.params.autoHeight)&&e.update()}function DI(){const r=this;r.documentTouchHandlerProceeded||(r.documentTouchHandlerProceeded=!0,r.params.touchReleaseOnEdges&&(r.el.style.touchAction="auto"))}const Zm=(r,e)=>{const t=Fs(),{params:i,el:s,wrapperEl:n,device:a}=r,o=!!i.nested,l=e==="on"?"addEventListener":"removeEventListener",u=e;t[l]("touchstart",r.onDocumentTouchStart,{passive:!1,capture:o}),s[l]("touchstart",r.onTouchStart,{passive:!1}),s[l]("pointerdown",r.onTouchStart,{passive:!1}),t[l]("touchmove",r.onTouchMove,{passive:!1,capture:o}),t[l]("pointermove",r.onTouchMove,{passive:!1,capture:o}),t[l]("touchend",r.onTouchEnd,{passive:!0}),t[l]("pointerup",r.onTouchEnd,{passive:!0}),t[l]("pointercancel",r.onTouchEnd,{passive:!0}),t[l]("touchcancel",r.onTouchEnd,{passive:!0}),t[l]("pointerout",r.onTouchEnd,{passive:!0}),t[l]("pointerleave",r.onTouchEnd,{passive:!0}),t[l]("contextmenu",r.onTouchEnd,{passive:!0}),(i.preventClicks||i.preventClicksPropagation)&&s[l]("click",r.onClick,!0),i.cssMode&&n[l]("scroll",r.onScroll),i.updateOnWindowResize?r[u](a.ios||a.android?"resize orientationchange observerUpdate":"resize observerUpdate",Jm,!0):r[u]("observerUpdate",Jm,!0),s[l]("load",r.onLoad,{capture:!0})};function OI(){const r=this,{params:e}=r;r.onTouchStart=CI.bind(r),r.onTouchMove=LI.bind(r),r.onTouchEnd=II.bind(r),r.onDocumentTouchStart=DI.bind(r),e.cssMode&&(r.onScroll=PI.bind(r)),r.onClick=RI.bind(r),r.onLoad=kI.bind(r),Zm(r,"on")}function MI(){Zm(this,"off")}var FI={attachEvents:OI,detachEvents:MI};const e0=(r,e)=>r.grid&&e.grid&&e.grid.rows>1;function NI(){const r=this,{realIndex:e,initialized:t,params:i,el:s}=r,n=i.breakpoints;if(!n||n&&Object.keys(n).length===0)return;const a=r.getBreakpoint(n,r.params.breakpointsBase,r.el);if(!a||r.currentBreakpoint===a)return;const l=(a in n?n[a]:void 0)||r.originalParams,u=e0(r,i),h=e0(r,l),f=r.params.grabCursor,g=l.grabCursor,v=i.enabled;u&&!h?(s.classList.remove(`${i.containerModifierClass}grid`,`${i.containerModifierClass}grid-column`),r.emitContainerClasses()):!u&&h&&(s.classList.add(`${i.containerModifierClass}grid`),(l.grid.fill&&l.grid.fill==="column"||!l.grid.fill&&i.grid.fill==="column")&&s.classList.add(`${i.containerModifierClass}grid-column`),r.emitContainerClasses()),f&&!g?r.unsetGrabCursor():!f&&g&&r.setGrabCursor(),["navigation","pagination","scrollbar"].forEach(D=>{if(typeof l[D]>"u")return;const B=i[D]&&i[D].enabled,N=l[D]&&l[D].enabled;B&&!N&&r[D].disable(),!B&&N&&r[D].enable()});const y=l.direction&&l.direction!==i.direction,b=i.loop&&(l.slidesPerView!==i.slidesPerView||y),E=i.loop;y&&t&&r.changeDirection(),hi(r.params,l);const A=r.params.enabled,M=r.params.loop;Object.assign(r,{allowTouchMove:r.params.allowTouchMove,allowSlideNext:r.params.allowSlideNext,allowSlidePrev:r.params.allowSlidePrev}),v&&!A?r.disable():!v&&A&&r.enable(),r.currentBreakpoint=a,r.emit("_beforeBreakpoint",l),t&&(b?(r.loopDestroy(),r.loopCreate(e),r.updateSlides()):!E&&M?(r.loopCreate(e),r.updateSlides()):E&&!M&&r.loopDestroy()),r.emit("breakpoint",l)}function BI(r,e,t){if(e===void 0&&(e="window"),!r||e==="container"&&!t)return;let i=!1;const s=ui(),n=e==="window"?s.innerHeight:t.clientHeight,a=Object.keys(r).map(o=>{if(typeof o=="string"&&o.indexOf("@")===0){const l=parseFloat(o.substr(1));return{value:n*l,point:o}}return{value:o,point:o}});a.sort((o,l)=>parseInt(o.value,10)-parseInt(l.value,10));for(let o=0;o<a.length;o+=1){const{point:l,value:u}=a[o];e==="window"?s.matchMedia(`(min-width: ${u}px)`).matches&&(i=l):u<=t.clientWidth&&(i=l)}return i||"max"}var $I={setBreakpoint:NI,getBreakpoint:BI};function UI(r,e){const t=[];return r.forEach(i=>{typeof i=="object"?Object.keys(i).forEach(s=>{i[s]&&t.push(e+s)}):typeof i=="string"&&t.push(e+i)}),t}function GI(){const r=this,{classNames:e,params:t,rtl:i,el:s,device:n}=r,a=UI(["initialized",t.direction,{"free-mode":r.params.freeMode&&t.freeMode.enabled},{autoheight:t.autoHeight},{rtl:i},{grid:t.grid&&t.grid.rows>1},{"grid-column":t.grid&&t.grid.rows>1&&t.grid.fill==="column"},{android:n.android},{ios:n.ios},{"css-mode":t.cssMode},{centered:t.cssMode&&t.centeredSlides},{"watch-progress":t.watchSlidesProgress}],t.containerModifierClass);e.push(...a),s.classList.add(...e),r.emitContainerClasses()}function VI(){const r=this,{el:e,classNames:t}=r;e.classList.remove(...t),r.emitContainerClasses()}var jI={addClasses:GI,removeClasses:VI};function HI(){const r=this,{isLocked:e,params:t}=r,{slidesOffsetBefore:i}=t;if(i){const s=r.slides.length-1,n=r.slidesGrid[s]+r.slidesSizesGrid[s]+i*2;r.isLocked=r.size>n}else r.isLocked=r.snapGrid.length===1;t.allowSlideNext===!0&&(r.allowSlideNext=!r.isLocked),t.allowSlidePrev===!0&&(r.allowSlidePrev=!r.isLocked),e&&e!==r.isLocked&&(r.isEnd=!1),e!==r.isLocked&&r.emit(r.isLocked?"lock":"unlock")}var KI={checkOverflow:HI},wu={init:!0,direction:"horizontal",oneWayMovement:!1,swiperElementNodeName:"SWIPER-CONTAINER",touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:"swiper",enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-blank",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideFullyVisibleClass:"swiper-slide-fully-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function zI(r,e){return function(i){i===void 0&&(i={});const s=Object.keys(i)[0],n=i[s];if(typeof n!="object"||n===null){hi(e,i);return}if(r[s]===!0&&(r[s]={enabled:!0}),s==="navigation"&&r[s]&&r[s].enabled&&!r[s].prevEl&&!r[s].nextEl&&(r[s].auto=!0),["pagination","scrollbar"].indexOf(s)>=0&&r[s]&&r[s].enabled&&!r[s].el&&(r[s].auto=!0),!(s in r&&"enabled"in n)){hi(e,i);return}typeof r[s]=="object"&&!("enabled"in r[s])&&(r[s].enabled=!0),r[s]||(r[s]={enabled:!1}),hi(e,i)}}const Tu={eventsEmitter:jL,update:eI,translate:aI,transition:uI,slide:yI,loop:EI,grabCursor:AI,events:FI,breakpoints:$I,checkOverflow:KI,classes:jI},Au={};let _u=class Sr{constructor(){let e,t;for(var i=arguments.length,s=new Array(i),n=0;n<i;n++)s[n]=arguments[n];s.length===1&&s[0].constructor&&Object.prototype.toString.call(s[0]).slice(8,-1)==="Object"?t=s[0]:[e,t]=s,t||(t={}),t=hi({},t),e&&!t.el&&(t.el=e);const a=Fs();if(t.el&&typeof t.el=="string"&&a.querySelectorAll(t.el).length>1){const h=[];return a.querySelectorAll(t.el).forEach(f=>{const g=hi({},t,{el:f});h.push(new Sr(g))}),h}const o=this;o.__swiper__=!0,o.support=Wm(),o.device=qm({userAgent:t.userAgent}),o.browser=UL(),o.eventsListeners={},o.eventsAnyListeners=[],o.modules=[...o.__modules__],t.modules&&Array.isArray(t.modules)&&o.modules.push(...t.modules);const l={};o.modules.forEach(h=>{h({params:t,swiper:o,extendParams:zI(t,l),on:o.on.bind(o),once:o.once.bind(o),off:o.off.bind(o),emit:o.emit.bind(o)})});const u=hi({},wu,l);return o.params=hi({},u,Au,t),o.originalParams=hi({},o.params),o.passedParams=hi({},t),o.params&&o.params.on&&Object.keys(o.params.on).forEach(h=>{o.on(h,o.params.on[h])}),o.params&&o.params.onAny&&o.onAny(o.params.onAny),Object.assign(o,{enabled:o.params.enabled,el:e,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return o.params.direction==="horizontal"},isVertical(){return o.params.direction==="vertical"},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:o.params.allowSlideNext,allowSlidePrev:o.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:o.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:o.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),o.emit("_swiper"),o.params.init&&o.init(),o}getDirectionLabel(e){return this.isHorizontal()?e:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[e]}getSlideIndex(e){const{slidesEl:t,params:i}=this,s=lr(t,`.${i.slideClass}, swiper-slide`),n=Km(s[0]);return Km(e)-n}getSlideIndexByData(e){return this.getSlideIndex(this.slides.filter(t=>t.getAttribute("data-swiper-slide-index")*1===e)[0])}recalcSlides(){const e=this,{slidesEl:t,params:i}=e;e.slides=lr(t,`.${i.slideClass}, swiper-slide`)}enable(){const e=this;e.enabled||(e.enabled=!0,e.params.grabCursor&&e.setGrabCursor(),e.emit("enable"))}disable(){const e=this;e.enabled&&(e.enabled=!1,e.params.grabCursor&&e.unsetGrabCursor(),e.emit("disable"))}setProgress(e,t){const i=this;e=Math.min(Math.max(e,0),1);const s=i.minTranslate(),a=(i.maxTranslate()-s)*e+s;i.translateTo(a,typeof t>"u"?0:t),i.updateActiveIndex(),i.updateSlidesClasses()}emitContainerClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=e.el.className.split(" ").filter(i=>i.indexOf("swiper")===0||i.indexOf(e.params.containerModifierClass)===0);e.emit("_containerClasses",t.join(" "))}getSlideClasses(e){const t=this;return t.destroyed?"":e.className.split(" ").filter(i=>i.indexOf("swiper-slide")===0||i.indexOf(t.params.slideClass)===0).join(" ")}emitSlidesClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=[];e.slides.forEach(i=>{const s=e.getSlideClasses(i);t.push({slideEl:i,classNames:s}),e.emit("_slideClass",i,s)}),e.emit("_slideClasses",t)}slidesPerViewDynamic(e,t){e===void 0&&(e="current"),t===void 0&&(t=!1);const i=this,{params:s,slides:n,slidesGrid:a,slidesSizesGrid:o,size:l,activeIndex:u}=i;let h=1;if(typeof s.slidesPerView=="number")return s.slidesPerView;if(s.centeredSlides){let f=n[u]?Math.ceil(n[u].swiperSlideSize):0,g;for(let v=u+1;v<n.length;v+=1)n[v]&&!g&&(f+=Math.ceil(n[v].swiperSlideSize),h+=1,f>l&&(g=!0));for(let v=u-1;v>=0;v-=1)n[v]&&!g&&(f+=n[v].swiperSlideSize,h+=1,f>l&&(g=!0))}else if(e==="current")for(let f=u+1;f<n.length;f+=1)(t?a[f]+o[f]-a[u]<l:a[f]-a[u]<l)&&(h+=1);else for(let f=u-1;f>=0;f-=1)a[u]-a[f]<l&&(h+=1);return h}update(){const e=this;if(!e||e.destroyed)return;const{snapGrid:t,params:i}=e;i.breakpoints&&e.setBreakpoint(),[...e.el.querySelectorAll('[loading="lazy"]')].forEach(a=>{a.complete&&ho(e,a)}),e.updateSize(),e.updateSlides(),e.updateProgress(),e.updateSlidesClasses();function s(){const a=e.rtlTranslate?e.translate*-1:e.translate,o=Math.min(Math.max(a,e.maxTranslate()),e.minTranslate());e.setTranslate(o),e.updateActiveIndex(),e.updateSlidesClasses()}let n;if(i.freeMode&&i.freeMode.enabled&&!i.cssMode)s(),i.autoHeight&&e.updateAutoHeight();else{if((i.slidesPerView==="auto"||i.slidesPerView>1)&&e.isEnd&&!i.centeredSlides){const a=e.virtual&&i.virtual.enabled?e.virtual.slides:e.slides;n=e.slideTo(a.length-1,0,!1,!0)}else n=e.slideTo(e.activeIndex,0,!1,!0);n||s()}i.watchOverflow&&t!==e.snapGrid&&e.checkOverflow(),e.emit("update")}changeDirection(e,t){t===void 0&&(t=!0);const i=this,s=i.params.direction;return e||(e=s==="horizontal"?"vertical":"horizontal"),e===s||e!=="horizontal"&&e!=="vertical"||(i.el.classList.remove(`${i.params.containerModifierClass}${s}`),i.el.classList.add(`${i.params.containerModifierClass}${e}`),i.emitContainerClasses(),i.params.direction=e,i.slides.forEach(n=>{e==="vertical"?n.style.width="":n.style.height=""}),i.emit("changeDirection"),t&&i.update()),i}changeLanguageDirection(e){const t=this;t.rtl&&e==="rtl"||!t.rtl&&e==="ltr"||(t.rtl=e==="rtl",t.rtlTranslate=t.params.direction==="horizontal"&&t.rtl,t.rtl?(t.el.classList.add(`${t.params.containerModifierClass}rtl`),t.el.dir="rtl"):(t.el.classList.remove(`${t.params.containerModifierClass}rtl`),t.el.dir="ltr"),t.update())}mount(e){const t=this;if(t.mounted)return!0;let i=e||t.params.el;if(typeof i=="string"&&(i=document.querySelector(i)),!i)return!1;i.swiper=t,i.parentNode&&i.parentNode.host&&i.parentNode.host.nodeName===t.params.swiperElementNodeName.toUpperCase()&&(t.isElement=!0);const s=()=>`.${(t.params.wrapperClass||"").trim().split(" ").join(".")}`;let a=i&&i.shadowRoot&&i.shadowRoot.querySelector?i.shadowRoot.querySelector(s()):lr(i,s())[0];return!a&&t.params.createElements&&(a=mu("div",t.params.wrapperClass),i.append(a),lr(i,`.${t.params.slideClass}`).forEach(o=>{a.append(o)})),Object.assign(t,{el:i,wrapperEl:a,slidesEl:t.isElement&&!i.parentNode.host.slideSlots?i.parentNode.host:a,hostEl:t.isElement?i.parentNode.host:i,mounted:!0,rtl:i.dir.toLowerCase()==="rtl"||Lr(i,"direction")==="rtl",rtlTranslate:t.params.direction==="horizontal"&&(i.dir.toLowerCase()==="rtl"||Lr(i,"direction")==="rtl"),wrongRTL:Lr(a,"display")==="-webkit-box"}),!0}init(e){const t=this;if(t.initialized||t.mount(e)===!1)return t;t.emit("beforeInit"),t.params.breakpoints&&t.setBreakpoint(),t.addClasses(),t.updateSize(),t.updateSlides(),t.params.watchOverflow&&t.checkOverflow(),t.params.grabCursor&&t.enabled&&t.setGrabCursor(),t.params.loop&&t.virtual&&t.params.virtual.enabled?t.slideTo(t.params.initialSlide+t.virtual.slidesBefore,0,t.params.runCallbacksOnInit,!1,!0):t.slideTo(t.params.initialSlide,0,t.params.runCallbacksOnInit,!1,!0),t.params.loop&&t.loopCreate(),t.attachEvents();const s=[...t.el.querySelectorAll('[loading="lazy"]')];return t.isElement&&s.push(...t.hostEl.querySelectorAll('[loading="lazy"]')),s.forEach(n=>{n.complete?ho(t,n):n.addEventListener("load",a=>{ho(t,a.target)})}),Eu(t),t.initialized=!0,Eu(t),t.emit("init"),t.emit("afterInit"),t}destroy(e,t){e===void 0&&(e=!0),t===void 0&&(t=!0);const i=this,{params:s,el:n,wrapperEl:a,slides:o}=i;return typeof i.params>"u"||i.destroyed||(i.emit("beforeDestroy"),i.initialized=!1,i.detachEvents(),s.loop&&i.loopDestroy(),t&&(i.removeClasses(),n.removeAttribute("style"),a.removeAttribute("style"),o&&o.length&&o.forEach(l=>{l.classList.remove(s.slideVisibleClass,s.slideFullyVisibleClass,s.slideActiveClass,s.slideNextClass,s.slidePrevClass),l.removeAttribute("style"),l.removeAttribute("data-swiper-slide-index")})),i.emit("destroy"),Object.keys(i.eventsListeners).forEach(l=>{i.off(l)}),e!==!1&&(i.el.swiper=null,RL(i)),i.destroyed=!0),null}static extendDefaults(e){hi(Au,e)}static get extendedDefaults(){return Au}static get defaults(){return wu}static installModule(e){Sr.prototype.__modules__||(Sr.prototype.__modules__=[]);const t=Sr.prototype.__modules__;typeof e=="function"&&t.indexOf(e)<0&&t.push(e)}static use(e){return Array.isArray(e)?(e.forEach(t=>Sr.installModule(t)),Sr):(Sr.installModule(e),Sr)}};Object.keys(Tu).forEach(r=>{Object.keys(Tu[r]).forEach(e=>{_u.prototype[e]=Tu[r][e]})}),_u.use([GL,VL]);const t0=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","swiperElementNodeName","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","breakpointsBase","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopAdditionalSlides","loopAddBlankSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideFullyVisibleClass","slideNextClass","slidePrevClass","slideBlankClass","wrapperClass","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function rs(r){return typeof r=="object"&&r!==null&&r.constructor&&Object.prototype.toString.call(r).slice(8,-1)==="Object"&&!r.__swiper__}function Ns(r,e){const t=["__proto__","constructor","prototype"];Object.keys(e).filter(i=>t.indexOf(i)<0).forEach(i=>{typeof r[i]>"u"?r[i]=e[i]:rs(e[i])&&rs(r[i])&&Object.keys(e[i]).length>0?e[i].__swiper__?r[i]=e[i]:Ns(r[i],e[i]):r[i]=e[i]})}function i0(r){return r===void 0&&(r={}),r.navigation&&typeof r.navigation.nextEl>"u"&&typeof r.navigation.prevEl>"u"}function r0(r){return r===void 0&&(r={}),r.pagination&&typeof r.pagination.el>"u"}function s0(r){return r===void 0&&(r={}),r.scrollbar&&typeof r.scrollbar.el>"u"}function n0(r){r===void 0&&(r="");const e=r.split(" ").map(i=>i.trim()).filter(i=>!!i),t=[];return e.forEach(i=>{t.indexOf(i)<0&&t.push(i)}),t.join(" ")}function WI(r){return r===void 0&&(r=""),r?r.includes("swiper-wrapper")?r:`swiper-wrapper ${r}`:"swiper-wrapper"}function qI(r){let{swiper:e,slides:t,passedParams:i,changedParams:s,nextEl:n,prevEl:a,scrollbarEl:o,paginationEl:l}=r;const u=s.filter(Q=>Q!=="children"&&Q!=="direction"&&Q!=="wrapperClass"),{params:h,pagination:f,navigation:g,scrollbar:v,virtual:y,thumbs:b}=e;let E,A,M,D,B,N,J,Z;s.includes("thumbs")&&i.thumbs&&i.thumbs.swiper&&h.thumbs&&!h.thumbs.swiper&&(E=!0),s.includes("controller")&&i.controller&&i.controller.control&&h.controller&&!h.controller.control&&(A=!0),s.includes("pagination")&&i.pagination&&(i.pagination.el||l)&&(h.pagination||h.pagination===!1)&&f&&!f.el&&(M=!0),s.includes("scrollbar")&&i.scrollbar&&(i.scrollbar.el||o)&&(h.scrollbar||h.scrollbar===!1)&&v&&!v.el&&(D=!0),s.includes("navigation")&&i.navigation&&(i.navigation.prevEl||a)&&(i.navigation.nextEl||n)&&(h.navigation||h.navigation===!1)&&g&&!g.prevEl&&!g.nextEl&&(B=!0);const se=Q=>{e[Q]&&(e[Q].destroy(),Q==="navigation"?(e.isElement&&(e[Q].prevEl.remove(),e[Q].nextEl.remove()),h[Q].prevEl=void 0,h[Q].nextEl=void 0,e[Q].prevEl=void 0,e[Q].nextEl=void 0):(e.isElement&&e[Q].el.remove(),h[Q].el=void 0,e[Q].el=void 0))};s.includes("loop")&&e.isElement&&(h.loop&&!i.loop?N=!0:!h.loop&&i.loop?J=!0:Z=!0),u.forEach(Q=>{if(rs(h[Q])&&rs(i[Q]))Object.assign(h[Q],i[Q]),(Q==="navigation"||Q==="pagination"||Q==="scrollbar")&&"enabled"in i[Q]&&!i[Q].enabled&&se(Q);else{const q=i[Q];(q===!0||q===!1)&&(Q==="navigation"||Q==="pagination"||Q==="scrollbar")?q===!1&&se(Q):h[Q]=i[Q]}}),u.includes("controller")&&!A&&e.controller&&e.controller.control&&h.controller&&h.controller.control&&(e.controller.control=h.controller.control),s.includes("children")&&t&&y&&h.virtual.enabled?(y.slides=t,y.update(!0)):s.includes("virtual")&&y&&h.virtual.enabled&&(t&&(y.slides=t),y.update(!0)),s.includes("children")&&t&&h.loop&&(Z=!0),E&&b.init()&&b.update(!0),A&&(e.controller.control=h.controller.control),M&&(e.isElement&&(!l||typeof l=="string")&&(l=document.createElement("div"),l.classList.add("swiper-pagination"),l.part.add("pagination"),e.el.appendChild(l)),l&&(h.pagination.el=l),f.init(),f.render(),f.update()),D&&(e.isElement&&(!o||typeof o=="string")&&(o=document.createElement("div"),o.classList.add("swiper-scrollbar"),o.part.add("scrollbar"),e.el.appendChild(o)),o&&(h.scrollbar.el=o),v.init(),v.updateSize(),v.setTranslate()),B&&(e.isElement&&((!n||typeof n=="string")&&(n=document.createElement("div"),n.classList.add("swiper-button-next"),n.innerHTML=e.hostEl.constructor.nextButtonSvg,n.part.add("button-next"),e.el.appendChild(n)),(!a||typeof a=="string")&&(a=document.createElement("div"),a.classList.add("swiper-button-prev"),a.innerHTML=e.hostEl.constructor.prevButtonSvg,a.part.add("button-prev"),e.el.appendChild(a))),n&&(h.navigation.nextEl=n),a&&(h.navigation.prevEl=a),g.init(),g.update()),s.includes("allowSlideNext")&&(e.allowSlideNext=i.allowSlideNext),s.includes("allowSlidePrev")&&(e.allowSlidePrev=i.allowSlidePrev),s.includes("direction")&&e.changeDirection(i.direction,!1),(N||Z)&&e.loopDestroy(),(J||Z)&&e.loopCreate(),e.update()}function YI(r,e){r===void 0&&(r={}),e===void 0&&(e=!0);const t={on:{}},i={},s={};Ns(t,wu),t._emitClasses=!0,t.init=!1;const n={},a=t0.map(l=>l.replace(/_/,"")),o=Object.assign({},r);return Object.keys(o).forEach(l=>{typeof r[l]>"u"||(a.indexOf(l)>=0?rs(r[l])?(t[l]={},s[l]={},Ns(t[l],r[l]),Ns(s[l],r[l])):(t[l]=r[l],s[l]=r[l]):l.search(/on[A-Z]/)===0&&typeof r[l]=="function"?e?i[`${l[2].toLowerCase()}${l.substr(3)}`]=r[l]:t.on[`${l[2].toLowerCase()}${l.substr(3)}`]=r[l]:n[l]=r[l])}),["navigation","pagination","scrollbar"].forEach(l=>{t[l]===!0&&(t[l]={}),t[l]===!1&&delete t[l]}),{params:t,passedParams:s,rest:n,events:i}}function XI(r,e){let{el:t,nextEl:i,prevEl:s,paginationEl:n,scrollbarEl:a,swiper:o}=r;i0(e)&&i&&s&&(o.params.navigation.nextEl=i,o.originalParams.navigation.nextEl=i,o.params.navigation.prevEl=s,o.originalParams.navigation.prevEl=s),r0(e)&&n&&(o.params.pagination.el=n,o.originalParams.pagination.el=n),s0(e)&&a&&(o.params.scrollbar.el=a,o.originalParams.scrollbar.el=a),o.init(t)}function QI(r,e,t,i,s){const n=[];if(!e)return n;const a=l=>{n.indexOf(l)<0&&n.push(l)};if(t&&i){const l=i.map(s),u=t.map(s);l.join("")!==u.join("")&&a("children"),i.length!==t.length&&a("children")}return t0.filter(l=>l[0]==="_").map(l=>l.replace(/_/,"")).forEach(l=>{if(l in r&&l in e)if(rs(r[l])&&rs(e[l])){const u=Object.keys(r[l]),h=Object.keys(e[l]);u.length!==h.length?a(l):(u.forEach(f=>{r[l][f]!==e[l][f]&&a(l)}),h.forEach(f=>{r[l][f]!==e[l][f]&&a(l)}))}else r[l]!==e[l]&&a(l)}),n}const JI=r=>{!r||r.destroyed||!r.params.virtual||r.params.virtual&&!r.params.virtual.enabled||(r.updateSlides(),r.updateProgress(),r.updateSlidesClasses(),r.parallax&&r.params.parallax&&r.params.parallax.enabled&&r.parallax.setTranslate())};function fo(){return fo=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},fo.apply(this,arguments)}function a0(r){return r.type&&r.type.displayName&&r.type.displayName.includes("SwiperSlide")}function o0(r){const e=[];return de.Children.toArray(r).forEach(t=>{a0(t)?e.push(t):t.props&&t.props.children&&o0(t.props.children).forEach(i=>e.push(i))}),e}function ZI(r){const e=[],t={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return de.Children.toArray(r).forEach(i=>{if(a0(i))e.push(i);else if(i.props&&i.props.slot&&t[i.props.slot])t[i.props.slot].push(i);else if(i.props&&i.props.children){const s=o0(i.props.children);s.length>0?s.forEach(n=>e.push(n)):t["container-end"].push(i)}else t["container-end"].push(i)}),{slides:e,slots:t}}function eR(r,e,t){if(!t)return null;const i=h=>{let f=h;return h<0?f=e.length+h:f>=e.length&&(f=f-e.length),f},s=r.isHorizontal()?{[r.rtlTranslate?"right":"left"]:`${t.offset}px`}:{top:`${t.offset}px`},{from:n,to:a}=t,o=r.params.loop?-e.length:0,l=r.params.loop?e.length*2:e.length,u=[];for(let h=o;h<l;h+=1)h>=n&&h<=a&&u.push(e[i(h)]);return u.map((h,f)=>de.cloneElement(h,{swiper:r,style:s,key:h.props.virtualIndex||h.key||`slide-${f}`}))}function Gn(r,e){return typeof window>"u"?de.useEffect(r,e):de.useLayoutEffect(r,e)}const l0=de.createContext(null),tR=de.createContext(null),iR=de.forwardRef(function(r,e){let{className:t,tag:i="div",wrapperTag:s="div",children:n,onSwiper:a,...o}=r===void 0?{}:r,l=!1;const[u,h]=de.useState("swiper"),[f,g]=de.useState(null),[v,y]=de.useState(!1),b=de.useRef(!1),E=de.useRef(null),A=de.useRef(null),M=de.useRef(null),D=de.useRef(null),B=de.useRef(null),N=de.useRef(null),J=de.useRef(null),Z=de.useRef(null),{params:se,passedParams:Q,rest:q,events:oe}=YI(o),{slides:me,slots:he}=ZI(n),Ee=()=>{y(!v)};Object.assign(se.on,{_containerClasses(ve,Se){h(Se)}});const we=()=>{Object.assign(se.on,oe),l=!0;const ve={...se};if(delete ve.wrapperClass,A.current=new _u(ve),A.current.virtual&&A.current.params.virtual.enabled){A.current.virtual.slides=me;const Se={cache:!1,slides:me,renderExternal:g,renderExternalUpdate:!1};Ns(A.current.params.virtual,Se),Ns(A.current.originalParams.virtual,Se)}};E.current||we(),A.current&&A.current.on("_beforeBreakpoint",Ee);const ue=()=>{l||!oe||!A.current||Object.keys(oe).forEach(ve=>{A.current.on(ve,oe[ve])})},ge=()=>{!oe||!A.current||Object.keys(oe).forEach(ve=>{A.current.off(ve,oe[ve])})};de.useEffect(()=>()=>{A.current&&A.current.off("_beforeBreakpoint",Ee)}),de.useEffect(()=>{!b.current&&A.current&&(A.current.emitSlidesClasses(),b.current=!0)}),Gn(()=>{if(e&&(e.current=E.current),!!E.current)return A.current.destroyed&&we(),XI({el:E.current,nextEl:B.current,prevEl:N.current,paginationEl:J.current,scrollbarEl:Z.current,swiper:A.current},se),a&&!A.current.destroyed&&a(A.current),()=>{A.current&&!A.current.destroyed&&A.current.destroy(!0,!1)}},[]),Gn(()=>{ue();const ve=QI(Q,M.current,me,D.current,Se=>Se.key);return M.current=Q,D.current=me,ve.length&&A.current&&!A.current.destroyed&&qI({swiper:A.current,slides:me,passedParams:Q,changedParams:ve,nextEl:B.current,prevEl:N.current,scrollbarEl:Z.current,paginationEl:J.current}),()=>{ge()}}),Gn(()=>{JI(A.current)},[f]);function Ce(){return se.virtual?eR(A.current,me,f):me.map((ve,Se)=>de.cloneElement(ve,{swiper:A.current,swiperSlideIndex:Se}))}return de.createElement(i,fo({ref:E,className:n0(`${u}${t?` ${t}`:""}`)},q),de.createElement(tR.Provider,{value:A.current},he["container-start"],de.createElement(s,{className:WI(se.wrapperClass)},he["wrapper-start"],Ce(),he["wrapper-end"]),i0(se)&&de.createElement(de.Fragment,null,de.createElement("div",{ref:N,className:"swiper-button-prev"}),de.createElement("div",{ref:B,className:"swiper-button-next"})),s0(se)&&de.createElement("div",{ref:Z,className:"swiper-scrollbar"}),r0(se)&&de.createElement("div",{ref:J,className:"swiper-pagination"}),he["container-end"]))});iR.displayName="Swiper";const rR=de.forwardRef(function(r,e){let{tag:t="div",children:i,className:s="",swiper:n,zoom:a,lazy:o,virtualIndex:l,swiperSlideIndex:u,...h}=r===void 0?{}:r;const f=de.useRef(null),[g,v]=de.useState("swiper-slide"),[y,b]=de.useState(!1);function E(B,N,J){N===f.current&&v(J)}Gn(()=>{if(typeof u<"u"&&(f.current.swiperSlideIndex=u),e&&(e.current=f.current),!(!f.current||!n)){if(n.destroyed){g!=="swiper-slide"&&v("swiper-slide");return}return n.on("_slideClass",E),()=>{n&&n.off("_slideClass",E)}}}),Gn(()=>{n&&f.current&&!n.destroyed&&v(n.getSlideClasses(f.current))},[n]);const A={isActive:g.indexOf("swiper-slide-active")>=0,isVisible:g.indexOf("swiper-slide-visible")>=0,isPrev:g.indexOf("swiper-slide-prev")>=0,isNext:g.indexOf("swiper-slide-next")>=0},M=()=>typeof i=="function"?i(A):i,D=()=>{b(!0)};return de.createElement(t,fo({ref:f,className:n0(`${g}${s?` ${s}`:""}`),"data-swiper-slide-index":l,onLoad:D},h),a&&de.createElement(l0.Provider,{value:A},de.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":typeof a=="number"?a:void 0},M(),o&&!y&&de.createElement("div",{className:"swiper-lazy-preloader"}))),!a&&de.createElement(l0.Provider,{value:A},M(),o&&!y&&de.createElement("div",{className:"swiper-lazy-preloader"})))});rR.displayName="SwiperSlide";function Cu(r){this.message=r}Cu.prototype=new Error,Cu.prototype.name="InvalidCharacterError";var c0=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(r){var e=String(r).replace(/=+$/,"");if(e.length%4==1)throw new Cu("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,s=0,n=0,a="";i=e.charAt(n++);~i&&(t=s%4?64*t+i:i,s++%4)?a+=String.fromCharCode(255&t>>(-2*s&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return a};function sR(r){var e=r.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return function(t){return decodeURIComponent(c0(t).replace(/(.)/g,function(i,s){var n=s.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}(e)}catch{return c0(e)}}function po(r){this.message=r}function u0(r,e){if(typeof r!="string")throw new po("Invalid token specified");var t=(e=e||{}).header===!0?0:1;try{return JSON.parse(sR(r.split(".")[t]))}catch(i){throw new po("Invalid token specified: "+i.message)}}po.prototype=new Error,po.prototype.name="InvalidTokenError";const nR={dev:"https://dev.api.brixcloud.io/v1",stage:"https://stage.api.brixcloud.io/v1",prod:"https://api.brixcloud.io/v1"},aR={dev:"https://dev.auth.brixcloud.io/v1",stage:"https://stage.auth.brixcloud.io/v1",prod:"https://auth.brixcloud.io/v1"},oR=async({id:r,env:e})=>{const t=await fetch(nR[e]+`/public/ugc/${r}`),i=await t.json();if(!t.ok)throw i;return i},lR=async({clientId:r,token:e,env:t})=>{const i=`__brix_session_token_${r}`,s="__brix_session_api_status";let n=e??localStorage.getItem(i);if(n)try{u0(n).exp*1e3-Date.now()<0&&(n=null)}catch{n=null}if(!n)if(sessionStorage.getItem(s)==="pending")for(;sessionStorage.getItem(s)==="pending";)await new Promise(o=>setTimeout(o,100)),n=localStorage.getItem(i);else try{sessionStorage.setItem(i,"pending"),n=(await(await fetch(aR[t]+"/auth/token/guest",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({partner:r})})).json()).accessToken}finally{sessionStorage.setItem(i,"success")}return localStorage.setItem(i,n),u0(n)},h0=(r,e=!1)=>{const[t,i]=de.useState(null),[s,n]=de.useState(null);return de.useEffect(()=>{if(e)return;(async()=>{try{const o=await r();i(o),n(null)}catch(o){i(null),n(o.message)}})()},[r,e]),{data:t,error:s}};function cR({id:r,env:e,token:t,style:i}){var Z,se;const[s,n]=de.useState(),[a,o]=de.useState(60),[l,u]=de.useState(!0),[h,f]=de.useState(!1),{data:g}=h0(de.useCallback(()=>oR({id:r,env:e}),[r,e]),!r),{data:v}=h0(de.useCallback(()=>{var Q;return lR({clientId:(Q=g==null?void 0:g.client)==null?void 0:Q.id,env:e,token:t})},[(Z=g==null?void 0:g.client)==null?void 0:Z.id,e,t]),!((se=g==null?void 0:g.client)!=null&&se.id)),y=de.useRef(null),b=tw({ref:y,threshold:1}),E=de.useCallback(Q=>{n(Q)},[]),A=de.useCallback(()=>{n(void 0)},[]),M=()=>{s&&s.play()},D=()=>{s&&s.pause()},B=(Q,q)=>{if(Q.stopPropagation(),!s)return;const oe=q*s.duration/100;s.currentTime=oe},N=Q=>{Q.stopPropagation(),s&&(s.muted=!s.muted,u(s.muted))},J=de.useMemo(()=>new YE({identityPoolId:ep[e].identityPoolId,streamName:ep[e].streamName}),[e]);return de.useEffect(()=>{if(!s)return;const Q=he=>{const Ee=he.target;o(Ee.currentTime/Ee.duration*100)},q=()=>{f(!0),J.start()},oe=()=>{f(!1),J.stop()},me=()=>{s.pause()};return s.addEventListener("loadedmetadata",me),s.addEventListener("timeupdate",Q),s.addEventListener("play",q),s.addEventListener("pause",oe),()=>{s.removeEventListener("loadedmetadata",me),s.removeEventListener("timeupdate",Q),s.removeEventListener("play",q),s.removeEventListener("pause",oe)}},[s,J]),de.useEffect(()=>{b||s==null||s.pause()},[b,s]),de.useEffect(()=>{!v||!r||(J.setType("ugc"),J.setId(r),J.setUser(v.userId,v.role),J.stop())},[J,v,r]),We.jsx(QE,{kinesis:J,children:We.jsxs("div",{ref:y,className:`${Hr.root}`,style:i,children:[We.jsx(CL,{ratio:!0,className:Hr.player,controls:!1,src:g==null?void 0:g.playUrl,onInit:E,onDestroy:A}),!h&&We.jsx("div",{className:Hr.play_button,onClick:M,children:We.jsx(Un,{className:Hr.play_icon,name:"IoPlay"})}),h&&We.jsx("div",{className:Hr.pause_button,onClick:D}),We.jsx("div",{className:Hr.mute_button,onClick:N,children:We.jsx(Un,{name:l?"IoVolumeMute":"IoVolumeHigh"})}),We.jsx(mm,{className:Hr.progress,progress:a,onChangeProgress:B})]})})}const d0=Object.freeze(Object.defineProperty({__proto__:null,CognitoIdentityClient:Xf,GetCredentialsForIdentityCommand:WE,GetIdCommand:qE},Symbol.toStringTag,{value:"Module"}));ni.PlayerUser=cR,Object.defineProperty(ni,Symbol.toStringTag,{value:"Module"})});
|
|
148
|
-
//# sourceMappingURL=index.umd.js.map
|